diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000000000000000000000000000000000000..aa11892fa6a90593c848a84833f861dd7025fd80
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,37 @@
+job1:
+  script:
+   - echo $PWD
+   - echo $USER
+   - echo $OAI_USER
+   - echo $OAI_EXTRA_ARGS
+   - echo $NFS_SHARE_DIR
+   - echo $EXTERNAL_SHARE_DIR
+   - echo $SHELL
+   - echo $OAI_TEST_CASE_GROUP
+   - echo $MACHINELIST
+   - echo $MACHINELISTGENERIC
+   - git rev-parse --abbrev-ref HEAD
+   - git_repo=`git config --get remote.origin.url`
+   - git_head=`git rev-parse HEAD`
+   - echo $git_head
+   - tmp=`git show-ref --head | grep $git_head`
+   - tmp=(${tmp///// })
+   - git_branch=${tmp[@]:(-1)}
+   - echo $git_branch
+   - source oaienv
+   - echo $OPENAIR_DIR
+   - NFS_TEST_RESULTS_DIR=$NFS_SHARE_DIR/$git_branch/$git_head
+   - EXTERNAL_SHARE_RESULTS_DIR=$EXTERNAL_SHARE_DIR/$git_branch/$git_head
+   - echo $NFS_TEST_RESULTS_DIR
+   - echo $EXTERNAL_SHARE_RESULTS_DIR
+   - echo $NRUNS_LTE_SOFTMODEM
+   - echo $TIMEOUT_CMD
+   - mkdir -p $OPENAIR_DIR/cmake_targets/autotests/log
+   - python $OPENAIR_DIR/cmake_targets/autotests/run_exec_lte-softmodem_tests.py -c -5GRepo $git_repo -MachineList "$MACHINELIST" -MachineListGeneric "$MACHINELISTGENERIC"  -5GRepoHeadVersion $git_head -n $NFS_SHARE_DIR -u $OAI_USER -p $OAI_PASS  $OAI_EXTRA_ARGS -g "$OAI_TEST_CASE_GROUP">& $OPENAIR_DIR/cmake_targets/autotests/python_autotest_cleanup.log
+   - python $OPENAIR_DIR/cmake_targets/autotests/run_exec_lte-softmodem_tests.py -r -5GRepo $git_repo -MachineList "$MACHINELIST" -MachineListGeneric "$MACHINELISTGENERIC" -5GRepoHeadVersion $git_head -n $NFS_SHARE_DIR -u $OAI_USER -p $OAI_PASS `echo $OAI_EXTRA_ARGS` -g "$OAI_TEST_CASE_GROUP" --nrun_lte_softmodem $NRUNS_LTE_SOFTMODEM --timeout_cmd $TIMEOUT_CMD >& $OPENAIR_DIR/cmake_targets/autotests/python_autotest.log
+   - mv $OPENAIR_DIR/cmake_targets/autotests/python_autotest.log $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest.log
+   - mv $OPENAIR_DIR/cmake_targets/autotests/python_autotest_cleanup.log $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest_cleanup.log
+   - sshpass -p "$OAI_PASS" rsync -az -e "ssh -o StrictHostKeyChecking=no "  --rsync-path="mkdir -p $NFS_TEST_RESULTS_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$NFS_TEST_RESULTS_DIR
+   - sshpass -p "$OAI_PASS" rsync -az -e "ssh -o StrictHostKeyChecking=no "  --rsync-path="mkdir -p $EXTERNAL_SHARE_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$EXTERNAL_SHARE_DIR
+   - cat $OPENAIR_DIR/cmake_targets/autotests/log/results_autotests.xml
+  when: manual  
diff --git a/README.txt b/README.txt
index 2ff2e02190d5b2c628e793e5d2f0e7b19eedd4de..b549f8122f80144d30eabb07a10fbbbf18a6bc0f 100644
--- a/README.txt
+++ b/README.txt
@@ -1,19 +1,27 @@
-OpenAirInterface is under GNU GPLv3 license. The full GNU General Public License is included in this distribution in the file called "COPYING".
-
-The OpenAirInterface (OAI) software is composed of six different parts: 
-
-openair1: 3GPP LTE Rel-8 PHY layer + PHY RF simulation
-
-openair2: 3GPP LTE Rel-9 RLC/MAC/PDCP/RRC implementations, eNB application, X2AP. Note that for RLC, the following versions are userL UM_v9.3.0, TM_v9.3.0, and AM_v9.3.0. For PDCP, PDCP_v10.1.0 is used. For RRC, only LITE is used.
-
-openair3: 3GPP LTE Rel9 and 10 MME/NAS, S+P-GW, HSS, S1AP (ENB and MME).
-
-common: some common OAI utilities, other tools can be found at openair2/UTILS
-
-targets: scripts to compile and lauch different system targets (simulation, emulation and real-time platforms, user-space tools for these platforms (tbd)) 
-
-see README files in these subdirectories for more information
-
-see also https://twiki.eurecom.fr/twiki/bin/view/OpenAirInterface/WebHome
-
-
+OpenAirInterface is under OpenAirInterface Software Alliance license.
+├── http://www.openairinterface.org/?page_id=101
+├── http://www.openairinterface.org/?page_id=698
+
+The OpenAirInterface (OAI) software is composed of the following parts: 
+
+openairinterface5g
+├── cmake_targets: build utilities to compile (simulation, emulation and real-time platforms), and generated build files
+├── common : some common OAI utilities, other tools can be found at openair2/UTILS
+├── COPYING
+├── maketags : script to generate emacs tags
+├── openair1 : 3GPP LTE Rel-10 PHY layer + PHY RF simulation and a subset of Rel 12 Features.
+├── openair2 :3GPP LTE Rel-10 RLC/MAC/PDCP/RRC/X2AP implementation. 
+    ├── LAYER2/RLC/ with the following subdirectories: UM_v9.3.0, TM_v9.3.0, and AM_v9.3.0. 
+    ├── LAYER2/PDCP/PDCP_v10.1.0. 
+    ├── RRC/LITE
+    ├── PHY_INTERFACE
+    ├── X2AP
+    ├── ENB_APP 
+├── openair3: 3GPP LTE Rel10 for S1AP, NAS GTPV1-U for both ENB and UE.
+    ├── GTPV1-U
+    ├── NAS 
+    ├── S1AP
+    ├── SCTP
+    ├── SECU
+    ├── UDP
+└── targets: top level wrapper for unitary simulation for PHY channels, system-level emulation (eNB-UE with and without S1), and realtime eNB and UE and RRH GW.
diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt
index 53e79229d8c4d548348e5a05d3ff3632aff8d074..d477ef4e943983826b172f1c21fa102fde118283 100644
--- a/cmake_targets/CMakeLists.txt
+++ b/cmake_targets/CMakeLists.txt
@@ -36,7 +36,7 @@ set (OPENAIR1_DIR    ${OPENAIR_DIR}/openair1)
 set (OPENAIR2_DIR    ${OPENAIR_DIR}/openair2)
 set (OPENAIR3_DIR    ${OPENAIR_DIR}/openair3)
 set (OPENAIR_TARGETS ${OPENAIR_DIR}/targets)
-set (OPENAIR3_DIR   ${OPENAIR_DIR}/openair3)
+set (OPENAIR3_DIR    ${OPENAIR_DIR}/openair3)
 set (OPENAIR_CMAKE   ${OPENAIR_DIR}/cmake_targets)
 set (OPENAIR_BIN_DIR ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY})
 
@@ -44,6 +44,10 @@ project (OpenAirInterface)
 
 #add_definitions("-DEMIT_ASN_DEBUG=1")
 
+add_subdirectory(${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms7002m lms7002m)
+add_subdirectory(${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR lmsSDR)
+add_subdirectory(${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/Si5351C Si5351C)
+
 ###########################################
 # macros to define options as there is numerous options in oai
 ################################################
@@ -125,22 +129,26 @@ endmacro(add_list_string_option)
 if (CMAKE_BUILD_TYPE STREQUAL "")
    set(CMAKE_BUILD_TYPE "RelWithDebInfo")
 endif()
+message("CMAKE_BUILD_TYPE is ${CMAKE_BUILD_TYPE}")
 add_list_string_option(CMAKE_BUILD_TYPE "RelWithDebInfo" "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." Debug Release RelWithDebInfo MinSizeRel)
 
 Message("Architecture is ${CMAKE_SYSTEM_PROCESSOR}")
 if (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l")
   set(C_FLAGS_PROCESSOR "-gdwarf-2 -mfloat-abi=hard -mfpu=neon -lgcc -lrt")
 else (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l")
-  file(STRINGS "/proc/cpuinfo" CPUINFO REGEX flags LIMIT_COUNT 1)
-  #Message("CPUINFO is ${CPUINFO}")
-  if (CPUINFO MATCHES "avx2")
-    set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mavx2")
-  endif()
-  if (CPUINFO MATCHES "sse4_1")
-    set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1")
-  endif()
-  if (CPUINFO MATCHES "ssse3")
-    set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mssse3")
+  if(EXISTS  "/proc/cpuinfo")
+    file(STRINGS "/proc/cpuinfo" CPUINFO REGEX flags LIMIT_COUNT 1)
+    if (CPUINFO MATCHES "avx2")
+      set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mavx2")
+    endif()
+    if (CPUINFO MATCHES "sse4_1")
+      set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -msse4.1")
+    endif()
+    if (CPUINFO MATCHES "ssse3")
+      set(C_FLAGS_PROCESSOR "${C_FLAGS_PROCESSOR} -mssse3")
+    endif()
+  else()
+    Message("/proc/cpuinfo does not exit. We will use manual CPU flags")
   endif()
 endif()
 
@@ -150,7 +158,7 @@ Message("C_FLAGS_PROCESSOR is ${C_FLAGS_PROCESSOR}")
 
 if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86")
   if ( (NOT( C_FLAGS_PROCESSOR MATCHES "ssse3")) OR (NOT( C_FLAGS_PROCESSOR MATCHES "msse4.1")) )
-    Message(FATAL_ERROR "For x86 Architecture, you must have following flags: -mssse3 -msse4.1. The current detected flags are: ${C_FLAGS_PROCESSOR}. You can pass the flags manually in build script, for example: ./build_oai --cflags_processor \"-mssse3 -msse4.1\" ")
+    Message(FATAL_ERROR "For x86 Architecture, you must have following flags: -mssse3 -msse4.1. The current detected flags are: ${C_FLAGS_PROCESSOR}. You can pass the flags manually in build script, for example: ./build_oai --cflags_processor \"-mssse3 -msse4.1 -mavx2\" ")
   endif()
 endif()
 
@@ -162,49 +170,79 @@ set(CMAKE_C_FLAGS
   "${CMAKE_C_FLAGS} -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP"
 )
 set(CMAKE_CXX_FLAGS
-  "${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR}"
+  "${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -std=c++11 "
 )
+
+
+#########################
+set(CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${CMAKE_CURRENT_BINARY_DIR}")
+#########################
 # set a flag for changes in the source code
 # these changes are related to hardcoded path to include .h files
 add_definitions(-DCMAKER)
 set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3")
-set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3 -O2") 
+set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3 -O3") 
+
+
+set(GIT_BRANCH        "UNKNOWN")
+set(GIT_COMMIT_HASH   "UNKNOWN")
+set(GIT_COMMIT_DATE   "UNKNOWN")
+
+
+find_package(Git)
+if(GIT_FOUND)
+  message("git found: ${GIT_EXECUTABLE}")
+  # Get the current working branch
+  execute_process(
+    COMMAND git rev-parse --abbrev-ref HEAD
+    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+    OUTPUT_VARIABLE GIT_BRANCH
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+  )
+
+  # Get the latest abbreviated commit hash of the working branch
+  execute_process(
+    COMMAND git log -1 --format=%h
+    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+    OUTPUT_VARIABLE GIT_COMMIT_HASH
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+  )
+  
+  # Get the latest commit date of the working branch
+  execute_process(
+    COMMAND git log -1 --format=%cd
+    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+    OUTPUT_VARIABLE GIT_COMMIT_DATE
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+  )
+endif()
 
-# Below has been put in comment because does not work with
-# SVN authentication.
-#
-#find_package(Subversion)
-#if(SUBVERSION_FOUND)
-#  Subversion_WC_INFO(${OPENAIR_DIR} openair)
-#  set (FIRMWARE_VERSION "${openair_WC_REVISION} - ${openair_WC_LAST_CHANGED_DATE}")
-#  Subversion_WC_LOG(${OPENAIR_DIR} Project)
-#else()
-#  set (FIRMWARE_VERSION "No svn information")
-#endif()
-#add_definitions("-DFIRMWARE_VERSION=\"${FIRMWARE_VERSION}\"")
 
 # Below is a hard-coded info
 set (FIRMWARE_VERSION "No svn information")
 add_definitions("-DFIRMWARE_VERSION=\"${FIRMWARE_VERSION}\"")
-add_definitions("-DPACKAGE_VERSION=\"${FIRMWARE_VERSION}\"")
-add_definitions("-DPACKAGE_BUGREPORT=\"OpenAirInterface web site\"")
+add_definitions("-DPACKAGE_VERSION=\"Branch: ${GIT_BRANCH} Abrev. Hash: ${GIT_COMMIT_HASH} Date: ${GIT_COMMIT_DATE}\"")
+add_definitions("-DPACKAGE_BUGREPORT=\"openair4g-devel@lists.eurecom.fr\"")
 
 
 
 # Debug related options
 #########################################
-add_boolean_option(MSG_PRINT  False "print debug messages")
-add_boolean_option(DISABLE_XER_PRINT False "print XER Format")
-add_boolean_option(XER_PRINT False "print XER Format")
-add_boolean_option(RRC_MSG_PRINT False "print RRC messages")
-add_boolean_option(PDCP_MSG_PRINT False "print PDCP messages to /tmp/pdcp.log")
-add_boolean_option(DEBUG_PDCP_PAYLOAD False "print PDCP PDU to stdout")  # if true, make sure that global and PDCP log levels are trace 
+add_boolean_option(ASN_DEBUG           False "ASN1 coder/decoder Debug")
+add_boolean_option(EMIT_ASN_DEBUG      False "ASN1 coder/decoder Debug")
+add_boolean_option(MSG_PRINT           False "print debug messages")
+add_boolean_option(DISABLE_XER_PRINT   False "print XER Format")
+add_boolean_option(XER_PRINT           False "print XER Format")
+add_boolean_option(RRC_MSG_PRINT       False "print RRC messages")
+add_boolean_option(PDCP_MSG_PRINT      False "print PDCP messages to /tmp/pdcp.log")
+add_boolean_option(DEBUG_PDCP_PAYLOAD  False "print PDCP PDU to stdout")  # if true, make sure that global and PDCP log levels are trace 
 add_boolean_option(DEBUG_MAC_INTERFACE False "print MAC-RLC PDU exchange to stdout") # if true, make sure that global and PDCP log levels are trace 
-add_boolean_option(TRACE_RLC_PAYLOAD False "print RLC PDU to stdout") # if true, make sure that global and PDCP log levels are trace 
-add_boolean_option(TEST_OMG False "???")
-add_boolean_option(DEBUG_OMG False "???")
-add_boolean_option(XFORMS True "This adds the possibility to see the signal oscilloscope")
-add_boolean_option(PRINT_STATS False "This adds the possibility to see the status")
+add_boolean_option(TRACE_RLC_PAYLOAD   False "print RLC PDU to stdout") # if true, make sure that global and PDCP log levels are trace 
+add_boolean_option(TEST_OMG            False "???")
+add_boolean_option(DEBUG_OMG           False "???")
+add_boolean_option(XFORMS              False "This adds the possibility to see the signal oscilloscope")
+add_boolean_option(PRINT_STATS         False "This adds the possibility to see the status")
+add_boolean_option(T_TRACER            False "Activate the T tracer, a debugging/monitoring framework" )
 
 add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering")
 
@@ -227,7 +265,8 @@ endif (${ENABLE_ITTI})
 
 add_boolean_option(RTAI False "Use RTAI")
 if (${RTAI})
-  set(LOWLATENCY False)
+  set(DEADLINE_SCHEDULER False)
+  set(CPU_AFFINITY False)
   add_definitions("-DENABLE_RTAI_CLOCK")
   add_definitions("-DCONFIG_RTAI_LXRT_INLINE")
   include_directories ("/usr/realtime/include")
@@ -245,8 +284,12 @@ endif (${RTAI})
 # New C code source file, cmake must be re-run (instead of re-running make only)
 #############
 set(asn1c_call "${OPENAIR_CMAKE}/tools/generate_asn1")
+set(fix_asn1c_call "${OPENAIR_CMAKE}/tools/fix_asn1")
 set(asn1_generated_dir ${OPENAIR_BIN_DIR})
 
+set(protoc_call "${OPENAIR_CMAKE}/tools/generate_protobuf")
+set(protobuf_generated_dir ${OPENAIR_BIN_DIR})
+
 # RRC
 ######
 add_list2_option(RRC_ASN1_VERSION "Rel10" "ASN.1 version of RRC interface" "Rel8" "Rel10" "CBA")
@@ -263,7 +306,19 @@ set (RRC_FULL_DIR ${asn1_generated_dir}/${RRC_ASN1_VERSION})
 if(NOT EXISTS ${asn1c_call})
   message( FATAL_ERROR "The script ${asn1c_call} must be present" )
 endif(NOT EXISTS ${asn1c_call})
-execute_process(COMMAND ${asn1c_call}  ${RRC_FULL_DIR} ${RRC_GRAMMAR})
+execute_process(COMMAND ${asn1c_call}  ${RRC_FULL_DIR} ${RRC_GRAMMAR}
+                RESULT_VARIABLE ret)
+if (NOT ${ret} STREQUAL 0)
+  message(FATAL_ERROR "${asn1c_call}: error")
+endif (NOT ${ret} STREQUAL 0)
+if(NOT EXISTS ${fix_asn1c_call})
+  message( FATAL_ERROR "The script ${fix_asn1c_call} must be present" )
+endif(NOT EXISTS ${fix_asn1c_call})
+execute_process(COMMAND ${fix_asn1c_call} ${RRC_FULL_DIR} RRC ${RRC_ASN1_VERSION}
+                RESULT_VARIABLE ret)
+if (NOT ${ret} STREQUAL 0)
+  message(FATAL_ERROR "${fix_asn1c_call}: error")
+endif (NOT ${ret} STREQUAL 0)
 file(GLOB rrc_source ${RRC_FULL_DIR}/*.c)
 set(rrc_source  ${rrc_source} ${OPENAIR2_DIR}/RRC/LITE/MESSAGES/asn1_msg.c)
 file(GLOB rrc_h ${RRC_FULL_DIR}/*.h)
@@ -277,6 +332,7 @@ include_directories ("${RRC_FULL_DIR}")
 add_custom_command (
   OUTPUT ${RRC_FULL_DIR}/asn1_constants.h
   COMMAND ${asn1c_call}  ${RRC_FULL_DIR} ${RRC_GRAMMAR}
+  COMMAND ${fix_asn1c_call}  ${RRC_FULL_DIR} RRC ${RRC_ASN1_VERSION}
   DEPENDS ${RRC_GRAMMAR}
   )
 
@@ -305,13 +361,28 @@ set(S1AP_ASN_FILES
   )
 set(S1AP_C_DIR ${asn1_generated_dir}/${ASN1RELDIR})
 #message("calling ${asn1c_call} ${S1AP_C_DIR} ${S1AP_ASN_FILES}")
-execute_process(COMMAND ${asn1c_call} ${S1AP_C_DIR} ${S1AP_ASN_FILES})
+execute_process(COMMAND ${asn1c_call} ${S1AP_C_DIR} ${S1AP_ASN_FILES}
+                RESULT_VARIABLE ret)
+if (NOT ${ret} STREQUAL 0)
+  message(FATAL_ERROR "${asn1c_call}: error")
+endif (NOT ${ret} STREQUAL 0)
+execute_process(COMMAND python ${S1AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f${S1AP_ASN_DIR}/S1AP-PDU-Contents.asn -o${S1AP_C_DIR}
+                RESULT_VARIABLE ret)
+if (NOT ${ret} STREQUAL 0)
+  message(FATAL_ERROR "asn1tostruct.py: error")
+endif (NOT ${ret} STREQUAL 0)
+execute_process(COMMAND ${fix_asn1c_call} ${S1AP_C_DIR} S1AP ${S1AP_VERSION}
+                RESULT_VARIABLE ret)
+if (NOT ${ret} STREQUAL 0)
+  message(FATAL_ERROR "${fix_asn1c_call}: error")
+endif (NOT ${ret} STREQUAL 0)
 file(GLOB S1AP_source ${S1AP_C_DIR}/*.c)
 
 set(S1AP_OAI_generated
   ${S1AP_C_DIR}/s1ap_decoder.c
   ${S1AP_C_DIR}/s1ap_encoder.c
   ${S1AP_C_DIR}/s1ap_xer_print.c
+  ${S1AP_C_DIR}/s1ap_compare.c
   ${S1AP_C_DIR}/s1ap_ies_defs.h
   )
 file(GLOB s1ap_h ${S1AP_C_DIR}/*.h)
@@ -321,6 +392,7 @@ add_custom_command (
   OUTPUT ${S1AP_OAI_generated}
   COMMAND ${asn1c_call} ${S1AP_C_DIR} ${S1AP_ASN_FILES}
   COMMAND python ${S1AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f${S1AP_ASN_DIR}/S1AP-PDU-Contents.asn -o${S1AP_C_DIR}
+  COMMAND ${fix_asn1c_call} ${S1AP_C_DIR} S1AP ${S1AP_VERSION}
   DEPENDS ${S1AP_ASN_FILES}
   )
 add_library(S1AP_LIB
@@ -372,7 +444,21 @@ set(X2AP_ASN_FILES
 
 set(X2AP_C_DIR ${asn1_generated_dir}/${ASN1RELDIR})
 #message("calling ${asn1c_call} ${X2AP_C_DIR} ${X2AP_ASN_FILES}")
-execute_process(COMMAND ${asn1c_call} ${X2AP_C_DIR} ${X2AP_ASN_FILES})
+execute_process(COMMAND ${asn1c_call} ${X2AP_C_DIR} ${X2AP_ASN_FILES}
+                RESULT_VARIABLE ret)
+if (NOT ${ret} STREQUAL 0)
+  message(FATAL_ERROR "${asn1c_call}: error")
+endif (NOT ${ret} STREQUAL 0)
+execute_process(COMMAND python ${X2AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f ${X2AP_ASN_DIR}/X2AP-PDU-Contents.asn -o ${X2AP_C_DIR}
+                RESULT_VARIABLE ret)
+if (NOT ${ret} STREQUAL 0)
+  message(FATAL_ERROR "asn1tostruct.py: error")
+endif (NOT ${ret} STREQUAL 0)
+execute_process(COMMAND ${fix_asn1c_call} ${X2AP_C_DIR} X2AP ${X2AP_VERSION}
+                RESULT_VARIABLE ret)
+if (NOT ${ret} STREQUAL 0)
+  message(FATAL_ERROR "${fix_asn1c_call}: error")
+endif (NOT ${ret} STREQUAL 0)
 file(GLOB X2AP_source ${X2AP_C_DIR}/*.c)
 
 set(X2AP_OAI_generated
@@ -389,6 +475,7 @@ add_custom_command (
   OUTPUT ${X2AP_OAI_generated}
   COMMAND ${asn1c_call} ${X2AP_C_DIR} ${X2AP_ASN_FILES}
   COMMAND python ${X2AP_DIR}/MESSAGES/ASN1/asn1tostruct.py -f ${X2AP_ASN_DIR}/X2AP-PDU-Contents.asn -o ${X2AP_C_DIR}
+  COMMAND ${fix_asn1c_call} ${X2AP_C_DIR} X2AP ${X2AP_VERSION}
   DEPENDS ${X2AP_ASN_FILES}
   )
 
@@ -407,8 +494,55 @@ add_list1_option(NB_ANTENNAS_RX "2" "Number of antennas in reception" "1" "2" "4
 add_list1_option(NB_ANTENNAS_TX "2" "Number of antennas in transmission" "1" "2" "4")
 add_list1_option(NB_ANTENNAS_TXRX "2" "Number of antennas in ????" "1" "2" "4")
 
-add_list2_option(RF_BOARD "EXMIMO" "RF head type" "False" "EXMIMO" "OAI_USRP" "ETHERNET" "OAI_BLADERF" "CPRIGW")
+add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "EXMIMO" "OAI_USRP" "OAI_BLADERF" "CPRIGW" "OAI_LMSSDR")
+
+add_list2_option(TRANSP_PRO "None" "Transport protocol type" "None" "ETHERNET")
 
+
+# include RF devices / transport protocols library modules
+######################################################################
+
+include_directories("${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/")
+include_directories ("${OPENAIR_TARGETS}/ARCH/EXMIMO/DEFS/")
+#set (option_HWEXMIMOLIB_lib "-l ")
+set(HWLIB_EXMIMO_SOURCE 
+  ${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c
+  ${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/gain_control.c
+  )
+add_library(oai_exmimodevif MODULE ${HWLIB_EXMIMO_SOURCE} )
+
+include_directories("${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/")
+set (option_HWUSRPLIB_lib "-l uhd")
+set(HWLIB_USRP_SOURCE 
+  ${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
+  )
+add_library(oai_usrpdevif MODULE ${HWLIB_USRP_SOURCE} )
+
+include_directories("${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/")
+set (option_HWBLADERFLIB_lib "-l bladerf")
+set(HWLIB_BLADERF_SOURCE 
+  ${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c
+  )
+add_library(oai_bladerfdevif MODULE ${HWLIB_BLADERF_SOURCE} )
+
+include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/")
+set (option_HWLMSSDRLIB_lib "-l LMS_SDR -l LMS7002M -l Si5351C")
+set(HWLIB_LMSSDR_SOURCE 
+  ${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp
+  )
+add_library(oai_lmssdrdevif MODULE ${HWLIB_LMSSDR_SOURCE} )
+
+include_directories("${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/")
+set(TPLIB_ETHERNET_SOURCE 
+  ${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
+  ${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c
+  ${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c
+  )
+add_library(oai_eth_transpro MODULE ${TPLIB_ETHERNET_SOURCE} )
+
+
+# RF devices / transport protocols settings
+######################################################################
 if (${RF_BOARD} STREQUAL "EXMIMO")
   set(DRIVER2013)
   include_directories ("${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/")
@@ -416,6 +550,7 @@ if (${RF_BOARD} STREQUAL "EXMIMO")
   set(HW_SOURCE ${HW_SOURCE}
     ${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c
     ${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/gain_control.c)
+  set(option_HW_lib "-rdynamic -ldl")
 
 elseif (${RF_BOARD} STREQUAL "OAI_USRP")
   include_directories("${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/")
@@ -423,8 +558,7 @@ elseif (${RF_BOARD} STREQUAL "OAI_USRP")
   set(HW_SOURCE ${HW_SOURCE}
     ${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp)
   LINK_DIRECTORIES("/opt/lib")
-  set(option_HW_lib "uhd")
-  set(LOWLATENCY False)
+  set(option_HW_lib "-luhd -rdynamic -ldl")
 
 elseif (${RF_BOARD} STREQUAL "OAI_BLADERF")
   include_directories("${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/")
@@ -434,26 +568,50 @@ elseif (${RF_BOARD} STREQUAL "OAI_BLADERF")
     ${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c
     )
   LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu")
-  set(option_HW_lib "bladeRF")
-#set(LOWLATENCY False)
 
-elseif (${RF_BOARD} STREQUAL "ETHERNET")
-  include_directories ("${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB")
-  set(HW_SOURCE ${HW_SOURCE}
-    ${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
-    )
-  set(LOWLATENCY True)
-  
+  set(option_HW_lib "bladeRF -rdynamic -ldl")
+
+elseif (${RF_BOARD} STREQUAL "OAI_LMSSDR")
+  include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB")
+  include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR")
+  include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms7002m")
+  include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/Si5351C")
+  include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard")
+  LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu")
+  LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/lmsSDR")
+  LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/lms7002m")
+  LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/Si5351C")
+  set(HW_SOURCE ${HW_SOURCE} ${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp)
+  set(option_HW_lib "-lLMS_SDR -lLMS7002M -lSi5351C -rdynamic -ldl")
+
 elseif (${RF_BOARD} STREQUAL "CPRIGW")
   set(HW_SOURCE ${HW_SOURCE}
     ${OPENAIR_TARGETS}/ARCH/CPRIGW/USERSPACE/LIB/cprigw_lib.c
     )
   include_directories("${OPENAIR_TARGETS}/ARCH/CPRIGW/USERSPACE/LIB/")
-   set(option_HW_lib "-rdynamic dl")
+  set(option_HW_lib "-rdynamic dl")
+  
 endif (${RF_BOARD} STREQUAL "EXMIMO")
 
+
+if (${TRANSP_PRO} STREQUAL "ETHERNET")
+  
+  include_directories ("${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB")
+  set(TRANSPORT_SOURCE ${TRANSPORT_SOURCE}
+    ${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
+    ${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c
+    ${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c
+    )
+  set(option_TP_lib "-rdynamic -ldl")
+
+  
+endif (${TRANSP_PRO} STREQUAL "ETHERNET")
+##########################################################
+
 include_directories ("${OPENAIR_TARGETS}/ARCH/COMMON")
 
+Message("DEADLINE_SCHEDULER flag  is ${DEADLINE_SCHEDULER}")
+Message("CPU_Affinity flag is ${CPU_AFFINITY}")
 
 ##############################################################
 #    ???!!! TO BE DOCUMENTED OPTIONS !!!???
@@ -466,7 +624,8 @@ add_boolean_option(RRC_DEFAULT_RAB_IS_AM False "set the RLC mode to AM for the d
 
 add_boolean_option(OAI_NW_DRIVER_TYPE_ETHERNET False "????")
 add_boolean_option(DISABLE_USE_NAS False "???")
-add_boolean_option(LOWLATENCY True "Use the Linux scheduler SCHED_DEADLINE: kernel >= 3.14")
+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(OAISIM False "specific to oaisim")
@@ -476,6 +635,9 @@ add_list_string_option(PACKAGE_NAME "NotDefined" "As per attribute name")
 add_boolean_option(MESSAGE_CHART_GENERATOR False         "For generating sequence diagrams")
 add_boolean_option(MESSAGE_CHART_GENERATOR_RLC_MAC False "trace RLC-MAC exchanges in sequence diagrams")
 add_boolean_option(MESSAGE_CHART_GENERATOR_PHY     False "trace some PHY exchanges in sequence diagrams")
+
+add_boolean_option(ENB_AGENT                   True         "enable eNB agent to inteface with a SDN contrller")
+
 ########################
 # Include order
 ##########################
@@ -771,7 +933,14 @@ add_library(SECU_CN ${SECU_CN_SRC})
 
 # Scheduler
 ################################"
-file(GLOB SCHED_SRC ${OPENAIR1_DIR}/SCHED/*.c)
+set(SCHED_SRC 
+  ${OPENAIR1_DIR}/SCHED/phy_procedures_lte_eNb.c
+  ${OPENAIR1_DIR}/SCHED/phy_procedures_lte_ue.c
+  ${OPENAIR1_DIR}/SCHED/phy_procedures_lte_common.c
+  ${OPENAIR1_DIR}/SCHED/phy_mac_stub.c
+  ${OPENAIR1_DIR}/SCHED/pucch_pc.c
+  ${OPENAIR1_DIR}/SCHED/pusch_pc.c
+)
 add_library(SCHED_LIB ${SCHED_SRC})
 
 # Layer 1
@@ -840,12 +1009,14 @@ set(PHY_SRC
   ${OPENAIR1_DIR}/PHY/CODING/crc_byte.c
   ${OPENAIR1_DIR}/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c
   ${OPENAIR1_DIR}/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c
+  ${OPENAIR1_DIR}/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c
   ${OPENAIR1_DIR}/PHY/CODING/lte_rate_matching.c
   ${OPENAIR1_DIR}/PHY/CODING/rate_matching.c
   ${OPENAIR1_DIR}/PHY/CODING/viterbi.c
   ${OPENAIR1_DIR}/PHY/CODING/viterbi_lte.c
   ${OPENAIR1_DIR}/PHY/INIT/lte_init.c
   ${OPENAIR1_DIR}/PHY/INIT/lte_parms.c
+  ${OPENAIR1_DIR}/PHY/INIT/lte_param_init.c
   ${OPENAIR1_DIR}/PHY/TOOLS/file_output.c
   ${OPENAIR1_DIR}/PHY/TOOLS/lte_dfts.c
   ${OPENAIR1_DIR}/PHY/TOOLS/log2_approx.c
@@ -941,8 +1112,8 @@ set (ENB_APP_SRC
 add_library(L2
   ${L2_SRC}
   ${MAC_SRC}
-  ${ENB_APP_SRC}
-  ${OPENAIR2_DIR}/RRC/L2_INTERFACE/openair_rrc_L2_interface.c)
+  ${ENB_APP_SRC})
+#  ${OPENAIR2_DIR}/RRC/L2_INTERFACE/openair_rrc_L2_interface.c)
 
 # L3 Libs
 ##########################
@@ -1000,7 +1171,6 @@ add_library(CN_UTILS
   ${OPENAIR3_DIR}/UTILS/conversions.c
   ${OPENAIR3_DIR}/UTILS/enum_string.c
   ${OPENAIR3_DIR}/UTILS/log.c
-  ${OPENAIR3_DIR}/UTILS/mme_config.c
   ${OPENAIR3_DIR}/UTILS/mcc_mnc_itu.c
   )
 
@@ -1341,6 +1511,9 @@ include(FindPkgConfig)
 pkg_search_module(LIBXML2 libxml-2.0 REQUIRED)
 include_directories(${LIBXML2_INCLUDE_DIRS})
 
+pkg_search_module(LIBXSLT libxslt REQUIRED)
+include_directories(${LIBXSLT_INCLUDE_DIRS})
+
 pkg_search_module(OPENSSL openssl REQUIRED)
 include_directories(${OPENSSL_INCLUDE_DIRS})
 
@@ -1356,7 +1529,7 @@ if (${RF_BOARD} STREQUAL "OAI_USRP")
   include_directories(${LIBBOOST_INCLUDE_DIR})
 endif (${RF_BOARD} STREQUAL "OAI_USRP")
 
-pkg_search_module(OPENPGM openpgm-5.1)
+pkg_search_module(OPENPGM openpgm-5.1 openpgm-5.2)
 if(NOT ${OPENPGM_FOUND})
   message("PACKAGE openpgm-5.1 is required by binaries such as oaisim: will fail later if this target is built")
 else()
@@ -1398,16 +1571,47 @@ endif (${XFORMS})
 
 set(CMAKE_MODULE_PATH "${OPENAIR_DIR}/cmake_targets/tools/MODULES" "${CMAKE_MODULE_PATH}")
 
+#include T directory even if the T is off because T macros are in the code
+#no matter what
+include_directories("${OPENAIR_DIR}/common/utils/T")
+
+if (${T_TRACER})
+  set(T_SOURCE
+      ${OPENAIR_DIR}/common/utils/T/T.c
+      ${OPENAIR_DIR}/common/utils/T/local_tracer.c)
+  set (T_LIB "rt")
+endif (${T_TRACER})
+
+#Some files in the T directory are generated.
+#This rule and the following deal with it.
+add_custom_command (
+  OUTPUT ${OPENAIR_DIR}/common/utils/T/T_IDs.h
+  COMMAND make
+  WORKING_DIRECTORY ${OPENAIR_DIR}/common/utils/T
+  DEPENDS ${OPENAIR_DIR}/common/utils/T/T_messages.txt
+  )
+
+#This rule is specifically needed to generate T files
+#before anything else in a project that uses the T.
+#See below, there are some 'add_dependencies' showing that.
+#Basically we create a custom target and we make other
+#targets depend on it. That forces cmake to generate
+#T files before anything else.
+add_custom_target (
+  generate_T
+  DEPENDS ${OPENAIR_DIR}/common/utils/T/T_IDs.h
+)
 
 # Hack on a test of asn1c version (already dirty)
 add_definitions(-DASN1_MINIMUM_VERSION=924)
 
 #################################
 # add executables for operation
-#################################""
+#################################
 
 # lte-softmodem is both eNB and UE implementation
 ###################################################
+
 add_executable(lte-softmodem
   ${rrc_h}
   ${s1ap_h}
@@ -1425,20 +1629,23 @@ add_executable(lte-softmodem
   ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
   ${GTPU_need_ITTI}
   ${HW_SOURCE}
+  ${TRANSPORT_SOURCE}  
   ${RTAI_SOURCE}
   ${XFORMS_SOURCE}
   ${XFORMS_SOURCE_SOFTMODEM}
+  ${T_SOURCE}
   )
 
-target_link_libraries (lte-softmodem
+target_link_libraries (lte-softmodem -ldl
   -Wl,--start-group
-  RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${MIH_LIB}
+  RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${MIH_LIB} 
   -Wl,--end-group )
 
-
 target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES})
-target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${option_HW_lib} ${XFORMS_LIBRARIES} )
-target_link_libraries (lte-softmodem ${LIBBOOST_LIBRARIES})
+target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${option_HW_lib} ${option_TP_lib} ${XFORMS_LIBRARIES} ) 
+target_link_libraries (lte-softmodem ${LIBBOOST_LIBRARIES} -lboost_system) #Added manually as it is not found for some reason for USRP
+target_link_libraries (lte-softmodem ${LIB_LMS_LIBRARIES})
+target_link_libraries (lte-softmodem ${T_LIB})
 
 # lte-softmodem-nos1 is both eNB and UE implementation
 ###################################################
@@ -1455,13 +1662,15 @@ add_executable(lte-softmodem-nos1
   ${OPENAIR_TARGETS}/SIMU/USER/init_lte.c
   ${OPENAIR_TARGETS}/COMMON/create_tasks.c
   ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
-  #${OPENAIR2_DIR}/RRC/NAS/nas_config.c # enable if you want rrc to mount ip interface
-  #${OPENAIR2_DIR}/RRC/NAS/rb_config.c
+  ${OPENAIR2_DIR}/RRC/NAS/nas_config.c
+  ${OPENAIR2_DIR}/RRC/NAS/rb_config.c
   ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
   ${HW_SOURCE}
+  ${TRANSPORT_SOURCE}  
   ${RTAI_SOURCE}
   ${XFORMS_SOURCE}
   ${XFORMS_SOURCE_SOFTMODEM}
+  ${T_SOURCE}
   )
 target_link_libraries (lte-softmodem-nos1
   -Wl,--start-group
@@ -1469,38 +1678,46 @@ target_link_libraries (lte-softmodem-nos1
   -Wl,--end-group )
 
 target_link_libraries (lte-softmodem-nos1 ${LIBXML2_LIBRARIES})
-target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES}  ${option_HW_lib} ${XFORMS_LIBRARIES} )
-target_link_libraries (lte-softmodem-nos1 ${LIBBOOST_LIBRARIES})
-
-
+target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES}  ${option_HW_lib}  ${option_TP_lib} ${XFORMS_LIBRARIES} )
+target_link_libraries (lte-softmodem-nos1 ${LIBBOOST_LIBRARIES} -lboost_system) #Added manually as it is not found for some reason for USRP
+target_link_libraries (lte-softmodem-nos1  ${LIB_LMS_LIBRARIES})
+target_link_libraries (lte-softmodem-nos1 ${T_LIB})
 
 # rrh
 ################################
-set(DRIVER2013)
-
-#Note: only on RF type is currently supported for RRH
+#Note: only one RF type (USRP) is currently supported for RRH
 add_executable(rrh_gw
   ${OPENAIR_TARGETS}/RT/USER/rrh_gw.c
   ${OPENAIR_TARGETS}/RT/USER/eNB_transport_IQ.c
   ${OPENAIR_TARGETS}/RT/USER/UE_transport_IQ.c
   ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
   ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c		
-  ${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c 
   ${HW_SOURCE}
+  ${TRANSPORT_SOURCE}  
+  ${T_SOURCE}
   )
-# assert and common_lib.h
-target_include_directories(rrh_gw PRIVATE  ${OPENAIR_DIR}/common/utils/itti ${OPENAIR_TARGETS}/ARCH/COMMON ${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/ )
-
+target_include_directories(rrh_gw PRIVATE  ${OPENAIR_DIR}/common/utils/itti)
 target_link_libraries(rrh_gw
   -Wl,--start-group
   UTIL LFDS  
   -Wl,--end-group )
 target_link_libraries (rrh_gw rt pthread m )
-target_link_libraries (rrh_gw ${option_HW_lib} ${LIBBOOST_LIBRARIES} )
+target_link_libraries (rrh_gw  ${option_HW_lib} ${option_TP_lib} ${LIBBOOST_LIBRARIES} -lboost_system ) #Added manually as it is not found for some reason for USRP
+target_link_libraries (rrh_gw ${LIB_LMS_LIBRARIES})
+target_link_libraries (rrh_gw ${T_LIB})
 
-#Message("-- default_HW_lib=ETHERNET") # only in case of RRH
 Message("-- option_HW_lib=${option_HW_lib}")
 Message("-- HW_SOURCE=${HW_SOURCE}")
+Message("-- option_TP_lib=${option_TP_lib}")
+Message("-- TRANSPORT_SOURCE=${TRANSPORT_SOURCE}")
+
+if (${RF_BOARD} STREQUAL "OAI_LMSSDR")
+  add_dependencies(lte-softmodem LMS7002M LMS_SDR Si5351C)
+  add_dependencies(lte-softmodem-nos1 LMS7002M LMS_SDR Si5351C)
+  add_dependencies(rrh_gw LMS7002M LMS_SDR Si5351C)
+endif (${RF_BOARD} STREQUAL "OAI_LMSSDR")
+
+
 
 # USIM process
 #################
@@ -1551,7 +1768,9 @@ add_executable(oaisim
   ${GTPU_need_ITTI}
   ${OPENAIR_TARGETS}/COMMON/create_tasks.c
   ${HW_SOURCE}
+  ${TRANSPORT_SOURCE}  
   ${XFORMS_SOURCE}
+  ${T_SOURCE}
 )
 
 
@@ -1562,10 +1781,11 @@ target_link_libraries (oaisim
   -Wl,--end-group )
 
 target_link_libraries (oaisim ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES})
-target_link_libraries (oaisim pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES}  ${NETTLE_LIBRARIES} sctp ${option_HW_lib}
+target_link_libraries (oaisim pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES}  ${NETTLE_LIBRARIES} sctp ${option_HW_lib} ${option_TP_lib}
   ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${OPENPGM_LIBRARIES})
 #Force link with forms, regardless XFORMS option
 target_link_libraries (oaisim forms)
+target_link_libraries (oaisim ${T_LIB})
 
 
 
@@ -1589,7 +1809,9 @@ add_executable(oaisim_nos1
   ${OPENAIR2_DIR}/UTIL/OMG/sumo.c
   ${OPENAIR_TARGETS}/COMMON/create_tasks.c
   ${HW_SOURCE}
+  ${TRANSPORT_SOURCE}  
   ${XFORMS_SOURCE}
+  ${T_SOURCE}
 )
 target_include_directories(oaisim_nos1 PUBLIC  ${OPENAIR_TARGETS}/SIMU/USER)
 target_link_libraries (oaisim_nos1
@@ -1598,11 +1820,11 @@ target_link_libraries (oaisim_nos1
   -Wl,--end-group )
 
 target_link_libraries (oaisim_nos1 ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES})
-target_link_libraries (oaisim_nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES}  ${NETTLE_LIBRARIES}  ${option_HW_lib}
+target_link_libraries (oaisim_nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES}  ${NETTLE_LIBRARIES}  ${option_HW_lib}  ${option_TP_lib}
   ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${OPENPGM_LIBRARIES})
 #Force link with forms, regardless XFORMS option
 target_link_libraries (oaisim_nos1 forms)
-
+target_link_libraries (oaisim_nos1 ${T_LIB})
 
 # Unitary tests for each piece of L1: example, mbmssim is MBMS L1 simulator
 #####################################
@@ -1612,15 +1834,17 @@ foreach(myExe dlsim ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim syn
     ${OPENAIR_BIN_DIR}/messages_xml.h
     ${OPENAIR1_DIR}/SIMULATION/LTE_PHY/${myExe}.c
     ${XFORMS_SOURCE}
+    ${T_SOURCE}
     )
   target_link_libraries (${myExe}
     -Wl,--start-group SIMU UTIL SCHED_LIB PHY LFDS ${ITTI_LIB} -Wl,--end-group
-    pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES}
+    pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB}
     )
 endforeach(myExe)
 
 add_executable(test_epc_generate_scenario
   ${OPENAIR3_DIR}/TEST/EPC_TEST/generate_scenario.c
+  ${OPENAIR3_DIR}/TEST/EPC_TEST/generate_scenario.h
   ${OPENAIR2_DIR}/ENB_APP/enb_config.h
   ${OPENAIR2_DIR}/COMMON/commonDef.h
   ${OPENAIR2_DIR}/COMMON/messages_def.h
@@ -1629,7 +1853,28 @@ add_executable(test_epc_generate_scenario
   ${OPENAIR_BIN_DIR}/messages_xml.h
   )
 target_link_libraries (test_epc_generate_scenario
-  -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES}  
+  -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES}  
+  )
+
+add_executable(test_epc_play_scenario
+  ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario.c
+  ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_decode.c
+  ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_display.c
+  ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_fsm.c
+  ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_parse.c
+  ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_s1ap.c
+  ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c
+  ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_s1ap_eNB_defs.h
+  ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario_sctp.c
+  ${OPENAIR3_DIR}/TEST/EPC_TEST/play_scenario.h
+  ${OPENAIR2_DIR}/COMMON/commonDef.h
+  ${OPENAIR2_DIR}/COMMON/messages_def.h
+  ${OPENAIR2_DIR}/COMMON/messages_types.h
+  ${OPENAIR_BIN_DIR}/messages_xml.h
+  )
+target_include_directories(test_epc_play_scenario PUBLIC /usr/local/share/asn1c)
+target_link_libraries (test_epc_play_scenario
+  -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES}  
   )
 
 
@@ -1658,8 +1903,23 @@ endforeach(myExe)
 #../targets/TEST/PDCP/test_pdcp.c
 #../targets/TEST/PDCP/with_rlc/test_pdcp_rlc.c
 
-
-
+#ensure that the T header files are generated before targets depending on them
+if (${T_TRACER})
+  add_dependencies(lte-softmodem generate_T)
+  add_dependencies(lte-softmodem-nos1 generate_T)
+  add_dependencies(rrh_gw generate_T)
+  add_dependencies(oaisim generate_T)
+  add_dependencies(oaisim_nos1 generate_T)
+  add_dependencies(dlsim generate_T)
+  add_dependencies(ulsim generate_T)
+  add_dependencies(pbchsim generate_T)
+  add_dependencies(scansim generate_T)
+  add_dependencies(mbmssim generate_T)
+  add_dependencies(pdcchsim generate_T)
+  add_dependencies(pucchsim generate_T)
+  add_dependencies(prachsim generate_T)
+  add_dependencies(syncsim generate_T)
+endif (${T_TRACER})
 
 ##################################################
 # Generated specific cases is not regular code
@@ -1679,6 +1939,11 @@ foreach( d ${DirDefs} )
     list(APPEND itti_compiler_options "-I${d}")
 endforeach()
 
+# castxml doesn't work with c11 (gcc 5 default)
+# force castxml and clang compilation with gnu89 standard
+# we can't use cXX standard as pthread_rwlock_t is gnu standard
+list(APPEND itti_compiler_options "-std=gnu89")
+
 set (ITTI_H ${ITTI_DIR}/intertask_interface_types.h)
 add_custom_command (
   OUTPUT ${OPENAIR_BIN_DIR}/messages.xml
@@ -1821,38 +2086,4 @@ endforeach(file)
 ADD_CUSTOM_TARGET(oarf
    DEPENDS ${OCT_FILES}
 )
- 
-#CMAKE INSTALL and CPACK
-
-#INSTALL(PROGRAMS lte-softmodem ${OPENAIR_DIR}/targets DESTINATION bin)
-#INSTALL(PROGRAMS oaisim ${OPENAIR_DIR}/targets DESTINATION bin)
-
-
-#SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenAirInterface")
-#SET(CPACK_PACKAGE_VENDOR "Eurecom")
-#SET(CPACK_PACKAGE_DESCRIPTION_FILE "${OPENAIR_DIR}/README.txt")
-#SET(CPACK_RESOURCE_FILE_LICENSE "${OPENAIR_DIR}/COPYING")
-#SET(CPACK_PACKAGE_VERSION_MAJOR "1")
-#SET(CPACK_PACKAGE_VERSION_MINOR "1")
-#SET(CPACK_PACKAGE_VERSION_PATCH "1")
-
-#SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
-#SET(CPACK_STRIP_FILES "${OPENAIR_TARGETS}/bin")
-#SET(CPACK_SOURCE_STRIP_FILES "")
-
-##debian specific 
-#SET(CPACK_DEBIAN_PACKAGE_NAME "OAI") 
-#SET(CPACK_DEBIAN_PACKAGE_VERSION "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
-##dpkg --print-architecture (do not use i686
-#SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
-
-#SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.3.1-6), libgcc1 (>= 1:3.4.2-12)")
-#SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libpthread.so.0  libm.so.6 libconfig.so.9 librt.so.1 libcrypt.so.1 libcrypto.so.1.0.0  libnettle.so.4 libsctp.so.1 libc.so.6")
-#SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "EURECOM-OSA")
-
-#SET(CPACK_PACKAGE_EXECUTABLES "lte-softmodem" "mme_gw.Rel10" "openair-hss")
-
-#SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "OpenAirInterface")
-#SET(CPACK_DEBIAN_PACKAGE_Section "Beta-Release")
 
-#INCLUDE(CPack)
diff --git a/cmake_targets/autotests/010101/CMakeLists.txt b/cmake_targets/autotests/010101/CMakeLists.txt
deleted file mode 100644
index ed913b0fb9bbfb7844fd62069c30ec4a32f5ea0e..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010101/CMakeLists.txt
+++ /dev/null
@@ -1,106 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-set ( ADDR_CONF False )
-set ( DEBUG_OMG False )
-set ( DISABLE_USE_NAS False )
-set ( DISABLE_XER_PRINT False )
-set ( DRIVER2013 False )
-set ( EMOS False )
-set ( ENABLE_FXP True )
-set ( ENABLE_ITTI False )
-set ( ENABLE_NAS_UE_LOGGING False )
-set ( ENABLE_NEW_MULTICAST True )
-set ( ENABLE_PGM_TRANSPORT True )
-set ( ENABLE_RAL False )
-set ( ENABLE_SECURITY False )
-set ( ENABLE_STANDALONE_EPC False )
-set ( ENABLE_USE_CPU_EXECUTION_TIME True )
-set ( ENABLE_USE_MME False )
-set (  ENABLE_USE_RAW_SOCKET_FOR_SGI False)
-set ( ENABLE_VCD_FIFO False )
-set ( ENB_MODE True )
-set ( HARD_RT False )
-set ( JUMBO_FRAME True )
-set ( LARGE_SCALE False )
-set ( LINK_ENB_PDCP_TO_GTPV1U False )
-set ( LINK_ENB_PDCP_TO_IP_DRIVER False )
-set ( LINUX_LIST False )
-set ( LINUX True )
-set ( LOCALIZATION False )
-set ( LOG_NO_THREAD True )
-set ( LOWLATENCY False )
-set ( MAC_CONTEXT 1 )
-set ( MAX_NUM_CCs 1 )
-set ( MESSAGE_CHART_GENERATOR         False )
-set ( MESSAGE_CHART_GENERATOR_RLC_MAC False )
-set ( MESSAGE_CHART_GENERATOR_PHY     False )
-set ( MIH_C_MEDIEVAL_EXTENSIONS False )
-set ( MSG_PRINT False )
-set ( MU_RECEIVER False )
-set ( NAS_ADDRESS_FIX False )
-set ( NAS_BUILT_IN_EPC False )
-set ( NAS_BUILT_IN_UE False )
-set ( NAS_MME False )
-set ( NAS_NETLINK False )
-set ( NAS_UE False )
-set ( NB_ANTENNAS_RX 2 )
-set ( NB_ANTENNAS_TX 2 )
-set ( NB_ANTENNAS_TXRX 2 )
-set ( NEW_FFT True )
-set ( NO_RRM True )
-set ( OAI_EMU True )
-set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
-set ( OAI_NW_DRIVER_USE_NETLINK False )
-set ( OAISIM True )
-set ( OPENAIR1 True )
-set ( OPENAIR2 True )
-set ( OPENAIR_EMU False )
-set ( OPENAIR_LTE True )
-set ( PBS_SIM False )
-set ( PC_DSP False )
-set ( PC_TARGET False )
-set ( PDCP_MSG_PRINT False )
-set ( PDCP_USE_NETLINK False )
-set ( PDCP_USE_NETLINK_QUEUES False )
-set ( PERFECT_CE False )
-set ( PHY_ABSTRACTION True )
-set ( PHY_CONTEXT 1 )
-set ( PHY_EMUL False )
-set ( PHYSIM False )
-set ( PUCCH True )
-set ( RANDOM_BF False )
-set ( RF_BOARD "False" )
-set ( RLC_STOP_ON_LOST_PDU False )
-set ( RRC_ASN1_VERSION Rel8 )
-set ( RRC_DEFAULT_RAB_IS_AM False )
-set ( RRC_MSG_PRINT False )
-set ( RTAI False )
-set ( S1AP_LIMIT_STREAM_ID_TO_1 False )
-set ( S1AP_VERSION R10 )
-set ( SMBV False )
-set ( SPECTRA False )
-set ( STOP_ON_IP_TRAFFIC_OVERLOAD False )
-set ( TEST_OMG False )
-set ( TRACE_RLC_AM_BO False )
-set ( TRACE_RLC_AM_FREE_SDU False )
-set ( TRACE_RLC_AM_HOLE False )
-set ( TRACE_RLC_AM_PDU True )
-set ( TRACE_RLC_AM_RESEGMENT False )
-set ( TRACE_RLC_AM_RX_DECODE False )
-set ( TRACE_RLC_AM_RX False )
-set ( TRACE_RLC_AM_STATUS_CREATION False )
-set ( TRACE_RLC_AM_TX False )
-set ( TRACE_RLC_AM_TX_STATUS False )
-set ( TRACE_RLC_PAYLOAD False )
-set ( TRACE_RLC_UM_DAR False )
-set ( TRACE_RLC_UM_DISPLAY_ASCII_DATA False )
-set ( TRACE_RLC_UM_PDU True )
-set ( TRACE_RLC_UM_RX False )
-set ( TRACE_RLC_UM_SEGMENT False )
-set ( TRACE_RLC_UM_TX_STATUS False )
-set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
-set ( USE_MME "R8" )
-set ( USER_MODE True )
-set ( XER_PRINT True )
-set ( XFORMS False )
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
\ No newline at end of file
diff --git a/cmake_targets/autotests/010102/CMakeLists.txt b/cmake_targets/autotests/010102/CMakeLists.txt
deleted file mode 100644
index d05856ebb0e5e4b3ca11fb2b04014f61b947d40f..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010102/CMakeLists.txt
+++ /dev/null
@@ -1,106 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-set ( ADDR_CONF False )
-set ( DEBUG_OMG False )
-set ( DISABLE_USE_NAS False )
-set ( DISABLE_XER_PRINT False )
-set ( DRIVER2013 False )
-set ( EMOS False )
-set ( ENABLE_FXP True )
-set ( ENABLE_ITTI False )
-set ( ENABLE_NAS_UE_LOGGING False )
-set ( ENABLE_NEW_MULTICAST True )
-set ( ENABLE_PGM_TRANSPORT True )
-set ( ENABLE_RAL False )
-set ( ENABLE_SECURITY False )
-set ( ENABLE_STANDALONE_EPC False )
-set ( ENABLE_USE_CPU_EXECUTION_TIME True )
-set ( ENABLE_USE_MME False )
-set ( ENABLE_VCD_FIFO True )
-set ( ENB_MODE True )
-set ( EPC_BUILD False )
-set ( HARD_RT False )
-set ( JUMBO_FRAME True )
-set ( LARGE_SCALE False )
-set ( LINK_ENB_PDCP_TO_GTPV1U False )
-set ( LINK_ENB_PDCP_TO_IP_DRIVER False )
-set ( LINUX_LIST False )
-set ( LINUX True )
-set ( LOCALIZATION False )
-set ( LOG_NO_THREAD True )
-set ( LOWLATENCY False )
-set ( MAC_CONTEXT 1 )
-set ( MAX_NUM_CCs 1 )
-set ( MESSAGE_CHART_GENERATOR         False )
-set ( MESSAGE_CHART_GENERATOR_RLC_MAC False )
-set ( MESSAGE_CHART_GENERATOR_PHY     False )
-set ( MIH_C_MEDIEVAL_EXTENSIONS False )
-set ( MSG_PRINT False )
-set ( MU_RECEIVER False )
-set ( NAS_ADDRESS_FIX False )
-set ( NAS_BUILT_IN_EPC False )
-set ( NAS_BUILT_IN_UE False )
-set ( NAS_MME False )
-set ( NAS_NETLINK False )
-set ( NAS_UE False )
-set ( NB_ANTENNAS_RX 2 )
-set ( NB_ANTENNAS_TX 2 )
-set ( NB_ANTENNAS_TXRX 2 )
-set ( NEW_FFT True )
-set ( NO_RRM True )
-set ( OAI_EMU True )
-set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
-set ( OAI_NW_DRIVER_USE_NETLINK False )
-set ( OAISIM True )
-set ( OPENAIR1 False )
-set ( OPENAIR2 True )
-set ( OPENAIR_EMU False )
-set ( OPENAIR_LTE True )
-set ( PBS_SIM False )
-set ( PC_DSP False )
-set ( PC_TARGET False )
-set ( PDCP_MSG_PRINT False )
-set ( PDCP_USE_NETLINK_QUEUES False )
-set ( PDCP_USE_NETLINK True )
-set ( PERFECT_CE False )
-set ( PHY_ABSTRACTION True )
-set ( PHY_CONTEXT 1 )
-set ( PHY_EMUL False )
-set ( PHYSIM False )
-set ( PUCCH True )
-set ( RANDOM_BF False )
-set ( RF_BOARD False )
-set ( RLC_STOP_ON_LOST_PDU False )
-set ( RRC_ASN1_VERSION Rel8 )
-set ( RRC_DEFAULT_RAB_IS_AM False )
-set ( RRC_MSG_PRINT False )
-set ( RTAI False )
-set ( S1AP_LIMIT_STREAM_ID_TO_1 False )
-set ( S1AP_VERSION R10 )
-set ( SMBV False )
-set ( SPECTRA False )
-set ( STOP_ON_IP_TRAFFIC_OVERLOAD False )
-set ( TEST_OMG False )
-set ( TRACE_RLC_AM_BO False )
-set ( TRACE_RLC_AM_FREE_SDU False )
-set ( TRACE_RLC_AM_HOLE False )
-set ( TRACE_RLC_AM_PDU True )
-set ( TRACE_RLC_AM_RESEGMENT False )
-set ( TRACE_RLC_AM_RX_DECODE False )
-set ( TRACE_RLC_AM_RX False )
-set ( TRACE_RLC_AM_STATUS_CREATION False )
-set ( TRACE_RLC_AM_TX False )
-set ( TRACE_RLC_AM_TX_STATUS False )
-set ( TRACE_RLC_PAYLOAD False )
-set ( TRACE_RLC_UM_DAR False )
-set ( TRACE_RLC_UM_DISPLAY_ASCII_DATA False )
-set ( TRACE_RLC_UM_PDU True )
-set ( TRACE_RLC_UM_RX False )
-set ( TRACE_RLC_UM_SEGMENT False )
-set ( TRACE_RLC_UM_TX_STATUS False )
-set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
-set ( USE_MME False )
-set ( USER_MODE True )
-set ( XER_PRINT True )
-set ( XFORMS False )
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/010103/CMakeLists.txt b/cmake_targets/autotests/010103/CMakeLists.txt
deleted file mode 100644
index 9603067fe177b7d0b1e4902cace081cb21982212..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010103/CMakeLists.txt
+++ /dev/null
@@ -1,107 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-set ( ADDR_CONF False )
-set ( DEBUG_OMG False )
-set ( DISABLE_USE_NAS False )
-set ( DISABLE_XER_PRINT False )
-set ( DRIVER2013 True )
-set ( EMOS False )
-set ( ENABLE_FXP True )
-set ( ENABLE_ITTI False )
-set ( ENABLE_NAS_UE_LOGGING False )
-set ( ENABLE_NEW_MULTICAST False )
-set ( ENABLE_PGM_TRANSPORT False )
-set ( ENABLE_RAL False )
-set ( ENABLE_SECURITY False )
-set ( ENABLE_STANDALONE_EPC False )
-set ( ENABLE_USE_CPU_EXECUTION_TIME True )
-set ( ENABLE_USE_MME False )
-set ( ENABLE_VCD_FIFO True )
-set ( ENB_MODE True )
-set ( EPC_BUILD False )
-set ( HARD_RT False )
-set ( JUMBO_FRAME True )
-set ( LARGE_SCALE False )
-set ( LINK_ENB_PDCP_TO_GTPV1U False )
-set ( LINK_ENB_PDCP_TO_IP_DRIVER False )
-set ( LINUX False )
-set ( LINUX_LIST False )
-set ( LOCALIZATION False )
-set ( LOG_NO_THREAD True )
-set ( LOWLATENCY False )
-set ( MAC_CONTEXT 1 )
-set ( MAX_NUM_CCs 1 )
-set ( MESSAGE_CHART_GENERATOR         False )
-set ( MESSAGE_CHART_GENERATOR_RLC_MAC False )
-set ( MESSAGE_CHART_GENERATOR_PHY     False )
-set ( MIH_C_MEDIEVAL_EXTENSIONS False )
-set ( MSG_PRINT False )
-set ( MU_RECEIVER False )
-set ( NAS_ADDRESS_FIX False )
-set ( NAS_BUILT_IN_EPC False )
-set ( NAS_BUILT_IN_UE False )
-set ( NAS_MME False )
-set ( NAS_NETLINK False )
-set ( NAS_UE False )
-set ( NB_ANTENNAS_RX 2 )
-set ( NB_ANTENNAS_TX 2 )
-set ( NB_ANTENNAS_TXRX 2 )
-set ( NEW_FFT True )
-set ( NO_RRM True )
-set ( OAI_EMU False )
-set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
-set ( OAI_NW_DRIVER_USE_NETLINK False )
-set ( OAISIM False )
-set ( OPENAIR1 True )
-set ( OPENAIR2 True )
-set ( OPENAIR_EMU False )
-set ( OPENAIR_LTE True )
-set ( PBS_SIM False )
-set ( PC_DSP True )
-set ( PC_TARGET True )
-set ( PDCP_MSG_PRINT False )
-set ( PDCP_USE_NETLINK False )
-set ( PDCP_USE_NETLINK_QUEUES False )
-set ( PERFECT_CE False )
-set ( PHY_ABSTRACTION False )
-set ( PHY_CONTEXT 1 )
-set ( PHY_EMUL False )
-set ( PHYSIM True )
-set ( PUCCH True )
-set ( RANDOM_BF False )
-set ( RF_BOARD OAI_USRP )
-set ( RLC_STOP_ON_LOST_PDU False )
-set ( RRC_ASN1_VERSION Rel10 )
-set ( RRC_DEFAULT_RAB_IS_AM False )
-set ( RRC_MSG_PRINT False )
-set ( RTAI False )
-set ( S1AP_LIMIT_STREAM_ID_TO_1 False )
-set ( S1AP_VERSION R10 )
-set ( SMBV False )
-set ( SPECTRA False )
-set ( STOP_ON_IP_TRAFFIC_OVERLOAD False )
-set ( TEST_OMG False )
-set ( TRACE_RLC_AM_BO False )
-set ( TRACE_RLC_AM_FREE_SDU False )
-set ( TRACE_RLC_AM_HOLE False )
-set ( TRACE_RLC_AM_PDU False )
-set ( TRACE_RLC_AM_RESEGMENT False )
-set ( TRACE_RLC_AM_RX_DECODE False )
-set ( TRACE_RLC_AM_RX False )
-set ( TRACE_RLC_AM_STATUS_CREATION False )
-set ( TRACE_RLC_AM_TX False )
-set ( TRACE_RLC_AM_TX_STATUS False )
-set ( TRACE_RLC_PAYLOAD False )
-set ( TRACE_RLC_UM_DAR False )
-set ( TRACE_RLC_UM_DISPLAY_ASCII_DATA False )
-set ( TRACE_RLC_UM_PDU False )
-set ( TRACE_RLC_UM_RX False )
-set ( TRACE_RLC_UM_SEGMENT False )
-set ( TRACE_RLC_UM_TX_STATUS False )
-set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
-set ( USE_MME False )
-set ( USER_MODE True )
-set ( XER_PRINT False )
-set ( XFORMS False )
-set(PACKAGE_NAME "lte-softmodem")
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/010103/CMakeLists.txt.Rel10 b/cmake_targets/autotests/010103/CMakeLists.txt.Rel10
deleted file mode 100644
index 6af3c587628f4a4dbb952cf45fed10d41754bb31..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010103/CMakeLists.txt.Rel10
+++ /dev/null
@@ -1,107 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-set ( ADDR_CONF False )
-set ( DEBUG_OMG False )
-set ( DISABLE_USE_NAS False )
-set ( DISABLE_XER_PRINT False )
-set ( DRIVER2013 True )
-set ( EMOS False )
-set ( ENABLE_FXP True )
-set ( ENABLE_ITTI False )
-set ( ENABLE_NAS_UE_LOGGING False )
-set ( ENABLE_NEW_MULTICAST False )
-set ( ENABLE_PGM_TRANSPORT False )
-set ( ENABLE_RAL False )
-set ( ENABLE_SECURITY False )
-set ( ENABLE_STANDALONE_EPC False )
-set ( ENABLE_USE_CPU_EXECUTION_TIME True )
-set ( ENABLE_USE_MME False )
-set ( ENABLE_VCD_FIFO True )
-set ( ENB_MODE True )
-set ( EPC_BUILD False )
-set ( HARD_RT False )
-set ( JUMBO_FRAME True )
-set ( LARGE_SCALE False )
-set ( LINK_ENB_PDCP_TO_GTPV1U False )
-set ( LINK_ENB_PDCP_TO_IP_DRIVER False )
-set ( LINUX False )
-set ( LINUX_LIST False )
-set ( LOCALIZATION False )
-set ( LOG_NO_THREAD True )
-set ( LOWLATENCY False )
-set ( MAC_CONTEXT 1 )
-set ( MAX_NUM_CCs 1 )
-set ( MESSAGE_CHART_GENERATOR         False )
-set ( MESSAGE_CHART_GENERATOR_RLC_MAC False )
-set ( MESSAGE_CHART_GENERATOR_PHY     False )
-set ( MIH_C_MEDIEVAL_EXTENSIONS False )
-set ( MSG_PRINT False )
-set ( MU_RECEIVER False )
-set ( NAS_ADDRESS_FIX False )
-set ( NAS_BUILT_IN_EPC False )
-set ( NAS_BUILT_IN_UE False )
-set ( NAS_MME False )
-set ( NAS_NETLINK False )
-set ( NAS_UE False )
-set ( NB_ANTENNAS_RX 2 )
-set ( NB_ANTENNAS_TX 2 )
-set ( NB_ANTENNAS_TXRX 2 )
-set ( NEW_FFT True )
-set ( NO_RRM True )
-set ( OAI_EMU False )
-set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
-set ( OAI_NW_DRIVER_USE_NETLINK False )
-set ( OAISIM False )
-set ( OPENAIR1 True )
-set ( OPENAIR2 True )
-set ( OPENAIR_EMU False )
-set ( OPENAIR_LTE True )
-set ( PBS_SIM False )
-set ( PC_DSP True )
-set ( PC_TARGET True )
-set ( PDCP_MSG_PRINT False )
-set ( PDCP_USE_NETLINK False )
-set ( PDCP_USE_NETLINK_QUEUES False )
-set ( PERFECT_CE False )
-set ( PHY_ABSTRACTION False )
-set ( PHY_CONTEXT 1 )
-set ( PHY_EMUL False )
-set ( PHYSIM True )
-set ( PUCCH True )
-set ( RANDOM_BF False )
-set ( RF_BOARD EXMIMO )
-set ( RLC_STOP_ON_LOST_PDU False )
-set ( RRC_ASN1_VERSION Rel10 )
-set ( RRC_DEFAULT_RAB_IS_AM False )
-set ( RRC_MSG_PRINT False )
-set ( RTAI False )
-set ( S1AP_LIMIT_STREAM_ID_TO_1 False )
-set ( S1AP_VERSION R10 )
-set ( SMBV False )
-set ( SPECTRA False )
-set ( STOP_ON_IP_TRAFFIC_OVERLOAD False )
-set ( TEST_OMG False )
-set ( TRACE_RLC_AM_BO False )
-set ( TRACE_RLC_AM_FREE_SDU False )
-set ( TRACE_RLC_AM_HOLE False )
-set ( TRACE_RLC_AM_PDU False )
-set ( TRACE_RLC_AM_RESEGMENT False )
-set ( TRACE_RLC_AM_RX_DECODE False )
-set ( TRACE_RLC_AM_RX False )
-set ( TRACE_RLC_AM_STATUS_CREATION False )
-set ( TRACE_RLC_AM_TX False )
-set ( TRACE_RLC_AM_TX_STATUS False )
-set ( TRACE_RLC_PAYLOAD False )
-set ( TRACE_RLC_UM_DAR False )
-set ( TRACE_RLC_UM_DISPLAY_ASCII_DATA False )
-set ( TRACE_RLC_UM_PDU False )
-set ( TRACE_RLC_UM_RX False )
-set ( TRACE_RLC_UM_SEGMENT False )
-set ( TRACE_RLC_UM_TX_STATUS False )
-set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
-set ( USE_MME False )
-set ( USER_MODE True )
-set ( XER_PRINT False )
-set ( XFORMS False )
-set(PACKAGE_NAME "lte-softmodem")
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/010103/CMakeLists.txt.Rel8 b/cmake_targets/autotests/010103/CMakeLists.txt.Rel8
deleted file mode 100644
index dafbed61d90060c2a685d05e5dbf73650226adbb..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010103/CMakeLists.txt.Rel8
+++ /dev/null
@@ -1,107 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-set ( ADDR_CONF False )
-set ( DEBUG_OMG False )
-set ( DISABLE_USE_NAS False )
-set ( DISABLE_XER_PRINT False )
-set ( DRIVER2013 True )
-set ( EMOS False )
-set ( ENABLE_FXP True )
-set ( ENABLE_ITTI False )
-set ( ENABLE_NAS_UE_LOGGING False )
-set ( ENABLE_NEW_MULTICAST False )
-set ( ENABLE_PGM_TRANSPORT False )
-set ( ENABLE_RAL False )
-set ( ENABLE_SECURITY False )
-set ( ENABLE_STANDALONE_EPC False )
-set ( ENABLE_USE_CPU_EXECUTION_TIME True )
-set ( ENABLE_USE_MME False )
-set ( ENABLE_VCD_FIFO True )
-set ( ENB_MODE True )
-set ( EPC_BUILD False )
-set ( HARD_RT False )
-set ( JUMBO_FRAME True )
-set ( LARGE_SCALE False )
-set ( LINK_ENB_PDCP_TO_GTPV1U False )
-set ( LINK_ENB_PDCP_TO_IP_DRIVER False )
-set ( LINUX False )
-set ( LINUX_LIST False )
-set ( LOCALIZATION False )
-set ( LOG_NO_THREAD True )
-set ( LOWLATENCY False )
-set ( MAC_CONTEXT 1 )
-set ( MAX_NUM_CCs 1 )
-set ( MESSAGE_CHART_GENERATOR         False )
-set ( MESSAGE_CHART_GENERATOR_RLC_MAC False )
-set ( MESSAGE_CHART_GENERATOR_PHY     False )
-set ( MIH_C_MEDIEVAL_EXTENSIONS False )
-set ( MSG_PRINT False )
-set ( MU_RECEIVER False )
-set ( NAS_ADDRESS_FIX False )
-set ( NAS_BUILT_IN_EPC False )
-set ( NAS_BUILT_IN_UE False )
-set ( NAS_MME False )
-set ( NAS_NETLINK False )
-set ( NAS_UE False )
-set ( NB_ANTENNAS_RX 2 )
-set ( NB_ANTENNAS_TX 2 )
-set ( NB_ANTENNAS_TXRX 2 )
-set ( NEW_FFT True )
-set ( NO_RRM True )
-set ( OAI_EMU False )
-set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
-set ( OAI_NW_DRIVER_USE_NETLINK False )
-set ( OAISIM False )
-set ( OPENAIR1 True )
-set ( OPENAIR2 True )
-set ( OPENAIR_EMU False )
-set ( OPENAIR_LTE True )
-set ( PBS_SIM False )
-set ( PC_DSP True )
-set ( PC_TARGET True )
-set ( PDCP_MSG_PRINT False )
-set ( PDCP_USE_NETLINK False )
-set ( PDCP_USE_NETLINK_QUEUES False )
-set ( PERFECT_CE False )
-set ( PHY_ABSTRACTION False )
-set ( PHY_CONTEXT 1 )
-set ( PHY_EMUL False )
-set ( PHYSIM True )
-set ( PUCCH True )
-set ( RANDOM_BF False )
-set ( RF_BOARD EXMIMO )
-set ( RLC_STOP_ON_LOST_PDU False )
-set ( RRC_ASN1_VERSION Rel8 )
-set ( RRC_DEFAULT_RAB_IS_AM False )
-set ( RRC_MSG_PRINT False )
-set ( RTAI False )
-set ( S1AP_LIMIT_STREAM_ID_TO_1 False )
-set ( S1AP_VERSION R10 )
-set ( SMBV False )
-set ( SPECTRA False )
-set ( STOP_ON_IP_TRAFFIC_OVERLOAD False )
-set ( TEST_OMG False )
-set ( TRACE_RLC_AM_BO False )
-set ( TRACE_RLC_AM_FREE_SDU False )
-set ( TRACE_RLC_AM_HOLE False )
-set ( TRACE_RLC_AM_PDU False )
-set ( TRACE_RLC_AM_RESEGMENT False )
-set ( TRACE_RLC_AM_RX_DECODE False )
-set ( TRACE_RLC_AM_RX False )
-set ( TRACE_RLC_AM_STATUS_CREATION False )
-set ( TRACE_RLC_AM_TX False )
-set ( TRACE_RLC_AM_TX_STATUS False )
-set ( TRACE_RLC_PAYLOAD False )
-set ( TRACE_RLC_UM_DAR False )
-set ( TRACE_RLC_UM_DISPLAY_ASCII_DATA False )
-set ( TRACE_RLC_UM_PDU False )
-set ( TRACE_RLC_UM_RX False )
-set ( TRACE_RLC_UM_SEGMENT False )
-set ( TRACE_RLC_UM_TX_STATUS False )
-set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
-set ( USE_MME False )
-set ( USER_MODE True )
-set ( XER_PRINT False )
-set ( XFORMS False )
-set(PACKAGE_NAME "lte-softmodem")
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/010103/CMakeLists.txt.USRP b/cmake_targets/autotests/010103/CMakeLists.txt.USRP
deleted file mode 100644
index 9603067fe177b7d0b1e4902cace081cb21982212..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010103/CMakeLists.txt.USRP
+++ /dev/null
@@ -1,107 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-set ( ADDR_CONF False )
-set ( DEBUG_OMG False )
-set ( DISABLE_USE_NAS False )
-set ( DISABLE_XER_PRINT False )
-set ( DRIVER2013 True )
-set ( EMOS False )
-set ( ENABLE_FXP True )
-set ( ENABLE_ITTI False )
-set ( ENABLE_NAS_UE_LOGGING False )
-set ( ENABLE_NEW_MULTICAST False )
-set ( ENABLE_PGM_TRANSPORT False )
-set ( ENABLE_RAL False )
-set ( ENABLE_SECURITY False )
-set ( ENABLE_STANDALONE_EPC False )
-set ( ENABLE_USE_CPU_EXECUTION_TIME True )
-set ( ENABLE_USE_MME False )
-set ( ENABLE_VCD_FIFO True )
-set ( ENB_MODE True )
-set ( EPC_BUILD False )
-set ( HARD_RT False )
-set ( JUMBO_FRAME True )
-set ( LARGE_SCALE False )
-set ( LINK_ENB_PDCP_TO_GTPV1U False )
-set ( LINK_ENB_PDCP_TO_IP_DRIVER False )
-set ( LINUX False )
-set ( LINUX_LIST False )
-set ( LOCALIZATION False )
-set ( LOG_NO_THREAD True )
-set ( LOWLATENCY False )
-set ( MAC_CONTEXT 1 )
-set ( MAX_NUM_CCs 1 )
-set ( MESSAGE_CHART_GENERATOR         False )
-set ( MESSAGE_CHART_GENERATOR_RLC_MAC False )
-set ( MESSAGE_CHART_GENERATOR_PHY     False )
-set ( MIH_C_MEDIEVAL_EXTENSIONS False )
-set ( MSG_PRINT False )
-set ( MU_RECEIVER False )
-set ( NAS_ADDRESS_FIX False )
-set ( NAS_BUILT_IN_EPC False )
-set ( NAS_BUILT_IN_UE False )
-set ( NAS_MME False )
-set ( NAS_NETLINK False )
-set ( NAS_UE False )
-set ( NB_ANTENNAS_RX 2 )
-set ( NB_ANTENNAS_TX 2 )
-set ( NB_ANTENNAS_TXRX 2 )
-set ( NEW_FFT True )
-set ( NO_RRM True )
-set ( OAI_EMU False )
-set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
-set ( OAI_NW_DRIVER_USE_NETLINK False )
-set ( OAISIM False )
-set ( OPENAIR1 True )
-set ( OPENAIR2 True )
-set ( OPENAIR_EMU False )
-set ( OPENAIR_LTE True )
-set ( PBS_SIM False )
-set ( PC_DSP True )
-set ( PC_TARGET True )
-set ( PDCP_MSG_PRINT False )
-set ( PDCP_USE_NETLINK False )
-set ( PDCP_USE_NETLINK_QUEUES False )
-set ( PERFECT_CE False )
-set ( PHY_ABSTRACTION False )
-set ( PHY_CONTEXT 1 )
-set ( PHY_EMUL False )
-set ( PHYSIM True )
-set ( PUCCH True )
-set ( RANDOM_BF False )
-set ( RF_BOARD OAI_USRP )
-set ( RLC_STOP_ON_LOST_PDU False )
-set ( RRC_ASN1_VERSION Rel10 )
-set ( RRC_DEFAULT_RAB_IS_AM False )
-set ( RRC_MSG_PRINT False )
-set ( RTAI False )
-set ( S1AP_LIMIT_STREAM_ID_TO_1 False )
-set ( S1AP_VERSION R10 )
-set ( SMBV False )
-set ( SPECTRA False )
-set ( STOP_ON_IP_TRAFFIC_OVERLOAD False )
-set ( TEST_OMG False )
-set ( TRACE_RLC_AM_BO False )
-set ( TRACE_RLC_AM_FREE_SDU False )
-set ( TRACE_RLC_AM_HOLE False )
-set ( TRACE_RLC_AM_PDU False )
-set ( TRACE_RLC_AM_RESEGMENT False )
-set ( TRACE_RLC_AM_RX_DECODE False )
-set ( TRACE_RLC_AM_RX False )
-set ( TRACE_RLC_AM_STATUS_CREATION False )
-set ( TRACE_RLC_AM_TX False )
-set ( TRACE_RLC_AM_TX_STATUS False )
-set ( TRACE_RLC_PAYLOAD False )
-set ( TRACE_RLC_UM_DAR False )
-set ( TRACE_RLC_UM_DISPLAY_ASCII_DATA False )
-set ( TRACE_RLC_UM_PDU False )
-set ( TRACE_RLC_UM_RX False )
-set ( TRACE_RLC_UM_SEGMENT False )
-set ( TRACE_RLC_UM_TX_STATUS False )
-set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
-set ( USE_MME False )
-set ( USER_MODE True )
-set ( XER_PRINT False )
-set ( XFORMS False )
-set(PACKAGE_NAME "lte-softmodem")
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/010104/CMakeLists.txt b/cmake_targets/autotests/010104/CMakeLists.txt
deleted file mode 100644
index 36a9eb75da8391cf560ac6a1210e6c7bcb10f517..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010104/CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-set(PACKAGE_NAME "unitary_tests_simulators")
-set(PHYSIM True)
-set(RF_BOARD None)
-set(XFORMS False)
-
-set(DEBUG_PHY False)
-set(MU_RECIEVER Flase)
-set(RANDOM_BF False)
-set(PBS_SIM False)
-set(PERFECT_CE False)
-set(NAS_UE False)
-set(MESSAGE_CHART_GENERATOR False)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/010106/CMakeLists.txt b/cmake_targets/autotests/010106/CMakeLists.txt
deleted file mode 100644
index 2b315ad411b706ee5d136490fceff909f31041e7..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010106/CMakeLists.txt
+++ /dev/null
@@ -1,75 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-set(ADDR_CONF False)
-set(DEBUG_OMG False)
-set(DISABLE_XER_PRINT False)
-set(DRIVER2013 False)
-set(ENABLE_FXP True)
-set(ENABLE_ITTI True)
-set(ENABLE_NAS_UE_LOGGING False)
-set(ENABLE_NEW_MULTICAST True)
-set(ENABLE_PGM_TRANSPORT True)
-set(ENABLE_RAL False)
-set(ENABLE_SECURITY False)
-set(ENABLE_USE_CPU_EXECUTION_TIME True)
-set(ENABLE_USE_MME False)
-set(ENABLE_VCD_FIFO True)
-set(HARD_RT False)
-set(JUMBO_FRAME True)
-set(LARGE_SCALE False)
-set(LINK_ENB_PDCP_TO_GTPV1U False)
-set(LINUX_LIST False)
-set(LINUX True)
-set(LOCALIZATION False)
-set(LOG_NO_THREAD True)
-set(LOWLATENCY False)
-set(MAC_CONTEXT 1)
-set(MAX_NUM_CCs 1)
-set(MESSAGE_CHART_GENERATOR         False )
-set(MESSAGE_CHART_GENERATOR_RLC_MAC False )
-set(MESSAGE_CHART_GENERATOR_PHY     False )
-set(MIH_C_MEDIEVAL_EXTENSIONS False)
-set(MSG_PRINT False)
-set(MU_RECEIVER False)
-set(NAS_ADDRESS_FIX true)
-set(NAS_NETLINK True)
-set(NAS_UE True)
-set(NEW_FFT True)
-set(NO_RRM True)
-set(OAI_EMU True)
-set(OAI_EMU True)
-set(OAI_NW_DRIVER_TYPE_ETHERNET False)
-set(OPENAIR1 False)
-set(OPENAIR2 True)
-set(OPENAIR_EMU True)
-set(OPENAIR_LTE True)
-set (PACKAGE_NAME "oaisim")
-set(PACKAGE_NAME "oaisim")
-set(PBS_SIM False)
-set(PC_DSP False)
-set(PC_TARGET False)
-set(PDCP_MSG_PRINT False)
-set(PERFECT_CE False)
-set(PHY_ABSTRACTION True)
-set(PHY_ABSTRACTION True)
-set(PHY_EMUL False)
-set(PHYSIM False)
-set(PUCCH True)
-set(RANDOM_BF False)
-set(RF_BOARD "NoBoard")
-set(RLC_STOP_ON_LOST_PDU False)
-set(RRC_ASN1_VERSION Rel8)
-set(RRC_ASN1_VERSION "Rel8")
-set(RRC_MSG_PRINT False)
-set(RTAI False)
-set(SECU False)
-set(SMBV False)
-set(SPECTRA False)
-set(TEST_OMG False)
-set(USE_3GPP_ADDR_AS_LINK_ADDR False)
-set(USE_MME False)
-set(USER_MODE True)
-set(XER_PRINT False)
-set(XFORMS False)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/010107/CMakeLists.txt b/cmake_targets/autotests/010107/CMakeLists.txt
deleted file mode 100644
index a2aa19942e0d2ea114e129f47c556d3bca187ff1..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010107/CMakeLists.txt
+++ /dev/null
@@ -1,107 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-set ( ADDR_CONF False )
-set ( DEBUG_OMG False )
-set ( DISABLE_USE_NAS False )
-set ( DISABLE_XER_PRINT False )
-set ( DRIVER2013 False )
-set ( EMOS False )
-set ( ENABLE_FXP True )
-set ( ENABLE_ITTI False )
-set ( ENABLE_NAS_UE_LOGGING False )
-set ( ENABLE_NEW_MULTICAST True )
-set ( ENABLE_PGM_TRANSPORT True )
-set ( ENABLE_RAL False )
-set ( ENABLE_SECURITY False )
-set ( ENABLE_STANDALONE_EPC False )
-set ( ENABLE_USE_CPU_EXECUTION_TIME True )
-set ( ENABLE_USE_MME False )
-set ( ENABLE_VCD_FIFO True )
-set ( ENB_MODE True )
-set ( EPC_BUILD False )
-set ( HARD_RT False )
-set ( JUMBO_FRAME True )
-set ( LARGE_SCALE False )
-set ( LINK_ENB_PDCP_TO_GTPV1U False )
-set ( LINK_ENB_PDCP_TO_IP_DRIVER False )
-set ( LINUX_LIST False )
-set ( LINUX True )
-set ( LOCALIZATION False )
-set ( LOG_NO_THREAD True )
-set ( LOWLATENCY False )
-set ( MAC_CONTEXT 1 )
-set ( MAX_NUM_CCs 1 )
-set ( MESSAGE_CHART_GENERATOR         False )
-set ( MESSAGE_CHART_GENERATOR_RLC_MAC False )
-set ( MESSAGE_CHART_GENERATOR_PHY     False )
-set ( MIH_C_MEDIEVAL_EXTENSIONS False )
-set ( MSG_PRINT False )
-set ( MU_RECEIVER False )
-set ( NAS_ADDRESS_FIX False )
-set ( NAS_BUILT_IN_EPC False )
-set ( NAS_BUILT_IN_UE False )
-set ( NAS_MME False )
-set ( NAS_NETLINK False )
-set ( NAS_UE False )
-set ( NB_ANTENNAS_RX 2 )
-set ( NB_ANTENNAS_TX 2 )
-set ( NB_ANTENNAS_TXRX 2 )
-set ( NEW_FFT True )
-set ( NO_RRM True )
-set ( OAI_EMU True )
-set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
-set ( OAI_NW_DRIVER_USE_NETLINK False )
-set ( OAISIM True )
-set ( OPENAIR1 False )
-set ( OPENAIR2 True )
-set ( OPENAIR_EMU False )
-set ( OPENAIR_LTE True )
-set ( PBS_SIM False )
-set ( PC_DSP False )
-set ( PC_TARGET False )
-set ( PDCP_MSG_PRINT False )
-set ( PDCP_USE_NETLINK False )
-set ( PDCP_USE_NETLINK_QUEUES False )
-set ( PERFECT_CE False )
-set ( PHY_ABSTRACTION True )
-set ( PHY_CONTEXT 1 )
-set ( PHY_EMUL False )
-set ( PHYSIM False )
-set ( PUCCH True )
-set ( RANDOM_BF False )
-set ( RF_BOARD False )
-set ( RLC_STOP_ON_LOST_PDU True )
-set ( RRC_ASN1_VERSION Rel10 )
-set ( RRC_DEFAULT_RAB_IS_AM False )
-set ( RRC_MSG_PRINT False )
-set ( RTAI False )
-set ( S1AP_LIMIT_STREAM_ID_TO_1 False )
-set ( S1AP_VERSION R10 )
-set ( SMBV False )
-set ( SPECTRA False )
-set ( STOP_ON_IP_TRAFFIC_OVERLOAD False )
-set ( TEST_OMG False )
-set ( TRACE_RLC_AM_BO False )
-set ( TRACE_RLC_AM_FREE_SDU False )
-set ( TRACE_RLC_AM_HOLE False )
-set ( TRACE_RLC_AM_PDU True )
-set ( TRACE_RLC_AM_RESEGMENT False )
-set ( TRACE_RLC_AM_RX_DECODE False )
-set ( TRACE_RLC_AM_RX False )
-set ( TRACE_RLC_AM_STATUS_CREATION False )
-set ( TRACE_RLC_AM_TX False )
-set ( TRACE_RLC_AM_TX_STATUS False )
-set ( TRACE_RLC_PAYLOAD False )
-set ( TRACE_RLC_UM_DAR False )
-set ( TRACE_RLC_UM_DISPLAY_ASCII_DATA False )
-set ( TRACE_RLC_UM_PDU True )
-set ( TRACE_RLC_UM_RX False )
-set ( TRACE_RLC_UM_SEGMENT False )
-set ( TRACE_RLC_UM_TX_STATUS False )
-set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
-set ( USE_MME False )
-set ( USER_MODE True )
-set ( XER_PRINT True )
-set ( XFORMS False )
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/010108/CMakeLists.txt b/cmake_targets/autotests/010108/CMakeLists.txt
deleted file mode 100644
index 63bfb1066f7193a07cc598e45aad85b68bb070d4..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010108/CMakeLists.txt
+++ /dev/null
@@ -1,74 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-set(ADDR_CONF False)
-set(DEBUG_OMG False)
-set(DISABLE_XER_PRINT False)
-set(DRIVER2013 False)
-set(ENABLE_FXP True)
-set(ENABLE_ITTI True)
-set(ENABLE_NAS_UE_LOGGING False)
-set(ENABLE_NEW_MULTICAST True)
-set(ENABLE_PGM_TRANSPORT True)
-set(ENABLE_RAL False)
-set(ENABLE_SECURITY False)
-set(ENABLE_USE_CPU_EXECUTION_TIME True)
-set(ENABLE_USE_MME False)
-set(ENABLE_VCD_FIFO True)
-set(HARD_RT False)
-set(JUMBO_FRAME True)
-set(LARGE_SCALE False)
-set(LINK_ENB_PDCP_TO_GTPV1U False)
-set(LINUX_LIST False)
-set(LINUX True)
-set(LOCALIZATION False)
-set(LOG_NO_THREAD True)
-set(LOWLATENCY False)
-set(MAC_CONTEXT 1)
-set(MAX_NUM_CCs 1)
-set(MESSAGE_CHART_GENERATOR         False)
-set(MESSAGE_CHART_GENERATOR_RLC_MAC False)
-set(MESSAGE_CHART_GENERATOR_PHY     False)
-set(MIH_C_MEDIEVAL_EXTENSIONS False)
-set(MSG_PRINT False)
-set(MU_RECEIVER False)
-set(NAS_ADDRESS_FIX true)
-set(NAS_NETLINK True)
-set(NAS_UE True)
-set(NEW_FFT True)
-set(NO_RRM True)
-set(OAI_EMU True)
-set(OAI_NW_DRIVER_TYPE_ETHERNET False)
-set(OPENAIR1 False)
-set(OPENAIR2 True)
-set(OPENAIR_EMU True)
-set(OPENAIR_LTE True)
-set (PACKAGE_NAME "oaisim")
-set(PACKAGE_NAME "oaisim")
-set(PBS_SIM False)
-set(PC_DSP False)
-set(PC_TARGET False)
-set(PDCP_MSG_PRINT False)
-set(PERFECT_CE False)
-set(PHY_ABSTRACTION True)
-set(PHY_ABSTRACTION True)
-set(PHY_EMUL False)
-set(PHYSIM False)
-set(PUCCH True)
-set(RANDOM_BF False)
-set(RF_BOARD "NoBoard")
-set(RLC_STOP_ON_LOST_PDU True)
-set(RRC_ASN1_VERSION Rel10)
-set(RRC_ASN1_VERSION "Rel10")
-set(RRC_MSG_PRINT False)
-set(RTAI False)
-set(SECU False)
-set(SMBV False)
-set(SPECTRA False)
-set(TEST_OMG False)
-set(USE_3GPP_ADDR_AS_LINK_ADDR False)
-set(USE_MME False)
-set(USER_MODE True)
-set(XER_PRINT False)
-set(XFORMS False)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/010120/CMakeLists.txt b/cmake_targets/autotests/010120/CMakeLists.txt
deleted file mode 100644
index d05856ebb0e5e4b3ca11fb2b04014f61b947d40f..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010120/CMakeLists.txt
+++ /dev/null
@@ -1,106 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-set ( ADDR_CONF False )
-set ( DEBUG_OMG False )
-set ( DISABLE_USE_NAS False )
-set ( DISABLE_XER_PRINT False )
-set ( DRIVER2013 False )
-set ( EMOS False )
-set ( ENABLE_FXP True )
-set ( ENABLE_ITTI False )
-set ( ENABLE_NAS_UE_LOGGING False )
-set ( ENABLE_NEW_MULTICAST True )
-set ( ENABLE_PGM_TRANSPORT True )
-set ( ENABLE_RAL False )
-set ( ENABLE_SECURITY False )
-set ( ENABLE_STANDALONE_EPC False )
-set ( ENABLE_USE_CPU_EXECUTION_TIME True )
-set ( ENABLE_USE_MME False )
-set ( ENABLE_VCD_FIFO True )
-set ( ENB_MODE True )
-set ( EPC_BUILD False )
-set ( HARD_RT False )
-set ( JUMBO_FRAME True )
-set ( LARGE_SCALE False )
-set ( LINK_ENB_PDCP_TO_GTPV1U False )
-set ( LINK_ENB_PDCP_TO_IP_DRIVER False )
-set ( LINUX_LIST False )
-set ( LINUX True )
-set ( LOCALIZATION False )
-set ( LOG_NO_THREAD True )
-set ( LOWLATENCY False )
-set ( MAC_CONTEXT 1 )
-set ( MAX_NUM_CCs 1 )
-set ( MESSAGE_CHART_GENERATOR         False )
-set ( MESSAGE_CHART_GENERATOR_RLC_MAC False )
-set ( MESSAGE_CHART_GENERATOR_PHY     False )
-set ( MIH_C_MEDIEVAL_EXTENSIONS False )
-set ( MSG_PRINT False )
-set ( MU_RECEIVER False )
-set ( NAS_ADDRESS_FIX False )
-set ( NAS_BUILT_IN_EPC False )
-set ( NAS_BUILT_IN_UE False )
-set ( NAS_MME False )
-set ( NAS_NETLINK False )
-set ( NAS_UE False )
-set ( NB_ANTENNAS_RX 2 )
-set ( NB_ANTENNAS_TX 2 )
-set ( NB_ANTENNAS_TXRX 2 )
-set ( NEW_FFT True )
-set ( NO_RRM True )
-set ( OAI_EMU True )
-set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
-set ( OAI_NW_DRIVER_USE_NETLINK False )
-set ( OAISIM True )
-set ( OPENAIR1 False )
-set ( OPENAIR2 True )
-set ( OPENAIR_EMU False )
-set ( OPENAIR_LTE True )
-set ( PBS_SIM False )
-set ( PC_DSP False )
-set ( PC_TARGET False )
-set ( PDCP_MSG_PRINT False )
-set ( PDCP_USE_NETLINK_QUEUES False )
-set ( PDCP_USE_NETLINK True )
-set ( PERFECT_CE False )
-set ( PHY_ABSTRACTION True )
-set ( PHY_CONTEXT 1 )
-set ( PHY_EMUL False )
-set ( PHYSIM False )
-set ( PUCCH True )
-set ( RANDOM_BF False )
-set ( RF_BOARD False )
-set ( RLC_STOP_ON_LOST_PDU False )
-set ( RRC_ASN1_VERSION Rel8 )
-set ( RRC_DEFAULT_RAB_IS_AM False )
-set ( RRC_MSG_PRINT False )
-set ( RTAI False )
-set ( S1AP_LIMIT_STREAM_ID_TO_1 False )
-set ( S1AP_VERSION R10 )
-set ( SMBV False )
-set ( SPECTRA False )
-set ( STOP_ON_IP_TRAFFIC_OVERLOAD False )
-set ( TEST_OMG False )
-set ( TRACE_RLC_AM_BO False )
-set ( TRACE_RLC_AM_FREE_SDU False )
-set ( TRACE_RLC_AM_HOLE False )
-set ( TRACE_RLC_AM_PDU True )
-set ( TRACE_RLC_AM_RESEGMENT False )
-set ( TRACE_RLC_AM_RX_DECODE False )
-set ( TRACE_RLC_AM_RX False )
-set ( TRACE_RLC_AM_STATUS_CREATION False )
-set ( TRACE_RLC_AM_TX False )
-set ( TRACE_RLC_AM_TX_STATUS False )
-set ( TRACE_RLC_PAYLOAD False )
-set ( TRACE_RLC_UM_DAR False )
-set ( TRACE_RLC_UM_DISPLAY_ASCII_DATA False )
-set ( TRACE_RLC_UM_PDU True )
-set ( TRACE_RLC_UM_RX False )
-set ( TRACE_RLC_UM_SEGMENT False )
-set ( TRACE_RLC_UM_TX_STATUS False )
-set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
-set ( USE_MME False )
-set ( USER_MODE True )
-set ( XER_PRINT True )
-set ( XFORMS False )
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/010130/CMakeLists.txt b/cmake_targets/autotests/010130/CMakeLists.txt
deleted file mode 100644
index 45c99b01ab5c684a16661316a6fe9c69c1ec480a..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010130/CMakeLists.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-set(ENABLE_VCD_FIFO False )
-set(ENABLE_ITTI False )
-set(RF_BOARD "ETHERNET")
-set(PACKAGE_NAME "\"rrh_gw\"")
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/010200/CMakeLists.template b/cmake_targets/autotests/010200/CMakeLists.template
deleted file mode 100644
index 1ccd57fffda1b22e705436528bbf91d662519273..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010200/CMakeLists.template
+++ /dev/null
@@ -1,82 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-set (  CMAKE_BUILD_TYPE "RelWithDebInfo" )
-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 )
-set (  ENABLE_NEW_MULTICAST True )
-set (  ENABLE_PGM_TRANSPORT True )
-set (  ENABLE_RAL False )
-set (  ENABLE_SECURITY False )
-set (  ENABLE_STANDALONE_EPC False)
-set (  ENABLE_USE_CPU_EXECUTION_TIME True )
-set (  ENABLE_USE_MME False )
-set (  ENABLE_USE_RAW_SOCKET_FOR_SGI False)
-set (  ENABLE_VCD_FIFO False )
-set (  ENB_MODE True )
-set (  EXMIMO_IOT True )
-set (  HARD_RT False )
-set (  JUMBO_FRAME True )
-set (  LARGE_SCALE False )
-set (  LINK_ENB_PDCP_TO_GTPV1U False)
-set (  LINUX_LIST False )
-set (  LINUX True )
-set (  LOCALIZATION False )
-set (  LOG_NO_THREAD 1 )
-set (  LOWLATENCY False )
-set (  MAC_CONTEXT 1 )
-set (  MAX_NUM_CCs 1 )
-set (  MESSAGE_CHART_GENERATOR         False )
-set (  MESSAGE_CHART_GENERATOR_RLC_MAC False )
-set (  MESSAGE_CHART_GENERATOR_PHY     False )
-set (  MIH_C_MEDIEVAL_EXTENSIONS False )
-set (  MSG_PRINT False )
-set (  MU_RECEIVER False )
-set (  NAS_ADDRESS_FIX True )
-set (  NAS_BUILT_IN_UE False)
-set (  NAS_MME False )
-set (  NAS_UE False )
-set (  NB_ANTENNAS_RX "2" )
-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 True )
-set (  OAI_NW_DRIVER_USE_NETLINK True )
-set (  OPENAIR1 True )
-set (  OPENAIR2 True )
-set (  OPENAIR_EMU False )
-set (  OPENAIR_LTE True )
-set (  PACKAGE_NAME "oaisim" )
-set (  PBS_SIM False )
-set (  PDCP_USE_NETLINK True )
-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 )
-set (  PUCCH True )
-set (  RANDOM_BF False )
-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 )
-set (  TEST_OMG False )
-set (  USE_3GPP_ADDR_AS_LINK_ADDR False )
-set (  USE_MME "R10" )
-set (  USER_MODE True )
-set (  XER_PRINT False )
diff --git a/cmake_targets/autotests/010200/CMakeLists.txt b/cmake_targets/autotests/010200/CMakeLists.txt
deleted file mode 100644
index e6c4bdfe476b509a37e93e9c2357f4107aacad7e..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010200/CMakeLists.txt
+++ /dev/null
@@ -1,87 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-set (  CMAKE_BUILD_TYPE "RelWithDebInfo" )
-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 )
-set (  ENABLE_NEW_MULTICAST True )
-set (  ENABLE_PGM_TRANSPORT True )
-set (  ENABLE_RAL False )
-set (  ENABLE_SECURITY False )
-set (  ENABLE_STANDALONE_EPC False)
-set (  ENABLE_USE_CPU_EXECUTION_TIME True )
-set (  ENABLE_USE_MME False )
-set (  ENABLE_USE_RAW_SOCKET_FOR_SGI False)
-set (  ENABLE_VCD_FIFO False )
-set (  ENB_MODE True )
-set (  EXMIMO_IOT True )
-set (  HARD_RT False )
-set (  JUMBO_FRAME True )
-set (  LARGE_SCALE False )
-set (  LINK_ENB_PDCP_TO_GTPV1U False)
-set (  LINUX_LIST False )
-set (  LINUX True )
-set (  LOCALIZATION False )
-set (  LOG_NO_THREAD 1 )
-set (  LOWLATENCY False )
-set (  MAC_CONTEXT 1 )
-set (  MAX_NUM_CCs 1 )
-set (  MESSAGE_CHART_GENERATOR         False )
-set (  MESSAGE_CHART_GENERATOR_RLC_MAC False )
-set (  MESSAGE_CHART_GENERATOR_PHY     False )
-set (  MIH_C_MEDIEVAL_EXTENSIONS False )
-set (  MSG_PRINT False )
-set (  MU_RECEIVER False )
-set (  NAS_ADDRESS_FIX True )
-set (  NAS_BUILT_IN_UE False)
-set (  NAS_MME False )
-set (  NAS_UE False )
-set (  NB_ANTENNAS_RX "2" )
-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 True )
-set (  OAI_NW_DRIVER_USE_NETLINK True )
-set (  OPENAIR1 True )
-set (  OPENAIR2 True )
-set (  OPENAIR_EMU False )
-set (  OPENAIR_LTE True )
-set (  PACKAGE_NAME "oaisim" )
-set (  PBS_SIM False )
-set (  PDCP_USE_NETLINK True )
-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 )
-set (  PUCCH True )
-set (  RANDOM_BF False )
-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 )
-set (  TEST_OMG False )
-set (  USE_3GPP_ADDR_AS_LINK_ADDR False )
-set (  USE_MME "R10" )
-set (  USER_MODE True )
-set (  XER_PRINT False )
-set ( XFORMS False )
-set ( PRINT_STATS False )
-set ( RRC_ASN1_VERSION "Rel10")
-set ( ENABLE_VCD_FIFO False )
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/010201/CMakeLists.template b/cmake_targets/autotests/010201/CMakeLists.template
deleted file mode 100644
index 1ccd57fffda1b22e705436528bbf91d662519273..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010201/CMakeLists.template
+++ /dev/null
@@ -1,82 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-set (  CMAKE_BUILD_TYPE "RelWithDebInfo" )
-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 )
-set (  ENABLE_NEW_MULTICAST True )
-set (  ENABLE_PGM_TRANSPORT True )
-set (  ENABLE_RAL False )
-set (  ENABLE_SECURITY False )
-set (  ENABLE_STANDALONE_EPC False)
-set (  ENABLE_USE_CPU_EXECUTION_TIME True )
-set (  ENABLE_USE_MME False )
-set (  ENABLE_USE_RAW_SOCKET_FOR_SGI False)
-set (  ENABLE_VCD_FIFO False )
-set (  ENB_MODE True )
-set (  EXMIMO_IOT True )
-set (  HARD_RT False )
-set (  JUMBO_FRAME True )
-set (  LARGE_SCALE False )
-set (  LINK_ENB_PDCP_TO_GTPV1U False)
-set (  LINUX_LIST False )
-set (  LINUX True )
-set (  LOCALIZATION False )
-set (  LOG_NO_THREAD 1 )
-set (  LOWLATENCY False )
-set (  MAC_CONTEXT 1 )
-set (  MAX_NUM_CCs 1 )
-set (  MESSAGE_CHART_GENERATOR         False )
-set (  MESSAGE_CHART_GENERATOR_RLC_MAC False )
-set (  MESSAGE_CHART_GENERATOR_PHY     False )
-set (  MIH_C_MEDIEVAL_EXTENSIONS False )
-set (  MSG_PRINT False )
-set (  MU_RECEIVER False )
-set (  NAS_ADDRESS_FIX True )
-set (  NAS_BUILT_IN_UE False)
-set (  NAS_MME False )
-set (  NAS_UE False )
-set (  NB_ANTENNAS_RX "2" )
-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 True )
-set (  OAI_NW_DRIVER_USE_NETLINK True )
-set (  OPENAIR1 True )
-set (  OPENAIR2 True )
-set (  OPENAIR_EMU False )
-set (  OPENAIR_LTE True )
-set (  PACKAGE_NAME "oaisim" )
-set (  PBS_SIM False )
-set (  PDCP_USE_NETLINK True )
-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 )
-set (  PUCCH True )
-set (  RANDOM_BF False )
-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 )
-set (  TEST_OMG False )
-set (  USE_3GPP_ADDR_AS_LINK_ADDR False )
-set (  USE_MME "R10" )
-set (  USER_MODE True )
-set (  XER_PRINT False )
diff --git a/cmake_targets/autotests/010201/CMakeLists.txt b/cmake_targets/autotests/010201/CMakeLists.txt
deleted file mode 100644
index e6c4bdfe476b509a37e93e9c2357f4107aacad7e..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010201/CMakeLists.txt
+++ /dev/null
@@ -1,87 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-set (  CMAKE_BUILD_TYPE "RelWithDebInfo" )
-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 )
-set (  ENABLE_NEW_MULTICAST True )
-set (  ENABLE_PGM_TRANSPORT True )
-set (  ENABLE_RAL False )
-set (  ENABLE_SECURITY False )
-set (  ENABLE_STANDALONE_EPC False)
-set (  ENABLE_USE_CPU_EXECUTION_TIME True )
-set (  ENABLE_USE_MME False )
-set (  ENABLE_USE_RAW_SOCKET_FOR_SGI False)
-set (  ENABLE_VCD_FIFO False )
-set (  ENB_MODE True )
-set (  EXMIMO_IOT True )
-set (  HARD_RT False )
-set (  JUMBO_FRAME True )
-set (  LARGE_SCALE False )
-set (  LINK_ENB_PDCP_TO_GTPV1U False)
-set (  LINUX_LIST False )
-set (  LINUX True )
-set (  LOCALIZATION False )
-set (  LOG_NO_THREAD 1 )
-set (  LOWLATENCY False )
-set (  MAC_CONTEXT 1 )
-set (  MAX_NUM_CCs 1 )
-set (  MESSAGE_CHART_GENERATOR         False )
-set (  MESSAGE_CHART_GENERATOR_RLC_MAC False )
-set (  MESSAGE_CHART_GENERATOR_PHY     False )
-set (  MIH_C_MEDIEVAL_EXTENSIONS False )
-set (  MSG_PRINT False )
-set (  MU_RECEIVER False )
-set (  NAS_ADDRESS_FIX True )
-set (  NAS_BUILT_IN_UE False)
-set (  NAS_MME False )
-set (  NAS_UE False )
-set (  NB_ANTENNAS_RX "2" )
-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 True )
-set (  OAI_NW_DRIVER_USE_NETLINK True )
-set (  OPENAIR1 True )
-set (  OPENAIR2 True )
-set (  OPENAIR_EMU False )
-set (  OPENAIR_LTE True )
-set (  PACKAGE_NAME "oaisim" )
-set (  PBS_SIM False )
-set (  PDCP_USE_NETLINK True )
-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 )
-set (  PUCCH True )
-set (  RANDOM_BF False )
-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 )
-set (  TEST_OMG False )
-set (  USE_3GPP_ADDR_AS_LINK_ADDR False )
-set (  USE_MME "R10" )
-set (  USER_MODE True )
-set (  XER_PRINT False )
-set ( XFORMS False )
-set ( PRINT_STATS False )
-set ( RRC_ASN1_VERSION "Rel10")
-set ( ENABLE_VCD_FIFO False )
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/010202/CMakeLists.txt b/cmake_targets/autotests/010202/CMakeLists.txt
deleted file mode 100644
index e6c4bdfe476b509a37e93e9c2357f4107aacad7e..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010202/CMakeLists.txt
+++ /dev/null
@@ -1,87 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-set (  CMAKE_BUILD_TYPE "RelWithDebInfo" )
-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 )
-set (  ENABLE_NEW_MULTICAST True )
-set (  ENABLE_PGM_TRANSPORT True )
-set (  ENABLE_RAL False )
-set (  ENABLE_SECURITY False )
-set (  ENABLE_STANDALONE_EPC False)
-set (  ENABLE_USE_CPU_EXECUTION_TIME True )
-set (  ENABLE_USE_MME False )
-set (  ENABLE_USE_RAW_SOCKET_FOR_SGI False)
-set (  ENABLE_VCD_FIFO False )
-set (  ENB_MODE True )
-set (  EXMIMO_IOT True )
-set (  HARD_RT False )
-set (  JUMBO_FRAME True )
-set (  LARGE_SCALE False )
-set (  LINK_ENB_PDCP_TO_GTPV1U False)
-set (  LINUX_LIST False )
-set (  LINUX True )
-set (  LOCALIZATION False )
-set (  LOG_NO_THREAD 1 )
-set (  LOWLATENCY False )
-set (  MAC_CONTEXT 1 )
-set (  MAX_NUM_CCs 1 )
-set (  MESSAGE_CHART_GENERATOR         False )
-set (  MESSAGE_CHART_GENERATOR_RLC_MAC False )
-set (  MESSAGE_CHART_GENERATOR_PHY     False )
-set (  MIH_C_MEDIEVAL_EXTENSIONS False )
-set (  MSG_PRINT False )
-set (  MU_RECEIVER False )
-set (  NAS_ADDRESS_FIX True )
-set (  NAS_BUILT_IN_UE False)
-set (  NAS_MME False )
-set (  NAS_UE False )
-set (  NB_ANTENNAS_RX "2" )
-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 True )
-set (  OAI_NW_DRIVER_USE_NETLINK True )
-set (  OPENAIR1 True )
-set (  OPENAIR2 True )
-set (  OPENAIR_EMU False )
-set (  OPENAIR_LTE True )
-set (  PACKAGE_NAME "oaisim" )
-set (  PBS_SIM False )
-set (  PDCP_USE_NETLINK True )
-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 )
-set (  PUCCH True )
-set (  RANDOM_BF False )
-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 )
-set (  TEST_OMG False )
-set (  USE_3GPP_ADDR_AS_LINK_ADDR False )
-set (  USE_MME "R10" )
-set (  USER_MODE True )
-set (  XER_PRINT False )
-set ( XFORMS False )
-set ( PRINT_STATS False )
-set ( RRC_ASN1_VERSION "Rel10")
-set ( ENABLE_VCD_FIFO False )
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/010203/CMakeLists.txt b/cmake_targets/autotests/010203/CMakeLists.txt
deleted file mode 100644
index e6c4bdfe476b509a37e93e9c2357f4107aacad7e..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010203/CMakeLists.txt
+++ /dev/null
@@ -1,87 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-set (  CMAKE_BUILD_TYPE "RelWithDebInfo" )
-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 )
-set (  ENABLE_NEW_MULTICAST True )
-set (  ENABLE_PGM_TRANSPORT True )
-set (  ENABLE_RAL False )
-set (  ENABLE_SECURITY False )
-set (  ENABLE_STANDALONE_EPC False)
-set (  ENABLE_USE_CPU_EXECUTION_TIME True )
-set (  ENABLE_USE_MME False )
-set (  ENABLE_USE_RAW_SOCKET_FOR_SGI False)
-set (  ENABLE_VCD_FIFO False )
-set (  ENB_MODE True )
-set (  EXMIMO_IOT True )
-set (  HARD_RT False )
-set (  JUMBO_FRAME True )
-set (  LARGE_SCALE False )
-set (  LINK_ENB_PDCP_TO_GTPV1U False)
-set (  LINUX_LIST False )
-set (  LINUX True )
-set (  LOCALIZATION False )
-set (  LOG_NO_THREAD 1 )
-set (  LOWLATENCY False )
-set (  MAC_CONTEXT 1 )
-set (  MAX_NUM_CCs 1 )
-set (  MESSAGE_CHART_GENERATOR         False )
-set (  MESSAGE_CHART_GENERATOR_RLC_MAC False )
-set (  MESSAGE_CHART_GENERATOR_PHY     False )
-set (  MIH_C_MEDIEVAL_EXTENSIONS False )
-set (  MSG_PRINT False )
-set (  MU_RECEIVER False )
-set (  NAS_ADDRESS_FIX True )
-set (  NAS_BUILT_IN_UE False)
-set (  NAS_MME False )
-set (  NAS_UE False )
-set (  NB_ANTENNAS_RX "2" )
-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 True )
-set (  OAI_NW_DRIVER_USE_NETLINK True )
-set (  OPENAIR1 True )
-set (  OPENAIR2 True )
-set (  OPENAIR_EMU False )
-set (  OPENAIR_LTE True )
-set (  PACKAGE_NAME "oaisim" )
-set (  PBS_SIM False )
-set (  PDCP_USE_NETLINK True )
-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 )
-set (  PUCCH True )
-set (  RANDOM_BF False )
-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 )
-set (  TEST_OMG False )
-set (  USE_3GPP_ADDR_AS_LINK_ADDR False )
-set (  USE_MME "R10" )
-set (  USER_MODE True )
-set (  XER_PRINT False )
-set ( XFORMS False )
-set ( PRINT_STATS False )
-set ( RRC_ASN1_VERSION "Rel10")
-set ( ENABLE_VCD_FIFO False )
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/010204/CMakeLists.txt b/cmake_targets/autotests/010204/CMakeLists.txt
deleted file mode 100644
index e6c4bdfe476b509a37e93e9c2357f4107aacad7e..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010204/CMakeLists.txt
+++ /dev/null
@@ -1,87 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-set (  CMAKE_BUILD_TYPE "RelWithDebInfo" )
-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 )
-set (  ENABLE_NEW_MULTICAST True )
-set (  ENABLE_PGM_TRANSPORT True )
-set (  ENABLE_RAL False )
-set (  ENABLE_SECURITY False )
-set (  ENABLE_STANDALONE_EPC False)
-set (  ENABLE_USE_CPU_EXECUTION_TIME True )
-set (  ENABLE_USE_MME False )
-set (  ENABLE_USE_RAW_SOCKET_FOR_SGI False)
-set (  ENABLE_VCD_FIFO False )
-set (  ENB_MODE True )
-set (  EXMIMO_IOT True )
-set (  HARD_RT False )
-set (  JUMBO_FRAME True )
-set (  LARGE_SCALE False )
-set (  LINK_ENB_PDCP_TO_GTPV1U False)
-set (  LINUX_LIST False )
-set (  LINUX True )
-set (  LOCALIZATION False )
-set (  LOG_NO_THREAD 1 )
-set (  LOWLATENCY False )
-set (  MAC_CONTEXT 1 )
-set (  MAX_NUM_CCs 1 )
-set (  MESSAGE_CHART_GENERATOR         False )
-set (  MESSAGE_CHART_GENERATOR_RLC_MAC False )
-set (  MESSAGE_CHART_GENERATOR_PHY     False )
-set (  MIH_C_MEDIEVAL_EXTENSIONS False )
-set (  MSG_PRINT False )
-set (  MU_RECEIVER False )
-set (  NAS_ADDRESS_FIX True )
-set (  NAS_BUILT_IN_UE False)
-set (  NAS_MME False )
-set (  NAS_UE False )
-set (  NB_ANTENNAS_RX "2" )
-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 True )
-set (  OAI_NW_DRIVER_USE_NETLINK True )
-set (  OPENAIR1 True )
-set (  OPENAIR2 True )
-set (  OPENAIR_EMU False )
-set (  OPENAIR_LTE True )
-set (  PACKAGE_NAME "oaisim" )
-set (  PBS_SIM False )
-set (  PDCP_USE_NETLINK True )
-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 )
-set (  PUCCH True )
-set (  RANDOM_BF False )
-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 )
-set (  TEST_OMG False )
-set (  USE_3GPP_ADDR_AS_LINK_ADDR False )
-set (  USE_MME "R10" )
-set (  USER_MODE True )
-set (  XER_PRINT False )
-set ( XFORMS False )
-set ( PRINT_STATS False )
-set ( RRC_ASN1_VERSION "Rel10")
-set ( ENABLE_VCD_FIFO False )
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/010205/CMakeLists.txt b/cmake_targets/autotests/010205/CMakeLists.txt
deleted file mode 100644
index e6c4bdfe476b509a37e93e9c2357f4107aacad7e..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010205/CMakeLists.txt
+++ /dev/null
@@ -1,87 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-set (  CMAKE_BUILD_TYPE "RelWithDebInfo" )
-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 )
-set (  ENABLE_NEW_MULTICAST True )
-set (  ENABLE_PGM_TRANSPORT True )
-set (  ENABLE_RAL False )
-set (  ENABLE_SECURITY False )
-set (  ENABLE_STANDALONE_EPC False)
-set (  ENABLE_USE_CPU_EXECUTION_TIME True )
-set (  ENABLE_USE_MME False )
-set (  ENABLE_USE_RAW_SOCKET_FOR_SGI False)
-set (  ENABLE_VCD_FIFO False )
-set (  ENB_MODE True )
-set (  EXMIMO_IOT True )
-set (  HARD_RT False )
-set (  JUMBO_FRAME True )
-set (  LARGE_SCALE False )
-set (  LINK_ENB_PDCP_TO_GTPV1U False)
-set (  LINUX_LIST False )
-set (  LINUX True )
-set (  LOCALIZATION False )
-set (  LOG_NO_THREAD 1 )
-set (  LOWLATENCY False )
-set (  MAC_CONTEXT 1 )
-set (  MAX_NUM_CCs 1 )
-set (  MESSAGE_CHART_GENERATOR         False )
-set (  MESSAGE_CHART_GENERATOR_RLC_MAC False )
-set (  MESSAGE_CHART_GENERATOR_PHY     False )
-set (  MIH_C_MEDIEVAL_EXTENSIONS False )
-set (  MSG_PRINT False )
-set (  MU_RECEIVER False )
-set (  NAS_ADDRESS_FIX True )
-set (  NAS_BUILT_IN_UE False)
-set (  NAS_MME False )
-set (  NAS_UE False )
-set (  NB_ANTENNAS_RX "2" )
-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 True )
-set (  OAI_NW_DRIVER_USE_NETLINK True )
-set (  OPENAIR1 True )
-set (  OPENAIR2 True )
-set (  OPENAIR_EMU False )
-set (  OPENAIR_LTE True )
-set (  PACKAGE_NAME "oaisim" )
-set (  PBS_SIM False )
-set (  PDCP_USE_NETLINK True )
-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 )
-set (  PUCCH True )
-set (  RANDOM_BF False )
-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 )
-set (  TEST_OMG False )
-set (  USE_3GPP_ADDR_AS_LINK_ADDR False )
-set (  USE_MME "R10" )
-set (  USER_MODE True )
-set (  XER_PRINT False )
-set ( XFORMS False )
-set ( PRINT_STATS False )
-set ( RRC_ASN1_VERSION "Rel10")
-set ( ENABLE_VCD_FIFO False )
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/010300/CMakeLists.txt b/cmake_targets/autotests/010300/CMakeLists.txt
deleted file mode 100644
index 36a9eb75da8391cf560ac6a1210e6c7bcb10f517..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010300/CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-set(PACKAGE_NAME "unitary_tests_simulators")
-set(PHYSIM True)
-set(RF_BOARD None)
-set(XFORMS False)
-
-set(DEBUG_PHY False)
-set(MU_RECIEVER Flase)
-set(RANDOM_BF False)
-set(PBS_SIM False)
-set(PERFECT_CE False)
-set(NAS_UE False)
-set(MESSAGE_CHART_GENERATOR False)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/010301/CMakeLists.txt b/cmake_targets/autotests/010301/CMakeLists.txt
deleted file mode 100644
index 36a9eb75da8391cf560ac6a1210e6c7bcb10f517..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010301/CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-set(PACKAGE_NAME "unitary_tests_simulators")
-set(PHYSIM True)
-set(RF_BOARD None)
-set(XFORMS False)
-
-set(DEBUG_PHY False)
-set(MU_RECIEVER Flase)
-set(RANDOM_BF False)
-set(PBS_SIM False)
-set(PERFECT_CE False)
-set(NAS_UE False)
-set(MESSAGE_CHART_GENERATOR False)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/010302/CMakeLists.txt b/cmake_targets/autotests/010302/CMakeLists.txt
deleted file mode 100644
index 36a9eb75da8391cf560ac6a1210e6c7bcb10f517..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010302/CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-set(PACKAGE_NAME "unitary_tests_simulators")
-set(PHYSIM True)
-set(RF_BOARD None)
-set(XFORMS False)
-
-set(DEBUG_PHY False)
-set(MU_RECIEVER Flase)
-set(RANDOM_BF False)
-set(PBS_SIM False)
-set(PERFECT_CE False)
-set(NAS_UE False)
-set(MESSAGE_CHART_GENERATOR False)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/010303/CMakeLists.txt b/cmake_targets/autotests/010303/CMakeLists.txt
deleted file mode 100644
index 36a9eb75da8391cf560ac6a1210e6c7bcb10f517..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010303/CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-set(PACKAGE_NAME "unitary_tests_simulators")
-set(PHYSIM True)
-set(RF_BOARD None)
-set(XFORMS False)
-
-set(DEBUG_PHY False)
-set(MU_RECIEVER Flase)
-set(RANDOM_BF False)
-set(PBS_SIM False)
-set(PERFECT_CE False)
-set(NAS_UE False)
-set(MESSAGE_CHART_GENERATOR False)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/010304/CMakeLists.txt b/cmake_targets/autotests/010304/CMakeLists.txt
deleted file mode 100644
index 36a9eb75da8391cf560ac6a1210e6c7bcb10f517..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010304/CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-set(PACKAGE_NAME "unitary_tests_simulators")
-set(PHYSIM True)
-set(RF_BOARD None)
-set(XFORMS False)
-
-set(DEBUG_PHY False)
-set(MU_RECIEVER Flase)
-set(RANDOM_BF False)
-set(PBS_SIM False)
-set(PERFECT_CE False)
-set(NAS_UE False)
-set(MESSAGE_CHART_GENERATOR False)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/010305/CMakeLists.txt b/cmake_targets/autotests/010305/CMakeLists.txt
deleted file mode 100644
index 36a9eb75da8391cf560ac6a1210e6c7bcb10f517..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010305/CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-set(PACKAGE_NAME "unitary_tests_simulators")
-set(PHYSIM True)
-set(RF_BOARD None)
-set(XFORMS False)
-
-set(DEBUG_PHY False)
-set(MU_RECIEVER Flase)
-set(RANDOM_BF False)
-set(PBS_SIM False)
-set(PERFECT_CE False)
-set(NAS_UE False)
-set(MESSAGE_CHART_GENERATOR False)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/010400/CMakeLists.txt b/cmake_targets/autotests/010400/CMakeLists.txt
deleted file mode 100644
index e6c4bdfe476b509a37e93e9c2357f4107aacad7e..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010400/CMakeLists.txt
+++ /dev/null
@@ -1,87 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-set (  CMAKE_BUILD_TYPE "RelWithDebInfo" )
-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 )
-set (  ENABLE_NEW_MULTICAST True )
-set (  ENABLE_PGM_TRANSPORT True )
-set (  ENABLE_RAL False )
-set (  ENABLE_SECURITY False )
-set (  ENABLE_STANDALONE_EPC False)
-set (  ENABLE_USE_CPU_EXECUTION_TIME True )
-set (  ENABLE_USE_MME False )
-set (  ENABLE_USE_RAW_SOCKET_FOR_SGI False)
-set (  ENABLE_VCD_FIFO False )
-set (  ENB_MODE True )
-set (  EXMIMO_IOT True )
-set (  HARD_RT False )
-set (  JUMBO_FRAME True )
-set (  LARGE_SCALE False )
-set (  LINK_ENB_PDCP_TO_GTPV1U False)
-set (  LINUX_LIST False )
-set (  LINUX True )
-set (  LOCALIZATION False )
-set (  LOG_NO_THREAD 1 )
-set (  LOWLATENCY False )
-set (  MAC_CONTEXT 1 )
-set (  MAX_NUM_CCs 1 )
-set (  MESSAGE_CHART_GENERATOR         False )
-set (  MESSAGE_CHART_GENERATOR_RLC_MAC False )
-set (  MESSAGE_CHART_GENERATOR_PHY     False )
-set (  MIH_C_MEDIEVAL_EXTENSIONS False )
-set (  MSG_PRINT False )
-set (  MU_RECEIVER False )
-set (  NAS_ADDRESS_FIX True )
-set (  NAS_BUILT_IN_UE False)
-set (  NAS_MME False )
-set (  NAS_UE False )
-set (  NB_ANTENNAS_RX "2" )
-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 True )
-set (  OAI_NW_DRIVER_USE_NETLINK True )
-set (  OPENAIR1 True )
-set (  OPENAIR2 True )
-set (  OPENAIR_EMU False )
-set (  OPENAIR_LTE True )
-set (  PACKAGE_NAME "oaisim" )
-set (  PBS_SIM False )
-set (  PDCP_USE_NETLINK True )
-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 )
-set (  PUCCH True )
-set (  RANDOM_BF False )
-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 )
-set (  TEST_OMG False )
-set (  USE_3GPP_ADDR_AS_LINK_ADDR False )
-set (  USE_MME "R10" )
-set (  USER_MODE True )
-set (  XER_PRINT False )
-set ( XFORMS False )
-set ( PRINT_STATS False )
-set ( RRC_ASN1_VERSION "Rel10")
-set ( ENABLE_VCD_FIFO False )
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/010401/CMakeLists.txt b/cmake_targets/autotests/010401/CMakeLists.txt
deleted file mode 100644
index e6c4bdfe476b509a37e93e9c2357f4107aacad7e..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010401/CMakeLists.txt
+++ /dev/null
@@ -1,87 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-set (  CMAKE_BUILD_TYPE "RelWithDebInfo" )
-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 )
-set (  ENABLE_NEW_MULTICAST True )
-set (  ENABLE_PGM_TRANSPORT True )
-set (  ENABLE_RAL False )
-set (  ENABLE_SECURITY False )
-set (  ENABLE_STANDALONE_EPC False)
-set (  ENABLE_USE_CPU_EXECUTION_TIME True )
-set (  ENABLE_USE_MME False )
-set (  ENABLE_USE_RAW_SOCKET_FOR_SGI False)
-set (  ENABLE_VCD_FIFO False )
-set (  ENB_MODE True )
-set (  EXMIMO_IOT True )
-set (  HARD_RT False )
-set (  JUMBO_FRAME True )
-set (  LARGE_SCALE False )
-set (  LINK_ENB_PDCP_TO_GTPV1U False)
-set (  LINUX_LIST False )
-set (  LINUX True )
-set (  LOCALIZATION False )
-set (  LOG_NO_THREAD 1 )
-set (  LOWLATENCY False )
-set (  MAC_CONTEXT 1 )
-set (  MAX_NUM_CCs 1 )
-set (  MESSAGE_CHART_GENERATOR         False )
-set (  MESSAGE_CHART_GENERATOR_RLC_MAC False )
-set (  MESSAGE_CHART_GENERATOR_PHY     False )
-set (  MIH_C_MEDIEVAL_EXTENSIONS False )
-set (  MSG_PRINT False )
-set (  MU_RECEIVER False )
-set (  NAS_ADDRESS_FIX True )
-set (  NAS_BUILT_IN_UE False)
-set (  NAS_MME False )
-set (  NAS_UE False )
-set (  NB_ANTENNAS_RX "2" )
-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 True )
-set (  OAI_NW_DRIVER_USE_NETLINK True )
-set (  OPENAIR1 True )
-set (  OPENAIR2 True )
-set (  OPENAIR_EMU False )
-set (  OPENAIR_LTE True )
-set (  PACKAGE_NAME "oaisim" )
-set (  PBS_SIM False )
-set (  PDCP_USE_NETLINK True )
-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 )
-set (  PUCCH True )
-set (  RANDOM_BF False )
-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 )
-set (  TEST_OMG False )
-set (  USE_3GPP_ADDR_AS_LINK_ADDR False )
-set (  USE_MME "R10" )
-set (  USER_MODE True )
-set (  XER_PRINT False )
-set ( XFORMS False )
-set ( PRINT_STATS False )
-set ( RRC_ASN1_VERSION "Rel10")
-set ( ENABLE_VCD_FIFO False )
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/010402/CMakeLists.txt b/cmake_targets/autotests/010402/CMakeLists.txt
deleted file mode 100644
index e6c4bdfe476b509a37e93e9c2357f4107aacad7e..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010402/CMakeLists.txt
+++ /dev/null
@@ -1,87 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-set (  CMAKE_BUILD_TYPE "RelWithDebInfo" )
-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 )
-set (  ENABLE_NEW_MULTICAST True )
-set (  ENABLE_PGM_TRANSPORT True )
-set (  ENABLE_RAL False )
-set (  ENABLE_SECURITY False )
-set (  ENABLE_STANDALONE_EPC False)
-set (  ENABLE_USE_CPU_EXECUTION_TIME True )
-set (  ENABLE_USE_MME False )
-set (  ENABLE_USE_RAW_SOCKET_FOR_SGI False)
-set (  ENABLE_VCD_FIFO False )
-set (  ENB_MODE True )
-set (  EXMIMO_IOT True )
-set (  HARD_RT False )
-set (  JUMBO_FRAME True )
-set (  LARGE_SCALE False )
-set (  LINK_ENB_PDCP_TO_GTPV1U False)
-set (  LINUX_LIST False )
-set (  LINUX True )
-set (  LOCALIZATION False )
-set (  LOG_NO_THREAD 1 )
-set (  LOWLATENCY False )
-set (  MAC_CONTEXT 1 )
-set (  MAX_NUM_CCs 1 )
-set (  MESSAGE_CHART_GENERATOR         False )
-set (  MESSAGE_CHART_GENERATOR_RLC_MAC False )
-set (  MESSAGE_CHART_GENERATOR_PHY     False )
-set (  MIH_C_MEDIEVAL_EXTENSIONS False )
-set (  MSG_PRINT False )
-set (  MU_RECEIVER False )
-set (  NAS_ADDRESS_FIX True )
-set (  NAS_BUILT_IN_UE False)
-set (  NAS_MME False )
-set (  NAS_UE False )
-set (  NB_ANTENNAS_RX "2" )
-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 True )
-set (  OAI_NW_DRIVER_USE_NETLINK True )
-set (  OPENAIR1 True )
-set (  OPENAIR2 True )
-set (  OPENAIR_EMU False )
-set (  OPENAIR_LTE True )
-set (  PACKAGE_NAME "oaisim" )
-set (  PBS_SIM False )
-set (  PDCP_USE_NETLINK True )
-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 )
-set (  PUCCH True )
-set (  RANDOM_BF False )
-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 )
-set (  TEST_OMG False )
-set (  USE_3GPP_ADDR_AS_LINK_ADDR False )
-set (  USE_MME "R10" )
-set (  USER_MODE True )
-set (  XER_PRINT False )
-set ( XFORMS False )
-set ( PRINT_STATS False )
-set ( RRC_ASN1_VERSION "Rel10")
-set ( ENABLE_VCD_FIFO False )
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/010403/CMakeLists.txt b/cmake_targets/autotests/010403/CMakeLists.txt
deleted file mode 100644
index e6c4bdfe476b509a37e93e9c2357f4107aacad7e..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/010403/CMakeLists.txt
+++ /dev/null
@@ -1,87 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-set (  CMAKE_BUILD_TYPE "RelWithDebInfo" )
-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 )
-set (  ENABLE_NEW_MULTICAST True )
-set (  ENABLE_PGM_TRANSPORT True )
-set (  ENABLE_RAL False )
-set (  ENABLE_SECURITY False )
-set (  ENABLE_STANDALONE_EPC False)
-set (  ENABLE_USE_CPU_EXECUTION_TIME True )
-set (  ENABLE_USE_MME False )
-set (  ENABLE_USE_RAW_SOCKET_FOR_SGI False)
-set (  ENABLE_VCD_FIFO False )
-set (  ENB_MODE True )
-set (  EXMIMO_IOT True )
-set (  HARD_RT False )
-set (  JUMBO_FRAME True )
-set (  LARGE_SCALE False )
-set (  LINK_ENB_PDCP_TO_GTPV1U False)
-set (  LINUX_LIST False )
-set (  LINUX True )
-set (  LOCALIZATION False )
-set (  LOG_NO_THREAD 1 )
-set (  LOWLATENCY False )
-set (  MAC_CONTEXT 1 )
-set (  MAX_NUM_CCs 1 )
-set (  MESSAGE_CHART_GENERATOR         False )
-set (  MESSAGE_CHART_GENERATOR_RLC_MAC False )
-set (  MESSAGE_CHART_GENERATOR_PHY     False )
-set (  MIH_C_MEDIEVAL_EXTENSIONS False )
-set (  MSG_PRINT False )
-set (  MU_RECEIVER False )
-set (  NAS_ADDRESS_FIX True )
-set (  NAS_BUILT_IN_UE False)
-set (  NAS_MME False )
-set (  NAS_UE False )
-set (  NB_ANTENNAS_RX "2" )
-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 True )
-set (  OAI_NW_DRIVER_USE_NETLINK True )
-set (  OPENAIR1 True )
-set (  OPENAIR2 True )
-set (  OPENAIR_EMU False )
-set (  OPENAIR_LTE True )
-set (  PACKAGE_NAME "oaisim" )
-set (  PBS_SIM False )
-set (  PDCP_USE_NETLINK True )
-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 )
-set (  PUCCH True )
-set (  RANDOM_BF False )
-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 )
-set (  TEST_OMG False )
-set (  USE_3GPP_ADDR_AS_LINK_ADDR False )
-set (  USE_MME "R10" )
-set (  USER_MODE True )
-set (  XER_PRINT False )
-set ( XFORMS False )
-set ( PRINT_STATS False )
-set ( RRC_ASN1_VERSION "Rel10")
-set ( ENABLE_VCD_FIFO False )
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/015000/CMakeLists.txt b/cmake_targets/autotests/015000/CMakeLists.txt
deleted file mode 100644
index 47cf5074b5b067a9c8e75608e6c5757504ba46c0..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/015000/CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-set(PACKAGE_NAME "unitary_tests_simulators")
-set(PHYSIM True)
-set(RF_BOARD None)
-set(XFORMS False)
-
-set(DEBUG_PHY False)
-set(MU_RECIEVER False)
-set(RANDOM_BF False)
-set(PBS_SIM False)
-set(PERFECT_CE False)
-set(NAS_UE False)
-set(MESSAGE_CHART_GENERATOR False)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/015001/CMakeLists.txt b/cmake_targets/autotests/015001/CMakeLists.txt
deleted file mode 100644
index 47cf5074b5b067a9c8e75608e6c5757504ba46c0..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/015001/CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-set(PACKAGE_NAME "unitary_tests_simulators")
-set(PHYSIM True)
-set(RF_BOARD None)
-set(XFORMS False)
-
-set(DEBUG_PHY False)
-set(MU_RECIEVER False)
-set(RANDOM_BF False)
-set(PBS_SIM False)
-set(PERFECT_CE False)
-set(NAS_UE False)
-set(MESSAGE_CHART_GENERATOR False)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/015002/CMakeLists.txt b/cmake_targets/autotests/015002/CMakeLists.txt
deleted file mode 100644
index 47cf5074b5b067a9c8e75608e6c5757504ba46c0..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/015002/CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-set(PACKAGE_NAME "unitary_tests_simulators")
-set(PHYSIM True)
-set(RF_BOARD None)
-set(XFORMS False)
-
-set(DEBUG_PHY False)
-set(MU_RECIEVER False)
-set(RANDOM_BF False)
-set(PBS_SIM False)
-set(PERFECT_CE False)
-set(NAS_UE False)
-set(MESSAGE_CHART_GENERATOR False)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/015003/CMakeLists.txt b/cmake_targets/autotests/015003/CMakeLists.txt
deleted file mode 100644
index 47cf5074b5b067a9c8e75608e6c5757504ba46c0..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/015003/CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-set(PACKAGE_NAME "unitary_tests_simulators")
-set(PHYSIM True)
-set(RF_BOARD None)
-set(XFORMS False)
-
-set(DEBUG_PHY False)
-set(MU_RECIEVER False)
-set(RANDOM_BF False)
-set(PBS_SIM False)
-set(PERFECT_CE False)
-set(NAS_UE False)
-set(MESSAGE_CHART_GENERATOR False)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/015004/CMakeLists.txt b/cmake_targets/autotests/015004/CMakeLists.txt
deleted file mode 100644
index 47cf5074b5b067a9c8e75608e6c5757504ba46c0..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/015004/CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-set(PACKAGE_NAME "unitary_tests_simulators")
-set(PHYSIM True)
-set(RF_BOARD None)
-set(XFORMS False)
-
-set(DEBUG_PHY False)
-set(MU_RECIEVER False)
-set(RANDOM_BF False)
-set(PBS_SIM False)
-set(PERFECT_CE False)
-set(NAS_UE False)
-set(MESSAGE_CHART_GENERATOR False)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/015005/CMakeLists.txt b/cmake_targets/autotests/015005/CMakeLists.txt
deleted file mode 100644
index 47cf5074b5b067a9c8e75608e6c5757504ba46c0..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/015005/CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-set(PACKAGE_NAME "unitary_tests_simulators")
-set(PHYSIM True)
-set(RF_BOARD None)
-set(XFORMS False)
-
-set(DEBUG_PHY False)
-set(MU_RECIEVER False)
-set(RANDOM_BF False)
-set(PBS_SIM False)
-set(PERFECT_CE False)
-set(NAS_UE False)
-set(MESSAGE_CHART_GENERATOR False)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/015006/CMakeLists.txt b/cmake_targets/autotests/015006/CMakeLists.txt
deleted file mode 100644
index 47cf5074b5b067a9c8e75608e6c5757504ba46c0..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/015006/CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-set(PACKAGE_NAME "unitary_tests_simulators")
-set(PHYSIM True)
-set(RF_BOARD None)
-set(XFORMS False)
-
-set(DEBUG_PHY False)
-set(MU_RECIEVER False)
-set(RANDOM_BF False)
-set(PBS_SIM False)
-set(PERFECT_CE False)
-set(NAS_UE False)
-set(MESSAGE_CHART_GENERATOR False)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/015007/CMakeLists.txt b/cmake_targets/autotests/015007/CMakeLists.txt
deleted file mode 100644
index 47cf5074b5b067a9c8e75608e6c5757504ba46c0..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/015007/CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-set(PACKAGE_NAME "unitary_tests_simulators")
-set(PHYSIM True)
-set(RF_BOARD None)
-set(XFORMS False)
-
-set(DEBUG_PHY False)
-set(MU_RECIEVER False)
-set(RANDOM_BF False)
-set(PBS_SIM False)
-set(PERFECT_CE False)
-set(NAS_UE False)
-set(MESSAGE_CHART_GENERATOR False)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/015008/CMakeLists.txt b/cmake_targets/autotests/015008/CMakeLists.txt
deleted file mode 100644
index 47cf5074b5b067a9c8e75608e6c5757504ba46c0..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/015008/CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-set(PACKAGE_NAME "unitary_tests_simulators")
-set(PHYSIM True)
-set(RF_BOARD None)
-set(XFORMS False)
-
-set(DEBUG_PHY False)
-set(MU_RECIEVER False)
-set(RANDOM_BF False)
-set(PBS_SIM False)
-set(PERFECT_CE False)
-set(NAS_UE False)
-set(MESSAGE_CHART_GENERATOR False)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/015009/CMakeLists.txt b/cmake_targets/autotests/015009/CMakeLists.txt
deleted file mode 100644
index 47cf5074b5b067a9c8e75608e6c5757504ba46c0..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/015009/CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-set(PACKAGE_NAME "unitary_tests_simulators")
-set(PHYSIM True)
-set(RF_BOARD None)
-set(XFORMS False)
-
-set(DEBUG_PHY False)
-set(MU_RECIEVER False)
-set(RANDOM_BF False)
-set(PBS_SIM False)
-set(PERFECT_CE False)
-set(NAS_UE False)
-set(MESSAGE_CHART_GENERATOR False)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/015100/CMakeLists.txt b/cmake_targets/autotests/015100/CMakeLists.txt
deleted file mode 100644
index 47cf5074b5b067a9c8e75608e6c5757504ba46c0..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/015100/CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-set(PACKAGE_NAME "unitary_tests_simulators")
-set(PHYSIM True)
-set(RF_BOARD None)
-set(XFORMS False)
-
-set(DEBUG_PHY False)
-set(MU_RECIEVER False)
-set(RANDOM_BF False)
-set(PBS_SIM False)
-set(PERFECT_CE False)
-set(NAS_UE False)
-set(MESSAGE_CHART_GENERATOR False)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/015101/CMakeLists.txt b/cmake_targets/autotests/015101/CMakeLists.txt
deleted file mode 100644
index 47cf5074b5b067a9c8e75608e6c5757504ba46c0..0000000000000000000000000000000000000000
--- a/cmake_targets/autotests/015101/CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-set(PACKAGE_NAME "unitary_tests_simulators")
-set(PHYSIM True)
-set(RF_BOARD None)
-set(XFORMS False)
-
-set(DEBUG_PHY False)
-set(MU_RECIEVER False)
-set(RANDOM_BF False)
-set(PBS_SIM False)
-set(PERFECT_CE False)
-set(NAS_UE False)
-set(MESSAGE_CHART_GENERATOR False)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/../../CMakeLists.txt)
diff --git a/cmake_targets/autotests/README.txt b/cmake_targets/autotests/README.txt
index 29649ba8f7228f5232e41d932e8c5021fd66f523..cf1e28dd050498d7107abbc8461d9b07e4486477 100644
--- a/cmake_targets/autotests/README.txt
+++ b/cmake_targets/autotests/README.txt
@@ -12,10 +12,12 @@ Obj.#   Case#   Test#	Description
 01      01      11      Build lte-softmodem_noS1.EXMIMO.Rel10
 01      01      12      Build lte-softmodem_noS1.BLADERF.Rel10
 01      01      13      Build lte-softmodem_noS1.ETHERNET.Rel10
+01      01      14      Build lte-softmodem_noS1.LMSSDR.Rel10
 01      01      20      Build lte-softmodem.USRP.Rel10
 01      01      21      Build lte-softmodem.EXMIMO.Rel10
 01      01      22      Build lte-softmodem.BLADERF.Rel10
 01      01      23      Build lte-softmodem.ETHERNET.Rel10
+01      01      24      Build lte-softmodem.LMSSDR.Rel10
 
 01      01      30      Build (dlsim.Rel10 + ulsim.Rel10 + pucchsim.Rel10 + prachsim.Rel10 + pdcchsim.Rel10 + pbchsim.Rel10 + mbmssim.Rel10
                         secu_knas_encrypt_eia1.Rel10 secu_kenb.Rel10 aes128_ctr_encrypt.Rel10 aes128_ctr_decrypt.Rel10 secu_knas_encrypt_eea2.Rel10
@@ -24,7 +26,7 @@ Obj.#   Case#   Test#	Description
 01      01      40      Build RRH Gateway for USRP (Rel 10)
 01      01      41      Build RRH Gateway for EXMIMO  (Rel 10)
 01      01      42      Build RRH Gateway for BLADERF  (Rel 10)
-
+01      01      43      Build RRH Gateway for LMSSDR (Rel 10)
 
 
 01      02              Run OAISIM-NOS1 Rel10 (TDD + 5MHz/10MHz/20MHz + TM 1,2), and check the operation
@@ -98,52 +100,146 @@ Obj.#   Case#   Test#	Description
 
 
 01      55              lte-softmodem tests with USRP B210 RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX, 2TX/2RX
-01      55      00      Band 7 FDD 5MHz UL Throughput for 60 sec for 1TX/1RX
-01      55      01      Band 7 FDD 10MHz UL Throughput for 60 sec for 1TX/1RX
-01      55      02      Band 7 FDD 20MHz UL Throughput for 60 sec for 1TX/1RX
-01      55      03      Band 7 FDD 5MHz DL Throughput for 60 sec for 1TX/1RX
-01      55      04      Band 7 FDD 10MHz DL Throughput for 60 sec for 1TX/1RX
-01      55      05      Band 7 FDD 20MHz DL Throughput for 60 sec for 1TX/1RX
-01      55      06      Band 7 FDD 5MHz UL Throughput for 60 sec for 2TX/2RX
-01      55      07      Band 7 FDD 10MHz UL Throughput for 60 sec for 2TX/2RX
-01      55      08      Band 7 FDD 20MHz UL Throughput for 60 sec for 2TX/2RX
-01      55      09      Band 7 FDD 5MHz DL Throughput for 60 sec for 2TX/2RX
-01      55      10      Band 7 FDD 10MHz DL Throughput for 60 sec for 2TX/2RX
-01      55      11      Band 7 FDD 20MHz DL Throughput for 60 sec for 2TX/2RX
+01      55      00      Band 7 FDD 5MHz UL Throughput (UDP) for 300 sec for 1TX/1RX 
+01      55      01      Band 7 FDD 10MHz UL Throughput (UDP) for 300 sec for 1TX/1RX
+01      55      02      Band 7 FDD 20MHz UL Throughput (UDP) for 300 sec for 1TX/1RX
+01      55      03      Band 7 FDD 5MHz DL Throughput (UDP) for 300 sec for 1TX/1RX
+01      55      04      Band 7 FDD 10MHz DL Throughput (UDP) for 300 sec for 1TX/1RX
+01      55      05      Band 7 FDD 20MHz DL Throughput (UDP) for 300 sec for 1TX/1RX
+01      55      06      Band 7 FDD 5MHz UL Throughput (UDP) for 300 sec for 2TX/2RX
+01      55      07      Band 7 FDD 10MHz UL Throughput (UDP) for 300 sec for 2TX/2RX
+01      55      08      Band 7 FDD 20MHz UL Throughput (UDP) for 300 sec for 2TX/2RX
+01      55      09      Band 7 FDD 5MHz DL Throughput (UDP) for 300 sec for 2TX/2RX
+01      55      10      Band 7 FDD 10MHz DL Throughput (UDP) for 300 sec for 2TX/2RX
+01      55      11      Band 7 FDD 20MHz DL Throughput (UDP) for 300 sec for 2TX/2RX
+01      55      12      Band 7 FDD 5MHz UL Throughput (TCP) for 300 sec for 1TX/1RX
+01      55      13      Band 7 FDD 10MHz UL Throughput (TCP) for 300 sec for 1TX/1RX
+01      55      14      Band 7 FDD 20MHz UL Throughput (TCP) for 300 sec for 1TX/1RX
+01      55      15      Band 7 FDD 5MHz DL Throughput (TCP) for 300 sec for 1TX/1RX
+01      55      16      Band 7 FDD 10MHz DL Throughput (TCP) for 300 sec for 1TX/1RX
+01      55      17      Band 7 FDD 20MHz DL Throughput (TCP) for 300 sec for 1TX/1RX
 
 01      56              lte-softmodem tests with USRP B210  RF as eNB and  OAI EPC (eNB and EPC are on same machines) w/ Bandrich COTS UE
-
+01      56      00      Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
+01      56      01      Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
+01      56      02      Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
+01      56      03      Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
+01      56      04      Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
+01      56      05      Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
 
 01      57              lte-softmodem tests with USRP B210 RF as eNB and OAI EPC (eNB and EPC are on different machines) w/ Bandrich COTS UE
+01      57      00      Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
+01      57      01      Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
+01      57      02      Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
+01      57      03      Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
+01      57      04      Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
+01      57      05      Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
 
 01      58               lte-softmodem tests with USRP X310 RF as eNB and ALU EPC w/ Bandrich COTS UE for `TX/1RX, 2TX/2RX
-01      58      00      Band 7 FDD 5MHz UL Throughput for 60 sec for 1TX/1RX
-01      58      01      Band 7 FDD 10MHz UL Throughput for 60 sec for 1TX/1RX
-01      58      02      Band 7 FDD 20MHz UL Throughput for 60 sec for 1TX/1RX
-01      58      03      Band 7 FDD 5MHz DL Throughput for 60 sec for 1TX/1RX
-01      58      04      Band 7 FDD 10MHz DL Throughput for 60 sec for 1TX/1RX
-01      58      05      Band 7 FDD 20MHz DL Throughput for 60 sec for 1TX/1RX
+01      58      00      Band 7 FDD 5MHz UL Throughput (UDP) for 300 sec for 1TX/1RX
+01      58      01      Band 7 FDD 10MHz UL Throughput (UDP)  for 300 sec for 1TX/1RX
+01      58      02      Band 7 FDD 20MHz UL Throughput (UDP)  for 300 sec for 1TX/1RX
+01      58      03      Band 7 FDD 5MHz DL Throughput (UDP) for 300 sec for 1TX/1RX
+01      58      04      Band 7 FDD 10MHz DL Throughput (UDP) for 300 sec for 1TX/1RX
+01      58      05      Band 7 FDD 20MHz DL Throughput (UDP) for 300 sec for 1TX/1RX
+01      58      06      Band 7 FDD 5MHz UL Throughput (TCP) for 300 sec for 1TX/1RX
+01      58      07      Band 7 FDD 10MHz UL Throughput (TCP) for 300 sec for 1TX/1RX
+01      58      08      Band 7 FDD 20MHz UL Throughput (TCP) for 300 sec for 1TX/1RX
+01      58      09      Band 7 FDD 5MHz DL Throughput (TCP) for 300 sec for 1TX/1RX
+01      58      10      Band 7 FDD 10MHz DL Throughput (TCP) for 300 sec for 1TX/1RX
+01      58      11      Band 7 FDD 20MHz DL Throughput (TCP) for 300 sec for 1TX/1RX
+
 
 01      59              lte-softmodem tests with USRP X310  RF as eNB and  OAI EPC (eNB and EPC are on same machines) w/ Bandrich COTS UE
 
-01      61              lte-softmodem tests with USRP X310 RF as eNB and OAI EPC (eNB and EPC are on different machines) w/ Bandrich COTS UE
+01      60              lte-softmodem tests with USRP X310 RF as eNB and OAI EPC (eNB and EPC are on different machines) w/ Bandrich COTS UE
+01      60      00      Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
+01      60      01      Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
+01      60      02      Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
+01      60      03      Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
+01      60      04      Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
+01      60      05      Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
 
 01      61              lte-softmodem tests with EXMIMO RF as eNB and ALU EPC w/ Bandrich COTS UE for `TX/1RX, 2TX/2RX
-01      61      00      Band 7 FDD 5MHz UL Throughput for 60 sec for 1TX/1RX
-01      61      01      Band 7 FDD 10MHz UL Throughput for 60 sec for 1TX/1RX
-01      61      02      Band 7 FDD 20MHz UL Throughput for 60 sec for 1TX/1RX
-01      61      03      Band 7 FDD 5MHz DL Throughput for 60 sec for 1TX/1RX
-01      61      04      Band 7 FDD 10MHz DL Throughput for 60 sec for 1TX/1RX
-01      61      05      Band 7 FDD 20MHz DL Throughput for 60 sec for 1TX/1RX
+01      61      00      Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
+01      61      01      Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
+01      61      02      Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
+01      61      03      Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
+01      61      04      Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
+01      61      05      Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
 
 01      62              lte-softmodem tests with EXMIMO RF as eNB and OAI EPC (eNB and EPC are on same machines) w/ Bandrich COTS UE
-01      63              lte-softmodem tests with EXMIMO RF as eNB and  OAI EPC (eNB and EPC are on different machines) w/ Bandrich COTS UE
 
-01      58              lte-softmodem-noS1 tests
+01      63              lte-softmodem tests with EXMIMO RF as eNB and  OAI EPC (eNB and EPC are on different machines) w/ Bandrich COTS UE
+01      63      00      Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
+01      63      01      Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
+01      63      02      Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
+01      63      03      Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
+01      63      04      Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
+01      63      05      Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
+
+01      65      00      lte-softmodem tests with BladeRF RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX
+01      65      00      Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
+01      65      01      Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
+01      65      02      Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
+01      65      03      Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
+01      65      04      Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
+01      65      05      Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
+
+
+01      70      00      lte-softmodem tests with SoDeRa RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX
+01      70      00      Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
+01      70      01      Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
+01      70      02      Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
+01      70      03      Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
+01      70      04      Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
+01      70      05      Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
+
+
+01      75      00      lte-softmodem + RRH tests with B210 RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX
+01      75      00      Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
+01      75      01      Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
+01      75      02      Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
+01      75      03      Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
+01      75      04      Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
+01      75      05      Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
+
+01      80      00      lte-softmodem + RRH tests with BladeRF RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX
+01      80      00      Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
+01      80      01      Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
+01      80      02      Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
+01      80      03      Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
+01      80      04      Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
+01      80      05      Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
+
+01      85      00      lte-softmodem + RRH tests with USRP X310 RF as eNB and ALU EPC w/ Bandrich COTS UE for TX/1RX
+01      85      00      Band 7 FDD 5MHz UL Throughput for 300 sec for 1TX/1RX
+01      85      01      Band 7 FDD 10MHz UL Throughput for 300 sec for 1TX/1RX
+01      85      02      Band 7 FDD 20MHz UL Throughput for 300 sec for 1TX/1RX
+01      85      03      Band 7 FDD 5MHz DL Throughput for 300 sec for 1TX/1RX
+01      85      04      Band 7 FDD 10MHz DL Throughput for 300 sec for 1TX/1RX
+01      85      05      Band 7 FDD 20MHz DL Throughput for 300 sec for 1TX/1RX
+
+02      55              lte-softmodem tests with USRP B210 RF as eNB and ALU EPC w/ Sony Experia M4 COTS UE for TX/1RX
+02      55      00      Band 7 FDD 5MHz UL Throughput (UDP) for 300 sec for 1TX/1RX
+02      55      01      Band 7 FDD 10MHz UL Throughput (UDP) for 300 sec for 1TX/1RX
+02      55      02      Band 7 FDD 20MHz UL Throughput (UDP) for 300 sec for 1TX/1RX
+02      55      03      Band 7 FDD 5MHz DL Throughput (UDP) for 300 sec for 1TX/1RX
+02      55      04      Band 7 FDD 10MHz DL Throughput (UDP) for 300 sec for 1TX/1RX
+02      55      05      Band 7 FDD 20MHz DL Throughput (UDP) for 300 sec for 1TX/1RX
+02      55      06      Band 7 FDD 5MHz UL Throughput (TCP) for 300 sec for 1TX/1RX
+02      55      07      Band 7 FDD 10MHz UL Throughput (TCP) for 300 sec for 1TX/1RX
+02      55      08      Band 7 FDD 20MHz UL Throughput (TCP) for 300 sec for 1TX/1RX
+02      55      09      Band 7 FDD 5MHz DL Throughput (TCP) for 300 sec for 1TX/1RX
+02      55      10      Band 7 FDD 10MHz DL Throughput (TCP) for 300 sec for 1TX/1RX
+02      55      11      Band 7 FDD 20MHz DL Throughput (TCP) for 300 sec for 1TX/1RX
+  
+
+01      64              lte-softmodem-noS1 tests
 
 02                      Functional test case
 
-03                      Non-Functional test case
+03                      Autotests specific to OAI UE
 
 04                      Failure test case 
  
@@ -153,6 +249,4 @@ Obj.#   Case#   Test#	Description
 #TODO: Add test cases for 10,20 MHz
 #TODO: Add test cases for TDD/FDD 
 #TODO: Test and compile seperately for Rel8/Rel10
-#TODO: Case03.py eMBMS test case
-
-
+#TODO: Case03.py eMBMS test case
\ No newline at end of file
diff --git a/cmake_targets/autotests/core.py b/cmake_targets/autotests/core.py
index c899069f89a726d4b8cba18e688af16665a90751..5b1f39a85b74e0953101446c9971fb079d72ecbe 100644
--- a/cmake_targets/autotests/core.py
+++ b/cmake_targets/autotests/core.py
@@ -118,8 +118,7 @@ class core:
         rsp1 = self.prompt1
         rsp2 = self.prompt2
         if sudo == True:
-          command = 'echo \'' + self.password + '\' | sudo -S -E ' + command
-
+           command = 'echo \'' + '' + '\' | sudo -S -E bash -c \' ' + command + '\' '
         self.wait_quiet()
         if self.send_cr:
             log.stats['cmd'] += 1
@@ -140,7 +139,7 @@ class core:
             rsp2 = self.prompt2
         self.wait_quiet()
         if sudo == True:
-          command = 'echo \'' + self.password + '\' | sudo -S -E ' + command
+            command = 'echo \'' + '' + '\' | sudo -S -E bash -c \' ' + command + '\' '
         if self.send_cr:
             log.stats['cmd'] += 1
             self.oai.sendline(command)
@@ -181,7 +180,8 @@ class core:
             rsp2 = self.prompt2
         self.wait_quiet()
         if sudo == True:
-          command = 'echo \'' + self.password + '\' | sudo -S -E ' + command
+          #command = 'echo \'' + self.password + '\' | sudo -S -E ' + command
+          command = 'echo \'' + '' + '\' | sudo -S -E bash -c \' ' + command + '\' '
         if self.send_cr:
             log.stats['cmd'] += 1
             self.oai.sendline(command)
@@ -192,6 +192,7 @@ class core:
         if index == 0 or index == 1 :
             return self.oai.before
         else:
+            print "command = " + command + "rsp1  = " + rsp1 + " rsp2 = " + rsp2 + " index = " + str(index)
             raise log.err(self.failed(command, rsp1 + ' or ' + rsp2,debug))
 
            
@@ -239,8 +240,9 @@ class core:
     #    print rsp
         if  (rsp.find(expect) == -1):
             return 'OK'
-
-        raise log.err(self.failed(command, expect,debug))
+        else:
+            print "command = " + command + "expect  = " + expect + "rsp = " + rsp
+            raise log.err(self.failed(command, expect,debug))
 
     
     # **************************send_wait*************************    
diff --git a/cmake_targets/autotests/openair.py b/cmake_targets/autotests/openair.py
index e8d07ba1e1f1c36ce623a515da32366a2afc766b..1079c466a822b5cfdfe4d76bfad383175972d5a3 100644
--- a/cmake_targets/autotests/openair.py
+++ b/cmake_targets/autotests/openair.py
@@ -83,10 +83,13 @@ class openair(core):
         return (stdout, stderr)
 
     def connect(self, username, password, prompt='PEXPECT_OAI'):
-     while True:  
+     max_retries=100
+     i=0
+     while i <= max_retries:  
         self.prompt1 = prompt
         self.prompt2 = prompt
         self.password = '' 
+        i=i+1
         # WE do not store the password when sending commands for secuirity reasons. The password might be accidentally logged in such cases.
         #The password is used only to make ssh connections. In case user wants to run programs with sudo, then he/she needs to add following line in /etc/sudoers
         # your_user_name  ALL=(ALL:ALL) NOPASSWD: ALL
@@ -109,11 +112,14 @@ class openair(core):
         except Exception, e:
             error=''
             error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: '  + str(e.__class__) + " : " + str( e)
+            error = error + 'address = "'+ self.address +' username = ' + username
             error = error + traceback.format_exc()
             print error
-            print "Retrying again in 60 seconds"
-            time.sleep(60)
-            #sys.exit(1)
+            print "Retrying again in 1  seconds"
+            time.sleep(1)
+            if i==max_retries:
+              print "Fatal Error: Terminating the program now..."
+              sys.exit(1)
                 
     def connect2(self, username, password, prompt='$'):
         self.prompt1 = prompt
diff --git a/cmake_targets/autotests/run_compilation_autotests.bash b/cmake_targets/autotests/run_compilation_autotests.bash
index afe7aa4873ccd3c626a449ef11e9289f5b17ba9e..a7b056dc811d32b2d7be1b09258ff1b60ba2d71b 100755
--- a/cmake_targets/autotests/run_compilation_autotests.bash
+++ b/cmake_targets/autotests/run_compilation_autotests.bash
@@ -20,7 +20,7 @@ test_compile() {
     compile_prog=$2
     exec_prog=$3
     build_dir=$tdir/$1/build
-    log_file=$tdir/log/test.$1.txt
+    log_file=$tdir/log/test.$1.$2.$5.txt
     target=$5
     echo "Compiling test case $test_name. Log file = $log_file"
     rm -fr $build_dir
@@ -34,10 +34,10 @@ test_compile() {
     if [ -s $exec_prog ] ; then
         cp $exec_prog $tdir/bin/`basename $exec_prog`.$target.$test_name
         echo_success "$test_name $exec_prog $target compiled"
-        xUnit_success "compilation" $test_name "PASS" 1
+        xUnit_success "compilation" $test_name "PASS" 1 "$results_file"
     else
         echo_error "$test_name $exec_prog $target compilation failed"
-        xUnit_fail "compilation" $test_name "FAIL" 1
+        xUnit_fail "compilation" $test_name "FAIL" 1 "$results_file"
     fi
 }
 
diff --git a/cmake_targets/autotests/run_exec_autotests.bash b/cmake_targets/autotests/run_exec_autotests.bash
index 836a8c197afea8a0fbb9ae763506f29ac7f4fa76..2d3f193b300d52378a2d1600bd26ec2a1bd2359d 100755
--- a/cmake_targets/autotests/run_exec_autotests.bash
+++ b/cmake_targets/autotests/run_exec_autotests.bash
@@ -1,4 +1,34 @@
 #!/bin/bash
+#******************************************************************************
+
+#    OpenAirInterface 
+#    Copyright(c) 1999 - 2014 Eurecom
+
+#    OpenAirInterface is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+
+
+#    OpenAirInterface is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+
+#   You should have received a copy of the GNU General Public License
+#   along with OpenAirInterface.The full GNU General Public License is 
+#   included in this distribution in the file called "COPYING". If not, 
+#   see <http://www.gnu.org/licenses/>.
+
+#  Contact Information
+#  OpenAirInterface Admin: openair_admin@eurecom.fr
+#  OpenAirInterface Tech : openair_tech@eurecom.fr
+#  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+  
+#  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+# *******************************************************************************/
+# \author Navid Nikaein, Rohit Gupta
 
 if [ -s $OPENAIR_DIR/cmake_targets/tools/build_helper ] ; then
    source $OPENAIR_DIR/cmake_targets/tools/build_helper
@@ -12,7 +42,7 @@ trap handle_ctrl_c INT
 source $OPENAIR_DIR/cmake_targets/tools/test_helper
 
 
-#SUDO="sudo -E "
+SUDO="sudo -E -S"
 tdir=$OPENAIR_DIR/cmake_targets/autotests
 rm -fr $tdir/bin 
 mkdir -p $tdir/bin
@@ -111,6 +141,8 @@ function test_compile() {
           compile_log_dir=`eval echo \"$OPENAIR_DIR/cmake_targets/log/\"`
           echo "Removing compilation log files in $compile_log_dir"
           rm -frv $compile_log_dir
+          echo "Executing $pre_exec_file $pre_exe_args ...."
+          eval $pre_exec_file  $pre_exec_args
           echo "Executing $compile_prog $compile_prog_args ...."
           eval $compile_prog  $compile_prog_args
           echo "Copying compilation log files to test case log directory: $log_dir"
@@ -175,6 +207,7 @@ function test_compile() {
 #\param $13 -> output of compilation program that needs to be found for test case to pass
 #\param $14 -> tags to help identify the test case for readability in output xml file
 #\param $15 => password for the user to run certain commands as sudo
+#\param $16 => test config file params to be modified
 
 function test_compile_and_run() {
     xUnit_start
@@ -195,12 +228,14 @@ function test_compile_and_run() {
     compile_prog_out=${13}
     tags=${14}
     mypassword=${15}
+    test_config_file=${16}
+
     build_dir=$tdir/$1/build
     #exec_file=$build_dir/$6
     xmlfile_testcase=$log_dir/test.$1.xml
     #Temporary log file where execution log is stored.
     temp_exec_log=$log_dir/temp_log.txt
-    
+    export OPENAIR_LOGDIR=$log_dir
     rm -fr $log_dir
     mkdir -p $log_dir
     
@@ -219,6 +254,10 @@ function test_compile_and_run() {
     
     #compile_prog_array=()
     #read -a compile_prog_array <<<"$compile_prog"
+
+    #test_config_file=`eval "echo \"$test_config_file\" "`
+
+    #echo "test_config_file = $test_config_file"
   
     tags_array=()
     read -a tags_array <<<"$tags"
@@ -238,17 +277,21 @@ function test_compile_and_run() {
        cd $log_dir
        {   
           uname -a
-          #eval $pre_compile_prog
-          #cmake ..
-          #rm -fv $exec_file
-          echo "Executing $compile_prog $compile_args" >> $log_file
+          echo "Executing $pre_compile_prog"
+          eval $pre_compile_prog
+ 
+          if [ "$test_config_file" != "" ]; then
+            echo "Modifying test_config_file parameters..."
+            echo "$test_config_file" |xargs -L 1 $OPENAIR_DIR/cmake_targets/autotests/tools/search_repl.py 
+          fi
+          echo "Executing $compile_prog $compile_args"
           eval "$compile_prog $compile_args"
           echo "Copying compilation log files to test case log directory: $log_dir"
           cp -fvr $OPENAIR_DIR/cmake_targets/log/ $log_dir/compile_log
        }>> $log_file 2>&1
        echo "</COMPILATION LOG>" >> $log_file 2>&1
     #done
-
+    
     #process the test case if it is that of execution
     if [ "$class" == "execution" ]; then
       tags_array_index=0
@@ -269,7 +312,7 @@ function test_compile_and_run() {
            
           if [ -n "$pre_exec_file" ]; then
             {  echo " Executing $pre_exec_file $pre_exec_args " 
-               eval " echo '$mypassword' |sudo -S -E $pre_exec_file $pre_exec_args " ; }>> $temp_exec_log  2>&1
+               eval " $pre_exec_file $pre_exec_args " ; }>> $temp_exec_log  2>&1
 
           fi
           echo "Executing $main_exec $main_exec_args_array_index "
@@ -377,6 +420,7 @@ until [ -z "$1" ]
        -g | --run-group)
             RUN_GROUP=1
             test_case_group=$2
+            test_case_group=`sed "s/\+/\*/g" <<<  "${test_case_group}"` # Replace + with * for bash string substituion
             echo_info "Will execute test cases only in group $test_case_group"
             shift 2;;
         -p)
@@ -393,14 +437,12 @@ until [ -z "$1" ]
    esac
   done
 
-if [ "$SET_PASSWORD" == "1" ]; then
-   mypassword=$passwd
-else
-   read -s -p "Enter Password: " mypassword
+if [ "$SET_PASSWORD" != "1" ]; then
+   read -s -p "Enter Password: " passwd
 fi
 
 tmpfile=`mktemp`
-echo \'$passwd\' | $SUDO echo $HOME >& $tmpfile
+echo $passwd | $SUDO echo $HOME > $tmpfile
 tstsudo=`cat $tmpfile`
 if [ "$tstsudo" != "$HOME" ]; then
   echo "$USER might not have sudo privileges. Exiting" 
@@ -414,9 +456,17 @@ rm -fr $tmpfile
 xml_conf="$OPENAIR_DIR/cmake_targets/autotests/test_case_list.xml"
 
 test_case_list=`xmlstarlet sel -T -t -m /testCaseList/testCase -s A:N:- "@id" -v "@id" -n $xml_conf`
+test_case_excl_list=`xmlstarlet sel -t -v "/testCaseList/TestCaseExclusionList" $xml_conf`
+echo "Test Case Exclusion List = $test_case_excl_list "
+
+test_case_excl_list=`sed "s/\+/\*/g" <<< "$test_case_excl_list" ` # Replace + with * for bash string substituion
+
+read -a test_case_excl_array <<< "$test_case_excl_list"
 
 echo "test_case_list = $test_case_list"
 
+echo "Test Case Exclusion List = $test_case_excl_list \n"
+
 readarray -t test_case_array <<<"$test_case_list"
 
 read -a test_case_group_array <<< "$test_case_group"
@@ -437,7 +487,17 @@ for search_expr in "${test_case_array[@]}"
     else
        flag_run_test_case=1
     fi
-       
+
+    for search_excl in "${test_case_excl_array[@]}"
+       do  
+          if [[ $search_expr == $search_excl ]];then
+             flag_run_test_case=0
+             echo_info "Test case $search_expr match found in test case excl group. Will skip the test case for execution..."
+             break
+          fi
+       done
+
+
     #We skip this test case if it is not in the group list
     if [ "$flag_run_test_case" -ne "1" ]; then
       continue
@@ -458,6 +518,7 @@ for search_expr in "${test_case_array[@]}"
     nruns=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/nruns" $xml_conf`
     compile_prog_out=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/compile_prog_out" $xml_conf`
     tags=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/tags" $xml_conf`
+    test_config_file=`xmlstarlet sel -t -v "/testCaseList/testCase[@id='$search_expr']/test_config_file" $xml_conf`
 
     echo "class = $class"
     echo "name = $name"
@@ -474,6 +535,7 @@ for search_expr in "${test_case_array[@]}"
     echo "search_expr_false = $search_expr_false"
     echo "nruns = $nruns"
 
+
     #eval $pre_exec
     compile_prog_out=`eval echo \"$compile_prog_out\"`
 
@@ -496,8 +558,8 @@ for search_expr in "${test_case_array[@]}"
     if [ "$class" == "compilation" ]; then
         test_compile "$name" "$compile_prog" "$compile_prog_args" "$pre_exec" "$pre_exec_args" "$main_exec" "$main_exec_args" "search_array_true[@]" "$search_expr_false" "$nruns" "$pre_compile_prog" "$class" "$compile_prog_out" "$tags"
     elif  [ "$class" == "execution" ]; then
-        $SUDO killall -q oaisim_nos1
-        test_compile_and_run "$name" "$compile_prog" "$compile_prog_args" "$pre_exec" "$pre_exec_args" "$main_exec" "$main_exec_args" "search_array_true[@]" "$search_expr_false" "$nruns" "$pre_compile_prog" "$class" "$compile_prog_out" "$tags" "$mypassword" 
+        echo \'passwd\' | $SUDO killall -q oaisim_nos1
+        test_compile_and_run "$name" "$compile_prog" "$compile_prog_args" "$pre_exec" "$pre_exec_args" "$main_exec" "$main_exec_args" "search_array_true[@]" "$search_expr_false" "$nruns" "$pre_compile_prog" "$class" "$compile_prog_out" "$tags" "$mypassword" "$test_config_file"
     else
         echo "Unexpected class of test case...Skipping the test case $name ...."
     fi
diff --git a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py
old mode 100644
new mode 100755
index ea43ffd5ff71b203ec1294b756b9c97caf35f286..eed2fffb77a194fd82377a5f834fe1d4e475725e
--- a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py
+++ b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py
@@ -29,10 +29,7 @@
 
 # *******************************************************************************/
 
-# \file test01.py
-# \brief test 01 for OAI
-# \author Navid Nikaein
-# \date 2013 - 2015
+# \author Rohit Gupta
 # \version 0.1
 # @ingroup _test
 
@@ -52,11 +49,6 @@ import re
 import numpy as np
 
 import log
-import case01
-import case02
-import case03
-import case04
-import case05
 
 from  openair import *
 
@@ -65,21 +57,29 @@ import paramiko
 import subprocess
 import commands
 sys.path.append('/opt/ssh')
+sys.path.append(os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/tools/'))
 
+from lib_autotest import *
 import ssh
 from ssh import SSHSession
+import argparse
 
+# \brief write a string to a file
+# \param filename name of file
+# \param string string to write
+# \mode file opening mode (default=write)
 def write_file(filename, string, mode="w"):
    text_file = open(filename, mode)
    text_file.write(string)
    text_file.close()
-   
-#$1 name of file (assuming created with iperf -s -u ....
-#$2 minimum throughput
-#$3 maximum throughput
-#$4 average throughput
-#$5 minimum duration of throughput
-#The throughput values found in file must be higher than values from from 2,3,4,5
+ 
+# \brief function to check if test case passed throughput test
+# \param filename name of file which has throughput results (usually from iperf -s ...
+# \param min_tput minimum throughput
+# \param max_tuput maximum throughput
+# \param average average throughput
+# \param min_duration minimum duration of throughput
+#The throughput values found in file must be higher than values from from arguments 2,3,4,5
 #The function returns True if throughput conditions are saisfied else it returns fails
 def tput_test(filename, min_tput, max_tput, average, min_duration):
    
@@ -106,13 +106,16 @@ def tput_test(filename, min_tput, max_tput, average, min_duration):
    else: 
       return False , tput_string
 
-    
+# \brief Convert string to float or return None if there is exception    
 def try_convert_to_float(string, fail=None):
     try:
         return float(string)
     except Exception:
         return fail;
 
+# \brief get throughput statistics from log file
+# \param search_expr search expression found in test_case_list.xml file
+# \param logfile_traffic logfile which has traffic statistics
 def tput_test_search_expr (search_expr, logfile_traffic):
    result=0
    tput_string=''
@@ -158,7 +161,13 @@ def tput_test_search_expr (search_expr, logfile_traffic):
 
    return result, tput_string
       
-
+# \brief function to copy files to/from remote machine
+# \param username user with which to make sftp connection
+# \param password password of user
+# \param hostname host to connect
+# \ports port of remote machine on which server is listening
+# \paramList This is list of operations as a set {operation: "get/put", localfile: "filename", remotefile: "filename"
+# \param logfile Ignored currently and set once at the beginning of program
 def sftp_module (username, password, hostname, ports, paramList,logfile): 
    #localD = localfile
    #remoteD = remotefile
@@ -167,14 +176,9 @@ def sftp_module (username, password, hostname, ports, paramList,logfile):
    #paramiko logfile path should not be changed with multiple calls. The logs seem to in first file regardless
    error = ""
    #The lines below are outside exception loop to be sure to terminate the test case if the network connectivity goes down or there is authentication failure
- 
-
-
    transport = paramiko.Transport(hostname, ports)
    transport.connect(username = username, password = password)
    sftp = paramiko.SFTPClient.from_transport(transport)
-   
-
    #  index =0 
    for param in paramList:
       try:
@@ -206,7 +210,10 @@ def sftp_module (username, password, hostname, ports, paramList,logfile):
    write_file(logfile, error, "a")
    res = os.system('\n echo \'SFTP Module Log for Machine: <' + hostname + '> ends...\' >> ' + logfile + ' 2>&1 \n')
 
-def finalize_deploy_script (timeout_cmd, terminate_missing_procs='True'):
+# \brief bash script stub put at the end of scripts to terminate it 
+# \param timeout_cmd terminate script after timeout_cmd seconds
+# \param terminate_missing_procs if True terminate all the processes launched by script if one of them terminates prematurely (due to error)
+def finalize_deploy_script (timeout_cmd, terminate_missing_procs='False'):
   cmd = 'declare -i timeout_cmd='+str(timeout_cmd) + '\n'
   if terminate_missing_procs == 'True':
     cmd = cmd +  """
@@ -244,64 +251,102 @@ def finalize_deploy_script (timeout_cmd, terminate_missing_procs='True'):
   
   return cmd
 
+# \brief run python script and update config file params of test case
+# \param oai module with already open connection
+# \param config_string config string taken from xml file
+# \param logdirRepo directory of remote repository
+# \param python_script python script location
 def update_config_file(oai, config_string, logdirRepo, python_script):
+  cmd=""
   if config_string :
     stringArray = config_string.splitlines()
-    cmd=""
     #python_script = '$OPENAIR_DIR/targets/autotests/tools/search_repl.py'
     for string in stringArray:
        #split the string based on space now
        string1=string.split()
        cmd = cmd + 'python ' + python_script + ' ' + logdirRepo+'/'+string1[0] + '  ' + string1[1] +  ' '+ string1[2] + '\n'
        #cmd = cmd + 'perl -p -i  -e \'s/'+ string1[1] + '\\s*=\\s*"\\S*"\\s*/' + string1[1] + ' = "' + string1[2] +'"' + '/g\'   ' + logdirRepo + '/' +string1[0] + '\n'
-    return cmd
-    #result = oai.send_recv(cmd)
+  return cmd
+  #result = oai.send_recv(cmd)
 
-def SSHSessionWrapper(machine, username, key_file, password, logdir_remote_testcase, logdir_local_base):
-  while True:
+# \brief thread safe sshsession wrapper due to occasional connection issues with ssh
+# \param machine name of machine
+# \param username user login for remote machine
+# \param key_file file name which has keys to enable passwordless login
+# \param password password for remote machine
+# \param logdir_remote remote directory
+# \param logdir_local_base local directory
+# \param operation operation to perform (get_all, put_all) transfers recursively for directories
+def SSHSessionWrapper(machine, username, key_file, password, logdir_remote, logdir_local_base, operation):
+  max_tries = 100
+  i=0
+  while i <= max_tries:
+    i = i +1
     try:
        ssh = SSHSession(machine , username, key_file, password)
-       ssh.get_all(logdir_remote_testcase , logdir_local_base)
+       if operation == "get_all":
+          ssh.get_all(logdir_remote , logdir_local_base)
+       elif operation == "put_all":
+          ssh.put_all(logdir_local_base, logdir_remote )
+       else:
+          print "Error: Uknown operation in SSHSessionWrapper. Exiting now..."
+          sys.exit(1)
        break 
     except Exception, e:
        error=''
        error = error + ' In Class = function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: '  + str(e.__class__) + " : " + str( e)
-       error = error + '\n username = ' + username + '\n machine = ' + machine + '\n logdir_remote = ' + logdir_remote_testcase + '\n logdir_local_base = ' + logdir_local_base 
+       error = error + '\n username = ' + username + '\n machine = ' + machine + '\n logdir_remote = ' + logdir_remote + '\n logdir_local_base = ' + logdir_local_base 
        error = error + traceback.format_exc()
        print error
-       print " Trying again in 60 seconds"
-       time.sleep(60)
+       print " Retrying again in 1 seconds"
+       time.sleep(1)
        print "Continuing ..."
+       if i ==max_tries:
+          print "Fatal Error: Max no of retries reached. Exiting now..."
+          sys.exit(1)
 
 
  
-#Function to clean old programs that might be running from earlier execution
-#oai - parameter for making connection to machine
-#programList - list of programs that must be terminated before execution of any test case 
-def cleanOldPrograms(oai, programList, CleanUpAluLteBox):
-  cmd = 'killall -q -r ' + programList
+# \briefFunction to clean old programs that might be running from earlier execution
+# \param oai - parameter for making connection to machine
+# \parm programList list of programs that must be terminated before execution of any test case 
+# \param CleanUpAluLteBox program to terminate AlU Bell Labs LTE Box
+# \param ExmimoRfStop String to stop EXMIMO card (specified in test_case_list.xml)
+def cleanOldPrograms(oai, programList, CleanUpAluLteBox, ExmimoRfStop, logdir, logdirOAI5GRepo):
+  cmd = 'sudo -E killall -9 -q -r ' + programList
   result = oai.send(cmd, True)
   print "Killing old programs..." + result
   programArray = programList.split()
   programListJoin = '|'.join(programArray)
+  cmd = " ( date ;echo \"Starting cleaning old programs.. \" ; dmesg|tail ; echo \"Current disk space.. \" ; df -h )>& " + logdir + "/oai_test_setup_cleanup.log.`hostname` 2>&1 ; sync"
+  result=oai.send_recv(cmd)
   cmd = cleanupOldProgramsScript + ' ' + '\''+programListJoin+'\''
   #result = oai.send_recv(cmd)
   #print result
   result = oai.send_expect_false(cmd, 'Match found', False)
-  print result
+  print "Looking for old programs..." + result
   res=oai.send_recv(CleanUpAluLteBox, True)
-
-
-class myThread (threading.Thread):
-    def __init__(self, threadID, name, counter):
-        threading.Thread.__init__(self)
-        self.threadID = threadID
-        self.name = name
-        self.counter = counter
-    def run(self):
-        print "Starting " + self.name
-
-
+  cmd= " echo \"Starting EXmimoRF Stop... \"  >> " + logdir + "/oai_test_setup_cleanup.log.`hostname` 2>&1  ; sync ";
+  oai.send_recv(cmd)
+  cmd  = "( " + "cd " + logdirOAI5GRepo + " ; source oaienv ;  "  +  ExmimoRfStop + " ) >> " + logdir + "/oai_test_setup_cleanup.log.`hostname` 2>&1  ; sync "
+  print "cleanoldprograms cmd = " + cmd
+  res=oai.send_recv(cmd, False, timeout=600)
+  cmd= " echo \"Stopping EXmimoRF Stop... \" >> " + logdir + "/oai_test_setup_cleanup.log.`hostname` 2>&1  ; sync ";
+  oai.send_recv(cmd)
+
+  #res = oai.send_recv(ExmimoRfStop, False)
+  cmd = " ( date ;echo \"Finished cleaning old programs.. \" ; dmesg | tail)>> $HOME/.oai_test_setup_cleanup.log.`hostname` 2>&1 ; sync"
+  res=oai.send_recv(cmd)
+
+# \brief Class thread to launch a generic command on remote machine
+# \param threadID number of thread (for book keeping)
+# \param threadname string of threadname (for book keeping)
+# \param machine machine name on which to run the command
+# \param username username with which to login
+# \param password password with which to login
+# \param cmd command as a string to run on remote machine
+# \parma sudo if True sudo is set
+# \param timeout timeout of command in seconds 
 class oaiThread (threading.Thread):
     def __init__(self, threadID, threadname, machine, username, password, cmd, sudo, timeout):
         threading.Thread.__init__(self)
@@ -316,7 +361,7 @@ class oaiThread (threading.Thread):
     def run(self):
         try:
           oai = openair('localdomain',self.machine)
-          oai.connect(user, self.password)
+          oai.connect(self.username, self.password)
           print "Starting " + self.threadname + " on machine " + self.machine
           result = oai.send_recv(self.cmd, self.sudo, self.timeout)
           print "result = " + result
@@ -325,14 +370,24 @@ class oaiThread (threading.Thread):
         except Exception, e:
            error=''
            error = error + ' In class oaiThread, function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: '  + str(e.__class__) + " : " + str( e)
-           error = error + '\n threadID = ' + str(self.threadID) + '\n threadname = ' + self.threadname + '\n timeout = ' + self.timeout + '\n machine = ' + self.machine + '\n cmd = ' + self.cmd + '\n timeout = ' + str(self.timeout) +  '\n'  
+           error = error + '\n threadID = ' + str(self.threadID) + '\n threadname = ' + self.threadname + '\n timeout = ' + str(self.timeout) + '\n machine = ' + self.machine + '\n cmd = ' + self.cmd + '\n timeout = ' + str(self.timeout) +  '\n username = ' + self.username + '\n'  
            error = error + traceback.format_exc()
            print error
 
 
-#This class runs test cases with class execution, compilatation
+# \brief This class runs test cases with class {execution, compilatation}
+# \param threadID number of thread (for book keeping)
+# \param name string of threadname (for book keeping)
+# \param machine machine name on which to run the command
+# \param logdirOAI5GRepo directory on remote machine which as openairinterface5g repo installed
+# \param testcasename name of test case to run on remote machine
+# \param CleanupAluLteBox string that contains commands to stop ALU Bell Labs LTEBox (specified in test_case_list.xml)
+# \param user username with which to login
+# \param password password with which to login
+# \param timeout timeout of command in seconds
+# \param ExmimoRfStop command to stop EXMIMO Card
 class testCaseThread_generic (threading.Thread):
-   def __init__(self, threadID, name, machine, logdirOAI5GRepo, testcasename,oldprogramList, CleanupAluLteBox, password, timeout):
+   def __init__(self, threadID, name, machine, logdirOAI5GRepo, testcasename,oldprogramList, CleanupAluLteBox, user, password, timeout, ExmimoRfStop):
        threading.Thread.__init__(self)
        self.threadID = threadID
        self.name = name
@@ -343,16 +398,18 @@ class testCaseThread_generic (threading.Thread):
        self.oldprogramList = oldprogramList
        self.CleanupAluLteBox = CleanupAluLteBox
        self.password=password
+       self.ExmimoRfStop = ExmimoRfStop
+       self.user = user
    def run(self):
      try:
        mypassword=''
        #addsudo = 'echo \'' + mypassword + '\' | sudo -S -E '
        addpass = 'echo \'' + mypassword + '\' | '
-       user = getpass.getuser()
+       #user = getpass.getuser()
        print "Starting test case : " + self.testcasename + " On machine " + self.machine + " timeout = " + str(self.timeout) 
        oai = openair('localdomain',self.machine)
-       oai.connect(user, self.password)
-       cleanOldPrograms(oai, self.oldprogramList, self.CleanupAluLteBox)
+       oai.connect(self.user, self.password)
+       #cleanOldPrograms(oai, self.oldprogramList, self.CleanupAluLteBox, self.ExmimoRfStop)
        logdir_local = os.environ.get('OPENAIR_DIR')
        logdir_local_testcase = logdir_local +'/cmake_targets/autotests/log/'+ self.testcasename
        logdir_local_base = logdir_local +'/cmake_targets/autotests/log/'
@@ -384,15 +441,15 @@ class testCaseThread_generic (threading.Thread):
        #Now we copy all the remote files
        #ssh = SSHSession(self.machine , username=user, key_file=None, password=self.password)
        #ssh.get_all(logdir_remote_testcase , logdir_local_base)
-       SSHSessionWrapper(self.machine, user, None, self.password, logdir_remote_testcase, logdir_local_base)
+       SSHSessionWrapper(self.machine, self.user, None, self.password, logdir_remote_testcase, logdir_local_base, "get_all")
        print "Finishing test case : " + self.testcasename + " On machine " + self.machine
-       cleanOldPrograms(oai, self.oldprogramList, self.CleanupAluLteBox)
+       #cleanOldPrograms(oai, self.oldprogramList, self.CleanupAluLteBox, self.ExmimoRfStop)
        #oai.kill(user,mypassword)
        oai.disconnect()
      except Exception, e:
          error=''
          error = error + ' In Class = testCaseThread_generic,  function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: '  + str(e.__class__) + " : " + str( e)
-         error = error + '\n threadID = ' + str(self.threadID) + '\n threadName = ' + self.name + '\n testcasename = ' + self.testcasename + '\n machine = ' + self.machine + '\n logdirOAI5GRepo = ' + self.logdirOAI5GRepo +  '\n' + '\n timeout = ' + str(self.timeout)  
+         error = error + '\n threadID = ' + str(self.threadID) + '\n threadName = ' + self.name + '\n testcasename = ' + self.testcasename + '\n machine = ' + self.machine + '\n logdirOAI5GRepo = ' + self.logdirOAI5GRepo +  '\n' + '\n timeout = ' + str(self.timeout)  + '\n user = ' + self.user
          error = error + traceback.format_exc()
          print error
          print "Continuing with next test case..."
@@ -400,12 +457,25 @@ class testCaseThread_generic (threading.Thread):
 
 
        
-   
+# \bried function to run a command as a sudo
+# \param cmd command as a string
+# \param password password to be supplied   
 def addsudo (cmd, password=""):
   cmd = 'echo \'' + password + '\' | sudo -S -E bash -c \' ' + cmd + '\' '
   return cmd
 
-def handle_testcaseclass_generic (testcasename, threadListGeneric, oldprogramList, logdirOAI5GRepo, MachineList, password, CleanupAluLteBox,timeout):
+# \brief handler for executing test cases (compilation, execution)
+# \param name of testcase
+# \param threadListGeneric list of threads which are already running on remote machines
+# \param oldprogramList list of programs which must be terminated before running a test case
+# \param logdirOAI5GRepo directory on remote machine which as openairinterface5g repo installed
+# \param MachineList list of all machines on which generic test cases can be run
+# \param user username with which to login
+# \param password password with which to login
+# \param CleanupAluLteBox string that contains commands to stop ALU Bell Labs LTEBox (specified in test_case_list.xml)
+# \param timeout timeout of command in seconds
+# \param ExmimoRfStop command to stop EXMIMO Card
+def handle_testcaseclass_generic (testcasename, threadListGeneric, oldprogramList, logdirOAI5GRepo, MachineList, user, password, CleanupAluLteBox,timeout, ExmimoRfStop):
   try:
     mypassword=password
     MachineListFree=[]
@@ -443,7 +513,7 @@ def handle_testcaseclass_generic (testcasename, threadListGeneric, oldprogramLis
        print "MachineListBusy = " + ','.join(MachineListBusy)
        print "MachineList = " + ','.join(MachineList)
     machine = MachineListFree[0]
-    thread = testCaseThread_generic(1,"Generic Thread_"+testcasename+"_"+ "machine_", machine, logdirOAI5GRepo, testcasename, oldprogramList, CleanupAluLteBox, password, timeout)
+    thread = testCaseThread_generic(1,"Generic Thread_"+testcasename+"_"+ "machine_", machine, logdirOAI5GRepo, testcasename, oldprogramList, CleanupAluLteBox, user, password, timeout, ExmimoRfStop)
     param={"thread_id":thread, "Machine":machine, "testcasename":testcasename}
     thread.start()
     threadListNew.append(param)
@@ -451,13 +521,15 @@ def handle_testcaseclass_generic (testcasename, threadListGeneric, oldprogramLis
   except Exception, e:
      error=''
      error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: '  + str(e.__class__) + " : " + str( e)
-     error = error + '\n testcasename = ' + testcasename + '\n logdirOAI5GRepo = ' + logdirOAI5GRepo + '\n MachineList = ' + ','.join(MachineList) + '\n timeout = ' + str(timeout) +  '\n'  
+     error = error + '\n testcasename = ' + testcasename + '\n logdirOAI5GRepo = ' + logdirOAI5GRepo + '\n MachineList = ' + ','.join(MachineList) + '\n timeout = ' + str(timeout) +  '\n' + 'user = ' + user
      error = error + traceback.format_exc()
      print error
      print "Continuing..."
      #sys.exit(1)
 
-#Blocking wait for all threads related to generic testcase execution, class (compilation and execution)
+# \brief Blocking wait for all threads related to generic testcase execution, class (compilation and execution)
+# \param threadListGeneric list of threads which are running on remote machines
+# \param timeout time to wait on threads in seconds
 def wait_testcaseclass_generic_threads(threadListGeneric, timeout = 1):
    threadListGenericNew=[]
    for param in threadListGeneric:
@@ -475,24 +547,50 @@ def wait_testcaseclass_generic_threads(threadListGeneric, timeout = 1):
          #threadListGeneric.remove(param)
    return threadListGenericNew
 
-#Function to handle test case class : lte-softmodem
-def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , logdirOpenaircnRepo, MachineList, password, CleanUpAluLteBox):
+
+# \brief handler for executing test cases (lte-softmodem)
+# \param testcase name of testcase
+# \param oldprogramList list of programs which must be terminated before running a test case
+# \param logdirOAI5GRepo directory on remote machine which has openairinterface5g repo installed
+# \param logdirOpenaircnRepo directory on remote machine which has openair-cn repo installed
+# \param MachineList list of all machines on which test cases can be run
+# \param user username with which to login
+# \param password password with which to login
+# \param CleanupAluLteBox string that contains commands to stop ALU Bell Labs LTEBox (specified in test_case_list.xml)
+# \param ExmimoRfStop command to stop EXMIMO Card
+# \param nruns_lte-softmodem global parameter to override number of runs (nruns) within the test case
+def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo , logdirOpenaircnRepo, MachineList, user, password, CleanUpAluLteBox, ExmimoRfStop, nruns_lte_softmodem, timeout_cmd):
   #We ignore the password sent to this function for secuirity reasons for password present in log files
   #It is recommended to add a line in /etc/sudoers that looks something like below. The line below will run sudo without password prompt
   # your_user_name ALL=(ALL:ALL) NOPASSWD: ALL
   mypassword=''
   #addsudo = 'echo \'' + mypassword + '\' | sudo -S -E '
   addpass = 'echo \'' + mypassword + '\' | '
-  user = getpass.getuser()
+  #user = getpass.getuser()
   testcasename = testcase.get('id')
   testcaseclass = testcase.findtext('class',default='')
-  timeout_cmd = testcase.findtext('TimeOut_cmd',default='')
+  if timeout_cmd == '':
+     timeout_cmd = testcase.findtext('TimeOut_cmd',default='')
   timeout_cmd = int(float(timeout_cmd))
   #Timeout_thread is more than that of cmd to have room for compilation time, etc
   timeout_thread = timeout_cmd + 300 
-  nruns = testcase.findtext('nruns',default='')
+  if nruns_lte_softmodem == '':
+    nruns = testcase.findtext('nruns',default='')
+  else:
+    nruns = nruns_lte_softmodem
   nruns = int(float(nruns))
   tags = testcase.findtext('tags',default='')
+
+  RRHMachine = testcase.findtext('RRH',default='')
+  RRH_compile_prog = testcase.findtext('RRH_compile_prog',default='')
+  RRH_compile_prog_args = testcase.findtext('RRH_compile_prog_args',default='')
+  RRH_pre_exec = testcase.findtext('RRH_pre_exec',default='')
+  RRH_pre_exec_args = testcase.findtext('RRH_pre_exec_args',default='')
+  RRH_main_exec = testcase.findtext('RRH_main_exec',default='')
+  RRH_main_exec_args = testcase.findtext('RRH_main_exec_args',default='')
+  RRH_terminate_missing_procs = testcase.findtext('RRH_terminate_missing_procs',default='True')
+
+
   eNBMachine = testcase.findtext('eNB',default='')
   eNB_config_file = testcase.findtext('eNB_config_file',default='')
   eNB_compile_prog = testcase.findtext('eNB_compile_prog',default='')
@@ -505,6 +603,8 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
   eNB_traffic_exec_args = testcase.findtext('eNB_traffic_exec_args',default='')
   eNB_terminate_missing_procs = testcase.findtext('eNB_terminate_missing_procs',default='True')
   eNB_search_expr_true = testcase.findtext('eNB_search_expr_true','')
+  if re.compile('\w+').match(eNB_search_expr_true) != None:
+      eNB_search_expr_true = eNB_search_expr_true + '  duration=' + str(timeout_cmd-90) + 's' 
 
   UEMachine = testcase.findtext('UE',default='')
   UE_config_file = testcase.findtext('UE_config_file',default='')
@@ -519,6 +619,8 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
   UE_terminate_missing_procs = testcase.findtext('UE_terminate_missing_procs',default='True')
   UE_search_expr_true = testcase.findtext('UE_search_expr_true','')
   UE_stop_script =  testcase.findtext('UE_stop_script','')
+  if re.compile('\w+').match(UE_search_expr_true) != None:
+      UE_search_expr_true = UE_search_expr_true + '  duration=' + str(timeout_cmd-90) + 's'
 
   EPCMachine = testcase.findtext('EPC',default='')
   EPC_config_file = testcase.findtext('EPC_config_file',default='')
@@ -537,23 +639,31 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
   EPC_traffic_exec_args = testcase.findtext('EPC_traffic_exec_args',default='')
   EPC_terminate_missing_procs = testcase.findtext('EPC_terminate_missing_procs',default='True')
   EPC_search_expr_true = testcase.findtext('EPC_search_expr_true','')
+  if re.compile('\w+').match(EPC_search_expr_true) != None:
+     EPC_search_expr_true = EPC_search_expr_true + '  duration=' + str(timeout_cmd-90) + 's'
 
   index_eNBMachine = MachineList.index(eNBMachine)
   index_UEMachine = MachineList.index(UEMachine)
   index_EPCMachine = MachineList.index(EPCMachine)
+  cmd = 'cd ' + logdirOAI5GRepo + '; source oaienv ; env|grep OPENAIR'
   oai_eNB = openair('localdomain', eNBMachine)
   oai_eNB.connect(user, password)
+  res= oai_eNB.send_recv(cmd)
   oai_UE = openair('localdomain', UEMachine)
   oai_UE.connect(user, password)
+  res = oai_eNB.send_recv(cmd)
   oai_EPC = openair('localdomain', EPCMachine)
   oai_EPC.connect(user, password)
-
-  cleanOldPrograms(oai_eNB, oldprogramList, CleanUpAluLteBox)
-  cleanOldPrograms(oai_UE, oldprogramList, CleanUpAluLteBox)
-  cleanOldPrograms(oai_EPC, oldprogramList, CleanUpAluLteBox)
-  logdir_eNB = logdirOAI5GRepo+'/cmake_targets/autotests/log/'+ testcasename
-  logdir_UE =  logdirOAI5GRepo+'/cmake_targets/autotests/log/'+ testcasename
-  logdir_EPC = logdirOpenaircnRepo+'/TEST/autotests/log/'+ testcasename
+  res = oai_eNB.send_recv(cmd)
+  if RRHMachine != '':
+    cmd = 'cd ' + logdirOAI5GRepo + '; source oaienv ; env|grep OPENAIR'
+    index_RRHMachine = MachineList.index(RRHMachine)
+    oai_RRH = openair('localdomain', RRHMachine)
+    oai_RRH.connect(user, password)
+    res= oai_RRH.send_recv(cmd)
+  #cleanOldPrograms(oai_eNB, oldprogramList, CleanUpAluLteBox, ExmimoRfStop)
+  #cleanOldPrograms(oai_UE, oldprogramList, CleanUpAluLteBox, ExmimoRfStop)
+  #cleanOldPrograms(oai_EPC, oldprogramList, CleanUpAluLteBox, ExmimoRfStop)
   logdir_local = os.environ.get('OPENAIR_DIR')
   if logdir_local is None:
      print "Environment variable OPENAIR_DIR not set correctly"
@@ -579,10 +689,14 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
     run_result=1
     run_result_string=''
     logdir_eNB = logdirOAI5GRepo+'/cmake_targets/autotests/log/'+ testcasename + '/run_' + str(run)
+    logdir_RRH = logdirOAI5GRepo+'/cmake_targets/autotests/log/'+ testcasename + '/run_' + str(run)
     logdir_UE =  logdirOAI5GRepo+'/cmake_targets/autotests/log/'+ testcasename + '/run_' + str(run)
     logdir_EPC = logdirOpenaircnRepo+'/TEST/autotests/log/'+ testcasename + '/run_' + str(run)
     logdir_local_testcase = logdir_local + '/cmake_targets/autotests/log/'+ testcasename + '/run_' + str(run)
     #Make the log directory of test case
+    if RRHMachine != '':
+      cmd = 'rm -fr ' + logdir_RRH + ' ; mkdir -p ' + logdir_RRH
+      result = oai_RRH.send_recv(cmd)
     cmd = 'rm -fr ' + logdir_eNB + ' ; mkdir -p ' + logdir_eNB
     result = oai_eNB.send_recv(cmd)
     cmd = 'rm -fr ' + logdir_UE + ' ; mkdir -p ' +  logdir_UE
@@ -591,6 +705,39 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
     result = oai_EPC.send_recv(cmd)
     cmd = ' rm -fr ' + logdir_local_testcase + ' ; mkdir -p ' + logdir_local_testcase
     result = os.system(cmd)
+
+    if RRHMachine != '':
+       logfile_compile_RRH = logdir_RRH + '/RRH_compile' + '_' + str(run) + '_.log'
+       logfile_exec_RRH = logdir_RRH + '/RRH_exec' + '_' + str(run) + '_.log'
+       logfile_pre_exec_RRH = logdir_RRH + '/RRH_pre_exec' + '_' + str(run) + '_.log'
+       logfile_task_RRH_compile_out = logdir_RRH + '/RRH_task_compile_out' + '_' + str(run) + '_.log'
+       logfile_task_RRH_compile = logdir_local_testcase + '/RRH_task_compile' + '_' + str(run) + '_.log'
+       logfile_task_RRH_out = logdir_RRH + '/RRH_task_out' + '_' + str(run) + '_.log'
+       logfile_task_RRH = logdir_local_testcase + '/RRH_task' + '_' + str(run) + '_.log'
+       task_RRH_compile = ' ( uname -a ; date \n'
+       task_RRH_compile = task_RRH_compile + 'cd ' + logdirOAI5GRepo + ' ; source oaienv ; source cmake_targets/tools/build_helper \n'
+       task_RRH_compile = task_RRH_compile + 'env |grep OPENAIR  \n'
+       if RRH_compile_prog != "":
+         task_RRH_compile  = task_RRH_compile +  ' ( ' + RRH_compile_prog + ' '+ RRH_compile_prog_args + ' ) > ' + logfile_compile_RRH + ' 2>&1 \n'
+       task_RRH_compile =  task_RRH_compile + ' date ) > ' + logfile_task_RRH_compile_out + ' 2>&1  '
+       write_file(logfile_task_RRH_compile, task_RRH_compile, mode="w")
+
+       task_RRH = ' ( uname -a ; date \n'
+       task_RRH = task_RRH + ' export OPENAIR_TESTDIR=' + logdir_RRH + '\n'
+       task_RRH = task_RRH + 'cd ' + logdirOAI5GRepo + ' ; source oaienv ; source cmake_targets/tools/build_helper \n'
+       task_RRH = task_RRH + 'env |grep OPENAIR  \n' + 'array_exec_pid=() \n'
+
+       if RRH_pre_exec != "":
+          task_RRH  = task_RRH +  ' ( date; ' + RRH_pre_exec + ' '+ RRH_pre_exec_args + ' ) > ' + logfile_pre_exec_RRH + ' 2>&1 \n'
+       if RRH_main_exec != "":
+          task_RRH = task_RRH + ' ( date; ' + addsudo(RRH_main_exec + ' ' + RRH_main_exec_args, mypassword) + ' ) > ' + logfile_exec_RRH + ' 2>&1 & \n'
+          task_RRH = task_RRH + 'array_exec_pid+=($!) \n'
+          task_RRH = task_RRH + 'echo eNB_main_exec PID = $! \n'
+       #terminate the eNB test case after timeout_cmd seconds
+       task_RRH  = task_RRH + finalize_deploy_script (timeout_cmd, RRH_terminate_missing_procs) + ' \n'
+       task_RRH  = task_RRH + 'handle_ctrl_c' + '\n' 
+       task_RRH  = task_RRH + ' ) > ' + logfile_task_RRH_out + ' 2>&1  '
+       write_file(logfile_task_RRH, task_RRH, mode="w")
     
     logfile_compile_eNB = logdir_eNB + '/eNB_compile' + '_' + str(run) + '_.log'
     logfile_exec_eNB = logdir_eNB + '/eNB_exec' + '_' + str(run) + '_.log'
@@ -601,6 +748,10 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
     logfile_task_eNB_out = logdir_eNB + '/eNB_task_out' + '_' + str(run) + '_.log'
     logfile_task_eNB = logdir_local_testcase + '/eNB_task' + '_' + str(run) + '_.log'
     logfile_local_traffic_eNB_out = logdir_local_testcase + '/eNB_traffic' + '_' + str(run) + '_.log' 
+    logfile_tshark_eNB = logdir_eNB + '/eNB_tshark' + '_' + str(run) + '_.log'
+    logfile_pcap_eNB = logdir_eNB + '/eNB_tshark' + '_' + str(run) + '_.pcap'
+    logfile_pcap_zip_eNB = logdir_eNB + '/eNB_tshark' + '_' + str(run) + '_.pcap.zip'
+    logfile_pcap_tmp_eNB = '/tmp/' + '/eNB_tshark' + '_' + str(run) + '_.pcap'
 
     task_eNB_compile = ' ( uname -a ; date \n'
     task_eNB_compile = task_eNB_compile + 'cd ' + logdirOAI5GRepo + ' ; source oaienv ; source cmake_targets/tools/build_helper \n'
@@ -612,19 +763,27 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
     write_file(logfile_task_eNB_compile, task_eNB_compile, mode="w")
 
     task_eNB = ' ( uname -a ; date \n'
+    task_eNB = task_eNB + ' export OPENAIR_TESTDIR=' + logdir_eNB + '\n'
     task_eNB = task_eNB + 'cd ' + logdirOAI5GRepo + ' ; source oaienv ; source cmake_targets/tools/build_helper \n'
     task_eNB = task_eNB + 'env |grep OPENAIR  \n' + 'array_exec_pid=() \n'
 
     if eNB_pre_exec != "":
-       task_eNB  = task_eNB +  ' ( ' + eNB_pre_exec + ' '+ eNB_pre_exec_args + ' ) > ' + logfile_pre_exec_eNB + ' 2>&1 \n'
+       task_eNB  = task_eNB +  ' ( date; ' + eNB_pre_exec + ' '+ eNB_pre_exec_args + ' ) > ' + logfile_pre_exec_eNB + ' 2>&1 \n'
     if eNB_main_exec != "":
-       task_eNB = task_eNB + ' ( ' + addsudo(eNB_main_exec + ' ' + eNB_main_exec_args, mypassword) + ' ) > ' + logfile_exec_eNB + ' 2>&1 & \n'
+       task_eNB = task_eNB + ' ( date; ' + addsudo(eNB_main_exec + ' ' + eNB_main_exec_args, mypassword) + ' ) > ' + logfile_exec_eNB + ' 2>&1 & \n'
        task_eNB = task_eNB + 'array_exec_pid+=($!) \n'
        task_eNB = task_eNB + 'echo eNB_main_exec PID = $! \n'
     if eNB_traffic_exec != "":
-       task_eNB = task_eNB + ' ( ' + eNB_traffic_exec + ' ' + eNB_traffic_exec_args + ' ) > ' + logfile_traffic_eNB + ' 2>&1 & \n '
+       cmd_traffic = eNB_traffic_exec + ' ' + eNB_traffic_exec_args
+       if cmd_traffic.find('-c') >= 0:
+          cmd_traffic = cmd_traffic + ' -t ' + str(timeout_cmd - 60)
+       task_eNB = task_eNB + ' (date;  ' + cmd_traffic + ' ) > ' + logfile_traffic_eNB + ' 2>&1 & \n'
        task_eNB = task_eNB + 'array_exec_pid+=($!) \n'
        task_eNB = task_eNB + 'echo eNB_traffic_exec PID = $! \n'
+
+    task_eNB = task_eNB + ' (date; sudo rm -f ' + logfile_pcap_tmp_eNB + ' ; sudo -E tshark -i lo -s 65535 -a duration:' + str(timeout_cmd-10)+ ' -w ' + logfile_pcap_tmp_eNB+ ' ; sudo -E chown ' + user + ' ' + logfile_pcap_tmp_eNB + ' ; zip -j -9  ' + logfile_pcap_zip_eNB + ' ' + logfile_pcap_tmp_eNB + '   ) > ' + logfile_tshark_eNB + ' 2>&1 & \n '
+    task_eNB = task_eNB + 'array_exec_pid+=($!) \n'
+    task_eNB = task_eNB + 'echo eNB_tshark_exec PID = $! \n'
     #terminate the eNB test case after timeout_cmd seconds
     task_eNB  = task_eNB + finalize_deploy_script (timeout_cmd, eNB_terminate_missing_procs) + ' \n'
     #task_eNB  = task_eNB + 'sleep ' +  str(timeout_cmd) + ' \n'
@@ -662,13 +821,16 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
     task_UE = task_UE + 'source cmake_targets/tools/build_helper \n'
     task_UE = task_UE + 'env |grep OPENAIR  \n'
     if UE_pre_exec != "":
-       task_UE  = task_UE +  ' ( ' + UE_pre_exec + ' '+ UE_pre_exec_args + ' ) > ' + logfile_pre_exec_UE + ' 2>&1 \n'
+       task_UE  = task_UE +  ' ( date; ' + UE_pre_exec + ' '+ UE_pre_exec_args + ' ) > ' + logfile_pre_exec_UE + ' 2>&1 \n'
     if UE_main_exec != "":
-       task_UE = task_UE + ' ( ' + addsudo(UE_main_exec + ' ' + UE_main_exec_args, mypassword)  + ' ) > ' + logfile_exec_UE + ' 2>&1 & \n'
+       task_UE = task_UE + ' ( date;  ' + addsudo(UE_main_exec + ' ' + UE_main_exec_args, mypassword)  + ' ) > ' + logfile_exec_UE + ' 2>&1 & \n'
        task_UE = task_UE + 'array_exec_pid+=($!) \n'
        task_UE = task_UE + 'echo UE_main_exec PID = $! \n'
     if UE_traffic_exec != "":
-       task_UE = task_UE + ' ( ' + UE_traffic_exec + ' ' + UE_traffic_exec_args + ' ) >' + logfile_traffic_UE + ' 2>&1 & \n'
+       cmd_traffic = UE_traffic_exec + ' ' + UE_traffic_exec_args
+       if cmd_traffic.find('-c') >= 0:
+          cmd_traffic = cmd_traffic + ' -t ' + str(timeout_cmd - 60)
+       task_UE = task_UE + ' ( date;  ' + cmd_traffic + ' ) >' + logfile_traffic_UE + ' 2>&1 & \n'
        task_UE = task_UE + 'array_exec_pid+=($!) \n'
        task_UE = task_UE + 'echo UE_traffic_exec PID = $! \n'
     #terminate the UE test case after timeout_cmd seconds
@@ -693,7 +855,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
 
     task_EPC_compile = ' ( uname -a ; date \n'
     task_EPC_compile = task_EPC_compile + 'array_exec_pid=()' + '\n'
-    task_EPC_compile = task_EPC_compile + 'cd ' + logdirOpenaircnRepo + '\n'
+    task_EPC_compile = task_EPC_compile + 'cd ' + logdirOpenaircnRepo + ' ; source oaienv \n'
     task_EPC_compile = task_EPC_compile + update_config_file(oai_EPC, EPC_config_file, logdirOpenaircnRepo, logdirOpenaircnRepo+'/TEST/autotests/tools/search_repl.py') + '\n'
     task_EPC_compile = task_EPC_compile +  'source BUILD/TOOLS/build_helper \n'
     if EPC_compile_prog != "":
@@ -704,21 +866,25 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
     write_file(logfile_task_EPC_compile, task_EPC_compile, mode="w")
     
     task_EPC = ' ( uname -a ; date \n'
+    task_EPC = task_EPC + ' export OPENAIRCN_TESTDIR=' + logdir_EPC + '\n'
     task_EPC = task_EPC + 'array_exec_pid=()' + '\n'
-    task_EPC = task_EPC + 'cd ' + logdirOpenaircnRepo + '\n'
+    task_EPC = task_EPC + 'cd ' + logdirOpenaircnRepo + '; source oaienv\n'
     task_EPC = task_EPC +  'source BUILD/TOOLS/build_helper \n'
     if EPC_pre_exec != "":
-       task_EPC  = task_EPC +  ' ( ' + EPC_pre_exec + ' '+ EPC_pre_exec_args + ' ) > ' + logfile_pre_exec_EPC + ' 2>&1 \n'
+       task_EPC  = task_EPC +  ' ( date; ' + EPC_pre_exec + ' '+ EPC_pre_exec_args + ' ) > ' + logfile_pre_exec_EPC + ' 2>&1 \n'
     if HSS_main_exec !=  "":
-       task_EPC  = task_EPC + '(' + addsudo (HSS_main_exec + ' ' + HSS_main_exec_args, mypassword) + ' ) > ' + logfile_exec_HSS  +  ' 2>&1   & \n'
+       task_EPC  = task_EPC + '( date; ' + addsudo (HSS_main_exec + ' ' + HSS_main_exec_args, mypassword) + ' ) > ' + logfile_exec_HSS  +  ' 2>&1   & \n'
        task_EPC = task_EPC + 'array_exec_pid+=($!) \n'
        task_EPC = task_EPC + 'echo HSS_main_exec PID = $! \n'
     if EPC_main_exec !=  "":
-       task_EPC  = task_EPC + '(' + addsudo (EPC_main_exec + ' ' + EPC_main_exec_args, mypassword) + ' ) > ' + logfile_exec_EPC  +  ' 2>&1   & \n'
+       task_EPC  = task_EPC + '( date; ' + addsudo (EPC_main_exec + ' ' + EPC_main_exec_args, mypassword) + ' ) > ' + logfile_exec_EPC  +  ' 2>&1   & \n'
        task_EPC = task_EPC + 'array_exec_pid+=($!) \n'
        task_EPC = task_EPC + 'echo EPC_main_exec PID = $! \n'
     if EPC_traffic_exec !=  "":
-       task_EPC  = task_EPC + '(' + EPC_traffic_exec + ' ' + EPC_traffic_exec_args + ' ) > ' + logfile_traffic_EPC  +  ' 2>&1   & \n' 
+       cmd_traffic = EPC_traffic_exec + ' ' + EPC_traffic_exec_args
+       if cmd_traffic.find('-c') >= 0:
+          cmd_traffic = cmd_traffic + ' -t ' + str(timeout_cmd - 60)
+       task_EPC  = task_EPC + '( date; ' + cmd_traffic + ' ) > ' + logfile_traffic_EPC  +  ' 2>&1   & \n' 
        task_EPC = task_EPC + 'array_exec_pid+=($!) \n'  
        task_EPC = task_EPC + 'echo EPC_traffic_exec PID = $! \n'
     #terminate the EPC test case after timeout_cmd seconds   
@@ -732,14 +898,20 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
     thread_EPC = oaiThread(1, "EPC_thread", EPCMachine, user, password , task_EPC_compile, False, timeout_thread)
     thread_eNB = oaiThread(2, "eNB_thread", eNBMachine, user, password , task_eNB_compile, False, timeout_thread)
     thread_UE = oaiThread(3, "UE_thread", UEMachine, user, password  , task_UE_compile, False, timeout_thread) 
+    if RRHMachine != '':
+        thread_RRH = oaiThread(4, "RRH_thread", RRHMachine, user, password  , task_RRH_compile, False, timeout_thread) 
     threads=[]
     threads.append(thread_eNB)
     threads.append(thread_UE)
     threads.append(thread_EPC)
+    if RRHMachine != '':
+        threads.append(thread_RRH)
     # Start new Threads
     thread_eNB.start()
     thread_UE.start()
     thread_EPC.start()
+    if RRHMachine != '':
+        thread_RRH.start()
     #Wait for all the compile threads to complete
     for t in threads:
        t.join()
@@ -748,25 +920,29 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
     thread_EPC = oaiThread(1, "EPC_thread", EPCMachine, user, password , task_EPC, False, timeout_thread)
     thread_eNB = oaiThread(2, "eNB_thread", eNBMachine, user, password , task_eNB, False, timeout_thread)
     thread_UE = oaiThread(3, "UE_thread", UEMachine, user, password  , task_UE, False, timeout_thread) 
-
+    if RRHMachine != '':
+        thread_RRH = oaiThread(4, "RRH_thread", RRHMachine, user, password  , task_RRH, False, timeout_thread) 
     threads=[]
     threads.append(thread_eNB)
     threads.append(thread_UE)
     threads.append(thread_EPC)
+    if RRHMachine != '':
+        threads.append(thread_RRH)
     # Start new Threads
 
     thread_eNB.start()
     thread_UE.start()
     thread_EPC.start()
-
+    if RRHMachine != '':
+        thread_RRH.start()
     #Wait for all the compile threads to complete
     for t in threads:
        t.join()
     #Now we get the log files from remote machines on the local machine
-
-    cleanOldPrograms(oai_eNB, oldprogramList, CleanUpAluLteBox)
-    cleanOldPrograms(oai_UE, oldprogramList, CleanUpAluLteBox)
-    cleanOldPrograms(oai_EPC, oldprogramList, CleanUpAluLteBox)
+    if RRHMachine != '':
+       cleanOldProgramsAllMachines([oai_eNB, oai_UE, oai_EPC, oai_RRH] , oldprogramList, CleanUpAluLteBox, ExmimoRfStop, [logdir_eNB, logdir_UE, logdir_EPC, logdir_RRH], logdirOAI5GRepo)
+    else:
+       cleanOldProgramsAllMachines([oai_eNB, oai_UE, oai_EPC] , oldprogramList, CleanUpAluLteBox, ExmimoRfStop, [logdir_eNB, logdir_UE, logdir_EPC], logdirOAI5GRepo)       
     logfile_UE_stop_script_out = logdir_UE + '/UE_stop_script_out' + '_' + str(run) + '_.log'
     logfile_UE_stop_script = logdir_local_testcase + '/UE_stop_script' + '_' + str(run) + '_.log'
 
@@ -781,22 +957,36 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
       thread_UE.start()
       thread_UE.join()
    
+    #Now we change the permissions of the logfiles to avoid some of them being with root permissions
+    cmd = 'sudo -E chown -R ' + user + ' ' + logdir_eNB
+    res= oai_eNB.send_recv(cmd)
+    print "Changing permissions of logdir <" + logdir_eNB + "> in eNB machine..." + res
+
+    cmd = 'sudo -E chown -R ' + user + ' ' +  logdir_UE
+    res= oai_UE.send_recv(cmd)
+    print "Changing permissions of logdir <" + logdir_UE + "> in UE machine..." + res
+
+    cmd = 'sudo -E chown -R ' + user + ' ' +  logdir_EPC
+    res= oai_EPC.send_recv(cmd)
+    print "Changing permissions of logdir <" + logdir_EPC + "> in EPC machine..." + res
+
+    if RRHMachine != '':
+       cmd = 'sudo -E chown -R ' + user + ' ' +  logdir_RRH
+       res= oai_RRH.send_recv(cmd)
+       print "Changing permissions of logdir <" + logdir_RRH + "> in RRH machine..." + res
 
     print "Copying files from EPCMachine : " + EPCMachine + "logdir_EPC = " + logdir_EPC
-    #ssh = SSHSession(EPCMachine , username=user, key_file=None, password=password)
-    #ssh.get_all(logdir_EPC , logdir_local + '/cmake_targets/autotests/log/'+ testcasename)
-    SSHSessionWrapper(EPCMachine, user, None, password, logdir_EPC, logdir_local + '/cmake_targets/autotests/log/'+ testcasename)
+    SSHSessionWrapper(EPCMachine, user, None, password, logdir_EPC, logdir_local + '/cmake_targets/autotests/log/'+ testcasename, "get_all")
 
     print "Copying files from eNBMachine " + eNBMachine + "logdir_eNB = " + logdir_eNB
-    #ssh = SSHSession(eNBMachine , username=user, key_file=None, password=password)
-    #ssh.get_all(logdir_eNB, logdir_local + '/cmake_targets/autotests/log/'+ testcasename)
-    SSHSessionWrapper(eNBMachine, user, None, password, logdir_eNB, logdir_local + '/cmake_targets/autotests/log/'+ testcasename)
+    SSHSessionWrapper(eNBMachine, user, None, password, logdir_eNB, logdir_local + '/cmake_targets/autotests/log/'+ testcasename, "get_all")
 
     print "Copying files from UEMachine : " + UEMachine + "logdir_UE = " + logdir_UE
-    #ssh = SSHSession(UEMachine , username=user, key_file=None, password=password)
-    #ssh.get_all(logdir_UE , logdir_local + '/cmake_targets/autotests/log/'+ testcasename)
-    SSHSessionWrapper(UEMachine, user, None, password, logdir_UE, logdir_local + '/cmake_targets/autotests/log/'+ testcasename)
+    SSHSessionWrapper(UEMachine, user, None, password, logdir_UE, logdir_local + '/cmake_targets/autotests/log/'+ testcasename, "get_all")
 
+    if RRHMachine != '':
+       print "Copying files from RRHMachine : " + RRHMachine + "logdir_RRH = " + logdir_RRH
+       SSHSessionWrapper(RRHMachine, user, None, password, logdir_RRH, logdir_local + '/cmake_targets/autotests/log/'+ testcasename, "get_all")
 
     
     #Currently we only perform throughput tests
@@ -815,7 +1005,28 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
       run_result_string = ' RUN_'+str(run) + ' = PASS'
     else:
       run_result_string = ' RUN_'+str(run) + ' = FAIL'
-    
+
+    #If there is assertion, we mark the test case as failure as most likely eNB crashed
+    cmd = "grep -ilr \"assertion\" " + logdir_local_testcase + " | cat " 
+    cmd_out = subprocess.check_output ([cmd], shell=True)
+    if len(cmd_out) !=0 :
+      run_result=0
+      run_result_string = ' RUN_'+str(run) + ' = FAIL(Assert)'
+
+    #If there is thread busy error, we mark the test case as failure as most likely eNB crashed
+    cmd = "grep -ilr \"thread busy\" " + logdir_local_testcase + " | cat "
+    cmd_out = subprocess.check_output ([cmd], shell=True)
+    if len(cmd_out) !=0:
+      run_result=0
+      run_result_string = ' RUN_'+str(run) + ' = FAIL(Thread_Busy)'
+
+    #If there is Segmentation fault, we mark the test case as failure as most likely eNB crashed
+    cmd = "grep -ilr \"segmentation fault\" " + logdir_local_testcase + " | cat "
+    cmd_out = subprocess.check_output ([cmd], shell=True)
+    if len(cmd_out) !=0:
+      run_result=0
+      run_result_string = ' RUN_'+str(run) + ' = FAIL(SEGFAULT)'
+
     run_result_string = run_result_string + tput_run_string
 
     test_result=test_result & run_result
@@ -839,88 +1050,199 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
   write_file(xmlFile, xml, mode="w")
 
 
-#This function searches if test case is present in list of test cases that need to be executed by user
-def search_test_case_group(testcasename, testcasegroup, search_test_case_group):
+# \brief This function searches if test case is present in list of test cases that need to be executed by user
+# \param testcasename the test case to search for
+# \param testcasegroup list that is passed from the arguments
+# \param test_case_exclude list of test cases excluded from execution (specified in test_case_list.xml)
+def search_test_case_group(testcasename, testcasegroup, test_case_exclude):
     
-    if search_test_case_group.find(testcasename) >=0:
-       print "\nSkipping test case as it is found in black list: " + testcasename
-       return False
+    if test_case_exclude != "":
+       testcase_exclusion_list=test_case_exclude.split()
+       for entry in testcase_exclusion_list:
+          if entry.find('+') >=0:
+            match = re.search(entry, testcasename)
+            if match:
+               print "\nSkipping test case as it is found in black list: " + testcasename
+               return False
+          else:
+             match = entry.find(testcasename)
+             if match >=0:
+                print "\nSkipping test case as it is found in black list: " + testcasename
+                return False
     if testcasegroup == '':
-       return True
-    testcaselist = testcasegroup.split()
-    for entry in testcaselist:
-       if entry.find('+') >=0:
-          match = re.search(entry, testcasename)
-          if match:
-             return True
-       else:
-          match = testcasename.find(entry)
-          if match >=0:
+         return True
+    else:
+      testcaselist = testcasegroup.split()
+      for entry in testcaselist:
+        if entry.find('+') >=0:
+           match = re.search(entry, testcasename)
+           if match:
+              return True
+        else:
+           match = testcasename.find(entry)
+           if match >=0:
              return True
     return False
-   
-       
 
-#thread1 = myThread(1, "Thread-1", 1)
+# \brief thread that cleans up remote machines from pre-existing test case executions
+# \param threadID number of thread (for book keeping)
+# \param threadname name of thread (for book keeping)
+# \param oai handler that can be used to execute programs on remote machines
+# \param CleanUpOldProgs list of programs which must be terminated before running a test case (specified in test_case_list.xml)
+# \param CleanupAluLteBox string that contains commands to stop ALU Bell Labs LTEBox (specified in test_case_list.xml)
+# \param ExmimoRfStop command to stop EXMIMO Card
+class oaiCleanOldProgramThread (threading.Thread):
+    def __init__(self, threadID, threadname, oai, CleanUpOldProgs, CleanUpAluLteBox, ExmimoRfStop, logdir, logdirOAI5GRepo):
+        threading.Thread.__init__(self)
+        self.threadID = threadID
+        self.threadname = threadname
+        self.oai = oai
+        self.CleanUpOldProgs = CleanUpOldProgs
+        self.CleanUpAluLteBox = CleanUpAluLteBox
+        self.ExmimoRfStop = ExmimoRfStop
+        self.logdir = logdir
+        self.logdirOAI5GRepo = logdirOAI5GRepo
+    def run(self):
+        try:
+          cleanOldPrograms(self.oai, self.CleanUpOldProgs, self.CleanUpAluLteBox, self.ExmimoRfStop, self.logdir, self.logdirOAI5GRepo)
+        except Exception, e:
+           error=''
+           error = error + ' In class oaiCleanOldProgramThread, function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: '  + str(e.__class__) + " : " + str( e)
+           error = error + '\n threadID = ' + str(self.threadID) + '\n threadname = ' + self.threadname + '\n CleanUpOldProgs = ' + self.CleanUpOldProgs + '\n CleanUpAluLteBox = ' + self.CleanUpAluLteBox + '\n ExmimoRfStop = ' + self.ExmimoRfStop + '\n'  
+           error = error + traceback.format_exc()
+           print error
+           print "There is error in cleaning up old programs....."
+           #sys.exit(1)
+
+# \brief Run parallel threads in all machines for clean up old execution of test cases
+# \param oai_list list of handlers that can be used to execute programs on remote machines
+# \param CleanUpOldProgs list of programs which must be terminated before running a test case (specified in test_case_list.xml)
+# \param CleanupAluLteBox string that contains commands to stop ALU Bell Labs LTEBox (specified in test_case_list.xml)
+# \param ExmimoRfStop command to stop EXMIMO Card
+def cleanOldProgramsAllMachines(oai_list, CleanOldProgs, CleanUpAluLteBox, ExmimoRfStop, logdir_list, logdirOAI5GRepo):
+   threadId=0
+   threadList=[]
+   index=0
+   if len(oai_list)!=len(logdir_list) :
+       logdir_list=[logdir[0]]*len(oai_list)
+
+   for oai in oai_list:
+      threadName="cleanup_thread_"+str(threadId)
+      thread=oaiCleanOldProgramThread(threadId, threadName, oai, CleanUpOldProgs, CleanUpAluLteBox, ExmimoRfStop, logdir_list[index],logdirOAI5GRepo)
+      threadList.append(thread)
+      thread.start()
+      threadId = threadId + 1
+      index = index+1
+   for t in threadList:
+      t.join()
+
+
 debug = 0
 pw =''
 i = 0
 dlsim=0
 localshell=0
-is_compiled = 0
-timeout=2000
-xmlInputFile="./test_case_list.xml"
-NFSResultsDir = '/mnt/sradio'
-cleanupOldProgramsScript = '$OPENAIR_DIR/cmake_targets/autotests/tools/remove_old_programs.bash'
+GitOAI5GRepo=''
+GitOAI5GRepoBranch=''
+GitOAI5GHeadVersion=''
+user=''
+pw=''
 testcasegroup=''
-
-logdir = '/tmp/' + 'OAITestFrameWork-' + getpass.getuser() + '/'
-logdirOAI5GRepo = logdir + 'openairinterface5g/'
-logdirOpenaircnRepo = logdir + 'openair-cn/'
-
+NFSResultsShare=''
+cleanUpRemoteMachines=False
 openairdir_local = os.environ.get('OPENAIR_DIR')
 if openairdir_local is None:
    print "Environment variable OPENAIR_DIR not set correctly"
    sys.exit()
-locallogdir = openairdir_local + '/cmake_targets/autotests/log/'
-#Remove  the contents of local log directory
-#os.system(' rm -fr ' + locallogdir + '; mkdir -p ' +  locallogdir  )
+locallogdir = openairdir_local + '/cmake_targets/autotests/log'
+MachineList = ''
+MachineListGeneric=''
 flag_remove_logdir=False
+flag_start_testcase=False
+nruns_lte_softmodem=''
+flag_skip_git_head_check=False
+flag_skip_oai_install=False
+Timeout_cmd=''
+print "Number of arguments argc = " + str(len(sys.argv))
+#for index in range(1,len(sys.argv) ):
+#  print "argv_" + str(index) + " : " + sys.argv[index]
+
 i=1
 while i < len (sys.argv):
     arg=sys.argv[i]
-    if arg == '-d':
-        debug = 1
-    elif arg == '-dd':
-        debug = 2
-    elif arg == '-p' :
-        prompt2 = sys.argv[i+1]
-        i = i +1
-    elif arg == '-r':
-        flag_remove_logdir=True 
-    elif arg == '-w' :
-        pw = sys.argv[i+1]
-        i = i +1  
-    elif arg == '-P' :
-        dlsim = 1
-    elif arg == '-l' :
-        localshell = 1
-    elif arg == '-c' :
-        is_compiled = 1
-    elif arg == '-t' :
-        timeout = sys.argv[i+1]
-        i = i +1  
+    if arg == '-r':
+        flag_remove_logdir=True
+    elif arg == '-s' :
+        flag_start_testcase=True
     elif arg == '-g' :
         testcasegroup = sys.argv[i+1].replace("\"","")
         i = i +1   
+    elif arg == '-c':
+        cleanUpRemoteMachines=True
+    elif arg == '-5GRepo':
+        GitOAI5GRepo = sys.argv[i+1]
+        i = i +1
+    elif arg == '-5GRepoBranch':
+        GitOAI5GRepoBranch = sys.argv[i+1]
+        i = i +1
+    elif arg == '-5GRepoHeadVersion':
+        GitOAI5GHeadVersion = sys.argv[i+1]
+        #We now find the branch that corresponds to this Git Head Commit
+        cmd = "git show-ref --head " + " | grep " + GitOAI5GHeadVersion
+        cmd_out = subprocess.check_output ([cmd], shell=True)
+        cmd_out=cmd_out.replace("\n","")
+        cmd_out = cmd_out.split('/')
+        GitOAI5GRepoBranch = cmd_out[-1]
+        if GitOAI5GRepoBranch == '':
+           print "Error extracting GitBranch from head commit. Exiting now..."
+           sys.exit(1)
+        i = i +1
+    elif arg == '-u':
+        user = sys.argv[i+1]
+        i = i +1
+    elif arg == '-p': 
+        pw = sys.argv[i+1]
+        i = i +1
+    elif arg == '-n': 
+        NFSResultsShare = sys.argv[i+1]
+        i = i +1
+    elif arg == '--nrun_lte_softmodem': 
+        nruns_lte_softmodem = sys.argv[i+1]
+        i = i +1
+    elif arg == '-MachineList':
+        MachineList =  sys.argv[i+1]
+        MachineList = MachineList.replace("\"","")
+        MachineList = MachineList.replace("\'","")
+        i = i +1
+    elif arg == '-MachineListGeneric':
+        MachineListGeneric =  sys.argv[i+1]
+        MachineListGeneric = MachineListGeneric.replace("\"","")
+        MachineListGeneric = MachineListGeneric.replace("\'","")
+        i = i +1
+    elif arg == '--skip-git-head-check':
+        flag_skip_git_head_check=True
+    elif arg == '--timeout_cmd': 
+        Timeout_cmd = sys.argv[i+1]
+        i = i +1
+    elif arg == '--skip-oai-install':
+        flag_skip_oai_install=True
     elif arg == '-h' :
-        print "-d:  low debug level"
-        print "-dd: high debug level"
-        print "-p:  set the prompt"
-        print "-r:  Remove the log directory in autotests/"
-        print "-w:  set the password for ssh to localhost"
-        print "-l:  use local shell instead of ssh connection"
-        print "-t:  set the time out in second for commands"
+        print "-s:  This flag *MUST* be set to start the test cases"
+        print "-r:  Remove the log directory in autotests"
+        print "-g:  Run test cases in a group"
+        print "-c:  Run cleanup scripts on remote machines and exit"
+        print "-5GRepo:  Repository for OAI 5G to use to run tests (overrides GitOAI5GRepo in test_case_list.xml)"
+        print "-5GRepoBranch:  Branch for OAI 5G Repository to run tests (overrides the branch in test_case_list.xml)"
+        print "-5GRepoHeadVersion:  Head commit on which to run tests (overrides the branch in test_case_list.xml)"
+        print "-u:  use the user name passed as argument"
+        print "-p:  use the password passed as an argument"
+        print "-n:  Set the NFS share passed as an argument"
+        print "--nrun_lte_softmodem:  Set the number of runs for lte-softmodem test case class"
+        print "-MachineList : overrides the MachineList parameter in test_case_list.xml"
+        print "-MachineListGeneric : overrides the MachineListGeneric  parameter in test_case_list.xml"
+        print "--skip-git-head-check: skip checking of GitHead remote/local branch (only for debugging)"
+        print "--timeout_cmd: Override the default parameter (timeout_cmd) in test_case_list.xml. This parameter is in seconds and should be > 120"
+        print "--skip-oai-install: Skips the openairinterface5g installer"
         sys.exit()
     else :
         print "Unrecongnized Option: <" + arg + ">. Use -h to see valid options"
@@ -945,27 +1267,49 @@ except KeyError:
    print "Please set the environment variable OPENAIR_TARGETS in the .bashrc"
    sys.exit(1)
 
-if flag_remove_logdir == True:
-   print "Removing directory: " + locallogdir
-   os.system(' rm -fr ' + locallogdir + '; mkdir -p ' +  locallogdir  )
-
+print "Killing zombie ssh sessions from earlier sessions..."
+cmd='ps aux |grep \"/usr/bin/ssh -q -l guptar\"| awk \'{print $2}\' | sudo xargs kill -9  '
 
+os.system(cmd)
 
-paramiko_logfile = os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/log/paramiko.log')
-res=os.system(' echo > ' + paramiko_logfile)
-paramiko.util.log_to_file(paramiko_logfile)
+if flag_start_testcase == False:
+  print "You need to start the testcase by passing option -s. Use -h to see all options. Aborting now..."
+  sys.exit(1)
 
 # get the oai object
 host = os.uname()[1]
 #oai = openair('localdomain','calisson')
-oai_list = {}
-
+oai_list = []
 
 #start_time = time.time()  # datetime.datetime.now()
-user = getpass.getuser()
+if user=='':
+  user = getpass.getuser()
+if pw=='':
+  pw = getpass.getpass()
+
+print "Killing zombie ssh sessions from earlier sessions..."
+cmd='ps aux |grep \"/usr/bin/ssh -q -l guptar\"|tr -s \" \" :|cut -f 2 -d :|xargs kill -9 '
+cmd = cmd + '; ps aux |grep \"/usr/bin/ssh -q -l ' + user + '\"|tr -s \" \" :|cut -f 2 -d :|xargs kill -9 '
+os.system(cmd)
+
 print "host = " + host 
 print "user = " + user
-pw=getpass.getpass()
+xmlInputFile=os.environ.get('OPENAIR_DIR')+"/cmake_targets/autotests/test_case_list.xml"
+NFSResultsDir = '/mnt/sradio'
+cleanupOldProgramsScript = '$OPENAIR_DIR/cmake_targets/autotests/tools/remove_old_programs.bash'
+logdir = '/tmp/' + 'OAITestFrameWork-' + user + '/'
+logdirOAI5GRepo = logdir + 'openairinterface5g/'
+logdirOpenaircnRepo = logdir + 'openair-cn/'
+
+if flag_remove_logdir == True:
+   print "Removing directory: " + locallogdir
+   os.system(' rm -fr ' + locallogdir + '; mkdir -p ' +  locallogdir  )
+
+paramiko_logfile = os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/log/paramiko.log')
+res=os.system(' echo > ' + paramiko_logfile)
+paramiko.util.log_to_file(paramiko_logfile)
+
+#pw=getpass.getpass()
 
 #Now we parse the xml file for basic configuration
 xmlTree = ET.parse(xmlInputFile)
@@ -973,51 +1317,61 @@ xmlRoot = xmlTree.getroot()
 
 
 
-
-MachineList = xmlRoot.findtext('MachineList',default='')
+if MachineList =='':
+   MachineList = xmlRoot.findtext('MachineList',default='')
 NFSResultsShare = xmlRoot.findtext('NFSResultsShare',default='')
 GitOpenaircnRepo = xmlRoot.findtext('GitOpenair-cnRepo',default='')
-GitOAI5GRepo = xmlRoot.findtext('GitOAI5GRepo',default='')
-GitOAI5GRepoBranch = xmlRoot.findtext('GitOAI5GRepoBranch',default='')
+
+if GitOAI5GRepo == '':
+   GitOAI5GRepo = xmlRoot.findtext('GitOAI5GRepo',default='')
+
+if GitOAI5GRepoBranch == '':
+   GitOAI5GRepoBranch = xmlRoot.findtext('GitOAI5GRepoBranch',default='')
+
 GitOpenaircnRepoBranch = xmlRoot.findtext('GitOpenair-cnRepoBranch',default='')
 CleanUpOldProgs = xmlRoot.findtext('CleanUpOldProgs',default='')
 CleanUpAluLteBox = xmlRoot.findtext('CleanUpAluLteBox',default='')
 Timeout_execution = int (xmlRoot.findtext('Timeout_execution'))
-MachineListGeneric = xmlRoot.findtext('MachineListGeneric',default='')
+if MachineListGeneric == '':
+   MachineListGeneric = xmlRoot.findtext('MachineListGeneric',default='')
 TestCaseExclusionList = xmlRoot.findtext('TestCaseExclusionList',default='')
+ExmimoRfStop = xmlRoot.findtext('ExmimoRfStop',default='')
+if nruns_lte_softmodem == '':
+   nruns_lte_softmodem = xmlRoot.findtext('nruns_lte-softmodem',default='')
+
 print "MachineList = " + MachineList
 print "GitOpenair-cnRepo = " + GitOpenaircnRepo
 print "GitOAI5GRepo = " + GitOAI5GRepo
 print "GitOAI5GBranch = " + GitOAI5GRepoBranch
 print "GitOpenaircnRepoBranch = " + GitOpenaircnRepoBranch
 print "NFSResultsShare = " + NFSResultsShare
-cmd = "git show-ref --heads -s "+ GitOAI5GRepoBranch
-GitOAI5GHeadVersion = subprocess.check_output ([cmd], shell=True)
+print "nruns_lte_softmodem = " + nruns_lte_softmodem
+print "Timeout_cmd = " + Timeout_cmd
+
+if GitOAI5GHeadVersion == '':
+  cmd = "git show-ref --heads -s "+ GitOAI5GRepoBranch
+  GitOAI5GHeadVersion = subprocess.check_output ([cmd], shell=True)
+  GitOAI5GHeadVersion=GitOAI5GHeadVersion.replace("\n","")
+
 print "GitOAI5GHeadVersion = " + GitOAI5GHeadVersion
 print "CleanUpOldProgs = " + CleanUpOldProgs
 print "Timeout_execution = " + str(Timeout_execution)
 
-MachineList = MachineList.split()
-MachineListGeneric = MachineListGeneric.split()
-
-index=0
-for machine in MachineList: 
-  oai_list[index] = openair('localdomain',machine)
-  index = index + 1
-
-
-#myThread (1,"sddsf", 1)
-
-
-#thread1 = oaiThread1(1, "Thread-1", 1)
-#def __init__(self, threadID, name, counter, oai, cmd, sudo, timeout):
-
-#sys.exit()
-
+if GitOAI5GHeadVersion == '':
+  print "Error getting the OAI5GBranch Head version...Exiting"
+  sys.exit()
 
+NFSTestsResultsDir = NFSResultsShare + '/'+ GitOAI5GRepoBranch + '/' + GitOAI5GHeadVersion
 
+print "NFSTestsResultsDir = " + NFSTestsResultsDir
 
+MachineList = MachineList.split()
+MachineListGeneric = MachineListGeneric.split()
 
+#index=0
+for machine in MachineList: 
+  oai_list.append( openair('localdomain',machine))
+  #index = index + 1
 
 
 print "\nTesting the sanity of machines used for testing..."
@@ -1036,33 +1390,24 @@ if localshell == 0:
               #print "password: " + pw 
            # issues in ubuntu 12.04
            oai_list[index].connect(user,pw)
-           #print "result = " + result
-           
-
-           #print '\nCleaning Older running programs : ' + CleanUpOldProgs
-           #cleanOldPrograms(oai_list[index], CleanUpOldProgs)
-
-
-
            print '\nChecking for sudo permissions on machine <'+machine+'>...'
            result = oai_list[index].send_expect_false('sudo -S -v','may not run sudo',True)
            print "Sudo permissions..." + result
            
            print '\nCleaning Older running programs : ' + CleanUpOldProgs
-           cleanOldPrograms(oai_list[index], CleanUpOldProgs, CleanUpAluLteBox)
+           cleanOldPrograms(oai_list[index], CleanUpOldProgs, CleanUpAluLteBox, ExmimoRfStop, '$HOME', '/tmp')
 
-           result = oai_list[index].send('mount ' + NFSResultsDir, True)
-           print "Mounting NFS Share " + NFSResultsDir + "..." + result
+           #result = oai_list[index].send('mount ' + NFSResultsDir, True)
+           #print "Mounting NFS Share " + NFSResultsDir + "..." + result
 
            # Check if NFS share is mounted correctly.
-           print 'Checking if NFS Share<' + NFSResultsDir + '> is mounted correctly...'
-           #result = oai_list[index].send_expect('mount | grep ' + NFSResultsDir,  NFSResultsDir )
-           cmd = 'if grep -qs '+NFSResultsDir+ ' /proc/mounts; then  echo \'' + NFSResultsDir  + ' is mounted\' ; fi'
-           search_expr = NFSResultsDir + ' is mounted'
-           print "cmd = " + cmd
-           print "search_expr = " + search_expr
-           result = oai_list[index].send_expect(cmd, search_expr)
-           print "Mount NFS_Results_Dir..." + result
+           #print 'Checking if NFS Share<' + NFSResultsDir + '> is mounted correctly...'
+           #cmd = 'if grep -qs '+NFSResultsDir+ ' /proc/mounts; then  echo \'' + NFSResultsDir  + ' is mounted\' ; fi'
+           #search_expr = NFSResultsDir + ' is mounted'
+           #print "cmd = " + cmd
+           #print "search_expr = " + search_expr
+           #result = oai_list[index].send_expect(cmd, search_expr)
+           #print "Mount NFS_Results_Dir..." + result
            index = index + 1
            
            #oai.connect2(user,pw) 
@@ -1074,94 +1419,76 @@ else:
     pw = ''
     oai_list[0].connect_localshell()
 
-
-
-
-
-cpu_freq = int(oai_list[0].cpu_freq())
-if timeout == 2000 : 
-    if cpu_freq <= 2000 : 
-        timeout = 3000
-    elif cpu_freq < 2700 :
-        timeout = 2000 
-    elif cpu_freq < 3300 :
-        timeout = 1500
-print "cpu freq(MHz): " + str(cpu_freq) + "timeout(s): " + str(timeout)
-
-# The log files are stored in branch/version/
-
-
-
-#result = oai_list[0].send('uname -a ' )
-#print result
-
 #We now prepare the machines for testing
-#index=0
+index=0
 threads_init_setup=[]
-for index in oai_list:
+for oai in oai_list:
   try:
       print "setting up machine: " + MachineList[index]
       #print oai_list[oai].send_recv('echo \''+pw+'\' |sudo -S -v')
       #print oai_list[oai].send_recv('sudo su')
       #print oai_list[oai].send_recv('who am i') 
       #cleanUpPrograms(oai_list[oai]
-      cmd =  'mkdir -p ' + logdir + ' ; rm -fr ' + logdir + '/*'
-      result = oai_list[index].send_recv(cmd)
+      cmd = 'sudo -S -E rm -fr ' + logdir + ' ; mkdir -p ' + logdir 
+      result = oai.send_recv(cmd)
      
       setuplogfile  = logdir  + '/setup_log_' + MachineList[index] + '_.txt'
       setup_script  = locallogdir  + '/setup_script_' + MachineList[index] +  '_.txt'
+
+      #Sometimes git fails so the script below retries in that case
+      localfile = os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/tools/git-retry.sh')
+      remotefile = logdir + '/git-retry.sh'
+      paramList=[]
+      port=22
+      paramList.append ( {"operation":'put', "localfile":localfile, "remotefile":remotefile} )
+      sftp_log = os.path.expandvars(locallogdir + '/sftp_module.log')
+      sftp_module (user, pw, MachineList[index], port, paramList, sftp_log)
+
+
       cmd = ' ( \n'
       #cmd = cmd  + 'rm -fR ' +  logdir + '\n'
       #cmd = cmd + 'mkdir -p ' + logdir + '\n'
       cmd = cmd + 'cd '+ logdir   + '\n'
-      cmd = cmd + 'git clone '+ GitOAI5GRepo  + '\n'
-      cmd = cmd + 'git clone '+ GitOpenaircnRepo   + '\n'
+      cmd = cmd + 'sudo apt-get install -y git \n'
+      cmd = cmd + 'chmod 700 ' + logdir + '/git-retry.sh \n' 
+      cmd = cmd + logdir + '/git-retry.sh clone  '+ GitOAI5GRepo  +' \n'
+      cmd = cmd + logdir + '/git-retry.sh clone '+ GitOpenaircnRepo + ' \n'
       cmd = cmd +  'cd ' + logdirOAI5GRepo  + '\n'
-      cmd = cmd + 'git checkout ' + GitOAI5GHeadVersion   + '\n'
+      cmd = cmd + 'git checkout ' + GitOAI5GRepoBranch   + '\n'                      
+      #cmd = cmd + 'git checkout ' + GitOAI5GHeadVersion   + '\n'
+      cmd = cmd + 'git_head=`git ls-remote |grep \'' + GitOAI5GRepoBranch + '\'` \n'
+      cmd = cmd + 'git_head=($git_head) \n'
+      cmd = cmd + 'git_head=${git_head[0]} \n'
+      cmd = cmd + 'echo \"GitOAI5GHeadVersion_remote = $git_head\" \n'
+      cmd = cmd + 'echo \"GitOAI5GHeadVersion_local = ' + GitOAI5GHeadVersion + '\" \n'
+      if flag_skip_git_head_check==True:
+         cmd = cmd + 'echo \"skipping GitHead check...\" \n '
+      else:
+         cmd = cmd + 'if [ \"$git_head\" != \"'+ GitOAI5GHeadVersion + '\" ]; then echo \"error: Git openairinterface5g head version does not match\" ; fi \n'
       cmd = cmd + 'source oaienv'   + '\n'
+      if flag_skip_oai_install == False:
+         cmd = cmd + 'source $OPENAIR_DIR/cmake_targets/tools/build_helper \n'
+         cmd = cmd + 'echo \"Installing core OAI dependencies...Start\" \n'
+         cmd = cmd + '$OPENAIR_DIR/cmake_targets/build_oai -I --install-optional-packages \n'
+         cmd = cmd + 'echo \"Installing core OAI dependencies...Finished\" \n'
+         #cmd = cmd + 'echo \"Installing BLADERF OAI dependencies...Start\" \n'
+         #cmd = cmd + 'check_install_bladerf_driver \n'
+         #cmd = cmd + 'echo \"Installing BLADERF OAI dependencies...Finished\" \n'
+         #cmd = cmd + 'echo \"Installing USRP OAI dependencies...Start\" \n'
+         #cmd = cmd + 'check_install_usrp_uhd_driver \n'
+         #cmd = cmd + 'echo \"Installing USRP OAI dependencies...Finished\" \n'
       cmd = cmd +  'cd ' + logdirOpenaircnRepo  + '\n'
       cmd = cmd +  'git checkout ' + GitOpenaircnRepoBranch  + '\n'
       cmd = cmd +  'env |grep OPENAIR'  + '\n'
       cmd = cmd + ' cd ' + logdir   + '\n'
-      cmd = cmd + ' ) > ' +  setuplogfile + ' 2>&1   '
+      cmd = cmd + ' ) > ' +  setuplogfile + ' 2>&1 \n'
       #cmd = cmd + 'echo \' ' + cmd  + '\' > ' + setup_script + ' 2>&1 \n '
       #result = oai_list[index].send_recv(cmd, False, 300 )
       write_file(setup_script, cmd, mode="w")
-      tempThread = oaiThread(index, 'thread_setup_'+str(index)+'_' + MachineList[index] , MachineList[index] , user, pw, cmd, False, 300)
+      tempThread = oaiThread(index, 'thread_setup_'+str(index)+'_' + MachineList[index] , MachineList[index] , user, pw, cmd, False, 3000)
       threads_init_setup.append(tempThread )
       tempThread.start()
-
-      #localfile = locallogdir + '/setup_log_' + MachineList[index] + '_.txt'
-      #remotefile = logdir  + '/setup_log_' + MachineList[index] + '_.txt'
-
-      #sftp_log = os.path.expandvars(locallogdir + '/sftp_module.log')
-      #sftp_module (user, pw, MachineList[index], 22, localfile, remotefile, sftp_log, "get")
-
-
-      #Now we copy test_case_list.xml on the remote machines
-      #localfile = os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/test_case_list.xml')
-      #remotefile = logdirOAI5GRepo + '/cmake_targets/autotests/test_case_list.xml'
-
-      #sftp_log = os.path.expandvars(locallogdir + '/sftp_module.log')
-      #sftp_module (user, pw, MachineList[index], 22, localfile, remotefile, sftp_log, "put")
-
-
-      #print oai_list[index].send('rm -fR ' +  logdir)
-      #print oai_list[index].send('mkdir -p ' + logdir)
-      #print oai_list[index].send('cd '+ logdir)
-      #print oai_list[index].send('git clone '+ GitOAI5GRepo )
-      #print oai_list[index].send('git clone '+ GitOpenaircnRepo)
-      #print oai_list[index].send('cd ' + logdirOAI5GRepo)
-      #print oai_list[index].send('git checkout ' + GitOAI5GHeadVersion)
-      #print oai_list[index].send('source oaienv')
-      #print oai_list[index].send('cd ' + logdirOpenaircnRepo)
-      #print oai_list[index].send('git checkout ' + GitOpenaircnRepoBranch)
-      #print oai_list[index].send_recv('cd ' + logdirOAI5GRepo)
-      #print oai_list[index].send_recv('source oaienv')
-      #print oai_list[index].send_recv('env |grep OPENAIR')
-
-      #print '\nCleaning Older running programs : ' + CleanUpOldProgs
-      #cleanOldPrograms(oai_list[index], CleanUpOldProgs)
+      index = index + 1
   except Exception, e:
          print 'There is error in one of the commands to setup the machine '+ MachineList[index] 
          error=''
@@ -1191,8 +1518,10 @@ for t in threads_init_setup:
    paramList.append ( {"operation":'put', "localfile":localfile, "remotefile":remotefile} )
    sftp_log = os.path.expandvars(locallogdir + '/sftp_module.log')
    sftp_module (user, pw, MachineList[index], port, paramList, sftp_log)
-   index = index+1
-   
+
+   cmd =  '  cd ' + logdirOAI5GRepo + ' ; source oaienv ; env|grep OPENAIR \n'
+   res = oai_list[index].send_recv(cmd)
+   index  = index +1
    if os.path.exists(localfile) == 0:
       print "Setup log file <" + localfile + "> missing for machine <" + MachineList[index] + ">.  Please check the setup log files. Exiting now"
       sys.exit(1)
@@ -1200,12 +1529,16 @@ for t in threads_init_setup:
 #Now we process all the test cases
 #Now we check if there was error in setup files
 
-status, out = commands.getstatusoutput('grep ' +  ' -il \'error\' ' + locallogdir + '/setup*')
+status, out = commands.getstatusoutput('grep ' +  ' -il \'error\' ' + locallogdir + '/setup_log*')
 if (out != '') :
   print "There is error in setup of machines"
   print "status  = " + str(status) + "\n Check files for error = " + out
-  print sys.exit(1)
+  print "Exiting now..."
+  sys.exit(1)
 
+cleanOldProgramsAllMachines(oai_list, CleanUpOldProgs, CleanUpAluLteBox, ExmimoRfStop, '$HOME' , logdirOAI5GRepo)
+if cleanUpRemoteMachines == True:
+  sys.exit(0)
 
 threadListGlobal=[]
 testcaseList=xmlRoot.findall('testCase')
@@ -1229,11 +1562,28 @@ for testcase in testcaseList:
            print "eNBMachine : " + eNBMachine + "UEMachine : " + UEMachine + "EPCMachine : " + EPCMachine + "MachineList : " + ','.join(MachineList)
         print "testcasename = " + testcasename + " class = " + testcaseclass
         threadListGlobal = wait_testcaseclass_generic_threads(threadListGlobal, Timeout_execution)
-        handle_testcaseclass_softmodem (testcase, CleanUpOldProgs, logdirOAI5GRepo, logdirOpenaircnRepo, MachineList, pw, CleanUpAluLteBox )
+        #cleanOldProgramsAllMachines(oai_list, CleanUpOldProgs, CleanUpAluLteBox, ExmimoRfStop)
+        handle_testcaseclass_softmodem (testcase, CleanUpOldProgs, logdirOAI5GRepo, logdirOpenaircnRepo, MachineList, user, pw, CleanUpAluLteBox, ExmimoRfStop, nruns_lte_softmodem, Timeout_cmd )
+        
+        #The lines below are copied from below to trace the failure of some of the machines in test setup. These lines below need to be removed in long term
+        print "Creating xml file for overall results..."
+        cmd = "cat $OPENAIR_DIR/cmake_targets/autotests/log/*/*.xml > $OPENAIR_DIR/cmake_targets/autotests/log/results_autotests.xml "
+        res=os.system(cmd)
+        os.system('sync')
+        print "Now copying files to NFS Share"
+        oai_localhost = openair('localdomain','localhost')
+        oai_localhost.connect(user,pw)
+        cmd = ' mkdir -p ' + NFSTestsResultsDir
+        res = oai_localhost.send_recv(cmd)
+
+        print "Copying files from GilabCI Runner Machine : " + host + " .locallogdir = " + locallogdir + ", NFSTestsResultsDir = " + NFSTestsResultsDir
+        SSHSessionWrapper('localhost', user, None, pw , NFSTestsResultsDir , locallogdir, "put_all")
+        oai_localhost.disconnect()
+
       elif (testcaseclass == 'compilation'): 
-        threadListGlobal = handle_testcaseclass_generic (testcasename, threadListGlobal, CleanUpOldProgs, logdirOAI5GRepo, MachineListGeneric, pw, CleanUpAluLteBox,Timeout_execution)
+        threadListGlobal = handle_testcaseclass_generic (testcasename, threadListGlobal, CleanUpOldProgs, logdirOAI5GRepo, MachineListGeneric, user, pw, CleanUpAluLteBox,Timeout_execution, ExmimoRfStop)
       elif (testcaseclass == 'execution'): 
-        threadListGlobal = handle_testcaseclass_generic (testcasename, threadListGlobal, CleanUpOldProgs, logdirOAI5GRepo, MachineListGeneric, pw, CleanUpAluLteBox,Timeout_execution)
+        threadListGlobal = handle_testcaseclass_generic (testcasename, threadListGlobal, CleanUpOldProgs, logdirOAI5GRepo, MachineListGeneric, user, pw, CleanUpAluLteBox, Timeout_execution, ExmimoRfStop)
       else :
         print "Unknown test case class: " + testcaseclass
         sys.exit()
@@ -1248,66 +1598,28 @@ for testcase in testcaseList:
      #sys.exit(1)
 
 
-print "Exiting the test cases execution now..."
-
-for t in threadListGlobal:
-   t.join
+print "Exiting the test cases execution now. Waiting for existing threads to complete..."
 
-sys.exit()
+for param in threadListGlobal:
+   thread_id = param["thread_id"]
+   thread_id.join()
 
-   #+ "class = "+ classx
+print "Creating xml file for overall results..."
+cmd = "cat $OPENAIR_DIR/cmake_targets/autotests/log/*/*.xml > $OPENAIR_DIR/cmake_targets/autotests/log/results_autotests.xml "
+res=os.system(cmd)
 
+print "Now copying files to NFS Share"
+oai_localhost = openair('localdomain','localhost')
+oai_localhost.connect(user,pw)
+cmd = 'mkdir -p ' + NFSTestsResultsDir
+res = oai_localhost.send_recv(cmd)
 
+print "Copying files from GilabCI Runner Machine : " + host + " .locallogdir = " + locallogdir + ", NFSTestsResultsDir = " + NFSTestsResultsDir
+SSHSessionWrapper('localhost', user, None, pw , NFSTestsResultsDir , locallogdir, "put_all")
 
-      #index = index +1
+cmd = "cat " + NFSTestsResultsDir + "/log/*/*.xml > " + NFSTestsResultsDir + "/log/results_autotests.xml"
+res = oai_localhost.send_recv(cmd)
+ 
+oai_localhost.disconnect()
 
-test = 'test01'
-ctime=datetime.datetime.utcnow().strftime("%Y-%m-%d.%Hh%M")
-logfile = user+'.'+test+'.'+ctime+'.txt'  
-logdir = os.getcwd() + '/pre-ci-logs-'+host;
-oai.create_dir(logdir,debug)    
-print 'log dir: ' + logdir
-print 'log file: ' + logfile
-pwd = oai.send_recv('pwd') 
-print "pwd = " + pwd
-result = oai.send('echo linux | sudo -S ls -al;sleep 5')
-print "result =" + result
 sys.exit()
-
-#oai.send_nowait('mkdir -p -m 755' + logdir + ';')
-
-#print '=================start the ' + test + ' at ' + ctime + '=================\n'
-#print 'Results will be reported in log file : ' + logfile
-log.writefile(logfile,'====================start'+test+' at ' + ctime + '=======================\n')
-log.set_debug_level(debug)
-
-oai.kill(user, pw)   
-oai.rm_driver(oai,user,pw)
-
-# start te test cases 
-if is_compiled == 0 :
-    is_compiled=case01.execute(oai, user, pw, host,logfile,logdir,debug,timeout)
-    
-if is_compiled != 0 :
-    case02.execute(oai, user, pw, host, logfile,logdir,debug)
-    case03.execute(oai, user, pw, host, logfile,logdir,debug)
-    case04.execute(oai, user, pw, host, logfile,logdir,debug)
-    case05.execute(oai, user, pw, host, logfile,logdir,debug)
-else :
-    print 'Compilation error: skip test case 02,03,04,05'
-
-oai.kill(user, pw) 
-oai.rm_driver(oai,user,pw)
-
-# perform the stats
-log.statistics(logfile)
-
-
-oai.disconnect()
-
-ctime=datetime.datetime.utcnow().strftime("%Y-%m-%d_%Hh%M")
-log.writefile(logfile,'====================end the '+ test + ' at ' + ctime +'====================')
-print 'Test results can be found in : ' + logfile 
-#print '\nThis test took %f minutes\n' % math.ceil((time.time() - start_time)/60) 
-
-#print '\n=====================end the '+ test + ' at ' + ctime + '====================='
diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml
index bb3b19497a094f912b9ee5b15f492fc25cb7b0ad..98c7247e304204913b606b2650e3e86a53911713 100644
--- a/cmake_targets/autotests/test_case_list.xml
+++ b/cmake_targets/autotests/test_case_list.xml
@@ -1,16 +1,18 @@
- <testCaseList>
+<testCaseList>
 
-<MachineList>stevens calisson mozart nano amerique</MachineList>
- <NFSResultsShare>/mnt/sradio/TEST_RESULTS</NFSResultsShare>
+<MachineList>mozart hutch starsky stevens amerique calisson nano qseven</MachineList>
+ <NFSResultsShare>/mnt/sradio/TEST_RESULTS/</NFSResultsShare>
  <GitOAI5GRepo>https://gitlab.eurecom.fr/oai/openairinterface5g.git</GitOAI5GRepo>
  <GitOpenair-cnRepo>https://gitlab.eurecom.fr/oai/openair-cn.git</GitOpenair-cnRepo>
- <GitOAI5GRepoBranch>enhancement-60-exmimo-tdd</GitOAI5GRepoBranch>
- <GitOpenair-cnRepoBranch>feature-17-test_framework</GitOpenair-cnRepoBranch>
- <CleanUpOldProgs>oaisim* oaisim_nos1* lte-softmodem* lte-softmodem-nos1* mme_gw* run_epc* run_hss* iperf* hss hss_sim configure_cots_bandrich_ue* wvdial* run_exec_autotests* iperf</CleanUpOldProgs>	
- <CleanUpAluLteBox>/opt/ltebox/tools/stop_ltebox</CleanUpAluLteBox>
+ <GitOAI5GRepoBranch>develop</GitOAI5GRepoBranch>
+ <GitOpenair-cnRepoBranch>develop</GitOpenair-cnRepoBranch>
+ <CleanUpOldProgs>oaisim oaisim_nos1 lte-softmodem lte-softmodem-nos1 mme_gw run_epc auth_request run_hss oai_hss mme spgw hss hss_sim configure_cots* wvdial  iperf iperf_script iperf_script_phone ping tshark rrh_gw iperf3 iperf3_script iperf3_script_phone pppd starthss start_ltebox stop_ltebox configure_cots_sony_experia_m4_ue configure_cots_huaweiE398_ue configure_cots_bandrich_ue</CleanUpOldProgs>	
+ <CleanUpAluLteBox>sudo -S -E /opt/ltebox/tools/stop_ltebox</CleanUpAluLteBox>
+<ExmimoRfStop>exmimo_pci=`lspci -m | grep Xilinx`; if [ -n "$exmimo_pci" ] ; then $OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; fi; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py --reset-ue;  sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue; uname -a; sudo -E dmesg</ExmimoRfStop>
  <Timeout_execution>36000</Timeout_execution>
- <TestCaseExclusionList>015502 015505  015506 015507 015508 015508 015509 015510 015511 015600 015700 016102 016105</TestCaseExclusionList>
- <MachineListGeneric>calisson stevens mozart nano amerique</MachineListGeneric>
+ <TestCaseExclusionList>010141 0102+ 010304 010305 0104+ 015502 015505 015506 015507 015508 015509 015510 015511 015514 015517 015602 015605 015702 015705 015802 015805 015808 015811 016102 016105 016502 016505 017002 017005 017502 017505 018002 018005 018502 018505 025502 025505 025508 025511</TestCaseExclusionList>
+ <nruns_lte-softmodem>3</nruns_lte-softmodem>
+ <MachineListGeneric>mozart hutch starsky stevens amerique calisson </MachineListGeneric>
      <testCase id="010101" >
      <class>compilation</class>
      <desc>Build oaisim.Rel8</desc>
@@ -21,7 +23,7 @@
                        $OPENAIR_DIR/cmake_targets/at_commands/build/at_nas_ue
                        $OPENAIR_DIR/cmake_targets/nas_sim_tools/build/usim
                        $OPENAIR_DIR/cmake_targets/nas_sim_tools/build/nvram</compile_prog_out>
-     <pre_exec></pre_exec>
+     <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
      <pre_exec_args></pre_exec_args>
      <main_exec></main_exec>
      <main_exec_args></main_exec_args>
@@ -41,7 +43,7 @@
                        $OPENAIR_DIR/cmake_targets/at_commands/build/at_nas_ue
                        $OPENAIR_DIR/cmake_targets/nas_sim_tools/build/usim
                        $OPENAIR_DIR/cmake_targets/nas_sim_tools/build/nvram</compile_prog_out>
-     <pre_exec></pre_exec>
+     <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
      <pre_exec_args></pre_exec_args>
      <main_exec></main_exec>
      <main_exec_args></main_exec_args>
@@ -61,7 +63,7 @@
                        $OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/rb_tool
                        $OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/CMakeFiles/nasmesh/nasmesh.ko
                        $OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/CMakeFiles/oai_nw_drv/oai_nw_drv.ko</compile_prog_out>
-     <pre_exec></pre_exec>
+     <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
      <pre_exec_args></pre_exec_args>
      <main_exec></main_exec>
      <main_exec_args></main_exec_args>
@@ -79,8 +81,9 @@
      <compile_prog_args>--eNB -w USRP -r Rel10 --noS1  -c </compile_prog_args>
      <compile_prog_out>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1
                        $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/rb_tool
-                       $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/CMakeFiles/nasmesh/nasmesh.ko</compile_prog_out>
-     <pre_exec></pre_exec>
+                       $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/CMakeFiles/nasmesh/nasmesh.ko
+                       $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/liboai_usrpdevif.so</compile_prog_out>
+     <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
      <pre_exec_args></pre_exec_args>
      <main_exec></main_exec>
      <main_exec_args></main_exec_args>
@@ -102,7 +105,7 @@
                        $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/CMakeFiles/openair_rf/openair_rf.ko
                        $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/updatefw
                        $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/oarf_config_exmimo.oct</compile_prog_out>
-     <pre_exec></pre_exec>
+     <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
      <pre_exec_args></pre_exec_args>
      <main_exec></main_exec>
      <main_exec_args></main_exec_args>
@@ -120,14 +123,15 @@
      <compile_prog_args>--eNB -w BLADERF -r Rel10 --noS1  -c </compile_prog_args>
      <compile_prog_out>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1
                        $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/rb_tool
-                       $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/CMakeFiles/nasmesh/nasmesh.ko</compile_prog_out>
-     <pre_exec></pre_exec>
+                       $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/CMakeFiles/nasmesh/nasmesh.ko
+                       $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/liboai_bladerfdevif.so</compile_prog_out>
+     <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
      <pre_exec_args></pre_exec_args>
      <main_exec></main_exec>
      <main_exec_args></main_exec_args>
      <search_expr_true></search_expr_true>
      <search_expr_false></search_expr_false>
-     <tags>lte-softmodem_noS1.EXMIMO.Rel10</tags>
+     <tags>lte-softmodem_noS1.BLADERF.Rel10</tags>
      <nruns>1</nruns>
      </testCase> 
 
@@ -136,11 +140,12 @@
      <desc>Build lte_softmodem_noS1.ETHERNET.Rel10</desc>
      <pre_compile_prog></pre_compile_prog>
      <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
-     <compile_prog_args>--eNB -w ETHERNET -r Rel10 --noS1  -c </compile_prog_args>
+     <compile_prog_args>--eNB -w None -t ETHERNET -r Rel10 --noS1  -c </compile_prog_args>
      <compile_prog_out>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1
                        $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/rb_tool
-                       $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/CMakeFiles/nasmesh/nasmesh.ko</compile_prog_out>
-     <pre_exec></pre_exec>
+                       $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/CMakeFiles/nasmesh/nasmesh.ko
+                       $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/liboai_eth_transpro.so</compile_prog_out>
+     <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
      <pre_exec_args></pre_exec_args>
      <main_exec></main_exec>
      <main_exec_args></main_exec_args>
@@ -150,6 +155,25 @@
      <nruns>1</nruns>
      </testCase> 
 
+     <testCase id="010114" >
+     <class>compilation</class>
+     <desc>Build lte_softmodem_noS1.LMSSDR.Rel10</desc>
+     <pre_compile_prog></pre_compile_prog>
+     <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
+     <compile_prog_args>--eNB -w LMSSDR -r Rel10 --noS1  -c </compile_prog_args>
+     <compile_prog_out>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1
+                       $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/rb_tool
+                       $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/CMakeFiles/nasmesh/nasmesh.ko
+                       $OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/liboai_lmssdrdevif.so</compile_prog_out>
+     <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
+     <pre_exec_args></pre_exec_args>
+     <main_exec></main_exec>
+     <main_exec_args></main_exec_args>
+     <search_expr_true></search_expr_true>
+     <search_expr_false></search_expr_false>
+     <tags>lte-softmodem_noS1.LMSSDR.Rel10</tags>
+     <nruns>1</nruns>
+     </testCase>
 
 
      <testCase id="010120" >
@@ -158,8 +182,9 @@
      <pre_compile_prog></pre_compile_prog>
      <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
      <compile_prog_args>--eNB -w USRP -r Rel10   -c </compile_prog_args>
-     <compile_prog_out>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</compile_prog_out>
-     <pre_exec></pre_exec>
+     <compile_prog_out>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+                       $OPENAIR_DIR/cmake_targets/lte_build_oai/build/liboai_usrpdevif.so</compile_prog_out>
+     <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
      <pre_exec_args></pre_exec_args>
      <main_exec></main_exec>
      <main_exec_args></main_exec_args>
@@ -179,7 +204,7 @@
                        $OPENAIR_DIR/cmake_targets/lte_build_oai/build/CMakeFiles/openair_rf/openair_rf.ko
                        $OPENAIR_DIR/cmake_targets/lte_build_oai/build/updatefw
                        $OPENAIR_DIR/cmake_targets/lte_build_oai/build/oarf_config_exmimo.oct</compile_prog_out>
-     <pre_exec></pre_exec>
+     <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
      <pre_exec_args></pre_exec_args>
      <main_exec></main_exec>
      <main_exec_args></main_exec_args>
@@ -195,8 +220,9 @@
      <pre_compile_prog></pre_compile_prog>
      <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
      <compile_prog_args>--eNB -w BLADERF -r Rel10   -c </compile_prog_args>
-     <compile_prog_out>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</compile_prog_out>
-     <pre_exec></pre_exec>
+     <compile_prog_out>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+                       $OPENAIR_DIR/cmake_targets/lte_build_oai/build/liboai_bladerfdevif.so</compile_prog_out>
+     <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
      <pre_exec_args></pre_exec_args>
      <main_exec></main_exec>
      <main_exec_args></main_exec_args>
@@ -211,9 +237,10 @@
      <desc>Build lte_softmodem.ETHERNET.Rel10</desc>
      <pre_compile_prog></pre_compile_prog>
      <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
-     <compile_prog_args>--eNB -w ETHERNET -r Rel10   -c </compile_prog_args>
-     <compile_prog_out>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</compile_prog_out>
-     <pre_exec></pre_exec>
+     <compile_prog_args>--eNB -w None -t ETHERNET -r Rel10   -c </compile_prog_args>
+     <compile_prog_out>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+                       $OPENAIR_DIR/cmake_targets/lte_build_oai/build/liboai_eth_transpro.so</compile_prog_out>
+     <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
      <pre_exec_args></pre_exec_args>
      <main_exec></main_exec>
      <main_exec_args></main_exec_args>
@@ -223,6 +250,24 @@
      <nruns>1</nruns>
      </testCase> 
 
+     <testCase id="010124" >
+     <class>compilation</class>
+     <desc>Build lte_softmodem.LMSSDR.Rel10</desc>
+     <pre_compile_prog></pre_compile_prog>
+     <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
+     <compile_prog_args>--eNB -w LMSSDR -r Rel10   -c </compile_prog_args>
+     <compile_prog_out>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+                       $OPENAIR_DIR/cmake_targets/lte_build_oai/build/liboai_lmssdrdevif.so</compile_prog_out>
+     <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
+     <pre_exec_args></pre_exec_args>
+     <main_exec></main_exec>
+     <main_exec_args></main_exec_args>
+     <search_expr_true></search_expr_true>
+     <search_expr_false></search_expr_false>
+     <tags>lte-softmodem.LMSSDR.Rel10</tags>
+     <nruns>1</nruns>
+     </testCase>
+
      <testCase id="010130" >
      <class>compilation</class>
      <desc>Build phy unitary simulators + secuirity unitary tests</desc>
@@ -246,7 +291,7 @@
                        $OPENAIR_DIR/cmake_targets/lte-simulators/build/test_kdf
                        $OPENAIR_DIR/cmake_targets/lte-simulators/build/test_aes128_cmac_encrypt
                        $OPENAIR_DIR/cmake_targets/lte-simulators/build/test_secu_knas_encrypt_eia2</compile_prog_out>
-     <pre_exec></pre_exec>
+     <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
      <pre_exec_args></pre_exec_args>
      <main_exec></main_exec>
      <main_exec_args></main_exec_args>
@@ -259,12 +304,14 @@
 
      <testCase id="010140" >
      <class>compilation</class>
-     <desc>Build RRH Gateway</desc>
+     <desc>Build RRH Gateway for USRP(RF) + Ethernet (Transport)</desc>
      <pre_compile_prog></pre_compile_prog>
      <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
-     <compile_prog_args>--RRH -w USRP  -c </compile_prog_args>
-     <compile_prog_out>$OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw</compile_prog_out>
-     <pre_exec></pre_exec>
+     <compile_prog_args>--RRH -w USRP -t ETHERNET  -c </compile_prog_args>
+     <compile_prog_out>$OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw
+                       $OPENAIR_DIR/cmake_targets/rrh_gw/build/liboai_usrpdevif.so
+                       $OPENAIR_DIR/cmake_targets/rrh_gw/build/liboai_eth_transpro.so</compile_prog_out>
+     <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
      <pre_exec_args></pre_exec_args>
      <main_exec></main_exec>
      <main_exec_args></main_exec_args>
@@ -276,15 +323,17 @@
 
      <testCase id="010141" >
      <class>compilation</class>
-     <desc>Build RRH Gateway</desc>
+     <desc>Build RRH Gateway for EXMIMO(RF) + Ethernet (Transport)</desc>
      <pre_compile_prog></pre_compile_prog>
      <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
-     <compile_prog_args>--RRH -w EXMIMO  -c </compile_prog_args>
+     <compile_prog_args>--RRH -w EXMIMO -t ETHNERNET  -c </compile_prog_args>
      <compile_prog_out>$OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw
                        $OPENAIR_DIR/cmake_targets/rrh_gw/build/CMakeFiles/openair_rf/openair_rf.ko
                        $OPENAIR_DIR/cmake_targets/rrh_gw/build/updatefw
-                       $OPENAIR_DIR/cmake_targets/rrh_gw/build/oarf_config_exmimo.oct</compile_prog_out>
-     <pre_exec></pre_exec>
+                       $OPENAIR_DIR/cmake_targets/rrh_gw/build/oarf_config_exmimo.oct
+                       $OPENAIR_DIR/cmake_targets/rrh_gw/build/liboai_exmimodevif.so
+                       $OPENAIR_DIR/cmake_targets/rrh_gw/build/liboai_eth_transpro.so</compile_prog_out>
+     <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
      <pre_exec_args></pre_exec_args>
      <main_exec></main_exec>
      <main_exec_args></main_exec_args>
@@ -296,12 +345,14 @@
 
      <testCase id="010142" >
      <class>compilation</class>
-     <desc>Build RRH Gateway</desc>
+     <desc>Build RRH Gateway for BladeRF (RF) nad Ethernet (transport)</desc>
      <pre_compile_prog></pre_compile_prog>
      <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
-     <compile_prog_args>--RRH -w BLADERF  -c </compile_prog_args>
-     <compile_prog_out>$OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw</compile_prog_out>
-     <pre_exec></pre_exec>
+     <compile_prog_args>--RRH -w BLADERF -t ETHERNET  -c </compile_prog_args>
+     <compile_prog_out>$OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw
+                       $OPENAIR_DIR/cmake_targets/rrh_gw/build/liboai_bladerfdevif.so
+                       $OPENAIR_DIR/cmake_targets/rrh_gw/build/liboai_eth_transpro.so</compile_prog_out>
+     <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
      <pre_exec_args></pre_exec_args>
      <main_exec></main_exec>
      <main_exec_args></main_exec_args>
@@ -311,22 +362,41 @@
      <nruns>1</nruns>
      </testCase>
 
+    <testCase id="010143" >
+     <class>compilation</class>
+     <desc>Build RRH Gateway for LMSSDR (RF) and Ethernet (transport)</desc>
+     <pre_compile_prog></pre_compile_prog>
+     <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
+     <compile_prog_args>--RRH -w LMSSDR -t ETHERNET  -c </compile_prog_args>
+     <compile_prog_out>$OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw
+                       $OPENAIR_DIR/cmake_targets/rrh_gw/build/liboai_lmssdrdevif.so
+                       $OPENAIR_DIR/cmake_targets/rrh_gw/build/liboai_eth_transpro.so</compile_prog_out>
+     <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
+     <pre_exec_args></pre_exec_args>
+     <main_exec></main_exec>
+     <main_exec_args></main_exec_args>
+     <search_expr_true></search_expr_true>
+     <search_expr_false></search_expr_false>
+     <tags>RRH.LMSSDR.Rel10</tags>
+     <nruns>1</nruns>
+     </testCase>
 
    <testCase id="010200">
       <class>execution</class>
       <desc>Run OAISIM Rel10 TDD, 1 eNB + 1 UE (5 MHz/10MHz/20MHz), (TM 1,2) and search for errors, segmentation fault or exit</desc>
-      <pre_compile_prog></pre_compile_prog>
+      <pre_compile_prog>cp -vf $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.generic.oaisim.local_no_mme.conf $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf </pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args>--oaisim --noS1  -c </compile_prog_args>
-      <pre_exec>$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
       <pre_exec_args></pre_exec_args>
+      <test_config_file></test_config_file>
       <main_exec>$OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1</main_exec>
-      <main_exec_args> -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 1
-                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 50 -x 1
-                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 100 -x 1
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 2
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 50  -x 2
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 100  -x 2 </main_exec_args>
+      <main_exec_args> -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 1 -s15
+                       -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 50 -x 1 -s15 
+                       -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 100 -x 1 -s15 
+                      -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 2 -s15 
+                      -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 50  -x 2 -s15 
+                      -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 100  -x 2 -s15 </main_exec_args>
       <tags>oaisim_noS1.tdd.5MHz.TM1 oaisim_noS1.tdd.10MHz.TM1 oaisim_noS1.tdd.20MHz.TM1 oaisim_noS1.tdd.5MHz.TM2 oaisim_noS1.tdd.10MHz.TM2 oaisim_noS1.tdd.20MHz.TM2</tags>
       <search_expr_true>"Received RRCConnectionReconfigurationComplete from UE 0"</search_expr_true>
       <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
@@ -336,18 +406,19 @@
     <testCase id="010201">
       <class>execution</class>
       <desc>Run OAISIM Rel10 TDD, 1 eNB + 1 UE (5 MHz/10MHz/20MHz), (TM 1,2) in PHY_ABSTRACTION mode and search for errors, segmentation fault or exit</desc>
-      <pre_compile_prog></pre_compile_prog>
+      <pre_compile_prog>cp -vf $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.generic.oaisim.local_no_mme.conf $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf </pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args>--oaisim --noS1  -c </compile_prog_args>
-      <pre_exec>$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
+      <test_config_file></test_config_file>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
       <pre_exec_args></pre_exec_args>
       <main_exec>$OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1</main_exec>
-      <main_exec_args> -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 1 -a
-                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 50 -x 1 -a 
-                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 100 -x 1 -a 
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 2 -a 
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 50  -x 2 -a 
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 100  -x 2 -a </main_exec_args>
+      <main_exec_args> -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 1 -a -s15
+                       -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 50 -x 1 -a -s15 
+                       -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 100 -x 1 -a -s15 
+                      -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 2 -a -s15 
+                      -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 50  -x 2 -a -s15
+                      -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 100  -x 2 -a -s15 </main_exec_args>
       <tags>oaisim_noS1.tdd.5MHz.TM1 oaisim_noS1.tdd.10MHz.TM1 oaisim_noS1.tdd.20MHz.TM1 oaisim_noS1.tdd.5MHz.TM2 oaisim_noS1.tdd.10MHz.TM2 oaisim_noS1.tdd.20MHz.TM2</tags>
       <search_expr_true>"Received RRCConnectionReconfigurationComplete from UE 0"</search_expr_true>
       <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
@@ -357,18 +428,19 @@
     <testCase id="010202">
       <class>execution</class>
       <desc>Run OAISIM Rel10 TDD, 1 eNB + 3 UEs (5 MHz/10MHz/20MHz), (TM 1,2) and search for errors, segmentation fault or exit</desc>
-      <pre_compile_prog></pre_compile_prog>
+<pre_compile_prog>cp -vf $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.generic.oaisim.local_no_mme.conf $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf </pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args>--oaisim --noS1  -c </compile_prog_args>
-      <pre_exec>$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
+      <test_config_file></test_config_file>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
       <pre_exec_args></pre_exec_args>
       <main_exec>$OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1</main_exec>
-      <main_exec_args> -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 1
-                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 1
-                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 1
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 2
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50  -x 2
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100  -x 2</main_exec_args>
+      <main_exec_args> -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 1 -s15
+                       -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 1 -s15
+                       -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 1 -s15
+                      -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 2 -s15
+                      -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50  -x 2 -s15
+                      -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100  -x 2 -s15 </main_exec_args>
       <tags>oaisim_noS1.tdd.5MHz.TM1 oaisim_noS1.tdd.10MHz.TM1 oaisim_noS1.tdd.20MHz.TM1 oaisim_noS1.tdd.5MHz.TM2 oaisim_noS1.tdd.10MHz.TM2 oaisim_noS1.tdd.20MHz.TM2 </tags>
       <search_expr_true>"Received RRCConnectionReconfigurationComplete from UE 0" "Received RRCConnectionReconfigurationComplete from UE 1" "Received RRCConnectionReconfigurationComplete from UE 2"</search_expr_true>
       <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
@@ -378,18 +450,19 @@
     <testCase id="010203">
       <class>execution</class>
       <desc>Run OAISIM Rel10 TDD, 1 eNB + 3 UEs (5 MHz) in PHY_ABSTRACTION mode and search for errors, segmentation fault or exit</desc>
-      <pre_compile_prog></pre_compile_prog>
+      <pre_compile_prog>cp -vf $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.generic.oaisim.local_no_mme.conf $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf </pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args>--oaisim --noS1  -c </compile_prog_args>
-      <pre_exec>$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
+      <test_config_file></test_config_file>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
       <pre_exec_args></pre_exec_args>
       <main_exec>$OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1</main_exec>
-      <main_exec_args> -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 1 -a 
-                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 1 -a
-                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 1 -a
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 2 -a
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50  -x 2 -a
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100  -x 2 -a</main_exec_args>
+      <main_exec_args> -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 1 -a -s15
+                       -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 1 -a -s15
+                       -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 1 -a -s15
+                      -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 2 -a -s15
+                      -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50  -x 2 -a -s15
+                      -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100  -x 2 -a -s15</main_exec_args>
       <tags>oaisim_noS1.tdd.5MHz.TM1 oaisim_noS1.tdd.10MHz.TM1 oaisim_noS1.tdd.20MHz.TM1 oaisim_noS1.tdd.5MHz.TM2 oaisim_noS1.tdd.10MHz.TM2  oaisim_nos1.tdd.20MHz.TM2</tags>
       <search_expr_true>"Received RRCConnectionReconfigurationComplete from UE 0" "Received RRCConnectionReconfigurationComplete from UE 1" "Received RRCConnectionReconfigurationComplete from UE 2"</search_expr_true>
       <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
@@ -399,18 +472,19 @@
     <testCase id="010204">
       <class>execution</class>
       <desc>Run OAI Rel10 TDD, 1 eNB + 1 UE (5 MHz) without abstraction mode, send ping from from eNB to UE, and check that there is no packet losses</desc>
-      <pre_compile_prog></pre_compile_prog>
+       <pre_compile_prog>cp -vf $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.generic.oaisim.local_no_mme.conf $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf </pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args>--oaisim --noS1  -c </compile_prog_args>
-      <pre_exec>$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
       <pre_exec_args></pre_exec_args>
+      <test_config_file></test_config_file>
       <main_exec>$OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1</main_exec>
-      <main_exec_args> -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 1 -c26 
-                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 1 -c26 
-                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 1 -c26 
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 2 -c26 
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50  -x 2 -c26 
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100  -x 2 -c26</main_exec_args>
+      <main_exec_args> -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 1 -c26 
+                       -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 1 -c26 
+                       -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 1 -c26 
+                      -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 2 -c26 
+                      -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50  -x 2 -c26 
+                      -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100  -x 2 -c26</main_exec_args>
       <tags>oaisim_noS1.tdd.5MHz.TM1 oaisim_noS1.tdd.10MHz.TM1 oaisim_noS1.tdd.20MHz.TM1 oaisim_noS1.tdd.5MHz.TM2 oaisim_noS1.tdd.10MHz.TM2 oaisim_noS1.tdd.20MHz.TM2 </tags>
       <search_expr_true>"DL and UL loss rate below 10"</search_expr_true>
       <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
@@ -420,18 +494,19 @@
     <testCase id="010205">
       <class>execution</class>
       <desc>Run OAI Rel10 TDD, 1 eNB + 1 UE (5 MHz) in PHY_ABSTRACTION  mode, send ping from from eNB to  UE, and check that there is no packet losses</desc>
-      <pre_compile_prog></pre_compile_prog>
+      <pre_compile_prog>cp -vf $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.generic.oaisim.local_no_mme.conf $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf </pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args>--oaisim --noS1  -c </compile_prog_args>
-      <pre_exec>$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
       <pre_exec_args></pre_exec_args>
+      <test_config_file></test_config_file>
       <main_exec>$OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1</main_exec>
-      <main_exec_args> -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 1 -c26 -a
-                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 1 -c26  -a
-                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 1 -c26 -a
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 2 -c26  -a
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50  -x 2 -c26 -a
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100  -x 2 -c26  -a</main_exec_args>
+      <main_exec_args> -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 1 -c26 -a
+                       -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 1 -c26  -a
+                       -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 1 -c26 -a
+                      -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 2 -c26  -a
+                      -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50  -x 2 -c26 -a
+                      -O $OPENAIR_LOGDIR/enb.band38.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100  -x 2 -c26  -a</main_exec_args>
       <tags>oaisim_noS1.tdd.5MHz.TM1 oaisim_noS1.tdd.10MHz.TM1 oaisim_noS1.tdd.20MHz.TM1 oaisim_noS1.tdd.5MHz.TM2 oaisim_noS1.tdd.10MHz.TM2 oaisim_noS1.tdd.20MHz.TM2 </tags>
       <search_expr_true>"DL and UL loss rate below 10"</search_expr_true>
       <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
@@ -444,15 +519,15 @@
       <pre_compile_prog></pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args>--oaisim --noS1  -c </compile_prog_args>
-      <pre_exec>$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
       <pre_exec_args></pre_exec_args>
       <main_exec>$OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1</main_exec>
-      <main_exec_args> -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 1 -F
-                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 50 -x 1 -F
-                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 100 -x 1 -F
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 2 -F
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 50  -x 2 -F
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 100  -x 2 -F</main_exec_args>
+      <main_exec_args> -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 1 -F -s15
+                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 50 -x 1 -F -s15
+                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 100 -x 1 -F -s15
+                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 2 -F -s15
+                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 50  -x 2 -F -s15
+                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 100  -x 2 -F -s15</main_exec_args>
       <tags>oaisim_noS1.FDD.5MHz.TM1 oaisim_noS1.FDD.10MHz.TM1 oaisim_noS1.FDD.20MHz.TM1 oaisim_noS1.FDD.5MHz.TM2 oaisim_noS1.FDD.10MHz.TM2 oaisim_noS1.FDD.20MHz.TM2</tags>
       <search_expr_true>"Received RRCConnectionReconfigurationComplete from UE 0"</search_expr_true>
       <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
@@ -465,15 +540,15 @@
       <pre_compile_prog></pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args>--oaisim --noS1  -c </compile_prog_args>
-      <pre_exec>$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
       <pre_exec_args></pre_exec_args>
       <main_exec>$OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1</main_exec>
-      <main_exec_args> -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 1 -F -a
-                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 50 -x 1 -F -a
-                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 100 -x 1 -F -a
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 2 -F -a
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 50  -x 2 -F -a
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 100  -x 2 -F -a</main_exec_args>
+      <main_exec_args> -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 1 -F -a -s15
+                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 50 -x 1 -F -a -s15
+                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 100 -x 1 -F -a -s15
+                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 2 -F -a -s15
+                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 50  -x 2 -F -a -s15
+                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 100  -x 2 -F -a -s15</main_exec_args>
       <tags>oaisim_noS1.FDD.5MHz.TM1 oaisim_noS1.FDD.10MHz.TM1 oaisim_noS1.FDD.20MHz.TM1 oaisim_noS1.FDD.5MHz.TM2 oaisim_noS1.FDD.10MHz.TM2 oaisim_noS1.FDD.20MHz.TM2</tags> 
       <search_expr_true>"Received RRCConnectionReconfigurationComplete from UE 0"</search_expr_true>
       <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
@@ -486,15 +561,15 @@
       <pre_compile_prog></pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args>--oaisim --noS1  -c </compile_prog_args>
-      <pre_exec>$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
       <pre_exec_args></pre_exec_args>
       <main_exec>$OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1</main_exec>
-      <main_exec_args> -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 1 -F
-                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 1 -F
-                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 1 -F
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 2 -F
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50  -x 2 -F
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100  -x 2 -F </main_exec_args>
+      <main_exec_args> -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 1 -F -s15
+                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 1 -F -s15
+                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 1 -F -s15
+                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 2 -F -s15
+                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50  -x 2 -F -s15
+                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100  -x 2 -F -s15</main_exec_args>
       <tags>oaisim_noS1.FDD.5MHz.TM1 oaisim_noS1.FDD.10MHz.TM1 oaisim_noS1.FDD.20MHz.TM1 oaisim_noS1.FDD.5MHz.TM2 oaisim_noS1.FDD.10MHz.TM2 oaisim_noS1.FDD.20MHz.TM2 </tags> 
       <search_expr_true>"Received RRCConnectionReconfigurationComplete from UE 0" "Received RRCConnectionReconfigurationComplete from UE 1" "Received RRCConnectionReconfigurationComplete from UE 2"</search_expr_true>
       <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
@@ -507,15 +582,15 @@
       <pre_compile_prog></pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args>--oaisim --noS1  -c </compile_prog_args>
-      <pre_exec>$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
       <pre_exec_args></pre_exec_args>
       <main_exec>$OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1</main_exec>
-      <main_exec_args> -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 1 -F -a
-                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 1 -F -a
-                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 1 -F -a
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 2 -F -a
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50  -x 2 -F -a
-                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100  -x 2 -F -a</main_exec_args>
+      <main_exec_args> -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 1 -F -a -s15
+                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50 -x 1 -F -a -s15
+                       -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100 -x 1 -F -a -s15
+                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 25 -x 2 -F -a -s15
+                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 50  -x 2 -F -a -s15
+                      -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u3 -n100 -R 100  -x 2 -F -a -s15</main_exec_args>
       <tags>oaisim_noS1.FDD.5MHz.TM1 oaisim_noS1.FDD.10MHz.TM1 oaisim_noS1.FDD.20MHz.TM1 oaisim_noS1.FDD.5MHz.TM2 oaisim_noS1.FDD.10MHz.TM2 oaisim_noS1.FDD.20MHz.TM2</tags>
       <search_expr_true>"Received RRCConnectionReconfigurationComplete from UE 0" "Received RRCConnectionReconfigurationComplete from UE 1" "Received RRCConnectionReconfigurationComplete from UE 2"</search_expr_true>
       <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
@@ -528,7 +603,7 @@
       <pre_compile_prog></pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args>--oaisim --noS1  -c </compile_prog_args>
-      <pre_exec>$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
       <pre_exec_args></pre_exec_args>
       <main_exec>$OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1</main_exec>
       <main_exec_args> -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 1 -F -c26
@@ -549,7 +624,7 @@
       <pre_compile_prog></pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args>--oaisim --noS1  -c </compile_prog_args>
-      <pre_exec>$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
       <pre_exec_args></pre_exec_args>
       <main_exec>$OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1</main_exec>
       <main_exec_args> -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -b1 -u1 -n100 -R 25 -x 1 -F -c26 -a
@@ -570,7 +645,7 @@
       <pre_compile_prog></pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args>--oaisim --noS1  -c </compile_prog_args>
-      <pre_exec>$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
       <pre_exec_args></pre_exec_args>
       <main_exec>$OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1</main_exec>
       <main_exec_args> -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -l7 -x 1 -Q3 -n 100 -b1 -u1</main_exec_args>
@@ -586,7 +661,7 @@
       <pre_compile_prog></pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args>--oaisim --noS1  -c </compile_prog_args>
-      <pre_exec>$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
       <pre_exec_args></pre_exec_args>
       <main_exec>$OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1</main_exec>
       <main_exec_args> -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -l7 -x 1 -T mscbr -Q3 -n 100 -b1 -u1</main_exec_args>
@@ -602,7 +677,7 @@
       <pre_compile_prog></pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args>--oaisim --noS1  -c </compile_prog_args>
-      <pre_exec>$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
       <pre_exec_args></pre_exec_args>
       <main_exec>$OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1</main_exec>
       <main_exec_args> -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -l7 -F -T mscbr -x 1 -Q3 -n 100 -b1 -u1</main_exec_args>
@@ -618,7 +693,7 @@
       <pre_compile_prog></pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args>--oaisim --noS1  -c </compile_prog_args>
-      <pre_exec>$OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1</pre_exec>
       <pre_exec_args></pre_exec_args>
       <main_exec>$OPENAIR_DIR/cmake_targets/oaisim_noS1_build_oai/build/oaisim_nos1</main_exec>
       <main_exec_args> -O $OPENAIR_TARGETS/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf -A AWGN -l7 -c43 -F -T mbvbr -Q4 -j1 -n120</main_exec_args>
@@ -634,7 +709,7 @@
       <pre_compile_prog></pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args> --core_simulators  -c </compile_prog_args>
-      <pre_exec></pre_exec>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
       <pre_exec_args></pre_exec_args>
       <main_exec>$OPENAIR_DIR/cmake_targets/lte-simulators/build/test_aes128_cmac_encrypt</main_exec>
       <main_exec_args> --verbose</main_exec_args>
@@ -650,7 +725,7 @@
       <pre_compile_prog></pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args> --core_simulators  -c </compile_prog_args>
-      <pre_exec></pre_exec>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
       <pre_exec_args></pre_exec_args>
       <main_exec>$OPENAIR_DIR/cmake_targets/lte-simulators/build/test_aes128_ctr_decrypt</main_exec>
       <main_exec_args> --verbose</main_exec_args>
@@ -666,7 +741,7 @@
       <pre_compile_prog></pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args> --core_simulators  -c </compile_prog_args>
-      <pre_exec></pre_exec>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
       <pre_exec_args></pre_exec_args>
       <main_exec>$OPENAIR_DIR/cmake_targets/lte-simulators/build/test_aes128_ctr_encrypt</main_exec>
       <main_exec_args> --verbose</main_exec_args>
@@ -682,7 +757,7 @@
       <pre_compile_prog></pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args> --core_simulators  -c </compile_prog_args>
-      <pre_exec></pre_exec>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
       <pre_exec_args></pre_exec_args>
       <main_exec>$OPENAIR_DIR/cmake_targets/lte-simulators/build/test_secu_kenb</main_exec>
       <main_exec_args> --verbose</main_exec_args>
@@ -698,7 +773,7 @@
       <pre_compile_prog></pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args> --core_simulators  -c </compile_prog_args>
-      <pre_exec></pre_exec>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
       <pre_exec_args></pre_exec_args>
       <main_exec>$OPENAIR_DIR/cmake_targets/lte-simulators/build/test_secu_knas</main_exec>
       <main_exec_args> --verbose</main_exec_args>
@@ -714,7 +789,7 @@
       <pre_compile_prog></pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args> --core_simulators  -c </compile_prog_args>
-      <pre_exec></pre_exec>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
       <pre_exec_args></pre_exec_args>
       <main_exec>$OPENAIR_DIR/cmake_targets/lte-simulators/build/test_secu_knas_encrypt_eea1</main_exec>
       <main_exec_args> --verbose</main_exec_args>
@@ -730,7 +805,7 @@
       <pre_compile_prog></pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args> --core_simulators  -c </compile_prog_args>
-      <pre_exec></pre_exec>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
       <pre_exec_args></pre_exec_args>
       <main_exec>$OPENAIR_DIR/cmake_targets/lte-simulators/build/test_secu_knas_encrypt_eea2</main_exec>
       <main_exec_args> --verbose</main_exec_args>
@@ -746,7 +821,7 @@
       <pre_compile_prog></pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args> --core_simulators  -c </compile_prog_args>
-      <pre_exec></pre_exec>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
       <pre_exec_args></pre_exec_args>
       <main_exec>$OPENAIR_DIR/cmake_targets/lte-simulators/build/test_secu_knas_encrypt_eia1</main_exec>
       <main_exec_args> --verbose</main_exec_args>
@@ -762,7 +837,7 @@
       <pre_compile_prog></pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args> --core_simulators  -c </compile_prog_args>
-      <pre_exec></pre_exec>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
       <pre_exec_args></pre_exec_args>
       <main_exec>$OPENAIR_DIR/cmake_targets/lte-simulators/build/test_secu_knas_encrypt_eia1</main_exec>
       <main_exec_args> --verbose</main_exec_args>
@@ -778,7 +853,7 @@
       <pre_compile_prog></pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args> --core_simulators  -c </compile_prog_args>
-      <pre_exec></pre_exec>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
       <pre_exec_args></pre_exec_args>
       <main_exec>$OPENAIR_DIR/cmake_targets/lte-simulators/build/test_kdf</main_exec>
       <main_exec_args> --verbose</main_exec_args>
@@ -805,7 +880,7 @@
       <pre_compile_prog></pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args> --phy_simulators  -c </compile_prog_args>
-      <pre_exec></pre_exec>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
       <pre_exec_args></pre_exec_args>
       <main_exec>$OPENAIR_DIR/cmake_targets/lte-simulators/build/dlsim</main_exec>
       <main_exec_args> -m5 -gF -s-1 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70 -L
@@ -836,7 +911,7 @@
       <pre_compile_prog></pre_compile_prog>
       <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
       <compile_prog_args> --phy_simulators  -c </compile_prog_args>
-      <pre_exec></pre_exec>
+      <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
       <pre_exec_args></pre_exec_args>
       <main_exec>$OPENAIR_DIR/cmake_targets/lte-simulators/build/ulsim</main_exec>
       <main_exec_args> -B25 -m5 -y1 -gN -x1 -s6 -w1.0 -e.1 -P -n500 -O70 -L
@@ -854,2098 +929,6971 @@
   <testCase id="015500" >
     <class>lte-softmodem</class>
     <desc></desc>
-    <eNB>calisson</eNB>
+    <eNB>hutch</eNB>
     <UE>stevens</UE>
     <EPC>amerique</EPC>
-    <TimeOut_cmd>180</TimeOut_cmd>
-    <eNB_working_dir>/tmp</eNB_working_dir>
-    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  N_RB_DL 25
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  downlink_frequency 2660000000L
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  uplink_frequency_offset -120000000
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  tx_gain 90
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  rx_gain 120
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  frame_type \"FDD\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  nb_antennas_rx  1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  nb_antennas_tx 1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
     <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
     <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
-    <eNB_pre_exec></eNB_pre_exec>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
     <eNB_pre_exec_args></eNB_pre_exec_args>
-    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
-    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  </eNB_main_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
     <eNB_traffic_exec></eNB_traffic_exec>
     <eNB_traffic_exec_args></eNB_traffic_exec_args>
     <eNB_search_expr_true></eNB_search_expr_true>
     <eNB_search_expr_false></eNB_search_expr_false>
-    <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
 
     <UE_working_dir>/tmp</UE_working_dir>
-    <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"4\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"5\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"6\"</UE_config_file>
-    <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
-    <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args>
-    <UE_pre_exec></UE_pre_exec>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
     <UE_pre_exec_args></UE_pre_exec_args>
-    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
     <UE_main_exec_args></UE_main_exec_args>
-    <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5;  iperf -u -c  192.172.0.1 -b 10Mbits/s -t 120 -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 7Mbits/s    -B 192.172.0.2</UE_traffic_exec>
     <UE_traffic_exec_args></UE_traffic_exec_args>
     <UE_search_expr_true></UE_search_expr_true>
     <UE_search_expr_false></UE_search_expr_false>
-    <UE_terminate_missing_procs>True</UE_terminate_missing_procs>
-    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
 
     <EPC_working_dir>/tmp</EPC_working_dir>
-    <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.local.enb.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.local.enb.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file>
-    <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
-    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
-    <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
-    <HSS_compile_prog_args> -c -l </HSS_compile_prog_args>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
 
-    <EPC_pre_exec></EPC_pre_exec>
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
     <EPC_pre_exec_args></EPC_pre_exec_args>
     <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
     <EPC_main_exec_args></EPC_main_exec_args>
     <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
     <HSS_main_exec_args></HSS_main_exec_args>
-    <EPC_traffic_exec>sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </EPC_traffic_exec>
     <EPC_traffic_exec_args></EPC_traffic_exec_args>
-    <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec duration=60.0s </EPC_search_expr_true>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
     <EPC_search_expr_false></EPC_search_expr_false>
-    <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
-    <tags>USRPb210.ALU_EPC.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags>
-    <nruns>3</nruns>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.Bandrich.5MHz.FDD.UDP.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
     </testCase> 
 
 
   <testCase id="015501" >
     <class>lte-softmodem</class>
     <desc></desc>
-    <eNB>calisson</eNB>
+    <eNB>hutch</eNB>
     <UE>stevens</UE>
     <EPC>amerique</EPC>
-    <TimeOut_cmd>180</TimeOut_cmd>
-    <eNB_working_dir>/tmp</eNB_working_dir>
-    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  N_RB_DL 50
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  downlink_frequency 2660000000L
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  uplink_frequency_offset -120000000
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  tx_gain 90
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  rx_gain 120
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  frame_type \"FDD\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  nb_antennas_rx  1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  nb_antennas_tx 1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
     <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
     <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
-    <eNB_pre_exec></eNB_pre_exec>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
     <eNB_pre_exec_args></eNB_pre_exec_args>
-    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
-    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  </eNB_main_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
     <eNB_traffic_exec></eNB_traffic_exec>
     <eNB_traffic_exec_args></eNB_traffic_exec_args>
     <eNB_search_expr_true></eNB_search_expr_true>
     <eNB_search_expr_false></eNB_search_expr_false>
-    <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
 
     <UE_working_dir>/tmp</UE_working_dir>
-    <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"4\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"5\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"6\"</UE_config_file>
-    <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
-    <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args>
-    <UE_pre_exec></UE_pre_exec>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
     <UE_pre_exec_args></UE_pre_exec_args>
-    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
     <UE_main_exec_args></UE_main_exec_args>
-    <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5;  iperf -u -c  192.172.0.1 -b 10Mbits/s -t 120 -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 14Mbits/s    -B 192.172.0.2</UE_traffic_exec>
     <UE_traffic_exec_args></UE_traffic_exec_args>
     <UE_search_expr_true></UE_search_expr_true>
     <UE_search_expr_false></UE_search_expr_false>
-    <UE_terminate_missing_procs>True</UE_terminate_missing_procs>
-    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
 
     <EPC_working_dir>/tmp</EPC_working_dir>
-    <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.local.enb.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.local.enb.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file>
-    <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
-    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
-    <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
-    <HSS_compile_prog_args> -c -l </HSS_compile_prog_args>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
 
-    <EPC_pre_exec></EPC_pre_exec>
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
     <EPC_pre_exec_args></EPC_pre_exec_args>
     <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
     <EPC_main_exec_args></EPC_main_exec_args>
     <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
     <HSS_main_exec_args></HSS_main_exec_args>
-    <EPC_traffic_exec>sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </EPC_traffic_exec>
     <EPC_traffic_exec_args></EPC_traffic_exec_args>
-    <EPC_search_expr_true>throughput_test min=2.0Mbits/sec max=2.0Mbits/sec average=2.0Mbits/sec duration=60.0s </EPC_search_expr_true>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
     <EPC_search_expr_false></EPC_search_expr_false>
-    <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
-    <tags>USRPb210.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags>
-    <nruns>3</nruns>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.Bandrich.10MHz.FDD.UDP.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
     </testCase> 
 
   <testCase id="015502" >
     <class>lte-softmodem</class>
     <desc></desc>
-    <eNB>calisson</eNB>
+    <eNB>hutch</eNB>
     <UE>stevens</UE>
     <EPC>amerique</EPC>
-    <TimeOut_cmd>180</TimeOut_cmd>
-    <eNB_working_dir>/tmp</eNB_working_dir>
-    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  N_RB_DL 100
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  downlink_frequency 2660000000L
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  uplink_frequency_offset -120000000
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  tx_gain 90
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  rx_gain 120
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  frame_type \"FDD\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  nb_antennas_rx  1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  nb_antennas_tx 1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
     <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
     <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
-    <eNB_pre_exec></eNB_pre_exec>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
     <eNB_pre_exec_args></eNB_pre_exec_args>
-    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
-    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  </eNB_main_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -E -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
     <eNB_traffic_exec></eNB_traffic_exec>
     <eNB_traffic_exec_args></eNB_traffic_exec_args>
     <eNB_search_expr_true></eNB_search_expr_true>
     <eNB_search_expr_false></eNB_search_expr_false>
-    <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
 
     <UE_working_dir>/tmp</UE_working_dir>
-    <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"4\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"5\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"6\"</UE_config_file>
-    <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
-    <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args>
-    <UE_pre_exec></UE_pre_exec>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
     <UE_pre_exec_args></UE_pre_exec_args>
-    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
     <UE_main_exec_args></UE_main_exec_args>
-    <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5;  iperf -u -c  192.172.0.1 -b 10Mbits/s -t 120 -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 10Mbits/s    -B 192.172.0.2</UE_traffic_exec>
     <UE_traffic_exec_args></UE_traffic_exec_args>
     <UE_search_expr_true></UE_search_expr_true>
     <UE_search_expr_false></UE_search_expr_false>
-    <UE_terminate_missing_procs>True</UE_terminate_missing_procs>
-    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
 
     <EPC_working_dir>/tmp</EPC_working_dir>
-    <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.local.enb.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.local.enb.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file>
-    <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
-    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
-    <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
-    <HSS_compile_prog_args> -c -l </HSS_compile_prog_args>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
 
-    <EPC_pre_exec></EPC_pre_exec>
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
     <EPC_pre_exec_args></EPC_pre_exec_args>
     <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
     <EPC_main_exec_args></EPC_main_exec_args>
     <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
     <HSS_main_exec_args></HSS_main_exec_args>
-    <EPC_traffic_exec>sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </EPC_traffic_exec>
     <EPC_traffic_exec_args></EPC_traffic_exec_args>
-    <EPC_search_expr_true>throughput_test min=4.0Mbits/sec max=4.0Mbits/sec average=4.0Mbits/sec duration=60.0s </EPC_search_expr_true>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
     <EPC_search_expr_false></EPC_search_expr_false>
-    <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
-    <tags>USRPb210.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags>
-    <nruns>3</nruns>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.Bandrich.20MHz.FDD.UDP.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
     </testCase> 
 
   <testCase id="015503" >
     <class>lte-softmodem</class>
     <desc></desc>
-    <eNB>calisson</eNB>
+    <eNB>hutch</eNB>
     <UE>stevens</UE>
     <EPC>amerique</EPC>
-    <TimeOut_cmd>180</TimeOut_cmd>
-    <eNB_working_dir>/tmp</eNB_working_dir>
-    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  N_RB_DL 25
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  downlink_frequency 2660000000L
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  uplink_frequency_offset -120000000
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  tx_gain 90
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  rx_gain 120
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  frame_type \"FDD\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  nb_antennas_rx  1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  nb_antennas_tx 1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
     <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
     <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
-    <eNB_pre_exec></eNB_pre_exec>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
     <eNB_pre_exec_args></eNB_pre_exec_args>
-    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
-    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  </eNB_main_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
     <eNB_traffic_exec></eNB_traffic_exec>
     <eNB_traffic_exec_args></eNB_traffic_exec_args>
     <eNB_search_expr_true></eNB_search_expr_true>
     <eNB_search_expr_false></eNB_search_expr_false>
-    <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
 
     <UE_working_dir>/tmp</UE_working_dir>
-    <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"4\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"5\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"6\"</UE_config_file>
-    <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
-    <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args>
-    <UE_pre_exec></UE_pre_exec>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
     <UE_pre_exec_args></UE_pre_exec_args>
-    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
     <UE_main_exec_args></UE_main_exec_args>
-    <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5;   iperf -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -f m -u</UE_traffic_exec>
     <UE_traffic_exec_args></UE_traffic_exec_args>
-    <UE_terminate_missing_procs>True</UE_terminate_missing_procs>
-    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script>
-    <UE_search_expr_true>throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec duration=60.0s </UE_search_expr_true>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec   </UE_search_expr_true>
     <UE_search_expr_false></UE_search_expr_false>
 
     <EPC_working_dir>/tmp</EPC_working_dir>
-    <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.local.enb.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.local.enb.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file>
-    <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
-    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
-    <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
-    <HSS_compile_prog_args> -c -l </HSS_compile_prog_args>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
 
-    <EPC_pre_exec></EPC_pre_exec>
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
     <EPC_pre_exec_args></EPC_pre_exec_args>
     <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
     <EPC_main_exec_args></EPC_main_exec_args>
     <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
     <HSS_main_exec_args></HSS_main_exec_args>
-    <EPC_traffic_exec>sleep 60; iperf -u -c  192.172.0.2 -b 10Mbits/s -t 120 -B 192.172.0.1</EPC_traffic_exec>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -b 16M -i 1 -f m -u</EPC_traffic_exec>
     <EPC_traffic_exec_args></EPC_traffic_exec_args>
     <EPC_search_expr_false></EPC_search_expr_false>
-    <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
-    <tags>USRPb210.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX</tags>
-    <nruns>3</nruns>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.Bandrich.5MHz.FDD.UDP.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
     </testCase> 
 
   <testCase id="015504" >
     <class>lte-softmodem</class>
     <desc></desc>
-    <eNB>calisson</eNB>
+    <eNB>hutch</eNB>
     <UE>stevens</UE>
     <EPC>amerique</EPC>
-    <TimeOut_cmd>180</TimeOut_cmd>
-    <eNB_working_dir>/tmp</eNB_working_dir>
-    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  N_RB_DL 50
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  downlink_frequency 2660000000L
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  uplink_frequency_offset -120000000
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  tx_gain 90
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  rx_gain 120
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  frame_type \"FDD\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  nb_antennas_rx  1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  nb_antennas_tx 1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
     <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
     <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
-    <eNB_pre_exec></eNB_pre_exec>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
     <eNB_pre_exec_args></eNB_pre_exec_args>
-    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
-    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  </eNB_main_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf     </eNB_main_exec_args>
     <eNB_traffic_exec></eNB_traffic_exec>
     <eNB_traffic_exec_args></eNB_traffic_exec_args>
     <eNB_search_expr_true></eNB_search_expr_true>
     <eNB_search_expr_false></eNB_search_expr_false>
-    <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
 
     <UE_working_dir>/tmp</UE_working_dir>
-    <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"4\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"5\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"6\"</UE_config_file>
-    <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
-    <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args>
-    <UE_pre_exec></UE_pre_exec>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
     <UE_pre_exec_args></UE_pre_exec_args>
-    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
     <UE_main_exec_args></UE_main_exec_args>
-    <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5;   iperf -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -f m -u </UE_traffic_exec>
     <UE_traffic_exec_args></UE_traffic_exec_args>
-    <UE_search_expr_true>throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec duration=60.0s </UE_search_expr_true>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec   </UE_search_expr_true>
     <UE_search_expr_false></UE_search_expr_false>
-    <UE_terminate_missing_procs>True</UE_terminate_missing_procs>
-    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
 
 
     <EPC_working_dir>/tmp</EPC_working_dir>
-    <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.local.enb.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.local.enb.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file>
-    <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
-    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
-    <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
-    <HSS_compile_prog_args> -c -l </HSS_compile_prog_args>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
 
-    <EPC_pre_exec></EPC_pre_exec>
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
     <EPC_pre_exec_args></EPC_pre_exec_args>
     <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
     <EPC_main_exec_args></EPC_main_exec_args>
     <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
     <HSS_main_exec_args></HSS_main_exec_args>
-    <EPC_traffic_exec>sleep 60; iperf -u -c  192.172.0.2 -b 10Mbits/s -t 120 -B 192.172.0.1</EPC_traffic_exec>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -b 33M -i 1 -f m -u  </EPC_traffic_exec>
     <EPC_traffic_exec_args></EPC_traffic_exec_args>
     <EPC_search_expr_false></EPC_search_expr_false>
-    <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
-    <tags>USRPb210.ALU_EPC.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX</tags>
-    <nruns>3</nruns>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.Bandrich.10MHz.FDD.UDP.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
     </testCase> 
 
   <testCase id="015505" >
     <class>lte-softmodem</class>
     <desc></desc>
-    <eNB>calisson</eNB>
+    <eNB>hutch</eNB>
     <UE>stevens</UE>
     <EPC>amerique</EPC>
-    <TimeOut_cmd>180</TimeOut_cmd>
-    <eNB_working_dir>/tmp</eNB_working_dir>
-    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  N_RB_DL 100
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  downlink_frequency 2660000000L
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  uplink_frequency_offset -120000000
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  tx_gain 90
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  rx_gain 120
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  frame_type \"FDD\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  nb_antennas_rx  1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  nb_antennas_tx 1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
     <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
     <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
-    <eNB_pre_exec></eNB_pre_exec>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
     <eNB_pre_exec_args></eNB_pre_exec_args>
-    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
-    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  </eNB_main_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -E -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
     <eNB_traffic_exec></eNB_traffic_exec>
     <eNB_traffic_exec_args></eNB_traffic_exec_args>
     <eNB_search_expr_true></eNB_search_expr_true>
     <eNB_search_expr_false></eNB_search_expr_false>
-    <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
 
     <UE_working_dir>/tmp</UE_working_dir>
-    <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"4\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"5\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"6\"</UE_config_file>
-    <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
-    <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args>
-    <UE_pre_exec></UE_pre_exec>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
     <UE_pre_exec_args></UE_pre_exec_args>
-    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
     <UE_main_exec_args></UE_main_exec_args>
-    <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5;   iperf -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
     <UE_traffic_exec_args></UE_traffic_exec_args>
-    <UE_search_expr_true>throughput_test min=15.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec duration=60.0s </UE_search_expr_true>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec   </UE_search_expr_true>
     <UE_search_expr_false></UE_search_expr_false>
-    <UE_terminate_missing_procs>True</UE_terminate_missing_procs>
-    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
 
 
     <EPC_working_dir>/tmp</EPC_working_dir>
-    <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.local.enb.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.local.enb.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file>
-    <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
-    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
-    <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
-    <HSS_compile_prog_args> -c -l </HSS_compile_prog_args>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
 
-    <EPC_pre_exec></EPC_pre_exec>
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
     <EPC_pre_exec_args></EPC_pre_exec_args>
     <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
     <EPC_main_exec_args></EPC_main_exec_args>
     <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
     <HSS_main_exec_args></HSS_main_exec_args>
-    <EPC_traffic_exec>sleep 60; iperf -u -c  192.172.0.2 -b 10Mbits/s -t 120 -B 192.172.0.1</EPC_traffic_exec>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -u -c  192.172.0.2 -b 10Mbits/s   </EPC_traffic_exec>
     <EPC_traffic_exec_args></EPC_traffic_exec_args>
     <EPC_search_expr_false></EPC_search_expr_false>
-    <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
-    <tags>USRPb210.ALU_EPC.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX</tags>
-    <nruns>3</nruns>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.Bandrich.20MHz.FDD.UDP.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
     </testCase> 
 
 
   <testCase id="015506" >
     <class>lte-softmodem</class>
     <desc></desc>
-    <eNB>calisson</eNB>
+    <eNB>hutch</eNB>
     <UE>stevens</UE>
     <EPC>amerique</EPC>
-    <TimeOut_cmd>180</TimeOut_cmd>
-    <eNB_working_dir>/tmp</eNB_working_dir>
-    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  N_RB_DL 25
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  downlink_frequency 2660000000L
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  uplink_frequency_offset -120000000
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  tx_gain 90
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  rx_gain 120
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  frame_type \"FDD\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  nb_antennas_rx  2
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  nb_antennas_tx 2
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  2
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 2
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
     <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
     <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
-    <eNB_pre_exec></eNB_pre_exec>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
     <eNB_pre_exec_args></eNB_pre_exec_args>
-    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
-    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  </eNB_main_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
     <eNB_traffic_exec></eNB_traffic_exec>
     <eNB_traffic_exec_args></eNB_traffic_exec_args>
     <eNB_search_expr_true></eNB_search_expr_true>
     <eNB_search_expr_false></eNB_search_expr_false>
-    <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
 
     <UE_working_dir>/tmp</UE_working_dir>
-    <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"4\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"5\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"6\"</UE_config_file>
-    <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
-    <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args>
-    <UE_pre_exec></UE_pre_exec>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
     <UE_pre_exec_args></UE_pre_exec_args>
-    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue;$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
     <UE_main_exec_args></UE_main_exec_args>
-    <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5;  iperf -u -c  192.172.0.1 -b 10Mbits/s -t 120 -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 10Mbits/s    -B 192.172.0.2</UE_traffic_exec>
     <UE_traffic_exec_args></UE_traffic_exec_args>
     <UE_search_expr_true></UE_search_expr_true>
     <UE_search_expr_false></UE_search_expr_false>
-    <UE_terminate_missing_procs>True</UE_terminate_missing_procs>
-    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
 
     <EPC_working_dir>/tmp</EPC_working_dir>
-    <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.local.enb.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.local.enb.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file>
-    <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
-    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
-    <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
-    <HSS_compile_prog_args> -c -l </HSS_compile_prog_args>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
 
-    <EPC_pre_exec></EPC_pre_exec>
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
     <EPC_pre_exec_args></EPC_pre_exec_args>
     <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
     <EPC_main_exec_args></EPC_main_exec_args>
     <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
     <HSS_main_exec_args></HSS_main_exec_args>
-    <EPC_traffic_exec>sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </EPC_traffic_exec>
     <EPC_traffic_exec_args></EPC_traffic_exec_args>
-    <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec duration=60.0s </EPC_search_expr_true>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
     <EPC_search_expr_false></EPC_search_expr_false>
-    <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
-    <tags>USRPb210.ALU_EPC.Bandrich.5MHz.FDD.Band_7.UL.2TX.2RX</tags>
-    <nruns>3</nruns>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.Bandrich.5MHz.FDD.UDP.Band_7.UL.2TX.2RX</tags>
+    <nruns>10</nruns>
     </testCase> 
 
 
   <testCase id="015507" >
     <class>lte-softmodem</class>
     <desc></desc>
-    <eNB>calisson</eNB>
+    <eNB>hutch</eNB>
     <UE>stevens</UE>
     <EPC>amerique</EPC>
-    <TimeOut_cmd>180</TimeOut_cmd>
-    <eNB_working_dir>/tmp</eNB_working_dir>
-    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  N_RB_DL 50
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  downlink_frequency 2660000000L
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  uplink_frequency_offset -120000000
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  tx_gain 90
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  rx_gain 120
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  frame_type \"FDD\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  nb_antennas_rx  2
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  nb_antennas_tx 2
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  2
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 2
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
     <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
     <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
-    <eNB_pre_exec></eNB_pre_exec>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
     <eNB_pre_exec_args></eNB_pre_exec_args>
-    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
-    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  </eNB_main_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
     <eNB_traffic_exec></eNB_traffic_exec>
     <eNB_traffic_exec_args></eNB_traffic_exec_args>
     <eNB_search_expr_true></eNB_search_expr_true>
     <eNB_search_expr_false></eNB_search_expr_false>
-    <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
 
     <UE_working_dir>/tmp</UE_working_dir>
-    <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"4\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"5\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"6\"</UE_config_file>
-    <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
-    <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args>
-    <UE_pre_exec></UE_pre_exec>
+    <UE_config_file></UE_config_file>>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
     <UE_pre_exec_args></UE_pre_exec_args>
-    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue;$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
     <UE_main_exec_args></UE_main_exec_args>
-    <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5;  iperf -u -c  192.172.0.1 -b 10Mbits/s -t 120 -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 10Mbits/s    -B 192.172.0.2</UE_traffic_exec>
     <UE_traffic_exec_args></UE_traffic_exec_args>
     <UE_search_expr_true></UE_search_expr_true>
     <UE_search_expr_false></UE_search_expr_false>
-    <UE_terminate_missing_procs>True</UE_terminate_missing_procs>
-    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
 
     <EPC_working_dir>/tmp</EPC_working_dir>
-    <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.local.enb.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.local.enb.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file>
-    <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
-    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
-    <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
-    <HSS_compile_prog_args> -c -l </HSS_compile_prog_args>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
 
-    <EPC_pre_exec></EPC_pre_exec>
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
     <EPC_pre_exec_args></EPC_pre_exec_args>
     <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
     <EPC_main_exec_args></EPC_main_exec_args>
     <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
     <HSS_main_exec_args></HSS_main_exec_args>
-    <EPC_traffic_exec>sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </EPC_traffic_exec>
     <EPC_traffic_exec_args></EPC_traffic_exec_args>
-    <EPC_search_expr_true>throughput_test min=2.0Mbits/sec max=2.0Mbits/sec average=2.0Mbits/sec duration=60.0s </EPC_search_expr_true>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=2.0Mbits/sec average=2.0Mbits/sec   </EPC_search_expr_true>
     <EPC_search_expr_false></EPC_search_expr_false>
-    <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
-    <tags>USRPb210.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.2TX.2RX</tags>
-    <nruns>3</nruns>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.Bandrich.10MHz.FDD.UDP.Band_7.UL.2TX.2RX</tags>
+    <nruns>10</nruns>
     </testCase> 
 
   <testCase id="015508" >
     <class>lte-softmodem</class>
     <desc></desc>
-    <eNB>calisson</eNB>
+    <eNB>hutch</eNB>
     <UE>stevens</UE>
     <EPC>amerique</EPC>
-    <TimeOut_cmd>180</TimeOut_cmd>
-    <eNB_working_dir>/tmp</eNB_working_dir>
-    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  N_RB_DL 100
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  downlink_frequency 2660000000L
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  uplink_frequency_offset -120000000
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  tx_gain 90
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  rx_gain 120
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  frame_type \"FDD\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  nb_antennas_rx  2
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  nb_antennas_tx 2
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  2
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 2
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
     <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
     <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
-    <eNB_pre_exec></eNB_pre_exec>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
     <eNB_pre_exec_args></eNB_pre_exec_args>
-    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
-    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  </eNB_main_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
     <eNB_traffic_exec></eNB_traffic_exec>
     <eNB_traffic_exec_args></eNB_traffic_exec_args>
     <eNB_search_expr_true></eNB_search_expr_true>
     <eNB_search_expr_false></eNB_search_expr_false>
-    <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
 
     <UE_working_dir>/tmp</UE_working_dir>
-    <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"4\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"5\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"6\"</UE_config_file>
-    <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
-    <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args>
-    <UE_pre_exec></UE_pre_exec>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
     <UE_pre_exec_args></UE_pre_exec_args>
-    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
     <UE_main_exec_args></UE_main_exec_args>
-    <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5;  iperf -u -c  192.172.0.1 -b 10Mbits/s -t 120 -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 10Mbits/s    -B 192.172.0.2</UE_traffic_exec>
     <UE_traffic_exec_args></UE_traffic_exec_args>
     <UE_search_expr_true></UE_search_expr_true>
     <UE_search_expr_false></UE_search_expr_false>
-    <UE_terminate_missing_procs>True</UE_terminate_missing_procs>
-    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
 
     <EPC_working_dir>/tmp</EPC_working_dir>
-    <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.local.enb.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.local.enb.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file>
-    <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
-    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
-    <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
-    <HSS_compile_prog_args> -c -l </HSS_compile_prog_args>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
 
-    <EPC_pre_exec></EPC_pre_exec>
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
     <EPC_pre_exec_args></EPC_pre_exec_args>
     <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
     <EPC_main_exec_args></EPC_main_exec_args>
     <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
     <HSS_main_exec_args></HSS_main_exec_args>
-    <EPC_traffic_exec>sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script  5 lo  -s -i 1 -u -f m</EPC_traffic_exec>
     <EPC_traffic_exec_args></EPC_traffic_exec_args>
-    <EPC_search_expr_true>throughput_test min=4.0Mbits/sec max=4.0Mbits/sec average=4.0Mbits/sec duration=60.0s </EPC_search_expr_true>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=4.0Mbits/sec average=4.0Mbits/sec   </EPC_search_expr_true>
     <EPC_search_expr_false></EPC_search_expr_false>
-    <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
-    <tags>USRPb210.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.2TX.2RX</tags>
-    <nruns>3</nruns>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.Bandrich.20MHz.FDD.UDP.Band_7.UL.2TX.2RX</tags>
+    <nruns>10</nruns>
     </testCase> 
 
   <testCase id="015509" >
     <class>lte-softmodem</class>
     <desc></desc>
-    <eNB>calisson</eNB>
+    <eNB>hutch</eNB>
     <UE>stevens</UE>
     <EPC>amerique</EPC>
-    <TimeOut_cmd>180</TimeOut_cmd>
-    <eNB_working_dir>/tmp</eNB_working_dir>
-    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  N_RB_DL 25
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  downlink_frequency 2660000000L
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  uplink_frequency_offset -120000000
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  tx_gain 90
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  rx_gain 120
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  frame_type \"FDD\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  nb_antennas_rx  2
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  nb_antennas_tx 2
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  2
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 2
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
     <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
     <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
-    <eNB_pre_exec></eNB_pre_exec>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
     <eNB_pre_exec_args></eNB_pre_exec_args>
-    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
-    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  </eNB_main_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
     <eNB_traffic_exec></eNB_traffic_exec>
     <eNB_traffic_exec_args></eNB_traffic_exec_args>
     <eNB_search_expr_true></eNB_search_expr_true>
     <eNB_search_expr_false></eNB_search_expr_false>
-    <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
 
     <UE_working_dir>/tmp</UE_working_dir>
-    <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"4\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"5\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"6\"</UE_config_file>
-    <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
-    <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args>
-    <UE_pre_exec></UE_pre_exec>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
     <UE_pre_exec_args></UE_pre_exec_args>
-    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
     <UE_main_exec_args></UE_main_exec_args>
-    <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5;   iperf -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
     <UE_traffic_exec_args></UE_traffic_exec_args>
-    <UE_search_expr_true>throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec duration=60.0s </UE_search_expr_true>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec   </UE_search_expr_true>
     <UE_search_expr_false></UE_search_expr_false>
-    <UE_terminate_missing_procs>True</UE_terminate_missing_procs>
-    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
 
 
     <EPC_working_dir>/tmp</EPC_working_dir>
-    <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.local.enb.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.local.enb.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file>
-    <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
-    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
-    <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
-    <HSS_compile_prog_args> -c -l </HSS_compile_prog_args>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
 
-    <EPC_pre_exec></EPC_pre_exec>
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
     <EPC_pre_exec_args></EPC_pre_exec_args>
     <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
     <EPC_main_exec_args></EPC_main_exec_args>
     <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
     <HSS_main_exec_args></HSS_main_exec_args>
-    <EPC_traffic_exec>sleep 60; iperf -u -c  192.172.0.2 -b 10Mbits/s -t 120 -B 192.172.0.1</EPC_traffic_exec>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c  192.172.0.2 -b 10Mbits/s</EPC_traffic_exec>
     <EPC_traffic_exec_args></EPC_traffic_exec_args>
     <EPC_search_expr_false></EPC_search_expr_false>
-    <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
-    <tags>USRPb210.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.2TX.2RX</tags>
-    <nruns>3</nruns>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.Bandrich.5MHz.FDD.UDP.Band_7.DL.2TX.2RX</tags>
+    <nruns>10</nruns>
     </testCase> 
 
   <testCase id="015510" >
     <class>lte-softmodem</class>
     <desc></desc>
-    <eNB>calisson</eNB>
+    <eNB>hutch</eNB>
     <UE>stevens</UE>
     <EPC>amerique</EPC>
-    <TimeOut_cmd>180</TimeOut_cmd>
-    <eNB_working_dir>/tmp</eNB_working_dir>
-    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  N_RB_DL 50
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  downlink_frequency 2660000000L
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  uplink_frequency_offset -120000000
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  tx_gain 90
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  rx_gain 120
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  frame_type \"FDD\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  nb_antennas_rx  2
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  nb_antennas_tx 2
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  2
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 2
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
     <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
     <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
-    <eNB_pre_exec></eNB_pre_exec>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
     <eNB_pre_exec_args></eNB_pre_exec_args>
-    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
-    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  </eNB_main_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
     <eNB_traffic_exec></eNB_traffic_exec>
     <eNB_traffic_exec_args></eNB_traffic_exec_args>
     <eNB_search_expr_true></eNB_search_expr_true>
     <eNB_search_expr_false></eNB_search_expr_false>
-    <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
 
     <UE_working_dir>/tmp</UE_working_dir>
-    <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"4\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"5\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"6\"</UE_config_file>
-    <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
-    <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args>
-    <UE_pre_exec></UE_pre_exec>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
     <UE_pre_exec_args></UE_pre_exec_args>
-    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
     <UE_main_exec_args></UE_main_exec_args>
-    <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5;   iperf -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0  -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
     <UE_traffic_exec_args></UE_traffic_exec_args>
-    <UE_search_expr_true>throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec duration=60.0s </UE_search_expr_true>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec   </UE_search_expr_true>
     <UE_search_expr_false></UE_search_expr_false>
-    <UE_terminate_missing_procs>True</UE_terminate_missing_procs>
-    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
 
 
     <EPC_working_dir>/tmp</EPC_working_dir>
-    <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.local.enb.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.local.enb.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file>
-    <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
-    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
-    <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
-    <HSS_compile_prog_args> -c -l </HSS_compile_prog_args>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
 
-    <EPC_pre_exec></EPC_pre_exec>
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
     <EPC_pre_exec_args></EPC_pre_exec_args>
     <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
     <EPC_main_exec_args></EPC_main_exec_args>
     <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
     <HSS_main_exec_args></HSS_main_exec_args>
-    <EPC_traffic_exec>sleep 60; iperf -u -c  192.172.0.2 -b 10Mbits/s -t 120 -B 192.172.0.1</EPC_traffic_exec>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script  60 lo -u -c  192.172.0.2 -b 10Mbits/s </EPC_traffic_exec>
     <EPC_traffic_exec_args></EPC_traffic_exec_args>
     <EPC_search_expr_false></EPC_search_expr_false>
-    <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
-    <tags>USRPb210.ALU_EPC.Bandrich.10MHz.FDD.Band_7.DL.2TX.2RX</tags>
-    <nruns>3</nruns>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.Bandrich.10MHz.FDD.UDP.Band_7.DL.2TX.2RX</tags>
+    <nruns>10</nruns>
     </testCase> 
 
   <testCase id="015511" >
     <class>lte-softmodem</class>
     <desc></desc>
-    <eNB>calisson</eNB>
+    <eNB>hutch</eNB>
     <UE>stevens</UE>
     <EPC>amerique</EPC>
-    <TimeOut_cmd>180</TimeOut_cmd>
-    <eNB_working_dir>/tmp</eNB_working_dir>
-    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  N_RB_DL 100
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  downlink_frequency 2660000000L
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  uplink_frequency_offset -120000000
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  tx_gain 90
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  rx_gain 120
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  frame_type \"FDD\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  nb_antennas_rx  2
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  nb_antennas_tx 2
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  2
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 2
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
     <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
     <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
-    <eNB_pre_exec></eNB_pre_exec>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
     <eNB_pre_exec_args></eNB_pre_exec_args>
-    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
-    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  </eNB_main_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -E -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
     <eNB_traffic_exec></eNB_traffic_exec>
     <eNB_traffic_exec_args></eNB_traffic_exec_args>
     <eNB_search_expr_true></eNB_search_expr_true>
     <eNB_search_expr_false></eNB_search_expr_false>
-    <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
 
     <UE_working_dir>/tmp</UE_working_dir>
-    <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"4\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"5\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"6\"</UE_config_file>
-    <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
-    <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args>
-    <UE_pre_exec></UE_pre_exec>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
     <UE_pre_exec_args></UE_pre_exec_args>
-    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
     <UE_main_exec_args></UE_main_exec_args>
-    <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5;   iperf -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0  -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
     <UE_traffic_exec_args></UE_traffic_exec_args>
-    <UE_search_expr_true>throughput_test min=15.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec duration=60.0s </UE_search_expr_true>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec   </UE_search_expr_true>
     <UE_search_expr_false></UE_search_expr_false>
-    <UE_terminate_missing_procs>True</UE_terminate_missing_procs>
-    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
 
 
     <EPC_working_dir>/tmp</EPC_working_dir>
-    <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.local.enb.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.local.enb.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file>
-    <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
-    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
-    <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
-    <HSS_compile_prog_args> -c -l </HSS_compile_prog_args>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
 
-    <EPC_pre_exec></EPC_pre_exec>
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
     <EPC_pre_exec_args></EPC_pre_exec_args>
     <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
     <EPC_main_exec_args></EPC_main_exec_args>
     <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
     <HSS_main_exec_args></HSS_main_exec_args>
-    <EPC_traffic_exec>sleep 60; iperf -u -c  192.172.0.2 -b 10Mbits/s -t 120 -B 192.172.0.1</EPC_traffic_exec>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c  192.172.0.2 -b 10Mbits/s  </EPC_traffic_exec>
     <EPC_traffic_exec_args></EPC_traffic_exec_args>
     <EPC_search_expr_false></EPC_search_expr_false>
-    <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
-    <tags>USRPb210.ALU_EPC.Bandrich.20MHz.FDD.Band_7.DL.2TX.2RX</tags>
-    <nruns>3</nruns>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.Bandrich.20MHz.FDD.UDP.Band_7.DL.2TX.2RX</tags>
+    <nruns>10</nruns>
     </testCase> 
 
-
-  <testCase id="015800" >
+  <testCase id="015512" >
     <class>lte-softmodem</class>
     <desc></desc>
-    <eNB>mozart</eNB>
+    <eNB>hutch</eNB>
     <UE>stevens</UE>
     <EPC>amerique</EPC>
-    <TimeOut_cmd>180</TimeOut_cmd>
-    <eNB_working_dir>/tmp</eNB_working_dir>
-    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  N_RB_DL 25
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf downlink_frequency 2660000000L
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  uplink_frequency_offset -120000000
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  frame_type \"FDD\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  nb_antennas_rx  1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  nb_antennas_tx 1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
     <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
     <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
-    <eNB_pre_exec>sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
     <eNB_pre_exec_args></eNB_pre_exec_args>
-    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
-    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  </eNB_main_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
     <eNB_traffic_exec></eNB_traffic_exec>
     <eNB_traffic_exec_args></eNB_traffic_exec_args>
     <eNB_search_expr_true></eNB_search_expr_true>
     <eNB_search_expr_false></eNB_search_expr_false>
-    <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
 
     <UE_working_dir>/tmp</UE_working_dir>
-    <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"4\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"5\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"6\"</UE_config_file>
-    <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
-    <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args>
-    <UE_pre_exec></UE_pre_exec>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
     <UE_pre_exec_args></UE_pre_exec_args>
-    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
     <UE_main_exec_args></UE_main_exec_args>
-    <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5;  iperf -u -c  192.172.0.1 -b 10Mbits/s -t 120 -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0  -c  192.172.0.1  </UE_traffic_exec>
     <UE_traffic_exec_args></UE_traffic_exec_args>
     <UE_search_expr_true></UE_search_expr_true>
     <UE_search_expr_false></UE_search_expr_false>
-    <UE_terminate_missing_procs>True</UE_terminate_missing_procs>
-    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
 
     <EPC_working_dir>/tmp</EPC_working_dir>
-    <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.local.enb.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.local.enb.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file>
-    <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
-    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
-    <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
-    <HSS_compile_prog_args> -c -l </HSS_compile_prog_args>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
 
-    <EPC_pre_exec></EPC_pre_exec>
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
     <EPC_pre_exec_args></EPC_pre_exec_args>
     <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
     <EPC_main_exec_args></EPC_main_exec_args>
     <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
     <HSS_main_exec_args></HSS_main_exec_args>
-    <EPC_traffic_exec>sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1  -f m </EPC_traffic_exec>
     <EPC_traffic_exec_args></EPC_traffic_exec_args>
-    <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec duration=60.0s </EPC_search_expr_true>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
     <EPC_search_expr_false></EPC_search_expr_false>
-    <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
-    <tags>USRPx310.ALU_EPC.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags>
-    <nruns>3</nruns>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.Bandrich.5MHz.FDD.TCP.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
     </testCase> 
 
 
-  <testCase id="015801" >
+  <testCase id="015513" >
     <class>lte-softmodem</class>
     <desc></desc>
-    <eNB>mozart</eNB>
+    <eNB>hutch</eNB>
     <UE>stevens</UE>
     <EPC>amerique</EPC>
-    <TimeOut_cmd>180</TimeOut_cmd>
-    <eNB_working_dir>/tmp</eNB_working_dir>
-    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310..conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf  N_RB_DL 50
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf downlink_frequency 2660000000L
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf  uplink_frequency_offset -120000000
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf  frame_type \"FDD\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf  nb_antennas_rx  1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf  nb_antennas_tx 1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
     <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
     <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
-    <eNB_pre_exec>sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
     <eNB_pre_exec_args></eNB_pre_exec_args>
-    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
-    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf  </eNB_main_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
     <eNB_traffic_exec></eNB_traffic_exec>
     <eNB_traffic_exec_args></eNB_traffic_exec_args>
     <eNB_search_expr_true></eNB_search_expr_true>
     <eNB_search_expr_false></eNB_search_expr_false>
-    <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
 
     <UE_working_dir>/tmp</UE_working_dir>
-    <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"4\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"5\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"6\"</UE_config_file>
-    <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
-    <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args>
-    <UE_pre_exec></UE_pre_exec>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
     <UE_pre_exec_args></UE_pre_exec_args>
-    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
     <UE_main_exec_args></UE_main_exec_args>
-    <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5;  iperf -u -c  192.172.0.1 -b 10Mbits/s -t 120 -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0  -c  192.172.0.1  </UE_traffic_exec>
     <UE_traffic_exec_args></UE_traffic_exec_args>
     <UE_search_expr_true></UE_search_expr_true>
     <UE_search_expr_false></UE_search_expr_false>
-    <UE_terminate_missing_procs>True</UE_terminate_missing_procs>
-    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
 
     <EPC_working_dir>/tmp</EPC_working_dir>
-    <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.local.enb.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.local.enb.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file>
-    <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
-    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
-    <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
-    <HSS_compile_prog_args> -c -l </HSS_compile_prog_args>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
 
-    <EPC_pre_exec></EPC_pre_exec>
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
     <EPC_pre_exec_args></EPC_pre_exec_args>
     <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
     <EPC_main_exec_args></EPC_main_exec_args>
     <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
     <HSS_main_exec_args></HSS_main_exec_args>
-    <EPC_traffic_exec>sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -f m </EPC_traffic_exec>
     <EPC_traffic_exec_args></EPC_traffic_exec_args>
-    <EPC_search_expr_true>throughput_test min=2.0Mbits/sec max=2.0Mbits/sec average=2.0Mbits/sec duration=60.0s </EPC_search_expr_true>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
     <EPC_search_expr_false></EPC_search_expr_false>
-    <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
-    <tags>USRPx310.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags>
-    <nruns>3</nruns>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.Bandrich.10MHz.FDD.TCP.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
     </testCase> 
 
-  <testCase id="015802" >
+  <testCase id="015514" >
     <class>lte-softmodem</class>
     <desc></desc>
-    <eNB>mozart</eNB>
+    <eNB>hutch</eNB>
     <UE>stevens</UE>
     <EPC>amerique</EPC>
-    <TimeOut_cmd>180</TimeOut_cmd>
-    <eNB_working_dir>/tmp</eNB_working_dir>
-    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf  N_RB_DL 100
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf downlink_frequency 2660000000L
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf  uplink_frequency_offset -120000000
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf  frame_type \"FDD\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf  nb_antennas_rx  1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf  nb_antennas_tx 1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.remote.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.remote.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
     <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
     <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
-    <eNB_pre_exec>sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
     <eNB_pre_exec_args></eNB_pre_exec_args>
-    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
-    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf  </eNB_main_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -E -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
     <eNB_traffic_exec></eNB_traffic_exec>
     <eNB_traffic_exec_args></eNB_traffic_exec_args>
     <eNB_search_expr_true></eNB_search_expr_true>
     <eNB_search_expr_false></eNB_search_expr_false>
-    <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
 
     <UE_working_dir>/tmp</UE_working_dir>
-    <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"4\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"5\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"6\"</UE_config_file>
-    <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
-    <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args>
-    <UE_pre_exec></UE_pre_exec>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
     <UE_pre_exec_args></UE_pre_exec_args>
-    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
     <UE_main_exec_args></UE_main_exec_args>
-    <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5;  iperf -u -c  192.172.0.1 -b 10Mbits/s -t 120 -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0  -c  192.172.0.1  </UE_traffic_exec>
     <UE_traffic_exec_args></UE_traffic_exec_args>
     <UE_search_expr_true></UE_search_expr_true>
     <UE_search_expr_false></UE_search_expr_false>
-    <UE_terminate_missing_procs>True</UE_terminate_missing_procs>
-    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
 
     <EPC_working_dir>/tmp</EPC_working_dir>
-    <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.local.enb.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.local.enb.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file>
-    <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
-    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
-    <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
-    <HSS_compile_prog_args> -c -l </HSS_compile_prog_args>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
 
-    <EPC_pre_exec></EPC_pre_exec>
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
     <EPC_pre_exec_args></EPC_pre_exec_args>
     <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
     <EPC_main_exec_args></EPC_main_exec_args>
     <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
     <HSS_main_exec_args></HSS_main_exec_args>
-    <EPC_traffic_exec>sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1  -f m </EPC_traffic_exec>
     <EPC_traffic_exec_args></EPC_traffic_exec_args>
-    <EPC_search_expr_true>throughput_test min=4.0Mbits/sec max=4.0Mbits/sec average=4.0Mbits/sec duration=60.0s </EPC_search_expr_true>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
     <EPC_search_expr_false></EPC_search_expr_false>
-    <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
-    <tags>USRPx310.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags>
-    <nruns>3</nruns>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.Bandrich.20MHz.FDD.TCP.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
     </testCase> 
 
-  <testCase id="015803" >
+  <testCase id="015515" >
     <class>lte-softmodem</class>
     <desc></desc>
-    <eNB>mozart</eNB>
+    <eNB>hutch</eNB>
     <UE>stevens</UE>
     <EPC>amerique</EPC>
-    <TimeOut_cmd>180</TimeOut_cmd>
-    <eNB_working_dir>/tmp</eNB_working_dir>
-    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  N_RB_DL 25
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf downlink_frequency 2660000000L
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  uplink_frequency_offset -120000000
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  frame_type \"FDD\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  nb_antennas_rx  1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  nb_antennas_tx 1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
     <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
     <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
-    <eNB_pre_exec>sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
     <eNB_pre_exec_args></eNB_pre_exec_args>
-    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
-    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf  </eNB_main_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
     <eNB_traffic_exec></eNB_traffic_exec>
     <eNB_traffic_exec_args></eNB_traffic_exec_args>
     <eNB_search_expr_true></eNB_search_expr_true>
     <eNB_search_expr_false></eNB_search_expr_false>
-    <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
 
     <UE_working_dir>/tmp</UE_working_dir>
-    <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"4\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"5\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"6\"</UE_config_file>
-    <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
-    <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args>
-    <UE_pre_exec></UE_pre_exec>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
     <UE_pre_exec_args></UE_pre_exec_args>
-    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
     <UE_main_exec_args></UE_main_exec_args>
-    <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5;   iperf -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1  -f m </UE_traffic_exec>
     <UE_traffic_exec_args></UE_traffic_exec_args>
-    <UE_terminate_missing_procs>True</UE_terminate_missing_procs>
-    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script>
-    <UE_search_expr_true>throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec duration=60.0s </UE_search_expr_true>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec   </UE_search_expr_true>
     <UE_search_expr_false></UE_search_expr_false>
 
     <EPC_working_dir>/tmp</EPC_working_dir>
-    <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.local.enb.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.local.enb.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file>
-    <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
-    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
-    <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
-    <HSS_compile_prog_args> -c -l </HSS_compile_prog_args>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
 
-    <EPC_pre_exec></EPC_pre_exec>
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
     <EPC_pre_exec_args></EPC_pre_exec_args>
     <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
     <EPC_main_exec_args></EPC_main_exec_args>
     <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
     <HSS_main_exec_args></HSS_main_exec_args>
-    <EPC_traffic_exec>sleep 60; iperf -u -c  192.172.0.2 -b 10Mbits/s -t 120 -B 192.172.0.1</EPC_traffic_exec>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -i 1  -f m  </EPC_traffic_exec>
     <EPC_traffic_exec_args></EPC_traffic_exec_args>
     <EPC_search_expr_false></EPC_search_expr_false>
-    <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
-    <tags>USRPx310.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX</tags>
-    <nruns>3</nruns>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.Bandrich.5MHz.FDD.TCP.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
     </testCase> 
 
-  <testCase id="015804" >
+  <testCase id="015516" >
     <class>lte-softmodem</class>
     <desc></desc>
-    <eNB>mozart</eNB>
+    <eNB>hutch</eNB>
     <UE>stevens</UE>
     <EPC>amerique</EPC>
-    <TimeOut_cmd>180</TimeOut_cmd>
-    <eNB_working_dir>/tmp</eNB_working_dir>
-    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf  N_RB_DL 50
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf downlink_frequency 2660000000L
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf  uplink_frequency_offset -120000000
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf  frame_type \"FDD\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf  nb_antennas_rx  1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf  nb_antennas_tx 1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
     <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
     <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
-    <eNB_pre_exec>sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec>
-    <eNB_pre_exec_args>sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec_args>
-    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
-    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf </eNB_main_exec_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf     </eNB_main_exec_args>
     <eNB_traffic_exec></eNB_traffic_exec>
     <eNB_traffic_exec_args></eNB_traffic_exec_args>
     <eNB_search_expr_true></eNB_search_expr_true>
     <eNB_search_expr_false></eNB_search_expr_false>
-    <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
 
     <UE_working_dir>/tmp</UE_working_dir>
-    <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"4\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"5\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"6\"</UE_config_file>
-    <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
-    <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args>
-    <UE_pre_exec></UE_pre_exec>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
     <UE_pre_exec_args></UE_pre_exec_args>
-    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
     <UE_main_exec_args></UE_main_exec_args>
-    <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5;   iperf -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1  -f m </UE_traffic_exec>
     <UE_traffic_exec_args></UE_traffic_exec_args>
-    <UE_terminate_missing_procs>True</UE_terminate_missing_procs>
-    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script>
-    <UE_search_expr_true>throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec duration=60.0s </UE_search_expr_true>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec   </UE_search_expr_true>
     <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
 
     <EPC_working_dir>/tmp</EPC_working_dir>
-    <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.local.enb.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.local.enb.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file>
-    <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
-    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
-    <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
-    <HSS_compile_prog_args> -c -l </HSS_compile_prog_args>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
 
-    <EPC_pre_exec></EPC_pre_exec>
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
     <EPC_pre_exec_args></EPC_pre_exec_args>
     <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
     <EPC_main_exec_args></EPC_main_exec_args>
     <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
     <HSS_main_exec_args></HSS_main_exec_args>
-    <EPC_traffic_exec>sleep 60; iperf -u -c  192.172.0.2 -b 10Mbits/s -t 120 -B 192.172.0.1</EPC_traffic_exec>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -i 1  -f m  </EPC_traffic_exec>
     <EPC_traffic_exec_args></EPC_traffic_exec_args>
     <EPC_search_expr_false></EPC_search_expr_false>
-    <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
-    <tags>USRPx310.ALU_EPC.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX</tags>
-    <nruns>3</nruns>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.Bandrich.10MHz.FDD.TCP.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
     </testCase> 
 
-  <testCase id="015805" >
+  <testCase id="015517" >
     <class>lte-softmodem</class>
     <desc></desc>
-    <eNB>mozart</eNB>
+    <eNB>hutch</eNB>
     <UE>stevens</UE>
     <EPC>amerique</EPC>
-    <TimeOut_cmd>180</TimeOut_cmd>
-    <eNB_working_dir>/tmp</eNB_working_dir>
-    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.conf  N_RB_DL 100
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.conf downlink_frequency 2660000000L
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.conf  uplink_frequency_offset -120000000
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.conf  frame_type \"FDD\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.conf  nb_antennas_rx  1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.conf  nb_antennas_tx 1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
     <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
     <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
-    <eNB_pre_exec>sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
     <eNB_pre_exec_args></eNB_pre_exec_args>
-    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
-    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpx310.epc.conf  </eNB_main_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -E -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
     <eNB_traffic_exec></eNB_traffic_exec>
     <eNB_traffic_exec_args></eNB_traffic_exec_args>
     <eNB_search_expr_true></eNB_search_expr_true>
     <eNB_search_expr_false></eNB_search_expr_false>
-    <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
 
     <UE_working_dir>/tmp</UE_working_dir>
-    <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"4\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"5\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"6\"</UE_config_file>
-    <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
-    <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args>
-    <UE_pre_exec></UE_pre_exec>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
     <UE_pre_exec_args></UE_pre_exec_args>
-    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
     <UE_main_exec_args></UE_main_exec_args>
-    <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5;   iperf -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1  -f m -B 192.172.0.2</UE_traffic_exec>
     <UE_traffic_exec_args></UE_traffic_exec_args>
-    <UE_terminate_missing_procs>True</UE_terminate_missing_procs>
-    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script>
-    <UE_search_expr_true>throughput_test min=15.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec duration=60.0s </UE_search_expr_true>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec   </UE_search_expr_true>
     <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
 
     <EPC_working_dir>/tmp</EPC_working_dir>
-    <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.local.enb.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.local.enb.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file>
-    <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
-    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
-    <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
-    <HSS_compile_prog_args> -c -l </HSS_compile_prog_args>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
 
-    <EPC_pre_exec></EPC_pre_exec>
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
     <EPC_pre_exec_args></EPC_pre_exec_args>
     <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
     <EPC_main_exec_args></EPC_main_exec_args>
     <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
     <HSS_main_exec_args></HSS_main_exec_args>
-    <EPC_traffic_exec>sleep 60; iperf -u -c  192.172.0.2 -b 10Mbits/s -t 120 -B 192.172.0.1</EPC_traffic_exec>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2   -c  192.172.0.2   </EPC_traffic_exec>
     <EPC_traffic_exec_args></EPC_traffic_exec_args>
     <EPC_search_expr_false></EPC_search_expr_false>
-    <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
-    <tags>USRPx310.ALU_EPC.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX</tags>
-    <nruns>3</nruns>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.Bandrich.20MHz.FDD.TCP.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
     </testCase> 
 
 
-
-
-  <testCase id="016100" >
+  <testCase id="015600" >
     <class>lte-softmodem</class>
     <desc></desc>
     <eNB>calisson</eNB>
     <UE>stevens</UE>
-    <EPC>amerique</EPC>
-    <TimeOut_cmd>180</TimeOut_cmd>
+    <EPC>calisson</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
     <eNB_working_dir>/tmp</eNB_working_dir>
-    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  N_RB_DL 25
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  uplink_frequency_offset -120000000
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  frame_type \"FDD\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_rx  1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_tx 1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf   ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  pdsch_referenceSignalPower -26
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.170.0.1\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth5:3\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.170.0.2/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth5:4\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.170.1.2/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
     <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
-    <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args>
-    <eNB_pre_exec>sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2; dmesg|tail </eNB_pre_exec>
+    <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args>
+    <eNB_pre_exec>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E  ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec>
     <eNB_pre_exec_args></eNB_pre_exec_args>
-    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
-    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  </eNB_main_exec_args>
+    <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
     <eNB_traffic_exec></eNB_traffic_exec>
     <eNB_traffic_exec_args></eNB_traffic_exec_args>
     <eNB_search_expr_true></eNB_search_expr_true>
     <eNB_search_expr_false></eNB_search_expr_false>
-    <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
 
     <UE_working_dir>/tmp</UE_working_dir>
-    <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"4\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"5\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"6\"</UE_config_file>
-    <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
-    <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args>
-    <UE_pre_exec></UE_pre_exec>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec>
     <UE_pre_exec_args></UE_pre_exec_args>
-    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
     <UE_main_exec_args></UE_main_exec_args>
-    <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5;  iperf -u -c  192.172.0.1 -b 10Mbits/s -t 120 -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 7Mbits/s -B 192.172.0.2</UE_traffic_exec>
     <UE_traffic_exec_args></UE_traffic_exec_args>
     <UE_search_expr_true></UE_search_expr_true>
     <UE_search_expr_false></UE_search_expr_false>
-    <UE_terminate_missing_procs>True</UE_terminate_missing_procs>
-    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
 
     <EPC_working_dir>/tmp</EPC_working_dir>
-    <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.local.enb.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.local.enb.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file>
-    <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
+    <EPC_config_file>BUILD/EPC/epc.conf.in  MCC \"208\"
+                     BUILD/EPC/epc.conf.in  MNC \"92\"
+                     BUILD/EPC/epc.conf.in  TAC \"1\"
+                     BUILD/EPC/epc.conf.in  MME_INTERFACE_NAME_FOR_S1_MME \"eth5:1\"
+                     BUILD/EPC/epc.conf.in  MME_IPV4_ADDRESS_FOR_S1_MME  \"192.170.0.1/24\"
+                     BUILD/EPC/epc.conf.in   SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP    \"eth5:2\";
+                     BUILD/EPC/epc.conf.in   SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP       \"192.170.1.1/24\"; 
+                     BUILD/EPC/epc.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth5\"
+                     BUILD/EPC/epc.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\"
+                     BUILD/EPC/epc.conf.in   IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file>
+    <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog>
     <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
-    <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
-    <HSS_compile_prog_args> -c -l </HSS_compile_prog_args>
+    <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog>
+    <HSS_compile_prog_args> -c -l --debug --random false </HSS_compile_prog_args>
 
-    <EPC_pre_exec></EPC_pre_exec>
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth5 add 192.172.0.1</EPC_pre_exec>
     <EPC_pre_exec_args></EPC_pre_exec_args>
-    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
-    <EPC_main_exec_args></EPC_main_exec_args>
-    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc  </EPC_main_exec>
+    <EPC_main_exec_args> -i -r </EPC_main_exec_args>
+    <HSS_main_exec>sleep 10; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in;  $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db   </HSS_main_exec>
     <HSS_main_exec_args></HSS_main_exec_args>
-    <EPC_traffic_exec>sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </EPC_traffic_exec>
     <EPC_traffic_exec_args></EPC_traffic_exec_args>
-    <EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec duration=60.0s </EPC_search_expr_true>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
     <EPC_search_expr_false></EPC_search_expr_false>
-    <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
-    <tags>EXMIMO.ALU_EPC.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags>
-    <nruns>3</nruns>
-    </testCase> 
-
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.OAI_EPC_local.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+   </testCase>
 
-  <testCase id="016101" >
+  <testCase id="015601" >
     <class>lte-softmodem</class>
     <desc></desc>
     <eNB>calisson</eNB>
     <UE>stevens</UE>
-    <EPC>amerique</EPC>
-    <TimeOut_cmd>180</TimeOut_cmd>
+    <EPC>calisson</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
     <eNB_working_dir>/tmp</eNB_working_dir>
-    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  N_RB_DL 50
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  uplink_frequency_offset -120000000
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  frame_type \"FDD\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_rx  1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_tx 1                     
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf   ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  pdsch_referenceSignalPower -29
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.170.0.1\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth5:3\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.170.0.2/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth5:4\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.170.1.2/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
     <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
-    <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args>
-    <eNB_pre_exec>sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail</eNB_pre_exec>
+    <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args>
+    <eNB_pre_exec>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E  ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec>
     <eNB_pre_exec_args></eNB_pre_exec_args>
-    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
-    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  </eNB_main_exec_args>
+    <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
     <eNB_traffic_exec></eNB_traffic_exec>
     <eNB_traffic_exec_args></eNB_traffic_exec_args>
     <eNB_search_expr_true></eNB_search_expr_true>
     <eNB_search_expr_false></eNB_search_expr_false>
-    <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
 
     <UE_working_dir>/tmp</UE_working_dir>
-    <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"4\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"5\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"6\"</UE_config_file>
-    <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
-    <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args>
-    <UE_pre_exec></UE_pre_exec>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
     <UE_pre_exec_args></UE_pre_exec_args>
-    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
     <UE_main_exec_args></UE_main_exec_args>
-    <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5;  iperf -u -c  192.172.0.1 -b 10Mbits/s -t 120 -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 14Mbits/s  -B 192.172.0.2</UE_traffic_exec>
     <UE_traffic_exec_args></UE_traffic_exec_args>
     <UE_search_expr_true></UE_search_expr_true>
     <UE_search_expr_false></UE_search_expr_false>
-    <UE_terminate_missing_procs>True</UE_terminate_missing_procs>
-    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
 
     <EPC_working_dir>/tmp</EPC_working_dir>
-    <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.local.enb.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.local.enb.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file>
-    <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
+    <EPC_config_file>BUILD/EPC/epc.conf.in  MCC \"208\"
+                     BUILD/EPC/epc.conf.in  MNC \"92\"
+                     BUILD/EPC/epc.conf.in  TAC \"1\"
+                     BUILD/EPC/epc.conf.in  MME_INTERFACE_NAME_FOR_S1_MME \"eth5:1\"
+                     BUILD/EPC/epc.conf.in  MME_IPV4_ADDRESS_FOR_S1_MME  \"192.170.0.1/24\"
+                     BUILD/EPC/epc.conf.in   SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP    \"eth5:2\";
+                     BUILD/EPC/epc.conf.in   SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP       \"192.170.1.1/24\"; 
+                     BUILD/EPC/epc.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth5\"
+                     BUILD/EPC/epc.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\"
+                     BUILD/EPC/epc.conf.in   IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file>
+    <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog>
     <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
-    <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
-    <HSS_compile_prog_args> -c -l </HSS_compile_prog_args>
+    <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog>
+    <HSS_compile_prog_args> -c -l --debug --random false  </HSS_compile_prog_args>
 
-    <EPC_pre_exec></EPC_pre_exec>
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth5 add 192.172.0.1 ;  cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec>
     <EPC_pre_exec_args></EPC_pre_exec_args>
-    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
-    <EPC_main_exec_args></EPC_main_exec_args>
-    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc  </EPC_main_exec>
+    <EPC_main_exec_args> -i -r </EPC_main_exec_args>
+    <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db   </HSS_main_exec>
     <HSS_main_exec_args></HSS_main_exec_args>
-    <EPC_traffic_exec>sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </EPC_traffic_exec>
     <EPC_traffic_exec_args></EPC_traffic_exec_args>
-    <EPC_search_expr_true>throughput_test min=2.0Mbits/sec max=2.0Mbits/sec average=2.0Mbits/sec duration=60.0s </EPC_search_expr_true>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec    </EPC_search_expr_true>
     <EPC_search_expr_false></EPC_search_expr_false>
-    <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
-    <tags>EXMIMO.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags>
-    <nruns>3</nruns>
-    </testCase> 
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.OAI_EPC_local.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+   </testCase>
 
-  <testCase id="016102" >
+  <testCase id="015602" >
     <class>lte-softmodem</class>
     <desc></desc>
     <eNB>calisson</eNB>
     <UE>stevens</UE>
-    <EPC>amerique</EPC>
-    <TimeOut_cmd>180</TimeOut_cmd>
+    <EPC>calisson</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
     <eNB_working_dir>/tmp</eNB_working_dir>
-    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  N_RB_DL 100
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  uplink_frequency_offset -120000000
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  frame_type \"FDD\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_rx  1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_tx 1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf   ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  pdsch_referenceSignalPower -29
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.170.0.1\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth5:3\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.170.0.2/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth5:4\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.170.1.2/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
     <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
-    <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args>
-    <eNB_pre_exec>sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail</eNB_pre_exec>
+    <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args>
+    <eNB_pre_exec>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E  ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec>
     <eNB_pre_exec_args></eNB_pre_exec_args>
-    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
-    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  </eNB_main_exec_args>
+    <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
     <eNB_traffic_exec></eNB_traffic_exec>
     <eNB_traffic_exec_args></eNB_traffic_exec_args>
     <eNB_search_expr_true></eNB_search_expr_true>
     <eNB_search_expr_false></eNB_search_expr_false>
-    <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
 
     <UE_working_dir>/tmp</UE_working_dir>
-    <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"4\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"5\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"6\"</UE_config_file>
-    <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
-    <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args>
-    <UE_pre_exec></UE_pre_exec>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec>
     <UE_pre_exec_args></UE_pre_exec_args>
-    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
     <UE_main_exec_args></UE_main_exec_args>
-    <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5;  iperf -u -c  192.172.0.1 -b 10Mbits/s -t 120 -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 10Mbits/s    -B 192.172.0.2</UE_traffic_exec>
     <UE_traffic_exec_args></UE_traffic_exec_args>
     <UE_search_expr_true></UE_search_expr_true>
     <UE_search_expr_false></UE_search_expr_false>
-    <UE_terminate_missing_procs>True</UE_terminate_missing_procs>
-    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
 
     <EPC_working_dir>/tmp</EPC_working_dir>
-    <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.local.enb.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.local.enb.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file>
-    <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
+    <EPC_config_file>BUILD/EPC/epc.conf.in  MCC \"208\"
+                     BUILD/EPC/epc.conf.in  MNC \"92\"
+                     BUILD/EPC/epc.conf.in  TAC \"1\"
+                     BUILD/EPC/epc.conf.in  MME_INTERFACE_NAME_FOR_S1_MME \"eth5:1\"
+                     BUILD/EPC/epc.conf.in  MME_IPV4_ADDRESS_FOR_S1_MME  \"192.170.0.1/24\"
+                     BUILD/EPC/epc.conf.in   SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP    \"eth5:2\";
+                     BUILD/EPC/epc.conf.in   SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP       \"192.170.1.1/24\"; 
+                     BUILD/EPC/epc.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth5\"
+                     BUILD/EPC/epc.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\"
+                     BUILD/EPC/epc.conf.in   IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file>
+    <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog>
     <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
-    <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
-    <HSS_compile_prog_args> -c -l </HSS_compile_prog_args>
+    <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog>
+    <HSS_compile_prog_args> -c -l --debug --random false </HSS_compile_prog_args>
 
-    <EPC_pre_exec></EPC_pre_exec>
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth5 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec>
     <EPC_pre_exec_args></EPC_pre_exec_args>
-    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
-    <EPC_main_exec_args></EPC_main_exec_args>
-    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc  </EPC_main_exec>
+    <EPC_main_exec_args> -i -r </EPC_main_exec_args>
+    <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss  --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec>
     <HSS_main_exec_args></HSS_main_exec_args>
-    <EPC_traffic_exec>sleep 5; iperf -s -i 1 -u -f m -B 192.172.0.1</EPC_traffic_exec>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </EPC_traffic_exec>
     <EPC_traffic_exec_args></EPC_traffic_exec_args>
-    <EPC_search_expr_true>throughput_test min=4.0Mbits/sec max=4.0Mbits/sec average=4.0Mbits/sec duration=60.0s </EPC_search_expr_true>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec    </EPC_search_expr_true>
     <EPC_search_expr_false></EPC_search_expr_false>
-    <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
-    <tags>EXMIMO.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags>
-    <nruns>3</nruns>
-    </testCase> 
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.OAI_EPC_local.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+   </testCase>
 
-  <testCase id="016103" >
+  <testCase id="015603" >
     <class>lte-softmodem</class>
     <desc></desc>
     <eNB>calisson</eNB>
     <UE>stevens</UE>
-    <EPC>amerique</EPC>
-    <TimeOut_cmd>180</TimeOut_cmd>
+    <EPC>calisson</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
     <eNB_working_dir>/tmp</eNB_working_dir>
-    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  N_RB_DL 25
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  uplink_frequency_offset -120000000
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  frame_type \"FDD\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_rx  1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_tx 1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf   ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  pdsch_referenceSignalPower -26
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.170.0.1\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth5:3\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.170.0.2/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth5:4\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.170.1.2/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
     <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
-    <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args>
-    <eNB_pre_exec>sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail</eNB_pre_exec>
+    <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args>
+    <eNB_pre_exec>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E  ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec>
     <eNB_pre_exec_args></eNB_pre_exec_args>
-    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
-    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  </eNB_main_exec_args>
+    <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
     <eNB_traffic_exec></eNB_traffic_exec>
     <eNB_traffic_exec_args></eNB_traffic_exec_args>
     <eNB_search_expr_true></eNB_search_expr_true>
     <eNB_search_expr_false></eNB_search_expr_false>
-    <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
 
     <UE_working_dir>/tmp</UE_working_dir>
-    <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"4\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"5\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"6\"</UE_config_file>
-    <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
-    <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args>
-    <UE_pre_exec></UE_pre_exec>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec>
     <UE_pre_exec_args></UE_pre_exec_args>
-    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
     <UE_main_exec_args></UE_main_exec_args>
-    <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5;   iperf -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
     <UE_traffic_exec_args></UE_traffic_exec_args>
-    <UE_terminate_missing_procs>True</UE_terminate_missing_procs>
-    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script>
-    <UE_search_expr_true>throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec duration=60.0s </UE_search_expr_true>
+    <UE_search_expr_true>throughput_test min=00.0Mbits/sec max=10.5Mbits/sec average=11.0Mbits/sec   </UE_search_expr_true>
     <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
 
     <EPC_working_dir>/tmp</EPC_working_dir>
-    <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.local.enb.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.local.enb.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file>
-    <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
+    <EPC_config_file>BUILD/EPC/epc.conf.in  MCC \"208\"
+                     BUILD/EPC/epc.conf.in  MNC \"92\"
+                     BUILD/EPC/epc.conf.in  TAC \"1\"
+                     BUILD/EPC/epc.conf.in  MME_INTERFACE_NAME_FOR_S1_MME \"eth5:1\"
+                     BUILD/EPC/epc.conf.in  MME_IPV4_ADDRESS_FOR_S1_MME  \"192.170.0.1/24\"
+                     BUILD/EPC/epc.conf.in   SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP    \"eth5:2\";
+                     BUILD/EPC/epc.conf.in   SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP       \"192.170.1.1/24\"; 
+                     BUILD/EPC/epc.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth5\"
+                     BUILD/EPC/epc.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\"
+                     BUILD/EPC/epc.conf.in   IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file>
+    <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog>
     <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
-    <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
-    <HSS_compile_prog_args> -c -l </HSS_compile_prog_args>
+    <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog>
+    <HSS_compile_prog_args> -c -l --debug --random false </HSS_compile_prog_args>
 
-    <EPC_pre_exec></EPC_pre_exec>
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth5 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec>
     <EPC_pre_exec_args></EPC_pre_exec_args>
-    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
-    <EPC_main_exec_args></EPC_main_exec_args>
-    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc  </EPC_main_exec>
+    <EPC_main_exec_args> -i -r </EPC_main_exec_args>
+    <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss  --export-db $OPENAIRCN_TESTDIR/hss_export.db   </HSS_main_exec>
     <HSS_main_exec_args></HSS_main_exec_args>
-    <EPC_traffic_exec>sleep 60; iperf -u -c  192.172.0.2 -b 10Mbits/s -t 120 -B 192.172.0.1</EPC_traffic_exec>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo  -u -c  192.172.0.2 -b 10Mbits/s  </EPC_traffic_exec>
     <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true></EPC_search_expr_true>
     <EPC_search_expr_false></EPC_search_expr_false>
-    <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
-    <tags>EXMIMO.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX</tags>
-    <nruns>3</nruns>
-    </testCase> 
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.OAI_EPC_local.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+   </testCase>
 
-  <testCase id="016104" >
+   <testCase id="015604" >
     <class>lte-softmodem</class>
     <desc></desc>
     <eNB>calisson</eNB>
     <UE>stevens</UE>
-    <EPC>amerique</EPC>
-    <TimeOut_cmd>180</TimeOut_cmd>
+    <EPC>calisson</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
     <eNB_working_dir>/tmp</eNB_working_dir>
-    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  N_RB_DL 50
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  uplink_frequency_offset -120000000
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  frame_type \"FDD\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_rx  1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_tx 1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth1\"
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  pdsch_referenceSignalPower -29
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.170.0.1\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth5:3\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.170.0.2/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth5:4\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.170.1.2/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args>
+    <eNB_pre_exec>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E  ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=21.0Mbits/sec average=22.0Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file>BUILD/EPC/epc.conf.in  MCC \"208\"
+                     BUILD/EPC/epc.conf.in  MNC \"92\"
+                     BUILD/EPC/epc.conf.in  TAC \"1\"
+                     BUILD/EPC/epc.conf.in  MME_INTERFACE_NAME_FOR_S1_MME \"eth5:1\"
+                     BUILD/EPC/epc.conf.in  MME_IPV4_ADDRESS_FOR_S1_MME  \"192.170.0.1/24\"
+                     BUILD/EPC/epc.conf.in   SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP    \"eth5:2\";
+                     BUILD/EPC/epc.conf.in   SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP       \"192.170.1.1/24\"; 
+                     BUILD/EPC/epc.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth5\"
+                     BUILD/EPC/epc.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\"
+                     BUILD/EPC/epc.conf.in   IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file>
+    <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog>
+    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
+    <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog>
+    <HSS_compile_prog_args> -c -l --debug --random false </HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth5 add 192.172.0.1 ;  cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc  </EPC_main_exec>
+    <EPC_main_exec_args> -i -r </EPC_main_exec_args>
+    <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db  </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo  -u -c  192.172.0.2 -b 10Mbits/s  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true></EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.OAI_EPC_local.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+   </testCase>
+
+   <testCase id="015605" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>calisson</eNB>
+    <UE>stevens</UE>
+    <EPC>calisson</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  pdsch_referenceSignalPower -29
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.170.0.1\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth5:3\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.170.0.2/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth5:4\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.170.1.2/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args>
+    <eNB_pre_exec>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E  ifconfig eth5:3 192.170.0.2 up ; sudo -E ifconfig eth5:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=42.0Mbits/sec average=44.0Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file>BUILD/EPC/epc.conf.in  MCC \"208\"
+                     BUILD/EPC/epc.conf.in  MNC \"92\"
+                     BUILD/EPC/epc.conf.in  TAC \"1\"
+                     BUILD/EPC/epc.conf.in  MME_INTERFACE_NAME_FOR_S1_MME \"eth5:1\"
+                     BUILD/EPC/epc.conf.in  MME_IPV4_ADDRESS_FOR_S1_MME  \"192.170.0.1/24\"
+                     BUILD/EPC/epc.conf.in   SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP    \"eth5:2\";
+                     BUILD/EPC/epc.conf.in   SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP       \"192.170.1.1/24\"; 
+                     BUILD/EPC/epc.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth5\"
+                     BUILD/EPC/epc.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\"
+                     BUILD/EPC/epc.conf.in   IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file>
+    <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog>
+    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
+    <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog>
+    <HSS_compile_prog_args> -c -l --debug --random false</HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth5 add 192.172.0.1 ;  cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc  </EPC_main_exec>
+    <EPC_main_exec_args> -i -r </EPC_main_exec_args>
+    <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db   </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo  -u -c  192.172.0.2 -b 10Mbits/s  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true></EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.OAI_EPC_local.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+   </testCase>
+
+  <testCase id="015700" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>calisson</eNB>
+    <UE>stevens</UE>
+    <EPC>nano</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  pdsch_referenceSignalPower -26
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args>
+    <eNB_pre_exec>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 7Mbits/s    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file>ETC/hss.conf MYSQL_user \"root\"
+                     ETC/hss.conf MYSQL_pass \"linux\"
+                     ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"92\";MME_GID=\"4\";MME_CODE=\"1\";}"
+                     ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"92\";TAC=\"1\";}" 
+                     ETC/mme.conf  MME_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+                     ETC/mme.conf  MME_IPV4_ADDRESS_FOR_S1_MME  \"192.168.12.62/24\"
+                     ETC/mme.conf  MME_INTERFACE_NAME_FOR_S11_MME   \"lo\"
+                     ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME        \"127.0.11.1/8\"
+                     ETC/mme.conf MME_PORT_FOR_S11_MME                   2123
+                     ETC/mme.conf  SGW_IPV4_ADDRESS_FOR_S11           \"127.0.11.2/8\"
+                     ETC/mme.conf  OUTPUT \"CONSOLE\"
+                     ETC/mme.conf  HSS_HOSTNAME \"hss\"
+                     ETC/mme_fd.conf Identity \"nano.openair4G.eur\"
+                     ETC/hss_fd.conf Identity \"hss.openair4G.eur\"
+                     ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11              \"lo\"
+                     ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11                \"127.0.11.2/8\"
+                     ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP      \"192.168.12.62/24\"
+                     ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP         2152
+                     ETC/spgw.conf PGW_IPV4_ADDRESS_FOR_SGI              \"192.168.12.62/24\"
+                     ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" </EPC_config_file>
+    <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai -vf; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiamter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ hss.openair4G.eur;  $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+c
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>sleep 10;$OPENAIRCN_DIR/TEST/autotests/tools/run_epc  </EPC_main_exec>
+    <EPC_main_exec_args>  </EPC_main_exec_args>
+    <HSS_main_exec>cp -vf $OPENAIRCN_DIR/ETC/*.conf $OPENAIRCN_TESTDIR/; $OPENAIRCN_DIR/SCRIPTS/run_hss  --export-db $OPENAIRCN_TESTDIR/hss_export.db  </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec    </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.OAI_EPC_remote.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+   </testCase>
+
+  <testCase id="015701" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>calisson</eNB>
+    <UE>stevens</UE>
+    <EPC>nano</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  pdsch_referenceSignalPower -29
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args>
+    <eNB_pre_exec>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 14Mbits/s    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file>ETC/hss.conf MYSQL_user \"root\"
+                     ETC/hss.conf MYSQL_pass \"linux\"
+                     ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"92\";MME_GID=\"4\";MME_CODE=\"1\";}"
+                     ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"92\";TAC=\"1\";}" 
+                     ETC/mme.conf  MME_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+                     ETC/mme.conf  MME_IPV4_ADDRESS_FOR_S1_MME  \"192.168.12.62/24\"
+                     ETC/mme.conf  MME_INTERFACE_NAME_FOR_S11_MME   \"lo\"
+                     ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME        \"127.0.11.1/8\"
+                     ETC/mme.conf MME_PORT_FOR_S11_MME                   2123
+                     ETC/mme.conf  SGW_IPV4_ADDRESS_FOR_S11           \"127.0.11.2/8\"
+                     ETC/mme.conf  OUTPUT \"CONSOLE\"
+                     ETC/mme.conf  HSS_HOSTNAME \"hss\"
+                     ETC/mme_fd.conf Identity \"nano.openair4G.eur\"
+                     ETC/hss_fd.conf Identity \"hss.openair4G.eur\"
+                     ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11              \"lo\"
+                     ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11                \"127.0.11.2/8\"
+                     ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP      \"192.168.12.62/24\"
+                     ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP         2152
+                     ETC/spgw.conf PGW_IPV4_ADDRESS_FOR_SGI              \"192.168.12.62/24\"
+                     ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" </EPC_config_file>
+    <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai -vf; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiamter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ hss.openair4G.eur;  $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+c
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>sleep 10;$OPENAIRCN_DIR/TEST/autotests/tools/run_epc  </EPC_main_exec>
+    <EPC_main_exec_args>  </EPC_main_exec_args>
+    <HSS_main_exec>cp -vf $OPENAIRCN_DIR/ETC/*.conf $OPENAIRCN_TESTDIR/; $OPENAIRCN_DIR/SCRIPTS/run_hss  --export-db $OPENAIRCN_TESTDIR/hss_export.db  </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec    </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.OAI_EPC_remote.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+   </testCase>
+
+  <testCase id="015702" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>calisson</eNB>
+    <UE>stevens</UE>
+    <EPC>nano</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  pdsch_referenceSignalPower -29
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args>
+    <eNB_pre_exec>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E  ifconfig eth0:3 192.170.0.2 up ; sudo -E ifconfig eth0:4 192.170.1.2 up; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf </eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 10Mbits/s    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file>ETC/hss.conf MYSQL_user \"root\"
+                     ETC/hss.conf MYSQL_pass \"linux\"
+                     ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"92\";MME_GID=\"4\";MME_CODE=\"1\";}"
+                     ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"92\";TAC=\"1\";}" 
+                     ETC/mme.conf  MME_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+                     ETC/mme.conf  MME_IPV4_ADDRESS_FOR_S1_MME  \"192.168.12.62/24\"
+                     ETC/mme.conf  MME_INTERFACE_NAME_FOR_S11_MME   \"lo\"
+                     ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME        \"127.0.11.1/8\"
+                     ETC/mme.conf MME_PORT_FOR_S11_MME                   2123
+                     ETC/mme.conf  SGW_IPV4_ADDRESS_FOR_S11           \"127.0.11.2/8\"
+                     ETC/mme.conf  OUTPUT \"CONSOLE\"
+                     ETC/mme.conf  HSS_HOSTNAME \"hss\"
+                     ETC/mme_fd.conf Identity \"nano.openair4G.eur\"
+                     ETC/hss_fd.conf Identity \"hss.openair4G.eur\"
+                     ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11              \"lo\"
+                     ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11                \"127.0.11.2/8\"
+                     ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP      \"192.168.12.62/24\"
+                     ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP         2152
+                     ETC/spgw.conf PGW_IPV4_ADDRESS_FOR_SGI              \"192.168.12.62/24\"
+                     ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" </EPC_config_file>
+    <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai -vf; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiamter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ hss.openair4G.eur;  $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+c
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>sleep 10;$OPENAIRCN_DIR/TEST/autotests/tools/run_epc  </EPC_main_exec>
+    <EPC_main_exec_args>  </EPC_main_exec_args>
+    <HSS_main_exec>cp -vf $OPENAIRCN_DIR/ETC/*.conf $OPENAIRCN_TESTDIR/; $OPENAIRCN_DIR/SCRIPTS/run_hss  --export-db $OPENAIRCN_TESTDIR/hss_export.db  </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec    </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.OAI_EPC_remote.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+   </testCase>
+
+  <testCase id="015703" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>calisson</eNB>
+    <UE>stevens</UE>
+    <EPC>nano</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  pdsch_referenceSignalPower -26
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args>
+    <eNB_pre_exec>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 10M -R </UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=9Mbits/sec average=9Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file>ETC/hss.conf MYSQL_user \"root\"
+                     ETC/hss.conf MYSQL_pass \"linux\"
+                     ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"92\";MME_GID=\"4\";MME_CODE=\"1\";}"
+                     ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"92\";TAC=\"1\";}" 
+                     ETC/mme.conf  MME_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+                     ETC/mme.conf  MME_IPV4_ADDRESS_FOR_S1_MME  \"192.168.12.62/24\"
+                     ETC/mme.conf  MME_INTERFACE_NAME_FOR_S11_MME   \"lo\"
+                     ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME        \"127.0.11.1/8\"
+                     ETC/mme.conf MME_PORT_FOR_S11_MME                   2123
+                     ETC/mme.conf  SGW_IPV4_ADDRESS_FOR_S11           \"127.0.11.2/8\"
+                     ETC/mme.conf  OUTPUT \"CONSOLE\"
+                     ETC/mme.conf  HSS_HOSTNAME \"hss\"
+                     ETC/mme_fd.conf Identity \"nano.openair4G.eur\"
+                     ETC/hss_fd.conf Identity \"hss.openair4G.eur\"
+                     ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11              \"lo\"
+                     ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11                \"127.0.11.2/8\"
+                     ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP      \"192.168.12.62/24\"
+                     ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP         2152
+                     ETC/spgw.conf PGW_IPV4_ADDRESS_FOR_SGI              \"192.168.12.62/24\"
+                     ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" </EPC_config_file>
+    <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai -vf; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiamter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ hss.openair4G.eur;  $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+c
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>sleep 10;$OPENAIRCN_DIR/TEST/autotests/tools/run_epc  </EPC_main_exec>
+    <EPC_main_exec_args>  </EPC_main_exec_args>
+    <HSS_main_exec>cp -vf $OPENAIRCN_DIR/ETC/*.conf $OPENAIRCN_TESTDIR/; $OPENAIRCN_DIR/SCRIPTS/run_hss  --export-db $OPENAIRCN_TESTDIR/hss_export.db  </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true></EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.OAI_EPC_remote.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+   </testCase>
+
+   <testCase id="015704" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>calisson</eNB>
+    <UE>stevens</UE>
+    <EPC>nano</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  pdsch_referenceSignalPower -29
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args>
+    <eNB_pre_exec>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 10M -R </UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=9Mbits/sec average=9Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file>ETC/hss.conf MYSQL_user \"root\"
+                     ETC/hss.conf MYSQL_pass \"linux\"
+                     ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"92\";MME_GID=\"4\";MME_CODE=\"1\";}"
+                     ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"92\";TAC=\"1\";}" 
+                     ETC/mme.conf  MME_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+                     ETC/mme.conf  MME_IPV4_ADDRESS_FOR_S1_MME  \"192.168.12.62/24\"
+                     ETC/mme.conf  MME_INTERFACE_NAME_FOR_S11_MME   \"lo\"
+                     ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME        \"127.0.11.1/8\"
+                     ETC/mme.conf MME_PORT_FOR_S11_MME                   2123
+                     ETC/mme.conf  SGW_IPV4_ADDRESS_FOR_S11           \"127.0.11.2/8\"
+                     ETC/mme.conf  OUTPUT \"CONSOLE\"
+                     ETC/mme.conf  HSS_HOSTNAME \"hss\"
+                     ETC/mme_fd.conf Identity \"nano.openair4G.eur\"
+                     ETC/hss_fd.conf Identity \"hss.openair4G.eur\"
+                     ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11              \"lo\"
+                     ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11                \"127.0.11.2/8\"
+                     ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP      \"192.168.12.62/24\"
+                     ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP         2152
+                     ETC/spgw.conf PGW_IPV4_ADDRESS_FOR_SGI              \"192.168.12.62/24\"
+                     ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" </EPC_config_file>
+    <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai -vf; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiamter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ hss.openair4G.eur;  $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+c
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>sleep 10;$OPENAIRCN_DIR/TEST/autotests/tools/run_epc  </EPC_main_exec>
+    <EPC_main_exec_args>  </EPC_main_exec_args>
+    <HSS_main_exec>cp -vf $OPENAIRCN_DIR/ETC/*.conf $OPENAIRCN_TESTDIR/; $OPENAIRCN_DIR/SCRIPTS/run_hss  --export-db $OPENAIRCN_TESTDIR/hss_export.db  </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true></EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.OAI_EPC_remote.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+   </testCase>
+
+   <testCase id="015705" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>calisson</eNB>
+    <UE>stevens</UE>
+    <EPC>nano</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  pdsch_referenceSignalPower -29
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args>
+    <eNB_pre_exec>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; ifconfig ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec> $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 9M -R </UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=9Mbits/sec average=9Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file>ETC/hss.conf MYSQL_user \"root\"
+                     ETC/hss.conf MYSQL_pass \"linux\"
+                     ETC/mme.conf GUMMEI_LIST "{MCC=\"208\";MNC=\"92\";MME_GID=\"4\";MME_CODE=\"1\";}"
+                     ETC/mme.conf TAI_LIST "{MCC=\"208\";MNC=\"92\";TAC=\"1\";}" 
+                     ETC/mme.conf  MME_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+                     ETC/mme.conf  MME_IPV4_ADDRESS_FOR_S1_MME  \"192.168.12.62/24\"
+                     ETC/mme.conf  MME_INTERFACE_NAME_FOR_S11_MME   \"lo\"
+                     ETC/mme.conf MME_IPV4_ADDRESS_FOR_S11_MME        \"127.0.11.1/8\"
+                     ETC/mme.conf MME_PORT_FOR_S11_MME                   2123
+                     ETC/mme.conf  SGW_IPV4_ADDRESS_FOR_S11           \"127.0.11.2/8\"
+                     ETC/mme.conf  OUTPUT \"CONSOLE\"
+                     ETC/mme.conf  HSS_HOSTNAME \"hss\"
+                     ETC/mme_fd.conf Identity \"nano.openair4G.eur\"
+                     ETC/hss_fd.conf Identity \"hss.openair4G.eur\"
+                     ETC/spgw.conf SGW_INTERFACE_NAME_FOR_S11              \"lo\"
+                     ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S11                \"127.0.11.2/8\"
+                     ETC/spgw.conf SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP      \"192.168.12.62/24\"
+                     ETC/spgw.conf SGW_IPV4_PORT_FOR_S1U_S12_S4_UP         2152
+                     ETC/spgw.conf PGW_IPV4_ADDRESS_FOR_SGI              \"192.168.12.62/24\"
+                     ETC/spgw.conf IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\" </EPC_config_file>
+    <EPC_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiameter; sudo cp -vf $OPENAIRCN_DIR/ETC/mme.conf /usr/local/etc/oai/ ; sudo cp -vf $OPENAIRCN_DIR/ETC/mme_fd.conf /usr/local/etc/oai/freeDiameter; sudo cp $OPENAIRCN_DIR/ETC/spgw.conf /usr/local/etc/oai -vf; $OPENAIRCN_DIR/SCRIPTS/./check_mme_s6a_certificate /usr/local/etc/oai/freeDiameter/ nano.openair4G.eur ; $OPENAIRCN_DIR/SCRIPTS/build_mme -c ; $OPENAIRCN_DIR/SCRIPTS/build_spgw -c </EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog>sudo mkdir -p /usr/local/etc/oai/freeDiamter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ hss.openair4G.eur;  $OPENAIRCN_DIR/SCRIPTS/build_hss -c </HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+c
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>sleep 10;$OPENAIRCN_DIR/TEST/autotests/tools/run_epc  </EPC_main_exec>
+    <EPC_main_exec_args>  </EPC_main_exec_args>
+    <HSS_main_exec>cp -vf $OPENAIRCN_DIR/ETC/*.conf $OPENAIRCN_TESTDIR/; $OPENAIRCN_DIR/SCRIPTS/run_hss  --export-db $OPENAIRCN_TESTDIR/hss_export.db  </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true></EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.OAI_EPC_remote.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+   </testCase>
+
+
+  <testCase id="015800" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 7Mbits/s    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -f m -u</EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPx310.ALU_EPC.Bandrich.5MHz.FDD.UDP.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+
+  <testCase id="015801" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0  -u -c  192.172.0.1 -b 14Mbits/s    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPx310.ALU_EPC.Bandrich.10MHz.FDD.UDP.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="015802" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0  -u -c  192.172.0.1 -b 17Mbits/s    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script  5 lo -s -i 1 -u -f m  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPx310.ALU_EPC.Bandrich.20MHz.FDD.UDP.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="015803" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s  -i 1 -u -f m </UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -i 1 -u -f m -b 16M </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPx310.ALU_EPC.Bandrich.5MHz.FDD.UDP.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="015804" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec>
+    <eNB_pre_exec_args>sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m </UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -b 33Mbits/s -i 1 -f m -u     </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPx310.ALU_EPC.Bandrich.10MHz.FDD.UDP.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="015805" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m </UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -u -c  192.172.0.2 -b 10Mbits/s     </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPx310.ALU_EPC.Bandrich.20MHz.FDD.UDP.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="015806" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0  -c  192.172.0.1  -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -f m </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPx310.ALU_EPC.Bandrich.5MHz.FDD.TCP.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+
+  <testCase id="015807" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0   -c  192.172.0.1   -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1  -f m  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPx310.ALU_EPC.Bandrich.10MHz.FDD.TCP.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="015808" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0  -c  192.172.0.1    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script  5 lo -s -i 1  -f m  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPx310.ALU_EPC.Bandrich.20MHz.FDD.TCP.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="015809" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1  -f m </UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -i 1  -f m </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPx310.ALU_EPC.Bandrich.5MHz.FDD.TCP.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="015810" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec>
+    <eNB_pre_exec_args>sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1  -f m </UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -i 1  -f m  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPx310.ALU_EPC.Bandrich.10MHz.FDD.TCP.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="015811" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1  -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 75 lo -c  192.172.0.2     </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPx310.ALU_EPC.Bandrich.20MHz.FDD.TCP.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+
+
+  <testCase id="016000" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>nano</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ;  sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 10Mbits/s    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file>BUILD/EPC/epc.conf.in  MCC \"208\"
+                     BUILD/EPC/epc.conf.in  MNC \"92\"
+                     BUILD/EPC/epc.conf.in  TAC \"1\"
+                     BUILD/EPC/epc.conf.in  MME_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+                     BUILD/EPC/epc.conf.in  MME_IPV4_ADDRESS_FOR_S1_MME  \"192.168.12.62/24\"
+                     BUILD/EPC/epc.conf.in   SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP    \"eth0\";
+                     BUILD/EPC/epc.conf.in   SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP       \"192.168.12.62/24\"; 
+                     BUILD/EPC/epc.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth0\"
+                     BUILD/EPC/epc.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\"
+                     BUILD/EPC/epc.conf.in   IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file>
+    <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog>
+    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
+    <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog>
+    <HSS_compile_prog_args> -c -l --debug --random false  </HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc  </EPC_main_exec>
+    <EPC_main_exec_args> -r </EPC_main_exec_args>
+    <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db    </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec    </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPx310.OAI_EPC_remote.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+   </testCase>
+
+
+
+  <testCase id="016001" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>nano</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 10Mbits/s    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file>BUILD/EPC/epc.conf.in  MCC \"208\"
+                     BUILD/EPC/epc.conf.in  MNC \"92\"
+                     BUILD/EPC/epc.conf.in  TAC \"1\"
+                     BUILD/EPC/epc.conf.in  MME_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+                     BUILD/EPC/epc.conf.in  MME_IPV4_ADDRESS_FOR_S1_MME  \"192.168.12.62/24\"
+                     BUILD/EPC/epc.conf.in   SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP    \"eth0\";
+                     BUILD/EPC/epc.conf.in   SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP       \"192.168.12.62/24\"; 
+                     BUILD/EPC/epc.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth0\"
+                     BUILD/EPC/epc.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\"
+                     BUILD/EPC/epc.conf.in   IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file>
+    <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog>
+    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
+    <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog>
+    <HSS_compile_prog_args> -c -l  --debug --random false </HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in </EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc  </EPC_main_exec>
+    <EPC_main_exec_args> -r </EPC_main_exec_args>
+    <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db  </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec    </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPx310.OAI_EPC_remote.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+   </testCase>
+
+  <testCase id="016002" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>nano</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 10Mbits/s    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file>BUILD/EPC/epc.conf.in  MCC \"208\"
+                     BUILD/EPC/epc.conf.in  MNC \"92\"
+                     BUILD/EPC/epc.conf.in  TAC \"1\"
+                     BUILD/EPC/epc.conf.in  MME_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+                     BUILD/EPC/epc.conf.in  MME_IPV4_ADDRESS_FOR_S1_MME  \"192.168.12.62/24\"
+                     BUILD/EPC/epc.conf.in   SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP    \"eth0\";
+                     BUILD/EPC/epc.conf.in   SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP       \"192.168.12.62/24\"; 
+                     BUILD/EPC/epc.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth0\"
+                     BUILD/EPC/epc.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\"
+                     BUILD/EPC/epc.conf.in   IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file>
+    <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog>
+    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
+    <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog>
+    <HSS_compile_prog_args> -c -l --debug --random false</HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc  </EPC_main_exec>
+    <EPC_main_exec_args> -r </EPC_main_exec_args>
+    <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss  --export-db $OPENAIRCN_TESTDIR/hss_export.db   </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec    </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPx310.OAI_EPC_remote.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+   </testCase>
+
+  <testCase id="016003" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>nano</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>throughput_test min=00.0Mbits/sec max=10.5Mbits/sec average=11.0Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file>BUILD/EPC/epc.conf.in  MCC \"208\"
+                     BUILD/EPC/epc.conf.in  MNC \"92\"
+                     BUILD/EPC/epc.conf.in  TAC \"1\"
+                     BUILD/EPC/epc.conf.in  MME_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+                     BUILD/EPC/epc.conf.in  MME_IPV4_ADDRESS_FOR_S1_MME  \"192.168.12.62/24\"
+                     BUILD/EPC/epc.conf.in   SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP    \"eth0\";
+                     BUILD/EPC/epc.conf.in   SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP       \"192.168.12.62/24\"; 
+                     BUILD/EPC/epc.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth0\"
+                     BUILD/EPC/epc.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\"
+                     BUILD/EPC/epc.conf.in   IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file>
+    <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog>
+    <EPC_compile_prog_args>-c -l </EPC_compile_prog_args>
+    <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog>
+    <HSS_compile_prog_args> -c -l --debug --random false  </HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc  </EPC_main_exec>
+    <EPC_main_exec_args>  -r </EPC_main_exec_args>
+    <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss  --export-db $OPENAIRCN_TESTDIR/hss_export.db   </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo  -u -c  192.172.0.2 -b 10Mbits/s     </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true></EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPx310.OAI_EPC_remote.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+   </testCase>
+
+   <testCase id="016004" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>nano</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>sleep 15;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ;  sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec>
+    <eNB_pre_exec_args>sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail</eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf   </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=21.0Mbits/sec average=22.0Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue</UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file>BUILD/EPC/epc.conf.in  MCC \"208\"
+                     BUILD/EPC/epc.conf.in  MNC \"92\"
+                     BUILD/EPC/epc.conf.in  TAC \"1\"
+                     BUILD/EPC/epc.conf.in  MME_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+                     BUILD/EPC/epc.conf.in  MME_IPV4_ADDRESS_FOR_S1_MME  \"192.168.12.62/24\"
+                     BUILD/EPC/epc.conf.in   SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP    \"eth0\";
+                     BUILD/EPC/epc.conf.in   SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP       \"192.168.12.62/24\"; 
+                     BUILD/EPC/epc.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth0\"
+                     BUILD/EPC/epc.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\"
+                     BUILD/EPC/epc.conf.in   IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file>
+    <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog>
+    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
+    <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog>
+    <HSS_compile_prog_args> -c -l --debug --random false</HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth0 add 192.172.0.1 ;  cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc  </EPC_main_exec>
+    <EPC_main_exec_args> -r </EPC_main_exec_args>
+    <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo  -u -c  192.172.0.2 -b 10Mbits/s     </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true></EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPx310.OAI_EPC_remote.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+   </testCase>
+
+   <testCase id="016005" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>nano</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ;  sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=21.0Mbits/sec average=22.0Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file>BUILD/EPC/epc.conf.in  MCC \"208\"
+                     BUILD/EPC/epc.conf.in  MNC \"92\"
+                     BUILD/EPC/epc.conf.in  TAC \"1\"
+                     BUILD/EPC/epc.conf.in  MME_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+                     BUILD/EPC/epc.conf.in  MME_IPV4_ADDRESS_FOR_S1_MME  \"192.168.12.62/24\"
+                     BUILD/EPC/epc.conf.in   SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP    \"eth0\";
+                     BUILD/EPC/epc.conf.in   SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP       \"192.168.12.62/24\"; 
+                     BUILD/EPC/epc.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth0\"
+                     BUILD/EPC/epc.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\"
+                     BUILD/EPC/epc.conf.in   IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file>
+    <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog>
+    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
+    <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog>
+    <HSS_compile_prog_args> -c -l --debug --random false </HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc  </EPC_main_exec>
+    <EPC_main_exec_args> -r </EPC_main_exec_args>
+    <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db   </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo  -u -c  192.172.0.2 -b 10Mbits/s     </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true></EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPx310.OAI_EPC_remote.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+   </testCase>
+
+  <testCase id="016100" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>calisson</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf   ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; dmesg|tail </eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 7Mbits/s    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>EXMIMO.ALU_EPC.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+
+  <testCase id="016101" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>calisson</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_tx 1                     
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf   ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2 ; dmesg|tail</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 14Mbits/s    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>EXMIMO.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="016102" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>calisson</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf   ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2 ; dmesg|tail</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 10Mbits/s    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>EXMIMO.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="016103" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>calisson</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf   ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2 ; dmesg|tail</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 10M -R</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m     </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>EXMIMO.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="016104" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>calisson</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf   ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2 ; dmesg|tail</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf   </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script 1 ppp0 -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 20M -R</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m   </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>EXMIMO.ALU_EPC.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="016105" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>calisson</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_tx 1                     
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf   ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2 ; dmesg|tail</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c  192.172.0.2 -b 10Mbits/s     </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>EXMIMO.ALU_EPC.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+
+
+  <testCase id="016300" >
+   <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>calisson</eNB>
+    <UE>stevens</UE>
+    <EPC>nano</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf   ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>sleep 15;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ;  sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  $OPENAIR_TESTDIR/enb.conf </eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 10Mbits/s    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file>BUILD/EPC/epc.conf.in  MCC \"208\"
+                     BUILD/EPC/epc.conf.in  MNC \"92\"
+                     BUILD/EPC/epc.conf.in  TAC \"1\"
+                     BUILD/EPC/epc.conf.in  MME_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+                     BUILD/EPC/epc.conf.in  MME_IPV4_ADDRESS_FOR_S1_MME  \"192.168.12.62/24\"
+                     BUILD/EPC/epc.conf.in   SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP    \"eth0\";
+                     BUILD/EPC/epc.conf.in   SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP       \"192.168.12.62/24\"; 
+                     BUILD/EPC/epc.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth0\"
+                     BUILD/EPC/epc.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\"
+                     BUILD/EPC/epc.conf.in   IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file>
+    <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog>
+    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
+    <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog>
+    <HSS_compile_prog_args> -c -l --debug --random false </HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1 ;cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc  </EPC_main_exec>
+    <EPC_main_exec_args> -r </EPC_main_exec_args>
+    <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec    </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>EXMIMO.OAI_EPC_remote.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+   </testCase>
+
+
+
+  <testCase id="016301" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>calisson</eNB>
+    <UE>stevens</UE>
+    <EPC>nano</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_tx 1                     
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf   ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ;  sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2 ; dmesg|tail; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 10Mbits/s    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file>BUILD/EPC/epc.conf.in  MCC \"208\"
+                     BUILD/EPC/epc.conf.in  MNC \"92\"
+                     BUILD/EPC/epc.conf.in  TAC \"1\"
+                     BUILD/EPC/epc.conf.in  MME_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+                     BUILD/EPC/epc.conf.in  MME_IPV4_ADDRESS_FOR_S1_MME  \"192.168.12.62/24\"
+                     BUILD/EPC/epc.conf.in   SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP    \"eth0\";
+                     BUILD/EPC/epc.conf.in   SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP       \"192.168.12.62/24\"; 
+                     BUILD/EPC/epc.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth0\"
+                     BUILD/EPC/epc.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\"
+                     BUILD/EPC/epc.conf.in   IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file>
+    <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog>
+    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
+    <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog>
+    <HSS_compile_prog_args> -c -l --debug --random false </HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc  </EPC_main_exec>
+    <EPC_main_exec_args> -r </EPC_main_exec_args>
+    <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec    </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>EXMIMO.OAI_EPC_remote.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+   </testCase>
+
+  <testCase id="016302" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>calisson</eNB>
+    <UE>stevens</UE>
+    <EPC>nano</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf   ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>sleep 15;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ;  sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2 ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 10Mbits/s    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue</UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file>BUILD/EPC/epc.conf.in  MCC \"208\"
+                     BUILD/EPC/epc.conf.in  MNC \"92\"
+                     BUILD/EPC/epc.conf.in  TAC \"1\"
+                     BUILD/EPC/epc.conf.in  MME_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+                     BUILD/EPC/epc.conf.in  MME_IPV4_ADDRESS_FOR_S1_MME  \"192.168.12.62/24\"
+                     BUILD/EPC/epc.conf.in   SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP    \"eth0\";
+                     BUILD/EPC/epc.conf.in   SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP       \"192.168.12.62/24\"; 
+                     BUILD/EPC/epc.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth0\"
+                     BUILD/EPC/epc.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\"
+                     BUILD/EPC/epc.conf.in   IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file>
+    <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog>
+    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
+    <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog>
+    <HSS_compile_prog_args> -c -l --debug --random false  </HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc  </EPC_main_exec>
+    <EPC_main_exec_args> -r </EPC_main_exec_args>
+    <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db   </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec    </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>EXMIMO.OAI_EPC_remote.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+   </testCase>
+
+  <testCase id="016303" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>calisson</eNB>
+    <UE>stevens</UE>
+    <EPC>nano</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf   ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>sleep 15;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ;  sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2 ; dmesg|tail; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>throughput_test min=00.0Mbits/sec max=10.5Mbits/sec average=11.0Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file>BUILD/EPC/epc.conf.in  MCC \"208\"
+                     BUILD/EPC/epc.conf.in  MNC \"92\"
+                     BUILD/EPC/epc.conf.in  TAC \"1\"
+                     BUILD/EPC/epc.conf.in  MME_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+                     BUILD/EPC/epc.conf.in  MME_IPV4_ADDRESS_FOR_S1_MME  \"192.168.12.62/24\"
+                     BUILD/EPC/epc.conf.in   SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP    \"eth0\";
+                     BUILD/EPC/epc.conf.in   SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP       \"192.168.12.62/24\"; 
+                     BUILD/EPC/epc.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth0\"
+                     BUILD/EPC/epc.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\"
+                     BUILD/EPC/epc.conf.in   IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file>
+    <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog>
+    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
+    <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog>
+    <HSS_compile_prog_args> -c -l  --debug --random false </HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth0 add 192.172.0.1 ;cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc  </EPC_main_exec>
+    <EPC_main_exec_args>  -r </EPC_main_exec_args>
+    <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db  </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo  -u -c  192.172.0.2 -b 10Mbits/s     </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true></EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>EXMIMO.OAI_EPC_remote.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+   </testCase>
+
+   <testCase id="016304" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>calisson</eNB>
+    <UE>stevens</UE>
+    <EPC>nano</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf   ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>sleep 15;$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ;  sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2 ; dmesg|tail; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf   </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=21.0Mbits/sec average=22.0Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue</UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file>BUILD/EPC/epc.conf.in  MCC \"208\"
+                     BUILD/EPC/epc.conf.in  MNC \"92\"
+                     BUILD/EPC/epc.conf.in  TAC \"1\"
+                     BUILD/EPC/epc.conf.in  MME_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+                     BUILD/EPC/epc.conf.in  MME_IPV4_ADDRESS_FOR_S1_MME  \"192.168.12.62/24\"
+                     BUILD/EPC/epc.conf.in   SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP    \"eth0\";
+                     BUILD/EPC/epc.conf.in   SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP       \"192.168.12.62/24\"; 
+                     BUILD/EPC/epc.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth0\"
+                     BUILD/EPC/epc.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\"
+                     BUILD/EPC/epc.conf.in   IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file>
+    <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog>
+    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
+    <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog>
+    <HSS_compile_prog_args> -c -l --debug --random false </HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth0 add 192.172.0.1 ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc  </EPC_main_exec>
+    <EPC_main_exec_args> -r </EPC_main_exec_args>
+    <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss --export-db $OPENAIRCN_TESTDIR/hss_export.db   </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo  -u -c  192.172.0.2 -b 10Mbits/s     </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true></EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>EXMIMO.OAI_EPC_remote.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+   </testCase>
+
+   <testCase id="016305" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>calisson</eNB>
+    <UE>stevens</UE>
+    <EPC>nano</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_tx 1                     
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth5\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth5\"
                      targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf   ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
                      targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
     <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
-    <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args>
-    <eNB_pre_exec>sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail</eNB_pre_exec>
+    <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  ; sudo -E -S $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2 ; dmesg|tail; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  $OPENAIR_TESTDIR/enb.conf</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=21.0Mbits/sec average=22.0Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file>BUILD/EPC/epc.conf.in  MCC \"208\"
+                     BUILD/EPC/epc.conf.in  MNC \"92\"
+                     BUILD/EPC/epc.conf.in  TAC \"1\"
+                     BUILD/EPC/epc.conf.in  MME_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+                     BUILD/EPC/epc.conf.in  MME_IPV4_ADDRESS_FOR_S1_MME  \"192.168.12.62/24\"
+                     BUILD/EPC/epc.conf.in   SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP    \"eth0\";
+                     BUILD/EPC/epc.conf.in   SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP       \"192.168.12.62/24\"; 
+                     BUILD/EPC/epc.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth0\"
+                     BUILD/EPC/epc.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\"
+                     BUILD/EPC/epc.conf.in   IPV4_LIST \"192.172.0.0/24\",\"192.172.1.0/24\"</EPC_config_file>
+    <EPC_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_epc</EPC_compile_prog>
+    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
+    <HSS_compile_prog>$OPENAIRCN_DIR/SCRIPTS/build_hss</HSS_compile_prog>
+    <HSS_compile_prog_args> -c -l  --debug --random false</HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ;sudo -E ifconfig eth0 add 192.172.0.1</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>$OPENAIRCN_DIR/SCRIPTS/run_epc  </EPC_main_exec>
+    <EPC_main_exec_args> -r </EPC_main_exec_args>
+    <HSS_main_exec>sleep 10; $OPENAIRCN_DIR/SCRIPTS/run_hss  --export-db $OPENAIRCN_TESTDIR/hss_export.db   </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo  -u -c  192.172.0.2 -b 10Mbits/s     ; cp $OPENAIRCN_DIR/BUILD/EPC/epc.conf.in $OPENAIRCN_TESTDIR/epc.conf.in</EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true></EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>EXMIMO.OAI_EPC_remote.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+   </testCase>
+
+
+  <testCase id="016500" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  pdsch_referenceSignalPower -26
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w BLADERF -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 10Mbits/s    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>BladeRF.ALU_EPC.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+
+  <testCase id="016501" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  pdsch_referenceSignalPower -29
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w BLADERF -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  </eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 10Mbits/s    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>BladeRF.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="016502" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  pdsch_referenceSignalPower -32
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w BLADERF -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  </eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 10Mbits/s    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>BladeRF.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="016503" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  pdsch_referenceSignalPower -26
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w BLADERF -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  </eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo  -u -c  192.172.0.2 -b 10Mbits/s     </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>BladeRF.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="016504" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  pdsch_referenceSignalPower -29
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w BLADERF -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash </eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c  192.172.0.2 -b 10Mbits/s     </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>BladeRF.ALU_EPC.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="016505" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  pdsch_referenceSignalPower -32
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w BLADERF -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash  </eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c  192.172.0.2 -b 10Mbits/s     </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>BladeRF.ALU_EPC.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="017000" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  tx_gain 60
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  rx_gain 111
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  pdsch_referenceSignalPower -26
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w LMSSDR -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf --rf-config-file $OPENAIR_DIR/targets/ARCH/LMSSDR/enb_sodera_highband_5MHz_rx19dB_txfull.ini   </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 10Mbits/s    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>LMSSDR.ALU_EPC.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+
+  <testCase id="017001" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  tx_gain 60
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  rx_gain 111
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  pdsch_referenceSignalPower -26
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w LMSSDR -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  --rf-config-file    $OPENAIR_DIR/targets/ARCH/LMSSDR/enb_sodera_highband_10MHz_rx19dB_txfull.ini   </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 10Mbits/s    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>LMSSDR.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="017002" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  tx_gain 60
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  rx_gain 111
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  pdsch_referenceSignalPower -26
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w LMSSDR -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf     --rf-config-file $OPENAIR_DIR/targets/ARCH/LMSSDR/enb_sodera_highband_20MHz_rx19dB_txfull.ini </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 10Mbits/s    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>LMSSDR.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="017003" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  tx_gain 60
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  rx_gain 111
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  pdsch_referenceSignalPower -29
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w LMSSDR -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf    --rf-config-file $OPENAIR_DIR/targets/ARCH/LMSSDR/enb_sodera_highband_5MHz_rx19dB_txfull.ini </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo  -u -c  192.172.0.2 -b 10Mbits/s     </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>LMSSDR.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="017004" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  tx_gain 60
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  rx_gain 111
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  pdsch_referenceSignalPower -29
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w LMSSDR -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf    --rf-config-file $OPENAIR_DIR/targets/ARCH/LMSSDR/enb_sodera_highband_10MHz_rx19dB_txfull.ini</eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c  192.172.0.2 -b 10Mbits/s     </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>SoDeRa.ALU_EPC.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="017005" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  tx_gain 60
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  rx_gain 111
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  pdsch_referenceSignalPower -29
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w LMSSDR -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf     --rf-config-file $OPENAIR_DIR/targets/ARCH/LMSSDR/enb_sodera_highband_20MHz_rx19dB_txfull.ini</eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c  192.172.0.2 -b 10Mbits/s     </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>SoDeRa.ALU_EPC.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="017500" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <RRH>calisson</RRH>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <eNB>mozart</eNB>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  pdsch_referenceSignalPower  -26
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_PORT_FOR_S1U                     2152
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  rrh_gw_config   "local_if_name=\"eth0\";remote_address=\"10:60:4b:75:80:83\";local_address=\"98:90:96:df:66:07\";local_port=50000;remote_port=50000;tr_preference=\"raw\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=70;tx_scheduling_advance=9;rrh_gw_active=\"yes\";"</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w None -t ETHERNET -x -c --disable-deadline </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>sleep 5; sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf   </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <RRH_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</RRH_compile_prog>
+    <RRH_compile_prog_args>--RRH -w USRP -t ETHERNET -c --disable-deadline </RRH_compile_prog_args>
+    <RRH_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</RRH_pre_exec>
+    <RRH_pre_exec_args></RRH_pre_exec_args>
+    <RRH_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw</RRH_main_exec>
+    <RRH_main_exec_args> -n1 -x -m1 -i eth1 </RRH_main_exec_args>
+    <RRH_terminate_missing_procs>False</RRH_terminate_missing_procs>
+
+
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 10Mbits/s    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.RRH.ALU_EPC.Bandrich.5MHz.FDD.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+
+  <testCase id="017501" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <RRH>calisson</RRH>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  pdsch_referenceSignalPower  -29
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_PORT_FOR_S1U                     2152
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  rrh_gw_config   "local_if_name=\"eth0\";remote_address=\"10:60:4b:75:80:83\";local_address=\"98:90:96:df:66:07\";local_port=50000;remote_port=50000;tr_preference=\"raw\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=113;tx_scheduling_advance=9;rrh_gw_active=\"yes\";"</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w None -t ETHERNET -x -c --disable-deadline </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>sleep 5; sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf   </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <RRH_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</RRH_compile_prog>
+    <RRH_compile_prog_args>--RRH -w USRP -t ETHERNET -c --disable-deadline </RRH_compile_prog_args>
+    <RRH_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</RRH_pre_exec>
+    <RRH_pre_exec_args></RRH_pre_exec_args>
+    <RRH_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw</RRH_main_exec>
+    <RRH_main_exec_args> -n1 -x -m1 -i eth1 </RRH_main_exec_args>
+    <RRH_terminate_missing_procs>False</RRH_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 10Mbits/s    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.RRH.ALU_EPC.Bandrich.10MHz.FDD.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="017502" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <RRH>calisson</RRH>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  pdsch_referenceSignalPower  -32
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_PORT_FOR_S1U                     2152
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  rrh_gw_config   "local_if_name=\"eth0\";remote_address=\"10:60:4b:75:80:83\";local_address=\"98:90:96:df:66:07\";local_port=50000;remote_port=50000;tr_preference=\"raw\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=115;tx_scheduling_advance=11;rrh_gw_active=\"yes\";"</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w None -t ETHERNET -x -c --disable-deadline </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>sleep 5; sudo -E chrt -f 99  $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf   </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <RRH_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</RRH_compile_prog>
+    <RRH_compile_prog_args>--RRH -w USRP -t ETHERNET -c --disable-deadline </RRH_compile_prog_args>
+    <RRH_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</RRH_pre_exec>
+    <RRH_pre_exec_args></RRH_pre_exec_args>
+    <RRH_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw</RRH_main_exec>
+    <RRH_main_exec_args> -n1 -x -m1 -i eth1 </RRH_main_exec_args>
+    <RRH_terminate_missing_procs>False</RRH_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -u -c  192.172.0.1 -b 10Mbits/s    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.RRH.ALU_EPC.Bandrich.20MHz.FDD.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="017503" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <RRH>calisson</RRH>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  pdsch_referenceSignalPower  -26
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_PORT_FOR_S1U                     2152
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  rrh_gw_config   "local_if_name=\"eth0\";remote_address=\"10:60:4b:75:80:83\";local_address=\"98:90:96:df:66:07\";local_port=50000;remote_port=50000;tr_preference=\"raw\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=70;tx_scheduling_advance=9;rrh_gw_active=\"yes\";"</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w None -t ETHERNET -x -c --disable-deadline </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>sleep 5; sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf   </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <RRH_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</RRH_compile_prog>
+    <RRH_compile_prog_args>--RRH -w USRP -t ETHERNET -c --disable-deadline </RRH_compile_prog_args>
+    <RRH_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</RRH_pre_exec>
+    <RRH_pre_exec_args></RRH_pre_exec_args>
+    <RRH_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw</RRH_main_exec>
+    <RRH_main_exec_args> -n1 -x -m1 -i eth1 </RRH_main_exec_args>
+    <RRH_terminate_missing_procs>False</RRH_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo  -u -c  192.172.0.2 -b 10Mbits/s     </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.RRH.ALU_EPC.Bandrich.5MHz.FDD.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="017504" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <RRH>calisson</RRH>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  pdsch_referenceSignalPower  -29
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_PORT_FOR_S1U                     2152
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  rrh_gw_config   "local_if_name=\"eth0\";remote_address=\"10:60:4b:75:80:83\";local_address=\"98:90:96:df:66:07\";local_port=50000;remote_port=50000;tr_preference=\"raw\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=113;tx_scheduling_advance=9;rrh_gw_active=\"yes\";"</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w None -t ETHERNET -x -c --disable-deadline </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>sleep 5; sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf   </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <RRH_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</RRH_compile_prog>
+    <RRH_compile_prog_args>--RRH -w USRP -t ETHERNET -c --disable-deadline </RRH_compile_prog_args>
+    <RRH_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</RRH_pre_exec>
+    <RRH_pre_exec_args></RRH_pre_exec_args>
+    <RRH_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw</RRH_main_exec>
+    <RRH_main_exec_args> -n1 -x -m1 -i eth1 </RRH_main_exec_args>
+    <RRH_terminate_missing_procs>False</RRH_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c  192.172.0.2 -b 10Mbits/s     </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.RRH.ALU_EPC.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="017505" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <RRH>calisson</RRH>
+    <eNB>mozart</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  pdsch_referenceSignalPower  -32
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth6\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.111/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  ENB_PORT_FOR_S1U                     2152
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf  rrh_gw_config   "local_if_name=\"eth0\";remote_address=\"10:60:4b:75:80:83\";local_address=\"98:90:96:df:66:07\";local_port=50000;remote_port=50000;tr_preference=\"raw\";rf_preference=\"usrp_b200\";iq_txshift=4;tx_sample_advance=115;tx_scheduling_advance=11;rrh_gw_active=\"yes\";"</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w None -t ETHERNET -x -c --disable-deadline </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>sleep 5; $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf   </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <RRH_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</RRH_compile_prog>
+    <RRH_compile_prog_args>--RRH -w USRP -t ETHERNET -c --disable-deadline </RRH_compile_prog_args>
+    <RRH_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</RRH_pre_exec>
+    <RRH_pre_exec_args></RRH_pre_exec_args>
+    <RRH_main_exec>sudo -E chrt -f 99 $OPENAIR_DIR/cmake_targets/rrh_gw/build/rrh_gw</RRH_main_exec>
+    <RRH_main_exec_args> -n1 -x -m1 -i eth1 </RRH_main_exec_args>
+    <RRH_terminate_missing_procs>False</RRH_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 10; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script 1 ppp0 -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>throughput_test min=00.0Mbits/sec max=10.0Mbits/sec average=10.0Mbits/sec   </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue </UE_stop_script>
+
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c  192.172.0.2 -b 15Mbits/s     </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.RRH.ALU_EPC.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+
+  <testCase id="025500" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>hutch</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue  </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c  192.172.0.1 -b 7Mbits/s    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=5.0Mbits/sec average=5.0Mbits/sec   </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.SonyExperiaM4.5MHz.FDD.UDP.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+
+  <testCase id="025501" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>hutch</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue  </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c  192.172.0.1 -b 14Mbits/s    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=00.0Mbits/sec max=10.0Mbits/sec average=10.0Mbits/sec   </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.SonyExperiaM4.10MHz.FDD.UDP.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="025502" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>hutch</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
     <eNB_pre_exec_args></eNB_pre_exec_args>
-    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
-    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf </eNB_main_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf   -E  </eNB_main_exec_args>
     <eNB_traffic_exec></eNB_traffic_exec>
     <eNB_traffic_exec_args></eNB_traffic_exec_args>
     <eNB_search_expr_true></eNB_search_expr_true>
     <eNB_search_expr_false></eNB_search_expr_false>
-    <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
 
     <UE_working_dir>/tmp</UE_working_dir>
-    <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"4\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"5\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"6\"</UE_config_file>
-    <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
-    <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args>
-    <UE_pre_exec></UE_pre_exec>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
     <UE_pre_exec_args></UE_pre_exec_args>
-    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue  </UE_main_exec>
     <UE_main_exec_args></UE_main_exec_args>
-    <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5;   iperf -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c  192.172.0.1 -b 10Mbits/s    -B 192.172.0.2</UE_traffic_exec>
     <UE_traffic_exec_args></UE_traffic_exec_args>
-    <UE_terminate_missing_procs>True</UE_terminate_missing_procs>
-    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script>
-    <UE_search_expr_true>throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec duration=60.0s </UE_search_expr_true>
+    <UE_search_expr_true></UE_search_expr_true>
     <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue </UE_stop_script>
 
     <EPC_working_dir>/tmp</EPC_working_dir>
-    <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.local.enb.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.local.enb.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file>
-    <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
-    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
-    <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
-    <HSS_compile_prog_args> -c -l </HSS_compile_prog_args>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
 
-    <EPC_pre_exec></EPC_pre_exec>
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
     <EPC_pre_exec_args></EPC_pre_exec_args>
     <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
     <EPC_main_exec_args></EPC_main_exec_args>
     <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
     <HSS_main_exec_args></HSS_main_exec_args>
-    <EPC_traffic_exec>sleep 60; iperf -u -c  192.172.0.2 -b 10Mbits/s -t 120 -B 192.172.0.1</EPC_traffic_exec>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m  </EPC_traffic_exec>
     <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
     <EPC_search_expr_false></EPC_search_expr_false>
-    <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
-    <tags>EXMIMO.ALU_EPC.Bandrich.10MHz.FDD.Band_7.DL.1TX.1RX</tags>
-    <nruns>3</nruns>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.SonyExperiaM4.20MHz.FDD.UDP.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
     </testCase> 
 
-  <testCase id="016105" >
+  <testCase id="025503" >
     <class>lte-softmodem</class>
     <desc></desc>
-    <eNB>calisson</eNB>
+    <eNB>hutch</eNB>
     <UE>stevens</UE>
     <EPC>amerique</EPC>
-    <TimeOut_cmd>180</TimeOut_cmd>
+    <TimeOut_cmd>390</TimeOut_cmd>
     <eNB_working_dir>/tmp</eNB_working_dir>
-    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  N_RB_DL 100
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf downlink_frequency 2660000000L
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  uplink_frequency_offset -120000000
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  frame_type \"FDD\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_rx  1
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  nb_antennas_tx 1                     
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf   ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.82/24\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
     <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
-    <eNB_compile_prog_args>--eNB -w EXMIMO -x -c </eNB_compile_prog_args>
-    <eNB_pre_exec>sudo -E -S $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 ; dmesg|tail</eNB_pre_exec>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
     <eNB_pre_exec_args></eNB_pre_exec_args>
-    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
-    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf  </eNB_main_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf   </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue  </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -s -i 1 -u -f m  </UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue </UE_stop_script>
+    <UE_search_expr_false></UE_search_expr_false>
+    
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -b 16Mbits/s -i 1 -f m -u</EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.SonyExperiaM4.5MHz.FDD.UDP.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="025504" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>hutch</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
     <eNB_traffic_exec></eNB_traffic_exec>
     <eNB_traffic_exec_args></eNB_traffic_exec_args>
     <eNB_search_expr_true></eNB_search_expr_true>
     <eNB_search_expr_false></eNB_search_expr_false>
-    <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
 
     <UE_working_dir>/tmp</UE_working_dir>
-    <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"4\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"5\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"6\"</UE_config_file>
-    <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
-    <UE_compile_prog_args>--eNB -w USRP -x -c </UE_compile_prog_args>
-    <UE_pre_exec></UE_pre_exec>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
     <UE_pre_exec_args></UE_pre_exec_args>
-    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; sleep 45; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue  </UE_main_exec>
     <UE_main_exec_args></UE_main_exec_args>
-    <UE_traffic_exec>while true; do var=`ifconfig ppp0` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5;   iperf -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -s -i 1 -u -f m   </UE_traffic_exec>
     <UE_traffic_exec_args></UE_traffic_exec_args>
-    <UE_terminate_missing_procs>True</UE_terminate_missing_procs>
-    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue </UE_stop_script>
-    <UE_search_expr_true>throughput_test min=15.0Mbits/sec max=15.0Mbits/sec average=15.0Mbits/sec duration=60.0s </UE_search_expr_true>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec</UE_search_expr_true>
     <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue </UE_stop_script>
+
 
     <EPC_working_dir>/tmp</EPC_working_dir>
-    <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.local.enb.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.local.enb.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" </EPC_config_file>
-    <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
-    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
-    <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
-    <HSS_compile_prog_args> -c -l </HSS_compile_prog_args>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
 
-    <EPC_pre_exec></EPC_pre_exec>
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
     <EPC_pre_exec_args></EPC_pre_exec_args>
     <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
     <EPC_main_exec_args></EPC_main_exec_args>
     <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
     <HSS_main_exec_args></HSS_main_exec_args>
-    <EPC_traffic_exec>sleep 60; iperf -u -c  192.172.0.2 -b 10Mbits/s -t 120 -B 192.172.0.1</EPC_traffic_exec>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -b 33Mbits/s -i 1 -f m -u </EPC_traffic_exec>
     <EPC_traffic_exec_args></EPC_traffic_exec_args>
     <EPC_search_expr_false></EPC_search_expr_false>
-    <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
-    <tags>EXMIMO.ALU_EPC.Bandrich.20MHz.FDD.Band_7.DL.1TX.1RX</tags>
-    <nruns>3</nruns>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.SonyExperiaM4.10MHz.FDD.UDP.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
     </testCase> 
 
+  <testCase id="025505" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>hutch</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -E    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue  </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -s -i 1 -u -f m </UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>throughput_test min=00.0Mbits/sec max=10.0Mbits/sec average=10.0Mbits/sec</UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue </UE_stop_script>
 
 
-  <testCase id="015600" >
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2 -b 40Mbits/s -i 1 -f m -u     </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.SonyExperiaM4.20MHz.FDD.UDP.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="025506" >
     <class>lte-softmodem</class>
     <desc></desc>
-    <eNB>calisson</eNB>
+    <eNB>hutch</eNB>
     <UE>stevens</UE>
-    <EPC>nano</EPC>
-    <TimeOut_cmd>60</TimeOut_cmd>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
     <eNB_working_dir>/tmp</eNB_working_dir>
-    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  N_RB_DL 50
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"</eNB_config_file>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
     <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
-    <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args>
-    <eNB_pre_exec></eNB_pre_exec>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
     <eNB_pre_exec_args></eNB_pre_exec_args>
-    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
-    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  </eNB_main_exec_args>
-    <eNB_traffic_exec>iperf -s</eNB_traffic_exec>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
     <eNB_traffic_exec_args></eNB_traffic_exec_args>
     <eNB_search_expr_true></eNB_search_expr_true>
     <eNB_search_expr_false></eNB_search_expr_false>
-    <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
 
     <UE_working_dir>/tmp</UE_working_dir>
-    <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"92\"</UE_config_file>
-    <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
-    <UE_compile_prog_args>--eNB -w USRP -c</UE_compile_prog_args>
-    <UE_pre_exec></UE_pre_exec>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
     <UE_pre_exec_args></UE_pre_exec_args>
-    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue  </UE_main_exec>
     <UE_main_exec_args></UE_main_exec_args>
-    <UE_traffic_exec>ping 192.172.0.1</UE_traffic_exec>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E  -c  192.172.0.1     -B 192.172.0.2</UE_traffic_exec>
     <UE_traffic_exec_args></UE_traffic_exec_args>
     <UE_search_expr_true></UE_search_expr_true>
     <UE_search_expr_false></UE_search_expr_false>
-    <UE_terminate_missing_procs>True</UE_terminate_missing_procs>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue </UE_stop_script>
 
     <EPC_working_dir>/tmp</EPC_working_dir>
-    <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.local.enb.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.local.enb.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\" 
-                     BUILD/EPC/epc.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\"
-                     BUILD/EPC/epc.conf.in   MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\"
-                     BUILD/EPC/epc.conf.in   SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"
-                     BUILD/EPC/epc.conf.in   PGW_IPV4_ADDRESS_FOR_SGI  \"192.168.12.62/24\"</EPC_config_file>
-    <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
-    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
-    <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
-    <HSS_compile_prog_args> -c </HSS_compile_prog_args>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
 
-    <EPC_pre_exec></EPC_pre_exec>
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
     <EPC_pre_exec_args></EPC_pre_exec_args>
-    <EPC_main_exec>/SCRIPTS/run_epc -g </EPC_main_exec>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
     <EPC_main_exec_args></EPC_main_exec_args>
-    <HSS_main_exec>/SCRIPTS/run_hss -g </HSS_main_exec>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
     <HSS_main_exec_args></HSS_main_exec_args>
-    <EPC_traffic_exec>iperf -s</EPC_traffic_exec>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1  -f m  </EPC_traffic_exec>
     <EPC_traffic_exec_args></EPC_traffic_exec_args>
-    <EPC_search_expr_true></EPC_search_expr_true>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=5.0Mbits/sec average=5.0Mbits/sec   </EPC_search_expr_true>
     <EPC_search_expr_false></EPC_search_expr_false>
-    <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
-    <nruns>2</nruns>
-   </testCase>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.SonyExperiaM4.5MHz.FDD.TCP.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
 
 
-  <testCase id="015700" >
+  <testCase id="025507" >
     <class>lte-softmodem</class>
     <desc></desc>
-    <eNB>calisson</eNB>
+    <eNB>hutch</eNB>
     <UE>stevens</UE>
-   <EPC>calisson</EPC>
-    <TimeOut_cmd>60</TimeOut_cmd>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
     <eNB_working_dir>/tmp</eNB_working_dir>
-    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  N_RB_DL 50
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mobile_network_code \"92\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  N_RB_DL 50
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf  mme_ip_address "ipv4=\"192.168.12.62\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"</eNB_config_file>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
     <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
-    <eNB_compile_prog_args>--eNB -w USRP -c</eNB_compile_prog_args>
-    <eNB_pre_exec></eNB_pre_exec>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
     <eNB_pre_exec_args></eNB_pre_exec_args>
-    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
-    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  </eNB_main_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
     <eNB_traffic_exec></eNB_traffic_exec>
     <eNB_traffic_exec_args></eNB_traffic_exec_args>
     <eNB_search_expr_true></eNB_search_expr_true>
     <eNB_search_expr_false></eNB_search_expr_false>
-    <eNB_terminate_missing_procs>True</eNB_terminate_missing_procs>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
 
     <UE_working_dir>/tmp</UE_working_dir>
-    <UE_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  tracking_area_code \"1\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_country_code \"208\"
-                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf  mobile_network_code \"92\"</UE_config_file>
-    <UE_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
-    <UE_compile_prog_args>--eNB -w USRP -c</UE_compile_prog_args>
-    <UE_pre_exec></UE_pre_exec>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
     <UE_pre_exec_args></UE_pre_exec_args>
-    <UE_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --start-ue </UE_main_exec>
+    <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue  </UE_main_exec>
     <UE_main_exec_args></UE_main_exec_args>
-    <UE_traffic_exec>ping 192.172.0.1</UE_traffic_exec>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E  -c  192.172.0.1     -B 192.172.0.2</UE_traffic_exec>
     <UE_traffic_exec_args></UE_traffic_exec_args>
     <UE_search_expr_true></UE_search_expr_true>
     <UE_search_expr_false></UE_search_expr_false>
-    <UE_terminate_missing_procs>True</UE_terminate_missing_procs>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue </UE_stop_script>
 
     <EPC_working_dir>/tmp</EPC_working_dir>
-    <EPC_config_file>BUILD/EPC/epc.local.enb.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.local.enb.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.local.enb.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.local.enb.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.82/24\"
-                     BUILD/EPC/epc.conf.in  MCC \"208\"
-                     BUILD/EPC/epc.conf.in  MNC \"92\"
-                     BUILD/EPC/epc.conf.in   TAC \"1\"
-                     BUILD/EPC/epc.conf.in   PGW_INTERFACE_NAME_FOR_SGI \"eth1\"
-                     BUILD/EPC/epc.conf.in   PGW_IPV4_ADDRESS_FOR_SGI \"192.168.12.62/24\"
-                     BUILD/EPC/epc.conf.in   MME_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.62/24\"
-                     BUILD/EPC/epc.conf.in   SGW_IPV4_ADDRESS_FOR_S1U_S12_S4_UP \"192.168.12.62/24\"
-                     BUILD/EPC/epc.conf.in   PGW_IPV4_ADDRESS_FOR_SGI  \"192.168.12.62/24\"</EPC_config_file>
-    <EPC_compile_prog>SCRIPTS/build_epc</EPC_compile_prog>
-    <EPC_compile_prog_args>-c -l</EPC_compile_prog_args>
-    <HSS_compile_prog>SCRIPTS/build_hss</HSS_compile_prog>
-    <HSS_compile_prog_args> -c -l </HSS_compile_prog_args>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
 
-    <EPC_pre_exec></EPC_pre_exec>
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
     <EPC_pre_exec_args></EPC_pre_exec_args>
-    <EPC_main_exec>SCRIPTS/run_epc -l </EPC_main_exec>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
     <EPC_main_exec_args></EPC_main_exec_args>
-    <HSS_main_exec>SCRIPTS/run_hss  </HSS_main_exec>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
     <HSS_main_exec_args></HSS_main_exec_args>
-    <EPC_traffic_exec>iperf -s</EPC_traffic_exec>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1  -f m  </EPC_traffic_exec>
     <EPC_traffic_exec_args></EPC_traffic_exec_args>
-    <EPC_search_expr_true></EPC_search_expr_true>
+    <EPC_search_expr_true>throughput_test min=00.0Mbits/sec max=10.0Mbits/sec average=10.0Mbits/sec   </EPC_search_expr_true>
     <EPC_search_expr_false></EPC_search_expr_false>
-    <EPC_terminate_missing_procs>True</EPC_terminate_missing_procs>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.SonyExperiaM4.10MHz.FDD.TCP.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
 
-    <nruns>2</nruns>
-   </testCase>
+  <testCase id="025508" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>hutch</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -E -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
 
-  </testCaseList>
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue  </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E  -c  192.172.0.1    -B 192.172.0.2</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true></UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue </UE_stop_script>
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1  -f m  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_true>throughput_test min=0.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec   </EPC_search_expr_true>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.SonyExperiaM4.20MHz.FDD.TCP.Band_7.UL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="025509" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>hutch</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 25
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue  </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -s -i 1  -f m  </UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec </UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue </UE_stop_script>
+    <UE_search_expr_false></UE_search_expr_false>
+    
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2  -i 1 -f m </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.SonyExperiaM4.5MHz.FDD.TCP.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="025510" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>hutch</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 50
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -E -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue  </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -s -i 1  -f m   </UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>throughput_test min=0.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec</UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue </UE_stop_script>
+
+
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10 192.172.0.2 -c 192.172.0.2  -i 1 -f m  </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.SonyExperiaM4.10MHz.FDD.TCP.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
+  <testCase id="025511" >
+    <class>lte-softmodem</class>
+    <desc></desc>
+    <eNB>hutch</eNB>
+    <UE>stevens</UE>
+    <EPC>amerique</EPC>
+    <TimeOut_cmd>390</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tracking_area_code \"1\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_country_code \"208\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mobile_network_code \"92\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  N_RB_DL 100
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  mme_ip_address "ipv4=\"192.168.12.26\";ipv6=\"192:168:30::17\";active=\"yes\";preference=\"ipv4\";"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  downlink_frequency 2660000000L
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  uplink_frequency_offset -120000000
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  tx_gain 90
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  rx_gain 125
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  frame_type \"FDD\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_rx  1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  nb_antennas_tx 1
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1_MME       \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1_MME          \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_INTERFACE_NAME_FOR_S1U          \"eth0\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_IPV4_ADDRESS_FOR_S1U           \"192.168.12.19/24\"
+                     targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf  ENB_PORT_FOR_S1U                     2152</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>--eNB -w USRP -x -c </eNB_compile_prog_args>
+    <eNB_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem</eNB_main_exec>
+    <eNB_main_exec_args> -E -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf    </eNB_main_exec_args>
+    <eNB_traffic_exec></eNB_traffic_exec>
+    <eNB_traffic_exec_args></eNB_traffic_exec_args>
+    <eNB_search_expr_true></eNB_search_expr_true>
+    <eNB_search_expr_false></eNB_search_expr_false>
+    <eNB_terminate_missing_procs>False</eNB_terminate_missing_procs>
+
+    <UE_working_dir>/tmp</UE_working_dir>
+    <UE_config_file></UE_config_file>
+    <UE_compile_prog></UE_compile_prog>
+    <UE_compile_prog_args></UE_compile_prog_args>
+    <UE_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue  </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -s -i 1  -f m </UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>throughput_test min=00.0Mbits/sec max=10.0Mbits/sec average=10.0Mbits/sec</UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <UE_stop_script>sudo -S -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue </UE_stop_script>
 
 
+    <EPC_working_dir>/tmp</EPC_working_dir>
+    <EPC_config_file></EPC_config_file>
+    <EPC_compile_prog></EPC_compile_prog>
+    <EPC_compile_prog_args></EPC_compile_prog_args>
+    <HSS_compile_prog></HSS_compile_prog>
+    <HSS_compile_prog_args></HSS_compile_prog_args>
+
+    <EPC_pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</EPC_pre_exec>
+    <EPC_pre_exec_args></EPC_pre_exec_args>
+    <EPC_main_exec>/opt/ltebox/tools/stop_ltebox ; /opt/ltebox/tools/start_ltebox ; sleep 3000</EPC_main_exec>
+    <EPC_main_exec_args></EPC_main_exec_args>
+    <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
+    <HSS_main_exec_args></HSS_main_exec_args>
+    <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 10  192.172.0.2 -c 192.172.0.2  -i 1 -f m      </EPC_traffic_exec>
+    <EPC_traffic_exec_args></EPC_traffic_exec_args>
+    <EPC_search_expr_false></EPC_search_expr_false>
+    <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
+    <tags>USRPb210.ALU_EPC.SonyExperiaM4.20MHz.TCP.FDD.Band_7.DL.1TX.1RX</tags>
+    <nruns>10</nruns>
+    </testCase> 
+
 
 
+  </testCaseList>
diff --git a/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py b/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py
index ae25013f52cda113300db1223a663580fba1119c..8f1161390fce6cc1f55b828cdff804e169e9ae8e 100755
--- a/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py
+++ b/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py
@@ -1,8 +1,39 @@
 #!/usr/bin/python 
+#******************************************************************************
+
+#    OpenAirInterface 
+#    Copyright(c) 1999 - 2014 Eurecom
+
+#    OpenAirInterface is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+
+
+#    OpenAirInterface is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+
+#   You should have received a copy of the GNU General Public License
+#   along with OpenAirInterface.The full GNU General Public License is 
+#   included in this distribution in the file called "COPYING". If not, 
+#   see <http://www.gnu.org/licenses/>.
+
+#  Contact Information
+#  OpenAirInterface Admin: openair_admin@eurecom.fr
+#  OpenAirInterface Tech : openair_tech@eurecom.fr
+#  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+  
+#  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+# *******************************************************************************/
+# \author Navid Nikaein, Rohit Gupta
 
 import time
 import serial
 import os
+from socket import AF_INET
 from pyroute2 import IPRoute
 import sys
 import re
@@ -10,6 +41,7 @@ import threading
 import signal
 import traceback
 import os
+import commands
 
 # configure the serial connections (the parameters differs on the device you are connecting to)
 #First we find an open port to work with
@@ -20,22 +52,30 @@ if openair_dir == None:
   print "Error getting OPENAIR_DIR environment variable"
   sys.exit(1)
 
+sys.path.append(os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/tools/'))
+
+from lib_autotest import *
+
 def find_open_port():
    global serial_port, ser
    max_ports=100
-   if os.path.exists(serial_port) == True:
-     return serial_port
-   for port in range(2,100):
-      serial_port = '/dev/ttyUSB'+str(port)
-      if os.path.exists(serial_port) == True:
-         print 'New Serial Port : ' + serial_port
-         break
-
-   ser = serial.Serial(port=serial_port)
-   return
-
-find_open_port()
-print 'Using Serial port : ' + serial_port  
+   serial_port=''
+   while True:
+     if os.path.exists(serial_port) == True:
+       return serial_port
+     for port in range(0,100):
+        serial_port_tmp = '/dev/ttyUSB'+str(port)
+        if os.path.exists(serial_port_tmp) == True:
+           print 'New Serial Port : ' + serial_port_tmp
+           serial_port = serial_port_tmp
+           break
+     if serial_port == '':
+        print" Not able to detect valid serial ports. Resetting the modem now..."
+        reset_ue()
+     else :
+        ser = serial.Serial(port=serial_port)
+        return
+
     
 #serial_port = '/dev/ttyUSB2'
 bandrich_ppd_config = os.environ.get('OPENAIR_DIR') + '/cmake_targets/autotests/tools/wdial.bandrich.conf'
@@ -58,11 +98,12 @@ signal.signal(signal.SIGINT, signal_handler)
 #ser.isOpen()
 
 class pppThread (threading.Thread):
-    def __init__(self, threadID, name, counter):
+    def __init__(self, threadID, name, counter,port):
         threading.Thread.__init__(self)
         self.threadID = threadID
         self.name = name
         self.counter = counter
+        self.port=port
     def run(self):
         print "Starting " + self.name
         #Here we keep running pppd thread in indefinite loop as this script terminates sometimes
@@ -72,6 +113,10 @@ class pppThread (threading.Thread):
            print "Starting wvdial now..."
            print 'exit_flag = ' + str(exit_flag)
            send_command('AT+CGATT=1','OK', 300)
+           
+           #Now we do search and replace on wvdial config file
+           cmd="sed -i \"s%Modem = .*%Modem = " + self.port + "%g\" " +  bandrich_ppd_config
+           os.system(cmd)
            os.system('wvdial -C ' + bandrich_ppd_config + '' )
            if exit_flag == 1:
               print "Exit flag set to true. Exiting pppThread now"
@@ -102,10 +147,12 @@ def send_command (cmd, response, timeout):
         error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: '  + str(e.__class__) + " : " + str( e)
         error = error + traceback.format_exc()
         print error
+        time.sleep(1)
         
 
 def start_ue () :
    #print 'Enter your commands below.\r\nInsert "exit" to leave the application.'
+   global serial_port
    timeout=60 #timeout in seconds
    send_command('AT', 'OK' , timeout)
    send_command('AT+CFUN=1' , 'OK' , timeout)
@@ -113,22 +160,33 @@ def start_ue () :
    send_command('AT+CGATT=1','OK', 300)
    #os.system('wvdial -C ' + bandrich_ppd_config + ' &' )
    
-   thread_ppp = pppThread(1, "ppp_thread", 1)
+   thread_ppp = pppThread(1, "ppp_thread", 1,port=serial_port)
    thread_ppp.start()
 
-   iface='ppp0'
+   #iface='ppp0'
    
    while 1:
      time.sleep ( 2)
+     iface=''
      #Now we check if ppp0 interface is up and running
      try:
         if exit_flag == 1:
           break
+        cmd="ifconfig -a | sed 's/[ \t].*//;/^$/d' | grep ppp"
+        status, out = commands.getstatusoutput(cmd)
+        iface=out
         ip = IPRoute()
         idx = ip.link_lookup(ifname=iface)[0]
-        os.system ('route add 192.172.0.1 ppp0')
-        os.system ('ping -c 5 192.172.0.1')
-        break
+        print "iface = " + iface
+        print " Setting route now..."
+        #os.system("status=1; while [ \"$status\" -ne \"0\" ]; do route add -host " + gw + ' ' + iface + " ; status=$? ;sleep 1; echo \"status = $status\"  ; sleep 2; done ")
+        os.system ('route add -host ' + gw + ' ' + iface + ' 2> /dev/null')
+        #ip.route('add', dst=gw, oif=iface)
+        
+        os.system('sleep 5')
+        #print "Starting ping now..."
+        os.system ('ping -c 1 ' + gw)
+        #break
      except Exception, e:
         error = ' Interface ' + iface + 'does not exist...'
         error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: '  + str(e.__class__) + " : " + str( e)
@@ -144,11 +202,59 @@ def stop_ue():
    send_command('AT+CGATT=0' , 'OK|ERROR' , timeout)
    send_command('AT+CFUN=4' , 'OK' , timeout)
 
-for arg in sys.argv[1:]:
+
+#reset the USB BUS of Bandrich UE
+def reset_ue():
+  stringIdBandrich='BandRich, Inc. 4G LTE adapter'
+  status, out = commands.getstatusoutput('lsusb | grep -i \'' + stringIdBandrich + '\'')
+  if (out == '') :
+     print "Bandrich 4G LTE Adapter not found. Exiting now..."
+     sys.exit()
+  p=re.compile('Bus\s*(\w+)\s*Device\s*(\w+):\s*ID\s*(\w+):(\w+)')
+  res=p.findall(out)
+  BusId=res[0][0]
+  DeviceId=res[0][1]
+  VendorId=res[0][2]
+  ProductId=res[0][3]
+  usb_dir= find_usb_path(VendorId, ProductId)
+  print "Bandrich 4G LTE Adapter found in..." + usb_dir
+  print "Sleeping now for 45 seconds...please wait..."
+  cmd = "sudo sh -c \"echo 0 > " + usb_dir + "/authorized\""
+  os.system(cmd + " ; sleep 15" )
+  cmd = "sudo sh -c \"echo 1 > " + usb_dir + "/authorized\""
+  os.system(cmd + " ; sleep 30" )
+  find_open_port()
+  stop_ue()
+
+i=1
+gw='192.172.0.1'
+while i <  len(sys.argv):
+    arg=sys.argv[i]
     if arg == '--start-ue' :
+        print "Turning on UE..."
+        find_open_port()
+        print 'Using Serial port : ' + serial_port  
         start_ue()
     elif arg == '--stop-ue' :
+        print "Turning off UE..."
+        find_open_port()
+        print 'Using Serial port : ' + serial_port  
         stop_ue()
+    elif arg == '--reset-ue' :
+        print "Resetting UE..."
+        find_open_port()
+        reset_ue()
+    elif arg == '-gw' :
+        gw = sys.argv[i+1]
+        i=i+1
+    elif arg == '-h' :
+        print "--reset-ue:  Reset the UE on USB Bus. Similar to unplugging and plugging the UE"
+        print "--stop-ue:  Stop the UE. Send DETACH command" 
+        print "--start-ue:  Start the UE. Send ATTACH command"
+        print "-gw:  Specify the default gw as sometimes the gateway/route arguments are not set properly via wvdial"
     else :
         print " Script called with wrong arguments, arg = " + arg
         sys.exit()
+    i = i +1
+
+
diff --git a/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py b/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py
new file mode 100755
index 0000000000000000000000000000000000000000..929cc1c0a5246e0db485bb077878ed108aafcd49
--- /dev/null
+++ b/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py
@@ -0,0 +1,245 @@
+#!/usr/bin/python 
+#******************************************************************************
+
+#    OpenAirInterface 
+#    Copyright(c) 1999 - 2014 Eurecom
+
+#    OpenAirInterface is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+
+
+#    OpenAirInterface is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+
+#   You should have received a copy of the GNU General Public License
+#   along with OpenAirInterface.The full GNU General Public License is 
+#   included in this distribution in the file called "COPYING". If not, 
+#   see <http://www.gnu.org/licenses/>.
+
+#  Contact Information
+#  OpenAirInterface Admin: openair_admin@eurecom.fr
+#  OpenAirInterface Tech : openair_tech@eurecom.fr
+#  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+  
+#  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+# *******************************************************************************/
+# \author Navid Nikaein, Rohit Gupta
+
+import time
+import serial
+import os
+from pyroute2 import IPRoute
+import sys
+import re
+import threading
+import signal
+import traceback
+import os
+import commands
+
+# configure the serial connections (the parameters differs on the device you are connecting to)
+#First we find an open port to work with
+serial_port=''
+ser=serial.Serial()
+openair_dir = os.environ.get('OPENAIR_DIR')
+if openair_dir == None:
+  print "Error getting OPENAIR_DIR environment variable"
+  sys.exit(1)
+
+sys.path.append(os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/tools/'))
+
+from lib_autotest import *
+
+def find_open_port():
+   global serial_port, ser
+   max_ports=100
+   serial_port=''
+   while True:
+     if os.path.exists(serial_port) == True:
+       return serial_port
+     for port in range(2,100):
+        serial_port_tmp = '/dev/ttyUSB'+str(port)
+        if os.path.exists(serial_port_tmp) == True:
+           print 'New Serial Port : ' + serial_port_tmp
+           serial_port = serial_port_tmp
+           break
+     if serial_port == '':
+        print" Not able to detect valid serial ports. Resetting the modem now..."
+        reset_ue()
+     else :
+        ser = serial.Serial(port=serial_port)
+        return
+
+
+
+    
+#serial_port = '/dev/ttyUSB2'
+bandrich_ppd_config = os.environ.get('OPENAIR_DIR') + '/cmake_targets/autotests/tools/wdial.bandrich.conf'
+
+exit_flag=0
+
+def signal_handler(signal, frame):
+        print('You pressed Ctrl+C!')
+        print('Resetting the UE to detached state')
+        timeout=10
+        exit_flag=1
+        send_command('AT+CGATT=0' , 'OK' , timeout)
+        sys.exit(0)
+
+signal.signal(signal.SIGINT, signal_handler)
+
+
+
+#ser.open()
+#ser.isOpen()
+
+class pppThread (threading.Thread):
+    def __init__(self, threadID, name, counter):
+        threading.Thread.__init__(self)
+        self.threadID = threadID
+        self.name = name
+        self.counter = counter
+    def run(self):
+        print "Starting " + self.name
+        #Here we keep running pppd thread in indefinite loop as this script terminates sometimes
+        #while 1:
+        while 1:
+           time.sleep(5) #Hard coded, do not reduce this number! 
+           print "Starting wvdial now..."
+           print 'exit_flag = ' + str(exit_flag)
+           send_command('AT+CGATT=1','OK', 300)
+           os.system('wvdial -C ' + bandrich_ppd_config + '' )
+           if exit_flag == 1:
+              print "Exit flag set to true. Exiting pppThread now"
+           print "Terminating wvdial now..."
+
+def send_command (cmd, response, timeout):
+   count=0
+   sleep_duration = 1
+   print 'In function: send_command: cmd = <' + cmd + '> response: <' + response + '> \n'
+   global serial_port, ser
+   while count <= timeout:
+      try:
+        #Sometimes the port does not exist coz of reset in modem.
+        #In that case, we need to search for this port again
+        if os.path.exists(serial_port) == False:
+            find_open_port()
+        ser.write (cmd + '\r\n')
+        out = ''
+        time.sleep(sleep_duration)
+        count = count + sleep_duration
+        while ser.inWaiting() > 0:
+            out += ser.read(1)
+        print 'out = <' + out + '> response = <' + response + '> \n'
+        if re.search(response, out):
+          break
+      except Exception, e:
+        error = ' cmd : ' + cmd + ' response : ' + response
+        error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: '  + str(e.__class__) + " : " + str( e)
+        error = error + traceback.format_exc()
+        print error
+        time.sleep(1)
+        
+
+def start_ue () :
+   #print 'Enter your commands below.\r\nInsert "exit" to leave the application.'
+   timeout=60 #timeout in seconds
+   send_command('AT', 'OK' , timeout)
+   #send_command('AT+CFUN=1' , 'OK' , timeout)
+   #send_command('AT+CGATT=0' , 'OK' , timeout)
+   send_command('AT+CGATT=1','OK', 300)
+   #os.system('wvdial -C ' + bandrich_ppd_config + ' &' )
+   
+   thread_ppp = pppThread(1, "ppp_thread", 1)
+   thread_ppp.start()
+
+   iface='ppp0'
+   
+   while 1:
+     time.sleep ( 2)
+     #Now we check if ppp0 interface is up and running
+     try:
+        if exit_flag == 1:
+          break
+        ip = IPRoute()
+        idx = ip.link_lookup(ifname=iface)[0]
+        os.system ('route add ' + gw + ' ppp0')
+        os.system('sleep 5')
+        os.system ('ping ' + gw)
+        break
+     except Exception, e:
+        error = ' Interface ' + iface + 'does not exist...'
+        error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: '  + str(e.__class__) + " : " + str( e)
+        error = error + traceback.format_exc()
+        print error
+    
+   thread_ppp.join()
+
+def stop_ue():
+  stringIdBandrich='Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard'
+  status, out = commands.getstatusoutput('lsusb | grep -i \'' + stringIdBandrich + '\'')
+  if (out == '') :
+     print "Huawei E398 Adapter not found. Exiting now..."
+     sys.exit()
+  timeout=60
+  os.system('killall wvdial')
+  send_command('AT', 'OK' , timeout)
+  send_command('AT+CGATT=0' , 'OK|ERROR' , timeout)
+  #send_command('AT+CFUN=4' , 'OK' , timeout)
+
+
+#reset the USB BUS of Bandrich UE
+def reset_ue():
+  stringIdBandrich='Huawei Technologies Co., Ltd. E398 LTE/UMTS/GSM Modem/Networkcard'
+  status, out = commands.getstatusoutput('lsusb | grep -i \'' + stringIdBandrich + '\'')
+  if (out == '') :
+     print "Huawei E398 Adapter not found. Exiting now..."
+     sys.exit()
+  p=re.compile('Bus\s*(\w+)\s*Device\s*(\w+):\s*ID\s*(\w+):(\w+)')
+  res=p.findall(out)
+  BusId=res[0][0]
+  DeviceId=res[0][1]
+  VendorId=res[0][2]
+  ProductId=res[0][3]
+  usb_dir= find_usb_path(VendorId, ProductId)
+  print "Bandrich 4G LTE Adapter found in..." + usb_dir
+  cmd = "sudo sh -c \"echo 0 > " + usb_dir + "/authorized\""
+  os.system(cmd + " ; sleep 15" )
+  cmd = "sudo sh -c \"echo 1 > " + usb_dir + "/authorized\""
+  os.system(cmd + " ; sleep 30" )
+  stop_ue()
+
+i=1
+gw='192.172.0.1'
+while i <  len(sys.argv):
+    arg=sys.argv[i]
+    if arg == '--start-ue' :
+        find_open_port()
+        print 'Using Serial port : ' + serial_port  
+        start_ue()
+    elif arg == '--stop-ue' :
+        find_open_port()
+        print 'Using Serial port : ' + serial_port  
+        stop_ue()
+    elif arg == '--reset-ue' :
+        find_open_port()
+        reset_ue()
+    elif arg == '-gw' :
+        gw = sys.argv[i+1]
+        i=i+1
+    elif arg == '-h' :
+        print "--reset-ue:  Reset the UE on USB Bus. Similar to unplugging and plugging the UE"
+        print "--stop-ue:  Stop the UE. Send DETACH command" 
+        print "--start-ue:  Start the UE. Send ATTACH command"
+        print "-gw:  Specify the default gw as sometimes the gateway/route arguments are not set properly via wvdial"
+    else :
+        print " Script called with wrong arguments, arg = " + arg
+        sys.exit()
+    i = i +1
+
+
diff --git a/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py b/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py
new file mode 100755
index 0000000000000000000000000000000000000000..c136067a61525b591c487ef00f72392f18d895a1
--- /dev/null
+++ b/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py
@@ -0,0 +1,121 @@
+#!/usr/bin/python 
+
+import time
+import serial
+import os
+from pyroute2 import IPRoute
+import sys
+import re
+import threading
+import signal
+import traceback
+import os
+import commands
+
+# Find a device ID by running sudo adb devices
+# The device ID below is for Sony Xperia M4
+
+device_id='YT9115PX1E' 
+
+
+openair_dir = os.environ.get('OPENAIR_DIR')
+if openair_dir == None:
+  print "Error getting OPENAIR_DIR environment variable"
+  sys.exit(1)
+
+sys.path.append(os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/tools/'))
+
+from lib_autotest import *
+
+def signal_handler(signal, frame):
+        print('You pressed Ctrl+C!')
+        print('Exiting now...')
+        timeout=10
+        exit_flag=1
+        sys.exit(0)
+
+signal.signal(signal.SIGINT, signal_handler)
+
+# Find all the process IDs in a phone given the name of process
+def kill_processes(name):
+   print " Killing all processes by name..." + name
+   while 1:
+     cmd = 'sudo adb -s ' + device_id +' shell "ps |grep ' + name + '"' 
+     status, out = commands.getstatusoutput(cmd)
+     if status != 0:
+       print "Error executing command to kill process " + name
+       print "Error =" + out
+       sys.exit(1)
+     print "Out = " + out
+     if out=='':
+       break;
+     out_arr = out.split()
+     pid_to_kill = out_arr[1]
+     print "Now killing process ID " + pid_to_kill + " on Phone" 
+     cmd = 'sudo adb -s ' + device_id +' shell "kill -9 ' + pid_to_kill + '"' 
+     status, out = commands.getstatusoutput(cmd)
+     if status != 0:
+       print "Error execting command to kill process " + name
+       sys.exit(1)
+     print "Out = " + out
+
+def start_ue () :
+   #print 'Enter your commands below.\r\nInsert "exit" to leave the application.'
+   print 'Killing old iperf/ping sessions'
+   kill_processes('iperf')
+   kill_processes('iperf3')
+   kill_processes('ping')
+   print "Turning off airplane mode"
+   os.system('sudo -E adb devices')
+   os.system('sudo -E adb -s ' + device_id + ' shell \"settings put global airplane_mode_on 0; am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false\"')
+
+   while 1:
+     time.sleep ( 2)
+     #Now we check if ppp0 interface is up and running
+     try:
+        cmd = 'sudo adb -s ' + device_id + ' shell netcfg |grep 192.'
+        status, out = commands.getstatusoutput(cmd)
+        if (out == '') :
+            print "Waiting for UE to connect and get IP Address..."
+        else :
+            print "UE is now connected. IP Address settings are..." + out
+            os.system('sleep 5')
+            os.system ('sudo adb -s ' + device_id  + ' shell ping ' + gw)
+            break
+     except Exception, e:
+        error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: '  + str(e.__class__) + " : " + str( e)
+        error = error + traceback.format_exc()
+        print error
+
+    
+
+def stop_ue():
+   print "Turning on airplane mode"
+   os.system('sudo adb devices')
+   os.system('sudo adb -s ' + device_id + ' shell \"settings put global airplane_mode_on 1; am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true\" ')
+   print "Killing iperf/ping sessions"
+   kill_processes('iperf')
+   kill_processes('iperf3')
+   kill_processes('ping')
+   
+i=1
+gw='192.172.0.1'
+while i <  len(sys.argv):
+    arg=sys.argv[i]
+    if arg == '--start-ue' :
+        start_ue()
+    elif arg == '--stop-ue' :
+        stop_ue()
+    elif arg == '-gw' :
+        gw = sys.argv[i+1]
+        i=i+1
+    elif arg == '-h' :
+        print "--stop-ue:  Stop the UE. Turn on airplane mode" 
+        print "--start-ue:  Start the UE. Turn off airplane mode"
+        print "-gw:  Specify the default gw as sometimes the gateway/route arguments are not set properly via wvdial"
+    else :
+        print " Script called with wrong arguments, arg = " + arg
+        sys.exit()
+    i = i +1
+
+
diff --git a/cmake_targets/autotests/tools/configure_usrpb210.py b/cmake_targets/autotests/tools/configure_usrpb210.py
new file mode 100755
index 0000000000000000000000000000000000000000..12b091e4d8aeb6412fe3372aeb17aaa12fa79a07
--- /dev/null
+++ b/cmake_targets/autotests/tools/configure_usrpb210.py
@@ -0,0 +1,108 @@
+#!/usr/bin/python 
+#******************************************************************************
+
+#    OpenAirInterface 
+#    Copyright(c) 1999 - 2014 Eurecom
+
+#    OpenAirInterface is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+
+
+#    OpenAirInterface is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+
+#   You should have received a copy of the GNU General Public License
+#   along with OpenAirInterface.The full GNU General Public License is 
+#   included in this distribution in the file called "COPYING". If not, 
+#   see <http://www.gnu.org/licenses/>.
+
+#  Contact Information
+#  OpenAirInterface Admin: openair_admin@eurecom.fr
+#  OpenAirInterface Tech : openair_tech@eurecom.fr
+#  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+  
+#  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+# *******************************************************************************/
+# \author Navid Nikaein, Rohit Gupta
+
+import time
+import serial
+import os
+from pyroute2 import IPRoute
+import sys
+import re
+import threading
+import signal
+import traceback
+import os
+import commands
+
+# configure the serial connections (the parameters differs on the device you are connecting to)
+#First we find an open port to work with
+serial_port=''
+openair_dir = os.environ.get('OPENAIR_DIR')
+if openair_dir == None:
+  print "Error getting OPENAIR_DIR environment variable"
+  sys.exit(1)
+
+sys.path.append(os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/tools/'))
+
+from lib_autotest import *
+
+#Stop the USB BUS of USRPB210
+def stop_usrpb210():
+  stringIdBandrich='National Instruments Corp.'
+  status, out = commands.getstatusoutput('lsusb | grep -i \'' + stringIdBandrich + '\'')
+  if (out == '') :
+     print "USRP B210 not found. Exiting now..."
+     sys.exit()
+  p=re.compile('Bus\s*(\w+)\s*Device\s*(\w+):\s*ID\s*(\w+):(\w+)')
+  res=p.findall(out)
+  BusId=res[0][0]
+  DeviceId=res[0][1]
+  VendorId=res[0][2]
+  ProductId=res[0][3]
+  usb_dir= find_usb_path(VendorId, ProductId)
+  print "USRP B210 found in..." + usb_dir
+  cmd = "sudo sh -c \"echo 0 > " + usb_dir + "/authorized\""
+  os.system(cmd)
+
+#Start the USB bus of USRP B210
+def start_usrpb210():
+  stringIdBandrich='National Instruments Corp.'  
+  status, out = commands.getstatusoutput('lsusb | grep -i \'' + stringIdBandrich + '\'')
+  if (out == '') :
+     print "USRP B210 not found. Exiting now..."
+     sys.exit()
+  p=re.compile('Bus\s*(\w+)\s*Device\s*(\w+):\s*ID\s*(\w+):(\w+)')
+  res=p.findall(out)
+  BusId=res[0][0]
+  DeviceId=res[0][1]
+  VendorId=res[0][2]
+  ProductId=res[0][3]
+  usb_dir= find_usb_path(VendorId, ProductId)
+  print "USRP B210 found in..." + usb_dir
+  cmd = "sudo sh -c \"echo 1 > " + usb_dir + "/authorized\""
+  os.system(cmd)
+
+i=1
+while i <  len(sys.argv):
+    arg=sys.argv[i]
+    if arg == '--start-usrpb210' :
+        start_usrpb210()
+    elif arg == '--stop-usrpb210' :
+        stop_usrpb210()
+    elif arg == '-h' :
+        print "--stop-usrpb210:  Stop the USRP B210. It cannot be found in uhd_find_devices" 
+        print "--start-usrpb210:  Start the USRP B210. It can now be found in uhd_find_devices"
+    else :
+        print " Script called with wrong arguments, arg = " + arg
+        sys.exit()
+    i = i +1
+
+
diff --git a/cmake_targets/autotests/tools/find_usb_path.bash b/cmake_targets/autotests/tools/find_usb_path.bash
new file mode 100755
index 0000000000000000000000000000000000000000..d2a80cd6c28389332eb63a32109631381867e05b
--- /dev/null
+++ b/cmake_targets/autotests/tools/find_usb_path.bash
@@ -0,0 +1,51 @@
+#!/bin/bash
+#******************************************************************************
+
+#    OpenAirInterface 
+#    Copyright(c) 1999 - 2014 Eurecom
+
+#    OpenAirInterface is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+
+
+#    OpenAirInterface is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+
+#   You should have received a copy of the GNU General Public License
+#   along with OpenAirInterface.The full GNU General Public License is 
+#   included in this distribution in the file called "COPYING". If not, 
+#   see <http://www.gnu.org/licenses/>.
+
+#  Contact Information
+#  OpenAirInterface Admin: openair_admin@eurecom.fr
+#  OpenAirInterface Tech : openair_tech@eurecom.fr
+#  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+  
+#  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+# *******************************************************************************/
+# \author Navid Nikaein, Rohit Gupta
+
+
+#arg1 idVendor
+#arg2 idProduct
+argIdVendor=$1
+argIdProduct=$2
+
+echo $1
+echo $2
+
+for X in /sys/bus/usb/devices/*; do 
+    #echo "$X"
+    idVendor=`cat "$X/idVendor" 2>/dev/null` 
+    idProduct=`cat "$X/idProduct" 2>/dev/null`
+    if [ "$argIdVendor" == "$idVendor" ] && [ "$argIdProduct" == "$idProduct" ]
+    then
+      echo "$X"
+    fi
+done
+
diff --git a/cmake_targets/autotests/tools/free_mem.bash b/cmake_targets/autotests/tools/free_mem.bash
new file mode 100755
index 0000000000000000000000000000000000000000..873d6121e739e79b7042f396acba77dc3a40ee03
--- /dev/null
+++ b/cmake_targets/autotests/tools/free_mem.bash
@@ -0,0 +1,36 @@
+#!/bin/bash
+#******************************************************************************
+
+#    OpenAirInterface 
+#    Copyright(c) 1999 - 2014 Eurecom
+
+#    OpenAirInterface is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+
+
+#    OpenAirInterface is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+
+#   You should have received a copy of the GNU General Public License
+#   along with OpenAirInterface.The full GNU General Public License is 
+#   included in this distribution in the file called "COPYING". If not, 
+#   see <http://www.gnu.org/licenses/>.
+
+#  Contact Information
+#  OpenAirInterface Admin: openair_admin@eurecom.fr
+#  OpenAirInterface Tech : openair_tech@eurecom.fr
+#  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+  
+#  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+# *******************************************************************************/
+# \author Navid Nikaein, Rohit Gupta
+
+# To free unused memory else test setup runs out of memory
+sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches ' 
+
+
diff --git a/cmake_targets/autotests/tools/git-retry.sh b/cmake_targets/autotests/tools/git-retry.sh
new file mode 100755
index 0000000000000000000000000000000000000000..b897ba379d0a9b12b755603d72bdcb64a254f302
--- /dev/null
+++ b/cmake_targets/autotests/tools/git-retry.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+#Simple script to retry git clone in case of failure
+
+REALGIT=/usr/bin/git
+
+RETRIES=10
+DELAY=10
+COUNT=1
+while [ $COUNT -lt $RETRIES ]; do
+  $REALGIT $* >> git-clone-`hostname`-log.txt 2>&1
+  if [ $? -eq 0 ]; then
+    RETRIES=0
+    break
+  fi
+  let COUNT=$COUNT+1
+  sleep $DELAY
+done
diff --git a/cmake_targets/autotests/tools/iperf3_script b/cmake_targets/autotests/tools/iperf3_script
new file mode 100755
index 0000000000000000000000000000000000000000..e82816f6e140a3981536a13c7dd3ae23d6f3dc9f
--- /dev/null
+++ b/cmake_targets/autotests/tools/iperf3_script
@@ -0,0 +1,52 @@
+#!/bin/bash
+#******************************************************************************
+
+#    OpenAirInterface 
+#    Copyright(c) 1999 - 2014 Eurecom
+
+#    OpenAirInterface is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+
+
+#    OpenAirInterface is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+
+#   You should have received a copy of the GNU General Public License
+#   along with OpenAirInterface.The full GNU General Public License is 
+#   included in this distribution in the file called "COPYING". If not, 
+#   see <http://www.gnu.org/licenses/>.
+
+#  Contact Information
+#  OpenAirInterface Admin: openair_admin@eurecom.fr
+#  OpenAirInterface Tech : openair_tech@eurecom.fr
+#  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+  
+#  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+# *******************************************************************************/
+# \author Navid Nikaein, Rohit Gupta
+
+#arg1 timeout to wait before running the script
+#arg2 interface
+#arg3 iperf arguments
+
+args=($*)
+timeout=${args[0]}
+iface=${args[1]}
+iperf3_args=(${args[@]:2})
+
+#array=${1:-1}
+echo "args =  ${args[@]}"
+echo "timeout = $timeout"
+echo "iface = $iface"
+echo "iperf3_args = ${iperf3_args[@]}"
+
+sleep $timeout
+
+while true; do var=`ifconfig $iface` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done ; sleep 5
+
+iperf3 ${iperf3_args[@]}
diff --git a/cmake_targets/autotests/tools/iperf3_script_phone b/cmake_targets/autotests/tools/iperf3_script_phone
new file mode 100755
index 0000000000000000000000000000000000000000..c191f72ec3ce20d5a582ec3cb4bfc30ff184bf1b
--- /dev/null
+++ b/cmake_targets/autotests/tools/iperf3_script_phone
@@ -0,0 +1,63 @@
+#!/bin/bash
+#******************************************************************************
+
+#    OpenAirInterface 
+#    Copyright(c) 1999 - 2014 Eurecom
+
+#    OpenAirInterface is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+
+
+#    OpenAirInterface is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+
+#   You should have received a copy of the GNU General Public License
+#   along with OpenAirInterface.The full GNU General Public License is 
+#   included in this distribution in the file called "COPYING". If not, 
+#   see <http://www.gnu.org/licenses/>.
+
+#  Contact Information
+#  OpenAirInterface Admin: openair_admin@eurecom.fr
+#  OpenAirInterface Tech : openair_tech@eurecom.fr
+#  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+  
+#  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+# *******************************************************************************/
+# \author Navid Nikaein, Rohit Gupta
+
+#arg1 timeout to wait before running the script
+#arg2 interface
+#arg3 iperf3 arguments
+
+args=($*)
+timeout=${args[0]}
+device_id=${args[1]}
+iperf3_args=(${args[@]:2})
+
+#array=${1:-1}
+echo "args =  ${args[@]}"
+echo "timeout = $timeout"
+echo "device_id = $device_id"
+echo "iperf3_args = ${iperf3_args[@]}"
+
+sleep $timeout
+
+while true ; do
+  cmd=`sudo adb -s $device_id shell netcfg |grep 192.`
+  if [ -z "$cmd" ]; then
+     echo "Wating for UE to connect and get IP Address..."
+     sleep 1
+  else 
+     echo "UE is now connected. IP Address settings are... $cmd"
+     break
+  fi
+done
+
+echo "Starting iperf3 now..."
+
+sudo adb -s $device_id shell /data/local/tmp/iperf3 ${iperf3_args[@]}
diff --git a/cmake_targets/autotests/tools/iperf_script b/cmake_targets/autotests/tools/iperf_script
new file mode 100755
index 0000000000000000000000000000000000000000..731438d65da1cced26ba857262bb7477f9ca6f6a
--- /dev/null
+++ b/cmake_targets/autotests/tools/iperf_script
@@ -0,0 +1,106 @@
+#!/bin/bash
+#******************************************************************************
+
+#    OpenAirInterface 
+#    Copyright(c) 1999 - 2014 Eurecom
+
+#    OpenAirInterface is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+
+
+#    OpenAirInterface is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+
+#   You should have received a copy of the GNU General Public License
+#   along with OpenAirInterface.The full GNU General Public License is 
+#   included in this distribution in the file called "COPYING". If not, 
+#   see <http://www.gnu.org/licenses/>.
+
+#  Contact Information
+#  OpenAirInterface Admin: openair_admin@eurecom.fr
+#  OpenAirInterface Tech : openair_tech@eurecom.fr
+#  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+  
+#  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+# *******************************************************************************/
+# \author Navid Nikaein, Rohit Gupta
+
+#arg1 timeout to wait before running the script
+#arg2 interface
+#arg3 iperf arguments
+
+echo "Start time of script: `date`"
+
+args=($*)
+timeout=${args[0]}
+iface=${args[1]}
+iperf_args=(${args[@]:2})
+
+ip_client=`echo "$iperf_args" | sed -ne 's/.*\-c[ ]*\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\).*/\1/p'`
+
+#array=${1:-1}
+echo "args =  ${args[@]}"
+echo "timeout = $timeout"
+echo "iface = $iface"
+echo "iperf_args = ${iperf_args[@]}"
+echo "ip_client = $ip_client"
+
+
+
+# Test an IP address for validity:
+# Usage:
+#      valid_ip IP_ADDRESS
+#      if [[ $? -eq 0 ]]; then echo good; else echo bad; fi
+#   OR
+#      if valid_ip IP_ADDRESS; then echo good; else echo bad; fi
+#
+function valid_ip()
+{
+    local  ip=$1
+    local  stat=1
+
+    if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
+        OIFS=$IFS
+        IFS='.'
+        ip=($ip)
+        IFS=$OIFS
+        [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \
+            && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]]
+        stat=$?
+    fi
+    return $stat
+}
+
+if valid_ip $iface; then 
+  echo "$iface is Valid IP Address. Checking for connectivity..."
+  ping -c 1 $iface >& /dev/null
+  while  [ "$?" != "0" ]; do
+     ping -c 1 $iface >& /dev/null
+  done
+  echo "$iface connectivity achieved at `date`, Seconds = $SECONDS"  
+
+else 
+
+  echo "Waiting for Interface $iface to come up..."
+  while true; do var=`ifconfig $iface` ;sleep 1; if [ "$var" != "" ]; then break; fi ; done 
+  echo "$iface is now available at `date` , Seconds = $SECONDS"
+fi
+
+
+#if [ -n "$ip_client" ]; then
+#echo "Waiting for route to be setup before iperf makes connection..."
+#  var=`route -n | grep $ip_client`
+#  if ["$var" != "" ] ; then break; fi
+#
+#fi
+
+echo "Sleeping for additional $timeout seconds"
+sleep $timeout
+
+echo "Starting iperf at `date` , Seconds = $SECONDS ...."
+iperf ${iperf_args[@]}
diff --git a/cmake_targets/autotests/tools/iperf_script_phone b/cmake_targets/autotests/tools/iperf_script_phone
new file mode 100755
index 0000000000000000000000000000000000000000..f9ec7973f4152ee12dd9bd35afd163d43fc945cd
--- /dev/null
+++ b/cmake_targets/autotests/tools/iperf_script_phone
@@ -0,0 +1,63 @@
+#!/bin/bash
+#******************************************************************************
+
+#    OpenAirInterface 
+#    Copyright(c) 1999 - 2014 Eurecom
+
+#    OpenAirInterface is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+
+
+#    OpenAirInterface is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+
+#   You should have received a copy of the GNU General Public License
+#   along with OpenAirInterface.The full GNU General Public License is 
+#   included in this distribution in the file called "COPYING". If not, 
+#   see <http://www.gnu.org/licenses/>.
+
+#  Contact Information
+#  OpenAirInterface Admin: openair_admin@eurecom.fr
+#  OpenAirInterface Tech : openair_tech@eurecom.fr
+#  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+  
+#  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+# *******************************************************************************/
+# \author Navid Nikaein, Rohit Gupta
+
+#arg1 timeout to wait before running the script
+#arg2 interface
+#arg3 iperf arguments
+
+args=($*)
+timeout=${args[0]}
+device_id=${args[1]}
+iperf_args=(${args[@]:2})
+
+#array=${1:-1}
+echo "args =  ${args[@]}"
+echo "timeout = $timeout"
+echo "device_id = $device_id"
+echo "iperf_args = ${iperf_args[@]}"
+
+sleep $timeout
+
+while true ; do
+  cmd=`sudo adb -s $device_id shell netcfg |grep 192.`
+  if [ -z "$cmd" ]; then
+     echo "Wating for UE to connect and get IP Address..."
+     sleep 1
+  else 
+     echo "UE is now connected. IP Address settings are... $cmd"
+     break
+  fi
+done
+
+echo "Starting iperf now..."
+
+sudo adb -s $device_id shell /data/local/tmp/iperf ${iperf_args[@]}
diff --git a/cmake_targets/autotests/tools/lib_autotest.py b/cmake_targets/autotests/tools/lib_autotest.py
new file mode 100644
index 0000000000000000000000000000000000000000..9ac2305250d4b4c2ee2970b5c6536bdddf52342a
--- /dev/null
+++ b/cmake_targets/autotests/tools/lib_autotest.py
@@ -0,0 +1,63 @@
+#!/usr/bin/python
+#******************************************************************************
+
+#    OpenAirInterface 
+#    Copyright(c) 1999 - 2014 Eurecom
+
+#    OpenAirInterface is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+
+
+#    OpenAirInterface is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+
+#   You should have received a copy of the GNU General Public License
+#   along with OpenAirInterface.The full GNU General Public License is 
+#   included in this distribution in the file called "COPYING". If not, 
+#   see <http://www.gnu.org/licenses/>.
+
+#  Contact Information
+#  OpenAirInterface Admin: openair_admin@eurecom.fr
+#  OpenAirInterface Tech : openair_tech@eurecom.fr
+#  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+  
+#  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+# *******************************************************************************/
+# \author Navid Nikaein, Rohit Gupta
+
+import os
+from pyroute2 import IPRoute
+import sys
+import re
+import threading
+import signal
+import traceback
+import commands
+
+def read_file(filename):
+  try:
+    file = open(filename, 'r')
+    return file.read()
+  except Exception, e:
+    # WE just ignore the exception as some files are probably not present
+    #error = ' Filename ' + filename 
+    #error = error + ' In function: ' + sys._getframe().f_code.co_name + ': *** Caught exception: '  + str(e.__class__) + " : " + str( e)
+    #error = error + traceback.format_exc()
+    #print error
+    return ''
+
+def find_usb_path(idVendor, idProduct):
+  for root, dirs, files in os.walk("/sys/bus/usb/devices", topdown=False):
+    for name in dirs:
+        tmpdir= os.path.join(root, name)
+        tmpidVendor = read_file(tmpdir+'/idVendor').replace("\n","")
+        tmpidProduct = read_file(tmpdir+'/idProduct').replace("\n","")
+        if tmpidVendor == idVendor and tmpidProduct == idProduct:
+            return tmpdir
+  return ''
+
diff --git a/cmake_targets/autotests/tools/remove_old_programs.bash b/cmake_targets/autotests/tools/remove_old_programs.bash
index 772ba11f58342d542aba7ff980fa39996b82943f..c5c26e3752c1bcdc2208cf7ab5db22bba8fe2a48 100755
--- a/cmake_targets/autotests/tools/remove_old_programs.bash
+++ b/cmake_targets/autotests/tools/remove_old_programs.bash
@@ -1,7 +1,32 @@
 #!/bin/bash
 
 #$1 programs to be killed and checked
-var=`ps -A |grep -E -i $1`
+echo "removing old programs..."
+echo "args = $1"
+echo "script name = $0"
+filename=$(basename "$0")
+echo "filename = $filename"
+echo "programs to be killed...$1"
+
+echo "bash PID = $$" 
+pid="$$"
+echo "pid = $pid"
+
+echo "Killing programs now..."
+
+ps -aux |grep -E -i -w "$1"
+
+var=`ps -aux |grep -E -i -w "$1" |awk '{print $2}'| tr '\n' ' ' | sed  "s/$pid/ /"`
+echo "Killing processes...$var"
+#var=`ps -aux |grep -E -i '$1' |awk '{print $2}'| tr '\n' ' ' | sed  "s/$pid/ /"`
+#echo $var 
+if [ -n "$var" ] ; then  sudo  kill -9 $var ; fi
+
+#| sudo xargs kill -9 
+
+echo "checking for old programs..."
+var=`ps -aux |grep -E -i -w '$1' |grep -Ev 'grep' | grep -Ev '$filename'`
+
 echo $var
 if [ -n "$var" ]; then echo 'Match found'; else echo 'Match not found' ;fi 
 
diff --git a/cmake_targets/autotests/tools/run_gdb b/cmake_targets/autotests/tools/run_gdb
new file mode 100755
index 0000000000000000000000000000000000000000..a12d6ce21dc0c7df6fc77c200ee766ebe7dab3f6
--- /dev/null
+++ b/cmake_targets/autotests/tools/run_gdb
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+#arg0 -> Name of executable
+#args[1...N] -> arguments to be passed to executable
+if [ -z "$OPENAIR_DIR" ]
+then
+    echo "OPENAIR_DIR environment not set. Exiting.."
+    exit
+fi 
+
+source $OPENAIR_DIR/cmake_targets/tools/build_helper
+
+args=($*)
+exec_name=${args[0]}
+exe_args=(${args[@]:1})
+gdb_file=$OPENAIR_DIR/targets/bin/gdb_file
+gdb_log=$OPENAIR_DIR/targets/bin/gdb_log.bt
+
+echo "args = ${args[@]}"
+echo "exec_name = $exec_name"
+echo "exe_args = ${exe_args[@]}"
+echo "gdb log file = $gdb_log"
+
+$SUDO rm -fr $gdb_file $gdb_log
+$SUDO touch $gdb_file $gdb_log 
+$SUDO chmod 777  $gdb_file $gdb_log
+
+$SUDO echo "file $exec_name"                  >> $gdb_file
+$SUDO echo "set args ${exe_args[@]}"          >> $gdb_file
+$SUDO echo "run"                              >> $gdb_file
+$SUDO echo "set logging overwrite on"         >> $gdb_file
+$SUDO echo "set logging file $gdb_log"        >> $gdb_file
+$SUDO echo "set logging on"                   >> $gdb_file
+$SUDO echo "set pagination off"               >> $gdb_file
+$SUDO echo "handle SIG33 pass nostop noprint" >> $gdb_file
+$SUDO echo "echo backtrace:\n"                >> $gdb_file
+$SUDO echo "backtrace full"                   >> $gdb_file
+$SUDO echo "echo \n\nVariables:\n"            >> $gdb_file
+$SUDO echo "info variables"                   >> $gdb_file
+$SUDO echo "echo \n\nlocals:\n"               >> $gdb_file
+$SUDO echo "info locals"                      >> $gdb_file
+$SUDO echo "echo \n\nregisters:\n"            >> $gdb_file
+$SUDO echo "info registers"                   >> $gdb_file
+$SUDO echo "echo \n\ncurrent instructions:\n" >> $gdb_file 
+$SUDO echo "x/16i \$pc"                       >> $gdb_file
+$SUDO echo "echo \n\nthreads backtrace:\n"    >> $gdb_file
+$SUDO echo "thread apply all backtrace"       >> $gdb_file
+$SUDO echo "set logging off"                  >> $gdb_file
+$SUDO echo "quit"                             >> $gdb_file
+
+echo "Contents of gdb_file...start"
+$SUDO cat $gdb_file
+echo "Contents of gdb_file...finish"
+
+$SUDO gdb -n -x $gdb_file 2>&1
+
diff --git a/cmake_targets/autotests/tools/search_repl.py b/cmake_targets/autotests/tools/search_repl.py
index 0a91945c771770992f926386d258b8f456921830..fefc142f087e00a71a6ff5e67b28953a81abb01f 100755
--- a/cmake_targets/autotests/tools/search_repl.py
+++ b/cmake_targets/autotests/tools/search_repl.py
@@ -1,27 +1,65 @@
 #!/usr/bin/python
+#******************************************************************************
+
+#    OpenAirInterface 
+#    Copyright(c) 1999 - 2014 Eurecom
+
+#    OpenAirInterface is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+
+
+#    OpenAirInterface is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+
+#   You should have received a copy of the GNU General Public License
+#   along with OpenAirInterface.The full GNU General Public License is 
+#   included in this distribution in the file called "COPYING". If not, 
+#   see <http://www.gnu.org/licenses/>.
+
+#  Contact Information
+#  OpenAirInterface Admin: openair_admin@eurecom.fr
+#  OpenAirInterface Tech : openair_tech@eurecom.fr
+#  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+  
+#  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+# *******************************************************************************/
+# \author Navid Nikaein, Rohit Gupta
+
 import sys
 import re
+import os
 
 #Arg 1 name of file
 #Arg 2 keyword
 #arg 3 replacement text
 #Note that these should be seperated by spaces
 if len(sys.argv) != 4:
-  print "search_repl.py: Wrong number of arguments. This program needs 3 arguments"
+  print "search_repl.py: Wrong number of arguments. This program needs 3 arguments. The number of arguments supplied : " + str(sys.argv)
   sys.exit()
-filename = sys.argv[1]
+filename = os.path.expandvars(sys.argv[1])
 keyword = sys.argv[2]
 replacement_text = sys.argv[3]
 
+
 file = open(filename, 'r')
 string = file.read()
 file.close()
 
 
 if keyword == 'mme_ip_address':
-   #string =  (re.sub(r"mme_ip_address\s*=\s*\([^\$]+)\)\s*;\s*", r"<% tex \1 %>", t, re.M)
    replacement_text = keyword + ' =  ( { ' + replacement_text + ' } ) ; '
    string = re.sub(r"mme_ip_address\s*=\s*\(([^\$]+?)\)\s*;", replacement_text, string, re.M)
+elif keyword == 'IPV4_LIST' or keyword=='GUMMEI_LIST' or keyword == 'TAI_LIST':
+   replacement_text = keyword + ' =  ( ' + replacement_text + '  ) ; '
+   string = re.sub(r"%s\s*=\s*\(([^\$]+?)\)\s*;" % keyword, replacement_text, string, re.M)
+elif keyword == 'rrh_gw_config':
+   replacement_text = keyword + ' =  ( { ' + replacement_text + ' } ) ; '
+   string = re.sub(r"rrh_gw_config\s*=\s*\(([^\$]+?)\)\s*;", replacement_text, string, re.M)
 else :
    replacement_text = keyword + ' =  ' + replacement_text + ' ; '
    string = re.sub(r"%s\s*=\s*([^\$]+?)\s*;" % keyword , replacement_text, string, re.M)   
diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai
index 25bec96b98cd28571ef6b9f65457cb256bffb3e8..935c57f0f109e9fbc30d77a7f63ed3aa07a92e91 100755
--- a/cmake_targets/build_oai
+++ b/cmake_targets/build_oai
@@ -33,6 +33,7 @@
 # brief OAI automated build tool that can be used to install, compile, run OAI.
 # author  Navid Nikaein, Lionel GAUTHIER, Laurent Thomas
 
+set -e
 
 ################################
 # include helper functions
@@ -42,18 +43,25 @@ THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
 source $THIS_SCRIPT_PATH/tools/build_helper
 
 MSC_GEN="False"
-XFORMS="False"
+XFORMS="True"
 PRINT_STATS="False"
 VCD_TIMING="False"
+DEADLINE_SCHEDULER_FLAG_USER="False"
+FORCE_DEADLINE_SCHEDULER_FLAG_USER=""
+CPU_AFFINITY_FLAG_USER="True" #Only valid when lowlatecy flag is set to False
 REL="Rel10"
-HW="EXMIMO"
+HW="None"
+TP="None"
 NOS1=0
 EPC=0
 VERBOSE_COMPILE=0
 CFLAGS_PROCESSOR_USER=""
 RUN_GROUP=0
 TEST_CASE_GROUP=""
-
+BUILD_DOXYGEN=0
+T_TRACER="False"
+DISABLE_HARDWARE_DEPENDENCY="False"
+CMAKE_BUILD_TYPE=""
 trap handle_ctrl_c INT
 
 function print_help() {
@@ -75,7 +83,7 @@ Options
 --install-optional-packages
    Install useful but not mandatory packages such as valgrind
 -g | --run-with-gdb
-   Add debugging symbols to compilation directives
+   Add debugging symbols to compilation directives. It also disables any compiler optimization.
 -h | --help
    Print this help
 --eNB
@@ -88,10 +96,13 @@ Options
    default is Rel10,
    Rel8 limits the implementation to 3GPP Release 8 version
 -w | --hardware
-   EXMIMO (Default), USRP, BLADERF, ETHERNET, None
+   EXMIMO, USRP, BLADERF, ETHERNET, LMSSDR, None (Default)
    Adds this RF board support (in external packages installation and in compilation)
+-t | --transport protocol
+   ETHERNET , None
+   Adds this trasport protocol support in compilation
 --oaisim
-   Makes the oaisim simulator. Hardware will be defaulted to "NONE".
+   Makes the oaisim simulator. Hardware will be defaulted to "None".
 --phy_simulators
    Makes the unitary tests Layer 1 simulators
 --core_simulators
@@ -113,7 +124,18 @@ Options
    Shows detailed compilation instructions in makefile
 --cflags_processor
    Manually Add CFLAGS of processor if they are not detected correctly by script. Only add these flags if you know your processor supports them. Example flags: -msse3 -msse4.1 -msse4.2 -mavx2
-
+--build-doxygen
+   Builds doxygen based documentation.
+--disable-deadline
+   Disables deadline scheduler of Linux kernel (>=3.14.x).
+--enable-deadline
+   Enable deadline scheduler of Linux kernel (>=3.14.x). 
+--disable-cpu-affinity
+   Disables CPU Affinity between UHD/TX/RX Threads (Valid only when deadline scheduler is disabled). By defaulT, CPU Affinity is enabled when not using deadline scheduler. It is enabled only with >2 CPUs. For eNB, CPU_0-> Device library (UHD), CPU_1->TX Threads, CPU_2...CPU_MAX->Rx Threads. For UE, CPU_0->Device Library(UHD), CPU_1..CPU_MAX -> All the UE threads
+--T-tracer
+   Enables the T tracer.
+--disable-hardware-dependency
+   Disable HW dependency during installation
 Usage (first build):
  oaisim (eNB + UE): ./build_oai -I -g --oaisim -x --install-system-files
  Eurecom EXMIMO + COTS UE : ./build_oai -I -g --eNB -x --install-system-files
@@ -149,7 +171,8 @@ function main() {
             shift;;
        -g | --run-with-gdb)
             GDB=1
-            echo_info "Will Compile with gdb symbols"
+            CMAKE_BUILD_TYPE="Debug"
+            echo_info "Will Compile with gdb symbols and disable compiler optimization"
             shift;;
        --eNB)
             eNB=1
@@ -165,20 +188,35 @@ function main() {
             shift;;
        -r | --3gpp-release)
             REL=$2
-            echo_info "setting release to: $REL"
+            echo_info "Setting release to: $REL"
             shift 2;;
        -w | --hardware)
             HW="$2" #"${i#*=}"
-            # Use OAI_USRP  as the key word USRP is used inside UHD driver
-            if [ "$HW" == "USRP" ] ; then 
-		HW="OAI_USRP"
-	    fi 
-            if [ "$HW" == "BLADERF" ] ; then 
-		HW="OAI_BLADERF"
-	    fi 
-            echo_info "setting hardware to: $HW"
+            # Use OAI_USRP  as the key word USRP is used inside UHD driver           
+	    if [ "$HW" != "BLADERF" -a  "$HW" != "USRP" -a "$HW" != "LMSSDR" -a  "$HW" != "None" -a  "$HW" != "EXMIMO"  ] ; then 
+		echo_fatal "Unknown HW type $HW will exit..."		
+	    else
+		if [ "$HW" == "USRP" ] ; then 
+		    HW="OAI_USRP"
+		fi 
+		if [ "$HW" == "BLADERF" ] ; then 
+		    HW="OAI_BLADERF"
+		fi
+		if [ "$HW" == "LMSSDR" ] ; then 
+		    HW="OAI_LMSSDR"
+		fi 
+		echo_info "Setting hardware to: $HW"
+	    fi
             shift 2;;
-       --oaisim)
+	-t | --transport_protocol)
+            TP="$2" #"${i#*=}"
+	    if [ "$TP" != "ETHERNET" -a "$TP" != "None" ] ; then 
+		echo_fatal "Unknown TP type $TP will exit..."		
+	    else
+		echo_info "Setting transport protocol to: $TP"		
+	    fi
+            shift 2;;
+	--oaisim)
             oaisim=1
             echo_info "Will compile oaisim and drivers nasmesh, ..."
             shift;;
@@ -200,7 +238,7 @@ function main() {
             echo_info "executing test cases only in group: $TEST_CASE_GROUP"
             shift 2;;
        -V | --vcd)
-            echo_info "setting gtk-wave output"
+            echo_info "Setting gtk-wave output"
             VCD_TIMING=1
             EXE_ARGUMENTS="$EXE_ARGUMENTS -V"
             shift;;
@@ -223,8 +261,32 @@ function main() {
             shift;;
        --cflags_processor)
             CFLAGS_PROCESSOR_USER=$2
-            echo_info "setting CPU FLAGS from USER to: $CFLAGS_PROCESSOR_USER"
+            echo_info "Setting CPU FLAGS from USER to: $CFLAGS_PROCESSOR_USER"
             shift 2;;
+       --build-doxygen)
+	    BUILD_DOXYGEN=1
+            echo_info "Will build doxygen support"
+            shift;;     
+       --disable-deadline)
+            FORCE_DEADLINE_SCHEDULER_FLAG_USER="False"
+            echo_info "Disabling the usage of deadline scheduler"
+            shift 1;;
+       --enable-deadline)
+            FORCE_DEADLINE_SCHEDULER_FLAG_USER="True"
+            echo_info "Enabling the usage of deadline scheduler"
+            shift 1;;
+       --disable-cpu-affinity)
+            CPU_AFFINITY_FLAG_USER="False"
+            echo_info "Disabling CPU Affinity (only valid when not using deadline scheduler)"
+            shift 1;;
+       --T-tracer)
+            T_TRACER="True"
+            echo_info "Enabling the T tracer"
+            shift 1;;
+       --disable-hardware-dependency)
+            echo_info "Disabling hardware dependency for compiling software"
+            DISABLE_HARDWARE_DEPENDENCY="True"
+            shift 1;;
         -h | --help)
             print_help
             exit 1;;
@@ -234,6 +296,69 @@ function main() {
             break;;
    esac
   done
+  
+  #########################################################
+  # check validity of HW and TP parameters for RRH and eNB
+  #########################################################
+  # to be discussed
+  
+  if [ "$eNB" = "1" ] ; then
+      if [ "$HW" = "None" -a  "$TP" = "None" ] ; then
+	  echo_fatal "Define a local radio head (e.g. -w EXMIMO) or a transport protocol (e.g. -t ETHERNET) to communicate with a remote radio head!"
+      fi
+      if [ "$HW" != "None" -a  "$TP" != "None" ] ; then
+	  echo_fatal "Currently eNB  can not support simultaniously local and remote radio heads!!"
+      fi      
+      if [ "$HW" = "None" ] ; then 
+	  echo_info "No radio head has been selected (HW set to $HW)"	
+      fi
+      if [ "$TP" = "None" ] ; then
+	  echo_info "No transport protocol has been selected (TP set to $TP)"	
+      fi
+  fi
+  
+  if [ "$RRH" = "1" ] ; then
+      if [ "$TP" = "None" ] ; then
+	  echo_fatal "A transport protocol (e.g. -t ETHERNET) must be defined!"
+      fi
+      if [ "$HW" = "None" ] ; then
+	  echo_info "No radio head has been selected (HW set to $HW)"	
+      fi
+  fi
+
+  echo_info "RF HW set to $HW" 
+  #Now we set flags to enable deadline scheduler settings
+  #By default: USRP: disable, 
+  #By default: BLADERF: enable,
+  #By default: EXMIMO: enable
+  if [ "$FORCE_DEADLINE_SCHEDULER_FLAG_USER" = "" ]; then
+     if [ "$HW" = "EXMIMO" ] ; then 
+        DEADLINE_SCHEDULER_FLAG_USER="False"
+     elif [ "$HW" = "ETHERNET" ] ; then 
+        DEADLINE_SCHEDULER_FLAG_USER="True"
+     elif [ "$HW" = "OAI_USRP" ] ; then 
+        DEADLINE_SCHEDULER_FLAG_USER="False"
+     elif [ "$HW" = "OAI_BLADERF" ] ; then 
+        DEADLINE_SCHEDULER_FLAG_USER="False"
+     elif [ "$HW" = "OAI_LMSSDR" ] ; then 
+        DEADLINE_SCHEDULER_FLAG_USER="False"
+     elif [ "$HW" = "None" ] ; then 
+        DEADLINE_SCHEDULER_FLAG_USER="False"
+     else 
+        echo_error "Unknown HW type $HW. Exiting now..."
+        exit 
+     fi
+  else
+     DEADLINE_SCHEDULER_FLAG_USER=$FORCE_DEADLINE_SCHEDULER_FLAG_USER
+  fi
+
+  #Disable CPU Affinity for deadline scheduler
+  if [ "$DEADLINE_SCHEDULER_FLAG_USER" = "True" ] ; then 
+     CPU_AFFINITY_FLAG_USER="False"
+  fi
+
+  echo_info "Flags for Deadline scheduler: $DEADLINE_SCHEDULER_FLAG_USER"
+  echo_info "Flags for CPU Affinity: $CPU_AFFINITY_FLAG_USER"
 
   ############################################
   # setting and printing OAI envs, we should check here
@@ -271,10 +396,16 @@ function main() {
     if [ "$HW" == "OAI_USRP" ] ; then
       echo_info "installing packages for USRP support"
       check_install_usrp_uhd_driver
+      if [ ! "$DISABLE_HARDWARE_DEPENDENCY" == "True" ]; then
+        install_usrp_uhd_driver
+      fi
     fi 
     if [ "$HW" == "OAI_BLADERF" ] ; then
-      echo_info "installing packages for BALDERF support"
+      echo_info "installing packages for BLADERF support"
       check_install_bladerf_driver
+      if [ ! "$DISABLE_HARDWARE_DEPENDENCY" == "True" ]; then
+        flash_firmware_bladerf
+      fi
     fi
   fi
 
@@ -284,9 +415,11 @@ function main() {
   fi
 
   if [ "$oaisim" = "1" ] ; then
-      if [ "$HW" != "ETHERNET" ] ; then 
-	  HW="NONE"
-      fi 
+      #to be discussed
+      # there is no RF device and no transport protocol 
+      HW="None" 
+      TP="None"
+      
       if [ "$XFORMS" == "True" ] ; then 
 	  PRINT_STATS="True"
       fi 
@@ -315,12 +448,17 @@ function main() {
     if [ "$NOS1" = "1" ] ; then
 	cat  $DIR/$lte_build_dir/CMakeLists.template >>  $cmake_file
     fi
+    echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
     echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >>  $cmake_file
     echo "set ( XFORMS $XFORMS )"                  >>  $cmake_file
     echo "set ( RRC_ASN1_VERSION \"${REL}\")"      >>  $cmake_file
     echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )"     >>  $cmake_file
     echo "set ( RF_BOARD \"${HW}\")"               >>  $cmake_file
-    echo "set(PACKAGE_NAME \"${lte_exec}\")"     >>  $cmake_file
+    echo "set ( TRANSP_PRO \"${TP}\")"             >>  $cmake_file
+    echo "set(PACKAGE_NAME \"${lte_exec}\")"       >>  $cmake_file
+    echo "set (DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )"    >>$cmake_file
+    echo "set (CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )"      >>$cmake_file
+    echo "set ( T_TRACER $T_TRACER )"              >>  $cmake_file
     echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
     cd  $DIR/$lte_build_dir/build
     cmake ..
@@ -349,7 +487,7 @@ function main() {
     compilations \
       $lte_build_dir ue_ip \
       CMakeFiles/ue_ip/ue_ip.ko $dbin/ue_ip.ko
-      
+
 #    mkdir -p $DIR/at_commands/build
 #    cd $DIR/at_commands/build
 #    cmake ..
@@ -372,6 +510,11 @@ function main() {
     # generate USIM data
     if [ -f $dbin/nvram ]; then
       install_nas_tools $dbin $dconf
+      echo_info "Copying UE specific part to $DIR/$lte_build_dir/build"
+      cp -Rvf $dbin/.ue_emm.nvram $DIR/$lte_build_dir/build
+      cp -Rvf $dbin/.ue.nvram $DIR/$lte_build_dir/build
+      cp -Rvf $dbin/.usim.nvram $DIR/$lte_build_dir/build
+
     else
       echo_warning "not generated UE NAS files: binaries not found"
     fi
@@ -431,6 +574,8 @@ function main() {
     cp $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 $dbin
   fi
 
+  # oaisim compilation
+  ###############
   if [ "$oaisim" = "1" ] ; then
     dconf=$OPENAIR_DIR/targets/bin
       if [ "$NOS1" =  "1" ] ; then
@@ -444,11 +589,13 @@ function main() {
     echo_info "Compiling $oaisim_exec ($oaisim_build_dir)"
     cmake_file=$DIR/$oaisim_build_dir/CMakeLists.txt
     cp $DIR/$oaisim_build_dir/CMakeLists.template $cmake_file
+    echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
     echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >>  $cmake_file
     echo "set ( XFORMS $XFORMS )" >>  $cmake_file
     echo "set ( PRINT_STATS $PRINT_STATS )" >>  $cmake_file
     echo "set ( RRC_ASN1_VERSION \"${REL}\")" >>  $cmake_file
     echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >>  $cmake_file
+    echo "set ( T_TRACER $T_TRACER )"          >>  $cmake_file
     echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
     [ "$CLEAN" = "1" ] && rm -rf $DIR/$oaisim_build_dir/build
     mkdir -p $DIR/$oaisim_build_dir/build
@@ -511,9 +658,11 @@ function main() {
 
     cmake_file=$DIR/oaisim_mme_build_oai/CMakeLists.txt
     cp $DIR/oaisim_mme_build_oai/CMakeLists.template $cmake_file
-    echo "set(XFORMS $XFORMS )" >>  $cmake_file
-    echo "set(RRC_ASN1_VERSION \"${REL}\")" >>  $cmake_file
-    echo "set(ENABLE_VCD_FIFO $VCD_TIMING )" >>  $cmake_file
+    echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
+    echo "set ( XFORMS $XFORMS )" >>  $cmake_file
+    echo "set ( RRC_ASN1_VERSION \"${REL}\")" >>  $cmake_file
+    echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >>  $cmake_file
+    echo "set ( T_TRACER $T_TRACER )"        >>  $cmake_file
     echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
     #[ "$CLEAN" = "1" ] && rm -rf $DIR/oaisim_mme_build_oai/build
     #mkdir -p $DIR/oaisim_mme_build_oai/build
@@ -525,32 +674,127 @@ function main() {
   fi
 
   # RRH compilation
-  ##################
+  #####################
   if [ "$RRH" = "1" ] ; then
-    echo_info "Compiling RRH"
-    if [  $HW == "ETHERNET" ] ; then 
-	echo_info "RF frontend for RRH is not defined. This mode is used for testing (loopback)."
-    elif [ $HW != "EXMIMO" -a $HW != "OAI_USRP" -a $HW != "OAI_BLADERF" ] ; then 
-	echo_fatal "Hardware not defined ($HW)"
-    fi
-    cmake_file=$DIR/rrh_gw/CMakeLists.txt
-    echo "cmake_minimum_required(VERSION 2.8)"   >   $cmake_file
-    echo "set(ENABLE_VCD_FIFO $VCD_TIMING )"     >>  $cmake_file
-    echo "set(ENABLE_ITTI False )"     					 >>  $cmake_file
-    echo "set(RF_BOARD \"${HW}\")"               >>  $cmake_file
-    echo 'set(PACKAGE_NAME "\"rrh_gw\"")' >>  $cmake_file
-    echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
 
-    [ "$CLEAN" = "1" ] && rm -rf $DIR/rrh_gw/build
-    mkdir -p $DIR/rrh_gw/build
-    cd $DIR/rrh_gw/build
+     rrh_exec=rrh_gw
+     rrh_build_dir=rrh_gw
+     
+     echo_info "Compiling $rrh_exec ..."
+    
+     [ "$CLEAN" = "1" ] && rm -rf $DIR/rrh_gw/build 
+     mkdir -p $DIR/$rrh_build_dir/build
+     cmake_file=$DIR/$rrh_build_dir/CMakeLists.txt
+     echo "cmake_minimum_required(VERSION 2.8)"   >   $cmake_file
+     echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
+     echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )"     >>  $cmake_file
+     echo "set ( ENABLE_ITTI False )"     		 >>  $cmake_file
+     echo "set ( RF_BOARD \"${HW}\")"               >>  $cmake_file
+     echo "set ( TRANSP_PRO \"${TP}\")"             >>  $cmake_file
+     echo 'set ( PACKAGE_NAME "\"rrh_gw\"")'        >>  $cmake_file
+     echo "set ( DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )"    >>$cmake_file
+     echo "set ( CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )"    >>$cmake_file
+     echo "set ( T_TRACER $T_TRACER )"            >>  $cmake_file
+     echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file    
+     cd $DIR/$rrh_build_dir/build
+     cmake ..
+     compilations \
+	 rrh_gw rrh_gw \
+	 rrh_gw $dbin/rrh_gw
+
+  fi
+  
+  # build RF device and transport protocol libraries
+  #####################################
+  if [ "$eNB" = "1" -o  "$RRH" = "1" ] ; then
+
+      if [ "$eNB" = "1" ] ; then
+	  build_dir=$lte_build_dir	  
+      else
+	  build_dir=$rrh_build_dir	 
+      fi
+
+      # build RF device libraries (currently EXMIMO is not complied with the rest of HW targets)
+      if [ "$HW" != "None" ] ; then
+	  rm -f liboai_device.so
+	  rm -f $dbin/liboai_device.so
+
+
+	  # link liboai_device.so with the selected RF device library
+	  if [ "$HW" == "EXMIMO" ] ; then
+	      
+	      #add exmimo compilation
+	      #TODO EXMIMO library support
+	     
+	      echo_info "liboai_device.so is linked to EXMIMO device library"       
+	  elif [ "$HW" == "OAI_USRP" ] ; then
+	      if [ -d "/usr/include/uhd" ] ; then
+		  compilations \
+		      $build_dir oai_usrpdevif \
+		      liboai_usrpdevif.so $dbin/liboai_usrpdevif.so.$REL
+	      fi
+
+	      ln -s liboai_usrpdevif.so liboai_device.so
+	      ln -s $dbin/liboai_usrpdevif.so.$REL $dbin/liboai_device.so
+	      echo_info "liboai_device.so is linked to USRP device library"        
+	  elif [ "$HW" == "OAI_BLADERF" ] ; then
+	      if [ -f "/usr/include/libbladeRF.h" ] ; then
+		  compilations \
+		      $build_dir oai_bladerfdevif \
+		      liboai_bladerfdevif.so $dbin/liboai_bladerfdevif.so.$REL
+	      fi
+
+	      ln -s liboai_bladerfdevif.so liboai_device.so
+	      ln -s $dbin/liboai_bladerfdevif.so.$REL $dbin/liboai_device.so
+	      echo_info "liboai_device.so is linked to BLADERF device library"	 
+	  elif [ "$HW" == "OAI_LMSSDR" ] ; then
+#	      if [ -f "/usr/include/libbladeRF.h" ] ; then
+		  compilations \
+		      $build_dir oai_lmssdrdevif \
+		      liboai_lmssdrdevif.so $dbin/liboai_lmssdrdevif.so.$REL
+#	      fi
+
+	      ln -s liboai_lmssdrdevif.so liboai_device.so
+	      ln -s $dbin/liboai_lmssdrdevif.so.$REL $dbin/liboai_device.so
+	      echo_info "liboai_device.so is linked to LMSSDR device library"	 
+	  else 
+	      echo_info "liboai_device.so is not linked to any device library"	    
+	  fi
+      fi
+      
+      # build trasport protocol libraries (currently only ETHERNET is available)
+      if [ "$TP" != "None" ] ; then
+	  rm -f liboai_transpro.so
+	  rm -f $dbin/liboai_transpro.so
+
+	  if [ "$TP" == "ETHERNET" ] ; then
+	      compilations \
+		  $build_dir oai_eth_transpro \
+		  liboai_eth_transpro.so $dbin/liboai_eth_transpro.so.$REL
+	      ln -s liboai_eth_transpro.so liboai_transpro.so
+	      ln -s $dbin/liboai_eth_transpro.so.$REL $dbin/liboai_transpro.so
+	      echo_info "liboai_transpro.so is linked with ETHERNET library"	 
+	  fi      
+      fi
+fi
+
+
+  # Doxygen Support
+  #####################
+  if [ "$BUILD_DOXYGEN" = "1" ] ;then
+    doxygen_log=$OPENAIR_DIR/cmake_targets/log/doxygen.log
+    echo_info "Building doxygen based documentation. The documentation file is located here: $OPENAIR_DIR/targets/DOCS/html/index.html"
+    echo_info "Doxygen Generation log is located here: $doxygen_log"
+    echo_info "Generating doxygen files....please wait"
+    (
+    [ "$CLEAN" = "1" ] && rm -rf $OPENAIR_DIR/cmake_targets/doxygen/build
+    mkdir -p $OPENAIR_DIR/cmake_targets/doxygen/build
+    cd $OPENAIR_DIR/cmake_targets/doxygen/build
     cmake ..
-    compilations \
-      rrh_gw rrh_gw \
-      rrh_gw $dbin/rrh_gw
+    make doc
+    ) >& $doxygen_log
   fi
 
-  
   # Auto-tests
   #####################
   if [ "$OAI_TEST" = "1" ]; then
@@ -568,9 +812,9 @@ function main() {
     rm -fr $OPENAIR_DIR/cmake_targets/autotests/log
     mkdir -p $OPENAIR_DIR/cmake_targets/autotests/log
     if [ "$RUN_GROUP" -eq "1" ]; then
-        $OPENAIR_DIR/cmake_targets/autotests/run_exec_autotests.bash -g "$TEST_CASE_GROUP" -p '$mypassword' >& $OPENAIR_DIR/cmake_targets/autotests/log/autotests.log &
+        $OPENAIR_DIR/cmake_targets/autotests/run_exec_autotests.bash -g "$TEST_CASE_GROUP" -p $mypassword >& $OPENAIR_DIR/cmake_targets/autotests/log/autotests.log &
     else
-        $OPENAIR_DIR/cmake_targets/autotests/run_exec_autotests.bash -p '$mypassword' >& $OPENAIR_DIR/cmake_targets/autotests/log/autotests.log &
+        $OPENAIR_DIR/cmake_targets/autotests/run_exec_autotests.bash -p $mypassword >& $OPENAIR_DIR/cmake_targets/autotests/log/autotests.log &
     fi
     wait
   else
diff --git a/cmake_targets/epc_test/CMakeLists.template b/cmake_targets/epc_test/CMakeLists.template
index 25d94ea852b92eaa2b4080810a9aef13bf365dd7..76defbc7d7f1318602aa6c9ecbc85be4169a94ff 100644
--- a/cmake_targets/epc_test/CMakeLists.template
+++ b/cmake_targets/epc_test/CMakeLists.template
@@ -1,11 +1,13 @@
 cmake_minimum_required(VERSION 2.8)
 
 set (  CMAKE_BUILD_TYPE "RelWithDebInfo" )
+set (  ASN_DEBUG False)
 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 )
 set (  ENABLE_NAS_UE_LOGGING True )
@@ -27,7 +29,7 @@ set (  LINUX_LIST False )
 set (  LINUX True )
 set (  LOCALIZATION False )
 set (  LOG_NO_THREAD True )
-set (  LOWLATENCY False )
+set (  DEADLINE_SCHEDULER False )
 set (  MAC_CONTEXT 1 )
 set (  MAX_NUM_CCs 1 )
 set (  MESSAGE_CHART_GENERATOR False)
@@ -47,9 +49,9 @@ set (  OAI_EMU False )
 set (  OAISIM False )
 set (  OAI_NW_DRIVER_TYPE_ETHERNET False )
 set (  OAI_NW_DRIVER_USE_NETLINK True )
-set (  OPENAIR1 False )
-set (  OPENAIR2 False )
-set (  OPENAIR_LTE F )
+set (  OPENAIR1 True )
+set (  OPENAIR2 True )
+set (  OPENAIR_LTE True )
 set (  PACKAGE_NAME "epc_test" )
 set (  PBS_SIM False )
 set (  PDCP_USE_NETLINK True )
@@ -74,4 +76,4 @@ set (  SMBV False )
 set (  TEST_OMG False )
 set (  USE_MME "R10" )
 set (  USER_MODE True )
-set (  XER_PRINT False )
+set (  XER_PRINT True )
diff --git a/cmake_targets/lte-simulators/CMakeLists.txt b/cmake_targets/lte-simulators/CMakeLists.txt
index 7a0e84b425a8d7493e221ab3e256e7b7486e138f..0b706c8748eae45600e328daef5f39038396170d 100644
--- a/cmake_targets/lte-simulators/CMakeLists.txt
+++ b/cmake_targets/lte-simulators/CMakeLists.txt
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8)
 set(PACKAGE_NAME "unitary_tests_simulators")
 set(PHYSIM True)
 set(RF_BOARD None)
-set(XFORMS False)
+set(XFORMS True)
 
 set(DEBUG_PHY False)
 set(MU_RECIEVER False)
diff --git a/cmake_targets/oaisim_build_oai/CMakeLists.template b/cmake_targets/oaisim_build_oai/CMakeLists.template
index 76564d8fdd77954a80dea1a63823d3c375924a72..0a05d68d10d5d6ce758e8aa17588c444632bf700 100644
--- a/cmake_targets/oaisim_build_oai/CMakeLists.template
+++ b/cmake_targets/oaisim_build_oai/CMakeLists.template
@@ -28,7 +28,7 @@ set (  LINUX_LIST False )
 set (  LINUX True )
 set (  LOCALIZATION False )
 set (  LOG_NO_THREAD True )
-set (  LOWLATENCY False )
+set (  DEADLINE_SCHEDULER False )
 set (  MAC_CONTEXT 1 )
 set (  MAX_NUM_CCs 1 )
 set (  MESSAGE_CHART_GENERATOR False)
diff --git a/cmake_targets/oaisim_mme_build_oai/CMakeLists.template b/cmake_targets/oaisim_mme_build_oai/CMakeLists.template
index 1035a2859958a4b9e801746529f943a6b0171851..69fa209b16d266e5a5d846facba62904bd11143b 100644
--- a/cmake_targets/oaisim_mme_build_oai/CMakeLists.template
+++ b/cmake_targets/oaisim_mme_build_oai/CMakeLists.template
@@ -29,7 +29,7 @@ set (  LINUX_LIST False )
 set (  LINUX False )
 set (  LOCALIZATION False )
 set (  LOG_NO_THREAD False )
-set (  LOWLATENCY False )
+set (  DEADLINE_SCHEDULER False )
 set (  MAC_CONTEXT 1 )
 set (  MAX_NUM_CCs 1 )
 set (  MIH_C_MEDIEVAL_EXTENSIONS False )
diff --git a/cmake_targets/oaisim_noS1_build_oai/CMakeLists.template b/cmake_targets/oaisim_noS1_build_oai/CMakeLists.template
index 84c71de70e09f65266ed4a0645aa18b7fa719ab8..ec02ceec40fe25e0ed784332f117ce48da79a4b4 100644
--- a/cmake_targets/oaisim_noS1_build_oai/CMakeLists.template
+++ b/cmake_targets/oaisim_noS1_build_oai/CMakeLists.template
@@ -28,7 +28,7 @@ set (  LINUX_LIST False )
 set (  LINUX True )
 set (  LOCALIZATION False )
 set (  LOG_NO_THREAD 1 )
-set (  LOWLATENCY False )
+set (  DEADLINE_SCHEDULER False )
 set (  MAC_CONTEXT 1 )
 set (  MAX_NUM_CCs 2 )
 set (  MESSAGE_CHART_GENERATOR         False )
diff --git a/cmake_targets/rrh_gw/CMakeLists.txt b/cmake_targets/rrh_gw/CMakeLists.txt
deleted file mode 100644
index 9ff1437f0c58db559a3a9386489a18cc1e2a596e..0000000000000000000000000000000000000000
--- a/cmake_targets/rrh_gw/CMakeLists.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-set(ENABLE_VCD_FIFO False )
-set(ENABLE_ITTI False )
-set(RF_BOARD "ETHERNET")
-set(PACKAGE_NAME "\"rrh_gw\"")
-include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)
diff --git a/cmake_targets/s1c_mme_test/CMakeLists.template b/cmake_targets/s1c_mme_test/CMakeLists.template
index 4067202df16d6036e6354b0ca4d1eff851d74576..994edf835232401dbc9f41e70ae8b8e9e47e4740 100644
--- a/cmake_targets/s1c_mme_test/CMakeLists.template
+++ b/cmake_targets/s1c_mme_test/CMakeLists.template
@@ -29,7 +29,7 @@ set (  LINUX_LIST False )
 set (  LINUX True )
 set (  LOCALIZATION False )
 set (  LOG_NO_THREAD True )
-set (  LOWLATENCY False )
+set (  DEADLINE_SCHEDULER False )
 set (  MAC_CONTEXT 1 )
 set (  MAX_NUM_CCs 1 )
 set (  MESSAGE_CHART_GENERATOR False)
diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper
index a1fefec3ce57275189ba37aee399b2b21db31eee..0f87ce1ad37c5bb2b2d622f3c9525068a05a4455 100755
--- a/cmake_targets/tools/build_helper
+++ b/cmake_targets/tools/build_helper
@@ -1,4 +1,4 @@
-################################################################################
+ ################################################################################
 #
 # Copyright (c) 2015, EURECOM (www.eurecom.fr)
 # All rights reserved.
@@ -30,7 +30,7 @@
 ################################################################################
 # file build_helper
 # brief
-# author Laurent Thomas
+# authors Laurent Thomas, Lionel GAUTHIER
 #
 #######################################
 SUDO='sudo -E'
@@ -67,7 +67,45 @@ echo_warning() { cecho "$*" $yellow       ;}
 echo_success() { cecho "$*" $green        ;}
 echo_info()    { cecho "$*" $blue         ;}
 
+########################
+# distribution helpers #
+########################
+
+# This function return a string to identify the distribution we are running
+# If we can't check the distribution, it returns "Unknown"
+# This function return always true as exit code by design
+# Examples:
+#   Ubuntu16.04
+#   Debian8.5
+get_distribution_release() {
+    local distributor
+    if distributor=$(lsb_release -si 2>/dev/null) ; then
+        echo $distributor$(lsb_release -sr)
+    else
+        echo Unknown
+    fi
+}
+
+check_supported_distribution() {
+    local distribution=$(get_distribution_release)
+    case "$distribution" in
+        "Ubuntu16.04") return 0 ;;
+        "Ubuntu14.04") return 0 ;;
+    esac
+    return 1
+}
+
+##################
+# Error handlers #
+##################
+
+handler_EXIT() {
+	local exit_code=$?
+    [ "$exit_code" -eq 0 ] || echo_error "build have failed"
+	exit $exit_code
+}
 
+trap handler_EXIT EXIT
 
 ###########################
 # Cleaners
@@ -109,6 +147,7 @@ clean_all_files() {
 
 compilations() {
   cd $OPENAIR_DIR/cmake_targets/$1/build
+  set +e
   {
     rm -f $3
     if [ "$VERBOSE_COMPILE" == "1" ]; then
@@ -118,12 +157,14 @@ compilations() {
     fi
 
   } > $dlog/$2.$REL.txt 2>&1
+  set -e
   echo_info "Log file for compilation has been written to: $dlog/$2.$REL.txt"
   if [ -s $3 ] ; then
      cp $3 $4
      echo_success "$2 compiled"
   else
      echo_error "$2 compilation failed"
+     exit 1
   fi
 }
 
@@ -132,10 +173,21 @@ compilations() {
 ############################################
 
 install_nettle_from_source() {
+    nettle_install_log=$OPENAIR_DIR/cmake_targets/log/nettle_install_log.txt
+    echo_info "\nInstalling Nettle. The log file for nettle installation is here: $nettle_install_log "
+    (
     cd /tmp
     echo "Downloading nettle archive"
-    rm -rf /tmp/nettle-2.5.tar.gz* /tmp/nettle-2.5
-    wget ftp://ftp.lysator.liu.se/pub/security/lsh/nettle-2.5.tar.gz 
+    $SUDO rm -rf /tmp/nettle-2.5.tar.gz* /tmp/nettle-2.5
+    wget https://ftp.gnu.org/gnu/nettle/nettle-2.5.tar.gz
+    if [ $? -ne 0 ]; then
+      wget ftp://ftp.lysator.liu.se/pub/security/lsh/nettle-2.5.tar.gz
+    fi
+    if [ ! -f nettle-2.5.tar.gz ]; then
+      echo_error "Could not download nettle source files"
+      cd -
+      return
+    fi
     tar -xzf nettle-2.5.tar.gz
     cd nettle-2.5/
     ./configure --disable-openssl --enable-shared --prefix=/usr 
@@ -143,53 +195,69 @@ install_nettle_from_source() {
     make -j`nproc`
     make check 
     $SUDO make install 
-    rm -rf /tmp/nettle-2.5.tar.gz /tmp/nettle-2.5
+    ) >& $nettle_install_log
 }
 
 install_gnutls_from_source(){
+    gnutls_install_log=$OPENAIR_DIR/cmake_targets/log/gnutls_install_log.txt
+    echo_info "\nInstalling Gnutls. The log file for Gnutls installation is here: $gnutls_install_log "
+    (
     cd /tmp 
     echo "Downloading gnutls archive"
-    rm -rf /tmp/gnutls-3.1.23.tar.xz* /tmp/gnutls-3.1.23
-    wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.1/gnutls-3.1.23.tar.xz 
-    tar -xzf gnutls-3.1.23.tar.xz
+    $SUDO rm -rf /tmp/gnutls-3.1.23.tar.xz* /tmp/gnutls-3.1.23
+    wget http://mirrors.dotsrc.org/gcrypt/gnutls/v3.1/gnutls-3.1.23.tar.xz || \
+      wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.1/gnutls-3.1.23.tar.xz
+    if [ ! -f gnutls-3.1.23.tar.xz ]; then
+      echo_error "Could not download gnutls source files"
+      cd -
+      return
+    fi
+    tar -xJf gnutls-3.1.23.tar.xz
     cd gnutls-3.1.23/
     ./configure --prefix=/usr
     echo "Compiling gnutls"
     make -j`nproc`
     $SUDO make install 
-    rm -rf /tmp/gnutls-3.1.23.tar.xz /tmp/gnutls-3.1.23
+    )>& $gnutls_install_log
 }
 
 
 
 check_install_usrp_uhd_driver(){
-        log_file=$OPENAIR_DIR/cmake_targets/log/check_install_usrp_uhd_driver_log.txt
-        echo_info "\nIn function: check_install_usrp_uhd_driver(). Installing USRP Drivers : The logfile for the installation is located here: $log_file "
-        (
+        #first we remove old installation
+        $SUDO apt-get remove -y uhd || true
+        $SUDO apt-get remove libuhd-dev libuhd003 uhd-host -y
         v=$(lsb_release -cs)
-        $SUDO apt-add-repository "deb http://files.ettus.com/binaries/uhd/repo/uhd/ubuntu/$v $v main"
+        $SUDO apt-add-repository --remove "deb http://files.ettus.com/binaries/uhd/repo/uhd/ubuntu/$v $v main"
+        #The new USRP repository
+        $SUDO add-apt-repository ppa:ettusresearch/uhd -y
         $SUDO apt-get update
         $SUDO apt-get -y install  python python-tk libboost-all-dev libusb-1.0-0-dev
-        $SUDO apt-get -y install -t `lsb_release -cs` uhd --force-yes
-        ) >& $log_file
+        $SUDO apt-get -y install libuhd-dev libuhd003
 }
+
+install_usrp_uhd_driver() {
+        # We move uhd-host apart because it depends on linux kernel version
+        # On newer kernels, it fails to install
+        $SUDO apt-get -y install uhd-host
+        $SUDO uhd_images_downloader 
+}
+
 check_install_bladerf_driver(){
-        log_file=$OPENAIR_DIR/cmake_targets/log/check_install_bladerf_driver_log.txt
-        echo_info "\nIn function: check_install_bladerf_driver(). Install BLADERF drivers : The logfile for the installation is located here: $log_file "
-        (
-	$SUDO add-apt-repository -y ppa:bladerf/bladerf
-	$SUDO apt-get update
+	if [ "$(get_distribution_release)" == "Ubuntu14.04" ] ; then
+		$SUDO add-apt-repository -y ppa:bladerf/bladerf
+		$SUDO apt-get update
+	fi
 	$SUDO apt-get install -y bladerf libbladerf-dev
 	$SUDO apt-get install -y bladerf-firmware-fx3
 	$SUDO apt-get install -y bladerf-fpga-hostedx40	
-	bladeRF-cli --flash-firmware /usr/share/Nuand/bladeRF/bladeRF_fw.img	
-        ) >& $log_file
+}
+
+flash_firmware_bladerf() {
+	$SUDO bladeRF-cli --flash-firmware /usr/share/Nuand/bladeRF/bladeRF_fw.img
 }
 
 check_install_additional_tools (){
-    log_file=$OPENAIR_DIR/cmake_targets/log/check_install_additional_tools_log.txt
-    echo_info "\nIn function: check_install_oai_software(). Installing optional OAI packages : The logfile for the installation is located here: $log_file "
-    (
     $SUDO apt-get update
     $SUDO apt-get install -y \
 	check \
@@ -199,7 +267,6 @@ check_install_additional_tools (){
 	libboost-all-dev \
 	libpthread-stubs0-dev \
 	openvpn \
-	phpmyadmin \
 	pkg-config \
 	python-dev  \
 	python-pexpect \
@@ -211,17 +278,52 @@ check_install_additional_tools (){
 	valgrind  \
 	vlan	  \
 	ctags \
-        ntpdate
-      ) >& $log_file
-}
+        ntpdate \
+        iperf3 \
+        android-tools-adb \
+	wvdial \
+        python-numpy \
+    sshpass \
+    nscd
 
-check_install_oai_software() {
+    $SUDO pip install paramiko
+    $SUDO pip install pyroute2
+    $SUDO rm -fr /opt/ssh
+    $SUDO GIT_SSL_NO_VERIFY=true git clone https://gist.github.com/2190472.git /opt/ssh
     
-    log_file=$OPENAIR_DIR/cmake_targets/log/check_install_oai_software_log.txt
-    echo_info "\nIn function: check_install_oai_software(). Installing mandatory OAI packages : The logfile for the installation is located here: $log_file "
+    log_netiface=$OPENAIR_DIR/cmake_targets/log/netiface_install_log.txt
+    echo_info "Installing Netinterfaces package. The logfile for installation is in $log_netiface"
     (
+    $SUDO rm -fr /tmp/netifaces-0.10.4.tar.gz /tmp/netifaces
+    wget -P /tmp  https://pypi.python.org/packages/18/fa/dd13d4910aea339c0bb87d2b3838d8fd923c11869b1f6e741dbd0ff3bc00/netifaces-0.10.4.tar.gz
+    tar -xzvf /tmp/netifaces-0.10.4.tar.gz -C /tmp
+    cd /tmp/netifaces-0.10.4
+    $SUDO python setup.py install
+    cd -
+    ) >& $log_netiface
+}
+
+check_install_oai_software() {
+    local specific_packages=""
+    if ! check_supported_distribution; then
+        echo_error "Your distribution $(get_distribution_release) is not supported by oai !"
+        exit 1
+    fi
     $SUDO apt-get update
+    $SUDO apt install -y software-properties-common
+    case "$(get_distribution_release)" in
+        "Ubuntu14.04")
+            specific_packages="libtasn1-3-dev"
+            # For iperf3
+            $SUDO add-apt-repository "deb http://archive.ubuntu.com/ubuntu trusty-backports universe"
+            $SUDO apt-get update
+            ;;
+        "Ubuntu16.04")
+            specific_packages="libtasn1-6-dev"
+            ;;
+    esac
     $SUDO apt-get install -y \
+    $specific_packages \
 	autoconf  \
 	automake  \
 	bison  \
@@ -245,9 +347,9 @@ check_install_oai_software() {
 	iptables-dev \
 	libatlas-base-dev \
 	libatlas-dev \
-	libblas3gf \
 	libblas-dev \
 	libconfig8-dev \
+	libffi-dev \
 	libforms-bin \
 	libforms-dev \
 	libgcrypt11-dev \
@@ -257,17 +359,16 @@ check_install_oai_software() {
 	libidn11-dev \
 	libmysqlclient-dev  \
 	liboctave-dev \
-	libpgm-5.1 \
 	libpgm-dev \
+	libpython2.7-dev \
 	libsctp1  \
 	libsctp-dev  \
 	libssl-dev  \
-	libtasn1-3-dev  \
 	libtool  \
 	libusb-1.0-0-dev \
 	libxml2 \
 	libxml2-dev  \
-	linux-headers-`uname -r` \
+	libxslt1-dev \
 	mscgen  \
 	octave \
 	octave-signal \
@@ -279,38 +380,32 @@ check_install_oai_software() {
 	xmlstarlet \
 	python-pip \
 	pydb \
-	wvdial \
-        python-numpy
+	wget
+
     $SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so
-    if [ `lsb_release -rs` = '12.04' ] ; then
-        install_nettle_from_source
-        install_gnutls_from_source
-    else
-        $SUDO apt-get install -y libgnutls-dev nettle-dev nettle-bin 
-    fi
-    $SUDO pip install paramiko
-    $SUDO pip install pyroute2
-    ) > $log_file 2>&1
+    
+    #Sometimes linux headers are not available in apt-get if kernel is custom or new
+    $SUDO apt-get install linux-headers-`uname -r` || true
+    # First we remove gnutls/nettle installation and then install from sources
+    $SUDO apt-get remove -y libgnutls-dev nettle-dev nettle-bin
+    install_nettle_from_source
+    install_gnutls_from_source
+
     install_asn1c_from_source
-    $SUDO rm -fr /opt/ssh
-    $SUDO git clone https://gist.github.com/2190472.git /opt/ssh
 }
 
 install_asn1c_from_source(){
-    asn1_install_dir=$OPENAIR_DIR/cmake_targets/log/asn1c_install_log.txt
-    echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_dir "
+    asn1_install_log=$OPENAIR_DIR/cmake_targets/log/asn1c_install_log.txt
+    echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_log "
     (
-    rm -rf /tmp/asn1c-r1516
-    mkdir -p /tmp/asn1c-r1516
-    cd /tmp/asn1c-r1516
-    svn co https://github.com/vlm/asn1c/trunk  /tmp/asn1c-r1516 -r 1516 
-    patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch.p0 
-    patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_2.p0 
-    patch -p0 < $OPENAIR_DIR/openair2/RRC/LITE/MESSAGES/asn1c/asn1cpatch.p0 
+    $SUDO rm -rf /tmp/asn1c
+    git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c
+    cd /tmp/asn1c
     ./configure
     make -j`nproc`
-    $SUDO make install 
-    ) > $asn1_install_dir 2>&1 
+    $SUDO make install
+    cd -
+    ) > $asn1_install_log 2>&1
 }
 
 #################################################
@@ -336,7 +431,6 @@ install_nas_tools() {
 }
 
 
-
 ################################
 # set_openair_env
 ###############################
@@ -361,6 +455,8 @@ CURPID=$$
 ppid=$$
 arraycounter=1
 echo_info "** Trapped CTRL-C. Killing all subprocesses now..."
+echo_info "** Calling sync now..."
+sync 
 while true
 do
         FORLOOP=FALSE
@@ -392,3 +488,21 @@ done
 }
 
 
+# get from http://www.linuxjournal.com/content/validating-ip-address-bash-script
+validate_ip() {
+
+local  ip=$1
+local  stat=1
+
+if [[ $ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
+    OIFS=$IFS
+    IFS='.'
+    ip=($ip)
+    IFS=$OIFS
+    [[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \
+        && ${ip[2]} -le 255 && ${ip[3]} -le 255 ]]
+    stat=$?
+fi
+
+return $stat
+}
diff --git a/cmake_targets/tools/build_test_epc_tools b/cmake_targets/tools/build_test_epc_tools
index aff2a26fc09ef8f1705328c07df7f2357695744e..aa7103fd781774a278c458302757f6592a67cc32 100755
--- a/cmake_targets/tools/build_test_epc_tools
+++ b/cmake_targets/tools/build_test_epc_tools
@@ -22,7 +22,7 @@
 #  Contact Information
 #  OpenAirInterface Admin: openair_admin@eurecom.fr
 #  OpenAirInterface Tech : openair_tech@eurecom.fr
-#  OpenAirInterface Dev  : openair4g-devel@eurecom.fr
+#  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
 #
 #  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
 #
@@ -121,6 +121,7 @@ function main()
       echo "Cleaning TEST_EPC"
     fi
     rm -f $OPENAIR_DIR/targets/bin/test_epc_generate_scenario
+    rm -f $OPENAIR_DIR/targets/bin/test_epc_play_scenario
     rm -Rf build 2>&1
     mkdir -m 777 -p -v build
   fi
@@ -140,6 +141,13 @@ function main()
   compilations \
       epc_test test_epc_generate_scenario \
       test_epc_generate_scenario $dbin/test_epc_generate_scenario
+
+  compilations \
+      epc_test test_epc_play_scenario \
+      test_epc_play_scenario $dbin/test_epc_play_scenario
+      
+  $SUDO cp -upv test_epc_generate_scenario /usr/local/bin
+  $SUDO cp -upv test_epc_play_scenario     /usr/local/bin
 }
 
 
diff --git a/cmake_targets/tools/exmimo_stop_octave.m b/cmake_targets/tools/exmimo_stop_octave.m
new file mode 100644
index 0000000000000000000000000000000000000000..82aa1f2845f0fc8edf7b509debbc6b8a67f84b6f
--- /dev/null
+++ b/cmake_targets/tools/exmimo_stop_octave.m
@@ -0,0 +1,4 @@
+n=oarf_get_num_detected_cards;
+for i=n-1:0
+	oarf_stop(i);
+end
diff --git a/cmake_targets/tools/fix_asn1 b/cmake_targets/tools/fix_asn1
new file mode 100755
index 0000000000000000000000000000000000000000..0661d7878de20d86741df8e222875f3e7c79ab38
--- /dev/null
+++ b/cmake_targets/tools/fix_asn1
@@ -0,0 +1,177 @@
+#!/bin/bash
+
+# in those arrays, each line is:
+#   <file> <sha1sum of file (without line 4 which changes depending on the location of the files)> <patch to apply to file>
+
+RRC_Rel10=(
+  "SystemInformation-r8-IEs.h" 603cd6615cff36ec7020692d72c0d6de7c4859cb "fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h.diff"
+)
+
+X2AP_Rel11_2=(
+  "X2ap-CriticalityDiagnostics-IE-List.h" ae96308b37fcbcbf39da5012e42968135fc5f27b "fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h.diff"
+  "NativeInteger.c"                       1a55f5402fd363318cf5444ffe1f67530dcf66ff "fix_asn1.data/X2AP.rel11.2/NativeInteger.c.diff"
+  "constr_SET_OF.c"                       808cbbdf19b118c0bdb04e3acf2cbe6e4133be2b "fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c.diff"
+)
+
+S1AP_Rel10_5=(
+  "NativeInteger.c" 1a55f5402fd363318cf5444ffe1f67530dcf66ff "fix_asn1.data/S1AP.rel10.5/NativeInteger.c.diff"
+  "constr_SET_OF.c" 808cbbdf19b118c0bdb04e3acf2cbe6e4133be2b "fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c.diff"
+)
+
+red_color="$(tput setaf 1)"
+green_color="$(tput setaf 2)"
+reset_color="$(tput sgr0)"
+
+function error()
+{
+  echo -e "$red_color"ERROR: "$@""$reset_color"
+  exit 1
+}
+
+function check_sha1()
+{
+  local file="$1"
+  local target_sha1="$2"
+
+  if [ ! -f "$file" ]
+  then
+    error "$file: no such file"
+  fi
+
+  # we don't use the line 4 of the file
+  # it contains the location of the ASN1 grammar
+  # and this location is not the same on every
+  # installation (this is for *.h files, for *.c
+  # files it's no big deal to skip that line)
+  local computed_sha1=$(sed 4d "$file" | sha1sum | cut -f 1 -d ' ')
+
+  if [ "$target_sha1" != "$computed_sha1" ]
+  then
+    error "$file: wrong SHA1"
+  fi
+}
+
+function patch_file()
+{
+  local patch="$1"
+  local file="$2"
+
+  echo -e "$green_color""patch file $file with $OPENAIR_DIR/cmake_targets/tools/$patch""$reset_color"
+
+  patch "$file" "$OPENAIR_DIR/cmake_targets/tools/$patch"
+  if [ $? -ne 0 ]
+  then
+    error "patching of $file with $OPENAIR_DIR/cmake_targets/tools/$patch failed"
+  fi
+}
+
+function apply_patches()
+{
+  local directory="$1"
+  local array=$2
+  local len=$3       # the length could be computed locally but the way to do it is not clear to me [CROUX]
+
+  local i
+  local file
+  local sha1
+  local patch
+  local item
+
+  for (( i = 0; i < $len; i += 3 ))
+  do
+    # special bash syntax to access the array
+    item=$array[$i];       file=${!item}
+    item=$array[$((i+1))]; sha1=${!item}
+    item=$array[$((i+2))]; patch=${!item}
+    check_sha1 "$directory/$file" "$sha1"
+    patch_file "$patch" "$directory/$file"
+  done
+}
+
+function patch_rrc()
+{
+  local directory="$1"
+  local version="$2"
+
+  case "$version" in
+    Rel10 )
+      echo "patching RRC files release 10"
+      apply_patches "$directory" RRC_Rel10 ${#RRC_Rel10[*]}
+      ;;
+    Rel8 )
+      echo "patching RRC files release 8 TODO?"
+      ;;
+    * )
+      error unknwon/unhandled RRC version \'"$version"\'
+      ;;
+  esac
+}
+
+function patch_x2ap()
+{
+  local directory="$1"
+  local version="$2"
+
+  case "$version" in
+    R11 )
+      echo "patching X2AP files release 11.2"
+      apply_patches "$directory" X2AP_Rel11_2 ${#X2AP_Rel11_2[*]}
+      ;;
+    * )
+      error unknwon/unhandled X2AP version \'"$version"\'
+      ;;
+  esac
+}
+
+function patch_s1ap()
+{
+  local directory="$1"
+  local version="$2"
+
+  case "$version" in
+    R10 )
+      echo "patching S1AP files release 10.5"
+      apply_patches "$directory" S1AP_Rel10_5 ${#S1AP_Rel10_5[*]}
+      ;;
+    * )
+      error unknwon/unhandled S1AP version \'"$version"\'
+      ;;
+  esac
+}
+
+function main()
+{
+  if [ $# -ne 3 ]
+  then
+    echo "ERROR: pass <output directory> <module> <version>"
+    exit 1
+  fi
+
+  if [ x"$OPENAIR_DIR" = x ]
+  then
+    error "the variable OPENAIR_DIR is not set"
+  fi
+
+  local directory="$1"
+  local module="$2"
+  local version="$3"
+
+  case "$module" in
+    RRC )
+      patch_rrc "$directory" "$version"
+      ;;
+    X2AP )
+      patch_x2ap "$directory" "$version"
+      ;;
+    S1AP )
+      patch_s1ap "$directory" "$version"
+      ;;
+    * )
+      error unknown module "$module"
+      ;;
+  esac
+
+  exit 0
+}
+
+main "$@"
diff --git a/cmake_targets/tools/fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h.diff b/cmake_targets/tools/fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h.diff
new file mode 100644
index 0000000000000000000000000000000000000000..525e35ac9e452891513ef8c78c720cff108a5d16
--- /dev/null
+++ b/cmake_targets/tools/fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h.diff
@@ -0,0 +1,23 @@
+57,61d56
+< /* SystemInformation-r8-IEs */
+< typedef struct SystemInformation_r8_IEs {
+< 	struct SystemInformation_r8_IEs__sib_TypeAndInfo {
+< 		A_SEQUENCE_OF(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member {
+< 			SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR present;
+79c74,78
+< 			} choice;
+---
+> 			};
+> 
+> 		struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member {
+> 			SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR present;
+> 			union SystemInformation_r8_IEs__sib_TypeAndInfo__Member_u choice;
+83c82,87
+< 		} ) list;
+---
+> 		};
+> 
+> /* SystemInformation-r8-IEs */
+> typedef struct SystemInformation_r8_IEs {
+> 	struct SystemInformation_r8_IEs__sib_TypeAndInfo {
+> 		A_SEQUENCE_OF(struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member) list;
diff --git a/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/NativeInteger.c.diff b/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/NativeInteger.c.diff
new file mode 100644
index 0000000000000000000000000000000000000000..3b51426ad3fa008bec5131cd68d2bb0ea99d7750
--- /dev/null
+++ b/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/NativeInteger.c.diff
@@ -0,0 +1,8 @@
+283c283
+< 	int dynamic = 0;
+---
+> 	//int dynamic = 0;
+290c290
+< 		dynamic = 1;
+---
+> 		//dynamic = 1;
diff --git a/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c.diff b/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c.diff
new file mode 100644
index 0000000000000000000000000000000000000000..3ceaf5e3e5ccef48746cf5abf2952aa0c6910224
--- /dev/null
+++ b/cmake_targets/tools/fix_asn1.data/S1AP.rel10.5/constr_SET_OF.c.diff
@@ -0,0 +1,4 @@
+1007c1007
+< 				(int)nelems, (int)ct ? ct->effective_bits : -1);
+---
+> 				(int)nelems, ct ? ct->effective_bits : -1);
diff --git a/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/NativeInteger.c.diff b/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/NativeInteger.c.diff
new file mode 100644
index 0000000000000000000000000000000000000000..3b51426ad3fa008bec5131cd68d2bb0ea99d7750
--- /dev/null
+++ b/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/NativeInteger.c.diff
@@ -0,0 +1,8 @@
+283c283
+< 	int dynamic = 0;
+---
+> 	//int dynamic = 0;
+290c290
+< 		dynamic = 1;
+---
+> 		//dynamic = 1;
diff --git a/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h.diff b/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h.diff
new file mode 100644
index 0000000000000000000000000000000000000000..6ea7b2454eb80b1cf1c34b9bd4c320b20b6f6dd8
--- /dev/null
+++ b/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h.diff
@@ -0,0 +1,15 @@
+29,31c29
+< /* X2ap-CriticalityDiagnostics-IE-List */
+< typedef struct X2ap_CriticalityDiagnostics_IE_List {
+< 	A_SEQUENCE_OF(struct X2ap_CriticalityDiagnostics_IE_List__Member {
+---
+> struct X2ap_CriticalityDiagnostics_IE_List__Member {
+43c41,46
+< 	} ) list;
+---
+> 	};
+> 
+> /* X2ap-CriticalityDiagnostics-IE-List */
+> typedef struct X2ap_CriticalityDiagnostics_IE_List {
+> 	A_SEQUENCE_OF(struct X2ap_CriticalityDiagnostics_IE_List__Member
+> 	) list;
diff --git a/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c.diff b/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c.diff
new file mode 100644
index 0000000000000000000000000000000000000000..3ceaf5e3e5ccef48746cf5abf2952aa0c6910224
--- /dev/null
+++ b/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/constr_SET_OF.c.diff
@@ -0,0 +1,4 @@
+1007c1007
+< 				(int)nelems, (int)ct ? ct->effective_bits : -1);
+---
+> 				(int)nelems, ct ? ct->effective_bits : -1);
diff --git a/cmake_targets/tools/run_enb_s1_usrp b/cmake_targets/tools/run_enb_s1_usrp
index 01f4156071b828ce414fb0718361579bb6091785..2969f759a141ab8fb0f2362a4177871f846188d1 100755
--- a/cmake_targets/tools/run_enb_s1_usrp
+++ b/cmake_targets/tools/run_enb_s1_usrp
@@ -29,9 +29,9 @@
 ################################################################################
 # file run_enb_s1_usrp
 # brief run script for eNB USRP.
-# author  Lionel GAUTHIER
+# author  Lionel GAUTHIER and Navid Nikaein
 # company Eurecom
-# email:  lionel.gauthier@eurecom.fr 
+# email:  lionel.gauthier@eurecom.fr and navid.nikaein@eurecom.fr
 
 
 ################################
@@ -56,9 +56,13 @@ function help()
   echo_error "Mandatory arguments to long options are mandatory for short options too."
   echo_error "  -g, --gdb                           Run with GDB."
   echo_error "  -h, --help                          Print this help."
+  echo_error "  -e, --ulsch-max-errors    num-errs  maximum allowed number of uplink errors"
+  echo_error "  -f, --rf-config-file      filename  RF specific configuration file"
   echo_error "  -K, --itti-dump-file      filename  ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)"
   echo_error "  -M, --target-dl-mcs       mcs       Downlink target MCS."
-  echo_error "  -m, --mscgen              directory Generate mscgen output files in a directory"
+  echo_error "  -n, --T-no-wait                     don't wait for tracer, start immediately"
+  echo_error "  -p, --T-port              port      use given port"
+  echo_error "  -m, --mscgen                        directory Generate mscgen output files in a directory"
   echo_error "  -s, --show-stdout                   Do not redirect stdout and stderr to file /tmp/lte_softmodem.stdout.txt."
   echo_error "  -S, --enable-missed-slot            Continue execution in case of missed slot."
   echo_error "  -T, --target-ul-mcs       mcs       Uplink target MCS."
@@ -137,7 +141,27 @@ function main()
         shift;
         exit 0
         ;;
-      -K | --itti-dump-file)
+     -e | --ulsch-max-errors)
+        ulsch_max_errors=$2
+        echo "setting  --ulsch-max-errors to $ulsch_max_errors"
+        exe_arguments="$exe_arguments --ulsch-max-errors=$ulsch_max_errors"
+        shift 2;
+	 ;;      
+     -f | --rf-config-file)
+        rf_config_file=$2
+        # can omit file name if last arg on the line
+        if [ "x$rf_config_file" = "x" ]; then
+          rf_config_file=null
+          shift 1;
+        else
+          shift 2;
+        fi
+	if [ "$rf_config_file" != "null" ]; then
+            echo "setting  --rf-config-file to $rf_config_file"
+            exe_arguments="$exe_arguments --rf-config-file=$rf_config_file"
+	fi 
+        ;;      
+     -K | --itti-dump-file)
         itti_dump_file=$2
         # can omit file name if last arg on the line
         if [ "x$itti_dump_file" = "x" ]; then
@@ -166,7 +190,17 @@ function main()
         exe_arguments="$exe_arguments -m $2"
         shift 2;
         ;;
-      -V | --vcd)
+      -n | --T-no-wait)
+        echo "setting T tracer operation"
+        exe_arguments="$exe_arguments --T_nowait"   
+	shift ;
+	;;
+      -p | --T-port)
+        echo "setting T tracer port"
+        exe_arguments="$exe_arguments --T_port $2"   
+	shift 2;
+	;;
+	-V | --vcd)
         echo "setting gtk-wave output"
         exe_arguments="$exe_arguments -V /tmp/oai_gtk_wave.vcd"
         shift ;
diff --git a/cmake_targets/tools/run_enb_ue_virt_noS1 b/cmake_targets/tools/run_enb_ue_virt_noS1
index 74abe0de02b38abb469cb8a3c9aa7df53b6e1e16..f5ed770f808c9a7a80659fe581ea02c8598386ff 100755
--- a/cmake_targets/tools/run_enb_ue_virt_noS1
+++ b/cmake_targets/tools/run_enb_ue_virt_noS1
@@ -71,6 +71,7 @@ function help()
   echo_error "                                          and PDCP-LTE. Then capture for all the interfaces with the following filters: s1ap or lte_rrc or mac-lte or rlc-lte"
   echo_error "                                          or pdcp-lte. Note the L2 pdus are transmitted to the local interface."
   echo_error "  -x, --xforms                            Run XFORMS scope windows."
+  echo_error "  -n, --num-frames                        Set number of frames for simulation"
 }
 
 
@@ -165,6 +166,11 @@ function main()
         exe_arguments="$exe_arguments -P wireshark"
         shift 1;
         ;;
+      -n | --num-frames)
+	echo "setting the number of frames in simulation to $2"
+	exe_arguments="$exe_arguments -n $2"
+        shift 2;
+	;; 
       *)   
         echo "Unknown option $1"
         help
diff --git a/cmake_targets/tools/run_enb_ue_virt_s1 b/cmake_targets/tools/run_enb_ue_virt_s1
index 9cc226a6987053e797e516f94b019e2b7fad759d..9f325c7243cfd586cc93d19e33878bf8ab0b2772 100755
--- a/cmake_targets/tools/run_enb_ue_virt_s1
+++ b/cmake_targets/tools/run_enb_ue_virt_s1
@@ -81,8 +81,10 @@ function help()
   echo_error " "
   echo_error "Options:"
   echo_error "Mandatory arguments to long options are mandatory for short options too."
+  echo_error "  -a, --abstraction                       enable phy abstraction mode"
   echo_error "  -c, -C, --config-file  eNB_config_file  eNB config file, (see $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF)"
   echo_error "                                          Default eNB config file if not set is $1"
+  echo_error "  -l, --log-level                         set the global log level (8:trace, 7:debug, 6:info, 4:warn, 3:error). Note that the log configuration is eNB config file is ignored for oaisim."
   echo_error "  -g, --gdb                               Run with GDB."
   echo_error "  -h, --help                              Print this help."
   echo_error "  -K, --itti-dump-file   filename         ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)"
@@ -114,8 +116,14 @@ function main()
   until [ -z "$1" ]
     do
     case "$1" in
+      -a | --abstraction )
+	    abstraction_flag=1
+	    echo "enabling abstraction mode"
+	    exe_arguments="$exe_arguments -a"
+            shift;
+	    ;;      
       -c | -C | --config-file)
-        CONFIG_FILE_ENB=$2
+            CONFIG_FILE_ENB=$2
         # may be relative path 
         if [ -f $(dirname $(readlink -f $0))/$CONFIG_FILE ]; then
           CONFIG_FILE_ENB=$(dirname $(readlink -f $0))/$CONFIG_FILE
@@ -131,6 +139,11 @@ function main()
         fi
         shift 2;
         ;;
+      -l | --log-level)
+	echo "setting the log level to $2"
+	exe_arguments="$exe_arguments -l $2"
+        shift 2;
+ 	;;       
       -g | --gdb)
         run_gdb=1
         echo "setting GDB flag to: $GDB"
@@ -239,9 +252,10 @@ function main()
   # Check table 200 lte in /etc/iproute2/rt_tables
   fgrep lte /etc/iproute2/rt_tables  > /dev/null
   if [ $? -ne 0 ]; then
-    bash -c echo "200 lte " >> /etc/iproute2/rt_tables
+    echo "200 lte " >> /etc/iproute2/rt_tables
   fi
-  ip rule add fwmark 1 table lte
+  ip rule add fwmark 1 table lte 
+  ifconfig oip1 up
   ip route add default dev oip1 table lte
 
   exe_arguments="$exe_arguments -s15 -AAWGN -y1 -b1 -u1 -Q0"
diff --git a/cmake_targets/tools/start_bladerf.py b/cmake_targets/tools/start_bladerf.py
new file mode 100755
index 0000000000000000000000000000000000000000..ad83d5d5179f47cc76ffcf8bafa358e4dce9fcf5
--- /dev/null
+++ b/cmake_targets/tools/start_bladerf.py
@@ -0,0 +1,46 @@
+#!/usr/bin/python
+import time
+import serial
+import os
+from pyroute2 import IPRoute
+import sys
+import re
+import threading
+import signal
+import traceback
+import commands
+
+if os.environ.get('OPENAIR_DIR') == None:
+  print "Error getting OPENAIR_DIR environment variable"
+  sys.exit(1)
+
+sys.path.append(os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/tools/'))
+
+from lib_autotest import *
+
+def reset_bladerf():
+  stringIdBladeRF='OpenMoko, Inc'
+  status, out = commands.getstatusoutput('lsusb | grep -i \'' + stringIdBladeRF + '\'')
+  if (out == '') :
+     print "BladeRF not found. Exiting now..."
+     sys.exit()
+  p=re.compile('Bus\s*(\w+)\s*Device\s*(\w+):\s*ID\s*(\w+):(\w+)')
+  res=p.findall(out)
+  BusId=res[0][0]
+  DeviceId=res[0][1]
+  VendorId=res[0][2]
+  ProductId=res[0][3]
+  usb_dir= find_usb_path(VendorId, ProductId)
+  print "BladeRF Found in directory..." + usb_dir
+  cmd = "sudo sh -c \"echo 0 > " + usb_dir + "/authorized\""
+  os.system(cmd + " ; sleep 5" )
+  cmd = "sudo sh -c \"echo 1 > " + usb_dir + "/authorized\""
+  os.system(cmd + " ; sleep 5" )
+
+os.system ('sudo -E bladeRF-cli --flash-firmware /usr/share/Nuand/bladeRF/bladeRF_fw.img')
+
+print "Resettting BladeRF..."
+
+reset_bladerf()
+
+os.system ("dmesg|tail")
diff --git a/cmake_targets/tools/stop_exmimo2 b/cmake_targets/tools/stop_exmimo2
new file mode 100755
index 0000000000000000000000000000000000000000..102c9e068094e6a998a9f36339044f7214283874
--- /dev/null
+++ b/cmake_targets/tools/stop_exmimo2
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+echo "This script stops exmimo2 as it might be transmitting signal by itself if lte-softmodem terminates incorrectly"
+
+if [ "$OPENAIR_DIR" == "" ]; then
+  echo "Is the OPENAIR_DIR path set correctly? Exiting now"
+  exit
+fi
+sudo -E bash -c 'echo 3 > /proc/sys/vm/drop_caches'
+
+exmimo_mod=`lsmod |grep openair_rf`
+#load the module only if absent to avoid kernel crashes
+if [ -z "$exmimo_mod" ]
+then
+  sudo -E $OPENAIR_DIR/cmake_targets/tools/init_exmimo2
+fi
+
+#now we stop the card from transmitting anything
+cd $OPENAIR_DIR/targets/bin
+sudo -E octave -H --no-gui $OPENAIR_DIR/cmake_targets/tools/exmimo_stop_octave.m
+
diff --git a/cmake_targets/tools/test_helper b/cmake_targets/tools/test_helper
index 49a991057373dde600a7d7e098de916cb1bd5270..cae0bacbe030578fbd3d4a98ea7cdbe792a64dbb 100644
--- a/cmake_targets/tools/test_helper
+++ b/cmake_targets/tools/test_helper
@@ -35,7 +35,7 @@ xUnit_fail() {
   currtime=$(date +%s.%N)
   time=$(echo "$currtime - $XUNIT_START" | bc -l)
   xml="<testcase classname='$class' name='$test_case' Run_result='$run_result' time='$time s' RESULT='$result'></testcase>"
-  echo  -e $xml >> $xmlfile_testcase
+  echo  -e "$xml" >> "$xmlfile_testcase"
   XUNIT_TESTCASES_XML="$XUNIT_TESTCASES_XML \n$xml"
   XUNIT_FAILED=$((XUNIT_FAILED+1))
 }
diff --git a/common/utils/T/.gitignore b/common/utils/T/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..f5724e6ff8c25fd4bf1fc8701f7ca881de58194a
--- /dev/null
+++ b/common/utils/T/.gitignore
@@ -0,0 +1,13 @@
+*.o
+*.a
+T_IDs.h
+T_messages.txt.h
+genids
+tracer/enb
+tracer/extract_config
+tracer/record
+tracer/replay
+tracer/textlog
+tracer/vcd
+tracer/macpdu2wireshark
+tracee/tracee
diff --git a/common/utils/T/Makefile b/common/utils/T/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..dcb0d12fab9e638f49e812255e29cf61c058b755
--- /dev/null
+++ b/common/utils/T/Makefile
@@ -0,0 +1,23 @@
+CC=gcc
+CFLAGS=-Wall -g
+
+GENIDS=genids
+GENIDS_OBJS=genids.o
+
+all : $(GENIDS) T_messages.txt.h T_IDs.h
+
+$(GENIDS): $(GENIDS_OBJS)
+	$(CC) $(CFLAGS) -o $(GENIDS) $(GENIDS_OBJS)
+
+%.o: %.c
+	$(CC) $(CFLAGS) -c -o $@ $<
+
+T_messages.txt.h: T_messages.txt
+	xxd -i T_messages.txt > T_messages.txt.h
+
+T_IDs.h: $(GENIDS) T_messages.txt
+	./$(GENIDS) T_messages.txt T_IDs.h
+
+clean:
+	rm -f *.o $(GENIDS) core T_IDs.h T_messages.txt.h
+	cd tracer && make clean
diff --git a/common/utils/T/T.c b/common/utils/T/T.c
new file mode 100644
index 0000000000000000000000000000000000000000..5d84afa6607f897329b0c71858014dca08f42f36
--- /dev/null
+++ b/common/utils/T/T.c
@@ -0,0 +1,155 @@
+#include "T.h"
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <sys/socket.h>
+
+#define QUIT(x) do { \
+  printf("T tracer: QUIT: %s\n", x); \
+  exit(1); \
+} while (0)
+
+/* array used to activate/disactivate a log */
+static int T_IDs[T_NUMBER_OF_IDS];
+int *T_active = T_IDs;
+
+static int T_socket;
+
+/* T_cache
+ * - the T macro picks up the head of freelist and marks it busy
+ * - the T sender thread periodically wakes up and sends what's to be sent
+ */
+volatile int _T_freelist_head;
+volatile int *T_freelist_head = &_T_freelist_head;
+T_cache_t *T_cache;
+
+static void get_message(int s)
+{
+  char t;
+  int l;
+  int id;
+  int is_on;
+
+  if (read(s, &t, 1) != 1) QUIT("get_message fails");
+printf("got mess %d\n", t);
+  switch (t) {
+  case 0:
+    /* toggle all those IDs */
+    /* optimze? (too much syscalls) */
+    if (read(s, &l, sizeof(int)) != sizeof(int)) QUIT("get_message fails");
+    while (l) {
+      if (read(s, &id, sizeof(int)) != sizeof(int)) QUIT("get_message fails");
+      T_IDs[id] = 1 - T_IDs[id];
+      l--;
+    }
+    break;
+  case 1:
+    /* set IDs as given */
+    /* optimize? */
+    if (read(s, &l, sizeof(int)) != sizeof(int)) QUIT("get_message fails");
+    id = 0;
+    while (l) {
+      if (read(s, &is_on, sizeof(int)) != sizeof(int))
+        QUIT("get_message fails");
+      T_IDs[id] = is_on;
+      id++;
+      l--;
+    }
+    break;
+  case 2: break; /* do nothing, this message is to wait for local tracer */
+  }
+}
+
+static void *T_receive_thread(void *_)
+{
+  while (1) get_message(T_socket);
+  return NULL;
+}
+
+static void new_thread(void *(*f)(void *), void *data)
+{
+  pthread_t t;
+  pthread_attr_t att;
+
+  if (pthread_attr_init(&att))
+    { fprintf(stderr, "pthread_attr_init err\n"); exit(1); }
+  if (pthread_attr_setdetachstate(&att, PTHREAD_CREATE_DETACHED))
+    { fprintf(stderr, "pthread_attr_setdetachstate err\n"); exit(1); }
+  if (pthread_create(&t, &att, f, data))
+    { fprintf(stderr, "pthread_create err\n"); exit(1); }
+  if (pthread_attr_destroy(&att))
+    { fprintf(stderr, "pthread_attr_destroy err\n"); exit(1); }
+}
+
+/* defined in local_tracer.c */
+void T_local_tracer_main(int remote_port, int wait_for_tracer,
+    int local_socket);
+
+/* We monitor the tracee and the local tracer processes.
+ * When one dies we forcefully kill the other.
+ */
+#include <sys/types.h>
+#include <sys/wait.h>
+static void monitor_and_kill(int child1, int child2)
+{
+  int child;
+  int status;
+
+  child = wait(&status);
+  if (child == -1) perror("wait");
+  kill(child1, SIGKILL);
+  kill(child2, SIGKILL);
+  exit(0);
+}
+
+void T_init(int remote_port, int wait_for_tracer, int dont_fork)
+{
+  int socket_pair[2];
+  int s;
+  int T_shm_fd;
+  int child1, child2;
+
+  if (socketpair(AF_UNIX, SOCK_STREAM, 0, socket_pair))
+    { perror("socketpair"); abort(); }
+
+  /* child1 runs the local tracer and child2 (or main) runs the tracee */
+
+  child1 = fork(); if (child1 == -1) abort();
+  if (child1 == 0) {
+    close(socket_pair[1]);
+    T_local_tracer_main(remote_port, wait_for_tracer, socket_pair[0]);
+    exit(0);
+  }
+  close(socket_pair[0]);
+
+  if (dont_fork == 0) {
+    child2 = fork(); if (child2 == -1) abort();
+    if (child2 != 0) {
+      close(socket_pair[1]);
+      monitor_and_kill(child1, child2);
+    }
+  }
+
+  s = socket_pair[1];
+  /* wait for first message - initial list of active T events */
+  get_message(s);
+
+  T_socket = s;
+
+  /* setup shared memory */
+  T_shm_fd = shm_open(T_SHM_FILENAME, O_RDWR /*| O_SYNC*/, 0666);
+  shm_unlink(T_SHM_FILENAME);
+  if (T_shm_fd == -1) { perror(T_SHM_FILENAME); abort(); }
+  T_cache = mmap(NULL, T_CACHE_SIZE * sizeof(T_cache_t),
+                 PROT_READ | PROT_WRITE, MAP_SHARED, T_shm_fd, 0);
+  if (T_cache == NULL)
+    { perror(T_SHM_FILENAME); abort(); }
+  close(T_shm_fd);
+
+  new_thread(T_receive_thread, NULL);
+}
diff --git a/common/utils/T/T.h b/common/utils/T/T.h
new file mode 100644
index 0000000000000000000000000000000000000000..819615131e77cc72cf36d1f060ad61b8d1f8e2d2
--- /dev/null
+++ b/common/utils/T/T.h
@@ -0,0 +1,574 @@
+#ifndef _T_T_T_
+#define _T_T_T_
+
+#if T_TRACER
+
+#include <stdint.h>
+
+#include "T_defs.h"
+
+#ifdef T_SEND_TIME
+#include <time.h>
+#endif
+
+/* T message IDs */
+#include "T_IDs.h"
+
+/* known type - this is where you add new types */
+
+#define T_INT(x) int, (x)
+#define T_FLOAT(x) float, (x)
+#define T_BUFFER(x, len) buffer, ((T_buffer){addr:(x), length:(len)})
+#define T_STRING(x) string, (x)
+#define T_PRINTF(...) printf, (__VA_ARGS__)
+
+/* for each known type a T_PUT_XX macro is defined */
+
+#define T_PUT_int(argnum, val) \
+  do { \
+    int T_PUT_var = (val); \
+    T_CHECK_SIZE(sizeof(int), argnum); \
+    memcpy(T_LOCAL_buf + T_LOCAL_size, &T_PUT_var, sizeof(int)); \
+    T_LOCAL_size += sizeof(int); \
+  } while (0)
+
+#define T_PUT_ulong(argnum, val) \
+  do { \
+    unsigned long T_PUT_var = (val); \
+    T_CHECK_SIZE(sizeof(unsigned long), argnum); \
+    memcpy(T_LOCAL_buf + T_LOCAL_size, &T_PUT_var, sizeof(unsigned long)); \
+    T_LOCAL_size += sizeof(unsigned long); \
+  } while (0)
+
+#define T_PUT_float(argnum, val) \
+  do { \
+    float T_PUT_var = (val); \
+    T_CHECK_SIZE(sizeof(float), argnum); \
+    memcpy(T_LOCAL_buf + T_LOCAL_size, &T_PUT_var, sizeof(float)); \
+    T_LOCAL_size += sizeof(float); \
+  } while (0)
+
+#define T_PUT_buffer(argnum, val) \
+  do { \
+    T_buffer T_PUT_buffer_var = (val); \
+    T_PUT_int(argnum, T_PUT_buffer_var.length); \
+    T_CHECK_SIZE(T_PUT_buffer_var.length, argnum); \
+    memcpy(T_LOCAL_buf + T_LOCAL_size, T_PUT_buffer_var.addr, \
+           T_PUT_buffer_var.length); \
+    T_LOCAL_size += T_PUT_buffer_var.length; \
+  } while (0)
+
+#define T_PUT_string(argnum, val) \
+  do { \
+    char *T_PUT_var = (val); \
+    int T_PUT_len = strlen(T_PUT_var) + 1; \
+    T_CHECK_SIZE(T_PUT_len, argnum); \
+    memcpy(T_LOCAL_buf + T_LOCAL_size, T_PUT_var, T_PUT_len); \
+    T_LOCAL_size += T_PUT_len; \
+  } while (0)
+
+#define T_PUT_printf_deref(...) __VA_ARGS__
+
+#define T_PUT_printf(argnum, x) \
+  do { \
+    int T_PUT_len = snprintf(T_LOCAL_buf + T_LOCAL_size, \
+                             T_BUFFER_MAX - T_LOCAL_size, T_PUT_printf_deref x); \
+    if (T_PUT_len < 0) { \
+      printf("%s:%d:%s: you can't read this, or can you?", \
+               __FILE__, __LINE__, __FUNCTION__); \
+      abort(); \
+    } \
+    if (T_PUT_len >= T_BUFFER_MAX - T_LOCAL_size) { \
+      printf("%s:%d:%s: cannot put argument %d in T macro, not enough space" \
+               ", consider increasing T_BUFFER_MAX (%d)\n", \
+               __FILE__, __LINE__, __FUNCTION__, argnum, T_BUFFER_MAX); \
+      abort(); \
+    } \
+    T_LOCAL_size += T_PUT_len + 1; \
+  } while (0)
+
+/* structure type to detect that you pass a known type as first arg of T */
+struct T_header;
+
+/* to define message ID */
+#define T_ID(x) ((struct T_header *)(uintptr_t)(x))
+
+/* T macro tricks */
+
+#define TN(...) TN_N(__VA_ARGS__,33,32,31,30,29,28,27,26,25,24,23,22,21,\
+        20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)(__VA_ARGS__)
+#define TN_N(n0,n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,\
+        n18,n19,n20,n21,n22,n23,n24,n25,n26,n27,n28,n29,n30,n31,n32,n,...) T##n
+#define T(...) TN(__VA_ARGS__)
+
+/* type used to send arbitrary buffer data */
+typedef struct {
+  void *addr;
+  int length;
+} T_buffer;
+
+extern volatile int *T_freelist_head;
+extern T_cache_t *T_cache;
+
+/* used at header of Tn, allocates buffer */
+#define T_LOCAL_DATA \
+  char *T_LOCAL_buf; \
+  int T_LOCAL_size = 0; \
+  int T_LOCAL_slot; \
+  T_LOCAL_slot = __sync_fetch_and_add(T_freelist_head, 1) \
+                 & (T_CACHE_SIZE - 1); \
+  (void)__sync_fetch_and_and(T_freelist_head, T_CACHE_SIZE - 1); \
+  if (T_cache[T_LOCAL_slot].busy) { \
+    printf("%s:%d:%s: T cache is full - consider increasing its size\n", \
+           __FILE__, __LINE__, __FUNCTION__); \
+    abort(); \
+  } \
+  T_LOCAL_buf = T_cache[T_LOCAL_slot].buffer;
+
+#define T_ACTIVE(x) T_active[(intptr_t)x]
+
+#define T_COMMIT() \
+  T_cache[T_LOCAL_slot].length = T_LOCAL_size; \
+  __sync_synchronize(); \
+  T_cache[T_LOCAL_slot].busy = 1; \
+
+#define T_CHECK_SIZE(len, argnum) \
+  if (T_LOCAL_size + (len) > T_BUFFER_MAX) { \
+    printf("%s:%d:%s: cannot put argument %d in T macro, not enough space" \
+             ", consider increasing T_BUFFER_MAX (%d)\n", \
+             __FILE__, __LINE__, __FUNCTION__, argnum, T_BUFFER_MAX); \
+    abort(); \
+  }
+
+#if 0
+#define T_PUT(type, var, argnum) \
+  do { \
+    if (T_LOCAL_size + sizeof(var) > T_BUFFER_MAX) { \
+      printf("%s:%d:%s: cannot put argument %d in T macro, not enough space" \
+               ", consider increasing T_BUFFER_MAX (%d)\n", \
+               __FILE__, __LINE__, __FUNCTION__, argnum, T_BUFFER_MAX); \
+      abort(); \
+    } \
+    memcpy(T_LOCAL_buf + T_LOCAL_size, &var, sizeof(var)); \
+    T_LOCAL_size += sizeof(var); \
+  } while (0)
+#endif
+
+#if 0
+#define T_PROCESS(x, argnum) \
+  do { \
+    T_PUT(typeof(x), x, argnum); \
+  } while (0)
+#endif
+
+#if 0
+#define T_PROCESS(x, argnum) \
+  do { \
+    if (__builtin_types_compatible_p(typeof(x), int)) \
+      { T_PUT(int, (intptr_t)(x), argnum); printf("int\n"); } \
+    else if (__builtin_types_compatible_p(typeof(x), short)) \
+      { T_PUT(short, (intptr_t)(x), argnum); printf("short\n"); } \
+    else if (__builtin_types_compatible_p(typeof(x), float)) \
+      { T_PUT(float, (x), argnum); printf("float\n"); } \
+    else if (__builtin_types_compatible_p(typeof(x), char *)) \
+      { T_PUT(char *, (char *)(intptr_t)(x), argnum); printf("char *\n"); } \
+    else if (__builtin_types_compatible_p(typeof(x), float *)) \
+      { T_PUT(float *, (float *)(intptr_t)(x), argnum); printf("float *\n"); } \
+    else if (__builtin_types_compatible_p(typeof(x), void *)) \
+      { T_PUT(void *, (void *)(intptr_t)(x), argnum); printf("void *\n"); } \
+    else { \
+      printf("%s:%d:%s: unsupported type for argument %d in T macro\n", \
+               __FILE__, __LINE__, __FUNCTION__, argnum); \
+      abort(); \
+    } \
+  } while (0)
+#endif
+
+#ifdef T_SEND_TIME
+
+#define T_HEADER(x) \
+  do { \
+    if (!__builtin_types_compatible_p(typeof(x), struct T_header *)) { \
+      printf("%s:%d:%s: " \
+             "bad use of T, pass a message ID as first parameter\n", \
+             __FILE__, __LINE__, __FUNCTION__); \
+      abort(); \
+    } \
+    struct timespec T_HEADER_time; \
+    if (clock_gettime(CLOCK_REALTIME, &T_HEADER_time)) abort(); \
+    memcpy(T_LOCAL_buf, &T_HEADER_time, sizeof(struct timespec)); \
+    T_LOCAL_size += sizeof(struct timespec); \
+    T_PUT_int(1, (int)(uintptr_t)(x)); \
+  } while (0)
+
+#else /* #ifdef T_SEND_TIME */
+
+#define T_HEADER(x) \
+  do { \
+    if (!__builtin_types_compatible_p(typeof(x), struct T_header *)) { \
+      printf("%s:%d:%s: " \
+             "bad use of T, pass a message ID as first parameter\n", \
+             __FILE__, __LINE__, __FUNCTION__); \
+      abort(); \
+    } \
+    T_PUT_int(1, (int)(uintptr_t)(x)); \
+  } while (0)
+
+#endif /* #ifdef T_SEND_TIME */
+
+#define T1(t) \
+  do { \
+    if (T_ACTIVE(t)) { \
+      T_LOCAL_DATA \
+      T_HEADER(t); \
+      T_COMMIT(); \
+    } \
+  } while (0)
+
+#define T3(t,t0,x0) \
+  do { \
+    if (T_ACTIVE(t)) { \
+      T_LOCAL_DATA \
+      T_HEADER(t); \
+      T_PUT_##t0(2, x0); \
+      T_COMMIT(); \
+    } \
+  } while (0)
+
+#define T5(t,t0,x0,t1,x1) \
+  do { \
+    if (T_ACTIVE(t)) { \
+      T_LOCAL_DATA \
+      T_HEADER(t); \
+      T_PUT_##t0(2, x0); \
+      T_PUT_##t1(3, x1); \
+      T_COMMIT(); \
+    } \
+  } while (0)
+
+#define T7(t,t0,x0,t1,x1,t2,x2) \
+  do { \
+    if (T_ACTIVE(t)) { \
+      T_LOCAL_DATA \
+      T_HEADER(t); \
+      T_PUT_##t0(2, x0); \
+      T_PUT_##t1(3, x1); \
+      T_PUT_##t2(4, x2); \
+      T_COMMIT(); \
+    } \
+  } while (0)
+
+#define T9(t,t0,x0,t1,x1,t2,x2,t3,x3) \
+  do { \
+    if (T_ACTIVE(t)) { \
+      T_LOCAL_DATA \
+      T_HEADER(t); \
+      T_PUT_##t0(2, x0); \
+      T_PUT_##t1(3, x1); \
+      T_PUT_##t2(4, x2); \
+      T_PUT_##t3(5, x3); \
+      T_COMMIT(); \
+    } \
+  } while (0)
+
+#define T11(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4) \
+  do { \
+    if (T_ACTIVE(t)) { \
+      T_LOCAL_DATA \
+      T_HEADER(t); \
+      T_PUT_##t0(2, x0); \
+      T_PUT_##t1(3, x1); \
+      T_PUT_##t2(4, x2); \
+      T_PUT_##t3(5, x3); \
+      T_PUT_##t4(6, x4); \
+      T_COMMIT(); \
+    } \
+  } while (0)
+
+#define T13(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5) \
+  do { \
+    if (T_ACTIVE(t)) { \
+      T_LOCAL_DATA \
+      T_HEADER(t); \
+      T_PUT_##t0(2, x0); \
+      T_PUT_##t1(3, x1); \
+      T_PUT_##t2(4, x2); \
+      T_PUT_##t3(5, x3); \
+      T_PUT_##t4(6, x4); \
+      T_PUT_##t5(7, x5); \
+      T_COMMIT(); \
+    } \
+  } while (0)
+
+#define T15(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6) \
+  do { \
+    if (T_ACTIVE(t)) { \
+      T_LOCAL_DATA \
+      T_HEADER(t); \
+      T_PUT_##t0(2, x0); \
+      T_PUT_##t1(3, x1); \
+      T_PUT_##t2(4, x2); \
+      T_PUT_##t3(5, x3); \
+      T_PUT_##t4(6, x4); \
+      T_PUT_##t5(7, x5); \
+      T_PUT_##t6(8, x6); \
+      T_COMMIT(); \
+    } \
+  } while (0)
+
+#define T17(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7) \
+  do { \
+    if (T_ACTIVE(t)) { \
+      T_LOCAL_DATA \
+      T_HEADER(t); \
+      T_PUT_##t0(2, x0); \
+      T_PUT_##t1(3, x1); \
+      T_PUT_##t2(4, x2); \
+      T_PUT_##t3(5, x3); \
+      T_PUT_##t4(6, x4); \
+      T_PUT_##t5(7, x5); \
+      T_PUT_##t6(8, x6); \
+      T_PUT_##t7(9, x7); \
+      T_COMMIT(); \
+    } \
+  } while (0)
+
+#define T19(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8) \
+  do { \
+    if (T_ACTIVE(t)) { \
+      T_LOCAL_DATA \
+      T_HEADER(t); \
+      T_PUT_##t0(2, x0); \
+      T_PUT_##t1(3, x1); \
+      T_PUT_##t2(4, x2); \
+      T_PUT_##t3(5, x3); \
+      T_PUT_##t4(6, x4); \
+      T_PUT_##t5(7, x5); \
+      T_PUT_##t6(8, x6); \
+      T_PUT_##t7(9, x7); \
+      T_PUT_##t8(10, x8); \
+      T_COMMIT(); \
+    } \
+  } while (0)
+
+#define T21(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9) \
+  do { \
+    if (T_ACTIVE(t)) { \
+      T_LOCAL_DATA \
+      T_HEADER(t); \
+      T_PUT_##t0(2, x0); \
+      T_PUT_##t1(3, x1); \
+      T_PUT_##t2(4, x2); \
+      T_PUT_##t3(5, x3); \
+      T_PUT_##t4(6, x4); \
+      T_PUT_##t5(7, x5); \
+      T_PUT_##t6(8, x6); \
+      T_PUT_##t7(9, x7); \
+      T_PUT_##t8(10, x8); \
+      T_PUT_##t9(11, x9); \
+      T_COMMIT(); \
+    } \
+  } while (0)
+
+#define T23(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,t10,x10) \
+  do { \
+    if (T_ACTIVE(t)) { \
+      T_LOCAL_DATA \
+      T_HEADER(t); \
+      T_PUT_##t0(2, x0); \
+      T_PUT_##t1(3, x1); \
+      T_PUT_##t2(4, x2); \
+      T_PUT_##t3(5, x3); \
+      T_PUT_##t4(6, x4); \
+      T_PUT_##t5(7, x5); \
+      T_PUT_##t6(8, x6); \
+      T_PUT_##t7(9, x7); \
+      T_PUT_##t8(10, x8); \
+      T_PUT_##t9(11, x9); \
+      T_PUT_##t10(12, x10); \
+      T_COMMIT(); \
+    } \
+  } while (0)
+
+#define T25(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,t10,x10,t11,x11) \
+  do { \
+    if (T_ACTIVE(t)) { \
+      T_LOCAL_DATA \
+      T_HEADER(t); \
+      T_PUT_##t0(2, x0); \
+      T_PUT_##t1(3, x1); \
+      T_PUT_##t2(4, x2); \
+      T_PUT_##t3(5, x3); \
+      T_PUT_##t4(6, x4); \
+      T_PUT_##t5(7, x5); \
+      T_PUT_##t6(8, x6); \
+      T_PUT_##t7(9, x7); \
+      T_PUT_##t8(10, x8); \
+      T_PUT_##t9(11, x9); \
+      T_PUT_##t10(12, x10); \
+      T_PUT_##t11(13, x11); \
+      T_COMMIT(); \
+    } \
+  } while (0)
+
+#define T27(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,t10,x10,t11,x11,t12,x12) \
+  do { \
+    if (T_ACTIVE(t)) { \
+      T_LOCAL_DATA \
+      T_HEADER(t); \
+      T_PUT_##t0(2, x0); \
+      T_PUT_##t1(3, x1); \
+      T_PUT_##t2(4, x2); \
+      T_PUT_##t3(5, x3); \
+      T_PUT_##t4(6, x4); \
+      T_PUT_##t5(7, x5); \
+      T_PUT_##t6(8, x6); \
+      T_PUT_##t7(9, x7); \
+      T_PUT_##t8(10, x8); \
+      T_PUT_##t9(11, x9); \
+      T_PUT_##t10(12, x10); \
+      T_PUT_##t11(13, x11); \
+      T_PUT_##t12(14, x12); \
+      T_COMMIT(); \
+    } \
+  } while (0)
+
+#define T29(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,t10,x10,t11,x11,t12,x12,t13,x13) \
+  do { \
+    if (T_ACTIVE(t)) { \
+      T_LOCAL_DATA \
+      T_HEADER(t); \
+      T_PUT_##t0(2, x0); \
+      T_PUT_##t1(3, x1); \
+      T_PUT_##t2(4, x2); \
+      T_PUT_##t3(5, x3); \
+      T_PUT_##t4(6, x4); \
+      T_PUT_##t5(7, x5); \
+      T_PUT_##t6(8, x6); \
+      T_PUT_##t7(9, x7); \
+      T_PUT_##t8(10, x8); \
+      T_PUT_##t9(11, x9); \
+      T_PUT_##t10(12, x10); \
+      T_PUT_##t11(13, x11); \
+      T_PUT_##t12(14, x12); \
+      T_PUT_##t13(15, x13); \
+      T_COMMIT(); \
+    } \
+  } while (0)
+
+#define T31(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,t10,x10,t11,x11,t12,x12,t13,x13,t14,x14) \
+  do { \
+    if (T_ACTIVE(t)) { \
+      T_LOCAL_DATA \
+      T_HEADER(t); \
+      T_PUT_##t0(2, x0); \
+      T_PUT_##t1(3, x1); \
+      T_PUT_##t2(4, x2); \
+      T_PUT_##t3(5, x3); \
+      T_PUT_##t4(6, x4); \
+      T_PUT_##t5(7, x5); \
+      T_PUT_##t6(8, x6); \
+      T_PUT_##t7(9, x7); \
+      T_PUT_##t8(10, x8); \
+      T_PUT_##t9(11, x9); \
+      T_PUT_##t10(12, x10); \
+      T_PUT_##t11(13, x11); \
+      T_PUT_##t12(14, x12); \
+      T_PUT_##t13(15, x13); \
+      T_PUT_##t14(16, x14); \
+      T_COMMIT(); \
+    } \
+  } while (0)
+
+#define T33(t,t0,x0,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,t10,x10,t11,x11,t12,x12,t13,x13,t14,x14,t15,x15) \
+  do { \
+    if (T_ACTIVE(t)) { \
+      T_LOCAL_DATA \
+      T_HEADER(t); \
+      T_PUT_##t0(2, x0); \
+      T_PUT_##t1(3, x1); \
+      T_PUT_##t2(4, x2); \
+      T_PUT_##t3(5, x3); \
+      T_PUT_##t4(6, x4); \
+      T_PUT_##t5(7, x5); \
+      T_PUT_##t6(8, x6); \
+      T_PUT_##t7(9, x7); \
+      T_PUT_##t8(10, x8); \
+      T_PUT_##t9(11, x9); \
+      T_PUT_##t10(12, x10); \
+      T_PUT_##t11(13, x11); \
+      T_PUT_##t12(14, x12); \
+      T_PUT_##t13(15, x13); \
+      T_PUT_##t14(16, x14); \
+      T_PUT_##t15(17, x15); \
+      T_COMMIT(); \
+    } \
+  } while (0)
+
+#define T_CALL_ERROR \
+  do { \
+    printf("%s:%d:%s: error calling T, you have to use T_INT() or T_XX()\n", \
+           __FILE__, __LINE__, __FUNCTION__); \
+  } while (0)
+
+#define T2(...) T_CALL_ERROR
+#define T4(...) T_CALL_ERROR
+#define T6(...) T_CALL_ERROR
+#define T8(...) T_CALL_ERROR
+#define T10(...) T_CALL_ERROR
+#define T12(...) T_CALL_ERROR
+#define T14(...) T_CALL_ERROR
+#define T16(...) T_CALL_ERROR
+#define T18(...) T_CALL_ERROR
+#define T20(...) T_CALL_ERROR
+#define T22(...) T_CALL_ERROR
+#define T24(...) T_CALL_ERROR
+#define T26(...) T_CALL_ERROR
+#define T28(...) T_CALL_ERROR
+#define T30(...) T_CALL_ERROR
+#define T32(...) T_CALL_ERROR
+
+/* special cases for VCD logs */
+
+#define T_VCD_VARIABLE(var, val) \
+  do { \
+    if (T_ACTIVE(((var) + VCD_FIRST_VARIABLE))) { \
+      if ((var) > VCD_NUM_VARIABLES) { \
+        printf("%s:%d:%s: VCD data out of synch for the T, contact" \
+               " the authors!\n", __FILE__, __LINE__, __FUNCTION__); \
+        abort(); \
+      } \
+      T_LOCAL_DATA \
+      T_HEADER(T_ID((var) + VCD_FIRST_VARIABLE)); \
+      T_PUT_ulong(1, (val)); \
+      T_COMMIT(); \
+    } \
+  } while (0)
+
+#define T_VCD_FUNCTION(fun, val) \
+  do { \
+    if (T_ACTIVE(((fun) + VCD_FIRST_FUNCTION))) { \
+      if ((fun) > VCD_NUM_FUNCTIONS) { \
+        printf("%s:%d:%s: VCD data out of synch for the T, contact" \
+               " the authors!\n", __FILE__, __LINE__, __FUNCTION__); \
+        abort(); \
+      } \
+      T_LOCAL_DATA \
+      T_HEADER(T_ID((fun) + VCD_FIRST_FUNCTION)); \
+      T_PUT_int(1, (val)); \
+      T_COMMIT(); \
+    } \
+  } while (0)
+
+extern int *T_active;
+
+void T_init(int remote_port, int wait_for_tracer, int dont_fork);
+
+#else /* T_TRACER */
+
+/* if T_TRACER is not defined or is 0, the T is deactivated */
+#define T(...) /**/
+
+#endif /* T_TRACER */
+
+#endif /* _T_T_T_ */
diff --git a/common/utils/T/T_defs.h b/common/utils/T/T_defs.h
new file mode 100644
index 0000000000000000000000000000000000000000..9285a68d561cfdfc8ce61f640836c19c053ce1ef
--- /dev/null
+++ b/common/utils/T/T_defs.h
@@ -0,0 +1,43 @@
+#ifndef _T_defs_H_
+#define _T_defs_H_
+
+/* comment (and recompile everything) to not send time in events */
+#define T_SEND_TIME
+
+/* maximum number of arguments for the T macro */
+#define T_MAX_ARGS 16
+
+/* maximum size of a message - increase if needed */
+#define T_BUFFER_MAX (1024*64)
+
+/* size of the local cache for messages (must be pow(2,something)) */
+#define T_CACHE_SIZE (8192 * 2)
+
+/* maximum number of bytes a message can contain */
+#ifdef T_SEND_TIME
+#  define T_PAYLOAD_MAXSIZE (T_BUFFER_MAX-sizeof(int)-sizeof(struct timespec))
+#else
+#  define T_PAYLOAD_MAXSIZE (T_BUFFER_MAX-sizeof(int))
+#endif
+
+typedef struct {
+  volatile int busy;
+  char buffer[T_BUFFER_MAX];
+  int length;
+} T_cache_t;
+
+#define T_SHM_FILENAME "/T_shm_segment"
+
+/* number of VCD functions (to be kept up to date! see in T_messages.txt) */
+#define VCD_NUM_FUNCTIONS 146
+
+/* number of VCD variables (to be kept up to date! see in T_messages.txt) */
+#define VCD_NUM_VARIABLES 99
+
+/* first VCD function (to be kept up to date! see in T_messages.txt) */
+#define VCD_FIRST_FUNCTION    ((uintptr_t)T_VCD_FUNCTION_RT_SLEEP)
+
+/* first VCD variable (to be kept up to date! see in T_messages.txt) */
+#define VCD_FIRST_VARIABLE    ((uintptr_t)T_VCD_VARIABLE_FRAME_NUMBER_TX_ENB)
+
+#endif /* _T_defs_H_ */
diff --git a/common/utils/T/T_messages.txt b/common/utils/T/T_messages.txt
new file mode 100644
index 0000000000000000000000000000000000000000..050c48d0a9c78c99ce24a33bb19db25708f2397f
--- /dev/null
+++ b/common/utils/T/T_messages.txt
@@ -0,0 +1,1791 @@
+#general logs
+ID = ENB_MASTER_TICK
+    DESC = eNodeB master tick - one tick per ms, to be used as "reference clock", mostly for ticktime view
+    GROUP = ALL:GENERAL:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe
+
+#PHY logs
+ID = ENB_PHY_UL_TICK
+    DESC = eNodeB uplink tick - one tick per ms at start of uplink processing
+    GROUP = ALL:PHY:GRAPHIC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe
+ID = ENB_PHY_DL_TICK
+    DESC = eNodeB downlink tick - one tick per ms at start of downlink processing
+    GROUP = ALL:PHY:GRAPHIC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe
+ID = ENB_PHY_DLSCH_UE_DCI
+    DESC = eNodeB downlink UE specific DCI as sent by the PHY layer
+    GROUP = ALL:PHY:GRAPHIC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,dci_format : int,harq_pid
+ID = ENB_PHY_DLSCH_UE_ACK
+    DESC = eNodeB downlink UE ACK as seen by the PHY layer in process_HARQ_feedback
+    GROUP = ALL:PHY:GRAPHIC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid
+ID = ENB_PHY_DLSCH_UE_NACK
+    DESC = eNodeB downlink UE NACK as seen by the PHY layer in process_HARQ_feedback
+    GROUP = ALL:PHY:GRAPHIC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid
+ID = ENB_PHY_ULSCH_UE_DCI
+    DESC = eNodeB uplink UE specific DCI as sent by the PHY layer
+    GROUP = ALL:PHY:GRAPHIC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid
+ID = ENB_PHY_ULSCH_UE_NO_DCI_RETRANSMISSION
+    DESC = eNodeB uplink UE retransmission due to PHICH NACK (see generate_phich_top)
+    GROUP = ALL:PHY:GRAPHIC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid
+ID = ENB_PHY_ULSCH_UE_ACK
+    DESC = eNodeB uplink UE ACK as seen by the PHY layer
+    GROUP = ALL:PHY:GRAPHIC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid
+ID = ENB_PHY_ULSCH_UE_NACK
+    DESC = eNodeB uplink UE NACK as seen by the PHY layer
+    GROUP = ALL:PHY:GRAPHIC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid
+ID = ENB_PHY_INPUT_SIGNAL
+    DESC = eNodeB received signal in the time domain for a duration of 1ms
+    GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,antenna : buffer,rxdata
+ID = ENB_PHY_UL_CHANNEL_ESTIMATE
+    DESC = eNodeB channel estimation in the time domain
+    GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB
+    FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,antenna : buffer,chest_t
+ID = ENB_PHY_PUSCH_IQ
+    DESC = eNodeB PUSCH received IQ data
+    GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB
+    FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,nb_rb : int,N_RB_UL : int,symbols_per_tti : buffer,pusch_comp
+ID = ENB_PHY_PUCCH_1AB_IQ
+    DESC = eNodeB PUCCH received IQ data
+    GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB
+    FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,I : int,Q
+ID = ENB_PHY_PUCCH_1_ENERGY
+    DESC = eNodeB PUCCH 1 energy and threshold
+    GROUP = ALL:PHY:GRAPHIC:HEAVY:ENB
+    FORMAT = int,eNB_ID : int,UE_ID : int,frame : int,subframe : int,energy : int,threshold
+
+#MAC logs
+ID = ENB_MAC_UE_DL_SDU
+    DESC = MAC downlink SDU for an UE coming from RLC to MAC
+    GROUP = ALL:MAC:ENB
+    FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,harq_pid : int,lcid : int,length
+ID = ENB_MAC_UE_UL_SCHEDULE
+    DESC = MAC uplink UE scheduling decision
+    GROUP = ALL:MAC:ENB
+    FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,harq_pid : int,mcs : int,first_rb : int,nb_rb : int,TBS
+ID = ENB_MAC_UE_UL_SCHEDULE_RETRANSMISSION
+    DESC = MAC uplink UE scheduling retransmission decision
+    GROUP = ALL:MAC:ENB
+    FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,harq_pid : int,mcs : int,first_rb : int,nb_rb : int,round
+ID = ENB_MAC_UE_UL_PDU
+    DESC = MAC uplink UE received PDU
+    GROUP = ALL:MAC:ENB
+    FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,harq_pid : int,sdu_length : int,num_ce : int,num_sdu
+ID = ENB_MAC_UE_UL_PDU_WITH_DATA
+    DESC = MAC uplink UE received PDU
+    GROUP = ALL:MAC:ENB:HEAVY
+    FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,harq_pid : int,sdu_length : int,num_ce : int,num_sdu : buffer,data
+ID = ENB_MAC_UE_UL_SDU
+    DESC = MAC uplink UE received SDU
+    GROUP = ALL:MAC:ENB
+    FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,lcid : int,length
+ID = ENB_MAC_UE_UL_SDU_WITH_DATA
+    DESC = MAC uplink UE received SDU
+    GROUP = ALL:MAC:ENB:HEAVY
+    FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,lcid : int,length : buffer,data
+ID = ENB_MAC_UE_UL_CE
+    DESC = MAC uplink UE received control element
+    GROUP = ALL:MAC:ENB
+    FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,ce
+ID = ENB_MAC_UE_DL_PDU_WITH_DATA
+    DESC = MAC downlink PDU for an UE
+    GROUP = ALL:MAC:ENB
+    FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,harq_pid : buffer,data
+
+#RLC logs
+ID = ENB_RLC_DL
+    DESC = RLC downlink data
+    GROUP = ALL:RLC:ENB
+    FORMAT = int,eNB_ID : int,rnti : int,rb_id : int,length
+ID = ENB_RLC_UL
+    DESC = RLC uplink data
+    GROUP = ALL:RLC:ENB
+    FORMAT = int,eNB_ID : int,rnti : int,rb_id : int,length
+ID = ENB_RLC_MAC_DL
+    DESC = RLC downlink data
+    GROUP = ALL:RLC:ENB
+    FORMAT = int,eNB_ID : int,rnti : int,rb_id : int,length
+ID = ENB_RLC_MAC_UL
+    DESC = RLC uplink data
+    GROUP = ALL:RLC:ENB
+    FORMAT = int,eNB_ID : int,rnti : int,rb_id : int,length
+
+#PDCP logs
+ID = ENB_PDCP_UL
+    DESC = PDCP uplink data
+    GROUP = ALL:PDCP:ENB
+    FORMAT = int,eNB_ID : int,rnti : int,rb_id : int,length
+ID = ENB_PDCP_DL
+    DESC = PDCP uplink data
+    GROUP = ALL:PDCP:ENB
+    FORMAT = int,eNB_ID : int,rnti : int,rb_id : int,length
+
+#RRC logs
+ID = ENB_RRC_CONNECTION_SETUP_COMPLETE
+    DESC = RRC connection setup complete
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+ID = ENB_RRC_SECURITY_MODE_COMMAND
+    DESC = RRC security mode command
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+ID = ENB_RRC_SECURITY_MODE_COMPLETE
+    DESC = RRC security mode complete
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+ID = ENB_RRC_SECURITY_MODE_FAILURE
+    DESC = RRC security mode failure
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+ID = ENB_RRC_UE_CAPABILITY_ENQUIRY
+    DESC = RRC UE capability enquiry
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+ID = ENB_RRC_UE_CAPABILITY_INFORMATION
+    DESC = RRC UE capability information
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+ID = ENB_RRC_CONNECTION_REQUEST
+    DESC = RRC connection request
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+ID = ENB_RRC_CONNECTION_REJECT
+    DESC = RRC connection reject
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+ID = ENB_RRC_CONNECTION_REESTABLISHMENT_REQUEST
+    DESC = RRC connection reestablishment request
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+ID = ENB_RRC_CONNECTION_REESTABLISHMENT_COMPLETE
+    DESC = RRC connection reestablishment complete
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+ID = ENB_RRC_CONNECTION_REESTABLISHMENT_REJECT
+    DESC = RRC connection reestablishment reject
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+ID = ENB_RRC_CONNECTION_RELEASE
+    DESC = RRC connection release
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+ID = ENB_RRC_CONNECTION_RECONFIGURATION
+    DESC = RRC connection reconfiguration
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+ID = ENB_RRC_MEASUREMENT_REPORT
+    DESC = RRC measurement report
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+ID = ENB_RRC_HANDOVER_PREPARATION_INFORMATION
+    DESC = RRC handover preparation information
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+ID = ENB_RRC_CONNECTION_RECONFIGURATION_COMPLETE
+    DESC = RRC connection reconfiguration complete
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+ID = ENB_RRC_CONNECTION_SETUP
+    DESC = RRC connection setup
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+ID = ENB_RRC_UL_CCCH_DATA_IN
+    DESC = RRC uplink CCCH data in
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+ID = ENB_RRC_UL_DCCH_DATA_IN
+    DESC = RRC uplink DCCH data in
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+ID = ENB_RRC_UL_HANDOVER_PREPARATION_TRANSFER
+    DESC = RRC uplink handover preparation transfer
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+ID = ENB_RRC_UL_INFORMATION_TRANSFER
+    DESC = RRC uplink information transfer
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+ID = ENB_RRC_COUNTER_CHECK_RESPONSE
+    DESC = RRC counter check response
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+ID = ENB_RRC_UE_INFORMATION_RESPONSE_R9
+    DESC = RRC UE information response r9
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+ID = ENB_RRC_PROXIMITY_INDICATION_R9
+    DESC = RRC proximity indication r9
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+ID = ENB_RRC_RECONFIGURATION_COMPLETE_R10
+    DESC = RRC reconfiguration complete r10
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+ID = ENB_RRC_MBMS_COUNTING_RESPONSE_R10
+    DESC = RRC MBMS counting response r10
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+ID = ENB_RRC_INTER_FREQ_RSTD_MEASUREMENT_INDICATION
+    DESC = RRC inter frequency RSTD measurement indication
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+ID = ENB_RRC_UNKNOW_MESSAGE
+    DESC = RRC unknown message
+    GROUP = ALL:RRC:ENB
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti
+
+#legacy logs
+ID = LEGACY_MAC_INFO
+    DESC = MAC legacy logs - info level
+    GROUP = ALL:LEGACY_MAC:LEGACY_GROUP_INFO:LEGACY
+    FORMAT = string,log
+ID = LEGACY_MAC_ERROR
+    DESC = MAC legacy logs - error level
+    GROUP = ALL:LEGACY_MAC:LEGACY_GROUP_ERROR:LEGACY
+    FORMAT = string,log
+ID = LEGACY_MAC_WARNING
+    DESC = MAC legacy logs - warning level
+    GROUP = ALL:LEGACY_MAC:LEGACY_GROUP_WARNING:LEGACY
+    FORMAT = string,log
+ID = LEGACY_MAC_DEBUG
+    DESC = MAC legacy logs - debug level
+    GROUP = ALL:LEGACY_MAC:LEGACY_GROUP_DEBUG:LEGACY
+    FORMAT = string,log
+ID = LEGACY_MAC_TRACE
+    DESC = MAC legacy logs - trace level
+    GROUP = ALL:LEGACY_MAC:LEGACY_GROUP_TRACE:LEGACY
+    FORMAT = string,log
+
+ID = LEGACY_PHY_INFO
+    DESC = PHY legacy logs - info level
+    GROUP = ALL:LEGACY_PHY:LEGACY_GROUP_INFO:LEGACY
+    FORMAT = string,log
+ID = LEGACY_PHY_ERROR
+    DESC = PHY legacy logs - error level
+    GROUP = ALL:LEGACY_PHY:LEGACY_GROUP_ERROR:LEGACY
+    FORMAT = string,log
+ID = LEGACY_PHY_WARNING
+    DESC = PHY legacy logs - warning level
+    GROUP = ALL:LEGACY_PHY:LEGACY_GROUP_WARNING:LEGACY
+    FORMAT = string,log
+ID = LEGACY_PHY_DEBUG
+    DESC = PHY legacy logs - debug level
+    GROUP = ALL:LEGACY_PHY:LEGACY_GROUP_DEBUG:LEGACY
+    FORMAT = string,log
+ID = LEGACY_PHY_TRACE
+    DESC = PHY legacy logs - trace level
+    GROUP = ALL:LEGACY_PHY:LEGACY_GROUP_TRACE:LEGACY
+    FORMAT = string,log
+
+ID = LEGACY_S1AP_INFO
+    DESC = S1AP legacy logs - info level
+    GROUP = ALL:LEGACY_S1AP:LEGACY_GROUP_INFO:LEGACY
+    FORMAT = string,log
+ID = LEGACY_S1AP_ERROR
+    DESC = S1AP legacy logs - error level
+    GROUP = ALL:LEGACY_S1AP:LEGACY_GROUP_ERROR:LEGACY
+    FORMAT = string,log
+ID = LEGACY_S1AP_WARNING
+    DESC = S1AP legacy logs - warning level
+    GROUP = ALL:LEGACY_S1AP:LEGACY_GROUP_WARNING:LEGACY
+    FORMAT = string,log
+ID = LEGACY_S1AP_DEBUG
+    DESC = S1AP legacy logs - debug level
+    GROUP = ALL:LEGACY_S1AP:LEGACY_GROUP_DEBUG:LEGACY
+    FORMAT = string,log
+ID = LEGACY_S1AP_TRACE
+    DESC = S1AP legacy logs - trace level
+    GROUP = ALL:LEGACY_S1AP:LEGACY_GROUP_TRACE:LEGACY
+    FORMAT = string,log
+
+ID = LEGACY_X2AP_INFO
+    DESC = X2AP legacy logs - info level
+    GROUP = ALL:LEGACY_X2AP:LEGACY_GROUP_INFO:LEGACY
+    FORMAT = string,log
+ID = LEGACY_X2AP_ERROR
+    DESC = X2AP legacy logs - error level
+    GROUP = ALL:LEGACY_X2AP:LEGACY_GROUP_ERROR:LEGACY
+    FORMAT = string,log
+ID = LEGACY_X2AP_WARNING
+    DESC = X2AP legacy logs - warning level
+    GROUP = ALL:LEGACY_X2AP:LEGACY_GROUP_WARNING:LEGACY
+    FORMAT = string,log
+ID = LEGACY_X2AP_DEBUG
+    DESC = X2AP legacy logs - debug level
+    GROUP = ALL:LEGACY_X2AP:LEGACY_GROUP_DEBUG:LEGACY
+    FORMAT = string,log
+ID = LEGACY_X2AP_TRACE
+    DESC = X2AP legacy logs - trace level
+    GROUP = ALL:LEGACY_X2AP:LEGACY_GROUP_TRACE:LEGACY
+    FORMAT = string,log
+
+ID = LEGACY_RRC_INFO
+    DESC = RRC legacy logs - info level
+    GROUP = ALL:LEGACY_RRC:LEGACY_GROUP_INFO:LEGACY
+    FORMAT = string,log
+ID = LEGACY_RRC_ERROR
+    DESC = RRC legacy logs - error level
+    GROUP = ALL:LEGACY_RRC:LEGACY_GROUP_ERROR:LEGACY
+    FORMAT = string,log
+ID = LEGACY_RRC_WARNING
+    DESC = RRC legacy logs - warning level
+    GROUP = ALL:LEGACY_RRC:LEGACY_GROUP_WARNING:LEGACY
+    FORMAT = string,log
+ID = LEGACY_RRC_DEBUG
+    DESC = RRC legacy logs - debug level
+    GROUP = ALL:LEGACY_RRC:LEGACY_GROUP_DEBUG:LEGACY
+    FORMAT = string,log
+ID = LEGACY_RRC_TRACE
+    DESC = RRC legacy logs - trace level
+    GROUP = ALL:LEGACY_RRC:LEGACY_GROUP_TRACE:LEGACY
+    FORMAT = string,log
+
+ID = LEGACY_RLC_INFO
+    DESC = RLC legacy logs - info level
+    GROUP = ALL:LEGACY_RLC:LEGACY_GROUP_INFO:LEGACY
+    FORMAT = string,log
+ID = LEGACY_RLC_ERROR
+    DESC = RLC legacy logs - error level
+    GROUP = ALL:LEGACY_RLC:LEGACY_GROUP_ERROR:LEGACY
+    FORMAT = string,log
+ID = LEGACY_RLC_WARNING
+    DESC = RLC legacy logs - warning level
+    GROUP = ALL:LEGACY_RLC:LEGACY_GROUP_WARNING:LEGACY
+    FORMAT = string,log
+ID = LEGACY_RLC_DEBUG
+    DESC = RLC legacy logs - debug level
+    GROUP = ALL:LEGACY_RLC:LEGACY_GROUP_DEBUG:LEGACY
+    FORMAT = string,log
+ID = LEGACY_RLC_TRACE
+    DESC = RLC legacy logs - trace level
+    GROUP = ALL:LEGACY_RLC:LEGACY_GROUP_TRACE:LEGACY
+    FORMAT = string,log
+
+ID = LEGACY_PDCP_INFO
+    DESC = PDCP legacy logs - info level
+    GROUP = ALL:LEGACY_PDCP:LEGACY_GROUP_INFO:LEGACY
+    FORMAT = string,log
+ID = LEGACY_PDCP_ERROR
+    DESC = PDCP legacy logs - error level
+    GROUP = ALL:LEGACY_PDCP:LEGACY_GROUP_ERROR:LEGACY
+    FORMAT = string,log
+ID = LEGACY_PDCP_WARNING
+    DESC = PDCP legacy logs - warning level
+    GROUP = ALL:LEGACY_PDCP:LEGACY_GROUP_WARNING:LEGACY
+    FORMAT = string,log
+ID = LEGACY_PDCP_DEBUG
+    DESC = PDCP legacy logs - debug level
+    GROUP = ALL:LEGACY_PDCP:LEGACY_GROUP_DEBUG:LEGACY
+    FORMAT = string,log
+ID = LEGACY_PDCP_TRACE
+    DESC = PDCP legacy logs - trace level
+    GROUP = ALL:LEGACY_PDCP:LEGACY_GROUP_TRACE:LEGACY
+    FORMAT = string,log
+
+ID = LEGACY_ENB_APP_INFO
+    DESC = ENB_APP legacy logs - info level
+    GROUP = ALL:LEGACY_ENB_APP:LEGACY_GROUP_INFO:LEGACY
+    FORMAT = string,log
+ID = LEGACY_ENB_APP_ERROR
+    DESC = ENB_APP legacy logs - error level
+    GROUP = ALL:LEGACY_ENB_APP:LEGACY_GROUP_ERROR:LEGACY
+    FORMAT = string,log
+ID = LEGACY_ENB_APP_WARNING
+    DESC = ENB_APP legacy logs - warning level
+    GROUP = ALL:LEGACY_ENB_APP:LEGACY_GROUP_WARNING:LEGACY
+    FORMAT = string,log
+ID = LEGACY_ENB_APP_DEBUG
+    DESC = ENB_APP legacy logs - debug level
+    GROUP = ALL:LEGACY_ENB_APP:LEGACY_GROUP_DEBUG:LEGACY
+    FORMAT = string,log
+ID = LEGACY_ENB_APP_TRACE
+    DESC = ENB_APP legacy logs - trace level
+    GROUP = ALL:LEGACY_ENB_APP:LEGACY_GROUP_TRACE:LEGACY
+    FORMAT = string,log
+
+ID = LEGACY_SCTP_INFO
+    DESC = SCTP legacy logs - info level
+    GROUP = ALL:LEGACY_SCTP:LEGACY_GROUP_INFO:LEGACY
+    FORMAT = string,log
+ID = LEGACY_SCTP_ERROR
+    DESC = SCTP legacy logs - error level
+    GROUP = ALL:LEGACY_SCTP:LEGACY_GROUP_ERROR:LEGACY
+    FORMAT = string,log
+ID = LEGACY_SCTP_WARNING
+    DESC = SCTP legacy logs - warning level
+    GROUP = ALL:LEGACY_SCTP:LEGACY_GROUP_WARNING:LEGACY
+    FORMAT = string,log
+ID = LEGACY_SCTP_DEBUG
+    DESC = SCTP legacy logs - debug level
+    GROUP = ALL:LEGACY_SCTP:LEGACY_GROUP_DEBUG:LEGACY
+    FORMAT = string,log
+ID = LEGACY_SCTP_TRACE
+    DESC = SCTP legacy logs - trace level
+    GROUP = ALL:LEGACY_SCTP:LEGACY_GROUP_TRACE:LEGACY
+    FORMAT = string,log
+
+ID = LEGACY_UDP__INFO
+    DESC = UDP_ legacy logs - info level
+    GROUP = ALL:LEGACY_UDP_:LEGACY_GROUP_INFO:LEGACY
+    FORMAT = string,log
+ID = LEGACY_UDP__ERROR
+    DESC = UDP_ legacy logs - error level
+    GROUP = ALL:LEGACY_UDP_:LEGACY_GROUP_ERROR:LEGACY
+    FORMAT = string,log
+ID = LEGACY_UDP__WARNING
+    DESC = UDP_ legacy logs - warning level
+    GROUP = ALL:LEGACY_UDP_:LEGACY_GROUP_WARNING:LEGACY
+    FORMAT = string,log
+ID = LEGACY_UDP__DEBUG
+    DESC = UDP_ legacy logs - debug level
+    GROUP = ALL:LEGACY_UDP_:LEGACY_GROUP_DEBUG:LEGACY
+    FORMAT = string,log
+ID = LEGACY_UDP__TRACE
+    DESC = UDP_ legacy logs - trace level
+    GROUP = ALL:LEGACY_UDP_:LEGACY_GROUP_TRACE:LEGACY
+    FORMAT = string,log
+
+ID = LEGACY_NAS_INFO
+    DESC = NAS legacy logs - info level
+    GROUP = ALL:LEGACY_NAS:LEGACY_GROUP_INFO:LEGACY
+    FORMAT = string,log
+ID = LEGACY_NAS_ERROR
+    DESC = NAS legacy logs - error level
+    GROUP = ALL:LEGACY_NAS:LEGACY_GROUP_ERROR:LEGACY
+    FORMAT = string,log
+ID = LEGACY_NAS_WARNING
+    DESC = NAS legacy logs - warning level
+    GROUP = ALL:LEGACY_NAS:LEGACY_GROUP_WARNING:LEGACY
+    FORMAT = string,log
+ID = LEGACY_NAS_DEBUG
+    DESC = NAS legacy logs - debug level
+    GROUP = ALL:LEGACY_NAS:LEGACY_GROUP_DEBUG:LEGACY
+    FORMAT = string,log
+ID = LEGACY_NAS_TRACE
+    DESC = NAS legacy logs - trace level
+    GROUP = ALL:LEGACY_NAS:LEGACY_GROUP_TRACE:LEGACY
+    FORMAT = string,log
+
+ID = LEGACY_HW_INFO
+    DESC = HW legacy logs - info level
+    GROUP = ALL:LEGACY_HW:LEGACY_GROUP_INFO:LEGACY
+    FORMAT = string,log
+ID = LEGACY_HW_ERROR
+    DESC = HW legacy logs - error level
+    GROUP = ALL:LEGACY_HW:LEGACY_GROUP_ERROR:LEGACY
+    FORMAT = string,log
+ID = LEGACY_HW_WARNING
+    DESC = HW legacy logs - warning level
+    GROUP = ALL:LEGACY_HW:LEGACY_GROUP_WARNING:LEGACY
+    FORMAT = string,log
+ID = LEGACY_HW_DEBUG
+    DESC = HW legacy logs - debug level
+    GROUP = ALL:LEGACY_HW:LEGACY_GROUP_DEBUG:LEGACY
+    FORMAT = string,log
+ID = LEGACY_HW_TRACE
+    DESC = HW legacy logs - trace level
+    GROUP = ALL:LEGACY_HW:LEGACY_GROUP_TRACE:LEGACY
+    FORMAT = string,log
+
+ID = LEGACY_EMU_INFO
+    DESC = EMU legacy logs - info level
+    GROUP = ALL:LEGACY_EMU:LEGACY_GROUP_INFO:LEGACY
+    FORMAT = string,log
+ID = LEGACY_EMU_ERROR
+    DESC = EMU legacy logs - error level
+    GROUP = ALL:LEGACY_EMU:LEGACY_GROUP_ERROR:LEGACY
+    FORMAT = string,log
+ID = LEGACY_EMU_WARNING
+    DESC = EMU legacy logs - warning level
+    GROUP = ALL:LEGACY_EMU:LEGACY_GROUP_WARNING:LEGACY
+    FORMAT = string,log
+ID = LEGACY_EMU_DEBUG
+    DESC = EMU legacy logs - debug level
+    GROUP = ALL:LEGACY_EMU:LEGACY_GROUP_DEBUG:LEGACY
+    FORMAT = string,log
+ID = LEGACY_EMU_TRACE
+    DESC = EMU legacy logs - trace level
+    GROUP = ALL:LEGACY_EMU:LEGACY_GROUP_TRACE:LEGACY
+    FORMAT = string,log
+
+ID = LEGACY_OTG_INFO
+    DESC = OTG legacy logs - info level
+    GROUP = ALL:LEGACY_OTG:LEGACY_GROUP_INFO:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OTG_ERROR
+    DESC = OTG legacy logs - error level
+    GROUP = ALL:LEGACY_OTG:LEGACY_GROUP_ERROR:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OTG_WARNING
+    DESC = OTG legacy logs - warning level
+    GROUP = ALL:LEGACY_OTG:LEGACY_GROUP_WARNING:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OTG_DEBUG
+    DESC = OTG legacy logs - debug level
+    GROUP = ALL:LEGACY_OTG:LEGACY_GROUP_DEBUG:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OTG_TRACE
+    DESC = OTG legacy logs - trace level
+    GROUP = ALL:LEGACY_OTG:LEGACY_GROUP_TRACE:LEGACY
+    FORMAT = string,log
+
+ID = LEGACY_OCG_INFO
+    DESC = OCG legacy logs - info level
+    GROUP = ALL:LEGACY_OCG:LEGACY_GROUP_INFO:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OCG_ERROR
+    DESC = OCG legacy logs - error level
+    GROUP = ALL:LEGACY_OCG:LEGACY_GROUP_ERROR:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OCG_WARNING
+    DESC = OCG legacy logs - warning level
+    GROUP = ALL:LEGACY_OCG:LEGACY_GROUP_WARNING:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OCG_DEBUG
+    DESC = OCG legacy logs - debug level
+    GROUP = ALL:LEGACY_OCG:LEGACY_GROUP_DEBUG:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OCG_TRACE
+    DESC = OCG legacy logs - trace level
+    GROUP = ALL:LEGACY_OCG:LEGACY_GROUP_TRACE:LEGACY
+    FORMAT = string,log
+
+ID = LEGACY_OCM_INFO
+    DESC = OCM legacy logs - info level
+    GROUP = ALL:LEGACY_OCM:LEGACY_GROUP_INFO:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OCM_ERROR
+    DESC = OCM legacy logs - error level
+    GROUP = ALL:LEGACY_OCM:LEGACY_GROUP_ERROR:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OCM_WARNING
+    DESC = OCM legacy logs - warning level
+    GROUP = ALL:LEGACY_OCM:LEGACY_GROUP_WARNING:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OCM_DEBUG
+    DESC = OCM legacy logs - debug level
+    GROUP = ALL:LEGACY_OCM:LEGACY_GROUP_DEBUG:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OCM_TRACE
+    DESC = OCM legacy logs - trace level
+    GROUP = ALL:LEGACY_OCM:LEGACY_GROUP_TRACE:LEGACY
+    FORMAT = string,log
+
+ID = LEGACY_OIP_INFO
+    DESC = OIP legacy logs - info level
+    GROUP = ALL:LEGACY_OIP:LEGACY_GROUP_INFO:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OIP_ERROR
+    DESC = OIP legacy logs - error level
+    GROUP = ALL:LEGACY_OIP:LEGACY_GROUP_ERROR:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OIP_WARNING
+    DESC = OIP legacy logs - warning level
+    GROUP = ALL:LEGACY_OIP:LEGACY_GROUP_WARNING:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OIP_DEBUG
+    DESC = OIP legacy logs - debug level
+    GROUP = ALL:LEGACY_OIP:LEGACY_GROUP_DEBUG:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OIP_TRACE
+    DESC = OIP legacy logs - trace level
+    GROUP = ALL:LEGACY_OIP:LEGACY_GROUP_TRACE:LEGACY
+    FORMAT = string,log
+
+ID = LEGACY_OMG_INFO
+    DESC = OMG legacy logs - info level
+    GROUP = ALL:LEGACY_OMG:LEGACY_GROUP_INFO:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OMG_ERROR
+    DESC = OMG legacy logs - error level
+    GROUP = ALL:LEGACY_OMG:LEGACY_GROUP_ERROR:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OMG_WARNING
+    DESC = OMG legacy logs - warning level
+    GROUP = ALL:LEGACY_OMG:LEGACY_GROUP_WARNING:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OMG_DEBUG
+    DESC = OMG legacy logs - debug level
+    GROUP = ALL:LEGACY_OMG:LEGACY_GROUP_DEBUG:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OMG_TRACE
+    DESC = OMG legacy logs - trace level
+    GROUP = ALL:LEGACY_OMG:LEGACY_GROUP_TRACE:LEGACY
+    FORMAT = string,log
+
+ID = LEGACY_OPT_INFO
+    DESC = OPT legacy logs - info level
+    GROUP = ALL:LEGACY_OPT:LEGACY_GROUP_INFO:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OPT_ERROR
+    DESC = OPT legacy logs - error level
+    GROUP = ALL:LEGACY_OPT:LEGACY_GROUP_ERROR:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OPT_WARNING
+    DESC = OPT legacy logs - warning level
+    GROUP = ALL:LEGACY_OPT:LEGACY_GROUP_WARNING:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OPT_DEBUG
+    DESC = OPT legacy logs - debug level
+    GROUP = ALL:LEGACY_OPT:LEGACY_GROUP_DEBUG:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OPT_TRACE
+    DESC = OPT legacy logs - trace level
+    GROUP = ALL:LEGACY_OPT:LEGACY_GROUP_TRACE:LEGACY
+    FORMAT = string,log
+
+ID = LEGACY_GTPU_INFO
+    DESC = GTPU legacy logs - info level
+    GROUP = ALL:LEGACY_GTPU:LEGACY_GROUP_INFO:LEGACY
+    FORMAT = string,log
+ID = LEGACY_GTPU_ERROR
+    DESC = GTPU legacy logs - error level
+    GROUP = ALL:LEGACY_GTPU:LEGACY_GROUP_ERROR:LEGACY
+    FORMAT = string,log
+ID = LEGACY_GTPU_WARNING
+    DESC = GTPU legacy logs - warning level
+    GROUP = ALL:LEGACY_GTPU:LEGACY_GROUP_WARNING:LEGACY
+    FORMAT = string,log
+ID = LEGACY_GTPU_DEBUG
+    DESC = GTPU legacy logs - debug level
+    GROUP = ALL:LEGACY_GTPU:LEGACY_GROUP_DEBUG:LEGACY
+    FORMAT = string,log
+ID = LEGACY_GTPU_TRACE
+    DESC = GTPU legacy logs - trace level
+    GROUP = ALL:LEGACY_GTPU:LEGACY_GROUP_TRACE:LEGACY
+    FORMAT = string,log
+
+ID = LEGACY_TMR_INFO
+    DESC = TMR legacy logs - info level
+    GROUP = ALL:LEGACY_TMR:LEGACY_GROUP_INFO:LEGACY
+    FORMAT = string,log
+ID = LEGACY_TMR_ERROR
+    DESC = TMR legacy logs - error level
+    GROUP = ALL:LEGACY_TMR:LEGACY_GROUP_ERROR:LEGACY
+    FORMAT = string,log
+ID = LEGACY_TMR_WARNING
+    DESC = TMR legacy logs - warning level
+    GROUP = ALL:LEGACY_TMR:LEGACY_GROUP_WARNING:LEGACY
+    FORMAT = string,log
+ID = LEGACY_TMR_DEBUG
+    DESC = TMR legacy logs - debug level
+    GROUP = ALL:LEGACY_TMR:LEGACY_GROUP_DEBUG:LEGACY
+    FORMAT = string,log
+ID = LEGACY_TMR_TRACE
+    DESC = TMR legacy logs - trace level
+    GROUP = ALL:LEGACY_TMR:LEGACY_GROUP_TRACE:LEGACY
+    FORMAT = string,log
+
+ID = LEGACY_OSA_INFO
+    DESC = OSA legacy logs - info level
+    GROUP = ALL:LEGACY_OSA:LEGACY_GROUP_INFO:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OSA_ERROR
+    DESC = OSA legacy logs - error level
+    GROUP = ALL:LEGACY_OSA:LEGACY_GROUP_ERROR:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OSA_WARNING
+    DESC = OSA legacy logs - warning level
+    GROUP = ALL:LEGACY_OSA:LEGACY_GROUP_WARNING:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OSA_DEBUG
+    DESC = OSA legacy logs - debug level
+    GROUP = ALL:LEGACY_OSA:LEGACY_GROUP_DEBUG:LEGACY
+    FORMAT = string,log
+ID = LEGACY_OSA_TRACE
+    DESC = OSA legacy logs - trace level
+    GROUP = ALL:LEGACY_OSA:LEGACY_GROUP_TRACE:LEGACY
+    FORMAT = string,log
+
+# this is a bad hack but I won't fix (function util_print_hex_octets
+# in openairinterface5g/openair2/LAYER2/PDCP_v10.1.0/pdcp_util.c
+# does funky things with the LOG_x macros but we work on the C pre-processor
+# level and this funkyness is not easily dealable with, so be it...)
+ID = LEGACY_component_INFO
+    DESC = component legacy logs - info level
+    GROUP = ALL:LEGACY_component:LEGACY_GROUP_INFO:LEGACY
+    FORMAT = string,log
+ID = LEGACY_component_ERROR
+    DESC = component legacy logs - error level
+    GROUP = ALL:LEGACY_component:LEGACY_GROUP_ERROR:LEGACY
+    FORMAT = string,log
+ID = LEGACY_component_WARNING
+    DESC = component legacy logs - warning level
+    GROUP = ALL:LEGACY_component:LEGACY_GROUP_WARNING:LEGACY
+    FORMAT = string,log
+ID = LEGACY_component_DEBUG
+    DESC = component legacy logs - debug level
+    GROUP = ALL:LEGACY_component:LEGACY_GROUP_DEBUG:LEGACY
+    FORMAT = string,log
+ID = LEGACY_component_TRACE
+    DESC = component legacy logs - trace level
+    GROUP = ALL:LEGACY_component:LEGACY_GROUP_TRACE:LEGACY
+    FORMAT = string,log
+ID = LEGACY_componentP_INFO
+    DESC = componentP legacy logs - info level
+    GROUP = ALL:LEGACY_componentP:LEGACY_GROUP_INFO:LEGACY
+    FORMAT = string,log
+ID = LEGACY_componentP_ERROR
+    DESC = componentP legacy logs - error level
+    GROUP = ALL:LEGACY_componentP:LEGACY_GROUP_ERROR:LEGACY
+    FORMAT = string,log
+ID = LEGACY_componentP_WARNING
+    DESC = componentP legacy logs - warning level
+    GROUP = ALL:LEGACY_componentP:LEGACY_GROUP_WARNING:LEGACY
+    FORMAT = string,log
+ID = LEGACY_componentP_DEBUG
+    DESC = componentP legacy logs - debug level
+    GROUP = ALL:LEGACY_componentP:LEGACY_GROUP_DEBUG:LEGACY
+    FORMAT = string,log
+ID = LEGACY_componentP_TRACE
+    DESC = componentP legacy logs - trace level
+    GROUP = ALL:LEGACY_componentP:LEGACY_GROUP_TRACE:LEGACY
+    FORMAT = string,log
+
+#needed?
+ID = LEGACY_CLI_INFO
+    DESC = CLI legacy logs - info level
+    GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_INFO:LEGACY
+    FORMAT = string,log
+ID = LEGACY_CLI_ERROR
+    DESC = CLI legacy logs - error level
+    GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_ERROR:LEGACY
+    FORMAT = string,log
+ID = LEGACY_CLI_WARNING
+    DESC = CLI legacy logs - warning level
+    GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_WARNING:LEGACY
+    FORMAT = string,log
+ID = LEGACY_CLI_DEBUG
+    DESC = CLI legacy logs - debug level
+    GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_DEBUG:LEGACY
+    FORMAT = string,log
+ID = LEGACY_CLI_TRACE
+    DESC = CLI legacy logs - trace level
+    GROUP = ALL:LEGACY_CLI:LEGACY_GROUP_TRACE:LEGACY
+    FORMAT = string,log
+
+#for debug/test - not used
+ID = first
+ID = buf_test
+
+#VCD variables and functions
+
+#be careful! this must be synchronized with the code!
+#also keep up to date VCD_NUM_VARIABLES and VCD_NUM_FUNCTIONS in T_defs.h
+
+#to synchronize: copy/paste from openair2/UTIL/LOG/vcd_signal_dumper.h
+#the variables and functions name, replace "SIGNAL_DUMPER_VARIABLES" by
+#"VARIABLE" and "SIGNAL_DUMPER_FUNCTIONS" by "FUNCTION" (check that
+#everything is fine! for example we have
+#VCD_SIGNAL_DUMPER_VARIABLE_ITTI_SEND_MSG that has VARIABLE without S)
+#and then process with sed
+
+#to generate variables:
+#sed -e "s/  VCD_VARIABLE_\(.*\)/ID = VCD_VARIABLE_\1\n    DESC = VCD variable \1\n    GROUP = ALL:VCD:ENB\n    FORMAT = ulong,value/" < VCD >> T_messages.txt
+
+#to generate functions:
+#sed -e "s/  VCD_FUNCTION_\(.*\)/ID = VCD_FUNCTION_\1\n    DESC = VCD function \1\n    GROUP = ALL:VCD:ENB\n    FORMAT = int,value/" < VCD.functions >> T_messages.txt
+
+#you may want to manually edit groups for UE instead of eNB
+
+#then count functions and variables and update VCD_NUM_FUNCTIONS and
+#VCD_NUM_VARIABLES in T_defs.h
+
+#also verify that VCD_FIRST_FUNCTION and VCD_FIRST_VARIABLE are correct
+#in T_defs.h. They have to point to the first function and variable
+#as defined below. Note also that the order of the VCD functions
+#and variables must be the same as in the code.
+
+#variables
+
+ID = VCD_VARIABLE_FRAME_NUMBER_TX_ENB
+    DESC = VCD variable FRAME_NUMBER_TX_ENB
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_FRAME_NUMBER_RX_ENB
+    DESC = VCD variable FRAME_NUMBER_RX_ENB
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_RUNTIME_TX_ENB
+    DESC = VCD variable RUNTIME_TX_ENB
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_RUNTIME_RX_ENB
+    DESC = VCD variable RUNTIME_RX_ENB
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_FRAME_NUMBER_TX_UE
+    DESC = VCD variable FRAME_NUMBER_TX_UE
+    GROUP = ALL:VCD:UE:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_FRAME_NUMBER_RX_UE
+    DESC = VCD variable FRAME_NUMBER_RX_UE
+    GROUP = ALL:VCD:UE:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_SLOT_NUMBER_TX_UE
+    DESC = VCD variable SLOT_NUMBER_TX_UE
+    GROUP = ALL:VCD:UE:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_SLOT_NUMBER_RX_UE
+    DESC = VCD variable SLOT_NUMBER_RX_UE
+    GROUP = ALL:VCD:UE:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_SUBFRAME_NUMBER_TX_UE
+    DESC = VCD variable SUBFRAME_NUMBER_TX_UE
+    GROUP = ALL:VCD:UE:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_SUBFRAME_NUMBER_RX_UE
+    DESC = VCD variable SUBFRAME_NUMBER_RX_UE
+    GROUP = ALL:VCD:UE:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_MISSED_SLOTS_ENB
+    DESC = VCD variable MISSED_SLOTS_ENB
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_DAQ_MBOX
+    DESC = VCD variable DAQ_MBOX
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE_OFFSET_MBOX
+    DESC = VCD variable UE_OFFSET_MBOX
+    GROUP = ALL:VCD:UE:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE_RX_OFFSET
+    DESC = VCD variable UE_RX_OFFSET
+    GROUP = ALL:VCD:UE:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_DIFF
+    DESC = VCD variable DIFF
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_HW_SUBFRAME
+    DESC = VCD variable HW_SUBFRAME
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_HW_FRAME
+    DESC = VCD variable HW_FRAME
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_HW_SUBFRAME_RX
+    DESC = VCD variable HW_SUBFRAME_RX
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_HW_FRAME_RX
+    DESC = VCD variable HW_FRAME_RX
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_TXCNT
+    DESC = VCD variable TXCNT
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_RXCNT
+    DESC = VCD variable RXCNT
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_TRX_TS
+    DESC = VCD variable TRX_TS
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_TRX_TST
+    DESC = VCD variable TRX_TST
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_TX_TS
+    DESC = VCD variable TX_TS
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_RX_TS
+    DESC = VCD variable RX_TS
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_RX_HWCNT
+    DESC = VCD variable RX_HWCNT
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_RX_LHWCNT
+    DESC = VCD variable RX_LHWCNT
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_TX_HWCNT
+    DESC = VCD variable TX_HWCNT
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_TX_LHWCNT
+    DESC = VCD variable TX_LHWCNT
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_RX_PCK
+    DESC = VCD variable RX_PCK
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_TX_PCK
+    DESC = VCD variable TX_PCK
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_RX_SEQ_NUM
+    DESC = VCD variable RX_SEQ_NUM
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_RX_SEQ_NUM_PRV
+    DESC = VCD variable RX_SEQ_NUM_PRV
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_TX_SEQ_NUM
+    DESC = VCD variable TX_SEQ_NUM
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_CNT
+    DESC = VCD variable CNT
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_DUMMY_DUMP
+    DESC = VCD variable DUMMY_DUMP
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_ITTI_SEND_MSG
+    DESC = VCD variable ITTI_SEND_MSG
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_ITTI_POLL_MSG
+    DESC = VCD variable ITTI_POLL_MSG
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_ITTI_RECV_MSG
+    DESC = VCD variable ITTI_RECV_MSG
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_ITTI_ALLOC_MSG
+    DESC = VCD variable ITTI_ALLOC_MSG
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_MP_ALLOC
+    DESC = VCD variable MP_ALLOC
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_MP_FREE
+    DESC = VCD variable MP_FREE
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE_INST_CNT_RX
+    DESC = VCD variable UE_INST_CNT_RX
+    GROUP = ALL:VCD:UE:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE_INST_CNT_TX
+    DESC = VCD variable UE_INST_CNT_TX
+    GROUP = ALL:VCD:UE:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_DCI_INFO
+    DESC = VCD variable DCI_INFO
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_BSR
+    DESC = VCD variable UE0_BSR
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_BO
+    DESC = VCD variable UE0_BO
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_SCHEDULED
+    DESC = VCD variable UE0_SCHEDULED
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_TIMING_ADVANCE
+    DESC = VCD variable UE0_TIMING_ADVANCE
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_SR_ENERGY
+    DESC = VCD variable UE0_SR_ENERGY
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_SR_THRES
+    DESC = VCD variable UE0_SR_THRES
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_RSSI0
+    DESC = VCD variable UE0_RSSI0
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_RSSI1
+    DESC = VCD variable UE0_RSSI1
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_RSSI2
+    DESC = VCD variable UE0_RSSI2
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_RSSI3
+    DESC = VCD variable UE0_RSSI3
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_RSSI4
+    DESC = VCD variable UE0_RSSI4
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_RSSI5
+    DESC = VCD variable UE0_RSSI5
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_RSSI6
+    DESC = VCD variable UE0_RSSI6
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_RSSI7
+    DESC = VCD variable UE0_RSSI7
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_RES0
+    DESC = VCD variable UE0_RES0
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_RES1
+    DESC = VCD variable UE0_RES1
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_RES2
+    DESC = VCD variable UE0_RES2
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_RES3
+    DESC = VCD variable UE0_RES3
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_RES4
+    DESC = VCD variable UE0_RES4
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_RES5
+    DESC = VCD variable UE0_RES5
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_RES6
+    DESC = VCD variable UE0_RES6
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_RES7
+    DESC = VCD variable UE0_RES7
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_MCS0
+    DESC = VCD variable UE0_MCS0
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_MCS1
+    DESC = VCD variable UE0_MCS1
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_MCS2
+    DESC = VCD variable UE0_MCS2
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_MCS3
+    DESC = VCD variable UE0_MCS3
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_MCS4
+    DESC = VCD variable UE0_MCS4
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_MCS5
+    DESC = VCD variable UE0_MCS5
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_MCS6
+    DESC = VCD variable UE0_MCS6
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_MCS7
+    DESC = VCD variable UE0_MCS7
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_RB0
+    DESC = VCD variable UE0_RB0
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_RB1
+    DESC = VCD variable UE0_RB1
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_RB2
+    DESC = VCD variable UE0_RB2
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_RB3
+    DESC = VCD variable UE0_RB3
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_RB4
+    DESC = VCD variable UE0_RB4
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_RB5
+    DESC = VCD variable UE0_RB5
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_RB6
+    DESC = VCD variable UE0_RB6
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_RB7
+    DESC = VCD variable UE0_RB7
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_ROUND0
+    DESC = VCD variable UE0_ROUND0
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_ROUND1
+    DESC = VCD variable UE0_ROUND1
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_ROUND2
+    DESC = VCD variable UE0_ROUND2
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_ROUND3
+    DESC = VCD variable UE0_ROUND3
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_ROUND4
+    DESC = VCD variable UE0_ROUND4
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_ROUND5
+    DESC = VCD variable UE0_ROUND5
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_ROUND6
+    DESC = VCD variable UE0_ROUND6
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_ROUND7
+    DESC = VCD variable UE0_ROUND7
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_SFN0
+    DESC = VCD variable UE0_SFN0
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_SFN1
+    DESC = VCD variable UE0_SFN1
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_SFN2
+    DESC = VCD variable UE0_SFN2
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_SFN3
+    DESC = VCD variable UE0_SFN3
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_SFN4
+    DESC = VCD variable UE0_SFN4
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_SFN5
+    DESC = VCD variable UE0_SFN5
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_SFN6
+    DESC = VCD variable UE0_SFN6
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+ID = VCD_VARIABLE_UE0_SFN7
+    DESC = VCD variable UE0_SFN7
+    GROUP = ALL:VCD:ENB:VCD_VARIABLE
+    FORMAT = ulong,value
+
+#functions
+
+ID = VCD_FUNCTION_RT_SLEEP
+    DESC = VCD function RT_SLEEP
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_TRX_READ
+    DESC = VCD function TRX_READ
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_TRX_WRITE
+    DESC = VCD function TRX_WRITE
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_eNB_PROC_TX0
+    DESC = VCD function eNB_PROC_TX0
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_eNB_PROC_RX0
+    DESC = VCD function eNB_PROC_RX0
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_eNB_PROC_TX1
+    DESC = VCD function eNB_PROC_TX1
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_eNB_PROC_RX1
+    DESC = VCD function eNB_PROC_RX1
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_eNB_PROC_TX2
+    DESC = VCD function eNB_PROC_TX2
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_eNB_PROC_RX2
+    DESC = VCD function eNB_PROC_RX2
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_eNB_PROC_TX3
+    DESC = VCD function eNB_PROC_TX3
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_eNB_PROC_RX3
+    DESC = VCD function eNB_PROC_RX3
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_eNB_PROC_TX4
+    DESC = VCD function eNB_PROC_TX4
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_eNB_PROC_RX4
+    DESC = VCD function eNB_PROC_RX4
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_eNB_PROC_TX5
+    DESC = VCD function eNB_PROC_TX5
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_eNB_PROC_RX5
+    DESC = VCD function eNB_PROC_RX5
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_eNB_PROC_TX6
+    DESC = VCD function eNB_PROC_TX6
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_eNB_PROC_RX6
+    DESC = VCD function eNB_PROC_RX6
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_eNB_PROC_TX7
+    DESC = VCD function eNB_PROC_TX7
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_eNB_PROC_RX7
+    DESC = VCD function eNB_PROC_RX7
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_eNB_PROC_TX8
+    DESC = VCD function eNB_PROC_TX8
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_eNB_PROC_RX8
+    DESC = VCD function eNB_PROC_RX8
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_eNB_PROC_TX9
+    DESC = VCD function eNB_PROC_TX9
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_eNB_PROC_RX9
+    DESC = VCD function eNB_PROC_RX9
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_UE_THREAD_TX
+    DESC = VCD function UE_THREAD_TX
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_UE_THREAD_RX
+    DESC = VCD function UE_THREAD_RX
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_eNB_TX
+    DESC = VCD function eNB_TX
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_eNB_RX
+    DESC = VCD function eNB_RX
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_eNB_TRX
+    DESC = VCD function eNB_TRX
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_eNB_TM
+    DESC = VCD function eNB_TM
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_eNB_RX_SLEEP
+    DESC = VCD function eNB_RX_SLEEP
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_eNB_TX_SLEEP
+    DESC = VCD function eNB_TX_SLEEP
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_eNB_PROC_SLEEP
+    DESC = VCD function eNB_PROC_SLEEP
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_TRX_READ_RF
+    DESC = VCD function TRX_READ_RF
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_TRX_WRITE_RF
+    DESC = VCD function TRX_WRITE_RF
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_UE_SYNCH
+    DESC = VCD function UE_SYNCH
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_UE_SLOT_FEP
+    DESC = VCD function UE_SLOT_FEP
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_UE_RRC_MEASUREMENTS
+    DESC = VCD function UE_RRC_MEASUREMENTS
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_UE_GAIN_CONTROL
+    DESC = VCD function UE_GAIN_CONTROL
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_UE_ADJUST_SYNCH
+    DESC = VCD function UE_ADJUST_SYNCH
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_UE_MEASUREMENT_PROCEDURES
+    DESC = VCD function UE_MEASUREMENT_PROCEDURES
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_UE_PDCCH_PROCEDURES
+    DESC = VCD function UE_PDCCH_PROCEDURES
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_UE_PBCH_PROCEDURES
+    DESC = VCD function UE_PBCH_PROCEDURES
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PHY_PROCEDURES_ENB_TX
+    DESC = VCD function PHY_PROCEDURES_ENB_TX
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PHY_PROCEDURES_ENB_RX
+    DESC = VCD function PHY_PROCEDURES_ENB_RX
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PHY_PROCEDURES_UE_TX
+    DESC = VCD function PHY_PROCEDURES_UE_TX
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PHY_PROCEDURES_UE_RX
+    DESC = VCD function PHY_PROCEDURES_UE_RX
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PHY_PROCEDURES_ENB_LTE
+    DESC = VCD function PHY_PROCEDURES_ENB_LTE
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PHY_PROCEDURES_UE_LTE
+    DESC = VCD function PHY_PROCEDURES_UE_LTE
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PDSCH_THREAD
+    DESC = VCD function PDSCH_THREAD
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_DLSCH_THREAD0
+    DESC = VCD function DLSCH_THREAD0
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_DLSCH_THREAD1
+    DESC = VCD function DLSCH_THREAD1
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_DLSCH_THREAD2
+    DESC = VCD function DLSCH_THREAD2
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_DLSCH_THREAD3
+    DESC = VCD function DLSCH_THREAD3
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_DLSCH_THREAD4
+    DESC = VCD function DLSCH_THREAD4
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_DLSCH_THREAD5
+    DESC = VCD function DLSCH_THREAD5
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_DLSCH_THREAD6
+    DESC = VCD function DLSCH_THREAD6
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_DLSCH_THREAD7
+    DESC = VCD function DLSCH_THREAD7
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_DLSCH_DECODING0
+    DESC = VCD function DLSCH_DECODING0
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_DLSCH_DECODING1
+    DESC = VCD function DLSCH_DECODING1
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_DLSCH_DECODING2
+    DESC = VCD function DLSCH_DECODING2
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_DLSCH_DECODING3
+    DESC = VCD function DLSCH_DECODING3
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_DLSCH_DECODING4
+    DESC = VCD function DLSCH_DECODING4
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_DLSCH_DECODING5
+    DESC = VCD function DLSCH_DECODING5
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_DLSCH_DECODING6
+    DESC = VCD function DLSCH_DECODING6
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_DLSCH_DECODING7
+    DESC = VCD function DLSCH_DECODING7
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_RX_PDCCH
+    DESC = VCD function RX_PDCCH
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_DCI_DECODING
+    DESC = VCD function DCI_DECODING
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_RX_PHICH
+    DESC = VCD function RX_PHICH
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PHY_UE_CONFIG_SIB2
+    DESC = VCD function PHY_UE_CONFIG_SIB2
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PHY_CONFIG_SIB1_ENB
+    DESC = VCD function PHY_CONFIG_SIB1_ENB
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PHY_CONFIG_SIB2_ENB
+    DESC = VCD function PHY_CONFIG_SIB2_ENB
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PHY_CONFIG_DEDICATED_ENB
+    DESC = VCD function PHY_CONFIG_DEDICATED_ENB
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PHY_UE_COMPUTE_PRACH
+    DESC = VCD function PHY_UE_COMPUTE_PRACH
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PHY_ENB_ULSCH_MSG3
+    DESC = VCD function PHY_ENB_ULSCH_MSG3
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PHY_ENB_ULSCH_DECODING0
+    DESC = VCD function PHY_ENB_ULSCH_DECODING0
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PHY_ENB_ULSCH_DECODING1
+    DESC = VCD function PHY_ENB_ULSCH_DECODING1
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PHY_ENB_ULSCH_DECODING2
+    DESC = VCD function PHY_ENB_ULSCH_DECODING2
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PHY_ENB_ULSCH_DECODING3
+    DESC = VCD function PHY_ENB_ULSCH_DECODING3
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PHY_ENB_ULSCH_DECODING4
+    DESC = VCD function PHY_ENB_ULSCH_DECODING4
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PHY_ENB_ULSCH_DECODING5
+    DESC = VCD function PHY_ENB_ULSCH_DECODING5
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PHY_ENB_ULSCH_DECODING6
+    DESC = VCD function PHY_ENB_ULSCH_DECODING6
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PHY_ENB_ULSCH_DECODING7
+    DESC = VCD function PHY_ENB_ULSCH_DECODING7
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PHY_ENB_SFGEN
+    DESC = VCD function PHY_ENB_SFGEN
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PHY_ENB_PRACH_RX
+    DESC = VCD function PHY_ENB_PRACH_RX
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PHY_ENB_PDCCH_TX
+    DESC = VCD function PHY_ENB_PDCCH_TX
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PHY_ENB_RS_TX
+    DESC = VCD function PHY_ENB_RS_TX
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_UE_GENERATE_PRACH
+    DESC = VCD function UE_GENERATE_PRACH
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_UE_ULSCH_MODULATION
+    DESC = VCD function UE_ULSCH_MODULATION
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_UE_ULSCH_ENCODING
+    DESC = VCD function UE_ULSCH_ENCODING
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_UE_ULSCH_SCRAMBLING
+    DESC = VCD function UE_ULSCH_SCRAMBLING
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_ENB_DLSCH_MODULATION
+    DESC = VCD function ENB_DLSCH_MODULATION
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_ENB_DLSCH_ENCODING
+    DESC = VCD function ENB_DLSCH_ENCODING
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_ENB_DLSCH_SCRAMBLING
+    DESC = VCD function ENB_DLSCH_SCRAMBLING
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_MACPHY_INIT
+    DESC = VCD function MACPHY_INIT
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_MACPHY_EXIT
+    DESC = VCD function MACPHY_EXIT
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_ENB_DLSCH_ULSCH_SCHEDULER
+    DESC = VCD function ENB_DLSCH_ULSCH_SCHEDULER
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_FILL_RAR
+    DESC = VCD function FILL_RAR
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_TERMINATE_RA_PROC
+    DESC = VCD function TERMINATE_RA_PROC
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_INITIATE_RA_PROC
+    DESC = VCD function INITIATE_RA_PROC
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_CANCEL_RA_PROC
+    DESC = VCD function CANCEL_RA_PROC
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_GET_DCI_SDU
+    DESC = VCD function GET_DCI_SDU
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_GET_DLSCH_SDU
+    DESC = VCD function GET_DLSCH_SDU
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_RX_SDU
+    DESC = VCD function RX_SDU
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_MRBCH_PHY_SYNC_FAILURE
+    DESC = VCD function MRBCH_PHY_SYNC_FAILURE
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_SR_INDICATION
+    DESC = VCD function SR_INDICATION
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_DLSCH_PREPROCESSOR
+    DESC = VCD function DLSCH_PREPROCESSOR
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_SCHEDULE_DLSCH
+    DESC = VCD function SCHEDULE_DLSCH
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_FILL_DLSCH_DCI
+    DESC = VCD function FILL_DLSCH_DCI
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_OUT_OF_SYNC_IND
+    DESC = VCD function OUT_OF_SYNC_IND
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_UE_DECODE_SI
+    DESC = VCD function UE_DECODE_SI
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_UE_DECODE_CCCH
+    DESC = VCD function UE_DECODE_CCCH
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_UE_DECODE_BCCH
+    DESC = VCD function UE_DECODE_BCCH
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_UE_SEND_SDU
+    DESC = VCD function UE_SEND_SDU
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_UE_GET_SDU
+    DESC = VCD function UE_GET_SDU
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_UE_GET_RACH
+    DESC = VCD function UE_GET_RACH
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_UE_PROCESS_RAR
+    DESC = VCD function UE_PROCESS_RAR
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_UE_SCHEDULER
+    DESC = VCD function UE_SCHEDULER
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_UE_GET_SR
+    DESC = VCD function UE_GET_SR
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_UE_SEND_MCH_SDU
+    DESC = VCD function UE_SEND_MCH_SDU
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_RLC_DATA_REQ
+    DESC = VCD function RLC_DATA_REQ
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_MAC_RLC_STATUS_IND
+    DESC = VCD function MAC_RLC_STATUS_IND
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_MAC_RLC_DATA_REQ
+    DESC = VCD function MAC_RLC_DATA_REQ
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_MAC_RLC_DATA_IND
+    DESC = VCD function MAC_RLC_DATA_IND
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_RLC_UM_TRY_REASSEMBLY
+    DESC = VCD function RLC_UM_TRY_REASSEMBLY
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_RLC_UM_CHECK_TIMER_DAR_TIME_OUT
+    DESC = VCD function RLC_UM_CHECK_TIMER_DAR_TIME_OUT
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_RLC_UM_RECEIVE_PROCESS_DAR
+    DESC = VCD function RLC_UM_RECEIVE_PROCESS_DAR
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PDCP_RUN
+    DESC = VCD function PDCP_RUN
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PDCP_DATA_REQ
+    DESC = VCD function PDCP_DATA_REQ
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PDCP_DATA_IND
+    DESC = VCD function PDCP_DATA_IND
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PDCP_APPLY_SECURITY
+    DESC = VCD function PDCP_APPLY_SECURITY
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_PDCP_VALIDATE_SECURITY
+    DESC = VCD function PDCP_VALIDATE_SECURITY
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_RRC_RX_TX
+    DESC = VCD function RRC_RX_TX
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_RRC_MAC_CONFIG
+    DESC = VCD function RRC_MAC_CONFIG
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_RRC_UE_DECODE_SIB1
+    DESC = VCD function RRC_UE_DECODE_SIB1
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_RRC_UE_DECODE_SI
+    DESC = VCD function RRC_UE_DECODE_SI
+    GROUP = ALL:VCD:UE:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_GTPV1U_ENB_TASK
+    DESC = VCD function GTPV1U_ENB_TASK
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_GTPV1U_PROCESS_UDP_REQ
+    DESC = VCD function GTPV1U_PROCESS_UDP_REQ
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_GTPV1U_PROCESS_TUNNEL_DATA_REQ
+    DESC = VCD function GTPV1U_PROCESS_TUNNEL_DATA_REQ
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_UDP_ENB_TASK
+    DESC = VCD function UDP_ENB_TASK
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_EMU_TRANSPORT
+    DESC = VCD function EMU_TRANSPORT
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_LOG_RECORD
+    DESC = VCD function LOG_RECORD
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_ITTI_ENQUEUE_MESSAGE
+    DESC = VCD function ITTI_ENQUEUE_MESSAGE
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_ITTI_DUMP_ENQUEUE_MESSAGE
+    DESC = VCD function ITTI_DUMP_ENQUEUE_MESSAGE
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_ITTI_DUMP_ENQUEUE_MESSAGE_MALLOC
+    DESC = VCD function ITTI_DUMP_ENQUEUE_MESSAGE_MALLOC
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_ITTI_RELAY_THREAD
+    DESC = VCD function ITTI_RELAY_THREAD
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
+ID = VCD_FUNCTION_TEST
+    DESC = VCD function TEST
+    GROUP = ALL:VCD:ENB:VCD_FUNCTION
+    FORMAT = int,value
diff --git a/common/utils/T/defs.h b/common/utils/T/defs.h
new file mode 100644
index 0000000000000000000000000000000000000000..69b379ce0b3c3963475622ec3ed6d66b472ed97b
--- /dev/null
+++ b/common/utils/T/defs.h
@@ -0,0 +1,30 @@
+#ifndef _TRACER_DEFS_H_
+#define _TRACER_DEFS_H_
+
+/* types of plots */
+#define PLOT_VS_TIME   0
+#define PLOT_IQ_POINTS 1
+#define PLOT_MINMAX    2
+
+void new_thread(void *(*f)(void *), void *data);
+
+/* ... is { int count; int type; char *color; } for 'nplots' plots */
+void *make_plot(int width, int height, char *title, int nplots, ...);
+void plot_set(void *plot, float *data, int len, int pos, int pp);
+void iq_plot_set(void *plot, short *data, int len, int pos, int pp);
+void iq_plot_set_sized(void *_plot, short *data, int len, int pp);
+void iq_plot_add_iq_point_loop(void *_plot, short i, short q, int pp);
+void iq_plot_add_energy_point_loop(void *_plot, int e, int pp);
+
+/* returns an opaque pointer - truly a 'database *', see t_data.c */
+void *parse_database(char *filename);
+void dump_database(void *database);
+void list_ids(void *database);
+void list_groups(void *database);
+void on_off(void *d, char *item, int *a, int onoff);
+
+void *forwarder(char *ip, int port);
+void forward(void *forwarder, char *buf, int size);
+void forward_start_client(void *forwarder, int socket);
+
+#endif /* _TRACER_DEFS_H_ */
diff --git a/common/utils/T/generate_Txx.c b/common/utils/T/generate_Txx.c
new file mode 100644
index 0000000000000000000000000000000000000000..a32b554a718fd27fc56cbc8249ffd5094af44cb5
--- /dev/null
+++ b/common/utils/T/generate_Txx.c
@@ -0,0 +1,25 @@
+#include <stdio.h>
+
+void print(int n)
+{
+  int i;
+  printf("#define T%d(t", n);
+  for(i=0; i<(n-1)/2; i++) printf(",t%d,x%d", i, i);
+  printf(") \\\n");
+  printf("  do { \\\n");
+  printf("    if (T_ACTIVE(t)) { \\\n");
+  printf("      T_LOCAL_DATA \\\n");
+  printf("      T_HEADER(t); \\\n");
+  for(i=0; i<(n-1)/2; i++) printf("      T_PUT_##t%d(%d, x%d); \\\n", i, i+2, i);
+  printf("      T_COMMIT(); \\\n");
+  printf("    } \\\n");
+  printf("  } while (0)\n");
+  printf("\n");
+}
+
+int main(void)
+{
+  int i;
+  for (i = 11; i <= 33; i+=2) print(i);
+  return 0;
+}
diff --git a/common/utils/T/genids.c b/common/utils/T/genids.c
new file mode 100644
index 0000000000000000000000000000000000000000..734c506368ac348ba9db9ae2eae8048fcec929d6
--- /dev/null
+++ b/common/utils/T/genids.c
@@ -0,0 +1,155 @@
+#include <stdio.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+char **unique_ids;
+int unique_ids_size;
+int unique_ids_maxsize;
+
+int cmp(const void *p1, const void *p2)
+{
+  return strcmp(*(char * const *)p1, *(char * const *)p2);
+}
+
+/* return 1 if s was not already known, 0 if it was */
+int new_unique_id(char *s)
+{
+  if (unique_ids_size)
+  if (bsearch(&s, unique_ids, unique_ids_size, sizeof(char *), cmp) != NULL) {
+    printf("FATAL: ID %s is not unique\n", s);
+    return 0;
+  }
+  if (unique_ids_size == unique_ids_maxsize) {
+    unique_ids_maxsize += 256;
+    unique_ids = realloc(unique_ids, unique_ids_maxsize * sizeof(char *));
+    if (unique_ids == NULL) { printf("out of memory\n"); abort(); }
+  }
+  unique_ids[unique_ids_size] = strdup(s);
+  if (unique_ids[unique_ids_size] == NULL)
+    { printf("out of memory\n"); abort(); }
+  unique_ids_size++;
+  qsort(unique_ids, unique_ids_size, sizeof(char *), cmp);
+  return 1;
+}
+
+char *bufname;
+int bufname_size;
+int bufname_maxsize;
+
+void putname(int c)
+{
+  if (bufname_size == bufname_maxsize) {
+    bufname_maxsize += 256;
+    bufname = realloc(bufname, bufname_maxsize);
+    if (bufname == NULL) { printf("memory allocation error\n"); exit(1); }
+  }
+  bufname[bufname_size] = c;
+  bufname_size++;
+}
+
+char *bufvalue;
+int bufvalue_size;
+int bufvalue_maxsize;
+
+void putvalue(int c)
+{
+  if (bufvalue_size == bufvalue_maxsize) {
+    bufvalue_maxsize += 256;
+    bufvalue = realloc(bufvalue, bufvalue_maxsize);
+    if (bufvalue == NULL) { printf("memory allocation error\n"); exit(1); }
+  }
+  bufvalue[bufvalue_size] = c;
+  bufvalue_size++;
+}
+
+void smash_spaces(FILE *f)
+{
+  int c;
+  while (1) {
+    c = fgetc(f);
+    if (isspace(c)) continue;
+    if (c == ' ') continue;
+    if (c == '\t') continue;
+    if (c == '\n') continue;
+    if (c == 10 || c == 13) continue;
+    if (c == '#') {
+      while (1) {
+        c = fgetc(f);
+        if (c == '\n' || c == EOF) break;
+      }
+      continue;
+    }
+    break;
+  }
+  if (c != EOF) ungetc(c, f);
+}
+
+void get_line(FILE *f, char **name, char **value)
+{
+  int c;
+  bufname_size = 0;
+  bufvalue_size = 0;
+  *name = NULL;
+  *value = NULL;
+  smash_spaces(f);
+  c = fgetc(f);
+  while (!(c == '=' || isspace(c) || c == EOF)) { putname(c); c = fgetc(f); }
+  if (c == EOF) return;
+  putname(0);
+  while (!(c == EOF || c == '=')) c = fgetc(f);
+  if (c == EOF) return;
+  smash_spaces(f);
+  c = fgetc(f);
+  while (!(c == 10 || c == 13 || c == EOF)) { putvalue(c); c = fgetc(f); }
+  putvalue(0);
+  if (bufname_size <= 1) return;
+  if (bufvalue_size <= 1) return;
+  *name = bufname;
+  *value = bufvalue;
+}
+
+int main(int n, char **v)
+{
+  FILE *in;
+  FILE *out;
+  char *name;
+  char *value;
+  char *in_name;
+  char *out_name;
+
+  if (n != 3) { printf("gimme <source> <dest>\n"); exit(1); }
+
+  n = 0;
+
+  in_name = v[1];
+  out_name = v[2];
+
+  in = fopen(in_name, "r"); if (in == NULL) { perror(in_name); exit(1); }
+  out = fopen(out_name, "w"); if (out == NULL) { perror(out_name); exit(1); }
+
+  fprintf(out, "/* generated file, do not edit by hand */\n\n");
+
+  while (1) {
+    get_line(in, &name, &value);
+    if (name == NULL) break;
+    printf("name '%s' value '%s'\n", name, value);
+    if (isspace(value[strlen(value)-1])) {
+      printf("bad value '%s' (no space at the end please!)\n", value);
+      unlink(out_name);
+      exit(1);
+    }
+    if (!strcmp(name, "ID")) {
+      if (!new_unique_id(value)) { unlink(out_name); exit(1); }
+      fprintf(out, "#define T_%s T_ID(%d)\n", value, n);
+      n++;
+    }
+  }
+  fprintf(out, "#define T_NUMBER_OF_IDS %d\n", n);
+
+  fclose(in);
+  fclose(out);
+
+  return 0;
+}
diff --git a/common/utils/T/local_tracer.c b/common/utils/T/local_tracer.c
new file mode 100644
index 0000000000000000000000000000000000000000..68a937a6b56e80fe90d8a3ea27fc8cf3123af145
--- /dev/null
+++ b/common/utils/T/local_tracer.c
@@ -0,0 +1,380 @@
+#include <stdio.h>
+#include <string.h>
+#include <netinet/ip.h>
+#include <arpa/inet.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <inttypes.h>
+#include <signal.h>
+
+#include "T.h"
+#include "T_messages.txt.h"
+#include "T_defs.h"
+#include "T_IDs.h"
+
+static T_cache_t *T_local_cache;
+static int T_busylist_head;
+
+typedef struct databuf {
+  char *d;
+  int l;
+  struct databuf *next;
+} databuf;
+
+typedef struct {
+  int socket_local;
+  volatile int socket_remote;
+  int remote_port;
+  pthread_mutex_t lock;
+  pthread_cond_t cond;
+  databuf * volatile head, *tail;
+  uint64_t memusage;
+  uint64_t last_warning_memusage;
+} forward_data;
+
+/****************************************************************************/
+/*                      utility functions                                   */
+/****************************************************************************/
+
+static void new_thread(void *(*f)(void *), void *data)
+{
+  pthread_t t;
+  pthread_attr_t att;
+
+  if (pthread_attr_init(&att))
+    { fprintf(stderr, "pthread_attr_init err\n"); exit(1); }
+  if (pthread_attr_setdetachstate(&att, PTHREAD_CREATE_DETACHED))
+    { fprintf(stderr, "pthread_attr_setdetachstate err\n"); exit(1); }
+  if (pthread_attr_setstacksize(&att, 10000000))
+    { fprintf(stderr, "pthread_attr_setstacksize err\n"); exit(1); }
+  if (pthread_create(&t, &att, f, data))
+    { fprintf(stderr, "pthread_create err\n"); exit(1); }
+  if (pthread_attr_destroy(&att))
+    { fprintf(stderr, "pthread_attr_destroy err\n"); exit(1); }
+}
+
+static int get_connection(char *addr, int port)
+{
+  struct sockaddr_in a;
+  socklen_t alen;
+  int s, t;
+
+  printf("waiting for connection on %s:%d\n", addr, port);
+
+  s = socket(AF_INET, SOCK_STREAM, 0);
+  if (s == -1) { perror("socket"); exit(1); }
+  t = 1;
+  if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &t, sizeof(int)))
+    { perror("setsockopt"); exit(1); }
+
+  a.sin_family = AF_INET;
+  a.sin_port = htons(port);
+  a.sin_addr.s_addr = inet_addr(addr);
+
+  if (bind(s, (struct sockaddr *)&a, sizeof(a))) { perror("bind"); exit(1); }
+  if (listen(s, 5)) { perror("bind"); exit(1); }
+  alen = sizeof(a);
+  t = accept(s, (struct sockaddr *)&a, &alen);
+  if (t == -1) { perror("accept"); exit(1); }
+  close(s);
+
+  printf("connected\n");
+
+  return t;
+}
+
+static void forward(void *_forwarder, char *buf, int size);
+
+void send_T_messages_txt(void *forwarder)
+{
+  char buf[T_BUFFER_MAX];
+  char *T_LOCAL_buf = buf;
+  int T_LOCAL_size;
+  unsigned char *src;
+  int src_len;
+
+  /* trace T_message.txt
+   * Send several messages -1 with content followed by message -2.
+   */
+  src = T_messages_txt;
+  src_len = T_messages_txt_len;
+  while (src_len) {
+    int send_size = src_len;
+    if (send_size > T_PAYLOAD_MAXSIZE - sizeof(int))
+      send_size = T_PAYLOAD_MAXSIZE - sizeof(int);
+    /* TODO: be careful, we use internal T stuff, to rewrite? */
+    T_LOCAL_size = 0;
+    T_HEADER(T_ID(-1));
+    T_PUT_buffer(1, ((T_buffer){addr:(src), length:(send_size)}));
+    forward(forwarder, buf, T_LOCAL_size);
+    src += send_size;
+    src_len -= send_size;
+  }
+  T_LOCAL_size = 0;
+  T_HEADER(T_ID(-2));
+  forward(forwarder, buf, T_LOCAL_size);
+}
+
+/****************************************************************************/
+/*                      forward functions                                   */
+/****************************************************************************/
+
+static void *data_sender(void *_f)
+{
+  forward_data *f = _f;
+  databuf *cur;
+  char *buf, *b;
+  int size;
+
+wait:
+  if (pthread_mutex_lock(&f->lock)) abort();
+  while (f->head == NULL)
+    if (pthread_cond_wait(&f->cond, &f->lock)) abort();
+  cur = f->head;
+  buf = cur->d;
+  size = cur->l;
+  f->head = cur->next;
+  f->memusage -= size;
+  if (f->head == NULL) f->tail = NULL;
+  if (pthread_mutex_unlock(&f->lock)) abort();
+  free(cur);
+  goto process;
+
+process:
+  b = buf;
+  if (f->socket_remote != -1)
+  while (size) {
+    int l = write(f->socket_remote, b, size);
+    if (l <= 0) {
+      printf("forward error\n");
+      close(f->socket_remote);
+      f->socket_remote = -1;
+      break;
+    }
+    size -= l;
+    b += l;
+  }
+
+  free(buf);
+
+  goto wait;
+}
+
+static void *forward_remote_messages(void *_f)
+{
+#define PUT(x) do { \
+    if (bufsize == bufmaxsize) { \
+      bufmaxsize += 4096; \
+      buf = realloc(buf, bufmaxsize); \
+      if (buf == NULL) abort(); \
+    } \
+    buf[bufsize] = x; \
+    bufsize++; \
+  } while (0)
+#define PUT_BUF(x, l) do { \
+    char *zz = (char *)(x); \
+    int len = l; \
+    while (len) { PUT(*zz); zz++; len--; } \
+  } while (0)
+
+  forward_data *f = _f;
+  int from;
+  int to;
+  int l, len;
+  char *b;
+  char *buf = NULL;
+  int bufsize = 0;
+  int bufmaxsize = 0;
+  char t;
+
+again:
+
+  while (1) {
+    from = f->socket_remote;
+    to = f->socket_local;
+
+    bufsize = 0;
+
+    /* let's read and process messages */
+    len = read(from, &t, 1); if (len <= 0) goto dead;
+    PUT(t);
+
+    switch (t) {
+    case 0:
+    case 1:
+      /* message 0 and 1: get a length and then 'length' numbers */
+      if (read(from, &len, sizeof(int)) != sizeof(int)) goto dead;
+      PUT_BUF(&len, 4);
+      while (len) {
+        if (read(from, &l, sizeof(int)) != sizeof(int)) goto dead;
+        PUT_BUF(&l, 4);
+        len--;
+      }
+      break;
+
+    case 2: break;
+    default:
+      printf("%s:%d:%s: unhandled message type %d\n",
+          __FILE__, __LINE__, __FUNCTION__, t);
+      abort();
+    }
+
+    b = buf;
+    while (bufsize) {
+      l = write(to, b, bufsize);
+      if (l <= 0) abort();
+      bufsize -= l;
+      b += l;
+    }
+  }
+
+dead:
+  /* socket died, let's stop all traces and wait for another tracer */
+  /* TODO: be careful with those write, they might write less than wanted */
+  buf[0] = 1;
+  if (write(to, buf, 1) != 1) abort();
+  len = T_NUMBER_OF_IDS;
+  if (write(to, &len, sizeof(int)) != sizeof(int)) abort();
+  l = 0;
+  while (len) {
+    if (write(to, &l, sizeof(int)) != sizeof(int)) abort();
+    len--;
+  };
+
+  close(f->socket_remote);
+  f->socket_remote = get_connection("0.0.0.0", f->remote_port);
+  send_T_messages_txt(f);
+  goto again;
+
+  return NULL;
+}
+
+static void *forwarder(int port, int s)
+{
+  forward_data *f;
+
+  f = malloc(sizeof(*f)); if (f == NULL) abort();
+
+  pthread_mutex_init(&f->lock, NULL);
+  pthread_cond_init(&f->cond, NULL);
+
+  f->socket_local = s;
+  f->head = f->tail = NULL;
+
+  f->memusage = 0;
+  f->last_warning_memusage = 0;
+
+  printf("waiting for remote tracer on port %d\n", port);
+
+  f->remote_port = port;
+  f->socket_remote = get_connection("0.0.0.0", port);
+  send_T_messages_txt(f);
+
+  new_thread(data_sender, f);
+  new_thread(forward_remote_messages, f);
+
+  return f;
+}
+
+static void forward(void *_forwarder, char *buf, int size)
+{
+  forward_data *f = _forwarder;
+  int32_t ssize = size;
+  databuf *new;
+
+  new = malloc(sizeof(*new)); if (new == NULL) abort();
+
+  if (pthread_mutex_lock(&f->lock)) abort();
+
+  new->d = malloc(size + 4); if (new->d == NULL) abort();
+  /* put the size of the message at the head */
+  memcpy(new->d, &ssize, 4);
+  memcpy(new->d+4, buf, size);
+  new->l = size+4;
+  new->next = NULL;
+  if (f->head == NULL) f->head = new;
+  if (f->tail != NULL) f->tail->next = new;
+  f->tail = new;
+
+  f->memusage += size+4;
+  /* warn every 100MB */
+  if (f->memusage > f->last_warning_memusage &&
+      f->memusage - f->last_warning_memusage > 100000000) {
+    f->last_warning_memusage += 100000000;
+    printf("WARNING: memory usage is over %"PRIu64"MB\n",
+           f->last_warning_memusage / 1000000);
+  } else
+  if (f->memusage < f->last_warning_memusage &&
+      f->last_warning_memusage - f->memusage > 100000000) {
+    f->last_warning_memusage = (f->memusage/100000000) * 100000000;
+  }
+
+  if (pthread_cond_signal(&f->cond)) abort();
+  if (pthread_mutex_unlock(&f->lock)) abort();
+}
+
+/****************************************************************************/
+/*                      local functions                                     */
+/****************************************************************************/
+
+static void wait_message(void)
+{
+  while (T_local_cache[T_busylist_head].busy == 0) usleep(1000);
+}
+
+static void init_shm(void)
+{
+  int i;
+  int s = shm_open(T_SHM_FILENAME, O_RDWR | O_CREAT /*| O_SYNC*/, 0666);
+  if (s == -1) { perror(T_SHM_FILENAME); abort(); }
+  if (ftruncate(s, T_CACHE_SIZE * sizeof(T_cache_t)))
+    { perror(T_SHM_FILENAME); abort(); }
+  T_local_cache = mmap(NULL, T_CACHE_SIZE * sizeof(T_cache_t),
+                       PROT_READ | PROT_WRITE, MAP_SHARED, s, 0);
+  if (T_local_cache == NULL)
+    { perror(T_SHM_FILENAME); abort(); }
+  close(s);
+
+  /* let's garbage the memory to catch some potential problems
+   * (think multiprocessor sync issues, barriers, etc.)
+   */
+  memset(T_local_cache, 0x55, T_CACHE_SIZE * sizeof(T_cache_t));
+  for (i = 0; i < T_CACHE_SIZE; i++) T_local_cache[i].busy = 0;
+}
+
+void T_local_tracer_main(int remote_port, int wait_for_tracer,
+    int local_socket)
+{
+  int s;
+  int port = remote_port;
+  int dont_wait = wait_for_tracer ? 0 : 1;
+  void *f;
+
+  /* write on a socket fails if the other end is closed and we get SIGPIPE */
+  if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) abort();
+
+  init_shm();
+  s = local_socket;
+
+  if (dont_wait) {
+    char t = 2;
+    if (write(s, &t, 1) != 1) abort();
+  }
+
+  f = forwarder(port, s);
+
+  /* read messages */
+  while (1) {
+    wait_message();
+    __sync_synchronize();
+    forward(f, T_local_cache[T_busylist_head].buffer,
+            T_local_cache[T_busylist_head].length);
+    T_local_cache[T_busylist_head].busy = 0;
+    T_busylist_head++;
+    T_busylist_head &= T_CACHE_SIZE - 1;
+  }
+}
diff --git a/common/utils/T/plot.c b/common/utils/T/plot.c
new file mode 100644
index 0000000000000000000000000000000000000000..74473842883c7e968ecf3c84079c4645e18f2467
--- /dev/null
+++ b/common/utils/T/plot.c
@@ -0,0 +1,291 @@
+#include "defs.h"
+#include <X11/Xlib.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <pthread.h>
+#include <math.h>
+#include <unistd.h>
+#include <sys/select.h>
+#include <stdarg.h>
+
+typedef struct {
+  float *buf;
+  short *iqbuf;
+  int count;
+  int type;
+  volatile int iq_count;  /* for ULSCH IQ data */
+  int iq_insert_pos;
+  GC g;
+} data;
+
+typedef struct {
+  Display *d;
+  Window w;
+  Pixmap px;
+  GC bg;
+  int width;
+  int height;
+  pthread_mutex_t lock;
+  float zoom;
+  int timer_pipe[2];
+  data *p;             /* list of plots */
+  int nplots;
+} plot;
+
+static void *timer_thread(void *_p)
+{
+  plot *p = _p;
+  char c;
+
+  while (1) {
+    /* more or less 10Hz */
+    usleep(100*1000);
+    c = 1;
+    if (write(p->timer_pipe[1], &c, 1) != 1) abort();
+  }
+
+  return NULL;
+}
+
+static void *plot_thread(void *_p)
+{
+  float v;
+  float *s;
+  int i, j;
+  plot *p = _p;
+  int redraw = 0;
+  int replot = 0;
+  fd_set rset;
+  int xfd = ConnectionNumber(p->d);
+  int maxfd = xfd > p->timer_pipe[0] ? xfd : p->timer_pipe[0];
+  int pp;
+
+  while (1) {
+    while (XPending(p->d)) {
+      XEvent e;
+      XNextEvent(p->d, &e);
+      switch (e.type) {
+      case ButtonPress:
+        /* button 4: zoom out */
+        if (e.xbutton.button == 4) { p->zoom = p->zoom * 1.25; replot = 1; }
+        /* button 5: zoom in */
+        if (e.xbutton.button == 5) { p->zoom = p->zoom * 0.8; replot = 1; }
+        printf("zoom: %f\n", p->zoom);
+        break;
+      case Expose: redraw = 1; break;
+      }
+    }
+
+    if (replot == 1) {
+      replot = 0;
+      redraw = 1;
+
+      if (pthread_mutex_lock(&p->lock)) abort();
+
+      XFillRectangle(p->d, p->px, p->bg, 0, 0, p->width, p->height);
+
+      for (pp = 0; pp < p->nplots; pp++) {
+        if (p->p[pp].type == PLOT_MINMAX) {
+          s = p->p[pp].buf;
+          for (i = 0; i < 512; i++) {
+            int min = *s;
+            int max = *s;
+            for (j = 0; j < p->p[pp].count/512; j++, s++) {
+              if (*s < min) min = *s;
+              if (*s > max) max = *s;
+            }
+            XDrawLine(p->d, p->px, p->p[pp].g, i, 100-min, i, 100-max);
+          }
+        } else if (p->p[pp].type == PLOT_VS_TIME) {
+          for (i = 0; i < p->p[pp].count; i++)
+            p->p[pp].buf[i] =
+                10*log10(1.0+(float)(p->p[pp].iqbuf[2*i]*p->p[pp].iqbuf[2*i]+
+                p->p[pp].iqbuf[2*i+1]*p->p[pp].iqbuf[2*i+1]));
+          s = p->p[pp].buf;
+          for (i = 0; i < 512; i++) {
+            v = 0;
+            for (j = 0; j < p->p[pp].count/512; j++, s++) v += *s;
+            v /= p->p[pp].count/512;
+            XDrawLine(p->d, p->px, p->p[pp].g, i, 100, i, 100-v);
+          }
+        } else if (p->p[pp].type == PLOT_IQ_POINTS) {
+          XPoint pts[p->p[pp].iq_count];
+          int count = p->p[pp].iq_count;
+          for (i = 0; i < count; i++) {
+            pts[i].x = p->p[pp].iqbuf[2*i]*p->zoom/20+50;
+            pts[i].y = -p->p[pp].iqbuf[2*i+1]*p->zoom/20+50;
+          }
+          XDrawPoints(p->d, p->px, p->p[pp].g, pts, count, CoordModeOrigin);
+        }
+      }
+
+      if (pthread_mutex_unlock(&p->lock)) abort();
+    }
+
+    if (redraw) {
+      redraw = 0;
+      XCopyArea(p->d, p->px, p->w, DefaultGC(p->d, DefaultScreen(p->d)),
+                0, 0, p->width, p->height, 0, 0);
+    }
+
+    XFlush(p->d);
+
+    FD_ZERO(&rset);
+    FD_SET(p->timer_pipe[0], &rset);
+    FD_SET(xfd, &rset);
+    if (select(maxfd+1, &rset, NULL, NULL, NULL) == -1) abort();
+    if (FD_ISSET(p->timer_pipe[0], &rset)) {
+      char b[512];
+      if (read(p->timer_pipe[0], b, 512) <= 0) abort();
+      replot = 1;
+    }
+  }
+
+  return NULL;
+}
+
+void *make_plot(int width, int height, char *title, int nplots, ...)
+{
+  plot *p;
+  Display *d;
+  Window w;
+  Pixmap pm;
+  int i;
+  va_list ap;
+  XGCValues gcv;
+
+  p = malloc(sizeof(*p)); if (p == NULL) abort();
+
+  d = XOpenDisplay(0); if (d == NULL) abort();
+  w = XCreateSimpleWindow(d, DefaultRootWindow(d), 0, 0, width, height,
+        0, WhitePixel(d, DefaultScreen(d)), WhitePixel(d, DefaultScreen(d)));
+  XSelectInput(d, w, ExposureMask | ButtonPressMask);
+  XMapWindow(d, w);
+
+  {
+    XSetWindowAttributes att;
+    att.backing_store = Always;
+    XChangeWindowAttributes(d, w, CWBackingStore, &att);
+  }
+
+  XStoreName(d, w, title);
+
+  p->bg = XCreateGC(d, w, 0, NULL);
+  XCopyGC(d, DefaultGC(d, DefaultScreen(d)), -1L, p->bg);
+  gcv.foreground = WhitePixel(d, DefaultScreen(d));
+  XChangeGC(d, p->bg, GCForeground, &gcv);
+
+  pm = XCreatePixmap(d, w, width, height, DefaultDepth(d, DefaultScreen(d)));
+
+  p->width = width;
+  p->height = height;
+  p->p = malloc(nplots * sizeof(data)); if (p->p == NULL) abort();
+
+  va_start(ap, nplots);
+  for (i = 0; i < nplots; i++) {
+    int count;
+    int type;
+    char *color;
+    XColor rcol, scol;
+
+    count = va_arg(ap, int);
+    type = va_arg(ap, int);
+    color = va_arg(ap, char *);
+
+    p->p[i].g = XCreateGC(d, w, 0, NULL);
+    XCopyGC(d, DefaultGC(d, DefaultScreen(d)), -1L, p->p[i].g);
+    if (XAllocNamedColor(d, DefaultColormap(d, DefaultScreen(d)),
+                         color, &scol, &rcol)) {
+      gcv.foreground = scol.pixel;
+      XChangeGC(d, p->p[i].g, GCForeground, &gcv);
+    } else {
+      printf("could not allocate color '%s'\n", color);
+      abort();
+    }
+
+    if (type == PLOT_VS_TIME) {
+      p->p[i].buf = malloc(sizeof(float) * count);
+      if (p->p[i].buf == NULL) abort();
+      p->p[i].iqbuf = malloc(sizeof(short) * count * 2);
+      if(p->p[i].iqbuf==NULL)abort();
+    } else if (type == PLOT_MINMAX) {
+      p->p[i].buf = malloc(sizeof(float) * count);
+      if (p->p[i].buf == NULL) abort();
+      p->p[i].iqbuf = NULL;
+    } else {
+      p->p[i].buf = NULL;
+      p->p[i].iqbuf = malloc(sizeof(short) * count * 2);
+      if(p->p[i].iqbuf==NULL)abort();
+    }
+    p->p[i].count = count;
+    p->p[i].type = type;
+    p->p[i].iq_count = 0;
+    p->p[i].iq_insert_pos = 0;
+  }
+  va_end(ap);
+
+  p->d = d;
+  p->w = w;
+  p->px = pm;
+
+  p->zoom = 1;
+  p->nplots = nplots;
+
+  pthread_mutex_init(&p->lock, NULL);
+
+  if (pipe(p->timer_pipe)) abort();
+
+  new_thread(plot_thread, p);
+  new_thread(timer_thread, p);
+
+  return p;
+}
+
+void plot_set(void *_plot, float *data, int len, int pos, int pp)
+{
+  plot *p = _plot;
+  if (pthread_mutex_lock(&p->lock)) abort();
+  memcpy(p->p[pp].buf + pos, data, len * sizeof(float));
+  if (pthread_mutex_unlock(&p->lock)) abort();
+}
+
+void iq_plot_set(void *_plot, short *data, int count, int pos, int pp)
+{
+  plot *p = _plot;
+  if (pthread_mutex_lock(&p->lock)) abort();
+  memcpy(p->p[pp].iqbuf + pos * 2, data, count * 2 * sizeof(short));
+  if (pthread_mutex_unlock(&p->lock)) abort();
+}
+
+void iq_plot_set_sized(void *_plot, short *data, int count, int pp)
+{
+  plot *p = _plot;
+  if (pthread_mutex_lock(&p->lock)) abort();
+  memcpy(p->p[pp].iqbuf, data, count * 2 * sizeof(short));
+  p->p[pp].iq_count = count;
+  if (pthread_mutex_unlock(&p->lock)) abort();
+}
+
+void iq_plot_add_iq_point_loop(void *_plot, short i, short q, int pp)
+{
+  plot *p = _plot;
+  if (pthread_mutex_lock(&p->lock)) abort();
+  p->p[pp].iqbuf[p->p[pp].iq_insert_pos*2] = i;
+  p->p[pp].iqbuf[p->p[pp].iq_insert_pos*2+1] = q;
+  if (p->p[pp].iq_count != p->p[pp].count) p->p[pp].iq_count++;
+  p->p[pp].iq_insert_pos++;
+  if (p->p[pp].iq_insert_pos == p->p[pp].count) p->p[pp].iq_insert_pos = 0;
+  if (pthread_mutex_unlock(&p->lock)) abort();
+}
+
+void iq_plot_add_energy_point_loop(void *_plot, int e, int pp)
+{
+  plot *p = _plot;
+  if (pthread_mutex_lock(&p->lock)) abort();
+  p->p[pp].buf[p->p[pp].iq_insert_pos] = e;
+  if (p->p[pp].iq_count != p->p[pp].count) p->p[pp].iq_count++;
+  p->p[pp].iq_insert_pos++;
+  if (p->p[pp].iq_insert_pos == p->p[pp].count) p->p[pp].iq_insert_pos = 0;
+  if (pthread_mutex_unlock(&p->lock)) abort();
+}
diff --git a/common/utils/T/tracee/Makefile b/common/utils/T/tracee/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..10ea3bdca3c80b8256c9b0601c0ed7f5439e5e6d
--- /dev/null
+++ b/common/utils/T/tracee/Makefile
@@ -0,0 +1,14 @@
+CC=gcc
+CFLAGS=-Wall -g -pthread -DT_TRACER -I.
+
+PROG=tracee
+OBJS=tracee.o ../T.o ../local_tracer.o
+
+$(PROG): $(OBJS)
+	$(CC) $(CFLAGS) -o $(PROG) $(OBJS) -lrt
+
+tracee.o: tracee.c
+	$(CC) $(CFLAGS) -c -o $@ $<
+
+clean:
+	rm -f *.o $(PROG) core
diff --git a/common/utils/T/tracee/README b/common/utils/T/tracee/README
new file mode 100644
index 0000000000000000000000000000000000000000..f18dda85ac3ad3ad2e129acc7f986893655d93dd
--- /dev/null
+++ b/common/utils/T/tracee/README
@@ -0,0 +1 @@
+this is a very basic tracee, used to debug the tracer
diff --git a/common/utils/T/tracee/tracee.c b/common/utils/T/tracee/tracee.c
new file mode 100644
index 0000000000000000000000000000000000000000..5f820ee42eecf5eb60fdb9669bf66cfa867db5df
--- /dev/null
+++ b/common/utils/T/tracee/tracee.c
@@ -0,0 +1,16 @@
+#include "../T.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int main(void)
+{
+  int frame = 0;
+  T_init(2021, 1, 0);
+  while (1) {
+    getchar();
+    T(T_ENB_PHY_PUCCH_1AB_IQ, T_INT(0), T_INT(0), T_INT(frame), T_INT(0), T_INT(0), T_INT(0));
+    frame++;
+  }
+  return 0;
+}
diff --git a/common/utils/T/tracer/Makefile b/common/utils/T/tracer/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..71f1d25f9251b375dd5f57d88b59d78f979b3b11
--- /dev/null
+++ b/common/utils/T/tracer/Makefile
@@ -0,0 +1,62 @@
+CC=gcc
+CFLAGS=-Wall -g -pthread -DT_TRACER -I.
+
+#CFLAGS += -O3 -ffast-math -fomit-frame-pointer
+
+LIBS=-lX11 -lm -lpng -lXft
+
+all: record replay extract_config textlog enb vcd macpdu2wireshark
+
+record: utils.o record.o database.o config.o
+	$(CC) $(CFLAGS) -o record $^ $(LIBS)
+
+replay: utils.o replay.o
+	$(CC) $(CFLAGS) -o replay $^ $(LIBS)
+
+extract_config: extract_config.o
+	$(CC) $(CFLAGS) -o extract_config $^ $(LIBS)
+
+textlog: utils.o textlog.o database.o event.o handler.o config.o \
+         event_selector.o view/view.a gui/gui.a logger/logger.a \
+         filter/filter.a
+	$(CC) $(CFLAGS) -o textlog $^ $(LIBS)
+
+enb: utils.o enb.o database.o event.o handler.o config.o \
+         event_selector.o view/view.a gui/gui.a logger/logger.a \
+         filter/filter.a
+	$(CC) $(CFLAGS) -o enb $^ $(LIBS)
+
+vcd: utils.o vcd.o database.o event.o handler.o config.o \
+         event_selector.o view/view.a gui/gui.a logger/logger.a \
+         filter/filter.a
+	$(CC) $(CFLAGS) -o vcd $^ $(LIBS)
+
+macpdu2wireshark: macpdu2wireshark.o database.o utils.o handler.o event.o \
+                  config.o
+	$(CC) $(CFLAGS) -o $@ $^ $(LIBS)
+
+.PHONY: all gui/gui.a view/view.a logger/logger.a filter/filter.a
+
+gui/gui.a:
+	cd gui && make
+
+view/view.a:
+	cd view && make
+
+logger/logger.a:
+	cd logger && make
+
+filter/filter.a:
+	cd filter && make
+
+%.o: %.c
+	$(CC) $(CFLAGS) -c -o $@ $<
+
+clean:
+	rm -f *.o core tracer_remote textlog enb vcd record replay
+	rm -f extract_config macpdu2wireshark
+	cd gui && make clean
+	cd view && make clean
+	cd logger && make clean
+	cd filter && make clean
+	cd hacks && make clean
diff --git a/common/utils/T/tracer/config.c b/common/utils/T/tracer/config.c
new file mode 100644
index 0000000000000000000000000000000000000000..f88966ed79a111b2ab2d09d7110ae9da0c3781ea
--- /dev/null
+++ b/common/utils/T/tracer/config.c
@@ -0,0 +1,62 @@
+#include "config.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static char *local;
+static int local_size;
+static char *remote;
+static int remote_size;
+
+static char *PUT(char *to, int tosize, char c)
+{
+  if ((tosize & 4095) == 0) {
+    to = realloc(to, tosize + 4096); if (to == NULL) abort();
+  }
+  to[tosize] = c;
+  return to;
+}
+
+void  clear_remote_config(void)
+{
+  free(remote);
+  remote = NULL;
+  remote_size = 0;
+}
+
+void append_received_config_chunk(char *buf, int length)
+{
+  int buflen = *(int *)buf;
+  if (buflen != length - sizeof(int)) {
+    printf("ERROR: bad trace -1, should not happen...\n");
+    abort();
+  }
+  buf += sizeof(int);
+  while (buflen) {
+    remote = PUT(remote, remote_size, *buf);
+    remote_size++;
+    buf++;
+    buflen--;
+  }
+}
+
+void load_config_file(char *filename)
+{
+  int c;
+  FILE *f = fopen(filename, "r");
+  if (f == NULL) { perror(filename); abort(); }
+  while (1) {
+    c = fgetc(f); if (c == EOF) break;
+    local = PUT(local, local_size, c);
+    local_size++;
+  }
+  fclose(f);
+}
+
+void verify_config(void)
+{
+  if (local_size != remote_size || memcmp(local, remote, local_size) != 0) {
+    printf("ERROR: local and remote T_messages.txt not identical\n");
+    abort();
+  }
+}
diff --git a/common/utils/T/tracer/config.h b/common/utils/T/tracer/config.h
new file mode 100644
index 0000000000000000000000000000000000000000..f90869eb6621f89c5be80fc012e4edc7102a4652
--- /dev/null
+++ b/common/utils/T/tracer/config.h
@@ -0,0 +1,9 @@
+#ifndef _CONFIG_H_
+#define _CONFIG_H_
+
+void clear_remote_config(void);
+void append_received_config_chunk(char *buf, int length);
+void load_config_file(char *filename);
+void verify_config(void);
+
+#endif /* _CONFIG_H_ */
diff --git a/common/utils/T/tracer/database.c b/common/utils/T/tracer/database.c
new file mode 100644
index 0000000000000000000000000000000000000000..f0908948e23cb81ac2809faa14b8856f53492075
--- /dev/null
+++ b/common/utils/T/tracer/database.c
@@ -0,0 +1,503 @@
+#include "database.h"
+#include "utils.h"
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <ctype.h>
+
+typedef struct {
+  char *name;
+  char *desc;
+  char **groups;
+  int  gsize;
+  char **arg_type;
+  char **arg_name;
+  int  asize;
+  int  id;
+} id;
+
+typedef struct {
+  char *name;
+  char **ids;
+  int size;
+} group;
+
+typedef struct {
+  char *name;
+  id *i;
+  int isize;
+  group *g;
+  int gsize;
+  int *id_to_pos;
+} database;
+
+typedef struct {
+  char *data;
+  int size;
+  int maxsize;
+} buffer;
+
+typedef struct {
+  buffer name;
+  buffer value;
+} parser;
+
+void put(buffer *b, int c)
+{
+  if (b->size == b->maxsize) {
+    b->maxsize += 256;
+    b->data = realloc(b->data, b->maxsize);
+    if (b->data == NULL) { printf("memory allocation error\n"); exit(1); }
+  }
+  b->data[b->size] = c;
+  b->size++;
+}
+
+void smash_spaces(FILE *f)
+{
+  int c;
+  while (1) {
+    c = fgetc(f);
+    if (isspace(c)) continue;
+    if (c == ' ') continue;
+    if (c == '\t') continue;
+    if (c == '\n') continue;
+    if (c == 10 || c == 13) continue;
+    if (c == '#') {
+      while (1) {
+        c = fgetc(f);
+        if (c == '\n' || c == EOF) break;
+      }
+      continue;
+    }
+    break;
+  }
+  if (c != EOF) ungetc(c, f);
+}
+
+void get_line(parser *p, FILE *f, char **name, char **value)
+{
+  int c;
+  p->name.size = 0;
+  p->value.size = 0;
+  *name = NULL;
+  *value = NULL;
+  smash_spaces(f);
+  c = fgetc(f);
+  while (!(c == '=' || isspace(c) || c == EOF))
+    { put(&p->name, c); c = fgetc(f); }
+  if (c == EOF) return;
+  put(&p->name, 0);
+  while (!(c == EOF || c == '=')) c = fgetc(f);
+  if (c == EOF) return;
+  smash_spaces(f);
+  c = fgetc(f);
+  while (!(c == 10 || c == 13 || c == EOF))
+    { put(&p->value, c); c = fgetc(f); }
+  put(&p->value, 0);
+  if (p->name.size <= 1) return;
+  if (p->value.size <= 1) return;
+  *name = p->name.data;
+  *value = p->value.data;
+}
+
+int group_cmp(const void *_p1, const void *_p2)
+{
+  const group *p1 = _p1;
+  const group *p2 = _p2;
+  return strcmp(p1->name, p2->name);
+}
+
+int id_cmp(const void *_p1, const void *_p2)
+{
+  const id *p1 = _p1;
+  const id *p2 = _p2;
+  return strcmp(p1->name, p2->name);
+}
+
+int string_cmp(const void *_p1, const void *_p2)
+{
+  char * const *p1 = _p1;
+  char * const *p2 = _p2;
+  return strcmp(*p1, *p2);
+}
+
+id *add_id(database *r, char *idname, int i)
+{
+  if (bsearch(&(id){name:idname}, r->i, r->isize, sizeof(id), id_cmp) != NULL)
+    { printf("ERROR: ID '%s' declared more than once\n", idname); exit(1); }
+  if ((r->isize & 1023) == 0) {
+    r->i = realloc(r->i, (r->isize + 1024) * sizeof(id));
+    if (r->i == NULL) { printf("out of memory\n"); exit(1); }
+  }
+  r->i[r->isize].name = strdup(idname);
+  if (r->i[r->isize].name == NULL) { printf("out of memory\n"); exit(1); }
+  r->i[r->isize].desc = NULL;
+  r->i[r->isize].groups = NULL;
+  r->i[r->isize].gsize = 0;
+  r->i[r->isize].arg_type = NULL;
+  r->i[r->isize].arg_name = NULL;
+  r->i[r->isize].asize = 0;
+  r->i[r->isize].id = i;
+  r->isize++;
+  qsort(r->i, r->isize, sizeof(id), id_cmp);
+  return (id*)bsearch(&(id){name:idname}, r->i, r->isize, sizeof(id), id_cmp);
+}
+
+group *get_group(database *r, char *group_name)
+{
+  group *ret;
+
+  ret = bsearch(&(group){name:group_name},
+                r->g, r->gsize, sizeof(group), group_cmp);
+  if (ret != NULL) return ret;
+
+  if ((r->gsize & 1023) == 0) {
+    r->g = realloc(r->g, (r->gsize + 1024) * sizeof(group));
+    if (r->g == NULL) abort();
+  }
+  r->g[r->gsize].name = strdup(group_name);
+  if (r->g[r->gsize].name == NULL) abort();
+  r->g[r->gsize].ids = NULL;
+  r->g[r->gsize].size = 0;
+  r->gsize++;
+
+  qsort(r->g, r->gsize, sizeof(group), group_cmp);
+
+  return bsearch(&(group){name:group_name},
+                 r->g, r->gsize, sizeof(group), group_cmp);
+}
+
+void group_add_id(group *g, char *id)
+{
+  if ((g->size & 1023) == 0) {
+    g->ids = realloc(g->ids, (g->size + 1024) * sizeof(char *));
+    if (g->ids == NULL) abort();
+  }
+  g->ids[g->size] = id;
+  g->size++;
+}
+
+void id_add_group(id *i, char *group)
+{
+  char *g = bsearch(&group, i->groups, i->gsize, sizeof(char *), string_cmp);
+  if (g != NULL) return;
+
+  if ((i->gsize & 1023) == 0) {
+    i->groups = realloc(i->groups, (i->gsize+1024) * sizeof(char *));
+    if (i->groups == NULL) abort();
+  }
+  i->groups[i->gsize] = group;
+  i->gsize++;
+  qsort(i->groups, i->gsize, sizeof(char *), string_cmp);
+}
+
+void add_groups(database *r, id *i, char *groups)
+{
+  group *g;
+  if (i == NULL) {printf("ERROR: GROUP line before ID line\n");exit(1);}
+  while (1) {
+    char *start = groups;
+    char *end = start;
+    while (!isspace(*end) && *end != ':' && *end != 0) end++;
+    if (end == start) {
+      printf("bad group line: groups are seperated by ':'\n");
+      abort();
+    }
+    if (*end == 0) end = NULL; else *end = 0;
+
+    g = get_group(r, start);
+    group_add_id(g, i->name);
+    id_add_group(i, g->name);
+
+    if (end == NULL) break;
+    end++;
+    while ((isspace(*end) || *end == ':') && *end != 0) end++;
+    if (*end == 0) break;
+    groups = end;
+  }
+}
+
+void add_desc(id *i, char *desc)
+{
+  if (i == NULL) {printf("ERROR: DESC line before ID line\n");exit(1);}
+  i->desc = strdup(desc); if (i->desc == NULL) abort();
+}
+
+char *format_get_next_token(char **cur)
+{
+  char *start;
+  char *end;
+  char *ret;
+
+  start = *cur;
+
+  /* remove spaces */
+  while (*start && isspace(*start)) start ++;
+  if (*start == 0) return NULL;
+
+  /* special cases: ',' and ':' */
+  if (*start == ',' || *start == ':') { end = start + 1; goto special; }
+
+  end = start;
+
+  /* go to end of token */
+  while (*end && !isspace(*end) && *end != ',' && *end != ':') end++;
+
+special:
+  ret = malloc(end-start+1); if (ret == NULL) abort();
+  memcpy(ret, start, end-start);
+  ret[end-start] = 0;
+
+  *cur = end;
+  return ret;
+}
+
+void add_format(id *id, char *format)
+{
+  char *cur = format;
+  char *type;
+  char *name;
+  char *sep;
+  while (1) {
+    /* parse next type/name: expected " <type> , <name> :" */
+    /* get type */
+    type = format_get_next_token(&cur);
+    if (type == NULL) break;
+    /* get comma */
+    sep = format_get_next_token(&cur);
+    if (sep == NULL || strcmp(sep, ",") != 0) goto error;
+    free(sep);
+    /* get name */
+    name = format_get_next_token(&cur);
+    if (name == NULL) goto error;
+    /* if there is a next token it has to be : */
+    sep = format_get_next_token(&cur);
+    if (sep != NULL && strcmp(sep, ":") != 0) goto error;
+    free(sep);
+
+    /* add type/name */
+    if (id->asize % 64 == 0) {
+      id->arg_type = realloc(id->arg_type, (id->asize + 64) * sizeof(char *));
+      if (id->arg_type == NULL) abort();
+      id->arg_name = realloc(id->arg_name, (id->asize + 64) * sizeof(char *));
+      if (id->arg_name == NULL) abort();
+    }
+    id->arg_type[id->asize] = type;
+    id->arg_name[id->asize] = name;
+    id->asize++;
+  }
+  return;
+
+error:
+  printf("bad format '%s'\n", format);
+  abort();
+}
+
+void *parse_database(char *filename)
+{
+  FILE *in;
+  parser p;
+  database *r;
+  char *name, *value;
+  id *last_id = NULL;
+  int i;
+
+  r = calloc(1, sizeof(*r)); if (r == NULL) abort();
+  memset(&p, 0, sizeof(p));
+
+  r->name = strdup(filename); if (r->name == NULL) abort();
+
+  in = fopen(filename, "r"); if (in == NULL) { perror(filename); abort(); }
+
+  i = 0;
+
+  while (1) {
+    get_line(&p, in, &name, &value);
+    if (name == NULL) break;
+//printf("%s %s\n", name, value);
+    if (!strcmp(name, "ID")) { last_id = add_id(r, value, i); i++; }
+    if (!strcmp(name, "GROUP")) add_groups(r, last_id, value);
+    if (!strcmp(name, "DESC")) add_desc(last_id, value);
+    if (!strcmp(name, "FORMAT")) add_format(last_id, value);
+  }
+
+  fclose(in);
+  free(p.name.data);
+  free(p.value.data);
+
+  /* setup id_to_pos */
+  r->id_to_pos = malloc(sizeof(int) * r->isize);
+  if (r->id_to_pos == NULL) abort();
+  for (i = 0; i < r->isize; i++)
+    r->id_to_pos[r->i[i].id] = i;
+
+  return r;
+}
+
+void dump_database(void *_d)
+{
+  database *d = _d;
+  int i;
+
+  printf("database %s: %d IDs, %d GROUPs\n", d->name, d->isize, d->gsize);
+  for (i = 0; i < d->isize; i++) {
+    int j;
+    printf("ID %s [%s] [in %d group%s]\n",
+           d->i[i].name, d->i[i].desc ? d->i[i].desc : "",
+           d->i[i].gsize, d->i[i].gsize > 1 ? "s" : "");
+    for (j = 0; j < d->i[i].gsize; j++)
+      printf("    in GROUP: %s\n", d->i[i].groups[j]);
+    if (d->i[i].asize == 0) printf("    no FORMAT\n");
+    else {
+      int j;
+      printf("    FORMAT: ");
+      for (j = 0; j < d->i[i].asize; j++)
+        printf("'%s' , '%s' %s", d->i[i].arg_type[j], d->i[i].arg_name[j],
+               j == d->i[i].asize-1 ? "" : " : ");
+      printf("\n");
+    }
+  }
+  for (i = 0; i < d->gsize; i++) {
+    int j;
+    printf("GROUP %s [size %d]\n", d->g[i].name, d->g[i].size);
+    for (j = 0; j < d->g[i].size; j++)
+      printf("  contains ID: %s\n", d->g[i].ids[j]);
+  }
+}
+
+void list_ids(void *_d)
+{
+  database *d = _d;
+  int i;
+  for (i = 0; i < d->isize; i++) printf("%s\n", d->i[i].name);
+}
+
+void list_groups(void *_d)
+{
+  database *d = _d;
+  int i;
+  for (i = 0; i < d->gsize; i++) printf("%s\n", d->g[i].name);
+}
+
+static int onoff_id(database *d, char *name, int *a, int onoff)
+{
+  id *i;
+  i = bsearch(&(id){name:name}, d->i, d->isize, sizeof(id), id_cmp);
+  if (i == NULL) return 0;
+  a[i->id] = onoff;
+  printf("turning %s %s\n", onoff ? "ON" : "OFF", name);
+  return 1;
+}
+
+static int onoff_group(database *d, char *name, int *a, int onoff)
+{
+  group *g;
+  int i;
+  g = bsearch(&(group){name:name}, d->g, d->gsize, sizeof(group), group_cmp);
+  if (g == NULL) return 0;
+  for (i = 0; i < g->size; i++) onoff_id(d, g->ids[i], a, onoff);
+  return 1;
+}
+
+void on_off(void *_d, char *item, int *a, int onoff)
+{
+  int done;
+  database *d = _d;
+  int i;
+  if (item == NULL) {
+    for (i = 0; i < d->isize; i++) a[i] = onoff;
+    printf("turning %s all traces\n", onoff ? "ON" : "OFF");
+    return;
+  }
+  done = onoff_group(d, item, a, onoff);
+  done += onoff_id(d, item, a, onoff);
+  if (done == 0) {
+    printf("ERROR: ID/group '%s' not found in database\n", item);
+    exit(1);
+  }
+}
+
+char *event_name_from_id(void *_database, int id)
+{
+  database *d = _database;
+  return d->i[d->id_to_pos[id]].name;
+}
+
+int event_id_from_name(void *_database, char *name)
+{
+  database *d = _database;
+  id *i = (id*)bsearch(&(id){name:name}, d->i, d->isize, sizeof(id), id_cmp);
+  if (i == NULL)
+    { printf("%s:%d: '%s' not found\n", __FILE__, __LINE__, name); abort(); }
+  return i->id;
+}
+
+database_event_format get_format(void *_database, int event_id)
+{
+  database *d = _database;
+  database_event_format ret;
+
+  if (event_id < 0 || event_id >= d->isize) {
+    printf("%s:%d: bad event ID (%d)\n", __FILE__, __LINE__, event_id);
+    abort();
+  }
+
+  ret.type = d->i[d->id_to_pos[event_id]].arg_type;
+  ret.name = d->i[d->id_to_pos[event_id]].arg_name;
+  ret.count = d->i[d->id_to_pos[event_id]].asize;
+
+  return ret;
+}
+
+int number_of_ids(void *_d)
+{
+  database *d = _d;
+  return d->isize;
+}
+
+int database_get_ids(void *_d, char ***ids)
+{
+  database *d = _d;
+  int i;
+  *ids = malloc(d->isize * sizeof(char **)); if (*ids == NULL) abort();
+  for (i = 0; i < d->isize; i++) (*ids)[i] = d->i[i].name;
+  return d->isize;
+}
+
+int database_get_groups(void *_d, char ***groups)
+{
+  database *d = _d;
+  int i;
+  *groups = malloc(d->gsize * sizeof(char **)); if (*groups == NULL) abort();
+  for (i = 0; i < d->gsize; i++) (*groups)[i] = d->g[i].name;
+  return d->gsize;
+}
+
+int database_pos_to_id(void *_d, int pos)
+{
+  database *d = _d;
+  return d->i[pos].id;
+}
+
+void database_get_generic_description(void *_d, int id,
+    char **name, char **desc)
+{
+  database *d = _d;
+  int pos = d->id_to_pos[id];
+  OBUF o;
+  int i;
+  *name = strdup(d->i[pos].name); if (*name == NULL) abort();
+  o.osize = o.omaxsize = 0;
+  o.obuf = NULL;
+  PUTS(&o, *name);
+  for (i = 0; i < d->i[pos].asize; i++) {
+    PUTC(&o, ' ');
+    PUTS(&o, d->i[pos].arg_name[i]);
+    PUTS(&o, " [");
+    PUTS(&o, d->i[pos].arg_name[i]);
+    PUTS(&o, "]");
+  }
+  PUTC(&o, 0);
+  *desc = o.obuf;
+}
diff --git a/common/utils/T/tracer/database.h b/common/utils/T/tracer/database.h
new file mode 100644
index 0000000000000000000000000000000000000000..c5cab05d9f7be0da0cc8d50fcf3fda243aec556a
--- /dev/null
+++ b/common/utils/T/tracer/database.h
@@ -0,0 +1,31 @@
+#ifndef _DATABASE_H_
+#define _DATABASE_H_
+
+/* returns an opaque pointer - truly a 'database *', see database.c */
+void *parse_database(char *filename);
+void dump_database(void *database);
+void list_ids(void *database);
+void list_groups(void *database);
+void on_off(void *d, char *item, int *a, int onoff);
+char *event_name_from_id(void *database, int id);
+int event_id_from_name(void *database, char *name);
+int number_of_ids(void *database);
+int database_get_ids(void *database, char ***ids);
+int database_get_groups(void *database, char ***groups);
+int database_pos_to_id(void *database, int pos);
+void database_get_generic_description(void *database, int id,
+    char **name, char **desc);
+
+/****************************************************************************/
+/* get format of an event                                                   */
+/****************************************************************************/
+
+typedef struct {
+  char **type;
+  char **name;
+  int count;
+} database_event_format;
+
+database_event_format get_format(void *database, int event_id);
+
+#endif /* _DATABASE_H_ */
diff --git a/common/utils/T/tracer/defs.h b/common/utils/T/tracer/defs.h
new file mode 100644
index 0000000000000000000000000000000000000000..443fabdde8423ed744d1739f54acc82cef1c5c50
--- /dev/null
+++ b/common/utils/T/tracer/defs.h
@@ -0,0 +1,24 @@
+#ifndef _TRACER_DEFS_H_
+#define _TRACER_DEFS_H_
+
+/* types of plots */
+#define PLOT_VS_TIME   0
+#define PLOT_IQ_POINTS 1
+#define PLOT_MINMAX    2
+
+void new_thread(void *(*f)(void *), void *data);
+
+/* ... is { int count; int type; char *color; } for 'nplots' plots */
+void *make_plot(int width, int height, char *title, int nplots, ...);
+void plot_set(void *plot, float *data, int len, int pos, int pp);
+void iq_plot_set(void *plot, short *data, int len, int pos, int pp);
+void iq_plot_set_sized(void *_plot, short *data, int len, int pp);
+void iq_plot_add_iq_point_loop(void *_plot, short i, short q, int pp);
+void iq_plot_add_energy_point_loop(void *_plot, int e, int pp);
+
+/* T gui functions */
+void t_gui_start(void);
+void t_gui_set_input_signal(int eNB, int frame, int subframe, int antenna,
+    int size, void *buf);
+
+#endif /* _TRACER_DEFS_H_ */
diff --git a/common/utils/T/tracer/enb.c b/common/utils/T/tracer/enb.c
new file mode 100644
index 0000000000000000000000000000000000000000..3b8e2bf14e3c0eb147dc4b87381ab1826a9df10f
--- /dev/null
+++ b/common/utils/T/tracer/enb.c
@@ -0,0 +1,646 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <pthread.h>
+#include <signal.h>
+#include "database.h"
+#include "event.h"
+#include "handler.h"
+#include "logger/logger.h"
+#include "view/view.h"
+#include "gui/gui.h"
+#include "filter/filter.h"
+#include "utils.h"
+#include "../T_defs.h"
+#include "event_selector.h"
+#include "openair_logo.h"
+#include "config.h"
+
+typedef struct {
+  view *phyview;
+  view *macview;
+  view *rlcview;
+  view *pdcpview;
+  view *rrcview;
+  view *legacy;
+} enb_gui;
+
+typedef struct {
+  int socket;
+  int *is_on;
+  int nevents;
+  pthread_mutex_t lock;
+} enb_data;
+
+void is_on_changed(void *_d)
+{
+  enb_data *d = _d;
+  char t;
+
+  if (pthread_mutex_lock(&d->lock)) abort();
+
+  if (d->socket == -1) goto no_connection;
+
+  t = 1;
+  if (socket_send(d->socket, &t, 1) == -1 ||
+      socket_send(d->socket, &d->nevents, sizeof(int)) == -1 ||
+      socket_send(d->socket, d->is_on, d->nevents * sizeof(int)) == -1)
+    goto connection_dies;
+
+no_connection:
+  if (pthread_mutex_unlock(&d->lock)) abort();
+  return;
+
+connection_dies:
+  close(d->socket);
+  d->socket = -1;
+  if (pthread_mutex_unlock(&d->lock)) abort();
+}
+
+void usage(void)
+{
+  printf(
+"options:\n"
+"    -d <database file>        this option is mandatory\n"
+"    -on <GROUP or ID>         turn log ON for given GROUP or ID\n"
+"    -off <GROUP or ID>        turn log OFF for given GROUP or ID\n"
+"    -ON                       turn all logs ON\n"
+"    -OFF                      turn all logs OFF\n"
+"                              note: you may pass several -on/-off/-ON/-OFF,\n"
+"                                    they will be processed in order\n"
+"                                    by default, all is off\n"
+"    -ip <host>                connect to given IP address (default %s)\n"
+"    -p <port>                 connect to given port (default %d)\n"
+"    -debug-gui                activate GUI debug logs\n",
+  DEFAULT_REMOTE_IP,
+  DEFAULT_REMOTE_PORT
+  );
+  exit(1);
+}
+
+static void *gui_thread(void *_g)
+{
+  gui *g = _g;
+  gui_loop(g);
+  return NULL;
+}
+
+static filter *ticktime_filter(void *database, char *event, int i)
+{
+  /* filter is "harq_pid == i && UE_id == 0 && eNB_id == 0" */
+  return
+    filter_and(
+      filter_eq(filter_evarg(database, event, "harq_pid"), filter_int(i)),
+      filter_and(
+        filter_eq(filter_evarg(database, event, "UE_id"), filter_int(0)),
+        filter_eq(filter_evarg(database, event, "eNB_ID"), filter_int(0))));
+}
+
+static void enb_main_gui(enb_gui *e, gui *g, event_handler *h, void *database)
+{
+  widget *main_window;
+  widget *top_container;
+  widget *line, *col;
+  widget *logo;
+  widget *input_signal_plot;
+  logger *input_signal_log;
+  view *input_signal_view;
+  widget *timeline_plot;
+  logger *timelog;
+  view *timeview;
+  view *subview;
+  widget *text;
+  view *textview;
+  int i;
+  widget *w;
+  view *v;
+  logger *l;
+
+  main_window = new_toplevel_window(g, 1200, 900, "eNB tracer");
+  top_container = new_container(g, VERTICAL);
+  widget_add_child(g, main_window, top_container, -1);
+
+  line = new_container(g, HORIZONTAL);
+  widget_add_child(g, top_container, line, -1);
+  logo = new_image(g, openair_logo_png, openair_logo_png_len);
+  widget_add_child(g, line, logo, -1);
+  input_signal_plot = new_xy_plot(g, 256, 55, "input signal", 20);
+  widget_add_child(g, line, input_signal_plot, -1);
+  xy_plot_set_range(g, input_signal_plot, 0, 7680*10, 20, 70);
+  input_signal_log = new_framelog(h, database,
+      "ENB_PHY_INPUT_SIGNAL", "subframe", "rxdata");
+  /* a skip value of 10 means to process 1 frame over 10, that is
+   * more or less 10 frames per second
+   */
+  framelog_set_skip(input_signal_log, 10);
+  input_signal_view = new_view_xy(7680*10, 10,
+      g, input_signal_plot, new_color(g, "#0c0c72"), XY_LOOP_MODE);
+  logger_add_view(input_signal_log, input_signal_view);
+
+  /* UE 0 PUSCH IQ data */
+  w = new_xy_plot(g, 55, 55, "PUSCH IQ [UE 0]", 50);
+  widget_add_child(g, line, w, -1);
+  xy_plot_set_range(g, w, -1000, 1000, -1000, 1000);
+  l = new_iqlog(h, database, "ENB_PHY_PUSCH_IQ", "nb_rb",
+      "N_RB_UL", "symbols_per_tti", "pusch_comp");
+  v = new_view_xy(100*12*14,10,g,w,new_color(g,"#000"),XY_FORCED_MODE);
+  logger_add_view(l, v);
+  logger_set_filter(l,
+      filter_eq(
+        filter_evarg(database, "ENB_PHY_PUSCH_IQ", "UE_ID"),
+        filter_int(0)));
+
+  /* UE 0 estimated UL channel */
+  w = new_xy_plot(g, 280, 55, "UL estimated channel [UE 0]", 50);
+  widget_add_child(g, line, w, -1);
+  xy_plot_set_range(g, w, 0, 512*10, -10, 80);
+  l = new_framelog(h, database,
+      "ENB_PHY_UL_CHANNEL_ESTIMATE", "subframe", "chest_t");
+  //framelog_set_skip(input_signal_log, 10);
+  framelog_set_update_only_at_sf9(l, 0);
+  v = new_view_xy(512*10, 10, g, w, new_color(g, "#0c0c72"), XY_LOOP_MODE);
+  logger_add_view(l, v);
+  logger_set_filter(l,
+      filter_eq(
+        filter_evarg(database, "ENB_PHY_UL_CHANNEL_ESTIMATE", "UE_ID"),
+        filter_int(0)));
+
+  /* UE 0 PUCCH energy */
+  w = new_xy_plot(g, 128, 55, "PUCCH1 energy (SR) [UE 0]", 50);
+  widget_add_child(g, line, w, -1);
+  xy_plot_set_range(g, w, 0, 1024*10, -10, 80);
+  l = new_ttilog(h, database,
+      "ENB_PHY_PUCCH_1_ENERGY", "frame", "subframe", "threshold", 0);
+  v = new_view_tti(10, g, w, new_color(g, "#ff0000"));
+  logger_add_view(l, v);
+  logger_set_filter(l,
+      filter_eq(
+        filter_evarg(database, "ENB_PHY_PUCCH_1_ENERGY", "UE_ID"),
+        filter_int(0)));
+  l = new_ttilog(h, database,
+      "ENB_PHY_PUCCH_1_ENERGY", "frame", "subframe", "energy", 1);
+  v = new_view_tti(10, g, w, new_color(g, "#0c0c72"));
+  logger_add_view(l, v);
+  logger_set_filter(l,
+      filter_eq(
+        filter_evarg(database, "ENB_PHY_PUCCH_1_ENERGY", "UE_ID"),
+        filter_int(0)));
+
+  /* UE 0 PUCCH IQ data */
+  w = new_xy_plot(g, 55, 55, "PUCCH IQ [UE 0]", 50);
+  widget_add_child(g, line, w, -1);
+  xy_plot_set_range(g, w, -100, 100, -100, 100);
+  l = new_iqdotlog(h, database, "ENB_PHY_PUCCH_1AB_IQ", "I", "Q");
+  v = new_view_xy(500, 10, g, w, new_color(g,"#000"), XY_LOOP_MODE);
+  logger_add_view(l, v);
+  logger_set_filter(l,
+      filter_eq(
+        filter_evarg(database, "ENB_PHY_PUCCH_1AB_IQ", "UE_ID"),
+        filter_int(0)));
+
+  /* downlink/uplink UE DCIs */
+  widget_add_child(g, top_container,
+      new_label(g,"DL/UL TICK/DCI/ACK/NACK [all UEs]"), -1);
+  line = new_container(g, HORIZONTAL);
+  widget_add_child(g, top_container, line, -1);
+  timeline_plot = new_timeline(g, 512, 8, 5);
+  widget_add_child(g, line, timeline_plot, -1);
+  container_set_child_growable(g, line, timeline_plot, 1);
+  for (i = 0; i < 8; i++)
+    timeline_set_subline_background_color(g, timeline_plot, i,
+        new_color(g, i==0 || i==4 ? "#aaf" : "#eee"));
+  timeview = new_view_time(3600, 10, g, timeline_plot);
+  /* DL tick logging */
+  timelog = new_timelog(h, database, "ENB_PHY_DL_TICK");
+  subview = new_subview_time(timeview, 0, new_color(g, "#77c"), 3600*1000);
+  logger_add_view(timelog, subview);
+  /* DL DCI logging */
+  timelog = new_timelog(h, database, "ENB_PHY_DLSCH_UE_DCI");
+  subview = new_subview_time(timeview, 1, new_color(g, "#228"), 3600*1000);
+  logger_add_view(timelog, subview);
+  /* DL ACK */
+  timelog = new_timelog(h, database, "ENB_PHY_DLSCH_UE_ACK");
+  subview = new_subview_time(timeview, 2, new_color(g, "#282"), 3600*1000);
+  logger_add_view(timelog, subview);
+  /* DL NACK */
+  timelog = new_timelog(h, database, "ENB_PHY_DLSCH_UE_NACK");
+  subview = new_subview_time(timeview, 3, new_color(g, "#f22"), 3600*1000);
+  logger_add_view(timelog, subview);
+
+  /* UL tick logging */
+  timelog = new_timelog(h, database, "ENB_PHY_UL_TICK");
+  subview = new_subview_time(timeview, 4, new_color(g, "#77c"), 3600*1000);
+  logger_add_view(timelog, subview);
+  /* UL DCI logging */
+  timelog = new_timelog(h, database, "ENB_PHY_ULSCH_UE_DCI");
+  subview = new_subview_time(timeview, 5, new_color(g, "#228"), 3600*1000);
+  logger_add_view(timelog, subview);
+  /* UL retransmission without DCI logging */
+  timelog = new_timelog(h,database,"ENB_PHY_ULSCH_UE_NO_DCI_RETRANSMISSION");
+  subview = new_subview_time(timeview, 5, new_color(g, "#f22"), 3600*1000);
+  logger_add_view(timelog, subview);
+  /* UL ACK */
+  timelog = new_timelog(h, database, "ENB_PHY_ULSCH_UE_ACK");
+  subview = new_subview_time(timeview, 6, new_color(g, "#282"), 3600*1000);
+  logger_add_view(timelog, subview);
+  /* UL NACK */
+  timelog = new_timelog(h, database, "ENB_PHY_ULSCH_UE_NACK");
+  subview = new_subview_time(timeview, 7, new_color(g, "#f22"), 3600*1000);
+  logger_add_view(timelog, subview);
+
+  /* harq processes' ticktime view */
+  widget_add_child(g, top_container,
+      new_label(g,"DL/UL HARQ (x8) [UE 0]"), -1);
+  line = new_container(g, HORIZONTAL);
+  widget_add_child(g, top_container, line, -1);
+  timeline_plot = new_timeline(g, 512, 2*8+2, 3);
+  widget_add_child(g, line, timeline_plot, -1);
+  container_set_child_growable(g, line, timeline_plot, 1);
+  for (i = 0; i < 2*8+2; i++)
+    timeline_set_subline_background_color(g, timeline_plot, i,
+        new_color(g, i==0 || i==9 ? "#ddd" : (i%9)&1 ? "#e6e6e6" : "#eee"));
+  timeview = new_view_ticktime(10, g, timeline_plot);
+  ticktime_set_tick(timeview,
+      new_ticklog(h, database, "ENB_MASTER_TICK", "frame", "subframe"));
+  /* tick */
+  timelog = new_ticklog(h, database, "ENB_MASTER_TICK", "frame", "subframe");
+  /* tick on DL view */
+  subview = new_subview_ticktime(timeview, 0, new_color(g,"#bbb"), 3600*1000);
+  logger_add_view(timelog, subview);
+  /* tick on UL view */
+  subview = new_subview_ticktime(timeview, 9, new_color(g,"#bbb"), 3600*1000);
+  logger_add_view(timelog, subview);
+  /* DL harq pids */
+  for (i = 0; i < 8; i++) {
+    timelog = new_ticklog(h, database, "ENB_PHY_DLSCH_UE_DCI",
+        "frame", "subframe");
+    subview = new_subview_ticktime(timeview, i+1,
+        new_color(g,"#55f"), 3600*1000);
+    logger_add_view(timelog, subview);
+    logger_set_filter(timelog,
+        ticktime_filter(database, "ENB_PHY_DLSCH_UE_DCI", i));
+  }
+  /* DL ACK */
+  for (i = 0; i < 8; i++) {
+    timelog = new_ticklog(h, database, "ENB_PHY_DLSCH_UE_ACK",
+        "frame", "subframe");
+    subview = new_subview_ticktime(timeview, i+1,
+        new_color(g,"#282"), 3600*1000);
+    logger_add_view(timelog, subview);
+    logger_set_filter(timelog,
+        ticktime_filter(database, "ENB_PHY_DLSCH_UE_ACK", i));
+  }
+  /* DL NACK */
+  for (i = 0; i < 8; i++) {
+    timelog = new_ticklog(h, database, "ENB_PHY_DLSCH_UE_NACK",
+        "frame", "subframe");
+    subview = new_subview_ticktime(timeview, i+1,
+        new_color(g,"#f22"), 3600*1000);
+    logger_add_view(timelog, subview);
+    logger_set_filter(timelog,
+        ticktime_filter(database, "ENB_PHY_DLSCH_UE_NACK", i));
+  }
+  /* UL harq pids */
+  for (i = 0; i < 8; i++) {
+    /* first transmission */
+    timelog = new_ticklog(h, database, "ENB_PHY_ULSCH_UE_DCI",
+        "frame", "subframe");
+    subview = new_subview_ticktime(timeview, i+9+1,
+        new_color(g,"#55f"), 3600*1000);
+    logger_add_view(timelog, subview);
+    logger_set_filter(timelog,
+        ticktime_filter(database, "ENB_PHY_ULSCH_UE_DCI", i));
+    /* retransmission */
+    timelog = new_ticklog(h, database,
+        "ENB_PHY_ULSCH_UE_NO_DCI_RETRANSMISSION", "frame", "subframe");
+    subview = new_subview_ticktime(timeview, i+9+1,
+        new_color(g,"#99f"), 3600*1000);
+    logger_add_view(timelog, subview);
+    logger_set_filter(timelog,
+        ticktime_filter(database,
+            "ENB_PHY_ULSCH_UE_NO_DCI_RETRANSMISSION", i));
+  }
+  /* UL ACK */
+  for (i = 0; i < 8; i++) {
+    timelog = new_ticklog(h, database, "ENB_PHY_ULSCH_UE_ACK",
+        "frame", "subframe");
+    subview = new_subview_ticktime(timeview, i+9+1,
+        new_color(g,"#282"), 3600*1000);
+    logger_add_view(timelog, subview);
+    logger_set_filter(timelog,
+        ticktime_filter(database, "ENB_PHY_ULSCH_UE_ACK", i));
+  }
+  /* UL NACK */
+  for (i = 0; i < 8; i++) {
+    timelog = new_ticklog(h, database, "ENB_PHY_ULSCH_UE_NACK",
+        "frame", "subframe");
+    subview = new_subview_ticktime(timeview, i+9+1,
+        new_color(g,"#f22"), 3600*1000);
+    logger_add_view(timelog, subview);
+    logger_set_filter(timelog,
+        ticktime_filter(database, "ENB_PHY_ULSCH_UE_NACK", i));
+  }
+
+  /* phy/mac/rlc/pdcp/rrc textlog */
+  line = new_container(g, HORIZONTAL);
+  widget_add_child(g, top_container, line, -1);
+  container_set_child_growable(g, top_container, line, 1);
+
+  /* phy */
+  col = new_container(g, VERTICAL);
+  widget_add_child(g, line, col, -1);
+  container_set_child_growable(g, line, col, 1);
+  widget_add_child(g, col, new_label(g, "PHY"), -1);
+  text = new_textlist(g, 100, 10, new_color(g, "#afa"));
+  widget_add_child(g, col, text, -1);
+  container_set_child_growable(g, col, text, 1);
+  textview = new_view_textlist(10000, 10, g, text);
+  e->phyview = textview;
+
+  /* mac */
+  col = new_container(g, VERTICAL);
+  widget_add_child(g, line, col, -1);
+  container_set_child_growable(g, line, col, 1);
+  widget_add_child(g, col, new_label(g, "MAC"), -1);
+  text = new_textlist(g, 100, 10, new_color(g, "#adf"));
+  widget_add_child(g, col, text, -1);
+  container_set_child_growable(g, col, text, 1);
+  textview = new_view_textlist(10000, 10, g, text);
+  e->macview = textview;
+
+  line = new_container(g, HORIZONTAL);
+  widget_add_child(g, top_container, line, -1);
+  container_set_child_growable(g, top_container, line, 1);
+
+  /* rlc */
+  col = new_container(g, VERTICAL);
+  widget_add_child(g, line, col, -1);
+  container_set_child_growable(g, line, col, 1);
+  widget_add_child(g, col, new_label(g, "RLC"), -1);
+  text = new_textlist(g, 100, 10, new_color(g, "#aff"));
+  widget_add_child(g, col, text, -1);
+  container_set_child_growable(g, col, text, 1);
+  textview = new_view_textlist(10000, 10, g, text);
+  e->rlcview = textview;
+
+  /* pdcp */
+  col = new_container(g, VERTICAL);
+  widget_add_child(g, line, col, -1);
+  container_set_child_growable(g, line, col, 1);
+  widget_add_child(g, col, new_label(g, "PDCP"), -1);
+  text = new_textlist(g, 100, 10, new_color(g, "#ed9"));
+  widget_add_child(g, col, text, -1);
+  container_set_child_growable(g, col, text, 1);
+  textview = new_view_textlist(10000, 10, g, text);
+  e->pdcpview = textview;
+
+  line = new_container(g, HORIZONTAL);
+  widget_add_child(g, top_container, line, -1);
+  container_set_child_growable(g, top_container, line, 1);
+
+  /* rrc */
+  col = new_container(g, VERTICAL);
+  widget_add_child(g, line, col, -1);
+  container_set_child_growable(g, line, col, 1);
+  widget_add_child(g, col, new_label(g, "RRC"), -1);
+  text = new_textlist(g, 100, 10, new_color(g, "#fdb"));
+  widget_add_child(g, col, text, -1);
+  container_set_child_growable(g, col, text, 1);
+  textview = new_view_textlist(10000, 10, g, text);
+  e->rrcview = textview;
+
+  /* legacy logs (LOG_I, LOG_D, ...) */
+  widget_add_child(g, top_container, new_label(g, "LEGACY"), -1);
+  text = new_textlist(g, 100, 10, new_color(g, "#eeb"));
+  widget_add_child(g, top_container, text, -1);
+  container_set_child_growable(g, top_container, text, 1);
+  e->legacy = new_view_textlist(10000, 10, g, text);
+}
+
+void view_add_log(view *v, char *log, event_handler *h, void *database,
+    int *is_on)
+{
+  logger *textlog;
+  char *name, *desc;
+
+  database_get_generic_description(database,
+      event_id_from_name(database, log), &name, &desc);
+  textlog = new_textlog(h, database, name, desc);
+  logger_add_view(textlog, v);
+  free(name);
+  free(desc);
+
+  on_off(database, log, is_on, 1);
+}
+
+int main(int n, char **v)
+{
+  extern int volatile gui_logd;
+  char *database_filename = NULL;
+  void *database;
+  char *ip = DEFAULT_REMOTE_IP;
+  int port = DEFAULT_REMOTE_PORT;
+  char **on_off_name;
+  int *on_off_action;
+  int on_off_n = 0;
+  int *is_on;
+  int number_of_events;
+  int i;
+  event_handler *h;
+  gui *g;
+  enb_gui eg;
+  enb_data enb_data;
+
+  /* write on a socket fails if the other end is closed and we get SIGPIPE */
+  if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) abort();
+
+  on_off_name = malloc(n * sizeof(char *)); if (on_off_name == NULL) abort();
+  on_off_action = malloc(n * sizeof(int)); if (on_off_action == NULL) abort();
+
+  for (i = 1; i < n; i++) {
+    if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage();
+    if (!strcmp(v[i], "-d"))
+      { if (i > n-2) usage(); database_filename = v[++i]; continue; }
+    if (!strcmp(v[i], "-ip")) { if (i > n-2) usage(); ip = v[++i]; continue; }
+    if (!strcmp(v[i], "-p"))
+      { if (i > n-2) usage(); port = atoi(v[++i]); continue; }
+    if (!strcmp(v[i], "-on")) { if (i > n-2) usage();
+      on_off_name[on_off_n]=v[++i]; on_off_action[on_off_n++]=1; continue; }
+    if (!strcmp(v[i], "-off")) { if (i > n-2) usage();
+      on_off_name[on_off_n]=v[++i]; on_off_action[on_off_n++]=0; continue; }
+    if (!strcmp(v[i], "-ON"))
+      { on_off_name[on_off_n]=NULL; on_off_action[on_off_n++]=1; continue; }
+    if (!strcmp(v[i], "-OFF"))
+      { on_off_name[on_off_n]=NULL; on_off_action[on_off_n++]=0; continue; }
+    if (!strcmp(v[i], "-debug-gui")) { gui_logd = 1; continue; }
+    usage();
+  }
+
+  if (database_filename == NULL) {
+    printf("ERROR: provide a database file (-d)\n");
+    exit(1);
+  }
+
+  database = parse_database(database_filename);
+
+  load_config_file(database_filename);
+
+  number_of_events = number_of_ids(database);
+  is_on = calloc(number_of_events, sizeof(int));
+  if (is_on == NULL) abort();
+
+  h = new_handler(database);
+
+  g = gui_init();
+  new_thread(gui_thread, g);
+
+  enb_main_gui(&eg, g, h, database);
+
+  for (i = 0; i < number_of_events; i++) {
+    logger *textlog;
+    char *name, *desc;
+    database_get_generic_description(database, i, &name, &desc);
+    if (!strncmp(name, "LEGACY_", 7)) {
+      textlog = new_textlog(h, database, name, desc);
+      logger_add_view(textlog, eg.legacy);
+    }
+    free(name);
+    free(desc);
+  }
+
+  on_off(database, "ENB_PHY_INPUT_SIGNAL", is_on, 1);
+  on_off(database, "ENB_PHY_UL_CHANNEL_ESTIMATE", is_on, 1);
+  on_off(database, "ENB_PHY_DL_TICK", is_on, 1);
+  on_off(database, "ENB_PHY_DLSCH_UE_DCI", is_on, 1);
+  on_off(database, "ENB_PHY_DLSCH_UE_ACK", is_on, 1);
+  on_off(database, "ENB_PHY_DLSCH_UE_NACK", is_on, 1);
+  on_off(database, "ENB_PHY_UL_TICK", is_on, 1);
+  on_off(database, "ENB_PHY_ULSCH_UE_DCI", is_on, 1);
+  on_off(database, "ENB_PHY_ULSCH_UE_NO_DCI_RETRANSMISSION", is_on, 1);
+  on_off(database, "ENB_PHY_ULSCH_UE_ACK", is_on, 1);
+  on_off(database, "ENB_PHY_ULSCH_UE_NACK", is_on, 1);
+  on_off(database, "ENB_MASTER_TICK", is_on, 1);
+  on_off(database, "ENB_PHY_PUSCH_IQ", is_on, 1);
+  on_off(database, "ENB_PHY_PUCCH_1_ENERGY", is_on, 1);
+  on_off(database, "ENB_PHY_PUCCH_1AB_IQ", is_on, 1);
+
+  on_off(database, "LEGACY_RRC_INFO", is_on, 1);
+  on_off(database, "LEGACY_RRC_ERROR", is_on, 1);
+  on_off(database, "LEGACY_RRC_WARNING", is_on, 1);
+
+  view_add_log(eg.phyview, "ENB_PHY_DLSCH_UE_DCI", h, database, is_on);
+  view_add_log(eg.phyview, "ENB_PHY_DLSCH_UE_ACK", h, database, is_on);
+  view_add_log(eg.phyview, "ENB_PHY_DLSCH_UE_NACK", h, database, is_on);
+  view_add_log(eg.phyview, "ENB_PHY_ULSCH_UE_DCI", h, database, is_on);
+  view_add_log(eg.phyview, "ENB_PHY_ULSCH_UE_NO_DCI_RETRANSMISSION",
+      h, database, is_on);
+  view_add_log(eg.phyview, "ENB_PHY_ULSCH_UE_ACK", h, database, is_on);
+  view_add_log(eg.phyview, "ENB_PHY_ULSCH_UE_NACK", h, database, is_on);
+
+  view_add_log(eg.macview, "ENB_MAC_UE_DL_SDU", h, database, is_on);
+  view_add_log(eg.macview, "ENB_MAC_UE_UL_SCHEDULE", h, database, is_on);
+  view_add_log(eg.macview, "ENB_MAC_UE_UL_SCHEDULE_RETRANSMISSION",
+      h, database, is_on);
+  view_add_log(eg.macview, "ENB_MAC_UE_UL_PDU", h, database, is_on);
+  view_add_log(eg.macview, "ENB_MAC_UE_UL_PDU_WITH_DATA", h, database, is_on);
+  view_add_log(eg.macview, "ENB_MAC_UE_UL_SDU", h, database, is_on);
+  view_add_log(eg.macview, "ENB_MAC_UE_UL_SDU_WITH_DATA", h, database, is_on);
+  view_add_log(eg.macview, "ENB_MAC_UE_UL_CE", h, database, is_on);
+
+  view_add_log(eg.rlcview, "ENB_RLC_DL", h, database, is_on);
+  view_add_log(eg.rlcview, "ENB_RLC_UL", h, database, is_on);
+  view_add_log(eg.rlcview, "ENB_RLC_MAC_DL", h, database, is_on);
+  view_add_log(eg.rlcview, "ENB_RLC_MAC_UL", h, database, is_on);
+
+  view_add_log(eg.pdcpview, "ENB_PDCP_UL", h, database, is_on);
+  view_add_log(eg.pdcpview, "ENB_PDCP_DL", h, database, is_on);
+
+  view_add_log(eg.rrcview, "ENB_RRC_CONNECTION_SETUP_COMPLETE",
+      h, database, is_on);
+  view_add_log(eg.rrcview, "ENB_RRC_SECURITY_MODE_COMMAND",
+      h, database, is_on);
+  view_add_log(eg.rrcview, "ENB_RRC_UE_CAPABILITY_ENQUIRY",
+      h, database, is_on);
+  view_add_log(eg.rrcview, "ENB_RRC_CONNECTION_REJECT",
+      h, database, is_on);
+  view_add_log(eg.rrcview, "ENB_RRC_CONNECTION_REESTABLISHMENT_REJECT",
+      h, database, is_on);
+  view_add_log(eg.rrcview, "ENB_RRC_CONNECTION_RELEASE",
+      h, database, is_on);
+  view_add_log(eg.rrcview, "ENB_RRC_CONNECTION_RECONFIGURATION",
+      h, database, is_on);
+  view_add_log(eg.rrcview, "ENB_RRC_MEASUREMENT_REPORT",
+      h, database, is_on);
+  view_add_log(eg.rrcview, "ENB_RRC_HANDOVER_PREPARATION_INFORMATION",
+      h, database, is_on);
+  view_add_log(eg.rrcview, "ENB_RRC_CONNECTION_RECONFIGURATION_COMPLETE",
+      h, database, is_on);
+  view_add_log(eg.rrcview, "ENB_RRC_CONNECTION_SETUP",
+      h, database, is_on);
+  view_add_log(eg.rrcview, "ENB_RRC_UL_CCCH_DATA_IN",
+      h, database, is_on);
+  view_add_log(eg.rrcview, "ENB_RRC_UL_DCCH_DATA_IN",
+      h, database, is_on);
+  view_add_log(eg.rrcview, "ENB_RRC_SECURITY_MODE_COMPLETE",
+      h, database, is_on);
+  view_add_log(eg.rrcview, "ENB_RRC_SECURITY_MODE_FAILURE",
+      h, database, is_on);
+  view_add_log(eg.rrcview, "ENB_RRC_UE_CAPABILITY_INFORMATION",
+      h, database, is_on);
+  view_add_log(eg.rrcview, "ENB_RRC_CONNECTION_REQUEST",
+      h, database, is_on);
+  view_add_log(eg.rrcview, "ENB_RRC_CONNECTION_REESTABLISHMENT_REQUEST",
+      h, database, is_on);
+  view_add_log(eg.rrcview, "ENB_RRC_CONNECTION_REESTABLISHMENT_COMPLETE",
+      h, database, is_on);
+  view_add_log(eg.rrcview, "ENB_RRC_UL_HANDOVER_PREPARATION_TRANSFER",
+      h, database, is_on);
+  view_add_log(eg.rrcview, "ENB_RRC_UL_INFORMATION_TRANSFER",
+      h, database, is_on);
+  view_add_log(eg.rrcview, "ENB_RRC_COUNTER_CHECK_RESPONSE",
+      h, database, is_on);
+  view_add_log(eg.rrcview, "ENB_RRC_UE_INFORMATION_RESPONSE_R9",
+      h, database, is_on);
+  view_add_log(eg.rrcview, "ENB_RRC_PROXIMITY_INDICATION_R9",
+      h, database, is_on);
+  view_add_log(eg.rrcview, "ENB_RRC_RECONFIGURATION_COMPLETE_R10",
+      h, database, is_on);
+  view_add_log(eg.rrcview, "ENB_RRC_MBMS_COUNTING_RESPONSE_R10",
+      h, database, is_on);
+  view_add_log(eg.rrcview, "ENB_RRC_INTER_FREQ_RSTD_MEASUREMENT_INDICATION",
+      h, database, is_on);
+  view_add_log(eg.rrcview, "ENB_RRC_UNKNOW_MESSAGE",
+      h, database, is_on);
+
+  /* deactivate those two by default, they are a bit heavy */
+  on_off(database, "ENB_MAC_UE_UL_SDU_WITH_DATA", is_on, 0);
+  on_off(database, "ENB_MAC_UE_UL_PDU_WITH_DATA", is_on, 0);
+
+  for (i = 0; i < on_off_n; i++)
+    on_off(database, on_off_name[i], is_on, on_off_action[i]);
+
+  enb_data.socket = -1;
+  enb_data.is_on = is_on;
+  enb_data.nevents = number_of_events;
+  if (pthread_mutex_init(&enb_data.lock, NULL)) abort();
+  setup_event_selector(g, database, is_on, is_on_changed, &enb_data);
+
+restart:
+  clear_remote_config();
+  enb_data.socket = connect_to(ip, port);
+
+  /* send the first message - activate selected traces */
+  is_on_changed(&enb_data);
+
+  /* read messages */
+  while (1) {
+    char v[T_BUFFER_MAX];
+    event e;
+    e = get_event(enb_data.socket, v, database);
+    if (e.type == -1) goto restart;
+    handle_event(h, e);
+  }
+
+  return 0;
+}
diff --git a/common/utils/T/tracer/event.c b/common/utils/T/tracer/event.c
new file mode 100644
index 0000000000000000000000000000000000000000..0917c010b3852a95a6e0fa6f56e48315c1d19b2b
--- /dev/null
+++ b/common/utils/T/tracer/event.c
@@ -0,0 +1,106 @@
+#include "event.h"
+#include "database.h"
+#include "utils.h"
+#include "config.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+event get_event(int socket, char *event_buffer, void *database)
+{
+#ifdef T_SEND_TIME
+  struct timespec t;
+#endif
+  int type;
+  int32_t length;
+
+  /* Events type -1 and -2 are special: the tracee sends its version
+   * of T_messages.txt using those events.
+   * We have to check that the local version of T_messages.txt is identical
+   * to the one the tracee uses. We don't report those events to the
+   * application.
+   */
+
+again:
+  if (fullread(socket, &length, 4) == -1) goto read_error;
+#ifdef T_SEND_TIME
+  if (fullread(socket, &t, sizeof(struct timespec)) == -1) goto read_error;
+  length -= sizeof(struct timespec);
+#endif
+  if (fullread(socket, &type, sizeof(int)) == -1) goto read_error;
+  length -= sizeof(int);
+  if (fullread(socket, event_buffer, length) == -1) goto read_error;
+
+  if (type == -1) append_received_config_chunk(event_buffer, length);
+  if (type == -2) verify_config();
+
+  if (type == -1 || type == -2) goto again;
+
+#ifdef T_SEND_TIME
+  return new_event(t, type, length, event_buffer, database);
+#else
+  return new_event(type, length, event_buffer, database);
+#endif
+
+read_error:
+  return (event){type: -1};
+}
+
+#ifdef T_SEND_TIME
+event new_event(struct timespec sending_time, int type,
+    int length, char *buffer, void *database)
+#else
+event new_event(int type, int length, char *buffer, void *database)
+#endif
+{
+  database_event_format f;
+  event e;
+  int i;
+  int offset;
+
+#ifdef T_SEND_TIME
+  e.sending_time = sending_time;
+#endif
+  e.type = type;
+  e.buffer = buffer;
+
+  f = get_format(database, type);
+
+  e.ecount = f.count;
+
+  offset = 0;
+
+  /* setup offsets */
+  /* TODO: speedup (no strcmp, string event to include length at head) */
+  for (i = 0; i < f.count; i++) {
+    //e.e[i].offset = offset;
+    if (!strcmp(f.type[i], "int")) {
+      e.e[i].type = EVENT_INT;
+      e.e[i].i = *(int *)(&buffer[offset]);
+      offset += 4;
+    } else if (!strcmp(f.type[i], "ulong")) {
+      e.e[i].type = EVENT_ULONG;
+      e.e[i].ul = *(unsigned long *)(&buffer[offset]);
+      offset += sizeof(unsigned long);
+    } else if (!strcmp(f.type[i], "string")) {
+      e.e[i].type = EVENT_STRING;
+      e.e[i].s = &buffer[offset];
+      while (buffer[offset]) offset++;
+      offset++;
+    } else if (!strcmp(f.type[i], "buffer")) {
+      int len;
+      e.e[i].type = EVENT_BUFFER;
+      len = *(int *)(&buffer[offset]);
+      e.e[i].bsize = len;
+      e.e[i].b = &buffer[offset+sizeof(int)];
+      offset += len+sizeof(int);
+    } else {
+      printf("unhandled type '%s'\n", f.type[i]);
+      abort();
+    }
+  }
+
+  if (e.ecount==0) { printf("FORMAT not set in event %d\n", type); abort(); }
+
+  return e;
+}
diff --git a/common/utils/T/tracer/event.h b/common/utils/T/tracer/event.h
new file mode 100644
index 0000000000000000000000000000000000000000..6272baf1a8f13216959db18951b606690315d46e
--- /dev/null
+++ b/common/utils/T/tracer/event.h
@@ -0,0 +1,49 @@
+#ifndef _EVENT_H_
+#define _EVENT_H_
+
+#include "../T_defs.h"
+#ifdef T_SEND_TIME
+#include <time.h>
+#endif
+
+enum event_arg_type {
+  EVENT_INT,
+  EVENT_ULONG,
+  EVENT_STRING,
+  EVENT_BUFFER
+};
+
+typedef struct {
+  enum event_arg_type type;
+  //int offset;
+  union {
+    int i;
+    unsigned long ul;
+    char *s;
+    struct {
+      int bsize;
+      void *b;
+    };
+  };
+} event_arg;
+
+typedef struct {
+#ifdef T_SEND_TIME
+  struct timespec sending_time;
+#endif
+  int type;
+  char *buffer;
+  event_arg e[T_MAX_ARGS];
+  int ecount;
+} event;
+
+event get_event(int s, char *v, void *d);
+
+#ifdef T_SEND_TIME
+event new_event(struct timespec sending_time, int type,
+    int length, char *buffer, void *database);
+#else
+event new_event(int type, int length, char *buffer, void *database);
+#endif
+
+#endif /* _EVENT_H_ */
diff --git a/common/utils/T/tracer/event_selector.c b/common/utils/T/tracer/event_selector.c
new file mode 100644
index 0000000000000000000000000000000000000000..2b6cfd878de99faf5944f6a32511c883f545ae96
--- /dev/null
+++ b/common/utils/T/tracer/event_selector.c
@@ -0,0 +1,234 @@
+#include "event_selector.h"
+#include "gui/gui.h"
+#include "database.h"
+#include "utils.h"
+#include <stdlib.h>
+#include <string.h>
+
+struct event_selector {
+  int *is_on;
+  int *is_on_paused;    /* when pausing, is_on is set to all 0, this one
+                         * is used to copy back data when un-pausing */
+  int red;
+  int green;
+  gui *g;
+  widget *events;
+  widget *groups;
+  void *database;
+  int nevents;
+  int ngroups;
+  int paused;
+  /* those three widgets used to pause/unpause reception of events */
+  widget *parent_widget;
+  widget *normal_widget;
+  widget *pause_widget;
+  void (*change_callback)(void *change_callback_data);
+  void *change_callback_data;
+};
+
+static void scroll(void *private, gui *g,
+    char *notification, widget *w, void *notification_data)
+{
+  int visible_lines;
+  int start_line;
+  int number_of_lines;
+  int new_line;
+  int inc;
+  int *d = notification_data;
+  int key_modifiers = *d;
+
+  textlist_state(g, w, &visible_lines, &start_line, &number_of_lines);
+  inc = 10;
+  if (inc > visible_lines - 2) inc = visible_lines - 2;
+  if (inc < 1) inc = 1;
+  if (key_modifiers & KEY_CONTROL) inc = 1;
+  if (!strcmp(notification, "scrollup")) inc = -inc;
+
+  new_line = start_line + inc;
+  if (new_line > number_of_lines - visible_lines)
+    new_line = number_of_lines - visible_lines;
+  if (new_line < 0) new_line = 0;
+
+  textlist_set_start_line(g, w, new_line);
+}
+
+static void click(void *private, gui *g,
+    char *notification, widget *w, void *notification_data)
+{
+  int *d = notification_data;
+  struct event_selector *this = private;
+  int set_on;
+  int line = d[0];
+  int button = d[1];
+  char *text;
+  int color;
+  int i;
+
+  /* notification_data depends on the kind of widget */
+  if (w == this->pause_widget) {
+    line = 0;
+    button = d[0];
+  } else {
+    line = d[0];
+    button = d[1];
+  }
+
+  /* middle-button toggles - redo with SPACE when keyboard is processed */
+  if (button == 2) {
+    if (this->paused == 0) {
+      widget_del_child(g, this->parent_widget, this->normal_widget);
+      widget_add_child(g, this->parent_widget, this->pause_widget, 0);
+      container_set_child_growable(g, this->parent_widget,
+          this->pause_widget, 1);
+      /* pause */
+      memcpy(this->is_on_paused, this->is_on, this->nevents * sizeof(int));
+      memset(this->is_on, 0, this->nevents * sizeof(int));
+      this->change_callback(this->change_callback_data);
+    } else {
+      widget_del_child(g, this->parent_widget, this->pause_widget);
+      widget_add_child(g, this->parent_widget, this->normal_widget, 0);
+      container_set_child_growable(g, this->parent_widget,
+          this->normal_widget, 1);
+      /* un-pause */
+      memcpy(this->is_on, this->is_on_paused, this->nevents * sizeof(int));
+      this->change_callback(this->change_callback_data);
+    }
+    this->paused = 1 - this->paused;
+    return;
+  }
+
+  if (w == this->pause_widget) return;
+
+  if (button != 1 && button != 3) return;
+
+  if (button == 1) set_on = 1; else set_on = 0;
+
+  if (w == this->events)
+    textlist_get_line(this->g, this->events, line, &text, &color);
+  else
+    textlist_get_line(this->g, this->groups, line, &text, &color);
+
+  on_off(this->database, text, this->is_on, set_on);
+
+  for (i = 0; i < this->nevents; i++)
+    textlist_set_color(this->g, this->events, i,
+        this->is_on[database_pos_to_id(this->database, i)] ?
+            this->green : this->red);
+
+  for (i = 0; i < this->ngroups; i++)
+    textlist_set_color(this->g, this->groups, i, FOREGROUND_COLOR);
+  if (w == this->groups)
+    textlist_set_color(this->g, this->groups, line,
+        set_on ? this->green : this->red);
+
+  this->change_callback(this->change_callback_data);
+}
+
+event_selector *setup_event_selector(gui *g, void *database, int *is_on,
+    void (*change_callback)(void *), void *change_callback_data)
+{
+  struct event_selector *ret;
+  widget *win;
+  widget *win_container;
+  widget *main_container;
+  widget *container;
+  widget *left, *right;
+  widget *events, *groups;
+  widget *pause_container;
+  char **ids;
+  char **gps;
+  int n;
+  int i;
+  int red, green;
+
+  ret = calloc(1, sizeof(struct event_selector)); if (ret == NULL) abort();
+
+  red = new_color(g, "#c93535");
+  green = new_color(g, "#2f9e2a");
+
+  win = new_toplevel_window(g, 470, 300, "event selector");
+  win_container = new_container(g, VERTICAL);
+  widget_add_child(g, win, win_container, -1);
+
+  main_container = new_container(g, VERTICAL);
+  widget_add_child(g, win_container, main_container, -1);
+  container_set_child_growable(g, win_container, main_container, 1);
+
+  container = new_container(g, HORIZONTAL);
+  widget_add_child(g, main_container, container, -1);
+  container_set_child_growable(g, main_container, container, 1);
+  widget_add_child(g, main_container,
+      new_label(g, "mouse scroll to scroll - "
+                   "left click to activate - "
+                   "right click to deactivate"), -1);
+
+  left = new_container(g, VERTICAL);
+  right = new_container(g, VERTICAL);
+  widget_add_child(g, container, left, -1);
+  widget_add_child(g, container, right, -1);
+  container_set_child_growable(g, container, left, 1);
+  container_set_child_growable(g, container, right, 1);
+
+  widget_add_child(g, left, new_label(g, "Events"), -1);
+  widget_add_child(g, right, new_label(g, "Groups"), -1);
+
+  events = new_textlist(g, 235, 10, new_color(g, "#b3c1e1"));
+  groups = new_textlist(g, 235, 10, new_color(g, "#edd6cb"));
+
+  widget_add_child(g, left, events, -1);
+  widget_add_child(g, right, groups, -1);
+  container_set_child_growable(g, left, events, 1);
+  container_set_child_growable(g, right, groups, 1);
+
+  pause_container = new_positioner(g);
+  widget_add_child(g, pause_container,
+      new_label(g,
+          "events' reception paused - click middle button to resume"), -1);
+  label_set_clickable(g, pause_container, 1);
+
+  n = database_get_ids(database, &ids);
+  for (i = 0; i < n; i++) {
+    textlist_add(g, events, ids[i], -1,
+        is_on[database_pos_to_id(database, i)] ? green : red);
+  }
+  free(ids);
+
+  ret->nevents = n;
+
+  ret->is_on_paused = calloc(n, sizeof(int));
+  if (ret->is_on_paused == NULL) abort();
+
+  n = database_get_groups(database, &gps);
+  for (i = 0; i < n; i++) {
+    textlist_add(g, groups, gps[i], -1, FOREGROUND_COLOR);
+  }
+  free(gps);
+
+  ret->ngroups = n;
+
+  ret->g = g;
+  ret->is_on = is_on;
+  ret->red = red;
+  ret->green = green;
+  ret->events = events;
+  ret->groups = groups;
+  ret->database = database;
+  ret->change_callback = change_callback;
+  ret->change_callback_data = change_callback_data;
+
+  ret->parent_widget = win_container;
+  ret->normal_widget = main_container;
+  ret->pause_widget = pause_container;
+
+  register_notifier(g, "scrollup", events, scroll, ret);
+  register_notifier(g, "scrolldown", events, scroll, ret);
+  register_notifier(g, "click", events, click, ret);
+
+  register_notifier(g, "scrollup", groups, scroll, ret);
+  register_notifier(g, "scrolldown", groups, scroll, ret);
+  register_notifier(g, "click", groups, click, ret);
+
+  register_notifier(g, "click", pause_container, click, ret);
+
+  return ret;
+}
diff --git a/common/utils/T/tracer/event_selector.h b/common/utils/T/tracer/event_selector.h
new file mode 100644
index 0000000000000000000000000000000000000000..dedd79965c5096a5e2dce8ad13d61f11fbdda42e
--- /dev/null
+++ b/common/utils/T/tracer/event_selector.h
@@ -0,0 +1,11 @@
+#ifndef _EVENT_SELECTOR_H_
+#define _EVENT_SELECTOR_H_
+
+#include "gui/gui.h"
+
+typedef void event_selector;
+
+event_selector *setup_event_selector(gui *g, void *database, int *is_on,
+    void (*change_callback)(void *), void *change_callback_data);
+
+#endif /* _EVENT_SELECTOR_H_ */
diff --git a/common/utils/T/tracer/extract_config.c b/common/utils/T/tracer/extract_config.c
new file mode 100644
index 0000000000000000000000000000000000000000..f35d765cec5b3366b88eca9bd9bc85d2697a18e4
--- /dev/null
+++ b/common/utils/T/tracer/extract_config.c
@@ -0,0 +1,75 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "../T_defs.h"
+
+void usage(void)
+{
+  printf(
+"options:\n"
+"    -i <input file>           this option is mandatory\n"
+  );
+  exit(1);
+}
+
+#define ERR printf("ERROR: read file %s failed\n", input_filename)
+
+int main(int n, char **v)
+{
+  char *input_filename = NULL;
+  int i;
+  FILE *in;
+
+  for (i = 1; i < n; i++) {
+    if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage();
+    if (!strcmp(v[i], "-i"))
+      { if (i > n-2) usage(); input_filename = v[++i]; continue; }
+    usage();
+  }
+
+  if (input_filename == NULL) {
+    printf("ERROR: provide an input file (-i)\n");
+    exit(1);
+  }
+
+  in = fopen(input_filename, "r");
+  if (in == NULL) { perror(input_filename); abort(); }
+
+  while (1) {
+    int type;
+    int32_t length;
+    char v[T_BUFFER_MAX];
+    int vpos = 0;
+
+    /* read event from file */
+    if (fread(&length, 4, 1, in) != 1) break;
+    memcpy(v+vpos, &length, 4);
+    vpos += 4;
+#ifdef T_SEND_TIME
+    if (length < sizeof(struct timespec)) { ERR; break; }
+    if (fread(v+vpos, sizeof(struct timespec), 1, in) != 1) { ERR; break; }
+    vpos += sizeof(struct timespec);
+    length -= sizeof(struct timespec);
+#endif
+    if (length < sizeof(int)) { ERR; break; }
+    if (fread(&type, sizeof(int), 1, in) != 1) { ERR; break; }
+    memcpy(v+vpos, &type, sizeof(int));
+    vpos += sizeof(int);
+    length -= sizeof(int);
+    if (length) if (fread(v+vpos, length, 1, in) != 1) { ERR; break; }
+    vpos += length;
+
+    if (type == -1) {
+      if (length < sizeof(int)) { ERR; break; }
+      length -= sizeof(int);
+      if (fwrite(v+vpos-length, length, 1, stdout) != 1) { ERR; break; }
+    }
+
+    /* TODO: parse all file? */
+    if (type == -2) break;
+  }
+
+  fclose(in);
+
+  return 0;
+}
diff --git a/common/utils/T/tracer/filter/Makefile b/common/utils/T/tracer/filter/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..fb1427ca6ac101188c2fee0625314e80e635fa3b
--- /dev/null
+++ b/common/utils/T/tracer/filter/Makefile
@@ -0,0 +1,13 @@
+CC=gcc
+CFLAGS=-Wall -g -pthread -I..
+
+OBJS=filter.o
+
+filter.a: $(OBJS)
+	ar cr filter.a $(OBJS)
+
+%.o: %.c
+	$(CC) $(CFLAGS) -o $@ -c $<
+
+clean:
+	rm -f *.a *.o
diff --git a/common/utils/T/tracer/filter/filter.c b/common/utils/T/tracer/filter/filter.c
new file mode 100644
index 0000000000000000000000000000000000000000..b09b01259d91bf96dd8d886aee433000897d909c
--- /dev/null
+++ b/common/utils/T/tracer/filter/filter.c
@@ -0,0 +1,125 @@
+#include "filter.h"
+#include "event.h"
+#include "database.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+struct filter {
+  union {
+    struct { struct filter *a, *b; } op2;
+    int v;
+    struct { int event_type; int arg_index; } evarg;
+  } v;
+
+  int (*eval)(struct filter *this, event e);
+};
+
+/****************************************************************************/
+/*                     evaluation functions                                 */
+/****************************************************************************/
+
+int eval_and(struct filter *f, event e)
+{
+  if (f->v.op2.a->eval(f->v.op2.a, e) == 0) return 0;
+  return f->v.op2.b->eval(f->v.op2.b, e);
+}
+
+int eval_eq(struct filter *f, event e)
+{
+  int a = f->v.op2.a->eval(f->v.op2.a, e);
+  int b = f->v.op2.b->eval(f->v.op2.b, e);
+  return a == b;
+}
+
+int eval_int(struct filter *f, event e)
+{
+  return f->v.v;
+}
+
+int eval_evarg(struct filter *f, event e)
+{
+  if (e.type != f->v.evarg.event_type) {
+    printf("%s:%d:%s: bad event type\n", __FILE__, __LINE__, __FUNCTION__);
+    abort();
+  }
+  if (e.e[f->v.evarg.arg_index].type != EVENT_INT) {
+    printf("%s:%d:%s: bad event argtype; has to be 'int'\n",
+        __FILE__, __LINE__, __FUNCTION__);
+    abort();
+  }
+  return e.e[f->v.evarg.arg_index].i;
+}
+
+/****************************************************************************/
+/*                     filter construction functions                        */
+/****************************************************************************/
+
+filter *filter_and(filter *a, filter *b)
+{
+  struct filter *ret = calloc(1, sizeof(struct filter));
+  if (ret == NULL) abort();
+  ret->eval = eval_and;
+  ret->v.op2.a = a;
+  ret->v.op2.b = b;
+  return ret;
+}
+
+filter *filter_eq(filter *a, filter *b)
+{
+  struct filter *ret = calloc(1, sizeof(struct filter));
+  if (ret == NULL) abort();
+  ret->eval = eval_eq;
+  ret->v.op2.a = a;
+  ret->v.op2.b = b;
+  return ret;
+}
+
+filter *filter_int(int v)
+{
+  struct filter *ret = calloc(1, sizeof(struct filter));
+  if (ret == NULL) abort();
+  ret->eval = eval_int;
+  ret->v.v = v;
+  return ret;
+}
+
+filter *filter_evarg(void *database, char *event_name, char *varname)
+{
+  struct filter *ret;
+  int event_id;
+  database_event_format f;
+  int i;
+
+  ret = calloc(1, sizeof(struct filter)); if (ret == NULL) abort();
+
+  event_id = event_id_from_name(database, event_name);
+  f = get_format(database, event_id);
+
+  ret->eval = eval_evarg;
+  ret->v.evarg.event_type = event_id;
+  ret->v.evarg.arg_index = -1;
+
+  for (i = 0; i < f.count; i++) {
+    if (strcmp(f.name[i], varname) != 0) continue;
+    ret->v.evarg.arg_index = i;
+    break;
+  }
+  if (ret->v.evarg.arg_index == -1) {
+    printf("%s:%d:%s: event '%s' has no argument '%s'\n",
+        __FILE__, __LINE__, __FUNCTION__, event_name, varname);
+    abort();
+  }
+
+  return ret;
+}
+
+/****************************************************************************/
+/*                     eval function                                        */
+/****************************************************************************/
+
+int filter_eval(filter *_f, event e)
+{
+  struct filter *f = _f;
+  return f->eval(f, e);
+}
diff --git a/common/utils/T/tracer/filter/filter.h b/common/utils/T/tracer/filter/filter.h
new file mode 100644
index 0000000000000000000000000000000000000000..eba02d7fb7f9975709c60f167c267c1c3ce43c6b
--- /dev/null
+++ b/common/utils/T/tracer/filter/filter.h
@@ -0,0 +1,15 @@
+#ifndef _FILTER_H_
+#define _FILTER_H_
+
+#include "event.h"
+
+typedef void filter;
+
+filter *filter_and(filter *a, filter *b);
+filter *filter_eq(filter *a, filter *b);
+filter *filter_int(int v);
+filter *filter_evarg(void *database, char *event_name, char *varname);
+
+int filter_eval(filter *f, event e);
+
+#endif /* _FILTER_H_ */
diff --git a/common/utils/T/tracer/gui.c b/common/utils/T/tracer/gui.c
new file mode 100644
index 0000000000000000000000000000000000000000..46e06d2e1f0579fbabc4473e9d035acd847350bf
--- /dev/null
+++ b/common/utils/T/tracer/gui.c
@@ -0,0 +1,102 @@
+#include "defs.h"
+#include "gui/gui.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <pthread.h>
+#include <unistd.h>
+#include <string.h>
+#include <math.h>
+
+static struct {
+  gui *g;
+  widget *input_signal;      /* CC_id 0 antenna 0 */
+  volatile int input_signal_length;  /* unit: byte */
+  void *input_signal_iq;
+  pthread_mutex_t input_signal_lock;
+} eNB_data;
+
+static void *gui_thread(void *g)
+{
+  gui_loop(g);
+  exit(0);
+}
+
+static void *input_signal_plotter(void *_)
+{
+  short *iqbuf;
+  float *x;
+  float *y;
+  int i;
+  int length = eNB_data.input_signal_length / 4;
+
+  x = calloc(1, sizeof(float) * eNB_data.input_signal_length / 4);
+  y = calloc(1, sizeof(float) * eNB_data.input_signal_length / 4);
+  if (x == NULL || y == NULL) abort();
+
+  while (1) {
+    usleep(100 * 1000);
+
+    if (pthread_mutex_lock(&eNB_data.input_signal_lock)) abort();
+
+    if (length * 4 != eNB_data.input_signal_length) {
+      free(x);
+      free(y);
+      x = calloc(1, sizeof(float) * eNB_data.input_signal_length / 4);
+      y = calloc(1, sizeof(float) * eNB_data.input_signal_length / 4);
+      if (x == NULL || y == NULL) abort();
+      length = eNB_data.input_signal_length / 4;
+    }
+
+    iqbuf = eNB_data.input_signal_iq;
+
+    for (i = 0; i < length; i++) {
+      x[i] = i;
+      y[i] = 10*log10(1.0+(float)(iqbuf[2*i]*iqbuf[2*i]+
+                                  iqbuf[2*i+1]*iqbuf[2*i+1]));
+    }
+
+    xy_plot_set_points(eNB_data.g, eNB_data.input_signal, 0,
+        length, x, y);
+
+    if (pthread_mutex_unlock(&eNB_data.input_signal_lock)) abort();
+  }
+}
+
+void t_gui_start(void)
+{
+  gui *g = gui_init();
+
+  widget *win = new_toplevel_window(g, 550, 140, "input signal");
+  widget *plot = new_xy_plot(g, 512, 100, "eNB 0 input signal", 20);
+  widget_add_child(g, win, plot, -1);
+  xy_plot_set_range(g, plot, 0, 76800, 30, 70);
+  xy_plot_new_plot(g, plot, FOREGROUND_COLOR);
+
+  eNB_data.input_signal = plot;
+  eNB_data.input_signal_length = 76800 * 4;
+  eNB_data.input_signal_iq = calloc(1, 76800 * 4);
+  if (eNB_data.input_signal_iq == NULL) abort();
+  pthread_mutex_init(&eNB_data.input_signal_lock, NULL);
+
+  eNB_data.g = g;
+
+  new_thread(gui_thread, g);
+  new_thread(input_signal_plotter, NULL);
+}
+
+void t_gui_set_input_signal(int eNB, int frame, int subframe, int antenna,
+    int size, void *buf)
+{
+  if (pthread_mutex_lock(&eNB_data.input_signal_lock)) abort();
+
+  if (eNB_data.input_signal_length != size * 10) {
+    free(eNB_data.input_signal_iq);
+    eNB_data.input_signal_length = size * 10;
+    eNB_data.input_signal_iq = calloc(1, eNB_data.input_signal_length);
+    if (eNB_data.input_signal_iq == NULL) abort();
+  }
+
+  memcpy((char *)eNB_data.input_signal_iq + subframe * size, buf, size);
+
+  if (pthread_mutex_unlock(&eNB_data.input_signal_lock)) abort();
+}
diff --git a/common/utils/T/tracer/gui/Makefile b/common/utils/T/tracer/gui/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..53f2077eaccb2ae7aab01ee1ff5c5635cd207395
--- /dev/null
+++ b/common/utils/T/tracer/gui/Makefile
@@ -0,0 +1,18 @@
+CC=gcc
+CFLAGS=-Wall -g -pthread -I/usr/include/X11/Xft -I/usr/include/freetype2
+
+OBJS=init.o loop.o toplevel_window.o x.o container.o widget.o \
+     gui.o label.o event.o xy_plot.o textlist.o notify.o positioner.o \
+     timeline.o space.o image.o
+
+gui.a: $(OBJS)
+	ar cr gui.a $(OBJS)
+
+test: test.o gui.a
+	$(CC) -o test $(OBJS) test.o -lX11 -pthread -lm
+
+%.o: %.c
+	$(CC) $(CFLAGS) -o $@ -c $<
+
+clean:
+	rm -f *.a *.o test
diff --git a/common/utils/T/tracer/gui/container.c b/common/utils/T/tracer/gui/container.c
new file mode 100644
index 0000000000000000000000000000000000000000..8de43479332390a91294c62ff71ca8bd9ef5db9f
--- /dev/null
+++ b/common/utils/T/tracer/gui/container.c
@@ -0,0 +1,339 @@
+#include "gui.h"
+#include "gui_defs.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define MAX(a, b) ((a)>(b)?(a):(b))
+
+static void repack(gui *g, widget *_this)
+{
+  LOGD("REPACK container %p\n", _this);
+  struct container_widget *this = _this;
+  this->hints_are_valid = 0;
+  return this->common.parent->repack(g, this->common.parent);
+}
+
+static void add_child(gui *g, widget *_this, widget *child, int position)
+{
+  LOGD("ADD_CHILD container\n");
+  struct container_widget *this = _this;
+
+  this->hints_are_valid = 0;
+  widget_add_child_internal(g, this, child, position);
+
+  /* initially not growable */
+  this->growable = realloc(this->growable, (this->nchildren+1)*sizeof(int));
+  if (this->growable == NULL) abort();
+
+  if (position == -1) position = this->nchildren;
+
+  memmove(this->growable + position+1, this->growable + position,
+          (this->nchildren - position) * sizeof(int));
+
+  this->growable[position] = 0;
+
+  this->nchildren++;
+}
+
+static void del_child(gui *g, widget *_this, widget *child)
+{
+  LOGD("DEL_CHILD container\n");
+  struct container_widget *this = _this;
+  int position = widget_get_child_position(g, _this, child);
+
+  this->hints_are_valid = 0;
+  widget_del_child_internal(g, this, child);
+
+  memmove(this->growable + position, this->growable + position+1,
+          (this->nchildren - position - 1) * sizeof(int));
+
+  this->growable = realloc(this->growable, (this->nchildren-1)*sizeof(int));
+  if (this->nchildren != 1 && this->growable == NULL) abort();
+
+  this->nchildren--;
+}
+
+static void compute_vertical_hints(struct gui *g,
+    struct container_widget *this)
+{
+  struct widget_list *l;
+  int cwidth, cheight;
+  int allocated_width = 0, allocated_height = 0;
+
+  /* get largest width */
+  l = this->common.children;
+  while (l) {
+    l->item->hints(g, l->item, &cwidth, &cheight);
+    if (cwidth > allocated_width) allocated_width = cwidth;
+    allocated_height += cheight;
+    l = l->next;
+  }
+  this->hint_width = allocated_width;
+  this->hint_height = allocated_height;
+  this->hints_are_valid = 1;
+}
+
+static void compute_horizontal_hints(struct gui *g,
+    struct container_widget *this)
+{
+  struct widget_list *l;
+  int cwidth, cheight;
+  int allocated_width = 0, allocated_height = 0;
+
+  /* get largest height */
+  l = this->common.children;
+  while (l) {
+    l->item->hints(g, l->item, &cwidth, &cheight);
+    if (cheight > allocated_height) allocated_height = cheight;
+    allocated_width += cwidth;
+    l = l->next;
+  }
+  this->hint_width = allocated_width;
+  this->hint_height = allocated_height;
+  this->hints_are_valid = 1;
+}
+
+static void vertical_allocate(gui *_gui, widget *_this,
+    int x, int y, int width, int height)
+{
+  LOGD("ALLOCATE container vertical %p\n", _this);
+  int cy = 0;
+  int cwidth, cheight;
+  struct gui *g = _gui;
+  struct container_widget *this = _this;
+  struct widget_list *l;
+  int over_pixels = 0;
+  int i;
+
+  if (this->hints_are_valid == 1) goto hints_ok;
+
+  compute_vertical_hints(g, this);
+
+hints_ok:
+
+  this->common.x = x;
+  this->common.y = y;
+  this->common.width = width;
+  this->common.height = height;
+
+  /* TODO: some pixels won't be allocated, take care of it? */
+  if (height > this->hint_height) {
+    int ngrowable = 0;
+    for (i = 0; i < this->nchildren; i++) if (this->growable[i]) ngrowable++;
+    if (ngrowable)
+      over_pixels = (height - this->hint_height) / ngrowable;
+  }
+
+  /* allocate */
+  l = this->common.children;
+  i = 0;
+  while (l) {
+    int allocated_height;
+    l->item->hints(g, l->item, &cwidth, &cheight);
+    allocated_height = cheight + (this->growable[i] ? over_pixels : 0);
+    l->item->allocate(g, l->item, this->common.x, this->common.y + cy,
+        MAX(width, cwidth), allocated_height);
+    cy += allocated_height;
+    l = l->next;
+    i++;
+  }
+
+//  if (cy != this->hint_height) ERR("reachable?\n");
+}
+
+static void horizontal_allocate(gui *_gui, widget *_this,
+    int x, int y, int width, int height)
+{
+  LOGD("ALLOCATE container horizontal %p\n", _this);
+  int cx = 0;
+  int cwidth, cheight;
+  struct gui *g = _gui;
+  struct container_widget *this = _this;
+  struct widget_list *l;
+  int over_pixels = 0;
+  int i;
+
+  if (this->hints_are_valid == 1) goto hints_ok;
+
+  compute_horizontal_hints(g, this);
+
+hints_ok:
+
+  this->common.x = x;
+  this->common.y = y;
+  this->common.width = width;
+  this->common.height = height;
+
+  /* TODO: some pixels won't be allocated, take care of it? */
+  if (width > this->hint_width) {
+    int ngrowable = 0;
+    for (i = 0; i < this->nchildren; i++) if (this->growable[i]) ngrowable++;
+    if (ngrowable)
+      over_pixels = (width - this->hint_width) / ngrowable;
+  }
+
+  /* allocate */
+  l = this->common.children;
+  i = 0;
+  while (l) {
+    int allocated_width;
+    l->item->hints(g, l->item, &cwidth, &cheight);
+    allocated_width = cwidth + (this->growable[i] ? over_pixels : 0);
+    l->item->allocate(g, l->item, this->common.x + cx, this->common.y,
+        allocated_width, MAX(height, cheight)/* this->hint_height */);
+    cx += allocated_width;
+    l = l->next;
+    i++;
+  }
+
+//  if (cx != this->hint_width) ERR("reachable?\n");
+}
+
+static void vertical_hints(gui *_gui, widget *_w, int *width, int *height)
+{
+  LOGD("HINTS container vertical %p\n", _w);
+  struct gui *g = _gui;
+  struct container_widget *this = _w;
+
+  if (this->hints_are_valid) {
+    *width = this->hint_width;
+    *height = this->hint_height;
+    return;
+  }
+
+  compute_vertical_hints(g, this);
+
+  *width = this->hint_width;
+  *height = this->hint_height;
+}
+
+static void horizontal_hints(gui *_gui, widget *_w, int *width, int *height)
+{
+  LOGD("HINTS container horizontal %p\n", _w);
+  struct gui *g = _gui;
+  struct container_widget *this = _w;
+
+  if (this->hints_are_valid) {
+    *width = this->hint_width;
+    *height = this->hint_height;
+    return;
+  }
+
+  compute_horizontal_hints(g, this);
+
+  *width = this->hint_width;
+  *height = this->hint_height;
+}
+
+static void horizontal_button(gui *_g, widget *_this, int x, int y,
+    int key_modifiers, int button, int up)
+{
+  LOGD("BUTTON container horizontal %p xy %d %d button %d up %d\n", _this, x, y, button, up);
+  struct gui *g = _g;
+  struct container_widget *this = _this;
+  struct widget_list *l;
+
+  l = this->common.children;
+  while (l) {
+    if (l->item->x <= x && x < l->item->x + l->item->width) {
+      l->item->button(g, l->item, x, y, key_modifiers, button, up);
+      break;
+    }
+    l = l->next;
+  }
+}
+
+static void vertical_button(gui *_g, widget *_this, int x, int y,
+    int key_modifiers, int button, int up)
+{
+  LOGD("BUTTON container vertical %p xy %d %d button %d up %d\n", _this, x, y, button, up);
+  struct gui *g = _g;
+  struct container_widget *this = _this;
+  struct widget_list *l;
+
+  l = this->common.children;
+  while (l) {
+    if (l->item->y <= y && y < l->item->y + l->item->height) {
+      l->item->button(g, l->item, x, y, key_modifiers, button, up);
+      break;
+    }
+    l = l->next;
+  }
+}
+
+static void paint(gui *_gui, widget *_this)
+{
+  LOGD("PAINT container\n");
+  struct gui *g = _gui;
+  struct widget *this = _this;
+  struct widget_list *l;
+
+  l = this->children;
+  while (l) {
+    l->item->paint(g, l->item);
+    l = l->next;
+  }
+}
+
+widget *new_container(gui *_gui, int vertical)
+{
+  struct gui *g = _gui;
+  struct container_widget *w;
+
+  glock(g);
+
+  w = new_widget(g, CONTAINER, sizeof(struct container_widget));
+
+  w->vertical = vertical;
+  w->hints_are_valid = 0;
+
+  w->common.paint     = paint;
+  w->common.add_child = add_child;
+  w->common.del_child = del_child;
+  w->common.repack    = repack;
+
+  if (vertical) {
+    w->common.allocate  = vertical_allocate;
+    w->common.hints     = vertical_hints;
+    w->common.button    = vertical_button;
+  } else {
+    w->common.allocate  = horizontal_allocate;
+    w->common.hints     = horizontal_hints;
+    w->common.button    = horizontal_button;
+  }
+
+  gunlock(g);
+
+  return w;
+}
+
+/*************************************************************************/
+/*                             public functions                          */
+/*************************************************************************/
+
+void container_set_child_growable(gui *_gui, widget *_this,
+    widget *child, int growable)
+{
+  gui *g = _gui;
+  struct container_widget *this = _this;
+  struct widget_list *lcur;
+  int i;
+
+  glock(g);
+
+  lcur = this->common.children;
+  i = 0;
+  while (lcur) {
+    if (lcur->item == child) break;
+    lcur = lcur->next;
+    i++;
+  }
+  if (lcur == NULL) ERR("%s:%d: child not found\n", __FILE__, __LINE__);
+
+  this->growable[i] = growable;
+
+  send_event(g, REPACK, this->common.id);
+
+  gunlock(g);
+}
diff --git a/common/utils/T/tracer/gui/event.c b/common/utils/T/tracer/gui/event.c
new file mode 100644
index 0000000000000000000000000000000000000000..842318fcea5aff8e468b835429ff19bab3de45ad
--- /dev/null
+++ b/common/utils/T/tracer/gui/event.c
@@ -0,0 +1,209 @@
+#include "gui.h"
+#include "gui_defs.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdarg.h>
+
+/*****************************************************************/
+/*                       generic functions                       */
+/*****************************************************************/
+
+static void event_list_append(struct gui *g, struct event *e)
+{
+  struct event_list *new;
+
+  new = calloc(1, sizeof(struct event_list));
+  if (new == NULL) OOM;
+
+  new->item = e;
+
+  if (g->queued_events == NULL) {
+    g->queued_events = new;
+    new->last = new;
+    return;
+  }
+
+  g->queued_events->last->next = new;
+  g->queued_events->last = new;
+}
+
+static void free_event(struct event *e)
+{
+  switch (e->type) {
+  case REPACK: /* nothing */ break;
+  case DIRTY: /* nothing */ break;
+  }
+  free(e);
+}
+
+static int events_equal(struct event *e1, struct event *e2)
+{
+  if (e1->type != e2->type) return 0;
+  switch (e1->type) {
+  case REPACK: {
+    struct repack_event *re1 = (struct repack_event *)e1;
+    struct repack_event *re2 = (struct repack_event *)e2;
+    return re1->id == re2->id;
+  }
+  case DIRTY: {
+    struct dirty_event *re1 = (struct dirty_event *)e1;
+    struct dirty_event *re2 = (struct dirty_event *)e2;
+    return re1->id == re2->id;
+  }}
+  /* unreachable */
+  abort();
+}
+
+/*****************************************************************/
+/*                         sending events                        */
+/*****************************************************************/
+
+static event *new_event_repack(int id)
+{
+  struct repack_event *ret;
+  ret = calloc(1, sizeof(struct repack_event));
+  if (ret == NULL) OOM;
+  ret->id = id;
+  return ret;
+}
+
+static event *new_event_dirty(int id)
+{
+  struct dirty_event *ret;
+  ret = calloc(1, sizeof(struct dirty_event));
+  if (ret == NULL) OOM;
+  ret->id = id;
+  return ret;
+}
+
+static void compress_event_list(struct gui *g)
+{
+  struct event *last;
+  struct event_list *cur;
+  /* basic compression, to be refined */
+
+  /* pickup last event and remove every copy of it found before
+   * if it's DIRTY or REPACK
+   */
+  last = g->queued_events->last->item;
+  if (last->type == DIRTY || last->type == REPACK) {
+    cur = g->queued_events;
+    while (cur->item != last) {
+      if (cur->item != NULL && events_equal(cur->item, last)) {
+        free_event(cur->item);
+        cur->item = NULL;
+      }
+      cur = cur->next;
+    }
+  }
+}
+
+void send_event(gui *_gui, enum event_type type, ...)
+{
+  LOGD("send_event %d\n", type);
+  struct gui *g = _gui;
+  int do_write = 0;
+  va_list ap;
+  struct event *e;
+
+  if (g->queued_events == NULL) do_write = 1;
+
+  va_start(ap, type);
+
+  switch (type) {
+  case REPACK: {
+    int id;
+    id = va_arg(ap, int);
+    e = new_event_repack(id);
+    break;
+  }
+  case DIRTY: {
+    int id;
+    id = va_arg(ap, int);
+    e = new_event_dirty(id);
+    break;
+  }
+  }
+
+  va_end(ap);
+
+  e->type = type;
+
+  event_list_append(g, e);
+  compress_event_list(g);
+
+  if (do_write) {
+    char c = 1;
+    if (write(g->event_pipe[1], &c, 1) != 1)
+      ERR("error writing to pipe: %s\n", strerror(errno));
+  }
+}
+
+/*****************************************************************/
+/*                      processing events                        */
+/*****************************************************************/
+
+static void repack_event(struct gui *g, int id)
+{
+  struct widget *w = find_widget(g, id);
+  if (w == NULL) { WARN("widget id %d not found\n", id); return; }
+  w->repack(g, w);
+}
+
+/* TODO: put that function somewhere else? */
+static struct toplevel_window_widget *get_toplevel_window(struct widget *w)
+{
+  while (w != NULL) {
+    if (w->type == TOPLEVEL_WINDOW)
+      return (struct toplevel_window_widget *)w;
+    w = w->parent;
+  }
+  return NULL;
+}
+
+static void dirty_event(struct gui *g, int id)
+{
+  struct widget *w = find_widget(g, id);
+  struct toplevel_window_widget *win;
+  if (w == NULL) { WARN("widget id %d not found\n", id); return; }
+  win = get_toplevel_window(w);
+  if (win == NULL)
+    { WARN("widget id %d not contained in a window\n", id); return; }
+  g->xwin = win->x;
+  w->clear(g, w);
+  w->paint(g, w);
+  g->xwin = NULL;
+  g->repainted = 1;
+}
+
+static void process_event(struct gui *g, struct event *e)
+{
+  LOGD("processing event type %d\n", e->type);
+  switch (e->type) {
+  case REPACK: repack_event(g, ((struct repack_event *)e)->id); break;
+  case DIRTY: dirty_event(g, ((struct dirty_event *)e)->id); break;
+  }
+}
+
+/* TODO: events' compression */
+void gui_events(gui *_gui)
+{
+  struct gui *g = _gui;
+
+  LOGD("gui_events START: head %p\n", g->queued_events);
+
+  while (g->queued_events) {
+    struct event_list *cur = g->queued_events;
+    g->queued_events = cur->next;
+    if (g->queued_events) g->queued_events->last = cur->last;
+    if (cur->item != NULL) {
+      process_event(g, cur->item);
+      free_event(cur->item);
+    }
+    free(cur);
+  }
+  LOGD("gui_events DONE\n");
+}
diff --git a/common/utils/T/tracer/gui/gui.c b/common/utils/T/tracer/gui/gui.c
new file mode 100644
index 0000000000000000000000000000000000000000..f0d7dcbcb1faf04a7157cb7f763937403281d250
--- /dev/null
+++ b/common/utils/T/tracer/gui/gui.c
@@ -0,0 +1,34 @@
+#include "gui.h"
+#include "gui_defs.h"
+#include "x.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <pthread.h>
+
+int volatile gui_logd;
+
+void glock(gui *_gui)
+{
+  struct gui *g = _gui;
+  if (pthread_mutex_lock(g->lock)) ERR("mutex error\n");
+}
+
+void gunlock(gui *_gui)
+{
+  struct gui *g = _gui;
+  if (pthread_mutex_unlock(g->lock)) ERR("mutex error\n");
+}
+
+int new_color(gui *_gui, char *color)
+{
+  struct gui *g = _gui;
+  int ret;
+
+  glock(g);
+
+  ret = x_new_color(g->x, color);
+
+  gunlock(g);
+
+  return ret;
+}
diff --git a/common/utils/T/tracer/gui/gui.h b/common/utils/T/tracer/gui/gui.h
new file mode 100644
index 0000000000000000000000000000000000000000..27e6603042fa24d928933031d822609b5115f084
--- /dev/null
+++ b/common/utils/T/tracer/gui/gui.h
@@ -0,0 +1,105 @@
+#ifndef _GUI_H_
+#define _GUI_H_
+
+/* defines the public API of the GUI */
+
+typedef void gui;
+typedef void widget;
+
+#define HORIZONTAL 0
+#define VERTICAL   1
+
+#define BACKGROUND_COLOR 0
+#define FOREGROUND_COLOR 1
+
+#define DEFAULT_FONT 0
+
+/* key modifiers */
+#define KEY_SHIFT   (1<<0)
+#define KEY_CONTROL (1<<1)
+#define KEY_ALT     (1<<2)
+
+gui *gui_init(void);
+
+/* position = -1 to put at the end */
+void widget_add_child(gui *gui, widget *parent, widget *child, int position);
+void widget_del_child(gui *gui, widget *parent, widget *child);
+void widget_dirty(gui *gui, widget *this);
+
+widget *new_toplevel_window(gui *gui, int width, int height, char *title);
+widget *new_container(gui *gui, int vertical);
+widget *new_positioner(gui *gui);
+widget *new_label(gui *gui, const char *text);
+widget *new_xy_plot(gui *gui, int width, int height, char *label,
+    int vruler_width);
+widget *new_textlist(gui *gui, int width, int nlines, int background_color);
+widget *new_timeline(gui *gui, int width, int number_of_sublines,
+    int subline_height);
+widget *new_space(gui *gui, int width, int height);
+widget *new_image(gui *gui, unsigned char *data, int length);
+
+void label_set_clickable(gui *gui, widget *label, int clickable);
+
+void container_set_child_growable(gui *_gui, widget *_this,
+    widget *child, int growable);
+
+int xy_plot_new_plot(gui *gui, widget *this, int color);
+void xy_plot_set_range(gui *gui, widget *this,
+    float xmin, float xmax, float ymin, float ymax);
+void xy_plot_set_points(gui *gui, widget *this,
+    int plot, int npoints, float *x, float *y);
+void xy_plot_get_dimensions(gui *gui, widget *this, int *width, int *height);
+
+void textlist_add(gui *gui, widget *this, const char *text, int position,
+    int color);
+void textlist_del(gui *gui, widget *this, int position);
+void textlist_add_silent(gui *gui, widget *this, const char *text,
+    int position, int color);
+void textlist_del_silent(gui *gui, widget *this, int position);
+void textlist_state(gui *_gui, widget *_this,
+    int *visible_lines, int *start_line, int *number_of_lines);
+void textlist_set_start_line(gui *gui, widget *this, int line);
+void textlist_get_line(gui *gui, widget *this, int line,
+    char **text, int *color);
+void textlist_set_color(gui *gui, widget *this, int line, int color);
+
+void timeline_clear(gui *gui, widget *this);
+void timeline_clear_silent(gui *gui, widget *this);
+void timeline_add_points(gui *gui, widget *this, int subline, int color,
+    int *x, int len);
+void timeline_add_points_silent(gui *gui, widget *this, int subline,
+    int color, int *x, int len);
+void timeline_set_subline_background_color(gui *gui, widget *this,
+    int subline, int color);
+void timeline_get_width(gui *gui, widget *this, int *width);
+
+void gui_loop(gui *gui);
+
+void glock(gui *gui);
+void gunlock(gui *gui);
+
+int new_color(gui *gui, char *color);
+
+/* notifications */
+/* known notifications:
+ * - textlist:
+ *      - scrollup   { int: key_modifiers }
+ *      - scrolldown { int: key_modifiers }
+ *      - click      { int [2]: line, button }
+ * - label:
+ *      - click      { int: button } (if enabled)
+ * - timeline
+ *      - resize     { int: width }
+ *      - scrollup   { int [3]: x, y, key_modifiers }
+ *      - scrolldown { int [3]: x, y, key_modifiers }
+ *      - click      { int: button }
+ */
+
+/* same type as in gui_defs.h */
+typedef void (*notifier)(void *private, gui *g,
+    char *notification, widget *w, void *notification_data);
+unsigned long register_notifier(gui *g, char *notification, widget *w,
+    notifier handler, void *private);
+void unregister_notifier(gui *g, unsigned long notifier_id);
+
+#endif /* _GUI_H_ */
diff --git a/common/utils/T/tracer/gui/gui_defs.h b/common/utils/T/tracer/gui/gui_defs.h
new file mode 100644
index 0000000000000000000000000000000000000000..ec72bb0e2bb14e8951f8bf7e5d3acda960109de8
--- /dev/null
+++ b/common/utils/T/tracer/gui/gui_defs.h
@@ -0,0 +1,255 @@
+#ifndef _GUI_DEFS_H_
+#define _GUI_DEFS_H_
+
+/* defines the private API of the GUI */
+
+extern int volatile gui_logd;
+#define LOGD(...) do { if (gui_logd) printf(__VA_ARGS__); } while (0)
+
+/*************************************************************************/
+/*                            logging macros                             */
+/*************************************************************************/
+
+#define ERR(...) \
+  do { \
+    printf("%s:%d:%s: ERROR: ", __FILE__, __LINE__, __FUNCTION__); \
+    printf(__VA_ARGS__); \
+    abort(); \
+  } while (0)
+
+#define WARN(...) \
+  do { \
+    printf("%s:%d:%s: WARNING: ", __FILE__, __LINE__, __FUNCTION__); \
+    printf(__VA_ARGS__); \
+  } while (0)
+
+#define OOM ERR("out of memory\n")
+
+/*************************************************************************/
+/*                             widgets                                   */
+/*************************************************************************/
+
+enum widget_type {
+  TOPLEVEL_WINDOW, CONTAINER, POSITIONER, TEXT_LIST, XY_PLOT, BUTTON, LABEL,
+  TIMELINE, SPACE, IMAGE
+};
+
+struct widget_list;
+
+struct widget {
+  enum widget_type type;
+  int id;
+  int x;            /* allocated x after packing */
+  int y;            /* allocated y after packing */
+  int width;        /* allocated width after packing */
+  int height;       /* allocated height after packing */
+  struct widget_list *children;
+  struct widget *parent;
+  void (*repack)(gui *g, widget *this);
+  void (*add_child)(gui *g, widget *this, widget *child, int position);
+  void (*del_child)(gui *g, widget *this, widget *child);
+  void (*allocate)(gui *g, widget *this, int x, int y, int width, int height);
+  void (*hints)(gui *g, widget *this, int *width, int *height);
+  void (*paint)(gui *g, widget *this);
+  void (*clear)(gui *g, widget *this);
+  /* user input */
+  void (*button)(gui *g, widget *this, int x, int y, int key_modifiers,
+      int button, int up);
+};
+
+struct widget_list {
+  struct widget *item;
+  struct widget_list *next;
+  //struct widget_list *prev;  /* unused? */
+  struct widget_list *last;  /* valid only for the head of the list */
+};
+
+struct toplevel_window_widget {
+  struct widget common;
+  void *x;                /* opaque X data (type x_window), used in x.c */
+};
+
+struct container_widget {
+  struct widget common;
+  int vertical;
+  int hints_are_valid;     /* used to cache hints values */
+  int hint_width;          /* cached hint values - invalid if */
+  int hint_height;         /* repack_was_called == 1          */
+  int *growable;
+  int nchildren;
+};
+
+struct positioner_widget {
+  struct widget common;
+};
+
+struct textlist_widget {
+  struct widget common;
+  char **text;
+  int *color;
+  int text_count;
+  int wanted_width;
+  int wanted_nlines;    /* number of lines of text the user wants to see */
+  int allocated_nlines; /* actual number of visible lines */
+  int starting_line;    /* points to the first visible line of text */
+  int line_height;
+  int baseline;
+  int background_color;
+};
+
+struct xy_plot_plot {
+  float *x;
+  float *y;
+  int npoints;
+  int color;
+};
+
+struct xy_plot_widget {
+  struct widget common;
+  char *label;
+  int label_width;
+  int label_height;
+  int label_baseline;
+  int vrule_width;       /* the width of the vertical ruler text zone */
+  float xmin, xmax;
+  float ymin, ymax;
+  int wanted_width;
+  int wanted_height;
+  struct xy_plot_plot *plots;
+  int nplots;
+};
+
+struct timeline_subline {
+  int *color;                  /* length = width of timeline widget
+                                * value = -1 if no color
+                                */
+  int width;
+  int background;              /* background color of the subline */
+};
+
+struct timeline_widget {
+  struct widget common;
+  int n;                         /* number of sublines */
+  struct timeline_subline *s;
+  int subline_height;
+  int wanted_width;
+};
+
+struct button_widget {
+  struct widget common;
+};
+
+struct label_widget {
+  struct widget common;
+  const char *t;
+  int color;
+  int width;         /* as given by the graphic's backend */
+  int height;        /* as given by the graphic's backend */
+  int baseline;      /* as given by the graphic's backend */
+};
+
+struct space_widget {
+  struct widget common;
+  int wanted_width;
+  int wanted_height;
+};
+
+struct image_widget {
+  struct widget common;
+  int width;
+  int height;
+  void *x;             /* opaque X data (type x_image), used in x.c */
+};
+
+/*************************************************************************/
+/*                             events                                    */
+/*************************************************************************/
+
+typedef void event;
+
+enum event_type {
+  DIRTY, REPACK
+};
+
+struct event {
+  enum event_type type;
+};
+
+struct event_list {
+  struct event *item;
+  struct event_list *next;
+  struct event_list *last;
+};
+
+struct dirty_event {
+  struct event common;
+  int id;
+};
+
+struct repack_event {
+  struct event common;
+  int id;
+};
+
+/*************************************************************************/
+/*                           notifications                               */
+/*************************************************************************/
+
+/* same type as in gui.h */
+typedef void (*notifier)(void *private, gui *g,
+    char *notification, widget *w, void *notification_data);
+
+struct notifier {
+  notifier handler;
+  unsigned long id;
+  char *notification;
+  widget *w;
+  void *private;
+  /* done is used bu gui_notify */
+  int done;
+};
+
+/*************************************************************************/
+/*                          main structure                               */
+/*************************************************************************/
+
+struct gui {
+  void                *lock;
+  void                *x; /* opaque X data (type x_connection), used in x.c */
+  struct widget_list  *toplevel;
+  struct event_list   *queued_events;
+  int                 event_pipe[2];
+  int                 next_id;         /* tells what is the ID of
+                                          the next created widget */
+  int                 repainted;       /* set to 1 when some widget has
+                                        * been repainted (TODO: can be any,
+                                        * to be optimized) */
+  void                *xwin;           /* set by a toplevel_window when
+                                        * it paints itself, to be used
+                                        * by its children */
+  struct notifier     *notifiers;
+  int                 notifiers_count;
+  unsigned long       next_notifier_id;
+};
+
+/*************************************************************************/
+/*                            internal functions                         */
+/*************************************************************************/
+
+widget *new_widget(struct gui *g, enum widget_type type, int size);
+void widget_add_child_internal(
+    gui *_gui, widget *parent, widget *child, int position);
+void widget_del_child_internal(gui *_gui, widget *parent, widget *child);
+int widget_get_child_position(gui *_gui, widget *parent, widget *child);
+
+const char *widget_name(enum widget_type type);
+
+void send_event(gui *gui, enum event_type type, ...);
+void gui_events(gui *gui);
+
+struct widget *find_widget(struct gui *g, int id);
+
+void gui_notify(struct gui *g, char *notification, widget *w,
+    void *notification_data);
+
+#endif /* _GUI_DEFS_H_ */
diff --git a/common/utils/T/tracer/gui/image.c b/common/utils/T/tracer/gui/image.c
new file mode 100644
index 0000000000000000000000000000000000000000..df9a7b8296ae40ea19221a4b1f8d65c20a899178
--- /dev/null
+++ b/common/utils/T/tracer/gui/image.c
@@ -0,0 +1,114 @@
+#include "gui.h"
+#include "gui_defs.h"
+#include "x.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <png.h>
+
+static void paint(gui *_gui, widget *_w)
+{
+  struct gui *g = _gui;
+  struct image_widget *w = _w;
+  LOGD("PAINT image %p\n", w);
+  x_draw_image(g->x, g->xwin, w->x, w->common.x, w->common.y);
+}
+
+static void hints(gui *_gui, widget *_w, int *width, int *height)
+{
+  struct image_widget *w = _w;
+  LOGD("HINTS image %p\n", w);
+  *width = w->width;
+  *height = w->height;
+}
+
+struct png_reader {
+  unsigned char *data;
+  int size;
+  int pos;
+};
+
+static void png_readfn(png_structp png_ptr, png_bytep data, png_size_t length)
+{
+  struct png_reader *r = png_get_io_ptr(png_ptr);
+  if (length > r->size - r->pos) png_error(png_ptr, "bad png image");
+  memcpy(data, r->data + r->pos, length);
+  r->pos += length;
+}
+
+static void load_image(struct gui *g, struct image_widget *w,
+    unsigned char *data, int length)
+{
+  png_structp png_ptr;
+  png_infop info_ptr;
+  png_bytepp image;
+  int width, height, bit_depth, color_type, channels;
+  unsigned char *img_data;
+  struct png_reader r;
+  int i;
+
+  /* unpack PNG data */
+
+  r.data = data;
+  r.size = length;
+  r.pos = 0;
+
+  png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
+  if (png_ptr == NULL) abort();
+
+  info_ptr = png_create_info_struct(png_ptr);
+  if (info_ptr == NULL) abort();
+
+  if (setjmp(png_jmpbuf(png_ptr))) abort();
+
+  png_set_read_fn(png_ptr, &r, png_readfn);
+
+  png_read_png(png_ptr, info_ptr,
+      PNG_TRANSFORM_STRIP_16 | PNG_TRANSFORM_EXPAND | PNG_TRANSFORM_PACKING |
+      PNG_TRANSFORM_GRAY_TO_RGB | PNG_TRANSFORM_BGR, NULL);
+
+  image = png_get_rows(png_ptr, info_ptr);
+
+  width = png_get_image_width(png_ptr, info_ptr);
+  height = png_get_image_height(png_ptr, info_ptr);
+  bit_depth = png_get_bit_depth(png_ptr, info_ptr);
+  color_type = png_get_color_type(png_ptr, info_ptr);
+  channels = png_get_channels(png_ptr, info_ptr);
+
+  if (width < 1 || width > 1000 || height < 1 || height > 1000 ||
+      bit_depth != 8 || color_type != PNG_COLOR_TYPE_RGBA || channels != 4)
+    { printf("bad image\n"); abort(); }
+
+  img_data = malloc(4 * width * height); if (img_data == NULL) abort();
+  for (i = 0; i < height; i++)
+    memcpy(img_data+i*4*width, image[i], width*4);
+
+  png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
+
+  /* create the X image */
+  w->x = x_create_image(g->x, img_data, width, height);
+
+  free(img_data);
+
+  w->width = width;
+  w->height = height;
+}
+
+widget *new_image(gui *_gui, unsigned char *data, int length)
+{
+  struct gui *g = _gui;
+  struct image_widget *w;
+
+  glock(g);
+
+  w = new_widget(g, IMAGE, sizeof(struct image_widget));
+
+  load_image(g, w, data, length);
+
+  w->common.paint = paint;
+  w->common.hints = hints;
+
+  gunlock(g);
+
+  return w;
+}
diff --git a/common/utils/T/tracer/gui/init.c b/common/utils/T/tracer/gui/init.c
new file mode 100644
index 0000000000000000000000000000000000000000..c6d5e3e435366b574b3495ee41b9c6df45621744
--- /dev/null
+++ b/common/utils/T/tracer/gui/init.c
@@ -0,0 +1,34 @@
+#include "gui.h"
+#include "gui_defs.h"
+#include "x.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <pthread.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+
+gui *gui_init(void)
+{
+  struct gui *ret;
+
+  ret = calloc(1, sizeof(struct gui));
+  if (ret == NULL) OOM;
+
+  ret->lock = malloc(sizeof(pthread_mutex_t));
+  if (ret->lock == NULL) OOM;
+  if (pthread_mutex_init(ret->lock, NULL))
+    ERR("mutex initialization failed\n");
+
+  if (pipe(ret->event_pipe))
+    ERR("%s\n", strerror(errno));
+
+  /* lock not necessary but there for consistency (when instrumenting x.c
+   * we need the gui to be locked when calling any function in x.c)
+   */
+  glock(ret);
+  ret->x = x_open();
+  gunlock(ret);
+
+  return ret;
+}
diff --git a/common/utils/T/tracer/gui/label.c b/common/utils/T/tracer/gui/label.c
new file mode 100644
index 0000000000000000000000000000000000000000..f649fa520147cb1bde0099bd9bab2f1330813423
--- /dev/null
+++ b/common/utils/T/tracer/gui/label.c
@@ -0,0 +1,83 @@
+#include "gui.h"
+#include "gui_defs.h"
+#include "x.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static void paint(gui *_gui, widget *_w)
+{
+  struct gui *g = _gui;
+  struct label_widget *l = _w;
+  LOGD("PAINT label '%s'\n", l->t);
+  x_draw_string(g->x, g->xwin, DEFAULT_FONT, l->color,
+      l->common.x, l->common.y + l->baseline, l->t);
+}
+
+static void hints(gui *_gui, widget *_w, int *width, int *height)
+{
+  struct label_widget *l = _w;
+  LOGD("HINTS label '%s'\n", l->t);
+  *width = l->width;
+  *height = l->height;
+}
+
+widget *new_label(gui *_gui, const char *label)
+{
+  struct gui *g = _gui;
+  struct label_widget *w;
+
+  glock(g);
+
+  w = new_widget(g, LABEL, sizeof(struct label_widget));
+
+  w->t = strdup(label);
+  if (w->t == NULL) OOM;
+  w->color = FOREGROUND_COLOR;
+
+  x_text_get_dimensions(g->x, DEFAULT_FONT, label,
+      &w->width, &w->height, &w->baseline);
+
+  w->common.paint = paint;
+  w->common.hints = hints;
+
+  gunlock(g);
+
+  return w;
+}
+
+static void button(gui *gui, widget *_this, int x, int y,
+    int key_modifiers, int button, int up)
+{
+  LOGD("BUTTON label %p xy %d %d button %d up %d\n", _this, x, y, button, up);
+
+  if (up != 0) return;
+
+  gui_notify(gui, "click", _this, &button);
+}
+
+/* we could use default_button, but it's in widget.c, so, well... */
+static void no_button(gui *gui, widget *_this, int x, int y,
+    int key_modifiers, int button, int up)
+{
+  /* do nothing */
+}
+
+/*************************************************************************/
+/*                             public functions                          */
+/*************************************************************************/
+
+void label_set_clickable(gui *_g, widget *_this, int clickable)
+{
+  struct gui *g = _g;
+  struct label_widget *this = _this;
+
+  glock(g);
+
+  if (clickable)
+    this->common.button = button;
+  else
+    this->common.button = no_button;
+
+  gunlock(g);
+}
diff --git a/common/utils/T/tracer/gui/loop.c b/common/utils/T/tracer/gui/loop.c
new file mode 100644
index 0000000000000000000000000000000000000000..8ceb3c06e1c4936dc508fea8e1ce8dc33b0d99c3
--- /dev/null
+++ b/common/utils/T/tracer/gui/loop.c
@@ -0,0 +1,66 @@
+#include "gui.h"
+#include "gui_defs.h"
+#include "x.h"
+#include <sys/select.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+
+void gui_loop(gui *_gui)
+{
+  struct gui *g = _gui;
+  int xfd;
+  int eventfd;
+  int maxfd;
+  fd_set rd;
+
+  /* lock not necessary but there for consistency (when instrumenting x.c
+   * we need the gui to be locked when calling any function in x.c)
+   */
+  glock(g);
+  xfd = x_connection_fd(g->x);
+  gunlock(g);
+  eventfd = g->event_pipe[0];
+
+  if (eventfd > xfd) maxfd = eventfd;
+  else               maxfd = xfd;
+
+  while (1) {
+    glock(g);
+    x_flush(g->x);
+    gunlock(g);
+    FD_ZERO(&rd);
+    FD_SET(xfd, &rd);
+    FD_SET(eventfd, &rd);
+    if (select(maxfd+1, &rd, NULL, NULL, NULL) == -1)
+      ERR("select: %s\n", strerror(errno));
+
+    glock(g);
+
+    if (FD_ISSET(xfd, &rd))
+      x_events(g);
+
+    if (FD_ISSET(eventfd, &rd)) {
+      char c[256];
+      if (read(eventfd, c, 256)); /* for no gcc warnings */
+    }
+
+    gui_events(g);
+
+    if (g->repainted) {
+      struct widget_list *cur;
+      g->repainted = 0;
+      cur = g->toplevel;
+      while (cur) {
+        struct toplevel_window_widget *w =
+            (struct toplevel_window_widget *)cur->item;
+        x_draw(g->x, w->x);
+        cur = cur->next;
+      }
+    }
+
+    gunlock(g);
+  }
+}
diff --git a/common/utils/T/tracer/gui/notify.c b/common/utils/T/tracer/gui/notify.c
new file mode 100644
index 0000000000000000000000000000000000000000..7ff40069411a1bd9bae7d0106b686c41b04b6ef6
--- /dev/null
+++ b/common/utils/T/tracer/gui/notify.c
@@ -0,0 +1,116 @@
+#include "gui.h"
+#include "gui_defs.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+unsigned long register_notifier(gui *_g, char *notification, widget *w,
+    notifier handler, void *private)
+{
+  struct gui *g = _g;
+  unsigned long ret;
+
+  glock(g);
+
+  if (g->next_notifier_id == 2UL * 1024 * 1024 * 1024)
+    ERR("%s:%d: report a bug\n", __FILE__, __LINE__);
+
+  g->notifiers = realloc(g->notifiers,
+      (g->notifiers_count+1) * sizeof(struct notifier));
+  if (g->notifiers == NULL) abort();
+
+  ret = g->next_notifier_id;
+
+  g->notifiers[g->notifiers_count].handler = handler;
+  g->notifiers[g->notifiers_count].id = g->next_notifier_id;
+  g->next_notifier_id++;
+  g->notifiers[g->notifiers_count].notification = strdup(notification);
+  if (g->notifiers[g->notifiers_count].notification == NULL) abort();
+  g->notifiers[g->notifiers_count].w = w;
+  g->notifiers[g->notifiers_count].private = private;
+  /* initialize done to 1 so as not to call the handler if it's created
+   * by the call of another one that is in progress
+   */
+  g->notifiers[g->notifiers_count].done = 1;
+
+  g->notifiers_count++;
+
+  gunlock(g);
+
+  return ret;
+}
+
+void unregister_notifier(gui *_g, unsigned long notifier_id)
+{
+  struct gui *g = _g;
+  int i;
+
+  glock(g);
+
+  for (i = 0; i < g->notifiers_count; i++)
+    if (g->notifiers[i].id == notifier_id) break;
+
+  if (i == g->notifiers_count)
+    ERR("%s:%d: notifier_id %ld not found\n", __FILE__,__LINE__,notifier_id);
+
+  free(g->notifiers[i].notification);
+
+  memmove(g->notifiers + i, g->notifiers + i + 1,
+      (g->notifiers_count-1 - i) * sizeof(struct notifier));
+
+  g->notifiers_count--;
+  g->notifiers = realloc(g->notifiers,
+      g->notifiers_count * sizeof(struct notifier));
+  if (g->notifiers == NULL) abort();
+
+  gunlock(g);
+}
+
+/* called with lock ON */
+void gui_notify(struct gui *g, char *notification, widget *w,
+    void *notification_data)
+{
+  void *private;
+  notifier handler;
+  int i;
+
+  /* this function is not re-entrant, for the moment keep as is
+   * and if the need is there, we'll make a new thread to handle
+   * notifications (or something)
+   * for now let's crash in case of recursive call
+   */
+  static int inside = 0;
+  if (inside) ERR("%s:%d: BUG! contact the authors\n", __FILE__, __LINE__);
+  inside = 1;
+
+  /* clear all handlers */
+  /* TODO: speedup */
+  for (i = 0; i < g->notifiers_count; i++) g->notifiers[i].done = 0;
+
+  /* calling the handler may modify the list of notifiers, we
+   * need to be careful here
+   */
+loop:
+  for (i = 0; i < g->notifiers_count; i++) {
+    if (g->notifiers[i].done == 1 ||
+        g->notifiers[i].w != w    ||
+        strcmp(g->notifiers[i].notification, notification) != 0)
+      continue;
+    break;
+  }
+  if (i == g->notifiers_count) goto done;
+
+  g->notifiers[i].done = 1;
+
+  handler = g->notifiers[i].handler;
+  private = g->notifiers[i].private;
+
+  gunlock(g);
+  handler(private, g, notification, w, notification_data);
+  glock(g);
+
+  goto loop;
+
+done:
+  inside = 0;
+}
diff --git a/common/utils/T/tracer/gui/positioner.c b/common/utils/T/tracer/gui/positioner.c
new file mode 100644
index 0000000000000000000000000000000000000000..673ffb32ded28295032e76e96626a179f11d8d23
--- /dev/null
+++ b/common/utils/T/tracer/gui/positioner.c
@@ -0,0 +1,93 @@
+#include "gui.h"
+#include "gui_defs.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static void add_child(gui *g, widget *_this, widget *child, int position)
+{
+  LOGD("ADD_CHILD positioner\n");
+  struct positioner_widget *this = _this;
+  widget_add_child_internal(g, this, child, position);
+}
+
+static void del_child(gui *g, widget *_this, widget *child)
+{
+  LOGD("DEL_CHILD positioner\n");
+  struct positioner_widget *this = _this;
+  widget_del_child_internal(g, this, child);
+}
+
+static void allocate(
+    gui *_g, widget *_this, int x, int y, int width, int height)
+{
+  LOGD("ALLOCATE positioner %p\n", _this);
+  struct gui *g = _g;
+  struct positioner_widget *this = _this;
+  struct widget_list *l = this->common.children;
+  int cwidth, cheight;
+
+  this->common.x = x;
+  this->common.y = y;
+  this->common.width = width;
+  this->common.height = height;
+
+  if (l != NULL) {
+    l->item->hints(g, l->item, &cwidth, &cheight);
+    l->item->allocate(g, l->item, x+(width-cwidth)/2, y+(height-cheight)/2,
+        cwidth, cheight);
+  }
+}
+
+static void hints(gui *_gui, widget *_w, int *width, int *height)
+{
+  LOGD("HINTS positioner %p\n", _w);
+  struct gui *g = _gui;
+  struct positioner_widget *this = _w;
+  struct widget_list *l = this->common.children;
+  if (l != NULL)
+    l->item->hints(g, l->item, width, height);
+  else { *width = *height = 1; }
+}
+
+static void button(gui *_g, widget *_this, int x, int y,
+    int key_modifiers, int button, int up)
+{
+  LOGD("BUTTON positioner %p xy %d %d button %d up %d\n", _this, x, y, button, up);
+  struct gui *g = _g;
+  struct positioner_widget *this = _this;
+  struct widget_list *l = this->common.children;
+  if (l != NULL)
+    l->item->button(g, l->item, x, y, key_modifiers, button, up);
+}
+
+static void paint(gui *_gui, widget *_this)
+{
+  LOGD("PAINT positioner\n");
+  struct gui *g = _gui;
+  struct widget *this = _this;
+  struct widget_list *l = this->children;
+  if (l != NULL)
+    l->item->paint(g, l->item);
+}
+
+widget *new_positioner(gui *_gui)
+{
+  struct gui *g = _gui;
+  struct positioner_widget *w;
+
+  glock(g);
+
+  w = new_widget(g, POSITIONER, sizeof(struct positioner_widget));
+
+  w->common.paint     = paint;
+  w->common.add_child = add_child;
+  w->common.del_child = del_child;
+  w->common.allocate  = allocate;
+  w->common.hints     = hints;
+  w->common.button    = button;
+
+  gunlock(g);
+
+  return w;
+}
diff --git a/common/utils/T/tracer/gui/space.c b/common/utils/T/tracer/gui/space.c
new file mode 100644
index 0000000000000000000000000000000000000000..c98600b88dc6edecac53d1e0417d533a312c1c4e
--- /dev/null
+++ b/common/utils/T/tracer/gui/space.c
@@ -0,0 +1,36 @@
+#include "gui.h"
+#include "gui_defs.h"
+#include <stdio.h>
+
+static void paint(gui *_gui, widget *_w)
+{
+  /* nothing */
+}
+
+static void hints(gui *_gui, widget *_w, int *width, int *height)
+{
+  struct space_widget *w = _w;
+  LOGD("HINTS space %p\n", w);
+  *width = w->wanted_width;
+  *height = w->wanted_height;
+}
+
+widget *new_space(gui *_gui, int width, int height)
+{
+  struct gui *g = _gui;
+  struct space_widget *w;
+
+  glock(g);
+
+  w = new_widget(g, SPACE, sizeof(struct space_widget));
+
+  w->wanted_width = width;
+  w->wanted_height = height;
+
+  w->common.paint = paint;
+  w->common.hints = hints;
+
+  gunlock(g);
+
+  return w;
+}
diff --git a/common/utils/T/tracer/gui/test.c b/common/utils/T/tracer/gui/test.c
new file mode 100644
index 0000000000000000000000000000000000000000..f64d02347e3383eb7b039156fc07db4585df5d6a
--- /dev/null
+++ b/common/utils/T/tracer/gui/test.c
@@ -0,0 +1,46 @@
+#include "gui.h"
+
+int main(void)
+{
+  gui *g;
+  widget *w, *c1, *c2, *l, *plot, *tl;
+  int tlcol;
+
+  g = gui_init();
+
+  c1 = new_container(g, VERTICAL);
+  c2 = new_container(g, HORIZONTAL);
+
+  l = new_label(g, "this is a good label");
+  widget_add_child(g, c2, l, 0);
+  l = new_label(g, "this is another good label");
+  widget_add_child(g, c2, l, -1);
+
+  l = new_label(g, "OH! WHAT A LABEL!");
+  widget_add_child(g, c1, l, -1);
+
+  widget_add_child(g, c1, c2, 0);
+
+  plot = new_xy_plot(g, 100, 100, "xy plot test", 30);
+#if 0
+  c2 = new_container(g, HORIZONTAL);
+  widget_add_child(g, c2, plot, -1);
+  widget_add_child(g, c1, c2, -1);
+#else
+  widget_add_child(g, c1, plot, -1);
+#endif
+
+  tlcol = new_color(g, "#ddf");
+  tl = new_textlist(g, 300, 10, tlcol);
+  widget_add_child(g, c1, tl, -1);
+
+  textlist_add(g, tl, "hello", -1, FOREGROUND_COLOR);
+  textlist_add(g, tl, "world", -1, FOREGROUND_COLOR);
+
+  w = new_toplevel_window(g, 500, 400, "test window");
+  widget_add_child(g, w, c1, 0);
+
+  gui_loop(g);
+
+  return 0;
+}
diff --git a/common/utils/T/tracer/gui/textlist.c b/common/utils/T/tracer/gui/textlist.c
new file mode 100644
index 0000000000000000000000000000000000000000..e919b7c0a51fcc6b14cd9449388e99bd7773bb2d
--- /dev/null
+++ b/common/utils/T/tracer/gui/textlist.c
@@ -0,0 +1,248 @@
+#include "gui.h"
+#include "gui_defs.h"
+#include "x.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static void paint(gui *_gui, widget *_this)
+{
+  struct gui *g = _gui;
+  struct textlist_widget *this = _this;
+  int i, j;
+  LOGD("PAINT textlist %p xywh %d %d %d %d starting line %d allocated nlines %d text_count %d\n", _this, this->common.x, this->common.y, this->common.width, this->common.height, this->starting_line, this->allocated_nlines, this->text_count);
+  x_fill_rectangle(g->x, g->xwin, this->background_color,
+      this->common.x, this->common.y,
+      this->common.width, this->common.height);
+  for (i = 0, j = this->starting_line;
+       i < this->allocated_nlines && j < this->text_count; i++, j++)
+    x_draw_clipped_string(g->x, g->xwin, DEFAULT_FONT, this->color[j],
+        this->common.x,
+        this->common.y + i * this->line_height + this->baseline,
+        this->text[j],
+        this->common.x, this->common.y,
+        this->common.width, this->common.height);
+}
+
+static void hints(gui *_gui, widget *_w, int *width, int *height)
+{
+  struct textlist_widget *w = _w;
+  *width = w->wanted_width;
+  *height = w->wanted_nlines * w->line_height;
+  LOGD("HINTS textlist wh %d %d\n", *width, *height);
+}
+
+static void allocate(
+    gui *gui, widget *_this, int x, int y, int width, int height)
+{
+  struct textlist_widget *this = _this;
+  this->common.x = x;
+  this->common.y = y;
+  this->common.width = width;
+  this->common.height = height;
+  this->allocated_nlines = height / this->line_height;
+  LOGD("ALLOCATE textlist %p xywh %d %d %d %d nlines %d\n", this, x, y, width, height, this->allocated_nlines);
+}
+
+static void button(gui *_g, widget *_this, int x, int y,
+    int key_modifiers, int button, int up)
+{
+  struct gui *g = _g;
+  struct textlist_widget *this = _this;
+  LOGD("BUTTON textlist %p xy %d %d button %d up %d\n", _this, x, y, button, up);
+  y -= this->common.y;
+  x -= this->common.x;
+  /* scroll up */
+  if (button == 4 && up == 0) {
+    gui_notify(g, "scrollup", _this, &key_modifiers);
+  }
+  /* scroll down */
+  if (button == 5 && up == 0) {
+    gui_notify(g, "scrolldown", _this, &key_modifiers);
+  }
+  /* button 1/2/3 click */
+  if (button >= 1 && button <= 3 && up == 0) {
+    int line = this->starting_line + y / this->line_height;
+    if (line >= 0 && line < this->text_count)
+      gui_notify(g, "click", _this, (int[2]){ line, button });
+  }
+}
+
+widget *new_textlist(gui *_gui, int width, int nlines, int bgcol)
+{
+  struct gui *g = _gui;
+  struct textlist_widget *w;
+  int dummy;
+
+  glock(g);
+
+  w = new_widget(g, TEXT_LIST, sizeof(struct textlist_widget));
+
+  w->wanted_nlines = nlines;
+  x_text_get_dimensions(g->x, DEFAULT_FONT, ".",
+      &dummy, &w->line_height, &w->baseline);
+  w->background_color = bgcol;
+  w->wanted_width = width;
+
+  w->common.paint = paint;
+  w->common.hints = hints;
+  w->common.allocate = allocate;
+
+  w->common.button = button;
+
+  gunlock(g);
+
+  return w;
+}
+
+/*************************************************************************/
+/*                             public functions                          */
+/*************************************************************************/
+
+static void _textlist_add(gui *_gui, widget *_this, const char *text,
+    int position, int color, int silent)
+{
+  struct gui *g = _gui;
+  struct textlist_widget *this = _this;
+
+  glock(g);
+
+  if (position < 0) position = this->text_count;
+  if (position > this->text_count) position = this->text_count;
+
+  this->text_count++;
+  this->text = realloc(this->text, this->text_count * sizeof(char *));
+  if (this->text == NULL) OOM;
+  this->color = realloc(this->color, this->text_count * sizeof(int));
+  if (this->color == NULL) OOM;
+
+  memmove(this->text + position + 1, this->text + position,
+          (this->text_count-1 - position) * sizeof(char *));
+  memmove(this->color + position + 1, this->color + position,
+          (this->text_count-1 - position) * sizeof(int));
+
+  this->text[position] = strdup(text); if (this->text[position] == NULL) OOM;
+  this->color[position] = color;
+
+  if (!silent) send_event(g, DIRTY, this->common.id);
+
+  gunlock(g);
+}
+
+static void _textlist_del(gui *_gui, widget *_this, int position, int silent)
+{
+  struct gui *g = _gui;
+  struct textlist_widget *this = _this;
+
+  glock(g);
+
+  /* TODO: useful check? */
+  if (this->text_count == 0) goto done;
+
+  if (position < 0) position = this->text_count;
+  if (position > this->text_count-1) position = this->text_count-1;
+
+  free(this->text[position]);
+
+  memmove(this->text + position, this->text + position + 1,
+          (this->text_count-1 - position) * sizeof(char *));
+  memmove(this->color + position, this->color + position + 1,
+          (this->text_count-1 - position) * sizeof(int));
+
+  this->text_count--;
+  this->text = realloc(this->text, this->text_count * sizeof(char *));
+  if (this->text == NULL) OOM;
+  this->color = realloc(this->color, this->text_count * sizeof(int));
+  if (this->color == NULL) OOM;
+
+  if (!silent) send_event(g, DIRTY, this->common.id);
+
+done:
+  gunlock(g);
+}
+
+void textlist_add(gui *gui, widget *this, const char *text, int position,
+    int color)
+{
+  _textlist_add(gui, this, text, position, color, 0);
+}
+
+void textlist_del(gui *gui, widget *this, int position)
+{
+  _textlist_del(gui, this, position, 0);
+}
+
+void textlist_add_silent(gui *gui, widget *this, const char *text,
+    int position, int color)
+{
+  _textlist_add(gui, this, text, position, color, 1);
+}
+
+void textlist_del_silent(gui *gui, widget *this, int position)
+{
+  _textlist_del(gui, this, position, 1);
+}
+
+void textlist_state(gui *_gui, widget *_this,
+    int *visible_lines, int *start_line, int *number_of_lines)
+{
+  struct gui *g = _gui;
+  struct textlist_widget *this = _this;
+
+  glock(g);
+
+  *visible_lines   = this->allocated_nlines;
+  *start_line      = this->starting_line;
+  *number_of_lines = this->text_count;
+
+  gunlock(g);
+}
+
+void textlist_set_start_line(gui *_gui, widget *_this, int line)
+{
+  struct gui *g = _gui;
+  struct textlist_widget *this = _this;
+
+  glock(g);
+
+  this->starting_line = line;
+
+  send_event(g, DIRTY, this->common.id);
+
+  gunlock(g);
+}
+
+void textlist_get_line(gui *_gui, widget *_this, int line,
+    char **text, int *color)
+{
+  struct gui *g = _gui;
+  struct textlist_widget *this = _this;
+
+  glock(g);
+
+  if (line < 0 || line >= this->text_count) {
+    *text = NULL;
+    *color = -1;
+  } else {
+    *text = this->text[line];
+    *color = this->color[line];
+  }
+
+  gunlock(g);
+}
+
+void textlist_set_color(gui *_gui, widget *_this, int line, int color)
+{
+  struct gui *g = _gui;
+  struct textlist_widget *this = _this;
+
+  glock(g);
+
+  if (line >= 0 && line < this->text_count) {
+    this->color[line] = color;
+
+    send_event(g, DIRTY, this->common.id);
+  }
+
+  gunlock(g);
+}
diff --git a/common/utils/T/tracer/gui/timeline.c b/common/utils/T/tracer/gui/timeline.c
new file mode 100644
index 0000000000000000000000000000000000000000..d2373ff60a4007f856c4349b339438852446b1bf
--- /dev/null
+++ b/common/utils/T/tracer/gui/timeline.c
@@ -0,0 +1,214 @@
+#include "gui.h"
+#include "gui_defs.h"
+#include "x.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+static void paint(gui *_gui, widget *_this)
+{
+  struct gui *g = _gui;
+  struct timeline_widget *this = _this;
+  int i;
+  int j;
+
+  for (i = 0; i < this->n; i++) {
+    x_fill_rectangle(g->x, g->xwin, this->s[i].background,
+        this->common.x, this->common.y + i * this->subline_height,
+        this->common.width, this->subline_height);
+    for (j = 0; j < this->s[i].width; j++)
+      if (this->s[i].color[j] != -1)
+        x_draw_line(g->x, g->xwin, this->s[i].color[j],
+            this->common.x + j, this->common.y + i * this->subline_height,
+            this->common.x + j, this->common.y + this->subline_height -1
+                + i * this->subline_height);
+  }
+
+  LOGD("PAINT timeline xywh %d %d %d %d\n", this->common.x, this->common.y, this->common.width, this->common.height);
+}
+
+static void hints(gui *_gui, widget *_w, int *width, int *height)
+{
+  struct timeline_widget *w = _w;
+  *width = w->wanted_width;
+  *height = w->n * w->subline_height;
+  LOGD("HINTS timeline wh %d %d\n", *width, *height);
+}
+
+static void allocate(gui *_gui, widget *_this,
+    int x, int y, int width, int height)
+{
+  struct timeline_widget *this = _this;
+  int i;
+  int j;
+  this->common.x = x;
+  this->common.y = y;
+  this->common.width = width;
+  this->common.height = height;
+  LOGD("ALLOCATE timeline %p xywh %d %d %d %d\n", this, x, y, width, height);
+  for (i = 0; i < this->n; i++) {
+    this->s[i].width = width;
+    this->s[i].color = realloc(this->s[i].color, width * sizeof(int));
+    if (this->s[i].color == NULL) abort();
+    for (j = 0; j < width; j++) this->s[i].color[j] = -1;
+  }
+  gui_notify(_gui, "resize", _this, &width);
+}
+
+static void button(gui *_g, widget *_this, int x, int y,
+    int key_modifiers, int button, int up)
+{
+  struct gui *g = _g;
+  struct timeline_widget *w = _this;
+  int d[3];
+  LOGD("BUTTON timeline %p xy %d %d button %d up %d\n", _this, x, y, button, up);
+  /* scroll up */
+  if (button == 4 && up == 0) {
+    d[0] = x - w->common.x;
+    d[1] = y - w->common.y;
+    d[2] = key_modifiers;
+    gui_notify(g, "scrollup", _this, d);
+  }
+  /* scroll down */
+  if (button == 5 && up == 0) {
+    d[0] = x - w->common.x;
+    d[1] = y - w->common.y;
+    d[2] = key_modifiers;
+    gui_notify(g, "scrolldown", _this, d);
+  }
+  /* button 1/2/3 */
+  if ((button == 1 || button == 2 || button == 3) && up == 0) {
+    gui_notify(g, "click", _this, &button);
+  }
+}
+
+/*************************************************************************/
+/*                           creation function                           */
+/*************************************************************************/
+
+widget *new_timeline(gui *_gui, int width, int number_of_sublines,
+    int subline_height)
+{
+  struct gui *g = _gui;
+  struct timeline_widget *w;
+  int i;
+  int j;
+
+  glock(g);
+
+  w = new_widget(g, TIMELINE, sizeof(struct timeline_widget));
+
+  w->wanted_width = width;
+  w->n = number_of_sublines;
+  w->s = calloc(w->n, sizeof(struct timeline_subline)); if (w->s == NULL) OOM;
+  w->subline_height = subline_height;
+
+  /* initialize colors */
+  for (i = 0; i < w->n; i++) {
+    w->s[i].width = width;
+    w->s[i].color = calloc(width, sizeof(int));
+    if (w->s[i].color == NULL) abort();
+    for (j = 0; j < width; j++) w->s[i].color[j] = -1;
+    w->s[i].background = BACKGROUND_COLOR;
+  }
+
+  w->common.paint = paint;
+  w->common.hints = hints;
+  w->common.allocate = allocate;
+  w->common.button = button;
+
+  gunlock(g);
+
+  return w;
+}
+
+/*************************************************************************/
+/*                           public functions                            */
+/*************************************************************************/
+
+static void _timeline_clear(gui *_gui, widget *_this, int silent)
+{
+  struct gui *g = _gui;
+  struct timeline_widget *this = _this;
+  int i;
+  int j;
+
+  glock(g);
+
+  for (i = 0; i < this->n; i++)
+    for (j = 0; j < this->s[i].width; j++)
+      this->s[i].color[j] = -1;
+
+  if (silent == 0)
+    send_event(g, DIRTY, this->common.id);
+
+  gunlock(g);
+}
+
+void timeline_clear(gui *_gui, widget *_this)
+{
+  _timeline_clear(_gui, _this, 0);
+}
+
+void timeline_clear_silent(gui *_gui, widget *_this)
+{
+  _timeline_clear(_gui, _this, 1);
+}
+
+static void _timeline_add_points(gui *_gui, widget *_this, int subline,
+    int color, int *x, int len, int silent)
+{
+  struct gui *g = _gui;
+  struct timeline_widget *this = _this;
+  int i;
+
+  glock(g);
+
+  for (i = 0; i < len; i++) {
+    if (x[i] >= this->s[subline].width) { WARN("out of bounds\n"); continue; }
+    this->s[subline].color[x[i]] = color;
+  }
+
+  if (silent == 0)
+    send_event(g, DIRTY, this->common.id);
+
+  gunlock(g);
+}
+
+void timeline_add_points(gui *_gui, widget *_this, int subline, int color,
+    int *x, int len)
+{
+  _timeline_add_points(_gui, _this, subline, color, x, len, 0);
+}
+
+void timeline_add_points_silent(gui *_gui, widget *_this, int subline,
+    int color, int *x, int len)
+{
+  _timeline_add_points(_gui, _this, subline, color, x, len, 1);
+}
+
+void timeline_set_subline_background_color(gui *_gui, widget *_this,
+    int subline, int color)
+{
+  struct gui *g = _gui;
+  struct timeline_widget *this = _this;
+
+  glock(g);
+
+  this->s[subline].background = color;
+
+  send_event(g, DIRTY, this->common.id);
+
+  gunlock(g);
+}
+
+void timeline_get_width(gui *_gui, widget *_this, int *width)
+{
+  struct gui *g = _gui;
+  struct timeline_widget *this = _this;
+
+  glock(g);
+
+  *width = this->common.width == 0 ? this->wanted_width : this->common.width;
+
+  gunlock(g);
+}
diff --git a/common/utils/T/tracer/gui/toplevel_window.c b/common/utils/T/tracer/gui/toplevel_window.c
new file mode 100644
index 0000000000000000000000000000000000000000..d2436c84f9a0b2dcea2442d07c2ba528d294bd57
--- /dev/null
+++ b/common/utils/T/tracer/gui/toplevel_window.c
@@ -0,0 +1,97 @@
+#include "gui.h"
+#include "gui_defs.h"
+#include "x.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+/**********************************************************************/
+/*                         callback functions                         */
+/**********************************************************************/
+
+static void repack(gui *g, widget *_this)
+{
+  LOGD("REPACK toplevel_window\n");
+  struct toplevel_window_widget *this = _this;
+  if (this->common.children == NULL) ERR("toplevel window has no child\n");
+  if (this->common.children->next != NULL)
+    ERR("toplevel window has too much children\n");
+  this->common.children->item->allocate(g, this->common.children->item,
+      0 /* x */, 0 /* y */, this->common.width, this->common.height);
+  send_event(g, DIRTY, this->common.id);
+}
+
+static void add_child(gui *_gui, widget *_this, widget *child, int position)
+{
+  LOGD("ADD_CHILD toplevel_window\n");
+  struct widget *this = _this;
+  if (this->children != NULL) {
+    WARN("toplevel window already has a child\n");
+    return;
+  }
+  widget_add_child_internal(_gui, _this, child, 0); /* this does the REPACK */
+}
+
+/* called when the underlying window is resized by the user or the system */
+static void allocate(
+    gui *_gui, widget *_this, int x, int y, int width, int height)
+{
+  LOGD("ALLOCATE toplevel_window\n");
+  struct toplevel_window_widget *this = _this;
+  this->common.width = width;
+  this->common.height = height;
+//  repack(_gui, _this);
+  send_event(_gui, REPACK, this->common.id);
+}
+
+static void paint(gui *_gui, widget *_this)
+{
+  struct gui *g = _gui;
+  struct toplevel_window_widget *this = _this;
+  LOGD("PAINT toplevel_window (%d %d)\n", this->common.width, this->common.height);
+  x_fill_rectangle(g->x, this->x, BACKGROUND_COLOR,
+      0, 0, this->common.width, this->common.height);
+  g->xwin = this->x;
+  this->common.children->item->paint(_gui, this->common.children->item);
+  g->xwin = NULL;    /* TODO: remove? it's just in case */
+}
+
+static void button(gui *_g, widget *_this, int x, int y,
+    int key_modifiers, int button, int up)
+{
+  struct gui *g = _g;
+  struct toplevel_window_widget *this = _this;
+  g->xwin = this->x;
+  this->common.children->item->button(_g, this->common.children->item,
+      x, y, key_modifiers, button, up);
+  g->xwin = NULL;    /* TODO: remove? it's just in case */
+}
+
+/**********************************************************************/
+/*                              creation                              */
+/**********************************************************************/
+
+widget *new_toplevel_window(gui *_gui, int width, int height, char *title)
+{
+  struct gui *g = _gui;
+  struct toplevel_window_widget *w;
+
+  glock(g);
+
+  w = new_widget(g, TOPLEVEL_WINDOW, sizeof(struct toplevel_window_widget));
+
+  w->common.width  = width;
+  w->common.height = height;
+
+  w->x = x_create_window(g->x, width, height, title);
+
+  w->common.repack    = repack;
+  w->common.add_child = add_child;
+  w->common.allocate  = allocate;
+  w->common.paint     = paint;
+
+  w->common.button    = button;
+
+  gunlock(g);
+
+  return w;
+}
diff --git a/common/utils/T/tracer/gui/widget.c b/common/utils/T/tracer/gui/widget.c
new file mode 100644
index 0000000000000000000000000000000000000000..362d2e1e4898c39960033fe206518d902a3ba897
--- /dev/null
+++ b/common/utils/T/tracer/gui/widget.c
@@ -0,0 +1,322 @@
+#include "gui.h"
+#include "gui_defs.h"
+#include "x.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+
+static void default_clear(gui *gui, widget *_this);
+static void default_repack(gui *gui, widget *_this);
+static void default_allocate(
+    gui *gui, widget *_this, int x, int y, int width, int height);
+static void default_add_child(
+    gui *_gui, widget *_this, widget *child, int position);
+static void default_del_child(gui *_gui, widget *_this, widget *child);
+static void default_hints(gui *g, widget *this, int *width, int *height);
+static void default_button(gui *gui, widget *_this, int x, int y,
+    int key_modifiers, int button, int up);
+
+static void toplevel_list_append(struct gui *g, struct widget *e)
+{
+  struct widget_list *new;
+
+  new = calloc(1, sizeof(struct widget_list));
+  if (new == NULL) OOM;
+
+  new->item = e;
+
+  if (g->toplevel == NULL) {
+    g->toplevel = new;
+    new->last = new;
+    return;
+  }
+
+  g->toplevel->last->next = new;
+  g->toplevel->last = new;
+}
+
+widget *new_widget(struct gui *g, enum widget_type type, int size)
+{
+  struct widget *ret;
+
+  //glock(g);
+
+  ret = calloc(1, size);
+  if (ret == NULL) OOM;
+
+  ret->clear     = default_clear;
+  ret->repack    = default_repack;
+  ret->add_child = default_add_child;
+  ret->del_child = default_del_child;
+  ret->allocate  = default_allocate;
+  ret->hints     = default_hints;
+  ret->button    = default_button;
+  /* there is no default paint, on purpose */
+
+  ret->type      = type;
+  ret->id        = g->next_id;
+  g->next_id++;
+  ret->width     = 0;
+  ret->height    = 0;
+
+  /* add toplevel windows to g->toplevel */
+  if (type == TOPLEVEL_WINDOW)
+    toplevel_list_append(g, ret);
+
+  //gunlock(g);
+
+  return ret;
+}
+
+/*************************************************************************/
+/*                          internal functions                           */
+/*************************************************************************/
+
+void widget_add_child_internal(
+    gui *_gui, widget *parent, widget *child, int position)
+{
+  struct widget *p = parent;
+  struct widget *c = child;
+  struct widget_list *new;
+  struct widget_list *prev, *cur;
+  int i;
+
+  new = calloc(1, sizeof(struct widget_list));
+  if (new == NULL) OOM;
+
+  new->item = c;
+  c->parent = p;
+
+  prev = NULL;
+  cur = p->children;
+
+  for (i = 0; position < 0 || i < position; i++) {
+    if (cur == NULL) break;
+    prev = cur;
+    cur = cur->next;
+  }
+
+  /* TODO: warn/err if i != position+1? */
+
+  if (prev == NULL) {
+    /* new is at head */
+    new->next = p->children;
+    if (p->children != NULL) new->last = p->children->last;
+    else                     new->last = new;
+    p->children = new;
+    goto repack;
+  }
+
+  if (cur == NULL) {
+    /* new is at tail */
+    prev->next = new;
+    p->children->last = new;
+    goto repack;
+  }
+
+  /* new is between two existing items */
+  prev->next = new;
+  new->next = cur;
+
+repack:
+  send_event(_gui, REPACK, p->id);
+}
+
+void widget_del_child_internal(gui *_gui, widget *parent, widget *child)
+{
+  struct widget *p = parent;
+  struct widget *c = child;
+  struct widget_list *prev, *cur;
+
+  c->parent = NULL;
+
+  prev = NULL;
+  cur = p->children;
+
+  while (cur != NULL && cur->item != c) {
+    prev = cur;
+    cur = cur->next;
+  }
+
+  if (cur == NULL) ERR("child not found\n");
+
+  if (prev == NULL) {
+    /* child is at head */
+    p->children = cur->next;
+    if (p->children != NULL) p->children->last = cur->last;
+    goto done;
+  }
+
+  if (cur->next == NULL) {
+    /* child is last (and prev is != NULL) */
+    prev->next = NULL;
+    p->children->last = prev;
+    goto done;
+  }
+
+  /* child is between two existing items */
+  prev->next = cur->next;
+
+done:
+  free(cur);
+  send_event(_gui, REPACK, p->id);
+}
+
+int widget_get_child_position(gui *_gui, widget *parent, widget *child)
+{
+  struct widget *p = parent;
+  struct widget *c = child;
+  struct widget_list *cur;
+  int i = 0;
+
+  cur = p->children;
+
+  while (cur != NULL && cur->item != c) {
+    cur = cur->next;
+    i++;
+  }
+
+  if (cur == NULL) return -1;
+  return i;
+}
+
+/*************************************************************************/
+/*                           default functions                           */
+/*************************************************************************/
+
+static void default_clear(gui *_gui, widget *_this)
+{
+  struct gui *g = _gui;
+  struct widget *this = _this;
+  x_fill_rectangle(g->x, g->xwin, BACKGROUND_COLOR,
+      this->x, this->y, this->width, this->height);
+}
+
+static void default_repack(gui *gui, widget *_this)
+{
+  struct widget *this = _this;
+  return this->parent->repack(gui, this->parent);
+}
+
+static void default_add_child(
+    gui *_gui, widget *_this, widget *child, int position)
+{
+  struct widget *this = _this;
+  WARN("cannot add child to widget %s\n", widget_name(this->type));
+}
+
+static void default_del_child( gui *_gui, widget *_this, widget *child)
+{
+  struct widget *this = _this;
+  WARN("cannot del child from widget %s\n", widget_name(this->type));
+}
+
+static void default_allocate(
+    gui *gui, widget *_this, int x, int y, int width, int height)
+{
+  struct widget *this = _this;
+  this->x = x;
+  this->y = y;
+  this->width = width;
+  this->height = height;
+}
+
+static void default_hints(gui *g, widget *this, int *width, int *height)
+{
+  *width = 1;
+  *height = 1;
+}
+
+static void default_button(gui *gui, widget *_this, int x, int y,
+    int key_modifiers, int button, int up)
+{
+  /* nothing */
+}
+
+/*************************************************************************/
+/*                             utils functions                           */
+/*************************************************************************/
+
+void widget_add_child(gui *_gui, widget *parent, widget *child, int position)
+{
+  struct widget *this = parent;
+  glock(_gui);
+  this->add_child(_gui, parent, child, position);
+  gunlock(_gui);
+}
+
+void widget_del_child(gui *_gui, widget *parent, widget *child)
+{
+  struct widget *this = parent;
+  glock(_gui);
+  this->del_child(_gui, parent, child);
+  gunlock(_gui);
+}
+
+void widget_dirty(gui *_gui, widget *_this)
+{
+  struct gui *g = _gui;
+  struct widget *this = _this;
+  glock(g);
+  send_event(g, DIRTY, this->id);
+  gunlock(g);
+}
+
+static const char *names[] = {
+  "TOPLEVEL_WINDOW", "CONTAINER", "POSITIONER", "TEXT_LIST",
+  "XY_PLOT", "BUTTON", "LABEL", "TIMELINE", "SPACE", "IMAGE"
+};
+const char *widget_name(enum widget_type type)
+{
+  switch (type) {
+  case TOPLEVEL_WINDOW:
+  case CONTAINER:
+  case POSITIONER:
+  case TEXT_LIST:
+  case XY_PLOT:
+  case BUTTON:
+  case LABEL:
+  case TIMELINE:
+  case SPACE:
+  case IMAGE:
+    return names[type];
+  }
+  return "UNKNOWN (error)";
+}
+
+/*************************************************************************/
+/*                             find a widget                             */
+/*************************************************************************/
+
+/* TODO: optimize traversal and also use a cache */
+struct widget *_find_widget(struct widget *c, int id)
+{
+  struct widget_list *l;
+  struct widget *ret;
+  if (c == NULL) return NULL;
+  if (c->id == id) return c;
+  l = c->children;
+  while (l) {
+    ret = _find_widget(l->item, id);
+    if (ret != NULL) return ret;
+    l = l->next;
+  }
+  return NULL;
+}
+
+struct widget *find_widget(struct gui *g, int id)
+{
+  struct widget_list *l;
+  struct widget *ret;
+
+  l = g->toplevel;
+
+  while (l) {
+    ret = _find_widget(l->item, id);
+    if (ret != NULL) return ret;
+    l = l->next;
+  }
+
+  return NULL;
+}
diff --git a/common/utils/T/tracer/gui/x.c b/common/utils/T/tracer/gui/x.c
new file mode 100644
index 0000000000000000000000000000000000000000..af3d05cc14b68936fa6be574e35b8e53f0201e21
--- /dev/null
+++ b/common/utils/T/tracer/gui/x.c
@@ -0,0 +1,435 @@
+#include "x.h"
+#include "x_defs.h"
+#include "gui_defs.h"
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int x_connection_fd(x_connection *_x)
+{
+  struct x_connection *x = _x;
+  return ConnectionNumber(x->d);
+}
+
+static GC create_gc(Display *d, char *color)
+{
+  GC ret = XCreateGC(d, DefaultRootWindow(d), 0, NULL);
+  XGCValues gcv;
+  XColor rcol, scol;
+
+  XCopyGC(d, DefaultGC(d, DefaultScreen(d)), -1L, ret);
+  if (XAllocNamedColor(d, DefaultColormap(d, DefaultScreen(d)),
+                      color, &scol, &rcol)) {
+    gcv.foreground = scol.pixel;
+    XChangeGC(d, ret, GCForeground, &gcv);
+  } else ERR("X: could not allocate color '%s'\n", color);
+
+  return ret;
+}
+
+int x_new_color(x_connection *_x, char *color)
+{
+  struct x_connection *x = _x;
+  x->ncolors++;
+
+  x->colors = realloc(x->colors, x->ncolors * sizeof(GC));
+  if (x->colors == NULL) OOM;
+  x->colors[x->ncolors-1] = create_gc(x->d, color);
+
+  x->xft_colors = realloc(x->xft_colors, x->ncolors * sizeof(XftColor));
+  if (x->xft_colors == NULL) OOM;
+  if (XftColorAllocName(x->d, DefaultVisual(x->d, DefaultScreen(x->d)),
+      DefaultColormap(x->d, DefaultScreen(x->d)),
+      color, &x->xft_colors[x->ncolors-1]) == False)
+    ERR("could not allocate color '%s'\n", color);
+
+  return x->ncolors - 1;
+}
+
+int x_new_font(x_connection *_x, char *font)
+{
+  struct x_connection *x = _x;
+  /* TODO: allocate fonts only once */
+  x->nfonts++;
+  x->fonts = realloc(x->fonts, x->nfonts * sizeof(XftFont *));
+  if (x->fonts == NULL) OOM;
+  x->fonts[x->nfonts-1] = XftFontOpenName(x->d, DefaultScreen(x->d), font);
+  if (x->fonts[x->nfonts-1] == NULL)
+    ERR("failed allocating font '%s'\n", font);
+  return x->nfonts - 1;
+}
+
+x_connection *x_open(void)
+{
+  struct x_connection *ret;
+
+  ret = calloc(1, sizeof(struct x_connection));
+  if (ret == NULL) OOM;
+
+  ret->d = XOpenDisplay(0);
+  LOGD("XOpenDisplay display %p return x_connection %p\n", ret->d, ret);
+  if (ret->d == NULL) ERR("error calling XOpenDisplay: no X? you root?\n");
+
+  x_new_color(ret, "white");    /* background color */
+  x_new_color(ret, "black");    /* foreground color */
+
+  x_new_font(ret, "sans-8");
+
+  return ret;
+}
+
+x_window *x_create_window(x_connection *_x, int width, int height,
+    char *title)
+{
+  struct x_connection *x = _x;
+  struct x_window *ret;
+
+  ret = calloc(1, sizeof(struct x_window));
+  if (ret == NULL) OOM;
+
+  ret->w = XCreateSimpleWindow(x->d, DefaultRootWindow(x->d), 0, 0,
+      width, height, 0, WhitePixel(x->d, DefaultScreen(x->d)),
+      WhitePixel(x->d, DefaultScreen(x->d)));
+  ret->width = width;
+  ret->height = height;
+
+  XStoreName(x->d, ret->w, title);
+
+  ret->p = XCreatePixmap(x->d, ret->w, width, height,
+      DefaultDepth(x->d, DefaultScreen(x->d)));
+  XFillRectangle(x->d, ret->p, x->colors[BACKGROUND_COLOR],
+      0, 0, width, height);
+
+  ret->xft = XftDrawCreate(x->d, ret->p,
+      DefaultVisual(x->d, DefaultScreen(x->d)),
+      DefaultColormap(x->d, DefaultScreen(x->d)));
+  if (ret->xft == NULL) ERR("XftDrawCreate failed\n");
+
+  /* enable backing store */
+  {
+    XSetWindowAttributes att;
+    att.backing_store = Always;
+    XChangeWindowAttributes(x->d, ret->w, CWBackingStore, &att);
+  }
+
+  XSelectInput(x->d, ret->w,
+      KeyPressMask      |
+      ButtonPressMask   |
+      ButtonReleaseMask |
+      PointerMotionMask |
+      ExposureMask      |
+      StructureNotifyMask);
+
+  XMapWindow(x->d, ret->w);
+
+#if 0
+  /* wait for window to be mapped */
+  LOGD("wait for map\n");
+  while (1) {
+    XEvent ev;
+    //XWindowEvent(x->d, ret->w, StructureNotifyMask, &ev);
+    XWindowEvent(x->d, ret->w, ExposureMask, &ev);
+    LOGD("got ev %d\n", ev.type);
+    //if (ev.type == MapNotify) break;
+    if (ev.type == Expose) break;
+  }
+  LOGD("XXX create connection %p window %p (win id %d pixmap %d) w h %d %d\n", x, ret, (int)ret->w, (int)ret->p, width, height);
+#endif
+
+  return ret;
+}
+
+x_image *x_create_image(x_connection *_x, unsigned char *data,
+    int width, int height)
+{
+  struct x_connection *x = _x;
+  struct x_image *ret;
+  XImage *ximage;
+  XVisualInfo *vs;
+  XVisualInfo template;
+  int nvs;
+  Visual *v;
+
+  ret = calloc(1, sizeof(struct x_image)); if (ret == NULL) OOM;
+
+  template.class = TrueColor;
+  template.depth = 24;
+  template.red_mask = 0xff0000;
+  template.green_mask = 0x00ff00;
+  template.blue_mask = 0x0000ff;
+  template.bits_per_rgb = 8;
+
+  vs = XGetVisualInfo(x->d, VisualDepthMask | VisualClassMask |
+      VisualRedMaskMask | VisualGreenMaskMask | VisualBlueMaskMask |
+      VisualBitsPerRGBMask, &template, &nvs);
+  if (vs == NULL || nvs == 0) ERR("no good visual found\n");
+  v = vs[0].visual;
+  XFree(vs);
+
+  ximage = XCreateImage(x->d, v, 24, ZPixmap, 0,
+      (char*)data, width, height, 32, 0);
+  if (ximage == NULL) ERR("image creation failed\n");
+
+  ret->p = XCreatePixmap(x->d, DefaultRootWindow(x->d), width, height, 24);
+
+  XPutImage(x->d, ret->p, DefaultGC(x->d, DefaultScreen(x->d)),
+      ximage, 0, 0, 0, 0, width, height);
+
+  /* TODO: be sure it's fine to set data to NULL */
+  ximage->data = NULL;
+  XDestroyImage(ximage);
+
+  ret->width = width;
+  ret->height = height;
+
+  return ret;
+}
+
+static struct toplevel_window_widget *find_x_window(struct gui *g, Window id)
+{
+  struct widget_list *cur;
+  struct toplevel_window_widget *w;
+  struct x_window *xw;
+  cur = g->toplevel;
+  while (cur) {
+    w = (struct toplevel_window_widget *)cur->item;
+    xw = w->x;
+    if (xw->w == id) return w;
+    cur = cur->next;
+  }
+  return NULL;
+}
+
+void x_events(gui *_gui)
+{
+  struct gui *g = _gui;
+  struct widget_list *cur;
+  struct x_connection *x = g->x;
+  struct toplevel_window_widget *w;
+
+  LOGD("x_events START\n");
+  /* preprocessing (to "compress" events) */
+  cur = g->toplevel;
+  while (cur) {
+    struct x_window *xw;
+    w = (struct toplevel_window_widget *)cur->item;
+    xw = w->x;
+    xw->redraw = 0;
+    xw->repaint = 0;
+    xw->resize = 0;
+    cur = cur->next;
+  }
+
+  while (XPending(x->d)) {
+    XEvent ev;
+    XNextEvent(x->d, &ev);
+    LOGD("XEV %d\n", ev.type);
+    switch (ev.type) {
+    case MapNotify:
+    case Expose:
+      if ((w = find_x_window(g, ev.xexpose.window)) != NULL) {
+        struct x_window *xw = w->x;
+        xw->redraw = 1;
+      }
+      break;
+    case ConfigureNotify:
+      if ((w = find_x_window(g, ev.xconfigure.window)) != NULL) {
+        struct x_window *xw = w->x;
+        xw->resize = 1;
+        xw->new_width = ev.xconfigure.width;
+        xw->new_height = ev.xconfigure.height;
+        if (xw->new_width < 10) xw->new_width = 10;
+        if (xw->new_height < 10) xw->new_height = 10;
+        LOGD("ConfigureNotify %d %d\n", ev.xconfigure.width, ev.xconfigure.height);
+      }
+      break;
+    case ButtonPress:
+      if ((w = find_x_window(g, ev.xbutton.window)) != NULL) {
+        int key_modifiers = 0;
+        if (ev.xbutton.state & ShiftMask)   key_modifiers |= KEY_SHIFT;
+        if (ev.xbutton.state & Mod1Mask)    key_modifiers |= KEY_ALT;
+        if (ev.xbutton.state & ControlMask) key_modifiers |= KEY_CONTROL;
+        w->common.button(g, w, ev.xbutton.x, ev.xbutton.y, key_modifiers,
+            ev.xbutton.button, 0);
+      }
+      break;
+    case ButtonRelease:
+      if ((w = find_x_window(g, ev.xbutton.window)) != NULL) {
+        int key_modifiers = 0;
+        if (ev.xbutton.state & ShiftMask)   key_modifiers |= KEY_SHIFT;
+        if (ev.xbutton.state & Mod1Mask)    key_modifiers |= KEY_ALT;
+        if (ev.xbutton.state & ControlMask) key_modifiers |= KEY_CONTROL;
+        w->common.button(g, w, ev.xbutton.x, ev.xbutton.y, key_modifiers,
+            ev.xbutton.button, 1);
+      }
+      break;
+#if 0
+    case MapNotify:
+      if ((w = find_x_window(g, ev.xmap.window)) != NULL) {
+        struct x_window *xw = w->x;
+        xw->repaint = 1;
+      }
+      break;
+#endif
+    default: if (gui_logd) WARN("TODO: X event type %d\n", ev.type); break;
+    }
+  }
+
+  /* postprocessing */
+  LOGD("post processing\n");
+  cur = g->toplevel;
+  while (cur) {
+    struct toplevel_window_widget *w =
+        (struct toplevel_window_widget *)cur->item;
+    struct x_window *xw = w->x;
+    if (xw->resize) {
+      LOGD("resize old %d %d new %d %d\n", xw->width, xw->height, xw->new_width, xw->new_height);
+      if (xw->width != xw->new_width || xw->height != xw->new_height) {
+        w->common.allocate(g, w, 0, 0, xw->new_width, xw->new_height);
+        xw->width = xw->new_width;
+        xw->height = xw->new_height;
+        XftDrawDestroy(xw->xft);
+        XFreePixmap(x->d, xw->p);
+        xw->p = XCreatePixmap(x->d, xw->w, xw->width, xw->height,
+            DefaultDepth(x->d, DefaultScreen(x->d)));
+        XFillRectangle(x->d, xw->p, x->colors[BACKGROUND_COLOR],
+            0, 0, xw->width, xw->height);
+        xw->xft = XftDrawCreate(x->d, xw->p,
+            DefaultVisual(x->d, DefaultScreen(x->d)),
+            DefaultColormap(x->d, DefaultScreen(x->d)));
+        if (xw->xft == NULL) ERR("XftDrawCreate failed\n");
+
+        //xw->repaint = 1;
+      }
+    }
+    if (xw->repaint) {
+      w->common.paint(g, w);
+      xw->redraw = 1;
+    }
+    if (xw->redraw) {
+      struct x_connection *x = g->x;
+      LOGD("XCopyArea w h %d %d\n", xw->width, xw->height);
+      XCopyArea(x->d, xw->p, xw->w, x->colors[1],
+          0, 0, xw->width, xw->height, 0, 0);
+    }
+    cur = cur->next;
+  }
+  LOGD("x_events DONE\n");
+}
+
+void x_flush(x_connection *_x)
+{
+  struct x_connection *x = _x;
+  XFlush(x->d);
+}
+
+void x_text_get_dimensions(x_connection *_c, int font, const char *t,
+    int *width, int *height, int *baseline)
+{
+  struct x_connection *c = _c;
+  XGlyphInfo ext;
+
+  XftTextExtentsUtf8(c->d, c->fonts[font], (FcChar8 *)t, strlen(t), &ext);
+
+  *width = ext.width;
+  *height = c->fonts[font]->height;
+  *baseline = c->fonts[font]->ascent;
+}
+
+/***********************************************************************/
+/*                    public drawing functions                         */
+/***********************************************************************/
+
+void x_draw_line(x_connection *_c, x_window *_w, int color,
+    int x1, int y1, int x2, int y2)
+{
+  struct x_connection *c = _c;
+  struct x_window *w = _w;
+  XDrawLine(c->d, w->p, c->colors[color], x1, y1, x2, y2);
+}
+
+void x_draw_rectangle(x_connection *_c, x_window *_w, int color,
+    int x, int y, int width, int height)
+{
+  struct x_connection *c = _c;
+  struct x_window *w = _w;
+  XDrawRectangle(c->d, w->p, c->colors[color], x, y, width, height);
+}
+
+void x_fill_rectangle(x_connection *_c, x_window *_w, int color,
+    int x, int y, int width, int height)
+{
+  struct x_connection *c = _c;
+  struct x_window *w = _w;
+  XFillRectangle(c->d, w->p, c->colors[color], x, y, width, height);
+}
+
+void x_draw_string(x_connection *_c, x_window *_w, int font, int color,
+    int x, int y, const char *t)
+{
+  struct x_connection *c = _c;
+  struct x_window *w = _w;
+  int tlen = strlen(t);
+  XftDrawStringUtf8(w->xft, &c->xft_colors[color], c->fonts[font],
+      x, y, (const unsigned char *)t, tlen);
+}
+
+void x_draw_clipped_string(x_connection *_c, x_window *_w, int font,
+    int color, int x, int y, const char *t,
+    int clipx, int clipy, int clipwidth, int clipheight)
+{
+  struct x_window *w = _w;
+
+  XRectangle clip = { clipx, clipy, clipwidth, clipheight };
+  if (XftDrawSetClipRectangles(w->xft, 0, 0, &clip, 1) == False) abort();
+  x_draw_string(_c, _w, font, color, x, y, t);
+  if (XftDrawSetClip(w->xft, NULL) == False) abort();
+}
+
+void x_draw_image(x_connection *_c, x_window *_w, x_image *_img, int x, int y)
+{
+  struct x_connection *c = _c;
+  struct x_window *w = _w;
+  struct x_image *img = _img;
+
+  XCopyArea(c->d, img->p, w->p, DefaultGC(c->d, DefaultScreen(c->d)),
+      0, 0, img->width, img->height, x, y);
+}
+
+void x_draw(x_connection *_c, x_window *_w)
+{
+  struct x_connection *c = _c;
+  struct x_window *w = _w;
+  LOGD("x_draw XCopyArea w h %d %d display %p window %d pixmap %d\n", w->width, w->height, c->d, (int)w->w, (int)w->p);
+  XCopyArea(c->d, w->p, w->w, c->colors[1], 0, 0, w->width, w->height, 0, 0);
+}
+
+/* those two special functions are to plot many points
+ * first call x_add_point many times then x_plot_points once
+ */
+void x_add_point(x_connection *_c, int x, int y)
+{
+  struct x_connection *c = _c;
+
+  if (c->pts_size == c->pts_maxsize) {
+    c->pts_maxsize += 65536;
+    c->pts = realloc(c->pts, c->pts_maxsize * sizeof(XPoint));
+    if (c->pts == NULL) OOM;
+  }
+
+  c->pts[c->pts_size].x = x;
+  c->pts[c->pts_size].y = y;
+  c->pts_size++;
+}
+
+void x_plot_points(x_connection *_c, x_window *_w, int color)
+{
+  struct x_connection *c = _c;
+  LOGD("x_plot_points %d points\n", c->pts_size);
+  struct x_window *w = _w;
+  XDrawPoints(c->d, w->p, c->colors[color], c->pts, c->pts_size,
+      CoordModeOrigin);
+  c->pts_size = 0;
+}
diff --git a/common/utils/T/tracer/gui/x.h b/common/utils/T/tracer/gui/x.h
new file mode 100644
index 0000000000000000000000000000000000000000..d749d9acc4d9532891eea1931ed0447a197e9231
--- /dev/null
+++ b/common/utils/T/tracer/gui/x.h
@@ -0,0 +1,61 @@
+#ifndef _X_H_
+#define _X_H_
+
+/* public X interface */
+
+typedef void x_connection;
+typedef void x_window;
+typedef void x_image;
+
+x_connection *x_open(void);
+
+x_window *x_create_window(x_connection *x, int width, int height,
+    char *title);
+
+x_image *x_create_image(x_connection *x, unsigned char *data,
+    int width, int height);
+
+int x_connection_fd(x_connection *x);
+
+void x_flush(x_connection *x);
+
+int x_new_color(x_connection *x, char *color);
+int x_new_font(x_connection *x, char *font);
+
+/* for x_events, we pass the gui */
+#include "gui.h"
+void x_events(gui *gui);
+
+void x_text_get_dimensions(x_connection *, int font, const char *t,
+                           int *width, int *height, int *baseline);
+
+/* drawing functions */
+
+void x_draw_line(x_connection *c, x_window *w, int color,
+    int x1, int y1, int x2, int y2);
+
+void x_draw_rectangle(x_connection *c, x_window *w, int color,
+    int x, int y, int width, int height);
+
+void x_fill_rectangle(x_connection *c, x_window *w, int color,
+    int x, int y, int width, int height);
+
+void x_draw_string(x_connection *_c, x_window *_w, int font, int color,
+    int x, int y, const char *t);
+
+void x_draw_clipped_string(x_connection *_c, x_window *_w, int font,
+    int color, int x, int y, const char *t,
+    int clipx, int clipy, int clipwidth, int clipheight);
+
+void x_draw_image(x_connection *c, x_window *w, x_image *img, int x, int y);
+
+/* specials functions to plot many points
+ * you call several times x_add_point() then x_plot_points()
+ */
+void x_add_point(x_connection *c, int x, int y);
+void x_plot_points(x_connection *c, x_window *w, int color);
+
+/* this function copies the pixmap to the window */
+void x_draw(x_connection *c, x_window *w);
+
+#endif /* _X_H_ */
diff --git a/common/utils/T/tracer/gui/x_defs.h b/common/utils/T/tracer/gui/x_defs.h
new file mode 100644
index 0000000000000000000000000000000000000000..d0595ef51de128e191ae1c2a931cb422ef1b1cff
--- /dev/null
+++ b/common/utils/T/tracer/gui/x_defs.h
@@ -0,0 +1,37 @@
+#ifndef _X_DEFS_H_
+#define _X_DEFS_H_
+
+#include <X11/Xlib.h>
+#include <Xft.h>
+
+struct x_connection {
+  Display *d;
+  GC *colors;
+  XftColor *xft_colors;
+  int ncolors;
+  XPoint *pts;
+  int pts_size;
+  int pts_maxsize;
+  XftFont **fonts;
+  int nfonts;
+};
+
+struct x_window {
+  Window w;
+  Pixmap p;
+  int width;
+  int height;
+  XftDraw *xft;
+  /* below: internal data used for X events handling */
+  int redraw;
+  int repaint;
+  int resize, new_width, new_height;
+};
+
+struct x_image {
+  Pixmap p;
+  int width;
+  int height;
+};
+
+#endif /* _X_DEFS_H_ */
diff --git a/common/utils/T/tracer/gui/xy_plot.c b/common/utils/T/tracer/gui/xy_plot.c
new file mode 100644
index 0000000000000000000000000000000000000000..7d20a027a155524481d6aab45c2ada8361b83180
--- /dev/null
+++ b/common/utils/T/tracer/gui/xy_plot.c
@@ -0,0 +1,292 @@
+#include "gui.h"
+#include "gui_defs.h"
+#include "x.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+static void paint(gui *_gui, widget *_this)
+{
+  struct gui *g = _gui;
+  struct xy_plot_widget *this = _this;
+  int wanted_plot_width, allocated_plot_width;
+  int wanted_plot_height, allocated_plot_height;
+  float pxsize;
+  float ticdist;
+  float tic;
+  float ticstep;
+  int k, kmin, kmax;
+  float allocated_xmin, allocated_xmax;
+  float allocated_ymin, allocated_ymax;
+  float center;
+  int i;
+  int n;
+
+# define FLIP(v) (-(v) + allocated_plot_height-1)
+
+  LOGD("PAINT xy plot xywh %d %d %d %d\n", this->common.x, this->common.y, this->common.width, this->common.height);
+
+//x_draw_rectangle(g->x, g->xwin, 1, this->common.x, this->common.y, this->common.width, this->common.height);
+
+  wanted_plot_width = this->wanted_width;
+  allocated_plot_width = this->common.width - this->vrule_width;
+  wanted_plot_height = this->wanted_height;
+  allocated_plot_height = this->common.height - this->label_height * 2;
+
+  /* plot zone */
+  /* TODO: refine height - height of hrule text may be != from label */
+  x_draw_rectangle(g->x, g->xwin, 1,
+      this->common.x + this->vrule_width,
+      this->common.y,
+      this->common.width - this->vrule_width -1, /* -1 to see right border */
+      this->common.height - this->label_height * 2);
+
+  /* horizontal tics */
+  pxsize = (this->xmax - this->xmin) / wanted_plot_width;
+  ticdist = 100;
+  tic = floor(log10(ticdist * pxsize));
+  ticstep = powf(10, tic);
+  center = (this->xmax + this->xmin) / 2;
+  allocated_xmin = center - ((this->xmax - this->xmin) *
+                             allocated_plot_width / wanted_plot_width) / 2;
+  allocated_xmax = center + ((this->xmax - this->xmin) *
+                             allocated_plot_width / wanted_plot_width) / 2;
+  /* adjust tic if too tight */
+  LOGD("pre x ticstep %g\n", ticstep);
+  while (1) {
+    if (ticstep / (allocated_xmax - allocated_xmin)
+                * (allocated_plot_width - 1) > 40) break;
+    ticstep *= 2;
+  }
+  LOGD("post x ticstep %g\n", ticstep);
+  LOGD("xmin/max %g %g width wanted allocated %d %d alloc xmin/max %g %g ticstep %g\n", this->xmin, this->xmax, wanted_plot_width, allocated_plot_width, allocated_xmin, allocated_xmax, ticstep);
+  kmin = ceil(allocated_xmin / ticstep);
+  kmax = floor(allocated_xmax / ticstep);
+  for (k = kmin; k <= kmax; k++) {
+/*
+    (k * ticstep - allocated_xmin) / (allocated_max - allocated_xmin) =
+    (x - 0) / (allocated_plot_width-1 - 0)
+ */
+    char v[64];
+    int vwidth, dummy;
+    float x = (k * ticstep - allocated_xmin) /
+              (allocated_xmax - allocated_xmin) *
+              (allocated_plot_width - 1);
+    x_draw_line(g->x, g->xwin, FOREGROUND_COLOR,
+        this->common.x + this->vrule_width + x,
+        this->common.y + this->common.height - this->label_height * 2,
+        this->common.x + this->vrule_width + x,
+        this->common.y + this->common.height - this->label_height * 2 - 5);
+    sprintf(v, "%g", k * ticstep);
+    x_text_get_dimensions(g->x, DEFAULT_FONT, v, &vwidth, &dummy, &dummy);
+    x_draw_string(g->x, g->xwin, DEFAULT_FONT, FOREGROUND_COLOR,
+        this->common.x + this->vrule_width + x - vwidth/2,
+        this->common.y + this->common.height - this->label_height * 2 +
+            this->label_baseline,
+        v);
+    LOGD("tic k %d val %g x %g\n", k, k * ticstep, x);
+  }
+
+  /* vertical tics */
+  pxsize = (this->ymax - this->ymin) / wanted_plot_height;
+  ticdist = 30;
+  tic = floor(log10(ticdist * pxsize));
+  ticstep = powf(10, tic);
+  center = (this->ymax + this->ymin) / 2;
+  allocated_ymin = center - ((this->ymax - this->ymin) *
+                             allocated_plot_height / wanted_plot_height) / 2;
+  allocated_ymax = center + ((this->ymax - this->ymin) *
+                             allocated_plot_height / wanted_plot_height) / 2;
+  /* adjust tic if too tight */
+  LOGD("pre y ticstep %g\n", ticstep);
+  while (1) {
+    if (ticstep / (allocated_ymax - allocated_ymin)
+                * (allocated_plot_height - 1) > 20) break;
+    ticstep *= 2;
+  }
+  LOGD("post y ticstep %g\n", ticstep);
+  LOGD("ymin/max %g %g height wanted allocated %d %d alloc ymin/max %g %g ticstep %g\n", this->ymin, this->ymax, wanted_plot_height, allocated_plot_height, allocated_ymin, allocated_ymax, ticstep);
+  kmin = ceil(allocated_ymin / ticstep);
+  kmax = floor(allocated_ymax / ticstep);
+  for (k = kmin; k <= kmax; k++) {
+    char v[64];
+    int vwidth, dummy;
+    float y = (k * ticstep - allocated_ymin) /
+              (allocated_ymax - allocated_ymin) *
+              (allocated_plot_height - 1);
+    sprintf(v, "%g", k * ticstep);
+    x_text_get_dimensions(g->x, DEFAULT_FONT, v, &vwidth, &dummy, &dummy);
+    x_draw_line(g->x, g->xwin, FOREGROUND_COLOR,
+        this->common.x + this->vrule_width,
+        this->common.y + FLIP(y),
+        this->common.x + this->vrule_width + 5,
+        this->common.y + FLIP(y));
+    x_draw_string(g->x, g->xwin, DEFAULT_FONT, FOREGROUND_COLOR,
+        this->common.x + this->vrule_width - vwidth - 2,
+        this->common.y + FLIP(y) - this->label_height/2+this->label_baseline,
+        v);
+  }
+
+  /* label at bottom, in the middle */
+  x_draw_string(g->x, g->xwin, DEFAULT_FONT, FOREGROUND_COLOR,
+      this->common.x + (this->common.width - this->label_width) / 2,
+      this->common.y + this->common.height - this->label_height
+          + this->label_baseline,
+      this->label);
+
+  for (n = 0; n < this->nplots; n++) {
+    /* points */
+    float ax, bx, ay, by;
+    ax = (allocated_plot_width-1) / (allocated_xmax - allocated_xmin);
+    bx = -ax * allocated_xmin;
+    ay = (allocated_plot_height-1) / (allocated_ymax - allocated_ymin);
+    by = -ay * allocated_ymin;
+    for (i = 0; i < this->plots[n].npoints; i++) {
+      int x, y;
+      x = ax * this->plots[n].x[i] + bx;
+      y = ay * this->plots[n].y[i] + by;
+      if (x >= 0 && x < allocated_plot_width &&
+          y >= 0 && y < allocated_plot_height)
+        x_add_point(g->x,
+            this->common.x + this->vrule_width + x,
+            this->common.y + FLIP(y));
+    }
+    x_plot_points(g->x, g->xwin, this->plots[n].color);
+  }
+}
+
+static void hints(gui *_gui, widget *_w, int *width, int *height)
+{
+  struct xy_plot_widget *w = _w;
+  *width = w->wanted_width + w->vrule_width;
+  *height = w->wanted_height + w->label_height * 2; /* TODO: refine */
+  LOGD("HINTS xy plot wh %d %d (vrule_width %d) (wanted wh %d %d)\n", *width, *height, w->vrule_width, w->wanted_width, w->wanted_height);
+}
+
+widget *new_xy_plot(gui *_gui, int width, int height, char *label,
+    int vruler_width)
+{
+  struct gui *g = _gui;
+  struct xy_plot_widget *w;
+
+  glock(g);
+
+  w = new_widget(g, XY_PLOT, sizeof(struct xy_plot_widget));
+
+  w->label = strdup(label); if (w->label == NULL) OOM;
+  /* TODO: be sure calling X there is valid wrt "global model" (we are
+   * not in the "gui thread") */
+  x_text_get_dimensions(g->x, DEFAULT_FONT, label,
+      &w->label_width, &w->label_height, &w->label_baseline);
+  LOGD("XY PLOT label wh %d %d\n", w->label_width, w->label_height);
+
+  w->wanted_width = width;
+  w->wanted_height = height;
+  w->vrule_width = vruler_width;
+
+  w->xmin = -1;
+  w->xmax = 1;
+  w->ymin = -1;
+  w->ymax = 1;
+  w->plots = NULL;
+  w->nplots = 0;
+
+  w->common.paint = paint;
+  w->common.hints = hints;
+
+  gunlock(g);
+
+  return w;
+}
+
+/*************************************************************************/
+/*                           public functions                            */
+/*************************************************************************/
+
+int xy_plot_new_plot(gui *_gui, widget *_this, int color)
+{
+  int ret;
+  struct gui *g = _gui;
+  struct xy_plot_widget *this = _this;
+
+  glock(g);
+
+  ret = this->nplots;
+
+  this->nplots++;
+  this->plots = realloc(this->plots,
+      this->nplots * sizeof(struct xy_plot_plot));
+  if (this->plots == NULL) abort();
+
+  this->plots[ret].x = NULL;
+  this->plots[ret].y = NULL;
+  this->plots[ret].npoints = 0;
+  this->plots[ret].color = color;
+
+  gunlock(g);
+
+  return ret;
+}
+
+void xy_plot_set_range(gui *_gui, widget *_this,
+    float xmin, float xmax, float ymin, float ymax)
+{
+  struct gui *g = _gui;
+  struct xy_plot_widget *this = _this;
+
+  glock(g);
+
+  this->xmin = xmin;
+  this->xmax = xmax;
+  this->ymin = ymin;
+  this->ymax = ymax;
+
+  send_event(g, DIRTY, this->common.id);
+
+  gunlock(g);
+}
+
+void xy_plot_set_points(gui *_gui, widget *_this, int plot,
+    int npoints, float *x, float *y)
+{
+  struct gui *g = _gui;
+  struct xy_plot_widget *this = _this;
+
+  glock(g);
+
+  if (npoints != this->plots[plot].npoints) {
+    free(this->plots[plot].x);
+    free(this->plots[plot].y);
+    this->plots[plot].x = calloc(npoints, sizeof(float));
+    if (this->plots[plot].x == NULL) abort();
+    this->plots[plot].y = calloc(npoints, sizeof(float));
+    if (this->plots[plot].y == NULL) abort();
+    this->plots[plot].npoints = npoints;
+  }
+
+  memcpy(this->plots[plot].x, x, npoints * sizeof(float));
+  memcpy(this->plots[plot].y, y, npoints * sizeof(float));
+
+  send_event(g, DIRTY, this->common.id);
+
+  gunlock(g);
+}
+
+void xy_plot_get_dimensions(gui *_gui, widget *_this, int *width, int *height)
+{
+  struct gui *g = _gui;
+  struct xy_plot_widget *this = _this;
+
+  glock(g);
+
+  if (this->common.width == 0 || this->common.height == 0) {
+    *width = this->wanted_width;
+    *height = this->wanted_height;
+  } else {
+    *width = this->common.width - this->vrule_width;
+    *height = this->common.height - this->label_height * 2;
+  }
+
+  gunlock(g);
+}
diff --git a/common/utils/T/tracer/hacks/Makefile b/common/utils/T/tracer/hacks/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..ab10305c0b356c7085695c9099d1fc93492330e9
--- /dev/null
+++ b/common/utils/T/tracer/hacks/Makefile
@@ -0,0 +1,18 @@
+CC=gcc
+CFLAGS=-Wall -g -pthread -DT_TRACER -I. -I..
+
+LIBS=-lX11 -lm -lpng -lXft
+
+all: dump_nack_signal
+
+dump_nack_signal: ../utils.o ../database.o ../config.o ../event.o \
+                  dump_nack_signal.o
+	$(CC) $(CFLAGS) -o dump_nack_signal $^ $(LIBS)
+
+.PHONY: all
+
+%.o: %.c
+	$(CC) $(CFLAGS) -c -o $@ $<
+
+clean:
+	rm -f *.o core dump_nack_signal
diff --git a/common/utils/T/tracer/hacks/dump_nack_signal.c b/common/utils/T/tracer/hacks/dump_nack_signal.c
new file mode 100644
index 0000000000000000000000000000000000000000..1627bdd14e925ad68797d16614be9e57bc23447e
--- /dev/null
+++ b/common/utils/T/tracer/hacks/dump_nack_signal.c
@@ -0,0 +1,115 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "utils.h"
+#include "event.h"
+#include "database.h"
+#include "config.h"
+#include "../T_defs.h"
+
+void usage(void)
+{
+  printf(
+"options:\n"
+"    -d <database file>        this option is mandatory\n"
+"    -ip <host>                connect to given IP address (default %s)\n"
+"    -p <port>                 connect to given port (default %d)\n",
+  DEFAULT_REMOTE_IP,
+  DEFAULT_REMOTE_PORT
+  );
+  exit(1);
+}
+
+int main(int n, char **v)
+{
+  char *database_filename = NULL;
+  void *database;
+  char *ip = DEFAULT_REMOTE_IP;
+  int port = DEFAULT_REMOTE_PORT;
+  int i;
+  char t;
+  int number_of_events;
+  int socket;
+  int *is_on;
+  int ev_input, ev_nack;
+  int ev_ack;
+
+  for (i = 1; i < n; i++) {
+    if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage();
+    if (!strcmp(v[i], "-d"))
+      { if (i > n-2) usage(); database_filename = v[++i]; continue; }
+    if (!strcmp(v[i], "-ip")) { if (i > n-2) usage(); ip = v[++i]; continue; }
+    if (!strcmp(v[i], "-p"))
+      { if (i > n-2) usage(); port = atoi(v[++i]); continue; }
+    usage();
+  }
+
+  if (database_filename == NULL) {
+    printf("ERROR: provide a database file (-d)\n");
+    exit(1);
+  }
+
+  database = parse_database(database_filename);
+
+  load_config_file(database_filename);
+
+  number_of_events = number_of_ids(database);
+  is_on = calloc(number_of_events, sizeof(int));
+  if (is_on == NULL) abort();
+
+  on_off(database, "ENB_PHY_INPUT_SIGNAL", is_on, 1);
+  on_off(database, "ENB_PHY_ULSCH_UE_NACK", is_on, 1);
+  on_off(database, "ENB_PHY_ULSCH_UE_ACK", is_on, 1);
+
+  ev_input = event_id_from_name(database, "ENB_PHY_INPUT_SIGNAL");
+  ev_nack = event_id_from_name(database, "ENB_PHY_ULSCH_UE_NACK");
+  ev_ack = event_id_from_name(database, "ENB_PHY_ULSCH_UE_ACK");
+
+  socket = connect_to(ip, port);
+
+  t = 1;
+  if (socket_send(socket, &t, 1) == -1 ||
+      socket_send(socket, &number_of_events, sizeof(int)) == -1 ||
+      socket_send(socket, is_on, number_of_events * sizeof(int)) == -1)
+    abort();
+
+  char dump[10][T_BUFFER_MAX];
+  event dump_ev[10];
+FILE *z = fopen("/tmp/dd", "w"); if (z == NULL) abort();
+  while (1) {
+    char v[T_BUFFER_MAX];
+    event e;
+    e = get_event(socket, v, database);
+    if (e.type == -1) break;
+    if (e.type == ev_input) {
+      int sf = e.e[2].i;
+      memcpy(dump[sf], v, T_BUFFER_MAX);
+      dump_ev[sf] = e;
+      printf("input %d/%d\n", e.e[1].i, sf);
+if (fwrite(dump_ev[sf].e[4].b, dump_ev[sf].e[4].bsize, 1, z) != 1) abort();
+fflush(z);
+    }
+    if (e.type == ev_nack) {
+      int sf = e.e[2].i;
+      printf("nack %d/%d\n", e.e[1].i, sf);
+      FILE *f = fopen("/tmp/dump.raw", "w"); if (f == NULL) abort();
+      if (fwrite(dump[sf] + ((char *)dump_ev[sf].e[4].b - v),
+          dump_ev[sf].e[4].bsize, 1, f) != 1) abort();
+      if (fclose(f)) abort();
+      printf("dumped... press enter (delta %d)\n", (int)((char *)dump_ev[sf].e[4].b - v));
+//      getchar();
+    }
+    if (e.type == ev_ack) {
+      int sf = e.e[2].i;
+      printf("ack %d/%d\n", e.e[1].i, sf);
+      FILE *f = fopen("/tmp/dump.raw", "w"); if (f == NULL) abort();
+      if (fwrite(dump[sf] + ((char *)dump_ev[sf].e[4].b - v),
+          dump_ev[sf].e[4].bsize, 1, f) != 1) abort();
+      if (fclose(f)) abort();
+      printf("dumped... press enter (delta %d)\n", (int)((char *)dump_ev[sf].e[4].b - v));
+//      getchar();
+    }
+  }
+
+  return 0;
+}
diff --git a/common/utils/T/tracer/handler.c b/common/utils/T/tracer/handler.c
new file mode 100644
index 0000000000000000000000000000000000000000..1ee9db1adee05d299c164abfddf96e6908e759b8
--- /dev/null
+++ b/common/utils/T/tracer/handler.c
@@ -0,0 +1,82 @@
+#include "handler.h"
+#include "event.h"
+#include "database.h"
+#include <stdlib.h>
+#include <stdio.h>
+
+typedef void (*handler_function)(void *p, event e);
+
+struct handler_data {
+  handler_function f;
+  void *p;
+  unsigned long id;
+};
+
+struct handler_list {
+  struct handler_data *f;
+  int size;
+  int maxsize;
+};
+
+/* internal definition of an event handler */
+struct _event_handler {
+  void *database;
+  struct handler_list *events;
+  unsigned long next_id;
+};
+
+void handle_event(event_handler *_h, event e)
+{
+  struct _event_handler *h = _h;
+  int i;
+  for (i = 0; i < h->events[e.type].size; i++)
+    h->events[e.type].f[i].f(h->events[e.type].f[i].p, e);
+}
+
+event_handler *new_handler(void *database)
+{
+  struct _event_handler *ret = calloc(1, sizeof(struct _event_handler));
+  if (ret == NULL) abort();
+
+  ret->database = database;
+
+  ret->events = calloc(number_of_ids(database), sizeof(struct handler_list));
+  if (ret->events == NULL) abort();
+
+  ret->next_id = 1;
+
+  return ret;
+}
+
+unsigned long register_handler_function(event_handler *_h, int event_id,
+    void (*f)(void *, event), void *p)
+{
+  struct _event_handler *h = _h;
+  unsigned long ret = h->next_id;
+  struct handler_list *l;
+
+  h->next_id++;
+  if (h->next_id == 2UL * 1024 * 1024 * 1024)
+    { printf("%s:%d: this is bad...\n", __FILE__, __LINE__); abort(); }
+
+  l = &h->events[event_id];
+  if (l->size == l->maxsize) {
+    l->maxsize += 16;
+    l->f = realloc(l->f, l->maxsize * sizeof(struct handler_data));
+    if (l->f == NULL) abort();
+  }
+  l->f[l->size].f = f;
+  l->f[l->size].p = p;
+  l->f[l->size].id = ret;
+
+  l->size++;
+
+  return ret;
+}
+
+void remove_handler_function(event_handler *h, int event_id,
+    unsigned long handler_id)
+{
+  printf("%s:%d: TODO\n", __FILE__, __LINE__);
+  abort();
+}
diff --git a/common/utils/T/tracer/handler.h b/common/utils/T/tracer/handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..5934e1704c52ff3ee9b5fb2239e2f2a602bc5bb9
--- /dev/null
+++ b/common/utils/T/tracer/handler.h
@@ -0,0 +1,16 @@
+#ifndef _HANDLER_H_
+#define _HANDLER_H_
+
+typedef void event_handler;
+
+#include "event.h"
+
+event_handler *new_handler(void *database);
+void handle_event(event_handler *h, event e);
+
+unsigned long register_handler_function(event_handler *_h, int event_id,
+    void (*f)(void *, event), void *p);
+void remove_handler_function(event_handler *h, int event_id,
+    unsigned long handler_id);
+
+#endif /* _HANDLER_H_ */
diff --git a/common/utils/T/tracer/logger/Makefile b/common/utils/T/tracer/logger/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..92431739dba89d44104bc8c509daec7ea479af2b
--- /dev/null
+++ b/common/utils/T/tracer/logger/Makefile
@@ -0,0 +1,14 @@
+CC=gcc
+CFLAGS=-Wall -g -pthread -I..
+
+OBJS=logger.o textlog.o framelog.o ttilog.o timelog.o ticklog.o iqlog.o \
+     iqdotlog.o
+
+logger.a: $(OBJS)
+	ar cr logger.a $(OBJS)
+
+%.o: %.c
+	$(CC) $(CFLAGS) -o $@ -c $<
+
+clean:
+	rm -f *.a *.o
diff --git a/common/utils/T/tracer/logger/framelog.c b/common/utils/T/tracer/logger/framelog.c
new file mode 100644
index 0000000000000000000000000000000000000000..45ae3e399f98dd4e1e091cf39606ad3b7ad3a88f
--- /dev/null
+++ b/common/utils/T/tracer/logger/framelog.c
@@ -0,0 +1,155 @@
+#include "logger.h"
+#include "logger_defs.h"
+#include "handler.h"
+#include "database.h"
+#include "filter/filter.h"
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <math.h>
+
+struct framelog {
+  struct logger common;
+  void *database;
+  int subframe_arg;
+  int buffer_arg;
+  float *x;
+  float *buffer;
+  int blength;
+  int skip_delay;       /* one frame over 'skip_delay' is truly processed
+                         * 0 to disable (process all data)
+                         */
+  int skip_current;     /* internal data for the skip mechanism */
+  int skip_on;          /* internal data for the skip mechanism */
+  int update_only_at_sf9;
+};
+
+static void _event(void *p, event e)
+{
+  struct framelog *l = p;
+  int i;
+  int subframe;
+  void *buffer;
+  int bsize;
+  int nsamples;
+
+  if (l->common.filter != NULL && filter_eval(l->common.filter, e) == 0)
+    return;
+
+  subframe = e.e[l->subframe_arg].i;
+  buffer = e.e[l->buffer_arg].b;
+  bsize = e.e[l->buffer_arg].bsize;
+
+  if (l->skip_delay != 0) {
+    if (subframe == 0) {
+      l->skip_current++;
+      if (l->skip_current >= l->skip_delay) {
+        l->skip_on = 0;
+        l->skip_current = 0;
+      } else
+        l->skip_on = 1;
+    }
+  }
+  if (l->skip_on) return;
+
+  nsamples = bsize / (2*sizeof(int16_t));
+
+  if (l->blength != nsamples * 10) {
+    l->blength = nsamples * 10;
+    free(l->x);
+    free(l->buffer);
+    l->x = calloc(l->blength, sizeof(float));
+    if (l->x == NULL) abort();
+    l->buffer = calloc(l->blength, sizeof(float));
+    if (l->buffer == NULL) abort();
+    /* update 'x' */
+    for (i = 0; i < l->blength; i++)
+      l->x[i] = i;
+    /* update 'length' of views */
+    for (i = 0; i < l->common.vsize; i++)
+      l->common.v[i]->set(l->common.v[i], "length", l->blength);
+  }
+
+  /* TODO: compute the LOGs in the plotter (too much useless computations) */
+  for (i = 0; i < nsamples; i++) {
+    int I = ((int16_t *)buffer)[i*2];
+    int Q = ((int16_t *)buffer)[i*2+1];
+    l->buffer[subframe * nsamples + i] = 10*log10(1.0+(float)(I*I+Q*Q));
+  }
+
+  if (l->update_only_at_sf9 == 0 || subframe == 9)
+    for (i = 0; i < l->common.vsize; i++)
+      l->common.v[i]->append(l->common.v[i], l->x, l->buffer, l->blength);
+}
+
+logger *new_framelog(event_handler *h, void *database,
+    char *event_name, char *subframe_varname, char *buffer_varname)
+{
+  struct framelog *ret;
+  int event_id;
+  database_event_format f;
+  int i;
+
+  ret = calloc(1, sizeof(struct framelog)); if (ret == NULL) abort();
+
+  ret->update_only_at_sf9 = 1;
+
+  ret->common.event_name = strdup(event_name);
+  if (ret->common.event_name == NULL) abort();
+  ret->database = database;
+
+  event_id = event_id_from_name(database, event_name);
+
+  ret->common.handler_id = register_handler_function(h,event_id,_event,ret);
+
+  f = get_format(database, event_id);
+
+  /* look for subframe and buffer args */
+  ret->subframe_arg = -1;
+  ret->buffer_arg = -1;
+  for (i = 0; i < f.count; i++) {
+    if (!strcmp(f.name[i], subframe_varname)) ret->subframe_arg = i;
+    if (!strcmp(f.name[i], buffer_varname)) ret->buffer_arg = i;
+  }
+  if (ret->subframe_arg == -1) {
+    printf("%s:%d: subframe argument '%s' not found in event '%s'\n",
+        __FILE__, __LINE__, subframe_varname, event_name);
+    abort();
+  }
+  if (ret->buffer_arg == -1) {
+    printf("%s:%d: buffer argument '%s' not found in event '%s'\n",
+        __FILE__, __LINE__, buffer_varname, event_name);
+    abort();
+  }
+  if (strcmp(f.type[ret->subframe_arg], "int") != 0) {
+    printf("%s:%d: argument '%s' has wrong type (should be 'int')\n",
+        __FILE__, __LINE__, subframe_varname);
+    abort();
+  }
+  if (strcmp(f.type[ret->buffer_arg], "buffer") != 0) {
+    printf("%s:%d: argument '%s' has wrong type (should be 'buffer')\n",
+        __FILE__, __LINE__, buffer_varname);
+    abort();
+  }
+
+  return ret;
+}
+
+/****************************************************************************/
+/*                             public functions                             */
+/****************************************************************************/
+
+void framelog_set_skip(logger *_this, int skip_delay)
+{
+  struct framelog *l = _this;
+  /* TODO: protect with a lock? */
+  l->skip_delay = skip_delay;
+  l->skip_current = 0;
+  l->skip_on = 0;
+}
+
+void framelog_set_update_only_at_sf9(logger *_this, int update_only_at_sf9)
+{
+  struct framelog *l = _this;
+  l->update_only_at_sf9 = update_only_at_sf9;
+}
diff --git a/common/utils/T/tracer/logger/iqdotlog.c b/common/utils/T/tracer/logger/iqdotlog.c
new file mode 100644
index 0000000000000000000000000000000000000000..f635f9718ddd9fac158dd43ac51b11ada8d79d4b
--- /dev/null
+++ b/common/utils/T/tracer/logger/iqdotlog.c
@@ -0,0 +1,82 @@
+#include "logger.h"
+#include "logger_defs.h"
+#include "handler.h"
+#include "database.h"
+#include "filter/filter.h"
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+struct iqdotlog {
+  struct logger common;
+  void *database;
+  int i_arg;
+  int q_arg;
+};
+
+static void _event(void *p, event e)
+{
+  struct iqdotlog *l = p;
+  int i;
+  float I, Q;
+
+  if (l->common.filter != NULL && filter_eval(l->common.filter, e) == 0)
+    return;
+
+  I = e.e[l->i_arg].i;
+  Q = e.e[l->q_arg].i;
+
+  for (i = 0; i < l->common.vsize; i++)
+    l->common.v[i]->append(l->common.v[i], &I, &Q, 1);
+}
+
+logger *new_iqdotlog(event_handler *h, void *database,
+    char *event_name, char *I, char *Q)
+{
+  struct iqdotlog *ret;
+  int event_id;
+  database_event_format f;
+  int i;
+
+  ret = calloc(1, sizeof(struct iqdotlog)); if (ret == NULL) abort();
+
+  ret->common.event_name = strdup(event_name);
+  if (ret->common.event_name == NULL) abort();
+  ret->database = database;
+
+  event_id = event_id_from_name(database, event_name);
+
+  ret->common.handler_id = register_handler_function(h,event_id,_event,ret);
+
+  f = get_format(database, event_id);
+
+  /* look for args */
+  ret->i_arg = -1;
+  ret->q_arg = -1;
+  for (i = 0; i < f.count; i++) {
+    if (!strcmp(f.name[i], I)) ret->i_arg = i;
+    if (!strcmp(f.name[i], Q)) ret->q_arg = i;
+  }
+  if (ret->i_arg == -1) {
+    printf("%s:%d: argument '%s' not found in event '%s'\n",
+        __FILE__, __LINE__, I, event_name);
+    abort();
+  }
+  if (ret->q_arg == -1) {
+    printf("%s:%d: argument '%s' not found in event '%s'\n",
+        __FILE__, __LINE__, Q, event_name);
+    abort();
+  }
+  if (strcmp(f.type[ret->i_arg], "int") != 0) {
+    printf("%s:%d: argument '%s' has wrong type (should be 'int')\n",
+        __FILE__, __LINE__, I);
+    abort();
+  }
+  if (strcmp(f.type[ret->q_arg], "int") != 0) {
+    printf("%s:%d: argument '%s' has wrong type (should be 'int')\n",
+        __FILE__, __LINE__, Q);
+    abort();
+  }
+
+  return ret;
+}
diff --git a/common/utils/T/tracer/logger/iqlog.c b/common/utils/T/tracer/logger/iqlog.c
new file mode 100644
index 0000000000000000000000000000000000000000..bea8adccc50b4815da137056f57c7517b0db9799
--- /dev/null
+++ b/common/utils/T/tracer/logger/iqlog.c
@@ -0,0 +1,187 @@
+#include "logger.h"
+#include "logger_defs.h"
+#include "handler.h"
+#include "database.h"
+#include "filter/filter.h"
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <math.h>
+
+struct iqlog {
+  struct logger common;
+  void *database;
+  int nb_rb_arg;
+  int N_RB_UL_arg;
+  int symbols_per_tti_arg;
+  int buffer_arg;
+  float *i;
+  float *q;
+  int max_length;
+};
+
+#if 0
+/* this function passes all received IQ samples to the views */
+static void _event(void *p, event e)
+{
+  struct iqlog *l = p;
+  int i;
+  void *buffer;
+  int bsize;
+  int nsamples;
+
+  if (l->common.filter != NULL && filter_eval(l->common.filter, e) == 0)
+    return;
+
+  buffer = e.e[l->buffer_arg].b;
+  bsize = e.e[l->buffer_arg].bsize;
+
+  nsamples = bsize / (2*sizeof(int16_t));
+
+  if (nsamples > l->max_length) {
+    l->i = realloc(l->i, nsamples * sizeof(float));
+    if (l->i == NULL) abort();
+    l->q = realloc(l->q, nsamples * sizeof(float));
+    if (l->q == NULL) abort();
+    l->max_length = nsamples;
+  }
+
+  for (i = 0; i < nsamples; i++) {
+    l->i[i] = ((int16_t *)buffer)[i*2];
+    l->q[i] = ((int16_t *)buffer)[i*2+1];
+  }
+
+  for (i = 0; i < l->common.vsize; i++)
+    l->common.v[i]->append(l->common.v[i], l->i, l->q, nsamples);
+}
+#endif
+
+static void _event(void *p, event e)
+{
+  struct iqlog *l = p;
+  int i, j;
+  void *buffer;
+  int bsize;
+  int nb_rb;
+  int N_RB_UL;
+  int symbols_per_tti;
+  int max_nsamples;
+  float *idst, *qdst;
+  int count;
+
+  if (l->common.filter != NULL && filter_eval(l->common.filter, e) == 0)
+    return;
+
+  nb_rb = e.e[l->nb_rb_arg].i;
+  N_RB_UL = e.e[l->N_RB_UL_arg].i;
+  symbols_per_tti = e.e[l->symbols_per_tti_arg].i;
+
+  buffer = e.e[l->buffer_arg].b;
+  bsize = e.e[l->buffer_arg].bsize;
+
+  if (bsize != N_RB_UL * symbols_per_tti * 12 * 4) {
+    printf("%s:%d:%s: bad buffer size\n", __FILE__, __LINE__, __FUNCTION__);
+    abort();
+  }
+
+  max_nsamples = bsize / 4;
+
+  if (max_nsamples > l->max_length) {
+    l->i = realloc(l->i, max_nsamples * sizeof(float));
+    if (l->i == NULL) abort();
+    l->q = realloc(l->q, max_nsamples * sizeof(float));
+    if (l->q == NULL) abort();
+    l->max_length = max_nsamples;
+  }
+
+  idst = l->i;
+  qdst = l->q;
+  count = 0;
+  for (i = 0; i < symbols_per_tti; i++)
+    for (j = 0; j < 12 * nb_rb; j++) {
+      *idst = ((int16_t *)buffer)[(i*N_RB_UL*12 + j) * 2];
+      *qdst = ((int16_t *)buffer)[(i*N_RB_UL*12 + j) * 2 + 1];
+      idst++;
+      qdst++;
+      count++;
+    }
+
+  for (i = 0; i < l->common.vsize; i++)
+    l->common.v[i]->append(l->common.v[i], l->i, l->q, count);
+}
+
+logger *new_iqlog(event_handler *h, void *database,
+    char *event_name, char *nb_rb, char *N_RB_UL, char *symbols_per_tti,
+    char *buffer_varname)
+{
+  struct iqlog *ret;
+  int event_id;
+  database_event_format f;
+  int i;
+
+  ret = calloc(1, sizeof(struct iqlog)); if (ret == NULL) abort();
+
+  ret->common.event_name = strdup(event_name);
+  if (ret->common.event_name == NULL) abort();
+  ret->database = database;
+
+  event_id = event_id_from_name(database, event_name);
+
+  ret->common.handler_id = register_handler_function(h,event_id,_event,ret);
+
+  f = get_format(database, event_id);
+
+  /* look for args */
+  ret->nb_rb_arg = -1;
+  ret->N_RB_UL_arg = -1;
+  ret->symbols_per_tti_arg = -1;
+  ret->buffer_arg = -1;
+  for (i = 0; i < f.count; i++) {
+    if (!strcmp(f.name[i], nb_rb)) ret->nb_rb_arg = i;
+    if (!strcmp(f.name[i], N_RB_UL)) ret->N_RB_UL_arg = i;
+    if (!strcmp(f.name[i], symbols_per_tti)) ret->symbols_per_tti_arg = i;
+    if (!strcmp(f.name[i], buffer_varname)) ret->buffer_arg = i;
+  }
+  if (ret->nb_rb_arg == -1) {
+    printf("%s:%d: argument '%s' not found in event '%s'\n",
+        __FILE__, __LINE__, nb_rb, event_name);
+    abort();
+  }
+  if (ret->N_RB_UL_arg == -1) {
+    printf("%s:%d: argument '%s' not found in event '%s'\n",
+        __FILE__, __LINE__, N_RB_UL, event_name);
+    abort();
+  }
+  if (ret->symbols_per_tti_arg == -1) {
+    printf("%s:%d: argument '%s' not found in event '%s'\n",
+        __FILE__, __LINE__, symbols_per_tti, event_name);
+    abort();
+  }
+  if (ret->buffer_arg == -1) {
+    printf("%s:%d: buffer argument '%s' not found in event '%s'\n",
+        __FILE__, __LINE__, buffer_varname, event_name);
+    abort();
+  }
+  if (strcmp(f.type[ret->nb_rb_arg], "int") != 0) {
+    printf("%s:%d: argument '%s' has wrong type (should be 'int')\n",
+        __FILE__, __LINE__, nb_rb);
+    abort();
+  }
+  if (strcmp(f.type[ret->N_RB_UL_arg], "int") != 0) {
+    printf("%s:%d: argument '%s' has wrong type (should be 'int')\n",
+        __FILE__, __LINE__, N_RB_UL);
+    abort();
+  }
+  if (strcmp(f.type[ret->symbols_per_tti_arg], "int") != 0) {
+    printf("%s:%d: argument '%s' has wrong type (should be 'int')\n",
+        __FILE__, __LINE__, symbols_per_tti);
+    abort();
+  }
+  if (strcmp(f.type[ret->buffer_arg], "buffer") != 0) {
+    printf("%s:%d: argument '%s' has wrong type (should be 'buffer')\n",
+        __FILE__, __LINE__, buffer_varname);
+    abort();
+  }
+
+  return ret;
+}
diff --git a/common/utils/T/tracer/logger/logger.c b/common/utils/T/tracer/logger/logger.c
new file mode 100644
index 0000000000000000000000000000000000000000..ab6fb8bc625e97bc0f5b7ea848a8c25c422b463e
--- /dev/null
+++ b/common/utils/T/tracer/logger/logger.c
@@ -0,0 +1,17 @@
+#include "logger.h"
+#include "logger_defs.h"
+#include <stdlib.h>
+
+void logger_add_view(logger *_l, view *v)
+{
+  struct logger *l = _l;
+  l->vsize++;
+  l->v = realloc(l->v, l->vsize * sizeof(view *)); if (l->v == NULL) abort();
+  l->v[l->vsize-1] = v;
+}
+
+void logger_set_filter(logger *_l, void *filter)
+{
+  struct logger *l = _l;
+  l->filter = filter;
+}
diff --git a/common/utils/T/tracer/logger/logger.h b/common/utils/T/tracer/logger/logger.h
new file mode 100644
index 0000000000000000000000000000000000000000..b2ab4f8cbcd09367d30ffa74a0d16891f83b4264
--- /dev/null
+++ b/common/utils/T/tracer/logger/logger.h
@@ -0,0 +1,32 @@
+#ifndef _LOGGER_H_
+#define _LOGGER_H_
+
+typedef void logger;
+
+logger *new_framelog(void *event_handler, void *database,
+    char *event_name, char *subframe_varname, char *buffer_varname);
+logger *new_textlog(void *event_handler, void *database,
+    char *event_name, char *format);
+logger *new_ttilog(void *event_handler, void *database,
+    char *event_name, char *frame_varname, char *subframe_varname,
+    char *data_varname, int convert_to_dB);
+logger *new_timelog(void *event_handler, void *database, char *event_name);
+logger *new_ticklog(void *event_handler, void *database,
+    char *event_name, char *frame_name, char *subframe_name);
+logger *new_iqlog(void *event_handler, void *database,
+    char *event_name, char *nb_rb, char *N_RB_UL, char *symbols_per_tti,
+    char *buffer_varname);
+logger *new_iqdotlog(void *event_handler, void *database,
+    char *event_name, char *I, char *Q);
+
+void framelog_set_skip(logger *_this, int skip_delay);
+void framelog_set_update_only_at_sf9(logger *_this, int update_only_at_sf9);
+
+void textlog_dump_buffer(logger *_this, int dump_buffer);
+
+#include "view/view.h"
+
+void logger_add_view(logger *l, view *v);
+void logger_set_filter(logger *l, void *filter);
+
+#endif /* _LOGGER_H_ */
diff --git a/common/utils/T/tracer/logger/logger_defs.h b/common/utils/T/tracer/logger/logger_defs.h
new file mode 100644
index 0000000000000000000000000000000000000000..8e8d6a2d3e8e59d939114e8f490c7c79185667d1
--- /dev/null
+++ b/common/utils/T/tracer/logger/logger_defs.h
@@ -0,0 +1,16 @@
+#ifndef _LOGGER_DEFS_H_
+#define _LOGGER_DEFS_H_
+
+#include "view/view.h"
+
+struct logger {
+  char *event_name;
+  unsigned long handler_id;
+  /* list of views */
+  view **v;
+  int vsize;
+  /* filter - NULL if no filter set */
+  void *filter;
+};
+
+#endif /* _LOGGER_DEFS_H_ */
diff --git a/common/utils/T/tracer/logger/textlog.c b/common/utils/T/tracer/logger/textlog.c
new file mode 100644
index 0000000000000000000000000000000000000000..9eb6fd02d8fbbec5d63702c4b89d80df2327fe92
--- /dev/null
+++ b/common/utils/T/tracer/logger/textlog.c
@@ -0,0 +1,217 @@
+#include "logger.h"
+#include "logger_defs.h"
+#include "handler.h"
+#include "database.h"
+#include "view/view.h"
+#include "utils.h"
+#include "filter/filter.h"
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+enum format_item_type {
+  INSTRING,
+  INT, ULONG, STRING, BUFFER };
+
+struct format_item {
+  enum format_item_type type;
+  union {
+    /* INSTRING */
+    char *s;
+    /* others */
+    int event_arg;
+  };
+};
+
+struct textlog {
+  struct logger common;
+  char *format;
+  void *database;
+  /* parsed format string */
+  struct format_item *f;
+  int fsize;
+  /* local output buffer */
+  OBUF o;
+  int dump_buffer;
+};
+
+static void _event(void *p, event e)
+{
+  struct textlog *l = p;
+  int i, j;
+#ifdef T_SEND_TIME
+  struct tm *t;
+  char tt[64];
+#endif
+
+  if (l->common.filter != NULL && filter_eval(l->common.filter, e) == 0)
+    return;
+
+  l->o.osize = 0;
+
+#ifdef T_SEND_TIME
+  t = localtime(&e.sending_time.tv_sec);
+  /* round tv_nsec to nearest millisecond */
+  sprintf(tt, "%2.2d:%2.2d:%2.2d.%9.9ld: ", t->tm_hour, t->tm_min, t->tm_sec,
+      e.sending_time.tv_nsec);
+  PUTS(&l->o, tt);
+#endif
+
+  for (i = 0; i < l->fsize; i++)
+  switch(l->f[i].type) {
+  case INSTRING: PUTS(&l->o, l->f[i].s); break;
+  case INT:      PUTI(&l->o, e.e[l->f[i].event_arg].i); break;
+  case ULONG:    PUTUL(&l->o, e.e[l->f[i].event_arg].ul); break;
+  case STRING:   PUTS_CLEAN(&l->o, e.e[l->f[i].event_arg].s); break;
+  case BUFFER:
+    PUTS(&l->o, "{buffer size:");
+    PUTI(&l->o, e.e[l->f[i].event_arg].bsize);
+    if (l->dump_buffer) {
+      PUTS(&l->o, " [");
+      for (j = 0; j < e.e[l->f[i].event_arg].bsize; j++) {
+        PUTX2(&l->o, ((unsigned char *)e.e[l->f[i].event_arg].b)[j]);
+        PUTC(&l->o, ' ');
+      }
+      PUTS(&l->o, "]");
+    }
+    PUTS(&l->o, "}");
+    break;
+  }
+  PUTC(&l->o, 0);
+
+  for (i = 0; i < l->common.vsize; i++)
+    l->common.v[i]->append(l->common.v[i], l->o.obuf);
+}
+
+enum chunk_type { C_ERROR, C_STRING, C_ARG_NAME, C_EVENT_NAME };
+struct chunk {
+  enum chunk_type type;
+  char *s;
+  enum format_item_type it;
+  int event_arg;
+};
+
+/* TODO: speed it up? */
+static int find_argument(char *name, database_event_format f,
+    enum format_item_type *it, int *event_arg)
+{
+  int i;
+  for (i = 0; i < f.count; i++) if (!strcmp(name, f.name[i])) break;
+  if (i == f.count) return 0;
+  *event_arg = i;
+  if (!strcmp(f.type[i], "int"))         *it = INT;
+  else if (!strcmp(f.type[i], "ulong"))  *it = ULONG;
+  else if (!strcmp(f.type[i], "string")) *it = STRING;
+  else if (!strcmp(f.type[i], "buffer")) *it = BUFFER;
+  else return 0;
+  return 1;
+}
+
+static struct chunk next_chunk(char **s, database_event_format f)
+{
+  char *cur = *s;
+  char *name;
+  enum format_item_type it;
+  int event_arg;
+
+  /* argument in [ ] */
+  if (*cur == '[') {
+    *cur = 0;
+    cur++;
+    name = cur;
+    /* no \ allowed there */
+    while (*cur && *cur != ']' && *cur != '\\') cur++;
+    if (*cur != ']') goto error;
+    *cur = 0;
+    cur++;
+    *s = cur;
+    if (find_argument(name, f, &it, &event_arg) == 0) goto error;
+    return (struct chunk){type:C_ARG_NAME, s:name, it:it, event_arg:event_arg};
+  }
+
+  /* { } is name of event (anything in between is smashed) */
+  if (*cur == '{') {
+    *cur = 0;
+    cur++;
+    while (*cur && *cur != '}') cur++;
+    if (*cur != '}') goto error;
+    *cur = 0;
+    cur++;
+    *s = cur;
+    return (struct chunk){type:C_EVENT_NAME};
+  }
+
+  /* anything but [ and { is raw string */
+  /* TODO: deal with \ */
+  name = cur;
+  while (*cur && *cur != '[' && *cur != '{') cur++;
+  *s = cur;
+  return (struct chunk){type:C_STRING, s:name};
+
+error:
+  return (struct chunk){type:C_ERROR};
+}
+
+logger *new_textlog(event_handler *h, void *database,
+    char *event_name, char *format)
+{
+  struct textlog *ret;
+  int event_id;
+  database_event_format f;
+  char *cur;
+
+  ret = calloc(1, sizeof(struct textlog)); if (ret == NULL) abort();
+
+  ret->common.event_name = strdup(event_name);
+  if (ret->common.event_name == NULL) abort();
+  ret->format = strdup(format); if (ret->format == NULL) abort();
+  ret->database = database;
+
+  event_id = event_id_from_name(database, event_name);
+
+  ret->common.handler_id = register_handler_function(h,event_id,_event,ret);
+
+  f = get_format(database, event_id);
+
+  /* we won't get more than strlen(format) "chunks" */
+  ret->f = malloc(sizeof(struct format_item) * strlen(format));
+  if (ret->f == NULL) abort();
+
+  cur = ret->format;
+
+  while (*cur) {
+    struct chunk c = next_chunk(&cur, f);
+    switch (c.type) {
+    case C_ERROR: goto error;
+    case C_STRING:
+      ret->f[ret->fsize].type = INSTRING;
+      ret->f[ret->fsize].s = c.s;
+      break;
+    case C_ARG_NAME:
+      ret->f[ret->fsize].type = c.it;
+      ret->f[ret->fsize].event_arg = c.event_arg;
+      break;
+    case C_EVENT_NAME:
+      ret->f[ret->fsize].type = INSTRING;
+      ret->f[ret->fsize].s = ret->common.event_name;
+      break;
+    }
+    ret->fsize++;
+  }
+
+  return ret;
+
+error:
+  printf("%s:%d: bad format '%s'\n", __FILE__, __LINE__, format);
+  abort();
+}
+
+/****************************************************************************/
+/*                             public functions                             */
+/****************************************************************************/
+
+void textlog_dump_buffer(logger *_this, int dump_buffer)
+{
+  struct textlog *l = _this;
+  l->dump_buffer = dump_buffer;
+}
diff --git a/common/utils/T/tracer/logger/ticklog.c b/common/utils/T/tracer/logger/ticklog.c
new file mode 100644
index 0000000000000000000000000000000000000000..7a3bc45338858a953182fcb81d99d86a73b7a3de
--- /dev/null
+++ b/common/utils/T/tracer/logger/ticklog.c
@@ -0,0 +1,84 @@
+#include "logger.h"
+#include "logger_defs.h"
+#include "event.h"
+#include "database.h"
+#include "handler.h"
+#include "filter/filter.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+struct ticklog {
+  struct logger common;
+  void *database;
+  int frame_arg;
+  int subframe_arg;
+};
+
+static void _event(void *p, event e)
+{
+  struct ticklog *l = p;
+  int i;
+  int frame;
+  int subframe;
+
+  if (l->common.filter != NULL && filter_eval(l->common.filter, e) == 0)
+    return;
+
+  frame = e.e[l->frame_arg].i;
+  subframe = e.e[l->subframe_arg].i;
+
+  for (i = 0; i < l->common.vsize; i++)
+    l->common.v[i]->append(l->common.v[i], e.sending_time, frame, subframe);
+}
+
+logger *new_ticklog(event_handler *h, void *database,
+    char *event_name, char *frame_varname, char *subframe_varname)
+{
+  struct ticklog *ret;
+  int event_id;
+  database_event_format f;
+  int i;
+
+  ret = calloc(1, sizeof(struct ticklog)); if (ret == NULL) abort();
+
+  ret->common.event_name = strdup(event_name);
+  if (ret->common.event_name == NULL) abort();
+  ret->database = database;
+
+  event_id = event_id_from_name(database, event_name);
+
+  ret->common.handler_id = register_handler_function(h,event_id,_event,ret);
+
+  f = get_format(database, event_id);
+
+  /* look for frame and subframe args */
+  ret->frame_arg = -1;
+  ret->subframe_arg = -1;
+  for (i = 0; i < f.count; i++) {
+    if (!strcmp(f.name[i], frame_varname)) ret->frame_arg = i;
+    if (!strcmp(f.name[i], subframe_varname)) ret->subframe_arg = i;
+  }
+  if (ret->frame_arg == -1) {
+    printf("%s:%d: frame argument '%s' not found in event '%s'\n",
+        __FILE__, __LINE__, frame_varname, event_name);
+    abort();
+  }
+  if (ret->subframe_arg == -1) {
+    printf("%s:%d: subframe argument '%s' not found in event '%s'\n",
+        __FILE__, __LINE__, subframe_varname, event_name);
+    abort();
+  }
+  if (strcmp(f.type[ret->frame_arg], "int") != 0) {
+    printf("%s:%d: argument '%s' has wrong type (should be 'int')\n",
+        __FILE__, __LINE__, frame_varname);
+    abort();
+  }
+  if (strcmp(f.type[ret->subframe_arg], "int") != 0) {
+    printf("%s:%d: argument '%s' has wrong type (should be 'int')\n",
+        __FILE__, __LINE__, subframe_varname);
+    abort();
+  }
+
+  return ret;
+}
diff --git a/common/utils/T/tracer/logger/timelog.c b/common/utils/T/tracer/logger/timelog.c
new file mode 100644
index 0000000000000000000000000000000000000000..b474c8200d16cbdac17c6be4ed847b0d11bfe19a
--- /dev/null
+++ b/common/utils/T/tracer/logger/timelog.c
@@ -0,0 +1,41 @@
+#include "logger.h"
+#include "logger_defs.h"
+#include "event.h"
+#include "database.h"
+#include "handler.h"
+#include "filter/filter.h"
+#include <stdlib.h>
+#include <string.h>
+
+struct timelog {
+  struct logger common;
+};
+
+static void _event(void *p, event e)
+{
+  struct timelog *l = p;
+  int i;
+
+  if (l->common.filter != NULL && filter_eval(l->common.filter, e) == 0)
+    return;
+
+  for (i = 0; i < l->common.vsize; i++)
+    l->common.v[i]->append(l->common.v[i], e.sending_time);
+}
+
+logger *new_timelog(event_handler *h, void *database, char *event_name)
+{
+  struct timelog *ret;
+  int event_id;
+
+  ret = calloc(1, sizeof(struct timelog)); if (ret == NULL) abort();
+
+  ret->common.event_name = strdup(event_name);
+  if (ret->common.event_name == NULL) abort();
+
+  event_id = event_id_from_name(database, event_name);
+
+  ret->common.handler_id = register_handler_function(h,event_id,_event,ret);
+
+  return ret;
+}
diff --git a/common/utils/T/tracer/logger/ttilog.c b/common/utils/T/tracer/logger/ttilog.c
new file mode 100644
index 0000000000000000000000000000000000000000..29e22fbf10e97e8df1e32929320108e3601d1f24
--- /dev/null
+++ b/common/utils/T/tracer/logger/ttilog.c
@@ -0,0 +1,111 @@
+#include "logger.h"
+#include "logger_defs.h"
+#include "event.h"
+#include "database.h"
+#include "handler.h"
+#include "filter/filter.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+struct ttilog {
+  struct logger common;
+  void *database;
+  int frame_arg;
+  int subframe_arg;
+  int data_arg;
+  int convert_to_dB;
+};
+
+static void _event(void *p, event e)
+{
+  struct ttilog *l = p;
+  int i;
+  int frame;
+  int subframe;
+  float value;
+
+  if (l->common.filter != NULL && filter_eval(l->common.filter, e) == 0)
+    return;
+
+  frame = e.e[l->frame_arg].i;
+  subframe = e.e[l->subframe_arg].i;
+  switch (e.e[l->data_arg].type) {
+  case EVENT_INT: value = e.e[l->data_arg].i; break;
+  case EVENT_ULONG: value = e.e[l->data_arg].ul; break;
+  default: printf("%s:%d: unsupported type\n", __FILE__, __LINE__); abort();
+  }
+
+  if (l->convert_to_dB) value = 10 * log10(value);
+
+  for (i = 0; i < l->common.vsize; i++)
+    l->common.v[i]->append(l->common.v[i], frame, subframe, value);
+}
+
+logger *new_ttilog(event_handler *h, void *database,
+    char *event_name, char *frame_varname, char *subframe_varname,
+    char *data_varname, int convert_to_dB)
+{
+  struct ttilog *ret;
+  int event_id;
+  database_event_format f;
+  int i;
+
+  ret = calloc(1, sizeof(struct ttilog)); if (ret == NULL) abort();
+
+  ret->common.event_name = strdup(event_name);
+  if (ret->common.event_name == NULL) abort();
+  ret->database = database;
+  ret->convert_to_dB = convert_to_dB;
+
+  event_id = event_id_from_name(database, event_name);
+
+  ret->common.handler_id = register_handler_function(h,event_id,_event,ret);
+
+  f = get_format(database, event_id);
+
+  /* look for frame, subframe and data args */
+  ret->frame_arg = -1;
+  ret->subframe_arg = -1;
+  ret->data_arg = -1;
+  for (i = 0; i < f.count; i++) {
+    if (!strcmp(f.name[i], frame_varname)) ret->frame_arg = i;
+    if (!strcmp(f.name[i], subframe_varname)) ret->subframe_arg = i;
+    if (!strcmp(f.name[i], data_varname)) ret->data_arg = i;
+  }
+  if (ret->frame_arg == -1) {
+    printf("%s:%d: frame argument '%s' not found in event '%s'\n",
+        __FILE__, __LINE__, frame_varname, event_name);
+    abort();
+  }
+  if (ret->subframe_arg == -1) {
+    printf("%s:%d: subframe argument '%s' not found in event '%s'\n",
+        __FILE__, __LINE__, subframe_varname, event_name);
+    abort();
+  }
+  if (ret->data_arg == -1) {
+    printf("%s:%d: data argument '%s' not found in event '%s'\n",
+        __FILE__, __LINE__, data_varname, event_name);
+    abort();
+  }
+  if (strcmp(f.type[ret->frame_arg], "int") != 0) {
+    printf("%s:%d: argument '%s' has wrong type (should be 'int')\n",
+        __FILE__, __LINE__, frame_varname);
+    abort();
+  }
+  if (strcmp(f.type[ret->subframe_arg], "int") != 0) {
+    printf("%s:%d: argument '%s' has wrong type (should be 'int')\n",
+        __FILE__, __LINE__, subframe_varname);
+    abort();
+  }
+  if (strcmp(f.type[ret->data_arg], "int") != 0 &&
+      strcmp(f.type[ret->data_arg], "float") != 0) {
+    printf("%s:%d: argument '%s' has wrong type"
+           " (should be 'int' or 'float')\n",
+        __FILE__, __LINE__, data_varname);
+    abort();
+  }
+
+  return ret;
+}
diff --git a/common/utils/T/tracer/macpdu2wireshark.c b/common/utils/T/tracer/macpdu2wireshark.c
new file mode 100644
index 0000000000000000000000000000000000000000..886638f5ef2c6774045395cc593e20cbd12a50a9
--- /dev/null
+++ b/common/utils/T/tracer/macpdu2wireshark.c
@@ -0,0 +1,260 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <fcntl.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include "database.h"
+#include "event.h"
+#include "handler.h"
+#include "config.h"
+#include "utils.h"
+#include "packet-mac-lte.h"
+
+#define DEFAULT_IP   "127.0.0.1"
+#define DEFAULT_PORT 9999
+
+typedef struct {
+  int socket;
+  struct sockaddr_in to;
+  OBUF buf;
+  /* ul */
+  int ul_rnti;
+  int ul_frame;
+  int ul_subframe;
+  int ul_data;
+  /* dl */
+  int dl_rnti;
+  int dl_frame;
+  int dl_subframe;
+  int dl_data;
+} ev_data;
+
+void ul(void *_d, event e)
+{
+  ev_data *d = _d;
+  ssize_t ret;
+  int fsf;
+  int i;
+
+  d->buf.osize = 0;
+
+  PUTS(&d->buf, MAC_LTE_START_STRING);
+  PUTC(&d->buf, FDD_RADIO);
+  PUTC(&d->buf, DIRECTION_UPLINK);
+  PUTC(&d->buf, C_RNTI);
+
+  PUTC(&d->buf, MAC_LTE_RNTI_TAG);
+  PUTC(&d->buf, (e.e[d->ul_rnti].i>>8) & 255);
+  PUTC(&d->buf, e.e[d->ul_rnti].i & 255);
+
+  /* for newer version of wireshark? */
+  fsf = (e.e[d->ul_frame].i << 4) + e.e[d->ul_subframe].i;
+  /* for older version? */
+  fsf = e.e[d->ul_subframe].i;
+  PUTC(&d->buf, MAC_LTE_FRAME_SUBFRAME_TAG);
+  PUTC(&d->buf, (fsf>>8) & 255);
+  PUTC(&d->buf, fsf & 255);
+
+  PUTC(&d->buf, MAC_LTE_PAYLOAD_TAG);
+  for (i = 0; i < e.e[d->ul_data].bsize; i++)
+    PUTC(&d->buf, ((char*)e.e[d->ul_data].b)[i]);
+
+  ret = sendto(d->socket, d->buf.obuf, d->buf.osize, 0,
+      (struct sockaddr *)&d->to, sizeof(struct sockaddr_in));
+  if (ret != d->buf.osize) abort();
+}
+
+void dl(void *_d, event e)
+{
+  ev_data *d = _d;
+  ssize_t ret;
+  int fsf;
+  int i;
+
+  d->buf.osize = 0;
+
+  PUTS(&d->buf, MAC_LTE_START_STRING);
+  PUTC(&d->buf, FDD_RADIO);
+  PUTC(&d->buf, DIRECTION_DOWNLINK);
+  PUTC(&d->buf, C_RNTI);
+
+  PUTC(&d->buf, MAC_LTE_RNTI_TAG);
+  PUTC(&d->buf, (e.e[d->dl_rnti].i>>8) & 255);
+  PUTC(&d->buf, e.e[d->dl_rnti].i & 255);
+
+  /* for newer version of wireshark? */
+  fsf = (e.e[d->dl_frame].i << 4) + e.e[d->dl_subframe].i;
+  /* for older version? */
+  fsf = e.e[d->dl_subframe].i;
+  PUTC(&d->buf, MAC_LTE_FRAME_SUBFRAME_TAG);
+  PUTC(&d->buf, (fsf>>8) & 255);
+  PUTC(&d->buf, fsf & 255);
+
+  PUTC(&d->buf, MAC_LTE_PAYLOAD_TAG);
+  for (i = 0; i < e.e[d->dl_data].bsize; i++)
+    PUTC(&d->buf, ((char*)e.e[d->dl_data].b)[i]);
+
+  ret = sendto(d->socket, d->buf.obuf, d->buf.osize, 0,
+      (struct sockaddr *)&d->to, sizeof(struct sockaddr_in));
+  if (ret != d->buf.osize) abort();
+}
+
+void setup_data(ev_data *d, void *database, int ul_id, int dl_id)
+{
+  database_event_format f;
+  int i;
+
+  d->ul_rnti     = -1;
+  d->ul_frame    = -1;
+  d->ul_subframe = -1;
+  d->ul_data     = -1;
+
+  d->dl_rnti     = -1;
+  d->dl_frame    = -1;
+  d->dl_subframe = -1;
+  d->dl_data     = -1;
+
+#define G(var_name, var_type, var) \
+  if (!strcmp(f.name[i], var_name)) { \
+    if (strcmp(f.type[i], var_type)) goto error; \
+    var = i; \
+    continue; \
+  }
+
+  /* ul: rnti, frame, subframe, data */
+  f = get_format(database, ul_id);
+  for (i = 0; i < f.count; i++) {
+    G("rnti",     "int",    d->ul_rnti);
+    G("frame",    "int",    d->ul_frame);
+    G("subframe", "int",    d->ul_subframe);
+    G("data",     "buffer", d->ul_data);
+  }
+  if (d->ul_rnti == -1 || d->ul_frame == -1 || d->ul_subframe == -1 ||
+      d->ul_data == -1) goto error;
+
+  /* dl: rnti, frame, subframe, data */
+  f = get_format(database, dl_id);
+  for (i = 0; i < f.count; i++) {
+    G("rnti",     "int",    d->dl_rnti);
+    G("frame",    "int",    d->dl_frame);
+    G("subframe", "int",    d->dl_subframe);
+    G("data",     "buffer", d->dl_data);
+  }
+  if (d->dl_rnti == -1 || d->dl_frame == -1 || d->dl_subframe == -1 ||
+      d->dl_data == -1) goto error;
+
+#undef G
+
+  return;
+
+error:
+  printf("bad T_messages.txt\n");
+  abort();
+}
+
+void *receiver(void *_d)
+{
+  ev_data *d = _d;
+  int s;
+  char buf[100000];
+
+  s = socket(AF_INET, SOCK_DGRAM, 0);
+  if (s == -1) { perror("socket"); abort(); }
+
+  if (bind(s, (struct sockaddr *)&d->to, sizeof(struct sockaddr_in)) == -1)
+    { perror("bind"); abort(); }
+
+  while (1) {
+    if (recv(s, buf, 100000, 0) <= 0) abort();
+  }
+
+  return 0;
+}
+
+void usage(void)
+{
+  printf(
+"options:\n"
+"    -d <database file>        this option is mandatory\n"
+"    -in <dump file>           read events from this dump file\n"
+"    -ip <IP address>          send packets to this IP address (default %s)\n"
+"    -p <port>                 send packets to this port (default %d)\n",
+  DEFAULT_IP,
+  DEFAULT_PORT
+  );
+  exit(1);
+}
+
+int main(int n, char **v)
+{
+  char *database_filename = NULL;
+  char *input_filename = NULL;
+  void *database;
+  event_handler *h;
+  int in;
+  int i;
+  int ul_id, dl_id;
+  ev_data d;
+  char *ip = DEFAULT_IP;
+  int port = DEFAULT_PORT;
+
+  memset(&d, 0, sizeof(ev_data));
+
+  for (i = 1; i < n; i++) {
+    if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage();
+    if (!strcmp(v[i], "-d"))
+      { if (i > n-2) usage(); database_filename = v[++i]; continue; }
+    if (!strcmp(v[i], "-in"))
+      { if (i > n-2) usage(); input_filename = v[++i]; continue; }
+    if (!strcmp(v[i], "-ip")) { if (i > n-2) usage(); ip = v[++i]; continue; }
+    if (!strcmp(v[i], "-p")) {if(i>n-2)usage(); port=atoi(v[++i]); continue; }
+    usage();
+  }
+
+  if (database_filename == NULL) {
+    printf("ERROR: provide a database file (-d)\n");
+    exit(1);
+  }
+
+  if (input_filename == NULL) {
+    printf("ERROR: provide an input file (-i)\n");
+    exit(1);
+  }
+
+  in = open(input_filename, O_RDONLY);
+  if (in == -1) { perror(input_filename); return 1; }
+
+  database = parse_database(database_filename);
+  load_config_file(database_filename);
+
+  h = new_handler(database);
+
+  ul_id = event_id_from_name(database, "ENB_MAC_UE_UL_PDU_WITH_DATA");
+  dl_id = event_id_from_name(database, "ENB_MAC_UE_DL_PDU_WITH_DATA");
+  setup_data(&d, database, ul_id, dl_id);
+
+  register_handler_function(h, ul_id, ul, &d);
+  register_handler_function(h, dl_id, dl, &d);
+
+  d.socket = socket(AF_INET, SOCK_DGRAM, 0);
+  if (d.socket == -1) { perror("socket"); exit(1); }
+
+  d.to.sin_family = AF_INET;
+  d.to.sin_port = htons(port);
+  d.to.sin_addr.s_addr = inet_addr(ip);
+
+  new_thread(receiver, &d);
+
+  /* read messages */
+  while (1) {
+    char v[T_BUFFER_MAX];
+    event e;
+    e = get_event(in, v, database);
+    if (e.type == -1) break;
+    if (!(e.type == ul_id || e.type == dl_id)) continue;
+    handle_event(h, e);
+  }
+
+  return 0;
+}
diff --git a/common/utils/T/tracer/openair_logo.h b/common/utils/T/tracer/openair_logo.h
new file mode 100644
index 0000000000000000000000000000000000000000..4fc49cce3a3eb0068b31dc60fb5b4c830701890a
--- /dev/null
+++ b/common/utils/T/tracer/openair_logo.h
@@ -0,0 +1,592 @@
+/* this file (minus this comment) was obtained by running:
+ *   xxd -i openair_logo.png > openair_logo.h
+ */
+unsigned char openair_logo_png[] = {
+  0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
+  0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x3c,
+  0x08, 0x06, 0x00, 0x00, 0x00, 0xcf, 0x2e, 0x90, 0x87, 0x00, 0x00, 0x1b,
+  0x39, 0x49, 0x44, 0x41, 0x54, 0x78, 0xda, 0xed, 0x9d, 0x79, 0x70, 0x1c,
+  0xd7, 0x7d, 0xe7, 0x3f, 0xaf, 0xbb, 0xa7, 0xe7, 0x02, 0x06, 0xf7, 0x8d,
+  0xc1, 0xc5, 0x03, 0xa0, 0x48, 0x91, 0x94, 0x64, 0x52, 0x24, 0xbd, 0x96,
+  0xe4, 0x48, 0xb2, 0x9d, 0xc4, 0x76, 0x7c, 0xc5, 0x89, 0x53, 0x59, 0xef,
+  0x3a, 0xeb, 0x72, 0xe2, 0xdd, 0x8a, 0x1d, 0xa7, 0xca, 0xf6, 0x3a, 0x5b,
+  0x59, 0x67, 0xbd, 0xde, 0x4d, 0x7c, 0x24, 0xf6, 0x7a, 0x53, 0x71, 0xec,
+  0x8a, 0x6d, 0xc5, 0x67, 0x39, 0x4e, 0x36, 0x76, 0x2c, 0x7b, 0x23, 0x5b,
+  0xca, 0xea, 0xb0, 0x49, 0x49, 0x94, 0x28, 0x92, 0x00, 0x49, 0x00, 0x84,
+  0x00, 0x10, 0x04, 0x06, 0xc7, 0x00, 0x83, 0x01, 0xe6, 0x9e, 0x3e, 0xde,
+  0xfe, 0xd1, 0x3d, 0x03, 0x0c, 0x0e, 0x12, 0xa4, 0x48, 0x29, 0x06, 0xe7,
+  0x57, 0x35, 0x85, 0x41, 0x1f, 0xaf, 0x5f, 0xf7, 0x7c, 0xdf, 0xef, 0x7d,
+  0x7f, 0xdf, 0xf7, 0x7b, 0xaf, 0x85, 0x94, 0x52, 0x52, 0xb6, 0x57, 0xd4,
+  0x6c, 0x29, 0xb1, 0xa5, 0x64, 0x21, 0x93, 0x67, 0x60, 0x3e, 0xc6, 0xd8,
+  0x62, 0x82, 0x68, 0x32, 0x4d, 0xce, 0x30, 0x51, 0x05, 0x28, 0x42, 0xa0,
+  0x09, 0x08, 0xa8, 0x2a, 0x0d, 0x41, 0x3f, 0xed, 0x55, 0x15, 0x74, 0xd5,
+  0x84, 0x68, 0xae, 0x0c, 0xa2, 0x28, 0x0a, 0x8a, 0x10, 0xe5, 0x87, 0xe8,
+  0x9a, 0x28, 0x03, 0xfa, 0x95, 0xb3, 0xbc, 0x65, 0xb3, 0x98, 0xcd, 0xf3,
+  0xdc, 0x6c, 0x8c, 0xa7, 0x23, 0x73, 0xa8, 0xc0, 0xa1, 0x96, 0x3a, 0xf6,
+  0xd4, 0x55, 0x13, 0xae, 0x0c, 0xe2, 0x51, 0x95, 0x75, 0xe7, 0x2c, 0xa4,
+  0xb3, 0x4c, 0xc5, 0x97, 0x19, 0x5b, 0x88, 0xb3, 0x9c, 0xc9, 0xd0, 0x53,
+  0x57, 0xcd, 0xee, 0xc6, 0x7a, 0xaa, 0xfc, 0x3e, 0x74, 0x4d, 0x2d, 0x03,
+  0xba, 0x0c, 0xe8, 0x97, 0xdf, 0xa4, 0x84, 0xf1, 0x44, 0x8a, 0x67, 0x67,
+  0x16, 0x38, 0x13, 0x8d, 0x73, 0x47, 0x43, 0x35, 0x6f, 0xe8, 0x6a, 0xa1,
+  0x52, 0xf7, 0x5c, 0x5b, 0x39, 0xc0, 0xf0, 0x4c, 0x94, 0x91, 0xb9, 0x05,
+  0xaa, 0xfd, 0x3e, 0xba, 0xeb, 0x6b, 0x68, 0xaa, 0xaa, 0x44, 0x55, 0x94,
+  0x32, 0xa0, 0xcb, 0xf6, 0xf2, 0x58, 0xda, 0xb4, 0x78, 0xec, 0xf2, 0x2c,
+  0xfd, 0xd1, 0x25, 0x76, 0xd7, 0x54, 0xf0, 0xe6, 0x9e, 0x36, 0x74, 0xf5,
+  0xa5, 0x03, 0x70, 0x2c, 0xba, 0xc0, 0x78, 0x74, 0x91, 0xda, 0x80, 0x8f,
+  0xee, 0xc6, 0x3a, 0x42, 0x01, 0x7f, 0x19, 0xd0, 0x65, 0xbb, 0xb9, 0x36,
+  0x9f, 0xcd, 0xf1, 0xd0, 0xf9, 0x4b, 0x04, 0x34, 0x85, 0x37, 0x76, 0xb5,
+  0xd2, 0x11, 0x0a, 0xdc, 0xd0, 0xf2, 0x4d, 0xcb, 0x66, 0x28, 0x32, 0xc3,
+  0x72, 0x3a, 0x43, 0x47, 0x7d, 0x2d, 0x6d, 0x75, 0x35, 0x65, 0x40, 0x97,
+  0xed, 0xe6, 0xd8, 0x5c, 0x26, 0xc7, 0x9f, 0x3d, 0x3f, 0xc4, 0x6b, 0x5a,
+  0xea, 0xf8, 0xe5, 0xae, 0x66, 0x7c, 0xea, 0xcd, 0xe3, 0xbb, 0xb3, 0xf1,
+  0x65, 0xc6, 0x67, 0xe6, 0x68, 0xa8, 0x0e, 0xd1, 0xd3, 0xdc, 0x78, 0x4b,
+  0x3d, 0x67, 0xad, 0x0c, 0xb5, 0x9b, 0x6f, 0xcb, 0x79, 0x93, 0x0f, 0xff,
+  0x7c, 0x80, 0xff, 0x70, 0x5b, 0x27, 0xf7, 0xb4, 0xd6, 0xdf, 0xf4, 0xeb,
+  0x35, 0x55, 0x87, 0xf0, 0xeb, 0x1e, 0x86, 0x27, 0x23, 0x28, 0x40, 0xd7,
+  0x2d, 0x04, 0x6a, 0xa5, 0x0c, 0xb7, 0x9b, 0x6f, 0xbf, 0xf7, 0xf8, 0x69,
+  0xde, 0xfb, 0x32, 0x81, 0xb9, 0x60, 0xa1, 0x80, 0x9f, 0xdd, 0xed, 0xad,
+  0x2c, 0x2c, 0x25, 0x88, 0x2e, 0x2e, 0x95, 0x3d, 0x74, 0xd9, 0x6e, 0x8c,
+  0x7d, 0xe4, 0xc4, 0x79, 0xde, 0xdc, 0xdd, 0xcc, 0x6b, 0xb6, 0x08, 0x66,
+  0x09, 0x0c, 0x44, 0x17, 0x39, 0x35, 0xb3, 0x40, 0x64, 0x29, 0x41, 0xce,
+  0x30, 0xd0, 0x84, 0x20, 0xe4, 0x51, 0x69, 0xab, 0x0c, 0xb2, 0xb3, 0xbe,
+  0x86, 0x3d, 0x8d, 0x75, 0x5b, 0x92, 0xe8, 0x42, 0x01, 0x3f, 0x1d, 0x8d,
+  0xf5, 0x44, 0xe6, 0x17, 0xa8, 0xf0, 0xfb, 0xf0, 0xfb, 0xbc, 0x65, 0x0e,
+  0x5d, 0xb6, 0xeb, 0xb7, 0x47, 0x2e, 0xcf, 0xf1, 0xe8, 0xe5, 0x39, 0x3e,
+  0x75, 0x74, 0xef, 0x55, 0x07, 0x3f, 0xf2, 0x96, 0xcd, 0x4f, 0x26, 0x66,
+  0xf8, 0xd1, 0xe8, 0x14, 0xbd, 0x55, 0x15, 0xdc, 0x1b, 0x6e, 0x62, 0x57,
+  0x75, 0x25, 0x15, 0x5e, 0x4f, 0x31, 0xe0, 0x9b, 0x49, 0xa4, 0x18, 0x5b,
+  0x58, 0x64, 0x2c, 0xba, 0x40, 0x67, 0x4d, 0x15, 0x77, 0x75, 0xb6, 0x51,
+  0xb1, 0x05, 0x90, 0x8e, 0x5c, 0x9e, 0x42, 0x55, 0x14, 0xba, 0x5a, 0x9b,
+  0x11, 0xdb, 0x7c, 0x10, 0xa6, 0x0c, 0xe8, 0x9b, 0x64, 0x69, 0xd3, 0xe2,
+  0xfd, 0x4f, 0x9c, 0xe6, 0x13, 0x87, 0x6f, 0xa3, 0xb3, 0xd2, 0x7f, 0x45,
+  0x8f, 0x3c, 0x18, 0x5b, 0xe6, 0xaf, 0xcf, 0x8e, 0xd2, 0x57, 0x53, 0xc1,
+  0xef, 0xec, 0xeb, 0xc1, 0xbb, 0x05, 0x19, 0x6f, 0x78, 0x26, 0xca, 0xc5,
+  0x99, 0x39, 0x7a, 0x9b, 0x1b, 0xe8, 0x6e, 0xac, 0xbf, 0xa2, 0xf6, 0x9c,
+  0x37, 0x0c, 0x86, 0xc7, 0x2f, 0x13, 0x6e, 0x69, 0xa2, 0xaa, 0x22, 0x58,
+  0x06, 0x74, 0xd9, 0xae, 0xdd, 0xbe, 0x74, 0x7e, 0x1c, 0x9f, 0xaa, 0xf0,
+  0xae, 0x5d, 0xed, 0xe8, 0x9b, 0x80, 0x4d, 0x02, 0x8f, 0x4c, 0xcc, 0xf2,
+  0xf0, 0x58, 0x84, 0x0f, 0x1c, 0xd8, 0xc9, 0xee, 0xea, 0xca, 0x6b, 0xba,
+  0x46, 0xd6, 0x30, 0x38, 0x3d, 0x36, 0x41, 0x85, 0xd7, 0x4b, 0x6f, 0x5b,
+  0x0b, 0x9e, 0x2b, 0xd0, 0x90, 0xcb, 0x33, 0x73, 0x98, 0xa6, 0x49, 0x47,
+  0x6b, 0xf3, 0xb6, 0x1e, 0x78, 0x29, 0x07, 0x85, 0x37, 0xc1, 0xe2, 0x39,
+  0x83, 0x17, 0x97, 0x52, 0x1c, 0x6e, 0xac, 0xdd, 0x14, 0xcc, 0x00, 0x3f,
+  0x1a, 0x9f, 0xe1, 0xf1, 0xc9, 0x28, 0x1f, 0x3f, 0xbc, 0xf7, 0x9a, 0xc1,
+  0x0c, 0xe0, 0xf3, 0x78, 0x38, 0xb4, 0xb3, 0x1b, 0xcb, 0xb2, 0x18, 0x9d,
+  0x9e, 0xc1, 0xbe, 0x82, 0x6f, 0x6a, 0x6b, 0x6a, 0x20, 0x91, 0x48, 0x92,
+  0xcf, 0xe7, 0xcb, 0x41, 0x61, 0xd9, 0xae, 0xcd, 0x1e, 0x8f, 0xcc, 0xd3,
+  0x1d, 0x0a, 0xd2, 0x51, 0xe1, 0xdb, 0xf4, 0x98, 0x53, 0xd1, 0x38, 0x3f,
+  0x9f, 0x89, 0xf1, 0xbb, 0xfb, 0x7a, 0x68, 0xf0, 0xeb, 0xeb, 0xf6, 0x4f,
+  0x25, 0xd3, 0x9c, 0x9f, 0x8f, 0x93, 0xc9, 0xe5, 0xf1, 0x08, 0x08, 0x79,
+  0x34, 0xc2, 0x55, 0x95, 0x74, 0xd4, 0x56, 0x95, 0x1c, 0xa7, 0x2a, 0x0a,
+  0x7b, 0xbb, 0xc2, 0x9c, 0xb9, 0x38, 0x46, 0x34, 0x16, 0xa7, 0x69, 0x93,
+  0xc1, 0x14, 0x45, 0x08, 0x42, 0x15, 0x41, 0x96, 0x96, 0x13, 0xf8, 0xbc,
+  0xde, 0x6d, 0xcb, 0xa5, 0xcb, 0x1e, 0xfa, 0x26, 0xd8, 0xd8, 0x72, 0x9a,
+  0xd6, 0xa0, 0x8f, 0xa0, 0x67, 0x63, 0x7f, 0x91, 0x34, 0x4c, 0x1e, 0x9b,
+  0x9c, 0xe7, 0x35, 0x2d, 0x75, 0x74, 0xaf, 0x19, 0x2d, 0x34, 0xa5, 0xcd,
+  0x57, 0xcf, 0x8d, 0xf1, 0xbd, 0xe1, 0x09, 0xa4, 0x94, 0xb4, 0x54, 0x06,
+  0x68, 0xad, 0x0c, 0x12, 0xd4, 0x3d, 0x4c, 0x2c, 0x2e, 0xf1, 0xd8, 0xb9,
+  0x61, 0xe2, 0xa9, 0x74, 0xa9, 0x57, 0x52, 0x14, 0xf6, 0x74, 0xb6, 0x73,
+  0x69, 0x7a, 0x1a, 0xd3, 0xb2, 0x36, 0xad, 0x57, 0x4b, 0x63, 0x03, 0xd1,
+  0x58, 0xac, 0xec, 0xa1, 0xcb, 0xb6, 0x75, 0x9b, 0x4e, 0x67, 0xb1, 0x91,
+  0x74, 0x54, 0x6c, 0x1e, 0x08, 0x3e, 0x1f, 0x8d, 0x93, 0xb7, 0x6d, 0x5e,
+  0xd3, 0x5a, 0x57, 0xb2, 0xdd, 0x92, 0x92, 0x3f, 0x3a, 0x71, 0x9e, 0xfd,
+  0x35, 0x95, 0xfc, 0x56, 0x5f, 0x17, 0x35, 0x3e, 0x1d, 0x8f, 0x4b, 0x59,
+  0x24, 0x90, 0xce, 0xe7, 0x59, 0x4c, 0xa4, 0x39, 0x3d, 0x76, 0x89, 0xbd,
+  0xe1, 0x36, 0x1a, 0xaa, 0x42, 0xc5, 0x73, 0x03, 0x3e, 0x2f, 0x75, 0x55,
+  0x55, 0x4c, 0x47, 0xe7, 0x09, 0x37, 0x37, 0x6d, 0x78, 0x5d, 0xaf, 0x57,
+  0xc7, 0x34, 0x4d, 0x4c, 0xd3, 0xc4, 0xe3, 0xf1, 0x6c, 0xcb, 0xe7, 0x5f,
+  0xf6, 0xd0, 0x37, 0xd8, 0x22, 0xa9, 0x2c, 0x42, 0x08, 0xda, 0x82, 0x1b,
+  0xd3, 0x8d, 0xbc, 0x6d, 0x33, 0xba, 0x9c, 0xa6, 0xb3, 0x32, 0x40, 0xe5,
+  0x1a, 0x0f, 0xfe, 0x99, 0x17, 0x2e, 0xb2, 0xb3, 0x2a, 0xc8, 0x6f, 0xef,
+  0xe9, 0xa4, 0x31, 0xe0, 0x2b, 0x82, 0x19, 0x40, 0x00, 0x41, 0x5d, 0xa7,
+  0xbd, 0xae, 0x9a, 0x03, 0x5d, 0x1d, 0x8c, 0x4c, 0x46, 0xc8, 0xe6, 0x72,
+  0x25, 0xe7, 0x77, 0xb5, 0xb6, 0x10, 0x99, 0x9e, 0xbd, 0x62, 0xfd, 0x2a,
+  0x83, 0x15, 0x24, 0xd7, 0x78, 0xf8, 0x32, 0xa0, 0xcb, 0xb6, 0xa9, 0x45,
+  0xb3, 0x79, 0x04, 0xd0, 0xe0, 0xdf, 0x58, 0x1f, 0x8e, 0x66, 0xf2, 0xcc,
+  0x67, 0xf3, 0x1c, 0xac, 0x0f, 0x95, 0x6c, 0x7f, 0x71, 0x39, 0xc5, 0xf3,
+  0xf3, 0x71, 0xde, 0xb7, 0xb7, 0xfb, 0xaa, 0xd7, 0xa8, 0x0e, 0x06, 0xe8,
+  0x6a, 0x6c, 0x60, 0x6c, 0x72, 0xba, 0x94, 0x4f, 0xab, 0x0a, 0x7e, 0x9f,
+  0x97, 0x74, 0x3a, 0xb3, 0x39, 0xa0, 0x2b, 0x2a, 0x48, 0x95, 0x01, 0x5d,
+  0xb6, 0xad, 0x5a, 0xc6, 0xb4, 0x10, 0x08, 0x36, 0x0b, 0xb9, 0x96, 0xf2,
+  0x06, 0xcb, 0x79, 0x83, 0x1d, 0xa1, 0x52, 0x3d, 0xf8, 0x6b, 0x83, 0x13,
+  0xfc, 0xde, 0x6d, 0xa5, 0x60, 0xb6, 0x25, 0x0c, 0xc4, 0x92, 0x3c, 0x17,
+  0x5d, 0x26, 0x63, 0xae, 0x70, 0x63, 0xe1, 0x06, 0x78, 0x8a, 0x22, 0xc8,
+  0xe5, 0x4a, 0x55, 0x8b, 0x9a, 0xaa, 0x10, 0x4b, 0x89, 0xe4, 0xa6, 0xf5,
+  0xf3, 0xfb, 0x74, 0xb2, 0xd9, 0x6c, 0x19, 0xd0, 0x65, 0xdb, 0x9a, 0x49,
+  0x40, 0x53, 0x36, 0x57, 0x10, 0x72, 0x96, 0x4d, 0xde, 0x96, 0xf8, 0xd7,
+  0x68, 0xc6, 0xcf, 0xcd, 0x2d, 0xad, 0xe3, 0xd4, 0xdf, 0xba, 0x18, 0xe1,
+  0xfe, 0x1f, 0x9e, 0xe4, 0xd0, 0xdf, 0x9f, 0xe0, 0xe3, 0x27, 0x5f, 0xc4,
+  0x5c, 0x25, 0xcb, 0xe9, 0x9a, 0x86, 0x5f, 0xd7, 0x49, 0x67, 0x33, 0x6b,
+  0x00, 0xeb, 0x23, 0x97, 0xdb, 0x1c, 0xb0, 0xba, 0x47, 0xbf, 0x62, 0xe0,
+  0x58, 0x0e, 0x0a, 0xcb, 0x56, 0x62, 0xdd, 0x95, 0x01, 0x6a, 0xbd, 0xfa,
+  0xa6, 0xfb, 0xeb, 0x7c, 0x3a, 0x87, 0x1b, 0xab, 0xd7, 0x6d, 0x7f, 0xa0,
+  0xbd, 0xbe, 0x44, 0xb3, 0x36, 0x6d, 0x89, 0x47, 0x11, 0xbc, 0xb3, 0xa7,
+  0xd9, 0x99, 0x00, 0x20, 0xdc, 0xd6, 0x22, 0x56, 0xe8, 0x45, 0xa8, 0x22,
+  0x88, 0xb6, 0xa6, 0x61, 0x04, 0x02, 0x3e, 0xa4, 0xb4, 0x37, 0xff, 0xc1,
+  0x35, 0x8d, 0xaa, 0x50, 0x68, 0xdb, 0x3e, 0xff, 0xf2, 0x48, 0xe1, 0x4d,
+  0xf4, 0xd4, 0xe2, 0x26, 0x1c, 0x5b, 0xb6, 0x9b, 0xe4, 0xa1, 0x33, 0x99,
+  0x0c, 0x86, 0x61, 0xa0, 0xaa, 0x1a, 0xc1, 0xe0, 0xd6, 0x66, 0x5e, 0x24,
+  0x93, 0x49, 0x6c, 0x7b, 0xbd, 0xf7, 0x10, 0x42, 0xe0, 0xf5, 0x7a, 0xd1,
+  0x75, 0x7d, 0x4b, 0xe5, 0x64, 0xb3, 0x39, 0xf2, 0xf9, 0xdc, 0xd5, 0x5b,
+  0xeb, 0x26, 0xe5, 0x3a, 0x41, 0x93, 0x24, 0x10, 0x08, 0x6c, 0xa9, 0xae,
+  0x42, 0x08, 0x82, 0x41, 0x67, 0x86, 0xf5, 0x96, 0x3d, 0xc5, 0x26, 0xdb,
+  0x17, 0xb2, 0x06, 0x12, 0x49, 0xbd, 0x4f, 0xbf, 0xe2, 0xb1, 0xb6, 0x94,
+  0x2c, 0xe6, 0x4c, 0x52, 0xa6, 0x85, 0x00, 0x6c, 0xa0, 0x3d, 0xe0, 0x45,
+  0x5d, 0x43, 0x67, 0x16, 0x73, 0x06, 0x09, 0xc3, 0x5a, 0x57, 0x86, 0x10,
+  0x10, 0xd4, 0x54, 0x6a, 0xbc, 0x9e, 0x32, 0xa0, 0xaf, 0xf4, 0x23, 0x5f,
+  0xb8, 0x30, 0xc8, 0xcc, 0xcc, 0x0c, 0x99, 0x4c, 0x06, 0xcb, 0xb2, 0x50,
+  0x14, 0x05, 0x9f, 0xcf, 0x4b, 0x7d, 0x7d, 0x3d, 0x3b, 0x77, 0xee, 0xa4,
+  0xa9, 0x69, 0xbd, 0x06, 0x1a, 0x8b, 0xc5, 0x78, 0xf6, 0xd9, 0x93, 0x2c,
+  0x2d, 0xc5, 0xb1, 0x6d, 0xb9, 0x21, 0xf0, 0x34, 0x4d, 0x25, 0x18, 0x0c,
+  0xd2, 0xd6, 0xd6, 0xc6, 0xee, 0xdd, 0xbb, 0xf1, 0xf9, 0xd6, 0xcb, 0x5e,
+  0xb6, 0x6d, 0x73, 0xe2, 0xc4, 0xd3, 0x44, 0x22, 0x11, 0x4c, 0xd3, 0xbc,
+  0xfa, 0xcd, 0x69, 0x2a, 0xfb, 0xf7, 0xdf, 0x4e, 0x6f, 0x6f, 0x1f, 0x00,
+  0xf9, 0x7c, 0x9e, 0xe7, 0x9f, 0x7f, 0x9e, 0xcb, 0x97, 0x27, 0x91, 0x52,
+  0xd2, 0xd1, 0x11, 0xe6, 0xe8, 0xd1, 0xa3, 0xeb, 0xce, 0xb3, 0x2c, 0x8b,
+  0xc7, 0x1e, 0x7b, 0xac, 0xa8, 0x16, 0xf8, 0x7c, 0x3e, 0x1e, 0x78, 0xe0,
+  0x01, 0x2a, 0x2b, 0x2b, 0xae, 0x3f, 0x58, 0xb4, 0x2c, 0x3e, 0xf1, 0xdc,
+  0x28, 0xa7, 0xa2, 0xcb, 0x48, 0xe0, 0x50, 0x63, 0x88, 0xdf, 0xdf, 0xd7,
+  0x41, 0x73, 0x60, 0x63, 0x35, 0x24, 0x69, 0x58, 0xfc, 0xd5, 0xb9, 0xcb,
+  0xfc, 0x74, 0x72, 0x1e, 0x5d, 0x51, 0x48, 0x9b, 0x16, 0xdf, 0x7f, 0xc3,
+  0x1d, 0x34, 0xba, 0xa3, 0x8a, 0x0b, 0x59, 0x83, 0xff, 0xd5, 0x7f, 0x89,
+  0x67, 0xe7, 0x96, 0x30, 0x37, 0x78, 0xa6, 0x08, 0xf0, 0x2a, 0x0a, 0xf5,
+  0x3e, 0x0f, 0x77, 0x36, 0x84, 0x78, 0x7b, 0x77, 0x13, 0xed, 0x57, 0x18,
+  0xb9, 0xbc, 0xe5, 0x00, 0x7d, 0xf2, 0xe4, 0x49, 0xfa, 0xfb, 0x07, 0x48,
+  0xa7, 0xd3, 0xe4, 0xf3, 0x79, 0x6c, 0xdb, 0x46, 0x4a, 0x89, 0x10, 0x02,
+  0x45, 0x51, 0xb8, 0x74, 0x69, 0x82, 0xc1, 0xc1, 0x21, 0xba, 0xba, 0x3a,
+  0x39, 0x7a, 0xf4, 0x68, 0x89, 0xf7, 0x7b, 0xea, 0xa9, 0xa7, 0x18, 0x1b,
+  0x1b, 0x2f, 0x7a, 0xbc, 0xc2, 0xb9, 0x25, 0xd1, 0xa9, 0xa2, 0xa0, 0x28,
+  0x0a, 0x63, 0x63, 0xe3, 0x9c, 0x3d, 0xdb, 0xcf, 0x81, 0x03, 0x07, 0xb8,
+  0xfd, 0xf6, 0x7d, 0x25, 0xc7, 0x0c, 0x0e, 0x0e, 0xf1, 0xc2, 0x0b, 0x2f,
+  0x14, 0xf3, 0x11, 0xa4, 0x94, 0x1b, 0x7a, 0xfc, 0x82, 0x79, 0x3c, 0x1e,
+  0xba, 0xbb, 0x57, 0x94, 0x83, 0x8b, 0x17, 0x47, 0x38, 0x7d, 0xfa, 0x0c,
+  0x99, 0x8c, 0x03, 0xd4, 0x68, 0x34, 0x8a, 0x10, 0x0a, 0x47, 0x8e, 0xdc,
+  0x5d, 0x4a, 0x01, 0xa4, 0x64, 0x76, 0x76, 0x8e, 0x64, 0x32, 0xe9, 0xf2,
+  0xd2, 0x00, 0x96, 0x65, 0xbe, 0xa4, 0x07, 0xfd, 0x27, 0x27, 0x5f, 0xe4,
+  0xcb, 0x17, 0x26, 0x8b, 0xe0, 0x7b, 0x66, 0x2e, 0x8e, 0x2a, 0x04, 0x1f,
+  0x39, 0xd8, 0x4d, 0x85, 0x67, 0x7d, 0x52, 0x91, 0x29, 0x25, 0x23, 0xcb,
+  0x69, 0x9e, 0x9e, 0x5d, 0xc2, 0xa7, 0x2a, 0x24, 0x0d, 0x93, 0x9c, 0x7b,
+  0xaf, 0xa6, 0x2d, 0x79, 0x78, 0x22, 0xca, 0x5f, 0x9c, 0x1d, 0x47, 0x20,
+  0x50, 0x04, 0x18, 0xb6, 0x5c, 0x97, 0xcb, 0xa1, 0x08, 0x81, 0x47, 0x11,
+  0x3c, 0x3a, 0xb9, 0xc0, 0xd7, 0x06, 0xa7, 0x78, 0xf7, 0xee, 0x56, 0x3e,
+  0xb4, 0xbf, 0x73, 0x5b, 0xa7, 0x90, 0x6e, 0x09, 0xd0, 0x8f, 0x3c, 0xf2,
+  0x08, 0x83, 0x83, 0x43, 0x25, 0xe0, 0x69, 0x6c, 0x6c, 0xa4, 0xae, 0xae,
+  0x96, 0x44, 0x22, 0x49, 0x24, 0x12, 0xc1, 0xb2, 0x2c, 0x12, 0x89, 0x04,
+  0xfd, 0xfd, 0x03, 0x2c, 0x2f, 0x2f, 0x73, 0xff, 0xfd, 0xf7, 0x13, 0x72,
+  0x83, 0x8f, 0xe5, 0xe5, 0x44, 0x09, 0x68, 0x9b, 0x9b, 0x9b, 0xa9, 0xac,
+  0xac, 0x2c, 0x82, 0xda, 0x34, 0x4d, 0x22, 0x91, 0x08, 0xa9, 0x54, 0x8a,
+  0x7c, 0x3e, 0x4f, 0x34, 0x1a, 0xe5, 0xc9, 0x27, 0x9f, 0x24, 0x99, 0x4c,
+  0x94, 0x78, 0xd0, 0x64, 0x32, 0x51, 0xec, 0x15, 0x84, 0x10, 0x84, 0x42,
+  0x21, 0x5a, 0x5a, 0x5a, 0x36, 0x05, 0xb5, 0xa2, 0xa8, 0xd4, 0xd6, 0xd6,
+  0xad, 0xa2, 0x49, 0xe9, 0xe2, 0xf9, 0x85, 0xeb, 0xf6, 0xf7, 0xf7, 0xd3,
+  0xd3, 0xd3, 0x4d, 0x63, 0x63, 0xe3, 0x86, 0x0d, 0xac, 0xf0, 0xfd, 0xa5,
+  0xb0, 0xdc, 0xc5, 0x9c, 0xc1, 0x57, 0x07, 0xa7, 0x9c, 0x46, 0xe6, 0x52,
+  0x06, 0x53, 0x4a, 0xbe, 0x75, 0x71, 0x9a, 0x77, 0xed, 0x6a, 0x61, 0x4f,
+  0xf5, 0xc6, 0x29, 0x9d, 0xaa, 0x70, 0x14, 0x13, 0x4d, 0x11, 0x25, 0x19,
+  0x72, 0xb6, 0x94, 0x2c, 0x64, 0x0d, 0x72, 0x96, 0x4d, 0xa5, 0x47, 0xc3,
+  0xb0, 0x25, 0xf7, 0xb6, 0xd6, 0xd0, 0x12, 0x58, 0xf1, 0xc0, 0xa6, 0x65,
+  0x73, 0x21, 0x9e, 0xe2, 0xdc, 0x62, 0x92, 0x94, 0x69, 0x91, 0x4e, 0x64,
+  0xf9, 0xe4, 0xa9, 0x51, 0x2e, 0x25, 0x33, 0x7c, 0xfe, 0xd8, 0x1e, 0xb6,
+  0x2b, 0xa6, 0xaf, 0x0a, 0xe8, 0xd1, 0xd1, 0x31, 0xce, 0x9d, 0x3b, 0x5f,
+  0xfc, 0x71, 0x43, 0xa1, 0x10, 0xf7, 0xdd, 0x77, 0x1f, 0x3b, 0x76, 0xf4,
+  0x14, 0x8f, 0x89, 0xc7, 0xe3, 0x3c, 0xfc, 0xf0, 0x8f, 0x5c, 0x8f, 0x27,
+  0x18, 0x1d, 0x1d, 0xa3, 0xa9, 0x69, 0x80, 0x63, 0xc7, 0x8e, 0x6d, 0xe8,
+  0x35, 0x5f, 0xf5, 0xaa, 0xbb, 0xe8, 0xe9, 0xe9, 0x29, 0x02, 0x5a, 0x08,
+  0x81, 0x94, 0x92, 0x53, 0xa7, 0x4e, 0xf1, 0xe4, 0x93, 0x4f, 0x21, 0x84,
+  0x20, 0x9f, 0xcf, 0x33, 0x38, 0x38, 0x44, 0x38, 0x1c, 0xa6, 0xbd, 0xbd,
+  0x7d, 0x43, 0x9a, 0x12, 0x0e, 0x87, 0x79, 0xe0, 0x81, 0xfb, 0xb9, 0x52,
+  0x5c, 0x7b, 0x35, 0x6f, 0x94, 0x4a, 0xa5, 0x38, 0x7e, 0xfc, 0x04, 0x6f,
+  0x79, 0xcb, 0xaf, 0xdd, 0xb4, 0x87, 0xfc, 0xe5, 0x0b, 0x97, 0xc9, 0xdb,
+  0x36, 0xea, 0xaa, 0xba, 0x68, 0x42, 0x30, 0x91, 0xcc, 0xf0, 0xff, 0x26,
+  0x63, 0xec, 0x0c, 0x05, 0x8a, 0x40, 0xbf, 0xa6, 0x88, 0xde, 0x6d, 0x64,
+  0x29, 0xd3, 0xe2, 0x03, 0xfb, 0x3a, 0x79, 0x43, 0xb8, 0xbe, 0x84, 0x72,
+  0x58, 0xb6, 0xe4, 0x87, 0x97, 0xa2, 0x7c, 0xec, 0x99, 0x61, 0xa6, 0xd3,
+  0x39, 0x54, 0x04, 0x5f, 0x3a, 0x3f, 0xc9, 0x6f, 0xec, 0x68, 0xe1, 0x58,
+  0x73, 0xf5, 0xb6, 0x04, 0xf4, 0x55, 0xa3, 0x9c, 0xb1, 0xb1, 0xb1, 0x22,
+  0x28, 0x54, 0x55, 0x65, 0xef, 0xde, 0xbd, 0x25, 0x60, 0x06, 0xa8, 0xae,
+  0xae, 0xe6, 0x4d, 0x6f, 0x7a, 0x23, 0x86, 0x61, 0x14, 0xbb, 0xec, 0x85,
+  0x85, 0x18, 0xe9, 0x74, 0xfa, 0x8a, 0x21, 0x93, 0x10, 0xa2, 0x58, 0xb6,
+  0x10, 0x82, 0xbb, 0xee, 0xba, 0x8b, 0xee, 0xee, 0xee, 0xa2, 0xc7, 0x4d,
+  0xa5, 0x52, 0x2c, 0x2d, 0x2d, 0x5d, 0x01, 0xac, 0x94, 0x94, 0xb3, 0xd1,
+  0x67, 0x2b, 0x36, 0x3d, 0x1d, 0xa1, 0xbf, 0xbf, 0xff, 0xa6, 0x3d, 0xe4,
+  0xaf, 0x5c, 0x88, 0x14, 0xc1, 0x2c, 0xa0, 0xf8, 0xdd, 0xa7, 0xaa, 0x7c,
+  0x63, 0x38, 0x42, 0x3c, 0x67, 0xbc, 0x74, 0xb9, 0x4a, 0xac, 0xf9, 0xe0,
+  0x78, 0xf7, 0xb7, 0x76, 0x37, 0xf2, 0xef, 0x7a, 0xdb, 0x30, 0x5c, 0xaa,
+  0xa3, 0x08, 0xc1, 0x89, 0xd9, 0xf8, 0xb6, 0xa5, 0x1c, 0x57, 0x05, 0xf4,
+  0xea, 0xe0, 0x4b, 0x55, 0x55, 0xbc, 0xde, 0x8d, 0x83, 0x98, 0xd5, 0x9c,
+  0x59, 0x08, 0xb1, 0x21, 0x4f, 0xbe, 0x9a, 0xe5, 0xf3, 0x79, 0x72, 0xab,
+  0xf2, 0x13, 0x3c, 0x1e, 0xcf, 0x86, 0xc1, 0xe1, 0x8d, 0xb6, 0x74, 0x3a,
+  0xcb, 0xc0, 0xc0, 0xb9, 0x2b, 0x36, 0x9e, 0xeb, 0xb5, 0x6f, 0x0d, 0x47,
+  0x58, 0x5c, 0x05, 0xd8, 0x9e, 0x90, 0x9f, 0xd7, 0x87, 0xeb, 0xc9, 0x59,
+  0x36, 0x1e, 0x45, 0xf0, 0x6c, 0x74, 0x89, 0x53, 0xf3, 0x4e, 0xa0, 0x78,
+  0x33, 0x2c, 0x6f, 0xdb, 0xc4, 0xdc, 0xe1, 0xf8, 0x02, 0x5d, 0x69, 0x0d,
+  0x7a, 0x6f, 0x5d, 0x40, 0x6f, 0xac, 0x9a, 0x6e, 0xb0, 0xf5, 0x1a, 0xc0,
+  0xbb, 0x5a, 0xfe, 0x2a, 0x70, 0xef, 0xa9, 0xa9, 0x08, 0x8f, 0x3e, 0xfa,
+  0x18, 0x93, 0x93, 0x93, 0x2e, 0x05, 0x81, 0x8e, 0x8e, 0x30, 0x6d, 0x6d,
+  0x6d, 0xd7, 0x21, 0x8e, 0x6d, 0xcd, 0x54, 0x55, 0x45, 0x4a, 0x89, 0xaa,
+  0x2a, 0xcc, 0xcc, 0xcc, 0x14, 0xbd, 0xf4, 0x8d, 0x0c, 0x9a, 0x1e, 0x1a,
+  0x8e, 0x14, 0x83, 0x35, 0x9f, 0xaa, 0xf0, 0x3b, 0x7b, 0xda, 0x79, 0x77,
+  0x6f, 0x2b, 0xba, 0xaa, 0x20, 0x01, 0xbf, 0xa6, 0xf0, 0x57, 0xe7, 0x2e,
+  0x63, 0xd9, 0xf2, 0x86, 0x03, 0x79, 0x30, 0x9e, 0xe2, 0xd3, 0x2f, 0x8c,
+  0xf3, 0xed, 0x91, 0x19, 0x3c, 0x8a, 0x42, 0xce, 0xb2, 0xd9, 0x5d, 0x15,
+  0x2c, 0xa5, 0x26, 0x65, 0x1d, 0xfa, 0xa5, 0x99, 0x6d, 0xdb, 0xcc, 0xcd,
+  0xcd, 0x22, 0xa5, 0x4d, 0x22, 0x91, 0x64, 0x69, 0x69, 0x89, 0x68, 0x34,
+  0xca, 0xd4, 0xd4, 0x14, 0xd9, 0x6c, 0xd6, 0x95, 0xf0, 0x34, 0x76, 0xef,
+  0xde, 0xcd, 0xe1, 0xc3, 0x87, 0x37, 0xf5, 0xd0, 0x52, 0x4a, 0xe6, 0xe6,
+  0xe6, 0x38, 0x75, 0xea, 0x14, 0xe6, 0xaa, 0x3c, 0x07, 0xcb, 0xb2, 0xb8,
+  0xfb, 0xee, 0xc3, 0x57, 0xd5, 0x8c, 0xa5, 0x94, 0xb4, 0xb4, 0x34, 0x13,
+  0x8b, 0x2d, 0x92, 0x4a, 0xa5, 0x90, 0x52, 0x72, 0xe1, 0xc2, 0x05, 0x3a,
+  0x3b, 0xbb, 0x68, 0x6b, 0x6b, 0xbd, 0x21, 0xf7, 0xfa, 0x78, 0x64, 0x91,
+  0xe1, 0x78, 0xba, 0xe8, 0x02, 0xea, 0x7d, 0x3a, 0xbf, 0xb5, 0xb3, 0x85,
+  0xe5, 0xbc, 0xc9, 0xd1, 0xa6, 0x2a, 0x9e, 0x88, 0x2c, 0xe2, 0x55, 0x15,
+  0x1e, 0x9d, 0x5c, 0x60, 0x28, 0x9e, 0x62, 0x6f, 0xed, 0xf5, 0xcb, 0x82,
+  0x85, 0x6b, 0x8c, 0x2d, 0x67, 0xe8, 0x8f, 0x25, 0x79, 0x2e, 0xba, 0xc4,
+  0x4f, 0x27, 0xe7, 0x39, 0x3d, 0x9f, 0x40, 0x53, 0x14, 0x0c, 0xdb, 0x66,
+  0x5f, 0x4d, 0x05, 0x9f, 0x3d, 0xd6, 0xbb, 0xad, 0xb5, 0xe9, 0x97, 0x1d,
+  0xd0, 0xa6, 0x69, 0x72, 0xea, 0xd4, 0x0b, 0x58, 0x96, 0x45, 0x3a, 0x9d,
+  0x29, 0x91, 0xc3, 0x6a, 0x6a, 0x6a, 0x08, 0x87, 0xc3, 0xf4, 0xf4, 0xf4,
+  0xd0, 0xd3, 0xd3, 0x85, 0xae, 0x7b, 0xaf, 0x08, 0xc8, 0x48, 0x24, 0xc2,
+  0xc4, 0xc4, 0x44, 0xc9, 0xf6, 0x5c, 0x2e, 0xc7, 0xa1, 0x43, 0xaf, 0xda,
+  0xd2, 0x20, 0x48, 0x5d, 0x5d, 0x1d, 0x7d, 0x7d, 0x7d, 0xfc, 0xf8, 0xc7,
+  0xff, 0x8c, 0xae, 0x7b, 0x88, 0xc7, 0x97, 0x39, 0x73, 0xe6, 0x34, 0x35,
+  0x35, 0xd5, 0x37, 0x44, 0x05, 0xf8, 0xe6, 0x70, 0x84, 0x94, 0xdb, 0xd8,
+  0x14, 0x01, 0xaf, 0x0b, 0xd7, 0x51, 0xa5, 0x6b, 0x54, 0xe9, 0x1a, 0xf7,
+  0xb5, 0xd6, 0x72, 0x7c, 0x26, 0x5e, 0xec, 0x67, 0xbe, 0x30, 0x70, 0x89,
+  0x2f, 0xdd, 0xb3, 0xf7, 0xba, 0xd1, 0xec, 0x57, 0x55, 0xbe, 0x37, 0x3a,
+  0xcb, 0xdf, 0x0e, 0x4d, 0xf1, 0xc2, 0x7c, 0x82, 0x68, 0x26, 0x8f, 0x22,
+  0xc0, 0x92, 0x50, 0xeb, 0xd1, 0x78, 0x73, 0x57, 0x03, 0xef, 0xdd, 0xd3,
+  0xce, 0x5d, 0x0d, 0xdb, 0x77, 0xd8, 0xfb, 0x15, 0x01, 0xb4, 0x94, 0x92,
+  0x44, 0xc2, 0x91, 0xdf, 0xfc, 0x7e, 0x3f, 0x75, 0x75, 0xcd, 0x34, 0x36,
+  0x36, 0xd2, 0xda, 0xda, 0x4a, 0x5d, 0x5d, 0x2d, 0xd5, 0xd5, 0xd5, 0xf8,
+  0xfd, 0x5b, 0x5b, 0x68, 0x50, 0xd7, 0x75, 0x02, 0x81, 0x40, 0x09, 0xdd,
+  0xf1, 0x5e, 0xc3, 0xf4, 0x22, 0x29, 0xa1, 0xaf, 0xaf, 0x97, 0xa1, 0xa1,
+  0x61, 0x46, 0x47, 0x47, 0xf1, 0x78, 0x3c, 0x5c, 0xbc, 0x38, 0x42, 0x38,
+  0x1c, 0xc6, 0xb2, 0xec, 0x97, 0x74, 0x9f, 0xe7, 0x16, 0x93, 0xbc, 0x30,
+  0xbf, 0x8c, 0x69, 0xdb, 0xae, 0x1e, 0xac, 0xf0, 0xc1, 0xdb, 0x3b, 0x8a,
+  0xfb, 0x1f, 0x6c, 0xaf, 0xe3, 0xef, 0x47, 0x67, 0x19, 0x8a, 0xa7, 0xf0,
+  0xa8, 0x0a, 0x3f, 0x18, 0x9b, 0xe3, 0x13, 0x87, 0x76, 0xd2, 0xe4, 0xbf,
+  0x76, 0x7e, 0xab, 0x08, 0x88, 0x65, 0xf3, 0xfc, 0xd9, 0xa9, 0x51, 0x86,
+  0x97, 0xd2, 0xa8, 0x02, 0xaa, 0x75, 0x8d, 0xdb, 0xeb, 0x2a, 0xb9, 0xbf,
+  0xad, 0x96, 0x63, 0xcd, 0xd5, 0xdc, 0x59, 0x1f, 0x22, 0xa4, 0x6f, 0xff,
+  0xd4, 0x9d, 0x97, 0xfd, 0x0e, 0x35, 0x4d, 0xe3, 0xc0, 0x81, 0x03, 0xec,
+  0xda, 0xb5, 0x93, 0x40, 0x20, 0x80, 0xc7, 0xe3, 0x41, 0xd7, 0xf5, 0x4d,
+  0x83, 0xcd, 0x2b, 0xc9, 0x71, 0x3b, 0x76, 0xec, 0xe0, 0xde, 0x7b, 0xef,
+  0x21, 0x9f, 0x37, 0x4a, 0x1a, 0xcc, 0xb5, 0x0c, 0x51, 0x6b, 0x9a, 0x87,
+  0xc3, 0x87, 0x0f, 0x31, 0x3d, 0x3d, 0x5d, 0x54, 0x69, 0x9e, 0x7d, 0xf6,
+  0xe4, 0x4b, 0x4e, 0xb1, 0xfc, 0xfe, 0xd8, 0x1c, 0x97, 0x93, 0x59, 0x14,
+  0x21, 0x90, 0xc0, 0x1d, 0xf5, 0x95, 0xa8, 0x42, 0x61, 0x7c, 0x39, 0x83,
+  0x10, 0x82, 0x1a, 0xaf, 0x87, 0x9e, 0x90, 0x9f, 0xa1, 0x78, 0x0a, 0x01,
+  0xa4, 0x4d, 0x9b, 0xaf, 0x5c, 0x98, 0xe2, 0x8f, 0xee, 0xec, 0xb9, 0x2e,
+  0xba, 0x51, 0xa1, 0x6b, 0xa8, 0xae, 0x66, 0x2d, 0x70, 0x66, 0xbf, 0xd4,
+  0x78, 0x3d, 0x7c, 0xf0, 0xf6, 0x4e, 0x82, 0x9e, 0x5b, 0x67, 0xdd, 0xe8,
+  0x97, 0x1d, 0xd0, 0xaa, 0xaa, 0xd2, 0xd1, 0xd1, 0xb1, 0xa1, 0xb6, 0x7c,
+  0xad, 0x80, 0xf6, 0x7a, 0xbd, 0x04, 0x83, 0x41, 0x82, 0x2f, 0x71, 0xa9,
+  0x89, 0x96, 0x96, 0x16, 0x0e, 0x1e, 0x3c, 0xc8, 0xf1, 0xe3, 0xc7, 0xd1,
+  0x75, 0x9d, 0x54, 0x2a, 0xf5, 0x92, 0xca, 0x8b, 0xa4, 0x72, 0x1c, 0x9f,
+  0x89, 0x93, 0xb5, 0xec, 0x22, 0xc0, 0x9e, 0x8f, 0x2e, 0xf3, 0xea, 0xef,
+  0x3f, 0x53, 0xe4, 0xba, 0x02, 0xc8, 0x98, 0x2b, 0xda, 0xb4, 0xa6, 0x08,
+  0x1e, 0x1a, 0x8a, 0xf0, 0xb1, 0x3b, 0x7a, 0xae, 0x99, 0xee, 0x48, 0x40,
+  0x41, 0xf0, 0xe5, 0x7b, 0xf6, 0xf2, 0x2b, 0xff, 0xf7, 0x79, 0xb2, 0xa6,
+  0x8d, 0x04, 0x9e, 0x9a, 0x8e, 0xf1, 0xdf, 0x4f, 0xbd, 0xc8, 0x9f, 0x1e,
+  0xde, 0xcd, 0xad, 0xb2, 0xc8, 0xff, 0x0d, 0xcb, 0x87, 0xbe, 0x16, 0x85,
+  0xee, 0xc6, 0xa9, 0x08, 0x37, 0x46, 0x19, 0xd0, 0x34, 0x8d, 0xbe, 0xbe,
+  0x5e, 0xda, 0xda, 0xda, 0xaf, 0x38, 0x94, 0xbe, 0x55, 0x7b, 0x72, 0x7a,
+  0x91, 0xb3, 0xb1, 0x44, 0xc9, 0x6a, 0x49, 0x86, 0x2d, 0x59, 0xca, 0x9b,
+  0x2c, 0xbb, 0x9f, 0xa5, 0xbc, 0x49, 0x7e, 0xcd, 0xb5, 0xe2, 0x79, 0x83,
+  0x6f, 0x5e, 0x8c, 0x5c, 0x5f, 0x6c, 0x22, 0x6d, 0x0e, 0xd6, 0x57, 0xf2,
+  0x0f, 0xaf, 0xbb, 0xa3, 0xd8, 0x48, 0xf2, 0xb6, 0xe4, 0x6f, 0x2e, 0x4c,
+  0xf1, 0x99, 0x33, 0x63, 0xd8, 0xdc, 0x1a, 0x49, 0x95, 0x57, 0xf5, 0xd0,
+  0x85, 0x21, 0x6a, 0x21, 0x04, 0x86, 0x61, 0x10, 0x8d, 0xce, 0x17, 0xff,
+  0x5f, 0xad, 0x5c, 0x8c, 0x8f, 0x5f, 0x2a, 0x76, 0xf5, 0x52, 0x4a, 0xbc,
+  0x5e, 0x2f, 0x9a, 0x76, 0xb3, 0xa3, 0xe9, 0x1b, 0xe7, 0x76, 0xea, 0xeb,
+  0xeb, 0xd9, 0xb7, 0x6f, 0x2f, 0xb1, 0xd8, 0x02, 0xa6, 0x69, 0x5e, 0x77,
+  0xa3, 0x4b, 0x1a, 0x16, 0x8f, 0x47, 0x62, 0xcc, 0x67, 0xf2, 0xf8, 0x35,
+  0x15, 0x4b, 0x4a, 0x1e, 0x6c, 0xaf, 0x2b, 0xc9, 0xae, 0x5b, 0xe1, 0xbe,
+  0x82, 0xc9, 0x54, 0x96, 0x67, 0x66, 0xe3, 0x18, 0xb6, 0xc4, 0xb4, 0x25,
+  0x5f, 0x1d, 0x9c, 0xe2, 0xdf, 0xee, 0x6e, 0xbd, 0xee, 0x3b, 0x3b, 0xda,
+  0x54, 0xc5, 0xdf, 0xbd, 0x6e, 0x3f, 0xbf, 0xf9, 0xd3, 0x7e, 0x72, 0x96,
+  0x8d, 0x29, 0x25, 0x9f, 0x3a, 0x3d, 0x46, 0xad, 0xd7, 0xc3, 0x7b, 0xfa,
+  0xda, 0x4a, 0x46, 0x2b, 0x6f, 0x49, 0x40, 0xef, 0xdb, 0xb7, 0x97, 0xb3,
+  0x67, 0xcf, 0x92, 0x4e, 0xa7, 0x11, 0x42, 0x30, 0x38, 0x38, 0x88, 0x65,
+  0x99, 0xec, 0xdf, 0xbf, 0x9f, 0x60, 0x30, 0x88, 0x61, 0x18, 0x0c, 0x0f,
+  0x5f, 0xe4, 0xe4, 0xc9, 0x93, 0x68, 0x9a, 0x86, 0x94, 0x4e, 0x5a, 0x66,
+  0x57, 0x57, 0x07, 0x5e, 0xaf, 0x7e, 0x43, 0x2b, 0xbb, 0xba, 0x17, 0x90,
+  0x52, 0x92, 0xcb, 0xe5, 0xdc, 0xfc, 0x0f, 0x63, 0x93, 0x9e, 0x00, 0x7c,
+  0x3e, 0x3f, 0xbe, 0x2d, 0x2e, 0x52, 0xb8, 0x67, 0x4f, 0x1f, 0x13, 0x13,
+  0x97, 0x18, 0x19, 0x79, 0xf1, 0xba, 0x7b, 0x83, 0x33, 0x0b, 0x09, 0x9e,
+  0x9c, 0x5e, 0x44, 0x57, 0x15, 0x2c, 0x29, 0x69, 0xf0, 0xeb, 0x7c, 0xf7,
+  0xc1, 0x83, 0xa8, 0x9b, 0xe0, 0x28, 0x65, 0x98, 0x1c, 0xfb, 0xfe, 0xb3,
+  0x5c, 0x4e, 0x3a, 0x9c, 0x7d, 0x2c, 0x91, 0xe1, 0x89, 0x48, 0x8c, 0x43,
+  0x8d, 0x55, 0xd7, 0xfd, 0x9c, 0x5e, 0xdb, 0x5a, 0xc7, 0x57, 0xee, 0xdb,
+  0xcb, 0xef, 0x3e, 0x71, 0x9e, 0xa4, 0x69, 0x62, 0xda, 0xf0, 0xb1, 0x67,
+  0x2e, 0x12, 0xf2, 0x68, 0xbc, 0x7d, 0x47, 0xd3, 0xb6, 0x06, 0xf5, 0x55,
+  0x01, 0x1d, 0x0a, 0x85, 0x78, 0xfd, 0xeb, 0x5f, 0xcf, 0x53, 0x4f, 0x3d,
+  0xc5, 0xc2, 0xc2, 0x02, 0x86, 0x61, 0x30, 0x30, 0x70, 0x8e, 0xfe, 0xfe,
+  0x01, 0x74, 0x5d, 0x77, 0xc1, 0x24, 0xd1, 0x34, 0xa7, 0xa8, 0xaa, 0xaa,
+  0x2a, 0x0e, 0x1e, 0x3c, 0x58, 0x4c, 0xd9, 0xbc, 0xa1, 0xfc, 0x48, 0x51,
+  0x8a, 0x8a, 0x86, 0x94, 0x92, 0x8b, 0x17, 0x2f, 0x32, 0x32, 0x32, 0x72,
+  0x45, 0x2a, 0x71, 0xe4, 0xc8, 0x11, 0xee, 0xbc, 0xf3, 0x8e, 0x2d, 0xab,
+  0x26, 0x07, 0x0f, 0x1e, 0x64, 0x76, 0x76, 0x96, 0x44, 0x22, 0x59, 0xcc,
+  0x31, 0xb1, 0x6d, 0x7b, 0x4b, 0x81, 0xa6, 0x61, 0x4b, 0x7e, 0x3e, 0xb3,
+  0xc8, 0xc8, 0x52, 0x8a, 0x0a, 0x8f, 0x46, 0xd2, 0xb0, 0x78, 0xff, 0x6d,
+  0x61, 0xc4, 0x15, 0x52, 0xf8, 0x83, 0x1e, 0x8d, 0xfb, 0xdb, 0xeb, 0xf8,
+  0xfa, 0xd0, 0x14, 0xb6, 0x74, 0x3c, 0xfc, 0xb7, 0x2f, 0xce, 0x70, 0xb8,
+  0xa9, 0x7a, 0xeb, 0x0d, 0x6a, 0x83, 0x5d, 0x6f, 0xec, 0x6c, 0xe0, 0xcf,
+  0x8f, 0xf5, 0xf2, 0xd1, 0xa7, 0x87, 0x89, 0xe5, 0x9c, 0x44, 0xa6, 0x0f,
+  0x1e, 0x1f, 0x44, 0x57, 0x15, 0xde, 0xd2, 0xdd, 0x78, 0xeb, 0x02, 0x1a,
+  0xa0, 0xbb, 0xbb, 0x8b, 0xea, 0xea, 0x2a, 0xfa, 0xfb, 0x07, 0x88, 0x44,
+  0xa6, 0x88, 0xc5, 0x16, 0x8b, 0x69, 0xa4, 0x42, 0x08, 0x7c, 0x3e, 0x3f,
+  0x35, 0x35, 0xd5, 0x34, 0x37, 0xb7, 0xd0, 0xdb, 0xbb, 0x8b, 0x70, 0xb8,
+  0xa3, 0xf4, 0x87, 0x36, 0x8c, 0xa2, 0x82, 0xa0, 0x28, 0xca, 0x75, 0xf3,
+  0xd4, 0xf6, 0xf6, 0x36, 0xea, 0xeb, 0xeb, 0x99, 0x9d, 0x9d, 0x75, 0x65,
+  0x35, 0x79, 0x55, 0x6e, 0xbc, 0x5a, 0xe7, 0xb6, 0x2c, 0xab, 0xa4, 0x2e,
+  0xd6, 0x06, 0x73, 0xeb, 0xc2, 0xe1, 0x30, 0x77, 0xde, 0x79, 0x27, 0x27,
+  0x4f, 0x3e, 0xc7, 0xf2, 0xf2, 0x32, 0xba, 0xae, 0x13, 0x0e, 0xb7, 0x13,
+  0xdc, 0x42, 0xe4, 0x39, 0xba, 0x9c, 0xe6, 0xeb, 0xc3, 0x11, 0x0c, 0xdb,
+  0x59, 0xe4, 0xbc, 0xd6, 0xe7, 0xe1, 0x6d, 0xdd, 0x4d, 0x57, 0x5d, 0x79,
+  0xf4, 0xfd, 0xb7, 0x85, 0x79, 0x68, 0x70, 0x8a, 0xa4, 0x61, 0x61, 0x23,
+  0x79, 0x7c, 0x3a, 0xc6, 0xf1, 0x99, 0x45, 0x6c, 0x09, 0x19, 0xc3, 0xc2,
+  0xb2, 0x25, 0xa6, 0x61, 0xad, 0x34, 0x66, 0x9c, 0x91, 0x40, 0xc3, 0x30,
+  0x49, 0x01, 0xd2, 0x34, 0x37, 0xcc, 0x89, 0x7e, 0xe7, 0x8e, 0x26, 0xd2,
+  0xa6, 0xc5, 0xc7, 0x9f, 0x1b, 0x61, 0x3a, 0x95, 0x23, 0x69, 0x58, 0xbc,
+  0xf7, 0x89, 0x01, 0x32, 0xd6, 0x1e, 0xde, 0xb5, 0xb3, 0x65, 0x5b, 0x02,
+  0xfa, 0x9a, 0xa7, 0x60, 0x2d, 0x2e, 0x2e, 0xb2, 0xb0, 0x10, 0x23, 0x95,
+  0x4a, 0x61, 0x9a, 0x26, 0xaa, 0xaa, 0x12, 0x08, 0xf8, 0xa9, 0xae, 0xae,
+  0xa6, 0xa1, 0xa1, 0x61, 0x43, 0xee, 0x79, 0xee, 0xdc, 0xb9, 0xa2, 0x0c,
+  0xa6, 0xaa, 0x2a, 0x5d, 0x5d, 0xdd, 0x54, 0x57, 0x5f, 0x5f, 0x97, 0x3a,
+  0x3b, 0x3b, 0xc7, 0xdc, 0xdc, 0x2c, 0xb9, 0x5c, 0xfe, 0xaa, 0x91, 0xbb,
+  0xa2, 0x28, 0xb4, 0xb6, 0xb6, 0x16, 0x27, 0x1d, 0xcc, 0xcc, 0xcc, 0x12,
+  0x89, 0x44, 0x90, 0xd2, 0x46, 0x4a, 0x68, 0x6c, 0x6c, 0xa0, 0xa3, 0xa3,
+  0x63, 0x03, 0x6a, 0x23, 0x19, 0x1f, 0x1f, 0x67, 0x71, 0x31, 0x8e, 0xdf,
+  0xef, 0x27, 0x1c, 0x6e, 0xa7, 0xa2, 0xe2, 0xea, 0xa3, 0x78, 0xd3, 0xe9,
+  0x1c, 0xdf, 0x1d, 0x99, 0x41, 0x15, 0x02, 0x4b, 0x4a, 0xc2, 0x15, 0x3e,
+  0xde, 0xd4, 0xd9, 0xb0, 0xa5, 0x97, 0x02, 0x7d, 0x75, 0x70, 0xca, 0x19,
+  0x84, 0x91, 0xe0, 0xd5, 0x14, 0xee, 0xaa, 0x0f, 0xb1, 0x98, 0x33, 0xe8,
+  0x8f, 0x25, 0xd1, 0x14, 0x41, 0xde, 0x92, 0xbc, 0xef, 0xb6, 0x36, 0x2a,
+  0x3d, 0x1a, 0x96, 0x94, 0x9c, 0x9a, 0x4f, 0xf0, 0x64, 0x64, 0x11, 0x5d,
+  0x15, 0xe4, 0x2c, 0x9b, 0xb7, 0xf7, 0x34, 0xd1, 0xbd, 0xc1, 0x2a, 0xa7,
+  0x39, 0xcb, 0xe6, 0x27, 0x93, 0x0b, 0xbc, 0xb8, 0x94, 0x46, 0x55, 0x04,
+  0x86, 0x2d, 0x69, 0x09, 0x78, 0xf9, 0xcd, 0x1d, 0xcd, 0xdb, 0x52, 0xf9,
+  0x28, 0xcf, 0x29, 0xbc, 0x45, 0x6d, 0xbb, 0xce, 0x63, 0xd4, 0xa4, 0x94,
+  0x48, 0xdb, 0xe9, 0xce, 0x9c, 0x8f, 0xe5, 0x7c, 0x6c, 0x1b, 0xdb, 0xb6,
+  0xb1, 0x6d, 0x0b, 0x5b, 0x5a, 0xce, 0x31, 0xb6, 0x8d, 0x94, 0x56, 0x31,
+  0x93, 0x6e, 0xe5, 0xff, 0x95, 0x73, 0xb1, 0x6d, 0xd7, 0x03, 0x4a, 0x90,
+  0x12, 0xcb, 0x2d, 0x1b, 0xf7, 0x63, 0xe3, 0x78, 0x47, 0x6c, 0x1b, 0x89,
+  0x5b, 0x8e, 0x74, 0x45, 0x25, 0xf7, 0xbb, 0xfb, 0x4f, 0xf1, 0x3c, 0x49,
+  0xe9, 0xdf, 0xd5, 0x11, 0x62, 0xc1, 0xdb, 0xba, 0xcd, 0x13, 0xe7, 0x10,
+  0x59, 0x42, 0x2e, 0xe5, 0x3a, 0x9e, 0x59, 0xd8, 0x2e, 0x41, 0x8a, 0xab,
+  0x52, 0x97, 0x86, 0x96, 0x9d, 0xb4, 0x76, 0xed, 0xdf, 0x5e, 0x9e, 0x6c,
+  0x7b, 0x73, 0x68, 0xe9, 0xac, 0x6a, 0x82, 0x0b, 0xc6, 0x02, 0x90, 0xdd,
+  0x8f, 0x65, 0x99, 0xd8, 0xb6, 0x05, 0xb6, 0x03, 0x76, 0xcb, 0xb2, 0x8a,
+  0xc7, 0x49, 0xdb, 0xc2, 0xb2, 0x6d, 0x27, 0xa3, 0x4c, 0x9a, 0xee, 0x36,
+  0xdb, 0x05, 0xa6, 0xc4, 0xb2, 0x2c, 0x6c, 0xf7, 0x3b, 0xd2, 0xc6, 0x76,
+  0x01, 0x28, 0x0b, 0x80, 0xb6, 0x25, 0x12, 0xcb, 0x01, 0x65, 0x11, 0xd0,
+  0x2e, 0xf8, 0x65, 0xa1, 0x4e, 0xab, 0x00, 0x6d, 0xaf, 0x06, 0xb4, 0x74,
+  0xcb, 0x76, 0x21, 0xb9, 0x16, 0xd0, 0x72, 0x15, 0x70, 0xc1, 0x01, 0xaf,
+  0x90, 0x28, 0xc2, 0x49, 0x8e, 0x97, 0xd8, 0x20, 0x15, 0x9c, 0x29, 0xa8,
+  0x9b, 0xfc, 0xf0, 0x42, 0xe0, 0xf7, 0x55, 0x94, 0x5d, 0xfa, 0x2f, 0x0a,
+  0xa0, 0x05, 0x80, 0xa2, 0x82, 0x90, 0x08, 0xa9, 0x22, 0x50, 0x91, 0xd2,
+  0x46, 0x2d, 0x78, 0x4e, 0x59, 0xf0, 0xc6, 0x2e, 0xd8, 0x5c, 0xcf, 0x69,
+  0xbb, 0x00, 0xa5, 0xe0, 0xd9, 0x0b, 0x5e, 0xd4, 0x05, 0x5a, 0x31, 0x80,
+  0xb1, 0x6d, 0x24, 0x8e, 0x37, 0x2f, 0x82, 0xb2, 0xe0, 0x8d, 0x5d, 0xb8,
+  0x39, 0x13, 0x67, 0x65, 0x11, 0xa4, 0x05, 0x1e, 0x5b, 0x68, 0x6c, 0x05,
+  0xb0, 0xaf, 0xfc, 0x5f, 0x00, 0xb1, 0x5c, 0x9f, 0xb6, 0x5a, 0x2c, 0x77,
+  0x7d, 0x07, 0xab, 0x20, 0x98, 0xcb, 0xe4, 0x38, 0xb3, 0xb0, 0x8c, 0x61,
+  0x3b, 0xc7, 0x49, 0xdb, 0x76, 0x07, 0x38, 0xe4, 0x26, 0x9e, 0x4c, 0x30,
+  0xb1, 0xac, 0xe2, 0xcd, 0xcd, 0xb3, 0xba, 0x64, 0xe9, 0xd6, 0xf1, 0x4d,
+  0x9d, 0x0d, 0x28, 0xc2, 0xe1, 0xb1, 0xdf, 0x18, 0x9e, 0xe6, 0x27, 0x93,
+  0x0b, 0x7c, 0xe4, 0x60, 0x17, 0xaf, 0x6a, 0x08, 0xf1, 0x27, 0x27, 0x47,
+  0x98, 0xcd, 0xe4, 0xf9, 0xf3, 0x63, 0x7d, 0x04, 0x34, 0x85, 0x68, 0x26,
+  0xcf, 0xdb, 0x1e, 0x39, 0xcd, 0x3b, 0x76, 0x34, 0x73, 0xb4, 0xa9, 0x8a,
+  0xcf, 0x9d, 0xbd, 0xc4, 0x72, 0xde, 0x2a, 0xe1, 0xb2, 0x3e, 0x55, 0xe1,
+  0xdf, 0xf7, 0xb6, 0xd2, 0x12, 0xd0, 0xf9, 0xd3, 0x17, 0xc6, 0xc8, 0x98,
+  0x76, 0x31, 0xa8, 0x34, 0xa5, 0xe4, 0x53, 0x77, 0xef, 0x62, 0x6f, 0x6d,
+  0x05, 0xdf, 0x1e, 0x99, 0xe6, 0xdb, 0xc3, 0xd3, 0xee, 0xd4, 0x2c, 0x49,
+  0xbd, 0x57, 0xe7, 0x1d, 0x3b, 0x9a, 0xf8, 0x95, 0x8e, 0x7a, 0x14, 0x21,
+  0x58, 0xc8, 0x19, 0x7c, 0xf4, 0xe9, 0x61, 0xa6, 0x92, 0xb9, 0xe2, 0xc2,
+  0x37, 0x59, 0xcb, 0xe6, 0xbd, 0x7d, 0x6d, 0xfc, 0xfa, 0x0e, 0x27, 0x50,
+  0x9d, 0x4e, 0xe7, 0xf8, 0xf0, 0x89, 0x21, 0x76, 0x54, 0x05, 0xf8, 0xc3,
+  0xfd, 0x5d, 0x54, 0xad, 0xca, 0xf5, 0x58, 0xca, 0x9b, 0x7c, 0xf9, 0xc2,
+  0x24, 0x27, 0x66, 0xe2, 0x78, 0x55, 0x85, 0x5f, 0xed, 0xac, 0xe7, 0x6d,
+  0xdd, 0x4d, 0x04, 0xdc, 0x75, 0x40, 0x3e, 0xf9, 0xfc, 0x28, 0xcf, 0xcc,
+  0xad, 0xe4, 0x8f, 0x9b, 0xb6, 0xe4, 0xf6, 0xba, 0x0a, 0x3e, 0x7c, 0xa0,
+  0x6b, 0xc3, 0xe5, 0x81, 0x5f, 0x3e, 0x0f, 0x2d, 0x9c, 0x85, 0xab, 0x56,
+  0x1e, 0xea, 0xf6, 0x1e, 0xf7, 0x7f, 0x64, 0x68, 0x9a, 0xff, 0x7c, 0x69,
+  0x98, 0x94, 0x61, 0xad, 0xe9, 0x7f, 0xc5, 0xa6, 0xe2, 0xb7, 0x1c, 0xbf,
+  0xb8, 0x81, 0x44, 0x67, 0x73, 0x77, 0x63, 0x35, 0xbf, 0xdc, 0x51, 0x8f,
+  0x2e, 0x04, 0xb6, 0x84, 0xb1, 0x44, 0x9a, 0x13, 0x33, 0x8b, 0x2c, 0xe5,
+  0xdb, 0x99, 0x4c, 0x65, 0xf9, 0xe1, 0x44, 0x94, 0xb3, 0x0b, 0x09, 0x42,
+  0xba, 0xc6, 0xa7, 0x8e, 0xec, 0x26, 0x67, 0xdb, 0xfc, 0x2c, 0xb2, 0xc0,
+  0xde, 0xda, 0x0a, 0xde, 0xd4, 0xd9, 0xc0, 0xbe, 0xda, 0x0a, 0x32, 0xa6,
+  0xcd, 0xd7, 0x86, 0x26, 0xc9, 0x9a, 0x92, 0xff, 0xb4, 0x2f, 0x8c, 0xa6,
+  0x08, 0x2a, 0x75, 0x8d, 0xc7, 0xa6, 0x62, 0x3c, 0x7c, 0x29, 0xca, 0xaf,
+  0xef, 0x68, 0xa6, 0xbb, 0xd2, 0x8f, 0x2d, 0x9d, 0xe4, 0xfc, 0x0a, 0x8f,
+  0x4a, 0x22, 0x6f, 0xf1, 0x37, 0x17, 0xa6, 0x98, 0x48, 0x64, 0x78, 0x63,
+  0x67, 0x23, 0x75, 0x3e, 0x0f, 0x27, 0x66, 0xe3, 0xbc, 0xe3, 0x27, 0xa7,
+  0x79, 0x4f, 0x6f, 0x1b, 0x5f, 0xbc, 0xe7, 0x36, 0x86, 0x16, 0x53, 0x7c,
+  0xe5, 0xfc, 0x24, 0xf7, 0xb6, 0xd6, 0xf2, 0x4b, 0xed, 0xb5, 0xe4, 0x2d,
+  0x49, 0xde, 0xb6, 0x69, 0x0a, 0x78, 0x01, 0x27, 0x68, 0xfd, 0xdf, 0xfd,
+  0x13, 0x7c, 0x67, 0x64, 0x86, 0x06, 0x9f, 0xce, 0x8e, 0xca, 0x00, 0xef,
+  0xee, 0x75, 0xd2, 0x66, 0xa7, 0x52, 0x39, 0xee, 0xfb, 0xa7, 0x67, 0x49,
+  0x1a, 0x16, 0x6f, 0xef, 0x69, 0x22, 0x65, 0x58, 0xfc, 0xfe, 0xcf, 0x06,
+  0xf9, 0x97, 0xa9, 0x45, 0x3e, 0x77, 0xac, 0x17, 0x01, 0x3c, 0x34, 0x34,
+  0x45, 0xce, 0xb6, 0x79, 0x4f, 0x6f, 0x5b, 0xb1, 0x6e, 0x5d, 0x21, 0xff,
+  0x86, 0xef, 0x27, 0xff, 0x57, 0x27, 0xdb, 0xfd, 0xa2, 0x99, 0x69, 0x64,
+  0x37, 0x1c, 0x8a, 0xf7, 0x78, 0x54, 0x2e, 0xc5, 0x62, 0x34, 0xa8, 0x16,
+  0x35, 0x8a, 0xdc, 0x92, 0xce, 0xab, 0x6a, 0xba, 0xa3, 0x41, 0xaf, 0xd9,
+  0x9d, 0xb1, 0x6c, 0xde, 0xd8, 0x59, 0x5f, 0x32, 0x48, 0xe1, 0xcc, 0xc0,
+  0x76, 0x72, 0x37, 0x04, 0x02, 0x4d, 0x08, 0x82, 0x9a, 0xca, 0x5f, 0x0e,
+  0x4c, 0xf0, 0xf6, 0x9e, 0x26, 0xe7, 0x5d, 0x2b, 0xae, 0x02, 0xd2, 0x13,
+  0xf2, 0xf3, 0x5f, 0xdc, 0x44, 0xa4, 0x1f, 0x8c, 0xcf, 0xb2, 0x80, 0xc1,
+  0x27, 0x0e, 0xed, 0x04, 0x1c, 0x56, 0xf5, 0xb3, 0xe9, 0x45, 0x02, 0x9a,
+  0xca, 0x7f, 0xdc, 0x1b, 0xe6, 0xe8, 0x1a, 0x4d, 0x3a, 0x96, 0x33, 0x50,
+  0x04, 0x74, 0x87, 0xfc, 0xfc, 0xf1, 0x5d, 0x3d, 0x34, 0xfa, 0x75, 0xb2,
+  0x96, 0xc5, 0xc1, 0xef, 0x9d, 0xe0, 0xef, 0x46, 0x67, 0xf8, 0xe2, 0x3d,
+  0xb7, 0xa1, 0x08, 0x50, 0x14, 0xc1, 0x2f, 0xb5, 0xd7, 0xf2, 0x5f, 0xef,
+  0xda, 0xb1, 0x5e, 0xad, 0xca, 0x59, 0x7c, 0x63, 0x38, 0x42, 0x53, 0x40,
+  0x07, 0x09, 0x8f, 0x47, 0x62, 0xbc, 0xa5, 0xbb, 0x91, 0x90, 0xae, 0xf1,
+  0x0f, 0xa3, 0x33, 0xcc, 0x67, 0x0c, 0x3e, 0x7e, 0x68, 0x07, 0x7f, 0x70,
+  0x7b, 0x27, 0x00, 0xbf, 0x36, 0x36, 0xc7, 0x40, 0x2c, 0x49, 0x3c, 0x67,
+  0x50, 0xeb, 0xf3, 0xa0, 0x2a, 0x82, 0x06, 0x5d, 0x2f, 0xd6, 0xf9, 0x17,
+  0x4a, 0x87, 0xfe, 0x85, 0x8a, 0xde, 0x6d, 0x8b, 0xd1, 0x0b, 0xc7, 0x37,
+  0x5c, 0x0e, 0x4b, 0x13, 0x82, 0xc3, 0x46, 0x8a, 0xbe, 0x26, 0x73, 0x4b,
+  0x51, 0x91, 0xb4, 0x6d, 0xba, 0xfa, 0x8e, 0xe1, 0xf3, 0x57, 0xb2, 0x96,
+  0xc8, 0xd8, 0x52, 0xd2, 0x53, 0x19, 0xb8, 0xe2, 0xa8, 0x9b, 0x2d, 0x9d,
+  0xa4, 0xfe, 0xa4, 0x61, 0xf1, 0xa1, 0xe3, 0x43, 0x3c, 0xf4, 0xda, 0x7d,
+  0x20, 0xd6, 0x2f, 0xe4, 0xb8, 0x8a, 0x69, 0xb9, 0xd4, 0xc2, 0x46, 0x08,
+  0xa7, 0x1b, 0xff, 0x97, 0xa9, 0x18, 0x0b, 0x59, 0x83, 0x06, 0x9f, 0xce,
+  0xa1, 0xc6, 0x2a, 0x56, 0xcf, 0xa5, 0x95, 0x12, 0x46, 0x97, 0x33, 0x9c,
+  0x5d, 0x48, 0xf0, 0xb7, 0xc3, 0x11, 0x2c, 0x29, 0xf9, 0x90, 0x0b, 0xc0,
+  0xc2, 0x0d, 0x5e, 0x58, 0x4c, 0xf2, 0x93, 0xcb, 0x0b, 0xa8, 0x02, 0xee,
+  0x6e, 0xaa, 0x2e, 0x2e, 0x99, 0xf0, 0xbd, 0x17, 0x67, 0x58, 0x32, 0x4c,
+  0xde, 0xb7, 0xa7, 0x1d, 0x4d, 0x11, 0x7c, 0x73, 0x78, 0x9a, 0xd3, 0x0b,
+  0x09, 0xee, 0x69, 0xa9, 0x71, 0xe7, 0x63, 0x3a, 0x0b, 0xd5, 0x14, 0xec,
+  0x2d, 0xdd, 0x8d, 0xc5, 0x01, 0x99, 0x78, 0xde, 0x40, 0xe0, 0x8c, 0x72,
+  0xfe, 0x78, 0xc2, 0x49, 0x85, 0xe8, 0xad, 0x0e, 0xb2, 0xb3, 0x2a, 0x50,
+  0x06, 0xf4, 0x8d, 0xb6, 0xe4, 0x52, 0x94, 0x68, 0x64, 0x78, 0xc3, 0xc1,
+  0x1b, 0x55, 0x11, 0xb4, 0x69, 0x2a, 0x1d, 0x5b, 0x0c, 0xf1, 0x15, 0x8f,
+  0xce, 0xde, 0xf0, 0xf5, 0xcf, 0x5e, 0xb1, 0xa4, 0xa4, 0xaf, 0x26, 0xc8,
+  0x81, 0xda, 0x4a, 0xfe, 0xa2, 0x7f, 0x9c, 0xcf, 0x9e, 0x19, 0xdb, 0xd2,
+  0x1b, 0xae, 0x0a, 0xde, 0xde, 0xb0, 0x6d, 0xfe, 0x69, 0x7c, 0x8e, 0x47,
+  0x27, 0x63, 0x1c, 0x6d, 0xaa, 0xe2, 0xae, 0x86, 0x50, 0x91, 0x4f, 0x0b,
+  0x04, 0x59, 0xcb, 0xe2, 0x4b, 0xe7, 0x2f, 0xf3, 0xdd, 0x91, 0x19, 0x1e,
+  0x6c, 0xaf, 0xe5, 0x93, 0x87, 0x77, 0xf1, 0x1b, 0x3b, 0x9a, 0x4b, 0x9a,
+  0xde, 0xe9, 0xf9, 0x04, 0x9f, 0xc9, 0x8e, 0xd3, 0xec, 0xd7, 0xd9, 0x55,
+  0x1d, 0xa4, 0xc2, 0xa3, 0x62, 0x4b, 0xc9, 0x17, 0xcf, 0x5d, 0xa6, 0xc9,
+  0xaf, 0xf3, 0x9e, 0xde, 0x36, 0xce, 0x2f, 0xa6, 0xf8, 0xc2, 0xd9, 0x09,
+  0x9e, 0x9c, 0x5e, 0x74, 0x00, 0x7d, 0xc5, 0x3e, 0xab, 0x70, 0x75, 0x88,
+  0x1b, 0x16, 0x9f, 0x3f, 0x7b, 0x09, 0x5d, 0x11, 0xfc, 0xf6, 0xee, 0x96,
+  0x32, 0xa0, 0x6f, 0x86, 0x29, 0x9a, 0x87, 0x8e, 0x5d, 0x87, 0xd7, 0xfd,
+  0x1c, 0xaa, 0x10, 0x8c, 0x2f, 0x67, 0x78, 0x6c, 0x2e, 0x4e, 0xc6, 0xdc,
+  0xca, 0x48, 0xa5, 0xc4, 0xa3, 0xfb, 0x39, 0x75, 0x71, 0x7a, 0x5d, 0xe0,
+  0xe9, 0x70, 0x59, 0x8d, 0x5f, 0xed, 0x68, 0xc0, 0xaf, 0x5d, 0x19, 0xa0,
+  0x59, 0xd3, 0xe6, 0xc3, 0x07, 0xbb, 0x78, 0x7c, 0x3a, 0xc6, 0x77, 0x47,
+  0x66, 0xdc, 0x00, 0x4d, 0x6c, 0xe1, 0xea, 0x12, 0xaf, 0xaa, 0xf0, 0xe1,
+  0x83, 0xdd, 0xbc, 0xb6, 0xad, 0x16, 0x4d, 0x88, 0x75, 0xab, 0x9a, 0x6a,
+  0x8a, 0xa0, 0x39, 0xe0, 0x25, 0xa4, 0xab, 0x54, 0x79, 0x3d, 0xbc, 0xb5,
+  0xbb, 0x69, 0x1d, 0x85, 0x7a, 0x5d, 0xb8, 0x9e, 0xff, 0x76, 0x68, 0x27,
+  0x59, 0xd3, 0x2a, 0x26, 0x48, 0xfd, 0xf3, 0xe5, 0x79, 0x2e, 0x2e, 0xa7,
+  0x50, 0x85, 0xe0, 0x8f, 0x4f, 0x8e, 0x30, 0x97, 0xc9, 0xa3, 0x2a, 0xf0,
+  0x7f, 0x46, 0x67, 0x79, 0x6f, 0x5f, 0x5b, 0x51, 0x48, 0xd2, 0x57, 0x5d,
+  0x6f, 0x31, 0x67, 0x30, 0x9b, 0xc9, 0xd3, 0x59, 0xe1, 0x2b, 0xae, 0x1b,
+  0xd9, 0xe8, 0xd3, 0xf9, 0xce, 0x83, 0xfb, 0xb1, 0x6c, 0x49, 0xe5, 0xbf,
+  0x92, 0xc9, 0x03, 0xdb, 0x0e, 0xd0, 0x81, 0x8a, 0x5a, 0x02, 0x15, 0x35,
+  0x1b, 0xc8, 0x6f, 0x0a, 0x8f, 0x0e, 0x4d, 0xf2, 0x95, 0x98, 0xbd, 0xe1,
+  0x5a, 0x70, 0x9b, 0x68, 0x76, 0x88, 0x99, 0xe1, 0x75, 0x9b, 0x73, 0xb6,
+  0xe4, 0xbe, 0x96, 0x1a, 0x1e, 0x6c, 0xaf, 0xc3, 0x7f, 0x95, 0x0c, 0x5c,
+  0x89, 0x24, 0xa4, 0x6b, 0x7c, 0xe6, 0x48, 0x2f, 0x0f, 0x3e, 0xfc, 0x1c,
+  0xae, 0x10, 0x79, 0xd5, 0x4b, 0xdb, 0xae, 0x14, 0x69, 0xd9, 0x12, 0xd3,
+  0x92, 0xa4, 0x6d, 0x8b, 0x78, 0xce, 0xa0, 0x39, 0xe0, 0x75, 0x01, 0x25,
+  0xd1, 0x14, 0xc1, 0x7b, 0xfa, 0xda, 0x68, 0xf2, 0x7b, 0xf8, 0x1f, 0xa7,
+  0xc6, 0x78, 0xdf, 0x13, 0x03, 0x7c, 0xed, 0xb5, 0xfb, 0x4a, 0x56, 0xa7,
+  0x0e, 0x79, 0x34, 0xaa, 0x75, 0x0d, 0x56, 0x01, 0xee, 0xf3, 0x67, 0x2f,
+  0xe1, 0x11, 0x0a, 0xff, 0xf3, 0xee, 0x5d, 0x04, 0x35, 0x15, 0x8f, 0x2a,
+  0x78, 0x32, 0xb2, 0xc8, 0xd7, 0x87, 0x23, 0xfc, 0x7c, 0x26, 0x4e, 0x77,
+  0xa5, 0x9f, 0xac, 0x69, 0xf3, 0x8f, 0x63, 0x73, 0x1c, 0x6e, 0xac, 0x22,
+  0x9a, 0xc9, 0xf3, 0xd9, 0x33, 0xe3, 0x78, 0x55, 0x85, 0x4f, 0x1f, 0xd9,
+  0x4d, 0x83, 0x4f, 0xc7, 0x96, 0x12, 0x1b, 0x30, 0x2c, 0x1b, 0xd3, 0x96,
+  0x44, 0x33, 0x79, 0x74, 0x45, 0x50, 0xef, 0xd7, 0xd1, 0x5e, 0xc1, 0x21,
+  0xc8, 0x6d, 0x07, 0x68, 0x67, 0xe8, 0x7d, 0xe3, 0x07, 0x3a, 0xb0, 0x64,
+  0x30, 0x91, 0x95, 0x88, 0x2d, 0xa5, 0x81, 0x0b, 0x2c, 0x33, 0xbf, 0x61,
+  0xc7, 0x9b, 0x31, 0x2c, 0xfa, 0x6a, 0x2a, 0xd6, 0xd0, 0x07, 0x49, 0xce,
+  0xb2, 0x49, 0x18, 0x4e, 0x5e, 0x85, 0x44, 0x92, 0x34, 0x4c, 0x74, 0x45,
+  0x60, 0x4a, 0xc9, 0xe1, 0xa6, 0x2a, 0x3e, 0x7a, 0xb0, 0x9b, 0x8f, 0x9f,
+  0x1c, 0xa1, 0x4a, 0x2f, 0x55, 0x92, 0x12, 0x86, 0xc5, 0xf2, 0x2a, 0xd5,
+  0x45, 0x13, 0x0a, 0x35, 0xba, 0xc6, 0x72, 0xde, 0xe4, 0x03, 0x3f, 0xbf,
+  0x80, 0x5f, 0x53, 0x91, 0xd2, 0x91, 0xed, 0xbe, 0xf7, 0xe0, 0x01, 0xf6,
+  0xd6, 0x56, 0x90, 0x32, 0x2c, 0x6c, 0xe9, 0x78, 0xd1, 0x3f, 0xd8, 0xdf,
+  0x45, 0xc2, 0xb0, 0xf8, 0xf4, 0xe9, 0x31, 0x52, 0xa6, 0xcd, 0x77, 0xee,
+  0xbf, 0x1d, 0x4b, 0x82, 0x9d, 0x37, 0xc9, 0xac, 0xc9, 0x57, 0xf9, 0xd9,
+  0x74, 0x9c, 0x9f, 0xcd, 0xc4, 0x39, 0xd2, 0x54, 0xc5, 0xfb, 0xf7, 0x86,
+  0x8b, 0x23, 0x86, 0xbd, 0xd5, 0x41, 0x1e, 0x8f, 0xc4, 0xf8, 0xec, 0x99,
+  0x71, 0x7e, 0xf0, 0x86, 0x3b, 0xf8, 0xc2, 0xbf, 0xe9, 0xe3, 0x73, 0x67,
+  0x2f, 0xf1, 0xe0, 0xc3, 0xcf, 0x23, 0x90, 0x74, 0x55, 0x06, 0xf8, 0xd8,
+  0x1d, 0xdd, 0x74, 0x87, 0x02, 0x58, 0x52, 0x12, 0xd0, 0x54, 0x06, 0xe3,
+  0x29, 0x8e, 0xfc, 0xe3, 0x33, 0x6e, 0xdd, 0x6c, 0x8e, 0x34, 0x55, 0xf3,
+  0x85, 0x57, 0xef, 0xa1, 0xed, 0x15, 0x5c, 0x26, 0x61, 0x5b, 0x0d, 0x7d,
+  0x1b, 0xb9, 0x34, 0x83, 0xa7, 0x7f, 0x8a, 0x61, 0xe4, 0x36, 0x80, 0xa7,
+  0xb3, 0x60, 0xa2, 0x61, 0x6d, 0xed, 0x76, 0x2d, 0xcb, 0xe0, 0xc0, 0xd1,
+  0xb7, 0xa2, 0x7b, 0x03, 0xeb, 0x21, 0x2d, 0x1d, 0xbd, 0x78, 0x75, 0x8e,
+  0x86, 0x94, 0x30, 0x9f, 0xcd, 0xb3, 0x64, 0x98, 0xb4, 0x04, 0xbc, 0xe8,
+  0x8a, 0xc2, 0xe5, 0x54, 0x16, 0x55, 0x40, 0x47, 0x85, 0x1f, 0x81, 0x93,
+  0x57, 0x31, 0x9f, 0xcd, 0x53, 0xeb, 0xf5, 0x94, 0x2c, 0x78, 0x3e, 0xba,
+  0x9c, 0xc6, 0x92, 0xb0, 0x6b, 0x15, 0x07, 0xcd, 0x59, 0x36, 0xb3, 0x99,
+  0x3c, 0x69, 0xd3, 0x2a, 0xe1, 0xb4, 0x1d, 0x15, 0x3e, 0x7c, 0xaa, 0xc2,
+  0xe5, 0x54, 0x0e, 0xa4, 0xa4, 0x35, 0xe8, 0xc3, 0xe3, 0xe6, 0x68, 0x5c,
+  0x4a, 0x66, 0x90, 0x12, 0xc2, 0x15, 0x3e, 0x24, 0x92, 0xf1, 0xe5, 0x2c,
+  0xf5, 0x3e, 0x4f, 0x89, 0x2e, 0xbc, 0x98, 0x33, 0x89, 0x66, 0x72, 0x54,
+  0x7b, 0x3d, 0xc5, 0x85, 0x1f, 0x0b, 0x7c, 0x3f, 0x92, 0xca, 0x91, 0xb5,
+  0x6c, 0x7a, 0x42, 0x4e, 0x4e, 0x48, 0xc6, 0xb4, 0x89, 0x65, 0x0d, 0x84,
+  0x70, 0x82, 0x5b, 0xaf, 0x2a, 0x8a, 0x1c, 0x7e, 0x29, 0xef, 0x50, 0x90,
+  0xe2, 0x18, 0x16, 0x10, 0xd0, 0x54, 0x5a, 0x02, 0xde, 0xeb, 0x5a, 0x05,
+  0xaa, 0x0c, 0xe8, 0x0d, 0x2c, 0x3e, 0x3f, 0xc9, 0xc8, 0xc0, 0xe3, 0x98,
+  0xe6, 0x4b, 0x7b, 0xb9, 0xa4, 0x94, 0x12, 0xdd, 0x17, 0xe0, 0x8e, 0x57,
+  0xbf, 0x13, 0x45, 0xb9, 0x75, 0xe6, 0xe3, 0x6d, 0x07, 0xdb, 0x56, 0x94,
+  0x43, 0x4a, 0x9b, 0xea, 0xfa, 0xf5, 0xd3, 0xa8, 0x14, 0xe1, 0x78, 0xa6,
+  0xcb, 0xc9, 0x2c, 0xa6, 0xb4, 0x29, 0xcc, 0x3c, 0xdb, 0xc8, 0x91, 0x08,
+  0xb7, 0x9c, 0x8a, 0x8a, 0x46, 0x06, 0xe2, 0x69, 0x07, 0xd0, 0xee, 0x71,
+  0x85, 0xa5, 0x80, 0x0b, 0x4b, 0x6d, 0x81, 0x33, 0x97, 0xaf, 0x70, 0xa2,
+  0x10, 0x2b, 0x0a, 0xc0, 0xea, 0x0f, 0xab, 0x06, 0xae, 0x04, 0x94, 0x7c,
+  0x5f, 0x5d, 0x0f, 0xb1, 0xaa, 0x0e, 0x45, 0x35, 0xdb, 0x2d, 0x44, 0x48,
+  0x4a, 0x46, 0x14, 0x57, 0xbf, 0x1f, 0x6b, 0x75, 0x7d, 0xc4, 0x6a, 0x1d,
+  0xa2, 0xa8, 0x89, 0xcb, 0x75, 0x72, 0x61, 0x09, 0x31, 0x13, 0x2b, 0xeb,
+  0xe4, 0xad, 0x79, 0x51, 0x80, 0xbb, 0x6f, 0x4d, 0xf9, 0x6b, 0xee, 0xb3,
+  0x74, 0xbb, 0x13, 0x80, 0xab, 0xaf, 0x90, 0x93, 0xbe, 0x65, 0xb2, 0xed,
+  0xbe, 0x31, 0x3a, 0xcf, 0x1f, 0x3e, 0x3d, 0xe4, 0x4e, 0x4c, 0x55, 0x50,
+  0x14, 0x81, 0x22, 0x24, 0x42, 0x28, 0xce, 0xff, 0x6a, 0x01, 0x1c, 0xce,
+  0xf2, 0xb4, 0x8a, 0x3b, 0xc4, 0x2e, 0x14, 0x05, 0x55, 0x38, 0x92, 0x9f,
+  0x47, 0x38, 0x83, 0x25, 0x9a, 0x70, 0x5e, 0x76, 0xa9, 0x00, 0x9a, 0x2a,
+  0x50, 0x11, 0xa8, 0x8a, 0x40, 0x15, 0x02, 0x45, 0x71, 0xff, 0x17, 0x8e,
+  0xee, 0xad, 0xb9, 0x6a, 0x84, 0x42, 0x61, 0xbf, 0x33, 0xe0, 0x51, 0xf8,
+  0xd1, 0x3d, 0x38, 0xe5, 0x29, 0xee, 0x39, 0xce, 0x79, 0x0a, 0x8a, 0x70,
+  0xae, 0xab, 0x28, 0xee, 0x39, 0x28, 0xc5, 0xe3, 0x34, 0x57, 0x82, 0x54,
+  0x85, 0x13, 0x0d, 0xa8, 0x8a, 0x5b, 0x67, 0xa1, 0xa0, 0xba, 0xf5, 0x2a,
+  0x94, 0xaf, 0xe0, 0xdc, 0xa7, 0xe2, 0x96, 0x2b, 0x84, 0x40, 0xc5, 0x99,
+  0xfe, 0xa5, 0x28, 0x8a, 0xbb, 0xcf, 0xa1, 0x12, 0xc5, 0xed, 0x25, 0xe7,
+  0x89, 0x62, 0xdd, 0x9c, 0x67, 0xb6, 0x7a, 0xbf, 0xf3, 0x5d, 0x75, 0x1b,
+  0x84, 0xc0, 0x99, 0x9a, 0x57, 0xed, 0x55, 0xf1, 0xbf, 0x42, 0x88, 0xbe,
+  0x65, 0xde, 0xb1, 0x12, 0x4d, 0xa5, 0xd0, 0xb1, 0xa9, 0xf6, 0xa9, 0x28,
+  0x45, 0xe0, 0xca, 0xe2, 0x8f, 0x24, 0x5c, 0x37, 0x59, 0xf8, 0x91, 0x84,
+  0x50, 0x50, 0x84, 0x86, 0x28, 0x00, 0xc7, 0x95, 0xcd, 0x34, 0x1c, 0xa0,
+  0x3a, 0xa0, 0x2c, 0x00, 0xc7, 0x05, 0x84, 0xb2, 0x02, 0x8c, 0x02, 0xa0,
+  0x34, 0x17, 0xec, 0x05, 0x90, 0x09, 0x51, 0x0a, 0x68, 0x8d, 0x15, 0xe0,
+  0x15, 0x00, 0xad, 0x0a, 0x65, 0x05, 0x38, 0x62, 0x05, 0xd0, 0xaa, 0xc0,
+  0x69, 0x2c, 0x6e, 0x59, 0x0e, 0xd8, 0x24, 0xaa, 0xa2, 0x38, 0xe5, 0x0a,
+  0x05, 0xd5, 0x9d, 0x65, 0xae, 0xad, 0x05, 0x26, 0x4e, 0xb9, 0xc2, 0x6d,
+  0x04, 0x4e, 0x1d, 0x14, 0x04, 0xee, 0x33, 0x58, 0x7d, 0xef, 0xac, 0xa9,
+  0x2f, 0xab, 0xea, 0xe2, 0xd6, 0x5f, 0xb8, 0x3d, 0x8b, 0xe2, 0x96, 0x27,
+  0xdc, 0x80, 0xdc, 0xe3, 0x36, 0xfc, 0x32, 0xe5, 0xb8, 0xa9, 0x54, 0x04,
+  0x5e, 0xd3, 0x5c, 0x43, 0xbd, 0x4f, 0xc7, 0xa3, 0xac, 0xbc, 0x74, 0xad,
+  0xd8, 0x9d, 0x17, 0x29, 0x81, 0x58, 0x4f, 0x0b, 0x44, 0xa1, 0x4b, 0x2f,
+  0x00, 0x64, 0xe5, 0x78, 0x51, 0xf4, 0x4c, 0xab, 0xbe, 0xbb, 0x5d, 0xb4,
+  0xd3, 0x68, 0xa4, 0xbb, 0xbf, 0x00, 0x14, 0x56, 0x28, 0x8b, 0x0b, 0x46,
+  0xb1, 0x9a, 0xa2, 0x14, 0xc0, 0x21, 0x56, 0x68, 0x43, 0xf1, 0x3a, 0x52,
+  0x94, 0xac, 0x2c, 0xaa, 0xac, 0x12, 0xe7, 0x4a, 0xeb, 0xe1, 0x1c, 0xa0,
+  0xac, 0xa1, 0x3d, 0x45, 0x3a, 0x24, 0x56, 0x28, 0x4d, 0x09, 0x0d, 0xda,
+  0x80, 0xba, 0x6c, 0xb8, 0x7f, 0x15, 0xdd, 0x28, 0x38, 0x00, 0x0a, 0xb4,
+  0xa6, 0xd0, 0x90, 0x5f, 0xc1, 0x74, 0x8e, 0x72, 0x82, 0x7f, 0xd9, 0xb6,
+  0x95, 0x95, 0xdf, 0x53, 0x58, 0xb6, 0x6d, 0x65, 0xff, 0x1f, 0x15, 0xa9,
+  0x64, 0x27, 0x80, 0x33, 0x9e, 0x47, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45,
+  0x4e, 0x44, 0xae, 0x42, 0x60, 0x82
+};
+unsigned int openair_logo_png_len = 7026;
diff --git a/common/utils/T/tracer/openair_logo.png b/common/utils/T/tracer/openair_logo.png
new file mode 100644
index 0000000000000000000000000000000000000000..6a14f2ab4bdf39e7d01bb396f80299b3e5dea075
Binary files /dev/null and b/common/utils/T/tracer/openair_logo.png differ
diff --git a/common/utils/T/tracer/packet-mac-lte.h b/common/utils/T/tracer/packet-mac-lte.h
new file mode 100644
index 0000000000000000000000000000000000000000..039b9dc3c4cfe13cd5310f1e8a3c6275f081df9b
--- /dev/null
+++ b/common/utils/T/tracer/packet-mac-lte.h
@@ -0,0 +1,404 @@
+/* packet-mac-lte.h
+ *
+ * Martin Mathieson
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
+ * Copyright 1998 Gerald Combs
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * This header file may also be distributed under
+ * the terms of the BSD Licence as follows:
+ *
+ * Copyright (C) 2009 Martin Mathieson. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE
+ */
+
+//#include "ws_symbol_export.h"
+
+/* radioType */
+#define FDD_RADIO 1
+#define TDD_RADIO 2
+
+/* Direction */
+#define DIRECTION_UPLINK   0
+#define DIRECTION_DOWNLINK 1
+
+/* rntiType */
+#define NO_RNTI     0
+#define P_RNTI      1
+#define RA_RNTI     2
+#define C_RNTI      3
+#define SI_RNTI     4
+#define SPS_RNTI    5
+#define M_RNTI      6
+#define SL_BCH_RNTI 7
+#define SL_RNTI     8
+#define SC_RNTI     9
+#define G_RNTI      10
+
+#if 0
+typedef enum mac_lte_oob_event {
+    ltemac_send_preamble,
+    ltemac_send_sr,
+    ltemac_sr_failure
+} mac_lte_oob_event;
+
+typedef enum mac_lte_dl_retx {
+    dl_retx_no,
+    dl_retx_yes,
+    dl_retx_unknown
+} mac_lte_dl_retx;
+
+typedef enum mac_lte_crc_status {
+    crc_fail = 0,
+    crc_success = 1,
+    crc_high_code_rate = 2,
+    crc_pdsch_lost = 3,
+    crc_duplicate_nonzero_rv = 4,
+    crc_false_dci = 5
+} mac_lte_crc_status;
+
+typedef enum mac_lte_carrier_id {
+    carrier_id_primary,
+    carrier_id_secondary_1,
+    carrier_id_secondary_2,
+    carrier_id_secondary_3,
+    carrier_id_secondary_4
+} mac_lte_carrier_id;
+
+typedef enum mac_lte_ce_mode {
+    no_ce_mode = 0,
+    ce_mode_a = 1,
+    ce_mode_b = 2
+} mac_lte_ce_mode;
+
+typedef enum mac_lte_nb_mode {
+    no_nb_mode = 0,
+    nb_mode = 1
+} mac_lte_nb_mode;
+
+/* Context info attached to each LTE MAC frame */
+typedef struct mac_lte_info
+{
+    /* Needed for decode */
+    guint8          radioType;
+    guint8          direction;
+    guint8          rntiType;
+
+    /* Extra info to display */
+    guint16         rnti;
+    guint16         ueid;
+
+    /* Timing info */
+    guint16         sysframeNumber;
+    guint16         subframeNumber;
+
+    /* Optional field. More interesting for TDD (FDD is always -4 subframeNumber) */
+    gboolean        subframeNumberOfGrantPresent;
+    guint16         subframeNumberOfGrant;
+
+    /* Flag set only if doing PHY-level data test - i.e. there may not be a
+       well-formed MAC PDU so just show as raw data */
+    gboolean        isPredefinedData;
+
+    /* Length of DL PDU or UL grant size in bytes */
+    guint16         length;
+
+    /* 0=newTx, 1=first-retx, etc */
+    guint8          reTxCount;
+    guint8          isPHICHNACK; /* FALSE=PDCCH retx grant, TRUE=PHICH NACK */
+
+    /* UL only.  Indicates if the R10 extendedBSR-Sizes parameter is set */
+    gboolean        isExtendedBSRSizes;
+
+    /* UL only.  Indicates if the R10 simultaneousPUCCH-PUSCH parameter is set for PCell */
+    gboolean        isSimultPUCCHPUSCHPCell;
+
+    /* UL only.  Indicates if the R10 extendedBSR-Sizes parameter is set for PSCell */
+    gboolean        isSimultPUCCHPUSCHPSCell;
+
+    /* Status of CRC check. For UE it is DL only. For eNodeB it is UL
+       only. For an analyzer, it is present for both DL and UL. */
+    gboolean        crcStatusValid;
+    mac_lte_crc_status crcStatus;
+
+    /* Carrier ID */
+    mac_lte_carrier_id   carrierId;
+
+    /* DL only.  Is this known to be a retransmission? */
+    mac_lte_dl_retx dl_retx;
+
+    /* DL only. CE mode to be used for RAR decoding */
+    mac_lte_ce_mode ceMode;
+
+    /* DL and UL. NB-IoT mode of the UE */
+    mac_lte_nb_mode nbMode;
+
+    /* More Physical layer info (see direction above for which side of union to use) */
+    union {
+        struct mac_lte_ul_phy_info
+        {
+            guint8 present;  /* Remaining UL fields are present and should be displayed */
+            guint8 modulation_type;
+            guint8 tbs_index;
+            guint8 resource_block_length;
+            guint8 resource_block_start;
+            guint8 harq_id;
+            gboolean ndi;
+        } ul_info;
+        struct mac_lte_dl_phy_info
+        {
+            guint8 present; /* Remaining DL fields are present and should be displayed */
+            guint8 dci_format;
+            guint8 resource_allocation_type;
+            guint8 aggregation_level;
+            guint8 mcs_index;
+            guint8 redundancy_version_index;
+            guint8 resource_block_length;
+            guint8 harq_id;
+            gboolean ndi;
+            guint8   transport_block;  /* 0..1 */
+        } dl_info;
+    } detailed_phy_info;
+
+    /* Relating to out-of-band events */
+    /* N.B. dissector will only look to these fields if length is 0... */
+    mac_lte_oob_event  oob_event;
+    guint8             rapid;
+    guint8             rach_attempt_number;
+    #define MAX_SRs 20
+    guint16            number_of_srs;
+    guint16            oob_ueid[MAX_SRs];
+    guint16            oob_rnti[MAX_SRs];
+} mac_lte_info;
+
+
+typedef struct mac_lte_tap_info {
+    /* Info from context */
+    guint16  rnti;
+    guint16  ueid;
+    guint8   rntiType;
+    guint8   isPredefinedData;
+    gboolean crcStatusValid;
+    mac_lte_crc_status   crcStatus;
+    guint8   direction;
+
+    guint8   isPHYRetx;
+    guint16  ueInTTI;
+
+    nstime_t mac_lte_time;
+
+    /* Number of bytes (which part is used depends upon context settings) */
+    guint32  single_number_of_bytes;
+    guint32  bytes_for_lcid[11];
+    guint32  sdus_for_lcid[11];
+    guint8   number_of_rars;
+    guint8   number_of_paging_ids;
+
+    /* Number of padding bytes includes padding subheaders and trailing padding */
+    guint16  padding_bytes;
+    guint16  raw_length;
+} mac_lte_tap_info;
+
+
+/* Accessor function to check if a frame was considered to be ReTx */
+int is_mac_lte_frame_retx(packet_info *pinfo, guint8 direction);
+
+#endif
+
+/*****************************************************************/
+/* UDP framing format                                            */
+/* -----------------------                                       */
+/* Several people have asked about dissecting MAC by framing     */
+/* PDUs over IP.  A suggested format over UDP has been created   */
+/* and implemented by this dissector, using the definitions      */
+/* below. A link to an example program showing you how to encode */
+/* these headers and send LTE MAC PDUs on a UDP socket is        */
+/* provided at https://wiki.wireshark.org/MAC-LTE                 */
+/*                                                               */
+/* A heuristic dissecter (enabled by a preference) will          */
+/* recognise a signature at the beginning of these frames.       */
+/*****************************************************************/
+
+
+/* Signature.  Rather than try to define a port for this, or make the
+   port number a preference, frames will start with this string (with no
+   terminating NULL */
+#define MAC_LTE_START_STRING "mac-lte"
+
+/* Fixed fields.  This is followed by the following 3 mandatory fields:
+   - radioType (1 byte)
+   - direction (1 byte)
+   - rntiType (1 byte)
+   (where the allowed values are defined above */
+
+/* Optional fields. Attaching this info to frames will allow you
+   to show you display/filter/plot/add-custom-columns on these fields, so should
+   be added if available.
+   The format is to have the tag, followed by the value (there is no length field,
+   it's implicit from the tag) */
+
+#define MAC_LTE_RNTI_TAG            0x02
+/* 2 bytes, network order */
+
+#define MAC_LTE_UEID_TAG            0x03
+/* 2 bytes, network order */
+
+#define MAC_LTE_FRAME_SUBFRAME_TAG  0x04
+/* 2 bytes, network order, SFN is stored in 12 MSB and SF in 4 LSB */
+
+#define MAC_LTE_PREDEFINED_DATA_TAG 0x05
+/* 1 byte */
+
+#define MAC_LTE_RETX_TAG            0x06
+/* 1 byte */
+
+#define MAC_LTE_CRC_STATUS_TAG      0x07
+/* 1 byte */
+
+#define MAC_LTE_EXT_BSR_SIZES_TAG   0x08
+/* 0 byte */
+
+#define MAC_LTE_SEND_PREAMBLE_TAG   0x09
+/* 2 bytes, RAPID value (1 byte) followed by RACH attempt number (1 byte) */
+
+#define MAC_LTE_CARRIER_ID_TAG      0x0A
+/* 1 byte */
+
+#define MAC_LTE_PHY_TAG             0x0B
+/* variable length, length (1 byte) then depending on direction
+   in UL: modulation type (1 byte), TBS index (1 byte), RB length (1 byte),
+          RB start (1 byte), HARQ id (1 byte), NDI (1 byte)
+   in DL: DCI format (1 byte), resource allocation type (1 byte), aggregation level (1 byte),
+          MCS index (1 byte), redundancy version (1 byte), resource block length (1 byte),
+          HARQ id (1 byte), NDI (1 byte), TB (1 byte), DL reTx (1 byte) */
+
+#define MAC_LTE_SIMULT_PUCCH_PUSCH_PCELL  0x0C
+/* 0 byte */
+
+#define MAC_LTE_SIMULT_PUCCH_PUSCH_PSCELL 0x0D
+/* 0 byte */
+
+#define MAC_LTE_CE_MODE             0x0E
+/* 1 byte containing mac_lte_ce_mode enum value */
+
+#define MAC_LTE_NB_MODE             0x0F
+/* 1 byte containing mac_lte_nb_mode enum value */
+
+/* MAC PDU. Following this tag comes the actual MAC PDU (there is no length, the PDU
+   continues until the end of the frame) */
+#define MAC_LTE_PAYLOAD_TAG 0x01
+
+
+#if 0
+
+/* Type to store parameters for configuring LCID->RLC channel settings for DRB */
+/* Some are optional, and may not be seen (e.g. on reestablishment) */
+typedef struct drb_mapping_t
+{
+    guint16    ueid;                /* Mandatory */
+    guint8     drbid;               /* Mandatory */
+    gboolean   lcid_present;
+    guint8     lcid;                /* Part of LogicalChannelConfig - optional */
+    gboolean   rlcMode_present;
+    guint8     rlcMode;             /* Part of RLC config - optional */
+    gboolean   rlc_ul_ext_li_field; /* Part of RLC config - optional */
+    gboolean   rlc_dl_ext_li_field; /* Part of RLC config - optional */
+    gboolean   rlc_ul_ext_am_sn;    /* Part of RLC config - optional */
+    gboolean   rlc_dl_ext_am_sn;    /* Part of RLC config - optional */
+    gboolean   um_sn_length_present;
+    guint8     um_sn_length;        /* Part of RLC config - optional */
+    gboolean   ul_priority_present;
+    guint8     ul_priority;         /* Part of LogicalChannelConfig - optional */
+    gboolean   pdcp_sn_size_present;
+    guint8     pdcp_sn_size;        /* Part of pdcp-Config - optional */
+} drb_mapping_t;
+
+
+/* Set details of an LCID -> drb channel mapping.  To be called from
+   configuration protocol (e.g. RRC) */
+void set_mac_lte_channel_mapping(drb_mapping_t *drb_mapping);
+
+
+/* Dedicated DRX config. Used to verify that a sensible config is given.
+   Also, beginning to configure MAC with this config and (optionally) show
+   DRX config and state (cycles/timers) attached to each UL/DL PDU! */
+typedef struct drx_config_t {
+    gboolean    configured;
+    guint32     frameNum;
+    guint32     previousFrameNum;
+
+    guint32     onDurationTimer;
+    guint32     inactivityTimer;
+    guint32     retransmissionTimer;
+    guint32     longCycle;
+    guint32     cycleOffset;
+    /* Optional Short cycle */
+    gboolean    shortCycleConfigured;
+    guint32     shortCycle;
+    guint32     shortCycleTimer;
+} drx_config_t;
+
+/* Functions to set/release up dedicated DRX config */
+void set_mac_lte_drx_config(guint16 ueid, drx_config_t *drx_config, packet_info *pinfo);
+void set_mac_lte_drx_config_release(guint16 ueid,  packet_info *pinfo);
+
+/* RRC can tell this dissector which RAPIDs are Group A, Group A&B */
+void set_mac_lte_rapid_ranges(guint groupA, guint all_RA);
+
+/* RRC can indicate whether extended BSR sizes are used */
+void set_mac_lte_extended_bsr_sizes(guint16 ueid, gboolean use_ext_bsr_sizes, packet_info *pinfo);
+
+/* RRC can indicate whether simultaneous PUCCH/PUSCH is used */
+typedef enum {
+    SIMULT_PUCCH_PUSCH_PCELL = 0,
+    SIMULT_PUCCH_PUSCH_PSCELL
+} simult_pucch_pusch_cell_type;
+void set_mac_lte_simult_pucch_pusch(guint16 ueid, simult_pucch_pusch_cell_type cell_type, gboolean use_simult_pucch_pusch, packet_info *pinfo);
+
+/* Functions to be called from outside this module (e.g. in a plugin, where mac_lte_info
+   isn't available) to get/set per-packet data */
+WS_DLL_PUBLIC
+mac_lte_info *get_mac_lte_proto_data(packet_info *pinfo);
+WS_DLL_PUBLIC
+void set_mac_lte_proto_data(packet_info *pinfo, mac_lte_info *p_mac_lte_info);
+
+/* Function to attempt to populate p_mac_lte_info using framing definition above */
+gboolean dissect_mac_lte_context_fields(struct mac_lte_info  *p_mac_lte_info, tvbuff_t *tvb,
+                                        gint *p_offset);
+
+#endif
diff --git a/common/utils/T/tracer/plot.c b/common/utils/T/tracer/plot.c
new file mode 100644
index 0000000000000000000000000000000000000000..74473842883c7e968ecf3c84079c4645e18f2467
--- /dev/null
+++ b/common/utils/T/tracer/plot.c
@@ -0,0 +1,291 @@
+#include "defs.h"
+#include <X11/Xlib.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <pthread.h>
+#include <math.h>
+#include <unistd.h>
+#include <sys/select.h>
+#include <stdarg.h>
+
+typedef struct {
+  float *buf;
+  short *iqbuf;
+  int count;
+  int type;
+  volatile int iq_count;  /* for ULSCH IQ data */
+  int iq_insert_pos;
+  GC g;
+} data;
+
+typedef struct {
+  Display *d;
+  Window w;
+  Pixmap px;
+  GC bg;
+  int width;
+  int height;
+  pthread_mutex_t lock;
+  float zoom;
+  int timer_pipe[2];
+  data *p;             /* list of plots */
+  int nplots;
+} plot;
+
+static void *timer_thread(void *_p)
+{
+  plot *p = _p;
+  char c;
+
+  while (1) {
+    /* more or less 10Hz */
+    usleep(100*1000);
+    c = 1;
+    if (write(p->timer_pipe[1], &c, 1) != 1) abort();
+  }
+
+  return NULL;
+}
+
+static void *plot_thread(void *_p)
+{
+  float v;
+  float *s;
+  int i, j;
+  plot *p = _p;
+  int redraw = 0;
+  int replot = 0;
+  fd_set rset;
+  int xfd = ConnectionNumber(p->d);
+  int maxfd = xfd > p->timer_pipe[0] ? xfd : p->timer_pipe[0];
+  int pp;
+
+  while (1) {
+    while (XPending(p->d)) {
+      XEvent e;
+      XNextEvent(p->d, &e);
+      switch (e.type) {
+      case ButtonPress:
+        /* button 4: zoom out */
+        if (e.xbutton.button == 4) { p->zoom = p->zoom * 1.25; replot = 1; }
+        /* button 5: zoom in */
+        if (e.xbutton.button == 5) { p->zoom = p->zoom * 0.8; replot = 1; }
+        printf("zoom: %f\n", p->zoom);
+        break;
+      case Expose: redraw = 1; break;
+      }
+    }
+
+    if (replot == 1) {
+      replot = 0;
+      redraw = 1;
+
+      if (pthread_mutex_lock(&p->lock)) abort();
+
+      XFillRectangle(p->d, p->px, p->bg, 0, 0, p->width, p->height);
+
+      for (pp = 0; pp < p->nplots; pp++) {
+        if (p->p[pp].type == PLOT_MINMAX) {
+          s = p->p[pp].buf;
+          for (i = 0; i < 512; i++) {
+            int min = *s;
+            int max = *s;
+            for (j = 0; j < p->p[pp].count/512; j++, s++) {
+              if (*s < min) min = *s;
+              if (*s > max) max = *s;
+            }
+            XDrawLine(p->d, p->px, p->p[pp].g, i, 100-min, i, 100-max);
+          }
+        } else if (p->p[pp].type == PLOT_VS_TIME) {
+          for (i = 0; i < p->p[pp].count; i++)
+            p->p[pp].buf[i] =
+                10*log10(1.0+(float)(p->p[pp].iqbuf[2*i]*p->p[pp].iqbuf[2*i]+
+                p->p[pp].iqbuf[2*i+1]*p->p[pp].iqbuf[2*i+1]));
+          s = p->p[pp].buf;
+          for (i = 0; i < 512; i++) {
+            v = 0;
+            for (j = 0; j < p->p[pp].count/512; j++, s++) v += *s;
+            v /= p->p[pp].count/512;
+            XDrawLine(p->d, p->px, p->p[pp].g, i, 100, i, 100-v);
+          }
+        } else if (p->p[pp].type == PLOT_IQ_POINTS) {
+          XPoint pts[p->p[pp].iq_count];
+          int count = p->p[pp].iq_count;
+          for (i = 0; i < count; i++) {
+            pts[i].x = p->p[pp].iqbuf[2*i]*p->zoom/20+50;
+            pts[i].y = -p->p[pp].iqbuf[2*i+1]*p->zoom/20+50;
+          }
+          XDrawPoints(p->d, p->px, p->p[pp].g, pts, count, CoordModeOrigin);
+        }
+      }
+
+      if (pthread_mutex_unlock(&p->lock)) abort();
+    }
+
+    if (redraw) {
+      redraw = 0;
+      XCopyArea(p->d, p->px, p->w, DefaultGC(p->d, DefaultScreen(p->d)),
+                0, 0, p->width, p->height, 0, 0);
+    }
+
+    XFlush(p->d);
+
+    FD_ZERO(&rset);
+    FD_SET(p->timer_pipe[0], &rset);
+    FD_SET(xfd, &rset);
+    if (select(maxfd+1, &rset, NULL, NULL, NULL) == -1) abort();
+    if (FD_ISSET(p->timer_pipe[0], &rset)) {
+      char b[512];
+      if (read(p->timer_pipe[0], b, 512) <= 0) abort();
+      replot = 1;
+    }
+  }
+
+  return NULL;
+}
+
+void *make_plot(int width, int height, char *title, int nplots, ...)
+{
+  plot *p;
+  Display *d;
+  Window w;
+  Pixmap pm;
+  int i;
+  va_list ap;
+  XGCValues gcv;
+
+  p = malloc(sizeof(*p)); if (p == NULL) abort();
+
+  d = XOpenDisplay(0); if (d == NULL) abort();
+  w = XCreateSimpleWindow(d, DefaultRootWindow(d), 0, 0, width, height,
+        0, WhitePixel(d, DefaultScreen(d)), WhitePixel(d, DefaultScreen(d)));
+  XSelectInput(d, w, ExposureMask | ButtonPressMask);
+  XMapWindow(d, w);
+
+  {
+    XSetWindowAttributes att;
+    att.backing_store = Always;
+    XChangeWindowAttributes(d, w, CWBackingStore, &att);
+  }
+
+  XStoreName(d, w, title);
+
+  p->bg = XCreateGC(d, w, 0, NULL);
+  XCopyGC(d, DefaultGC(d, DefaultScreen(d)), -1L, p->bg);
+  gcv.foreground = WhitePixel(d, DefaultScreen(d));
+  XChangeGC(d, p->bg, GCForeground, &gcv);
+
+  pm = XCreatePixmap(d, w, width, height, DefaultDepth(d, DefaultScreen(d)));
+
+  p->width = width;
+  p->height = height;
+  p->p = malloc(nplots * sizeof(data)); if (p->p == NULL) abort();
+
+  va_start(ap, nplots);
+  for (i = 0; i < nplots; i++) {
+    int count;
+    int type;
+    char *color;
+    XColor rcol, scol;
+
+    count = va_arg(ap, int);
+    type = va_arg(ap, int);
+    color = va_arg(ap, char *);
+
+    p->p[i].g = XCreateGC(d, w, 0, NULL);
+    XCopyGC(d, DefaultGC(d, DefaultScreen(d)), -1L, p->p[i].g);
+    if (XAllocNamedColor(d, DefaultColormap(d, DefaultScreen(d)),
+                         color, &scol, &rcol)) {
+      gcv.foreground = scol.pixel;
+      XChangeGC(d, p->p[i].g, GCForeground, &gcv);
+    } else {
+      printf("could not allocate color '%s'\n", color);
+      abort();
+    }
+
+    if (type == PLOT_VS_TIME) {
+      p->p[i].buf = malloc(sizeof(float) * count);
+      if (p->p[i].buf == NULL) abort();
+      p->p[i].iqbuf = malloc(sizeof(short) * count * 2);
+      if(p->p[i].iqbuf==NULL)abort();
+    } else if (type == PLOT_MINMAX) {
+      p->p[i].buf = malloc(sizeof(float) * count);
+      if (p->p[i].buf == NULL) abort();
+      p->p[i].iqbuf = NULL;
+    } else {
+      p->p[i].buf = NULL;
+      p->p[i].iqbuf = malloc(sizeof(short) * count * 2);
+      if(p->p[i].iqbuf==NULL)abort();
+    }
+    p->p[i].count = count;
+    p->p[i].type = type;
+    p->p[i].iq_count = 0;
+    p->p[i].iq_insert_pos = 0;
+  }
+  va_end(ap);
+
+  p->d = d;
+  p->w = w;
+  p->px = pm;
+
+  p->zoom = 1;
+  p->nplots = nplots;
+
+  pthread_mutex_init(&p->lock, NULL);
+
+  if (pipe(p->timer_pipe)) abort();
+
+  new_thread(plot_thread, p);
+  new_thread(timer_thread, p);
+
+  return p;
+}
+
+void plot_set(void *_plot, float *data, int len, int pos, int pp)
+{
+  plot *p = _plot;
+  if (pthread_mutex_lock(&p->lock)) abort();
+  memcpy(p->p[pp].buf + pos, data, len * sizeof(float));
+  if (pthread_mutex_unlock(&p->lock)) abort();
+}
+
+void iq_plot_set(void *_plot, short *data, int count, int pos, int pp)
+{
+  plot *p = _plot;
+  if (pthread_mutex_lock(&p->lock)) abort();
+  memcpy(p->p[pp].iqbuf + pos * 2, data, count * 2 * sizeof(short));
+  if (pthread_mutex_unlock(&p->lock)) abort();
+}
+
+void iq_plot_set_sized(void *_plot, short *data, int count, int pp)
+{
+  plot *p = _plot;
+  if (pthread_mutex_lock(&p->lock)) abort();
+  memcpy(p->p[pp].iqbuf, data, count * 2 * sizeof(short));
+  p->p[pp].iq_count = count;
+  if (pthread_mutex_unlock(&p->lock)) abort();
+}
+
+void iq_plot_add_iq_point_loop(void *_plot, short i, short q, int pp)
+{
+  plot *p = _plot;
+  if (pthread_mutex_lock(&p->lock)) abort();
+  p->p[pp].iqbuf[p->p[pp].iq_insert_pos*2] = i;
+  p->p[pp].iqbuf[p->p[pp].iq_insert_pos*2+1] = q;
+  if (p->p[pp].iq_count != p->p[pp].count) p->p[pp].iq_count++;
+  p->p[pp].iq_insert_pos++;
+  if (p->p[pp].iq_insert_pos == p->p[pp].count) p->p[pp].iq_insert_pos = 0;
+  if (pthread_mutex_unlock(&p->lock)) abort();
+}
+
+void iq_plot_add_energy_point_loop(void *_plot, int e, int pp)
+{
+  plot *p = _plot;
+  if (pthread_mutex_lock(&p->lock)) abort();
+  p->p[pp].buf[p->p[pp].iq_insert_pos] = e;
+  if (p->p[pp].iq_count != p->p[pp].count) p->p[pp].iq_count++;
+  p->p[pp].iq_insert_pos++;
+  if (p->p[pp].iq_insert_pos == p->p[pp].count) p->p[pp].iq_insert_pos = 0;
+  if (pthread_mutex_unlock(&p->lock)) abort();
+}
diff --git a/common/utils/T/tracer/record.c b/common/utils/T/tracer/record.c
new file mode 100644
index 0000000000000000000000000000000000000000..b1a1bc60de8cb8bdd0b69604f414f7d5aa7b0802
--- /dev/null
+++ b/common/utils/T/tracer/record.c
@@ -0,0 +1,162 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <string.h>
+#include <unistd.h>
+#include "database.h"
+#include "utils.h"
+#include "../T_defs.h"
+#include "config.h"
+
+void usage(void)
+{
+  printf(
+"options:\n"
+"    -d <database file>        this option is mandatory\n"
+"    -o <output file>          this option is mandatory\n"
+"    -on <GROUP or ID>         turn log ON for given GROUP or ID\n"
+"    -off <GROUP or ID>        turn log OFF for given GROUP or ID\n"
+"    -ON                       turn all logs ON\n"
+"    -OFF                      turn all logs OFF\n"
+"                              note: you may pass several -on/-off/-ON/-OFF,\n"
+"                                    they will be processed in order\n"
+"                                    by default, all is off\n"
+"    -ip <host>                connect to given IP address (default %s)\n"
+"    -p <port>                 connect to given port (default %d)\n",
+  DEFAULT_REMOTE_IP,
+  DEFAULT_REMOTE_PORT
+  );
+  exit(1);
+}
+
+volatile int run = 1;
+
+static int socket = -1;
+
+void force_stop(int x)
+{
+  printf("\ngently quit...\n");
+  close(socket);
+  socket = -1;
+  run = 0;
+}
+
+int main(int n, char **v)
+{
+  char *database_filename = NULL;
+  char *output_filename = NULL;
+  FILE *out;
+  void *database;
+  char *ip = DEFAULT_REMOTE_IP;
+  int port = DEFAULT_REMOTE_PORT;
+  char **on_off_name;
+  int *on_off_action;
+  int on_off_n = 0;
+  int *is_on;
+  int number_of_events;
+  int i;
+  char mt;
+
+  /* write on a socket fails if the other end is closed and we get SIGPIPE */
+  if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) abort();
+
+  on_off_name = malloc(n * sizeof(char *)); if (on_off_name == NULL) abort();
+  on_off_action = malloc(n * sizeof(int)); if (on_off_action == NULL) abort();
+
+  for (i = 1; i < n; i++) {
+    if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage();
+    if (!strcmp(v[i], "-d"))
+      { if (i > n-2) usage(); database_filename = v[++i]; continue; }
+    if (!strcmp(v[i], "-o"))
+      { if (i > n-2) usage(); output_filename = v[++i]; continue; }
+    if (!strcmp(v[i], "-ip")) { if (i > n-2) usage(); ip = v[++i]; continue; }
+    if (!strcmp(v[i], "-p"))
+      { if (i > n-2) usage(); port = atoi(v[++i]); continue; }
+    if (!strcmp(v[i], "-on")) { if (i > n-2) usage();
+      on_off_name[on_off_n]=v[++i]; on_off_action[on_off_n++]=1; continue; }
+    if (!strcmp(v[i], "-off")) { if (i > n-2) usage();
+      on_off_name[on_off_n]=v[++i]; on_off_action[on_off_n++]=0; continue; }
+    if (!strcmp(v[i], "-ON"))
+      { on_off_name[on_off_n]=NULL; on_off_action[on_off_n++]=1; continue; }
+    if (!strcmp(v[i], "-OFF"))
+      { on_off_name[on_off_n]=NULL; on_off_action[on_off_n++]=0; continue; }
+    usage();
+  }
+
+  if (database_filename == NULL) {
+    printf("ERROR: provide a database file (-d)\n");
+    exit(1);
+  }
+  if (output_filename == NULL) {
+    printf("ERROR: provide an output file (-o)\n");
+    exit(1);
+  }
+
+  database = parse_database(database_filename);
+
+  load_config_file(database_filename);
+
+  number_of_events = number_of_ids(database);
+  is_on = calloc(number_of_events, sizeof(int));
+  if (is_on == NULL) abort();
+
+  for (i = 0; i < on_off_n; i++)
+    on_off(database, on_off_name[i], is_on, on_off_action[i]);
+
+  socket = connect_to(ip, port);
+
+  /* activate selected traces */
+  mt = 1;
+  if (socket_send(socket, &mt, 1) == -1 ||
+      socket_send(socket, &number_of_events, sizeof(int)) == -1 ||
+      socket_send(socket, is_on, number_of_events * sizeof(int)) == -1)
+    abort();
+
+  out = fopen(output_filename, "w");
+  if (out == NULL) {
+    perror(output_filename);
+    exit(1);
+  }
+
+  /* exit on ctrl+c and ctrl+z */
+  if (signal(SIGQUIT, force_stop) == SIG_ERR) abort();
+  if (signal(SIGINT, force_stop) == SIG_ERR) abort();
+  if (signal(SIGTSTP, force_stop) == SIG_ERR) abort();
+
+  /* read messages */
+  while (run) {
+    int type;
+    int32_t length;
+    char v[T_BUFFER_MAX];
+    int vpos = 0;
+
+    if (fullread(socket, &length, 4) == -1) goto read_error;
+    memcpy(v+vpos, &length, 4);
+    vpos += 4;
+#ifdef T_SEND_TIME
+    if (fullread(socket,v+vpos,sizeof(struct timespec))==-1) goto read_error;
+    vpos += sizeof(struct timespec);
+    length -= sizeof(struct timespec);
+#endif
+    if (fullread(socket, &type, sizeof(int)) == -1) goto read_error;
+    memcpy(v+vpos, &type, sizeof(int));
+    vpos += sizeof(int);
+    length -= sizeof(int);
+    if (fullread(socket, v+vpos, length) == -1) goto read_error;
+    vpos += length;
+
+    if (type == -1) append_received_config_chunk(v+vpos-length, length);
+    if (type == -2) verify_config();
+
+    if (fwrite(v, vpos, 1, out) != 1) {
+      printf("error saving data to file %s\n", output_filename);
+      fclose(out);
+      exit(1);
+    }
+  }
+
+read_error:
+  fclose(out);
+
+  return 0;
+}
diff --git a/common/utils/T/tracer/replay.c b/common/utils/T/tracer/replay.c
new file mode 100644
index 0000000000000000000000000000000000000000..be7e8d60c69fefcdd562ec79c5dea01c384b92c0
--- /dev/null
+++ b/common/utils/T/tracer/replay.c
@@ -0,0 +1,183 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <pthread.h>
+#include "utils.h"
+#include "../T_defs.h"
+
+#define DEFAULT_REMOTE_PORT 2021
+
+/* replay.c does not know anything about events - it just has the array
+ * is_on that grows each time replay.c sees a type that does not fit in
+ * there (the idea is to isolate replay.c as maximum by not using unneeded
+ * information)
+ */
+int *is_on;
+int is_on_size;
+
+/* this lock is used to protect access to is_on/is_on_size */
+pthread_mutex_t biglock = PTHREAD_MUTEX_INITIALIZER;
+
+void set_is_on_size(int size)
+{
+  is_on = realloc(is_on, size * sizeof(int)); if (is_on == NULL) abort();
+  memset(is_on + is_on_size, 0, (size - is_on_size) * sizeof(int));
+  is_on_size = size;
+}
+
+void lock(void)
+{
+  if (pthread_mutex_lock(&biglock)) abort();
+}
+
+void unlock(void)
+{
+  if (pthread_mutex_unlock(&biglock)) abort();
+}
+
+#define QUIT(x) do { printf("%s\n", x); exit(1); } while(0)
+
+void get_message(int s)
+{
+  char t;
+  int l;
+  int id;
+  int on;
+
+  if (read(s, &t, 1) != 1) QUIT("get_message fails");
+  lock();
+  switch (t) {
+  case 0:
+    /* toggle all those IDs */
+    if (read(s, &l, sizeof(int)) != sizeof(int)) QUIT("get_message fails");
+    while (l) {
+      if (read(s, &id, sizeof(int)) != sizeof(int)) QUIT("get_message fails");
+      if (id > is_on_size - 1) set_is_on_size(id + 1);
+      is_on[id] = 1 - is_on[id];
+      l--;
+    }
+    break;
+  case 1:
+    /* set IDs as given */
+    /* optimize? */
+    if (read(s, &l, sizeof(int)) != sizeof(int)) QUIT("get_message fails");
+    if (l > is_on_size) set_is_on_size(l);
+    id = 0;
+    while (l) {
+      if (read(s, &on, sizeof(int)) != sizeof(int))
+        QUIT("get_message fails");
+      is_on[id] = on;
+      id++;
+      l--;
+    }
+    break;
+  case 2: break; /* do nothing, this message is to wait for local tracer */
+  default: abort();
+  }
+  unlock();
+}
+
+void *get_message_thread(void *_socket)
+{
+  int socket = *(int *)_socket;
+
+  while (1) get_message(socket);
+
+  return NULL;
+}
+
+void usage(void)
+{
+  printf(
+"options:\n"
+"    -i <input file>           this option is mandatory\n"
+"    -p <port>                 wait connection on given port (default %d)\n"
+"    -w                        user must press a key after each sent event\n",
+  DEFAULT_REMOTE_PORT
+  );
+  exit(1);
+}
+
+#define ERR printf("ERROR: read file %s failed\n", input_filename)
+
+int main(int n, char **v)
+{
+  int port = DEFAULT_REMOTE_PORT;
+  char *input_filename = NULL;
+  int i;
+  int socket;
+  FILE *in;
+  int do_send;
+  int do_wait = 0;
+
+  for (i = 1; i < n; i++) {
+    if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage();
+    if (!strcmp(v[i], "-i"))
+      { if (i > n-2) usage(); input_filename = v[++i]; continue; }
+    if (!strcmp(v[i], "-p"))
+      { if (i > n-2) usage(); port = atoi(v[++i]); continue; }
+    if (!strcmp(v[i], "-w")) { do_wait = 1; continue; }
+    usage();
+  }
+
+  if (input_filename == NULL) {
+    printf("ERROR: provide an input file (-i)\n");
+    exit(1);
+  }
+
+  in = fopen(input_filename, "r");
+  if (in == NULL) { perror(input_filename); abort(); }
+
+  socket = get_connection("0.0.0.0", port);
+
+  /* get first message to activate selected traces */
+  get_message(socket);
+
+  new_thread(get_message_thread, &socket);
+
+  while (1) {
+    int type;
+    int32_t length;
+    char v[T_BUFFER_MAX];
+    int vpos = 0;
+
+    /* read event from file */
+    if (fread(&length, 4, 1, in) != 1) break;
+    memcpy(v+vpos, &length, 4);
+    vpos += 4;
+#ifdef T_SEND_TIME
+    if (length < sizeof(struct timespec)) { ERR; break; }
+    if (fread(v+vpos, sizeof(struct timespec), 1, in) != 1) { ERR; break; }
+    vpos += sizeof(struct timespec);
+    length -= sizeof(struct timespec);
+#endif
+    if (length < sizeof(int)) { ERR; break; }
+    if (fread(&type, sizeof(int), 1, in) != 1) { ERR; break; }
+    memcpy(v+vpos, &type, sizeof(int));
+    vpos += sizeof(int);
+    length -= sizeof(int);
+    if (length) if (fread(v+vpos, length, 1, in) != 1) { ERR; break; }
+    vpos += length;
+
+    /* only send if configured to do so */
+    lock();
+    if (type < 0) do_send = 1;
+    else {
+      if (type > is_on_size - 1) set_is_on_size(type+1);
+      do_send = is_on[type];
+    }
+    unlock();
+
+    if (do_send)
+      if (socket_send(socket, v, vpos) != 0)
+        { printf("ERROR: socket writing failed\n"); abort(); }
+
+    if (do_send && do_wait) getchar();
+  }
+
+  fclose(in);
+  close(socket);
+
+  return 0;
+}
diff --git a/common/utils/T/tracer/textlog.c b/common/utils/T/tracer/textlog.c
new file mode 100644
index 0000000000000000000000000000000000000000..32bf1ed791ce10060fb48b62d7f4b69c94b23ba9
--- /dev/null
+++ b/common/utils/T/tracer/textlog.c
@@ -0,0 +1,195 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <pthread.h>
+#include <signal.h>
+#include "database.h"
+#include "event.h"
+#include "handler.h"
+#include "logger/logger.h"
+#include "view/view.h"
+#include "gui/gui.h"
+#include "utils.h"
+#include "../T_defs.h"
+#include "event_selector.h"
+#include "config.h"
+
+typedef struct {
+  int socket;
+  int *is_on;
+  int nevents;
+  pthread_mutex_t lock;
+} textlog_data;
+
+void is_on_changed(void *_d)
+{
+  textlog_data *d = _d;
+  char t;
+
+  if (pthread_mutex_lock(&d->lock)) abort();
+
+  if (d->socket == -1) goto no_connection;
+
+  t = 1;
+  if (socket_send(d->socket, &t, 1) == -1 ||
+      socket_send(d->socket, &d->nevents, sizeof(int)) == -1 ||
+      socket_send(d->socket, d->is_on, d->nevents * sizeof(int)) == -1)
+    abort();
+
+no_connection:
+  if (pthread_mutex_unlock(&d->lock)) abort();
+}
+
+void usage(void)
+{
+  printf(
+"options:\n"
+"    -d <database file>        this option is mandatory\n"
+"    -on <GROUP or ID>         turn log ON for given GROUP or ID\n"
+"    -off <GROUP or ID>        turn log OFF for given GROUP or ID\n"
+"    -ON                       turn all logs ON\n"
+"    -OFF                      turn all logs OFF\n"
+"                              note: you may pass several -on/-off/-ON/-OFF,\n"
+"                                    they will be processed in order\n"
+"                                    by default, all is off\n"
+"    -full                     also dump buffers' content\n"
+"    -ip <host>                connect to given IP address (default %s)\n"
+"    -p <port>                 connect to given port (default %d)\n"
+"    -x                        GUI output\n"
+"    -debug-gui                activate GUI debug logs\n"
+"    -no-gui                   disable GUI entirely\n",
+  DEFAULT_REMOTE_IP,
+  DEFAULT_REMOTE_PORT
+  );
+  exit(1);
+}
+
+static void *gui_thread(void *_g)
+{
+  gui *g = _g;
+  gui_loop(g);
+  return NULL;
+}
+
+int main(int n, char **v)
+{
+  extern int volatile gui_logd;
+  char *database_filename = NULL;
+  void *database;
+  char *ip = DEFAULT_REMOTE_IP;
+  int port = DEFAULT_REMOTE_PORT;
+  char **on_off_name;
+  int *on_off_action;
+  int on_off_n = 0;
+  int *is_on;
+  int number_of_events;
+  int i;
+  event_handler *h;
+  logger *textlog;
+  gui *g;
+  int gui_mode = 0;
+  view *out;
+  int gui_active = 1;
+  textlog_data textlog_data;
+  int full = 0;
+
+  /* write on a socket fails if the other end is closed and we get SIGPIPE */
+  if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) abort();
+
+  on_off_name = malloc(n * sizeof(char *)); if (on_off_name == NULL) abort();
+  on_off_action = malloc(n * sizeof(int)); if (on_off_action == NULL) abort();
+
+  for (i = 1; i < n; i++) {
+    if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage();
+    if (!strcmp(v[i], "-d"))
+      { if (i > n-2) usage(); database_filename = v[++i]; continue; }
+    if (!strcmp(v[i], "-ip")) { if (i > n-2) usage(); ip = v[++i]; continue; }
+    if (!strcmp(v[i], "-p"))
+      { if (i > n-2) usage(); port = atoi(v[++i]); continue; }
+    if (!strcmp(v[i], "-on")) { if (i > n-2) usage();
+      on_off_name[on_off_n]=v[++i]; on_off_action[on_off_n++]=1; continue; }
+    if (!strcmp(v[i], "-off")) { if (i > n-2) usage();
+      on_off_name[on_off_n]=v[++i]; on_off_action[on_off_n++]=0; continue; }
+    if (!strcmp(v[i], "-ON"))
+      { on_off_name[on_off_n]=NULL; on_off_action[on_off_n++]=1; continue; }
+    if (!strcmp(v[i], "-OFF"))
+      { on_off_name[on_off_n]=NULL; on_off_action[on_off_n++]=0; continue; }
+    if (!strcmp(v[i], "-x")) { gui_mode = 1; continue; }
+    if (!strcmp(v[i], "-debug-gui")) { gui_logd = 1; continue; }
+    if (!strcmp(v[i], "-no-gui")) { gui_active = 0; continue; }
+    if (!strcmp(v[i], "-full")) { full = 1; continue; }
+    usage();
+  }
+
+  if (gui_active == 0) gui_mode = 0;
+
+  if (database_filename == NULL) {
+    printf("ERROR: provide a database file (-d)\n");
+    exit(1);
+  }
+
+  database = parse_database(database_filename);
+
+  load_config_file(database_filename);
+
+  number_of_events = number_of_ids(database);
+  is_on = calloc(number_of_events, sizeof(int));
+  if (is_on == NULL) abort();
+
+  h = new_handler(database);
+
+  if (gui_active) {
+    g = gui_init();
+    new_thread(gui_thread, g);
+  }
+
+  if (gui_mode) {
+    widget *w, *win;
+//    w = new_textlist(g, 600, 20, 0);
+    w = new_textlist(g, 800, 50, BACKGROUND_COLOR);
+    win = new_toplevel_window(g, 800, 50*12, "textlog");
+    widget_add_child(g, win, w, -1);
+    out = new_view_textlist(1000, 10, g, w);
+    //tout = new_view_textlist(7, 4, g, w);
+  } else {
+    out = new_view_stdout();
+  }
+
+  for (i = 0; i < number_of_events; i++) {
+    char *name, *desc;
+    database_get_generic_description(database, i, &name, &desc);
+    textlog = new_textlog(h, database, name, desc);
+//        "ENB_PHY_UL_CHANNEL_ESTIMATE",
+//        "ev: {} eNB_id [eNB_ID] frame [frame] subframe [subframe]");
+    logger_add_view(textlog, out);
+    if (full) textlog_dump_buffer(textlog, 1);
+    free(name);
+    free(desc);
+  }
+
+  for (i = 0; i < on_off_n; i++)
+    on_off(database, on_off_name[i], is_on, on_off_action[i]);
+
+  textlog_data.socket = -1;
+  textlog_data.is_on = is_on;
+  textlog_data.nevents = number_of_events;
+  if (pthread_mutex_init(&textlog_data.lock, NULL)) abort();
+  if (gui_active)
+    setup_event_selector(g, database, is_on, is_on_changed, &textlog_data);
+
+  textlog_data.socket = connect_to(ip, port);
+
+  /* send the first message - activate selected traces */
+  is_on_changed(&textlog_data);
+
+  /* read messages */
+  while (1) {
+    char v[T_BUFFER_MAX];
+    event e;
+    e = get_event(textlog_data.socket, v, database);
+    if (e.type == -1) abort();
+    handle_event(h, e);
+  }
+
+  return 0;
+}
diff --git a/common/utils/T/tracer/utils.c b/common/utils/T/tracer/utils.c
new file mode 100644
index 0000000000000000000000000000000000000000..a22e0a0565dabecfa928d2bd6d4c7c5df6c72553
--- /dev/null
+++ b/common/utils/T/tracer/utils.c
@@ -0,0 +1,205 @@
+#include "utils.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <pthread.h>
+#include <time.h>
+#include <unistd.h>
+#include <ctype.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+void new_thread(void *(*f)(void *), void *data)
+{
+  pthread_t t;
+  pthread_attr_t att;
+
+  if (pthread_attr_init(&att))
+    { fprintf(stderr, "pthread_attr_init err\n"); exit(1); }
+  if (pthread_attr_setdetachstate(&att, PTHREAD_CREATE_DETACHED))
+    { fprintf(stderr, "pthread_attr_setdetachstate err\n"); exit(1); }
+  if (pthread_attr_setstacksize(&att, 10000000))
+    { fprintf(stderr, "pthread_attr_setstacksize err\n"); exit(1); }
+  if (pthread_create(&t, &att, f, data))
+    { fprintf(stderr, "pthread_create err\n"); exit(1); }
+  if (pthread_attr_destroy(&att))
+    { fprintf(stderr, "pthread_attr_destroy err\n"); exit(1); }
+}
+
+void sleepms(int ms)
+{
+  struct timespec t;
+
+  t.tv_sec = ms / 1000;
+  t.tv_nsec = (ms % 1000) * 1000000L;
+
+  /* TODO: deal with EINTR */
+  if (nanosleep(&t, NULL)) abort();
+}
+
+/****************************************************************************/
+/* list                                                                     */
+/****************************************************************************/
+
+list *list_remove_head(list *l)
+{
+  list *ret;
+  if (l == NULL) return NULL;
+  ret = l->next;
+  if (ret != NULL) ret->last = l->last;
+  free(l);
+  return ret;
+}
+
+list *list_append(list *l, void *data)
+{
+  list *new = calloc(1, sizeof(list));
+  if (new == NULL) abort();
+  new->data = data;
+  if (l == NULL) {
+    new->last = new;
+    return new;
+  }
+  l->last->next = new;
+  l->last = new;
+  return l;
+}
+
+/****************************************************************************/
+/* socket                                                                   */
+/****************************************************************************/
+
+int socket_send(int socket, void *buffer, int size)
+{
+  char *x = buffer;
+  int ret;
+  while (size) {
+    ret = write(socket, x, size);
+    if (ret <= 0) return -1;
+    size -= ret;
+    x += ret;
+  }
+  return 0;
+}
+
+int get_connection(char *addr, int port)
+{
+  struct sockaddr_in a;
+  socklen_t alen;
+  int s, t;
+
+  printf("waiting for connection on %s:%d\n", addr, port);
+
+  s = socket(AF_INET, SOCK_STREAM, 0);
+  if (s == -1) { perror("socket"); exit(1); }
+  t = 1;
+  if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &t, sizeof(int)))
+    { perror("setsockopt"); exit(1); }
+
+  a.sin_family = AF_INET;
+  a.sin_port = htons(port);
+  a.sin_addr.s_addr = inet_addr(addr);
+
+  if (bind(s, (struct sockaddr *)&a, sizeof(a))) { perror("bind"); exit(1); }
+  if (listen(s, 5)) { perror("bind"); exit(1); }
+  alen = sizeof(a);
+  t = accept(s, (struct sockaddr *)&a, &alen);
+  if (t == -1) { perror("accept"); exit(1); }
+  close(s);
+
+  printf("connected\n");
+
+  return t;
+}
+
+int fullread(int fd, void *_buf, int count)
+{
+  char *buf = _buf;
+  int ret = 0;
+  int l;
+  while (count) {
+    l = read(fd, buf, count);
+    if (l <= 0) return -1;
+    count -= l;
+    buf += l;
+    ret += l;
+  }
+  return ret;
+}
+
+int connect_to(char *addr, int port)
+{
+  int s;
+  struct sockaddr_in a;
+
+  printf("connecting to %s:%d\n", addr, port);
+
+again:
+  s = socket(AF_INET, SOCK_STREAM, 0);
+  if (s == -1) { perror("socket"); exit(1); }
+
+  a.sin_family = AF_INET;
+  a.sin_port = htons(port);
+  a.sin_addr.s_addr = inet_addr(addr);
+
+  if (connect(s, (struct sockaddr *)&a, sizeof(a)) == -1) {
+    perror("connect");
+    close(s);
+    printf("trying again in 1s\n");
+    sleep(1);
+    goto again;
+  }
+
+  return s;
+}
+
+/****************************************************************************/
+/* buffer                                                                   */
+/****************************************************************************/
+
+void PUTC(OBUF *o, char c)
+{
+  if (o->osize == o->omaxsize) {
+    o->omaxsize += 512;
+    o->obuf = realloc(o->obuf, o->omaxsize);
+    if (o->obuf == NULL) abort();
+  }
+  o->obuf[o->osize] = c;
+  o->osize++;
+}
+
+void PUTS(OBUF *o, char *s)
+{
+  while (*s) PUTC(o, *s++);
+}
+
+static int clean(char c)
+{
+  if (!isprint(c)) c = ' ';
+  return c;
+}
+
+void PUTS_CLEAN(OBUF *o, char *s)
+{
+  while (*s) PUTC(o, clean(*s++));
+}
+
+void PUTI(OBUF *o, int i)
+{
+  char s[64];
+  sprintf(s, "%d", i);
+  PUTS(o, s);
+}
+
+void PUTX2(OBUF *o, int i)
+{
+  char s[64];
+  sprintf(s, "%2.2x", i);
+  PUTS(o, s);
+}
+
+void PUTUL(OBUF *o, unsigned long l)
+{
+  char s[128];
+  sprintf(s, "%ld", l);
+  PUTS(o, s);
+}
diff --git a/common/utils/T/tracer/utils.h b/common/utils/T/tracer/utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..086e92b5dcb4cb0e2fd6476132a815b3b018ba6a
--- /dev/null
+++ b/common/utils/T/tracer/utils.h
@@ -0,0 +1,50 @@
+#ifndef _UTILS_H_
+#define _UTILS_H_
+
+void new_thread(void *(*f)(void *), void *data);
+void sleepms(int ms);
+
+/****************************************************************************/
+/* list                                                                     */
+/****************************************************************************/
+
+typedef struct list {
+  struct list *last, *next;
+  void *data;
+} list;
+
+list *list_remove_head(list *l);
+list *list_append(list *l, void *data);
+
+/****************************************************************************/
+/* socket                                                                   */
+/****************************************************************************/
+
+#define DEFAULT_REMOTE_IP "127.0.0.1"
+#define DEFAULT_REMOTE_PORT 2021
+
+/* socket_send: return 0 if okay, -1 on error */
+int socket_send(int socket, void *buffer, int size);
+int get_connection(char *addr, int port);
+/* fullread: return length read if okay (that is: 'count'), -1 on error */
+int fullread(int fd, void *_buf, int count);
+int connect_to(char *addr, int port);
+
+/****************************************************************************/
+/* buffer                                                                   */
+/****************************************************************************/
+
+typedef struct {
+  int osize;
+  int omaxsize;
+  char *obuf;
+} OBUF;
+
+void PUTC(OBUF *o, char c);
+void PUTS(OBUF *o, char *s);
+void PUTS_CLEAN(OBUF *o, char *s);
+void PUTI(OBUF *o, int i);
+void PUTX2(OBUF *o, int i);
+void PUTUL(OBUF *o, unsigned long i);
+
+#endif /* _UTILS_H_ */
diff --git a/common/utils/T/tracer/vcd.c b/common/utils/T/tracer/vcd.c
new file mode 100644
index 0000000000000000000000000000000000000000..0ad2756c2a49d218314aa4b586ba6a7bac0765ab
--- /dev/null
+++ b/common/utils/T/tracer/vcd.c
@@ -0,0 +1,201 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <pthread.h>
+#include <signal.h>
+#include "database.h"
+#include "event.h"
+#include "handler.h"
+#include "logger/logger.h"
+#include "view/view.h"
+#include "gui/gui.h"
+#include "utils.h"
+#include "../T_defs.h"
+#include "event_selector.h"
+#include "config.h"
+
+typedef struct {
+  int socket;
+  int *is_on;
+  int nevents;
+  pthread_mutex_t lock;
+} vcd_data;
+
+void is_on_changed(void *_d)
+{
+  vcd_data *d = _d;
+  char t;
+
+  if (pthread_mutex_lock(&d->lock)) abort();
+
+  if (d->socket == -1) goto no_connection;
+
+  t = 1;
+  if (socket_send(d->socket, &t, 1) == -1 ||
+      socket_send(d->socket, &d->nevents, sizeof(int)) == -1 ||
+      socket_send(d->socket, d->is_on, d->nevents * sizeof(int)) == -1)
+    abort();
+
+no_connection:
+  if (pthread_mutex_unlock(&d->lock)) abort();
+}
+
+void usage(void)
+{
+  printf(
+"options:\n"
+"    -d <database file>        this option is mandatory\n"
+"    -on <GROUP or ID>         turn log ON for given GROUP or ID\n"
+"    -off <GROUP or ID>        turn log OFF for given GROUP or ID\n"
+"    -ON                       turn all logs ON\n"
+"    -OFF                      turn all logs OFF\n"
+"                              note: you may pass several -on/-off/-ON/-OFF,\n"
+"                                    they will be processed in order\n"
+"                                    by default, all is off\n"
+"    -ip <host>                connect to given IP address (default %s)\n"
+"    -p <port>                 connect to given port (default %d)\n"
+"    -debug-gui                activate GUI debug logs\n",
+  DEFAULT_REMOTE_IP,
+  DEFAULT_REMOTE_PORT
+  );
+  exit(1);
+}
+
+static void *gui_thread(void *_g)
+{
+  gui *g = _g;
+  gui_loop(g);
+  return NULL;
+}
+
+static void vcd_main_gui(gui *g, event_handler *h, void *database)
+{
+  int i, j;
+  int n;
+  int nb_functions = 0;
+  char **ids;
+  widget *win;
+  widget *container;
+  widget *w;
+  view *timeview;
+  view *subview;
+  logger *timelog;
+
+  /* get number of vcd functions - look for all events VCD_FUNCTION_xxx */
+  n = database_get_ids(database, &ids);
+  for (i = 0; i < n; i++) {
+    if (strncmp(ids[i], "VCD_FUNCTION_", 13) != 0) continue;
+    nb_functions++;
+  }
+
+  win = new_toplevel_window(g, 1000, 5 * nb_functions, "VCD tracer");
+  container = new_container(g, VERTICAL);
+  widget_add_child(g, win, container, -1);
+
+  w = new_timeline(g, 1000, nb_functions, 5);
+  widget_add_child(g, container, w, -1);
+  for (i = 0; i < nb_functions; i++)
+    timeline_set_subline_background_color(g, w, i,
+        new_color(g, i & 1 ? "#ddd" : "#eee"));
+  timeview = new_view_time(3600, 10, g, w);
+  i = 0;
+  for (j = 0; j < n; j++) {
+    if (strncmp(ids[j], "VCD_FUNCTION_", 13) != 0) continue;
+    timelog = new_timelog(h, database, ids[j]);
+    subview = new_subview_time(timeview, i, FOREGROUND_COLOR, 3600*1000);
+    logger_add_view(timelog, subview);
+    i++;
+  }
+
+  free(ids);
+}
+
+int main(int n, char **v)
+{
+  extern int volatile gui_logd;
+  char *database_filename = NULL;
+  void *database;
+  char *ip = DEFAULT_REMOTE_IP;
+  int port = DEFAULT_REMOTE_PORT;
+  char **on_off_name;
+  int *on_off_action;
+  int on_off_n = 0;
+  int *is_on;
+  int number_of_events;
+  int i;
+  event_handler *h;
+  gui *g;
+  vcd_data vcd_data;
+
+  /* write on a socket fails if the other end is closed and we get SIGPIPE */
+  if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) abort();
+
+  on_off_name = malloc(n * sizeof(char *)); if (on_off_name == NULL) abort();
+  on_off_action = malloc(n * sizeof(int)); if (on_off_action == NULL) abort();
+
+  for (i = 1; i < n; i++) {
+    if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage();
+    if (!strcmp(v[i], "-d"))
+      { if (i > n-2) usage(); database_filename = v[++i]; continue; }
+    if (!strcmp(v[i], "-ip")) { if (i > n-2) usage(); ip = v[++i]; continue; }
+    if (!strcmp(v[i], "-p"))
+      { if (i > n-2) usage(); port = atoi(v[++i]); continue; }
+    if (!strcmp(v[i], "-on")) { if (i > n-2) usage();
+      on_off_name[on_off_n]=v[++i]; on_off_action[on_off_n++]=1; continue; }
+    if (!strcmp(v[i], "-off")) { if (i > n-2) usage();
+      on_off_name[on_off_n]=v[++i]; on_off_action[on_off_n++]=0; continue; }
+    if (!strcmp(v[i], "-ON"))
+      { on_off_name[on_off_n]=NULL; on_off_action[on_off_n++]=1; continue; }
+    if (!strcmp(v[i], "-OFF"))
+      { on_off_name[on_off_n]=NULL; on_off_action[on_off_n++]=0; continue; }
+    if (!strcmp(v[i], "-debug-gui")) { gui_logd = 1; continue; }
+    usage();
+  }
+
+  if (database_filename == NULL) {
+    printf("ERROR: provide a database file (-d)\n");
+    exit(1);
+  }
+
+  database = parse_database(database_filename);
+
+  load_config_file(database_filename);
+
+  number_of_events = number_of_ids(database);
+  is_on = calloc(number_of_events, sizeof(int));
+  if (is_on == NULL) abort();
+
+  h = new_handler(database);
+
+  g = gui_init();
+  new_thread(gui_thread, g);
+
+  vcd_main_gui(g, h, database);
+
+  on_off(database, "VCD_FUNCTION", is_on, 1);
+
+  for (i = 0; i < on_off_n; i++)
+    on_off(database, on_off_name[i], is_on, on_off_action[i]);
+
+  vcd_data.socket = -1;
+  vcd_data.is_on = is_on;
+  vcd_data.nevents = number_of_events;
+  if (pthread_mutex_init(&vcd_data.lock, NULL)) abort();
+  setup_event_selector(g, database, is_on, is_on_changed, &vcd_data);
+
+  vcd_data.socket = connect_to(ip, port);
+
+  /* send the first message - activate selected traces */
+  is_on_changed(&vcd_data);
+
+  /* read messages */
+  while (1) {
+    char v[T_BUFFER_MAX];
+    event e;
+    e = get_event(vcd_data.socket, v, database);
+    if (e.type == -1) abort();
+    handle_event(h, e);
+  }
+
+  return 0;
+}
diff --git a/common/utils/T/tracer/view/Makefile b/common/utils/T/tracer/view/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..32b267ec24d60c25bf1650e5b60250579c6be871
--- /dev/null
+++ b/common/utils/T/tracer/view/Makefile
@@ -0,0 +1,13 @@
+CC=gcc
+CFLAGS=-Wall -g -pthread -I.. -I../logger
+
+OBJS=stdout.o textlist.o xy.o tti.o time.o ticktime.o
+
+view.a: $(OBJS)
+	ar cr view.a $(OBJS)
+
+%.o: %.c
+	$(CC) $(CFLAGS) -o $@ -c $<
+
+clean:
+	rm -f *.a *.o
diff --git a/common/utils/T/tracer/view/stdout.c b/common/utils/T/tracer/view/stdout.c
new file mode 100644
index 0000000000000000000000000000000000000000..93223e59d81d2591a9a317f75c84cd7f57b32d33
--- /dev/null
+++ b/common/utils/T/tracer/view/stdout.c
@@ -0,0 +1,35 @@
+#include "view.h"
+#include <stdlib.h>
+#include <stdio.h>
+#include <pthread.h>
+
+struct stdout {
+  view common;
+  pthread_mutex_t lock;
+};
+
+static void clear(view *this)
+{
+  /* do nothing */
+}
+
+static void append(view *_this, char *s)
+{
+  struct stdout *this = (struct stdout *)_this;
+  if (pthread_mutex_lock(&this->lock)) abort();
+  printf("%s\n", s);
+  if (pthread_mutex_unlock(&this->lock)) abort();
+}
+
+view *new_view_stdout(void)
+{
+  struct stdout *ret = calloc(1, sizeof(struct stdout));
+  if (ret == NULL) abort();
+
+  ret->common.clear = clear;
+  ret->common.append = (void (*)(view *, ...))append;
+
+  if (pthread_mutex_init(&ret->lock, NULL)) abort();
+
+  return (view *)ret;
+}
diff --git a/common/utils/T/tracer/view/textlist.c b/common/utils/T/tracer/view/textlist.c
new file mode 100644
index 0000000000000000000000000000000000000000..b89314191c9728ee763d6eacda22653ab05e53f5
--- /dev/null
+++ b/common/utils/T/tracer/view/textlist.c
@@ -0,0 +1,169 @@
+#include "view.h"
+#include "../utils.h"
+#include "gui/gui.h"
+#include <stdlib.h>
+#include <pthread.h>
+#include <string.h>
+
+struct textlist {
+  view common;
+  gui *g;
+  widget *w;
+  int maxsize;
+  int cursize;
+  float refresh_rate;
+  int autoscroll;
+  pthread_mutex_t lock;
+  list * volatile to_append;
+};
+
+static void _append(struct textlist *this, char *s, int *deleted)
+{
+  if (this->cursize == this->maxsize) {
+    textlist_del_silent(this->g, this->w, 0);
+    this->cursize--;
+    (*deleted)++;
+  }
+  textlist_add_silent(this->g, this->w, s, -1, FOREGROUND_COLOR);
+  this->cursize++;
+}
+
+static void *textlist_thread(void *_this)
+{
+  struct textlist *this = _this;
+  int dirty;
+  int deleted;
+  int visible_lines, start_line, number_of_lines;
+
+  while (1) {
+    if (pthread_mutex_lock(&this->lock)) abort();
+    dirty = this->to_append == NULL ? 0 : 1;
+    deleted = 0;
+    while (this->to_append != NULL) {
+      char *s = this->to_append->data;
+      this->to_append = list_remove_head(this->to_append);
+      _append(this, s, &deleted);
+      free(s);
+    }
+    if (dirty) {
+      textlist_state(this->g, this->w, &visible_lines, &start_line,
+          &number_of_lines);
+      if (this->autoscroll)
+        start_line = number_of_lines - visible_lines;
+      else
+        start_line -= deleted;
+      if (start_line < 0) start_line = 0;
+      textlist_set_start_line(this->g, this->w, start_line);
+      /* this call is not necessary, but if things change in textlist... */
+      widget_dirty(this->g, this->w);
+    }
+    if (pthread_mutex_unlock(&this->lock)) abort();
+    sleepms(1000/this->refresh_rate);
+  }
+
+  return 0;
+}
+
+static void clear(view *this)
+{
+  /* TODO */
+}
+
+static void append(view *_this, char *s)
+{
+  struct textlist *this = (struct textlist *)_this;
+  char *dup;
+
+  if (pthread_mutex_lock(&this->lock)) abort();
+  dup = strdup(s); if (dup == NULL) abort();
+  this->to_append = list_append(this->to_append, dup);
+  if (pthread_mutex_unlock(&this->lock)) abort();
+}
+
+static void scroll(void *private, gui *g,
+    char *notification, widget *w, void *notification_data)
+{
+  struct textlist *this = private;
+  int visible_lines;
+  int start_line;
+  int number_of_lines;
+  int new_line;
+  int inc;
+  int *d = notification_data;
+  int key_modifiers = *d;
+
+  if (pthread_mutex_lock(&this->lock)) abort();
+
+  textlist_state(g, w, &visible_lines, &start_line, &number_of_lines);
+  inc = 10;
+  if (inc > visible_lines - 2) inc = visible_lines - 2;
+  if (inc < 1) inc = 1;
+  if (key_modifiers & KEY_CONTROL) inc = 1;
+  if (!strcmp(notification, "scrollup")) inc = -inc;
+
+  new_line = start_line + inc;
+  if (new_line > number_of_lines - visible_lines)
+    new_line = number_of_lines - visible_lines;
+  if (new_line < 0) new_line = 0;
+
+  textlist_set_start_line(g, w, new_line);
+
+  if (new_line + visible_lines < number_of_lines)
+    this->autoscroll = 0;
+  else
+    this->autoscroll = 1;
+
+  if (pthread_mutex_unlock(&this->lock)) abort();
+}
+
+static void click(void *private, gui *g,
+    char *notification, widget *w, void *notification_data)
+{
+  struct textlist *this = private;
+  int *d = notification_data;
+  int button = d[1];
+
+  if (pthread_mutex_lock(&this->lock)) abort();
+
+  if (button == 1) this->autoscroll = 1;
+  if (button == 3) this->autoscroll = 0;
+
+  if (this->autoscroll) {
+    int visible_lines, start_line, number_of_lines;
+    textlist_state(this->g, this->w, &visible_lines, &start_line,
+        &number_of_lines);
+    start_line = number_of_lines - visible_lines;
+    if (start_line < 0) start_line = 0;
+    textlist_set_start_line(this->g, this->w, start_line);
+    /* this call is not necessary, but if things change in textlist... */
+    widget_dirty(this->g, this->w);
+  }
+
+  if (pthread_mutex_unlock(&this->lock)) abort();
+}
+
+view *new_view_textlist(int maxsize, float refresh_rate, gui *g, widget *w)
+{
+  struct textlist *ret = calloc(1, sizeof(struct textlist));
+  if (ret == NULL) abort();
+
+  ret->common.clear = clear;
+  ret->common.append = (void (*)(view *, ...))append;
+
+  ret->cursize = 0;
+  ret->maxsize = maxsize;
+  ret->refresh_rate = refresh_rate;
+  ret->g = g;
+  ret->w = w;
+  ret->autoscroll = 1;
+
+  if (pthread_mutex_init(&ret->lock, NULL)) abort();
+
+  register_notifier(g, "scrollup", w, scroll, ret);
+  register_notifier(g, "scrolldown", w, scroll, ret);
+  register_notifier(g, "click", w, click, ret);
+
+  new_thread(textlist_thread, ret);
+
+  return (view *)ret;
+}
diff --git a/common/utils/T/tracer/view/ticktime.c b/common/utils/T/tracer/view/ticktime.c
new file mode 100644
index 0000000000000000000000000000000000000000..1e1c7352a07a1acafe1f57681e8925a099fcd6ef
--- /dev/null
+++ b/common/utils/T/tracer/view/ticktime.c
@@ -0,0 +1,411 @@
+#include "view.h"
+#include "../utils.h"
+#include "logger.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <pthread.h>
+#include <string.h>
+
+/* TODO: some code is identical/almost identical to time.c, merge/factorize */
+
+/****************************************************************************/
+/*                               tick timeview                              */
+/****************************************************************************/
+
+struct plot {
+  struct timespec *tick;
+  int ticksize;
+  int tickmaxsize;
+  int tickstart;
+  int line;
+  int color;
+};
+
+struct ticktime {
+  view common;
+  gui *g;
+  widget *w;
+  float refresh_rate;
+  pthread_mutex_t lock;
+  struct plot *p;
+  int psize;
+  double pixel_length;        /* unit: nanosecond (maximum 1 hour/pixel) */
+  struct timespec latest_time;
+  struct timespec start_time;
+  int autoscroll;
+  struct timespec tick_latest_time;
+  int tick_latest_frame;
+  int tick_latest_subframe;
+  void *clock_ticktime;      /* data for the clock tick, see below */
+};
+
+/* TODO: put that function somewhere else (utils.c) */
+static struct timespec time_add(struct timespec a, struct timespec b)
+{
+  struct timespec ret;
+  ret.tv_sec = a.tv_sec + b.tv_sec;
+  ret.tv_nsec = a.tv_nsec + b.tv_nsec;
+  if (ret.tv_nsec > 1000000000) {
+    ret.tv_sec++;
+    ret.tv_nsec -= 1000000000;
+  }
+  return ret;
+}
+
+/* TODO: put that function somewhere else (utils.c) */
+static struct timespec time_sub(struct timespec a, struct timespec b)
+{
+  struct timespec ret;
+  if (a.tv_nsec < b.tv_nsec) {
+    ret.tv_nsec = (int64_t)a.tv_nsec - (int64_t)b.tv_nsec + 1000000000;
+    ret.tv_sec = a.tv_sec - b.tv_sec - 1;
+  } else {
+    ret.tv_nsec = a.tv_nsec - b.tv_nsec;
+    ret.tv_sec = a.tv_sec - b.tv_sec;
+  }
+  return ret;
+}
+
+/* TODO: put that function somewhere else (utils.c) */
+static struct timespec nano_to_time(int64_t n)
+{
+  struct timespec ret;
+  ret.tv_sec = n / 1000000000;
+  ret.tv_nsec = n % 1000000000;
+  return ret;
+}
+
+/* TODO: put that function somewhere else (utils.c) */
+static int time_cmp(struct timespec a, struct timespec b)
+{
+  if (a.tv_sec < b.tv_sec) return -1;
+  if (a.tv_sec > b.tv_sec) return 1;
+  if (a.tv_nsec < b.tv_nsec) return -1;
+  if (a.tv_nsec > b.tv_nsec) return 1;
+  return 0;
+}
+
+static int interval_empty(struct ticktime *this, int sub,
+    struct timespec start, struct timespec end)
+{
+  int a, b, mid;
+  int i;
+
+  if (this->p[sub].ticksize == 0) return 1;
+
+  /* look for a tick larger than start and smaller than end */
+  a = 0;
+  b = this->p[sub].ticksize - 1;
+  while (b >= a) {
+    mid = (a+b) / 2;
+    i = (this->p[sub].tickstart + mid) % this->p[sub].ticksize;
+    if (time_cmp(this->p[sub].tick[i], start) < 0) a = mid + 1;
+    else if (time_cmp(this->p[sub].tick[i], end) > 0) b = mid - 1;
+    else return 0;
+  }
+  return 1;
+}
+
+static void *ticktime_thread(void *_this)
+{
+  struct ticktime *this = _this;
+  int width;
+  int l;
+  int i;
+  struct timespec tstart;
+  struct timespec tnext;
+  struct plot *p;
+  int64_t pixel_length;
+
+  while (1) {
+    if (pthread_mutex_lock(&this->lock)) abort();
+
+    timeline_get_width(this->g, this->w, &width);
+    timeline_clear_silent(this->g, this->w);
+
+    /* TODO: optimize? */
+
+    /* use rounded pixel_length */
+    pixel_length = this->pixel_length;
+
+    if (this->autoscroll) {
+      tnext = time_add(this->latest_time,
+          (struct timespec){tv_sec:0,tv_nsec:1});
+      tstart = time_sub(tnext, nano_to_time(pixel_length * width));
+      this->start_time = tstart;
+    } else {
+      tstart = this->start_time;
+      tnext = time_add(tstart, nano_to_time(pixel_length * width));
+    }
+
+    for (l = 0; l < this->psize; l++) {
+      for (i = 0; i < width; i++) {
+        struct timespec tick_start, tick_end;
+        tick_start = time_add(tstart, nano_to_time(pixel_length * i));
+        tick_end = time_add(tick_start, nano_to_time(pixel_length-1));
+        if (interval_empty(this, l, tick_start, tick_end))
+          continue;
+        p = &this->p[l];
+        /* TODO: only one call */
+        int x[3] = {i==0?i:i-1, i, i==width-1?i:i+1};
+        timeline_add_points_silent(this->g, this->w, p->line, p->color, x, 3);
+      }
+    }
+
+    widget_dirty(this->g, this->w);
+
+    if (pthread_mutex_unlock(&this->lock)) abort();
+    sleepms(1000 / this->refresh_rate);
+  }
+
+  return 0;
+}
+
+static void scroll(void *private, gui *g,
+    char *notification, widget *w, void *notification_data)
+{
+  struct ticktime *this = private;
+  int *d = notification_data;
+  int x = d[0];
+  int key_modifiers = d[2];
+  double mul = 1.2;
+  double pixel_length;
+  int64_t old_px_len_rounded;
+  struct timespec t;
+  int scroll_px;
+  int width;
+
+  if (pthread_mutex_lock(&this->lock)) abort();
+
+  old_px_len_rounded = this->pixel_length;
+
+  /* scroll if control+wheel, zoom otherwise */
+
+  if (key_modifiers & KEY_CONTROL) {
+    timeline_get_width(this->g, this->w, &width);
+    if (width < 2) width = 2;
+    scroll_px = 100;
+    if (scroll_px > width - 1) scroll_px = width - 1;
+    if (!strcmp(notification, "scrolldown"))
+      this->start_time = time_add(this->start_time,
+          nano_to_time(scroll_px * old_px_len_rounded));
+    else
+      this->start_time = time_sub(this->start_time,
+          nano_to_time(scroll_px * old_px_len_rounded));
+    goto end;
+  }
+
+  if (!strcmp(notification, "scrollup")) mul = 1 / mul;
+
+again:
+  pixel_length = this->pixel_length * mul;
+  if (pixel_length < 1) pixel_length = 1;
+  if (pixel_length > (double)3600 * 1000000000)
+    pixel_length = (double)3600 * 1000000000;
+
+  this->pixel_length = pixel_length;
+
+  /* due to rounding, we may need to zoom by more than 1.2 with
+   * very close lookup, otherwise the user zooming command won't
+   * be visible (say length is 2.7, zoom in, new length is 2.25,
+   * and rounding is 2, same value, no change, no feedback to user => bad)
+   * TODO: make all this cleaner
+   */
+  if (pixel_length != 1 && pixel_length != (double)3600 * 1000000000 &&
+      (int64_t)pixel_length == old_px_len_rounded)
+    goto again;
+
+  t = time_add(this->start_time, nano_to_time(x * old_px_len_rounded));
+  this->start_time = time_sub(t, nano_to_time(x * (int64_t)pixel_length));
+
+end:
+  if (pthread_mutex_unlock(&this->lock)) abort();
+}
+
+static void click(void *private, gui *g,
+    char *notification, widget *w, void *notification_data)
+{
+  struct ticktime *this = private;
+  int *d = notification_data;
+  int button = *d;
+
+  if (button == 3) this->autoscroll = 0;
+  if (button == 1) this->autoscroll = 1;
+}
+
+view *new_view_ticktime(float refresh_rate, gui *g, widget *w)
+{
+  struct ticktime *ret = calloc(1, sizeof(struct ticktime));
+  if (ret == NULL) abort();
+
+  ret->refresh_rate = refresh_rate;
+  ret->g = g;
+  ret->w = w;
+
+  ret->p = NULL;
+  ret->psize = 0;
+
+  ret->autoscroll = 1;
+
+  ret->tick_latest_time.tv_sec = 1;
+
+  /* default pixel length: 10ms */
+  ret->pixel_length = 10 * 1000000;
+
+  register_notifier(g, "scrollup", w, scroll, ret);
+  register_notifier(g, "scrolldown", w, scroll, ret);
+  register_notifier(g, "click", w, click, ret);
+
+  if (pthread_mutex_init(&ret->lock, NULL)) abort();
+
+  new_thread(ticktime_thread, ret);
+
+  return (view *)ret;
+}
+
+/****************************************************************************/
+/*                          subticktimeview                                 */
+/****************************************************************************/
+
+struct subticktime {
+  view common;
+  struct ticktime *parent;
+  int line;
+  int color;
+  int subview;
+};
+
+static void append(view *_this, struct timespec t, int frame, int subframe)
+{
+  struct subticktime *this = (struct subticktime *)_this;
+  struct ticktime    *ticktime = this->parent;
+  struct plot        *p = &ticktime->p[this->subview];
+  int                i;
+  struct timespec    swap;
+  int64_t            diff;
+
+  if (pthread_mutex_lock(&ticktime->lock)) abort();
+
+  /* get time with respect to latest known tick time */
+  diff = (frame*10 + subframe) -
+      (ticktime->tick_latest_frame*10 + ticktime->tick_latest_subframe);
+  if (diff > 1024*10/2) diff -= 1024*10;
+  else if (diff < -1024*10/2) diff += 1024*10;
+  if (diff < 0)
+    t = time_sub(ticktime->tick_latest_time, nano_to_time(-diff * 1000000));
+  else
+    t = time_add(ticktime->tick_latest_time, nano_to_time(diff * 1000000));
+
+  if (p->ticksize < p->tickmaxsize) {
+    p->tick[p->ticksize] = t;
+    p->ticksize++;
+  } else {
+    p->tick[p->tickstart] = t;
+    p->tickstart = (p->tickstart + 1) % p->ticksize;
+  }
+
+  /* due to adjustment of the time, array may not be ordered anymore */
+  for (i = p->ticksize-2; i >= 0; i--) {
+    int prev = (p->tickstart + i) % p->ticksize;
+    int cur = (prev + 1) % p->ticksize;
+    if (time_cmp(p->tick[prev], p->tick[cur]) <= 0) break;
+    swap = p->tick[prev];
+    p->tick[prev] = p->tick[cur];
+    p->tick[cur] = swap;
+  }
+
+  if (time_cmp(ticktime->latest_time, t) < 0)
+    ticktime->latest_time = t;
+
+  if (pthread_mutex_unlock(&ticktime->lock)) abort();
+}
+
+view *new_subview_ticktime(view *_time, int line, int color, int size)
+{
+  struct ticktime *ticktime = (struct ticktime *)_time;
+  struct subticktime *ret = calloc(1, sizeof(struct subticktime));
+  if (ret == NULL) abort();
+
+  ret->common.append = (void (*)(view *, ...))append;
+
+  if (pthread_mutex_lock(&ticktime->lock)) abort();
+
+  ret->parent = ticktime;
+  ret->line = line;
+  ret->color = color;
+  ret->subview = ticktime->psize;
+
+  ticktime->p = realloc(ticktime->p,
+      (ticktime->psize + 1) * sizeof(struct plot));
+  if (ticktime->p == NULL) abort();
+  ticktime->p[ticktime->psize].tick = calloc(size, sizeof(struct timespec));
+  if (ticktime->p[ticktime->psize].tick == NULL) abort();
+  ticktime->p[ticktime->psize].ticksize = 0;
+  ticktime->p[ticktime->psize].tickmaxsize = size;
+  ticktime->p[ticktime->psize].tickstart = 0;
+  ticktime->p[ticktime->psize].line = line;
+  ticktime->p[ticktime->psize].color = color;
+
+  ticktime->psize++;
+
+  if (pthread_mutex_unlock(&ticktime->lock)) abort();
+
+  return (view *)ret;
+}
+
+/****************************************************************************/
+/*                               clock tick                                 */
+/****************************************************************************/
+
+struct clock_ticktime {
+  view common;
+  struct ticktime *parent;
+};
+
+static void clock_append(view *_this, struct timespec t,
+    int frame, int subframe)
+{
+  struct clock_ticktime *this = (struct clock_ticktime *)_this;
+  struct ticktime *tt = this->parent;
+  int64_t diff;
+
+  if (subframe == 10) { subframe = 0; frame = (frame + 1) % 1024; }
+
+  if (pthread_mutex_lock(&tt->lock)) abort();
+
+  /* get time relative to latest known tick time */
+  /* In normal conditions diff is 1 but if the user pauses reception of events
+   * it may be anything. Let's take only positive values.
+   */
+  diff = (frame*10 + subframe) -
+      (tt->tick_latest_frame*10 + tt->tick_latest_subframe);
+  if (diff < 0) diff += 1024*10;
+  tt->tick_latest_time = time_add(tt->tick_latest_time,
+      nano_to_time(diff * 1000000));
+  tt->tick_latest_frame = frame;
+  tt->tick_latest_subframe = subframe;
+
+  if (time_cmp(tt->latest_time, tt->tick_latest_time) < 0)
+    tt->latest_time = tt->tick_latest_time;
+
+  if (pthread_mutex_unlock(&tt->lock)) abort();
+}
+
+void ticktime_set_tick(view *_ticktime, void *logger)
+{
+  struct ticktime *ticktime = (struct ticktime *)_ticktime;
+  struct clock_ticktime *n;
+
+  if (pthread_mutex_lock(&ticktime->lock)) abort();
+
+  free(ticktime->clock_ticktime);
+  n = ticktime->clock_ticktime = calloc(1, sizeof(struct clock_ticktime));
+  if (n == NULL) abort();
+
+  n->common.append = (void (*)(view *, ...))clock_append;
+  n->parent = ticktime;
+
+  logger_add_view(logger, (view *)n);
+
+  if (pthread_mutex_unlock(&ticktime->lock)) abort();
+}
diff --git a/common/utils/T/tracer/view/time.c b/common/utils/T/tracer/view/time.c
new file mode 100644
index 0000000000000000000000000000000000000000..287e7b1c7be029af0a815febb271938d888857a4
--- /dev/null
+++ b/common/utils/T/tracer/view/time.c
@@ -0,0 +1,322 @@
+#include "view.h"
+#include "../utils.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <pthread.h>
+#include <string.h>
+
+/****************************************************************************/
+/*                              timeview                                    */
+/****************************************************************************/
+
+struct plot {
+  struct timespec *tick;
+  int ticksize;
+  int tickmaxsize;
+  int tickstart;
+  int line;
+  int color;
+};
+
+struct time {
+  view common;
+  gui *g;
+  widget *w;
+  float refresh_rate;
+  pthread_mutex_t lock;
+  struct plot *p;
+  int psize;
+  double pixel_length;        /* unit: nanosecond (maximum 1 hour/pixel) */
+  struct timespec latest_time;
+  struct timespec start_time;
+  int autoscroll;
+};
+
+/* TODO: put that function somewhere else (utils.c) */
+static struct timespec time_add(struct timespec a, struct timespec b)
+{
+  struct timespec ret;
+  ret.tv_sec = a.tv_sec + b.tv_sec;
+  ret.tv_nsec = a.tv_nsec + b.tv_nsec;
+  if (ret.tv_nsec > 1000000000) {
+    ret.tv_sec++;
+    ret.tv_nsec -= 1000000000;
+  }
+  return ret;
+}
+
+/* TODO: put that function somewhere else (utils.c) */
+static struct timespec time_sub(struct timespec a, struct timespec b)
+{
+  struct timespec ret;
+  if (a.tv_nsec < b.tv_nsec) {
+    ret.tv_nsec = (int64_t)a.tv_nsec - (int64_t)b.tv_nsec + 1000000000;
+    ret.tv_sec = a.tv_sec - b.tv_sec - 1;
+  } else {
+    ret.tv_nsec = a.tv_nsec - b.tv_nsec;
+    ret.tv_sec = a.tv_sec - b.tv_sec;
+  }
+  return ret;
+}
+
+/* TODO: put that function somewhere else (utils.c) */
+static struct timespec nano_to_time(int64_t n)
+{
+  struct timespec ret;
+  ret.tv_sec = n / 1000000000;
+  ret.tv_nsec = n % 1000000000;
+  return ret;
+}
+
+/* TODO: put that function somewhere else (utils.c) */
+static int time_cmp(struct timespec a, struct timespec b)
+{
+  if (a.tv_sec < b.tv_sec) return -1;
+  if (a.tv_sec > b.tv_sec) return 1;
+  if (a.tv_nsec < b.tv_nsec) return -1;
+  if (a.tv_nsec > b.tv_nsec) return 1;
+  return 0;
+}
+
+static int interval_empty(struct time *this, int sub,
+    struct timespec start, struct timespec end)
+{
+  int a, b, mid;
+  int i;
+
+  if (this->p[sub].ticksize == 0) return 1;
+
+  /* look for a tick larger than start and smaller than end */
+  a = 0;
+  b = this->p[sub].ticksize - 1;
+  while (b >= a) {
+    mid = (a+b) / 2;
+    i = (this->p[sub].tickstart + mid) % this->p[sub].ticksize;
+    if (time_cmp(this->p[sub].tick[i], start) < 0) a = mid + 1;
+    else if (time_cmp(this->p[sub].tick[i], end) > 0) b = mid - 1;
+    else return 0;
+  }
+  return 1;
+}
+
+static void *time_thread(void *_this)
+{
+  struct time *this = _this;
+  int width;
+  int l;
+  int i;
+  struct timespec tstart;
+  struct timespec tnext;
+  struct plot *p;
+  int64_t pixel_length;
+
+  while (1) {
+    if (pthread_mutex_lock(&this->lock)) abort();
+
+    timeline_get_width(this->g, this->w, &width);
+    timeline_clear_silent(this->g, this->w);
+
+    /* TODO: optimize? */
+
+    /* use rounded pixel_length */
+    pixel_length = this->pixel_length;
+
+    if (this->autoscroll) {
+      tnext = time_add(this->latest_time,
+          (struct timespec){tv_sec:0,tv_nsec:1});
+      tstart = time_sub(tnext, nano_to_time(pixel_length * width));
+      this->start_time = tstart;
+    } else {
+      tstart = this->start_time;
+      tnext = time_add(tstart, nano_to_time(pixel_length * width));
+    }
+
+    for (l = 0; l < this->psize; l++) {
+      for (i = 0; i < width; i++) {
+        struct timespec tick_start, tick_end;
+        tick_start = time_add(tstart, nano_to_time(pixel_length * i));
+        tick_end = time_add(tick_start, nano_to_time(pixel_length-1));
+        if (interval_empty(this, l, tick_start, tick_end))
+          continue;
+        p = &this->p[l];
+        /* TODO: only one call */
+        timeline_add_points_silent(this->g, this->w, p->line, p->color, &i, 1);
+      }
+    }
+
+    widget_dirty(this->g, this->w);
+
+    if (pthread_mutex_unlock(&this->lock)) abort();
+    sleepms(1000 / this->refresh_rate);
+  }
+
+  return 0;
+}
+
+static void scroll(void *private, gui *g,
+    char *notification, widget *w, void *notification_data)
+{
+  struct time *this = private;
+  int *d = notification_data;
+  int x = d[0];
+  int key_modifiers = d[2];
+  double mul = 1.2;
+  double pixel_length;
+  int64_t old_px_len_rounded;
+  struct timespec t;
+  int scroll_px;
+  int width;
+
+  if (pthread_mutex_lock(&this->lock)) abort();
+
+  old_px_len_rounded = this->pixel_length;
+
+  /* scroll if control+wheel, zoom otherwise */
+
+  if (key_modifiers & KEY_CONTROL) {
+    timeline_get_width(this->g, this->w, &width);
+    if (width < 2) width = 2;
+    scroll_px = 100;
+    if (scroll_px > width - 1) scroll_px = width - 1;
+    if (!strcmp(notification, "scrolldown"))
+      this->start_time = time_add(this->start_time,
+          nano_to_time(scroll_px * old_px_len_rounded));
+    else
+      this->start_time = time_sub(this->start_time,
+          nano_to_time(scroll_px * old_px_len_rounded));
+    goto end;
+  }
+
+  if (!strcmp(notification, "scrollup")) mul = 1 / mul;
+
+again:
+  pixel_length = this->pixel_length * mul;
+  if (pixel_length < 1) pixel_length = 1;
+  if (pixel_length > (double)3600 * 1000000000)
+    pixel_length = (double)3600 * 1000000000;
+
+  this->pixel_length = pixel_length;
+
+  /* due to rounding, we may need to zoom by more than 1.2 with
+   * very close lookup, otherwise the user zooming command won't
+   * be visible (say length is 2.7, zoom in, new length is 2.25,
+   * and rounding is 2, same value, no change, no feedback to user => bad)
+   * TODO: make all this cleaner
+   */
+  if (pixel_length != 1 && pixel_length != (double)3600 * 1000000000 &&
+      (int64_t)pixel_length == old_px_len_rounded)
+    goto again;
+
+  t = time_add(this->start_time, nano_to_time(x * old_px_len_rounded));
+  this->start_time = time_sub(t, nano_to_time(x * (int64_t)pixel_length));
+
+end:
+  if (pthread_mutex_unlock(&this->lock)) abort();
+}
+
+static void click(void *private, gui *g,
+    char *notification, widget *w, void *notification_data)
+{
+  struct time *this = private;
+  int *d = notification_data;
+  int button = *d;
+
+  if (button == 3) this->autoscroll = 0;
+  if (button == 1) this->autoscroll = 1;
+}
+
+view *new_view_time(int number_of_seconds, float refresh_rate,
+    gui *g, widget *w)
+{
+  struct time *ret = calloc(1, sizeof(struct time));
+  if (ret == NULL) abort();
+
+  ret->refresh_rate = refresh_rate;
+  ret->g = g;
+  ret->w = w;
+
+  ret->p = NULL;
+  ret->psize = 0;
+
+  ret->autoscroll = 1;
+
+  /* default pixel length: 10ms */
+  ret->pixel_length = 10 * 1000000;
+
+  register_notifier(g, "scrollup", w, scroll, ret);
+  register_notifier(g, "scrolldown", w, scroll, ret);
+  register_notifier(g, "click", w, click, ret);
+
+  if (pthread_mutex_init(&ret->lock, NULL)) abort();
+
+  new_thread(time_thread, ret);
+
+  return (view *)ret;
+}
+
+/****************************************************************************/
+/*                            subtimeview                                   */
+/****************************************************************************/
+
+struct subtime {
+  view common;
+  struct time *parent;
+  int line;
+  int color;
+  int subview;
+};
+
+static void append(view *_this, struct timespec t)
+{
+  struct subtime *this = (struct subtime *)_this;
+  struct time    *time = this->parent;
+  struct plot    *p = &time->p[this->subview];
+
+  if (pthread_mutex_lock(&time->lock)) abort();
+
+  if (p->ticksize < p->tickmaxsize) {
+    p->tick[p->ticksize] = t;
+    p->ticksize++;
+  } else {
+    p->tick[p->tickstart] = t;
+    p->tickstart = (p->tickstart + 1) % p->ticksize;
+  }
+
+  if (time_cmp(time->latest_time, t) < 0)
+    time->latest_time = t;
+
+  if (pthread_mutex_unlock(&time->lock)) abort();
+}
+
+view *new_subview_time(view *_time, int line, int color, int size)
+{
+  struct time *time = (struct time *)_time;
+  struct subtime *ret = calloc(1, sizeof(struct subtime));
+  if (ret == NULL) abort();
+
+  ret->common.append = (void (*)(view *, ...))append;
+
+  if (pthread_mutex_lock(&time->lock)) abort();
+
+  ret->parent = time;
+  ret->line = line;
+  ret->color = color;
+  ret->subview = time->psize;
+
+  time->p = realloc(time->p,
+      (time->psize + 1) * sizeof(struct plot));
+  if (time->p == NULL) abort();
+  time->p[time->psize].tick = calloc(size, sizeof(struct timespec));
+  if (time->p[time->psize].tick == NULL) abort();
+  time->p[time->psize].ticksize = 0;
+  time->p[time->psize].tickmaxsize = size;
+  time->p[time->psize].tickstart = 0;
+  time->p[time->psize].line = line;
+  time->p[time->psize].color = color;
+
+  time->psize++;
+
+  if (pthread_mutex_unlock(&time->lock)) abort();
+
+  return (view *)ret;
+}
diff --git a/common/utils/T/tracer/view/tti.c b/common/utils/T/tracer/view/tti.c
new file mode 100644
index 0000000000000000000000000000000000000000..ebf9fc657cb5f1cf581d93dcb7553254e9dfbf66
--- /dev/null
+++ b/common/utils/T/tracer/view/tti.c
@@ -0,0 +1,121 @@
+#include "view.h"
+#include "../utils.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <pthread.h>
+#include <stdarg.h>
+#include <string.h>
+
+struct tti {
+  view common;
+  gui *g;
+  widget *w;
+  int plot;
+  float refresh_rate;
+  pthread_mutex_t lock;
+  float data[1024*10];
+  int valid[1024*10];
+  float xout[1024*10];
+  float yout[1024*10];
+  int last_insert_point;
+};
+
+static int far_enough(int i, int last_insert, int plot_width)
+{
+  int p1;
+  int p2;
+  int hole_size_px;
+  int hole_size_tti;
+  hole_size_px = 10;
+  hole_size_tti = 10240 * hole_size_px / plot_width;
+  p1 = last_insert;
+  p2 = (last_insert + hole_size_tti) % (1024*10);
+  if (p1 < p2) {
+    return !(i > p1 && i < p2);
+  }
+  return i > p2 && i <= p1;
+}
+
+static void *tti_thread(void *_this)
+{
+  struct tti *this = _this;
+  int i;
+  int length;
+  int plot_width;
+  int plot_height;
+
+  while (1) {
+    if (pthread_mutex_lock(&this->lock)) abort();
+    xy_plot_get_dimensions(this->g, this->w, &plot_width, &plot_height);
+    length = 0;
+    /* TODO: optimize */
+    for (i = 0; i < 1024*10; i++)
+      /* do not take points too close after last insertion point */
+      if (this->valid[i] &&
+          far_enough(i, this->last_insert_point, plot_width)) {
+        this->xout[length] = i;
+        this->yout[length] = this->data[i];
+        length++;
+      }
+    xy_plot_set_points(this->g, this->w, this->plot,
+        length, this->xout, this->yout);
+    if (pthread_mutex_unlock(&this->lock)) abort();
+    sleepms(1000/this->refresh_rate);
+  }
+
+  return 0;
+}
+
+static void clear(view *this)
+{
+  /* TODO */
+}
+
+static void append(view *_this, int frame, int subframe, double value)
+{
+  struct tti *this = (struct tti *)_this;
+  int i;
+  int index = frame * 10 + subframe;
+
+  if (pthread_mutex_lock(&this->lock)) abort();
+
+  /* TODO: optimize */
+  /* clear all between last insert point and current one
+   * this may be wrong if delay between two append is
+   * greater than 1024 frames (something like that)
+   */
+  i = (this->last_insert_point + 1) % (1024*10);
+  while (i != index) {
+    this->valid[i] = 0;
+    i = (i + 1) % (1024*10);
+  }
+
+  this->data[index] = value;
+  this->valid[index] = 1;
+
+  this->last_insert_point = index;
+
+  if (pthread_mutex_unlock(&this->lock)) abort();
+}
+
+view *new_view_tti(float refresh_rate, gui *g, widget *w, int color)
+{
+  struct tti *ret = calloc(1, sizeof(struct tti));
+  if (ret == NULL) abort();
+
+  ret->common.clear = clear;
+  ret->common.append = (void (*)(view *, ...))append;
+
+  ret->refresh_rate = refresh_rate;
+  ret->g = g;
+  ret->w = w;
+  ret->plot = xy_plot_new_plot(g, w, color);
+
+  ret->last_insert_point = 0;
+
+  if (pthread_mutex_init(&ret->lock, NULL)) abort();
+
+  new_thread(tti_thread, ret);
+
+  return (view *)ret;
+}
diff --git a/common/utils/T/tracer/view/view.h b/common/utils/T/tracer/view/view.h
new file mode 100644
index 0000000000000000000000000000000000000000..2173c842ce956929945ef1e38662f64e90e0dcc2
--- /dev/null
+++ b/common/utils/T/tracer/view/view.h
@@ -0,0 +1,29 @@
+#ifndef _VIEW_H_
+#define _VIEW_H_
+
+#include "gui/gui.h"
+
+/* defines the public API of views */
+
+typedef struct view {
+  void (*clear)(struct view *this);
+  void (*append)(struct view *this, ...);
+  void (*set)(struct view *this, char *name, ...);
+} view;
+
+enum xy_mode { XY_LOOP_MODE, XY_FORCED_MODE };
+
+view *new_view_stdout(void);
+view *new_view_textlist(int maxsize, float refresh_rate, gui *g, widget *w);
+view *new_view_xy(int length, float refresh_rate, gui *g, widget *w,
+    int color, enum xy_mode mode);
+view *new_view_tti(float refresh_rate, gui *g, widget *w,
+    int color);
+view *new_view_time(int number_of_seconds, float refresh_rate,
+    gui *g, widget *w);
+view *new_subview_time(view *time, int line, int color, int size);
+view *new_view_ticktime(float refresh_rate, gui *g, widget *w);
+view *new_subview_ticktime(view *ticktime, int line, int color, int size);
+void ticktime_set_tick(view *ticktime, void *logger);
+
+#endif /* _VIEW_H_ */
diff --git a/common/utils/T/tracer/view/xy.c b/common/utils/T/tracer/view/xy.c
new file mode 100644
index 0000000000000000000000000000000000000000..96a44cf5129e41f044cdbf559df32709fb5a8ff2
--- /dev/null
+++ b/common/utils/T/tracer/view/xy.c
@@ -0,0 +1,147 @@
+#include "view.h"
+#include "../utils.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <pthread.h>
+#include <stdarg.h>
+#include <string.h>
+
+struct xy {
+  view common;
+  gui *g;
+  widget *w;
+  int plot;
+  float refresh_rate;
+  pthread_mutex_t lock;
+  int length;
+  int max_length;      /* used in XY_FORCED_MODE */
+  float *x;
+  float *y;
+  int insert_point;
+};
+
+static void *xy_thread(void *_this)
+{
+  struct xy *this = _this;
+
+  while (1) {
+    if (pthread_mutex_lock(&this->lock)) abort();
+    xy_plot_set_points(this->g, this->w, this->plot,
+        this->length, this->x, this->y);
+    if (pthread_mutex_unlock(&this->lock)) abort();
+    sleepms(1000/this->refresh_rate);
+  }
+
+  return 0;
+}
+
+static void clear(view *this)
+{
+  /* TODO */
+}
+
+static void append_loop(view *_this, float *x, float *y, int length)
+{
+  struct xy *this = (struct xy *)_this;
+  int i;
+  int ip;
+
+  if (pthread_mutex_lock(&this->lock)) abort();
+
+  ip = this->insert_point;
+
+  /* TODO: optimize the copy */
+  for (i = 0; i < length; i++) {
+    this->x[ip] = x[i];
+    this->y[ip] = y[i];
+    ip++; if (ip == this->length) ip = 0;
+  }
+
+  this->insert_point = ip;
+
+  if (pthread_mutex_unlock(&this->lock)) abort();
+}
+
+static void append_forced(view *_this, float *x, float *y, int length)
+{
+  struct xy *this = (struct xy *)_this;
+
+  if (length > this->max_length) {
+    printf("%s:%d:%s: bad length (%d), max allowed is %d\n",
+        __FILE__, __LINE__, __FUNCTION__, length, this->max_length);
+    abort();
+  }
+
+  if (pthread_mutex_lock(&this->lock)) abort();
+
+  memcpy(this->x, x, length * sizeof(float));
+  memcpy(this->y, y, length * sizeof(float));
+  this->length = length;
+
+  if (pthread_mutex_unlock(&this->lock)) abort();
+}
+
+static void set(view *_this, char *name, ...)
+{
+  struct xy *this = (struct xy *)_this;
+  va_list ap;
+
+  if (!strcmp(name, "length")) {
+    if (pthread_mutex_lock(&this->lock)) abort();
+
+    va_start(ap, name);
+
+    free(this->x);
+    free(this->y);
+    this->length = va_arg(ap, int);
+    this->x = calloc(this->length, sizeof(float)); if (this->x==NULL)abort();
+    this->y = calloc(this->length, sizeof(float)); if (this->y==NULL)abort();
+    this->insert_point = 0;
+
+    va_end(ap);
+
+    if (pthread_mutex_unlock(&this->lock)) abort();
+    return;
+  }
+
+  printf("%s:%d: unkown setting '%s'\n", __FILE__, __LINE__, name);
+  abort();
+}
+
+view *new_view_xy(int length, float refresh_rate, gui *g, widget *w,
+    int color, enum xy_mode mode)
+{
+  struct xy *ret = calloc(1, sizeof(struct xy));
+  if (ret == NULL) abort();
+
+  ret->common.clear = clear;
+
+  switch (mode) {
+  case XY_LOOP_MODE:
+    ret->common.append = (void (*)(view *, ...))append_loop;
+    ret->common.set = set;
+    ret->length = length;
+    ret->insert_point = 0;
+    break;
+  case XY_FORCED_MODE:
+    ret->common.append = (void (*)(view *, ...))append_forced;
+    ret->common.set = NULL;
+    ret->length = 0;
+    ret->max_length = length;
+    break;
+  }
+
+  ret->refresh_rate = refresh_rate;
+  ret->g = g;
+  ret->w = w;
+  ret->plot = xy_plot_new_plot(g, w, color);
+
+  ret->x = calloc(length, sizeof(float)); if (ret->x == NULL) abort();
+  ret->y = calloc(length, sizeof(float)); if (ret->y == NULL) abort();
+
+  if (pthread_mutex_init(&ret->lock, NULL)) abort();
+
+  new_thread(xy_thread, ret);
+
+  return (view *)ret;
+}
diff --git a/common/utils/collection/hashtable/hashtable.c b/common/utils/collection/hashtable/hashtable.c
index d424e2a0add6bbb31962b7f47d68b50359d751f9..4ce0ee7a7ed7ca3d2b830a0d50857e6578123295 100755
--- a/common/utils/collection/hashtable/hashtable.c
+++ b/common/utils/collection/hashtable/hashtable.c
@@ -177,7 +177,6 @@ hashtable_rc_t hashtable_dump_content (const hash_table_t * const hashtblP, char
 {
     hash_node_t  *node         = NULL;
     unsigned int  i            = 0;
-    unsigned int  num_elements = 0;
     if (hashtblP == NULL) {
         *remaining_bytes_in_buffer_pP = snprintf(
                 buffer_pP,
diff --git a/common/utils/itti/intertask_interface.c b/common/utils/itti/intertask_interface.c
index 572c207b3fc7e639671a584b3b6c11241b521ca6..6789dadce60629b14ea493b9148ba2e6882ddd4e 100644
--- a/common/utils/itti/intertask_interface.c
+++ b/common/utils/itti/intertask_interface.c
@@ -58,6 +58,10 @@
 # include "vcd_signal_dumper.h"
 #endif
 
+#if T_TRACER
+#include "T.h"
+#endif
+
 /* Includes "intertask_interface_init.h" to check prototype coherence, but
  * disable threads and messages information generation.
  */
diff --git a/common/utils/itti/intertask_interface_dump.c b/common/utils/itti/intertask_interface_dump.c
index 491bff59b0fcc5aab29116be171daa710504c365..30d92e3a292595ff036cff3fc869ec23aec01081 100644
--- a/common/utils/itti/intertask_interface_dump.c
+++ b/common/utils/itti/intertask_interface_dump.c
@@ -64,6 +64,10 @@
 #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
diff --git a/common/utils/itti/memory_pools.c b/common/utils/itti/memory_pools.c
index dadc80ca2af76268bf170f11967f9f707e795d77..a7d3448352e569423ad56b9c4dc3bb4c992c7c45 100644
--- a/common/utils/itti/memory_pools.c
+++ b/common/utils/itti/memory_pools.c
@@ -37,6 +37,11 @@
 # include "vcd_signal_dumper.h"
 #endif
 
+#if T_TRACER
+#include <string.h>
+#include "T.h"
+#endif
+
 /*------------------------------------------------------------------------------*/
 const static int mp_debug = 0;
 
@@ -54,7 +59,9 @@ uint64_t vcd_mp_free;
 #endif
 
 /*------------------------------------------------------------------------------*/
+#ifndef CHARS_TO_UINT32
 #define CHARS_TO_UINT32(c1, c2, c3, c4) (((c1) << 24) | ((c2) << 16) | ((c3) << 8) | (c4))
+#endif
 
 #define MEMORY_POOL_ITEM_INFO_NUMBER    2
 
diff --git a/openair1/MAC_INTERFACE/COPYING b/openair1/MAC_INTERFACE/COPYING
deleted file mode 100644
index 818433ecc0e094a4db1023c68b33f24344643ad8..0000000000000000000000000000000000000000
--- a/openair1/MAC_INTERFACE/COPYING
+++ /dev/null
@@ -1,674 +0,0 @@
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                            Preamble
-
-  The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
-  The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works.  By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.  We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors.  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
-  To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights.  Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received.  You must make sure that they, too, receive
-or can get the source code.  And you must show them these terms so they
-know their rights.
-
-  Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
-  For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software.  For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-  Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so.  This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software.  The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable.  Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products.  If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
-  Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary.  To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                       TERMS AND CONDITIONS
-
-  0. Definitions.
-
-  "This License" refers to version 3 of the GNU General Public License.
-
-  "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
-  "The Program" refers to any copyrightable work licensed under this
-License.  Each licensee is addressed as "you".  "Licensees" and
-"recipients" may be individuals or organizations.
-
-  To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy.  The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
-  A "covered work" means either the unmodified Program or a work based
-on the Program.
-
-  To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy.  Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
-  To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies.  Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
-  An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License.  If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
-  1. Source Code.
-
-  The "source code" for a work means the preferred form of the work
-for making modifications to it.  "Object code" means any non-source
-form of a work.
-
-  A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
-  The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form.  A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
-  The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities.  However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work.  For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
-  The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
-  The Corresponding Source for a work in source code form is that
-same work.
-
-  2. Basic Permissions.
-
-  All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met.  This License explicitly affirms your unlimited
-permission to run the unmodified Program.  The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work.  This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
-  You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force.  You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright.  Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
-  Conveying under any other circumstances is permitted solely under
-the conditions stated below.  Sublicensing is not allowed; section 10
-makes it unnecessary.
-
-  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
-  No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
-  When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
-  4. Conveying Verbatim Copies.
-
-  You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
-  You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
-  5. Conveying Modified Source Versions.
-
-  You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
-    a) The work must carry prominent notices stating that you modified
-    it, and giving a relevant date.
-
-    b) The work must carry prominent notices stating that it is
-    released under this License and any conditions added under section
-    7.  This requirement modifies the requirement in section 4 to
-    "keep intact all notices".
-
-    c) You must license the entire work, as a whole, under this
-    License to anyone who comes into possession of a copy.  This
-    License will therefore apply, along with any applicable section 7
-    additional terms, to the whole of the work, and all its parts,
-    regardless of how they are packaged.  This License gives no
-    permission to license the work in any other way, but it does not
-    invalidate such permission if you have separately received it.
-
-    d) If the work has interactive user interfaces, each must display
-    Appropriate Legal Notices; however, if the Program has interactive
-    interfaces that do not display Appropriate Legal Notices, your
-    work need not make them do so.
-
-  A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit.  Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
-  6. Conveying Non-Source Forms.
-
-  You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
-    a) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by the
-    Corresponding Source fixed on a durable physical medium
-    customarily used for software interchange.
-
-    b) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by a
-    written offer, valid for at least three years and valid for as
-    long as you offer spare parts or customer support for that product
-    model, to give anyone who possesses the object code either (1) a
-    copy of the Corresponding Source for all the software in the
-    product that is covered by this License, on a durable physical
-    medium customarily used for software interchange, for a price no
-    more than your reasonable cost of physically performing this
-    conveying of source, or (2) access to copy the
-    Corresponding Source from a network server at no charge.
-
-    c) Convey individual copies of the object code with a copy of the
-    written offer to provide the Corresponding Source.  This
-    alternative is allowed only occasionally and noncommercially, and
-    only if you received the object code with such an offer, in accord
-    with subsection 6b.
-
-    d) Convey the object code by offering access from a designated
-    place (gratis or for a charge), and offer equivalent access to the
-    Corresponding Source in the same way through the same place at no
-    further charge.  You need not require recipients to copy the
-    Corresponding Source along with the object code.  If the place to
-    copy the object code is a network server, the Corresponding Source
-    may be on a different server (operated by you or a third party)
-    that supports equivalent copying facilities, provided you maintain
-    clear directions next to the object code saying where to find the
-    Corresponding Source.  Regardless of what server hosts the
-    Corresponding Source, you remain obligated to ensure that it is
-    available for as long as needed to satisfy these requirements.
-
-    e) Convey the object code using peer-to-peer transmission, provided
-    you inform other peers where the object code and Corresponding
-    Source of the work are being offered to the general public at no
-    charge under subsection 6d.
-
-  A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
-  A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling.  In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage.  For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product.  A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
-  "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source.  The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
-  If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information.  But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
-  The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed.  Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
-  Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
-  7. Additional Terms.
-
-  "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law.  If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
-  When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it.  (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.)  You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
-  Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
-    a) Disclaiming warranty or limiting liability differently from the
-    terms of sections 15 and 16 of this License; or
-
-    b) Requiring preservation of specified reasonable legal notices or
-    author attributions in that material or in the Appropriate Legal
-    Notices displayed by works containing it; or
-
-    c) Prohibiting misrepresentation of the origin of that material, or
-    requiring that modified versions of such material be marked in
-    reasonable ways as different from the original version; or
-
-    d) Limiting the use for publicity purposes of names of licensors or
-    authors of the material; or
-
-    e) Declining to grant rights under trademark law for use of some
-    trade names, trademarks, or service marks; or
-
-    f) Requiring indemnification of licensors and authors of that
-    material by anyone who conveys the material (or modified versions of
-    it) with contractual assumptions of liability to the recipient, for
-    any liability that these contractual assumptions directly impose on
-    those licensors and authors.
-
-  All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10.  If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term.  If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
-  If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
-  Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
-  8. Termination.
-
-  You may not propagate or modify a covered work except as expressly
-provided under this License.  Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
-  However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
-  Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-  Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License.  If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
-  9. Acceptance Not Required for Having Copies.
-
-  You are not required to accept this License in order to receive or
-run a copy of the Program.  Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance.  However,
-nothing other than this License grants you permission to propagate or
-modify any covered work.  These actions infringe copyright if you do
-not accept this License.  Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
-  10. Automatic Licensing of Downstream Recipients.
-
-  Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License.  You are not responsible
-for enforcing compliance by third parties with this License.
-
-  An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations.  If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
-  You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License.  For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
-  11. Patents.
-
-  A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based.  The
-work thus licensed is called the contributor's "contributor version".
-
-  A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version.  For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
-  Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
-  In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement).  To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
-  If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients.  "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
-  If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
-  A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License.  You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
-  Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
-  12. No Surrender of Others' Freedom.
-
-  If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all.  For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
-  13. Use with the GNU Affero General Public License.
-
-  Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work.  The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
-  14. Revised Versions of this License.
-
-  The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-  Each version is given a distinguishing version number.  If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation.  If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
-  If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
-  Later license versions may give you additional or different
-permissions.  However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
-  15. Disclaimer of Warranty.
-
-  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. Limitation of Liability.
-
-  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
-  17. Interpretation of Sections 15 and 16.
-
-  If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-  If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
-    <program>  Copyright (C) <year>  <name of author>
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
-  You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
-  The GNU General Public License does not permit incorporating your program
-into proprietary programs.  If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.  But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/openair1/MAC_INTERFACE/Makefile.inc b/openair1/MAC_INTERFACE/Makefile.inc
deleted file mode 100644
index 5dcd2a3ffe8cab7618aa97c083bce1f369ce38e7..0000000000000000000000000000000000000000
--- a/openair1/MAC_INTERFACE/Makefile.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-#MAC_XFACE_OBJS = $(OPENAIR1_TOP)/MAC_INTERFACE/register.o
-MAC_XFACE_OBJS += $(OPENAIR1_TOP)/MAC_INTERFACE/init.o
diff --git a/openair1/MAC_INTERFACE/defs.h b/openair1/MAC_INTERFACE/defs.h
deleted file mode 100755
index dbaab57fcc5fff946067431d63612426cdcd5613..0000000000000000000000000000000000000000
--- a/openair1/MAC_INTERFACE/defs.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
-    OpenAirInterface
-    Copyright(c) 1999 - 2014 Eurecom
-
-    OpenAirInterface is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-
-    OpenAirInterface is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with OpenAirInterface.The full GNU General Public License is
-   included in this distribution in the file called "COPYING". If not,
-   see <http://www.gnu.org/licenses/>.
-
-  Contact Information
-  OpenAirInterface Admin: openair_admin@eurecom.fr
-  OpenAirInterface Tech : openair_tech@eurecom.fr
-  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
-
-  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
-
- *******************************************************************************/
-/*________________________mac_defs.h________________________
-
- Authors : Hicham Anouar, Raymond Knopp
- Company : EURECOM
- Emails  : anouar@eurecom.fr,  knopp@eurecom.fr
- ________________________________________________________________*/
-
-#ifndef __MAC_INTERFACE_DEFS_H__
-#define __MAC_INTERFACE_DEFS_H__
-
-
-#include "PHY_INTERFACE/defs.h"
-
-#endif
diff --git a/openair1/MAC_INTERFACE/extern.h b/openair1/MAC_INTERFACE/extern.h
deleted file mode 100755
index a7444939eee33837f6a8a0a20ea47fc3f14eac4f..0000000000000000000000000000000000000000
--- a/openair1/MAC_INTERFACE/extern.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
-    OpenAirInterface
-    Copyright(c) 1999 - 2014 Eurecom
-
-    OpenAirInterface is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-
-    OpenAirInterface is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with OpenAirInterface.The full GNU General Public License is
-   included in this distribution in the file called "COPYING". If not,
-   see <http://www.gnu.org/licenses/>.
-
-  Contact Information
-  OpenAirInterface Admin: openair_admin@eurecom.fr
-  OpenAirInterface Tech : openair_tech@eurecom.fr
-  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
-
-  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
-
- *******************************************************************************/
-/*________________________mac_extern.h________________________
-
- Authors : Hicham Anouar, Raymond Knopp
- Company : EURECOM
- Emails  : anouar@eurecom.fr,  knopp@eurecom.fr
-________________________________________________________________*/
-
-
-/*! \file mac_extern.h
-* \brief Generic mac interface external variable definitions
-* \author R. Knopp
-* \date March 2006
-* \note
-* \warning
-* @ingroup macxface
-*/
-
-#ifndef __MAC_INTERFACE_EXTERN_H__
-#define __MAC_INTERFACE_EXTERN_H__
-
-#include "defs.h"
-
-
-extern MAC_xface *mac_xface;
-
-
-#endif /*__MAC_INTERFACE_EXTERN_H__ */
diff --git a/openair1/MAC_INTERFACE/init.c b/openair1/MAC_INTERFACE/init.c
deleted file mode 100644
index 480d365f099b8c7c58811f9e9d7eda2aec35844a..0000000000000000000000000000000000000000
--- a/openair1/MAC_INTERFACE/init.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
-    OpenAirInterface
-    Copyright(c) 1999 - 2014 Eurecom
-
-    OpenAirInterface is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-
-    OpenAirInterface is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with OpenAirInterface.The full GNU General Public License is
-   included in this distribution in the file called "COPYING". If not,
-   see <http://www.gnu.org/licenses/>.
-
-  Contact Information
-  OpenAirInterface Admin: openair_admin@eurecom.fr
-  OpenAirInterface Tech : openair_tech@eurecom.fr
-  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
-
-  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
-
- *******************************************************************************/
-/*________________________mac_init.c________________________
-
- Authors : Hicham Anouar, Raymond Knopp
- Company : EURECOM
- Emails  : anouar@eurecom.fr,  knopp@eurecom.fr
-________________________________________________________________*/
-
-/*!\brief Initilization and reconfiguration routines for generic MAC interface */
-
-#include "defs.h"
-#include "extern.h"
-#include "SCHED/defs.h"
-
-int mac_init(void)
-{
-  int i;
-
-#ifndef USER_MODE
-  // mac_xface->macphy_init();
-  mac_xface->macphy_exit = openair_sched_exit;
-#else
-  mac_xface->macphy_exit=(void (*)(void)) exit;
-#endif
-
-  /* this is done in cbmimo1_fileops
-  #ifdef OPENAIR2
-  mac_xface->macphy_init();
-  #endif //OPENAIR2
-  */
-
-  return(1);
-}
-
-void mac_cleanup(void)
-{
-
-}
-
-void mac_resynch(void)
-{
-
-}
-
-/*
-#ifdef OPENAIR2
-EXPORT_SYMBOL(frame);
-#endif //OPENAIR2
-*/
diff --git a/openair1/MAC_INTERFACE/register.c b/openair1/MAC_INTERFACE/register.c
deleted file mode 100644
index 0c3c611817296a812313fdc93ab781d6690aecb6..0000000000000000000000000000000000000000
--- a/openair1/MAC_INTERFACE/register.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
-    OpenAirInterface
-    Copyright(c) 1999 - 2014 Eurecom
-
-    OpenAirInterface is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-
-    OpenAirInterface is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with OpenAirInterface.The full GNU General Public License is
-   included in this distribution in the file called "COPYING". If not,
-   see <http://www.gnu.org/licenses/>.
-
-  Contact Information
-  OpenAirInterface Admin: openair_admin@eurecom.fr
-  OpenAirInterface Tech : openair_tech@eurecom.fr
-  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
-
-  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
-
- *******************************************************************************/
-/*________________________mac_register.c________________________
-
- Authors : Hicham Anouar, Raymond Knopp
- Company : EURECOM
- Emails  : anouar@eurecom.fr,  knopp@eurecom.fr
-________________________________________________________________*/
-
-
-/*!\brief Registration routines for generic MAC interface.  Register/unregister a MAC.
-Upon registration, the MAC retrieves the transport channel (MAC_tch) data structure and provides the
-pointer to the macphy_scheduler() routine*/
-#define __NO_VERSION__
-
-#undef __PHY_IMPLEMENTATION_DEFS_H__
-
-#include "ARCH/CBMIMO1/DEVICE_DRIVER/defs.h"
-#include "defs.h"
-#include "extern.h"
-#include "SCHED/extern.h"
-
-#ifndef USER_MODE
-
-
-
-
-
-void dummy_macphy_scheduler(uint8_t last_slot)
-{
-  //if (last_slot == 0)
-  //  mac_xface->frame++;
-
-  msg("[OPENAIR][MAC XFACE] in dummy_macphy_scheduler(): MAC no yet registered!\n");
-
-  //#ifdef EMOS
-  //  phy_procedures(last_slot);
-  //#endif
-
-}
-
-void dummy_macphy_setparams(void *params)
-{
-  msg("[OPENAIR][MAC XFACE] dummy_macphy_setparams(): no MAC registered!\n");
-}
-
-void dummy_macphy_init(void )
-{
-  msg("[OPENAIR][MAC XFACE] dummy_macphy_init(): no MAC registered!\n");
-}
-
-MAC_xface *mac_register(void macphy_scheduler(uint8_t last_slot), void macphy_setparams(void *),void macphy_init(void ),void mrbch_phy_sync_failure(unsigned char,unsigned char),
-                        void chbch_phy_sync_success(unsigned char,unsigned char))
-{
-
-  if (openair_daq_vars.mac_registered == 0) {
-
-    msg("[OPENAIR][MAC XFACE] Registering new MAC interface at %p, scheduler %p, setparams at %p, init at %p\n",
-        mac_xface,macphy_scheduler,macphy_setparams,macphy_init);
-    mac_xface->macphy_scheduler = macphy_scheduler;
-    mac_xface->macphy_setparams = macphy_setparams;
-    mac_xface->macphy_init      = macphy_init;
-#ifndef PC_TARGET
-    //    mac_xface->ublaze_mac_xface = ublaze_mac_xface;
-#endif
-    openair_daq_vars.mac_registered=1;
-    return(mac_xface);
-  } else {
-    msg("[OPENAIR][MAC XFACE] MAC interface already registered, aborting ...\n");
-    return NULL;
-  }
-
-
-}
-
-int mac_unregister(MAC_xface *mac_xface_rx)
-{
-
-  if (mac_xface_rx == mac_xface) {
-    msg("[OPENAIR][MAC XFACE] Unregistering MAC interface\n");
-    mac_xface->macphy_scheduler = dummy_macphy_scheduler;
-    mac_xface->macphy_setparams = dummy_macphy_setparams;
-    mac_xface->macphy_init      = dummy_macphy_init;
-    openair_daq_vars.mac_registered=0;
-    return(0);
-  } else {
-    msg("[OPENAIR][MAC XFACE] Not the right interface descriptor pointer!!!, aborting ...\n");
-    return (-1);
-  }
-
-}
-
-EXPORT_SYMBOL(mac_register);
-EXPORT_SYMBOL(mac_unregister);
-#endif //USER_MODE
diff --git a/openair1/MAC_INTERFACE/vars.h b/openair1/MAC_INTERFACE/vars.h
deleted file mode 100755
index e3ef7f6ab18bb7dad4376df62679f7562a941e4a..0000000000000000000000000000000000000000
--- a/openair1/MAC_INTERFACE/vars.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
-    OpenAirInterface
-    Copyright(c) 1999 - 2014 Eurecom
-
-    OpenAirInterface is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-
-    OpenAirInterface is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with OpenAirInterface.The full GNU General Public License is
-   included in this distribution in the file called "COPYING". If not,
-   see <http://www.gnu.org/licenses/>.
-
-  Contact Information
-  OpenAirInterface Admin: openair_admin@eurecom.fr
-  OpenAirInterface Tech : openair_tech@eurecom.fr
-  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
-
-  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
-
- *******************************************************************************/
-/*________________________mac_vars.h________________________
-
- Authors : Hicham Anouar, Raymond Knopp
- Company : EURECOM
- Emails  : anouar@eurecom.fr,  knopp@eurecom.fr
-________________________________________________________________*/
-
-
-/*! \file mac_vars.h
-* \brief generic mac interface variable definitions
-* \author R. Knopp
-* \version 1
-* \date March 2006
-*  @ingroup macxface
-*/
-
-#ifndef __MAC_INTERFACE_VARS_H__
-#define __MAC_INTERFACE_VARS_H__
-
-#include "defs.h"
-
-MAC_xface *mac_xface;
-
-#endif //__MAC_INTERFACE_VARS_H__
diff --git a/openair1/PHY/CODING/3gpplte_sse.c b/openair1/PHY/CODING/3gpplte_sse.c
index 41c0f65dc35f15dfa5e6f1d83a8fae39f0fa1d8c..34fcbef6d65485502023d43bdaae9c31de1b9fe4 100755
--- a/openair1/PHY/CODING/3gpplte_sse.c
+++ b/openair1/PHY/CODING/3gpplte_sse.c
@@ -37,6 +37,7 @@
 #include "extern_3GPPinterleaver.h"
 #else
 #include "vars.h"
+#include <stdint.h>
 #endif
 #include <stdio.h>
 #include <string.h>
@@ -48,6 +49,7 @@
 #define print_shorts(s,x) printf("%s %x,%x,%x,%x,%x,%x,%x,%x\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7])
 #define print_ints(s,x) printf("%s %x %x %x %x\n",s,(x)[0],(x)[1],(x)[2],(x)[3])
 
+#define print_bytes2(s,x) printf("%s %x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x,%x\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7],(x)[8],(x)[9],(x)[10],(x)[11],(x)[12],(x)[13],(x)[14],(x)[15],(x)[16],(x)[17],(x)[18],(x)[19],(x)[20],(x)[21],(x)[22],(x)[23],(x)[24],(x)[25],(x)[26],(x)[27],(x)[28],(x)[29],(x)[30],(x)[31])
 
 //#define DEBUG_TURBO_ENCODER 1
 #define CALLGRIND 1
@@ -57,16 +59,12 @@ unsigned long long threegpplte_interleaver_tmp;
 #if defined(__x86_64__) || defined(__i386__)
 struct treillis {
   union {
-    __m64 systematic_64[3];
-    char systematic_8[24];
-  };
-  union {
-    __m64 parity1_64[3];
-    char parity1_8[24];
+    __m64 systematic_andp1_64[3];
+    uint8_t systematic_andp1_8[24];
   };
   union {
     __m64 parity2_64[3];
-    char parity2_8[24];
+    uint8_t parity2_8[24];
   };
   int exit_state;
 }  __attribute__ ((aligned(64)));
@@ -75,12 +73,8 @@ struct treillis {
 
 struct treillis {
   union {
-    uint8x8_t systematic_64[3];
-    char systematic_8[24];
-  }__attribute__((aligned(64)));
-  union {
-    uint8x8_t parity1_64[3];
-    char parity1_8[24];
+    uint8x8_t systematic_andp1_64[3];
+    char systematic_andp1_8[24];
   }__attribute__((aligned(64)));
   union {
     uint8x8_t parity2_64[3];
@@ -91,6 +85,7 @@ struct treillis {
 #endif
 
 struct treillis all_treillis[8][256];
+
 int all_treillis_initialized=0;
 
 static inline unsigned char threegpplte_rsc(unsigned char input,unsigned char *state)
@@ -116,18 +111,20 @@ void treillis_table_init(void)
   unsigned char v, current_state;
 
   // clear all_treillis
-  for (i=0; i<8; i++)
+  for (i=0; i<8; i++) {
     bzero( all_treillis[i], sizeof(all_treillis[0]) );
+  }
 
   for (i=0; i<8; i++) { //all possible initial states
     for (j=0; j<=255; j++) { // all possible values of a byte
       current_state=i;
 
       for (b=0; b<8 ; b++ ) { // pre-compute the image of the byte j in _m128i vector right place
-        all_treillis[i][j].systematic_8[b*3]= (j&(1<<(7-b)))>>(7-b);
-        v=threegpplte_rsc( all_treillis[i][j].systematic_8[b*3] ,
+        all_treillis[i][j].systematic_andp1_8[b*3]= (j&(1<<(7-b)))>>(7-b);
+        v=threegpplte_rsc( all_treillis[i][j].systematic_andp1_8[b*3] ,
                            &current_state);
-        all_treillis[i][j].parity1_8[b*3+1]=v; // for the yparity1
+	all_treillis[i][j].systematic_andp1_8[b*3+1]=v; // for the yparity1
+	//        all_treillis[i][j].parity1_8[b*3+1]=v; // for the yparity1
         all_treillis[i][j].parity2_8[b*3+2]=v; // for the yparity2
       }
 
@@ -143,9 +140,10 @@ void treillis_table_init(void)
 char interleave_compact_byte(short * base_interleaver,unsigned char * input, unsigned char * output, int n)
 {
 
-  char expandInput[768*8] __attribute__((aligned(16)));
+  char expandInput[768*8] __attribute__((aligned(32)));
   int i,loop=n>>4;
 #if defined(__x86_64__) || defined(__i386__)
+#ifndef __AVX2__
   __m128i *i_128=(__m128i *)input, *o_128=(__m128i*)expandInput;
   __m128i tmp1, tmp2, tmp3, tmp4;
   __m128i BIT_MASK = _mm_set_epi8(  0b00000001,
@@ -164,6 +162,43 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
                                     0b00100000,
                                     0b01000000,
                                     0b10000000);
+
+#else
+  __m256i *i_256=(__m256i *)input, *o_256=(__m256i*)expandInput;
+  __m256i tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
+  __m256i BIT_MASK = _mm256_set_epi8(  0b00000001,
+				       0b00000010,
+				       0b00000100,
+				       0b00001000,
+				       0b00010000,
+				       0b00100000,
+				       0b01000000,
+				       0b10000000,
+				       0b00000001,
+				       0b00000010,
+				       0b00000100,
+				       0b00001000,
+				       0b00010000,
+				       0b00100000,
+				       0b01000000,
+				       0b10000000,
+				       0b00000001,
+				       0b00000010,
+				       0b00000100,
+				       0b00001000,
+				       0b00010000,
+				       0b00100000,
+				       0b01000000,
+				       0b10000000,
+				       0b00000001,
+				       0b00000010,
+				       0b00000100,
+				       0b00001000,
+				       0b00010000,
+				       0b00100000,
+				       0b01000000,
+				       0b10000000);
+#endif
 #elif defined(__arm__)
   uint8x16_t *i_128=(uint8x16_t *)input, *o_128=(uint8x16_t *)expandInput;
   uint8x16_t tmp1,tmp2;
@@ -187,46 +222,126 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
                                     0b00000010,
                                     0b00000001};
 #endif
+ 
+
+#ifndef __AVX2__
   if ((n&15) > 0)
     loop++;
+#else
+  loop=n>>5;
+  if ((n&31) > 0)
+    loop++;
+#endif
 
+  
   for (i=0; i<loop ; i++ ) {
-    /* int cur_byte=i<<3; */
-    /* for (b=0;b<8;b++) */
-    /*   expandInput[cur_byte+b] = (input[i]&(1<<(7-b)))>>(7-b); */
+    // int cur_byte=i<<3; 
+    // for (b=0;b<8;b++) 
+    //   expandInput[cur_byte+b] = (input[i]&(1<<(7-b)))>>(7-b); 
 
 #if defined(__x86_64__) || defined(__i386__)
-    tmp1=_mm_load_si128(i_128++);
-    tmp2=_mm_unpacklo_epi8(tmp1,tmp1);
-    tmp3=_mm_unpacklo_epi16(tmp2,tmp2);
-    tmp4=_mm_unpacklo_epi32(tmp3,tmp3);
+#ifndef __AVX2__
+    tmp1=_mm_load_si128(i_128++);       // tmp1 = B0,B1,...,B15
+    tmp2=_mm_unpacklo_epi8(tmp1,tmp1);  // tmp2 = B0,B0,B1,B1,...,B7,B7
+    tmp3=_mm_unpacklo_epi16(tmp2,tmp2); // tmp3 = B0,B0,B0,B0,B1,B1,B1,B1,B2,B2,B2,B2,B3,B3,B3,B3
+    tmp4=_mm_unpacklo_epi32(tmp3,tmp3); // tmp4 - B0,B0,B0,B0,B0,B0,B0,B0,B1,B1,B1,B1,B1,B1,B1,B1
     *o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);
 
-    tmp4=_mm_unpackhi_epi32(tmp3,tmp3);
+    tmp4=_mm_unpackhi_epi32(tmp3,tmp3); // tmp4 - B2,B2,B2,B2,B2,B2,B2,B2,B3,B3,B3,B3,B3,B3,B3,B3
     *o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
 
-    tmp3=_mm_unpackhi_epi16(tmp2,tmp2);
-    tmp4=_mm_unpacklo_epi32(tmp3,tmp3);
+    tmp3=_mm_unpackhi_epi16(tmp2,tmp2); // tmp3 = B4,B4,B4,B4,B5,B5,B5,B5,B6,B6,B6,B6,B7,B7,B7,B7
+    tmp4=_mm_unpacklo_epi32(tmp3,tmp3); // tmp4 - B4,B4,B4,B4,B4,B4,B4,B4,B5,B5,B5,B5,B5,B5,B5,B5
     *o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
 
-    tmp4=_mm_unpackhi_epi32(tmp3,tmp3);
+    tmp4=_mm_unpackhi_epi32(tmp3,tmp3); // tmp4 - B6,B6,B6,B6,B6,B6,B6,B6,B7,B7,B7,B7,B7,B7,B7,B7
     *o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
 
-    tmp2=_mm_unpackhi_epi8(tmp1,tmp1);
-    tmp3=_mm_unpacklo_epi16(tmp2,tmp2);
-    tmp4=_mm_unpacklo_epi32(tmp3,tmp3);
+    tmp2=_mm_unpackhi_epi8(tmp1,tmp1);  // tmp2 = B8,B8,B9,B9,...,B15,B15
+    tmp3=_mm_unpacklo_epi16(tmp2,tmp2); // tmp3 = B8,B8,B8,B8,B9,B9,B9,B9,B10,B10,B10,B10,B11,B11,B11,B11
+    tmp4=_mm_unpacklo_epi32(tmp3,tmp3); // tmp4 = B8,B8,B8,B8,B8,B8,B8,B8,B9,B9,B9,B9,B9,B9,B9,B9
     *o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
 
-    tmp4=_mm_unpackhi_epi32(tmp3,tmp3);
+    tmp4=_mm_unpackhi_epi32(tmp3,tmp3); // tmp4 = B10,B10,B10,B10,B10,B10,B10,B10,B11,B11,B11,B11,B11,B11,B11,B11
     *o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
 
-    tmp3=_mm_unpackhi_epi16(tmp2,tmp2);
-    tmp4=_mm_unpacklo_epi32(tmp3,tmp3);
+    tmp3=_mm_unpackhi_epi16(tmp2,tmp2); // tmp3 = B12,B12,B12,B12,B13,B13,B13,B13,B14,B14,B14,B14,B15,B15,B15,B15
+    tmp4=_mm_unpacklo_epi32(tmp3,tmp3); // tmp4 = B12,B12,B12,B12,B12,B12,B12,B12,B13,B13,B13,B13,B13,B13,B13,B13
     *o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
 
-    tmp4=_mm_unpackhi_epi32(tmp3,tmp3);
+    tmp4=_mm_unpackhi_epi32(tmp3,tmp3); // tmp4 = B14,B14,B14,B14,B14,B14,B14,B14,B15,B15,B15,B15,B15,B15,B15,B15
     *o_128++=_mm_cmpeq_epi8(_mm_and_si128(tmp4,BIT_MASK),BIT_MASK);;
-
+#else
+    tmp1=_mm256_load_si256(i_256++);       // tmp1 = B0,B1,...,B15,...,B31
+    //print_bytes2("in",(uint8_t*)&tmp1);
+    tmp2=_mm256_unpacklo_epi8(tmp1,tmp1);  // tmp2 = B0,B0,B1,B1,...,B7,B7,B16,B16,B17,B17,...,B23,B23
+    tmp3=_mm256_unpacklo_epi16(tmp2,tmp2); // tmp3 = B0,B0,B0,B0,B1,B1,B1,B1,B2,B2,B2,B2,B3,B3,B3,B3,B16,B16,B16,B16,...,B19,B19,B19,B19
+    tmp4=_mm256_unpacklo_epi32(tmp3,tmp3); // tmp4 - B0,B0,B0,B0,B0,B0,B0,B0,B1,B1,B1,B1,B1,B1,B1,B1,B16,B16...,B17..,B17
+    tmp5=_mm256_unpackhi_epi32(tmp3,tmp3); // tmp5 - B2,B2,B2,B2,B2,B2,B2,B2,B3,B3,B3,B3,B3,B3,B3,B3,B18...,B18,B19,...,B19
+    tmp6=_mm256_insertf128_si256(tmp4,_mm256_extracti128_si256(tmp5,0),1);  // tmp6 = B0 B1 B2 B3
+    tmp7=_mm256_insertf128_si256(tmp5,_mm256_extracti128_si256(tmp4,1),0);  // tmp7 = B16 B17 B18 B19
+    //print_bytes2("tmp2",(uint8_t*)&tmp2);
+    //print_bytes2("tmp3",(uint8_t*)&tmp3);
+    //print_bytes2("tmp4",(uint8_t*)&tmp4);
+    //print_bytes2("tmp5",(uint8_t*)&tmp4);
+    //print_bytes2("tmp6",(uint8_t*)&tmp6);
+    //print_bytes2("tmp7",(uint8_t*)&tmp7);
+    o_256[0]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp6,BIT_MASK),BIT_MASK);
+    //print_bytes2("out",(uint8_t*)o_256);
+    o_256[4]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp7,BIT_MASK),BIT_MASK);;
+    //print_bytes2("out",(uint8_t*)(o_256+4));
+
+    tmp3=_mm256_unpackhi_epi16(tmp2,tmp2); // tmp3 = B4,B4,B4,B4,B5,B5,B5,B5,B6,B6,B6,B6,B7,B7,B7,B7,B20,B20,B20,B20,...,B23,B23,B23,B23
+    tmp4=_mm256_unpacklo_epi32(tmp3,tmp3); // tmp4 - B4,B4,B4,B4,B4,B4,B4,B4,B5,B5,B5,B5,B5,B5,B5,B5,B20,B20...,B21..,B21
+    tmp5=_mm256_unpackhi_epi32(tmp3,tmp3); // tmp5 - B6,B6,B6,B6,B6,B6,B6,B6,B7,B7,B7,B7,B7,B7,B7,B7,B22...,B22,B23,...,B23
+    tmp6=_mm256_insertf128_si256(tmp4,_mm256_extracti128_si256(tmp5,0),1);  // tmp6 = B4 B5 B6 B7
+    tmp7=_mm256_insertf128_si256(tmp5,_mm256_extracti128_si256(tmp4,1),0);  // tmp7 = B20 B21 B22 B23
+    //print_bytes2("tmp2",(uint8_t*)&tmp2);
+    //print_bytes2("tmp3",(uint8_t*)&tmp3);
+    //print_bytes2("tmp4",(uint8_t*)&tmp4);
+    //print_bytes2("tmp5",(uint8_t*)&tmp4);
+    //print_bytes2("tmp6",(uint8_t*)&tmp6);
+    //print_bytes2("tmp7",(uint8_t*)&tmp7);
+    o_256[1]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp6,BIT_MASK),BIT_MASK);
+    //print_bytes2("out",(uint8_t*)(o_256+1));
+    o_256[5]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp7,BIT_MASK),BIT_MASK);;
+    //print_bytes2("out",(uint8_t*)(o_256+4));
+
+    tmp2=_mm256_unpackhi_epi8(tmp1,tmp1);  // tmp2 = B8 B9 B10 B11 B12 B13 B14 B15 B25 B26 B27 B28 B29 B30 B31
+    tmp3=_mm256_unpacklo_epi16(tmp2,tmp2); // tmp3 = B8,B9,B10,B11,B26,B27,B28,B29
+    tmp4=_mm256_unpacklo_epi32(tmp3,tmp3); // tmp4 - B8,B9,B26,B27
+    tmp5=_mm256_unpackhi_epi32(tmp3,tmp3); // tmp5 - B10,B11,B28,B29
+    tmp6=_mm256_insertf128_si256(tmp4,_mm256_extracti128_si256(tmp5,0),1);  // tmp6 = B8 B9 B10 B11
+    tmp7=_mm256_insertf128_si256(tmp5,_mm256_extracti128_si256(tmp4,1),0);  // tmp7 = B26 B27 B28 B29
+    //print_bytes2("tmp2",(uint8_t*)&tmp2);
+    //print_bytes2("tmp3",(uint8_t*)&tmp3);
+    //print_bytes2("tmp4",(uint8_t*)&tmp4);
+    //print_bytes2("tmp5",(uint8_t*)&tmp4);
+    //print_bytes2("tmp6",(uint8_t*)&tmp6);
+    //print_bytes2("tmp7",(uint8_t*)&tmp7);
+    o_256[2]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp6,BIT_MASK),BIT_MASK);
+    //print_bytes2("out",(uint8_t*)(o_256+2));
+    o_256[6]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp7,BIT_MASK),BIT_MASK);;
+    //print_bytes2("out",(uint8_t*)(o_256+4));
+
+    tmp3=_mm256_unpackhi_epi16(tmp2,tmp2); // tmp3 = B12 B13 B14 B15 B28 B29 B30 B31
+    tmp4=_mm256_unpacklo_epi32(tmp3,tmp3); // tmp4 = B12 B13 B28 B29
+    tmp5=_mm256_unpackhi_epi32(tmp3,tmp3); // tmp5 = B14 B15 B30 B31 
+    tmp6=_mm256_insertf128_si256(tmp4,_mm256_extracti128_si256(tmp5,0),1);  // tmp6 = B12 B13 B14 B15 
+    tmp7=_mm256_insertf128_si256(tmp5,_mm256_extracti128_si256(tmp4,1),0);  // tmp7 = B28 B29 B30 B31
+    //print_bytes2("tmp2",(uint8_t*)&tmp2);
+    //print_bytes2("tmp3",(uint8_t*)&tmp3);
+    //print_bytes2("tmp4",(uint8_t*)&tmp4);
+    //print_bytes2("tmp5",(uint8_t*)&tmp4);
+    //print_bytes2("tmp6",(uint8_t*)&tmp6);
+    //print_bytes2("tmp7",(uint8_t*)&tmp7);
+    o_256[3]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp6,BIT_MASK),BIT_MASK);
+    //print_bytes2("out",(uint8_t*)(o_256+3));
+    o_256[7]=_mm256_cmpeq_epi8(_mm256_and_si256(tmp7,BIT_MASK),BIT_MASK);;
+    //print_bytes2("out",(uint8_t*)(o_256+7));
+
+    o_256+=8;
+#endif
 #elif defined(__arm__)
     tmp1=vld1q_u8((uint8_t*)i_128);
     //print_bytes("tmp1:",(uint8_t*)&tmp1);
@@ -302,11 +417,17 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
     i_128++;
 #endif
   }
+  
 
   short * ptr_intl=base_interleaver;
 #if defined(__x86_64) || defined(__i386__)
+#ifndef __AVX2__
   __m128i tmp;
- uint16_t *systematic2_ptr=(unsigned short *) output;
+ uint16_t *systematic2_ptr=(uint16_t *) output;
+#else
+  __m256i tmp;
+ uint32_t *systematic2_ptr=(uint32_t *) output;
+#endif
 #elif defined(__arm__)
   uint8x16_t tmp;
   const uint8_t __attribute__ ((aligned (16))) _Powers[16]= 
@@ -316,11 +437,15 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
   uint8x16_t Powers= vld1q_u8(_Powers);
   uint8_t *systematic2_ptr=(uint8_t *) output;
 #endif
-  int input_length_words=n>>1;
-
+#ifndef __AVX2__
+  int input_length_words=1+((n-1)>>1);
+#else
+  int input_length_words=1+((n-1)>>2);
+#endif 
   for ( i=0; i<  input_length_words ; i ++ ) {
 
 #if defined(__x86_64__) || defined(__i386__)
+#ifndef __AVX2__
     tmp=_mm_insert_epi8(tmp,expandInput[*ptr_intl++],7);
     tmp=_mm_insert_epi8(tmp,expandInput[*ptr_intl++],6);
     tmp=_mm_insert_epi8(tmp,expandInput[*ptr_intl++],5);
@@ -338,6 +463,45 @@ char interleave_compact_byte(short * base_interleaver,unsigned char * input, uns
     tmp=_mm_insert_epi8(tmp,expandInput[*ptr_intl++],8+1);
     tmp=_mm_insert_epi8(tmp,expandInput[*ptr_intl++],8+0);
     *systematic2_ptr++=(unsigned short)_mm_movemask_epi8(tmp);
+#else
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],7);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],6);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],5);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],4);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],3);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],2);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],1);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],0);
+
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+7);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+6);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+5);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+4);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+3);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+2);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+1);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],8+0);
+
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+7);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+6);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+5);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+4);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+3);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+2);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+1);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],16+0);
+
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+7);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+6);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+5);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+4);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+3);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+2);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+1);
+    tmp=_mm256_insert_epi8(tmp,expandInput[*ptr_intl++],24+0);
+
+    *systematic2_ptr++=(unsigned int)_mm256_movemask_epi8(tmp);
+#endif
 #elif defined(__arm__)
     tmp=vsetq_lane_u8(expandInput[*ptr_intl++],tmp,7);
     tmp=vsetq_lane_u8(expandInput[*ptr_intl++],tmp,6);
@@ -391,8 +555,9 @@ void threegpplte_turbo_encoder(unsigned char *input,
   unsigned short input_length_bits = input_length_bytes<<3;
   short * base_interleaver;
 
-  if (  all_treillis_initialized == 0 )
+  if (  all_treillis_initialized == 0 ) {
     treillis_table_init();
+  }
 
   // look for f1 and f2 precomputed interleaver values
   for (i=0; i < 188 && f1f2mat[i].nb_bits != input_length_bits; i++);
@@ -405,7 +570,7 @@ void threegpplte_turbo_encoder(unsigned char *input,
   }
 
 
-  unsigned char systematic2[768];
+  unsigned char systematic2[768] __attribute__((aligned(32)));
   interleave_compact_byte(base_interleaver,input,systematic2,input_length_bytes);
 
 #if defined(__x86_64__) || defined(__i386__)
@@ -419,22 +584,26 @@ void threegpplte_turbo_encoder(unsigned char *input,
   for ( state0=state1=i=0 ; i<input_length_bytes; i++ ) {
     cur_s1=input[i];
     cur_s2=systematic2[i];
-
+      
     for ( code_rate=0; code_rate<3; code_rate++) {
 #if defined(__x86_64__) || defined(__i386__)
-      *ptr_output++ = _mm_add_pi8(all_treillis[state0][cur_s1].systematic_64[code_rate],
-                                  _mm_add_pi8(all_treillis[state0][cur_s1].parity1_64[code_rate],
-                                              all_treillis[state1][cur_s2].parity2_64[code_rate]));
+      /*
+       *ptr_output++ = _mm_add_pi8(all_treillis[state0][cur_s1].systematic_64[code_rate],
+       _mm_add_pi8(all_treillis[state0][cur_s1].parity1_64[code_rate],
+	 all_treillis[state1][cur_s2].parity2_64[code_rate]));
+	*/
+      *ptr_output++ = _mm_add_pi8(all_treillis[state0][cur_s1].systematic_andp1_64[code_rate],
+				  all_treillis[state1][cur_s2].parity2_64[code_rate]);
+	
+	
 #elif defined(__arm__)
-      uint8x8_t ptmp = vadd_u8(all_treillis[state0][cur_s1].parity1_64[code_rate],
-                               all_treillis[state1][cur_s2].parity2_64[code_rate]);
-      *ptr_output++ = vadd_u8(all_treillis[state0][cur_s1].systematic_64[code_rate],
-                              ptmp);
+	*ptr_output++ = vadd_u8(all_treillis[state0][cur_s1].systematic_andp1_64[code_rate],
+				all_treillis[state0][cur_s1].parity2_64[code_rate]);
 #endif
-    }
-
-    state0=all_treillis[state0][cur_s1].exit_state;
-    state1=all_treillis[state1][cur_s2].exit_state;
+      }
+      
+      state0=all_treillis[state0][cur_s1].exit_state;
+      state1=all_treillis[state1][cur_s2].exit_state;
   }
 
   x=output+(input_length_bits*3);
@@ -485,7 +654,7 @@ void threegpplte_turbo_encoder(unsigned char *input,
 int main(int argc,char **argv)
 {
 
-  unsigned char input[INPUT_LENGTH+16],state,state2;
+  unsigned char input[INPUT_LENGTH+32],state,state2;
   unsigned char output[12+(3*(INPUT_LENGTH<<3))],x,z;
   int i;
   unsigned char out;
@@ -510,7 +679,7 @@ int main(int argc,char **argv)
   memset((void*)input,0,INPUT_LENGTH+16);
   for (i=0; i<INPUT_LENGTH; i++) {
     input[i] = i*219;
-    printf("Input %d : %x\n",i,input[i]);
+    printf("Input %d : %d\n",i,input[i]);
   }
 
   threegpplte_turbo_encoder(&input[0],
diff --git a/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c b/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c
new file mode 100644
index 0000000000000000000000000000000000000000..24f399a2b20ce643ac2142f222cbbdae95176bef
--- /dev/null
+++ b/openair1/PHY/CODING/3gpplte_turbo_decoder_avx2_16bit.c
@@ -0,0 +1,1421 @@
+/*******************************************************************************
+    OpenAirInterface
+    Copyright(c) 1999 - 2014 Eurecom
+
+    OpenAirInterface is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+
+    OpenAirInterface is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenAirInterface.The full GNU General Public License is
+   included in this distribution in the file called "COPYING". If not,
+   see <http://www.gnu.org/licenses/>.
+
+  Contact Information
+  OpenAirInterface Admin: openair_admin@eurecom.fr
+  OpenAirInterface Tech : openair_tech@eurecom.fr
+  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+
+  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+ *******************************************************************************/
+/* file: 3gpplte_turbo_decoder_sse_16bit.c
+   purpose: Routines for implementing max-logmap decoding of Turbo-coded (DLSCH) transport channels from 36-212, V8.6 2009-03
+   authors: raymond.knopp@eurecom.fr, Laurent Thomas (Alcatel-Lucent)
+   date: 21.10.2009
+
+   Note: This version of the routine currently requires SSE2,SSSE3 and SSE4.1 equipped computers.  It uses 16-bit inputs for
+         LLRS and uses 16-bit arithmetic for the internal computations!
+
+   Changelog: 17.11.2009 FK SSE4.1 not required anymore
+   Aug. 2012 new parallelization options for higher speed (8-way parallelization)
+   Jan. 2013 8-bit LLR support with 16-way parallelization
+   Feb. 2013 New interleaving and hard-decision optimizations (L. Thomas)
+   May 2013 Extracted 16bit code
+*/
+
+///
+///
+
+#ifdef __AVX2__
+
+#include "PHY/sse_intrin.h"
+
+#ifndef TEST_DEBUG
+#include "PHY/defs.h"
+#include "PHY/CODING/defs.h"
+#include "PHY/CODING/lte_interleaver_inline.h"
+#include "extern_3GPPinterleaver.h"
+#else
+
+#include "defs.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#endif
+
+#ifdef MEX
+#include "mex.h"
+#endif
+
+
+//#define DEBUG_LOGMAP
+
+#ifdef DEBUG_LOGMAP
+#define print_shorts(s,x) fprintf(fdavx2,"%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7]);fprintf(fdavx2b,"%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[8],(x)[9],(x)[10],(x)[11],(x)[12],(x)[13],(x)[14],(x)[15])
+FILE *fdavx2,*fdavx2b;
+#else
+
+#endif
+
+
+#define print_bytes(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7],(x)[8],(x)[9],(x)[10],(x)[11],(x)[12],(x)[13],(x)[14],(x)[15],(x)[16],(x)[17],(x)[18],(x)[19],(x)[20],(x)[21],(x)[22],(x)[23],(x)[24],(x)[25],(x)[26],(x)[27],(x)[28],(x)[29],(x)[30],(x)[31])
+
+
+
+
+typedef int16_t llr_t; // internal decoder LLR data is 16-bit fixed
+typedef int16_t channel_t;
+#define MAX 256
+
+void log_map16avx2(llr_t* systematic,channel_t* y_parity, llr_t* m11, llr_t* m10, llr_t *alpha, llr_t *beta, llr_t* ext,uint16_t frame_length,unsigned char term_flag,unsigned char F,int offset8_flag,time_stats_t *alpha_stats,time_stats_t *beta_stats,time_stats_t *gamma_stats,time_stats_t *ext_stats);
+void compute_gamma16avx2(llr_t* m11,llr_t* m10,llr_t* systematic, channel_t* y_parity, uint16_t frame_length,unsigned char term_flag);
+void compute_alpha16avx2(llr_t*alpha,llr_t *beta, llr_t* m11,llr_t* m10, uint16_t frame_length,unsigned char F);
+void compute_beta16avx2(llr_t*alpha, llr_t* beta,llr_t* m11,llr_t* m10, uint16_t frame_length,unsigned char F,int offset8_flag);
+void compute_ext16avx2(llr_t* alpha,llr_t* beta,llr_t* m11,llr_t* m10,llr_t* extrinsic, llr_t* ap, uint16_t frame_length);
+
+
+void log_map16avx2(llr_t* systematic,
+		   channel_t* y_parity,
+		   llr_t* m11,
+		   llr_t* m10,
+		   llr_t *alpha,
+		   llr_t *beta,
+		   llr_t* ext,
+		   uint16_t frame_length,
+		   unsigned char term_flag,
+		   unsigned char F,
+		   int offset8_flag,
+		   time_stats_t *alpha_stats,
+		   time_stats_t *beta_stats,
+		   time_stats_t *gamma_stats,
+		   time_stats_t *ext_stats)
+{
+
+#ifdef DEBUG_LOGMAP
+  fprintf(fdavx2,"log_map (avx2_16bit), frame_length %d\n",frame_length);
+  fprintf(fdavx2b,"log_map (avx2_16bit), frame_length %d\n",frame_length);
+#endif
+
+  start_meas(gamma_stats) ;
+  compute_gamma16avx2(m11,m10,systematic,y_parity,frame_length,term_flag) ;
+  stop_meas(gamma_stats);
+  start_meas(alpha_stats) ;
+  compute_alpha16avx2(alpha,beta,m11,m10,frame_length,F)                  ;
+  stop_meas(alpha_stats);
+  start_meas(beta_stats)  ;
+  compute_beta16avx2(alpha,beta,m11,m10,frame_length,F,offset8_flag)      ;
+  stop_meas(beta_stats);
+  start_meas(ext_stats)   ;
+  compute_ext16avx2(alpha,beta,m11,m10,ext,systematic,frame_length)       ;
+  stop_meas(ext_stats);
+
+
+}
+
+void compute_gamma16avx2(llr_t* m11,llr_t* m10,llr_t* systematic,channel_t* y_parity,
+                     uint16_t frame_length,unsigned char term_flag)
+{
+  int k,K1;
+
+  __m256i *systematic128 = (__m256i *)systematic;
+  __m256i *y_parity128   = (__m256i *)y_parity;
+  __m256i *m10_128        = (__m256i *)m10;
+  __m256i *m11_128        = (__m256i *)m11;
+
+#ifdef DEBUG_LOGMAP
+  fprintf(fdavx2,"compute_gamma (avx2_16bit), %p,%p,%p,%p,framelength %d\n",m11,m10,systematic,y_parity,frame_length);
+  fprintf(fdavx2b,"compute_gamma (avx2_16bit), %p,%p,%p,%p,framelength %d\n",m11,m10,systematic,y_parity,frame_length);
+#endif
+
+  K1=frame_length>>3;
+
+  for (k=0; k<K1; k++) {
+    m11_128[k] = _mm256_srai_epi16(_mm256_adds_epi16(systematic128[k],y_parity128[k]),1);
+    m10_128[k] = _mm256_srai_epi16(_mm256_subs_epi16(systematic128[k],y_parity128[k]),1);
+#ifdef DEBUG_LOGMAP
+    fprintf(fdavx2,"Loop index k %d\n",k);
+    fprintf(fdavx2b,"Loop index k %d\n",k);
+    print_shorts("sys",(int16_t*)&systematic128[k]);
+    print_shorts("yp",(int16_t*)&y_parity128[k]);
+    print_shorts("m11",(int16_t*)&m11_128[k]);
+    print_shorts("m10",(int16_t*)&m10_128[k]);
+#endif
+  }
+
+  // Termination
+  m11_128[k] = _mm256_srai_epi16(_mm256_adds_epi16(systematic128[k+term_flag],y_parity128[k]),1);
+  m10_128[k] = _mm256_srai_epi16(_mm256_subs_epi16(systematic128[k+term_flag],y_parity128[k]),1);
+
+#ifdef DEBUG_LOGMAP
+  fprintf(fdavx2,"Loop index k %d (term flag %d)\n",k,term_flag);
+  fprintf(fdavx2b,"Loop index k %d (term flag %d)\n",k,term_flag);
+  print_shorts("sys",(int16_t*)&systematic128[k+term_flag]);
+  print_shorts("yp",(int16_t*)&y_parity128[k]);
+  print_shorts("m11",(int16_t*)&m11_128[k]);
+  print_shorts("m10",(int16_t*)&m10_128[k]);
+#endif
+}
+
+#define L 40
+
+void compute_alpha16avx2(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,uint16_t frame_length,unsigned char F)
+{
+  int k,l,l2,K1,rerun_flag=0;
+
+  __m256i *alpha128=(__m256i *)alpha,*alpha_ptr;
+  __m256i a0,a1,a2,a3,a4,a5,a6,a7,*m11p,*m10p;
+  __m256i m_b0,m_b1,m_b2,m_b3,m_b4,m_b5,m_b6,m_b7;
+  __m256i new0,new1,new2,new3,new4,new5,new6,new7;
+  __m256i alpha_max;
+
+  unsigned long long timein,timeout;
+
+  l2 = L>>3;
+  K1 = (frame_length>>3);
+#ifdef DEBUG_LOGMAP
+  fprintf(fdavx2,"Compute alpha (avx2_16bit)\n");
+  fprintf(fdavx2b,"Compute alpha (avx2_16bit)\n");
+#endif
+  timein = rdtsc_oai();
+
+  for (l=K1;; l=l2,rerun_flag=1) {
+    alpha128 = (__m256i *)alpha;
+
+    if (rerun_flag == 0) {
+
+      alpha128[0] = _mm256_set_epi16(-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,0,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,0);
+      alpha128[1] = _mm256_set_epi16(-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2);
+      alpha128[2] = _mm256_set_epi16(-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2);
+      alpha128[3] = _mm256_set_epi16(-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2);
+      alpha128[4] = _mm256_set_epi16(-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2);
+      alpha128[5] = _mm256_set_epi16(-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2);
+      alpha128[6] = _mm256_set_epi16(-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2);
+      alpha128[7] = _mm256_set_epi16(-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2,-MAX/2);
+#ifdef DEBUG_LOGMAP
+      fprintf(fdavx2,"Initial alpha\n");
+      fprintf(fdavx2b,"Initial alpha\n");
+      print_shorts("a0",(int16_t*)&alpha128[0]);
+      print_shorts("a1",(int16_t*)&alpha128[1]);
+      print_shorts("a2",(int16_t*)&alpha128[2]);
+      print_shorts("a3",(int16_t*)&alpha128[3]);
+      print_shorts("a4",(int16_t*)&alpha128[4]);
+      print_shorts("a5",(int16_t*)&alpha128[5]);
+      print_shorts("a6",(int16_t*)&alpha128[6]);
+      print_shorts("a7",(int16_t*)&alpha128[7]);
+#endif
+    } else {
+      //set initial alpha in columns 1-7 from final alpha from last run in columns 0-6
+      alpha128[0] = _mm256_slli_si256(alpha128[frame_length],2);
+      alpha128[1] = _mm256_slli_si256(alpha128[1+frame_length],2);
+      alpha128[2] = _mm256_slli_si256(alpha128[2+frame_length],2);
+      alpha128[3] = _mm256_slli_si256(alpha128[3+frame_length],2);
+      alpha128[4] = _mm256_slli_si256(alpha128[4+frame_length],2);
+      alpha128[5] = _mm256_slli_si256(alpha128[5+frame_length],2);
+      alpha128[6] = _mm256_slli_si256(alpha128[6+frame_length],2);
+      alpha128[7] = _mm256_slli_si256(alpha128[7+frame_length],2);
+      // set initial alpha in column 0 to (0,-MAX/2,...,-MAX/2)
+      alpha[16] = -MAX/2;
+      alpha[32] = -MAX/2;
+      alpha[48] = -MAX/2;
+      alpha[64] = -MAX/2;
+      alpha[80] = -MAX/2;
+      alpha[96] = -MAX/2;
+      alpha[112] = -MAX/2;
+
+      alpha[24] = -MAX/2;
+      alpha[40] = -MAX/2;
+      alpha[56] = -MAX/2;
+      alpha[72] = -MAX/2;
+      alpha[88] = -MAX/2;
+      alpha[104] = -MAX/2;
+      alpha[120] = -MAX/2;
+#ifdef DEBUG_LOGMAP
+      fprintf(fdavx2,"Second run\n");
+      fprintf(fdavx2b,"Second run\n");
+      print_shorts("a0",(int16_t*)&alpha128[0]);
+      print_shorts("a1",(int16_t*)&alpha128[1]);
+      print_shorts("a2",(int16_t*)&alpha128[2]);
+      print_shorts("a3",(int16_t*)&alpha128[3]);
+      print_shorts("a4",(int16_t*)&alpha128[4]);
+      print_shorts("a5",(int16_t*)&alpha128[5]);
+      print_shorts("a6",(int16_t*)&alpha128[6]);
+      print_shorts("a7",(int16_t*)&alpha128[7]);
+#endif
+
+    }
+
+    alpha_ptr = &alpha128[0];
+    m11p = (__m256i*)m_11;
+    m10p = (__m256i*)m_10;
+
+    for (k=0;
+         k<l;
+         k++) {
+
+
+      a1=_mm256_load_si256(&alpha_ptr[1]);
+      a3=_mm256_load_si256(&alpha_ptr[3]);
+      a5=_mm256_load_si256(&alpha_ptr[5]);
+      a7=_mm256_load_si256(&alpha_ptr[7]);
+
+      m_b0 = _mm256_adds_epi16(a1,*m11p);  // m11
+      m_b4 = _mm256_subs_epi16(a1,*m11p);  // m00=-m11
+      m_b1 = _mm256_subs_epi16(a3,*m10p);  // m01=-m10
+      m_b5 = _mm256_adds_epi16(a3,*m10p);  // m10
+      m_b2 = _mm256_adds_epi16(a5,*m10p);  // m10
+      m_b6 = _mm256_subs_epi16(a5,*m10p);  // m01=-m10
+      m_b3 = _mm256_subs_epi16(a7,*m11p);  // m00=-m11
+      m_b7 = _mm256_adds_epi16(a7,*m11p);  // m11
+
+      a0=_mm256_load_si256(&alpha_ptr[0]);
+      a2=_mm256_load_si256(&alpha_ptr[2]);
+      a4=_mm256_load_si256(&alpha_ptr[4]);
+      a6=_mm256_load_si256(&alpha_ptr[6]);
+
+      new0 = _mm256_subs_epi16(a0,*m11p);  // m00=-m11
+      new4 = _mm256_adds_epi16(a0,*m11p);  // m11
+      new1 = _mm256_adds_epi16(a2,*m10p);  // m10
+      new5 = _mm256_subs_epi16(a2,*m10p);  // m01=-m10
+      new2 = _mm256_subs_epi16(a4,*m10p);  // m01=-m10
+      new6 = _mm256_adds_epi16(a4,*m10p);  // m10
+      new3 = _mm256_adds_epi16(a6,*m11p);  // m11
+      new7 = _mm256_subs_epi16(a6,*m11p);  // m00=-m11
+
+      a0 = _mm256_max_epi16(m_b0,new0);
+      a1 = _mm256_max_epi16(m_b1,new1);
+      a2 = _mm256_max_epi16(m_b2,new2);
+      a3 = _mm256_max_epi16(m_b3,new3);
+      a4 = _mm256_max_epi16(m_b4,new4);
+      a5 = _mm256_max_epi16(m_b5,new5);
+      a6 = _mm256_max_epi16(m_b6,new6);
+      a7 = _mm256_max_epi16(m_b7,new7);
+
+      alpha_max = _mm256_max_epi16(a0,a1);
+      alpha_max = _mm256_max_epi16(alpha_max,a2);
+      alpha_max = _mm256_max_epi16(alpha_max,a3);
+      alpha_max = _mm256_max_epi16(alpha_max,a4);
+      alpha_max = _mm256_max_epi16(alpha_max,a5);
+      alpha_max = _mm256_max_epi16(alpha_max,a6);
+      alpha_max = _mm256_max_epi16(alpha_max,a7);
+
+      alpha_ptr+=8;
+      m11p++;
+      m10p++;
+
+      alpha_ptr[0] = _mm256_subs_epi16(a0,alpha_max);
+      alpha_ptr[1] = _mm256_subs_epi16(a1,alpha_max);
+      alpha_ptr[2] = _mm256_subs_epi16(a2,alpha_max);
+      alpha_ptr[3] = _mm256_subs_epi16(a3,alpha_max);
+      alpha_ptr[4] = _mm256_subs_epi16(a4,alpha_max);
+      alpha_ptr[5] = _mm256_subs_epi16(a5,alpha_max);
+      alpha_ptr[6] = _mm256_subs_epi16(a6,alpha_max);
+      alpha_ptr[7] = _mm256_subs_epi16(a7,alpha_max);
+
+#ifdef DEBUG_LOGMAP
+      fprintf(fdavx2,"Loop index %d\n",k);
+      fprintf(fdavx2b,"Loop index %d\n",k);
+      print_shorts("mb0",(int16_t*)&m_b0);
+      print_shorts("mb1",(int16_t*)&m_b1);
+      print_shorts("mb2",(int16_t*)&m_b2);
+      print_shorts("mb3",(int16_t*)&m_b3);
+      print_shorts("mb4",(int16_t*)&m_b4);
+      print_shorts("mb5",(int16_t*)&m_b5);
+      print_shorts("mb6",(int16_t*)&m_b6);
+      print_shorts("mb7",(int16_t*)&m_b7);
+
+      fprintf(fdavx2,"Loop index %d, new\n",k);
+      fprintf(fdavx2b,"Loop index %d, new\n",k);
+      print_shorts("new0",(int16_t*)&new0);
+      print_shorts("new1",(int16_t*)&new1);
+      print_shorts("new2",(int16_t*)&new2);
+      print_shorts("new3",(int16_t*)&new3);
+      print_shorts("new4",(int16_t*)&new4);
+      print_shorts("new5",(int16_t*)&new5);
+      print_shorts("new6",(int16_t*)&new6);
+      print_shorts("new7",(int16_t*)&new7);
+
+      fprintf(fdavx2,"Loop index %d, after max\n",k);
+      fprintf(fdavx2b,"Loop index %d, after max\n",k);
+      print_shorts("a0",(int16_t*)&a0);
+      print_shorts("a1",(int16_t*)&a1);
+      print_shorts("a2",(int16_t*)&a2);
+      print_shorts("a3",(int16_t*)&a3);
+      print_shorts("a4",(int16_t*)&a4);
+      print_shorts("a5",(int16_t*)&a5);
+      print_shorts("a6",(int16_t*)&a6);
+      print_shorts("a7",(int16_t*)&a7);
+
+      fprintf(fdavx2,"Loop index %d\n",k);
+      fprintf(fdavx2b,"Loop index %d\n",k);
+      print_shorts("a0",(int16_t*)&alpha_ptr[0]);
+      print_shorts("a1",(int16_t*)&alpha_ptr[1]);
+      print_shorts("a2",(int16_t*)&alpha_ptr[2]);
+      print_shorts("a3",(int16_t*)&alpha_ptr[3]);
+      print_shorts("a4",(int16_t*)&alpha_ptr[4]);
+      print_shorts("a5",(int16_t*)&alpha_ptr[5]);
+      print_shorts("a6",(int16_t*)&alpha_ptr[6]);
+      print_shorts("a7",(int16_t*)&alpha_ptr[7]);
+
+
+#endif
+
+    }
+
+    if (rerun_flag==1)
+      break;
+  }
+  timeout = rdtsc_oai();
+  printf("alpha: inner loop time %llu\n",timeout-timein);
+
+}
+
+
+void compute_beta16avx2(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,uint16_t frame_length,unsigned char F,int offset8_flag)
+{
+
+  int k,rerun_flag=0;
+
+  __m256i *m11p,*m10p;
+  register __m256i b0,b1,b2,b3,b4,b5,b6,b7;
+  register __m256i m_b0,m_b1,m_b2,m_b3,m_b4,m_b5,m_b6,m_b7;
+  register __m256i new0,new1,new2,new3,new4,new5,new6,new7;
+
+  __m256i *beta128,*alpha128,*beta_ptr;
+  __m256i beta_max;
+
+  llr_t m11,m10,beta0_16,beta1_16,beta2_16,beta3_16,beta4_16,beta5_16,beta6_16,beta7_16,beta0_2,beta1_2,beta2_2,beta3_2,beta_m;
+  llr_t m11_cw2,m10_cw2,beta0_cw2_16,beta1_cw2_16,beta2_cw2_16,beta3_cw2_16,beta4_cw2_16,beta5_cw2_16,beta6_cw2_16,beta7_cw2_16,beta0_2_cw2,beta1_2_cw2,beta2_2_cw2,beta3_2_cw2,beta_m_cw2;
+  llr_t beta0,beta1;
+  llr_t beta0_cw2,beta1_cw2;
+
+  unsigned long long timein,timeout;
+
+#ifdef DEBUG_LOGMAP
+  fprintf(fdavx2,"compute_beta (avx2_16bit), %p,%p,%p,%p,framelength %d,F %d\n",
+      beta,m_11,m_10,alpha,frame_length,F);
+  fprintf(fdavx2b,"compute_beta (avx2_16bit), %p,%p,%p,%p,framelength %d,F %d\n",
+      beta,m_11,m_10,alpha,frame_length,F);
+#endif
+
+
+  // termination for beta initialization
+
+  //  fprintf(fdavx2,"beta init: offset8 %d\n",offset8_flag);
+  m11=(int16_t)m_11[(frame_length<<1)+2];
+  m10=(int16_t)m_10[(frame_length<<1)+2];
+
+  m11_cw2=(int16_t)m_11[(frame_length<<1)+8+2];
+  m10_cw2=(int16_t)m_10[(frame_length<<1)+8+2];
+
+#ifdef DEBUG_LOGMAP
+  fprintf(fdavx2,"m11,m10 %d,%d\n",m11,m10);
+  fprintf(fdavx2b,"m11,m10 %d,%d\n",m11_cw2,m10_cw2);
+#endif
+
+  beta0 = -m11;//M0T_TERM;
+  beta1 = m11;//M1T_TERM;
+  beta0_cw2 = -m11_cw2;//M0T_TERM;
+  beta1_cw2 = m11_cw2;//M1T_TERM;
+
+  m11=(int16_t)m_11[(frame_length<<1)+1];
+  m10=(int16_t)m_10[(frame_length<<1)+1];
+  m11_cw2=(int16_t)m_11[(frame_length<<1)+1+8];
+  m10_cw2=(int16_t)m_10[(frame_length<<1)+1+8];
+
+#ifdef DEBUG_LOGMAP
+  fprintf(fdavx2,"m11,m10 %d,%d\n",m11,m10);
+  fprintf(fdavx2b,"m11,m10 %d,%d\n",m11_cw2,m10_cw2);
+#endif
+  beta0_2 = beta0-m11;//+M0T_TERM;
+  beta1_2 = beta0+m11;//+M1T_TERM;
+  beta2_2 = beta1+m10;//M2T_TERM;
+  beta3_2 = beta1-m10;//+M3T_TERM;
+  beta0_2_cw2 = beta0_cw2-m11_cw2;//+M0T_TERM;
+  beta1_2_cw2 = beta0_cw2+m11_cw2;//+M1T_TERM;
+  beta2_2_cw2 = beta1_cw2+m10_cw2;//M2T_TERM;
+  beta3_2_cw2 = beta1_cw2-m10_cw2;//+M3T_TERM;
+
+  m11=(int16_t)m_11[frame_length<<1];
+  m10=(int16_t)m_10[frame_length<<1];
+  m11_cw2=(int16_t)m_11[(frame_length<<1)+8];
+  m10_cw2=(int16_t)m_10[(frame_length<<1)+8];
+#ifdef DEBUG_LOGMAP
+  fprintf(fdavx2,"m11,m10 %d,%d\n",m11,m10);
+  fprintf(fdavx2b,"m11,m10 %d,%d\n",m11_cw2,m10_cw2);
+#endif
+  beta0_16 = beta0_2-m11;//+M0T_TERM;
+  beta1_16 = beta0_2+m11;//+M1T_TERM;
+  beta2_16 = beta1_2+m10;//+M2T_TERM;
+  beta3_16 = beta1_2-m10;//+M3T_TERM;
+  beta4_16 = beta2_2-m10;//+M4T_TERM;
+  beta5_16 = beta2_2+m10;//+M5T_TERM;
+  beta6_16 = beta3_2+m11;//+M6T_TERM;
+  beta7_16 = beta3_2-m11;//+M7T_TERM;
+
+  beta0_cw2_16 = beta0_2_cw2-m11_cw2;//+M0T_TERM;
+  beta1_cw2_16 = beta0_2_cw2+m11_cw2;//+M1T_TERM;
+  beta2_cw2_16 = beta1_2_cw2+m10_cw2;//+M2T_TERM;
+  beta3_cw2_16 = beta1_2_cw2-m10_cw2;//+M3T_TERM;
+  beta4_cw2_16 = beta2_2_cw2-m10_cw2;//+M4T_TERM;
+  beta5_cw2_16 = beta2_2_cw2+m10_cw2;//+M5T_TERM;
+  beta6_cw2_16 = beta3_2_cw2+m11_cw2;//+M6T_TERM;
+  beta7_cw2_16 = beta3_2_cw2-m11_cw2;//+M7T_TERM;
+
+
+  beta_m = (beta0_16>beta1_16) ? beta0_16 : beta1_16;
+  beta_m = (beta_m>beta2_16) ? beta_m : beta2_16;
+  beta_m = (beta_m>beta3_16) ? beta_m : beta3_16;
+  beta_m = (beta_m>beta4_16) ? beta_m : beta4_16;
+  beta_m = (beta_m>beta5_16) ? beta_m : beta5_16;
+  beta_m = (beta_m>beta6_16) ? beta_m : beta6_16;
+  beta_m = (beta_m>beta7_16) ? beta_m : beta7_16;
+
+  beta_m_cw2 = (beta0_cw2_16>beta1_cw2_16) ? beta0_cw2_16 : beta1_cw2_16;
+  beta_m_cw2 = (beta_m_cw2>beta2_cw2_16) ? beta_m_cw2 : beta2_cw2_16;
+  beta_m_cw2 = (beta_m_cw2>beta3_cw2_16) ? beta_m_cw2 : beta3_cw2_16;
+  beta_m_cw2 = (beta_m_cw2>beta4_cw2_16) ? beta_m_cw2 : beta4_cw2_16;
+  beta_m_cw2 = (beta_m_cw2>beta5_cw2_16) ? beta_m_cw2 : beta5_cw2_16;
+  beta_m_cw2 = (beta_m_cw2>beta6_cw2_16) ? beta_m_cw2 : beta6_cw2_16;
+  beta_m_cw2 = (beta_m_cw2>beta7_cw2_16) ? beta_m_cw2 : beta7_cw2_16;
+
+
+  beta0_16=beta0_16-beta_m;
+  beta1_16=beta1_16-beta_m;
+  beta2_16=beta2_16-beta_m;
+  beta3_16=beta3_16-beta_m;
+  beta4_16=beta4_16-beta_m;
+  beta5_16=beta5_16-beta_m;
+  beta6_16=beta6_16-beta_m;
+  beta7_16=beta7_16-beta_m;
+
+  beta0_cw2_16=beta0_cw2_16-beta_m_cw2;
+  beta1_cw2_16=beta1_cw2_16-beta_m_cw2;
+  beta2_cw2_16=beta2_cw2_16-beta_m_cw2;
+  beta3_cw2_16=beta3_cw2_16-beta_m_cw2;
+  beta4_cw2_16=beta4_cw2_16-beta_m_cw2;
+  beta5_cw2_16=beta5_cw2_16-beta_m_cw2;
+  beta6_cw2_16=beta6_cw2_16-beta_m_cw2;
+  beta7_cw2_16=beta7_cw2_16-beta_m_cw2;
+
+  for (rerun_flag=0;; rerun_flag=1) {
+
+    beta_ptr   = (__m256i*)&beta[frame_length<<4];
+    alpha128   = (__m256i*)&alpha[0];
+
+    if (rerun_flag == 0) {
+      beta_ptr[0] = alpha128[(frame_length)];
+      beta_ptr[1] = alpha128[1+(frame_length)];
+      beta_ptr[2] = alpha128[2+(frame_length)];
+      beta_ptr[3] = alpha128[3+(frame_length)];
+      beta_ptr[4] = alpha128[4+(frame_length)];
+      beta_ptr[5] = alpha128[5+(frame_length)];
+      beta_ptr[6] = alpha128[6+(frame_length)];
+      beta_ptr[7] = alpha128[7+(frame_length)];
+
+#ifdef DEBUG_LOGMAP
+      fprintf(fdavx2,"beta init \n");
+      fprintf(fdavx2b,"beta init \n");
+      print_shorts("b0",(int16_t*)&beta_ptr[0]);
+      print_shorts("b1",(int16_t*)&beta_ptr[1]);
+      print_shorts("b2",(int16_t*)&beta_ptr[2]);
+      print_shorts("b3",(int16_t*)&beta_ptr[3]);
+      print_shorts("b4",(int16_t*)&beta_ptr[4]);
+      print_shorts("b5",(int16_t*)&beta_ptr[5]);
+      print_shorts("b6",(int16_t*)&beta_ptr[6]);
+      print_shorts("b7",(int16_t*)&beta_ptr[7]);
+#endif
+    } else {
+
+      beta128 = (__m256i*)&beta[0];
+      beta_ptr[0] = _mm256_srli_si256(beta128[0],2);
+      beta_ptr[1] = _mm256_srli_si256(beta128[1],2);
+      beta_ptr[2] = _mm256_srli_si256(beta128[2],2);
+      beta_ptr[3] = _mm256_srli_si256(beta128[3],2);
+      beta_ptr[4] = _mm256_srli_si256(beta128[4],2);
+      beta_ptr[5] = _mm256_srli_si256(beta128[5],2);
+      beta_ptr[6] = _mm256_srli_si256(beta128[6],2);
+      beta_ptr[7] = _mm256_srli_si256(beta128[7],2);
+#ifdef DEBUG_LOGMAP
+      fprintf(fdavx2,"beta init (second run)\n");
+      fprintf(fdavx2b,"beta init (second run)\n");
+      print_shorts("b0",(int16_t*)&beta_ptr[0]);
+      print_shorts("b1",(int16_t*)&beta_ptr[1]);
+      print_shorts("b2",(int16_t*)&beta_ptr[2]);
+      print_shorts("b3",(int16_t*)&beta_ptr[3]);
+      print_shorts("b4",(int16_t*)&beta_ptr[4]);
+      print_shorts("b5",(int16_t*)&beta_ptr[5]);
+      print_shorts("b6",(int16_t*)&beta_ptr[6]);
+      print_shorts("b7",(int16_t*)&beta_ptr[7]);
+#endif
+    }
+
+
+    beta_ptr[0] = _mm256_insert_epi16(beta_ptr[0],beta0_16,7);
+    beta_ptr[1] = _mm256_insert_epi16(beta_ptr[1],beta1_16,7);
+    beta_ptr[2] = _mm256_insert_epi16(beta_ptr[2],beta2_16,7);
+    beta_ptr[3] = _mm256_insert_epi16(beta_ptr[3],beta3_16,7);
+    beta_ptr[4] = _mm256_insert_epi16(beta_ptr[4],beta4_16,7);
+    beta_ptr[5] = _mm256_insert_epi16(beta_ptr[5],beta5_16,7);
+    beta_ptr[6] = _mm256_insert_epi16(beta_ptr[6],beta6_16,7);
+    beta_ptr[7] = _mm256_insert_epi16(beta_ptr[7],beta7_16,7);
+
+    beta_ptr[0] = _mm256_insert_epi16(beta_ptr[0],beta0_cw2_16,15);
+    beta_ptr[1] = _mm256_insert_epi16(beta_ptr[1],beta1_cw2_16,15);
+    beta_ptr[2] = _mm256_insert_epi16(beta_ptr[2],beta2_cw2_16,15);
+    beta_ptr[3] = _mm256_insert_epi16(beta_ptr[3],beta3_cw2_16,15);
+    beta_ptr[4] = _mm256_insert_epi16(beta_ptr[4],beta4_cw2_16,15);
+    beta_ptr[5] = _mm256_insert_epi16(beta_ptr[5],beta5_cw2_16,15);
+    beta_ptr[6] = _mm256_insert_epi16(beta_ptr[6],beta6_cw2_16,15);
+    beta_ptr[7] = _mm256_insert_epi16(beta_ptr[7],beta7_cw2_16,15);
+
+#ifdef DEBUG_LOGMAP
+      fprintf(fdavx2,"beta init (after insert) \n");
+      fprintf(fdavx2b,"beta init (after insert) \n");
+      print_shorts("b0",(int16_t*)&beta_ptr[0]);
+      print_shorts("b1",(int16_t*)&beta_ptr[1]);
+      print_shorts("b2",(int16_t*)&beta_ptr[2]);
+      print_shorts("b3",(int16_t*)&beta_ptr[3]);
+      print_shorts("b4",(int16_t*)&beta_ptr[4]);
+      print_shorts("b5",(int16_t*)&beta_ptr[5]);
+      print_shorts("b6",(int16_t*)&beta_ptr[6]);
+      print_shorts("b7",(int16_t*)&beta_ptr[7]);
+#endif
+    int loopval=((rerun_flag==0)?0:((frame_length-L)>>3));
+
+    printf("beta: rerun %d => loopval %d\n",rerun_flag,loopval);
+
+    timein = rdtsc_oai();
+
+    m11p = (frame_length>>3)-1+(__m256i*)m_11;
+    m10p = (frame_length>>3)-1+(__m256i*)m_10;
+
+    for (k=(frame_length>>3)-1; k>=loopval; k--) {
+
+      
+      b4 = _mm256_load_si256(&beta_ptr[4]);
+      b5 = _mm256_load_si256(&beta_ptr[5]);
+      b6 = _mm256_load_si256(&beta_ptr[6]);
+      b7 = _mm256_load_si256(&beta_ptr[7]);
+
+      m_b0 = _mm256_adds_epi16(b4,*m11p);  //m11
+      m_b1 = _mm256_subs_epi16(b4,*m11p);  //m00
+      m_b2 = _mm256_subs_epi16(b5,*m10p);  //m01
+      m_b3 = _mm256_adds_epi16(b5,*m10p);  //m10
+      m_b4 = _mm256_adds_epi16(b6,*m10p);  //m10
+      m_b5 = _mm256_subs_epi16(b6,*m10p);  //m01
+      m_b6 = _mm256_subs_epi16(b7,*m11p);  //m00
+      m_b7 = _mm256_adds_epi16(b7,*m11p);  //m11
+
+      b0 = _mm256_load_si256(&beta_ptr[0]);
+      b1 = _mm256_load_si256(&beta_ptr[1]);
+      b2 = _mm256_load_si256(&beta_ptr[2]);
+      b3 = _mm256_load_si256(&beta_ptr[3]);
+
+      new0 = _mm256_subs_epi16(b0,*m11p);  //m00
+      new1 = _mm256_adds_epi16(b0,*m11p);  //m11
+      new2 = _mm256_adds_epi16(b1,*m10p);  //m10
+      new3 = _mm256_subs_epi16(b1,*m10p);  //m01
+      new4 = _mm256_subs_epi16(b2,*m10p);  //m01
+      new5 = _mm256_adds_epi16(b2,*m10p);  //m10
+      new6 = _mm256_adds_epi16(b3,*m11p);  //m11
+      new7 = _mm256_subs_epi16(b3,*m11p);  //m00
+
+
+      b0 = _mm256_max_epi16(m_b0,new0);
+      b1 = _mm256_max_epi16(m_b1,new1);
+      b2 = _mm256_max_epi16(m_b2,new2);
+      b3 = _mm256_max_epi16(m_b3,new3);
+      b4 = _mm256_max_epi16(m_b4,new4);
+      b5 = _mm256_max_epi16(m_b5,new5);
+      b6 = _mm256_max_epi16(m_b6,new6);
+      b7 = _mm256_max_epi16(m_b7,new7);
+
+      beta_max = _mm256_max_epi16(b0,b1);
+      beta_max = _mm256_max_epi16(beta_max   ,b2);
+      beta_max = _mm256_max_epi16(beta_max   ,b3);
+      beta_max = _mm256_max_epi16(beta_max   ,b4);
+      beta_max = _mm256_max_epi16(beta_max   ,b5);
+      beta_max = _mm256_max_epi16(beta_max   ,b6);
+      beta_max = _mm256_max_epi16(beta_max   ,b7);
+
+      beta_ptr-=8;
+      m11p--;
+      m10p--;
+
+      beta_ptr[0] = _mm256_subs_epi16(b0,beta_max);
+      beta_ptr[1] = _mm256_subs_epi16(b1,beta_max);
+      beta_ptr[2] = _mm256_subs_epi16(b2,beta_max);
+      beta_ptr[3] = _mm256_subs_epi16(b3,beta_max);
+      beta_ptr[4] = _mm256_subs_epi16(b4,beta_max);
+      beta_ptr[5] = _mm256_subs_epi16(b5,beta_max);
+      beta_ptr[6] = _mm256_subs_epi16(b6,beta_max);
+      beta_ptr[7] = _mm256_subs_epi16(b7,beta_max);
+
+#ifdef DEBUG_LOGMAP
+      fprintf(fdavx2,"Loop index %d, mb\n",k);
+      fprintf(fdavx2,"beta init (after max)\n");
+      fprintf(fdavx2b,"Loop index %d, mb\n",k);
+      fprintf(fdavx2b,"beta init (after max)\n");
+
+      print_shorts("b0",(int16_t*)&beta_ptr[0]);
+      print_shorts("b1",(int16_t*)&beta_ptr[1]);
+      print_shorts("b2",(int16_t*)&beta_ptr[2]);
+      print_shorts("b3",(int16_t*)&beta_ptr[3]);
+      print_shorts("b4",(int16_t*)&beta_ptr[4]);
+      print_shorts("b5",(int16_t*)&beta_ptr[5]);
+      print_shorts("b6",(int16_t*)&beta_ptr[6]);
+      print_shorts("b7",(int16_t*)&beta_ptr[7]);
+
+#endif
+    }
+    timeout = rdtsc_oai();
+    printf("beta: inner loop time %llu\n",timeout-timein);
+
+    if (rerun_flag==1)
+      break;
+  }
+}
+
+void compute_ext16avx2(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,llr_t* ext, llr_t* systematic,uint16_t frame_length)
+{
+
+  __m256i *alpha128=(__m256i *)alpha;
+  __m256i *beta128=(__m256i *)beta;
+  __m256i *m11_128,*m10_128,*ext_128;
+  __m256i *alpha_ptr,*beta_ptr;
+  __m256i m00_1,m00_2,m00_3,m00_4;
+  __m256i m01_1,m01_2,m01_3,m01_4;
+  __m256i m10_1,m10_2,m10_3,m10_4;
+  __m256i m11_1,m11_2,m11_3,m11_4;
+
+  int k;
+
+  //
+  // LLR computation, 8 consequtive bits per loop
+  //
+
+#ifdef DEBUG_LOGMAP
+  fprintf(fdavx2,"compute_ext (avx2_16bit), %p, %p, %p, %p, %p, %p ,framelength %d\n",alpha,beta,m_11,m_10,ext,systematic,frame_length);
+  fprintf(fdavx2b,"compute_ext (avx2_16bit), %p, %p, %p, %p, %p, %p ,framelength %d\n",alpha,beta,m_11,m_10,ext,systematic,frame_length);
+#endif
+
+  alpha_ptr = alpha128;
+  beta_ptr = &beta128[8];
+
+
+  for (k=0; k<(frame_length>>3); k++) {
+
+
+    m11_128        = (__m256i*)&m_11[k<<4];
+    m10_128        = (__m256i*)&m_10[k<<4];
+    ext_128        = (__m256i*)&ext[k<<4];
+
+    /*
+      fprintf(fdavx2,"EXT %03d\n",k);
+      print_shorts("a0:",&alpha_ptr[0]);
+      print_shorts("a1:",&alpha_ptr[1]);
+      print_shorts("a2:",&alpha_ptr[2]);
+      print_shorts("a3:",&alpha_ptr[3]);
+      print_shorts("a4:",&alpha_ptr[4]);
+      print_shorts("a5:",&alpha_ptr[5]);
+      print_shorts("a6:",&alpha_ptr[6]);
+      print_shorts("a7:",&alpha_ptr[7]);
+      print_shorts("b0:",&beta_ptr[0]);
+      print_shorts("b1:",&beta_ptr[1]);
+      print_shorts("b2:",&beta_ptr[2]);
+      print_shorts("b3:",&beta_ptr[3]);
+      print_shorts("b4:",&beta_ptr[4]);
+      print_shorts("b5:",&beta_ptr[5]);
+      print_shorts("b6:",&beta_ptr[6]);
+      print_shorts("b7:",&beta_ptr[7]);
+    */
+    m00_4 = _mm256_adds_epi16(alpha_ptr[7],beta_ptr[3]); //ALPHA_BETA_4m00;
+    m11_4 = _mm256_adds_epi16(alpha_ptr[7],beta_ptr[7]); //ALPHA_BETA_4m11;
+    m00_3 = _mm256_adds_epi16(alpha_ptr[6],beta_ptr[7]); //ALPHA_BETA_3m00;
+    m11_3 = _mm256_adds_epi16(alpha_ptr[6],beta_ptr[3]); //ALPHA_BETA_3m11;
+    m00_2 = _mm256_adds_epi16(alpha_ptr[1],beta_ptr[4]); //ALPHA_BETA_2m00;
+    m11_2 = _mm256_adds_epi16(alpha_ptr[1],beta_ptr[0]); //ALPHA_BETA_2m11;
+    m11_1 = _mm256_adds_epi16(alpha_ptr[0],beta_ptr[4]); //ALPHA_BETA_1m11;
+    m00_1 = _mm256_adds_epi16(alpha_ptr[0],beta_ptr[0]); //ALPHA_BETA_1m00;
+    m01_4 = _mm256_adds_epi16(alpha_ptr[5],beta_ptr[6]); //ALPHA_BETA_4m01;
+    m10_4 = _mm256_adds_epi16(alpha_ptr[5],beta_ptr[2]); //ALPHA_BETA_4m10;
+    m01_3 = _mm256_adds_epi16(alpha_ptr[4],beta_ptr[2]); //ALPHA_BETA_3m01;
+    m10_3 = _mm256_adds_epi16(alpha_ptr[4],beta_ptr[6]); //ALPHA_BETA_3m10;
+    m01_2 = _mm256_adds_epi16(alpha_ptr[3],beta_ptr[1]); //ALPHA_BETA_2m01;
+    m10_2 = _mm256_adds_epi16(alpha_ptr[3],beta_ptr[5]); //ALPHA_BETA_2m10;
+    m10_1 = _mm256_adds_epi16(alpha_ptr[2],beta_ptr[1]); //ALPHA_BETA_1m10;
+    m01_1 = _mm256_adds_epi16(alpha_ptr[2],beta_ptr[5]); //ALPHA_BETA_1m01;
+    /*
+      print_shorts("m11_1:",&m11_1);
+      print_shorts("m11_2:",&m11_2);
+      print_shorts("m11_3:",&m11_3);
+      print_shorts("m11_4:",&m11_4);
+      print_shorts("m00_1:",&m00_1);
+      print_shorts("m00_2:",&m00_2);
+      print_shorts("m00_3:",&m00_3);
+      print_shorts("m00_4:",&m00_4);
+      print_shorts("m10_1:",&m10_1);
+      print_shorts("m10_2:",&m10_2);
+      print_shorts("m10_3:",&m10_3);
+      print_shorts("m10_4:",&m10_4);
+      print_shorts("m01_1:",&m01_1);
+      print_shorts("m01_2:",&m01_2);
+      print_shorts("m01_3:",&m01_3);
+      print_shorts("m01_4:",&m01_4);
+    */
+    m01_1 = _mm256_max_epi16(m01_1,m01_2);
+    m01_1 = _mm256_max_epi16(m01_1,m01_3);
+    m01_1 = _mm256_max_epi16(m01_1,m01_4);
+    m00_1 = _mm256_max_epi16(m00_1,m00_2);
+    m00_1 = _mm256_max_epi16(m00_1,m00_3);
+    m00_1 = _mm256_max_epi16(m00_1,m00_4);
+    m10_1 = _mm256_max_epi16(m10_1,m10_2);
+    m10_1 = _mm256_max_epi16(m10_1,m10_3);
+    m10_1 = _mm256_max_epi16(m10_1,m10_4);
+    m11_1 = _mm256_max_epi16(m11_1,m11_2);
+    m11_1 = _mm256_max_epi16(m11_1,m11_3);
+    m11_1 = _mm256_max_epi16(m11_1,m11_4);
+
+    //      print_shorts("m11_1:",&m11_1);
+
+    m01_1 = _mm256_subs_epi16(m01_1,*m10_128);
+    m00_1 = _mm256_subs_epi16(m00_1,*m11_128);
+    m10_1 = _mm256_adds_epi16(m10_1,*m10_128);
+    m11_1 = _mm256_adds_epi16(m11_1,*m11_128);
+
+    //      print_shorts("m10_1:",&m10_1);
+    //      print_shorts("m11_1:",&m11_1);
+    m01_1 = _mm256_max_epi16(m01_1,m00_1);
+    m10_1 = _mm256_max_epi16(m10_1,m11_1);
+    //      print_shorts("m01_1:",&m01_1);
+    //      print_shorts("m10_1:",&m10_1);
+
+    *ext_128 = _mm256_subs_epi16(m10_1,m01_1);
+
+#ifdef DEBUG_LOGMAP
+    fprintf(fdavx2,"ext %p\n",ext_128);
+    fprintf(fdavx2b,"ext %p\n",ext_128);
+    print_shorts("ext:",(int16_t*)ext_128);
+    print_shorts("m11:",(int16_t*)m11_128);
+    print_shorts("m10:",(int16_t*)m10_128);
+    print_shorts("m10_1:",(int16_t*)&m10_1);
+    print_shorts("m01_1:",(int16_t*)&m01_1);
+
+
+#endif    
+
+    alpha_ptr+=8;
+    beta_ptr+=8;
+    }
+}
+
+
+
+//int pi2[n],pi3[n+8],pi5[n+8],pi4[n+8],pi6[n+8],
+int *pi2tab16avx2[188],*pi5tab16avx2[188],*pi4tab16avx2[188],*pi6tab16avx2[188];
+
+void free_td16avx2(void)
+{
+  int ind;
+
+  for (ind=0; ind<188; ind++) {
+    free(pi2tab16avx2[ind]);
+    free(pi5tab16avx2[ind]);
+    free(pi4tab16avx2[ind]);
+    free(pi6tab16avx2[ind]);
+  }
+}
+
+void init_td16avx2()
+{
+
+  int ind,i,i2,i3,j,n,pi,pi2_i,pi2_pi;
+  short * base_interleaver;
+
+  for (ind=0; ind<188; ind++) {
+    n = f1f2mat[ind].nb_bits;
+    base_interleaver=il_tb+f1f2mat[ind].beg_index;
+#ifdef MEX
+    // This is needed for the Mex implementation to make the memory persistent
+    pi2tab16[ind] = mxMalloc((n+8)*sizeof(int));
+    pi5tab16[ind] = mxMalloc((n+8)*sizeof(int));
+    pi4tab16[ind] = mxMalloc((n+8)*sizeof(int));
+    pi6tab16[ind] = mxMalloc((n+8)*sizeof(int));
+#else
+    pi2tab16avx2[ind] = malloc((n+8)*sizeof(int));
+    pi5tab16avx2[ind] = malloc((n+8)*sizeof(int));
+    pi4tab16avx2[ind] = malloc((n+8)*sizeof(int));
+    pi6tab16avx2[ind] = malloc((n+8)*sizeof(int));
+#endif
+
+    //    fprintf(fdavx2,"Interleaver index %d\n",ind);
+    for (i=i2=0; i2<8; i2++) {
+      j=i2;
+
+      for (i3=0; i3<(n>>3); i3++,i++,j+=8) {
+
+        //    if (j>=n)
+        //      j-=(n-1);
+
+        pi2tab16avx2[ind][i]  = ((j>>3)<<4) + (j&7); // 16*floor(j/8) + j mod8, which allows the second codeword to be in pi[i] + 8 
+	//	fprintf(fdavx2,"pi2[%d] = %d(%d)\n",i, pi2tab16avx2[ind][i],j);
+      }
+    }
+
+    for (i=0; i<n; i++) {
+      pi = base_interleaver[i];//(uint32_t)threegpplte_interleaver(f1,f2,n);
+      pi2_i  = ((pi2tab16avx2[ind][i]>>4)<<3)+(pi2tab16avx2[ind][i]&7);
+      pi2_pi = ((pi2tab16avx2[ind][pi]>>4)<<3)+(pi2tab16avx2[ind][pi]&7);
+      pi4tab16avx2[ind][pi2_i]  = pi2tab16avx2[ind][pi];
+      pi5tab16avx2[ind][pi2_pi] = pi2tab16avx2[ind][i];
+      pi6tab16avx2[ind][pi]     = pi2tab16avx2[ind][i];
+    }
+
+  }
+}
+
+unsigned char phy_threegpplte_turbo_decoder16avx2(int16_t *y,
+						  int16_t *y2,
+						  uint8_t *decoded_bytes,
+						  uint8_t *decoded_bytes2,
+						  uint16_t n,
+						  uint16_t f1,
+						  uint16_t f2,
+						  uint8_t max_iterations,
+						  uint8_t crc_type,
+						  uint8_t F,
+						  time_stats_t *init_stats,
+						  time_stats_t *alpha_stats,
+						  time_stats_t *beta_stats,
+						  time_stats_t *gamma_stats,
+						  time_stats_t *ext_stats,
+						  time_stats_t *intl1_stats,
+						  time_stats_t *intl2_stats)
+{
+
+  /*  y is a pointer to the input
+      decoded_bytes is a pointer to the decoded output
+      n is the size in bits of the coded block, with the tail */
+
+
+  llr_t systematic0[2*(n+16)] __attribute__ ((aligned(32)));
+  llr_t systematic1[2*(n+16)] __attribute__ ((aligned(32)));
+  llr_t systematic2[2*(n+16)] __attribute__ ((aligned(32)));
+  llr_t yparity1[2*(n+16)] __attribute__ ((aligned(32)));
+  llr_t yparity2[2*(n+16)] __attribute__ ((aligned(32)));
+
+  llr_t ext[2*(n+128)] __attribute__((aligned(32)));
+  llr_t ext2[2*(n+128)] __attribute__((aligned(32)));
+
+  llr_t alpha[(n+16)*16] __attribute__ ((aligned(32)));
+  llr_t beta[(n+16)*16] __attribute__ ((aligned(32)));
+  llr_t m11[2*(n+16)] __attribute__ ((aligned(32)));
+  llr_t m10[2*(n+16)] __attribute__ ((aligned(32)));
+
+
+  int *pi2_p,*pi4_p,*pi5_p,*pi6_p;
+  llr_t *s,*s1,*s2,*yp1,*yp2,*yp,*yp_cw2;
+  uint32_t i,j,iind;//,pi;
+  uint8_t iteration_cnt=0;
+  uint32_t crc,oldcrc,crc_cw2,oldcrc_cw2,crc_len;
+  uint8_t temp;
+  uint32_t db;
+
+
+  __m256i tmp, zeros=_mm256_setzero_si256();
+
+
+  int offset8_flag=0;
+
+#ifdef DEBUG_LOGMAP
+  fdavx2 = fopen("dump_avx2.txt","w");
+  fdavx2b = fopen("dump_avx2b.txt","w");
+
+  printf("tc avx2_16 (y,y2) %p,%p\n",y,y2);
+#endif
+  if (crc_type > 3) {
+    printf("Illegal crc length!\n");
+    return 255;
+  }
+
+
+  start_meas(init_stats);
+
+
+
+  for (iind=0; iind < 188 && f1f2mat[iind].nb_bits != n; iind++);
+
+  if ( iind == 188 ) {
+    printf("Illegal frame length!\n");
+    return 255;
+  }
+
+  switch (crc_type) {
+  case CRC24_A:
+  case CRC24_B:
+    crc_len=3;
+    break;
+
+  case CRC16:
+    crc_len=2;
+    break;
+
+  case CRC8:
+    crc_len=1;
+    break;
+
+  default:
+    crc_len=3;
+  }
+
+
+  s = systematic0;
+  s1 = systematic1;
+  s2 = systematic2;
+  yp1 = yparity1;
+  yp2 = yparity2;
+
+
+#if 0
+  __m128i *yp128,*yp128_cw2;
+  __m128i tmpe,tmpe_cw2;
+  yp128 = (__m128i*)y;
+  yp128_cw2 = (__m128i*)y2;
+
+
+
+  for (i=0; i<n; i+=8) {
+    pi2_p = &pi2tab16avx2[iind][i];
+
+    j=pi2_p[0];
+
+
+    tmpe  = _mm_load_si128(yp128);
+    tmpe_cw2 = _mm_load_si128(yp128_cw2);
+    //    fprintf(fdavx2,"yp128 %p\n",yp128);
+    //    print_shorts("tmpe",(int16_t*)&tmpe);
+
+    s[j]     = _mm_extract_epi16(tmpe,0);
+    yp1[j]   = _mm_extract_epi16(tmpe,1);
+    yp2[j]   = _mm_extract_epi16(tmpe,2);
+    s[j+8]   = _mm_extract_epi16(tmpe_cw2,0);
+    yp1[j+8] = _mm_extract_epi16(tmpe_cw2,1);
+    yp2[j+8] = _mm_extract_epi16(tmpe_cw2,2);
+
+#ifdef DEBUG_LOGMAP
+    fprintf(fdavx2,"init0: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]);
+    fprintf(fdavx2b,"init0: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]);
+#endif
+
+    j=pi2_p[1];
+
+    s[j]   = _mm_extract_epi16(tmpe,3);
+    yp1[j] = _mm_extract_epi16(tmpe,4);
+    yp2[j] = _mm_extract_epi16(tmpe,5);
+    s[j+8]   = _mm_extract_epi16(tmpe_cw2,3);
+    yp1[j+8] = _mm_extract_epi16(tmpe_cw2,4);
+    yp2[j+8] = _mm_extract_epi16(tmpe_cw2,5);
+#ifdef DEBUG_LOGMAP
+    fprintf(fdavx2,"init1: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]);
+    fprintf(fdavx2b,"init1: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]);
+#endif
+    j=pi2_p[2];
+
+    s[j]   = _mm_extract_epi16(tmpe,6);
+    yp1[j] = _mm_extract_epi16(tmpe,7);
+    tmpe = _mm_load_si128(&yp128[1]);
+    yp2[j] = _mm_extract_epi16(tmpe,0);
+    s[j+8]   = _mm_extract_epi16(tmpe_cw2,6);
+    yp1[j+8] = _mm_extract_epi16(tmpe_cw2,7);
+    tmpe_cw2 = _mm_load_si128(&yp128_cw2[1]);
+    yp2[j+8] = _mm_extract_epi16(tmpe_cw2,0);
+#ifdef DEBUG_LOGMAP
+    fprintf(fdavx2,"init2: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]);
+    fprintf(fdavx2b,"init2: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]);
+#endif
+    j=pi2_p[3];
+
+    s[j]   = _mm_extract_epi16(tmpe,1);
+    yp1[j] = _mm_extract_epi16(tmpe,2);
+    yp2[j] = _mm_extract_epi16(tmpe,3);
+    s[j+8]   = _mm_extract_epi16(tmpe_cw2,1);
+    yp1[j+8] = _mm_extract_epi16(tmpe_cw2,2);
+    yp2[j+8] = _mm_extract_epi16(tmpe_cw2,3);
+#ifdef DEBUG_LOGMAP
+    fprintf(fdavx2,"init3: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]);
+    fprintf(fdavx2b,"init3: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]);
+#endif
+    j=pi2_p[4];
+
+    s[j]   = _mm_extract_epi16(tmpe,4);
+    yp1[j] = _mm_extract_epi16(tmpe,5);
+    yp2[j] = _mm_extract_epi16(tmpe,6);
+    s[j+8]   = _mm_extract_epi16(tmpe_cw2,4);
+    yp1[j+8] = _mm_extract_epi16(tmpe_cw2,5);
+    yp2[j+8] = _mm_extract_epi16(tmpe_cw2,6);
+#ifdef DEBUG_LOGMAP
+    fprintf(fdavx2,"init4: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]);
+    fprintf(fdavx2b,"init4: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]);
+#endif
+    j=pi2_p[5];
+
+    s[j]   = _mm_extract_epi16(tmpe,7);
+    tmpe = _mm_load_si128(&yp128[2]);
+    yp1[j] = _mm_extract_epi16(tmpe,0);
+    yp2[j] = _mm_extract_epi16(tmpe,1);
+    s[j+8]   = _mm_extract_epi16(tmpe_cw2,7);
+    tmpe_cw2 = _mm_load_si128(&yp128_cw2[2]);
+    yp1[j+8] = _mm_extract_epi16(tmpe_cw2,0);
+    yp2[j+8] = _mm_extract_epi16(tmpe_cw2,1);
+#ifdef DEBUG_LOGMAP
+    fprintf(fdavx2,"init5: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]);
+    fprintf(fdavx2b,"init5: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]);
+#endif
+    j=pi2_p[6];
+
+    s[j]   = _mm_extract_epi16(tmpe,2);
+    yp1[j] = _mm_extract_epi16(tmpe,3);
+    yp2[j] = _mm_extract_epi16(tmpe,4);
+    s[j+8]   = _mm_extract_epi16(tmpe_cw2,2);
+    yp1[j+8] = _mm_extract_epi16(tmpe_cw2,3);
+    yp2[j+8] = _mm_extract_epi16(tmpe_cw2,4);
+#ifdef DEBUG_LOGMAP
+    fprintf(fdavx2,"init6: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]);
+    fprintf(fdavx2b,"init6: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]);
+#endif
+    j=pi2_p[7];
+
+    s[j]   = _mm_extract_epi16(tmpe,5);
+    yp1[j] = _mm_extract_epi16(tmpe,6);
+    yp2[j] = _mm_extract_epi16(tmpe,7);
+    s[j+8]   = _mm_extract_epi16(tmpe_cw2,5);
+    yp1[j+8] = _mm_extract_epi16(tmpe_cw2,6);
+    yp2[j+8] = _mm_extract_epi16(tmpe_cw2,7);
+#ifdef DEBUG_LOGMAP
+    fprintf(fdavx2,"init7: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j],yp1[j],yp2[j]);
+    fprintf(fdavx2b,"init7: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",((j>>4)<<3)+(j&7),s[j+8],yp1[j+8],yp2[j+8]);
+#endif
+    yp128+=3;
+    yp128_cw2+=3;
+
+  }
+  yp=(llr_t*)yp128;
+  yp_cw2=(llr_t*)yp128_cw2;
+#else
+  
+  pi2_p    = &pi2tab16avx2[iind][0];
+  for (i=0,j=0; i<n; i++) {
+    s[*pi2_p]     = y[j];
+    s[*pi2_p+8]   = y2[j++];
+    yp1[*pi2_p]   = y[j];
+    yp1[*pi2_p+8] = y2[j++];
+    yp2[*pi2_p]   = y[j];
+    yp2[(*pi2_p++)+8] = y2[j++];
+  }    
+  yp=(llr_t*)&y[j];
+  yp_cw2=(llr_t*)&y2[j];
+#endif
+
+
+  // Termination
+  for (i=0; i<3; i++) {
+    s[(n<<1)+i]    = *yp;
+    s1[(n<<1)+i]   = *yp;
+    s2[(n<<1)+i]   = *yp;
+    yp++;
+    yp1[(n<<1)+i]  = *yp;
+    yp++;
+
+    s[(n<<1)+i+8]   = *yp_cw2;
+    s1[(n<<1)+i+8]  = *yp_cw2;
+    s2[(n<<1)+i+8]  = *yp_cw2;
+    yp_cw2++;
+    yp1[(n<<1)+i+8] = *yp_cw2;
+    yp_cw2++;
+#ifdef DEBUG_LOGMAP
+    fprintf(fdavx2,"Term 1 (%d): %d %d\n",n+i,s[(n<<1)+i],yp1[(n<<1)+i]);
+    fprintf(fdavx2b,"Term 1 (%d): %d %d\n",n+i,s[(n<<1)+i+8],yp1[(n<<1)+i+8]);
+#endif //DEBUG_LOGMAP
+  }
+
+  for (i=16; i<19; i++) {
+    s[(n<<1)+i]  = *yp;
+    s1[(n<<1)+i] = *yp;
+    s2[(n<<1)+i] = *yp;
+    yp++;
+    yp2[(n<<1)+(i-16)] = *yp;
+    yp++;
+
+    s[(n<<1)+i+8]= *yp_cw2;
+    s1[(n<<1)+i+8] = *yp_cw2 ;
+    s2[(n<<1)+i+8] = *yp_cw2;
+    yp_cw2++;
+    yp2[(n<<1)+i-16+8] = *yp_cw2;
+    yp_cw2++;
+#ifdef DEBUG_LOGMAP
+    fprintf(fdavx2,"Term 2 (%d): %d %d\n",n+i-3-8,s[(n<<1)+i],yp2[(n<<1)+i-16]);
+    fprintf(fdavx2b,"Term 2 (%d): %d %d\n",n+i-3-8,s[(n<<1)+i+8],yp2[(n<<1)+i-16+8]);
+#endif //DEBUG_LOGMAP
+  }
+
+#ifdef DEBUG_LOGMAP
+  fprintf(fdavx2,"\n");
+  fprintf(fdavx2b,"\n");
+#endif //DEBUG_LOGMAP
+
+  stop_meas(init_stats);
+
+  // do log_map from first parity bit
+
+  log_map16avx2(systematic0,yparity1,m11,m10,alpha,beta,ext,n,0,F,offset8_flag,alpha_stats,beta_stats,gamma_stats,ext_stats);
+
+  while (iteration_cnt++ < max_iterations) {
+
+#ifdef DEBUG_LOGMAP
+    fprintf(fdavx2,"\n*******************ITERATION %d (n %d), ext %p\n\n",iteration_cnt,n,ext);
+    fprintf(fdavx2b,"\n*******************ITERATION %d (n %d), ext %p\n\n",iteration_cnt,n,ext);
+#endif //DEBUG_LOGMAP
+ 
+    start_meas(intl1_stats);
+
+    pi4_p=pi4tab16avx2[iind];
+
+    for (i=0; i<(n>>3); i++) { // steady-state portion
+
+      ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[*pi4_p],0);
+      ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[8+*pi4_p++],8);
+      ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[*pi4_p],1);
+      ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[8+*pi4_p++],9);
+      ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[*pi4_p],2);
+      ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[8+*pi4_p++],10);
+      ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[*pi4_p],3);
+      ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[8+*pi4_p++],11);
+      ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[*pi4_p],4);
+      ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[8+*pi4_p++],12);
+      ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[*pi4_p],5);
+      ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[8+*pi4_p++],13);
+      ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[*pi4_p],6);
+      ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[8+*pi4_p++],14);
+      ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[*pi4_p],7);
+      ((__m256i *)systematic2)[i]=_mm256_insert_epi16(((__m256i *)systematic2)[i],ext[8+*pi4_p++],15);
+#ifdef DEBUG_LOGMAP
+      print_shorts("syst2",(int16_t*)&((__m256i *)systematic2)[i]);
+#endif
+    }
+
+    stop_meas(intl1_stats);
+
+    // do log_map from second parity bit
+
+    log_map16avx2(systematic2,yparity2,m11,m10,alpha,beta,ext2,n,1,F,offset8_flag,alpha_stats,beta_stats,gamma_stats,ext_stats);
+
+
+
+    pi5_p=pi5tab16avx2[iind];
+
+    for (i=0; i<(n>>3); i++) {
+
+      tmp=_mm256_insert_epi16(tmp,ext2[*pi5_p],0);
+      tmp=_mm256_insert_epi16(tmp,ext2[8+*pi5_p++],8);
+      tmp=_mm256_insert_epi16(tmp,ext2[*pi5_p],1);
+      tmp=_mm256_insert_epi16(tmp,ext2[8+*pi5_p++],9);
+      tmp=_mm256_insert_epi16(tmp,ext2[*pi5_p],2);
+      tmp=_mm256_insert_epi16(tmp,ext2[8+*pi5_p++],10);
+      tmp=_mm256_insert_epi16(tmp,ext2[*pi5_p],3);
+      tmp=_mm256_insert_epi16(tmp,ext2[8+*pi5_p++],11);
+      tmp=_mm256_insert_epi16(tmp,ext2[*pi5_p],4);
+      tmp=_mm256_insert_epi16(tmp,ext2[8+*pi5_p++],12);
+      tmp=_mm256_insert_epi16(tmp,ext2[*pi5_p],5);
+      tmp=_mm256_insert_epi16(tmp,ext2[8+*pi5_p++],13);
+      tmp=_mm256_insert_epi16(tmp,ext2[*pi5_p],6);
+      tmp=_mm256_insert_epi16(tmp,ext2[8+*pi5_p++],14);
+      tmp=_mm256_insert_epi16(tmp,ext2[*pi5_p],7);
+      tmp=_mm256_insert_epi16(tmp,ext2[8+*pi5_p++],15);
+      ((__m256i *)systematic1)[i] = _mm256_adds_epi16(_mm256_subs_epi16(tmp,((__m256i*)ext)[i]),((__m256i *)systematic0)[i]);
+#ifdef DEBUG_LOGMAP
+      print_shorts("syst1",(int16_t*)&((__m256i *)systematic1)[i]);
+#endif
+    }
+
+    if (iteration_cnt>1) {
+      start_meas(intl2_stats);
+      pi6_p=pi6tab16avx2[iind];
+
+      for (i=0; i<(n>>3); i++) {
+
+        tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p],7);
+        tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[8+*pi6_p++],15);
+        tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p],6);
+        tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[8+*pi6_p++],14);
+        tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p],5);
+        tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[8+*pi6_p++],13);
+        tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p],4);
+        tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[8+*pi6_p++],12);
+        tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p],3);
+        tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[8+*pi6_p++],11);
+        tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p],2);
+        tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[8+*pi6_p++],10);
+        tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p],1);
+        tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[8+*pi6_p++],9);
+        tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p],0);
+        tmp=_mm256_insert_epi16(tmp, ((llr_t*)ext2)[8+*pi6_p++],8);
+#ifdef DEBUG_LOGMAP
+	print_shorts("tmp",(int16_t*)&tmp);
+#endif
+        tmp=_mm256_cmpgt_epi8(_mm256_packs_epi16(tmp,zeros),zeros);
+        db=(uint32_t)_mm256_movemask_epi8(tmp);
+	decoded_bytes[i]=db&0xff;
+	decoded_bytes2[i]=(uint8_t)(db>>16)&0xff;
+#ifdef DEBUG_LOGMAP
+	print_shorts("tmp",(int16_t*)&tmp);
+	fprintf(fdavx2,"decoded_bytes[%d] %x (%x)\n",i,decoded_bytes[i],db);
+	fprintf(fdavx2b,"decoded_bytes[%d] %x (%x)\n",i,decoded_bytes2[i],db);
+#endif
+      }
+    }
+
+    // check status on output
+    if (iteration_cnt>1) {
+      oldcrc= *((uint32_t *)(&decoded_bytes[(n>>3)-crc_len]));
+
+      switch (crc_type) {
+
+      case CRC24_A:
+        oldcrc&=0x00ffffff;
+        crc = crc24a(&decoded_bytes[F>>3],
+                     n-24-F)>>8;
+        temp=((uint8_t *)&crc)[2];
+        ((uint8_t *)&crc)[2] = ((uint8_t *)&crc)[0];
+        ((uint8_t *)&crc)[0] = temp;
+        break;
+
+      case CRC24_B:
+        oldcrc&=0x00ffffff;
+        crc = crc24b(decoded_bytes,
+                     n-24)>>8;
+        temp=((uint8_t *)&crc)[2];
+        ((uint8_t *)&crc)[2] = ((uint8_t *)&crc)[0];
+        ((uint8_t *)&crc)[0] = temp;
+        break;
+
+      case CRC16:
+        oldcrc&=0x0000ffff;
+        crc = crc16(decoded_bytes,
+                    n-16)>>16;
+        break;
+
+      case CRC8:
+        oldcrc&=0x000000ff;
+        crc = crc8(decoded_bytes,
+                   n-8)>>24;
+        break;
+
+      default:
+        printf("FATAL: 3gpplte_turbo_decoder_sse.c: Unknown CRC\n");
+        return(255);
+        break;
+      }
+
+      // second CW
+      oldcrc_cw2= *((uint32_t *)(&decoded_bytes2[(n>>3)-crc_len]));
+
+      switch (crc_type) {
+
+      case CRC24_A:
+        oldcrc_cw2&=0x00ffffff;
+        crc_cw2 = crc24a(&decoded_bytes2[F>>3],
+			 n-24-F)>>8;
+        temp=((uint8_t *)&crc_cw2)[2];
+        ((uint8_t *)&crc_cw2)[2] = ((uint8_t *)&crc_cw2)[0];
+        ((uint8_t *)&crc_cw2)[0] = temp;
+        break;
+
+      case CRC24_B:
+        oldcrc_cw2&=0x00ffffff;
+        crc_cw2 = crc24b(decoded_bytes2,
+			 n-24)>>8;
+        temp=((uint8_t *)&crc_cw2)[2];
+        ((uint8_t *)&crc_cw2)[2] = ((uint8_t *)&crc_cw2)[0];
+        ((uint8_t *)&crc_cw2)[0] = temp;
+        break;
+
+      case CRC16:
+        oldcrc_cw2&=0x0000ffff;
+        crc_cw2 = crc16(decoded_bytes2,
+			n-16)>>16;
+        break;
+
+      case CRC8:
+        oldcrc_cw2&=0x000000ff;
+        crc_cw2 = crc8(decoded_bytes2,
+		       n-8)>>24;
+        break;
+
+      default:
+        printf("FATAL: 3gpplte_turbo_decoder_sse.c: Unknown CRC\n");
+        return(255);
+        break;
+      }
+
+      stop_meas(intl2_stats);
+
+#ifdef DEBUG_LOGMAP
+      fprintf(fdavx2,"oldcrc %x, crc %x, oldcrc_cw2 %x, crc_cw2 %x\n",oldcrc,crc,oldcrc_cw2,crc_cw2);
+      fprintf(fdavx2b,"oldcrc %x, crc %x, oldcrc_cw2 %x, crc_cw2 %x\n",oldcrc,crc,oldcrc_cw2,crc_cw2);
+#endif
+
+      if ((crc == oldcrc) && (crc!=0) && (crc_cw2 == oldcrc_cw2) && (crc_cw2!=0)) {
+        return(iteration_cnt);
+      }
+    }
+
+    // do log_map from first parity bit
+    if (iteration_cnt < max_iterations) {
+      log_map16avx2(systematic1,yparity1,m11,m10,alpha,beta,ext,n,0,F,offset8_flag,alpha_stats,beta_stats,gamma_stats,ext_stats);
+
+      __m256i* ext_128=(__m256i*) ext;
+      __m256i* s1_128=(__m256i*) systematic1;
+      __m256i* s0_128=(__m256i*) systematic0;
+      int myloop=n>>3;
+
+      for (i=0; i<myloop; i++) {
+
+        *ext_128=_mm256_adds_epi16(_mm256_subs_epi16(*ext_128,*s1_128++),*s0_128++);
+        ext_128++;
+      }
+    }
+  }
+
+  //  fprintf(fdavx2,"crc %x, oldcrc %x\n",crc,oldcrc);
+
+
+  _mm_empty();
+  _m_empty();
+
+#ifdef DEBUG_LOGMAP
+  fclose(fdavx2);
+#endif
+  return(iteration_cnt);
+}
+
+#endif //__AVX2__
+
+
diff --git a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c
index 702aee86567e5ec1e5ae47ac7c3c6bb5eed5e1f5..ab7d19407e4a3058510a60b5d8cf9d74268033d5 100644
--- a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c
+++ b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_16bit.c
@@ -63,11 +63,17 @@
 #include "mex.h"
 #endif
 
+//#define DEBUG_LOGMAP
 
-#define print_shorts(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7])
+#ifdef DEBUG_LOGMAP
+#define print_shorts(s,x) fprintf(fdsse4,"%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7])
+#endif
 
-//#define DEBUG_LOGMAP
+#undef __AVX2__
 
+#ifdef DEBUG_LOGMAP
+FILE *fdsse4;
+#endif
 
 typedef int16_t llr_t; // internal decoder LLR data is 16-bit fixed
 typedef int16_t channel_t;
@@ -99,7 +105,7 @@ void log_map16(llr_t* systematic,
 {
 
 #ifdef DEBUG_LOGMAP
-  msg("log_map, frame_length %d\n",frame_length);
+  fprintf(fdsse4,"log_map, frame_length %d\n",frame_length);
 #endif
 
   start_meas(gamma_stats) ;
@@ -135,22 +141,35 @@ void compute_gamma16(llr_t* m11,llr_t* m10,llr_t* systematic,channel_t* y_parity
 #endif
 
 #ifdef DEBUG_LOGMAP
-  msg("compute_gamma, %p,%p,%p,%p,framelength %d\n",m11,m10,systematic,y_parity,frame_length);
+  fprintf(fdsse4,"compute_gamma (sse_16bit), %p,%p,%p,%p,framelength %d\n",m11,m10,systematic,y_parity,frame_length);
 #endif
 
+#ifndef __AVX2__
   K1=frame_length>>3;
+#else
+  if ((frame_length&15) > 0)
+    K1=(frame_length+1)>>4;
+  else
+    K1=frame_length>>4;
+#endif
 
   for (k=0; k<K1; k++) {
 #if defined(__x86_64__) || defined(__i386__)
+#ifndef __AVX2__
     m11_128[k] = _mm_srai_epi16(_mm_adds_epi16(systematic128[k],y_parity128[k]),1);
     m10_128[k] = _mm_srai_epi16(_mm_subs_epi16(systematic128[k],y_parity128[k]),1);
+#else
+    ((__m256i*)m11_128)[k] = _mm256_srai_epi16(_mm256_adds_epi16(((__m256i*)systematic128)[k],((__m256i*)y_parity128)[k]),1);
+    //    ((__m256i*)m10_128)[k] = _mm256_srai_epi16(_mm256_subs_epi16(((__m256i*)y_parity128)[k],((__m256i*)systematic128)[k]),1);
+    ((__m256i*)m10_128)[k] = _mm256_srai_epi16(_mm256_subs_epi16(((__m256i*)systematic128)[k],((__m256i*)y_parity128)[k]),1);
+#endif
 #elif defined(__arm__)
     m11_128[k] = vhaddq_s16(systematic128[k],y_parity128[k]);
     m10_128[k] = vhsubq_s16(systematic128[k],y_parity128[k]);
 #endif
 
 #ifdef DEBUG_LOGMAP
-    printf("Loop index k, m11,m10\n");
+    fprintf(fdsse4,"Loop index k %d\n", k);
     print_shorts("sys",(int16_t*)&systematic128[k]);
     print_shorts("yp",(int16_t*)&y_parity128[k]);
     print_shorts("m11",(int16_t*)&m11_128[k]);
@@ -158,14 +177,28 @@ void compute_gamma16(llr_t* m11,llr_t* m10,llr_t* systematic,channel_t* y_parity
 #endif
   }
 
+  k=frame_length>>3;
   // Termination
 #if defined(__x86_64__) || defined(__i386__)
   m11_128[k] = _mm_srai_epi16(_mm_adds_epi16(systematic128[k+term_flag],y_parity128[k]),1);
+  //#ifndef __AVX2__
+#if 1
   m10_128[k] = _mm_srai_epi16(_mm_subs_epi16(systematic128[k+term_flag],y_parity128[k]),1);
+#else
+  m10_128[k] = _mm_srai_epi16(_mm_subs_epi16(y_parity128[k],systematic128[k+term_flag]),1);
+#endif
 #elif defined(__arm__)
   m11_128[k] = vhaddq_s16(systematic128[k+term_flag],y_parity128[k]);
   m10_128[k] = vhsubq_s16(systematic128[k+term_flag],y_parity128[k]);
 #endif
+
+#ifdef DEBUG_LOGMAP
+fprintf(fdsse4,"Loop index k %d (term flag %d)\n", k,term_flag);
+print_shorts("sys",(int16_t*)&systematic128[k]);
+    print_shorts("yp",(int16_t*)&y_parity128[k]);
+    print_shorts("m11",(int16_t*)&m11_128[k]);
+    print_shorts("m10",(int16_t*)&m10_128[k]);
+#endif
 }
 
 #define L 40
@@ -174,11 +207,21 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s
 {
   int k,l,l2,K1,rerun_flag=0;
 #if defined(__x86_64__) || defined(__i386__)
-  __m128i *alpha128=(__m128i *)alpha,*alpha_ptr;
-  __m128i a0,a1,a2,a3,a4,a5,a6,a7,*m11p,*m10p;
+  __m128i *alpha128=(__m128i *)alpha,*alpha_ptr,*m11p,*m10p;
+  //#ifndef __AVX2__
+#if 1
+  __m128i a0,a1,a2,a3,a4,a5,a6,a7;
   __m128i m_b0,m_b1,m_b2,m_b3,m_b4,m_b5,m_b6,m_b7;
   __m128i new0,new1,new2,new3,new4,new5,new6,new7;
   __m128i alpha_max;
+#else
+  __m256i *alpha256=(__m256i *)alpha,*alpha_ptr256,m11,m10;
+  __m256i a01,a23,a45,a67,a02,a13,a64,a75;
+  __m256i m_b01,m_b23,m_b45,m_b67,new01,new23,new45,new67;
+  __m256i m11m10_256;
+  __m256i alpha_max;
+#endif
+
 #elif defined(__arm__)
   int16x8_t *alpha128=(int16x8_t *)alpha,*alpha_ptr;
   int16x8_t a0,a1,a2,a3,a4,a5,a6,a7,*m11p,*m10p;
@@ -188,10 +231,16 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s
 #endif
   l2 = L>>3;
   K1 = (frame_length>>3);
-
+#ifdef DEBUG_LOGMAP
+  fprintf(fdsse4,"compute_alpha (sse_16bit)\n");
+#endif
   for (l=K1;; l=l2,rerun_flag=1) {
 #if defined(__x86_64__) || defined(__i386__)
     alpha128 = (__m128i *)alpha;
+    //#ifdef __AVX2__
+#if 0
+    alpha256 = (__m256i *)alpha;
+#endif
 #elif defined(__arm__)
     alpha128 = (int16x8_t *)alpha;
 #endif
@@ -218,7 +267,7 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s
       alpha128[7] = vdupq_n_s16(-MAX/2);
 #endif
 #ifdef DEBUG_LOGMAP
-      printf("Initial alpha\n");
+      fprintf(fdsse4,"Initial alpha\n");
       print_shorts("a0",(int16_t*)&alpha128[0]);
       print_shorts("a1",(int16_t*)&alpha128[1]);
       print_shorts("a2",(int16_t*)&alpha128[2]);
@@ -258,7 +307,7 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s
       alpha[48] = -MAX/2;
       alpha[56] = -MAX/2;
 #ifdef DEBUG_LOGMAP
-      printf("Second run\n");
+      fprintf(fdsse4,"Second run\n");
       print_shorts("a0",(int16_t*)&alpha128[0]);
       print_shorts("a1",(int16_t*)&alpha128[1]);
       print_shorts("a2",(int16_t*)&alpha128[2]);
@@ -272,6 +321,11 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s
     }
 
     alpha_ptr = &alpha128[0];
+    //#ifdef __AVX2__
+#if 0
+    alpha_ptr256 = &alpha256[0];
+#endif
+
 #if defined(__x86_64__) || defined(__i386__)
     m11p = (__m128i*)m_11;
     m10p = (__m128i*)m_10;
@@ -284,6 +338,8 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s
          k++) {
 
 #if defined(__x86_64__) || defined(__i386__)
+      //#ifndef __AVX2__
+#if 1
       a1=_mm_load_si128(&alpha_ptr[1]);
       a3=_mm_load_si128(&alpha_ptr[3]);
       a5=_mm_load_si128(&alpha_ptr[5]);
@@ -328,6 +384,37 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s
       alpha_max = _mm_max_epi16(alpha_max,a5);
       alpha_max = _mm_max_epi16(alpha_max,a6);
       alpha_max = _mm_max_epi16(alpha_max,a7);
+#else
+      a02=_mm256_load_si256(&alpha_ptr256[0]);
+      a13=_mm256_load_si256(&alpha_ptr256[1]);
+      a64=_mm256_load_si256(&alpha_ptr256[2]);
+      a75=_mm256_load_si256(&alpha_ptr256[3]);
+      m11m10_256 = _mm256_insertf128_si256(m11m10_256,*m11p,0);
+      m11m10_256 = _mm256_insertf128_si256(m11m10_256,*m10p,1);
+
+
+      m_b01 = _mm256_adds_epi16(a13,m11m10_256); //negative m10
+      m_b23 = _mm256_subs_epi16(a75,m11m10_256); //negative m10
+      m_b45 = _mm256_subs_epi16(a13,m11m10_256); //negative m10
+      m_b67 = _mm256_adds_epi16(a75,m11m10_256); //negative m10
+
+      new01 = _mm256_subs_epi16(a02,m11m10_256);  //negative m10
+      new23 = _mm256_adds_epi16(a64,m11m10_256);  //negative m10
+      new45 = _mm256_adds_epi16(a02,m11m10_256);  //negative m10
+      new67 = _mm256_subs_epi16(a64,m11m10_256);  //negative m10
+
+      a01   = _mm256_max_epi16(m_b01,new01);
+      a23   = _mm256_max_epi16(m_b23,new23);
+      a45   = _mm256_max_epi16(m_b45,new45);
+      a67   = _mm256_max_epi16(m_b67,new67);
+
+      alpha_max = _mm256_max_epi16(a01,a23);
+      alpha_max = _mm256_max_epi16(alpha_max,a45);
+      alpha_max = _mm256_max_epi16(alpha_max,a67);
+      alpha_max = _mm256_max_epi16(alpha_max,_mm256_permutevar8x32_epi32(alpha_max,_mm256_set_epi32(3,2,1,0,7,6,5,4)));
+      
+      
+#endif
 #elif defined(__arm__)
       m_b0 = vqaddq_s16(alpha_ptr[1],*m11p);  // m11
       m_b4 = vqsubq_s16(alpha_ptr[1],*m11p);  // m00=-m11
@@ -367,9 +454,15 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s
 #endif
 
       alpha_ptr+=8;
+      //#ifdef __AVX2__
+#if 0
+      alpha_ptr256+=4;
+#endif
       m11p++;
       m10p++;
 #if defined(__x86_64__) || defined(__i386__)
+      //#ifndef __AVX2__
+#if 1
       alpha_ptr[0] = _mm_subs_epi16(a0,alpha_max);
       alpha_ptr[1] = _mm_subs_epi16(a1,alpha_max);
       alpha_ptr[2] = _mm_subs_epi16(a2,alpha_max);
@@ -378,6 +471,18 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s
       alpha_ptr[5] = _mm_subs_epi16(a5,alpha_max);
       alpha_ptr[6] = _mm_subs_epi16(a6,alpha_max);
       alpha_ptr[7] = _mm_subs_epi16(a7,alpha_max);
+#else
+
+      a01   = _mm256_subs_epi16(a01,alpha_max);
+      a23   = _mm256_subs_epi16(a23,alpha_max);
+      a45   = _mm256_subs_epi16(a45,alpha_max);
+      a67   = _mm256_subs_epi16(a67,alpha_max);
+
+      alpha_ptr256[0] = _mm256_permute2x128_si256(a01,a23,0x20);  //a02
+      alpha_ptr256[1] = _mm256_permute2x128_si256(a01,a23,0x13);  //a13
+      alpha_ptr256[2] = _mm256_permute2x128_si256(a45,a67,0x02);  //a64
+      alpha_ptr256[3] = _mm256_permute2x128_si256(a45,a67,0x31);  //a75
+#endif
 #elif defined(__arm__)
       alpha_ptr[0] = vqsubq_s16(a0,alpha_max);
       alpha_ptr[1] = vqsubq_s16(a1,alpha_max);
@@ -390,7 +495,7 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s
 #endif
 
 #ifdef DEBUG_LOGMAP
-      printf("Loop index %d, mb\n",k);
+      fprintf(fdsse4,"Loop index %d\n",k);
       print_shorts("mb0",(int16_t*)&m_b0);
       print_shorts("mb1",(int16_t*)&m_b1);
       print_shorts("mb2",(int16_t*)&m_b2);
@@ -400,7 +505,7 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s
       print_shorts("mb6",(int16_t*)&m_b6);
       print_shorts("mb7",(int16_t*)&m_b7);
 
-      printf("Loop index %d, new\n",k);
+      fprintf(fdsse4,"Loop index %d, new\n",k);
       print_shorts("new0",(int16_t*)&new0);
       print_shorts("new1",(int16_t*)&new1);
       print_shorts("new2",(int16_t*)&new2);
@@ -410,7 +515,7 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s
       print_shorts("new6",(int16_t*)&new6);
       print_shorts("new7",(int16_t*)&new7);
 
-      printf("Loop index %d, after max\n",k);
+      fprintf(fdsse4,"Loop index %d, after max\n",k);
       print_shorts("a0",(int16_t*)&a0);
       print_shorts("a1",(int16_t*)&a1);
       print_shorts("a2",(int16_t*)&a2);
@@ -420,7 +525,7 @@ void compute_alpha16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,unsigned s
       print_shorts("a6",(int16_t*)&a6);
       print_shorts("a7",(int16_t*)&a7);
 
-      printf("Loop index %d\n",k);
+      fprintf(fdsse4,"Loop index %d\n",k);
       print_shorts("a0",(int16_t*)&alpha_ptr[0]);
       print_shorts("a1",(int16_t*)&alpha_ptr[1]);
       print_shorts("a2",(int16_t*)&alpha_ptr[2]);
@@ -463,25 +568,33 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh
   llr_t beta0,beta1;
 
 #ifdef DEBUG_LOGMAP
-  msg("compute_beta, %p,%p,%p,%p,framelength %d,F %d\n",
-      beta,m_11,m_10,alpha,frame_length,F);
+  fprintf(fdsse4,"compute_beta, %p,%p,%p,%p,framelength %d,F %d\n",
+	  beta,m_11,m_10,alpha,frame_length,F);
 #endif
 
 
   // termination for beta initialization
 
-  //  printf("beta init: offset8 %d\n",offset8_flag);
+  //  fprintf(fdsse4,"beta init: offset8 %d\n",offset8_flag);
   m11=(int16_t)m_11[2+frame_length];
+  //#ifndef __AVX2__
+#if 1
   m10=(int16_t)m_10[2+frame_length];
-
-  //  printf("m11,m10 %d,%d\n",m11,m10);
+#else
+  m10=-(int16_t)m_10[2+frame_length];
+#endif
+#ifdef DEBUG_LOGMAP
+  fprintf(fdsse4,"m11,m10 %d,%d\n",m11,m10);
+#endif
 
   beta0 = -m11;//M0T_TERM;
   beta1 = m11;//M1T_TERM;
   m11=(int16_t)m_11[1+frame_length];
   m10=(int16_t)m_10[1+frame_length];
 
-  //  printf("m11,m10 %d,%d\n",m11,m10);
+#ifdef DEBUG_LOGMAP
+  fprintf(fdsse4,"m11,m10 %d,%d\n",m11,m10);
+#endif
 
   beta0_2 = beta0-m11;//+M0T_TERM;
   beta1_2 = beta0+m11;//+M1T_TERM;
@@ -489,8 +602,9 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh
   beta3_2 = beta1-m10;//+M3T_TERM;
   m11=(int16_t)m_11[frame_length];
   m10=(int16_t)m_10[frame_length];
-  //  printf("m11,m10 %d,%d (%p)\n",m11,m10,m_11+frame_length);
-
+#ifdef DEBUG_LOGMAP
+  fprintf(fdsse4,"m11,m10 %d,%d\n",m11,m10);
+#endif
   beta0_16 = beta0_2-m11;//+M0T_TERM;
   beta1_16 = beta0_2+m11;//+M1T_TERM;
   beta2_16 = beta1_2+m10;//+M2T_TERM;
@@ -536,6 +650,17 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh
       beta_ptr[5] = alpha128[5+(frame_length)];
       beta_ptr[6] = alpha128[6+(frame_length)];
       beta_ptr[7] = alpha128[7+(frame_length)];
+#ifdef DEBUG_LOGMAP
+      fprintf(fdsse4,"beta init \n");
+      print_shorts("b0",(int16_t*)&beta_ptr[0]);
+      print_shorts("b1",(int16_t*)&beta_ptr[1]);
+      print_shorts("b2",(int16_t*)&beta_ptr[2]);
+      print_shorts("b3",(int16_t*)&beta_ptr[3]);
+      print_shorts("b4",(int16_t*)&beta_ptr[4]);
+      print_shorts("b5",(int16_t*)&beta_ptr[5]);
+      print_shorts("b6",(int16_t*)&beta_ptr[6]);
+      print_shorts("b7",(int16_t*)&beta_ptr[7]);
+#endif
     } else {
 #if defined(__x86_64__) || defined(__i386__)
       beta128 = (__m128i*)&beta[0];
@@ -558,6 +683,17 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh
       beta_ptr[5] = (int16x8_t)vshrq_n_s64((int64x2_t)beta128[5],16);   beta_ptr[5] = vsetq_lane_s16(beta[43],beta_ptr[5],4);
       beta_ptr[6] = (int16x8_t)vshrq_n_s64((int64x2_t)beta128[6],16);   beta_ptr[6] = vsetq_lane_s16(beta[51],beta_ptr[6],4);
       beta_ptr[7] = (int16x8_t)vshrq_n_s64((int64x2_t)beta128[7],16);   beta_ptr[7] = vsetq_lane_s16(beta[59],beta_ptr[7],4);
+#endif
+#ifdef DEBUG_LOGMAP
+      fprintf(fdsse4,"beta init (second run) \n");
+      print_shorts("b0",(int16_t*)&beta_ptr[0]);
+      print_shorts("b1",(int16_t*)&beta_ptr[1]);
+      print_shorts("b2",(int16_t*)&beta_ptr[2]);
+      print_shorts("b3",(int16_t*)&beta_ptr[3]);
+      print_shorts("b4",(int16_t*)&beta_ptr[4]);
+      print_shorts("b5",(int16_t*)&beta_ptr[5]);
+      print_shorts("b6",(int16_t*)&beta_ptr[6]);
+      print_shorts("b7",(int16_t*)&beta_ptr[7]);
 #endif
     }
 
@@ -582,6 +718,17 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh
     beta_ptr[7] = vsetq_lane_s16(beta7_16,beta_ptr[7],7);
 #endif
 
+#ifdef DEBUG_LOGMAP
+      fprintf(fdsse4,"beta init (after insert) \n");
+      print_shorts("b0",(int16_t*)&beta_ptr[0]);
+      print_shorts("b1",(int16_t*)&beta_ptr[1]);
+      print_shorts("b2",(int16_t*)&beta_ptr[2]);
+      print_shorts("b3",(int16_t*)&beta_ptr[3]);
+      print_shorts("b4",(int16_t*)&beta_ptr[4]);
+      print_shorts("b5",(int16_t*)&beta_ptr[5]);
+      print_shorts("b6",(int16_t*)&beta_ptr[6]);
+      print_shorts("b7",(int16_t*)&beta_ptr[7]);
+#endif
     int loopval=((rerun_flag==0)?0:((frame_length-L)>>3));
 
     for (k=(frame_length>>3)-1; k>=loopval; k--) {
@@ -589,6 +736,9 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh
       m11_128=((__m128i*)m_11)[k];
       m10_128=((__m128i*)m_10)[k];
 
+
+      //#ifndef __AVX2__
+#if 1
       m_b0 = _mm_adds_epi16(beta_ptr[4],m11_128);  //m11
       m_b1 = _mm_subs_epi16(beta_ptr[4],m11_128);  //m00
       m_b2 = _mm_subs_epi16(beta_ptr[5],m10_128);  //m01
@@ -598,6 +748,7 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh
       m_b6 = _mm_subs_epi16(beta_ptr[7],m11_128);  //m00
       m_b7 = _mm_adds_epi16(beta_ptr[7],m11_128);  //m11
 
+
       new0 = _mm_subs_epi16(beta_ptr[0],m11_128);  //m00
       new1 = _mm_adds_epi16(beta_ptr[0],m11_128);  //m11
       new2 = _mm_adds_epi16(beta_ptr[1],m10_128);  //m10
@@ -607,8 +758,29 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh
       new6 = _mm_adds_epi16(beta_ptr[3],m11_128);  //m11
       new7 = _mm_subs_epi16(beta_ptr[3],m11_128);  //m00
 
+#else
+      b01=_mm256_load_si256(&((_m256i*)beta_ptr)[0]);
+      b23=_mm256_load_si256(&((_m256i*)beta_ptr)[1]);
+      b45=_mm256_load_si256(&((_m256i*)beta_ptr)[2]);
+      b67=_mm256_load_si256(&((_m256i*)beta_ptr)[3]);
+      m11m10_256 = _mm256_insertf128_si256(m11m10_256,m11_128,0);
+      m11m10_256 = _mm256_insertf128_si256(m11m10_256,m10_128,1);
+
+
+      m_b02 = _mm256_adds_epi16(b45,m11m10_256); //negative m10
+      m_b13 = _mm256_subs_epi16(b45,m11m10_256); //negative m10
+      m_b64 = _mm256_subs_epi16(b67,m11m10_256); //negative m10
+      m_b75 = _mm256_adds_epi16(b67,m11m10_256); //negative m10
+      new02 = _mm256_subs_epi16(b01,m11m10_256);  //negative m10
+      new13 = _mm256_adds_epi16(b01,m11m10_256);  //negative m10
+      new64 = _mm256_adds_epi16(b23,m11m10_256);  //negative m10
+      new75 = _mm256_subs_epi16(b24,m11m10_256);  //negative m10
+#endif
+
       beta_ptr-=8;
 
+      //#ifndef __AVX2__
+#if 1
       beta_ptr[0] = _mm_max_epi16(m_b0,new0);
       beta_ptr[1] = _mm_max_epi16(m_b1,new1);
       beta_ptr[2] = _mm_max_epi16(m_b2,new2);
@@ -634,6 +806,28 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh
       beta_ptr[5] = _mm_subs_epi16(beta_ptr[5],beta_max);
       beta_ptr[6] = _mm_subs_epi16(beta_ptr[6],beta_max);
       beta_ptr[7] = _mm_subs_epi16(beta_ptr[7],beta_max);
+#else
+      b02   = _mm256_max_epi16(m_b02,new02);
+      b13   = _mm256_max_epi16(m_b13,new13);
+      b64   = _mm256_max_epi16(m_b64,new64);
+      b75   = _mm256_max_epi16(m_b75,new75);
+      
+      beta_max = _mm256_max_epi16(b02,b13);
+      beta_max = _mm256_max_epi16(beta_max,b64);
+      beta_max = _mm256_max_epi16(beta_max,b75);
+      beta_max = _mm256_max_epi16(beta_max,_mm256_permutevar8x32_epi32(betaa_max,_mm256_set_epi32(3,2,1,0,7,6,5,4)));
+
+      b02   = _mm256_subs_epi16(b02,beta_max);
+      b13   = _mm256_subs_epi16(b13,beta_max);
+      b64   = _mm256_subs_epi16(b64,beta_max);
+      b75   = _mm256_subs_epi16(b75,beta_max);
+
+      ((_m256i*)beta_ptr)[0]) = _mm256_permute2x128_si256(b02,b13,0x02);  //b01
+      ((_m256i*)beta_ptr)[1]) = _mm256_permute2x128_si256(b02,b13,0x31);  //b23
+      ((_m256i*)beta_ptr)[2]) = _mm256_permute2x128_si256(b64,b75,0x13);  //b45
+      ((_m256i*)beta_ptr)[3]) = _mm256_permute2x128_si256(b64,b75,0x20);  //b67
+#endif
+
 #elif defined(__arm__)
       m11_128=((int16x8_t*)m_11)[k];
       m10_128=((int16x8_t*)m_10)[k];
@@ -684,6 +878,18 @@ void compute_beta16(llr_t* alpha,llr_t* beta,llr_t *m_11,llr_t* m_10,unsigned sh
       beta_ptr[7] = vqsubq_s16(beta_ptr[7],beta_max);
 #endif
 
+#ifdef DEBUG_LOGMAP
+      fprintf(fdsse4,"Loop index %d, mb\n",k);
+      fprintf(fdsse4,"beta init (after max)\n");
+      print_shorts("b0",(int16_t*)&beta_ptr[0]);
+      print_shorts("b1",(int16_t*)&beta_ptr[1]);
+      print_shorts("b2",(int16_t*)&beta_ptr[2]);
+      print_shorts("b3",(int16_t*)&beta_ptr[3]);
+      print_shorts("b4",(int16_t*)&beta_ptr[4]);
+      print_shorts("b5",(int16_t*)&beta_ptr[5]);
+      print_shorts("b6",(int16_t*)&beta_ptr[6]);
+      print_shorts("b7",(int16_t*)&beta_ptr[7]);
+#endif
 
     }
 
@@ -721,7 +927,7 @@ void compute_ext16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,llr_t* ext,
   //
 
 #ifdef DEBUG_LOGMAP
-  msg("compute_ext, %p, %p, %p, %p, %p, %p ,framelength %d\n",alpha,beta,m_11,m_10,ext,systematic,frame_length);
+  fprintf(fdsse4,"compute_ext (sse_16bit), %p, %p, %p, %p, %p, %p ,framelength %d\n",alpha,beta,m_11,m_10,ext,systematic,frame_length);
 #endif
 
   alpha_ptr = alpha128;
@@ -736,7 +942,7 @@ void compute_ext16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,llr_t* ext,
     ext_128        = (__m128i*)&ext[k<<3];
 
     /*
-      printf("EXT %03d\n",k);
+      fprintf(fdsse4,"EXT %03d\n",k);
       print_shorts("a0:",&alpha_ptr[0]);
       print_shorts("a1:",&alpha_ptr[1]);
       print_shorts("a2:",&alpha_ptr[2]);
@@ -754,6 +960,9 @@ void compute_ext16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,llr_t* ext,
       print_shorts("b6:",&beta_ptr[6]);
       print_shorts("b7:",&beta_ptr[7]);
     */
+
+    //#ifndef __AVX2__
+#if 1
     m00_4 = _mm_adds_epi16(alpha_ptr[7],beta_ptr[3]); //ALPHA_BETA_4m00;
     m11_4 = _mm_adds_epi16(alpha_ptr[7],beta_ptr[7]); //ALPHA_BETA_4m11;
     m00_3 = _mm_adds_epi16(alpha_ptr[6],beta_ptr[7]); //ALPHA_BETA_3m00;
@@ -770,6 +979,32 @@ void compute_ext16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,llr_t* ext,
     m10_2 = _mm_adds_epi16(alpha_ptr[3],beta_ptr[5]); //ALPHA_BETA_2m10;
     m10_1 = _mm_adds_epi16(alpha_ptr[2],beta_ptr[1]); //ALPHA_BETA_1m10;
     m01_1 = _mm_adds_epi16(alpha_ptr[2],beta_ptr[5]); //ALPHA_BETA_1m01;
+#else
+
+
+    m00_1 = _mm_adds_epi16(alpha_ptr[0],beta_ptr[0]); //ALPHA_BETA_1m00;
+    m10_1 = _mm_adds_epi16(alpha_ptr[2],beta_ptr[1]); //ALPHA_BETA_1m10;
+    m11_1 = _mm_adds_epi16(alpha_ptr[0],beta_ptr[4]); //ALPHA_BETA_1m11;
+    m01_1 = _mm_adds_epi16(alpha_ptr[2],beta_ptr[5]); //ALPHA_BETA_1m01;
+
+    m11_2 = _mm_adds_epi16(alpha_ptr[1],beta_ptr[0]); //ALPHA_BETA_2m11;
+    m01_2 = _mm_adds_epi16(alpha_ptr[3],beta_ptr[1]); //ALPHA_BETA_2m01;
+    m00_2 = _mm_adds_epi16(alpha_ptr[1],beta_ptr[4]); //ALPHA_BETA_2m00;
+    m10_2 = _mm_adds_epi16(alpha_ptr[3],beta_ptr[5]); //ALPHA_BETA_2m10;
+
+    m11_3 = _mm_adds_epi16(alpha_ptr[6],beta_ptr[3]); //ALPHA_BETA_3m11;
+    m01_3 = _mm_adds_epi16(alpha_ptr[4],beta_ptr[2]); //ALPHA_BETA_3m01;
+    m00_3 = _mm_adds_epi16(alpha_ptr[6],beta_ptr[7]); //ALPHA_BETA_3m00;
+    m10_3 = _mm_adds_epi16(alpha_ptr[4],beta_ptr[6]); //ALPHA_BETA_3m10;
+
+    m00_4 = _mm_adds_epi16(alpha_ptr[7],beta_ptr[3]); //ALPHA_BETA_4m00;
+    m10_4 = _mm_adds_epi16(alpha_ptr[5],beta_ptr[2]); //ALPHA_BETA_4m10;
+    m11_4 = _mm_adds_epi16(alpha_ptr[7],beta_ptr[7]); //ALPHA_BETA_4m11;
+    m01_4 = _mm_adds_epi16(alpha_ptr[5],beta_ptr[6]); //ALPHA_BETA_4m01;
+
+
+#endif
+
     /*
       print_shorts("m11_1:",&m11_1);
       print_shorts("m11_2:",&m11_2);
@@ -816,15 +1051,15 @@ void compute_ext16(llr_t* alpha,llr_t* beta,llr_t* m_11,llr_t* m_10,llr_t* ext,
     //      print_shorts("m10_1:",&m10_1);
 
     *ext_128 = _mm_subs_epi16(m10_1,m01_1);
+#ifdef DEBUG_LOGMAP
+    fprintf(fdsse4,"ext %p\n",ext_128);
+    print_shorts("ext:",(int16_t*)ext_128);
+    print_shorts("m11:",(int16_t*)m11_128);
+    print_shorts("m10:",(int16_t*)m10_128);
+    print_shorts("m10_1:",(int16_t*)&m10_1);
+    print_shorts("m01_1:",(int16_t*)&m01_1);
+#endif
 
-    /*
-      print_shorts("ext:",ext_128);
-      print_shorts("m11:",m11_128);
-      print_shorts("m10:",m10_128);
-      print_shorts("m10_1:",&m10_1);
-      print_shorts("m01_1:",&m01_1);
-      print_shorts("syst:",systematic_128);
-    */
 #elif defined(__arm__)
     m11_128        = (int16x8_t*)&m_11[k<<3];
     m10_128        = (int16x8_t*)&m_10[k<<3];
@@ -927,7 +1162,7 @@ void init_td16()
         //      j-=(n-1);
 
         pi2tab16[ind][i]  = j;
-        //    printf("pi2[%d] = %d\n",i,j);
+        //    fprintf(fdsse4,"pi2[%d] = %d\n",i,j);
       }
     }
 
@@ -964,19 +1199,19 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
       n is the size in bits of the coded block, with the tail */
 
 
-  llr_t systematic0[n+16] __attribute__ ((aligned(16)));
-  llr_t systematic1[n+16] __attribute__ ((aligned(16)));
-  llr_t systematic2[n+16] __attribute__ ((aligned(16)));
-  llr_t yparity1[n+16] __attribute__ ((aligned(16)));
-  llr_t yparity2[n+16] __attribute__ ((aligned(16)));
+  llr_t systematic0[n+16] __attribute__ ((aligned(32)));
+  llr_t systematic1[n+16] __attribute__ ((aligned(32)));
+  llr_t systematic2[n+16] __attribute__ ((aligned(32)));
+  llr_t yparity1[n+16] __attribute__ ((aligned(32)));
+  llr_t yparity2[n+16] __attribute__ ((aligned(32)));
 
-  llr_t ext[n+128] __attribute__((aligned(16)));
-  llr_t ext2[n+128] __attribute__((aligned(16)));
+  llr_t ext[n+128] __attribute__((aligned(32)));
+  llr_t ext2[n+128] __attribute__((aligned(32)));
 
-  llr_t alpha[(n+16)*8] __attribute__ ((aligned(16)));
-  llr_t beta[(n+16)*8] __attribute__ ((aligned(16)));
-  llr_t m11[n+16] __attribute__ ((aligned(16)));
-  llr_t m10[n+16] __attribute__ ((aligned(16)));
+  llr_t alpha[(n+16)*8] __attribute__ ((aligned(32)));
+  llr_t beta[(n+16)*8] __attribute__ ((aligned(32)));
+  llr_t m11[n+32] __attribute__ ((aligned(32)));
+  llr_t m10[n+32] __attribute__ ((aligned(32)));
 
 
   int *pi2_p,*pi4_p,*pi5_p,*pi6_p;
@@ -989,7 +1224,7 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
 #if defined(__x86_64__) || defined(__i386__)
   __m128i *yp128;
   __m128i tmp, zeros=_mm_setzero_si128();
-  register __m128i tmpe;
+  __m128i tmpe;
 #elif defined(__arm__)
   int16x8_t *yp128;
 //  int16x8_t tmp128[(n+8)>>3];
@@ -1000,12 +1235,20 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
 #endif
   int offset8_flag=0;
 
+#ifdef DEBUG_LOGMAP
+  fdsse4 = fopen("dump_sse4.txt","w");
+
+
+  printf("tc sse4_16 (y) %p\n",y);
+#endif
+
   if (crc_type > 3) {
-    msg("Illegal crc length!\n");
+    printf("Illegal crc length!\n");
     return 255;
   }
 
 
+
   start_meas(init_stats);
 
 
@@ -1013,7 +1256,7 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
   for (iind=0; iind < 188 && f1f2mat[iind].nb_bits != n; iind++);
 
   if ( iind == 188 ) {
-    msg("Illegal frame length!\n");
+    printf("Illegal frame length!\n");
     return 255;
   }
 
@@ -1059,62 +1302,74 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
 
 #if defined(__x86_64__) || defined(__i386__)
     tmpe = _mm_load_si128(yp128);
+    //    fprintf(fdsse4,"yp128 %p\n",yp128);
+    //    print_shorts("tmpe",(int16_t *)&tmpe);
 
     s[j]   = _mm_extract_epi16(tmpe,0);
     yp1[j] = _mm_extract_epi16(tmpe,1);
     yp2[j] = _mm_extract_epi16(tmpe,2);
-    //        printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
-
+#ifdef DEBUG_LOGMAP
+    fprintf(fdsse4,"init0: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
+#endif
     j=pi2_p[1];
 
     s[j]   = _mm_extract_epi16(tmpe,3);
     yp1[j] = _mm_extract_epi16(tmpe,4);
     yp2[j] = _mm_extract_epi16(tmpe,5);
-    //    printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
-
+#ifdef DEBUG_LOGMAP
+    fprintf(fdsse4,"init1: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
+#endif
     j=pi2_p[2];
 
     s[j]   = _mm_extract_epi16(tmpe,6);
     yp1[j] = _mm_extract_epi16(tmpe,7);
     tmpe = _mm_load_si128(&yp128[1]);
     yp2[j] = _mm_extract_epi16(tmpe,0);
-    //    printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
-
+#ifdef DEBUG_LOGMAP
+    fprintf(fdsse4,"init2: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
+#endif
     j=pi2_p[3];
 
     s[j]   = _mm_extract_epi16(tmpe,1);
     yp1[j] = _mm_extract_epi16(tmpe,2);
     yp2[j] = _mm_extract_epi16(tmpe,3);
-    //    printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
-
+#ifdef DEBUG_LOGMAP
+    fprintf(fdsse4,"init3: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
+#endif
     j=pi2_p[4];
 
     s[j]   = _mm_extract_epi16(tmpe,4);
     yp1[j] = _mm_extract_epi16(tmpe,5);
     yp2[j] = _mm_extract_epi16(tmpe,6);
-    //    printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
-
+#ifdef DEBUG_LOGMAP
+    fprintf(fdsse4,"init4: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
+#endif
     j=pi2_p[5];
 
     s[j]   = _mm_extract_epi16(tmpe,7);
     tmpe = _mm_load_si128(&yp128[2]);
     yp1[j] = _mm_extract_epi16(tmpe,0);
     yp2[j] = _mm_extract_epi16(tmpe,1);
-    //    printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
+#ifdef DEBUG_LOGMAP
+    fprintf(fdsse4,"init5: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
+#endif
 
     j=pi2_p[6];
 
     s[j]   = _mm_extract_epi16(tmpe,2);
     yp1[j] = _mm_extract_epi16(tmpe,3);
     yp2[j] = _mm_extract_epi16(tmpe,4);
-    //    printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
-
+#ifdef DEBUG_LOGMAP
+    fprintf(fdsse4,"init6: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
+#endif
     j=pi2_p[7];
 
     s[j]   = _mm_extract_epi16(tmpe,5);
     yp1[j] = _mm_extract_epi16(tmpe,6);
     yp2[j] = _mm_extract_epi16(tmpe,7);
-    //    printf("init: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
+#ifdef DEBUG_LOGMAP
+    fprintf(fdsse4,"init7: j %d, s[j] %d yp1[j] %d yp2[j] %d\n",j,s[j],yp1[j],yp2[j]);
+#endif
 
 #elif defined(__arm__)
     s[j]   = vgetq_lane_s16(yp128[0],0);
@@ -1172,7 +1427,7 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
     yp1[i] = *yp;
     yp++;
 #ifdef DEBUG_LOGMAP
-    msg("Term 1 (%d): %d %d\n",i,s[i],yp1[i]);
+    fprintf(fdsse4,"Term 1 (%d): %d %d\n",i,s[i],yp1[i]);
 #endif //DEBUG_LOGMAP
   }
 
@@ -1184,12 +1439,12 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
     yp2[i-8] = *yp;
     yp++;
 #ifdef DEBUG_LOGMAP
-    msg("Term 2 (%d): %d %d\n",i-3,s[i],yp2[i-8]);
+    fprintf(fdsse4,"Term 2 (%d): %d %d\n",i-3,s[i],yp2[i-8]);
 #endif //DEBUG_LOGMAP
   }
 
 #ifdef DEBUG_LOGMAP
-  msg("\n");
+  fprintf(fdsse4,"\n");
 #endif //DEBUG_LOGMAP
 
   stop_meas(init_stats);
@@ -1201,7 +1456,7 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
   while (iteration_cnt++ < max_iterations) {
 
 #ifdef DEBUG_LOGMAP
-    printf("\n*******************ITERATION %d (n %d), ext %p\n\n",iteration_cnt,n,ext);
+    fprintf(fdsse4,"\n*******************ITERATION %d (n %d), ext %p\n\n",iteration_cnt,n,ext);
 #endif //DEBUG_LOGMAP
 
     start_meas(intl1_stats);
@@ -1209,24 +1464,29 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
     pi4_p=pi4tab16[iind];
 
     for (i=0; i<(n>>3); i++) { // steady-state portion
+
 #if defined(__x86_64__) || defined(__i386__)
-      ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],0);
-      ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],1);
-      ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],2);
-      ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],3);
-      ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],4);
-      ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],5);
-      ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],6);
-      ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],((llr_t*)ext)[*pi4_p++],7);
+      ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],0);
+      ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],1);
+      ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],2);
+      ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],3);
+      ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],4);
+      ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],5);
+      ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],6);
+      ((__m128i *)systematic2)[i]=_mm_insert_epi16(((__m128i *)systematic2)[i],ext[*pi4_p++],7);
+
 #elif defined(__arm__)
-      ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],0);
-      ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],1);
-      ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],2);
-      ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],3);
-      ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],4);
-      ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],5);
-      ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],6);
-      ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(((llr_t*)ext)[*pi4_p++],((int16x8_t*)systematic2)[i],7);
+      ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],0);
+      ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],1);
+      ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],2);
+      ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],3);
+      ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],4);
+      ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],5);
+      ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],6);
+      ((int16x8_t*)systematic2)[i]=vsetq_lane_s16(ext[*pi4_p++],((int16x8_t*)systematic2)[i],7);
+#endif
+#ifdef DEBUG_LOGMAP
+      print_shorts("syst2",(int16_t*)&((__m128i *)systematic2)[i]);
 #endif
     }
 
@@ -1261,6 +1521,9 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
         tmp=vsetq_lane_s16(ext2[*pi5_p++],tmp,6);
         tmp=vsetq_lane_s16(ext2[*pi5_p++],tmp,7);
 	((int16x8_t *)systematic1)[i] = vqaddq_s16(vqsubq_s16(tmp,((int16x8_t*)ext)[i]),((int16x8_t *)systematic0)[i]);
+#endif
+#ifdef DEBUG_LOGMAP
+	print_shorts("syst1",(int16_t*)&((__m128i *)systematic1)[i]);
 #endif
     }
 
@@ -1278,6 +1541,9 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
         tmp=_mm_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p++],2);
         tmp=_mm_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p++],1);
         tmp=_mm_insert_epi16(tmp, ((llr_t*)ext2)[*pi6_p++],0);
+#ifdef DEBUG_LOGMAP
+	print_shorts("tmp",(int16_t*)&tmp);
+#endif
         tmp=_mm_cmpgt_epi8(_mm_packs_epi16(tmp,zeros),zeros);
         decoded_bytes[i]=(unsigned char)_mm_movemask_epi8(tmp);
 #elif defined(__arm__)
@@ -1297,6 +1563,10 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
 	uint64x2_t Mask   = vpaddlq_u32(vpaddlq_u16(vandq_u16(vcgtq_s16(tmp,zeros), Powers)));
         uint64x1_t Mask64 = vget_high_u64(Mask)+vget_low_u64(Mask);
         decoded_bytes[i] = (uint8_t)Mask64;
+#endif
+#ifdef DEBUG_LOGMAP
+	print_shorts("tmp",(int16_t*)&tmp);
+	fprintf(fdsse4,"decoded_bytes[%d] %x\n",i,decoded_bytes[i]);
 #endif
       }
     }
@@ -1344,6 +1614,9 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
       }
 
       stop_meas(intl2_stats);
+#ifdef DEBUG_LOGMAP
+      fprintf(fdsse4,"oldcrc %x, crc %x\n",oldcrc,crc);
+#endif
 
       if ((crc == oldcrc) && (crc!=0)) {
         return(iteration_cnt);
@@ -1374,8 +1647,12 @@ unsigned char phy_threegpplte_turbo_decoder16(short *y,
       }
     }
   }
+	
+  //  fprintf(fdsse4,"crc %x, oldcrc %x\n",crc,oldcrc);
 
-  //  printf("crc %x, oldcrc %x\n",crc,oldcrc);
+#ifdef DEBUG_LOGMAP
+      fclose(fdsse4);
+#endif
 
 #if defined(__x86_64__) || defined(__i386__)
   _mm_empty();
diff --git a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c
index ee78dd07732ac5a0d70222530a46d2ed90bb7ae6..0227a45a3de8d3e32fa5e0ba290240342cf2c391 100644
--- a/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c
+++ b/openair1/PHY/CODING/3gpplte_turbo_decoder_sse_8bit.c
@@ -1000,6 +1000,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
 
 #if defined(__x86_64__) || defined(__i386__)
 
+  // note: this makes valgrind freak
   __m128i avg=_mm_set1_epi32(0);
 
   for (i=0; i<(3*(n>>4))+1; i++) {
@@ -1503,6 +1504,7 @@ unsigned char phy_threegpplte_turbo_decoder8(short *y,
 
           tmp2=_mm_and_si128(tmp,mask);
           tmp2=_mm_cmpeq_epi16(tmp2,mask);
+	  //	  printf("decoded_bytes %p\n",decoded_bytes);
           decoded_bytes[n_128*0+i]=(uint8_t) _mm_movemask_epi8(_mm_packs_epi16(tmp2,zeros));
           int j;
 
diff --git a/openair1/PHY/CODING/Makefile b/openair1/PHY/CODING/Makefile
index b323c479d323ca88f5599613f4b8a1bacf95092b..d12689e1cc101051e081805084c28d68392f98f5 100644
--- a/openair1/PHY/CODING/Makefile
+++ b/openair1/PHY/CODING/Makefile
@@ -5,7 +5,7 @@ RATE12CC_SRC = ccoding_byte.c viterbi.c crc_byte.c
 all: 3gpplte_sse 
 
 3gpplte_sse: $(TURBO_SRC)
-	gcc -o 3gpplte_sse 3gpplte_sse.c -msse4 -Wall -g -ggdb -DMAIN
+	gcc -o 3gpplte_sse 3gpplte_sse.c -msse4 -Wall -g -ggdb -DTC_MAIN -I../..
 
 
 
diff --git a/openair1/PHY/CODING/defs.h b/openair1/PHY/CODING/defs.h
index acb6e8dd29b32793eec8ffba8c716ebdb30007a2..c0f6091dfddc7262e9918afcb9ca40fc50efe095 100644
--- a/openair1/PHY/CODING/defs.h
+++ b/openair1/PHY/CODING/defs.h
@@ -303,6 +303,10 @@ void ccodedot11_init(void);
 \brief This function initializes the trellis structure for decoding an 802.11 convolutional code.*/
 void ccodedot11_init_inv(void);
 
+/*!\fn void teillis_table_init(void)
+\brief This function initializes the trellis structure for 3GPP LTE Turbo code.*/
+void treillis_table_init(void);
+
 /*\fn void threegpplte_turbo_encoder(uint8_t *input,uint16_t input_length_bytes,uint8_t *output,uint8_t F,uint16_t interleaver_f1,uint16_t interleaver_f2)
 \brief This function implements a rate 1/3 8-state parralel concatenated turbo code (3GPP-LTE).
 @param input Pointer to input buffer
@@ -353,6 +357,8 @@ void ccodedab_init(void);
 \brief This function initializes the trellis structure for decoding an DAB convolutional code (first 3 bits).*/
 void ccodedab_init_inv(void);
 
+
+
 /*!\fn void crcTableInit(void)
 \brief This function initializes the different crc tables.*/
 void crcTableInit (void);
@@ -366,6 +372,17 @@ void init_td8 (void);
 \brief This function initializes the tables for 16-bit LLR Turbo decoder.*/
 void init_td16 (void);
 
+#ifdef __AVX2__
+/*!\fn void init_td8(void)
+\brief This function initializes the tables for 8-bit LLR Turbo decoder (AVX2).*/
+void init_td8avx2 (void);
+
+
+/*!\fn void init_td16(void)
+\brief This function initializes the tables for 16-bit LLR Turbo decoder (AVX2).*/
+void init_td16avx2 (void);
+#endif
+
 /*!\fn uint32_t crc24a(uint8_t *inPtr, int32_t bitlen)
 \brief This computes a 24-bit crc ('a' variant for overall transport block)
 based on 3GPP UMTS/LTE specifications.
@@ -483,6 +500,24 @@ uint8_t phy_threegpplte_turbo_decoder16(int16_t *y,
                                         time_stats_t *intl1_stats,
                                         time_stats_t *intl2_stats);
 
+uint8_t phy_threegpplte_turbo_decoder16avx2(int16_t *y,
+					    int16_t *y2,
+					    uint8_t *decoded_bytes,
+					    uint8_t *decoded_bytes2,
+					    uint16_t n,
+					    uint16_t interleaver_f1,
+					    uint16_t interleaver_f2,
+					    uint8_t max_iterations,
+					    uint8_t crc_type,
+					    uint8_t F,
+					    time_stats_t *init_stats,
+					    time_stats_t *alpha_stats,
+					    time_stats_t *beta_stats,
+					    time_stats_t *gamma_stats,
+					    time_stats_t *ext_stats,
+					    time_stats_t *intl1_stats,
+					    time_stats_t *intl2_stats);
+
 /*!
 \brief This routine performs max-logmap detection for the 3GPP turbo code (with termination).  It is optimized for SIMD processing and 8-bit
 LLR arithmetic, and requires SSE2,SSSE3 and SSE4.1 (gcc >=4.3 and appropriate CPU)
diff --git a/openair1/PHY/CODING/lte_rate_matching.c b/openair1/PHY/CODING/lte_rate_matching.c
index 69697fc2e0c0ef932e330788f0782bdc1b5c428f..2dbf92d751be76f8baf53ced356db1f2c5c2f7e2 100644
--- a/openair1/PHY/CODING/lte_rate_matching.c
+++ b/openair1/PHY/CODING/lte_rate_matching.c
@@ -36,6 +36,7 @@
 #include <stdlib.h>
 #endif
 #include "PHY/defs.h"
+#include "assertions.h"
 
 //#define cmin(a,b) ((a)<(b) ? (a) : (b))
 
@@ -494,8 +495,14 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
   char fname[512];
 #endif
 
-  Nir = Nsoft/Kmimo/cmin(8,Mdlharq);
-  Ncb = cmin(Nir/C,3*(RTC<<5));
+  if (Mdlharq>0) {  // Downlink
+    Nir = Nsoft/Kmimo/cmin(8,Mdlharq);
+    Ncb = cmin(Nir/C,3*(RTC<<5));
+  }
+  else {  // Uplink
+    Nir=0;
+    Ncb = 3*(RTC<<5); // Kw
+  }
 #ifdef RM_DEBUG_TX
 
   if (rvidx==0 && r==0) {
@@ -515,16 +522,14 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
   // if (rvidx==3)
   //  for (cnt=0;cnt<Ncb;cnt++)
   //    counter_buffer[rvidx][cnt]=0;
-  if (Ncb<(3*(RTC<<5))) {
-    msg("Exiting, RM condition (Nir %d, Nsoft %d, Kw %d\n",Nir,Nsoft,3*(RTC<<5));
-    return(0);
-  }
+  AssertFatal(Ncb>=(3*RTC<<5),"Exiting, RM condition (Ncb %d, Nir/C %d, Nsoft %d, Kw %d\n",Ncb,Nir/C,Nsoft,3*(RTC<<5));
+  
 
   Gp = G/Nl/Qm;
   GpmodC = Gp%C;
 
 #ifdef RM_DEBUG
-  printf("lte_rate_matching_turbo: Kw %d, rvidx %d, G %d, Qm %d, Nl%d, r %d\n",3*(RTC<<5),rvidx, G, Qm,Nl,r);
+  printf("lte_rate_matching_turbo: Ncb %d, Kw %d, Nir/C %d, rvidx %d, G %d, Qm %d, Nl%d, r %d\n",Ncb,3*(RTC<<5),Nir/C,rvidx, G, Qm,Nl,r);
 #endif
 
   if (r < (C-(GpmodC)))
@@ -710,15 +715,20 @@ int lte_rate_matching_turbo_rx(uint32_t RTC,
   int nulled=0;
 #endif
 
-  if (Kmimo==0 || Mdlharq==0 || C==0 || Qm==0 || Nl==0) {
+  if (Kmimo==0 || C==0 || Qm==0 || Nl==0) {
     printf("lte_rate_matching.c: invalid parameters (Kmimo %d, Mdlharq %d, C %d, Qm %d, Nl %d\n",
         Kmimo,Mdlharq,C,Qm,Nl);
     return(-1);
   }
 
-  Nir = Nsoft/Kmimo/cmin(8,Mdlharq);
-  Ncb = cmin(Nir/C,3*(RTC<<5));
-
+  if (Mdlharq>0) { // Downlink
+    Nir = Nsoft/Kmimo/cmin(8,Mdlharq);
+    Ncb = cmin(Nir/C,3*(RTC<<5));
+  }
+  else {  // Uplink
+    Nir=0;
+    Ncb = 3*(RTC<<5);
+  }
 
   Gp = G/Nl/Qm;
   GpmodC = Gp%C;
diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c
index ace9f43ea2b165ea44d05bd3adbd6958fa64aa2a..bd56286deac06f23ca7ec79f2e33d942763d8063 100644
--- a/openair1/PHY/INIT/lte_init.c
+++ b/openair1/PHY/INIT/lte_init.c
@@ -26,17 +26,6 @@
   Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
 
  *******************************************************************************/
-/*
-#ifdef CBMIMO1
-#include "ARCH/COMMON/defs.h"
-#include "ARCH/CBMIMO1/DEVICE_DRIVER/from_grlib_softconfig.h"
-#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h"
-#include "ARCH/CBMIMO1/DEVICE_DRIVER/defs.h"
-#include "ARCH/CBMIMO1/DEVICE_DRIVER/extern.h"
-#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_pci.h"
-//#include "pci_commands.h"
-#endif //CBMIMO1
-*/
 #ifdef EXMIMO
 #include "openair0_lib.h"
 #endif
@@ -128,8 +117,8 @@ void phy_config_sib2_eNB(uint8_t Mod_id,
 {
 
   LTE_DL_FRAME_PARMS *lte_frame_parms = &PHY_vars_eNB_g[Mod_id][CC_id]->lte_frame_parms;
-  LTE_eNB_UE_stats *eNB_UE_stats      = PHY_vars_eNB_g[Mod_id][CC_id]->eNB_UE_stats;
-  int32_t rx_total_gain_eNB_dB        = PHY_vars_eNB_g[Mod_id][CC_id]->rx_total_gain_eNB_dB;
+  //LTE_eNB_UE_stats *eNB_UE_stats      = PHY_vars_eNB_g[Mod_id][CC_id]->eNB_UE_stats;
+  //int32_t rx_total_gain_eNB_dB        = PHY_vars_eNB_g[Mod_id][CC_id]->rx_total_gain_eNB_dB;
   int i;
 
   LOG_D(PHY,"[eNB%d] CCid %d Frame %d: Applying radioResourceConfigCommon\n",Mod_id,CC_id,PHY_vars_eNB_g[Mod_id][CC_id]->proc[8].frame_tx);
@@ -724,11 +713,11 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
                                     int CC_id)
 {
 
-  PHY_VARS_eNB *phy_vars_eNB = PHY_vars_eNB_g[Mod_id][CC_id];
+  //PHY_VARS_eNB *phy_vars_eNB = PHY_vars_eNB_g[Mod_id][CC_id];
   uint8_t UE_id = find_ue(rnti,PHY_vars_eNB_g[Mod_id][0]);
   struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10 = sCellToAddMod_r10->radioResourceConfigDedicatedSCell_r10->physicalConfigDedicatedSCell_r10;
   //struct RadioResourceConfigCommonSCell_r10 *physicalConfigCommonSCell_r10 = sCellToAddMod_r10->radioResourceConfigCommonSCell_r10;
-  PhysCellId_t physCellId_r10 = sCellToAddMod_r10->cellIdentification_r10->physCellId_r10;
+  //PhysCellId_t physCellId_r10 = sCellToAddMod_r10->cellIdentification_r10->physCellId_r10;
   ARFCN_ValueEUTRA_t dl_CarrierFreq_r10 = sCellToAddMod_r10->cellIdentification_r10->dl_CarrierFreq_r10;
   uint32_t carrier_freq_local;
 
@@ -774,7 +763,7 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
   }
 
   if (physicalConfigDedicatedSCell_r10) {
-#warning " phy_vars_eNB->physicalConfigDedicatedSCell_r10 does not exist in phy_vars_eNB"
+//#warning " phy_vars_eNB->physicalConfigDedicatedSCell_r10 does not exist in phy_vars_eNB"
     //  phy_vars_eNB->physicalConfigDedicatedSCell_r10[UE_id] = physicalConfigDedicatedSCell_r10;
     LOG_I(PHY,"[eNB %d] Frame %d: Configured phyConfigDedicatedSCell with CC_id %d for UE %d\n",Mod_id,/*phy_vars_eNB->frame*/0,CC_id,UE_id);
   } else {
@@ -929,12 +918,16 @@ void phy_init_lte_top(LTE_DL_FRAME_PARMS *lte_frame_parms)
   ccodelte_init();
   ccodelte_init_inv();
 
+  treillis_table_init();
+
   phy_generate_viterbi_tables();
   phy_generate_viterbi_tables_lte();
 
   init_td8();
   init_td16();
-
+#ifdef __AVX2__
+  init_td16avx2();
+#endif
 
   lte_sync_time_init(lte_frame_parms);
 
@@ -1090,7 +1083,7 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
     // init TX buffers
 
     ue_common_vars->txdata  = (int32_t**)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t*) );
-    ue_common_vars->txdataF = (mod_sym_t **)malloc16( frame_parms->nb_antennas_tx*sizeof(mod_sym_t*) );
+    ue_common_vars->txdataF = (int32_t **)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t*) );
 
     for (i=0; i<frame_parms->nb_antennas_tx; i++) {
 #ifdef USER_MODE
@@ -1098,7 +1091,7 @@ int phy_init_lte_ue(PHY_VARS_UE *phy_vars_ue,
 #else //USER_MODE
       ue_common_vars->txdata[i]  = TX_DMA_BUFFER[0][i];
 #endif //USER_MODE
-      ue_common_vars->txdataF[i] = (mod_sym_t *)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t) );
+      ue_common_vars->txdataF[i] = (int32_t *)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t) );
     }
 
     // init RX buffers
@@ -1311,21 +1304,21 @@ int phy_init_lte_eNB(PHY_VARS_eNB *phy_vars_eNB,
 
       // TX vars
       eNB_common_vars->txdata[eNB_id]  = (int32_t**)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t*) );
-      eNB_common_vars->txdataF[eNB_id] = (mod_sym_t **)malloc16( frame_parms->nb_antennas_tx*sizeof(mod_sym_t*) );
+      eNB_common_vars->txdataF[eNB_id] = (int32_t **)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t*) );
 
       for (i=0; i<frame_parms->nb_antennas_tx; i++) {
 #ifdef USER_MODE
         eNB_common_vars->txdata[eNB_id][i]  = (int32_t*)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(int32_t) );
-        eNB_common_vars->txdataF[eNB_id][i] = (mod_sym_t*)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t) );
+        eNB_common_vars->txdataF[eNB_id][i] = (int32_t*)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t) );
 #else // USER_MODE
         eNB_common_vars->txdata[eNB_id][i]  = TX_DMA_BUFFER[eNB_id][i];
-        eNB_common_vars->txdataF[eNB_id][i] = (mod_sym_t *)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t) );
+        eNB_common_vars->txdataF[eNB_id][i] = (int32_t *)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t) );
 #endif //USER_MODE
 #ifdef DEBUG_PHY
         msg("[openair][LTE_PHY][INIT] lte_eNB_common_vars->txdata[%d][%d] = %p\n",eNB_id,i,eNB_common_vars->txdata[eNB_id][i]);
         msg("[openair][LTE_PHY][INIT] lte_eNB_common_vars->txdataF[%d][%d] = %p (%d bytes)\n",
             eNB_id,i,eNB_common_vars->txdataF[eNB_id][i],
-            FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
+            FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t));
 #endif
       }
 
diff --git a/openair1/PHY/INIT/lte_param_init.c b/openair1/PHY/INIT/lte_param_init.c
new file mode 100644
index 0000000000000000000000000000000000000000..0db51e8b170c001e8f221b3b6acde2993ee297c8
--- /dev/null
+++ b/openair1/PHY/INIT/lte_param_init.c
@@ -0,0 +1,107 @@
+#include <string.h>
+#include <math.h>
+#include <unistd.h>
+#include <execinfo.h>
+#include <signal.h>
+
+#include "SIMULATION/TOOLS/defs.h"
+#include "PHY/types.h"
+#include "PHY/defs.h"
+#include "PHY/extern.h"
+
+extern PHY_VARS_eNB *PHY_vars_eNB;
+extern PHY_VARS_UE *PHY_vars_UE;
+
+void lte_param_init(unsigned char N_tx, 
+		    unsigned char N_rx,
+		    unsigned char transmission_mode,
+		    uint8_t extended_prefix_flag,
+		    frame_t frame_type, 
+		    uint16_t Nid_cell,
+		    uint8_t tdd_config,
+		    uint8_t N_RB_DL,
+		    uint8_t threequarter_fs,
+                    uint8_t osf,
+		    uint32_t perfect_ce)
+{
+
+  LTE_DL_FRAME_PARMS *lte_frame_parms;
+  int i;
+
+
+  printf("Start lte_param_init\n");
+  PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB));
+  PHY_vars_UE = malloc(sizeof(PHY_VARS_UE));
+  //PHY_config = malloc(sizeof(PHY_CONFIG));
+  mac_xface = malloc(sizeof(MAC_xface));
+
+  srand(0);
+  randominit(0);
+  set_taus_seed(0);
+
+  lte_frame_parms = &(PHY_vars_eNB->lte_frame_parms);
+
+  lte_frame_parms->N_RB_DL            = N_RB_DL;   //50 for 10MHz and 25 for 5 MHz
+  lte_frame_parms->N_RB_UL            = N_RB_DL;
+  lte_frame_parms->threequarter_fs    = threequarter_fs;
+  lte_frame_parms->Ncp                = extended_prefix_flag;
+  lte_frame_parms->Ncp_UL             = extended_prefix_flag;
+  lte_frame_parms->Nid_cell           = Nid_cell;
+  lte_frame_parms->nushift            = Nid_cell%6;
+  lte_frame_parms->nb_antennas_tx     = N_tx;
+  lte_frame_parms->nb_antennas_rx     = N_rx;
+  lte_frame_parms->nb_antennas_tx_eNB = N_tx;
+  lte_frame_parms->phich_config_common.phich_resource         = one;
+  lte_frame_parms->tdd_config         = tdd_config;
+  lte_frame_parms->frame_type         = frame_type;
+  //  lte_frame_parms->Csrs = 2;
+  //  lte_frame_parms->Bsrs = 0;
+  //  lte_frame_parms->kTC = 0;44
+  //  lte_frame_parms->n_RRC = 0;
+  lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0;
+
+  init_frame_parms(lte_frame_parms,osf);
+
+  //copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing));
+
+  //  phy_init_top(lte_frame_parms); //allocation
+
+  PHY_vars_UE->is_secondary_ue = 0;
+  PHY_vars_UE->lte_frame_parms = *lte_frame_parms;
+  PHY_vars_eNB->lte_frame_parms = *lte_frame_parms;
+
+  phy_init_lte_top(lte_frame_parms);
+  dump_frame_parms(lte_frame_parms);
+
+  PHY_vars_UE->PHY_measurements.n_adj_cells=0;
+  PHY_vars_UE->PHY_measurements.adj_cell_id[0] = Nid_cell+1;
+  PHY_vars_UE->PHY_measurements.adj_cell_id[1] = Nid_cell+2;
+
+  for (i=0; i<3; i++)
+    lte_gold(lte_frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i);
+
+  phy_init_lte_ue(PHY_vars_UE,1,0);
+  phy_init_lte_eNB(PHY_vars_eNB,0,0,0);
+
+  generate_pcfich_reg_mapping(&PHY_vars_UE->lte_frame_parms);
+  generate_phich_reg_mapping(&PHY_vars_UE->lte_frame_parms);
+
+  // DL power control init
+  if (transmission_mode == 1) {
+    PHY_vars_eNB->pdsch_config_dedicated->p_a  = dB0; // 4 = 0dB
+    ((PHY_vars_eNB->lte_frame_parms).pdsch_config_common).p_b = 0;
+    PHY_vars_UE->pdsch_config_dedicated->p_a  = dB0; // 4 = 0dB
+    ((PHY_vars_UE->lte_frame_parms).pdsch_config_common).p_b = 0;
+  } else { // rho_a = rhob
+    PHY_vars_eNB->pdsch_config_dedicated->p_a  = dB0; // 4 = 0dB
+    ((PHY_vars_eNB->lte_frame_parms).pdsch_config_common).p_b = 1;
+    PHY_vars_UE->pdsch_config_dedicated->p_a  = dB0; // 4 = 0dB
+    ((PHY_vars_UE->lte_frame_parms).pdsch_config_common).p_b = 1;
+  }
+
+  PHY_vars_UE->perfect_ce = perfect_ce;
+
+  printf("Done lte_param_init\n");
+
+
+}
diff --git a/openair1/PHY/INIT/lte_parms.c b/openair1/PHY/INIT/lte_parms.c
index 55bd964aa7e302b1e7853a4e41dc5c5c84b3a215..fa0e731af97830ad22bad3c85f89584cd8246e07 100644
--- a/openair1/PHY/INIT/lte_parms.c
+++ b/openair1/PHY/INIT/lte_parms.c
@@ -68,33 +68,57 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf)
     break;
 
   default:
-    msg("Illegal oversampling %d\n",osf);
+    printf("Illegal oversampling %d\n",osf);
     return(-1);
   }
 
   switch (frame_parms->N_RB_DL) {
+
   case 100:
     if (osf>1) {
-      msg("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL);
+      printf("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL);
       return(-1);
     }
 
-    frame_parms->ofdm_symbol_size = 2048;
-    frame_parms->log2_symbol_size = 11;
-    frame_parms->samples_per_tti = 30720;
-    frame_parms->first_carrier_offset = 2048-600;
+    if (frame_parms->threequarter_fs) {
+      frame_parms->ofdm_symbol_size = 1536;
+      frame_parms->samples_per_tti = 23040;
+      frame_parms->first_carrier_offset = 1536-600;
+      frame_parms->nb_prefix_samples=(frame_parms->nb_prefix_samples*3)>>2;
+      frame_parms->nb_prefix_samples0=(frame_parms->nb_prefix_samples0*3)>>2;
+    }
+    else {
+      frame_parms->ofdm_symbol_size = 2048;
+      frame_parms->samples_per_tti = 30720;
+      frame_parms->first_carrier_offset = 2048-600;
+    }
+    frame_parms->N_RBGS = 4;
+    frame_parms->N_RBG = 25;
+    break;
+
+  case 75:
+    if (osf>1) {
+      printf("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL);
+      return(-1);
+    }
+
+
+    frame_parms->ofdm_symbol_size = 1536;
+    frame_parms->samples_per_tti = 23040;
+    frame_parms->first_carrier_offset = 1536-450;
+    frame_parms->nb_prefix_samples=(frame_parms->nb_prefix_samples*3)>>2;
+    frame_parms->nb_prefix_samples0=(frame_parms->nb_prefix_samples0*3)>>2;
     frame_parms->N_RBGS = 4;
     frame_parms->N_RBG = 25;
     break;
 
   case 50:
     if (osf>1) {
-      msg("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL);
+      printf("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL);
       return(-1);
     }
 
     frame_parms->ofdm_symbol_size = 1024*osf;
-    frame_parms->log2_symbol_size = 10+log2_osf;
     frame_parms->samples_per_tti = 15360*osf;
     frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 300;
     frame_parms->nb_prefix_samples>>=(1-log2_osf);
@@ -105,13 +129,13 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf)
 
   case 25:
     if (osf>2) {
-      msg("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL);
+      printf("Illegal oversampling %d for N_RB_DL %d\n",osf,frame_parms->N_RB_DL);
       return(-1);
     }
 
     frame_parms->ofdm_symbol_size = 512*osf;
 
-    frame_parms->log2_symbol_size = 9+log2_osf;
+
     frame_parms->samples_per_tti = 7680*osf;
     frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 150;
     frame_parms->nb_prefix_samples>>=(2-log2_osf);
@@ -124,7 +148,6 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf)
 
   case 15:
     frame_parms->ofdm_symbol_size = 256*osf;
-    frame_parms->log2_symbol_size = 8+log2_osf;
     frame_parms->samples_per_tti = 3840*osf;
     frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 90;
     frame_parms->nb_prefix_samples>>=(3-log2_osf);
@@ -135,7 +158,6 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf)
 
   case 6:
     frame_parms->ofdm_symbol_size = 128*osf;
-    frame_parms->log2_symbol_size = 7+log2_osf;
     frame_parms->samples_per_tti = 1920*osf;
     frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 36;
     frame_parms->nb_prefix_samples>>=(4-log2_osf);
@@ -145,7 +167,7 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf)
     break;
 
   default:
-    msg("init_frame_parms: Error: Number of resource blocks (N_RB_DL %d) undefined, frame_parms = %p \n",frame_parms->N_RB_DL, frame_parms);
+    printf("init_frame_parms: Error: Number of resource blocks (N_RB_DL %d) undefined, frame_parms = %p \n",frame_parms->N_RB_DL, frame_parms);
     return(-1);
     break;
   }
@@ -159,23 +181,22 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf)
 
 void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms)
 {
-  msg("frame_parms->N_RB_DL=%d\n",frame_parms->N_RB_DL);
-  msg("frame_parms->N_RB_UL=%d\n",frame_parms->N_RB_UL);
-  msg("frame_parms->Nid_cell=%d\n",frame_parms->Nid_cell);
-  msg("frame_parms->Ncp=%d\n",frame_parms->Ncp);
-  msg("frame_parms->Ncp_UL=%d\n",frame_parms->Ncp_UL);
-  msg("frame_parms->nushift=%d\n",frame_parms->nushift);
-  msg("frame_parms->frame_type=%d\n",frame_parms->frame_type);
-  msg("frame_parms->tdd_config=%d\n",frame_parms->tdd_config);
-  msg("frame_parms->tdd_config_S=%d\n",frame_parms->tdd_config_S);
-  msg("frame_parms->mode1_flag=%d\n",frame_parms->mode1_flag);
-  msg("frame_parms->nb_antennas_tx=%d\n",frame_parms->nb_antennas_tx);
-  msg("frame_parms->nb_antennas_rx=%d\n",frame_parms->nb_antennas_rx);
-  msg("frame_parms->ofdm_symbol_size=%d\n",frame_parms->ofdm_symbol_size);
-  msg("frame_parms->log2_symbol_size=%d\n",frame_parms->log2_symbol_size);
-  msg("frame_parms->nb_prefix_samples=%d\n",frame_parms->nb_prefix_samples);
-  msg("frame_parms->nb_prefix_samples0=%d\n",frame_parms->nb_prefix_samples0);
-  msg("frame_parms->first_carrier_offset=%d\n",frame_parms->first_carrier_offset);
-  msg("frame_parms->samples_per_tti=%d\n",frame_parms->samples_per_tti);
-  msg("frame_parms->symbols_per_tti=%d\n",frame_parms->symbols_per_tti);
+  printf("frame_parms->N_RB_DL=%d\n",frame_parms->N_RB_DL);
+  printf("frame_parms->N_RB_UL=%d\n",frame_parms->N_RB_UL);
+  printf("frame_parms->Nid_cell=%d\n",frame_parms->Nid_cell);
+  printf("frame_parms->Ncp=%d\n",frame_parms->Ncp);
+  printf("frame_parms->Ncp_UL=%d\n",frame_parms->Ncp_UL);
+  printf("frame_parms->nushift=%d\n",frame_parms->nushift);
+  printf("frame_parms->frame_type=%d\n",frame_parms->frame_type);
+  printf("frame_parms->tdd_config=%d\n",frame_parms->tdd_config);
+  printf("frame_parms->tdd_config_S=%d\n",frame_parms->tdd_config_S);
+  printf("frame_parms->mode1_flag=%d\n",frame_parms->mode1_flag);
+  printf("frame_parms->nb_antennas_tx=%d\n",frame_parms->nb_antennas_tx);
+  printf("frame_parms->nb_antennas_rx=%d\n",frame_parms->nb_antennas_rx);
+  printf("frame_parms->ofdm_symbol_size=%d\n",frame_parms->ofdm_symbol_size);
+  printf("frame_parms->nb_prefix_samples=%d\n",frame_parms->nb_prefix_samples);
+  printf("frame_parms->nb_prefix_samples0=%d\n",frame_parms->nb_prefix_samples0);
+  printf("frame_parms->first_carrier_offset=%d\n",frame_parms->first_carrier_offset);
+  printf("frame_parms->samples_per_tti=%d\n",frame_parms->samples_per_tti);
+  printf("frame_parms->symbols_per_tti=%d\n",frame_parms->symbols_per_tti);
 }
diff --git a/openair1/PHY/LTE_ESTIMATION/adjust_gain.c b/openair1/PHY/LTE_ESTIMATION/adjust_gain.c
index 52f26a25629e447e6a9e086ea3d634d28257b199..af72bce967cfa8c27465f36fc44b348197ad4bf3 100644
--- a/openair1/PHY/LTE_ESTIMATION/adjust_gain.c
+++ b/openair1/PHY/LTE_ESTIMATION/adjust_gain.c
@@ -29,8 +29,6 @@
 #include "PHY/types.h"
 #include "PHY/defs.h"
 #include "PHY/extern.h"
-#include "MAC_INTERFACE/defs.h"
-#include "MAC_INTERFACE/extern.h"
 
 #ifdef EXMIMO
 #include "openair0_lib.h"
@@ -38,23 +36,16 @@ extern int card;
 #endif
 
 void
-phy_adjust_gain (PHY_VARS_UE *phy_vars_ue, uint8_t eNB_id)
+phy_adjust_gain (PHY_VARS_UE *phy_vars_ue, uint32_t rx_power_fil_dB, uint8_t eNB_id)
 {
 
-  uint16_t rx_power_fil_dB;
 #ifdef EXMIMO
   exmimo_config_t *p_exmimo_config = openair0_exmimo_pci[card].exmimo_config_ptr;
   uint16_t i;
 #endif
-  int rssi;
-
-  rssi = dB_fixed(phy_vars_ue->PHY_measurements.rssi);
-
-  if (rssi>0) rx_power_fil_dB = rssi;
-  else rx_power_fil_dB = phy_vars_ue->PHY_measurements.rx_power_avg_dB[eNB_id];
 
   LOG_D(PHY,"Gain control: rssi %d (%d,%d)\n",
-         rssi,
+         rx_power_fil_dB,
          phy_vars_ue->PHY_measurements.rssi,
          phy_vars_ue->PHY_measurements.rx_power_avg_dB[eNB_id]
         );
diff --git a/openair1/PHY/LTE_ESTIMATION/defs.h b/openair1/PHY/LTE_ESTIMATION/defs.h
index 10dc558c9b46490a27c533e9ec1fb7c5f9809bf2..c20d24e34f2cb6ae324b87d13920617fdf889938 100644
--- a/openair1/PHY/LTE_ESTIMATION/defs.h
+++ b/openair1/PHY/LTE_ESTIMATION/defs.h
@@ -213,6 +213,7 @@ int8_t set_RSRQ_filtered(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index,floa
 
 //! Automatic gain control
 void phy_adjust_gain (PHY_VARS_UE *phy_vars_ue,
+		      uint32_t rx_power_fil_dB,
                       unsigned char eNB_id);
 
 int lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
@@ -243,15 +244,16 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
 
 int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,module_id_t UE_id,uint8_t subframe);
 
-void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNb,
+void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB,
+			     int subframe,
                              module_id_t eNB_id,
                              unsigned char clear);
 
-void lte_eNB_I0_measurements_emul(PHY_VARS_eNB *phy_vars_eNb,
+void lte_eNB_I0_measurements_emul(PHY_VARS_eNB *phy_vars_eNB,
                                   uint8_t sect_id);
 
 
-void lte_eNB_srs_measurements(PHY_VARS_eNB *phy_vars_eNb,
+void lte_eNB_srs_measurements(PHY_VARS_eNB *phy_vars_eNBy,
                               module_id_t eNB_id,
                               module_id_t UE_id,
                               unsigned char init_averaging);
diff --git a/openair1/PHY/LTE_ESTIMATION/filt96_32.h b/openair1/PHY/LTE_ESTIMATION/filt96_32.h
index a29a8c26fb20746613397ddee2b5bc07735ad408..61225974bc406568f39d54ce356f3eafee3f2058 100644
--- a/openair1/PHY/LTE_ESTIMATION/filt96_32.h
+++ b/openair1/PHY/LTE_ESTIMATION/filt96_32.h
@@ -26,187 +26,187 @@
   Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
 
  *******************************************************************************/
-short filt24_0[24] __attribute__((aligned(16))) ={
+short filt24_0[24] __attribute__((aligned(32))) ={
   2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0,0
 };
-short filt24_0_dcl[24] __attribute__((aligned(16))) ={
+short filt24_0_dcl[24] __attribute__((aligned(32))) ={
   2341,4681,7022,9362,11703,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0,0
 };
-short filt24_0_dcr[24] __attribute__((aligned(16))) ={
+short filt24_0_dcr[24] __attribute__((aligned(32))) ={
   2730,5461,8192,10922,13653,16384,14043,11703,9362,7022,4681,0,0,0,0,0,0,0,0,0,0,0,0
 };
 
-short filt24_1[24] __attribute__((aligned(16))) ={
+short filt24_1[24] __attribute__((aligned(32))) ={
   0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0
 };
-short filt24_1_dcl[24] __attribute__((aligned(16))) ={
+short filt24_1_dcl[24] __attribute__((aligned(32))) ={
   0,4681,7022,9362,11703,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0
 };
-short filt24_1_dcr[24] __attribute__((aligned(16))) ={
+short filt24_1_dcr[24] __attribute__((aligned(32))) ={
   0,2730,5461,8192,10922,13653,16384,14043,11703,9362,7022,4681,0,0,0,0,0,0,0,0,0,0,0,0
 };
 
 
-short filt24_2[24] __attribute__((aligned(16))) ={
+short filt24_2[24] __attribute__((aligned(32))) ={
   0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0
 };
-short filt24_2_dcl[24] __attribute__((aligned(16))) ={
+short filt24_2_dcl[24] __attribute__((aligned(32))) ={
   0,0,2341,4681,7022,9362, 11703,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0
 };
-short filt24_2_dcr[24] __attribute__((aligned(16))) ={
+short filt24_2_dcr[24] __attribute__((aligned(32))) ={
   0,0,2730,5461,8192,10922,13653,16384,14043,11703,9362,4681,2341,0,0,0,0,0,0,0,0,0,0,0
 };
 
 //  X X X Y | X X X X | X Y X X
-short filt24_3[24] __attribute__((aligned(16))) ={
+short filt24_3[24] __attribute__((aligned(32))) ={
   0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0
 };
-short filt24_3_dcl[24] __attribute__((aligned(16))) ={
+short filt24_3_dcl[24] __attribute__((aligned(32))) ={
   0,0,0,2341,4681,7022,9362,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0
 };
 //  X X X Y | X X DC X X | X Y X X
-short filt24_3_dcr[24] __attribute__((aligned(16))) ={
+short filt24_3_dcr[24] __attribute__((aligned(32))) ={
   0,0,0,2730,5461,8192,10922,13653,16384,14043,11703,7022,4681,2341,0,0,0,0,0,0,0,0,0,0
 };
 
 
-short filt24_4[24] __attribute__((aligned(16))) ={
+short filt24_4[24] __attribute__((aligned(32))) ={
   0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0
 };
-short filt24_4_dcl[24] __attribute__((aligned(16))) ={
+short filt24_4_dcl[24] __attribute__((aligned(32))) ={
   0,0,0,0,2341,7022,9362,11703,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0
 };
-short filt24_4_dcr[24] __attribute__((aligned(16))) ={
+short filt24_4_dcr[24] __attribute__((aligned(32))) ={
   0,0,0,0,2730,5461,8192,10922,13653,16384,14043,11703,7022,4681,2341,0,0,0,0,0,0,0,0,0
 };
 
-short filt24_5[24] __attribute__((aligned(16))) ={
+short filt24_5[24] __attribute__((aligned(32))) ={
   0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0
 };
 //  X X X Y | X X DC X X | X Y X X
-short filt24_5_dcl[24] __attribute__((aligned(16))) ={
+short filt24_5_dcl[24] __attribute__((aligned(32))) ={
   0,0,0,0,0,2341,4681,9362,11703,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0
 };
-short filt24_5_dcr[24] __attribute__((aligned(16))) ={
+short filt24_5_dcr[24] __attribute__((aligned(32))) ={
   0,0,0,0,0,2730,5461,8192,10922,13653,16384,11703,9362,7022,4681,2730,0,0,0,0,0,0,0,0
 };
 
 
-short filt24_6[24] __attribute__((aligned(16))) ={
+short filt24_6[24] __attribute__((aligned(32))) ={
   0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0
 };
-short filt24_6_dcl[24] __attribute__((aligned(16))) ={
+short filt24_6_dcl[24] __attribute__((aligned(32))) ={
   0,0,0,0,0,0,4681,7022,9362,11703,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0
 };
-short filt24_6_dcr[24] __attribute__((aligned(16))) ={
+short filt24_6_dcr[24] __attribute__((aligned(32))) ={
   0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,14043,11703,9362,7022,4681,0,0,0,0,0,0,0
 };
 
 
-short filt24_7[24] __attribute__((aligned(16))) ={
+short filt24_7[24] __attribute__((aligned(32))) ={
   0,0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0
 };
-short filt24_7_dcl[24] __attribute__((aligned(16))) ={
+short filt24_7_dcl[24] __attribute__((aligned(32))) ={
   0,0,0,0,0,0,0,4681,7022,9362,11703,14043,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0
 };
-short filt24_7_dcr[24] __attribute__((aligned(16))) ={
+short filt24_7_dcr[24] __attribute__((aligned(32))) ={
   0,0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,14043,11703,9362,7022,4681,0,0,0,0,0,0
 };
 
-short filt24_0l[24] __attribute__((aligned(16))) ={
+short filt24_0l[24] __attribute__((aligned(32))) ={
   30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0,0
 };
-short filt24_1l[24] __attribute__((aligned(16))) ={
+short filt24_1l[24] __attribute__((aligned(32))) ={
   0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0
 };
-short filt24_2l[24] __attribute__((aligned(16))) ={
+short filt24_2l[24] __attribute__((aligned(32))) ={
   0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0
 };
-short filt24_3l[24] __attribute__((aligned(16))) ={
+short filt24_3l[24] __attribute__((aligned(32))) ={
   //0,0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0};
   0,0,0,0,0,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0
 };
-short filt24_4l[24] __attribute__((aligned(16))) ={
+short filt24_4l[24] __attribute__((aligned(32))) ={
   0,0,0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0
 };
-short filt24_5l[24] __attribute__((aligned(16))) ={
+short filt24_5l[24] __attribute__((aligned(32))) ={
   0,0,0,0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0
 };
-short filt24_6l[24] __attribute__((aligned(16))) ={
+short filt24_6l[24] __attribute__((aligned(32))) ={
   0,0,0,0,0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0
 };
-short filt24_7l[24] __attribute__((aligned(16))) ={
+short filt24_7l[24] __attribute__((aligned(32))) ={
   0,0,0,0,0,0,0,30037,27306,24576,21845,19114,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0
 };
-short filt24_0l2[24] __attribute__((aligned(16))) ={
+short filt24_0l2[24] __attribute__((aligned(32))) ={
   2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0,0
 };
-short filt24_1l2[24] __attribute__((aligned(16))) ={
+short filt24_1l2[24] __attribute__((aligned(32))) ={
   0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0,0
 };
-short filt24_2l2[24] __attribute__((aligned(16))) ={
+short filt24_2l2[24] __attribute__((aligned(32))) ={
   -2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0,0
 };
-short filt24_3l2[24] __attribute__((aligned(16))) ={
+short filt24_3l2[24] __attribute__((aligned(32))) ={
   -5461,-2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0,0
 };
-short filt24_4l2[24] __attribute__((aligned(16))) ={
+short filt24_4l2[24] __attribute__((aligned(32))) ={
   -8192,-5461,-2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0,0
 };
-short filt24_5l2[24] __attribute__((aligned(16))) ={
+short filt24_5l2[24] __attribute__((aligned(32))) ={
   0,-8192,-5461,-2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0,0
 };
-short filt24_6l2[24] __attribute__((aligned(16))) ={
+short filt24_6l2[24] __attribute__((aligned(32))) ={
   -13653,-10922,-8192,-5461,-2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0,0
 };
-short filt24_7l2[24] __attribute__((aligned(16))) ={
+short filt24_7l2[24] __attribute__((aligned(32))) ={
   0,-13653,-10922,-8192,-5461,-2730,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,0,0,0,0,0
 };
-short filt24_0r[24] __attribute__((aligned(16))) ={
+short filt24_0r[24] __attribute__((aligned(32))) ={
   2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0,0,0,0,0,0
 };
-short filt24_1r[24] __attribute__((aligned(16))) ={
+short filt24_1r[24] __attribute__((aligned(32))) ={
   0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0,0,0,0,0
 };
-short filt24_2r[24] __attribute__((aligned(16))) ={
+short filt24_2r[24] __attribute__((aligned(32))) ={
   0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0,0,0,0
 };
-short filt24_3r[24] __attribute__((aligned(16))) ={
+short filt24_3r[24] __attribute__((aligned(32))) ={
   0,0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0,0,0
 };
-short filt24_4r[24] __attribute__((aligned(16))) ={
+short filt24_4r[24] __attribute__((aligned(32))) ={
   0,0,0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0,0
 };
-short filt24_5r[24] __attribute__((aligned(16))) ={
+short filt24_5r[24] __attribute__((aligned(32))) ={
   0,0,0,0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0,0
 };
-short filt24_6r[24] __attribute__((aligned(16))) ={
+short filt24_6r[24] __attribute__((aligned(32))) ={
   0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0,0
 };
-short filt24_7r[24] __attribute__((aligned(16))) ={
+short filt24_7r[24] __attribute__((aligned(32))) ={
   0,0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,19114,21845,24576,27306,30037,0,0,0,0,0,0
 };
-short filt24_0r2[24] __attribute__((aligned(16))) ={  /****/
+short filt24_0r2[24] __attribute__((aligned(32))) ={  /****/
   2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0,0,0,0,0,0
 };
-short filt24_1r2[24] __attribute__((aligned(16))) ={
+short filt24_1r2[24] __attribute__((aligned(32))) ={
   0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0,0,0,0,0
 };
-short filt24_2r2[24] __attribute__((aligned(16))) ={
+short filt24_2r2[24] __attribute__((aligned(32))) ={
   0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0,0,0,0
 };
-short filt24_3r2[24] __attribute__((aligned(16))) ={
+short filt24_3r2[24] __attribute__((aligned(32))) ={
   0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0,0,0
 };
-short filt24_4r2[24] __attribute__((aligned(16))) ={
+short filt24_4r2[24] __attribute__((aligned(32))) ={
   0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0,0
 };
-short filt24_5r2[24] __attribute__((aligned(16))) ={
+short filt24_5r2[24] __attribute__((aligned(32))) ={
   0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0,0
 };
-short filt24_6r2[24] __attribute__((aligned(16))) ={
+short filt24_6r2[24] __attribute__((aligned(32))) ={
   0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653,0
 };
-short filt24_7r2[24] __attribute__((aligned(16))) ={
+short filt24_7r2[24] __attribute__((aligned(32))) ={
   0,0,0,0,0,0,0,2730,5461,8192,10922,13653,16384,13653,10922,8192,5461,2730,0,-2730,-5461,-8192,-10922,-13653
 };
diff --git a/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c b/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c
index 9425e94d025edb33d97ff937d0fbef412d9ad7f6..059119c605536e1d599c657737e1d14ffd0a626b 100644
--- a/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c
+++ b/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c
@@ -29,8 +29,6 @@
 #include "PHY/types.h"
 #include "PHY/defs.h"
 #include "PHY/extern.h"
-#include "MAC_INTERFACE/defs.h"
-#include "MAC_INTERFACE/extern.h"
 
 #define DEBUG_PHY
 
diff --git a/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c
index 10c0cef42ad4858ec57ee0ac243ae8a262c2d35d..bfbe94bb6118ae686a7cae69df6c2f2a608db246 100644
--- a/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c
+++ b/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c
@@ -203,8 +203,9 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
       multadd_complex_vector_real_scalar(dl_ch-(phy_vars_ue->lte_frame_parms.ofdm_symbol_size<<1),
                                          phy_vars_ue->ch_est_alpha,dl_ch-(phy_vars_ue->lte_frame_parms.ofdm_symbol_size<<1),
                                          1,phy_vars_ue->lte_frame_parms.ofdm_symbol_size);
-
-
+#ifdef DEBUG_CH
+    printf("k %d, first_carrier %d\n",k,phy_vars_ue->lte_frame_parms.first_carrier_offset);
+#endif
     if ((phy_vars_ue->lte_frame_parms.N_RB_DL==6)  ||
         (phy_vars_ue->lte_frame_parms.N_RB_DL==50) ||
         (phy_vars_ue->lte_frame_parms.N_RB_DL==100)) {
@@ -213,7 +214,9 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
       // Treat first 2 pilots specially (left edge)
       ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
       ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
-      // printf("pilot 0 : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
+#ifdef DEBUG_CH
+      printf("pilot 0 : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
+#endif
       multadd_real_vector_complex_scalar(fl,
                                          ch,
                                          dl_ch,
@@ -224,7 +227,9 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
 
       ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
       ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
-      // printf("pilot 1 : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
+#ifdef DEBUG_CH
+      printf("pilot 1 : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
+#endif
       multadd_real_vector_complex_scalar(f2l2,
                                          ch,
                                          dl_ch,
@@ -235,15 +240,13 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
 
       for (pilot_cnt=2; pilot_cnt<((phy_vars_ue->lte_frame_parms.N_RB_DL)-1); pilot_cnt+=2) {
 
-        // printf("%d\n",dl_ch-(int16_t *)&dl_ch_estimates[(p<<1)+aarx][ch_offset]);
-
-        //  printf("pilot[%d][%d] (%d,%d)\n",p,pilot_cnt,pil[0],pil[1]);
-        //  printf("rx[%d] -> (%d,%d)\n", k, rxF[0], rxF[1]);
 
 
         ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15); //Re
         ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15); //Im
-        // printf("**rb %d %d\n",rb,dl_ch-(int16_t *)&dl_ch_estimates[(p<<1)+aarx][ch_offset]);
+#ifdef DEBUG_CH
+	printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
+#endif
         multadd_real_vector_complex_scalar(f,
                                            ch,
                                            dl_ch,
@@ -254,13 +257,11 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
         rxF+=12;
         dl_ch+=8;
 
-        // printf("pilot[%d][%d] (%d,%d)\n",p,rb,pil[0],pil[1]);
-        // printf("rx[%d] -> (%d,%d)\n", k+6, rxF[0], rxF[1]);
-
-
         ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
         ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
-        // printf("**rb %d %d\n",rb,dl_ch-(int16_t *)&dl_ch_estimates[(p<<1)+aarx][ch_offset]);
+#ifdef DEBUG_CH
+	printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
+#endif
         multadd_real_vector_complex_scalar(f2,
                                            ch,
                                            dl_ch,
@@ -281,15 +282,17 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
 
       rxF   = (int16_t *)&rxdataF[aarx][((symbol_offset+1+k))];
 
+#ifdef DEBUG_CH
+      printf("second half k %d\n",k);
+#endif
       for (pilot_cnt=0; pilot_cnt<((phy_vars_ue->lte_frame_parms.N_RB_DL)-3); pilot_cnt+=2) {
-        //  printf("pilot[%d][%d] (%d,%d)\n",p,pilot_cnt,pil[0],pil[1]);
-        //  printf("rx[%d] -> (%d,%d)\n", k+6, rxF[0], rxF[1]);
 
 
         ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
         ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
-
-        //   printf("**rb %d %d\n",rb,dl_ch-(int16_t *)&dl_ch_estimates[(p<<1)+aarx][ch_offset]);
+#ifdef DEBUG_CH
+	printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
+#endif
         multadd_real_vector_complex_scalar(f,
                                            ch,
                                            dl_ch,
@@ -300,8 +303,9 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
 
         ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
         ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
-
-        //   printf("**rb %d %d\n",rb,dl_ch-(int16_T *)&dl_ch_estimates[(p<<1)+aarx][ch_offset]);
+#ifdef DEBUG_CH
+	printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
+#endif
         multadd_real_vector_complex_scalar(f2,
                                            ch,
                                            dl_ch,
@@ -314,8 +318,9 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
 
       ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
       ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
-      //            printf("pilot 49: rxF -> (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
-
+#ifdef DEBUG_CH
+      printf("pilot %d: rxF -> (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
+#endif
       multadd_real_vector_complex_scalar(fr,
                                          ch,
                                          dl_ch,
@@ -326,7 +331,9 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
 
       ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
       ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
-      //             printf("pilot 50: rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
+#ifdef DEBUG_CH
+      printf("pilot %d: rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
+#endif
       multadd_real_vector_complex_scalar(f2r2,
                                          ch,
                                          dl_ch,
@@ -703,24 +710,28 @@ int lte_dl_channel_estimation(PHY_VARS_UE *phy_vars_ue,
 
   void (*idft)(int16_t *,int16_t *, int);
 
-  switch (phy_vars_ue->lte_frame_parms.log2_symbol_size) {
-  case 7:
+  switch (phy_vars_ue->lte_frame_parms.ofdm_symbol_size) {
+  case 128:
     idft = idft128;
     break;
 
-  case 8:
+  case 256:
     idft = idft256;
     break;
 
-  case 9:
+  case 512:
     idft = idft512;
     break;
 
-  case 10:
+  case 1024:
     idft = idft1024;
     break;
 
-  case 11:
+  case 1536:
+    idft = idft1536;
+    break;
+
+  case 2048:
     idft = idft2048;
     break;
 
diff --git a/openair1/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c
index dbb2ba231fff2efd6f2d907fb7f8cc05376b6aeb..1dbafdb911154760bcf283e738219901aa9a7d86 100644
--- a/openair1/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c
+++ b/openair1/PHY/LTE_ESTIMATION/lte_dl_mbsfn_channel_estimation.c
@@ -755,26 +755,27 @@ int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *phy_vars_ue,
     if (phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa]) {
       switch (phy_vars_ue->lte_frame_parms.N_RB_DL) {
       case 6:
-	idft128((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][LTE_CE_OFFSET],
+	idft128((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][8],
 		(int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa],
 		1);
 	break;
       case 25:
-	idft512((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][LTE_CE_OFFSET],
+	idft512((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][8],
 		(int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa],
 		1);
 	break;
       case 50:
-	idft1024((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][LTE_CE_OFFSET],
+	idft1024((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][8],
 		(int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa],
 		1);
 	break;
       case 75:
-	idft1536((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][LTE_CE_OFFSET],
-		(int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa]);
+	idft1536((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][8],
+		 (int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa],
+		 1);
 	break;
       case 100:
-	idft2048((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][LTE_CE_OFFSET],
+	idft2048((int16_t*) &phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_offset][aa][8],
 		(int16_t*) phy_vars_ue->lte_ue_common_vars.dl_ch_estimates_time[eNB_offset][aa],
 		1);
 	break;
diff --git a/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c
index 9564b7842c9e91ea48b0955ef1e8b458e8247de2..8b5c1a1806cb572f99b033eb955902d0697f78c5 100644
--- a/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c
+++ b/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c
@@ -39,110 +39,85 @@
 int32_t rx_power_avg_eNB[3][3];
 
 
-void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNb,
+void lte_eNB_I0_measurements(PHY_VARS_eNB *phy_vars_eNB,
+			     int subframe,
                              unsigned char eNB_id,
                              unsigned char clear)
 {
 
-  LTE_eNB_COMMON *eNB_common_vars = &phy_vars_eNb->lte_eNB_common_vars;
-  LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNb->lte_frame_parms;
-  PHY_MEASUREMENTS_eNB *phy_measurements = &phy_vars_eNb->PHY_measurements_eNB[eNB_id];
+  LTE_eNB_COMMON *eNB_common_vars = &phy_vars_eNB->lte_eNB_common_vars;
+  LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms;
+  PHY_MEASUREMENTS_eNB *phy_measurements = &phy_vars_eNB->PHY_measurements_eNB[eNB_id];
+  uint32_t *rb_mask = phy_vars_eNB->rb_mask_ul;
 
-
-  uint32_t aarx,rx_power_correction;
+  uint32_t aarx /* ,rx_power_correction */;
   uint32_t rb;
   int32_t *ul_ch;
   int32_t n0_power_tot;
-
+  int len;
+  int offset;
   // noise measurements
   // for the moment we measure the noise on the 7th OFDM symbol (in S subframe)
 
   phy_measurements->n0_power_tot = 0;
 
-  /*  printf("rxdataF0 %p, rxdataF1 %p\n",
-   (&eNB_common_vars->rxdataF[0][0][(frame_parms->ofdm_symbol_size + frame_parms->first_carrier_offset)<<1 ]),
-   (&eNB_common_vars->rxdataF[0][1][(frame_parms->ofdm_symbol_size + frame_parms->first_carrier_offset)<<1 ]));
-  */
-  /*
-  for (i=0;i<512;i++)
-    printf("sector 0 antenna 0 : %d,%d\n",((short *)&eNB_common_vars->rxdataF[0][0][(19*frame_parms->ofdm_symbol_size)<<1])[i<<1],
-     ((short *)&eNB_common_vars->rxdataF[0][0][(19*frame_parms->ofdm_symbol_size)<<1])[1+(i<<1)]);
-
-  for (i=0;i<12;i++)
-    //    printf("sector 0 antenna 1 : %d,%d\n",((short *)&eNB_common_vars->rxdataF[0][1][(19*frame_parms->ofdm_symbol_size)<<1])[i<<1],
-     ((short *)&eNB_common_vars->rxdataF[0][1][(19*frame_parms->ofdm_symbol_size)<<1])[1+(i<<1)]);
-  */
-
-  if ( (frame_parms->ofdm_symbol_size == 128) ||
-       (frame_parms->ofdm_symbol_size == 512) )
-    rx_power_correction = 2;
-  else
-    rx_power_correction = 1;
-
   for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
     if (clear == 1)
       phy_measurements->n0_power[aarx]=0;
 
-#ifdef USER_MODE
-    phy_measurements->n0_power[aarx] = ((k1*signal_energy(&eNB_common_vars->rxdata[eNB_id][aarx][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size],
-                                         frame_parms->ofdm_symbol_size)) + k2*phy_measurements->n0_power[aarx])>>10;
-#else
+
     phy_measurements->n0_power[aarx] = ((k1*signal_energy(&eNB_common_vars->rxdata[eNB_id][aarx][(frame_parms->samples_per_tti<<1) -frame_parms->ofdm_symbol_size],
-                                         frame_parms->ofdm_symbol_size))+k2*phy_measurements->n0_power[aarx])>>10;
-#endif
-    phy_measurements->n0_power[aarx] = (phy_measurements->n0_power[aarx] * 12*frame_parms->N_RB_DL)/(frame_parms->ofdm_symbol_size);
+							  frame_parms->ofdm_symbol_size)) + k2*phy_measurements->n0_power[aarx])>>10;
+    //phy_measurements->n0_power[aarx] = (phy_measurements->n0_power[aarx]) * 12*frame_parms->N_RB_DL)/(frame_parms->ofdm_symbol_size);
     phy_measurements->n0_power_dB[aarx] = (unsigned short) dB_fixed(phy_measurements->n0_power[aarx]);
     phy_measurements->n0_power_tot +=  phy_measurements->n0_power[aarx];
   }
 
   phy_measurements->n0_power_tot_dB = (unsigned short) dB_fixed(phy_measurements->n0_power_tot);
 
-  phy_measurements->n0_power_tot_dBm = phy_measurements->n0_power_tot_dB - phy_vars_eNb->rx_total_gain_eNB_dB;
+  phy_measurements->n0_power_tot_dBm = phy_measurements->n0_power_tot_dB - phy_vars_eNB->rx_total_gain_eNB_dB;
   //      printf("n0_power %d\n",phy_measurements->n0_power_tot_dB);
 
 
   for (rb=0; rb<frame_parms->N_RB_UL; rb++) {
 
     n0_power_tot=0;
-
-    for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
-
-
-      if (rb < 12)
-        //  ul_ch    = &eNB_common_vars->rxdataF[eNB_id][aarx][((19*(frame_parms->ofdm_symbol_size)) + frame_parms->first_carrier_offset + (rb*12))<<1];
-        ul_ch    = &eNB_common_vars->rxdataF[eNB_id][aarx][((7*frame_parms->ofdm_symbol_size) + frame_parms->first_carrier_offset + (rb*12))<<1];
-      else if (rb>12)
-        ul_ch    = &eNB_common_vars->rxdataF[eNB_id][aarx][((7*frame_parms->ofdm_symbol_size) + 6 + (rb-13)*12)<<1];
-      else {
-        ul_ch = NULL;
-      }
-
-      if (clear == 1)
-        phy_measurements->n0_subband_power[aarx][rb]=0;
-
-      if (ul_ch) {
-        //  for (i=0;i<24;i+=2)
-        //    printf("re %d => %d\n",i/2,ul_ch[i]);
-        phy_measurements->n0_subband_power[aarx][rb] = ((k1*(signal_energy_nodc(ul_ch,
-            24))*rx_power_correction) + (k2*phy_measurements->n0_subband_power[aarx][rb]))>>11;  // 11 and 24 to compensate for repeated signal format
-
-        phy_measurements->n0_subband_power_dB[aarx][rb] = dB_fixed(phy_measurements->n0_subband_power[aarx][rb]);
-        //  printf("eNb %d, aarx %d, rb %d : energy %d (%d dB)\n",eNB_id,aarx,rb,signal_energy_nodc(ul_ch,24),  phy_measurements->n0_subband_power_dB[aarx][rb]);
-        n0_power_tot += phy_measurements->n0_subband_power[aarx][rb];
-      } else {
-        phy_measurements->n0_subband_power[aarx][rb] = 1;
-        phy_measurements->n0_subband_power_dB[aarx][rb] = -99;
-        n0_power_tot = 1;
+    if ((rb_mask[rb>>5]&(1<<(rb&31))) == 0) {  // check that rb was not used in this subframe
+      for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
+
+      // select the 7th symbol in an uplink subframe
+	offset = (frame_parms->first_carrier_offset + (rb*12))%frame_parms->ofdm_symbol_size;
+	offset += (7*frame_parms->ofdm_symbol_size);
+	ul_ch  = &eNB_common_vars->rxdataF[eNB_id][aarx][offset];
+	len = 12;
+	// just do first half of middle PRB for odd number of PRBs
+	if (((frame_parms->N_RB_UL&1) == 1) && 
+	    (rb==(frame_parms->N_RB_UL>>1))) {
+	  len=6;
+	}
+	if (clear == 1)
+	  phy_measurements->n0_subband_power[aarx][rb]=0;
+
+	AssertFatal(ul_ch, "RX signal buffer (freq) problem");
+
+
+	phy_measurements->n0_subband_power[aarx][rb] = signal_energy_nodc(ul_ch,len);
+	//((k1*(signal_energy_nodc(ul_ch,len))) 
+	  //  + (k2*phy_measurements->n0_subband_power[aarx][rb]));  
+	  
+	phy_measurements->n0_subband_power_dB[aarx][rb] = dB_fixed(phy_measurements->n0_subband_power[aarx][rb]);
+	//		printf("subframe %d (%d): eNb %d, aarx %d, rb %d len %d: energy %d (%d dB)\n",subframe,offset,eNB_id,aarx,rb,len,signal_energy_nodc(ul_ch,len),  
+	//	       phy_measurements->n0_subband_power_dB[aarx][rb]);
+	n0_power_tot += phy_measurements->n0_subband_power[aarx][rb];
       }
+      
+      phy_measurements->n0_subband_power_tot_dB[rb] = dB_fixed(n0_power_tot);
+      phy_measurements->n0_subband_power_tot_dBm[rb] = phy_measurements->n0_subband_power_tot_dB[rb] - phy_vars_eNB->rx_total_gain_eNB_dB - dB_fixed(frame_parms->N_RB_UL);
+      
     }
-
-    phy_measurements->n0_subband_power_tot_dB[rb] = dB_fixed(n0_power_tot);
-    phy_measurements->n0_subband_power_tot_dBm[rb] = phy_measurements->n0_subband_power_tot_dB[rb] - phy_vars_eNb->rx_total_gain_eNB_dB - 14;
-
   }
 }
 
-
 void lte_eNB_srs_measurements(PHY_VARS_eNB *phy_vars_eNb,
                               unsigned char eNB_id,
                               unsigned char UE_id,
diff --git a/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c b/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c
index 9864a50ee29e6dc6d5a343862e1f3f677d38d85f..dfb39a510f0faac40d8598bbc6a286908c627b66 100644
--- a/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c
+++ b/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c
@@ -37,8 +37,6 @@
 #include "PHY/defs.h"
 #include "PHY/extern.h"
 #include "SCHED/extern.h"
-#include "MAC_INTERFACE/defs.h"
-#include "MAC_INTERFACE/extern.h"
 #include <math.h>
 
 #ifdef OPENAIR2
@@ -52,8 +50,8 @@
 int* sync_corr_ue0 = NULL;
 int* sync_corr_ue1 = NULL;
 int* sync_corr_ue2 = NULL;
-int sync_tmp[2048*4] __attribute__((aligned(16)));
-short syncF_tmp[2048*2] __attribute__((aligned(16)));
+int sync_tmp[2048*4] __attribute__((aligned(32)));
+short syncF_tmp[2048*2] __attribute__((aligned(32)));
 
 
 
@@ -61,7 +59,6 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms )   // LTE_UE_COMMON *com
 {
 
   int i,k;
-  //unsigned short ds = frame_parms->log2_symbol_size - 7;
 
   sync_corr_ue0 = (int *)malloc16(LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(int)*frame_parms->samples_per_tti);
   sync_corr_ue1 = (int *)malloc16(LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(int)*frame_parms->samples_per_tti);
@@ -173,24 +170,18 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms )   // LTE_UE_COMMON *com
     
   case 75:
     idft1536((short*)syncF_tmp,          /// complex input
-	    (short*)sync_tmp); /// complex output
+	     (short*)sync_tmp,
+	     1); /// complex output
     break;
   case 100:
     idft2048((short*)syncF_tmp,          /// complex input
-	    (short*)sync_tmp, /// complex output
-	    1);
+	     (short*)sync_tmp, /// complex output
+	     1);
     break;
   default:
     LOG_E(PHY,"Unsupported N_RB_DL %d\n",frame_parms->N_RB_DL);
     break;
   }
-  /*
-      frame_parms->twiddle_ifft,    /// complex twiddle factors
-      frame_parms->rev,             /// bit reversed permutation vector
-      frame_parms->log2_symbol_size,/// log2(FFT_SIZE)
-      (frame_parms->log2_symbol_size/2),
-      0);                            /// 0 - input is in complex Q1.15 format, 1 - input is in complex redundant Q1.15 format)
-  */
 
   for (i=0; i<frame_parms->ofdm_symbol_size; i++)
     ((int32_t*)primary_synch0_time)[i] = sync_tmp[i];
@@ -227,8 +218,8 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms )   // LTE_UE_COMMON *com
     
   case 75:
     idft1536((short*)syncF_tmp,          /// complex input
-	    (short*)sync_tmp /// complex output
-	    );
+	     (short*)sync_tmp, /// complex output
+	     1);
     break;
   case 100:
     idft2048((short*)syncF_tmp,          /// complex input
@@ -275,8 +266,8 @@ int lte_sync_time_init(LTE_DL_FRAME_PARMS *frame_parms )   // LTE_UE_COMMON *com
     
   case 75:
     idft1536((short*)syncF_tmp,          /// complex input
-	    (short*)sync_tmp /// complex output
-	    );
+	     (short*)sync_tmp, /// complex output
+	     1);
     break;
   case 100:
     idft2048((short*)syncF_tmp,          /// complex input
@@ -354,6 +345,8 @@ static inline int abs32(int x)
 int debug_cnt=0;
 #endif
 
+#define SHIFT 17
+
 int lte_sync_time(int **rxdata, ///rx data in time domain
                   LTE_DL_FRAME_PARMS *frame_parms,
                   int *eNB_id)
@@ -422,8 +415,8 @@ int lte_sync_time(int **rxdata, ///rx data in time domain
       //calculate dot product of primary_synch0_time and rxdata[ar][n] (ar=0..nb_ant_rx) and store the sum in temp[n];
       for (ar=0; ar<frame_parms->nb_antennas_rx; ar++) {
 
-        result  = dot_product((short*)primary_synch0_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, 15);
-        result2 = dot_product((short*)primary_synch0_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, 15);
+        result  = dot_product((short*)primary_synch0_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, SHIFT);
+        result2 = dot_product((short*)primary_synch0_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, SHIFT);
 
         ((short*)sync_corr_ue0)[2*n] += ((short*) &result)[0];
         ((short*)sync_corr_ue0)[2*n+1] += ((short*) &result)[1];
@@ -436,8 +429,8 @@ int lte_sync_time(int **rxdata, ///rx data in time domain
       }
 
       for (ar=0; ar<frame_parms->nb_antennas_rx; ar++) {
-        result = dot_product((short*)primary_synch1_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, 15);
-        result2 = dot_product((short*)primary_synch1_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, 15);
+        result = dot_product((short*)primary_synch1_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, SHIFT);
+        result2 = dot_product((short*)primary_synch1_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, SHIFT);
         ((short*)sync_corr_ue1)[2*n] += ((short*) &result)[0];
         ((short*)sync_corr_ue1)[2*n+1] += ((short*) &result)[1];
         ((short*)sync_corr_ue1)[2*(length+n)] += ((short*) &result2)[0];
@@ -451,8 +444,8 @@ int lte_sync_time(int **rxdata, ///rx data in time domain
 
       for (ar=0; ar<frame_parms->nb_antennas_rx; ar++) {
 
-        result = dot_product((short*)primary_synch2_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, 15);
-        result2 = dot_product((short*)primary_synch2_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, 15);
+        result = dot_product((short*)primary_synch2_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, SHIFT);
+        result2 = dot_product((short*)primary_synch2_time, (short*) &(rxdata[ar][n+length]), frame_parms->ofdm_symbol_size, SHIFT);
         ((short*)sync_corr_ue2)[2*n] += ((short*) &result)[0];
         ((short*)sync_corr_ue2)[2*n+1] += ((short*) &result)[1];
         ((short*)sync_corr_ue2)[2*(length+n)] += ((short*) &result2)[0];
@@ -491,13 +484,10 @@ int lte_sync_time(int **rxdata, ///rx data in time domain
 
   *eNB_id = sync_source;
 
-#ifdef DEBUG_PHY
-  msg("[PHY][UE] lte_sync_time: Sync source = %d, Peak found at pos %d, val = %d\n",
-      sync_source,peak_pos,peak_val);
-
-
+  LOG_D(PHY,"[UE] lte_sync_time: Sync source = %d, Peak found at pos %d, val = %d (%d dB)\n",sync_source,peak_pos,peak_val,dB_fixed(peak_val)/2);
 
 
+#ifdef DEBUG_PHY
   if (debug_cnt == 0) {
     write_output("sync_corr0_ue.m","synccorr0",sync_corr_ue0,2*length,1,2);
     write_output("sync_corr1_ue.m","synccorr1",sync_corr_ue1,2*length,1,2);
@@ -569,7 +559,7 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain
       //calculate dot product of primary_synch0_time and rxdata[ar][n] (ar=0..nb_ant_rx) and store the sum in temp[n];
       for (ar=0; ar<frame_parms->nb_antennas_rx; ar++)  {
 
-        result = dot_product((short*)primary_synch_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, 15);
+        result = dot_product((short*)primary_synch_time, (short*) &(rxdata[ar][n]), frame_parms->ofdm_symbol_size, SHIFT);
         //((short*)sync_corr)[2*n]   += ((short*) &result)[0];
         //((short*)sync_corr)[2*n+1] += ((short*) &result)[1];
         sync_corr_eNB[n] += abs32(result);
diff --git a/openair1/PHY/LTE_ESTIMATION/lte_sync_timefreq.c b/openair1/PHY/LTE_ESTIMATION/lte_sync_timefreq.c
index 493583214a3b5206d1f5a4b0d0903e5da4dd07ec..74b46c5eb65e79c0c7adad0d04c38ffa95e6d34e 100644
--- a/openair1/PHY/LTE_ESTIMATION/lte_sync_timefreq.c
+++ b/openair1/PHY/LTE_ESTIMATION/lte_sync_timefreq.c
@@ -56,8 +56,8 @@ void lte_sync_timefreq(PHY_VARS_UE *ue,int band,unsigned int DL_freq)
 {
 #if defined(__x86_64__) || defined(__i386__)
   UE_SCAN_INFO_t *scan_info = &ue->scan_info[band];
-  int16_t spectrum[12288] __attribute__((aligned(16)));
-  int16_t spectrum_p5ms[12288] __attribute__((aligned(16)));
+  int16_t spectrum[12288] __attribute__((aligned(32)));
+  int16_t spectrum_p5ms[12288] __attribute__((aligned(32)));
   int i,f,band_idx;
   __m128i autocorr0[256/4],autocorr1[256/4],autocorr2[256/4];
   __m128i autocorr0_t[256/4],autocorr1_t[256/4],autocorr2_t[256/4];
diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c
index 65c4214427d5be4574db5d1ff86a0a993d6e156f..3bc26ad7e85b88bf57029c8dfcd9de11f3dc9bfc 100644
--- a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c
+++ b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c
@@ -572,7 +572,7 @@ void lte_ue_measurements(PHY_VARS_UE *phy_vars_ue,
         // skip the first 4 RE due to interpolation filter length of 5 (not possible to skip 5 due to 128i alignment, must be multiple of 128bit)
 
 #if defined(__x86_64__) || defined(__i386__)
-       __m128i pmi128_re,pmi128_im,mmtmpPMI0,mmtmpPMI1,mmtmpPMI2,mmtmpPMI3;
+       __m128i pmi128_re,pmi128_im,mmtmpPMI0,mmtmpPMI1 /* ,mmtmpPMI2,mmtmpPMI3 */ ;
 
         dl_ch0_128    = (__m128i *)&phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_id][aarx][4];
         dl_ch1_128    = (__m128i *)&phy_vars_ue->lte_ue_common_vars.dl_ch_estimates[eNB_id][2+aarx][4];
diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
index 1d23bdca38d7b4121485d3777fdfdd268fbce9e1..1de23f64122c72abf0b4e680a748c7305a814ad2 100644
--- a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
+++ b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
@@ -31,6 +31,7 @@
 #include "PHY/sse_intrin.h"
 //#define DEBUG_CH
 
+#include "T.h"
 
 // For Channel Estimation in Distributed Alamouti Scheme
 //static int16_t temp_out_ifft[2048*4] __attribute__((aligned(16)));
@@ -40,8 +41,8 @@ static int16_t temp_out_ifft_0[2048*4] __attribute__((aligned(16)));
 static int16_t temp_out_ifft_1[2048*4] __attribute__((aligned(16)));
 
 
-static int32_t temp_in_ifft_0[2048*2] __attribute__((aligned(16)));
-static int32_t temp_in_ifft_1[2048*2] __attribute__((aligned(16)));
+static int32_t temp_in_ifft_0[2048*2] __attribute__((aligned(32)));
+static int32_t temp_in_ifft_1[2048*2] __attribute__((aligned(32)));
 static int32_t temp_in_fft_0[2048*2] __attribute__((aligned(16)));
 static int32_t temp_in_fft_1[2048*2] __attribute__((aligned(16)));
 
@@ -331,6 +332,13 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
 	break;
       }
 
+#if T_TRACER
+      if (aa == 0)
+        T(T_ENB_PHY_UL_CHANNEL_ESTIMATE, T_INT(eNB_id), T_INT(UE_id),
+          T_INT(phy_vars_eNB->proc[sched_subframe].frame_rx), T_INT(subframe),
+          T_INT(0), T_BUFFER(ul_ch_estimates_time[0], 512  * 4));
+#endif
+
 #ifdef DEBUG_CH
 
       if (aa==0) {
@@ -432,7 +440,7 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
         in_fft_ptr_0 = &temp_in_fft_0[0];
         in_fft_ptr_1 = &temp_in_fft_1[0];
 
-        for(j=0; j<(1<<(frame_parms->log2_symbol_size))/12; j++) {
+        for(j=0; j<(frame_parms->ofdm_symbol_size)/12; j++) {
           if (j>19) {
             ((int16_t*)in_fft_ptr_0)[-40+(2*j)] = ((int16_t*)temp_out_ifft_0)[-80+(2*j)]*rx_power_correction;
             ((int16_t*)in_fft_ptr_0)[-40+(2*j)+1] = ((int16_t*)temp_out_ifft_0)[-80+(2*j+1)]*rx_power_correction;
diff --git a/openair1/PHY/LTE_REFSIG/defs.h b/openair1/PHY/LTE_REFSIG/defs.h
index b48403ff9973cfc1890dbd0019767e42e0b5f29a..f8701a63a82e0c4e1b38bde5a8388703590ec88e 100644
--- a/openair1/PHY/LTE_REFSIG/defs.h
+++ b/openair1/PHY/LTE_REFSIG/defs.h
@@ -73,7 +73,7 @@ void lte_gold_mbsfn(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_mbsfn_tabl
 
 
 int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB,
-                     mod_sym_t *output,
+                     int32_t *output,
                      short amp,
                      unsigned char Ns,
                      unsigned char l,
@@ -89,7 +89,7 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB,
 */
 int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
                    uint8_t UE_id,
-                   mod_sym_t *output,
+                   int32_t *output,
                    short amp,
                    uint8_t Ns,
                    uint8_t p,
@@ -102,7 +102,7 @@ int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
 @param Ns Slot number (0..19)
 @param l symbol (0,1,2)
 */
-int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, mod_sym_t *output,
+int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, int32_t *output,
                  short amp,
                  int subframe,
                  unsigned char l);
@@ -148,7 +148,7 @@ void free_ul_ref_sigs(void);
 @sub_frame_offset  Offset of this subframe in units of subframes
 */
 
-int lte_generate_srs(mod_sym_t **txdataF,
+int lte_generate_srs(int32_t **txdataF,
                      short amp,
                      LTE_DL_FRAME_PARMS *frame_parms,
                      unsigned int sub_frame_offset);
diff --git a/openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c b/openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c
index 6faf2e1ed0ee47816182be2473859fe1ac82bcac..9ffda3a83d914e001a07d561a314f1e21fe7a77c 100644
--- a/openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c
+++ b/openair1/PHY/LTE_REFSIG/lte_dl_cell_spec.c
@@ -41,7 +41,7 @@
 
 //Calibration
 int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB,
-                        mod_sym_t *output,
+                        int32_t *output,
                         short amp,
                         unsigned char Ns,
                         unsigned char l,//nb of sym per slot
@@ -50,7 +50,7 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB,
 
   unsigned char nu,mprime,mprime_dword,mprime_qpsk_symb,m;
   unsigned short k,a;
-  mod_sym_t qpsk[4];
+  int32_t qpsk[4];
 
   a = (amp*ONE_OVER_SQRT2_Q15)>>15;
   ((short *)&qpsk[0])[0] = a;
@@ -72,7 +72,7 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB,
   else if ((p==1) && (l>0))
     nu = 0;
   else {
-    msg("lte_dl_cell_spec: p %d, l %d -> ERROR\n",p,l);
+    printf("lte_dl_cell_spec: p %d, l %d -> ERROR\n",p,l);
     return(-1);
   }
 
@@ -94,9 +94,9 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB,
     output[k] = qpsk[(phy_vars_eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3];
     //output[k] = (lte_gold_table[eNB_offset][Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3;
 #ifdef DEBUG_DL_CELL_SPEC
-    msg("Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n",
+    printf("Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n",
               Ns,l,m,mprime_dword,mprime_qpsk_symb);
-    msg("index = %d (k %d)\n",(phy_vars_eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k);
+    printf("index = %d (k %d)\n",(phy_vars_eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k);
 #endif
 
     mprime++;
@@ -121,7 +121,7 @@ int lte_dl_cell_spec_SS(PHY_VARS_eNB *phy_vars_eNB,
 
 
 int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB,
-                     mod_sym_t *output,
+                     int32_t *output,
                      short amp,
                      unsigned char Ns,
                      unsigned char l,
@@ -130,7 +130,7 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB,
 
   unsigned char nu,mprime,mprime_dword,mprime_qpsk_symb,m;
   unsigned short k,a;
-  mod_sym_t qpsk[4];
+  int32_t qpsk[4];
 
   a = (amp*ONE_OVER_SQRT2_Q15)>>15;
   ((short *)&qpsk[0])[0] = a;
@@ -151,7 +151,7 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB,
   else if ((p==1) && (l>0))
     nu = 0;
   else {
-    msg("lte_dl_cell_spec: p %d, l %d -> ERROR\n",p,l);
+    printf("lte_dl_cell_spec: p %d, l %d -> ERROR\n",p,l);
     return(-1);
   }
 
@@ -177,9 +177,9 @@ int lte_dl_cell_spec(PHY_VARS_eNB *phy_vars_eNB,
     output[k] = qpsk[(phy_vars_eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3];
     //output[k] = (lte_gold_table[eNB_offset][Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3;
 #ifdef DEBUG_DL_CELL_SPEC
-    msg("Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n",
+    printf("Ns %d, l %d, m %d,mprime_dword %d, mprime_qpsk_symbol %d\n",
         Ns,l,m,mprime_dword,mprime_qpsk_symb);
-    msg("index = %d (k %d)\n",(phy_vars_eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k);
+    printf("index = %d (k %d)\n",(phy_vars_eNB->lte_gold_table[Ns][l][mprime_dword]>>(2*mprime_qpsk_symb))&3,k);
 #endif
 
     mprime++;
diff --git a/openair1/PHY/LTE_REFSIG/lte_dl_mbsfn.c b/openair1/PHY/LTE_REFSIG/lte_dl_mbsfn.c
index c3b141841a9d2fba22cf27e66601f32c37d91d43..9c3269b863b9c5ae8de92b8248b6968f2fee25cd 100644
--- a/openair1/PHY/LTE_REFSIG/lte_dl_mbsfn.c
+++ b/openair1/PHY/LTE_REFSIG/lte_dl_mbsfn.c
@@ -39,7 +39,7 @@
 //extern unsigned int lte_gold_table[10][3][42];
 //#define DEBUG_DL_MBSFN
 
-int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, mod_sym_t *output,
+int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, int32_t *output,
                  short amp,
                  int subframe,
                  unsigned char l)
@@ -47,7 +47,7 @@ int lte_dl_mbsfn(PHY_VARS_eNB *phy_vars_eNB, mod_sym_t *output,
 
   unsigned int mprime,mprime_dword,mprime_qpsk_symb,m;
   unsigned short k=0,a;
-  mod_sym_t qpsk[4];
+  int32_t qpsk[4];
 
   a = (amp*ONE_OVER_SQRT2_Q15)>>15;
   ((short *)&qpsk[0])[0] = a;
diff --git a/openair1/PHY/LTE_REFSIG/lte_dl_uespec.c b/openair1/PHY/LTE_REFSIG/lte_dl_uespec.c
index e7b3dd2ed1826bab0b2ac5f49be0a3323cec367d..9b094393c7cbb0fbff56dec693377cd4c0ae7bc5 100644
--- a/openair1/PHY/LTE_REFSIG/lte_dl_uespec.c
+++ b/openair1/PHY/LTE_REFSIG/lte_dl_uespec.c
@@ -54,14 +54,14 @@ int Wbar_NCP[8][4] = {{1,1,1,1},{1,-1,1,-1},{1,1,1,1},{1,-1,1,-1},{1,1,-1,-1},{-
 
 int lte_dl_ue_spec(PHY_VARS_eNB *phy_vars_eNB,
                    uint8_t UE_id,
-                   mod_sym_t *output,
+                   int32_t *output,
                    short amp,
                    uint8_t Ns,
                    uint8_t p,
                    int SS_flag )
 {
 
-  mod_sym_t qpsk[4],nqpsk[4],*qpsk_p,*output_p;
+  int32_t qpsk[4],nqpsk[4],*qpsk_p,*output_p;
   int16_t a;
   int w,lprime,ind,l,ind_dword,ind_qpsk_symb,nPRB;
   //  LTE_eNB_DLSCH_t *dlsch = phy_vars_eNB->dlsch_eNB[UE_id][0];
diff --git a/openair1/PHY/LTE_REFSIG/lte_gold.c b/openair1/PHY/LTE_REFSIG/lte_gold.c
index 567851a51a6cd376f2cd6841782dd7fb374b402d..bfd67166408a9e3a1e777cd30ffcbd6118812a9b 100644
--- a/openair1/PHY/LTE_REFSIG/lte_gold.c
+++ b/openair1/PHY/LTE_REFSIG/lte_gold.c
@@ -61,21 +61,18 @@ void lte_gold(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_table[20][2][14]
 
       x2 = Ncp +
            (Nid_cell<<1) +
-           (((1+(Nid_cell<<1))*(1 + (((frame_parms->Ncp==0)?4:3)*l) + (7*(1+ns))))<<10); //cinit
+	(((1+(Nid_cell<<1))*(1 + (((frame_parms->Ncp==0)?4:3)*l) + (7*(1+ns))))<<10); //cinit
       //x2 = frame_parms->Ncp + (Nid_cell<<1) + (1+(Nid_cell<<1))*(1 + (3*l) + (7*(1+ns))); //cinit
       //n = 0
-      //      printf("cinit (ns %d, l %d) => %d\n",ns,l,x2);
       x1 = 1+ (1<<31);
       x2=x2 ^ ((x2 ^ (x2>>1) ^ (x2>>2) ^ (x2>>3))<<31);
 
       // skip first 50 double words (1600 bits)
-      //printf("n=0 : x1 %x, x2 %x\n",x1,x2);
       for (n=1; n<50; n++) {
         x1 = (x1>>1) ^ (x1>>4);
         x1 = x1 ^ (x1<<31) ^ (x1<<28);
         x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4);
         x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28);
-        //  printf("x1 : %x, x2 : %x\n",x1,x2);
       }
 
       for (n=0; n<14; n++) {
@@ -84,7 +81,6 @@ void lte_gold(LTE_DL_FRAME_PARMS *frame_parms,uint32_t lte_gold_table[20][2][14]
         x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4);
         x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28);
         lte_gold_table[ns][l][n] = x1^x2;
-        //  printf("n=%d : c %x\n",n,x1^x2);
       }
 
     }
diff --git a/openair1/PHY/LTE_REFSIG/lte_ul_ref.c b/openair1/PHY/LTE_REFSIG/lte_ul_ref.c
index 75599f4b71022a817140bff16a40884bb1fa9787..4020abe361421c8a978d124867980dacfc2d6157 100644
--- a/openair1/PHY/LTE_REFSIG/lte_ul_ref.c
+++ b/openair1/PHY/LTE_REFSIG/lte_ul_ref.c
@@ -35,16 +35,18 @@
 
 uint16_t dftsizes[33] = {12,24,36,48,60,72,96,108,120,144,180,192,216,240,288,300,324,360,384,432,480,540,576,600,648,720,864,900,960,972,1080,1152,1200};
 
-uint16_t ref_primes[33] = {11,23,31,47,50,71,89,107,113,139,179,191,211,239,283,293,317,359,383,431,479,523,571,599,647,719,863,887,953,971,1069,1151,1193};
+uint16_t ref_primes[33] = {11,23,31,47,59,71,89,107,113,139,179,191,211,239,283,293,317,359,383,431,479,523,571,599,647,719,863,887,953,971,1069,1151,1193};
 
 
 int16_t *ul_ref_sigs[30][2][33];
 int16_t *ul_ref_sigs_rx[30][2][33]; //these contain the sequences in repeated format and quantized to QPSK ifdef IFFT_FPGA
 
+/* 36.211 table 5.5.1.2-1 */
 char ref12[360] = {-1,1,3,-3,3,3,1,1,3,1,-3,3,1,1,3,3,3,-1,1,-3,-3,1,-3,3,1,1,-3,-3,-3,-1,-3,-3,1,-3,1,-1,-1,1,1,1,1,-1,-3,-3,1,-3,3,-1,-1,3,1,-1,1,-1,-3,-1,1,-1,1,3,1,-3,3,-1,-1,1,1,-1,-1,3,-3,1,-1,3,-3,-3,-3,3,1,-1,3,3,-3,1,-3,-1,-1,-1,1,-3,3,-1,1,-3,3,1,1,-3,3,1,-1,-1,-1,1,1,3,-1,1,1,-3,-1,3,3,-1,-3,1,1,1,1,1,-1,3,-1,1,1,-3,-3,-1,-3,-3,3,-1,3,1,-1,-1,3,3,-3,1,3,1,3,3,1,-3,1,1,-3,1,1,1,-3,-3,-3,1,3,3,-3,3,-3,1,1,3,-1,-3,3,3,-3,1,-1,-3,-1,3,1,3,3,3,-1,1,3,-1,1,-3,-1,-1,1,1,3,1,-1,-3,1,3,1,-1,1,3,3,3,-1,-1,3,-1,-3,1,1,3,-3,3,-3,-3,3,1,3,-1,-3,3,1,1,-3,1,-3,-3,-1,-1,1,-3,-1,3,1,3,1,-1,-1,3,-3,-1,-3,-1,-1,-3,1,1,1,1,3,1,-1,1,-3,-1,-1,3,-1,1,-3,-3,-3,-3,-3,1,-1,-3,1,1,-3,-3,-3,-3,-1,3,-3,1,-3,3,1,1,-1,-3,-1,-3,1,-1,1,3,-1,1,1,1,3,1,3,3,-1,1,-1,-3,-3,1,1,-3,3,3,1,3,3,1,-3,-1,-1,3,1,3,-3,-3,3,-3,1,-1,-1,3,-1,-3,-3,-1,-3,-1,-3,3,1,-1,1,3,-3,-3,-1,3,-3,3,-1,3,3,-3,3,3,-1,-1,3,-3,-3,-1,-1,-3,-1,3,-3,3,1,-1};
 
+/* 36.211 table 5.5.1.2-2 */
 char ref24[720] = {
-  -1,3,1,-3,3,-1,1,3,-3,3,1,3,-3,3,1,1,-1,1,3,-3,3,-3,-1,-3,-3,3,-3,-3,-3,1,-3,-3,3,-1,1,1,1,3,1,-1,3,-3,-3,1,3,1,1,-3,3,-1,3,3,1,1,-3,3,3,3,3,1,-1,3,-1,1,1,-1,-3,-1,-1,1,3,3,-1,-3,1,1,3,-3,1,1,-3,-1,-1,1,3,1,3,1,-1,3,1,1,-3,-1,-3,-1,-1,-1,-1,-3,-3,-1,1,1,3,3,-1,3,-1,1,-1,-3,1,-1,-3,-3,1,-3,-1,-1,-3,1,1,3,-1,1,3,1,-3,1,-3,1,1,-1,-1,3,-1,-3,3,-3,-3,-3,1,1,1,1,-1,-1,3,-3,-3,3,-3,1,-1,-1,1,-1,1,1,-1,-3,-1,1,-1,3,-1,-3,-3,3,3,-1,-1,-3,-1,3,1,3,1,3,1,1,-1,3,1,-1,1,3,-3,-1,-1,1,-3,1,3,-3,1,-1,-3,3,-3,3,-1,-1,-1,-1,1,-3,-3,-3,1,-3,-3,-3,1,-3,1,1,-3,3,3,-1,-3,-1,3,-3,3,3,3,-1,1,1,-3,1,-1,1,1,-3,1,1,-1,1,-3,-3,3,-1,3,-1,-1,-3,-3,-3,-1,-3,-3,1,-1,1,3,3,-1,1,-1,3,1,3,3,-3,-3,1,3,1,-1,-3,-3,-3,3,3,-3,3,3,-1,-3,3,-1,1,-3,1,1,3,3,1,1,1,-1,-1,1,-3,3,-1,1,1,-3,3,3,-1,-3,3,-3,-1,-3,-1,-1,-1,-1,-1,-3,-1,3,3,1,-1,1,3,3,3,-1,1,1,-3,1,3,-1,-3,3,-3,-3,3,1,3,1,-3,3,1,3,1,1,3,3,-1,-1,-3,1,-3,-1,3,1,1,3,-1,-1,1,-3,1,3,-3,1,-1,-3,-1,3,1,3,1,-1,-3,-3,-1,-1,-3,-3,-3,-1,-1,-3,3,-1,-1,-1,-1,1,1,-3,3,1,3,3,1,-1,1,-3,1,-3,1,1,-3,-1,1,3,-1,3,3,-1,-3,1,-1,-3,3,3,3,-1,1,1,3,-1,-3,-1,3,-1,-1,-1,1,1,1,1,1,-1,3,-1,-3,1,1,3,-3,1,-3,-1,1,1,-3,-3,3,1,1,-3,1,3,3,1,-1,-3,3,-1,3,3,3,-3,1,-1,1,-1,-3,-1,1,3,-1,3,-3,-3,-1,-3,3,-3,-3,-3,-1,-1,-3,-1,-3,3,1,3,-3,-1,3,-1,1,-1,3,-3,1,-1,-3,-3,1,1,-1,1,-1,1,-1,3,1,-3,-1,1,-1,1,-1,-1,3,3,-3,-1,1,-3,-3,-1,-3,3,1,-1,-3,-1,-3,-3,3,-3,3,-3,-1,1,3,1,-3,1,3,3,-1,-3,-1,-1,-1,-1,3,3,3,1,3,3,-3,1,3,-1,3,-1,3,3,-3,3,1,-1,3,3,1,-1,3,3,-1,-3,3,-3,-1,-1,3,-1,3,-1,-1,1,1,1,1,-1,-1,-3,-1,3,1,-1,1,-1,3,-1,3,1,1,-1,-1,-3,1,1,-3,1,3,-3,1,1,-3,-3,-1,-1,-3,-1,1,3,1,1,-3,-1,-1,-3,3,-3,3,1,-3,3,-3,1,-1,1,-3,1,1,1,-1,-3,3,3,1,1,3,-1,-3,-1,-1,-1,3,1,-3,-3,-1,3,-3,-1,-3,-1,-3,-1,-1,-3,-1,-1,1,-3,-1,-1,1,-1,-3,1,1,-3,1,-3,-3,3,1,1,-1,3,-1,-1,1,1,-1,-1,-3,-1,3,-1,3,-1,1,3,1,-1,3,1,3,-3,-3,1,-1,-1,1,3
+  -1,3,1,-3,3,-1,1,3,-3,3,1,3,-3,3,1,1,-1,1,3,-3,3,-3,-1,-3,-3,3,-3,-3,-3,1,-3,-3,3,-1,1,1,1,3,1,-1,3,-3,-3,1,3,1,1,-3,3,-1,3,3,1,1,-3,3,3,3,3,1,-1,3,-1,1,1,-1,-3,-1,-1,1,3,3,-1,-3,1,1,3,-3,1,1,-3,-1,-1,1,3,1,3,1,-1,3,1,1,-3,-1,-3,-1,-1,-1,-1,-3,-3,-1,1,1,3,3,-1,3,-1,1,-1,-3,1,-1,-3,-3,1,-3,-1,-1,-3,1,1,3,-1,1,3,1,-3,1,-3,1,1,-1,-1,3,-1,-3,3,-3,-3,-3,1,1,1,1,-1,-1,3,-3,-3,3,-3,1,-1,-1,1,-1,1,1,-1,-3,-1,1,-1,3,-1,-3,-3,3,3,-1,-1,-3,-1,3,1,3,1,3,1,1,-1,3,1,-1,1,3,-3,-1,-1,1,-3,1,3,-3,1,-1,-3,3,-3,3,-1,-1,-1,-1,1,-3,-3,-3,1,-3,-3,-3,1,-3,1,1,-3,3,3,-1,-3,-1,3,-3,3,3,3,-1,1,1,-3,1,-1,1,1,-3,1,1,-1,1,-3,-3,3,-1,3,-1,-1,-3,-3,-3,-1,-3,-3,1,-1,1,3,3,-1,1,-1,3,1,3,3,-3,-3,1,3,1,-1,-3,-3,-3,3,3,-3,3,3,-1,-3,3,-1,1,-3,1,1,3,3,1,1,1,-1,-1,1,-3,3,-1,1,1,-3,3,3,-1,-3,3,-3,-1,-3,-1,3,-1,-1,-1,-1,-3,-1,3,3,1,-1,1,3,3,3,-1,1,1,-3,1,3,-1,-3,3,-3,-3,3,1,3,1,-3,3,1,3,1,1,3,3,-1,-1,-3,1,-3,-1,3,1,1,3,-1,-1,1,-3,1,3,-3,1,-1,-3,-1,3,1,3,1,-1,-3,-3,-1,-1,-3,-3,-3,-1,-1,-3,3,-1,-1,-1,-1,1,1,-3,3,1,3,3,1,-1,1,-3,1,-3,1,1,-3,-1,1,3,-1,3,3,-1,-3,1,-1,-3,3,3,3,-1,1,1,3,-1,-3,-1,3,-1,-1,-1,1,1,1,1,1,-1,3,-1,-3,1,1,3,-3,1,-3,-1,1,1,-3,-3,3,1,1,-3,1,3,3,1,-1,-3,3,-1,3,3,3,-3,1,-1,1,-1,-3,-1,1,3,-1,3,-3,-3,-1,-3,3,-3,-3,-3,-1,-1,-3,-1,-3,3,1,3,-3,-1,3,-1,1,-1,3,-3,1,-1,-3,-3,1,1,-1,1,-1,1,-1,3,1,-3,-1,1,-1,1,-1,-1,3,3,-3,-1,1,-3,-3,-1,-3,3,1,-1,-3,-1,-3,-3,3,-3,3,-3,-1,1,3,1,-3,1,3,3,-1,-3,-1,-1,-1,-1,3,3,3,1,3,3,-3,1,3,-1,3,-1,3,3,-3,3,1,-1,3,3,1,-1,3,3,-1,-3,3,-3,-1,-1,3,-1,3,-1,-1,1,1,1,1,-1,-1,-3,-1,3,1,-1,1,-1,3,-1,3,1,1,-1,-1,-3,1,1,-3,1,3,-3,1,1,-3,-3,-1,-1,-3,-1,1,3,1,1,-3,-1,-1,-3,3,-3,3,1,-3,3,-3,1,-1,1,-3,1,1,1,-1,-3,3,3,1,1,3,-1,-3,-1,-1,-1,3,1,-3,-3,-1,3,-3,-1,-3,-1,-3,-1,-1,-3,-1,-1,1,-3,-1,-1,1,-1,-3,1,1,-3,1,-3,-3,3,1,1,-1,3,-1,-1,1,1,-1,-1,-3,-1,3,-1,3,-1,1,3,1,-1,3,1,3,-3,-3,1,-1,-1,1,3
 };
 
 void generate_ul_ref_sigs(void)
@@ -127,7 +129,7 @@ void generate_ul_ref_sigs_rx(void)
     for (u=0; u<30; u++) {
       for (v=0; v<2; v++) {
         qbar = ref_primes[Msc_RS] * (u+1)/(double)31;
-        ul_ref_sigs_rx[u][v][Msc_RS] = (int16_t*)malloc16(4*sizeof(int16_t)*dftsizes[Msc_RS]);
+        ul_ref_sigs_rx[u][v][Msc_RS] = (int16_t*)malloc16(2*sizeof(int16_t)*dftsizes[Msc_RS]);
 
         if ((((int)floor(2*qbar))&1) == 0)
           q = (int)(floor(qbar+.5)) - v;
@@ -163,7 +165,7 @@ void generate_ul_ref_sigs_rx(void)
 
   // These are the sequences for RB 1
   for (u=0; u<30; u++) {
-    ul_ref_sigs_rx[u][0][0] = (int16_t*)malloc16(4*sizeof(int16_t)*dftsizes[0]);
+    ul_ref_sigs_rx[u][0][0] = (int16_t*)malloc16(2*sizeof(int16_t)*dftsizes[0]);
 
     for (n=0; n<dftsizes[0]; n++) {
       ul_ref_sigs_rx[u][0][0][n<<1]    = (int16_t)(floor(32767*cos(M_PI*ref12[(u*12) + n]/4)));
@@ -173,13 +175,11 @@ void generate_ul_ref_sigs_rx(void)
 
   // These are the sequences for RB 2
   for (u=0; u<30; u++) {
-    ul_ref_sigs_rx[u][0][1] = (int16_t*)malloc16(4*sizeof(int16_t)*dftsizes[1]);
+    ul_ref_sigs_rx[u][0][1] = (int16_t*)malloc16(2*sizeof(int16_t)*dftsizes[1]);
 
     for (n=0; n<dftsizes[1]; n++) {
       ul_ref_sigs_rx[u][0][1][n<<1]    = (int16_t)(floor(32767*cos(M_PI*ref24[(u*24) + n]/4)));
       ul_ref_sigs_rx[u][0][1][1+(n<<1)]= (int16_t)(floor(32767*sin(M_PI*ref24[(u*24) + n]/4)));
-      ul_ref_sigs_rx[u][0][1][2+(n<<2)]=-(int16_t)(floor(32767*sin(M_PI*ref24[(u*24) + n]/4)));
-      ul_ref_sigs_rx[u][0][1][3+(n<<2)]= (int16_t)(floor(32767*cos(M_PI*ref24[(u*24) + n]/4)));
     }
 
   }
diff --git a/openair1/PHY/LTE_REFSIG/primary_synch.h b/openair1/PHY/LTE_REFSIG/primary_synch.h
index f9cf6fc171d156cf197be85d54debc479d66abd1..717f2e552cab59313b7c02b7ef4347070f4667b6 100644
--- a/openair1/PHY/LTE_REFSIG/primary_synch.h
+++ b/openair1/PHY/LTE_REFSIG/primary_synch.h
@@ -1,31 +1,3 @@
-/*******************************************************************************
-    OpenAirInterface
-    Copyright(c) 1999 - 2014 Eurecom
-
-    OpenAirInterface is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-
-    OpenAirInterface is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with OpenAirInterface.The full GNU General Public License is
-   included in this distribution in the file called "COPYING". If not,
-   see <http://www.gnu.org/licenses/>.
-
-  Contact Information
-  OpenAirInterface Admin: openair_admin@eurecom.fr
-  OpenAirInterface Tech : openair_tech@eurecom.fr
-  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
-
-  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
-
- *******************************************************************************/
 short primary_synch0[144] = {0,0,0,0,0,0,0,0,0,0,32767,0,-26120,-19785,11971,-30502,-24020,-22288,32117,6492,31311,9658,-16384,-28378,25100,-21063,-7292,-31946,20429,25618,14948,29158,11971,-30502,31311,9658,25100,-21063,-16384,28377,-24020,22287,32117,6492,-7292,31945,20429,25618,-26120,-19785,-16384,-28378,-16384,28377,-26120,-19785,-32402,4883,31311,-9659,32117,6492,-7292,-31946,32767,-1,25100,-21063,-24020,22287,-32402,4883,-32402,4883,-24020,22287,25100,-21063,32767,-1,-7292,-31946,32117,6492,31311,-9659,-32402,4883,-26120,-19785,-16384,28377,-16384,-28378,-26120,-19785,20429,25618,-7292,31945,32117,6492,-24020,22287,-16384,28377,25100,-21063,31311,9658,11971,-30502,14948,29158,20429,25618,-7292,-31946,25100,-21063,-16384,-28378,31311,9658,32117,6492,-24020,-22288,11971,-30502,-26120,-19785,32767,0,0,0,0,0,0,0,0,0,0,0};
 short primary_synch1[144] = {0,0,0,0,0,0,0,0,0,0,32767,0,-31754,-8086,-24020,-22288,2448,32675,-26120,19784,27073,18458,-16384,28377,25100,21062,-29523,14217,-7292,31945,-13477,-29868,-24020,-22288,27073,18458,25100,21062,-16384,-28378,2448,-32676,-26120,19784,-29523,-14218,-7292,31945,-31754,-8086,-16384,28377,-16384,-28378,-31754,-8086,31311,-9659,27073,-18459,-26120,19784,-29523,14217,32767,-1,25100,21062,2448,-32676,31311,-9659,31311,-9659,2448,-32676,25100,21062,32767,0,-29523,14217,-26120,19784,27073,-18459,31311,-9659,-31754,-8086,-16384,-28378,-16384,28377,-31754,-8086,-7292,31945,-29523,-14218,-26120,19784,2448,-32676,-16384,-28378,25100,21062,27073,18458,-24020,-22288,-13477,-29868,-7292,31945,-29523,14217,25100,21062,-16384,28377,27073,18458,-26120,19784,2448,32675,-24020,-22288,-31754,-8086,32767,0,0,0,0,0,0,0,0,0,0,0};
 short primary_synch2[144] = {0,0,0,0,0,0,0,0,0,0,32767,0,-31754,8085,-24020,22287,2448,-32676,-26120,-19785,27073,-18459,-16384,-28378,25100,-21063,-29523,-14218,-7292,-31946,-13477,29867,-24020,22287,27073,-18459,25100,-21063,-16384,28377,2448,32675,-26120,-19785,-29523,14217,-7292,-31946,-31754,8085,-16384,-28378,-16384,28377,-31754,8085,31311,9658,27073,18458,-26120,-19785,-29523,-14218,32767,0,25100,-21063,2448,32675,31311,9658,31311,9658,2448,32675,25100,-21063,32767,0,-29523,-14218,-26120,-19785,27073,18458,31311,9658,-31754,8085,-16384,28377,-16384,-28378,-31754,8085,-7292,-31946,-29523,14217,-26120,-19785,2448,32675,-16384,28377,25100,-21063,27073,-18459,-24020,22287,-13477,29867,-7292,-31946,-29523,-14218,25100,-21063,-16384,-28378,27073,-18459,-26120,-19785,2448,-32676,-24020,22287,-31754,8085,32767,-1,0,0,0,0,0,0,0,0,0,0};
diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c
index 78bb766e5058fbe160f51bdb81c5780495bb9e3f..45241753a3616a967996ee4f807de7b3fb34555e 100644
--- a/openair1/PHY/LTE_TRANSPORT/dci.c
+++ b/openair1/PHY/LTE_TRANSPORT/dci.c
@@ -272,12 +272,12 @@ uint32_t Y;
 //#define Mquad (Msymb/4)
 
 static uint32_t bitrev_cc_dci[32] = {1,17,9,25,5,21,13,29,3,19,11,27,7,23,15,31,0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30};
-static mod_sym_t wtemp[2][Msymb];
+static int32_t wtemp[2][Msymb];
 
-void pdcch_interleaving(LTE_DL_FRAME_PARMS *frame_parms,mod_sym_t **z, mod_sym_t **wbar,uint8_t n_symbols_pdcch,uint8_t mi)
+void pdcch_interleaving(LTE_DL_FRAME_PARMS *frame_parms,int32_t **z, int32_t **wbar,uint8_t n_symbols_pdcch,uint8_t mi)
 {
 
-  mod_sym_t *wptr,*wptr2,*zptr;
+  int32_t *wptr,*wptr2,*zptr;
   uint32_t Mquad = get_nquad(n_symbols_pdcch,frame_parms,mi);
   uint32_t RCC = (Mquad>>5), ND;
   uint32_t row,col,Kpi,index;
@@ -2027,7 +2027,7 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
                          uint32_t n_rnti,
                          int16_t amp,
                          LTE_DL_FRAME_PARMS *frame_parms,
-                         mod_sym_t **txdataF,
+                         int32_t **txdataF,
                          uint32_t subframe)
 {
 
@@ -2038,10 +2038,10 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
   int16_t re_offset;
   uint8_t mi = get_mi(frame_parms,subframe);
   static uint8_t e[DCI_BITS_MAX];
-  static mod_sym_t yseq0[Msymb],yseq1[Msymb],wbar0[Msymb],wbar1[Msymb];
+  static int32_t yseq0[Msymb],yseq1[Msymb],wbar0[Msymb],wbar1[Msymb];
 
-  mod_sym_t *y[2];
-  mod_sym_t *wbar[2];
+  int32_t *y[2];
+  int32_t *wbar[2];
 
   int nushiftmod3 = frame_parms->nushift%3;
 
@@ -2108,14 +2108,14 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
       if (dci_alloc[i].L == (uint8_t)L) {
 
 #ifdef DEBUG_DCI_ENCODING
-        LOG_I(PHY,"Generating common DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x)\n",i,num_common_dci,dci_alloc[i].nCCE,dci_alloc[i].dci_length,1<<dci_alloc[i].L,
+        LOG_I(PHY,"Generating common DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x)\n",i,num_common_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,1<<dci_alloc[i].L,
               *(unsigned int*)dci_alloc[i].dci_pdu);
         dump_dci(frame_parms,&dci_alloc[i]);
 #endif
 
-        if (dci_alloc[i].nCCE>=0) {
+        if (dci_alloc[i].firstCCE>=0) {
           e_ptr = generate_dci0(dci_alloc[i].dci_pdu,
-                                e+(72*dci_alloc[i].nCCE),
+                                e+(72*dci_alloc[i].firstCCE),
                                 dci_alloc[i].dci_length,
                                 dci_alloc[i].L,
                                 dci_alloc[i].rnti);
@@ -2133,9 +2133,9 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
         dump_dci(frame_parms,&dci_alloc[i]);
 #endif
 
-        if (dci_alloc[i].nCCE >= 0) {
+        if (dci_alloc[i].firstCCE >= 0) {
           e_ptr = generate_dci0(dci_alloc[i].dci_pdu,
-                                e+(72*dci_alloc[i].nCCE),
+                                e+(72*dci_alloc[i].firstCCE),
                                 dci_alloc[i].dci_length,
                                 dci_alloc[i].L,
                                 dci_alloc[i].rnti);
@@ -2537,13 +2537,116 @@ uint16_t get_nquad(uint8_t num_pdcch_symbols,LTE_DL_FRAME_PARMS *frame_parms,uin
   return(Nreg - 4 - (3*Ngroup_PHICH));
 }
 
-uint16_t get_nCCE_max(uint8_t Mod_id,uint8_t CC_id)
+uint16_t get_nCCE_mac(uint8_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int subframe)
 {
 
   // check for eNB only !
-  return(get_nCCE(3,&PHY_vars_eNB_g[Mod_id][CC_id]->lte_frame_parms,1)); // 5, 15,21
+  return(get_nCCE(num_pdcch_symbols,
+		  &PHY_vars_eNB_g[Mod_id][CC_id]->lte_frame_parms,
+		  get_mi(&PHY_vars_eNB_g[Mod_id][CC_id]->lte_frame_parms,subframe))); 
 }
 
+
+int get_nCCE_offset_l1(int *CCE_table,
+		       const unsigned char L, 
+		       const int nCCE, 
+		       const int common_dci, 
+		       const unsigned short rnti, 
+		       const unsigned char subframe)
+{
+
+  int search_space_free,m,nb_candidates = 0,l,i;
+  unsigned int Yk;
+   /*
+    printf("CCE Allocation: ");
+    for (i=0;i<nCCE;i++)
+    printf("%d.",CCE_table[i]);
+    printf("\n");
+  */
+  if (common_dci == 1) {
+    // check CCE(0 ... L-1)
+    nb_candidates = (L==4) ? 4 : 2;
+    nb_candidates = min(nb_candidates,nCCE/L);
+
+    //    printf("Common DCI nb_candidates %d, L %d\n",nb_candidates,L);
+
+    for (m = nb_candidates-1 ; m >=0 ; m--) {
+
+      search_space_free = 1;
+      for (l=0; l<L; l++) {
+
+	//	printf("CCE_table[%d] %d\n",(m*L)+l,CCE_table[(m*L)+l]);
+        if (CCE_table[(m*L) + l] == 1) {
+          search_space_free = 0;
+          break;
+        }
+      }
+     
+      if (search_space_free == 1) {
+
+	//	printf("returning %d\n",m*L);
+
+        for (l=0; l<L; l++)
+          CCE_table[(m*L)+l]=1;
+        return(m*L);
+      }
+    }
+
+    return(-1);
+
+  } else { // Find first available in ue specific search space
+    // according to procedure in Section 9.1.1 of 36.213 (v. 8.6)
+    // compute Yk
+    Yk = (unsigned int)rnti;
+
+    for (i=0; i<=subframe; i++)
+      Yk = (Yk*39827)%65537;
+
+    Yk = Yk % (nCCE/L);
+
+
+    switch (L) {
+    case 1:
+    case 2:
+      nb_candidates = 6;
+      break;
+
+    case 4:
+    case 8:
+      nb_candidates = 2;
+      break;
+
+    default:
+      DevParam(L, nCCE, rnti);
+      break;
+    }
+
+
+    LOG_D(MAC,"rnti %x, Yk = %d, nCCE %d (nCCE/L %d),nb_cand %d\n",rnti,Yk,nCCE,nCCE/L,nb_candidates);
+
+    for (m = 0 ; m < nb_candidates ; m++) {
+      search_space_free = 1;
+
+      for (l=0; l<L; l++) {
+        if (CCE_table[(((Yk+m)%(nCCE/L))*L) + l] == 1) {
+          search_space_free = 0;
+          break;
+        }
+      }
+
+      if (search_space_free == 1) {
+        for (l=0; l<L; l++)
+          CCE_table[(((Yk+m)%(nCCE/L))*L)+l]=1;
+
+        return(((Yk+m)%(nCCE/L))*L);
+      }
+    }
+
+    return(-1);
+  }
+}
+
+
 void dci_decoding_procedure0(LTE_UE_PDCCH **lte_ue_pdcch_vars,
 			     int do_common,
 			     uint8_t subframe,
@@ -2691,7 +2794,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **lte_ue_pdcch_vars,
         dci_alloc[*dci_cnt].dci_length = sizeof_bits;
         dci_alloc[*dci_cnt].rnti       = crc;
         dci_alloc[*dci_cnt].L          = L;
-        dci_alloc[*dci_cnt].nCCE       = CCEind;
+        dci_alloc[*dci_cnt].firstCCE   = CCEind;
 
         if (sizeof_bytes<=4) {
           dci_alloc[*dci_cnt].dci_pdu[3] = dci_decoded_output[0];
diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c
index 77fbebe0d34010a30cf8a2056c18afe1f86723f4..b9643edfdc83dc396638eb4a1d57aa49c85ddda8 100644
--- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c
+++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c
@@ -40,8 +40,6 @@
 #include "PHY/defs.h"
 #include "PHY/extern.h"
 #include "SCHED/defs.h"
-#include "MAC_INTERFACE/defs.h"
-#include "MAC_INTERFACE/extern.h"
 #ifdef DEBUG_DCI_TOOLS
 #include "PHY/vars.h"
 #endif
@@ -253,8 +251,8 @@ void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t
         */
       //      printf("rb_alloc[1]=%x,rb_alloc[0]=%x\n",rb_alloc2[1],rb_alloc2[0]);
     } else {
-      LOG_E(PHY,"resource type 1 not supported for  N_RB_DL=100\n");
-      mac_xface->macphy_exit("resource type 1 not supported for  N_RB_DL=100\n");
+      LOG_E(PHY,"resource type 1 not supported for  N_RB_DL=50\n");
+      //      mac_xface->macphy_exit("resource type 1 not supported for  N_RB_DL=100\n");
       /*
       subset = rb_alloc&1;
       shift  = (rb_alloc>>1)&1;
@@ -284,7 +282,7 @@ void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t
       }
     } else {
       LOG_E(PHY,"resource type 1 not supported for  N_RB_DL=100\n");
-      mac_xface->macphy_exit("resource type 1 not supported for  N_RB_DL=100\n");
+      //      mac_xface->macphy_exit("resource type 1 not supported for  N_RB_DL=100\n");
       /*
       subset = rb_alloc&1;
       shift  = (rb_alloc>>1)&1;
@@ -453,7 +451,7 @@ uint32_t conv_1C_RIV(int32_t rballoc,uint32_t N_RB_DL) {
    
 }
 
-int get_prb(int N_RB_DL,int odd_slot,int vrb,int Ngap) {
+uint32_t get_prb(int N_RB_DL,int odd_slot,int vrb,int Ngap) {
 
   int offset;
 
@@ -734,11 +732,11 @@ void generate_RIV_tables()
       if (nVRB<32)
         alloc0 |= (1<<nVRB);
       else if (nVRB<64)
-        alloc1 |= (1<<(nVRB-33));
+        alloc1 |= (1<<(nVRB-32));
       else if (nVRB<96)
-        alloc2 |= (1<<(nVRB-65));
+        alloc2 |= (1<<(nVRB-64));
       else
-        alloc3 |= (1<<(nVRB-97));
+        alloc3 |= (1<<(nVRB-96));
 
       // Distributed Gap1, even slot
       nVRB_even_dist = get_prb(100,0,nVRB,0);
@@ -770,9 +768,9 @@ void generate_RIV_tables()
       else if (nVRB_odd_dist<64)
         allocdist1_0_odd |= (1<<(nVRB_odd_dist-32));
       else if (nVRB_odd_dist<96)
-	allocdist2_0_odd |= (1<<(nVRB_odd_dist-65));
+	allocdist2_0_odd |= (1<<(nVRB_odd_dist-64));
       else
-	allocdist3_0_odd |= (1<<(nVRB_odd_dist-97));
+	allocdist3_0_odd |= (1<<(nVRB_odd_dist-96));
 
 
       // Distributed Gap2, even slot
@@ -926,10 +924,15 @@ int generate_eNB_dlsch_params_from_dci(int frame,
         //      printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
       }
 
-
       dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
 
-      dlsch0_harq->rb_alloc[0]    = localRIV2alloc_LUT6[rballoc];
+      if (vrb_type==LOCALIZED) {
+	dlsch0_harq->rb_alloc[0]    = localRIV2alloc_LUT6[rballoc];
+      }
+      else {
+	LOG_E(PHY,"Distributed RB allocation not done yet\n");
+	mac_xface->macphy_exit("exiting");
+      }
       dlsch0_harq->vrb_type       = vrb_type;
       dlsch0_harq->nb_rb          = RIV2nb_rb_LUT6[rballoc];//NPRB;
       RIV_max = RIV_max6;
@@ -960,7 +963,14 @@ int generate_eNB_dlsch_params_from_dci(int frame,
 
       dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
 
-      dlsch0_harq->rb_alloc[0]    = localRIV2alloc_LUT25[rballoc];
+      
+      if (vrb_type==LOCALIZED) {
+	dlsch0_harq->rb_alloc[0]    = localRIV2alloc_LUT25[rballoc];
+      }
+      else {
+	LOG_E(PHY,"Distributed RB allocation not done yet\n");
+	mac_xface->macphy_exit("exiting");
+      }
       dlsch0_harq->vrb_type       = vrb_type;
       dlsch0_harq->nb_rb          = RIV2nb_rb_LUT25[rballoc];//NPRB;
       RIV_max                     = RIV_max25;
@@ -987,9 +997,16 @@ int generate_eNB_dlsch_params_from_dci(int frame,
       }
 
       dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
+      if (vrb_type==LOCALIZED) {
+	dlsch0_harq->rb_alloc[0]     = localRIV2alloc_LUT50_0[rballoc];
+	dlsch0_harq->rb_alloc[1]     = localRIV2alloc_LUT50_1[rballoc];
+      }
+      else {
+	LOG_E(PHY,"Distributed RB allocation not done yet\n");
+	mac_xface->macphy_exit("exiting");
+      }
+
 
-      dlsch0_harq->rb_alloc[0]     = localRIV2alloc_LUT50_0[rballoc];
-      dlsch0_harq->rb_alloc[1]     = localRIV2alloc_LUT50_1[rballoc];
       dlsch0_harq->vrb_type        = vrb_type;
       dlsch0_harq->nb_rb                               = RIV2nb_rb_LUT50[rballoc];//NPRB;
       RIV_max = RIV_max50;
@@ -1017,10 +1034,17 @@ int generate_eNB_dlsch_params_from_dci(int frame,
       dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
 
       dlsch0_harq->vrb_type         = vrb_type;
-      dlsch0_harq->rb_alloc[0]      = localRIV2alloc_LUT100_0[rballoc];
-      dlsch0_harq->rb_alloc[1]      = localRIV2alloc_LUT100_1[rballoc];
-      dlsch0_harq->rb_alloc[2]      = localRIV2alloc_LUT100_2[rballoc];
-      dlsch0_harq->rb_alloc[3]      = localRIV2alloc_LUT100_3[rballoc];
+      if (vrb_type==LOCALIZED) {
+	dlsch0_harq->rb_alloc[0]      = localRIV2alloc_LUT100_0[rballoc];
+	dlsch0_harq->rb_alloc[1]      = localRIV2alloc_LUT100_1[rballoc];
+	dlsch0_harq->rb_alloc[2]      = localRIV2alloc_LUT100_2[rballoc];
+	dlsch0_harq->rb_alloc[3]      = localRIV2alloc_LUT100_3[rballoc];
+      }
+      else {
+	LOG_E(PHY,"Distributed RB allocation not done yet\n");
+	mac_xface->macphy_exit("exiting");
+      }
+
 
 
       dlsch0_harq->nb_rb                               = RIV2nb_rb_LUT100[rballoc];//NPRB;
@@ -1102,12 +1126,8 @@ int generate_eNB_dlsch_params_from_dci(int frame,
 
     dlsch[0]->harq_ids[subframe] = harq_pid;
 
-    if (dlsch0_harq->round == 0) {
-      /* necessary test? */
-      if (dlsch0_harq->status == SCH_IDLE)
-        remove_harq_pid_from_freelist(dlsch[0], harq_pid);
+    if (dlsch0_harq->round == 0)
       dlsch0_harq->status = ACTIVE;
-    }
 
     break;
 
@@ -1250,9 +1270,6 @@ int generate_eNB_dlsch_params_from_dci(int frame,
 
 
     if (dlsch0_harq->round == 0) {
-      /* necessary test? */
-      if (dlsch0_harq->status == SCH_IDLE)
-        remove_harq_pid_from_freelist(dlsch[0], harq_pid);
       dlsch0_harq->status = ACTIVE;
       //            printf("Setting DLSCH process %d to ACTIVE\n",harq_pid);
       // MCS and TBS don't change across HARQ rounds
@@ -1620,19 +1637,11 @@ int generate_eNB_dlsch_params_from_dci(int frame,
     }
 
     // reset HARQ process if this is the first transmission
-    if (dlsch0_harq->round == 0) {
-      /* necessary test? */
-      if (dlsch0_harq->status == SCH_IDLE)
-        remove_harq_pid_from_freelist(dlsch0, harq_pid);
+    if (dlsch0_harq->round == 0)
       dlsch0_harq->status = ACTIVE;
-    }
 
-    if (dlsch1_harq->round == 0) {
-      /* necessary test? */
-      if (dlsch1_harq->status == SCH_IDLE)
-        remove_harq_pid_from_freelist(dlsch1, harq_pid);
+    if (dlsch1_harq->round == 0)
       dlsch1_harq->status = ACTIVE;
-    }
 
     dlsch0->rnti = rnti;
     dlsch1->rnti = rnti;
@@ -2007,19 +2016,11 @@ int generate_eNB_dlsch_params_from_dci(int frame,
     }
 
     // reset HARQ process if this is the first transmission
-    if ((dlsch0->active==1) && (dlsch0_harq->round == 0)) {
-      /* necessary test? */
-      if (dlsch0_harq->status == SCH_IDLE)
-        remove_harq_pid_from_freelist(dlsch0, harq_pid);
+    if ((dlsch0->active==1) && (dlsch0_harq->round == 0))
       dlsch0_harq->status = ACTIVE;
-    }
 
-    if ((dlsch1->active==1) && (dlsch1_harq->round == 0)) {
-      /* necessary test? */
-      if (dlsch1_harq->status == SCH_IDLE)
-        remove_harq_pid_from_freelist(dlsch1, harq_pid);
+    if ((dlsch1->active==1) && (dlsch1_harq->round == 0))
       dlsch1_harq->status = ACTIVE;
-    }
 
     dlsch0->rnti = rnti;
     dlsch1->rnti = rnti;
@@ -2159,23 +2160,16 @@ int generate_eNB_dlsch_params_from_dci(int frame,
     // check if either TB is disabled (see 36-213 V8.6 p. 26)
 
 
-    if ((dlsch0_harq->rvidx == 1) && (dlsch0_harq->mcs == 0)) {
-      LOG_W(PHY, "what to do with respect to remove_harq_pid_from_freelist?\n");
+    if ((dlsch0_harq->rvidx == 1) && (dlsch0_harq->mcs == 0))
       dlsch0_harq->status = DISABLED;
-    }
 
-    if ((dlsch1_harq->rvidx == 1) && (dlsch1_harq->mcs == 0)) {
-      LOG_W(PHY, "what to do with respect to remove_harq_pid_from_freelist?\n");
+    if ((dlsch1_harq->rvidx == 1) && (dlsch1_harq->mcs == 0))
       dlsch1_harq->status = DISABLED;
-    }
 
     dlsch0_harq->Nl        = 1;
 
 
     if (dlsch0_harq->round == 0) {
-      /* necessary test? */
-      if (dlsch0_harq->status == SCH_IDLE)
-        remove_harq_pid_from_freelist(dlsch0, harq_pid);
       dlsch0_harq->status = ACTIVE;
       //      printf("Setting DLSCH process %d to ACTIVE\n",harq_pid);
     }
@@ -2340,17 +2334,11 @@ int generate_eNB_dlsch_params_from_dci(int frame,
 
 
     if ((dlsch0_harq->round == 0) && (dlsch0->active == 1) ) {
-      /* necessary test? */
-      if (dlsch0_harq->status == SCH_IDLE)
-        remove_harq_pid_from_freelist(dlsch0, harq_pid);
       dlsch0_harq->status      = ACTIVE;
       dlsch0_harq->mcs         = mcs1;
     }
 
     if ((dlsch1_harq->round == 0) && (dlsch1->active == 1) ) {
-      /* necessary test? */
-      if (dlsch1_harq->status == SCH_IDLE)
-        remove_harq_pid_from_freelist(dlsch1, harq_pid);
       dlsch1_harq->status      = ACTIVE;
       dlsch1_harq->mcs         = mcs2;
     }
@@ -2514,9 +2502,6 @@ int generate_eNB_dlsch_params_from_dci(int frame,
 
 
     if (dlsch0_harq->round == 0) {
-      /* necessary test? */
-      if (dlsch0_harq->status == SCH_IDLE)
-        remove_harq_pid_from_freelist(dlsch0, harq_pid);
       dlsch0_harq->status = ACTIVE;
       //      printf("Setting DLSCH process %d to ACTIVE\n",harq_pid);
     }
@@ -2646,9 +2631,6 @@ int generate_eNB_dlsch_params_from_dci(int frame,
 
     //    dlsch0_harq->Ndi         = ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->ndi;
     if (dlsch0_harq->round == 0) {
-      /* necessary test? */
-      if (dlsch0_harq->status == SCH_IDLE)
-        remove_harq_pid_from_freelist(dlsch0, harq_pid);
       dlsch0_harq->status = ACTIVE;
       //      printf("Setting DLSCH process %d to ACTIVE\n",harq_pid);
     }
@@ -2691,17 +2673,17 @@ int generate_eNB_dlsch_params_from_dci(int frame,
 #ifdef DEBUG_DCI
 
   if (dlsch0) {
-    msg("dlsch0 eNB: dlsch0   %p\n",dlsch0);
-    msg("dlsch0 eNB: rnti     %x\n",dlsch0->rnti);
-    msg("dlsch0 eNB: NBRB     %d\n",dlsch0_harq->nb_rb);
-    msg("dlsch0 eNB: rballoc  %x\n",dlsch0_harq->rb_alloc[0]);
-    msg("dlsch0 eNB: harq_pid %d\n",harq_pid);
-    msg("dlsch0 eNB: round    %d\n",dlsch0_harq->round);
-    msg("dlsch0 eNB: rvidx    %d\n",dlsch0_harq->rvidx);
-    msg("dlsch0 eNB: TBS      %d (NPRB %d)\n",dlsch0_harq->TBS,NPRB);
-    msg("dlsch0 eNB: mcs      %d\n",dlsch0_harq->mcs);
-    msg("dlsch0 eNB: tpmi %d\n",tpmi);
-    msg("dlsch0 eNB: mimo_mode %d\n",dlsch0_harq->mimo_mode);
+    printf("dlsch0 eNB: dlsch0   %p\n",dlsch0);
+    printf("dlsch0 eNB: rnti     %x\n",dlsch0->rnti);
+    printf("dlsch0 eNB: NBRB     %d\n",dlsch0_harq->nb_rb);
+    printf("dlsch0 eNB: rballoc  %x\n",dlsch0_harq->rb_alloc[0]);
+    printf("dlsch0 eNB: harq_pid %d\n",harq_pid);
+    printf("dlsch0 eNB: round    %d\n",dlsch0_harq->round);
+    printf("dlsch0 eNB: rvidx    %d\n",dlsch0_harq->rvidx);
+    printf("dlsch0 eNB: TBS      %d (NPRB %d)\n",dlsch0_harq->TBS,NPRB);
+    printf("dlsch0 eNB: mcs      %d\n",dlsch0_harq->mcs);
+    printf("dlsch0 eNB: tpmi %d\n",tpmi);
+    printf("dlsch0 eNB: mimo_mode %d\n",dlsch0_harq->mimo_mode);
   }
 
 #endif
@@ -4450,7 +4432,7 @@ int generate_ue_dlsch_params_from_dci(int frame,
     dlsch[0]->g_pucch += delta_PUCCH_lut[TPC&3];
 
     if (TPC!=1)
-      LOG_I(PHY,"format1 TPC %d, dlsch0_harq->delta_PUCCH %d\n",TPC,dlsch0_harq->delta_PUCCH);
+      LOG_D(PHY,"format1 TPC %d, dlsch0_harq->delta_PUCCH %d\n",TPC,dlsch0_harq->delta_PUCCH);
 
     dlsch0_harq->rvidx     = rv;
 
@@ -4459,7 +4441,7 @@ int generate_ue_dlsch_params_from_dci(int frame,
 
     dlsch0_harq->dl_power_off = 1; //no power offset
 
-    LOG_D(PHY,"UE (%x/%d): Subframe %d Format2 DCI: ndi %d, old_ndi %d (first tx %d) harq_status %d\n",dlsch[0]->rnti,harq_pid,subframe,ndi,dlsch0_harq->DCINdi,
+    LOG_D(PHY,"UE (%x/%d): Subframe %d Format1 DCI: ndi %d, old_ndi %d (first tx %d) harq_status %d\n",dlsch[0]->rnti,harq_pid,subframe,ndi,dlsch0_harq->DCINdi,
           dlsch0_harq->first_tx,dlsch0_harq->status);
 
     //    printf("Format2 DCI (UE, hard pid %d): ndi %d, old_ndi %d (first tx %d)\n",harq_pid,ndi,dlsch0_harq->DCINdi,
@@ -5558,15 +5540,15 @@ int generate_ue_dlsch_params_from_dci(int frame,
 #ifdef DEBUG_DCI
 
   if (dlsch[0]) {
-    msg("PDSCH dlsch0 UE: rnti     %x\n",dlsch[0]->rnti);
-    msg("PDSCH dlsch0 UE: NBRB     %d\n",dlsch0_harq->nb_rb);
-    msg("PDSCH dlsch0 UE: rballoc  %x\n",dlsch0_harq->rb_alloc[0]);
-    msg("PDSCH dlsch0 UE: harq_pid %d\n",harq_pid);
-    msg("PDSCH dlsch0 UE: DCINdi   %d\n",dlsch0_harq->DCINdi);
-    msg("PDSCH dlsch0 UE: rvidx    %d\n",dlsch0_harq->rvidx);
-    msg("PDSCH dlsch0 UE: TBS      %d\n",dlsch0_harq->TBS);
-    msg("PDSCH dlsch0 UE: mcs      %d\n",dlsch0_harq->mcs);
-    msg("PDSCH dlsch0 UE: pwr_off  %d\n",dlsch0_harq->dl_power_off);
+    printf("PDSCH dlsch0 UE: rnti     %x\n",dlsch[0]->rnti);
+    printf("PDSCH dlsch0 UE: NBRB     %d\n",dlsch0_harq->nb_rb);
+    printf("PDSCH dlsch0 UE: rballoc  %x\n",dlsch0_harq->rb_alloc_even[0]);
+    printf("PDSCH dlsch0 UE: harq_pid %d\n",harq_pid);
+    printf("PDSCH dlsch0 UE: DCINdi   %d\n",dlsch0_harq->DCINdi);
+    printf("PDSCH dlsch0 UE: rvidx    %d\n",dlsch0_harq->rvidx);
+    printf("PDSCH dlsch0 UE: TBS      %d\n",dlsch0_harq->TBS);
+    printf("PDSCH dlsch0 UE: mcs      %d\n",dlsch0_harq->mcs);
+    printf("PDSCH dlsch0 UE: pwr_off  %d\n",dlsch0_harq->dl_power_off);
   }
 
 #endif
@@ -6420,6 +6402,7 @@ abort();
     if (ulsch->harq_processes[harq_pid]->first_tx==1) {
       //      ulsch->harq_processes[harq_pid]->Ndi                                   = 1;
       ulsch->harq_processes[harq_pid]->first_tx=0;
+      ulsch->harq_processes[harq_pid]->DCINdi= ndi;
       ulsch->harq_processes[harq_pid]->round = 0;
     } else {
       if (ulsch->harq_processes[harq_pid]->DCINdi!=ndi) { // new SDU opportunity
@@ -7121,10 +7104,10 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
 
     harq_pid = subframe2harq_pid(frame_parms,
                                  pdcch_alloc2ul_frame(frame_parms,
-                                     phy_vars_eNB->proc[sched_subframe].frame_tx,
-                                     subframe),
+						      phy_vars_eNB->proc[sched_subframe].frame_tx,
+						      subframe),
                                  pdcch_alloc2ul_subframe(frame_parms,subframe));
-
+    
     //    printf("eNB: sched_subframe %d, subframe %d, frame_tx %d\n",sched_subframe,subframe,phy_vars_eNB->proc[sched_subframe].frame_tx);
 
     switch (frame_parms->N_RB_DL) {
@@ -7658,9 +7641,9 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
         break;
       }
     } else {
-      ulsch->harq_processes[harq_pid]->O_RI = 0;//1;
+      ulsch->harq_processes[harq_pid]->O_RI = 0;
       ulsch->harq_processes[harq_pid]->Or2                                   = 0;
-      ulsch->harq_processes[harq_pid]->Or1                                   = 0;//sizeof_HLC_subband_cqi_nopmi_5MHz;
+      ulsch->harq_processes[harq_pid]->Or1                                   = 0;
       ulsch->harq_processes[harq_pid]->uci_format                            = HLC_subband_cqi_nopmi;
     }
 
diff --git a/openair1/PHY/LTE_TRANSPORT/defs.h b/openair1/PHY/LTE_TRANSPORT/defs.h
index 7f4d17dc1d7e2854b9a3ff76d8a0f7cc356f6bde..b61af32bc7854a44e1739b493b9ee8f151d17622 100644
--- a/openair1/PHY/LTE_TRANSPORT/defs.h
+++ b/openair1/PHY/LTE_TRANSPORT/defs.h
@@ -262,21 +262,18 @@ typedef struct LTE_eNB_DLSCH_s {
   uint8_t error_threshold;
   /// Pointers to 8 HARQ processes for the DLSCH
   LTE_DL_eNB_HARQ_t *harq_processes[8];
-  /// circular list of free harq PIDs (the oldest come first)
-  /// (10 is arbitrary value, must be > to max number of DL HARQ processes in LTE)
-  int harq_pid_freelist[10];
-  /// the head position of the free list (if list is free then head=tail)
-  int head_freelist;
-  /// the tail position of the free list
-  int tail_freelist;
   /// Number of soft channel bits
   uint32_t G;
   /// Codebook index for this dlsch (0,1,2,3)
   uint8_t codebook_index;
-  /// Maximum number of HARQ rounds (for definition see 36-212 V8.6 2009-03, p.17)
+  /// Maximum number of HARQ processes (for definition see 36-212 V8.6 2009-03, p.17)
   uint8_t Mdlharq;
+  /// Maximum number of HARQ rounds
+  uint8_t Mlimit;
   /// MIMO transmission mode indicator for this sub-frame (for definition see 36-212 V8.6 2009-03, p.17)
   uint8_t Kmimo;
+  /// Nsoft parameter related to UE Category
+  uint32_t Nsoft;
   /// amplitude of PDSCH (compared to RS) in symbols without pilots
   int16_t sqrt_rho_a;
   /// amplitude of PDSCH (compared to RS) in symbols containing pilots
@@ -317,11 +314,9 @@ typedef struct {
   /// Scrambled "b"-sequences (for definition see 36-211 V8.6 2009-03, p.14)
   uint8_t b_tilde[MAX_NUM_CHANNEL_BITS];
   /// Modulated "d"-sequences (for definition see 36-211 V8.6 2009-03, p.14)
-  mod_sym_t d[MAX_NUM_RE];
+  int32_t d[MAX_NUM_RE];
   /// Transform-coded "z"-sequences (for definition see 36-211 V8.6 2009-03, p.14-15)
-  mod_sym_t z[MAX_NUM_RE];
-  /// Maximum number of HARQ rounds (for definition see 36-212 V8.6 2009-03, p.17)
-  uint8_t Mdlharq;
+  int32_t z[MAX_NUM_RE];
   /// "q" sequences for CQI/PMI (for definition see 36-212 V8.6 2009-03, p.27)
   uint8_t q[MAX_CQI_PAYLOAD];
   /// coded and interleaved CQI bits
@@ -470,8 +465,8 @@ typedef struct {
 typedef struct {
   /// Pointers to 8 HARQ processes for the ULSCH
   LTE_UL_eNB_HARQ_t *harq_processes[8];
-  /// Maximum number of HARQ rounds (for definition see 36-212 V8.6 2009-03, p.17)
-  uint8_t Mdlharq;
+  /// Maximum number of HARQ rounds
+  uint8_t Mlimit;
   /// Maximum number of iterations used in eNB turbo decoder
   uint8_t max_turbo_iterations;
   /// ACK/NAK Bundling flag
@@ -574,6 +569,10 @@ typedef struct {
   vrb_t vrb_type;
   /// downlink power offset field
   uint8_t dl_power_off;
+  /// trials per round statistics
+  uint32_t trials[8];
+  /// error statistics per round
+  uint32_t errors[8];
 } LTE_DL_UE_HARQ_t;
 
 typedef struct {
@@ -591,13 +590,13 @@ typedef struct LTE_eNB_UE_stats {
   /// UL RSSI per receive antenna
   int32_t UL_rssi[NB_ANTENNAS_RX];
   /// PUCCH1a/b power (digital linear)
-  int32_t Po_PUCCH;
+  uint32_t Po_PUCCH;
   /// PUCCH1a/b power (dBm)
   int32_t Po_PUCCH_dBm;
   /// PUCCH1 power (digital linear), conditioned on below threshold
-  int32_t Po_PUCCH1_below;
+  uint32_t Po_PUCCH1_below;
   /// PUCCH1 power (digital linear), conditioned on above threshold
-  int32_t Po_PUCCH1_above;
+  uint32_t Po_PUCCH1_above;
   /// Indicator that Po_PUCCH has been updated by PHY
   int32_t Po_PUCCH_update;
   /// DL Wideband CQI index (2 TBs)
@@ -704,10 +703,12 @@ typedef struct {
   harq_status_t harq_ack[10];
   /// Pointers to up to 8 HARQ processes
   LTE_DL_UE_HARQ_t *harq_processes[8];
-  /// Maximum number of HARQ rounds (for definition see 36-212 V8.6 2009-03, p.17
+  /// Maximum number of HARQ processes(for definition see 36-212 V8.6 2009-03, p.17
   uint8_t Mdlharq;
   /// MIMO transmission mode indicator for this sub-frame (for definition see 36-212 V8.6 2009-03, p.17)
   uint8_t Kmimo;
+  /// Nsoft parameter related to UE Category
+  uint32_t Nsoft;
   /// Maximum number of Turbo iterations
   uint8_t max_turbo_iterations;
   /// accumulated tx power adjustment for PUCCH
@@ -755,7 +756,7 @@ typedef struct {
   /// Aggregation level
   uint8_t L;
   /// Position of first CCE of the dci
-  int nCCE;
+  int firstCCE;
   /// flag to indicate that this is a RA response
   boolean_t ra_flag;
   /// rnti
diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
index f051dc3ecfe9869bf993c4dfe06ea61e0edf793c..366b93e71da8582be093edbc68ee21d0a9809bae 100644
--- a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
+++ b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
@@ -44,6 +44,8 @@
 #include "PHY/CODING/extern.h"
 #include "PHY/CODING/lte_interleaver_inline.h"
 #include "PHY/LTE_TRANSPORT/defs.h"
+#include "PHY/LTE_TRANSPORT/proto.h"
+#include "SCHED/defs.h"
 #include "defs.h"
 #include "UTIL/LOG/vcd_signal_dumper.h"
 
@@ -91,11 +93,11 @@ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch)
 #endif
 
         for (r=0; r<MAX_NUM_DLSCH_SEGMENTS; r++) {
-
+	  
 #ifdef DEBUG_DLSCH_FREE
           msg("Freeing dlsch process %d c[%d] (%p)\n",i,r,dlsch->harq_processes[i]->c[r]);
 #endif
-
+	  
           if (dlsch->harq_processes[i]->c[r]) {
             free16(dlsch->harq_processes[i]->c[r],((r==0)?8:0) + 3+768);
             dlsch->harq_processes[i]->c[r] = NULL;
@@ -104,20 +106,20 @@ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch)
             free16(dlsch->harq_processes[i]->d[r],(96+12+3+(3*6144)));
             dlsch->harq_processes[i]->d[r] = NULL;
           }
-        }
-
-        free16(dlsch->harq_processes[i],sizeof(LTE_DL_eNB_HARQ_t));
-        dlsch->harq_processes[i] = NULL;
+        
+	}
+	free16(dlsch->harq_processes[i],sizeof(LTE_DL_eNB_HARQ_t));
+	dlsch->harq_processes[i] = NULL;
       }
     }
-
+    
     free16(dlsch,sizeof(LTE_eNB_DLSCH_t));
     dlsch = NULL;
-  }
-
+    }
+  
 }
 
-LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,unsigned char N_RB_DL, uint8_t abstraction_flag)
+LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_t Nsoft,unsigned char N_RB_DL, uint8_t abstraction_flag)
 {
 
   LTE_eNB_DLSCH_t *dlsch;
@@ -148,13 +150,12 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,unsigne
     bzero(dlsch,sizeof(LTE_eNB_DLSCH_t));
     dlsch->Kmimo = Kmimo;
     dlsch->Mdlharq = Mdlharq;
+    dlsch->Mlimit = 4;
+    dlsch->Nsoft = Nsoft;
 
     for (i=0; i<10; i++)
       dlsch->harq_ids[i] = Mdlharq;
 
-    dlsch->head_freelist = 0;
-    dlsch->tail_freelist = 0;
-
     for (i=0; i<Mdlharq; i++) {
       dlsch->harq_processes[i] = (LTE_DL_eNB_HARQ_t *)malloc16(sizeof(LTE_DL_eNB_HARQ_t));
       LOG_T(PHY, "Required mem size %d (bw scaling %d), dlsch->harq_processes[%d] %p\n",
@@ -195,36 +196,34 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,unsigne
         msg("Can't get harq_p %d\n",i);
         exit_flag=3;
       }
-
-      put_harq_pid_in_freelist(dlsch, i);
     }
 
     if (exit_flag==0) {
       for (i=0; i<Mdlharq; i++) {
         dlsch->harq_processes[i]->round=0;
 
-        if (abstraction_flag==0) {
-          for (j=0; j<96; j++)
-            for (r=0; r<MAX_NUM_DLSCH_SEGMENTS/bw_scaling; r++) {
-        //      printf("dlsch->harq_processes[%d]->d[%d] %p\n",i,r,dlsch->harq_processes[i]->d[r]);
-              dlsch->harq_processes[i]->d[r][j] = LTE_NULL;
-            }
-        }
+	for (j=0; j<96; j++)
+	  for (r=0; r<MAX_NUM_DLSCH_SEGMENTS/bw_scaling; r++) {
+	    //      printf("dlsch->harq_processes[%d]->d[%d] %p\n",i,r,dlsch->harq_processes[i]->d[r]);
+	    if (dlsch->harq_processes[i]->d[r])
+	      dlsch->harq_processes[i]->d[r][j] = LTE_NULL;
+	  }
+        
       }
 
       return(dlsch);
     }
   }
 
-  LOG_D(PHY, "new_eNB_dlsch exit flag %d, size of  %ld\n",
-        exit_flag, sizeof(LTE_eNB_DLSCH_t));
+  LOG_D(PHY,"new_eNB_dlsch exit flag %d, size of  %ld\n",
+	exit_flag, sizeof(LTE_eNB_DLSCH_t));
   free_eNB_dlsch(dlsch);
   return(NULL);
 
 
 }
 
-void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch, uint8_t abstraction_flag)
+void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch)
 {
 
   unsigned char Mdlharq;
@@ -244,12 +243,11 @@ void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch, uint8_t abstraction_flag)
         dlsch->harq_processes[i]->status = 0;
         dlsch->harq_processes[i]->round  = 0;
 
-        if (abstraction_flag==0) {
-          for (j=0; j<96; j++)
-            for (r=0; r<MAX_NUM_DLSCH_SEGMENTS; r++)
-	      if (dlsch->harq_processes[i]->d[r])
-		dlsch->harq_processes[i]->d[r][j] = LTE_NULL;
-        }
+	for (j=0; j<96; j++)
+	  for (r=0; r<MAX_NUM_DLSCH_SEGMENTS; r++)
+	    if (dlsch->harq_processes[i]->d[r])
+	      dlsch->harq_processes[i]->d[r][j] = LTE_NULL;
+        
       }
     }
   }
@@ -400,7 +398,7 @@ int dlsch_encoding(unsigned char *a,
                                         dlsch->harq_processes[harq_pid]->w[r],
                                         dlsch->harq_processes[harq_pid]->e+r_offset,
                                         dlsch->harq_processes[harq_pid]->C, // C
-                                        NSOFT,                    // Nsoft,
+                                        dlsch->Nsoft,                    // Nsoft,
                                         dlsch->Mdlharq,
                                         dlsch->Kmimo,
                                         dlsch->harq_processes[harq_pid]->rvidx,
diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c
index 6ab784aa18619a5652847ae72fc4e24d71e457a7..2e8d70102ffec29619a46849b7d3d80cbae43f86 100644
--- a/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c
+++ b/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c
@@ -81,7 +81,7 @@ void free_ue_dlsch(LTE_UE_DLSCH_t *dlsch)
   }
 }
 
-LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t max_turbo_iterations,uint8_t N_RB_DL, uint8_t abstraction_flag)
+LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_turbo_iterations,uint8_t N_RB_DL, uint8_t abstraction_flag)
 {
 
   LTE_UE_DLSCH_t *dlsch;
@@ -113,10 +113,11 @@ LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t max_turbo_ite
     memset(dlsch,0,sizeof(LTE_UE_DLSCH_t));
     dlsch->Kmimo = Kmimo;
     dlsch->Mdlharq = Mdlharq;
+    dlsch->Nsoft = Nsoft;
     dlsch->max_turbo_iterations = max_turbo_iterations;
 
     for (i=0; i<Mdlharq; i++) {
-      //      msg("new_ue_dlsch: Harq process %d\n",i);
+      //      printf("new_ue_dlsch: Harq process %d\n",i);
       dlsch->harq_processes[i] = (LTE_DL_UE_HARQ_t *)malloc16(sizeof(LTE_DL_UE_HARQ_t));
 
       if (dlsch->harq_processes[i]) {
@@ -155,7 +156,7 @@ LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t max_turbo_ite
       return(dlsch);
   }
 
-  msg("new_ue_dlsch with size %zu: exit_flag = %u\n",sizeof(LTE_DL_UE_HARQ_t), exit_flag);
+  printf("new_ue_dlsch with size %zu: exit_flag = %u\n",sizeof(LTE_DL_UE_HARQ_t), exit_flag);
   free_ue_dlsch(dlsch);
 
   return(NULL);
@@ -186,6 +187,27 @@ uint32_t  dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
   uint8_t crc_type;
 #ifdef DEBUG_DLSCH_DECODING
   uint16_t i;
+#endif
+#ifdef __AVX2__
+  int Kr_last,skipped_last=0;
+  uint8_t (*tc_2cw)(int16_t *y,
+		    int16_t *y2,
+		    uint8_t *,
+		    uint8_t *,
+		    uint16_t,
+		    uint16_t,
+		    uint16_t,
+		    uint8_t,
+		    uint8_t,
+		    uint8_t,
+		    time_stats_t *,
+		    time_stats_t *,
+		    time_stats_t *,
+		    time_stats_t *,
+		    time_stats_t *,
+		    time_stats_t *,
+		    time_stats_t *);
+
 #endif
   uint8_t (*tc)(int16_t *y,
                 uint8_t *,
@@ -203,28 +225,35 @@ uint32_t  dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
                 time_stats_t *,
                 time_stats_t *);
 
+
+
+
   if (!dlsch_llr) {
-    msg("dlsch_decoding.c: NULL dlsch_llr pointer\n");
+    printf("dlsch_decoding.c: NULL dlsch_llr pointer\n");
     return(dlsch->max_turbo_iterations);
   }
 
   if (!harq_process) {
-    msg("dlsch_decoding.c: NULL harq_process pointer\n");
+    printf("dlsch_decoding.c: NULL harq_process pointer\n");
     return(dlsch->max_turbo_iterations);
   }
 
   if (!frame_parms) {
-    msg("dlsch_decoding.c: NULL frame_parms pointer\n");
+    printf("dlsch_decoding.c: NULL frame_parms pointer\n");
     return(dlsch->max_turbo_iterations);
   }
 
   if (subframe>9) {
-    msg("dlsch_decoding.c: Illegal subframe index %d\n",subframe);
+    printf("dlsch_decoding.c: Illegal subframe index %d\n",subframe);
     return(dlsch->max_turbo_iterations);
   }
 
-  if (llr8_flag == 0)
+  if (llr8_flag == 0) {
+#ifdef __AVX2__
+    tc_2cw = phy_threegpplte_turbo_decoder16avx2;
+#endif
     tc = phy_threegpplte_turbo_decoder16;
+  }
   else
     tc = phy_threegpplte_turbo_decoder8;
 
@@ -232,16 +261,19 @@ uint32_t  dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
 
   /*
   if (nb_rb > frame_parms->N_RB_DL) {
-    msg("dlsch_decoding.c: Illegal nb_rb %d\n",nb_rb);
+    printf("dlsch_decoding.c: Illegal nb_rb %d\n",nb_rb);
     return(max_turbo_iterations);
     }*/
 
   /*harq_pid = dlsch->current_harq_pid;
   if (harq_pid >= 8) {
-    msg("dlsch_decoding.c: Illegal harq_pid %d\n",harq_pid);
+    printf("dlsch_decoding.c: Illegal harq_pid %d\n",harq_pid);
     return(max_turbo_iterations);
   }
   */
+
+  harq_process->trials[harq_process->round]++;
+
   A = harq_process->TBS; //2072 for QPSK 1/3
 
   ret = dlsch->max_turbo_iterations;
@@ -250,7 +282,7 @@ uint32_t  dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
   G = harq_process->G;
   //get_G(frame_parms,nb_rb,dlsch->rb_alloc,mod_order,num_pdcch_symbols,phy_vars_ue->frame,subframe);
 
-  //  msg("DLSCH Decoding, harq_pid %d Ndi %d\n",harq_pid,harq_process->Ndi);
+  //  printf("DLSCH Decoding, harq_pid %d Ndi %d\n",harq_pid,harq_process->Ndi);
 
   if (harq_process->round == 0) {
     // This is a new packet, so compute quantities regarding segmentation
@@ -269,7 +301,7 @@ uint32_t  dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
 
   /*
   else {
-    msg("dlsch_decoding.c: Ndi>0 not checked yet!!\n");
+    printf("dlsch_decoding.c: Ndi>0 not checked yet!!\n");
     return(max_turbo_iterations);
   }
   */
@@ -296,10 +328,14 @@ uint32_t  dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
     break;
   }
 
-  if (harq_process->C >= MAX_NUM_DLSCH_SEGMENTS/bw_scaling) {
+  if (harq_process->C > MAX_NUM_DLSCH_SEGMENTS/bw_scaling) {
     LOG_E(PHY,"Illegal harq_process->C %d > %d\n",harq_process->C,MAX_NUM_DLSCH_SEGMENTS/bw_scaling);
     return((1+dlsch->max_turbo_iterations));
   }
+#ifdef DEBUG_DLSCH_DECODING
+  printf("Segmentation: C %d, Cminus %d, Kminus %d, Kplus %d\n",harq_process->C,harq_process->Cminus,harq_process->Kminus,harq_process->Kplus);
+#endif
+
   for (r=0; r<harq_process->C; r++) {
 
     
@@ -320,7 +356,7 @@ uint32_t  dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
     else if (Kr_bytes <= 768)
       iind = 123 + ((Kr_bytes-256)>>3);
     else {
-      msg("dlsch_decoding: Illegal codeword size %d!!!\n",Kr_bytes);
+      printf("dlsch_decoding: Illegal codeword size %d!!!\n",Kr_bytes);
       return(dlsch->max_turbo_iterations);
     }
 
@@ -353,7 +389,7 @@ uint32_t  dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
                                    (uint8_t*)&dummy_w[r][0],
                                    dlsch_llr+r_offset,
                                    harq_process->C,
-                                   NSOFT,
+                                   dlsch->Nsoft,
                                    dlsch->Mdlharq,
                                    dlsch->Kmimo,
                                    harq_process->rvidx,
@@ -414,15 +450,12 @@ uint32_t  dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
     printf("\n");
     */
 
+    //#ifndef __AVX2__
+#if 1
     if (err_flag == 0) {
 
       start_meas(dlsch_turbo_decoding_stats);
-#ifdef TURBO_S
-      ret = phy_threegpplte_turbo_decoder_scalar
-#else
-
       ret = tc
-#endif
             (&harq_process->d[r][96],
              harq_process->c[r],
              Kr,
@@ -442,7 +475,130 @@ uint32_t  dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
 
       stop_meas(dlsch_turbo_decoding_stats);
     }
+#else
+    if ((harq_process->C == 1) ||  
+	((r==harq_process->C-1) && (skipped_last==0))) { // last segment with odd number of segments
+
+      start_meas(dlsch_turbo_decoding_stats);
+      ret = tc
+            (&harq_process->d[r][96],
+             harq_process->c[r],
+             Kr,
+             f1f2mat_old[iind*2],
+             f1f2mat_old[(iind*2)+1],
+             dlsch->max_turbo_iterations,
+             crc_type,
+             (r==0) ? harq_process->F : 0,
+             &phy_vars_ue->dlsch_tc_init_stats,
+             &phy_vars_ue->dlsch_tc_alpha_stats,
+             &phy_vars_ue->dlsch_tc_beta_stats,
+             &phy_vars_ue->dlsch_tc_gamma_stats,
+             &phy_vars_ue->dlsch_tc_ext_stats,
+             &phy_vars_ue->dlsch_tc_intl1_stats,
+             &phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1);
+      stop_meas(dlsch_turbo_decoding_stats);
+      //      printf("single decode, exit\n");
+      //      exit(-1);
+    }
+    else {
+    // we can merge code segments
+      if ((skipped_last == 0) && (r<harq_process->C-1)) {
+	skipped_last = 1;
+	Kr_last = Kr;
+      }
+      else {
+	skipped_last=0;
+	
+	if (Kr_last == Kr) { // decode 2 code segments with AVX2 version
+#ifdef DEBUG_DLSCH_DECODING
+	  printf("single decoding segment %d (%p)\n",r-1,&harq_process->d[r-1][96]);
+#endif
+	  start_meas(dlsch_turbo_decoding_stats);
+#ifdef DEBUG_DLSCH_DECODING
+	  printf("double decoding segments %d,%d (%p,%p)\n",r-1,r,&harq_process->d[r-1][96],&harq_process->d[r][96]);
+#endif
+	  ret = tc_2cw
+            (&harq_process->d[r-1][96],
+	     &harq_process->d[r][96],
+             harq_process->c[r-1],
+             harq_process->c[r],
+             Kr,
+             f1f2mat_old[iind*2],
+             f1f2mat_old[(iind*2)+1],
+             dlsch->max_turbo_iterations,
+             crc_type,
+             (r==0) ? harq_process->F : 0,
+             &phy_vars_ue->dlsch_tc_init_stats,
+             &phy_vars_ue->dlsch_tc_alpha_stats,
+             &phy_vars_ue->dlsch_tc_beta_stats,
+             &phy_vars_ue->dlsch_tc_gamma_stats,
+             &phy_vars_ue->dlsch_tc_ext_stats,
+             &phy_vars_ue->dlsch_tc_intl1_stats,
+             &phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1);
+	  /*
+	  ret = tc
+            (&harq_process->d[r-1][96],
+             harq_process->c[r-1],
+             Kr_last,
+             f1f2mat_old[iind*2],
+             f1f2mat_old[(iind*2)+1],
+             dlsch->max_turbo_iterations,
+             crc_type,
+             (r==0) ? harq_process->F : 0,
+             &phy_vars_ue->dlsch_tc_init_stats,
+             &phy_vars_ue->dlsch_tc_alpha_stats,
+             &phy_vars_ue->dlsch_tc_beta_stats,
+             &phy_vars_ue->dlsch_tc_gamma_stats,
+             &phy_vars_ue->dlsch_tc_ext_stats,
+             &phy_vars_ue->dlsch_tc_intl1_stats,
+             &phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1);
 
+	     exit(-1);*/
+	  stop_meas(dlsch_turbo_decoding_stats);
+	} 
+	else { // Kr_last != Kr
+	  start_meas(dlsch_turbo_decoding_stats);
+	  ret = tc
+            (&harq_process->d[r-1][96],
+             harq_process->c[r-1],
+             Kr_last,
+             f1f2mat_old[iind*2],
+             f1f2mat_old[(iind*2)+1],
+             dlsch->max_turbo_iterations,
+             crc_type,
+             (r==0) ? harq_process->F : 0,
+             &phy_vars_ue->dlsch_tc_init_stats,
+             &phy_vars_ue->dlsch_tc_alpha_stats,
+             &phy_vars_ue->dlsch_tc_beta_stats,
+             &phy_vars_ue->dlsch_tc_gamma_stats,
+             &phy_vars_ue->dlsch_tc_ext_stats,
+             &phy_vars_ue->dlsch_tc_intl1_stats,
+             &phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1);
+	  stop_meas(dlsch_turbo_decoding_stats);
+	  
+	  start_meas(dlsch_turbo_decoding_stats);
+	  ret = tc
+            (&harq_process->d[r][96],
+             harq_process->c[r],
+             Kr,
+             f1f2mat_old[iind*2],
+             f1f2mat_old[(iind*2)+1],
+             dlsch->max_turbo_iterations,
+             crc_type,
+             (r==0) ? harq_process->F : 0,
+             &phy_vars_ue->dlsch_tc_init_stats,
+             &phy_vars_ue->dlsch_tc_alpha_stats,
+             &phy_vars_ue->dlsch_tc_beta_stats,
+             &phy_vars_ue->dlsch_tc_gamma_stats,
+             &phy_vars_ue->dlsch_tc_ext_stats,
+             &phy_vars_ue->dlsch_tc_intl1_stats,
+             &phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1);
+	  stop_meas(dlsch_turbo_decoding_stats);
+	  
+	}
+      }
+    }
+#endif
 
 
     if ((err_flag == 0) && (ret>=(1+dlsch->max_turbo_iterations))) {// a Code segment is in error so break;
@@ -456,6 +612,7 @@ uint32_t  dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
     dlsch->harq_ack[subframe].ack = 0;
     dlsch->harq_ack[subframe].harq_id = harq_pid;
     dlsch->harq_ack[subframe].send_harq_status = 1;
+    harq_process->errors[harq_process->round]++;
     harq_process->round++;
 
     //    LOG_D(PHY,"[UE %d] DLSCH: Setting NACK for subframe %d (pid %d, round %d)\n",phy_vars_ue->Mod_id,subframe,harq_pid,harq_process->round);
diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c
index de9acefb6ee3696609ff0001f915f209364bebc3..19ce6b9edc8ed2879c26fbbe7acb2aae35507398 100644
--- a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c
+++ b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c
@@ -281,7 +281,7 @@ int rx_pdsch(PHY_VARS_UE *phy_vars_ue,
     //  avgs = cmax(avgs,avg[(aarx<<1)+aatx]);
 
 
-    lte_ue_pdsch_vars[eNB_id]->log2_maxh = (log2_approx(avgs)/2);
+    lte_ue_pdsch_vars[eNB_id]->log2_maxh = (log2_approx(avgs)/2)+1;
     // + log2_approx(frame_parms->nb_antennas_tx_eNB-1) //-1 because log2_approx counts the number of bits
     //      + log2_approx(frame_parms->nb_antennas_rx-1);
 
@@ -1898,17 +1898,17 @@ void dlsch_channel_compensation_TM3(LTE_DL_FRAME_PARMS *frame_parms,
 
   for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
 
-    dl_ch0_128          = (__m128i *)&dl_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*12];
-    dl_ch1_128          = (__m128i *)&dl_ch_estimates_ext[2+aarx][symbol*frame_parms->N_RB_DL*12];
+    dl_ch0_128          = (__m128i *)&dl_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_DL*12];    // hr,0
+    dl_ch1_128          = (__m128i *)&dl_ch_estimates_ext[2+aarx][symbol*frame_parms->N_RB_DL*12];  // hr,1
 
 
     dl_ch_mag0_128      = (__m128i *)&dl_ch_mag0[aarx][symbol*frame_parms->N_RB_DL*12];
     dl_ch_mag0_128b     = (__m128i *)&dl_ch_magb0[aarx][symbol*frame_parms->N_RB_DL*12];
     dl_ch_mag1_128      = (__m128i *)&dl_ch_mag1[aarx][symbol*frame_parms->N_RB_DL*12];
     dl_ch_mag1_128b     = (__m128i *)&dl_ch_magb1[aarx][symbol*frame_parms->N_RB_DL*12];
-    rxdataF128          = (__m128i *)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_DL*12];
-    rxdataF_comp0_128   = (__m128i *)&rxdataF_comp0[aarx][symbol*frame_parms->N_RB_DL*12];
-    rxdataF_comp1_128   = (__m128i *)&rxdataF_comp1[aarx][symbol*frame_parms->N_RB_DL*12];
+    rxdataF128          = (__m128i *)&rxdataF_ext[aarx][symbol*frame_parms->N_RB_DL*12];           // yr
+    rxdataF_comp0_128   = (__m128i *)&rxdataF_comp0[aarx][symbol*frame_parms->N_RB_DL*12];         // yr,0 = yr * conj(hr,0)
+    rxdataF_comp1_128   = (__m128i *)&rxdataF_comp1[aarx][symbol*frame_parms->N_RB_DL*12];         // yr,1 = yr * conj(hr,1)
 
 
     for (rb=0; rb<nb_rb; rb++) {
diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c
index a35f89b8518baa2cdfc342a77045946702074621..f9f6002970ec433d7c962340c28a9954d379bcd3 100644
--- a/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c
+++ b/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c
@@ -662,14 +662,16 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms,
 
   if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) {
     if (frame_parms->mode1_flag==0)
-      len = (nb_rb*8)- (2*pbch_pss_sss_adjust/3);
+      len = (nb_rb*8) - (2*pbch_pss_sss_adjust/3);
     else
       len = (nb_rb*10) - (5*pbch_pss_sss_adjust/6);
   } else {
     len = (nb_rb*12) - pbch_pss_sss_adjust;
   }
 
+
   //  printf("dlsch_qpsk_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust);
+
   for (i=0; i<len; i++) {
     *llr32 = *rxF;
     //    printf("llr %d : (%d,%d)\n",i,((int16_t*)llr32)[0],((int16_t*)llr32)[1]);
diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c
index 3b9c58ca1bdd03ee55ca7606dadcb665014916a6..06aa2656be32001cc08a37f24dcb05a50598ab20 100644
--- a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c
+++ b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c
@@ -137,7 +137,7 @@ void layer1prec2A(int32_t *antenna0_sample, int32_t *antenna1_sample, uint8_t pr
 }
 
 int allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
-                       mod_sym_t **txdataF,
+                       int32_t **txdataF,
                        uint32_t *jj,
                        uint32_t *jj2,
                        uint16_t re_offset,
@@ -981,7 +981,7 @@ int allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
   return(0);
 }
 
-int allocate_REs_in_RB_MCH(mod_sym_t **txdataF,
+int allocate_REs_in_RB_MCH(int32_t **txdataF,
                            uint32_t *jj,
                            uint16_t re_offset,
                            uint32_t symbol_offset,
@@ -1178,7 +1178,7 @@ uint8_t get_pmi(uint8_t N_RB_DL,LTE_DL_eNB_HARQ_t *dlsch_harq,uint16_t rb)
 }
 
 
-int dlsch_modulation(mod_sym_t **txdataF,
+int dlsch_modulation(int32_t **txdataF,
                      int16_t amp,
                      uint32_t subframe_offset,
                      LTE_DL_FRAME_PARMS *frame_parms,
@@ -1492,7 +1492,7 @@ int dlsch_modulation(mod_sym_t **txdataF,
   return (re_allocated);
 }
 
-int mch_modulation(mod_sym_t **txdataF,
+int mch_modulation(int32_t **txdataF,
                    int16_t amp,
                    uint32_t subframe_offset,
                    LTE_DL_FRAME_PARMS *frame_parms,
diff --git a/openair1/PHY/LTE_TRANSPORT/drs_modulation.c b/openair1/PHY/LTE_TRANSPORT/drs_modulation.c
index 1b9df8046f81ad1d4d72f2c7ea79a10d8fc0d767..097bcdd691cde68864bb22b4e064b9679a43c7db 100644
--- a/openair1/PHY/LTE_TRANSPORT/drs_modulation.c
+++ b/openair1/PHY/LTE_TRANSPORT/drs_modulation.c
@@ -63,7 +63,7 @@ int generate_drs_pusch(PHY_VARS_UE *phy_vars_ue,
 
   uint8_t cyclic_shift,cyclic_shift0,cyclic_shift1;
   LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_ue->lte_frame_parms;
-  mod_sym_t *txdataF = phy_vars_ue->lte_ue_common_vars.txdataF[ant];
+  int32_t *txdataF = phy_vars_ue->lte_ue_common_vars.txdataF[ant];
   uint32_t u,v,alpha_ind;
   uint32_t u0=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[subframe<<1];
   uint32_t u1=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[1+(subframe<<1)];
@@ -147,13 +147,13 @@ int generate_drs_pusch(PHY_VARS_UE *phy_vars_ue,
         if (cyclic_shift == 0) {
           for (k=0; k<12; k++) {
             if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] >= 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] >= 0))
-              txdataF[symbol_offset+re_offset] = (mod_sym_t) 1;
+              txdataF[symbol_offset+re_offset] = (int32_t) 1;
             else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] >= 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] < 0))
-              txdataF[symbol_offset+re_offset] = (mod_sym_t) 2;
+              txdataF[symbol_offset+re_offset] = (int32_t) 2;
             else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] < 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] >= 0))
-              txdataF[symbol_offset+re_offset] = (mod_sym_t) 3;
+              txdataF[symbol_offset+re_offset] = (int32_t) 3;
             else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] < 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] < 0))
-              txdataF[symbol_offset+re_offset] = (mod_sym_t) 4;
+              txdataF[symbol_offset+re_offset] = (int32_t) 4;
 
             re_offset++;
             drs_offset++;
@@ -165,22 +165,22 @@ int generate_drs_pusch(PHY_VARS_UE *phy_vars_ue,
           for (k=0; k<12; k++) {
             if(k%2 == 0) {
               if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] >= 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] >= 0))
-                txdataF[symbol_offset+re_offset] = (mod_sym_t) 4;
+                txdataF[symbol_offset+re_offset] = (int32_t) 4;
               else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] >= 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] < 0))
-                txdataF[symbol_offset+re_offset] = (mod_sym_t) 3;
+                txdataF[symbol_offset+re_offset] = (int32_t) 3;
               else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] < 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] >= 0))
-                txdataF[symbol_offset+re_offset] = (mod_sym_t) 2;
+                txdataF[symbol_offset+re_offset] = (int32_t) 2;
               else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] < 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] < 0))
-                txdataF[symbol_offset+re_offset] = (mod_sym_t) 1;
+                txdataF[symbol_offset+re_offset] = (int32_t) 1;
             } else {
               if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] >= 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] >= 0))
-                txdataF[symbol_offset+re_offset] = (mod_sym_t) 1;
+                txdataF[symbol_offset+re_offset] = (int32_t) 1;
               else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] >= 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] < 0))
-                txdataF[symbol_offset+re_offset] = (mod_sym_t) 2;
+                txdataF[symbol_offset+re_offset] = (int32_t) 2;
               else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] < 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] >= 0))
-                txdataF[symbol_offset+re_offset] = (mod_sym_t) 3;
+                txdataF[symbol_offset+re_offset] = (int32_t) 3;
               else if ((ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1] < 0) && (ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1] < 0))
-                txdataF[symbol_offset+re_offset] = (mod_sym_t) 4;
+                txdataF[symbol_offset+re_offset] = (int32_t) 4;
             }
 
             re_offset++;
diff --git a/openair1/PHY/LTE_TRANSPORT/group_hopping.c b/openair1/PHY/LTE_TRANSPORT/group_hopping.c
index 992ac3088d316662cd9fbeebd48f6710e8e69e35..64c0830386faabed6f6d028a28edad8c42acbbeb 100644
--- a/openair1/PHY/LTE_TRANSPORT/group_hopping.c
+++ b/openair1/PHY/LTE_TRANSPORT/group_hopping.c
@@ -52,7 +52,7 @@ void generate_grouphop(LTE_DL_FRAME_PARMS *frame_parms)
 
   x2 = frame_parms->Nid_cell/30;
 #ifdef DEBUG_GROUPHOP
-  msg("[PHY] GroupHop:");
+  printf("[PHY] GroupHop:");
 #endif
 
   for (ns=0; ns<20; ns++) {
@@ -68,12 +68,12 @@ void generate_grouphop(LTE_DL_FRAME_PARMS *frame_parms)
     }
 
 #ifdef DEBUG_GROUPHOP
-    msg("%d.",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[ns]);
+    printf("%d.",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[ns]);
 #endif
   }
 
 #ifdef DEBUG_GROUPHOP
-  msg("\n");
+  printf("\n");
 #endif
 }
 
@@ -89,7 +89,7 @@ void generate_seqhop(LTE_DL_FRAME_PARMS *frame_parms)
 
   s = lte_gold_generic(&x1,&x2,reset);
 #ifdef DEBUG_GROUPHOP
-  msg("[PHY] SeqHop:");
+  printf("[PHY] SeqHop:");
 #endif
 
   for (ns=0; ns<20; ns++) {
@@ -100,12 +100,12 @@ void generate_seqhop(LTE_DL_FRAME_PARMS *frame_parms)
       frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[ns] = 0;
 
 #ifdef DEBUG_GROUPHOP
-    msg("%d.",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[ns]);
+    printf("%d.",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[ns]);
 #endif
   }
 
 #ifdef DEBUG_GROUPHOP
-  msg("\n");
+  printf("\n");
 #endif
 }
 
@@ -116,7 +116,7 @@ void generate_nPRS(LTE_DL_FRAME_PARMS *frame_parms)
   uint8_t reset=1;
   uint32_t x1, x2, s=0;
   // This is from Section 5.5.1.3
-  uint8_t Nsymb_UL = (frame_parms->Ncp_UL == 0) ? 7 : 6;
+  uint8_t Nsymb_UL = (frame_parms->Ncp_UL == NORMAL) ? 7 : 6;
   uint16_t next = 0;
   uint8_t ns=0;
 
@@ -124,7 +124,7 @@ void generate_nPRS(LTE_DL_FRAME_PARMS *frame_parms)
 
   x2 = (32*(uint32_t)(frame_parms->Nid_cell/30)) + fss_pusch;
 #ifdef DEBUG_GROUPHOP
-  msg("[PHY] nPRS:");
+  printf("[PHY] nPRS:");
 #endif
 
   for (n=0; n<(20*Nsymb_UL); n++) { //loop over total number of bytes to generate
@@ -137,7 +137,7 @@ void generate_nPRS(LTE_DL_FRAME_PARMS *frame_parms)
     if (n == next) {
       frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[ns] = ((uint8_t*)&s)[next&3];
 #ifdef DEBUG_GROUPHOP
-      msg("%d.",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[ns]);
+      printf("%d.",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[ns]);
 #endif
       ns++;
       next+=Nsymb_UL;
@@ -145,7 +145,7 @@ void generate_nPRS(LTE_DL_FRAME_PARMS *frame_parms)
   }
 
 #ifdef DEBUG_GROUPHOP
-  msg("\n");
+  printf("\n");
 #endif
 }
 
diff --git a/openair1/PHY/LTE_TRANSPORT/initial_sync.c b/openair1/PHY/LTE_TRANSPORT/initial_sync.c
index bc2a00d8e6c16f587d3af3634a6d375cb3258bb3..5a8463a86129888ba733e2dc142e868398a3dde4 100644
--- a/openair1/PHY/LTE_TRANSPORT/initial_sync.c
+++ b/openair1/PHY/LTE_TRANSPORT/initial_sync.c
@@ -48,7 +48,7 @@
 #include "gain_control.h"
 #endif
 
-#if defined(OAI_USRP) || defined(EXMIMO)
+#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_LMSSDR)
 #include "common_lib.h"
 extern openair0_config_t openair0_cfg[];
 #endif
@@ -280,7 +280,6 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
   uint8_t flip_fdd_ncp,flip_fdd_ecp,flip_tdd_ncp,flip_tdd_ecp;
   //  uint16_t Nid_cell_fdd_ncp=0,Nid_cell_fdd_ecp=0,Nid_cell_tdd_ncp=0,Nid_cell_tdd_ecp=0;
   LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_ue->lte_frame_parms;
-  int i;
   int ret=-1;
   int aarx,rx_power=0;
   /*#ifdef OAI_USRP
@@ -291,17 +290,10 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
   frame_parms->Ncp=NORMAL;
   frame_parms->frame_type=FDD;
   init_frame_parms(frame_parms,1);
-
-  //  write_output("rxdata0.m","rxd0",phy_vars_ue->lte_ue_common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
-
-  /*#ifdef OAI_USRP
-  for (aarx = 0; aarx<frame_parms->nb_antennas_rx;aarx++) {
-    rxdata128 = (__m128i*)phy_vars_ue->lte_ue_common_vars.rxdata[aarx];
-    for (i=0; i<(frame_parms->samples_per_tti*10)>>2; i++) {
-      rxdata128[i] = _mm_srai_epi16(rxdata128[i],4);
-    } 
-  }
-  #endif*/
+  /*
+  write_output("rxdata0.m","rxd0",phy_vars_ue->lte_ue_common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
+  exit(-1);
+  */
   sync_pos = lte_sync_time(phy_vars_ue->lte_ue_common_vars.rxdata,
                            frame_parms,
                            (int *)&phy_vars_ue->lte_ue_common_vars.eNb_id);
@@ -316,30 +308,6 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
   LOG_I(PHY,"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n",phy_vars_ue->Mod_id,sync_pos,phy_vars_ue->lte_ue_common_vars.eNb_id);
 #endif
 
-
-  for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++)
-    rx_power += signal_energy(&phy_vars_ue->lte_ue_common_vars.rxdata[aarx][sync_pos2],
-                              frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples);
-
-  phy_vars_ue->PHY_measurements.rx_power_avg_dB[0] = dB_fixed(rx_power/frame_parms->nb_antennas_rx);
-
-#ifdef DEBUG_INITIAL_SYNCH
-  LOG_I(PHY,"[UE%d] Initial sync : Estimated power: %d dB\n",phy_vars_ue->Mod_id,phy_vars_ue->PHY_measurements.rx_power_avg_dB[0] );
-#endif
-
-#ifdef EXMIMO
-
-  if ((openair_daq_vars.rx_gain_mode == DAQ_AGC_ON) &&
-      (mode != rx_calib_ue) && (mode != rx_calib_ue_med) && (mode != rx_calib_ue_byp) )
-    //phy_adjust_gain(phy_vars_ue,0);
-    gain_control_all(phy_vars_ue->PHY_measurements.rx_power_avg_dB[0],0);
-
-#else
-#ifndef OAI_USRP
-  phy_adjust_gain(phy_vars_ue,0);
-#endif
-#endif
-
   // SSS detection
 
   // PSS is hypothesized in last symbol of first slot in Frame
@@ -528,20 +496,20 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
 #endif
 
     if (phy_vars_ue->UE_scan_carrier == 0) {
-#ifdef OPENAIR2
-      LOG_I(PHY,"[UE%d] Sending synch status to higher layers\n",phy_vars_ue->Mod_id);
-      //mac_resynch();
-      mac_xface->dl_phy_sync_success(phy_vars_ue->Mod_id,phy_vars_ue->frame_rx,0,1);//phy_vars_ue->lte_ue_common_vars.eNb_id);
-#endif //OPENAIR2
-      
+      if (phy_vars_ue->mac_enabled==1) {
+	LOG_I(PHY,"[UE%d] Sending synch status to higher layers\n",phy_vars_ue->Mod_id);
+	//mac_resynch();
+	mac_xface->dl_phy_sync_success(phy_vars_ue->Mod_id,phy_vars_ue->frame_rx,0,1);//phy_vars_ue->lte_ue_common_vars.eNb_id);
+	phy_vars_ue->UE_mode[0] = PRACH;
+      }
+      else {
+	phy_vars_ue->UE_mode[0] = PUSCH;
+      }
+
       generate_pcfich_reg_mapping(frame_parms);
       generate_phich_reg_mapping(frame_parms);
       //    init_prach625(frame_parms);
-#ifndef OPENAIR2
-      phy_vars_ue->UE_mode[0] = PUSCH;
-#else
-      phy_vars_ue->UE_mode[0] = PRACH;
-#endif
+
       //phy_vars_ue->lte_ue_pbch_vars[0]->pdu_errors=0;
       phy_vars_ue->lte_ue_pbch_vars[0]->pdu_errors_conseq=0;
     //phy_vars_ue->lte_ue_pbch_vars[0]->pdu_errors_last=0;
@@ -567,7 +535,7 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
 	  phy_vars_ue->lte_frame_parms.phich_config_common.phich_duration,
 	  phich_string[phy_vars_ue->lte_frame_parms.phich_config_common.phich_resource],
 	  phy_vars_ue->lte_frame_parms.nb_antennas_tx_eNB);
-#if defined(OAI_USRP) || defined(EXMIMO)
+#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_LMSSDR)
     LOG_I(PHY,"[UE %d] Frame %d Measured Carrier Frequency %.0f Hz (offset %d Hz)\n",
 	  phy_vars_ue->Mod_id,
 	  phy_vars_ue->frame_rx,
@@ -595,6 +563,65 @@ int initial_sync(PHY_VARS_UE *phy_vars_ue, runmode_t mode)
 
   }
 
+  // gain control
+  if (ret!=0) { //we are not synched, so we cannot use rssi measurement (which is based on channel estimates)
+    rx_power = 0;
+
+    // do a measurement on the best guess of the PSS
+    for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++)
+      rx_power += signal_energy(&phy_vars_ue->lte_ue_common_vars.rxdata[aarx][sync_pos2],
+				frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples);
+    
+    /*
+    // do a measurement on the full frame
+    for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++)
+      rx_power += signal_energy(&phy_vars_ue->lte_ue_common_vars.rxdata[aarx][0],
+				frame_parms->samples_per_tti*10);
+    */
+
+    // we might add a low-pass filter here later
+    phy_vars_ue->PHY_measurements.rx_power_avg[0] = rx_power/frame_parms->nb_antennas_rx; 
+
+    phy_vars_ue->PHY_measurements.rx_power_avg_dB[0] = dB_fixed(phy_vars_ue->PHY_measurements.rx_power_avg[0]);
+
+#ifdef DEBUG_INITIAL_SYNCH
+  LOG_I(PHY,"[UE%d] Initial sync : Estimated power: %d dB\n",phy_vars_ue->Mod_id,phy_vars_ue->PHY_measurements.rx_power_avg_dB[0] );
+#endif
+
+#ifdef EXMIMO
+  if ((openair_daq_vars.rx_gain_mode == DAQ_AGC_ON) &&
+      (mode != rx_calib_ue) && (mode != rx_calib_ue_med) && (mode != rx_calib_ue_byp) )
+    //phy_adjust_gain(phy_vars_ue,0);
+    gain_control_all(phy_vars_ue->PHY_measurements.rx_power_avg_dB[0],0);
+
+#else
+#ifndef OAI_USRP
+#ifndef OAI_BLADERF 
+#ifndef OAI_LMSSDR
+  phy_adjust_gain(phy_vars_ue,phy_vars_ue->PHY_measurements.rx_power_avg_dB[0],0);
+#endif
+#endif
+#endif
+#endif
+  }
+  else {
+#ifdef EXMIMO
+  if ((openair_daq_vars.rx_gain_mode == DAQ_AGC_ON) &&
+      (mode != rx_calib_ue) && (mode != rx_calib_ue_med) && (mode != rx_calib_ue_byp) )
+    //phy_adjust_gain(phy_vars_ue,0);
+    gain_control_all(dB_fixed(phy_vars_ue->PHY_measurements.rssi),0);
+
+#else
+#ifndef OAI_USRP
+#ifndef OAI_BLADERF 
+#ifndef OAI_LMSSDR
+  phy_adjust_gain(phy_vars_ue,dB_fixed(phy_vars_ue->PHY_measurements.rssi),0);
+#endif
+#endif
+#endif
+#endif
+  }
+
   //  exit_fun("debug exit");
   return ret;
 }
diff --git a/openair1/PHY/LTE_TRANSPORT/pbch.c b/openair1/PHY/LTE_TRANSPORT/pbch.c
index 0eee263a10f14aea989bd05f6d8e89bd962a9028..b7b7149c627750c6c40e7dc13b2e1cfe943aad43 100755
--- a/openair1/PHY/LTE_TRANSPORT/pbch.c
+++ b/openair1/PHY/LTE_TRANSPORT/pbch.c
@@ -61,7 +61,7 @@
 #define PBCH_A 24
 
 int allocate_pbch_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
-                            mod_sym_t **txdataF,
+                            int32_t **txdataF,
                             uint32_t *jj,
                             uint16_t re_offset,
                             uint32_t symbol_offset,
@@ -160,7 +160,7 @@ int allocate_pbch_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
 
 //uint8_t pbch_d[96+(3*(16+PBCH_A))], pbch_w[3*3*(16+PBCH_A)],pbch_e[1920];  //one bit per byte
 int generate_pbch(LTE_eNB_PBCH *eNB_pbch,
-                  mod_sym_t **txdataF,
+                  int32_t **txdataF,
                   int amp,
                   LTE_DL_FRAME_PARMS *frame_parms,
                   uint8_t *pbch_pdu,
diff --git a/openair1/PHY/LTE_TRANSPORT/pcfich.c b/openair1/PHY/LTE_TRANSPORT/pcfich.c
index f289fd3bd078afed7dbb67f65d5cee1859552564..915ce17a45c1016cc454f21970d67d4a5220e7af 100644
--- a/openair1/PHY/LTE_TRANSPORT/pcfich.c
+++ b/openair1/PHY/LTE_TRANSPORT/pcfich.c
@@ -38,7 +38,6 @@
 * \warning
 */
 #include "PHY/defs.h"
-#include "MAC_INTERFACE/extern.h"
 
 //uint16_t pcfich_reg[4];
 //uint8_t pcfich_first_reg_idx = 0;
@@ -144,12 +143,12 @@ uint8_t pcfich_b[4][32]= {{0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1,0,1,1
 void generate_pcfich(uint8_t num_pdcch_symbols,
                      int16_t amp,
                      LTE_DL_FRAME_PARMS *frame_parms,
-                     mod_sym_t **txdataF,
+                     int32_t **txdataF,
                      uint8_t subframe)
 {
 
   uint8_t pcfich_bt[32],nsymb,pcfich_quad;
-  mod_sym_t pcfich_d[2][16];
+  int32_t pcfich_d[2][16];
   uint8_t i;
   uint32_t symbol_offset,m,re_offset,reg_offset;
   int16_t gain_lin_QPSK;
diff --git a/openair1/PHY/LTE_TRANSPORT/phich.c b/openair1/PHY/LTE_TRANSPORT/phich.c
index e08ad239bdc9a9c0a83e57dcfca799ebb56d4a4c..a7138bcd0492e4df6b14569fcf9f2a22b12aee28 100644
--- a/openair1/PHY/LTE_TRANSPORT/phich.c
+++ b/openair1/PHY/LTE_TRANSPORT/phich.c
@@ -46,6 +46,8 @@
 #include "ARCH/CBMIMO1/DEVICE_DRIVER/extern.h"
 #endif
 
+#include "T.h"
+
 //#define DEBUG_PHICH 1
 
 //extern unsigned short pcfich_reg[4];
@@ -393,8 +395,8 @@ void generate_phich_emul(LTE_DL_FRAME_PARMS *frame_parms,
 
 }
 
-mod_sym_t alam_bpsk_perm1[4] = {2,1,4,3}; // -conj(x) 1 (-1-j) -> 2 (1-j), 2->1, 3 (-1+j) -> (4) 1+j, 4->3
-mod_sym_t alam_bpsk_perm2[4] = {3,4,2,1}; // conj(x) 1 (-1-j) -> 3 (-1+j), 3->1, 2 (1-j) -> 4 (1+j), 4->2
+int32_t alam_bpsk_perm1[4] = {2,1,4,3}; // -conj(x) 1 (-1-j) -> 2 (1-j), 2->1, 3 (-1+j) -> (4) 1+j, 4->3
+int32_t alam_bpsk_perm2[4] = {3,4,2,1}; // conj(x) 1 (-1-j) -> 3 (-1+j), 3->1, 2 (1-j) -> 4 (1+j), 4->2
 
 // This routine generates the PHICH
 
@@ -404,7 +406,7 @@ void generate_phich(LTE_DL_FRAME_PARMS *frame_parms,
                     uint8_t ngroup_PHICH,
                     uint8_t HI,
                     uint8_t subframe,
-                    mod_sym_t **y)
+                    int32_t **y)
 {
 
   int16_t d[24],*dp;
@@ -1425,7 +1427,7 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB,
 
   LTE_DL_FRAME_PARMS *frame_parms=&phy_vars_eNB->lte_frame_parms;
   LTE_eNB_ULSCH_t **ulsch_eNB = phy_vars_eNB->ulsch_eNB;
-  mod_sym_t **txdataF = phy_vars_eNB->lte_eNB_common_vars.txdataF[sect_id];
+  int32_t **txdataF = phy_vars_eNB->lte_eNB_common_vars.txdataF[sect_id];
   uint8_t harq_pid;
   uint8_t Ngroup_PHICH,ngroup_PHICH,nseq_PHICH;
   uint8_t NSF_PHICH = 4;
@@ -1466,7 +1468,6 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB,
 
         nseq_PHICH = ((ulsch_eNB[UE_id]->harq_processes[harq_pid]->first_rb/Ngroup_PHICH) +
                       ulsch_eNB[UE_id]->harq_processes[harq_pid]->n_DMRS)%(2*NSF_PHICH);
-        //#ifdef DEBUG_PHICH
         LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d Generating PHICH, ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d dci_alloc %d)\n",
               phy_vars_eNB->Mod_id,harq_pid,phy_vars_eNB->proc[sched_subframe].frame_tx,
               subframe,ngroup_PHICH,Ngroup_PHICH,nseq_PHICH,
@@ -1474,7 +1475,6 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB,
               ulsch_eNB[UE_id]->harq_processes[harq_pid]->first_rb,
               ulsch_eNB[UE_id]->harq_processes[harq_pid]->dci_alloc);
 
-        //#endif
         if (ulsch_eNB[UE_id]->Msg3_active == 1) {
           LOG_D(PHY,"[eNB %d][PUSCH %d][RAPROC] Frame %d, subframe %d: Generating Msg3 PHICH for UE %d, ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d\n",
                 phy_vars_eNB->Mod_id,harq_pid,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,
@@ -1506,15 +1506,15 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB,
         if ((ulsch_eNB[UE_id]->harq_processes[harq_pid]->dci_alloc == 0) &&
             (ulsch_eNB[UE_id]->harq_processes[harq_pid]->rar_alloc == 0) ) {
           if (ulsch_eNB[UE_id]->harq_processes[harq_pid]->phich_ACK==0 ) {
+            T(T_ENB_PHY_ULSCH_UE_NO_DCI_RETRANSMISSION, T_INT(phy_vars_eNB->Mod_id), T_INT(phy_vars_eNB->proc[sched_subframe].frame_tx),
+              T_INT(subframe), T_INT(UE_id), T_INT(ulsch_eNB[UE_id]->rnti), T_INT(harq_pid));
             LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d, subframe %d : PHICH NACK / (no format0 DCI) Setting subframe_scheduling_flag\n",
                   phy_vars_eNB->Mod_id,harq_pid,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe);
             ulsch_eNB[UE_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 1;
-            //      ulsch_eNB[UE_id]->harq_processes[harq_pid]->Ndi = 0;
-            //      ulsch_eNB[UE_id]->harq_processes[harq_pid]->round++; //this is already done in phy_procedures
             ulsch_eNB[UE_id]->harq_processes[harq_pid]->rvidx = rv_table[ulsch_eNB[UE_id]->harq_processes[harq_pid]->round&3];
             ulsch_eNB[UE_id]->harq_processes[harq_pid]->O_RI                                  = 0;
             ulsch_eNB[UE_id]->harq_processes[harq_pid]->Or2                                   = 0;
-            ulsch_eNB[UE_id]->harq_processes[harq_pid]->Or1                                   = 0;//sizeof_HLC_subband_cqi_nopmi_5MHz;
+            ulsch_eNB[UE_id]->harq_processes[harq_pid]->Or1                                   = 0;
             ulsch_eNB[UE_id]->harq_processes[harq_pid]->uci_format                            = HLC_subband_cqi_nopmi;
 
           } else {
diff --git a/openair1/PHY/LTE_TRANSPORT/pilots.c b/openair1/PHY/LTE_TRANSPORT/pilots.c
index ba1eee293dc53819458bcb5cef645734806ee61d..66e32fcb4977cfac5dac2534f180534ae6abe6d1 100644
--- a/openair1/PHY/LTE_TRANSPORT/pilots.c
+++ b/openair1/PHY/LTE_TRANSPORT/pilots.c
@@ -41,7 +41,7 @@
 #include "PHY/defs.h"
 
 void generate_pilots(PHY_VARS_eNB *phy_vars_eNB,
-                     mod_sym_t **txdataF,
+                     int32_t **txdataF,
                      int16_t amp,
                      uint16_t Ntti)
 {
@@ -168,7 +168,7 @@ void generate_pilots(PHY_VARS_eNB *phy_vars_eNB,
 }
 
 int generate_pilots_slot(PHY_VARS_eNB *phy_vars_eNB,
-                         mod_sym_t **txdataF,
+                         int32_t **txdataF,
                          int16_t amp,
                          uint16_t slot,
                          int first_pilot_only)
diff --git a/openair1/PHY/LTE_TRANSPORT/pilots_mbsfn.c b/openair1/PHY/LTE_TRANSPORT/pilots_mbsfn.c
index a81eb3848070490dcc84414ccee67b2a49440e6c..168f3db17c08354d20cdb677b290e7d97878f9ec 100644
--- a/openair1/PHY/LTE_TRANSPORT/pilots_mbsfn.c
+++ b/openair1/PHY/LTE_TRANSPORT/pilots_mbsfn.c
@@ -42,7 +42,7 @@
 
 
 int generate_mbsfn_pilot(PHY_VARS_eNB *phy_vars_eNB,
-                         mod_sym_t **txdataF,
+                         int32_t **txdataF,
                          int16_t amp,
                          uint16_t subframe)
 {
diff --git a/openair1/PHY/LTE_TRANSPORT/prach.c b/openair1/PHY/LTE_TRANSPORT/prach.c
index 25ecc392e80a3cb64c69e5f6c819f118862043bd..b93519d393ba58673ea3ed0d8993f99ff6663edd 100644
--- a/openair1/PHY/LTE_TRANSPORT/prach.c
+++ b/openair1/PHY/LTE_TRANSPORT/prach.c
@@ -608,7 +608,7 @@ int32_t generate_prach( PHY_VARS_UE *phy_vars_ue, uint8_t eNB_id, uint8_t subfra
   uint8_t preamble_index     = phy_vars_ue->prach_resources[eNB_id]->ra_PreambleIndex;
   uint8_t tdd_mapindex       = phy_vars_ue->prach_resources[eNB_id]->ra_TDD_map_index;
   int16_t *prachF           = phy_vars_ue->lte_ue_prach_vars[eNB_id]->prachF;
-  static int16_t prach_tmp[45600*2] __attribute__((aligned(16)));
+  static int16_t prach_tmp[45600*2] __attribute__((aligned(32)));
   int16_t *prach            = prach_tmp;
   int16_t *prach2;
   int16_t amp               = phy_vars_ue->lte_ue_prach_vars[eNB_id]->amp;
@@ -898,7 +898,7 @@ int32_t generate_prach( PHY_VARS_UE *phy_vars_ue, uint8_t eNB_id, uint8_t subfra
       memmove( prach, prach+512, Ncp<<2 );
       prach_len = 256+Ncp;
     } else {
-      idft1536(prachF,prach2);
+      idft1536(prachF,prach2,1);
       memmove( prach, prach+3072, Ncp<<2 );
       prach_len = 1536+Ncp;
 
@@ -1058,21 +1058,24 @@ int32_t generate_prach( PHY_VARS_UE *phy_vars_ue, uint8_t eNB_id, uint8_t subfra
 }
 //__m128i mmtmpX0,mmtmpX1,mmtmpX2,mmtmpX3;
 
-void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_energy_list, uint16_t *preamble_delay_list, uint16_t Nf, uint8_t tdd_mapindex)
+void rx_prach(PHY_VARS_eNB *phy_vars_eNB,
+	      uint8_t subframe,
+	      uint16_t *preamble_energy_list, 
+	      uint16_t *preamble_delay_list, 
+	      uint16_t Nf, 
+	      uint8_t tdd_mapindex)
 {
 
   int i;
-  lte_frame_type_t frame_type         = phy_vars_eNB->lte_frame_parms.frame_type;
-
-  //uint8_t tdd_config         = phy_vars_eNB->lte_frame_parms.tdd_config;
-  uint16_t rootSequenceIndex = phy_vars_eNB->lte_frame_parms.prach_config_common.rootSequenceIndex;
-  uint8_t prach_ConfigIndex  = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
-  uint8_t Ncs_config         = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig;
-  uint8_t restricted_set     = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag;
-  //uint8_t n_ra_prboffset     = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset;
-  int16_t *prachF           = phy_vars_eNB->lte_eNB_prach_vars.prachF;
-  int16_t **rxsigF          = phy_vars_eNB->lte_eNB_prach_vars.rxsigF;
-  int16_t **prach_ifft      = phy_vars_eNB->lte_eNB_prach_vars.prach_ifft;
+  lte_frame_type_t frame_type = phy_vars_eNB->lte_frame_parms.frame_type;
+
+  uint16_t rootSequenceIndex  = phy_vars_eNB->lte_frame_parms.prach_config_common.rootSequenceIndex;
+  uint8_t prach_ConfigIndex   = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
+  uint8_t Ncs_config          = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig;
+  uint8_t restricted_set      = phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag;
+  int16_t *prachF             = phy_vars_eNB->lte_eNB_prach_vars.prachF;
+  int16_t **rxsigF            = phy_vars_eNB->lte_eNB_prach_vars.rxsigF;
+  int16_t **prach_ifft        = phy_vars_eNB->lte_eNB_prach_vars.prach_ifft;
   int16_t *prach[4];
   int16_t *prach2;
   uint8_t n_ra_prb;
@@ -1086,12 +1089,8 @@ void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_ene
   uint16_t numshift=0;
   uint16_t *prach_root_sequence_map;
   uint8_t prach_fmt = get_prach_fmt(prach_ConfigIndex,frame_type);
-  //uint8_t Nsp=2;
-  //uint8_t f_ra,t1_ra;
   uint16_t N_ZC = (prach_fmt <4)?839:139;
   uint8_t not_found;
-  //  LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms;
-  //  uint16_t subframe_offset;
   int k;
   uint16_t u;
   int16_t *Xu;
@@ -1107,7 +1106,6 @@ void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_ene
 
   for (aa=0; aa<nb_ant_rx; aa++) {
     prach[aa] = (int16_t*)&phy_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][subframe*phy_vars_eNB->lte_frame_parms.samples_per_tti-phy_vars_eNB->N_TA_offset];
-    //    remove_625_Hz(phy_vars_eNB,prach[aa]);
   }
 
   // First compute physical root sequence
@@ -1134,37 +1132,6 @@ void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_ene
   n_ra_prb = get_prach_prb_offset(&(phy_vars_eNB->lte_frame_parms),tdd_mapindex,Nf);
   prach_root_sequence_map = (prach_fmt < 4) ? prach_root_sequence_map0_3 : prach_root_sequence_map4;
 
-  /*
-  // this code is now part of get_prach_prb_offset
-  if (frame_type == TDD) { // TDD
-    // adjust n_ra_prboffset for frequency multiplexing (p.36 36.211)
-
-    f_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[tdd_mapindex].f_ra;
-
-    if (prach_fmt < 4) {
-      if ((f_ra&1) == 0) {
-        n_ra_prb = n_ra_prboffset + 6*(f_ra>>1);
-      } else {
-        n_ra_prb = phy_vars_eNB->lte_frame_parms.N_RB_UL - 6 - n_ra_prboffset + 6*(f_ra>>1);
-      }
-
-    } else {
-      if ((tdd_config >2) && (tdd_config<6))
-        Nsp = 2;
-
-      t1_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[0].t1_ra;
-
-      if ((((Nf&1)*(2-Nsp)+t1_ra)&1) == 0) {
-        n_ra_prb = 6*f_ra;
-      } else {
-        n_ra_prb = phy_vars_eNB->lte_frame_parms.N_RB_UL - 6*(f_ra+1);
-      }
-
-    }
-  }
-  */
-
-  //    printf("NCS %d\n",NCS);
   // PDP is oversampled, e.g. 1024 sample instead of 839
   // Adapt the NCS (zero-correlation zones) with oversampling factor e.g. 1024/839
   NCS2 = (N_ZC==839) ? ((NCS<<10)/839) : ((NCS<<8)/139);
@@ -1217,9 +1184,6 @@ void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_ene
     break;
   }
 
-  //  nsymb = (frame_parms->Ncp==0) ? 14:12;
-  //  subframe_offset = (unsigned int)frame_parms->ofdm_symbol_size*subframe*nsymb;
-
   preamble_offset_old = 99;
 
   for (preamble_index=0 ; preamble_index<64 ; preamble_index++) {
@@ -1338,10 +1302,10 @@ void rx_prach(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint16_t *preamble_ene
           if (prach_fmt == 4) {
             dft256(prach2,rxsigF[aa],1);
           } else {
-            dft1536(prach2,rxsigF[aa]);
+            dft1536(prach2,rxsigF[aa],1);
 
             if (prach_fmt>1)
-              dft1536(prach2+3072,rxsigF[aa]+3072);
+              dft1536(prach2+3072,rxsigF[aa]+3072,1);
           }
 
           break;
diff --git a/openair1/PHY/LTE_TRANSPORT/print_stats.c b/openair1/PHY/LTE_TRANSPORT/print_stats.c
index 53ca8759532d12c6004baa755601bd0eb2971d2f..7445fca40f62c1b79314678008d67921079c0b10 100644
--- a/openair1/PHY/LTE_TRANSPORT/print_stats.c
+++ b/openair1/PHY/LTE_TRANSPORT/print_stats.c
@@ -50,7 +50,7 @@
 #endif
 
 extern int mac_get_rrc_status(uint8_t Mod_id,uint8_t eNB_flag,uint8_t index);
-#if defined(OAI_USRP) || defined(EXMIMO)
+#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
 #include "common_lib.h"
 extern openair0_config_t openair0_cfg[];
 #endif
@@ -61,17 +61,19 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t
   uint8_t eNB=0;
   uint32_t RRC_status;
   int len=length;
+  int harq_pid,round;
 
   if (phy_vars_ue==NULL)
     return 0;
 
   if ((mode == normal_txrx) || (mode == no_L2_connect)) {
     len += sprintf(&buffer[len], "[UE_PROC] UE %d, RNTI %x\n",phy_vars_ue->Mod_id, phy_vars_ue->lte_ue_pdcch_vars[0]->crnti);
-     len += sprintf(&buffer[len],"[UE PROC] RSRP[0] %.2f dBm/RE, RSSI %.2f dBm, RSRQ[0] %.2f dB, N0 %d dBm/RE\n",
+     len += sprintf(&buffer[len],"[UE PROC] RSRP[0] %.2f dBm/RE, RSSI %.2f dBm, RSRQ[0] %.2f dB, N0 %d dBm/RE (NF %.1f dB)\n",
 		    10*log10(phy_vars_ue->PHY_measurements.rsrp[0])-phy_vars_ue->rx_total_gain_dB,
 		    10*log10(phy_vars_ue->PHY_measurements.rssi)-phy_vars_ue->rx_total_gain_dB, 
 		    10*log10(phy_vars_ue->PHY_measurements.rsrq[0]),
-		    phy_vars_ue->PHY_measurements.n0_power_tot_dBm);
+		    phy_vars_ue->PHY_measurements.n0_power_tot_dBm,
+		    (double)phy_vars_ue->PHY_measurements.n0_power_tot_dBm+132.24);
 
     /*
     len += sprintf(&buffer[len],
@@ -96,20 +98,20 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t
 #ifdef EXMIMO
     len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB (LNA %d, vga %d dB)\n",phy_vars_ue->rx_total_gain_dB, openair0_cfg[0].rxg_mode[0],(int)openair0_cfg[0].rx_gain[0]);
 #endif
-#ifdef OAI_USRP
+#if defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
     len += sprintf(&buffer[len], "[UE PROC] RX Gain %d dB\n",phy_vars_ue->rx_total_gain_dB);
 #endif
-#if defined(EXMIMO) || defined(OAI_USRP)
+#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
     len += sprintf(&buffer[len], "[UE_PROC] Frequency offset %d Hz (%d), estimated carrier frequency %f Hz\n",phy_vars_ue->lte_ue_common_vars.freq_offset,openair_daq_vars.freq_offset,openair0_cfg[0].rx_freq[0]-phy_vars_ue->lte_ue_common_vars.freq_offset);
 #endif
     len += sprintf(&buffer[len], "[UE PROC] UE mode = %s (%d)\n",mode_string[phy_vars_ue->UE_mode[0]],phy_vars_ue->UE_mode[0]);
     len += sprintf(&buffer[len], "[UE PROC] timing_advance = %d\n",phy_vars_ue->timing_advance);
     if (phy_vars_ue->UE_mode[0]==PUSCH) {
       len += sprintf(&buffer[len], "[UE PROC] Po_PUSCH = %d dBm (PL %d dB, Po_NOMINAL_PUSCH %d dBm, PHR %d dB)\n", 
-		     PHY_vars_UE_g[0][0]->ulsch_ue[0]->Po_PUSCH,
+		     phy_vars_ue->ulsch_ue[0]->Po_PUSCH,
 		     get_PL(phy_vars_ue->Mod_id,phy_vars_ue->CC_id,0),
-		     mac_xface->get_Po_NOMINAL_PUSCH(phy_vars_ue->Mod_id,0),
-		     PHY_vars_UE_g[0][0]->ulsch_ue[0]->PHR);
+		     phy_vars_ue->lte_frame_parms.ul_power_control_config_common.p0_NominalPUSCH,
+		     phy_vars_ue->ulsch_ue[0]->PHR);
       len += sprintf(&buffer[len], "[UE PROC] Po_PUCCH = %d dBm (Po_NOMINAL_PUCCH %d dBm, g_pucch %d dB)\n", 
 		     get_PL(phy_vars_ue->Mod_id,phy_vars_ue->CC_id,0)+
 		     phy_vars_ue->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH+
@@ -487,13 +489,27 @@ int dump_ue_stats(PHY_VARS_UE *phy_vars_ue, char* buffer, int length, runmode_t
       if (phy_vars_ue->transmission_mode[eNB] == 6)
         len += sprintf(&buffer[len], "[UE PROC] Mode 6 Wideband CQI eNB %d : %d dB\n",eNB,phy_vars_ue->PHY_measurements.precoded_cqi_dB[eNB][0]);
 
+      for (harq_pid=0;harq_pid<8;harq_pid++) {
+	len+=sprintf(&buffer[len],"[UE PROC] eNB %d: CW 0 harq_pid %d, mcs %d:",eNB,harq_pid,phy_vars_ue->dlsch_ue[0][0]->harq_processes[harq_pid]->mcs);
+	for (round=0;round<8;round++)
+	  len+=sprintf(&buffer[len],"%d/%d ",
+		       phy_vars_ue->dlsch_ue[0][0]->harq_processes[harq_pid]->errors[round],
+		       phy_vars_ue->dlsch_ue[0][0]->harq_processes[harq_pid]->trials[round]);
+	len+=sprintf(&buffer[len],"\n");
+      }
       if (phy_vars_ue->dlsch_ue[0] && phy_vars_ue->dlsch_ue[0][0] && phy_vars_ue->dlsch_ue[0][1]) {
         len += sprintf(&buffer[len], "[UE PROC] Saved PMI for DLSCH eNB %d : %jx (%p)\n",eNB,pmi2hex_2Ar1(phy_vars_ue->dlsch_ue[0][0]->pmi_alloc),phy_vars_ue->dlsch_ue[0][0]);
 
         len += sprintf(&buffer[len], "[UE PROC] eNB %d: dl_power_off = %d\n",eNB,phy_vars_ue->dlsch_ue[0][0]->harq_processes[0]->dl_power_off);
 
-        len += sprintf(&buffer[len], "[UE PROC] DL mcs1 (dlsch cw1) %d\n",phy_vars_ue->dlsch_ue[0][0]->harq_processes[0]->mcs);
-        len += sprintf(&buffer[len], "[UE PROC] DL mcs2 (dlsch cw2) %d\n",phy_vars_ue->dlsch_ue[0][1]->harq_processes[0]->mcs);
+	for (harq_pid=0;harq_pid<8;harq_pid++) {
+	  len+=sprintf(&buffer[len],"[UE PROC] eNB %d: CW 1 harq_pid %d, mcs %d:",eNB,harq_pid,phy_vars_ue->dlsch_ue[0][1]->harq_processes[0]->mcs);
+	  for (round=0;round<8;round++)
+	    len+=sprintf(&buffer[len],"%d/%d ",
+			 phy_vars_ue->dlsch_ue[0][1]->harq_processes[harq_pid]->errors[round],
+			 phy_vars_ue->dlsch_ue[0][1]->harq_processes[harq_pid]->trials[round]);
+	  len+=sprintf(&buffer[len],"\n");
+	}
       }
 
       len += sprintf(&buffer[len], "[UE PROC] DLSCH Total %d, Error %d, FER %d\n",phy_vars_ue->dlsch_received[0],phy_vars_ue->dlsch_errors[0],phy_vars_ue->dlsch_fer[0]);
@@ -565,7 +581,7 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
   // }
 
   for (eNB=0; eNB<number_of_cards_l; eNB++) {
-    len += sprintf(&buffer[len],"[eNB PROC] eNB %d/%d Frame %d: RX Gain %d dB, I0 %d dBm (%d,%d) dB \n",
+    len += sprintf(&buffer[len],"eNB %d/%d Frame %d: RX Gain %d dB, I0 %d dBm (%d,%d) dB \n",
                    eNB,number_of_cards_l,
                    phy_vars_eNB->proc[0].frame_tx,
                    phy_vars_eNB->rx_total_gain_eNB_dB,
@@ -573,14 +589,18 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
                    phy_vars_eNB->PHY_measurements_eNB[eNB].n0_power_dB[0],
                    phy_vars_eNB->PHY_measurements_eNB[eNB].n0_power_dB[1]);
 
-    len += sprintf(&buffer[len],"[eNB PROC] Subband I0: ");
-
-    for (i=0; i<25; i++)
-      len += sprintf(&buffer[len],"%2d ",
-                     phy_vars_eNB->PHY_measurements_eNB[eNB].n0_subband_power_tot_dB[i]);
+    len += sprintf(&buffer[len],"PRB I0 (%X.%X.%X.%X): ",
+		   phy_vars_eNB->rb_mask_ul[0],
+		   phy_vars_eNB->rb_mask_ul[1],phy_vars_eNB->rb_mask_ul[2],phy_vars_eNB->rb_mask_ul[3]);
 
+    for (i=0; i<phy_vars_eNB->lte_frame_parms.N_RB_UL; i++) {
+      len += sprintf(&buffer[len],"%4d ",
+                     phy_vars_eNB->PHY_measurements_eNB[eNB].n0_subband_power_tot_dBm[i]);
+      if ((i>0) && ((i%25) == 0)) 
+	len += sprintf(&buffer[len],"\n");
+    }
     len += sprintf(&buffer[len],"\n");
-    len += sprintf(&buffer[len],"\n[eNB PROC] PERFORMANCE PARAMETERS\n");
+    len += sprintf(&buffer[len],"\nPERFORMANCE PARAMETERS\n");
     /*
     len += sprintf(&buffer[len],"[eNB PROC] Total DLSCH Bitrate for the System %dkbps\n",((phy_vars_eNB->eNB_UE_stats[0].dlsch_bitrate + phy_vars_eNB->eNB_UE_stats[1].dlsch_bitrate)/1000));
     len += sprintf(&buffer[len],"[eNB PROC] Total Bits successfully transitted %dKbits in %dframe(s)\n",((phy_vars_eNB->eNB_UE_stats[0].total_transmitted_bits + phy_vars_eNB->eNB_UE_stats[1].total_transmitted_bits)/1000),phy_vars_eNB->frame+1);
@@ -588,119 +608,115 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
     */
 
     for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
-#ifdef OPENAIR2
+      if ((phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti>0)&&
+	  (phy_vars_eNB->eNB_UE_stats[UE_id].mode == PUSCH)) {	
 
-      if (phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti>0) {
         phy_vars_eNB->total_dlsch_bitrate = phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_bitrate + phy_vars_eNB->total_dlsch_bitrate;
         phy_vars_eNB->total_transmitted_bits = phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS + phy_vars_eNB->total_transmitted_bits;
 
         //phy_vars_eNB->total_system_throughput = phy_vars_eNB->eNB_UE_stats[UE_id].total_transmitted_bits + phy_vars_eNB->total_system_throughput;
-        if (phy_vars_eNB->eNB_UE_stats[UE_id].mode == PUSCH)
-          for (i=0; i<8; i++)
-            success = success + (phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[i][0] - phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_l2_errors[i]);
-      }
-
-#else
-      phy_vars_eNB->total_dlsch_bitrate = phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_bitrate + phy_vars_eNB->total_dlsch_bitrate;
-      phy_vars_eNB->total_transmitted_bits = phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS +  phy_vars_eNB->total_transmitted_bits;
-
-      //phy_vars_eNB->total_system_throughput = phy_vars_eNB->eNB_UE_stats[UE_id].total_transmitted_bits + phy_vars_eNB->total_system_throughput;
-      for (i=0; i<8; i++)
-        success = success + (phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[i][0] - phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_l2_errors[i]);
-
-#endif
-    }
-
-    len += sprintf(&buffer[len],"[eNB PROC] Total DLSCH bits successfully transmitted %d kbits in %d frame(s)\n",(phy_vars_eNB->total_transmitted_bits/1000),phy_vars_eNB->proc[0].frame_tx+1);
-    len += sprintf(&buffer[len],"[eNB PROC] Total DLSCH average system throughput %d kbps\n",(phy_vars_eNB->total_dlsch_bitrate/1000));
-    len += sprintf(&buffer[len],"[eNB PROC] Total DLSCH successful transmissions %d in %d frame(s)\n",success,phy_vars_eNB->proc[0].frame_tx+1);
-    //len += sprintf(&buffer[len],"[eNB PROC] FULL MU-MIMO Transmissions/Total Transmissions = %d/%d\n",phy_vars_eNB->FULL_MUMIMO_transmissions,phy_vars_eNB->check_for_total_transmissions);
-    //len += sprintf(&buffer[len],"[eNB PROC] MU-MIMO Transmissions/Total Transmissions = %d/%d\n",phy_vars_eNB->check_for_MUMIMO_transmissions,phy_vars_eNB->check_for_total_transmissions);
-    //len += sprintf(&buffer[len],"[eNB PROC] SU-MIMO Transmissions/Total Transmissions = %d/%d\n",phy_vars_eNB->check_for_SUMIMO_transmissions,phy_vars_eNB->check_for_total_transmissions);
-
-  }
-
-  len += sprintf(&buffer[len],"\n");
-
-  for (UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
-#ifdef OPENAIR2
-
-    if (phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti>0) {
-#endif
-      len += sprintf(&buffer[len],"[eNB PROC] UE %d (%x) Power: (%d,%d) dB, Po_PUSCH: (%d,%d) dBm, Po_PUCCH (%d/%d) dBm, Po_PUCCH1 (%d,%d) dBm,  PUCCH1 Thres %d dBm \n",
-                     UE_id,
-                     phy_vars_eNB->eNB_UE_stats[UE_id].crnti,
-                     dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[UE_id]->ulsch_power[0]),
-                     dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[UE_id]->ulsch_power[1]),
-                     phy_vars_eNB->eNB_UE_stats[UE_id].UL_rssi[0],
-                     phy_vars_eNB->eNB_UE_stats[UE_id].UL_rssi[1],
-		     dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH)-phy_vars_eNB->rx_total_gain_eNB_dB,
-		     phy_vars_eNB->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH,
-		     dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below)-phy_vars_eNB->rx_total_gain_eNB_dB,
-		     dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_above)-phy_vars_eNB->rx_total_gain_eNB_dB,
-		     PUCCH1_THRES+phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm, //-dB_fixed(phy_vars_eNB->lte_frame_parms.N_RB_UL),
-                     phy_vars_eNB->eNB_UE_stats[UE_id].sector);
-
-      for(i=0; i<8; i++)
-        len+= sprintf(&buffer[len],"   harq %d: DL mcs %d, UL mcs %d, UL rb %d, delta_TF %d\n",
-                      i,
-                      phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[i]->mcs,
-                      phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[i]->mcs,
-                      phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[i]->nb_rb,
-                      phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[i]->delta_TF);
-
-      len += sprintf(&buffer[len],"[eNB PROC] Wideband CQI: (%d,%d) dB\n",
-                     phy_vars_eNB->PHY_measurements_eNB[eNB].wideband_cqi_dB[UE_id][0],
-                     phy_vars_eNB->PHY_measurements_eNB[eNB].wideband_cqi_dB[UE_id][1]);
-
-      len += sprintf(&buffer[len],"[eNB PROC] Subband CQI:    ");
-
-      for (i=0; i<25; i++)
-        len += sprintf(&buffer[len],"%2d ",
-                       phy_vars_eNB->PHY_measurements_eNB[eNB].subband_cqi_tot_dB[UE_id][i]);
-
-      len += sprintf(&buffer[len],"\n");
-
-      len += sprintf(&buffer[len],"[eNB PROC] DL TM %d, DL_cqi %d, DL_pmi_single %jx\n",
-                     phy_vars_eNB->transmission_mode[UE_id],
-                     phy_vars_eNB->eNB_UE_stats[UE_id].DL_cqi[0],
-                     pmi2hex_2Ar1(phy_vars_eNB->eNB_UE_stats[UE_id].DL_pmi_single));
-
-      len += sprintf(&buffer[len],"[eNB PROC] DL Subband CQI: ");
-
-      for (i=0; i<13; i++)
-        len += sprintf(&buffer[len],"%2d ",
-                       phy_vars_eNB->eNB_UE_stats[UE_id].DL_subband_cqi[0][i]);
-
-      len += sprintf(&buffer[len],"\n");
-
-      len += sprintf(&buffer[len],"[eNB PROC] Timing advance %d samples (%d 16Ts), update %d\n",
-                     phy_vars_eNB->eNB_UE_stats[UE_id].UE_timing_offset,
-                     phy_vars_eNB->eNB_UE_stats[UE_id].UE_timing_offset>>2,
-                     phy_vars_eNB->eNB_UE_stats[UE_id].timing_advance_update);
-
-      len += sprintf(&buffer[len],"[eNB PROC] Mode = %s(%d)\n",
-                     mode_string[phy_vars_eNB->eNB_UE_stats[UE_id].mode],
-                     phy_vars_eNB->eNB_UE_stats[UE_id].mode);
-#ifdef OPENAIR2
-      UE_id_mac = find_UE_id(phy_vars_eNB->Mod_id,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti);
-
-      if (UE_id_mac != -1) {
-        RRC_status = mac_eNB_get_rrc_status(phy_vars_eNB->Mod_id,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti);
-        len += sprintf(&buffer[len],"[eNB PROC] UE_id_mac = %d, RRC status = %d\n",UE_id_mac,RRC_status);
-      } else
-        len += sprintf(&buffer[len],"[eNB PROC] UE_id_mac = -1\n");
-
-#endif
-
-#ifdef OPENAIR2
-
-      if (phy_vars_eNB->eNB_UE_stats[UE_id].mode == PUSCH) {
-#endif
-        len += sprintf(&buffer[len],"[eNB PROC] SR received/total: %d/%d (diff %d)\n",
+         
+	for (i=0; i<8; i++)
+	  success = success + (phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[i][0] - phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_l2_errors[i]);
+
+    
+	
+	len += sprintf(&buffer[len],"Total DLSCH %d kbits / %d frames ",(phy_vars_eNB->total_transmitted_bits/1000),phy_vars_eNB->proc[0].frame_tx+1);
+	len += sprintf(&buffer[len],"Total DLSCH throughput %d kbps ",(phy_vars_eNB->total_dlsch_bitrate/1000));
+	len += sprintf(&buffer[len],"Total DLSCH trans %d / %d frames\n",success,phy_vars_eNB->proc[0].frame_tx+1);
+	//len += sprintf(&buffer[len],"[eNB PROC] FULL MU-MIMO Transmissions/Total Transmissions = %d/%d\n",phy_vars_eNB->FULL_MUMIMO_transmissions,phy_vars_eNB->check_for_total_transmissions);
+	//len += sprintf(&buffer[len],"[eNB PROC] MU-MIMO Transmissions/Total Transmissions = %d/%d\n",phy_vars_eNB->check_for_MUMIMO_transmissions,phy_vars_eNB->check_for_total_transmissions);
+	//len += sprintf(&buffer[len],"[eNB PROC] SU-MIMO Transmissions/Total Transmissions = %d/%d\n",phy_vars_eNB->check_for_SUMIMO_transmissions,phy_vars_eNB->check_for_total_transmissions);
+	
+	len += sprintf(&buffer[len],"UE %d (%x) Power: (%d,%d) dB, Po_PUSCH: (%d,%d) dBm, Po_PUCCH (%d/%d) dBm, Po_PUCCH1 (%d,%d) dBm,  PUCCH1 Thres %d dBm \n",
+		       UE_id,
+		       phy_vars_eNB->eNB_UE_stats[UE_id].crnti,
+		       dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[UE_id]->ulsch_power[0]),
+		       dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[UE_id]->ulsch_power[1]),
+		       phy_vars_eNB->eNB_UE_stats[UE_id].UL_rssi[0],
+		       phy_vars_eNB->eNB_UE_stats[UE_id].UL_rssi[1],
+		       dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB,
+		       phy_vars_eNB->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH,
+		       dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB,
+		       dB_fixed(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_above/phy_vars_eNB->lte_frame_parms.N_RB_UL)-phy_vars_eNB->rx_total_gain_eNB_dB,
+		       PUCCH1_THRES+phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm-dB_fixed(phy_vars_eNB->lte_frame_parms.N_RB_UL));
+	
+	len+= sprintf(&buffer[len],"DL mcs %d, UL mcs %d, UL rb %d, delta_TF %d, ",
+		      phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[0]->mcs,
+		      phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[0]->mcs,
+		      phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[0]->nb_rb,
+		      phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[0]->delta_TF);
+	
+	len += sprintf(&buffer[len],"Wideband CQI: (%d,%d) dB\n",
+		       phy_vars_eNB->PHY_measurements_eNB[eNB].wideband_cqi_dB[UE_id][0],
+		       phy_vars_eNB->PHY_measurements_eNB[eNB].wideband_cqi_dB[UE_id][1]);
+	
+	/*	len += sprintf(&buffer[len],"[eNB PROC] Subband CQI:    ");
+	
+	for (i=0; i<phy_vars_eNB->lte_frame_parms.N_RB_DL; i++)
+	  len += sprintf(&buffer[len],"%2d ",
+			 phy_vars_eNB->PHY_measurements_eNB[eNB].subband_cqi_tot_dB[UE_id][i]);
+	
+	len += sprintf(&buffer[len],"\n");
+	*/
+
+	len += sprintf(&buffer[len],"DL TM %d, DL_cqi %d, DL_pmi_single %jx ",
+		       phy_vars_eNB->transmission_mode[UE_id],
+		       phy_vars_eNB->eNB_UE_stats[UE_id].DL_cqi[0],
+		       pmi2hex_2Ar1(phy_vars_eNB->eNB_UE_stats[UE_id].DL_pmi_single));
+
+	len += sprintf(&buffer[len],"Timing advance %d samples (%d 16Ts), update %d ",
+		       phy_vars_eNB->eNB_UE_stats[UE_id].UE_timing_offset,
+		       phy_vars_eNB->eNB_UE_stats[UE_id].UE_timing_offset>>2,
+		       phy_vars_eNB->eNB_UE_stats[UE_id].timing_advance_update);
+	
+	len += sprintf(&buffer[len],"Mode = %s(%d) ",
+		       mode_string[phy_vars_eNB->eNB_UE_stats[UE_id].mode],
+		       phy_vars_eNB->eNB_UE_stats[UE_id].mode);
+	UE_id_mac = find_UE_id(phy_vars_eNB->Mod_id,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti);
+	
+	if (UE_id_mac != -1) {
+	  RRC_status = mac_eNB_get_rrc_status(phy_vars_eNB->Mod_id,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti);
+	  len += sprintf(&buffer[len],"UE_id_mac = %d, RRC status = %d\n",UE_id_mac,RRC_status);
+	} else
+	  len += sprintf(&buffer[len],"UE_id_mac = -1\n");
+	
+        len += sprintf(&buffer[len],"SR received/total: %d/%d (diff %d)\n",
                        phy_vars_eNB->eNB_UE_stats[UE_id].sr_received,
                        phy_vars_eNB->eNB_UE_stats[UE_id].sr_total,
                        phy_vars_eNB->eNB_UE_stats[UE_id].sr_total-phy_vars_eNB->eNB_UE_stats[UE_id].sr_received);
+	
+	len += sprintf(&buffer[len],"DL Subband CQI: ");
+
+	int nb_sb;
+	switch (phy_vars_eNB->lte_frame_parms.N_RB_DL) {
+	case 6:
+	  nb_sb=0;
+	  break;
+	case 15:
+	  nb_sb = 4;
+	case 25:
+	  nb_sb = 7;
+	  break;
+	case 50:
+	  nb_sb = 9;
+	  break;
+	case 75:
+	  nb_sb = 10;
+	  break;
+	case 100:
+	  nb_sb = 13;
+	  break;
+	default:
+	  nb_sb=0;
+	  break;
+	}	
+	for (i=0; i<nb_sb; i++)
+	  len += sprintf(&buffer[len],"%2d ",
+			 phy_vars_eNB->eNB_UE_stats[UE_id].DL_subband_cqi[0][i]);
+	len += sprintf(&buffer[len],"\n");
+	
+
 
         ulsch_errors = 0;
 
@@ -709,10 +725,10 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
           ulsch_round_errors[j]=0;
         }
 
-        len += sprintf(&buffer[len],"[eNB PROC] ULSCH errors/attempts per harq (per round): \n");
+        len += sprintf(&buffer[len],"ULSCH errors/attempts per harq (per round): \n");
 
         for (i=0; i<8; i++) {
-          len += sprintf(&buffer[len],"   harq %d: %d/%d (fer %d) (%d/%d, %d/%d, %d/%d, %d/%d)\n",
+          len += sprintf(&buffer[len],"   harq %d: %d/%d (fer %d) (%d/%d, %d/%d, %d/%d, %d/%d) ",
                          i,
                          phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_errors[i],
                          phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[i][0],
@@ -725,6 +741,9 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
                          phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[i][2],
                          phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_errors[i][3],
                          phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_decoding_attempts[i][3]);
+	  if ((i&1) == 1)
+	    len += sprintf(&buffer[len],"\n");
+	    
           ulsch_errors+=phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_errors[i];
 
           for (j=0; j<4; j++) {
@@ -733,7 +752,7 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
           }
         }
 
-        len += sprintf(&buffer[len],"[eNB PROC] ULSCH errors/attempts total %d/%d (%d/%d, %d/%d, %d/%d, %d/%d): \n",
+        len += sprintf(&buffer[len],"ULSCH errors/attempts total %d/%d (%d/%d, %d/%d, %d/%d, %d/%d)\n",
                        ulsch_errors,ulsch_round_attempts[0],
 
                        ulsch_round_errors[0],ulsch_round_attempts[0],
@@ -748,10 +767,10 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
           dlsch_round_errors[j]=0;
         }
 
-        len += sprintf(&buffer[len],"[eNB PROC] DLSCH errors/attempts per harq (per round): \n");
+        len += sprintf(&buffer[len],"DLSCH errors/attempts per harq (per round): \n");
 
         for (i=0; i<8; i++) {
-          len += sprintf(&buffer[len],"   harq %d: %d/%d (%d/%d/%d, %d/%d/%d, %d/%d/%d, %d/%d/%d)\n",
+          len += sprintf(&buffer[len],"   harq %d: %d/%d (%d/%d/%d, %d/%d/%d, %d/%d/%d, %d/%d/%d) ",
                          i,
                          phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_l2_errors[i],
                          phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[i][0],
@@ -767,6 +786,10 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
                          phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_ACK[i][3],
                          phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_NAK[i][3],
                          phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_trials[i][3]);
+	  if ((i&1) == 1)
+	    len += sprintf(&buffer[len],"\n");
+
+
           dlsch_errors+=phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_l2_errors[i];
 
           for (j=0; j<4; j++) {
@@ -775,7 +798,7 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
           }
         }
 
-        len += sprintf(&buffer[len],"[eNB PROC] DLSCH errors/attempts total %d/%d (%d/%d, %d/%d, %d/%d, %d/%d): \n",
+        len += sprintf(&buffer[len],"DLSCH errors/attempts total %d/%d (%d/%d, %d/%d, %d/%d, %d/%d): \n",
                        dlsch_errors,dlsch_round_attempts[0],
                        dlsch_round_errors[0],dlsch_round_attempts[0],
                        dlsch_round_errors[1],dlsch_round_attempts[1],
@@ -783,11 +806,11 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
                        dlsch_round_errors[3],dlsch_round_attempts[3]);
 
 
-        len += sprintf(&buffer[len],"[eNB PROC] DLSCH total bits from MAC: %dkbit\n",(phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS_MAC)/1000);
-        len += sprintf(&buffer[len],"[eNB PROC] DLSCH total bits ack'ed: %dkbit\n",(phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS)/1000);
-        len += sprintf(&buffer[len],"[eNB PROC] DLSCH Average throughput (100 frames): %dkbps\n",(phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_bitrate/1000));
-        len += sprintf(&buffer[len],"[eNB PROC] Transmission Mode %d\n",phy_vars_eNB->transmission_mode[UE_id]);
-
+        len += sprintf(&buffer[len],"DLSCH total bits from MAC: %dkbit ",(phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS_MAC)/1000);
+        len += sprintf(&buffer[len],"DLSCH total bits ack'ed: %dkbit ",(phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS)/1000);
+        len += sprintf(&buffer[len],"DLSCH Average throughput (100 frames): %dkbps\n",(phy_vars_eNB->eNB_UE_stats[UE_id].dlsch_bitrate/1000));
+	//        len += sprintf(&buffer[len],"[eNB PROC] Transmission Mode %d\n",phy_vars_eNB->transmission_mode[UE_id]);
+	/*
         if(phy_vars_eNB->transmission_mode[UE_id] == 5) {
           if(phy_vars_eNB->mu_mimo_mode[UE_id].dl_pow_off == 0)
             len += sprintf(&buffer[len],"[eNB PROC] ****UE %d is in MU-MIMO mode****\n",UE_id);
@@ -796,7 +819,8 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
           else
             len += sprintf(&buffer[len],"[eNB PROC] ****UE %d is not scheduled****\n",UE_id);
         }
-
+	*/
+	/*
         len += sprintf(&buffer[len],"[eNB PROC] RB Allocation on Sub-bands: ");
 
         //  for (j=0;j< mac_xface->lte_frame_parms->N_RBGS;j++)
@@ -806,16 +830,14 @@ int dump_eNB_stats(PHY_VARS_eNB *phy_vars_eNB, char* buffer, int length)
 
         len += sprintf(&buffer[len],"\n");
         len += sprintf(&buffer[len],"[eNB PROC] Total Number of Allocated PRBs = %d\n",phy_vars_eNB->mu_mimo_mode[UE_id].pre_nb_available_rbs);
-
-#ifdef OPENAIR2
+	*/
       }
     }
 
-#endif
     len += sprintf(&buffer[len],"\n");
   }
-
+  
   len += sprintf(&buffer[len],"EOF\n");
-
+  
   return len;
 }
diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h
index b56d9b0e8cbd1cf6a817e5e10e216efbde444656..806201f63470e6bed5ed34547cb67e4fe1deb768 100644
--- a/openair1/PHY/LTE_TRANSPORT/proto.h
+++ b/openair1/PHY/LTE_TRANSPORT/proto.h
@@ -54,17 +54,18 @@
 */
 void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch);
 
-void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch, uint8_t abstraction_flag);
+void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch);
 
-/** \fn new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t abstraction_flag)
+/** \fn new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t abstraction_flag)
     \brief This function allocates structures for a particular DLSCH at eNB
     @returns Pointer to DLSCH to be removed
     @param Kmimo Kmimo factor from 36-212/36-213
     @param Mdlharq Maximum number of HARQ rounds (36-212/36-213)
+    @param Nsoft Soft-LLR buffer size from UE-Category
     @params N_RB_DL total number of resource blocks (determine the operating BW)
     @param abstraction_flag Flag to indicate abstracted interface
 */
-LTE_eNB_DLSCH_t *new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t N_RB_DL, uint8_t abstraction_flag);
+LTE_eNB_DLSCH_t *new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t N_RB_DL, uint8_t abstraction_flag);
 
 /** \fn free_ue_dlsch(LTE_UE_DLSCH_t *dlsch)
     \brief This function frees memory allocated for a particular DLSCH at UE
@@ -72,20 +73,25 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t N_RB_DL, ui
 */
 void free_ue_dlsch(LTE_UE_DLSCH_t *dlsch);
 
-LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t Mdlharq,uint8_t max_turbo_iterations,uint8_t N_RB_UL, uint8_t abstraction_flag);
-
-LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint8_t max_turbo_iterations,uint8_t N_RB_DL, uint8_t abstraction_flag);
-
-LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char Mdlharq,unsigned char N_RB_UL, uint8_t abstraction_flag);
+/** \fn new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t abstraction_flag)
+    \brief This function allocates structures for a particular DLSCH at eNB
+    @returns Pointer to DLSCH to be removed
+    @param Kmimo Kmimo factor from 36-212/36-213
+    @param Mdlharq Maximum number of HARQ rounds (36-212/36-213)
+    @param Nsoft Soft-LLR buffer size from UE-Category
+    @params N_RB_DL total number of resource blocks (determine the operating BW)
+    @param abstraction_flag Flag to indicate abstracted interface
+*/
+LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_turbo_iterations,uint8_t N_RB_DL, uint8_t abstraction_flag);
 
 
-void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch, uint8_t abstraction_flag);
+void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch);
 
 void free_ue_ulsch(LTE_UE_ULSCH_t *ulsch);
 
-LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t Mdlharq,uint8_t max_turbo_iterations,uint8_t N_RB_UL, uint8_t abstraction_flag);
+LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t max_turbo_iterations,uint8_t N_RB_UL, uint8_t abstraction_flag);
 
-LTE_UE_ULSCH_t *new_ue_ulsch(uint8_t Mdlharq, unsigned char N_RB_UL, uint8_t abstraction_flag);
+LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag);
 
 /** \fn dlsch_encoding(uint8_t *input_buffer,
     LTE_DL_FRAME_PARMS *frame_parms,
@@ -127,7 +133,7 @@ void dlsch_encoding_emul(PHY_VARS_eNB *phy_vars_eNB,
 
 // Functions below implement 36-211
 
-/** \fn allocate_REs_in_RB(mod_sym_t **txdataF,
+/** \fn allocate_REs_in_RB(int32_t **txdataF,
     uint32_t *jj,
     uint32_t *jj2,
     uint16_t re_offset,
@@ -163,7 +169,7 @@ void dlsch_encoding_emul(PHY_VARS_eNB *phy_vars_eNB,
 */
 
 int32_t allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
-                           mod_sym_t **txdataF,
+                           int32_t **txdataF,
                            uint32_t *jj,
                            uint32_t *jj2,
                            uint16_t re_offset,
@@ -180,7 +186,7 @@ int32_t allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
                            uint8_t skip_half);
 
 
-/** \fn int32_t dlsch_modulation(mod_sym_t **txdataF,
+/** \fn int32_t dlsch_modulation(int32_t **txdataF,
     int16_t amp,
     uint32_t sub_frame_offset,
     LTE_DL_FRAME_PARMS *frame_parms,
@@ -197,7 +203,7 @@ int32_t allocate_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
     @param dlsch1 Pointer to Transport Block 0 DLSCH descriptor for this allocation
 
 */
-int32_t dlsch_modulation(mod_sym_t **txdataF,
+int32_t dlsch_modulation(int32_t **txdataF,
                          int16_t amp,
                          uint32_t sub_frame_offset,
                          LTE_DL_FRAME_PARMS *frame_parms,
@@ -212,7 +218,7 @@ int32_t dlsch_modulation(mod_sym_t **txdataF,
   @param frame_parms Pointer to frame descriptor
   @param dlsch Pointer to DLSCH descriptor for this allocation
 */
-int mch_modulation(mod_sym_t **txdataF,
+int mch_modulation(int32_t **txdataF,
                    int16_t amp,
                    uint32_t subframe_offset,
                    LTE_DL_FRAME_PARMS *frame_parms,
@@ -273,7 +279,7 @@ void dump_mch(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint16_t coded_bits_per_co
     @param N Number of sub-frames to generate
 */
 void generate_pilots(PHY_VARS_eNB *phy_vars_eNB,
-                     mod_sym_t **txdataF,
+                     int32_t **txdataF,
                      int16_t amp,
                      uint16_t N);
 
@@ -286,17 +292,17 @@ void generate_pilots(PHY_VARS_eNB *phy_vars_eNB,
    @param first_pilot_only (0 no)
 */
 int32_t generate_pilots_slot(PHY_VARS_eNB *phy_vars_eNB,
-                             mod_sym_t **txdataF,
+                             int32_t **txdataF,
                              int16_t amp,
                              uint16_t slot,
                              int first_pilot_only);
 
 int32_t generate_mbsfn_pilot(PHY_VARS_eNB *phy_vars_eNB,
-                             mod_sym_t **txdataF,
+                             int32_t **txdataF,
                              int16_t amp,
                              uint16_t subframe);
 
-int32_t generate_pss(mod_sym_t **txdataF,
+int32_t generate_pss(int32_t **txdataF,
                      int16_t amp,
                      LTE_DL_FRAME_PARMS *frame_parms,
                      uint16_t l,
@@ -304,14 +310,14 @@ int32_t generate_pss(mod_sym_t **txdataF,
 
 int32_t generate_pss_emul(PHY_VARS_eNB *phy_vars_eNB,uint8_t sect_id);
 
-int32_t generate_sss(mod_sym_t **txdataF,
+int32_t generate_sss(int32_t **txdataF,
                      short amp,
                      LTE_DL_FRAME_PARMS *frame_parms,
                      unsigned short symbol,
                      unsigned short slot_offset);
 
 int32_t generate_pbch(LTE_eNB_PBCH *eNB_pbch,
-                      mod_sym_t **txdataF,
+                      int32_t **txdataF,
                       int32_t amp,
                       LTE_DL_FRAME_PARMS *frame_parms,
                       uint8_t *pbch_pdu,
@@ -1142,7 +1148,7 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
                          uint32_t n_rnti,
                          int16_t amp,
                          LTE_DL_FRAME_PARMS *frame_parms,
-                         mod_sym_t **txdataF,
+                         int32_t **txdataF,
                          uint32_t sub_frame_offset);
 
 uint8_t generate_dci_top_emul(PHY_VARS_eNB *phy_vars_eNB,
@@ -1233,11 +1239,20 @@ uint32_t get_TBS_DL(uint8_t mcs, uint16_t nb_rb);
 uint32_t get_TBS_UL(uint8_t mcs, uint16_t nb_rb);
 
 /* \brief Return bit-map of resource allocation for a given DCI rballoc (RIV format) and vrb type
+   @param N_RB_DL number of PRB on DL
+   @param indicator for even/odd slot
+   @param vrb vrb index
+   @param Ngap Gap indicator
+*/
+uint32_t get_prb(int N_RB_DL,int odd_slot,int vrb,int Ngap);
+
+/* \brief Return prb for a given vrb index 
    @param vrb_type VRB type (0=localized,1=distributed)
    @param rb_alloc_dci rballoc field from DCI
 */
 uint32_t get_rballoc(vrb_t vrb_type,uint16_t rb_alloc_dci);
 
+
 /* \brief Return bit-map of resource allocation for a given DCI rballoc (RIV format) and vrb type
    @returns Transmission mode (1-7)
 */
@@ -1326,7 +1341,7 @@ void init_ul_hopping(LTE_DL_FRAME_PARMS *frame_parms);
 int32_t compareints (const void * a, const void * b);
 
 
-void ulsch_modulation(mod_sym_t **txdataF,
+void ulsch_modulation(int32_t **txdataF,
                       int16_t amp,
                       frame_t frame,
                       uint32_t subframe,
@@ -1435,7 +1450,7 @@ void pcfich_unscrambling(LTE_DL_FRAME_PARMS *frame_parms,
 void generate_pcfich(uint8_t num_pdcch_symbols,
                      int16_t amp,
                      LTE_DL_FRAME_PARMS *frame_parms,
-                     mod_sym_t **txdataF,
+                     int32_t **txdataF,
                      uint8_t subframe);
 
 uint8_t rx_pcfich(LTE_DL_FRAME_PARMS *frame_parms,
@@ -1577,6 +1592,12 @@ uint16_t computeRIV(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs);
 
 uint32_t pmi_extend(LTE_DL_FRAME_PARMS *frame_parms,uint8_t wideband_pmi);
 
+int get_nCCE_offset_l1(int *CCE_table,
+		       const unsigned char L, 
+		       const int nCCE, 
+		       const int common_dci, 
+		       const unsigned short rnti, 
+		       const unsigned char subframe);
 
 uint16_t get_nCCE(uint8_t num_pdcch_symbols,LTE_DL_FRAME_PARMS *frame_parms,uint8_t mi);
 
@@ -1584,11 +1605,11 @@ uint16_t get_nquad(uint8_t num_pdcch_symbols,LTE_DL_FRAME_PARMS *frame_parms,uin
 
 uint8_t get_mi(LTE_DL_FRAME_PARMS *frame,uint8_t subframe);
 
-uint16_t get_nCCE_max(uint8_t Mod_id,uint8_t CC_id);
+uint16_t get_nCCE_mac(uint8_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int subframe);
 
 uint8_t get_num_pdcch_symbols(uint8_t num_dci,DCI_ALLOC_t *dci_alloc,LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
 
-void pdcch_interleaving(LTE_DL_FRAME_PARMS *frame_parms,mod_sym_t **z, mod_sym_t **wbar,uint8_t n_symbols_pdcch,uint8_t mi);
+void pdcch_interleaving(LTE_DL_FRAME_PARMS *frame_parms,int32_t **z, int32_t **wbar,uint8_t n_symbols_pdcch,uint8_t mi);
 
 void pdcch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms,
                         uint8_t subframe,
@@ -1617,7 +1638,7 @@ void dlsch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms,
 
 void init_ncs_cell(LTE_DL_FRAME_PARMS *frame_parms,uint8_t ncs_cell[20][7]);
 
-void generate_pucch(mod_sym_t **txdataF,
+void generate_pucch(int32_t **txdataF,
                     LTE_DL_FRAME_PARMS *frame_parms,
                     uint8_t ncs_cell[20][7],
                     PUCCH_FMT_t fmt,
@@ -1637,22 +1658,23 @@ void generate_pucch_emul(PHY_VARS_UE *phy_vars_ue,
                          uint8_t subframe);
 
 
-int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
-                 PUCCH_FMT_t fmt,
-                 uint8_t UE_id,
-                 uint16_t n1_pucch,
-                 uint16_t n2_pucch,
-                 uint8_t shortened_format,
-                 uint8_t *payload,
-                 uint8_t subframe,
-                 uint8_t pucch1_thres);
+uint32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
+		  PUCCH_FMT_t fmt,
+		  uint8_t UE_id,
+		  uint16_t n1_pucch,
+		  uint16_t n2_pucch,
+		  uint8_t shortened_format,
+		  uint8_t *payload,
+		  int     frame,
+		  uint8_t subframe,
+		  uint8_t pucch1_thres);
 
 int32_t rx_pucch_emul(PHY_VARS_eNB *phy_vars_eNB,
-                      uint8_t UE_index,
-                      PUCCH_FMT_t fmt,
-                      uint8_t n1_pucch_sel,
-                      uint8_t *payload,
-                      uint8_t subframe);
+		       uint8_t UE_index,
+		       PUCCH_FMT_t fmt,
+		       uint8_t n1_pucch_sel,
+		       uint8_t *payload,
+		       uint8_t subframe);
 
 
 /*!
diff --git a/openair1/PHY/LTE_TRANSPORT/pss.c b/openair1/PHY/LTE_TRANSPORT/pss.c
index cb954dedb4d57de40f0a9d30bc2c163cb6df13e5..e2a4c549da2ee939a01428c09fe6fe4ade6b6d7c 100644
--- a/openair1/PHY/LTE_TRANSPORT/pss.c
+++ b/openair1/PHY/LTE_TRANSPORT/pss.c
@@ -47,7 +47,7 @@
 #include "PHY/defs.h"
 #include "PHY/extern.h"
 
-int generate_pss(mod_sym_t **txdataF,
+int generate_pss(int32_t **txdataF,
                  short amp,
                  LTE_DL_FRAME_PARMS *frame_parms,
                  unsigned short symbol,
diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c
index 47a15dda45c3fe2be1005d67e190991e2ee06437..356ae89d42257073f902feae38ebb778a8bdc4f4 100644
--- a/openair1/PHY/LTE_TRANSPORT/pucch.c
+++ b/openair1/PHY/LTE_TRANSPORT/pucch.c
@@ -41,6 +41,11 @@
 #include "PHY/extern.h"
 #include "LAYER2/MAC/extern.h"
 
+#include "UTIL/LOG/log.h"
+#include "UTIL/LOG/vcd_signal_dumper.h"
+
+#include "T.h"
+
 //uint8_t ncs_cell[20][7];
 //#define DEBUG_PUCCH_TX
 //#define DEBUG_PUCCH_RX
@@ -118,7 +123,7 @@ int16_t W3_im[3][6] = {{0    ,0     ,0     },
 
 char pucch_format_string[6][20] = {"format 1\0","format 1a\0","format 1b\0","format 2\0","format 2a\0","format 2b\0"};
 
-void generate_pucch(mod_sym_t **txdataF,
+void generate_pucch(int32_t **txdataF,
                     LTE_DL_FRAME_PARMS *frame_parms,
                     uint8_t ncs_cell[20][7],
                     PUCCH_FMT_t fmt,
@@ -142,7 +147,7 @@ void generate_pucch(mod_sym_t **txdataF,
   uint8_t m,l,refs;
   uint8_t n_cs,S,alpha_ind,rem;
   int16_t tmp_re,tmp_im,ref_re,ref_im,W_re=0,W_im=0;
-  mod_sym_t *txptr;
+  int32_t *txptr;
   uint32_t symbol_offset;
 
   uint8_t deltaPUCCH_Shift          = frame_parms->pucch_config_common.deltaPUCCH_Shift;
@@ -430,15 +435,16 @@ void generate_pucch_emul(PHY_VARS_UE *phy_vars_ue,
 
 }
 
-int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
-                 PUCCH_FMT_t fmt,
-                 uint8_t UE_id,
-                 uint16_t n1_pucch,
-                 uint16_t n2_pucch,
-                 uint8_t shortened_format,
-                 uint8_t *payload,
-                 uint8_t subframe,
-                 uint8_t pucch1_thres)
+uint32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
+		  PUCCH_FMT_t fmt,
+		  uint8_t UE_id,
+		  uint16_t n1_pucch,
+		  uint16_t n2_pucch,
+		  uint8_t shortened_format,
+		  uint8_t *payload,
+		  int     frame,
+		  uint8_t subframe,
+		  uint8_t pucch1_thres)
 {
 
 
@@ -446,11 +452,11 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
   LTE_eNB_COMMON *eNB_common_vars                = &phy_vars_eNB->lte_eNB_common_vars;
   LTE_DL_FRAME_PARMS *frame_parms                    = &phy_vars_eNB->lte_frame_parms;
   //  PUCCH_CONFIG_DEDICATED *pucch_config_dedicated = &phy_vars_eNB->pucch_config_dedicated[UE_id];
-  int8_t sigma2_dB                                   = phy_vars_eNB->PHY_measurements_eNB[0].n0_power_dB[0];
-  int32_t *Po_PUCCH                                  = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH);
+  int8_t sigma2_dB                                   = phy_vars_eNB->PHY_measurements_eNB[0].n0_subband_power_tot_dB[0]-10;
+  uint32_t *Po_PUCCH                                  = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH);
   int32_t *Po_PUCCH_dBm                              = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH_dBm);
-  int32_t *Po_PUCCH1_below                           = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below);
-  int32_t *Po_PUCCH1_above                           = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_above);
+  uint32_t *Po_PUCCH1_below                           = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_below);
+  uint32_t *Po_PUCCH1_above                           = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH1_above);
   int32_t *Po_PUCCH_update                           = &(phy_vars_eNB->eNB_UE_stats[UE_id].Po_PUCCH_update);
   uint32_t u,v,n,aa;
   uint32_t z[12*14];
@@ -468,7 +474,7 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
   uint32_t symbol_offset;
   int16_t stat_ref_re,stat_ref_im,*cfo,chest_re,chest_im;
   int32_t stat_re=0,stat_im=0;
-  int32_t stat,stat_max=0;
+  uint32_t stat,stat_max=0;
 
   uint8_t deltaPUCCH_Shift          = frame_parms->pucch_config_common.deltaPUCCH_Shift;
   uint8_t NRB2                      = frame_parms->pucch_config_common.nRB_CQI;
@@ -478,6 +484,7 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
   uint32_t u1 = (frame_parms->Nid_cell + frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[1+(subframe<<1)]) % 30;
   uint32_t v0=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[subframe<<1];
   uint32_t v1=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[1+(subframe<<1)];
+  int chL;
 
   if (first_call == 1) {
     for (i=0;i<10;i++) {
@@ -508,6 +515,7 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
   }
   */  
 
+    
   if ((deltaPUCCH_Shift==0) || (deltaPUCCH_Shift>3)) {
     LOG_E(PHY,"[eNB] rx_pucch: Illegal deltaPUCCH_shift %d (should be 1,2,3)\n",deltaPUCCH_Shift);
     return(-1);
@@ -737,30 +745,35 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
           cfo =  (frame_parms->Ncp==0) ? &cfo_pucch_np[14*phase] : &cfo_pucch_ep[12*phase];
 
           for (l=0; l<(nsymb>>1); l++) {
-            stat_re += ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15)     - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
-            stat_im += ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
+            stat_re += (((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15)     - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15))/nsymb;
+            stat_im += (((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15))/nsymb;
             off+=2;
+
+		    
 #ifdef DEBUG_PUCCH_RX
-            LOG_D(PHY,"[eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d)\n",subframe,l,re,
+            LOG_D(PHY,"[eNB] PUCCH subframe %d (%d,%d,%d) => (%d,%d) x (%d,%d) : (%d,%d) , stat %d\n",subframe,phase,l,re,
                   rxcomp[aa][off],rxcomp[aa][1+off],
                   cfo[l<<1],cfo[1+(l<<1)],
-                  stat_re,stat_im);
+                  stat_re,stat_im,stat);
 #endif
           }
 
           for (l2=0,l=(nsymb>>1); l<(nsymb-1); l++,l2++) {
-            stat_re += ((rxcomp[aa][off]*(int32_t)cfo[l2<<1])>>15)     - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l2<<1)])>>15);
-            stat_im += ((rxcomp[aa][off]*(int32_t)cfo[1+(l2<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l2<<1)])>>15);
+            stat_re += (((rxcomp[aa][off]*(int32_t)cfo[l2<<1])>>15)     - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l2<<1)])>>15))/nsymb;
+            stat_im += (((rxcomp[aa][off]*(int32_t)cfo[1+(l2<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l2<<1)])>>15))/nsymb;
             off+=2;
+
 #ifdef DEBUG_PUCCH_RX
-            LOG_D(PHY,"[eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d)\n",subframe,l2,re,
+            LOG_D(PHY,"[eNB] PUCCH subframe %d (%d,%d,%d) => (%d,%d) x (%d,%d) : (%d,%d), stat %d\n",subframe,phase,l2,re,
                   rxcomp[aa][off],rxcomp[aa][1+off],
                   cfo[l2<<1],cfo[1+(l2<<1)],
-                  stat_re,stat_im);
+                  stat_re,stat_im,stat);
 #endif
 
+
           }
-	  stat += (stat_re*stat_re) + (stat_im*stat_im);
+	  stat += ((stat_re*stat_re) + (stat_im*stat_im));
+
        } //re
       } // aa
 
@@ -772,18 +785,23 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
 
     } //phase
 
-    stat_max /= (nsymb*12); // normalize to energy per symbol and RE
+    stat_max *= nsymb;  // normalize to energy per symbol
+    stat_max /= (frame_parms->N_RB_UL*12); // 
 #ifdef DEBUG_PUCCH_RX
     LOG_D(PHY,"[eNB] PUCCH: stat %d, stat_max %d, phase_max %d\n", stat,stat_max,phase_max);
 #endif
 
 #ifdef DEBUG_PUCCH_RX
-    LOG_D(PHY,"[eNB] PUCCH fmt0:  stat_max : %d, sigma2_dB %d (%d, %d), phase_max : %d\n",dB_fixed(stat_max),sigma2_dB,phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm,pucch1_thres,phase_max);
+    LOG_I(PHY,"[eNB] PUCCH fmt1:  stat_max : %d, sigma2_dB %d (%d, %d), phase_max : %d\n",dB_fixed(stat_max),sigma2_dB,phy_vars_eNB->PHY_measurements_eNB[0].n0_subband_power_tot_dBm[6],pucch1_thres,phase_max);
 #endif
 
     phy_vars_eNB->pucch1_stats[UE_id][(subframe<<10)+phy_vars_eNB->pucch1_stats_cnt[UE_id][subframe]] = stat_max;
+    phy_vars_eNB->pucch1_stats_thres[UE_id][(subframe<<10)+phy_vars_eNB->pucch1_stats_cnt[UE_id][subframe]] = sigma2_dB+pucch1_thres;
     phy_vars_eNB->pucch1_stats_cnt[UE_id][subframe] = (phy_vars_eNB->pucch1_stats_cnt[UE_id][subframe]+1)&1023;
 
+    T(T_ENB_PHY_PUCCH_1_ENERGY, T_INT(phy_vars_eNB->Mod_id), T_INT(UE_id), T_INT(frame), T_INT(subframe),
+      T_INT(stat_max), T_INT(sigma2_dB+pucch1_thres));
+
     /*
     if (phy_vars_eNB->pucch1_stats_cnt[UE_id][subframe] == 0) {
       write_output("pucch_debug.m","pucch_energy",
@@ -798,27 +816,29 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
     if (sigma2_dB<(dB_fixed(stat_max)-pucch1_thres))  {
       *payload = 1;
       *Po_PUCCH1_above = ((*Po_PUCCH1_above<<9) + (stat_max<<9)+1024)>>10;
-
+      //LOG_I(PHY,"[eNB] PUCCH fmt1:  stat_max : %d, sigma2_dB %d (%d, %d), phase_max : %d\n",dB_fixed(stat_max),sigma2_dB,phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm,pucch1_thres,phase_max);
     }
     else {
       *payload = 0;
       *Po_PUCCH1_below = ((*Po_PUCCH1_below<<9) + (stat_max<<9)+1024)>>10;
     }
-    LOG_D(PHY,"[eNB] PUCCH fmt0:  stat_max : %d, sigma2_dB %d (I0 %d dBm, thres %d), Po_PUCCH1_below/above : %d / %d\n",dB_fixed(stat_max),sigma2_dB,phy_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dBm,pucch1_thres,dB_fixed(*Po_PUCCH1_below),dB_fixed(*Po_PUCCH1_above));
+    LOG_D(PHY,"[eNB] PUCCH fmt1:  stat_max : %d, sigma2_dB %d (I0 %d dBm, thres %d), Po_PUCCH1_below/above : %d / %d\n",dB_fixed(stat_max),sigma2_dB,phy_vars_eNB->PHY_measurements_eNB[0].n0_subband_power_tot_dBm[6],pucch1_thres,dB_fixed(*Po_PUCCH1_below),dB_fixed(*Po_PUCCH1_above));
     *Po_PUCCH_update = 1;
-
+    if (UE_id==0) {
+      VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SR_ENERGY,dB_fixed(stat_max));
+      VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SR_THRES,sigma2_dB+pucch1_thres);
+    }
   } else if ((fmt == pucch_format1a)||
-	     (fmt == pucch_format1b)||
-	     (fmt == pucch_format1b_cs2)||
-	     (fmt == pucch_format1b_cs3)||
-	     (fmt == pucch_format1b_cs4))
-    {
+             (fmt == pucch_format1b)||
+             (fmt == pucch_format1b_cs2)||
+             (fmt == pucch_format1b_cs3)||
+             (fmt == pucch_format1b_cs4)) {
     stat_max = 0;
 #ifdef DEBUG_PUCCH_RX
     LOG_I(PHY,"Doing PUCCH detection for format 1a/1b\n");
 #endif
 
-    for (phase=0; phase<7; phase++) {
+    for (phase=3;phase<4;phase++){ //phase=0; phase<7; phase++) {
       stat=0;
 
       for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
@@ -849,6 +869,9 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
 #endif
           }
 
+
+
+
           for (l2=0,l=(nsymb>>1); l<(nsymb-1); l++,l2++) {
             if ((l2<2) || ((l2>(nsymb>>1) - 3)) ) {  // data symbols
               stat_re += ((rxcomp[aa][off]*(int32_t)cfo[l2<<1])>>15)     - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l2<<1)])>>15);
@@ -868,34 +891,36 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
 
           }
 
-          stat += (((stat_re*stat_re)) + ((stat_im*stat_im)) +
-                   ((stat_ref_re*stat_ref_re)) + ((stat_ref_im*stat_ref_im)));
 #ifdef DEBUG_PUCCH_RX
           LOG_D(PHY,"aa%d re %d : phase %d : stat %d\n",aa,re,phase,stat);
 #endif
+
+	  stat += ((((stat_re*stat_re)) + ((stat_im*stat_im)) +
+		    ((stat_ref_re*stat_ref_re)) + ((stat_ref_im*stat_ref_im)))/nsymb);
+
+
         } //re
       } // aa
 
 #ifdef DEBUG_PUCCH_RX
-      LOG_I(PHY,"phase %d : stat %d\n",phase,stat);
+      LOG_I(PHY,"Format 1A: phase %d : stat %d\n",phase,stat);
 #endif
-
       if (stat>stat_max) {
         stat_max = stat;
         phase_max = phase;
       }
     } //phase
 
-    stat_max/=(nsymb*12);  //normalize to energy per symbol and RE
-#ifdef DEBUG_PUCCH_RX
-    LOG_I(PHY,"[eNB] PUCCH fmt1:  stat_max : %d, phase_max : %d\n",stat_max,phase_max);
-#endif
+    stat_max/=(12);  //normalize to energy per symbol and RE
+    //#ifdef DEBUG_PUCCH_RX
+    LOG_D(PHY,"[eNB] PUCCH fmt1a/b:  stat_max : %d, phase_max : %d\n",stat_max,phase_max);
+    //#endif
 
     stat_re=0;
     stat_im=0;
     LOG_D(PHY,"PUCCH1A : Po_PUCCH before %d dB (%d)\n",dB_fixed(*Po_PUCCH),*Po_PUCCH);
-    *Po_PUCCH = ((*Po_PUCCH<<9) + (stat_max<<9)+1024)>>10;
-    *Po_PUCCH_dBm = dB_fixed(*Po_PUCCH) - phy_vars_eNB->rx_total_gain_eNB_dB;
+    *Po_PUCCH = ((*Po_PUCCH>>1) + ((stat_max)>>1));
+    *Po_PUCCH_dBm = dB_fixed(*Po_PUCCH/frame_parms->N_RB_UL) - phy_vars_eNB->rx_total_gain_eNB_dB;
     *Po_PUCCH_update = 1;
  
     LOG_D(PHY,"PUCCH1A : stat_max %d (%d,%d,%d) => Po_PUCCH %d\n",
@@ -911,6 +936,8 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
 
       *Po_PUCCH = ((*Po_PUCCH*1023) + stat_max)>>10;
 
+      chL = (nsymb>>1)-4;
+
       for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
         for (re=0; re<12; re++) {
           chest_re=0;
@@ -920,8 +947,8 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
           // channel estimate for first slot
           for (l=2; l<(nsymb>>1)-2; l++) {
             off=(re<<1) + (24*l);
-            chest_re += ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15)     - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
-            chest_im += ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
+            chest_re += (((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15)     - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15))/chL;
+	    chest_im += (((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15))/chL;
           }
 
 #ifdef DEBUG_PUCCH_RX
@@ -933,8 +960,8 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
             off=(re<<1) + (24*l);
             tmp_re = ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15)     - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
             tmp_im = ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
-            stat_re += ((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15);
-            stat_im += ((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15);
+            stat_re += (((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15))/4;
+            stat_im += (((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15))/4;
             off+=2;
 #ifdef DEBUG_PUCCH_RX
             LOG_D(PHY,"[eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d)\n",subframe,l,re,
@@ -948,8 +975,8 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
             off=(re<<1) + (24*l);
             tmp_re = ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15)     - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
             tmp_im = ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
-            stat_re += ((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15);
-            stat_im += ((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15);
+            stat_re += (((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15)/4);
+            stat_im += (((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15)/4);
             off+=2;
 #ifdef DEBUG_PUCCH_RX
             LOG_D(PHY,"[eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d)\n",subframe,l,re,
@@ -965,8 +992,8 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
           // channel estimate for second slot
           for (l=2; l<(nsymb>>1)-2; l++) {
             off=(re<<1) + (24*l) + (nsymb>>1)*24;
-            chest_re += ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15)     - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
-            chest_im += ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
+            chest_re += (((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15)     - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15))/chL;
+	    chest_im += (((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15))/chL;
           }
 
 #ifdef DEBUG_PUCCH_RX
@@ -978,8 +1005,8 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
             off=(re<<1) + (24*l) + (nsymb>>1)*24;
             tmp_re = ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15)     - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
             tmp_im = ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
-            stat_re += ((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15);
-            stat_im += ((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15);
+            stat_re += (((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15))/4;
+            stat_im += (((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15))/4;
             off+=2;
 #ifdef DEBUG_PUCCH_RX
             LOG_D(PHY,"[PHY][eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d)\n",subframe,l,re,
@@ -993,8 +1020,8 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
             off=(re<<1) + (24*l) + (nsymb>>1)*24;
             tmp_re = ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15)     - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
             tmp_im = ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
-            stat_re += ((tmp_re*chest_re)>>9) + ((tmp_im*chest_im)>>9);
-            stat_im += ((tmp_re*chest_im)>>9) - ((tmp_im*chest_re)>>9);
+            stat_re += (((tmp_re*chest_re)>>15) + ((tmp_im*chest_im)>>15))/4;
+            stat_im += (((tmp_re*chest_im)>>15) - ((tmp_im*chest_re)>>15))/4;
             off+=2;
 #ifdef DEBUG_PUCCH_RX
             LOG_D(PHY,"[PHY][eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d)\n",subframe,l,re,
@@ -1012,14 +1039,17 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
       } // aa
 
 #ifdef DEBUG_PUCCH_RX
-      LOG_D(PHY,"PUCCH 1a/b: subframe %d : stat %d,%d (pos %d)\n",subframe,stat_re,stat_im,
+      LOG_I(PHY,"PUCCH 1a/b: subframe %d : stat %d,%d (pos %d)\n",subframe,stat_re,stat_im,
 	    (subframe<<10) + (phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe]));
 #endif
 
-      ((int16_t*)&phy_vars_eNB->pucch1ab_stats[UE_id][(subframe<<10) + (phy_vars_eNB->pucch1_stats_cnt[UE_id][subframe])])[0] = stat_re;
-      ((int16_t*)&phy_vars_eNB->pucch1ab_stats[UE_id][(subframe<<10) + (phy_vars_eNB->pucch1_stats_cnt[UE_id][subframe])])[1] = stat_im;
+      phy_vars_eNB->pucch1ab_stats[UE_id][(subframe<<11) + 2*(phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe])] = (stat_re);
+      phy_vars_eNB->pucch1ab_stats[UE_id][(subframe<<11) + 1+2*(phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe])] = (stat_im);
       phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe] = (phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe]+1)&1023;
 
+      /* frame not available here - set to -1 for the moment */
+      T(T_ENB_PHY_PUCCH_1AB_IQ, T_INT(phy_vars_eNB->Mod_id), T_INT(UE_id), T_INT(-1), T_INT(subframe), T_INT(stat_re), T_INT(stat_im));
+
       switch (fmt) {
       case pucch_format1a:
 	*payload = (stat_re<0) ? 1 : 0;
@@ -1043,6 +1073,11 @@ int32_t rx_pucch(PHY_VARS_eNB *phy_vars_eNB,
       }
     } else { // insufficient energy on PUCCH so NAK/DTX
       *payload = 0;
+      ((int16_t*)&phy_vars_eNB->pucch1ab_stats[UE_id][(subframe<<10) + (phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe])])[0] = (int16_t)(stat_re);
+      ((int16_t*)&phy_vars_eNB->pucch1ab_stats[UE_id][(subframe<<10) + (phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe])])[1] = (int16_t)(stat_im);
+      phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe] = (phy_vars_eNB->pucch1ab_stats_cnt[UE_id][subframe]+1)&1023;
+
+      *payload = (stat_re<0) ? 1 : 0;
 
       if (fmt==pucch_format1b)
         *(1+payload) = 0;
@@ -1076,7 +1111,7 @@ int32_t rx_pucch_emul(PHY_VARS_eNB *phy_vars_eNB,
   }
 
   if (UE_id==NB_UE_INST) {
-    LOG_E(PHY,"rx_pucch_emul: FATAL, didn't find UE with rnti %x\n",rnti);
+    LOG_W(PHY,"rx_pucch_emul: Didn't find UE with rnti %x\n",rnti);
     return(-1);
   }
 
diff --git a/openair1/PHY/LTE_TRANSPORT/rar_tools.c b/openair1/PHY/LTE_TRANSPORT/rar_tools.c
index 1b789e114435269d9b3a3d476c67d7ae4dad9c9e..40dec0ec6f4eca97d85620557855c6642cce3d3f 100644
--- a/openair1/PHY/LTE_TRANSPORT/rar_tools.c
+++ b/openair1/PHY/LTE_TRANSPORT/rar_tools.c
@@ -40,12 +40,8 @@
 #include "PHY/defs.h"
 #include "PHY/extern.h"
 #include "SCHED/extern.h"
-#ifdef OPENAIR2
 #include "LAYER2/MAC/defs.h"
-#include "MAC_INTERFACE/defs.h"
-#include "MAC_INTERFACE/extern.h"
 #include "SCHED/defs.h"
-#endif
 
 #include "assertions.h"
 
@@ -81,7 +77,7 @@ int generate_eNB_ulsch_params_from_rar(unsigned char *rar_pdu,
   uint16_t *RIV2nb_rb_LUT, *RIV2first_rb_LUT;
   uint16_t RIV_max;
 
-  LOG_I(PHY,"[eNB][RAPROC] generate_eNB_ulsch_params_from_rar: subframe %d (harq_pid %d)\n",subframe,harq_pid);
+  LOG_D(PHY,"[eNB][RAPROC] generate_eNB_ulsch_params_from_rar: subframe %d (harq_pid %d)\n",subframe,harq_pid);
 
   switch (frame_parms->N_RB_DL) {
   case 6:
diff --git a/openair1/PHY/LTE_TRANSPORT/srs_modulation.c b/openair1/PHY/LTE_TRANSPORT/srs_modulation.c
index 1edc98cf2cb6c1bf54456d23843720acb7f0d9d8..249fd81ee45d2547f3633156c7c8a0d4ae313168 100644
--- a/openair1/PHY/LTE_TRANSPORT/srs_modulation.c
+++ b/openair1/PHY/LTE_TRANSPORT/srs_modulation.c
@@ -137,7 +137,7 @@ int32_t generate_srs_tx(PHY_VARS_UE *phy_vars_ue,
 
   LTE_DL_FRAME_PARMS *frame_parms=&phy_vars_ue->lte_frame_parms;
   SOUNDINGRS_UL_CONFIG_DEDICATED *soundingrs_ul_config_dedicated=&phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id];
-  mod_sym_t *txdataF = phy_vars_ue->lte_ue_common_vars.txdataF[0];
+  int32_t *txdataF = phy_vars_ue->lte_ue_common_vars.txdataF[0];
   uint16_t msrsb=0,Nb=0,nb,b,msrs0=0,k,Msc_RS,Msc_RS_idx,carrier_pos,symbol_offset;
   uint16_t *Msc_idx_ptr;
   int32_t k0;
@@ -237,13 +237,13 @@ int32_t generate_srs_tx(PHY_VARS_UE *phy_vars_ue,
 
     for (k=0; k<Msc_RS; k++) {
       if ((ul_ref_sigs[0][0][Msc_RS_idx][k<<1] >= 0) && (ul_ref_sigs[0][0][Msc_RS_idx][(k<<1)+1] >= 0))
-        txdataF[symbol_offset+carrier_pos] = (mod_sym_t) 4;
+        txdataF[symbol_offset+carrier_pos] = (int32_t) 4;
       else if ((ul_ref_sigs[0][0][Msc_RS_idx][k<<1] >= 0) && (ul_ref_sigs[0][0][Msc_RS_idx][(k<<1)+1] < 0))
-        txdataF[symbol_offset+carrier_pos] = (mod_sym_t) 2;
+        txdataF[symbol_offset+carrier_pos] = (int32_t) 2;
       else if ((ul_ref_sigs[0][0][Msc_RS_idx][k<<1] < 0) && (ul_ref_sigs[0][0][Msc_RS_idx][(k<<1)+1] >= 0))
-        txdataF[symbol_offset+carrier_pos] = (mod_sym_t) 3;
+        txdataF[symbol_offset+carrier_pos] = (int32_t) 3;
       else if ((ul_ref_sigs[0][0][Msc_RS_idx][k<<1] < 0) && (ul_ref_sigs[0][0][Msc_RS_idx][(k<<1)+1] < 0))
-        txdataF[symbol_offset+carrier_pos] = (mod_sym_t) 1;
+        txdataF[symbol_offset+carrier_pos] = (int32_t) 1;
 
       carrier_pos+=2;
 
diff --git a/openair1/PHY/LTE_TRANSPORT/sss.c b/openair1/PHY/LTE_TRANSPORT/sss.c
index e1e6463b3700cff2edd8fcca9bab496a877f3f65..34d55daaea4fc66c9a4abf8626753097d34a2035 100644
--- a/openair1/PHY/LTE_TRANSPORT/sss.c
+++ b/openair1/PHY/LTE_TRANSPORT/sss.c
@@ -44,7 +44,7 @@
 //#define DEBUG_SSS
 
 
-int generate_sss(mod_sym_t **txdataF,
+int generate_sss(int32_t **txdataF,
                  int16_t amp,
                  LTE_DL_FRAME_PARMS *frame_parms,
                  uint16_t symbol,
diff --git a/openair1/PHY/LTE_TRANSPORT/uci_tools.c b/openair1/PHY/LTE_TRANSPORT/uci_tools.c
index 426872942bfa4f8f839451c983e30771290f9222..ca506cdb356ac333647b4e48fca2ef61e0a6e89d 100644
--- a/openair1/PHY/LTE_TRANSPORT/uci_tools.c
+++ b/openair1/PHY/LTE_TRANSPORT/uci_tools.c
@@ -39,8 +39,6 @@
 */
 #include "PHY/defs.h"
 #include "PHY/extern.h"
-#include "MAC_INTERFACE/defs.h"
-#include "MAC_INTERFACE/extern.h"
 #ifdef DEBUG_UCI_TOOLS
 #include "PHY/vars.h"
 #endif
diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c
index 606f2d8dfc66d2a38e18dc5cd807a586cdc326ff..1004cfa192d482a2cf2d8df8ba131db2310165c0 100644
--- a/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c
+++ b/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c
@@ -73,7 +73,7 @@ void free_ue_ulsch(LTE_UE_ULSCH_t *ulsch)
     msg("Freeing ulsch %p\n",ulsch);
 #endif
 
-    for (i=0; i<ulsch->Mdlharq; i++) {
+    for (i=0; i<8; i++) {
 #ifdef DEBUG_ULSCH_FREE
       msg("Freeing ulsch process %d\n",i);
 #endif
@@ -118,7 +118,7 @@ void free_ue_ulsch(LTE_UE_ULSCH_t *ulsch)
 
 }
 
-LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char Mdlharq,unsigned char N_RB_UL, uint8_t abstraction_flag)
+LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag)
 {
 
   LTE_UE_ULSCH_t *ulsch;
@@ -147,9 +147,8 @@ LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char Mdlharq,unsigned char N_RB_UL, uint8_
 
   if (ulsch) {
     memset(ulsch,0,sizeof(LTE_UE_ULSCH_t));
-    ulsch->Mdlharq = Mdlharq;
 
-    for (i=0; i<Mdlharq; i++) {
+    for (i=0; i<8; i++) {
 
       ulsch->harq_processes[i] = (LTE_UL_UE_HARQ_t *)malloc16(sizeof(LTE_UL_UE_HARQ_t));
 
@@ -187,7 +186,7 @@ LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char Mdlharq,unsigned char N_RB_UL, uint8_
     }
 
     if ((abstraction_flag == 0) && (exit_flag==0)) {
-      for (i=0; i<Mdlharq; i++)
+      for (i=0; i<8; i++)
         for (j=0; j<96; j++)
           for (r=0; r<MAX_NUM_ULSCH_SEGMENTS; r++)
             ulsch->harq_processes[i]->d[r][j] = LTE_NULL;
@@ -541,7 +540,7 @@ uint32_t ulsch_encoding(uint8_t *a,
                                           ulsch->e+r_offset,
                                           ulsch->harq_processes[harq_pid]->C, // C
                                           NSOFT,                    // Nsoft,
-                                          ulsch->Mdlharq,
+                                          0,  // this means UL
                                           1,
                                           ulsch->harq_processes[harq_pid]->rvidx,
                                           get_Qm_ul(ulsch->harq_processes[harq_pid]->mcs),
diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
index 25dae3ed63646da5a632e3eed86b6b56f7916284..a0a5602261ceb4015104d3e94ef12be220bab228 100644
--- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
+++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
@@ -44,8 +44,6 @@
 #include "PHY/extern.h"
 #include "PHY/CODING/extern.h"
 #include "extern.h"
-#include "MAC_INTERFACE/defs.h"
-#include "MAC_INTERFACE/extern.h"
 #include "SCHED/extern.h"
 #ifdef OPENAIR2
 #include "LAYER2/MAC/defs.h"
@@ -54,10 +52,6 @@
 #include "PHY_INTERFACE/extern.h"
 #endif
 
-#ifdef OMP
-#include <omp.h>
-#endif
-
 #ifdef PHY_ABSTRACTION
 #include "UTIL/OCG/OCG.h"
 #include "UTIL/OCG/OCG_extern.h"
@@ -72,7 +66,7 @@ void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch)
   int i,r;
 
   if (ulsch) {
-    for (i=0; i<ulsch->Mdlharq; i++) {
+    for (i=0; i<8; i++) {
       if (ulsch->harq_processes[i]) {
         if (ulsch->harq_processes[i]->b) {
           free16(ulsch->harq_processes[i]->b,MAX_ULSCH_PAYLOAD_BYTES);
@@ -100,7 +94,7 @@ void free_eNB_ulsch(LTE_eNB_ULSCH_t *ulsch)
   }
 }
 
-LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t Mdlharq,uint8_t max_turbo_iterations,uint8_t N_RB_UL, uint8_t abstraction_flag)
+LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t max_turbo_iterations,uint8_t N_RB_UL, uint8_t abstraction_flag)
 {
 
   LTE_eNB_ULSCH_t *ulsch;
@@ -129,10 +123,10 @@ LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t Mdlharq,uint8_t max_turbo_iterations,uint
 
   if (ulsch) {
     memset(ulsch,0,sizeof(LTE_eNB_ULSCH_t));
-    ulsch->Mdlharq = Mdlharq;
     ulsch->max_turbo_iterations = max_turbo_iterations;
+    ulsch->Mlimit = 4;
 
-    for (i=0; i<Mdlharq; i++) {
+    for (i=0; i<8; i++) {
       //      msg("new_ue_ulsch: Harq process %d\n",i);
       ulsch->harq_processes[i] = (LTE_UL_eNB_HARQ_t *)malloc16(sizeof(LTE_UL_eNB_HARQ_t));
 
@@ -148,7 +142,6 @@ LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t Mdlharq,uint8_t max_turbo_iterations,uint
         if (abstraction_flag==0) {
           for (r=0; r<MAX_NUM_ULSCH_SEGMENTS/bw_scaling; r++) {
             ulsch->harq_processes[i]->c[r] = (uint8_t*)malloc16(((r==0)?8:0) + 3+768);
-
             if (ulsch->harq_processes[i]->c[r])
               memset(ulsch->harq_processes[i]->c[r],0,((r==0)?8:0) + 3+768);
             else
@@ -179,18 +172,16 @@ LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t Mdlharq,uint8_t max_turbo_iterations,uint
   return(NULL);
 }
 
-void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch, uint8_t abstraction_flag)
+void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch)
 {
 
-  unsigned char Mdlharq;
   unsigned char i;
 
   //ulsch = (LTE_eNB_ULSCH_t *)malloc16(sizeof(LTE_eNB_ULSCH_t));
   if (ulsch) {
-    Mdlharq = ulsch->Mdlharq;
     ulsch->rnti = 0;
 
-    for (i=0; i<Mdlharq; i++) {
+    for (i=0; i<8; i++) {
       if (ulsch->harq_processes[i]) {
         //    ulsch->harq_processes[i]->Ndi = 0;
         ulsch->harq_processes[i]->status = 0;
@@ -254,7 +245,7 @@ unsigned int  ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
   uint8_t *columnset;
   unsigned int sumKr=0;
   unsigned int Qprime,L,G,Q_CQI,Q_RI,H,Hprime,Hpp,Cmux,Rmux_prime,O_RCC;
-  unsigned int Qprime_ACK,Qprime_CQI,Qprime_RI,len_ACK=0,len_RI=0;
+  unsigned int Qprime_ACK,Qprime_RI,len_ACK=0,len_RI=0;
   //  uint8_t q_ACK[MAX_ACK_PAYLOAD],q_RI[MAX_RI_PAYLOAD];
   int metric,metric_new;
   uint8_t o_flip[8];
@@ -288,13 +279,12 @@ unsigned int  ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
                 time_stats_t *,
                 time_stats_t *);
 
-  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING,1);
+  harq_pid = subframe2harq_pid(frame_parms,phy_vars_eNB->proc[sched_subframe].frame_rx,subframe);
+
+  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING0+harq_pid,1);
 
   // x1 is set in lte_gold_generic
   x2 = ((uint32_t)ulsch->rnti<<14) + ((uint32_t)subframe<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1
-
-  //  harq_pid = (ulsch->RRCConnRequest_flag == 0) ? subframe2harq_pid_tdd(frame_parms->tdd_config,subframe) : 0;
-  harq_pid = subframe2harq_pid(frame_parms,phy_vars_eNB->proc[sched_subframe].frame_rx,subframe);
   ulsch_harq = ulsch->harq_processes[harq_pid];
 
   if (harq_pid==255) {
@@ -347,6 +337,7 @@ unsigned int  ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
     //  CLEAR LLR's HERE for first packet in process
   }
 
+  //  printf("after segmentation c[%d] = %p\n",0,ulsch_harq->c[0]);
 
   sumKr = 0;
 
@@ -419,12 +410,13 @@ unsigned int  ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
   else
     L=8;
 
+  // NOTE: we have to handle the case where we have a very small number of bits (condition on pg. 26 36.212)
   if (ulsch_harq->Or1 > 0)
     Qprime = (ulsch_harq->Or1 + L) * ulsch_harq->Msc_initial*ulsch_harq->Nsymb_initial * ulsch->beta_offset_cqi_times8;
   else
     Qprime=0;
 
-  if (Qprime > 0) {
+  if (Qprime > 0) {  // check if ceiling is larger than floor in Q' expression
     if ((Qprime % (8*sumKr)) > 0)
       Qprime = 1+(Qprime/(8*sumKr));
     else
@@ -435,14 +427,10 @@ unsigned int  ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
 
 
 
-  if (Qprime > (G - ulsch_harq->O_RI))
-    Qprime = G - ulsch_harq->O_RI;
-
   Q_CQI = Q_m * Qprime;
 #ifdef DEBUG_ULSCH_DECODING
   msg("ulsch_decoding: G %d, Q_RI %d, Q_CQI %d (L %d, Or1 %d) O_ACK %d\n",G,Q_RI,Q_CQI,L,ulsch_harq->Or1,ulsch_harq->O_ACK);
 #endif
-  Qprime_CQI = Qprime;
 
   G = G - Q_RI - Q_CQI;
 
@@ -461,9 +449,7 @@ unsigned int  ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
   //  Rmux       = Hpp*Q_m/Cmux;
   Rmux_prime = Hpp/Cmux;
 
-#ifdef DEBUG_ULSCH_DECODING
-  msg("ulsch_decoding.c: G raw %d (%d symb), Hpp %d, Cmux %d, Rmux_prime %d\n",G,ulsch_harq->Nsymb_pusch,Hpp,Cmux,Rmux_prime);
-#endif
+
   // Clear "tag" interleaving matrix to allow for CQI/DATA identification
   memset(ytag,0,Cmux*Rmux_prime);
 
@@ -471,128 +457,8 @@ unsigned int  ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
 
   i=0;
   memset(y,LTE_NULL,Q_m*Hpp);
-  /*
-  //  Do RI coding
-  if (ulsch->O_RI == 1) {
-    switch (Q_m) {
-    case 2:
-      q_RI[0] = 0;
-      q_RI[1] = PUSCH_y;
-      len_RI=2;
-      break;
-    case 4:
-      q_RI[0] = 0;
-      q_RI[1] = PUSCH_y;//1;
-      q_RI[2] = PUSCH_x;//o_RI[0];
-      q_RI[3] = PUSCH_x;//1;
-      len_RI=4;
-      break;
-    case 6:
-      q_RI[0] = 0;
-      q_RI[1] = PUSCH_y;//1;
-      q_RI[2] = PUSCH_x;//1;
-      q_RI[3] = PUSCH_x;//ulsch->o_RI[0];
-      q_RI[4] = PUSCH_x;//1;
-      q_RI[5] = PUSCH_x;//1;
-      len_RI=6;
-      break;
-    }
-  }
-  else if (ulsch->O_RI > 1){
-    LOG_E(PHY,"ulsch_decoding: FATAL, RI cannot be more than 1 bit yet\n");
-    return(-1);
-  }
 
-  // 1-bit ACK/NAK
-  if (ulsch_harq->O_ACK == 1) {
-    switch (Q_m) {
-    case 2:
-      q_ACK[0] = 0;
-      q_ACK[1] = (ulsch->bundling==0)? PUSCH_y : 0;
-      len_ACK = 2;
-      break;
-    case 4:
-      q_ACK[0] = 0;
-      q_ACK[1] = (ulsch->bundling==0)? PUSCH_y : 0;
-      q_ACK[2] = PUSCH_x;
-      q_ACK[3] = PUSCH_x;
-      len_ACK = 4;
-      break;
-    case 6:
-      q_ACK[0] = 0;
-      q_ACK[1] = (ulsch->bundling==0)? PUSCH_y : 0;
-      q_ACK[2] = PUSCH_x;
-      q_ACK[3] = PUSCH_x;
-      q_ACK[4] = PUSCH_x;
-      q_ACK[6] = PUSCH_x;
-      len_ACK = 6;
-      break;
-    }
-  }
-  // two-bit ACK/NAK
-  if (ulsch_harq->O_ACK == 2) {
-    switch (Q_m) {
-    case 2:
-      q_ACK[0] = 0;
-      q_ACK[1] = 0;
-      q_ACK[2] = 0;
-      q_ACK[3] = 0;
-      q_ACK[4] = 0;
-      q_ACK[5] = 0;
-      len_ACK = 6;
-      break;
-    case 4:
-      q_ACK[0]  = 0;
-      q_ACK[1]  = 0;
-      q_ACK[2]  = PUSCH_x;
-      q_ACK[3]  = PUSCH_x;//1;
-      q_ACK[4]  = 0;
-      q_ACK[5]  = 0;
-      q_ACK[6]  = PUSCH_x;
-      q_ACK[7]  = PUSCH_x;//1;
-      q_ACK[8]  = 0;
-      q_ACK[9]  = 0;
-      q_ACK[10] = PUSCH_x;
-      q_ACK[11] = PUSCH_x;//1;
-      len_ACK = 12;
-      break;
-    case 6:
-      q_ACK[0] = 0;
-      q_ACK[1] = 0;
-      q_ACK[2] = PUSCH_x;
-      q_ACK[3] = PUSCH_x;
-      q_ACK[4] = PUSCH_x;
-      q_ACK[5] = PUSCH_x;
-
-      q_ACK[6] = 0;
-      q_ACK[7] = 0;
-      q_ACK[8] = PUSCH_x;
-      q_ACK[9] = PUSCH_x;
-      q_ACK[10] = PUSCH_x;
-      q_ACK[11] = PUSCH_x;
-
-      q_ACK[12] = 0;
-      q_ACK[13] = 0;
-      q_ACK[14] = PUSCH_x;
-      q_ACK[15] = PUSCH_x;
-      q_ACK[16] = PUSCH_x;
-      q_ACK[17] = PUSCH_x;
-      len_ACK = 18;
-
-      break;
-    }
-  }
-  if (ulsch_harq->O_ACK > 2) {
-    LOG_E(PHY,"ulsch_decoding: FATAL, ACK cannot be more than 2 bits yet\n");
-    return(-1);
-  }
-
-
-  // RI BITS
-
-  //  memset(ytag2,0,Q_m*Hpp);
-
-  */
+  //  printf("before unscrambling c[%d] = %p\n",0,ulsch_harq->c[0]);
   // read in buffer and unscramble llrs for everything but placeholder bits
   // llrs stored per symbol correspond to columns of interleaving matrix
 
@@ -608,6 +474,8 @@ unsigned int  ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
     s = lte_gold_generic(&x1, &x2, 0);
   }
 
+  //  printf("after unscrambling c[%d] = %p\n",0,ulsch_harq->c[0]);
+
   if (frame_parms->Ncp == 0)
     columnset = cs_ri_normal;
   else
@@ -631,6 +499,8 @@ unsigned int  ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
 
   }
 
+  //  printf("after RI c[%d] = %p\n",0,ulsch_harq->c[0]);
+
   // HARQ-ACK Bits (Note these overwrite some bits)
   if (frame_parms->Ncp == 0)
     columnset = cs_ack_normal;
@@ -733,40 +603,6 @@ unsigned int  ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
   }
 
 
-  //      for (q=0;q<Q_m;q++) {
-  /*
-  if ((i&0x1f)==0) {
-    s = lte_gold_generic(&x1, &x2, reset);
-    //    msg("lte_gold[%d]=%x\n",i,s);
-    reset = 0;
-  }
-  c = (uint8_t)((s>>(i&0x1f))&1);
-
-
-
-  // if bits are tagged as placeholders (RI,ACK)
-
-  if (ytag2[q+(Q_m*((r*Cmux)+j))] == PUSCH_y) {
-
-    c=c_prev;
-  }
-  else if (ytag2[q+(Q_m*((r*Cmux)+j))] == PUSCH_x) {
-    c = 0;
-  #ifdef DEBUG_ULSCH_DECODING
-    //    msg("ulsch_decoding.c: PUSCH_x in row %d, col %d: llr %d\n",r,j,ulsch_llr[i]);
-  #endif
-  }
-  c_prev = c;
-  #ifdef DEBUG_ULSCH_DECODING
-  //  msg("llr[%d] = %d (c %d, ytag2 %d) ==> ",i,ulsch_llr[i],c,ytag2[q+(Q_m*((r*Cmux)+j))]);
-  #endif
-  // note flipped here for reverse polarity in 3GPP bit mapping
-  y[q+(Q_m*((r*Cmux)+j))] = (c==0) ? -ulsch_llr[i] : ulsch_llr[i];
-  i++;
-  #ifdef DEBUG_ULSCH_DECODING
-  //  msg("%d\n",y[q+(Q_m*((r*Cmux)+j))]);
-  #endif
-  */
   stop_meas(&phy_vars_eNB->ulsch_demultiplexing_stats);
 
   if (i!=(H+Q_RI))
@@ -828,17 +664,13 @@ unsigned int  ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
     for (q=0; q<Q_m; q++) {
       if (y[q+(Q_m*((r*Cmux) + columnset[j]))]!=0)
         ulsch_harq->q_ACK[(q+(Q_m*i))%len_ACK] += y[q+(Q_m*((r*Cmux) + columnset[j]))];
-
-#ifdef DEBUG_ULSCH_DECODING
-      //      LOG_D(PHY,"ACK %d => %d (%d,%d,%d)\n",(q+(Q_m*i))%len_ACK,ulsch_harq->q_ACK[(q+(Q_m*i))%len_ACK],q+(Q_m*((r*Cmux) + columnset[j])),r,columnset[j]);
-      printf("ACK %d => %d (%d,%d,%d)\n",(q+(Q_m*i))%len_ACK,ulsch_harq->q_ACK[(q+(Q_m*i))%len_ACK],q+(Q_m*((r*Cmux) + columnset[j])),r,columnset[j]);
-#endif
       y[q+(Q_m*((r*Cmux) + columnset[j]))]=0;  // NULL LLRs in ACK positions
     }
 
     j=(j+3)&3;
   }
 
+  //  printf("after ACKNAK c[%d] = %p\n",0,ulsch_harq->c[0]);
 
   // RI BITS
 
@@ -883,178 +715,141 @@ unsigned int  ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
     j=(j+3)&3;
   }
 
+  //  printf("after RI2 c[%d] = %p\n",0,ulsch_harq->c[0]);
+
   // CQI and Data bits
   j=0;
   j2=0;
 
   //  r=0;
-  for (i=0; i<Qprime_CQI; i++) {
-
-    /*
-    while (ytag[(r*Cmux)+j]==LTE_NULL) {
-    #ifdef DEBUG_ULSCH_DECODING
-      msg("ulsch_decoding.c: r %d, j %d: LTE_NULL\n",r,j);
-    #endif
-      j++;
-      if (j==Cmux) {
-    j=0;
-    r++;
+  if (Q_RI>0) {
+    for (i=0; i<(Q_CQI/Q_m); i++) {
+      
+      while (ytag[j]==LTE_NULL) {
+	j++;
+	j2+=Q_m;
       }
-    }
-    for (q=0;q<Q_m;q++) {
-      ys = y[q+(Q_m*((r*Cmux)+j))];
-      if (ys>127)
-    ulsch_harq->q[q+(Q_m*i)] = 127;
-      else if (ys<-128)
-    ulsch_harq->q[q+(Q_m*i)] = -128;
-      else
-    ulsch_harq->q[q+(Q_m*i)] = ys;
-    #ifdef DEBUG_ULSCH_DECODING
-      msg("ulsch_decoding.c: CQI %d, r %d, j %d, y[%d] %d\n",q+(Q_m*i),r,j, q+(Q_m*((r*Cmux) + j)),ys);
-    #endif
-    }
-    */
-    while (ytag[j]==LTE_NULL) {
-      j++;
+      
+      for (q=0; q<Q_m; q++) {
+	//      ys = y[q+(Q_m*((r*Cmux)+j))];
+	ys = y[q+j2];
+	
+	if (ys>127)
+	  ulsch_harq->q[q+(Q_m*i)] = 127;
+	else if (ys<-128)
+	  ulsch_harq->q[q+(Q_m*i)] = -128;
+	else
+	  ulsch_harq->q[q+(Q_m*i)] = ys;
+      }
+      
       j2+=Q_m;
     }
-
-    for (q=0; q<Q_m; q++) {
-      //      ys = y[q+(Q_m*((r*Cmux)+j))];
-      ys = y[q+j2];
-
-      if (ys>127)
-        ulsch_harq->q[q+(Q_m*i)] = 127;
-      else if (ys<-128)
-        ulsch_harq->q[q+(Q_m*i)] = -128;
-      else
-        ulsch_harq->q[q+(Q_m*i)] = ys;
-
-#ifdef DEBUG_ULSCH_DECODING
-      msg("ulsch_decoding.c: CQI %d, q %d, y[%d] %d\n",q+(Q_m*i),q,j2, q+j2,ys);
-#endif
-    }
-
-    j2+=Q_m;
-  }
-
-  // j2=j*Q_m;
-
-  switch (Q_m) {
-  case 2:
-    for (iprime=0; iprime<(Hprime-Qprime_CQI)<<1;) {
-      while (ytag[j]==LTE_NULL) {
-        j++;
-        j2+=2;
+    
+        
+    switch (Q_m) {
+    case 2:
+      for (iprime=0; iprime<G;) {
+	while (ytag[j]==LTE_NULL) {
+	  j++;
+	  j2+=2;
+	}
+	
+	ulsch_harq->e[iprime++] = y[j2++];
+	ulsch_harq->e[iprime++] = y[j2++];
+	
       }
-
-      ulsch_harq->e[iprime++] = y[j2++];
-      ulsch_harq->e[iprime++] = y[j2++];
-#ifdef DEBUG_ULSCH_DECODING
-      //  msg("ulsch_decoding.c: e %d, r %d, j %d, y[%d] %d\n",g,r,j,q+(Q_m*((r*Cmux) + j)),y[q+(Q_m*((r*Cmux)+j))]);
-#endif
-
-    }
-
-    //    write_output("/tmp/ulsch_e.m","ulsch_e",ulsch->e,iprime,1,0);
-    break;
-
-  case 4:
-    for (iprime=0; iprime<(Hprime-Qprime_CQI)<<2;) {
-      while (ytag[j]==LTE_NULL) {
-        j++;
-        j2+=4;
+      
+      
+      break;
+      
+    case 4:
+      for (iprime=0; iprime<G;) {
+	while (ytag[j]==LTE_NULL) {
+	  j++;
+	  j2+=4;
+	}
+	
+	ulsch_harq->e[iprime++] = y[j2++];
+	ulsch_harq->e[iprime++] = y[j2++];
+	ulsch_harq->e[iprime++] = y[j2++];
+	ulsch_harq->e[iprime++] = y[j2++];
+	
       }
-
-      ulsch_harq->e[iprime++] = y[j2++];
-      ulsch_harq->e[iprime++] = y[j2++];
-      ulsch_harq->e[iprime++] = y[j2++];
-      ulsch_harq->e[iprime++] = y[j2++];
-#ifdef DEBUG_ULSCH_DECODING
-      //  msg("ulsch_decoding.c: e %d, r %d, j %d, y[%d] %d\n",g,r,j,q+(Q_m*((r*Cmux) + j)),y[q+(Q_m*((r*Cmux)+j))]);
-#endif
-
-    }
-
-    break;
-
-  case 6:
-    for (iprime=0; iprime<(Hprime-Qprime_CQI)*6;) {
-      while (ytag[j]==LTE_NULL) {
-        j++;
-        j2+=6;
+      
+      break;
+      
+    case 6:
+      for (iprime=0; iprime<G;) {
+	while (ytag[j]==LTE_NULL) {
+	  j++;
+	  j2+=6;
+	}
+	
+	ulsch_harq->e[iprime++] = y[j2++];
+	ulsch_harq->e[iprime++] = y[j2++];
+	ulsch_harq->e[iprime++] = y[j2++];
+	ulsch_harq->e[iprime++] = y[j2++];
+	ulsch_harq->e[iprime++] = y[j2++];
+	ulsch_harq->e[iprime++] = y[j2++];
+	
       }
-
-      ulsch_harq->e[iprime++] = y[j2++];
-      ulsch_harq->e[iprime++] = y[j2++];
-      ulsch_harq->e[iprime++] = y[j2++];
-      ulsch_harq->e[iprime++] = y[j2++];
-      ulsch_harq->e[iprime++] = y[j2++];
-      ulsch_harq->e[iprime++] = y[j2++];
-#ifdef DEBUG_ULSCH_DECODING
-      //  msg("ulsch_decoding.c: e %d, r %d, j %d, y[%d] %d\n",g,r,j,q+(Q_m*((r*Cmux) + j)),y[q+(Q_m*((r*Cmux)+j))]);
-#endif
+      
+      break;
 
     }
-
-    break;
-
-  }
-
-  /*
-  for (i=0,iprime=-Qprime_CQI;i<Hprime;i++,iprime++) {
-
-    while (ytag[(r*Cmux)+j]==LTE_NULL) {
-  #ifdef DEBUG_ULSCH_DECODING
-      msg("ulsch_decoding.c: r %d, j %d: LTE_NULL\n",r,j);
-  #endif
-      j++;
-      if (j==Cmux) {
-  j=0;
-  r++;
+    
+
+  } // Q_RI>0
+  else {
+
+    for (i=0; i<(Q_CQI/Q_m); i++) {
+      
+      for (q=0; q<Q_m; q++) {
+	ys = y[q+j2];
+	if (ys>127)
+	  ulsch_harq->q[q+(Q_m*i)] = 127;
+	else if (ys<-128)
+	  ulsch_harq->q[q+(Q_m*i)] = -128;
+	else
+	  ulsch_harq->q[q+(Q_m*i)] = ys;
       }
+      
+      j2+=Q_m;
     }
-
-    if (i<Qprime_CQI) {
-
-      for (q=0;q<Q_m;q++) {
-  ys = y[q+(Q_m*((r*Cmux)+j))];
-  if (ys>127)
-    ulsch_harq->q[q+(Q_m*i)] = 127;
-  else if (ys<-128)
-    ulsch_harq->q[q+(Q_m*i)] = -128;
-  else
-    ulsch_harq->q[q+(Q_m*i)] = ys;
-  #ifdef DEBUG_ULSCH_DECODING
-  msg("ulsch_decoding.c: CQI %d, r %d, j %d, y[%d] %d\n",q+(Q_m*i),r,j, q+(Q_m*((r*Cmux) + j)),ys);
-  #endif
+    //    printf("after CQI0 c[%d] = %p\n",0,ulsch_harq->c[0]);
+    switch (Q_m) {
+    case 2:
+      for (iprime=0; iprime<G;) {
+	ulsch_harq->e[iprime++] = y[j2++];
+	ulsch_harq->e[iprime++] = y[j2++];
       }
-    }
-    else {
-      for (q=0;q<Q_m;q++) {
-  g = q+(Q_m*iprime);
-  ulsch->e[g] = y[q+(Q_m*((r*Cmux)+j))];
-  #ifdef DEBUG_ULSCH_DECODING
-  //  msg("ulsch_decoding.c: e %d, r %d, j %d, y[%d] %d\n",g,r,j,q+(Q_m*((r*Cmux) + j)),y[q+(Q_m*((r*Cmux)+j))]);
-  #endif
+      break;
+    case 4:
+      for (iprime=0; iprime<G;) {
+	ulsch_harq->e[iprime++] = y[j2++];
+	ulsch_harq->e[iprime++] = y[j2++];
+	ulsch_harq->e[iprime++] = y[j2++];
+	ulsch_harq->e[iprime++] = y[j2++];
       }
-    }
-    j++;
-    if (j==Cmux) {
-      j=0;
-      r++;
+      break;
+    case 6:
+      for (iprime=0; iprime<G;) {
+	ulsch_harq->e[iprime++] = y[j2++];
+	ulsch_harq->e[iprime++] = y[j2++];
+	ulsch_harq->e[iprime++] = y[j2++];
+	ulsch_harq->e[iprime++] = y[j2++];
+	ulsch_harq->e[iprime++] = y[j2++];
+	ulsch_harq->e[iprime++] = y[j2++];
+      }
+      break;
     }
   }
-  */
+  //  printf("after ACKNAK2 c[%d] = %p (iprime %d, G %d)\n",0,ulsch_harq->c[0],iprime,G);
 
   // Do CQI/RI/HARQ-ACK Decoding first and pass to MAC
 
   // HARQ-ACK
   wACK_idx = (ulsch->bundling==0) ? 4 : ((Nbundled-1)&3);
-#ifdef DEBUG_ULSCH_DECODING
-  msg("ulsch_decoding.c: Bundling %d, Nbundled %d, wACK_idx %d\n",
-      ulsch->bundling,Nbundled,wACK_idx);
-#endif
 
   if (ulsch_harq->O_ACK == 1) {
     ulsch_harq->q_ACK[0] *= wACK_RX[wACK_idx][0];
@@ -1064,10 +859,6 @@ unsigned int  ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
       ulsch_harq->o_ACK[0] = 0;
     else
       ulsch_harq->o_ACK[0] = 1;
-
-#ifdef DEBUG_ULSCH_DECODING
-    msg("ulsch_decoding.c: ulsch_q_ACK[0] %d (%d,%d)\n",ulsch_harq->q_ACK[0],wACK_RX[wACK_idx][0],wACK_RX[wACK_idx][1]);
-#endif
   }
 
   if (ulsch_harq->O_ACK == 2) {
@@ -1077,16 +868,12 @@ unsigned int  ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
       ulsch_harq->q_ACK[0] = ulsch_harq->q_ACK[0]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[3]*wACK_RX[wACK_idx][1];
       ulsch_harq->q_ACK[1] = ulsch_harq->q_ACK[1]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[4]*wACK_RX[wACK_idx][1];
       ulsch_harq->q_ACK[2] = ulsch_harq->q_ACK[2]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[5]*wACK_RX[wACK_idx][1];
-
       break;
-
     case 4:
       ulsch_harq->q_ACK[0] = ulsch_harq->q_ACK[0]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[5]*wACK_RX[wACK_idx][1];
       ulsch_harq->q_ACK[1] = ulsch_harq->q_ACK[1]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[8]*wACK_RX[wACK_idx][1];
       ulsch_harq->q_ACK[2] = ulsch_harq->q_ACK[4]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[9]*wACK_RX[wACK_idx][1];
-
       break;
-
     case 6:
       ulsch_harq->q_ACK[0] =  ulsch_harq->q_ACK[0]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[7]*wACK_RX[wACK_idx][1];
       ulsch_harq->q_ACK[1] =  ulsch_harq->q_ACK[1]*wACK_RX[wACK_idx][0] + ulsch_harq->q_ACK[12]*wACK_RX[wACK_idx][1];
@@ -1123,37 +910,16 @@ unsigned int  ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
     }
   }
 
-#ifdef DEBUG_ULSCH_DECODING
-
-  for (i=0; i<ulsch_harq->O_ACK; i++)
-    msg("ulsch_decoding: O_ACK[%d] %d, q_ACK => (%d,%d,%d)\n",i,ulsch_harq->o_ACK[i],ulsch_harq->q_ACK[0],ulsch_harq->q_ACK[1],ulsch_harq->q_ACK[2]);
-
-#endif
-
   // RI
 
   if ((ulsch_harq->O_RI == 1) && (Qprime_RI > 0)) {
     ulsch_harq->o_RI[0] = ((ulsch_harq->q_RI[0] + ulsch_harq->q_RI[Q_m/2]) > 0) ? 0 : 1;
   }
 
-#ifdef DEBUG_ULSCH_DECODING
-
-  if (Qprime_RI > 0) {
-    for (i=0; i<2*ulsch_harq->O_RI; i++)
-      msg("ulsch_decoding: q_RI[%d] %d\n",i,ulsch_harq->q_RI[i]);
-  }
-
-  if (Qprime_CQI > 0) {
-    for (i=0; i<ulsch_harq->O_RI; i++)
-      LOG_D(PHY,"ulsch_decoding: O_RI[%d] %d\n",i,ulsch_harq->o_RI[i]);
-  }
-
-#endif
-
-
   // CQI
 
-  if (Qprime_CQI>0) {
+  //  printf("before cqi c[%d] = %p\n",0,ulsch_harq->c[0]);
+  if (Q_CQI>0) {
     memset((void *)&dummy_w_cc[0],0,3*(ulsch_harq->Or1+8+32));
 
     O_RCC = generate_dummy_w_cc(ulsch_harq->Or1+8,
@@ -1178,7 +944,6 @@ unsigned int  ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
     else
       ulsch_harq->cqi_crc_status = 0;
 
-    //printf("crc(cqi) rx: %x\n",(crc8(o_flip,ulsch->Or1)>>24));
 
     if (ulsch->harq_processes[harq_pid]->Or1<=32) {
       ulsch_harq->o[3] = o_flip[0] ;
@@ -1221,6 +986,7 @@ unsigned int  ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
 
   for (r=0; r<ulsch_harq->C; r++) {
 
+    //    printf("before subblock deinterleaving c[%d] = %p\n",r,ulsch_harq->c[r]);
     // Get Turbo interleaver parameters
     if (r<ulsch_harq->Cminus)
       Kr = ulsch_harq->Kminus;
@@ -1269,7 +1035,7 @@ unsigned int  ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
                                    ulsch_harq->e+r_offset,
                                    ulsch_harq->C,
                                    NSOFT,
-                                   ulsch->Mdlharq,
+                                   0,   //Uplink
                                    1,
                                    ulsch_harq->rvidx,
                                    (ulsch_harq->round==0)?1:0,  // clear
@@ -1283,50 +1049,25 @@ unsigned int  ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
 
     stop_meas(&phy_vars_eNB->ulsch_rate_unmatching_stats);
     r_offset += E;
-    /*
-    msg("Subblock deinterleaving, d %p w %p\n",
-     ulsch_harq->d[r],
-     ulsch_harq->w);
-    */
+
     start_meas(&phy_vars_eNB->ulsch_deinterleaving_stats);
     sub_block_deinterleaving_turbo(4+Kr,
                                    &ulsch_harq->d[r][96],
                                    ulsch_harq->w[r]);
     stop_meas(&phy_vars_eNB->ulsch_deinterleaving_stats);
-    /*
-    #ifdef DEBUG_ULSCH_DECODING
-    msg("decoder input(segment %d) :",r);
-    for (i=0;i<(3*8*Kr_bytes)+12;i++)
-      msg("%d : %d\n",i,ulsch_harq->d[r][96+i]);
-    msg("\n");
-    #endif
-    */
   }
 
-#ifdef OMP
-  #pragma omp parallel private(r,ret) shared(ulsch,harq_pid,crc_type,Kr,f1f2mat_old,phy_vars_eNB,status,iind,)
-  {
-    #pragma omp for nowait
-#endif
-
     for (r=0; r<ulsch_harq->C; r++) {
-      //    msg("Clearing c, %p\n",ulsch_harq->c[r]);
-      //    memset(ulsch_harq->c[r],0,16);//block_length);
-      //    msg("done\n");
+
+      /*      printf("c[%d] : %p\n",r,
+	     ulsch_harq->c[r]);
+      */
+
       if (ulsch_harq->C == 1)
         crc_type = CRC24_A;
       else
         crc_type = CRC24_B;
 
-      /*
-        msg("decoder input(segment %d)\n",r);
-        for (i=0;i<(3*8*Kr_bytes)+12;i++)
-        if ((ulsch_harq->d[r][96+i]>7) ||
-        (ulsch_harq->d[r][96+i] < -8))
-        msg("%d : %d\n",i,ulsch_harq->d[r][96+i]);
-        msg("\n");
-      */
-
       start_meas(&phy_vars_eNB->ulsch_turbo_decoding_stats);
 
       ret = tc(&ulsch_harq->d[r][96],
@@ -1349,31 +1090,10 @@ unsigned int  ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
 
       status[r] = ret;
 
-      if (ret==(1+ulsch->max_turbo_iterations)) {// a Code segment is in error so break;
-#ifdef DEBUG_ULSCH_DECODING
-        msg("ULSCH harq_pid %d CRC failed\n",harq_pid);
-#endif
-        /*
-          for (i=0;i<Kr_bytes;i++)
-          printf("segment %d : byte %d => %d\n",r,i,ulsch_harq->c[r][i]);
-          return(ret);
-        */
-      }
-
-#ifdef DEBUG_ULSCH_DECODING
-      else
-        msg("ULSCH harq_pid %d CRC OK : %d iterations\n",harq_pid, ret);
-
-#endif
-
     }
 
-#ifdef OMP
-  }
-#endif
   // Reassembly of Transport block here
   offset = 0;
-  //  msg("F %d, Fbytes %d\n",ulsch_harq->F,ulsch_harq->F>>3);
 
   ret = 1;
 
@@ -1391,8 +1111,6 @@ unsigned int  ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
                &ulsch_harq->c[0][(ulsch_harq->F>>3)],
                Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0));
         offset = Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0);
-        //            msg("copied %d bytes to b sequence\n",
-        //             Kr_bytes - (ulsch_harq->F>>3));
       } else {
         memcpy(ulsch_harq->b+offset,
                ulsch_harq->c[r],
@@ -1408,7 +1126,7 @@ unsigned int  ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
 
   }
 
-  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING,0);
+  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING0+harq_pid,0);
 
   return(ret);
 }
diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c
index 606b2692d5bbe35b9b0d729099f90f8451faf465..010dd36f3192334b1df919ed2b6219c506246166 100644
--- a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c
+++ b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c
@@ -40,13 +40,13 @@
 
 #include "PHY/defs.h"
 #include "PHY/extern.h"
-#include "MAC_INTERFACE/defs.h"
-#include "MAC_INTERFACE/extern.h"
 #include "defs.h"
 #include "extern.h"
 //#define DEBUG_ULSCH
 #include "PHY/sse_intrin.h"
 
+#include "T.h"
+
 //extern char* namepointer_chMag ;
 //eren
 //extern int **ulchmag_eren;
@@ -1617,7 +1617,7 @@ void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB,
   rx_power_correction = 1;
 
   if (ulsch[UE_id]->harq_processes[harq_pid]->nb_rb == 0) {
-    LOG_E(PHY,"PUSCH (%d/%x) nb_rb=0!\n", harq_pid,ulsch[UE_id]->rnti,harq_pid);
+    LOG_E(PHY,"PUSCH (%d/%x) nb_rb=0!\n", harq_pid,ulsch[UE_id]->rnti);
     return;
   }
 
@@ -1657,8 +1657,15 @@ void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB,
     }
   } else {
     for (i=0; i<frame_parms->nb_antennas_rx; i++) {
+      /*
       eNB_pusch_vars->ulsch_power[i] = signal_energy_nodc(eNB_pusch_vars->drs_ch_estimates[eNB_id][i],
                                        ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12)*rx_power_correction;
+
+      */
+      
+      eNB_pusch_vars->ulsch_power[i] = signal_energy_nodc(eNB_pusch_vars->drs_ch_estimates[eNB_id][i],
+							  ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12);
+      
 #ifdef LOCALIZATION
       eNB_pusch_vars->subcarrier_power = (int32_t *)malloc(ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12*sizeof(int32_t));
       eNB_pusch_vars->active_subcarrier = subcarrier_energy(eNB_pusch_vars->drs_ch_estimates[eNB_id][i],
@@ -1833,6 +1840,12 @@ void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB,
 #endif
 
 
+  T(T_ENB_PHY_PUSCH_IQ, T_INT(eNB_id), T_INT(UE_id), T_INT(phy_vars_eNB->proc[sched_subframe].frame_rx),
+    T_INT(subframe), T_INT(ulsch[UE_id]->harq_processes[harq_pid]->nb_rb),
+    T_INT(frame_parms->N_RB_UL), T_INT(frame_parms->symbols_per_tti),
+    T_BUFFER(eNB_pusch_vars->rxdataF_comp[eNB_id][0],
+             2 * /* ulsch[UE_id]->harq_processes[harq_pid]->nb_rb */ frame_parms->N_RB_UL *12*frame_parms->symbols_per_tti*2));
+
   llrp = (int16_t*)&eNB_pusch_vars->llr[0];
 
   for (l=0; l<frame_parms->symbols_per_tti-ulsch[UE_id]->harq_processes[harq_pid]->srs_active; l++) {
diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c b/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c
index e9780ee92b20f2f5dbe9a455215d0b6a135fb088..b4f7f024803d0595c1fa0d674fae81d5cb3f5559 100644
--- a/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c
+++ b/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c
@@ -50,7 +50,7 @@
 //#define DEBUG_ULSCH_MODULATION
 
 #ifndef OFDMA_ULSCH
-void dft_lte(mod_sym_t *z,mod_sym_t *d, int32_t Msc_PUSCH, uint8_t Nsymb)
+void dft_lte(int32_t *z,int32_t *d, int32_t Msc_PUSCH, uint8_t Nsymb)
 {
 
 #if defined(__x86_64__) || defined(__i386__)
@@ -373,7 +373,7 @@ void dft_lte(mod_sym_t *z,mod_sym_t *d, int32_t Msc_PUSCH, uint8_t Nsymb)
 }
 
 #endif
-void ulsch_modulation(mod_sym_t **txdataF,
+void ulsch_modulation(int32_t **txdataF,
                       short amp,
                       uint32_t frame,
                       uint32_t subframe,
@@ -393,7 +393,7 @@ void ulsch_modulation(mod_sym_t **txdataF,
   //  uint8_t harq_pid = (rag_flag == 1) ? 0 : subframe2harq_pid_tdd(frame_parms->tdd_config,subframe);
   uint8_t harq_pid = subframe2harq_pid(frame_parms,frame,subframe);
   uint8_t Q_m;
-  mod_sym_t *txptr;
+  int32_t *txptr;
   uint32_t symbol_offset;
   uint16_t first_rb;
   uint16_t nb_rb;
diff --git a/openair1/PHY/MODULATION/defs.h b/openair1/PHY/MODULATION/defs.h
index 8d45c15e0031ddca60c3be49667f1c1c32d40d6a..8b92e3886e403b4cd826b947421203d1cdb111de 100644
--- a/openair1/PHY/MODULATION/defs.h
+++ b/openair1/PHY/MODULATION/defs.h
@@ -34,12 +34,12 @@
 */
 
 /**
-\fn void PHY_ofdm_mod(int *input,int *output,unsigned char log2fftsize,unsigned char nb_symbols,unsigned short nb_prefix_samples,Extension_t etype)
+\fn void PHY_ofdm_mod(int *input,int *output,int fftsize,unsigned char nb_symbols,unsigned short nb_prefix_samples,Extension_t etype)
 This function performs OFDM modulation with cyclic extension or zero-padding.
 
 @param input The sequence input samples in the frequency-domain.  This is a concatenation of the input symbols in SIMD redundant format
 @param output The time-domain output signal
-@param log2fftsize Base-2 logarithm of the OFDM symbol size (\f$N_d\f$)
+@param fftsize size of OFDM symbol size (\f$N_d\f$)
 @param nb_symbols The number of OFDM symbols in the block
 @param nb_prefix_samples The number of prefix/suffix/zero samples
 @param etype Type of extension (CYCLIC_PREFIX,CYCLIC_SUFFIX,ZEROS)
@@ -47,7 +47,7 @@ This function performs OFDM modulation with cyclic extension or zero-padding.
 */
 void PHY_ofdm_mod(int *input,
                   int *output,
-                  unsigned char log2fftsize,
+                  int fftsize,
                   unsigned char nb_symbols,
                   unsigned short nb_prefix_samples,
                   Extension_t etype
@@ -87,7 +87,7 @@ int slot_fep_ul(LTE_DL_FRAME_PARMS *frame_parms,
 
 void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRAME_PARMS *frame_parms);
 
-void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms);
+void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms);
 
 void remove_7_5_kHz(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe);
 
diff --git a/openair1/PHY/MODULATION/ofdm_mod.c b/openair1/PHY/MODULATION/ofdm_mod.c
index 61e5f9fb5bc20c7bbd436419d7a8e9584351ceeb..d7dd141fb56d1063cf8b158759781046fa1f6521 100755
--- a/openair1/PHY/MODULATION/ofdm_mod.c
+++ b/openair1/PHY/MODULATION/ofdm_mod.c
@@ -61,9 +61,9 @@ void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRA
            txdata+(i*(frame_parms->samples_per_tti>>1)));
 #endif
 
-    PHY_ofdm_mod(txdataF+(i*NUMBER_OF_OFDM_CARRIERS*frame_parms->symbols_per_tti>>1),        // input
+    PHY_ofdm_mod(txdataF+(i*frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti>>1),        // input
                  txdata+(i*frame_parms->samples_per_tti>>1),         // output
-                 frame_parms->log2_symbol_size,                // log2_fft_size
+                 frame_parms->ofdm_symbol_size,                
                  1,                 // number of symbols
                  frame_parms->nb_prefix_samples0,               // number of prefix samples
                  CYCLIC_PREFIX);
@@ -71,9 +71,9 @@ void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRA
     printf("slot i %d (txdata offset %d)\n",i,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0+(i*frame_parms->samples_per_tti>>1));
 #endif
 
-    PHY_ofdm_mod(txdataF+NUMBER_OF_OFDM_CARRIERS+(i*NUMBER_OF_OFDM_CARRIERS*(frame_parms->symbols_per_tti>>1)),        // input
+    PHY_ofdm_mod(txdataF+frame_parms->ofdm_symbol_size+(i*frame_parms->ofdm_symbol_size*(frame_parms->symbols_per_tti>>1)),        // input
                  txdata+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES0+(i*(frame_parms->samples_per_tti>>1)),         // output
-                 frame_parms->log2_symbol_size,                // log2_fft_size
+                 frame_parms->ofdm_symbol_size,                
                  (short_offset==1) ? 1 :(frame_parms->symbols_per_tti>>1)-1,//6,                 // number of symbols
                  frame_parms->nb_prefix_samples,               // number of prefix samples
                  CYCLIC_PREFIX);
@@ -84,14 +84,14 @@ void normal_prefix_mod(int32_t *txdataF,int32_t *txdata,uint8_t nsymb,LTE_DL_FRA
 
 void PHY_ofdm_mod(int *input,                       /// pointer to complex input
                   int *output,                      /// pointer to complex output
-                  unsigned char log2fftsize,        /// log2(FFT_SIZE)
+                  int fftsize,            /// FFT_SIZE
                   unsigned char nb_symbols,         /// number of OFDM symbols
                   unsigned short nb_prefix_samples,  /// cyclic prefix length
                   Extension_t etype                /// type of extension
                  )
 {
 
-  static short temp[2048*4] __attribute__((aligned(16)));
+  static short temp[2048*4] __attribute__((aligned(32)));
   unsigned short i,j;
   short k;
 
@@ -100,24 +100,28 @@ void PHY_ofdm_mod(int *input,                       /// pointer to complex input
   int *temp_ptr=(int*)0;
   void (*idft)(int16_t *,int16_t *, int);
 
-  switch (log2fftsize) {
-  case 7:
+  switch (fftsize) {
+  case 128:
     idft = idft128;
     break;
 
-  case 8:
+  case 256:
     idft = idft256;
     break;
 
-  case 9:
+  case 512:
     idft = idft512;
     break;
 
-  case 10:
+  case 1024:
     idft = idft1024;
     break;
 
-  case 11:
+  case 1536:
+    idft = idft1536;
+    break;
+
+  case 2048:
     idft = idft2048;
     break;
 
@@ -127,8 +131,8 @@ void PHY_ofdm_mod(int *input,                       /// pointer to complex input
   }
 
 #ifdef DEBUG_OFDM_MOD
-  msg("[PHY] OFDM mod (size %d,prefix %d) Symbols %d, input %p, output %p\n",
-      1<<log2fftsize,nb_prefix_samples,nb_symbols,input,output);
+  printf("[PHY] OFDM mod (size %d,prefix %d) Symbols %d, input %p, output %p\n",
+      fftsize,nb_prefix_samples,nb_symbols,input,output);
 #endif
 
 
@@ -136,35 +140,45 @@ void PHY_ofdm_mod(int *input,                       /// pointer to complex input
   for (i=0; i<nb_symbols; i++) {
 
 #ifdef DEBUG_OFDM_MOD
-    msg("[PHY] symbol %d/%d (%p,%p -> %p)\n",i,nb_symbols,input,&input[i<<log2fftsize],&output[(i<<log2fftsize) + ((i)*nb_prefix_samples)]);
+    printf("[PHY] symbol %d/%d offset %d (%p,%p -> %p)\n",i,nb_symbols,i*fftsize+(i*nb_prefix_samples),input,&input[i*fftsize],&output[(i*fftsize) + ((i)*nb_prefix_samples)]);
 #endif
 
-    idft((int16_t *)&input[i<<log2fftsize],
-         (log2fftsize==7) ? (int16_t *)temp : (int16_t *)&output[(i<<log2fftsize) + ((1+i)*nb_prefix_samples)],
+#ifndef __AVX2__
+    // handle 128-bit alignment for 128-bit SIMD (SSE4,NEON,AltiVEC)
+    idft((int16_t *)&input[i*fftsize],
+         (fftsize==128) ? (int16_t *)temp : (int16_t *)&output[(i*fftsize) + ((1+i)*nb_prefix_samples)],
+         1);
+#else
+    // on AVX2 need 256-bit alignment
+    idft((int16_t *)&input[i*fftsize],
+         (fftsize<=512) ? (int16_t *)temp : (int16_t *)&output[(i*fftsize) + ((1+i)*nb_prefix_samples)],
          1);
-    //    write_output("fft_out.m","fftout",temp,(1<<log2fftsize)*2,1,1);
-
-    //memset(temp,0,1<<log2fftsize);
 
+#endif
 
     // Copy to frame buffer with Cyclic Extension
     // Note:  will have to adjust for synchronization offset!
 
     switch (etype) {
     case CYCLIC_PREFIX:
-      output_ptr = &output[(i<<log2fftsize) + ((1+i)*nb_prefix_samples)];
+      output_ptr = &output[(i*fftsize) + ((1+i)*nb_prefix_samples)];
       temp_ptr = (int *)temp;
 
 
       //      msg("Doing cyclic prefix method\n");
 
-      if (log2fftsize==7) {
-        for (j=0; j<((1<<log2fftsize)) ; j++) {
+#ifndef __AVX2__
+      if (fftsize==128) 
+#else
+      if (fftsize<=512) 
+#endif
+      {
+        for (j=0; j<fftsize ; j++) {
           output_ptr[j] = temp_ptr[j];
         }
       }
 
-      j=(1<<log2fftsize);
+      j=fftsize;
 
       for (k=-1; k>=-nb_prefix_samples; k--) {
         output_ptr[k] = output_ptr[--j];
@@ -175,19 +189,19 @@ void PHY_ofdm_mod(int *input,                       /// pointer to complex input
     case CYCLIC_SUFFIX:
 
 
-      output_ptr = &output[(i<<log2fftsize)+ (i*nb_prefix_samples)];
+      output_ptr = &output[(i*fftsize)+ (i*nb_prefix_samples)];
 
       temp_ptr = (int *)temp;
 
       //      msg("Doing cyclic suffix method\n");
 
-      for (j=0; j<(1<<log2fftsize) ; j++) {
+      for (j=0; j<fftsize ; j++) {
         output_ptr[j] = temp_ptr[2*j];
       }
 
 
       for (j=0; j<nb_prefix_samples; j++)
-        output_ptr[(1<<log2fftsize)+j] = output_ptr[j];
+        output_ptr[fftsize+j] = output_ptr[j];
 
       break;
 
@@ -198,11 +212,11 @@ void PHY_ofdm_mod(int *input,                       /// pointer to complex input
     case NONE:
 
       //      msg("NO EXTENSION!\n");
-      output_ptr = &output[(i<<log2fftsize)];
+      output_ptr = &output[fftsize];
 
       temp_ptr = (int *)temp;
 
-      for (j=0; j<(1<<log2fftsize) ; j++) {
+      for (j=0; j<fftsize ; j++) {
         output_ptr[j] = temp_ptr[2*j];
 
 
@@ -219,18 +233,11 @@ void PHY_ofdm_mod(int *input,                       /// pointer to complex input
 
   }
 
-  /*
-  printf("input %p, output %p, log2fftsize %d, nsymb %d\n",input,output,log2fftsize,nb_symbols);
-  for (i=0;i<16;i++)
-    printf("%d %d\n",((short *)input)[i<<1],((short *)input)[1+(i<<1)]);
-  printf("------\n");
-  for (i=0;i<16;i++)
-    printf("%d %d\n",((short *)output)[i<<1],((short *)output)[1+(i<<1)]);
-  */
+
 }
 
 
-void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms)
+void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms)
 {
 
   int aa, slot_offset, slot_offset_F;
@@ -244,7 +251,7 @@ void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t
         LOG_D(PHY,"Frame %d, subframe %d: Doing MBSFN modulation (slot_offset %d)\n",frame,next_slot>>1,slot_offset);
         PHY_ofdm_mod(&txdataF[aa][slot_offset_F],        // input
                      &txdata[aa][slot_offset],         // output
-                     frame_parms->log2_symbol_size,                // log2_fft_size
+                     frame_parms->ofdm_symbol_size,                
                      12,                 // number of symbols
                      frame_parms->ofdm_symbol_size>>2,               // number of prefix samples
                      CYCLIC_PREFIX);
@@ -252,7 +259,7 @@ void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t
         if (frame_parms->Ncp == EXTENDED)
           PHY_ofdm_mod(&txdataF[aa][slot_offset_F],        // input
                        &txdata[aa][slot_offset],         // output
-                       frame_parms->log2_symbol_size,                // log2_fft_size
+                       frame_parms->ofdm_symbol_size,                
                        2,                 // number of symbols
                        frame_parms->nb_prefix_samples,               // number of prefix samples
                        CYCLIC_PREFIX);
@@ -268,7 +275,7 @@ void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t
       if (frame_parms->Ncp == EXTENDED)
         PHY_ofdm_mod(&txdataF[aa][slot_offset_F],        // input
                      &txdata[aa][slot_offset],         // output
-                     frame_parms->log2_symbol_size,                // log2_fft_size
+                     frame_parms->ofdm_symbol_size,                
                      6,                 // number of symbols
                      frame_parms->nb_prefix_samples,               // number of prefix samples
                      CYCLIC_PREFIX);
diff --git a/openair1/PHY/MODULATION/slot_fep.c b/openair1/PHY/MODULATION/slot_fep.c
index feb2d885b2c1279c5a649dd0b12f82c10a0c3bc7..61c83e5b890b4f8545805042b5ed11c8ddb44f7c 100644
--- a/openair1/PHY/MODULATION/slot_fep.c
+++ b/openair1/PHY/MODULATION/slot_fep.c
@@ -27,7 +27,6 @@
 
  *******************************************************************************/
 #include "PHY/defs.h"
-#include "MAC_INTERFACE/extern.h"
 #include "defs.h"
 //#define DEBUG_FEP
 
@@ -56,26 +55,30 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
   unsigned int rx_offset;
 
   void (*dft)(int16_t *,int16_t *, int);
-  int tmp_dft_in[256];  // This is for misalignment issues for 6 and 15 PRBs
+  int tmp_dft_in[2048] __attribute__ ((aligned (32)));  // This is for misalignment issues for 6 and 15 PRBs
 
-  switch (frame_parms->log2_symbol_size) {
-  case 7:
+  switch (frame_parms->ofdm_symbol_size) {
+  case 128:
     dft = dft128;
     break;
 
-  case 8:
+  case 256:
     dft = dft256;
     break;
 
-  case 9:
+  case 512:
     dft = dft512;
     break;
 
-  case 10:
+  case 1024:
     dft = dft1024;
     break;
 
-  case 11:
+  case 1536:
+    dft = dft1536;
+    break;
+
+  case 2048:
     dft = dft2048;
     break;
 
@@ -96,12 +99,12 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
 
 
   if (l<0 || l>=7-frame_parms->Ncp) {
-    msg("slot_fep: l must be between 0 and %d\n",7-frame_parms->Ncp);
+    printf("slot_fep: l must be between 0 and %d\n",7-frame_parms->Ncp);
     return(-1);
   }
 
   if (Ns<0 || Ns>=20) {
-    msg("slot_fep: Ns must be between 0 and 19\n");
+    printf("slot_fep: Ns must be between 0 and 19\n");
     return(-1);
   }
 
@@ -111,12 +114,12 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
     memset(&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],0,frame_parms->ofdm_symbol_size*sizeof(int));
 
     rx_offset = sample_offset + slot_offset + nb_prefix_samples0 + subframe_offset - SOFFSET;
-    // Align with 128 bit
-    rx_offset = rx_offset - rx_offset % 4;
+    // Align with 256 bit
+    //    rx_offset = rx_offset&0xfffffff8;
 
 #ifdef DEBUG_FEP
     //  if (phy_vars_ue->frame <100)
-    msg("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d\n", phy_vars_ue->frame_rx,Ns, symbol,
+    printf("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d\n", phy_vars_ue->frame_rx,Ns, symbol,
         nb_prefix_samples,nb_prefix_samples0,slot_offset,subframe_offset,sample_offset,rx_offset);
 #endif
 
@@ -127,9 +130,9 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
                (short *)&ue_common_vars->rxdata[aa][0],
                frame_parms->ofdm_symbol_size*sizeof(int));
 
-      if ((rx_offset&3)!=0) {  // if input to dft is not 128-bit aligned, issue for size 6 and 15 PRBs
+      if ((rx_offset&7)!=0) {  // if input to dft is not 256-bit aligned, issue for size 6,15 and 25 PRBs
         memcpy((void *)tmp_dft_in,
-               (void *)&ue_common_vars->rxdata[aa][(rx_offset-nb_prefix_samples0) % frame_length_samples],
+               (void *)&ue_common_vars->rxdata[aa][rx_offset % frame_length_samples],
                frame_parms->ofdm_symbol_size*sizeof(int));
         dft((int16_t *)tmp_dft_in,
             (int16_t *)&ue_common_vars->rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],1);
@@ -142,12 +145,12 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
 
       }
     } else {
-      rx_offset += (frame_parms->ofdm_symbol_size+nb_prefix_samples) +
-                   (frame_parms->ofdm_symbol_size+nb_prefix_samples)*(l-1);
+      rx_offset += (frame_parms->ofdm_symbol_size+nb_prefix_samples)*l;// +
+      //                   (frame_parms->ofdm_symbol_size+nb_prefix_samples)*(l-1);
 
 #ifdef DEBUG_FEP
       //  if (phy_vars_ue->frame <100)
-      msg("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d\n", phy_vars_ue->frame_rx,Ns, symbol,
+      printf("slot_fep: frame %d: slot %d, symbol %d, nb_prefix_samples %d, nb_prefix_samples0 %d, slot_offset %d, subframe_offset %d, sample_offset %d,rx_offset %d\n", phy_vars_ue->frame_rx,Ns, symbol,
           nb_prefix_samples,nb_prefix_samples0,slot_offset,subframe_offset,sample_offset,rx_offset);
 #endif
 
@@ -158,7 +161,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
 
       start_meas(&phy_vars_ue->rx_dft_stats);
 
-      if ((rx_offset&3)!=0) {  // if input to dft is not 128-bit aligned, issue for size 6 and 15 PRBs
+      if ((rx_offset&7)!=0) {  // if input to dft is not 128-bit aligned, issue for size 6 and 15 PRBs
         memcpy((void *)tmp_dft_in,
                (void *)&ue_common_vars->rxdata[aa][(rx_offset) % frame_length_samples],
                frame_parms->ofdm_symbol_size*sizeof(int));
@@ -182,7 +185,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
       for (aa=0; aa<frame_parms->nb_antennas_tx_eNB; aa++) {
 
 #ifdef DEBUG_FEP
-        msg("Channel estimation eNB %d, aatx %d, slot %d, symbol %d\n",eNB_id,aa,Ns,l);
+        printf("Channel estimation eNB %d, aatx %d, slot %d, symbol %d\n",eNB_id,aa,Ns,l);
 #endif
         start_meas(&phy_vars_ue->dlsch_channel_estimation_stats);
         lte_dl_channel_estimation(phy_vars_ue,eNB_id,0,
@@ -205,7 +208,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
       // do frequency offset estimation here!
       // use channel estimates from current symbol (=ch_t) and last symbol (ch_{t-1})
 #ifdef DEBUG_FEP
-      msg("Frequency offset estimation\n");
+      printf("Frequency offset estimation\n");
 #endif
 
       if (l==(4-frame_parms->Ncp)) {
@@ -222,7 +225,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
   }
 
 #ifdef DEBUG_FEP
-  msg("slot_fep: done\n");
+  printf("slot_fep: done\n");
 #endif
   return(0);
 }
diff --git a/openair1/PHY/MODULATION/slot_fep_mbsfn.c b/openair1/PHY/MODULATION/slot_fep_mbsfn.c
index 94dc4b3ef162cc3b8d3e421de3e89d9745bf81e5..f6ca4aa2f41db203fb69a80f84fbc1bfe68e8343 100644
--- a/openair1/PHY/MODULATION/slot_fep_mbsfn.c
+++ b/openair1/PHY/MODULATION/slot_fep_mbsfn.c
@@ -27,7 +27,6 @@
 
  *******************************************************************************/
 #include "PHY/defs.h"
-#include "MAC_INTERFACE/extern.h"
 #include "defs.h"
 //#define DEBUG_FEP
 
@@ -54,25 +53,29 @@ int slot_fep_mbsfn(PHY_VARS_UE *phy_vars_ue,
   unsigned int frame_length_samples = frame_parms->samples_per_tti * 10;
   void (*dft)(int16_t *,int16_t *, int);
 
-  switch (frame_parms->log2_symbol_size) {
+  switch (frame_parms->ofdm_symbol_size) {
 
-  case 7:
+  case 128:
     dft = dft128;
     break;
 
-  case 8:
+  case 256:
     dft = dft256;
     break;
 
-  case 9:
+  case 512:
     dft = dft512;
     break;
 
-  case 10:
+  case 1024:
     dft = dft1024;
     break;
 
-  case 11:
+  case 1536:
+    dft = dft1536;
+    break;
+
+  case 2048:
     dft = dft2048;
     break;
 
diff --git a/openair1/PHY/MODULATION/slot_fep_ul.c b/openair1/PHY/MODULATION/slot_fep_ul.c
index 32bae2c0360a5c1316c47ccda5cd66f86d012676..57f4a6f7ab983b27464a9592ad877fbbe423194d 100644
--- a/openair1/PHY/MODULATION/slot_fep_ul.c
+++ b/openair1/PHY/MODULATION/slot_fep_ul.c
@@ -50,24 +50,28 @@ int slot_fep_ul(LTE_DL_FRAME_PARMS *frame_parms,
 
   void (*dft)(int16_t *,int16_t *, int);
 
-  switch (frame_parms->log2_symbol_size) {
-  case 7:
+  switch (frame_parms->ofdm_symbol_size) {
+  case 128:
     dft = dft128;
     break;
 
-  case 8:
+  case 256:
     dft = dft256;
     break;
 
-  case 9:
+  case 512:
     dft = dft512;
     break;
 
-  case 10:
+  case 1024:
     dft = dft1024;
     break;
 
-  case 11:
+  case 1536:
+    dft = dft1536;
+    break;
+
+  case 2048:
     dft = dft2048;
     break;
 
diff --git a/openair1/PHY/TOOLS/Makefile b/openair1/PHY/TOOLS/Makefile
index 908c1b6f14c89b1f388dd033a2b5409e4bf12b0c..eee9d7834426077de14d2b71b80d7011283ce276 100644
--- a/openair1/PHY/TOOLS/Makefile
+++ b/openair1/PHY/TOOLS/Makefile
@@ -1,8 +1,14 @@
-lte_dfts: lte_dfts.c
-	gcc -O2 -mavx2 -g -ggdb -o lte_dfts lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DUSER_MODE -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
+lte_dfts_sse4: lte_dfts.c
+	gcc -O2 -msse4.1 -g -ggdb -o lte_dfts_sse4 lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DUSER_MODE -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
 
-lte_dfts.s: lte_dfts.c
+lte_dfts_avx2: lte_dfts.c
+	gcc -O2 -mavx2 -g -ggdb -o lte_dfts_avx2 lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DUSER_MODE -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
+
+lte_dfts_avx2.s: lte_dfts.c
 	gcc -O2 -mavx2 -S lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DUSER_MODE -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
 
-dft_cycles: lte_dfts
-	./lte_dfts | egrep cycles
+lte_dfts_sse4.s: lte_dfts.c
+	gcc -O2 -msse4.1 -S lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DUSER_MODE -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
+
+dft_cycles_avx2: lte_dfts_avx2
+	./lte_dfts_avx2 | egrep cycles
diff --git a/openair1/PHY/TOOLS/cdot_prod.c b/openair1/PHY/TOOLS/cdot_prod.c
index 2e52e63f7ef774a4cf0580e278e4c2f15bec08c8..e6ff476303ed811954b3002fb1643ac487ee038b 100644
--- a/openair1/PHY/TOOLS/cdot_prod.c
+++ b/openair1/PHY/TOOLS/cdot_prod.c
@@ -115,11 +115,11 @@ int32_t dot_product(int16_t *x,
   // convert back to integer
   result = _mm_cvtsi64_si32(mmtmp7);
 
-  return(result);
-
   _mm_empty();
   _m_empty();
 
+  return(result);
+
 #elif defined(__arm__)
   int16x4_t *x_128=(int16x4_t*)x;
   int16x4_t *y_128=(int16x4_t*)y;
diff --git a/openair1/PHY/TOOLS/cmult_mm.c b/openair1/PHY/TOOLS/cmult_mm.c
deleted file mode 100644
index 328958af29605645183c7421dca863829eed3ab1..0000000000000000000000000000000000000000
--- a/openair1/PHY/TOOLS/cmult_mm.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/*******************************************************************************
-    OpenAirInterface
-    Copyright(c) 1999 - 2014 Eurecom
-
-    OpenAirInterface is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-
-    OpenAirInterface is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with OpenAirInterface.The full GNU General Public License is
-   included in this distribution in the file called "COPYING". If not,
-   see <http://www.gnu.org/licenses/>.
-
-  Contact Information
-  OpenAirInterface Admin: openair_admin@eurecom.fr
-  OpenAirInterface Tech : openair_tech@eurecom.fr
-  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
-
-  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
-
- *******************************************************************************/
-#include "defs.h"
-
-int mult_cpx_matrix_h(short *x1[2][2],
-                      short *x2[2][2],
-                      short *y[2][2],
-                      unsigned int N,
-                      unsigned short output_shift,
-                      short hermitian)
-{
-
-  if (hermitian) {
-    // this computes x1^H*x2 and stores it in y
-    mult_cpx_vector_h(x2[0][0],x1[0][0],y[0][0],N,output_shift,1);
-    mult_cpx_vector_h(x2[0][1],x1[0][1],y[0][0],N,output_shift,1);
-    mult_cpx_vector_h(x2[0][0],x1[1][0],y[1][0],N,output_shift,1);
-    mult_cpx_vector_h(x2[0][1],x1[1][1],y[1][0],N,output_shift,1);
-    mult_cpx_vector_h(x2[1][0],x1[0][0],y[0][1],N,output_shift,1);
-    mult_cpx_vector_h(x2[1][1],x1[0][1],y[0][1],N,output_shift,1);
-    mult_cpx_vector_h(x2[1][0],x1[1][0],y[1][1],N,output_shift,1);
-    mult_cpx_vector_h(x2[1][1],x1[1][1],y[1][1],N,output_shift,1);
-  } else {
-    // this computes x1*x2^H and stores it in y
-    mult_cpx_vector_h(x1[0][0],x2[0][0],y[0][0],N,output_shift,1);
-    mult_cpx_vector_h(x1[0][1],x2[0][1],y[0][0],N,output_shift,1);
-    mult_cpx_vector_h(x1[0][0],x2[1][0],y[0][1],N,output_shift,1);
-    mult_cpx_vector_h(x1[0][1],x2[1][1],y[0][1],N,output_shift,1);
-    mult_cpx_vector_h(x1[1][0],x2[0][0],y[1][0],N,output_shift,1);
-    mult_cpx_vector_h(x1[1][1],x2[0][1],y[1][0],N,output_shift,1);
-    mult_cpx_vector_h(x1[1][0],x2[1][0],y[1][1],N,output_shift,1);
-    mult_cpx_vector_h(x1[1][1],x2[1][1],y[1][1],N,output_shift,1);
-  }
-}
-
-int mult_cpx_matrix_vector(int *x1[2][2],
-                           int *x2[2],
-                           int *y[2],
-                           unsigned int N,
-                           unsigned short output_shift)
-{
-
-  Zero_Buffer(y[0],N*8);
-  Zero_Buffer(y[1],N*8);
-
-  // this computes x1*x2 and stores it in y (32 bit)
-  mult_cpx_vector_add32((short*)x2[0],(short*)x1[0][0],(short*)y[0],N);
-  mult_cpx_vector_add32((short*)x2[1],(short*)x1[0][1],(short*)y[0],N);
-  mult_cpx_vector_add32((short*)x2[0],(short*)x1[1][0],(short*)y[1],N);
-  mult_cpx_vector_add32((short*)x2[1],(short*)x1[1][1],(short*)y[1],N);
-
-  // shift and pack
-  shift_and_pack((short*)y[0],N,output_shift);
-  shift_and_pack((short*)y[1],N,output_shift);
-
-}
-
-#ifdef MAIN_MM
-#include <stdio.h>
-#include <stdlib.h>
-main ()
-{
-  short x1_00[256] __attribute__((aligned(16)));
-  short x1_10[256] __attribute__((aligned(16)));
-  short x1_01[256] __attribute__((aligned(16)));
-  short x1_11[256] __attribute__((aligned(16)));
-  short x2_0[256] __attribute__((aligned(16)));
-  short x2_1[256] __attribute__((aligned(16)));
-  short y_0[256] __attribute__((aligned(16)));
-  short y_1[256] __attribute__((aligned(16)));
-
-  int *x1[2][2];
-  int *x2[2];
-  int *y[2];
-  int i,m,n;
-
-  x1[0][0] = (int*)x1_00;
-  x1[0][1] = (int*)x1_01;
-  x1[1][0] = (int*)x1_10;
-  x1[1][1] = (int*)x1_11;
-  x2[0] = (int*)x2_0;
-  x2[1] = (int*)x2_1;
-  y[0] = (int*)y_0;
-  y[1] = (int*)y_1;
-
-  for(m=0; m<2; m++) {
-    for(n=0; n<2; n++) {
-      for(i=0; i<256; i+=4) {
-        ((short*)x1[m][n])[i] = ((short) rand())/4;
-        ((short*)x1[m][n])[i+1] = ((short) rand())/4;
-        ((short*)x1[m][n])[i+2] = -((short*)x1[m][n])[i+1];
-        ((short*)x1[m][n])[i+3] = ((short*)x1[m][n])[i];
-      }
-    }
-
-    for(i=0; i<256; i+=4) {
-      ((short*)x2[m])[i] = ((short) rand())/4;
-      ((short*)x2[m])[i+1] = ((short) rand())/4;
-      ((short*)x2[m])[i+2] = ((short*)x2[m])[i];
-      ((short*)x2[m])[i+3] = ((short*)x2[m])[i+1];
-    }
-
-    Zero_Buffer(y[m],512);
-  }
-
-  /*
-  input[0] = 100;
-  input[1] = 200;
-  input[2] = -200;
-  input[3] = 100;
-  input[4] = 1000;
-  input[5] = 2000;
-  input[6] = -2000;
-  input[7] = 1000;
-  input[8] = 100;
-  input[9] = 200;
-  input[10] = -200;
-  input[11] = 100;
-  input[12] = 1000;
-  input[13] = 2000;
-  input[14] = -2000;
-  input[15] = 1000;
-
-  input2[0] = 2;
-  input2[1] = 1;
-  input2[2] = 2;
-  input2[3] = 1;
-  input2[4] = 20;
-  input2[5] = 10;
-  input2[6] = 20;
-  input2[7] = 10;
-  input2[8] = 2;
-  input2[9] = 1;
-  input2[10] = 2;
-  input2[11] = 1;
-  input2[12] = 2000;
-  input2[13] = 1000;
-  input2[14] = 2000;
-  input2[15] = 1000;
-
-  x1[0][0] = (int*)input;
-  x1[0][1] = (int*)input;
-  x1[1][0] = (int*)input;
-  x1[1][1] = (int*)input;
-
-  x2[0] = (int*)input2;
-  x2[1] = (int*)input2;
-
-  y[0] = (int*)output;
-  y[1] = (int*)output2;
-  */
-
-  mult_cpx_matrix_vector(x1,x2,y,64,15);
-
-  //mult_cpx_vector_add32(x2[0],x1[0][0],y[0],64);
-
-  for (i=0; i<128; i+=2)
-    printf("i=%d, x1 = [%d+1i*%d %d+1i*%d; %d+1i*%d %d+1i*%d]; x2 = [%d+1i*%d; %d+1i*%d]; y = [%d+1i*%d; %d+1i*%d]; y_m= round(x1*x2./pow2(15)); y-y_m \n",
-           i,
-           ((short*)x1[0][0])[2*i],  ((short*)x1[0][0])[2*i+2],
-           ((short*)x1[0][1])[2*i],  ((short*)x1[0][1])[2*i+2],
-           ((short*)x1[1][0])[2*i],  ((short*)x1[1][0])[2*i+2],
-           ((short*)x1[1][1])[2*i],  ((short*)x1[1][1])[2*i+2],
-           ((short*)x2[0])[2*i],  ((short*)x2[0])[2*i+1],
-           ((short*)x2[1])[2*i],  ((short*)x2[1])[2*i+1],
-           ((short*)y[0])[2*i],  ((short*)y[0])[2*i+1],
-           ((short*)y[1])[2*i],  ((short*)y[1])[2*i+1]);
-
-  //((int*)y[0])[i],  ((int*)y[0])[i+1],
-  //((int*)y[1])[i],  ((int*)y[1])[i+1]);
-
-}
-
-#endif
diff --git a/openair1/PHY/TOOLS/cmult_vv.c b/openair1/PHY/TOOLS/cmult_vv.c
index d7b72755087cb3e3b343e79140a9935d208e9b56..f970d332248f47fd2109dc71515a8ce99a11ce27 100755
--- a/openair1/PHY/TOOLS/cmult_vv.c
+++ b/openair1/PHY/TOOLS/cmult_vv.c
@@ -50,7 +50,7 @@ int mult_cpx_conj_vector(int16_t *x1,
                          uint32_t N,
                          int output_shift)
 {
-  // Multiply elementwise two complex vectors of N elements with repeated formatted output
+  // Multiply elementwise the complex conjugate of x1 with x2. 
   // x1       - input 1    in the format  |Re0 Im0 Re1 Im1|,......,|Re(N-2)  Im(N-2) Re(N-1) Im(N-1)|
   //            We assume x1 with a dinamic of 15 bit maximum
   //
@@ -90,7 +90,7 @@ int mult_cpx_conj_vector(int16_t *x1,
     tmp_im = _mm_shufflelo_epi16(*x1_128,_MM_SHUFFLE(2,3,0,1));
     tmp_im = _mm_shufflehi_epi16(tmp_im,_MM_SHUFFLE(2,3,0,1));
     tmp_im = _mm_sign_epi16(tmp_im,*(__m128i*)&conjug[0]);
-    tmp_im = _mm_madd_epi16(tmp_im,*x1_128);
+    tmp_im = _mm_madd_epi16(tmp_im,*x2_128);
     tmp_re = _mm_srai_epi32(tmp_re,output_shift);
     tmp_im = _mm_srai_epi32(tmp_im,output_shift);
     tmpy0  = _mm_unpacklo_epi32(tmp_re,tmp_im);
@@ -130,3 +130,4 @@ int mult_cpx_conj_vector(int16_t *x1,
 
   return(0);
 }
+
diff --git a/openair1/PHY/TOOLS/cmult_vvh.c b/openair1/PHY/TOOLS/cmult_vvh.c
deleted file mode 100644
index 64cf163d09c84c09c2afb1afd3aecd467c861a07..0000000000000000000000000000000000000000
--- a/openair1/PHY/TOOLS/cmult_vvh.c
+++ /dev/null
@@ -1,366 +0,0 @@
-/*******************************************************************************
-    OpenAirInterface
-    Copyright(c) 1999 - 2014 Eurecom
-
-    OpenAirInterface is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-
-    OpenAirInterface is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with OpenAirInterface.The full GNU General Public License is
-   included in this distribution in the file called "COPYING". If not,
-   see <http://www.gnu.org/licenses/>.
-
-  Contact Information
-  OpenAirInterface Admin: openair_admin@eurecom.fr
-  OpenAirInterface Tech : openair_tech@eurecom.fr
-  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
-
-  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
-
- *******************************************************************************/
-#include "defs.h"
-
-static  __m128i shift __attribute__ ((aligned(16)));
-
-
-int mult_cpx_vector_h(short *x1,
-                      short *x2,
-                      short *y,
-                      unsigned int N,
-                      unsigned short output_shift,
-                      short sign)
-{
-  // Multiply elementwise the complex vector x1 with the complex conjugate of the complex vecotr x2 of N elements and adds it to the vector y.
-  // x1       - input 1    in the format  |Re0  Im0 Re0 Im0|,......,|Re(N-1)  Im(N-1) Re(N-1) Im(N-1)|
-  //            We assume x1 with a dinamic of 15 bit maximum
-  //
-  // x2       - input 2    in the format  |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
-  //            We assume x2 with a dinamic of 14 bit maximum
-  //
-  // y        - output     in the format  |Re0  Im0 Re0 Im0|,......,|Re(N-1)  Im(N-1) Re(N-1) Im(N-1)|
-  //
-  // N        - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
-  //
-  // log2_amp - increase the output amplitude by a factor 2^log2_amp (default is 0)
-  //            WARNING: log2_amp>0 can cause overflow!!
-  // sign     - +1..add, -1..substract
-
-  unsigned int i;                 // loop counter
-
-  register __m128i m0,m1,m2;
-
-  short *temps;
-  int *tempd;
-
-  __m128i *x1_128;
-  __m128i *x2_128;
-  __m128i *y_128;
-  __m128i mask;
-
-  __m128i temp;
-
-  shift = _mm_cvtsi32_si128(output_shift);
-  x1_128 = (__m128i *)&x1[0];
-  x2_128 = (__m128i *)&x2[0];
-  y_128 = (__m128i *)&y[0];
-
-  if (sign == -1)
-    mask = (__m128i) _mm_set_epi16 (-1,1,-1,-1,-1,1,-1,-1);
-  else
-    mask = (__m128i) _mm_set_epi16 (1,-1,1,1,1,-1,1,1);
-
-  // we compute 2*4 cpx multiply for each loop
-  for(i=0; i<(N>>3); i++) {
-
-    //    printf("i=%d\n",i);
-
-    // unroll 1
-    //    temps = (short *)x1_128;
-    //    printf("x1 : %d,%d,%d,%d,%d,%d,%d,%d\n",temps[0],temps[1],temps[2],temps[3],temps[4],temps[5],temps[6],temps[7]);
-    m1 = x1_128[0];
-    m2 = x2_128[0];
-
-    //    temps = (short *)&x2_128[0];
-    //    printf("x2 : %x,%x,%x,%x,%x,%x,%x,%x\n",temps[0],temps[1],temps[2],temps[3],temps[4],temps[5],temps[6],temps[7]);
-
-    // bring x2 in conjugate form
-    // the first two instructions might be replaced with a single one in SSE3
-    m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2));
-    m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2));
-    m2 = _mm_mullo_epi16(m2, mask);
-
-    //    temp = m2;
-    //    temps = (short *)&temp;
-    //    printf("x2 conj : %x,%x,%x,%x,%x,%x,%x,%x\n",temps[0],temps[1],temps[2],temps[3],temps[4],temps[5],temps[6],temps[7]);
-
-    m0 = _mm_madd_epi16(m1,m2); //pmaddwd_r2r(mm1,mm0);         // 1- compute x1[0]*x2[0]
-
-    //    temp = m0;
-
-    //    tempd = &temp;
-    //    printf("m0 : %d,%d,%d,%d\n",tempd[0],tempd[1],tempd[2],tempd[3]);
-
-    m0 = _mm_sra_epi32(m0,shift);        // 1- shift right by shift in order to  compensate for the input amplitude
-
-    //    temp = m0;
-
-    //    tempd = (int *)&temp;
-    //  printf("m0 : %d,%d,%d,%d\n",tempd[0],tempd[1],tempd[2],tempd[3]);
-
-    m0 = _mm_packs_epi32(m0,m0);        // 1- pack in a 128 bit register [re im re im]
-    m0 = _mm_unpacklo_epi32(m0,m0);        // 1- pack in a 128 bit register [re im re im]
-
-    y_128[0] = _mm_add_epi16(m0,y_128[0]);
-
-    //    temps = (short *)&y_128[0];
-    //    printf("y0 : %d,%d,%d,%d,%d,%d,%d,%d\n",temps[0],temps[1],temps[2],temps[3],temps[4],temps[5],temps[6],temps[7]);
-
-    // unroll 2
-    m1 = x1_128[1];
-    m2 = x2_128[1];
-
-    m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2));
-    m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2));
-    m2 = _mm_mullo_epi16(m2, mask);
-
-    m0 = _mm_madd_epi16(m1,m2); //pmaddwd_r2r(mm1,mm0);         // 1- compute x1[0]*x2[0]
-
-    m0 = _mm_sra_epi32(m0,shift);        // 1- shift right by shift in order to  compensate for the input amplitude
-
-    m0 = _mm_packs_epi32(m0,m0);        // 1- pack in a 128 bit register [re im re im]
-    m0 = _mm_unpacklo_epi32(m0,m0);        // 1- pack in a 128 bit register [re im re im]
-
-    y_128[1] = _mm_add_epi16(m0,y_128[1]);
-
-    // unroll 3
-    m1 = x1_128[2];
-    m2 = x2_128[2];
-
-    m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2));
-    m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2));
-    m2 = _mm_mullo_epi16(m2, mask);
-
-    m0 = _mm_madd_epi16(m1,m2); //pmaddwd_r2r(mm1,mm0);         // 1- compute x1[0]*x2[0]
-
-    m0 = _mm_sra_epi32(m0,shift);        // 1- shift right by shift in order to  compensate for the input amplitude
-
-    m0 = _mm_packs_epi32(m0,m0);        // 1- pack in a 128 bit register [re im re im]
-    m0 = _mm_unpacklo_epi32(m0,m0);        // 1- pack in a 128 bit register [re im re im]
-
-    y_128[2] = _mm_add_epi16(m0,y_128[2]);
-
-
-    // unroll 4
-    m1 = x1_128[3];
-    m2 = x2_128[3];
-
-    m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2));
-    m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2));
-    m2 = _mm_mullo_epi16(m2, mask);
-
-    m0 = _mm_madd_epi16(m1,m2); //pmaddwd_r2r(mm1,mm0);         // 1- compute x1[0]*x2[0]
-
-    m0 = _mm_sra_epi32(m0,shift);        // 1- shift right by shift in order to  compensate for the input amplitude
-
-    m0 = _mm_packs_epi32(m0,m0);        // 1- pack in a 128 bit register [re im re im]
-    m0 = _mm_unpacklo_epi32(m0,m0);        // 1- pack in a 128 bit register [re im re im]
-
-    y_128[3] = _mm_add_epi16(m0,y_128[3]);
-
-    x1_128+=4;
-    x2_128+=4;
-    y_128 +=4;
-    //    printf("x1_128 = %p, x2_128 =%p,  y_128=%p\n",x1_128,x2_128,y_128);
-
-  }
-
-
-  _mm_empty();
-  _m_empty();
-
-  return(0);
-}
-
-
-int mult_cpx_vector_h_add32(short *x1,
-                            short *x2,
-                            short *y,
-                            unsigned int N,
-                            short sign)
-{
-  // Multiply elementwise the complex vector x1 with the complex conjugate of the complex vecotr x2 of N elements and adds it to the vector y.
-  // x1       - input 1    in 16bit format  |Re0  Im0 Re0 Im0|,......,|Re(N-1)  Im(N-1) Re(N-1) Im(N-1)|
-  //            We assume x1 with a dinamic of 15 bit maximum
-  //
-  // x2       - input 2    in 16bit format  |Re0 Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
-  //            We assume x2 with a dinamic of 14 bit maximum
-  //
-  // y        - output     in 32bit format  |Re0  Im0|,......,|Re(N-1)  Im(N-1)|
-  //
-  // N        - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
-  //
-  // sign     - +1..add, -1..substract
-
-  unsigned int i;                 // loop counter
-
-  register __m128i m0,m1,m2;
-
-  short *temps;
-  int *tempd;
-
-  __m128i *x1_128;
-  __m128i *x2_128;
-  __m128i *y_128;
-  __m128i mask;
-
-  __m128i temp;
-
-  x1_128 = (__m128i *)&x1[0];
-  x2_128 = (__m128i *)&x2[0];
-  y_128 = (__m128i *)&y[0];
-
-  if (sign == -1)
-    mask = (__m128i) _mm_set_epi16 (-1,1,-1,-1,-1,1,-1,-1);
-  else
-    mask = (__m128i) _mm_set_epi16 (1,-1,1,1,1,-1,1,1);
-
-  // we compute 2*4 cpx multiply for each loop
-  for(i=0; i<(N>>3); i++) {
-
-    m1 = x1_128[0];
-    m2 = x2_128[0];
-
-    // bring x2 in conjugate form
-    // the first two instructions might be replaced with a single one in SSE3
-    m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2));
-    m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2));
-    m2 = _mm_mullo_epi16(m2, mask);
-
-    m0 = _mm_madd_epi16(m1,m2);         // 1- compute x1[0]*x2[0], result is 32bit
-
-    y_128[0] = _mm_add_epi32(m0,y_128[0]);
-
-    // unroll 2
-    m1 = x1_128[1];
-    m2 = x2_128[1];
-
-    m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2));
-    m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2));
-    m2 = _mm_mullo_epi16(m2, mask);
-
-    m0 = _mm_madd_epi16(m1,m2);
-
-    y_128[1] = _mm_add_epi32(m0,y_128[1]);
-
-    // unroll 3
-    m1 = x1_128[2];
-    m2 = x2_128[2];
-
-    m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2));
-    m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2));
-    m2 = _mm_mullo_epi16(m2, mask);
-
-    m0 = _mm_madd_epi16(m1,m2);
-
-    y_128[2] = _mm_add_epi32(m0,y_128[2]);
-
-
-    // unroll 4
-    m1 = x1_128[3];
-    m2 = x2_128[3];
-
-    m2 = _mm_shufflelo_epi16(m2,_MM_SHUFFLE(0,1,3,2));
-    m2 = _mm_shufflehi_epi16(m2,_MM_SHUFFLE(0,1,3,2));
-    m2 = _mm_mullo_epi16(m2, mask);
-
-    m0 = _mm_madd_epi16(m1,m2);
-
-    y_128[3] = _mm_add_epi32(m0,y_128[3]);
-
-    x1_128+=4;
-    x2_128+=4;
-    y_128 +=4;
-
-  }
-
-
-  _mm_empty();
-  _m_empty();
-
-  return(0);
-}
-
-#ifdef MAIN
-#define L 16
-
-main ()
-{
-
-  short input[256] __attribute__((aligned(16)));
-  short input2[256] __attribute__((aligned(16)));
-  short output[256] __attribute__((aligned(16)));
-
-  int i;
-
-  Zero_Buffer(output,256*2);
-
-  for (i=0; i<16; i+=2)
-    printf("output[%d] = %d + %d i\n",i,output[i],output[i+1]);
-
-  input[0] = 100;
-  input[1] = 200;
-  input[2] = 100;
-  input[3] = 200;
-  input[4] = 1234;
-  input[5] = -1234;
-  input[6] = 1234;
-  input[7] = -1234;
-  input[8] = 100;
-  input[9] = 200;
-  input[10] = 100;
-  input[11] = 200;
-  input[12] = 1000;
-  input[13] = 2000;
-  input[14] = 1000;
-  input[15] = 2000;
-
-  input2[0] = 1;
-  input2[1] = 2;
-  input2[2] = 1;
-  input2[3] = 2;
-  input2[4] = 10;
-  input2[5] = 20;
-  input2[6] = 10;
-  input2[7] = 20;
-  input2[8] = 1;
-  input2[9] = 2;
-  input2[10] = 1;
-  input2[11] = 2;
-  input2[12] = 1000;
-  input2[13] = 2000;
-  input2[14] = 1000;
-  input2[15] = 2000;
-
-
-  mult_cpx_vector_h(input2,input2,output,8,0,1);
-
-  for (i=0; i<16; i+=2)
-    printf("output[%d] = %d + %d i\n",i,output[i],output[i+1]);
-
-  Zero_Buffer(output,256*2);
-  mult_cpx_vector_h(input2,input2,output,8,0,-1);
-
-  for (i=0; i<16; i+=2)
-    printf("output[%d] = %d + %d i\n",i,output[i],output[i+1]);
-
-}
-
-#endif //MAIN
diff --git a/openair1/PHY/TOOLS/defs.h b/openair1/PHY/TOOLS/defs.h
index 6960fcda4c8793ff4920a0cc99edc60c5dddff42..8d30a7ea1004004505afb44bd589c9130626c0bb 100644
--- a/openair1/PHY/TOOLS/defs.h
+++ b/openair1/PHY/TOOLS/defs.h
@@ -64,6 +64,8 @@ struct complex32 {
   int32_t i;
 };
 
+//cmult_sv.h
+
 /*!\fn void multadd_real_vector_complex_scalar(int16_t *x,int16_t *alpha,int16_t *y,uint32_t N)
 This function performs componentwise multiplication and accumulation of a complex scalar and a real vector.
 @param x Vector input (Q1.15)
@@ -95,192 +97,14 @@ void multadd_complex_vector_real_scalar(int16_t *x,
                                         uint8_t zero_flag,
                                         uint32_t N);
 
-
-/*!\fn int32_t mult_cpx_vector(int16_t *x1,int16_t *x2,int16_t *y,uint32_t N,int32_t output_shift)
-This function performs optimized componentwise multiplication of two Q1.15 vectors in repeated format.
-
-@param x1 Input 1 in the format  |Re0  Im0 Re0 Im0|,......,|Re(N-1)  Im(N-1) Re(N-1) Im(N-1)|
-@param x2 Input 2 in the format  |Re0 -Im0 Im0 Re0|,......,|Re(N-1) -Im(N-1) Im(N-1) Re(N-1)|
-@param y  Output in the format  |Re0  Im0 Re0 Im0|,......,|Re(N-1)  Im(N-1) Re(N-1) Im(N-1)|
-@param N  Length of Vector WARNING: N must be a multiple of 8 (4x loop unrolling and two complex multiplies per cycle)
-@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!!
-
-The function implemented is : \f$\mathbf{y} = \mathbf{x_1}\odot\mathbf{x_2}\f$
-*/
-int32_t mult_cpx_vector(int16_t *x1,
-                        int16_t *x2,
-                        int16_t *y,
-                        uint32_t N,
-                        int32_t output_shift);
-
-/*!\fn int32_t mult_cpx_vector_norep(int16_t *x1,int16_t *x2,int16_t *y,uint32_t N,int32_t output_shift)
-This function performs optimized componentwise multiplication of two Q1.15 vectors with normal formatted output.
-
-@param x1 Input 1 in the format  |Re0  Im0 Re0 Im0|,......,|Re(N-1)  Im(N-1) Re(N-1) Im(N-1)|
-@param x2 Input 2 in the format  |Re0 -Im0 Im0 Re0|,......,|Re(N-1) -Im(N-1) Im(N-1) Re(N-1)|
-@param y  Output in the format  |Re0  Im0 Re1 Im1|,......,|Re(N-2)  Im(N-2) Re(N-1) Im(N-1)|
-@param N  Length of Vector WARNING: N must be a multiple of 8 (4x loop unrolling and two complex multiplies per cycle)
-@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!!
-
-The function implemented is : \f$\mathbf{y} = \mathbf{x_1}\odot\mathbf{x_2}\f$
-*/
-int32_t mult_cpx_vector_norep(int16_t *x1,
-                              int16_t *x2,
-                              int16_t *y,
-                              uint32_t N,
-                              int32_t output_shift);
-
-
-/*!\fn int32_t mult_cpx_vector_norep2(int16_t *x1,int16_t *x2,int16_t *y,uint32_t N,int32_t output_shift)
-This function performs optimized componentwise multiplication of two Q1.15 vectors with normal formatted output.
-
-@param x1 Input 1 in the format  |Re0  Im0 Re0 Im0|,......,|Re(N-1)  Im(N-1) Re(N-1) Im(N-1)|
-@param x2 Input 2 in the format  |Re0 -Im0 Im0 Re0|,......,|Re(N-1) -Im(N-1) Im(N-1) Re(N-1)|
-@param y  Output in the format  |Re0  Im0 Re1 Im1|,......,|Re(N-2)  Im(N-2) Re(N-1) Im(N-1)|
-@param N  Length of Vector WARNING: N must be a multiple of 8 (no unrolling and two complex multiplies per cycle)
-@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!!
-
-The function implemented is : \f$\mathbf{y} = \mathbf{x_1}\odot\mathbf{x_2}\f$
-*/
-int32_t mult_cpx_vector_norep2(int16_t *x1,
-                               int16_t *x2,
-                               int16_t *y,
-                               uint32_t N,
-                               int32_t output_shift);
-
-int32_t mult_cpx_vector_norep_conj(int16_t *x1,
-                                   int16_t *x2,
-                                   int16_t *y,
-                                   uint32_t N,
-                                   int32_t output_shift);
-
-int32_t mult_cpx_vector_norep_conj2(int16_t *x1,
-                                    int16_t *x2,
-                                    int16_t *y,
-                                    uint32_t N,
-                                    int32_t output_shift);
-
-/*!\fn int32_t mult_cpx_vector2(int16_t *x1,int16_t *x2,int16_t *y,uint32_t N,int32_t output_shift)
-This function performs optimized componentwise multiplication of two Q1.15 vectors.
-
-@param x1 Input 1 in the format  |Re0  Im0 Re0 Im0|,......,|Re(N-1)  Im(N-1) Re(N-1) Im(N-1)|
-@param x2 Input 2 in the format  |Re0 -Im0 Im0 Re0|,......,|Re(N-1) -Im(N-1) Im(N-1) Re(N-1)|
-@param y  Output in the format  |Re0  Im0 Re0 Im0|,......,|Re(N-1)  Im(N-1) Re(N-1) Im(N-1)|
-@param N  Length of Vector WARNING: N must be a multiple of 2 (2 complex multiplies per cycle)
-@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!!
-
-The function implemented is : \f$\mathbf{y} = \mathbf{x_1}\odot\mathbf{x_2}\f$
-*/
-int32_t mult_cpx_vector2(int16_t *x1,
-                         int16_t *x2,
-                         int16_t *y,
-                         uint32_t N,
-                         int32_t output_shift);
-
-/*!\fn int32_t mult_cpx_vector_add(int16_t *x1,int16_t *x2,int16_t *y,uint32_t N,int32_t output_shift)
-This function performs optimized componentwise multiplication of two Q1.15 vectors. The output IS ADDED TO y. WARNING: make sure that output_shift is set to the right value, so that the result of the multiplication has the comma at the same place as y.
-
-@param x1 Input 1 in the format  |Re0  Im0 Re0 Im0|,......,|Re(N-1)  Im(N-1) Re(N-1) Im(N-1)|
-@param x2 Input 2 in the format  |Re0 -Im0 Im0 Re0|,......,|Re(N-1) -Im(N-1) Im(N-1) Re(N-1)|
-@param y  Output in the format  |Re0  Im0 Re0 Im0|,......,|Re(N-1)  Im(N-1) Re(N-1) Im(N-1)|
-@param N  Length of Vector WARNING: N>=4
-@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!!
-
-The function implemented is : \f$\mathbf{y} += \mathbf{x_1}\odot\mathbf{x_2}\f$
-*/
-
-int32_t mult_cpx_vector_add(int16_t *x1,
-                            int16_t *x2,
-                            int16_t *y,
-                            uint32_t N,
-                            int32_t output_shift);
-
-
-int32_t mult_cpx_vector_h_add32(int16_t *x1,
-                                int16_t *x2,
-                                int16_t *y,
-                                uint32_t N,
-                                int16_t sign);
-
-int32_t mult_cpx_vector_add32(int16_t *x1,
-                              int16_t *x2,
-                              int16_t *y,
-                              uint32_t N);
-
-int32_t mult_vector32(int16_t *x1,
-                      int16_t *x2,
+int rotate_cpx_vector(int16_t *x,
+                      int16_t *alpha,
                       int16_t *y,
-                      uint32_t N);
-
-int32_t mult_vector32_scalar(int16_t *x1,
-                             int32_t x2,
-                             int16_t *y,
-                             uint32_t N);
+                      uint32_t N,
+                      uint16_t output_shift);
 
-int32_t mult_cpx_vector32_conj(int16_t *x,
-                               int16_t *y,
-                               uint32_t N);
 
-int32_t mult_cpx_vector32_real(int16_t *x1,
-                               int16_t *x2,
-                               int16_t *y,
-                               uint32_t N);
 
-int32_t shift_and_pack(int16_t *y,
-                       uint32_t N,
-                       int32_t output_shift);
-
-/*!\fn int32_t mult_cpx_vector_h(int16_t *x1,int16_t *x2,int16_t *y,uint32_t N,int32_t output_shift,int16_t sign)
-This function performs optimized componentwise multiplication of the vector x1 with the conjugate of the vector x2. The output IS ADDED TO y. WARNING: make sure that output_shift is set to the right value, so that the result of the multiplication has the comma at the same place as y.
-
-@param x1 Input 1 in the format  |Re0  Im0 Re0 Im0|,......,|Re(N-1)  Im(N-1) Re(N-1) Im(N-1)|
-@param x2 Input 2 in the format  |Re0  Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
-@param y  Output in the format  |Re0  Im0 Re0 Im0|,......,|Re(N-1)  Im(N-1) Re(N-1) Im(N-1)|
-@param N  Length of Vector (complex samples) WARNING: N>=4
-@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!!
-@param sign +1..add, -1..substract
-
-The function implemented is : \f$\mathbf{y} = \mathbf{y} + \mathbf{x_1}\odot\mathbf{x_2}^*\f$
-*/
-int32_t mult_cpx_vector_h(int16_t *x1,
-                          int16_t *x2,
-                          int16_t *y,
-                          uint32_t N,
-                          int32_t output_shift,
-                          int16_t sign);
-
-/*!\fn int32_t mult_cpx_matrix_h(int16_t *x1[2][2],int16_t *x2[2][2],int16_t *y[2][2],uint32_t N,uint16_t output_shift,int16_t hermitian)
-This function performs optimized componentwise matrix multiplication of the 2x2 matrices x1 with the 2x2 matrices x2. The output IS ADDED TO y (i.e. make sure y is initilized correctly). WARNING: make sure that output_shift is set to the right value, so that the result of the multiplication has the comma at the same place as y.
-
-@param x1 Input 1 in the format  |Re0  Im0 Re0 Im0|,......,|Re(N-1)  Im(N-1) Re(N-1) Im(N-1)|
-@param x2 Input 2 in the format  |Re0  Im0 Re0 Im0|,......,|Re(N-1) Im(N-1) Re(N-1) Im(N-1)|
-@param y  Output in the format  |Re0  Im0 Re0 Im0|,......,|Re(N-1)  Im(N-1) Re(N-1) Im(N-1)|
-@param N  Length of Vector (complex samples) WARNING: N>=4
-@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!!
-@param hermitian if !=0 the hermitian transpose is returned (i.e. A^H*B instead of A*B^H)
-*/
-int32_t mult_cpx_matrix_h(int16_t *x1[2][2],
-                          int16_t *x2[2][2],
-                          int16_t *y[2][2],
-                          uint32_t N,
-                          uint16_t output_shift,
-                          int16_t hermitian);
-
-
-/*!\fn int32_t mult_cpx_matrix_vector(int32_t *x1[2][2],int32_t *x2[2],int32_t *y[2],uint32_t N,uint16_t output_shift)
-This function performs optimized componentwise matrix-vector multiplication of the 2x2 matrices x1 with the 2x1 vectors x2. The output IS ADDED TO y (i.e. make sure y is initilized correctly). WARNING: make sure that output_shift is set to the right value, so that the result of the multiplication has the comma at the same place as y.
-
-@param x1 Input 1 in the format  |Re0  Im0 Re0 Im0|,......,|Re(N-1)  Im(N-1) Re(N-1) Im(N-1)|
-@param x2 Input 2 in the format  |Re0  -Im0 Im0 Re0|,......,|Re(N-1) -Im(N-1) Im(N-1) Re(N-1)|
-@param y  Output in the format  |Re0  Im0 Re0 Im0|,......,|Re(N-1)  Im(N-1) Re(N-1) Im(N-1)| WARNING: y must be different for x2
-@param N  Length of Vector (complex samples) WARNING: N>=4
-@param output_shift Number of bits to shift output down to Q1.15 (should be 15 for Q1.15 inputs) WARNING: log2_amp>0 can cause overflow!!
-*/
-int32_t mult_cpx_matrix_vector(int32_t *x1[2][2],
-                               int32_t *x2[2],
-                               int32_t *y[2],
-                               uint32_t N,
-                               uint16_t output_shift);
 
 /*!\fn void init_fft(uint16_t size,uint8_t logsize,uint16_t *rev)
 \brief Initialize the FFT engine for a given size
@@ -289,6 +113,25 @@ int32_t mult_cpx_matrix_vector(int32_t *x1[2][2],
 @param rev Pointer to bit-reversal permutation array
 */
 
+//cmult_vv.c
+/*!
+  Multiply elementwise the complex conjugate of x1 with x2. 
+  @param x1       - input 1    in the format  |Re0 Im0 Re1 Im1|,......,|Re(N-2)  Im(N-2) Re(N-1) Im(N-1)|
+              We assume x1 with a dinamic of 15 bit maximum
+  @param x2       - input 2    in the format  |Re0 Im0 Re1 Im1|,......,|Re(N-2)  Im(N-2) Re(N-1) Im(N-1)|
+              We assume x2 with a dinamic of 14 bit maximum
+  @param y        - output     in the format  |Re0 Im0 Re1 Im1|,......,|Re(N-2)  Im(N-2) Re(N-1) Im(N-1)|
+  @param N        - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
+  @param output_shift  - shift to be applied to generate output
+*/
+
+int mult_cpx_conj_vector(int16_t *x1,
+                         int16_t *x2,
+                         int16_t *y,
+                         uint32_t N,
+                         int output_shift);
+
+// lte_dfts.c
 void init_fft(uint16_t size,
               uint8_t logsize,
               uint16_t *rev);
@@ -313,7 +156,7 @@ This function performs optimized fixed-point radix-2 FFT/IFFT.
         );
 */
 
-void idft1536(int16_t *sigF,int16_t *sig);
+void idft1536(int16_t *sigF,int16_t *sig,int scale);
 
 void idft6144(int16_t *sigF,int16_t *sig);
 
@@ -325,7 +168,7 @@ void idft3072(int16_t *sigF,int16_t *sig);
 
 void idft24576(int16_t *sigF,int16_t *sig);
 
-void dft1536(int16_t *sigF,int16_t *sig);
+void dft1536(int16_t *sigF,int16_t *sig,int scale);
 
 void dft6144(int16_t *sigF,int16_t *sig);
 
@@ -355,6 +198,7 @@ int32_t rotate_cpx_vector(int16_t *x,
                           uint16_t output_shift);
 
 
+//cadd_sv.c
 
 /*!\fn int32_t add_cpx_vector(int16_t *x,int16_t *alpha,int16_t *y,uint32_t N)
 This function performs componentwise addition of a vector with a complex scalar.
diff --git a/openair1/PHY/TOOLS/lte_dfts.c b/openair1/PHY/TOOLS/lte_dfts.c
index c031d5d384d751e55e9b484cc3d86872589ccdd9..1bdcb3ad6022605bcf88564e87044d08e6664f52 100644
--- a/openair1/PHY/TOOLS/lte_dfts.c
+++ b/openair1/PHY/TOOLS/lte_dfts.c
@@ -5,7 +5,7 @@
     OpenAirInterface is free software: you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
+    (at your option) any lat_er version.
 
 
     OpenAirInterface is distributed in the hope that it will be useful,
@@ -45,21 +45,23 @@
 #define debug_msg
 #define ONE_OVER_SQRT2_Q15 23170
 
+
 #endif
 
+#define ONE_OVER_SQRT3_Q15 18919
 
 #include "PHY/sse_intrin.h"
 
 #define print_shorts(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7])
+#define print_shorts256(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7],(x)[8],(x)[9],(x)[10],(x)[11],(x)[12],(x)[13],(x)[14],(x)[15])
+
 #define print_ints(s,x) printf("%s %d %d %d %d\n",s,(x)[0],(x)[1],(x)[2],(x)[3])
 
-#ifdef AVX2
-static int16_t conjugatedft2[16] __attribute__((aligned(32))) = {1,1,1,1,1,1,1,1,-1,1,-1,1,-1,1,-1,1,-1,1};
-#endif
 
-static int16_t conjugatedft[8] __attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1} ;
+static int16_t conjugatedft[32] __attribute__((aligned(32))) = {-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1};
+
 
-static short reflip[8]  __attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
+static int16_t reflip[32]  __attribute__((aligned(32))) = {1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1};
 
 #if defined(__x86_64__) || defined(__i386__)
 static inline void cmac(__m128i a,__m128i b, __m128i *re32, __m128i *im32) __attribute__((always_inline));
@@ -94,15 +96,50 @@ static inline void cmacc(__m128i a,__m128i b, __m128i *re32, __m128i *im32)
   cmac_tmp    = _mm_sign_epi16(b,*(__m128i*)reflip);
   //  cmac_tmp    = _mm_shufflelo_epi16(b,_MM_SHUFFLE(2,3,0,1));
   //  cmac_tmp    = _mm_shufflehi_epi16(cmac_tmp,_MM_SHUFFLE(2,3,0,1));
-  cmac_tmp = _mm_shuffle_epi8(b,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2));
+  cmac_tmp = _mm_shuffle_epi8(cmac_tmp,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2));
   cmac_tmp_im32  = _mm_madd_epi16(cmac_tmp,a);
 
   *re32 = _mm_add_epi32(*re32,cmac_tmp_re32);
   *im32 = _mm_add_epi32(*im32,cmac_tmp_im32);
 }
 
+#ifdef __AVX2__
+static inline void cmac_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) __attribute__((always_inline));
+static inline void cmac_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32)
+{
+
+  __m256i cmac_tmp,cmac_tmp_re32,cmac_tmp_im32;
+  __m256i imshuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,19,18,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2);
+
+  cmac_tmp       = _mm256_sign_epi16(b,*(__m256i*)reflip);
+  cmac_tmp_re32  = _mm256_madd_epi16(a,cmac_tmp);
+
+  cmac_tmp       = _mm256_shuffle_epi8(b,imshuffle);
+  cmac_tmp_im32  = _mm256_madd_epi16(cmac_tmp,a);
+
+  *re32 = _mm256_add_epi32(*re32,cmac_tmp_re32);
+  *im32 = _mm256_add_epi32(*im32,cmac_tmp_im32);
+}
+
+static inline void cmacc_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) __attribute__((always_inline));
+static inline void cmacc_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32)
+{
+
+  __m256i cmac_tmp,cmac_tmp_re32,cmac_tmp_im32;
+  __m256i imshuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,19,18,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2);
+
+  cmac_tmp_re32   = _mm256_madd_epi16(a,b);
+
 
+  cmac_tmp        = _mm256_sign_epi16(b,*(__m256i*)reflip);
+  cmac_tmp        = _mm256_shuffle_epi8(b,imshuffle);
+  cmac_tmp_im32   = _mm256_madd_epi16(cmac_tmp,a);
 
+  *re32 = _mm256_add_epi32(*re32,cmac_tmp_re32);
+  *im32 = _mm256_add_epi32(*im32,cmac_tmp_im32);
+}
+
+#endif
 
 static inline void cmult(__m128i a,__m128i b, __m128i *re32, __m128i *im32) __attribute__((always_inline));
 
@@ -120,6 +157,24 @@ static inline void cmult(__m128i a,__m128i b, __m128i *re32, __m128i *im32)
 
 }
 
+#ifdef __AVX2__
+static inline void cmult_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) __attribute__((always_inline));
+
+static inline void cmult_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32)
+{
+
+  register __m256i mmtmpb;
+  __m256i const perm_mask = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2);
+
+  mmtmpb    = _mm256_sign_epi16(b,*(__m256i*)reflip);
+  *re32     = _mm256_madd_epi16(a,mmtmpb);
+  mmtmpb    = _mm256_shuffle_epi8(b,perm_mask);
+  *im32     = _mm256_madd_epi16(a,mmtmpb);
+
+}
+
+#endif
+
 static inline void cmultc(__m128i a,__m128i b, __m128i *re32, __m128i *im32) __attribute__((always_inline));
 
 static inline void cmultc(__m128i a,__m128i b, __m128i *re32, __m128i *im32)
@@ -134,6 +189,23 @@ static inline void cmultc(__m128i a,__m128i b, __m128i *re32, __m128i *im32)
 
 }
 
+#ifdef __AVX2__
+static inline void cmultc_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32) __attribute__((always_inline));
+
+static inline void cmultc_256(__m256i a,__m256i b, __m256i *re32, __m256i *im32)
+{
+
+  register __m256i mmtmpb;
+  __m256i const perm_mask = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2);
+
+  *re32     = _mm256_madd_epi16(a,b);
+  mmtmpb    = _mm256_sign_epi16(b,*(__m256i*)reflip);
+  mmtmpb    = _mm256_shuffle_epi8(mmtmpb,perm_mask);
+  *im32     = _mm256_madd_epi16(a,mmtmpb);
+
+}
+
+#endif
 
 static inline __m128i cpack(__m128i xre,__m128i xim) __attribute__((always_inline));
 
@@ -148,6 +220,21 @@ static inline __m128i cpack(__m128i xre,__m128i xim)
 
 }
 
+#ifdef __AVX2__
+static inline __m256i cpack_256(__m256i xre,__m256i xim) __attribute__((always_inline));
+
+static inline __m256i cpack_256(__m256i xre,__m256i xim)
+{
+
+  register __m256i cpack_tmp1,cpack_tmp2;
+
+  cpack_tmp1 = _mm256_unpacklo_epi32(xre,xim);
+  cpack_tmp2 = _mm256_unpackhi_epi32(xre,xim);
+  return(_mm256_packs_epi32(_mm256_srai_epi32(cpack_tmp1,15),_mm256_srai_epi32(cpack_tmp2,15)));
+
+}
+
+#endif
 
 static inline void packed_cmult(__m128i a,__m128i b, __m128i *c) __attribute__((always_inline));
 
@@ -160,6 +247,18 @@ static inline void packed_cmult(__m128i a,__m128i b, __m128i *c)
 
 }
 
+#ifdef __AVX2__
+static inline void packed_cmult_256(__m256i a,__m256i b, __m256i *c) __attribute__((always_inline));
+
+static inline void packed_cmult_256(__m256i a,__m256i b, __m256i *c)
+{
+
+  __m256i cre,cim;
+  cmult_256(a,b,&cre,&cim);
+  *c = cpack_256(cre,cim);
+
+}
+#endif
 
 static inline void packed_cmultc(__m128i a,__m128i b, __m128i *c) __attribute__((always_inline));
 
@@ -173,6 +272,20 @@ static inline void packed_cmultc(__m128i a,__m128i b, __m128i *c)
 
 }
 
+#ifdef __AVX2__
+static inline void packed_cmultc_256(__m256i a,__m256i b, __m256i *c) __attribute__((always_inline));
+
+static inline void packed_cmultc_256(__m256i a,__m256i b, __m256i *c)
+{
+
+  __m256i cre,cim;
+
+  cmultc_256(a,b,&cre,&cim);
+  *c = cpack_256(cre,cim);
+
+}
+#endif
+
 static inline __m128i packed_cmult2(__m128i a,__m128i b,__m128i b2) __attribute__((always_inline));
 
 static inline __m128i packed_cmult2(__m128i a,__m128i b,__m128i b2)
@@ -188,6 +301,23 @@ static inline __m128i packed_cmult2(__m128i a,__m128i b,__m128i b2)
 
 }
 
+#ifdef __AVX2__
+static inline __m256i packed_cmult2_256(__m256i a,__m256i b,__m256i b2) __attribute__((always_inline));
+
+static inline __m256i packed_cmult2_256(__m256i a,__m256i b,__m256i b2)
+{
+
+
+  register __m256i cre,cim;
+
+  cre       = _mm256_madd_epi16(a,b);
+  cim       = _mm256_madd_epi16(a,b2);
+
+  return(cpack_256(cre,cim));
+
+}
+#endif
+
 #elif defined (__arm__)
 static inline void cmac(int16x8_t a,int16x8_t b, int32x4_t *re32, int32x4_t *im32) __attribute__((always_inline));
 static inline void cmac(int16x8_t a,int16x8_t b, int32x4_t *re32, int32x4_t *im32)
@@ -344,15 +474,15 @@ static inline int16x8_t packed_cmult2(int16x8_t a,int16x8_t b,  int16x8_t b2)
 
 #endif
 
-static int16_t W0s[8]__attribute__((aligned(16))) = {32767,0,32767,0,32767,0,32767,0};
+static int16_t W0s[16]__attribute__((aligned(32))) = {32767,0,32767,0,32767,0,32767,0,32767,0,32767,0,32767,0,32767,0};
 
-static int16_t W13s[8]__attribute__((aligned(16))) = {-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378};
-static int16_t W23s[8]__attribute__((aligned(16))) = {-16384,28378,-16384,28378,-16384,28378,-16384,28378};
+static int16_t W13s[16]__attribute__((aligned(32))) = {-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378};
+static int16_t W23s[16]__attribute__((aligned(32))) = {-16384,28378,-16384,28378,-16384,28378,-16384,28378,-16384,28378,-16384,28378,-16384,28378,-16384,28378};
 
-static int16_t W15s[8]__attribute__((aligned(16))) = {10126,-31163,10126,-31163,10126,-31163,10126,-31163};
-static int16_t W25s[8]__attribute__((aligned(16))) = {-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260};
-static int16_t W35s[8]__attribute__((aligned(16))) = {-26510,19260,-26510,19260,-26510,19260,-26510,19260};
-static int16_t W45s[8]__attribute__((aligned(16))) = {10126,31163,10126,31163,10126,31163,10126,31163};
+static int16_t W15s[16]__attribute__((aligned(32))) = {10126,-31163,10126,-31163,10126,-31163,10126,-31163,10126,-31163,10126,-31163,10126,-31163,10126,-31163};
+static int16_t W25s[16]__attribute__((aligned(32))) = {-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260};
+static int16_t W35s[16]__attribute__((aligned(32))) = {-26510,19260,-26510,19260,-26510,19260,-26510,19260,-26510,19260,-26510,19260,-26510,19260,-26510,19260};
+static int16_t W45s[16]__attribute__((aligned(32))) = {10126,31163,10126,31163,10126,31163,10126,31163,10126,31163,10126,31163,10126,31163,10126,31163};
 
 #if defined(__x86_64__) || defined(__i386__)
 __m128i *W0 = (__m128i *)W0s;
@@ -362,6 +492,17 @@ __m128i *W15 = (__m128i *)W15s;
 __m128i *W25 = (__m128i *)W25s;
 __m128i *W35 = (__m128i *)W35s;
 __m128i *W45 = (__m128i *)W45s;
+
+#ifdef __AVX2__
+__m256i *W0_256 =  (__m256i *)W0s;
+__m256i *W13_256 = (__m256i *)W13s;
+__m256i *W23_256 = (__m256i *)W23s;
+__m256i *W15_256 = (__m256i *)W15s;
+__m256i *W25_256 = (__m256i *)W25s;
+__m256i *W35_256 = (__m256i *)W35s;
+__m256i *W45_256 = (__m256i *)W45s;
+#endif
+
 #elif defined(__arm__)
 int16x8_t *W0  = (int16x8_t *)W0s;
 int16x8_t *W13 = (int16x8_t *)W13s;
@@ -374,7 +515,7 @@ int16x8_t *W45 = (int16x8_t *)W45s;
 static int16_t dft_norm_table[16] = {9459,  //12
                                      6689,//24
                                      5461,//36
-                                     4729,//48
+                                     4729,//482
                                      4230,//60
                                      23170,//72
                                      3344,//96
@@ -417,6 +558,36 @@ static inline void bfly2(__m128i *x0, __m128i *x1,__m128i *y0, __m128i *y1,__m12
   *y1 = _mm_packs_epi32(bfly2_tmp1,bfly2_tmp2);
 }
 
+#ifdef __AVX2__
+
+static inline void bfly2_256(__m256i *x0, __m256i *x1,__m256i *y0, __m256i *y1,__m256i *tw)__attribute__((always_inline));
+
+static inline void bfly2_256(__m256i *x0, __m256i *x1,__m256i *y0, __m256i *y1,__m256i *tw)
+{
+
+  __m256i x0r_2,x0i_2,x1r_2,x1i_2,dy0r,dy1r,dy0i,dy1i;
+  __m256i bfly2_tmp1,bfly2_tmp2;
+
+  cmult_256(*(x0),*(W0_256),&x0r_2,&x0i_2);
+  cmult_256(*(x1),*(tw),&x1r_2,&x1i_2);
+
+  dy0r = _mm256_srai_epi32(_mm256_add_epi32(x0r_2,x1r_2),15);
+  dy1r = _mm256_srai_epi32(_mm256_sub_epi32(x0r_2,x1r_2),15);
+  dy0i = _mm256_srai_epi32(_mm256_add_epi32(x0i_2,x1i_2),15);
+  //  printf("y0i %d\n",((int16_t *)y0i)[0]);
+  dy1i = _mm256_srai_epi32(_mm256_sub_epi32(x0i_2,x1i_2),15);
+
+  bfly2_tmp1 = _mm256_unpacklo_epi32(dy0r,dy0i);
+  bfly2_tmp2 = _mm256_unpackhi_epi32(dy0r,dy0i);
+  *y0 = _mm256_packs_epi32(bfly2_tmp1,bfly2_tmp2);
+
+  bfly2_tmp1 = _mm256_unpacklo_epi32(dy1r,dy1i);
+  bfly2_tmp2 = _mm256_unpackhi_epi32(dy1r,dy1i);
+  *y1 = _mm256_packs_epi32(bfly2_tmp1,bfly2_tmp2);
+}
+
+#endif
+
 #elif defined(__arm__)
 
 static inline void bfly2(int16x8_t *x0, int16x8_t *x1,int16x8_t *y0, int16x8_t *y1,int16x8_t *tw)__attribute__((always_inline));
@@ -464,21 +635,56 @@ static inline void bfly2_tw1(int16x8_t *x0, int16x8_t *x1, int16x8_t *y0, int16x
 
 }
 #endif
-
+ 
 #if defined(__x86_64__) || defined(__i386__)
+
+
+
 static inline void bfly2_16(__m128i *x0, __m128i *x1, __m128i *y0, __m128i *y1, __m128i *tw, __m128i *twb)__attribute__((always_inline));
 
 static inline void bfly2_16(__m128i *x0, __m128i *x1, __m128i *y0, __m128i *y1, __m128i *tw, __m128i *twb)
 {
 
-  register __m128i x1t;
+  //  register __m128i x1t;
+  __m128i x1t;
 
   x1t = packed_cmult2(*(x1),*(tw),*(twb));
-
+  /*
+  print_shorts("x0",(int16_t*)x0);
+  print_shorts("x1",(int16_t*)x1);
+  print_shorts("tw",(int16_t*)tw);
+  print_shorts("twb",(int16_t*)twb);
+  print_shorts("x1t",(int16_t*)&x1t);*/
   *y0  = _mm_adds_epi16(*x0,x1t);
   *y1  = _mm_subs_epi16(*x0,x1t);
+  /*  print_shorts("y0",(int16_t*)y0);
+      print_shorts("y1",(int16_t*)y1);*/
+}
+
+#ifdef __AVX2__
+
+static inline void bfly2_16_256(__m256i *x0, __m256i *x1, __m256i *y0, __m256i *y1, __m256i *tw, __m256i *twb)__attribute__((always_inline));
+
+static inline void bfly2_16_256(__m256i *x0, __m256i *x1, __m256i *y0, __m256i *y1, __m256i *tw, __m256i *twb)
+{
 
+  //  register __m256i x1t;
+  __m256i x1t;
+
+  x1t = packed_cmult2_256(*(x1),*(tw),*(twb));
+  /*
+  print_shorts256("x0",(int16_t*)x0);
+  print_shorts256("x1",(int16_t*)x1);
+  print_shorts256("tw",(int16_t*)tw);
+  print_shorts256("twb",(int16_t*)twb);
+  print_shorts256("x1t",(int16_t*)&x1t);*/
+  *y0  = _mm256_adds_epi16(*x0,x1t);
+  *y1  = _mm256_subs_epi16(*x0,x1t);
+  
+  /*print_shorts256("y0",(int16_t*)y0);
+    print_shorts256("y1",(int16_t*)y1);*/
 }
+#endif
 
 
 #elif defined(__arm__)
@@ -488,15 +694,10 @@ static inline void bfly2_16(int16x8_t *x0, int16x8_t *x1, int16x8_t *y0, int16x8
 static inline void bfly2_16(int16x8_t *x0, int16x8_t *x1, int16x8_t *y0, int16x8_t *y1, int16x8_t *tw, int16x8_t *twb)
 {
 
-  register int16x8_t x1t;
-
-  x1t = packed_cmult2(*(x1),*(tw),*(twb));
-
-  *y0  = vqaddq_s16(*x0,x1t);
-  *y1  = vqsubq_s16(*x0,x1t);
+  *y0  = vqaddq_s16(*x0,*x1);
+  *y1  = vqsubq_s16(*x0,*x1);
 
 }
-
 #endif
 
 #if defined(__x86_64__) || defined(__i386__)
@@ -525,6 +726,35 @@ static inline void ibfly2(__m128i *x0, __m128i *x1,__m128i *y0, __m128i *y1,__m1
   bfly2_tmp2 = _mm_unpackhi_epi32(dy1r,dy1i);
   *y1 = _mm_packs_epi32(bfly2_tmp1,bfly2_tmp2);
 }
+
+#ifdef __AVX2__
+static inline void ibfly2_256(__m256i *x0, __m256i *x1,__m256i *y0, __m256i *y1,__m256i *tw)__attribute__((always_inline));
+
+static inline void ibfly2_256(__m256i *x0, __m256i *x1,__m256i *y0, __m256i *y1,__m256i *tw)
+{
+
+  __m256i x0r_2,x0i_2,x1r_2,x1i_2,dy0r,dy1r,dy0i,dy1i;
+  __m256i bfly2_tmp1,bfly2_tmp2;
+
+  cmultc_256(*(x0),*(W0_256),&x0r_2,&x0i_2);
+  cmultc_256(*(x1),*(tw),&x1r_2,&x1i_2);
+
+  dy0r = _mm256_srai_epi32(_mm256_add_epi32(x0r_2,x1r_2),15);
+  dy1r = _mm256_srai_epi32(_mm256_sub_epi32(x0r_2,x1r_2),15);
+  dy0i = _mm256_srai_epi32(_mm256_add_epi32(x0i_2,x1i_2),15);
+  //  printf("y0i %d\n",((int16_t *)y0i)[0]);
+  dy1i = _mm256_srai_epi32(_mm256_sub_epi32(x0i_2,x1i_2),15);
+
+  bfly2_tmp1 = _mm256_unpacklo_epi32(dy0r,dy0i);
+  bfly2_tmp2 = _mm256_unpackhi_epi32(dy0r,dy0i);
+  *y0 = _mm256_packs_epi32(bfly2_tmp1,bfly2_tmp2);
+
+  bfly2_tmp1 = _mm256_unpacklo_epi32(dy1r,dy1i);
+  bfly2_tmp2 = _mm256_unpackhi_epi32(dy1r,dy1i);
+  *y1 = _mm256_packs_epi32(bfly2_tmp1,bfly2_tmp2);
+}
+#endif
+
 #elif defined(__arm__)
 static inline void ibfly2(int16x8_t *x0, int16x8_t *x1,int16x8_t *y0, int16x8_t *y1,int16x8_t *tw)
 {
@@ -577,6 +807,33 @@ static inline void bfly3(__m128i *x0,__m128i *x1,__m128i *x2,
   *(y2) = _mm_adds_epi16(*(x0),*(y2));
 }
 
+#ifdef __AVX2__
+
+static inline void bfly3_256(__m256i *x0,__m256i *x1,__m256i *x2,
+			     __m256i *y0,__m256i *y1,__m256i *y2,
+			     __m256i *tw1,__m256i *tw2) __attribute__((always_inline));
+
+static inline void bfly3_256(__m256i *x0,__m256i *x1,__m256i *x2,
+			     __m256i *y0,__m256i *y1,__m256i *y2,
+			     __m256i *tw1,__m256i *tw2)
+{ 
+
+  __m256i tmpre,tmpim,x1_2,x2_2;
+
+  packed_cmult_256(*(x1),*(tw1),&x1_2);
+  packed_cmult_256(*(x2),*(tw2),&x2_2);
+  *(y0)  = _mm256_adds_epi16(*(x0),_mm256_adds_epi16(x1_2,x2_2));
+  cmult_256(x1_2,*(W13_256),&tmpre,&tmpim);
+  cmac_256(x2_2,*(W23_256),&tmpre,&tmpim);
+  *(y1) = cpack_256(tmpre,tmpim);
+  *(y1) = _mm256_adds_epi16(*(x0),*(y1));
+  cmult_256(x1_2,*(W23_256),&tmpre,&tmpim);
+  cmac_256(x2_2,*(W13_256),&tmpre,&tmpim);
+  *(y2) = cpack_256(tmpre,tmpim);
+  *(y2) = _mm256_adds_epi16(*(x0),*(y2));
+}
+#endif
+
 #elif defined(__arm__)
 static inline void bfly3(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,
                          int16x8_t *y0,int16x8_t *y1,int16x8_t *y2,
@@ -630,6 +887,33 @@ static inline void ibfly3(__m128i *x0,__m128i *x1,__m128i *x2,
   *(y2) = _mm_adds_epi16(*(x0),*(y2));
 }
 
+#ifdef __AVX2__
+
+static inline void ibfly3_256(__m256i *x0,__m256i *x1,__m256i *x2,
+			      __m256i *y0,__m256i *y1,__m256i *y2,
+			      __m256i *tw1,__m256i *tw2) __attribute__((always_inline));
+
+static inline void ibfly3_256(__m256i *x0,__m256i *x1,__m256i *x2,
+			      __m256i *y0,__m256i *y1,__m256i *y2,
+			      __m256i *tw1,__m256i *tw2)
+{ 
+
+  __m256i tmpre,tmpim,x1_2,x2_2;
+
+  packed_cmultc_256(*(x1),*(tw1),&x1_2);
+  packed_cmultc_256(*(x2),*(tw2),&x2_2);
+  *(y0)  = _mm256_adds_epi16(*(x0),_mm256_adds_epi16(x1_2,x2_2));
+  cmultc_256(x1_2,*(W13_256),&tmpre,&tmpim);
+  cmacc_256(x2_2,*(W23_256),&tmpre,&tmpim);
+  *(y1) = cpack_256(tmpre,tmpim);
+  *(y1) = _mm256_adds_epi16(*(x0),*(y1));
+  cmultc_256(x1_2,*(W23_256),&tmpre,&tmpim);
+  cmacc_256(x2_2,*(W13_256),&tmpre,&tmpim);
+  *(y2) = cpack_256(tmpre,tmpim);
+  *(y2) = _mm256_adds_epi16(*(x0),*(y2));
+}
+#endif
+
 #elif defined(__arm__)
 static inline void ibfly3(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,
 			  int16x8_t *y0,int16x8_t *y1,int16x8_t *y2,
@@ -677,6 +961,30 @@ static inline void bfly3_tw1(__m128i *x0,__m128i *x1,__m128i *x2,
   *(y2) = cpack(tmpre,tmpim);
   *(y2) = _mm_adds_epi16(*(x0),*(y2));
 }
+
+#ifdef __AVX2__
+
+static inline void bfly3_tw1_256(__m256i *x0,__m256i *x1,__m256i *x2,
+				 __m256i *y0,__m256i *y1,__m256i *y2) __attribute__((always_inline));
+
+static inline void bfly3_tw1_256(__m256i *x0,__m256i *x1,__m256i *x2,
+				 __m256i *y0,__m256i *y1,__m256i *y2)
+{
+
+  __m256i tmpre,tmpim;
+
+  *(y0) = _mm256_adds_epi16(*(x0),_mm256_adds_epi16(*(x1),*(x2)));
+  cmult_256(*(x1),*(W13_256),&tmpre,&tmpim);
+  cmac_256(*(x2),*(W23_256),&tmpre,&tmpim);
+  *(y1) = cpack_256(tmpre,tmpim);
+  *(y1) = _mm256_adds_epi16(*(x0),*(y1));
+  cmult_256(*(x1),*(W23_256),&tmpre,&tmpim);
+  cmac_256(*(x2),*(W13_256),&tmpre,&tmpim);
+  *(y2) = cpack_256(tmpre,tmpim);
+  *(y2) = _mm256_adds_epi16(*(x0),*(y2));
+}
+#endif
+
 #elif defined(__arm__)
 static inline void bfly3_tw1(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,
                              int16x8_t *y0,int16x8_t *y1,int16x8_t *y2) __attribute__((always_inline));
@@ -743,6 +1051,48 @@ static inline void bfly4(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3,
   *(y3) = _mm_add_epi16(*(x0),cpack(dy3r,dy3i));
 }
 
+#ifdef __AVX2__
+static inline void bfly4_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3,
+			     __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3,
+			     __m256i *tw1,__m256i *tw2,__m256i *tw3)__attribute__((always_inline));
+
+static inline void bfly4_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3,
+			     __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3,
+			     __m256i *tw1,__m256i *tw2,__m256i *tw3)
+{
+
+  __m256i x1r_2,x1i_2,x2r_2,x2i_2,x3r_2,x3i_2,dy0r,dy0i,dy1r,dy1i,dy2r,dy2i,dy3r,dy3i;
+
+  //  cmult(*(x0),*(W0),&x0r_2,&x0i_2);
+  cmult_256(*(x1),*(tw1),&x1r_2,&x1i_2);
+  cmult_256(*(x2),*(tw2),&x2r_2,&x2i_2);
+  cmult_256(*(x3),*(tw3),&x3r_2,&x3i_2);
+  //  dy0r = _mm_add_epi32(x0r_2,_mm_add_epi32(x1r_2,_mm_add_epi32(x2r_2,x3r_2)));
+  //  dy0i = _mm_add_epi32(x0i_2,_mm_add_epi32(x1i_2,_mm_add_epi32(x2i_2,x3i_2)));
+  //  *(y0)  = cpack(dy0r,dy0i);
+  dy0r = _mm256_add_epi32(x1r_2,_mm256_add_epi32(x2r_2,x3r_2));
+  dy0i = _mm256_add_epi32(x1i_2,_mm256_add_epi32(x2i_2,x3i_2));
+  *(y0)  = _mm256_add_epi16(*(x0),cpack_256(dy0r,dy0i));
+  //  dy1r = _mm_add_epi32(x0r_2,_mm_sub_epi32(x1i_2,_mm_add_epi32(x2r_2,x3i_2)));
+  //  dy1i = _mm_sub_epi32(x0i_2,_mm_add_epi32(x1r_2,_mm_sub_epi32(x2i_2,x3r_2)));
+  //  *(y1)  = cpack(dy1r,dy1i);
+  dy1r = _mm256_sub_epi32(x1i_2,_mm256_add_epi32(x2r_2,x3i_2));
+  dy1i = _mm256_sub_epi32(_mm256_sub_epi32(x3r_2,x2i_2),x1r_2);
+  *(y1)  = _mm256_add_epi16(*(x0),cpack_256(dy1r,dy1i));
+  //  dy2r = _mm_sub_epi32(x0r_2,_mm_sub_epi32(x1r_2,_mm_sub_epi32(x2r_2,x3r_2)));
+  //  dy2i = _mm_sub_epi32(x0i_2,_mm_sub_epi32(x1i_2,_mm_sub_epi32(x2i_2,x3i_2)));
+  //  *(y2)  = cpack(dy2r,dy2i);
+  dy2r = _mm256_sub_epi32(_mm256_sub_epi32(x2r_2,x3r_2),x1r_2);
+  dy2i = _mm256_sub_epi32(_mm256_sub_epi32(x2i_2,x3i_2),x1i_2);
+  *(y2)  = _mm256_add_epi16(*(x0),cpack_256(dy2r,dy2i));
+  //  dy3r = _mm_sub_epi32(x0r_2,_mm_add_epi32(x1i_2,_mm_sub_epi32(x2r_2,x3i_2)));
+  //  dy3i = _mm_add_epi32(x0i_2,_mm_sub_epi32(x1r_2,_mm_add_epi32(x2i_2,x3r_2)));
+  //  *(y3) = cpack(dy3r,dy3i);
+  dy3r = _mm256_sub_epi32(_mm256_sub_epi32(x3i_2,x2r_2),x1i_2);
+  dy3i = _mm256_sub_epi32(x1r_2,_mm256_add_epi32(x2i_2,x3r_2));
+  *(y3) = _mm256_add_epi16(*(x0),cpack_256(dy3r,dy3i));
+}
+#endif
 #elif defined(__arm__)
 static inline void bfly4(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3,
                          int16x8_t *y0,int16x8_t *y1,int16x8_t *y2,int16x8_t *y3,
@@ -818,6 +1168,39 @@ static inline void ibfly4(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3,
   *(y1) = _mm_add_epi16(*(x0),cpack(dy1r,dy1i));
 }
 
+#ifdef __AVX2__
+
+static inline void ibfly4_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3,
+			      __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3,
+			      __m256i *tw1,__m256i *tw2,__m256i *tw3)__attribute__((always_inline));
+
+static inline void ibfly4_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3,
+			      __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3,
+			      __m256i *tw1,__m256i *tw2,__m256i *tw3)
+{
+
+  __m256i x1r_2,x1i_2,x2r_2,x2i_2,x3r_2,x3i_2,dy0r,dy0i,dy1r,dy1i,dy2r,dy2i,dy3r,dy3i;
+
+
+  cmultc_256(*(x1),*(tw1),&x1r_2,&x1i_2);
+  cmultc_256(*(x2),*(tw2),&x2r_2,&x2i_2);
+  cmultc_256(*(x3),*(tw3),&x3r_2,&x3i_2);
+
+  dy0r = _mm256_add_epi32(x1r_2,_mm256_add_epi32(x2r_2,x3r_2));
+  dy0i = _mm256_add_epi32(x1i_2,_mm256_add_epi32(x2i_2,x3i_2));
+  *(y0)  = _mm256_add_epi16(*(x0),cpack_256(dy0r,dy0i));
+  dy3r = _mm256_sub_epi32(x1i_2,_mm256_add_epi32(x2r_2,x3i_2));
+  dy3i = _mm256_sub_epi32(_mm256_sub_epi32(x3r_2,x2i_2),x1r_2);
+  *(y3)  = _mm256_add_epi16(*(x0),cpack_256(dy3r,dy3i));
+  dy2r = _mm256_sub_epi32(_mm256_sub_epi32(x2r_2,x3r_2),x1r_2);
+  dy2i = _mm256_sub_epi32(_mm256_sub_epi32(x2i_2,x3i_2),x1i_2);
+  *(y2)  = _mm256_add_epi16(*(x0),cpack_256(dy2r,dy2i));
+  dy1r = _mm256_sub_epi32(_mm256_sub_epi32(x3i_2,x2r_2),x1i_2);
+  dy1i = _mm256_sub_epi32(x1r_2,_mm256_add_epi32(x2i_2,x3r_2));
+  *(y1) = _mm256_add_epi16(*(x0),cpack_256(dy1r,dy1i));
+}
+
+#endif
 #elif defined(__arm__)
 
 static inline void ibfly4(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3,
@@ -888,6 +1271,32 @@ static inline void bfly4_tw1(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3,
   */
 }
 
+#ifdef __AVX2__
+
+static inline void bfly4_tw1_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3,
+				 __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3)__attribute__((always_inline));
+
+static inline void bfly4_tw1_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3,
+				 __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3)
+{
+  register __m256i x1_flip,x3_flip,x02t,x13t;
+  register __m256i complex_shuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2);
+
+  x02t    = _mm256_adds_epi16(*(x0),*(x2));
+  x13t    = _mm256_adds_epi16(*(x1),*(x3));
+  *(y0)   = _mm256_adds_epi16(x02t,x13t);
+  *(y2)   = _mm256_subs_epi16(x02t,x13t);
+  x1_flip = _mm256_sign_epi16(*(x1),*(__m256i*)conjugatedft);
+  x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle);
+  x3_flip = _mm256_sign_epi16(*(x3),*(__m256i*)conjugatedft);
+  x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle);
+  x02t    = _mm256_subs_epi16(*(x0),*(x2));
+  x13t    = _mm256_subs_epi16(x1_flip,x3_flip);
+  *(y1)   = _mm256_adds_epi16(x02t,x13t);  // x0 + x1f - x2 - x3f
+  *(y3)   = _mm256_subs_epi16(x02t,x13t);  // x0 - x1f - x2 + x3f
+}
+#endif
+
 #elif defined(__arm__)
 
 static inline void bfly4_tw1(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3,
@@ -1005,6 +1414,48 @@ static inline void bfly4_16(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3,
 
 }
 
+#ifdef __AVX2__
+static inline void bfly4_16_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3,
+				__m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3,
+				__m256i *tw1,__m256i *tw2,__m256i *tw3,
+				__m256i *tw1b,__m256i *tw2b,__m256i *tw3b)__attribute__((always_inline));
+
+static inline void bfly4_16_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3,
+				__m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3,
+				__m256i *tw1,__m256i *tw2,__m256i *tw3,
+				__m256i *tw1b,__m256i *tw2b,__m256i *tw3b)
+{
+
+  register __m256i x1t,x2t,x3t,x02t,x13t;
+  register __m256i x1_flip,x3_flip;
+  register __m256i complex_shuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2);
+
+  // each input xi is assumed to be to consecutive vectors xi0 xi1 on which to perform the 8 butterflies
+  // [xi00 xi01 xi02 xi03 xi10 xi20 xi30 xi40]
+  // each output yi is the same
+
+  x1t = packed_cmult2_256(*(x1),*(tw1),*(tw1b));
+  x2t = packed_cmult2_256(*(x2),*(tw2),*(tw2b));
+  x3t = packed_cmult2_256(*(x3),*(tw3),*(tw3b));
+
+  x02t  = _mm256_adds_epi16(*(x0),x2t);
+  x13t  = _mm256_adds_epi16(x1t,x3t);
+  *(y0)   = _mm256_adds_epi16(x02t,x13t);
+  *(y2)   = _mm256_subs_epi16(x02t,x13t);
+
+  x1_flip = _mm256_sign_epi16(x1t,*(__m256i*)conjugatedft);
+  x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle);
+  x3_flip = _mm256_sign_epi16(x3t,*(__m256i*)conjugatedft);
+  x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle);
+  x02t  = _mm256_subs_epi16(*(x0),x2t);
+  x13t  = _mm256_subs_epi16(x1_flip,x3_flip);
+  *(y1)   = _mm256_adds_epi16(x02t,x13t);  // x0 + x1f - x2 - x3f
+  *(y3)   = _mm256_subs_epi16(x02t,x13t);  // x0 - x1f - x2 + x3f
+
+}
+
+#endif
+
 #elif defined(__arm__)
 
 static inline void bfly4_16(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3,
@@ -1089,6 +1540,47 @@ static inline void ibfly4_16(__m128i *x0,__m128i *x1,__m128i *x2,__m128i *x3,
 
 }
 
+#ifdef __AVX2__
+static inline void ibfly4_16_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3,
+				 __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3,
+				 __m256i *tw1,__m256i *tw2,__m256i *tw3,
+				 __m256i *tw1b,__m256i *tw2b,__m256i *tw3b)__attribute__((always_inline));
+
+static inline void ibfly4_16_256(__m256i *x0,__m256i *x1,__m256i *x2,__m256i *x3,
+				 __m256i *y0,__m256i *y1,__m256i *y2,__m256i *y3,
+				 __m256i *tw1,__m256i *tw2,__m256i *tw3,
+				 __m256i *tw1b,__m256i *tw2b,__m256i *tw3b)
+{
+
+  register __m256i x1t,x2t,x3t,x02t,x13t;
+  register __m256i x1_flip,x3_flip;
+  register __m256i complex_shuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2);
+
+  // each input xi is assumed to be to consecutive vectors xi0 xi1 on which to perform the 8 butterflies
+  // [xi00 xi01 xi02 xi03 xi10 xi20 xi30 xi40]
+  // each output yi is the same
+
+  x1t = packed_cmult2_256(*(x1),*(tw1),*(tw1b));
+  x2t = packed_cmult2_256(*(x2),*(tw2),*(tw2b));
+  x3t = packed_cmult2_256(*(x3),*(tw3),*(tw3b));
+
+  x02t  = _mm256_adds_epi16(*(x0),x2t);
+  x13t  = _mm256_adds_epi16(x1t,x3t);
+  *(y0)   = _mm256_adds_epi16(x02t,x13t);
+  *(y2)   = _mm256_subs_epi16(x02t,x13t);
+
+  x1_flip = _mm256_sign_epi16(x1t,*(__m256i*)conjugatedft);
+  x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle);
+  x3_flip = _mm256_sign_epi16(x3t,*(__m256i*)conjugatedft);
+  x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle);
+  x02t  = _mm256_subs_epi16(*(x0),x2t);
+  x13t  = _mm256_subs_epi16(x1_flip,x3_flip);
+  *(y3)   = _mm256_adds_epi16(x02t,x13t);  // x0 + x1f - x2 - x3f
+  *(y1)   = _mm256_subs_epi16(x02t,x13t);  // x0 - x1f - x2 + x3f
+
+}
+#endif
+
 #elif defined(__arm__)
 static inline void ibfly4_16(int16x8_t *x0,int16x8_t *x1,int16x8_t *x2,int16x8_t *x3,
 			     int16x8_t *y0,int16x8_t *y1,int16x8_t *y2,int16x8_t *y3,
@@ -1173,6 +1665,59 @@ static inline void bfly5(__m128i *x0, __m128i *x1, __m128i *x2, __m128i *x3,__m1
 
 }
 
+#ifdef __AVX2__
+
+static inline void bfly5_256(__m256i *x0, __m256i *x1, __m256i *x2, __m256i *x3,__m256i *x4,
+			     __m256i *y0, __m256i *y1, __m256i *y2, __m256i *y3,__m256i *y4,
+			     __m256i *tw1,__m256i *tw2,__m256i *tw3,__m256i *tw4)__attribute__((always_inline));
+
+static inline void bfly5_256(__m256i *x0, __m256i *x1, __m256i *x2, __m256i *x3,__m256i *x4,
+			     __m256i *y0, __m256i *y1, __m256i *y2, __m256i *y3,__m256i *y4,
+			     __m256i *tw1,__m256i *tw2,__m256i *tw3,__m256i *tw4)
+{
+
+
+
+  __m256i x1_2,x2_2,x3_2,x4_2,tmpre,tmpim;
+
+  packed_cmult_256(*(x1),*(tw1),&x1_2);
+  packed_cmult_256(*(x2),*(tw2),&x2_2);
+  packed_cmult_256(*(x3),*(tw3),&x3_2);
+  packed_cmult_256(*(x4),*(tw4),&x4_2);
+
+  *(y0)  = _mm256_adds_epi16(*(x0),_mm256_adds_epi16(x1_2,_mm256_adds_epi16(x2_2,_mm256_adds_epi16(x3_2,x4_2))));
+  cmult_256(x1_2,*(W15_256),&tmpre,&tmpim);
+  cmac_256(x2_2,*(W25_256),&tmpre,&tmpim);
+  cmac_256(x3_2,*(W35_256),&tmpre,&tmpim);
+  cmac_256(x4_2,*(W45_256),&tmpre,&tmpim);
+  *(y1) = cpack_256(tmpre,tmpim);
+  *(y1) = _mm256_adds_epi16(*(x0),*(y1));
+
+  cmult_256(x1_2,*(W25_256),&tmpre,&tmpim);
+  cmac_256(x2_2,*(W45_256),&tmpre,&tmpim);
+  cmac_256(x3_2,*(W15_256),&tmpre,&tmpim);
+  cmac_256(x4_2,*(W35_256),&tmpre,&tmpim);
+  *(y2) = cpack_256(tmpre,tmpim);
+  *(y2) = _mm256_adds_epi16(*(x0),*(y2));
+
+  cmult_256(x1_2,*(W35_256),&tmpre,&tmpim);
+  cmac_256(x2_2,*(W15_256),&tmpre,&tmpim);
+  cmac_256(x3_2,*(W45_256),&tmpre,&tmpim);
+  cmac_256(x4_2,*(W25_256),&tmpre,&tmpim);
+  *(y3) = cpack_256(tmpre,tmpim);
+  *(y3) = _mm256_adds_epi16(*(x0),*(y3));
+
+  cmult_256(x1_2,*(W45_256),&tmpre,&tmpim);
+  cmac_256(x2_2,*(W35_256),&tmpre,&tmpim);
+  cmac_256(x3_2,*(W25_256),&tmpre,&tmpim);
+  cmac_256(x4_2,*(W15_256),&tmpre,&tmpim);
+  *(y4) = cpack_256(tmpre,tmpim);
+  *(y4) = _mm256_adds_epi16(*(x0),*(y4));
+
+
+}
+#endif
+
 #elif defined(__arm__)
 static inline void bfly5(int16x8_t *x0, int16x8_t *x1, int16x8_t *x2, int16x8_t *x3,int16x8_t *x4,
                          int16x8_t *y0, int16x8_t *y1, int16x8_t *y2, int16x8_t *y3,int16x8_t *y4,
@@ -1265,6 +1810,43 @@ static inline void bfly5_tw1(__m128i *x0, __m128i *x1, __m128i *x2, __m128i *x3,
   *(y4) = _mm_adds_epi16(*(x0),*(y4));
 }
 
+#ifdef __AVX2__
+static inline void bfly5_tw1_256(__m256i *x0, __m256i *x1, __m256i *x2, __m256i *x3,__m256i *x4,
+				 __m256i *y0, __m256i *y1, __m256i *y2, __m256i *y3,__m256i *y4) __attribute__((always_inline));
+
+static inline void bfly5_tw1_256(__m256i *x0, __m256i *x1, __m256i *x2, __m256i *x3,__m256i *x4,
+				 __m256i *y0, __m256i *y1, __m256i *y2, __m256i *y3,__m256i *y4)
+{
+
+  __m256i tmpre,tmpim;
+
+  *(y0) = _mm256_adds_epi16(*(x0),_mm256_adds_epi16(*(x1),_mm256_adds_epi16(*(x2),_mm256_adds_epi16(*(x3),*(x4)))));
+  cmult_256(*(x1),*(W15_256),&tmpre,&tmpim);
+  cmac_256(*(x2),*(W25_256),&tmpre,&tmpim);
+  cmac_256(*(x3),*(W35_256),&tmpre,&tmpim);
+  cmac_256(*(x4),*(W45_256),&tmpre,&tmpim);
+  *(y1) = cpack_256(tmpre,tmpim);
+  *(y1) = _mm256_adds_epi16(*(x0),*(y1));
+  cmult_256(*(x1),*(W25_256),&tmpre,&tmpim);
+  cmac_256(*(x2),*(W45_256),&tmpre,&tmpim);
+  cmac_256(*(x3),*(W15_256),&tmpre,&tmpim);
+  cmac_256(*(x4),*(W35_256),&tmpre,&tmpim);
+  *(y2) = cpack_256(tmpre,tmpim);
+  *(y2) = _mm256_adds_epi16(*(x0),*(y2));
+  cmult_256(*(x1),*(W35_256),&tmpre,&tmpim);
+  cmac_256(*(x2),*(W15_256),&tmpre,&tmpim);
+  cmac_256(*(x3),*(W45_256),&tmpre,&tmpim);
+  cmac_256(*(x4),*(W25_256),&tmpre,&tmpim);
+  *(y3) = cpack_256(tmpre,tmpim);
+  *(y3) = _mm256_adds_epi16(*(x0),*(y3));
+  cmult_256(*(x1),*(W45_256),&tmpre,&tmpim);
+  cmac_256(*(x2),*(W35_256),&tmpre,&tmpim);
+  cmac_256(*(x3),*(W25_256),&tmpre,&tmpim);
+  cmac_256(*(x4),*(W15_256),&tmpre,&tmpim);
+  *(y4) = cpack_256(tmpre,tmpim);
+  *(y4) = _mm256_adds_epi16(*(x0),*(y4));
+}
+#endif
 #elif defined(__arm__)
 static inline void bfly5_tw1(int16x8_t *x0, int16x8_t *x1, int16x8_t *x2, int16x8_t *x3,int16x8_t *x4,
                              int16x8_t *y0, int16x8_t *y1, int16x8_t *y2, int16x8_t *y3,int16x8_t *y4) __attribute__((always_inline));
@@ -1347,18 +1929,46 @@ static inline void transpose16_ooff(__m128i *x,__m128i *y,int off)
   register __m128i ytmp0,ytmp1,ytmp2,ytmp3;
   __m128i *y2=y;
 
-  ytmp0 = _mm_unpacklo_epi32(x[0],x[1]);
-  ytmp1 = _mm_unpackhi_epi32(x[0],x[1]);
-  ytmp2 = _mm_unpacklo_epi32(x[2],x[3]);
-  ytmp3 = _mm_unpackhi_epi32(x[2],x[3]);
-  *y2     = _mm_unpacklo_epi64(ytmp0,ytmp2);
+  ytmp0 = _mm_unpacklo_epi32(x[0],x[1]); // x00 x10 x01 x11
+  ytmp1 = _mm_unpackhi_epi32(x[0],x[1]); // x02 x12 x03 x13
+  ytmp2 = _mm_unpacklo_epi32(x[2],x[3]); // x20 x30 x21 x31
+  ytmp3 = _mm_unpackhi_epi32(x[2],x[3]); // x22 x32 x23 x33
+  *y2     = _mm_unpacklo_epi64(ytmp0,ytmp2); // x00 x10 x20 x30 
   y2+=off;
-  *y2     = _mm_unpackhi_epi64(ytmp0,ytmp2);
+  *y2     = _mm_unpackhi_epi64(ytmp0,ytmp2); // x01 x11 x21 x31
   y2+=off;
-  *y2     = _mm_unpacklo_epi64(ytmp1,ytmp3);
+  *y2     = _mm_unpacklo_epi64(ytmp1,ytmp3); // x02 x12 x22 x32
   y2+=off;
-  *y2     = _mm_unpackhi_epi64(ytmp1,ytmp3);
+  *y2     = _mm_unpackhi_epi64(ytmp1,ytmp3); // x03 x13 x23 x33
+}
+
+#ifdef __AVX2__
+
+static inline void transpose16_ooff_simd256(__m256i *x,__m256i *y,int off) __attribute__((always_inline));
+static inline void transpose16_ooff_simd256(__m256i *x,__m256i *y,int off)
+{
+  register __m256i ytmp0,ytmp1,ytmp2,ytmp3,ytmp4,ytmp5,ytmp6,ytmp7;
+  __m256i *y2=y;
+  __m256i const perm_mask = _mm256_set_epi32(7, 3, 5, 1, 6, 2, 4, 0);
+
+  ytmp0 = _mm256_permutevar8x32_epi32(x[0],perm_mask);  // x00 x10 x01 x11 x02 x12 x03 x13
+  ytmp1 = _mm256_permutevar8x32_epi32(x[1],perm_mask);  // x20 x30 x21 x31 x22 x32 x23 x33
+  ytmp2 = _mm256_permutevar8x32_epi32(x[2],perm_mask);  // x40 x50 x41 x51 x42 x52 x43 x53
+  ytmp3 = _mm256_permutevar8x32_epi32(x[3],perm_mask);  // x60 x70 x61 x71 x62 x72 x63 x73
+  ytmp4 = _mm256_unpacklo_epi64(ytmp0,ytmp1);           // x00 x10 x20 x30 x01 x11 x21 x31
+  ytmp5 = _mm256_unpackhi_epi64(ytmp0,ytmp1);           // x02 x12 x22 x32 x03 x13 x23 x33
+  ytmp6 = _mm256_unpacklo_epi64(ytmp2,ytmp3);           // x40 x50 x60 x70 x41 x51 x61 x71
+  ytmp7 = _mm256_unpackhi_epi64(ytmp2,ytmp3);           // x42 x52 x62 x72 x43 x53 x63 x73
+
+  *y2    = _mm256_insertf128_si256(ytmp4,_mm256_extracti128_si256(ytmp6,0),1);  //x00 x10 x20 x30 x40 x50 x60 x70
+  y2+=off;  
+  *y2    = _mm256_insertf128_si256(ytmp6,_mm256_extracti128_si256(ytmp4,1),0);  //x01 x11 x21 x31 x41 x51 x61 x71
+  y2+=off;  
+  *y2    = _mm256_insertf128_si256(ytmp5,_mm256_extracti128_si256(ytmp7,0),1);  //x00 x10 x20 x30 x40 x50 x60 x70
+  y2+=off;  
+  *y2    = _mm256_insertf128_si256(ytmp7,_mm256_extracti128_si256(ytmp5,1),0);  //x01 x11 x21 x31 x41 x51 x61 x71
 }
+#endif
 
 #elif defined(__arm__)
 static inline void transpose16_ooff(int16x8_t *x,int16x8_t *y,int off) __attribute__((always_inline));
@@ -1388,7 +1998,29 @@ static inline void transpose4_ooff(__m64 *x,__m64 *y,int off)
 {
   y[0]   = _mm_unpacklo_pi32(x[0],x[1]);
   y[off] = _mm_unpackhi_pi32(x[0],x[1]);
+
+  // x[0] = [x0 x1]
+  // x[1] = [x2 x3]
+  // y[0] = [x0 x2]
+  // y[off] = [x1 x3]
+}
+#ifdef __AVX2__
+static inline void transpose4_ooff_simd256(__m256i *x,__m256i *y,int off)__attribute__((always_inline));
+static inline void transpose4_ooff_simd256(__m256i *x,__m256i *y,int off)
+{
+  __m256i const perm_mask = _mm256_set_epi32(7, 5, 3, 1, 6, 4, 2, 0);
+  __m256i perm_tmp0,perm_tmp1;
+
+  // x[0] = [x0 x1 x2 x3 x4 x5 x6 x7]
+  // x[1] = [x8 x9 x10 x11 x12 x13 x14]
+  // y[0] = [x0 x2 x4 x6 x8 x10 x12 x14]
+  // y[off] = [x1 x3 x5 x7 x9 x11 x13 x15]
+  perm_tmp0 = _mm256_permutevar8x32_epi32(x[0],perm_mask);
+  perm_tmp1 = _mm256_permutevar8x32_epi32(x[1],perm_mask);
+  y[0]   = _mm256_insertf128_si256(perm_tmp0,_mm256_extracti128_si256(perm_tmp1,0),1);
+  y[off] = _mm256_insertf128_si256(perm_tmp1,_mm256_extracti128_si256(perm_tmp0,1),0);
 }
+#endif
 #elif (__arm__)
 
 static inline void transpose4_ooff(int16x4_t *x,int16x4_t *y,int off)__attribute__((always_inline));
@@ -1404,26 +2036,46 @@ static inline void transpose4_ooff(int16x4_t *x,int16x4_t *y,int off)
 
 // 16-point optimized DFT kernel
 
-int16_t tw16[24] __attribute__((aligned(16))) = { 32767,0,30272,-12540,23169 ,-23170,12539 ,-30273,
+int16_t tw16[24] __attribute__((aligned(32))) = { 32767,0,30272,-12540,23169 ,-23170,12539 ,-30273,
                                                   32767,0,23169,-23170,0     ,-32767,-23170,-23170,
                                                   32767,0,12539,-30273,-23170,-23170,-30273,12539
                                                 };
 
-int16_t tw16a[24] __attribute__((aligned(16))) = {32767,0,30272,12540,23169 ,23170,12539 ,30273,
+int16_t tw16a[24] __attribute__((aligned(32))) = {32767,0,30272,12540,23169 ,23170,12539 ,30273,
                                                   32767,0,23169,23170,0     ,32767,-23170,23170,
                                                   32767,0,12539,30273,-23170,23170,-30273,-12539
                                                  };
 
-int16_t tw16b[24] __attribute__((aligned(16))) = { 0,32767,-12540,30272,-23170,23169 ,-30273,12539,
+int16_t tw16b[24] __attribute__((aligned(32))) = { 0,32767,-12540,30272,-23170,23169 ,-30273,12539,
                                                    0,32767,-23170,23169,-32767,0     ,-23170,-23170,
                                                    0,32767,-30273,12539,-23170,-23170,12539 ,-30273
                                                  };
 
-int16_t tw16c[24] __attribute__((aligned(16))) = { 0,32767,12540,30272,23170,23169 ,30273 ,12539,
+int16_t tw16c[24] __attribute__((aligned(32))) = { 0,32767,12540,30272,23170,23169 ,30273 ,12539,
                                                    0,32767,23170,23169,32767,0     ,23170 ,-23170,
                                                    0,32767,30273,12539,23170,-23170,-12539,-30273
                                                  };
 
+int16_t tw16rep[48] __attribute__((aligned(32))) = { 32767,0,30272,-12540,23169 ,-23170,12539 ,-30273,32767,0,30272,-12540,23169 ,-23170,12539 ,-30273,
+						     32767,0,23169,-23170,0     ,-32767,-23170,-23170,32767,0,23169,-23170,0     ,-32767,-23170,-23170,
+						     32767,0,12539,-30273,-23170,-23170,-30273,12539,32767,0,12539,-30273,-23170,-23170,-30273,12539
+                                                   };
+
+int16_t tw16arep[48] __attribute__((aligned(32))) = {32767,0,30272,12540,23169 ,23170,12539 ,30273,32767,0,30272,12540,23169 ,23170,12539 ,30273,
+						     32767,0,23169,23170,0     ,32767,-23170,23170,32767,0,23169,23170,0     ,32767,-23170,23170,
+						     32767,0,12539,30273,-23170,23170,-30273,-12539,32767,0,12539,30273,-23170,23170,-30273,-12539
+                                                    }; 
+
+int16_t tw16brep[48] __attribute__((aligned(32))) = { 0,32767,-12540,30272,-23170,23169 ,-30273,12539,0,32767,-12540,30272,-23170,23169 ,-30273,12539,
+                                                      0,32767,-23170,23169,-32767,0     ,-23170,-23170,0,32767,-23170,23169,-32767,0     ,-23170,-23170,
+                                                      0,32767,-30273,12539,-23170,-23170,12539 ,-30273,0,32767,-30273,12539,-23170,-23170,12539 ,-30273
+                                                    };
+
+int16_t tw16crep[48] __attribute__((aligned(32))) = { 0,32767,12540,30272,23170,23169 ,30273 ,12539,0,32767,12540,30272,23170,23169 ,30273 ,12539,
+						      0,32767,23170,23169,32767,0     ,23170 ,-23170,0,32767,23170,23169,32767,0     ,23170 ,-23170,
+						      0,32767,30273,12539,23170,-23170,-12539,-30273,0,32767,30273,12539,23170,-23170,-12539,-30273
+                                                    };
+
 
 
 static inline void dft16(int16_t *x,int16_t *y) __attribute__((always_inline));
@@ -1437,7 +2089,6 @@ static inline void dft16(int16_t *x,int16_t *y)
 
 
 
-#ifndef AVX2
   /*  This is the original version before unrolling
 
   bfly4_tw1(x128,x128+1,x128+2,x128+3,
@@ -1496,32 +2147,6 @@ static inline void dft16(int16_t *x,int16_t *y)
   y128[1] = _mm_adds_epi16(x02t,x13t);  // x0 + x1f - x2 - x3f
   y128[3] = _mm_subs_epi16(x02t,x13t);  // x0 - x1f - x2 + x3f
 
-#else
-
-  //  x02t    = _mm_adds_epi16(x128[0],x128[2]);
-  //  x13t    = _mm_adds_epi16(x128[1],x128[3]);
-
-  xt      = _mm256_adds_epi16(x256[0],x256[1]);
-
-  xtmp0   = _mm_adds_epi16(x02t,x13t);
-  xtmp2   = _mm_subs_epi16(x02t,x13t);
-
-  x13_flip
-  x1_flip = _mm_sign_epi16(x128[1],*(__m128i*)conjugatedft);
-  x1_flip = _mm_shuffle_epi8(x1_flip,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2));
-  x3_flip = _mm_sign_epi16(x128[3],*(__m128i*)conjugatedft);
-  x3_flip = _mm_shuffle_epi8(x3_flip,_mm_set_epi8(13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2));
-
-  //  x02t    = _mm_subs_epi16(x128[0],x128[2]);
-  //  x13t    = _mm_subs_epi16(x1_flip,x3_flip);
-  xt      = _mm256_subs_epi16(x256flip0,x256flip1);
-
-  xtmp1   = _mm_adds_epi16(x02t,x13t);  // x0 + x1f - x2 - x3f
-  xtmp3   = _mm_subs_epi16(x02t,x13t);  // x0 - x1f - x2 + x3f
-
-
-#endif
-
 #elif defined(__arm__)
 
   int16x8_t *tw16a_128=(int16x8_t *)tw16a,*tw16b_128=(int16x8_t *)tw16b,*x128=(int16x8_t *)x,*y128=(int16x8_t *)y;
@@ -1592,17 +2217,101 @@ static inline void dft16(int16_t *x,int16_t *y)
 #endif
 }
 
-static inline void idft16(int16_t *x,int16_t *y) __attribute__((always_inline));
-
-static inline void idft16(int16_t *x,int16_t *y)
+#if defined(__x86_64__) || defined(__i386__)
+#ifdef __AVX2__
+// Does two 16-point DFTS (x[0 .. 15] is 128 LSBs of input vector, x[16..31] is in 128 MSBs) 
+static inline void dft16_simd256(int16_t *x,int16_t *y) __attribute__((always_inline));
+static inline void dft16_simd256(int16_t *x,int16_t *y)
 {
 
-#if defined(__x86_64__) || defined(__i386__)
-  __m128i *tw16a_128=(__m128i *)tw16,*tw16b_128=(__m128i *)tw16c,*x128=(__m128i *)x,*y128=(__m128i *)y;
+  __m256i *tw16a_256=(__m256i *)tw16arep,*tw16b_256=(__m256i *)tw16brep,*x256=(__m256i *)x,*y256=(__m256i *)y;
 
-  /*
-  bfly4_tw1(x128,x128+1,x128+2,x128+3,
-      y128,y128+1,y128+2,y128+3);
+  __m256i x1_flip,x3_flip,x02t,x13t;
+  __m256i ytmp0,ytmp1,ytmp2,ytmp3,xtmp0,xtmp1,xtmp2,xtmp3;
+  register __m256i complex_shuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2);
+
+  // First stage : 4 Radix-4 butterflies without input twiddles
+
+  x02t    = _mm256_adds_epi16(x256[0],x256[2]);
+  x13t    = _mm256_adds_epi16(x256[1],x256[3]);
+  xtmp0   = _mm256_adds_epi16(x02t,x13t);
+  xtmp2   = _mm256_subs_epi16(x02t,x13t);
+  x1_flip = _mm256_sign_epi16(x256[1],*(__m256i*)conjugatedft);
+  x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle);
+  x3_flip = _mm256_sign_epi16(x256[3],*(__m256i*)conjugatedft);
+  x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle);
+  x02t    = _mm256_subs_epi16(x256[0],x256[2]);
+  x13t    = _mm256_subs_epi16(x1_flip,x3_flip);
+  xtmp1   = _mm256_adds_epi16(x02t,x13t);  // x0 + x1f - x2 - x3f
+  xtmp3   = _mm256_subs_epi16(x02t,x13t);  // x0 - x1f - x2 + x3f
+
+  /*  print_shorts256("xtmp0",(int16_t*)&xtmp0);
+      print_shorts256("xtmp1",(int16_t*)&xtmp1);
+  print_shorts256("xtmp2",(int16_t*)&xtmp2);
+  print_shorts256("xtmp3",(int16_t*)&xtmp3);*/
+
+  ytmp0   = _mm256_unpacklo_epi32(xtmp0,xtmp1);  
+  ytmp1   = _mm256_unpackhi_epi32(xtmp0,xtmp1);
+  ytmp2   = _mm256_unpacklo_epi32(xtmp2,xtmp3);
+  ytmp3   = _mm256_unpackhi_epi32(xtmp2,xtmp3);
+  xtmp0   = _mm256_unpacklo_epi64(ytmp0,ytmp2);
+  xtmp1   = _mm256_unpackhi_epi64(ytmp0,ytmp2);
+  xtmp2   = _mm256_unpacklo_epi64(ytmp1,ytmp3);
+  xtmp3   = _mm256_unpackhi_epi64(ytmp1,ytmp3);
+
+  // Second stage : 4 Radix-4 butterflies with input twiddles
+  xtmp1 = packed_cmult2_256(xtmp1,tw16a_256[0],tw16b_256[0]);
+  xtmp2 = packed_cmult2_256(xtmp2,tw16a_256[1],tw16b_256[1]);
+  xtmp3 = packed_cmult2_256(xtmp3,tw16a_256[2],tw16b_256[2]);
+
+  /*  print_shorts256("xtmp0",(int16_t*)&xtmp0);
+  print_shorts256("xtmp1",(int16_t*)&xtmp1);
+  print_shorts256("xtmp2",(int16_t*)&xtmp2);
+  print_shorts256("xtmp3",(int16_t*)&xtmp3);*/
+
+  x02t    = _mm256_adds_epi16(xtmp0,xtmp2);
+  x13t    = _mm256_adds_epi16(xtmp1,xtmp3);
+  ytmp0   = _mm256_adds_epi16(x02t,x13t);
+  ytmp2   = _mm256_subs_epi16(x02t,x13t);
+  x1_flip = _mm256_sign_epi16(xtmp1,*(__m256i*)conjugatedft);
+  x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle);
+  x3_flip = _mm256_sign_epi16(xtmp3,*(__m256i*)conjugatedft);
+  x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle);
+  x02t    = _mm256_subs_epi16(xtmp0,xtmp2);
+  x13t    = _mm256_subs_epi16(x1_flip,x3_flip);
+  ytmp1   = _mm256_adds_epi16(x02t,x13t);  // x0 + x1f - x2 - x3f
+  ytmp3   = _mm256_subs_epi16(x02t,x13t);  // x0 - x1f - x2 + x3f
+ 
+
+  // [y0  y1  y2  y3  y16 y17 y18 y19]
+  // [y4  y5  y6  y7  y20 y21 y22 y23]
+  // [y8  y9  y10 y11 y24 y25 y26 y27]
+  // [y12 y13 y14 y15 y28 y29 y30 y31]
+
+  y256[0] = _mm256_insertf128_si256(ytmp0,_mm256_extracti128_si256(ytmp1,0),1);
+  y256[1] = _mm256_insertf128_si256(ytmp2,_mm256_extracti128_si256(ytmp3,0),1);
+  y256[2] = _mm256_insertf128_si256(ytmp1,_mm256_extracti128_si256(ytmp0,1),0);
+  y256[3] = _mm256_insertf128_si256(ytmp3,_mm256_extracti128_si256(ytmp2,1),0);
+
+  // [y0  y1  y2  y3  y4  y5  y6  y7]
+  // [y8  y9  y10 y11 y12 y13 y14 y15]
+  // [y16 y17 y18 y19 y20 y21 y22 y23]
+  // [y24 y25 y26 y27 y28 y29 y30 y31]
+}
+
+#endif  
+#endif
+static inline void idft16(int16_t *x,int16_t *y) __attribute__((always_inline));
+
+static inline void idft16(int16_t *x,int16_t *y)
+{
+
+#if defined(__x86_64__) || defined(__i386__)
+  __m128i *tw16a_128=(__m128i *)tw16,*tw16b_128=(__m128i *)tw16c,*x128=(__m128i *)x,*y128=(__m128i *)y;
+
+  /*
+  bfly4_tw1(x128,x128+1,x128+2,x128+3,
+      y128,y128+1,y128+2,y128+3);
 
   transpose16(y128,ytmp);
 
@@ -1723,27 +2432,193 @@ static inline void idft16(int16_t *x,int16_t *y)
 #endif
 }
 
+#if defined(__x86_64__) || defined(__i386__)
+#ifdef __AVX2__
+// Does two 16-point IDFTS (x[0 .. 15] is 128 LSBs of input vector, x[16..31] is in 128 MSBs) 
+static inline void idft16_simd256(int16_t *x,int16_t *y) __attribute__((always_inline));
+static inline void idft16_simd256(int16_t *x,int16_t *y)
+{
+
+  __m256i *tw16a_256=(__m256i *)tw16rep,*tw16b_256=(__m256i *)tw16crep,*x256=(__m256i *)x,*y256=(__m256i *)y;
+  register __m256i x1_flip,x3_flip,x02t,x13t;
+  register __m256i ytmp0,ytmp1,ytmp2,ytmp3,xtmp0,xtmp1,xtmp2,xtmp3;
+  register __m256i complex_shuffle = _mm256_set_epi8(29,28,31,30,25,24,27,26,21,20,23,22,17,16,19,18,13,12,15,14,9,8,11,10,5,4,7,6,1,0,3,2);
+
+  // First stage : 4 Radix-4 butterflies without input twiddles
+
+  x02t    = _mm256_adds_epi16(x256[0],x256[2]);
+  x13t    = _mm256_adds_epi16(x256[1],x256[3]);
+  xtmp0   = _mm256_adds_epi16(x02t,x13t);
+  xtmp2   = _mm256_subs_epi16(x02t,x13t);
+  x1_flip = _mm256_sign_epi16(x256[1],*(__m256i*)conjugatedft);
+  x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle);
+  x3_flip = _mm256_sign_epi16(x256[3],*(__m256i*)conjugatedft);
+  x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle);
+  x02t    = _mm256_subs_epi16(x256[0],x256[2]);
+  x13t    = _mm256_subs_epi16(x1_flip,x3_flip);
+  xtmp3   = _mm256_adds_epi16(x02t,x13t);  // x0 + x1f - x2 - x3f
+  xtmp1   = _mm256_subs_epi16(x02t,x13t);  // x0 - x1f - x2 + x3f
+
+  ytmp0   = _mm256_unpacklo_epi32(xtmp0,xtmp1);  
+  ytmp1   = _mm256_unpackhi_epi32(xtmp0,xtmp1);
+  ytmp2   = _mm256_unpacklo_epi32(xtmp2,xtmp3);
+  ytmp3   = _mm256_unpackhi_epi32(xtmp2,xtmp3);
+  xtmp0   = _mm256_unpacklo_epi64(ytmp0,ytmp2);
+  xtmp1   = _mm256_unpackhi_epi64(ytmp0,ytmp2);
+  xtmp2   = _mm256_unpacklo_epi64(ytmp1,ytmp3);
+  xtmp3   = _mm256_unpackhi_epi64(ytmp1,ytmp3);
+
+  // Second stage : 4 Radix-4 butterflies with input twiddles
+  xtmp1 = packed_cmult2_256(xtmp1,tw16a_256[0],tw16b_256[0]);
+  xtmp2 = packed_cmult2_256(xtmp2,tw16a_256[1],tw16b_256[1]);
+  xtmp3 = packed_cmult2_256(xtmp3,tw16a_256[2],tw16b_256[2]);
+
+  x02t    = _mm256_adds_epi16(xtmp0,xtmp2);
+  x13t    = _mm256_adds_epi16(xtmp1,xtmp3);
+  ytmp0   = _mm256_adds_epi16(x02t,x13t);
+  ytmp2   = _mm256_subs_epi16(x02t,x13t);
+  x1_flip = _mm256_sign_epi16(xtmp1,*(__m256i*)conjugatedft);
+  x1_flip = _mm256_shuffle_epi8(x1_flip,complex_shuffle);
+  x3_flip = _mm256_sign_epi16(xtmp3,*(__m256i*)conjugatedft);
+  x3_flip = _mm256_shuffle_epi8(x3_flip,complex_shuffle);
+  x02t    = _mm256_subs_epi16(xtmp0,xtmp2);
+  x13t    = _mm256_subs_epi16(x1_flip,x3_flip);
+  ytmp3   = _mm256_adds_epi16(x02t,x13t);  // x0 + x1f - x2 - x3f
+  ytmp1   = _mm256_subs_epi16(x02t,x13t);  // x0 - x1f - x2 + x3f
+
+  // [y0  y1  y2  y3  y16 y17 y18 y19]
+  // [y4  y5  y6  y7  y20 y21 y22 y23]
+  // [y8  y9  y10 y11 y24 y25 y26 y27]
+  // [y12 y13 y14 y15 y28 y29 y30 y31]
+
+  y256[0] = _mm256_insertf128_si256(ytmp0,_mm256_extracti128_si256(ytmp1,0),1);
+  y256[1] = _mm256_insertf128_si256(ytmp2,_mm256_extracti128_si256(ytmp3,0),1);
+  y256[2] = _mm256_insertf128_si256(ytmp1,_mm256_extracti128_si256(ytmp0,1),0);
+  y256[3] = _mm256_insertf128_si256(ytmp3,_mm256_extracti128_si256(ytmp2,1),0);
+
+}
+#endif  
+#endif
 
 // 64-point optimized DFT
 
-int16_t tw64[96] __attribute__((aligned(16))) = { 32767,0,32609,-3212,32137,-6393,31356,-9512,30272,-12540,28897,-15447,27244,-18205,25329,-20788,23169,-23170,20787,-25330,18204,-27245,15446,-28898,12539,-30273,9511,-31357,6392,-32138,3211,-32610,
-                                                  32767,0,32137,-6393,30272,-12540,27244,-18205,23169,-23170,18204,-27245,12539,-30273,6392,-32138,0,-32767,-6393,-32138,-12540,-30273,-18205,-27245,-23170,-23170,-27245,-18205,-30273,-12540,-32138,-6393,
-                                                  32767,0,31356,-9512,27244,-18205,20787,-25330,12539,-30273,3211,-32610,-6393,-32138,-15447,-28898,-23170,-23170,-28898,-15447,-32138,-6393,-32610,3211,-30273,12539,-25330,20787,-18205,27244,-9512,31356
+int16_t tw64[96] __attribute__((aligned(32))) = { 
+32767,0,32609,-3212,32137,-6393,31356,-9512,
+30272,-12540,28897,-15447,27244,-18205,25329,-20788,
+23169,-23170,20787,-25330,18204,-27245,15446,-28898,
+12539,-30273,9511,-31357,6392,-32138,3211,-32610,
+32767,0,32137,-6393,30272,-12540,27244,-18205,
+23169,-23170,18204,-27245,12539,-30273,6392,-32138,
+0,-32767,-6393,-32138,-12540,-30273,-18205,-27245,
+-23170,-23170,-27245,-18205,-30273,-12540,-32138,-6393,
+32767,0,31356,-9512,27244,-18205,20787,-25330,
+12539,-30273,3211,-32610,-6393,-32138,-15447,-28898,
+-23170,-23170,-28898,-15447,-32138,-6393,-32610,3211,
+-30273,12539,-25330,20787,-18205,27244,-9512,31356
+                                                };
+
+int16_t tw64rep[192] __attribute__((aligned(32))) = { 
+32767,0,32609,-3212,32137,-6393,31356,-9512,32767,0,32609,-3212,32137,-6393,31356,-9512,
+30272,-12540,28897,-15447,27244,-18205,25329,-20788,30272,-12540,28897,-15447,27244,-18205,25329,-20788,
+23169,-23170,20787,-25330,18204,-27245,15446,-28898,23169,-23170,20787,-25330,18204,-27245,15446,-28898,
+12539,-30273,9511,-31357,6392,-32138,3211,-32610,12539,-30273,9511,-31357,6392,-32138,3211,-32610,
+32767,0,32137,-6393,30272,-12540,27244,-18205,32767,0,32137,-6393,30272,-12540,27244,-18205,
+23169,-23170,18204,-27245,12539,-30273,6392,-32138,23169,-23170,18204,-27245,12539,-30273,6392,-32138,
+0,-32767,-6393,-32138,-12540,-30273,-18205,-27245,0,-32767,-6393,-32138,-12540,-30273,-18205,-27245,
+-23170,-23170,-27245,-18205,-30273,-12540,-32138,-6393,-23170,-23170,-27245,-18205,-30273,-12540,-32138,-6393,
+32767,0,31356,-9512,27244,-18205,20787,-25330,32767,0,31356,-9512,27244,-18205,20787,-25330,
+12539,-30273,3211,-32610,-6393,-32138,-15447,-28898,12539,-30273,3211,-32610,-6393,-32138,-15447,-28898,
+-23170,-23170,-28898,-15447,-32138,-6393,-32610,3211,-23170,-23170,-28898,-15447,-32138,-6393,-32610,3211,
+-30273,12539,-25330,20787,-18205,27244,-9512,31356,-30273,12539,-25330,20787,-18205,27244,-9512,31356
                                                 };
 
-int16_t tw64a[96] __attribute__((aligned(16))) = { 32767,0,32609,3212,32137,6393,31356,9512,30272,12540,28897,15447,27244,18205,25329,20788,23169,23170,20787,25330,18204,27245,15446,28898,12539,30273,9511,31357,6392,32138,3211,32610,
-                                                   32767,0,32137,6393,30272,12540,27244,18205,23169,23170,18204,27245,12539,30273,6392,32138,0,32767,-6393,32138,-12540,30273,-18205,27245,-23170,23170,-27245,18205,-30273,12540,-32138,6393,
-                                                   32767,0,31356,9512,27244,18205,20787,25330,12539,30273,3211,32610,-6393,32138,-15447,28898,-23170,23170,-28898,15447,-32138,6393,-32610,-3211,-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356
+int16_t tw64a[96] __attribute__((aligned(32))) = { 
+32767,0,32609,3212,32137,6393,31356,9512,
+30272,12540,28897,15447,27244,18205,25329,20788,
+23169,23170,20787,25330,18204,27245,15446,28898,
+12539,30273,9511,31357,6392,32138,3211,32610,
+32767,0,32137,6393,30272,12540,27244,18205,
+23169,23170,18204,27245,12539,30273,6392,32138,
+0,32767,-6393,32138,-12540,30273,-18205,27245,
+-23170,23170,-27245,18205,-30273,12540,-32138,6393,
+32767,0,31356,9512,27244,18205,20787,25330,
+12539,30273,3211,32610,-6393,32138,-15447,28898,
+-23170,23170,-28898,15447,-32138,6393,-32610,-3211,
+-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356
+                                                 };
+int16_t tw64arep[192] __attribute__((aligned(32))) = { 
+32767,0,32609,3212,32137,6393,31356,9512,32767,0,32609,3212,32137,6393,31356,9512,
+30272,12540,28897,15447,27244,18205,25329,20788,30272,12540,28897,15447,27244,18205,25329,20788,
+23169,23170,20787,25330,18204,27245,15446,28898,23169,23170,20787,25330,18204,27245,15446,28898,
+12539,30273,9511,31357,6392,32138,3211,32610,12539,30273,9511,31357,6392,32138,3211,32610,
+32767,0,32137,6393,30272,12540,27244,18205,32767,0,32137,6393,30272,12540,27244,18205,
+23169,23170,18204,27245,12539,30273,6392,32138,23169,23170,18204,27245,12539,30273,6392,32138,
+0,32767,-6393,32138,-12540,30273,-18205,27245,0,32767,-6393,32138,-12540,30273,-18205,27245,
+-23170,23170,-27245,18205,-30273,12540,-32138,6393,-23170,23170,-27245,18205,-30273,12540,-32138,6393,
+32767,0,31356,9512,27244,18205,20787,25330,32767,0,31356,9512,27244,18205,20787,25330,
+12539,30273,3211,32610,-6393,32138,-15447,28898,12539,30273,3211,32610,-6393,32138,-15447,28898,
+-23170,23170,-28898,15447,-32138,6393,-32610,-3211,-23170,23170,-28898,15447,-32138,6393,-32610,-3211,
+-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356,-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356
                                                  };
 
-int16_t tw64b[96] __attribute__((aligned(16))) = { 0,32767,-3212,32609,-6393,32137,-9512,31356,-12540,30272,-15447,28897,-18205,27244,-20788,25329,-23170,23169,-25330,20787,-27245,18204,-28898,15446,-30273,12539,-31357,9511,-32138,6392,-32610,3211,
-                                                   0,32767,-6393,32137,-12540,30272,-18205,27244,-23170,23169,-27245,18204,-30273,12539,-32138,6392,-32767,0,-32138,-6393,-30273,-12540,-27245,-18205,-23170,-23170,-18205,-27245,-12540,-30273,-6393,-32138,
-                                                   0,32767,-9512,31356,-18205,27244,-25330,20787,-30273,12539,-32610,3211,-32138,-6393,-28898,-15447,-23170,-23170,-15447,-28898,-6393,-32138,3211,-32610,12539,-30273,20787,-25330,27244,-18205,31356,-9512
+int16_t tw64b[96] __attribute__((aligned(32))) = { 
+0,32767,-3212,32609,-6393,32137,-9512,31356,
+-12540,30272,-15447,28897,-18205,27244,-20788,25329,
+-23170,23169,-25330,20787,-27245,18204,-28898,15446,
+-30273,12539,-31357,9511,-32138,6392,-32610,3211,
+0,32767,-6393,32137,-12540,30272,-18205,27244,
+-23170,23169,-27245,18204,-30273,12539,-32138,6392,
+-32767,0,-32138,-6393,-30273,-12540,-27245,-18205,
+-23170,-23170,-18205,-27245,-12540,-30273,-6393,-32138,
+0,32767,-9512,31356,-18205,27244,-25330,20787,
+-30273,12539,-32610,3211,-32138,-6393,-28898,-15447,
+-23170,-23170,-15447,-28898,-6393,-32138,3211,-32610,
+12539,-30273,20787,-25330,27244,-18205,31356,-9512
                                                  };
 
-int16_t tw64c[96] __attribute__((aligned(16))) = { 0,32767,3212,32609,6393,32137,9512,31356,12540,30272,15447,28897,18205,27244,20788,25329,23170,23169,25330,20787,27245,18204,28898,15446,30273,12539,31357,9511,32138,6392,32610,3211,
-                                                   0,32767,6393,32137,12540,30272,18205,27244,23170,23169,27245,18204,30273,12539,32138,6392,32767,0,32138,-6393,30273,-12540,27245,-18205,23170,-23170,18205,-27245,12540,-30273,6393,-32138,
-                                                   0,32767,9512,31356,18205,27244,25330,20787,30273,12539,32610,3211,32138,-6393,28898,-15447,23170,-23170,15447,-28898,6393,-32138,-3211,-32610,-12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512
+int16_t tw64brep[192] __attribute__((aligned(32))) = { 
+0,32767,-3212,32609,-6393,32137,-9512,31356,0,32767,-3212,32609,-6393,32137,-9512,31356,
+-12540,30272,-15447,28897,-18205,27244,-20788,25329,-12540,30272,-15447,28897,-18205,27244,-20788,25329,
+-23170,23169,-25330,20787,-27245,18204,-28898,15446,-23170,23169,-25330,20787,-27245,18204,-28898,15446,
+-30273,12539,-31357,9511,-32138,6392,-32610,3211,-30273,12539,-31357,9511,-32138,6392,-32610,3211,
+0,32767,-6393,32137,-12540,30272,-18205,27244,0,32767,-6393,32137,-12540,30272,-18205,27244,
+-23170,23169,-27245,18204,-30273,12539,-32138,6392,-23170,23169,-27245,18204,-30273,12539,-32138,6392,
+-32767,0,-32138,-6393,-30273,-12540,-27245,-18205,-32767,0,-32138,-6393,-30273,-12540,-27245,-18205,
+-23170,-23170,-18205,-27245,-12540,-30273,-6393,-32138,-23170,-23170,-18205,-27245,-12540,-30273,-6393,-32138,
+0,32767,-9512,31356,-18205,27244,-25330,20787,0,32767,-9512,31356,-18205,27244,-25330,20787,
+-30273,12539,-32610,3211,-32138,-6393,-28898,-15447,-30273,12539,-32610,3211,-32138,-6393,-28898,-15447,
+-23170,-23170,-15447,-28898,-6393,-32138,3211,-32610,-23170,-23170,-15447,-28898,-6393,-32138,3211,-32610,
+12539,-30273,20787,-25330,27244,-18205,31356,-9512,12539,-30273,20787,-25330,27244,-18205,31356,-9512
+                                                 };
+
+int16_t tw64c[96] __attribute__((aligned(32))) = { 
+0,32767,3212,32609,6393,32137,9512,31356,
+12540,30272,15447,28897,18205,27244,20788,25329,
+23170,23169,25330,20787,27245,18204,28898,15446,
+30273,12539,31357,9511,32138,6392,32610,3211,
+0,32767,6393,32137,12540,30272,18205,27244,
+23170,23169,27245,18204,30273,12539,32138,6392,
+32767,0,32138,-6393,30273,-12540,27245,-18205,
+23170,-23170,18205,-27245,12540,-30273,6393,-32138,
+0,32767,9512,31356,18205,27244,25330,20787,
+30273,12539,32610,3211,32138,-6393,28898,-15447,
+23170,-23170,15447,-28898,6393,-32138,-3211,-32610,
+-12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512
+                                                 };
+
+int16_t tw64crep[192] __attribute__((aligned(32))) = { 
+0,32767,3212,32609,6393,32137,9512,31356,0,32767,3212,32609,6393,32137,9512,31356,
+12540,30272,15447,28897,18205,27244,20788,25329,12540,30272,15447,28897,18205,27244,20788,25329,
+23170,23169,25330,20787,27245,18204,28898,15446,23170,23169,25330,20787,27245,18204,28898,15446,
+30273,12539,31357,9511,32138,6392,32610,3211,30273,12539,31357,9511,32138,6392,32610,3211,
+0,32767,6393,32137,12540,30272,18205,27244,0,32767,6393,32137,12540,30272,18205,27244,
+23170,23169,27245,18204,30273,12539,32138,6392,23170,23169,27245,18204,30273,12539,32138,6392,
+32767,0,32138,-6393,30273,-12540,27245,-18205,32767,0,32138,-6393,30273,-12540,27245,-18205,
+23170,-23170,18205,-27245,12540,-30273,6393,-32138,23170,-23170,18205,-27245,12540,-30273,6393,-32138,
+0,32767,9512,31356,18205,27244,25330,20787,0,32767,9512,31356,18205,27244,25330,20787,
+30273,12539,32610,3211,32138,-6393,28898,-15447,30273,12539,32610,3211,32138,-6393,28898,-15447,
+23170,-23170,15447,-28898,6393,-32138,-3211,-32610,23170,-23170,15447,-28898,6393,-32138,-3211,-32610,
+-12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512,-12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512
                                                  };
 
 
@@ -1753,6 +2628,13 @@ int16_t tw64c[96] __attribute__((aligned(16))) = { 0,32767,3212,32609,6393,32137
 #define shiftright_int16(a,shift) _mm_srai_epi16(a,shift)
 #define set1_int16(a) _mm_set1_epi16(a);
 #define mulhi_int16(a,b) _mm_slli_epi16(_mm_mulhi_epi16(a,b),1);
+#ifdef __AVX2__
+#define simd256_q15_t __m256i
+#define shiftright_int16_simd256(a,shift) _mm256_srai_epi16(a,shift)
+#define set1_int16_simd256(a) _mm256_set1_epi16(a);
+#define mulhi_int16_simd256(a,b) _mm256_slli_epi16(_mm256_mulhi_epi16(a,b),1);
+#endif
+
 #elif defined(__arm__)
 #define simd_q15_t int16x8_t
 #define simdshort_q15_t int16x4_t
@@ -1761,8 +2643,10 @@ int16_t tw64c[96] __attribute__((aligned(16))) = { 0,32767,3212,32609,6393,32137
 #define mulhi_int16(a,b) vqdmulhq_s16(a,b);
 #define _mm_empty() 
 #define _m_empty()
+
 #endif
 
+#ifndef __AVX2__
 void dft64(int16_t *x,int16_t *y,int scale)
 {
 
@@ -1780,18 +2664,41 @@ void dft64(int16_t *x,int16_t *y,int scale)
 
 
   transpose16_ooff(x128,xtmp,4);
+  // xtmp0  = x00 x10 x20 x30
+  // xtmp4  = x01 x11 x21 x31
+  // xtmp8  = x02 x12 x22 x32
+  // xtmp12 = x03 x13 x23 x33
   transpose16_ooff(x128+4,xtmp+1,4);
+  // xtmp1  = x40 x50 x60 x70
+  // xtmp5  = x41 x51 x61 x71
+  // xtmp9  = x42 x52 x62 x72
+  // xtmp13 = x43 x53 x63 x73
   transpose16_ooff(x128+8,xtmp+2,4);
+  // xtmp2  = x80 x90 xa0 xb0
+  // xtmp6  = x41 x51 x61 x71
+  // xtmp10 = x82 x92 xa2 xb2
+  // xtmp14 = x83 x93 xa3 xb3
   transpose16_ooff(x128+12,xtmp+3,4);
-
+  // xtmp3  = xc0 xd0 xe0 xf0
+  // xtmp7  = xc1 xd1 xe1 xf1
+  // xtmp11 = xc2 xd2 xe2 xf2
+  // xtmp15 = xc3 xd3 xe3 xf3
 
 #ifdef D64STATS
   stop_meas(&ts_t);
   start_meas(&ts_d);
 #endif
 
-
+  // xtmp0  = x00 x10 x20 x30
+  // xtmp1  = x40 x50 x60 x70
+  // xtmp2  = x80 x90 xa0 xb0
+  // xtmp3  = xc0 xd0 xe0 xf0
   dft16((int16_t*)(xtmp),(int16_t*)ytmp);
+
+  // xtmp4  = x01 x11 x21 x31
+  // xtmp5  = x41 x51 x61 x71
+  // xtmp6  = x81 x91 xa1 xb1
+  // xtmp7  = xc1 xd1 xe1 xf1
   dft16((int16_t*)(xtmp+4),(int16_t*)(ytmp+4));
   dft16((int16_t*)(xtmp+8),(int16_t*)(ytmp+8));
   dft16((int16_t*)(xtmp+12),(int16_t*)(ytmp+12));
@@ -1853,6 +2760,155 @@ void dft64(int16_t *x,int16_t *y,int scale)
 
 }
 
+#else // __AVX2__
+void dft64(int16_t *x,int16_t *y,int scale)
+{
+
+  simd256_q15_t xtmp[16],ytmp[16],*tw64a_256=(simd256_q15_t *)tw64a,*tw64b_256=(simd256_q15_t *)tw64b,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y;
+  simd256_q15_t xintl0,xintl1,xintl2,xintl3,xintl4,xintl5,xintl6,xintl7;
+  simd256_q15_t const perm_mask = _mm256_set_epi32(7, 3, 5, 1, 6, 2, 4, 0);
+
+
+#ifdef D64STATS
+  time_stats_t ts_t,ts_d,ts_b;
+
+  reset_meas(&ts_t);
+  reset_meas(&ts_d);
+  reset_meas(&ts_b);
+  start_meas(&ts_t);
+#endif
+
+#ifdef D64STATS
+  stop_meas(&ts_t);
+  start_meas(&ts_d);
+#endif
+  /*  
+  print_shorts256("x2560",(int16_t*)x256);
+  print_shorts256("x2561",(int16_t*)(x256+1));
+  print_shorts256("x2562",(int16_t*)(x256+2));
+  print_shorts256("x2563",(int16_t*)(x256+3));
+  print_shorts256("x2564",(int16_t*)(x256+4));
+  print_shorts256("x2565",(int16_t*)(x256+5));
+  print_shorts256("x2566",(int16_t*)(x256+6));
+  print_shorts256("x2567",(int16_t*)(x256+7));
+  */
+  xintl0 = _mm256_permutevar8x32_epi32(x256[0],perm_mask);  // x0  x4  x1  x5  x2  x6  x3  x7
+  xintl1 = _mm256_permutevar8x32_epi32(x256[1],perm_mask);  // x8  x12 x9  x13 x10 x14 x11 x15
+  xintl2 = _mm256_permutevar8x32_epi32(x256[2],perm_mask);  // x16 x20 x17 x21 x18 x22 x19 x23
+  xintl3 = _mm256_permutevar8x32_epi32(x256[3],perm_mask);  // x24 x28 x25 x29 x26 x30 x27 x31
+  xintl4 = _mm256_permutevar8x32_epi32(x256[4],perm_mask);  // x32 x28 x25 x29 x26 x30 x27 x31
+  xintl5 = _mm256_permutevar8x32_epi32(x256[5],perm_mask);  // x40 x28 x25 x29 x26 x30 x27 x31
+  xintl6 = _mm256_permutevar8x32_epi32(x256[6],perm_mask);  // x48 x28 x25 x29 x26 x30 x27 x31
+  xintl7 = _mm256_permutevar8x32_epi32(x256[7],perm_mask);  // x56 x28 x25 x29 x26 x30 x27 x31
+  /*
+  print_shorts256("xintl0",(int16_t*)&xintl0);
+  print_shorts256("xintl1",(int16_t*)&xintl1);
+  print_shorts256("xintl2",(int16_t*)&xintl2);
+  print_shorts256("xintl3",(int16_t*)&xintl3);
+  print_shorts256("xintl4",(int16_t*)&xintl4);
+  print_shorts256("xintl5",(int16_t*)&xintl5);
+  print_shorts256("xintl6",(int16_t*)&xintl6);
+  print_shorts256("xintl7",(int16_t*)&xintl7);
+  */
+  xtmp[0] = _mm256_unpacklo_epi64(xintl0,xintl1);        // x0  x4  x8  x12 x1  x5  x9  x13
+  xtmp[4] = _mm256_unpackhi_epi64(xintl0,xintl1);        // x2  x6  x10 x14 x3  x7  x11 x15
+  xtmp[1] = _mm256_unpacklo_epi64(xintl2,xintl3);        // x16 x20 x24 x28 x17 x21 x25 x29
+  xtmp[5] = _mm256_unpackhi_epi64(xintl2,xintl3);        // x18 x22 x26 x30 x19 x23 x27 x31
+  xtmp[2] = _mm256_unpacklo_epi64(xintl4,xintl5);        // x32 x36 x40 x44 x33 x37 x41 x45
+  xtmp[6] = _mm256_unpackhi_epi64(xintl4,xintl5);        // x34 x38 x42 x46 x35 x39 x43 x47
+  xtmp[3] = _mm256_unpacklo_epi64(xintl6,xintl7);        // x48 x52 x56 x60 x49 x53 x57 x61
+  xtmp[7] = _mm256_unpackhi_epi64(xintl6,xintl7);        // x50 x54 x58 x62 x51 x55 x59 x63
+  /*
+  print_shorts256("xtmp0",(int16_t*)xtmp);
+  print_shorts256("xtmp1",(int16_t*)(xtmp+1));
+  print_shorts256("xtmp2",(int16_t*)(xtmp+2));
+  print_shorts256("xtmp3",(int16_t*)(xtmp+3));
+  print_shorts256("xtmp4",(int16_t*)(xtmp+4));
+  print_shorts256("xtmp5",(int16_t*)(xtmp+5));
+  print_shorts256("xtmp6",(int16_t*)(xtmp+6));
+  print_shorts256("xtmp7",(int16_t*)(xtmp+7));
+  */
+  dft16_simd256((int16_t*)(xtmp),(int16_t*)ytmp);
+  // [y0  y1  y2  y3  y4  y5  y6  y7]
+  // [y8  y9  y10 y11 y12 y13 y14 y15]
+  // [y16 y17 y18 y19 y20 y21 y22 y23]
+  // [y24 y25 y26 y27 y28 y29 y30 y31]
+  /*
+  print_shorts256("ytmp0",(int16_t*)ytmp);
+  print_shorts256("ytmp1",(int16_t*)(ytmp+1));
+  print_shorts256("ytmp2",(int16_t*)(ytmp+2));
+  print_shorts256("ytmp3",(int16_t*)(ytmp+3));
+  */
+  dft16_simd256((int16_t*)(xtmp+4),(int16_t*)(ytmp+4));
+  // [y32 y33 y34 y35 y36 y37 y38 y39]
+  // [y40 y41 y42 y43 y44 y45 y46 y47]
+  // [y48 y49 y50 y51 y52 y53 y54 y55]
+  // [y56 y57 y58 y59 y60 y61 y62 y63]
+  /*
+  print_shorts256("ytmp4",(int16_t*)(ytmp+4));
+  print_shorts256("ytmp5",(int16_t*)(ytmp+5));
+  print_shorts256("ytmp6",(int16_t*)(ytmp+6));
+  print_shorts256("ytmp7",(int16_t*)(ytmp+7));
+  */
+#ifdef D64STATS
+  stop_meas(&ts_d);
+  start_meas(&ts_b);
+#endif
+
+
+  bfly4_16_256(ytmp,ytmp+2,ytmp+4,ytmp+6,
+	       y256,y256+2,y256+4,y256+6,
+	       tw64a_256,tw64a_256+2,tw64a_256+4,
+	       tw64b_256,tw64b_256+2,tw64b_256+4);
+  // [y0  y1  y2  y3  y4  y5  y6  y7]
+  // [y16 y17 y18 y19 y20 y21 y22 y23]
+  // [y32 y33 y34 y35 y36 y37 y38 y39]
+  // [y48 y49 y50 y51 y52 y53 y54 y55]
+
+  bfly4_16_256(ytmp+1,ytmp+3,ytmp+5,ytmp+7,
+	       y256+1,y256+3,y256+5,y256+7,
+	       tw64a_256+1,tw64a_256+3,tw64a_256+5,
+	       tw64b_256+1,tw64b_256+3,tw64b_256+5);
+  // [y8  y9  y10 y11 y12 y13 y14 y15]
+  // [y24 y25 y26 y27 y28 y29 y30 y31]
+  // [y40 y41 y42 y43 y44 y45 y46 y47]
+  // [y56 y57 y58 y59 y60 y61 y62 y63]
+  /*  
+  print_shorts256("y256_0",(int16_t*)&y256[0]);
+  print_shorts256("y256_1",(int16_t*)&y256[1]);
+  print_shorts256("y256_2",(int16_t*)&y256[2]);
+  print_shorts256("y256_3",(int16_t*)&y256[3]);
+  print_shorts256("y256_4",(int16_t*)&y256[4]);
+  print_shorts256("y256_5",(int16_t*)&y256[5]);
+  print_shorts256("y256_6",(int16_t*)&y256[6]);
+  print_shorts256("y256_7",(int16_t*)&y256[7]);
+  */
+
+#ifdef D64STATS
+  stop_meas(&ts_b);
+  printf("t: %llu cycles, d: %llu cycles, b: %llu cycles\n",ts_t.diff,ts_d.diff,ts_b.diff);
+#endif
+
+
+  if (scale>0) {
+    y256[0]  = shiftright_int16_simd256(y256[0],3);
+    y256[1]  = shiftright_int16_simd256(y256[1],3);
+    y256[2]  = shiftright_int16_simd256(y256[2],3);
+    y256[3]  = shiftright_int16_simd256(y256[3],3);
+    y256[4]  = shiftright_int16_simd256(y256[4],3);
+    y256[5]  = shiftright_int16_simd256(y256[5],3);
+    y256[6]  = shiftright_int16_simd256(y256[6],3);
+    y256[7]  = shiftright_int16_simd256(y256[7],3);
+  }
+
+  _mm_empty();
+  _m_empty();
+
+
+}
+#endif
+
+#ifndef __AVX2__
 void idft64(int16_t *x,int16_t *y,int scale)
 {
 
@@ -1897,7 +2953,6 @@ void idft64(int16_t *x,int16_t *y,int scale)
             y128,y128+4,y128+8,y128+12,
             tw64a_128,tw64a_128+4,tw64a_128+8,
             tw64b_128,tw64b_128+4,tw64b_128+8);
-
   ibfly4_16(ytmp+1,ytmp+5,ytmp+9,ytmp+13,
             y128+1,y128+5,y128+9,y128+13,
             tw64a_128+1,tw64a_128+5,tw64a_128+9,
@@ -1945,15 +3000,117 @@ void idft64(int16_t *x,int16_t *y,int scale)
 
 }
 
+#else // __AVX2__
+void idft64(int16_t *x,int16_t *y,int scale)
+{
 
-int16_t tw128[128] __attribute__((aligned(16))) = {  32767,0,32727,-1608,32609,-3212,32412,-4808,32137,-6393,31785,-7962,31356,-9512,30851,-11039,30272,-12540,29621,-14010,28897,-15447,28105,-16846,27244,-18205,26318,-19520,25329,-20788,24278,-22005,23169,-23170,22004,-24279,20787,-25330,19519,-26319,18204,-27245,16845,-28106,15446,-28898,14009,-29622,12539,-30273,11038,-30852,9511,-31357,7961,-31786,6392,-32138,4807,-32413,3211,-32610,1607,-32728,0,-32767,-1608,-32728,-3212,-32610,-4808,-32413,-6393,-32138,-7962,-31786,-9512,-31357,-11039,-30852,-12540,-30273,-14010,-29622,-15447,-28898,-16846,-28106,-18205,-27245,-19520,-26319,-20788,-25330,-22005,-24279,-23170,-23170,-24279,-22005,-25330,-20788,-26319,-19520,-27245,-18205,-28106,-16846,-28898,-15447,-29622,-14010,-30273,-12540,-30852,-11039,-31357,-9512,-31786,-7962,-32138,-6393,-32413,-4808,-32610,-3212,-32728,-1608};
+  simd256_q15_t xtmp[16],ytmp[16],*tw64a_256=(simd256_q15_t *)tw64,*tw64b_256=(simd256_q15_t *)tw64c,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y;
+  register simd256_q15_t xintl0,xintl1,xintl2,xintl3,xintl4,xintl5,xintl6,xintl7;
+  simd256_q15_t const perm_mask = _mm256_set_epi32(7, 3, 5, 1, 6, 2, 4, 0);
 
-int16_t tw128a[128] __attribute__((aligned(16))) = { 32767,0,32727,1608,32609,3212,32412,4808,32137,6393,31785,7962,31356,9512,30851,11039,30272,12540,29621,14010,28897,15447,28105,16846,27244,18205,26318,19520,25329,20788,24278,22005,23169,23170,22004,24279,20787,25330,19519,26319,18204,27245,16845,28106,15446,28898,14009,29622,12539,30273,11038,30852,9511,31357,7961,31786,6392,32138,4807,32413,3211,32610,1607,32728,0,32767,-1608,32728,-3212,32610,-4808,32413,-6393,32138,-7962,31786,-9512,31357,-11039,30852,-12540,30273,-14010,29622,-15447,28898,-16846,28106,-18205,27245,-19520,26319,-20788,25330,-22005,24279,-23170,23170,-24279,22005,-25330,20788,-26319,19520,-27245,18205,-28106,16846,-28898,15447,-29622,14010,-30273,12540,-30852,11039,-31357,9512,-31786,7962,-32138,6393,-32413,4808,-32610,3212,-32728,1608};
 
-int16_t tw128b[128] __attribute__((aligned(16))) = {0,32767,-1608,32727,-3212,32609,-4808,32412,-6393,32137,-7962,31785,-9512,31356,-11039,30851,-12540,30272,-14010,29621,-15447,28897,-16846,28105,-18205,27244,-19520,26318,-20788,25329,-22005,24278,-23170,23169,-24279,22004,-25330,20787,-26319,19519,-27245,18204,-28106,16845,-28898,15446,-29622,14009,-30273,12539,-30852,11038,-31357,9511,-31786,7961,-32138,6392,-32413,4807,-32610,3211,-32728,1607,-32767,0,-32728,-1608,-32610,-3212,-32413,-4808,-32138,-6393,-31786,-7962,-31357,-9512,-30852,-11039,-30273,-12540,-29622,-14010,-28898,-15447,-28106,-16846,-27245,-18205,-26319,-19520,-25330,-20788,-24279,-22005,-23170,-23170,-22005,-24279,-20788,-25330,-19520,-26319,-18205,-27245,-16846,-28106,-15447,-28898,-14010,-29622,-12540,-30273,-11039,-30852,-9512,-31357,-7962,-31786,-6393,-32138,-4808,-32413,-3212,-32610,-1608,-32728};
+#ifdef D64STATS
+  time_stats_t ts_t,ts_d,ts_b;
+
+  reset_meas(&ts_t);
+  reset_meas(&ts_d);
+  reset_meas(&ts_b);
+  start_meas(&ts_t);
+#endif
+
+#ifdef D64STATS
+  stop_meas(&ts_t);
+  start_meas(&ts_d);
+#endif
+
+  xintl0 = _mm256_permutevar8x32_epi32(x256[0],perm_mask);  // x0  x4  x1  x5  x2  x6  x3  x7
+  xintl1 = _mm256_permutevar8x32_epi32(x256[1],perm_mask);  // x8  x12 x9  x13 x10 x14 x11 x15
+  xintl2 = _mm256_permutevar8x32_epi32(x256[2],perm_mask);  // x16 x20 x17 x21 x18 x22 x19 x23
+  xintl3 = _mm256_permutevar8x32_epi32(x256[3],perm_mask);  // x24 x28 x25 x29 x26 x30 x27 x31
+  xintl4 = _mm256_permutevar8x32_epi32(x256[4],perm_mask);  // x24 x28 x25 x29 x26 x30 x27 x31
+  xintl5 = _mm256_permutevar8x32_epi32(x256[5],perm_mask);  // x24 x28 x25 x29 x26 x30 x27 x31
+  xintl6 = _mm256_permutevar8x32_epi32(x256[6],perm_mask);  // x24 x28 x25 x29 x26 x30 x27 x31
+  xintl7 = _mm256_permutevar8x32_epi32(x256[7],perm_mask);  // x24 x28 x25 x29 x26 x30 x27 x31
+
+  xtmp[0] = _mm256_unpacklo_epi64(xintl0,xintl1);        // x0  x4  x8  x12 x1  x5  x9  x13
+  xtmp[4] = _mm256_unpackhi_epi64(xintl0,xintl1);        // x2  x6  x10 x14 x3  x7  x11 x15
+  xtmp[1] = _mm256_unpacklo_epi64(xintl2,xintl3);        // x16 x20 x24 x28 x17 x21 x25 x29
+  xtmp[5] = _mm256_unpackhi_epi64(xintl2,xintl3);        // x18 x22 x26 x30 x19 x23 x27 x31
+  xtmp[2] = _mm256_unpacklo_epi64(xintl4,xintl5);        // x32 x36 x40 x44 x33 x37 x41 x45
+  xtmp[6] = _mm256_unpackhi_epi64(xintl4,xintl5);        // x34 x38 x42 x46 x35 x39 x43 x47
+  xtmp[3] = _mm256_unpacklo_epi64(xintl6,xintl7);        // x48 x52 x56 x60 x49 x53 x57 x61
+  xtmp[7] = _mm256_unpackhi_epi64(xintl6,xintl7);        // x50 x54 x58 x62 x51 x55 x59 x63
+
+
+  idft16_simd256((int16_t*)(xtmp),(int16_t*)ytmp);
+  // [y0  y1  y2  y3  y16 y17 y18 y19]
+  // [y4  y5  y6  y7  y20 y21 y22 y23]
+  // [y8  y9  y10 y11 y24 y25 y26 y27]
+  // [y12 y13 y14 y15 y28 y29 y30 y31]
+
+  idft16_simd256((int16_t*)(xtmp+4),(int16_t*)(ytmp+4));
+  // [y32 y33 y34 y35 y48 y49 y50 y51]
+  // [y36 y37 y38 y39 y52 y53 y54 y55]
+  // [y40 y41 y42 y43 y56 y57 y58 y59]
+  // [y44 y45 y46 y47 y60 y61 y62 y63]
+
+#ifdef D64STATS
+  stop_meas(&ts_d);
+  start_meas(&ts_b);
+#endif
+
+
+  ibfly4_16_256(ytmp,ytmp+2,ytmp+4,ytmp+6,
+		y256,y256+2,y256+4,y256+6,
+		tw64a_256,tw64a_256+2,tw64a_256+4,
+		tw64b_256,tw64b_256+2,tw64b_256+4);
+  // [y0  y1  y2  y3  y4  y5  y6  y7]
+  // [y16 y17 y18 y19 y20 y21 y22 y23]
+  // [y32 y33 y34 y35 y36 y37 y38 y39]
+  // [y48 y49 y50 y51 y52 y53 y54 y55]
+
+  ibfly4_16_256(ytmp+1,ytmp+3,ytmp+5,ytmp+7,
+		y256+1,y256+3,y256+5,y256+7,
+		tw64a_256+1,tw64a_256+3,tw64a_256+5,
+		tw64b_256+1,tw64b_256+3,tw64b_256+5);
+  // [y8  y9  y10 y11 y12 y13 y14 y15]
+  // [y24 y25 y26 y27 y28 y29 y30 y31]
+  // [y40 y41 y42 y43 y44 y45 y46 y47]
+  // [y56 y57 y58 y59 y60 y61 y62 y63]
+
+
+#ifdef D64STATS
+  stop_meas(&ts_b);
+  printf("t: %llu cycles, d: %llu cycles, b: %llu cycles\n",ts_t.diff,ts_d.diff,ts_b.diff);
+#endif
+
+
+  if (scale>0) {
+    y256[0]  = shiftright_int16_simd256(y256[0],3);
+    y256[1]  = shiftright_int16_simd256(y256[1],3);
+    y256[2]  = shiftright_int16_simd256(y256[2],3);
+    y256[3]  = shiftright_int16_simd256(y256[3],3);
+    y256[4]  = shiftright_int16_simd256(y256[4],3);
+    y256[5]  = shiftright_int16_simd256(y256[5],3);
+    y256[6]  = shiftright_int16_simd256(y256[6],3);
+    y256[7]  = shiftright_int16_simd256(y256[7],3);
+  }
+
+  _mm_empty();
+  _m_empty();
+
+}
+#endif
 
-int16_t tw128c[128] __attribute__((aligned(16))) = {0,32767,1608,32727,3212,32609,4808,32412,6393,32137,7962,31785,9512,31356,11039,30851,12540,30272,14010,29621,15447,28897,16846,28105,18205,27244,19520,26318,20788,25329,22005,24278,23170,23169,24279,22004,25330,20787,26319,19519,27245,18204,28106,16845,28898,15446,29622,14009,30273,12539,30852,11038,31357,9511,31786,7961,32138,6392,32413,4807,32610,3211,32728,1607,32767,0,32728,-1608,32610,-3212,32413,-4808,32138,-6393,31786,-7962,31357,-9512,30852,-11039,30273,-12540,29622,-14010,28898,-15447,28106,-16846,27245,-18205,26319,-19520,25330,-20788,24279,-22005,23170,-23170,22005,-24279,20788,-25330,19520,-26319,18205,-27245,16846,-28106,15447,-28898,14010,-29622,12540,-30273,11039,-30852,9512,-31357,7962,-31786,6393,-32138,4808,-32413,3212,-32610,1608,-32728};
+int16_t tw128[128] __attribute__((aligned(32))) = {  32767,0,32727,-1608,32609,-3212,32412,-4808,32137,-6393,31785,-7962,31356,-9512,30851,-11039,30272,-12540,29621,-14010,28897,-15447,28105,-16846,27244,-18205,26318,-19520,25329,-20788,24278,-22005,23169,-23170,22004,-24279,20787,-25330,19519,-26319,18204,-27245,16845,-28106,15446,-28898,14009,-29622,12539,-30273,11038,-30852,9511,-31357,7961,-31786,6392,-32138,4807,-32413,3211,-32610,1607,-32728,0,-32767,-1608,-32728,-3212,-32610,-4808,-32413,-6393,-32138,-7962,-31786,-9512,-31357,-11039,-30852,-12540,-30273,-14010,-29622,-15447,-28898,-16846,-28106,-18205,-27245,-19520,-26319,-20788,-25330,-22005,-24279,-23170,-23170,-24279,-22005,-25330,-20788,-26319,-19520,-27245,-18205,-28106,-16846,-28898,-15447,-29622,-14010,-30273,-12540,-30852,-11039,-31357,-9512,-31786,-7962,-32138,-6393,-32413,-4808,-32610,-3212,-32728,-1608};
 
+int16_t tw128a[128] __attribute__((aligned(32))) = { 32767,0,32727,1608,32609,3212,32412,4808,32137,6393,31785,7962,31356,9512,30851,11039,30272,12540,29621,14010,28897,15447,28105,16846,27244,18205,26318,19520,25329,20788,24278,22005,23169,23170,22004,24279,20787,25330,19519,26319,18204,27245,16845,28106,15446,28898,14009,29622,12539,30273,11038,30852,9511,31357,7961,31786,6392,32138,4807,32413,3211,32610,1607,32728,0,32767,-1608,32728,-3212,32610,-4808,32413,-6393,32138,-7962,31786,-9512,31357,-11039,30852,-12540,30273,-14010,29622,-15447,28898,-16846,28106,-18205,27245,-19520,26319,-20788,25330,-22005,24279,-23170,23170,-24279,22005,-25330,20788,-26319,19520,-27245,18205,-28106,16846,-28898,15447,-29622,14010,-30273,12540,-30852,11039,-31357,9512,-31786,7962,-32138,6393,-32413,4808,-32610,3212,-32728,1608};
+
+int16_t tw128b[128] __attribute__((aligned(32))) = {0,32767,-1608,32727,-3212,32609,-4808,32412,-6393,32137,-7962,31785,-9512,31356,-11039,30851,-12540,30272,-14010,29621,-15447,28897,-16846,28105,-18205,27244,-19520,26318,-20788,25329,-22005,24278,-23170,23169,-24279,22004,-25330,20787,-26319,19519,-27245,18204,-28106,16845,-28898,15446,-29622,14009,-30273,12539,-30852,11038,-31357,9511,-31786,7961,-32138,6392,-32413,4807,-32610,3211,-32728,1607,-32767,0,-32728,-1608,-32610,-3212,-32413,-4808,-32138,-6393,-31786,-7962,-31357,-9512,-30852,-11039,-30273,-12540,-29622,-14010,-28898,-15447,-28106,-16846,-27245,-18205,-26319,-19520,-25330,-20788,-24279,-22005,-23170,-23170,-22005,-24279,-20788,-25330,-19520,-26319,-18205,-27245,-16846,-28106,-15447,-28898,-14010,-29622,-12540,-30273,-11039,-30852,-9512,-31357,-7962,-31786,-6393,-32138,-4808,-32413,-3212,-32610,-1608,-32728};
+
+int16_t tw128c[128] __attribute__((aligned(32))) = {0,32767,1608,32727,3212,32609,4808,32412,6393,32137,7962,31785,9512,31356,11039,30851,12540,30272,14010,29621,15447,28897,16846,28105,18205,27244,19520,26318,20788,25329,22005,24278,23170,23169,24279,22004,25330,20787,26319,19519,27245,18204,28106,16845,28898,15446,29622,14009,30273,12539,30852,11038,31357,9511,31786,7961,32138,6392,32413,4807,32610,3211,32728,1607,32767,0,32728,-1608,32610,-3212,32413,-4808,32138,-6393,31786,-7962,31357,-9512,30852,-11039,30273,-12540,29622,-14010,28898,-15447,28106,-16846,27245,-18205,26319,-19520,25330,-20788,24279,-22005,23170,-23170,22005,-24279,20788,-25330,19520,-26319,18205,-27245,16846,-28106,15447,-28898,14010,-29622,12540,-30273,11039,-30852,9512,-31357,7962,-31786,6393,-32138,4808,-32413,3212,-32610,1608,-32728};
+
+#ifndef __AVX2__
 void dft128(int16_t *x,int16_t *y,int scale)
 {
 
@@ -2000,6 +3157,8 @@ void dft128(int16_t *x,int16_t *y,int scale)
   dft64((int16_t*)(xtmp),(int16_t*)ytmp,1);
   dft64((int16_t*)(xtmp+32),(int16_t*)(ytmp+16),1);
 
+  /*  write_output("dft128a.m","dfta",ytmp,64,1,1);
+      write_output("dft128b.m","dftb",ytmp+16,64,1,1);*/
 
   for (i=0; i<16; i++) {
     bfly2_16(ytmpp,ytmpp+16,
@@ -2050,11 +3209,83 @@ void dft128(int16_t *x,int16_t *y,int scale)
 
   }
 
+  /*  write_output("dft128out.m","dft128",y,128,1,1);
+      exit(-1);*/
   _mm_empty();
   _m_empty();
 
 }
 
+#else // __AVX2__
+void dft128(int16_t *x,int16_t *y,int scale)
+{
+
+  simd256_q15_t xtmp[16],*x256 = (simd256_q15_t *)x;
+  simd256_q15_t ytmp[16],*y256=(simd256_q15_t*)y;
+  simd256_q15_t *tw128a_256p=(simd256_q15_t *)tw128a,*tw128b_256p=(simd256_q15_t *)tw128b,*y256p=(simd256_q15_t *)y;
+  simd256_q15_t *ytmpp = &ytmp[0];
+  int i;
+  simd256_q15_t ONE_OVER_SQRT2_Q15_256 = set1_int16_simd256(ONE_OVER_SQRT2_Q15);
+
+  transpose4_ooff_simd256(x256  ,xtmp,8);
+  transpose4_ooff_simd256(x256+2,xtmp+1,8);
+  transpose4_ooff_simd256(x256+4,xtmp+2,8);
+  transpose4_ooff_simd256(x256+6,xtmp+3,8);
+  transpose4_ooff_simd256(x256+8,xtmp+4,8);
+  transpose4_ooff_simd256(x256+10,xtmp+5,8);
+  transpose4_ooff_simd256(x256+12,xtmp+6,8);
+  transpose4_ooff_simd256(x256+14,xtmp+7,8);
+  
+  /*  write_output("dft128ina_256.m","dftina",xtmp,64,1,1);
+  write_output("dft128inb_256.m","dftinb",xtmp+8,64,1,1);
+  */
+
+  dft64((int16_t*)(xtmp),(int16_t*)ytmp,1);
+  dft64((int16_t*)(xtmp+8),(int16_t*)(ytmp+8),1);
+  
+  /*write_output("dft128outa_256.m","dftouta",ytmp,64,1,1);
+  write_output("dft128outb_256.m","dftoutb",ytmp+8,64,1,1);
+  */
+
+  for (i=0; i<8; i++) {
+    bfly2_16_256(ytmpp,ytmpp+8,
+		 y256p,y256p+8,
+		 tw128a_256p,
+		 tw128b_256p);
+    tw128a_256p++;
+    tw128b_256p++;
+    y256p++;
+    ytmpp++;
+  }
+
+  if (scale>0) {
+
+    y256[0] = mulhi_int16_simd256(y256[0],ONE_OVER_SQRT2_Q15_256);
+    y256[1] = mulhi_int16_simd256(y256[1],ONE_OVER_SQRT2_Q15_256);
+    y256[2] = mulhi_int16_simd256(y256[2],ONE_OVER_SQRT2_Q15_256);
+    y256[3] = mulhi_int16_simd256(y256[3],ONE_OVER_SQRT2_Q15_256);
+    y256[4] = mulhi_int16_simd256(y256[4],ONE_OVER_SQRT2_Q15_256);
+    y256[5] = mulhi_int16_simd256(y256[5],ONE_OVER_SQRT2_Q15_256);
+    y256[6] = mulhi_int16_simd256(y256[6],ONE_OVER_SQRT2_Q15_256);
+    y256[7] = mulhi_int16_simd256(y256[7],ONE_OVER_SQRT2_Q15_256);
+    y256[8] = mulhi_int16_simd256(y256[8],ONE_OVER_SQRT2_Q15_256);
+    y256[9] = mulhi_int16_simd256(y256[9],ONE_OVER_SQRT2_Q15_256);
+    y256[10] = mulhi_int16_simd256(y256[10],ONE_OVER_SQRT2_Q15_256);
+    y256[11] = mulhi_int16_simd256(y256[11],ONE_OVER_SQRT2_Q15_256);
+    y256[12] = mulhi_int16_simd256(y256[12],ONE_OVER_SQRT2_Q15_256);
+    y256[13] = mulhi_int16_simd256(y256[13],ONE_OVER_SQRT2_Q15_256);
+    y256[14] = mulhi_int16_simd256(y256[14],ONE_OVER_SQRT2_Q15_256);
+    y256[15] = mulhi_int16_simd256(y256[15],ONE_OVER_SQRT2_Q15_256);
+
+  }
+  
+  /*  write_output("dft128.m","dft",y256,128,1,1);
+      exit(-1);*/
+}
+
+#endif
+
+#ifndef __AVX2__
 void idft128(int16_t *x,int16_t *y,int scale)
 {
 
@@ -2153,22 +3384,80 @@ void idft128(int16_t *x,int16_t *y,int scale)
 
 }
 
+#else // __AVX2__
+void idft128(int16_t *x,int16_t *y,int scale)
+{
+
+  simd256_q15_t xtmp[16],*x256 = (simd256_q15_t *)x;
+  simd256_q15_t ytmp[16],*y256=(simd256_q15_t*)y;
+  simd256_q15_t *tw128_256p=(simd256_q15_t *)tw128,*y256p=(simd256_q15_t *)y;
+  simd256_q15_t *ytmpp = &ytmp[0];
+  int i;
+  simd256_q15_t ONE_OVER_SQRT2_Q15_256 = set1_int16_simd256(ONE_OVER_SQRT2_Q15);
+
+
+  transpose4_ooff_simd256(x256  ,xtmp,8);
+  transpose4_ooff_simd256(x256+2,xtmp+1,8);
+  transpose4_ooff_simd256(x256+4,xtmp+2,8);
+  transpose4_ooff_simd256(x256+6,xtmp+3,8);
+  transpose4_ooff_simd256(x256+8,xtmp+4,8);
+  transpose4_ooff_simd256(x256+10,xtmp+5,8);
+  transpose4_ooff_simd256(x256+12,xtmp+6,8);
+  transpose4_ooff_simd256(x256+14,xtmp+7,8);
+
+  idft64((int16_t*)(xtmp),(int16_t*)ytmp,1);
+  idft64((int16_t*)(xtmp+8),(int16_t*)(ytmp+8),1);
+
+
+  for (i=0; i<8; i++) {
+    ibfly2_256(ytmpp,ytmpp+8,
+	       y256p,y256p+8,
+	       tw128_256p);
+    tw128_256p++;
+    y256p++;
+    ytmpp++;
+  }
+
+  if (scale>0) {
+
+    y256[0] = mulhi_int16_simd256(y256[0],ONE_OVER_SQRT2_Q15_256);
+    y256[1] = mulhi_int16_simd256(y256[1],ONE_OVER_SQRT2_Q15_256);
+    y256[2] = mulhi_int16_simd256(y256[2],ONE_OVER_SQRT2_Q15_256);
+    y256[3] = mulhi_int16_simd256(y256[3],ONE_OVER_SQRT2_Q15_256);
+    y256[4] = mulhi_int16_simd256(y256[4],ONE_OVER_SQRT2_Q15_256);
+    y256[5] = mulhi_int16_simd256(y256[5],ONE_OVER_SQRT2_Q15_256);
+    y256[6] = mulhi_int16_simd256(y256[6],ONE_OVER_SQRT2_Q15_256);
+    y256[7] = mulhi_int16_simd256(y256[7],ONE_OVER_SQRT2_Q15_256);
+    y256[8] = mulhi_int16_simd256(y256[8],ONE_OVER_SQRT2_Q15_256);
+    y256[9] = mulhi_int16_simd256(y256[9],ONE_OVER_SQRT2_Q15_256);
+    y256[10] = mulhi_int16_simd256(y256[10],ONE_OVER_SQRT2_Q15_256);
+    y256[11] = mulhi_int16_simd256(y256[11],ONE_OVER_SQRT2_Q15_256);
+    y256[12] = mulhi_int16_simd256(y256[12],ONE_OVER_SQRT2_Q15_256);
+    y256[13] = mulhi_int16_simd256(y256[13],ONE_OVER_SQRT2_Q15_256);
+    y256[14] = mulhi_int16_simd256(y256[14],ONE_OVER_SQRT2_Q15_256);
+    y256[15] = mulhi_int16_simd256(y256[15],ONE_OVER_SQRT2_Q15_256);
+
+  }
+
+}
+
+#endif
 
-int16_t tw256[384] __attribute__((aligned(16))) = {  32767,0,32757,-805,32727,-1608,32678,-2411,32609,-3212,32520,-4012,32412,-4808,32284,-5602,32137,-6393,31970,-7180,31785,-7962,31580,-8740,31356,-9512,31113,-10279,30851,-11039,30571,-11793,30272,-12540,29955,-13279,29621,-14010,29268,-14733,28897,-15447,28510,-16151,28105,-16846,27683,-17531,27244,-18205,26789,-18868,26318,-19520,25831,-20160,25329,-20788,24811,-21403,24278,-22005,23731,-22595,23169,-23170,22594,-23732,22004,-24279,21402,-24812,20787,-25330,20159,-25832,19519,-26319,18867,-26790,18204,-27245,17530,-27684,16845,-28106,16150,-28511,15446,-28898,14732,-29269,14009,-29622,13278,-29956,12539,-30273,11792,-30572,11038,-30852,10278,-31114,9511,-31357,8739,-31581,7961,-31786,7179,-31971,6392,-32138,5601,-32285,4807,-32413,4011,-32521,3211,-32610,2410,-32679,1607,-32728,804,-32758,
+int16_t tw256[384] __attribute__((aligned(32))) = {  32767,0,32757,-805,32727,-1608,32678,-2411,32609,-3212,32520,-4012,32412,-4808,32284,-5602,32137,-6393,31970,-7180,31785,-7962,31580,-8740,31356,-9512,31113,-10279,30851,-11039,30571,-11793,30272,-12540,29955,-13279,29621,-14010,29268,-14733,28897,-15447,28510,-16151,28105,-16846,27683,-17531,27244,-18205,26789,-18868,26318,-19520,25831,-20160,25329,-20788,24811,-21403,24278,-22005,23731,-22595,23169,-23170,22594,-23732,22004,-24279,21402,-24812,20787,-25330,20159,-25832,19519,-26319,18867,-26790,18204,-27245,17530,-27684,16845,-28106,16150,-28511,15446,-28898,14732,-29269,14009,-29622,13278,-29956,12539,-30273,11792,-30572,11038,-30852,10278,-31114,9511,-31357,8739,-31581,7961,-31786,7179,-31971,6392,-32138,5601,-32285,4807,-32413,4011,-32521,3211,-32610,2410,-32679,1607,-32728,804,-32758,
                                                      32767,0,32727,-1608,32609,-3212,32412,-4808,32137,-6393,31785,-7962,31356,-9512,30851,-11039,30272,-12540,29621,-14010,28897,-15447,28105,-16846,27244,-18205,26318,-19520,25329,-20788,24278,-22005,23169,-23170,22004,-24279,20787,-25330,19519,-26319,18204,-27245,16845,-28106,15446,-28898,14009,-29622,12539,-30273,11038,-30852,9511,-31357,7961,-31786,6392,-32138,4807,-32413,3211,-32610,1607,-32728,0,-32767,-1608,-32728,-3212,-32610,-4808,-32413,-6393,-32138,-7962,-31786,-9512,-31357,-11039,-30852,-12540,-30273,-14010,-29622,-15447,-28898,-16846,-28106,-18205,-27245,-19520,-26319,-20788,-25330,-22005,-24279,-23170,-23170,-24279,-22005,-25330,-20788,-26319,-19520,-27245,-18205,-28106,-16846,-28898,-15447,-29622,-14010,-30273,-12540,-30852,-11039,-31357,-9512,-31786,-7962,-32138,-6393,-32413,-4808,-32610,-3212,-32728,-1608,
                                                      32767,0,32678,-2411,32412,-4808,31970,-7180,31356,-9512,30571,-11793,29621,-14010,28510,-16151,27244,-18205,25831,-20160,24278,-22005,22594,-23732,20787,-25330,18867,-26790,16845,-28106,14732,-29269,12539,-30273,10278,-31114,7961,-31786,5601,-32285,3211,-32610,804,-32758,-1608,-32728,-4012,-32521,-6393,-32138,-8740,-31581,-11039,-30852,-13279,-29956,-15447,-28898,-17531,-27684,-19520,-26319,-21403,-24812,-23170,-23170,-24812,-21403,-26319,-19520,-27684,-17531,-28898,-15447,-29956,-13279,-30852,-11039,-31581,-8740,-32138,-6393,-32521,-4012,-32728,-1608,-32758,804,-32610,3211,-32285,5601,-31786,7961,-31114,10278,-30273,12539,-29269,14732,-28106,16845,-26790,18867,-25330,20787,-23732,22594,-22005,24278,-20160,25831,-18205,27244,-16151,28510,-14010,29621,-11793,30571,-9512,31356,-7180,31970,-4808,32412,-2411,32678
                                                   };
 
-int16_t tw256a[384] __attribute__((aligned(16))) = { 32767,0,32757,804,32727,1607,32678,2410,32609,3211,32520,4011,32412,4807,32284,5601,32137,6392,31970,7179,31785,7961,31580,8739,31356,9511,31113,10278,30851,11038,30571,11792,30272,12539,29955,13278,29621,14009,29268,14732,28897,15446,28510,16150,28105,16845,27683,17530,27244,18204,26789,18867,26318,19519,25831,20159,25329,20787,24811,21402,24278,22004,23731,22594,23169,23169,22594,23731,22004,24278,21402,24811,20787,25329,20159,25831,19519,26318,18867,26789,18204,27244,17530,27683,16845,28105,16150,28510,15446,28897,14732,29268,14009,29621,13278,29955,12539,30272,11792,30571,11038,30851,10278,31113,9511,31356,8739,31580,7961,31785,7179,31970,6392,32137,5601,32284,4807,32412,4011,32520,3211,32609,2410,32678,1607,32727,804,32757,
+int16_t tw256a[384] __attribute__((aligned(32))) = { 32767,0,32757,804,32727,1607,32678,2410,32609,3211,32520,4011,32412,4807,32284,5601,32137,6392,31970,7179,31785,7961,31580,8739,31356,9511,31113,10278,30851,11038,30571,11792,30272,12539,29955,13278,29621,14009,29268,14732,28897,15446,28510,16150,28105,16845,27683,17530,27244,18204,26789,18867,26318,19519,25831,20159,25329,20787,24811,21402,24278,22004,23731,22594,23169,23169,22594,23731,22004,24278,21402,24811,20787,25329,20159,25831,19519,26318,18867,26789,18204,27244,17530,27683,16845,28105,16150,28510,15446,28897,14732,29268,14009,29621,13278,29955,12539,30272,11792,30571,11038,30851,10278,31113,9511,31356,8739,31580,7961,31785,7179,31970,6392,32137,5601,32284,4807,32412,4011,32520,3211,32609,2410,32678,1607,32727,804,32757,
                                                      32767,0,32727,1607,32609,3211,32412,4807,32137,6392,31785,7961,31356,9511,30851,11038,30272,12539,29621,14009,28897,15446,28105,16845,27244,18204,26318,19519,25329,20787,24278,22004,23169,23169,22004,24278,20787,25329,19519,26318,18204,27244,16845,28105,15446,28897,14009,29621,12539,30272,11038,30851,9511,31356,7961,31785,6392,32137,4807,32412,3211,32609,1607,32727,0,32767,-1608,32727,-3212,32609,-4808,32412,-6393,32137,-7962,31785,-9512,31356,-11039,30851,-12540,30272,-14010,29621,-15447,28897,-16846,28105,-18205,27244,-19520,26318,-20788,25329,-22005,24278,-23170,23169,-24279,22004,-25330,20787,-26319,19519,-27245,18204,-28106,16845,-28898,15446,-29622,14009,-30273,12539,-30852,11038,-31357,9511,-31786,7961,-32138,6392,-32413,4807,-32610,3211,-32728,1607,
                                                      32767,0,32678,2410,32412,4807,31970,7179,31356,9511,30571,11792,29621,14009,28510,16150,27244,18204,25831,20159,24278,22004,22594,23731,20787,25329,18867,26789,16845,28105,14732,29268,12539,30272,10278,31113,7961,31785,5601,32284,3211,32609,804,32757,-1608,32727,-4012,32520,-6393,32137,-8740,31580,-11039,30851,-13279,29955,-15447,28897,-17531,27683,-19520,26318,-21403,24811,-23170,23169,-24812,21402,-26319,19519,-27684,17530,-28898,15446,-29956,13278,-30852,11038,-31581,8739,-32138,6392,-32521,4011,-32728,1607,-32758,-805,-32610,-3212,-32285,-5602,-31786,-7962,-31114,-10279,-30273,-12540,-29269,-14733,-28106,-16846,-26790,-18868,-25330,-20788,-23732,-22595,-22005,-24279,-20160,-25832,-18205,-27245,-16151,-28511,-14010,-29622,-11793,-30572,-9512,-31357,-7180,-31971,-4808,-32413,-2411,-32679
                                                    };
 
-int16_t tw256b[384] __attribute__((aligned(16))) = {0,32767,-805,32757,-1608,32727,-2411,32678,-3212,32609,-4012,32520,-4808,32412,-5602,32284,-6393,32137,-7180,31970,-7962,31785,-8740,31580,-9512,31356,-10279,31113,-11039,30851,-11793,30571,-12540,30272,-13279,29955,-14010,29621,-14733,29268,-15447,28897,-16151,28510,-16846,28105,-17531,27683,-18205,27244,-18868,26789,-19520,26318,-20160,25831,-20788,25329,-21403,24811,-22005,24278,-22595,23731,-23170,23169,-23732,22594,-24279,22004,-24812,21402,-25330,20787,-25832,20159,-26319,19519,-26790,18867,-27245,18204,-27684,17530,-28106,16845,-28511,16150,-28898,15446,-29269,14732,-29622,14009,-29956,13278,-30273,12539,-30572,11792,-30852,11038,-31114,10278,-31357,9511,-31581,8739,-31786,7961,-31971,7179,-32138,6392,-32285,5601,-32413,4807,-32521,4011,-32610,3211,-32679,2410,-32728,1607,-32758,804,
+int16_t tw256b[384] __attribute__((aligned(32))) = {0,32767,-805,32757,-1608,32727,-2411,32678,-3212,32609,-4012,32520,-4808,32412,-5602,32284,-6393,32137,-7180,31970,-7962,31785,-8740,31580,-9512,31356,-10279,31113,-11039,30851,-11793,30571,-12540,30272,-13279,29955,-14010,29621,-14733,29268,-15447,28897,-16151,28510,-16846,28105,-17531,27683,-18205,27244,-18868,26789,-19520,26318,-20160,25831,-20788,25329,-21403,24811,-22005,24278,-22595,23731,-23170,23169,-23732,22594,-24279,22004,-24812,21402,-25330,20787,-25832,20159,-26319,19519,-26790,18867,-27245,18204,-27684,17530,-28106,16845,-28511,16150,-28898,15446,-29269,14732,-29622,14009,-29956,13278,-30273,12539,-30572,11792,-30852,11038,-31114,10278,-31357,9511,-31581,8739,-31786,7961,-31971,7179,-32138,6392,-32285,5601,-32413,4807,-32521,4011,-32610,3211,-32679,2410,-32728,1607,-32758,804,
                                                     0,32767,-1608,32727,-3212,32609,-4808,32412,-6393,32137,-7962,31785,-9512,31356,-11039,30851,-12540,30272,-14010,29621,-15447,28897,-16846,28105,-18205,27244,-19520,26318,-20788,25329,-22005,24278,-23170,23169,-24279,22004,-25330,20787,-26319,19519,-27245,18204,-28106,16845,-28898,15446,-29622,14009,-30273,12539,-30852,11038,-31357,9511,-31786,7961,-32138,6392,-32413,4807,-32610,3211,-32728,1607,-32767,0,-32728,-1608,-32610,-3212,-32413,-4808,-32138,-6393,-31786,-7962,-31357,-9512,-30852,-11039,-30273,-12540,-29622,-14010,-28898,-15447,-28106,-16846,-27245,-18205,-26319,-19520,-25330,-20788,-24279,-22005,-23170,-23170,-22005,-24279,-20788,-25330,-19520,-26319,-18205,-27245,-16846,-28106,-15447,-28898,-14010,-29622,-12540,-30273,-11039,-30852,-9512,-31357,-7962,-31786,-6393,-32138,-4808,-32413,-3212,-32610,-1608,-32728,
                                                     0,32767,-2411,32678,-4808,32412,-7180,31970,-9512,31356,-11793,30571,-14010,29621,-16151,28510,-18205,27244,-20160,25831,-22005,24278,-23732,22594,-25330,20787,-26790,18867,-28106,16845,-29269,14732,-30273,12539,-31114,10278,-31786,7961,-32285,5601,-32610,3211,-32758,804,-32728,-1608,-32521,-4012,-32138,-6393,-31581,-8740,-30852,-11039,-29956,-13279,-28898,-15447,-27684,-17531,-26319,-19520,-24812,-21403,-23170,-23170,-21403,-24812,-19520,-26319,-17531,-27684,-15447,-28898,-13279,-29956,-11039,-30852,-8740,-31581,-6393,-32138,-4012,-32521,-1608,-32728,804,-32758,3211,-32610,5601,-32285,7961,-31786,10278,-31114,12539,-30273,14732,-29269,16845,-28106,18867,-26790,20787,-25330,22594,-23732,24278,-22005,25831,-20160,27244,-18205,28510,-16151,29621,-14010,30571,-11793,31356,-9512,31970,-7180,32412,-4808,32678,-2411
                                                    };
-
+#ifndef __AVX2__
 void dft256(int16_t *x,int16_t *y,int scale)
 {
 
@@ -2337,25 +3626,205 @@ void idft256(int16_t *x,int16_t *y,int scale)
 
 }
 
-int16_t tw512[512] __attribute__((aligned(16))) = {
+#else //__AVX2__
+
+void dft256(int16_t *x,int16_t *y,int scale)
+{
+
+  simd256_q15_t xtmp[32],ytmp[32],*tw256a_256p=(simd256_q15_t *)tw256a,*tw256b_256p=(simd256_q15_t *)tw256b,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y;
+  simd256_q15_t *ytmpp = &ytmp[0];
+  int i;
+
+  transpose16_ooff_simd256(x256+0,xtmp+0,8);
+  transpose16_ooff_simd256(x256+4,xtmp+1,8);
+  transpose16_ooff_simd256(x256+8,xtmp+2,8);
+  transpose16_ooff_simd256(x256+12,xtmp+3,8);
+  transpose16_ooff_simd256(x256+16,xtmp+4,8);
+  transpose16_ooff_simd256(x256+20,xtmp+5,8);
+  transpose16_ooff_simd256(x256+24,xtmp+6,8);
+  transpose16_ooff_simd256(x256+28,xtmp+7,8);
+  /*
+  char vname[10];
+  for (i=0;i<32;i++) {
+    sprintf(vname,"xtmp%d",i);
+    print_shorts256(vname,(int16_t*)(xtmp+i));
+  }
+  exit(-1);*/
+
+  dft64((int16_t*)(xtmp),(int16_t*)(ytmp),1);
+  dft64((int16_t*)(xtmp+8),(int16_t*)(ytmp+8),1);
+  dft64((int16_t*)(xtmp+16),(int16_t*)(ytmp+16),1);
+  dft64((int16_t*)(xtmp+24),(int16_t*)(ytmp+24),1);
+
+
+  bfly4_16_256(ytmpp,ytmpp+8,ytmpp+16,ytmpp+24,
+	       y256p,y256p+8,y256p+16,y256p+24,
+	       tw256a_256p,tw256a_256p+8,tw256a_256p+16,
+	       tw256b_256p,tw256b_256p+8,tw256b_256p+16);
+  bfly4_16_256(ytmpp+1,ytmpp+9,ytmpp+17,ytmpp+25,
+	       y256p+1,y256p+9,y256p+17,y256p+25,
+	       tw256a_256p+1,tw256a_256p+9,tw256a_256p+17,
+	       tw256b_256p+1,tw256b_256p+9,tw256b_256p+17);
+  bfly4_16_256(ytmpp+2,ytmpp+10,ytmpp+18,ytmpp+26,
+	       y256p+2,y256p+10,y256p+18,y256p+26,
+	       tw256a_256p+2,tw256a_256p+10,tw256a_256p+18,
+	       tw256b_256p+2,tw256b_256p+10,tw256b_256p+18);
+  bfly4_16_256(ytmpp+3,ytmpp+11,ytmpp+19,ytmpp+27,
+	       y256p+3,y256p+11,y256p+19,y256p+27,
+	       tw256a_256p+3,tw256a_256p+11,tw256a_256p+19,
+	       tw256b_256p+3,tw256b_256p+11,tw256b_256p+19);
+  bfly4_16_256(ytmpp+4,ytmpp+12,ytmpp+20,ytmpp+28,
+	       y256p+4,y256p+12,y256p+20,y256p+28,
+	       tw256a_256p+4,tw256a_256p+12,tw256a_256p+20,
+	       tw256b_256p+4,tw256b_256p+12,tw256b_256p+20);
+  bfly4_16_256(ytmpp+5,ytmpp+13,ytmpp+21,ytmpp+29,
+	       y256p+5,y256p+13,y256p+21,y256p+29,
+	       tw256a_256p+5,tw256a_256p+13,tw256a_256p+21,
+	       tw256b_256p+5,tw256b_256p+13,tw256b_256p+21);
+  bfly4_16_256(ytmpp+6,ytmpp+14,ytmpp+22,ytmpp+30,
+	       y256p+6,y256p+14,y256p+22,y256p+30,
+	       tw256a_256p+6,tw256a_256p+14,tw256a_256p+22,
+	       tw256b_256p+6,tw256b_256p+14,tw256b_256p+22);
+  bfly4_16_256(ytmpp+7,ytmpp+15,ytmpp+23,ytmpp+31,
+	       y256p+7,y256p+15,y256p+23,y256p+31,
+	       tw256a_256p+7,tw256a_256p+15,tw256a_256p+23,
+	       tw256b_256p+7,tw256b_256p+15,tw256b_256p+23);
+
+  if (scale>0) {
+
+    for (i=0; i<2; i++) {
+      y256[0]  = shiftright_int16_simd256(y256[0],1);
+      y256[1]  = shiftright_int16_simd256(y256[1],1);
+      y256[2]  = shiftright_int16_simd256(y256[2],1);
+      y256[3]  = shiftright_int16_simd256(y256[3],1);
+      y256[4]  = shiftright_int16_simd256(y256[4],1);
+      y256[5]  = shiftright_int16_simd256(y256[5],1);
+      y256[6]  = shiftright_int16_simd256(y256[6],1);
+      y256[7]  = shiftright_int16_simd256(y256[7],1);
+      y256[8]  = shiftright_int16_simd256(y256[8],1);
+      y256[9]  = shiftright_int16_simd256(y256[9],1);
+      y256[10] = shiftright_int16_simd256(y256[10],1);
+      y256[11] = shiftright_int16_simd256(y256[11],1);
+      y256[12] = shiftright_int16_simd256(y256[12],1);
+      y256[13] = shiftright_int16_simd256(y256[13],1);
+      y256[14] = shiftright_int16_simd256(y256[14],1);
+      y256[15] = shiftright_int16_simd256(y256[15],1);
+
+      y256+=16;
+    }
+
+  }
+
+  _mm_empty();
+  _m_empty();
+
+}
+
+void idft256(int16_t *x,int16_t *y,int scale)
+{
+
+  simd256_q15_t xtmp[32],ytmp[32],*tw256_256p=(simd256_q15_t *)tw256,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y;
+  simd256_q15_t *ytmpp = &ytmp[0];
+  int i;
+
+  transpose16_ooff_simd256(x256+0,xtmp+0,8);
+  transpose16_ooff_simd256(x256+4,xtmp+1,8);
+  transpose16_ooff_simd256(x256+8,xtmp+2,8);
+  transpose16_ooff_simd256(x256+12,xtmp+3,8);
+  transpose16_ooff_simd256(x256+16,xtmp+4,8);
+  transpose16_ooff_simd256(x256+20,xtmp+5,8);
+  transpose16_ooff_simd256(x256+24,xtmp+6,8);
+  transpose16_ooff_simd256(x256+28,xtmp+7,8);
+  
+  idft64((int16_t*)(xtmp),(int16_t*)(ytmp),1);
+  idft64((int16_t*)(xtmp+8),(int16_t*)(ytmp+8),1);
+  idft64((int16_t*)(xtmp+16),(int16_t*)(ytmp+16),1);
+  idft64((int16_t*)(xtmp+24),(int16_t*)(ytmp+24),1);
+  
+  
+  ibfly4_256(ytmpp,ytmpp+8,ytmpp+16,ytmpp+24,
+	     y256p,y256p+8,y256p+16,y256p+24,
+	     tw256_256p,tw256_256p+8,tw256_256p+16);
+
+  ibfly4_256(ytmpp+1,ytmpp+9,ytmpp+17,ytmpp+25,
+	     y256p+1,y256p+9,y256p+17,y256p+25,
+	     tw256_256p+1,tw256_256p+9,tw256_256p+17);
+
+  ibfly4_256(ytmpp+2,ytmpp+10,ytmpp+18,ytmpp+26,
+	     y256p+2,y256p+10,y256p+18,y256p+26,
+	     tw256_256p+2,tw256_256p+10,tw256_256p+18);
+
+  ibfly4_256(ytmpp+3,ytmpp+11,ytmpp+19,ytmpp+27,
+	     y256p+3,y256p+11,y256p+19,y256p+27,
+	     tw256_256p+3,tw256_256p+11,tw256_256p+19);
+
+  ibfly4_256(ytmpp+4,ytmpp+12,ytmpp+20,ytmpp+28,
+	     y256p+4,y256p+12,y256p+20,y256p+28,
+	     tw256_256p+4,tw256_256p+12,tw256_256p+20);
+
+  ibfly4_256(ytmpp+5,ytmpp+13,ytmpp+21,ytmpp+29,
+	     y256p+5,y256p+13,y256p+21,y256p+29,
+	     tw256_256p+5,tw256_256p+13,tw256_256p+21);
+
+  ibfly4_256(ytmpp+6,ytmpp+14,ytmpp+22,ytmpp+30,
+	     y256p+6,y256p+14,y256p+22,y256p+30,
+	     tw256_256p+6,tw256_256p+14,tw256_256p+22);
+
+  ibfly4_256(ytmpp+7,ytmpp+15,ytmpp+23,ytmpp+31,
+	     y256p+7,y256p+15,y256p+23,y256p+31,
+	     tw256_256p+7,tw256_256p+15,tw256_256p+23);
+
+  
+  if (scale>0) {
+
+    for (i=0; i<2; i++) {
+      y256[0]  = shiftright_int16_simd256(y256[0],1);
+      y256[1]  = shiftright_int16_simd256(y256[1],1);
+      y256[2]  = shiftright_int16_simd256(y256[2],1);
+      y256[3]  = shiftright_int16_simd256(y256[3],1);
+      y256[4]  = shiftright_int16_simd256(y256[4],1);
+      y256[5]  = shiftright_int16_simd256(y256[5],1);
+      y256[6]  = shiftright_int16_simd256(y256[6],1);
+      y256[7]  = shiftright_int16_simd256(y256[7],1);
+      y256[8]  = shiftright_int16_simd256(y256[8],1);
+      y256[9]  = shiftright_int16_simd256(y256[9],1);
+      y256[10] = shiftright_int16_simd256(y256[10],1);
+      y256[11] = shiftright_int16_simd256(y256[11],1);
+      y256[12] = shiftright_int16_simd256(y256[12],1);
+      y256[13] = shiftright_int16_simd256(y256[13],1);
+      y256[14] = shiftright_int16_simd256(y256[14],1);
+      y256[15] = shiftright_int16_simd256(y256[15],1);
+
+      y256+=16;
+    }
+
+  }
+
+  _mm_empty();
+  _m_empty();
+
+}
+
+#endif
+int16_t tw512[512] __attribute__((aligned(32))) = {
   32767,0,32764,-403,32757,-805,32744,-1207,32727,-1608,32705,-2010,32678,-2411,32646,-2812,32609,-3212,32567,-3612,32520,-4012,32468,-4410,32412,-4808,32350,-5206,32284,-5602,32213,-5998,32137,-6393,32056,-6787,31970,-7180,31880,-7572,31785,-7962,31684,-8352,31580,-8740,31470,-9127,31356,-9512,31236,-9896,31113,-10279,30984,-10660,30851,-11039,30713,-11417,30571,-11793,30424,-12167,30272,-12540,30116,-12910,29955,-13279,29790,-13646,29621,-14010,29446,-14373,29268,-14733,29085,-15091,28897,-15447,28706,-15800,28510,-16151,28309,-16500,28105,-16846,27896,-17190,27683,-17531,27466,-17869,27244,-18205,27019,-18538,26789,-18868,26556,-19195,26318,-19520,26077,-19841,25831,-20160,25582,-20475,25329,-20788,25072,-21097,24811,-21403,24546,-21706,24278,-22005,24006,-22302,23731,-22595,23452,-22884,23169,-23170,22883,-23453,22594,-23732,22301,-24007,22004,-24279,21705,-24547,21402,-24812,21096,-25073,20787,-25330,20474,-25583,20159,-25832,19840,-26078,19519,-26319,19194,-26557,18867,-26790,18537,-27020,18204,-27245,17868,-27467,17530,-27684,17189,-27897,16845,-28106,16499,-28310,16150,-28511,15799,-28707,15446,-28898,15090,-29086,14732,-29269,14372,-29447,14009,-29622,13645,-29791,13278,-29956,12909,-30117,12539,-30273,12166,-30425,11792,-30572,11416,-30714,11038,-30852,10659,-30985,10278,-31114,9895,-31237,9511,-31357,9126,-31471,8739,-31581,8351,-31685,7961,-31786,7571,-31881,7179,-31971,6786,-32057,6392,-32138,5997,-32214,5601,-32285,5205,-32351,4807,-32413,4409,-32469,4011,-32521,3611,-32568,3211,-32610,2811,-32647,2410,-32679,2009,-32706,1607,-32728,1206,-32745,804,-32758,402,-32765,0,-32767,-403,-32765,-805,-32758,-1207,-32745,-1608,-32728,-2010,-32706,-2411,-32679,-2812,-32647,-3212,-32610,-3612,-32568,-4012,-32521,-4410,-32469,-4808,-32413,-5206,-32351,-5602,-32285,-5998,-32214,-6393,-32138,-6787,-32057,-7180,-31971,-7572,-31881,-7962,-31786,-8352,-31685,-8740,-31581,-9127,-31471,-9512,-31357,-9896,-31237,-10279,-31114,-10660,-30985,-11039,-30852,-11417,-30714,-11793,-30572,-12167,-30425,-12540,-30273,-12910,-30117,-13279,-29956,-13646,-29791,-14010,-29622,-14373,-29447,-14733,-29269,-15091,-29086,-15447,-28898,-15800,-28707,-16151,-28511,-16500,-28310,-16846,-28106,-17190,-27897,-17531,-27684,-17869,-27467,-18205,-27245,-18538,-27020,-18868,-26790,-19195,-26557,-19520,-26319,-19841,-26078,-20160,-25832,-20475,-25583,-20788,-25330,-21097,-25073,-21403,-24812,-21706,-24547,-22005,-24279,-22302,-24007,-22595,-23732,-22884,-23453,-23170,-23170,-23453,-22884,-23732,-22595,-24007,-22302,-24279,-22005,-24547,-21706,-24812,-21403,-25073,-21097,-25330,-20788,-25583,-20475,-25832,-20160,-26078,-19841,-26319,-19520,-26557,-19195,-26790,-18868,-27020,-18538,-27245,-18205,-27467,-17869,-27684,-17531,-27897,-17190,-28106,-16846,-28310,-16500,-28511,-16151,-28707,-15800,-28898,-15447,-29086,-15091,-29269,-14733,-29447,-14373,-29622,-14010,-29791,-13646,-29956,-13279,-30117,-12910,-30273,-12540,-30425,-12167,-30572,-11793,-30714,-11417,-30852,-11039,-30985,-10660,-31114,-10279,-31237,-9896,-31357,-9512,-31471,-9127,-31581,-8740,-31685,-8352,-31786,-7962,-31881,-7572,-31971,-7180,-32057,-6787,-32138,-6393,-32214,-5998,-32285,-5602,-32351,-5206,-32413,-4808,-32469,-4410,-32521,-4012,-32568,-3612,-32610,-3212,-32647,-2812,-32679,-2411,-32706,-2010,-32728,-1608,-32745,-1207,-32758,-805,-32765,-403
 };
 
-int16_t tw512a[512] __attribute__((aligned(16))) = {
+int16_t tw512a[512] __attribute__((aligned(32))) = {
   32767,0,32764,403,32757,805,32744,1207,32727,1608,32705,2010,32678,2411,32646,2812,32609,3212,32567,3612,32520,4012,32468,4410,32412,4808,32350,5206,32284,5602,32213,5998,32137,6393,32056,6787,31970,7180,31880,7572,31785,7962,31684,8352,31580,8740,31470,9127,31356,9512,31236,9896,31113,10279,30984,10660,30851,11039,30713,11417,30571,11793,30424,12167,30272,12540,30116,12910,29955,13279,29790,13646,29621,14010,29446,14373,29268,14733,29085,15091,28897,15447,28706,15800,28510,16151,28309,16500,28105,16846,27896,17190,27683,17531,27466,17869,27244,18205,27019,18538,26789,18868,26556,19195,26318,19520,26077,19841,25831,20160,25582,20475,25329,20788,25072,21097,24811,21403,24546,21706,24278,22005,24006,22302,23731,22595,23452,22884,23169,23170,22883,23453,22594,23732,22301,24007,22004,24279,21705,24547,21402,24812,21096,25073,20787,25330,20474,25583,20159,25832,19840,26078,19519,26319,19194,26557,18867,26790,18537,27020,18204,27245,17868,27467,17530,27684,17189,27897,16845,28106,16499,28310,16150,28511,15799,28707,15446,28898,15090,29086,14732,29269,14372,29447,14009,29622,13645,29791,13278,29956,12909,30117,12539,30273,12166,30425,11792,30572,11416,30714,11038,30852,10659,30985,10278,31114,9895,31237,9511,31357,9126,31471,8739,31581,8351,31685,7961,31786,7571,31881,7179,31971,6786,32057,6392,32138,5997,32214,5601,32285,5205,32351,4807,32413,4409,32469,4011,32521,3611,32568,3211,32610,2811,32647,2410,32679,2009,32706,1607,32728,1206,32745,804,32758,402,32765,0,32767,-403,32765,-805,32758,-1207,32745,-1608,32728,-2010,32706,-2411,32679,-2812,32647,-3212,32610,-3612,32568,-4012,32521,-4410,32469,-4808,32413,-5206,32351,-5602,32285,-5998,32214,-6393,32138,-6787,32057,-7180,31971,-7572,31881,-7962,31786,-8352,31685,-8740,31581,-9127,31471,-9512,31357,-9896,31237,-10279,31114,-10660,30985,-11039,30852,-11417,30714,-11793,30572,-12167,30425,-12540,30273,-12910,30117,-13279,29956,-13646,29791,-14010,29622,-14373,29447,-14733,29269,-15091,29086,-15447,28898,-15800,28707,-16151,28511,-16500,28310,-16846,28106,-17190,27897,-17531,27684,-17869,27467,-18205,27245,-18538,27020,-18868,26790,-19195,26557,-19520,26319,-19841,26078,-20160,25832,-20475,25583,-20788,25330,-21097,25073,-21403,24812,-21706,24547,-22005,24279,-22302,24007,-22595,23732,-22884,23453,-23170,23170,-23453,22884,-23732,22595,-24007,22302,-24279,22005,-24547,21706,-24812,21403,-25073,21097,-25330,20788,-25583,20475,-25832,20160,-26078,19841,-26319,19520,-26557,19195,-26790,18868,-27020,18538,-27245,18205,-27467,17869,-27684,17531,-27897,17190,-28106,16846,-28310,16500,-28511,16151,-28707,15800,-28898,15447,-29086,15091,-29269,14733,-29447,14373,-29622,14010,-29791,13646,-29956,13279,-30117,12910,-30273,12540,-30425,12167,-30572,11793,-30714,11417,-30852,11039,-30985,10660,-31114,10279,-31237,9896,-31357,9512,-31471,9127,-31581,8740,-31685,8352,-31786,7962,-31881,7572,-31971,7180,-32057,6787,-32138,6393,-32214,5998,-32285,5602,-32351,5206,-32413,4808,-32469,4410,-32521,4012,-32568,3612,-32610,3212,-32647,2812,-32679,2411,-32706,2010,-32728,1608,-32745,1207,-32758,805,-32765,403
 };
 
 
 
-int16_t tw512b[512] __attribute__((aligned(16))) = {
+int16_t tw512b[512] __attribute__((aligned(32))) = {
   0,32767,-403,32764,-805,32757,-1207,32744,-1608,32727,-2010,32705,-2411,32678,-2812,32646,-3212,32609,-3612,32567,-4012,32520,-4410,32468,-4808,32412,-5206,32350,-5602,32284,-5998,32213,-6393,32137,-6787,32056,-7180,31970,-7572,31880,-7962,31785,-8352,31684,-8740,31580,-9127,31470,-9512,31356,-9896,31236,-10279,31113,-10660,30984,-11039,30851,-11417,30713,-11793,30571,-12167,30424,-12540,30272,-12910,30116,-13279,29955,-13646,29790,-14010,29621,-14373,29446,-14733,29268,-15091,29085,-15447,28897,-15800,28706,-16151,28510,-16500,28309,-16846,28105,-17190,27896,-17531,27683,-17869,27466,-18205,27244,-18538,27019,-18868,26789,-19195,26556,-19520,26318,-19841,26077,-20160,25831,-20475,25582,-20788,25329,-21097,25072,-21403,24811,-21706,24546,-22005,24278,-22302,24006,-22595,23731,-22884,23452,-23170,23169,-23453,22883,-23732,22594,-24007,22301,-24279,22004,-24547,21705,-24812,21402,-25073,21096,-25330,20787,-25583,20474,-25832,20159,-26078,19840,-26319,19519,-26557,19194,-26790,18867,-27020,18537,-27245,18204,-27467,17868,-27684,17530,-27897,17189,-28106,16845,-28310,16499,-28511,16150,-28707,15799,-28898,15446,-29086,15090,-29269,14732,-29447,14372,-29622,14009,-29791,13645,-29956,13278,-30117,12909,-30273,12539,-30425,12166,-30572,11792,-30714,11416,-30852,11038,-30985,10659,-31114,10278,-31237,9895,-31357,9511,-31471,9126,-31581,8739,-31685,8351,-31786,7961,-31881,7571,-31971,7179,-32057,6786,-32138,6392,-32214,5997,-32285,5601,-32351,5205,-32413,4807,-32469,4409,-32521,4011,-32568,3611,-32610,3211,-32647,2811,-32679,2410,-32706,2009,-32728,1607,-32745,1206,-32758,804,-32765,402,-32767,0,-32765,-403,-32758,-805,-32745,-1207,-32728,-1608,-32706,-2010,-32679,-2411,-32647,-2812,-32610,-3212,-32568,-3612,-32521,-4012,-32469,-4410,-32413,-4808,-32351,-5206,-32285,-5602,-32214,-5998,-32138,-6393,-32057,-6787,-31971,-7180,-31881,-7572,-31786,-7962,-31685,-8352,-31581,-8740,-31471,-9127,-31357,-9512,-31237,-9896,-31114,-10279,-30985,-10660,-30852,-11039,-30714,-11417,-30572,-11793,-30425,-12167,-30273,-12540,-30117,-12910,-29956,-13279,-29791,-13646,-29622,-14010,-29447,-14373,-29269,-14733,-29086,-15091,-28898,-15447,-28707,-15800,-28511,-16151,-28310,-16500,-28106,-16846,-27897,-17190,-27684,-17531,-27467,-17869,-27245,-18205,-27020,-18538,-26790,-18868,-26557,-19195,-26319,-19520,-26078,-19841,-25832,-20160,-25583,-20475,-25330,-20788,-25073,-21097,-24812,-21403,-24547,-21706,-24279,-22005,-24007,-22302,-23732,-22595,-23453,-22884,-23170,-23170,-22884,-23453,-22595,-23732,-22302,-24007,-22005,-24279,-21706,-24547,-21403,-24812,-21097,-25073,-20788,-25330,-20475,-25583,-20160,-25832,-19841,-26078,-19520,-26319,-19195,-26557,-18868,-26790,-18538,-27020,-18205,-27245,-17869,-27467,-17531,-27684,-17190,-27897,-16846,-28106,-16500,-28310,-16151,-28511,-15800,-28707,-15447,-28898,-15091,-29086,-14733,-29269,-14373,-29447,-14010,-29622,-13646,-29791,-13279,-29956,-12910,-30117,-12540,-30273,-12167,-30425,-11793,-30572,-11417,-30714,-11039,-30852,-10660,-30985,-10279,-31114,-9896,-31237,-9512,-31357,-9127,-31471,-8740,-31581,-8352,-31685,-7962,-31786,-7572,-31881,-7180,-31971,-6787,-32057,-6393,-32138,-5998,-32214,-5602,-32285,-5206,-32351,-4808,-32413,-4410,-32469,-4012,-32521,-3612,-32568,-3212,-32610,-2812,-32647,-2411,-32679,-2010,-32706,-1608,-32728,-1207,-32745,-805,-32758,-403,-32765
 };
 
-int16_t tw512c[512] __attribute__((aligned(16))) = {
+int16_t tw512c[512] __attribute__((aligned(32))) = {
   0,32767,403,32764,805,32757,1207,32744,1608,32727,2010,32705,2411,32678,2812,32646,3212,32609,3612,32567,4012,32520,4410,32468,4808,32412,5206,32350,5602,32284,5998,32213,6393,32137,6787,32056,7180,31970,7572,31880,7962,31785,8352,31684,8740,31580,9127,31470,9512,31356,9896,31236,10279,31113,10660,30984,11039,30851,11417,30713,11793,30571,12167,30424,12540,30272,12910,30116,13279,29955,13646,29790,14010,29621,14373,29446,14733,29268,15091,29085,15447,28897,15800,28706,16151,28510,16500,28309,16846,28105,17190,27896,17531,27683,17869,27466,18205,27244,18538,27019,18868,26789,19195,26556,19520,26318,19841,26077,20160,25831,20475,25582,20788,25329,21097,25072,21403,24811,21706,24546,22005,24278,22302,24006,22595,23731,22884,23452,23170,23169,23453,22883,23732,22594,24007,22301,24279,22004,24547,21705,24812,21402,25073,21096,25330,20787,25583,20474,25832,20159,26078,19840,26319,19519,26557,19194,26790,18867,27020,18537,27245,18204,27467,17868,27684,17530,27897,17189,28106,16845,28310,16499,28511,16150,28707,15799,28898,15446,29086,15090,29269,14732,29447,14372,29622,14009,29791,13645,29956,13278,30117,12909,30273,12539,30425,12166,30572,11792,30714,11416,30852,11038,30985,10659,31114,10278,31237,9895,31357,9511,31471,9126,31581,8739,31685,8351,31786,7961,31881,7571,31971,7179,32057,6786,32138,6392,32214,5997,32285,5601,32351,5205,32413,4807,32469,4409,32521,4011,32568,3611,32610,3211,32647,2811,32679,2410,32706,2009,32728,1607,32745,1206,32758,804,32765,402,32767,0,32765,-403,32758,-805,32745,-1207,32728,-1608,32706,-2010,32679,-2411,32647,-2812,32610,-3212,32568,-3612,32521,-4012,32469,-4410,32413,-4808,32351,-5206,32285,-5602,32214,-5998,32138,-6393,32057,-6787,31971,-7180,31881,-7572,31786,-7962,31685,-8352,31581,-8740,31471,-9127,31357,-9512,31237,-9896,31114,-10279,30985,-10660,30852,-11039,30714,-11417,30572,-11793,30425,-12167,30273,-12540,30117,-12910,29956,-13279,29791,-13646,29622,-14010,29447,-14373,29269,-14733,29086,-15091,28898,-15447,28707,-15800,28511,-16151,28310,-16500,28106,-16846,27897,-17190,27684,-17531,27467,-17869,27245,-18205,27020,-18538,26790,-18868,26557,-19195,26319,-19520,26078,-19841,25832,-20160,25583,-20475,25330,-20788,25073,-21097,24812,-21403,24547,-21706,24279,-22005,24007,-22302,23732,-22595,23453,-22884,23170,-23170,22884,-23453,22595,-23732,22302,-24007,22005,-24279,21706,-24547,21403,-24812,21097,-25073,20788,-25330,20475,-25583,20160,-25832,19841,-26078,19520,-26319,19195,-26557,18868,-26790,18538,-27020,18205,-27245,17869,-27467,17531,-27684,17190,-27897,16846,-28106,16500,-28310,16151,-28511,15800,-28707,15447,-28898,15091,-29086,14733,-29269,14373,-29447,14010,-29622,13646,-29791,13279,-29956,12910,-30117,12540,-30273,12167,-30425,11793,-30572,11417,-30714,11039,-30852,10660,-30985,10279,-31114,9896,-31237,9512,-31357,9127,-31471,8740,-31581,8352,-31685,7962,-31786,7572,-31881,7180,-31971,6787,-32057,6393,-32138,5998,-32214,5602,-32285,5206,-32351,4808,-32413,4410,-32469,4012,-32521,3612,-32568,3212,-32610,2812,-32647,2411,-32679,2010,-32706,1608,-32728,1207,-32745,805,-32758,403,-32765
 };
 
-
+#ifndef __AVX2__
 void dft512(int16_t *x,int16_t *y,int scale)
 {
 
@@ -2566,11 +4035,179 @@ void idft512(int16_t *x,int16_t *y,int scale)
 
 }
 
-int16_t tw1024[1536] __attribute__((aligned(16))) = {  32767,0,32766,-202,32764,-403,32761,-604,32757,-805,32751,-1006,32744,-1207,32736,-1407,32727,-1608,32717,-1809,32705,-2010,32692,-2210,32678,-2411,32662,-2611,32646,-2812,32628,-3012,32609,-3212,32588,-3412,32567,-3612,32544,-3812,32520,-4012,32495,-4211,32468,-4410,32441,-4609,32412,-4808,32382,-5007,32350,-5206,32318,-5404,32284,-5602,32249,-5800,32213,-5998,32176,-6196,32137,-6393,32097,-6590,32056,-6787,32014,-6983,31970,-7180,31926,-7376,31880,-7572,31833,-7767,31785,-7962,31735,-8157,31684,-8352,31633,-8546,31580,-8740,31525,-8933,31470,-9127,31413,-9320,31356,-9512,31297,-9704,31236,-9896,31175,-10088,31113,-10279,31049,-10470,30984,-10660,30918,-10850,30851,-11039,30783,-11228,30713,-11417,30643,-11605,30571,-11793,30498,-11981,30424,-12167,30349,-12354,30272,-12540,30195,-12725,30116,-12910,30036,-13095,29955,-13279,29873,-13463,29790,-13646,29706,-13828,29621,-14010,29534,-14192,29446,-14373,29358,-14553,29268,-14733,29177,-14912,29085,-15091,28992,-15269,28897,-15447,28802,-15624,28706,-15800,28608,-15976,28510,-16151,28410,-16326,28309,-16500,28208,-16673,28105,-16846,28001,-17018,27896,-17190,27790,-17361,27683,-17531,27575,-17700,27466,-17869,27355,-18037,27244,-18205,27132,-18372,27019,-18538,26905,-18703,26789,-18868,26673,-19032,26556,-19195,26437,-19358,26318,-19520,26198,-19681,26077,-19841,25954,-20001,25831,-20160,25707,-20318,25582,-20475,25456,-20632,25329,-20788,25201,-20943,25072,-21097,24942,-21250,24811,-21403,24679,-21555,24546,-21706,24413,-21856,24278,-22005,24143,-22154,24006,-22302,23869,-22449,23731,-22595,23592,-22740,23452,-22884,23311,-23028,23169,-23170,23027,-23312,22883,-23453,22739,-23593,22594,-23732,22448,-23870,22301,-24007,22153,-24144,22004,-24279,21855,-24414,21705,-24547,21554,-24680,21402,-24812,21249,-24943,21096,-25073,20942,-25202,20787,-25330,20631,-25457,20474,-25583,20317,-25708,20159,-25832,20000,-25955,19840,-26078,19680,-26199,19519,-26319,19357,-26438,19194,-26557,19031,-26674,18867,-26790,18702,-26906,18537,-27020,18371,-27133,18204,-27245,18036,-27356,17868,-27467,17699,-27576,17530,-27684,17360,-27791,17189,-27897,17017,-28002,16845,-28106,16672,-28209,16499,-28310,16325,-28411,16150,-28511,15975,-28609,15799,-28707,15623,-28803,15446,-28898,15268,-28993,15090,-29086,14911,-29178,14732,-29269,14552,-29359,14372,-29447,14191,-29535,14009,-29622,13827,-29707,13645,-29791,13462,-29874,13278,-29956,13094,-30037,12909,-30117,12724,-30196,12539,-30273,12353,-30350,12166,-30425,11980,-30499,11792,-30572,11604,-30644,11416,-30714,11227,-30784,11038,-30852,10849,-30919,10659,-30985,10469,-31050,10278,-31114,10087,-31176,9895,-31237,9703,-31298,9511,-31357,9319,-31414,9126,-31471,8932,-31526,8739,-31581,8545,-31634,8351,-31685,8156,-31736,7961,-31786,7766,-31834,7571,-31881,7375,-31927,7179,-31971,6982,-32015,6786,-32057,6589,-32098,6392,-32138,6195,-32177,5997,-32214,5799,-32250,5601,-32285,5403,-32319,5205,-32351,5006,-32383,4807,-32413,4608,-32442,4409,-32469,4210,-32496,4011,-32521,3811,-32545,3611,-32568,3411,-32589,3211,-32610,3011,-32629,2811,-32647,2610,-32663,2410,-32679,2209,-32693,2009,-32706,1808,-32718,1607,-32728,1406,-32737,1206,-32745,1005,-32752,804,-32758,603,-32762,402,-32765,201,-32767,
+#else //__AVX2__
+
+void dft512(int16_t *x,int16_t *y,int scale)
+{
+
+  simd256_q15_t xtmp[64],*x256 = (simd256_q15_t *)x;
+  simd256_q15_t ytmp[64],*y256=(simd256_q15_t*)y;
+  simd256_q15_t *tw512_256p=(simd256_q15_t*)tw512,*y256p=(simd256_q15_t *)y;
+  simd256_q15_t *ytmpp = &ytmp[0];
+  int i;
+  simd256_q15_t ONE_OVER_SQRT2_Q15_256 = set1_int16_simd256(ONE_OVER_SQRT2_Q15);
+
+
+  transpose4_ooff_simd256(x256  ,xtmp,32);
+  transpose4_ooff_simd256(x256+2,xtmp+1,32);
+  transpose4_ooff_simd256(x256+4,xtmp+2,32);
+  transpose4_ooff_simd256(x256+6,xtmp+3,32);
+  transpose4_ooff_simd256(x256+8,xtmp+4,32);
+  transpose4_ooff_simd256(x256+10,xtmp+5,32);
+  transpose4_ooff_simd256(x256+12,xtmp+6,32);
+  transpose4_ooff_simd256(x256+14,xtmp+7,32);
+  transpose4_ooff_simd256(x256+16,xtmp+8,32);
+  transpose4_ooff_simd256(x256+18,xtmp+9,32);
+  transpose4_ooff_simd256(x256+20,xtmp+10,32);
+  transpose4_ooff_simd256(x256+22,xtmp+11,32);
+  transpose4_ooff_simd256(x256+24,xtmp+12,32);
+  transpose4_ooff_simd256(x256+26,xtmp+13,32);
+  transpose4_ooff_simd256(x256+28,xtmp+14,32);
+  transpose4_ooff_simd256(x256+30,xtmp+15,32);
+  transpose4_ooff_simd256(x256+32,xtmp+16,32);
+  transpose4_ooff_simd256(x256+34,xtmp+17,32);
+  transpose4_ooff_simd256(x256+36,xtmp+18,32);
+  transpose4_ooff_simd256(x256+38,xtmp+19,32);
+  transpose4_ooff_simd256(x256+40,xtmp+20,32);
+  transpose4_ooff_simd256(x256+42,xtmp+21,32);
+  transpose4_ooff_simd256(x256+44,xtmp+22,32);
+  transpose4_ooff_simd256(x256+46,xtmp+23,32);
+  transpose4_ooff_simd256(x256+48,xtmp+24,32);
+  transpose4_ooff_simd256(x256+50,xtmp+25,32);
+  transpose4_ooff_simd256(x256+52,xtmp+26,32);
+  transpose4_ooff_simd256(x256+54,xtmp+27,32);
+  transpose4_ooff_simd256(x256+56,xtmp+28,32);
+  transpose4_ooff_simd256(x256+58,xtmp+29,32);
+  transpose4_ooff_simd256(x256+60,xtmp+30,32);
+  transpose4_ooff_simd256(x256+62,xtmp+31,32);
+
+  dft256((int16_t*)(xtmp),(int16_t*)ytmp,1);
+  dft256((int16_t*)(xtmp+32),(int16_t*)(ytmp+32),1);
+
+
+  for (i=0; i<32; i++) {
+    bfly2_256(ytmpp,ytmpp+32,
+	      y256p,y256p+32,
+	      tw512_256p);
+    tw512_256p++;
+    y256p++;
+    ytmpp++;
+  }
+
+  if (scale>0) {
+
+    for (i=0;i<4;i++) {
+      y256[0] = mulhi_int16_simd256(y256[0],ONE_OVER_SQRT2_Q15_256);
+      y256[1] = mulhi_int16_simd256(y256[1],ONE_OVER_SQRT2_Q15_256);
+      y256[2] = mulhi_int16_simd256(y256[2],ONE_OVER_SQRT2_Q15_256);
+      y256[3] = mulhi_int16_simd256(y256[3],ONE_OVER_SQRT2_Q15_256);
+      y256[4] = mulhi_int16_simd256(y256[4],ONE_OVER_SQRT2_Q15_256);
+      y256[5] = mulhi_int16_simd256(y256[5],ONE_OVER_SQRT2_Q15_256);
+      y256[6] = mulhi_int16_simd256(y256[6],ONE_OVER_SQRT2_Q15_256);
+      y256[7] = mulhi_int16_simd256(y256[7],ONE_OVER_SQRT2_Q15_256);
+      y256[8] = mulhi_int16_simd256(y256[8],ONE_OVER_SQRT2_Q15_256);
+      y256[9] = mulhi_int16_simd256(y256[9],ONE_OVER_SQRT2_Q15_256);
+      y256[10] = mulhi_int16_simd256(y256[10],ONE_OVER_SQRT2_Q15_256);
+      y256[11] = mulhi_int16_simd256(y256[11],ONE_OVER_SQRT2_Q15_256);
+      y256[12] = mulhi_int16_simd256(y256[12],ONE_OVER_SQRT2_Q15_256);
+      y256[13] = mulhi_int16_simd256(y256[13],ONE_OVER_SQRT2_Q15_256);
+      y256[14] = mulhi_int16_simd256(y256[14],ONE_OVER_SQRT2_Q15_256);
+      y256[15] = mulhi_int16_simd256(y256[15],ONE_OVER_SQRT2_Q15_256);
+      y256+=16;
+    }
+  }
+
+}
+
+void idft512(int16_t *x,int16_t *y,int scale)
+{
+
+  simd256_q15_t xtmp[64],*x256 = (simd256_q15_t *)x;
+  simd256_q15_t ytmp[64],*y256=(simd256_q15_t*)y;
+  simd256_q15_t *tw512_256p=(simd256_q15_t *)tw512,*y256p=(simd256_q15_t *)y;
+  simd256_q15_t *ytmpp = &ytmp[0];
+  int i;
+  simd256_q15_t ONE_OVER_SQRT2_Q15_256 = set1_int16_simd256(ONE_OVER_SQRT2_Q15);
+
+
+  transpose4_ooff_simd256(x256  ,xtmp,32);
+  transpose4_ooff_simd256(x256+2,xtmp+1,32);
+  transpose4_ooff_simd256(x256+4,xtmp+2,32);
+  transpose4_ooff_simd256(x256+6,xtmp+3,32);
+  transpose4_ooff_simd256(x256+8,xtmp+4,32);
+  transpose4_ooff_simd256(x256+10,xtmp+5,32);
+  transpose4_ooff_simd256(x256+12,xtmp+6,32);
+  transpose4_ooff_simd256(x256+14,xtmp+7,32);
+  transpose4_ooff_simd256(x256+16,xtmp+8,32);
+  transpose4_ooff_simd256(x256+18,xtmp+9,32);
+  transpose4_ooff_simd256(x256+20,xtmp+10,32);
+  transpose4_ooff_simd256(x256+22,xtmp+11,32);
+  transpose4_ooff_simd256(x256+24,xtmp+12,32);
+  transpose4_ooff_simd256(x256+26,xtmp+13,32);
+  transpose4_ooff_simd256(x256+28,xtmp+14,32);
+  transpose4_ooff_simd256(x256+30,xtmp+15,32);
+  transpose4_ooff_simd256(x256+32,xtmp+16,32);
+  transpose4_ooff_simd256(x256+34,xtmp+17,32);
+  transpose4_ooff_simd256(x256+36,xtmp+18,32);
+  transpose4_ooff_simd256(x256+38,xtmp+19,32);
+  transpose4_ooff_simd256(x256+40,xtmp+20,32);
+  transpose4_ooff_simd256(x256+42,xtmp+21,32);
+  transpose4_ooff_simd256(x256+44,xtmp+22,32);
+  transpose4_ooff_simd256(x256+46,xtmp+23,32);
+  transpose4_ooff_simd256(x256+48,xtmp+24,32);
+  transpose4_ooff_simd256(x256+50,xtmp+25,32);
+  transpose4_ooff_simd256(x256+52,xtmp+26,32);
+  transpose4_ooff_simd256(x256+54,xtmp+27,32);
+  transpose4_ooff_simd256(x256+56,xtmp+28,32);
+  transpose4_ooff_simd256(x256+58,xtmp+29,32);
+  transpose4_ooff_simd256(x256+60,xtmp+30,32);
+  transpose4_ooff_simd256(x256+62,xtmp+31,32);
+
+  idft256((int16_t*)(xtmp),(int16_t*)ytmp,1);
+  idft256((int16_t*)(xtmp+32),(int16_t*)(ytmp+32),1);
+
+
+  for (i=0; i<32; i++) {
+    ibfly2_256(ytmpp,ytmpp+32,
+	       y256p,y256p+32,
+	       tw512_256p);
+    tw512_256p++;
+    y256p++;
+    ytmpp++;
+  }
+
+  if (scale>0) {
+
+    for (i=0;i<4;i++) {
+      y256[0] = mulhi_int16_simd256(y256[0],ONE_OVER_SQRT2_Q15_256);
+      y256[1] = mulhi_int16_simd256(y256[1],ONE_OVER_SQRT2_Q15_256);
+      y256[2] = mulhi_int16_simd256(y256[2],ONE_OVER_SQRT2_Q15_256);
+      y256[3] = mulhi_int16_simd256(y256[3],ONE_OVER_SQRT2_Q15_256);
+      y256[4] = mulhi_int16_simd256(y256[4],ONE_OVER_SQRT2_Q15_256);
+      y256[5] = mulhi_int16_simd256(y256[5],ONE_OVER_SQRT2_Q15_256);
+      y256[6] = mulhi_int16_simd256(y256[6],ONE_OVER_SQRT2_Q15_256);
+      y256[7] = mulhi_int16_simd256(y256[7],ONE_OVER_SQRT2_Q15_256);
+      y256[8] = mulhi_int16_simd256(y256[8],ONE_OVER_SQRT2_Q15_256);
+      y256[9] = mulhi_int16_simd256(y256[9],ONE_OVER_SQRT2_Q15_256);
+      y256[10] = mulhi_int16_simd256(y256[10],ONE_OVER_SQRT2_Q15_256);
+      y256[11] = mulhi_int16_simd256(y256[11],ONE_OVER_SQRT2_Q15_256);
+      y256[12] = mulhi_int16_simd256(y256[12],ONE_OVER_SQRT2_Q15_256);
+      y256[13] = mulhi_int16_simd256(y256[13],ONE_OVER_SQRT2_Q15_256);
+      y256[14] = mulhi_int16_simd256(y256[14],ONE_OVER_SQRT2_Q15_256);
+      y256[15] = mulhi_int16_simd256(y256[15],ONE_OVER_SQRT2_Q15_256);
+      y256+=16;
+    }
+  }
+
+}
+
+#endif
+
+int16_t tw1024[1536] __attribute__((aligned(32))) = {  32767,0,32766,-202,32764,-403,32761,-604,32757,-805,32751,-1006,32744,-1207,32736,-1407,32727,-1608,32717,-1809,32705,-2010,32692,-2210,32678,-2411,32662,-2611,32646,-2812,32628,-3012,32609,-3212,32588,-3412,32567,-3612,32544,-3812,32520,-4012,32495,-4211,32468,-4410,32441,-4609,32412,-4808,32382,-5007,32350,-5206,32318,-5404,32284,-5602,32249,-5800,32213,-5998,32176,-6196,32137,-6393,32097,-6590,32056,-6787,32014,-6983,31970,-7180,31926,-7376,31880,-7572,31833,-7767,31785,-7962,31735,-8157,31684,-8352,31633,-8546,31580,-8740,31525,-8933,31470,-9127,31413,-9320,31356,-9512,31297,-9704,31236,-9896,31175,-10088,31113,-10279,31049,-10470,30984,-10660,30918,-10850,30851,-11039,30783,-11228,30713,-11417,30643,-11605,30571,-11793,30498,-11981,30424,-12167,30349,-12354,30272,-12540,30195,-12725,30116,-12910,30036,-13095,29955,-13279,29873,-13463,29790,-13646,29706,-13828,29621,-14010,29534,-14192,29446,-14373,29358,-14553,29268,-14733,29177,-14912,29085,-15091,28992,-15269,28897,-15447,28802,-15624,28706,-15800,28608,-15976,28510,-16151,28410,-16326,28309,-16500,28208,-16673,28105,-16846,28001,-17018,27896,-17190,27790,-17361,27683,-17531,27575,-17700,27466,-17869,27355,-18037,27244,-18205,27132,-18372,27019,-18538,26905,-18703,26789,-18868,26673,-19032,26556,-19195,26437,-19358,26318,-19520,26198,-19681,26077,-19841,25954,-20001,25831,-20160,25707,-20318,25582,-20475,25456,-20632,25329,-20788,25201,-20943,25072,-21097,24942,-21250,24811,-21403,24679,-21555,24546,-21706,24413,-21856,24278,-22005,24143,-22154,24006,-22302,23869,-22449,23731,-22595,23592,-22740,23452,-22884,23311,-23028,23169,-23170,23027,-23312,22883,-23453,22739,-23593,22594,-23732,22448,-23870,22301,-24007,22153,-24144,22004,-24279,21855,-24414,21705,-24547,21554,-24680,21402,-24812,21249,-24943,21096,-25073,20942,-25202,20787,-25330,20631,-25457,20474,-25583,20317,-25708,20159,-25832,20000,-25955,19840,-26078,19680,-26199,19519,-26319,19357,-26438,19194,-26557,19031,-26674,18867,-26790,18702,-26906,18537,-27020,18371,-27133,18204,-27245,18036,-27356,17868,-27467,17699,-27576,17530,-27684,17360,-27791,17189,-27897,17017,-28002,16845,-28106,16672,-28209,16499,-28310,16325,-28411,16150,-28511,15975,-28609,15799,-28707,15623,-28803,15446,-28898,15268,-28993,15090,-29086,14911,-29178,14732,-29269,14552,-29359,14372,-29447,14191,-29535,14009,-29622,13827,-29707,13645,-29791,13462,-29874,13278,-29956,13094,-30037,12909,-30117,12724,-30196,12539,-30273,12353,-30350,12166,-30425,11980,-30499,11792,-30572,11604,-30644,11416,-30714,11227,-30784,11038,-30852,10849,-30919,10659,-30985,10469,-31050,10278,-31114,10087,-31176,9895,-31237,9703,-31298,9511,-31357,9319,-31414,9126,-31471,8932,-31526,8739,-31581,8545,-31634,8351,-31685,8156,-31736,7961,-31786,7766,-31834,7571,-31881,7375,-31927,7179,-31971,6982,-32015,6786,-32057,6589,-32098,6392,-32138,6195,-32177,5997,-32214,5799,-32250,5601,-32285,5403,-32319,5205,-32351,5006,-32383,4807,-32413,4608,-32442,4409,-32469,4210,-32496,4011,-32521,3811,-32545,3611,-32568,3411,-32589,3211,-32610,3011,-32629,2811,-32647,2610,-32663,2410,-32679,2209,-32693,2009,-32706,1808,-32718,1607,-32728,1406,-32737,1206,-32745,1005,-32752,804,-32758,603,-32762,402,-32765,201,-32767,
                                                        32767,0,32764,-403,32757,-805,32744,-1207,32727,-1608,32705,-2010,32678,-2411,32646,-2812,32609,-3212,32567,-3612,32520,-4012,32468,-4410,32412,-4808,32350,-5206,32284,-5602,32213,-5998,32137,-6393,32056,-6787,31970,-7180,31880,-7572,31785,-7962,31684,-8352,31580,-8740,31470,-9127,31356,-9512,31236,-9896,31113,-10279,30984,-10660,30851,-11039,30713,-11417,30571,-11793,30424,-12167,30272,-12540,30116,-12910,29955,-13279,29790,-13646,29621,-14010,29446,-14373,29268,-14733,29085,-15091,28897,-15447,28706,-15800,28510,-16151,28309,-16500,28105,-16846,27896,-17190,27683,-17531,27466,-17869,27244,-18205,27019,-18538,26789,-18868,26556,-19195,26318,-19520,26077,-19841,25831,-20160,25582,-20475,25329,-20788,25072,-21097,24811,-21403,24546,-21706,24278,-22005,24006,-22302,23731,-22595,23452,-22884,23169,-23170,22883,-23453,22594,-23732,22301,-24007,22004,-24279,21705,-24547,21402,-24812,21096,-25073,20787,-25330,20474,-25583,20159,-25832,19840,-26078,19519,-26319,19194,-26557,18867,-26790,18537,-27020,18204,-27245,17868,-27467,17530,-27684,17189,-27897,16845,-28106,16499,-28310,16150,-28511,15799,-28707,15446,-28898,15090,-29086,14732,-29269,14372,-29447,14009,-29622,13645,-29791,13278,-29956,12909,-30117,12539,-30273,12166,-30425,11792,-30572,11416,-30714,11038,-30852,10659,-30985,10278,-31114,9895,-31237,9511,-31357,9126,-31471,8739,-31581,8351,-31685,7961,-31786,7571,-31881,7179,-31971,6786,-32057,6392,-32138,5997,-32214,5601,-32285,5205,-32351,4807,-32413,4409,-32469,4011,-32521,3611,-32568,3211,-32610,2811,-32647,2410,-32679,2009,-32706,1607,-32728,1206,-32745,804,-32758,402,-32765,0,-32767,-403,-32765,-805,-32758,-1207,-32745,-1608,-32728,-2010,-32706,-2411,-32679,-2812,-32647,-3212,-32610,-3612,-32568,-4012,-32521,-4410,-32469,-4808,-32413,-5206,-32351,-5602,-32285,-5998,-32214,-6393,-32138,-6787,-32057,-7180,-31971,-7572,-31881,-7962,-31786,-8352,-31685,-8740,-31581,-9127,-31471,-9512,-31357,-9896,-31237,-10279,-31114,-10660,-30985,-11039,-30852,-11417,-30714,-11793,-30572,-12167,-30425,-12540,-30273,-12910,-30117,-13279,-29956,-13646,-29791,-14010,-29622,-14373,-29447,-14733,-29269,-15091,-29086,-15447,-28898,-15800,-28707,-16151,-28511,-16500,-28310,-16846,-28106,-17190,-27897,-17531,-27684,-17869,-27467,-18205,-27245,-18538,-27020,-18868,-26790,-19195,-26557,-19520,-26319,-19841,-26078,-20160,-25832,-20475,-25583,-20788,-25330,-21097,-25073,-21403,-24812,-21706,-24547,-22005,-24279,-22302,-24007,-22595,-23732,-22884,-23453,-23170,-23170,-23453,-22884,-23732,-22595,-24007,-22302,-24279,-22005,-24547,-21706,-24812,-21403,-25073,-21097,-25330,-20788,-25583,-20475,-25832,-20160,-26078,-19841,-26319,-19520,-26557,-19195,-26790,-18868,-27020,-18538,-27245,-18205,-27467,-17869,-27684,-17531,-27897,-17190,-28106,-16846,-28310,-16500,-28511,-16151,-28707,-15800,-28898,-15447,-29086,-15091,-29269,-14733,-29447,-14373,-29622,-14010,-29791,-13646,-29956,-13279,-30117,-12910,-30273,-12540,-30425,-12167,-30572,-11793,-30714,-11417,-30852,-11039,-30985,-10660,-31114,-10279,-31237,-9896,-31357,-9512,-31471,-9127,-31581,-8740,-31685,-8352,-31786,-7962,-31881,-7572,-31971,-7180,-32057,-6787,-32138,-6393,-32214,-5998,-32285,-5602,-32351,-5206,-32413,-4808,-32469,-4410,-32521,-4012,-32568,-3612,-32610,-3212,-32647,-2812,-32679,-2411,-32706,-2010,-32728,-1608,-32745,-1207,-32758,-805,-32765,-403,
                                                        32767,0,32761,-604,32744,-1207,32717,-1809,32678,-2411,32628,-3012,32567,-3612,32495,-4211,32412,-4808,32318,-5404,32213,-5998,32097,-6590,31970,-7180,31833,-7767,31684,-8352,31525,-8933,31356,-9512,31175,-10088,30984,-10660,30783,-11228,30571,-11793,30349,-12354,30116,-12910,29873,-13463,29621,-14010,29358,-14553,29085,-15091,28802,-15624,28510,-16151,28208,-16673,27896,-17190,27575,-17700,27244,-18205,26905,-18703,26556,-19195,26198,-19681,25831,-20160,25456,-20632,25072,-21097,24679,-21555,24278,-22005,23869,-22449,23452,-22884,23027,-23312,22594,-23732,22153,-24144,21705,-24547,21249,-24943,20787,-25330,20317,-25708,19840,-26078,19357,-26438,18867,-26790,18371,-27133,17868,-27467,17360,-27791,16845,-28106,16325,-28411,15799,-28707,15268,-28993,14732,-29269,14191,-29535,13645,-29791,13094,-30037,12539,-30273,11980,-30499,11416,-30714,10849,-30919,10278,-31114,9703,-31298,9126,-31471,8545,-31634,7961,-31786,7375,-31927,6786,-32057,6195,-32177,5601,-32285,5006,-32383,4409,-32469,3811,-32545,3211,-32610,2610,-32663,2009,-32706,1406,-32737,804,-32758,201,-32767,-403,-32765,-1006,-32752,-1608,-32728,-2210,-32693,-2812,-32647,-3412,-32589,-4012,-32521,-4609,-32442,-5206,-32351,-5800,-32250,-6393,-32138,-6983,-32015,-7572,-31881,-8157,-31736,-8740,-31581,-9320,-31414,-9896,-31237,-10470,-31050,-11039,-30852,-11605,-30644,-12167,-30425,-12725,-30196,-13279,-29956,-13828,-29707,-14373,-29447,-14912,-29178,-15447,-28898,-15976,-28609,-16500,-28310,-17018,-28002,-17531,-27684,-18037,-27356,-18538,-27020,-19032,-26674,-19520,-26319,-20001,-25955,-20475,-25583,-20943,-25202,-21403,-24812,-21856,-24414,-22302,-24007,-22740,-23593,-23170,-23170,-23593,-22740,-24007,-22302,-24414,-21856,-24812,-21403,-25202,-20943,-25583,-20475,-25955,-20001,-26319,-19520,-26674,-19032,-27020,-18538,-27356,-18037,-27684,-17531,-28002,-17018,-28310,-16500,-28609,-15976,-28898,-15447,-29178,-14912,-29447,-14373,-29707,-13828,-29956,-13279,-30196,-12725,-30425,-12167,-30644,-11605,-30852,-11039,-31050,-10470,-31237,-9896,-31414,-9320,-31581,-8740,-31736,-8157,-31881,-7572,-32015,-6983,-32138,-6393,-32250,-5800,-32351,-5206,-32442,-4609,-32521,-4012,-32589,-3412,-32647,-2812,-32693,-2210,-32728,-1608,-32752,-1006,-32765,-403,-32767,201,-32758,804,-32737,1406,-32706,2009,-32663,2610,-32610,3211,-32545,3811,-32469,4409,-32383,5006,-32285,5601,-32177,6195,-32057,6786,-31927,7375,-31786,7961,-31634,8545,-31471,9126,-31298,9703,-31114,10278,-30919,10849,-30714,11416,-30499,11980,-30273,12539,-30037,13094,-29791,13645,-29535,14191,-29269,14732,-28993,15268,-28707,15799,-28411,16325,-28106,16845,-27791,17360,-27467,17868,-27133,18371,-26790,18867,-26438,19357,-26078,19840,-25708,20317,-25330,20787,-24943,21249,-24547,21705,-24144,22153,-23732,22594,-23312,23027,-22884,23452,-22449,23869,-22005,24278,-21555,24679,-21097,25072,-20632,25456,-20160,25831,-19681,26198,-19195,26556,-18703,26905,-18205,27244,-17700,27575,-17190,27896,-16673,28208,-16151,28510,-15624,28802,-15091,29085,-14553,29358,-14010,29621,-13463,29873,-12910,30116,-12354,30349,-11793,30571,-11228,30783,-10660,30984,-10088,31175,-9512,31356,-8933,31525,-8352,31684,-7767,31833,-7180,31970,-6590,32097,-5998,32213,-5404,32318,-4808,32412,-4211,32495,-3612,32567,-3012,32628,-2411,32678,-1809,32717,-1207,32744,-604,32761
                                                     };
-
+#ifndef __AVX2__
 void dft1024(int16_t *x,int16_t *y,int scale)
 {
 
@@ -2683,13 +4320,127 @@ void idft1024(int16_t *x,int16_t *y,int scale)
 
 }
 
-int16_t tw2048[2048] __attribute__((aligned(16))) = {32767,0,32766,-101,32766,-202,32765,-302,32764,-403,32763,-503,32761,-604,32759,-704,32757,-805,32754,-905,32751,-1006,32748,-1106,32744,-1207,32740,-1307,32736,-1407,32732,-1508,32727,-1608,32722,-1709,32717,-1809,32711,-1909,32705,-2010,32699,-2110,32692,-2210,32685,-2311,32678,-2411,32670,-2511,32662,-2611,32654,-2712,32646,-2812,32637,-2912,32628,-3012,32618,-3112,32609,-3212,32599,-3312,32588,-3412,32578,-3512,32567,-3612,32556,-3712,32544,-3812,32532,-3912,32520,-4012,32508,-4111,32495,-4211,32482,-4311,32468,-4410,32455,-4510,32441,-4609,32426,-4709,32412,-4808,32397,-4908,32382,-5007,32366,-5107,32350,-5206,32334,-5305,32318,-5404,32301,-5503,32284,-5602,32267,-5701,32249,-5800,32231,-5899,32213,-5998,32194,-6097,32176,-6196,32156,-6294,32137,-6393,32117,-6492,32097,-6590,32077,-6689,32056,-6787,32035,-6885,32014,-6983,31992,-7082,31970,-7180,31948,-7278,31926,-7376,31903,-7474,31880,-7572,31856,-7669,31833,-7767,31809,-7865,31785,-7962,31760,-8060,31735,-8157,31710,-8254,31684,-8352,31659,-8449,31633,-8546,31606,-8643,31580,-8740,31553,-8837,31525,-8933,31498,-9030,31470,-9127,31442,-9223,31413,-9320,31385,-9416,31356,-9512,31326,-9608,31297,-9704,31267,-9800,31236,-9896,31206,-9992,31175,-10088,31144,-10183,31113,-10279,31081,-10374,31049,-10470,31017,-10565,30984,-10660,30951,-10755,30918,-10850,30885,-10945,30851,-11039,30817,-11134,30783,-11228,30748,-11323,30713,-11417,30678,-11511,30643,-11605,30607,-11699,30571,-11793,30535,-11887,30498,-11981,30461,-12074,30424,-12167,30386,-12261,30349,-12354,30311,-12447,30272,-12540,30234,-12633,30195,-12725,30156,-12818,30116,-12910,30076,-13003,30036,-13095,29996,-13187,29955,-13279,29915,-13371,29873,-13463,29832,-13554,29790,-13646,29748,-13737,29706,-13828,29663,-13919,29621,-14010,29577,-14101,29534,-14192,29490,-14282,29446,-14373,29402,-14463,29358,-14553,29313,-14643,29268,-14733,29222,-14823,29177,-14912,29131,-15002,29085,-15091,29038,-15180,28992,-15269,28945,-15358,28897,-15447,28850,-15535,28802,-15624,28754,-15712,28706,-15800,28657,-15888,28608,-15976,28559,-16064,28510,-16151,28460,-16239,28410,-16326,28360,-16413,28309,-16500,28259,-16587,28208,-16673,28156,-16760,28105,-16846,28053,-16932,28001,-17018,27948,-17104,27896,-17190,27843,-17275,27790,-17361,27736,-17446,27683,-17531,27629,-17616,27575,-17700,27520,-17785,27466,-17869,27411,-17953,27355,-18037,27300,-18121,27244,-18205,27188,-18288,27132,-18372,27076,-18455,27019,-18538,26962,-18621,26905,-18703,26847,-18786,26789,-18868,26731,-18950,26673,-19032,26615,-19114,26556,-19195,26497,-19277,26437,-19358,26378,-19439,26318,-19520,26258,-19600,26198,-19681,26137,-19761,26077,-19841,26016,-19921,25954,-20001,25893,-20080,25831,-20160,25769,-20239,25707,-20318,25645,-20397,25582,-20475,25519,-20554,25456,-20632,25392,-20710,25329,-20788,25265,-20865,25201,-20943,25136,-21020,25072,-21097,25007,-21174,24942,-21250,24877,-21327,24811,-21403,24745,-21479,24679,-21555,24613,-21630,24546,-21706,24480,-21781,24413,-21856,24346,-21931,24278,-22005,24211,-22080,24143,-22154,24075,-22228,24006,-22302,23938,-22375,23869,-22449,23800,-22522,23731,-22595,23661,-22667,23592,-22740,23522,-22812,23452,-22884,23382,-22956,23311,-23028,23240,-23099,23169,-23170,23098,-23241,23027,-23312,22955,-23383,22883,-23453,22811,-23523,22739,-23593,22666,-23662,22594,-23732,22521,-23801,22448,-23870,22374,-23939,22301,-24007,22227,-24076,22153,-24144,22079,-24212,22004,-24279,21930,-24347,21855,-24414,21780,-24481,21705,-24547,21629,-24614,21554,-24680,21478,-24746,21402,-24812,21326,-24878,21249,-24943,21173,-25008,21096,-25073,21019,-25137,20942,-25202,20864,-25266,20787,-25330,20709,-25393,20631,-25457,20553,-25520,20474,-25583,20396,-25646,20317,-25708,20238,-25770,20159,-25832,20079,-25894,20000,-25955,19920,-26017,19840,-26078,19760,-26138,19680,-26199,19599,-26259,19519,-26319,19438,-26379,19357,-26438,19276,-26498,19194,-26557,19113,-26616,19031,-26674,18949,-26732,18867,-26790,18785,-26848,18702,-26906,18620,-26963,18537,-27020,18454,-27077,18371,-27133,18287,-27189,18204,-27245,18120,-27301,18036,-27356,17952,-27412,17868,-27467,17784,-27521,17699,-27576,17615,-27630,17530,-27684,17445,-27737,17360,-27791,17274,-27844,17189,-27897,17103,-27949,17017,-28002,16931,-28054,16845,-28106,16759,-28157,16672,-28209,16586,-28260,16499,-28310,16412,-28361,16325,-28411,16238,-28461,16150,-28511,16063,-28560,15975,-28609,15887,-28658,15799,-28707,15711,-28755,15623,-28803,15534,-28851,15446,-28898,15357,-28946,15268,-28993,15179,-29039,15090,-29086,15001,-29132,14911,-29178,14822,-29223,14732,-29269,14642,-29314,14552,-29359,14462,-29403,14372,-29447,14281,-29491,14191,-29535,14100,-29578,14009,-29622,13918,-29664,13827,-29707,13736,-29749,13645,-29791,13553,-29833,13462,-29874,13370,-29916,13278,-29956,13186,-29997,13094,-30037,13002,-30077,12909,-30117,12817,-30157,12724,-30196,12632,-30235,12539,-30273,12446,-30312,12353,-30350,12260,-30387,12166,-30425,12073,-30462,11980,-30499,11886,-30536,11792,-30572,11698,-30608,11604,-30644,11510,-30679,11416,-30714,11322,-30749,11227,-30784,11133,-30818,11038,-30852,10944,-30886,10849,-30919,10754,-30952,10659,-30985,10564,-31018,10469,-31050,10373,-31082,10278,-31114,10182,-31145,10087,-31176,9991,-31207,9895,-31237,9799,-31268,9703,-31298,9607,-31327,9511,-31357,9415,-31386,9319,-31414,9222,-31443,9126,-31471,9029,-31499,8932,-31526,8836,-31554,8739,-31581,8642,-31607,8545,-31634,8448,-31660,8351,-31685,8253,-31711,8156,-31736,8059,-31761,7961,-31786,7864,-31810,7766,-31834,7668,-31857,7571,-31881,7473,-31904,7375,-31927,7277,-31949,7179,-31971,7081,-31993,6982,-32015,6884,-32036,6786,-32057,6688,-32078,6589,-32098,6491,-32118,6392,-32138,6293,-32157,6195,-32177,6096,-32195,5997,-32214,5898,-32232,5799,-32250,5700,-32268,5601,-32285,5502,-32302,5403,-32319,5304,-32335,5205,-32351,5106,-32367,5006,-32383,4907,-32398,4807,-32413,4708,-32427,4608,-32442,4509,-32456,4409,-32469,4310,-32483,4210,-32496,4110,-32509,4011,-32521,3911,-32533,3811,-32545,3711,-32557,3611,-32568,3511,-32579,3411,-32589,3311,-32600,3211,-32610,3111,-32619,3011,-32629,2911,-32638,2811,-32647,2711,-32655,2610,-32663,2510,-32671,2410,-32679,2310,-32686,2209,-32693,2109,-32700,2009,-32706,1908,-32712,1808,-32718,1708,-32723,1607,-32728,1507,-32733,1406,-32737,1306,-32741,1206,-32745,1105,-32749,1005,-32752,904,-32755,804,-32758,703,-32760,603,-32762,502,-32764,402,-32765,301,-32766,201,-32767,100,-32767,0,-32767,-101,-32767,-202,-32767,-302,-32766,-403,-32765,-503,-32764,-604,-32762,-704,-32760,-805,-32758,-905,-32755,-1006,-32752,-1106,-32749,-1207,-32745,-1307,-32741,-1407,-32737,-1508,-32733,-1608,-32728,-1709,-32723,-1809,-32718,-1909,-32712,-2010,-32706,-2110,-32700,-2210,-32693,-2311,-32686,-2411,-32679,-2511,-32671,-2611,-32663,-2712,-32655,-2812,-32647,-2912,-32638,-3012,-32629,-3112,-32619,-3212,-32610,-3312,-32600,-3412,-32589,-3512,-32579,-3612,-32568,-3712,-32557,-3812,-32545,-3912,-32533,-4012,-32521,-4111,-32509,-4211,-32496,-4311,-32483,-4410,-32469,-4510,-32456,-4609,-32442,-4709,-32427,-4808,-32413,-4908,-32398,-5007,-32383,-5107,-32367,-5206,-32351,-5305,-32335,-5404,-32319,-5503,-32302,-5602,-32285,-5701,-32268,-5800,-32250,-5899,-32232,-5998,-32214,-6097,-32195,-6196,-32177,-6294,-32157,-6393,-32138,-6492,-32118,-6590,-32098,-6689,-32078,-6787,-32057,-6885,-32036,-6983,-32015,-7082,-31993,-7180,-31971,-7278,-31949,-7376,-31927,-7474,-31904,-7572,-31881,-7669,-31857,-7767,-31834,-7865,-31810,-7962,-31786,-8060,-31761,-8157,-31736,-8254,-31711,-8352,-31685,-8449,-31660,-8546,-31634,-8643,-31607,-8740,-31581,-8837,-31554,-8933,-31526,-9030,-31499,-9127,-31471,-9223,-31443,-9320,-31414,-9416,-31386,-9512,-31357,-9608,-31327,-9704,-31298,-9800,-31268,-9896,-31237,-9992,-31207,-10088,-31176,-10183,-31145,-10279,-31114,-10374,-31082,-10470,-31050,-10565,-31018,-10660,-30985,-10755,-30952,-10850,-30919,-10945,-30886,-11039,-30852,-11134,-30818,-11228,-30784,-11323,-30749,-11417,-30714,-11511,-30679,-11605,-30644,-11699,-30608,-11793,-30572,-11887,-30536,-11981,-30499,-12074,-30462,-12167,-30425,-12261,-30387,-12354,-30350,-12447,-30312,-12540,-30273,-12633,-30235,-12725,-30196,-12818,-30157,-12910,-30117,-13003,-30077,-13095,-30037,-13187,-29997,-13279,-29956,-13371,-29916,-13463,-29874,-13554,-29833,-13646,-29791,-13737,-29749,-13828,-29707,-13919,-29664,-14010,-29622,-14101,-29578,-14192,-29535,-14282,-29491,-14373,-29447,-14463,-29403,-14553,-29359,-14643,-29314,-14733,-29269,-14823,-29223,-14912,-29178,-15002,-29132,-15091,-29086,-15180,-29039,-15269,-28993,-15358,-28946,-15447,-28898,-15535,-28851,-15624,-28803,-15712,-28755,-15800,-28707,-15888,-28658,-15976,-28609,-16064,-28560,-16151,-28511,-16239,-28461,-16326,-28411,-16413,-28361,-16500,-28310,-16587,-28260,-16673,-28209,-16760,-28157,-16846,-28106,-16932,-28054,-17018,-28002,-17104,-27949,-17190,-27897,-17275,-27844,-17361,-27791,-17446,-27737,-17531,-27684,-17616,-27630,-17700,-27576,-17785,-27521,-17869,-27467,-17953,-27412,-18037,-27356,-18121,-27301,-18205,-27245,-18288,-27189,-18372,-27133,-18455,-27077,-18538,-27020,-18621,-26963,-18703,-26906,-18786,-26848,-18868,-26790,-18950,-26732,-19032,-26674,-19114,-26616,-19195,-26557,-19277,-26498,-19358,-26438,-19439,-26379,-19520,-26319,-19600,-26259,-19681,-26199,-19761,-26138,-19841,-26078,-19921,-26017,-20001,-25955,-20080,-25894,-20160,-25832,-20239,-25770,-20318,-25708,-20397,-25646,-20475,-25583,-20554,-25520,-20632,-25457,-20710,-25393,-20788,-25330,-20865,-25266,-20943,-25202,-21020,-25137,-21097,-25073,-21174,-25008,-21250,-24943,-21327,-24878,-21403,-24812,-21479,-24746,-21555,-24680,-21630,-24614,-21706,-24547,-21781,-24481,-21856,-24414,-21931,-24347,-22005,-24279,-22080,-24212,-22154,-24144,-22228,-24076,-22302,-24007,-22375,-23939,-22449,-23870,-22522,-23801,-22595,-23732,-22667,-23662,-22740,-23593,-22812,-23523,-22884,-23453,-22956,-23383,-23028,-23312,-23099,-23241,-23170,-23170,-23241,-23099,-23312,-23028,-23383,-22956,-23453,-22884,-23523,-22812,-23593,-22740,-23662,-22667,-23732,-22595,-23801,-22522,-23870,-22449,-23939,-22375,-24007,-22302,-24076,-22228,-24144,-22154,-24212,-22080,-24279,-22005,-24347,-21931,-24414,-21856,-24481,-21781,-24547,-21706,-24614,-21630,-24680,-21555,-24746,-21479,-24812,-21403,-24878,-21327,-24943,-21250,-25008,-21174,-25073,-21097,-25137,-21020,-25202,-20943,-25266,-20865,-25330,-20788,-25393,-20710,-25457,-20632,-25520,-20554,-25583,-20475,-25646,-20397,-25708,-20318,-25770,-20239,-25832,-20160,-25894,-20080,-25955,-20001,-26017,-19921,-26078,-19841,-26138,-19761,-26199,-19681,-26259,-19600,-26319,-19520,-26379,-19439,-26438,-19358,-26498,-19277,-26557,-19195,-26616,-19114,-26674,-19032,-26732,-18950,-26790,-18868,-26848,-18786,-26906,-18703,-26963,-18621,-27020,-18538,-27077,-18455,-27133,-18372,-27189,-18288,-27245,-18205,-27301,-18121,-27356,-18037,-27412,-17953,-27467,-17869,-27521,-17785,-27576,-17700,-27630,-17616,-27684,-17531,-27737,-17446,-27791,-17361,-27844,-17275,-27897,-17190,-27949,-17104,-28002,-17018,-28054,-16932,-28106,-16846,-28157,-16760,-28209,-16673,-28260,-16587,-28310,-16500,-28361,-16413,-28411,-16326,-28461,-16239,-28511,-16151,-28560,-16064,-28609,-15976,-28658,-15888,-28707,-15800,-28755,-15712,-28803,-15624,-28851,-15535,-28898,-15447,-28946,-15358,-28993,-15269,-29039,-15180,-29086,-15091,-29132,-15002,-29178,-14912,-29223,-14823,-29269,-14733,-29314,-14643,-29359,-14553,-29403,-14463,-29447,-14373,-29491,-14282,-29535,-14192,-29578,-14101,-29622,-14010,-29664,-13919,-29707,-13828,-29749,-13737,-29791,-13646,-29833,-13554,-29874,-13463,-29916,-13371,-29956,-13279,-29997,-13187,-30037,-13095,-30077,-13003,-30117,-12910,-30157,-12818,-30196,-12725,-30235,-12633,-30273,-12540,-30312,-12447,-30350,-12354,-30387,-12261,-30425,-12167,-30462,-12074,-30499,-11981,-30536,-11887,-30572,-11793,-30608,-11699,-30644,-11605,-30679,-11511,-30714,-11417,-30749,-11323,-30784,-11228,-30818,-11134,-30852,-11039,-30886,-10945,-30919,-10850,-30952,-10755,-30985,-10660,-31018,-10565,-31050,-10470,-31082,-10374,-31114,-10279,-31145,-10183,-31176,-10088,-31207,-9992,-31237,-9896,-31268,-9800,-31298,-9704,-31327,-9608,-31357,-9512,-31386,-9416,-31414,-9320,-31443,-9223,-31471,-9127,-31499,-9030,-31526,-8933,-31554,-8837,-31581,-8740,-31607,-8643,-31634,-8546,-31660,-8449,-31685,-8352,-31711,-8254,-31736,-8157,-31761,-8060,-31786,-7962,-31810,-7865,-31834,-7767,-31857,-7669,-31881,-7572,-31904,-7474,-31927,-7376,-31949,-7278,-31971,-7180,-31993,-7082,-32015,-6983,-32036,-6885,-32057,-6787,-32078,-6689,-32098,-6590,-32118,-6492,-32138,-6393,-32157,-6294,-32177,-6196,-32195,-6097,-32214,-5998,-32232,-5899,-32250,-5800,-32268,-5701,-32285,-5602,-32302,-5503,-32319,-5404,-32335,-5305,-32351,-5206,-32367,-5107,-32383,-5007,-32398,-4908,-32413,-4808,-32427,-4709,-32442,-4609,-32456,-4510,-32469,-4410,-32483,-4311,-32496,-4211,-32509,-4111,-32521,-4012,-32533,-3912,-32545,-3812,-32557,-3712,-32568,-3612,-32579,-3512,-32589,-3412,-32600,-3312,-32610,-3212,-32619,-3112,-32629,-3012,-32638,-2912,-32647,-2812,-32655,-2712,-32663,-2611,-32671,-2511,-32679,-2411,-32686,-2311,-32693,-2210,-32700,-2110,-32706,-2010,-32712,-1909,-32718,-1809,-32723,-1709,-32728,-1608,-32733,-1508,-32737,-1407,-32741,-1307,-32745,-1207,-32749,-1106,-32752,-1006,-32755,-905,-32758,-805,-32760,-704,-32762,-604,-32764,-503,-32765,-403,-32766,-302,-32767,-202,-32767,-101};
+#else //__AVX2__
+void dft1024(int16_t *x,int16_t *y,int scale)
+{
 
+  simd256_q15_t xtmp[128],ytmp[128],*tw1024_256p=(simd256_q15_t *)tw1024,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y;
+  simd256_q15_t *ytmpp = &ytmp[0];
+  int i,j;
+
+  for (i=0,j=0; i<128; i+=4,j++) {
+    transpose16_ooff_simd256(x256+i,xtmp+j,32);
+  }
 
+
+  dft256((int16_t*)(xtmp),(int16_t*)(ytmp),1);
+  dft256((int16_t*)(xtmp+32),(int16_t*)(ytmp+32),1);
+  dft256((int16_t*)(xtmp+64),(int16_t*)(ytmp+64),1);
+  dft256((int16_t*)(xtmp+96),(int16_t*)(ytmp+96),1);
+
+  for (i=0; i<32; i++) {
+    bfly4_256(ytmpp,ytmpp+32,ytmpp+64,ytmpp+96,
+	      y256p,y256p+32,y256p+64,y256p+96,
+	      tw1024_256p,tw1024_256p+32,tw1024_256p+64);
+    tw1024_256p++;
+    y256p++;
+    ytmpp++;
+  }
+
+  if (scale>0) {
+
+    for (i=0; i<8; i++) {
+      y256[0]  = shiftright_int16_simd256(y256[0],1);
+      y256[1]  = shiftright_int16_simd256(y256[1],1);
+      y256[2]  = shiftright_int16_simd256(y256[2],1);
+      y256[3]  = shiftright_int16_simd256(y256[3],1);
+      y256[4]  = shiftright_int16_simd256(y256[4],1);
+      y256[5]  = shiftright_int16_simd256(y256[5],1);
+      y256[6]  = shiftright_int16_simd256(y256[6],1);
+      y256[7]  = shiftright_int16_simd256(y256[7],1);
+      y256[8]  = shiftright_int16_simd256(y256[8],1);
+      y256[9]  = shiftright_int16_simd256(y256[9],1);
+      y256[10] = shiftright_int16_simd256(y256[10],1);
+      y256[11] = shiftright_int16_simd256(y256[11],1);
+      y256[12] = shiftright_int16_simd256(y256[12],1);
+      y256[13] = shiftright_int16_simd256(y256[13],1);
+      y256[14] = shiftright_int16_simd256(y256[14],1);
+      y256[15] = shiftright_int16_simd256(y256[15],1);
+
+      y256+=16;
+    }
+
+  }
+
+  _mm_empty();
+  _m_empty();
+
+}
+
+void idft1024(int16_t *x,int16_t *y,int scale)
+{
+
+  simd256_q15_t xtmp[128],ytmp[128],*tw1024_256p=(simd256_q15_t *)tw1024,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y;
+  simd256_q15_t *ytmpp = &ytmp[0];
+  int i,j;
+
+  for (i=0,j=0; i<128; i+=4,j++) {
+    transpose16_ooff_simd256(x256+i,xtmp+j,32);
+  }
+
+
+  idft256((int16_t*)(xtmp),(int16_t*)(ytmp),1);
+  idft256((int16_t*)(xtmp+32),(int16_t*)(ytmp+32),1);
+  idft256((int16_t*)(xtmp+64),(int16_t*)(ytmp+64),1);
+  idft256((int16_t*)(xtmp+96),(int16_t*)(ytmp+96),1);
+
+  for (i=0; i<32; i++) {
+    ibfly4_256(ytmpp,ytmpp+32,ytmpp+64,ytmpp+96,
+	       y256p,y256p+32,y256p+64,y256p+96,
+	       tw1024_256p,tw1024_256p+32,tw1024_256p+64);
+    tw1024_256p++;
+    y256p++;
+    ytmpp++;
+  }
+
+  if (scale>0) {
+
+    for (i=0; i<8; i++) {
+      y256[0]  = shiftright_int16_simd256(y256[0],1);
+      y256[1]  = shiftright_int16_simd256(y256[1],1);
+      y256[2]  = shiftright_int16_simd256(y256[2],1);
+      y256[3]  = shiftright_int16_simd256(y256[3],1);
+      y256[4]  = shiftright_int16_simd256(y256[4],1);
+      y256[5]  = shiftright_int16_simd256(y256[5],1);
+      y256[6]  = shiftright_int16_simd256(y256[6],1);
+      y256[7]  = shiftright_int16_simd256(y256[7],1);
+      y256[8]  = shiftright_int16_simd256(y256[8],1);
+      y256[9]  = shiftright_int16_simd256(y256[9],1);
+      y256[10] = shiftright_int16_simd256(y256[10],1);
+      y256[11] = shiftright_int16_simd256(y256[11],1);
+      y256[12] = shiftright_int16_simd256(y256[12],1);
+      y256[13] = shiftright_int16_simd256(y256[13],1);
+      y256[14] = shiftright_int16_simd256(y256[14],1);
+      y256[15] = shiftright_int16_simd256(y256[15],1);
+
+      y256+=16;
+    }
+
+  }
+
+  _mm_empty();
+  _m_empty();
+
+}
+#endif
+
+int16_t tw2048[2048] __attribute__((aligned(32))) = {32767,0,32766,-101,32766,-202,32765,-302,32764,-403,32763,-503,32761,-604,32759,-704,32757,-805,32754,-905,32751,-1006,32748,-1106,32744,-1207,32740,-1307,32736,-1407,32732,-1508,32727,-1608,32722,-1709,32717,-1809,32711,-1909,32705,-2010,32699,-2110,32692,-2210,32685,-2311,32678,-2411,32670,-2511,32662,-2611,32654,-2712,32646,-2812,32637,-2912,32628,-3012,32618,-3112,32609,-3212,32599,-3312,32588,-3412,32578,-3512,32567,-3612,32556,-3712,32544,-3812,32532,-3912,32520,-4012,32508,-4111,32495,-4211,32482,-4311,32468,-4410,32455,-4510,32441,-4609,32426,-4709,32412,-4808,32397,-4908,32382,-5007,32366,-5107,32350,-5206,32334,-5305,32318,-5404,32301,-5503,32284,-5602,32267,-5701,32249,-5800,32231,-5899,32213,-5998,32194,-6097,32176,-6196,32156,-6294,32137,-6393,32117,-6492,32097,-6590,32077,-6689,32056,-6787,32035,-6885,32014,-6983,31992,-7082,31970,-7180,31948,-7278,31926,-7376,31903,-7474,31880,-7572,31856,-7669,31833,-7767,31809,-7865,31785,-7962,31760,-8060,31735,-8157,31710,-8254,31684,-8352,31659,-8449,31633,-8546,31606,-8643,31580,-8740,31553,-8837,31525,-8933,31498,-9030,31470,-9127,31442,-9223,31413,-9320,31385,-9416,31356,-9512,31326,-9608,31297,-9704,31267,-9800,31236,-9896,31206,-9992,31175,-10088,31144,-10183,31113,-10279,31081,-10374,31049,-10470,31017,-10565,30984,-10660,30951,-10755,30918,-10850,30885,-10945,30851,-11039,30817,-11134,30783,-11228,30748,-11323,30713,-11417,30678,-11511,30643,-11605,30607,-11699,30571,-11793,30535,-11887,30498,-11981,30461,-12074,30424,-12167,30386,-12261,30349,-12354,30311,-12447,30272,-12540,30234,-12633,30195,-12725,30156,-12818,30116,-12910,30076,-13003,30036,-13095,29996,-13187,29955,-13279,29915,-13371,29873,-13463,29832,-13554,29790,-13646,29748,-13737,29706,-13828,29663,-13919,29621,-14010,29577,-14101,29534,-14192,29490,-14282,29446,-14373,29402,-14463,29358,-14553,29313,-14643,29268,-14733,29222,-14823,29177,-14912,29131,-15002,29085,-15091,29038,-15180,28992,-15269,28945,-15358,28897,-15447,28850,-15535,28802,-15624,28754,-15712,28706,-15800,28657,-15888,28608,-15976,28559,-16064,28510,-16151,28460,-16239,28410,-16326,28360,-16413,28309,-16500,28259,-16587,28208,-16673,28156,-16760,28105,-16846,28053,-16932,28001,-17018,27948,-17104,27896,-17190,27843,-17275,27790,-17361,27736,-17446,27683,-17531,27629,-17616,27575,-17700,27520,-17785,27466,-17869,27411,-17953,27355,-18037,27300,-18121,27244,-18205,27188,-18288,27132,-18372,27076,-18455,27019,-18538,26962,-18621,26905,-18703,26847,-18786,26789,-18868,26731,-18950,26673,-19032,26615,-19114,26556,-19195,26497,-19277,26437,-19358,26378,-19439,26318,-19520,26258,-19600,26198,-19681,26137,-19761,26077,-19841,26016,-19921,25954,-20001,25893,-20080,25831,-20160,25769,-20239,25707,-20318,25645,-20397,25582,-20475,25519,-20554,25456,-20632,25392,-20710,25329,-20788,25265,-20865,25201,-20943,25136,-21020,25072,-21097,25007,-21174,24942,-21250,24877,-21327,24811,-21403,24745,-21479,24679,-21555,24613,-21630,24546,-21706,24480,-21781,24413,-21856,24346,-21931,24278,-22005,24211,-22080,24143,-22154,24075,-22228,24006,-22302,23938,-22375,23869,-22449,23800,-22522,23731,-22595,23661,-22667,23592,-22740,23522,-22812,23452,-22884,23382,-22956,23311,-23028,23240,-23099,23169,-23170,23098,-23241,23027,-23312,22955,-23383,22883,-23453,22811,-23523,22739,-23593,22666,-23662,22594,-23732,22521,-23801,22448,-23870,22374,-23939,22301,-24007,22227,-24076,22153,-24144,22079,-24212,22004,-24279,21930,-24347,21855,-24414,21780,-24481,21705,-24547,21629,-24614,21554,-24680,21478,-24746,21402,-24812,21326,-24878,21249,-24943,21173,-25008,21096,-25073,21019,-25137,20942,-25202,20864,-25266,20787,-25330,20709,-25393,20631,-25457,20553,-25520,20474,-25583,20396,-25646,20317,-25708,20238,-25770,20159,-25832,20079,-25894,20000,-25955,19920,-26017,19840,-26078,19760,-26138,19680,-26199,19599,-26259,19519,-26319,19438,-26379,19357,-26438,19276,-26498,19194,-26557,19113,-26616,19031,-26674,18949,-26732,18867,-26790,18785,-26848,18702,-26906,18620,-26963,18537,-27020,18454,-27077,18371,-27133,18287,-27189,18204,-27245,18120,-27301,18036,-27356,17952,-27412,17868,-27467,17784,-27521,17699,-27576,17615,-27630,17530,-27684,17445,-27737,17360,-27791,17274,-27844,17189,-27897,17103,-27949,17017,-28002,16931,-28054,16845,-28106,16759,-28157,16672,-28209,16586,-28260,16499,-28310,16412,-28361,16325,-28411,16238,-28461,16150,-28511,16063,-28560,15975,-28609,15887,-28658,15799,-28707,15711,-28755,15623,-28803,15534,-28851,15446,-28898,15357,-28946,15268,-28993,15179,-29039,15090,-29086,15001,-29132,14911,-29178,14822,-29223,14732,-29269,14642,-29314,14552,-29359,14462,-29403,14372,-29447,14281,-29491,14191,-29535,14100,-29578,14009,-29622,13918,-29664,13827,-29707,13736,-29749,13645,-29791,13553,-29833,13462,-29874,13370,-29916,13278,-29956,13186,-29997,13094,-30037,13002,-30077,12909,-30117,12817,-30157,12724,-30196,12632,-30235,12539,-30273,12446,-30312,12353,-30350,12260,-30387,12166,-30425,12073,-30462,11980,-30499,11886,-30536,11792,-30572,11698,-30608,11604,-30644,11510,-30679,11416,-30714,11322,-30749,11227,-30784,11133,-30818,11038,-30852,10944,-30886,10849,-30919,10754,-30952,10659,-30985,10564,-31018,10469,-31050,10373,-31082,10278,-31114,10182,-31145,10087,-31176,9991,-31207,9895,-31237,9799,-31268,9703,-31298,9607,-31327,9511,-31357,9415,-31386,9319,-31414,9222,-31443,9126,-31471,9029,-31499,8932,-31526,8836,-31554,8739,-31581,8642,-31607,8545,-31634,8448,-31660,8351,-31685,8253,-31711,8156,-31736,8059,-31761,7961,-31786,7864,-31810,7766,-31834,7668,-31857,7571,-31881,7473,-31904,7375,-31927,7277,-31949,7179,-31971,7081,-31993,6982,-32015,6884,-32036,6786,-32057,6688,-32078,6589,-32098,6491,-32118,6392,-32138,6293,-32157,6195,-32177,6096,-32195,5997,-32214,5898,-32232,5799,-32250,5700,-32268,5601,-32285,5502,-32302,5403,-32319,5304,-32335,5205,-32351,5106,-32367,5006,-32383,4907,-32398,4807,-32413,4708,-32427,4608,-32442,4509,-32456,4409,-32469,4310,-32483,4210,-32496,4110,-32509,4011,-32521,3911,-32533,3811,-32545,3711,-32557,3611,-32568,3511,-32579,3411,-32589,3311,-32600,3211,-32610,3111,-32619,3011,-32629,2911,-32638,2811,-32647,2711,-32655,2610,-32663,2510,-32671,2410,-32679,2310,-32686,2209,-32693,2109,-32700,2009,-32706,1908,-32712,1808,-32718,1708,-32723,1607,-32728,1507,-32733,1406,-32737,1306,-32741,1206,-32745,1105,-32749,1005,-32752,904,-32755,804,-32758,703,-32760,603,-32762,502,-32764,402,-32765,301,-32766,201,-32767,100,-32767,0,-32767,-101,-32767,-202,-32767,-302,-32766,-403,-32765,-503,-32764,-604,-32762,-704,-32760,-805,-32758,-905,-32755,-1006,-32752,-1106,-32749,-1207,-32745,-1307,-32741,-1407,-32737,-1508,-32733,-1608,-32728,-1709,-32723,-1809,-32718,-1909,-32712,-2010,-32706,-2110,-32700,-2210,-32693,-2311,-32686,-2411,-32679,-2511,-32671,-2611,-32663,-2712,-32655,-2812,-32647,-2912,-32638,-3012,-32629,-3112,-32619,-3212,-32610,-3312,-32600,-3412,-32589,-3512,-32579,-3612,-32568,-3712,-32557,-3812,-32545,-3912,-32533,-4012,-32521,-4111,-32509,-4211,-32496,-4311,-32483,-4410,-32469,-4510,-32456,-4609,-32442,-4709,-32427,-4808,-32413,-4908,-32398,-5007,-32383,-5107,-32367,-5206,-32351,-5305,-32335,-5404,-32319,-5503,-32302,-5602,-32285,-5701,-32268,-5800,-32250,-5899,-32232,-5998,-32214,-6097,-32195,-6196,-32177,-6294,-32157,-6393,-32138,-6492,-32118,-6590,-32098,-6689,-32078,-6787,-32057,-6885,-32036,-6983,-32015,-7082,-31993,-7180,-31971,-7278,-31949,-7376,-31927,-7474,-31904,-7572,-31881,-7669,-31857,-7767,-31834,-7865,-31810,-7962,-31786,-8060,-31761,-8157,-31736,-8254,-31711,-8352,-31685,-8449,-31660,-8546,-31634,-8643,-31607,-8740,-31581,-8837,-31554,-8933,-31526,-9030,-31499,-9127,-31471,-9223,-31443,-9320,-31414,-9416,-31386,-9512,-31357,-9608,-31327,-9704,-31298,-9800,-31268,-9896,-31237,-9992,-31207,-10088,-31176,-10183,-31145,-10279,-31114,-10374,-31082,-10470,-31050,-10565,-31018,-10660,-30985,-10755,-30952,-10850,-30919,-10945,-30886,-11039,-30852,-11134,-30818,-11228,-30784,-11323,-30749,-11417,-30714,-11511,-30679,-11605,-30644,-11699,-30608,-11793,-30572,-11887,-30536,-11981,-30499,-12074,-30462,-12167,-30425,-12261,-30387,-12354,-30350,-12447,-30312,-12540,-30273,-12633,-30235,-12725,-30196,-12818,-30157,-12910,-30117,-13003,-30077,-13095,-30037,-13187,-29997,-13279,-29956,-13371,-29916,-13463,-29874,-13554,-29833,-13646,-29791,-13737,-29749,-13828,-29707,-13919,-29664,-14010,-29622,-14101,-29578,-14192,-29535,-14282,-29491,-14373,-29447,-14463,-29403,-14553,-29359,-14643,-29314,-14733,-29269,-14823,-29223,-14912,-29178,-15002,-29132,-15091,-29086,-15180,-29039,-15269,-28993,-15358,-28946,-15447,-28898,-15535,-28851,-15624,-28803,-15712,-28755,-15800,-28707,-15888,-28658,-15976,-28609,-16064,-28560,-16151,-28511,-16239,-28461,-16326,-28411,-16413,-28361,-16500,-28310,-16587,-28260,-16673,-28209,-16760,-28157,-16846,-28106,-16932,-28054,-17018,-28002,-17104,-27949,-17190,-27897,-17275,-27844,-17361,-27791,-17446,-27737,-17531,-27684,-17616,-27630,-17700,-27576,-17785,-27521,-17869,-27467,-17953,-27412,-18037,-27356,-18121,-27301,-18205,-27245,-18288,-27189,-18372,-27133,-18455,-27077,-18538,-27020,-18621,-26963,-18703,-26906,-18786,-26848,-18868,-26790,-18950,-26732,-19032,-26674,-19114,-26616,-19195,-26557,-19277,-26498,-19358,-26438,-19439,-26379,-19520,-26319,-19600,-26259,-19681,-26199,-19761,-26138,-19841,-26078,-19921,-26017,-20001,-25955,-20080,-25894,-20160,-25832,-20239,-25770,-20318,-25708,-20397,-25646,-20475,-25583,-20554,-25520,-20632,-25457,-20710,-25393,-20788,-25330,-20865,-25266,-20943,-25202,-21020,-25137,-21097,-25073,-21174,-25008,-21250,-24943,-21327,-24878,-21403,-24812,-21479,-24746,-21555,-24680,-21630,-24614,-21706,-24547,-21781,-24481,-21856,-24414,-21931,-24347,-22005,-24279,-22080,-24212,-22154,-24144,-22228,-24076,-22302,-24007,-22375,-23939,-22449,-23870,-22522,-23801,-22595,-23732,-22667,-23662,-22740,-23593,-22812,-23523,-22884,-23453,-22956,-23383,-23028,-23312,-23099,-23241,-23170,-23170,-23241,-23099,-23312,-23028,-23383,-22956,-23453,-22884,-23523,-22812,-23593,-22740,-23662,-22667,-23732,-22595,-23801,-22522,-23870,-22449,-23939,-22375,-24007,-22302,-24076,-22228,-24144,-22154,-24212,-22080,-24279,-22005,-24347,-21931,-24414,-21856,-24481,-21781,-24547,-21706,-24614,-21630,-24680,-21555,-24746,-21479,-24812,-21403,-24878,-21327,-24943,-21250,-25008,-21174,-25073,-21097,-25137,-21020,-25202,-20943,-25266,-20865,-25330,-20788,-25393,-20710,-25457,-20632,-25520,-20554,-25583,-20475,-25646,-20397,-25708,-20318,-25770,-20239,-25832,-20160,-25894,-20080,-25955,-20001,-26017,-19921,-26078,-19841,-26138,-19761,-26199,-19681,-26259,-19600,-26319,-19520,-26379,-19439,-26438,-19358,-26498,-19277,-26557,-19195,-26616,-19114,-26674,-19032,-26732,-18950,-26790,-18868,-26848,-18786,-26906,-18703,-26963,-18621,-27020,-18538,-27077,-18455,-27133,-18372,-27189,-18288,-27245,-18205,-27301,-18121,-27356,-18037,-27412,-17953,-27467,-17869,-27521,-17785,-27576,-17700,-27630,-17616,-27684,-17531,-27737,-17446,-27791,-17361,-27844,-17275,-27897,-17190,-27949,-17104,-28002,-17018,-28054,-16932,-28106,-16846,-28157,-16760,-28209,-16673,-28260,-16587,-28310,-16500,-28361,-16413,-28411,-16326,-28461,-16239,-28511,-16151,-28560,-16064,-28609,-15976,-28658,-15888,-28707,-15800,-28755,-15712,-28803,-15624,-28851,-15535,-28898,-15447,-28946,-15358,-28993,-15269,-29039,-15180,-29086,-15091,-29132,-15002,-29178,-14912,-29223,-14823,-29269,-14733,-29314,-14643,-29359,-14553,-29403,-14463,-29447,-14373,-29491,-14282,-29535,-14192,-29578,-14101,-29622,-14010,-29664,-13919,-29707,-13828,-29749,-13737,-29791,-13646,-29833,-13554,-29874,-13463,-29916,-13371,-29956,-13279,-29997,-13187,-30037,-13095,-30077,-13003,-30117,-12910,-30157,-12818,-30196,-12725,-30235,-12633,-30273,-12540,-30312,-12447,-30350,-12354,-30387,-12261,-30425,-12167,-30462,-12074,-30499,-11981,-30536,-11887,-30572,-11793,-30608,-11699,-30644,-11605,-30679,-11511,-30714,-11417,-30749,-11323,-30784,-11228,-30818,-11134,-30852,-11039,-30886,-10945,-30919,-10850,-30952,-10755,-30985,-10660,-31018,-10565,-31050,-10470,-31082,-10374,-31114,-10279,-31145,-10183,-31176,-10088,-31207,-9992,-31237,-9896,-31268,-9800,-31298,-9704,-31327,-9608,-31357,-9512,-31386,-9416,-31414,-9320,-31443,-9223,-31471,-9127,-31499,-9030,-31526,-8933,-31554,-8837,-31581,-8740,-31607,-8643,-31634,-8546,-31660,-8449,-31685,-8352,-31711,-8254,-31736,-8157,-31761,-8060,-31786,-7962,-31810,-7865,-31834,-7767,-31857,-7669,-31881,-7572,-31904,-7474,-31927,-7376,-31949,-7278,-31971,-7180,-31993,-7082,-32015,-6983,-32036,-6885,-32057,-6787,-32078,-6689,-32098,-6590,-32118,-6492,-32138,-6393,-32157,-6294,-32177,-6196,-32195,-6097,-32214,-5998,-32232,-5899,-32250,-5800,-32268,-5701,-32285,-5602,-32302,-5503,-32319,-5404,-32335,-5305,-32351,-5206,-32367,-5107,-32383,-5007,-32398,-4908,-32413,-4808,-32427,-4709,-32442,-4609,-32456,-4510,-32469,-4410,-32483,-4311,-32496,-4211,-32509,-4111,-32521,-4012,-32533,-3912,-32545,-3812,-32557,-3712,-32568,-3612,-32579,-3512,-32589,-3412,-32600,-3312,-32610,-3212,-32619,-3112,-32629,-3012,-32638,-2912,-32647,-2812,-32655,-2712,-32663,-2611,-32671,-2511,-32679,-2411,-32686,-2311,-32693,-2210,-32700,-2110,-32706,-2010,-32712,-1909,-32718,-1809,-32723,-1709,-32728,-1608,-32733,-1508,-32737,-1407,-32741,-1307,-32745,-1207,-32749,-1106,-32752,-1006,-32755,-905,-32758,-805,-32760,-704,-32762,-604,-32764,-503,-32765,-403,-32766,-302,-32767,-202,-32767,-101};
+
+#ifndef __AVX2__
 void dft2048(int16_t *x,int16_t *y,int scale)
 {
 
-  simdshort_q15_t xtmp[2048],*xtmpp,*x64 = (simdshort_q15_t *)x;
+  simdshort_q15_t xtmp[1024],*xtmpp,*x64 = (simdshort_q15_t *)x;
   simd_q15_t ytmp[512],*tw2048_128p=(simd_q15_t *)tw2048,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y;
   simd_q15_t *ytmpp = &ytmp[0];
   int i;
@@ -2779,7 +4530,7 @@ void dft2048(int16_t *x,int16_t *y,int scale)
 void idft2048(int16_t *x,int16_t *y,int scale)
 {
 
-  simdshort_q15_t xtmp[2048],*xtmpp,*x64 = (simdshort_q15_t *)x;
+  simdshort_q15_t xtmp[1024],*xtmpp,*x64 = (simdshort_q15_t *)x;
   simd_q15_t ytmp[512],*tw2048_128p=(simd_q15_t *)tw2048,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y;
   simd_q15_t *ytmpp = &ytmp[0];
   int i;
@@ -2838,26 +4589,208 @@ void idft2048(int16_t *x,int16_t *y,int scale)
   }
 
   if (scale>0) {
-    y128p = y128;
+    y128p = y128;
+
+    for (i=0; i<32; i++) {
+      y128p[0]  = mulhi_int16(y128p[0],ONE_OVER_SQRT2_Q15_128);
+      y128p[1]  = mulhi_int16(y128p[1],ONE_OVER_SQRT2_Q15_128);
+      y128p[2]  = mulhi_int16(y128p[2],ONE_OVER_SQRT2_Q15_128);
+      y128p[3]  = mulhi_int16(y128p[3],ONE_OVER_SQRT2_Q15_128);
+      y128p[4]  = mulhi_int16(y128p[4],ONE_OVER_SQRT2_Q15_128);
+      y128p[5]  = mulhi_int16(y128p[5],ONE_OVER_SQRT2_Q15_128);
+      y128p[6]  = mulhi_int16(y128p[6],ONE_OVER_SQRT2_Q15_128);
+      y128p[7]  = mulhi_int16(y128p[7],ONE_OVER_SQRT2_Q15_128);
+      y128p[8]  = mulhi_int16(y128p[8],ONE_OVER_SQRT2_Q15_128);
+      y128p[9]  = mulhi_int16(y128p[9],ONE_OVER_SQRT2_Q15_128);
+      y128p[10] = mulhi_int16(y128p[10],ONE_OVER_SQRT2_Q15_128);
+      y128p[11] = mulhi_int16(y128p[11],ONE_OVER_SQRT2_Q15_128);
+      y128p[12] = mulhi_int16(y128p[12],ONE_OVER_SQRT2_Q15_128);
+      y128p[13] = mulhi_int16(y128p[13],ONE_OVER_SQRT2_Q15_128);
+      y128p[14] = mulhi_int16(y128p[14],ONE_OVER_SQRT2_Q15_128);
+      y128p[15] = mulhi_int16(y128p[15],ONE_OVER_SQRT2_Q15_128);
+      y128p+=16;
+    }
+  }
+
+  _mm_empty();
+  _m_empty();
+
+}
+
+#else // __AVX2__
+
+void dft2048(int16_t *x,int16_t *y,int scale)
+{
+
+  simd256_q15_t xtmp[256],*xtmpp,*x256 = (simd256_q15_t *)x;
+  simd256_q15_t ytmp[256],*tw2048_256p=(simd256_q15_t *)tw2048,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y;
+  simd256_q15_t *ytmpp = &ytmp[0];
+  int i;
+  simd256_q15_t ONE_OVER_SQRT2_Q15_128 = set1_int16_simd256(ONE_OVER_SQRT2_Q15);
+
+  xtmpp = xtmp;
+
+  for (i=0; i<4; i++) {
+    transpose4_ooff_simd256(x256  ,xtmpp,128);
+    transpose4_ooff_simd256(x256+2,xtmpp+1,128);
+    transpose4_ooff_simd256(x256+4,xtmpp+2,128);
+    transpose4_ooff_simd256(x256+6,xtmpp+3,128);
+    transpose4_ooff_simd256(x256+8,xtmpp+4,128);
+    transpose4_ooff_simd256(x256+10,xtmpp+5,128);
+    transpose4_ooff_simd256(x256+12,xtmpp+6,128);
+    transpose4_ooff_simd256(x256+14,xtmpp+7,128);
+    transpose4_ooff_simd256(x256+16,xtmpp+8,128);
+    transpose4_ooff_simd256(x256+18,xtmpp+9,128);
+    transpose4_ooff_simd256(x256+20,xtmpp+10,128);
+    transpose4_ooff_simd256(x256+22,xtmpp+11,128);
+    transpose4_ooff_simd256(x256+24,xtmpp+12,128);
+    transpose4_ooff_simd256(x256+26,xtmpp+13,128);
+    transpose4_ooff_simd256(x256+28,xtmpp+14,128);
+    transpose4_ooff_simd256(x256+30,xtmpp+15,128);
+    transpose4_ooff_simd256(x256+32,xtmpp+16,128);
+    transpose4_ooff_simd256(x256+34,xtmpp+17,128);
+    transpose4_ooff_simd256(x256+36,xtmpp+18,128);
+    transpose4_ooff_simd256(x256+38,xtmpp+19,128);
+    transpose4_ooff_simd256(x256+40,xtmpp+20,128);
+    transpose4_ooff_simd256(x256+42,xtmpp+21,128);
+    transpose4_ooff_simd256(x256+44,xtmpp+22,128);
+    transpose4_ooff_simd256(x256+46,xtmpp+23,128);
+    transpose4_ooff_simd256(x256+48,xtmpp+24,128);
+    transpose4_ooff_simd256(x256+50,xtmpp+25,128);
+    transpose4_ooff_simd256(x256+52,xtmpp+26,128);
+    transpose4_ooff_simd256(x256+54,xtmpp+27,128);
+    transpose4_ooff_simd256(x256+56,xtmpp+28,128);
+    transpose4_ooff_simd256(x256+58,xtmpp+29,128);
+    transpose4_ooff_simd256(x256+60,xtmpp+30,128);
+    transpose4_ooff_simd256(x256+62,xtmpp+31,128);
+    x256+=64;
+    xtmpp+=32;
+  }
+
+  dft1024((int16_t*)(xtmp),(int16_t*)ytmp,1);
+  dft1024((int16_t*)(xtmp+128),(int16_t*)(ytmp+128),1);
+
+
+  for (i=0; i<128; i++) {
+    bfly2_256(ytmpp,ytmpp+128,
+	      y256p,y256p+128,
+	      tw2048_256p);
+    tw2048_256p++;
+    y256p++;
+    ytmpp++;
+  }
+
+  if (scale>0) {
+    y256p = y256;
+
+    for (i=0; i<16; i++) {
+      y256p[0]  = mulhi_int16_simd256(y256p[0],ONE_OVER_SQRT2_Q15_128);
+      y256p[1]  = mulhi_int16_simd256(y256p[1],ONE_OVER_SQRT2_Q15_128);
+      y256p[2]  = mulhi_int16_simd256(y256p[2],ONE_OVER_SQRT2_Q15_128);
+      y256p[3]  = mulhi_int16_simd256(y256p[3],ONE_OVER_SQRT2_Q15_128);
+      y256p[4]  = mulhi_int16_simd256(y256p[4],ONE_OVER_SQRT2_Q15_128);
+      y256p[5]  = mulhi_int16_simd256(y256p[5],ONE_OVER_SQRT2_Q15_128);
+      y256p[6]  = mulhi_int16_simd256(y256p[6],ONE_OVER_SQRT2_Q15_128);
+      y256p[7]  = mulhi_int16_simd256(y256p[7],ONE_OVER_SQRT2_Q15_128);
+      y256p[8]  = mulhi_int16_simd256(y256p[8],ONE_OVER_SQRT2_Q15_128);
+      y256p[9]  = mulhi_int16_simd256(y256p[9],ONE_OVER_SQRT2_Q15_128);
+      y256p[10] = mulhi_int16_simd256(y256p[10],ONE_OVER_SQRT2_Q15_128);
+      y256p[11] = mulhi_int16_simd256(y256p[11],ONE_OVER_SQRT2_Q15_128);
+      y256p[12] = mulhi_int16_simd256(y256p[12],ONE_OVER_SQRT2_Q15_128);
+      y256p[13] = mulhi_int16_simd256(y256p[13],ONE_OVER_SQRT2_Q15_128);
+      y256p[14] = mulhi_int16_simd256(y256p[14],ONE_OVER_SQRT2_Q15_128);
+      y256p[15] = mulhi_int16_simd256(y256p[15],ONE_OVER_SQRT2_Q15_128);
+      y256p+=16;
+    }
+  }
+
+  _mm_empty();
+  _m_empty();
+
+}
+
+void idft2048(int16_t *x,int16_t *y,int scale)
+{
+
+  simd256_q15_t xtmp[256],*xtmpp,*x256 = (simd256_q15_t *)x;
+  simd256_q15_t ytmp[256],*tw2048_256p=(simd256_q15_t *)tw2048,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y;
+  simd256_q15_t *ytmpp = &ytmp[0];
+  int i;
+  simd256_q15_t ONE_OVER_SQRT2_Q15_128 = set1_int16_simd256(ONE_OVER_SQRT2_Q15);
+
+  xtmpp = xtmp;
+
+  for (i=0; i<4; i++) {
+    transpose4_ooff_simd256(x256  ,xtmpp,128);
+    transpose4_ooff_simd256(x256+2,xtmpp+1,128);
+    transpose4_ooff_simd256(x256+4,xtmpp+2,128);
+    transpose4_ooff_simd256(x256+6,xtmpp+3,128);
+    transpose4_ooff_simd256(x256+8,xtmpp+4,128);
+    transpose4_ooff_simd256(x256+10,xtmpp+5,128);
+    transpose4_ooff_simd256(x256+12,xtmpp+6,128);
+    transpose4_ooff_simd256(x256+14,xtmpp+7,128);
+    transpose4_ooff_simd256(x256+16,xtmpp+8,128);
+    transpose4_ooff_simd256(x256+18,xtmpp+9,128);
+    transpose4_ooff_simd256(x256+20,xtmpp+10,128);
+    transpose4_ooff_simd256(x256+22,xtmpp+11,128);
+    transpose4_ooff_simd256(x256+24,xtmpp+12,128);
+    transpose4_ooff_simd256(x256+26,xtmpp+13,128);
+    transpose4_ooff_simd256(x256+28,xtmpp+14,128);
+    transpose4_ooff_simd256(x256+30,xtmpp+15,128);
+    transpose4_ooff_simd256(x256+32,xtmpp+16,128);
+    transpose4_ooff_simd256(x256+34,xtmpp+17,128);
+    transpose4_ooff_simd256(x256+36,xtmpp+18,128);
+    transpose4_ooff_simd256(x256+38,xtmpp+19,128);
+    transpose4_ooff_simd256(x256+40,xtmpp+20,128);
+    transpose4_ooff_simd256(x256+42,xtmpp+21,128);
+    transpose4_ooff_simd256(x256+44,xtmpp+22,128);
+    transpose4_ooff_simd256(x256+46,xtmpp+23,128);
+    transpose4_ooff_simd256(x256+48,xtmpp+24,128);
+    transpose4_ooff_simd256(x256+50,xtmpp+25,128);
+    transpose4_ooff_simd256(x256+52,xtmpp+26,128);
+    transpose4_ooff_simd256(x256+54,xtmpp+27,128);
+    transpose4_ooff_simd256(x256+56,xtmpp+28,128);
+    transpose4_ooff_simd256(x256+58,xtmpp+29,128);
+    transpose4_ooff_simd256(x256+60,xtmpp+30,128);
+    transpose4_ooff_simd256(x256+62,xtmpp+31,128);
+    x256+=64;
+    xtmpp+=32;
+  }
+
+  idft1024((int16_t*)(xtmp),(int16_t*)ytmp,1);
+  idft1024((int16_t*)(xtmp+128),(int16_t*)(ytmp+128),1);
+
+
+  for (i=0; i<128; i++) {
+    ibfly2_256(ytmpp,ytmpp+128,
+	       y256p,y256p+128,
+	       tw2048_256p);
+    tw2048_256p++;
+    y256p++;
+    ytmpp++;
+  }
+
+  if (scale>0) {
+    y256p = y256;
 
-    for (i=0; i<32; i++) {
-      y128p[0]  = mulhi_int16(y128p[0],ONE_OVER_SQRT2_Q15_128);
-      y128p[1]  = mulhi_int16(y128p[1],ONE_OVER_SQRT2_Q15_128);
-      y128p[2]  = mulhi_int16(y128p[2],ONE_OVER_SQRT2_Q15_128);
-      y128p[3]  = mulhi_int16(y128p[3],ONE_OVER_SQRT2_Q15_128);
-      y128p[4]  = mulhi_int16(y128p[4],ONE_OVER_SQRT2_Q15_128);
-      y128p[5]  = mulhi_int16(y128p[5],ONE_OVER_SQRT2_Q15_128);
-      y128p[6]  = mulhi_int16(y128p[6],ONE_OVER_SQRT2_Q15_128);
-      y128p[7]  = mulhi_int16(y128p[7],ONE_OVER_SQRT2_Q15_128);
-      y128p[8]  = mulhi_int16(y128p[8],ONE_OVER_SQRT2_Q15_128);
-      y128p[9]  = mulhi_int16(y128p[9],ONE_OVER_SQRT2_Q15_128);
-      y128p[10] = mulhi_int16(y128p[10],ONE_OVER_SQRT2_Q15_128);
-      y128p[11] = mulhi_int16(y128p[11],ONE_OVER_SQRT2_Q15_128);
-      y128p[12] = mulhi_int16(y128p[12],ONE_OVER_SQRT2_Q15_128);
-      y128p[13] = mulhi_int16(y128p[13],ONE_OVER_SQRT2_Q15_128);
-      y128p[14] = mulhi_int16(y128p[14],ONE_OVER_SQRT2_Q15_128);
-      y128p[15] = mulhi_int16(y128p[15],ONE_OVER_SQRT2_Q15_128);
-      y128p+=16;
+    for (i=0; i<16; i++) {
+      y256p[0]  = mulhi_int16_simd256(y256p[0],ONE_OVER_SQRT2_Q15_128);
+      y256p[1]  = mulhi_int16_simd256(y256p[1],ONE_OVER_SQRT2_Q15_128);
+      y256p[2]  = mulhi_int16_simd256(y256p[2],ONE_OVER_SQRT2_Q15_128);
+      y256p[3]  = mulhi_int16_simd256(y256p[3],ONE_OVER_SQRT2_Q15_128);
+      y256p[4]  = mulhi_int16_simd256(y256p[4],ONE_OVER_SQRT2_Q15_128);
+      y256p[5]  = mulhi_int16_simd256(y256p[5],ONE_OVER_SQRT2_Q15_128);
+      y256p[6]  = mulhi_int16_simd256(y256p[6],ONE_OVER_SQRT2_Q15_128);
+      y256p[7]  = mulhi_int16_simd256(y256p[7],ONE_OVER_SQRT2_Q15_128);
+      y256p[8]  = mulhi_int16_simd256(y256p[8],ONE_OVER_SQRT2_Q15_128);
+      y256p[9]  = mulhi_int16_simd256(y256p[9],ONE_OVER_SQRT2_Q15_128);
+      y256p[10] = mulhi_int16_simd256(y256p[10],ONE_OVER_SQRT2_Q15_128);
+      y256p[11] = mulhi_int16_simd256(y256p[11],ONE_OVER_SQRT2_Q15_128);
+      y256p[12] = mulhi_int16_simd256(y256p[12],ONE_OVER_SQRT2_Q15_128);
+      y256p[13] = mulhi_int16_simd256(y256p[13],ONE_OVER_SQRT2_Q15_128);
+      y256p[14] = mulhi_int16_simd256(y256p[14],ONE_OVER_SQRT2_Q15_128);
+      y256p[15] = mulhi_int16_simd256(y256p[15],ONE_OVER_SQRT2_Q15_128);
+      y256p+=16;
     }
   }
 
@@ -2866,12 +4799,15 @@ void idft2048(int16_t *x,int16_t *y,int scale)
 
 }
 
+#endif
+
 #include "twiddles4096.h"
 
+#ifndef __AVX2__
 void dft4096(int16_t *x,int16_t *y,int scale)
 {
 
-  simd_q15_t xtmp[4096],ytmp[4096],*tw4096_128p=(simd_q15_t *)tw4096,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y;
+  simd_q15_t xtmp[1024],ytmp[1024],*tw4096_128p=(simd_q15_t *)tw4096,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y;
   simd_q15_t *ytmpp = &ytmp[0];
   int i,j;
 
@@ -2924,10 +4860,12 @@ void dft4096(int16_t *x,int16_t *y,int scale)
 
 }
 
+
+
 void idft4096(int16_t *x,int16_t *y,int scale)
 {
 
-  simd_q15_t xtmp[4096],ytmp[4096],*tw4096_128p=(simd_q15_t *)tw4096,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y;
+  simd_q15_t xtmp[1024],ytmp[1024],*tw4096_128p=(simd_q15_t *)tw4096,*x128=(simd_q15_t *)x,*y128=(simd_q15_t *)y,*y128p=(simd_q15_t *)y;
   simd_q15_t *ytmpp = &ytmp[0];
   int i,j;
 
@@ -2980,19 +4918,125 @@ void idft4096(int16_t *x,int16_t *y,int scale)
 
 }
 
-/* Twiddles generated with
-twa = floor(32767*exp(-sqrt(-1)*2*pi*(0:4095)/8192));
-twa2 = zeros(1,2*4096);
-twa2(1:2:end) = real(twa);
-twa2(2:2:end) = imag(twa);
-fd=fopen("twiddle_tmp.txt","w");
-fprintf(fd,"static int16_t tw8192[4096*2] = {");
-fprintf(fd,"%d,",twa2(1:(4096*2)-1));
-fprintf(fd,"%d};\n",twa2(end));
-fclose(fd);
-*/
-static int16_t tw8192[4096*2] = {32767,0,32766,-26,32766,-51,32766,-76,32766,-101,32766,-126,32766,-151,32766,-176,32766,-202,32766,-227,32766,-252,32765,-277,32765,-302,32765,-327,32765,-352,32764,-377,32764,-403,32764,-428,32763,-453,32763,-478,32763,-503,32762,-528,32762,-553,32761,-579,32761,-604,32760,-629,32760,-654,32759,-679,32759,-704,32758,-729,32758,-754,32757,-780,32757,-805,32756,-830,32755,-855,32755,-880,32754,-905,32753,-930,32753,-955,32752,-981,32751,-1006,32750,-1031,32750,-1056,32749,-1081,32748,-1106,32747,-1131,32746,-1156,32745,-1181,32744,-1207,32743,-1232,32742,-1257,32741,-1282,32740,-1307,32739,-1332,32738,-1357,32737,-1382,32736,-1407,32735,-1433,32734,-1458,32733,-1483,32732,-1508,32731,-1533,32729,-1558,32728,-1583,32727,-1608,32726,-1633,32725,-1659,32723,-1684,32722,-1709,32721,-1734,32719,-1759,32718,-1784,32717,-1809,32715,-1834,32714,-1859,32712,-1884,32711,-1909,32709,-1935,32708,-1960,32706,-1985,32705,-2010,32703,-2035,32702,-2060,32700,-2085,32699,-2110,32697,-2135,32695,-2160,32694,-2185,32692,-2210,32690,-2236,32688,-2261,32687,-2286,32685,-2311,32683,-2336,32681,-2361,32680,-2386,32678,-2411,32676,-2436,32674,-2461,32672,-2486,32670,-2511,32668,-2536,32666,-2561,32664,-2586,32662,-2611,32660,-2637,32658,-2662,32656,-2687,32654,-2712,32652,-2737,32650,-2762,32648,-2787,32646,-2812,32644,-2837,32641,-2862,32639,-2887,32637,-2912,32635,-2937,32632,-2962,32630,-2987,32628,-3012,32625,-3037,32623,-3062,32621,-3087,32618,-3112,32616,-3137,32614,-3162,32611,-3187,32609,-3212,32606,-3237,32604,-3262,32601,-3287,32599,-3312,32596,-3337,32594,-3362,32591,-3387,32588,-3412,32586,-3437,32583,-3462,32580,-3487,32578,-3512,32575,-3537,32572,-3562,32570,-3587,32567,-3612,32564,-3637,32561,-3662,32558,-3687,32556,-3712,32553,-3737,32550,-3762,32547,-3787,32544,-3812,32541,-3837,32538,-3862,32535,-3887,32532,-3912,32529,-3937,32526,-3962,32523,-3987,32520,-4012,32517,-4036,32514,-4061,32511,-4086,32508,-4111,32504,-4136,32501,-4161,32498,-4186,32495,-4211,32492,-4236,32488,-4261,32485,-4286,32482,-4311,32478,-4336,32475,-4360,32472,-4385,32468,-4410,32465,-4435,32462,-4460,32458,-4485,32455,-4510,32451,-4535,32448,-4560,32444,-4585,32441,-4609,32437,-4634,32434,-4659,32430,-4684,32426,-4709,32423,-4734,32419,-4759,32416,-4784,32412,-4808,32408,-4833,32404,-4858,32401,-4883,32397,-4908,32393,-4933,32389,-4958,32386,-4982,32382,-5007,32378,-5032,32374,-5057,32370,-5082,32366,-5107,32362,-5131,32358,-5156,32354,-5181,32350,-5206,32346,-5231,32342,-5255,32338,-5280,32334,-5305,32330,-5330,32326,-5355,32322,-5379,32318,-5404,32314,-5429,32310,-5454,32305,-5479,32301,-5503,32297,-5528,32293,-5553,32288,-5578,32284,-5602,32280,-5627,32275,-5652,32271,-5677,32267,-5701,32262,-5726,32258,-5751,32254,-5776,32249,-5800,32245,-5825,32240,-5850,32236,-5875,32231,-5899,32227,-5924,32222,-5949,32218,-5973,32213,-5998,32208,-6023,32204,-6048,32199,-6072,32194,-6097,32190,-6122,32185,-6146,32180,-6171,32176,-6196,32171,-6220,32166,-6245,32161,-6270,32156,-6294,32152,-6319,32147,-6344,32142,-6368,32137,-6393,32132,-6418,32127,-6442,32122,-6467,32117,-6492,32112,-6516,32107,-6541,32102,-6565,32097,-6590,32092,-6615,32087,-6639,32082,-6664,32077,-6689,32072,-6713,32066,-6738,32061,-6762,32056,-6787,32051,-6812,32046,-6836,32040,-6861,32035,-6885,32030,-6910,32024,-6934,32019,-6959,32014,-6983,32008,-7008,32003,-7033,31998,-7057,31992,-7082,31987,-7106,31981,-7131,31976,-7155,31970,-7180,31965,-7204,31959,-7229,31954,-7253,31948,-7278,31943,-7302,31937,-7327,31931,-7351,31926,-7376,31920,-7400,31914,-7425,31909,-7449,31903,-7474,31897,-7498,31891,-7523,31886,-7547,31880,-7572,31874,-7596,31868,-7620,31862,-7645,31856,-7669,31851,-7694,31845,-7718,31839,-7743,31833,-7767,31827,-7791,31821,-7816,31815,-7840,31809,-7865,31803,-7889,31797,-7913,31791,-7938,31785,-7962,31778,-7987,31772,-8011,31766,-8035,31760,-8060,31754,-8084,31748,-8108,31741,-8133,31735,-8157,31729,-8181,31723,-8206,31716,-8230,31710,-8254,31704,-8279,31697,-8303,31691,-8327,31684,-8352,31678,-8376,31672,-8400,31665,-8425,31659,-8449,31652,-8473,31646,-8497,31639,-8522,31633,-8546,31626,-8570,31619,-8594,31613,-8619,31606,-8643,31600,-8667,31593,-8691,31586,-8716,31580,-8740,31573,-8764,31566,-8788,31559,-8813,31553,-8837,31546,-8861,31539,-8885,31532,-8909,31525,-8933,31518,-8958,31512,-8982,31505,-9006,31498,-9030,31491,-9054,31484,-9078,31477,-9103,31470,-9127,31463,-9151,31456,-9175,31449,-9199,31442,-9223,31435,-9247,31428,-9271,31420,-9296,31413,-9320,31406,-9344,31399,-9368,31392,-9392,31385,-9416,31377,-9440,31370,-9464,31363,-9488,31356,-9512,31348,-9536,31341,-9560,31334,-9584,31326,-9608,31319,-9632,31311,-9656,31304,-9680,31297,-9704,31289,-9728,31282,-9752,31274,-9776,31267,-9800,31259,-9824,31252,-9848,31244,-9872,31236,-9896,31229,-9920,31221,-9944,31214,-9968,31206,-9992,31198,-10016,31191,-10040,31183,-10064,31175,-10088,31167,-10112,31160,-10136,31152,-10160,31144,-10183,31136,-10207,31128,-10231,31121,-10255,31113,-10279,31105,-10303,31097,-10327,31089,-10350,31081,-10374,31073,-10398,31065,-10422,31057,-10446,31049,-10470,31041,-10493,31033,-10517,31025,-10541,31017,-10565,31009,-10589,31001,-10612,30992,-10636,30984,-10660,30976,-10684,30968,-10707,30960,-10731,30951,-10755,30943,-10779,30935,-10802,30927,-10826,30918,-10850,30910,-10874,30902,-10897,30893,-10921,30885,-10945,30876,-10968,30868,-10992,30860,-11016,30851,-11039,30843,-11063,30834,-11087,30826,-11110,30817,-11134,30809,-11158,30800,-11181,30791,-11205,30783,-11228,30774,-11252,30766,-11276,30757,-11299,30748,-11323,30739,-11346,30731,-11370,30722,-11394,30713,-11417,30705,-11441,30696,-11464,30687,-11488,30678,-11511,30669,-11535,30660,-11558,30652,-11582,30643,-11605,30634,-11629,30625,-11652,30616,-11676,30607,-11699,30598,-11723,30589,-11746,30580,-11770,30571,-11793,30562,-11817,30553,-11840,30544,-11863,30535,-11887,30525,-11910,30516,-11934,30507,-11957,30498,-11981,30489,-12004,30480,-12027,30470,-12051,30461,-12074,30452,-12097,30442,-12121,30433,-12144,30424,-12167,30415,-12191,30405,-12214,30396,-12237,30386,-12261,30377,-12284,30368,-12307,30358,-12331,30349,-12354,30339,-12377,30330,-12400,30320,-12424,30311,-12447,30301,-12470,30291,-12493,30282,-12517,30272,-12540,30263,-12563,30253,-12586,30243,-12610,30234,-12633,30224,-12656,30214,-12679,30205,-12702,30195,-12725,30185,-12749,30175,-12772,30165,-12795,30156,-12818,30146,-12841,30136,-12864,30126,-12887,30116,-12910,30106,-12934,30096,-12957,30086,-12980,30076,-13003,30066,-13026,30056,-13049,30046,-13072,30036,-13095,30026,-13118,30016,-13141,30006,-13164,29996,-13187,29986,-13210,29976,-13233,29966,-13256,29955,-13279,29945,-13302,29935,-13325,29925,-13348,29915,-13371,29904,-13394,29894,-13417,29884,-13440,29873,-13463,29863,-13486,29853,-13508,29842,-13531,29832,-13554,29822,-13577,29811,-13600,29801,-13623,29790,-13646,29780,-13668,29769,-13691,29759,-13714,29748,-13737,29738,-13760,29727,-13783,29717,-13805,29706,-13828,29695,-13851,29685,-13874,29674,-13896,29663,-13919,29653,-13942,29642,-13965,29631,-13987,29621,-14010,29610,-14033,29599,-14056,29588,-14078,29577,-14101,29567,-14124,29556,-14146,29545,-14169,29534,-14192,29523,-14214,29512,-14237,29501,-14260,29490,-14282,29479,-14305,29468,-14327,29457,-14350,29446,-14373,29435,-14395,29424,-14418,29413,-14440,29402,-14463,29391,-14485,29380,-14508,29369,-14531,29358,-14553,29346,-14576,29335,-14598,29324,-14621,29313,-14643,29302,-14666,29290,-14688,29279,-14710,29268,-14733,29256,-14755,29245,-14778,29234,-14800,29222,-14823,29211,-14845,29200,-14867,29188,-14890,29177,-14912,29165,-14935,29154,-14957,29142,-14979,29131,-15002,29119,-15024,29108,-15046,29096,-15069,29085,-15091,29073,-15113,29062,-15136,29050,-15158,29038,-15180,29027,-15202,29015,-15225,29003,-15247,28992,-15269,28980,-15291,28968,-15314,28956,-15336,28945,-15358,28933,-15380,28921,-15402,28909,-15425,28897,-15447,28886,-15469,28874,-15491,28862,-15513,28850,-15535,28838,-15557,28826,-15580,28814,-15602,28802,-15624,28790,-15646,28778,-15668,28766,-15690,28754,-15712,28742,-15734,28730,-15756,28718,-15778,28706,-15800,28694,-15822,28681,-15844,28669,-15866,28657,-15888,28645,-15910,28633,-15932,28620,-15954,28608,-15976,28596,-15998,28584,-16020,28571,-16042,28559,-16064,28547,-16086,28534,-16108,28522,-16129,28510,-16151,28497,-16173,28485,-16195,28472,-16217,28460,-16239,28447,-16261,28435,-16282,28423,-16304,28410,-16326,28397,-16348,28385,-16369,28372,-16391,28360,-16413,28347,-16435,28335,-16456,28322,-16478,28309,-16500,28297,-16522,28284,-16543,28271,-16565,28259,-16587,28246,-16608,28233,-16630,28220,-16652,28208,-16673,28195,-16695,28182,-16717,28169,-16738,28156,-16760,28143,-16781,28131,-16803,28118,-16825,28105,-16846,28092,-16868,28079,-16889,28066,-16911,28053,-16932,28040,-16954,28027,-16975,28014,-16997,28001,-17018,27988,-17040,27975,-17061,27962,-17083,27948,-17104,27935,-17125,27922,-17147,27909,-17168,27896,-17190,27883,-17211,27869,-17233,27856,-17254,27843,-17275,27830,-17297,27816,-17318,27803,-17339,27790,-17361,27777,-17382,27763,-17403,27750,-17424,27736,-17446,27723,-17467,27710,-17488,27696,-17510,27683,-17531,27669,-17552,27656,-17573,27642,-17594,27629,-17616,27615,-17637,27602,-17658,27588,-17679,27575,-17700,27561,-17721,27548,-17743,27534,-17764,27520,-17785,27507,-17806,27493,-17827,27479,-17848,27466,-17869,27452,-17890,27438,-17911,27424,-17932,27411,-17953,27397,-17974,27383,-17995,27369,-18016,27355,-18037,27342,-18058,27328,-18079,27314,-18100,27300,-18121,27286,-18142,27272,-18163,27258,-18184,27244,-18205,27230,-18226,27216,-18247,27202,-18268,27188,-18288,27174,-18309,27160,-18330,27146,-18351,27132,-18372,27118,-18393,27104,-18413,27090,-18434,27076,-18455,27061,-18476,27047,-18496,27033,-18517,27019,-18538,27005,-18559,26990,-18579,26976,-18600,26962,-18621,26948,-18641,26933,-18662,26919,-18683,26905,-18703,26890,-18724,26876,-18745,26861,-18765,26847,-18786,26833,-18806,26818,-18827,26804,-18847,26789,-18868,26775,-18889,26760,-18909,26746,-18930,26731,-18950,26717,-18971,26702,-18991,26688,-19012,26673,-19032,26658,-19052,26644,-19073,26629,-19093,26615,-19114,26600,-19134,26585,-19155,26570,-19175,26556,-19195,26541,-19216,26526,-19236,26512,-19256,26497,-19277,26482,-19297,26467,-19317,26452,-19338,26437,-19358,26423,-19378,26408,-19398,26393,-19419,26378,-19439,26363,-19459,26348,-19479,26333,-19500,26318,-19520,26303,-19540,26288,-19560,26273,-19580,26258,-19600,26243,-19621,26228,-19641,26213,-19661,26198,-19681,26183,-19701,26168,-19721,26153,-19741,26137,-19761,26122,-19781,26107,-19801,26092,-19821,26077,-19841,26061,-19861,26046,-19881,26031,-19901,26016,-19921,26000,-19941,25985,-19961,25970,-19981,25954,-20001,25939,-20021,25924,-20041,25908,-20061,25893,-20080,25878,-20100,25862,-20120,25847,-20140,25831,-20160,25816,-20180,25800,-20199,25785,-20219,25769,-20239,25754,-20259,25738,-20278,25723,-20298,25707,-20318,25691,-20338,25676,-20357,25660,-20377,25645,-20397,25629,-20416,25613,-20436,25598,-20456,25582,-20475,25566,-20495,25550,-20514,25535,-20534,25519,-20554,25503,-20573,25487,-20593,25472,-20612,25456,-20632,25440,-20651,25424,-20671,25408,-20690,25392,-20710,25376,-20729,25361,-20749,25345,-20768,25329,-20788,25313,-20807,25297,-20826,25281,-20846,25265,-20865,25249,-20885,25233,-20904,25217,-20923,25201,-20943,25185,-20962,25169,-20981,25152,-21001,25136,-21020,25120,-21039,25104,-21058,25088,-21078,25072,-21097,25056,-21116,25039,-21135,25023,-21155,25007,-21174,24991,-21193,24974,-21212,24958,-21231,24942,-21250,24926,-21269,24909,-21289,24893,-21308,24877,-21327,24860,-21346,24844,-21365,24827,-21384,24811,-21403,24795,-21422,24778,-21441,24762,-21460,24745,-21479,24729,-21498,24712,-21517,24696,-21536,24679,-21555,24663,-21574,24646,-21593,24630,-21612,24613,-21630,24596,-21649,24580,-21668,24563,-21687,24546,-21706,24530,-21725,24513,-21744,24496,-21762,24480,-21781,24463,-21800,24446,-21819,24430,-21837,24413,-21856,24396,-21875,24379,-21894,24362,-21912,24346,-21931,24329,-21950,24312,-21968,24295,-21987,24278,-22005,24261,-22024,24244,-22043,24228,-22061,24211,-22080,24194,-22098,24177,-22117,24160,-22136,24143,-22154,24126,-22173,24109,-22191,24092,-22210,24075,-22228,24058,-22246,24041,-22265,24023,-22283,24006,-22302,23989,-22320,23972,-22339,23955,-22357,23938,-22375,23921,-22394,23903,-22412,23886,-22430,23869,-22449,23852,-22467,23835,-22485,23817,-22504,23800,-22522,23783,-22540,23766,-22558,23748,-22576,23731,-22595,23714,-22613,23696,-22631,23679,-22649,23661,-22667,23644,-22686,23627,-22704,23609,-22722,23592,-22740,23574,-22758,23557,-22776,23539,-22794,23522,-22812,23504,-22830,23487,-22848,23469,-22866,23452,-22884,23434,-22902,23417,-22920,23399,-22938,23382,-22956,23364,-22974,23346,-22992,23329,-23010,23311,-23028,23293,-23046,23276,-23063,23258,-23081,23240,-23099,23223,-23117,23205,-23135,23187,-23152,23169,-23170,23151,-23188,23134,-23206,23116,-23224,23098,-23241,23080,-23259,23062,-23277,23045,-23294,23027,-23312,23009,-23330,22991,-23347,22973,-23365,22955,-23383,22937,-23400,22919,-23418,22901,-23435,22883,-23453,22865,-23470,22847,-23488,22829,-23505,22811,-23523,22793,-23540,22775,-23558,22757,-23575,22739,-23593,22721,-23610,22703,-23628,22685,-23645,22666,-23662,22648,-23680,22630,-23697,22612,-23715,22594,-23732,22575,-23749,22557,-23767,22539,-23784,22521,-23801,22503,-23818,22484,-23836,22466,-23853,22448,-23870,22429,-23887,22411,-23904,22393,-23922,22374,-23939,22356,-23956,22338,-23973,22319,-23990,22301,-24007,22282,-24024,22264,-24042,22245,-24059,22227,-24076,22209,-24093,22190,-24110,22172,-24127,22153,-24144,22135,-24161,22116,-24178,22097,-24195,22079,-24212,22060,-24229,22042,-24245,22023,-24262,22004,-24279,21986,-24296,21967,-24313,21949,-24330,21930,-24347,21911,-24363,21893,-24380,21874,-24397,21855,-24414,21836,-24431,21818,-24447,21799,-24464,21780,-24481,21761,-24497,21743,-24514,21724,-24531,21705,-24547,21686,-24564,21667,-24581,21648,-24597,21629,-24614,21611,-24631,21592,-24647,21573,-24664,21554,-24680,21535,-24697,21516,-24713,21497,-24730,21478,-24746,21459,-24763,21440,-24779,21421,-24796,21402,-24812,21383,-24828,21364,-24845,21345,-24861,21326,-24878,21307,-24894,21288,-24910,21268,-24927,21249,-24943,21230,-24959,21211,-24975,21192,-24992,21173,-25008,21154,-25024,21134,-25040,21115,-25057,21096,-25073,21077,-25089,21057,-25105,21038,-25121,21019,-25137,21000,-25153,20980,-25170,20961,-25186,20942,-25202,20922,-25218,20903,-25234,20884,-25250,20864,-25266,20845,-25282,20825,-25298,20806,-25314,20787,-25330,20767,-25346,20748,-25362,20728,-25377,20709,-25393,20689,-25409,20670,-25425,20650,-25441,20631,-25457,20611,-25473,20592,-25488,20572,-25504,20553,-25520,20533,-25536,20513,-25551,20494,-25567,20474,-25583,20455,-25599,20435,-25614,20415,-25630,20396,-25646,20376,-25661,20356,-25677,20337,-25692,20317,-25708,20297,-25724,20277,-25739,20258,-25755,20238,-25770,20218,-25786,20198,-25801,20179,-25817,20159,-25832,20139,-25848,20119,-25863,20099,-25879,20079,-25894,20060,-25909,20040,-25925,20020,-25940,20000,-25955,19980,-25971,19960,-25986,19940,-26001,19920,-26017,19900,-26032,19880,-26047,19860,-26062,19840,-26078,19820,-26093,19800,-26108,19780,-26123,19760,-26138,19740,-26154,19720,-26169,19700,-26184,19680,-26199,19660,-26214,19640,-26229,19620,-26244,19599,-26259,19579,-26274,19559,-26289,19539,-26304,19519,-26319,19499,-26334,19478,-26349,19458,-26364,19438,-26379,19418,-26394,19397,-26409,19377,-26424,19357,-26438,19337,-26453,19316,-26468,19296,-26483,19276,-26498,19255,-26513,19235,-26527,19215,-26542,19194,-26557,19174,-26571,19154,-26586,19133,-26601,19113,-26616,19092,-26630,19072,-26645,19051,-26659,19031,-26674,19011,-26689,18990,-26703,18970,-26718,18949,-26732,18929,-26747,18908,-26761,18888,-26776,18867,-26790,18846,-26805,18826,-26819,18805,-26834,18785,-26848,18764,-26862,18744,-26877,18723,-26891,18702,-26906,18682,-26920,18661,-26934,18640,-26949,18620,-26963,18599,-26977,18578,-26991,18558,-27006,18537,-27020,18516,-27034,18495,-27048,18475,-27062,18454,-27077,18433,-27091,18412,-27105,18392,-27119,18371,-27133,18350,-27147,18329,-27161,18308,-27175,18287,-27189,18267,-27203,18246,-27217,18225,-27231,18204,-27245,18183,-27259,18162,-27273,18141,-27287,18120,-27301,18099,-27315,18078,-27329,18057,-27343,18036,-27356,18015,-27370,17994,-27384,17973,-27398,17952,-27412,17931,-27425,17910,-27439,17889,-27453,17868,-27467,17847,-27480,17826,-27494,17805,-27508,17784,-27521,17763,-27535,17742,-27549,17720,-27562,17699,-27576,17678,-27589,17657,-27603,17636,-27616,17615,-27630,17593,-27643,17572,-27657,17551,-27670,17530,-27684,17509,-27697,17487,-27711,17466,-27724,17445,-27737,17423,-27751,17402,-27764,17381,-27778,17360,-27791,17338,-27804,17317,-27817,17296,-27831,17274,-27844,17253,-27857,17232,-27870,17210,-27884,17189,-27897,17167,-27910,17146,-27923,17124,-27936,17103,-27949,17082,-27963,17060,-27976,17039,-27989,17017,-28002,16996,-28015,16974,-28028,16953,-28041,16931,-28054,16910,-28067,16888,-28080,16867,-28093,16845,-28106,16824,-28119,16802,-28132,16780,-28144,16759,-28157,16737,-28170,16716,-28183,16694,-28196,16672,-28209,16651,-28221,16629,-28234,16607,-28247,16586,-28260,16564,-28272,16542,-28285,16521,-28298,16499,-28310,16477,-28323,16455,-28336,16434,-28348,16412,-28361,16390,-28373,16368,-28386,16347,-28398,16325,-28411,16303,-28424,16281,-28436,16260,-28448,16238,-28461,16216,-28473,16194,-28486,16172,-28498,16150,-28511,16128,-28523,16107,-28535,16085,-28548,16063,-28560,16041,-28572,16019,-28585,15997,-28597,15975,-28609,15953,-28621,15931,-28634,15909,-28646,15887,-28658,15865,-28670,15843,-28682,15821,-28695,15799,-28707,15777,-28719,15755,-28731,15733,-28743,15711,-28755,15689,-28767,15667,-28779,15645,-28791,15623,-28803,15601,-28815,15579,-28827,15556,-28839,15534,-28851,15512,-28863,15490,-28875,15468,-28887,15446,-28898,15424,-28910,15401,-28922,15379,-28934,15357,-28946,15335,-28957,15313,-28969,15290,-28981,15268,-28993,15246,-29004,15224,-29016,15201,-29028,15179,-29039,15157,-29051,15135,-29063,15112,-29074,15090,-29086,15068,-29097,15045,-29109,15023,-29120,15001,-29132,14978,-29143,14956,-29155,14934,-29166,14911,-29178,14889,-29189,14866,-29201,14844,-29212,14822,-29223,14799,-29235,14777,-29246,14754,-29257,14732,-29269,14709,-29280,14687,-29291,14665,-29303,14642,-29314,14620,-29325,14597,-29336,14575,-29347,14552,-29359,14530,-29370,14507,-29381,14484,-29392,14462,-29403,14439,-29414,14417,-29425,14394,-29436,14372,-29447,14349,-29458,14326,-29469,14304,-29480,14281,-29491,14259,-29502,14236,-29513,14213,-29524,14191,-29535,14168,-29546,14145,-29557,14123,-29568,14100,-29578,14077,-29589,14055,-29600,14032,-29611,14009,-29622,13986,-29632,13964,-29643,13941,-29654,13918,-29664,13895,-29675,13873,-29686,13850,-29696,13827,-29707,13804,-29718,13782,-29728,13759,-29739,13736,-29749,13713,-29760,13690,-29770,13667,-29781,13645,-29791,13622,-29802,13599,-29812,13576,-29823,13553,-29833,13530,-29843,13507,-29854,13485,-29864,13462,-29874,13439,-29885,13416,-29895,13393,-29905,13370,-29916,13347,-29926,13324,-29936,13301,-29946,13278,-29956,13255,-29967,13232,-29977,13209,-29987,13186,-29997,13163,-30007,13140,-30017,13117,-30027,13094,-30037,13071,-30047,13048,-30057,13025,-30067,13002,-30077,12979,-30087,12956,-30097,12933,-30107,12909,-30117,12886,-30127,12863,-30137,12840,-30147,12817,-30157,12794,-30166,12771,-30176,12748,-30186,12724,-30196,12701,-30206,12678,-30215,12655,-30225,12632,-30235,12609,-30244,12585,-30254,12562,-30264,12539,-30273,12516,-30283,12492,-30292,12469,-30302,12446,-30312,12423,-30321,12399,-30331,12376,-30340,12353,-30350,12330,-30359,12306,-30369,12283,-30378,12260,-30387,12236,-30397,12213,-30406,12190,-30416,12166,-30425,12143,-30434,12120,-30443,12096,-30453,12073,-30462,12050,-30471,12026,-30481,12003,-30490,11980,-30499,11956,-30508,11933,-30517,11909,-30526,11886,-30536,11862,-30545,11839,-30554,11816,-30563,11792,-30572,11769,-30581,11745,-30590,11722,-30599,11698,-30608,11675,-30617,11651,-30626,11628,-30635,11604,-30644,11581,-30653,11557,-30661,11534,-30670,11510,-30679,11487,-30688,11463,-30697,11440,-30706,11416,-30714,11393,-30723,11369,-30732,11345,-30740,11322,-30749,11298,-30758,11275,-30767,11251,-30775,11227,-30784,11204,-30792,11180,-30801,11157,-30810,11133,-30818,11109,-30827,11086,-30835,11062,-30844,11038,-30852,11015,-30861,10991,-30869,10967,-30877,10944,-30886,10920,-30894,10896,-30903,10873,-30911,10849,-30919,10825,-30928,10801,-30936,10778,-30944,10754,-30952,10730,-30961,10706,-30969,10683,-30977,10659,-30985,10635,-30993,10611,-31002,10588,-31010,10564,-31018,10540,-31026,10516,-31034,10492,-31042,10469,-31050,10445,-31058,10421,-31066,10397,-31074,10373,-31082,10349,-31090,10326,-31098,10302,-31106,10278,-31114,10254,-31122,10230,-31129,10206,-31137,10182,-31145,10159,-31153,10135,-31161,10111,-31168,10087,-31176,10063,-31184,10039,-31192,10015,-31199,9991,-31207,9967,-31215,9943,-31222,9919,-31230,9895,-31237,9871,-31245,9847,-31253,9823,-31260,9799,-31268,9775,-31275,9751,-31283,9727,-31290,9703,-31298,9679,-31305,9655,-31312,9631,-31320,9607,-31327,9583,-31335,9559,-31342,9535,-31349,9511,-31357,9487,-31364,9463,-31371,9439,-31378,9415,-31386,9391,-31393,9367,-31400,9343,-31407,9319,-31414,9295,-31421,9270,-31429,9246,-31436,9222,-31443,9198,-31450,9174,-31457,9150,-31464,9126,-31471,9102,-31478,9077,-31485,9053,-31492,9029,-31499,9005,-31506,8981,-31513,8957,-31519,8932,-31526,8908,-31533,8884,-31540,8860,-31547,8836,-31554,8812,-31560,8787,-31567,8763,-31574,8739,-31581,8715,-31587,8690,-31594,8666,-31601,8642,-31607,8618,-31614,8593,-31620,8569,-31627,8545,-31634,8521,-31640,8496,-31647,8472,-31653,8448,-31660,8424,-31666,8399,-31673,8375,-31679,8351,-31685,8326,-31692,8302,-31698,8278,-31705,8253,-31711,8229,-31717,8205,-31724,8180,-31730,8156,-31736,8132,-31742,8107,-31749,8083,-31755,8059,-31761,8034,-31767,8010,-31773,7986,-31779,7961,-31786,7937,-31792,7912,-31798,7888,-31804,7864,-31810,7839,-31816,7815,-31822,7790,-31828,7766,-31834,7742,-31840,7717,-31846,7693,-31852,7668,-31857,7644,-31863,7619,-31869,7595,-31875,7571,-31881,7546,-31887,7522,-31892,7497,-31898,7473,-31904,7448,-31910,7424,-31915,7399,-31921,7375,-31927,7350,-31932,7326,-31938,7301,-31944,7277,-31949,7252,-31955,7228,-31960,7203,-31966,7179,-31971,7154,-31977,7130,-31982,7105,-31988,7081,-31993,7056,-31999,7032,-32004,7007,-32009,6982,-32015,6958,-32020,6933,-32025,6909,-32031,6884,-32036,6860,-32041,6835,-32047,6811,-32052,6786,-32057,6761,-32062,6737,-32067,6712,-32073,6688,-32078,6663,-32083,6638,-32088,6614,-32093,6589,-32098,6564,-32103,6540,-32108,6515,-32113,6491,-32118,6466,-32123,6441,-32128,6417,-32133,6392,-32138,6367,-32143,6343,-32148,6318,-32153,6293,-32157,6269,-32162,6244,-32167,6219,-32172,6195,-32177,6170,-32181,6145,-32186,6121,-32191,6096,-32195,6071,-32200,6047,-32205,6022,-32209,5997,-32214,5972,-32219,5948,-32223,5923,-32228,5898,-32232,5874,-32237,5849,-32241,5824,-32246,5799,-32250,5775,-32255,5750,-32259,5725,-32263,5700,-32268,5676,-32272,5651,-32276,5626,-32281,5601,-32285,5577,-32289,5552,-32294,5527,-32298,5502,-32302,5478,-32306,5453,-32311,5428,-32315,5403,-32319,5378,-32323,5354,-32327,5329,-32331,5304,-32335,5279,-32339,5254,-32343,5230,-32347,5205,-32351,5180,-32355,5155,-32359,5130,-32363,5106,-32367,5081,-32371,5056,-32375,5031,-32379,5006,-32383,4981,-32387,4957,-32390,4932,-32394,4907,-32398,4882,-32402,4857,-32405,4832,-32409,4807,-32413,4783,-32417,4758,-32420,4733,-32424,4708,-32427,4683,-32431,4658,-32435,4633,-32438,4608,-32442,4584,-32445,4559,-32449,4534,-32452,4509,-32456,4484,-32459,4459,-32463,4434,-32466,4409,-32469,4384,-32473,4359,-32476,4335,-32479,4310,-32483,4285,-32486,4260,-32489,4235,-32493,4210,-32496,4185,-32499,4160,-32502,4135,-32505,4110,-32509,4085,-32512,4060,-32515,4035,-32518,4011,-32521,3986,-32524,3961,-32527,3936,-32530,3911,-32533,3886,-32536,3861,-32539,3836,-32542,3811,-32545,3786,-32548,3761,-32551,3736,-32554,3711,-32557,3686,-32559,3661,-32562,3636,-32565,3611,-32568,3586,-32571,3561,-32573,3536,-32576,3511,-32579,3486,-32581,3461,-32584,3436,-32587,3411,-32589,3386,-32592,3361,-32595,3336,-32597,3311,-32600,3286,-32602,3261,-32605,3236,-32607,3211,-32610,3186,-32612,3161,-32615,3136,-32617,3111,-32619,3086,-32622,3061,-32624,3036,-32626,3011,-32629,2986,-32631,2961,-32633,2936,-32636,2911,-32638,2886,-32640,2861,-32642,2836,-32645,2811,-32647,2786,-32649,2761,-32651,2736,-32653,2711,-32655,2686,-32657,2661,-32659,2636,-32661,2610,-32663,2585,-32665,2560,-32667,2535,-32669,2510,-32671,2485,-32673,2460,-32675,2435,-32677,2410,-32679,2385,-32681,2360,-32682,2335,-32684,2310,-32686,2285,-32688,2260,-32689,2235,-32691,2209,-32693,2184,-32695,2159,-32696,2134,-32698,2109,-32700,2084,-32701,2059,-32703,2034,-32704,2009,-32706,1984,-32707,1959,-32709,1934,-32710,1908,-32712,1883,-32713,1858,-32715,1833,-32716,1808,-32718,1783,-32719,1758,-32720,1733,-32722,1708,-32723,1683,-32724,1658,-32726,1632,-32727,1607,-32728,1582,-32729,1557,-32730,1532,-32732,1507,-32733,1482,-32734,1457,-32735,1432,-32736,1406,-32737,1381,-32738,1356,-32739,1331,-32740,1306,-32741,1281,-32742,1256,-32743,1231,-32744,1206,-32745,1180,-32746,1155,-32747,1130,-32748,1105,-32749,1080,-32750,1055,-32751,1030,-32751,1005,-32752,980,-32753,954,-32754,929,-32754,904,-32755,879,-32756,854,-32756,829,-32757,804,-32758,779,-32758,753,-32759,728,-32759,703,-32760,678,-32760,653,-32761,628,-32761,603,-32762,578,-32762,552,-32763,527,-32763,502,-32764,477,-32764,452,-32764,427,-32765,402,-32765,376,-32765,351,-32766,326,-32766,301,-32766,276,-32766,251,-32767,226,-32767,201,-32767,175,-32767,150,-32767,125,-32767,100,-32767,75,-32767,50,-32767,25,-32767,0,-32767,-26,-32767,-51,-32767,-76,-32767,-101,-32767,-126,-32767,-151,-32767,-176,-32767,-202,-32767,-227,-32767,-252,-32767,-277,-32766,-302,-32766,-327,-32766,-352,-32766,-377,-32765,-403,-32765,-428,-32765,-453,-32764,-478,-32764,-503,-32764,-528,-32763,-553,-32763,-579,-32762,-604,-32762,-629,-32761,-654,-32761,-679,-32760,-704,-32760,-729,-32759,-754,-32759,-780,-32758,-805,-32758,-830,-32757,-855,-32756,-880,-32756,-905,-32755,-930,-32754,-955,-32754,-981,-32753,-1006,-32752,-1031,-32751,-1056,-32751,-1081,-32750,-1106,-32749,-1131,-32748,-1156,-32747,-1181,-32746,-1207,-32745,-1232,-32744,-1257,-32743,-1282,-32742,-1307,-32741,-1332,-32740,-1357,-32739,-1382,-32738,-1407,-32737,-1433,-32736,-1458,-32735,-1483,-32734,-1508,-32733,-1533,-32732,-1558,-32730,-1583,-32729,-1608,-32728,-1633,-32727,-1659,-32726,-1684,-32724,-1709,-32723,-1734,-32722,-1759,-32720,-1784,-32719,-1809,-32718,-1834,-32716,-1859,-32715,-1884,-32713,-1909,-32712,-1935,-32710,-1960,-32709,-1985,-32707,-2010,-32706,-2035,-32704,-2060,-32703,-2085,-32701,-2110,-32700,-2135,-32698,-2160,-32696,-2185,-32695,-2210,-32693,-2236,-32691,-2261,-32689,-2286,-32688,-2311,-32686,-2336,-32684,-2361,-32682,-2386,-32681,-2411,-32679,-2436,-32677,-2461,-32675,-2486,-32673,-2511,-32671,-2536,-32669,-2561,-32667,-2586,-32665,-2611,-32663,-2637,-32661,-2662,-32659,-2687,-32657,-2712,-32655,-2737,-32653,-2762,-32651,-2787,-32649,-2812,-32647,-2837,-32645,-2862,-32642,-2887,-32640,-2912,-32638,-2937,-32636,-2962,-32633,-2987,-32631,-3012,-32629,-3037,-32626,-3062,-32624,-3087,-32622,-3112,-32619,-3137,-32617,-3162,-32615,-3187,-32612,-3212,-32610,-3237,-32607,-3262,-32605,-3287,-32602,-3312,-32600,-3337,-32597,-3362,-32595,-3387,-32592,-3412,-32589,-3437,-32587,-3462,-32584,-3487,-32581,-3512,-32579,-3537,-32576,-3562,-32573,-3587,-32571,-3612,-32568,-3637,-32565,-3662,-32562,-3687,-32559,-3712,-32557,-3737,-32554,-3762,-32551,-3787,-32548,-3812,-32545,-3837,-32542,-3862,-32539,-3887,-32536,-3912,-32533,-3937,-32530,-3962,-32527,-3987,-32524,-4012,-32521,-4036,-32518,-4061,-32515,-4086,-32512,-4111,-32509,-4136,-32505,-4161,-32502,-4186,-32499,-4211,-32496,-4236,-32493,-4261,-32489,-4286,-32486,-4311,-32483,-4336,-32479,-4360,-32476,-4385,-32473,-4410,-32469,-4435,-32466,-4460,-32463,-4485,-32459,-4510,-32456,-4535,-32452,-4560,-32449,-4585,-32445,-4609,-32442,-4634,-32438,-4659,-32435,-4684,-32431,-4709,-32427,-4734,-32424,-4759,-32420,-4784,-32417,-4808,-32413,-4833,-32409,-4858,-32405,-4883,-32402,-4908,-32398,-4933,-32394,-4958,-32390,-4982,-32387,-5007,-32383,-5032,-32379,-5057,-32375,-5082,-32371,-5107,-32367,-5131,-32363,-5156,-32359,-5181,-32355,-5206,-32351,-5231,-32347,-5255,-32343,-5280,-32339,-5305,-32335,-5330,-32331,-5355,-32327,-5379,-32323,-5404,-32319,-5429,-32315,-5454,-32311,-5479,-32306,-5503,-32302,-5528,-32298,-5553,-32294,-5578,-32289,-5602,-32285,-5627,-32281,-5652,-32276,-5677,-32272,-5701,-32268,-5726,-32263,-5751,-32259,-5776,-32255,-5800,-32250,-5825,-32246,-5850,-32241,-5875,-32237,-5899,-32232,-5924,-32228,-5949,-32223,-5973,-32219,-5998,-32214,-6023,-32209,-6048,-32205,-6072,-32200,-6097,-32195,-6122,-32191,-6146,-32186,-6171,-32181,-6196,-32177,-6220,-32172,-6245,-32167,-6270,-32162,-6294,-32157,-6319,-32153,-6344,-32148,-6368,-32143,-6393,-32138,-6418,-32133,-6442,-32128,-6467,-32123,-6492,-32118,-6516,-32113,-6541,-32108,-6565,-32103,-6590,-32098,-6615,-32093,-6639,-32088,-6664,-32083,-6689,-32078,-6713,-32073,-6738,-32067,-6762,-32062,-6787,-32057,-6812,-32052,-6836,-32047,-6861,-32041,-6885,-32036,-6910,-32031,-6934,-32025,-6959,-32020,-6983,-32015,-7008,-32009,-7033,-32004,-7057,-31999,-7082,-31993,-7106,-31988,-7131,-31982,-7155,-31977,-7180,-31971,-7204,-31966,-7229,-31960,-7253,-31955,-7278,-31949,-7302,-31944,-7327,-31938,-7351,-31932,-7376,-31927,-7400,-31921,-7425,-31915,-7449,-31910,-7474,-31904,-7498,-31898,-7523,-31892,-7547,-31887,-7572,-31881,-7596,-31875,-7620,-31869,-7645,-31863,-7669,-31857,-7694,-31852,-7718,-31846,-7743,-31840,-7767,-31834,-7791,-31828,-7816,-31822,-7840,-31816,-7865,-31810,-7889,-31804,-7913,-31798,-7938,-31792,-7962,-31786,-7987,-31779,-8011,-31773,-8035,-31767,-8060,-31761,-8084,-31755,-8108,-31749,-8133,-31742,-8157,-31736,-8181,-31730,-8206,-31724,-8230,-31717,-8254,-31711,-8279,-31705,-8303,-31698,-8327,-31692,-8352,-31685,-8376,-31679,-8400,-31673,-8425,-31666,-8449,-31660,-8473,-31653,-8497,-31647,-8522,-31640,-8546,-31634,-8570,-31627,-8594,-31620,-8619,-31614,-8643,-31607,-8667,-31601,-8691,-31594,-8716,-31587,-8740,-31581,-8764,-31574,-8788,-31567,-8813,-31560,-8837,-31554,-8861,-31547,-8885,-31540,-8909,-31533,-8933,-31526,-8958,-31519,-8982,-31513,-9006,-31506,-9030,-31499,-9054,-31492,-9078,-31485,-9103,-31478,-9127,-31471,-9151,-31464,-9175,-31457,-9199,-31450,-9223,-31443,-9247,-31436,-9271,-31429,-9296,-31421,-9320,-31414,-9344,-31407,-9368,-31400,-9392,-31393,-9416,-31386,-9440,-31378,-9464,-31371,-9488,-31364,-9512,-31357,-9536,-31349,-9560,-31342,-9584,-31335,-9608,-31327,-9632,-31320,-9656,-31312,-9680,-31305,-9704,-31298,-9728,-31290,-9752,-31283,-9776,-31275,-9800,-31268,-9824,-31260,-9848,-31253,-9872,-31245,-9896,-31237,-9920,-31230,-9944,-31222,-9968,-31215,-9992,-31207,-10016,-31199,-10040,-31192,-10064,-31184,-10088,-31176,-10112,-31168,-10136,-31161,-10160,-31153,-10183,-31145,-10207,-31137,-10231,-31129,-10255,-31122,-10279,-31114,-10303,-31106,-10327,-31098,-10350,-31090,-10374,-31082,-10398,-31074,-10422,-31066,-10446,-31058,-10470,-31050,-10493,-31042,-10517,-31034,-10541,-31026,-10565,-31018,-10589,-31010,-10612,-31002,-10636,-30993,-10660,-30985,-10684,-30977,-10707,-30969,-10731,-30961,-10755,-30952,-10779,-30944,-10802,-30936,-10826,-30928,-10850,-30919,-10874,-30911,-10897,-30903,-10921,-30894,-10945,-30886,-10968,-30877,-10992,-30869,-11016,-30861,-11039,-30852,-11063,-30844,-11087,-30835,-11110,-30827,-11134,-30818,-11158,-30810,-11181,-30801,-11205,-30792,-11228,-30784,-11252,-30775,-11276,-30767,-11299,-30758,-11323,-30749,-11346,-30740,-11370,-30732,-11394,-30723,-11417,-30714,-11441,-30706,-11464,-30697,-11488,-30688,-11511,-30679,-11535,-30670,-11558,-30661,-11582,-30653,-11605,-30644,-11629,-30635,-11652,-30626,-11676,-30617,-11699,-30608,-11723,-30599,-11746,-30590,-11770,-30581,-11793,-30572,-11817,-30563,-11840,-30554,-11863,-30545,-11887,-30536,-11910,-30526,-11934,-30517,-11957,-30508,-11981,-30499,-12004,-30490,-12027,-30481,-12051,-30471,-12074,-30462,-12097,-30453,-12121,-30443,-12144,-30434,-12167,-30425,-12191,-30416,-12214,-30406,-12237,-30397,-12261,-30387,-12284,-30378,-12307,-30369,-12331,-30359,-12354,-30350,-12377,-30340,-12400,-30331,-12424,-30321,-12447,-30312,-12470,-30302,-12493,-30292,-12517,-30283,-12540,-30273,-12563,-30264,-12586,-30254,-12610,-30244,-12633,-30235,-12656,-30225,-12679,-30215,-12702,-30206,-12725,-30196,-12749,-30186,-12772,-30176,-12795,-30166,-12818,-30157,-12841,-30147,-12864,-30137,-12887,-30127,-12910,-30117,-12934,-30107,-12957,-30097,-12980,-30087,-13003,-30077,-13026,-30067,-13049,-30057,-13072,-30047,-13095,-30037,-13118,-30027,-13141,-30017,-13164,-30007,-13187,-29997,-13210,-29987,-13233,-29977,-13256,-29967,-13279,-29956,-13302,-29946,-13325,-29936,-13348,-29926,-13371,-29916,-13394,-29905,-13417,-29895,-13440,-29885,-13463,-29874,-13486,-29864,-13508,-29854,-13531,-29843,-13554,-29833,-13577,-29823,-13600,-29812,-13623,-29802,-13646,-29791,-13668,-29781,-13691,-29770,-13714,-29760,-13737,-29749,-13760,-29739,-13783,-29728,-13805,-29718,-13828,-29707,-13851,-29696,-13874,-29686,-13896,-29675,-13919,-29664,-13942,-29654,-13965,-29643,-13987,-29632,-14010,-29622,-14033,-29611,-14056,-29600,-14078,-29589,-14101,-29578,-14124,-29568,-14146,-29557,-14169,-29546,-14192,-29535,-14214,-29524,-14237,-29513,-14260,-29502,-14282,-29491,-14305,-29480,-14327,-29469,-14350,-29458,-14373,-29447,-14395,-29436,-14418,-29425,-14440,-29414,-14463,-29403,-14485,-29392,-14508,-29381,-14531,-29370,-14553,-29359,-14576,-29347,-14598,-29336,-14621,-29325,-14643,-29314,-14666,-29303,-14688,-29291,-14710,-29280,-14733,-29269,-14755,-29257,-14778,-29246,-14800,-29235,-14823,-29223,-14845,-29212,-14867,-29201,-14890,-29189,-14912,-29178,-14935,-29166,-14957,-29155,-14979,-29143,-15002,-29132,-15024,-29120,-15046,-29109,-15069,-29097,-15091,-29086,-15113,-29074,-15136,-29063,-15158,-29051,-15180,-29039,-15202,-29028,-15225,-29016,-15247,-29004,-15269,-28993,-15291,-28981,-15314,-28969,-15336,-28957,-15358,-28946,-15380,-28934,-15402,-28922,-15425,-28910,-15447,-28898,-15469,-28887,-15491,-28875,-15513,-28863,-15535,-28851,-15557,-28839,-15580,-28827,-15602,-28815,-15624,-28803,-15646,-28791,-15668,-28779,-15690,-28767,-15712,-28755,-15734,-28743,-15756,-28731,-15778,-28719,-15800,-28707,-15822,-28695,-15844,-28682,-15866,-28670,-15888,-28658,-15910,-28646,-15932,-28634,-15954,-28621,-15976,-28609,-15998,-28597,-16020,-28585,-16042,-28572,-16064,-28560,-16086,-28548,-16108,-28535,-16129,-28523,-16151,-28511,-16173,-28498,-16195,-28486,-16217,-28473,-16239,-28461,-16261,-28448,-16282,-28436,-16304,-28424,-16326,-28411,-16348,-28398,-16369,-28386,-16391,-28373,-16413,-28361,-16435,-28348,-16456,-28336,-16478,-28323,-16500,-28310,-16522,-28298,-16543,-28285,-16565,-28272,-16587,-28260,-16608,-28247,-16630,-28234,-16652,-28221,-16673,-28209,-16695,-28196,-16717,-28183,-16738,-28170,-16760,-28157,-16781,-28144,-16803,-28132,-16825,-28119,-16846,-28106,-16868,-28093,-16889,-28080,-16911,-28067,-16932,-28054,-16954,-28041,-16975,-28028,-16997,-28015,-17018,-28002,-17040,-27989,-17061,-27976,-17083,-27963,-17104,-27949,-17125,-27936,-17147,-27923,-17168,-27910,-17190,-27897,-17211,-27884,-17233,-27870,-17254,-27857,-17275,-27844,-17297,-27831,-17318,-27817,-17339,-27804,-17361,-27791,-17382,-27778,-17403,-27764,-17424,-27751,-17446,-27737,-17467,-27724,-17488,-27711,-17510,-27697,-17531,-27684,-17552,-27670,-17573,-27657,-17594,-27643,-17616,-27630,-17637,-27616,-17658,-27603,-17679,-27589,-17700,-27576,-17721,-27562,-17743,-27549,-17764,-27535,-17785,-27521,-17806,-27508,-17827,-27494,-17848,-27480,-17869,-27467,-17890,-27453,-17911,-27439,-17932,-27425,-17953,-27412,-17974,-27398,-17995,-27384,-18016,-27370,-18037,-27356,-18058,-27343,-18079,-27329,-18100,-27315,-18121,-27301,-18142,-27287,-18163,-27273,-18184,-27259,-18205,-27245,-18226,-27231,-18247,-27217,-18268,-27203,-18288,-27189,-18309,-27175,-18330,-27161,-18351,-27147,-18372,-27133,-18393,-27119,-18413,-27105,-18434,-27091,-18455,-27077,-18476,-27062,-18496,-27048,-18517,-27034,-18538,-27020,-18559,-27006,-18579,-26991,-18600,-26977,-18621,-26963,-18641,-26949,-18662,-26934,-18683,-26920,-18703,-26906,-18724,-26891,-18745,-26877,-18765,-26862,-18786,-26848,-18806,-26834,-18827,-26819,-18847,-26805,-18868,-26790,-18889,-26776,-18909,-26761,-18930,-26747,-18950,-26732,-18971,-26718,-18991,-26703,-19012,-26689,-19032,-26674,-19052,-26659,-19073,-26645,-19093,-26630,-19114,-26616,-19134,-26601,-19155,-26586,-19175,-26571,-19195,-26557,-19216,-26542,-19236,-26527,-19256,-26513,-19277,-26498,-19297,-26483,-19317,-26468,-19338,-26453,-19358,-26438,-19378,-26424,-19398,-26409,-19419,-26394,-19439,-26379,-19459,-26364,-19479,-26349,-19500,-26334,-19520,-26319,-19540,-26304,-19560,-26289,-19580,-26274,-19600,-26259,-19621,-26244,-19641,-26229,-19661,-26214,-19681,-26199,-19701,-26184,-19721,-26169,-19741,-26154,-19761,-26138,-19781,-26123,-19801,-26108,-19821,-26093,-19841,-26078,-19861,-26062,-19881,-26047,-19901,-26032,-19921,-26017,-19941,-26001,-19961,-25986,-19981,-25971,-20001,-25955,-20021,-25940,-20041,-25925,-20061,-25909,-20080,-25894,-20100,-25879,-20120,-25863,-20140,-25848,-20160,-25832,-20180,-25817,-20199,-25801,-20219,-25786,-20239,-25770,-20259,-25755,-20278,-25739,-20298,-25724,-20318,-25708,-20338,-25692,-20357,-25677,-20377,-25661,-20397,-25646,-20416,-25630,-20436,-25614,-20456,-25599,-20475,-25583,-20495,-25567,-20514,-25551,-20534,-25536,-20554,-25520,-20573,-25504,-20593,-25488,-20612,-25473,-20632,-25457,-20651,-25441,-20671,-25425,-20690,-25409,-20710,-25393,-20729,-25377,-20749,-25362,-20768,-25346,-20788,-25330,-20807,-25314,-20826,-25298,-20846,-25282,-20865,-25266,-20885,-25250,-20904,-25234,-20923,-25218,-20943,-25202,-20962,-25186,-20981,-25170,-21001,-25153,-21020,-25137,-21039,-25121,-21058,-25105,-21078,-25089,-21097,-25073,-21116,-25057,-21135,-25040,-21155,-25024,-21174,-25008,-21193,-24992,-21212,-24975,-21231,-24959,-21250,-24943,-21269,-24927,-21289,-24910,-21308,-24894,-21327,-24878,-21346,-24861,-21365,-24845,-21384,-24828,-21403,-24812,-21422,-24796,-21441,-24779,-21460,-24763,-21479,-24746,-21498,-24730,-21517,-24713,-21536,-24697,-21555,-24680,-21574,-24664,-21593,-24647,-21612,-24631,-21630,-24614,-21649,-24597,-21668,-24581,-21687,-24564,-21706,-24547,-21725,-24531,-21744,-24514,-21762,-24497,-21781,-24481,-21800,-24464,-21819,-24447,-21837,-24431,-21856,-24414,-21875,-24397,-21894,-24380,-21912,-24363,-21931,-24347,-21950,-24330,-21968,-24313,-21987,-24296,-22005,-24279,-22024,-24262,-22043,-24245,-22061,-24229,-22080,-24212,-22098,-24195,-22117,-24178,-22136,-24161,-22154,-24144,-22173,-24127,-22191,-24110,-22210,-24093,-22228,-24076,-22246,-24059,-22265,-24042,-22283,-24024,-22302,-24007,-22320,-23990,-22339,-23973,-22357,-23956,-22375,-23939,-22394,-23922,-22412,-23904,-22430,-23887,-22449,-23870,-22467,-23853,-22485,-23836,-22504,-23818,-22522,-23801,-22540,-23784,-22558,-23767,-22576,-23749,-22595,-23732,-22613,-23715,-22631,-23697,-22649,-23680,-22667,-23662,-22686,-23645,-22704,-23628,-22722,-23610,-22740,-23593,-22758,-23575,-22776,-23558,-22794,-23540,-22812,-23523,-22830,-23505,-22848,-23488,-22866,-23470,-22884,-23453,-22902,-23435,-22920,-23418,-22938,-23400,-22956,-23383,-22974,-23365,-22992,-23347,-23010,-23330,-23028,-23312,-23046,-23294,-23063,-23277,-23081,-23259,-23099,-23241,-23117,-23224,-23135,-23206,-23152,-23188,-23170,-23170,-23188,-23152,-23206,-23135,-23224,-23117,-23241,-23099,-23259,-23081,-23277,-23063,-23294,-23046,-23312,-23028,-23330,-23010,-23347,-22992,-23365,-22974,-23383,-22956,-23400,-22938,-23418,-22920,-23435,-22902,-23453,-22884,-23470,-22866,-23488,-22848,-23505,-22830,-23523,-22812,-23540,-22794,-23558,-22776,-23575,-22758,-23593,-22740,-23610,-22722,-23628,-22704,-23645,-22686,-23662,-22667,-23680,-22649,-23697,-22631,-23715,-22613,-23732,-22595,-23749,-22576,-23767,-22558,-23784,-22540,-23801,-22522,-23818,-22504,-23836,-22485,-23853,-22467,-23870,-22449,-23887,-22430,-23904,-22412,-23922,-22394,-23939,-22375,-23956,-22357,-23973,-22339,-23990,-22320,-24007,-22302,-24024,-22283,-24042,-22265,-24059,-22246,-24076,-22228,-24093,-22210,-24110,-22191,-24127,-22173,-24144,-22154,-24161,-22136,-24178,-22117,-24195,-22098,-24212,-22080,-24229,-22061,-24245,-22043,-24262,-22024,-24279,-22005,-24296,-21987,-24313,-21968,-24330,-21950,-24347,-21931,-24363,-21912,-24380,-21894,-24397,-21875,-24414,-21856,-24431,-21837,-24447,-21819,-24464,-21800,-24481,-21781,-24497,-21762,-24514,-21744,-24531,-21725,-24547,-21706,-24564,-21687,-24581,-21668,-24597,-21649,-24614,-21630,-24631,-21612,-24647,-21593,-24664,-21574,-24680,-21555,-24697,-21536,-24713,-21517,-24730,-21498,-24746,-21479,-24763,-21460,-24779,-21441,-24796,-21422,-24812,-21403,-24828,-21384,-24845,-21365,-24861,-21346,-24878,-21327,-24894,-21308,-24910,-21289,-24927,-21269,-24943,-21250,-24959,-21231,-24975,-21212,-24992,-21193,-25008,-21174,-25024,-21155,-25040,-21135,-25057,-21116,-25073,-21097,-25089,-21078,-25105,-21058,-25121,-21039,-25137,-21020,-25153,-21001,-25170,-20981,-25186,-20962,-25202,-20943,-25218,-20923,-25234,-20904,-25250,-20885,-25266,-20865,-25282,-20846,-25298,-20826,-25314,-20807,-25330,-20788,-25346,-20768,-25362,-20749,-25377,-20729,-25393,-20710,-25409,-20690,-25425,-20671,-25441,-20651,-25457,-20632,-25473,-20612,-25488,-20593,-25504,-20573,-25520,-20554,-25536,-20534,-25551,-20514,-25567,-20495,-25583,-20475,-25599,-20456,-25614,-20436,-25630,-20416,-25646,-20397,-25661,-20377,-25677,-20357,-25692,-20338,-25708,-20318,-25724,-20298,-25739,-20278,-25755,-20259,-25770,-20239,-25786,-20219,-25801,-20199,-25817,-20180,-25832,-20160,-25848,-20140,-25863,-20120,-25879,-20100,-25894,-20080,-25909,-20061,-25925,-20041,-25940,-20021,-25955,-20001,-25971,-19981,-25986,-19961,-26001,-19941,-26017,-19921,-26032,-19901,-26047,-19881,-26062,-19861,-26078,-19841,-26093,-19821,-26108,-19801,-26123,-19781,-26138,-19761,-26154,-19741,-26169,-19721,-26184,-19701,-26199,-19681,-26214,-19661,-26229,-19641,-26244,-19621,-26259,-19600,-26274,-19580,-26289,-19560,-26304,-19540,-26319,-19520,-26334,-19500,-26349,-19479,-26364,-19459,-26379,-19439,-26394,-19419,-26409,-19398,-26424,-19378,-26438,-19358,-26453,-19338,-26468,-19317,-26483,-19297,-26498,-19277,-26513,-19256,-26527,-19236,-26542,-19216,-26557,-19195,-26571,-19175,-26586,-19155,-26601,-19134,-26616,-19114,-26630,-19093,-26645,-19073,-26659,-19052,-26674,-19032,-26689,-19012,-26703,-18991,-26718,-18971,-26732,-18950,-26747,-18930,-26761,-18909,-26776,-18889,-26790,-18868,-26805,-18847,-26819,-18827,-26834,-18806,-26848,-18786,-26862,-18765,-26877,-18745,-26891,-18724,-26906,-18703,-26920,-18683,-26934,-18662,-26949,-18641,-26963,-18621,-26977,-18600,-26991,-18579,-27006,-18559,-27020,-18538,-27034,-18517,-27048,-18496,-27062,-18476,-27077,-18455,-27091,-18434,-27105,-18413,-27119,-18393,-27133,-18372,-27147,-18351,-27161,-18330,-27175,-18309,-27189,-18288,-27203,-18268,-27217,-18247,-27231,-18226,-27245,-18205,-27259,-18184,-27273,-18163,-27287,-18142,-27301,-18121,-27315,-18100,-27329,-18079,-27343,-18058,-27356,-18037,-27370,-18016,-27384,-17995,-27398,-17974,-27412,-17953,-27425,-17932,-27439,-17911,-27453,-17890,-27467,-17869,-27480,-17848,-27494,-17827,-27508,-17806,-27521,-17785,-27535,-17764,-27549,-17743,-27562,-17721,-27576,-17700,-27589,-17679,-27603,-17658,-27616,-17637,-27630,-17616,-27643,-17594,-27657,-17573,-27670,-17552,-27684,-17531,-27697,-17510,-27711,-17488,-27724,-17467,-27737,-17446,-27751,-17424,-27764,-17403,-27778,-17382,-27791,-17361,-27804,-17339,-27817,-17318,-27831,-17297,-27844,-17275,-27857,-17254,-27870,-17233,-27884,-17211,-27897,-17190,-27910,-17168,-27923,-17147,-27936,-17125,-27949,-17104,-27963,-17083,-27976,-17061,-27989,-17040,-28002,-17018,-28015,-16997,-28028,-16975,-28041,-16954,-28054,-16932,-28067,-16911,-28080,-16889,-28093,-16868,-28106,-16846,-28119,-16825,-28132,-16803,-28144,-16781,-28157,-16760,-28170,-16738,-28183,-16717,-28196,-16695,-28209,-16673,-28221,-16652,-28234,-16630,-28247,-16608,-28260,-16587,-28272,-16565,-28285,-16543,-28298,-16522,-28310,-16500,-28323,-16478,-28336,-16456,-28348,-16435,-28361,-16413,-28373,-16391,-28386,-16369,-28398,-16348,-28411,-16326,-28424,-16304,-28436,-16282,-28448,-16261,-28461,-16239,-28473,-16217,-28486,-16195,-28498,-16173,-28511,-16151,-28523,-16129,-28535,-16108,-28548,-16086,-28560,-16064,-28572,-16042,-28585,-16020,-28597,-15998,-28609,-15976,-28621,-15954,-28634,-15932,-28646,-15910,-28658,-15888,-28670,-15866,-28682,-15844,-28695,-15822,-28707,-15800,-28719,-15778,-28731,-15756,-28743,-15734,-28755,-15712,-28767,-15690,-28779,-15668,-28791,-15646,-28803,-15624,-28815,-15602,-28827,-15580,-28839,-15557,-28851,-15535,-28863,-15513,-28875,-15491,-28887,-15469,-28898,-15447,-28910,-15425,-28922,-15402,-28934,-15380,-28946,-15358,-28957,-15336,-28969,-15314,-28981,-15291,-28993,-15269,-29004,-15247,-29016,-15225,-29028,-15202,-29039,-15180,-29051,-15158,-29063,-15136,-29074,-15113,-29086,-15091,-29097,-15069,-29109,-15046,-29120,-15024,-29132,-15002,-29143,-14979,-29155,-14957,-29166,-14935,-29178,-14912,-29189,-14890,-29201,-14867,-29212,-14845,-29223,-14823,-29235,-14800,-29246,-14778,-29257,-14755,-29269,-14733,-29280,-14710,-29291,-14688,-29303,-14666,-29314,-14643,-29325,-14621,-29336,-14598,-29347,-14576,-29359,-14553,-29370,-14531,-29381,-14508,-29392,-14485,-29403,-14463,-29414,-14440,-29425,-14418,-29436,-14395,-29447,-14373,-29458,-14350,-29469,-14327,-29480,-14305,-29491,-14282,-29502,-14260,-29513,-14237,-29524,-14214,-29535,-14192,-29546,-14169,-29557,-14146,-29568,-14124,-29578,-14101,-29589,-14078,-29600,-14056,-29611,-14033,-29622,-14010,-29632,-13987,-29643,-13965,-29654,-13942,-29664,-13919,-29675,-13896,-29686,-13874,-29696,-13851,-29707,-13828,-29718,-13805,-29728,-13783,-29739,-13760,-29749,-13737,-29760,-13714,-29770,-13691,-29781,-13668,-29791,-13646,-29802,-13623,-29812,-13600,-29823,-13577,-29833,-13554,-29843,-13531,-29854,-13508,-29864,-13486,-29874,-13463,-29885,-13440,-29895,-13417,-29905,-13394,-29916,-13371,-29926,-13348,-29936,-13325,-29946,-13302,-29956,-13279,-29967,-13256,-29977,-13233,-29987,-13210,-29997,-13187,-30007,-13164,-30017,-13141,-30027,-13118,-30037,-13095,-30047,-13072,-30057,-13049,-30067,-13026,-30077,-13003,-30087,-12980,-30097,-12957,-30107,-12934,-30117,-12910,-30127,-12887,-30137,-12864,-30147,-12841,-30157,-12818,-30166,-12795,-30176,-12772,-30186,-12749,-30196,-12725,-30206,-12702,-30215,-12679,-30225,-12656,-30235,-12633,-30244,-12610,-30254,-12586,-30264,-12563,-30273,-12540,-30283,-12517,-30292,-12493,-30302,-12470,-30312,-12447,-30321,-12424,-30331,-12400,-30340,-12377,-30350,-12354,-30359,-12331,-30369,-12307,-30378,-12284,-30387,-12261,-30397,-12237,-30406,-12214,-30416,-12191,-30425,-12167,-30434,-12144,-30443,-12121,-30453,-12097,-30462,-12074,-30471,-12051,-30481,-12027,-30490,-12004,-30499,-11981,-30508,-11957,-30517,-11934,-30526,-11910,-30536,-11887,-30545,-11863,-30554,-11840,-30563,-11817,-30572,-11793,-30581,-11770,-30590,-11746,-30599,-11723,-30608,-11699,-30617,-11676,-30626,-11652,-30635,-11629,-30644,-11605,-30653,-11582,-30661,-11558,-30670,-11535,-30679,-11511,-30688,-11488,-30697,-11464,-30706,-11441,-30714,-11417,-30723,-11394,-30732,-11370,-30740,-11346,-30749,-11323,-30758,-11299,-30767,-11276,-30775,-11252,-30784,-11228,-30792,-11205,-30801,-11181,-30810,-11158,-30818,-11134,-30827,-11110,-30835,-11087,-30844,-11063,-30852,-11039,-30861,-11016,-30869,-10992,-30877,-10968,-30886,-10945,-30894,-10921,-30903,-10897,-30911,-10874,-30919,-10850,-30928,-10826,-30936,-10802,-30944,-10779,-30952,-10755,-30961,-10731,-30969,-10707,-30977,-10684,-30985,-10660,-30993,-10636,-31002,-10612,-31010,-10589,-31018,-10565,-31026,-10541,-31034,-10517,-31042,-10493,-31050,-10470,-31058,-10446,-31066,-10422,-31074,-10398,-31082,-10374,-31090,-10350,-31098,-10327,-31106,-10303,-31114,-10279,-31122,-10255,-31129,-10231,-31137,-10207,-31145,-10183,-31153,-10160,-31161,-10136,-31168,-10112,-31176,-10088,-31184,-10064,-31192,-10040,-31199,-10016,-31207,-9992,-31215,-9968,-31222,-9944,-31230,-9920,-31237,-9896,-31245,-9872,-31253,-9848,-31260,-9824,-31268,-9800,-31275,-9776,-31283,-9752,-31290,-9728,-31298,-9704,-31305,-9680,-31312,-9656,-31320,-9632,-31327,-9608,-31335,-9584,-31342,-9560,-31349,-9536,-31357,-9512,-31364,-9488,-31371,-9464,-31378,-9440,-31386,-9416,-31393,-9392,-31400,-9368,-31407,-9344,-31414,-9320,-31421,-9296,-31429,-9271,-31436,-9247,-31443,-9223,-31450,-9199,-31457,-9175,-31464,-9151,-31471,-9127,-31478,-9103,-31485,-9078,-31492,-9054,-31499,-9030,-31506,-9006,-31513,-8982,-31519,-8958,-31526,-8933,-31533,-8909,-31540,-8885,-31547,-8861,-31554,-8837,-31560,-8813,-31567,-8788,-31574,-8764,-31581,-8740,-31587,-8716,-31594,-8691,-31601,-8667,-31607,-8643,-31614,-8619,-31620,-8594,-31627,-8570,-31634,-8546,-31640,-8522,-31647,-8497,-31653,-8473,-31660,-8449,-31666,-8425,-31673,-8400,-31679,-8376,-31685,-8352,-31692,-8327,-31698,-8303,-31705,-8279,-31711,-8254,-31717,-8230,-31724,-8206,-31730,-8181,-31736,-8157,-31742,-8133,-31749,-8108,-31755,-8084,-31761,-8060,-31767,-8035,-31773,-8011,-31779,-7987,-31786,-7962,-31792,-7938,-31798,-7913,-31804,-7889,-31810,-7865,-31816,-7840,-31822,-7816,-31828,-7791,-31834,-7767,-31840,-7743,-31846,-7718,-31852,-7694,-31857,-7669,-31863,-7645,-31869,-7620,-31875,-7596,-31881,-7572,-31887,-7547,-31892,-7523,-31898,-7498,-31904,-7474,-31910,-7449,-31915,-7425,-31921,-7400,-31927,-7376,-31932,-7351,-31938,-7327,-31944,-7302,-31949,-7278,-31955,-7253,-31960,-7229,-31966,-7204,-31971,-7180,-31977,-7155,-31982,-7131,-31988,-7106,-31993,-7082,-31999,-7057,-32004,-7033,-32009,-7008,-32015,-6983,-32020,-6959,-32025,-6934,-32031,-6910,-32036,-6885,-32041,-6861,-32047,-6836,-32052,-6812,-32057,-6787,-32062,-6762,-32067,-6738,-32073,-6713,-32078,-6689,-32083,-6664,-32088,-6639,-32093,-6615,-32098,-6590,-32103,-6565,-32108,-6541,-32113,-6516,-32118,-6492,-32123,-6467,-32128,-6442,-32133,-6418,-32138,-6393,-32143,-6368,-32148,-6344,-32153,-6319,-32157,-6294,-32162,-6270,-32167,-6245,-32172,-6220,-32177,-6196,-32181,-6171,-32186,-6146,-32191,-6122,-32195,-6097,-32200,-6072,-32205,-6048,-32209,-6023,-32214,-5998,-32219,-5973,-32223,-5949,-32228,-5924,-32232,-5899,-32237,-5875,-32241,-5850,-32246,-5825,-32250,-5800,-32255,-5776,-32259,-5751,-32263,-5726,-32268,-5701,-32272,-5677,-32276,-5652,-32281,-5627,-32285,-5602,-32289,-5578,-32294,-5553,-32298,-5528,-32302,-5503,-32306,-5479,-32311,-5454,-32315,-5429,-32319,-5404,-32323,-5379,-32327,-5355,-32331,-5330,-32335,-5305,-32339,-5280,-32343,-5255,-32347,-5231,-32351,-5206,-32355,-5181,-32359,-5156,-32363,-5131,-32367,-5107,-32371,-5082,-32375,-5057,-32379,-5032,-32383,-5007,-32387,-4982,-32390,-4958,-32394,-4933,-32398,-4908,-32402,-4883,-32405,-4858,-32409,-4833,-32413,-4808,-32417,-4784,-32420,-4759,-32424,-4734,-32427,-4709,-32431,-4684,-32435,-4659,-32438,-4634,-32442,-4609,-32445,-4585,-32449,-4560,-32452,-4535,-32456,-4510,-32459,-4485,-32463,-4460,-32466,-4435,-32469,-4410,-32473,-4385,-32476,-4360,-32479,-4336,-32483,-4311,-32486,-4286,-32489,-4261,-32493,-4236,-32496,-4211,-32499,-4186,-32502,-4161,-32505,-4136,-32509,-4111,-32512,-4086,-32515,-4061,-32518,-4036,-32521,-4012,-32524,-3987,-32527,-3962,-32530,-3937,-32533,-3912,-32536,-3887,-32539,-3862,-32542,-3837,-32545,-3812,-32548,-3787,-32551,-3762,-32554,-3737,-32557,-3712,-32559,-3687,-32562,-3662,-32565,-3637,-32568,-3612,-32571,-3587,-32573,-3562,-32576,-3537,-32579,-3512,-32581,-3487,-32584,-3462,-32587,-3437,-32589,-3412,-32592,-3387,-32595,-3362,-32597,-3337,-32600,-3312,-32602,-3287,-32605,-3262,-32607,-3237,-32610,-3212,-32612,-3187,-32615,-3162,-32617,-3137,-32619,-3112,-32622,-3087,-32624,-3062,-32626,-3037,-32629,-3012,-32631,-2987,-32633,-2962,-32636,-2937,-32638,-2912,-32640,-2887,-32642,-2862,-32645,-2837,-32647,-2812,-32649,-2787,-32651,-2762,-32653,-2737,-32655,-2712,-32657,-2687,-32659,-2662,-32661,-2637,-32663,-2611,-32665,-2586,-32667,-2561,-32669,-2536,-32671,-2511,-32673,-2486,-32675,-2461,-32677,-2436,-32679,-2411,-32681,-2386,-32682,-2361,-32684,-2336,-32686,-2311,-32688,-2286,-32689,-2261,-32691,-2236,-32693,-2210,-32695,-2185,-32696,-2160,-32698,-2135,-32700,-2110,-32701,-2085,-32703,-2060,-32704,-2035,-32706,-2010,-32707,-1985,-32709,-1960,-32710,-1935,-32712,-1909,-32713,-1884,-32715,-1859,-32716,-1834,-32718,-1809,-32719,-1784,-32720,-1759,-32722,-1734,-32723,-1709,-32724,-1684,-32726,-1659,-32727,-1633,-32728,-1608,-32729,-1583,-32730,-1558,-32732,-1533,-32733,-1508,-32734,-1483,-32735,-1458,-32736,-1433,-32737,-1407,-32738,-1382,-32739,-1357,-32740,-1332,-32741,-1307,-32742,-1282,-32743,-1257,-32744,-1232,-32745,-1207,-32746,-1181,-32747,-1156,-32748,-1131,-32749,-1106,-32750,-1081,-32751,-1056,-32751,-1031,-32752,-1006,-32753,-981,-32754,-955,-32754,-930,-32755,-905,-32756,-880,-32756,-855,-32757,-830,-32758,-805,-32758,-780,-32759,-754,-32759,-729,-32760,-704,-32760,-679,-32761,-654,-32761,-629,-32762,-604,-32762,-579,-32763,-553,-32763,-528,-32764,-503,-32764,-478,-32764,-453,-32765,-428,-32765,-403,-32765,-377,-32766,-352,-32766,-327,-32766,-302,-32766,-277,-32767,-252,-32767,-227,-32767,-202,-32767,-176,-32767,-151,-32767,-126,-32767,-101,-32767,-76,-32767,-51,-32767,-26};
+#else //__AVX2__
+void dft4096(int16_t *x,int16_t *y,int scale)
+{
+
+  simd256_q15_t xtmp[512],ytmp[512],*tw4096_256p=(simd256_q15_t *)tw4096,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y;
+  simd256_q15_t *ytmpp = &ytmp[0];
+  int i,j;
+
+  for (i=0,j=0; i<512; i+=4,j++) {
+    transpose16_ooff_simd256(x256+i,xtmp+j,128);
+  }
+
+
+  dft1024((int16_t*)(xtmp),(int16_t*)(ytmp),1);
+  dft1024((int16_t*)(xtmp+128),(int16_t*)(ytmp+128),1);
+  dft1024((int16_t*)(xtmp+256),(int16_t*)(ytmp+256),1);
+  dft1024((int16_t*)(xtmp+384),(int16_t*)(ytmp+384),1);
+
+  for (i=0; i<128; i++) {
+    bfly4_256(ytmpp,ytmpp+128,ytmpp+256,ytmpp+384,
+	      y256p,y256p+128,y256p+256,y256p+384,
+	      tw4096_256p,tw4096_256p+128,tw4096_256p+256);
+    tw4096_256p++;
+    y256p++;
+    ytmpp++;
+  }
+
+  if (scale>0) {
+
+    for (i=0; i<32; i++) {
+      y256[0]  = shiftright_int16_simd256(y256[0],1);
+      y256[1]  = shiftright_int16_simd256(y256[1],1);
+      y256[2]  = shiftright_int16_simd256(y256[2],1);
+      y256[3]  = shiftright_int16_simd256(y256[3],1);
+      y256[4]  = shiftright_int16_simd256(y256[4],1);
+      y256[5]  = shiftright_int16_simd256(y256[5],1);
+      y256[6]  = shiftright_int16_simd256(y256[6],1);
+      y256[7]  = shiftright_int16_simd256(y256[7],1);
+      y256[8]  = shiftright_int16_simd256(y256[8],1);
+      y256[9]  = shiftright_int16_simd256(y256[9],1);
+      y256[10] = shiftright_int16_simd256(y256[10],1);
+      y256[11] = shiftright_int16_simd256(y256[11],1);
+      y256[12] = shiftright_int16_simd256(y256[12],1);
+      y256[13] = shiftright_int16_simd256(y256[13],1);
+      y256[14] = shiftright_int16_simd256(y256[14],1);
+      y256[15] = shiftright_int16_simd256(y256[15],1);
+
+      y256+=16;
+    }
+
+  }
+
+  _mm_empty();
+  _m_empty();
+
+}
+
+void idft4096(int16_t *x,int16_t *y,int scale)
+{
+
+  simd256_q15_t xtmp[512],ytmp[512],*tw4096_256p=(simd256_q15_t *)tw4096,*x256=(simd256_q15_t *)x,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y;
+  simd256_q15_t *ytmpp = &ytmp[0];
+  int i,j;
 
+  for (i=0,j=0; i<512; i+=4,j++) {
+    transpose16_ooff_simd256(x256+i,xtmp+j,128);
+  }
+
+
+  idft1024((int16_t*)(xtmp),(int16_t*)(ytmp),1);
+  idft1024((int16_t*)(xtmp+128),(int16_t*)(ytmp+128),1);
+  idft1024((int16_t*)(xtmp+256),(int16_t*)(ytmp+256),1);
+  idft1024((int16_t*)(xtmp+384),(int16_t*)(ytmp+384),1);
+
+  for (i=0; i<128; i++) {
+    ibfly4_256(ytmpp,ytmpp+128,ytmpp+256,ytmpp+384,
+	       y256p,y256p+128,y256p+256,y256p+384,
+	       tw4096_256p,tw4096_256p+128,tw4096_256p+256);
+    tw4096_256p++;
+    y256p++;
+    ytmpp++;
+  }
+
+  if (scale>0) {
+
+    for (i=0; i<32; i++) {
+      y256[0]  = shiftright_int16_simd256(y256[0],1);
+      y256[1]  = shiftright_int16_simd256(y256[1],1);
+      y256[2]  = shiftright_int16_simd256(y256[2],1);
+      y256[3]  = shiftright_int16_simd256(y256[3],1);
+      y256[4]  = shiftright_int16_simd256(y256[4],1);
+      y256[5]  = shiftright_int16_simd256(y256[5],1);
+      y256[6]  = shiftright_int16_simd256(y256[6],1);
+      y256[7]  = shiftright_int16_simd256(y256[7],1);
+      y256[8]  = shiftright_int16_simd256(y256[8],1);
+      y256[9]  = shiftright_int16_simd256(y256[9],1);
+      y256[10] = shiftright_int16_simd256(y256[10],1);
+      y256[11] = shiftright_int16_simd256(y256[11],1);
+      y256[12] = shiftright_int16_simd256(y256[12],1);
+      y256[13] = shiftright_int16_simd256(y256[13],1);
+      y256[14] = shiftright_int16_simd256(y256[14],1);
+      y256[15] = shiftright_int16_simd256(y256[15],1);
+
+      y256+=16;
+    }
+
+  }
+
+  _mm_empty();
+  _m_empty();
+
+}
+
+#endif //__AVX2__
+
+
+#include "twiddles8192.h"
+
+#ifndef __AVX2__
 void dft8192(int16_t *x,int16_t *y,int scale)
 {
 
@@ -3173,13 +5217,199 @@ void idft8192(int16_t *x,int16_t *y,int scale)
 
 }
 
+#else // __AVX2__
+void dft8192(int16_t *x,int16_t *y,int scale)
+{
+
+  simd256_q15_t xtmp[1024],*xtmpp,*x256 = (simd256_q15_t *)x;
+  simd256_q15_t ytmp[1024],*tw8192_256p=(simd256_q15_t *)tw8192,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y;
+  simd256_q15_t *ytmpp = &ytmp[0];
+  int i;
+  simd256_q15_t ONE_OVER_SQRT2_Q15_128 = set1_int16_simd256(ONE_OVER_SQRT2_Q15);
+  
+  xtmpp = xtmp;
+
+  for (i=0; i<32; i++) {
+    transpose4_ooff_simd256(x256  ,xtmpp,512);
+    transpose4_ooff_simd256(x256+2,xtmpp+1,512);
+    transpose4_ooff_simd256(x256+4,xtmpp+2,512);
+    transpose4_ooff_simd256(x256+6,xtmpp+3,512);
+    transpose4_ooff_simd256(x256+8,xtmpp+4,512);
+    transpose4_ooff_simd256(x256+10,xtmpp+5,512);
+    transpose4_ooff_simd256(x256+12,xtmpp+6,512);
+    transpose4_ooff_simd256(x256+14,xtmpp+7,512);
+    transpose4_ooff_simd256(x256+16,xtmpp+8,512);
+    transpose4_ooff_simd256(x256+18,xtmpp+9,512);
+    transpose4_ooff_simd256(x256+20,xtmpp+10,512);
+    transpose4_ooff_simd256(x256+22,xtmpp+11,512);
+    transpose4_ooff_simd256(x256+24,xtmpp+12,512);
+    transpose4_ooff_simd256(x256+26,xtmpp+13,512);
+    transpose4_ooff_simd256(x256+28,xtmpp+14,512);
+    transpose4_ooff_simd256(x256+30,xtmpp+15,512);
+    transpose4_ooff_simd256(x256+32,xtmpp+16,512);
+    transpose4_ooff_simd256(x256+34,xtmpp+17,512);
+    transpose4_ooff_simd256(x256+36,xtmpp+18,512);
+    transpose4_ooff_simd256(x256+38,xtmpp+19,512);
+    transpose4_ooff_simd256(x256+40,xtmpp+20,512);
+    transpose4_ooff_simd256(x256+42,xtmpp+21,512);
+    transpose4_ooff_simd256(x256+44,xtmpp+22,512);
+    transpose4_ooff_simd256(x256+46,xtmpp+23,512);
+    transpose4_ooff_simd256(x256+48,xtmpp+24,512);
+    transpose4_ooff_simd256(x256+50,xtmpp+25,512);
+    transpose4_ooff_simd256(x256+52,xtmpp+26,512);
+    transpose4_ooff_simd256(x256+54,xtmpp+27,512);
+    transpose4_ooff_simd256(x256+56,xtmpp+28,512);
+    transpose4_ooff_simd256(x256+58,xtmpp+29,512);
+    transpose4_ooff_simd256(x256+60,xtmpp+30,512);
+    transpose4_ooff_simd256(x256+62,xtmpp+31,512);
+    x256+=64;
+    xtmpp+=32;
+  }
+
+  dft4096((int16_t*)(xtmp),(int16_t*)ytmp,1);
+  dft4096((int16_t*)(xtmp+1024),(int16_t*)(ytmp+512),1);
+
+
+  for (i=0; i<512; i++) {
+    bfly2_256(ytmpp,ytmpp+512,
+	      y256p,y256p+512,
+	      tw8192_256p);
+    tw8192_256p++;
+    y256p++;
+    ytmpp++;
+  }
+
+  if (scale>0) {
+    y256p = y256;
+
+    for (i=0; i<64; i++) {
+      y256p[0]  = mulhi_int16_simd256(y256p[0],ONE_OVER_SQRT2_Q15_128);
+      y256p[1]  = mulhi_int16_simd256(y256p[1],ONE_OVER_SQRT2_Q15_128);
+      y256p[2]  = mulhi_int16_simd256(y256p[2],ONE_OVER_SQRT2_Q15_128);
+      y256p[3]  = mulhi_int16_simd256(y256p[3],ONE_OVER_SQRT2_Q15_128);
+      y256p[4]  = mulhi_int16_simd256(y256p[4],ONE_OVER_SQRT2_Q15_128);
+      y256p[5]  = mulhi_int16_simd256(y256p[5],ONE_OVER_SQRT2_Q15_128);
+      y256p[6]  = mulhi_int16_simd256(y256p[6],ONE_OVER_SQRT2_Q15_128);
+      y256p[7]  = mulhi_int16_simd256(y256p[7],ONE_OVER_SQRT2_Q15_128);
+      y256p[8]  = mulhi_int16_simd256(y256p[8],ONE_OVER_SQRT2_Q15_128);
+      y256p[9]  = mulhi_int16_simd256(y256p[9],ONE_OVER_SQRT2_Q15_128);
+      y256p[10] = mulhi_int16_simd256(y256p[10],ONE_OVER_SQRT2_Q15_128);
+      y256p[11] = mulhi_int16_simd256(y256p[11],ONE_OVER_SQRT2_Q15_128);
+      y256p[12] = mulhi_int16_simd256(y256p[12],ONE_OVER_SQRT2_Q15_128);
+      y256p[13] = mulhi_int16_simd256(y256p[13],ONE_OVER_SQRT2_Q15_128);
+      y256p[14] = mulhi_int16_simd256(y256p[14],ONE_OVER_SQRT2_Q15_128);
+      y256p[15] = mulhi_int16_simd256(y256p[15],ONE_OVER_SQRT2_Q15_128);
+      y256p+=16;
+    }
+  }
+
+  _mm_empty();
+  _m_empty();
+
+}
+
+void idft8192(int16_t *x,int16_t *y,int scale)
+{
+
+  simd256_q15_t xtmp[1024],*xtmpp,*x256 = (simd256_q15_t *)x;
+  simd256_q15_t ytmp[1024],*tw8192_256p=(simd256_q15_t *)tw8192,*y256=(simd256_q15_t *)y,*y256p=(simd256_q15_t *)y;
+  simd256_q15_t *ytmpp = &ytmp[0];
+  int i;
+  simd256_q15_t ONE_OVER_SQRT2_Q15_128 = set1_int16_simd256(ONE_OVER_SQRT2_Q15);
+  
+  xtmpp = xtmp;
+
+  for (i=0; i<32; i++) {
+    transpose4_ooff_simd256(x256  ,xtmpp,512);
+    transpose4_ooff_simd256(x256+2,xtmpp+1,512);
+    transpose4_ooff_simd256(x256+4,xtmpp+2,512);
+    transpose4_ooff_simd256(x256+6,xtmpp+3,512);
+    transpose4_ooff_simd256(x256+8,xtmpp+4,512);
+    transpose4_ooff_simd256(x256+10,xtmpp+5,512);
+    transpose4_ooff_simd256(x256+12,xtmpp+6,512);
+    transpose4_ooff_simd256(x256+14,xtmpp+7,512);
+    transpose4_ooff_simd256(x256+16,xtmpp+8,512);
+    transpose4_ooff_simd256(x256+18,xtmpp+9,512);
+    transpose4_ooff_simd256(x256+20,xtmpp+10,512);
+    transpose4_ooff_simd256(x256+22,xtmpp+11,512);
+    transpose4_ooff_simd256(x256+24,xtmpp+12,512);
+    transpose4_ooff_simd256(x256+26,xtmpp+13,512);
+    transpose4_ooff_simd256(x256+28,xtmpp+14,512);
+    transpose4_ooff_simd256(x256+30,xtmpp+15,512);
+    transpose4_ooff_simd256(x256+32,xtmpp+16,512);
+    transpose4_ooff_simd256(x256+34,xtmpp+17,512);
+    transpose4_ooff_simd256(x256+36,xtmpp+18,512);
+    transpose4_ooff_simd256(x256+38,xtmpp+19,512);
+    transpose4_ooff_simd256(x256+40,xtmpp+20,512);
+    transpose4_ooff_simd256(x256+42,xtmpp+21,512);
+    transpose4_ooff_simd256(x256+44,xtmpp+22,512);
+    transpose4_ooff_simd256(x256+46,xtmpp+23,512);
+    transpose4_ooff_simd256(x256+48,xtmpp+24,512);
+    transpose4_ooff_simd256(x256+50,xtmpp+25,512);
+    transpose4_ooff_simd256(x256+52,xtmpp+26,512);
+    transpose4_ooff_simd256(x256+54,xtmpp+27,512);
+    transpose4_ooff_simd256(x256+56,xtmpp+28,512);
+    transpose4_ooff_simd256(x256+58,xtmpp+29,512);
+    transpose4_ooff_simd256(x256+60,xtmpp+30,512);
+    transpose4_ooff_simd256(x256+62,xtmpp+31,512);
+    x256+=64;
+    xtmpp+=32;
+  }
+
+  idft4096((int16_t*)(xtmp),(int16_t*)ytmp,1);
+  idft4096((int16_t*)(xtmp+1024),(int16_t*)(ytmp+512),1);
+
+
+  for (i=0; i<512; i++) {
+    ibfly2_256(ytmpp,ytmpp+512,
+	       y256p,y256p+512,
+	       tw8192_256p);
+    tw8192_256p++;
+    y256p++;
+    ytmpp++;
+  }
+
+  if (scale>0) {
+    y256p = y256;
+
+    for (i=0; i<64; i++) {
+      y256p[0]  = mulhi_int16_simd256(y256p[0],ONE_OVER_SQRT2_Q15_128);
+      y256p[1]  = mulhi_int16_simd256(y256p[1],ONE_OVER_SQRT2_Q15_128);
+      y256p[2]  = mulhi_int16_simd256(y256p[2],ONE_OVER_SQRT2_Q15_128);
+      y256p[3]  = mulhi_int16_simd256(y256p[3],ONE_OVER_SQRT2_Q15_128);
+      y256p[4]  = mulhi_int16_simd256(y256p[4],ONE_OVER_SQRT2_Q15_128);
+      y256p[5]  = mulhi_int16_simd256(y256p[5],ONE_OVER_SQRT2_Q15_128);
+      y256p[6]  = mulhi_int16_simd256(y256p[6],ONE_OVER_SQRT2_Q15_128);
+      y256p[7]  = mulhi_int16_simd256(y256p[7],ONE_OVER_SQRT2_Q15_128);
+      y256p[8]  = mulhi_int16_simd256(y256p[8],ONE_OVER_SQRT2_Q15_128);
+      y256p[9]  = mulhi_int16_simd256(y256p[9],ONE_OVER_SQRT2_Q15_128);
+      y256p[10] = mulhi_int16_simd256(y256p[10],ONE_OVER_SQRT2_Q15_128);
+      y256p[11] = mulhi_int16_simd256(y256p[11],ONE_OVER_SQRT2_Q15_128);
+      y256p[12] = mulhi_int16_simd256(y256p[12],ONE_OVER_SQRT2_Q15_128);
+      y256p[13] = mulhi_int16_simd256(y256p[13],ONE_OVER_SQRT2_Q15_128);
+      y256p[14] = mulhi_int16_simd256(y256p[14],ONE_OVER_SQRT2_Q15_128);
+      y256p[15] = mulhi_int16_simd256(y256p[15],ONE_OVER_SQRT2_Q15_128);
+      y256p+=16;
+    }
+  }
+
+  _mm_empty();
+  _m_empty();
+
+}
+
+
+#endif
+
 #include "twiddle1536.h"
 // 512 x 3
-void idft1536(int16_t *input, int16_t *output)
+void idft1536(int16_t *input, int16_t *output, int scale)
 {
   int i,i2,j;
-  uint32_t tmp[3][512 ]__attribute__((aligned(16)));
-  uint32_t tmpo[3][512] __attribute__((aligned(16)));
+  uint32_t tmp[3][512 ]__attribute__((aligned(32)));
+  uint32_t tmpo[3][512] __attribute__((aligned(32)));
+  simd_q15_t *y128p=(simd_q15_t*)output;
+  simd_q15_t ONE_OVER_SQRT3_Q15_128 = set1_int16(ONE_OVER_SQRT3_Q15);
 
   for (i=0,j=0; i<512; i++) {
     tmp[0][i] = ((uint32_t *)input)[j++];
@@ -3190,17 +5420,6 @@ void idft1536(int16_t *input, int16_t *output)
   idft512((int16_t*)(tmp[0]),(int16_t*)(tmpo[0]),1);
   idft512((int16_t*)(tmp[1]),(int16_t*)(tmpo[1]),1);
   idft512((int16_t*)(tmp[2]),(int16_t*)(tmpo[2]),1);
-  /*
-  for (i=1; i<512; i++) {
-    tmpo[0][i] = tmpo[0][i<<1];
-    tmpo[1][i] = tmpo[1][i<<1];
-    tmpo[2][i] = tmpo[2][i<<1];
-    }*/
-
-  //  write_output("in.m","in",input,6144,1,1);
-  //  write_output("out0.m","o0",tmpo[0],2048,1,1);
-  //  write_output("out1.m","o1",tmpo[1],2048,1,1);
-  //  write_output("out2.m","o2",tmpo[2],2048,1,1);
 
   for (i=0,i2=0; i<1024; i+=8,i2+=4)  {
     ibfly3((simd_q15_t*)(&tmpo[0][i2]),(simd_q15_t*)(&tmpo[1][i2]),((simd_q15_t*)&tmpo[2][i2]),
@@ -3209,16 +5428,40 @@ void idft1536(int16_t *input, int16_t *output)
   }
 
 
+  if (scale==1) {
+    for (i=0; i<24; i++) {
+      y128p[0]  = mulhi_int16(y128p[0],ONE_OVER_SQRT3_Q15_128);
+      y128p[1]  = mulhi_int16(y128p[1],ONE_OVER_SQRT3_Q15_128);
+      y128p[2]  = mulhi_int16(y128p[2],ONE_OVER_SQRT3_Q15_128);
+      y128p[3]  = mulhi_int16(y128p[3],ONE_OVER_SQRT3_Q15_128);
+      y128p[4]  = mulhi_int16(y128p[4],ONE_OVER_SQRT3_Q15_128);
+      y128p[5]  = mulhi_int16(y128p[5],ONE_OVER_SQRT3_Q15_128);
+      y128p[6]  = mulhi_int16(y128p[6],ONE_OVER_SQRT3_Q15_128);
+      y128p[7]  = mulhi_int16(y128p[7],ONE_OVER_SQRT3_Q15_128);
+      y128p[8]  = mulhi_int16(y128p[8],ONE_OVER_SQRT3_Q15_128);
+      y128p[9]  = mulhi_int16(y128p[9],ONE_OVER_SQRT3_Q15_128);
+      y128p[10] = mulhi_int16(y128p[10],ONE_OVER_SQRT3_Q15_128);
+      y128p[11] = mulhi_int16(y128p[11],ONE_OVER_SQRT3_Q15_128);
+      y128p[12] = mulhi_int16(y128p[12],ONE_OVER_SQRT3_Q15_128);
+      y128p[13] = mulhi_int16(y128p[13],ONE_OVER_SQRT3_Q15_128);
+      y128p[14] = mulhi_int16(y128p[14],ONE_OVER_SQRT3_Q15_128);
+      y128p[15] = mulhi_int16(y128p[15],ONE_OVER_SQRT3_Q15_128);
+      y128p+=16;
+    }
+  }
+
   _mm_empty();
   _m_empty();
 
 }
 
-void dft1536(int16_t *input, int16_t *output)
+void dft1536(int16_t *input, int16_t *output, int scale)
 {
   int i,i2,j;
-  uint32_t tmp[3][512] __attribute__((aligned(16)));
-  uint32_t tmpo[3][512] __attribute__((aligned(16)));
+  uint32_t tmp[3][512] __attribute__((aligned(32)));
+  uint32_t tmpo[3][512] __attribute__((aligned(32)));
+  simd_q15_t *y128p=(simd_q15_t*)output;
+  simd_q15_t ONE_OVER_SQRT3_Q15_128 = set1_int16(ONE_OVER_SQRT3_Q15);
 
   for (i=0,j=0; i<512; i++) {
     tmp[0][i] = ((uint32_t *)input)[j++];
@@ -3246,6 +5489,28 @@ void dft1536(int16_t *input, int16_t *output)
           (simd_q15_t*)(twa1536+i),(simd_q15_t*)(twb1536+i));
   }
 
+  if (scale==1) {
+    for (i=0; i<24; i++) {
+      y128p[0]  = mulhi_int16(y128p[0],ONE_OVER_SQRT3_Q15_128);
+      y128p[1]  = mulhi_int16(y128p[1],ONE_OVER_SQRT3_Q15_128);
+      y128p[2]  = mulhi_int16(y128p[2],ONE_OVER_SQRT3_Q15_128);
+      y128p[3]  = mulhi_int16(y128p[3],ONE_OVER_SQRT3_Q15_128);
+      y128p[4]  = mulhi_int16(y128p[4],ONE_OVER_SQRT3_Q15_128);
+      y128p[5]  = mulhi_int16(y128p[5],ONE_OVER_SQRT3_Q15_128);
+      y128p[6]  = mulhi_int16(y128p[6],ONE_OVER_SQRT3_Q15_128);
+      y128p[7]  = mulhi_int16(y128p[7],ONE_OVER_SQRT3_Q15_128);
+      y128p[8]  = mulhi_int16(y128p[8],ONE_OVER_SQRT3_Q15_128);
+      y128p[9]  = mulhi_int16(y128p[9],ONE_OVER_SQRT3_Q15_128);
+      y128p[10] = mulhi_int16(y128p[10],ONE_OVER_SQRT3_Q15_128);
+      y128p[11] = mulhi_int16(y128p[11],ONE_OVER_SQRT3_Q15_128);
+      y128p[12] = mulhi_int16(y128p[12],ONE_OVER_SQRT3_Q15_128);
+      y128p[13] = mulhi_int16(y128p[13],ONE_OVER_SQRT3_Q15_128);
+      y128p[14] = mulhi_int16(y128p[14],ONE_OVER_SQRT3_Q15_128);
+      y128p[15] = mulhi_int16(y128p[15],ONE_OVER_SQRT3_Q15_128);
+      y128p+=16;
+    }
+  }
+
   _mm_empty();
   _m_empty();
 
@@ -3267,8 +5532,8 @@ void idft3072(int16_t *input, int16_t *output)
 void idft6144(int16_t *input, int16_t *output)
 {
   int i,i2,j;
-  uint32_t tmp[3][2048] __attribute__((aligned(16)));
-  uint32_t tmpo[3][2048] __attribute__((aligned(16)));
+  uint32_t tmp[3][2048] __attribute__((aligned(32)));
+  uint32_t tmpo[3][2048] __attribute__((aligned(32)));
 
   for (i=0,j=0; i<2048; i++) {
     tmp[0][i] = ((uint32_t *)input)[j++];
@@ -3308,8 +5573,8 @@ void idft6144(int16_t *input, int16_t *output)
 void dft6144(int16_t *input, int16_t *output)
 {
   int i,i2,j;
-  uint32_t tmp[3][2048] __attribute__((aligned(16)));
-  uint32_t tmpo[3][2048] __attribute__((aligned(16)));
+  uint32_t tmp[3][2048] __attribute__((aligned(32)));
+  uint32_t tmpo[3][2048] __attribute__((aligned(32)));
 
   for (i=0,j=0; i<2048; i++) {
     tmp[0][i] = ((uint32_t *)input)[j++];
@@ -3348,8 +5613,8 @@ void dft6144(int16_t *input, int16_t *output)
 void dft12288(int16_t *input, int16_t *output)
 {
   int i,i2,j;
-  uint32_t tmp[3][4096] __attribute__((aligned(16)));
-  uint32_t tmpo[3][4096] __attribute__((aligned(16)));
+  uint32_t tmp[3][4096] __attribute__((aligned(32)));
+  uint32_t tmpo[3][4096] __attribute__((aligned(32)));
 
   for (i=0,j=0; i<4096; i++) {
     tmp[0][i] = ((uint32_t *)input)[j++];
@@ -3384,8 +5649,8 @@ void dft12288(int16_t *input, int16_t *output)
 void idft12288(int16_t *input, int16_t *output)
 {
   int i,i2,j;
-  uint32_t tmp[3][4096] __attribute__((aligned(16)));
-  uint32_t tmpo[3][4096] __attribute__((aligned(16)));
+  uint32_t tmp[3][4096] __attribute__((aligned(32)));
+  uint32_t tmpo[3][4096] __attribute__((aligned(32)));
 
   for (i=0,j=0; i<4096; i++) {
     tmp[0][i] = ((uint32_t *)input)[j++];
@@ -3431,8 +5696,8 @@ void idft18432(int16_t *input, int16_t *output)
 void dft24576(int16_t *input, int16_t *output)
 {
   int i,i2,j;
-  uint32_t tmp[3][8192] __attribute__((aligned(16)));
-  uint32_t tmpo[3][8192] __attribute__((aligned(16)));
+  uint32_t tmp[3][8192] __attribute__((aligned(32)));
+  uint32_t tmpo[3][8192] __attribute__((aligned(32)));
 
   for (i=0,j=0; i<8192; i++) {
     tmp[0][i] = ((uint32_t *)input)[j++];
@@ -3468,8 +5733,8 @@ void dft24576(int16_t *input, int16_t *output)
 void idft24576(int16_t *input, int16_t *output)
 {
   int i,i2,j;
-  uint32_t tmp[3][16384] __attribute__((aligned(16)));
-  uint32_t tmpo[3][16384] __attribute__((aligned(16)));
+  uint32_t tmp[3][16384] __attribute__((aligned(32)));
+  uint32_t tmpo[3][16384] __attribute__((aligned(32)));
 
   for (i=0,j=0; i<8192; i++) {
     tmp[0][i] = ((uint32_t *)input)[j++];
@@ -3510,11 +5775,11 @@ void idft24576(int16_t *input, int16_t *output)
 ///  THIS SECTION IS FOR ALL PUSCH DFTS (i.e. radix 2^a * 3^b * 4^c * 5^d)
 ///  They use twiddles for 4-way parallel DFTS (i.e. 4 DFTS with interleaved input/output)
 
-static int16_t W1_12s[8]__attribute__((aligned(16))) = {28377,-16383,28377,-16383,28377,-16383,28377,-16383};
-static int16_t W2_12s[8]__attribute__((aligned(16))) = {16383,-28377,16383,-28377,16383,-28377,16383,-28377};
-static int16_t W3_12s[8]__attribute__((aligned(16))) = {0,-32767,0,-32767,0,-32767,0,-32767};
-static int16_t W4_12s[8]__attribute__((aligned(16))) = {-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377};
-static int16_t W6_12s[8]__attribute__((aligned(16))) = {-32767,0,-32767,0,-32767,0,-32767,0};
+static int16_t W1_12s[8]__attribute__((aligned(32))) = {28377,-16383,28377,-16383,28377,-16383,28377,-16383};
+static int16_t W2_12s[8]__attribute__((aligned(32))) = {16383,-28377,16383,-28377,16383,-28377,16383,-28377};
+static int16_t W3_12s[8]__attribute__((aligned(32))) = {0,-32767,0,-32767,0,-32767,0,-32767};
+static int16_t W4_12s[8]__attribute__((aligned(32))) = {-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377};
+static int16_t W6_12s[8]__attribute__((aligned(32))) = {-32767,0,-32767,0,-32767,0,-32767,0};
 
 simd_q15_t *W1_12=(simd_q15_t *)W1_12s;
 simd_q15_t *W2_12=(simd_q15_t *)W2_12s;
@@ -3693,7 +5958,193 @@ void dft12(int16_t *x,int16_t *y)
 
 }
 
-static int16_t tw24[88]__attribute__((aligned(16))) = {31650,-8480,31650,-8480,31650,-8480,31650,-8480,
+#ifdef __AVX2__
+
+static int16_t W1_12s_256[16]__attribute__((aligned(32))) = {28377,-16383,28377,-16383,28377,-16383,28377,-16383,28377,-16383,28377,-16383,28377,-16383,28377,-16383};
+static int16_t W2_12s_256[16]__attribute__((aligned(32))) = {16383,-28377,16383,-28377,16383,-28377,16383,-28377,16383,-28377,16383,-28377,16383,-28377,16383,-28377};
+static int16_t W3_12s_256[16]__attribute__((aligned(32))) = {0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767};
+static int16_t W4_12s_256[16]__attribute__((aligned(32))) = {-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377};
+static int16_t W6_12s_256[16]__attribute__((aligned(32))) = {-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0,-32767,0};
+
+simd256_q15_t *W1_12_256=(simd256_q15_t *)W1_12s_256;
+simd256_q15_t *W2_12_256=(simd256_q15_t *)W2_12s_256;
+simd256_q15_t *W3_12_256=(simd256_q15_t *)W3_12s_256;
+simd256_q15_t *W4_12_256=(simd256_q15_t *)W4_12s_256;
+simd256_q15_t *W6_12_256=(simd256_q15_t *)W6_12s_256;
+
+
+
+static inline void dft12f_simd256(simd256_q15_t *x0,
+				  simd256_q15_t *x1,
+				  simd256_q15_t *x2,
+				  simd256_q15_t *x3,
+				  simd256_q15_t *x4,
+				  simd256_q15_t *x5,
+				  simd256_q15_t *x6,
+				  simd256_q15_t *x7,
+				  simd256_q15_t *x8,
+				  simd256_q15_t *x9,
+				  simd256_q15_t *x10,
+				  simd256_q15_t *x11,
+				  simd256_q15_t *y0,
+				  simd256_q15_t *y1,
+				  simd256_q15_t *y2,
+				  simd256_q15_t *y3,
+				  simd256_q15_t *y4,
+				  simd256_q15_t *y5,
+				  simd256_q15_t *y6,
+				  simd256_q15_t *y7,
+				  simd256_q15_t *y8,
+				  simd256_q15_t *y9,
+				  simd256_q15_t *y10,
+				  simd256_q15_t *y11) __attribute__((always_inline));
+
+static inline void dft12f_simd256(simd256_q15_t *x0,
+				  simd256_q15_t *x1,
+				  simd256_q15_t *x2,
+				  simd256_q15_t *x3,
+				  simd256_q15_t *x4,
+				  simd256_q15_t *x5,
+				  simd256_q15_t *x6,
+				  simd256_q15_t *x7,
+				  simd256_q15_t *x8,
+				  simd256_q15_t *x9,
+				  simd256_q15_t *x10,
+				  simd256_q15_t *x11,
+				  simd256_q15_t *y0,
+				  simd256_q15_t *y1,
+				  simd256_q15_t *y2,
+				  simd256_q15_t *y3,
+				  simd256_q15_t *y4,
+				  simd256_q15_t *y5,
+				  simd256_q15_t *y6,
+				  simd256_q15_t *y7,
+				  simd256_q15_t *y8,
+				  simd256_q15_t *y9,
+				  simd256_q15_t *y10,
+				  simd256_q15_t *y11)
+{
+
+
+  simd256_q15_t tmp_dft12[12];
+
+  simd256_q15_t *tmp_dft12_ptr = &tmp_dft12[0];
+
+  // msg("dft12\n");
+
+  bfly4_tw1_256(x0,
+		x3,
+		x6,
+		x9,
+		tmp_dft12_ptr,
+		tmp_dft12_ptr+3,
+		tmp_dft12_ptr+6,
+		tmp_dft12_ptr+9);
+
+
+  bfly4_tw1_256(x1,
+		x4,
+		x7,
+		x10,
+		tmp_dft12_ptr+1,
+		tmp_dft12_ptr+4,
+		tmp_dft12_ptr+7,
+		tmp_dft12_ptr+10);
+  
+
+  bfly4_tw1_256(x2,
+		x5,
+		x8,
+		x11,
+		tmp_dft12_ptr+2,
+		tmp_dft12_ptr+5,
+		tmp_dft12_ptr+8,
+		tmp_dft12_ptr+11);
+  
+  //  k2=0;
+  bfly3_tw1_256(tmp_dft12_ptr,
+		tmp_dft12_ptr+1,
+		tmp_dft12_ptr+2,
+		y0,
+		y4,
+		y8);
+  
+  
+  
+  //  k2=1;
+  bfly3_256(tmp_dft12_ptr+3,
+	    tmp_dft12_ptr+4,
+	    tmp_dft12_ptr+5,
+	    y1,
+	    y5,
+	    y9,
+	    W1_12_256,
+	    W2_12_256);
+  
+  
+  
+  //  k2=2;
+  bfly3_256(tmp_dft12_ptr+6,
+	    tmp_dft12_ptr+7,
+	    tmp_dft12_ptr+8,
+	    y2,
+	    y6,
+	    y10,
+	    W2_12_256,
+	    W4_12_256);
+  
+  //  k2=3;
+  bfly3_256(tmp_dft12_ptr+9,
+	    tmp_dft12_ptr+10,
+	    tmp_dft12_ptr+11,
+	    y3,
+	    y7,
+	    y11,
+	    W3_12_256,
+	    W6_12_256);
+  
+}
+
+
+
+
+void dft12_simd256(int16_t *x,int16_t *y)
+{
+
+  simd256_q15_t *x256 = (simd256_q15_t *)x,*y256 = (simd256_q15_t *)y;
+  dft12f_simd256(&x256[0],
+		 &x256[1],
+		 &x256[2],
+		 &x256[3],
+		 &x256[4],
+		 &x256[5],
+		 &x256[6],
+		 &x256[7],
+		 &x256[8],
+		 &x256[9],
+		 &x256[10],
+		 &x256[11],
+		 &y256[0],
+		 &y256[1],
+		 &y256[2],
+		 &y256[3],
+		 &y256[4],
+		 &y256[5],
+		 &y256[6],
+		 &y256[7],
+		 &y256[8],
+		 &y256[9],
+		 &y256[10],
+		 &y256[11]);
+  
+  _mm_empty();
+  _m_empty();
+
+}
+
+#endif
+
+static int16_t tw24[88]__attribute__((aligned(32))) = {31650,-8480,31650,-8480,31650,-8480,31650,-8480,
                                                        28377,-16383,28377,-16383,28377,-16383,28377,-16383,
                                                        23169,-23169,23169,-23169,23169,-23169,23169,-23169,
                                                        16383,-28377,16383,-28377,16383,-28377,16383,-28377,
@@ -3804,7 +6255,7 @@ void dft24(int16_t *x,int16_t *y,unsigned char scale_flag)
 
 }
 
-static int16_t twa36[88]__attribute__((aligned(16))) = {32269,-5689,32269,-5689,32269,-5689,32269,-5689,
+static int16_t twa36[88]__attribute__((aligned(32))) = {32269,-5689,32269,-5689,32269,-5689,32269,-5689,
                                                         30790,-11206,30790,-11206,30790,-11206,30790,-11206,
                                                         28377,-16383,28377,-16383,28377,-16383,28377,-16383,
                                                         25100,-21062,25100,-21062,25100,-21062,25100,-21062,
@@ -3817,7 +6268,7 @@ static int16_t twa36[88]__attribute__((aligned(16))) = {32269,-5689,32269,-5689,
                                                         -11206,-30790,-11206,-30790,-11206,-30790,-11206,-30790
                                                        };
 
-static int16_t twb36[88]__attribute__((aligned(16))) = {30790,-11206,30790,-11206,30790,-11206,30790,-11206,
+static int16_t twb36[88]__attribute__((aligned(32))) = {30790,-11206,30790,-11206,30790,-11206,30790,-11206,
                                                         25100,-21062,25100,-21062,25100,-21062,25100,-21062,
                                                         16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                         5689,-32269,5689,-32269,5689,-32269,5689,-32269,
@@ -3950,7 +6401,7 @@ void dft36(int16_t *x,int16_t *y,unsigned char scale_flag)
 
 }
 
-static int16_t twa48[88]__attribute__((aligned(16))) = {32486,-4276,32486,-4276,32486,-4276,32486,-4276,
+static int16_t twa48[88]__attribute__((aligned(32))) = {32486,-4276,32486,-4276,32486,-4276,32486,-4276,
                                                         31650,-8480,31650,-8480,31650,-8480,31650,-8480,
                                                         30272,-12539,30272,-12539,30272,-12539,30272,-12539,
                                                         28377,-16383,28377,-16383,28377,-16383,28377,-16383,
@@ -3963,7 +6414,7 @@ static int16_t twa48[88]__attribute__((aligned(16))) = {32486,-4276,32486,-4276,
                                                         4276,-32486,4276,-32486,4276,-32486,4276,-32486
                                                        };
 
-static int16_t twb48[88]__attribute__((aligned(16))) = {31650,-8480,31650,-8480,31650,-8480,31650,-8480,
+static int16_t twb48[88]__attribute__((aligned(32))) = {31650,-8480,31650,-8480,31650,-8480,31650,-8480,
                                                         28377,-16383,28377,-16383,28377,-16383,28377,-16383,
                                                         23169,-23169,23169,-23169,23169,-23169,23169,-23169,
                                                         16383,-28377,16383,-28377,16383,-28377,16383,-28377,
@@ -3976,7 +6427,7 @@ static int16_t twb48[88]__attribute__((aligned(16))) = {31650,-8480,31650,-8480,
                                                         -31650,-8480,-31650,-8480,-31650,-8480,-31650,-8480
                                                        };
 
-static int16_t twc48[88]__attribute__((aligned(16))) = {30272,-12539,30272,-12539,30272,-12539,30272,-12539,
+static int16_t twc48[88]__attribute__((aligned(32))) = {30272,-12539,30272,-12539,30272,-12539,30272,-12539,
                                                         23169,-23169,23169,-23169,23169,-23169,23169,-23169,
                                                         12539,-30272,12539,-30272,12539,-30272,12539,-30272,
                                                         0,-32767,0,-32767,0,-32767,0,-32767,
@@ -4146,7 +6597,7 @@ void dft48(int16_t *x, int16_t *y,unsigned char scale_flag)
 
 }
 
-static int16_t twa60[88]__attribute__((aligned(16))) = {32587,-3425,32587,-3425,32587,-3425,32587,-3425,
+static int16_t twa60[88]__attribute__((aligned(32))) = {32587,-3425,32587,-3425,32587,-3425,32587,-3425,
                                                         32050,-6812,32050,-6812,32050,-6812,32050,-6812,
                                                         31163,-10125,31163,-10125,31163,-10125,31163,-10125,
                                                         29934,-13327,29934,-13327,29934,-13327,29934,-13327,
@@ -4158,7 +6609,7 @@ static int16_t twa60[88]__attribute__((aligned(16))) = {32587,-3425,32587,-3425,
                                                         16383,-28377,16383,-28377,16383,-28377,16383,-28377,
                                                         13327,-29934,13327,-29934,13327,-29934,13327,-29934
                                                        };
-static int16_t twb60[88]__attribute__((aligned(16))) = {32050,-6812,32050,-6812,32050,-6812,32050,-6812,
+static int16_t twb60[88]__attribute__((aligned(32))) = {32050,-6812,32050,-6812,32050,-6812,32050,-6812,
                                                         29934,-13327,29934,-13327,29934,-13327,29934,-13327,
                                                         26509,-19259,26509,-19259,26509,-19259,26509,-19259,
                                                         21925,-24350,21925,-24350,21925,-24350,21925,-24350,
@@ -4170,7 +6621,7 @@ static int16_t twb60[88]__attribute__((aligned(16))) = {32050,-6812,32050,-6812,
                                                         -16383,-28377,-16383,-28377,-16383,-28377,-16383,-28377,
                                                         -21925,-24350,-21925,-24350,-21925,-24350,-21925,-24350
                                                        };
-static int16_t twc60[88]__attribute__((aligned(16))) = {31163,-10125,31163,-10125,31163,-10125,31163,-10125,
+static int16_t twc60[88]__attribute__((aligned(32))) = {31163,-10125,31163,-10125,31163,-10125,31163,-10125,
                                                         26509,-19259,26509,-19259,26509,-19259,26509,-19259,
                                                         19259,-26509,19259,-26509,19259,-26509,19259,-26509,
                                                         10125,-31163,10125,-31163,10125,-31163,10125,-31163,
@@ -4182,7 +6633,7 @@ static int16_t twc60[88]__attribute__((aligned(16))) = {31163,-10125,31163,-1012
                                                         -32767,0,-32767,0,-32767,0,-32767,0,
                                                         -31163,10125,-31163,10125,-31163,10125,-31163,10125
                                                        };
-static int16_t twd60[88]__attribute__((aligned(16))) = {29934,-13327,29934,-13327,29934,-13327,29934,-13327,
+static int16_t twd60[88]__attribute__((aligned(32))) = {29934,-13327,29934,-13327,29934,-13327,29934,-13327,
                                                         21925,-24350,21925,-24350,21925,-24350,21925,-24350,
                                                         10125,-31163,10125,-31163,10125,-31163,10125,-31163,
                                                         -3425,-32587,-3425,-32587,-3425,-32587,-3425,-32587,
@@ -4374,7 +6825,7 @@ void dft60(int16_t *x,int16_t *y,unsigned char scale)
 
 }
 
-static int16_t tw72[280]__attribute__((aligned(16))) = {32642,-2855,32642,-2855,32642,-2855,32642,-2855,
+static int16_t tw72[280]__attribute__((aligned(32))) = {32642,-2855,32642,-2855,32642,-2855,32642,-2855,
                                                         32269,-5689,32269,-5689,32269,-5689,32269,-5689,
                                                         31650,-8480,31650,-8480,31650,-8480,31650,-8480,
                                                         30790,-11206,30790,-11206,30790,-11206,30790,-11206,
@@ -4453,7 +6904,7 @@ void dft72(int16_t *x,int16_t *y,unsigned char scale_flag)
 
 }
 
-static int16_t tw96[376]__attribute__((aligned(16))) = {32696,-2143,32696,-2143,32696,-2143,32696,-2143,
+static int16_t tw96[376]__attribute__((aligned(32))) = {32696,-2143,32696,-2143,32696,-2143,32696,-2143,
                                                         32486,-4276,32486,-4276,32486,-4276,32486,-4276,
                                                         32137,-6392,32137,-6392,32137,-6392,32137,-6392,
                                                         31650,-8480,31650,-8480,31650,-8480,31650,-8480,
@@ -4546,7 +6997,7 @@ void dft96(int16_t *x,int16_t *y,unsigned char scale_flag)
 
 }
 
-static int16_t twa108[280]__attribute__((aligned(16))) = {32711,-1905,32711,-1905,32711,-1905,32711,-1905,
+static int16_t twa108[280]__attribute__((aligned(32))) = {32711,-1905,32711,-1905,32711,-1905,32711,-1905,
                                                           32545,-3804,32545,-3804,32545,-3804,32545,-3804,
                                                           32269,-5689,32269,-5689,32269,-5689,32269,-5689,
                                                           31883,-7556,31883,-7556,31883,-7556,31883,-7556,
@@ -4583,7 +7034,7 @@ static int16_t twa108[280]__attribute__((aligned(16))) = {32711,-1905,32711,-190
                                                           -14705,-29281,-14705,-29281,-14705,-29281,-14705,-29281
                                                          };
 
-static int16_t twb108[280]__attribute__((aligned(16))) = {32545,-3804,32545,-3804,32545,-3804,32545,-3804,
+static int16_t twb108[280]__attribute__((aligned(32))) = {32545,-3804,32545,-3804,32545,-3804,32545,-3804,
                                                           31883,-7556,31883,-7556,31883,-7556,31883,-7556,
                                                           30790,-11206,30790,-11206,30790,-11206,30790,-11206,
                                                           29281,-14705,29281,-14705,29281,-14705,29281,-14705,
@@ -4670,7 +7121,7 @@ void dft108(int16_t *x,int16_t *y,unsigned char scale_flag)
 
 }
 
-static int16_t tw120[472]__attribute__((aligned(16))) = {32722,-1714,32722,-1714,32722,-1714,32722,-1714,
+static int16_t tw120[472]__attribute__((aligned(32))) = {32722,-1714,32722,-1714,32722,-1714,32722,-1714,
                                                          32587,-3425,32587,-3425,32587,-3425,32587,-3425,
                                                          32363,-5125,32363,-5125,32363,-5125,32363,-5125,
                                                          32050,-6812,32050,-6812,32050,-6812,32050,-6812,
@@ -4775,7 +7226,7 @@ void dft120(int16_t *x,int16_t *y, unsigned char scale_flag)
 
 }
 
-static int16_t twa144[376]__attribute__((aligned(16))) = {32735,-1429,32735,-1429,32735,-1429,32735,-1429,
+static int16_t twa144[376]__attribute__((aligned(32))) = {32735,-1429,32735,-1429,32735,-1429,32735,-1429,
                                                           32642,-2855,32642,-2855,32642,-2855,32642,-2855,
                                                           32486,-4276,32486,-4276,32486,-4276,32486,-4276,
                                                           32269,-5689,32269,-5689,32269,-5689,32269,-5689,
@@ -4824,7 +7275,7 @@ static int16_t twa144[376]__attribute__((aligned(16))) = {32735,-1429,32735,-142
                                                           -15130,-29064,-15130,-29064,-15130,-29064,-15130,-29064
                                                          };
 
-static int16_t twb144[376]__attribute__((aligned(16))) = {32642,-2855,32642,-2855,32642,-2855,32642,-2855,
+static int16_t twb144[376]__attribute__((aligned(32))) = {32642,-2855,32642,-2855,32642,-2855,32642,-2855,
                                                           32269,-5689,32269,-5689,32269,-5689,32269,-5689,
                                                           31650,-8480,31650,-8480,31650,-8480,31650,-8480,
                                                           30790,-11206,30790,-11206,30790,-11206,30790,-11206,
@@ -4922,7 +7373,7 @@ void dft144(int16_t *x,int16_t *y,unsigned char scale_flag)
 
 }
 
-static int16_t twa180[472]__attribute__((aligned(16))) = {32747,-1143,32747,-1143,32747,-1143,32747,-1143,
+static int16_t twa180[472]__attribute__((aligned(32))) = {32747,-1143,32747,-1143,32747,-1143,32747,-1143,
                                                           32687,-2285,32687,-2285,32687,-2285,32687,-2285,
                                                           32587,-3425,32587,-3425,32587,-3425,32587,-3425,
                                                           32448,-4560,32448,-4560,32448,-4560,32448,-4560,
@@ -4983,7 +7434,7 @@ static int16_t twa180[472]__attribute__((aligned(16))) = {32747,-1143,32747,-114
                                                           -15383,-28931,-15383,-28931,-15383,-28931,-15383,-28931
                                                          };
 
-static int16_t twb180[472]__attribute__((aligned(16))) = {32687,-2285,32687,-2285,32687,-2285,32687,-2285,
+static int16_t twb180[472]__attribute__((aligned(32))) = {32687,-2285,32687,-2285,32687,-2285,32687,-2285,
                                                           32448,-4560,32448,-4560,32448,-4560,32448,-4560,
                                                           32050,-6812,32050,-6812,32050,-6812,32050,-6812,
                                                           31497,-9031,31497,-9031,31497,-9031,31497,-9031,
@@ -5093,7 +7544,7 @@ void dft180(int16_t *x,int16_t *y,unsigned char scale_flag)
 
 }
 
-static int16_t twa192[376]__attribute__((aligned(16))) = {32749,-1072,32749,-1072,32749,-1072,32749,-1072,
+static int16_t twa192[376]__attribute__((aligned(32))) = {32749,-1072,32749,-1072,32749,-1072,32749,-1072,
                                                           32696,-2143,32696,-2143,32696,-2143,32696,-2143,
                                                           32609,-3211,32609,-3211,32609,-3211,32609,-3211,
                                                           32486,-4276,32486,-4276,32486,-4276,32486,-4276,
@@ -5142,7 +7593,7 @@ static int16_t twa192[376]__attribute__((aligned(16))) = {32749,-1072,32749,-107
                                                           1072,-32749,1072,-32749,1072,-32749,1072,-32749
                                                          };
 
-static int16_t twb192[376]__attribute__((aligned(16))) = {32696,-2143,32696,-2143,32696,-2143,32696,-2143,
+static int16_t twb192[376]__attribute__((aligned(32))) = {32696,-2143,32696,-2143,32696,-2143,32696,-2143,
                                                           32486,-4276,32486,-4276,32486,-4276,32486,-4276,
                                                           32137,-6392,32137,-6392,32137,-6392,32137,-6392,
                                                           31650,-8480,31650,-8480,31650,-8480,31650,-8480,
@@ -5191,7 +7642,7 @@ static int16_t twb192[376]__attribute__((aligned(16))) = {32696,-2143,32696,-214
                                                           -32696,-2143,-32696,-2143,-32696,-2143,-32696,-2143
                                                          };
 
-static int16_t twc192[376]__attribute__((aligned(16))) = {32609,-3211,32609,-3211,32609,-3211,32609,-3211,
+static int16_t twc192[376]__attribute__((aligned(32))) = {32609,-3211,32609,-3211,32609,-3211,32609,-3211,
                                                           32137,-6392,32137,-6392,32137,-6392,32137,-6392,
                                                           31356,-9511,31356,-9511,31356,-9511,31356,-9511,
                                                           30272,-12539,30272,-12539,30272,-12539,30272,-12539,
@@ -5295,7 +7746,7 @@ void dft192(int16_t *x,int16_t *y,unsigned char scale_flag)
 
 }
 
-static int16_t twa216[568]__attribute__((aligned(16))) = {32753,-953,32753,-953,32753,-953,32753,-953,
+static int16_t twa216[568]__attribute__((aligned(32))) = {32753,-953,32753,-953,32753,-953,32753,-953,
                                                           32711,-1905,32711,-1905,32711,-1905,32711,-1905,
                                                           32642,-2855,32642,-2855,32642,-2855,32642,-2855,
                                                           32545,-3804,32545,-3804,32545,-3804,32545,-3804,
@@ -5368,7 +7819,7 @@ static int16_t twa216[568]__attribute__((aligned(16))) = {32753,-953,32753,-953,
                                                           -15551,-28841,-15551,-28841,-15551,-28841,-15551,-28841
                                                          };
 
-static int16_t twb216[568]__attribute__((aligned(16))) = {32711,-1905,32711,-1905,32711,-1905,32711,-1905,
+static int16_t twb216[568]__attribute__((aligned(32))) = {32711,-1905,32711,-1905,32711,-1905,32711,-1905,
                                                           32545,-3804,32545,-3804,32545,-3804,32545,-3804,
                                                           32269,-5689,32269,-5689,32269,-5689,32269,-5689,
                                                           31883,-7556,31883,-7556,31883,-7556,31883,-7556,
@@ -5490,7 +7941,7 @@ void dft216(int16_t *x,int16_t *y,unsigned char scale_flag)
 
 }
 
-static int16_t twa240[472]__attribute__((aligned(16))) = {32755,-857,32755,-857,32755,-857,32755,-857,
+static int16_t twa240[472]__attribute__((aligned(32))) = {32755,-857,32755,-857,32755,-857,32755,-857,
                                                           32722,-1714,32722,-1714,32722,-1714,32722,-1714,
                                                           32665,-2570,32665,-2570,32665,-2570,32665,-2570,
                                                           32587,-3425,32587,-3425,32587,-3425,32587,-3425,
@@ -5551,7 +8002,7 @@ static int16_t twa240[472]__attribute__((aligned(16))) = {32755,-857,32755,-857,
                                                           857,-32755,857,-32755,857,-32755,857,-32755
                                                          };
 
-static int16_t twb240[472]__attribute__((aligned(16))) = {32722,-1714,32722,-1714,32722,-1714,32722,-1714,
+static int16_t twb240[472]__attribute__((aligned(32))) = {32722,-1714,32722,-1714,32722,-1714,32722,-1714,
                                                           32587,-3425,32587,-3425,32587,-3425,32587,-3425,
                                                           32363,-5125,32363,-5125,32363,-5125,32363,-5125,
                                                           32050,-6812,32050,-6812,32050,-6812,32050,-6812,
@@ -5612,7 +8063,7 @@ static int16_t twb240[472]__attribute__((aligned(16))) = {32722,-1714,32722,-171
                                                           -32722,-1714,-32722,-1714,-32722,-1714,-32722,-1714
                                                          };
 
-static int16_t twc240[472]__attribute__((aligned(16))) = {32665,-2570,32665,-2570,32665,-2570,32665,-2570,
+static int16_t twc240[472]__attribute__((aligned(32))) = {32665,-2570,32665,-2570,32665,-2570,32665,-2570,
                                                           32363,-5125,32363,-5125,32363,-5125,32363,-5125,
                                                           31861,-7649,31861,-7649,31861,-7649,31861,-7649,
                                                           31163,-10125,31163,-10125,31163,-10125,31163,-10125,
@@ -5740,7 +8191,7 @@ twb2(2:2:end) = imag(twb);
 
 
  */
-static int16_t twa288[760]__attribute__((aligned(16))) = {32759,-714,32759,-714,32759,-714,32759,-714,
+static int16_t twa288[760]__attribute__((aligned(32))) = {32759,-714,32759,-714,32759,-714,32759,-714,
                                                           32735,-1429,32735,-1429,32735,-1429,32735,-1429,
                                                           32696,-2143,32696,-2143,32696,-2143,32696,-2143,
                                                           32642,-2855,32642,-2855,32642,-2855,32642,-2855,
@@ -5837,7 +8288,7 @@ static int16_t twa288[760]__attribute__((aligned(16))) = {32759,-714,32759,-714,
                                                           -15760,-28727,-15760,-28727,-15760,-28727,-15760,-28727
                                                          };
 
-static int16_t twb288[760]__attribute__((aligned(16))) = {32735,-1429,32735,-1429,32735,-1429,32735,-1429,
+static int16_t twb288[760]__attribute__((aligned(32))) = {32735,-1429,32735,-1429,32735,-1429,32735,-1429,
                                                           32642,-2855,32642,-2855,32642,-2855,32642,-2855,
                                                           32486,-4276,32486,-4276,32486,-4276,32486,-4276,
                                                           32269,-5689,32269,-5689,32269,-5689,32269,-5689,
@@ -5983,7 +8434,7 @@ void dft288(int16_t *x,int16_t *y,unsigned char scale_flag)
 
 }
 
-static int16_t twa300[472]__attribute__((aligned(16))) = {32759,-686,32759,-686,32759,-686,32759,-686,
+static int16_t twa300[472]__attribute__((aligned(32))) = {32759,-686,32759,-686,32759,-686,32759,-686,
                                                           32738,-1372,32738,-1372,32738,-1372,32738,-1372,
                                                           32702,-2057,32702,-2057,32702,-2057,32702,-2057,
                                                           32652,-2741,32652,-2741,32652,-2741,32652,-2741,
@@ -6044,7 +8495,7 @@ static int16_t twa300[472]__attribute__((aligned(16))) = {32759,-686,32759,-686,
                                                           10775,-30944,10775,-30944,10775,-30944,10775,-30944
                                                          };
 
-static int16_t twb300[472]__attribute__((aligned(16))) = {32738,-1372,32738,-1372,32738,-1372,32738,-1372,
+static int16_t twb300[472]__attribute__((aligned(32))) = {32738,-1372,32738,-1372,32738,-1372,32738,-1372,
                                                           32652,-2741,32652,-2741,32652,-2741,32652,-2741,
                                                           32508,-4106,32508,-4106,32508,-4106,32508,-4106,
                                                           32308,-5464,32308,-5464,32308,-5464,32308,-5464,
@@ -6105,7 +8556,7 @@ static int16_t twb300[472]__attribute__((aligned(16))) = {32738,-1372,32738,-137
                                                           -25679,-20353,-25679,-20353,-25679,-20353,-25679,-20353
                                                          };
 
-static int16_t twc300[472]__attribute__((aligned(16))) = {32702,-2057,32702,-2057,32702,-2057,32702,-2057,
+static int16_t twc300[472]__attribute__((aligned(32))) = {32702,-2057,32702,-2057,32702,-2057,32702,-2057,
                                                           32508,-4106,32508,-4106,32508,-4106,32508,-4106,
                                                           32186,-6139,32186,-6139,32186,-6139,32186,-6139,
                                                           31737,-8148,31737,-8148,31737,-8148,31737,-8148,
@@ -6166,7 +8617,7 @@ static int16_t twc300[472]__attribute__((aligned(16))) = {32702,-2057,32702,-205
                                                           -27666,17557,-27666,17557,-27666,17557,-27666,17557
                                                          };
 
-static int16_t twd300[472]__attribute__((aligned(16))) = {32652,-2741,32652,-2741,32652,-2741,32652,-2741,
+static int16_t twd300[472]__attribute__((aligned(32))) = {32652,-2741,32652,-2741,32652,-2741,32652,-2741,
                                                           32308,-5464,32308,-5464,32308,-5464,32308,-5464,
                                                           31737,-8148,31737,-8148,31737,-8148,31737,-8148,
                                                           30944,-10775,30944,-10775,30944,-10775,30944,-10775,
@@ -16075,7 +18526,6 @@ void dft1200(int16_t *x,int16_t *y,unsigned char scale_flag)
 
   if (scale_flag==1) {
     norm128 = set1_int16(16384);//dft_norm_table[13]);
-
     for (i=0; i<1200; i++) {
       y128[i] = mulhi_int16(y128[i],norm128);
     }
@@ -16097,9 +18547,11 @@ int main(int argc, char**argv)
 
 
   time_stats_t ts;
-  simd_q15_t x[2048],y[2048],tw0,tw1,tw2,tw3;
-
-
+#ifdef __AVX2__
+  simd256_q15_t x[2048],y[2048],tw0,tw1,tw2,tw3;
+#else
+  simd_q15_t x[4096],y[4096],tw0,tw1,tw2,tw3;
+#endif
   int i;
 
   set_taus_seed(0);
@@ -16426,10 +18878,10 @@ int main(int argc, char**argv)
     for (i=0;i<4;i++)
       printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&y[i])[0],((int16_t *)&y[i])[1],((int16_t*)&y[i])[2],((int16_t *)&y[i])[3],((int16_t*)&y[i])[4],((int16_t *)&y[i])[5],((int16_t*)&y[i])[6],((int16_t *)&y[i])[7]);
     printf("\n");
-  */
-  memset((void*)&x[0],0,64*4);
-/*
-  for (i=0; i<64; i+=4) {
+ */
+  memset((void*)&x[0],0,2048*4);
+      
+  for (i=0; i<2048; i+=4) {
      ((int16_t*)x)[i<<1] = 1024;
      ((int16_t*)x)[1+(i<<1)] = 0;
      ((int16_t*)x)[2+(i<<1)] = 0;
@@ -16438,40 +18890,65 @@ int main(int argc, char**argv)
      ((int16_t*)x)[5+(i<<1)] = 0;
      ((int16_t*)x)[6+(i<<1)] = 0;
      ((int16_t*)x)[7+(i<<1)] = -1024;
+     }
+  /*
+  for (i=0; i<2048; i+=2) {
+     ((int16_t*)x)[i<<1] = 1024;
+     ((int16_t*)x)[1+(i<<1)] = 0;
+     ((int16_t*)x)[2+(i<<1)] = -1024;
+     ((int16_t*)x)[3+(i<<1)] = 0;
+     }
+       
+  for (i=0;i<2048*2;i++) {
+    ((int16_t*)x)[i] = i/2;//(int16_t)((taus()&0xffff))>>5;
   }
-*/
-  for (i=0;i<64;i++) {
-      ((int16_t*)x)[i] = (int16_t)((taus()&0xffff))>>5;
+     */
+  memset((void*)&x[0],0,64*sizeof(int32_t));
+  for (i=2;i<36;i++) {
+    if ((taus() & 1)==0)
+      ((int16_t*)x)[i] = 364;
+    else
+      ((int16_t*)x)[i] = -364;
   }
-  memset((void*)&y[0],0,64*4);
-/*
-  dft16((int16_t *)x,(int16_t *)y);
-  printf("16-point\n");
+  for (i=(128-36);i<128;i++) {
+    if ((taus() & 1)==0)
+      ((int16_t*)x)[i] = 364;
+    else
+      ((int16_t*)x)[i] = -364;
+  }
+  idft64((int16_t *)x,(int16_t *)y,1);
+  
+
+  printf("64-point\n");
   printf("X: ");
-  for (i=0;i<4;i++)
-    printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&x[i])[0],((int16_t *)&x[i])[1],((int16_t*)&x[i])[2],((int16_t *)&x[i])[3],((int16_t*)&x[i])[4],((int16_t*)&x[i])[5],((int16_t*)&x[i])[6],((int16_t*)&x[i])[7]);
+  for (i=0;i<8;i++)
+    print_shorts256("",((int16_t *)x)+(i*16));
+
   printf("\nY:");
 
-  for (i=0;i<4;i++)
-    printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&y[i])[0],((int16_t *)&y[i])[1],((int16_t*)&y[i])[2],((int16_t *)&y[i])[3],((int16_t*)&y[i])[4],((int16_t *)&y[i])[5],((int16_t*)&y[i])[6],((int16_t *)&y[i])[7]);
+  for (i=0;i<8;i++)
+    print_shorts256("",((int16_t *)y)+(i*16));
   printf("\n");
-  exit(-1); 
-*/
-  dft64((int16_t *)x,(int16_t *)y,1);
-  dft64((int16_t *)x,(int16_t *)y,1);
-  dft64((int16_t *)x,(int16_t *)y,1);
+
+  
+
+
+  idft64((int16_t *)x,(int16_t *)y,1);
+  idft64((int16_t *)x,(int16_t *)y,1);
+  idft64((int16_t *)x,(int16_t *)y,1);
   reset_meas(&ts);
 
   for (i=0; i<10000000; i++) {
     start_meas(&ts);
-    dft64((int16_t *)x,(int16_t *)y,1);
+    idft64((int16_t *)x,(int16_t *)y,1);
     stop_meas(&ts);
 
   }
 
   printf("\n\n64-point (%f cycles, #trials %d)\n",(double)ts.diff/(double)ts.trials,ts.trials);
-  write_output("x64.m","x64",x,64,1,1);
+  //  write_output("x64.m","x64",x,64,1,1);
   write_output("y64.m","y64",y,64,1,1);
+  write_output("x64.m","x64",x,64,1,1);
 
 /*
   printf("X: ");
@@ -16493,18 +18970,32 @@ int main(int argc, char**argv)
   }
 */
   
-  memset((void*)&y[0],0,128*4);
+  memset((void*)&x[0],0,128*4);
+  for (i=2;i<72;i++) {
+    if ((taus() & 1)==0)
+      ((int16_t*)x)[i] = 364;
+    else
+      ((int16_t*)x)[i] = -364;
+  }
+  for (i=(256-72);i<256;i++) {
+    if ((taus() & 1)==0)
+      ((int16_t*)x)[i] = 364;
+    else
+      ((int16_t*)x)[i] = -364;
+  }
   reset_meas(&ts);
 
   for (i=0; i<10000; i++) {
     start_meas(&ts);
-    dft128((int16_t *)x,(int16_t *)y,0);
+    idft128((int16_t *)x,(int16_t *)y,1);
     stop_meas(&ts);
   }
 
   printf("\n\n128-point(%f cycles)\n",(double)ts.diff/(double)ts.trials);
-
-  /* printf("X: ");
+  write_output("y128.m","y128",y,128,1,1);
+  write_output("x128.m","x128",x,128,1,1);
+/*
+  printf("X: ");
    for (i=0;i<32;i++)
      printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&x[i])[0],((int16_t *)&x[i])[1],((int16_t*)&x[i])[2],((int16_t *)&x[i])[3],((int16_t*)&x[i])[4],((int16_t*)&x[i])[5],((int16_t*)&x[i])[6],((int16_t*)&x[i])[7]);
    printf("\nY:");
@@ -16512,35 +19003,64 @@ int main(int argc, char**argv)
    for (i=0;i<32;i++)
      printf("%d,%d,%d,%d,%d,%d,%d,%d,",((int16_t*)&y[i])[0],((int16_t *)&y[i])[1],((int16_t*)&y[i])[2],((int16_t *)&y[i])[3],((int16_t*)&y[i])[4],((int16_t *)&y[i])[5],((int16_t*)&y[i])[6],((int16_t *)&y[i])[7]);
    printf("\n");
-  */
+*/
+
+  /*
   for (i=0; i<512; i++) {
     ((int16_t*)x)[i] = (int16_t)((taus()&0xffff))>>5;
   }
-
+  
   memset((void*)&y[0],0,256*4);
+  */
+  memset((void*)&x[0],0,256*sizeof(int32_t));
+  for (i=2;i<144;i++) {
+    if ((taus() & 1)==0)
+      ((int16_t*)x)[i] = 364;
+    else
+      ((int16_t*)x)[i] = -364;
+  }
+  for (i=(512-144);i<512;i++) {
+    if ((taus() & 1)==0)
+      ((int16_t*)x)[i] = 364;
+    else
+      ((int16_t*)x)[i] = -364;
+  }
   reset_meas(&ts);
 
   for (i=0; i<10000; i++) {
     start_meas(&ts);
-    dft256((int16_t *)x,(int16_t *)y,1);
+    idft256((int16_t *)x,(int16_t *)y,1);
     stop_meas(&ts);
   }
 
   printf("\n\n256-point(%f cycles)\n",(double)ts.diff/(double)ts.trials);
+  write_output("y256.m","y256",y,256,1,1);
+  write_output("x256.m","x256",x,256,1,1);
+
+  memset((void*)&x[0],0,512*sizeof(int32_t));
+  for (i=2;i<302;i++) {
+    if ((taus() & 1)==0)
+      ((int16_t*)x)[i] = 364;
+    else
+      ((int16_t*)x)[i] = -364;
+  }
+  for (i=(1024-300);i<1024;i++) {
+    if ((taus() & 1)==0)
+      ((int16_t*)x)[i] = 364;
+    else
+      ((int16_t*)x)[i] = -364;
+  }
 
   reset_meas(&ts);
-
   for (i=0; i<10000; i++) {
     start_meas(&ts);
-    dft512((int16_t *)x,(int16_t *)y,1);
+    idft512((int16_t *)x,(int16_t *)y,1);
     stop_meas(&ts);
   }
 
   printf("\n\n512-point(%f cycles)\n",(double)ts.diff/(double)ts.trials);
-
-  write_output("x.m","x",x,512,1,1);
-  write_output("y.m","y",y,512,1,1);
-
+  write_output("y512.m","y512",y,512,1,1);
+  write_output("x512.m","x512",x,512,1,1);
   /*
   printf("X: ");
   for (i=0;i<64;i++)
@@ -16552,25 +19072,56 @@ int main(int argc, char**argv)
   printf("\n");
   */
 
+  memset((void*)x,0,1024*sizeof(int32_t));
+  for (i=2;i<602;i++) {
+    if ((taus() & 1)==0)
+      ((int16_t*)x)[i] = 364;
+    else
+      ((int16_t*)x)[i] = -364;
+  }
+  for (i=2*724;i<2048;i++) {
+    if ((taus() & 1)==0)
+      ((int16_t*)x)[i] = 364;
+    else
+      ((int16_t*)x)[i] = -364;
+  }
   reset_meas(&ts);
 
   for (i=0; i<10000; i++) {
     start_meas(&ts);
-    dft1024((int16_t *)x,(int16_t *)y,1);
+    idft1024((int16_t *)x,(int16_t *)y,1);
     stop_meas(&ts);
   }
 
   printf("\n\n1024-point(%f cycles)\n",(double)ts.diff/(double)ts.trials);
-
+  write_output("y1024.m","y1024",y,1024,1,1);
+  write_output("x1024.m","x1024",x,1024,1,1);
+
+  memset((void*)x,0,2048*sizeof(int32_t));
+  for (i=2;i<1202;i++) {
+    if ((taus() & 1)==0)
+      ((int16_t*)x)[i] = 364;
+    else
+      ((int16_t*)x)[i] = -364;
+  }
+  for (i=2*(2048-600);i<4096;i++) {
+    if ((taus() & 1)==0)
+      ((int16_t*)x)[i] = 364;
+    else
+      ((int16_t*)x)[i] = -364;
+  }
   reset_meas(&ts);
 
   for (i=0; i<10000; i++) {
     start_meas(&ts);
-    dft2048((int16_t *)x,(int16_t *)y,1);
+    idft2048((int16_t *)x,(int16_t *)y,1);
     stop_meas(&ts);
   }
 
   printf("\n\n2048-point(%f cycles)\n",(double)ts.diff/(double)ts.trials);
+  write_output("y2048.m","y2048",y,2048,1,1);
+  write_output("x2048.m","x2048",x,2048,1,1);
+
   return(0);
 }
 
diff --git a/openair1/PHY/TOOLS/lte_phy_scope.c b/openair1/PHY/TOOLS/lte_phy_scope.c
index 49cafa19b591216fea2b9b8f3b0480940b1d2e45..4b623fb9dc09cd58436e6884b951357b6b3e5450 100644
--- a/openair1/PHY/TOOLS/lte_phy_scope.c
+++ b/openair1/PHY/TOOLS/lte_phy_scope.c
@@ -88,7 +88,7 @@ FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void )
   fl_set_object_boxtype( fdui->rxsig_t, FL_EMBOSSED_BOX );
   fl_set_object_color( fdui->rxsig_t, FL_BLACK, FL_RED );
   fl_set_object_lcolor( fdui->rxsig_t, FL_WHITE ); // Label color
-  fl_set_xyplot_ybounds(fdui->rxsig_t,30,70);
+  fl_set_xyplot_ybounds(fdui->rxsig_t,10,70);
 
   // Time-domain channel response
   fdui->chest_t = fl_add_xyplot( FL_NORMAL_XYPLOT, 410, 20, 370, 100, "Channel Impulse Response (samples, abs)" );
@@ -119,7 +119,7 @@ FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void )
   fl_set_xyplot_xgrid( fdui->pusch_llr,FL_GRID_MAJOR);
 
   // I/Q PUCCH comp (format 1)
-  fdui->pucch_comp1 = fl_add_xyplot( FL_POINTS_XYPLOT, 540, 480, 240, 100, "PUCCH I/Q of MF Output" );
+  fdui->pucch_comp1 = fl_add_xyplot( FL_POINTS_XYPLOT, 540, 480, 240, 100, "PUCCH1 Energy (SR)" );
   fl_set_object_boxtype( fdui->pucch_comp1, FL_EMBOSSED_BOX );
   fl_set_object_color( fdui->pucch_comp1, FL_BLACK, FL_YELLOW );
   fl_set_object_lcolor( fdui->pucch_comp1, FL_WHITE ); // Label color
@@ -160,7 +160,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
                    int UE_id)
 {
   int eNB_id = 0;
-  int i,arx,atx,ind,k;
+  int i,i2,arx,atx,ind,k;
   LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_enb->lte_frame_parms;
   int nsymb_ce = 12*frame_parms->N_RB_UL*frame_parms->symbols_per_tti;
   uint8_t nb_antennas_rx = frame_parms->nb_antennas_rx;
@@ -171,15 +171,17 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
   int16_t *pusch_llr;
   int16_t *pusch_comp;
   int32_t *pucch1_comp;
-  int16_t *pucch1ab_comp;
+  int32_t *pucch1_thres;
+  int32_t *pucch1ab_comp;
   float Re,Im,ymax;
   float *llr, *bit;
   float I[nsymb_ce*2], Q[nsymb_ce*2];
-  float I_pucch[10240],Q_pucch[10240],A_pucch[10240],B_pucch[10240];
+  float I_pucch[10240],Q_pucch[10240],A_pucch[10240],B_pucch[10240],C_pucch[10240];
   float rxsig_t_dB[nb_antennas_rx][FRAME_LENGTH_COMPLEX_SAMPLES];
   float chest_t_abs[nb_antennas_rx][frame_parms->ofdm_symbol_size];
   float *chest_f_abs;
   float time[FRAME_LENGTH_COMPLEX_SAMPLES];
+  float time2[2048];
   float freq[nsymb_ce*nb_antennas_rx*nb_antennas_tx];
   int frame = phy_vars_enb->proc[0].frame_tx;
   uint32_t total_dlsch_bitrate = phy_vars_enb->total_dlsch_bitrate;
@@ -206,7 +208,8 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
   pusch_llr = (int16_t*) phy_vars_enb->lte_eNB_pusch_vars[UE_id]->llr;
   pusch_comp = (int16_t*) phy_vars_enb->lte_eNB_pusch_vars[UE_id]->rxdataF_comp[eNB_id][0];
   pucch1_comp = (int32_t*) phy_vars_enb->pucch1_stats[UE_id];
-  pucch1ab_comp = (int16_t*) phy_vars_enb->pucch1ab_stats[UE_id];
+  pucch1_thres = (int32_t*) phy_vars_enb->pucch1_stats_thres[UE_id];
+  pucch1ab_comp = (int32_t*) phy_vars_enb->pucch1ab_stats[UE_id];
 
   // Received signal in time domain of receive antenna 0
   if (rxsig_t != NULL) {
@@ -236,19 +239,21 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
 
     if (chest_t[0] !=NULL) {
       for (i=0; i<(frame_parms->ofdm_symbol_size); i++) {
-        chest_t_abs[0][i] = 10*log10((float) (chest_t[0][2*i]*chest_t[0][2*i]+chest_t[0][2*i+1]*chest_t[0][2*i+1]));
+	i2 = (i+(frame_parms->ofdm_symbol_size>>1))%frame_parms->ofdm_symbol_size;
+	time2[i] = (float)(i-(frame_parms->ofdm_symbol_size>>1));
+        chest_t_abs[0][i] = 10*log10((float) (1+chest_t[0][2*i2]*chest_t[0][2*i2]+chest_t[0][2*i2+1]*chest_t[0][2*i2+1]));
 
         if (chest_t_abs[0][i] > ymax)
           ymax = chest_t_abs[0][i];
       }
 
-      fl_set_xyplot_data(form->chest_t,time,chest_t_abs[0],(frame_parms->ofdm_symbol_size),"","","");
+      fl_set_xyplot_data(form->chest_t,time2,chest_t_abs[0],(frame_parms->ofdm_symbol_size),"","","");
     }
 
     for (arx=1; arx<nb_antennas_rx; arx++) {
       if (chest_t[arx] !=NULL) {
         for (i=0; i<(frame_parms->ofdm_symbol_size>>3); i++) {
-          chest_t_abs[arx][i] = 10*log10((float) (chest_t[arx][2*i]*chest_t[arx][2*i]+chest_t[arx][2*i+1]*chest_t[arx][2*i+1]));
+          chest_t_abs[arx][i] = 10*log10((float) (1+chest_t[arx][2*i]*chest_t[arx][2*i]+chest_t[arx][2*i+1]*chest_t[arx][2*i+1]));
  
           if (chest_t_abs[arx][i] > ymax)
             ymax = chest_t_abs[arx][i];
@@ -337,16 +342,20 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
   // PUSCH I/Q of MF Output
   if (pucch1ab_comp!=NULL) {
     for (ind=0; ind<10240; ind++) {
-      I_pucch[ind] = pucch1ab_comp[2*ind];
-      Q_pucch[ind] = pucch1ab_comp[2*ind+1];
+
+      I_pucch[ind] = (float)pucch1ab_comp[2*(ind)];
+      Q_pucch[ind] = (float)pucch1ab_comp[2*(ind)+1];
       A_pucch[ind] = 10*log10(pucch1_comp[ind]);
       B_pucch[ind] = ind;
+      C_pucch[ind] = (float)pucch1_thres[ind]; 
     }
     fl_set_xyplot_data(form->pucch_comp,I_pucch,Q_pucch,10240,"","","");
     fl_set_xyplot_data(form->pucch_comp1,B_pucch,A_pucch,1024,"","","");
-    fl_set_xyplot_xbounds(form->pucch_comp,-200,200);
-    fl_set_xyplot_ybounds(form->pucch_comp,-100,100);
-    fl_set_xyplot_ybounds(form->pucch_comp1,10,40);
+    fl_add_xyplot_overlay(form->pucch_comp1,1,B_pucch,C_pucch,1024,FL_RED);
+    fl_set_xyplot_ybounds(form->pucch_comp,-5000,5000);
+    fl_set_xyplot_xbounds(form->pucch_comp,-5000,5000);
+
+    fl_set_xyplot_ybounds(form->pucch_comp1,0,80);
   }
 
 
@@ -387,7 +396,7 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void )
   fl_set_object_boxtype( fdui->rxsig_t, FL_EMBOSSED_BOX );
   fl_set_object_color( fdui->rxsig_t, FL_BLACK, FL_RED );
   fl_set_object_lcolor( fdui->rxsig_t, FL_WHITE ); // Label color
-  fl_set_xyplot_ybounds(fdui->rxsig_t,30,70);
+  fl_set_xyplot_ybounds(fdui->rxsig_t,10,70);
 
   // Time-domain channel response
   fdui->chest_t = fl_add_xyplot( FL_NORMAL_XYPLOT, 410, 20, 370, 100, "Channel Impulse Response (samples, abs)" );
@@ -710,13 +719,13 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
 
   // PDSCH LLRs
   if (pdsch_llr != NULL) {
-    for (i=0; i<coded_bits_per_codeword/4; i++) {
-      llr[i] = (float) pdsch_llr[4*i];
+    for (i=0; i<coded_bits_per_codeword; i++) {
+      llr[i] = (float) pdsch_llr[i];
       bit[i] = (float) i;
     }
 
-    fl_set_xyplot_xbounds(form->pdsch_llr,0,coded_bits_per_codeword/4);
-    fl_set_xyplot_data(form->pdsch_llr,bit,llr,coded_bits_per_codeword/4,"","","");
+    fl_set_xyplot_xbounds(form->pdsch_llr,0,coded_bits_per_codeword);
+    fl_set_xyplot_data(form->pdsch_llr,bit,llr,coded_bits_per_codeword,"","","");
   }
 
   // PDSCH I/Q of MF Output
diff --git a/openair1/PHY/TOOLS/signal_energy.c b/openair1/PHY/TOOLS/signal_energy.c
index 323a1831dc17cbf1f72fc7df9004fb83a2127113..373fdc0d90acbe35cd3095ee51c25d099e87d780 100755
--- a/openair1/PHY/TOOLS/signal_energy.c
+++ b/openair1/PHY/TOOLS/signal_energy.c
@@ -197,7 +197,7 @@ int32_t signal_energy(int32_t *input,uint32_t length)
   for (i=0; i<length>>1; i++) {
 
     tmpE = vqaddq_s32(tmpE,vshrq_n_s32(vmull_s16(*in,*in),shift));
-    tmpDC = vaddw_s16(tmpDC,vshr_n_s16(*in++,shift_DC));
+    //tmpDC = vaddw_s16(tmpDC,vshr_n_s16(*in++,shift_DC));
 
   }
 
diff --git a/openair1/PHY/TOOLS/time_meas.h b/openair1/PHY/TOOLS/time_meas.h
index a3df8970535976cdbe1b235dd6ad56e4a588d38c..3e621ac281bb41dde0164b9ad848f87becfd9f0f 100644
--- a/openair1/PHY/TOOLS/time_meas.h
+++ b/openair1/PHY/TOOLS/time_meas.h
@@ -26,6 +26,9 @@
   Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
 
  *******************************************************************************/
+#ifndef __TIME_MEAS_DEFS__H__
+#define __TIME_MEAS_DEFS__H__
+
 #include <unistd.h>
 #include <math.h>
 #include <stdint.h>
@@ -148,3 +151,4 @@ static inline void copy_meas(time_stats_t *dst_ts,time_stats_t *src_ts)
     dst_ts->max=src_ts->max;
   }
 }
+#endif
diff --git a/openair1/PHY/TOOLS/twiddles8192.h b/openair1/PHY/TOOLS/twiddles8192.h
new file mode 100644
index 0000000000000000000000000000000000000000..ddb8ab227310e98896282c9d7e624d87954ad89c
--- /dev/null
+++ b/openair1/PHY/TOOLS/twiddles8192.h
@@ -0,0 +1,12 @@
+/* Twiddles generated with
+twa = floor(32767*exp(-sqrt(-1)*2*pi*(0:4095)/8192));
+twa2 = zeros(1,2*4096);
+twa2(1:2:end) = real(twa);
+twa2(2:2:end) = imag(twa);
+fd=fopen("twiddle_tmp.txt","w");
+fprintf(fd,"static int16_t tw8192[4096*2] = {");
+fprintf(fd,"%d,",twa2(1:(4096*2)-1));
+fprintf(fd,"%d};\n",twa2(end));
+fclose(fd);
+*/
+static int16_t tw8192[4096*2] = {32767,0,32766,-26,32766,-51,32766,-76,32766,-101,32766,-126,32766,-151,32766,-176,32766,-202,32766,-227,32766,-252,32765,-277,32765,-302,32765,-327,32765,-352,32764,-377,32764,-403,32764,-428,32763,-453,32763,-478,32763,-503,32762,-528,32762,-553,32761,-579,32761,-604,32760,-629,32760,-654,32759,-679,32759,-704,32758,-729,32758,-754,32757,-780,32757,-805,32756,-830,32755,-855,32755,-880,32754,-905,32753,-930,32753,-955,32752,-981,32751,-1006,32750,-1031,32750,-1056,32749,-1081,32748,-1106,32747,-1131,32746,-1156,32745,-1181,32744,-1207,32743,-1232,32742,-1257,32741,-1282,32740,-1307,32739,-1332,32738,-1357,32737,-1382,32736,-1407,32735,-1433,32734,-1458,32733,-1483,32732,-1508,32731,-1533,32729,-1558,32728,-1583,32727,-1608,32726,-1633,32725,-1659,32723,-1684,32722,-1709,32721,-1734,32719,-1759,32718,-1784,32717,-1809,32715,-1834,32714,-1859,32712,-1884,32711,-1909,32709,-1935,32708,-1960,32706,-1985,32705,-2010,32703,-2035,32702,-2060,32700,-2085,32699,-2110,32697,-2135,32695,-2160,32694,-2185,32692,-2210,32690,-2236,32688,-2261,32687,-2286,32685,-2311,32683,-2336,32681,-2361,32680,-2386,32678,-2411,32676,-2436,32674,-2461,32672,-2486,32670,-2511,32668,-2536,32666,-2561,32664,-2586,32662,-2611,32660,-2637,32658,-2662,32656,-2687,32654,-2712,32652,-2737,32650,-2762,32648,-2787,32646,-2812,32644,-2837,32641,-2862,32639,-2887,32637,-2912,32635,-2937,32632,-2962,32630,-2987,32628,-3012,32625,-3037,32623,-3062,32621,-3087,32618,-3112,32616,-3137,32614,-3162,32611,-3187,32609,-3212,32606,-3237,32604,-3262,32601,-3287,32599,-3312,32596,-3337,32594,-3362,32591,-3387,32588,-3412,32586,-3437,32583,-3462,32580,-3487,32578,-3512,32575,-3537,32572,-3562,32570,-3587,32567,-3612,32564,-3637,32561,-3662,32558,-3687,32556,-3712,32553,-3737,32550,-3762,32547,-3787,32544,-3812,32541,-3837,32538,-3862,32535,-3887,32532,-3912,32529,-3937,32526,-3962,32523,-3987,32520,-4012,32517,-4036,32514,-4061,32511,-4086,32508,-4111,32504,-4136,32501,-4161,32498,-4186,32495,-4211,32492,-4236,32488,-4261,32485,-4286,32482,-4311,32478,-4336,32475,-4360,32472,-4385,32468,-4410,32465,-4435,32462,-4460,32458,-4485,32455,-4510,32451,-4535,32448,-4560,32444,-4585,32441,-4609,32437,-4634,32434,-4659,32430,-4684,32426,-4709,32423,-4734,32419,-4759,32416,-4784,32412,-4808,32408,-4833,32404,-4858,32401,-4883,32397,-4908,32393,-4933,32389,-4958,32386,-4982,32382,-5007,32378,-5032,32374,-5057,32370,-5082,32366,-5107,32362,-5131,32358,-5156,32354,-5181,32350,-5206,32346,-5231,32342,-5255,32338,-5280,32334,-5305,32330,-5330,32326,-5355,32322,-5379,32318,-5404,32314,-5429,32310,-5454,32305,-5479,32301,-5503,32297,-5528,32293,-5553,32288,-5578,32284,-5602,32280,-5627,32275,-5652,32271,-5677,32267,-5701,32262,-5726,32258,-5751,32254,-5776,32249,-5800,32245,-5825,32240,-5850,32236,-5875,32231,-5899,32227,-5924,32222,-5949,32218,-5973,32213,-5998,32208,-6023,32204,-6048,32199,-6072,32194,-6097,32190,-6122,32185,-6146,32180,-6171,32176,-6196,32171,-6220,32166,-6245,32161,-6270,32156,-6294,32152,-6319,32147,-6344,32142,-6368,32137,-6393,32132,-6418,32127,-6442,32122,-6467,32117,-6492,32112,-6516,32107,-6541,32102,-6565,32097,-6590,32092,-6615,32087,-6639,32082,-6664,32077,-6689,32072,-6713,32066,-6738,32061,-6762,32056,-6787,32051,-6812,32046,-6836,32040,-6861,32035,-6885,32030,-6910,32024,-6934,32019,-6959,32014,-6983,32008,-7008,32003,-7033,31998,-7057,31992,-7082,31987,-7106,31981,-7131,31976,-7155,31970,-7180,31965,-7204,31959,-7229,31954,-7253,31948,-7278,31943,-7302,31937,-7327,31931,-7351,31926,-7376,31920,-7400,31914,-7425,31909,-7449,31903,-7474,31897,-7498,31891,-7523,31886,-7547,31880,-7572,31874,-7596,31868,-7620,31862,-7645,31856,-7669,31851,-7694,31845,-7718,31839,-7743,31833,-7767,31827,-7791,31821,-7816,31815,-7840,31809,-7865,31803,-7889,31797,-7913,31791,-7938,31785,-7962,31778,-7987,31772,-8011,31766,-8035,31760,-8060,31754,-8084,31748,-8108,31741,-8133,31735,-8157,31729,-8181,31723,-8206,31716,-8230,31710,-8254,31704,-8279,31697,-8303,31691,-8327,31684,-8352,31678,-8376,31672,-8400,31665,-8425,31659,-8449,31652,-8473,31646,-8497,31639,-8522,31633,-8546,31626,-8570,31619,-8594,31613,-8619,31606,-8643,31600,-8667,31593,-8691,31586,-8716,31580,-8740,31573,-8764,31566,-8788,31559,-8813,31553,-8837,31546,-8861,31539,-8885,31532,-8909,31525,-8933,31518,-8958,31512,-8982,31505,-9006,31498,-9030,31491,-9054,31484,-9078,31477,-9103,31470,-9127,31463,-9151,31456,-9175,31449,-9199,31442,-9223,31435,-9247,31428,-9271,31420,-9296,31413,-9320,31406,-9344,31399,-9368,31392,-9392,31385,-9416,31377,-9440,31370,-9464,31363,-9488,31356,-9512,31348,-9536,31341,-9560,31334,-9584,31326,-9608,31319,-9632,31311,-9656,31304,-9680,31297,-9704,31289,-9728,31282,-9752,31274,-9776,31267,-9800,31259,-9824,31252,-9848,31244,-9872,31236,-9896,31229,-9920,31221,-9944,31214,-9968,31206,-9992,31198,-10016,31191,-10040,31183,-10064,31175,-10088,31167,-10112,31160,-10136,31152,-10160,31144,-10183,31136,-10207,31128,-10231,31121,-10255,31113,-10279,31105,-10303,31097,-10327,31089,-10350,31081,-10374,31073,-10398,31065,-10422,31057,-10446,31049,-10470,31041,-10493,31033,-10517,31025,-10541,31017,-10565,31009,-10589,31001,-10612,30992,-10636,30984,-10660,30976,-10684,30968,-10707,30960,-10731,30951,-10755,30943,-10779,30935,-10802,30927,-10826,30918,-10850,30910,-10874,30902,-10897,30893,-10921,30885,-10945,30876,-10968,30868,-10992,30860,-11016,30851,-11039,30843,-11063,30834,-11087,30826,-11110,30817,-11134,30809,-11158,30800,-11181,30791,-11205,30783,-11228,30774,-11252,30766,-11276,30757,-11299,30748,-11323,30739,-11346,30731,-11370,30722,-11394,30713,-11417,30705,-11441,30696,-11464,30687,-11488,30678,-11511,30669,-11535,30660,-11558,30652,-11582,30643,-11605,30634,-11629,30625,-11652,30616,-11676,30607,-11699,30598,-11723,30589,-11746,30580,-11770,30571,-11793,30562,-11817,30553,-11840,30544,-11863,30535,-11887,30525,-11910,30516,-11934,30507,-11957,30498,-11981,30489,-12004,30480,-12027,30470,-12051,30461,-12074,30452,-12097,30442,-12121,30433,-12144,30424,-12167,30415,-12191,30405,-12214,30396,-12237,30386,-12261,30377,-12284,30368,-12307,30358,-12331,30349,-12354,30339,-12377,30330,-12400,30320,-12424,30311,-12447,30301,-12470,30291,-12493,30282,-12517,30272,-12540,30263,-12563,30253,-12586,30243,-12610,30234,-12633,30224,-12656,30214,-12679,30205,-12702,30195,-12725,30185,-12749,30175,-12772,30165,-12795,30156,-12818,30146,-12841,30136,-12864,30126,-12887,30116,-12910,30106,-12934,30096,-12957,30086,-12980,30076,-13003,30066,-13026,30056,-13049,30046,-13072,30036,-13095,30026,-13118,30016,-13141,30006,-13164,29996,-13187,29986,-13210,29976,-13233,29966,-13256,29955,-13279,29945,-13302,29935,-13325,29925,-13348,29915,-13371,29904,-13394,29894,-13417,29884,-13440,29873,-13463,29863,-13486,29853,-13508,29842,-13531,29832,-13554,29822,-13577,29811,-13600,29801,-13623,29790,-13646,29780,-13668,29769,-13691,29759,-13714,29748,-13737,29738,-13760,29727,-13783,29717,-13805,29706,-13828,29695,-13851,29685,-13874,29674,-13896,29663,-13919,29653,-13942,29642,-13965,29631,-13987,29621,-14010,29610,-14033,29599,-14056,29588,-14078,29577,-14101,29567,-14124,29556,-14146,29545,-14169,29534,-14192,29523,-14214,29512,-14237,29501,-14260,29490,-14282,29479,-14305,29468,-14327,29457,-14350,29446,-14373,29435,-14395,29424,-14418,29413,-14440,29402,-14463,29391,-14485,29380,-14508,29369,-14531,29358,-14553,29346,-14576,29335,-14598,29324,-14621,29313,-14643,29302,-14666,29290,-14688,29279,-14710,29268,-14733,29256,-14755,29245,-14778,29234,-14800,29222,-14823,29211,-14845,29200,-14867,29188,-14890,29177,-14912,29165,-14935,29154,-14957,29142,-14979,29131,-15002,29119,-15024,29108,-15046,29096,-15069,29085,-15091,29073,-15113,29062,-15136,29050,-15158,29038,-15180,29027,-15202,29015,-15225,29003,-15247,28992,-15269,28980,-15291,28968,-15314,28956,-15336,28945,-15358,28933,-15380,28921,-15402,28909,-15425,28897,-15447,28886,-15469,28874,-15491,28862,-15513,28850,-15535,28838,-15557,28826,-15580,28814,-15602,28802,-15624,28790,-15646,28778,-15668,28766,-15690,28754,-15712,28742,-15734,28730,-15756,28718,-15778,28706,-15800,28694,-15822,28681,-15844,28669,-15866,28657,-15888,28645,-15910,28633,-15932,28620,-15954,28608,-15976,28596,-15998,28584,-16020,28571,-16042,28559,-16064,28547,-16086,28534,-16108,28522,-16129,28510,-16151,28497,-16173,28485,-16195,28472,-16217,28460,-16239,28447,-16261,28435,-16282,28423,-16304,28410,-16326,28397,-16348,28385,-16369,28372,-16391,28360,-16413,28347,-16435,28335,-16456,28322,-16478,28309,-16500,28297,-16522,28284,-16543,28271,-16565,28259,-16587,28246,-16608,28233,-16630,28220,-16652,28208,-16673,28195,-16695,28182,-16717,28169,-16738,28156,-16760,28143,-16781,28131,-16803,28118,-16825,28105,-16846,28092,-16868,28079,-16889,28066,-16911,28053,-16932,28040,-16954,28027,-16975,28014,-16997,28001,-17018,27988,-17040,27975,-17061,27962,-17083,27948,-17104,27935,-17125,27922,-17147,27909,-17168,27896,-17190,27883,-17211,27869,-17233,27856,-17254,27843,-17275,27830,-17297,27816,-17318,27803,-17339,27790,-17361,27777,-17382,27763,-17403,27750,-17424,27736,-17446,27723,-17467,27710,-17488,27696,-17510,27683,-17531,27669,-17552,27656,-17573,27642,-17594,27629,-17616,27615,-17637,27602,-17658,27588,-17679,27575,-17700,27561,-17721,27548,-17743,27534,-17764,27520,-17785,27507,-17806,27493,-17827,27479,-17848,27466,-17869,27452,-17890,27438,-17911,27424,-17932,27411,-17953,27397,-17974,27383,-17995,27369,-18016,27355,-18037,27342,-18058,27328,-18079,27314,-18100,27300,-18121,27286,-18142,27272,-18163,27258,-18184,27244,-18205,27230,-18226,27216,-18247,27202,-18268,27188,-18288,27174,-18309,27160,-18330,27146,-18351,27132,-18372,27118,-18393,27104,-18413,27090,-18434,27076,-18455,27061,-18476,27047,-18496,27033,-18517,27019,-18538,27005,-18559,26990,-18579,26976,-18600,26962,-18621,26948,-18641,26933,-18662,26919,-18683,26905,-18703,26890,-18724,26876,-18745,26861,-18765,26847,-18786,26833,-18806,26818,-18827,26804,-18847,26789,-18868,26775,-18889,26760,-18909,26746,-18930,26731,-18950,26717,-18971,26702,-18991,26688,-19012,26673,-19032,26658,-19052,26644,-19073,26629,-19093,26615,-19114,26600,-19134,26585,-19155,26570,-19175,26556,-19195,26541,-19216,26526,-19236,26512,-19256,26497,-19277,26482,-19297,26467,-19317,26452,-19338,26437,-19358,26423,-19378,26408,-19398,26393,-19419,26378,-19439,26363,-19459,26348,-19479,26333,-19500,26318,-19520,26303,-19540,26288,-19560,26273,-19580,26258,-19600,26243,-19621,26228,-19641,26213,-19661,26198,-19681,26183,-19701,26168,-19721,26153,-19741,26137,-19761,26122,-19781,26107,-19801,26092,-19821,26077,-19841,26061,-19861,26046,-19881,26031,-19901,26016,-19921,26000,-19941,25985,-19961,25970,-19981,25954,-20001,25939,-20021,25924,-20041,25908,-20061,25893,-20080,25878,-20100,25862,-20120,25847,-20140,25831,-20160,25816,-20180,25800,-20199,25785,-20219,25769,-20239,25754,-20259,25738,-20278,25723,-20298,25707,-20318,25691,-20338,25676,-20357,25660,-20377,25645,-20397,25629,-20416,25613,-20436,25598,-20456,25582,-20475,25566,-20495,25550,-20514,25535,-20534,25519,-20554,25503,-20573,25487,-20593,25472,-20612,25456,-20632,25440,-20651,25424,-20671,25408,-20690,25392,-20710,25376,-20729,25361,-20749,25345,-20768,25329,-20788,25313,-20807,25297,-20826,25281,-20846,25265,-20865,25249,-20885,25233,-20904,25217,-20923,25201,-20943,25185,-20962,25169,-20981,25152,-21001,25136,-21020,25120,-21039,25104,-21058,25088,-21078,25072,-21097,25056,-21116,25039,-21135,25023,-21155,25007,-21174,24991,-21193,24974,-21212,24958,-21231,24942,-21250,24926,-21269,24909,-21289,24893,-21308,24877,-21327,24860,-21346,24844,-21365,24827,-21384,24811,-21403,24795,-21422,24778,-21441,24762,-21460,24745,-21479,24729,-21498,24712,-21517,24696,-21536,24679,-21555,24663,-21574,24646,-21593,24630,-21612,24613,-21630,24596,-21649,24580,-21668,24563,-21687,24546,-21706,24530,-21725,24513,-21744,24496,-21762,24480,-21781,24463,-21800,24446,-21819,24430,-21837,24413,-21856,24396,-21875,24379,-21894,24362,-21912,24346,-21931,24329,-21950,24312,-21968,24295,-21987,24278,-22005,24261,-22024,24244,-22043,24228,-22061,24211,-22080,24194,-22098,24177,-22117,24160,-22136,24143,-22154,24126,-22173,24109,-22191,24092,-22210,24075,-22228,24058,-22246,24041,-22265,24023,-22283,24006,-22302,23989,-22320,23972,-22339,23955,-22357,23938,-22375,23921,-22394,23903,-22412,23886,-22430,23869,-22449,23852,-22467,23835,-22485,23817,-22504,23800,-22522,23783,-22540,23766,-22558,23748,-22576,23731,-22595,23714,-22613,23696,-22631,23679,-22649,23661,-22667,23644,-22686,23627,-22704,23609,-22722,23592,-22740,23574,-22758,23557,-22776,23539,-22794,23522,-22812,23504,-22830,23487,-22848,23469,-22866,23452,-22884,23434,-22902,23417,-22920,23399,-22938,23382,-22956,23364,-22974,23346,-22992,23329,-23010,23311,-23028,23293,-23046,23276,-23063,23258,-23081,23240,-23099,23223,-23117,23205,-23135,23187,-23152,23169,-23170,23151,-23188,23134,-23206,23116,-23224,23098,-23241,23080,-23259,23062,-23277,23045,-23294,23027,-23312,23009,-23330,22991,-23347,22973,-23365,22955,-23383,22937,-23400,22919,-23418,22901,-23435,22883,-23453,22865,-23470,22847,-23488,22829,-23505,22811,-23523,22793,-23540,22775,-23558,22757,-23575,22739,-23593,22721,-23610,22703,-23628,22685,-23645,22666,-23662,22648,-23680,22630,-23697,22612,-23715,22594,-23732,22575,-23749,22557,-23767,22539,-23784,22521,-23801,22503,-23818,22484,-23836,22466,-23853,22448,-23870,22429,-23887,22411,-23904,22393,-23922,22374,-23939,22356,-23956,22338,-23973,22319,-23990,22301,-24007,22282,-24024,22264,-24042,22245,-24059,22227,-24076,22209,-24093,22190,-24110,22172,-24127,22153,-24144,22135,-24161,22116,-24178,22097,-24195,22079,-24212,22060,-24229,22042,-24245,22023,-24262,22004,-24279,21986,-24296,21967,-24313,21949,-24330,21930,-24347,21911,-24363,21893,-24380,21874,-24397,21855,-24414,21836,-24431,21818,-24447,21799,-24464,21780,-24481,21761,-24497,21743,-24514,21724,-24531,21705,-24547,21686,-24564,21667,-24581,21648,-24597,21629,-24614,21611,-24631,21592,-24647,21573,-24664,21554,-24680,21535,-24697,21516,-24713,21497,-24730,21478,-24746,21459,-24763,21440,-24779,21421,-24796,21402,-24812,21383,-24828,21364,-24845,21345,-24861,21326,-24878,21307,-24894,21288,-24910,21268,-24927,21249,-24943,21230,-24959,21211,-24975,21192,-24992,21173,-25008,21154,-25024,21134,-25040,21115,-25057,21096,-25073,21077,-25089,21057,-25105,21038,-25121,21019,-25137,21000,-25153,20980,-25170,20961,-25186,20942,-25202,20922,-25218,20903,-25234,20884,-25250,20864,-25266,20845,-25282,20825,-25298,20806,-25314,20787,-25330,20767,-25346,20748,-25362,20728,-25377,20709,-25393,20689,-25409,20670,-25425,20650,-25441,20631,-25457,20611,-25473,20592,-25488,20572,-25504,20553,-25520,20533,-25536,20513,-25551,20494,-25567,20474,-25583,20455,-25599,20435,-25614,20415,-25630,20396,-25646,20376,-25661,20356,-25677,20337,-25692,20317,-25708,20297,-25724,20277,-25739,20258,-25755,20238,-25770,20218,-25786,20198,-25801,20179,-25817,20159,-25832,20139,-25848,20119,-25863,20099,-25879,20079,-25894,20060,-25909,20040,-25925,20020,-25940,20000,-25955,19980,-25971,19960,-25986,19940,-26001,19920,-26017,19900,-26032,19880,-26047,19860,-26062,19840,-26078,19820,-26093,19800,-26108,19780,-26123,19760,-26138,19740,-26154,19720,-26169,19700,-26184,19680,-26199,19660,-26214,19640,-26229,19620,-26244,19599,-26259,19579,-26274,19559,-26289,19539,-26304,19519,-26319,19499,-26334,19478,-26349,19458,-26364,19438,-26379,19418,-26394,19397,-26409,19377,-26424,19357,-26438,19337,-26453,19316,-26468,19296,-26483,19276,-26498,19255,-26513,19235,-26527,19215,-26542,19194,-26557,19174,-26571,19154,-26586,19133,-26601,19113,-26616,19092,-26630,19072,-26645,19051,-26659,19031,-26674,19011,-26689,18990,-26703,18970,-26718,18949,-26732,18929,-26747,18908,-26761,18888,-26776,18867,-26790,18846,-26805,18826,-26819,18805,-26834,18785,-26848,18764,-26862,18744,-26877,18723,-26891,18702,-26906,18682,-26920,18661,-26934,18640,-26949,18620,-26963,18599,-26977,18578,-26991,18558,-27006,18537,-27020,18516,-27034,18495,-27048,18475,-27062,18454,-27077,18433,-27091,18412,-27105,18392,-27119,18371,-27133,18350,-27147,18329,-27161,18308,-27175,18287,-27189,18267,-27203,18246,-27217,18225,-27231,18204,-27245,18183,-27259,18162,-27273,18141,-27287,18120,-27301,18099,-27315,18078,-27329,18057,-27343,18036,-27356,18015,-27370,17994,-27384,17973,-27398,17952,-27412,17931,-27425,17910,-27439,17889,-27453,17868,-27467,17847,-27480,17826,-27494,17805,-27508,17784,-27521,17763,-27535,17742,-27549,17720,-27562,17699,-27576,17678,-27589,17657,-27603,17636,-27616,17615,-27630,17593,-27643,17572,-27657,17551,-27670,17530,-27684,17509,-27697,17487,-27711,17466,-27724,17445,-27737,17423,-27751,17402,-27764,17381,-27778,17360,-27791,17338,-27804,17317,-27817,17296,-27831,17274,-27844,17253,-27857,17232,-27870,17210,-27884,17189,-27897,17167,-27910,17146,-27923,17124,-27936,17103,-27949,17082,-27963,17060,-27976,17039,-27989,17017,-28002,16996,-28015,16974,-28028,16953,-28041,16931,-28054,16910,-28067,16888,-28080,16867,-28093,16845,-28106,16824,-28119,16802,-28132,16780,-28144,16759,-28157,16737,-28170,16716,-28183,16694,-28196,16672,-28209,16651,-28221,16629,-28234,16607,-28247,16586,-28260,16564,-28272,16542,-28285,16521,-28298,16499,-28310,16477,-28323,16455,-28336,16434,-28348,16412,-28361,16390,-28373,16368,-28386,16347,-28398,16325,-28411,16303,-28424,16281,-28436,16260,-28448,16238,-28461,16216,-28473,16194,-28486,16172,-28498,16150,-28511,16128,-28523,16107,-28535,16085,-28548,16063,-28560,16041,-28572,16019,-28585,15997,-28597,15975,-28609,15953,-28621,15931,-28634,15909,-28646,15887,-28658,15865,-28670,15843,-28682,15821,-28695,15799,-28707,15777,-28719,15755,-28731,15733,-28743,15711,-28755,15689,-28767,15667,-28779,15645,-28791,15623,-28803,15601,-28815,15579,-28827,15556,-28839,15534,-28851,15512,-28863,15490,-28875,15468,-28887,15446,-28898,15424,-28910,15401,-28922,15379,-28934,15357,-28946,15335,-28957,15313,-28969,15290,-28981,15268,-28993,15246,-29004,15224,-29016,15201,-29028,15179,-29039,15157,-29051,15135,-29063,15112,-29074,15090,-29086,15068,-29097,15045,-29109,15023,-29120,15001,-29132,14978,-29143,14956,-29155,14934,-29166,14911,-29178,14889,-29189,14866,-29201,14844,-29212,14822,-29223,14799,-29235,14777,-29246,14754,-29257,14732,-29269,14709,-29280,14687,-29291,14665,-29303,14642,-29314,14620,-29325,14597,-29336,14575,-29347,14552,-29359,14530,-29370,14507,-29381,14484,-29392,14462,-29403,14439,-29414,14417,-29425,14394,-29436,14372,-29447,14349,-29458,14326,-29469,14304,-29480,14281,-29491,14259,-29502,14236,-29513,14213,-29524,14191,-29535,14168,-29546,14145,-29557,14123,-29568,14100,-29578,14077,-29589,14055,-29600,14032,-29611,14009,-29622,13986,-29632,13964,-29643,13941,-29654,13918,-29664,13895,-29675,13873,-29686,13850,-29696,13827,-29707,13804,-29718,13782,-29728,13759,-29739,13736,-29749,13713,-29760,13690,-29770,13667,-29781,13645,-29791,13622,-29802,13599,-29812,13576,-29823,13553,-29833,13530,-29843,13507,-29854,13485,-29864,13462,-29874,13439,-29885,13416,-29895,13393,-29905,13370,-29916,13347,-29926,13324,-29936,13301,-29946,13278,-29956,13255,-29967,13232,-29977,13209,-29987,13186,-29997,13163,-30007,13140,-30017,13117,-30027,13094,-30037,13071,-30047,13048,-30057,13025,-30067,13002,-30077,12979,-30087,12956,-30097,12933,-30107,12909,-30117,12886,-30127,12863,-30137,12840,-30147,12817,-30157,12794,-30166,12771,-30176,12748,-30186,12724,-30196,12701,-30206,12678,-30215,12655,-30225,12632,-30235,12609,-30244,12585,-30254,12562,-30264,12539,-30273,12516,-30283,12492,-30292,12469,-30302,12446,-30312,12423,-30321,12399,-30331,12376,-30340,12353,-30350,12330,-30359,12306,-30369,12283,-30378,12260,-30387,12236,-30397,12213,-30406,12190,-30416,12166,-30425,12143,-30434,12120,-30443,12096,-30453,12073,-30462,12050,-30471,12026,-30481,12003,-30490,11980,-30499,11956,-30508,11933,-30517,11909,-30526,11886,-30536,11862,-30545,11839,-30554,11816,-30563,11792,-30572,11769,-30581,11745,-30590,11722,-30599,11698,-30608,11675,-30617,11651,-30626,11628,-30635,11604,-30644,11581,-30653,11557,-30661,11534,-30670,11510,-30679,11487,-30688,11463,-30697,11440,-30706,11416,-30714,11393,-30723,11369,-30732,11345,-30740,11322,-30749,11298,-30758,11275,-30767,11251,-30775,11227,-30784,11204,-30792,11180,-30801,11157,-30810,11133,-30818,11109,-30827,11086,-30835,11062,-30844,11038,-30852,11015,-30861,10991,-30869,10967,-30877,10944,-30886,10920,-30894,10896,-30903,10873,-30911,10849,-30919,10825,-30928,10801,-30936,10778,-30944,10754,-30952,10730,-30961,10706,-30969,10683,-30977,10659,-30985,10635,-30993,10611,-31002,10588,-31010,10564,-31018,10540,-31026,10516,-31034,10492,-31042,10469,-31050,10445,-31058,10421,-31066,10397,-31074,10373,-31082,10349,-31090,10326,-31098,10302,-31106,10278,-31114,10254,-31122,10230,-31129,10206,-31137,10182,-31145,10159,-31153,10135,-31161,10111,-31168,10087,-31176,10063,-31184,10039,-31192,10015,-31199,9991,-31207,9967,-31215,9943,-31222,9919,-31230,9895,-31237,9871,-31245,9847,-31253,9823,-31260,9799,-31268,9775,-31275,9751,-31283,9727,-31290,9703,-31298,9679,-31305,9655,-31312,9631,-31320,9607,-31327,9583,-31335,9559,-31342,9535,-31349,9511,-31357,9487,-31364,9463,-31371,9439,-31378,9415,-31386,9391,-31393,9367,-31400,9343,-31407,9319,-31414,9295,-31421,9270,-31429,9246,-31436,9222,-31443,9198,-31450,9174,-31457,9150,-31464,9126,-31471,9102,-31478,9077,-31485,9053,-31492,9029,-31499,9005,-31506,8981,-31513,8957,-31519,8932,-31526,8908,-31533,8884,-31540,8860,-31547,8836,-31554,8812,-31560,8787,-31567,8763,-31574,8739,-31581,8715,-31587,8690,-31594,8666,-31601,8642,-31607,8618,-31614,8593,-31620,8569,-31627,8545,-31634,8521,-31640,8496,-31647,8472,-31653,8448,-31660,8424,-31666,8399,-31673,8375,-31679,8351,-31685,8326,-31692,8302,-31698,8278,-31705,8253,-31711,8229,-31717,8205,-31724,8180,-31730,8156,-31736,8132,-31742,8107,-31749,8083,-31755,8059,-31761,8034,-31767,8010,-31773,7986,-31779,7961,-31786,7937,-31792,7912,-31798,7888,-31804,7864,-31810,7839,-31816,7815,-31822,7790,-31828,7766,-31834,7742,-31840,7717,-31846,7693,-31852,7668,-31857,7644,-31863,7619,-31869,7595,-31875,7571,-31881,7546,-31887,7522,-31892,7497,-31898,7473,-31904,7448,-31910,7424,-31915,7399,-31921,7375,-31927,7350,-31932,7326,-31938,7301,-31944,7277,-31949,7252,-31955,7228,-31960,7203,-31966,7179,-31971,7154,-31977,7130,-31982,7105,-31988,7081,-31993,7056,-31999,7032,-32004,7007,-32009,6982,-32015,6958,-32020,6933,-32025,6909,-32031,6884,-32036,6860,-32041,6835,-32047,6811,-32052,6786,-32057,6761,-32062,6737,-32067,6712,-32073,6688,-32078,6663,-32083,6638,-32088,6614,-32093,6589,-32098,6564,-32103,6540,-32108,6515,-32113,6491,-32118,6466,-32123,6441,-32128,6417,-32133,6392,-32138,6367,-32143,6343,-32148,6318,-32153,6293,-32157,6269,-32162,6244,-32167,6219,-32172,6195,-32177,6170,-32181,6145,-32186,6121,-32191,6096,-32195,6071,-32200,6047,-32205,6022,-32209,5997,-32214,5972,-32219,5948,-32223,5923,-32228,5898,-32232,5874,-32237,5849,-32241,5824,-32246,5799,-32250,5775,-32255,5750,-32259,5725,-32263,5700,-32268,5676,-32272,5651,-32276,5626,-32281,5601,-32285,5577,-32289,5552,-32294,5527,-32298,5502,-32302,5478,-32306,5453,-32311,5428,-32315,5403,-32319,5378,-32323,5354,-32327,5329,-32331,5304,-32335,5279,-32339,5254,-32343,5230,-32347,5205,-32351,5180,-32355,5155,-32359,5130,-32363,5106,-32367,5081,-32371,5056,-32375,5031,-32379,5006,-32383,4981,-32387,4957,-32390,4932,-32394,4907,-32398,4882,-32402,4857,-32405,4832,-32409,4807,-32413,4783,-32417,4758,-32420,4733,-32424,4708,-32427,4683,-32431,4658,-32435,4633,-32438,4608,-32442,4584,-32445,4559,-32449,4534,-32452,4509,-32456,4484,-32459,4459,-32463,4434,-32466,4409,-32469,4384,-32473,4359,-32476,4335,-32479,4310,-32483,4285,-32486,4260,-32489,4235,-32493,4210,-32496,4185,-32499,4160,-32502,4135,-32505,4110,-32509,4085,-32512,4060,-32515,4035,-32518,4011,-32521,3986,-32524,3961,-32527,3936,-32530,3911,-32533,3886,-32536,3861,-32539,3836,-32542,3811,-32545,3786,-32548,3761,-32551,3736,-32554,3711,-32557,3686,-32559,3661,-32562,3636,-32565,3611,-32568,3586,-32571,3561,-32573,3536,-32576,3511,-32579,3486,-32581,3461,-32584,3436,-32587,3411,-32589,3386,-32592,3361,-32595,3336,-32597,3311,-32600,3286,-32602,3261,-32605,3236,-32607,3211,-32610,3186,-32612,3161,-32615,3136,-32617,3111,-32619,3086,-32622,3061,-32624,3036,-32626,3011,-32629,2986,-32631,2961,-32633,2936,-32636,2911,-32638,2886,-32640,2861,-32642,2836,-32645,2811,-32647,2786,-32649,2761,-32651,2736,-32653,2711,-32655,2686,-32657,2661,-32659,2636,-32661,2610,-32663,2585,-32665,2560,-32667,2535,-32669,2510,-32671,2485,-32673,2460,-32675,2435,-32677,2410,-32679,2385,-32681,2360,-32682,2335,-32684,2310,-32686,2285,-32688,2260,-32689,2235,-32691,2209,-32693,2184,-32695,2159,-32696,2134,-32698,2109,-32700,2084,-32701,2059,-32703,2034,-32704,2009,-32706,1984,-32707,1959,-32709,1934,-32710,1908,-32712,1883,-32713,1858,-32715,1833,-32716,1808,-32718,1783,-32719,1758,-32720,1733,-32722,1708,-32723,1683,-32724,1658,-32726,1632,-32727,1607,-32728,1582,-32729,1557,-32730,1532,-32732,1507,-32733,1482,-32734,1457,-32735,1432,-32736,1406,-32737,1381,-32738,1356,-32739,1331,-32740,1306,-32741,1281,-32742,1256,-32743,1231,-32744,1206,-32745,1180,-32746,1155,-32747,1130,-32748,1105,-32749,1080,-32750,1055,-32751,1030,-32751,1005,-32752,980,-32753,954,-32754,929,-32754,904,-32755,879,-32756,854,-32756,829,-32757,804,-32758,779,-32758,753,-32759,728,-32759,703,-32760,678,-32760,653,-32761,628,-32761,603,-32762,578,-32762,552,-32763,527,-32763,502,-32764,477,-32764,452,-32764,427,-32765,402,-32765,376,-32765,351,-32766,326,-32766,301,-32766,276,-32766,251,-32767,226,-32767,201,-32767,175,-32767,150,-32767,125,-32767,100,-32767,75,-32767,50,-32767,25,-32767,0,-32767,-26,-32767,-51,-32767,-76,-32767,-101,-32767,-126,-32767,-151,-32767,-176,-32767,-202,-32767,-227,-32767,-252,-32767,-277,-32766,-302,-32766,-327,-32766,-352,-32766,-377,-32765,-403,-32765,-428,-32765,-453,-32764,-478,-32764,-503,-32764,-528,-32763,-553,-32763,-579,-32762,-604,-32762,-629,-32761,-654,-32761,-679,-32760,-704,-32760,-729,-32759,-754,-32759,-780,-32758,-805,-32758,-830,-32757,-855,-32756,-880,-32756,-905,-32755,-930,-32754,-955,-32754,-981,-32753,-1006,-32752,-1031,-32751,-1056,-32751,-1081,-32750,-1106,-32749,-1131,-32748,-1156,-32747,-1181,-32746,-1207,-32745,-1232,-32744,-1257,-32743,-1282,-32742,-1307,-32741,-1332,-32740,-1357,-32739,-1382,-32738,-1407,-32737,-1433,-32736,-1458,-32735,-1483,-32734,-1508,-32733,-1533,-32732,-1558,-32730,-1583,-32729,-1608,-32728,-1633,-32727,-1659,-32726,-1684,-32724,-1709,-32723,-1734,-32722,-1759,-32720,-1784,-32719,-1809,-32718,-1834,-32716,-1859,-32715,-1884,-32713,-1909,-32712,-1935,-32710,-1960,-32709,-1985,-32707,-2010,-32706,-2035,-32704,-2060,-32703,-2085,-32701,-2110,-32700,-2135,-32698,-2160,-32696,-2185,-32695,-2210,-32693,-2236,-32691,-2261,-32689,-2286,-32688,-2311,-32686,-2336,-32684,-2361,-32682,-2386,-32681,-2411,-32679,-2436,-32677,-2461,-32675,-2486,-32673,-2511,-32671,-2536,-32669,-2561,-32667,-2586,-32665,-2611,-32663,-2637,-32661,-2662,-32659,-2687,-32657,-2712,-32655,-2737,-32653,-2762,-32651,-2787,-32649,-2812,-32647,-2837,-32645,-2862,-32642,-2887,-32640,-2912,-32638,-2937,-32636,-2962,-32633,-2987,-32631,-3012,-32629,-3037,-32626,-3062,-32624,-3087,-32622,-3112,-32619,-3137,-32617,-3162,-32615,-3187,-32612,-3212,-32610,-3237,-32607,-3262,-32605,-3287,-32602,-3312,-32600,-3337,-32597,-3362,-32595,-3387,-32592,-3412,-32589,-3437,-32587,-3462,-32584,-3487,-32581,-3512,-32579,-3537,-32576,-3562,-32573,-3587,-32571,-3612,-32568,-3637,-32565,-3662,-32562,-3687,-32559,-3712,-32557,-3737,-32554,-3762,-32551,-3787,-32548,-3812,-32545,-3837,-32542,-3862,-32539,-3887,-32536,-3912,-32533,-3937,-32530,-3962,-32527,-3987,-32524,-4012,-32521,-4036,-32518,-4061,-32515,-4086,-32512,-4111,-32509,-4136,-32505,-4161,-32502,-4186,-32499,-4211,-32496,-4236,-32493,-4261,-32489,-4286,-32486,-4311,-32483,-4336,-32479,-4360,-32476,-4385,-32473,-4410,-32469,-4435,-32466,-4460,-32463,-4485,-32459,-4510,-32456,-4535,-32452,-4560,-32449,-4585,-32445,-4609,-32442,-4634,-32438,-4659,-32435,-4684,-32431,-4709,-32427,-4734,-32424,-4759,-32420,-4784,-32417,-4808,-32413,-4833,-32409,-4858,-32405,-4883,-32402,-4908,-32398,-4933,-32394,-4958,-32390,-4982,-32387,-5007,-32383,-5032,-32379,-5057,-32375,-5082,-32371,-5107,-32367,-5131,-32363,-5156,-32359,-5181,-32355,-5206,-32351,-5231,-32347,-5255,-32343,-5280,-32339,-5305,-32335,-5330,-32331,-5355,-32327,-5379,-32323,-5404,-32319,-5429,-32315,-5454,-32311,-5479,-32306,-5503,-32302,-5528,-32298,-5553,-32294,-5578,-32289,-5602,-32285,-5627,-32281,-5652,-32276,-5677,-32272,-5701,-32268,-5726,-32263,-5751,-32259,-5776,-32255,-5800,-32250,-5825,-32246,-5850,-32241,-5875,-32237,-5899,-32232,-5924,-32228,-5949,-32223,-5973,-32219,-5998,-32214,-6023,-32209,-6048,-32205,-6072,-32200,-6097,-32195,-6122,-32191,-6146,-32186,-6171,-32181,-6196,-32177,-6220,-32172,-6245,-32167,-6270,-32162,-6294,-32157,-6319,-32153,-6344,-32148,-6368,-32143,-6393,-32138,-6418,-32133,-6442,-32128,-6467,-32123,-6492,-32118,-6516,-32113,-6541,-32108,-6565,-32103,-6590,-32098,-6615,-32093,-6639,-32088,-6664,-32083,-6689,-32078,-6713,-32073,-6738,-32067,-6762,-32062,-6787,-32057,-6812,-32052,-6836,-32047,-6861,-32041,-6885,-32036,-6910,-32031,-6934,-32025,-6959,-32020,-6983,-32015,-7008,-32009,-7033,-32004,-7057,-31999,-7082,-31993,-7106,-31988,-7131,-31982,-7155,-31977,-7180,-31971,-7204,-31966,-7229,-31960,-7253,-31955,-7278,-31949,-7302,-31944,-7327,-31938,-7351,-31932,-7376,-31927,-7400,-31921,-7425,-31915,-7449,-31910,-7474,-31904,-7498,-31898,-7523,-31892,-7547,-31887,-7572,-31881,-7596,-31875,-7620,-31869,-7645,-31863,-7669,-31857,-7694,-31852,-7718,-31846,-7743,-31840,-7767,-31834,-7791,-31828,-7816,-31822,-7840,-31816,-7865,-31810,-7889,-31804,-7913,-31798,-7938,-31792,-7962,-31786,-7987,-31779,-8011,-31773,-8035,-31767,-8060,-31761,-8084,-31755,-8108,-31749,-8133,-31742,-8157,-31736,-8181,-31730,-8206,-31724,-8230,-31717,-8254,-31711,-8279,-31705,-8303,-31698,-8327,-31692,-8352,-31685,-8376,-31679,-8400,-31673,-8425,-31666,-8449,-31660,-8473,-31653,-8497,-31647,-8522,-31640,-8546,-31634,-8570,-31627,-8594,-31620,-8619,-31614,-8643,-31607,-8667,-31601,-8691,-31594,-8716,-31587,-8740,-31581,-8764,-31574,-8788,-31567,-8813,-31560,-8837,-31554,-8861,-31547,-8885,-31540,-8909,-31533,-8933,-31526,-8958,-31519,-8982,-31513,-9006,-31506,-9030,-31499,-9054,-31492,-9078,-31485,-9103,-31478,-9127,-31471,-9151,-31464,-9175,-31457,-9199,-31450,-9223,-31443,-9247,-31436,-9271,-31429,-9296,-31421,-9320,-31414,-9344,-31407,-9368,-31400,-9392,-31393,-9416,-31386,-9440,-31378,-9464,-31371,-9488,-31364,-9512,-31357,-9536,-31349,-9560,-31342,-9584,-31335,-9608,-31327,-9632,-31320,-9656,-31312,-9680,-31305,-9704,-31298,-9728,-31290,-9752,-31283,-9776,-31275,-9800,-31268,-9824,-31260,-9848,-31253,-9872,-31245,-9896,-31237,-9920,-31230,-9944,-31222,-9968,-31215,-9992,-31207,-10016,-31199,-10040,-31192,-10064,-31184,-10088,-31176,-10112,-31168,-10136,-31161,-10160,-31153,-10183,-31145,-10207,-31137,-10231,-31129,-10255,-31122,-10279,-31114,-10303,-31106,-10327,-31098,-10350,-31090,-10374,-31082,-10398,-31074,-10422,-31066,-10446,-31058,-10470,-31050,-10493,-31042,-10517,-31034,-10541,-31026,-10565,-31018,-10589,-31010,-10612,-31002,-10636,-30993,-10660,-30985,-10684,-30977,-10707,-30969,-10731,-30961,-10755,-30952,-10779,-30944,-10802,-30936,-10826,-30928,-10850,-30919,-10874,-30911,-10897,-30903,-10921,-30894,-10945,-30886,-10968,-30877,-10992,-30869,-11016,-30861,-11039,-30852,-11063,-30844,-11087,-30835,-11110,-30827,-11134,-30818,-11158,-30810,-11181,-30801,-11205,-30792,-11228,-30784,-11252,-30775,-11276,-30767,-11299,-30758,-11323,-30749,-11346,-30740,-11370,-30732,-11394,-30723,-11417,-30714,-11441,-30706,-11464,-30697,-11488,-30688,-11511,-30679,-11535,-30670,-11558,-30661,-11582,-30653,-11605,-30644,-11629,-30635,-11652,-30626,-11676,-30617,-11699,-30608,-11723,-30599,-11746,-30590,-11770,-30581,-11793,-30572,-11817,-30563,-11840,-30554,-11863,-30545,-11887,-30536,-11910,-30526,-11934,-30517,-11957,-30508,-11981,-30499,-12004,-30490,-12027,-30481,-12051,-30471,-12074,-30462,-12097,-30453,-12121,-30443,-12144,-30434,-12167,-30425,-12191,-30416,-12214,-30406,-12237,-30397,-12261,-30387,-12284,-30378,-12307,-30369,-12331,-30359,-12354,-30350,-12377,-30340,-12400,-30331,-12424,-30321,-12447,-30312,-12470,-30302,-12493,-30292,-12517,-30283,-12540,-30273,-12563,-30264,-12586,-30254,-12610,-30244,-12633,-30235,-12656,-30225,-12679,-30215,-12702,-30206,-12725,-30196,-12749,-30186,-12772,-30176,-12795,-30166,-12818,-30157,-12841,-30147,-12864,-30137,-12887,-30127,-12910,-30117,-12934,-30107,-12957,-30097,-12980,-30087,-13003,-30077,-13026,-30067,-13049,-30057,-13072,-30047,-13095,-30037,-13118,-30027,-13141,-30017,-13164,-30007,-13187,-29997,-13210,-29987,-13233,-29977,-13256,-29967,-13279,-29956,-13302,-29946,-13325,-29936,-13348,-29926,-13371,-29916,-13394,-29905,-13417,-29895,-13440,-29885,-13463,-29874,-13486,-29864,-13508,-29854,-13531,-29843,-13554,-29833,-13577,-29823,-13600,-29812,-13623,-29802,-13646,-29791,-13668,-29781,-13691,-29770,-13714,-29760,-13737,-29749,-13760,-29739,-13783,-29728,-13805,-29718,-13828,-29707,-13851,-29696,-13874,-29686,-13896,-29675,-13919,-29664,-13942,-29654,-13965,-29643,-13987,-29632,-14010,-29622,-14033,-29611,-14056,-29600,-14078,-29589,-14101,-29578,-14124,-29568,-14146,-29557,-14169,-29546,-14192,-29535,-14214,-29524,-14237,-29513,-14260,-29502,-14282,-29491,-14305,-29480,-14327,-29469,-14350,-29458,-14373,-29447,-14395,-29436,-14418,-29425,-14440,-29414,-14463,-29403,-14485,-29392,-14508,-29381,-14531,-29370,-14553,-29359,-14576,-29347,-14598,-29336,-14621,-29325,-14643,-29314,-14666,-29303,-14688,-29291,-14710,-29280,-14733,-29269,-14755,-29257,-14778,-29246,-14800,-29235,-14823,-29223,-14845,-29212,-14867,-29201,-14890,-29189,-14912,-29178,-14935,-29166,-14957,-29155,-14979,-29143,-15002,-29132,-15024,-29120,-15046,-29109,-15069,-29097,-15091,-29086,-15113,-29074,-15136,-29063,-15158,-29051,-15180,-29039,-15202,-29028,-15225,-29016,-15247,-29004,-15269,-28993,-15291,-28981,-15314,-28969,-15336,-28957,-15358,-28946,-15380,-28934,-15402,-28922,-15425,-28910,-15447,-28898,-15469,-28887,-15491,-28875,-15513,-28863,-15535,-28851,-15557,-28839,-15580,-28827,-15602,-28815,-15624,-28803,-15646,-28791,-15668,-28779,-15690,-28767,-15712,-28755,-15734,-28743,-15756,-28731,-15778,-28719,-15800,-28707,-15822,-28695,-15844,-28682,-15866,-28670,-15888,-28658,-15910,-28646,-15932,-28634,-15954,-28621,-15976,-28609,-15998,-28597,-16020,-28585,-16042,-28572,-16064,-28560,-16086,-28548,-16108,-28535,-16129,-28523,-16151,-28511,-16173,-28498,-16195,-28486,-16217,-28473,-16239,-28461,-16261,-28448,-16282,-28436,-16304,-28424,-16326,-28411,-16348,-28398,-16369,-28386,-16391,-28373,-16413,-28361,-16435,-28348,-16456,-28336,-16478,-28323,-16500,-28310,-16522,-28298,-16543,-28285,-16565,-28272,-16587,-28260,-16608,-28247,-16630,-28234,-16652,-28221,-16673,-28209,-16695,-28196,-16717,-28183,-16738,-28170,-16760,-28157,-16781,-28144,-16803,-28132,-16825,-28119,-16846,-28106,-16868,-28093,-16889,-28080,-16911,-28067,-16932,-28054,-16954,-28041,-16975,-28028,-16997,-28015,-17018,-28002,-17040,-27989,-17061,-27976,-17083,-27963,-17104,-27949,-17125,-27936,-17147,-27923,-17168,-27910,-17190,-27897,-17211,-27884,-17233,-27870,-17254,-27857,-17275,-27844,-17297,-27831,-17318,-27817,-17339,-27804,-17361,-27791,-17382,-27778,-17403,-27764,-17424,-27751,-17446,-27737,-17467,-27724,-17488,-27711,-17510,-27697,-17531,-27684,-17552,-27670,-17573,-27657,-17594,-27643,-17616,-27630,-17637,-27616,-17658,-27603,-17679,-27589,-17700,-27576,-17721,-27562,-17743,-27549,-17764,-27535,-17785,-27521,-17806,-27508,-17827,-27494,-17848,-27480,-17869,-27467,-17890,-27453,-17911,-27439,-17932,-27425,-17953,-27412,-17974,-27398,-17995,-27384,-18016,-27370,-18037,-27356,-18058,-27343,-18079,-27329,-18100,-27315,-18121,-27301,-18142,-27287,-18163,-27273,-18184,-27259,-18205,-27245,-18226,-27231,-18247,-27217,-18268,-27203,-18288,-27189,-18309,-27175,-18330,-27161,-18351,-27147,-18372,-27133,-18393,-27119,-18413,-27105,-18434,-27091,-18455,-27077,-18476,-27062,-18496,-27048,-18517,-27034,-18538,-27020,-18559,-27006,-18579,-26991,-18600,-26977,-18621,-26963,-18641,-26949,-18662,-26934,-18683,-26920,-18703,-26906,-18724,-26891,-18745,-26877,-18765,-26862,-18786,-26848,-18806,-26834,-18827,-26819,-18847,-26805,-18868,-26790,-18889,-26776,-18909,-26761,-18930,-26747,-18950,-26732,-18971,-26718,-18991,-26703,-19012,-26689,-19032,-26674,-19052,-26659,-19073,-26645,-19093,-26630,-19114,-26616,-19134,-26601,-19155,-26586,-19175,-26571,-19195,-26557,-19216,-26542,-19236,-26527,-19256,-26513,-19277,-26498,-19297,-26483,-19317,-26468,-19338,-26453,-19358,-26438,-19378,-26424,-19398,-26409,-19419,-26394,-19439,-26379,-19459,-26364,-19479,-26349,-19500,-26334,-19520,-26319,-19540,-26304,-19560,-26289,-19580,-26274,-19600,-26259,-19621,-26244,-19641,-26229,-19661,-26214,-19681,-26199,-19701,-26184,-19721,-26169,-19741,-26154,-19761,-26138,-19781,-26123,-19801,-26108,-19821,-26093,-19841,-26078,-19861,-26062,-19881,-26047,-19901,-26032,-19921,-26017,-19941,-26001,-19961,-25986,-19981,-25971,-20001,-25955,-20021,-25940,-20041,-25925,-20061,-25909,-20080,-25894,-20100,-25879,-20120,-25863,-20140,-25848,-20160,-25832,-20180,-25817,-20199,-25801,-20219,-25786,-20239,-25770,-20259,-25755,-20278,-25739,-20298,-25724,-20318,-25708,-20338,-25692,-20357,-25677,-20377,-25661,-20397,-25646,-20416,-25630,-20436,-25614,-20456,-25599,-20475,-25583,-20495,-25567,-20514,-25551,-20534,-25536,-20554,-25520,-20573,-25504,-20593,-25488,-20612,-25473,-20632,-25457,-20651,-25441,-20671,-25425,-20690,-25409,-20710,-25393,-20729,-25377,-20749,-25362,-20768,-25346,-20788,-25330,-20807,-25314,-20826,-25298,-20846,-25282,-20865,-25266,-20885,-25250,-20904,-25234,-20923,-25218,-20943,-25202,-20962,-25186,-20981,-25170,-21001,-25153,-21020,-25137,-21039,-25121,-21058,-25105,-21078,-25089,-21097,-25073,-21116,-25057,-21135,-25040,-21155,-25024,-21174,-25008,-21193,-24992,-21212,-24975,-21231,-24959,-21250,-24943,-21269,-24927,-21289,-24910,-21308,-24894,-21327,-24878,-21346,-24861,-21365,-24845,-21384,-24828,-21403,-24812,-21422,-24796,-21441,-24779,-21460,-24763,-21479,-24746,-21498,-24730,-21517,-24713,-21536,-24697,-21555,-24680,-21574,-24664,-21593,-24647,-21612,-24631,-21630,-24614,-21649,-24597,-21668,-24581,-21687,-24564,-21706,-24547,-21725,-24531,-21744,-24514,-21762,-24497,-21781,-24481,-21800,-24464,-21819,-24447,-21837,-24431,-21856,-24414,-21875,-24397,-21894,-24380,-21912,-24363,-21931,-24347,-21950,-24330,-21968,-24313,-21987,-24296,-22005,-24279,-22024,-24262,-22043,-24245,-22061,-24229,-22080,-24212,-22098,-24195,-22117,-24178,-22136,-24161,-22154,-24144,-22173,-24127,-22191,-24110,-22210,-24093,-22228,-24076,-22246,-24059,-22265,-24042,-22283,-24024,-22302,-24007,-22320,-23990,-22339,-23973,-22357,-23956,-22375,-23939,-22394,-23922,-22412,-23904,-22430,-23887,-22449,-23870,-22467,-23853,-22485,-23836,-22504,-23818,-22522,-23801,-22540,-23784,-22558,-23767,-22576,-23749,-22595,-23732,-22613,-23715,-22631,-23697,-22649,-23680,-22667,-23662,-22686,-23645,-22704,-23628,-22722,-23610,-22740,-23593,-22758,-23575,-22776,-23558,-22794,-23540,-22812,-23523,-22830,-23505,-22848,-23488,-22866,-23470,-22884,-23453,-22902,-23435,-22920,-23418,-22938,-23400,-22956,-23383,-22974,-23365,-22992,-23347,-23010,-23330,-23028,-23312,-23046,-23294,-23063,-23277,-23081,-23259,-23099,-23241,-23117,-23224,-23135,-23206,-23152,-23188,-23170,-23170,-23188,-23152,-23206,-23135,-23224,-23117,-23241,-23099,-23259,-23081,-23277,-23063,-23294,-23046,-23312,-23028,-23330,-23010,-23347,-22992,-23365,-22974,-23383,-22956,-23400,-22938,-23418,-22920,-23435,-22902,-23453,-22884,-23470,-22866,-23488,-22848,-23505,-22830,-23523,-22812,-23540,-22794,-23558,-22776,-23575,-22758,-23593,-22740,-23610,-22722,-23628,-22704,-23645,-22686,-23662,-22667,-23680,-22649,-23697,-22631,-23715,-22613,-23732,-22595,-23749,-22576,-23767,-22558,-23784,-22540,-23801,-22522,-23818,-22504,-23836,-22485,-23853,-22467,-23870,-22449,-23887,-22430,-23904,-22412,-23922,-22394,-23939,-22375,-23956,-22357,-23973,-22339,-23990,-22320,-24007,-22302,-24024,-22283,-24042,-22265,-24059,-22246,-24076,-22228,-24093,-22210,-24110,-22191,-24127,-22173,-24144,-22154,-24161,-22136,-24178,-22117,-24195,-22098,-24212,-22080,-24229,-22061,-24245,-22043,-24262,-22024,-24279,-22005,-24296,-21987,-24313,-21968,-24330,-21950,-24347,-21931,-24363,-21912,-24380,-21894,-24397,-21875,-24414,-21856,-24431,-21837,-24447,-21819,-24464,-21800,-24481,-21781,-24497,-21762,-24514,-21744,-24531,-21725,-24547,-21706,-24564,-21687,-24581,-21668,-24597,-21649,-24614,-21630,-24631,-21612,-24647,-21593,-24664,-21574,-24680,-21555,-24697,-21536,-24713,-21517,-24730,-21498,-24746,-21479,-24763,-21460,-24779,-21441,-24796,-21422,-24812,-21403,-24828,-21384,-24845,-21365,-24861,-21346,-24878,-21327,-24894,-21308,-24910,-21289,-24927,-21269,-24943,-21250,-24959,-21231,-24975,-21212,-24992,-21193,-25008,-21174,-25024,-21155,-25040,-21135,-25057,-21116,-25073,-21097,-25089,-21078,-25105,-21058,-25121,-21039,-25137,-21020,-25153,-21001,-25170,-20981,-25186,-20962,-25202,-20943,-25218,-20923,-25234,-20904,-25250,-20885,-25266,-20865,-25282,-20846,-25298,-20826,-25314,-20807,-25330,-20788,-25346,-20768,-25362,-20749,-25377,-20729,-25393,-20710,-25409,-20690,-25425,-20671,-25441,-20651,-25457,-20632,-25473,-20612,-25488,-20593,-25504,-20573,-25520,-20554,-25536,-20534,-25551,-20514,-25567,-20495,-25583,-20475,-25599,-20456,-25614,-20436,-25630,-20416,-25646,-20397,-25661,-20377,-25677,-20357,-25692,-20338,-25708,-20318,-25724,-20298,-25739,-20278,-25755,-20259,-25770,-20239,-25786,-20219,-25801,-20199,-25817,-20180,-25832,-20160,-25848,-20140,-25863,-20120,-25879,-20100,-25894,-20080,-25909,-20061,-25925,-20041,-25940,-20021,-25955,-20001,-25971,-19981,-25986,-19961,-26001,-19941,-26017,-19921,-26032,-19901,-26047,-19881,-26062,-19861,-26078,-19841,-26093,-19821,-26108,-19801,-26123,-19781,-26138,-19761,-26154,-19741,-26169,-19721,-26184,-19701,-26199,-19681,-26214,-19661,-26229,-19641,-26244,-19621,-26259,-19600,-26274,-19580,-26289,-19560,-26304,-19540,-26319,-19520,-26334,-19500,-26349,-19479,-26364,-19459,-26379,-19439,-26394,-19419,-26409,-19398,-26424,-19378,-26438,-19358,-26453,-19338,-26468,-19317,-26483,-19297,-26498,-19277,-26513,-19256,-26527,-19236,-26542,-19216,-26557,-19195,-26571,-19175,-26586,-19155,-26601,-19134,-26616,-19114,-26630,-19093,-26645,-19073,-26659,-19052,-26674,-19032,-26689,-19012,-26703,-18991,-26718,-18971,-26732,-18950,-26747,-18930,-26761,-18909,-26776,-18889,-26790,-18868,-26805,-18847,-26819,-18827,-26834,-18806,-26848,-18786,-26862,-18765,-26877,-18745,-26891,-18724,-26906,-18703,-26920,-18683,-26934,-18662,-26949,-18641,-26963,-18621,-26977,-18600,-26991,-18579,-27006,-18559,-27020,-18538,-27034,-18517,-27048,-18496,-27062,-18476,-27077,-18455,-27091,-18434,-27105,-18413,-27119,-18393,-27133,-18372,-27147,-18351,-27161,-18330,-27175,-18309,-27189,-18288,-27203,-18268,-27217,-18247,-27231,-18226,-27245,-18205,-27259,-18184,-27273,-18163,-27287,-18142,-27301,-18121,-27315,-18100,-27329,-18079,-27343,-18058,-27356,-18037,-27370,-18016,-27384,-17995,-27398,-17974,-27412,-17953,-27425,-17932,-27439,-17911,-27453,-17890,-27467,-17869,-27480,-17848,-27494,-17827,-27508,-17806,-27521,-17785,-27535,-17764,-27549,-17743,-27562,-17721,-27576,-17700,-27589,-17679,-27603,-17658,-27616,-17637,-27630,-17616,-27643,-17594,-27657,-17573,-27670,-17552,-27684,-17531,-27697,-17510,-27711,-17488,-27724,-17467,-27737,-17446,-27751,-17424,-27764,-17403,-27778,-17382,-27791,-17361,-27804,-17339,-27817,-17318,-27831,-17297,-27844,-17275,-27857,-17254,-27870,-17233,-27884,-17211,-27897,-17190,-27910,-17168,-27923,-17147,-27936,-17125,-27949,-17104,-27963,-17083,-27976,-17061,-27989,-17040,-28002,-17018,-28015,-16997,-28028,-16975,-28041,-16954,-28054,-16932,-28067,-16911,-28080,-16889,-28093,-16868,-28106,-16846,-28119,-16825,-28132,-16803,-28144,-16781,-28157,-16760,-28170,-16738,-28183,-16717,-28196,-16695,-28209,-16673,-28221,-16652,-28234,-16630,-28247,-16608,-28260,-16587,-28272,-16565,-28285,-16543,-28298,-16522,-28310,-16500,-28323,-16478,-28336,-16456,-28348,-16435,-28361,-16413,-28373,-16391,-28386,-16369,-28398,-16348,-28411,-16326,-28424,-16304,-28436,-16282,-28448,-16261,-28461,-16239,-28473,-16217,-28486,-16195,-28498,-16173,-28511,-16151,-28523,-16129,-28535,-16108,-28548,-16086,-28560,-16064,-28572,-16042,-28585,-16020,-28597,-15998,-28609,-15976,-28621,-15954,-28634,-15932,-28646,-15910,-28658,-15888,-28670,-15866,-28682,-15844,-28695,-15822,-28707,-15800,-28719,-15778,-28731,-15756,-28743,-15734,-28755,-15712,-28767,-15690,-28779,-15668,-28791,-15646,-28803,-15624,-28815,-15602,-28827,-15580,-28839,-15557,-28851,-15535,-28863,-15513,-28875,-15491,-28887,-15469,-28898,-15447,-28910,-15425,-28922,-15402,-28934,-15380,-28946,-15358,-28957,-15336,-28969,-15314,-28981,-15291,-28993,-15269,-29004,-15247,-29016,-15225,-29028,-15202,-29039,-15180,-29051,-15158,-29063,-15136,-29074,-15113,-29086,-15091,-29097,-15069,-29109,-15046,-29120,-15024,-29132,-15002,-29143,-14979,-29155,-14957,-29166,-14935,-29178,-14912,-29189,-14890,-29201,-14867,-29212,-14845,-29223,-14823,-29235,-14800,-29246,-14778,-29257,-14755,-29269,-14733,-29280,-14710,-29291,-14688,-29303,-14666,-29314,-14643,-29325,-14621,-29336,-14598,-29347,-14576,-29359,-14553,-29370,-14531,-29381,-14508,-29392,-14485,-29403,-14463,-29414,-14440,-29425,-14418,-29436,-14395,-29447,-14373,-29458,-14350,-29469,-14327,-29480,-14305,-29491,-14282,-29502,-14260,-29513,-14237,-29524,-14214,-29535,-14192,-29546,-14169,-29557,-14146,-29568,-14124,-29578,-14101,-29589,-14078,-29600,-14056,-29611,-14033,-29622,-14010,-29632,-13987,-29643,-13965,-29654,-13942,-29664,-13919,-29675,-13896,-29686,-13874,-29696,-13851,-29707,-13828,-29718,-13805,-29728,-13783,-29739,-13760,-29749,-13737,-29760,-13714,-29770,-13691,-29781,-13668,-29791,-13646,-29802,-13623,-29812,-13600,-29823,-13577,-29833,-13554,-29843,-13531,-29854,-13508,-29864,-13486,-29874,-13463,-29885,-13440,-29895,-13417,-29905,-13394,-29916,-13371,-29926,-13348,-29936,-13325,-29946,-13302,-29956,-13279,-29967,-13256,-29977,-13233,-29987,-13210,-29997,-13187,-30007,-13164,-30017,-13141,-30027,-13118,-30037,-13095,-30047,-13072,-30057,-13049,-30067,-13026,-30077,-13003,-30087,-12980,-30097,-12957,-30107,-12934,-30117,-12910,-30127,-12887,-30137,-12864,-30147,-12841,-30157,-12818,-30166,-12795,-30176,-12772,-30186,-12749,-30196,-12725,-30206,-12702,-30215,-12679,-30225,-12656,-30235,-12633,-30244,-12610,-30254,-12586,-30264,-12563,-30273,-12540,-30283,-12517,-30292,-12493,-30302,-12470,-30312,-12447,-30321,-12424,-30331,-12400,-30340,-12377,-30350,-12354,-30359,-12331,-30369,-12307,-30378,-12284,-30387,-12261,-30397,-12237,-30406,-12214,-30416,-12191,-30425,-12167,-30434,-12144,-30443,-12121,-30453,-12097,-30462,-12074,-30471,-12051,-30481,-12027,-30490,-12004,-30499,-11981,-30508,-11957,-30517,-11934,-30526,-11910,-30536,-11887,-30545,-11863,-30554,-11840,-30563,-11817,-30572,-11793,-30581,-11770,-30590,-11746,-30599,-11723,-30608,-11699,-30617,-11676,-30626,-11652,-30635,-11629,-30644,-11605,-30653,-11582,-30661,-11558,-30670,-11535,-30679,-11511,-30688,-11488,-30697,-11464,-30706,-11441,-30714,-11417,-30723,-11394,-30732,-11370,-30740,-11346,-30749,-11323,-30758,-11299,-30767,-11276,-30775,-11252,-30784,-11228,-30792,-11205,-30801,-11181,-30810,-11158,-30818,-11134,-30827,-11110,-30835,-11087,-30844,-11063,-30852,-11039,-30861,-11016,-30869,-10992,-30877,-10968,-30886,-10945,-30894,-10921,-30903,-10897,-30911,-10874,-30919,-10850,-30928,-10826,-30936,-10802,-30944,-10779,-30952,-10755,-30961,-10731,-30969,-10707,-30977,-10684,-30985,-10660,-30993,-10636,-31002,-10612,-31010,-10589,-31018,-10565,-31026,-10541,-31034,-10517,-31042,-10493,-31050,-10470,-31058,-10446,-31066,-10422,-31074,-10398,-31082,-10374,-31090,-10350,-31098,-10327,-31106,-10303,-31114,-10279,-31122,-10255,-31129,-10231,-31137,-10207,-31145,-10183,-31153,-10160,-31161,-10136,-31168,-10112,-31176,-10088,-31184,-10064,-31192,-10040,-31199,-10016,-31207,-9992,-31215,-9968,-31222,-9944,-31230,-9920,-31237,-9896,-31245,-9872,-31253,-9848,-31260,-9824,-31268,-9800,-31275,-9776,-31283,-9752,-31290,-9728,-31298,-9704,-31305,-9680,-31312,-9656,-31320,-9632,-31327,-9608,-31335,-9584,-31342,-9560,-31349,-9536,-31357,-9512,-31364,-9488,-31371,-9464,-31378,-9440,-31386,-9416,-31393,-9392,-31400,-9368,-31407,-9344,-31414,-9320,-31421,-9296,-31429,-9271,-31436,-9247,-31443,-9223,-31450,-9199,-31457,-9175,-31464,-9151,-31471,-9127,-31478,-9103,-31485,-9078,-31492,-9054,-31499,-9030,-31506,-9006,-31513,-8982,-31519,-8958,-31526,-8933,-31533,-8909,-31540,-8885,-31547,-8861,-31554,-8837,-31560,-8813,-31567,-8788,-31574,-8764,-31581,-8740,-31587,-8716,-31594,-8691,-31601,-8667,-31607,-8643,-31614,-8619,-31620,-8594,-31627,-8570,-31634,-8546,-31640,-8522,-31647,-8497,-31653,-8473,-31660,-8449,-31666,-8425,-31673,-8400,-31679,-8376,-31685,-8352,-31692,-8327,-31698,-8303,-31705,-8279,-31711,-8254,-31717,-8230,-31724,-8206,-31730,-8181,-31736,-8157,-31742,-8133,-31749,-8108,-31755,-8084,-31761,-8060,-31767,-8035,-31773,-8011,-31779,-7987,-31786,-7962,-31792,-7938,-31798,-7913,-31804,-7889,-31810,-7865,-31816,-7840,-31822,-7816,-31828,-7791,-31834,-7767,-31840,-7743,-31846,-7718,-31852,-7694,-31857,-7669,-31863,-7645,-31869,-7620,-31875,-7596,-31881,-7572,-31887,-7547,-31892,-7523,-31898,-7498,-31904,-7474,-31910,-7449,-31915,-7425,-31921,-7400,-31927,-7376,-31932,-7351,-31938,-7327,-31944,-7302,-31949,-7278,-31955,-7253,-31960,-7229,-31966,-7204,-31971,-7180,-31977,-7155,-31982,-7131,-31988,-7106,-31993,-7082,-31999,-7057,-32004,-7033,-32009,-7008,-32015,-6983,-32020,-6959,-32025,-6934,-32031,-6910,-32036,-6885,-32041,-6861,-32047,-6836,-32052,-6812,-32057,-6787,-32062,-6762,-32067,-6738,-32073,-6713,-32078,-6689,-32083,-6664,-32088,-6639,-32093,-6615,-32098,-6590,-32103,-6565,-32108,-6541,-32113,-6516,-32118,-6492,-32123,-6467,-32128,-6442,-32133,-6418,-32138,-6393,-32143,-6368,-32148,-6344,-32153,-6319,-32157,-6294,-32162,-6270,-32167,-6245,-32172,-6220,-32177,-6196,-32181,-6171,-32186,-6146,-32191,-6122,-32195,-6097,-32200,-6072,-32205,-6048,-32209,-6023,-32214,-5998,-32219,-5973,-32223,-5949,-32228,-5924,-32232,-5899,-32237,-5875,-32241,-5850,-32246,-5825,-32250,-5800,-32255,-5776,-32259,-5751,-32263,-5726,-32268,-5701,-32272,-5677,-32276,-5652,-32281,-5627,-32285,-5602,-32289,-5578,-32294,-5553,-32298,-5528,-32302,-5503,-32306,-5479,-32311,-5454,-32315,-5429,-32319,-5404,-32323,-5379,-32327,-5355,-32331,-5330,-32335,-5305,-32339,-5280,-32343,-5255,-32347,-5231,-32351,-5206,-32355,-5181,-32359,-5156,-32363,-5131,-32367,-5107,-32371,-5082,-32375,-5057,-32379,-5032,-32383,-5007,-32387,-4982,-32390,-4958,-32394,-4933,-32398,-4908,-32402,-4883,-32405,-4858,-32409,-4833,-32413,-4808,-32417,-4784,-32420,-4759,-32424,-4734,-32427,-4709,-32431,-4684,-32435,-4659,-32438,-4634,-32442,-4609,-32445,-4585,-32449,-4560,-32452,-4535,-32456,-4510,-32459,-4485,-32463,-4460,-32466,-4435,-32469,-4410,-32473,-4385,-32476,-4360,-32479,-4336,-32483,-4311,-32486,-4286,-32489,-4261,-32493,-4236,-32496,-4211,-32499,-4186,-32502,-4161,-32505,-4136,-32509,-4111,-32512,-4086,-32515,-4061,-32518,-4036,-32521,-4012,-32524,-3987,-32527,-3962,-32530,-3937,-32533,-3912,-32536,-3887,-32539,-3862,-32542,-3837,-32545,-3812,-32548,-3787,-32551,-3762,-32554,-3737,-32557,-3712,-32559,-3687,-32562,-3662,-32565,-3637,-32568,-3612,-32571,-3587,-32573,-3562,-32576,-3537,-32579,-3512,-32581,-3487,-32584,-3462,-32587,-3437,-32589,-3412,-32592,-3387,-32595,-3362,-32597,-3337,-32600,-3312,-32602,-3287,-32605,-3262,-32607,-3237,-32610,-3212,-32612,-3187,-32615,-3162,-32617,-3137,-32619,-3112,-32622,-3087,-32624,-3062,-32626,-3037,-32629,-3012,-32631,-2987,-32633,-2962,-32636,-2937,-32638,-2912,-32640,-2887,-32642,-2862,-32645,-2837,-32647,-2812,-32649,-2787,-32651,-2762,-32653,-2737,-32655,-2712,-32657,-2687,-32659,-2662,-32661,-2637,-32663,-2611,-32665,-2586,-32667,-2561,-32669,-2536,-32671,-2511,-32673,-2486,-32675,-2461,-32677,-2436,-32679,-2411,-32681,-2386,-32682,-2361,-32684,-2336,-32686,-2311,-32688,-2286,-32689,-2261,-32691,-2236,-32693,-2210,-32695,-2185,-32696,-2160,-32698,-2135,-32700,-2110,-32701,-2085,-32703,-2060,-32704,-2035,-32706,-2010,-32707,-1985,-32709,-1960,-32710,-1935,-32712,-1909,-32713,-1884,-32715,-1859,-32716,-1834,-32718,-1809,-32719,-1784,-32720,-1759,-32722,-1734,-32723,-1709,-32724,-1684,-32726,-1659,-32727,-1633,-32728,-1608,-32729,-1583,-32730,-1558,-32732,-1533,-32733,-1508,-32734,-1483,-32735,-1458,-32736,-1433,-32737,-1407,-32738,-1382,-32739,-1357,-32740,-1332,-32741,-1307,-32742,-1282,-32743,-1257,-32744,-1232,-32745,-1207,-32746,-1181,-32747,-1156,-32748,-1131,-32749,-1106,-32750,-1081,-32751,-1056,-32751,-1031,-32752,-1006,-32753,-981,-32754,-955,-32754,-930,-32755,-905,-32756,-880,-32756,-855,-32757,-830,-32758,-805,-32758,-780,-32759,-754,-32759,-729,-32760,-704,-32760,-679,-32761,-654,-32761,-629,-32762,-604,-32762,-579,-32763,-553,-32763,-528,-32764,-503,-32764,-478,-32764,-453,-32765,-428,-32765,-403,-32765,-377,-32766,-352,-32766,-327,-32766,-302,-32766,-277,-32767,-252,-32767,-227,-32767,-202,-32767,-176,-32767,-151,-32767,-126,-32767,-101,-32767,-76,-32767,-51,-32767,-26};
diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h
index 89c0afe230f3a04920fb845c3ccd9937c1a0025d..6551640f48ede8d7aa3040ab5d0150077f8f6c30 100755
--- a/openair1/PHY/defs.h
+++ b/openair1/PHY/defs.h
@@ -65,10 +65,12 @@
 //use msg in the real-time thread context
 #define msg_nrt printf
 //use msg_nrt in the non real-time context (for initialization, ...)
-#ifdef __AVX2__
-#define malloc16(x) memalign(32,x)
-#else
-#define malloc16(x) memalign(16,x)
+#ifndef malloc16
+#  ifdef __AVX2__
+#    define malloc16(x) memalign(32,x)
+#  else
+#    define malloc16(x) memalign(16,x)
+#  endif
 #endif
 #define free16(y,x) free(y)
 #define bigmalloc malloc
@@ -76,6 +78,13 @@
 #define openair_free(y,x) free((y))
 #define PAGE_SIZE 4096
 
+//#ifdef SHRLIBDEV
+//extern int rxrescale;
+//#define RX_IQRESCALELEN rxrescale
+//#else
+//#define RX_IQRESCALELEN 15
+//#endif
+
 //! \brief Allocate \c size bytes of memory on the heap with alignment 16 and zero it afterwards.
 //! If no more memory is available, this function will terminate the program with an assertion error.
 static inline void* malloc16_clear( size_t size )
@@ -113,7 +122,6 @@ static inline void* malloc16_clear( size_t size )
 #define UNUSED(x) (void)x;
 
 
-#include "spec_defs_top.h"
 #include "impl_defs_top.h"
 #include "impl_defs_lte.h"
 
@@ -288,6 +296,9 @@ typedef struct PHY_VARS_eNB_s {
   int              **dl_precoder_SeNB[3];
   char             log2_maxp; /// holds the maximum channel/precoder coefficient
 
+  /// if ==0 enables phy only test mode
+  int mac_enabled;
+
   /// For emulation only (used by UE abstraction to retrieve DCI)
   uint8_t num_common_dci[2];                         // num_dci in even/odd subframes
   uint8_t num_ue_spec_dci[2];                         // num_dci in even/odd subframes
@@ -330,6 +341,8 @@ typedef struct PHY_VARS_eNB_s {
   struct PhysicalConfigDedicated *physicalConfigDedicated[NUMBER_OF_UE_MAX];
 
 
+  uint32_t rb_mask_ul[4];
+
   /// Information regarding TM5
   MU_MIMO_mode mu_mimo_mode[NUMBER_OF_UE_MAX];
 
@@ -391,13 +404,18 @@ typedef struct PHY_VARS_eNB_s {
 #ifdef LOCALIZATION
   /// time state for localization
   time_stats_t localization_stats;
-#endif
+#endif 
 
   int32_t pucch1_stats_cnt[NUMBER_OF_UE_MAX][10];
   int32_t pucch1_stats[NUMBER_OF_UE_MAX][10*1024];
+  int32_t pucch1_stats_thres[NUMBER_OF_UE_MAX][10*1024];
   int32_t pucch1ab_stats_cnt[NUMBER_OF_UE_MAX][10];
-  int32_t pucch1ab_stats[NUMBER_OF_UE_MAX][10*1024];
-
+  int32_t pucch1ab_stats[NUMBER_OF_UE_MAX][2*10*1024];
+  int32_t pusch_stats_rb[NUMBER_OF_UE_MAX][10240];
+  int32_t pusch_stats_round[NUMBER_OF_UE_MAX][10240];
+  int32_t pusch_stats_mcs[NUMBER_OF_UE_MAX][10240];
+  int32_t pusch_stats_bsr[NUMBER_OF_UE_MAX][10240];
+  int32_t pusch_stats_BO[NUMBER_OF_UE_MAX][10240];
 #if ENABLE_RAL
   hash_table_t    *ral_thresholds_timed;
   SLIST_HEAD(ral_thresholds_gen_poll_enb_s, ral_threshold_phy_t) ral_thresholds_gen_polled[RAL_LINK_PARAM_GEN_MAX];
@@ -586,6 +604,9 @@ typedef struct {
   /// holds the maximum channel/precoder coefficient
   char             log2_maxp;
 
+  /// if ==0 enables phy only test mode
+  int mac_enabled;
+
   /// Flag to initialize averaging of PHY measurements
   int init_averaging;
 
diff --git a/openair1/PHY/extern.h b/openair1/PHY/extern.h
index a7450e3e21cf14eec465082758db07d2c218d200..4c9e2706c78a6055a72546c6c7d102bf87399b98 100755
--- a/openair1/PHY/extern.h
+++ b/openair1/PHY/extern.h
@@ -30,7 +30,7 @@
 #define __PHY_EXTERN_H__
 
 #include "PHY/defs.h"
-
+#include "PHY_INTERFACE/defs.h"
 
 extern  char* namepointer_chMag ;
 extern char* namepointer_log2;
@@ -39,10 +39,7 @@ extern  char fmageren_name2[512];
 extern unsigned int RX_DMA_BUFFER[4][NB_ANTENNAS_RX];
 extern unsigned int TX_DMA_BUFFER[4][NB_ANTENNAS_TX];
 
-#ifdef OPENAIR_LTE
 #include "PHY/LTE_TRANSPORT/extern.h"
-#include "MAC_INTERFACE/defs.h"
-#include "MAC_INTERFACE/extern.h"
 #include "SIMULATION/ETH_TRANSPORT/extern.h"
 
 extern unsigned int DAQ_MBOX;
@@ -56,6 +53,7 @@ extern PHY_VARS_eNB ***PHY_vars_eNB_g;
 extern PHY_VARS_RN **PHY_vars_RN_g;
 extern LTE_DL_FRAME_PARMS *lte_frame_parms_g;
 
+extern MAC_xface *mac_xface;
 
 
 extern short primary_synch0[144];
@@ -78,7 +76,6 @@ extern char mode_string[4][20];
 
 #include "PHY/LTE_TRANSPORT/extern.h"
 
-#endif
 
 #ifndef OPENAIR2
 extern unsigned char NB_eNB_INST;
diff --git a/openair1/PHY/impl_defs_lte.h b/openair1/PHY/impl_defs_lte.h
index be087b95feec1f8bcd3659482c3e3faffed82e51..481d30c92de5bc510352c4dc6bd31685dbeab4ee 100644
--- a/openair1/PHY/impl_defs_lte.h
+++ b/openair1/PHY/impl_defs_lte.h
@@ -43,7 +43,6 @@
 
 
 #include "types.h"
-#include "spec_defs_top.h"
 //#include "defs.h"
 
 #define LTE_NUMBER_OF_SUBFRAMES_PER_FRAME 10
@@ -529,10 +528,10 @@ typedef struct {
   uint8_t dual_tx;
   /// flag to indicate SISO transmission
   uint8_t mode1_flag;
+  /// Indicator that 20 MHz channel uses 3/4 sampling frequency
+  uint8_t threequarter_fs;
   /// Size of FFT
   uint16_t ofdm_symbol_size;
-  /// log2(Size of FFT)
-  uint8_t log2_symbol_size;
   /// Number of prefix samples in all but first symbol of slot
   uint16_t nb_prefix_samples;
   /// Number of prefix samples in first symbol of slot
@@ -618,7 +617,7 @@ typedef struct {
   /// - first index: eNB id [0..2] (hard coded)
   /// - second index: tx antenna [0..nb_antennas_tx[
   /// - third index: sample [0..]
-  mod_sym_t **txdataF[3];
+  int32_t **txdataF[3];
   /// \brief Holds the received data in time domain.
   /// Should point to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER.
   /// - first index: eNB id [0..2] (hard coded)
@@ -762,7 +761,7 @@ typedef struct {
   /// For IFFT_FPGA this points to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER.
   /// - first index: tx antenna [0..nb_antennas_tx[
   /// - second index: sample [0..FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX[
-  mod_sym_t **txdataF;
+  int32_t **txdataF;
   /// \brief Holds the received data in time domain.
   /// Should point to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER.
   /// - first index: rx antenna [0..nb_antennas_rx[
diff --git a/openair1/PHY/impl_defs_top.h b/openair1/PHY/impl_defs_top.h
index 5dc038c8f624cda0d9fec4eb711081557ba42cee..499c353df011d5692cc74ee0ed1d9f97945e64bc 100755
--- a/openair1/PHY/impl_defs_top.h
+++ b/openair1/PHY/impl_defs_top.h
@@ -44,7 +44,15 @@
 /** @defgroup _ref_implementation_ OpenAirInterface LTE Implementation
  * @{
 
- * @defgroup _PHY_RF_INTERFACE_ Generic PHY - RF Interface
+ * @defgroup _PHY_RF_INTERFACE_ PHY - RF Interface
+ * @ingroup _PHY_RF_INTERFACE_
+ * @{
+ * @defgroup _GENERIC_PHY_RF_INTERFACE_ Generic PHY - RF Interface
+ * @defgroup _USRP_PHY_RF_INTERFACE_    PHY - USRP RF Interface
+ * @defgroup _BLADERF_PHY_RF_INTERFACE_    PHY - BLADERF RF Interface
+ * @defgroup _LMSSDR_PHY_RF_INTERFACE_    PHY - LMSSDR RF Interface
+ * @}
+ *
  * @ingroup _ref_implementation_
  * @{
  * This module is responsible for defining the generic interface between PHY and RF Target
@@ -108,7 +116,6 @@
  */
 
 #include "types.h"
-#include "spec_defs_top.h"
 
 
 
@@ -117,18 +124,13 @@
 */
 #define NUMBER_OF_OFDM_CARRIERS (frame_parms->ofdm_symbol_size)
 #define NUMBER_OF_SYMBOLS_PER_FRAME (frame_parms->symbols_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME)
-#define LOG2_NUMBER_OF_OFDM_CARRIERS (frame_parms->log2_symbol_size)
 #define NUMBER_OF_USEFUL_CARRIERS (12*frame_parms->N_RB_DL)
 #define NUMBER_OF_ZERO_CARRIERS (NUMBER_OF_OFDM_CARRIERS-NUMBER_OF_USEFUL_CARRIERS)
 #define NUMBER_OF_USEFUL_CARRIERS_BYTES (NUMBER_OF_USEFUL_CARRIERS>>2)
 #define HALF_NUMBER_OF_USEFUL_CARRIERS (NUMBER_OF_USEFUL_CARRIERS>>1)
 #define HALF_NUMBER_OF_USEFUL_CARRIERS_BYTES (HALF_NUMBER_OF_USEFUL_CARRIERS>>2)
 #define FIRST_CARRIER_OFFSET (HALF_NUMBER_OF_USEFUL_CARRIERS+NUMBER_OF_ZERO_CARRIERS)
-#ifdef OPENAIR_LTE
 #define NUMBER_OF_OFDM_SYMBOLS_PER_SLOT (NUMBER_OF_SYMBOLS_PER_FRAME/LTE_SLOTS_PER_FRAME)
-#else
-#define NUMBER_OF_OFDM_SYMBOLS_PER_SLOT 16
-#endif
 
 #ifdef EMOS
 #define EMOS_SCH_INDEX 1
@@ -257,71 +259,11 @@
 #define AMP_OVER_2 (AMP>>1)
 
 /// Threshold for PUCCH Format 1 detection
-#define PUCCH1_THRES 10
+#define PUCCH1_THRES 0
 /// Threshold for PUCCH Format 1a/1b detection
 #define PUCCH1a_THRES 4
 #define PUCCH1b_THRES 4
 
-#ifndef OPENAIR_LTE
-///
-/// PHY-MAC Interface Defs
-///
-
-/// Maximum number of parallel streams per slot
-#define NB_STREAMS_MAX 4
-
-/// Maximum number of frequency groups per slot
-#define NB_GROUPS_MAX 16
-
-/// Maximum number of control bytes per slot
-#define NB_CNTL_BYTES_MAX 8
-
-/// Maximum number of data bytes per slot
-#define NB_DATA_BYTES_MAX 256
-
-#define MAX_NUM_TB 32
-#define MAX_TB_SIZE_BYTES 128
-
-/// Size of SACCH PDU in Bytes
-#define SACCH_SIZE_BYTES (sizeof(UL_SACCH_PDU)+4)
-/// Size of SACCH PDU in Bytes
-#define SACCH_SIZE_BITS  (SACCH_SIZE_BYTES<<3)
-
-#define MAX_SACH_SIZE_BYTES 1024
-
-
-#define SACH_ERROR 1
-#define SACCH_ERROR 2
-#define SACH_MISSING 3
-#define SACH_PARAM_INVALID 10
-
-#endif //OPENAIR_LTE
-
-/*
-enum STATUS_RX {STATUS_RX_OFF,
-    STATUS_RX_ON,
-    STATUS_RX_SYNCING,
-    STATUS_RX_CANNOT_SYNC,
-    STATUS_RX_DATA_PROBLEM,
-    STATUS_RX_LOST_SYNC,
-    STATUS_RX_ABORT,
-    STATUS_RX_TOO_LATE,
-    STATUS_RX_CLOCK_STOPPED};
-
-enum STATUS_TX {
-  STATUS_TX_OFF,
-  STATUS_TX_ON,
-  STATUS_TX_INPUT_CORRUPT,
-  STATUS_TX_ABORT,
-  STATUS_TX_TOO_LATE,
-  STATUS_TX_CLOCK_STOPPED};
-
-enum MODE {
-  SYNCHED,
-  SYNCHING,
-  NOT_SYNCHED};
-*/
-
 /// Data structure for transmission.
 typedef struct {
   /// RAW TX sample buffer
@@ -336,18 +278,25 @@ typedef struct {
   int *RX_DMA_BUFFER[2];
 } TX_RX_VARS;
 
+/*! \brief Extension Type */
+typedef enum {
+  CYCLIC_PREFIX,
+  CYCLIC_SUFFIX,
+  ZEROS,
+  NONE
+} Extension_t;
+	
 /// Measurement Variables
 
 #define NUMBER_OF_SUBBANDS_MAX 13
 #define NUMBER_OF_HARQ_PID_MAX 8
 
-#if defined(CBMIMO1) || defined(EXMIMO) || defined(OAI_USRP)
 #define MAX_FRAME_NUMBER 0x400
+#if defined(CBMIMO1) || defined(EXMIMO) || defined(OAI_USRP)
 #define NUMBER_OF_eNB_MAX 1
-#define NUMBER_OF_UE_MAX 4
+#define NUMBER_OF_UE_MAX 16
 #define NUMBER_OF_CONNECTED_eNB_MAX 3
 #else
-#define MAX_FRAME_NUMBER 0xFFFF
 #ifdef LARGE_SCALE
 #define NUMBER_OF_eNB_MAX 2
 #define NUMBER_OF_UE_MAX 120
@@ -472,13 +421,13 @@ typedef struct {
   //! estimated avg noise power (dB)
   short n0_power_tot_dBm;
   //! estimated avg noise power per RB per RX ant (lin)
-  unsigned short n0_subband_power[NB_ANTENNAS_RX][25];
+  unsigned short n0_subband_power[NB_ANTENNAS_RX][100];
   //! estimated avg noise power per RB per RX ant (dB)
-  unsigned short n0_subband_power_dB[NB_ANTENNAS_RX][25];
+  unsigned short n0_subband_power_dB[NB_ANTENNAS_RX][100];
   //! estimated avg noise power per RB (dB)
-  short n0_subband_power_tot_dB[25];
+  short n0_subband_power_tot_dB[100];
   //! estimated avg noise power per RB (dBm)
-  short n0_subband_power_tot_dBm[25];
+  short n0_subband_power_tot_dBm[100];
   // eNB measurements (per user)
   //! estimated received spatial signal power (linear)
   unsigned int   rx_spatial_power[NUMBER_OF_UE_MAX][2][2];
@@ -498,13 +447,13 @@ typedef struct {
   /// Wideband CQI (sum of all RX antennas, in dB)
   char           wideband_cqi_tot[NUMBER_OF_UE_MAX];
   /// Subband CQI per RX antenna and RB (= SINR)
-  int            subband_cqi[NUMBER_OF_UE_MAX][NB_ANTENNAS_RX][25];
+  int            subband_cqi[NUMBER_OF_UE_MAX][NB_ANTENNAS_RX][100];
   /// Total Subband CQI and RB (= SINR)
-  int            subband_cqi_tot[NUMBER_OF_UE_MAX][25];
+  int            subband_cqi_tot[NUMBER_OF_UE_MAX][100];
   /// Subband CQI in dB and RB (= SINR dB)
-  int            subband_cqi_dB[NUMBER_OF_UE_MAX][NB_ANTENNAS_RX][25];
+  int            subband_cqi_dB[NUMBER_OF_UE_MAX][NB_ANTENNAS_RX][100];
   /// Total Subband CQI and RB
-  int            subband_cqi_tot_dB[NUMBER_OF_UE_MAX][25];
+  int            subband_cqi_tot_dB[NUMBER_OF_UE_MAX][100];
 
 } PHY_MEASUREMENTS_eNB;
 
diff --git a/openair1/PHY/spec_defs.h b/openair1/PHY/spec_defs.h
deleted file mode 100755
index c8a1e86e5e9ce4661d3ea049aa860b2b8fcf15ed..0000000000000000000000000000000000000000
--- a/openair1/PHY/spec_defs.h
+++ /dev/null
@@ -1,745 +0,0 @@
-/*******************************************************************************
-    OpenAirInterface
-    Copyright(c) 1999 - 2014 Eurecom
-
-    OpenAirInterface is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-
-    OpenAirInterface is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with OpenAirInterface.The full GNU General Public License is
-   included in this distribution in the file called "COPYING". If not,
-   see <http://www.gnu.org/licenses/>.
-
-  Contact Information
-  OpenAirInterface Admin: openair_admin@eurecom.fr
-  OpenAirInterface Tech : openair_tech@eurecom.fr
-  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
-
-  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
-
- *******************************************************************************/
-#ifndef __PHY_DEFS_SPEC_H__
-#define __PHY_DEFS_SPEC_H__
-
-#include "types.h"
-
-
-/*! \mainpage OpenAirInterface.org Specifications
-
-\section scope_openair Scope
-
-The present document specifies the architecture of the following components of a OpenAirInterface network
--# \ref _RN_TOPOLOGY_
--# \ref _PHY_PROCEDURES_MESH_
--# \ref _PHY_PROCEDURES_CELL_
--# \ref _L2_PROTOCOLS
-\subsection _RN_TOPOLOGY_ Radio Network Topology and Components
-This section describes the different components which constitute the OpenAirInterface. Two types of network topologies are supported, mesh and cellular.
-The mesh topology is depicted as:
-
-\image html mesh_topology_small.png "OpenAirInterface Mesh Topology" width=5cm
-\image latex mesh_topology.pdf "OpenAirInterface Mesh Topology"
-
-The cellular topology is depicted as:
-
-\image html cellular_topology_small.png "OpenAirInterface Cellular Topology" width=5cm
-\image latex cellular_topology.pdf "OpenAirInterface Cellular Topology"
-
-The mesh topology contains Clusterheads (CH) and Mesh Routers (MR) whereas the cellular topology contains Clusterheads/NodeB (CH/NodeB) and User Equipment (UE).
-The main difference at the physical layer between the two topologies is that direct communications between UE is not permitted in a cellular topology.  Other major
-differences exist at layers 2 and 3.  In both topologies, MR/UE can be connected to more than one CH at any time, if radio connectivity is possible.
-
-The two types of physical networking devices are specified as follows:
-
-- Cluster-head (CH or NodeB): A cluster-head can be defined as a node with a maximum visibility/connectivity in terms of number of nodes in its neighborhood.
-From the point-of-view of the MAC layer, it assumes the fine-grain management of radio resources in the cluster (cell). It determines the frame partitioning
-(see \ref _framing_modulation) and bandwidth allocation and communicates this information to nodes in the cluster through a beacon. At the
-physical layer, the cluster-head provides mechanisms for timing and carrier frequency synchronization. The primary role of the CH is to manage radio resources in their cluster.  The cluster is defined as the set of nodes which are characterized by one-hop connectivity with the clusterhead.  One-hop connectivity is further defined as the capacity to reliably receive and transmit basic signaling channels with the clusterhead using at least at the lowest datarate communication mode. Reliable communication is defined by a transmission which falls below a maximal error probability threshold.
-CH can only be connected to MR on the same frequency-carrier since they use the same temporal resources as other CH.  Thus direct CH<->CH communication is not possible on the same frequency carrier.
-The downlink (CH -> MR) signaling channels allow for the CH to schedule transmission of labels (in the form of time and frequency mappings on the radio resource) which each carry different types of traffic throughout the mesh network.  The Uplink (UL) signaling channels (MR -> CH) are used for relaying bandwidth requirement indicators and channel quality measurements from nodes within the cluster.  These feed the scheduling algorithms residing in the CH and allow for proper resource allocation satisfying quality-of-service (QoS) negotiations carried out using Layer 3 (L3) signaling.
-
-The CH further provides mechanisms for measurement reporting to L3 (for routing, QoS management, labeling, etc...).  This is achieved by a set of signaling channels which relay measurement information (UL) for the nodes in the cluster to the CH.  The CH processes these raw measurements into a form which is expected by L3 mechanisms.
-Some CH can assume the role of network synchronization by sending special synchronization pilots (see Section 1.1.5).  These will be called Primary CH when network synchronization is achieved using this method.  Other CH using this method are called Secondary CH.
-
- - Regular node/Mesh Router (UE): All nodes have the ability to play at the same time the role of a host and of a router, although this functionality is not activated
-in a cellular topology.
-
-The primary role of an MR is to interpret the scheduling information from the CH on the DL signaling channels in order to route the traffic corresponding to the
-scheduled labels on the allocated physical resources.  MR can be connected to other MR (direct link) in the same cluster. MR can also be connected to more than one cluster
-at the same time. It is also expected to using the UL signaling channels to relay measurements to the CH with which is connected.
-A secondary role of some MR is to search, on behalf of the CH, for isolated nodes which need to be connected to the mesh. These MR use a special signaling resource (MRBCH) to
-exchange basic topological parameters with the IN which then results in overall network topology updates.  If several IN are contending for access with the cluster,
-joint processing of the requests will be performed by the mesh during topology adjustments.  The most likely nodes to assume this role will be those at the extremities
-of the mesh.
-
-Either type of equipment can also assume the role of relay/gateway to a secondary network. `
-
-In mesh topologies some nodes (CH or MR) assume the role of and edge router (from a layer 2/3 perspective). An edge router is either a CH or MR with an IP interface to
-another network. The role of ER is to aggregate traffic (ingress) from IP flows to MPLS-like labels for transmission in the mesh.  On reception it must demultiplex
-traffic (degress) from MPLS-like labels to IP for traffic exiting the mesh.  Edge routers, potentially all CH and MR, must have MAC-layer interfaces to IP in order to
-perform these functions.
-
-Both OpenAirInterface topologies require Network Synchronization (NS) at least between adjacent clusters.  This must be on the order of a few microseconds.  Three mechanisms are
-supported to ensure NS.  Firstly, a secondary synchronization source (e.g. GPS) can be used as a common time reference by all nodes.  Secondly, one CH (Primary CH) in the
-network use a special synchronization signal which has longer range than the range of communication, in order to cover the region which a common time reference.  This is
-suitable for small networks.  Finally the method of distributed relaying of synchronization is possible.  This is a method by which all nodes propagate a time reference.  Nodes
-switch between reception (for timing acquisition and tracking) and transmission of the reference. This guarantees coverage of network synchronization over long distances
-in the absence of a secondary synchronization source.
-
-
-\subsection _L2_PROTOCOLS  Layer 2 Protocols
-Layer 2 is structured as below. It comprises:
-- A IP/MPLS networking device (NAS DRIVER) responsible for provision of IP/MPLS layer services to Layer 2 and vice-versa
-- An MPLS label-switching entity (NAS MPLS) responsible for routing/forwarding within the mesh network (MESH topology only)
-- A Radio resource control (RRC) entity responsible for MAC layer signalling for configuration of logical flows (labels) and retrieval of measurement information.
-- A Radio Link Control (RLC) entity which is responsible for automatic repeat request protocols (ARQ) and IP/MPLS packet segmentation
-- A convergence protocol (PDCP) responsible for IP interface and related functions (header compression, ciphering, etc.)
-- A scheduling and multiplexing unit (\ref _openair_mac_layer_specs_) responsible for the mapping between logical channels (labels and control-plane signalling)
-and transport channels.  It implements the interface with the PHY, which is the collection of transport channels as well as a primitives for
-collection of PHY measurements and configuration of PHY parameters.
-
-\image latex layer2_stack_overview.pdf "Global View of OpenAirInterface Protocol Stack and Communication Primitives"
-\image html layer2_stack_overview.png "Global View of OpenAirInterface Protocol Stack and Communication Primitives"
-
-These entities are described in the following subsections.
-
-\subsubsection _RRC_ Radio Resource Control (RRC)
-The radio resource control entity is responsible for the L2 signalling implementing the radio channels establishment. It also implements the control of
-measurement procedures described in Section 1.3.4. Its internal state machine controls the basic procedures for startup, monitoring of synchronization
-through the measurement system and update of the nodes role in the network (Sections 1.3-0).
-
-RRC is responsible for configuration of all MAC entities (and PHY via MAC), both dynamic (during label establishment) and static (control channels).  This functionality
-is in response to event occurring in the interaction with L3 and based on dynamic measurements of radio quality.
-
-RRC signalling makes use of DCCH, CCCH and BCCH for transport of the various protocols.
-
-
-\subsubsection _RLC_ Radio Link Control (RLC)
-RLC segments IP packets. The segment size is configurable for each QoS class and is signalled by higher layers during route establishment.  The sizes
-are chosen based on the granularity of the underlying MAC/PHY resources (transport blocks).
-
-RLC is responsible for ARQ and indexing of SDUs from the user traffic and signalling SDUs from RRC.  The SDU inputs from LS form the
-set of radio bearers, and those from RRC the set of signalling radio bearers. It has two modes of functionality: acknowledged and unacknowledged.
-Each logical channel can have an associated ARQ process which is managed by RLC.   The ARQ mechanisms are based on Release 6 3GPP RLC (25.8xx).
-The interface with RRC for configuration is not yet described.  The interface with MAC is designed such that data for each logical channel is
-buffered in data queues, whose occupancy can be measured by the MAC scheduling entity.
-
-\subsubsection _MAC_ MAC scheduling Entity (MAC)
-The MAC entity is responsible for scheduling control plane and user-plane traffic on the physical OFDMA resources.
-On transmission, the inputs to this entity are connected to data queues originating in the RLC layer which form the set of logical channels. The
-control plane traffic is represented by logical channels which form the interface with the RLC.  Logical channels contain both user-plane (originating
-in the IP/MPLS entity via the PDCP entity) and control-plane traffic (originating in the RRC entity).  MAC layer specifications are found in \ref _openair_mac_layer_specs_.
-The MAC is responsible the transport channel interface which exchange data (MAC SDUs) and PHY measurement data for RRC measurement procedures.
-
-\subsection _PHY_PROCEDURES_MESH_ Physical Layer Procedures - Mesh Topology
-\subsection _PHY_PROCEDURES_CELL_ Physical Layer Procedures - Cellular Topology
-
-\subsubsection _POWER_ON_CH_ Power-on procedures of a CH
-This clause briefly describes the power-on procedure of a CH. The CH RRC receives basic cell configuration information (CHBCH/RACH configuration) from
-L3 Radio Resource Management (RRM)  and configures the MAC and RLC layers.  The MAC, in turn, configures the static paramters of the PHY. Upon completion
-of this initialization phase it enters the steady-state mode.
-
-\subsubsection _POWER_ON_UE_ Power-on procedures of a UE
-This clause briefly describes the power-on procedures of a UE which is managed by the UE-RRC state machine.  The first function is to search for at least one
-existing CH in range which is under the responsibility of the PHY.  This procedure attempts to analyze the received signal power over a pre-defined time period. If a
-signal is detected on the desired carrier, the node attempts PHY synchronization using the pilots of the candidate CHs.  The postulated frame start position is used
-to demodulate the CHBCH resources.  If the PHY returns an error-free CHBCH with acceptable receive quality, the node is said to be pre-synchronized to the CH.
-It then attempts to decode the CHBCH of the rest of the CH in range.  At the end of this stage, it has a list of acceptable CH.  This procedure is repeated periodically,
-until active communication is sought with the network.
-
-Upon passing to the state of active communication, it demodulates the CHBCH continuously from the CHs to obtain the UL-CCCH configurations as well as MCCH/MTCH.
-Once configured, it attempts to establish a connection (connection request) with each of the candidates using the RACH resources of each CH.  Upon successful completion
-of the association procedure it is said to be synchronized to the CH and enters the steady-state mode for each CH.
-
-\subsubsection _CH_SS_OP_ CH Steady-state operation
-In TTI N, the CH transmits all DL flows as determined by the CHBCH scheduler during the end of TTI N-2. Furthermore, it detects the UL-SACCH for all UE flows and the
-UE-SACH for all flows.  It also detects the RACH (CCCH). At the end of each TTI, once it has received all feedback indicators (channel and queuing), it invokes
-the CHBCH scheduling entity to determine the allocations for TTI N+2.  The sequence of operations after receiving flows from TTI N (towards the end of TTI N+1) is:
-
-Entity: RRC TX
-
--#  generate BCCH and CCCH to be conveyed in TTI N+2
--#  program new logical channels and measurement procedures starting in TTI N+2 based on L3 signaling requests
--#  generate signaling radio bearers (measurement requests, UE radio bearer/logical channel configuration) for TTI N+2, and invoke RLC
-
-Entity: MAC TX
-
--#  Invoke MAC Scheduler for TTI N+2 allocations : compute DL_SACCH_PDU and UL_ALLOC_PDU for N+2, corresponding to  PHY allocations in N+3.
--#  Generate CHBCH PDU for TTI N+2
--#  Retrieve RLC SDUs and generate DL_SACH for TTI N+2
--#  Generate MACPHY_DATA_REQ for TX transport channels in TTI N+2
-
-MAC RX
-
--#  Generate MACPHY_DATA_REQ for RX transport channels in TTI N+2 (based on previously scheduled UL_ALLOC_PDU received by UE in TTI N, decoded by end of TTI N+1)
--#  Invoked by PHY through macphy_data_confirm, the received flows are routed to RLC data queues and MAC signaling information is
-stored for MAC TX scheduling in next TTI.  The MACPHY_DATA_IND primitive (invoked by PHY) also provides CH RX measurements information in an UL_MEAS structure.
-
-RRC RX
-
--#  Retrieve RACH and process association requests
--#  Retrieve signaling radio bearers from RLC
--#  Retrieve CH RX measurements from PHY/MAC
-
-This sequence is invoked at the end of each TTI by the system scheduler.
-
-\subsubsection  _UE_SS_OP_ UE Steady-state operation
-
-In the steady-state of TTI N, the UE PHY demodulates the CHBCH.  The CHBCH PDU is then available during TTI N+1 for the MAC. to determine the allocations of the CH and
-itself in TTI N+2. Based on the decoded information, its scheduling entity generates the transmission for the next TTI and configures the PHY to demodulate the data for
-which it is destination in the current TTI.  The UE RRC acts on PHY/MAC measurements to maintain proper synchronization and received signal quality, for example by
-detecting a loss of connection of degradation of service. The sequence of operations at the end of TTI N is
-
-Entity: MAC RX
-
--#  Parse CHBCH_PDU
--#  Generate macphy_data_req for RX transport channels in TTI N+2 (based on previously scheduled UL_ALLOC received by UE in TTI N, decoded by end of TTI N+1)
--#  Invoked by PHY through macphy_data_confirm, the received flows are routed to RLC data queues and MAC signaling information is stored for MAC TX scheduling in next TTI.  The reported PHY RF measurements (i.e. in DL_MEAS structure) are processed and used to generate UL_SACCH_FB.
--#  Process measurements for RRC measurement reports and invoke mac_meas_ind for each logical channel requiring a measurement report.
-
-Entity: RRC RX
-
--#  Retrieve BCCH  and CCCH and generate association requests
--#  Retrieve signaling radio bearers from RLC
--#  Retrieve UE RX measurements from PHY/MAC for L3 measurement reporting
-
-Entity: RRC TX
-
--#  program new logical channels and measurement procedures starting in TTI N+2 based on L3 signaling requests signaled by CH-RRC
--#  generate signaling radio bearers (measurement reports, configuration ACKs) for TTI N+2, and invoke RLC
-
-Entity: MAC TX
-
--#  Invoke MAC multiplexer for TTI N+2 allocations : compute UL_SACCH_FB and UL_SACCH_PDU for N+2, corresponding to  PHY allocations in N+3.
--#  Generate CHBCH PDU for TTI N+2
--#  Retrieve RLC SDUs and generate UL_SACH for TTI N+2
--#  Generate MACPHY_DATA_REQ for UL_SACH in TTI N+2
-
-\subsubsection _QOS_MEAS_PROC_ QoS Measurement Procedures
-
-CH RRC manages L3 measurement reports at L2 for nodes within the cell. Measurement reports are exchanged between UE and CH using a logical channel (DCCH)
-for topological control signaling, and edge routers can provide these measurements to IP
-Since the CH scheduler has access to low-level PHY measurements, the MAC layer is responsible for measurement reporting on behalf of the PHY and itself.
-The CH obtains raw measurements of all links in the cell.  RRC acquires these measurements from MAC scheduling entity.
-Measurements are processed in nodes to the degree required for higher level services. For example nodes will extract link quality (rate/delay) indicators from
-low-level services (MAC to L3 measurement messages) which are transported using special signaling flows offered by the MAC. This is then used for L2.5 topology
-maintenance (radio-bearer (re)-assignment). Edge routers will extract L2.5 measurement information on labels to provide IP with quality indicators.
-
-The interface with RRC for measurement reports is very similar to existing Release 6 HSPA. The types of measurements are:
-- periodic (or one-shot) with configurable reporting interval and total number of measurements
-- event-driven - in order to handle degradation of QoS level or loss of connection.
-
-The available measurements for CH RRC(L2) are:
-- RSSI (dBm) on physical resources corresponding to logical channel.
-- Average SINR (dB) on physical resources corresponding to logical channel.
-- Average number of transmission rounds (times 10) on transport channel associated with logical channel.
-- Average residual block error rate (times 1000) on transport channel associated with logical channel (after HARQ!).
-- Actual Spectral efficiency (bits/symbol times 10) of transport channel associated with logical channel.
-*/
-
-/** @defgroup _openair_specs_ OpenAirInterface Layer1/2 Specifications
-* @defgroup physical_layer_ OpenAirInterface Physical Layer (PHY) Specifications
-* @ingroup _openair_specs_
-* @{
-This clause specifies the PHY layer for a multiple-antenna orthogonal frequency-division multiple-access (OFDMA) system applied and
-the generic openair MAC interface.
-\image html PHY_arch.png "openair PHY"
-\image latex PHY_arch.png "openair PHY" width=15cm
-The specification is intended for reconfigurable equipment, so that actual parameters and mechanisms can be configured
-prior to deployment of the equipment or potentially over-the-air, although the latter is not yet supported by any of the openair MAC implementations.  The
-PHY and MAC layers are tightly coupled so that the MAC entity can directly influence the occupied physical resources. The OFDMA system provides the means for
-transmitting several multiple-bitrate streams (multiplexed over sub-carriers and antennas) in parallel. Moreover, PHY signaling strategies are included to
-provide the means for exploiting channel state feedback at the transmitters in order to allow for advanced PHY allocation of OFDMA resources via the MAC.
-Modulation and channel coding formats are generic allowing for specific techniques to be employed in different deployment scenarios although configurations
-based on the 802.11a legacy standard (binary/quaternary phase shift keying BPSK/QPSK, 16-point quadrature amplitude modulation (16-QAM),
-64-QAM, rate 1/2,2/3,3/4 punctured convolutional codes) are provided here. The specifications are not specific to any frequency band or bandwidth,
-although the minimum expected channel bandwidth should not be less than 1 MHz.
-*/
-
-/** @defgroup _phy_scope Scope
-* @ingroup physical_layer_
-* @{
-This subclause describes the PHY services provided to the openair MAC.  The openair PHY consists of several protocol functions which provide the interface
-between the MAC and PHY for allocation MAC layer PDUs to physical resources.  Physical channels are used to convey signaling, data and training information
-across the radio medium.  OpenAirInterface implements the following physical channels:
-
--# The PCHSCH (Physical Clusterhead Synchronization Channel) is a pilot resource reserved to a clusterhead (CH) which is responsible for
-delivering synchronization information to nodes in the cluster.  This channel is used by nodes to acquire timing information regarding the
-beginning of the TTI and to perform initial frequency offset adjustments with respect to the carrier frequency of the CH.  The channel
-is also used by adjacent clusterheads to synchronize the network, in order to facilitate inter-cluster communication under quality-of-service guarantees.
--# The PCHBCH (Physical Cluster-head Broadcast Channel) is a signaling resrouce reserved to a clusterhead which is responsible for delivering layer 2/3
-protocol information to the nodes of the cluster.  It can also used by the nodes in the cluster to acquire accurate timing and frequency synchronization information.
--# the PRACH (Physical Random Access Channel) is a signaling resource used by a node to provide layer 2 protocol information to its clusterhead.
--# the PCHSCH (Physical Clusterhead Synchronization Channel) is a pilot resource used by a CH to allow the UE/MR to estimate the channel of CH and to acquire timing synchronization.
--# the PSCH (Physical Synchronization Channel) is a pilot resource used by a node to allow the CH to estimate the channel of an MR/UE.
--# the PSACH (Physical Scheduled-Access Channel) is a multi-cast data resource used by a node or CH to send MAC data PDUs to one or more destinations in
-parallel (using multi-antenna OFDMA).
--# the PSACCH (Physical Scheduled-Access Control Channel) is a signaling resource used by a node to provide MAC protocol information to the destinations of its
-transmissions as well as the CH.
--# the PMRBCH (Physical Mesh Router Broadcast Channel) is a signaling resource used by a node to provide layer 2 broadcast protocol information to neighbouring nodes
-outside the range of clusterheads.  It is used by nodes in mesh network topologies to relay network synchronization and provide initial configuration information to
-
-Transport channels constitute the control and user plane interfaces between the MAC and PHY layers.  The are used to exchange both data and measurement information
-and are mapped onto the above physical channels.  OpenAirInterface implements the following transport channels:
-
--# The CHBCH (Clusterhead Broadcast Channel) is the transport channel mapped to the PCHBCH.
--# The RACH (Random-Access Channel) is the transport channel mapped to the PRACH.
--# The DL-SACH (Downlink Scheduled-Access Channel) is the transport channel mapped to the PSACH.
--# The UL/MR-SACH (Uplink or Mesh-Router Scheduled-Access Channel) is the transport channel with components mapped to both the PSACH and PSACCH.
--# The MRBCH (Mesh-Router Broadcast Channel) is the transport channel mappted to the PMRBCH.
-
-During reception, all transport channels convey measurement information.
-* @}
-*/
-
-/** @defgroup _phy_framing Framing and Channel Multiplexing
-* @ingroup physical_layer_
-* @{
-*/
-
-
-/** @defgroup _framing_modulation TTI and Modulation Parameters
-* @ingroup _phy_framing
-
-The physical layer uses OFDM symbols organized into frames (corresponding to TTIs) of complex baseband samples at a sampling rate of \f$ f_\mathrm{s} \f$ samples/s.  The carrier frequency is denoted \f$f_c\f$. Each TTI is made up of \f$N_{\mathrm{symb}}\f$ OFDM symbols. OFDM symbols,  \f$\mathbf{s}\f$, of length \f$N_\mathrm{s}\f$ samples contain two distinct parts,\f$\mathbf{s}_\mathrm{I}\f$ and \f$\mathbf{s}_\mathrm{E}\f$.
-
-OpenAirMesh framing is completely configurable, but the nominal OFDMA configuration is shown below
-
-\image html mesh_frame.png "OpenAir PHY Framing"
-\image latex mesh_frame.pdf "OpenAir PHY Framing" width=15cm
-
-One frame consists of 64 OFDM symbols and is  divided in a CH transmission time interval (TTI) and a MR TTI. The first four symbols of the CH TTI are reserved for pilot symbols. Each CH transmits one common pilot symbol (CHSCH$_0$) at position 0 and one dedicated pilot symbol (CHSCH\f$_i\f$) at position \f$i \in \{1,2,3\}\f$. This way we can ensure orthogonality between the pilots of different CH received at one MR. The pilot symbols are followed by the broadcast channel (CH-BCH).  The rest of the CH TTI frame is reserved for the multiplexed scheduled access channels (CH-SACH).
-
-The MR TTI contains the random access channel (MR-RACH) with an associated pilot symbol (SCH$_0$). The next two symbols are reserved for pilots. Each MR transmits a pilot symbol SCH\f$_i\f$, \f$i \in \{1,2\}\f$ corresponding to the cluster it belongs to. The pilot symbols are followed by the uplink broadcast channel (MR-BCH) with an associated pilot symbol (MRSCH). The rest of the uplink frame contains the multiplexed scheduled access channels (MR-SACH). The end of the CH and MR TTIs are protected by a guard interval of two symbols. All pilots are designed for MIMO and/or Multiuser channel estimation at the corresponding end.
-
-MAC PDUs arrive at the MAC interface from different logical resources (control, broadcast, multiple-user data streams) in parallel at the start of each TTI and must be mapped to the available radio resources.  Each PDU is scrambled, encoded with a CRC check, and encoded using a channel code with associated bit-interleaving. The output of the channel coding block contains the information content to be transfered across the channel via the modulator. The modulated information content, \f$\mathbf{s}_\mathrm{I}\f$, is built starting either from a frequency-domain signal (classical OFDM) or several time-domain signals (digital FDM). Both techniques yield what are denoted herein as OFDM symbols. In the first method (classical OFDM), \f$\mathbf{S}_\mathrm{I}\f$ is specified in the frequency-domain and is made up of \f$N_\mathrm{d}\f$ samples. This is transfered to the time-domain via the inverse discrete-time Fourier transform (DFT) yielding a time-domain signal also of length \f$N_\mathrm{d}\f$ samples, \f$\mathbf{s}_\mathrm{I}=\mathrm{idft}(\mathbf{S}_\mathrm{I})\f$. In the second method, up to \f$N_\mathrm{f}\f$ different time-domain signals each comprising \f$N_{\mathrm{d,2}}=\frac{N_\mathrm{d}}{N_\mathrm{f}}\f$ samples, where \f$N_\mathrm{f}\f$ denots the number of frequency groups making up an OFDM symbol.  Here each signal \f$\mathbf{s}_{i}\f$ is transformed to the frequency-domain via an \f$N_\mathrm{d,2}\f$-dimensional DFT yielding \f$\mathbf{S}_i\f$ and the combined frequency-domain signal is the concatenation of the \f$\mathbf{S}_i\f$, \f$\mathbf{S}_\mathrm{I} = [\mathbf{S}_0 | \mathbf{S}_1 | \cdots | \mathbf{S}_{N_\mathrm{f}-1}]\f$
-
-The redundant (or null) portion, \f$\mathrm{s}_\mathrm{E}\f$, comprises \f$N_\mathrm{c}=N_\mathrm{s}-N_\mathrm{d}\f$ extra samples, and is concatenated to \f$\mathbf{s}_\mathrm{I}\f$. It is either a cyclic extension or zeros.  The overall symbol is \f$\mathbf{s} = [\mathbf{s}_\mathrm{E} | \mathbf{s}_\mathrm{I}]\f$ (prefix configuration) or \f$\mathbf{s} = [\mathbf{s}_\mathrm{I} | \mathbf{s}_\mathrm{E}]\f$ (suffix configuration).
-
-The cyclic prefix or zero-padding is used to absorb a channel with a delay spread (including propagation delay of the primary paths) equal to its length so that adjacent OFDM symbols do not overlap in time.  If the cyclic prefix method is used, then \f$s_{\mathrm{E},i} = s_{\mathrm{I},N_\mathrm{d}-N_\mathrm{c}+i}, i=0,\cdots,N_\mathrm{c}-1\f$, whereas if the cyclic suffix method is used, then \f$s_{\mathrm{E},i} = s_{\mathrm{I},i}, i=0,\cdots,N_\mathrm{c}-1\f$ otherwise \f$s_{\mathrm{E},i}=0, i=0,\cdots,N_\mathrm{c}-1\f$. The value \f$N_\mathrm{c}\f$ should be chosen based on the maximum propagation delay in the system.  For outdoor channels this will be on the order of a few microseconds.  In addition, for large \f$N_\mathrm{c}\f$, the value of \f$N_\mathrm{d}\f$ should also be large so that the overhead due to the propagation channel be kept to a minimum.  \f$N_\mathrm{d}\f$ should be large enough to allow for frequency-domain multiplexing of user data streams if OFDMA is employed.  Very large \f$N_\mathrm{c},N_\mathrm{d}\f$ are probably not required for openair except perhaps in the case of long-distance point-to-point links
-(e.g. to link different hotspot areas).
-
-OFDM symbols typically provide for a certain spectral roll-off to satisfy RF spectral mask requirements and aid in transmit filtering and adjacent channel suppression.  This is usually accomplished by inserting \f$N_{\mathrm{z}}\f$ zeros in \f$\mathbf{S}_f\f$. The total number of useful samples in \f$\mathbf{S}_f\f$ is therefore \f$N_\mathrm{d}-N_\mathrm{z}\f$.
-
-For use in OFDMA multiplexing, the useful carriers can be split into \f$N_\mathrm{f}\f$ groups of contiguous carriers. Each group of carriers can be used to transmit a different data stream in the same OFDM symbol.  This particularly useful for achieving dynamic FDMA on the uplink of a cellular system.
-
-A summary of the framing parameters is given in following table and is represented by the primitive PHY_FRAMING.  It represents part of the static configuration of the air-interface and is set during the initialization phase of the equipment via the MAC-layer interface (see \ref _mac_phy_primitives_,MACPHY_CONFIG_REQ) .
-
-*/
-
-
-/** @defgroup _chsch_sig Clusterhead Synchronization Channel (P-CHSCH,S-CHSCH) Signaling Format
-* @ingroup _phy_framing
-
-The clusterhead synchronization channel is a signaling channel generated in the PHY layer and is comprised of
-\f$N_{\mathrm{s,CHSCH}}(N_\mathrm{d}+N_\mathrm{c})\f$ samples, or the equivalent of one \f$N_{\mathrm{s,CHSCH}}\f$ OFDM symbols.   The main purposes of
-this channel are
-
--# Timing (TTI/symbol) synchronization for nodes inside the cluster
--# Frequency sychronization for nodes inside the cluster
--# Timing (TTI/symbol) sychronization for clusterheads in adjacent clusters
--# Frequency synchronization for clusterheads in adjacent clusters
-
-It is emitted once per TTI in conjunction with the clusterhead broadcast channel (P-CHBCH,S-CHSCH).  Aside from its primary purposes above, it is also
-intended to be exploited for channel estimation prior to demodulation of the CHBCH, since the CHBCH does not comprise pilot signals and the clusterhead
-does not use the MCH. The number of symbols required, \f$N_{\mathrm{s,CHSCH}}\f$, depend on the desired time and frequency acquisition precision.
-
-The x-CHSCH is a pseudo-random QPSK sequence defined in the frequency domain by the bit sequences
-\f$\mathrm{Re}\{\mathbf{c}_i\}, \mathrm{Im}\{\mathbf{c}_i\}, i=0,1,\cdots,\lfloor(N_{\mathrm{d}} - N_{\mathrm{z}})N_{\mathrm{s,CHSCH}}/32 \rfloor -1\f$.
-If multiple transmit antennas (up to \f$N_d/N_c\f$) are used on the same frequency carrier, the CHSCH sequence,
-\f$\mathbf{c}_{\mathrm{CHSCH,2}}\f$, shall be cyclicly shifted by \f$iN_\mathrm{c}, i=1,2,\cdots,N_\mathrm{ant}\f$ samples on antenna \f$i\f$ prior to
-cyclic extension. This is to allow nodes to estimate the different channels of the clusterhead efficiently in the frequency domain.
-
-The transmit power of the CHSCH shall be adjustable by higher layers in order to control the detection range of the clusterhead.
-
-The parameters of the CHSCH are summarized in the following table and represented by the primitive PHY_CHSCH
-
-*/
-
-
-/** @defgroup _CHBCH Clusterhead Broadcast Channel (P-CHBCH,S-CHBCH) Signaling Format
-* @ingroup _phy_framing
-
-
-The CHBCH is the signaling channel used by the DLC for passing basic protocol information from the clusterhead to the nodes in its
-cluster.  This information is used to distribute physical resources during the TTI and some additional protocol information
-(association, QoS reservation, etc.). It is located in the first symbol in the TTI,\f$s_{\mathrm{CHBCH}}\f$. In the case of several
-clusterheads operating on the same carrier frequency, the CHBCH of adjacent clusters (i.e. those within range of the CHSCH) cannot collide
-and thus must be allocated different symbols in the TTI or use disjoint frequency carrier sets. The same is true of the CHBCH and MCH/RACH of
-adjacent clusters.  The time/frequency allocation of CHSCH/MCH/RACH across several clusters must be accomplished in a distributed fashion based on the
-activation times of the different clusterheads and mobility of the clusters.  This is beyond the scope of this preliminary specification.
-
-The CHBCH must use the lowest spectral efficiency (highest sensitivity) coded-modulation format in order to be detectable at large distances.
-It will thus employ a rate 1/2 forward-error-correcting code with QPSK modulation \ref _phy_coded_modulation.  Information will be coded
-across \f$N_{\mathrm{s,CHBCH}}-1\f$ OFDM symbols using all non-zero carriers.  Interleaving shall be performed across frequencies with depth
-\f$IntDepth_{\mathrm{CHBCH}}\f$. \f$IntDepth_{\mathrm{CHBCH}}\f$ shall be an integer divisor of \f$N_{\mathrm{d}}-N_{\mathrm{z}}\f$. Prior to
-forward-error correction coding, a CRC of length 32 bits shall be applied to the PDU arriving from the MAC layer interface.
-
-Channel estimation can be obtained from the CHSCH which is located in the adjacent OFDM symbols.  The CHSCH symbols shall be found starting
-in symbol number \f$\lfloor.5N_{\mathrm{symb}}\rfloor\f$ of the CHBCH.
-
-The number of bits per TTI delivered by the MAC layer interface (FEC + CRC) bits is determined by the formula
-\f$(N_{\mathrm{symb}}-1)*(N_{\mathrm{d}}-N_{\mathrm{f}}) - 32\f$.
-
-If \f$N_\mathrm{pilot}\f$ additional pilot symbols per OFDM symbol are required to handle large frequency offsets due to high-mobility (Doppler)
-or significant carrier frequency offsets due to the RF equipment,  then these are to be placed at equally spaced positions starting from the
-first non-zero carrier in each CHBCH symbol.  These simply puncture the coded bit sequence.  Care must be taken when choosing the value of
-\f$N_\mathrm{f}\f$ with respect to \f$IntDepth_{\mathrm{CHBCH}}\f$ so that consecutive bits of the encoded sequence are not punctured.
-A judicious choice would take \f$IntDepth_{\mathrm{CHBCH}}\f$ and \f$N_{\mathrm{d}}-N_{\mathrm{z}}\f$ to be relatively prime.
-
-In order to allow for multi-cell deployment the CHBCH can use a reduced set of subbands which is controlled by the parameter \f$FreqReuse\f$. It should be set to the maximum number of base stations. Let \f$N_{FreqGroup}\f$ be the number of carriers of one frequency group. Then, the set of carriers used by the \f$i^\mathrm{th}\f$ CHBCH \f$i=1,2,3\f$ (CHBCH 0 is unused) is given by
-\f$\left\{((i-1) FreqReuse N_{pilot} ) + k*N_{FreqGroup}, k=0,\cdots,N_{Pilots}-1\right\}\f$.
-
-The transmit power of the CHBCH shall be adjustable by higher layers in order to control the detection range of the clusterhead.  This value will be
-transfered via higher layer signaling so that nodes may perform open-loop power control. The following table summarizes the parameters of the CHBCH
-which are transfered from higher layers using the primitive PHY_CHBCH.
-
-*/
-
-
-/** @defgroup _RACH Random-Access Channel (RACH) Signaling Format
-* @ingroup _phy_framing
-
-
-The RACH is a signaling channel used only during the association phase of a node and for other management services.
-Several RACHs can be used in parallel to reduce contention in dense networks, and the exact number are signaled by the higher layer.
-This resource is not meant, however, to be used for intensive data transmission.  Data streams consisting of small sporadic packets
-could potentially use this channel if required.
-
-The RACH is subject to power control.  The transmit power should be adjusted in a closed-loop fashion based on the
-measured path loss between the node and the clusterhead.
-
-For adhoc/mesh configurations, one or more MCH are reserved for the RACH.  For a cellular
-scenario, a SACH resource is opened periodically for the RACH by the clusterhead.
-
-*/
-
-
-/** @defgroup _SACH Scheduled-Access (SACH) and Scheduled-Access Control Channel (SACCH) Signaling Format
-* @ingroup _phy_framing
-
-The SACH/SACCH is a multiplexed resource containing both signaling information (Scheduled Access Control CHannel) and user plane traffic
-(Scheduled Access CHannel).  The SACH is a set of data streams multiplexed by multiple-antenna OFDMA containing user traffic for several
-destinations.  The SACCH contains low-layer protocol information regarding sequencing (for ARQ and channel decoding) and signaling for
-channel feedback mechanisms.  In AdHoc/Mesh configuration, the SACCH is a resource common to all destinations sharing the SACH and
-its data is multiplexed with those of the SACH. In the cellular configuration, the SACCH
-is located in the first allocated symbol and uses the lowest-order (highest protection) coded-modulation format.  Aside from low-level signaling
-it contains the allocation formats used by the set of streams in the SACH, specifically the coded-modulation formats and frequency-allocations in the
-case of the AdHoc/Mesh configuration.  In the downlink of a cellular configuration, the SACCH information is embedded in the CHBCH PDU.
-
-The transmission format of the SACH/SACCH can either use classical OFDM or digital FDM, and this is signaled by the higher layers.
-
-Each SACH/SACCH is made up of \f$N_{\mathrm{symb,SACH}}\f$ OFDM symbols. The number of symbols
-used by a particular SACH in a particular TTI is broadcast via MAC-layer signaling in the CHBCH and depends QoS parameters and
-measurements.  It is thus a dynamic parameter known by all nodes in the cluster at the beginning of each TTI.
-
-A SACH/SACCH contains \f$N_\mathrm{pilot,SACCH}\f$ pilot symbols during the SACCH symbols to allow for multi-antenna wideband channel estimation, and
-\f$N_\mathrm{pilot,SACH}\f$ pilot symbols per SACH symbol for carrier frequency offset tracking.  The encoding rules for the SACCH
-pilot symbols is identical to the MCH/RACH on the first transmit antenna.  If multiple transmit antennas are employed, the pilot symbols for antenna
-\f$i=0,1,\cdots,N_\mathrm{ant}\f$ in position $k$ is multiplied by the complex phasor sequence \f$e^{j*2*pi*kiN_\mathrm{p}/N_\mathrm{d}}\f$.
-This phasor sequence ensures that the \f$N_\mathrm{ant}\f$ channel responses are orthogonal at the receiver provided
-\f$N_\mathrm{ant}N_\mathrm{p}\leq N_\mathrm{d}\f$ and \f$N_\mathrm{p}\f$ is less than the maximum channel duration plus maximum propagation delay.
-
-Both \f$N_\mathrm{pilot,SACH}\f$ and \f$N_\mathrm{ant}\f$ are broadcast using higher layer signaling or pre-configured.
-
-The number of samples for SACH/SACCH data is
-\f$N_\mathrm{samp,SACH} = N_\mathrm{symb,SACH}(N_\mathrm{d}-N_\mathrm{f} - N_\mathrm{pilot,SACCH} - N_\mathrm{pilot,SACH}) - 32\f$.
-SACCH data is to be encoded using the lowest spectral efficiency coded-modulation format, namely a rate 1/2 forward error-correcting code with QPSK
-modulation.  If multiple transmit antennas are used, then the lowest spectral-efficiency BICM space-time code is to be employed.  Prior to FEC coding a
-CRC shall be computed on the SACCH data and should be concatenated to the tail of the information.  The total number of
-coded bits for the SACCH depends on the number of streams.  It should be kept to a minimum with respect to the total number of data bits in the SACH
-streams in order to guarantee efficiency.
-
-Since the SACH is a dynamically allocated resource based on channel quality measures,
-sample interleaving across different OFDM carriers is not required.
-
-Prior to forward error-correction coding, a CRC of length 32 bits shall be applied to the PDU.
-
-The SACH is the only resource for which the output of the channel coding block is vectorial, in the case of multiple transmit antennas. Space-time signal
-processing is therefore possible on the SACH data streams. Identical interleaving is performed on all antenna streams and the choice of coded-modulation
-and space-time processing methods is determined by the MAC scheduler.  A choice of 16 different formats are considered including some of the legacy
-802.11a formats. The formats could potentially be reconfigurable and installed at run-time or over-the-air. This is discussed in \ref _phy_coded_modulation.
-Each stream can use a separate coded-modulation format.
-
-Streams can use a subset of the OFDM carriers according to the frequency allocation vector as mentioned earlier.  The allocations are chosen by the opportunistic
-scheduling algorithm in the MAC layer in order to achieve multi-user diversity and potentially spatial-multiplexing.
-
-The configuration information for the SACH/SACCH resource are partially signaled by higher layers and partially computed dynamically by the scheduling algorithm in the MAC.  They are described by the primitive PHY_SACH summarized in the following table.
-
-
-*/
-
-/*! \brief Extension Type */
-typedef enum {
-  CYCLIC_PREFIX,
-  CYCLIC_SUFFIX,
-  ZEROS,
-  NONE
-} Extension_t;
-
-
-/*! \brief Transmit Signal Format */
-typedef enum {
-  OFDM=0,
-  Digital_FDM
-} Signal_format_t;
-
-
-/*! \brief  PHY Framing Structure
-*/
-
-typedef struct PHY_FRAMING {
-  u_long   fc_khz;         /*!< \brief Carrier Frequency (kHz)*/
-  u_long   fs_khz;         /*!< \brief Sampling Frequency (kHz)*/
-  u_short         Nsymb ;         /*!< \brief Number of OFDM Symbols per TTI */
-  u_short        Nd;             /*!< \brief Number of OFDM Carriers */
-  u_char         log2Nd;         /*!< \brief Log2 of Number of OFDM Carriers */
-  u_short  Nc;             /*!< \brief Number of Prefix Samples*/
-  u_short  Nz;             /*!< \brief Number of Zero Carriers*/
-  u_char   Nf;             /*!< \brief Number of Frequency Groups*/
-  Extension_t    Extension_type; /*!< \brief Prefix method*/
-} PHY_FRAMING;
-
-
-/*! \brief  PHY_CHSCH Configuration Structure
-*/
-
-typedef struct PHY_CHSCH {
-  u_short  symbol;                 /*!< \brief First Symbol of CHSCH in TTI */
-  u_short  Nsymb;                  /*!< \brief Number of Symbols of CHSCH in TTI*/
-  u_char   dd_offset;
-  u_long   chsch_seq_re[32];       /*!< \brief Real part of \f$\mathbf{c}_i\f$  \f$(0\cdots n_1-1 \mathrm{LSBs})\f$*/
-  u_long   chsch_seq_im[32];       /*!< \brief Imaginary part of \f$\mathbf{c}_i\f$  \f$(0\cdots n_1-1 \mathrm{LSBs})\f$*/
-  char         CHSCH_POWER_dBm;    /*!< \brief Average CHSCH Transmit Power*/
-} PHY_CHSCH;
-
-/*! \brief  PHY_SCH Configuration Structure
-*/
-typedef struct PHY_SCH {
-  u_short  Nsymb;                  /*!< \brief Number of Symbols of SCH in TTI */
-  u_char   dd_offset;
-  u_long   sch_seq_re[32];       /*!< \brief Real part of \f$\mathbf{c}_i\f$  \f$(0\cdots n_1-1 \mathrm{LSBs})\f$*/
-  u_long   sch_seq_im[32];       /*!< \brief Imaginary part of \f$\mathbf{c}_i\f$  \f$(0\cdots n_1-1 \mathrm{LSBs})\f$*/
-  char     SCH_POWER_dBm;        /*!< \brief Average SCH Transmit Power*/
-} PHY_SCH;
-
-
-/*! \brief  PHY_CHBCH Configuration Structure
-*/
-
-typedef struct PHY_CHBCH {
-  u_short  symbol;           /*!< \brief First Symbol of CHBCH in TTI */
-  u_short  Nsymb;            /*!< \brief Number of Symbols of CHBCH in TTI */
-  u_short  IntDepth;          /*!< \brief Frequency Interleaving depth of CHBCH */
-  u_char   dd_offset;
-  u_short  Npilot;            /*!< \brief Number of pilot symbols in CHBCH */
-  u_long   pilot_re[8];       /*!< \brief Pilot symbols (Real part) */
-  u_long   pilot_im[8];       /*!< \brief Pilot symbols (Imag part) */
-  u_char   FreqReuse;         /*!< \brief Frequency Reuse Factor */
-  u_char   FreqReuse_ind;     /*!< \brief Frequency Reuse Index */
-  char   CHBCH_POWER_dBm;     /*!< \brief Average CHBCH Transmit Power*/
-} PHY_CHBCH;
-
-typedef struct PHY_MRBCH {
-  u_short  symbol;           /*!< \brief First Symbol of MRBCH in TTI */
-  u_short  Nsymb;            /*!< \brief Number of Symbols of MRBCH in TTI */
-  u_short  IntDepth;          /*!< \brief Frequency Interleaving depth of MRBCH */
-  u_char   dd_offset;
-  u_short  Npilot;            /*!< \brief Number of pilot symbols in MRBCH */
-  u_long   pilot_re[8];       /*!< \brief Pilot symbols (Real part) */
-  u_long   pilot_im[8];       /*!< \brief Pilot symbols (Imag part) */
-  u_char   FreqReuse;         /*!< \brief Frequency Reuse Factor */
-  u_char   FreqReuse_ind;     /*!< \brief Frequency Reuse Index */
-  char     MRBCH_POWER_dBm;     /*!< \brief Average MRBCH Transmit Power*/
-} PHY_MRBCH;
-
-/*! \brief  PHY SACH/SACCH Configuration Structure
-*/
-
-
-typedef struct PHY_SACH {
-  Signal_format_t Signal_format;                         /*!< \brief Transmit Signal format of SACH/SACCH*/
-  u_char          Npilot;                                /*!< \brief Number of pilot symbols */
-  u_long          pilot_re[8];                           /*!< \brief Pilot symbols (real part) */
-  u_long          pilot_im[8];                           /*!< \brief Pilot symbols (imag part) */
-  char            SACH_POWER_dBm;                        /*!< \brief Average MCH/RACH Transmit Power*/
-} PHY_SACH;
-
-
-/* @}*/
-
-
-
-/** @defgroup _phy_coded_modulation Coded Modulation and H-ARQ
-* @ingroup physical_layer_
-* @{
-OpenAirMesh makes use of punctured binary codes (64-state rate 1/2 convolutional or 8-state rate 1/3 3GPP/LTE Turbo code).
-Puncturing can use either 3GPP rate matching or random puncturing in order to fine tune the coding rate to adapt to
-configurable transport block sizes delivered to PHY by the MAC.  The overall coding sub-system is shown in
-Figure below. New transport blocks arriving from the MAC layer (based on multi-user scheduling) are coded
-using a CRC extension and the chosen binary code.  These are then fed to the active transport block buffer along with
-those that are to be retransmitted.  Each transmitted block is punctured and then passed to a bit-interleaver and
-modulation mapper (BICM).  OpenAirMesh supports QPSK, 16-QAM and 64-QAM modulation.
-
-\image html openair_coding.png "Coded Modulation Subsystem"
-\image latex openair_coding.png "Coded Modulation Subsystem" width=15cm
-
-The transmitted transport blocks can be split into to two spatial streams in the case of point-to-point MIMO transmission.
-Each stream receives an adjustable amplitude and then each is passed to a different (orthogonal) space-time parser which
-guarantees that both streams use different antennas in the same time/frequency dimension.   This allows for low-complexity
-successive detection at the receiver and maximizes diversity against fading. This is a form of superposition coding since
-the two streams are combined additively in the air through the use of multiple transmit antennas.
-
-A second design objective for this coding strategy, in addition to low-complexity point-to-point MIMO operation, is that
-the same transmitter and receiver structure can be used in a distributed MIMO scenario. Here one spatial stream is used
-at each source and the second stream originates in another part of the network, either in the same cluster or an adjacent
-cluster.  Co-operation is needed in order to guarantee different STF parsing for the two streams so that they can be
-decoupled at the SIC receiver.  A particular user can decode both streams or simply select the one it requires.
-
-*/
-/** @defgroup _phy_scrambling Transport block Scrambling
-* @ingroup _phy_coded_modulation
-
-Each transport block is scrambled using the LFSR shown in the following figure with a random initial state
-in the LFSR determined at deployment time. The LFSR is used in the to descramble the SDU. Scrambling is always
-performed on all transport channels.
-
-\image html scrambler.png "MAC SDU Scrambling"
-\image latex scrambler.png "MAC SDU Scrambling" width=15cm
-
-\note More information on Linear feedback shift register (LFSR) can be found on http://homepage.mac.com/afj/lfsr.html or http://www-math.cudenver.edu/~wcherowi/courses/m5410/m5410fsr.html
-*/
-
-/** @defgroup _phy_crc Cyclic Redundancy Check
-* @ingroup _phy_coded_modulation
-
-For the purpose of error-detection a cyclic-redundancy check (CRC) is applied to every transport block entering the
-PHY coding subsystem, including those destined for the CHBCH,MCH, RACH and SACCH.  To the latter are a applied an
-8-bit systematic CRC defined by the generator \f$g_8(D)=1+D+D^3+D^4+D^7+D^8\f$.  Data on the SACH is encoded using a
-24-bit CRC defined by the generator \f$g_{16}(D)=1+D^5+D^{12}+D^{15}\f$.
-\note: Basic information about CRC can be found at: http://www.mathpages.com/home/kmath458.htm or http://utopia.knoware.nl/users/eprebel/Communication/CRC/
-*/
-
-/**@defgroup _phy_conv_cod Convolutional Coding
-* @ingroup _phy_coded_modulation
-
-For coded-modulation formats using convolutional coding, the 802.11a rate 1/2 64-state convolutional coder shown
-below shall be applied to the scrambled and parity-checked transport blocks.
-
-\image html convolutional.png "802.11a Convolutional Code"
-\image latex convolutional.png "802.11a Convolutional Code" width=15cm
-
-*/
-
-/** @defgroup _phy_puncturing_ Puncturing
-* @ingroup _phy_coded_modulation
-
-Random puncturing makes use of a 32-bit Tausworthe random number generator.  Let \f$S_i,i\in\{0,1,2\}\f$ be
-the 32-bit initial values of the generator state given by
-
-\f$S_0(0) = \mathrm{1E23D852} + 16s\f$
-
-\f$S_1(0) = \mathrm{81F38A1C} + 16s\f$
-
-\f$S_2(0) = \mathrm{FE1A133E} + 16s\f$
-
-where \f$s\f$ is a seed.  The seed is typically different for each transport block and each round in the
-HARQ protocol.  It can be also used for layer 1 encryption.
-
-The state recursions at iteration \f$n\f$ are given by
-
-\f$b_0(n)=((2^{13}S_0(n-1))\oplus S_0(n-1))2^{-19}\f$
-
-\f$b_1(n)=((2^{2}S_1(n-1))\oplus S_1(n-1))2^{-25}\f$
-
-\f$b_2(n)=((2^{3}S_2(n-1))\oplus S_2(n-1))2^{-11}\f$
-
-\f$S_0(n)=((S_0(n-1)\mathrm{and}\mathrm{FFFFFFFE})2^{12})\oplus b_0(n)\f$
-
-\f$S_1(n)=((S_1(n-1)\mathrm{and}\mathrm{FFFFFFF8})2^{4})\oplus b_0(n)\f$
-
-\f$S_2(n)=((S_2(n-1)\mathrm{and}\mathrm{FFFFFFF0})2^{17})\oplus b_0(n)\f$
-
-and the output of the generator is \f$U(n)=S_0(n)\oplus S_1(n)\oplus S_2(n)\f$.
-
-Let \f$N_c\f$ be the number of coded bits after puncturing, \f$N_i\f$ be the number of input bits and
-\f$N_{\mathrm{bps}}\f$ be the number bits per symbol \f$N_{\mathrm{bps}}\in\{2,4,6\}\f$. Let the
-input sequence be denoted \f$c[i],i\in\{0,1,\cdots,N_i-1\}\f$. The
-Tausworthe puncturing procedure is achieved according to the following algorithm for a rate 1/2 binary code:
-
-1. Based on \f$N_c\f$, \f$N_i\f$ check that the rate falls between (\f$\frac{N_{\mathrm{bps}}}{4}\f$,\f$\frac{3N_{\mathrm{bps}}}{8}\f$),
-otherwise declare an error.
-
-2. Set the number of punctured bits to \f$N_p\leftarrow (N_i-N_c)/N_{\mathrm{bps}}\f$.
-
-3. Initially mark all \f$N_c\f$ coded bits to be transmitted.
-
-4. Set the initial seed of the Tausworthe to the function value \f$\mathrm{s}\f$
-
-5. Set \f$N_{i2}\leftarrow \lfloor N_i/N_{\mathrm{bps}}\rfloor \f$.
-
-6. Set \f$i\leftarrow0\f$
-
-7. Let \f$U(i)\f$ be the \f$i^{\mathrm{th}}\f$ output of the Tausworthe generator and
-\f$U'(i)=U(i)\mathrm{mod}2^{\lceil \log_2(N_{i2})\rceil}\f$
-
-8. if \f$U'(i) < N_{i2}\f$ and \f$\mathrm{c[U'(i)]}\f$ is not already punctured go to 10
-
-9. goto 7
-
-10. Mark \f$c[U' + jN_{i2}])\f$ as punctured for \f$j=0,1,\cdots,N_{\mathrm{bps}}-1\f$.
-
-11. Set \f$i\leftarrow i+1\f$
-
-12. if \f$i<N_{i2}\f$ goto 7
-*/
-
-/** @defgroup _phy_interl Bit-Interleaving and Modulation Mapping
-* @ingroup _phy_coded_modulation
-
-The interleaving depth for CHBCH,MCH,RACH and SACCH in the multiplexing sub-block is chosen to ensure sufficient separation in frequency
-for adjacent coded outputs, and thus maximize frequency diversity.  For coded-modulation formats 0-5, let \f$D=(N_\mathrm{d}-N_\mathrm{z})/IntDepth\f$ where
-\f$IntDepth\f$ depends on the particular transport channel at hand.  Each output bit from the convolutional coder, \f$c_i\f$, shall be placed in the set
-\f$C_{i\mathrm{mod}D}\f$.  The bits in each set are permuted based on a pseudo-random sequence and then combined to form 2,4 or 6-tuples depending on the modulation
-order of the coded-modulation format. The interleaving permutation sequence depends on \f$D\f$ and the number of coded bits.
-
-For the SACH, \f$D\f$ is the number of allocated frequency groups.  The above interleaving strategy shall be applied with this value.
-
-The QAM modulated symbols are mapped according to the Gray mapping as shown in the following figures.  QAM symbols must be scaled to
-ensure constant average energy independent of the modulation order.  The scaling factors are \f$1/\sqrt(2),1/\sqrt{10}\f$ and \f$1/\sqrt{42}\f$ for
-QPSK, 16-QAM and 64-QAM respectively.
-
-\image html QAMmodulation.png "QAM Modulation Mapping"
-\image latex QAMmodulation.png "QAM Modulation Mapping" width=15cm
-
-* @}
-* @}
-* @defgroup _openair_mac_layer_specs_ MAC Layer (MAC) Specifications
-* @ingroup _openair_specs_
-*/
-
-
-#endif /*__PHY_DEFS_SPEC_H__ */
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/openair1/PHY/spec_defs_top.h b/openair1/PHY/spec_defs_top.h
deleted file mode 100755
index 8f647f1eacc676087f545725ff0b778e445d6a19..0000000000000000000000000000000000000000
--- a/openair1/PHY/spec_defs_top.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
-    OpenAirInterface
-    Copyright(c) 1999 - 2014 Eurecom
-
-    OpenAirInterface is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-
-    OpenAirInterface is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with OpenAirInterface.The full GNU General Public License is
-   included in this distribution in the file called "COPYING". If not,
-   see <http://www.gnu.org/licenses/>.
-
-  Contact Information
-  OpenAirInterface Admin: openair_admin@eurecom.fr
-  OpenAirInterface Tech : openair_tech@eurecom.fr
-  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
-
-  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
-
- *******************************************************************************/
-#ifndef __PHY_SPEC_DEFS_TOP_H__
-#define __PHY_SPEC_DEFS_TOP_H__
-
-#include "types.h"
-
-
-
-/*! \brief Extension Type */
-typedef enum {
-  CYCLIC_PREFIX,
-  CYCLIC_SUFFIX,
-  ZEROS,
-  NONE
-} Extension_t;
-
-
-/// mod_sym_t is the type of txdataF
-#ifdef IFFT_FPGA
-typedef unsigned char mod_sym_t;
-#else
-typedef int mod_sym_t;
-#endif //IFFT_FPGA
-
-
-#endif /*__PHY_SPEC_DEFS_TOP_H__ */
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/openair1/PHY/vars.h b/openair1/PHY/vars.h
index 87683ede062140f5a785d4f29aeda507dce121a0..6dcafc91e5d5ea380c3e873d6387fbc682bb1746 100755
--- a/openair1/PHY/vars.h
+++ b/openair1/PHY/vars.h
@@ -81,7 +81,7 @@ unsigned char NB_RN_INST=0;
 unsigned char NB_INST=0;
 #endif
 
-unsigned int ULSCH_max_consecutive_errors = 10;
+unsigned int ULSCH_max_consecutive_errors = 20;
 
 int number_of_cards;
 
diff --git a/openair1/SCHED/defs.h b/openair1/SCHED/defs.h
index e0ca3f57b09a2b15ab2cd98269428b6a90491ad9..3a553143dfff307a6e935af6ffef3ef6688a675e 100644
--- a/openair1/SCHED/defs.h
+++ b/openair1/SCHED/defs.h
@@ -420,14 +420,10 @@ uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, ui
 
 uint16_t get_Np(uint8_t N_RB_DL,uint8_t nCCE,uint8_t plus1);
 
-int get_nCCE_offset(unsigned char L, int nCCE, int common_dci, unsigned short rnti, unsigned char subframe);
-
-void put_harq_pid_in_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid);
-void remove_harq_pid_from_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid);
 
 int8_t find_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB);
 int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB);
-int32_t remove_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag);
+int mac_phy_remove_ue(module_id_t Mod_idP,rnti_t rnti);
 
 void process_timing_advance(module_id_t Mod_id,uint8_t CC_id,int16_t timing_advance);
 void process_timing_advance_rar(PHY_VARS_UE *phy_vars_ue,uint16_t timing_advance);
diff --git a/openair1/SCHED/phy_mac_stub.c b/openair1/SCHED/phy_mac_stub.c
new file mode 100644
index 0000000000000000000000000000000000000000..a7da9f9cc5eae6871e003268bbc30d9a1085eaf1
--- /dev/null
+++ b/openair1/SCHED/phy_mac_stub.c
@@ -0,0 +1,768 @@
+/*******************************************************************************
+    OpenAirInterface
+    Copyright(c) 1999 - 2014 Eurecom
+
+    OpenAirInterface is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+
+    OpenAirInterface is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenAirInterface.The full GNU General Public License is
+   included in this distribution in the file called "COPYING". If not,
+   see <http://www.gnu.org/licenses/>.
+
+  Contact Information
+  OpenAirInterface Admin: openair_admin@eurecom.fr
+  OpenAirInterface Tech : openair_tech@eurecom.fr
+  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+
+  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+ *******************************************************************************/
+
+/*! \file phy_mac_stub.c
+ * \brief stimulates the phy without mac
+ * \author R. Knopp, F. Kaltenberger, N. Nikaein
+ * \date 2011
+ * \version 0.1
+ * \company Eurecom
+ * \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr,navid.nikaein@eurecom.fr
+ * \note
+ * \warning
+ */
+
+#include "PHY/defs.h"
+#include "PHY/extern.h"
+#include "SCHED/defs.h"
+#include "SCHED/extern.h"
+#include "LAYER2/MAC/extern.h"
+
+#ifdef EMOS
+#include "SCHED/phy_procedures_emos.h"
+#endif
+
+void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_eNB)
+{
+
+  //uint8_t cooperation_flag = phy_vars_eNB->cooperation_flag;
+  uint8_t transmission_mode = phy_vars_eNB->transmission_mode[0];
+
+  uint32_t rballoc = 0x7FFF;
+  //uint32_t rballoc2 = 0x000F;
+  uint32_t rballoc_test = 0xFFFF;
+  int subframe = phy_vars_eNB->proc[sched_subframe].subframe_tx;
+
+  LTE_eNB_DLSCH_t *DLSCH_ptr = phy_vars_eNB->dlsch_eNB[0][0];
+
+  /*
+    uint32_t rand = taus();
+    if ((subframe==8) || (subframe==9) || (subframe==0))
+    rand = (rand%5)+5;
+    else
+    rand = (rand%4)+5;
+  */
+  uint32_t bcch_pdu;
+  uint64_t dlsch_pdu;
+
+  DCI_pdu->Num_common_dci = 0;
+  DCI_pdu->Num_ue_spec_dci=0;
+
+  switch (subframe) {
+  case 5:
+    DCI_pdu->Num_common_dci = 1;
+    DCI_pdu->dci_alloc[0].L          = 2;
+    DCI_pdu->dci_alloc[0].rnti       = SI_RNTI;
+    DCI_pdu->dci_alloc[0].format     = format1A;
+    DCI_pdu->dci_alloc[0].ra_flag    = 0;
+
+    switch (phy_vars_eNB->lte_frame_parms.N_RB_DL) {
+    case 6:
+      if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) {
+        DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_1_5MHz_FDD_t;
+        ((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->type              = 1;
+        ((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->vrb_type          = 0;
+        ((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->rballoc           = computeRIV(25,10,3);
+        ((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->ndi               = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
+        ((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->rv                = 1;
+        ((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->mcs               = 1;
+        ((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->harq_pid          = 0;
+        ((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->TPC               = 1;      // set to 3 PRB
+        memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&bcch_pdu,sizeof(DCI1A_1_5MHz_TDD_1_6_t));
+      } else {
+        DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_1_5MHz_TDD_1_6_t;
+        ((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->type              = 1;
+        ((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->vrb_type          = 0;
+        ((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->rballoc           = computeRIV(25,10,3);
+        ((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->ndi               = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
+        ((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->rv                = 1;
+        ((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->mcs               = 1;
+        ((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->harq_pid          = 0;
+        ((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->TPC               = 1;      // set to 3 PRB
+        memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&bcch_pdu,sizeof(DCI1A_1_5MHz_TDD_1_6_t));
+      }
+
+      break;
+
+    case 25:
+    default:
+      if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) {
+        DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_5MHz_FDD_t;
+        ((DCI1A_5MHz_FDD_t*)&bcch_pdu)->type              = 1;
+        ((DCI1A_5MHz_FDD_t*)&bcch_pdu)->vrb_type          = 0;
+        ((DCI1A_5MHz_FDD_t*)&bcch_pdu)->rballoc           = computeRIV(25,10,3);
+        ((DCI1A_5MHz_FDD_t*)&bcch_pdu)->ndi               = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
+        ((DCI1A_5MHz_FDD_t*)&bcch_pdu)->rv                = 1;
+        ((DCI1A_5MHz_FDD_t*)&bcch_pdu)->mcs               = 1;
+        ((DCI1A_5MHz_FDD_t*)&bcch_pdu)->harq_pid          = 0;
+        ((DCI1A_5MHz_FDD_t*)&bcch_pdu)->TPC               = 1;      // set to 3 PRB
+        memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&bcch_pdu,sizeof(DCI1A_5MHz_TDD_1_6_t));
+      } else {
+        DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_5MHz_TDD_1_6_t;
+        ((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->type              = 1;
+        ((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->vrb_type          = 0;
+        ((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->rballoc           = computeRIV(25,10,3);
+        ((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->ndi               = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
+        ((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->rv                = 1;
+        ((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->mcs               = 1;
+        ((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->harq_pid          = 0;
+        ((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->TPC               = 1;      // set to 3 PRB
+        memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&bcch_pdu,sizeof(DCI1A_5MHz_TDD_1_6_t));
+      }
+
+      break;
+
+    case 50:
+      if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) {
+        DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_10MHz_FDD_t;
+        ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->type              = 1;
+        ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->vrb_type          = 0;
+        ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->rballoc           = computeRIV(50,10,3);
+        ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->ndi               = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
+        ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->rv                = 1;
+        ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->mcs               = 1;
+        ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->harq_pid          = 0;
+        ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->TPC               = 1;      // set to 3 PRB
+        memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&bcch_pdu,sizeof(DCI1A_10MHz_TDD_1_6_t));
+      } else {
+        DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_10MHz_TDD_1_6_t;
+        ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->type              = 1;
+        ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->vrb_type          = 0;
+        ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->rballoc           = computeRIV(50,10,3);
+        ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->ndi               = subframe / 5;
+        ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->rv                = 1;
+        ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->mcs               = 1;
+        ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->harq_pid          = subframe % 5;
+        ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->TPC               = 1;      // set to 3 PRB
+        memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&bcch_pdu,sizeof(DCI1A_10MHz_TDD_1_6_t));
+      }
+
+      break;
+
+    case 100:
+      if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) {
+        DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_20MHz_FDD_t;
+        ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->type              = 1;
+        ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->vrb_type          = 0;
+        ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->rballoc           = computeRIV(100,10,3);
+        ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->ndi               = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
+        ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->rv                = 1;
+        ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->mcs               = 1;
+        ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->harq_pid          = 0;
+        ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->TPC               = 1;      // set to 3 PRB
+        memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&bcch_pdu,sizeof(DCI1A_20MHz_TDD_1_6_t));
+      } else {
+        DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_20MHz_TDD_1_6_t;
+        ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->type              = 1;
+        ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->vrb_type          = 0;
+        ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->rballoc           = computeRIV(100,10,3);
+        ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->ndi               = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
+        ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->rv                = 1;
+        ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->mcs               = 1;
+        ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->harq_pid          = 0;
+        ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->TPC               = 1;      // set to 3 PRB
+        memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&bcch_pdu,sizeof(DCI1A_20MHz_TDD_1_6_t));
+      }
+
+      break;
+    }
+    break; //subframe switch
+
+    /*
+  case 6:
+      DCI_pdu->Num_ue_spec_dci = 1;
+      DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI2_5MHz_2A_M10PRB_TDD_t;
+      DCI_pdu->dci_alloc[0].L          = 2;
+      DCI_pdu->dci_alloc[0].rnti       = 0x1236;
+      DCI_pdu->dci_alloc[0].format     = format2_2A_M10PRB;
+      DCI_pdu->dci_alloc[0].ra_flag    = 0;
+
+      DLSCH_alloc_pdu1.rballoc          = 0x00ff;
+      DLSCH_alloc_pdu1.TPC              = 0;
+      DLSCH_alloc_pdu1.dai              = 0;
+      DLSCH_alloc_pdu1.harq_pid         = 0;
+      DLSCH_alloc_pdu1.tb_swap          = 0;
+      DLSCH_alloc_pdu1.mcs1             = 0;
+      DLSCH_alloc_pdu1.ndi1             = 1;
+      DLSCH_alloc_pdu1.rv1              = 0;
+      DLSCH_alloc_pdu1.tpmi             = 0;
+      memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&DLSCH_alloc_pdu1,sizeof(DCI2_5MHz_2A_M10PRB_TDD_t));
+    break;
+    */
+
+  default:
+  case 7:
+    DCI_pdu->Num_ue_spec_dci = 1;
+    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;
+
+    if (transmission_mode<3) {
+      //user 1
+      switch (phy_vars_eNB->lte_frame_parms.N_RB_DL) {
+      case 25:
+        if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) {
+          DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_5MHz_FDD_t;
+
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc          = rballoc; //computeRIV(25,10,3);
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->TPC              = 0;
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid         = subframe % 5;
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs              = openair_daq_vars.target_ue_dl_mcs;
+          //((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs            = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi              = subframe / 5;
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv               = 0;
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rah              = 0;
+
+          memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_5MHz_FDD_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;
+
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc          = rballoc2;
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->TPC              = 0;
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->dai              = 0;
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid         = 1;
+          //((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs              = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs              = openair_daq_vars.target_ue_dl_mcs;
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi              = 1;
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv               = 0;
+          memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_5MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_5MHz_TDD_t));
+          */
+        } else {
+          DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_5MHz_TDD_t;
+
+          ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rballoc          = rballoc; //computeRIV(25,10,3);
+          ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->TPC              = 0;
+          ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->dai              = 0;
+          ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->harq_pid         = subframe % 5;
+          ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->mcs              = openair_daq_vars.target_ue_dl_mcs;
+          //((DCI1_5MHz_TDD_t *)&dlsch_pdu)->mcs            = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
+          ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->ndi              = subframe / 5;
+          ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rv               = 0;
+          ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rah              = 0;
+          memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_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;
+
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc          = rballoc2;
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->TPC              = 0;
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->dai              = 0;
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid         = 1;
+          //((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs              = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs              = openair_daq_vars.target_ue_dl_mcs;
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi              = 1;
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv               = 0;
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rah              = 0;
+          memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_5MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_5MHz_TDD_t));
+          */
+        }
+
+        break;
+
+      case 50:
+
+        if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) {
+          DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_10MHz_FDD_t;
+
+          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rballoc          = rballoc; //computeRIV(50,10,3);
+          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->TPC              = 0;
+          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->harq_pid         = subframe % 5;
+          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs              = openair_daq_vars.target_ue_dl_mcs;
+          //((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs            = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
+          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->ndi              = subframe / 5;
+          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rv               = 0;
+          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rah              = 0;
+
+          memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_10MHz_FDD_t));
+
+          /*
+          //user2
+          DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_10MHz_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;
+
+          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rballoc          = rballoc2;
+          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->TPC              = 0;
+          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->dai              = 0;
+          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->harq_pid         = 1;
+          //((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs              = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
+          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs              = openair_daq_vars.target_ue_dl_mcs;
+          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->ndi              = 1;
+          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rv               = 0;
+          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rah              = 0;
+          memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_10MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_10MHz_TDD_t));
+          */
+        } else {
+          DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_10MHz_TDD_t;
+
+          ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->rballoc          = rballoc; //computeRIV(50,10,3);
+          ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->TPC              = 0;
+          ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->dai              = 0;
+          ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->harq_pid         = subframe % 5;
+          ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->mcs              = openair_daq_vars.target_ue_dl_mcs;
+          //((DCI1_10MHz_TDD_t *)&dlsch_pdu)->mcs            = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
+          ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->ndi              = subframe / 5;
+          ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->rv               = 0;
+          ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->rah              = 0;
+          memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_10MHz_TDD_t));
+
+          /*
+          //user2
+          DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_10MHz_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;
+
+          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rballoc          = rballoc2;
+          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->TPC              = 0;
+          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->dai              = 0;
+          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->harq_pid         = 1;
+          //((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs              = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
+          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs              = openair_daq_vars.target_ue_dl_mcs;
+          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->ndi              = 1;
+          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rv               = 0;
+          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rah              = 0;
+          memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_10MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_10MHz_TDD_t));
+          */
+        }
+
+        break;
+
+      case 100:
+        if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) {
+          DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_20MHz_FDD_t;
+
+          ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rballoc          = rballoc; //computeRIV(100,10,3);
+          ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->TPC              = 0;
+          ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->harq_pid         = subframe % 5;
+          ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->mcs              = openair_daq_vars.target_ue_dl_mcs;
+          //((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs             = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
+          ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->ndi              = subframe / 5;
+          ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rv               = 0;
+          ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rah              = 0;
+
+          memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_20MHz_FDD_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;
+
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc          = rballoc2;
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->TPC              = 0;
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->dai              = 0;
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid         = 1;
+          //((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs              = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs              = openair_daq_vars.target_ue_dl_mcs;
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi              = 1;
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv               = 0;
+          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rah              = 0;
+          memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_5MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_5MHz_TDD_t));
+          */
+        } else {
+          DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_20MHz_TDD_t;
+
+          ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->rballoc          = rballoc; //computeRIV(100,10,3);
+          ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->TPC              = 0;
+          ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->dai              = 0;
+          ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->harq_pid         = subframe % 5;
+          ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->mcs              = openair_daq_vars.target_ue_dl_mcs;
+          //((DCI1_20MHz_TDD_t *)&dlsch_pdu)->mcs            = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
+          ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->ndi              = subframe / 5;
+          ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->rv               = 0;
+          ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->rah              = 0;
+          memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_20MHz_TDD_t));
+
+          /*
+          //user2
+          DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_20MHz_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;
+
+          ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rballoc          = rballoc2;
+          ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->TPC              = 0;
+          ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->dai              = 0;
+          ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->harq_pid         = 1;
+          //((DCI1_20MHz_FDD_t *)&dlsch_pdu)->mcs              = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
+          ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->mcs              = openair_daq_vars.target_ue_dl_mcs;
+          ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->ndi              = 1;
+          ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rv               = 0;
+          ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rah              = 0;
+          memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_20MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_5MHz_TDD_t));
+          */
+        }
+
+        break;
+      }
+    } else if (transmission_mode==4) {
+      DCI_pdu->Num_ue_spec_dci = 1;
+      // user 1
+      DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI2_5MHz_2A_FDD_t;
+      DCI_pdu->dci_alloc[0].L          = 3;
+      DCI_pdu->dci_alloc[0].rnti       = 0x1235;
+      DCI_pdu->dci_alloc[0].format     = format2;
+      DCI_pdu->dci_alloc[0].ra_flag    = 0;
+
+      ((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->tpmi     = 0;
+      ((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->rv1      = 0;
+      ((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->ndi1     = subframe / 5;
+      ((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->mcs1     = openair_daq_vars.target_ue_dl_mcs;
+      ((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->rv2      = 0;
+      ((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->ndi2     = subframe / 5;
+      ((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->mcs2     = openair_daq_vars.target_ue_dl_mcs;
+      ((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->tb_swap  = 0;
+      ((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->harq_pid = subframe % 5;
+      ((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->TPC      = 0;
+      ((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->rballoc  = openair_daq_vars.ue_dl_rb_alloc;
+      ((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->rah      = 0;
+
+    } else if (transmission_mode==5) {
+      DCI_pdu->Num_ue_spec_dci = 2;
+      // user 1
+      DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t;
+      DCI_pdu->dci_alloc[0].L          = 3;
+      DCI_pdu->dci_alloc[0].rnti       = 0x1235;
+      DCI_pdu->dci_alloc[0].format     = format1E_2A_M10PRB;
+      DCI_pdu->dci_alloc[0].ra_flag    = 0;
+
+      DLSCH_alloc_pdu1E.tpmi             = 5; //5=use feedback
+      DLSCH_alloc_pdu1E.rv               = 0;
+      DLSCH_alloc_pdu1E.ndi              = subframe / 5;
+      //DLSCH_alloc_pdu1E.mcs            = cqi_to_mcs[phy_vars_eNB->eNB_UE_stats->DL_cqi[0]];
+      //DLSCH_alloc_pdu1E.mcs            = (unsigned char) (taus()%28);
+      DLSCH_alloc_pdu1E.mcs              = openair_daq_vars.target_ue_dl_mcs;
+      //DLSCH_alloc_pdu1E.mcs            = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
+      phy_vars_eNB->eNB_UE_stats[0].dlsch_mcs1 = DLSCH_alloc_pdu1E.mcs;
+      DLSCH_alloc_pdu1E.harq_pid         = subframe % 5;
+      DLSCH_alloc_pdu1E.dai              = 0;
+      DLSCH_alloc_pdu1E.TPC              = 0;
+      DLSCH_alloc_pdu1E.rballoc          = openair_daq_vars.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          = 0;
+      DCI_pdu->dci_alloc[1].rnti       = 0x1236;
+      DCI_pdu->dci_alloc[1].format     = format1E_2A_M10PRB;
+      DCI_pdu->dci_alloc[1].ra_flag    = 0;
+      //DLSCH_alloc_pdu1E.mcs            = openair_daq_vars.target_ue_dl_mcs;
+      //DLSCH_alloc_pdu1E.mcs            = (unsigned char) (taus()%28);
+      //DLSCH_alloc_pdu1E.mcs            = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
+      DLSCH_alloc_pdu1E.mcs            = (unsigned char) (((phy_vars_eNB->proc[sched_subframe].frame_tx%1024)/3)%28);
+      phy_vars_eNB->eNB_UE_stats[1].dlsch_mcs1 = DLSCH_alloc_pdu1E.mcs;
+
+      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
+      phy_vars_eNB->eNB_UE_stats[1].DL_pmi_single = (phy_vars_eNB->eNB_UE_stats[0].DL_pmi_single ^ 0x1555);
+    }
+
+    break; //subframe switch
+
+    /*
+      case 8:
+      DCI_pdu->Num_common_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;
+
+      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_ue_spec_dci = 1;
+
+    //user 1
+    if (phy_vars_eNB->lte_frame_parms.frame_type == FDD)
+      DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI0_5MHz_FDD_t ;
+    else
+      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;
+
+    UL_alloc_pdu.type    = 0;
+    UL_alloc_pdu.hopping = 0;
+    UL_alloc_pdu.rballoc = computeRIV(25,2,openair_daq_vars.ue_ul_nb_rb);
+    UL_alloc_pdu.mcs     = openair_daq_vars.target_ue_ul_mcs;
+    UL_alloc_pdu.ndi     = phy_vars_eNB->proc[sched_subframe].frame_tx&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+openair_daq_vars.ue_ul_nb_rb,openair_daq_vars.ue_ul_nb_rb);
+    else
+      UL_alloc_pdu.rballoc = computeRIV(25,0,openair_daq_vars.ue_ul_nb_rb);
+    UL_alloc_pdu.mcs     = openair_daq_vars.target_ue_ul_mcs;
+    UL_alloc_pdu.ndi     = phy_vars_eNB->proc[sched_subframe].frame_tx&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_common_dci+DCI_pdu->Num_ue_spec_dci; i++) {
+    DCI_pdu->nCCE += (1<<(DCI_pdu->dci_alloc[i].L));
+  }
+  */
+}
+
+void fill_dci_emos(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *phy_vars_eNB)
+{
+
+  //uint8_t cooperation_flag = phy_vars_eNB->cooperation_flag;
+  uint8_t transmission_mode = phy_vars_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_common_dci = 0;
+  DCI_pdu->Num_ue_spec_dci=0;
+
+  switch (subframe) {
+  case 5:
+    DCI_pdu->Num_ue_spec_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;
+
+      DLSCH_alloc_pdu.rballoc          = openair_daq_vars.ue_dl_rb_alloc;
+      DLSCH_alloc_pdu.TPC              = 0;
+      DLSCH_alloc_pdu.dai              = 0;
+      DLSCH_alloc_pdu.harq_pid         = 1;
+      DLSCH_alloc_pdu.mcs              = openair_daq_vars.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;
+
+      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              = openair_daq_vars.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_ue_spec_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;
+
+      DLSCH_alloc_pdu1E.tpmi             = 5; //5=use feedback
+      DLSCH_alloc_pdu1E.rv               = 0;
+      DLSCH_alloc_pdu1E.ndi              = 1;
+      DLSCH_alloc_pdu1E.mcs              = openair_daq_vars.target_ue_dl_mcs;
+      DLSCH_alloc_pdu1E.harq_pid         = 1;
+      DLSCH_alloc_pdu1E.dai              = 0;
+      DLSCH_alloc_pdu1E.TPC              = 0;
+      DLSCH_alloc_pdu1E.rballoc          = openair_daq_vars.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;
+
+      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
+      phy_vars_eNB->eNB_UE_stats[1].DL_pmi_single = (phy_vars_eNB->eNB_UE_stats[0].DL_pmi_single ^ 0x1555);
+    }
+
+    break;
+
+  case 7:
+    DCI_pdu->Num_common_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;
+
+    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_ue_spec_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;
+
+    UL_alloc_pdu.type    = 0;
+    UL_alloc_pdu.hopping = 0;
+    UL_alloc_pdu.rballoc = computeRIV(25,0,openair_daq_vars.ue_ul_nb_rb);
+    UL_alloc_pdu.mcs     = openair_daq_vars.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+openair_daq_vars.ue_ul_nb_rb,openair_daq_vars.ue_ul_nb_rb);
+    else
+    UL_alloc_pdu.rballoc = computeRIV(25,0,openair_daq_vars.ue_ul_nb_rb);
+    UL_alloc_pdu.mcs     = openair_daq_vars.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_common_dci+DCI_pdu->Num_ue_spec_dci; i++) {
+    DCI_pdu->nCCE += (1<<(DCI_pdu->dci_alloc[i].L));
+  }
+  */
+}
diff --git a/openair1/SCHED/phy_procedures_lte_common.c b/openair1/SCHED/phy_procedures_lte_common.c
index 2cf690cc6bcda1618f9fb0d3bf0aa91488e3372d..39238bd681272f5edfa99bbdaee98c242764175d 100755
--- a/openair1/SCHED/phy_procedures_lte_common.c
+++ b/openair1/SCHED/phy_procedures_lte_common.c
@@ -39,8 +39,6 @@
 */
 #include "PHY/defs.h"
 #include "PHY/extern.h"
-#include "MAC_INTERFACE/defs.h"
-#include "MAC_INTERFACE/extern.h"
 #include "SCHED/defs.h"
 #include "SCHED/extern.h"
 
@@ -405,8 +403,8 @@ uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,
 
           if (harq_ack[0].send_harq_status == 1)
             o_ACK[1] = harq_ack[0].ack;
-        } else if (harq_ack[8].send_harq_status == 1)
-          o_ACK[0] = harq_ack[8].ack;
+        } else if (harq_ack[0].send_harq_status == 1)
+          o_ACK[0] = harq_ack[0].ack;
 
         status = harq_ack[9].send_harq_status + (harq_ack[0].send_harq_status<<1);
         //printf("Subframe 4, TDD config 3: harq_ack[9] = %d,harq_ack[0] = %d\n",harq_ack[9].ack,harq_ack[0].ack);
diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c
old mode 100644
new mode 100755
index f4f28bced1f79e7d1bc41aa32a51974aa14e62fc..70bd81f89bdcdc0e7d4f0784852dd34dd2ab0cf6
--- a/openair1/SCHED/phy_procedures_lte_eNb.c
+++ b/openair1/SCHED/phy_procedures_lte_eNb.c
@@ -1,3 +1,4 @@
+
 /*******************************************************************************
     OpenAirInterface
     Copyright(c) 1999 - 2014 Eurecom
@@ -40,8 +41,6 @@
 
 #include "PHY/defs.h"
 #include "PHY/extern.h"
-#include "MAC_INTERFACE/defs.h"
-#include "MAC_INTERFACE/extern.h"
 #include "SCHED/defs.h"
 #include "SCHED/extern.h"
 
@@ -52,12 +51,12 @@
 //#define DEBUG_PHY_PROC (Already defined in cmake)
 //#define DEBUG_ULSCH
 
-//#ifdef OPENAIR2
 #include "LAYER2/MAC/extern.h"
 #include "LAYER2/MAC/defs.h"
 #include "UTIL/LOG/log.h"
 #include "UTIL/LOG/vcd_signal_dumper.h"
-//#endif
+
+#include "T.h"
 
 #include "assertions.h"
 #include "msc.h"
@@ -76,18 +75,17 @@
 #define PUCCH 1
 
 extern int exit_openair;
-//extern void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms);
 
 
-unsigned char dlsch_input_buffer[2700] __attribute__ ((aligned(16)));
-int eNB_sync_buffer0[640*6] __attribute__ ((aligned(16)));
-int eNB_sync_buffer1[640*6] __attribute__ ((aligned(16)));
+unsigned char dlsch_input_buffer[2700] __attribute__ ((aligned(32)));
+int eNB_sync_buffer0[640*6] __attribute__ ((aligned(32)));
+int eNB_sync_buffer1[640*6] __attribute__ ((aligned(32)));
 int *eNB_sync_buffer[2] = {eNB_sync_buffer0, eNB_sync_buffer1};
 
 extern uint16_t hundred_times_log10_NPRB[100];
 
 unsigned int max_peak_val;
-int max_sect_id, max_sync_pos;
+int max_sync_pos;
 
 //DCI_ALLOC_t dci_alloc[8];
 
@@ -104,7 +102,6 @@ extern uint8_t smbv_frame_cnt;
 #ifdef DIAG_PHY
 extern int rx_sig_fifo;
 #endif
-static unsigned char I0_clear = 1;
 
 uint8_t is_SR_subframe(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id,uint8_t sched_subframe)
 {
@@ -136,30 +133,6 @@ uint8_t is_SR_subframe(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id,uint8_t sched_su
   return(0);
 }
 
-void put_harq_pid_in_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid)
-{
-  DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->tail_freelist] = harq_pid;
-  DLSCH_ptr->tail_freelist = (DLSCH_ptr->tail_freelist + 1) % 10;
-}
-
-void remove_harq_pid_from_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid)
-{
-  if (DLSCH_ptr->head_freelist == DLSCH_ptr->tail_freelist) {
-    LOG_E(PHY, "%s:%d: you cannot read this!\n", __FILE__, __LINE__);
-    abort();
-  }
-  /* basic check, in case several threads deal with the free list at the same time
-   * in normal situations it should not happen, that's also why we don't use any
-   * locking mechanism to protect the free list
-   * to be refined in case things don't work properly
-   */
-  if (harq_pid != DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist]) {
-    LOG_E(PHY, "%s:%d: critical error, get in touch with the authors\n", __FILE__, __LINE__);
-    abort();
-  }
-  DLSCH_ptr->head_freelist = (DLSCH_ptr->head_freelist + 1) % 10;
-}
-
 #if 0
 int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB)
 {
@@ -180,19 +153,19 @@ int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB)
     } else {
       if (phy_vars_eNB->eNB_UE_stats[i].crnti==0) {
         MSC_LOG_EVENT(MSC_PHY_ENB, "0 Add ue %"PRIx16" ", rnti);
-        LOG_I(PHY,"UE_id %d associated with rnti %x\n",i, (uint16_t)rnti);
+        LOG_D(PHY,"UE_id %d associated with rnti %x\n",i, (uint16_t)rnti);
         phy_vars_eNB->dlsch_eNB[i][0]->rnti = rnti;
         phy_vars_eNB->ulsch_eNB[i]->rnti = rnti;
         phy_vars_eNB->eNB_UE_stats[i].crnti = rnti;
 
-        phy_vars_eNB->eNB_UE_stats[i].Po_PUCCH1_below = 0;
-        phy_vars_eNB->eNB_UE_stats[i].Po_PUCCH1_above = (int32_t)pow(10.0,.1*(phy_vars_eNB->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH+phy_vars_eNB->rx_total_gain_eNB_dB));
-        phy_vars_eNB->eNB_UE_stats[i].Po_PUCCH        = (int32_t)pow(10.0,.1*(phy_vars_eNB->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH+phy_vars_eNB->rx_total_gain_eNB_dB));
-        LOG_I(PHY,"Initializing Po_PUCCH: p0_NominalPUCCH %d, gain %d => %d\n",
-              phy_vars_eNB->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH,
-              phy_vars_eNB->rx_total_gain_eNB_dB,
-              phy_vars_eNB->eNB_UE_stats[i].Po_PUCCH);
-
+	phy_vars_eNB->eNB_UE_stats[i].Po_PUCCH1_below = 0;
+	phy_vars_eNB->eNB_UE_stats[i].Po_PUCCH1_above = (int32_t)pow(10.0,.1*(phy_vars_eNB->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH+phy_vars_eNB->rx_total_gain_eNB_dB));
+	phy_vars_eNB->eNB_UE_stats[i].Po_PUCCH        = (int32_t)pow(10.0,.1*(phy_vars_eNB->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH+phy_vars_eNB->rx_total_gain_eNB_dB));
+	LOG_D(PHY,"Initializing Po_PUCCH: p0_NominalPUCCH %d, gain %d => %d\n",
+	      phy_vars_eNB->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH,
+	      phy_vars_eNB->rx_total_gain_eNB_dB,
+	      phy_vars_eNB->eNB_UE_stats[i].Po_PUCCH);
+  
         return(i);
       }
     }
@@ -264,98 +237,88 @@ abort();
 
   return ret;
 }
-#endif
+#endif //#if 0
 
 #if 0
-int32_t remove_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB, uint8_t abstraction_flag)
-{
+int mac_phy_remove_ue(module_id_t Mod_idP,rnti_t rntiP) {
   uint8_t i;
-  int j;
+  int j,CC_id;
+  PHY_VARS_eNB *phy_vars_eNB;
 
-  for (i=0; i<NUMBER_OF_UE_MAX; i++) {
-    if ((phy_vars_eNB->dlsch_eNB[i]==NULL) || (phy_vars_eNB->ulsch_eNB[i]==NULL)) {
-      MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (ENOMEM)", rnti);
-      LOG_E(PHY,"Can't remove UE, not enough memory allocated\n");
-      return(-1);
-    } else {
-      if (phy_vars_eNB->eNB_UE_stats[i].crnti==rnti) {
-        MSC_LOG_EVENT(MSC_PHY_ENB, "0 Removed ue %"PRIx16" ", rnti);
+  for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
+    phy_vars_eNB = PHY_vars_eNB_g[Mod_idP][CC_id];
+    for (i=0; i<NUMBER_OF_UE_MAX; i++) {
+      if ((phy_vars_eNB->dlsch_eNB[i]==NULL) || (phy_vars_eNB->ulsch_eNB[i]==NULL)) {
+	MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (ENOMEM)", rnti);
+	LOG_E(PHY,"Can't remove UE, not enough memory allocated\n");
+	return(-1);
+      } else {
+	if (phy_vars_eNB->eNB_UE_stats[i].crnti==rntiP) {
+	  MSC_LOG_EVENT(MSC_PHY_ENB, "0 Removed ue %"PRIx16" ", rntiP);
 #ifdef DEBUG_PHY_PROC
-        LOG_I(PHY,"eNB %d removing UE %d with rnti %x\n",phy_vars_eNB->Mod_id,i,rnti);
-#endif
-        //msg("[PHY] UE_id %d\n",i);
-        clean_eNb_dlsch(phy_vars_eNB->dlsch_eNB[i][0], abstraction_flag);
-        clean_eNb_ulsch(phy_vars_eNB->ulsch_eNB[i],abstraction_flag);
-        //phy_vars_eNB->eNB_UE_stats[i].crnti = 0;
-        memset(&phy_vars_eNB->eNB_UE_stats[i],0,sizeof(LTE_eNB_UE_stats));
-        //  mac_exit_wrapper("Removing UE");
-
-        /* clear the harq pid freelist */
-        phy_vars_eNB->dlsch_eNB[i][0]->head_freelist = 0;
-        phy_vars_eNB->dlsch_eNB[i][0]->tail_freelist = 0;
-        for (j = 0; j < 8; j++)
-          put_harq_pid_in_freelist(phy_vars_eNB->dlsch_eNB[i][0], j);
-
-        return(i);
+	  LOG_I(PHY,"eNB %d removing UE %d with rnti %x\n",phy_vars_eNB->Mod_id,i,rnti);
+#endif
+	  //msg("[PHY] UE_id %d\n",i);
+	  clean_eNb_dlsch(phy_vars_eNB->dlsch_eNB[i][0]);
+	  clean_eNb_ulsch(phy_vars_eNB->ulsch_eNB[i]);
+	  //phy_vars_eNB->eNB_UE_stats[i].crnti = 0;
+	  memset(&phy_vars_eNB->eNB_UE_stats[i],0,sizeof(LTE_eNB_UE_stats));
+	  //  mac_exit_wrapper("Removing UE");
+	  
+	  return(i);
+	}
       }
     }
   }
-
-  MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (not found)", rnti);
+  MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (not found)", rntiP);
   return(-1);
 }
 #else
-int32_t remove_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB, uint8_t abstraction_flag)
+int mac_phy_remove_ue(module_id_t Mod_idP,rnti_t rntiP)
 {
   int i;
-  int j;
+  int CC_id;
   int ret = -1;
-  int CC;
+  PHY_VARS_eNB *phy_vars_eNB;
 
-  for (CC = 0; CC < MAX_NUM_CCs; CC++) {
-    phy_vars_eNB = PHY_vars_eNB_g[0][CC];
+  for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
+    phy_vars_eNB = PHY_vars_eNB_g[Mod_idP][CC_id];
     for (i=0; i<NUMBER_OF_UE_MAX; i++) {
       if ((phy_vars_eNB->dlsch_eNB[i]==NULL) || (phy_vars_eNB->ulsch_eNB[i]==NULL)) {
-        MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (ENOMEM)", rnti);
-        LOG_E(PHY,"Can't remove UE, not enough memory allocated\n");
+	MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (ENOMEM)", rnti);
+	LOG_E(PHY,"Can't remove UE, not enough memory allocated\n");
 abort();
-        return -1;
+	return -1;
       } else {
-        if (phy_vars_eNB->eNB_UE_stats[i].crnti==rnti) {
-          MSC_LOG_EVENT(MSC_PHY_ENB, "0 Removed ue %"PRIx16" ", rnti);
+	if (phy_vars_eNB->eNB_UE_stats[i].crnti==rntiP) {
+	  MSC_LOG_EVENT(MSC_PHY_ENB, "0 Removed ue %"PRIx16" ", rntiP);
 #ifdef DEBUG_PHY_PROC
-          LOG_I(PHY,"eNB %d removing UE %d with rnti %x\n",phy_vars_eNB->Mod_id,i,rnti);
-#endif
-          //msg("[PHY] UE_id %d\n",i);
-          clean_eNb_dlsch(phy_vars_eNB->dlsch_eNB[i][0], abstraction_flag);
-          clean_eNb_ulsch(phy_vars_eNB->ulsch_eNB[i],abstraction_flag);
-          //phy_vars_eNB->eNB_UE_stats[i].crnti = 0;
-          memset(&phy_vars_eNB->eNB_UE_stats[i],0,sizeof(LTE_eNB_UE_stats));
-          //  mac_exit_wrapper("Removing UE");
-
-          /* clear the harq pid freelist */
-          phy_vars_eNB->dlsch_eNB[i][0]->head_freelist = 0;
-          phy_vars_eNB->dlsch_eNB[i][0]->tail_freelist = 0;
-          for (j = 0; j < 8; j++)
-            put_harq_pid_in_freelist(phy_vars_eNB->dlsch_eNB[i][0], j);
-
+	  LOG_I(PHY,"eNB %d removing UE %d with rnti %x\n",phy_vars_eNB->Mod_id,i,rnti);
+#endif
+	  //msg("[PHY] UE_id %d\n",i);
+	  clean_eNb_dlsch(phy_vars_eNB->dlsch_eNB[i][0]);
+	  clean_eNb_ulsch(phy_vars_eNB->ulsch_eNB[i]);
+	  //phy_vars_eNB->eNB_UE_stats[i].crnti = 0;
+	  memset(&phy_vars_eNB->eNB_UE_stats[i],0,sizeof(LTE_eNB_UE_stats));
+	  //  mac_exit_wrapper("Removing UE");
+	  
           if (ret != -1 && i != ret) {
             printf("bad in remove_ue\n");
             abort();
           }
           ret = i;
           break;
-        }
+	}
       }
     }
   }
 
   if (ret == -1) {
-    MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (not found)", rnti);
+    MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (not found)", rntiP);
   }
   return ret;
 }
-#endif
+#endif //#if 0
 
 int8_t find_next_ue_index(PHY_VARS_eNB *phy_vars_eNB)
 {
@@ -379,9 +342,8 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16
   LTE_eNB_DLSCH_t *DLSCH_ptr;
   LTE_eNB_ULSCH_t *ULSCH_ptr;
   uint8_t ulsch_subframe,ulsch_frame;
-  uint8_t i;
+  int i;
   int8_t UE_id = find_ue(rnti,PHY_vars_eNB_g[Mod_id][CC_id]);
-  int sf1=(10*frame)+subframe,sf2,sfdiff,sfdiff_max=7;
 
   if (UE_id==-1) {
     LOG_D(PHY,"Cannot find UE with rnti %x (Mod_id %d, CC_id %d)\n",rnti, Mod_id, CC_id);
@@ -392,40 +354,19 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16
   if (ul_flag == 0)  {// this is a DL request
     DLSCH_ptr = PHY_vars_eNB_g[Mod_id][CC_id]->dlsch_eNB[(uint32_t)UE_id][0];
 
-    // set to no available process first
-    *harq_pid = -1;
-
-    for (i=0; i<DLSCH_ptr->Mdlharq; i++) {
-      if (DLSCH_ptr->harq_processes[i]!=NULL) {
-        if (DLSCH_ptr->harq_processes[i]->status == ACTIVE) {
-	  sf2 = (DLSCH_ptr->harq_processes[i]->frame*10) + DLSCH_ptr->harq_processes[i]->subframe;
-	  if (sf2<=sf1)
-	    sfdiff = sf1-sf2;
-	  else // this happens when wrapping around 1024 frame barrier
-	    sfdiff = 10240 + sf1-sf2;
-	  LOG_D(PHY,"process %d is active, round %d (waiting %d)\n",i,DLSCH_ptr->harq_processes[i]->round,sfdiff);
-
-	  if (sfdiff>sfdiff_max) { // this is an active process that is waiting longer than the others (and longer than 7 ms)
-	    sfdiff_max = sfdiff; 
-	    *harq_pid = i;
-	    *round = DLSCH_ptr->harq_processes[i]->round;
-	  }
-	}
-      } else { // a process is not defined
-	LOG_E(PHY,"[eNB %d] DLSCH process %d for rnti %x (UE_id %d) not allocated\n",Mod_id,i,rnti,UE_id);
-	return(-1);
-      }
-    }
+    /* let's go synchronous for the moment - maybe we can change at some point */
+    i = (frame * 10 + subframe) % 8;
 
-    /* if no active harq pid, get the oldest in the freelist, if any */
-    if (*harq_pid == 255 && DLSCH_ptr->head_freelist != DLSCH_ptr->tail_freelist) {
-      *harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
+    if (DLSCH_ptr->harq_processes[i]->status == ACTIVE) {
+      *harq_pid = i;
+      *round = DLSCH_ptr->harq_processes[i]->round;
+    } else if (DLSCH_ptr->harq_processes[i]->status == SCH_IDLE) {
+      *harq_pid = i;
       *round = 0;
-      LOG_D(PHY,"process %d is first free process\n", *harq_pid);
+    } else {
+      printf("%s:%d: bad state for harq process - PLEASE REPORT!!\n", __FILE__, __LINE__);
+      abort();
     }
-
-    LOG_D(PHY,"get_ue_active_harq_pid DL => Frame %d, Subframe %d : harq_pid %d\n",
-	  frame,subframe,*harq_pid);
   } else { // This is a UL request
 
     ULSCH_ptr = PHY_vars_eNB_g[Mod_id][CC_id]->ulsch_eNB[(uint32_t)UE_id];
@@ -442,100 +383,6 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16
   return(0);
 }
 
-int CCE_table[800];
-
-void init_nCCE_table(void)
-{
-  memset(CCE_table,0,800*sizeof(int));
-}
-
-
-int get_nCCE_offset(const unsigned char L, const int nCCE, const int common_dci, const unsigned short rnti, const unsigned char subframe)
-{
-
-  int search_space_free,m,nb_candidates = 0,l,i;
-  unsigned int Yk;
-
-  /*
-    printf("CCE Allocation: ");
-    for (i=0;i<nCCE;i++)
-    printf("%d.",CCE_table[i]);
-    printf("\n");
-  */
-  if (common_dci == 1) {
-    // check CCE(0 ... L-1)
-    nb_candidates = (L==4) ? 4 : 2;
-    nb_candidates = min(nb_candidates,nCCE/L);
-
-    for (m = nb_candidates-1 ; m >=0 ; m--) {
-      search_space_free = 1;
-      for (l=0; l<L; l++) {
-        if (CCE_table[(m*L) + l] == 1) {
-          search_space_free = 0;
-          break;
-        }
-      }
-
-      if (search_space_free == 1) {
-        for (l=0; l<L; l++)
-          CCE_table[(m*L)+l]=1;
-        return(m*L);
-      }
-    }
-
-    return(-1);
-
-  } else { // Find first available in ue specific search space
-    // according to procedure in Section 9.1.1 of 36.213 (v. 8.6)
-    // compute Yk
-    Yk = (unsigned int)rnti;
-
-    for (i=0; i<=subframe; i++)
-      Yk = (Yk*39827)%65537;
-
-    Yk = Yk % (nCCE/L);
-
-
-    switch (L) {
-    case 1:
-    case 2:
-      nb_candidates = 6;
-      break;
-
-    case 4:
-    case 8:
-      nb_candidates = 2;
-      break;
-
-    default:
-      DevParam(L, nCCE, rnti);
-      break;
-    }
-
-    //    LOG_I(PHY,"rnti %x, Yk = %d, nCCE %d (nCCE/L %d),nb_cand %d\n",rnti,Yk,nCCE,nCCE/L,nb_candidates);
-
-    for (m = 0 ; m < nb_candidates ; m++) {
-      search_space_free = 1;
-
-      for (l=0; l<L; l++) {
-        if (CCE_table[(((Yk+m)%(nCCE/L))*L) + l] == 1) {
-          search_space_free = 0;
-          break;
-        }
-      }
-
-      if (search_space_free == 1) {
-        for (l=0; l<L; l++)
-          CCE_table[(((Yk+m)%(nCCE/L))*L)+l]=1;
-
-        return(((Yk+m)%(nCCE/L))*L);
-      }
-    }
-
-    return(-1);
-  }
-}
-
 #if Rel10
 
 void ca_config(uint8_t  Mod_id,
@@ -646,72 +493,22 @@ void phy_procedures_emos_eNB_TX(unsigned char subframe, PHY_VARS_eNB *phy_vars_e
 }
 #endif
 
-/*
-  void phy_procedures_eNB_S_TX(unsigned char next_slot,PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag) {
-
-  int sect_id = 0, aa;
-
-  if (next_slot%2==0) {
-  #ifdef DEBUG_PHY_PROC
-  msg("[PHY][eNB %d] Frame %d, slot %d: Generating pilots for DL-S\n",
-  phy_vars_eNB->Mod_id,phy_vars_eNB->frame,next_slot);
-  #endif
-
-  for (sect_id=0;sect_id<number_of_cards;sect_id++) {
-  if (abstraction_flag == 0) {
-
-  for (aa=0; aa<phy_vars_eNB->lte_frame_parms.nb_antennas_tx; aa++) {
-
-
-  #ifdef IFFT_FPGA
-  memset(&phy_vars_eNB->lte_eNB_common_vars.txdataF[sect_id][aa][next_slot*(phy_vars_eNB->lte_frame_parms.N_RB_DL*12)*(phy_vars_eNB->lte_frame_parms.symbols_per_tti>>1)],
-  0,(phy_vars_eNB->lte_frame_parms.N_RB_DL*12)*(phy_vars_eNB->lte_frame_parms.symbols_per_tti>>1)*sizeof(mod_sym_t));
-  #else
-  memset(&phy_vars_eNB->lte_eNB_common_vars.txdataF[sect_id][aa][next_slot*phy_vars_eNB->lte_frame_parms.ofdm_symbol_size*(phy_vars_eNB->lte_frame_parms.symbols_per_tti>>1)],
-  0,phy_vars_eNB->lte_frame_parms.ofdm_symbol_size*(phy_vars_eNB->lte_frame_parms.symbols_per_tti>>1)*sizeof(mod_sym_t));
-  #endif
-  }
-
-  generate_pilots_slot(phy_vars_eNB,
-  phy_vars_eNB->lte_eNB_common_vars.txdataF[sect_id],
-  AMP,
-  next_slot);
-
-  msg("[PHY][eNB] Frame %d, subframe %d Generating PSS\n",
-  phy_vars_eNB->frame,next_slot>>1);
-
-  generate_pss(phy_vars_eNB->lte_eNB_common_vars.txdataF[sect_id],
-  4*AMP,
-  &phy_vars_eNB->lte_frame_parms,
-  2,
-  next_slot);
 
-  }
-  else {
-  #ifdef PHY_ABSTRACTION
-  generate_pss_emul(phy_vars_eNB,sect_id);
-  #endif
-  }
-  }
-  }
-  }
-*/
 
 void phy_procedures_eNB_S_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag,relaying_type_t r_type)
 {
   UNUSED(r_type);
 
-  //  unsigned char sect_id=0;
   int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx;
 
 #ifdef DEBUG_PHY_PROC
   LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_S_RX(%d)\n", phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_rx, subframe);
 #endif
 
-  //  for (sect_id=0;sect_id<number_of_cards;sect_id++) {
 
   if (abstraction_flag == 0) {
     lte_eNB_I0_measurements(phy_vars_eNB,
+			    subframe,
                             0,
                             phy_vars_eNB->first_run_I0_measurements);
   }
@@ -725,8 +522,6 @@ void phy_procedures_eNB_S_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars
 #endif
 
 
-  if (I0_clear == 1)
-    I0_clear = 0;
 }
 
 
@@ -786,693 +581,6 @@ void phy_procedures_emos_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eN
 }
 #endif
 
-#ifndef OPENAIR2
-void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_eNB)
-{
-
-  int i;
-  uint8_t cooperation_flag = phy_vars_eNB->cooperation_flag;
-  uint8_t transmission_mode = phy_vars_eNB->transmission_mode[0];
-
-  uint32_t rballoc = 0x7FFF;
-  uint32_t rballoc2 = 0x000F;
-  int subframe = phy_vars_eNB->proc[sched_subframe].subframe_tx;
-  /*
-    uint32_t rand = taus();
-    if ((subframe==8) || (subframe==9) || (subframe==0))
-    rand = (rand%5)+5;
-    else
-    rand = (rand%4)+5;
-  */
-  uint32_t bcch_pdu;
-  uint64_t dlsch_pdu;
-
-  DCI_pdu->Num_common_dci = 0;
-  DCI_pdu->Num_ue_spec_dci=0;
-
-
-
-  switch (subframe) {
-  case 5:
-    DCI_pdu->Num_common_dci = 1;
-    DCI_pdu->dci_alloc[0].L          = 2;
-    DCI_pdu->dci_alloc[0].rnti       = SI_RNTI;
-    DCI_pdu->dci_alloc[0].format     = format1A;
-    DCI_pdu->dci_alloc[0].ra_flag    = 0;
-
-    switch (phy_vars_eNB->lte_frame_parms.N_RB_DL) {
-    case 6:
-      if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) {
-        DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_1_5MHz_FDD_t;
-        ((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->type              = 1;
-        ((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->vrb_type          = 0;
-        ((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->rballoc           = computeRIV(25,10,3);
-        ((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->ndi               = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
-        ((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->rv                = 1;
-        ((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->mcs               = 1;
-        ((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->harq_pid          = 0;
-        ((DCI1A_1_5MHz_FDD_t*)&bcch_pdu)->TPC               = 1;      // set to 3 PRB
-        memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&bcch_pdu,sizeof(DCI1A_1_5MHz_TDD_1_6_t));
-      } else {
-        DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_1_5MHz_TDD_1_6_t;
-        ((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->type              = 1;
-        ((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->vrb_type          = 0;
-        ((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->rballoc           = computeRIV(25,10,3);
-        ((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->ndi               = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
-        ((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->rv                = 1;
-        ((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->mcs               = 1;
-        ((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->harq_pid          = 0;
-        ((DCI1A_1_5MHz_TDD_1_6_t*)&bcch_pdu)->TPC               = 1;      // set to 3 PRB
-        memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&bcch_pdu,sizeof(DCI1A_1_5MHz_TDD_1_6_t));
-      }
-
-      break;
-
-    case 25:
-    default:
-      if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) {
-        DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_5MHz_FDD_t;
-        ((DCI1A_5MHz_FDD_t*)&bcch_pdu)->type              = 1;
-        ((DCI1A_5MHz_FDD_t*)&bcch_pdu)->vrb_type          = 0;
-        ((DCI1A_5MHz_FDD_t*)&bcch_pdu)->rballoc           = computeRIV(25,10,3);
-        ((DCI1A_5MHz_FDD_t*)&bcch_pdu)->ndi               = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
-        ((DCI1A_5MHz_FDD_t*)&bcch_pdu)->rv                = 1;
-        ((DCI1A_5MHz_FDD_t*)&bcch_pdu)->mcs               = 1;
-        ((DCI1A_5MHz_FDD_t*)&bcch_pdu)->harq_pid          = 0;
-        ((DCI1A_5MHz_FDD_t*)&bcch_pdu)->TPC               = 1;      // set to 3 PRB
-        memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&bcch_pdu,sizeof(DCI1A_5MHz_TDD_1_6_t));
-//printf("!!!!!!!!!!!!!!!!!!!! %s CC %d\n", __FILENAME__, phy_vars_eNB->CC_id);
-      } else {
-        DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_5MHz_TDD_1_6_t;
-        ((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->type              = 1;
-        ((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->vrb_type          = 0;
-        ((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->rballoc           = computeRIV(25,10,3);
-        ((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->ndi               = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
-        ((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->rv                = 1;
-        ((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->mcs               = 1;
-        ((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->harq_pid          = 0;
-        ((DCI1A_5MHz_TDD_1_6_t*)&bcch_pdu)->TPC               = 1;      // set to 3 PRB
-        memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&bcch_pdu,sizeof(DCI1A_5MHz_TDD_1_6_t));
-      }
-
-      break;
-
-    case 50:
-      if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) {
-        DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_10MHz_FDD_t;
-        ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->type              = 1;
-        ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->vrb_type          = 0;
-        ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->rballoc           = computeRIV(25,10,3);
-        ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->ndi               = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
-        ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->rv                = 1;
-        ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->mcs               = 1;
-        ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->harq_pid          = 0;
-        ((DCI1A_10MHz_FDD_t*)&bcch_pdu)->TPC               = 1;      // set to 3 PRB
-        memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&bcch_pdu,sizeof(DCI1A_10MHz_TDD_1_6_t));
-      } else {
-        DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_10MHz_TDD_1_6_t;
-        ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->type              = 1;
-        ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->vrb_type          = 0;
-        ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->rballoc           = computeRIV(25,10,3);
-        ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->ndi               = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
-        ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->rv                = 1;
-        ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->mcs               = 1;
-        ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->harq_pid          = 0;
-        ((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->TPC               = 1;      // set to 3 PRB
-        memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&bcch_pdu,sizeof(DCI1A_10MHz_TDD_1_6_t));
-      }
-
-      break;
-
-    case 100:
-      if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) {
-        DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_20MHz_FDD_t;
-        ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->type              = 1;
-        ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->vrb_type          = 0;
-        ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->rballoc           = computeRIV(25,10,3);
-        ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->ndi               = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
-        ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->rv                = 1;
-        ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->mcs               = 1;
-        ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->harq_pid          = 0;
-        ((DCI1A_20MHz_FDD_t*)&bcch_pdu)->TPC               = 1;      // set to 3 PRB
-        memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&bcch_pdu,sizeof(DCI1A_20MHz_TDD_1_6_t));
-      } else {
-        DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_20MHz_TDD_1_6_t;
-        ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->type              = 1;
-        ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->vrb_type          = 0;
-        ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->rballoc           = computeRIV(25,10,3);
-        ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->ndi               = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
-        ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->rv                = 1;
-        ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->mcs               = 1;
-        ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->harq_pid          = 0;
-        ((DCI1A_20MHz_TDD_1_6_t*)&bcch_pdu)->TPC               = 1;      // set to 3 PRB
-        memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&bcch_pdu,sizeof(DCI1A_20MHz_TDD_1_6_t));
-      }
-
-      break;
-    }
-
-  case 6:
-    /*
-      DCI_pdu->Num_ue_spec_dci = 1;
-      DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI2_5MHz_2A_M10PRB_TDD_t;
-      DCI_pdu->dci_alloc[0].L          = 2;
-      DCI_pdu->dci_alloc[0].rnti       = 0x1236;
-      DCI_pdu->dci_alloc[0].format     = format2_2A_M10PRB;
-      DCI_pdu->dci_alloc[0].ra_flag    = 0;
-
-      DLSCH_alloc_pdu1.rballoc          = 0x00ff;
-      DLSCH_alloc_pdu1.TPC              = 0;
-      DLSCH_alloc_pdu1.dai              = 0;
-      DLSCH_alloc_pdu1.harq_pid         = 0;
-      DLSCH_alloc_pdu1.tb_swap          = 0;
-      DLSCH_alloc_pdu1.mcs1             = 0;
-      DLSCH_alloc_pdu1.ndi1             = 1;
-      DLSCH_alloc_pdu1.rv1              = 0;
-      DLSCH_alloc_pdu1.tpmi             = 0;
-      memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&DLSCH_alloc_pdu1,sizeof(DCI2_5MHz_2A_M10PRB_TDD_t));
-    */
-    break;
-
-  case 7:
-    DCI_pdu->Num_ue_spec_dci = 1;
-    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;
-
-    if (transmission_mode<3) {
-      //user 1
-      switch (phy_vars_eNB->lte_frame_parms.N_RB_DL) {
-      case 25:
-        if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) {
-          DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_5MHz_FDD_t;
-
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc          = rballoc;
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->TPC              = 0;
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid         = 0;
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs              = openair_daq_vars.target_ue_dl_mcs;
-          //((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs              = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi              = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv               = 0;
-          memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_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;
-
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc          = rballoc2;
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->TPC              = 0;
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->dai              = 0;
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid         = 1;
-          //((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs              = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs              = openair_daq_vars.target_ue_dl_mcs;
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi              = 1;
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv               = 0;
-          memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_5MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_5MHz_TDD_t));
-          */
-        } else {
-          DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_5MHz_TDD_t;
-
-          ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rballoc          = rballoc;
-          ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->TPC              = 0;
-          ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->dai              = 0;
-          ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->harq_pid         = 0;
-          ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->mcs              = openair_daq_vars.target_ue_dl_mcs;
-          //((DCI1_5MHz_TDD_t *)&dlsch_pdu)->mcs              = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
-          ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->ndi              = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
-          ((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rv               = 0;
-          memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_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;
-
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc          = rballoc2;
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->TPC              = 0;
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->dai              = 0;
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid         = 1;
-          //((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs              = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs              = openair_daq_vars.target_ue_dl_mcs;
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi              = 1;
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv               = 0;
-          memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_5MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_5MHz_TDD_t));
-          */
-        }
-
-        break;
-
-      case 50:
-
-        if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) {
-          DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_10MHz_FDD_t;
-
-          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rballoc          = rballoc;
-          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->TPC              = 0;
-          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->harq_pid         = 0;
-          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs              = openair_daq_vars.target_ue_dl_mcs;
-          //((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs              = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
-          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->ndi              = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
-          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rv               = 0;
-          memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_10MHz_TDD_t));
-
-          /*
-          //user2
-          DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_10MHz_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;
-
-          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rballoc          = rballoc2;
-          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->TPC              = 0;
-          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->dai              = 0;
-          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->harq_pid         = 1;
-          //((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs              = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
-          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs              = openair_daq_vars.target_ue_dl_mcs;
-          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->ndi              = 1;
-          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rv               = 0;
-          memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_10MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_10MHz_TDD_t));
-          */
-        } else {
-          DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_10MHz_TDD_t;
-
-          ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->rballoc          = rballoc;
-          ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->TPC              = 0;
-          ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->dai              = 0;
-          ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->harq_pid         = 0;
-          ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->mcs              = openair_daq_vars.target_ue_dl_mcs;
-          //((DCI1_10MHz_TDD_t *)&dlsch_pdu)->mcs              = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
-          ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->ndi              = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
-          ((DCI1_10MHz_TDD_t *)&dlsch_pdu)->rv               = 0;
-          memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_10MHz_TDD_t));
-
-          /*
-          //user2
-          DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_10MHz_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;
-
-          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rballoc          = rballoc2;
-          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->TPC              = 0;
-          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->dai              = 0;
-          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->harq_pid         = 1;
-          //((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs              = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
-          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs              = openair_daq_vars.target_ue_dl_mcs;
-          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->ndi              = 1;
-          ((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rv               = 0;
-          memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_10MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_10MHz_TDD_t));
-          */
-        }
-
-        break;
-
-      case 100:
-        if (phy_vars_eNB->lte_frame_parms.frame_type == FDD) {
-          DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_5MHz_FDD_t;
-
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc          = rballoc;
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->TPC              = 0;
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid         = 0;
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs              = openair_daq_vars.target_ue_dl_mcs;
-          //((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs              = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi              = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv               = 0;
-          memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_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;
-
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc          = rballoc2;
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->TPC              = 0;
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->dai              = 0;
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid         = 1;
-          //((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs              = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs              = openair_daq_vars.target_ue_dl_mcs;
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi              = 1;
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv               = 0;
-          memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_5MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_5MHz_TDD_t));
-          */
-        } else {
-          DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_20MHz_TDD_t;
-
-          ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->rballoc          = rballoc;
-          ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->TPC              = 0;
-          ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->dai              = 0;
-          ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->harq_pid         = 0;
-          ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->mcs              = openair_daq_vars.target_ue_dl_mcs;
-          //((DCI1_20MHz_TDD_t *)&dlsch_pdu)->mcs              = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
-          ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->ndi              = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
-          ((DCI1_20MHz_TDD_t *)&dlsch_pdu)->rv               = 0;
-          memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_20MHz_TDD_t));
-
-          /*
-          //user2
-          DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_20MHz_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;
-
-          ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rballoc          = rballoc2;
-          ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->TPC              = 0;
-          ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->dai              = 0;
-          ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->harq_pid         = 1;
-          //((DCI1_20MHz_FDD_t *)&dlsch_pdu)->mcs              = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
-          ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->mcs              = openair_daq_vars.target_ue_dl_mcs;
-          ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->ndi              = 1;
-          ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rv               = 0;
-          memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&((DCI1_20MHz_FDD_t *)&dlsch_pdu)->,sizeof(DCI1_5MHz_TDD_t));
-          */
-        }
-
-        break;
-      }
-
-    } else if (transmission_mode==5) {
-      DCI_pdu->Num_ue_spec_dci = 2;
-      // user 1
-      DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t;
-      DCI_pdu->dci_alloc[0].L          = 3;
-      DCI_pdu->dci_alloc[0].rnti       = 0x1235;
-      DCI_pdu->dci_alloc[0].format     = format1E_2A_M10PRB;
-      DCI_pdu->dci_alloc[0].ra_flag    = 0;
-
-      DLSCH_alloc_pdu1E.tpmi             = 5; //5=use feedback
-      DLSCH_alloc_pdu1E.rv               = 0;
-      DLSCH_alloc_pdu1E.ndi              = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
-      //DLSCH_alloc_pdu1E.mcs            = cqi_to_mcs[phy_vars_eNB->eNB_UE_stats->DL_cqi[0]];
-      //DLSCH_alloc_pdu1E.mcs            = (unsigned char) (taus()%28);
-      DLSCH_alloc_pdu1E.mcs              = openair_daq_vars.target_ue_dl_mcs;
-      //DLSCH_alloc_pdu1E.mcs            = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
-      phy_vars_eNB->eNB_UE_stats[0].dlsch_mcs1 = DLSCH_alloc_pdu1E.mcs;
-      DLSCH_alloc_pdu1E.harq_pid         = 0;
-      DLSCH_alloc_pdu1E.dai              = 0;
-      DLSCH_alloc_pdu1E.TPC              = 0;
-      DLSCH_alloc_pdu1E.rballoc          = openair_daq_vars.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          = 0;
-      DCI_pdu->dci_alloc[1].rnti       = 0x1236;
-      DCI_pdu->dci_alloc[1].format     = format1E_2A_M10PRB;
-      DCI_pdu->dci_alloc[1].ra_flag    = 0;
-      //DLSCH_alloc_pdu1E.mcs            = openair_daq_vars.target_ue_dl_mcs;
-      //DLSCH_alloc_pdu1E.mcs            = (unsigned char) (taus()%28);
-      //DLSCH_alloc_pdu1E.mcs            = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
-      DLSCH_alloc_pdu1E.mcs            = (unsigned char) (((phy_vars_eNB->proc[sched_subframe].frame_tx%1024)/3)%28);
-      phy_vars_eNB->eNB_UE_stats[1].dlsch_mcs1 = DLSCH_alloc_pdu1E.mcs;
-
-      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
-      phy_vars_eNB->eNB_UE_stats[1].DL_pmi_single = (phy_vars_eNB->eNB_UE_stats[0].DL_pmi_single ^ 0x1555);
-    }
-
-    break;
-
-    /*
-      case 8:
-      DCI_pdu->Num_common_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;
-
-      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_ue_spec_dci = 1;
-
-    //user 1
-    if (phy_vars_eNB->lte_frame_parms.frame_type == FDD)
-      DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI0_5MHz_FDD_t ;
-    else
-      DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI0_5MHz_TDD_1_6_t ;
-
-printf("%s:%d abort for debug\n", __FILE__, __LINE__);
-abort();
-    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;
-
-    UL_alloc_pdu.type    = 0;
-    UL_alloc_pdu.hopping = 0;
-    UL_alloc_pdu.rballoc = computeRIV(25,2,openair_daq_vars.ue_ul_nb_rb);
-    UL_alloc_pdu.mcs     = openair_daq_vars.target_ue_ul_mcs;
-    UL_alloc_pdu.ndi     = phy_vars_eNB->proc[sched_subframe].frame_tx&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+openair_daq_vars.ue_ul_nb_rb,openair_daq_vars.ue_ul_nb_rb);
-    else
-      UL_alloc_pdu.rballoc = computeRIV(25,0,openair_daq_vars.ue_ul_nb_rb);
-    UL_alloc_pdu.mcs     = openair_daq_vars.target_ue_ul_mcs;
-    UL_alloc_pdu.ndi     = phy_vars_eNB->proc[sched_subframe].frame_tx&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_common_dci+DCI_pdu->Num_ue_spec_dci; i++) {
-    DCI_pdu->nCCE += (1<<(DCI_pdu->dci_alloc[i].L));
-  }
-
-}
-
-#ifdef EMOS
-void fill_dci_emos(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *phy_vars_eNB)
-{
-
-  int i;
-  uint8_t cooperation_flag = phy_vars_eNB->cooperation_flag;
-  uint8_t transmission_mode = phy_vars_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_common_dci = 0;
-  DCI_pdu->Num_ue_spec_dci=0;
-
-  switch (subframe) {
-  case 5:
-    DCI_pdu->Num_ue_spec_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;
-
-      DLSCH_alloc_pdu.rballoc          = openair_daq_vars.ue_dl_rb_alloc;
-      DLSCH_alloc_pdu.TPC              = 0;
-      DLSCH_alloc_pdu.dai              = 0;
-      DLSCH_alloc_pdu.harq_pid         = 1;
-      DLSCH_alloc_pdu.mcs              = openair_daq_vars.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;
-
-      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              = openair_daq_vars.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_ue_spec_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;
-
-      DLSCH_alloc_pdu1E.tpmi             = 5; //5=use feedback
-      DLSCH_alloc_pdu1E.rv               = 0;
-      DLSCH_alloc_pdu1E.ndi              = 1;
-      DLSCH_alloc_pdu1E.mcs              = openair_daq_vars.target_ue_dl_mcs;
-      DLSCH_alloc_pdu1E.harq_pid         = 1;
-      DLSCH_alloc_pdu1E.dai              = 0;
-      DLSCH_alloc_pdu1E.TPC              = 0;
-      DLSCH_alloc_pdu1E.rballoc          = openair_daq_vars.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;
-
-      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
-      phy_vars_eNB->eNB_UE_stats[1].DL_pmi_single = (phy_vars_eNB->eNB_UE_stats[0].DL_pmi_single ^ 0x1555);
-    }
-
-    break;
-
-  case 7:
-    DCI_pdu->Num_common_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;
-
-    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_ue_spec_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;
-
-    UL_alloc_pdu.type    = 0;
-    UL_alloc_pdu.hopping = 0;
-    UL_alloc_pdu.rballoc = computeRIV(25,0,openair_daq_vars.ue_ul_nb_rb);
-    UL_alloc_pdu.mcs     = openair_daq_vars.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+openair_daq_vars.ue_ul_nb_rb,openair_daq_vars.ue_ul_nb_rb);
-    else
-    UL_alloc_pdu.rballoc = computeRIV(25,0,openair_daq_vars.ue_ul_nb_rb);
-    UL_alloc_pdu.mcs     = openair_daq_vars.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_common_dci+DCI_pdu->Num_ue_spec_dci; i++) {
-    DCI_pdu->nCCE += (1<<(DCI_pdu->dci_alloc[i].L));
-  }
-
-}
-#endif //EMOS
-#endif //OPENAIR2
-
 #define AMP_OVER_SQRT2 ((AMP*ONE_OVER_SQRT2_Q15)>>15)
 #define AMP_OVER_2 (AMP>>1)
 int QPSK[4]= {AMP_OVER_SQRT2|(AMP_OVER_SQRT2<<16),AMP_OVER_SQRT2|((65536-AMP_OVER_SQRT2)<<16),((65536-AMP_OVER_SQRT2)<<16)|AMP_OVER_SQRT2,((65536-AMP_OVER_SQRT2)<<16)|(65536-AMP_OVER_SQRT2)};
@@ -1607,6 +715,8 @@ void phy_eNB_lte_check_measurement_thresholds(instance_t instanceP, ral_threshol
 #endif
 
 
+unsigned int taus(void);
+DCI_PDU DCI_pdu_tmp;
 
 void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag,
                            relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn)
@@ -1618,10 +728,8 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
   uint8_t harq_pid;
   DCI_PDU *DCI_pdu;
   uint8_t *DLSCH_pdu=NULL;
-#ifndef OPENAIR2
-  DCI_PDU DCI_pdu_tmp;
+  //DCI_PDU DCI_pdu_tmp;
   uint8_t DLSCH_pdu_tmp[768*8];
-#endif
   int8_t UE_id;
   uint8_t num_pdcch_symbols=0;
   uint8_t ul_subframe;
@@ -1642,41 +750,40 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
   VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX,1);
   start_meas(&phy_vars_eNB->phy_proc_tx);
 
-#ifdef DEBUG_PHY_PROC
-  LOG_D(PHY,"[%s %"PRIu8"] Frame %d subframe %d : Doing phy_procedures_eNB_TX\n",
-        (r_type == multicast_relay) ? "RN/eNB" : "eNB",
-        phy_vars_eNB->Mod_id, frame, subframe);
-#endif
+  T(T_ENB_PHY_DL_TICK, T_INT(phy_vars_eNB->Mod_id), T_INT(frame), T_INT(subframe));
 
   for (i=0; i<NUMBER_OF_UE_MAX; i++) {
     // If we've dropped the UE, go back to PRACH mode for this UE
-    //#if !defined(EXMIMO_IOT)
+
     if (phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors == ULSCH_max_consecutive_errors) {
-      LOG_W(PHY,"[eNB %d, CC %d] frame %d, subframe %d, UE %d: ULSCH consecutive error count reached %u, removing UE\n",
+      LOG_W(PHY,"[eNB %d, CC %d] frame %d, subframe %d, UE %d: ULSCH consecutive error count reached %u, triggering UL Failure\n",
             phy_vars_eNB->Mod_id,phy_vars_eNB->CC_id,frame,subframe, i, phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors);
-      phy_vars_eNB->eNB_UE_stats[i].mode = PRACH;
-      remove_ue(phy_vars_eNB->eNB_UE_stats[i].crnti,phy_vars_eNB,abstraction_flag);
       phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors=0;
+      mac_xface->UL_failure_indication(phy_vars_eNB->Mod_id,
+				       phy_vars_eNB->CC_id,
+				       frame,
+				       phy_vars_eNB->eNB_UE_stats[i].crnti,
+				       subframe);
+				       
     }
+	
 
-    //#endif
   }
 
 
-#ifdef OPENAIR2
-
   // Get scheduling info for next subframe
-  if (phy_vars_eNB->CC_id == 0)
-    mac_xface->eNB_dlsch_ulsch_scheduler(phy_vars_eNB->Mod_id,0,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe);//,1);
-
-#endif
+  if (phy_vars_eNB->mac_enabled==1) {
+    if (phy_vars_eNB->CC_id == 0) {
+      mac_xface->eNB_dlsch_ulsch_scheduler(phy_vars_eNB->Mod_id,0,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe);//,1);
+    }
+  }
 
   if (abstraction_flag==0) {
     // clear the transmit data array for the current subframe
     for (aa=0; aa<phy_vars_eNB->lte_frame_parms.nb_antennas_tx_eNB; aa++) {
 
       memset(&phy_vars_eNB->lte_eNB_common_vars.txdataF[0][aa][subframe*phy_vars_eNB->lte_frame_parms.ofdm_symbol_size*(phy_vars_eNB->lte_frame_parms.symbols_per_tti)],
-             0,phy_vars_eNB->lte_frame_parms.ofdm_symbol_size*(phy_vars_eNB->lte_frame_parms.symbols_per_tti)*sizeof(mod_sym_t));
+             0,phy_vars_eNB->lte_frame_parms.ofdm_symbol_size*(phy_vars_eNB->lte_frame_parms.symbols_per_tti)*sizeof(int32_t));
     }
   }
 
@@ -1730,9 +837,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
               phy_vars_rn->Mod_id,phy_vars_rn->frame, subframe,subframe%5,
               phy_vars_rn->sync_area[subframe%5],mch_pduP->mcs,mch_pduP->Pdu_size);
       } else {
-        /* LOG_I(PHY,"[RN %d] Frame %d subframe %d: do not forward MCH pdu for MBSFN  sync area %d (MCS %d, TBS %d)\n",
-           phy_vars_rn->Mod_id,phy_vars_rn->frame, next_slot>>1,
-           mch_pduP->sync_area,mch_pduP->mcs,mch_pduP->Pdu_size);*/
         mch_pduP=NULL;
       }
 
@@ -1774,10 +878,10 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
                            AMP,
                            subframe<<1,0);
       if (subframe_select(&phy_vars_eNB->lte_frame_parms,subframe) == SF_DL)
-        generate_pilots_slot(phy_vars_eNB,
-                             phy_vars_eNB->lte_eNB_common_vars.txdataF[0],
-                             AMP,
-                             (subframe<<1)+1,0);
+	generate_pilots_slot(phy_vars_eNB,
+			     phy_vars_eNB->lte_eNB_common_vars.txdataF[0],
+			     AMP,
+			     (subframe<<1)+1,0);
 
       VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_RS_TX,0);
 
@@ -1881,20 +985,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
 
 
 
-#ifdef DEBUG_PHY_PROC
-    uint16_t frame_tx = (((int) (pbch_pdu[2]&0x3))<<8) + ((int) (pbch_pdu[1]&0xfc)) + phy_vars_eNB->proc[sched_subframe].frame_tx%4;
-
-    LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Generating PBCH, mode1_flag=%"PRIu8", frame_tx=%"PRIu16", pdu=%02"PRIx8"%02"PRIx8"%02"PRIx8"\n",
-          phy_vars_eNB->Mod_id,
-          phy_vars_eNB->proc[sched_subframe].frame_tx,
-          subframe,
-          phy_vars_eNB->lte_frame_parms.mode1_flag,
-          frame_tx,
-          pbch_pdu[2],
-          pbch_pdu[1],
-          pbch_pdu[0]);
-#endif
-
     if (abstraction_flag==0) {
 
       generate_pbch(&phy_vars_eNB->lte_eNB_pbch,
@@ -1921,7 +1011,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
     if (abstraction_flag==0) {
 
       if (phy_vars_eNB->lte_frame_parms.frame_type == TDD) {
-        //    printf("Generating PSS (frame %d, subframe %d)\n",phy_vars_eNB->proc[sched_subframe].frame_tx,next_slot>>1);
         generate_pss(phy_vars_eNB->lte_eNB_common_vars.txdataF[0],
                      AMP,
                      &phy_vars_eNB->lte_frame_parms,
@@ -1972,7 +1061,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
     if (abstraction_flag==0) {
 
       if (phy_vars_eNB->lte_frame_parms.frame_type == TDD) {
-        //      printf("Generating PSS (frame %d, subframe %d)\n",phy_vars_eNB->proc[sched_subframe].frame_tx,next_slot>>1);
         generate_pss(phy_vars_eNB->lte_eNB_common_vars.txdataF[0],
                      AMP,
                      &phy_vars_eNB->lte_frame_parms,
@@ -1984,8 +1072,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
 
 
 
-  //  sect_id=0;
-
 #if defined(SMBV) && !defined(EXMIMO)
 
   // PBCH takes one allocation
@@ -1996,36 +1082,22 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
 
 #endif
 
-#ifdef OPENAIR2
-
-  // Parse DCI received from MAC
-  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,1);
-  DCI_pdu = mac_xface->get_dci_sdu(phy_vars_eNB->Mod_id,
-                                   phy_vars_eNB->CC_id,
-                                   phy_vars_eNB->proc[sched_subframe].frame_tx,
-                                   subframe);
+  if (phy_vars_eNB->mac_enabled==1) {
+    // Parse DCI received from MAC
+    VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,1);
+    DCI_pdu = mac_xface->get_dci_sdu(phy_vars_eNB->Mod_id,
+				     phy_vars_eNB->CC_id,
+				     phy_vars_eNB->proc[sched_subframe].frame_tx,
+				     subframe);
+  }
+  else {
+    DCI_pdu = &DCI_pdu_tmp;
+#ifdef EMOS_CHANNEL
+    fill_dci_emos(DCI_pdu,sched_subframe,phy_vars_eNB);
 #else
-  DCI_pdu = &DCI_pdu_tmp;
-#ifdef EMOS
-  /*
-    if (((phy_vars_eNB->proc[sched_subframe].frame_tx%1024)%3 == 0) && (next_slot == 0)) {
-    //openair_daq_vars.target_ue_dl_mcs = (openair_daq_vars.target_ue_dl_mcs+1)%28;
-    openair_daq_vars.target_ue_dl_mcs = taus()%28;
-    LOG_D(PHY,"[MYEMOS] frame %d, increasing MCS to %d\n",phy_vars_eNB->proc[sched_subframe].frame_tx,openair_daq_vars.target_ue_dl_mcs);
-    }
-  */
-  /*
-    if (phy_vars_eNB->proc[sched_subframe].frame_tx > 28000) {
-    LOG_E(PHY,"More that 28000 frames reached! Exiting!\n");
-    }
-  */
-#endif
-#ifdef EMOS_CHANNEL
-  fill_dci_emos(DCI_pdu,sched_subframe,phy_vars_eNB);
-#else
-  fill_dci(DCI_pdu,sched_subframe,phy_vars_eNB);
-#endif
+    fill_dci(DCI_pdu,sched_subframe,phy_vars_eNB);
 #endif
+  }
 
   // clear existing ulsch dci allocations before applying info from MAC  (this is table
   ul_subframe = pdcch_alloc2ul_subframe(&phy_vars_eNB->lte_frame_parms,subframe);
@@ -2042,25 +1114,15 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
       }
   }
 
-#ifdef EMOS
-  //emos_dump_eNB.dci_cnt[next_slot>>1] = DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci; //nb_dci_common+nb_dci_ue_spec;
-#endif
-
   // clear previous allocation information for all UEs
   for (i=0; i<NUMBER_OF_UE_MAX; i++) {
     phy_vars_eNB->dlsch_eNB[i][0]->subframe_tx[subframe] = 0;
   }
 
-  init_nCCE_table();
 
-  num_pdcch_symbols = get_num_pdcch_symbols(DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci,
-                      DCI_pdu->dci_alloc,
-                      &phy_vars_eNB->lte_frame_parms,
-                      subframe);
-  DCI_pdu->nCCE = get_nCCE(num_pdcch_symbols,
-                           &phy_vars_eNB->lte_frame_parms,
-                           get_mi(&phy_vars_eNB->lte_frame_parms,subframe));
-  LOG_D(PHY,"num_pdcch_symbols %"PRIu8", nCCE %u (dci commond %"PRIu8", dci uespec %"PRIu8"\n",num_pdcch_symbols,DCI_pdu->nCCE,
+  num_pdcch_symbols = DCI_pdu->num_pdcch_symbols;
+
+  LOG_D(PHY,"num_pdcch_symbols %"PRIu8",(dci common %"PRIu8", dci uespec %"PRIu8"\n",num_pdcch_symbols,
         DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci);
 
 #if defined(SMBV) && !defined(EXMIMO)
@@ -2074,20 +1136,18 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
 
 #endif
 
-  for (i=0; i<DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci ; i++) {
-#ifdef DEBUG_PHY_PROC
 
-    if (DCI_pdu->dci_alloc[i].rnti != SI_RNTI) {
-      LOG_D(PHY,"[eNB] Subframe %d : Doing DCI index %"PRIu32"/%d\n",subframe,i,DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci);
-      dump_dci(&phy_vars_eNB->lte_frame_parms,&DCI_pdu->dci_alloc[i]);
-    }
 
-#endif
+  VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,DCI_pdu->num_pdcch_symbols);
+
+  for (i=0; i<DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci ; i++) {
+    LOG_D(PHY,"[eNB] Subframe %d: DCI %d/%d : rnti %x, CCEind %d\n",subframe,i,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci,DCI_pdu->dci_alloc[i].rnti,DCI_pdu->dci_alloc[i].firstCCE);
+    VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,DCI_pdu->dci_alloc[i].rnti);
+    VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,DCI_pdu->dci_alloc[i].format);
+    VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,DCI_pdu->dci_alloc[i].firstCCE);
 
     if (DCI_pdu->dci_alloc[i].rnti == SI_RNTI) {
-#ifdef DEBUG_PHY_PROC
-      LOG_D(PHY,"[eNB %"PRIu8"] SI generate_eNB_dlsch_params_from_dci\n", phy_vars_eNB->Mod_id);
-#endif
+
       generate_eNB_dlsch_params_from_dci(frame,
 					 subframe,
                                          &DCI_pdu->dci_alloc[i].dci_pdu[0],
@@ -2102,33 +1162,24 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
                                          phy_vars_eNB->eNB_UE_stats[0].DL_pmi_single);
 
 
-      int result = get_nCCE_offset(1<<DCI_pdu->dci_alloc[i].L, DCI_pdu->nCCE, 1, SI_RNTI, subframe);
-      phy_vars_eNB->dlsch_eNB_SI->nCCE[subframe] = result;
-
-      if (result == -1) {
-        // FIXME what happens to phy_vars_eNB->dlsch_eNB_SI->nCCE[subframe]?
-        LOG_E(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : No available CCE resources for common DCI (SI)!!!\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe);
-      } else {
-        LOG_T(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for common DCI (SI)  => %"PRIu8"/%u\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,
-              phy_vars_eNB->dlsch_eNB_SI->nCCE[subframe],DCI_pdu->nCCE);
+      phy_vars_eNB->dlsch_eNB_SI->nCCE[subframe] = DCI_pdu->dci_alloc[i].firstCCE;
 
+      LOG_T(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for common DCI (SI)  => %"PRIu8"/%u\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,
+	    phy_vars_eNB->dlsch_eNB_SI->nCCE[subframe],DCI_pdu->dci_alloc[i].firstCCE);
+      
 #if defined(SMBV) && !defined(EXMIMO)
 
-        // configure SI DCI
-        if (smbv_is_config_frame(phy_vars_eNB->proc[sched_subframe].frame_tx) && (smbv_frame_cnt < 4)) {
-          msg("[SMBV] Frame %3d, SI in SF %d DCI %"PRIu32"\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i);
-          smbv_configure_common_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), "SI", &DCI_pdu->dci_alloc[i], i);
-        }
-
-#endif
+      // configure SI DCI
+      if (smbv_is_config_frame(phy_vars_eNB->proc[sched_subframe].frame_tx) && (smbv_frame_cnt < 4)) {
+	msg("[SMBV] Frame %3d, SI in SF %d DCI %"PRIu32"\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i);
+	smbv_configure_common_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), "SI", &DCI_pdu->dci_alloc[i], i);
       }
-
-      DCI_pdu->dci_alloc[i].nCCE = phy_vars_eNB->dlsch_eNB_SI->nCCE[subframe];
+      
+#endif
+      
 
     } else if (DCI_pdu->dci_alloc[i].ra_flag == 1) {
-#ifdef DEBUG_PHY_PROC
-      LOG_D(PHY,"[eNB %"PRIu8"] RA generate_eNB_dlsch_params_from_dci\n", phy_vars_eNB->Mod_id);
-#endif
+
       generate_eNB_dlsch_params_from_dci(frame,
 					 subframe,
                                          &DCI_pdu->dci_alloc[i].dci_pdu[0],
@@ -2142,46 +1193,35 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
                                          P_RNTI,
                                          phy_vars_eNB->eNB_UE_stats[0].DL_pmi_single);
 
-      //    mac_xface->macphy_exit("Transmitted RAR, exiting\n");
 
-      int result = get_nCCE_offset(1<<DCI_pdu->dci_alloc[i].L, DCI_pdu->nCCE, 1, DCI_pdu->dci_alloc[i].rnti, subframe);
-      phy_vars_eNB->dlsch_eNB_ra->nCCE[subframe] = result;
+      phy_vars_eNB->dlsch_eNB_ra->nCCE[subframe] = DCI_pdu->dci_alloc[i].firstCCE;
 
-      if (result == -1) {
-        // FIXME what happens to phy_vars_eNB->dlsch_eNB_ra->nCCE[subframe]?
-        LOG_E(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : No available CCE resources for common DCI (RA) !!!\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe);
-      } else {
-        LOG_D(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for common DCI (RA)  => %"PRIu8"/%u\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,
-              phy_vars_eNB->dlsch_eNB_ra->nCCE[subframe],DCI_pdu->nCCE);
+      LOG_D(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for common DCI (RA)  => %"PRIu8"/%u (num_pdcch_symbols %d)\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,
+	    phy_vars_eNB->dlsch_eNB_ra->nCCE[subframe],get_nCCE_mac(phy_vars_eNB->Mod_id,phy_vars_eNB->CC_id,num_pdcch_symbols,subframe),num_pdcch_symbols);
 #if defined(SMBV) && !defined(EXMIMO)
 
-        // configure RA DCI
-        if (smbv_is_config_frame(phy_vars_eNB->proc[sched_subframe].frame_tx) && (smbv_frame_cnt < 4)) {
-          msg("[SMBV] Frame %3d, RA in SF %d DCI %"PRIu32"\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i);
-          smbv_configure_common_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), "RA", &DCI_pdu->dci_alloc[i], i);
-        }
-
-#endif
-
+      // configure RA DCI
+      if (smbv_is_config_frame(phy_vars_eNB->proc[sched_subframe].frame_tx) && (smbv_frame_cnt < 4)) {
+	msg("[SMBV] Frame %3d, RA in SF %d DCI %"PRIu32"\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i);
+	smbv_configure_common_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), "RA", &DCI_pdu->dci_alloc[i], i);
       }
 
-      DCI_pdu->dci_alloc[i].nCCE = phy_vars_eNB->dlsch_eNB_ra->nCCE[subframe];
+#endif
 
     }
 
     else if (DCI_pdu->dci_alloc[i].format != format0) { // this is a normal DLSCH allocation
 
-#ifdef OPENAIR2
-#ifdef DEBUG_PHY_PROC
-      LOG_D(PHY,"[eNB] Searching for RNTI %"PRIx16"\n",DCI_pdu->dci_alloc[i].rnti);
-#endif
-      UE_id = find_ue((int16_t)DCI_pdu->dci_alloc[i].rnti,phy_vars_eNB);
-#else
-      UE_id = i;
-#endif
+      if (phy_vars_eNB->mac_enabled==1)
+	UE_id = find_ue((int16_t)DCI_pdu->dci_alloc[i].rnti,phy_vars_eNB);
+      else
+	UE_id = i;
 
       if (UE_id>=0) {
-        //    dump_dci(&phy_vars_eNB->lte_frame_parms,&DCI_pdu->dci_alloc[i]);
+	if ((frame%100)==0) {
+	  LOG_D(PHY,"Frame %3d, SF %d \n",frame,subframe); 
+	  dump_dci(&phy_vars_eNB->lte_frame_parms,&DCI_pdu->dci_alloc[i]);
+	}
 #if defined(SMBV) && !defined(EXMIMO)
         // Configure this user
         if (smbv_is_config_frame(phy_vars_eNB->proc[sched_subframe].frame_tx) && (smbv_frame_cnt < 4)) {
@@ -2191,6 +1231,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
         }
 
 #endif
+
         generate_eNB_dlsch_params_from_dci(frame,
 					   subframe,
                                            &DCI_pdu->dci_alloc[i].dci_pdu[0],
@@ -2206,38 +1247,31 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
         LOG_D(PHY,"[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d subframe %d: Generated dlsch params\n",
               phy_vars_eNB->Mod_id,DCI_pdu->dci_alloc[i].rnti,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->current_harq_pid,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe);
 
-        int result = get_nCCE_offset(1<<DCI_pdu->dci_alloc[i].L, DCI_pdu->nCCE, 0, DCI_pdu->dci_alloc[i].rnti, subframe);
-        phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nCCE[subframe] = result;
 
-        if (result == -1) {
-          // FIXME what happens to phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nCCE[subframe]?
-          LOG_E(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : No available CCE resources for UE spec DCI (PDSCH %"PRIx16") !!!\n",
-                phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,DCI_pdu->dci_alloc[i].rnti);
-        } else {
-          LOG_D(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for ue DCI (PDSCH %"PRIx16")  => %"PRIu8"/%u\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,
-                DCI_pdu->dci_alloc[i].rnti,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nCCE[subframe],DCI_pdu->nCCE);
+        T(T_ENB_PHY_DLSCH_UE_DCI, T_INT(phy_vars_eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(UE_id),
+          T_INT(DCI_pdu->dci_alloc[i].rnti), T_INT(DCI_pdu->dci_alloc[i].format),
+          T_INT(phy_vars_eNB->dlsch_eNB[(int)UE_id][0]->current_harq_pid));
 
-#if defined(SMBV) && !defined(EXMIMO)
-          DCI_pdu->dci_alloc[i].nCCE = phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nCCE[subframe];
+        phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nCCE[subframe] = DCI_pdu->dci_alloc[i].firstCCE;
 
-          // configure UE-spec DCI
-          if (smbv_is_config_frame(phy_vars_eNB->proc[sched_subframe].frame_tx) && (smbv_frame_cnt < 4)) {
-            msg("[SMBV] Frame %3d, PDSCH in SF %d DCI %"PRIu32"\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i);
-            smbv_configure_ue_spec_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), UE_id+1, &DCI_pdu->dci_alloc[i], i);
-          }
+	LOG_D(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resource for ue DCI (PDSCH %"PRIx16")  => %"PRIu8"/%u\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,
+	      DCI_pdu->dci_alloc[i].rnti,phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nCCE[subframe],DCI_pdu->dci_alloc[i].firstCCE);
+
+#if defined(SMBV) && !defined(EXMIMO)
+	
+	// configure UE-spec DCI
+	if (smbv_is_config_frame(phy_vars_eNB->proc[sched_subframe].frame_tx) && (smbv_frame_cnt < 4)) {
+	  msg("[SMBV] Frame %3d, PDSCH in SF %d DCI %"PRIu32"\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i);
+	  smbv_configure_ue_spec_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), UE_id+1, &DCI_pdu->dci_alloc[i], i);
+	}
 
 #endif
-        }
 
-        DCI_pdu->dci_alloc[i].nCCE = phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->nCCE[subframe];
-#ifdef DEBUG_PHY_PROC
-        //if (phy_vars_eNB->proc[sched_subframe].frame_tx%100 == 0)
         LOG_D(PHY,"[eNB %"PRIu8"][DCI][PDSCH %"PRIx16"] Frame %d subframe %d UE_id %"PRId8" Generated DCI format %d, aggregation %d\n",
               phy_vars_eNB->Mod_id, DCI_pdu->dci_alloc[i].rnti,
               phy_vars_eNB->proc[sched_subframe].frame_tx, subframe,UE_id,
               DCI_pdu->dci_alloc[i].format,
               1<<DCI_pdu->dci_alloc[i].L);
-#endif
       } else {
         LOG_D(PHY,"[eNB %"PRIu8"][PDSCH] Frame %d : No UE_id with corresponding rnti %"PRIx16", dropping DLSCH\n",
               phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,DCI_pdu->dci_alloc[i].rnti);
@@ -2246,6 +1280,8 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
 
   }
 
+  VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,(frame*10)+subframe);
+
   // Apply physicalConfigDedicated if needed
   phy_config_dedicated_eNB_step2(phy_vars_eNB);
 
@@ -2258,15 +1294,16 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
 
       if (harq_pid==255) {
         LOG_E(PHY,"[eNB %"PRIu8"] Frame %d: Bad harq_pid for ULSCH allocation\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx);
-        //mac_exit_wrapper("Invalid harq_pid (255) detected");
-        return; // not reached
+        return; 
       }
 
-#ifdef OPENAIR2
-      UE_id = find_ue((int16_t)DCI_pdu->dci_alloc[i].rnti,phy_vars_eNB);
-#else
-      UE_id = i;
-#endif
+      if (phy_vars_eNB->mac_enabled==1)
+	UE_id = find_ue((int16_t)DCI_pdu->dci_alloc[i].rnti,phy_vars_eNB);
+      else
+	UE_id = i;
+
+      T(T_ENB_PHY_ULSCH_UE_DCI, T_INT(phy_vars_eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(UE_id),
+        T_INT(DCI_pdu->dci_alloc[i].rnti), T_INT(harq_pid));
 
       if (UE_id<0) {
         LOG_E(PHY,"[eNB %"PRIu8"] Frame %d: Unknown UE_id for rnti %"PRIx16"\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,DCI_pdu->dci_alloc[i].rnti);
@@ -2274,8 +1311,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
         return; // not reached
       }
 
-#ifdef DEBUG_PHY_PROC
-      //if (phy_vars_eNB->proc[sched_subframe].frame_tx%100 == 0)
       LOG_D(PHY,
             "[eNB %"PRIu8"][PUSCH %"PRIu8"] Frame %d subframe %d UL Frame %"PRIu32", UL Subframe %"PRIu8", Generated ULSCH (format0) DCI (rnti %"PRIx16", dci %"PRIx8") (DCI pos %"PRIu32"/%d), aggregation %d\n",
             phy_vars_eNB->Mod_id,
@@ -2291,10 +1326,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
             i,
             DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci,
             1<<DCI_pdu->dci_alloc[i].L);
-#endif
 
-      //dump_dci(&phy_vars_eNB->lte_frame_parms,&DCI_pdu->dci_alloc[i]);
-      //LOG_D(PHY,"[eNB] cba generate_eNB_ulsch_params_from_dci for ue %d for dci rnti %x\n", UE_id, DCI_pdu->dci_alloc[i].rnti);
       generate_eNB_ulsch_params_from_dci(&DCI_pdu->dci_alloc[i].dci_pdu[0],
                                          DCI_pdu->dci_alloc[i].rnti,
                                          sched_subframe,
@@ -2307,37 +1339,22 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
                                          CBA_RNTI,
                                          0);  // do_srs
 
-      if ((DCI_pdu->dci_alloc[i].nCCE=get_nCCE_offset(1<<DCI_pdu->dci_alloc[i].L,
-                                      DCI_pdu->nCCE,
-                                      0,
-                                      DCI_pdu->dci_alloc[i].rnti,
-                                      subframe)) == -1) {
-        LOG_E(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : No available CCE resources (%u) for UE spec DCI (PUSCH %"PRIx16") !!!\n",
-              phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,DCI_pdu->nCCE,DCI_pdu->dci_alloc[i].rnti);
-      } else {
-        LOG_T(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resources for UE spec DCI (PUSCH %"PRIx16") => %d/%u\n",
-              phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,DCI_pdu->dci_alloc[i].rnti,
-              DCI_pdu->dci_alloc[i].nCCE,DCI_pdu->nCCE);
-
+      LOG_T(PHY,"[eNB %"PRIu8"] Frame %d subframe %d : CCE resources for UE spec DCI (PUSCH %"PRIx16") => %d/%u\n",
+	    phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,DCI_pdu->dci_alloc[i].rnti,
+	    DCI_pdu->dci_alloc[i].firstCCE,DCI_pdu->dci_alloc[i].firstCCE);
+      
 #if defined(SMBV) && !defined(EXMIMO)
 
         // configure UE-spec DCI for UL Grant
-        if (smbv_is_config_frame(phy_vars_eNB->proc[sched_subframe].frame_tx) && (smbv_frame_cnt < 4)) {
-          msg("[SMBV] Frame %3d, SF %d UL DCI %"PRIu32"\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i);
-          smbv_configure_ue_spec_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), UE_id+1, &DCI_pdu->dci_alloc[i], i);
-        }
-
-#endif
-
+      if (smbv_is_config_frame(phy_vars_eNB->proc[sched_subframe].frame_tx) && (smbv_frame_cnt < 4)) {
+	msg("[SMBV] Frame %3d, SF %d UL DCI %"PRIu32"\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i);
+	smbv_configure_ue_spec_dci(smbv_fname,(smbv_frame_cnt*10) + (subframe), UE_id+1, &DCI_pdu->dci_alloc[i], i);
       }
-
-#ifdef DEBUG_PHY_PROC
-      LOG_D(PHY,"[eNB %"PRIu8"][PUSCH %"PRIu8"] frame %d subframe %d Setting subframe_scheduling_flag for UE %"PRIu32" harq_pid %"PRIu8" (ul subframe %"PRIu8")\n",
-            phy_vars_eNB->Mod_id,harq_pid,
-            phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i,harq_pid,
-            pdcch_alloc2ul_subframe(&phy_vars_eNB->lte_frame_parms,subframe));
+      
 #endif
 
+      
+
       if ((DCI_pdu->dci_alloc[i].rnti  >= CBA_RNTI) && (DCI_pdu->dci_alloc[i].rnti < P_RNTI))
         phy_vars_eNB->ulsch_eNB[(uint32_t)UE_id]->harq_processes[harq_pid]->subframe_cba_scheduling_flag = 1;
       else
@@ -2360,15 +1377,11 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
   }
 
   if (abstraction_flag == 0) {
-#ifdef DEBUG_PHY_PROC
 
     if (DCI_pdu->Num_ue_spec_dci+DCI_pdu->Num_common_dci > 0)
       LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_top (pdcch) (common %"PRIu8",ue_spec %"PRIu8")\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx, subframe,
             DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci);
 
-#endif
-
-    //    for (sect_id=0;sect_id<number_of_cards;sect_id++)
     num_pdcch_symbols = generate_dci_top(DCI_pdu->Num_ue_spec_dci,
                                          DCI_pdu->Num_common_dci,
                                          DCI_pdu->dci_alloc,
@@ -2378,10 +1391,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
                                          phy_vars_eNB->lte_eNB_common_vars.txdataF[0],
                                          subframe);
 
-#ifdef DEBUG_PHY_PROC
-    //  LOG_I(PHY,"[eNB %d] Frame %d, subframe %d: num_pdcch_symbols %d)\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx, next_slot>>1,num_pdcch_symbols);
-
-#endif
   }
 
 #ifdef PHY_ABSTRACTION // FIXME this ifdef seems suspicious
@@ -2394,29 +1403,25 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
 
   VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,0);
 
-#ifdef DEBUG_PHY_PROC
-  //LOG_D(PHY,"[eNB %d] Frame %d, slot %d: num_pdcch_symbols=%d\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx, next_slot,num_pdcch_symbols);
-#endif
-
   // Check for SI activity
 
   if (phy_vars_eNB->dlsch_eNB_SI->active == 1) {
     input_buffer_length = phy_vars_eNB->dlsch_eNB_SI->harq_processes[0]->TBS/8;
 
 
-#ifdef OPENAIR2
-    DLSCH_pdu = mac_xface->get_dlsch_sdu(phy_vars_eNB->Mod_id,
-                                         phy_vars_eNB->CC_id,
-                                         phy_vars_eNB->proc[sched_subframe].frame_tx,
-                                         SI_RNTI,
-                                         0);
-#else
-    DLSCH_pdu = DLSCH_pdu_tmp;
-
-    for (i=0; i<input_buffer_length; i++)
-      DLSCH_pdu[i] = (unsigned char)(taus()&0xff);
+    if (phy_vars_eNB->mac_enabled==1) {
+      DLSCH_pdu = mac_xface->get_dlsch_sdu(phy_vars_eNB->Mod_id,
+					   phy_vars_eNB->CC_id,
+					   phy_vars_eNB->proc[sched_subframe].frame_tx,
+					   SI_RNTI,
+					   0);
+    }
+    else {
+      DLSCH_pdu = DLSCH_pdu_tmp;
 
-#endif
+      for (i=0; i<input_buffer_length; i++)
+	DLSCH_pdu[i] = (unsigned char)(taus()&0xff);
+    }
 
 #if defined(SMBV) && !defined(EXMIMO)
 
@@ -2426,21 +1431,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
       smbv_configure_datalist_for_alloc(smbv_fname, smbv_alloc_cnt++, (smbv_frame_cnt*10) + (subframe), DLSCH_pdu, input_buffer_length);
     }
 
-#endif
-
-#ifdef DEBUG_PHY_PROC
-#ifdef DEBUG_DLSCH
-   //FIXME: The code below is commented as next_slot is not defined which results in failed compilation
-   /*
-    LOG_D(PHY,"[eNB %"PRIu8"][SI] Frame %d, slot %d: Calling generate_dlsch (SI) with input size = %"PRIu16", num_pdcch_symbols %"PRIu8"\n",
-          phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx, next_slot, input_buffer_length,num_pdcch_symbols); // FIXME this code is broken (next_slot?)
-
-    for (i=0; i<input_buffer_length; i++)
-      LOG_T(PHY,"%x.",i,DLSCH_pdu[i]);// FIXME this code is broken (number of arguments)
-
-    LOG_T(PHY,"\n");
-    */
-#endif
 #endif
 
     if (abstraction_flag == 0) {
@@ -2472,7 +1462,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
       stop_meas(&phy_vars_eNB->dlsch_scrambling_stats);
 
       start_meas(&phy_vars_eNB->dlsch_modulation_stats);
-      //      for (sect_id=0;sect_id<number_of_cards;sect_id++)
+
       re_allocated = dlsch_modulation(phy_vars_eNB->lte_eNB_common_vars.txdataF[0],
                                       AMP,
                                       subframe,
@@ -2499,25 +1489,15 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
 
   // Check for RA activity
   if (phy_vars_eNB->dlsch_eNB_ra->active == 1) {
-#ifdef DEBUG_PHY_PROC
-    LOG_D(PHY,"[eNB %"PRIu8"][RAPROC] Frame %d, subframe %d, RA active, filling RAR:\n",
-          phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx, subframe);
-#endif
 
     input_buffer_length = phy_vars_eNB->dlsch_eNB_ra->harq_processes[0]->TBS/8;
 
-#ifdef OPENAIR2
     int16_t crnti = mac_xface->fill_rar(phy_vars_eNB->Mod_id,
                                         phy_vars_eNB->CC_id,
                                         phy_vars_eNB->proc[sched_subframe].frame_tx,
                                         dlsch_input_buffer,
                                         phy_vars_eNB->lte_frame_parms.N_RB_UL,
                                         input_buffer_length);
-    /*
-      for (i=0;i<input_buffer_length;i++)
-      LOG_T(PHY,"%x.",dlsch_input_buffer[i]);
-      LOG_T(PHY,"\n");
-    */
     if (crnti!=0) 
       UE_id = add_ue(crnti,phy_vars_eNB);
     else 
@@ -2525,7 +1505,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
 
     if (UE_id==-1) {
       LOG_W(PHY,"[eNB] Max user count reached.\n");
-      //mac_xface->macphy_exit("[PHY][eNB] Max user count reached.\n");
       mac_xface->cancel_ra_proc(phy_vars_eNB->Mod_id,
                                 phy_vars_eNB->CC_id,
                                 phy_vars_eNB->proc[sched_subframe].frame_tx,
@@ -2548,23 +1527,13 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
                      phy_vars_eNB->proc[sched_subframe].frame_tx,
                      &phy_vars_eNB->ulsch_eNB[(uint32_t)UE_id]->Msg3_frame,
                      &phy_vars_eNB->ulsch_eNB[(uint32_t)UE_id]->Msg3_subframe);
-      LOG_I(PHY,"[eNB][RAPROC] Frame %d subframe %d, Activated Msg3 demodulation for UE %"PRId8" in frame %"PRIu32", subframe %"PRIu8"\n",
+      LOG_D(PHY,"[eNB][RAPROC] Frame %d subframe %d, Activated Msg3 demodulation for UE %"PRId8" in frame %"PRIu32", subframe %"PRIu8"\n",
             phy_vars_eNB->proc[sched_subframe].frame_tx,
             subframe,
             UE_id,
             phy_vars_eNB->ulsch_eNB[(uint32_t)UE_id]->Msg3_frame,
             phy_vars_eNB->ulsch_eNB[(uint32_t)UE_id]->Msg3_subframe);
 
-#else
-
-    for (i=0; i<input_buffer_length; i++)
-      dlsch_input_buffer[i]= (unsigned char) i; //(taus()&0xff);
-
-    dlsch_input_buffer[1] = (phy_vars_eNB->eNB_UE_stats[0].UE_timing_offset)>>(2+4); // 7 MSBs of timing advance + divide by 4
-    dlsch_input_buffer[2] = ((phy_vars_eNB->eNB_UE_stats[0].UE_timing_offset)<<(4-2))&0xf0;  // 4 LSBs of timing advance + divide by 4
-    //LOG_I(PHY,"UE %d: timing_offset = %d\n",UE_id,phy_vars_eNB->eNB_UE_stats[0].UE_timing_offset);
-#endif
-
 #if defined(SMBV) && !defined(EXMIMO)
 
       // Configures the data source of allocation (allocation is configured by DCI)
@@ -2575,13 +1544,13 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
 
 #endif
 
-#ifdef DEBUG_PHY_PROC
+
       LOG_D(PHY,"[eNB %"PRIu8"][RAPROC] Frame %d, subframe %d: Calling generate_dlsch (RA) with input size = %"PRIu16",Msg3 frame %"PRIu32", Msg3 subframe %"PRIu8"\n",
             phy_vars_eNB->Mod_id,
             phy_vars_eNB->proc[sched_subframe].frame_tx, subframe,input_buffer_length,
             phy_vars_eNB->ulsch_eNB[(uint32_t)UE_id]->Msg3_frame,
             phy_vars_eNB->ulsch_eNB[(uint32_t)UE_id]->Msg3_subframe);
-#endif
+
 
       if (abstraction_flag == 0) {
 
@@ -2606,7 +1575,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
                                num_pdcch_symbols,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe),
                          0,
                          subframe<<1);
-        //  for (sect_id=0;sect_id<number_of_cards;sect_id++)
+
         re_allocated = dlsch_modulation(phy_vars_eNB->lte_eNB_common_vars.txdataF[0],
                                         AMP,
                                         subframe,
@@ -2627,15 +1596,8 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
       LOG_D(PHY,"[eNB %"PRIu8"][RAPROC] Frame %d subframe %d Deactivating DLSCH RA\n",phy_vars_eNB->Mod_id,
             phy_vars_eNB->proc[sched_subframe].frame_tx,subframe);
 
-#ifdef DEBUG_PHY_PROC
-      LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d, DLSCH (RA) re_allocated = %"PRIu16"\n",phy_vars_eNB->Mod_id,
-            phy_vars_eNB->proc[sched_subframe].frame_tx, subframe, re_allocated);
-#endif
-
-#ifdef OPENAIR2
     } //max user count
 
-#endif
     phy_vars_eNB->dlsch_eNB_ra->active = 0;
   }
 
@@ -2649,7 +1611,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
       input_buffer_length = phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->TBS/8;
 
 
-#ifdef DEBUG_PHY_PROC
+
       LOG_D(PHY,
             "[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d, subframe %d: Generating PDSCH/DLSCH with input size = %"PRIu16", G %d, nb_rb %"PRIu16", mcs %"PRIu8", pmi_alloc %"PRIx16", rv %"PRIu8" (round %"PRIu8")\n",
             phy_vars_eNB->Mod_id, phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti,harq_pid,
@@ -2665,7 +1627,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
             pmi2hex_2Ar1(phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->pmi_alloc),
             phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->rvidx,
             phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->round);
-#endif
+
 #if defined(MESSAGE_CHART_GENERATOR_PHY)
       MSC_LOG_TX_MESSAGE(
         MSC_PHY_ENB,MSC_PHY_UE,
@@ -2674,11 +1636,11 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
         phy_vars_eNB->proc[sched_subframe].frame_tx, subframe,
         input_buffer_length,
         get_G(&phy_vars_eNB->lte_frame_parms,
-                        phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->nb_rb,
-                        phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->rb_alloc,
-                        get_Qm(phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->mcs),
-                        phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->Nl,
-                        num_pdcch_symbols,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe),
+        		phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->nb_rb,
+        		phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->rb_alloc,
+        		get_Qm(phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->mcs),
+        		phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->Nl,
+        		num_pdcch_symbols,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe),
         phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->nb_rb,
         phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->mcs,
         pmi2hex_2Ar1(phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->pmi_alloc),
@@ -2692,21 +1654,21 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
 
         phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].dlsch_trials[harq_pid][0]++;
 
-#ifdef OPENAIR2
-        DLSCH_pdu = mac_xface->get_dlsch_sdu(phy_vars_eNB->Mod_id,
-                                             phy_vars_eNB->CC_id,
-                                             phy_vars_eNB->proc[sched_subframe].frame_tx,
-                                             phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti,
-                                             0);
-        phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS_MAC += phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->TBS;
-#else
-        DLSCH_pdu = DLSCH_pdu_tmp;
-
-        for (i=0; i<input_buffer_length; i++)
-          DLSCH_pdu[i] = (unsigned char)(taus()&0xff);
-
-#endif
-
+	if (phy_vars_eNB->mac_enabled==1) {
+	  DLSCH_pdu = mac_xface->get_dlsch_sdu(phy_vars_eNB->Mod_id,
+					       phy_vars_eNB->CC_id,
+					       phy_vars_eNB->proc[sched_subframe].frame_tx,
+					       phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->rnti,
+					       0);
+	  phy_vars_eNB->eNB_UE_stats[UE_id].total_TBS_MAC += phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->TBS;
+	}
+	else {
+	  DLSCH_pdu = DLSCH_pdu_tmp;
+	  
+	  for (i=0; i<input_buffer_length; i++)
+	    DLSCH_pdu[i] = (unsigned char)(taus()&0xff);
+	}
+	
 #if defined(SMBV) && !defined(EXMIMO)
 
         // Configures the data source of allocation (allocation is configured by DCI)
@@ -2717,10 +1679,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
 
 #endif
 
-//printf("eNB DLSCH SDU (len %d bits): \n", (int)phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->TBS);
-//for (i=0; i<phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->TBS>>3; i++)
-//printf("%"PRIx8".",DLSCH_pdu[i]);
-//printf("\n");
 
 #ifdef DEBUG_PHY_PROC
 #ifdef DEBUG_DLSCH
@@ -2769,15 +1727,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
                          subframe<<1);
         stop_meas(&phy_vars_eNB->dlsch_scrambling_stats);
         start_meas(&phy_vars_eNB->dlsch_modulation_stats);
-        //for (sect_id=0;sect_id<number_of_cards;sect_id++) {
 
-        /*          if ((phy_vars_eNB->transmission_mode[(uint8_t)UE_id] == 5) &&
-              (phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->dl_power_off == 0))
-              amp = (int16_t)(((int32_t)AMP*(int32_t)ONE_OVER_SQRT2_Q15)>>15);
-              else*/
-        //              amp = AMP;
-        //      if (UE_id == 1)
-        //      LOG_I(PHY,"[MYEMOS] MCS_i %d\n", phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->harq_processes[harq_pid]->mcs);
 
         re_allocated = dlsch_modulation(phy_vars_eNB->lte_eNB_common_vars.txdataF[0],
                                         AMP,
@@ -2802,7 +1752,6 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
 #endif
       phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->active = 0;
 
-      //mac_xface->macphy_exit("first dlsch transmitted\n");
     }
 
     else if ((phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0])&&
@@ -2811,22 +1760,15 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
 
       // clear subframe TX flag since UE is not scheduled for PDSCH in this subframe (so that we don't look for PUCCH later)
       phy_vars_eNB->dlsch_eNB[(uint8_t)UE_id][0]->subframe_tx[subframe]=0;
-#ifdef DEBUG_PHY_PROC
-      //LOG_D(PHY,"[eNB %d] DCI: Clearing subframe_tx for subframe %d, UE %d\n",phy_vars_eNB->Mod_id,subframe,UE_id);
-#endif
     }
   }
 
 
 
   // if we have PHICH to generate
-  //    printf("[PHY][eNB] Frame %d subframe %d Checking for phich\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe);
+
   if (is_phich_subframe(&phy_vars_eNB->lte_frame_parms,subframe))
   {
-#ifdef DEBUG_PHY_PROC
-    //      LOG_D(PHY,"[eNB %d] Frame %d, subframe %d: Calling generate_phich_top\n",phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx, subframe);
-#endif
-    //    for (sect_id=0;sect_id<number_of_cards;sect_id++) {
     generate_phich_top(phy_vars_eNB,
                        sched_subframe,
                        AMP,
@@ -2862,6 +1804,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
   stop_meas(&phy_vars_eNB->phy_proc_tx);
 
 
+  (void)re_allocated; /* remove gcc warning "set but not used" */
 }
 
 void process_Msg3(PHY_VARS_eNB *phy_vars_eNB,uint8_t sched_subframe,uint8_t UE_id, uint8_t harq_pid)
@@ -2921,6 +1864,9 @@ void process_HARQ_ACK(
           Mod_id, dlsch->rnti, dl_harq_pid, dlsch_harq_proc->round);
 #endif
 
+    T(T_ENB_PHY_DLSCH_UE_NACK, T_INT(phy_vars_eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(UE_id), T_INT(dlsch->rnti),
+      T_INT(dl_harq_pid[m]));
+
     if (dlsch_harq_proc->round == 0)
       ue_stats->dlsch_NAK_round0++;
 
@@ -2944,7 +1890,6 @@ void process_HARQ_ACK(
       dlsch_harq_proc->round = 0;
       ue_stats->dlsch_l2_errors[dl_harq_pid]++;
       dlsch_harq_proc->status = SCH_IDLE;
-      put_harq_pid_in_freelist(dlsch, dl_harq_pid);
       dlsch->harq_ids[dl_subframe] = dlsch->Mdlharq;
     }
   } else {
@@ -2952,13 +1897,16 @@ void process_HARQ_ACK(
     LOG_D(PHY,"[eNB %d][PDSCH %x/%d] ACK Received in round %d, resetting process\n",
           Mod_id, dlsch->rnti, dl_harq_pid, dlsch_harq_proc->round);
 #endif
+
+    T(T_ENB_PHY_DLSCH_UE_ACK, T_INT(phy_vars_eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(UE_id), T_INT(dlsch->rnti),
+      T_INT(dl_harq_pid[m]));
+
     ue_stats->dlsch_ACK[dl_harq_pid][dlsch_harq_proc->round]++;
 
 //printf("ACKNACK got an ACK! CC %d\n", phy_vars_eNB->CC_id);
     // Received ACK so set round to 0 and set dlsch_harq_pid IDLE
     dlsch_harq_proc->round  = 0;
     dlsch_harq_proc->status = SCH_IDLE;
-    put_harq_pid_in_freelist(dlsch, dl_harq_pid);
     dlsch->harq_ids[dl_subframe] = dlsch->Mdlharq;
 
     ue_stats->total_TBS = ue_stats->total_TBS +
@@ -3017,7 +1965,7 @@ void process_HARQ_feedback(uint8_t UE_id,
   LTE_DL_eNB_HARQ_t *dlsch_harq_proc;
   uint8_t subframe_m4,M,m;
   int mp;
-  int all_ACKed=1,nb_alloc=0,nb_ACK=0;
+  int /*all_ACKed=1,*/nb_alloc=0,nb_ACK=0;
   int frame = phy_vars_eNB->proc[sched_subframe].frame_rx;
   int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx;
   int harq_pid = subframe2harq_pid( &phy_vars_eNB->lte_frame_parms,frame,subframe);
@@ -3073,22 +2021,30 @@ printf("ACKNACK **** fr/subfr %d/%d sCC %d ack %d\n", frame, subframe, phy_vars_
     subframe_m4 = (subframe<4) ? subframe+6 : subframe-4;
 
     dl_harq_pid[0] = dlsch->harq_ids[subframe_m4];
-    if (0/*two cells configured*/) 
+    if (0/*two cells configured*/)
       M=2;
     else
       M=1;
 
     for (m=0;m<M;m++) {
-      if (pusch_flag == 1)
-	dlsch_ACK[m] = phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[harq_pid]->o_ACK[m];
-      else
-	dlsch_ACK[m] = pucch_payload[m];
-
-//printf("process_HARQ_feedback fr/subfr %d %d dlsch_ACK[0] %d CC %d\n", frame, subframe, dlsch_ACK[0], phy_vars_eNB->CC_id);
-      LOG_D(PHY,"[eNB %d] Frame %d: Received ACK/NAK (%d/%d) %d for subframe %d\n",phy_vars_eNB->Mod_id,
-	    frame,m,M,dlsch_ACK[0],subframe_m4);
+      if (pusch_flag == 1) {
+        dlsch_ACK[m] = phy_vars_eNB->ulsch_eNB[(uint8_t)UE_id]->harq_processes[harq_pid]->o_ACK[m];
+        if (dlsch->subframe_tx[subframe_m4]==1)
+        LOG_D(PHY,"[eNB %d] Frame %d: Received ACK/NAK %d on PUSCH for subframe %d\n",phy_vars_eNB->Mod_id,
+	    frame,dlsch_ACK[m],subframe_m4);
+      }
+      else {
+        dlsch_ACK[m] = pucch_payload[m];
+        LOG_D(PHY,"[eNB %d] Frame %d: Received ACK/NAK (%d/%d) on PUCCH for subframe %d\n",phy_vars_eNB->Mod_id,
+	    frame,m,M,dlsch_ACK[m],subframe_m4);
+        /*
+        if (dlsch_ACK[0]==0)
+	AssertFatal(0,"Exiting on NAK on PUCCH\n");
+        */
+      }
     }
 
+
 #if defined(MESSAGE_CHART_GENERATOR_PHY)
     MSC_LOG_RX_MESSAGE(
       MSC_PHY_ENB,MSC_PHY_UE,
@@ -3123,8 +2079,8 @@ printf("ACKNACK **** fr/subfr %d/%d sCC %d ack %d\n", frame, subframe, phy_vars_
 
     else {  // PUCCH ACK/NAK
       if ((SR_payload == 1)&&(pucch_sel!=2)) {  // decode Table 7.3 if multiplexing and SR=1
-	// handle case where positive SR was transmitted with multiplexing
-	// this case is not properly tested!
+        // handle case where positive SR was transmitted with multiplexing
+        // this case is not properly tested!
         nb_ACK = 0;
 
         if (M == 2) {
@@ -3141,27 +2097,27 @@ printf("ACKNACK **** fr/subfr %d/%d sCC %d ack %d\n", frame, subframe, phy_vars_
             nb_ACK = 3;
         }
 
-	nb_alloc = 0;
+        nb_alloc = 0;
 
-	for (m=0; m<M; m++) {
-	  dl_subframe = ul_ACK_subframe2_dl_subframe(&phy_vars_eNB->lte_frame_parms,
-						     subframe,
-						     m);
+        for (m=0; m<M; m++) {
+          dl_subframe = ul_ACK_subframe2_dl_subframe(&phy_vars_eNB->lte_frame_parms,
+                                                     subframe,
+                                                     m);
 
-	  if (dlsch->subframe_tx[dl_subframe]==1)
-	    nb_alloc++;
-	}
+          if (dlsch->subframe_tx[dl_subframe]==1)
+            nb_alloc++;
+        }
 
-	if (nb_alloc == nb_ACK) {
-	  //all_ACKed = 1;
-	  for (m=0; m<M; m++) 
-	    dlsch_ACK[m] = 1;
-	}
-	else {
-	  //all_ACKed = 0;
-	  for (m=0; m<M; m++) 
-	    dlsch_ACK[m] = 0;
-	}
+        if (nb_alloc == nb_ACK) {
+          //all_ACKed = 1;
+          for (m=0; m<M; m++)
+            dlsch_ACK[m] = 1;
+        }
+        else {
+          //all_ACKed = 0;
+          for (m=0; m<M; m++)
+            dlsch_ACK[m] = 0;
+        }
 
       } else if (pucch_sel == 2) { // bundling or M=1
         //  printf("*** (%d,%d)\n",pucch_payload[0],pucch_payload[1]);
@@ -3490,10 +2446,9 @@ void prach_procedures(PHY_VARS_eNB *phy_vars_eNB,uint8_t sched_subframe,uint8_t
   memset(&preamble_delay_list[0],0,64*sizeof(uint16_t));
 
   if (abstraction_flag == 0) {
-    LOG_D(PHY,"[eNB %d][RAPROC] Frame %d, Subframe %d : PRACH RX Signal Power : %d dBm\n",phy_vars_eNB->Mod_id,
+    LOG_D(PHY,"[eNB %d][RAPROC] Frame %d, Subframe %d : PRACH RX Signal Power : %d dBm\n",phy_vars_eNB->Mod_id, 
           frame,subframe,dB_fixed(signal_energy(&phy_vars_eNB->lte_eNB_common_vars.rxdata[0][0][subframe*phy_vars_eNB->lte_frame_parms.samples_per_tti],512)) - phy_vars_eNB->rx_total_gain_eNB_dB);
 
-    //    LOG_I(PHY,"[eNB %d][RAPROC] PRACH: rootSequenceIndex %d, prach_ConfigIndex %d, zeroCorrelationZoneConfig %d, highSpeedFlag %d, prach_FreqOffset %d\n",phy_vars_eNB->Mod_id,phy_vars_eNB->lte_frame_parms.prach_config_common.rootSequenceIndex,phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex, phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag,phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset);
 
     rx_prach(phy_vars_eNB,
              subframe,
@@ -3538,31 +2493,25 @@ void prach_procedures(PHY_VARS_eNB *phy_vars_eNB,uint8_t sched_subframe,uint8_t
 #endif
 
   if (preamble_energy_list[preamble_max] > 580) {
-    /*
-    write_output("prach_ifft0.m","prach_t0",prach_ifft[0],2048,1,1);
-    write_output("prach_rx0.m","prach_rx0",&phy_vars_eNB->lte_eNB_common_vars.rxdata[0][0][subframe*phy_vars_eNB->lte_frame_parms.samples_per_tti],6144+792,1,1);
-    write_output("prach_rxF0.m","prach_rxF0",phy_vars_eNB->lte_eNB_prach_vars.rxsigF[0],24576,1,1);
-
-    mac_xface->macphy_exit("Exiting for PRACH debug\n");
-    */
 
     UE_id = find_next_ue_index(phy_vars_eNB);
-
+ 
     if (UE_id>=0) {
       phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].UE_timing_offset = preamble_delay_list[preamble_max]&0x1FFF; //limit to 13 (=11+2) bits
-      //phy_vars_eNb->eNB_UE_stats[(uint32_t)UE_id].mode = PRACH;
+
       phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].sector = 0;
-      LOG_I(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure (UE_id %d) with preamble %d, energy %d.%d dB, delay %d\n",
+      LOG_D(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure (UE_id %d) with preamble %d, energy %d.%d dB, delay %d\n",
             phy_vars_eNB->Mod_id,
             phy_vars_eNB->CC_id,
             frame,
             subframe,
-            UE_id,
+	    UE_id,
             preamble_max,
             preamble_energy_max/10,
             preamble_energy_max%10,
             preamble_delay_list[preamble_max]);
-#ifdef OPENAIR2
+
+      if (phy_vars_eNB->mac_enabled==1) {
         uint8_t update_TA=4;
 
         switch (phy_vars_eNB->lte_frame_parms.N_RB_DL) {
@@ -3588,9 +2537,9 @@ void prach_procedures(PHY_VARS_eNB *phy_vars_eNB,uint8_t sched_subframe,uint8_t
                                   frame,
                                   preamble_max,
                                   preamble_delay_list[preamble_max]*update_TA,
-                                  0,subframe,0);
+				  0,subframe,0);
+      }      
 
-#endif
     } else {
       MSC_LOG_EVENT(MSC_PHY_ENB, "0 RA Failed add user, too many");
       LOG_I(PHY,"[eNB %d][RAPROC] frame %d, subframe %d: Unable to add user, max user count reached\n",
@@ -3609,229 +2558,846 @@ void ulsch_decoding_procedures(unsigned char subframe, unsigned int i, PHY_VARS_
 }
 
 
-
-void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_eNB,const uint8_t abstraction_flag,const relaying_type_t r_type)
+void pucch_procedures(const unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_eNB,int UE_id,int harq_pid,const uint8_t abstraction_flag)
 {
-  //RX processing
-  UNUSED(r_type);
-  uint32_t l, ret=0,i,j,k;
-  uint32_t sect_id=0;
-  uint32_t harq_pid, harq_idx, round;
+  LTE_DL_FRAME_PARMS *frame_parms=&phy_vars_eNB->lte_frame_parms;
   uint8_t SR_payload = 0,*pucch_payload=NULL,pucch_payload0[2]= {0,0},pucch_payload1[2]= {0,0};
-  uint8_t cs0,cs1,cs2,cs3;
+  uint8_t cs0,cs1 /* ,cs2,cs3 */;
   int16_t n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3;
   uint8_t do_SR = 0;
   uint8_t pucch_sel = 0;
-  int32_t metric0=0,metric1=0,metric2=0;
+  int32_t metric0=0,metric1=0,metric2=0,metric0_SR=0;
   ANFBmode_t bundling_flag;
   PUCCH_FMT_t format;
   int thres;
-  uint8_t nPRS;
-  //  uint8_t two_ues_connected = 0;
-  uint8_t pusch_active = 0;
-  LTE_DL_FRAME_PARMS *frame_parms=&phy_vars_eNB->lte_frame_parms;
-  int sync_pos;
-  uint16_t rnti=0;
-  uint8_t access_mode;
-  int num_active_cba_groups;
-  const int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx;
-  const int frame = phy_vars_eNB->proc[sched_subframe].frame_rx;
   int sfm4;
 
+  const int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx;
+  const int frame = phy_vars_eNB->proc[sched_subframe].frame_rx;
 
-#ifdef OAI_USRP
-  int aa;
-#endif
-  AssertFatal(sched_subframe < NUM_ENB_THREADS, "Bad sched_subframe %d", sched_subframe);
-
-  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX,1);
-  start_meas(&phy_vars_eNB->phy_proc_rx);
-#ifdef DEBUG_PHY_PROC
-  LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_RX(%d)\n",phy_vars_eNB->Mod_id,frame, subframe);
-#endif
+  if ((phy_vars_eNB->dlsch_eNB[UE_id][0]) &&
+      (phy_vars_eNB->dlsch_eNB[UE_id][0]->rnti>0) &&
+      /* for the moment the UE only transmits on its primary CC */
+      (phy_vars_eNB->pCCflag[UE_id] == 1) &&
+      (phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->subframe_scheduling_flag==0)) { 
+
+    // check SR availability
+    do_SR = is_SR_subframe(phy_vars_eNB,UE_id,sched_subframe);
+    //      do_SR = 0;
+
+    // Now ACK/NAK
+    // First check subframe_tx flag for earlier subframes
+    n1_pucch0 = -1;
+    n1_pucch1 = -1;
+    n1_pucch2 = -1;
+    n1_pucch3 = -1;
+    get_n1_pucch_eNB(phy_vars_eNB,
+                     UE_id,
+                     sched_subframe,
+                     &n1_pucch0,
+                     &n1_pucch1,
+                     &n1_pucch2,
+                     &n1_pucch3);
+
+    LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d, subframe %d Checking for PUCCH (%d,%d,%d,%d) SR %d\n",
+          phy_vars_eNB->Mod_id,phy_vars_eNB->dlsch_eNB[UE_id][0]->rnti,
+          frame,subframe,
+          n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,do_SR);
 
-  /*
-#ifdef OAI_USRP
-  for (aa=0;aa<phy_vars_eNB->lte_frame_parms.nb_antennas_rx;aa++)
-    rescale(&phy_vars_eNB->lte_eNB_common_vars.rxdata[0][aa][subframe*phy_vars_eNB->lte_frame_parms.samples_per_tti],
-            phy_vars_eNB->lte_frame_parms.samples_per_tti);
-#endif
-  */
-  if (abstraction_flag == 0) {
-    remove_7_5_kHz(phy_vars_eNB,subframe<<1);
-    remove_7_5_kHz(phy_vars_eNB,(subframe<<1)+1);
-  }
+    if ((n1_pucch0==-1) &&
+        (n1_pucch1==-1) &&
+        (n1_pucch2==-1) &&
+        (n1_pucch3==-1) &&
+        (do_SR==0)) {  // no TX PDSCH that have to be checked and no SR for this UE_id
+    } else {
+      // otherwise we have some PUCCH detection to do
 
-  // check if we have to detect PRACH first
-  if (is_prach_subframe(&phy_vars_eNB->lte_frame_parms,frame,subframe)>0) {
-    VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,1);
-    prach_procedures(phy_vars_eNB,sched_subframe,abstraction_flag);
-    VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,0);
-  }
+      // Null out PUCCH PRBs for noise measurement
+      switch(phy_vars_eNB->lte_frame_parms.N_RB_UL) {
+      case 6:
+        phy_vars_eNB->rb_mask_ul[0] |= (0x1 | (1<<5)); //position 5
+        break;
+      case 15:
+        phy_vars_eNB->rb_mask_ul[0] |= (0x1 | (1<<14)); // position 14
+        break;
+      case 25:
+        phy_vars_eNB->rb_mask_ul[0] |= (0x1 | (1<<24)); // position 24
+        break;
+      case 50:
+        phy_vars_eNB->rb_mask_ul[0] |= 0x1;
+        phy_vars_eNB->rb_mask_ul[1] |= (1<<17); // position 49 (49-32)
+        break;
+      case 75:
+        phy_vars_eNB->rb_mask_ul[0] |= 0x1;
+        phy_vars_eNB->rb_mask_ul[2] |= (1<<10); // position 74 (74-64)
+        break;
+      case 100:
+        phy_vars_eNB->rb_mask_ul[0] |= 0x1;
+        phy_vars_eNB->rb_mask_ul[3] |= (1<<3); // position 99 (99-96)
+        break;
+      default:
+        LOG_E(PHY,"Unknown number for N_RB_UL %d\n",phy_vars_eNB->lte_frame_parms.N_RB_UL);
+        break;
+      }
 
-  if (abstraction_flag == 0) {
-    start_meas(&phy_vars_eNB->ofdm_demod_stats);
+      if (do_SR == 1)
+        phy_vars_eNB->eNB_UE_stats[UE_id].sr_total++;
 
-    for (l=0; l<phy_vars_eNB->lte_frame_parms.symbols_per_tti/2; l++) {
+      if (do_SR == 1
+#ifdef Rel10
+            /* SR detection is different when 2 CCs and channel selection are active
+             * (this special case is done below)
+             */
+             &&
+            !(phy_vars_eNB->lte_frame_parms.frame_type == FDD &&
+              phy_vars_eNB->n_configured_SCCs[UE_id] == 1 &&
+              phy_vars_eNB->pucch_config_dedicated[UE_id].channel_selection == 1
+              /* we still have to detect SR here if there is no n1_pucch valid */
+              && (n1_pucch0 != -1 || n1_pucch1 != -1 || n1_pucch2 != -1 || n1_pucch3 != -1))
+#endif
+                    ) {
+        // get metric for SR only
+        if (abstraction_flag == 0)
+          metric0_SR = rx_pucch(phy_vars_eNB,
+                                pucch_format1,
+                                UE_id,
+                                phy_vars_eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex,
+                                0, // n2_pucch
+                                0, // shortened format, should be use_srs flag, later
+                                &SR_payload,
+                                frame,
+                                subframe,
+                                PUCCH1_THRES);
 
-      //      for (sect_id=0;sect_id<number_of_cards;sect_id++) {
-      slot_fep_ul(&phy_vars_eNB->lte_frame_parms,
-                  &phy_vars_eNB->lte_eNB_common_vars,
-                  l,
-                  subframe<<1,
-                  0,
-                  0
-                 );
-      slot_fep_ul(&phy_vars_eNB->lte_frame_parms,
-                  &phy_vars_eNB->lte_eNB_common_vars,
-                  l,
-                  (subframe<<1)+1,
-                  0,
-                  0
-                 );
-    }
+#ifdef PHY_ABSTRACTION
+        else {
+          metric0_SR = rx_pucch_emul(phy_vars_eNB,
+                                     UE_id,
+                                     pucch_format1,
+                                     0,
+                                     &SR_payload,
+                                     sched_subframe);
+          LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR (UE SR %d/%d)\n",phy_vars_eNB->Mod_id,
+                phy_vars_eNB->ulsch_eNB[UE_id]->rnti,frame,subframe,SR_payload,phy_vars_eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex);
+        }
 
-    stop_meas(&phy_vars_eNB->ofdm_demod_stats);
-  }
+#endif
+      }// do_SR==1
 
-  sect_id = 0;
+      if ((n1_pucch0==-1) && (n1_pucch1==-1)) { // just check for SR
+      } else if (phy_vars_eNB->lte_frame_parms.frame_type==FDD) { // FDD
 
-  /*
-    for (UE_id=0;UE_id<NUMBER_OF_UE_MAX;UE_id++) {
-
-    if ((phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].mode>PRACH) && (last_slot%2==1)) {
-    #ifdef DEBUG_PHY_PROC
-    LOG_D(PHY,"[eNB %d] frame %d, slot %d: Doing SRS estimation and measurements for UE_id %d (UE_mode %d)\n",
-    phy_vars_eNB->Mod_id,
-    phy_vars_eNB->proc[sched_subframe].frame_tx, last_slot,
-    UE_id,phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].mode);
-    #endif
-    for (sect_id=0;sect_id<number_of_cards;sect_id++) {
-
-    lte_srs_channel_estimation(&phy_vars_eNB->lte_frame_parms,
-    &phy_vars_eNB->lte_eNB_common_vars,
-    &phy_vars_eNB->lte_eNB_srs_vars[(uint32_t)UE_id],
-    &phy_vars_eNB->soundingrs_ul_config_dedicated[(uint32_t)UE_id],
-    last_slot>>1,
-    sect_id);
-    lte_eNB_srs_measurements(phy_vars_eNB,
-    sect_id,
-    UE_id,
-    1);
-    #ifdef DEBUG_PHY_PROC
-    LOG_D(PHY,"[eNB %d] frame %d, slot %d: UE_id %d, sect_id %d: RX RSSI %d (from SRS)\n",
-    phy_vars_eNB->Mod_id,
-    phy_vars_eNB->proc[sched_subframe].frame_tx, last_slot,
-    UE_id,sect_id,
-    phy_vars_eNB->PHY_measurements_eNB[sect_id].rx_rssi_dBm[(uint32_t)UE_id]);
-    #endif
-    }
+        sfm4 = (subframe+6)%10;
 
-    sect_id=0;
-    #ifdef USER_MODE
-    //write_output("srs_est0.m","srsest0",phy_vars_eNB->lte_eNB_common_vars.srs_ch_estimates[0][0],512,1,1);
-    //write_output("srs_est1.m","srsest1",phy_vars_eNB->lte_eNB_common_vars.srs_ch_estimates[0][1],512,1,1);
-    #endif
-
-    //msg("timing advance in\n");
-    sync_pos = lte_est_timing_advance(&phy_vars_eNB->lte_frame_parms,
-    &phy_vars_eNB->lte_eNB_srs_vars[(uint32_t)UE_id],
-    &sect_id,
-    phy_vars_eNB->first_run_timing_advance[(uint32_t)UE_id],
-    number_of_cards,
-    24576);
-
-    //msg("timing advance out\n");
-
-    //phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].UE_timing_offset = sync_pos - phy_vars_eNB->lte_frame_parms.nb_prefix_samples/8;
-    phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].UE_timing_offset = 0;
-    phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].sector = sect_id;
-    #ifdef DEBUG_PHY_PROC
-    LOG_D(PHY,"[eNB %d] frame %d, slot %d: user %d in sector %d: timing_advance = %d\n",
-    phy_vars_eNB->Mod_id,
-    phy_vars_eNB->proc[sched_subframe].frame_tx, last_slot,
-    UE_id, sect_id,
-    phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].UE_timing_offset);
-    #endif
-    }
-    }
-    else {
+        if (phy_vars_eNB->n_configured_SCCs[UE_id] == 0) { // use Rel8 procedure for SR/PUCCH multiplexing
 
-    }
-  */
+          // if SR was detected, use the n1_pucch from SR, else use n1_pucch0
+          // (first paragraph from Section 7.3.1 from 36.213)
+          //n1_pucch0 = (SR_payload==1) ? phy_vars_eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex:n1_pucch0;
 
-  // Check for active processes in current subframe
-  harq_pid = subframe2harq_pid(&phy_vars_eNB->lte_frame_parms,
-                               frame,subframe);
-  pusch_active = 0;
+          LOG_D(PHY,"Demodulating PUCCH for ACK/NAK: n1_pucch0 %d (%d), SR_payload %d\n",n1_pucch0,phy_vars_eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex,SR_payload);
 
-  // reset the cba flag used for collision detection
-  for (i=0; i < NUM_MAX_CBA_GROUP; i++) {
-    phy_vars_eNB->cba_last_reception[i]=0;
+          if (phy_vars_eNB->dlsch_eNB[UE_id][1]->subframe_tx[sfm4]==0) {  // TB2 is not active
+            format = pucch_format1a;
+            thres  = PUCCH1a_THRES;
+          }
+          else {// TB2 is active
+            format = pucch_format1b;
+            thres  = PUCCH1b_THRES;
+          }
+          if (abstraction_flag == 0) {
+            metric0 = rx_pucch(phy_vars_eNB,
+                               format,
+                               UE_id,
+                               (uint16_t)n1_pucch0,
+                               0, //n2_pucch
+                               0, // shortened format
+                               pucch_payload0,
+                               frame,
+                               subframe,
+                               thres);
+
+            if (metric0 < metric0_SR)
+              metric0=rx_pucch(phy_vars_eNB,
+                               format,
+                               UE_id,
+                               phy_vars_eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex,
+                               0, //n2_pucch
+                               0, // shortened format
+                               pucch_payload0,
+                               frame,
+                               subframe,
+                               thres);
+          }
+          else {
+#ifdef PHY_ABSTRACTION
+            metric0 = rx_pucch_emul(phy_vars_eNB,UE_id,
+                                    format,
+                                    0,
+                                    pucch_payload0,
+                                    subframe);
+#endif
+          } // abstraction flag
+printf("NO CC SR f/sf %d/%d: do_SR %d/pl %d (n1 SR %d/noSR %d) m %d pucch payload %d format %d (1a %d 1b %d) (tb1 %d 2 %d)\n", frame, subframe,
+       do_SR, SR_payload, phy_vars_eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex, n1_pucch0, metric0, pucch_payload0[0], format,
+       pucch_format1a, pucch_format1b, phy_vars_eNB->dlsch_eNB[UE_id][0]->subframe_tx[sfm4], phy_vars_eNB->dlsch_eNB[UE_id][1]->subframe_tx[sfm4]);
+        } // active_SCCs=0
+#ifdef Rel10
+        else if ((phy_vars_eNB->n_configured_SCCs[UE_id] == 1) &&
+                 (phy_vars_eNB->pucch_config_dedicated[UE_id].channel_selection==1)) {
+          // use Rel10 procedure for SR/PUCCH multiplexing with Channel Selection
+
+#if 0
+          // if SR was detected, use the n1_pucch from SR, else use n1_pucch0
+          // (second paragraph from Section 7.3.1 from 36.213)
+printf("SR_payload %d\n", SR_payload);
+          if (SR_payload == 1) {
+{
+  int m0, m1, m2;
+  int p0[2], p1[2], p2[2];
+  n1_pucch0 = phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex;
+  m0 = rx_pucch(phy_vars_eNB,
+                                 pucch_format1b,
+                                 UE_id,
+                                 (uint16_t)n1_pucch0,
+                                 0, //n2_pucch
+                                 0, // shortened format
+                                 pucch_payload0,
+                                 frame,
+                                 subframe,
+                                 PUCCH1b_THRES);
+  p0[0] = pucch_payload0[0]; p0[1] = pucch_payload0[1];
+
+  n1_pucch0 = 0;
+  m1 = rx_pucch(phy_vars_eNB,
+                                 pucch_format1b_cs2,
+                                 UE_id,
+                                 (uint16_t)n1_pucch0,
+                                 0, //n2_pucch
+                                 0, // shortened format
+                                 pucch_payload0,
+                                 frame,
+                                 subframe,
+                                 PUCCH1b_THRES);
+  p1[0] = pucch_payload0[0]; p1[1] = pucch_payload0[1];
+
+  n1_pucch0 = 31;
+  m2 = rx_pucch(phy_vars_eNB,
+                                 pucch_format1b_cs2,
+                                 UE_id,
+                                 (uint16_t)n1_pucch0,
+                                 0, //n2_pucch
+                                 0, // shortened format
+                                 pucch_payload0,
+                                 frame,
+                                 subframe,
+                                 PUCCH1b_THRES);
+  p2[0] = pucch_payload0[0]; p2[1] = pucch_payload0[1];
+  printf("SR: m0/m1/m2 %d/%d/%d p0 %d%d p1 %d%d p2 %d%d\n",
+         m0, m1, m2, p0[0], p0[1], p1[0], p1[1], p2[0], p2[1]);
+}
+            n1_pucch0 = phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex;
+            if (abstraction_flag == 0)
+              metric0 = rx_pucch(phy_vars_eNB,
+                                 pucch_format1b_cs2,
+                                 UE_id,
+                                 (uint16_t)n1_pucch0,
+                                 0, //n2_pucch
+                                 0, // shortened format
+                                 pucch_payload0,
+                                 frame,
+                                 subframe,
+                                 PUCCH1b_THRES);
+            else {
+#ifdef PHY_ABSTRACTION
+              metric0 = rx_pucch_emul(phy_vars_eNB,UE_id,
+                                      pucch_format1b,
+                                      0,
+                                      pucch_payload0,
+                                      subframe);
+#endif
+            } // abstraction flag
+printf("pucch detect on SR (%d) payload %d %d\n", n1_pucch0, pucch_payload0[0], pucch_payload0[1]);
+          }
+          else { // No SR so use channel selection procedure
+printf("!!! n1_pucch0 %d n1_pucch1 %d n1_pucch2 %d n1_pucch3 %d\n", n1_pucch0, n1_pucch1, n1_pucch2, n1_pucch3);
+            if ((n1_pucch0 != -1) &&
+                (n1_pucch1 != -1) &&
+                (n1_pucch2 == -1) &&
+                (n1_pucch3 == -1) )  { // A = 2 case
+
+              // call rx_pucch for two sequences
+              metric0 = rx_pucch(phy_vars_eNB,
+                                 pucch_format1b_cs2,
+                                 UE_id,
+                                 (uint16_t)n1_pucch0,
+                                 0, //n2_pucch
+                                 0, // shortened format
+                                 &cs0,
+                                 frame,
+                                 subframe,
+                                 PUCCH1b_THRES);
+              metric1 = rx_pucch(phy_vars_eNB,
+                                 pucch_format1b_cs2,
+                                 UE_id,
+                                 (uint16_t)n1_pucch1,
+                                 0, //n2_pucch
+                                 0, // shortened format
+                                 &cs1,
+                                 frame,
+                                 subframe,
+                                 PUCCH1b_THRES);
+              // This is Table 10.1.2.2.1-3 from 36.213
+              if (metric0>metric1) {
+                pucch_payload0[0] = cs0;
+                pucch_payload0[1] = 0;   // NACK/DTX
+              }
+              else {
+                pucch_payload0[0] = cs1;
+                pucch_payload0[1] = 1;   // ACK
+              }
+printf("pucch detect on pucch %d payload %d %d (metric %d/%d)\n", metric0 > metric1 ? n1_pucch0 : n1_pucch1, pucch_payload0[0], pucch_payload0[1], metric0, metric1);
+            }
+            else if ((n1_pucch2 != -1) &&
+                     (n1_pucch3 == -1) ) { //A = 3 case
+            }
+            else if (n1_pucch3 != -1) {
+
+            }
+            else {
+              AssertFatal(0, "Impossible HARQ channel selection condition n1_pucch (%d,%d,%d,%d)",n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3);
+            }
+          }
+#endif
+/* REPLACEMENT CODE STARTS HERE */
+          if ((n1_pucch0 != -1) &&
+              (n1_pucch1 != -1) &&
+              (n1_pucch2 == -1) &&
+              (n1_pucch3 == -1) )  { // A = 2 case
+            if (do_SR == 1)
+              metric0 = rx_pucch(phy_vars_eNB,
+                                 pucch_format1b,
+                                 UE_id,
+                                 phy_vars_eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex,
+                                 0, //n2_pucch
+                                 0, // shortened format
+                                 pucch_payload0,
+                                 frame,
+                                 subframe,
+                                 PUCCH1b_THRES);
+            metric1 = rx_pucch(phy_vars_eNB,
+                               pucch_format1b_cs2,
+                               UE_id,
+                               (uint16_t)n1_pucch0,
+                               0, //n2_pucch
+                               0, // shortened format
+                               &cs0,
+                               frame,
+                               subframe,
+                               PUCCH1b_THRES);
+            metric2 = rx_pucch(phy_vars_eNB,
+                               pucch_format1b_cs2,
+                               UE_id,
+                               (uint16_t)n1_pucch1,
+                               0, //n2_pucch
+                               0, // shortened format
+                               &cs1,
+                               frame,
+                               subframe,
+                               PUCCH1b_THRES);
+printf("SR: do_SR %d (n1 %d/%d/%d) m0/m1/m2 %d/%d/%d p0 %d%d cs0 %d cs1 %d\n",
+       do_SR, phy_vars_eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex, n1_pucch0, n1_pucch1, metric0, metric1, metric2, pucch_payload0[0], pucch_payload0[1], cs0, cs1);
+            if (do_SR == 1 && metric0 > metric1 && metric0 > metric2) {
+              SR_payload = 1;
+            } else if (metric1 > metric2) {
+              pucch_payload0[0] = cs0;
+              pucch_payload0[1] = 0;   // NACK/DTX
+            } else {
+              pucch_payload0[0] = cs1;
+              pucch_payload0[1] = 1;   // ACK
+            }
+          } else if ((n1_pucch2 != -1) &&
+                     (n1_pucch3 == -1) ) { //A = 3 case
+            AssertFatal(0, "case A=3 TODO");
+          } else if (n1_pucch3 != -1) {
+            AssertFatal(0, "case A=4 TODO");
+          } else {
+            AssertFatal(0, "Impossible HARQ channel selection condition n1_pucch (%d,%d,%d,%d)",n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3);
+          }
+/* REPLACEMENT CODE ENDS HERE */
+        }
+#endif /* Rel10 */
+#ifdef DEBUG_PHY_PROC
+        LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d pucch1a (FDD) payload %d (metric %d)\n",
+              phy_vars_eNB->Mod_id,
+              phy_vars_eNB->dlsch_eNB[UE_id][0]->rnti,
+              frame,subframe,
+              pucch_payload0[0],metric0);
+#endif
+
+        process_HARQ_feedback(UE_id,sched_subframe,phy_vars_eNB,
+                              0,// pusch_flag
+                              pucch_payload0,
+                              2,
+                              SR_payload);
+      } // FDD
+      else {  //TDD
+
+        bundling_flag = phy_vars_eNB->pucch_config_dedicated[UE_id].tdd_AckNackFeedbackMode;
+
+        // fix later for 2 TB case and format1b
+
+        if ((frame_parms->frame_type==FDD) ||
+            (bundling_flag==bundling)    ||
+            ((frame_parms->frame_type==TDD)&&(frame_parms->tdd_config==1)&&((subframe!=2)||(subframe!=7)))) {
+          format = pucch_format1a;
+          //      msg("PUCCH 1a\n");
+        } else {
+          format = pucch_format1b;
+          //      msg("PUCCH 1b\n");
+        }
+
+        // if SR was detected, use the n1_pucch from SR
+        if (SR_payload==1) {
+#ifdef DEBUG_PHY_PROC
+          LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d Checking ACK/NAK (%d,%d,%d,%d) format %d with SR\n",phy_vars_eNB->Mod_id,
+                phy_vars_eNB->dlsch_eNB[UE_id][0]->rnti,
+                frame,subframe,
+                n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,format);
+#endif
+
+          if (abstraction_flag == 0)
+            metric0_SR = rx_pucch(phy_vars_eNB,
+                                  format,
+                                  UE_id,
+                                  phy_vars_eNB->scheduling_request_config[UE_id].sr_PUCCH_ResourceIndex,
+                                  0, //n2_pucch
+                                  0, // shortened format
+                                  pucch_payload0,
+                                  frame,
+                                  subframe,
+                                  PUCCH1a_THRES);
+          else {
+#ifdef PHY_ABSTRACTION
+            metric0 = rx_pucch_emul(phy_vars_eNB,UE_id,
+                                    format,
+                                    0,
+                                    pucch_payload0,
+                                    subframe);
+#endif
+          }
+        } else { //using n1_pucch0/n1_pucch1 resources
+#ifdef DEBUG_PHY_PROC
+          LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d Checking ACK/NAK (%d,%d,%d,%d) format %d\n",phy_vars_eNB->Mod_id,
+                phy_vars_eNB->dlsch_eNB[UE_id][0]->rnti,
+                frame,subframe,
+                n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,format);
+#endif
+          metric0=0;
+          metric1=0;
+
+          // Check n1_pucch0 metric
+          if (n1_pucch0 != -1) {
+            if (abstraction_flag == 0)
+              metric0 = rx_pucch(phy_vars_eNB,
+                                 format,
+                                 UE_id,
+                                 (uint16_t)n1_pucch0,
+                                 0, // n2_pucch
+                                 0, // shortened format
+                                 pucch_payload0,
+                                 frame,
+                                 subframe,
+                                 PUCCH1a_THRES);
+            else {
+#ifdef PHY_ABSTRACTION
+              metric0 = rx_pucch_emul(phy_vars_eNB,UE_id,
+                                      format,
+                                      0,
+                                      pucch_payload0,
+                                      subframe);
+#endif
+            }
+          }
+
+          // Check n1_pucch1 metric
+          if (n1_pucch1 != -1) {
+            if (abstraction_flag == 0)
+              metric1 = rx_pucch(phy_vars_eNB,
+                                 format,
+                                 UE_id,
+                                 (uint16_t)n1_pucch1,
+                                 0, //n2_pucch
+                                 0, // shortened format
+                                 pucch_payload1,
+                                 frame,
+                                 subframe,
+                                 PUCCH1a_THRES);
+            else {
+#ifdef PHY_ABSTRACTION
+              metric1 = rx_pucch_emul(phy_vars_eNB,UE_id,
+                                      format,
+                                      1,
+                                      pucch_payload1,
+                                      subframe);
+
+
+#endif
+            }
+          }
+        }
+
+        if (SR_payload == 1) {
+          pucch_payload = pucch_payload0;
+
+          if (bundling_flag == bundling)
+            pucch_sel = 2;
+        } else if (bundling_flag == multiplexing) { // multiplexing + no SR
+          pucch_payload = (metric1>metric0) ? pucch_payload1 : pucch_payload0;
+          pucch_sel     = (metric1>metric0) ? 1 : 0;
+        } else { // bundling + no SR
+          if (n1_pucch1 != -1)
+            pucch_payload = pucch_payload1;
+          else if (n1_pucch0 != -1)
+            pucch_payload = pucch_payload0;
+
+          pucch_sel = 2;  // indicate that this is a bundled ACK/NAK
+        }
+
+#ifdef DEBUG_PHY_PROC
+        LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d ACK/NAK metric 0 %d, metric 1 %d, sel %d, (%d,%d)\n",phy_vars_eNB->Mod_id,
+              phy_vars_eNB->dlsch_eNB[UE_id][0]->rnti,
+              frame,subframe,
+              metric0,metric1,pucch_sel,pucch_payload[0],pucch_payload[1]);
+#endif
+        process_HARQ_feedback(UE_id,sched_subframe,phy_vars_eNB,
+                              0,// pusch_flag
+                              pucch_payload,
+                              pucch_sel,
+                              SR_payload);
+      }
+    }
+
+    if (SR_payload == 1) {
+      LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Got SR for PUSCH, transmitting to MAC\n",phy_vars_eNB->Mod_id,
+            phy_vars_eNB->ulsch_eNB[UE_id]->rnti,frame,subframe);
+      phy_vars_eNB->eNB_UE_stats[UE_id].sr_received++;
+
+      if (phy_vars_eNB->first_sr[UE_id] == 1) { // this is the first request for uplink after Connection Setup, so clear HARQ process 0 use for Msg4
+        phy_vars_eNB->first_sr[UE_id] = 0;
+        phy_vars_eNB->dlsch_eNB[UE_id][0]->harq_processes[0]->round=0;
+        phy_vars_eNB->dlsch_eNB[UE_id][0]->harq_processes[0]->status=SCH_IDLE;
+        LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d First SR\n",
+              phy_vars_eNB->Mod_id,
+              phy_vars_eNB->ulsch_eNB[UE_id]->rnti,frame,subframe);
+      }
+
+      if (phy_vars_eNB->mac_enabled==1) {
+        mac_xface->SR_indication(phy_vars_eNB->Mod_id,
+                                 phy_vars_eNB->CC_id,
+                                 frame,
+                                 phy_vars_eNB->dlsch_eNB[UE_id][0]->rnti,subframe);
+      }
+    }
+  }
+}
+
+void cba_procedures(const unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_eNB,int UE_id,int harq_pid,const uint8_t abstraction_flag) {
+
+  uint8_t access_mode;
+  int num_active_cba_groups;
+  const int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx;
+  const int frame = phy_vars_eNB->proc[sched_subframe].frame_rx;
+  uint16_t rnti=0;
+  int ret=0;
+
+  num_active_cba_groups = phy_vars_eNB->ulsch_eNB[UE_id]->num_active_cba_groups;
+  
+  if ((phy_vars_eNB->ulsch_eNB[UE_id]) &&
+      (num_active_cba_groups > 0) &&
+      (phy_vars_eNB->ulsch_eNB[UE_id]->cba_rnti[UE_id%num_active_cba_groups]>0) &&
+      (phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->subframe_cba_scheduling_flag==1)) {
+    rnti=0;
+    
+#ifdef DEBUG_PHY_PROC
+    LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d Checking PUSCH/ULSCH CBA Reception for UE %d with cba rnti %x mode %s\n",
+	  phy_vars_eNB->Mod_id,harq_pid,
+	  frame,subframe,
+	  UE_id, (uint16_t)phy_vars_eNB->ulsch_eNB[UE_id]->cba_rnti[UE_id%num_active_cba_groups],mode_string[phy_vars_eNB->eNB_UE_stats[UE_id].mode]);
+#endif
+    
+    if (abstraction_flag==0) {
+      rx_ulsch(phy_vars_eNB,
+	       sched_subframe,
+	       phy_vars_eNB->eNB_UE_stats[UE_id].sector,  // this is the effective sector id
+	       UE_id,
+	       phy_vars_eNB->ulsch_eNB,
+	       0);
+    }
+    
+#ifdef PHY_ABSTRACTION
+    else {
+      rx_ulsch_emul(phy_vars_eNB,
+		    subframe,
+		    phy_vars_eNB->eNB_UE_stats[UE_id].sector,  // this is the effective sector id
+		    UE_id);
+    }
+    
+#endif
+    
+    if (abstraction_flag == 0) {
+      ret = ulsch_decoding(phy_vars_eNB,
+			   UE_id,
+			   sched_subframe,
+			   0, // control_only_flag
+			   phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->V_UL_DAI,
+			   phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->nb_rb>20 ? 1 : 0);
+    }
+    
+#ifdef PHY_ABSTRACTION
+    else {
+      ret = ulsch_decoding_emul(phy_vars_eNB,
+				sched_subframe,
+				UE_id,
+				&rnti);
+    }
+    
+#endif
+    
+    if (phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->cqi_crc_status == 1) {
+#ifdef DEBUG_PHY_PROC
+      
+      print_CQI(phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->o,phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->uci_format,0,phy_vars_eNB->lte_frame_parms.N_RB_DL);
+#endif
+      access_mode = UNKNOWN_ACCESS;
+      extract_CQI(phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->o,
+		  phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->uci_format,
+		  &phy_vars_eNB->eNB_UE_stats[UE_id],
+		  phy_vars_eNB->lte_frame_parms.N_RB_DL,
+		  &rnti, &access_mode,
+                  /* TODO more than one CC for this case? */
+                  1);
+      phy_vars_eNB->eNB_UE_stats[UE_id].rank = phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->o_RI[0];
+    }
+    
+      phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->subframe_cba_scheduling_flag=0;
+      phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->status= SCH_IDLE;
+      
+      if ((num_active_cba_groups > 0) &&
+          (UE_id + num_active_cba_groups < NUMBER_OF_UE_MAX) &&
+          (phy_vars_eNB->ulsch_eNB[UE_id+num_active_cba_groups]->cba_rnti[UE_id%num_active_cba_groups] > 0 ) &&
+          (phy_vars_eNB->ulsch_eNB[UE_id+num_active_cba_groups]->num_active_cba_groups> 0)) {
+#ifdef DEBUG_PHY_PROC
+        LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d harq_pid %d resetting the subframe_scheduling_flag for Ue %d cba groups %d members\n",
+              phy_vars_eNB->Mod_id,harq_pid,frame,subframe,UE_id,harq_pid,
+              UE_id+num_active_cba_groups, UE_id%phy_vars_eNB->ulsch_eNB[UE_id]->num_active_cba_groups);
+#endif
+        phy_vars_eNB->ulsch_eNB[UE_id+num_active_cba_groups]->harq_processes[harq_pid]->subframe_cba_scheduling_flag=1;
+        phy_vars_eNB->ulsch_eNB[UE_id+num_active_cba_groups]->harq_processes[harq_pid]->status= CBA_ACTIVE;
+        phy_vars_eNB->ulsch_eNB[UE_id+num_active_cba_groups]->harq_processes[harq_pid]->TBS=phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->TBS;
+      }
+
+      if (ret == (1+MAX_TURBO_ITERATIONS)) {
+        phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_round_errors[harq_pid][phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->round]++;
+        phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->phich_active = 1;
+        phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->phich_ACK = 0;
+        phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->round++;
+      } // ulsch in error
+      else {
+        LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d ULSCH received, setting round to 0, PHICH ACK\n",
+              phy_vars_eNB->Mod_id,harq_pid,
+              frame,subframe);
+
+        phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->phich_active = 1;
+        phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->phich_ACK = 1;
+        phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->round = 0;
+        phy_vars_eNB->eNB_UE_stats[UE_id].ulsch_consecutive_errors = 0;
+#ifdef DEBUG_PHY_PROC
+#ifdef DEBUG_ULSCH
+        LOG_D(PHY,"[eNB] Frame %d, Subframe %d : ULSCH SDU (RX harq_pid %d) %d bytes:",
+              frame,subframe,
+              harq_pid,phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->TBS>>3);
+
+        for (j=0; j<phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->TBS>>3; j++)
+          LOG_T(PHY,"%x.",phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->b[j]);
+
+        LOG_T(PHY,"\n");
+#endif
+#endif
+
+        if (access_mode > UNKNOWN_ACCESS) {
+          LOG_D(PHY,"[eNB %d] Frame %d, Subframe %d : received ULSCH SDU from CBA transmission, UE (%d,%x), CBA (group %d, rnti %x)\n",
+                phy_vars_eNB->Mod_id, frame,subframe,
+                UE_id, phy_vars_eNB->ulsch_eNB[UE_id]->rnti,
+                UE_id % phy_vars_eNB->ulsch_eNB[UE_id]->num_active_cba_groups, phy_vars_eNB->ulsch_eNB[UE_id]->cba_rnti[UE_id%num_active_cba_groups]);
+
+          // detect if there is a CBA collision
+          if (phy_vars_eNB->cba_last_reception[UE_id%num_active_cba_groups] == 0 ) {
+            mac_xface->rx_sdu(phy_vars_eNB->Mod_id,
+                              phy_vars_eNB->CC_id,
+                              frame,subframe,
+                              phy_vars_eNB->ulsch_eNB[UE_id]->rnti,
+                              phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->b,
+                              phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->TBS>>3,
+                              harq_pid,
+                              NULL);
+
+            phy_vars_eNB->cba_last_reception[UE_id%num_active_cba_groups]+=1;//(subframe);
+          } else {
+            if (phy_vars_eNB->cba_last_reception[UE_id%num_active_cba_groups] == 1 )
+              LOG_N(PHY,"[eNB%d] Frame %d subframe %d : first CBA collision detected \n ",
+                    phy_vars_eNB->Mod_id,frame,subframe);
+
+            LOG_N(PHY,"[eNB%d] Frame %d subframe %d : CBA collision set SR for UE %d in group %d \n ",
+                  phy_vars_eNB->Mod_id,frame,subframe,
+                  phy_vars_eNB->cba_last_reception[UE_id%num_active_cba_groups],UE_id%num_active_cba_groups );
+
+            phy_vars_eNB->cba_last_reception[UE_id%num_active_cba_groups]+=1;
+
+            mac_xface->SR_indication(phy_vars_eNB->Mod_id,
+                                     phy_vars_eNB->CC_id,
+                                     frame,
+                                     phy_vars_eNB->dlsch_eNB[UE_id][0]->rnti,subframe);
+          }
+        } // UNKNOWN_ACCESS
+      } // ULSCH CBA not in error
+  }
+
+}
+
+void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_eNB,const uint8_t abstraction_flag,const relaying_type_t r_type)
+{
+  //RX processing
+  UNUSED(r_type);
+  uint32_t l, ret=0,i,j,k;
+  uint32_t harq_pid, harq_idx, round;
+  uint8_t nPRS;
+  LTE_DL_FRAME_PARMS *frame_parms=&phy_vars_eNB->lte_frame_parms;
+  int sync_pos;
+  uint16_t rnti=0;
+  uint8_t access_mode;
+
+  const int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx;
+  const int frame = phy_vars_eNB->proc[sched_subframe].frame_rx;
+
+  AssertFatal(sched_subframe < NUM_ENB_THREADS, "Bad sched_subframe %d", sched_subframe);
+
+  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX,1);
+  start_meas(&phy_vars_eNB->phy_proc_rx);
+#ifdef DEBUG_PHY_PROC
+  LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_RX(%d)\n",phy_vars_eNB->Mod_id,frame, subframe);
+#endif
+
+  T(T_ENB_PHY_UL_TICK, T_INT(phy_vars_eNB->Mod_id), T_INT(frame), T_INT(subframe));
+
+  T(T_ENB_PHY_INPUT_SIGNAL, T_INT(phy_vars_eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(0),
+    T_BUFFER(&phy_vars_eNB->lte_eNB_common_vars.rxdata[0][0][subframe*phy_vars_eNB->lte_frame_parms.samples_per_tti],
+             phy_vars_eNB->lte_frame_parms.samples_per_tti * 4));
+
+  phy_vars_eNB->rb_mask_ul[0]=0;
+  phy_vars_eNB->rb_mask_ul[1]=0;
+  phy_vars_eNB->rb_mask_ul[2]=0;
+  phy_vars_eNB->rb_mask_ul[3]=0;
+
+  if (abstraction_flag == 0) {
+    remove_7_5_kHz(phy_vars_eNB,subframe<<1);
+    remove_7_5_kHz(phy_vars_eNB,(subframe<<1)+1);
+  }
+
+  // check if we have to detect PRACH first
+  if (is_prach_subframe(&phy_vars_eNB->lte_frame_parms,frame,subframe)>0) {
+    VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,1);
+    prach_procedures(phy_vars_eNB,sched_subframe,abstraction_flag);
+    VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,0);
+  }
+
+  if (abstraction_flag == 0) {
+    start_meas(&phy_vars_eNB->ofdm_demod_stats);
+
+    for (l=0; l<phy_vars_eNB->lte_frame_parms.symbols_per_tti/2; l++) {
+
+      slot_fep_ul(&phy_vars_eNB->lte_frame_parms,
+                  &phy_vars_eNB->lte_eNB_common_vars,
+                  l,
+                  subframe<<1,
+                  0,
+                  0
+                 );
+      slot_fep_ul(&phy_vars_eNB->lte_frame_parms,
+                  &phy_vars_eNB->lte_eNB_common_vars,
+                  l,
+                  (subframe<<1)+1,
+                  0,
+                  0
+                 );
+    }
+
+    stop_meas(&phy_vars_eNB->ofdm_demod_stats);
+  }
+
+  // Check for active processes in current subframe
+  harq_pid = subframe2harq_pid(&phy_vars_eNB->lte_frame_parms,
+                               frame,subframe);
+
+  // reset the cba flag used for collision detection
+  for (i=0; i < NUM_MAX_CBA_GROUP; i++) {
+    phy_vars_eNB->cba_last_reception[i]=0;
   }
 
-  //  LOG_I(PHY,"subframe %d: nPRS %d\n",last_slot>>1,phy_vars_eNB->lte_frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[last_slot-1]);
+  // Do PUCCH processing first
 
   for (i=0; i<NUMBER_OF_UE_MAX; i++) {
+    pucch_procedures(sched_subframe,phy_vars_eNB,i,harq_pid,abstraction_flag);
+  }
 
-    /*
-      if ((i == 1) && (phy_vars_eNB->cooperation_flag > 0) && (two_ues_connected == 1))
-      break;
-    */
-#ifdef OPENAIR2
-    if (phy_vars_eNB->eNB_UE_stats[i].mode == RA_RESPONSE)
-      process_Msg3(phy_vars_eNB,sched_subframe,i,harq_pid);
-
-#endif
+  for (i=0; i<NUMBER_OF_UE_MAX; i++) {
 
-    /*
-    #ifdef DEBUG_PHY_PROC
-    if (phy_vars_eNB->ulsch_eNB[i]) {
-
-      LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d, subframe %d rnti %x, alloc %d, Msg3 %d\n",phy_vars_eNB->Mod_id,
-      harq_pid,frame,subframe,
-      (phy_vars_eNB->ulsch_eNB[i]->rnti),
-      (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->subframe_scheduling_flag),
-      (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag)
-      );
+    // check for Msg3
+    if (phy_vars_eNB->mac_enabled==1) {
+      if (phy_vars_eNB->eNB_UE_stats[i].mode == RA_RESPONSE) {
+	process_Msg3(phy_vars_eNB,sched_subframe,i,harq_pid);
+      }
     }
-    #endif
-    */
+
+
+    phy_vars_eNB->pusch_stats_rb[i][(frame*10)+subframe] = -63;
+    phy_vars_eNB->pusch_stats_round[i][(frame*10)+subframe] = 0;
+    phy_vars_eNB->pusch_stats_mcs[i][(frame*10)+subframe] = -63;
 
     if ((phy_vars_eNB->ulsch_eNB[i]) &&
         (phy_vars_eNB->ulsch_eNB[i]->rnti>0) &&
-        (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->subframe_scheduling_flag==1) &&
-        /* for the moment, the UE transmits only on its primary CC */
-        (phy_vars_eNB->pCCflag[i] == 1)) {
-
-      pusch_active = 1;
+        (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->subframe_scheduling_flag==1)) {
+      // UE is has ULSCH scheduling
       round = phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round;
 
+      for (int rb=0;
+           rb<=phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb;
+	   rb++) {
+	int rb2 = rb+phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->first_rb;
+	phy_vars_eNB->rb_mask_ul[rb2>>5] |= (1<<(rb2&31));
+      }
 #ifdef DEBUG_PHY_PROC
       LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d Scheduling PUSCH/ULSCH Reception for rnti %x (UE_id %d)\n",
             phy_vars_eNB->Mod_id,harq_pid,
             frame,subframe,phy_vars_eNB->ulsch_eNB[i]->rnti,i);
 #endif
 
-#ifdef DEBUG_PHY_PROC
-
       if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1) {
         LOG_D(PHY,"[eNB %d] frame %d, subframe %d: Scheduling ULSCH Reception for Msg3 in Sector %d\n",
               phy_vars_eNB->Mod_id,
               frame,
               subframe,
               phy_vars_eNB->eNB_UE_stats[i].sector);
+	VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_MSG3,1);
       } else {
-        LOG_D(PHY,"[eNB %d] frame %d, subframe %d: Scheduling ULSCH Reception for UE %d Mode %s sect_id %d\n",
+        LOG_D(PHY,"[eNB %d] frame %d, subframe %d: Scheduling ULSCH Reception for UE %d Mode %s\n",
               phy_vars_eNB->Mod_id,
               frame,
               subframe,
               i,
-              mode_string[phy_vars_eNB->eNB_UE_stats[i].mode],
-              phy_vars_eNB->eNB_UE_stats[i].sector);
+              mode_string[phy_vars_eNB->eNB_UE_stats[i].mode]);
       }
 
-#endif
 
       nPRS = phy_vars_eNB->lte_frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[subframe<<1];
 
@@ -3859,7 +3425,6 @@ printf("pusch f/sf %d/%d harq_pid %d ulsch %p O_ACK %d (%d %d)\n", frame, subfra
        phy_vars_eNB->n_configured_SCCs[i] == 1 && phy_vars_eNB->dlsch_eNB[i][0]->dlsch_s[0][0]->subframe_tx[sf] > 0);
       }
 
-#ifdef DEBUG_PHY_PROC
       LOG_D(PHY,
             "[eNB %d][PUSCH %d] Frame %d Subframe %d Demodulating PUSCH: dci_alloc %d, rar_alloc %d, round %d, first_rb %d, nb_rb %d, mcs %d, TBS %d, rv %d, cyclic_shift %d (n_DMRS2 %d, cyclicShift_common %d, nprs %d), O_ACK %d \n",
             phy_vars_eNB->Mod_id,harq_pid,frame,subframe,
@@ -3876,7 +3441,9 @@ printf("pusch f/sf %d/%d harq_pid %d ulsch %p O_ACK %d (%d %d)\n", frame, subfra
             phy_vars_eNB->lte_frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift,
             nPRS,
             phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->O_ACK);
-#endif
+      phy_vars_eNB->pusch_stats_rb[i][(frame*10)+subframe] = phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb;
+      phy_vars_eNB->pusch_stats_round[i][(frame*10)+subframe] = phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round;
+      phy_vars_eNB->pusch_stats_mcs[i][(frame*10)+subframe] = phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->mcs;
       start_meas(&phy_vars_eNB->ulsch_demodulation_stats);
 
       if (abstraction_flag==0) {
@@ -3907,904 +3474,391 @@ printf("pusch f/sf %d/%d harq_pid %d ulsch %p O_ACK %d (%d %d)\n", frame, subfra
         ret = ulsch_decoding(phy_vars_eNB,
                              i,
                              sched_subframe,
-                             0, // control_only_flag
-                             phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->V_UL_DAI,
-                             0);
-      }
-
-#ifdef PHY_ABSTRACTION
-      else {
-        ret = ulsch_decoding_emul(phy_vars_eNB,
-                                  sched_subframe,
-                                  i,
-                                  &rnti);
-      }
-
-#endif
-      stop_meas(&phy_vars_eNB->ulsch_decoding_stats);
-
-#ifdef DEBUG_PHY_PROC
-      LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) RSSI (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d\n",
-            phy_vars_eNB->Mod_id,harq_pid,
-            frame,subframe,
-            phy_vars_eNB->ulsch_eNB[i]->rnti,
-            dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[0]),
-            dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[1]),
-            phy_vars_eNB->eNB_UE_stats[i].UL_rssi[0],
-            phy_vars_eNB->eNB_UE_stats[i].UL_rssi[1],
-            phy_vars_eNB->PHY_measurements_eNB->n0_power_dB[0],
-            phy_vars_eNB->PHY_measurements_eNB->n0_power_dB[1],
-            phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[0],
-            phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[1],
-            ret);
-#endif //DEBUG_PHY_PROC
-      /*
-      if ((two_ues_connected==1) && (phy_vars_eNB->cooperation_flag==2)) {
-      for (j=0;j<phy_vars_eNB->lte_frame_parms.nb_antennas_rx;j++) {
-      phy_vars_eNB->eNB_UE_stats[i].UL_rssi[j] = dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power_0[j])
-      - phy_vars_eNB->rx_total_gain_eNB_dB;
-      phy_vars_eNB->eNB_UE_stats[i+1].UL_rssi[j] = dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power_1[j])
-      - phy_vars_eNB->rx_total_gain_eNB_dB;
-      }
-      #ifdef DEBUG_PHY_PROC
-      LOG_D(PHY,"[eNB %d] Frame %d subframe %d: ULSCH %d RX power UE0 (%d,%d) dB RX power UE1 (%d,%d)\n",
-      phy_vars_eNB->Mod_id,phy_vars_eNB->proc[sched_subframe].frame_tx,last_slot>>1,i,
-      dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power_0[0]),
-      dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power_0[1]),
-      dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power_1[0]),
-      dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power_1[1]));
-      #endif
-      }
-      else {
-      */
-
-if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->O_ACK)
-printf("o_ACK %d %d\n", phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[0], phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[1]);
-      //compute the expected ULSCH RX power (for the stats)
-      phy_vars_eNB->ulsch_eNB[(uint32_t)i]->harq_processes[harq_pid]->delta_TF =
-        get_hundred_times_delta_IF_eNB(phy_vars_eNB,i,harq_pid, 0); // 0 means bw_factor is not considered
-
-      //dump_ulsch(phy_vars_eNB, sched_subframe, i);
-
-      phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts[harq_pid][phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round]++;
-#ifdef DEBUG_PHY_PROC
-      LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d harq_pid %d Clearing subframe_scheduling_flag\n",
-            phy_vars_eNB->Mod_id,harq_pid,frame,subframe,i,harq_pid);
-#endif
-      phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->subframe_scheduling_flag=0;
-
-//printf("phy_vars_eNB->ulsch_eNB[%d]->harq_processes[%d]->cqi_crc_status == %d\n", i, harq_pid, phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->cqi_crc_status);
-      if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->cqi_crc_status == 1) {
-#ifdef DEBUG_PHY_PROC
-        //if (((phy_vars_eNB->proc[sched_subframe].frame_tx%10) == 0) || (phy_vars_eNB->proc[sched_subframe].frame_tx < 50))
-        print_CQI(phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->uci_format,0,phy_vars_eNB->lte_frame_parms.N_RB_DL);
-#endif
-        extract_CQI(phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o,
-                    phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->uci_format,
-                    &phy_vars_eNB->eNB_UE_stats[i],
-                    phy_vars_eNB->lte_frame_parms.N_RB_DL,
-                    &rnti, &access_mode,
-                    /* for the moment, maximum 2 CCs supported */
-                    phy_vars_eNB->CA_activated[i] ? 2 : 1);
-#if 0
-/* no need to update because in openair1/PHY/LTE_TRANSPORT/uci_tools.c it is now correctly done */
-        /* if 2 CCs are activated, we must update stats of 2nd CC */
-        if (phy_vars_eNB->CA_activated[i]) {
-          /* hack! one should get the phy_var depending on the UE */
-          PHY_VARS_eNB *cc2 = PHY_vars_eNB_g[0][1];
-          cc2->eNB_UE_stats[i].DL_cqi[0] = phy_vars_eNB->eNB_UE_stats[i].DL_cqi[1];
-          memcpy(cc2->eNB_UE_stats[i].DL_subband_cqi[0], phy_vars_eNB->eNB_UE_stats[i].DL_subband_cqi[1], 13);
-        }
-#endif
-        phy_vars_eNB->eNB_UE_stats[i].rank = phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_RI[0];
-      }
-
-      if (ret == (1+MAX_TURBO_ITERATIONS)) {
-
-        /*
-        if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round>0) {
-          dump_ulsch(phy_vars_eNB, sched_subframe, i);
-          mac_xface->macphy_exit("retransmission in error");
-        }
-        */
-
-        phy_vars_eNB->eNB_UE_stats[i].ulsch_round_errors[harq_pid][phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round]++;
-        phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active = 1;
-        phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_ACK = 0;
-        phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round++;
-
-        LOG_D(PHY,"[eNB][PUSCH %d] Increasing to round %d\n",harq_pid,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round);
-
-        if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1) {
-          LOG_I(PHY,"[eNB %d/%d][RAPROC] frame %d, subframe %d, UE %d: Error receiving ULSCH (Msg3), round %d/%d\n",
-                phy_vars_eNB->Mod_id,
-                phy_vars_eNB->CC_id,
-                frame,subframe, i,
-                phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round-1,
-                phy_vars_eNB->lte_frame_parms.maxHARQ_Msg3Tx-1);
-
-          LOG_I(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) RSSI (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d\n",
-                phy_vars_eNB->Mod_id,harq_pid,
-                frame,subframe,
-                phy_vars_eNB->ulsch_eNB[i]->rnti,
-                dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[0]),
-                dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[1]),
-                phy_vars_eNB->eNB_UE_stats[i].UL_rssi[0],
-                phy_vars_eNB->eNB_UE_stats[i].UL_rssi[1],
-                phy_vars_eNB->PHY_measurements_eNB->n0_power_dB[0],
-                phy_vars_eNB->PHY_measurements_eNB->n0_power_dB[1],
-                phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[0],
-                phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[1],
-                ret);
-
-          if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round ==
-              phy_vars_eNB->lte_frame_parms.maxHARQ_Msg3Tx) {
-            LOG_I(PHY,"[eNB %d][RAPROC] maxHARQ_Msg3Tx reached, abandoning RA procedure for UE %d\n",
-                  phy_vars_eNB->Mod_id, i);
-            phy_vars_eNB->eNB_UE_stats[i].mode = PRACH;
-#ifdef OPENAIR2
-            mac_xface->cancel_ra_proc(phy_vars_eNB->Mod_id,
-                                      phy_vars_eNB->CC_id,
-                                      frame,
-                                      phy_vars_eNB->eNB_UE_stats[i].crnti);
-#endif
-            remove_ue(phy_vars_eNB->eNB_UE_stats[i].crnti,phy_vars_eNB,abstraction_flag);
-            phy_vars_eNB->ulsch_eNB[(uint32_t)i]->Msg3_active = 0;
-            //phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active = 0;
-
-          } else {
-            // activate retransmission for Msg3 (signalled to UE PHY by PHICH (not MAC/DCI)
-            phy_vars_eNB->ulsch_eNB[(uint32_t)i]->Msg3_active = 1;
-
-            get_Msg3_alloc_ret(&phy_vars_eNB->lte_frame_parms,
-                               subframe,
-                               frame,
-                               &phy_vars_eNB->ulsch_eNB[i]->Msg3_frame,
-                               &phy_vars_eNB->ulsch_eNB[i]->Msg3_subframe);
-          }/*
-
-    LOG_D(PHY,"[eNB] Frame %d, Subframe %d : ULSCH SDU (RX harq_pid %d) %d bytes:",frame,subframe,
-    harq_pid,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3);
-    for (j=0;j<phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3;j++)
-      printf("%x.",phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->c[0][j]);
-    printf("\n");
-     */
-          //    dump_ulsch(phy_vars_eNB,sched_subframe,i);
-          //#ifndef EXMIMO_IOT
-          LOG_W(PHY,"[eNB] Frame %d, Subframe %d: Msg3 in error, i = %d \n", frame,subframe,i);
-          //#else
-          //mac_exit_wrapper("Msg3 error");
-          //#endif
-        } // This is Msg3 error
-        else { //normal ULSCH
-          LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d Error receiving ULSCH, round %d/%d (ACK %d,%d)\n",
-                phy_vars_eNB->Mod_id,harq_pid,
-                frame,subframe, i,
-                phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round-1,
-                phy_vars_eNB->ulsch_eNB[i]->Mdlharq,
-                phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[0],
-                phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[1]);
-
-#if defined(MESSAGE_CHART_GENERATOR_PHY)
-          MSC_LOG_RX_DISCARDED_MESSAGE(
-            MSC_PHY_ENB,MSC_PHY_UE,
-            NULL,0,
-            "%05u:%02u ULSCH received rnti %x harq id %u round %d",
-            frame,subframe,
-            phy_vars_eNB->ulsch_eNB[i]->rnti,harq_pid,
-            phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round-1
-            );
-#endif
-          /*
-          LOG_T(PHY,"[eNB] Frame %d, Subframe %d : ULSCH SDU (RX harq_pid %d) %d bytes:\n",frame,subframe,
-          harq_pid,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3);
-          if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->c[0]!=NULL){
-            for (j=0;j<phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3;j++)
-              LOG_T(PHY,"%x.",phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->c[0][j]);
-            LOG_T(PHY,"\n");
-          }
-          */
-
-
-          //    dump_ulsch(phy_vars_eNB,sched_subframe,i);
-          //mac_exit_wrapper("ULSCH error");
-
-          if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round== phy_vars_eNB->ulsch_eNB[i]->Mdlharq) {
-            LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d ULSCH Mdlharq %d reached\n",
-                  phy_vars_eNB->Mod_id,harq_pid,
-                  frame,subframe, i,
-                  phy_vars_eNB->ulsch_eNB[i]->Mdlharq);
-
-            phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round=0;
-            phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active=0;
-            phy_vars_eNB->eNB_UE_stats[i].ulsch_errors[harq_pid]++;
-            phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors++;
-            //dump_ulsch(phy_vars_eNB, sched_subframe, i);
-          }
-        }
-      }  // ulsch in error
-      else {
-        if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1) {
-          LOG_I(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d ULSCH received, setting round to 0, PHICH ACK\n",
-                phy_vars_eNB->Mod_id,harq_pid,
-                frame,subframe);
-          LOG_I(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) RSSI (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d\n",
-                phy_vars_eNB->Mod_id,harq_pid,
-                frame,subframe,
-                phy_vars_eNB->ulsch_eNB[i]->rnti,
-                dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[0]),
-                dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[1]),
-                phy_vars_eNB->eNB_UE_stats[i].UL_rssi[0],
-                phy_vars_eNB->eNB_UE_stats[i].UL_rssi[1],
-                phy_vars_eNB->PHY_measurements_eNB->n0_power_dB[0],
-                phy_vars_eNB->PHY_measurements_eNB->n0_power_dB[1],
-                phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[0],
-                phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[1],
-                ret);
-        }
-#if defined(MESSAGE_CHART_GENERATOR_PHY)
-        MSC_LOG_RX_MESSAGE(
-          MSC_PHY_ENB,MSC_PHY_UE,
-          NULL,0,
-          "%05u:%02u ULSCH received rnti %x harq id %u",
-          frame,subframe,
-          phy_vars_eNB->ulsch_eNB[i]->rnti,harq_pid
-          );
-#endif
-        for (j=0; j<phy_vars_eNB->lte_frame_parms.nb_antennas_rx; j++)
-          //this is the RSSI per RB
-          phy_vars_eNB->eNB_UE_stats[i].UL_rssi[j] =
-            dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[j]*
-                     (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb*12)/
-                     phy_vars_eNB->lte_frame_parms.ofdm_symbol_size) -
-            phy_vars_eNB->rx_total_gain_eNB_dB -
-            hundred_times_log10_NPRB[phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb-1]/100 -
-            get_hundred_times_delta_IF_eNB(phy_vars_eNB,i,harq_pid, 0)/100;
-
-        phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active = 1;
-        phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_ACK = 1;
-        phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round = 0;
-        phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors = 0;
-
-        if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1) {
-#ifdef OPENAIR2
-#ifdef DEBUG_PHY_PROC
-          LOG_I(PHY,"[eNB %d][RAPROC] Frame %d Terminating ra_proc for harq %d, UE %d\n",
-                phy_vars_eNB->Mod_id,
-                frame,harq_pid,i);
-#endif
-          mac_xface->rx_sdu(phy_vars_eNB->Mod_id,
-                            phy_vars_eNB->CC_id,
-                            frame,subframe,
-                            phy_vars_eNB->ulsch_eNB[i]->rnti,
-                            phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b,
-                            phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3,
-                            harq_pid,
-                            &phy_vars_eNB->ulsch_eNB[i]->Msg3_flag);
-
-          // false msg3 detection by MAC: empty PDU
-          if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 0 ) {
-            phy_vars_eNB->eNB_UE_stats[i].mode = PRACH;
-            mac_xface->cancel_ra_proc(phy_vars_eNB->Mod_id,
-                                      phy_vars_eNB->CC_id,
-                                      frame,
-                                      phy_vars_eNB->eNB_UE_stats[i].crnti);
-            remove_ue(phy_vars_eNB->eNB_UE_stats[i].crnti,phy_vars_eNB,abstraction_flag);
-            phy_vars_eNB->ulsch_eNB[(uint32_t)i]->Msg3_active = 0;
-          }
-
-          /*
-            mac_xface->terminate_ra_proc(phy_vars_eNB->Mod_id,
-            frame,
-            phy_vars_eNB->ulsch_eNB[i]->rnti,
-            phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b,
-            phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3);
-          */
-#endif
-
-          phy_vars_eNB->eNB_UE_stats[i].mode = PUSCH;
-          phy_vars_eNB->ulsch_eNB[i]->Msg3_flag = 0;
-
-#ifdef DEBUG_PHY_PROC
-          LOG_D(PHY,"[eNB %d][RAPROC] Frame %d : RX Subframe %d Setting UE %d mode to PUSCH\n",phy_vars_eNB->Mod_id,frame,subframe,i);
-#endif //DEBUG_PHY_PROC
-
-          for (k=0; k<8; k++) { //harq_processes
-            for (j=0; j<phy_vars_eNB->dlsch_eNB[i][0]->Mdlharq; j++) {
-              phy_vars_eNB->eNB_UE_stats[i].dlsch_NAK[k][j]=0;
-              phy_vars_eNB->eNB_UE_stats[i].dlsch_ACK[k][j]=0;
-              phy_vars_eNB->eNB_UE_stats[i].dlsch_trials[k][j]=0;
-            }
-
-            phy_vars_eNB->eNB_UE_stats[i].dlsch_l2_errors[k]=0;
-            phy_vars_eNB->eNB_UE_stats[i].ulsch_errors[k]=0;
-            phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors=0;
-
-            for (j=0; j<phy_vars_eNB->ulsch_eNB[i]->Mdlharq; j++) {
-              phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts[k][j]=0;
-              phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts_last[k][j]=0;
-              phy_vars_eNB->eNB_UE_stats[i].ulsch_round_errors[k][j]=0;
-              phy_vars_eNB->eNB_UE_stats[i].ulsch_round_fer[k][j]=0;
-            }
-          }
-
-          phy_vars_eNB->eNB_UE_stats[i].dlsch_sliding_cnt=0;
-          phy_vars_eNB->eNB_UE_stats[i].dlsch_NAK_round0=0;
-          phy_vars_eNB->eNB_UE_stats[i].dlsch_mcs_offset=0;
-
-          //mac_xface->macphy_exit("Mode PUSCH. Exiting.\n");
-        } else {
-
-#ifdef DEBUG_PHY_PROC
-#ifdef DEBUG_ULSCH
-          LOG_D(PHY,"[eNB] Frame %d, Subframe %d : ULSCH SDU (RX harq_pid %d) %d bytes:",frame,subframe,
-                harq_pid,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3);
-
-          for (j=0; j<phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3; j++)
-            LOG_T(PHY,"%x.",phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b[j]);
+                             0, // control_only_flag
+                             phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->V_UL_DAI,
+			     phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb>20 ? 1 : 0);
+      }
 
-          LOG_T(PHY,"\n");
-#endif
-#endif
-          //dump_ulsch(phy_vars_eNB,sched_subframe,i);
-
-
-#ifdef OPENAIR2
-          //    if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->calibration_flag == 0) {
-//printf("**** fr/subfr %d %d call mac_xface->rx_sdu CC %d\n", frame, subframe, phy_vars_eNB->CC_id);
-          mac_xface->rx_sdu(phy_vars_eNB->Mod_id,
-                            phy_vars_eNB->CC_id,
-                            frame,subframe,
-                            phy_vars_eNB->ulsch_eNB[i]->rnti,
-                            phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b,
-                            phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3,
-                            harq_pid,
-                            NULL);
-          //}
-          /*
-            else {
-            // Retrieve calibration information and do whatever
-            LOG_D(PHY,"[eNB][Auto-Calibration] Frame %d, Subframe %d : ULSCH PDU (RX) %d bytes\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3);
-            }
-          */
-#ifdef LOCALIZATION
-          start_meas(&phy_vars_eNB->localization_stats);
-          aggregate_eNB_UE_localization_stats(phy_vars_eNB,
-                                              i,
-                                              frame,
-                                              subframe,
-                                              get_hundred_times_delta_IF_eNB(phy_vars_eNB,i,harq_pid, 1)/100);
-          stop_meas(&phy_vars_eNB->localization_stats);
-#endif
+#ifdef PHY_ABSTRACTION
+      else {
+        ret = ulsch_decoding_emul(phy_vars_eNB,
+                                  sched_subframe,
+                                  i,
+                                  &rnti);
+      }
 
 #endif
-        }
+      stop_meas(&phy_vars_eNB->ulsch_decoding_stats);
 
-        // estimate timing advance for MAC
-        if (abstraction_flag == 0) {
-          sync_pos = lte_est_timing_advance_pusch(phy_vars_eNB,i,sched_subframe);
-          phy_vars_eNB->eNB_UE_stats[i].timing_advance_update = sync_pos - phy_vars_eNB->lte_frame_parms.nb_prefix_samples/4; //to check
-        }
+      LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) RSSI (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d\n",
+            phy_vars_eNB->Mod_id,harq_pid,
+            frame,subframe,
+            phy_vars_eNB->ulsch_eNB[i]->rnti,
+            dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[0]),
+            dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[1]),
+            phy_vars_eNB->eNB_UE_stats[i].UL_rssi[0],
+            phy_vars_eNB->eNB_UE_stats[i].UL_rssi[1],
+            phy_vars_eNB->PHY_measurements_eNB->n0_power_dB[0],
+            phy_vars_eNB->PHY_measurements_eNB->n0_power_dB[1],
+            phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[0],
+            phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[1],
+            ret);
 
-#ifdef DEBUG_PHY_PROC
-        LOG_D(PHY,"[eNB %d] frame %d, subframe %d: user %d in sector %d: timing advance = %d\n",
-              phy_vars_eNB->Mod_id,
-              frame, subframe,
-              i, sect_id,
-              phy_vars_eNB->eNB_UE_stats[i].timing_advance_update);
-#endif
 
+if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->O_ACK)
+printf("o_ACK %d %d\n", phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[0], phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[1]);
+      //compute the expected ULSCH RX power (for the stats)
+      phy_vars_eNB->ulsch_eNB[(uint32_t)i]->harq_processes[harq_pid]->delta_TF =
+        get_hundred_times_delta_IF_eNB(phy_vars_eNB,i,harq_pid, 0); // 0 means bw_factor is not considered
 
-      }  // ulsch not in error
+      //dump_ulsch(phy_vars_eNB, sched_subframe, i);
 
-      // process HARQ feedback
+      phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts[harq_pid][phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round]++;
 #ifdef DEBUG_PHY_PROC
-      LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d, Processing HARQ feedback for UE %d (after PUSCH)\n",phy_vars_eNB->Mod_id,
-            phy_vars_eNB->dlsch_eNB[i][0]->rnti,
-            frame,subframe,
-            i);
+      LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d harq_pid %d Clearing subframe_scheduling_flag\n",
+            phy_vars_eNB->Mod_id,harq_pid,frame,subframe,i,harq_pid);
 #endif
-      process_HARQ_feedback(i,
-                            sched_subframe,
-                            phy_vars_eNB,
-                            1, // pusch_flag
-                            0,
-                            0,
-                            0);
+      phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->subframe_scheduling_flag=0;
 
+//printf("phy_vars_eNB->ulsch_eNB[%d]->harq_processes[%d]->cqi_crc_status == %d\n", i, harq_pid, phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->cqi_crc_status);
+      if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->cqi_crc_status == 1) {
 #ifdef DEBUG_PHY_PROC
-      LOG_D(PHY,"[eNB %d] Frame %d subframe %d, sect %d: received ULSCH harq_pid %d for UE %d, ret = %d, CQI CRC Status %d, ACK %d,%d, ulsch_errors %d/%d\n",
-            phy_vars_eNB->Mod_id,frame,subframe,
-            phy_vars_eNB->eNB_UE_stats[i].sector,
-            harq_pid,
-            i,
-            ret,
-            phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->cqi_crc_status,
-            phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[0],
-            phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[1],
-            phy_vars_eNB->eNB_UE_stats[i].ulsch_errors[harq_pid],
-            phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts[harq_pid][0]);
+        //if (((phy_vars_eNB->proc[sched_subframe].frame_tx%10) == 0) || (phy_vars_eNB->proc[sched_subframe].frame_tx < 50))
+        print_CQI(phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->uci_format,0,phy_vars_eNB->lte_frame_parms.N_RB_DL);
 #endif
+        extract_CQI(phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o,
+                    phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->uci_format,
+                    &phy_vars_eNB->eNB_UE_stats[i],
+                    phy_vars_eNB->lte_frame_parms.N_RB_DL,
+                    &rnti, &access_mode,
+                    /* for the moment, maximum 2 CCs supported */
+                    phy_vars_eNB->CA_activated[i] ? 2 : 1);
+#if 0
+/* no need to update because in openair1/PHY/LTE_TRANSPORT/uci_tools.c it is now correctly done */
+        /* if 2 CCs are activated, we must update stats of 2nd CC */
+        if (phy_vars_eNB->CA_activated[i]) {
+          /* hack! one should get the phy_var depending on the UE */
+          PHY_VARS_eNB *cc2 = PHY_vars_eNB_g[0][1];
+          cc2->eNB_UE_stats[i].DL_cqi[0] = phy_vars_eNB->eNB_UE_stats[i].DL_cqi[1];
+          memcpy(cc2->eNB_UE_stats[i].DL_subband_cqi[0], phy_vars_eNB->eNB_UE_stats[i].DL_subband_cqi[1], 13);
+        }
+#endif
+        phy_vars_eNB->eNB_UE_stats[i].rank = phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_RI[0];
 
-    } // ulsch_eNB[i] && ....
-
-#ifdef PUCCH
-    else if ((phy_vars_eNB->dlsch_eNB[i][0]) &&
-             (phy_vars_eNB->dlsch_eNB[i][0]->rnti>0) &&
-             /* for the moment the UE only transmits on its primary CC */
-             (phy_vars_eNB->pCCflag[i] == 1)) { // check for PUCCH
-
-      // check SR availability
-      do_SR = is_SR_subframe(phy_vars_eNB,i,sched_subframe);
-      //      do_SR = 0;
+      }
 
-      // Now ACK/NAK
+      if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1)
+	VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_MSG3,0);
 
-      n1_pucch0 = -1;
-      n1_pucch1 = -1;
-      n1_pucch2 = -1;
-      n1_pucch3 = -1;
-      get_n1_pucch_eNB(phy_vars_eNB,
-                       i,
-                       sched_subframe,
-                       &n1_pucch0,
-                       &n1_pucch1,
-                       &n1_pucch2,
-                       &n1_pucch3);
+      if (ret == (1+MAX_TURBO_ITERATIONS)) {
+        T(T_ENB_PHY_ULSCH_UE_NACK, T_INT(phy_vars_eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(i), T_INT(phy_vars_eNB->ulsch_eNB[i]->rnti),
+          T_INT(harq_pid));
 
-      LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d, subframe %d Checking for PUCCH (%d,%d,%d,%d) SR %d\n",
-            phy_vars_eNB->Mod_id,phy_vars_eNB->dlsch_eNB[i][0]->rnti,
-            frame,subframe,
-            n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,do_SR);
+        phy_vars_eNB->eNB_UE_stats[i].ulsch_round_errors[harq_pid][phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round]++;
+        phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active = 1;
+        phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_ACK = 0;
+        phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round++;
 
-      if ((n1_pucch0==-1) &&
-          (n1_pucch1==-1) &&
-          (n1_pucch2==-1) &&
-          (n1_pucch3==-1) &&
-          (do_SR==0)) {  // no TX PDSCH that have to be checked and no SR for this UE_id
-      } else {
-        // otherwise we have some PUCCH detection to do
+        LOG_D(PHY,"[eNB][PUSCH %d] Increasing to round %d\n",harq_pid,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round);
 
-        if (do_SR == 1)
-          phy_vars_eNB->eNB_UE_stats[i].sr_total++;
+        if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1) {
+          LOG_D(PHY,"[eNB %d/%d][RAPROC] frame %d, subframe %d, UE %d: Error receiving ULSCH (Msg3), round %d/%d\n",
+                phy_vars_eNB->Mod_id,
+                phy_vars_eNB->CC_id,
+                frame,subframe, i,
+                phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round-1,
+                phy_vars_eNB->lte_frame_parms.maxHARQ_Msg3Tx-1);
 
-        if (do_SR == 1
-#ifdef Rel10
-              /* SR detection is different when 2 CCs and channel selection are active
-               * (this special case is done below)
-               */
-               &&
-              !(phy_vars_eNB->lte_frame_parms.frame_type == FDD &&
-                phy_vars_eNB->n_configured_SCCs[i] == 1 &&
-                phy_vars_eNB->pucch_config_dedicated[i].channel_selection == 1
-                /* we still have to detect SR here if there is no n1_pucch valid */
-                && (n1_pucch0 != -1 || n1_pucch1 != -1 || n1_pucch2 != -1 || n1_pucch3 != -1))
-#endif
-                      ) {
-          // get metric for SR only
-          if (abstraction_flag == 0)
-            metric0 = rx_pucch(phy_vars_eNB,
-                               pucch_format1,
-                               i,
-                               phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex,
-                               0, // n2_pucch
-                               0, // shortened format
-                               &SR_payload,
-                               subframe,
-                               PUCCH1_THRES);
+	  LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) RSSI (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d\n",
+		phy_vars_eNB->Mod_id,harq_pid,
+		frame,subframe,
+		phy_vars_eNB->ulsch_eNB[i]->rnti,
+		dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[0]),
+		dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[1]),
+		phy_vars_eNB->eNB_UE_stats[i].UL_rssi[0],
+		phy_vars_eNB->eNB_UE_stats[i].UL_rssi[1],
+		phy_vars_eNB->PHY_measurements_eNB->n0_power_dB[0],
+		phy_vars_eNB->PHY_measurements_eNB->n0_power_dB[1],
+		phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[0],
+		phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[1],
+		ret);
 
-#ifdef PHY_ABSTRACTION
-          else {
-            metric0 = rx_pucch_emul(phy_vars_eNB,
-                                    i,
-                                    pucch_format1,
-                                    0,
-                                    &SR_payload,
-                                    sched_subframe);
-            LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR (UE SR %d/%d)\n",phy_vars_eNB->Mod_id,
-                  phy_vars_eNB->ulsch_eNB[i]->rnti,frame,subframe,SR_payload,phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex);
-          }
+          if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round ==
+              phy_vars_eNB->lte_frame_parms.maxHARQ_Msg3Tx) {
+            LOG_D(PHY,"[eNB %d][RAPROC] maxHARQ_Msg3Tx reached, abandoning RA procedure for UE %d\n",
+                  phy_vars_eNB->Mod_id, i);
+            phy_vars_eNB->eNB_UE_stats[i].mode = PRACH;
+	    if (phy_vars_eNB->mac_enabled==1) {
+	      mac_xface->cancel_ra_proc(phy_vars_eNB->Mod_id,
+					phy_vars_eNB->CC_id,
+					frame,
+					phy_vars_eNB->eNB_UE_stats[i].crnti);
+	    }
+            mac_phy_remove_ue(phy_vars_eNB->Mod_id,phy_vars_eNB->eNB_UE_stats[i].crnti);
 
-#endif
-        }// do_SR==1
+            phy_vars_eNB->ulsch_eNB[(uint32_t)i]->Msg3_active = 0;
+            //phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active = 0;
 
-        if ((n1_pucch0==-1) && (n1_pucch1==-1)) { // just check for SR
-        }
-        else if (phy_vars_eNB->lte_frame_parms.frame_type==FDD) { // FDD
+          } else {
+            // activate retransmission for Msg3 (signalled to UE PHY by PHICH (not MAC/DCI)
+            phy_vars_eNB->ulsch_eNB[(uint32_t)i]->Msg3_active = 1;
 
-          sfm4 = (subframe+6)%10;
+            get_Msg3_alloc_ret(&phy_vars_eNB->lte_frame_parms,
+                               subframe,
+                               frame,
+                               &phy_vars_eNB->ulsch_eNB[i]->Msg3_frame,
+                               &phy_vars_eNB->ulsch_eNB[i]->Msg3_subframe);
+          }
+          LOG_D(PHY,"[eNB] Frame %d, Subframe %d: Msg3 in error, i = %d \n", frame,subframe,i);
+        } // This is Msg3 error
 
-          if (phy_vars_eNB->n_configured_SCCs[i] == 0) { // use Rel8 procedure for SR/PUCCH multiplexing
+        else { //normal ULSCH
+          LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d Error receiving ULSCH, round %d/%d (ACK %d,%d)\n",
+                phy_vars_eNB->Mod_id,harq_pid,
+                frame,subframe, i,
+                phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round-1,
+                phy_vars_eNB->ulsch_eNB[i]->Mlimit,
+                phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[0],
+                phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[1]);
 
-            // if SR was detected, use the n1_pucch from SR, else use n1_pucch0
-            // (first paragraph from Section 7.3.1 from 36.213)
-            n1_pucch0 = (SR_payload==1) ? phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex:n1_pucch0;
-            if (phy_vars_eNB->dlsch_eNB[i][1]->subframe_tx[sfm4]==0) {  // TB2 is not active
-              format = pucch_format1a;
-              thres  = PUCCH1a_THRES;
-            }
-            else {// TB2 is active
-              format = pucch_format1b;
-              thres  = PUCCH1b_THRES;
-            }
-            if (abstraction_flag == 0)
-              metric0 = rx_pucch(phy_vars_eNB,
-                                 format,
-                                 i,
-                                 (uint16_t)n1_pucch0,
-                                 0, //n2_pucch
-                                 0, // shortened format
-                                 pucch_payload0,
-                                 subframe,
-                                 thres);
-            else {
-#ifdef PHY_ABSTRACTION
-              metric0 = rx_pucch_emul(phy_vars_eNB,i,
-                                      format,
-                                      0,
-                                      pucch_payload0,
-                                      subframe);
+#if defined(MESSAGE_CHART_GENERATOR_PHY)
+          MSC_LOG_RX_DISCARDED_MESSAGE(
+            MSC_PHY_ENB,MSC_PHY_UE,
+            NULL,0,
+            "%05u:%02u ULSCH received rnti %x harq id %u round %d",
+            frame,subframe,
+            phy_vars_eNB->ulsch_eNB[i]->rnti,harq_pid,
+            phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round-1
+            );
 #endif
-            } // abstraction flag
-printf("NO CC SR f/sf %d/%d: do_SR %d/pl %d (n1 SR %d/noSR %d) m %d pucch payload %d format %d (1a %d 1b %d) (tb1 %d 2 %d)\n", frame, subframe,
-       do_SR, SR_payload, phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex, n1_pucch0, metric0, pucch_payload0[0], format,
-       pucch_format1a, pucch_format1b, phy_vars_eNB->dlsch_eNB[i][0]->subframe_tx[sfm4], phy_vars_eNB->dlsch_eNB[i][1]->subframe_tx[sfm4]);
-          } // active_SCCs=0
-#ifdef Rel10
-          else if ((phy_vars_eNB->n_configured_SCCs[i] == 1)&&
-                   (phy_vars_eNB->pucch_config_dedicated[i].channel_selection==1)){
-            // use Rel10 procedure for SR/PUCCH multiplexing with Channel Selection
-
-#if 0
-            // if SR was detected, use the n1_pucch from SR, else use n1_pucch0
-            // (second paragraph from Section 7.3.1 from 36.213)
-printf("SR_payload %d\n", SR_payload);
-            if (SR_payload == 1) {
-{
-  int m0, m1, m2;
-  int p0[2], p1[2], p2[2];
-  n1_pucch0 = phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex;
-  m0 = rx_pucch(phy_vars_eNB,
-                                   pucch_format1b,
-                                   i,
-                                   (uint16_t)n1_pucch0,
-                                   0, //n2_pucch
-                                   0, // shortened format
-                                   pucch_payload0,
-                                   subframe,
-                                   PUCCH1b_THRES);
-  p0[0] = pucch_payload0[0]; p0[1] = pucch_payload0[1];
 
-  n1_pucch0 = 0;
-  m1 = rx_pucch(phy_vars_eNB,
-                                   pucch_format1b_cs2,
-                                   i,
-                                   (uint16_t)n1_pucch0,
-                                   0, //n2_pucch
-                                   0, // shortened format
-                                   pucch_payload0,
-                                   subframe,
-                                   PUCCH1b_THRES);
-  p1[0] = pucch_payload0[0]; p1[1] = pucch_payload0[1];
+          if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round== phy_vars_eNB->ulsch_eNB[i]->Mlimit) {
+            LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d ULSCH Mlimit %d reached\n",
+                  phy_vars_eNB->Mod_id,harq_pid,
+                  frame,subframe, i,
+                  phy_vars_eNB->ulsch_eNB[i]->Mlimit);
 
-  n1_pucch0 = 31;
-  m2 = rx_pucch(phy_vars_eNB,
-                                   pucch_format1b_cs2,
-                                   i,
-                                   (uint16_t)n1_pucch0,
-                                   0, //n2_pucch
-                                   0, // shortened format
-                                   pucch_payload0,
-                                   subframe,
-                                   PUCCH1b_THRES);
-  p2[0] = pucch_payload0[0]; p2[1] = pucch_payload0[1];
-  printf("SR: m0/m1/m2 %d/%d/%d p0 %d%d p1 %d%d p2 %d%d\n",
-         m0, m1, m2, p0[0], p0[1], p1[0], p1[1], p2[0], p2[1]);
-}
-              n1_pucch0 = phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex;
-              if (abstraction_flag == 0)
-                metric0 = rx_pucch(phy_vars_eNB,
-                                   pucch_format1b_cs2,
-                                   i,
-                                   (uint16_t)n1_pucch0,
-                                   0, //n2_pucch
-                                   0, // shortened format
-                                   pucch_payload0,
-                                   subframe,
-                                   PUCCH1b_THRES);
-              else {
-#ifdef PHY_ABSTRACTION
-                metric0 = rx_pucch_emul(phy_vars_eNB,i,
-                                        pucch_format1b,
-                                        0,
-                                        pucch_payload0,
-                                        subframe);
-#endif
-              } // abstraction flag
-printf("pucch detect on SR (%d) payload %d %d\n", n1_pucch0, pucch_payload0[0], pucch_payload0[1]);
-            }
-            else { // No SR so use channel selection procedure
-printf("!!! n1_pucch0 %d n1_pucch1 %d n1_pucch2 %d n1_pucch3 %d\n", n1_pucch0, n1_pucch1, n1_pucch2, n1_pucch3);
-              if ((n1_pucch0 != -1) &&
-                  (n1_pucch1 != -1) &&
-                  (n1_pucch2 == -1) &&
-                  (n1_pucch3 == -1) )  { // A = 2 case
-
-                // call rx_pucch for two sequences
-                metric0 = rx_pucch(phy_vars_eNB,
-                                   pucch_format1b_cs2,
-                                   i,
-                                   (uint16_t)n1_pucch0,
-                                   0, //n2_pucch
-                                   0, // shortened format
-                                   &cs0,
-                                   subframe,
-                                   PUCCH1b_THRES);
-                metric1 = rx_pucch(phy_vars_eNB,
-                                   pucch_format1b_cs2,
-                                   i,
-                                   (uint16_t)n1_pucch1,
-                                   0, //n2_pucch
-                                   0, // shortened format
-                                   &cs1,
-                                   subframe,
-                                   PUCCH1b_THRES);
-                // This is Table 10.1.2.2.1-3 from 36.213
-                if (metric0>metric1) {
-                  pucch_payload0[0] = cs0;
-                  pucch_payload0[1] = 0;   // NACK/DTX
-                }
-                else {
-                  pucch_payload0[0] = cs1;
-                  pucch_payload0[1] = 1;   // ACK
-                }
-printf("pucch detect on pucch %d payload %d %d (metric %d/%d)\n", metric0 > metric1 ? n1_pucch0 : n1_pucch1, pucch_payload0[0], pucch_payload0[1], metric0, metric1);
-              }
-              else if ((n1_pucch2 != -1) &&
-                       (n1_pucch3 == -1) ) { //A = 3 case
-              }
-              else if (n1_pucch3 != -1) {
+            phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round=0;
+            phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active=0;
+            phy_vars_eNB->eNB_UE_stats[i].ulsch_errors[harq_pid]++;
+            phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors++;
 
-              }
-              else {
-                AssertFatal(0, "Impossible HARQ channel selection condition n1_pucch (%d,%d,%d,%d)",n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3);
-              }
-            }
-#endif
-/* REPLACEMENT CODE STARTS HERE */
-            if ((n1_pucch0 != -1) &&
-                (n1_pucch1 != -1) &&
-                (n1_pucch2 == -1) &&
-                (n1_pucch3 == -1) )  { // A = 2 case
-              if (do_SR == 1)
-                metric0 = rx_pucch(phy_vars_eNB,
-                                   pucch_format1b,
-                                   i,
-                                   phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex,
-                                   0, //n2_pucch
-                                   0, // shortened format
-                                   pucch_payload0,
-                                   subframe,
-                                   PUCCH1b_THRES);
-              metric1 = rx_pucch(phy_vars_eNB,
-                                 pucch_format1b_cs2,
-                                 i,
-                                 (uint16_t)n1_pucch0,
-                                 0, //n2_pucch
-                                 0, // shortened format
-                                 &cs0,
-                                 subframe,
-                                 PUCCH1b_THRES);
-              metric2 = rx_pucch(phy_vars_eNB,
-                                 pucch_format1b_cs2,
-                                 i,
-                                 (uint16_t)n1_pucch1,
-                                 0, //n2_pucch
-                                 0, // shortened format
-                                 &cs1,
-                                 subframe,
-                                 PUCCH1b_THRES);
-printf("SR: do_SR %d (n1 %d/%d/%d) m0/m1/m2 %d/%d/%d p0 %d%d cs0 %d cs1 %d\n",
-       do_SR, phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex, n1_pucch0, n1_pucch1, metric0, metric1, metric2, pucch_payload0[0], pucch_payload0[1], cs0, cs1);
-              if (do_SR == 1 && metric0 > metric1 && metric0 > metric2) {
-                SR_payload = 1;
-              } else if (metric1 > metric2) {
-                pucch_payload0[0] = cs0;
-                pucch_payload0[1] = 0;   // NACK/DTX
-              } else {
-                pucch_payload0[0] = cs1;
-                pucch_payload0[1] = 1;   // ACK
-              }
-            } else if ((n1_pucch2 != -1) &&
-                       (n1_pucch3 == -1) ) { //A = 3 case
-              AssertFatal(0, "case A=3 TODO");
-            } else if (n1_pucch3 != -1) {
-              AssertFatal(0, "case A=4 TODO");
-            } else {
-              AssertFatal(0, "Impossible HARQ channel selection condition n1_pucch (%d,%d,%d,%d)",n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3);
-            }
-/* REPLACEMENT CODE ENDS HERE */
+	    // indicate error to MAC
+	    mac_xface->rx_sdu(phy_vars_eNB->Mod_id,
+			      phy_vars_eNB->CC_id,
+			      frame,subframe,
+			      phy_vars_eNB->ulsch_eNB[i]->rnti,
+			      NULL,
+			      0,
+			      harq_pid,
+			      &phy_vars_eNB->ulsch_eNB[i]->Msg3_flag);
           }
-#endif /* Rel10 */
-#ifdef DEBUG_PHY_PROC
-          LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d pucch1a (FDD) payload %d (metric %d)\n",
-                phy_vars_eNB->Mod_id,
-                phy_vars_eNB->dlsch_eNB[i][0]->rnti,
-                frame,subframe,
-                pucch_payload0[0],metric0);
+        }
+      }  // ulsch in error
+      else {
+        T(T_ENB_PHY_ULSCH_UE_ACK, T_INT(phy_vars_eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(i), T_INT(phy_vars_eNB->ulsch_eNB[i]->rnti),
+          T_INT(harq_pid));
+
+        if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1) {
+	  LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d ULSCH received, setting round to 0, PHICH ACK\n",
+		phy_vars_eNB->Mod_id,harq_pid,
+		frame,subframe);
+	  LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) RSSI (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d\n",
+		phy_vars_eNB->Mod_id,harq_pid,
+		frame,subframe,
+		phy_vars_eNB->ulsch_eNB[i]->rnti,
+		dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[0]),
+		dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[1]),
+		phy_vars_eNB->eNB_UE_stats[i].UL_rssi[0],
+		phy_vars_eNB->eNB_UE_stats[i].UL_rssi[1],
+		phy_vars_eNB->PHY_measurements_eNB->n0_power_dB[0],
+		phy_vars_eNB->PHY_measurements_eNB->n0_power_dB[1],
+		phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[0],
+		phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[1],
+		ret);
+	}
+#if defined(MESSAGE_CHART_GENERATOR_PHY)
+        MSC_LOG_RX_MESSAGE(
+          MSC_PHY_ENB,MSC_PHY_UE,
+          NULL,0,
+          "%05u:%02u ULSCH received rnti %x harq id %u",
+          frame,subframe,
+          phy_vars_eNB->ulsch_eNB[i]->rnti,harq_pid
+          );
 #endif
+        for (j=0; j<phy_vars_eNB->lte_frame_parms.nb_antennas_rx; j++)
+          //this is the RSSI per RB
+          phy_vars_eNB->eNB_UE_stats[i].UL_rssi[j] =
+	    
+            dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[i]->ulsch_power[j]*
+                     (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb*12)/
+                     phy_vars_eNB->lte_frame_parms.ofdm_symbol_size) -
+            phy_vars_eNB->rx_total_gain_eNB_dB -
+            hundred_times_log10_NPRB[phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb-1]/100 -
+            get_hundred_times_delta_IF_eNB(phy_vars_eNB,i,harq_pid, 0)/100;
+	    
+        phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active = 1;
+        phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_ACK = 1;
+        phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round = 0;
+        phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors = 0;
 
-          process_HARQ_feedback(i,sched_subframe,phy_vars_eNB,
-                                0,// pusch_flag
-                                pucch_payload0,
-                                2,
-                                SR_payload);
-        } // FDD
-        else {  //TDD
+        if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1) {
+	  if (phy_vars_eNB->mac_enabled==1) {
+
+	    LOG_I(PHY,"[eNB %d][RAPROC] Frame %d Terminating ra_proc for harq %d, UE %d\n",
+		  phy_vars_eNB->Mod_id,
+		  frame,harq_pid,i);
+	    
+	    mac_xface->rx_sdu(phy_vars_eNB->Mod_id,
+			      phy_vars_eNB->CC_id,
+			      frame,subframe,
+			      phy_vars_eNB->ulsch_eNB[i]->rnti,
+			      phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b,
+			      phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3,
+			      harq_pid,
+			      &phy_vars_eNB->ulsch_eNB[i]->Msg3_flag);
+	    
+	    // one-shot msg3 detection by MAC: empty PDU (e.g. CRNTI)
+	    if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 0 ) {
+	      phy_vars_eNB->eNB_UE_stats[i].mode = PRACH;
+	      mac_xface->cancel_ra_proc(phy_vars_eNB->Mod_id,
+					phy_vars_eNB->CC_id,
+					frame,
+					phy_vars_eNB->eNB_UE_stats[i].crnti);
+	      mac_phy_remove_ue(phy_vars_eNB->Mod_id,phy_vars_eNB->eNB_UE_stats[i].crnti);
+	      phy_vars_eNB->ulsch_eNB[(uint32_t)i]->Msg3_active = 0;
+	    } // Msg3_flag == 0
+	    
+	  } // mac_enabled==1
 
-          bundling_flag = phy_vars_eNB->pucch_config_dedicated[i].tdd_AckNackFeedbackMode;
+          phy_vars_eNB->eNB_UE_stats[i].mode = PUSCH;
+          phy_vars_eNB->ulsch_eNB[i]->Msg3_flag = 0;
 
-          // fix later for 2 TB case and format1b
+	  LOG_D(PHY,"[eNB %d][RAPROC] Frame %d : RX Subframe %d Setting UE %d mode to PUSCH\n",phy_vars_eNB->Mod_id,frame,subframe,i);
 
-          if ((frame_parms->frame_type==FDD) ||
-              (bundling_flag==bundling)    ||
-              ((frame_parms->frame_type==TDD)&&(frame_parms->tdd_config==1)&&((subframe!=2)||(subframe!=7)))) {
-            format = pucch_format1a;
-            //      msg("PUCCH 1a\n");
-          } else {
-            format = pucch_format1b;
-            //      msg("PUCCH 1b\n");
-          }
+          for (k=0; k<8; k++) { //harq_processes
+            for (j=0; j<phy_vars_eNB->dlsch_eNB[i][0]->Mlimit; j++) {
+              phy_vars_eNB->eNB_UE_stats[i].dlsch_NAK[k][j]=0;
+              phy_vars_eNB->eNB_UE_stats[i].dlsch_ACK[k][j]=0;
+              phy_vars_eNB->eNB_UE_stats[i].dlsch_trials[k][j]=0;
+            }
 
-          // if SR was detected, use the n1_pucch from SR
-          if (SR_payload==1) {
-#ifdef DEBUG_PHY_PROC
-            LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d Checking ACK/NAK (%d,%d,%d,%d) format %d with SR\n",phy_vars_eNB->Mod_id,
-                  phy_vars_eNB->dlsch_eNB[i][0]->rnti,
-                  frame,subframe,
-                  n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,format);
-#endif
+            phy_vars_eNB->eNB_UE_stats[i].dlsch_l2_errors[k]=0;
+            phy_vars_eNB->eNB_UE_stats[i].ulsch_errors[k]=0;
+            phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors=0;
 
-            if (abstraction_flag == 0)
-              metric0 = rx_pucch(phy_vars_eNB,
-                                 format,
-                                 i,
-                                 phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex,
-                                 0, //n2_pucch
-                                 1, // shortened format
-                                 pucch_payload0,
-                                 subframe,
-                                 PUCCH1a_THRES);
-            else {
-#ifdef PHY_ABSTRACTION
-              metric0 = rx_pucch_emul(phy_vars_eNB,i,
-                                      format,
-                                      0,
-                                      pucch_payload0,
-                                      subframe);
-#endif
+            for (j=0; j<phy_vars_eNB->ulsch_eNB[i]->Mlimit; j++) {
+              phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts[k][j]=0;
+              phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts_last[k][j]=0;
+              phy_vars_eNB->eNB_UE_stats[i].ulsch_round_errors[k][j]=0;
+              phy_vars_eNB->eNB_UE_stats[i].ulsch_round_fer[k][j]=0;
             }
-          } else { //using n1_pucch0/n1_pucch1 resources
+          }
+
+          phy_vars_eNB->eNB_UE_stats[i].dlsch_sliding_cnt=0;
+          phy_vars_eNB->eNB_UE_stats[i].dlsch_NAK_round0=0;
+          phy_vars_eNB->eNB_UE_stats[i].dlsch_mcs_offset=0;
+        } // Msg3_flag==1
+	else {  // Msg3_flag == 0
+
 #ifdef DEBUG_PHY_PROC
-            LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d Checking ACK/NAK (%d,%d,%d,%d) format %d\n",phy_vars_eNB->Mod_id,
-                  phy_vars_eNB->dlsch_eNB[i][0]->rnti,
-                  frame,subframe,
-                  n1_pucch0,n1_pucch1,n1_pucch2,n1_pucch3,format);
+#ifdef DEBUG_ULSCH
+          LOG_D(PHY,"[eNB] Frame %d, Subframe %d : ULSCH SDU (RX harq_pid %d) %d bytes:",frame,subframe,
+                harq_pid,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3);
+
+          for (j=0; j<phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3; j++)
+            LOG_T(PHY,"%x.",phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b[j]);
+
+          LOG_T(PHY,"\n");
 #endif
-            metric0=0;
-            metric1=0;
-
-            // Check n1_pucch0 metric
-            if (n1_pucch0 != -1) {
-              if (abstraction_flag == 0)
-                metric0 = rx_pucch(phy_vars_eNB,
-                                   format,
-                                   i,
-                                   (uint16_t)n1_pucch0,
-                                   0, // n2_pucch
-                                   1, // shortened format
-                                   pucch_payload0,
-                                   subframe,
-                                   PUCCH1a_THRES);
-              else {
-#ifdef PHY_ABSTRACTION
-                metric0 = rx_pucch_emul(phy_vars_eNB,i,
-                                        format,
-                                        0,
-                                        pucch_payload0,
-                                        subframe);
 #endif
-              }
-            }
 
-            // Check n1_pucch1 metric
-            if (n1_pucch1 != -1) {
-              if (abstraction_flag == 0)
-                metric1 = rx_pucch(phy_vars_eNB,
-                                   format,
-                                   i,
-                                   (uint16_t)n1_pucch1,
-                                   0, //n2_pucch
-                                   1, // shortened format
-                                   pucch_payload1,
-                                   subframe,
-                                   PUCCH1a_THRES);
-              else {
-#ifdef PHY_ABSTRACTION
-                metric1 = rx_pucch_emul(phy_vars_eNB,i,
-                                        format,
-                                        1,
-                                        pucch_payload1,
-                                        subframe);
+	  if (phy_vars_eNB->mac_enabled==1) {
+
+	    mac_xface->rx_sdu(phy_vars_eNB->Mod_id,
+			      phy_vars_eNB->CC_id,
+			      frame,subframe,
+			      phy_vars_eNB->ulsch_eNB[i]->rnti,
+			      phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b,
+			      phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3,
+			      harq_pid,
+			      NULL);
 
+#ifdef LOCALIZATION
+	    start_meas(&phy_vars_eNB->localization_stats);
+	    aggregate_eNB_UE_localization_stats(phy_vars_eNB,
+						i,
+						frame,
+						subframe,
+						get_hundred_times_delta_IF_eNB(phy_vars_eNB,i,harq_pid, 1)/100);
+	    stop_meas(&phy_vars_eNB->localization_stats);
+#endif
+	    
+	  } // mac_enabled==1
+        } // Msg3_flag == 0
+
+        // estimate timing advance for MAC
+        if (abstraction_flag == 0) {
+          sync_pos = lte_est_timing_advance_pusch(phy_vars_eNB,i,sched_subframe);
+          phy_vars_eNB->eNB_UE_stats[i].timing_advance_update = sync_pos - phy_vars_eNB->lte_frame_parms.nb_prefix_samples/4; //to check
+        }
 
+#ifdef DEBUG_PHY_PROC
+        LOG_D(PHY,"[eNB %d] frame %d, subframe %d: user %d: timing advance = %d\n",
+              phy_vars_eNB->Mod_id,
+              frame, subframe,
+              i,
+              phy_vars_eNB->eNB_UE_stats[i].timing_advance_update);
 #endif
-              }
-            }
-          }
 
-          if (SR_payload == 1) {
-            pucch_payload = pucch_payload0;
 
-            if (bundling_flag == bundling)
-              pucch_sel = 2;
-          } else if (bundling_flag == multiplexing) { // multiplexing + no SR
-            pucch_payload = (metric1>metric0) ? pucch_payload1 : pucch_payload0;
-            pucch_sel     = (metric1>metric0) ? 1 : 0;
-          } else { // bundling + no SR
-            if (n1_pucch1 != -1)
-              pucch_payload = pucch_payload1;
-            else if (n1_pucch0 != -1)
-              pucch_payload = pucch_payload0;
-
-            pucch_sel = 2;  // indicate that this is a bundled ACK/NAK
-          }
+      }  // ulsch not in error
 
+      // process HARQ feedback
 #ifdef DEBUG_PHY_PROC
-          LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d ACK/NAK metric 0 %d, metric 1 %d, sel %d, (%d,%d)\n",phy_vars_eNB->Mod_id,
-                phy_vars_eNB->dlsch_eNB[i][0]->rnti,
-                frame,subframe,
-                metric0,metric1,pucch_sel,pucch_payload[0],pucch_payload[1]);
+      LOG_D(PHY,"[eNB %d][PDSCH %x] Frame %d subframe %d, Processing HARQ feedback for UE %d (after PUSCH)\n",phy_vars_eNB->Mod_id,
+            phy_vars_eNB->dlsch_eNB[i][0]->rnti,
+            frame,subframe,
+            i);
 #endif
-          process_HARQ_feedback(i,sched_subframe,phy_vars_eNB,
-                                0,// pusch_flag
-                                pucch_payload,
-                                pucch_sel,
-                                SR_payload);
-        }
-      }
-
-      if (SR_payload == 1) {
-        LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Got SR for PUSCH, transmitting to MAC\n",phy_vars_eNB->Mod_id,
-              phy_vars_eNB->ulsch_eNB[i]->rnti,frame,subframe);
-        phy_vars_eNB->eNB_UE_stats[i].sr_received++;
-
-        if (phy_vars_eNB->first_sr[i] == 1) { // this is the first request for uplink after Connection Setup, so clear HARQ process 0 use for Msg4
-          /* is this test necessary? */
-          if (phy_vars_eNB->dlsch_eNB[i][0]->harq_processes[0]->status != SCH_IDLE)
-            put_harq_pid_in_freelist(phy_vars_eNB->dlsch_eNB[i][0], 0);
-          phy_vars_eNB->first_sr[i] = 0;
-          phy_vars_eNB->dlsch_eNB[i][0]->harq_processes[0]->round=0;
-          phy_vars_eNB->dlsch_eNB[i][0]->harq_processes[0]->status=SCH_IDLE;
-          LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d First SR\n",
-                phy_vars_eNB->Mod_id,
-                phy_vars_eNB->ulsch_eNB[i]->rnti,frame,subframe);
-        }
+      process_HARQ_feedback(i,
+                            sched_subframe,
+                            phy_vars_eNB,
+                            1, // pusch_flag
+                            0,
+                            0,
+                            0);
 
-#ifdef OPENAIR2
-        mac_xface->SR_indication(phy_vars_eNB->Mod_id,
-                                 phy_vars_eNB->CC_id,
-                                 frame,
-                                 phy_vars_eNB->dlsch_eNB[i][0]->rnti,subframe);
+#ifdef DEBUG_PHY_PROC
+      LOG_D(PHY,"[eNB %d] Frame %d subframe %d, sect %d: received ULSCH harq_pid %d for UE %d, ret = %d, CQI CRC Status %d, ACK %d,%d, ulsch_errors %d/%d\n",
+            phy_vars_eNB->Mod_id,frame,subframe,
+            phy_vars_eNB->eNB_UE_stats[i].sector,
+            harq_pid,
+            i,
+            ret,
+            phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->cqi_crc_status,
+            phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[0],
+            phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_ACK[1],
+            phy_vars_eNB->eNB_UE_stats[i].ulsch_errors[harq_pid],
+            phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts[harq_pid][0]);
 #endif
+      
+      // dump stats to VCD
+      if (i==0) {
+	VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS0+harq_pid,phy_vars_eNB->pusch_stats_mcs[0][(frame*10)+subframe]);
+	VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB0+harq_pid,phy_vars_eNB->pusch_stats_rb[0][(frame*10)+subframe]);
+	VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND0+harq_pid,phy_vars_eNB->pusch_stats_round[0][(frame*10)+subframe]);
+	VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI0+harq_pid,dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[0]->ulsch_power[0]));
+	VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES0+harq_pid,ret);
+	VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN0+harq_pid,(frame*10)+subframe);
       }
-    } // PUCCH processing
+    } // ulsch_eNB[0] && ulsch_eNB[0]->rnti>0 && ulsch_eNB[0]->subframe_scheduling_flag == 1
 
-#endif //PUCCH
 
+    // update ULSCH statistics for tracing
     if ((frame % 100 == 0) && (subframe == 4)) {
       for (harq_idx=0; harq_idx<8; harq_idx++) {
-        for (round=0; round<phy_vars_eNB->ulsch_eNB[i]->Mdlharq; round++) {
+        for (round=0; round<phy_vars_eNB->ulsch_eNB[i]->Mlimit; round++) {
           if ((phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts[harq_idx][round] -
                phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts_last[harq_idx][round]) != 0) {
             phy_vars_eNB->eNB_UE_stats[i].ulsch_round_fer[harq_idx][round] =
@@ -4831,192 +3885,28 @@ printf("SR: do_SR %d (n1 %d/%d/%d) m0/m1/m2 %d/%d/%d p0 %d%d cs0 %d cs1 %d\n",
       phy_vars_eNB->eNB_UE_stats[i].total_TBS_last = phy_vars_eNB->eNB_UE_stats[i].total_TBS;
     }
 
-    num_active_cba_groups = phy_vars_eNB->ulsch_eNB[i]->num_active_cba_groups;
-
-    /*if (num_active_cba_groups > 0 )
-      LOG_D(PHY,"[eNB] last slot %d trying cba transmission decoding UE %d num_grps %d rnti %x flag %d\n",
-      last_slot, i, num_active_cba_groups,phy_vars_eNB->ulsch_eNB[i]->cba_rnti[i%num_active_cba_groups],
-      phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->subframe_cba_scheduling_flag );
-    */
-    if ((phy_vars_eNB->ulsch_eNB[i]) &&
-        (num_active_cba_groups > 0) &&
-        (phy_vars_eNB->ulsch_eNB[i]->cba_rnti[i%num_active_cba_groups]>0) &&
-        (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->subframe_cba_scheduling_flag==1)) {
-      rnti=0;
-
-#ifdef DEBUG_PHY_PROC
-      LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d Checking PUSCH/ULSCH CBA Reception for UE %d with cba rnti %x mode %s\n",
-            phy_vars_eNB->Mod_id,harq_pid,
-            frame,subframe,
-            i, (uint16_t)phy_vars_eNB->ulsch_eNB[i]->cba_rnti[i%num_active_cba_groups],mode_string[phy_vars_eNB->eNB_UE_stats[i].mode]);
-#endif
-
-//printf("**** fr/subfr %d %d call rx_ulsch (2nd) CC %d\n", frame, subframe, phy_vars_eNB->CC_id);
-      if (abstraction_flag==0) {
-        rx_ulsch(phy_vars_eNB,
-                 sched_subframe,
-                 phy_vars_eNB->eNB_UE_stats[i].sector,  // this is the effective sector id
-                 i,
-                 phy_vars_eNB->ulsch_eNB,
-                 0);
-      }
-
-#ifdef PHY_ABSTRACTION
-      else {
-        rx_ulsch_emul(phy_vars_eNB,
-                      subframe,
-                      phy_vars_eNB->eNB_UE_stats[i].sector,  // this is the effective sector id
-                      i);
-      }
-
-#endif
-
-      if (abstraction_flag == 0) {
-        ret = ulsch_decoding(phy_vars_eNB,
-                             i,
-                             sched_subframe,
-                             0, // control_only_flag
-                             phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->V_UL_DAI,
-                             0);
-      }
-
-#ifdef PHY_ABSTRACTION
-      else {
-        ret = ulsch_decoding_emul(phy_vars_eNB,
-                                  sched_subframe,
-                                  i,
-                                  &rnti);
-      }
-
-#endif
-
-      if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->cqi_crc_status == 1) {
-#ifdef DEBUG_PHY_PROC
-        //if (((phy_vars_eNB->proc[sched_subframe].frame_tx%10) == 0) || (phy_vars_eNB->proc[sched_subframe].frame_tx < 50))
-        print_CQI(phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->uci_format,0,phy_vars_eNB->lte_frame_parms.N_RB_DL);
-#endif
-        access_mode = UNKNOWN_ACCESS;
-        extract_CQI(phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o,
-                    phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->uci_format,
-                    &phy_vars_eNB->eNB_UE_stats[i],
-                    phy_vars_eNB->lte_frame_parms.N_RB_DL,
-                    &rnti, &access_mode,
-                    /* TODO more than one CC for this case? */
-                    1);
-        phy_vars_eNB->eNB_UE_stats[i].rank = phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->o_RI[0];
-      }
-
-      /*  LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d harq_pid %d resetting the sched_subframeuling_flag, total cba groups %d %d\n",
-      phy_vars_eNB->Mod_id,harq_pid,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,i,harq_pid,
-      phy_vars_eNB->ulsch_eNB[i]->num_active_cba_groups,num_active_cba_groups);
-      */
-      phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->subframe_cba_scheduling_flag=0;
-      phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->status= SCH_IDLE;
-
-      if ((num_active_cba_groups > 0) &&
-          //  (i % num_active_cba_groups == 0) && // this ue is used a a template for the CBA
-          (i + num_active_cba_groups < NUMBER_OF_UE_MAX) &&
-          (phy_vars_eNB->ulsch_eNB[i+num_active_cba_groups]->cba_rnti[i%num_active_cba_groups] > 0 ) &&
-          (phy_vars_eNB->ulsch_eNB[i+num_active_cba_groups]->num_active_cba_groups> 0)) {
-#ifdef DEBUG_PHY_PROC
-        LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d harq_pid %d resetting the subframe_scheduling_flag for Ue %d cba groups %d members\n",
-              phy_vars_eNB->Mod_id,harq_pid,frame,subframe,i,harq_pid,
-              i+num_active_cba_groups, i%phy_vars_eNB->ulsch_eNB[i]->num_active_cba_groups);
-#endif
-        phy_vars_eNB->ulsch_eNB[i+num_active_cba_groups]->harq_processes[harq_pid]->subframe_cba_scheduling_flag=1;
-        phy_vars_eNB->ulsch_eNB[i+num_active_cba_groups]->harq_processes[harq_pid]->status= CBA_ACTIVE;
-        phy_vars_eNB->ulsch_eNB[i+num_active_cba_groups]->harq_processes[harq_pid]->TBS=phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS;
-      }
-
-      if (ret == (1+MAX_TURBO_ITERATIONS)) {
-        phy_vars_eNB->eNB_UE_stats[i].ulsch_round_errors[harq_pid][phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round]++;
-        phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active = 1;
-        phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_ACK = 0;
-        phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round++;
-      } // ulsch in error
-      else {
-        LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d ULSCH received, setting round to 0, PHICH ACK\n",
-              phy_vars_eNB->Mod_id,harq_pid,
-              frame,subframe);
-
-        phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active = 1;
-        phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_ACK = 1;
-        phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round = 0;
-        phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors = 0;
-#ifdef DEBUG_PHY_PROC
-#ifdef DEBUG_ULSCH
-        LOG_D(PHY,"[eNB] Frame %d, Subframe %d : ULSCH SDU (RX harq_pid %d) %d bytes:",
-              frame,subframe,
-              harq_pid,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3);
-
-        for (j=0; j<phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3; j++)
-          LOG_T(PHY,"%x.",phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b[j]);
-
-        LOG_T(PHY,"\n");
-#endif
-#endif
-
-        if (access_mode > UNKNOWN_ACCESS) {
-          LOG_D(PHY,"[eNB %d] Frame %d, Subframe %d : received ULSCH SDU from CBA transmission, UE (%d,%x), CBA (group %d, rnti %x)\n",
-                phy_vars_eNB->Mod_id, frame,subframe,
-                i, phy_vars_eNB->ulsch_eNB[i]->rnti,
-                i % phy_vars_eNB->ulsch_eNB[i]->num_active_cba_groups, phy_vars_eNB->ulsch_eNB[i]->cba_rnti[i%num_active_cba_groups]);
-
-          // detect if there is a CBA collision
-          if (phy_vars_eNB->cba_last_reception[i%num_active_cba_groups] == 0 ) {
-            mac_xface->rx_sdu(phy_vars_eNB->Mod_id,
-                              phy_vars_eNB->CC_id,
-                              frame,subframe,
-                              phy_vars_eNB->ulsch_eNB[i]->rnti,
-                              phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->b,
-                              phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3,
-                              harq_pid,
-                              NULL);
-
-            phy_vars_eNB->cba_last_reception[i%num_active_cba_groups]+=1;//(subframe);
-          } else {
-            if (phy_vars_eNB->cba_last_reception[i%num_active_cba_groups] == 1 )
-              LOG_N(PHY,"[eNB%d] Frame %d subframe %d : first CBA collision detected \n ",
-                    phy_vars_eNB->Mod_id,frame,subframe);
-
-            LOG_N(PHY,"[eNB%d] Frame %d subframe %d : CBA collision set SR for UE %d in group %d \n ",
-                  phy_vars_eNB->Mod_id,frame,subframe,
-                  phy_vars_eNB->cba_last_reception[i%num_active_cba_groups],i%num_active_cba_groups );
-
-            phy_vars_eNB->cba_last_reception[i%num_active_cba_groups]+=1;
-
-            mac_xface->SR_indication(phy_vars_eNB->Mod_id,
-                                     phy_vars_eNB->CC_id,
-                                     frame,
-                                     phy_vars_eNB->dlsch_eNB[i][0]->rnti,subframe);
-          }
-        }
-      } // ULSCH CBA not in error
-    }
-
+    // CBA (non-LTE)
+    cba_procedures(sched_subframe,phy_vars_eNB,i,harq_pid,abstraction_flag);
   } // loop i=0 ... NUMBER_OF_UE_MAX-1
 
-  if (pusch_active == 0) {
-    if (abstraction_flag == 0) {
-      //      LOG_D(PHY,"[eNB] Frame %d, subframe %d Doing I0_measurements\n",
-      //    (((subframe)==9)?-1:0) + phy_vars_eNB->proc[sched_subframe].frame_tx,subframe);
-      lte_eNB_I0_measurements(phy_vars_eNB,
-                              0,
-                              phy_vars_eNB->first_run_I0_measurements);
-    }
+  if (abstraction_flag == 0) {
+    lte_eNB_I0_measurements(phy_vars_eNB,
+			    subframe,
+			    0,
+			    phy_vars_eNB->first_run_I0_measurements);
+    phy_vars_eNB->first_run_I0_measurements = 0;
+  }
 
 #ifdef PHY_ABSTRACTION
     else {
       lte_eNB_I0_measurements_emul(phy_vars_eNB,
-                                   sect_id);
+                                   0);
     }
 
 #endif
 
 
-    if (I0_clear == 1)
-      I0_clear = 0;
-  }
+    //}
 
 #ifdef EMOS
   phy_procedures_emos_eNB_RX(subframe,phy_vars_eNB);
@@ -5255,11 +4145,11 @@ void phy_procedures_eNB_lte(unsigned char subframe,PHY_VARS_eNB **phy_vars_eNB,u
     phy_vars_eNB[CC_id]->proc[subframe].frame_tx++;
     phy_vars_eNB[CC_id]->proc[subframe].frame_rx++;
 
-    if (phy_vars_eNB[CC_id]->proc[subframe].frame_tx==MAX_FRAME_NUMBER) // defined in impl_defs_top.h
-      phy_vars_eNB[CC_id]->proc[subframe].frame_tx=0;
+    if (phy_vars_eNB[CC_id]->proc[subframe].frame_tx>=MAX_FRAME_NUMBER) // defined in impl_defs_top.h
+      phy_vars_eNB[CC_id]->proc[subframe].frame_tx-=MAX_FRAME_NUMBER;
 
-    if (phy_vars_eNB[CC_id]->proc[subframe].frame_rx==MAX_FRAME_NUMBER)
-      phy_vars_eNB[CC_id]->proc[subframe].frame_rx=0;
+    if (phy_vars_eNB[CC_id]->proc[subframe].frame_rx>=MAX_FRAME_NUMBER)
+      phy_vars_eNB[CC_id]->proc[subframe].frame_rx-=MAX_FRAME_NUMBER;
   }
 
   VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_LTE,0);
diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c
index 7dcd71ce472b982b823b5f91751e17063f5850a6..ac09ac77b395a9e20b0f2ff421958c38ef31a3c8 100755
--- a/openair1/SCHED/phy_procedures_lte_ue.c
+++ b/openair1/SCHED/phy_procedures_lte_ue.c
@@ -42,8 +42,6 @@
 #include "defs.h"
 #include "PHY/defs.h"
 #include "PHY/extern.h"
-#include "MAC_INTERFACE/defs.h"
-#include "MAC_INTERFACE/extern.h"
 #include "SCHED/defs.h"
 #include "SCHED/extern.h"
 
@@ -59,20 +57,15 @@ extern int card;
 #endif
 #endif
 
-//#define DEBUG_PHY_PROC
-#define UE_TX_POWER (-10)
+#define DEBUG_PHY_PROC
 
-//#ifdef OPENAIR2
 #ifndef PUCCH
 #define PUCCH
 #endif
-//#endif
 
-//#ifdef OPENAIR2
 #include "LAYER2/MAC/extern.h"
 #include "LAYER2/MAC/defs.h"
 #include "UTIL/LOG/log.h"
-//#endif
 
 #ifdef EMOS
 fifo_dump_emos_UE emos_dump_UE;
@@ -87,9 +80,6 @@ fifo_dump_emos_UE emos_dump_UE;
 #   endif
 #endif
 
-#ifndef OPENAIR2
-//#define DIAG_PHY
-#endif
 
 #define DLSCH_RB_ALLOC 0x1fbf  // skip DC RB (total 23/25 RBs)
 #define DLSCH_RB_ALLOC_12 0x0aaa  // skip DC RB (total 23/25 RBs)
@@ -121,7 +111,7 @@ extern int rx_sig_fifo;
 #endif
 
 
-#if defined(EXMIMO) || defined(OAI_USRP)
+#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
 extern uint32_t downlink_frequency[MAX_NUM_CCs][4];
 #endif
 
@@ -168,7 +158,7 @@ void dump_dlsch_SI(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe)
                                   1,
                                   phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->num_pdcch_symbols,
                                   phy_vars_ue->frame_rx,subframe);
-  LOG_I(PHY,"[UE %d] Dumping dlsch_SI : ofdm_symbol_size %d, nsymb %d, nb_rb %d, mcs %d, nb_rb %d, num_pdcch_symbols %d,G %d\n",
+  LOG_D(PHY,"[UE %d] Dumping dlsch_SI : ofdm_symbol_size %d, nsymb %d, nb_rb %d, mcs %d, nb_rb %d, num_pdcch_symbols %d,G %d\n",
         phy_vars_ue->Mod_id,
 	phy_vars_ue->lte_frame_parms.ofdm_symbol_size,
 	nsymb,
@@ -197,7 +187,7 @@ void dump_dlsch_SI(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t subframe)
   exit(-1);
 }
 
-#if defined(EXMIMO) || defined(OAI_USRP)
+#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
 //unsigned int gain_table[31] = {100,112,126,141,158,178,200,224,251,282,316,359,398,447,501,562,631,708,794,891,1000,1122,1258,1412,1585,1778,1995,2239,2512,2818,3162};
 /*
 unsigned int get_tx_amp_prach(int power_dBm, int power_max_dBm, int N_RB_UL)
@@ -454,7 +444,7 @@ uint16_t get_n1_pucch(PHY_VARS_UE *phy_vars_ue,
 
   if (frame_parms->frame_type == FDD ) { // FDD
     sf = (subframe<4)? subframe+6 : subframe-4;
-    printf("n1_pucch_UE: subframe %d, nCCE %d\n",sf,phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->nCCE[sf]);
+    LOG_D(PHY,"n1_pucch_UE: subframe %d, nCCE %d\n",sf,phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->nCCE[sf]);
 
     if (SR == 0)
       return(frame_parms->pucch_config_common.n1PUCCH_AN + phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->nCCE[sf]);
@@ -642,16 +632,12 @@ void phy_procedures_emos_UE_TX(uint8_t next_slot,uint8_t eNB_id) {
 #endif
 
 int dummy_tx_buffer[3840*4] __attribute__((aligned(16)));
-#ifndef OPENAIR2
 PRACH_RESOURCES_t prach_resources_local;
-#endif
 
 void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode,relaying_type_t r_type)
 {
 
-#ifndef OPENAIR2
   int i;
-#endif
   uint16_t first_rb, nb_rb;
   uint8_t harq_pid;
   unsigned int input_buffer_length;
@@ -669,7 +655,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
   uint8_t ack_status=0;
   int8_t Po_PUCCH;
   int32_t ulsch_start=0;
-#if defined(EXMIMO) || defined(OAI_USRP)
+#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
   int overflow=0;
   int k,l;
 #endif
@@ -724,8 +710,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
                                    subframe_tx);
 
 
-#ifdef OPENAIR2
-
+      if (phy_vars_ue->mac_enabled == 1) {
       if ((phy_vars_ue->ulsch_ue_Msg3_active[eNB_id] == 1) &&
           (phy_vars_ue->ulsch_ue_Msg3_frame[eNB_id] == frame_tx) &&
           (phy_vars_ue->ulsch_ue_Msg3_subframe[eNB_id] == subframe_tx)) { // Initial Transmission of Msg3
@@ -756,8 +741,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
 
         Msg3_flag=0;
       }
-
-#endif
+      }
 
       if (phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag == 1) {
 
@@ -856,19 +840,17 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
 #endif
           stop_meas(&phy_vars_ue->ulsch_encoding_stats);
 
-
-#ifdef OPENAIR2
-          // signal MAC that Msg3 was sent
-          mac_xface->Msg3_transmitted(Mod_id,
-                                      CC_id,
-                                      frame_tx,
-                                      eNB_id);
-#endif
+	  if (phy_vars_ue->mac_enabled == 1) {
+	    // signal MAC that Msg3 was sent
+	    mac_xface->Msg3_transmitted(Mod_id,
+					CC_id,
+					frame_tx,
+					eNB_id);
+	  }
         } else {
           input_buffer_length = phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->TBS/8;
 
-#ifdef OPENAIR2
-
+	  if (phy_vars_ue->mac_enabled==1) {
           //  LOG_D(PHY,"[UE  %d] ULSCH : Searching for MAC SDUs\n",Mod_id);
           if (phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->round==0) {
             //if (phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->calibration_flag == 0) {
@@ -905,7 +887,8 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
           LOG_T(PHY,"\n");
 #endif
 #endif
-#else //OPENAIR2
+	}
+	  else {
           // the following lines were necessary for the calibration in CROWN
           /*
           if (phy_vars_ue->ulsch_ue[eNB_id]->harq_processes[harq_pid]->calibration_flag == 0) {
@@ -917,6 +900,8 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
           }
           */
 
+          unsigned int taus(void);
+
           for (i=0; i<input_buffer_length; i++)
             ulsch_input_buffer[i]= (uint8_t)(taus()&0xff);
 
@@ -928,8 +913,8 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
           for (i=0;i<input_buffer_length;i++)
             ulsch_input_buffer[i]= i;
           */
+	}
 
-#endif //OPENAIR2
           start_meas(&phy_vars_ue->ulsch_encoding_stats);
 
           if (abstraction_flag==0) {
@@ -961,15 +946,16 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
         }
 
         if (abstraction_flag == 0) {
-#ifdef OPENAIR2
-          pusch_power_cntl(phy_vars_ue,subframe_tx,eNB_id,1, abstraction_flag);
-          phy_vars_ue->tx_power_dBm = phy_vars_ue->ulsch_ue[eNB_id]->Po_PUSCH;
-#else
-          phy_vars_ue->tx_power_dBm = UE_TX_POWER;
-#endif
+	  if (phy_vars_ue->mac_enabled==1) {
+	    pusch_power_cntl(phy_vars_ue,subframe_tx,eNB_id,1, abstraction_flag);
+	    phy_vars_ue->tx_power_dBm = phy_vars_ue->ulsch_ue[eNB_id]->Po_PUSCH;
+	  }
+	  else {
+	    phy_vars_ue->tx_power_dBm = phy_vars_ue->tx_power_max_dBm;
+	  }
           phy_vars_ue->tx_total_RE = nb_rb*12;
 	  
-#if defined(EXMIMO) || defined(OAI_USRP)
+#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
 	  tx_amp = get_tx_amp(phy_vars_ue->tx_power_dBm,
 			      phy_vars_ue->tx_power_max_dBm,
 			      phy_vars_ue->lte_frame_parms.N_RB_UL,
@@ -1023,17 +1009,19 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
         if (is_SR_TXOp(phy_vars_ue,eNB_id,subframe_tx)==1) {
           LOG_D(PHY,"[UE %d][SR %x] Frame %d subframe %d: got SR_TXOp, Checking for SR for PUSCH from MAC\n",
                 Mod_id,phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->crnti,frame_tx,subframe_tx);
-#ifdef OPENAIR2
-          SR_payload = mac_xface->ue_get_SR(Mod_id,
-                                            CC_id,
-                                            frame_tx,
-                                            eNB_id,
-                                            phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->crnti,
-                                            subframe_tx); // subframe used for meas gap
-#else
-          SR_payload = 1;
-#endif
 
+	  if (phy_vars_ue->mac_enabled==1) {
+	    SR_payload = mac_xface->ue_get_SR(Mod_id,
+					      CC_id,
+					      frame_tx,
+					      eNB_id,
+					      phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->crnti,
+					      subframe_tx); // subframe used for meas gap
+	  }
+	  else {
+	    SR_payload = 1;
+	  }
+	  
           if (SR_payload>0) {
             generate_ul_signal = 1;
             LOG_D(PHY,"[UE %d][SR %x] Frame %d subframe %d got the SR for PUSCH is %d\n",
@@ -1041,8 +1029,9 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
           } else {
             phy_vars_ue->sr[subframe_tx]=0;
           }
-        } else
+        } else {
           SR_payload=0;
+	}
 
         if (get_ack(&phy_vars_ue->lte_frame_parms,
                     phy_vars_ue->dlsch_ue[eNB_id][0]->harq_ack,
@@ -1057,15 +1046,16 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
                                   pucch_ack_payload,
                                   SR_payload);
 
-#ifdef OPENAIR2
-          Po_PUCCH = pucch_power_cntl(phy_vars_ue,subframe_tx,eNB_id,format);
-          phy_vars_ue->tx_power_dBm = Po_PUCCH;
-#else
-          phy_vars_ue->tx_power_dBm = UE_TX_POWER;
-#endif
+	  if (phy_vars_ue->mac_enabled == 1) {
+	    Po_PUCCH = pucch_power_cntl(phy_vars_ue,subframe_tx,eNB_id,format);
+	  } 
+	  else {
+	    Po_PUCCH = phy_vars_ue->tx_power_max_dBm;
+	  }
+	  phy_vars_ue->tx_power_dBm = Po_PUCCH;
           phy_vars_ue->tx_total_RE = 12;
 
-#if defined(EXMIMO) || defined(OAI_USRP)
+#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
 	  tx_amp = get_tx_amp(Po_PUCCH,
 			      phy_vars_ue->tx_power_max_dBm,
 			      phy_vars_ue->lte_frame_parms.N_RB_UL,
@@ -1120,15 +1110,16 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
           }
         } else if (SR_payload==1) { // no ACK/NAK but SR is triggered by MAC
 
-#ifdef OPENAIR2
-          Po_PUCCH = pucch_power_cntl(phy_vars_ue,subframe_tx,eNB_id,pucch_format1);
-          phy_vars_ue->tx_power_dBm = Po_PUCCH;
-#else
-          phy_vars_ue->tx_power_dBm = UE_TX_POWER;
-#endif
+	  if (phy_vars_ue->mac_enabled == 1) {
+	    Po_PUCCH = pucch_power_cntl(phy_vars_ue,subframe_tx,eNB_id,pucch_format1);
+	  }
+	  else {
+	    Po_PUCCH = phy_vars_ue->tx_power_max_dBm;
+	  }
+	  phy_vars_ue->tx_power_dBm = Po_PUCCH;
           phy_vars_ue->tx_total_RE = 12;
 
-#if defined(EXMIMO) || defined(OAI_USRP)
+#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
           tx_amp =  get_tx_amp(Po_PUCCH,
 	                       phy_vars_ue->tx_power_max_dBm,
 	                       phy_vars_ue->lte_frame_parms.N_RB_UL,
@@ -1230,7 +1221,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
       if (abstraction_flag == 0) {
         nsymb = (frame_parms->Ncp == 0) ? 14 : 12;
 
-#if defined(EXMIMO) || defined(OAI_USRP) //this is the EXPRESS MIMO case
+#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)//this is the EXPRESS MIMO case
         ulsch_start = (phy_vars_ue->rx_offset+subframe_tx*frame_parms->samples_per_tti-
                        openair_daq_vars.timing_advance-
                        phy_vars_ue->timing_advance-
@@ -1257,18 +1248,18 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
           for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
             if (frame_parms->Ncp == 1)
               PHY_ofdm_mod(&phy_vars_ue->lte_ue_common_vars.txdataF[aa][subframe_tx*nsymb*frame_parms->ofdm_symbol_size],
-#if defined(EXMIMO) || defined(OAI_USRP)
+#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
                            dummy_tx_buffer,
 #else
                            &phy_vars_ue->lte_ue_common_vars.txdata[aa][ulsch_start],
 #endif
-                           frame_parms->log2_symbol_size,
+                           frame_parms->ofdm_symbol_size,
                            nsymb,
                            frame_parms->nb_prefix_samples,
                            CYCLIC_PREFIX);
             else
               normal_prefix_mod(&phy_vars_ue->lte_ue_common_vars.txdataF[aa][subframe_tx*nsymb*frame_parms->ofdm_symbol_size],
-#if defined(EXMIMO) || defined(OAI_USRP)
+#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
                                 dummy_tx_buffer,
 #else
                                 &phy_vars_ue->lte_ue_common_vars.txdata[aa][ulsch_start],
@@ -1289,7 +1280,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
               }
             */
 #ifndef OFDMA_ULSCH
-#if defined(EXMIMO) || defined(OAI_USRP)
+#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
             apply_7_5_kHz(phy_vars_ue,dummy_tx_buffer,0);
             apply_7_5_kHz(phy_vars_ue,dummy_tx_buffer,1);
 #else
@@ -1304,7 +1295,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
             */
 #endif
 
-#if defined(EXMIMO) || defined(OAI_USRP)
+#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
             overflow = ulsch_start - 9*frame_parms->samples_per_tti;
 
             //if ((slot_tx==4) && (aa==0)) printf("ulsch_start %d, overflow %d\n",ulsch_start,overflow);
@@ -1345,30 +1336,23 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
     //  }// slot_tx is even
     //  else {  // slot_tx is odd, do the PRACH here
 
-#ifdef OPENAIR2
-
     if ((phy_vars_ue->UE_mode[eNB_id] == PRACH) && (phy_vars_ue->lte_frame_parms.prach_config_common.prach_Config_enabled==1)) {
 
-#else
-
-    if (1) {
-#endif
-
       // check if we have PRACH opportunity
       if (is_prach_subframe(&phy_vars_ue->lte_frame_parms,frame_tx,subframe_tx)) {
         phy_vars_ue->generate_prach=0;
-#ifdef OPENAIR2
-
-        // ask L2 for RACH transport
-        if ((mode != rx_calib_ue) && (mode != rx_calib_ue_med) && (mode != rx_calib_ue_byp) && (mode != no_L2_connect) ) {
-          phy_vars_ue->prach_resources[eNB_id] = mac_xface->ue_get_rach(Mod_id,
-                                                 CC_id,
-                                                 frame_tx,
-                                                 eNB_id,
-                                                 subframe_tx);
-          //    LOG_I(PHY,"Got prach_resources for eNB %d address %d, RRCCommon %d\n",eNB_id,phy_vars_ue->prach_resources[eNB_id],UE_mac_inst[Mod_id].radioResourceConfigCommon);
-        }
-#endif
+
+	if (phy_vars_ue->mac_enabled==1){
+	  // ask L2 for RACH transport
+	  if ((mode != rx_calib_ue) && (mode != rx_calib_ue_med) && (mode != rx_calib_ue_byp) && (mode != no_L2_connect) ) {
+	    phy_vars_ue->prach_resources[eNB_id] = mac_xface->ue_get_rach(Mod_id,
+									  CC_id,
+									  frame_tx,
+									  eNB_id,
+									  subframe_tx);
+	    //    LOG_I(PHY,"Got prach_resources for eNB %d address %d, RRCCommon %d\n",eNB_id,phy_vars_ue->prach_resources[eNB_id],UE_mac_inst[Mod_id].radioResourceConfigCommon);
+	  }
+	}
 
         if (phy_vars_ue->prach_resources[eNB_id]!=NULL) {
 
@@ -1382,7 +1366,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
 #endif
 
           if (abstraction_flag == 0) {
-            LOG_D(PHY,"[UE  %d][RAPROC] Frame %d, Subframe %d : Generating PRACH, preamble %d, TARGET_RECEIVED_POWER %d dBm, PRACH TDD Resource index %d, RA-RNTI %d\n",
+            LOG_I(PHY,"[UE  %d][RAPROC] Frame %d, Subframe %d : Generating PRACH, preamble %d, TARGET_RECEIVED_POWER %d dBm, PRACH TDD Resource index %d, RA-RNTI %d\n",
                   Mod_id,
                   frame_tx,
                   subframe_tx,
@@ -1391,20 +1375,17 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
                   phy_vars_ue->prach_resources[eNB_id]->ra_TDD_map_index,
                   phy_vars_ue->prach_resources[eNB_id]->ra_RNTI);
 
-#ifdef OPENAIR2
-	    if (mode != calib_prach_tx)
+	    if ((phy_vars_ue->mac_enabled==1) && (mode != calib_prach_tx)) {
 	      phy_vars_ue->tx_power_dBm = phy_vars_ue->prach_resources[eNB_id]->ra_PREAMBLE_RECEIVED_TARGET_POWER+get_PL(Mod_id,CC_id,eNB_id);
+	    }
 	    else {
 	      phy_vars_ue->tx_power_dBm = phy_vars_ue->tx_power_max_dBm;
 	      phy_vars_ue->prach_resources[eNB_id]->ra_PreambleIndex = 19;	      
 	    }
-#else
-            phy_vars_ue->tx_power_dBm = UE_TX_POWER;
-#endif
 
             phy_vars_ue->tx_total_RE = 96;
 
-#if defined(EXMIMO) || defined(OAI_USRP)
+#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
             phy_vars_ue->lte_ue_prach_vars[eNB_id]->amp = get_tx_amp(phy_vars_ue->tx_power_dBm,
 								     phy_vars_ue->tx_power_max_dBm,
 								     phy_vars_ue->lte_frame_parms.N_RB_UL,
@@ -1431,12 +1412,12 @@ void phy_procedures_UE_TX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstra
           } else {
             UE_transport_info[Mod_id][CC_id].cntl.prach_flag=1;
             UE_transport_info[Mod_id][CC_id].cntl.prach_id=phy_vars_ue->prach_resources[eNB_id]->ra_PreambleIndex;
-#ifdef OPENAIR2
-            mac_xface->Msg1_transmitted(Mod_id,
-                                        CC_id,
-                                        frame_tx,
-                                        eNB_id);
-#endif
+	    if (phy_vars_ue->mac_enabled==1){
+	      mac_xface->Msg1_transmitted(Mod_id,
+					  CC_id,
+					  frame_tx,
+					  eNB_id);
+	    }
           }
 
           LOG_D(PHY,"[UE  %d][RAPROC] Frame %d, subframe %d: Generating PRACH (eNB %d) preamble index %d for UL, TX power %d dBm (PL %d dB), l3msg \n",
@@ -1549,11 +1530,15 @@ void lte_ue_measurement_procedures(uint16_t l, PHY_VARS_UE *phy_vars_ue,uint8_t
     if ((openair_daq_vars.rx_gain_mode == DAQ_AGC_ON) &&
         (mode != rx_calib_ue) && (mode != rx_calib_ue_med) && (mode != rx_calib_ue_byp) )
       if  (phy_vars_ue->frame_rx%100==0)
-        gain_control_all(phy_vars_ue->PHY_measurements.rx_power_avg_dB[eNB_id],0);
+        gain_control_all(dB_fixed(phy_vars_ue->PHY_measurements.rssi),0);
 
 #else
 #ifndef OAI_USRP
-    phy_adjust_gain (phy_vars_ue,0);
+#ifndef OAI_BLADERF
+#ifndef OAI_LMSSDR
+    phy_adjust_gain (phy_vars_ue,dB_fixed(phy_vars_ue->PHY_measurements.rssi),0);
+#endif
+#endif
 #endif
 #endif
     VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL, VCD_FUNCTION_OUT);
@@ -1818,11 +1803,11 @@ void lte_ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *phy_vars_ue,uint8_t abst
     frame_tx += ((int)(phy_vars_ue->lte_ue_pbch_vars[eNB_id]->decoded_output[1]&0xfc));
     frame_tx += pbch_phase;
 
-#ifdef OPENAIR2
-    mac_xface->dl_phy_sync_success(phy_vars_ue->Mod_id,frame_rx,eNB_id,
-                                   phy_vars_ue->UE_mode[eNB_id]==NOT_SYNCHED ? 1 : 0);
-#endif
-
+    if (phy_vars_ue->mac_enabled==1) {
+      mac_xface->dl_phy_sync_success(phy_vars_ue->Mod_id,frame_rx,eNB_id,
+				     phy_vars_ue->UE_mode[eNB_id]==NOT_SYNCHED ? 1 : 0);
+    }
+    
 #ifdef EMOS
     //emos_dump_UE.frame_tx = frame_tx;
     //emos_dump_UE.mimo_mode = phy_vars_ue->lte_ue_pbch_vars[eNB_id]->decoded_output[1];
@@ -1902,16 +1887,15 @@ void lte_ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *phy_vars_ue,uint8_t abst
           phy_vars_ue->Mod_id,frame_rx, slot_rx);
     phy_vars_ue->lte_ue_pbch_vars[eNB_id]->pdu_errors_conseq++;
     phy_vars_ue->lte_ue_pbch_vars[eNB_id]->pdu_errors++;
-#ifdef OPENAIR2
-    mac_xface->out_of_sync_ind(phy_vars_ue->Mod_id,frame_rx,eNB_id);
-#else
-
-    if (phy_vars_ue->lte_ue_pbch_vars[eNB_id]->pdu_errors_conseq>=100) {
-      LOG_E(PHY,"More that 100 consecutive PBCH errors! Exiting!\n");
-      mac_xface->macphy_exit("More that 100 consecutive PBCH errors!");
+    if (phy_vars_ue->mac_enabled == 1) {
+      mac_xface->out_of_sync_ind(phy_vars_ue->Mod_id,frame_rx,eNB_id);
+    }
+    else{
+      if (phy_vars_ue->lte_ue_pbch_vars[eNB_id]->pdu_errors_conseq>=100) {
+	LOG_E(PHY,"More that 100 consecutive PBCH errors! Exiting!\n");
+	mac_xface->macphy_exit("More that 100 consecutive PBCH errors!");
+      }
     }
-
-#endif
   }
 
   if (frame_rx % 100 == 0) {
@@ -2061,9 +2045,9 @@ int lte_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *phy_vars_ue,uint8_t abst
 
 #endif
 
-#ifdef DEBUG_PHY_PROC
+  //#ifdef DEBUG_PHY_PROC
   LOG_D(PHY,"[UE  %d] Frame %d, slot %d, Mode %s: DCI found %i\n",phy_vars_ue->Mod_id,frame_rx,slot_rx,mode_string[phy_vars_ue->UE_mode[eNB_id]],dci_cnt);
-#endif
+  //#endif
 
   phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->dci_received += dci_cnt;
   /*
@@ -2101,9 +2085,9 @@ int lte_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *phy_vars_ue,uint8_t abst
 
 #ifdef DEBUG_PHY_PROC
 
-    if (subframe_rx == 9) { //( frame_rx % 100 == 0)   {
+    if ( frame_rx % 100 == 0)   {
       LOG_D(PHY,"frame %d, subframe %d, rnti %x: dci %d/%d\n",frame_rx,subframe_rx,phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->crnti,i,dci_cnt);
-      //dump_dci(&phy_vars_ue->lte_frame_parms, &dci_alloc_rx[i]);
+      dump_dci(&phy_vars_ue->lte_frame_parms, &dci_alloc_rx[i]);
     }
 
 #endif
@@ -2412,9 +2396,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
   int eNB_id_i = 1;
   uint8_t dual_stream_UE = 0;
 #endif
-#ifndef OPENAIR2
   uint8_t *rar;
-#endif
   int pmch_flag=0;
   uint8_t sync_area=255;
   int pmch_mcs=-1;
@@ -2423,9 +2405,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
   int slot_rx = phy_vars_ue->slot_rx;
   int subframe_rx = slot_rx>>1;
   int subframe_prev = (subframe_rx+9)%10;
-#ifdef OPENAIR2
   int CC_id = phy_vars_ue->CC_id;
-#endif
 
   VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_IN);
 
@@ -2444,7 +2424,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
     else
       openair_daq_vars.use_ia_receiver = (openair_daq_vars.use_ia_receiver+1)%3;
 
-    LOG_I(PHY,"[MYEMOS] frame %d, IA receiver %d, MCS %d, bitrate %d\n",
+    LOG_D(PHY,"[MYEMOS] frame %d, IA receiver %d, MCS %d, bitrate %d\n",
           frame_rx,
           openair_daq_vars.use_ia_receiver,
           phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[phy_vars_ue->dlsch_ue[eNB_id][0]->current_harq_pid]->mcs,
@@ -2622,13 +2602,13 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
 
         phy_vars_ue->dlsch_ue[eNB_id][0]->active = 0;
 
-#ifdef DEBUG_PHY_PROC
+	//#ifdef DEBUG_PHY_PROC
         LOG_D(PHY,"[UE  %d][PDSCH %x/%d] Frame %d subframe %d Scheduling DLSCH decoding\n",
               phy_vars_ue->Mod_id,
               phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,
               harq_pid,
               (subframe_prev == 9) ? (frame_rx-1) : frame_rx,subframe_prev);
-#endif
+	//#endif
 
         if (phy_vars_ue->dlsch_ue[eNB_id][0]) {
           if (abstraction_flag == 0) {
@@ -2657,7 +2637,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
                                  phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid],
                                  subframe_prev,
                                  harq_pid,
-                                 1,0);
+                                 1,phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->nb_rb>10 ? 1 : 0);
             stop_meas(&phy_vars_ue->dlsch_decoding_stats);
           }
 
@@ -2675,15 +2655,17 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
             phy_vars_ue->dlsch_errors[eNB_id]++;
 
 #ifdef DEBUG_PHY_PROC
-            LOG_D(PHY,"[UE  %d][PDSCH %x/%d] Frame %d subframe %d DLSCH in error (rv %d,mcs %d)\n",
+            LOG_D(PHY,"[UE  %d][PDSCH %x/%d] Frame %d subframe %d DLSCH in error (rv %d,mcs %d,TBS %d)\n",
                   phy_vars_ue->Mod_id,phy_vars_ue->dlsch_ue[eNB_id][0]->rnti,
                   harq_pid,frame_rx,subframe_prev,
                   phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->rvidx,
-                  phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs);
-
-            //      if (abstraction_flag ==0 )
-            //dump_dlsch(phy_vars_ue,eNB_id,subframe_prev,harq_pid);
-            //mac_xface->macphy_exit("");
+                  phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->mcs,
+                  phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->TBS);
+/*
+            if (abstraction_flag ==0 )
+              dump_dlsch(phy_vars_ue,eNB_id,subframe_prev,harq_pid);
+            mac_xface->macphy_exit("");
+*/
 #endif
           } else {
             LOG_D(PHY,"[UE  %d][PDSCH %x/%d] Frame %d subframe %d (slot_rx %d): Received DLSCH (rv %d,mcs %d,TBS %d)\n",
@@ -2703,14 +2685,14 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
             LOG_T(PHY,"\n");
 #endif
 #endif
-#ifdef OPENAIR2
-            mac_xface->ue_send_sdu(phy_vars_ue->Mod_id,
-                                   CC_id,
-                                   frame_rx,
-                                   phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[phy_vars_ue->dlsch_ue[eNB_id][0]->current_harq_pid]->b,
-                                   phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[phy_vars_ue->dlsch_ue[eNB_id][0]->current_harq_pid]->TBS>>3,
-                                   eNB_id);
-#endif
+	    if (phy_vars_ue->mac_enabled == 1) {
+	      mac_xface->ue_send_sdu(phy_vars_ue->Mod_id,
+				     CC_id,
+				     frame_rx,
+				     phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[phy_vars_ue->dlsch_ue[eNB_id][0]->current_harq_pid]->b,
+				     phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[phy_vars_ue->dlsch_ue[eNB_id][0]->current_harq_pid]->TBS>>3,
+				     eNB_id);
+	    }
             phy_vars_ue->total_TBS[eNB_id] =  phy_vars_ue->total_TBS[eNB_id] +
                                               phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[phy_vars_ue->dlsch_ue[eNB_id][0]->current_harq_pid]->TBS;
             phy_vars_ue->total_received_bits[eNB_id] = phy_vars_ue->total_TBS[eNB_id] +
@@ -2799,7 +2781,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
                     frame_rx,subframe_prev);
 
 #ifdef DEBUG_PHY_PROC
-            LOG_I(PHY,"Decoding DLSCH_SI : rb_alloc %x : nb_rb %d G %d TBS %d, num_pdcch_sym %d\n",phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->rb_alloc_even[0],
+            LOG_D(PHY,"Decoding DLSCH_SI : rb_alloc %x : nb_rb %d G %d TBS %d, num_pdcch_sym %d\n",phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->rb_alloc_even[0],
                   phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->nb_rb,
                   phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->G,
                   phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->TBS,
@@ -2847,7 +2829,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
           if (ret == (1+phy_vars_ue->dlsch_ue_SI[eNB_id]->max_turbo_iterations)) {
             phy_vars_ue->dlsch_SI_errors[eNB_id]++;
 #ifdef DEBUG_PHY_PROC
-            LOG_I(PHY,"[UE  %d] Frame %d, subframe %d, received SI in error (TBS %d, mcs %d, rvidx %d, rballoc %X.%X.%X.%X\n",
+            LOG_D(PHY,"[UE  %d] Frame %d, subframe %d, received SI in error (TBS %d, mcs %d, rvidx %d, rballoc %X.%X.%X.%X\n",
 		  phy_vars_ue->Mod_id,
 		  frame_rx,
 		  subframe_prev,
@@ -2880,24 +2862,20 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
                   phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->rb_alloc_even[3]);
 #endif
 
-#ifdef OPENAIR2
-            /*
-                            printf("\n\n");
-                for (i=0;i<phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->TBS>>3;i++)
-                  printf("%02x ",phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->b[i]);
-                printf("\n");
-              */
-            mac_xface->ue_decode_si(phy_vars_ue->Mod_id,
-                                    CC_id,
-                                    frame_rx,
-                                    eNB_id,
-                                    phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->b,
-                                    phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->TBS>>3);
-            /*
-              if ((frame_rx % 160) < 10)
-                printf("sending SI to L2 in frame %d\n",frame_rx);
-              */
-#endif
+	    if (phy_vars_ue->mac_enabled == 1) {
+	      /*
+		printf("\n\n");
+		for (i=0;i<phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->TBS>>3;i++)
+		printf("%02x ",phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->b[i]);
+		printf("\n");
+	      */
+	      mac_xface->ue_decode_si(phy_vars_ue->Mod_id,
+				      CC_id,
+				      frame_rx,
+				      eNB_id,
+				      phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->b,
+				      phy_vars_ue->dlsch_ue_SI[eNB_id]->harq_processes[0]->TBS>>3);
+	    }
           }
         }
 
@@ -3013,8 +2991,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
                 subframe_prev, phy_vars_ue->UE_mode[eNB_id]);
 #endif
 
-#ifdef OPENAIR2
-
+	  if (phy_vars_ue->mac_enabled == 1) {
           if ((phy_vars_ue->UE_mode[eNB_id] != PUSCH) && (phy_vars_ue->prach_resources[eNB_id]->Msg3!=NULL)) {
             LOG_D(PHY,"[UE  %d][RAPROC] Frame %d subframe %d Invoking MAC for RAR (current preamble %d)\n",
                   phy_vars_ue->Mod_id,frame_rx-((subframe_prev==9) ? 1 : 0),
@@ -3071,14 +3048,13 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
                     phy_vars_ue->prach_resources[eNB_id]->ra_PreambleIndex);
             }
           } // mode != PUSCH
-
-#else //OPENAIR2
-
-          rar = phy_vars_ue->dlsch_ue_ra[eNB_id]->harq_processes[0]->b+1;
-          timing_advance = ((((uint16_t)(rar[0]&0x7f))<<4) + (rar[1]>>4));
-          //timing_advance = phy_vars_ue->dlsch_ue_ra[eNB_id]->harq_processes[0]->b[0];
-          process_timing_advance_rar(phy_vars_ue,timing_advance);
-#endif
+	  }
+	    else {
+	      rar = phy_vars_ue->dlsch_ue_ra[eNB_id]->harq_processes[0]->b+1;
+	      timing_advance = ((((uint16_t)(rar[0]&0x7f))<<4) + (rar[1]>>4));
+	      //timing_advance = phy_vars_ue->dlsch_ue_ra[eNB_id]->harq_processes[0]->b[0];
+	      process_timing_advance_rar(phy_vars_ue,timing_advance);
+	    }
         } //ret <= MAX_ITERATIONS
 
         /*
@@ -3280,7 +3256,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
   }
 
   if (is_pmch_subframe((subframe_rx==9?-1:0)+frame_rx,subframe_rx,&phy_vars_ue->lte_frame_parms)) {
-    LOG_I(PHY,"ue calling pmch subframe ..\n ");
+    LOG_D(PHY,"ue calling pmch subframe ..\n ");
 
     if ((slot_rx%2)==1) {
       LOG_D(PHY,"[UE %d] Frame %d, subframe %d: Querying for PMCH demodulation(%d)\n",
@@ -3347,7 +3323,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
                                phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0],
                                subframe_prev,
                                0,
-                               0,0);
+                               0,1);
         } else { // abstraction
 #ifdef PHY_ABSTRACTION
           ret = dlsch_decoding_emul(phy_vars_ue,
@@ -3428,7 +3404,7 @@ int phy_procedures_UE_RX(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstrac
             phy_vars_rn->sync_area[subframe_rx] = sync_area; // this could also go the harq data struct
             phy_vars_rn->dlsch_rn_MCH[subframe_rx]->harq_processes[0]->TBS = phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0]->TBS;
             phy_vars_rn->dlsch_rn_MCH[subframe_rx]->harq_processes[0]->mcs = phy_vars_ue->dlsch_ue_MCH[0]->harq_processes[0]->mcs;
-            LOG_I(PHY,"[RN/UE %d] Frame %d subframe %d: store the MCH PDU for MBSFN sync area %d (MCS %d, TBS %d)\n",
+            LOG_D(PHY,"[RN/UE %d] Frame %d subframe %d: store the MCH PDU for MBSFN sync area %d (MCS %d, TBS %d)\n",
                   phy_vars_ue->Mod_id, frame_rx,subframe_rx,sync_area,
                   phy_vars_rn->dlsch_rn_MCH[subframe_rx]->harq_processes[0]->mcs,
                   phy_vars_rn->dlsch_rn_MCH[subframe_rx]->harq_processes[0]->TBS>>3);
@@ -3630,24 +3606,21 @@ void phy_procedures_UE_lte(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstr
   int           CC_id =0;
 #endif
   int           frame_rx = phy_vars_ue->frame_rx;
-#ifdef OPENAIR2
   int           frame_tx = phy_vars_ue->frame_tx;
-#endif
   int           slot_rx  = phy_vars_ue->slot_rx;
   int           slot_tx  = phy_vars_ue->slot_tx;
   int           subframe_tx = slot_tx>>1;
   int           subframe_rx = slot_rx>>1;
 #undef DEBUG_PHY_PROC
 
-#ifdef OPENAIR2
   UE_L2_STATE_t ret;
-#endif
-#ifndef OPENAIR2
-  phy_vars_ue->UE_mode[eNB_id]=PUSCH;
-  phy_vars_ue->prach_resources[eNB_id] = &prach_resources_local;
-  prach_resources_local.ra_RNTI = 0xbeef;
-  prach_resources_local.ra_PreambleIndex = 0;
-#endif
+
+  if (phy_vars_ue->mac_enabled == 0) {
+    phy_vars_ue->UE_mode[eNB_id]=PUSCH;
+    phy_vars_ue->prach_resources[eNB_id] = &prach_resources_local;
+    prach_resources_local.ra_RNTI = 0xbeef;
+    prach_resources_local.ra_PreambleIndex = 0;
+  }
 
 
   VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_LTE,1);
@@ -3846,16 +3819,14 @@ void phy_procedures_UE_lte(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstr
       phy_procedures_UE_RX(phy_vars_ue,eNB_id,abstraction_flag,mode,r_type,phy_vars_rn);
   }
 
-#ifdef OPENAIR2
-
-  if (slot_rx%2==0) {
-
-    ret = mac_xface->ue_scheduler(phy_vars_ue->Mod_id,
-                                  frame_tx,
-                                  subframe_rx,
-                                  subframe_select(&phy_vars_ue->lte_frame_parms,subframe_tx),
-                                  eNB_id,
-                                  0/*FIXME CC_id*/);
+  if (phy_vars_ue->mac_enabled==1) {
+    if (slot_rx%2==0) {
+      ret = mac_xface->ue_scheduler(phy_vars_ue->Mod_id,
+				    frame_tx,
+				    subframe_rx,
+				    subframe_select(&phy_vars_ue->lte_frame_parms,subframe_tx),
+				    eNB_id,
+				    0/*FIXME CC_id*/);
 
     if (ret == CONNECTION_LOST) {
       LOG_E(PHY,"[UE %d] Frame %d, subframe %d RRC Connection lost, returning to PRACH\n",phy_vars_ue->Mod_id,
@@ -3874,11 +3845,7 @@ void phy_procedures_UE_lte(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t abstr
       phy_vars_ue->UE_mode[eNB_id] = PRACH;
     }
   }
-
-#endif
-
-  //  if (last_slot == 19)
-  //    phy_vars_ue->frame++;
+  }
 
   VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_LTE,0);
   stop_meas(&phy_vars_ue->phy_proc);
diff --git a/openair1/SCHED/pucch_pc.c b/openair1/SCHED/pucch_pc.c
index feeff7159886cec6f01ce65fa45f20f1bf181009..afcf4bd5b34ea2604359d9e1b5bee46d95ace50f 100644
--- a/openair1/SCHED/pucch_pc.c
+++ b/openair1/SCHED/pucch_pc.c
@@ -46,16 +46,16 @@ int8_t pucch_power_cntl(PHY_VARS_UE *phy_vars_ue,uint8_t subframe,uint8_t eNB_id
 {
 
   int8_t Po_PUCCH;
-  uint8_t harq_pid;
+  //uint8_t harq_pid;
 
   // P_pucch =  P_opucch+ PL + h(nCQI,nHARQ) + delta_pucchF(pucch_fmt) + g(i))
   //
-  if ((pucch_fmt == pucch_format1a) ||
-      (pucch_fmt == pucch_format1b)) {  // Update g_pucch based on TPC/delta_PUCCH received in PDCCH for this process
-    harq_pid = phy_vars_ue->dlsch_ue[eNB_id][0]->harq_ack[subframe].harq_id;
+  //if ((pucch_fmt == pucch_format1a) ||
+  //    (pucch_fmt == pucch_format1b)) {  // Update g_pucch based on TPC/delta_PUCCH received in PDCCH for this process
+    //harq_pid = phy_vars_ue->dlsch_ue[eNB_id][0]->harq_ack[subframe].harq_id;
     //this is now done in dci_tools
     //phy_vars_ue->g_pucch[eNB_id] += phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->delta_PUCCH;
-  }
+  //}
 
   Po_PUCCH = get_PL(phy_vars_ue->Mod_id,phy_vars_ue->CC_id,eNB_id)+
     phy_vars_ue->lte_frame_parms.ul_power_control_config_common.p0_NominalPUCCH+
diff --git a/openair1/SCHED/pusch_pc.c b/openair1/SCHED/pusch_pc.c
index 2af8771afef6bc48bf61d306e8ef777fe1cd7860..5fb1f7449ca9a2bcf77554d6027b85f189e6a5c0 100644
--- a/openair1/SCHED/pusch_pc.c
+++ b/openair1/SCHED/pusch_pc.c
@@ -81,7 +81,7 @@ int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id,
   //(phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->control_only == 1) ? phy_vars_eNB->ulsch_eNB[UE_id]->beta_offset_cqi_times8:8;
 
   DevAssert( UE_id < NUMBER_OF_UE_MAX );
-#warning "This condition happens sometimes. Need more investigation" // navid
+//#warning "This condition happens sometimes. Need more investigation" // navid
   //DevAssert( MPR_x100/6 < 100 );
 
   if (phy_vars_eNB->ul_power_control_dedicated[UE_id].deltaMCS_Enabled == 1) {
diff --git a/openair1/SIMULATION/ETH_TRANSPORT/bypass_session_layer.c b/openair1/SIMULATION/ETH_TRANSPORT/bypass_session_layer.c
index 765952133a5c3b784ac5f4867d35029b315eff98..0ced6e0cebda82589cec66b07a2d986eb411d576 100644
--- a/openair1/SIMULATION/ETH_TRANSPORT/bypass_session_layer.c
+++ b/openair1/SIMULATION/ETH_TRANSPORT/bypass_session_layer.c
@@ -288,7 +288,7 @@ int emu_transport_handle_ue_info(bypass_msg_header_t *messg,
               n_ue, total_header+total_tbs,total_header,total_tbs);
       }
 
-#warning "CC id should be adjusted, set to zero for the moment"
+//#warning "CC id should be adjusted, set to zero for the moment"
       memcpy(&UE_transport_info[n_ue][CC_id], UE_info, total_header + total_tbs);
 
       /* Go to the next UE info */
diff --git a/openair1/SIMULATION/ETH_TRANSPORT/emu_transport.c b/openair1/SIMULATION/ETH_TRANSPORT/emu_transport.c
index 8c5516eabd6837e9860efafb93f6edf8c7d5ccb3..ec15e7c668924ad000f544bd32345f01f93bb8eb 100644
--- a/openair1/SIMULATION/ETH_TRANSPORT/emu_transport.c
+++ b/openair1/SIMULATION/ETH_TRANSPORT/emu_transport.c
@@ -291,7 +291,6 @@ void fill_phy_enb_vars(unsigned int enb_id, uint8_t CC_id,unsigned int next_slot
   LTE_eNB_DLSCH_t *dlsch_eNB;
   unsigned short ue_id;
   uint8_t nb_total_dci;
-  int i;
 
   // eNB
   // PBCH : copy payload
diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c
index 2d27f2eea5cb4729eeb268280dc4c9a67f1ac857..0ed1721a2c4052b0b6d28456f81b7fdf6b9ddb2c 100644
--- a/openair1/SIMULATION/LTE_PHY/dlsim.c
+++ b/openair1/SIMULATION/LTE_PHY/dlsim.c
@@ -48,7 +48,6 @@
 #include "PHY/types.h"
 #include "PHY/defs.h"
 #include "PHY/vars.h"
-#include "MAC_INTERFACE/vars.h"
 
 #include "SCHED/defs.h"
 #include "SCHED/vars.h"
@@ -61,25 +60,7 @@
 extern unsigned int dlsch_tbs25[27][25],TBStable[27][110];
 extern unsigned char offset_mumimo_llr_drange_fix;
 
-#ifdef XFORMS
 #include "PHY/TOOLS/lte_phy_scope.h"
-#endif
-
-
-
-//#define AWGN
-//#define NO_DCI
-
-
-
-//#define ABSTRACTION
-
-/*
-  #define RBmask0 0x00fc00fc
-  #define RBmask1 0x0
-  #define RBmask2 0x0
-  #define RBmask3 0x0
-*/
 
 PHY_VARS_eNB *PHY_vars_eNB;
 PHY_VARS_UE *PHY_vars_UE;
@@ -107,88 +88,6 @@ void handler(int sig)
   exit(1);
 }
 
-void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,uint8_t extended_prefix_flag,uint8_t fdd_flag, uint16_t Nid_cell,uint8_t tdd_config,uint8_t N_RB_DL,
-                    uint8_t osf,uint32_t perfect_ce)
-{
-
-  LTE_DL_FRAME_PARMS *lte_frame_parms;
-  int i;
-
-
-  printf("Start lte_param_init\n");
-  PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB));
-  PHY_vars_UE = malloc(sizeof(PHY_VARS_UE));
-  //PHY_config = malloc(sizeof(PHY_CONFIG));
-  mac_xface = malloc(sizeof(MAC_xface));
-
-  srand(0);
-  randominit(0);
-  set_taus_seed(0);
-
-  lte_frame_parms = &(PHY_vars_eNB->lte_frame_parms);
-
-  lte_frame_parms->N_RB_DL            = N_RB_DL;   //50 for 10MHz and 25 for 5 MHz
-  lte_frame_parms->N_RB_UL            = N_RB_DL;
-  lte_frame_parms->Ncp                = extended_prefix_flag;
-  lte_frame_parms->Nid_cell           = Nid_cell;
-  lte_frame_parms->nushift            = Nid_cell%6;
-  lte_frame_parms->nb_antennas_tx     = N_tx;
-  lte_frame_parms->nb_antennas_rx     = N_rx;
-  lte_frame_parms->nb_antennas_tx_eNB = N_tx;
-  lte_frame_parms->phich_config_common.phich_resource         = one;
-  lte_frame_parms->tdd_config         = tdd_config;
-  lte_frame_parms->frame_type         = (fdd_flag==1)?0 : 1;
-  //  lte_frame_parms->Csrs = 2;
-  //  lte_frame_parms->Bsrs = 0;
-  //  lte_frame_parms->kTC = 0;44
-  //  lte_frame_parms->n_RRC = 0;
-  lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0;
-
-  init_frame_parms(lte_frame_parms,osf);
-
-  //copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing));
-
-  //  phy_init_top(lte_frame_parms); //allocation
-
-  PHY_vars_UE->is_secondary_ue = 0;
-  PHY_vars_UE->lte_frame_parms = *lte_frame_parms;
-  PHY_vars_eNB->lte_frame_parms = *lte_frame_parms;
-
-  phy_init_lte_top(lte_frame_parms);
-  dump_frame_parms(lte_frame_parms);
-
-  PHY_vars_UE->PHY_measurements.n_adj_cells=0;
-  PHY_vars_UE->PHY_measurements.adj_cell_id[0] = Nid_cell+1;
-  PHY_vars_UE->PHY_measurements.adj_cell_id[1] = Nid_cell+2;
-
-  for (i=0; i<3; i++)
-    lte_gold(lte_frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i);
-
-  phy_init_lte_ue(PHY_vars_UE,1,0);
-  phy_init_lte_eNB(PHY_vars_eNB,0,0,0);
-
-  generate_pcfich_reg_mapping(&PHY_vars_UE->lte_frame_parms);
-  generate_phich_reg_mapping(&PHY_vars_UE->lte_frame_parms);
-
-  // DL power control init
-  if (transmission_mode == 1) {
-    PHY_vars_eNB->pdsch_config_dedicated->p_a  = dB0; // 4 = 0dB
-    ((PHY_vars_eNB->lte_frame_parms).pdsch_config_common).p_b = 0;
-    PHY_vars_UE->pdsch_config_dedicated->p_a  = dB0; // 4 = 0dB
-    ((PHY_vars_UE->lte_frame_parms).pdsch_config_common).p_b = 0;
-  } else { // rho_a = rhob
-    PHY_vars_eNB->pdsch_config_dedicated->p_a  = dB0; // 4 = 0dB
-    ((PHY_vars_eNB->lte_frame_parms).pdsch_config_common).p_b = 1;
-    PHY_vars_UE->pdsch_config_dedicated->p_a  = dB0; // 4 = 0dB
-    ((PHY_vars_UE->lte_frame_parms).pdsch_config_common).p_b = 1;
-  }
-
-  PHY_vars_UE->perfect_ce = perfect_ce;
-
-  printf("Done lte_param_init\n");
-
-
-}
 
 
 //DCI2_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu2_2A[2];
@@ -200,7 +99,7 @@ uint64_t DLSCH_alloc_pdu_1[2];
 #define CCCH_RB_ALLOC computeRIV(PHY_vars_eNB->lte_frame_parms.N_RB_UL,0,2)
 //#define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13
 //#define DLSCH_RB_ALLOC 0x0001
-void do_OFDM_mod_l(mod_sym_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms)
+void do_OFDM_mod_l(int32_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms)
 {
 
   int aa, slot_offset, slot_offset_F;
@@ -214,7 +113,7 @@ void do_OFDM_mod_l(mod_sym_t **txdataF, int32_t **txdata, uint16_t next_slot, LT
     if (frame_parms->Ncp == 1)
       PHY_ofdm_mod(&txdataF[aa][slot_offset_F],        // input
                    &txdata[aa][slot_offset],         // output
-                   frame_parms->log2_symbol_size,                // log2_fft_size
+                   frame_parms->ofdm_symbol_size,
                    6,                 // number of symbols
                    frame_parms->nb_prefix_samples,               // number of prefix samples
                    CYCLIC_PREFIX);
@@ -266,15 +165,15 @@ int main(int argc, char **argv)
   unsigned int ret;
   unsigned int coded_bits_per_codeword=0,nsymb,dci_cnt,tbs=0;
 
-  unsigned int tx_lev=0,tx_lev_dB=0,trials,errs[4]= {0,0,0,0},errs2[4]= {0,0,0,0},round_trials[4]= {0,0,0,0},dci_errors=0,dlsch_active=0,num_layers;
+  unsigned int tx_lev=0,tx_lev_dB=0,trials,errs[4]= {0,0,0,0},errs2[4]= {0,0,0,0},round_trials[4]= {0,0,0,0},dci_errors=0,dlsch_active=0;//,num_layers;
   int re_allocated;
   char fname[32],vname[32];
   FILE *bler_fd;
   char bler_fname[256];
   FILE *time_meas_fd;
   char time_meas_fname[256];
-  FILE *tikz_fd;
-  char tikz_fname[256];
+  //  FILE *tikz_fd;
+  //  char tikz_fname[256];
 
   FILE *input_trch_fd=NULL;
   unsigned char input_trch_file=0;
@@ -300,7 +199,7 @@ int main(int argc, char **argv)
   uint8_t rx_sample_offset = 0;
   //char stats_buffer[4096];
   //int len;
-  uint8_t num_rounds = 4,fix_rounds=0;
+  uint8_t num_rounds = 4;//,fix_rounds=0;
   uint8_t subframe=7;
   int u;
   int n=0;
@@ -314,15 +213,14 @@ int main(int argc, char **argv)
 
   // void *data;
   // int ii;
-  int bler;
+  //  int bler;
   double blerr[4],uncoded_ber,avg_ber;
   short *uncoded_ber_bit=NULL;
   uint8_t N_RB_DL=25,osf=1;
-  uint8_t fdd_flag = 0;
-#ifdef XFORMS
-  FD_lte_phy_scope_ue *form_ue;
+  frame_t frame_type = FDD;
+  int xforms=0;
+  FD_lte_phy_scope_ue *form_ue = NULL;
   char title[255];
-#endif
   uint32_t DLSCH_RB_ALLOC = 0x1fff;
   int numCCE=0;
   int dci_length_bytes=0,dci_length=0;
@@ -330,7 +228,7 @@ int main(int argc, char **argv)
   int common_flag=0,TPC=0;
 
   double cpu_freq_GHz;
-  time_stats_t ts;//,sts,usts;
+  //  time_stats_t ts;//,sts,usts;
   int avg_iter,iter_trials;
   int rballocset=0;
   int print_perf=0;
@@ -344,15 +242,24 @@ int main(int argc, char **argv)
   int TB0_active = 1;
   uint32_t perfect_ce = 0;
 
-  LTE_DL_UE_HARQ_t *dlsch0_ue_harq;
-  LTE_DL_eNB_HARQ_t *dlsch0_eNB_harq;
+  //  LTE_DL_UE_HARQ_t *dlsch0_ue_harq;
+  //  LTE_DL_eNB_HARQ_t *dlsch0_eNB_harq;
   uint8_t Kmimo;
-  FILE    *proc_fd = NULL;
-  char buf[64];
+  uint8_t ue_category=4;
+  uint32_t Nsoft;
+
+
+
+  int CCE_table[800];
+
+  int threequarter_fs=0;
 
   opp_enabled=1; // to enable the time meas
 
 #if defined(__arm__)
+  FILE    *proc_fd = NULL;
+  char buf[64];
+
   proc_fd = fopen("/sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_cur_freq", "r");
   if(!proc_fd)
      printf("cannot open /sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_cur_freq");
@@ -376,16 +283,20 @@ int main(int argc, char **argv)
   // default parameters
   n_frames = 1000;
   snr0 = 0;
-  num_layers = 1;
+  //  num_layers = 1;
   perfect_ce = 0;
 
-  while ((c = getopt (argc, argv, "ahdpZDe:m:n:o:s:f:t:c:g:r:F:x:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:PLl:Y")) != -1) {
+  while ((c = getopt (argc, argv, "ahdpZDe:Em:n:o:s:f:t:c:g:r:F:x:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:PLl:XY")) != -1) {
     switch (c) {
     case 'a':
       awgn_flag = 1;
       channel_model = AWGN;
       break;
 
+    case 'A':
+      abstx = 1;
+      break;
+
     case 'b':
       tdd_config=atoi(optarg);
       break;
@@ -394,10 +305,59 @@ int main(int argc, char **argv)
       N_RB_DL=atoi(optarg);
       break;
 
+    case 'c':
+      num_pdcch_symbols=atoi(optarg);
+      break;
+
+    case 'C':
+      Nid_cell = atoi(optarg);
+      break;
+
     case 'd':
       dci_flag = 1;
       break;
 
+    case 'D':
+      frame_type=TDD;
+      break;
+
+    case 'e':
+      num_rounds=1;
+      common_flag = 1;
+      TPC = atoi(optarg);
+      break;
+      
+    case 'E':
+      threequarter_fs=1;
+      break;
+
+    case 'f':
+      input_snr_step= atof(optarg);
+      break;
+
+    case 'F':
+      forgetting_factor = atof(optarg);
+      break;
+
+    case 'i':
+      input_fd = fopen(optarg,"r");
+      input_file=1;
+      dci_flag = 1;
+      break;
+
+    case 'I':
+      input_trch_fd = fopen(optarg,"r");
+      input_trch_file=1;
+      break;
+
+    case 'L':
+      llr8_flag=1;
+      break;
+
+    case 'l':
+      offset_mumimo_llr_drange_fix=atoi(optarg);
+      break;
+
     case 'm':
       mcs1 = atoi(optarg);
       break;
@@ -406,6 +366,11 @@ int main(int argc, char **argv)
       mcs2 = atoi(optarg);
       break;
 
+    case 'O':
+      test_perf=atoi(optarg);
+      //print_perf =1;
+      break;
+
     case 't':
       mcs_i = atoi(optarg);
       i_mod = get_Qm(mcs_i);
@@ -415,27 +380,16 @@ int main(int argc, char **argv)
       n_frames = atoi(optarg);
       break;
 
-    case 'C':
-      Nid_cell = atoi(optarg);
-      break;
 
     case 'o':
       rx_sample_offset = atoi(optarg);
       break;
 
-    case 'D':
-      fdd_flag = 1;
-      break;
-
     case 'r':
       DLSCH_RB_ALLOC = atoi(optarg);
       rballocset = 1;
       break;
 
-    case 'F':
-      forgetting_factor = atof(optarg);
-      break;
-
     case 's':
       snr0 = atof(optarg);
       break;
@@ -444,13 +398,6 @@ int main(int argc, char **argv)
       snr_int = atof(optarg);
       break;
 
-    case 'f':
-      input_snr_step= atof(optarg);
-      break;
-
-    case 'A':
-      abstx = 1;
-      break;
 
     case 'N':
       n_ch_rlz= atof(optarg);
@@ -460,10 +407,6 @@ int main(int argc, char **argv)
       extended_prefix_flag=1;
       break;
 
-    case 'c':
-      num_pdcch_symbols=atoi(optarg);
-      break;
-
     case 'g':
       memcpy(channel_model_input,optarg,10);
 
@@ -523,70 +466,12 @@ int main(int argc, char **argv)
       case 'N':
         channel_model=AWGN;
         break;
-
       default:
         msg("Unsupported channel model!\n");
         exit(-1);
       }
 
       break;
-
-    case 'x':
-      transmission_mode=atoi(optarg);
-
-      if ((transmission_mode!=1) &&
-          (transmission_mode!=2) &&
-          (transmission_mode!=3) &&
-          (transmission_mode!=4) &&
-          (transmission_mode!=5) &&
-          (transmission_mode!=6)) {
-        msg("Unsupported transmission mode %d\n",transmission_mode);
-        exit(-1);
-      }
-
-      if (transmission_mode>1) {
-        n_tx = 2;
-      }
-
-      break;
-
-    case 'y':
-      n_tx=atoi(optarg);
-
-      if ((n_tx==0) || (n_tx>2)) {
-        msg("Unsupported number of tx antennas %d\n",n_tx);
-        exit(-1);
-      }
-
-      break;
-
-    case 'z':
-      n_rx=atoi(optarg);
-
-      if ((n_rx==0) || (n_rx>2)) {
-        msg("Unsupported number of rx antennas %d\n",n_rx);
-        exit(-1);
-      }
-
-      break;
-
-    case 'I':
-      input_trch_fd = fopen(optarg,"r");
-      input_trch_file=1;
-      break;
-
-    case 'i':
-      input_fd = fopen(optarg,"r");
-      input_file=1;
-      dci_flag = 1;
-      break;
-
-    case 'e':
-      num_rounds=1;
-      common_flag = 1;
-      TPC = atoi(optarg);
-      break;
-
     case 'R':
       num_rounds=atoi(optarg);
       break;
@@ -624,27 +509,59 @@ int main(int argc, char **argv)
       print_perf=1;
       break;
 
-    case 'L':
-      llr8_flag=1;
-      break;
+    case 'x':
+      transmission_mode=atoi(optarg);
+
+      if ((transmission_mode!=1) &&
+          (transmission_mode!=2) &&
+          (transmission_mode!=3) &&
+          (transmission_mode!=4) &&
+          (transmission_mode!=5) &&
+          (transmission_mode!=6)) {
+        msg("Unsupported transmission mode %d\n",transmission_mode);
+        exit(-1);
+      }
+
+      if (transmission_mode>1) {
+        n_tx = 2;
+      }
 
-    case 'l':
-      offset_mumimo_llr_drange_fix=atoi(optarg);
       break;
 
-    case 'O':
-      test_perf=atoi(optarg);
-      //print_perf =1;
+    case 'y':
+      n_tx=atoi(optarg);
+
+      if ((n_tx==0) || (n_tx>2)) {
+        msg("Unsupported number of tx antennas %d\n",n_tx);
+        exit(-1);
+      }
+
       break;
 
-    case 'Z':
-      dump_table=1;
+    case 'X':
+      xforms=1;
       break;
 
     case 'Y':
       perfect_ce=1;
       break;
 
+    case 'z':
+      n_rx=atoi(optarg);
+
+      if ((n_rx==0) || (n_rx>2)) {
+        msg("Unsupported number of rx antennas %d\n",n_rx);
+        exit(-1);
+      }
+
+      break;
+
+    case 'Z':
+      dump_table=1;
+      break;
+
+
+
     case 'h':
     default:
       printf("%s -h(elp) -a(wgn on) -d(ci decoding on) -p(extended prefix on) -m mcs1 -M mcs2 -n n_frames -s snr0 -x transmission mode (1,2,5,6) -y TXant -z RXant -I trch_file\n",argv[0]);
@@ -704,28 +621,39 @@ int main(int argc, char **argv)
   if ((transmission_mode > 1) && (n_tx != 2))
     printf("n_tx must be >1 for transmission_mode %d\n",transmission_mode);
 
-#ifdef XFORMS
-  fl_initialize (&argc, argv, NULL, 0, 0);
-  form_ue = create_lte_phy_scope_ue();
-  sprintf (title, "LTE PHY SCOPE eNB");
-  fl_show_form (form_ue->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
-
-  if (!dual_stream_UE==0) {
-    openair_daq_vars.use_ia_receiver = 1;
-    fl_set_button(form_ue->button_0,1);
-    fl_set_object_label(form_ue->button_0, "IA Receiver ON");
-    fl_set_object_color(form_ue->button_0, FL_GREEN, FL_GREEN);
+  if (xforms==1) {
+    fl_initialize (&argc, argv, NULL, 0, 0);
+    form_ue = create_lte_phy_scope_ue();
+    sprintf (title, "LTE PHY SCOPE eNB");
+    fl_show_form (form_ue->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
+    
+    if (!dual_stream_UE==0) {
+      openair_daq_vars.use_ia_receiver = 1;
+      fl_set_button(form_ue->button_0,1);
+      fl_set_object_label(form_ue->button_0, "IA Receiver ON");
+      fl_set_object_color(form_ue->button_0, FL_GREEN, FL_GREEN);
+    }
   }
 
-#endif
-
   if (transmission_mode==5) {
     n_users = 2;
     printf("dual_stream_UE=%d\n", dual_stream_UE);
   }
 
-  lte_param_init(n_tx,n_rx,transmission_mode,extended_prefix_flag,fdd_flag,Nid_cell,tdd_config,N_RB_DL,osf,perfect_ce);
+  lte_param_init(n_tx,
+		 n_rx,
+		 transmission_mode,
+		 extended_prefix_flag,
+		 frame_type,
+		 Nid_cell,
+		 tdd_config,
+		 N_RB_DL,
+		 threequarter_fs,
+		 osf,
+		 perfect_ce);
 
+
+    
   eNB_id_i = PHY_vars_UE->n_connected_eNB;
 
   printf("Setting mcs1 = %d\n",mcs1);
@@ -986,10 +914,27 @@ int main(int argc, char **argv)
   else
     Kmimo=1;
 
+  switch (ue_category) {
+  case 1:
+    Nsoft = 250368;
+    break;
+  case 2:
+  case 3:
+    Nsoft = 1237248;
+    break;
+  case 4:
+    Nsoft = 1827072;
+    break;
+  default:
+    printf("Unsupported UE category %d\n",ue_category);
+    exit(-1);
+    break;
+  }
+
   for (k=0; k<n_users; k++) {
     // Create transport channel structures for 2 transport blocks (MIMO)
     for (i=0; i<2; i++) {
-      PHY_vars_eNB->dlsch_eNB[k][i] = new_eNB_dlsch(Kmimo,8,N_RB_DL,0);
+      PHY_vars_eNB->dlsch_eNB[k][i] = new_eNB_dlsch(Kmimo,8,Nsoft,N_RB_DL,0);
 
       if (!PHY_vars_eNB->dlsch_eNB[k][i]) {
         printf("Can't get eNB dlsch structures\n");
@@ -1001,7 +946,7 @@ int main(int argc, char **argv)
   }
 
   for (i=0; i<2; i++) {
-    PHY_vars_UE->dlsch_ue[0][i]  = new_ue_dlsch(Kmimo,8,MAX_TURBO_ITERATIONS,N_RB_DL,0);
+    PHY_vars_UE->dlsch_ue[0][i]  = new_ue_dlsch(Kmimo,8,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0);
 
     if (!PHY_vars_UE->dlsch_ue[0][i]) {
       printf("Can't get ue dlsch structures\n");
@@ -1012,7 +957,7 @@ int main(int argc, char **argv)
   }
 
   // structure for SIC at UE
-  PHY_vars_UE->dlsch_eNB[0] = new_eNB_dlsch(Kmimo,8,N_RB_DL,0);
+  PHY_vars_UE->dlsch_eNB[0] = new_eNB_dlsch(Kmimo,8,Nsoft,N_RB_DL,0);
 
   if (DLSCH_alloc_pdu2_1E[0].tpmi == 5) {
 
@@ -1299,7 +1244,7 @@ int main(int argc, char **argv)
           dci_alloc[num_dci].L          = 1;
           dci_alloc[num_dci].rnti       = SI_RNTI;
           dci_alloc[num_dci].format     = format1A;
-          dci_alloc[num_dci].nCCE       = 0;
+          dci_alloc[num_dci].firstCCE       = 0;
           dump_dci(&PHY_vars_eNB->lte_frame_parms,&dci_alloc[num_dci]);
 
           printf("Generating dlsch params for user %d\n",k);
@@ -1606,7 +1551,7 @@ int main(int argc, char **argv)
           dci_alloc[num_dci].L          = 1;
           dci_alloc[num_dci].rnti       = SI_RNTI;
           dci_alloc[num_dci].format     = format1A;
-          dci_alloc[num_dci].nCCE       = 0;
+          dci_alloc[num_dci].firstCCE       = 0;
           dump_dci(&PHY_vars_eNB->lte_frame_parms,&dci_alloc[num_dci]);
 
           printf("Generating dlsch params for user %d\n",k);
@@ -1914,7 +1859,7 @@ int main(int argc, char **argv)
           dci_alloc[num_dci].L          = 1;
           dci_alloc[num_dci].rnti       = SI_RNTI;
           dci_alloc[num_dci].format     = format1A;
-          dci_alloc[num_dci].nCCE       = 0;
+          dci_alloc[num_dci].firstCCE       = 0;
           dump_dci(&PHY_vars_eNB->lte_frame_parms,&dci_alloc[num_dci]);
 
           printf("Generating dlsch params for user %d\n",k);
@@ -1945,7 +1890,7 @@ int main(int argc, char **argv)
         dci_alloc[num_dci].L          = 1;
         dci_alloc[num_dci].rnti       = n_rnti+k;
         dci_alloc[num_dci].format     = format1E_2A_M10PRB;
-        dci_alloc[num_dci].nCCE       = 4*k;
+        dci_alloc[num_dci].firstCCE       = 4*k;
         printf("Generating dlsch params for user %d\n",k);
         generate_eNB_dlsch_params_from_dci(0,
 					   subframe,
@@ -1990,17 +1935,20 @@ int main(int argc, char **argv)
     if (n_frames==1) printf("%d\n",numCCE);
 
     // apply RNTI-based nCCE allocation
+    memset(CCE_table,0,800*sizeof(int));
+
     for (i=num_common_dci; i<num_dci; i++) {
 
-      dci_alloc[i].nCCE = get_nCCE_offset(1<<dci_alloc[i].L,
-                                          numCCE,
-                                          (dci_alloc[i].rnti==SI_RNTI)? 1 : 0,
-                                          dci_alloc[i].rnti,
-                                          subframe);
+      dci_alloc[i].firstCCE = get_nCCE_offset_l1(CCE_table,
+						 1<<dci_alloc[i].L,
+						 numCCE,
+						 (dci_alloc[i].rnti==SI_RNTI)? 1 : 0,
+						 dci_alloc[i].rnti,
+						 subframe);
 
       if (n_frames==1)
         printf("dci %d: rnti %x, format %d : nCCE %d/%d\n",i,dci_alloc[i].rnti, dci_alloc[i].format,
-               dci_alloc[i].nCCE,numCCE);
+               dci_alloc[i].firstCCE,numCCE);
     }
 
     for (k=0; k<n_users; k++) {
@@ -2083,7 +2031,7 @@ int main(int argc, char **argv)
       round_trials[3] = 0;
 
       dci_errors=0;
-      avg_ber = 0;
+      //      avg_ber = 0;
 
       round=0;
       avg_iter = 0;
@@ -2164,7 +2112,7 @@ PMI_FEEDBACK:
 
           //  printf("Trial %d : Round %d, pmi_feedback %d \n",trials,round,pmi_feedback);
           for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx; aa++) {
-            memset(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNB_id][aa][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
+            memset(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNB_id][aa][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t));
           }
 
           if (input_fd==NULL) {
@@ -2554,7 +2502,7 @@ PMI_FEEDBACK:
                 }
               }
             }
-
+	    
             num_pdcch_symbols_2 = generate_dci_top(num_ue_spec_dci,
                                                    num_common_dci,
                                                    dci_alloc,
@@ -2563,7 +2511,7 @@ PMI_FEEDBACK:
                                                    &PHY_vars_eNB->lte_frame_parms,
                                                    PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNB_id],
                                                    subframe);
-
+	    
             if (num_pdcch_symbols_2 > num_pdcch_symbols) {
               msg("Error: given num_pdcch_symbols not big enough (%d > %d)\n",num_pdcch_symbols_2,num_pdcch_symbols);
               exit(-1);
@@ -2668,13 +2616,17 @@ PMI_FEEDBACK:
               }
 
               start_meas(&PHY_vars_eNB->dlsch_modulation_stats);
+     
               re_allocated = dlsch_modulation(PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNB_id],
                                               AMP,
                                               subframe,
                                               &PHY_vars_eNB->lte_frame_parms,
                                               num_pdcch_symbols,
                                               PHY_vars_eNB->dlsch_eNB[k][0],
-                                              PHY_vars_eNB->dlsch_eNB[k][1]);
+                                              PHY_vars_eNB->dlsch_eNB[k][1]);	      
+              /* avoid gcc warnings */
+              (void)re_allocated;
+
               stop_meas(&PHY_vars_eNB->dlsch_modulation_stats);
               /*
               if (trials==0 && round==0)
@@ -2792,8 +2744,16 @@ PMI_FEEDBACK:
                 random_channel(eNB2UE[2],0);
                 random_channel(eNB2UE[3],0);
               }
-          }
-
+	    
+	    if (PHY_vars_UE->perfect_ce==1) {
+                  // fill in perfect channel estimates
+                  freq_channel(eNB2UE[round],PHY_vars_UE->lte_frame_parms.N_RB_DL,12*PHY_vars_UE->lte_frame_parms.N_RB_DL + 1);
+		  /*
+		  write_output("channel.m","ch",eNB2UE[round]->ch[0],eNB2UE[round]->channel_length,1,8);
+                  write_output("channelF.m","chF",eNB2UE[round]->chF[0],12*PHY_vars_UE->lte_frame_parms.N_RB_DL + 1,1,8);
+		  */
+	    }
+	  }
 
           if(abstx) {
             if (trials==0 && round==0) {
@@ -2939,11 +2899,6 @@ PMI_FEEDBACK:
 
               if (PHY_vars_UE->perfect_ce==1) {
                 if (awgn_flag==0) {
-                  // fill in perfect channel estimates
-                  freq_channel(eNB2UE[round],PHY_vars_UE->lte_frame_parms.N_RB_DL,12*PHY_vars_UE->lte_frame_parms.N_RB_DL + 1);
-
-                  //write_output("channel.m","ch",desc1->ch[0],desc1->channel_length,1,8);
-                  //write_output("channelF.m","chF",desc1->chF[0],nb_samples,1,8);
                   for(k=0; k<NUMBER_OF_eNB_MAX; k++) {
                     for(aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
                       for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
@@ -3337,7 +3292,7 @@ PMI_FEEDBACK:
             PHY_vars_UE->dlsch_ue[0][cw]->harq_processes[PHY_vars_UE->dlsch_ue[0][cw]->current_harq_pid]->G = coded_bits_per_codeword;
 
 
-            /*
+	                
             // calculate uncoded BLER
             uncoded_ber=0;
             for (i=0;i<coded_bits_per_codeword;i++)
@@ -3353,7 +3308,7 @@ PMI_FEEDBACK:
 
             if (n_frames==1)
               write_output("uncoded_ber_bit.m","uncoded_ber_bit",uncoded_ber_bit,coded_bits_per_codeword,1,0);
-            */
+            
 
             start_meas(&PHY_vars_UE->dlsch_unscrambling_stats);
             dlsch_unscrambling(&PHY_vars_UE->lte_frame_parms,
@@ -3464,12 +3419,12 @@ PMI_FEEDBACK:
               }
 
               sprintf(fname,"rxsig0_r%d.m",round);
-              sprintf(vname,"rxs0_r%d.m",round);
+              sprintf(vname,"rxs0_r%d",round);
               write_output(fname,vname, &PHY_vars_UE->lte_ue_common_vars.rxdata[0][0],10*PHY_vars_UE->lte_frame_parms.samples_per_tti,1,1);
               sprintf(fname,"rxsigF0_r%d.m",round);
-              sprintf(vname,"rxs0F_r%d.m",round);
+              sprintf(vname,"rxs0F_r%d",round);
               write_output(fname,vname, &PHY_vars_UE->lte_ue_common_vars.rxdataF[0][0],2*PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb,2,1);
-
+	     
               if (PHY_vars_UE->lte_frame_parms.nb_antennas_rx>1) {
                 sprintf(fname,"rxsig1_r%d.m",round);
                 sprintf(vname,"rxs1_r%d.m",round);
@@ -3480,14 +3435,14 @@ PMI_FEEDBACK:
               }
 
               sprintf(fname,"dlsch00_r%d.m",round);
-              sprintf(vname,"dl00_r%d.m",round);
+              sprintf(vname,"dl00_r%d",round);
               write_output(fname,vname,
                            &(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][0][0]),
                            PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb,1,1);
 
               if (PHY_vars_UE->lte_frame_parms.nb_antennas_rx>1) {
                 sprintf(fname,"dlsch01_r%d.m",round);
-                sprintf(vname,"dl01_r%d.m",round);
+                sprintf(vname,"dl01_r%d",round);
                 write_output(fname,vname,
                              &(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][1][0]),
                              PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb/2,1,1);
@@ -3495,7 +3450,7 @@ PMI_FEEDBACK:
 
               if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx>1) {
                 sprintf(fname,"dlsch10_r%d.m",round);
-                sprintf(vname,"dl10_r%d.m",round);
+                sprintf(vname,"dl10_r%d",round);
                 write_output(fname,vname,
                              &(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][2][0]),
                              PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb/2,1,1);
@@ -3503,7 +3458,7 @@ PMI_FEEDBACK:
 
               if ((PHY_vars_UE->lte_frame_parms.nb_antennas_rx>1) && (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx>1)) {
                 sprintf(fname,"dlsch11_r%d.m",round);
-                sprintf(vname,"dl11_r%d.m",round);
+                sprintf(vname,"dl11_r%d",round);
                 write_output(fname,vname,
                              &(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[eNB_id][3][0]),
                              PHY_vars_UE->lte_frame_parms.ofdm_symbol_size*nsymb/2,1,1);
@@ -3527,13 +3482,13 @@ PMI_FEEDBACK:
             //      PHY_vars_UE->dlsch_ue[0][0]->harq_processes[0]->round++;
           }
 
-#ifdef XFORMS
-          phy_scope_UE(form_ue,
-                       PHY_vars_UE,
-                       eNB_id,
-                       0,// UE_id
-                       subframe);
-#endif
+	  if (xforms==1) {
+	    phy_scope_UE(form_ue,
+			 PHY_vars_UE,
+			 eNB_id,
+			 0,// UE_id
+			 subframe);
+	  }
 
         }  //round
 
@@ -4034,7 +3989,7 @@ PMI_FEEDBACK:
         printf("[continue] effective rate : %f  (%2.1f%%,%f)): increase snr \n",rate*effective_rate, 100*effective_rate, rate);
       }
 
-      if (((double)errs[0]/(round_trials[0]))<1e-2)
+      if (((double)errs[0]/(round_trials[0]))<(10.0/n_frames))
         break;
     }// SNR
 
diff --git a/openair1/SIMULATION/LTE_PHY/mbmssim.c b/openair1/SIMULATION/LTE_PHY/mbmssim.c
index b9be0b27e8163404ff3310894927385fe0d05121..2691257895bbca11dd3cdb903b12edba4395a765 100644
--- a/openair1/SIMULATION/LTE_PHY/mbmssim.c
+++ b/openair1/SIMULATION/LTE_PHY/mbmssim.c
@@ -38,7 +38,6 @@
 #include "PHY/types.h"
 #include "PHY/defs.h"
 #include "PHY/vars.h"
-#include "MAC_INTERFACE/vars.h"
 #ifdef EMOS
 #include "SCHED/phy_procedures_emos.h"
 #endif
@@ -47,8 +46,7 @@
 #include "LAYER2/MAC/vars.h"
 
 #ifdef XFORMS
-#include <forms.h>
-#include "../../USERSPACE_TOOLS/SCOPE/lte_scope.h"
+#include "PHY/TOOLS/lte_phy_scope.h"
 #endif //XFORMS
 
 
@@ -129,11 +127,10 @@ int main(int argc, char **argv)
 
   char c;
 
-  int i,l,aa,aarx,k;
+  int i,l,l2,aa,aarx,k;
   double sigma2, sigma2_dB=0,SNR,snr0=-2.0,snr1=0.0;
   uint8_t snr1set=0;
   double snr_step=1,input_snr_step=1;
-  //mod_sym_t **txdataF;
   int **txdata;
   double **s_re,**s_im,**r_re,**r_im;
   double iqim = 0.0;
@@ -174,16 +171,19 @@ int main(int argc, char **argv)
 
   lte_frame_type_t frame_type = FDD;
 
+  uint32_t Nsoft = 1827072;
 
+  /*
 #ifdef XFORMS
-  FD_lte_scope *form_dl;
+  FD_lte_phy_scope_ue *form_ue;
   char title[255];
 
   fl_initialize (&argc, argv, NULL, 0, 0);
-  form_dl = create_form_lte_scope();
+  form_ue = create_lte_phy_scope_ue();
   sprintf (title, "LTE DL SCOPE UE");
-  fl_show_form (form_dl->lte_scope, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
+  fl_show_form (form_ue->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
 #endif
+  */
 
   logInit();
   number_of_cards = 1;
@@ -335,7 +335,11 @@ int main(int argc, char **argv)
   else
     sprintf(fname,"embms_awgn_%d_%d.m",mcs,N_RB_DL);
 
-  fd = fopen(fname,"w");
+  if (!(fd = fopen(fname,"w"))) {
+    printf("Cannot open %s, check permissions\n",fname);
+    exit(-1);
+  }
+	
 
   if (awgn_flag==0)
     fprintf(fd,"SNR_%d_%d=[];errs_mch_%d_%d=[];mch_trials_%d_%d=[];\n",
@@ -383,14 +387,14 @@ int main(int argc, char **argv)
                                 0);
 
   // Create transport channel structures for 2 transport blocks (MIMO)
-  PHY_vars_eNB->dlsch_eNB_MCH = new_eNB_dlsch(1,8,N_RB_DL,0);
+  PHY_vars_eNB->dlsch_eNB_MCH = new_eNB_dlsch(1,8,Nsoft,N_RB_DL,0);
 
   if (!PHY_vars_eNB->dlsch_eNB_MCH) {
     printf("Can't get eNB dlsch structures\n");
     exit(-1);
   }
 
-  PHY_vars_UE->dlsch_ue_MCH[0]  = new_ue_dlsch(1,8,MAX_TURBO_ITERATIONS_MBSFN,N_RB_DL,0);
+  PHY_vars_UE->dlsch_ue_MCH[0]  = new_ue_dlsch(1,8,Nsoft,MAX_TURBO_ITERATIONS_MBSFN,N_RB_DL,0);
 
   PHY_vars_eNB->lte_frame_parms.num_MBSFN_config = 1;
   PHY_vars_eNB->lte_frame_parms.MBSFN_config[0].radioframeAllocationPeriod = 0;
@@ -450,14 +454,14 @@ int main(int argc, char **argv)
       //if (trials%100==0)
       //eNB2UE[0]->first_run = 1;
       eNB2UE->first_run = 1;
-      memset(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][0][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
+      memset(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][0][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t));
 
       generate_mch(PHY_vars_eNB,sched_subframe,input_buffer,0);
 
 
       PHY_ofdm_mod(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][0],        // input,
                    txdata[0],         // output
-                   frame_parms->log2_symbol_size,                // log2_fft_size
+                   frame_parms->ofdm_symbol_size,
                    LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb,                 // number of symbols
                    frame_parms->nb_prefix_samples,               // number of prefix samples
                    CYCLIC_PREFIX);
@@ -536,11 +540,25 @@ int main(int argc, char **argv)
 	    }
 	  }
 	}
-	
-	rx_pmch(PHY_vars_UE,
-                0,
-                subframe%10,
-                l);
+
+	if (l==6)
+          for (l2=2;l2<7;l2++)
+	    rx_pmch(PHY_vars_UE,
+		    0,
+		    subframe%10,
+		    l2);
+	if (l==6)
+          for (l2=2;l2<7;l2++)
+	    rx_pmch(PHY_vars_UE,
+		    0,
+		    subframe%10,
+		    l2);
+	if (l==11)
+          for (l2=7;l2<12;l2++)
+	    rx_pmch(PHY_vars_UE,
+		    0,
+		    subframe%10,
+		    l2);
       }
 
       PHY_vars_UE->dlsch_ue_MCH[0]->harq_processes[0]->G = get_G(&PHY_vars_UE->lte_frame_parms,
@@ -581,10 +599,10 @@ int main(int argc, char **argv)
               mcs,N_RB_DL,mcs,N_RB_DL,errs[0],
               mcs,N_RB_DL,mcs,N_RB_DL,trials);
     else
-      fprintf(fd,"SNR_awgn_%d = [SNR_awgn_%d %d]; errs_mch_awgn_%d =[errs_mch_awgn_%f  %d]; mch_trials_awgn_%d =[mch_trials_awgn_%d %d];\n",
-              mcs,N_RB_DL,mcs,N_RB_DL,SNR,
-              mcs,N_RB_DL,mcs,N_RB_DL,errs[0],
-              mcs,N_RB_DL,mcs,N_RB_DL,trials);
+      fprintf(fd,"SNR_awgn_%d = [SNR_awgn_%d %f]; errs_mch_awgn_%d =[errs_mch_awgn_%d  %d]; mch_trials_awgn_%d =[mch_trials_awgn_%d %d];\n",
+              N_RB_DL,N_RB_DL,SNR,
+              N_RB_DL,N_RB_DL,errs[0],
+              N_RB_DL,N_RB_DL,trials);
 
     fflush(fd);
 
diff --git a/openair1/SIMULATION/LTE_PHY/pbchsim.c b/openair1/SIMULATION/LTE_PHY/pbchsim.c
index b7f9f57b6bb1539b5b150dfb9dd5f51d3275f597..4a2b3f935120036e29ed1405f4a865720123e98d 100644
--- a/openair1/SIMULATION/LTE_PHY/pbchsim.c
+++ b/openair1/SIMULATION/LTE_PHY/pbchsim.c
@@ -38,7 +38,6 @@
 #include "PHY/types.h"
 #include "PHY/defs.h"
 #include "PHY/vars.h"
-#include "MAC_INTERFACE/vars.h"
 
 #ifdef EMOS
 #include "SCHED/phy_procedures_emos.h"
@@ -53,92 +52,16 @@
 
 #include "OCG_vars.h"
 
-PHY_VARS_eNB *PHY_vars_eNb,*PHY_vars_eNb1,*PHY_vars_eNb2;
+PHY_VARS_eNB *PHY_vars_eNB,*PHY_vars_eNB1,*PHY_vars_eNB2;
 PHY_VARS_UE *PHY_vars_UE;
 
 #define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13
 
-void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,unsigned char extended_prefix_flag,unsigned char frame_type, uint16_t Nid_cell,uint8_t N_RB_DL,uint8_t osf)
-{
-
-  //  unsigned int ind;
-  LTE_DL_FRAME_PARMS *lte_frame_parms;
-  int i;
-
-  printf("Start lte_param_init\n");
-  PHY_vars_eNb = malloc(sizeof(PHY_VARS_eNB));
-  PHY_vars_eNb1 = malloc(sizeof(PHY_VARS_eNB));
-  PHY_vars_eNb2 = malloc(sizeof(PHY_VARS_eNB));
-
-  PHY_vars_UE = malloc(sizeof(PHY_VARS_UE));
-  //PHY_config = malloc(sizeof(PHY_CONFIG));
-  mac_xface = malloc(sizeof(MAC_xface));
-
-  randominit(0);
-  set_taus_seed(0);
-
-  lte_frame_parms = &(PHY_vars_eNb->lte_frame_parms);
-
-  lte_frame_parms->N_RB_DL            = N_RB_DL;   //50 for 10MHz and 25 for 5 MHz
-  lte_frame_parms->N_RB_UL            = N_RB_DL;
-  lte_frame_parms->Ncp                = extended_prefix_flag;
-  lte_frame_parms->Nid_cell           = Nid_cell;
-  lte_frame_parms->nushift            = Nid_cell%6;
-  lte_frame_parms->nb_antennas_tx     = N_tx;
-  lte_frame_parms->nb_antennas_tx_eNB = N_tx;
-  lte_frame_parms->nb_antennas_rx     = N_rx;
-  //  lte_frame_parms->Csrs = 2;
-  //  lte_frame_parms->Bsrs = 0;
-  //  lte_frame_parms->kTC = 0;
-  //  lte_frame_parms->n_RRC = 0;
-  lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0;
-  lte_frame_parms->tdd_config = 3;
-  lte_frame_parms->frame_type = frame_type;
-  init_frame_parms(lte_frame_parms,osf);
-
-  //copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing));
-
-  PHY_vars_UE->lte_frame_parms = *lte_frame_parms;
-
-  phy_init_lte_top(lte_frame_parms);
-
-  PHY_vars_UE->PHY_measurements.n_adj_cells=2;
-  PHY_vars_UE->PHY_measurements.adj_cell_id[0] = Nid_cell+1;
-  PHY_vars_UE->PHY_measurements.adj_cell_id[1] = Nid_cell+2;
-
-  for (i=0; i<3; i++)
-    lte_gold(lte_frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i);
-
-  phy_init_lte_ue(PHY_vars_UE,1,0);
-
-  phy_init_lte_eNB(PHY_vars_eNb,0,0,0);
-
-  memcpy((void*)&PHY_vars_eNb1->lte_frame_parms,(void*)&PHY_vars_eNb->lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS));
-  PHY_vars_eNb1->lte_frame_parms.Nid_cell=Nid_cell+1;
-  PHY_vars_eNb1->lte_frame_parms.nushift=(Nid_cell+1)%6;
-  PHY_vars_eNb1->Mod_id=1;
-
-  memcpy((void*)&PHY_vars_eNb2->lte_frame_parms,(void*)&PHY_vars_eNb->lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS));
-  PHY_vars_eNb2->lte_frame_parms.Nid_cell=Nid_cell+2;
-  PHY_vars_eNb2->lte_frame_parms.nushift=(Nid_cell+2)%6;
-  PHY_vars_eNb2->Mod_id=2;
-
-  phy_init_lte_eNB(PHY_vars_eNb1,0,0,0);
-
-  phy_init_lte_eNB(PHY_vars_eNb2,0,0,0);
-
-  phy_init_lte_top(lte_frame_parms);
-
-  printf("Done lte_param_init\n");
-
-
-}
-
-mod_sym_t *dummybuf[4];
-mod_sym_t dummy0[2048*14];
-mod_sym_t dummy1[2048*14];
-mod_sym_t dummy2[2048*14];
-mod_sym_t dummy3[2048*14];
+int32_t *dummybuf[4];
+int32_t dummy0[2048*14];
+int32_t dummy1[2048*14];
+int32_t dummy2[2048*14];
+int32_t dummy3[2048*14];
 
 
 int main(int argc, char **argv)
@@ -149,16 +72,15 @@ int main(int argc, char **argv)
   int i,l,aa;
   double sigma2, sigma2_dB=0,SNR,snr0=-2.0,snr1;
   uint8_t snr1set=0;
-  //mod_sym_t **txdataF;
   int **txdata,**txdata1,**txdata2;
   double **s_re,**s_im,**s_re1,**s_im1,**s_re2,**s_im2,**r_re,**r_im,**r_re1,**r_im1,**r_re2,**r_im2;
   double iqim = 0.0;
   unsigned char pbch_pdu[6];
   //  int sync_pos, sync_pos_slot;
   //  FILE *rx_frame_file;
-  FILE *output_fd;
+  FILE *output_fd = NULL;
   uint8_t write_output_file=0;
-  int result;
+  //int result;
   int freq_offset;
   //  int subframe_offset;
   //  char fname[40], vname[40];
@@ -167,8 +89,8 @@ int main(int argc, char **argv)
   uint16_t Nid_cell=0;
 
   int n_frames=1;
-  channel_desc_t *eNB2UE,*eNB2UE1,*eNB2UE2;
-  uint32_t nsymb,tx_lev,tx_lev1,tx_lev2;
+  channel_desc_t *eNB2UE,*eNB2UE1 = NULL,*eNB2UE2 = NULL;
+  uint32_t nsymb,tx_lev,tx_lev1 = 0,tx_lev2 = 0;
   uint8_t extended_prefix_flag=0;
   int8_t interf1=-21,interf2=-21;
   LTE_DL_FRAME_PARMS *frame_parms;
@@ -180,12 +102,12 @@ int main(int argc, char **argv)
   char input_val_str[50],input_val_str2[50];
   //  double input_val1,input_val2;
   //  uint16_t amask=0;
-  uint8_t frame_mod4,num_pdcch_symbols;
+  uint8_t frame_mod4,num_pdcch_symbols = 0;
   uint16_t NB_RB=25;
 
   SCM_t channel_model=AWGN;//Rayleigh1_anticorr;
 
-  DCI_ALLOC_t dci_alloc[8];
+  //DCI_ALLOC_t dci_alloc[8];
   uint8_t abstraction_flag=0;//,calibration_flag=0;
   double pbch_sinr;
   int pbch_tx_ant;
@@ -420,6 +342,28 @@ int main(int argc, char **argv)
 
   lte_param_init(n_tx,n_rx,transmission_mode,extended_prefix_flag,frame_type,Nid_cell,N_RB_DL,osf);
 
+  PHY_vars_eNB1 = malloc(sizeof(PHY_VARS_eNB));
+  PHY_vars_eNB2 = malloc(sizeof(PHY_VARS_eNB));
+  PHY_vars_UE->PHY_measurements.n_adj_cells=2;
+  PHY_vars_UE->PHY_measurements.adj_cell_id[0] = Nid_cell+1;
+  PHY_vars_UE->PHY_measurements.adj_cell_id[1] = Nid_cell+2;
+
+  for (i=0; i<3; i++)
+    lte_gold(&PHY_vars_eNB->lte_frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i);
+
+  memcpy((void*)&PHY_vars_eNB1->lte_frame_parms,(void*)&PHY_vars_eNB->lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS));
+  PHY_vars_eNB1->lte_frame_parms.Nid_cell=Nid_cell+1;
+  PHY_vars_eNB1->lte_frame_parms.nushift=(Nid_cell+1)%6;
+  PHY_vars_eNB1->Mod_id=1;
+
+  memcpy((void*)&PHY_vars_eNB2->lte_frame_parms,(void*)&PHY_vars_eNB->lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS));
+  PHY_vars_eNB2->lte_frame_parms.Nid_cell=Nid_cell+2;
+  PHY_vars_eNB2->lte_frame_parms.nushift=(Nid_cell+2)%6;
+  PHY_vars_eNB2->Mod_id=2;
+
+  phy_init_lte_eNB(PHY_vars_eNB1,0,0,0);
+  phy_init_lte_eNB(PHY_vars_eNB2,0,0,0);
+
 #ifdef XFORMS
   fl_initialize (&argc, argv, NULL, 0, 0);
   form_ue = create_lte_phy_scope_ue();
@@ -436,13 +380,13 @@ int main(int argc, char **argv)
 
   printf("SNR0 %f, SNR1 %f\n",snr0,snr1);
 
-  frame_parms = &PHY_vars_eNb->lte_frame_parms;
+  frame_parms = &PHY_vars_eNB->lte_frame_parms;
 
 
 
-  txdata = PHY_vars_eNb->lte_eNB_common_vars.txdata[0];
-  txdata1 = PHY_vars_eNb1->lte_eNB_common_vars.txdata[0];
-  txdata2 = PHY_vars_eNb2->lte_eNB_common_vars.txdata[0];
+  txdata = PHY_vars_eNB->lte_eNB_common_vars.txdata[0];
+  txdata1 = PHY_vars_eNB1->lte_eNB_common_vars.txdata[0];
+  txdata2 = PHY_vars_eNB2->lte_eNB_common_vars.txdata[0];
 
 
   s_re = malloc(2*sizeof(double*));
@@ -463,8 +407,8 @@ int main(int argc, char **argv)
   printf("FFT Size %d, Extended Prefix %d, Samples per subframe %d, Symbols per subframe %d, interf (%d,%d)\n",NUMBER_OF_OFDM_CARRIERS,
          frame_parms->Ncp,frame_parms->samples_per_tti,nsymb,interf1,interf2);
 
-  printf("PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0][0] = %p\n",
-         PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0][0]);
+  printf("PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0][0] = %p\n",
+         PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0][0]);
 
 
   DLSCH_alloc_pdu2.rah              = 0;
@@ -479,31 +423,31 @@ int main(int argc, char **argv)
   // Forget second codeword
   DLSCH_alloc_pdu2.tpmi             = (transmission_mode==6 ? 5 : 0) ;  // precoding
 
-  eNB2UE = new_channel_desc_scm(PHY_vars_eNb->lte_frame_parms.nb_antennas_tx,
+  eNB2UE = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx,
                                 PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
                                 channel_model,
- 				N_RB2sampling_rate(PHY_vars_eNb->lte_frame_parms.N_RB_DL),
-				N_RB2channel_bandwidth(PHY_vars_eNb->lte_frame_parms.N_RB_DL),
+ 				N_RB2sampling_rate(PHY_vars_eNB->lte_frame_parms.N_RB_DL),
+				N_RB2channel_bandwidth(PHY_vars_eNB->lte_frame_parms.N_RB_DL),
                                 0,
                                 0,
                                 0);
 
   if (interf1>-20)
-    eNB2UE1 = new_channel_desc_scm(PHY_vars_eNb->lte_frame_parms.nb_antennas_tx,
+    eNB2UE1 = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx,
                                    PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
                                    channel_model,
-				   N_RB2sampling_rate(PHY_vars_eNb->lte_frame_parms.N_RB_DL),
-				   N_RB2channel_bandwidth(PHY_vars_eNb->lte_frame_parms.N_RB_DL),
+				   N_RB2sampling_rate(PHY_vars_eNB->lte_frame_parms.N_RB_DL),
+				   N_RB2channel_bandwidth(PHY_vars_eNB->lte_frame_parms.N_RB_DL),
                                    0,
                                    4,
                                    0);
 
   if (interf2>-20)
-    eNB2UE2 = new_channel_desc_scm(PHY_vars_eNb->lte_frame_parms.nb_antennas_tx,
+    eNB2UE2 = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx,
                                    PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
                                    channel_model,
-				   N_RB2sampling_rate(PHY_vars_eNb->lte_frame_parms.N_RB_DL),
-				   N_RB2channel_bandwidth(PHY_vars_eNb->lte_frame_parms.N_RB_DL),
+				   N_RB2sampling_rate(PHY_vars_eNB->lte_frame_parms.N_RB_DL),
+				   N_RB2channel_bandwidth(PHY_vars_eNB->lte_frame_parms.N_RB_DL),
                                    0,
                                    8,
                                    0);
@@ -567,47 +511,47 @@ int main(int argc, char **argv)
     pbch_pdu[1]=1;
     pbch_pdu[2]=0;
 
-    if (PHY_vars_eNb->lte_frame_parms.frame_type == 0) {
-      generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
+    if (PHY_vars_eNB->lte_frame_parms.frame_type == 0) {
+      generate_pss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
                    AMP,
-                   &PHY_vars_eNb->lte_frame_parms,
-                   (PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 6 : 5,
+                   &PHY_vars_eNB->lte_frame_parms,
+                   (PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 6 : 5,
                    0);
-      generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
+      generate_sss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
                    AMP,
-                   &PHY_vars_eNb->lte_frame_parms,
-                   (PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 5 : 4,
+                   &PHY_vars_eNB->lte_frame_parms,
+                   (PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 5 : 4,
                    0);
-      generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
+      generate_pss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
                    AMP,
-                   &PHY_vars_eNb->lte_frame_parms,
-                   (PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 6 : 5,
+                   &PHY_vars_eNB->lte_frame_parms,
+                   (PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 6 : 5,
                    10);
-      generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
+      generate_sss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
                    AMP,
-                   &PHY_vars_eNb->lte_frame_parms,
-                   (PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 5 : 4,
+                   &PHY_vars_eNB->lte_frame_parms,
+                   (PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 5 : 4,
                    10);
 
     } else {
-      generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
+      generate_sss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
                    AMP,
-                   &PHY_vars_eNb->lte_frame_parms,
-                   (PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 6 : 5,
+                   &PHY_vars_eNB->lte_frame_parms,
+                   (PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 6 : 5,
                    1);
-      generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
+      generate_pss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
                    AMP,
-                   &PHY_vars_eNb->lte_frame_parms,
+                   &PHY_vars_eNB->lte_frame_parms,
                    2,
                    2);
-      generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
+      generate_sss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
                    AMP,
-                   &PHY_vars_eNb->lte_frame_parms,
-                   (PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 6 : 5,
+                   &PHY_vars_eNB->lte_frame_parms,
+                   (PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 6 : 5,
                    11);
-      generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
+      generate_pss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
                    AMP,
-                   &PHY_vars_eNb->lte_frame_parms,
+                   &PHY_vars_eNB->lte_frame_parms,
                    2,
                    12);
 
@@ -626,11 +570,11 @@ int main(int argc, char **argv)
     dci_alloc[1].rnti       = 0x1234;
     */
 
-    printf("Generating PBCH for mode1_flag = %d\n", PHY_vars_eNb->lte_frame_parms.mode1_flag);
+    printf("Generating PBCH for mode1_flag = %d\n", PHY_vars_eNB->lte_frame_parms.mode1_flag);
 
 
-    generate_pilots(PHY_vars_eNb,
-                    PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
+    generate_pilots(PHY_vars_eNB,
+                    PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
                     AMP,
                     LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
 
@@ -641,8 +585,8 @@ int main(int argc, char **argv)
            dci_alloc,
            0,
            1024,
-           &PHY_vars_eNb->lte_frame_parms,
-           PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
+           &PHY_vars_eNB->lte_frame_parms,
+           PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
            0);
     */
 
@@ -657,47 +601,47 @@ int main(int argc, char **argv)
       dummybuf[1] = dummy1;
       dummybuf[2] = dummy2;
       dummybuf[3] = dummy3;
-      generate_pbch(&PHY_vars_eNb->lte_eNB_pbch,
-                    (mod_sym_t**)dummybuf,
+      generate_pbch(&PHY_vars_eNB->lte_eNB_pbch,
+                    (int32_t**)dummybuf,
                     AMP,
-                    &PHY_vars_eNb->lte_frame_parms,
+                    &PHY_vars_eNB->lte_frame_parms,
                     pbch_pdu,
                     0);
     }
 
-    generate_pbch(&PHY_vars_eNb->lte_eNB_pbch,
-                  PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
+    generate_pbch(&PHY_vars_eNB->lte_eNB_pbch,
+                  PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
                   AMP,
-                  &PHY_vars_eNb->lte_frame_parms,
+                  &PHY_vars_eNB->lte_frame_parms,
                   pbch_pdu,
                   pbch_phase);
     /*
-    generate_pbch(&PHY_vars_eNb->lte_eNB_pbch,
-      PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
+    generate_pbch(&PHY_vars_eNB->lte_eNB_pbch,
+      PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
       AMP,
-      &PHY_vars_eNb->lte_frame_parms,
+      &PHY_vars_eNB->lte_frame_parms,
       pbch_pdu,
       1);
     */
 
     if (interf1>-20) {
       /*
-      generate_pss(PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0],
+      generate_pss(PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0],
        AMP,
-       &PHY_vars_eNb1->lte_frame_parms,
-       (PHY_vars_eNb1->lte_frame_parms.Ncp==0)?6:5,
+       &PHY_vars_eNB1->lte_frame_parms,
+       (PHY_vars_eNB1->lte_frame_parms.Ncp==0)?6:5,
        0);
       */
-      generate_pilots(PHY_vars_eNb1,
-                      PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0],
+      generate_pilots(PHY_vars_eNB1,
+                      PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0],
                       AMP,
                       LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
 
 
-      generate_pbch(&PHY_vars_eNb1->lte_eNB_pbch,
-                    PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0],
+      generate_pbch(&PHY_vars_eNB1->lte_eNB_pbch,
+                    PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0],
                     AMP,
-                    &PHY_vars_eNb1->lte_frame_parms,
+                    &PHY_vars_eNB1->lte_frame_parms,
                     pbch_pdu,
                     0);
 
@@ -705,26 +649,26 @@ int main(int argc, char **argv)
 
     if (interf2>-20) {
       /*
-      generate_pss(PHY_vars_eNb2->lte_eNB_common_vars.txdataF[0],
+      generate_pss(PHY_vars_eNB2->lte_eNB_common_vars.txdataF[0],
        AMP,
-       &PHY_vars_eNb2->lte_frame_parms,
-       (PHY_vars_eNb2->lte_frame_parms.Ncp==0)?6:5,
+       &PHY_vars_eNB2->lte_frame_parms,
+       (PHY_vars_eNB2->lte_frame_parms.Ncp==0)?6:5,
        0);
 
       */
 
 
 
-      generate_pilots(PHY_vars_eNb2,
-                      PHY_vars_eNb2->lte_eNB_common_vars.txdataF[0],
+      generate_pilots(PHY_vars_eNB2,
+                      PHY_vars_eNB2->lte_eNB_common_vars.txdataF[0],
                       AMP,
                       LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
 
 
-      generate_pbch(&PHY_vars_eNb2->lte_eNB_pbch,
-                    PHY_vars_eNb2->lte_eNB_common_vars.txdataF[0],
+      generate_pbch(&PHY_vars_eNB2->lte_eNB_pbch,
+                    PHY_vars_eNB2->lte_eNB_common_vars.txdataF[0],
                     AMP,
-                    &PHY_vars_eNb2->lte_frame_parms,
+                    &PHY_vars_eNB2->lte_frame_parms,
                     pbch_pdu,
                     0);
 
@@ -733,10 +677,10 @@ int main(int argc, char **argv)
 
     //  write_output("pilotsF.m","rsF",txdataF[0],lte_frame_parms->ofdm_symbol_size,1,1);
 
-    write_output("txsigF0.m","txsF0", PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
+    write_output("txsigF0.m","txsF0", PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
 
-    if (PHY_vars_eNb->lte_frame_parms.nb_antennas_tx>1)
-      write_output("txsigF1.m","txsF1", PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][1],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
+    if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx>1)
+      write_output("txsigF1.m","txsF1", PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][1],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
 
     tx_lev = 0;
     tx_lev1 = 0;
@@ -745,16 +689,16 @@ int main(int argc, char **argv)
 
 
 
-    for (aa=0; aa<PHY_vars_eNb->lte_frame_parms.nb_antennas_tx; aa++) {
+    for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx; aa++) {
       if (frame_parms->Ncp == 1)
-        PHY_ofdm_mod(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][aa],        // input,
+        PHY_ofdm_mod(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][aa],        // input,
                      txdata[aa],         // output
-                     frame_parms->log2_symbol_size,                // log2_fft_size
+                     frame_parms->ofdm_symbol_size,
                      LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb,                 // number of symbols
                      frame_parms->nb_prefix_samples,               // number of prefix samples
                      CYCLIC_PREFIX);
       else {
-        normal_prefix_mod(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][aa],
+        normal_prefix_mod(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][aa],
                           txdata[aa],
                           LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb,
                           frame_parms);
@@ -765,17 +709,17 @@ int main(int argc, char **argv)
     }
 
     if (interf1>-20) {
-      for (aa=0; aa<PHY_vars_eNb1->lte_frame_parms.nb_antennas_tx; aa++) {
+      for (aa=0; aa<PHY_vars_eNB1->lte_frame_parms.nb_antennas_tx; aa++) {
         if (frame_parms->Ncp == 1)
-          PHY_ofdm_mod(PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0][aa],        // input,
-                       PHY_vars_eNb1->lte_eNB_common_vars.txdata[0][aa],         // output
-                       frame_parms->log2_symbol_size,                // log2_fft_size
+          PHY_ofdm_mod(PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0][aa],        // input,
+                       PHY_vars_eNB1->lte_eNB_common_vars.txdata[0][aa],         // output
+                       frame_parms->ofdm_symbol_size,
                        2*nsymb,                 // number of symbols
                        frame_parms->nb_prefix_samples,               // number of prefix samples
                        CYCLIC_PREFIX);
         else {
-          normal_prefix_mod(PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0][aa],
-                            PHY_vars_eNb1->lte_eNB_common_vars.txdata[0][aa],
+          normal_prefix_mod(PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0][aa],
+                            PHY_vars_eNB1->lte_eNB_common_vars.txdata[0][aa],
                             2*nsymb,
                             frame_parms);
         }
@@ -784,24 +728,24 @@ int main(int argc, char **argv)
                                  OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES);
       }
 
-      write_output("txsigF0_1.m","txsF0_1", PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0][0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
+      write_output("txsigF0_1.m","txsF0_1", PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0][0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
 
-      if (PHY_vars_eNb1->lte_frame_parms.nb_antennas_tx>1)
-        write_output("txsigF1_1.m","txsF1_1", PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0][1],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
+      if (PHY_vars_eNB1->lte_frame_parms.nb_antennas_tx>1)
+        write_output("txsigF1_1.m","txsF1_1", PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0][1],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
     }
 
     if (interf2>-20) {
-      for (aa=0; aa<PHY_vars_eNb2->lte_frame_parms.nb_antennas_tx; aa++) {
+      for (aa=0; aa<PHY_vars_eNB2->lte_frame_parms.nb_antennas_tx; aa++) {
         if (frame_parms->Ncp == 1)
-          PHY_ofdm_mod(PHY_vars_eNb2->lte_eNB_common_vars.txdataF[0][aa],        // input,
-                       PHY_vars_eNb2->lte_eNB_common_vars.txdata[0][aa],         // output
-                       frame_parms->log2_symbol_size,                // log2_fft_size
+          PHY_ofdm_mod(PHY_vars_eNB2->lte_eNB_common_vars.txdataF[0][aa],        // input,
+                       PHY_vars_eNB2->lte_eNB_common_vars.txdata[0][aa],         // output
+                       frame_parms->ofdm_symbol_size,
                        2*nsymb,                 // number of symbols
                        frame_parms->nb_prefix_samples,               // number of prefix samples
                        CYCLIC_PREFIX);
         else {
-          normal_prefix_mod(PHY_vars_eNb2->lte_eNB_common_vars.txdataF[0][aa],
-                            PHY_vars_eNb2->lte_eNB_common_vars.txdata[0][aa],
+          normal_prefix_mod(PHY_vars_eNB2->lte_eNB_common_vars.txdataF[0][aa],
+                            PHY_vars_eNB2->lte_eNB_common_vars.txdata[0][aa],
                             2*nsymb,
                             frame_parms);
         }
@@ -810,10 +754,10 @@ int main(int argc, char **argv)
                                  OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES);
       }
 
-      write_output("txsigF0_2.m","txsF0_2", PHY_vars_eNb2->lte_eNB_common_vars.txdataF[0][0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
+      write_output("txsigF0_2.m","txsF0_2", PHY_vars_eNB2->lte_eNB_common_vars.txdataF[0][0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
 
-      if (PHY_vars_eNb2->lte_frame_parms.nb_antennas_tx>1)
-        write_output("txsigF1_2.m","txsF1_2", PHY_vars_eNb2->lte_eNB_common_vars.txdataF[0][1],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
+      if (PHY_vars_eNB2->lte_frame_parms.nb_antennas_tx>1)
+        write_output("txsigF1_2.m","txsF1_2", PHY_vars_eNB2->lte_eNB_common_vars.txdataF[0][1],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
     }
 
     //    tx_lev_dB = (unsigned int) dB_fixed(tx_lev);
@@ -823,20 +767,23 @@ int main(int argc, char **argv)
     if (frame_parms->nb_antennas_tx>1)
       write_output("txsig1.m","txs1", txdata[1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
 
-    write_output("txsig0_1.m","txs0_1", PHY_vars_eNb1->lte_eNB_common_vars.txdata[0][0],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
+    write_output("txsig0_1.m","txs0_1", PHY_vars_eNB1->lte_eNB_common_vars.txdata[0][0],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
 
     if (frame_parms->nb_antennas_tx>1)
-      write_output("txsig1_1.m","txs1_1", PHY_vars_eNb1->lte_eNB_common_vars.txdata[0][1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
+      write_output("txsig1_1.m","txs1_1", PHY_vars_eNB1->lte_eNB_common_vars.txdata[0][1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
 
-    write_output("txsig0_2.m","txs0_2", PHY_vars_eNb2->lte_eNB_common_vars.txdata[0][0],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
+    write_output("txsig0_2.m","txs0_2", PHY_vars_eNB2->lte_eNB_common_vars.txdata[0][0],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
 
     if (frame_parms->nb_antennas_tx>1)
-      write_output("txsig1_2.m","txs1_2", PHY_vars_eNb2->lte_eNB_common_vars.txdata[0][1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
+      write_output("txsig1_2.m","txs1_2", PHY_vars_eNB2->lte_eNB_common_vars.txdata[0][1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
   } else { //read in from file
     i=0;
 
     while (!feof(input_fd)) {
-      fscanf(input_fd,"%s %s",input_val_str,input_val_str2);//&input_val1,&input_val2);
+      if (fscanf(input_fd,"%s %s",input_val_str,input_val_str2) != 2) { //&input_val1,&input_val2);
+        printf("%s:%d:%s: error with fscanf, exiting\n", __FILE__, __LINE__, __FUNCTION__);
+        exit(1);
+      }
 
       if ((i%4)==0) {
         ((short*)txdata[0])[i/2] = (short)((1<<15)*strtod(input_val_str,NULL));
@@ -864,7 +811,7 @@ int main(int argc, char **argv)
   // multipath channel
 
   for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
-    for (aa=0; aa<PHY_vars_eNb->lte_frame_parms.nb_antennas_tx; aa++) {
+    for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx; aa++) {
       s_re[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)]);
       s_im[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)+1]);
 
@@ -925,7 +872,7 @@ int main(int argc, char **argv)
         }
       }
 
-      sigma2_dB = 10*log10((double)tx_lev) +10*log10((double)PHY_vars_eNb->lte_frame_parms.ofdm_symbol_size/(double)(12*NB_RB)) - SNR;
+      sigma2_dB = 10*log10((double)tx_lev) +10*log10((double)PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size/(double)(12*NB_RB)) - SNR;
 
       if (n_frames==1)
         printf("sigma2_dB %f (SNR %f dB) tx_lev_dB %f,%f,%f\n",sigma2_dB,SNR,
@@ -947,7 +894,7 @@ int main(int argc, char **argv)
       for (n_trials=0; n_trials<ntrials; n_trials++) {
         //printf("n_trial %d\n",n_trials);
         for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
-          for (aa=0; aa<PHY_vars_eNb->lte_frame_parms.nb_antennas_rx; aa++) {
+          for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_rx; aa++) {
             if (n_trials==0) {
               r_re[aa][i] += (pow(10.0,.05*interf1)*r_re1[aa][i] + pow(10.0,.05*interf2)*r_re2[aa][i]);
               r_im[aa][i] += (pow(10.0,.05*interf1)*r_im1[aa][i] + pow(10.0,.05*interf2)*r_im2[aa][i]);
@@ -983,14 +930,14 @@ int main(int argc, char **argv)
         */
 
 
-        for (l=0; l<PHY_vars_eNb->lte_frame_parms.symbols_per_tti; l++) {
+        for (l=0; l<PHY_vars_eNB->lte_frame_parms.symbols_per_tti; l++) {
 
-          //    subframe_offset = (l/PHY_vars_eNb->lte_frame_parms.symbols_per_tti)*PHY_vars_eNb->lte_frame_parms.samples_per_tti;
+          //    subframe_offset = (l/PHY_vars_eNB->lte_frame_parms.symbols_per_tti)*PHY_vars_eNB->lte_frame_parms.samples_per_tti;
           //      printf("subframe_offset = %d\n",subframe_offset);
 
           slot_fep(PHY_vars_UE,
-                   l%(PHY_vars_eNb->lte_frame_parms.symbols_per_tti/2),
-                   l/(PHY_vars_eNb->lte_frame_parms.symbols_per_tti/2),
+                   l%(PHY_vars_eNB->lte_frame_parms.symbols_per_tti/2),
+                   l/(PHY_vars_eNB->lte_frame_parms.symbols_per_tti/2),
                    0,
                    0,
 		   0);
@@ -1026,7 +973,7 @@ int main(int argc, char **argv)
             */
           }
 
-          if (l==((PHY_vars_eNb->lte_frame_parms.Ncp==0)?4:3)) {
+          if (l==((PHY_vars_eNB->lte_frame_parms.Ncp==0)?4:3)) {
             //sprintf(fname,"dl_ch00_%d.m",l);
             //sprintf(vname,"dl_ch00_%d",l);
             //write_output(fname,vname,&(lte_ue_common_vars->dl_ch_estimates[0][lte_frame_parms->ofdm_symbol_size*(l%6)]),lte_frame_parms->ofdm_symbol_size,1,1);
@@ -1038,7 +985,7 @@ int main(int argc, char **argv)
 				1);
           }
 
-          if (l==((PHY_vars_eNb->lte_frame_parms.Ncp==0)?10:9)) {
+          if (l==((PHY_vars_eNB->lte_frame_parms.Ncp==0)?10:9)) {
 
             for (frame_mod4=0; frame_mod4<4; frame_mod4++) {
               pbch_tx_ant = rx_pbch(&PHY_vars_UE->lte_ue_common_vars,
@@ -1059,7 +1006,7 @@ int main(int argc, char **argv)
 
               pbch_tx_ant = rx_pbch(&PHY_vars_UE->lte_ue_common_vars,
                                     PHY_vars_UE->lte_ue_pbch_vars[0],
-                                    &PHY_vars_eNb->lte_frame_parms,
+                                    &PHY_vars_eNB->lte_frame_parms,
                                     0,
                                     ALAMOUTI,
                                     PHY_vars_UE->high_speed_flag,
@@ -1119,10 +1066,10 @@ int main(int argc, char **argv)
 
   if (n_frames==1) {
 
-    write_output("H00.m","h00",&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[0][0][0]),((frame_parms->Ncp==0)?7:6)*(PHY_vars_eNb->lte_frame_parms.ofdm_symbol_size),1,1);
+    write_output("H00.m","h00",&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[0][0][0]),((frame_parms->Ncp==0)?7:6)*(PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size),1,1);
 
     if (n_tx==2)
-      write_output("H10.m","h10",&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[0][2][0]),((frame_parms->Ncp==0)?7:6)*(PHY_vars_eNb->lte_frame_parms.ofdm_symbol_size),1,1);
+      write_output("H10.m","h10",&(PHY_vars_UE->lte_ue_common_vars.dl_ch_estimates[0][2][0]),((frame_parms->Ncp==0)?7:6)*(PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size),1,1);
 
     write_output("rxsig0.m","rxs0", PHY_vars_UE->lte_ue_common_vars.rxdata[0],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
     write_output("rxsigF0.m","rxsF0", PHY_vars_UE->lte_ue_common_vars.rxdataF[0],NUMBER_OF_OFDM_CARRIERS*2*((frame_parms->Ncp==0)?14:12),2,1);
diff --git a/openair1/SIMULATION/LTE_PHY/pdcchsim.c b/openair1/SIMULATION/LTE_PHY/pdcchsim.c
index 7a361329806eb8347805d6a04637b8b823f41248..4691875d3a6c132084ef23b3a4b82f4109c80d90 100644
--- a/openair1/SIMULATION/LTE_PHY/pdcchsim.c
+++ b/openair1/SIMULATION/LTE_PHY/pdcchsim.c
@@ -34,7 +34,6 @@
 #include "PHY/types.h"
 #include "PHY/defs.h"
 #include "PHY/vars.h"
-#include "MAC_INTERFACE/vars.h"
 
 #ifdef EMOS
 #include "SCHED/phy_procedures_emos.h"
@@ -56,112 +55,20 @@ PHY_VARS_UE *PHY_vars_UE;
 
 #define UL_RB_ALLOC 0x1ff;
 #define CCCH_RB_ALLOC computeRIV(PHY_vars_eNB->lte_frame_parms.N_RB_UL,0,2)
-#define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13
-
-void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,unsigned char extended_prefix_flag,uint16_t Nid_cell,uint8_t tdd_config,uint8_t N_RB_DL,
-                    lte_frame_type_t frame_type,uint8_t osf,uint32_t perfect_ce)
-{
-
-  unsigned int i;
-  LTE_DL_FRAME_PARMS *lte_frame_parms;
-
-  printf("Start lte_param_init (Nid_cell %d, extended_prefix %d, transmission_mode %d, N_tx %d, N_rx %d)\n",
-         Nid_cell, extended_prefix_flag,transmission_mode,N_tx,N_rx);
-  PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB));
-  PHY_vars_eNB1 = malloc(sizeof(PHY_VARS_eNB));
-  PHY_vars_eNB2 = malloc(sizeof(PHY_VARS_eNB));
-
-  PHY_vars_UE = malloc(sizeof(PHY_VARS_UE));
-  //PHY_config = malloc(sizeof(PHY_CONFIG));
-  mac_xface = malloc(sizeof(MAC_xface));
-
-  randominit(0);
-  set_taus_seed(0);
-
-  lte_frame_parms = &(PHY_vars_eNB->lte_frame_parms);
-
-  lte_frame_parms->N_RB_DL            = N_RB_DL;   //50 for 10MHz and 25 for 5 MHz
-  lte_frame_parms->N_RB_UL            = N_RB_DL;
-  lte_frame_parms->Ncp                = extended_prefix_flag;
-  lte_frame_parms->Nid_cell           = Nid_cell;
-  lte_frame_parms->nushift            = Nid_cell%6;
-  lte_frame_parms->nb_antennas_tx_eNB     = N_tx;
-  lte_frame_parms->nb_antennas_tx     = N_tx;
-  lte_frame_parms->nb_antennas_rx     = N_rx;
-  lte_frame_parms->phich_config_common.phich_resource = one; //half
-  lte_frame_parms->tdd_config         = tdd_config;
-  lte_frame_parms->frame_type         = frame_type;
-
-  //  lte_frame_parms->Csrs = 2;
-  //  lte_frame_parms->Bsrs = 0;
-  //  lte_frame_parms->kTC = 0;
-  //  lte_frame_parms->n_RRC = 0;
-  lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0;
-
-  init_frame_parms(lte_frame_parms,osf);
-
-  //copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing));
-
-
-  memcpy(&PHY_vars_UE->lte_frame_parms,lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS));
-
-
-  phy_init_lte_top(lte_frame_parms);
-
-  phy_init_lte_ue(PHY_vars_UE,1,0);
-
-  phy_init_lte_eNB(PHY_vars_eNB,0,0,0);
-
-  memcpy((void*)&PHY_vars_eNB1->lte_frame_parms,(void*)&PHY_vars_eNB->lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS));
-  PHY_vars_eNB1->lte_frame_parms.nushift=(Nid_cell+1)%6;
-  PHY_vars_eNB1->lte_frame_parms.Nid_cell=Nid_cell+1;
-
-  memcpy((void*)&PHY_vars_eNB2->lte_frame_parms,(void*)&PHY_vars_eNB->lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS));
-  PHY_vars_eNB2->lte_frame_parms.nushift=(Nid_cell+2)%6;
-  PHY_vars_eNB2->lte_frame_parms.Nid_cell=Nid_cell+2;
-
-  phy_init_lte_eNB(PHY_vars_eNB1,0,0,0);
-
-  phy_init_lte_eNB(PHY_vars_eNB2,0,0,0);
-
-  phy_init_lte_top(lte_frame_parms);
-
-  PHY_vars_UE->PHY_measurements.n_adj_cells=2;
-  PHY_vars_UE->PHY_measurements.adj_cell_id[0] = Nid_cell+1;
-  PHY_vars_UE->PHY_measurements.adj_cell_id[1] = Nid_cell+2;
-  PHY_vars_UE->perfect_ce = perfect_ce;
-
-  for (i=0; i<3; i++)
-    lte_gold(lte_frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i);
-
-  generate_pcfich_reg_mapping(&PHY_vars_UE->lte_frame_parms);
-  generate_phich_reg_mapping(&PHY_vars_UE->lte_frame_parms);
-
-  printf("Done lte_param_init\n");
-
-  CCCH_alloc_pdu.type               = 1;
-  CCCH_alloc_pdu.vrb_type           = 0;
-  CCCH_alloc_pdu.rballoc            = CCCH_RB_ALLOC;
-  CCCH_alloc_pdu.ndi      = 1;
-  CCCH_alloc_pdu.mcs      = 1;
-  CCCH_alloc_pdu.harq_pid = 0;
-
-}
-
-
+#define DLSCH_RB_ALLOC ((uint16_t)0x1fbf) // igore DC component,RB13
 
 DCI_PDU DCI_pdu;
 
 DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2Lcommon, uint8_t format_selector, uint32_t rnti)
 {
-  uint8_t BCCH_alloc_pdu[8];
-  uint8_t DLSCH_alloc_pdu[8];
-  uint8_t UL_alloc_pdu[8];
+  uint32_t BCCH_alloc_pdu[2];
+  uint32_t DLSCH_alloc_pdu[2];
+  uint32_t UL_alloc_pdu[2];
 
   int i;
-  int dci_length_bytes,dci_length;
-  int BCCH_pdu_size_bits, BCCH_pdu_size_bytes;
-  int UL_pdu_size_bits, UL_pdu_size_bytes;
+  int dci_length_bytes=0,dci_length=0;
+  int BCCH_pdu_size_bits=0, BCCH_pdu_size_bytes=0;
+  int UL_pdu_size_bits=0, UL_pdu_size_bytes=0;
   int mcs = 3;
 
   DCI_pdu.Num_ue_spec_dci = 0;
@@ -462,31 +369,31 @@ DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2
   DCI_pdu.dci_alloc[0].ra_flag    = 0;
   memcpy((void*)&DCI_pdu.dci_alloc[0].dci_pdu[0], &BCCH_alloc_pdu[0], BCCH_pdu_size_bytes);
   DCI_pdu.Num_common_dci++;
-  /*
+  if (lte_frame_parms->N_RB_DL >= 25) {
   // add ue specific dci
-  DCI_pdu.dci_alloc[1].dci_length = dci_length;
-  DCI_pdu.dci_alloc[1].L          = log2L;
-  DCI_pdu.dci_alloc[1].rnti       = rnti;
-  DCI_pdu.dci_alloc[1].format     = format1;
-  DCI_pdu.dci_alloc[1].ra_flag    = 0;
-  memcpy((void*)&DCI_pdu.dci_alloc[1].dci_pdu[0], &DLSCH_alloc_pdu[0], dci_length_bytes);
-  DCI_pdu.Num_ue_spec_dci++;
-
-
-  DCI_pdu.dci_alloc[0].dci_length = UL_pdu_size_bits;
-  DCI_pdu.dci_alloc[0].L          = log2L;
-  DCI_pdu.dci_alloc[0].rnti       = rnti;
-  DCI_pdu.dci_alloc[0].format     = format0;
-  DCI_pdu.dci_alloc[0].ra_flag    = 0;
-  memcpy((void*)&DCI_pdu.dci_alloc[0].dci_pdu[0], &UL_alloc_pdu[0], UL_pdu_size_bytes);
-  DCI_pdu.Num_ue_spec_dci++;
-  */
-  DCI_pdu.nCCE = 0;
-
-  for (i=0; i<DCI_pdu.Num_common_dci+DCI_pdu.Num_ue_spec_dci; i++) {
-    DCI_pdu.nCCE += (1<<(DCI_pdu.dci_alloc[i].L));
+    DCI_pdu.dci_alloc[1].dci_length = dci_length;
+    DCI_pdu.dci_alloc[1].L          = log2L;
+    DCI_pdu.dci_alloc[1].rnti       = rnti;
+    DCI_pdu.dci_alloc[1].format     = format1;
+    DCI_pdu.dci_alloc[1].ra_flag    = 0;
+    memcpy((void*)&DCI_pdu.dci_alloc[1].dci_pdu[0], &DLSCH_alloc_pdu[0], dci_length_bytes);
+    DCI_pdu.Num_ue_spec_dci++;
+
+    if (lte_frame_parms->N_RB_DL >= 50) {
+      DCI_pdu.dci_alloc[2].dci_length = UL_pdu_size_bits;
+      DCI_pdu.dci_alloc[2].L          = log2L;
+      DCI_pdu.dci_alloc[2].rnti       = rnti;
+      DCI_pdu.dci_alloc[2].format     = format0;
+      DCI_pdu.dci_alloc[2].ra_flag    = 0;
+      memcpy((void*)&DCI_pdu.dci_alloc[0].dci_pdu[0], &UL_alloc_pdu[0], UL_pdu_size_bytes);
+      DCI_pdu.Num_ue_spec_dci++;
+    }
   }
 
+
+
+
+  
   return(&DCI_pdu);
 }
 
@@ -499,7 +406,6 @@ int main(int argc, char **argv)
 
   int i,l,aa;
   double sigma2, sigma2_dB=0,SNR,snr0=-2.0,snr1;
-  //mod_sym_t **txdataF;
 
   int **txdata;
   double **s_re,**s_im,**r_re,**r_im;
@@ -523,10 +429,8 @@ int main(int argc, char **argv)
   uint8_t dci_cnt=0;
   LTE_DL_FRAME_PARMS *frame_parms;
   uint8_t log2L=2, log2Lcommon=2, format_selector=0;
-  uint8_t numCCE,nCCE_max,common_active=0,ul_active=0,dl_active=0;
-  uint32_t rv;
+  uint8_t numCCE,common_active=0,ul_active=0,dl_active=0;
 
-  DCI_format_t format = format1;
   uint32_t n_trials_common=0,n_trials_ul=0,n_trials_dl=0,false_detection_cnt=0;
   uint8_t common_rx,ul_rx,dl_rx;
   uint8_t tdd_config=3;
@@ -540,19 +444,19 @@ int main(int argc, char **argv)
 
   DCI_ALLOC_t dci_alloc_rx[8];
 
-  void* dlsch_pdu = NULL;
-  //  int ret;
+  int ret;
 
   uint8_t harq_pid;
   uint8_t phich_ACK;
 
   uint8_t num_phich_interf = 0;
   lte_frame_type_t frame_type=TDD;
-  int re_offset;
-  uint32_t *txptr;
+  //  int re_offset;
+  //  uint32_t *txptr;
   int aarx;
   int k;
   uint32_t perfect_ce = 0;
+  int CCE_table[800];
 
   number_of_cards = 1;
   openair_daq_vars.rx_rf_mode = 1;
@@ -798,9 +702,11 @@ int main(int argc, char **argv)
                  n_rx,
                  transmission_mode,
                  extended_prefix_flag,
+		 frame_type,
                  Nid_cell,
                  tdd_config,
-                 N_RB_DL,frame_type,
+                 N_RB_DL,
+		 0,
                  osf,
                  perfect_ce);
 
@@ -863,8 +769,8 @@ int main(int argc, char **argv)
 
 
 
-  PHY_vars_eNB->ulsch_eNB[0] = new_eNB_ulsch(8,MAX_TURBO_ITERATIONS,N_RB_DL,0);
-  PHY_vars_UE->ulsch_ue[0]   = new_ue_ulsch(8,N_RB_DL,0);
+  PHY_vars_eNB->ulsch_eNB[0] = new_eNB_ulsch(MAX_TURBO_ITERATIONS,N_RB_DL,0);
+  PHY_vars_UE->ulsch_ue[0]   = new_ue_ulsch(N_RB_DL,0);
 
 
   PHY_vars_eNB->proc[subframe].frame_tx    = 0;
@@ -876,7 +782,12 @@ int main(int argc, char **argv)
     i=0;
 
     while (!feof(input_fd)) {
-      fscanf(input_fd,"%s %s",input_val_str,input_val_str2);//&input_val1,&input_val2);
+      ret=fscanf(input_fd,"%s %s",input_val_str,input_val_str2);//&input_val1,&input_val2);
+
+      if (ret != 2) {
+        printf("%s:%d:%s: fscanf error, exiting\n", __FILE__, __LINE__, __FUNCTION__);
+        exit(1);
+      }
 
       if ((i%4)==0) {
         ((short*)txdata[0])[i/2] = (short)((1<<15)*strtod(input_val_str,NULL));
@@ -903,7 +814,7 @@ int main(int argc, char **argv)
 
   PHY_vars_UE->UE_mode[0] = PUSCH;
 
-  nCCE_max = get_nCCE(3,&PHY_vars_eNB->lte_frame_parms,get_mi(&PHY_vars_eNB->lte_frame_parms,0));
+  //  nCCE_max = get_nCCE(3,&PHY_vars_eNB->lte_frame_parms,get_mi(&PHY_vars_eNB->lte_frame_parms,0));
   //printf("nCCE_max %d\n",nCCE_max);
 
   //printf("num_phich interferers %d\n",num_phich_interf);
@@ -923,7 +834,7 @@ int main(int argc, char **argv)
 
       //    printf("DCI (SF %d): txdataF %p (0 %p)\n",subframe,&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa][512*14*subframe],&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa][0]);
       for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx_eNB; aa++) {
-        memset(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(mod_sym_t));
+        memset(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa][0],0,FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t));
 
         /*
         re_offset = PHY_vars_eNB->lte_frame_parms.first_carrier_offset;
@@ -955,55 +866,62 @@ int main(int argc, char **argv)
         numCCE=0;
         n_trials_common++;
         common_active = 1;
-        n_trials_ul++;
-        ul_active = 1;
-        n_trials_dl++;
-        dl_active = 1;
+	if (PHY_vars_eNB->lte_frame_parms.N_RB_DL >= 50) { 
+	  n_trials_ul++;
+	  ul_active = 1;
+	}
+        if (PHY_vars_eNB->lte_frame_parms.N_RB_DL >= 25) { 
+	  n_trials_dl++;
+	  dl_active = 1; 
+	}
 
-        init_nCCE_table();
         num_pdcch_symbols = get_num_pdcch_symbols(DCI_pdu.Num_common_dci+DCI_pdu.Num_ue_spec_dci,
                             DCI_pdu.dci_alloc, frame_parms, subframe);
-        DCI_pdu.nCCE = get_nCCE(num_pdcch_symbols,&PHY_vars_eNB->lte_frame_parms,get_mi(&PHY_vars_eNB->lte_frame_parms,subframe));
+	numCCE = get_nCCE(num_pdcch_symbols,&PHY_vars_eNB->lte_frame_parms,get_mi(&PHY_vars_eNB->lte_frame_parms,subframe));
 
         if (n_frames==1) {
           printf("num_dci %d, num_pddch_symbols %d, nCCE %d\n",
                  DCI_pdu.Num_common_dci+DCI_pdu.Num_ue_spec_dci,
-                 num_pdcch_symbols,
-                 DCI_pdu.nCCE);
+                 num_pdcch_symbols,numCCE);
         }
 
         // apply RNTI-based nCCE allocation
+	memset(CCE_table,0,800*sizeof(int));
+
         for (i = 0; i < DCI_pdu.Num_common_dci + DCI_pdu.Num_ue_spec_dci; i++) {
           // SI RNTI
           if (DCI_pdu.dci_alloc[i].rnti == SI_RNTI) {
-            DCI_pdu.dci_alloc[i].nCCE = get_nCCE_offset(1<<DCI_pdu.dci_alloc[i].L,
-                                        DCI_pdu.nCCE,
-                                        1,
-                                        SI_RNTI,
-                                        subframe);
+            DCI_pdu.dci_alloc[i].firstCCE = get_nCCE_offset_l1(CCE_table,
+							       1<<DCI_pdu.dci_alloc[i].L,
+							       numCCE,
+							       1,
+							       SI_RNTI,
+							       subframe);
           }
           // RA RNTI
           else if (DCI_pdu.dci_alloc[i].ra_flag == 1) {
-            DCI_pdu.dci_alloc[i].nCCE = get_nCCE_offset(1<<DCI_pdu.dci_alloc[i].L,
-                                        DCI_pdu.nCCE,
-                                        1,
-                                        DCI_pdu.dci_alloc[i].rnti,
-                                        subframe);
+            DCI_pdu.dci_alloc[i].firstCCE = get_nCCE_offset_l1(CCE_table,
+							       1<<DCI_pdu.dci_alloc[i].L,
+							       numCCE,
+							       1,
+							       DCI_pdu.dci_alloc[i].rnti,
+							       subframe);
           }
           // C RNTI
           else {
-            DCI_pdu.dci_alloc[i].nCCE = get_nCCE_offset(1<<DCI_pdu.dci_alloc[i].L,
-                                        DCI_pdu.nCCE,
-                                        0,
-                                        DCI_pdu.dci_alloc[i].rnti,
-                                        subframe);
+            DCI_pdu.dci_alloc[i].firstCCE = get_nCCE_offset_l1(CCE_table,
+							       1<<DCI_pdu.dci_alloc[i].L,
+							       numCCE,
+							       0,
+							       DCI_pdu.dci_alloc[i].rnti,
+							       subframe);
           }
 
           if (n_frames==1)
             printf("dci %d: rnti 0x%x, format %d, L %d, nCCE %d/%d dci_length %d\n",i,DCI_pdu.dci_alloc[i].rnti, DCI_pdu.dci_alloc[i].format,
-                   DCI_pdu.dci_alloc[i].L, DCI_pdu.dci_alloc[i].nCCE, DCI_pdu.nCCE, DCI_pdu.dci_alloc[i].dci_length);
+                   DCI_pdu.dci_alloc[i].L, DCI_pdu.dci_alloc[i].firstCCE, numCCE, DCI_pdu.dci_alloc[i].dci_length);
 
-          if (DCI_pdu.dci_alloc[i].nCCE==-1)
+          if (DCI_pdu.dci_alloc[i].firstCCE==-1)
             exit(-1);
         }
 
@@ -1037,7 +955,7 @@ int main(int argc, char **argv)
 
           generate_phich_top(PHY_vars_eNB,
                              subframe,AMP,0,0);
-          /*
+          
           // generate 3 interfering PHICH
           if (num_phich_interf>0) {
             PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->first_rb = 4;
@@ -1064,7 +982,7 @@ int main(int argc, char **argv)
           }
 
           PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->first_rb = 0;
-          */
+          
         }
 
         //  write_output("pilotsF.m","rsF",txdataF[0],lte_PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size,1,1);
@@ -1084,7 +1002,7 @@ int main(int argc, char **argv)
           if (PHY_vars_eNB->lte_frame_parms.Ncp == 1)
             PHY_ofdm_mod(&PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa][subframe*nsymb*PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size],        // input,
                          &txdata[aa][subframe*PHY_vars_eNB->lte_frame_parms.samples_per_tti],         // output
-                         PHY_vars_eNB->lte_frame_parms.log2_symbol_size,                // log2_fft_size
+                         PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size,
                          2*nsymb,                 // number of symbols
                          PHY_vars_eNB->lte_frame_parms.nb_prefix_samples,               // number of prefix samples
                          CYCLIC_PREFIX);
@@ -1244,7 +1162,7 @@ int main(int argc, char **argv)
 
             for (i = 0; i < dci_cnt; i++)
               printf("dci %d: rnti 0x%x, format %d, L %d, nCCE %d/%d dci_length %d\n",i, dci_alloc_rx[i].rnti, dci_alloc_rx[i].format,
-                     dci_alloc_rx[i].L, dci_alloc_rx[i].nCCE, numCCE, dci_alloc_rx[i].dci_length);
+                     dci_alloc_rx[i].L, dci_alloc_rx[i].firstCCE, numCCE, dci_alloc_rx[i].dci_length);
           }
 
           for (i=0; i<dci_cnt; i++) {
@@ -1319,8 +1237,8 @@ int main(int argc, char **argv)
     } //trials
 
     printf("SNR %f : n_errors_common = %d/%d (%e)\n", SNR,n_errors_common,n_trials_common,(double)n_errors_common/n_trials_common);
-    printf("SNR %f : n_errors_ul = %d/%d (%e)\n", SNR,n_errors_ul,n_trials_ul,(double)n_errors_ul/n_trials_ul);
-    printf("SNR %f : n_errors_dl = %d/%d (%e)\n", SNR,n_errors_dl,n_trials_dl,(double)n_errors_dl/n_trials_dl);
+    if (ul_active==1) printf("SNR %f : n_errors_ul = %d/%d (%e)\n", SNR,n_errors_ul,n_trials_ul,(double)n_errors_ul/n_trials_ul);
+    if (dl_active==1) printf("SNR %f : n_errors_dl = %d/%d (%e)\n", SNR,n_errors_dl,n_trials_dl,(double)n_errors_dl/n_trials_dl);
     printf("SNR %f : n_errors_cfi = %d/%d (%e)\n", SNR,n_errors_cfi,trial,(double)n_errors_cfi/trial);
     printf("SNR %f : n_errors_hi = %d/%d (%e)\n", SNR,n_errors_hi,trial,(double)n_errors_hi/trial);
 
diff --git a/openair1/SIMULATION/LTE_PHY/prachsim.c b/openair1/SIMULATION/LTE_PHY/prachsim.c
index 4df53b053f9b377569c7de648cd323bd12e51176..37fc3a6a102d30d5883e3a6d78deeb5a4627007d 100644
--- a/openair1/SIMULATION/LTE_PHY/prachsim.c
+++ b/openair1/SIMULATION/LTE_PHY/prachsim.c
@@ -34,10 +34,6 @@
 #include "PHY/types.h"
 #include "PHY/defs.h"
 #include "PHY/vars.h"
-#include "MAC_INTERFACE/vars.h"
-#ifdef IFFT_FPGA
-#include "PHY/LTE_REFSIG/mod_table.h"
-#endif
 #ifdef EMOS
 #include "SCHED/phy_procedures_emos.h"
 #endif
@@ -56,60 +52,10 @@ PHY_VARS_UE *PHY_vars_UE;
 
 
 
-void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,unsigned char extended_prefix_flag,uint16_t Nid_cell,uint8_t N_RB_DL,uint8_t osf)
-{
-
-  LTE_DL_FRAME_PARMS *lte_frame_parms;
-
-  printf("Start lte_param_init\n");
-  PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB));
-
-  PHY_vars_UE = malloc(sizeof(PHY_VARS_UE));
-  //PHY_config = malloc(sizeof(PHY_CONFIG));
-  mac_xface = malloc(sizeof(MAC_xface));
-
-  randominit(0);
-  set_taus_seed(0);
-
-  lte_frame_parms = &(PHY_vars_eNB->lte_frame_parms);
-
-  lte_frame_parms->N_RB_DL            = N_RB_DL;   //50 for 10MHz and 25 for 5 MHz
-  lte_frame_parms->N_RB_UL            = N_RB_DL;
-  lte_frame_parms->Ncp                = extended_prefix_flag;
-  lte_frame_parms->Nid_cell           = Nid_cell;
-  lte_frame_parms->nushift            = 0;
-  lte_frame_parms->nb_antennas_tx     = N_tx;
-  lte_frame_parms->nb_antennas_rx     = N_rx;
-  //  lte_frame_parms->Csrs = 2;
-  //  lte_frame_parms->Bsrs = 0;
-  //  lte_frame_parms->kTC = 0;
-  //  lte_frame_parms->n_RRC = 0;
-  lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0;
-  lte_frame_parms->tdd_config = 1;
-  lte_frame_parms->frame_type = 1;
-  init_frame_parms(lte_frame_parms,osf);
-
-  //copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing));
-
-
-  PHY_vars_UE->lte_frame_parms = *lte_frame_parms;
-
-  phy_init_lte_top(lte_frame_parms);
-
-  phy_init_lte_ue(PHY_vars_UE,1,0);
-
-  phy_init_lte_eNB(PHY_vars_eNB,0,0,0);
-
-
-
-
-
-  printf("Done lte_param_init\n");
-
-}
-
 extern uint16_t prach_root_sequence_map0_3[838];
 
+void dump_prach_config(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
+
 int main(int argc, char **argv)
 {
 
@@ -120,13 +66,10 @@ int main(int argc, char **argv)
   uint8_t snr1set=0;
   uint8_t ue_speed1set=0;
   //mod_sym_t **txdataF;
-#ifdef IFFT_FPGA
-  int **txdataF2;
-#endif
   int **txdata;
   double **s_re,**s_im,**r_re,**r_im;
   double iqim=0.0;
-  int trial, ntrials=1;
+  int trial; //, ntrials=1;
   uint8_t transmission_mode = 1,n_tx=1,n_rx=1;
   uint16_t Nid_cell=0;
 
@@ -134,7 +77,7 @@ int main(int argc, char **argv)
   uint8_t hs_flag=0;
   int n_frames=1;
   channel_desc_t *UE2eNB;
-  uint32_t nsymb,tx_lev,tx_lev_dB;
+  uint32_t nsymb,tx_lev; //,tx_lev_dB;
   uint8_t extended_prefix_flag=0;
   //  int8_t interf1=-19,interf2=-19;
   LTE_DL_FRAME_PARMS *frame_parms;
@@ -153,8 +96,8 @@ int main(int argc, char **argv)
   uint16_t preamble_energy_list[64],preamble_tx=99,preamble_delay_list[64];
   uint16_t preamble_max,preamble_energy_max;
   PRACH_RESOURCES_t prach_resources;
-  uint8_t prach_fmt;
-  int N_ZC;
+  //uint8_t prach_fmt;
+  //int N_ZC;
   int delay = 0;
   double delay_avg=0;
   double ue_speed = 0;
@@ -178,7 +121,8 @@ int main(int argc, char **argv)
     case 'a':
       printf("Running AWGN simulation\n");
       awgn_flag = 1;
-      ntrials=1;
+      /* ntrials not used later, no need to set */
+      //ntrials=1;
       break;
 
     case 'd':
@@ -370,7 +314,17 @@ int main(int argc, char **argv)
   if (transmission_mode==2)
     n_tx=2;
 
-  lte_param_init(n_tx,n_rx,transmission_mode,extended_prefix_flag,Nid_cell,N_RB_DL,osf);
+  lte_param_init(n_tx,
+		 n_rx,
+		 transmission_mode,
+		 extended_prefix_flag,
+		 FDD,
+		 Nid_cell,
+		 3,
+		 N_RB_DL,
+		 0,
+		 osf,
+		 0);
 
 
   if (snr1set==0) {
@@ -447,9 +401,11 @@ int main(int argc, char **argv)
   PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag=hs_flag;
   PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset=0;
 
-  prach_fmt = get_prach_fmt(PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
-                            PHY_vars_eNB->lte_frame_parms.frame_type);
-  N_ZC = (prach_fmt <4)?839:139;
+  /* N_ZC not used later, so prach_fmt is also useless, don't set */
+  //prach_fmt = get_prach_fmt(PHY_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
+  //                          PHY_vars_eNB->lte_frame_parms.frame_type);
+  /* N_ZC not used later, no need to set */
+  //N_ZC = (prach_fmt <4)?839:139;
 
   compute_prach_seq(&PHY_vars_eNB->lte_frame_parms.prach_config_common,PHY_vars_eNB->lte_frame_parms.frame_type,PHY_vars_eNB->X_u);
 
@@ -473,7 +429,8 @@ int main(int argc, char **argv)
                           subframe,
                           0); //Nf
 
-  tx_lev_dB = (unsigned int) dB_fixed(tx_lev);
+  /* tx_lev_dB not used later, no need to set */
+  //tx_lev_dB = (unsigned int) dB_fixed(tx_lev);
 
   write_output("txsig0_new.m","txs0", &txdata[0][subframe*frame_parms->samples_per_tti],frame_parms->samples_per_tti,1,1);
   //write_output("txsig1.m","txs1", txdata[1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
@@ -590,14 +547,6 @@ int main(int argc, char **argv)
     //  printf("(%f,%f)\n",SNR,(double)prach_errors/(double)n_frames);
   } //SNR loop
 
-#ifdef IFFT_FPGA
-  free(txdataF2[0]);
-  free(txdataF2[1]);
-  free(txdataF2);
-  free(txdata[0]);
-  free(txdata[1]);
-  free(txdata);
-#endif
 
   for (i=0; i<2; i++) {
     free(s_re[i]);
diff --git a/openair1/SIMULATION/LTE_PHY/pucchsim.c b/openair1/SIMULATION/LTE_PHY/pucchsim.c
index 7820552f69394320fafb2bfe5ed7e04272dfb599..cfb7e2558df4cf2c52be7ef9f665bbbace23c3e0 100644
--- a/openair1/SIMULATION/LTE_PHY/pucchsim.c
+++ b/openair1/SIMULATION/LTE_PHY/pucchsim.c
@@ -34,10 +34,6 @@
 #include "PHY/types.h"
 #include "PHY/defs.h"
 #include "PHY/vars.h"
-#include "MAC_INTERFACE/vars.h"
-#ifdef IFFT_FPGA
-#include "PHY/LTE_REFSIG/mod_table.h"
-#endif
 #ifdef EMOS
 #include "SCHED/phy_procedures_emos.h"
 #endif
@@ -58,60 +54,6 @@ PHY_VARS_UE *PHY_vars_UE;
 
 
 
-void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,unsigned char extended_prefix_flag,uint16_t Nid_cell,uint8_t N_RB_DL,uint8_t osf)
-{
-
-  LTE_DL_FRAME_PARMS *lte_frame_parms;
-
-  printf("Start lte_param_init\n");
-  PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB));
-
-  PHY_vars_UE = malloc(sizeof(PHY_VARS_UE));
-  //PHY_config = malloc(sizeof(PHY_CONFIG));
-  mac_xface = malloc(sizeof(MAC_xface));
-
-  randominit(0);
-  set_taus_seed(0);
-
-  lte_frame_parms = &(PHY_vars_eNB->lte_frame_parms);
-
-  lte_frame_parms->N_RB_DL            = N_RB_DL;   //50 for 10MHz and 25 for 5 MHz
-  lte_frame_parms->N_RB_UL            = N_RB_DL;
-  lte_frame_parms->Ncp                = extended_prefix_flag;
-  lte_frame_parms->Nid_cell           = Nid_cell;
-  lte_frame_parms->nushift            = 0;
-  lte_frame_parms->nb_antennas_tx     = N_tx;
-  lte_frame_parms->nb_antennas_rx     = N_rx;
-  //  lte_frame_parms->Csrs = 2;
-  //  lte_frame_parms->Bsrs = 0;
-  //  lte_frame_parms->kTC = 0;
-  //  lte_frame_parms->n_RRC = 0;
-  lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0;
-  lte_frame_parms->tdd_config = 3;
-  lte_frame_parms->frame_type = 0;
-  init_frame_parms(lte_frame_parms,osf);
-
-  //copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing));
-
-//  phy_init_top(lte_frame_parms); //allocation
-
-  PHY_vars_UE->lte_frame_parms = *lte_frame_parms;
-
-
-  phy_init_lte_ue(PHY_vars_UE,1,0);
-
-  phy_init_lte_eNB(PHY_vars_eNB,0,0,0);
-
-  phy_init_lte_top(lte_frame_parms);
-
-
-
-
-  printf("Done lte_param_init\n");
-
-}
-
-
 int main(int argc, char **argv)
 {
 
@@ -121,9 +63,6 @@ int main(int argc, char **argv)
   double sigma2, sigma2_dB=0,SNR,snr0=-2.0,snr1=0.0;
   uint8_t snr1set=0;
   //mod_sym_t **txdataF;
-#ifdef IFFT_FPGA
-  int **txdataF2;
-#endif
   int **txdata;
   double **s_re,**s_im,**r_re,**r_im;
   double ricean_factor=0.0000005,iqim=0.0;
@@ -248,7 +187,7 @@ int main(int argc, char **argv)
         break;
 
       default:
-        msg("Unsupported channel model!\n");
+        printf("Unsupported channel model!\n");
         exit(-1);
       }
 
@@ -260,13 +199,13 @@ int main(int argc, char **argv)
 
     case 's':
       snr0 = atof(optarg);
-      msg("Setting SNR0 to %f\n",snr0);
+      printf("Setting SNR0 to %f\n",snr0);
       break;
 
     case 'S':
       snr1 = atof(optarg);
       snr1set=1;
-      msg("Setting SNR1 to %f\n",snr1);
+      printf("Setting SNR1 to %f\n",snr1);
       break;
 
     case 'p':
@@ -289,7 +228,7 @@ int main(int argc, char **argv)
       if ((transmission_mode!=1) &&
           (transmission_mode!=2) &&
           (transmission_mode!=6)) {
-        msg("Unsupported transmission mode %d\n",transmission_mode);
+        printf("Unsupported transmission mode %d\n",transmission_mode);
         exit(-1);
       }
 
@@ -299,7 +238,7 @@ int main(int argc, char **argv)
       n_tx=atoi(optarg);
 
       if ((n_tx==0) || (n_tx>2)) {
-        msg("Unsupported number of tx antennas %d\n",n_tx);
+        printf("Unsupported number of tx antennas %d\n",n_tx);
         exit(-1);
       }
 
@@ -309,7 +248,7 @@ int main(int argc, char **argv)
       n_rx=atoi(optarg);
 
       if ((n_rx==0) || (n_rx>2)) {
-        msg("Unsupported number of rx antennas %d\n",n_rx);
+        printf("Unsupported number of rx antennas %d\n",n_rx);
         exit(-1);
       }
 
@@ -370,7 +309,16 @@ int main(int argc, char **argv)
   if (transmission_mode==2)
     n_tx=2;
 
-  lte_param_init(n_tx,n_rx,transmission_mode,extended_prefix_flag,Nid_cell,N_RB_DL,osf);
+  lte_param_init(n_tx,
+		 n_rx,
+		 transmission_mode,
+		 extended_prefix_flag,
+		 Nid_cell,
+		 FDD,
+		 3,
+		 N_RB_DL,
+		 osf,
+		 0);
 
 
   if (snr1set==0) {
@@ -385,23 +333,7 @@ int main(int argc, char **argv)
   frame_parms = &PHY_vars_eNB->lte_frame_parms;
 
 
-#ifdef IFFT_FPGA
-  txdata    = (int **)malloc16(2*sizeof(int*));
-  txdata[0] = (int *)malloc16(FRAME_LENGTH_BYTES);
-  txdata[1] = (int *)malloc16(FRAME_LENGTH_BYTES);
-
-  bzero(txdata[0],FRAME_LENGTH_BYTES);
-  bzero(txdata[1],FRAME_LENGTH_BYTES);
-
-  txdataF2    = (int **)malloc16(2*sizeof(int*));
-  txdataF2[0] = (int *)malloc16(FRAME_LENGTH_BYTES_NO_PREFIX);
-  txdataF2[1] = (int *)malloc16(FRAME_LENGTH_BYTES_NO_PREFIX);
-
-  bzero(txdataF2[0],FRAME_LENGTH_BYTES_NO_PREFIX);
-  bzero(txdataF2[1],FRAME_LENGTH_BYTES_NO_PREFIX);
-#else
   txdata = PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id];
-#endif
 
   s_re = malloc(2*sizeof(double*));
   s_im = malloc(2*sizeof(double*));
@@ -414,7 +346,7 @@ int main(int argc, char **argv)
 
 
 
-  msg("[SIM] Using SCM/101\n");
+  printf("[SIM] Using SCM/101\n");
   UE2eNB = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx,
                                 PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
                                 channel_model,
@@ -426,7 +358,7 @@ int main(int argc, char **argv)
 
 
   if (UE2eNB==NULL) {
-    msg("Problem generating channel model. Exiting.\n");
+    printf("Problem generating channel model. Exiting.\n");
     exit(-1);
   }
 
@@ -454,7 +386,7 @@ int main(int argc, char **argv)
   PHY_vars_UE->lte_frame_parms.pucch_config_common.nRB_CQI          = 0;
   PHY_vars_UE->lte_frame_parms.pucch_config_common.nCS_AN           = 0;
 
-  pucch_payload = 1;
+  pucch_payload = 0;
 
   generate_pucch(PHY_vars_UE->lte_ue_common_vars.txdataF,
                  frame_parms,
@@ -467,27 +399,6 @@ int main(int argc, char **argv)
                  &pucch_payload,
                  AMP, //amp,
                  subframe); //subframe
-#ifdef IFFT_FPGA_UE
-  tx_lev=0;
-
-  for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
-
-    if (frame_parms->Ncp == 1)
-      PHY_ofdm_mod(txdataF2[aa],        // input
-                   txdata[aa],         // output
-                   frame_parms->log2_symbol_size,                // log2_fft_size
-                   2*nsymb,                 // number of symbols
-                   frame_parms->nb_prefix_samples,               // number of prefix samples
-                   CYCLIC_PREFIX);
-    else
-      normal_prefix_mod(txdataF2[aa],txdata[aa],2*nsymb,frame_parms);
-  }
-
-  tx_lev += signal_energy(&txdata[aa][OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES],
-                          OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES);
-
-#else
-
   write_output("txsigF0.m","txsF0", &PHY_vars_UE->lte_ue_common_vars.txdataF[0][2*subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX],OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX*nsymb,1,1);
 
   tx_lev = 0;
@@ -498,7 +409,7 @@ int main(int argc, char **argv)
     if (frame_parms->Ncp == 1)
       PHY_ofdm_mod(&PHY_vars_UE->lte_ue_common_vars.txdataF[aa][2*subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX],        // input,
                    &txdata[aa][PHY_vars_eNB->lte_frame_parms.samples_per_tti*subframe],         // output
-                   frame_parms->log2_symbol_size,                // log2_fft_size
+                   frame_parms->ofdm_symbol_size,
                    nsymb,                 // number of symbols
                    frame_parms->nb_prefix_samples,               // number of prefix samples
                    CYCLIC_PREFIX);
@@ -519,7 +430,6 @@ int main(int argc, char **argv)
                             OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES);
   }
 
-#endif
 
 
   write_output("txsig0.m","txs0", txdata[0], FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
@@ -597,9 +507,7 @@ int main(int argc, char **argv)
           }
         }
 
-        lte_eNB_I0_measurements(PHY_vars_eNB,
-                                0,
-                                1);
+
 
         for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
           for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_rx; aa++) {
@@ -647,6 +555,10 @@ int main(int argc, char **argv)
 
         //      if (sig == 1)
         //    printf("*");
+        lte_eNB_I0_measurements(PHY_vars_eNB,
+                                subframe,
+				0,
+                                1);
         PHY_vars_eNB->PHY_measurements_eNB[0].n0_power_tot_dB = N0;//(int8_t)(sigma2_dB-10*log10(PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size/(12*NB_RB)));
         stat = rx_pucch(PHY_vars_eNB,
                         pucch_format,
@@ -655,6 +567,7 @@ int main(int argc, char **argv)
                         n2_pucch,
                         0, //shortened_format,
                         &pucch_payload_rx, //payload,
+                        0 /* frame not defined, let's pass 0 */,
                         subframe,
                         pucch1_thres);
 
@@ -700,15 +613,6 @@ int main(int argc, char **argv)
   }
 
 
-#ifdef IFFT_FPGA
-  free(txdataF2[0]);
-  free(txdataF2[1]);
-  free(txdataF2);
-  free(txdata[0]);
-  free(txdata[1]);
-  free(txdata);
-#endif
-
   for (i=0; i<2; i++) {
     free(s_re[i]);
     free(s_im[i]);
diff --git a/openair1/SIMULATION/LTE_PHY/scansim.c b/openair1/SIMULATION/LTE_PHY/scansim.c
index c2ceb1c58d53813dd243e1d85a19323321e1627e..2cbb7b3e322522ef9ddcccfd4a78f29ca915d262 100644
--- a/openair1/SIMULATION/LTE_PHY/scansim.c
+++ b/openair1/SIMULATION/LTE_PHY/scansim.c
@@ -56,94 +56,11 @@
 #define BW 20.0
 
 
-PHY_VARS_eNB *PHY_vars_eNb,*PHY_vars_eNb1,*PHY_vars_eNb2;
+PHY_VARS_eNB *PHY_vars_eNB,*PHY_vars_eNB1,*PHY_vars_eNB2;
 PHY_VARS_UE *PHY_vars_UE;
 
 #define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13
 
-void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,unsigned char extended_prefix_flag,unsigned char frame_type, uint16_t Nid_cell,uint8_t N_RB_DL,uint8_t osf)
-{
-
-  //  unsigned int ind;
-  LTE_DL_FRAME_PARMS *lte_frame_parms;
-  int i;
-
-  printf("Start lte_param_init\n");
-  PHY_vars_eNb = malloc(sizeof(PHY_VARS_eNB));
-  PHY_vars_eNb1 = malloc(sizeof(PHY_VARS_eNB));
-  PHY_vars_eNb2 = malloc(sizeof(PHY_VARS_eNB));
-
-  PHY_vars_UE = malloc(sizeof(PHY_VARS_UE));
-  //PHY_config = malloc(sizeof(PHY_CONFIG));
-  mac_xface = malloc(sizeof(MAC_xface));
-
-  randominit(0);
-  set_taus_seed(0);
-
-  lte_frame_parms = &(PHY_vars_eNb->lte_frame_parms);
-
-  lte_frame_parms->N_RB_DL            = N_RB_DL;   //50 for 10MHz and 25 for 5 MHz
-  lte_frame_parms->N_RB_UL            = N_RB_DL;
-  lte_frame_parms->Ncp                = extended_prefix_flag;
-  lte_frame_parms->Nid_cell           = Nid_cell;
-  lte_frame_parms->nushift            = Nid_cell%6;
-  lte_frame_parms->nb_antennas_tx     = N_tx;
-  lte_frame_parms->nb_antennas_tx_eNB = N_tx;
-  lte_frame_parms->nb_antennas_rx     = N_rx;
-  //  lte_frame_parms->Csrs = 2;
-  //  lte_frame_parms->Bsrs = 0;
-  //  lte_frame_parms->kTC = 0;
-  //  lte_frame_parms->n_RRC = 0;
-  lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0;
-  lte_frame_parms->tdd_config = 3;
-  lte_frame_parms->frame_type = frame_type;
-  init_frame_parms(lte_frame_parms,osf);
-
-  //copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing));
-
-
-  PHY_vars_UE->lte_frame_parms = *lte_frame_parms;
-
-  phy_init_lte_top(lte_frame_parms);
-
-  PHY_vars_UE->PHY_measurements.n_adj_cells=2;
-  PHY_vars_UE->PHY_measurements.adj_cell_id[0] = Nid_cell+1;
-  PHY_vars_UE->PHY_measurements.adj_cell_id[1] = Nid_cell+2;
-
-  for (i=0; i<3; i++)
-    lte_gold(lte_frame_parms,PHY_vars_UE->lte_gold_table[i],Nid_cell+i);
-
-  phy_init_lte_ue(PHY_vars_UE,1,0);
-
-  phy_init_lte_eNB(PHY_vars_eNb,0,0,0);
-
-  for (i=0; i<10; i++) {
-    PHY_vars_UE->scan_info[0].amp[0][i] = 0;
-    PHY_vars_UE->scan_info[0].amp[1][i] = 0;
-    PHY_vars_UE->scan_info[0].amp[2][i] = 0;
-  }
-
-  memcpy((void*)&PHY_vars_eNb1->lte_frame_parms,(void*)&PHY_vars_eNb->lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS));
-  PHY_vars_eNb1->lte_frame_parms.Nid_cell=Nid_cell+1;
-  PHY_vars_eNb1->lte_frame_parms.nushift=(Nid_cell+1)%6;
-  PHY_vars_eNb1->Mod_id=1;
-
-  memcpy((void*)&PHY_vars_eNb2->lte_frame_parms,(void*)&PHY_vars_eNb->lte_frame_parms,sizeof(LTE_DL_FRAME_PARMS));
-  PHY_vars_eNb2->lte_frame_parms.Nid_cell=Nid_cell+2;
-  PHY_vars_eNb2->lte_frame_parms.nushift=(Nid_cell+2)%6;
-  PHY_vars_eNb2->Mod_id=2;
-
-  phy_init_lte_eNB(PHY_vars_eNb1,0,0,0);
-
-  phy_init_lte_eNB(PHY_vars_eNb2,0,0,0);
-
-  phy_init_lte_top(lte_frame_parms);
-
-  printf("Done lte_param_init\n");
-
-
-}
-
 mod_sym_t *dummybuf[4];
 mod_sym_t dummy0[2048*14];
 mod_sym_t dummy1[2048*14];
@@ -404,7 +321,16 @@ int main(int argc, char **argv)
   if (transmission_mode>=2)
     n_tx=2;
 
-  lte_param_init(n_tx,n_rx,transmission_mode,extended_prefix_flag,frame_type,Nid_cell,N_RB_DL,osf);
+  lte_param_init(n_tx,
+		 n_rx,
+		 transmission_mode,
+		 extended_prefix_flag,
+		 frame_type,
+		 Nid_cell,
+		 3,
+		 N_RB_DL,
+		 osf,
+		 0);
 
 #ifdef XFORMS
   fl_initialize (&argc, argv, NULL, 0, 0);
@@ -422,13 +348,13 @@ int main(int argc, char **argv)
 
   printf("SNR0 %f, SNR1 %f\n",snr0,snr1);
 
-  frame_parms = &PHY_vars_eNb->lte_frame_parms;
+  frame_parms = &PHY_vars_eNB->lte_frame_parms;
 
 
 
-  txdata = PHY_vars_eNb->lte_eNB_common_vars.txdata[0];
-  txdata1 = PHY_vars_eNb1->lte_eNB_common_vars.txdata[0];
-  txdata2 = PHY_vars_eNb2->lte_eNB_common_vars.txdata[0];
+  txdata = PHY_vars_eNB->lte_eNB_common_vars.txdata[0];
+  txdata1 = PHY_vars_eNB1->lte_eNB_common_vars.txdata[0];
+  txdata2 = PHY_vars_eNB2->lte_eNB_common_vars.txdata[0];
 
 
   s_re = malloc(2*sizeof(double*));
@@ -449,8 +375,8 @@ int main(int argc, char **argv)
   printf("FFT Size %d, Extended Prefix %d, Samples per subframe %d, Symbols per subframe %d\n",NUMBER_OF_OFDM_CARRIERS,
          frame_parms->Ncp,frame_parms->samples_per_tti,nsymb);
 
-  printf("PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0][0] = %p\n",
-         PHY_vars_eNb1->lte_eNB_common_vars.txdataF[0][0]);
+  printf("PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0][0] = %p\n",
+         PHY_vars_eNB1->lte_eNB_common_vars.txdataF[0][0]);
 
 
   DLSCH_alloc_pdu2.rah              = 0;
@@ -465,13 +391,14 @@ int main(int argc, char **argv)
   // Forget second codeword
   DLSCH_alloc_pdu2.tpmi             = (transmission_mode==6 ? 5 : 0) ;  // precoding
 
-  eNB2UE = new_channel_desc_scm(PHY_vars_eNb->lte_frame_parms.nb_antennas_tx,
-                                PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
-                                channel_model,
-                                BW,
-                                0,
-                                0,
-                                0);
+  eNB2UE = new_channel_desc_scm(PHY_vars_eNB->lte_frame_parms.nb_antennas_tx,
+				PHY_vars_UE->lte_frame_parms.nb_antennas_rx,
+				channel_model,
+				N_RB2sampling_rate(PHY_vars_eNB->lte_frame_parms.N_RB_DL),
+				N_RB2channel_bandwidth(PHY_vars_eNB->lte_frame_parms.N_RB_DL),
+				0,
+				0,
+				0);
 
 
   if (eNB2UE==NULL) {
@@ -512,51 +439,51 @@ int main(int argc, char **argv)
   pbch_pdu[1]=1;
   pbch_pdu[2]=0;
 
-  if (PHY_vars_eNb->lte_frame_parms.frame_type == FDD) {
-    generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
+  if (PHY_vars_eNB->lte_frame_parms.frame_type == FDD) {
+    generate_pss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
                  AMP,
-                 &PHY_vars_eNb->lte_frame_parms,
-                 (PHY_vars_eNb->lte_frame_parms.Ncp==NORMAL) ? 6 : 5,
+                 &PHY_vars_eNB->lte_frame_parms,
+                 (PHY_vars_eNB->lte_frame_parms.Ncp==NORMAL) ? 6 : 5,
                  0);
     /*
-    generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
+    generate_sss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
                  AMP,
-                 &PHY_vars_eNb->lte_frame_parms,
-                 (PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 5 : 4,
+                 &PHY_vars_eNB->lte_frame_parms,
+                 (PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 5 : 4,
                  0);*/
-    generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
+    generate_pss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
                  AMP,
-                 &PHY_vars_eNb->lte_frame_parms,
-                 (PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 6 : 5,
+                 &PHY_vars_eNB->lte_frame_parms,
+                 (PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 6 : 5,
                  10);
     /*
-    generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
+    generate_sss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
                  AMP,
-                 &PHY_vars_eNb->lte_frame_parms,
-                 (PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 5 : 4,
+                 &PHY_vars_eNB->lte_frame_parms,
+                 (PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 5 : 4,
                  10);
     */
 
   } else {
 
-    generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
+    generate_sss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
                  AMP,
-                 &PHY_vars_eNb->lte_frame_parms,
-                 (PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 6 : 5,
+                 &PHY_vars_eNB->lte_frame_parms,
+                 (PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 6 : 5,
                  1);
-    generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
+    generate_pss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
                  AMP,
-                 &PHY_vars_eNb->lte_frame_parms,
+                 &PHY_vars_eNB->lte_frame_parms,
                  2,
                  2);
-    generate_sss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
+    generate_sss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
                  AMP,
-                 &PHY_vars_eNb->lte_frame_parms,
-                 (PHY_vars_eNb->lte_frame_parms.Ncp==0) ? 6 : 5,
+                 &PHY_vars_eNB->lte_frame_parms,
+                 (PHY_vars_eNB->lte_frame_parms.Ncp==0) ? 6 : 5,
                  11);
-    generate_pss(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
+    generate_pss(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
                  AMP,
-                 &PHY_vars_eNb->lte_frame_parms,
+                 &PHY_vars_eNB->lte_frame_parms,
                  2,
                  12);
 
@@ -565,8 +492,8 @@ int main(int argc, char **argv)
 
 
   /*
-  generate_pilots(PHY_vars_eNb,
-      PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
+  generate_pilots(PHY_vars_eNB,
+      PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
       AMP,
       LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
 
@@ -577,8 +504,8 @@ int main(int argc, char **argv)
      dci_alloc,
      0,
      1024,
-     &PHY_vars_eNb->lte_frame_parms,
-     PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
+     &PHY_vars_eNB->lte_frame_parms,
+     PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
      0);
   */
 
@@ -593,25 +520,25 @@ int main(int argc, char **argv)
     dummybuf[1] = dummy1;
     dummybuf[2] = dummy2;
     dummybuf[3] = dummy3;
-    generate_pbch(&PHY_vars_eNb->lte_eNB_pbch,
+    generate_pbch(&PHY_vars_eNB->lte_eNB_pbch,
       (mod_sym_t**)dummybuf,
       AMP,
-      &PHY_vars_eNb->lte_frame_parms,
+      &PHY_vars_eNB->lte_frame_parms,
       pbch_pdu,
       0);
   }
 
-  generate_pbch(&PHY_vars_eNb->lte_eNB_pbch,
-    PHY_vars_eNb->lte_eNB_common_vars.txdataF[0],
+  generate_pbch(&PHY_vars_eNB->lte_eNB_pbch,
+    PHY_vars_eNB->lte_eNB_common_vars.txdataF[0],
     AMP,
-    &PHY_vars_eNb->lte_frame_parms,
+    &PHY_vars_eNB->lte_frame_parms,
     pbch_pdu,
     pbch_phase);
   */
-  write_output("txsigF0.m","txsF0", PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
+  write_output("txsigF0.m","txsF0", PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][0],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
 
-  if (PHY_vars_eNb->lte_frame_parms.nb_antennas_tx>1)
-    write_output("txsigF1.m","txsF1", PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][1],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
+  if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx>1)
+    write_output("txsigF1.m","txsF1", PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][1],FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX,1,1);
 
   tx_lev = 0;
   tx_lev1 = 0;
@@ -620,16 +547,16 @@ int main(int argc, char **argv)
 
 
 
-  for (aa=0; aa<PHY_vars_eNb->lte_frame_parms.nb_antennas_tx; aa++) {
+  for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx; aa++) {
     if (frame_parms->Ncp == 1)
-      PHY_ofdm_mod(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][aa],        // input,
+      PHY_ofdm_mod(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][aa],        // input,
                    txdata[aa],         // output
-                   frame_parms->log2_symbol_size,                // log2_fft_size
+                   frame_parms->ofdm_symbol_size,
                    LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb,                 // number of symbols
                    frame_parms->nb_prefix_samples,               // number of prefix samples
                    CYCLIC_PREFIX);
     else {
-      normal_prefix_mod(PHY_vars_eNb->lte_eNB_common_vars.txdataF[0][aa],
+      normal_prefix_mod(PHY_vars_eNB->lte_eNB_common_vars.txdataF[0][aa],
                         txdata[aa],
                         LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb,
                         frame_parms);
@@ -648,7 +575,7 @@ int main(int argc, char **argv)
   // multipath channel
 
   for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
-    for (aa=0; aa<PHY_vars_eNb->lte_frame_parms.nb_antennas_tx; aa++) {
+    for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_tx; aa++) {
       s_re[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)]);
       s_im[aa][i] = ((double)(((short *)txdata[aa]))[(i<<1)+1]);
     }
@@ -667,7 +594,7 @@ int main(int argc, char **argv)
       multipath_channel(eNB2UE,s_re,s_im,r_re,r_im,
                         2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES,0);
 
-      sigma2_dB = 10*log10((double)tx_lev) +10*log10((double)PHY_vars_eNb->lte_frame_parms.ofdm_symbol_size/(double)(12*NB_RB)) - SNR;
+      sigma2_dB = 10*log10((double)tx_lev) +10*log10((double)PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size/(double)(12*NB_RB)) - SNR;
 
       if (n_frames==1)
         printf("sigma2_dB %f (SNR %f dB) tx_lev_dB %f,%f,%f\n",sigma2_dB,SNR,
@@ -689,7 +616,7 @@ int main(int argc, char **argv)
       for (n_trials=0; n_trials<ntrials; n_trials++) {
         //printf("n_trial %d\n",n_trials);
         for (i=0; i<2*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; i++) {
-          for (aa=0; aa<PHY_vars_eNb->lte_frame_parms.nb_antennas_rx; aa++) {
+          for (aa=0; aa<PHY_vars_eNB->lte_frame_parms.nb_antennas_rx; aa++) {
             ((short*) PHY_vars_UE->lte_ue_common_vars.rxdata[aa])[2*i] = (short) ((r_re[aa][i] +sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
             ((short*) PHY_vars_UE->lte_ue_common_vars.rxdata[aa])[2*i+1] = (short) ((r_im[aa][i] + (iqim*r_re[aa][i]) + sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
           }
diff --git a/openair1/SIMULATION/LTE_PHY/syncsim.c b/openair1/SIMULATION/LTE_PHY/syncsim.c
index a5f046da9352a4105acaafe8e291e24ab13271f4..45b69adcc544c0e1b6f89d25ad8be4ecf6e3314a 100644
--- a/openair1/SIMULATION/LTE_PHY/syncsim.c
+++ b/openair1/SIMULATION/LTE_PHY/syncsim.c
@@ -1189,7 +1189,7 @@ int main(int argc, char **argv)
       if (frame_parms->Ncp == 1)
         PHY_ofdm_mod(txdataF2[aa],        // input
                      txdata[aa],         // output
-                     PHY_vars_eNB->lte_frame_parms.log2_symbol_size,                // log2_fft_size
+                     PHY_vars_eNB->lte_frame_parms.ofdm_symbol_size,                // log2_fft_size
                      LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb,                 // number of symbols
                      PHY_vars_eNB->lte_frame_parms.nb_prefix_samples,               // number of prefix samples
                      PHY_vars_eNB->lte_frame_parms.twiddle_ifft,  // IFFT twiddle factors
@@ -1218,7 +1218,7 @@ int main(int argc, char **argv)
       if (frame_parms->Ncp == 1)
         PHY_ofdm_mod(PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNb_id][aa],        // input,
                      txdata[aa],         // output
-                     frame_parms->log2_symbol_size,                // log2_fft_size
+                     frame_parms->ofdm_symbol_size,                // log2_fft_size
                      LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb,                 // number of symbols
                      frame_parms->nb_prefix_samples,               // number of prefix samples
                      frame_parms->twiddle_ifft,  // IFFT twiddle factors
@@ -1240,7 +1240,7 @@ int main(int argc, char **argv)
         if (frame_parms->Ncp == 1)
           PHY_ofdm_mod(PHY_vars_eNB1->lte_eNB_common_vars.txdataF[eNb_id][aa],        // input,
                        PHY_vars_eNB1->lte_eNB_common_vars.txdata[eNb_id][aa],         // output
-                       frame_parms->log2_symbol_size,                // log2_fft_size
+                       frame_parms->ofdm_symbol_size,                // log2_fft_size
                        LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb,                 // number of symbols
                        frame_parms->nb_prefix_samples,               // number of prefix samples
                        frame_parms->twiddle_ifft,  // IFFT twiddle factors
@@ -1260,7 +1260,7 @@ int main(int argc, char **argv)
         if (frame_parms->Ncp == 1)
           PHY_ofdm_mod(PHY_vars_eNB2->lte_eNB_common_vars.txdataF[eNb_id][aa],        // input,
                        PHY_vars_eNB2->lte_eNB_common_vars.txdata[eNb_id][aa],         // output
-                       frame_parms->log2_symbol_size,                // log2_fft_size
+                       frame_parms->ofdm_symbol_size,                // log2_fft_size
                        LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*nsymb,                 // number of symbols
                        frame_parms->nb_prefix_samples,               // number of prefix samples
                        frame_parms->twiddle_ifft,  // IFFT twiddle factors
diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c
index 55745b6896b5e4b28f36351f4c2af409a4edeec5..8199efc9409eda3b826f30c4bd1524a8923d208c 100644
--- a/openair1/SIMULATION/LTE_PHY/ulsim.c
+++ b/openair1/SIMULATION/LTE_PHY/ulsim.c
@@ -45,16 +45,13 @@
 #include "PHY/types.h"
 #include "PHY/defs.h"
 #include "PHY/vars.h"
-#include "MAC_INTERFACE/vars.h"
 
 #include "SCHED/defs.h"
 #include "SCHED/vars.h"
 #include "LAYER2/MAC/vars.h"
 #include "OCG_vars.h"
 
-#ifdef XFORMS
 #include "PHY/TOOLS/lte_phy_scope.h"
-#endif
 
 extern unsigned short dftsizes[33];
 extern short *ul_ref_sigs[30][2][33];
@@ -74,12 +71,9 @@ node_desc_t *ue_data[NUMBER_OF_UE_MAX];
 extern uint16_t beta_ack[16],beta_ri[16],beta_cqi[16];
 //extern  char* namepointer_chMag ;
 
-
-
-#ifdef XFORMS
+int xforms=0;
 FD_lte_phy_scope_enb *form_enb;
 char title[255];
-#endif
 
 /*the following parameters are used to control the processing times*/
 double t_tx_max = -1000000000; /*!< \brief initial max process time for tx */
@@ -89,60 +83,6 @@ double t_rx_min = 1000000000; /*!< \brief initial min process time for tx */
 int n_tx_dropped = 0; /*!< \brief initial max process time for tx */
 int n_rx_dropped = 0; /*!< \brief initial max process time for rx */
 
-void lte_param_init(unsigned char N_tx, unsigned char N_rx,unsigned char transmission_mode,uint8_t extended_prefix_flag,uint8_t N_RB_DL,uint8_t frame_type,uint8_t tdd_config,uint8_t osf)
-{
-
-  LTE_DL_FRAME_PARMS *lte_frame_parms;
-
-  printf("Start lte_param_init\n");
-  PHY_vars_eNB = malloc(sizeof(PHY_VARS_eNB));
-  PHY_vars_UE = malloc(sizeof(PHY_VARS_UE));
-  //PHY_config = malloc(sizeof(PHY_CONFIG));
-  mac_xface = malloc(sizeof(MAC_xface));
-
-  randominit(0);
-  set_taus_seed(0);
-
-  lte_frame_parms = &(PHY_vars_eNB->lte_frame_parms);
-
-  lte_frame_parms->frame_type         = frame_type;
-  lte_frame_parms->tdd_config         = tdd_config;
-  lte_frame_parms->N_RB_DL            = N_RB_DL;   //50 for 10MHz and 25 for 5 MHz
-  lte_frame_parms->N_RB_UL            = N_RB_DL;
-  lte_frame_parms->Ncp                = extended_prefix_flag;
-  lte_frame_parms->Ncp_UL             = extended_prefix_flag;
-  lte_frame_parms->Nid_cell           = 10;
-  lte_frame_parms->nushift            = 0;
-  lte_frame_parms->nb_antennas_tx     = N_tx;
-  lte_frame_parms->nb_antennas_rx     = N_rx;
-  //  lte_frame_parms->Csrs = 2;
-  //  lte_frame_parms->Bsrs = 0;
-  //  lte_frame_parms->kTC = 0;
-  //  lte_frame_parms->n_RRC = 0;
-  lte_frame_parms->mode1_flag = (transmission_mode == 1)? 1 : 0;
-  lte_frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = 0;//n_DMRS1 set to 0
-
-  init_frame_parms(lte_frame_parms,osf);
-
-  //copy_lte_parms_to_phy_framing(lte_frame_parms, &(PHY_config->PHY_framing));
-
-
-  PHY_vars_UE->lte_frame_parms = *lte_frame_parms;
-
-  phy_init_lte_top(lte_frame_parms);
-
-  phy_init_lte_ue(PHY_vars_UE,1,0);
-
-  phy_init_lte_eNB(PHY_vars_eNB,0,0,0);
-
-  printf("Done lte_param_init\n");
-
-
-}
-
-
-
-
 int main(int argc, char **argv)
 {
 
@@ -151,7 +91,7 @@ int main(int argc, char **argv)
 
   int aarx,aatx;
   double channelx,channely;
-  double sigma2, sigma2_dB=10,SNR,SNR2,snr0=-2.0,snr1,SNRmeas,rate,saving_bler;
+  double sigma2, sigma2_dB=10,SNR,SNR2,snr0=-2.0,snr1,SNRmeas,rate,saving_bler=0;
   double input_snr_step=.2,snr_int=30;
   double blerr;
 
@@ -180,7 +120,7 @@ int main(int argc, char **argv)
   unsigned int coded_bits_per_codeword,nsymb;
   int subframe=3;
   unsigned int tx_lev=0,tx_lev_dB,trials,errs[4]= {0,0,0,0},round_trials[4]= {0,0,0,0};
-  uint8_t transmission_mode=1,n_rx=1,n_tx=1;
+  uint8_t transmission_mode=1,n_rx=1;
 
   FILE *bler_fd=NULL;
   char bler_fname[512];
@@ -248,6 +188,7 @@ int main(int argc, char **argv)
   int nb_rb_set = 0;
   int sf;
 
+  int threequarter_fs=0;
   opp_enabled=1; // to enable the time meas
 
   cpu_freq_GHz = (double)get_cpu_freq_GHz();
@@ -257,7 +198,7 @@ int main(int argc, char **argv)
   logInit();
   set_comp_log(PHY,LOG_DEBUG,LOG_MED,1);
 
-  while ((c = getopt (argc, argv, "hapZbm:n:Y:X:x:s:w:e:q:d:D:O:c:r:i:f:y:c:oA:C:R:g:N:l:S:T:QB:PI:L")) != -1) {
+  while ((c = getopt (argc, argv, "hapZEbm:n:Y:X:x:s:w:e:q:d:D:O:c:r:i:f:y:c:oA:C:R:g:N:l:S:T:QB:PI:LF")) != -1) {
     switch (c) {
     case 'a':
       channel_model = AWGN;
@@ -367,7 +308,7 @@ int main(int argc, char **argv)
         break;
 
       default:
-        msg("Unsupported channel model!\n");
+        printf("Unsupported channel model!\n");
         exit(-1);
         break;
       }
@@ -391,14 +332,10 @@ int main(int argc, char **argv)
 
       if ((transmission_mode!=1) &&
           (transmission_mode!=2)) {
-        msg("Unsupported transmission mode %d\n",transmission_mode);
+        printf("Unsupported transmission mode %d\n",transmission_mode);
         exit(-1);
       }
 
-      if (transmission_mode>1) {
-        n_tx = 1;
-      }
-
       break;
 
     case 'y':
@@ -431,6 +368,10 @@ int main(int argc, char **argv)
       cyclic_shift = atoi(optarg);
       break;
 
+    case 'E':
+      threequarter_fs=1;
+      break;
+
     case 'N':
       N0 = atoi(optarg);
       break;
@@ -441,10 +382,10 @@ int main(int argc, char **argv)
 
     case 'i':
       input_fdUL = fopen(optarg,"r");
-      msg("Reading in %s (%p)\n",optarg,input_fdUL);
+      printf("Reading in %s (%p)\n",optarg,input_fdUL);
 
       if (input_fdUL == (FILE*)NULL) {
-        msg("Unknown file %s\n",optarg);
+        printf("Unknown file %s\n",optarg);
         exit(-1);
       }
 
@@ -507,6 +448,10 @@ int main(int argc, char **argv)
       max_turbo_iterations=atoi(optarg);
       break;
 
+    case 'F':
+      xforms=1;
+      break;
+
     case 'Z':
       dump_table = 1;
       break;
@@ -520,7 +465,17 @@ int main(int argc, char **argv)
     }
   }
 
-  lte_param_init(1,n_rx,1,extended_prefix_flag,N_RB_DL,frame_type,tdd_config,osf);
+  lte_param_init(1,
+		 n_rx,
+		 1,
+		 extended_prefix_flag,
+		 frame_type,
+		 0,
+		 tdd_config,
+		 N_RB_DL,
+		 threequarter_fs,
+		 osf,
+		 0);
 
   if (nb_rb_set == 0)
     nb_rb = PHY_vars_eNB->lte_frame_parms.N_RB_UL;
@@ -554,13 +509,8 @@ int main(int argc, char **argv)
   //  r_re0 = malloc(2*sizeof(double*));
   //  r_im0 = malloc(2*sizeof(double*));
 
-  nsymb = (PHY_vars_eNB->lte_frame_parms.Ncp == 0) ? 14 : 12;
-
-  coded_bits_per_codeword = nb_rb * (12 * get_Qm(mcs)) * nsymb;
+  nsymb = (PHY_vars_eNB->lte_frame_parms.Ncp == NORMAL) ? 14 : 12;
 
-  rate = (double)dlsch_tbs25[get_I_TBS(mcs)][nb_rb-1]/(coded_bits_per_codeword);
-
-  printf("Rate = %f (mod %d), coded bits %d\n",rate,get_Qm(mcs),coded_bits_per_codeword);
 
   sprintf(bler_fname,"ULbler_mcs%d_nrb%d_ChannelModel%d_nsim%d.csv",mcs,nb_rb,chMod,n_frames);
   bler_fd = fopen(bler_fname,"w");
@@ -637,12 +587,12 @@ int main(int argc, char **argv)
   }
 
 
-#ifdef XFORMS
-  fl_initialize (&argc, argv, NULL, 0, 0);
-  form_enb = create_lte_phy_scope_enb();
-  sprintf (title, "LTE PHY SCOPE eNB");
-  fl_show_form (form_enb->lte_phy_scope_enb, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
-#endif
+  if (xforms==1) {
+    fl_initialize (&argc, argv, NULL, 0, 0);
+    form_enb = create_lte_phy_scope_enb();
+    sprintf (title, "LTE PHY SCOPE eNB");
+    fl_show_form (form_enb->lte_phy_scope_enb, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
+  }
 
   PHY_vars_UE->lte_ue_pdcch_vars[0]->crnti = 14;
 
@@ -685,13 +635,13 @@ int main(int argc, char **argv)
   UE2eNB->max_Doppler = maxDoppler;
 
   // NN: N_RB_UL has to be defined in ulsim
-  PHY_vars_eNB->ulsch_eNB[0] = new_eNB_ulsch(8,max_turbo_iterations,N_RB_DL,0);
-  PHY_vars_UE->ulsch_ue[0]   = new_ue_ulsch(8,N_RB_DL,0);
+  PHY_vars_eNB->ulsch_eNB[0] = new_eNB_ulsch(max_turbo_iterations,N_RB_DL,0);
+  PHY_vars_UE->ulsch_ue[0]   = new_ue_ulsch(N_RB_DL,0);
 
   // Create transport channel structures for 2 transport blocks (MIMO)
   for (i=0; i<2; i++) {
-    PHY_vars_eNB->dlsch_eNB[0][i] = new_eNB_dlsch(1,8,N_RB_DL,0);
-    PHY_vars_UE->dlsch_ue[0][i]  = new_ue_dlsch(1,8,MAX_TURBO_ITERATIONS,N_RB_DL,0);
+    PHY_vars_eNB->dlsch_eNB[0][i] = new_eNB_dlsch(1,8,1827072,N_RB_DL,0);
+    PHY_vars_UE->dlsch_ue[0][i]  = new_ue_dlsch(1,8,1827072,MAX_TURBO_ITERATIONS,N_RB_DL,0);
 
     if (!PHY_vars_eNB->dlsch_eNB[0][i]) {
       printf("Can't get eNB dlsch structures\n");
@@ -706,7 +656,7 @@ int main(int argc, char **argv)
     PHY_vars_eNB->dlsch_eNB[0][i]->rnti = 14;
     PHY_vars_UE->dlsch_ue[0][i]->rnti   = 14;
 
-  }
+  } 
 
 
   switch (PHY_vars_eNB->lte_frame_parms.N_RB_UL) {
@@ -810,9 +760,9 @@ int main(int argc, char **argv)
     PHY_vars_eNB->proc[sf].subframe_rx=sf;
   }
 
-  msg("Init UL hopping UE\n");
+  printf("Init UL hopping UE\n");
   init_ul_hopping(&PHY_vars_UE->lte_frame_parms);
-  msg("Init UL hopping eNB\n");
+  printf("Init UL hopping eNB\n");
   init_ul_hopping(&PHY_vars_eNB->lte_frame_parms);
 
   PHY_vars_eNB->proc[subframe].frame_rx = PHY_vars_UE->frame_tx;
@@ -852,6 +802,13 @@ int main(int argc, char **argv)
                                      CBA_RNTI,
                                      srs_flag);
 
+  coded_bits_per_codeword = nb_rb * (12 * get_Qm_ul(mcs)) * nsymb;
+
+  if (cqi_flag == 1) coded_bits_per_codeword-=PHY_vars_UE->ulsch_ue[0]->O;
+
+  rate = (double)dlsch_tbs25[get_I_TBS(mcs)][nb_rb-1]/(coded_bits_per_codeword);
+
+  printf("Rate = %f (mod %d), coded bits %d\n",rate,get_Qm_ul(mcs),coded_bits_per_codeword);
 
 
   PHY_vars_UE->frame_tx = (PHY_vars_UE->frame_tx+1)&1023;
@@ -894,11 +851,11 @@ int main(int argc, char **argv)
 
 
       harq_pid = subframe2harq_pid(&PHY_vars_UE->lte_frame_parms,PHY_vars_UE->frame_tx,subframe);
-
+      input_buffer_length = PHY_vars_UE->ulsch_ue[0]->harq_processes[harq_pid]->TBS/8;
+      input_buffer = (unsigned char *)malloc(input_buffer_length+4);
       //      printf("UL frame %d/subframe %d, harq_pid %d\n",PHY_vars_UE->frame,subframe,harq_pid);
       if (input_fdUL == NULL) {
-        input_buffer_length = PHY_vars_UE->ulsch_ue[0]->harq_processes[harq_pid]->TBS/8;
-        input_buffer = (unsigned char *)malloc(input_buffer_length+4);
+
 
         if (n_frames == 1) {
           trch_out_fdUL= fopen("ulsch_trchUL.txt","w");
@@ -920,7 +877,7 @@ int main(int argc, char **argv)
         i=0;
 
         while (!feof(input_fdUL)) {
-          fscanf(input_fdUL,"%s %s",input_val_str,input_val_str2);//&input_val1,&input_val2);
+          ret=fscanf(input_fdUL,"%s %s",input_val_str,input_val_str2);//&input_val1,&input_val2);
 
           if ((i%4)==0) {
             ((short*)txdata[0])[i/2] = (short)((1<<15)*strtod(input_val_str,NULL));
@@ -1106,10 +1063,10 @@ int main(int argc, char **argv)
             start_meas(&PHY_vars_UE->ofdm_mod_stats);
 
             for (aa=0; aa<1; aa++) {
-              if (frame_parms->Ncp == 1)
+              if (frame_parms->Ncp == EXTENDED)
                 PHY_ofdm_mod(&PHY_vars_UE->lte_ue_common_vars.txdataF[aa][subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX],        // input
                              &txdata[aa][PHY_vars_eNB->lte_frame_parms.samples_per_tti*subframe],         // output
-                             PHY_vars_UE->lte_frame_parms.log2_symbol_size,                // log2_fft_size
+                             PHY_vars_UE->lte_frame_parms.ofdm_symbol_size,
                              nsymb,                 // number of symbols
                              PHY_vars_UE->lte_frame_parms.nb_prefix_samples,               // number of prefix samples
                              CYCLIC_PREFIX);
@@ -1250,6 +1207,7 @@ int main(int argc, char **argv)
           start_meas(&PHY_vars_eNB->phy_proc_rx);
           start_meas(&PHY_vars_eNB->ofdm_demod_stats);
           lte_eNB_I0_measurements(PHY_vars_eNB,
+				  subframe,
                                   0,
                                   1);
 
@@ -1299,6 +1257,7 @@ int main(int argc, char **argv)
 	  */
 
           start_meas(&PHY_vars_eNB->ulsch_decoding_stats);
+
           ret= ulsch_decoding(PHY_vars_eNB,
                               0, // UE_id
                               subframe,
@@ -1335,7 +1294,7 @@ int main(int argc, char **argv)
           if (PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->o_ACK[0] != PHY_vars_UE->ulsch_ue[0]->o_ACK[0])
             ack_errors++;
 
-          //    msg("ulsch_coding: O[%d] %d\n",i,o_flip[i]);
+          //    printf("ulsch_coding: O[%d] %d\n",i,o_flip[i]);
 
 
           if (ret <= PHY_vars_eNB->ulsch_eNB[0]->max_turbo_iterations) {
@@ -1396,9 +1355,9 @@ int main(int argc, char **argv)
         if ((errs[0]>=100) && (trials>(n_frames/2)))
           break;
 
-#ifdef XFORMS
-        phy_scope_eNB(form_enb,PHY_vars_eNB,0);
-#endif
+	if (xforms==1)
+	  phy_scope_eNB(form_enb,PHY_vars_eNB,0);
+
         /*calculate the total processing time for each packet, get the max, min, and number of packets that exceed t>3000us*/
 
         double t_tx = (double)PHY_vars_UE->phy_proc_tx.p_time/cpu_freq_GHz/1000.0;
@@ -1558,7 +1517,7 @@ int main(int argc, char **argv)
              rate*effective_rate,
              100*effective_rate,
              rate,
-             rate*get_Qm(mcs),
+             rate*get_Qm_ul(mcs),
              (1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])/
              (double)PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->TBS,
              (1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0]));
diff --git a/openair1/SIMULATION/TOOLS/abstraction.c b/openair1/SIMULATION/TOOLS/abstraction.c
index 3720d9f99895becb2388bac4830cbb56ead1809a..591b238acfafdd32d00cddeccd2a66d42cbb308c 100644
--- a/openair1/SIMULATION/TOOLS/abstraction.c
+++ b/openair1/SIMULATION/TOOLS/abstraction.c
@@ -45,7 +45,7 @@ double **cos_lut=NULL,**sin_lut=NULL;
 
 
 
-void init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples)
+int init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples)
 {
 
 
@@ -54,15 +54,17 @@ void init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples)
   int16_t f;
   uint8_t l;
 
+  if ((n_samples&1)==0) {
+    fprintf(stderr, "freq_channel_init: n_samples has to be odd\n");
+    return(-1); 
+  }
 
   cos_lut = (double **)malloc(n_samples*sizeof(double*));
   sin_lut = (double **)malloc(n_samples*sizeof(double*));
 
-
-
   delta_f = nb_rb*180000/(n_samples-1);
 
-  for (f=-(n_samples>>1); f<(n_samples>>1); f++) {
+  for (f=-(n_samples>>1); f<=(n_samples>>1); f++) {
     freq=delta_f*(double)f*1e-6;// due to the fact that delays is in mus
 
     cos_lut[f+(n_samples>>1)] = (double *)malloc((int)desc->nb_taps*sizeof(double));
@@ -81,9 +83,11 @@ void init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples)
 
     }
   }
+
+  return(0);
 }
 
-void freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples)
+int freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples)
 {
 
 
@@ -93,22 +97,32 @@ void freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples)
   static int freq_channel_init=0;
   static int n_samples_max=0;
 
-  // printf("no of samples:%d,",n_samples);
+  // do some error checking
+  // n_samples has to be a odd number because we assume the spectrum is symmetric around the DC and includes the DC
+  if ((n_samples&1)==0) {
+    fprintf(stderr, "freq_channel: n_samples has to be odd\n");
+    return(-1); 
+  }
+
   // printf("no of taps:%d,",(int)desc->nb_taps);
 
   if (freq_channel_init == 0) {
     // we are initializing the lut for the largets possible n_samples=12*nb_rb+1
     // if called with n_samples<12*nb_rb+1, we decimate the lut
     n_samples_max=12*nb_rb+1;
-    init_freq_channel(desc,nb_rb,n_samples_max);
-    freq_channel_init=1;
+    if (init_freq_channel(desc,nb_rb,n_samples_max)==0)
+      freq_channel_init=1;
+    else
+      return(-1);
   }
 
-  d=n_samples_max/n_samples;
+  d=(n_samples_max-1)/(n_samples-1);
+
+  //printf("no_samples=%d, n_samples_max=%d, d=%d\n",n_samples,n_samples_max,d);
 
   start_meas(&desc->interp_freq);
 
-  for (f=-n_samples_max/2,f2=-n_samples/2; f<n_samples_max/2; f+=d,f2++) {
+  for (f=-n_samples_max/2,f2=-n_samples/2; f<=n_samples_max/2; f+=d,f2++) {
     clut = cos_lut[n_samples_max/2+f];
     slut = sin_lut[n_samples_max/2+f];
 
@@ -129,6 +143,8 @@ void freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples)
   }
 
   stop_meas(&desc->interp_freq);
+
+  return(0);
 }
 
 double compute_pbch_sinr(channel_desc_t *desc,
diff --git a/openair1/SIMULATION/TOOLS/defs.h b/openair1/SIMULATION/TOOLS/defs.h
index 0dfea70b890febf0a422674fb05dc33d2c13f95d..c72ea743b1e7a7cfadf39a525c8fd35a9862a090 100644
--- a/openair1/SIMULATION/TOOLS/defs.h
+++ b/openair1/SIMULATION/TOOLS/defs.h
@@ -354,8 +354,8 @@ int gauss(unsigned int *gauss_LUT,unsigned char Nbits);
 double gaussdouble(double,double);
 void randominit(unsigned int seed_init);
 double uniformrandom(void);
-void freq_channel(channel_desc_t *desc,uint16_t nb_rb, int16_t n_samples);
-void init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples);
+int freq_channel(channel_desc_t *desc,uint16_t nb_rb, int16_t n_samples);
+int init_freq_channel(channel_desc_t *desc,uint16_t nb_rb,int16_t n_samples);
 uint8_t multipath_channel_nosigconv(channel_desc_t *desc);
 void multipath_tv_channel(channel_desc_t *desc,
                           double **tx_sig_re,
diff --git a/openair2/COMMON/commonDef.h b/openair2/COMMON/commonDef.h
index e33e64ec063ef031cdb58e0339c42067660e3cfd..64216b009465119c56e0d357dab48875b7c4be08 100644
--- a/openair2/COMMON/commonDef.h
+++ b/openair2/COMMON/commonDef.h
@@ -48,7 +48,19 @@ Description Contains global common definitions
 
 #include <stdint.h>
 #include <stddef.h>
+#include <stdbool.h>
 
+typedef signed char        boolean_t;
+
+#if !defined(TRUE)
+#define TRUE               (boolean_t)0x01
+#endif
+
+#if !defined(FALSE)
+#define FALSE              (boolean_t)0x00
+#endif
+
+#define BOOL_NOT(b) (b^TRUE)
 
 #define NAS_UE_ID_FMT "0x%06x"
 
@@ -59,13 +71,6 @@ Description Contains global common definitions
 #define RETURNok        (0)
 #define RETURNerror     (-1)
 
-#ifndef FALSE
-#define FALSE           (0)
-#endif
-#ifndef TRUE
-#define TRUE            (1)
-#endif
-
 /*
  * Name of the environment variable which defines the default directory
  * where the NAS application is executed and where are located files
diff --git a/openair2/COMMON/openair_defs.h b/openair2/COMMON/openair_defs.h
index 0a6b88ce332a201aea191996bf822ad5206270f5..c2dd4d0616595266f82b28b5c20b91b85a1c5a6d 100755
--- a/openair2/COMMON/openair_defs.h
+++ b/openair2/COMMON/openair_defs.h
@@ -41,7 +41,13 @@
 #if !defined (msg)
 # define msg(aRGS...) LOG_D(PHY, ##aRGS)
 #endif
-#define malloc16(x) memalign(16,x) //malloc(x)
+#ifndef malloc16
+#  ifdef __AVX2__
+#    define malloc16(x) memalign(32,x)
+#  else
+#    define malloc16(x) memalign(16,x)
+#  endif
+#endif
 #define free16(y,x) free(y)
 #define bigmalloc malloc
 #define bigmalloc16 malloc16
diff --git a/openair2/COMMON/platform_types.h b/openair2/COMMON/platform_types.h
index a1af19fd0a1a1e5417d74470eb483dc7f9c44431..6f7722316fcdbe4d51e7442fff87459fd031d111 100755
--- a/openair2/COMMON/platform_types.h
+++ b/openair2/COMMON/platform_types.h
@@ -163,7 +163,13 @@ typedef uint32_t           mbms_session_id_t;
 typedef uint16_t           mbms_service_id_t;
 typedef uint16_t           rnti_t;
 typedef uint8_t            rrc_enb_index_t;
+typedef uint8_t            mme_code_t;
+typedef uint32_t           m_tmsi_t;
 
+//Random UE identity length = 40 bits
+#if ! defined(NOT_A_RANDOM_UE_IDENTITY)
+#define NOT_A_RANDOM_UE_IDENTITY (uint64_t)0xFFFFFFFF
+#endif
 #if ! defined(NOT_A_RNTI)
 #define NOT_A_RNTI (rnti_t)0
 #endif
diff --git a/openair2/COMMON/s1ap_messages_types.h b/openair2/COMMON/s1ap_messages_types.h
index c39725b737f1bb6c0750e1317046366b50679207..f2c6a2a3a27222fb17c7f263c20963e881ef08d1 100644
--- a/openair2/COMMON/s1ap_messages_types.h
+++ b/openair2/COMMON/s1ap_messages_types.h
@@ -112,7 +112,7 @@ typedef struct net_ip_address_s {
   unsigned ipv4:1;
   unsigned ipv6:1;
   char ipv4_address[16];
-  char ipv6_address[40];
+  char ipv6_address[46];
 } net_ip_address_t;
 
 typedef uint64_t bitrate_t;
diff --git a/openair2/ENB_APP/enb_app.c b/openair2/ENB_APP/enb_app.c
index 70fb5ad61f676294814e7a84fe6a1dd400a0a513..6d95c215db79c556923786942343296287d26cf8 100644
--- a/openair2/ENB_APP/enb_app.c
+++ b/openair2/ENB_APP/enb_app.c
@@ -285,6 +285,9 @@ void *eNB_app_task(void *args_p)
   instance_t                      instance;
   int                             result;
 
+  /* for no gcc warnings */
+  (void)instance;
+
   itti_mark_task_ready (TASK_ENB_APP);
 
 # if defined(ENABLE_USE_MME)
@@ -420,5 +423,8 @@ void *eNB_app_task(void *args_p)
 
 #endif
 
+  /* for no gcc warnings */
+  (void)enb_properties_p;
+
   return NULL;
 }
diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c
index 07e0ffa6406da3494da46822a28a470a78e2f179..51d5f3805f22121da975758fe9294afa833e9782 100755
--- a/openair2/ENB_APP/enb_config.c
+++ b/openair2/ENB_APP/enb_config.c
@@ -170,6 +170,18 @@
 #define ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U         "ENB_IPV4_ADDRESS_FOR_S1U"
 #define ENB_CONFIG_STRING_ENB_PORT_FOR_S1U              "ENB_PORT_FOR_S1U"
 
+#define ENB_CONFIG_STRING_RRH_GW_CONFIG                   "rrh_gw_config"
+#define ENB_CONFIG_STRING_RRH_GW_LOCAL_IF_NAME            "local_if_name"
+#define ENB_CONFIG_STRING_RRH_GW_LOCAL_ADDRESS            "local_address"
+#define ENB_CONFIG_STRING_RRH_GW_REMOTE_ADDRESS           "remote_address"
+#define ENB_CONFIG_STRING_RRH_GW_LOCAL_PORT               "local_port"
+#define ENB_CONFIG_STRING_RRH_GW_REMOTE_PORT              "remote_port"
+#define ENB_CONFIG_STRING_RRH_GW_ACTIVE                   "rrh_gw_active"
+#define ENB_CONFIG_STRING_RRH_GW_TRANSPORT_PREFERENCE     "tr_preference"
+#define ENB_CONFIG_STRING_RRH_GW_RF_TARGET_PREFERENCE     "rf_preference"
+#define ENB_CONFIG_STRING_RRH_GW_IQ_TXSHIFT               "iq_txshift"
+#define ENB_CONFIG_STRING_RRH_GW_TX_SAMPLE_ADVANCE        "tx_sample_advance"
+#define ENB_CONFIG_STRING_RRH_GW_TX_SCHEDULING_ADVANCE    "tx_scheduling_advance"
 
 #define ENB_CONFIG_STRING_ASN1_VERBOSITY                   "Asn1_verbosity"
 #define ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE              "none"
@@ -253,7 +265,7 @@ static const eutra_band_t eutra_bands[] = {
 
 Enb_properties_array_t enb_properties;
 
-static void enb_config_display(void)
+void enb_config_display(void)
 {
   int i,j;
 
@@ -274,6 +286,34 @@ static void enb_config_display(void)
     } else {
       printf( "\tMNC:                \t%02"PRIu16":\n",enb_properties.properties[i]->mnc);
     }
+    
+    for (j=0; j< enb_properties.properties[i]->nb_rrh_gw; j++) {
+      if (enb_properties.properties[i]->rrh_gw_config[j].active == 1 ){
+	printf( "\n\tRRH GW %d config for eNB %u:\n\n", j, i);
+	printf( "\tinterface name :       \t%s:\n",enb_properties.properties[i]->rrh_gw_if_name);
+	printf( "\tlocal address  :       \t%s:\n",enb_properties.properties[i]->rrh_gw_config[j].local_address);
+	printf( "\tlocal port     :       \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].local_port);
+	printf( "\tremote address :       \t%s:\n",enb_properties.properties[i]->rrh_gw_config[j].remote_address);
+	printf( "\tremote port    :       \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].remote_port);
+	printf( "\ttx_scheduling_advance :\t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].tx_scheduling_advance);
+	printf( "\ttx_sample_advance :    \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].tx_sample_advance);
+	printf( "\tiq_txshift :           \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].iq_txshift);
+	printf( "\ttransport  :           \t%s Ethernet:\n",(enb_properties.properties[i]->rrh_gw_config[j].raw == 1)? "RAW" : "UDP");
+	if (enb_properties.properties[i]->rrh_gw_config[j].exmimo == 1) {
+	  printf( "\tRF target  :           \tEXMIMO:\n\n");
+	} else if (enb_properties.properties[i]->rrh_gw_config[j].usrp_b200 == 1) {
+	  printf( "\tRF target  :           \tUSRP_B200:\n\n");
+	} else if (enb_properties.properties[i]->rrh_gw_config[j].usrp_x300 == 1) {
+	  printf( "\tRF target  :           \tUSRP_X300:\n\n");
+	} else if (enb_properties.properties[i]->rrh_gw_config[j].bladerf == 1) {
+	  printf( "\tRF target  :           \tBLADERF:\n\n");
+	} else if (enb_properties.properties[i]->rrh_gw_config[j].lmssdr == 1) {
+	  printf( "\tRF target  :           \tLMSSDR:\n\n");
+	} else {
+	  printf( "\tRF target  :           \tNONE:\n\n");
+	}
+      }
+    }
 
     for (j=0; j< enb_properties.properties[i]->nb_cc; j++) {
       printf( "\teutra band for CC %d:         \t%"PRId16":\n",j,enb_properties.properties[i]->eutra_band[j]);
@@ -455,15 +495,18 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
   config_setting_t *setting_srb1                  = NULL;
   config_setting_t *setting_mme_addresses         = NULL;
   config_setting_t *setting_mme_address           = NULL;
+  config_setting_t *setting_rrh_gws               = NULL;
+  config_setting_t *setting_rrh_gw                = NULL;
   config_setting_t *setting_enb                   = NULL;
   config_setting_t *setting_otg                   = NULL;
-  config_setting_t *subsetting_otg                   = NULL;
+  config_setting_t *subsetting_otg                = NULL;
   int               num_enb_properties            = 0;
   int               enb_properties_index          = 0;
   int               num_enbs                      = 0;
   int               num_mme_address               = 0;
-  int               num_otg_elements              =0;
-  int               num_component_carriers        =0;
+  int               num_rrh_gw                    = 0;
+  int               num_otg_elements              = 0;
+  int               num_component_carriers        = 0;
   int               i                             = 0;
   int               j                             = 0;
   int               parse_errors                  = 0;
@@ -519,9 +562,9 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
   const char*       pusch_alpha                   = NULL;
   libconfig_int     pucch_p0_Nominal              = 0;
   libconfig_int     msg3_delta_Preamble           = 0;
-  libconfig_int     ul_CyclicPrefixLength         = 0;
+  //libconfig_int     ul_CyclicPrefixLength         = 0;
   const char*       pucch_deltaF_Format1          = NULL;
-  const char*       pucch_deltaF_Format1a         = NULL;
+  //const char*       pucch_deltaF_Format1a         = NULL;
   const char*       pucch_deltaF_Format1b         = NULL;
   const char*       pucch_deltaF_Format2          = NULL;
   const char*       pucch_deltaF_Format2a         = NULL;
@@ -558,10 +601,21 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
 
   libconfig_int     my_int;
 
+
+  char*             if_name                       = NULL;
   char*             ipv4                          = NULL;
+  char*             ipv4_remote                   = NULL;
   char*             ipv6                          = NULL;
   char*             active                        = NULL;
   char*             preference                    = NULL;
+
+  char*             tr_preference                 = NULL;
+  char*             rf_preference                 = NULL;
+  libconfig_int     tx_scheduling_advance         = 0;
+  libconfig_int     tx_sample_advance             = 0;
+  libconfig_int     iq_txshift                    = 0;
+  libconfig_int     local_port                    = 0;
+  libconfig_int     remote_port                   = 0;
   const char*       active_enb[MAX_ENB];
   char*             enb_interface_name_for_S1U    = NULL;
   char*             enb_ipv4_address_for_S1U      = NULL;
@@ -595,6 +649,10 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
   char*             osa_log_level                 = NULL;
   char*             osa_log_verbosity             = NULL;
 
+  /* for no gcc warnings */
+  (void)astring;
+  (void)my_int;
+
   memset((char*) (enb_properties.properties), 0 , MAX_ENB * sizeof(Enb_properties_t *));
   memset((char*)active_enb,     0 , MAX_ENB * sizeof(char*));
 
@@ -965,7 +1023,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
 
               enb_properties.properties[enb_properties_index]->prach_zero_correlation[j] =prach_zero_correlation;
 
-              if ((prach_zero_correlation <0) || (prach_zero_correlation > 63))
+              if ((prach_zero_correlation <0) || (prach_zero_correlation > 15))
                 AssertError (0, parse_errors ++,
                              "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_zero_correlation choice: 0..15!\n",
                              lib_config_file_name_pP, i, prach_zero_correlation);
@@ -2136,6 +2194,97 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
               enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6 = 1;
             }
           }
+	  // RRH Config 
+	  setting_rrh_gws = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_RRH_GW_CONFIG);
+	  if ( setting_rrh_gws != NULL) {
+          num_rrh_gw     = config_setting_length(setting_rrh_gws);
+          enb_properties.properties[enb_properties_index]->nb_rrh_gw = 0;
+
+          for (j = 0; j < num_rrh_gw; j++) {
+            setting_rrh_gw = config_setting_get_elem(setting_rrh_gws, j);
+
+            if (  !(
+                   config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_LOCAL_IF_NAME, (const char **)&if_name)
+		   && config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_LOCAL_ADDRESS, (const char **)&ipv4)
+                   && config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_REMOTE_ADDRESS , (const char **)&ipv4_remote)
+                   && config_setting_lookup_int(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_LOCAL_PORT, &local_port)
+                   && config_setting_lookup_int(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_REMOTE_PORT, &remote_port)
+                   && config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_ACTIVE, (const char **)&active)
+		   && config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_TRANSPORT_PREFERENCE, (const char **)&tr_preference)
+		   && config_setting_lookup_string(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_RF_TARGET_PREFERENCE, (const char **)&rf_preference)
+		   && config_setting_lookup_int(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_IQ_TXSHIFT, &iq_txshift) 
+		   && config_setting_lookup_int(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_TX_SAMPLE_ADVANCE, &tx_sample_advance)
+		   && config_setting_lookup_int(setting_rrh_gw, ENB_CONFIG_STRING_RRH_GW_TX_SCHEDULING_ADVANCE, &tx_scheduling_advance)
+                 )
+              ) {
+              AssertError (0, parse_errors ++,
+                           "Failed to parse eNB configuration file %s, %u th enb %u the RRH GW address !\n",
+                           lib_config_file_name_pP, i, j);
+              continue; // FIXME will prevent segfaults below, not sure what happens at function exit...
+            }
+
+            enb_properties.properties[enb_properties_index]->nb_rrh_gw += 1;
+
+	    enb_properties.properties[enb_properties_index]->rrh_gw_if_name = strdup(if_name);
+            enb_properties.properties[enb_properties_index]->rrh_gw_config[j].local_address  = strdup(ipv4);
+            enb_properties.properties[enb_properties_index]->rrh_gw_config[j].remote_address = strdup(ipv4_remote);
+	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].local_port = local_port;
+	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].remote_port = remote_port;
+	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].iq_txshift = iq_txshift;
+	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].tx_sample_advance = tx_sample_advance;
+	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].tx_scheduling_advance= tx_scheduling_advance;
+
+            if (strcmp(active, "yes") == 0) {
+              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].active = 1;
+            } 
+
+            if (strcmp(tr_preference, "udp") == 0) {
+              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udp = 1;
+            } else if (strcmp(tr_preference, "raw") == 0) {
+              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].raw = 1;
+            } else {//if (strcmp(preference, "no") == 0) 
+              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udp = 1;
+              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].raw = 1;
+            }
+
+	    if (strcmp(rf_preference, "exmimo") == 0) {
+              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].exmimo = 1;
+            } else if (strcmp(rf_preference, "usrp_b200") == 0) {
+              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].usrp_b200 = 1;
+	    } else if (strcmp(rf_preference, "usrp_x300") == 0) {
+              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].usrp_x300 = 1;
+            } else if (strcmp(rf_preference, "bladerf") == 0) {
+              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].bladerf = 1;
+	    } else if (strcmp(rf_preference, "bladerf") == 0) {
+              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].lmssdr = 1;	      
+            } else {//if (strcmp(preference, "no") == 0) 
+              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].exmimo = 1;
+              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].usrp_b200 = 1;
+              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].usrp_x300 = 1;
+              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].bladerf = 1;    
+              enb_properties.properties[enb_properties_index]->rrh_gw_config[j].lmssdr = 1;    
+
+            }
+          }
+	  } else {
+	    enb_properties.properties[enb_properties_index]->nb_rrh_gw = 0;	    
+	    enb_properties.properties[enb_properties_index]->rrh_gw_if_name = "none";
+            enb_properties.properties[enb_properties_index]->rrh_gw_config[j].local_address  = "0.0.0.0";
+            enb_properties.properties[enb_properties_index]->rrh_gw_config[j].remote_address = "0.0.0.0";
+	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].local_port= 0;
+	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].remote_port= 0;	    
+	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].active = 0;	    
+	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].udp = 0;
+	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].raw = 0;
+	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].tx_scheduling_advance = 0;
+	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].tx_sample_advance = 0;
+	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].iq_txshift = 0;
+	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].exmimo = 0;
+	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].usrp_b200 = 0;
+	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].usrp_x300 = 0;
+	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].bladerf = 0;
+	    enb_properties.properties[enb_properties_index]->rrh_gw_config[j].lmssdr = 0;
+	  }
 
           // SCTP SETTING
           enb_properties.properties[enb_properties_index]->sctp_out_streams = SCTP_OUT_STREAMS;
diff --git a/openair2/ENB_APP/enb_config.h b/openair2/ENB_APP/enb_config.h
index 113681dafe62cd476c14ace0c09dc1644a1b4b62..5f7f2636a38ab49c7cfcbcfa5f6dc88103704d4e 100755
--- a/openair2/ENB_APP/enb_config.h
+++ b/openair2/ENB_APP/enb_config.h
@@ -78,6 +78,24 @@ typedef struct mme_ip_address_s {
   char     *ipv6_address;
 } mme_ip_address_t;
 
+typedef struct rrh_gw_config_s {
+  unsigned  udp:1;
+  unsigned  raw:1;
+  unsigned  active:1;
+  char     *local_address;
+  char     *remote_address;
+  uint16_t  local_port;
+  uint16_t  remote_port;
+  int tx_scheduling_advance;
+  int tx_sample_advance;
+  int iq_txshift;
+  unsigned  exmimo:1;
+  unsigned  usrp_b200:1;
+  unsigned  usrp_x300:1;
+  unsigned  bladerf:1; 
+  unsigned  lmssdr:1;  
+} rrh_gw_config_t;
+
 typedef struct Enb_properties_s {
   /* Unique eNB_id to identify the eNB within EPC.
    * For macro eNB ids this field should be 20 bits long.
@@ -203,6 +221,13 @@ typedef struct Enb_properties_s {
   char               *enb_interface_name_for_S1_MME;
   in_addr_t           enb_ipv4_address_for_S1_MME;
 
+
+  /* Nb of RRH to connect to */
+  uint8_t             nb_rrh_gw;
+  char               *rrh_gw_if_name;
+  /* List of MME to connect to */
+  rrh_gw_config_t       rrh_gw_config[4];
+
   // otg config
   /* Nb of OTG elements */
   uint8_t            num_otg_elements;
@@ -239,6 +264,7 @@ typedef struct Enb_properties_array_s {
   Enb_properties_t    *properties[MAX_ENB];
 } Enb_properties_array_t;
 
+void                          enb_config_display(void);
 const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP);
 
 const Enb_properties_array_t *enb_config_get(void);
diff --git a/openair2/LAYER2/MAC/config.c b/openair2/LAYER2/MAC/config.c
index 55b30acc6f3d7d89a5f1404caf0612e853823387..32089803ade9b2bacac5f80d1fd4126d405bab31 100644
--- a/openair2/LAYER2/MAC/config.c
+++ b/openair2/LAYER2/MAC/config.c
@@ -90,8 +90,8 @@ void ue_mac_reset(module_id_t module_idP,uint8_t eNB_index)
 
 int
 rrc_mac_config_req(
-  module_id_t                      Mod_id,
-  int                              CC_id,
+  module_id_t                      Mod_idP,
+  int                              CC_idP,
   eNB_flag_t                       eNB_flagP,
   rnti_t                           rntiP,
   uint8_t                          eNB_index,
@@ -129,28 +129,31 @@ rrc_mac_config_req(
   int i;
 
   int UE_id = -1;
+  eNB_MAC_INST *eNB = &eNB_mac_inst[Mod_idP];
+  UE_list_t *UE_list= &eNB->UE_list;
+
   VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_MAC_CONFIG, VCD_FUNCTION_IN);
 
   if (eNB_flagP==0) {
-    LOG_I(MAC,"[CONFIG][UE %d] Configuring MAC/PHY from eNB %d\n",Mod_id,eNB_index);
+    LOG_I(MAC,"[CONFIG][UE %d] Configuring MAC/PHY from eNB %d\n",Mod_idP,eNB_index);
 
     if (tdd_Config != NULL) {
-      UE_mac_inst[Mod_id].tdd_Config = tdd_Config;
+      UE_mac_inst[Mod_idP].tdd_Config = tdd_Config;
     }
   } else {
-    UE_id = find_UE_id(Mod_id, rntiP);
+    UE_id = find_UE_id(Mod_idP, rntiP);
     if (physicalConfigDedicated == NULL) {
-      LOG_I(MAC,"[CONFIG][eNB %d/%d] Configuring MAC/PHY\n", Mod_id, CC_id);
+      LOG_I(MAC,"[CONFIG][eNB %d/%d] Configuring MAC/PHY\n", Mod_idP, CC_idP);
     } else {
-      LOG_I(MAC,"[CONFIG][eNB %d/%d] Configuring MAC/PHY for UE %d (%x)\n", Mod_id, CC_id, UE_id, UE_RNTI(Mod_id, UE_id));
+      LOG_I(MAC,"[CONFIG][eNB %d/%d] Configuring MAC/PHY for UE %d (%x)\n", Mod_idP, CC_idP, UE_id, UE_RNTI(Mod_idP, UE_id));
     }
   }
 
   if (tdd_Config && SIwindowsize && SIperiod) {
     if (eNB_flagP == ENB_FLAG_YES) {
-      mac_xface->phy_config_sib1_eNB(Mod_id, CC_id, tdd_Config, *SIwindowsize, *SIperiod);
+      mac_xface->phy_config_sib1_eNB(Mod_idP, CC_idP, tdd_Config, *SIwindowsize, *SIperiod);
     } else {
-      mac_xface->phy_config_sib1_ue(Mod_id,0,eNB_index,tdd_Config,*SIwindowsize,*SIperiod);
+      mac_xface->phy_config_sib1_ue(Mod_idP,0,eNB_index,tdd_Config,*SIwindowsize,*SIperiod);
     }
   }
 
@@ -165,106 +168,112 @@ rrc_mac_config_req(
       LOG_I(MAC,"[CONFIG]pusch_config_common.groupAssignmentPUSCH = %ld\n",radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH);
       LOG_I(MAC,"[CONFIG]pusch_config_common.sequenceHoppingEnabled = %d\n",radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled);
       LOG_I(MAC,"[CONFIG]pusch_config_common.cyclicShift  = %ld\n",radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.cyclicShift);
-      mac_xface->phy_config_sib2_eNB(Mod_id, CC_id, radioResourceConfigCommon, ul_CarrierFreq, ul_Bandwidth, additionalSpectrumEmission, mbsfn_SubframeConfigList);
+      mac_xface->phy_config_sib2_eNB(Mod_idP, CC_idP, radioResourceConfigCommon, ul_CarrierFreq, ul_Bandwidth, additionalSpectrumEmission, mbsfn_SubframeConfigList);
     } else {
-      UE_mac_inst[Mod_id].radioResourceConfigCommon = radioResourceConfigCommon;
-      mac_xface->phy_config_sib2_ue(Mod_id,0,eNB_index,radioResourceConfigCommon,ul_CarrierFreq,ul_Bandwidth,additionalSpectrumEmission,mbsfn_SubframeConfigList);
+      UE_mac_inst[Mod_idP].radioResourceConfigCommon = radioResourceConfigCommon;
+      mac_xface->phy_config_sib2_ue(Mod_idP,0,eNB_index,radioResourceConfigCommon,ul_CarrierFreq,ul_Bandwidth,additionalSpectrumEmission,mbsfn_SubframeConfigList);
     }
   }
 
   // SRB2_lchan_config->choice.explicitValue.ul_SpecificParameters->logicalChannelGroup
   if (logicalChannelConfig!= NULL) {
     if (eNB_flagP==0) {
-      LOG_I(MAC,"[CONFIG][UE %d] Applying RRC logicalChannelConfig from eNB%d\n",Mod_id,eNB_index);
-      UE_mac_inst[Mod_id].logicalChannelConfig[logicalChannelIdentity]=logicalChannelConfig;
-      UE_mac_inst[Mod_id].scheduling_info.Bj[logicalChannelIdentity]=0; // initilize the bucket for this lcid
+      LOG_I(MAC,"[CONFIG][UE %d] Applying RRC logicalChannelConfig from eNB%d\n",Mod_idP,eNB_index);
+      UE_mac_inst[Mod_idP].logicalChannelConfig[logicalChannelIdentity]=logicalChannelConfig;
+      UE_mac_inst[Mod_idP].scheduling_info.Bj[logicalChannelIdentity]=0; // initilize the bucket for this lcid
 
       if (logicalChannelConfig->ul_SpecificParameters) {
-        UE_mac_inst[Mod_id].scheduling_info.bucket_size[logicalChannelIdentity]=logicalChannelConfig->ul_SpecificParameters->prioritisedBitRate *
+        UE_mac_inst[Mod_idP].scheduling_info.bucket_size[logicalChannelIdentity]=logicalChannelConfig->ul_SpecificParameters->prioritisedBitRate *
             logicalChannelConfig->ul_SpecificParameters->bucketSizeDuration; // set the max bucket size
-        UE_mac_inst[Mod_id].scheduling_info.LCGID[logicalChannelIdentity]=*logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup;
-        LOG_D(MAC,"[CONFIG][UE %d] LCID %d is attached to the LCGID %d\n",Mod_id,logicalChannelIdentity,*logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup);
+        UE_mac_inst[Mod_idP].scheduling_info.LCGID[logicalChannelIdentity]=*logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup;
+        LOG_D(MAC,"[CONFIG][UE %d] LCID %d is attached to the LCGID %d\n",Mod_idP,logicalChannelIdentity,*logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup);
       } else {
-        LOG_E(MAC,"[CONFIG][UE %d] LCID %d NULL ul_SpecificParameters\n",Mod_id,logicalChannelIdentity);
+        LOG_E(MAC,"[CONFIG][UE %d] LCID %d NULL ul_SpecificParameters\n",Mod_idP,logicalChannelIdentity);
         mac_xface->macphy_exit("NULL ul_SpecificParameters");
       }
     }
+    else {
+      if (logicalChannelConfig)
+	UE_list->UE_template[CC_idP][UE_id].lcgidmap[logicalChannelIdentity] = *logicalChannelConfig->ul_SpecificParameters->logicalChannelGroup;
+      else
+	UE_list->UE_template[CC_idP][UE_id].lcgidmap[logicalChannelIdentity] = 0;
+    }
   }
 
   if (mac_MainConfig != NULL) {
     if (eNB_flagP==0) {
-      LOG_I(MAC,"[CONFIG][UE%d] Applying RRC macMainConfig from eNB%d\n",Mod_id,eNB_index);
-      UE_mac_inst[Mod_id].macConfig=mac_MainConfig;
-      UE_mac_inst[Mod_id].measGapConfig=measGapConfig;
+      LOG_I(MAC,"[CONFIG][UE%d] Applying RRC macMainConfig from eNB%d\n",Mod_idP,eNB_index);
+      UE_mac_inst[Mod_idP].macConfig=mac_MainConfig;
+      UE_mac_inst[Mod_idP].measGapConfig=measGapConfig;
 
       if (mac_MainConfig->ul_SCH_Config) {
 
         if (mac_MainConfig->ul_SCH_Config->periodicBSR_Timer) {
-          UE_mac_inst[Mod_id].scheduling_info.periodicBSR_Timer = (uint16_t) *mac_MainConfig->ul_SCH_Config->periodicBSR_Timer;
+          UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_Timer = (uint16_t) *mac_MainConfig->ul_SCH_Config->periodicBSR_Timer;
         } else {
-          UE_mac_inst[Mod_id].scheduling_info.periodicBSR_Timer = (uint16_t) MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_infinity;
+          UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_Timer = (uint16_t) MAC_MainConfig__ul_SCH_Config__periodicBSR_Timer_infinity;
         }
 
         if (mac_MainConfig->ul_SCH_Config->maxHARQ_Tx) {
-          UE_mac_inst[Mod_id].scheduling_info.maxHARQ_Tx     = (uint16_t) *mac_MainConfig->ul_SCH_Config->maxHARQ_Tx;
+          UE_mac_inst[Mod_idP].scheduling_info.maxHARQ_Tx     = (uint16_t) *mac_MainConfig->ul_SCH_Config->maxHARQ_Tx;
         } else {
-          UE_mac_inst[Mod_id].scheduling_info.maxHARQ_Tx     = (uint16_t) MAC_MainConfig__ul_SCH_Config__maxHARQ_Tx_n5;
+          UE_mac_inst[Mod_idP].scheduling_info.maxHARQ_Tx     = (uint16_t) MAC_MainConfig__ul_SCH_Config__maxHARQ_Tx_n5;
         }
 
         if (mac_MainConfig->ul_SCH_Config->retxBSR_Timer) {
-          UE_mac_inst[Mod_id].scheduling_info.retxBSR_Timer     = (uint16_t) mac_MainConfig->ul_SCH_Config->retxBSR_Timer;
+          UE_mac_inst[Mod_idP].scheduling_info.retxBSR_Timer     = (uint16_t) mac_MainConfig->ul_SCH_Config->retxBSR_Timer;
         } else {
-          UE_mac_inst[Mod_id].scheduling_info.retxBSR_Timer     = (uint16_t)MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf2560;
+          UE_mac_inst[Mod_idP].scheduling_info.retxBSR_Timer     = (uint16_t)MAC_MainConfig__ul_SCH_Config__retxBSR_Timer_sf2560;
       }
       }
 
 #ifdef Rel10
 
       if (mac_MainConfig->ext1 && mac_MainConfig->ext1->sr_ProhibitTimer_r9) {
-        UE_mac_inst[Mod_id].scheduling_info.sr_ProhibitTimer  = (uint16_t) *mac_MainConfig->ext1->sr_ProhibitTimer_r9;
+        UE_mac_inst[Mod_idP].scheduling_info.sr_ProhibitTimer  = (uint16_t) *mac_MainConfig->ext1->sr_ProhibitTimer_r9;
       } else {
-        UE_mac_inst[Mod_id].scheduling_info.sr_ProhibitTimer  = (uint16_t) 0;
+        UE_mac_inst[Mod_idP].scheduling_info.sr_ProhibitTimer  = (uint16_t) 0;
       }
 
 #endif
-      UE_mac_inst[Mod_id].scheduling_info.periodicBSR_SF  = get_sf_periodicBSRTimer(UE_mac_inst[Mod_id].scheduling_info.periodicBSR_Timer);
-      UE_mac_inst[Mod_id].scheduling_info.retxBSR_SF     = get_sf_retxBSRTimer(UE_mac_inst[Mod_id].scheduling_info.retxBSR_Timer);
+      UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_SF  = get_sf_periodicBSRTimer(UE_mac_inst[Mod_idP].scheduling_info.periodicBSR_Timer);
+      UE_mac_inst[Mod_idP].scheduling_info.retxBSR_SF     = get_sf_retxBSRTimer(UE_mac_inst[Mod_idP].scheduling_info.retxBSR_Timer);
 
-      UE_mac_inst[Mod_id].scheduling_info.drx_config     = mac_MainConfig->drx_Config;
-      UE_mac_inst[Mod_id].scheduling_info.phr_config     = mac_MainConfig->phr_Config;
+      UE_mac_inst[Mod_idP].scheduling_info.drx_config     = mac_MainConfig->drx_Config;
+      UE_mac_inst[Mod_idP].scheduling_info.phr_config     = mac_MainConfig->phr_Config;
 
       if (mac_MainConfig->phr_Config) {
-        UE_mac_inst[Mod_id].PHR_state = mac_MainConfig->phr_Config->present;
-        UE_mac_inst[Mod_id].PHR_reconfigured = 1;
-        UE_mac_inst[Mod_id].scheduling_info.periodicPHR_Timer = mac_MainConfig->phr_Config->choice.setup.periodicPHR_Timer;
-        UE_mac_inst[Mod_id].scheduling_info.prohibitPHR_Timer = mac_MainConfig->phr_Config->choice.setup.prohibitPHR_Timer;
-        UE_mac_inst[Mod_id].scheduling_info.PathlossChange = mac_MainConfig->phr_Config->choice.setup.dl_PathlossChange;
+        UE_mac_inst[Mod_idP].PHR_state = mac_MainConfig->phr_Config->present;
+        UE_mac_inst[Mod_idP].PHR_reconfigured = 1;
+        UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_Timer = mac_MainConfig->phr_Config->choice.setup.periodicPHR_Timer;
+        UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_Timer = mac_MainConfig->phr_Config->choice.setup.prohibitPHR_Timer;
+        UE_mac_inst[Mod_idP].scheduling_info.PathlossChange = mac_MainConfig->phr_Config->choice.setup.dl_PathlossChange;
       } else {
-        UE_mac_inst[Mod_id].PHR_reconfigured = 0;
-        UE_mac_inst[Mod_id].PHR_state = MAC_MainConfig__phr_Config_PR_setup;
-        UE_mac_inst[Mod_id].scheduling_info.periodicPHR_Timer = MAC_MainConfig__phr_Config__setup__periodicPHR_Timer_sf20;
-        UE_mac_inst[Mod_id].scheduling_info.prohibitPHR_Timer = MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf20;
-        UE_mac_inst[Mod_id].scheduling_info.PathlossChange = MAC_MainConfig__phr_Config__setup__dl_PathlossChange_dB1;
+        UE_mac_inst[Mod_idP].PHR_reconfigured = 0;
+        UE_mac_inst[Mod_idP].PHR_state = MAC_MainConfig__phr_Config_PR_setup;
+        UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_Timer = MAC_MainConfig__phr_Config__setup__periodicPHR_Timer_sf20;
+        UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_Timer = MAC_MainConfig__phr_Config__setup__prohibitPHR_Timer_sf20;
+        UE_mac_inst[Mod_idP].scheduling_info.PathlossChange = MAC_MainConfig__phr_Config__setup__dl_PathlossChange_dB1;
       }
 
-      UE_mac_inst[Mod_id].scheduling_info.periodicPHR_SF =  get_sf_perioidicPHR_Timer(UE_mac_inst[Mod_id].scheduling_info.periodicPHR_Timer);
-      UE_mac_inst[Mod_id].scheduling_info.prohibitPHR_SF =  get_sf_prohibitPHR_Timer(UE_mac_inst[Mod_id].scheduling_info.prohibitPHR_Timer);
-      UE_mac_inst[Mod_id].scheduling_info.PathlossChange_db =  get_db_dl_PathlossChange(UE_mac_inst[Mod_id].scheduling_info.PathlossChange);
+      UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_SF =  get_sf_perioidicPHR_Timer(UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_Timer);
+      UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_SF =  get_sf_prohibitPHR_Timer(UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_Timer);
+      UE_mac_inst[Mod_idP].scheduling_info.PathlossChange_db =  get_db_dl_PathlossChange(UE_mac_inst[Mod_idP].scheduling_info.PathlossChange);
       LOG_D(MAC,"[UE %d] config PHR (%d): periodic %d (SF) prohibit %d (SF)  pathlosschange %d (db) \n",
-            Mod_id,
+            Mod_idP,
             (mac_MainConfig->phr_Config)?mac_MainConfig->phr_Config->present:-1,
-            UE_mac_inst[Mod_id].scheduling_info.periodicPHR_SF,
-            UE_mac_inst[Mod_id].scheduling_info.prohibitPHR_SF,
-            UE_mac_inst[Mod_id].scheduling_info.PathlossChange_db);
+            UE_mac_inst[Mod_idP].scheduling_info.periodicPHR_SF,
+            UE_mac_inst[Mod_idP].scheduling_info.prohibitPHR_SF,
+            UE_mac_inst[Mod_idP].scheduling_info.PathlossChange_db);
     }
   }
 
   if (physicalConfigDedicated != NULL) {
     if (eNB_flagP==1) {
-      mac_xface->phy_config_dedicated_eNB(Mod_id, CC_id, UE_RNTI(Mod_id, UE_id), physicalConfigDedicated);
+      mac_xface->phy_config_dedicated_eNB(Mod_idP, CC_idP, UE_RNTI(Mod_idP, UE_id), physicalConfigDedicated);
     } else {
-      mac_xface->phy_config_dedicated_ue(Mod_id,0,eNB_index,physicalConfigDedicated);
-      UE_mac_inst[Mod_id].physicalConfigDedicated=physicalConfigDedicated; // for SR proc
+      mac_xface->phy_config_dedicated_ue(Mod_idP,0,eNB_index,physicalConfigDedicated);
+      UE_mac_inst[Mod_idP].physicalConfigDedicated=physicalConfigDedicated; // for SR proc
     }
   }
 
@@ -273,11 +282,12 @@ rrc_mac_config_req(
   if (sCellToAddMod_r10 != NULL) {
 
     if (eNB_flagP==1) {
-      mac_xface->phy_config_dedicated_scell_eNB(Mod_id,UE_RNTI(Mod_id,UE_id),sCellToAddMod_r10,1);
+      mac_xface->phy_config_dedicated_scell_eNB(Mod_idP,UE_RNTI(Mod_idP,UE_id),sCellToAddMod_r10,1);
     } else {
-#warning "phy_config_dedicated_scell_ue is empty"
-      mac_xface->phy_config_dedicated_scell_ue(Mod_id,eNB_index,sCellToAddMod_r10,1);
-      UE_mac_inst[Mod_id].physicalConfigDedicatedSCell_r10 = sCellToAddMod_r10->radioResourceConfigDedicatedSCell_r10->physicalConfigDedicatedSCell_r10; // using SCell index 0
+
+	//#warning "phy_config_dedicated_scell_ue is empty"
+      mac_xface->phy_config_dedicated_scell_ue(Mod_idP,eNB_index,sCellToAddMod_r10,1);
+      UE_mac_inst[Mod_idP].physicalConfigDedicatedSCell_r10 = sCellToAddMod_r10->radioResourceConfigDedicatedSCell_r10->physicalConfigDedicatedSCell_r10; // using SCell index 0
     }
   }
 
@@ -286,22 +296,22 @@ rrc_mac_config_req(
   if (eNB_flagP == 0) {
     if (measObj!= NULL) {
       if (measObj[0]!= NULL) {
-        UE_mac_inst[Mod_id].n_adj_cells = measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList->list.count;
-        LOG_I(MAC,"Number of adjacent cells %d\n",UE_mac_inst[Mod_id].n_adj_cells);
+        UE_mac_inst[Mod_idP].n_adj_cells = measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList->list.count;
+        LOG_I(MAC,"Number of adjacent cells %d\n",UE_mac_inst[Mod_idP].n_adj_cells);
 
-        for (i=0; i<UE_mac_inst[Mod_id].n_adj_cells; i++) {
-          UE_mac_inst[Mod_id].adj_cell_id[i] = measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList->list.array[i]->physCellId;
-          LOG_I(MAC,"Cell %d : Nid_cell %d\n",i,UE_mac_inst[Mod_id].adj_cell_id[i]);
+        for (i=0; i<UE_mac_inst[Mod_idP].n_adj_cells; i++) {
+          UE_mac_inst[Mod_idP].adj_cell_id[i] = measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList->list.array[i]->physCellId;
+          LOG_I(MAC,"Cell %d : Nid_cell %d\n",i,UE_mac_inst[Mod_idP].adj_cell_id[i]);
         }
 
-        mac_xface->phy_config_meas_ue(Mod_id,0,eNB_index,UE_mac_inst[Mod_id].n_adj_cells,UE_mac_inst[Mod_id].adj_cell_id);
+        mac_xface->phy_config_meas_ue(Mod_idP,0,eNB_index,UE_mac_inst[Mod_idP].n_adj_cells,UE_mac_inst[Mod_idP].adj_cell_id);
       }
 
       /*
       if (quantityConfig != NULL) {
       if (quantityConfig[0] != NULL) {
-      UE_mac_inst[Mod_id].quantityConfig = quantityConfig[0];
-      LOG_I(MAC,"UE %d configured filterCoeff.",UE_mac_inst[Mod_id].crnti);
+      UE_mac_inst[Mod_idP].quantityConfig = quantityConfig[0];
+      LOG_I(MAC,"UE %d configured filterCoeff.",UE_mac_inst[Mod_idP].crnti);
       mac_xface->phy_config_meas_ue
       }
       }
@@ -312,51 +322,51 @@ rrc_mac_config_req(
   if (eNB_flagP==0) {
     if(mobilityControlInfo != NULL) {
 
-      LOG_D(MAC,"[UE%d] MAC Reset procedure triggered by RRC eNB %d \n",Mod_id,eNB_index);
-      ue_mac_reset(Mod_id,eNB_index);
+      LOG_D(MAC,"[UE%d] MAC Reset procedure triggered by RRC eNB %d \n",Mod_idP,eNB_index);
+      ue_mac_reset(Mod_idP,eNB_index);
 
       if(mobilityControlInfo->radioResourceConfigCommon.rach_ConfigCommon) {
-        memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->rach_ConfigCommon,
+        memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->rach_ConfigCommon,
                (void *)mobilityControlInfo->radioResourceConfigCommon.rach_ConfigCommon,
                sizeof(RACH_ConfigCommon_t));
       }
 
-      memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->prach_Config.prach_ConfigInfo,
+      memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->prach_Config.prach_ConfigInfo,
              (void *)mobilityControlInfo->radioResourceConfigCommon.prach_Config.prach_ConfigInfo,
              sizeof(PRACH_ConfigInfo_t));
-      UE_mac_inst[Mod_id].radioResourceConfigCommon->prach_Config.rootSequenceIndex = mobilityControlInfo->radioResourceConfigCommon.prach_Config.rootSequenceIndex;
+      UE_mac_inst[Mod_idP].radioResourceConfigCommon->prach_Config.rootSequenceIndex = mobilityControlInfo->radioResourceConfigCommon.prach_Config.rootSequenceIndex;
 
       if(mobilityControlInfo->radioResourceConfigCommon.pdsch_ConfigCommon) {
-        memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->pdsch_ConfigCommon,
+        memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->pdsch_ConfigCommon,
                (void *)mobilityControlInfo->radioResourceConfigCommon.pdsch_ConfigCommon,
                sizeof(PDSCH_ConfigCommon_t));
       }
 
       // not a pointer: mobilityControlInfo->radioResourceConfigCommon.pusch_ConfigCommon
-      memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->pusch_ConfigCommon,
+      memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->pusch_ConfigCommon,
              (void *)&mobilityControlInfo->radioResourceConfigCommon.pusch_ConfigCommon,
              sizeof(PUSCH_ConfigCommon_t));
 
       if(mobilityControlInfo->radioResourceConfigCommon.phich_Config) {
-        /* memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->phich_Config,
+        /* memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->phich_Config,
         (void *)mobilityControlInfo->radioResourceConfigCommon.phich_Config,
         sizeof(PHICH_Config_t)); */
       }
 
       if(mobilityControlInfo->radioResourceConfigCommon.pucch_ConfigCommon) {
-        memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->pucch_ConfigCommon,
+        memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->pucch_ConfigCommon,
                (void *)mobilityControlInfo->radioResourceConfigCommon.pucch_ConfigCommon,
                sizeof(PUCCH_ConfigCommon_t));
       }
 
       if(mobilityControlInfo->radioResourceConfigCommon.soundingRS_UL_ConfigCommon) {
-        memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->soundingRS_UL_ConfigCommon,
+        memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->soundingRS_UL_ConfigCommon,
                (void *)mobilityControlInfo->radioResourceConfigCommon.soundingRS_UL_ConfigCommon,
                sizeof(SoundingRS_UL_ConfigCommon_t));
       }
 
       if(mobilityControlInfo->radioResourceConfigCommon.uplinkPowerControlCommon) {
-        memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->uplinkPowerControlCommon,
+        memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->uplinkPowerControlCommon,
                (void *)mobilityControlInfo->radioResourceConfigCommon.uplinkPowerControlCommon,
                sizeof(UplinkPowerControlCommon_t));
       }
@@ -367,54 +377,54 @@ rrc_mac_config_req(
       }
 
       if(mobilityControlInfo->radioResourceConfigCommon.tdd_Config) {
-        UE_mac_inst[Mod_id].tdd_Config = mobilityControlInfo->radioResourceConfigCommon.tdd_Config;
+        UE_mac_inst[Mod_idP].tdd_Config = mobilityControlInfo->radioResourceConfigCommon.tdd_Config;
       }
 
       if(mobilityControlInfo->radioResourceConfigCommon.ul_CyclicPrefixLength) {
-        memcpy((void *)&UE_mac_inst[Mod_id].radioResourceConfigCommon->ul_CyclicPrefixLength,
+        memcpy((void *)&UE_mac_inst[Mod_idP].radioResourceConfigCommon->ul_CyclicPrefixLength,
                (void *)mobilityControlInfo->radioResourceConfigCommon.ul_CyclicPrefixLength,
                sizeof(UL_CyclicPrefixLength_t));
       }
 
       // store the previous rnti in case of failure, and set thenew rnti
-      UE_mac_inst[Mod_id].crnti_before_ho = UE_mac_inst[Mod_id].crnti;
-      UE_mac_inst[Mod_id].crnti = ((mobilityControlInfo->newUE_Identity.buf[0])|(mobilityControlInfo->newUE_Identity.buf[1]<<8));
-      LOG_I(MAC,"[UE %d] Received new identity %x from %d\n", Mod_id, UE_mac_inst[Mod_id].crnti, eNB_index);
-      UE_mac_inst[Mod_id].rach_ConfigDedicated = malloc(sizeof(*mobilityControlInfo->rach_ConfigDedicated));
+      UE_mac_inst[Mod_idP].crnti_before_ho = UE_mac_inst[Mod_idP].crnti;
+      UE_mac_inst[Mod_idP].crnti = ((mobilityControlInfo->newUE_Identity.buf[0])|(mobilityControlInfo->newUE_Identity.buf[1]<<8));
+      LOG_I(MAC,"[UE %d] Received new identity %x from %d\n", Mod_idP, UE_mac_inst[Mod_idP].crnti, eNB_index);
+      UE_mac_inst[Mod_idP].rach_ConfigDedicated = malloc(sizeof(*mobilityControlInfo->rach_ConfigDedicated));
 
       if (mobilityControlInfo->rach_ConfigDedicated) {
-        memcpy((void*)UE_mac_inst[Mod_id].rach_ConfigDedicated,
+        memcpy((void*)UE_mac_inst[Mod_idP].rach_ConfigDedicated,
                (void*)mobilityControlInfo->rach_ConfigDedicated,
                sizeof(*mobilityControlInfo->rach_ConfigDedicated));
       }
 
-      mac_xface->phy_config_afterHO_ue(Mod_id,0,eNB_index,mobilityControlInfo,0);
+      mac_xface->phy_config_afterHO_ue(Mod_idP,0,eNB_index,mobilityControlInfo,0);
     }
   }
 
   if (mbsfn_SubframeConfigList != NULL) {
     if (eNB_flagP == 1) {
-      LOG_I(MAC,"[eNB %d][CONFIG] Received %d subframe allocation pattern for MBSFN\n", Mod_id, mbsfn_SubframeConfigList->list.count);
-      eNB_mac_inst[Mod_id].common_channels[0].num_sf_allocation_pattern= mbsfn_SubframeConfigList->list.count;
+      LOG_I(MAC,"[eNB %d][CONFIG] Received %d subframe allocation pattern for MBSFN\n", Mod_idP, mbsfn_SubframeConfigList->list.count);
+      eNB_mac_inst[Mod_idP].common_channels[0].num_sf_allocation_pattern= mbsfn_SubframeConfigList->list.count;
 
       for (i=0; i<mbsfn_SubframeConfigList->list.count; i++) {
-        eNB_mac_inst[Mod_id].common_channels[0].mbsfn_SubframeConfig[i] = mbsfn_SubframeConfigList->list.array[i];
-        LOG_I(MAC, "[eNB %d][CONFIG] MBSFN_SubframeConfig[%d] pattern is  %x\n", Mod_id, i,
-              eNB_mac_inst[Mod_id].common_channels[0].mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[0]);
+        eNB_mac_inst[Mod_idP].common_channels[0].mbsfn_SubframeConfig[i] = mbsfn_SubframeConfigList->list.array[i];
+        LOG_I(MAC, "[eNB %d][CONFIG] MBSFN_SubframeConfig[%d] pattern is  %x\n", Mod_idP, i,
+              eNB_mac_inst[Mod_idP].common_channels[0].mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[0]);
       }
 
 #ifdef Rel10
-      eNB_mac_inst[Mod_id].common_channels[0].MBMS_flag = MBMS_Flag;
+      eNB_mac_inst[Mod_idP].common_channels[0].MBMS_flag = MBMS_Flag;
 #endif
     } else { // UE
-      LOG_I(MAC,"[UE %d][CONFIG] Received %d subframe allocation pattern for MBSFN\n", Mod_id, mbsfn_SubframeConfigList->list.count);
-      UE_mac_inst[Mod_id].num_sf_allocation_pattern= mbsfn_SubframeConfigList->list.count;
+      LOG_I(MAC,"[UE %d][CONFIG] Received %d subframe allocation pattern for MBSFN\n", Mod_idP, mbsfn_SubframeConfigList->list.count);
+      UE_mac_inst[Mod_idP].num_sf_allocation_pattern= mbsfn_SubframeConfigList->list.count;
 
       for (i=0; i<mbsfn_SubframeConfigList->list.count; i++) {
-        LOG_I(MAC, "[UE %d] Configuring MBSFN_SubframeConfig %d from received SIB2 \n", Mod_id, i);
-        UE_mac_inst[Mod_id].mbsfn_SubframeConfig[i] = mbsfn_SubframeConfigList->list.array[i];
-        //  LOG_I("[UE %d] MBSFN_SubframeConfig[%d] pattern is  %ld\n", Mod_id,
-        //    UE_mac_inst[Mod_id].mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[0]);
+        LOG_I(MAC, "[UE %d] Configuring MBSFN_SubframeConfig %d from received SIB2 \n", Mod_idP, i);
+        UE_mac_inst[Mod_idP].mbsfn_SubframeConfig[i] = mbsfn_SubframeConfigList->list.array[i];
+        //  LOG_I("[UE %d] MBSFN_SubframeConfig[%d] pattern is  %ld\n", Mod_idP,
+        //    UE_mac_inst[Mod_idP].mbsfn_SubframeConfig[i]->subframeAllocation.choice.oneFrame.buf[0]);
       }
     }
   }
@@ -424,24 +434,24 @@ rrc_mac_config_req(
   if (mbsfn_AreaInfoList != NULL) {
     if (eNB_flagP == 1) {
       // One eNB could be part of multiple mbsfn syc area, this could change over time so reset each time
-      LOG_I(MAC,"[eNB %d][CONFIG] Received %d MBSFN Area Info\n", Mod_id, mbsfn_AreaInfoList->list.count);
-      eNB_mac_inst[Mod_id].common_channels[0].num_active_mbsfn_area = mbsfn_AreaInfoList->list.count;
+      LOG_I(MAC,"[eNB %d][CONFIG] Received %d MBSFN Area Info\n", Mod_idP, mbsfn_AreaInfoList->list.count);
+      eNB_mac_inst[Mod_idP].common_channels[0].num_active_mbsfn_area = mbsfn_AreaInfoList->list.count;
 
       for (i =0; i< mbsfn_AreaInfoList->list.count; i++) {
-        eNB_mac_inst[Mod_id].common_channels[0].mbsfn_AreaInfo[i] = mbsfn_AreaInfoList->list.array[i];
-        LOG_I(MAC,"[eNB %d][CONFIG] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n", Mod_id,i,
-              eNB_mac_inst[Mod_id].common_channels[0].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9);
-        mac_xface->phy_config_sib13_eNB(Mod_id,0,i,eNB_mac_inst[Mod_id].common_channels[0].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9);
+        eNB_mac_inst[Mod_idP].common_channels[0].mbsfn_AreaInfo[i] = mbsfn_AreaInfoList->list.array[i];
+        LOG_I(MAC,"[eNB %d][CONFIG] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n", Mod_idP,i,
+              eNB_mac_inst[Mod_idP].common_channels[0].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9);
+        mac_xface->phy_config_sib13_eNB(Mod_idP,0,i,eNB_mac_inst[Mod_idP].common_channels[0].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9);
       }
     } else { // UE
-      LOG_I(MAC,"[UE %d][CONFIG] Received %d MBSFN Area Info\n", Mod_id, mbsfn_AreaInfoList->list.count);
-      UE_mac_inst[Mod_id].num_active_mbsfn_area = mbsfn_AreaInfoList->list.count;
+      LOG_I(MAC,"[UE %d][CONFIG] Received %d MBSFN Area Info\n", Mod_idP, mbsfn_AreaInfoList->list.count);
+      UE_mac_inst[Mod_idP].num_active_mbsfn_area = mbsfn_AreaInfoList->list.count;
 
       for (i =0; i< mbsfn_AreaInfoList->list.count; i++) {
-        UE_mac_inst[Mod_id].mbsfn_AreaInfo[i] = mbsfn_AreaInfoList->list.array[i];
-        LOG_I(MAC,"[UE %d] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n",Mod_id, i,
-              UE_mac_inst[Mod_id].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9);
-        mac_xface->phy_config_sib13_ue(Mod_id,0,eNB_index,i,UE_mac_inst[Mod_id].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9);
+        UE_mac_inst[Mod_idP].mbsfn_AreaInfo[i] = mbsfn_AreaInfoList->list.array[i];
+        LOG_I(MAC,"[UE %d] MBSFN_AreaInfo[%d]: MCCH Repetition Period = %ld\n",Mod_idP, i,
+              UE_mac_inst[Mod_idP].mbsfn_AreaInfo[i]->mcch_Config_r9.mcch_RepetitionPeriod_r9);
+        mac_xface->phy_config_sib13_ue(Mod_idP,0,eNB_index,i,UE_mac_inst[Mod_idP].mbsfn_AreaInfo[i]->mbsfn_AreaId_r9);
       }
     }
   }
@@ -456,29 +466,29 @@ rrc_mac_config_req(
       LOG_I(MAC, "[CONFIG] Number of PMCH in this MBSFN Area %d\n", pmch_InfoList->list.count);
 
       for (i =0; i< pmch_InfoList->list.count; i++) {
-        eNB_mac_inst[Mod_id].common_channels[0].pmch_Config[i] = &pmch_InfoList->list.array[i]->pmch_Config_r9;
+        eNB_mac_inst[Mod_idP].common_channels[0].pmch_Config[i] = &pmch_InfoList->list.array[i]->pmch_Config_r9;
 
         LOG_I(MAC, "[CONFIG] PMCH[%d]: This PMCH stop (sf_AllocEnd_r9) at subframe  %ldth\n", i,
-              eNB_mac_inst[Mod_id].common_channels[0].pmch_Config[i]->sf_AllocEnd_r9);
+              eNB_mac_inst[Mod_idP].common_channels[0].pmch_Config[i]->sf_AllocEnd_r9);
         LOG_I(MAC, "[CONFIG] PMCH[%d]: mch_Scheduling_Period = %ld\n", i,
-              eNB_mac_inst[Mod_id].common_channels[0].pmch_Config[i]->mch_SchedulingPeriod_r9);
+              eNB_mac_inst[Mod_idP].common_channels[0].pmch_Config[i]->mch_SchedulingPeriod_r9);
         LOG_I(MAC, "[CONFIG] PMCH[%d]: dataMCS = %ld\n", i,
-              eNB_mac_inst[Mod_id].common_channels[0].pmch_Config[i]->dataMCS_r9);
+              eNB_mac_inst[Mod_idP].common_channels[0].pmch_Config[i]->dataMCS_r9);
 
         // MBMS session info list in each MCH
-        eNB_mac_inst[Mod_id].common_channels[0].mbms_SessionList[i] = &pmch_InfoList->list.array[i]->mbms_SessionInfoList_r9;
-        LOG_I(MAC, "PMCH[%d] Number of session (MTCH) is: %d\n",i, eNB_mac_inst[Mod_id].common_channels[0].mbms_SessionList[i]->list.count);
+        eNB_mac_inst[Mod_idP].common_channels[0].mbms_SessionList[i] = &pmch_InfoList->list.array[i]->mbms_SessionInfoList_r9;
+        LOG_I(MAC, "PMCH[%d] Number of session (MTCH) is: %d\n",i, eNB_mac_inst[Mod_idP].common_channels[0].mbms_SessionList[i]->list.count);
       }
     } else { // UE
-      LOG_I(MAC, "[UE %d] Configuring PMCH_config from MCCH MESSAGE \n",Mod_id);
+      LOG_I(MAC, "[UE %d] Configuring PMCH_config from MCCH MESSAGE \n",Mod_idP);
 
       for (i =0; i< pmch_InfoList->list.count; i++) {
-        UE_mac_inst[Mod_id].pmch_Config[i] = &pmch_InfoList->list.array[i]->pmch_Config_r9;
-        LOG_I(MAC, "[UE %d] PMCH[%d]: MCH_Scheduling_Period = %ld\n", Mod_id, i,
-              UE_mac_inst[Mod_id].pmch_Config[i]->mch_SchedulingPeriod_r9);
+        UE_mac_inst[Mod_idP].pmch_Config[i] = &pmch_InfoList->list.array[i]->pmch_Config_r9;
+        LOG_I(MAC, "[UE %d] PMCH[%d]: MCH_Scheduling_Period = %ld\n", Mod_idP, i,
+              UE_mac_inst[Mod_idP].pmch_Config[i]->mch_SchedulingPeriod_r9);
       }
 
-      UE_mac_inst[Mod_id].mcch_status = 1;
+      UE_mac_inst[Mod_idP].mcch_status = 1;
     }
   }
 
@@ -487,28 +497,28 @@ rrc_mac_config_req(
 
   if (eNB_flagP == 0) {
     if (cba_rnti) {
-      UE_mac_inst[Mod_id].cba_rnti[num_active_cba_groups-1] = cba_rnti;
+      UE_mac_inst[Mod_idP].cba_rnti[num_active_cba_groups-1] = cba_rnti;
       LOG_D(MAC,"[UE %d] configure CBA group %d RNTI %x for eNB %d (total active cba group %d)\n",
-            Mod_id,Mod_id%num_active_cba_groups, cba_rnti,eNB_index,num_active_cba_groups);
-      mac_xface->phy_config_cba_rnti(Mod_id,CC_id,eNB_flagP,eNB_index,cba_rnti,num_active_cba_groups-1, num_active_cba_groups);
+            Mod_idP,Mod_idP%num_active_cba_groups, cba_rnti,eNB_index,num_active_cba_groups);
+      mac_xface->phy_config_cba_rnti(Mod_idP,CC_idP,eNB_flagP,eNB_index,cba_rnti,num_active_cba_groups-1, num_active_cba_groups);
     }
   } else {
     if (cba_rnti) {
       LOG_D(MAC,"[eNB %d] configure CBA RNTI for UE  %d (total active cba groups %d)\n",
-            Mod_id, UE_id, num_active_cba_groups);
-      eNB_mac_inst[Mod_id].common_channels[CC_id].num_active_cba_groups=num_active_cba_groups;
+            Mod_idP, UE_id, num_active_cba_groups);
+      eNB_mac_inst[Mod_idP].common_channels[CC_idP].num_active_cba_groups=num_active_cba_groups;
 
       for (i=0; i < num_active_cba_groups; i ++) {
-        if (eNB_mac_inst[Mod_id].common_channels[CC_id].cba_rnti[i] != cba_rnti + i) {
-          eNB_mac_inst[Mod_id].common_channels[CC_id].cba_rnti[i] = cba_rnti + i;
+        if (eNB_mac_inst[Mod_idP].common_channels[CC_idP].cba_rnti[i] != cba_rnti + i) {
+          eNB_mac_inst[Mod_idP].common_channels[CC_idP].cba_rnti[i] = cba_rnti + i;
         }
 
         //only configure UE ids up to num_active_cba_groups
         //we use them as candidates for the transmission of dci format0)
         if (UE_id%num_active_cba_groups == i) {
-          mac_xface->phy_config_cba_rnti(Mod_id,CC_id,eNB_flagP,UE_id,cba_rnti + i,i,num_active_cba_groups );
+          mac_xface->phy_config_cba_rnti(Mod_idP,CC_idP,eNB_flagP,UE_id,cba_rnti + i,i,num_active_cba_groups );
           LOG_D(MAC,"[eNB %d] configure CBA groups %d with RNTI %x for UE  %d (total active cba groups %d)\n",
-                Mod_id, i, eNB_mac_inst[Mod_id].common_channels[CC_id].cba_rnti[i],UE_id, num_active_cba_groups);
+                Mod_idP, i, eNB_mac_inst[Mod_idP].common_channels[CC_idP].cba_rnti[i],UE_id, num_active_cba_groups);
         }
       }
     }
@@ -605,7 +615,7 @@ rrc_get_estimated_ue_distance(
     return  eNB_UE_stats->distance.power_based;
   }
 
-  //    LOG_D(LOCALIZE, "DEBUG ME, dist = %d\n", &eNB_mac_inst[ctxt_pP->module_id].UE_list.UE_template[CC_id][UE_id].distance.power_based);
+  //    LOG_D(LOCALIZE, "DEBUG ME, dist = %d\n", &eNB_mac_inst[ctxt_pP->module_id].UE_list.UE_template[CC_idP][UE_id].distance.power_based);
 
 }
 
diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h
index 920de2e79d9eb61fe8f4be6a3d2d2d03822ff767..ce23f5fb229987e2c8a0adfee107d5a550a699a3 100644
--- a/openair2/LAYER2/MAC/defs.h
+++ b/openair2/LAYER2/MAC/defs.h
@@ -251,7 +251,8 @@ typedef struct {
 typedef struct {
   uint8_t Num_ue_spec_dci ;
   uint8_t Num_common_dci  ;
-  unsigned int nCCE;
+  //  uint32_t nCCE;
+  uint32_t num_pdcch_symbols;
   DCI_ALLOC_t dci_alloc[NUM_DCI_MAX] ;
 } DCI_PDU;
 /*! \brief CCCH payload */
@@ -658,9 +659,12 @@ typedef struct {
 
   // Logical channel info for link with RLC
 
-  /// UE BSR info for each logical channel group id
+  /// Last received UE BSR info for each logical channel group id
   uint8_t bsr_info[MAX_NUM_LCGID];
 
+  /// LCGID mapping
+  long lcgidmap[11];
+
   /// phr information
   int8_t phr_info;
 
@@ -740,7 +744,16 @@ typedef struct {
   uint8_t       dl_pow_off[MAX_NUM_CCs];
   uint16_t      pre_nb_available_rbs[MAX_NUM_CCs];
   unsigned char rballoc_sub_UE[MAX_NUM_CCs][N_RBG_MAX];
-
+  uint16_t      ta_timer;
+  int16_t       ta_update;
+  int32_t       context_active_timer;
+  int32_t       cqi_req_timer;
+  int32_t       ul_inactivity_timer;
+  int32_t       ul_failure_timer;
+  int32_t       ul_scheduled;
+  int32_t       ra_pdcch_order_sent;
+  int32_t       ul_out_of_sync;
+  int32_t       phr_received;
 } UE_sched_ctrl;
 /*! \brief eNB template for the Random access information */
 typedef struct {
@@ -770,8 +783,6 @@ typedef struct {
   uint8_t Msg3_subframe;
   /// Flag to indicate the eNB should generate Msg4 upon reception of SDU from RRC.  This is triggered by first ULSCH reception at eNB for new user.
   uint8_t generate_Msg4;
-  /// Flag to indicate the eNB should generate the DCI for Msg4, after getting the SDU from RRC.
-  uint8_t generate_Msg4_dci;
   /// Flag to indicate that eNB is waiting for ACK that UE has received Msg3.
   uint8_t wait_ack_Msg4;
   /// UE RNTI allocated during RAR
@@ -866,8 +877,8 @@ typedef struct {
   /// Outgoing CCCH pdu for PHY
   CCCH_PDU CCCH_pdu;
   RA_TEMPLATE RA_template[NB_RA_PROC_MAX];
-  /// BCCH active flag
-  uint8_t bcch_active;
+  /// VRB map for common channels
+  uint8_t vrb_map[100];
   /// MBSFN SubframeConfig
   struct MBSFN_SubframeConfig *mbsfn_SubframeConfig[8];
   /// number of subframe allocation pattern available for MBSFN sync area
@@ -914,9 +925,11 @@ typedef struct {
   /// Common cell resources
   COMMON_channels_t common_channels[MAX_NUM_CCs];
   UE_list_t UE_list;
+
   ///subband bitmap configuration
   SBMAP_CONF sbmap_conf;
-
+  /// CCE table used to build DCI scheduling information
+  int CCE_table[MAX_NUM_CCs][800];
   ///  active flag for Other lcid
   //  uint8_t lcid_active[NB_RB_MAX];
   /// eNB stats
diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c
index 329c40be05e51ae85e005995f016c0a0294336ea..a6c4eaeb16eb039d1136f6a0ac351fc887da77e9 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler.c
@@ -77,20 +77,20 @@
 
 
 
+
+
+
 void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, frame_t frameP, sub_frame_t subframeP)  //, int calibration_flag) {
 {
 
-  unsigned int nprb[MAX_NUM_CCs];
-  unsigned int nCCE[MAX_NUM_CCs];
   int mbsfn_status[MAX_NUM_CCs];
-  uint32_t RBalloc[MAX_NUM_CCs];
   protocol_ctxt_t   ctxt;
 #ifdef EXMIMO
-  int ret;
+  //int ret;
 #endif
 #if defined(ENABLE_ITTI)
   MessageDef   *msg_p;
-  const char   *msg_name;
+  const char         *msg_name;
   instance_t    instance;
   int           result;
 #endif
@@ -98,6 +98,8 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
   int CC_id,i,next_i;
   UE_list_t *UE_list=&eNB_mac_inst[module_idP].UE_list;
   rnti_t rnti;
+  void         *DLSCH_dci=NULL;
+  int size_bits=0,size_bytes=0;
 
   LOG_D(MAC,"[eNB %d] Frame %d, Subframe %d, entering MAC scheduler (UE_list->head %d)\n",module_idP, frameP, subframeP,UE_list->head);
 
@@ -106,10 +108,9 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
 
   for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
     DCI_pdu[CC_id] = &eNB_mac_inst[module_idP].common_channels[CC_id].DCI_pdu;
-    nCCE[CC_id]=0;
-    nprb[CC_id]=0;
-    RBalloc[CC_id]=0;
     mbsfn_status[CC_id]=0;
+    // clear vrb_map
+    memset(eNB_mac_inst[module_idP].common_channels[CC_id].vrb_map,0,100);
   }
 
   // refresh UE list based on UEs dropped by PHY in previous subframe
@@ -122,9 +123,125 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
           mac_xface->get_eNB_UE_stats(module_idP, CC_id, rnti));
     next_i= UE_list->next[i];
 
+    PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_bsr[i][(frameP*10)+subframeP]=-63;
+    if (i==UE_list->head)
+      VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR,PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_bsr[i][(frameP*10)+subframeP]); 
+    // increment this, it is cleared when we receive an sdu
+    eNB_mac_inst[module_idP].UE_list.UE_sched_ctrl[i].ul_inactivity_timer++;
+
+    eNB_mac_inst[module_idP].UE_list.UE_sched_ctrl[i].cqi_req_timer++;
+    
     if (mac_xface->get_eNB_UE_stats(module_idP, CC_id, rnti)==NULL) {
-      mac_remove_ue(module_idP, i, frameP, subframeP);
+      //      mac_remove_ue(module_idP, i, frameP, subframeP);
     }
+    else {
+      // check uplink failure
+      if ((UE_list->UE_sched_ctrl[i].ul_failure_timer>0)&&
+	  (UE_list->UE_sched_ctrl[i].ul_out_of_sync==0)) {
+	LOG_D(MAC,"UE %d rnti %x: UL Failure timer %d \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer);
+	if (UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent==0) {
+	  UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent=1;
+	  
+	  // add a format 1A dci for this UE to request an RA procedure (only one UE per subframe)
+	  LOG_D(MAC,"UE %d rnti %x: sending PDCCH order for RAPROC (failure timer %d) \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer);	    
+	  DLSCH_dci = (void *)UE_list->UE_template[CC_id][i].DLSCH_DCI[0];
+	  *(uint32_t*)DLSCH_dci = 0;
+	  if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) {
+	    switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) {
+	    case 6:
+	      ((DCI1A_1_5MHz_TDD_1_6_t*)DLSCH_dci)->type = 1;
+	      ((DCI1A_1_5MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 31;
+	      size_bytes = sizeof(DCI1A_1_5MHz_TDD_1_6_t);
+	      size_bits  = sizeof_DCI1A_1_5MHz_TDD_1_6_t;
+	      break;
+	    case 25:
+	      ((DCI1A_5MHz_TDD_1_6_t*)DLSCH_dci)->type = 1;
+	      ((DCI1A_5MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 511;
+	      size_bytes = sizeof(DCI1A_5MHz_TDD_1_6_t);
+	      size_bits  = sizeof_DCI1A_5MHz_TDD_1_6_t;
+	      break;
+	    case 50:
+	      ((DCI1A_10MHz_TDD_1_6_t*)DLSCH_dci)->type = 1;
+	      ((DCI1A_10MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 2047;
+	      size_bytes = sizeof(DCI1A_10MHz_TDD_1_6_t);
+	      size_bits  = sizeof_DCI1A_10MHz_TDD_1_6_t;
+	      break;
+	    case 100:
+	      ((DCI1A_20MHz_TDD_1_6_t*)DLSCH_dci)->type = 1;
+	      ((DCI1A_20MHz_TDD_1_6_t*)DLSCH_dci)->rballoc = 8191;
+	      size_bytes = sizeof(DCI1A_20MHz_TDD_1_6_t);
+	      size_bits  = sizeof_DCI1A_20MHz_TDD_1_6_t;
+	      break;
+	    }
+	  }
+	  else { // FDD
+	    switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) {
+	    case 6:
+	      ((DCI1A_1_5MHz_FDD_t*)DLSCH_dci)->type = 1;
+	      ((DCI1A_1_5MHz_FDD_t*)DLSCH_dci)->rballoc = 31;
+	      size_bytes = sizeof(DCI1A_1_5MHz_FDD_t);
+	      size_bits  = sizeof_DCI1A_1_5MHz_FDD_t;
+	      break;
+	    case 15:/*
+	      ((DCI1A_2_5MHz_FDD_t*)DLSCH_dci)->type = 1;
+	      ((DCI1A_2_5MHz_FDD_t*)DLSCH_dci)->rballoc = 31;
+	      size_bytes = sizeof(DCI1A_1_5MHz_FDD_t);
+	      size_bits  = sizeof_DCI1A_1_5MHz_FDD_t;*/
+	      break;
+	    case 25:
+	      ((DCI1A_5MHz_FDD_t*)DLSCH_dci)->type = 1;
+	      ((DCI1A_5MHz_FDD_t*)DLSCH_dci)->rballoc = 511;
+	      size_bytes = sizeof(DCI1A_5MHz_FDD_t);
+	      size_bits  = sizeof_DCI1A_5MHz_FDD_t;
+	      break;
+	    case 50:
+	      ((DCI1A_10MHz_FDD_t*)DLSCH_dci)->type = 1;
+	      ((DCI1A_10MHz_FDD_t*)DLSCH_dci)->rballoc = 2047;
+	      size_bytes = sizeof(DCI1A_10MHz_FDD_t);
+	      size_bits  = sizeof_DCI1A_10MHz_FDD_t;
+		break;
+	    case 75:
+	      /*	      ((DCI1A_15MHz_FDD_t*)DLSCH_dci)->type = 1;
+	      ((DCI1A_15MHz_FDD_t*)DLSCH_dci)->rballoc = 2047;
+	      size_bytes = sizeof(DCI1A_10MHz_FDD_t);
+	      size_bits  = sizeof_DCI1A_10MHz_FDD_t;*/
+		break;
+	    case 100:
+	      ((DCI1A_20MHz_FDD_t*)DLSCH_dci)->type = 1;
+	      ((DCI1A_20MHz_FDD_t*)DLSCH_dci)->rballoc = 8191;
+	      size_bytes = sizeof(DCI1A_20MHz_FDD_t);
+	      size_bits  = sizeof_DCI1A_20MHz_FDD_t;
+	      break;
+	    }
+	  }
+	  
+	  add_ue_spec_dci(DCI_pdu[CC_id],
+			  DLSCH_dci,
+			  rnti,
+			    size_bytes,
+			  process_ue_cqi (module_idP,i),//aggregation,
+			  size_bits,
+			  format1A,
+			  0);
+	}
+	else { // ra_pdcch_sent==1
+	  LOG_D(MAC,"UE %d rnti %x: sent PDCCH order for RAPROC waiting (failure timer %d) \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer);	    	    
+	  if ((UE_list->UE_sched_ctrl[i].ul_failure_timer % 40) == 0)
+	    UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent=0; // resend every 4 frames	      
+	}
+      
+	UE_list->UE_sched_ctrl[i].ul_failure_timer++;
+	// check threshold
+	if (UE_list->UE_sched_ctrl[i].ul_failure_timer > 200) {
+	  // inform RRC of failure and clear timer
+	  LOG_I(MAC,"UE %d rnti %x: UL Failure after repeated PDCCH orders: Triggering RRC \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer);
+	  mac_eNB_rrc_ul_failure(module_idP,CC_id,frameP,subframeP,rnti);
+	  UE_list->UE_sched_ctrl[i].ul_failure_timer=0;
+	  UE_list->UE_sched_ctrl[i].ul_out_of_sync=1;
+	}
+      }
+    } // ul_failure_timer>0
+    
     i = next_i;
   }
 
@@ -186,7 +303,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
   for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
     DCI_pdu[CC_id]->Num_common_dci  = 0;
     DCI_pdu[CC_id]->Num_ue_spec_dci = 0;
-    eNB_mac_inst[module_idP].common_channels[CC_id].bcch_active = 0;
+
 
 #ifdef Rel10
     eNB_mac_inst[module_idP].common_channels[CC_id].mcch_active =0;
@@ -194,6 +311,8 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
 
     eNB_mac_inst[module_idP].frame    = frameP;
     eNB_mac_inst[module_idP].subframe = subframeP;
+
+
   }
 
   //if (subframeP%5 == 0)
@@ -238,19 +357,20 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
     // Schedule ULSCH for FDD or subframeP 4 (TDD config 0,3,6)
     // Schedule Normal DLSCH
 
-    schedule_RA(module_idP,frameP,subframeP,2,nprb,nCCE);
+
+    schedule_RA(module_idP,frameP,subframeP,2);
+
 
     if (mac_xface->lte_frame_parms->frame_type == FDD) {  //FDD
-      schedule_ulsch(module_idP,frameP,cooperation_flag,0,4,nCCE);//,calibration_flag);
+      schedule_ulsch(module_idP,frameP,cooperation_flag,0,4);//,calibration_flag);
     } else if  ((mac_xface->lte_frame_parms->tdd_config == TDD) || //TDD
                 (mac_xface->lte_frame_parms->tdd_config == 3) ||
                 (mac_xface->lte_frame_parms->tdd_config == 6)) {
-      //schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,4,nCCE);//,calibration_flag);
+      //schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,4);//,calibration_flag);
     }
 
-    // schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
-
-    fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,1,mbsfn_status);
+    schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
+    fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
 
     break;
 
@@ -262,22 +382,22 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
       switch (mac_xface->lte_frame_parms->tdd_config) {
       case 0:
       case 1:
-        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,7,nCCE);
-        fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
+        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,7);
+        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
         break;
 
       case 6:
-        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,8,nCCE);
-        fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
+        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,8);
+        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
         break;
 
       default:
         break;
       }
     } else { //FDD
-      schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
-      fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
-      schedule_ulsch(module_idP,frameP,cooperation_flag,1,5,nCCE);
+      schedule_ulsch(module_idP,frameP,cooperation_flag,1,5);
+      schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
+      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
     }
 
     break;
@@ -287,9 +407,9 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
     // TDD, nothing
     // FDD, normal UL/DLSCH
     if (mac_xface->lte_frame_parms->frame_type == FDD) {  //FDD
-      schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
-      fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
-      schedule_ulsch(module_idP,frameP,cooperation_flag,2,6,nCCE);
+      schedule_ulsch(module_idP,frameP,cooperation_flag,2,6);
+      schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
+      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
     }
 
     break;
@@ -302,22 +422,22 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
     if (mac_xface->lte_frame_parms->frame_type == TDD) {
       switch (mac_xface->lte_frame_parms->tdd_config) {
       case 2:
-        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,7,nCCE);
+        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,7);
 
         // no break here!
       case 5:
-        schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
-        fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
+        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
+        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
         break;
 
       default:
         break;
       }
     } else { //FDD
-      schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
-      fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
-      schedule_ulsch(module_idP,frameP,cooperation_flag,3,7,nCCE);
 
+      schedule_ulsch(module_idP,frameP,cooperation_flag,3,7);
+      schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
+      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
     }
 
     break;
@@ -330,8 +450,8 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
     if (mac_xface->lte_frame_parms->frame_type == 1) { // TDD
       switch (mac_xface->lte_frame_parms->tdd_config) {
       case 1:
-        //        schedule_RA(module_idP,frameP,subframeP,nprb,nCCE);
-        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,8,nCCE);
+        //        schedule_RA(module_idP,frameP,subframeP);
+        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,8);
 
         // no break here!
       case 2:
@@ -341,8 +461,9 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
 
         // no break here!
       case 5:
-        schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
-        fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,1,mbsfn_status);
+
+        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
+        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
         break;
 
       default:
@@ -350,11 +471,10 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
       }
     } else {
       if (mac_xface->lte_frame_parms->frame_type == FDD) {  //FDD
-	//        schedule_RA(module_idP,frameP, subframeP, 0, nprb, nCCE);
-        //  schedule_ulsch(module_idP, frameP, cooperation_flag, 4, 8, nCCE);
-        schedule_ue_spec(module_idP, frameP, subframeP, nprb, nCCE, mbsfn_status);
-        fill_DLSCH_dci(module_idP, frameP, subframeP, RBalloc, 1, mbsfn_status);
 
+	schedule_ulsch(module_idP, frameP, cooperation_flag, 4, 8);
+	schedule_ue_spec(module_idP, frameP, subframeP,  mbsfn_status);
+        fill_DLSCH_dci(module_idP, frameP, subframeP,   mbsfn_status);
       }
     }
 
@@ -365,21 +485,21 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
     // TDD Config 0,6 ULSCH for subframes 9,3 resp.
     // TDD normal DLSCH
     // FDD normal UL/DLSCH
-    schedule_SI(module_idP,frameP,nprb,nCCE);
+    schedule_SI(module_idP,frameP,subframeP);
 
-    //schedule_RA(module_idP,frameP,subframeP,5,nprb,nCCE);
+    //schedule_RA(module_idP,frameP,subframeP,5);
     if (mac_xface->lte_frame_parms->frame_type == FDD) {
-      schedule_RA(module_idP,frameP,subframeP,1,nprb,nCCE);
-      //      schedule_ulsch(module_idP,frameP,cooperation_flag,5,9,nCCE);
-      fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,1,mbsfn_status);
-
+      schedule_RA(module_idP,frameP,subframeP,1);
+      schedule_ulsch(module_idP,frameP,cooperation_flag,5,9);
+      schedule_ue_spec(module_idP, frameP, subframeP,  mbsfn_status);
+      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
     } else if ((mac_xface->lte_frame_parms->tdd_config == 0) || // TDD Config 0
                (mac_xface->lte_frame_parms->tdd_config == 6)) { // TDD Config 6
-      //schedule_ulsch(module_idP,cooperation_flag,subframeP,nCCE);
-      fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
+      //schedule_ulsch(module_idP,cooperation_flag,subframeP);
+      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
     } else {
-      //schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
-      fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
+      schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
+      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
     }
 
     break;
@@ -395,36 +515,36 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
         break;
 
       case 1:
-        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,2,nCCE);
-        //  schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
-        fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
+        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,2);
+        //  schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
+        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
         break;
 
       case 6:
-        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3,nCCE);
-        //  schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
-        fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
+        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3);
+        //  schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
+        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
         break;
 
       case 5:
-        schedule_RA(module_idP,frameP,subframeP,2,nprb,nCCE);
-        schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
-        fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,1,mbsfn_status);
+        schedule_RA(module_idP,frameP,subframeP,2);
+        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
+        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
         break;
 
       case 3:
       case 4:
-        schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
-        fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
+        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
+        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
         break;
 
       default:
         break;
       }
     } else { //FDD
-      //      schedule_ulsch(module_idP,frameP,cooperation_flag,6,0,nCCE);
-      schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
-      fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
+      schedule_ulsch(module_idP,frameP,cooperation_flag,6,0);
+      schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
+      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
     }
 
     break;
@@ -437,23 +557,23 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
       switch (mac_xface->lte_frame_parms->tdd_config) {
       case 3:
       case 4:
-        schedule_RA(module_idP,frameP,subframeP,3,nprb,nCCE);  // 3 = Msg3 subframeP, not
-        schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
-        fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,1,mbsfn_status);
+        schedule_RA(module_idP,frameP,subframeP,3);  // 3 = Msg3 subframeP, not
+        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
+        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
         break;
 
       case 5:
-        schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
-        fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
+        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
+        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
         break;
 
       default:
         break;
       }
     } else { //FDD
-      //schedule_ulsch(module_idP,frameP,cooperation_flag,7,1,nCCE);
-      schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
-      fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
+      schedule_ulsch(module_idP,frameP,cooperation_flag,7,1);
+      schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
+      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
     }
 
     break;
@@ -470,19 +590,19 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
       case 4:
       case 5:
 
-        //  schedule_RA(module_idP,subframeP,nprb,nCCE);
-        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,2,nCCE);
-        schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
-        fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
+        //  schedule_RA(module_idP,subframeP);
+        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,2);
+        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
+        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
         break;
 
       default:
         break;
       }
     } else { //FDD
-      //schedule_ulsch(module_idP,frameP,cooperation_flag,8,2,nCCE);
-      schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
-      fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
+      schedule_ulsch(module_idP,frameP,cooperation_flag,8,2);
+      schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
+      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
     }
 
     break;
@@ -493,51 +613,74 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
     if (mac_xface->lte_frame_parms->frame_type == TDD) {
       switch (mac_xface->lte_frame_parms->tdd_config) {
       case 1:
-        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3,nCCE);
-        schedule_RA(module_idP,frameP,subframeP,7,nprb,nCCE);  // 7 = Msg3 subframeP, not
-        schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
-        fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,1,mbsfn_status);
+        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3);
+        schedule_RA(module_idP,frameP,subframeP,7);  // 7 = Msg3 subframeP, not
+        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
+        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
         break;
 
       case 3:
       case 4:
-        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3,nCCE);
-        schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
-        fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
+        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,3);
+        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
+        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
         break;
 
       case 6:
-        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,4,nCCE);
-        //schedule_RA(module_idP,frameP,subframeP,nprb,nCCE);
-        schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
-        fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
+        schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,4);
+        //schedule_RA(module_idP,frameP,subframeP);
+        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
+        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
         break;
 
       case 2:
       case 5:
-        //schedule_RA(module_idP,frameP,subframeP,nprb,nCCE);
-        schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
-        fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
+        //schedule_RA(module_idP,frameP,subframeP);
+        schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
+        fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
         break;
 
       default:
         break;
       }
     } else { //FDD
-      //     schedule_ulsch(module_idP,frameP,cooperation_flag,9,3,nCCE);
-      schedule_ue_spec(module_idP,frameP,subframeP,nprb,nCCE,mbsfn_status);
-      fill_DLSCH_dci(module_idP,frameP,subframeP,RBalloc,0,mbsfn_status);
+      schedule_ulsch(module_idP,frameP,cooperation_flag,9,3);
+      schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status);
+      fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status);
     }
 
     break;
 
   }
 
-  for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
-    DCI_pdu[CC_id]->nCCE = nCCE[CC_id];
-  }
+  LOG_D(MAC,"FrameP %d, subframeP %d : Scheduling CCEs\n",frameP,subframeP);
+
+  // Allocate CCEs for good after scheduling is done
+  for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++)
+    allocate_CCEs(module_idP,CC_id,subframeP,0);
 
-  LOG_D(MAC,"frameP %d, subframeP %d nCCE %d\n",frameP,subframeP,nCCE[0]);
+  /*
+  int dummy=0;
+  for (i=0;
+       i<DCI_pdu[CC_id]->Num_common_dci+DCI_pdu[CC_id]->Num_ue_spec_dci;
+       i++)
+    if (DCI_pdu[CC_id]->dci_alloc[i].rnti==2)
+      dummy=1;
+	
+  if (dummy==1)
+    for (i=0;
+	 i<DCI_pdu[CC_id]->Num_common_dci+DCI_pdu[CC_id]->Num_ue_spec_dci;
+	 i++)
+      LOG_I(MAC,"Frame %d, subframe %d: DCI %d/%d, format %d, rnti %x, NCCE %d(num_pdcch_symb %d)\n",
+	    frameP,subframeP,i,DCI_pdu[CC_id]->Num_common_dci+DCI_pdu[CC_id]->Num_ue_spec_dci,
+	    DCI_pdu[CC_id]->dci_alloc[i].format,
+	    DCI_pdu[CC_id]->dci_alloc[i].rnti,
+	    DCI_pdu[CC_id]->dci_alloc[i].firstCCE,
+	    DCI_pdu[CC_id]->num_pdcch_symbols);
+
+
+  LOG_D(MAC,"frameP %d, subframeP %d\n",frameP,subframeP);
+  */
 
   stop_meas(&eNB_mac_inst[module_idP].eNB_scheduler);
   VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_OUT);
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c
index f5e5d7816db03eb5b06dfd89eb5a8bfd946de877..2a617f7cd2632bd43811fe12bb6d9a2329508c6a 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c
@@ -68,7 +68,9 @@
 
 #include "SIMULATION/TOOLS/defs.h" // for taus
 
-void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,unsigned char Msg3_subframe,unsigned int *nprb,unsigned int *nCCE)
+#include "T.h"
+
+void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,unsigned char Msg3_subframe)
 {
 
   int CC_id;
@@ -76,34 +78,197 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
 
 
   RA_TEMPLATE *RA_template;
-  unsigned char i;//,harq_pid,round;
+  unsigned char i,harq_pid,round;
   int16_t rrc_sdu_length;
   unsigned char lcid,offset;
   module_id_t UE_id= UE_INDEX_INVALID;
   unsigned short TBsize = -1;
   unsigned short msg4_padding,msg4_post_padding,msg4_header;
+  uint8_t *vrb_map;
+  int first_rb;
+  int rballoc[MAX_NUM_CCs];
+  DCI_PDU *DCI_pdu;
 
   start_meas(&eNB->schedule_ra);
 
   for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
 
-    RA_template = (RA_TEMPLATE *)&eNB->common_channels[CC_id].RA_template[0];
+
+    vrb_map = eNB->common_channels[CC_id].vrb_map;
+    DCI_pdu = &eNB->common_channels[CC_id].DCI_pdu;
 
     for (i=0; i<NB_RA_PROC_MAX; i++) {
 
-      if (RA_template[i].RA_active == TRUE) {
+      RA_template = (RA_TEMPLATE *)&eNB->common_channels[CC_id].RA_template[i];
+
+      if (RA_template->RA_active == TRUE) {
 
         LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d RA %d is active (generate RAR %d, generate_Msg4 %d, wait_ack_Msg4 %d, rnti %x)\n",
-              module_idP,CC_id,i,RA_template[i].generate_rar,RA_template[i].generate_Msg4,RA_template[i].wait_ack_Msg4, RA_template[i].rnti);
+              module_idP,CC_id,i,RA_template->generate_rar,RA_template->generate_Msg4,RA_template->wait_ack_Msg4, RA_template->rnti);
+
+        if (RA_template->generate_rar == 1) {
+
+          LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generating RAR DCI (proc %d), RA_active %d format 1A (%d,%d))\n",
+                module_idP, CC_id, frameP, subframeP,i,
+                RA_template->RA_active,
+                RA_template->RA_dci_fmt1,
+                RA_template->RA_dci_size_bits1);
+
+
+
+          if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) {
+            switch(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) {
+            case 6:
+              ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->type=1;
+              ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0;
+              ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1;
+              ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rv=0;
+              ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0;
+              ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0;
+              ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1;
+              ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->padding=0;
+              ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
+              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type,
+                                ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc);
+              break;
+
+            case 25:
+              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->type=1;
+              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0;
+              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1;
+              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rv=0;
+              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0;
+              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0;
+              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1;
+              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->padding=0;
+              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
+              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type,
+                                ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc);
+              break;
+
+            case 50:
+              ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->type=1;
+              ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0;
+              ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1;
+              ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rv=0;
+              ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0;
+              ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0;
+              ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1;
+              ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->padding=0;
+              ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
+              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type,
+                                ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc);
+              break;
+
+            case 100:
+              ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->type=1;
+              ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0;
+              ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1;
+              ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rv=0;
+              ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0;
+              ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0;
+              ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1;
+              ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->padding=0;
+              ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
+              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type,
+                                ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc);
+              break;
+
+            default:
+              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->type=1;
+              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0;
+              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1;
+              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rv=0;
+              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0;
+              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0;
+              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1;
+              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->padding=0;
+              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
+              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type,
+                                ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc);
+              break;
+            }
+          } else {
+            switch(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) {
+            case 6:
+              ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->type=1;
+              ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0;
+              ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1;
+              ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rv=0;
+              ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0;
+              ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0;
+              ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1;
+              ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->padding=0;
+              ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
+              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type,
+                                ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc);
+              break;
+
+            case 25:
+              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->type=1;
+              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0;
+              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1;
+              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rv=0;
+              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0;
+              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0;
+              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1;
+              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->padding=0;
+              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_UL,first_rb,4);
+              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type,
+                                ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc);
+              break;
+
+            case 50:
+              ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->type=1;
+              ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0;
+              ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1;
+              ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rv=0;
+              ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0;
+              ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0;
+              ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1;
+              ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->padding=0;
+              ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
+              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type,
+                                ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc);
+              break;
+
+            case 100:
+              ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->type=1;
+              ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0;
+              ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1;
+              ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rv=0;
+              ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0;
+              ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0;
+              ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1;
+              ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->padding=0;
+              ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
+              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type,
+                                ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc);
+              break;
+
+            default:
+              break;
+            }
+          }
 
-        if (RA_template[i].generate_rar == 1) {
-          nprb[CC_id]= nprb[CC_id] + 3;
-          nCCE[CC_id] = nCCE[CC_id] + 4;
-          RA_template[i].Msg3_subframe=Msg3_subframe;
-        } else if (RA_template[i].generate_Msg4 == 1) {
+	  if (!CCE_allocation_infeasible(module_idP,CC_id,1,subframeP,2,RA_template->RA_rnti)) {
+	    LOG_D(MAC,"Frame %d: Subframe %d : Adding common DCI for RA_RNTI %x\n",
+                  frameP,subframeP,RA_template->RA_rnti);
+	    add_common_dci(DCI_pdu,
+			   (void*)&RA_template->RA_alloc_pdu1[0],
+			   RA_template->RA_rnti,
+			   RA_template->RA_dci_size_bytes1,
+			   2,
+			   RA_template->RA_dci_size_bits1,
+			   RA_template->RA_dci_fmt1,
+			   1);
+
+	    RA_template->Msg3_subframe=Msg3_subframe;
+	  }
+        } else if (RA_template->generate_Msg4 == 1) {
 
           // check for Msg4 Message
-          UE_id = find_UE_id(module_idP,RA_template[i].rnti);
+          UE_id = find_UE_id(module_idP,RA_template->rnti);
 
           if (Is_rrc_registered == 1) {
 
@@ -131,7 +296,7 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
 
           if (rrc_sdu_length>0) {
             LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Generating Msg4 with RRC Piggyback (RA proc %d, RNTI %x)\n",
-                  module_idP, CC_id, frameP, subframeP,i,RA_template[i].rnti);
+                  module_idP, CC_id, frameP, subframeP,i,RA_template->rnti);
 
             //msg("[MAC][eNB %d][RAPROC] Frame %d, subframeP %d: Received %d bytes for Msg4: \n",module_idP,frameP,subframeP,rrc_sdu_length);
             //    for (j=0;j<rrc_sdu_length;j++)
@@ -140,6 +305,21 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
             //    msg("[MAC][eNB] Frame %d, subframeP %d: Generated DLSCH (Msg4) DCI, format 1A, for UE %d\n",frameP, subframeP,UE_id);
             // Schedule Reflection of Connection request
 
+	    /*
+	    // randomize frequency allocation for RA
+	    while (1) {
+	      first_rb = (unsigned char)(taus()%(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL-4));
+	      
+	      if ((vrb_map[first_rb] != 1) && (vrb_map[first_rb+3] != 1))
+		break;
+	    }
+	    */
+	    first_rb=0;
+
+	    vrb_map[first_rb] = 1;
+	    vrb_map[first_rb+1] = 1;
+	    vrb_map[first_rb+2] = 1;
+	    vrb_map[first_rb+3] = 1;
 
 
             // Compute MCS for 3 PRB
@@ -149,278 +329,414 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
 
               switch (mac_xface->lte_frame_parms->N_RB_DL) {
               case 6:
-                ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->ndi=1;
+                ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->ndi=1;
 
                 if ((rrc_sdu_length+msg4_header) <= 22) {
-                  ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=4;
+                  ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=4;
                   TBsize = 22;
                 } else if ((rrc_sdu_length+msg4_header) <= 28) {
-                  ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=5;
+                  ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=5;
                   TBsize = 28;
                 } else if ((rrc_sdu_length+msg4_header) <= 32) {
-                  ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=6;
+                  ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=6;
                   TBsize = 32;
                 } else if ((rrc_sdu_length+msg4_header) <= 41) {
-                  ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=7;
+                  ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=7;
                   TBsize = 41;
                 } else if ((rrc_sdu_length+msg4_header) <= 49) {
-                  ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=8;
+                  ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=8;
                   TBsize = 49;
                 } else if ((rrc_sdu_length+msg4_header) <= 57) {
-                  ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=9;
+                  ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=9;
                   TBsize = 57;
                 }
-
+		((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->type=1;
+		((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0;
+		((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rv=0;
+		((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0;
+		((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1;
+		((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->padding=0;
+		((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
+		rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
+							 ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
+		
                 break;
 
               case 25:
 
-                ((DCI1A_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->ndi=1;
+                ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->ndi=1;
 
                 if ((rrc_sdu_length+msg4_header) <= 22) {
-                  ((DCI1A_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=4;
+                  ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=4;
                   TBsize = 22;
                 } else if ((rrc_sdu_length+msg4_header) <= 28) {
-                  ((DCI1A_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=5;
+                  ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=5;
                   TBsize = 28;
                 } else if ((rrc_sdu_length+msg4_header) <= 32) {
-                  ((DCI1A_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=6;
+                  ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=6;
                   TBsize = 32;
                 } else if ((rrc_sdu_length+msg4_header) <= 41) {
-                  ((DCI1A_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=7;
+                  ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=7;
                   TBsize = 41;
                 } else if ((rrc_sdu_length+msg4_header) <= 49) {
-                  ((DCI1A_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=8;
+                  ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=8;
                   TBsize = 49;
                 } else if ((rrc_sdu_length+msg4_header) <= 57) {
-                  ((DCI1A_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=9;
+                  ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=9;
                   TBsize = 57;
                 }
-
+		
+		((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->type=1;
+		((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0;
+		((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rv=0;
+		((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0;
+		((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1;
+		((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->padding=0;
+		((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
+		rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
+							 ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
                 break;
 
               case 50:
 
-                ((DCI1A_10MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->ndi=1;
+                ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->ndi=1;
 
                 if ((rrc_sdu_length+msg4_header) <= 22) {
-                  ((DCI1A_10MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=4;
+                  ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=4;
                   TBsize = 22;
                 } else if ((rrc_sdu_length+msg4_header) <= 28) {
-                  ((DCI1A_10MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=5;
+                  ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=5;
                   TBsize = 28;
                 } else if ((rrc_sdu_length+msg4_header) <= 32) {
-                  ((DCI1A_10MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=6;
+                  ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=6;
                   TBsize = 32;
                 } else if ((rrc_sdu_length+msg4_header) <= 41) {
-                  ((DCI1A_10MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=7;
+                  ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=7;
                   TBsize = 41;
                 } else if ((rrc_sdu_length+msg4_header) <= 49) {
-                  ((DCI1A_10MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=8;
+                  ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=8;
                   TBsize = 49;
                 } else if ((rrc_sdu_length+msg4_header) <= 57) {
-                  ((DCI1A_10MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=9;
+                  ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=9;
                   TBsize = 57;
                 }
+		((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->type=1;
+		((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0;
+		((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rv=0;
+		((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0;
+		((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1;
+		((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->padding=0;
+		((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
+		rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
+							 ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
 
                 break;
 
               case 100:
 
-                ((DCI1A_20MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->ndi=1;
+                ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->ndi=1;
 
                 if ((rrc_sdu_length+msg4_header) <= 22) {
-                  ((DCI1A_20MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=4;
+                  ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=4;
                   TBsize = 22;
                 } else if ((rrc_sdu_length+msg4_header) <= 28) {
-                  ((DCI1A_20MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=5;
+                  ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=5;
                   TBsize = 28;
                 } else if ((rrc_sdu_length+msg4_header) <= 32) {
-                  ((DCI1A_20MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=6;
+                  ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=6;
                   TBsize = 32;
                 } else if ((rrc_sdu_length+msg4_header) <= 41) {
-                  ((DCI1A_20MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=7;
+                  ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=7;
                   TBsize = 41;
                 } else if ((rrc_sdu_length+msg4_header) <= 49) {
-                  ((DCI1A_20MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=8;
+                  ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=8;
                   TBsize = 49;
                 } else if ((rrc_sdu_length+msg4_header) <= 57) {
-                  ((DCI1A_20MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=9;
+                  ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->mcs=9;
                   TBsize = 57;
                 }
 
+		((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->type=1;
+		((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0;
+		((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rv=0;
+		((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0;
+		((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1;
+		((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
+		rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
+							 ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
                 break;
               }
             } else { // FDD DCI
               switch (mac_xface->lte_frame_parms->N_RB_DL) {
               case 6:
-                ((DCI1A_1_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->ndi=1;
+                ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->ndi=1;
 
                 if ((rrc_sdu_length+msg4_header) <= 22) {
-                  ((DCI1A_1_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=4;
+                  ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=4;
                   TBsize = 22;
                 } else if ((rrc_sdu_length+msg4_header) <= 28) {
-                  ((DCI1A_1_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=5;
+                  ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=5;
                   TBsize = 28;
                 } else if ((rrc_sdu_length+msg4_header) <= 32) {
-                  ((DCI1A_1_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=6;
+                  ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=6;
                   TBsize = 32;
                 } else if ((rrc_sdu_length+msg4_header) <= 41) {
-                  ((DCI1A_1_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=7;
+                  ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=7;
                   TBsize = 41;
                 } else if ((rrc_sdu_length+msg4_header) <= 49) {
-                  ((DCI1A_1_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=8;
+                  ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=8;
                   TBsize = 49;
                 } else if ((rrc_sdu_length+msg4_header) <= 57) {
-                  ((DCI1A_1_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=9;
+                  ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=9;
                   TBsize = 57;
                 }
 
+		((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->type=1;
+		((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0;
+		((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rv=0;
+		((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0;
+		((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1;
+		((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->padding=0;
+		((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
+		rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
+							 ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
                 break;
 
               case 25:
-                ((DCI1A_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->ndi=1;
+                ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->ndi=1;
 
                 if ((rrc_sdu_length+msg4_header) <= 22) {
-                  ((DCI1A_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=4;
+                  ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=4;
                   TBsize = 22;
                 } else if ((rrc_sdu_length+msg4_header) <= 28) {
-                  ((DCI1A_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=5;
+                  ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=5;
                   TBsize = 28;
                 } else if ((rrc_sdu_length+msg4_header) <= 32) {
-                  ((DCI1A_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=6;
+                  ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=6;
                   TBsize = 32;
                 } else if ((rrc_sdu_length+msg4_header) <= 41) {
-                  ((DCI1A_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=7;
+                  ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=7;
                   TBsize = 41;
                 } else if ((rrc_sdu_length+msg4_header) <= 49) {
-                  ((DCI1A_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=8;
+                  ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=8;
                   TBsize = 49;
                 } else if ((rrc_sdu_length+msg4_header) <= 57) {
-                  ((DCI1A_5MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=9;
+                  ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=9;
                   TBsize = 57;
                 }
 
 printf("Msg4 MCS %d\n", ((DCI1A_5MHz_TDD_1_6_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs);
+		((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->type=1;
+		((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0;
+		((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rv=0;
+		((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0;
+		((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1;
+		((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->padding=0;
+		((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
+		rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
+							 ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
                 break;
 
               case 50:
-                ((DCI1A_10MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->ndi=1;
+                ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->ndi=1;
 
                 if ((rrc_sdu_length+msg4_header) <= 22) {
-                  ((DCI1A_10MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=4;
+                  ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=4;
                   TBsize = 22;
                 } else if ((rrc_sdu_length+msg4_header) <= 28) {
-                  ((DCI1A_10MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=5;
+                  ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=5;
                   TBsize = 28;
                 } else if ((rrc_sdu_length+msg4_header) <= 32) {
-                  ((DCI1A_10MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=6;
+                  ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=6;
                   TBsize = 32;
                 } else if ((rrc_sdu_length+msg4_header) <= 41) {
-                  ((DCI1A_10MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=7;
+                  ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=7;
                   TBsize = 41;
                 } else if ((rrc_sdu_length+msg4_header) <= 49) {
-                  ((DCI1A_10MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=8;
+                  ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=8;
                   TBsize = 49;
                 } else if ((rrc_sdu_length+msg4_header) <= 57) {
-                  ((DCI1A_10MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=9;
+                  ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=9;
                   TBsize = 57;
                 }
 
+		((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->type=1;
+		((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0;
+		((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rv=0;
+		((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0;
+		((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1;
+		((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->padding=0;
+		((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
+		rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
+							 ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
                 break;
 
               case 100:
-                ((DCI1A_20MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->ndi=1;
+                ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->ndi=1;
 
                 if ((rrc_sdu_length+msg4_header) <= 22) {
-                  ((DCI1A_20MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=4;
+                  ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=4;
                   TBsize = 22;
                 } else if ((rrc_sdu_length+msg4_header) <= 28) {
-                  ((DCI1A_20MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=5;
+                  ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=5;
                   TBsize = 28;
                 } else if ((rrc_sdu_length+msg4_header) <= 32) {
-                  ((DCI1A_20MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=6;
+                  ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=6;
                   TBsize = 32;
                 } else if ((rrc_sdu_length+msg4_header) <= 41) {
-                  ((DCI1A_20MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=7;
+                  ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=7;
                   TBsize = 41;
                 } else if ((rrc_sdu_length+msg4_header) <= 49) {
-                  ((DCI1A_20MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=8;
+                  ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=8;
                   TBsize = 49;
                 } else if ((rrc_sdu_length+msg4_header) <= 57) {
-                  ((DCI1A_20MHz_FDD_t*)&RA_template[i].RA_alloc_pdu2[0])->mcs=9;
+                  ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->mcs=9;
                   TBsize = 57;
                 }
-
+		((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->type=1;
+		((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0;
+		((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rv=0;
+		((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0;
+		((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1;
+		((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->padding=0;
+		((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
+		rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
+							 ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
                 break;
               }
             }
 
-            RA_template[i].generate_Msg4=0;
-            RA_template[i].generate_Msg4_dci=1;
-            RA_template[i].wait_ack_Msg4=1;
-            RA_template[i].RA_active = FALSE;
-            lcid=0;
-
-            if ((TBsize - rrc_sdu_length - msg4_header) <= 2) {
-              msg4_padding = TBsize - rrc_sdu_length - msg4_header;
-              msg4_post_padding = 0;
-            } else {
-              msg4_padding = 0;
-              msg4_post_padding = TBsize - rrc_sdu_length - msg4_header -1;
-            }
-
-            LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d subframeP %d Msg4 : TBS %d, sdu_len %d, msg4_header %d, msg4_padding %d, msg4_post_padding %d\n",
-                  module_idP,CC_id,frameP,subframeP,TBsize,rrc_sdu_length,msg4_header,msg4_padding,msg4_post_padding);
-            DevAssert( UE_id != UE_INDEX_INVALID ); // FIXME not sure how to gracefully return
-            offset = generate_dlsch_header((unsigned char*)eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0],
-                                           1,                           //num_sdus
-                                           (unsigned short*)&rrc_sdu_length,             //
-                                           &lcid,                       // sdu_lcid
-                                           255,                         // no drx
-                                           0,                           // no timing advance
-                                           RA_template[i].cont_res_id,  // contention res id
-                                           msg4_padding,                // no padding
-                                           msg4_post_padding
+	    if (!CCE_allocation_infeasible(module_idP,CC_id,0,subframeP,2,RA_template->rnti)) {
+	      add_ue_spec_dci(DCI_pdu,
+			      (void*)&RA_template->RA_alloc_pdu2[0],
+			      RA_template->rnti,
+			      RA_template->RA_dci_size_bytes2,
+			      2,
+			      RA_template->RA_dci_size_bits2,
+			      RA_template->RA_dci_fmt2,
+			      0);
+	      
+	      RA_template->generate_Msg4=0;
+	      RA_template->wait_ack_Msg4=1;
+	      RA_template->RA_active = FALSE;
+	      lcid=0;
+	      
+	      if ((TBsize - rrc_sdu_length - msg4_header) <= 2) {
+		msg4_padding = TBsize - rrc_sdu_length - msg4_header;
+		msg4_post_padding = 0;
+	      } else {
+		msg4_padding = 0;
+		msg4_post_padding = TBsize - rrc_sdu_length - msg4_header -1;
+	      }
+	      
+	      LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d subframeP %d Msg4 : TBS %d, sdu_len %d, msg4_header %d, msg4_padding %d, msg4_post_padding %d\n",
+		    module_idP,CC_id,frameP,subframeP,TBsize,rrc_sdu_length,msg4_header,msg4_padding,msg4_post_padding);
+	      DevAssert( UE_id != UE_INDEX_INVALID ); // FIXME not sure how to gracefully return
+	      offset = generate_dlsch_header((unsigned char*)eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0],
+					     1,                           //num_sdus
+					     (unsigned short*)&rrc_sdu_length,             //
+					     &lcid,                       // sdu_lcid
+					     255,                         // no drx
+					     0,                           // no timing advance
+					     RA_template->cont_res_id,  // contention res id
+					     msg4_padding,                // no padding
+					     msg4_post_padding
 #ifdef Rel10
-                                           , 0, 0  /* no scell config */
+                                             , 0, 0  /* no scell config */
 #endif
-                                          );
-
-            memcpy((void*)&eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0][(unsigned char)offset],
-                   &eNB->common_channels[CC_id].CCCH_pdu.payload[0],
-                   rrc_sdu_length);
-
-            if (opt_enabled==1) {
-              trace_pdu(1, (uint8_t *)eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0],
-                        rrc_sdu_length, UE_id, 3, UE_RNTI(module_idP, UE_id),
-                        eNB->subframe,0,0);
-              LOG_D(OPT,"[eNB %d][DLSCH] CC_id %d Frame %d trace pdu for rnti %x with size %d\n",
-                    module_idP, CC_id, frameP, UE_RNTI(module_idP,UE_id), rrc_sdu_length);
-            }
-
-            nprb[CC_id]= nprb[CC_id] + 3;
-            nCCE[CC_id] = nCCE[CC_id] + 4;
-          }
+                                            );
+	      
+	      memcpy((void*)&eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0][(unsigned char)offset],
+		     &eNB->common_channels[CC_id].CCCH_pdu.payload[0],
+		     rrc_sdu_length);
+	      
+              T(T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT(module_idP), T_INT(CC_id), T_INT(RA_template->rnti), T_INT(frameP), T_INT(subframeP),
+                T_INT(0 /*harq_pid always 0?*/), T_BUFFER(&eNB->UE_list.DLSCH_pdu[CC_id][0][UE_id].payload[0], TBsize));
+
+	      if (opt_enabled==1) {
+		trace_pdu(1, (uint8_t *)eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0],
+			  rrc_sdu_length, UE_id, 3, UE_RNTI(module_idP, UE_id),
+			  eNB->subframe,0,0);
+		LOG_D(OPT,"[eNB %d][DLSCH] CC_id %d Frame %d trace pdu for rnti %x with size %d\n",
+		      module_idP, CC_id, frameP, UE_RNTI(module_idP,UE_id), rrc_sdu_length);
+	      }
+	      
+	    }
+	  }
 
           //try here
         }
 
-        /*
-        else if (eNB_mac_inst[module_idP][CC_id].RA_template[i].wait_ack_Msg4==1) {
-        // check HARQ status and retransmit if necessary
-        LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, subframeP %d: Checking if Msg4 was acknowledged :\n",module_idP,frameP,subframeP);
-        // Get candidate harq_pid from PHY
-        mac_xface->get_ue_active_harq_pid(module_idP,eNB_mac_inst[module_idP][CC_id].RA_template[i].rnti,subframeP,&harq_pid,&round,0);
-        if (round>0) {
-         *nprb= (*nprb) + 3;
-         *nCCE = (*nCCE) + 4;
-        }
-        }
-         */
+      } else if (RA_template->wait_ack_Msg4==1) {
+	// check HARQ status and retransmit if necessary
+	LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Checking if Msg4 was acknowledged: \n",
+	      module_idP,CC_id,frameP,subframeP);
+	// Get candidate harq_pid from PHY
+	mac_xface->get_ue_active_harq_pid(module_idP,CC_id,RA_template->rnti,frameP,subframeP,&harq_pid,&round,0);
+	
+	if (round>0) {
+	  //RA_template->wait_ack_Msg4++;
+	  // we have to schedule a retransmission
+	  if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) {
+	    ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->ndi=1;
+	  } else {
+	    ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->ndi=1;
+	  }
+	  
+	  /*
+	  // randomize frequency allocation for RA
+	  while (1) {
+	    first_rb = (unsigned char)(taus()%(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL-4));
+	    
+	    if ((vrb_map[first_rb] != 1) && (vrb_map[first_rb+3] != 1))
+	      break;
+	  }
+	  */
+	  first_rb=0;
+	  vrb_map[first_rb] = 1;
+	  vrb_map[first_rb+1] = 1;
+	  vrb_map[first_rb+2] = 1;
+	  vrb_map[first_rb+3] = 1;
+	  
+	  if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) {
+	    ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_UL,first_rb,4);
+	    rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
+						     ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
+	  } else {
+	    ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_UL,first_rb,4);
+	    rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
+						     ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
+	  }
+	  
+	  if (!CCE_allocation_infeasible(module_idP,CC_id,0,subframeP,2,RA_template->rnti)) {
+	    add_ue_spec_dci(DCI_pdu,
+			    (void*)&RA_template->RA_alloc_pdu2[0],
+			    RA_template->rnti,
+			    RA_template->RA_dci_size_bytes2,
+			    2,
+			    RA_template->RA_dci_size_bits2,
+			    RA_template->RA_dci_fmt2,
+			    0);
+	  }
+	  LOG_W(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Msg4 not acknowledged, adding ue specific dci (rnti %x) for RA (Msg4 Retransmission)\n",
+		module_idP,CC_id,frameP,subframeP,RA_template->rnti);
+	} else {
+	  /*      msg4 not received
+		  if ((round == 0) && (RA_template->wait_ack_Msg4>1){
+		  remove UE instance across all the layers: mac_xface->cancel_RA();
+		  }
+	  */
+	  LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d : Msg4 acknowledged\n",module_idP,CC_id,frameP,subframeP);
+	  RA_template->wait_ack_Msg4=0;
+	  RA_template->RA_active=FALSE;
+	  UE_id = find_UE_id(module_idP,RA_template->rnti);
+	  DevAssert( UE_id != -1 );
+	  eNB_mac_inst[module_idP].UE_list.UE_template[UE_PCCID(module_idP,UE_id)][UE_id].configured=TRUE;
+	  
+	}
       }
-    }
-  }
+    } // for i=0 .. N_RA_PROC-1 
+  } // CC_id
 
   stop_meas(&eNB->schedule_ra);
 }
@@ -432,7 +748,10 @@ void initiate_ra_proc(module_id_t module_idP, int CC_id,frame_t frameP, uint16_t
   uint8_t i;
   RA_TEMPLATE *RA_template = (RA_TEMPLATE *)&eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[0];
 
-  LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Initiating RA procedure for preamble index %d\n",module_idP,CC_id,frameP,preamble_index);
+  LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Initiating RA procedure for preamble index %d\n",module_idP,CC_id,frameP,preamble_index);
+
+  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_INITIATE_RA_PROC,1);
+  VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_INITIATE_RA_PROC,0);
 
   for (i=0; i<NB_RA_PROC_MAX; i++) {
     if (RA_template[i].RA_active==FALSE) {
@@ -460,7 +779,7 @@ void cancel_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, rnti_t rn
   RA_TEMPLATE *RA_template = (RA_TEMPLATE *)&eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[0];
 
   MSC_LOG_EVENT(MSC_PHY_ENB, "RA Cancelling procedure ue %"PRIx16" ", rnti);
-  LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Cancelling RA procedure for UE rnti %x\n",module_idP,CC_id,frameP,rnti);
+  LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Cancelling RA procedure for UE rnti %x\n",module_idP,CC_id,frameP,rnti);
 
   for (i=0; i<NB_RA_PROC_MAX; i++) {
     if (rnti == RA_template[i].rnti) {
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_bch.c b/openair2/LAYER2/MAC/eNB_scheduler_bch.c
index dd0890783e2116fd09dc9f8b97d9d552028fbf2e..f3774777a1b287b7d4fd44a401393b97324a651a 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_bch.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_bch.c
@@ -72,9 +72,8 @@ void
 schedule_SI(
   module_id_t   module_idP,
   frame_t       frameP,
-  unsigned int* nprbP,
-  unsigned int* nCCEP
-)
+  sub_frame_t   subframeP)
+
 //------------------------------------------------------------------------------
 {
 
@@ -85,12 +84,19 @@ schedule_SI(
   void *BCCH_alloc_pdu;
   int CC_id;
   eNB_MAC_INST *eNB = &eNB_mac_inst[module_idP];
+  uint8_t *vrb_map;
+  int first_rb = -1;
+  int rballoc[MAX_NUM_CCs];
+  int sizeof1A_bytes,sizeof1A_bits = -1;
+  DCI_PDU *DCI_pdu;
 
   start_meas(&eNB->schedule_si);
 
   for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
-
-    BCCH_alloc_pdu=(void*)&eNB->common_channels[CC_id].BCCH_alloc_pdu;
+    
+    BCCH_alloc_pdu  = (void*)&eNB->common_channels[CC_id].BCCH_alloc_pdu;
+    DCI_pdu         = (void*)&eNB->common_channels[CC_id].DCI_pdu;
+    vrb_map         = (void*)&eNB->common_channels[CC_id].vrb_map;
 
     bcch_sdu_length = mac_rrc_data_req(module_idP,
                                        CC_id,
@@ -104,7 +110,41 @@ schedule_SI(
     if (bcch_sdu_length > 0) {
       LOG_D(MAC,"[eNB %d] Frame %d : BCCH->DLSCH CC_id %d, Received %d bytes \n",module_idP,frameP,CC_id,bcch_sdu_length);
 
+      // Allocate 4 PRBs in a random location
+      /*
+      while (1) {
+	first_rb = (unsigned char)(taus()%(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL-4));
+	if ((vrb_map[first_rb] != 1) && 
+	    (vrb_map[first_rb+1] != 1) && 
+	    (vrb_map[first_rb+2] != 1) && 
+	    (vrb_map[first_rb+3] != 1))
+	  break;
+      }
+      */
+      switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) {
+      case 6:
+	first_rb = 0;
+	break;
+      case 15:
+	first_rb = 6;
+	break;
+      case 25:
+	first_rb = 11;
+	break;
+      case 50:
+	first_rb = 23;
+	break;
+      case 100:
+	first_rb = 48;
+	break;
+      }
+
+      vrb_map[first_rb] = 1;
+      vrb_map[first_rb+1] = 1;
+      vrb_map[first_rb+2] = 1;
+      vrb_map[first_rb+3] = 1;
 
+      // Get MCS for length of SI
       if (bcch_sdu_length <= (mac_xface->get_TBS_DL(0,3))) {
         mcs=0;
       } else if (bcch_sdu_length <= (mac_xface->get_TBS_DL(1,3))) {
@@ -125,46 +165,153 @@ schedule_SI(
         mcs=8;
       }
 
+
+
       if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) {
         switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) {
         case 6:
           ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->mcs = mcs;
+          ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
+          ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->type = 1;
+          ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->vrb_type = 0;
+          ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->ndi = 1;
+          ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rv = 1;
+          ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->harq_pid = 0;
+          ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->TPC = 1;
+          ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->padding = 0;
+          rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc);
+	  sizeof1A_bytes = sizeof(DCI1A_1_5MHz_TDD_1_6_t);
+	  sizeof1A_bits = sizeof_DCI1A_1_5MHz_TDD_1_6_t;
           break;
 
         case 25:
           ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->mcs = mcs;
-          break;
+          ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
+          ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->type = 1;
+          ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->vrb_type = 0;
+          ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->ndi = 1;
+          ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rv = 1;
+          ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->harq_pid = 0;
+          ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->TPC = 1;
+          ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->padding = 0;
+          rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc);
+	  sizeof1A_bytes = sizeof(DCI1A_5MHz_TDD_1_6_t);
+	  sizeof1A_bits = sizeof_DCI1A_5MHz_TDD_1_6_t;
+	  break;
 
         case 50:
           ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->mcs = mcs;
+          ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
+          ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->type = 1;
+          ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->vrb_type = 0;
+          ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->ndi = 1;
+          ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rv = 1;
+          ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->harq_pid = 0;
+          ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->TPC = 1;
+          ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->padding = 0;
+          rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc);
+	  sizeof1A_bytes = sizeof(DCI1A_10MHz_TDD_1_6_t);
+	  sizeof1A_bits = sizeof_DCI1A_10MHz_TDD_1_6_t;
           break;
 
         case 100:
           ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->mcs = mcs;
-          break;
+          ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
+          ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->type = 1;
+          ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->vrb_type = 0;
+          ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->ndi = 1;
+          ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rv = 1;
+          ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->harq_pid = 0;
+          ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->TPC = 1;
+          ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->padding = 0;
+          rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc);
+	  sizeof1A_bytes = sizeof(DCI1A_20MHz_TDD_1_6_t);
+	  sizeof1A_bits = sizeof_DCI1A_20MHz_TDD_1_6_t; 
+         break;
         }
 
       } else {
         switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) {
         case 6:
           ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->mcs = mcs;
+          ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
+          ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->type = 1;
+          ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->vrb_type = 0;
+          ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->ndi = 1;
+          ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->rv = 1;
+          ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->harq_pid = 0;
+          ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->TPC = 1;
+          ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->padding = 0;
+
+          rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->rballoc);
+	  sizeof1A_bytes = sizeof(DCI1A_1_5MHz_FDD_t);
+	  sizeof1A_bits = sizeof_DCI1A_1_5MHz_FDD_t;
           break;
 
         case 25:
           ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->mcs = mcs;
+          ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
+          ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->type = 1;
+          ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->vrb_type = 0;
+          ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->ndi = 1;
+          ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->rv = 1;
+          ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->harq_pid = 0;
+          ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->TPC = 1;
+          ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->padding = 0;
+
+          rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->rballoc);
+	  sizeof1A_bytes = sizeof(DCI1A_5MHz_FDD_t);
+	  sizeof1A_bits = sizeof_DCI1A_5MHz_FDD_t;
           break;
 
         case 50:
           ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->mcs = mcs;
+          ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
+          ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->type = 1;
+          ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->vrb_type = 0;
+          ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->ndi = 1;
+          ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->rv = 1;
+          ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->harq_pid = 0;
+          ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->TPC = 1;
+          ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->padding = 0;
+
+          rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->rballoc);
+	  sizeof1A_bytes = sizeof(DCI1A_10MHz_FDD_t);
+	  sizeof1A_bits = sizeof_DCI1A_10MHz_FDD_t;
           break;
 
         case 100:
           ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->mcs = mcs;
-          break;
+          ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
+          ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->type = 1;
+          ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->vrb_type = 0;
+          ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->ndi = 1;
+          ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->rv = 1;
+          ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->harq_pid = 0;
+          ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->TPC = 1;
+          ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->padding = 0;
+
+          rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->rballoc);
+ 	  sizeof1A_bytes = sizeof(DCI1A_20MHz_FDD_t);
+	  sizeof1A_bits = sizeof_DCI1A_20MHz_FDD_t;
+	  break;
 
         }
       }
 
+      if (!CCE_allocation_infeasible(module_idP,CC_id,1,subframeP,2,SI_RNTI)) {
+	add_common_dci(DCI_pdu,
+		       BCCH_alloc_pdu,
+		       SI_RNTI,
+		       sizeof1A_bytes,
+		       2,
+		       sizeof1A_bits,
+		       format1A,0);
+      }
+      else {
+	LOG_E(MAC,"[eNB %d] CCid %d Frame %d, subframe %d : Cannot add DCI 1A for SI\n",module_idP, CC_id,frameP,subframeP);
+      }
+
       if (opt_enabled == 1) {
         trace_pdu(1,
                   &eNB->common_channels[CC_id].BCCH_pdu.payload[0],
@@ -194,17 +341,13 @@ schedule_SI(
               mac_xface->get_TBS_DL(mcs,3));
       }
 
-      eNB->common_channels[CC_id].bcch_active=1;
-      nprbP[CC_id]=3;
-      nCCEP[CC_id]=4;
+
       eNB->eNB_stats[CC_id].total_num_bcch_pdu+=1;
       eNB->eNB_stats[CC_id].bcch_buffer=bcch_sdu_length;
       eNB->eNB_stats[CC_id].total_bcch_buffer+=bcch_sdu_length;
       eNB->eNB_stats[CC_id].bcch_mcs=mcs;
     } else {
-      eNB->common_channels[CC_id].bcch_active=0;
-      nprbP[CC_id]=0;
-      nCCEP[CC_id]=0;
+
       //LOG_D(MAC,"[eNB %d] Frame %d : BCCH not active \n",Mod_id,frame);
     }
   }
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
index 7112456cc5201b6b10be047005db0ecc77b57ae1..d32d383a607f98d74da61d86ab959e642c98edf1 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
@@ -65,6 +65,8 @@
 # include "intertask_interface.h"
 #endif
 
+#include "T.h"
+
 #define ENABLE_MAC_PAYLOAD_DEBUG
 //#define DEBUG_eNB_SCHEDULER 1
 
@@ -453,16 +455,13 @@ schedule_ue_spec(
   module_id_t   module_idP,
   frame_t       frameP,
   sub_frame_t   subframeP,
-  unsigned int  *nb_rb_used0,
-  unsigned int  *nCCE_used,
-  int*           mbsfn_flag
+  int*          mbsfn_flag
 )
 //------------------------------------------------------------------------------
 {
 
   uint8_t               CC_id;
   int                   UE_id;
-  uint16_t              nCCE[MAX_NUM_CCs];
   int                   N_RBG[MAX_NUM_CCs];
   unsigned char         aggregation;
   mac_rlc_status_resp_t rlc_status;
@@ -481,7 +480,6 @@ schedule_ue_spec(
   //  uint16_t              pre_nb_available_rbs[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
   int                   mcs;
   uint16_t              min_rb_unit[MAX_NUM_CCs];
-  short                 ta_update        = 0;
   eNB_MAC_INST         *eNB      = &eNB_mac_inst[module_idP];
   UE_list_t            *UE_list  = &eNB->UE_list;
   LTE_DL_FRAME_PARMS   *frame_parms[MAX_NUM_CCs];
@@ -494,6 +492,7 @@ schedule_ue_spec(
   uint8_t               scell_bitmap = 0;
 #endif
   int                   scell_activation_len = 0; /* not into #ifdef Rel10 to ease code readability below */
+  int i;
 
   if (UE_list->head==-1) {
     return;
@@ -508,15 +507,18 @@ schedule_ue_spec(
   for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
     min_rb_unit[CC_id]=get_min_rb_unit(module_idP,CC_id);
     frame_parms[CC_id] = mac_xface->get_lte_frame_parms(module_idP,CC_id);
-    total_nb_available_rb[CC_id] = frame_parms[CC_id]->N_RB_DL - nb_rb_used0[CC_id];
-    nCCE[CC_id] = mac_xface->get_nCCE_max(module_idP,CC_id) - nCCE_used[CC_id];
+    // get number of PRBs less those used by common channels
+    total_nb_available_rb[CC_id] = frame_parms[CC_id]->N_RB_DL;
+    for (i=0;i<frame_parms[CC_id]->N_RB_DL;i++)
+      if (eNB->common_channels[CC_id].vrb_map[i]!=0)
+	total_nb_available_rb[CC_id]--;
+
     N_RBG[CC_id] = frame_parms[CC_id]->N_RBG;
 
     // store the global enb stats:
     eNB->eNB_stats[CC_id].num_dlactive_UEs =  UE_list->num_UEs;
     eNB->eNB_stats[CC_id].available_prbs =  total_nb_available_rb[CC_id];
     eNB->eNB_stats[CC_id].total_available_prbs +=  total_nb_available_rb[CC_id];
-    eNB->eNB_stats[CC_id].available_ncces = nCCE[CC_id];
     eNB->eNB_stats[CC_id].dlsch_bytes_tx=0;
     eNB->eNB_stats[CC_id].dlsch_pdus_tx=0;
   }
@@ -558,9 +560,11 @@ schedule_ue_spec(
         continue_flag=1;
       }
 
-      if ((ue_sched_ctl->pre_nb_available_rbs[CC_id] == 0) || (nCCE[CC_id] < (1<<aggregation))) {
+      if ((ue_sched_ctl->pre_nb_available_rbs[CC_id] == 0) ||  // no RBs allocated 
+	  CCE_allocation_infeasible(module_idP,CC_id,0,subframeP,aggregation,rnti)
+	  ) {
         LOG_D(MAC,"[eNB %d] Frame %d : no RB allocated for UE %d on CC_id %d: continue \n",
-              module_idP, frameP, UE_id, CC_id, nb_rb_used0[CC_id], ue_sched_ctl->pre_nb_available_rbs[CC_id], nCCE[CC_id], aggregation);
+              module_idP, frameP, UE_id, CC_id);
         //if(mac_xface->get_transmission_mode(module_idP,rnti)==5)
         continue_flag=1; //to next user (there might be rbs availiable for other UEs in TM5
         // else
@@ -575,7 +579,6 @@ schedule_ue_spec(
                     UE_list);
         // update UL DAI after DLSCH scheduling
         set_ul_DAI(module_idP,UE_id,CC_id,frameP,subframeP,frame_parms);
-
       }
 
       if (continue_flag == 1 ) {
@@ -624,11 +627,10 @@ schedule_ue_spec(
         UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][j] = 0;
       }
 
-      LOG_D(MAC,"[eNB %d] Frame %d: Scheduling UE %d on CC_id %d (rnti %x, harq_pid %d, round %d, rb %d, cqi %d, mcs %d, ncc %d, rrc %d)\n",
+      LOG_D(MAC,"[eNB %d] Frame %d: Scheduling UE %d on CC_id %d (rnti %x, harq_pid %d, round %d, rb %d, cqi %d, mcs %d, rrc %d)\n",
             module_idP, frameP, UE_id,CC_id,rnti,harq_pid, round,nb_available_rb,
             eNB_UE_stats->DL_cqi[0], eNB_UE_stats->dlsch_mcs1,
-            nCCE[CC_id],
-            UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status);
+	    UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status);
 
 
       // Note this code is for a specific DCI format
@@ -678,8 +680,6 @@ schedule_ue_spec(
 
           nb_available_rb -= nb_rb;
           aggregation = process_ue_cqi(module_idP,UE_id);
-          nCCE[CC_id]-=(1<<aggregation); // adjust the remaining nCCE
-          nCCE_used[CC_id] += (1<<aggregation);
 
 
           PHY_vars_eNB_g[module_idP][CC_id]->mu_mimo_mode[UE_id].pre_nb_available_rbs = nb_rb;
@@ -827,7 +827,6 @@ schedule_ue_spec(
           UE_list->eNB_UE_stats[CC_id][UE_id].num_retransmission+=1;
           UE_list->eNB_UE_stats[CC_id][UE_id].rbs_used_retx=nb_rb;
           UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used_retx+=nb_rb;
-          UE_list->eNB_UE_stats[CC_id][UE_id].ncce_used_retx=nCCE[CC_id];
           UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs1=eNB_UE_stats->dlsch_mcs1;
           UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs2=eNB_UE_stats->dlsch_mcs1;
 printf("\x1b[34;43mDTCH CC_id %d retrans? #rb %d mcs %d harq_pid %d round %d f/sf %d/%d\x1b[0m\n", CC_id, nb_rb, eNB_UE_stats->dlsch_mcs1, harq_pid, round, frameP, subframeP);
@@ -845,28 +844,6 @@ printf("\x1b[34;43mDTCH CC_id %d retrans? #rb %d mcs %d harq_pid %d round %d f/s
         // check first for RLC data on DCCH
         // add the length for  all the control elements (timing adv, drx, etc) : header + payload
 
-        //#ifndef EXMIMO_IOT
-        // to be checked by RK, NN, FK
-        uint8_t update_TA=4;
-
-        switch (frame_parms[CC_id]->N_RB_DL) {
-        case 6:
-          update_TA = 1;
-          break;
-
-        case 25:
-          update_TA = 4;
-          break;
-
-        case 50:
-          update_TA = 8;
-          break;
-
-        case 100:
-          update_TA = 16;
-          break;
-        }
-
 #ifdef Rel10
         /* check if SCells reconfiguration has to be done */
 /*NO SCELL*/
@@ -907,7 +884,7 @@ printf("to_configure!!\n");
           scell_activation_len = 0;
 #endif /* Rel10 */
 
-        ta_len = ((eNB_UE_stats->timing_advance_update/update_TA)!=0) ? 2 : 0;
+        ta_len = (ue_sched_ctl->ta_update!=0) ? 2 : 0;
 
         header_len_dcch = 2; // 2 bytes DCCH SDU subheader
 
@@ -937,6 +914,9 @@ printf("to_configure!!\n");
                                 DCCH,
                                 (char *)&dlsch_buffer[sdu_lengths[0]]);
 
+            T(T_ENB_MAC_UE_DL_SDU, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP),
+              T_INT(harq_pid), T_INT(DCCH), T_INT(sdu_lengths[0]));
+
             LOG_D(MAC,"[eNB %d][DCCH] CC_id %d Got %d bytes from RLC\n",module_idP,CC_id,sdu_lengths[0]);
             sdu_length_total = sdu_lengths[0];
             sdu_lcids[0] = DCCH;
@@ -984,6 +964,9 @@ printf("to_configure!!\n");
                                        DCCH+1,
                                        (char *)&dlsch_buffer[sdu_lengths[0]]);
 
+            T(T_ENB_MAC_UE_DL_SDU, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP),
+              T_INT(harq_pid), T_INT(DCCH+1), T_INT(sdu_lengths[num_sdus]));
+
             sdu_lcids[num_sdus] = DCCH1;
             sdu_length_total += sdu_lengths[num_sdus];
             header_len_dcch += 2;
@@ -1030,6 +1013,9 @@ printf("DTCH CC_id %d mcs %d tbs %d #avail rb %d harq_pid %d buf %d avail %d f/s
                                       DTCH,
                                       (char*)&dlsch_buffer[sdu_length_total]);
 
+            T(T_ENB_MAC_UE_DL_SDU, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP),
+              T_INT(harq_pid), T_INT(DTCH), T_INT(sdu_lengths[num_sdus]));
+
             LOG_D(MAC,"[eNB %d][USER-PLANE DEFAULT DRB] CC_id %d Got %d bytes for DTCH %d \n",
                   module_idP,CC_id,sdu_lengths[num_sdus],DTCH);
             sdu_lcids[num_sdus] = DTCH;
@@ -1157,11 +1143,6 @@ printf("DTCH CC_id %d mcs %d tbs %d #avail rb %d harq_pid %d buf %d avail %d f/s
             post_padding = TBS - sdu_length_total - header_len_dcch - header_len_dtch - ta_len - scell_activation_len; // 1 is for the postpadding header
           }
 
-          //#ifndef EXMIMO_IOT
-          ta_update = eNB_UE_stats->timing_advance_update/update_TA;
-          /*#else
-          ta_update = 0;
-          #endif*/
 
           offset = generate_dlsch_header((unsigned char*)UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0],
                                          // offset = generate_dlsch_header((unsigned char*)eNB_mac_inst[0].DLSCH_pdu[0][0].payload[0],
@@ -1169,7 +1150,7 @@ printf("DTCH CC_id %d mcs %d tbs %d #avail rb %d harq_pid %d buf %d avail %d f/s
                                          sdu_lengths,  //
                                          sdu_lcids,
                                          255,                                   // no drx
-                                         ta_update, // timing advance
+                                         ue_sched_ctl->ta_update, // timing advance
                                          NULL,                                  // contention res id
                                          padding,
                                          post_padding
@@ -1180,13 +1161,11 @@ printf("DTCH CC_id %d mcs %d tbs %d #avail rb %d harq_pid %d buf %d avail %d f/s
                                         );
 
           //#ifdef DEBUG_eNB_SCHEDULER
-          /* CROUX: let's get always the log, to remove (reactivate the if) */
-          //if (ta_update) {
-          if (0) {
+          if (ue_sched_ctl->ta_update) {
             LOG_I(MAC,
                   "[eNB %d][DLSCH] Frame %d Generate header for UE_id %d on CC_id %d: sdu_length_total %d, num_sdus %d, sdu_lengths[0] %d, sdu_lcids[0] %d => payload offset %d,timing advance value : %d, padding %d,post_padding %d,(mcs %d, TBS %d, nb_rb %d),header_dcch %d, header_dtch %d\n",
                   module_idP,frameP, UE_id, CC_id, sdu_length_total,num_sdus,sdu_lengths[0],sdu_lcids[0],offset,
-                  ta_update,padding,post_padding,mcs,TBS,nb_rb,header_len_dcch,header_len_dtch);
+                  ue_sched_ctl->ta_update,padding,post_padding,mcs,TBS,nb_rb,header_len_dcch,header_len_dtch);
           }
 
           //#endif
@@ -1217,9 +1196,10 @@ printf("DTCH CC_id %d mcs %d tbs %d #avail rb %d harq_pid %d buf %d avail %d f/s
                   module_idP, CC_id, frameP, UE_RNTI(module_idP,UE_id), TBS);
           }
 
+          T(T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP),
+            T_INT(harq_pid), T_BUFFER(UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0], TBS));
+
           aggregation = process_ue_cqi(module_idP,UE_id);
-          nCCE[CC_id]-=(1<<aggregation); // adjust the remaining nCCE
-          nCCE_used[CC_id]+=(1<<aggregation); // adjust the remaining nCCE
           UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid] = nb_rb;
 
 //printf("ACKNACK add_ue_dlsch_info CC_id %d UE_id %d subframeP %d nb_rb %d mcs1 %d mcs2 %d\n", CC_id, UE_id, subframeP, nb_rb, eNB_UE_stats->dlsch_mcs1, mcs);
@@ -1234,7 +1214,6 @@ printf("DTCH CC_id %d mcs %d tbs %d #avail rb %d harq_pid %d buf %d avail %d f/s
 
           UE_list->eNB_UE_stats[CC_id][UE_id].rbs_used = nb_rb;
           UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used += nb_rb;
-          UE_list->eNB_UE_stats[CC_id][UE_id].ncce_used = nCCE[CC_id];
           UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs1=eNB_UE_stats->dlsch_mcs1;
           UE_list->eNB_UE_stats[CC_id][UE_id].dlsch_mcs2=mcs;
           UE_list->eNB_UE_stats[CC_id][UE_id].TBS = TBS;
@@ -1247,7 +1226,7 @@ printf("DTCH CC_id %d mcs %d tbs %d #avail rb %d harq_pid %d buf %d avail %d f/s
           if (frame_parms[CC_id]->frame_type == TDD) {
             UE_list->UE_template[CC_id][UE_id].DAI++;
             //  printf("DAI update: subframeP %d: UE %d, DAI %d\n",subframeP,UE_id,UE_list->UE_template[CC_id][UE_id].DAI);
-#warning only for 5MHz channel
+//#warning only for 5MHz channel
             update_ul_dci(module_idP,CC_id,rnti,UE_list->UE_template[CC_id][UE_id].DAI);
           }
 
@@ -1255,7 +1234,7 @@ printf("DTCH CC_id %d mcs %d tbs %d #avail rb %d harq_pid %d buf %d avail %d f/s
           // this is the normalized RX power
 	  eNB_UE_stats =  mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti);
 	  normalized_rx_power = eNB_UE_stats->Po_PUCCH_dBm; 
-	  target_rx_power = mac_xface->get_target_pucch_rx_power(module_idP,CC_id) + 10;
+	  target_rx_power = mac_xface->get_target_pucch_rx_power(module_idP,CC_id) + 20;
 	    
           // this assumes accumulated tpc
 	  // make sure that we are only sending a tpc update once a frame, otherwise the control loop will freak out
@@ -1267,6 +1246,7 @@ printf("DTCH CC_id %d mcs %d tbs %d #avail rb %d harq_pid %d buf %d avail %d f/s
 
 	      UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_frame=frameP;
 	      UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_subframe=subframeP;
+	      
 	      if (normalized_rx_power>(target_rx_power+1)) {
 		tpc = 0; //-1
 		tpc_accumulated--;
@@ -1276,9 +1256,11 @@ printf("DTCH CC_id %d mcs %d tbs %d #avail rb %d harq_pid %d buf %d avail %d f/s
 	      } else {
 		tpc = 1; //0
 	      }
-	      LOG_D(MAC,"[eNB %d] DLSCH scheduler: frame %d, subframe %d, harq_pid %d, tpc %d, accumulated %d, normalized/target rx power %d/%d\n",
+	      /*	      
+	      LOG_I(MAC,"[eNB %d] DLSCH scheduler: frame %d, subframe %d, harq_pid %d, tpc %d, accumulated %d, normalized/target rx power %d/%d\n",
 		    module_idP,frameP, subframeP,harq_pid,tpc,
-		    tpc_accumulated,normalized_rx_power,target_rx_power);
+		    tpc_accumulated,normalized_rx_power,target_rx_power);*/
+
 	    } // Po_PUCCH has been updated 
 	    else {
 	      tpc = 1; //0
@@ -1584,10 +1566,9 @@ printf("DTCH CC_id %d mcs %d tbs %d #avail rb %d harq_pid %d buf %d avail %d f/s
       if (frame_parms[CC_id]->frame_type == TDD) {
         set_ul_DAI(module_idP,UE_id,CC_id,frameP,subframeP,frame_parms);
       }
-    }
-  }
 
-  //printf("MAC nCCE : %d\n",*nCCE_used);
+    } // UE_id loop
+  }  // CC_id loop
 
 
   stop_meas(&eNB->schedule_dlsch);
@@ -1598,36 +1579,33 @@ printf("DTCH CC_id %d mcs %d tbs %d #avail rb %d harq_pid %d buf %d avail %d f/s
 //------------------------------------------------------------------------------
 void
 fill_DLSCH_dci(
-  module_id_t module_idP,
-  frame_t frameP,
-  sub_frame_t subframeP,
-  uint32_t* RBallocP,
-  uint8_t RA_scheduledP,
-  int* mbsfn_flagP
-)
+	       module_id_t module_idP,
+	       frame_t frameP,
+	       sub_frame_t subframeP,
+	       int* mbsfn_flagP
+	       )
 //------------------------------------------------------------------------------
 {
 
   // loop over all allocated UEs and compute frequency allocations for PDSCH
   int   UE_id = -1;
-  uint8_t            first_rb,nb_rb=3;
+  uint8_t            /* first_rb, */ nb_rb=3;
   rnti_t        rnti;
-  unsigned char vrb_map[100];
+  //unsigned char *vrb_map;
   uint8_t            rballoc_sub[25];
   //uint8_t number_of_subbands=13;
-  uint32_t           *rballoc=RBallocP;
 
-  unsigned char round;
+  //unsigned char round;
   unsigned char harq_pid;
   void         *DLSCH_dci=NULL;
   DCI_PDU      *DCI_pdu;
   int           i;
-  void         *BCCH_alloc_pdu;
+  //void         *BCCH_alloc_pdu;
   int           size_bits,size_bytes;
   int CC_id;
   eNB_MAC_INST *eNB  =&eNB_mac_inst[module_idP];
   UE_list_t    *UE_list = &eNB->UE_list;
-  RA_TEMPLATE  *RA_template;
+  //RA_TEMPLATE  *RA_template;
 
   start_meas(&eNB->fill_DLSCH_dci);
   VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_FILL_DLSCH_DCI,VCD_FUNCTION_IN);
@@ -1638,598 +1616,8 @@ fill_DLSCH_dci(
     if (mbsfn_flagP[CC_id]>0)
       continue;
 
-    DCI_pdu  = &eNB->common_channels[CC_id].DCI_pdu;
-    BCCH_alloc_pdu=(void*)&eNB->common_channels[CC_id].BCCH_alloc_pdu;
-    // clear vrb_map
-    memset(vrb_map,0,100);
-
-
-    // SI DLSCH
-    //  printf("BCCH check\n");
-    if (eNB->common_channels[CC_id].bcch_active == 1) {
-      eNB->common_channels[CC_id].bcch_active = 0;
-      LOG_D(MAC,"[eNB %d] CC_id %d Frame %d subframeP %d: BCCH active\n", module_idP, CC_id, frameP, subframeP);
-      // randomize frequency allocation for SI
-      first_rb = 10;//(unsigned char)(taus()%(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL-4));
-
-      /*  Where is this from, should be removed!!!!
-
-      if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) {
-
-      }
-      else {
-      BCCH_alloc_pdu_fdd.rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
-      rballoc[CC_id] |= mac_xface->get_rballoc(BCCH_alloc_pdu_fdd.vrb_type,BCCH_alloc_pdu_fdd.rballoc);
-      }
-      */
-
-
-      vrb_map[first_rb] = 1;
-      vrb_map[first_rb+1] = 1;
-      vrb_map[first_rb+2] = 1;
-      vrb_map[first_rb+3] = 1;
-
-      if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) {
-        switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) {
-        case 6:
-          ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
-          ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->type = 1;
-          ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->vrb_type = 0;
-          ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->ndi = 1;
-          ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rv = 1;
-          ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->harq_pid = 0;
-          ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->TPC = 1;
-          ((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->padding = 0;
-          rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_1_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc);
-          add_common_dci(DCI_pdu,
-                         BCCH_alloc_pdu,
-                         SI_RNTI,
-                         sizeof(DCI1A_1_5MHz_TDD_1_6_t),
-                         2,
-                         sizeof_DCI1A_1_5MHz_TDD_1_6_t,
-                         format1A,0);
-          break;
-
-        case 25:
-          ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
-          ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->type = 1;
-          ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->vrb_type = 0;
-          ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->ndi = 1;
-          ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rv = 1;
-          ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->harq_pid = 0;
-          ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->TPC = 1;
-          ((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->padding = 0;
-          rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_5MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc);
-          add_common_dci(DCI_pdu,
-                         BCCH_alloc_pdu,
-                         SI_RNTI,
-                         sizeof(DCI1A_5MHz_TDD_1_6_t),
-                         2,
-                         sizeof_DCI1A_5MHz_TDD_1_6_t,
-                         format1A,0);
-          break;
-
-        case 50:
-          ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
-          ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->type = 1;
-          ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->vrb_type = 0;
-          ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->ndi = 1;
-          ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rv = 1;
-          ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->harq_pid = 0;
-          ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->TPC = 1;
-          ((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->padding = 0;
-          rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_10MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc);
-          add_common_dci(DCI_pdu,
-                         BCCH_alloc_pdu,
-                         SI_RNTI,
-                         sizeof(DCI1A_10MHz_TDD_1_6_t),
-                         2,
-                         sizeof_DCI1A_10MHz_TDD_1_6_t,
-                         format1A,0);
-          break;
-
-        case 100:
-          ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
-          ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->type = 1;
-          ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->vrb_type = 0;
-          ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->ndi = 1;
-          ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rv = 1;
-          ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->harq_pid = 0;
-          ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->TPC = 1;
-          ((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->padding = 0;
-          rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_20MHz_TDD_1_6_t*)BCCH_alloc_pdu)->rballoc);
-          add_common_dci(DCI_pdu,
-                         BCCH_alloc_pdu,
-                         SI_RNTI,
-                         sizeof(DCI1A_20MHz_TDD_1_6_t),
-                         2,
-                         sizeof_DCI1A_20MHz_TDD_1_6_t,
-                         format1A,0);
-          break;
-        }
-      } else {
-        switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) {
-        case 6:
-          ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
-          ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->type = 1;
-          ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->vrb_type = 0;
-          ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->ndi = 1;
-          ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->rv = 1;
-          ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->harq_pid = 0;
-          ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->TPC = 1;
-          ((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->padding = 0;
-
-          rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_1_5MHz_FDD_t*)BCCH_alloc_pdu)->rballoc);
-          add_common_dci(DCI_pdu,
-                         BCCH_alloc_pdu,
-                         SI_RNTI,
-                         sizeof(DCI1A_1_5MHz_FDD_t),
-                         2,
-                         sizeof_DCI1A_1_5MHz_FDD_t,
-                         format1A,0);
-          break;
-
-        case 25:
-          ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
-          ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->type = 1;
-          ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->vrb_type = 0;
-          ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->ndi = 1;
-          ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->rv = 1;
-          ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->harq_pid = 0;
-          ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->TPC = 1;
-          ((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->padding = 0;
-
-          rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_5MHz_FDD_t*)BCCH_alloc_pdu)->rballoc);
-          add_common_dci(DCI_pdu,
-                         BCCH_alloc_pdu,
-                         SI_RNTI,
-                         sizeof(DCI1A_5MHz_FDD_t),
-                         2,
-                         sizeof_DCI1A_5MHz_FDD_t,
-                         format1A,0);
-          break;
-
-        case 50:
-          ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
-          ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->type = 1;
-          ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->vrb_type = 0;
-          ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->ndi = 1;
-          ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->rv = 1;
-          ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->harq_pid = 0;
-          ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->TPC = 1;
-          ((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->padding = 0;
-
-          rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_10MHz_FDD_t*)BCCH_alloc_pdu)->rballoc);
-          add_common_dci(DCI_pdu,
-                         BCCH_alloc_pdu,
-                         SI_RNTI,
-                         sizeof(DCI1A_10MHz_FDD_t),
-                         2,
-                         sizeof_DCI1A_10MHz_FDD_t,
-                         format1A,0);
-          break;
-
-        case 100:
-          ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
-          ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->type = 1;
-          ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->vrb_type = 0;
-          ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->ndi = 1;
-          ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->rv = 1;
-          ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->harq_pid = 0;
-          ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->TPC = 1;
-          ((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->padding = 0;
-
-          rballoc[CC_id] |= mac_xface->get_rballoc(0,((DCI1A_20MHz_FDD_t*)BCCH_alloc_pdu)->rballoc);
-          add_common_dci(DCI_pdu,
-                         BCCH_alloc_pdu,
-                         SI_RNTI,
-                         sizeof(DCI1A_20MHz_FDD_t),
-                         2,
-                         sizeof_DCI1A_20MHz_FDD_t,
-                         format1A,0);
-          break;
-        }
-      }
-    }
-
-    if (RA_scheduledP == 1) {
-      for (i=0; i<NB_RA_PROC_MAX; i++) {
-
-        RA_template = &eNB->common_channels[CC_id].RA_template[i];
-
-        if (RA_template->generate_rar == 1) {
-
-          //FK: postponed to fill_rar
-          //RA_template->generate_rar = 0;
-
-          LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generating RAR DCI (proc %d), RA_active %d format 1A (%d,%d))\n",
-                module_idP, CC_id, frameP, subframeP,i,
-                RA_template->RA_active,
-                RA_template->RA_dci_fmt1,
-                RA_template->RA_dci_size_bits1);
-
-          // randomize frequency allocation for RA
-          while (1) {
-            first_rb = (unsigned char)(taus()%(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL-4));
-
-            if ((vrb_map[first_rb] != 1) && (vrb_map[first_rb+3] != 1))
-              break;
-          }
-
-          vrb_map[first_rb] = 1;
-          vrb_map[first_rb+1] = 1;
-          vrb_map[first_rb+2] = 1;
-          vrb_map[first_rb+3] = 1;
-
-          if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) {
-            switch(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) {
-            case 6:
-              ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->type=1;
-              ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0;
-              ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1;
-              ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rv=0;
-              ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0;
-              ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0;
-              ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1;
-              ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->padding=0;
-              ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
-              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type,
-                                ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc);
-              break;
-
-            case 25:
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->type=1;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rv=0;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->padding=0;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
-              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type,
-                                ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc);
-              break;
-
-            case 50:
-              ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->type=1;
-              ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0;
-              ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1;
-              ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rv=0;
-              ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0;
-              ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0;
-              ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1;
-              ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->padding=0;
-              ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
-              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type,
-                                ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc);
-              break;
-
-            case 100:
-              ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->type=1;
-              ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0;
-              ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1;
-              ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rv=0;
-              ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0;
-              ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0;
-              ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1;
-              ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->padding=0;
-              ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
-              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type,
-                                ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc);
-              break;
-
-            default:
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->type=1;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rv=0;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->padding=0;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
-              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type,
-                                ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu1[0])->rballoc);
-              break;
-            }
-          } else {
-            switch(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) {
-            case 6:
-              ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->type=1;
-              ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0;
-              ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1;
-              ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rv=0;
-              ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0;
-              ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0;
-              ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1;
-              ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->padding=0;
-              ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
-              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type,
-                                ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc);
-              break;
-
-            case 25:
-              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->type=1;
-              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0;
-              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1;
-              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rv=0;
-              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0;
-              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0;
-              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1;
-              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->padding=0;
-              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_UL,first_rb,4);
-              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type,
-                                ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc);
-              break;
-
-            case 50:
-              ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->type=1;
-              ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0;
-              ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1;
-              ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rv=0;
-              ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0;
-              ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0;
-              ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1;
-              ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->padding=0;
-              ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
-              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type,
-                                ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc);
-              break;
-
-            case 100:
-              ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->type=1;
-              ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type=0;
-              ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->ndi=1;
-              ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rv=0;
-              ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->mcs=0;
-              ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->harq_pid=0;
-              ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->TPC=1;
-              ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->padding=0;
-              ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
-              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->vrb_type,
-                                ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu1[0])->rballoc);
-              break;
-
-            default:
-              break;
-            }
-          }
-
-          add_common_dci(DCI_pdu,
-                         (void*)&RA_template->RA_alloc_pdu1[0],
-                         RA_template->RA_rnti,
-                         RA_template->RA_dci_size_bytes1,
-                         2,
-                         RA_template->RA_dci_size_bits1,
-                         RA_template->RA_dci_fmt1,
-                         1);
-
-
-
-          LOG_D(MAC,"[eNB %d] CC_id %d Frame %d: Adding common dci for RA%d (RAR) RA_active %d\n",
-                module_idP,CC_id,frameP,i, RA_template->RA_active);
-        }
-
-        if (RA_template->generate_Msg4_dci == 1) {
-
-          // randomize frequency allocation for RA
-          while (1) {
-            first_rb = (unsigned char)(taus()%(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL-4));
-
-            if ((vrb_map[first_rb] != 1) && (vrb_map[first_rb+3] != 1))
-              break;
-          }
-
-          vrb_map[first_rb] = 1;
-          vrb_map[first_rb+1] = 1;
-          vrb_map[first_rb+2] = 1;
-          vrb_map[first_rb+3] = 1;
-
-          if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) {
-            switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) {
-            case 6:
-              ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->type=1;
-              ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0;
-              ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rv=0;
-              ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0;
-              ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1;
-              ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->padding=0;
-              ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
-              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
-                                ((DCI1A_1_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
-              break;
-
-            case 25:
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->type=1;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rv=0;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->padding=0;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
-              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
-                                ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
-              break;
-
-            case 50:
-              ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->type=1;
-              ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0;
-              ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rv=0;
-              ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0;
-              ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1;
-              ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->padding=0;
-              ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
-              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
-                                ((DCI1A_10MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
-              break;
-
-            case 100:
-              ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->type=1;
-              ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0;
-              ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rv=0;
-              ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0;
-              ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1;
-              ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
-              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
-                                ((DCI1A_20MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
-              break;
-
-            default:
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->type=1;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rv=0;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->padding=0;
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
-              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
-                                ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
-              break;
-            }
-          } else {
-            switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) {
-
-            case 6:
-              ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->type=1;
-              ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0;
-              ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rv=0;
-              ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0;
-              ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1;
-              ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->padding=0;
-              ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
-              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
-                                ((DCI1A_1_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
-              break;
-
-            case 25:
-              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->type=1;
-              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0;
-              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rv=0;
-              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0;
-              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1;
-              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->padding=0;
-              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
-              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
-                                ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
-              break;
-
-            case 50:
-              ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->type=1;
-              ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0;
-              ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rv=0;
-              ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0;
-              ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1;
-              ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->padding=0;
-              ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
-              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
-                                ((DCI1A_10MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
-              break;
-
-            case 100:
-              ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->type=1;
-              ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0;
-              ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rv=0;
-              ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0;
-              ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1;
-              ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->padding=0;
-              ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
-              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
-                                ((DCI1A_20MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
-              break;
-
-            default:
-              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->type=1;
-              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type=0;
-              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rv=0;
-              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->harq_pid=0;
-              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->TPC=1;
-              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc= mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL,first_rb,4);
-              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
-                                ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
-              break;
-            }
-          }
-
-          add_ue_spec_dci(DCI_pdu,
-                          (void*)&RA_template->RA_alloc_pdu2[0],
-                          RA_template->rnti,
-                          RA_template->RA_dci_size_bytes2,
-                          1,
-                          RA_template->RA_dci_size_bits2,
-                          RA_template->RA_dci_fmt2,
-                          0);
-          LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Adding ue specific dci (rnti %x) for Msg4\n",
-                module_idP,CC_id,frameP,subframeP,RA_template->rnti);
-          RA_template->generate_Msg4_dci=0;
-
-        } else if (RA_template->wait_ack_Msg4==1) {
-          // check HARQ status and retransmit if necessary
-          LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Checking if Msg4 was acknowledged: \n",
-                module_idP,CC_id,frameP,subframeP);
-          // Get candidate harq_pid from PHY
-          mac_xface->get_ue_active_harq_pid(module_idP,CC_id,RA_template->rnti,frameP,subframeP,&harq_pid,&round,0);
-
-          if (round>0) {
-            //RA_template->wait_ack_Msg4++;
-            // we have to schedule a retransmission
-            if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) {
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->ndi=1;
-            } else {
-              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->ndi=1;
-            }
-
-            // randomize frequency allocation for RA
-            while (1) {
-              first_rb = (unsigned char)(taus()%(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL-4));
-
-              if ((vrb_map[first_rb] != 1) && (vrb_map[first_rb+3] != 1))
-                break;
-            }
-
-            vrb_map[first_rb] = 1;
-            vrb_map[first_rb+1] = 1;
-            vrb_map[first_rb+2] = 1;
-            vrb_map[first_rb+3] = 1;
-
-            if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) {
-              ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_UL,first_rb,4);
-              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
-                                ((DCI1A_5MHz_TDD_1_6_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
-            } else {
-              ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc = mac_xface->computeRIV(PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_UL,first_rb,4);
-              rballoc[CC_id] |= mac_xface->get_rballoc(((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->vrb_type,
-                                ((DCI1A_5MHz_FDD_t*)&RA_template->RA_alloc_pdu2[0])->rballoc);
-            }
-
-            add_ue_spec_dci(DCI_pdu,
-                            (void*)&RA_template->RA_alloc_pdu2[0],
-                            RA_template->rnti,
-                            RA_template->RA_dci_size_bytes2,
-                            2,
-                            RA_template->RA_dci_size_bits2,
-                            RA_template->RA_dci_fmt2,
-                            0);
-            LOG_W(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Msg4 not acknowledged, adding ue specific dci (rnti %x) for RA (Msg4 Retransmission)\n",
-                  module_idP,CC_id,frameP,subframeP,RA_template->rnti);
-          } else {
-            /*      msg4 not received
-            if ((round == 0) && (RA_template->wait_ack_Msg4>1){
-            remove UE instance across all the layers: mac_xface->cancel_RA();
-              }
-            */
-            LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d : Msg4 acknowledged\n",module_idP,CC_id,frameP,subframeP);
-            RA_template->wait_ack_Msg4=0;
-            RA_template->RA_active=FALSE;
-            UE_id = find_UE_id(module_idP,RA_template->rnti);
-            DevAssert( UE_id != -1 );
-            eNB_mac_inst[module_idP].UE_list.UE_template[UE_PCCID(module_idP,UE_id)][UE_id].configured=TRUE;
-
-          }
-        }
-      }
-    } // RA is scheduled in this subframeP
-
+    DCI_pdu         = &eNB->common_channels[CC_id].DCI_pdu;
+    
 
     // UE specific DCIs
     for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) {
@@ -2250,11 +1638,6 @@ fill_DLSCH_dci(
         /// Synchronizing rballoc with rballoc_sub
         for(i=0; i<PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RBG; i++) {
           rballoc_sub[i] = UE_list->UE_template[CC_id][UE_id].rballoc_subband[harq_pid][i];
-
-          if(rballoc_sub[i] == 1) {
-            rballoc[CC_id] |= (0x0001<<i);  // TO be FIXED!!!!!!
-          }
-
         }
 
         switch(mac_xface->get_transmission_mode(module_idP,CC_id,rnti)) {
@@ -2263,7 +1646,7 @@ fill_DLSCH_dci(
         case 1:
 
         case 2:
-          LOG_D(MAC,"[eNB %d] CC_id %d Adding UE %d spec DCI for %d PRBS (rb alloc: %x) \n",module_idP, CC_id, UE_id, nb_rb,rballoc);
+          LOG_D(MAC,"[eNB %d] CC_id %d Adding UE %d spec DCI for %d PRBS \n",module_idP, CC_id, UE_id, nb_rb);
 
           if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) {
             switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) {
@@ -2366,7 +1749,7 @@ if (CC_id == 0 && UE_list->scell_config[UE_id].scell_count) size_bits++;
 
         case 3:
           LOG_D(MAC,"[eNB %d] CC_id %d Adding Format 2A UE %d spec DCI for %d PRBS (rb alloc: %x) \n",
-                module_idP, CC_id, UE_id, nb_rb,rballoc);
+                module_idP, CC_id, UE_id, nb_rb);
 
           if (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.frame_type == TDD) {
             switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) {
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_mch.c b/openair2/LAYER2/MAC/eNB_scheduler_mch.c
index d010eb5ecb30d2c713d157e1c1201e892babeb6c..da5a553b62a0e94c908aef2f8ca1d142fff98b1d 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_mch.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_mch.c
@@ -670,7 +670,7 @@ MCH_PDU *get_mch_sdu(module_id_t module_idP, int CC_id, frame_t frameP, sub_fram
 {
   //  eNB_mac_inst[module_idP].MCH_pdu.mcs=0;
   //LOG_D(MAC," MCH_pdu.mcs is %d\n", eNB_mac_inst[module_idP].MCH_pdu.mcs);
-#warning "MCH pdu should take the CC_id index"
+//#warning "MCH pdu should take the CC_id index"
   return(&eNB_mac_inst[module_idP].common_channels[CC_id].MCH_pdu);
 }
 
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c
index 53560c36f5e84d93530daf353229a54cad07c5ba..757959e364e13b656b355afdbd090e7c09e2e6f5 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c
@@ -193,7 +193,7 @@ uint8_t find_active_UEs(module_id_t module_idP,int CC_id){
 // get aggregatiob form phy for a give UE
 unsigned char process_ue_cqi (module_id_t module_idP, int ue_idP)
 {
-  unsigned char aggregation=2;
+  unsigned char aggregation=1;
   // check the MCS and SNR and set the aggregation accordingly
   return aggregation;
 }
@@ -271,6 +271,7 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP)
     UE_list->ordered_ULCCids[0][UE_id]             = cc_idP;
     UE_list->num_UEs++;
     UE_list->active[UE_id]                         = TRUE;
+    memset((void*)&UE_list->UE_sched_ctrl[UE_id],0,sizeof(UE_sched_ctrl));
 
     for (j=0; j<8; j++) {
       UE_list->UE_template[cc_idP][UE_id].oldNDI[j]    = (j==0)?1:0;   // 1 because first transmission is with format1A (Msg4) for harq_pid 0
@@ -290,46 +291,45 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP)
 }
 
 //------------------------------------------------------------------------------
-int mac_remove_ue(module_id_t mod_idP, int ue_idP, int frameP, sub_frame_t subframeP)
+int rrc_mac_remove_ue(module_id_t mod_idP,rnti_t rntiP) 
 //------------------------------------------------------------------------------
 {
 
   int prev,i, ret=-1;
 
-  rnti_t  rnti;
+
   UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list;
-  int pCC_id = UE_PCCID(mod_idP,ue_idP);
+  int UE_id = find_UE_id(mod_idP,rntiP);
+  int pCC_id = UE_PCCID(mod_idP,UE_id);
+
+  if (UE_id == -1) {
+    LOG_W(MAC,"rrc_mac_remove_ue: UE %x not found\n", rntiP);
+    mac_phy_remove_ue(mod_idP,rntiP);
+    return 0;
+  }
 
-  rnti = UE_list->UE_template[pCC_id][ue_idP].rnti;
-  LOG_I(MAC,"Removing UE %d from Primary CC_id %d (rnti %x)\n",ue_idP,pCC_id, rnti);
+  LOG_I(MAC,"Removing UE %d from Primary CC_id %d (rnti %x)\n",UE_id,pCC_id, rntiP);
   dump_ue_list(UE_list,0);
 
   // clear all remaining pending transmissions
-  UE_list->UE_template[pCC_id][ue_idP].bsr_info[LCGID0]  = 0;
-  UE_list->UE_template[pCC_id][ue_idP].bsr_info[LCGID1]  = 0;
-  UE_list->UE_template[pCC_id][ue_idP].bsr_info[LCGID2]  = 0;
-  UE_list->UE_template[pCC_id][ue_idP].bsr_info[LCGID3]  = 0;
-
-  UE_list->UE_template[pCC_id][ue_idP].ul_SR             = 0;
-  UE_list->UE_template[pCC_id][ue_idP].rnti              = NOT_A_RNTI;
-  UE_list->UE_template[pCC_id][ue_idP].ul_active         = FALSE;
-  eNB_ulsch_info[mod_idP][pCC_id][ue_idP].rnti                        = NOT_A_RNTI;
-  eNB_ulsch_info[mod_idP][pCC_id][ue_idP].status                      = S_UL_NONE;
-  eNB_dlsch_info[mod_idP][pCC_id][ue_idP].rnti                        = NOT_A_RNTI;
-  eNB_dlsch_info[mod_idP][pCC_id][ue_idP].status                      = S_DL_NONE;
-
-  rrc_eNB_free_UE(
-    mod_idP,
-    rnti,
-    frameP,
-    subframeP);
+  UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID0]  = 0;
+  UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID1]  = 0;
+  UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID2]  = 0;
+  UE_list->UE_template[pCC_id][UE_id].bsr_info[LCGID3]  = 0;
+
+  UE_list->UE_template[pCC_id][UE_id].ul_SR             = 0;
+  UE_list->UE_template[pCC_id][UE_id].rnti              = NOT_A_RNTI;
+  UE_list->UE_template[pCC_id][UE_id].ul_active         = FALSE;
+  eNB_ulsch_info[mod_idP][pCC_id][UE_id].rnti                        = NOT_A_RNTI;
+  eNB_ulsch_info[mod_idP][pCC_id][UE_id].status                      = S_UL_NONE;
+  eNB_dlsch_info[mod_idP][pCC_id][UE_id].rnti                        = NOT_A_RNTI;
+  eNB_dlsch_info[mod_idP][pCC_id][UE_id].status                      = S_DL_NONE;
 
   prev = UE_list->head;
 
   for (i=UE_list->head; i>=0; i=UE_list->next[i]) {
-    if (i == ue_idP) {
+    if (i == UE_id) {
       // link prev to next in Active list
-      //if (prev==UE_list->head)
       if (i==UE_list->head) {
         UE_list->head = UE_list->next[i];
       } else {
@@ -352,9 +352,9 @@ int mac_remove_ue(module_id_t mod_idP, int ue_idP, int frameP, sub_frame_t subfr
   prev = UE_list->head_ul;
 
   for (i=UE_list->head_ul; i>=0; i=UE_list->next_ul[i]) {
-    if (i == ue_idP) {
+    if (i == UE_id) {
       // link prev to next in Active list
-      if (prev==UE_list->head_ul) {
+      if (i==UE_list->head_ul) {
         UE_list->head_ul = UE_list->next_ul[i];
       } else {
         UE_list->next_ul[prev] = UE_list->next_ul[i];
@@ -369,11 +369,13 @@ int mac_remove_ue(module_id_t mod_idP, int ue_idP, int frameP, sub_frame_t subfr
     prev=i;
   }
 
+  mac_phy_remove_ue(mod_idP,rntiP);
+
   if (ret == 0) {
     return (0);
   }
 
-  LOG_E(MAC,"error in mac_remove_ue(), could not find previous to %d in UE_list, should never happen, Dumping UE list\n",ue_idP);
+  LOG_E(MAC,"error in mac_remove_ue(), could not find previous to %d in UE_list, should never happen, Dumping UE list\n",UE_id);
   dump_ue_list(UE_list,0);
   mac_xface->macphy_exit("mac_remove_ue: Problem in UE_list");
   return(-1);
@@ -533,31 +535,6 @@ void swap_UEs(UE_list_t *listP,int nodeiP, int nodejP, int ul_flag)
   dump_ue_list(listP,ul_flag);
 }
 
-void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP, sub_frame_t subframeP)
-{
-
-  int UE_id = find_UE_id(mod_idP, rntiP);
-  UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list;
-
-  if (UE_id  != -1) {
-    /* no SR indication if the CC is not the primary CC
-     * (the UE currently can only transmit on the primary CC)
-     */
-    if (cc_idP != UE_PCCID(mod_idP, UE_id))
-      return;
-    LOG_D(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP);
-    UE_list->UE_template[cc_idP][UE_id].ul_SR = 1;
-    UE_list->UE_template[cc_idP][UE_id].ul_active = TRUE;
-  } else {
-    //     AssertFatal(0, "find_UE_id(%u,rnti %d) not found", enb_mod_idP, rntiP);
-    //    AssertError(0, 0, "Frame %d: find_UE_id(%u,rnti %d) not found\n", frameP, enb_mod_idP, rntiP);
-    LOG_D(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d (unknown UEid) on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP);
-  }
-}
-
-
-
-
 /*
   #ifdef Rel10
   unsigned char generate_mch_header( unsigned char *mac_header,
@@ -739,18 +716,31 @@ static char *ff[] = { "format0", "format1",
 uint8_t UE_is_to_be_scheduled(module_id_t module_idP,int CC_id,uint8_t UE_id)
 {
 
-  UE_TEMPLATE *UE_template = &eNB_mac_inst[module_idP].UE_list.UE_template[CC_id][UE_id];
+  UE_TEMPLATE *UE_template    = &eNB_mac_inst[module_idP].UE_list.UE_template[CC_id][UE_id];
+  UE_sched_ctrl *UE_sched_ctl = &eNB_mac_inst[module_idP].UE_list.UE_sched_ctrl[UE_id];
 
-  //  LOG_D(MAC,"[eNB %d][PUSCH] Frame %d subframeP %d Scheduling UE %d\n",module_idP,rnti,frameP,subframeP,
-  //  UE_id);
+
+  // do not schedule UE if UL is not working
+  if (UE_sched_ctl->ul_failure_timer>0)
+    return(0);
+  if (UE_sched_ctl->ul_out_of_sync>0)
+    return(0);
+
+  LOG_D(MAC,"[eNB %d][PUSCH] Checking UL requirements UE %d/%x\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id));
 
   if ((UE_template->bsr_info[LCGID0]>0) ||
       (UE_template->bsr_info[LCGID1]>0) ||
       (UE_template->bsr_info[LCGID2]>0) ||
       (UE_template->bsr_info[LCGID3]>0) ||
-      (UE_template->ul_SR>0)) { // uplink scheduling request
-//extern int FRAME_RX, SUBFRAME_RX, FRAME_TX, SUBFRAME_TX;
-//printf("UE_is_to_be_scheduled CCid %d UE_id %d (RX fr/subfr %d %d) (TX fr/subfr %d %d)\n", CC_id, UE_id, FRAME_RX, SUBFRAME_RX, FRAME_TX, SUBFRAME_TX);
+      (UE_template->ul_SR>0) || // uplink scheduling request
+      ((UE_sched_ctl->ul_inactivity_timer>20)&&
+       (UE_sched_ctl->ul_scheduled==0))||  // every 2 frames when RRC_CONNECTED
+      ((UE_sched_ctl->ul_inactivity_timer>10)&&
+       (UE_sched_ctl->ul_scheduled==0)&&
+       (mac_eNB_get_rrc_status(module_idP,UE_RNTI(module_idP,UE_id)) < RRC_CONNECTED))) // every Frame when not RRC_CONNECTED
+    { 
+
+    LOG_D(MAC,"[eNB %d][PUSCH] UE %d/%x should be scheduled\n",module_idP,UE_id,UE_RNTI(module_idP,UE_id));
     return(1);
   } else {
     return(0);
@@ -914,3 +904,265 @@ int get_nb_subband(void)
   return nb_sb;
 
 }
+
+void init_CCE_table(int module_idP,int CC_idP)
+{
+  memset(eNB_mac_inst[module_idP].CCE_table[CC_idP],0,800*sizeof(int));
+} 
+
+
+int get_nCCE_offset(int *CCE_table,
+		    const unsigned char L, 
+		    const int nCCE, 
+		    const int common_dci, 
+		    const unsigned short rnti, 
+		    const unsigned char subframe)
+{
+
+  int search_space_free,m,nb_candidates = 0,l,i;
+  unsigned int Yk;
+   /*
+    printf("CCE Allocation: ");
+    for (i=0;i<nCCE;i++)
+    printf("%d.",CCE_table[i]);
+    printf("\n");
+  */
+  if (common_dci == 1) {
+    // check CCE(0 ... L-1)
+    nb_candidates = (L==4) ? 4 : 2;
+    nb_candidates = min(nb_candidates,nCCE/L);
+
+    //    printf("Common DCI nb_candidates %d, L %d\n",nb_candidates,L);
+
+    for (m = nb_candidates-1 ; m >=0 ; m--) {
+
+      search_space_free = 1;
+      for (l=0; l<L; l++) {
+
+	//	printf("CCE_table[%d] %d\n",(m*L)+l,CCE_table[(m*L)+l]);
+        if (CCE_table[(m*L) + l] == 1) {
+          search_space_free = 0;
+          break;
+        }
+      }
+     
+      if (search_space_free == 1) {
+
+	//	printf("returning %d\n",m*L);
+
+        for (l=0; l<L; l++)
+          CCE_table[(m*L)+l]=1;
+        return(m*L);
+      }
+    }
+
+    return(-1);
+
+  } else { // Find first available in ue specific search space
+    // according to procedure in Section 9.1.1 of 36.213 (v. 8.6)
+    // compute Yk
+    Yk = (unsigned int)rnti;
+
+    for (i=0; i<=subframe; i++)
+      Yk = (Yk*39827)%65537;
+
+    Yk = Yk % (nCCE/L);
+
+
+    switch (L) {
+    case 1:
+    case 2:
+      nb_candidates = 6;
+      break;
+
+    case 4:
+    case 8:
+      nb_candidates = 2;
+      break;
+
+    default:
+      DevParam(L, nCCE, rnti);
+      break;
+    }
+
+
+    LOG_D(MAC,"rnti %x, Yk = %d, nCCE %d (nCCE/L %d),nb_cand %d\n",rnti,Yk,nCCE,nCCE/L,nb_candidates);
+
+    for (m = 0 ; m < nb_candidates ; m++) {
+      search_space_free = 1;
+
+      for (l=0; l<L; l++) {
+        if (CCE_table[(((Yk+m)%(nCCE/L))*L) + l] == 1) {
+          search_space_free = 0;
+          break;
+        }
+      }
+
+      if (search_space_free == 1) {
+        for (l=0; l<L; l++)
+          CCE_table[(((Yk+m)%(nCCE/L))*L)+l]=1;
+
+        return(((Yk+m)%(nCCE/L))*L);
+      }
+    }
+
+    return(-1);
+  }
+}
+
+// Allocate the CCEs
+int allocate_CCEs(int module_idP,
+		  int CC_idP,
+		  int subframeP,
+		  int test_onlyP) {
+
+
+  int *CCE_table = eNB_mac_inst[module_idP].CCE_table[CC_idP];
+  DCI_PDU *DCI_pdu = &eNB_mac_inst[module_idP].common_channels[CC_idP].DCI_pdu;
+  int nCCE_max = mac_xface->get_nCCE_max(module_idP,CC_idP,1,subframeP);
+  int fCCE;
+  int i,j;
+  DCI_ALLOC_t *dci_alloc;
+  int nCCE=0;
+
+  LOG_D(MAC,"Allocate CCEs subframe %d, test %d : (common %d,uspec %d)\n",subframeP,test_onlyP,DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci);
+  DCI_pdu->num_pdcch_symbols=1;
+
+try_again:
+  init_CCE_table(module_idP,CC_idP);
+  nCCE=0;
+
+  for (i=0;i<DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci;i++) {
+    dci_alloc = &DCI_pdu->dci_alloc[i];
+    LOG_D(MAC,"Trying to allocate DCI %d/%d (%d,%d) : rnti %x, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n",
+          i,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci,
+          DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci,
+          dci_alloc->rnti,1<<dci_alloc->L,
+          nCCE,nCCE_max,DCI_pdu->num_pdcch_symbols);
+
+    if (nCCE + (1<<dci_alloc->L) > nCCE_max) {
+      if (DCI_pdu->num_pdcch_symbols == 3)
+        goto failed;
+      DCI_pdu->num_pdcch_symbols++;
+      nCCE_max = mac_xface->get_nCCE_max(module_idP,CC_idP,DCI_pdu->num_pdcch_symbols,subframeP);
+      goto try_again;
+    }
+
+    // number of CCEs left can potentially hold this allocation
+    fCCE = get_nCCE_offset(CCE_table,
+                           1<<(dci_alloc->L),
+                           nCCE_max,
+                           (i<DCI_pdu->Num_common_dci) ? 1 : 0,
+                           dci_alloc->rnti,
+                           subframeP);
+    if (fCCE == -1) {
+      if (DCI_pdu->num_pdcch_symbols == 3) {
+        LOG_I(MAC,"subframe %d: Dropping Allocation for RNTI %x\n",
+              subframeP,dci_alloc->rnti);
+        for (j=0;j<=i;j++){
+          LOG_I(MAC,"DCI %d/%d (%d,%d) : rnti %x dci format %d, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n",
+                i,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci,
+                DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci,
+                DCI_pdu->dci_alloc[j].rnti,DCI_pdu->dci_alloc[j].format,
+                1<<DCI_pdu->dci_alloc[j].L,
+                nCCE,nCCE_max,DCI_pdu->num_pdcch_symbols);
+        }
+        goto failed;
+      }
+      DCI_pdu->num_pdcch_symbols++;
+      nCCE_max = mac_xface->get_nCCE_max(module_idP,CC_idP,DCI_pdu->num_pdcch_symbols,subframeP);
+      goto try_again;
+    } // fCCE==-1
+
+    // the allocation is feasible, rnti rule passes
+    nCCE += (1<<dci_alloc->L);
+    LOG_D(MAC,"Allocating at nCCE %d\n",fCCE);
+    if (test_onlyP == 0) {
+      dci_alloc->firstCCE=fCCE;
+      LOG_D(MAC,"Allocate CCEs subframe %d, test %d\n",subframeP,test_onlyP);
+    }
+  } // for i = 0 ... num_dcis
+
+  return 0;
+
+failed:
+  return -1;
+}
+
+boolean_t CCE_allocation_infeasible(int module_idP,
+				    int CC_idP,
+				    int common_flag,
+				    int subframe,
+				    int aggregation,
+				    int rnti) {
+
+
+  DCI_PDU *DCI_pdu = &eNB_mac_inst[module_idP].common_channels[CC_idP].DCI_pdu;
+  //DCI_ALLOC_t *dci_alloc;
+  int ret;
+  boolean_t res=FALSE;
+
+  if (common_flag==1) {
+    DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci].rnti = rnti;
+    DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci].L = aggregation;
+    DCI_pdu->Num_common_dci++;
+    ret = allocate_CCEs(module_idP,CC_idP,subframe,1);
+    if (ret==-1)
+      res = TRUE;
+    DCI_pdu->Num_common_dci--;
+  }
+  else {
+    DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci].rnti = rnti;
+    DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci].L = aggregation;
+    DCI_pdu->Num_ue_spec_dci++;
+    ret = allocate_CCEs(module_idP,CC_idP,subframe,1);
+    if (ret==-1)
+      res = TRUE;
+    DCI_pdu->Num_ue_spec_dci--;
+  }
+  return(res);
+}
+
+void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP, sub_frame_t subframeP)
+{
+ 
+  int UE_id = find_UE_id(mod_idP, rntiP);
+  UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list;
+ 
+  if (UE_id  != -1) {
+    /* no SR indication if the CC is not the primary CC
+     * (the UE currently can only transmit on the primary CC)
+     */
+    if (cc_idP != UE_PCCID(mod_idP, UE_id))
+      return;
+    if (mac_eNB_get_rrc_status(mod_idP,UE_RNTI(mod_idP,UE_id)) < RRC_CONNECTED)
+      LOG_I(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP);
+    UE_list->UE_template[cc_idP][UE_id].ul_SR = 1;
+    UE_list->UE_template[cc_idP][UE_id].ul_active = TRUE;
+    VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SR_INDICATION,1);
+    VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SR_INDICATION,0);
+  } else {
+    //     AssertFatal(0, "find_UE_id(%u,rnti %d) not found", enb_mod_idP, rntiP);
+    //    AssertError(0, 0, "Frame %d: find_UE_id(%u,rnti %d) not found\n", frameP, enb_mod_idP, rntiP);
+    LOG_D(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling SR for UE %d (unknown UEid) on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP);
+  }
+}
+
+void UL_failure_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP, sub_frame_t subframeP)
+{
+
+  int UE_id = find_UE_id(mod_idP, rntiP);
+  UE_list_t *UE_list = &eNB_mac_inst[mod_idP].UE_list;
+
+  if (UE_id  != -1) {
+    LOG_I(MAC,"[eNB %d][UE %d/%x] Frame %d subframeP %d Signaling UL Failure for UE %d on CC_id %d (timer %d)\n",
+	  mod_idP,UE_id,rntiP,frameP,subframeP, UE_id,cc_idP,
+	  UE_list->UE_sched_ctrl[UE_id].ul_failure_timer);
+    if (UE_list->UE_sched_ctrl[UE_id].ul_failure_timer == 0)
+      UE_list->UE_sched_ctrl[UE_id].ul_failure_timer=1;
+  } else {
+    //     AssertFatal(0, "find_UE_id(%u,rnti %d) not found", enb_mod_idP, rntiP);
+    //    AssertError(0, 0, "Frame %d: find_UE_id(%u,rnti %d) not found\n", frameP, enb_mod_idP, rntiP);
+    LOG_W(MAC,"[eNB %d][SR %x] Frame %d subframeP %d Signaling UL Failure for UE %d (unknown UEid) on CC_id %d\n",mod_idP,rntiP,frameP,subframeP, UE_id,cc_idP);
+  }
+}
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
index 16d7671d8105dc015a8e6c9118d3553889467b8f..3a64c21087d35d19f0f261e2e60e4b8c92f1c39b 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
@@ -63,6 +63,8 @@
 # include "intertask_interface.h"
 #endif
 
+#include "T.h"
+
 #define ENABLE_MAC_PAYLOAD_DEBUG
 #define DEBUG_eNB_SCHEDULER 1
 
@@ -88,6 +90,8 @@ void rx_sdu(
   int ii,j;
   eNB_MAC_INST *eNB = &eNB_mac_inst[enb_mod_idP];
   UE_list_t *UE_list= &eNB->UE_list;
+  int crnti_rx=0;
+  int old_buffer_info;
 
   start_meas(&eNB->rx_ulsch_sdu);
 
@@ -104,15 +108,40 @@ void rx_sdu(
   }
 
   LOG_D(MAC,"[eNB %d] CC_id %d Received ULSCH sdu from PHY (rnti %x, UE_id %d), parsing header\n",enb_mod_idP,CC_idP,rntiP,UE_id);
-  
+
+  if (sduP==NULL) { // we've got an error after N rounds
+    UE_list->UE_sched_ctrl[UE_id].ul_scheduled       &= (~(1<<harq_pidP));
+    return;
+  }
+
+  if (UE_id!=-1) {
+    UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer=0;
+    UE_list->UE_sched_ctrl[UE_id].ul_failure_timer   =0;
+    UE_list->UE_sched_ctrl[UE_id].ul_scheduled       &= (~(1<<harq_pidP));
+
+    if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync > 0) {
+      UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync=0;
+      mac_eNB_rrc_ul_in_sync(enb_mod_idP,CC_idP,frameP,subframeP,UE_RNTI(enb_mod_idP,UE_id));
+    }
+  }
+
+
   payload_ptr = parse_ulsch_header(sduP,&num_ce,&num_sdu,rx_ces,rx_lcids,rx_lengths,sdu_lenP);
- 
+
+  T(T_ENB_MAC_UE_UL_PDU, T_INT(enb_mod_idP), T_INT(CC_idP), T_INT(rntiP), T_INT(frameP), T_INT(subframeP),
+    T_INT(harq_pidP), T_INT(sdu_lenP), T_INT(num_ce), T_INT(num_sdu));
+  T(T_ENB_MAC_UE_UL_PDU_WITH_DATA, T_INT(enb_mod_idP), T_INT(CC_idP), T_INT(rntiP), T_INT(frameP), T_INT(subframeP),
+    T_INT(harq_pidP), T_INT(sdu_lenP), T_INT(num_ce), T_INT(num_sdu), T_BUFFER(sduP, sdu_lenP));
+
   eNB->eNB_stats[CC_idP].ulsch_bytes_rx=sdu_lenP;
   eNB->eNB_stats[CC_idP].total_ulsch_bytes_rx+=sdu_lenP;
   eNB->eNB_stats[CC_idP].total_ulsch_pdus_rx+=1;
   // control element
   for (i=0; i<num_ce; i++) {
 
+    T(T_ENB_MAC_UE_UL_CE, T_INT(enb_mod_idP), T_INT(CC_idP), T_INT(rntiP), T_INT(frameP), T_INT(subframeP),
+      T_INT(rx_ces[i]));
+
     switch (rx_ces[i]) { // implement and process BSR + CRNTI +
     case POWER_HEADROOM:
       if (UE_id != -1) {
@@ -121,18 +150,26 @@ void rx_sdu(
               enb_mod_idP, CC_idP, rx_ces[i], UE_list->UE_template[CC_idP][UE_id].phr_info);
         UE_list->UE_template[CC_idP][UE_id].phr_info_configured=1;
       }
+      UE_list->UE_sched_ctrl[UE_id].phr_received = 1;
 
       payload_ptr+=sizeof(POWER_HEADROOM_CMD);
       break;
 
     case CRNTI:
-      LOG_D(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d (ce %d/%d): Received CRNTI %2.2x%2.2x\n",
-            enb_mod_idP, CC_idP, rx_ces[i], i,num_ce, payload_ptr[0], payload_ptr[1]);
       UE_id = find_UE_id(enb_mod_idP,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1]);
-      LOG_I(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d : CRNTI %x (UE_id %d) in Msg3\n",enb_mod_idP, CC_idP, rx_ces[i], (((uint16_t)payload_ptr[0])<<8) + payload_ptr[1],UE_id);
-
+      LOG_I(MAC, "[eNB %d] Frame %d, Subframe %d CC_id %d MAC CE_LCID %d (ce %d/%d): CRNTI %x (UE_id %d) in Msg3\n",
+	    frameP,subframeP,enb_mod_idP, CC_idP, rx_ces[i], i,num_ce,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1],UE_id);
+      if (UE_id!=-1) {
+	UE_list->UE_sched_ctrl[UE_id].ul_inactivity_timer=0;
+	UE_list->UE_sched_ctrl[UE_id].ul_failure_timer=0;
+	if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync > 0) {
+	  UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync=0;
+	  mac_eNB_rrc_ul_in_sync(enb_mod_idP,CC_idP,frameP,subframeP,(((uint16_t)payload_ptr[0])<<8) + payload_ptr[1]);
+	}
+      }
+      crnti_rx=1;
       payload_ptr+=2;
-      /* we don't process this CE yet */
+
       if (msg3_flagP != NULL) {
 	*msg3_flagP = 0;
       }
@@ -146,13 +183,29 @@ void rx_sdu(
       LOG_D(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d : Received short BSR LCGID = %u bsr = %d\n",
 	    enb_mod_idP, CC_idP, rx_ces[i], lcgid, payload_ptr[0] & 0x3f);
 
+      if (crnti_rx==1)
+	LOG_I(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d : Received short BSR LCGID = %u bsr = %d\n",
+	      enb_mod_idP, CC_idP, rx_ces[i], lcgid, payload_ptr[0] & 0x3f);
       if (UE_id  != -1) {
 
         UE_list->UE_template[CC_idP][UE_id].bsr_info[lcgid] = (payload_ptr[0] & 0x3f);
 
+	// update buffer info
+	
+	UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid]=BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].bsr_info[lcgid]];
+
+	UE_list->UE_template[CC_idP][UE_id].ul_total_buffer= UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid];
+
+	PHY_vars_eNB_g[enb_mod_idP][CC_idP]->pusch_stats_bsr[UE_id][(frameP*10)+subframeP] = (payload_ptr[0] & 0x3f);
+	if (UE_id == UE_list->head)
+	  VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR,PHY_vars_eNB_g[enb_mod_idP][CC_idP]->pusch_stats_bsr[UE_id][(frameP*10)+subframeP]);	
         if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[lcgid] == 0 ) {
           UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[lcgid]=frameP;
         }
+	if (mac_eNB_get_rrc_status(enb_mod_idP,UE_RNTI(enb_mod_idP,UE_id)) < RRC_CONNECTED)
+	  LOG_I(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d : ul_total_buffer = %d (lcg increment %d)\n",
+		enb_mod_idP, CC_idP, rx_ces[i], UE_list->UE_template[CC_idP][UE_id].ul_total_buffer,
+		UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[lcgid]);	
       }
       else {
 
@@ -169,6 +222,41 @@ void rx_sdu(
         UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID2] =
           ((payload_ptr[1] & 0x0F) << 2) | ((payload_ptr[2] & 0xC0) >> 6);
         UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID3] = (payload_ptr[2] & 0x3F);
+
+	// update buffer info
+	old_buffer_info = UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID0];
+	UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID0]=BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID0]];
+
+	UE_list->UE_template[CC_idP][UE_id].ul_total_buffer+= UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID0];
+	if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >= old_buffer_info)
+	  UE_list->UE_template[CC_idP][UE_id].ul_total_buffer -= old_buffer_info;
+	else
+	  UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = 0;
+
+	old_buffer_info = UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID1];
+	UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID1]=BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID1]];
+	UE_list->UE_template[CC_idP][UE_id].ul_total_buffer+= UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID1];
+	if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >= old_buffer_info)
+	  UE_list->UE_template[CC_idP][UE_id].ul_total_buffer -= old_buffer_info;
+	else
+	  UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = 0;
+
+	old_buffer_info = UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID2];
+	UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID2]=BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID2]];
+	UE_list->UE_template[CC_idP][UE_id].ul_total_buffer+= UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID2];
+	if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >= old_buffer_info)
+	  UE_list->UE_template[CC_idP][UE_id].ul_total_buffer -= old_buffer_info;
+	else
+	  UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = 0;
+
+	old_buffer_info = UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID3];
+	UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID3]=BSR_TABLE[UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID3]];
+	UE_list->UE_template[CC_idP][UE_id].ul_total_buffer+= UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[LCGID3];
+	if (UE_list->UE_template[CC_idP][UE_id].ul_total_buffer >= old_buffer_info)
+	  UE_list->UE_template[CC_idP][UE_id].ul_total_buffer -= old_buffer_info;
+	else
+	  UE_list->UE_template[CC_idP][UE_id].ul_total_buffer = 0;
+
         LOG_D(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d: Received long BSR LCGID0 = %u LCGID1 = "
               "%u LCGID2 = %u LCGID3 = %u\n",
               enb_mod_idP, CC_idP,
@@ -177,6 +265,15 @@ void rx_sdu(
               UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID1],
               UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID2],
               UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID3]);
+      if (crnti_rx==1)
+        LOG_I(MAC, "[eNB %d] CC_id %d MAC CE_LCID %d: Received long BSR LCGID0 = %u LCGID1 = "
+              "%u LCGID2 = %u LCGID3 = %u\n",
+              enb_mod_idP, CC_idP,
+              rx_ces[i],
+              UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID0],
+              UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID1],
+              UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID2],
+              UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID3]);
 
         if (UE_list->UE_template[CC_idP][UE_id].bsr_info[LCGID0] == 0 ) {
           UE_list->UE_template[CC_idP][UE_id].ul_buffer_creation_time[LCGID0]=0;
@@ -216,14 +313,26 @@ void rx_sdu(
   for (i=0; i<num_sdu; i++) {
     LOG_D(MAC,"SDU Number %d MAC Subheader SDU_LCID %d, length %d\n",i,rx_lcids[i],rx_lengths[i]);
 
+    T(T_ENB_MAC_UE_UL_SDU, T_INT(enb_mod_idP), T_INT(CC_idP), T_INT(rntiP), T_INT(frameP), T_INT(subframeP),
+      T_INT(rx_lcids[i]), T_INT(rx_lengths[i]));
+    T(T_ENB_MAC_UE_UL_SDU_WITH_DATA, T_INT(enb_mod_idP), T_INT(CC_idP), T_INT(rntiP), T_INT(frameP), T_INT(subframeP),
+      T_INT(rx_lcids[i]), T_INT(rx_lengths[i]), T_BUFFER(payload_ptr, rx_lengths[i]));
+
     switch (rx_lcids[i]) {
     case CCCH :
+      if (rx_lengths[i] > CCCH_PAYLOAD_SIZE_MAX) {
+        LOG_E(MAC, "[eNB %d/%d] frame %d received CCCH of size %d (too big, maximum allowed is %d), dropping packet\n",
+              enb_mod_idP, CC_idP, frameP, rx_lengths[i], CCCH_PAYLOAD_SIZE_MAX);
+        break;
+      }
+
       LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, Received CCCH:  %x.%x.%x.%x.%x.%x, Terminating RA procedure for UE rnti %x\n",
             enb_mod_idP,CC_idP,frameP,
             payload_ptr[0],payload_ptr[1],payload_ptr[2],payload_ptr[3],payload_ptr[4], payload_ptr[5], rntiP);
-
+      VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_TERMINATE_RA_PROC,1);
+      VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_TERMINATE_RA_PROC,0);
       for (ii=0; ii<NB_RA_PROC_MAX; ii++) {
-        LOG_D(MAC,"[eNB %d][RAPROC] CC_id %p Checking proc %d : rnti (%x, %x), active %d\n",
+        LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Checking proc %d : rnti (%x, %x), active %d\n",
               enb_mod_idP, CC_idP, ii,
               eNB->common_channels[CC_idP].RA_template[ii].rnti, rntiP,
               eNB->common_channels[CC_idP].RA_template[ii].RA_active);
@@ -236,7 +345,7 @@ void rx_sdu(
           if (UE_id < 0) {
             memcpy(&eNB->common_channels[CC_idP].RA_template[ii].cont_res_id[0],payload_ptr,6);
             LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d CCCH: Received Msg3: length %d, offset %d\n",
-                  enb_mod_idP,CC_idP,frameP,rx_lengths[ii],payload_ptr-sduP);
+                  enb_mod_idP,CC_idP,frameP,rx_lengths[i],payload_ptr-sduP);
 
             if ((UE_id=add_new_ue(enb_mod_idP,CC_idP,eNB->common_channels[CC_idP].RA_template[ii].rnti,harq_pidP)) == -1 ) {
               mac_xface->macphy_exit("[MAC][eNB] Max user count reached\n");
@@ -246,7 +355,7 @@ void rx_sdu(
                     enb_mod_idP,CC_idP,frameP,eNB->common_channels[CC_idP].RA_template[ii].rnti,UE_id);
           } else {
             LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d CCCH: Received Msg3 from already registered UE %d: length %d, offset %d\n",
-                  enb_mod_idP,CC_idP,frameP,UE_id,rx_lengths[ii],payload_ptr-sduP);
+                  enb_mod_idP,CC_idP,frameP,UE_id,rx_lengths[i],payload_ptr-sduP);
 	    // kill RA procedure
           }
 
@@ -258,7 +367,7 @@ void rx_sdu(
               rntiP,
               CCCH,
               (uint8_t*)payload_ptr,
-              rx_lengths[ii],
+              rx_lengths[i],
               ENB_FLAG_YES,
               enb_mod_idP,
               0);
@@ -279,10 +388,11 @@ void rx_sdu(
     case  DCCH :
     case DCCH1 :
       //      if(eNB_mac_inst[module_idP][CC_idP].Dcch_lchan[UE_id].Active==1){
+      
 
 #if defined(ENABLE_MAC_PAYLOAD_DEBUG)
       LOG_T(MAC,"offset: %d\n",(unsigned char)((unsigned char*)payload_ptr-sduP));
-
+      
       for (j=0; j<32; j++) {
         LOG_T(MAC,"%x ",payload_ptr[j]);
       }
@@ -291,26 +401,29 @@ void rx_sdu(
 #endif
 
       if (UE_id != -1) {
-        //  This check is just to make sure we didn't get a bogus SDU length, to be removed ...
-        if (rx_lengths[i]<CCCH_PAYLOAD_SIZE_MAX) {
+	// adjust buffer occupancy of the correponding logical channel group
+	if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] >= rx_lengths[i])
+	  UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] -= rx_lengths[i];
+	else
+	  UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] = 0;
+
           LOG_D(MAC,"[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DCCH, received %d bytes form UE %d on LCID %d \n",
                 enb_mod_idP,CC_idP,frameP, rx_lengths[i], UE_id, rx_lcids[i]);
 
           mac_rlc_data_ind(
-            enb_mod_idP,
-            rntiP,
-	      enb_mod_idP,
-            frameP,
-            ENB_FLAG_YES,
-            MBMS_FLAG_NO,
-            rx_lcids[i],
-            (char *)payload_ptr,
-            rx_lengths[i],
-            1,
-            NULL);//(unsigned int*)crc_status);
+			   enb_mod_idP,
+			   rntiP,
+			   enb_mod_idP,
+			   frameP,
+			   ENB_FLAG_YES,
+			   MBMS_FLAG_NO,
+			   rx_lcids[i],
+			   (char *)payload_ptr,
+			   rx_lengths[i],
+			   1,
+			   NULL);//(unsigned int*)crc_status);
           UE_list->eNB_UE_stats[CC_idP][UE_id].num_pdu_rx[rx_lcids[i]]+=1;
           UE_list->eNB_UE_stats[CC_idP][UE_id].num_bytes_rx[rx_lcids[i]]+=rx_lengths[i];
-        }
       } /* UE_id != -1 */
 
       //      }
@@ -333,6 +446,17 @@ void rx_sdu(
             enb_mod_idP,CC_idP,frameP, rx_lengths[i], UE_id,rx_lcids[i]);
 
       if (UE_id != -1) {
+	// adjust buffer occupancy of the correponding logical channel group
+	LOG_D(MAC,"[eNB %d] CC_id %d Frame %d : ULSCH -> UL-DTCH, received %d bytes from UE %d for lcid %d, removing from LCGID %d, %d\n",
+	      enb_mod_idP,CC_idP,frameP, rx_lengths[i], UE_id,rx_lcids[i],
+	      UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]],
+	      UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]]);
+
+	if (UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] >= rx_lengths[i])
+	  UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] -= rx_lengths[i];
+	else
+	  UE_list->UE_template[CC_idP][UE_id].ul_buffer_info[UE_list->UE_template[CC_idP][UE_id].lcgidmap[rx_lcids[i]]] = 0;
+
         if ((rx_lengths[i] <SCH_PAYLOAD_SIZE_MAX) &&  (rx_lengths[i] > 0) ) {   // MAX SIZE OF transport block
           mac_rlc_data_ind(
             enb_mod_idP,
@@ -406,52 +530,6 @@ uint32_t bytes_to_bsr_index(int32_t nbytes)
   return(i-1);
 }
 
-void adjust_bsr_info(int buffer_occupancy,
-                     uint16_t TBS,
-                     UE_TEMPLATE *UE_template)
-{
-
-  uint32_t         tmp_bsr;
-
-  // could not serve all the uplink traffic
-  if (buffer_occupancy > 0 ) {
-    if (BSR_TABLE[UE_template->bsr_info[LCGID0]] <=  TBS ) {
-      tmp_bsr = BSR_TABLE[UE_template->bsr_info[LCGID0]]; // serving this amout of  bytes
-      UE_template->bsr_info[LCGID0] = 0;
-
-      if (BSR_TABLE[UE_template->bsr_info[LCGID1]] <= (TBS-tmp_bsr)) {
-        tmp_bsr += BSR_TABLE[UE_template->bsr_info[LCGID1]];
-        UE_template->bsr_info[LCGID1] = 0;
-
-        if (BSR_TABLE[UE_template->bsr_info[LCGID2]] <= (TBS-tmp_bsr)) {
-          tmp_bsr += BSR_TABLE[UE_template->bsr_info[LCGID2]];
-          UE_template->bsr_info[LCGID2] = 0;
-
-          if (BSR_TABLE[UE_template->bsr_info[LCGID3]] <= (TBS-tmp_bsr)) {
-            tmp_bsr += BSR_TABLE[UE_template->bsr_info[LCGID3]];
-            UE_template->bsr_info[LCGID3] = 0;
-          } else {
-            UE_template->bsr_info[LCGID3] = bytes_to_bsr_index((int32_t)BSR_TABLE[UE_template->bsr_info[LCGID3]] - ((int32_t) TBS - (int32_t)tmp_bsr));
-          }
-        } else {
-          UE_template->bsr_info[LCGID2] = bytes_to_bsr_index((int32_t)BSR_TABLE[UE_template->bsr_info[LCGID2]] - ((int32_t)TBS - (int32_t)tmp_bsr));
-        }
-      } else {
-        UE_template->bsr_info[LCGID1] = bytes_to_bsr_index((int32_t)BSR_TABLE[UE_template->bsr_info[LCGID1]] - ((int32_t)TBS - (int32_t)tmp_bsr));
-      }
-    } else {
-      UE_template->bsr_info[LCGID0] = bytes_to_bsr_index((int32_t)BSR_TABLE[UE_template->bsr_info[LCGID0]] - (int32_t)TBS);
-    }
-  } else { // we have flushed all buffers so clear bsr
-    UE_template->bsr_info[LCGID0] = 0;
-    UE_template->bsr_info[LCGID1] = 0;
-    UE_template->bsr_info[LCGID2] = 0;
-    UE_template->bsr_info[LCGID3] = 0;
-  }
-
-
-}
-
 void add_ue_ulsch_info(module_id_t module_idP, int CC_id, int UE_id, sub_frame_t subframeP, UE_ULSCH_STATUS status)
 {
 
@@ -463,66 +541,6 @@ void add_ue_ulsch_info(module_id_t module_idP, int CC_id, int UE_id, sub_frame_t
 
 }
 
-// This seems not to be used anymore
-/*
-int schedule_next_ulue(module_id_t module_idP, int UE_id, sub_frame_t subframeP){
-
-  int next_ue;
-
-  // first phase: scheduling for ACK
-  switch (subframeP) {
-    // scheduling for subframeP 2: for scheduled user during subframeP 5 and 6
-  case 8:
-    if  ((eNB_dlsch_info[module_idP][UE_id].status == S_DL_SCHEDULED) &&
-   (eNB_dlsch_info[module_idP][UE_id].subframe == 5 || eNB_dlsch_info[module_idP][UE_id].subframe == 6)){
-      // set the downlink status
-      eNB_dlsch_info[module_idP][UE_id].status = S_DL_BUFFERED;
-      return UE_id;
-    }
-    break;
-    // scheduling for subframeP 3: for scheduled user during subframeP 7 and 8
-  case 9:
-    if  ((eNB_dlsch_info[module_idP][UE_id].status == S_DL_SCHEDULED) &&
-   (eNB_dlsch_info[module_idP][UE_id].subframe == 7 || eNB_dlsch_info[module_idP][UE_id].subframe == 8)){
-      eNB_dlsch_info[module_idP][UE_id].status = S_DL_BUFFERED;
-      return UE_id;
-    }
-    break;
-    // scheduling UL subframeP 4: for scheduled user during subframeP 9 and 0
-  case 0 :
-    if  ((eNB_dlsch_info[module_idP][UE_id].status == S_DL_SCHEDULED) &&
-   (eNB_dlsch_info[module_idP][UE_id].subframe == 9 || eNB_dlsch_info[module_idP][UE_id].subframe == 0)){
-      eNB_dlsch_info[module_idP][UE_id].status = S_DL_BUFFERED;
-      return UE_id;
-    }
-    break;
-  default:
-    break;
-  }
-
-  // second phase
-  for (next_ue=0; next_ue <NUMBER_OF_UE_MAX; next_ue++ ){
-
-    if  (eNB_ulsch_info[module_idP][next_ue].status == S_UL_WAITING )
-      return next_ue;
-    else if (eNB_ulsch_info[module_idP][next_ue].status == S_UL_SCHEDULED){
-      eNB_ulsch_info[module_idP][next_ue].status = S_UL_BUFFERED;
-    }
-  }
-  for (next_ue=0; next_ue <NUMBER_OF_UE_MAX; next_ue++ ){
-    if (eNB_ulsch_info[module_idP][next_ue].status != S_UL_NONE )// do this just for active UEs
-      eNB_ulsch_info[module_idP][next_ue].status = S_UL_WAITING;
-  }
-  next_ue = 0;
-  return next_ue;
-
-}
- */
-
-
-
-
-
 unsigned char *parse_ulsch_header(unsigned char *mac_header,
                                   unsigned char *num_ce,
                                   unsigned char *num_sdu,
@@ -596,12 +614,14 @@ unsigned char *parse_ulsch_header(unsigned char *mac_header,
 }
 
 
-void schedule_ulsch(module_id_t module_idP, frame_t frameP,unsigned char cooperation_flag,sub_frame_t subframeP, unsigned char sched_subframe,
-                    unsigned int *nCCE)  //,int calibration_flag) {
-{
+void schedule_ulsch(module_id_t module_idP, 
+		    frame_t frameP,
+		    unsigned char cooperation_flag,
+		    sub_frame_t subframeP, 
+		    unsigned char sched_subframe) {
+
 
 
-  unsigned int nCCE_available[MAX_NUM_CCs];
   uint16_t first_rb[MAX_NUM_CCs],i;
   int CC_id;
   eNB_MAC_INST *eNB=&eNB_mac_inst[module_idP];
@@ -612,7 +632,6 @@ void schedule_ulsch(module_id_t module_idP, frame_t frameP,unsigned char coopera
   for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
 
     first_rb[CC_id] = 1;
-    nCCE_available[CC_id] = mac_xface->get_nCCE_max(module_idP,CC_id) - nCCE[CC_id];
 
     // UE data info;
     // check which UE has data to transmit
@@ -644,10 +663,10 @@ void schedule_ulsch(module_id_t module_idP, frame_t frameP,unsigned char coopera
 
   }
 
-  schedule_ulsch_rnti(module_idP, cooperation_flag, frameP, subframeP, sched_subframe, nCCE, nCCE_available, first_rb);
+  schedule_ulsch_rnti(module_idP, cooperation_flag, frameP, subframeP, sched_subframe,first_rb);
 
 #ifdef CBA
-  schedule_ulsch_cba_rnti(module_idP, cooperation_flag, frameP, subframeP, sched_subframe, nCCE, nCCE_available, first_rb);
+  schedule_ulsch_cba_rnti(module_idP, cooperation_flag, frameP, subframeP, sched_subframe, first_rb);
 #endif
 
 
@@ -662,8 +681,6 @@ void schedule_ulsch_rnti(module_id_t   module_idP,
                          frame_t       frameP,
                          sub_frame_t   subframeP,
                          unsigned char sched_subframe,
-                         unsigned int *nCCE,
-                         unsigned int *nCCE_available,
                          uint16_t     *first_rb)
 {
 
@@ -678,8 +695,8 @@ void schedule_ulsch_rnti(module_id_t   module_idP,
   uint8_t                 status         = 0;
   uint8_t                 rb_table_index = -1;
   uint16_t                TBS = 0;
-  int32_t                buffer_occupancy=0;
-  uint32_t                cqi_req,cshift,ndi,mcs,rballoc,tpc;
+  //  int32_t                buffer_occupancy=0;
+  uint32_t                cqi_req,cshift,ndi,mcs=0,rballoc,tpc;
   int32_t                 normalized_rx_power, target_rx_power=-90;
   static int32_t          tpc_accumulated=0;
 
@@ -687,9 +704,11 @@ void schedule_ulsch_rnti(module_id_t   module_idP,
   eNB_MAC_INST      *eNB=&eNB_mac_inst[module_idP];
   UE_list_t         *UE_list=&eNB->UE_list;
   UE_TEMPLATE       *UE_template;
-  int                rvidx_tab[4] = {0,2,3,1};
-  LTE_DL_FRAME_PARMS   *frame_parms;
+  UE_sched_ctrl     *UE_sched_ctrl;
 
+  //  int                rvidx_tab[4] = {0,2,3,1};
+  LTE_DL_FRAME_PARMS   *frame_parms;
+  int drop_ue=0;
 
   //  LOG_I(MAC,"entering ulsch preprocesor\n");
 
@@ -697,8 +716,7 @@ void schedule_ulsch_rnti(module_id_t   module_idP,
                                 frameP,
                                 subframeP,
                                 first_rb,
-                                aggregation,
-                                nCCE);
+                                aggregation);
 
   //  LOG_I(MAC,"exiting ulsch preprocesor\n");
 
@@ -707,6 +725,8 @@ void schedule_ulsch_rnti(module_id_t   module_idP,
 
     // don't schedule if Msg4 is not received yet
     if (UE_list->UE_template[UE_PCCID(module_idP,UE_id)][UE_id].configured==FALSE) {
+      LOG_I(MAC,"[eNB %d] frame %d subfarme %d, UE %d: not configured, skipping UE scheduling \n", 
+	    module_idP,frameP,subframeP,UE_id);
       continue;
     }
 
@@ -725,44 +745,57 @@ void schedule_ulsch_rnti(module_id_t   module_idP,
       eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti);
 
       if (eNB_UE_stats==NULL) {
-        LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d CC %d: no PHY context\n", module_idP,frameP,subframeP,UE_id,CC_id);
+        LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: no PHY context\n", module_idP,frameP,subframeP,UE_id,rnti,CC_id);
+	drop_ue=1;
         continue; // mac_xface->macphy_exit("[MAC][eNB] Cannot find eNB_UE_stats\n");
       }
 
-      if (nCCE_available[CC_id] < (1<<aggregation)) {
-        LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d CC %d: not enough nCCE (%d)\n", module_idP,frameP,subframeP,UE_id,CC_id,nCCE_available[CC_id]);
+      if (drop_ue==1)
+	continue;
+
+      if (CCE_allocation_infeasible(module_idP,CC_id,0,subframeP,aggregation,rnti)) {
+        LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: not enough nCCE\n", module_idP,frameP,subframeP,UE_id,rnti,CC_id);
         continue; // break;
       }
 
 
+      //      printf("UE %d/%x is feasible, mode %s\n",UE_id,rnti,mode_string[eNB_UE_stats->mode]);
+
       if (eNB_UE_stats->mode == PUSCH) { // ue has a ulsch channel
 
         DCI_pdu = &eNB->common_channels[CC_id].DCI_pdu;
-        UE_template = &UE_list->UE_template[CC_id][UE_id];
+        UE_template   = &UE_list->UE_template[CC_id][UE_id];
+        UE_sched_ctrl = &UE_list->UE_sched_ctrl[UE_id];
 
         if (mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,frameP,subframeP,&harq_pid,&round,1) == -1 ) {
           LOG_W(MAC,"[eNB %d] Scheduler Frame %d, subframeP %d: candidate harq_pid from PHY for UE %d CC %d RNTI %x\n",
                 module_idP,frameP,subframeP, UE_id, CC_id, rnti);
-          //  NN --> RK: Don't schedule UE if we cannot get harq pid
-          //should we continue or set harq_pid to 0?
           continue;
         } else
-          LOG_T(MAC,"[eNB %d] Frame %d, subframeP %d, UE %d CC %d : got harq pid %d  round %d (nCCE %d, rnti %x,mode %s)\n",
-                module_idP,frameP,subframeP,UE_id,CC_id, harq_pid, round,nCCE[CC_id],rnti,mode_string[eNB_UE_stats->mode]);
-
-#ifndef EXMIMO_IOT
+          LOG_T(MAC,"[eNB %d] Frame %d, subframeP %d, UE %d CC %d : got harq pid %d  round %d (rnti %x,mode %s)\n",
+                module_idP,frameP,subframeP,UE_id,CC_id, harq_pid, round,rnti,mode_string[eNB_UE_stats->mode]);
 
-        if (((UE_is_to_be_scheduled(module_idP,CC_id,UE_id)>0)) || (round>0) || ((frameP%10)==0))
+	PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP*10)+subframeP] = UE_template->ul_total_buffer;
+	VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_BO,PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_BO[UE_id][(frameP*10)+subframeP]);	
+        if (((UE_is_to_be_scheduled(module_idP,CC_id,UE_id)>0)) || (round>0))// || ((frameP%10)==0))
           // if there is information on bsr of DCCH, DTCH or if there is UL_SR, or if there is a packet to retransmit, or we want to schedule a periodic feedback every 10 frames
-#else
-        if (round==0)
-#endif
         {
+	  LOG_D(MAC,"[eNB %d][PUSCH] Frame %d subframe %d Scheduling UE %d/%x in round %d(SR %d,UL_inactivity timer %d,UL_failure timer %d)\n",
+		module_idP,frameP,subframeP,UE_id,rnti,round,UE_template->ul_SR,
+		UE_sched_ctrl->ul_inactivity_timer,
+		UE_sched_ctrl->ul_failure_timer);
           // reset the scheduling request
           UE_template->ul_SR = 0;
-          aggregation = process_ue_cqi(module_idP,UE_id); // =2 by default!!
+          aggregation = process_ue_cqi(module_idP,UE_id); 
           status = mac_eNB_get_rrc_status(module_idP,rnti);
-          cqi_req = (status < RRC_CONNECTED)? 0:1;
+	  if (status < RRC_CONNECTED)
+	    cqi_req = 0;
+	  else if (UE_sched_ctrl->cqi_req_timer>30) {
+	    cqi_req = 1;
+	    UE_sched_ctrl->cqi_req_timer=0;
+	  }
+	  else
+	    cqi_req = 0;
 
           //power control
           //compute the expected ULSCH RX power (for the stats)
@@ -807,7 +840,9 @@ void schedule_ulsch_rnti(module_id_t   module_idP,
 	    UE_list->eNB_UE_stats[CC_id][UE_id].target_rx_power=target_rx_power;
 	    UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs1=UE_template->pre_assigned_mcs_ul;
             mcs = cmin (UE_template->pre_assigned_mcs_ul, openair_daq_vars.target_ue_ul_mcs); // adjust, based on user-defined MCS
-
+	    if ((cqi_req==1) && (mcs>19)) {
+		mcs=19;
+	    }
             if (UE_template->pre_allocated_rb_table_index_ul >=0) {
               rb_table_index=UE_template->pre_allocated_rb_table_index_ul;
             } else {
@@ -816,9 +851,10 @@ void schedule_ulsch_rnti(module_id_t   module_idP,
 	    }
 
             UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2=mcs;
-            buffer_occupancy = UE_template->ul_total_buffer;
+	    //            buffer_occupancy = UE_template->ul_total_buffer;
 
-            while ((rb_table[rb_table_index]>(frame_parms->N_RB_UL-1-first_rb[CC_id])) &&
+            while (((rb_table[rb_table_index]>(frame_parms->N_RB_UL-1-first_rb[CC_id])) ||
+		    (rb_table[rb_table_index]>45)) &&
                    (rb_table_index>0)) {
               rb_table_index--;
             }
@@ -826,25 +862,377 @@ void schedule_ulsch_rnti(module_id_t   module_idP,
             TBS = mac_xface->get_TBS_UL(mcs,rb_table[rb_table_index]);
 	    UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used_rx+=rb_table[rb_table_index];
 	    UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_TBS=TBS;
-            buffer_occupancy -= TBS;
+	    //            buffer_occupancy -= TBS;
             rballoc = mac_xface->computeRIV(frame_parms->N_RB_UL,
                                             first_rb[CC_id],
                                             rb_table[rb_table_index]);
+
+            T(T_ENB_MAC_UE_UL_SCHEDULE, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP),
+              T_INT(subframeP), T_INT(harq_pid), T_INT(mcs), T_INT(first_rb[CC_id]), T_INT(rb_table[rb_table_index]),
+              T_INT(TBS));
+
+	    // bad indices : 20 (40 PRB), 21 (45 PRB), 22 (48 PRB)
             // increment for next UE allocation
             first_rb[CC_id]+=rb_table[rb_table_index];
             //store for possible retransmission
             UE_template->nb_rb_ul[harq_pid] = rb_table[rb_table_index];
+	    UE_sched_ctrl->ul_scheduled |= (1<<harq_pid);
+	    if (UE_id == UE_list->head)
+	      VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SCHEDULED,UE_sched_ctrl->ul_scheduled);
+
+	    if (mac_eNB_get_rrc_status(module_idP,rnti) < RRC_CONNECTED)
+	      LOG_I(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d)\n",
+		    module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,mcs,
+		    first_rb[CC_id],rb_table[rb_table_index],
+		    rb_table_index,TBS,harq_pid);
+
+	    // adjust total UL buffer status by TBS, wait for UL sdus to do final update
+	    LOG_D(MAC,"[eNB %d] CC_id %d UE %d/%x : adjusting ul_total_buffer, old %d, TBS %d\n", module_idP,CC_id,UE_id,rnti,UE_template->ul_total_buffer,TBS);
+	    if (UE_template->ul_total_buffer > TBS)
+	      UE_template->ul_total_buffer -= TBS;
+	    else
+	      UE_template->ul_total_buffer = 0;
+	    LOG_D(MAC,"ul_total_buffer, new %d\n", UE_template->ul_total_buffer);
+	    // Cyclic shift for DM RS
+	    cshift = 0;// values from 0 to 7 can be used for mapping the cyclic shift (36.211 , Table 5.5.2.1.1-1)
+	    	    
+	    if (frame_parms->frame_type == TDD) {
+	      switch (frame_parms->N_RB_UL) {
+	      case 6:
+		ULSCH_dci = UE_template->ULSCH_DCI[harq_pid];
+		
+		((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->type     = 0;
+		((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->hopping  = 0;
+		((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->rballoc  = rballoc;
+		((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->mcs      = mcs;
+		((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->ndi      = ndi;
+		((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->TPC      = tpc;
+		((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->cshift   = cshift;
+		((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->padding  = 0;
+		((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->dai      = UE_template->DAI_ul[sched_subframe];
+		((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req  = cqi_req;
+		
+		add_ue_spec_dci(DCI_pdu,
+				ULSCH_dci,
+				rnti,
+				sizeof(DCI0_1_5MHz_TDD_1_6_t),
+				aggregation,
+				sizeof_DCI0_1_5MHz_TDD_1_6_t,
+				format0,
+				0);
+		break;
+		
+	      default:
+	      case 25:
+		ULSCH_dci = UE_template->ULSCH_DCI[harq_pid];
+		
+		((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->type     = 0;
+		((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->hopping  = 0;
+		((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->rballoc  = rballoc;
+		((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->mcs      = mcs;
+		((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->ndi      = ndi;
+		((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->TPC      = tpc;
+		((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->cshift   = cshift;
+		((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->padding  = 0;
+		((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->dai      = UE_template->DAI_ul[sched_subframe];
+		((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req  = cqi_req;
+		
+		add_ue_spec_dci(DCI_pdu,
+				ULSCH_dci,
+				rnti,
+				sizeof(DCI0_5MHz_TDD_1_6_t),
+				aggregation,
+				sizeof_DCI0_5MHz_TDD_1_6_t,
+				format0,
+				0);
+		break;
+		
+	      case 50:
+		ULSCH_dci = UE_template->ULSCH_DCI[harq_pid];
+		
+		((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->type     = 0;
+		((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->hopping  = 0;
+		((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->rballoc  = rballoc;
+		((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->mcs      = mcs;
+		((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->ndi      = ndi;
+		((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->TPC      = tpc;
+		((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->cshift   = cshift;
+		((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->padding  = 0;
+		((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->dai      = UE_template->DAI_ul[sched_subframe];
+		((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req  = cqi_req;
+		
+		add_ue_spec_dci(DCI_pdu,
+				ULSCH_dci,
+				rnti,
+				sizeof(DCI0_10MHz_TDD_1_6_t),
+				aggregation,
+				sizeof_DCI0_10MHz_TDD_1_6_t,
+				format0,
+				0);
+		break;
+		
+	      case 100:
+		ULSCH_dci = UE_template->ULSCH_DCI[harq_pid];
+		
+		((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->type     = 0;
+		((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->hopping  = 0;
+		((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->rballoc  = rballoc;
+		((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->mcs      = mcs;
+		((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->ndi      = ndi;
+		((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->TPC      = tpc;
+		((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->cshift   = cshift;
+		((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->padding  = 0;
+		((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->dai      = UE_template->DAI_ul[sched_subframe];
+		((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req  = cqi_req;
+		
+		add_ue_spec_dci(DCI_pdu,
+				ULSCH_dci,
+				rnti,
+				sizeof(DCI0_20MHz_TDD_1_6_t),
+				aggregation,
+				sizeof_DCI0_20MHz_TDD_1_6_t,
+				format0,
+				0);
+		break;
+	      }
+	    } // TDD
+	    else { //FDD
+	      switch (frame_parms->N_RB_UL) {
+              case 25:
+              default:
+
+                ULSCH_dci          = UE_template->ULSCH_DCI[harq_pid];
+
+#if Rel10
+                /* rel10 UE with configured scells has a different DCI0 format, see 36.212 5.3.3.1.1 */
+                if (UE_list->scell_config[UE_id].scell_count == 0) {
+#endif
+                  ((DCI0_5MHz_FDD_t *)ULSCH_dci)->type     = 0;
+                  ((DCI0_5MHz_FDD_t *)ULSCH_dci)->hopping  = 0;
+                  ((DCI0_5MHz_FDD_t *)ULSCH_dci)->rballoc  = rballoc;
+                  ((DCI0_5MHz_FDD_t *)ULSCH_dci)->mcs      = mcs;
+                  ((DCI0_5MHz_FDD_t *)ULSCH_dci)->ndi      = ndi;
+                  ((DCI0_5MHz_FDD_t *)ULSCH_dci)->TPC      = tpc;
+                  ((DCI0_5MHz_FDD_t *)ULSCH_dci)->cshift   = cshift;
+                  ((DCI0_5MHz_FDD_t *)ULSCH_dci)->padding  = 0;
+                  ((DCI0_5MHz_FDD_t *)ULSCH_dci)->cqi_req  = cqi_req;
+
+                  add_ue_spec_dci(DCI_pdu,
+                                  ULSCH_dci,
+                                  rnti,
+                                  sizeof(DCI0_5MHz_FDD_t),
+                                  aggregation,
+                                  sizeof_DCI0_5MHz_FDD_t,
+                                  format0,
+                                  0);
+#if Rel10
+                } else {
+                  unsigned int cqi_req_CA;
+                  /* if there is a CQI requestm then:
+                   * - no secondary CC activated -> CQI request 2
+                   * - one secondary CC activated -> CQI request 3
+                   */
+                  if (cqi_req == 0)
+                    cqi_req_CA = 0;
+                  else if (UE_list->numactiveCCs[UE_id] == 1)
+                    cqi_req_CA = 2;
+                  else
+                    cqi_req_CA = 3;
+                  ((DCI0_5MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->type     = 0;
+                  ((DCI0_5MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->hopping  = 0;
+                  ((DCI0_5MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->rballoc  = rballoc;
+                  ((DCI0_5MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->mcs      = mcs;
+                  ((DCI0_5MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->ndi      = ndi;
+                  ((DCI0_5MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->TPC      = tpc;
+                  ((DCI0_5MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->cshift   = cshift;
+                  ((DCI0_5MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->cqi_req  = cqi_req_CA;
+                  ((DCI0_5MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->rat      = 0; /* TBC CROUX */
+                  ((DCI0_5MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->padding  = 0;
+
+                  add_ue_spec_dci(DCI_pdu,
+                                  ULSCH_dci,
+                                  rnti,
+                                  sizeof(DCI0_5MHz_FDD_R10_CA_UEspec_RAT_t),
+                                  aggregation,
+                                  sizeof_DCI0_5MHz_FDD_R10_CA_UEspec_RAT_t,
+                                  format0,
+                                  0);
+                }
+#endif /* Rel10 */
+                break;
+
+	      case 6:
+		ULSCH_dci          = UE_template->ULSCH_DCI[harq_pid];
+		
+		((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->type     = 0;
+		((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->hopping  = 0;
+		((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->rballoc  = rballoc;
+		((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->mcs      = mcs;
+		((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->ndi      = ndi;
+		((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->TPC      = tpc;
+		((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->cshift   = cshift;
+		((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->padding  = 0;
+		((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->cqi_req  = cqi_req;
+		
+		add_ue_spec_dci(DCI_pdu,
+				ULSCH_dci,
+				rnti,
+				sizeof(DCI0_1_5MHz_FDD_t),
+				aggregation,
+				sizeof_DCI0_1_5MHz_FDD_t,
+				format0,
+				0);
+		break;
+		
+              case 50:
+                ULSCH_dci          = UE_template->ULSCH_DCI[harq_pid];
 
-            LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d)\n",
+#if Rel10
+                /* rel10 UE with configured scells has a different DCI0 format, see 36.212 5.3.3.1.1 */
+                if (UE_list->scell_config[UE_id].scell_count == 0) {
+#endif
+                  ((DCI0_10MHz_FDD_t *)ULSCH_dci)->type     = 0;
+                  ((DCI0_10MHz_FDD_t *)ULSCH_dci)->hopping  = 0;
+                  ((DCI0_10MHz_FDD_t *)ULSCH_dci)->rballoc  = rballoc;
+                  ((DCI0_10MHz_FDD_t *)ULSCH_dci)->mcs      = mcs;
+                  ((DCI0_10MHz_FDD_t *)ULSCH_dci)->ndi      = ndi;
+                  ((DCI0_10MHz_FDD_t *)ULSCH_dci)->TPC      = tpc;
+                  ((DCI0_10MHz_FDD_t *)ULSCH_dci)->padding  = 0;
+                  ((DCI0_10MHz_FDD_t *)ULSCH_dci)->cshift   = cshift;
+                  ((DCI0_10MHz_FDD_t *)ULSCH_dci)->cqi_req  = cqi_req;
+
+                  add_ue_spec_dci(DCI_pdu,
+                                  ULSCH_dci,
+                                  rnti,
+                                  sizeof(DCI0_10MHz_FDD_t),
+                                  aggregation,
+                                  sizeof_DCI0_10MHz_FDD_t,
+                                  format0,
+                                  0);
+#if Rel10
+                } else {
+                  unsigned int cqi_req_CA;
+                  /* if there is a CQI requestm then:
+                   * - no secondary CC activated -> CQI request 2
+                   * - one secondary CC activated -> CQI request 3
+                   */
+                  if (cqi_req == 0)
+                    cqi_req_CA = 0;
+                  else if (UE_list->numactiveCCs[UE_id] == 1)
+                    cqi_req_CA = 2;
+                  else
+                    cqi_req_CA = 3;
+                  ((DCI0_10MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->type     = 0;
+                  ((DCI0_10MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->hopping  = 0;
+                  ((DCI0_10MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->rballoc  = rballoc;
+                  ((DCI0_10MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->mcs      = mcs;
+                  ((DCI0_10MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->ndi      = ndi;
+                  ((DCI0_10MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->TPC      = tpc;
+                  ((DCI0_10MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->cshift   = cshift;
+                  ((DCI0_10MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->cqi_req  = cqi_req_CA;
+                  ((DCI0_10MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->rat      = 0; /* TBC CROUX */
+                  ((DCI0_10MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->padding  = 0;
+
+                  add_ue_spec_dci(DCI_pdu,
+                                  ULSCH_dci,
+                                  rnti,
+                                  sizeof(DCI0_10MHz_FDD_R10_CA_UEspec_RAT_t),
+                                  aggregation,
+                                  sizeof_DCI0_10MHz_FDD_R10_CA_UEspec_RAT_t,
+                                  format0,
+                                  0);
+                }
+#endif /* Rel10 */
+                break;
+
+              case 100:
+                ULSCH_dci          = UE_template->ULSCH_DCI[harq_pid];
+
+#if Rel10
+                /* rel10 UE with configured scells has a different DCI0 format, see 36.212 5.3.3.1.1 */
+                if (UE_list->scell_config[UE_id].scell_count == 0) {
+#endif
+                  ((DCI0_20MHz_FDD_t *)ULSCH_dci)->type     = 0;
+                  ((DCI0_20MHz_FDD_t *)ULSCH_dci)->hopping  = 0;
+                  ((DCI0_20MHz_FDD_t *)ULSCH_dci)->rballoc  = rballoc;
+                  ((DCI0_20MHz_FDD_t *)ULSCH_dci)->mcs      = mcs;
+                  ((DCI0_20MHz_FDD_t *)ULSCH_dci)->ndi      = ndi;
+                  ((DCI0_20MHz_FDD_t *)ULSCH_dci)->TPC      = tpc;
+                  ((DCI0_20MHz_FDD_t *)ULSCH_dci)->padding  = 0;
+                  ((DCI0_20MHz_FDD_t *)ULSCH_dci)->cshift   = cshift;
+                  ((DCI0_20MHz_FDD_t *)ULSCH_dci)->cqi_req  = cqi_req;
+
+                  add_ue_spec_dci(DCI_pdu,
+                                  ULSCH_dci,
+                                  rnti,
+                                  sizeof(DCI0_20MHz_FDD_t),
+                                  aggregation,
+                                  sizeof_DCI0_20MHz_FDD_t,
+                                  format0,
+                                  0);
+#if Rel10
+                } else {
+                  unsigned int cqi_req_CA;
+                  /* if there is a CQI requestm then:
+                   * - no secondary CC activated -> CQI request 2
+                   * - one secondary CC activated -> CQI request 3
+                   */
+                  if (cqi_req == 0)
+                    cqi_req_CA = 0;
+                  else if (UE_list->numactiveCCs[UE_id] == 1)
+                    cqi_req_CA = 2;
+                  else
+                    cqi_req_CA = 3;
+                  ((DCI0_20MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->type     = 0;
+                  ((DCI0_20MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->hopping  = 0;
+                  ((DCI0_20MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->rballoc  = rballoc;
+                  ((DCI0_20MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->mcs      = mcs;
+                  ((DCI0_20MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->ndi      = ndi;
+                  ((DCI0_20MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->TPC      = tpc;
+                  ((DCI0_20MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->cshift   = cshift;
+                  ((DCI0_20MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->cqi_req  = cqi_req_CA;
+                  ((DCI0_20MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->rat      = 0; /* TBC CROUX */
+                  ((DCI0_20MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->padding  = 0;
+
+                  add_ue_spec_dci(DCI_pdu,
+                                  ULSCH_dci,
+                                  rnti,
+                                  sizeof(DCI0_20MHz_FDD_R10_CA_UEspec_RAT_t),
+                                  aggregation,
+                                  sizeof_DCI0_20MHz_FDD_R10_CA_UEspec_RAT_t,
+                                  format0,
+                                  0);
+                }
+#endif /* Rel10 */
+                break;
+		
+	      }
+	    }
+
+
+	    add_ue_ulsch_info(module_idP,
+			      CC_id,
+			      UE_id,
+			      subframeP,
+			      S_UL_SCHEDULED);
+	    
+	    LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for next UE_id %d, format 0\n", module_idP,CC_id,frameP,subframeP,UE_id);
+#ifdef DEBUG
+	    dump_dci(frame_parms, &DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci-1]);
+#endif
+	    
+          }
+	  else {
+            T(T_ENB_MAC_UE_UL_SCHEDULE_RETRANSMISSION, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP),
+              T_INT(subframeP), T_INT(harq_pid), T_INT(mcs), T_INT(first_rb[CC_id]), T_INT(rb_table[rb_table_index]),
+              T_INT(round));
+
+            LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled (PHICH) UE %d (mcs %d, first rb %d, nb_rb %d, rb_table_index %d, TBS %d, harq_pid %d,round %d)\n",
                   module_idP,harq_pid,rnti,CC_id,frameP,subframeP,UE_id,mcs,
                   first_rb[CC_id],rb_table[rb_table_index],
-                  rb_table_index,TBS,harq_pid);
-            // Adjust BSR entries for LCGIDs
-            adjust_bsr_info(buffer_occupancy,
-                            TBS,
-                            UE_template);
-
-          } else if (round > 0) { //we schedule a retransmission
+                  rb_table_index,TBS,harq_pid,round);
+	  }/* 
+	  else if (round > 0) { //we schedule a retransmission
 
             ndi = UE_template->oldNDI_UL[harq_pid];
 
@@ -855,7 +1243,7 @@ void schedule_ulsch_rnti(module_id_t   module_idP,
 
             }
 
-            LOG_D(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE retransmission (mcs %d, first rb %d, nb_rb %d, harq_pid %d, round %d)\n",
+            LOG_I(MAC,"[eNB %d][PUSCH %d/%x] CC_id %d Frame %d subframeP %d Scheduled UE retransmission (mcs %d, first rb %d, nb_rb %d, harq_pid %d, round %d)\n",
                   module_idP,UE_id,rnti,CC_id,frameP,subframeP,mcs,
                   first_rb[CC_id],UE_template->nb_rb_ul[harq_pid],
 		  harq_pid, round);
@@ -871,344 +1259,7 @@ void schedule_ulsch_rnti(module_id_t   module_idP,
 	    UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs1=mcs;
 	    UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2=mcs;
 	  }
-
-          // Cyclic shift for DM RS
-          if(cooperation_flag == 2) {
-            if(UE_id == 1) { // For Distriibuted Alamouti, cyclic shift applied to 2nd UE
-              cshift = 1;
-            } else {
-              cshift = 0;
-            }
-          } else {
-            cshift = 0;// values from 0 to 7 can be used for mapping the cyclic shift (36.211 , Table 5.5.2.1.1-1)
-          }
-
-          if (frame_parms->frame_type == TDD) {
-            switch (frame_parms->N_RB_UL) {
-            case 6:
-              ULSCH_dci = UE_template->ULSCH_DCI[harq_pid];
-
-              ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->type     = 0;
-              ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->hopping  = 0;
-              ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->rballoc  = rballoc;
-              ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->mcs      = mcs;
-              ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->ndi      = ndi;
-              ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->TPC      = tpc;
-              ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->cshift   = cshift;
-              ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->padding  = 0;
-              ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->dai      = UE_template->DAI_ul[sched_subframe];
-              ((DCI0_1_5MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req  = cqi_req;
-
-              add_ue_spec_dci(DCI_pdu,
-                              ULSCH_dci,
-                              rnti,
-                              sizeof(DCI0_1_5MHz_TDD_1_6_t),
-                              aggregation,
-                              sizeof_DCI0_1_5MHz_TDD_1_6_t,
-                              format0,
-                              0);
-              break;
-
-            default:
-            case 25:
-              ULSCH_dci = UE_template->ULSCH_DCI[harq_pid];
-
-              ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->type     = 0;
-              ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->hopping  = 0;
-              ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->rballoc  = rballoc;
-              ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->mcs      = mcs;
-              ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->ndi      = ndi;
-              ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->TPC      = tpc;
-              ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->cshift   = cshift;
-              ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->padding  = 0;
-              ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->dai      = UE_template->DAI_ul[sched_subframe];
-              ((DCI0_5MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req  = cqi_req;
-
-              add_ue_spec_dci(DCI_pdu,
-                              ULSCH_dci,
-                              rnti,
-                              sizeof(DCI0_5MHz_TDD_1_6_t),
-                              aggregation,
-                              sizeof_DCI0_5MHz_TDD_1_6_t,
-                              format0,
-                              0);
-              break;
-
-            case 50:
-              ULSCH_dci = UE_template->ULSCH_DCI[harq_pid];
-
-              ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->type     = 0;
-              ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->hopping  = 0;
-              ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->rballoc  = rballoc;
-              ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->mcs      = mcs;
-              ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->ndi      = ndi;
-              ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->TPC      = tpc;
-              ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->cshift   = cshift;
-              ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->padding  = 0;
-              ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->dai      = UE_template->DAI_ul[sched_subframe];
-              ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req  = cqi_req;
-
-              add_ue_spec_dci(DCI_pdu,
-                              ULSCH_dci,
-                              rnti,
-                              sizeof(DCI0_10MHz_TDD_1_6_t),
-                              aggregation,
-                              sizeof_DCI0_10MHz_TDD_1_6_t,
-                              format0,
-                              0);
-              break;
-
-            case 100:
-              ULSCH_dci = UE_template->ULSCH_DCI[harq_pid];
-
-              ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->type     = 0;
-              ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->hopping  = 0;
-              ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->rballoc  = rballoc;
-              ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->mcs      = mcs;
-              ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->ndi      = ndi;
-              ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->TPC      = tpc;
-              ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->cshift   = cshift;
-              ((DCI0_10MHz_TDD_1_6_t *)ULSCH_dci)->padding  = 0;
-              ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->dai      = UE_template->DAI_ul[sched_subframe];
-              ((DCI0_20MHz_TDD_1_6_t *)ULSCH_dci)->cqi_req  = cqi_req;
-
-              add_ue_spec_dci(DCI_pdu,
-                              ULSCH_dci,
-                              rnti,
-                              sizeof(DCI0_20MHz_TDD_1_6_t),
-                              aggregation,
-                              sizeof_DCI0_20MHz_TDD_1_6_t,
-                              format0,
-                              0);
-              break;
-            }
-          } // TDD
-          else { //FDD
-            switch (frame_parms->N_RB_UL) {
-            case 25:
-            default:
-
-              ULSCH_dci          = UE_template->ULSCH_DCI[harq_pid];
-
-#if Rel10
-              /* rel10 UE with configured scells has a different DCI0 format, see 36.212 5.3.3.1.1 */
-              if (UE_list->scell_config[UE_id].scell_count == 0) {
-#endif
-                ((DCI0_5MHz_FDD_t *)ULSCH_dci)->type     = 0;
-                ((DCI0_5MHz_FDD_t *)ULSCH_dci)->hopping  = 0;
-                ((DCI0_5MHz_FDD_t *)ULSCH_dci)->rballoc  = rballoc;
-                ((DCI0_5MHz_FDD_t *)ULSCH_dci)->mcs      = mcs;
-                ((DCI0_5MHz_FDD_t *)ULSCH_dci)->ndi      = ndi;
-                ((DCI0_5MHz_FDD_t *)ULSCH_dci)->TPC      = tpc;
-                ((DCI0_5MHz_FDD_t *)ULSCH_dci)->cshift   = cshift;
-                ((DCI0_5MHz_FDD_t *)ULSCH_dci)->padding  = 0;
-                ((DCI0_5MHz_FDD_t *)ULSCH_dci)->cqi_req  = cqi_req;
-
-                add_ue_spec_dci(DCI_pdu,
-                                ULSCH_dci,
-                                rnti,
-                                sizeof(DCI0_5MHz_FDD_t),
-                                aggregation,
-                                sizeof_DCI0_5MHz_FDD_t,
-                                format0,
-                                0);
-#if Rel10
-              } else {
-                unsigned int cqi_req_CA;
-                /* if there is a CQI requestm then:
-                 * - no secondary CC activated -> CQI request 2
-                 * - one secondary CC activated -> CQI request 3
-                 */
-                if (cqi_req == 0)
-                  cqi_req_CA = 0;
-                else if (UE_list->numactiveCCs[UE_id] == 1)
-                  cqi_req_CA = 2;
-                else
-                  cqi_req_CA = 3;
-                ((DCI0_5MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->type     = 0;
-                ((DCI0_5MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->hopping  = 0;
-                ((DCI0_5MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->rballoc  = rballoc;
-                ((DCI0_5MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->mcs      = mcs;
-                ((DCI0_5MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->ndi      = ndi;
-                ((DCI0_5MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->TPC      = tpc;
-                ((DCI0_5MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->cshift   = cshift;
-                ((DCI0_5MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->cqi_req  = cqi_req_CA;
-                ((DCI0_5MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->rat      = 0; /* TBC CROUX */
-                ((DCI0_5MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->padding  = 0;
-
-                add_ue_spec_dci(DCI_pdu,
-                                ULSCH_dci,
-                                rnti,
-                                sizeof(DCI0_5MHz_FDD_R10_CA_UEspec_RAT_t),
-                                aggregation,
-                                sizeof_DCI0_5MHz_FDD_R10_CA_UEspec_RAT_t,
-                                format0,
-                                0);
-              }
-#endif /* Rel10 */
-              break;
-
-            case 6:
-              ULSCH_dci          = UE_template->ULSCH_DCI[harq_pid];
-
-              ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->type     = 0;
-              ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->hopping  = 0;
-              ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->rballoc  = rballoc;
-              ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->mcs      = mcs;
-              ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->ndi      = ndi;
-              ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->TPC      = tpc;
-              ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->cshift   = cshift;
-              ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->padding  = 0;
-              ((DCI0_1_5MHz_FDD_t *)ULSCH_dci)->cqi_req  = cqi_req;
-
-              add_ue_spec_dci(DCI_pdu,
-                              ULSCH_dci,
-                              rnti,
-                              sizeof(DCI0_1_5MHz_FDD_t),
-                              aggregation,
-                              sizeof_DCI0_1_5MHz_FDD_t,
-                              format0,
-                              0);
-              break;
-
-            case 50:
-              ULSCH_dci          = UE_template->ULSCH_DCI[harq_pid];
-
-#if Rel10
-              /* rel10 UE with configured scells has a different DCI0 format, see 36.212 5.3.3.1.1 */
-              if (UE_list->scell_config[UE_id].scell_count == 0) {
-#endif
-                ((DCI0_10MHz_FDD_t *)ULSCH_dci)->type     = 0;
-                ((DCI0_10MHz_FDD_t *)ULSCH_dci)->hopping  = 0;
-                ((DCI0_10MHz_FDD_t *)ULSCH_dci)->rballoc  = rballoc;
-                ((DCI0_10MHz_FDD_t *)ULSCH_dci)->mcs      = mcs;
-                ((DCI0_10MHz_FDD_t *)ULSCH_dci)->ndi      = ndi;
-                ((DCI0_10MHz_FDD_t *)ULSCH_dci)->TPC      = tpc;
-                ((DCI0_10MHz_FDD_t *)ULSCH_dci)->padding  = 0;
-                ((DCI0_10MHz_FDD_t *)ULSCH_dci)->cshift   = cshift;
-                ((DCI0_10MHz_FDD_t *)ULSCH_dci)->cqi_req  = cqi_req;
-
-                add_ue_spec_dci(DCI_pdu,
-                                ULSCH_dci,
-                                rnti,
-                                sizeof(DCI0_10MHz_FDD_t),
-                                aggregation,
-                                sizeof_DCI0_10MHz_FDD_t,
-                                format0,
-                                0);
-#if Rel10
-              } else {
-                unsigned int cqi_req_CA;
-                /* if there is a CQI requestm then:
-                 * - no secondary CC activated -> CQI request 2
-                 * - one secondary CC activated -> CQI request 3
-                 */
-                if (cqi_req == 0)
-                  cqi_req_CA = 0;
-                else if (UE_list->numactiveCCs[UE_id] == 1)
-                  cqi_req_CA = 2;
-                else
-                  cqi_req_CA = 3;
-                ((DCI0_10MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->type     = 0;
-                ((DCI0_10MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->hopping  = 0;
-                ((DCI0_10MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->rballoc  = rballoc;
-                ((DCI0_10MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->mcs      = mcs;
-                ((DCI0_10MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->ndi      = ndi;
-                ((DCI0_10MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->TPC      = tpc;
-                ((DCI0_10MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->cshift   = cshift;
-                ((DCI0_10MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->cqi_req  = cqi_req_CA;
-                ((DCI0_10MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->rat      = 0; /* TBC CROUX */
-                ((DCI0_10MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->padding  = 0;
-
-                add_ue_spec_dci(DCI_pdu,
-                                ULSCH_dci,
-                                rnti,
-                                sizeof(DCI0_10MHz_FDD_R10_CA_UEspec_RAT_t),
-                                aggregation,
-                                sizeof_DCI0_10MHz_FDD_R10_CA_UEspec_RAT_t,
-                                format0,
-                                0);
-              }
-#endif /* Rel10 */
-              break;
-
-            case 100:
-              ULSCH_dci          = UE_template->ULSCH_DCI[harq_pid];
-
-#if Rel10
-              /* rel10 UE with configured scells has a different DCI0 format, see 36.212 5.3.3.1.1 */
-              if (UE_list->scell_config[UE_id].scell_count == 0) {
-#endif
-                ((DCI0_20MHz_FDD_t *)ULSCH_dci)->type     = 0;
-                ((DCI0_20MHz_FDD_t *)ULSCH_dci)->hopping  = 0;
-                ((DCI0_20MHz_FDD_t *)ULSCH_dci)->rballoc  = rballoc;
-                ((DCI0_20MHz_FDD_t *)ULSCH_dci)->mcs      = mcs;
-                ((DCI0_20MHz_FDD_t *)ULSCH_dci)->ndi      = ndi;
-                ((DCI0_20MHz_FDD_t *)ULSCH_dci)->TPC      = tpc;
-                ((DCI0_20MHz_FDD_t *)ULSCH_dci)->padding  = 0;
-                ((DCI0_20MHz_FDD_t *)ULSCH_dci)->cshift   = cshift;
-                ((DCI0_20MHz_FDD_t *)ULSCH_dci)->cqi_req  = cqi_req;
-
-                add_ue_spec_dci(DCI_pdu,
-                                ULSCH_dci,
-                                rnti,
-                                sizeof(DCI0_20MHz_FDD_t),
-                                aggregation,
-                                sizeof_DCI0_20MHz_FDD_t,
-                                format0,
-                                0);
-#if Rel10
-              } else {
-                unsigned int cqi_req_CA;
-                /* if there is a CQI requestm then:
-                 * - no secondary CC activated -> CQI request 2
-                 * - one secondary CC activated -> CQI request 3
-                 */
-                if (cqi_req == 0)
-                  cqi_req_CA = 0;
-                else if (UE_list->numactiveCCs[UE_id] == 1)
-                  cqi_req_CA = 2;
-                else
-                  cqi_req_CA = 3;
-                ((DCI0_20MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->type     = 0;
-                ((DCI0_20MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->hopping  = 0;
-                ((DCI0_20MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->rballoc  = rballoc;
-                ((DCI0_20MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->mcs      = mcs;
-                ((DCI0_20MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->ndi      = ndi;
-                ((DCI0_20MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->TPC      = tpc;
-                ((DCI0_20MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->cshift   = cshift;
-                ((DCI0_20MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->cqi_req  = cqi_req_CA;
-                ((DCI0_20MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->rat      = 0; /* TBC CROUX */
-                ((DCI0_20MHz_FDD_R10_CA_UEspec_RAT_t *)ULSCH_dci)->padding  = 0;
-
-                add_ue_spec_dci(DCI_pdu,
-                                ULSCH_dci,
-                                rnti,
-                                sizeof(DCI0_20MHz_FDD_R10_CA_UEspec_RAT_t),
-                                aggregation,
-                                sizeof_DCI0_20MHz_FDD_R10_CA_UEspec_RAT_t,
-                                format0,
-                                0);
-              }
-#endif /* Rel10 */
-              break;
-
-            }
-          }
-
-          add_ue_ulsch_info(module_idP,
-                            CC_id,
-                            UE_id,
-                            subframeP,
-                            S_UL_SCHEDULED);
-
-          nCCE[CC_id] = nCCE[CC_id] + (1<<aggregation);
-          nCCE_available[CC_id] = mac_xface->get_nCCE_max(module_idP,CC_id) - nCCE[CC_id];
-
-          LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for next UE_id %d, format 0\n", module_idP,CC_id,frameP,subframeP,UE_id);
-#ifdef DEBUG
-          dump_dci(frame_parms, &DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci-1]);
-#endif
+	   */
 
         } // UE_is_to_be_scheduled
       } // UE is in PUSCH
@@ -1217,8 +1268,7 @@ void schedule_ulsch_rnti(module_id_t   module_idP,
 }
 
 #ifdef CBA
-void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_flag, frame_t frameP, sub_frame_t subframeP, unsigned char sched_subframe, unsigned int *nCCE,
-                             unsigned int *nCCE_available, uint16_t *first_rb)
+void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_flag, frame_t frameP, sub_frame_t subframeP, unsigned char sched_subframe, uint16_t *first_rb)
 {
 
   eNB_MAC_INST *eNB = &eNB_mac_inst[module_idP];
@@ -1277,11 +1327,11 @@ void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_f
     // cba group template uses the exisitng UE template, and thus if a UE
     // is scheduled, the correspodning group can't be used for CBA
     // this can be fixed later
-    if ((total_groups > 0) && (nCCE[CC_id] == 0)) {
+    if (total_groups > 0)  {
       DCI_pdu = &eNB_mac_inst[module_idP].common_channels[CC_id].DCI_pdu;
 
       for (cba_group=0;
-           (cba_group<total_groups)  && (nCCE_available[CC_id]* (total_cba_resources+1) > (1<<aggregation));
+           (cba_group<total_groups)   > (1<<aggregation));
            cba_group++) {
         // equal weight
         //weight[cba_group] = floor(total_UEs/active_groups);//find_num_active_UEs_in_cbagroup(module_idP, cba_group);
@@ -1292,7 +1342,7 @@ void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_f
 
           // simple UE identity based grouping
           if ((UE_id % total_groups) == cba_group) { // this could be simplifed to  active_UEs[UE_id % total_groups]++;
-            if ((mac_get_rrc_status(module_idP,1,UE_id) > RRC_CONNECTED) &&
+            if ((mac_eNB_get_rrc_status(module_idP,rnti) > RRC_CONNECTED) &&
                 (UE_is_to_be_scheduled(module_idP,CC_id,UE_id) == 0)) {
               active_UEs[cba_group]++;
             }
@@ -1369,13 +1419,6 @@ void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_f
       // phase 2 reduce the number of cba allocations among the groups
       cba_group=0;
 
-      while  (nCCE[CC_id] + (1<<aggregation) * total_cba_resources >= nCCE_available[CC_id]) {
-        num_cba_resources[cba_group%total_groups]--;
-        total_cba_resources--;
-        //  LOG_N(MAC,"reducing num cba resources to %d for group %d \n", num_cba_resources[cba_group%total_groups], cba_group%total_groups );
-        cba_group++;
-      }
-
       if (total_cba_resources <= 0) {
         return;
       }
@@ -1393,11 +1436,11 @@ void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_f
       for (cba_group=0; cba_group<total_groups; cba_group++) {
 
         LOG_N(MAC,
-              "[eNB %d] CC_id %d Frame %d, subframe %d: cba group %d active_ues %d total groups %d mcs %d, available/required rb (%d/%d), num resources %d, ncce (%d/%d required %d \n",
+              "[eNB %d] CC_id %d Frame %d, subframe %d: cba group %d active_ues %d total groups %d mcs %d, available/required rb (%d/%d), num resources %d, ncce required %d \n",
               module_idP, CC_id, frameP, subframeP, cba_group,active_UEs[cba_group],total_groups,
               mcs[cba_group], available_rbs,required_rbs[cba_group],
               num_cba_resources[cba_group],
-              nCCE[CC_id],nCCE_available[CC_id],(1<<aggregation) * num_cba_resources[cba_group]);
+              (1<<aggregation) * num_cba_resources[cba_group]);
 
         for (cba_resources=0; cba_resources < num_cba_resources[cba_group]; cba_resources++) {
           rb_table_index =0;
@@ -1423,10 +1466,10 @@ void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_f
 
           first_rb[CC_id]+=rb_table[rb_table_index];
           LOG_N(MAC,
-                "[eNB %d] CC_id %d Frame %d, subframeP %d: schedule CBA access %d rnti %x, total/required/allocated/remaining rbs (%d/%d/%d/%d), mcs %d, rballoc %d, nCCE (%d/%d)\n",
+                "[eNB %d] CC_id %d Frame %d, subframeP %d: schedule CBA access %d rnti %x, total/required/allocated/remaining rbs (%d/%d/%d/%d), mcs %d, rballoc %d\n",
                 module_idP, CC_id, frameP, subframeP, cba_group,eNB_mac_inst[module_idP].common_channels[CC_id].cba_rnti[cba_group],
                 available_rbs, required_rbs[cba_group], allocated_rbs, remaining_rbs,
-                mcs[cba_group],rballoc,nCCE_available[CC_id],nCCE[CC_id]);
+                mcs[cba_group],rballoc);
 
           switch (frame_parms->N_RB_UL) {
           case 6:
@@ -1541,8 +1584,6 @@ abort();
             break;
           }
 
-          nCCE[CC_id] = nCCE[CC_id] + (1<<aggregation) ;
-          nCCE_available[CC_id] = mac_xface->get_nCCE_max(module_idP,CC_id) - nCCE[CC_id];
           //      break;// for the moment only schedule one
         }
       }
diff --git a/openair2/LAYER2/MAC/l1_helpers.c b/openair2/LAYER2/MAC/l1_helpers.c
index 3b4c78ea9253b66a42860beaeb9a95ec0cd538d2..44bdbfe00ec68e2f10a8b9e285ef275374babe13 100644
--- a/openair2/LAYER2/MAC/l1_helpers.c
+++ b/openair2/LAYER2/MAC/l1_helpers.c
@@ -47,8 +47,8 @@ int8_t get_Po_NOMINAL_PUSCH(module_id_t module_idP,uint8_t CC_id)
 
   if (CC_id>0) {
     LOG_E(MAC,"Transmission on secondary CCs is not supported yet\n");
-    mac_xface->macphy_exit("MAC FATAL  CC_id>0");
-    return 0; // not reached
+    //mac_xface->macphy_exit("MAC FATAL  CC_id>0");
+    return 0; 
   }
 
   if (UE_mac_inst[module_idP].radioResourceConfigCommon) {
@@ -56,7 +56,8 @@ int8_t get_Po_NOMINAL_PUSCH(module_id_t module_idP,uint8_t CC_id)
   }
   else {
     LOG_E(MAC,"[UE %d] CCid %d FATAL radioResourceConfigCommon is NULL !!!\n",module_idP,CC_id);
-    mac_xface->macphy_exit("FATAL radioResourceConfigCommon is NULL");
+    //mac_xface->macphy_exit("FATAL radioResourceConfigCommon is NULL");
+    return 0;
   }
 
   return(-120 + (rach_ConfigCommon->powerRampingParameters.preambleInitialReceivedTargetPower<<1) +
diff --git a/openair2/LAYER2/MAC/main.c b/openair2/LAYER2/MAC/main.c
index efcf146b455961a884123152d7108fe7cb08cbfb..c557be8600945590888b8cc6c5bb1dcbf4d88221 100644
--- a/openair2/LAYER2/MAC/main.c
+++ b/openair2/LAYER2/MAC/main.c
@@ -84,7 +84,7 @@ void dl_phy_sync_success(module_id_t   module_idP,
   } else
 #endif
   {
-    mac_in_sync_ind(module_idP,frameP,eNB_index);
+    rrc_in_sync_ind(module_idP,frameP,eNB_index);
   }
 
 }
@@ -382,7 +382,7 @@ int mac_init_global_param(void)
   //  mac_xface->macphy_data_ind=macphy_data_ind;
   mac_xface->mrbch_phy_sync_failure=mrbch_phy_sync_failure;
   mac_xface->dl_phy_sync_success=dl_phy_sync_success;
-  mac_xface->out_of_sync_ind=mac_out_of_sync_ind;
+  mac_xface->out_of_sync_ind=rrc_out_of_sync_ind;
 
   //  Mac_rlc_xface->macphy_exit=  mac_xface->macphy_exit;
   //  Mac_rlc_xface->frame = 0;
@@ -462,12 +462,14 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer,ui
   mac_xface->initiate_ra_proc          = initiate_ra_proc;
   mac_xface->cancel_ra_proc            = cancel_ra_proc;
   mac_xface->SR_indication             = SR_indication;
+  mac_xface->UL_failure_indication     = UL_failure_indication;
   mac_xface->rx_sdu                    = rx_sdu;
   mac_xface->get_dlsch_sdu             = get_dlsch_sdu;
   mac_xface->get_eNB_UE_stats          = get_eNB_UE_stats;
   mac_xface->get_transmission_mode     = get_transmission_mode;
   mac_xface->get_rballoc               = get_rballoc;
   mac_xface->get_nb_rb                 = conv_nprb;
+  mac_xface->get_prb                   = get_prb;
   //  mac_xface->get_SB_size               = Get_SB_size;
   mac_xface->get_subframe_direction    = get_subframe_direction;
   mac_xface->Msg3_transmitted          = Msg3_tx;
@@ -478,6 +480,7 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer,ui
   mac_xface->ca_config                 = ca_config;
   mac_xface->ca_activate               = ca_activate;
 #endif
+  mac_xface->mac_phy_remove_ue         = mac_phy_remove_ue;
 
   LOG_I(MAC,"[MAIN] init UE MAC functions \n");
   mac_xface->ue_decode_si              = ue_decode_si;
@@ -511,7 +514,7 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer,ui
   mac_xface->computeRIV             = computeRIV;
   mac_xface->get_TBS_DL             = get_TBS_DL;
   mac_xface->get_TBS_UL             = get_TBS_UL;
-  mac_xface->get_nCCE_max           = get_nCCE_max;
+  mac_xface->get_nCCE_max           = get_nCCE_mac;
   mac_xface->get_nCCE_offset        = get_nCCE_offset;
   mac_xface->get_ue_mode            = get_ue_mode;
   mac_xface->phy_config_sib1_eNB    = phy_config_sib1_eNB;
diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c
index 3efacf68add26cb0ef1ed1cc7ddbe2891a6add95..97a4110c69aab74965770aaaf055ac9faa224f34 100644
--- a/openair2/LAYER2/MAC/pre_processor.c
+++ b/openair2/LAYER2/MAC/pre_processor.c
@@ -47,6 +47,7 @@
 #include "LAYER2/MAC/proto.h"
 #include "LAYER2/MAC/extern.h"
 #include "UTIL/LOG/log.h"
+#include "UTIL/LOG/vcd_signal_dumper.h"
 #include "UTIL/OPT/opt.h"
 #include "OCG.h"
 #include "OCG_extern.h"
@@ -176,6 +177,7 @@ void assign_rbs_required (module_id_t Mod_id,
       eNB_UE_stats[CC_id]->DL_cqi[0], MIN_CQI_VALUE, MAX_CQI_VALUE);
       */
       eNB_UE_stats[CC_id]->dlsch_mcs1=cqi_to_mcs[eNB_UE_stats[CC_id]->DL_cqi[0]];
+
       eNB_UE_stats[CC_id]->dlsch_mcs1 = cmin(eNB_UE_stats[CC_id]->dlsch_mcs1,openair_daq_vars.target_ue_dl_mcs);
 
     }
@@ -318,6 +320,8 @@ void sort_UEs (module_id_t Mod_idP,
       rnti1 = UE_RNTI(Mod_idP,UE_id1);
       if(rnti1 == NOT_A_RNTI)
 	continue;
+      if (UE_list->UE_sched_ctrl[UE_id1].ul_out_of_sync == 1)
+	continue;
       pCC_id1 = UE_PCCID(Mod_idP,UE_id1);
       cqi1    = maxcqi(Mod_idP,UE_id1); //
       round1  = maxround(Mod_idP,rnti1,frameP,subframeP,0);
@@ -326,6 +330,8 @@ void sort_UEs (module_id_t Mod_idP,
       rnti2 = UE_RNTI(Mod_idP,UE_id2);
       if(rnti2 == NOT_A_RNTI)
         continue;
+      if (UE_list->UE_sched_ctrl[UE_id2].ul_out_of_sync == 1)
+	continue;
       cqi2    = maxcqi(Mod_idP,UE_id2);
       round2  = maxround(Mod_idP,rnti2,frameP,subframeP,0);  //mac_xface->get_ue_active_harq_pid(Mod_id,rnti2,subframe,&harq_pid2,&round2,0);
       pCC_id2 = UE_PCCID(Mod_idP,UE_id2);
@@ -452,7 +458,8 @@ void dlsch_scheduler_pre_processor (module_id_t   Mod_id,
 
     if(rnti == NOT_A_RNTI)
       continue;
-
+    if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1)
+      continue;
     UE_id = i;
 
     // if there is no available harq_process, skip the UE
@@ -562,6 +569,8 @@ void dlsch_scheduler_pre_processor (module_id_t   Mod_id,
           // LOG_D(MAC,"UE %d rnti 0x\n", UE_id, rnti );
           if(rnti == NOT_A_RNTI)
             continue;
+	  if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1)
+	    continue;
 
           transmission_mode = mac_xface->get_transmission_mode(Mod_id,CC_id,rnti);
 	  //          mac_xface->get_ue_active_harq_pid(Mod_id,CC_id,rnti,frameP,subframeP,&harq_pid,&round,0);
@@ -606,6 +615,8 @@ void dlsch_scheduler_pre_processor (module_id_t   Mod_id,
 		  round2    = ue_sched_ctl2->round[CC_id];
                   if(rnti2 == NOT_A_RNTI)
                     continue;
+		  if (UE_list->UE_sched_ctrl[UE_id2].ul_out_of_sync == 1)
+		    continue;
 
                   eNB_UE_stats2 = mac_xface->get_eNB_UE_stats(Mod_id,CC_id,rnti2);
                   //mac_xface->get_ue_active_harq_pid(Mod_id,CC_id,rnti2,frameP,subframeP,&harq_pid2,&round2,0);
@@ -729,38 +740,126 @@ void dlsch_scheduler_pre_processor (module_id_t   Mod_id,
   }
 }
 
+#define SF05_LIMIT 1
 
 void dlsch_scheduler_pre_processor_reset (int module_idP,
-    int UE_id,
-    uint8_t  CC_id,
-    int frameP,
-    int subframeP,					  
-    int N_RBG,
-    uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX],
-    uint16_t nb_rbs_required_remaining[MAX_NUM_CCs][NUMBER_OF_UE_MAX],
-    unsigned char rballoc_sub[MAX_NUM_CCs][N_RBG_MAX],
-    unsigned char MIMO_mode_indicator[MAX_NUM_CCs][N_RBG_MAX])
+					  int UE_id,
+					  uint8_t  CC_id,
+					  int frameP,
+					  int subframeP,					  
+					  int N_RBG,
+					  uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX],
+					  uint16_t nb_rbs_required_remaining[MAX_NUM_CCs][NUMBER_OF_UE_MAX],
+					  unsigned char rballoc_sub[MAX_NUM_CCs][N_RBG_MAX],
+					  unsigned char MIMO_mode_indicator[MAX_NUM_CCs][N_RBG_MAX])
+  
 {
-  int i;
+  int i,j;
   UE_list_t *UE_list=&eNB_mac_inst[module_idP].UE_list;
   UE_sched_ctrl *ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
   rnti_t rnti = UE_RNTI(module_idP,UE_id);
-
+  uint8_t *vrb_map = eNB_mac_inst[module_idP].common_channels[CC_id].vrb_map;
+  int RBGsize = PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL/N_RBG;
+#ifdef SF05_LIMIT
+  //int subframe05_limit=0;
+  int sf05_upper=-1,sf05_lower=-1;
+#endif
+  LTE_eNB_UE_stats *eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti);
   // initialize harq_pid and round
   mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,
 				    frameP,subframeP,
 				    &ue_sched_ctl->harq_pid[CC_id],
 				    &ue_sched_ctl->round[CC_id],
 				    0);
+  if (ue_sched_ctl->ta_timer == 0) {
 
+    // WE SHOULD PROTECT the eNB_UE_stats with a mutex here ...
+
+    ue_sched_ctl->ta_timer = 20;  // wait 20 subframes before taking TA measurement from PHY
+    switch (PHY_vars_eNB_g[module_idP][CC_id]->lte_frame_parms.N_RB_DL) {
+    case 6:
+      ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update;
+      break;
+      
+    case 15:
+      ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/2;
+      break;
+      
+    case 25:
+      ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/4;
+      break;
+      
+    case 50:
+      ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/8;
+      break;
+      
+    case 75:
+      ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/12;
+      break;
+      
+    case 100:
+      ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/16;
+      break;
+    }
+    // clear the update in case PHY does not have a new measurement after timer expiry
+    eNB_UE_stats->timing_advance_update =  0;
+  }
+  else {
+    ue_sched_ctl->ta_timer--;
+    ue_sched_ctl->ta_update =0; // don't trigger a timing advance command
+  }
+  if (UE_id==0) {
+    VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_TIMING_ADVANCE,ue_sched_ctl->ta_update);
+  }
   nb_rbs_required[CC_id][UE_id]=0;
   ue_sched_ctl->pre_nb_available_rbs[CC_id] = 0;
   ue_sched_ctl->dl_pow_off[CC_id] = 2;
   nb_rbs_required_remaining[CC_id][UE_id] = 0;
 
+#ifdef SF05_LIMIT  
+  switch (N_RBG) {
+  case 6:
+    sf05_lower=0;
+    sf05_upper=5;
+    break;
+  case 8:
+    sf05_lower=2;
+    sf05_upper=5;
+    break;
+  case 13:
+    sf05_lower=4;
+    sf05_upper=7;
+    break;
+  case 17:
+    sf05_lower=7;
+    sf05_upper=9;
+    break;
+  case 25:
+    sf05_lower=11;
+    sf05_upper=13;
+    break;
+  }
+#endif
+  // Initialize Subbands according to VRB map
   for (i=0; i<N_RBG; i++) {
     ue_sched_ctl->rballoc_sub_UE[CC_id][i] = 0;
     rballoc_sub[CC_id][i] = 0;
+#ifdef SF05_LIMIT
+    // for avoiding 6+ PRBs around DC in subframe 0-5 (avoid excessive errors)
+
+    if ((subframeP==0 || subframeP==5) && 
+	(i>=sf05_lower && i<=sf05_upper))
+      rballoc_sub[CC_id][i]=1;
+#endif
+    // for SI-RNTI,RA-RNTI and P-RNTI allocations
+    for (j=0;j<RBGsize;j++) {
+      if (vrb_map[j+(i*RBGsize)]!=0)  {
+	rballoc_sub[CC_id][i] = 1;
+	LOG_D(MAC,"Frame %d, subframe %d : vrb %d allocated\n",frameP,subframeP,j+(i*RBGsize));
+	break;
+      }
+    }
+    LOG_D(MAC,"Frame %d Subframe %d CC_id %d RBG %i : rb_alloc %d\n",frameP,subframeP,CC_id,i,rballoc_sub[CC_id][i]);
     MIMO_mode_indicator[CC_id][i] = 2;
   }
 }
@@ -828,8 +927,7 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
                                    int frameP,
                                    sub_frame_t subframeP,
                                    uint16_t *first_rb,
-                                   uint8_t aggregation,
-                                   uint32_t *nCCE)
+                                   uint8_t aggregation)
 {
 
   int16_t            i;
@@ -839,14 +937,10 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
   int16_t            total_remaining_rbs[MAX_NUM_CCs];
   uint16_t           max_num_ue_to_be_scheduled=0,total_ue_count=0;
   rnti_t             rnti= -1;
-  uint32_t            nCCE_to_be_used[MAX_NUM_CCs];
   UE_list_t          *UE_list = &eNB_mac_inst[module_idP].UE_list;
   UE_TEMPLATE        *UE_template = 0;
   LTE_DL_FRAME_PARMS   *frame_parms = 0;
 
-  // LOG_I(MAC,"store ulsch buffers\n");
-  // convert BSR to bytes for comparison with tbs
-  store_ulsch_buffer(module_idP,frameP, subframeP);
 
   //LOG_I(MAC,"assign max mcs min rb\n");
   // maximize MCS and then allocate required RB according to the buffer occupancy with the limit of max available UL RB
@@ -860,7 +954,6 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
   // we need to distribute RBs among UEs
   // step1:  reset the vars
   for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
-    nCCE_to_be_used[CC_id]= nCCE[CC_id];
     total_allocated_rbs[CC_id]=0;
     total_remaining_rbs[CC_id]=0;
     average_rbs_per_user[CC_id]=0;
@@ -882,6 +975,9 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
     if (rnti==NOT_A_RNTI)
       continue;
 
+    if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1)
+      continue;
+
     UE_id = i;
 
     for (n=0; n<UE_list->numactiveULCCs[UE_id]; n++) {
@@ -894,11 +990,13 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
       if (UE_template->pre_allocated_nb_rb_ul > 0) {
         total_ue_count+=1;
       }
-
-      if((mac_xface->get_nCCE_max(module_idP,CC_id) - nCCE_to_be_used[CC_id])  > (1<<aggregation)) {
+      /*
+      if((mac_xface->get_nCCE_max(module_idP,CC_id,3,subframeP) - nCCE_to_be_used[CC_id])  > (1<<aggregation)) {
         nCCE_to_be_used[CC_id] = nCCE_to_be_used[CC_id] + (1<<aggregation);
         max_num_ue_to_be_scheduled+=1;
-      }
+	}*/
+
+      max_num_ue_to_be_scheduled+=1;
 
       if (total_ue_count == 0) {
         average_rbs_per_user[CC_id] = 0;
@@ -928,6 +1026,8 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
 
     if (rnti==NOT_A_RNTI)
       continue;
+    if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1)
+      continue;
 
     UE_id = i;
 
@@ -956,6 +1056,8 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
 
       if (rnti==NOT_A_RNTI)
         continue;
+      if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1)
+	continue;
 
       UE_id = i;
 
@@ -997,49 +1099,6 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
 }
 
 
-void store_ulsch_buffer(module_id_t module_idP, int frameP, sub_frame_t subframeP)
-{
-
-  int                 UE_id,pCC_id,lcgid;
-  UE_list_t           *UE_list = &eNB_mac_inst[module_idP].UE_list;
-  UE_TEMPLATE         *UE_template;
-
-  for (UE_id=UE_list->head_ul; UE_id>=0; UE_id=UE_list->next_ul[UE_id]) {
-
-
-    UE_template = &UE_list->UE_template[UE_PCCID(module_idP,UE_id)][UE_id];
-    //LOG_I(MAC,"[UE %d next %d] SR is %d\n",UE_id, UE_list->next_ul[UE_id], UE_template->ul_SR);
-
-    UE_template->ul_total_buffer=0;
-
-    for (lcgid=0; lcgid<MAX_NUM_LCGID; lcgid++) {
-      UE_template->ul_buffer_info[lcgid]=BSR_TABLE[UE_template->bsr_info[lcgid]];
-      UE_template->ul_total_buffer+= UE_template->ul_buffer_info[lcgid]; // apply traffic aggregtaion if packets are small
-      //   UE_template->ul_buffer_creation_time_max=cmax(UE_template->ul_buffer_creation_time_max, frame_cycle*1024 + frameP-UE_template->ul_buffer_creation_time[lcgid]));
-    }
-
-    if ( UE_template->ul_total_buffer >0)
-      LOG_D(MAC,"[eNB %d] Frame %d subframe %d UE %d CC id %d: LCGID0 %d, LCGID1 %d, LCGID2 %d LCGID3 %d, BO %d\n",
-            module_idP, frameP,subframeP, UE_id, UE_PCCID(module_idP,UE_id),
-            UE_template->ul_buffer_info[LCGID0],
-            UE_template->ul_buffer_info[LCGID1],
-            UE_template->ul_buffer_info[LCGID2],
-            UE_template->ul_buffer_info[LCGID3],
-            UE_template->ul_total_buffer);
-    else if (UE_is_to_be_scheduled(module_idP,UE_PCCID(module_idP,UE_id),UE_id) > 0 ) {
-      if (UE_template->ul_total_buffer == 0 ) {
-        UE_template->ul_total_buffer = BSR_TABLE[11];
-      }
-
-      LOG_D(MAC,"[eNB %d] Frame %d subframe %d UE %d CC id %d: SR active, set BO to %d \n",
-            module_idP, frameP,subframeP, UE_id, UE_PCCID(module_idP,UE_id),
-            UE_template->ul_total_buffer);
-    }
-  }
-}
-
-
-
 void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subframeP, uint16_t *first_rb)
 {
 
@@ -1047,7 +1106,7 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra
   uint16_t           n,UE_id;
   uint8_t            CC_id;
   rnti_t             rnti           = -1;
-  int                mcs=cmin(16,openair_daq_vars.target_ue_ul_mcs);
+  int                mcs;
   int                rb_table_index=0,tbs,tx_power;
   eNB_MAC_INST       *eNB = &eNB_mac_inst[module_idP];
   UE_list_t          *UE_list = &eNB->UE_list;
@@ -1055,12 +1114,20 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra
   UE_TEMPLATE       *UE_template;
   LTE_DL_FRAME_PARMS   *frame_parms;
 
+
   for (i=UE_list->head_ul; i>=0; i=UE_list->next_ul[i]) {
 
     rnti = UE_RNTI(module_idP,i);
 
     if (rnti==NOT_A_RNTI)
       continue;
+    if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1)
+      continue;
+
+    if (UE_list->UE_sched_ctrl[i].phr_received == 1)
+      mcs = 20; // if we've received the power headroom information the UE, we can go to maximum mcs
+    else
+      mcs = 10; // otherwise, limit to QPSK PUSCH
 
     UE_id = i;
 
@@ -1146,7 +1213,7 @@ void sort_ue_ul (module_id_t module_idP,int frameP, sub_frame_t subframeP)
   int               UE_id1,UE_id2;
   int               pCCid1,pCCid2;
   int               round1,round2;
-  int               i=0,ii=0,j=0;
+  int               i=0,ii=0;
   rnti_t            rnti1,rnti2;
 
   UE_list_t *UE_list = &eNB_mac_inst[module_idP].UE_list;
@@ -1161,7 +1228,9 @@ void sort_ue_ul (module_id_t module_idP,int frameP, sub_frame_t subframeP)
       rnti1 = UE_RNTI(module_idP,UE_id1);
       
       if(rnti1 == NOT_A_RNTI)
-      continue;
+	continue;
+      if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1)
+	continue;
 
       pCCid1 = UE_PCCID(module_idP,UE_id1);
       round1  = maxround(module_idP,rnti1,frameP,subframeP,1);
@@ -1171,6 +1240,8 @@ void sort_ue_ul (module_id_t module_idP,int frameP, sub_frame_t subframeP)
       
       if(rnti2 == NOT_A_RNTI)
         continue;
+      if (UE_list->UE_sched_ctrl[UE_id2].ul_out_of_sync == 1)
+	continue;
 
       pCCid2 = UE_PCCID(module_idP,UE_id2);
       round2  = maxround(module_idP,rnti2,frameP,subframeP,1);
diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h
index 4434ddc4b6d11cbdcac0b2693bafd52ed4df2801..fe094205d88d2238ea6ae2c8f3213640cc1b667d 100644
--- a/openair2/LAYER2/MAC/proto.h
+++ b/openair2/LAYER2/MAC/proto.h
@@ -47,26 +47,23 @@ void add_ue_spec_dci(DCI_PDU *DCI_pdu,void *pdu,rnti_t rnti,unsigned char dci_si
 
 //LG commented cause compilation error for RT eNB extern inline unsigned int taus(void);
 
-/** \fn void schedule_RA(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,uint8_t Msg3_subframe,unsigned int *nprb,unsigned int *nCCE);
+/** \fn void schedule_RA(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,uint8_t Msg3_subframe,unsigned int *nprb);
 \brief First stage of Random-Access Scheduling. Loops over the RA_templates and checks if RAR, Msg3 or its retransmission are to be scheduled in the subframe.  It returns the total number of PRB used for RA SDUs.  For Msg3 it retrieves the L3msg from RRC and fills the appropriate buffers.  For the others it just computes the number of PRBs. Each DCI uses 3 PRBs (format 1A)
 for the message.
 @param Mod_id Instance ID of eNB
 @param frame Frame index
 @param subframe Subframe number on which to act
-@param nprb Pointer to current PRB count
-@param nCCE Pointer to current nCCE count
+
 */
-void schedule_RA(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,uint8_t Msg3_subframe,unsigned int *nprb,unsigned int *nCCE);
+void schedule_RA(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,uint8_t Msg3_subframe);
 
 /** \brief First stage of SI Scheduling. Gets a SI SDU from RRC if available and computes the MCS required to transport it as a function of the SDU length.  It assumes a length less than or equal to 64 bytes (MCS 6, 3 PRBs).
 @param Mod_id Instance ID of eNB
 @param frame Frame index
 @param subframe Subframe number on which to act
 @param Msg3_subframe Subframe where Msg3 will be transmitted
-@param nprb Pointer to current PRB count
-@param nCCE Pointer to current nCCE count
 */
-void schedule_SI(module_id_t module_idP,frame_t frameP,unsigned int *nprb,unsigned int *nCCE);
+void schedule_SI(module_id_t module_idP,frame_t frameP,sub_frame_t subframeP);
 
 /** \brief MBMS scheduling: Checking the position for MBSFN subframes. Create MSI, transfer MCCH from RRC to MAC, transfer MTCHs from RLC to MAC. Multiplexing MSI,MCCH&MTCHs. Return 1 if there are MBSFN data being allocated, otherwise return 0;
 @param Mod_id Instance ID of eNB
@@ -95,49 +92,41 @@ int8_t ue_get_mbsfn_sf_alloction (module_id_t module_idP, uint8_t mbsfn_sync_are
 @param frame Frame index
 @param subframe Subframe number on which to act
 @param sched_subframe Subframe number where PUSCH is transmitted (for DAI lookup)
-@param nCCE Pointer to current nCCE count
 */
-void schedule_ulsch(module_id_t module_idP,frame_t frameP,unsigned char cooperation_flag,sub_frame_t subframe,unsigned char sched_subframe,unsigned int *nCCE);
+void schedule_ulsch(module_id_t module_idP,frame_t frameP,unsigned char cooperation_flag,sub_frame_t subframe,unsigned char sched_subframe);
 
 /** \brief ULSCH Scheduling per RNTI
 @param Mod_id Instance ID of eNB
 @param frame Frame index
 @param subframe Subframe number on which to act
 @param sched_subframe Subframe number where PUSCH is transmitted (for DAI lookup)
-@param nCCE Pointer to current nCCE count
 */
-void schedule_ulsch_rnti(module_id_t module_idP, unsigned char cooperation_flag, frame_t frameP, sub_frame_t subframe, unsigned char sched_subframe, unsigned int *nCCE, unsigned int *nCCE_available,
-                         uint16_t *first_rb);
+void schedule_ulsch_rnti(module_id_t module_idP, unsigned char cooperation_flag, frame_t frameP, sub_frame_t subframe, unsigned char sched_subframe, uint16_t *first_rb);
 
 /** \brief ULSCH Scheduling for CBA  RNTI
 @param Mod_id Instance ID of eNB
 @param frame Frame index
 @param subframe Subframe number on which to act
 @param sched_subframe Subframe number where PUSCH is transmitted (for DAI lookup)
-@param nCCE Pointer to current nCCE count
 */
-void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_flag, frame_t frameP, sub_frame_t subframe, unsigned char sched_subframe, unsigned int *nCCE,
-                             unsigned int *nCCE_available, uint16_t *first_rb);
+void schedule_ulsch_cba_rnti(module_id_t module_idP, unsigned char cooperation_flag, frame_t frameP, sub_frame_t subframe, unsigned char sched_subframe, uint16_t *first_rb);
 
 /** \brief Second stage of DLSCH scheduling, after schedule_SI, schedule_RA and schedule_dlsch have been called.  This routine first allocates random frequency assignments for SI and RA SDUs using distributed VRB allocations and adds the corresponding DCI SDU to the DCI buffer for PHY.  It then loops over the UE specific DCIs previously allocated and fills in the remaining DCI fields related to frequency allocation.  It assumes localized allocation of type 0 (DCI.rah=0).  The allocation is done for tranmission modes 1,2,4.
 @param Mod_id Instance of eNB
 @param frame Frame index
 @param subframe Index of subframe
-@param rballoc Bitmask for allowable subband allocations
-@param RA_scheduled RA was scheduled in this subframe
 @param mbsfn_flag Indicates that this subframe is for MCH/MCCH
 */
-void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,uint32_t *rballoc,uint8_t RA_scheduled,int *mbsfn_flag);
+void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,int *mbsfn_flag);
 
 /** \brief UE specific DLSCH scheduling. Retrieves next ue to be schduled from round-robin scheduler and gets the appropriate harq_pid for the subframe from PHY. If the process is active and requires a retransmission, it schedules the retransmission with the same PRB count and MCS as the first transmission. Otherwise it consults RLC for DCCH/DTCH SDUs (status with maximum number of available PRBS), builds the MAC header (timing advance sent by default) and copies
 @param Mod_id Instance ID of eNB
 @param frame Frame index
 @param subframe Subframe on which to act
-@param nb_rb_used0 Number of PRB used by SI/RA
-@param nCCE_used Number of CCE used by SI/RA
+
 @param mbsfn_flag  Indicates that MCH/MCCH is in this subframe
 */
-void schedule_ue_spec(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,unsigned int *nb_rb_used0,unsigned int *nCCE_used,int *mbsfn_flag);
+void schedule_ue_spec(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,int *mbsfn_flag);
 
 /** \brief Function for UE/PHY to compute PUSCH transmit power in power-control procedure.
     @param Mod_id Module id of UE
@@ -280,6 +269,15 @@ void rx_sdu(const module_id_t module_idP, const int CC_id,const frame_t frameP,
 */
 void SR_indication(module_id_t module_idP,int CC_id,frame_t frameP,rnti_t rnti, sub_frame_t subframe);
 
+/* \brief Function to indicate a UL failure was detected by eNB PHY.
+@param Mod_id Instance ID of eNB
+@param CC_id Component carrier
+@param frameP Frame index
+@param rnti RNTI of UE transmitting the SR
+@param subframe Index of subframe where SR was received
+*/
+void UL_failure_indication(module_id_t Mod_id,int CC_id,frame_t frameP,rnti_t rnti,sub_frame_t subframe);
+
 uint8_t *get_dlsch_sdu(module_id_t module_idP,int CC_id,frame_t frameP,rnti_t rnti,uint8_t TBindex);
 
 /* \brief Function to retrieve MCH transport block and MCS used for MCH in this MBSFN subframe.  Returns null if no MCH is to be transmitted
@@ -312,6 +310,27 @@ uint8_t     process_ue_cqi    (module_id_t module_idP, int UE_id);
 
 int8_t find_active_UEs_with_traffic(module_id_t module_idP);
 
+void init_CCE_table(int module_idP,int CC_idP);
+
+int get_nCCE_offset(int *CCE_table,
+		    const unsigned char L, 
+		    const int nCCE, 
+		    const int common_dci, 
+		    const unsigned short rnti, 
+		    const unsigned char subframe);
+
+int allocate_CCEs(int module_idP,
+		  int CC_idP,
+		  int subframe,
+		  int test_only);
+
+boolean_t CCE_allocation_infeasible(int module_idP,
+				  int CC_idP,
+				  int common_flag,
+				  int subframe,
+				  int aggregation,
+				  int rnti);
+
 void set_ue_dai(sub_frame_t   subframeP,
                 uint8_t       tdd_config,
                 int           UE_id,
@@ -480,7 +499,7 @@ uint8_t *parse_ulsch_header(uint8_t *mac_header,
 int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer, uint8_t cba_group_active, uint8_t HO_active);
 int mac_init(void);
 int add_new_ue(module_id_t Mod_id, int CC_id, rnti_t rnti,int harq_pid);
-int mac_remove_ue(module_id_t Mod_id, int UE_id,int frameP, sub_frame_t subframeP);
+int rrc_mac_remove_ue(module_id_t Mod_id, rnti_t rntiP);
 
 
 int maxround(module_id_t Mod_id,uint16_t rnti,int frame,sub_frame_t subframe,uint8_t ul_flag);
@@ -492,7 +511,7 @@ int UE_PCCID(module_id_t mod_idP,int ue_idP);
 rnti_t UE_RNTI(module_id_t mod_idP, int ue_idP);
 
 
-void ulsch_scheduler_pre_processor(module_id_t module_idP, int frameP, sub_frame_t subframeP, uint16_t *first_rb, uint8_t  aggregattion, uint32_t *nCCE);
+void ulsch_scheduler_pre_processor(module_id_t module_idP, int frameP, sub_frame_t subframeP, uint16_t *first_rb, uint8_t  aggregattion);
 void store_ulsch_buffer(module_id_t module_idP, int frameP, sub_frame_t subframeP);
 void sort_ue_ul (module_id_t module_idP,int frameP, sub_frame_t subframeP);
 void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subframeP,uint16_t *first_rb);
@@ -793,6 +812,7 @@ rrc_get_estimated_ue_distance(
   const int         CC_idP,
   const uint8_t     loc_typeP);
 
+void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_eNB);
 
 #endif
 /** @}*/
diff --git a/openair2/LAYER2/MAC/ra_procedures.c b/openair2/LAYER2/MAC/ra_procedures.c
index 43ec8b05ec88c15ea71cb86fa024b5507786e1f2..669077bf4fddde7f649eb779cdde92088d329064 100644
--- a/openair2/LAYER2/MAC/ra_procedures.c
+++ b/openair2/LAYER2/MAC/ra_procedures.c
@@ -152,6 +152,9 @@ void get_prach_resources(module_id_t module_idP,
     }
   }
 
+  /* TODO: gcc warns if this variable is not always set, let's put -1 for no more warning */
+  messageSizeGroupA = -1;
+
   if (!rach_ConfigCommon->preambleInfo.preamblesGroupAConfig) {
     noGroupB = 1;
   } else {
@@ -171,6 +174,8 @@ void get_prach_resources(module_id_t module_idP,
       break;
     }
 
+    /* TODO: what value to use as default? */
+    messagePowerOffsetGroupB = -9999;
     switch (rach_ConfigCommon->preambleInfo.preamblesGroupAConfig->messagePowerOffsetGroupB) {
     case 0:
       messagePowerOffsetGroupB = -9999;
@@ -495,7 +500,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,
           UE_mac_inst[module_idP].RA_PREAMBLE_TRANSMISSION_COUNTER++;
           UE_mac_inst[module_idP].RA_prach_resources.ra_PREAMBLE_RECEIVED_TARGET_POWER +=
             (rach_ConfigCommon->powerRampingParameters.powerRampingStep<<1);  // 2dB increments in ASN.1 definition
-	  int preambleTransMax;
+	  int preambleTransMax = -1;
 	  switch (rach_ConfigCommon->ra_SupervisionInfo.preambleTransMax) {
 	  case RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n3:
 	    preambleTransMax = 3;
diff --git a/openair2/LAYER2/MAC/rar_tools.c b/openair2/LAYER2/MAC/rar_tools.c
index 2e97f83fac72920610829cacebb77c1e6190bcd1..be8dc43c97ad7b6c3cae0f1450e499e2e5b01985 100644
--- a/openair2/LAYER2/MAC/rar_tools.c
+++ b/openair2/LAYER2/MAC/rar_tools.c
@@ -39,8 +39,6 @@
 #include "defs.h"
 #include "proto.h"
 #include "extern.h"
-#include "MAC_INTERFACE/defs.h"
-#include "MAC_INTERFACE/extern.h"
 #include "SIMULATION/TOOLS/defs.h"
 #include "UTIL/LOG/log.h"
 #include "OCG.h"
@@ -117,7 +115,7 @@ unsigned short fill_rar(
   rar[2] |= ((mcs&0x8)>>3);  // mcs 10
   rar[3] = (((mcs&0x7)<<5)) | ((TPC&7)<<2) | ((ULdelay&1)<<1) | (cqireq&1);
 
-  LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Generating RAR (%02x|%02x.%02x.%02x.%02x.%02x.%02x) for ra_idx %d, CRNTI %x,preamble %d/%d,TIMING OFFSET %d\n",
+  LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d Generating RAR (%02x|%02x.%02x.%02x.%02x.%02x.%02x) for ra_idx %d, CRNTI %x,preamble %d/%d,TIMING OFFSET %d\n",
         module_idP, CC_id,
         frameP,
         *(uint8_t*)rarh,rar[0],rar[1],rar[2],rar[3],rar[4],rar[5],
@@ -168,14 +166,14 @@ ue_process_rar(
   LOG_D(MAC,"[UE %d][RAPROC] rarh->RAPID %d\n",module_idP,rarh->RAPID);
 
   //  LOG_I(MAC,"[UE %d][RAPROC] rar->R %d\n",module_idP,rar->R);
-  LOG_I(MAC,"[UE %d][RAPROC] rar->Timing_Advance_Command %d\n",module_idP,(((uint16_t)(rar[0]&0x7f))<<4) + (rar[1]>>4));
+  LOG_D(MAC,"[UE %d][RAPROC] rar->Timing_Advance_Command %d\n",module_idP,(((uint16_t)(rar[0]&0x7f))<<4) + (rar[1]>>4));
   //  LOG_I(MAC,"[UE %d][RAPROC] rar->hopping_flag %d\n",module_idP,rar->hopping_flag);
   //  LOG_I(MAC,"[UE %d][RAPROC] rar->rb_alloc %d\n",module_idP,rar->rb_alloc);
   //  LOG_I(MAC,"[UE %d][RAPROC] rar->mcs %d\n",module_idP,rar->mcs);
   //  LOG_I(MAC,"[UE %d][RAPROC] rar->TPC %d\n",module_idP,rar->TPC);
   //  LOG_I(MAC,"[UE %d][RAPROC] rar->UL_delay %d\n",module_idP,rar->UL_delay);
   //  LOG_I(MAC,"[UE %d][RAPROC] rar->cqi_req %d\n",module_idP,rar->cqi_req);
-  LOG_I(MAC,"[UE %d][RAPROC] rar->t_crnti %x\n",module_idP,(uint16_t)rar[5]+(rar[4]<<8));
+  LOG_D(MAC,"[UE %d][RAPROC] rar->t_crnti %x\n",module_idP,(uint16_t)rar[5]+(rar[4]<<8));
 #endif
 
 
diff --git a/openair2/LAYER2/MAC/vars.h b/openair2/LAYER2/MAC/vars.h
index 88da64de5a0634109a3621320d081ac143f18b0e..508c7f8c210a9f20753d79f6b298f0518ce87f88 100644
--- a/openair2/LAYER2/MAC/vars.h
+++ b/openair2/LAYER2/MAC/vars.h
@@ -55,6 +55,7 @@ const uint32_t BSR_TABLE[BSR_TABLE_SIZE]= {0,10,12,14,17,19,22,26,31,36,42,49,57
 
 //uint32_t EBSR_Level[63]={0,10,13,16,19,23,29,35,43,53,65,80,98,120,147,181};
 
+MAC_xface *mac_xface;
 
 uint32_t RRC_CONNECTION_FLAG;
 
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c
index f25e921570a7638d34fef297b60e7f8579d103ff..d8fa42a19cc3f8a82e5d88fc3d531515287271d9 100755
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c
@@ -45,7 +45,7 @@
 #include "pdcp_sequence_manager.h"
 #include "LAYER2/RLC/rlc.h"
 #include "LAYER2/MAC/extern.h"
-#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
+#include "RRC/LITE/proto.h"
 #include "pdcp_primitives.h"
 #include "OCG.h"
 #include "OCG_extern.h"
@@ -111,6 +111,11 @@ boolean_t pdcp_data_req(
   VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDCP_DATA_REQ,VCD_FUNCTION_IN);
   CHECK_CTXT_ARGS(ctxt_pP);
 
+#if T_TRACER
+  if (ctxt_pP->enb_flag != ENB_FLAG_NO)
+    T(T_ENB_PDCP_DL, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->rnti), T_INT(rb_idP), T_INT(sdu_buffer_sizeP));
+#endif
+
   if (modeP == PDCP_TRANSMISSION_MODE_TRANSPARENT) {
     AssertError (rb_idP < NB_RB_MBMS_MAX, return FALSE, "RB id is too high (%u/%d) %u %u!\n", rb_idP, NB_RB_MBMS_MAX, ctxt_pP->module_id, ctxt_pP->rnti);
   } else {
@@ -458,6 +463,11 @@ pdcp_data_ind(
   LOG_F(PDCP,"\n");
 #endif
 
+#if T_TRACER
+  if (ctxt_pP->enb_flag != ENB_FLAG_NO)
+    T(T_ENB_PDCP_UL, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->rnti), T_INT(rb_idP), T_INT(sdu_buffer_sizeP));
+#endif
+
   if (MBMS_flagP) {
     AssertError (rb_idP < NB_RB_MBMS_MAX, return FALSE,
                  "RB id is too high (%u/%d) %u rnti %x!\n",
@@ -636,10 +646,10 @@ pdcp_data_ind(
         PROTOCOL_PDCP_CTXT_FMT" DATA-IND len %u",
         PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP, pdcp_p),
         sdu_buffer_sizeP - pdcp_header_len - pdcp_tailer_len);
-      pdcp_rrc_data_ind(ctxt_pP,
-                        rb_id,
-                        sdu_buffer_sizeP - pdcp_header_len - pdcp_tailer_len,
-                        (uint8_t*)&sdu_buffer_pP->data[pdcp_header_len]);
+      rrc_data_ind(ctxt_pP,
+		   rb_id,
+		   sdu_buffer_sizeP - pdcp_header_len - pdcp_tailer_len,
+		   (uint8_t*)&sdu_buffer_pP->data[pdcp_header_len]);
       free_mem_block(sdu_buffer_pP);
 
       // free_mem_block(new_sdu);
@@ -692,7 +702,7 @@ pdcp_data_ind(
 #if defined(USER_MODE) && defined(OAI_EMU)
 
   if (oai_emulation.info.otg_enabled == 1) {
-    unsigned int dst_instance;
+    //unsigned int dst_instance;
     int    ctime;
 
     if ((pdcp_p->rlc_mode == RLC_MODE_AM)&&(MBMS_flagP==0) ) {
@@ -1032,6 +1042,8 @@ pdcp_remove_UE(
 
   }
 
+  (void)h_rc; /* remove gcc warning "set but not used" */
+
   return 1;
 }
 
@@ -1486,7 +1498,7 @@ pdcp_config_req_asn1 (
 
   case CONFIG_ACTION_REMOVE:
     DevAssert(pdcp_pP != NULL);
-#warning "TODO pdcp_module_id_to_rnti"
+//#warning "TODO pdcp_module_id_to_rnti"
     //pdcp_module_id_to_rnti[ctxt_pP.module_id ][dst_id] = NOT_A_RNTI;
     LOG_D(PDCP, PROTOCOL_PDCP_CTXT_FMT" CONFIG_ACTION_REMOVE LCID %d RBID %d configured\n",
           PROTOCOL_PDCP_CTXT_ARGS(ctxt_pP,pdcp_pP),
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
index 787d463b32c1840f935469e9b92f7a26b495aac3..ea304f93ae94f49efb1f1a4ef8aab0743176bf8c 100755
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
@@ -313,6 +313,8 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const  ctxt_pP)
   hash_key_t                     key       = HASHTABLE_NOT_A_KEY_VALUE;
   hashtable_rc_t                 h_rc;
   struct pdcp_netlink_element_s* data_p    = NULL;
+  /* avoid gcc warnings */
+  (void)data_p;
   module_id_t                    ue_id     = 0;
   pdcp_t*                        pdcp_p    = NULL;
 # if defined(PDCP_USE_NETLINK_QUEUES)
@@ -482,7 +484,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const  ctxt_pP)
             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;
+            rab_id    = pdcp_read_header_g.rb_id  % maxDRB;
           }
 
           CHECK_CTXT_ARGS(&ctxt);
@@ -492,7 +494,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const  ctxt_pP)
                   pdcp_read_header_g.inst +  oai_emulation.info.first_enb_local;*/
 #else // OAI_EMU
           pdcp_read_header_g.inst = 0;
-#warning "TO DO CORRCT VALUES FOR ue mod id, enb mod id"
+//#warning "TO DO CORRCT VALUES FOR ue mod id, enb mod id"
           ctxt.frame         = ctxt_cpy.frame;
           ctxt.enb_flag      = ctxt_cpy.enb_flag;
 
@@ -565,7 +567,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const  ctxt_pP)
               }
             } else  { // rb_id =0, thus interpreated as broadcast and transported as multiple unicast
               // is a broadcast packet, we have to send this packet on all default RABS of all connected UEs
-#warning CODE TO BE REVIEWED, ONLY WORK FOR SIMPLE TOPOLOGY CASES
+//#warning CODE TO BE REVIEWED, ONLY WORK FOR SIMPLE TOPOLOGY CASES
               for (ue_id = 0; ue_id < NB_UE_INST; ue_id++) {
                 if (oai_emulation.info.eNB_ue_module_id_to_rnti[ctxt_cpy.module_id][ue_id] != NOT_A_RNTI) {
                   ctxt.rnti = oai_emulation.info.eNB_ue_module_id_to_rnti[ctxt_cpy.module_id][ue_id];
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c
index ec303172b01f05051fcd0f2927b60bfd9e5caaf1..fd8279579d031eef0fb7990f4a546aa30f959307 100755
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c
@@ -103,7 +103,7 @@ rlc_am_get_buffer_occupancy_in_bytes (
   }
 
 #endif
-  return rlc_pP->status_buffer_occupancy + rlc_pP->retransmission_buffer_occupancy + rlc_pP->sdu_buffer_occupancy + max_li_overhead + header_overhead;
+  return rlc_pP->status_buffer_occupancy + rlc_pP->retrans_num_bytes_to_retransmit + rlc_pP->sdu_buffer_occupancy + max_li_overhead + header_overhead;
 }
 //-----------------------------------------------------------------------------
 void
@@ -599,6 +599,7 @@ rlc_am_mac_status_indication (
 			  rlc_sn_t             sn_end       = (rlc->vt_a - 1) & RLC_AM_SN_MASK;
 			  int                  found_pdu    = 0;
 			  rlc_sn_t             found_pdu_sn = 0; // avoid warning
+                          (void)found_pdu_sn; /* avoid gcc warning "set but not used" */
 
 
 			  while (sn != sn_end) {
@@ -681,6 +682,12 @@ rlc_am_mac_data_request (
   MessageDef         *msg_p;
 #   endif
   int                 octet_index, index;
+  /* for no gcc warnings */
+  (void)num_nack;
+  (void)message_string;
+  (void)message_string_size;
+  (void)octet_index;
+  (void)index;
 #endif
 
   list_init (&data_req.data, NULL);
@@ -915,8 +922,16 @@ rlc_am_mac_data_indication (
   MessageDef         *msg_p;
 #   endif
   int                 octet_index, index;
+  /* for no gcc warnings */
+  (void)num_nack;
+  (void)message_string;
+  (void)message_string_size;
+  (void)octet_index;
+  (void)index;
 #endif
 
+  (void)l_rlc_p; /* avoid gcc warning "unused variable" */
+
 #if TRACE_RLC_AM_PDU || MESSAGE_CHART_GENERATOR
 
   if (data_indP.data.nb_elements > 0) {
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.c
index eb2d0c5acac5732dff177ff4606b942e86b59f98..81645f06fef44af1590adc1e1cf0dd4b1ae27170 100755
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.c
@@ -57,7 +57,7 @@ rlc_am_init(
 
     pthread_mutex_init(&rlc_pP->lock_input_sdus, NULL);
     rlc_pP->input_sdus               = calloc(1, RLC_AM_SDU_CONTROL_BUFFER_SIZE*sizeof(rlc_am_tx_sdu_management_t));
-#warning "cast the rlc retrans buffer to uint32"
+//#warning "cast the rlc retrans buffer to uint32"
     //        rlc_pP->pdu_retrans_buffer       = calloc(1, (uint16_t)((unsigned int)RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE*(unsigned int)sizeof(rlc_am_tx_data_pdu_management_t)));
     rlc_pP->pdu_retrans_buffer       = calloc(1, (uint32_t)((unsigned int)RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE*(unsigned int)sizeof(
                                          rlc_am_tx_data_pdu_management_t)));
@@ -114,7 +114,7 @@ rlc_am_reestablish(
   LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[AM REESTABLISH] RE-INIT STATE VARIABLES, BUFFERS, LISTS\n",
         PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
 
-#warning TODO when possible reassemble RLC SDUs from any byte segments of AMD PDUs with SN inf VR(MR)
+//#warning TODO when possible reassemble RLC SDUs from any byte segments of AMD PDUs with SN inf VR(MR)
   list2_free(&rlc_pP->receiver_buffer);
 
   list_free(&rlc_pP->pdus_to_mac_layer);
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c
index e2dda28f957654dbb2295cf190253469fa0a13a0..18ff9a8ad43304de8d3213982d47d22e0ba74769 100755
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c
@@ -516,7 +516,7 @@ void rlc_am_segment_10 (
 
     pdu_tb_req_p->data_ptr        = (unsigned char*)pdu_p;
     pdu_tb_req_p->tb_size         = data_pdu_size - pdu_remaining_size;
-#warning "why 3000: changed to RLC_SDU_MAX_SIZE "
+//#warning "why 3000: changed to RLC_SDU_MAX_SIZE "
     assert(pdu_tb_req_p->tb_size < RLC_SDU_MAX_SIZE );
     rlc_am_pdu_polling(ctxt_pP, rlc_pP, pdu_p, pdu_mngt_p->payload_size);
 
diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c
index 8aab33f54c69677b4e844e0de8c2232879d9d651..7b0c9890ed435ec03ba5f5935b57c2b718770f01 100755
--- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c
+++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c
@@ -745,7 +745,7 @@ rlc_um_data_req (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP, mem_block_t
     /*
      * Print every single octet in hexadecimal form
      */
-    message_string_size += sprintf(&message_string[message_string_size], " %02x", (uint8_t*)(&sdu_pP->data[data_offset])[octet_index]);
+    message_string_size += sprintf(&message_string[message_string_size], " %02x", ((uint8_t*)(&sdu_pP->data[data_offset]))[octet_index]);
     /*
      * Align newline and pipes according to the octets in groups of 2
      */
diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.c
index b2930e62966a59650ee330ab67514d2d4da7f838..881dc9b99338944a03e73e4369b2e959be5a613f 100644
--- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.c
+++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_dar.c
@@ -37,7 +37,6 @@
 #include "rlc_primitives.h"
 #include "mac_primitives.h"
 #include "list.h"
-#include "MAC_INTERFACE/extern.h"
 #include "UTIL/LOG/log.h"
 #include "UTIL/LOG/vcd_signal_dumper.h"
 
diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_receiver.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_receiver.c
index 085f37e4c1bbeb5e5767bb14ef2d8ffc8b4273a6..6ea07a4677df3e406a89c0116e6e7f1c8c06e6d3 100755
--- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_receiver.c
+++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_receiver.c
@@ -36,7 +36,6 @@
 #include "rlc_primitives.h"
 #include "mac_primitives.h"
 #include "list.h"
-#include "MAC_INTERFACE/extern.h"
 #include "UTIL/LOG/log.h"
 
 //-----------------------------------------------------------------------------
diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c
index a31f99091652ee742330547965d729dbfad6230a..24890bf957d0ae6519bf8560f11a9bcd8d735b90 100755
--- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c
+++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_segment.c
@@ -40,7 +40,6 @@
 #include "list.h"
 #include "rlc_um.h"
 #include "rlc_primitives.h"
-#include "MAC_INTERFACE/extern.h"
 #include "UTIL/LOG/log.h"
 
 //-----------------------------------------------------------------------------
diff --git a/openair2/LAYER2/RLC/rlc.c b/openair2/LAYER2/RLC/rlc.c
index e19c6b0b0abbb05e0287d6d6d6718550a3b9bf2f..af0fe468754f620a67d0bcdc3e9a53824bcef680 100644
--- a/openair2/LAYER2/RLC/rlc.c
+++ b/openair2/LAYER2/RLC/rlc.c
@@ -359,6 +359,11 @@ rlc_op_status_t rlc_data_req     (const protocol_ctxt_t* const ctxt_pP,
 
 #endif
 
+#if T_TRACER
+  if (ctxt_pP->enb_flag)
+    T(T_ENB_RLC_DL, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->rnti), T_INT(rb_idP), T_INT(sdu_sizeP));
+#endif
+
   if (MBMS_flagP) {
     AssertFatal (rb_idP < NB_RB_MBMS_MAX, "RB id is too high (%u/%d)!\n", rb_idP, NB_RB_MBMS_MAX);
   } else {
@@ -571,6 +576,12 @@ void rlc_data_ind     (
   rlc_util_print_hex_octets(RLC, (unsigned char*)sdu_pP->data, sdu_sizeP);
 #endif
 
+#if T_TRACER
+  if (ctxt_pP->enb_flag)
+    T(T_ENB_RLC_UL, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->rnti), T_INT(rb_idP), T_INT(sdu_sizeP));
+#endif
+
+
   pdcp_data_ind (
     ctxt_pP,
     srb_flagP,
@@ -602,6 +613,9 @@ rlc_module_init (void)
   int          k;
   module_id_t  module_id1;
 
+  /* for no gcc warnings */
+  (void)k;
+
   LOG_D(RLC, "MODULE INIT\n");
   rlc_rrc_data_ind  = NULL;
   rlc_rrc_data_conf = NULL;
diff --git a/openair2/LAYER2/RLC/rlc.h b/openair2/LAYER2/RLC/rlc.h
index 392ae88cf8577c94dbf639c6b2c726e02432d5b8..72fde0b7468bedf9d4c0bebe9db80d5974c6d531 100755
--- a/openair2/LAYER2/RLC/rlc.h
+++ b/openair2/LAYER2/RLC/rlc.h
@@ -60,6 +60,8 @@
 #    include "DRB-ToAddModList.h"
 #    include "SRB-ToAddMod.h"
 #    include "SRB-ToAddModList.h"
+#    include "DRB-ToReleaseList.h"
+
 #ifdef Rel10
 #include "PMCH-InfoList-r9.h"
 #endif
diff --git a/openair2/LAYER2/RLC/rlc_mac.c b/openair2/LAYER2/RLC/rlc_mac.c
index 73f323f14b2013844ca2d7239436c1a011925cc1..3bde40888fe1ebc3fbc6d571c3ebf4296ddddb05 100644
--- a/openair2/LAYER2/RLC/rlc_mac.c
+++ b/openair2/LAYER2/RLC/rlc_mac.c
@@ -221,6 +221,11 @@ tbs_size_t mac_rlc_data_req(
     ;
   }
 
+#if T_TRACER
+  if (enb_flagP)
+    T(T_ENB_RLC_MAC_DL, T_INT(module_idP), T_INT(rntiP), T_INT(channel_idP), T_INT(ret_tb_size));
+#endif
+
   VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_MAC_RLC_DATA_REQ,VCD_FUNCTION_OUT);
   return ret_tb_size;
 }
@@ -276,6 +281,10 @@ void mac_rlc_data_ind     (
 
 #endif
 
+#if T_TRACER
+  if (enb_flagP)
+    T(T_ENB_RLC_MAC_UL, T_INT(module_idP), T_INT(rntiP), T_INT(channel_idP), T_INT(tb_sizeP));
+#endif
 
   if (MBMS_flagP) {
     if (BOOL_NOT(enb_flagP)) {
diff --git a/openair2/LAYER2/RLC/rlc_rrc.c b/openair2/LAYER2/RLC/rlc_rrc.c
index 05ad79d7d4fd85d7bc5fb34844071ba990ae8e05..eccea461abac6c1b31b61abf40a2017a77fe6999 100644
--- a/openair2/LAYER2/RLC/rlc_rrc.c
+++ b/openair2/LAYER2/RLC/rlc_rrc.c
@@ -87,6 +87,11 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t   * const ctxt_pP
 
 #endif
 
+  /* for no gcc warnings */
+  (void)rlc_union_p;
+  (void)key;
+  (void)h_rc;
+
   LOG_D(RLC, PROTOCOL_CTXT_FMT" CONFIG REQ ASN1 \n",
         PROTOCOL_CTXT_ARGS(ctxt_pP));
 
@@ -196,7 +201,7 @@ rlc_op_status_t rrc_rlc_config_asn1_req (const protocol_ctxt_t   * const ctxt_pP
           break;
 
         case SRB_ToAddMod__rlc_Config_PR_defaultValue:
-#warning TO DO SRB_ToAddMod__rlc_Config_PR_defaultValue
+//#warning TO DO SRB_ToAddMod__rlc_Config_PR_defaultValue
           if (rrc_rlc_add_rlc   (ctxt_pP, SRB_FLAG_YES, MBMS_FLAG_NO, rb_id, lc_id, RLC_MODE_UM) != NULL) {
             config_req_rlc_um_asn1(
               ctxt_pP,
@@ -463,6 +468,9 @@ rlc_op_status_t rrc_rlc_remove_rlc   (
 
 #endif
 
+  /* for no gcc warnings */
+  (void)lcid;
+
 #ifdef Rel10
 
   if (MBMS_flagP == TRUE) {
@@ -634,7 +642,7 @@ rlc_op_status_t rrc_rlc_config_req   (
   const rlc_info_t      rlc_infoP)
 {
   //-----------------------------------------------------------------------------
-  rlc_op_status_t status;
+  //rlc_op_status_t status;
 
   LOG_D(RLC, PROTOCOL_CTXT_FMT" CONFIG_REQ for RAB %u\n",
         PROTOCOL_CTXT_ARGS(ctxt_pP),
diff --git a/openair2/LAYER2/openair2_proc.c b/openair2/LAYER2/openair2_proc.c
index 35684d239aa548b0d5937ccd205dc621c7d60255..8daa8afb70374907254f70e6e54ffec00e5aa789 100644
--- a/openair2/LAYER2/openair2_proc.c
+++ b/openair2/LAYER2/openair2_proc.c
@@ -74,7 +74,7 @@ int dump_eNB_l2_stats(char *buffer, int length)
   int eNB_id,UE_id,number_of_cards;
   int len= length;
   int CC_id=0;
-  int i,j;
+  int i;
   protocol_ctxt_t      ctxt;
   rlc_op_status_t rlc_status;
   unsigned int stat_rlc_mode;
@@ -150,7 +150,7 @@ int dump_eNB_l2_stats(char *buffer, int length)
                      eNB->eNB_stats[CC_id].dlsch_pdus_tx,
                      eNB->eNB_stats[CC_id].total_dlsch_pdus_tx);
 
-      len += sprintf(&buffer[len],"ULSCH bitrate (TTI %u, avg %u) kbps, Received bytes (TTI %u, total %u), Received PDU (TTI %u, total %lu) \n",
+      len += sprintf(&buffer[len],"ULSCH bitrate (TTI %u, avg %u) kbps, Received bytes (TTI %u, total %u), Received PDU (TTI %lu, total %u) \n",
                      eNB->eNB_stats[CC_id].ulsch_bitrate,
                      eNB->eNB_stats[CC_id].total_ulsch_bitrate,
                      eNB->eNB_stats[CC_id].ulsch_bytes_rx,
@@ -201,9 +201,11 @@ int dump_eNB_l2_stats(char *buffer, int length)
                        UE_list->eNB_UE_stats[CC_id][UE_id].avg_overhead_bytes
                       );
         
-	len += sprintf(&buffer[len],"[MAC] UE %d (ULSCH), Status %d, RNTI %x : rx power (normalized %d,  target %d), MCS (pre %d, post %d), RB (rx %d, retx %d, total %d), Current TBS %d \n",
+
+	len += sprintf(&buffer[len],"[MAC] UE %d (ULSCH), Status %s, Failute timer %d, RNTI %x : rx power (normalized %d,  target %d), MCS (pre %d, post %d), RB (rx %d, retx %d, total %d), Current TBS %d \n",
                        UE_id,
                        map_int_to_str(rrc_status_names, UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status),
+		       UE_list->UE_sched_ctrl[UE_id].ul_failure_timer,
                        UE_list->eNB_UE_stats[CC_id][UE_id].crnti,
 		       UE_list->eNB_UE_stats[CC_id][UE_id].normalized_rx_power,
 		       UE_list->eNB_UE_stats[CC_id][UE_id].target_rx_power,
diff --git a/openair2/PHY_INTERFACE/defs.h b/openair2/PHY_INTERFACE/defs.h
index 8a0342e744fdf916ab00acb78d8cb22f30e03090..9274f82e91f46deaf78f712c5ee31ea112497e51 100755
--- a/openair2/PHY_INTERFACE/defs.h
+++ b/openair2/PHY_INTERFACE/defs.h
@@ -94,7 +94,8 @@ typedef struct {
 
   /// Indicate Scheduling Request from UE
   void (*SR_indication)(module_id_t Mod_id,int CC_id,frame_t frameP,rnti_t rnti,sub_frame_t subframe);
-
+  /// Indicate UL Failure to eNodeB MAC
+  void (*UL_failure_indication)(module_id_t Mod_id,int CC_id,frame_t frameP,rnti_t rnti,sub_frame_t subframe);
   /// Configure Common PHY parameters from SIB1
   void (*phy_config_sib1_eNB)(module_id_t Mod_id,int CC_id,
                               TDD_Config_t *tdd_config,
@@ -133,7 +134,6 @@ typedef struct {
   /// get delta mcs for fast UL AMC
   int16_t (*estimate_ue_tx_power)(uint32_t tbs, uint32_t nb_rb, uint8_t control_only, lte_prefix_type_t ncp, uint8_t use_srs);
 
-
 #if Rel10
   /// set/unset Carrier Aggregation configuration of an UE
   void (*ca_config)(uint8_t  Mod_id,
@@ -146,6 +146,8 @@ typedef struct {
                       uint8_t  activation_bitfield);
 #endif
 
+  int (*mac_phy_remove_ue)(module_id_t Mod_idP,rnti_t rntiP);
+
   /// UE functions
 
   /// reset the ue phy
@@ -250,19 +252,27 @@ typedef struct {
   int (*get_ue_active_harq_pid)(module_id_t Mod_id, uint8_t CC_id,rnti_t rnti, int frame, uint8_t subframe, uint8_t *harq_pid, uint8_t *round, uint8_t ul_flag);
 
   /// Function to retrieve number of CCE
-  uint16_t (*get_nCCE_max)(module_id_t Mod_id,uint8_t  CC_id);
+  uint16_t (*get_nCCE_max)(module_id_t Mod_id,uint8_t  CC_id,int num_pdcch_symbols,int subframe);
 
-  /// Function to get the CCE offset
-  int (*get_nCCE_offset)(unsigned char L, int nCCE, int common_dci, unsigned short rnti, unsigned char subframe);
+
+  int (*get_nCCE_offset)(int *CCE_table,
+                         const unsigned char L,
+                         const int nCCE,
+                         const int common_dci,
+                         const unsigned short rnti,
+                         const unsigned char subframe);
 
   /// Function to retrieve number of PRB in an rb_alloc
   uint32_t (*get_nb_rb)(uint8_t ra_header, uint32_t rb_alloc, int n_rb_dl);
 
+  /// Function to convert VRB to PRB for distributed allocation
+  uint32_t (*get_prb)(int N_RB_DL,int odd_slot,int vrb,int Ngap);
+
   /// Function to retrieve transmission mode for UE
   uint8_t (*get_transmission_mode)(module_id_t Mod_id,uint8_t CC_id,rnti_t rnti);
 
   /// Function to retrieve rb_alloc bitmap from dci rballoc field and VRB type
-  uint32_t (*get_rballoc)(uint8_t vrb_type, uint16_t rb_alloc_dci);
+  uint32_t (*get_rballoc)(vrb_t vrb_type, uint16_t rb_alloc_dci);
 
   /// Function for UE MAC to retrieve current PHY connectivity mode (PRACH,RA_RESPONSE,PUSCH)
   UE_MODE_t (*get_ue_mode)(module_id_t Mod_id, uint8_t CC_id,uint8_t eNB_index);
@@ -324,8 +334,9 @@ typedef struct {
 
   /// get the delta TF for Uplink Power Control Calculation
   int16_t (*get_hundred_times_delta_TF) (module_id_t module_idP, uint8_t CC_id, rnti_t rnti, uint8_t harq_pid);
-  /// get target uplink received power 
+  /// get target PUSCH received power 
   int16_t (*get_target_pusch_rx_power) (module_id_t module_idP, uint8_t CC_id);
+  /// get target PUSCH received power 
   int16_t (*get_target_pucch_rx_power) (module_id_t module_idP, uint8_t CC_id);
 
   unsigned char is_cluster_head;
diff --git a/openair2/RRC/L2_INTERFACE/openair_rrc_L2_interface.c b/openair2/RRC/L2_INTERFACE/openair_rrc_L2_interface.c
index 732d2aa54adff971b7b52948d378ef2cdda8eeb1..702433744d23e2003db7395bedb240cfc57e5ba3 100644
--- a/openair2/RRC/L2_INTERFACE/openair_rrc_L2_interface.c
+++ b/openair2/RRC/L2_INTERFACE/openair_rrc_L2_interface.c
@@ -155,10 +155,10 @@ rlcrrc_data_ind(
 )
 //------------------------------------------------------------------------------
 {
-  rrc_lite_data_ind(ctxt_pP,
-                    srb_idP,
-                    sdu_lenP,
-                    buffer_pP);
+  rrc_data_ind(ctxt_pP,
+	       srb_idP,
+	       sdu_lenP,
+	       buffer_pP);
 }
 
 //------------------------------------------------------------------------------
diff --git a/openair2/RRC/LITE/L2_interface.c b/openair2/RRC/LITE/L2_interface.c
index 6a64095e92a48020d95612add215cde07d726e81..d4ddd0e7abb66d82412eaa47369d9c2882b297a5 100644
--- a/openair2/RRC/LITE/L2_interface.c
+++ b/openair2/RRC/LITE/L2_interface.c
@@ -67,7 +67,7 @@ mui_t mui=0;
 
 //------------------------------------------------------------------------------
 int8_t
-mac_rrc_lite_data_req(
+mac_rrc_data_req(
   const module_id_t Mod_idP,
   const int         CC_id,
   const frame_t     frameP,
@@ -98,7 +98,7 @@ mac_rrc_lite_data_req(
       // All even frames transmit SIB in SF 5
       if (eNB_rrc_inst[Mod_idP].carrier[CC_id].sizeof_SIB1 == 255) {
         LOG_E(RRC,"[eNB %d] MAC Request for SIB1 and SIB1 not initialized\n",Mod_idP);
-        mac_xface->macphy_exit("mac_rrc_lite_data_req:  MAC Request for SIB1 and SIB1 not initialized");
+        mac_xface->macphy_exit("mac_rrc_data_req:  MAC Request for SIB1 and SIB1 not initialized");
       }
 
       if ((frameP%2) == 0) {
@@ -337,7 +337,7 @@ mac_rrc_lite_data_req(
 
 //------------------------------------------------------------------------------
 int8_t
-mac_rrc_lite_data_ind(
+mac_rrc_data_ind(
   const module_id_t     module_idP,
   const int             CC_id,
   const frame_t         frameP,
@@ -355,6 +355,10 @@ mac_rrc_lite_data_ind(
   SRB_INFO *Srb_info;
   protocol_ctxt_t ctxt;
   sdu_size_t      sdu_size = 0;
+
+  /* for no gcc warnings */
+  (void)sdu_size;
+
   /*
   int si_window;
    */
@@ -389,7 +393,7 @@ mac_rrc_lite_data_ind(
         itti_send_msg_to_task (TASK_RRC_UE, ctxt.instance, message_p);
       }
 #else
-      decode_BCCH_DLSCH_Message(&ctxt,eNB_indexP,sduP,sdu_lenP, 0, 0);
+      decode_BCCH_DLSCH_Message(&ctxt,eNB_indexP,(uint8_t*)sduP,sdu_lenP, 0, 0);
 #endif
     }
 
@@ -505,14 +509,14 @@ mac_rrc_lite_data_ind(
 
 //-------------------------------------------------------------------------------------------//
 // this function is Not USED anymore
-void mac_lite_sync_ind(module_id_t Mod_idP,uint8_t Status)
+void mac_sync_ind(module_id_t Mod_idP,uint8_t Status)
 {
   //-------------------------------------------------------------------------------------------//
 }
 
 //------------------------------------------------------------------------------
 uint8_t
-rrc_lite_data_req(
+rrc_data_req(
   const protocol_ctxt_t*   const ctxt_pP,
   const rb_id_t                  rb_idP,
   const mui_t                    muiP,
@@ -582,7 +586,7 @@ rrc_lite_data_req(
 
 //------------------------------------------------------------------------------
 void
-rrc_lite_data_ind(
+rrc_data_ind(
   const protocol_ctxt_t* const ctxt_pP,
   const rb_id_t                Srb_id,
   const sdu_size_t             sdu_sizeP,
@@ -634,7 +638,7 @@ rrc_lite_data_ind(
       buffer_pP,
       sdu_sizeP);
   } else {
-#warning "LG put 0 to arg4 that is eNB index"
+//#warning "LG put 0 to arg4 that is eNB index"
     rrc_ue_decode_dcch(
       ctxt_pP,
       DCCH_index,
@@ -646,7 +650,7 @@ rrc_lite_data_ind(
 }
 
 //-------------------------------------------------------------------------------------------//
-void rrc_lite_in_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_index)
+void rrc_in_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_index)
 {
   //-------------------------------------------------------------------------------------------//
 #if defined(ENABLE_ITTI)
@@ -670,7 +674,7 @@ void rrc_lite_in_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_inde
 }
 
 //-------------------------------------------------------------------------------------------//
-void rrc_lite_out_of_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_index)
+void rrc_out_of_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_index)
 {
   //-------------------------------------------------------------------------------------------//
   LOG_I(RRC,"[UE %d] Frame %d: OUT OF SYNC FROM eNB %d (T310 active %d : T310 %d, N310 %d, N311 %d)\n ",
@@ -697,7 +701,7 @@ void rrc_lite_out_of_sync_ind(module_id_t Mod_idP, frame_t frameP, uint16_t eNB_
 
 //------------------------------------------------------------------------------
 int
-mac_eNB_get_rrc_lite_status(
+mac_eNB_get_rrc_status(
   const module_id_t Mod_idP,
   const rnti_t      rntiP
 )
@@ -715,10 +719,50 @@ mac_eNB_get_rrc_lite_status(
   }
 }
 
+void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP,
+			    const int CC_idP,
+			    const frame_t frameP,
+			    const sub_frame_t subframeP,
+			    const rnti_t rntiP)
+{
+  struct rrc_eNB_ue_context_s* ue_context_p = NULL;
+  ue_context_p = rrc_eNB_get_ue_context(
+                   &eNB_rrc_inst[Mod_instP],
+                   rntiP);
+
+  if (ue_context_p != NULL) {
+    LOG_I(RRC,"Frame %d, Subframe %d: UE %x UL failure, activating timer\n",frameP,subframeP,rntiP);
+    ue_context_p->ue_context.ul_failure_timer=1;
+  }
+  else {
+    LOG_W(RRC,"Frame %d, Subframe %d: UL failure: UE %x unknown \n",frameP,subframeP,rntiP);
+  }
+  rrc_mac_remove_ue(Mod_instP,rntiP);
+}
+
+void mac_eNB_rrc_ul_in_sync(const module_id_t Mod_instP, 
+			    const int CC_idP, 
+			    const frame_t frameP,
+			    const sub_frame_t subframeP,
+			    const rnti_t rntiP)
+{
+  struct rrc_eNB_ue_context_s* ue_context_p = NULL;
+  ue_context_p = rrc_eNB_get_ue_context(
+                   &eNB_rrc_inst[Mod_instP],
+                   rntiP);
 
+  if (ue_context_p != NULL) {
+    LOG_I(RRC,"Frame %d, Subframe %d: UE %x to UL in synch\n",
+          frameP, subframeP, rntiP);
+    ue_context_p->ue_context.ul_failure_timer = 0;
+  } else {
+    LOG_E(RRC,"Frame %d, Subframe %d: UE %x unknown \n",
+          frameP, subframeP, rntiP);
+  }
+}
 //------------------------------------------------------------------------------
 int
-mac_UE_get_rrc_lite_status(
+mac_UE_get_rrc_status(
   const module_id_t Mod_idP,
   const uint8_t     indexP
 )
diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c
index 981222c43c46ab439aad11fe3c0eadcb6cda1282..eb70b45f751a0ebe4ed85c505c33ac39cad0bda2 100644
--- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c
+++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c
@@ -2140,6 +2140,67 @@ do_RRCConnectionReestablishmentReject(
   return((enc_rval.encoded+7)/8);
 }
 
+//------------------------------------------------------------------------------
+uint8_t
+do_RRCConnectionReject(
+  uint8_t                    Mod_id,
+  uint8_t*                   const buffer)
+//------------------------------------------------------------------------------
+{
+
+  asn_enc_rval_t enc_rval;
+
+  DL_CCCH_Message_t dl_ccch_msg;
+  RRCConnectionReject_t *rrcConnectionReject;
+
+  memset((void *)&dl_ccch_msg,0,sizeof(DL_CCCH_Message_t));
+  dl_ccch_msg.message.present           = DL_CCCH_MessageType_PR_c1;
+  dl_ccch_msg.message.choice.c1.present = DL_CCCH_MessageType__c1_PR_rrcConnectionReject;
+  rrcConnectionReject                   = &dl_ccch_msg.message.choice.c1.choice.rrcConnectionReject;
+
+  // RRCConnectionReject
+  rrcConnectionReject->criticalExtensions.present = RRCConnectionReject__criticalExtensions_PR_c1;
+  rrcConnectionReject->criticalExtensions.choice.c1.present = RRCConnectionReject__criticalExtensions__c1_PR_rrcConnectionReject_r8;
+  /* let's put a wait time of 1s for the moment */
+  rrcConnectionReject->criticalExtensions.choice.c1.choice.rrcConnectionReject_r8.waitTime = 1;
+
+#ifdef XER_PRINT
+  xer_fprint(stdout, &asn_DEF_DL_CCCH_Message, (void*)&dl_ccch_msg);
+#endif
+  enc_rval = uper_encode_to_buffer(&asn_DEF_DL_CCCH_Message,
+                                   (void*)&dl_ccch_msg,
+                                   buffer,
+                                   100);
+  AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %ld)!\n",
+               enc_rval.failed_type->name, enc_rval.encoded);
+
+#if defined(ENABLE_ITTI)
+# if !defined(DISABLE_XER_SPRINT)
+  {
+    char        message_string[20000];
+    size_t      message_string_size;
+
+    if ((message_string_size = xer_sprint(message_string, sizeof(message_string), &asn_DEF_DL_CCCH_Message, (void *) &dl_ccch_msg)) > 0) {
+      MessageDef *msg_p;
+
+      msg_p = itti_alloc_new_message_sized (TASK_RRC_ENB, RRC_DL_CCCH, message_string_size + sizeof (IttiMsgText));
+      msg_p->ittiMsg.rrc_dl_ccch.size = message_string_size;
+      memcpy(&msg_p->ittiMsg.rrc_dl_ccch.text, message_string, message_string_size);
+
+      itti_send_msg_to_task(TASK_UNKNOWN, Mod_id, msg_p);
+    }
+  }
+# endif
+#endif
+
+#ifdef USER_MODE
+  LOG_D(RRC,"RRCConnectionReject Encoded %d bits (%d bytes)\n",
+        enc_rval.encoded,(enc_rval.encoded+7)/8);
+#endif
+
+  return((enc_rval.encoded+7)/8);
+}
+
 uint8_t do_RRCConnectionRelease(
   uint8_t                             Mod_id,
   uint8_t                            *buffer,
diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.h b/openair2/RRC/LITE/MESSAGES/asn1_msg.h
index b5747cb94bc28d908bc9ab2c321246207535c070..9c5e72293a931ed70e738373867b67f538fe437a 100644
--- a/openair2/RRC/LITE/MESSAGES/asn1_msg.h
+++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.h
@@ -218,6 +218,16 @@ do_RRCConnectionReestablishmentReject(
     uint8_t                    Mod_id,
     uint8_t*                   const buffer);
 
+/**
+\brief Generate an RRCConnectionReject DL-CCCH-Message (eNB).
+@param Mod_id Module ID of eNB
+@param buffer Pointer to PER-encoded ASN.1 description of DL-CCCH-Message PDU
+@returns Size of encoded bit stream in bytes*/
+uint8_t
+do_RRCConnectionReject(
+    uint8_t                    Mod_id,
+    uint8_t*                   const buffer);
+
 /**
 \brief Generate an RRCConnectionRequest UL-CCCH-Message (UE) based on random string or S-TMSI.  This
 routine only generates an mo-data establishment cause.
diff --git a/openair2/RRC/LITE/MESSAGES/asn1c/asn1cpatch.p0 b/openair2/RRC/LITE/MESSAGES/asn1c/asn1cpatch.p0
deleted file mode 100644
index 18dc516285b45214f9dd88598ce8ed08753a7588..0000000000000000000000000000000000000000
--- a/openair2/RRC/LITE/MESSAGES/asn1c/asn1cpatch.p0
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: skeletons/per_opentype.c
-===================================================================
---- skeletons/per_opentype.c	(revision 1516)
-+++ skeletons/per_opentype.c	(working copy)
-@@ -277,7 +306,7 @@
- 	(void)constraints;
- 	(void)sptr;
- 
--	while(per_get_few_bits(pd, 24) >= 0);
-+	while(per_get_few_bits(pd, 1 /*24*/) >= 0);
- 
- 	rv.code = RC_OK;
- 	rv.consumed = pd->moved;
diff --git a/openair2/RRC/LITE/defs.h b/openair2/RRC/LITE/defs.h
index b11333b65d1daaf664485c2126d04289da941484..dcd4c09bac5d9c8b6a7afce05c54e3f795a59cfa 100644
--- a/openair2/RRC/LITE/defs.h
+++ b/openair2/RRC/LITE/defs.h
@@ -212,9 +212,9 @@ typedef struct UE_RRC_INFO_s {
 } __attribute__ ((__packed__)) UE_RRC_INFO;
 
 typedef struct UE_S_TMSI_s {
-  uint8_t  presence;
-  uint8_t  mme_code;
-  uint32_t m_tmsi;
+  boolean_t  presence;
+  mme_code_t mme_code;
+  m_tmsi_t   m_tmsi;
 } __attribute__ ((__packed__)) UE_S_TMSI;
 
 #if defined(ENABLE_ITTI)
@@ -385,6 +385,8 @@ typedef struct eNB_RRC_UE_s {
   transport_layer_addr_t             enb_gtp_addrs[S1AP_MAX_E_RAB];
   rb_id_t                            enb_gtp_ebi[S1AP_MAX_E_RAB];
 #endif
+  uint32_t                           ul_failure_timer;
+  uint32_t                           ue_release_timer;
 } eNB_RRC_UE_t;
 
 typedef uid_t ue_uid_t;
diff --git a/openair2/RRC/LITE/proto.h b/openair2/RRC/LITE/proto.h
index 8475b1e94de0ece9fd2261d80a6e9bc8b73d485d..cdf6f33f768845d9da674e2da245f9bf83e689ff 100644
--- a/openair2/RRC/LITE/proto.h
+++ b/openair2/RRC/LITE/proto.h
@@ -38,21 +38,23 @@
  *  @{
  */
 
+#include "RRC/LITE/defs.h"
+
 //main.c
 int rrc_init_global_param(void);
 int L3_xface_init(void);
 void openair_rrc_top_init(int eMBMS_active, char *uecap_xer, uint8_t cba_group_active,uint8_t HO_enabled);
 #if defined(ENABLE_ITTI)
 char
-openair_rrc_lite_eNB_configuration(
+openair_rrc_eNB_configuration(
   const module_id_t enb_mod_idP,
   RrcConfigurationReq* configuration
 );
 #endif
-char openair_rrc_lite_eNB_init(
+char openair_rrc_eNB_init(
   const module_id_t module_idP);
 
-char openair_rrc_lite_ue_init(
+char openair_rrc_ue_init(
   const module_id_t module_idP,
   const uint8_t CH_IDX);
 void rrc_config_buffer(SRB_INFO *srb_info, uint8_t Lchan_type, uint8_t Role);
@@ -284,7 +286,7 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
 
 //L2_interface.c
 int8_t
-mac_rrc_lite_data_req(
+mac_rrc_data_req(
   const module_id_t Mod_idP,
   const int         CC_id,
   const frame_t     frameP,
@@ -297,7 +299,7 @@ mac_rrc_lite_data_req(
 );
 
 int8_t
-mac_rrc_lite_data_ind(
+mac_rrc_data_ind(
   const module_id_t     module_idP,
   const int         CC_id,
   const frame_t         frameP,
@@ -313,8 +315,20 @@ mac_rrc_lite_data_ind(
 
 void mac_sync_ind( module_id_t Mod_instP, uint8_t status);
 
+void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP, 
+			    const int CC_id, 
+			    const frame_t frameP,
+			    const sub_frame_t subframeP,
+			    const rnti_t rnti);
+
+void mac_eNB_rrc_ul_in_sync(const module_id_t Mod_instP, 
+			    const int CC_id, 
+			    const frame_t frameP,
+			    const sub_frame_t subframeP,
+			    const rnti_t rnti);
+
 uint8_t
-rrc_lite_data_req(
+rrc_data_req(
   const protocol_ctxt_t*   const ctxt_pP,
   const rb_id_t                  rb_idP,
   const mui_t                    muiP,
@@ -325,16 +339,16 @@ rrc_lite_data_req(
 );
 
 void
-rrc_lite_data_ind(
+rrc_data_ind(
   const protocol_ctxt_t* const ctxt_pP,
   const rb_id_t                Srb_id,
   const sdu_size_t             sdu_sizeP,
   const uint8_t*   const       buffer_pP
 );
 
-void rrc_lite_in_sync_ind(module_id_t module_idP, frame_t frameP, uint16_t eNB_index);
+void rrc_in_sync_ind(module_id_t module_idP, frame_t frameP, uint16_t eNB_index);
 
-void rrc_lite_out_of_sync_ind(module_id_t module_idP, frame_t frameP, unsigned short eNB_index);
+void rrc_out_of_sync_ind(module_id_t module_idP, frame_t frameP, unsigned short eNB_index);
 
 int decode_MCCH_Message( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index, const uint8_t* const Sdu, const uint8_t Sdu_len, const uint8_t mbsfn_sync_area );
 
@@ -359,13 +373,13 @@ ue_measurement_report_triggering(
 );
 
 int
-mac_eNB_get_rrc_lite_status(
+mac_eNB_get_rrc_status(
   const module_id_t Mod_idP,
   const rnti_t      rntiP
 );
 
 int
-mac_UE_get_rrc_lite_status(
+mac_UE_get_rrc_status(
   const module_id_t Mod_idP,
   const uint8_t     indexP
 );
@@ -430,10 +444,8 @@ rrc_eNB_free_mem_UE_context(
 
 void
 rrc_eNB_free_UE(
-  const module_id_t enb_mod_idP,
-  const rnti_t      rntiP,
-  const frame_t     frameP,
-  const sub_frame_t subframeP
+		const module_id_t enb_mod_idP,
+		const struct rrc_eNB_ue_context_s*         const ue_context_pP
 );
 
 long binary_search_int(int elements[], long numElem, int value);
diff --git a/openair2/RRC/LITE/rrc_UE.c b/openair2/RRC/LITE/rrc_UE.c
index a919a055f287ef9b7916c92759c475e9e2dc4aec..01c1ee6ca90489ee55afe0c4f5502c5ced82599e 100644
--- a/openair2/RRC/LITE/rrc_UE.c
+++ b/openair2/RRC/LITE/rrc_UE.c
@@ -141,7 +141,9 @@ static uint8_t check_trigger_meas_event(
   Q_OffsetRange_t ofn, Q_OffsetRange_t ocn, Hysteresis_t hys,
   Q_OffsetRange_t ofs, Q_OffsetRange_t ocs, long a3_offset, TimeToTrigger_t ttt);
 
+#ifdef Rel10
 static void decode_MBSFNAreaConfiguration(module_id_t module_idP, uint8_t eNB_index, frame_t frameP,uint8_t mbsfn_sync_area);
+#endif
 
 
 
@@ -151,10 +153,13 @@ static void decode_MBSFNAreaConfiguration(module_id_t module_idP, uint8_t eNB_in
 
 
 /*------------------------------------------------------------------------------*/
+/* to avoid gcc warnings when compiling with certain options */
+#if defined(ENABLE_USE_MME) || ENABLE_RAL
 static Rrc_State_t rrc_get_state (module_id_t ue_mod_idP)
 {
   return UE_rrc_inst[ue_mod_idP].RrcState;
 }
+#endif
 
 static Rrc_Sub_State_t rrc_get_sub_state (module_id_t ue_mod_idP)
 {
@@ -261,6 +266,7 @@ static void init_SI_UE( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_
 
 #ifdef Rel10
 //-----------------------------------------------------------------------------
+#if 0
 static void init_MCCH_UE(module_id_t ue_mod_idP, uint8_t eNB_index)
 {
   int i;
@@ -274,9 +280,10 @@ static void init_MCCH_UE(module_id_t ue_mod_idP, uint8_t eNB_index)
   }
 }
 #endif
+#endif
 
 //-----------------------------------------------------------------------------
-static void openair_rrc_lite_ue_init_security( const protocol_ctxt_t* const ctxt_pP )
+static void openair_rrc_ue_init_security( const protocol_ctxt_t* const ctxt_pP )
 {
 #if defined(ENABLE_SECURITY)
   //    uint8_t *kRRCenc;
@@ -297,7 +304,7 @@ static void openair_rrc_lite_ue_init_security( const protocol_ctxt_t* const ctxt
 }
 
 //-----------------------------------------------------------------------------
-char openair_rrc_lite_ue_init( const module_id_t ue_mod_idP, const unsigned char eNB_index )
+char openair_rrc_ue_init( const module_id_t ue_mod_idP, const unsigned char eNB_index )
 {
   protocol_ctxt_t ctxt;
   PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_idP, ENB_FLAG_NO, NOT_A_RNTI, 0, 0,eNB_index);
@@ -324,7 +331,7 @@ char openair_rrc_lite_ue_init( const module_id_t ue_mod_idP, const unsigned char
   UE_rrc_inst[ctxt.module_id].integrity_algorithm = SecurityAlgorithmConfig__integrityProtAlgorithm_reserved;
 #endif
 
-  openair_rrc_lite_ue_init_security(&ctxt);
+  openair_rrc_ue_init_security(&ctxt);
   init_SI_UE(&ctxt,eNB_index);
   LOG_D(RRC,PROTOCOL_RRC_CTXT_FMT"  INIT: phy_sync_2_ch_ind\n",
         PROTOCOL_RRC_CTXT_ARGS(&ctxt));
@@ -445,14 +452,14 @@ static void rrc_ue_generate_RRCConnectionSetupComplete( const protocol_ctxt_t* c
   LOG_D(RLC,
         "[FRAME %05d][RRC_UE][MOD %02d][][--- PDCP_DATA_REQ/%d Bytes (RRCConnectionSetupComplete to eNB %d MUI %d) --->][PDCP][MOD %02d][RB %02d]\n",
         ctxt_pP->frame, ctxt_pP->module_id+NB_eNB_INST, size, eNB_index, rrc_mui, ctxt_pP->module_id+NB_eNB_INST, DCCH);
-  pdcp_rrc_data_req (
-    ctxt_pP,
-    DCCH,
-    rrc_mui++,
-    SDU_CONFIRM_NO,
-    size,
-    buffer,
-    PDCP_TRANSMISSION_MODE_CONTROL);
+  rrc_data_req (
+		ctxt_pP,
+		DCCH,
+		rrc_mui++,
+		SDU_CONFIRM_NO,
+		size,
+		buffer,
+		PDCP_TRANSMISSION_MODE_CONTROL);
 }
 
 //-----------------------------------------------------------------------------
@@ -472,14 +479,14 @@ static void rrc_ue_generate_RRCConnectionReconfigurationComplete( const protocol
         rrc_mui,
         UE_MODULE_ID_TO_INSTANCE(ctxt_pP->module_id),
         DCCH);
-  pdcp_rrc_data_req (
-    ctxt_pP,
-    DCCH,
-    rrc_mui++,
-    SDU_CONFIRM_NO,
-    size,
-    buffer,
-    PDCP_TRANSMISSION_MODE_CONTROL);
+  rrc_data_req (
+		ctxt_pP,
+		DCCH,
+		rrc_mui++,
+		SDU_CONFIRM_NO,
+		size,
+		buffer,
+		PDCP_TRANSMISSION_MODE_CONTROL);
 }
 
 
@@ -697,6 +704,10 @@ rrc_ue_establish_drb(
   // add descriptor from RRC PDU
 #ifdef PDCP_USE_NETLINK
   int oip_ifup=0,ip_addr_offset3=0,ip_addr_offset4=0;
+  /* avoid gcc warnings */
+  (void)oip_ifup;
+  (void)ip_addr_offset3;
+  (void)ip_addr_offset4;
 #endif
 
   LOG_I(RRC,"[UE %d] Frame %d: processing RRCConnectionReconfiguration: reconfiguring DRB %ld/LCID %d\n",
@@ -1296,7 +1307,7 @@ rrc_ue_process_radioResourceConfigDedicated(
     UE_rrc_inst[ctxt_pP->module_id].sib1[eNB_index]->cellAccessRelatedInfo.cellIdentity.buf[1],
     UE_rrc_inst[ctxt_pP->module_id].sib1[eNB_index]->cellAccessRelatedInfo.cellIdentity.buf[2],
     UE_rrc_inst[ctxt_pP->module_id].sib1[eNB_index]->cellAccessRelatedInfo.cellIdentity.buf[3]);
-#    endif OAI_EMU
+#    endif /* OAI_EMU */
 #endif
 }
 
@@ -1430,14 +1441,14 @@ rrc_ue_process_securityModeCommand(
       }
 
       LOG_T(RRC, "\n");
-      pdcp_rrc_data_req (
-        ctxt_pP,
-        DCCH,
-        rrc_mui++,
-        SDU_CONFIRM_NO,
-        (enc_rval.encoded + 7) / 8,
-        buffer,
-        PDCP_TRANSMISSION_MODE_CONTROL);
+      rrc_data_req (
+		    ctxt_pP,
+		    DCCH,
+		    rrc_mui++,
+		    SDU_CONFIRM_NO,
+		    (enc_rval.encoded + 7) / 8,
+		    buffer,
+		    PDCP_TRANSMISSION_MODE_CONTROL);
     }
   }
 }
@@ -1535,14 +1546,14 @@ rrc_ue_process_ueCapabilityEnquiry(
           }
 
           LOG_T(RRC, "\n");
-          pdcp_rrc_data_req (
-            ctxt_pP,
-            DCCH,
-            rrc_mui++,
-            SDU_CONFIRM_NO,
-            (enc_rval.encoded + 7) / 8,
-            buffer,
-            PDCP_TRANSMISSION_MODE_CONTROL);
+          rrc_data_req (
+			ctxt_pP,
+			DCCH,
+			rrc_mui++,
+			SDU_CONFIRM_NO,
+			(enc_rval.encoded + 7) / 8,
+			buffer,
+			PDCP_TRANSMISSION_MODE_CONTROL);
         }
       }
     }
@@ -2266,6 +2277,9 @@ static const char* SIB2preambleTransMax( long value )
   case 10:
     return "n200";
   }
+
+  /* unreachable but gcc warns... */
+  return "ERR";
 }
 static const char* SIB2ra_ResponseWindowSize( long value )
 {
@@ -3061,9 +3075,10 @@ uint64_t arfcn_to_freq(long arfcn) {
     return((uint64_t)3400000000 + ((arfcn-41590)*100000));
   else if (arfcn <45590) // Band 43
     return((uint64_t)3600000000 + ((arfcn-43950)*100000));
-  else
+  else {
     LOG_E(RRC,"Unknown EARFCN %d\n",arfcn);
-
+    exit(1);
+  }
 }
 static void dump_sib5( SystemInformationBlockType5_t *sib5 )
 {
@@ -4160,15 +4175,15 @@ void *rrc_ue_task( void *args_p )
 
       /* Transfer data to PDCP */
       PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_id, ENB_FLAG_NO, UE_rrc_inst[ue_mod_id].Info[0].rnti, 0, 0,0);
-      pdcp_rrc_data_req (&ctxt,
-                         DCCH,
-                         rrc_mui++,
-                         SDU_CONFIRM_NO,
-                         length, buffer,
-                         PDCP_TRANSMISSION_MODE_CONTROL);
+      rrc_data_req (&ctxt,
+		    DCCH,
+		    rrc_mui++,
+		    SDU_CONFIRM_NO,
+		    length, buffer,
+		    PDCP_TRANSMISSION_MODE_CONTROL);
       break;
     }
-
+      
 # endif
 
 # if ENABLE_RAL
diff --git a/openair2/RRC/LITE/rrc_common.c b/openair2/RRC/LITE/rrc_common.c
index e2d8a6c69b2a00b7b894c43706fef230bed9e2e3..bd77c8463a062cb5e46803c82187b074b4e7f3f2 100644
--- a/openair2/RRC/LITE/rrc_common.c
+++ b/openair2/RRC/LITE/rrc_common.c
@@ -48,6 +48,7 @@
 #include "asn1_msg.h"
 #include "pdcp.h"
 #include "UTIL/LOG/vcd_signal_dumper.h"
+#include "rrc_eNB_UE_context.h"
 
 #ifdef LOCALIZATION
 #include <sys/time.h>
@@ -132,7 +133,7 @@ rrc_init_global_param(
    return -1;
    }
    */
-  rrc_rlc_register_rrc (rlcrrc_data_ind, NULL); //register with rlc
+  rrc_rlc_register_rrc (rrc_data_ind, NULL); //register with rlc
 
   DCCH_LCHAN_DESC.transport_block_size = 4;
   DCCH_LCHAN_DESC.max_transport_blocks = 16;
@@ -253,6 +254,9 @@ openair_rrc_top_init(
   OAI_UECapability_t *UECap     = NULL;
   int                 CC_id;
 
+  /* for no gcc warnings */
+  (void)CC_id;
+
   LOG_D(RRC, "[OPENAIR][INIT] Init function start: NB_UE_INST=%d, NB_eNB_INST=%d\n", NB_UE_INST, NB_eNB_INST);
 
   if (NB_UE_INST > 0) {
@@ -411,12 +415,13 @@ rrc_rx_tx(
 )
 //-----------------------------------------------------------------------------
 {
-  uint8_t        UE_id;
+  //uint8_t        UE_id;
   int32_t        current_timestamp_ms, ref_timestamp_ms;
   struct timeval ts;
+  struct rrc_eNB_ue_context_s   *ue_context_p = NULL,*ue_to_be_removed = NULL;
+
 #ifdef LOCALIZATION
   double                         estimated_distance;
-  struct rrc_eNB_ue_context_s*   ue_context_p = NULL;
   protocol_ctxt_t                ctxt;
 #endif
   VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX,VCD_FUNCTION_IN);
@@ -517,7 +522,32 @@ rrc_rx_tx(
   } else { // eNB
     check_handovers(ctxt_pP);
     // counetr, and get the value and aggregate
-#ifdef LOCALIZATION
+
+    // check for UL failure
+    RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(eNB_rrc_inst[ctxt_pP->module_id].rrc_ue_head)) {
+      if (ue_context_p->ue_context.ul_failure_timer>0) {
+	ue_context_p->ue_context.ul_failure_timer++;
+	if (ue_context_p->ue_context.ul_failure_timer >= 20000) {
+	  // remove UE after 20 seconds after MAC has indicated UL failure
+	  LOG_I(RRC,"Removing UE %x instance\n",ue_context_p->ue_context.rnti);
+	  ue_to_be_removed = ue_context_p;
+	  break;
+	}
+      }
+      if (ue_context_p->ue_context.ue_release_timer>0) {
+	ue_context_p->ue_context.ue_release_timer++;
+	if (ue_context_p->ue_context.ue_release_timer >= 100) {
+	  // remove UE after 10 frames after RRCConnectionRelease is triggered
+	  LOG_I(RRC,"Removing UE %x instance\n",ue_context_p->ue_context.rnti);
+	  ue_to_be_removed = ue_context_p;
+	  break;
+	}
+      }
+    }
+    if (ue_to_be_removed)
+      rrc_eNB_free_UE(ctxt_pP->module_id,ue_to_be_removed);
+
+#ifdef RRC_LOCALIZATION
 
     /* for the localization, only primary CC_id might be relevant*/
     gettimeofday(&ts, NULL);
@@ -547,6 +577,9 @@ rrc_rx_tx(
     }
 
 #endif
+    (void)ts; /* remove gcc warning "unused variable" */
+    (void)ref_timestamp_ms; /* remove gcc warning "unused variable" */
+    (void)current_timestamp_ms; /* remove gcc warning "unused variable" */
   }
 
   VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_RX_TX,VCD_FUNCTION_OUT);
diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c
index ffd0e6777e25bf1243b99ec8a666be63ca90b02f..ef6e6e4bd06e6dfb77312a18ff1280f4f3e83dec 100644
--- a/openair2/RRC/LITE/rrc_eNB.c
+++ b/openair2/RRC/LITE/rrc_eNB.c
@@ -63,6 +63,8 @@
 #include "platform_types.h"
 #include "msc.h"
 
+#include "T.h"
+
 //#ifdef Rel10
 #include "MeasResults.h"
 //#endif
@@ -540,8 +542,8 @@ rrc_eNB_get_next_transaction_identifier(
 
 
 //-----------------------------------------------------------------------------
-// return 1 if there is already an UE with ue_identityP, 0 otherwise
-static int
+// return the ue context if there is already an UE with ue_identityP, NULL otherwise
+static struct rrc_eNB_ue_context_s*
 rrc_eNB_ue_context_random_exist(
   const protocol_ctxt_t* const ctxt_pP,
   const uint64_t               ue_identityP
@@ -551,9 +553,38 @@ rrc_eNB_ue_context_random_exist(
   struct rrc_eNB_ue_context_s*        ue_context_p = NULL;
   RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(eNB_rrc_inst[ctxt_pP->module_id].rrc_ue_head)) {
     if (ue_context_p->ue_context.random_ue_identity == ue_identityP)
-      return 1;
+      return ue_context_p;
   }
-  return 0;
+  return NULL;
+}
+//-----------------------------------------------------------------------------
+// return the ue context if there is already an UE with the same S-TMSI(MMEC+M-TMSI), NULL otherwise
+static struct rrc_eNB_ue_context_s*
+rrc_eNB_ue_context_stmsi_exist(
+  const protocol_ctxt_t* const ctxt_pP,
+  const mme_code_t             mme_codeP,
+  const m_tmsi_t               m_tmsiP
+)
+//-----------------------------------------------------------------------------
+{
+  struct rrc_eNB_ue_context_s*        ue_context_p = NULL;
+  RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(eNB_rrc_inst[ctxt_pP->module_id].rrc_ue_head)) {
+    LOG_I(RRC,"checking for UE S-TMSI %x, mme %x (%p): rnti %x",
+	  m_tmsiP, mme_codeP, ue_context_p, 
+	  ue_context_p->ue_context.rnti);
+    if (ue_context_p->ue_context.Initialue_identity_s_TMSI.presence == TRUE) {
+      printf("S-TMSI %x, MME %x\n",
+	    ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi,
+	    ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code);
+      if (ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi == m_tmsiP)
+        if (ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code == mme_codeP)
+          return ue_context_p;
+    }
+    else
+      printf("\n");
+
+  }
+  return NULL;
 }
 
 //-----------------------------------------------------------------------------
@@ -761,35 +792,34 @@ rrc_eNB_free_mem_UE_context(
 }
 
 //-----------------------------------------------------------------------------
-// called by MAC layer only
 // should be called when UE is lost by eNB
 void
-rrc_eNB_free_UE(
-  const module_id_t enb_mod_idP,
-  const rnti_t      rntiP,
-  const frame_t     frameP,
-  const sub_frame_t subframeP
-)
+rrc_eNB_free_UE(const module_id_t enb_mod_idP,const struct rrc_eNB_ue_context_s*        const ue_context_pP)
 //-----------------------------------------------------------------------------
 {
 
-  struct rrc_eNB_ue_context_s*        ue_context_p = NULL;
+
   protocol_ctxt_t                     ctxt;
 #if !defined(ENABLE_USE_MME)
   module_id_t                         ue_module_id;
+  /* avoid gcc warnings */
+  (void)ue_module_id;
 #endif
-  AssertFatal(enb_mod_idP < NB_eNB_INST, "eNB inst invalid (%d/%d) for UE %x!", enb_mod_idP, NB_eNB_INST, rntiP);
-  ue_context_p = rrc_eNB_get_ue_context(
+  rnti_t rnti = ue_context_pP->ue_context.rnti;
+
+
+  AssertFatal(enb_mod_idP < NB_eNB_INST, "eNB inst invalid (%d/%d) for UE %x!", enb_mod_idP, NB_eNB_INST, rnti);
+  /*  ue_context_p = rrc_eNB_get_ue_context(
                    &eNB_rrc_inst[enb_mod_idP],
                    rntiP
                  );
-
-  if (NULL != ue_context_p) {
-    PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, enb_mod_idP, ENB_FLAG_YES, rntiP, frameP, subframeP,enb_mod_idP);
-    LOG_W(RRC, "[eNB %d] Removing UE RNTI %x\n", enb_mod_idP, rntiP);
+  */
+  if (NULL != ue_context_pP) {
+    PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, enb_mod_idP, ENB_FLAG_YES, rnti, 0, 0,enb_mod_idP);
+    LOG_W(RRC, "[eNB %d] Removing UE RNTI %x\n", enb_mod_idP, rnti);
 
 #if defined(ENABLE_USE_MME)
-    rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_REQ(enb_mod_idP, ue_context_p, S1AP_CAUSE_RADIO_NETWORK, 21); // send cause 21: connection with ue lost
+    rrc_eNB_send_S1AP_UE_CONTEXT_RELEASE_REQ(enb_mod_idP, ue_context_pP, S1AP_CAUSE_RADIO_NETWORK, 21); // send cause 21: connection with ue lost
     /* From 3GPP 36300v10 p129 : 19.2.2.2.2 S1 UE Context Release Request (eNB triggered)
      * If the E-UTRAN internal reason is a radio link failure detected in the eNB, the eNB shall wait a sufficient time before
      *  triggering the S1 UE Context Release Request procedure
@@ -798,22 +828,22 @@ rrc_eNB_free_UE(
      */
 #else
 #if defined(OAI_EMU)
-    AssertFatal(ue_context_p->local_uid < NUMBER_OF_UE_MAX, "local_uid invalid (%d<%d) for UE %x!", ue_context_p->local_uid, NUMBER_OF_UE_MAX, rntiP);
-    ue_module_id = oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[enb_mod_idP][ue_context_p->local_uid];
-    AssertFatal(ue_module_id < NUMBER_OF_UE_MAX, "ue_module_id invalid (%d<%d) for UE %x!", ue_module_id, NUMBER_OF_UE_MAX, rntiP);
-    oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[enb_mod_idP][ue_context_p->local_uid] = -1;
+    AssertFatal(ue_context_pP->local_uid < NUMBER_OF_UE_MAX, "local_uid invalid (%d<%d) for UE %x!", ue_context_pP->local_uid, NUMBER_OF_UE_MAX, rnti);
+    ue_module_id = oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[enb_mod_idP][ue_context_pP->local_uid];
+    AssertFatal(ue_module_id < NUMBER_OF_UE_MAX, "ue_module_id invalid (%d<%d) for UE %x!", ue_module_id, NUMBER_OF_UE_MAX, rnti);
+    oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[enb_mod_idP][ue_context_pP->local_uid] = -1;
     oai_emulation.info.eNB_ue_module_id_to_rnti[enb_mod_idP][ue_module_id] = NOT_A_RNTI;
 #endif
 #endif
-    ue_context_p->ue_context.Status = RRC_IDLE;
 
+    rrc_mac_remove_ue(enb_mod_idP,rnti);
     rrc_rlc_remove_ue(&ctxt);
     pdcp_remove_UE(&ctxt);
 
     rrc_eNB_remove_ue_context(
       &ctxt,
       &eNB_rrc_inst[enb_mod_idP],
-      ue_context_p);
+      (struct rrc_eNB_ue_context_s*) ue_context_pP);
   }
 }
 
@@ -830,6 +860,9 @@ rrc_eNB_process_RRCConnectionSetupComplete(
         PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel UL-DCCH, " "processing RRCConnectionSetupComplete from UE\n",
         PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
 
+  T(T_ENB_RRC_CONNECTION_SETUP_COMPLETE, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+    T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
 #if defined(ENABLE_USE_MME)
 
   if (EPC_MODE_ENABLED == 1) {
@@ -860,6 +893,9 @@ rrc_eNB_generate_SecurityModeCommand(
   uint8_t                             buffer[100];
   uint8_t                             size;
 
+  T(T_ENB_RRC_SECURITY_MODE_COMMAND, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+    T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
   size = do_SecurityModeCommand(
            ctxt_pP,
            buffer,
@@ -901,14 +937,14 @@ rrc_eNB_generate_SecurityModeCommand(
     rrc_eNB_mui,
     size);
 
-  pdcp_rrc_data_req(
-    ctxt_pP,
-    DCCH,
-    rrc_eNB_mui++,
-    SDU_CONFIRM_NO,
-    size,
-    buffer,
-    PDCP_TRANSMISSION_MODE_CONTROL);
+  rrc_data_req(
+	       ctxt_pP,
+	       DCCH,
+	       rrc_eNB_mui++,
+	       SDU_CONFIRM_NO,
+	       size,
+	       buffer,
+	       PDCP_TRANSMISSION_MODE_CONTROL);
 
 }
 
@@ -924,6 +960,9 @@ rrc_eNB_generate_UECapabilityEnquiry(
   uint8_t                             buffer[100];
   uint8_t                             size;
 
+  T(T_ENB_RRC_UE_CAPABILITY_ENQUIRY, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+    T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
   size = do_UECapabilityEnquiry(
            ctxt_pP,
            buffer,
@@ -952,17 +991,63 @@ rrc_eNB_generate_UECapabilityEnquiry(
     rrc_eNB_mui,
     size);
 
-  pdcp_rrc_data_req(
-    ctxt_pP,
-    DCCH,
-    rrc_eNB_mui++,
-    SDU_CONFIRM_NO,
-    size,
-    buffer,
-    PDCP_TRANSMISSION_MODE_CONTROL);
+  rrc_data_req(
+	       ctxt_pP,
+	       DCCH,
+	       rrc_eNB_mui++,
+	       SDU_CONFIRM_NO,
+	       size,
+	       buffer,
+	       PDCP_TRANSMISSION_MODE_CONTROL);
 
 }
 
+//-----------------------------------------------------------------------------
+void
+rrc_eNB_generate_RRCConnectionReject(
+  const protocol_ctxt_t* const ctxt_pP,
+  rrc_eNB_ue_context_t*          const ue_context_pP,
+  const int                    CC_id
+)
+//-----------------------------------------------------------------------------
+{
+#ifdef RRC_MSG_PRINT
+  int                                 cnt;
+#endif
+
+  T(T_ENB_RRC_CONNECTION_REJECT, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+    T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
+  eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Tx_buffer.payload_size =
+    do_RRCConnectionReject(ctxt_pP->module_id,
+                          (uint8_t*) eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Tx_buffer.Payload);
+
+#ifdef RRC_MSG_PRINT
+  LOG_F(RRC,"[MSG] RRCConnectionReject\n");
+
+  for (cnt = 0; cnt < eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Tx_buffer.payload_size; cnt++) {
+    LOG_F(RRC,"%02x ", ((uint8_t*)eNB_rrc_inst[ctxt_pP->module_id].Srb0.Tx_buffer.Payload)[cnt]);
+  }
+
+  LOG_F(RRC,"\n");
+#endif
+
+  MSC_LOG_TX_MESSAGE(
+    MSC_RRC_ENB,
+    MSC_RRC_UE,
+    eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Tx_buffer.Header,
+    eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Tx_buffer.payload_size,
+    MSC_AS_TIME_FMT" RRCConnectionReject UE %x size %u",
+    MSC_AS_TIME_ARGS(ctxt_pP),
+    ue_context_pP == NULL ? -1 : ue_context_pP->ue_context.rnti,
+    eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Tx_buffer.payload_size);
+
+  LOG_I(RRC,
+        PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel DL-CCCH, Generating RRCConnectionReject (bytes %d)\n",
+        PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
+        eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Tx_buffer.payload_size);
+}
+
 //-----------------------------------------------------------------------------
 void
 rrc_eNB_generate_RRCConnectionReestablishmentReject(
@@ -976,6 +1061,9 @@ rrc_eNB_generate_RRCConnectionReestablishmentReject(
   int                                 cnt;
 #endif
 
+  T(T_ENB_RRC_CONNECTION_REESTABLISHMENT_REJECT, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+    T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
   eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Tx_buffer.payload_size =
     do_RRCConnectionReestablishmentReject(ctxt_pP->module_id,
                           (uint8_t*) eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Tx_buffer.Payload);
@@ -1018,9 +1106,14 @@ rrc_eNB_generate_RRCConnectionRelease(
   uint8_t                             buffer[RRC_BUF_SIZE];
   uint16_t                            size;
 
+  T(T_ENB_RRC_CONNECTION_RELEASE, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+    T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
   memset(buffer, 0, RRC_BUF_SIZE);
 
   size = do_RRCConnectionRelease(ctxt_pP->module_id, buffer,rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id));
+  // set release timer
+  ue_context_pP->ue_context.ue_release_timer=1;
 
   LOG_I(RRC,
         PROTOCOL_RRC_CTXT_UE_FMT" Logical Channel DL-DCCH, Generate RRCConnectionRelease (bytes %d)\n",
@@ -1045,14 +1138,14 @@ rrc_eNB_generate_RRCConnectionRelease(
     rrc_eNB_mui,
     size);
 
-  pdcp_rrc_data_req(
-    ctxt_pP,
-    DCCH,
-    rrc_eNB_mui++,
-    SDU_CONFIRM_NO,
-    size,
-    buffer,
-    PDCP_TRANSMISSION_MODE_CONTROL);
+  rrc_data_req(
+	       ctxt_pP,
+	       DCCH,
+	       rrc_eNB_mui++,
+	       SDU_CONFIRM_NO,
+	       size,
+	       buffer,
+	       PDCP_TRANSMISSION_MODE_CONTROL);
 }
 
 //-----------------------------------------------------------------------------
@@ -1072,8 +1165,8 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
   int                                 i;
 
   // configure SRB1/SRB2, PhysicalConfigDedicated, MAC_MainConfig for UE
-  eNB_RRC_INST*                       rrc_inst = &eNB_rrc_inst[ctxt_pP->module_id];
-  struct PhysicalConfigDedicated**    physicalConfigDedicated = &ue_context_pP->ue_context.physicalConfigDedicated;
+  //eNB_RRC_INST*                       rrc_inst = &eNB_rrc_inst[ctxt_pP->module_id];
+  //struct PhysicalConfigDedicated**    physicalConfigDedicated = &ue_context_pP->ue_context.physicalConfigDedicated;
 #if Rel10
   struct PhysicalConfigDedicated     *r10_physicalConfigDedicated = NULL;
 #endif
@@ -1107,7 +1200,7 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
 #if Rel10
   long                               *sr_ProhibitTimer_r9              = NULL;
   //     uint8_t sCellIndexToAdd = rrc_find_free_SCell_index(enb_mod_idP, ue_mod_idP, 1);
-  uint8_t                            sCellIndexToAdd = 0;
+  //uint8_t                            sCellIndexToAdd = 0;
 #endif
 
   long                               *logicalchannelgroup, *logicalchannelgroup_drb;
@@ -1120,6 +1213,8 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
   CellsToAddModList_t                *CellsToAddModList                = NULL;
   struct RRCConnectionReconfiguration_r8_IEs__dedicatedInfoNASList *dedicatedInfoNASList = NULL;
   DedicatedInfoNAS_t                 *dedicatedInfoNas                 = NULL;
+  /* for no gcc warnings */
+  (void)dedicatedInfoNas;
 
   C_RNTI_t                           *cba_RNTI                         = NULL;
 #ifdef CBA
@@ -1147,6 +1242,10 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
   }
 
 #endif
+
+  T(T_ENB_RRC_CONNECTION_RECONFIGURATION, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+    T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
   // Configure SRB2
   /// SRB2
   SRB2_config = CALLOC(1, sizeof(*SRB2_config));
@@ -1232,6 +1331,10 @@ rrc_eNB_generate_defaultRRCConnectionReconfiguration(
   DRB_pdcp_config->rlc_AM = NULL;
   DRB_pdcp_config->rlc_UM = NULL;
 
+  /* avoid gcc warnings */
+  (void)PDCP_rlc_AM;
+  (void)PDCP_rlc_UM;
+
 #ifdef RRC_DEFAULT_RAB_IS_AM // EXMIMO_IOT
   PDCP_rlc_AM = CALLOC(1, sizeof(*PDCP_rlc_AM));
   DRB_pdcp_config->rlc_AM = PDCP_rlc_AM;
@@ -1776,14 +1879,14 @@ if (0)
     rrc_eNB_mui,
     size);
 
-  pdcp_rrc_data_req(
-    ctxt_pP,
-    DCCH,
-    rrc_eNB_mui++,
-    SDU_CONFIRM_NO,
-    size,
-    buffer,
-    PDCP_TRANSMISSION_MODE_CONTROL);
+  rrc_data_req(
+	       ctxt_pP,
+	       DCCH,
+	       rrc_eNB_mui++,
+	       SDU_CONFIRM_NO,
+	       size,
+	       buffer,
+	       PDCP_TRANSMISSION_MODE_CONTROL);
 }
 
 #ifdef Rel10
@@ -2290,14 +2393,14 @@ rrc_eNB_generate_RRCConnectionReconfiguration_SCell(
     rrc_eNB_mui,
     size);
 
-  pdcp_rrc_data_req(
-    ctxt_pP,
-    DCCH,
-    rrc_eNB_mui++,
-    SDU_CONFIRM_NO,
-    size,
-    buffer,
-    PDCP_TRANSMISSION_MODE_CONTROL);
+  rrc_data_req(
+	       ctxt_pP,
+	       DCCH,
+	       rrc_eNB_mui++,
+	       SDU_CONFIRM_NO,
+	       size,
+	       buffer,
+	       PDCP_TRANSMISSION_MODE_CONTROL);
   return(0);
 }
 
@@ -2311,6 +2414,9 @@ rrc_eNB_process_MeasurementReport(
 )
 //-----------------------------------------------------------------------------
 {
+  T(T_ENB_RRC_MEASUREMENT_REPORT, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+    T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
 
   LOG_I(RRC, "[eNB %d] Frame %d: Process Measurement Report From UE %x (Measurement Id %d)\n",
         ctxt_pP->module_id, ctxt_pP->frame, ctxt_pP->rnti, (int)measResults2->measId);
@@ -2380,6 +2486,9 @@ rrc_eNB_generate_HandoverPreparationInformation(
      RadioResourceConfigDedicated_t *radioResourceConfigDedicated = CALLOC(1,sizeof(RadioResourceConfigDedicated_t));
    */
 
+  T(T_ENB_RRC_HANDOVER_PREPARATION_INFORMATION, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+    T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
   handoverInfo->as_config.antennaInfoCommon.antennaPortsCount = 0;    //Not used 0- but check value
   handoverInfo->as_config.sourceDl_CarrierFreq = 36090;   //Verify!
 
@@ -2470,6 +2579,9 @@ rrc_eNB_process_handoverPreparationInformation(
 )
 //-----------------------------------------------------------------------------
 {
+  T(T_ENB_RRC_HANDOVER_PREPARATION_INFORMATION, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+    T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
 
   LOG_I(RRC,
         "[eNB %d] Frame %d : Logical Channel UL-DCCH, processing RRCHandoverPreparationInformation, sending RRCConnectionReconfiguration to UE %d \n",
@@ -2545,6 +2657,9 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
 )
 //-----------------------------------------------------------------------------
 {
+  T(T_ENB_RRC_CONNECTION_RECONFIGURATION, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+    T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
 
   uint8_t                             buffer[RRC_BUF_SIZE];
   uint16_t                            size;
@@ -2582,8 +2697,8 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
   QuantityConfig_t                   *quantityConfig;
   MobilityControlInfo_t              *mobilityInfo;
   // HandoverCommand_t handoverCommand;
-  uint8_t                             sourceModId =
-    get_adjacent_cell_mod_id(ue_context_pP->ue_context.handover_info->as_context.reestablishmentInfo->sourcePhysCellId);
+  //uint8_t                             sourceModId =
+  //  get_adjacent_cell_mod_id(ue_context_pP->ue_context.handover_info->as_context.reestablishmentInfo->sourcePhysCellId);
 #if Rel10
   long                               *sr_ProhibitTimer_r9;
 #endif
@@ -3430,7 +3545,7 @@ rrc_eNB_generate_RRCConnectionReconfiguration_handover(
      handoverCommand.criticalExtensions.choice.c1.choice.handoverCommand_r8.handoverCommandMessage.buf = buffer;
      handoverCommand.criticalExtensions.choice.c1.choice.handoverCommand_r8.handoverCommandMessage.size = size;
    */
-#warning "COMPILATION PROBLEM"
+//#warning "COMPILATION PROBLEM"
 #ifdef PROBLEM_COMPILATION_RESOLVED
 
   if (sourceModId != 0xFF) {
@@ -3488,6 +3603,10 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
   int                                 oip_ifup = 0;
   int                                 dest_ip_offset = 0;
   module_id_t                         ue_module_id   = -1;
+  /* avoid gcc warnings */
+  (void)oip_ifup;
+  (void)dest_ip_offset;
+  (void)ue_module_id;
 #endif
 
   uint8_t                            *kRRCenc = NULL;
@@ -3495,7 +3614,10 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
   uint8_t                            *kUPenc = NULL;
 
   DRB_ToAddModList_t*                 DRB_configList = ue_context_pP->ue_context.DRB_configList;
-  SRB_ToAddModList_t*                 SRB_configList = ue_context_pP->ue_context.SRB_configList;
+  //SRB_ToAddModList_t*                 SRB_configList = ue_context_pP->ue_context.SRB_configList;
+
+  T(T_ENB_RRC_CONNECTION_RECONFIGURATION_COMPLETE, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+    T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
 
 #if defined(ENABLE_SECURITY)
 
@@ -3767,6 +3889,9 @@ rrc_eNB_generate_RRCConnectionSetup(
   SRB_ToAddMod_t                     *SRB1_config;
   int                                 cnt;
 
+  T(T_ENB_RRC_CONNECTION_SETUP, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+    T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
   SRB_configList = &ue_context_pP->ue_context.SRB_configList;
   eNB_rrc_inst[ctxt_pP->module_id].carrier[CC_id].Srb0.Tx_buffer.payload_size =
     do_RRCConnectionSetup(ctxt_pP,
@@ -3864,7 +3989,7 @@ rrc_eNB_generate_RRCConnectionSetup(
 #if defined(ENABLE_ITTI)
 char
 //-----------------------------------------------------------------------------
-openair_rrc_lite_eNB_init(
+openair_rrc_eNB_init(
   const module_id_t enb_mod_idP
 )
 //-----------------------------------------------------------------------------
@@ -3877,13 +4002,13 @@ openair_rrc_lite_eNB_init(
 #if defined(ENABLE_ITTI)
 //-----------------------------------------------------------------------------
 char
-openair_rrc_lite_eNB_configuration(
+openair_rrc_eNB_configuration(
   const module_id_t enb_mod_idP,
   RrcConfigurationReq* configuration
 )
 #else
 char
-openair_rrc_lite_eNB_init(
+openair_rrc_eNB_init(
   const module_id_t enb_mod_idP
 )
 #endif
@@ -3921,7 +4046,7 @@ openair_rrc_lite_eNB_init(
   //        for (j = 0; j < NUMBER_OF_UE_MAX; j++) {
   //            eNB_rrc_inst[ctxt.module_id].ciphering_algorithm[j] = SecurityAlgorithmConfig__cipheringAlgorithm_eea0;
   //            eNB_rrc_inst[ctxt.module_id].integrity_algorithm[j] = SecurityAlgorithmConfig__integrityProtAlgorithm_eia2;
-  //            rrc_lite_eNB_init_security(enb_mod_idP, j);
+  //            rrc_eNB_init_security(enb_mod_idP, j);
   //        }
   //    }
   eNB_rrc_inst[ctxt.module_id].Nb_ue = 0;
@@ -4048,6 +4173,10 @@ rrc_eNB_decode_ccch(
   int                                 i, rval;
   struct rrc_eNB_ue_context_s*                  ue_context_p = NULL;
   uint64_t                                      random_value = 0;
+  int                                           stmsi_received = 0;
+
+  T(T_ENB_RRC_UL_CCCH_DATA_IN, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+    T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
 
   //memset(ul_ccch_msg,0,sizeof(UL_CCCH_Message_t));
 
@@ -4119,6 +4248,9 @@ rrc_eNB_decode_ccch(
       break;
 
     case UL_CCCH_MessageType__c1_PR_rrcConnectionReestablishmentRequest:
+      T(T_ENB_RRC_CONNECTION_REESTABLISHMENT_REQUEST, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+        T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
 #ifdef RRC_MSG_PRINT
       LOG_F(RRC,"[MSG] RRC Connection Reestablishement Request\n");
 
@@ -4161,6 +4293,9 @@ rrc_eNB_decode_ccch(
       break;
 
     case UL_CCCH_MessageType__c1_PR_rrcConnectionRequest:
+      T(T_ENB_RRC_CONNECTION_REQUEST, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+        T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
 #ifdef RRC_MSG_PRINT
       LOG_F(RRC,"[MSG] RRC Connection Request\n");
 
@@ -4193,47 +4328,60 @@ rrc_eNB_decode_ccch(
       } else {
         rrcConnectionRequest = &ul_ccch_msg->message.choice.c1.choice.rrcConnectionRequest.criticalExtensions.choice.rrcConnectionRequest_r8;
         {
-          AssertFatal(rrcConnectionRequest->ue_Identity.present == InitialUE_Identity_PR_randomValue,
-                      "unsupported InitialUE-Identity in RRCConnectionRequest");
-          AssertFatal(rrcConnectionRequest->ue_Identity.choice.randomValue.size == 5,
-                      "wrong InitialUE-Identity randomValue size, expected 5, provided %d",
-                      rrcConnectionRequest->ue_Identity.choice.randomValue.size);
-          memcpy(((uint8_t*) & random_value) + 3,
-                 rrcConnectionRequest->ue_Identity.choice.randomValue.buf,
-                 rrcConnectionRequest->ue_Identity.choice.randomValue.size);
-          /* if there is already a registered UE (with another RNTI) with this random_value,
-           * the current one must be removed from MAC/PHY (zombie UE)
-           */
-          if (rrc_eNB_ue_context_random_exist(ctxt_pP, random_value)) {
-            AssertFatal(0 == 1, "TODO: remove UE fro MAC/PHY (how?)");
-            ue_context_p = NULL;
-          } else {
-            ue_context_p = rrc_eNB_get_next_free_ue_context(ctxt_pP, random_value);
-          }
-        }
-        LOG_D(RRC,
-              PROTOCOL_RRC_CTXT_UE_FMT" UE context: %X\n",
-              PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
-              ue_context_p);
-
-        if (ue_context_p != NULL) {
-
-
-#if defined(ENABLE_ITTI)
-          /* Check s-TMSI presence in message */
-          ue_context_p->ue_context.Initialue_identity_s_TMSI.presence =
-            (rrcConnectionRequest->ue_Identity.present == InitialUE_Identity_PR_s_TMSI);
-
-          if (ue_context_p->ue_context.Initialue_identity_s_TMSI.presence) {
+          if (InitialUE_Identity_PR_randomValue == rrcConnectionRequest->ue_Identity.present) {
+            AssertFatal(rrcConnectionRequest->ue_Identity.choice.randomValue.size == 5,
+                        "wrong InitialUE-Identity randomValue size, expected 5, provided %d",
+                        rrcConnectionRequest->ue_Identity.choice.randomValue.size);
+            memcpy(((uint8_t*) & random_value) + 3,
+                   rrcConnectionRequest->ue_Identity.choice.randomValue.buf,
+                   rrcConnectionRequest->ue_Identity.choice.randomValue.size);
+            /* if there is already a registered UE (with another RNTI) with this random_value,
+             * the current one must be removed from MAC/PHY (zombie UE)
+             */
+            if ((ue_context_p = rrc_eNB_ue_context_random_exist(ctxt_pP, random_value))) {
+//#warning "TODO: random_exist: remove UE from MAC/PHY (how?)"
+	      //              AssertFatal(0 == 1, "TODO: remove UE from MAC/PHY (how?)");
+              ue_context_p = NULL;
+            } else {
+              ue_context_p = rrc_eNB_get_next_free_ue_context(ctxt_pP, random_value);
+            }
+          } else if (InitialUE_Identity_PR_s_TMSI == rrcConnectionRequest->ue_Identity.present) {
             /* Save s-TMSI */
-            S_TMSI_t                            s_TMSI = rrcConnectionRequest->ue_Identity.choice.s_TMSI;
-
-            ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code =
-              BIT_STRING_to_uint8(&s_TMSI.mmec);
-            ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi =
-              BIT_STRING_to_uint32(&s_TMSI.m_TMSI);
-
-            MSC_LOG_RX_DISCARDED_MESSAGE(
+            S_TMSI_t   s_TMSI = rrcConnectionRequest->ue_Identity.choice.s_TMSI;
+            mme_code_t mme_code = BIT_STRING_to_uint8(&s_TMSI.mmec);
+            m_tmsi_t   m_tmsi   = BIT_STRING_to_uint32(&s_TMSI.m_TMSI);
+            random_value = (((uint64_t)mme_code) << 32) | m_tmsi;
+            if ((ue_context_p = rrc_eNB_ue_context_stmsi_exist(ctxt_pP, mme_code, m_tmsi))) {
+
+		//#warning "TODO: stmsi_exist: remove UE from MAC/PHY (how?)"
+	      LOG_I(RRC," S-TMSI exists, ue_context_p %p\n",ue_context_p);
+	      stmsi_received=1;
+              /* replace rnti in the context */
+              /* for that, remove the context from the RB tree */
+              RB_REMOVE(rrc_ue_tree_s, &eNB_rrc_inst[ctxt_pP->module_id].rrc_ue_head, ue_context_p);
+              /* and insert again, after changing rnti everywhere it has to be changed */
+              ue_context_p->ue_id_rnti = ctxt_pP->rnti;
+	      ue_context_p->ue_context.rnti = ctxt_pP->rnti;
+              RB_INSERT(rrc_ue_tree_s, &eNB_rrc_inst[ctxt_pP->module_id].rrc_ue_head, ue_context_p);
+              /* reset timers */
+              ue_context_p->ue_context.ul_failure_timer = 0;
+              ue_context_p->ue_context.ue_release_timer = 0;
+	      //   AssertFatal(0 == 1, "TODO: remove UE from MAC/PHY (how?)");
+	      //              ue_context_p = NULL;
+            } else {
+              ue_context_p = rrc_eNB_get_next_free_ue_context(ctxt_pP, NOT_A_RANDOM_UE_IDENTITY);
+              if (ue_context_p == NULL)
+                LOG_E(RRC, "%s:%d:%s: rrc_eNB_get_next_free_ue_context returned NULL\n", __FILE__, __LINE__, __FUNCTION__);
+              if (ue_context_p != NULL) {
+	        ue_context_p->ue_context.Initialue_identity_s_TMSI.presence = TRUE;
+	        ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code = mme_code;
+	        ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi = m_tmsi;
+              } else {
+                break;
+              }
+            }
+
+            MSC_LOG_RX_MESSAGE(
               MSC_RRC_ENB,
               MSC_RRC_UE,
               Srb_info->Rx_buffer.Payload,
@@ -4242,37 +4390,50 @@ rrc_eNB_decode_ccch(
               MSC_AS_TIME_ARGS(ctxt_pP),
               ue_context_p->ue_context.rnti,
               dec_rval.consumed,
-              s_TMSI.mmec,
-              s_TMSI.m_TMSI,
+              ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code,
+              ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi,
               ue_context_p->ue_context.random_ue_identity);
-
           } else {
-            MSC_LOG_RX_DISCARDED_MESSAGE(
-              MSC_RRC_ENB,
-              MSC_RRC_UE,
-              Srb_info->Rx_buffer.Payload,
-              dec_rval.consumed,
-              MSC_AS_TIME_FMT" RRCConnectionRequest UE %x size %u random UE id (0x%" PRIx64 ")",
-              MSC_AS_TIME_ARGS(ctxt_pP),
-              ue_context_p->ue_context.rnti,
-              dec_rval.consumed,
-              ue_context_p->ue_context.random_ue_identity);
+            LOG_E(RRC,
+                  PROTOCOL_RRC_CTXT_UE_FMT" RRCConnectionRequest without random UE identity or S-TMSI not supported, let's reject the UE\n",
+                  PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP));
+            rrc_eNB_generate_RRCConnectionReject(ctxt_pP,
+                             rrc_eNB_get_ue_context(&eNB_rrc_inst[ctxt_pP->module_id], ctxt_pP->rnti),
+                             CC_id);
+            break;
           }
 
-          ue_context_p->ue_context.establishment_cause =
-            rrcConnectionRequest->establishmentCause;
-          LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Accept new connection from UE random UE identity (0x%" PRIx64 ") MME code %u TMSI %u cause %u\n",
-                PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
-                ue_context_p->ue_context.random_ue_identity,
-                ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code,
-                ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi,
-                ue_context_p->ue_context.establishment_cause);
+        }
+        LOG_D(RRC,
+              PROTOCOL_RRC_CTXT_UE_FMT" UE context: %X\n",
+              PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
+              ue_context_p);
+
+        if (ue_context_p != NULL) {
+
+
+#if defined(ENABLE_ITTI)
+          ue_context_p->ue_context.establishment_cause = rrcConnectionRequest->establishmentCause;
+	  if (stmsi_received==0)
+	    LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Accept new connection from UE random UE identity (0x%" PRIx64 ") MME code %u TMSI %u cause %u\n",
+		  PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
+		  ue_context_p->ue_context.random_ue_identity,
+		  ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code,
+		  ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi,
+		  ue_context_p->ue_context.establishment_cause);
+	  else
+	    LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Accept new connection from UE  MME code %u TMSI %u cause %u\n",
+		  PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
+		  ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code,
+		  ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi,
+		  ue_context_p->ue_context.establishment_cause);
 #else
           LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Accept new connection for UE random UE identity (0x%" PRIx64 ")\n",
                 PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
                 ue_context_p->ue_context.random_ue_identity);
 #endif
-          eNB_rrc_inst[ctxt_pP->module_id].Nb_ue++;
+          if (stmsi_received == 0)
+	    eNB_rrc_inst[ctxt_pP->module_id].Nb_ue++;
 
 #if CEDRIC_ROUX
 #if !defined(ENABLE_USE_MME)
@@ -4515,6 +4676,9 @@ rrc_eNB_decode_dcch(
   SCellToAddMod_r10_t                *scell = NULL;
 #endif
 
+  T(T_ENB_RRC_UL_DCCH_DATA_IN, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+    T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
   if ((Srb_id != 1) && (Srb_id != 2)) {
     LOG_E(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Received message on SRB%d, should not have ...\n",
           PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
@@ -4662,6 +4826,9 @@ rrc_eNB_decode_dcch(
       break;
 
     case UL_DCCH_MessageType__c1_PR_rrcConnectionReestablishmentComplete:
+      T(T_ENB_RRC_CONNECTION_REESTABLISHMENT_COMPLETE, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+        T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
 #ifdef RRC_MSG_PRINT
       LOG_F(RRC,"[MSG] RRC Connection Reestablishment Complete\n");
 
@@ -4736,6 +4903,9 @@ rrc_eNB_decode_dcch(
       break;
 
     case UL_DCCH_MessageType__c1_PR_securityModeComplete:
+      T(T_ENB_RRC_SECURITY_MODE_COMPLETE, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+        T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
 #ifdef RRC_MSG_PRINT
       LOG_F(RRC,"[MSG] RRC Security Mode Complete\n");
 
@@ -4778,6 +4948,9 @@ rrc_eNB_decode_dcch(
       break;
 
     case UL_DCCH_MessageType__c1_PR_securityModeFailure:
+      T(T_ENB_RRC_SECURITY_MODE_FAILURE, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+        T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
 #ifdef RRC_MSG_PRINT
       LOG_F(RRC,"[MSG] RRC Security Mode Failure\n");
 
@@ -4810,11 +4983,14 @@ rrc_eNB_decode_dcch(
       // cancel the security mode in PDCP
 
       // followup with the remaining procedure
-#warning "LG Removed rrc_eNB_generate_UECapabilityEnquiry after receiving securityModeFailure"
+//#warning "LG Removed rrc_eNB_generate_UECapabilityEnquiry after receiving securityModeFailure"
       rrc_eNB_generate_UECapabilityEnquiry(ctxt_pP, ue_context_p);
       break;
 
     case UL_DCCH_MessageType__c1_PR_ueCapabilityInformation:
+      T(T_ENB_RRC_UE_CAPABILITY_INFORMATION, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+        T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
 #ifdef RRC_MSG_PRINT
       LOG_F(RRC,"[MSG] RRC UECapablility Information \n");
 
@@ -4904,9 +5080,15 @@ rrc_eNB_decode_dcch(
       break;
 
     case UL_DCCH_MessageType__c1_PR_ulHandoverPreparationTransfer:
+      T(T_ENB_RRC_UL_HANDOVER_PREPARATION_TRANSFER, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+        T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
       break;
 
     case UL_DCCH_MessageType__c1_PR_ulInformationTransfer:
+      T(T_ENB_RRC_UL_INFORMATION_TRANSFER, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+        T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
 #ifdef RRC_MSG_PRINT
       LOG_F(RRC,"[MSG] RRC UL Information Transfer \n");
 
@@ -4940,27 +5122,48 @@ rrc_eNB_decode_dcch(
       break;
 
     case UL_DCCH_MessageType__c1_PR_counterCheckResponse:
+      T(T_ENB_RRC_COUNTER_CHECK_RESPONSE, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+        T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
       break;
 
 #ifdef Rel10
 
     case UL_DCCH_MessageType__c1_PR_ueInformationResponse_r9:
+      T(T_ENB_RRC_UE_INFORMATION_RESPONSE_R9, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+        T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
       break;
 
     case UL_DCCH_MessageType__c1_PR_proximityIndication_r9:
+      T(T_ENB_RRC_PROXIMITY_INDICATION_R9, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+        T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
       break;
 
     case UL_DCCH_MessageType__c1_PR_rnReconfigurationComplete_r10:
+      T(T_ENB_RRC_RECONFIGURATION_COMPLETE_R10, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+        T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
       break;
 
     case UL_DCCH_MessageType__c1_PR_mbmsCountingResponse_r10:
+      T(T_ENB_RRC_MBMS_COUNTING_RESPONSE_R10, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+        T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
       break;
 
     case UL_DCCH_MessageType__c1_PR_interFreqRSTDMeasurementIndication_r10:
+      T(T_ENB_RRC_INTER_FREQ_RSTD_MEASUREMENT_INDICATION, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+        T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
       break;
 #endif
 
     default:
+      T(T_ENB_RRC_UNKNOW_MESSAGE, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame),
+        T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rnti));
+
       LOG_E(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Unknown message %s:%u\n",
             PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),
             __FILE__, __LINE__);
@@ -5189,7 +5392,7 @@ case CROUX_HACK:
       /* Messages from eNB app */
     case RRC_CONFIGURATION_REQ:
       LOG_I(RRC, "[eNB %d] Received %s\n", instance, msg_name_p);
-      openair_rrc_lite_eNB_configuration(ENB_INSTANCE_TO_MODULE_ID(instance), &RRC_CONFIGURATION_REQ(msg_p));
+      openair_rrc_eNB_configuration(ENB_INSTANCE_TO_MODULE_ID(instance), &RRC_CONFIGURATION_REQ(msg_p));
       break;
 
 #   if ENABLE_RAL
@@ -5201,7 +5404,7 @@ case CROUX_HACK:
       //SPECTRA: Add the RRC connection reconfiguration with Second cell configuration
     case RRC_RAL_CONNECTION_RECONFIGURATION_REQ:
       //                 ue_mod_id = 0; /* TODO force ue_mod_id to first UE, NAS UE not virtualized yet */
-#warning "TODO GET RIGHT RNTI"
+//#warning "TODO GET RIGHT RNTI"
       PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt,
                                     instance,
                                     ENB_FLAG_YES,
diff --git a/openair2/RRC/LITE/rrc_eNB_GTPV1U.c b/openair2/RRC/LITE/rrc_eNB_GTPV1U.c
index b85933ad47525290d2ccbaeeb01f05672c57fe52..29ff0d9dc2994f7ee83f4163deccf35233717323 100755
--- a/openair2/RRC/LITE/rrc_eNB_GTPV1U.c
+++ b/openair2/RRC/LITE/rrc_eNB_GTPV1U.c
@@ -86,6 +86,7 @@ rrc_eNB_process_GTPV1U_CREATE_TUNNEL_RESP(
 			  create_tunnel_resp_pP->num_tunnels,
 			  ue_context_p->ue_context.enb_gtp_ebi[0],
 			  ue_context_p->ue_context.enb_gtp_teid[0]);
+        (void)rnti; /* avoid gcc warning "set but not used" */
     return 0;
   } else {
     return -1;
diff --git a/openair2/RRC/LITE/rrc_eNB_S1AP.c b/openair2/RRC/LITE/rrc_eNB_S1AP.c
index 227ddfec22904934aa20cf67d07e4fbb339a0c03..53e609b7bd18b3567cf59d521f416b99345dfbee 100644
--- a/openair2/RRC/LITE/rrc_eNB_S1AP.c
+++ b/openair2/RRC/LITE/rrc_eNB_S1AP.c
@@ -43,6 +43,7 @@
 # include "RRC/LITE/defs.h"
 # include "rrc_eNB_UE_context.h"
 # include "rrc_eNB_S1AP.h"
+# include "enb_config.h"
 
 # if defined(ENABLE_ITTI)
 #   include "asn1_conversions.h"
@@ -59,6 +60,11 @@
 #endif
 #include "msc.h"
 
+#include "UERadioAccessCapabilityInformation.h"
+
+#include "gtpv1u_eNB_task.h"
+#include "RRC/LITE/rrc_eNB_GTPV1U.h"
+
 /* Value to indicate an invalid UE initial id */
 static const uint16_t UE_INITIAL_ID_INVALID = 0;
 
@@ -233,7 +239,7 @@ rrc_eNB_get_ue_context_from_s1ap_ids(
 static e_SecurityAlgorithmConfig__cipheringAlgorithm rrc_eNB_select_ciphering(uint16_t algorithms)
 {
 
-#warning "Forced   return SecurityAlgorithmConfig__cipheringAlgorithm_eea0, to be deleted in future"
+//#warning "Forced   return SecurityAlgorithmConfig__cipheringAlgorithm_eea0, to be deleted in future"
   return SecurityAlgorithmConfig__cipheringAlgorithm_eea0;
 
   if (algorithms & S1AP_ENCRYPTION_EEA2_MASK) {
@@ -392,6 +398,7 @@ rrc_pdcp_config_security(
 #define DEBUG_SECURITY 1
 
 #if defined (DEBUG_SECURITY)
+#undef msg
 #define msg printf
 
   if (print_keys ==1 ) {
@@ -580,29 +587,42 @@ void rrc_eNB_send_S1AP_UE_CAPABILITIES_IND(
 //------------------------------------------------------------------------------
 {
   UECapabilityInformation_t *ueCapabilityInformation = &ul_dcch_msg->message.choice.c1.choice.ueCapabilityInformation;
-
-  if ((ueCapabilityInformation->criticalExtensions.present == UECapabilityInformation__criticalExtensions_PR_c1)
-      && (ueCapabilityInformation->criticalExtensions.choice.c1.present
-          == UECapabilityInformation__criticalExtensions__c1_PR_ueCapabilityInformation_r8)
-      && (ueCapabilityInformation->criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list.count > 0)) {
-    UE_CapabilityRAT_ContainerList_t* ue_CapabilityRAT_ContainerList =
-      &ueCapabilityInformation->criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList;
-    MessageDef *msg_p;
-
-    msg_p = itti_alloc_new_message (TASK_RRC_ENB, S1AP_UE_CAPABILITIES_IND);
-    S1AP_UE_CAPABILITIES_IND (msg_p).eNB_ue_s1ap_id = ue_context_pP->ue_context.eNB_ue_s1ap_id;
-    S1AP_UE_CAPABILITIES_IND (msg_p).ue_radio_cap.length = ue_CapabilityRAT_ContainerList->list.array[0]->ueCapabilityRAT_Container.size;
-    S1AP_UE_CAPABILITIES_IND (msg_p).ue_radio_cap.buffer = ue_CapabilityRAT_ContainerList->list.array[0]->ueCapabilityRAT_Container.buf;
-
-    itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p);
-
-    if (ue_CapabilityRAT_ContainerList->list.count > 1) {
-      LOG_W (RRC,"[eNB %d][UE %x] can only handle 1 UE capability RAT item for now (%d)\n",
-             ctxt_pP->module_id,
-             ue_context_pP->ue_context.rnti,
-             ue_CapabilityRAT_ContainerList->list.count);
-    }
+  /* 4096 is arbitrary, should be big enough */
+  unsigned char buf[4096];
+  unsigned char *buf2;
+  UERadioAccessCapabilityInformation_t rac;
+
+  if (ueCapabilityInformation->criticalExtensions.present != UECapabilityInformation__criticalExtensions_PR_c1
+      || ueCapabilityInformation->criticalExtensions.choice.c1.present != UECapabilityInformation__criticalExtensions__c1_PR_ueCapabilityInformation_r8) {
+    LOG_E(RRC, "[eNB %d][UE %x] bad UE capabilities\n", ctxt_pP->module_id, ue_context_pP->ue_context.rnti);
+    return;
   }
+
+  asn_enc_rval_t ret = uper_encode_to_buffer(&asn_DEF_UECapabilityInformation, ueCapabilityInformation, buf, 4096);
+  if (ret.encoded == -1) abort();
+
+  memset(&rac, 0, sizeof(UERadioAccessCapabilityInformation_t));
+
+  rac.criticalExtensions.present = UERadioAccessCapabilityInformation__criticalExtensions_PR_c1;
+  rac.criticalExtensions.choice.c1.present = UERadioAccessCapabilityInformation__criticalExtensions__c1_PR_ueRadioAccessCapabilityInformation_r8;
+  rac.criticalExtensions.choice.c1.choice.ueRadioAccessCapabilityInformation_r8.ue_RadioAccessCapabilityInfo.buf = buf;
+  rac.criticalExtensions.choice.c1.choice.ueRadioAccessCapabilityInformation_r8.ue_RadioAccessCapabilityInfo.size = (ret.encoded+7)/8;
+  rac.criticalExtensions.choice.c1.choice.ueRadioAccessCapabilityInformation_r8.nonCriticalExtension = NULL;
+
+  /* 8192 is arbitrary, should be big enough */
+  buf2 = malloc16(8192);
+  if (buf2 == NULL) abort();
+  ret = uper_encode_to_buffer(&asn_DEF_UERadioAccessCapabilityInformation, &rac, buf2, 8192);
+  if (ret.encoded == -1) abort();
+
+  MessageDef *msg_p;
+
+  msg_p = itti_alloc_new_message (TASK_RRC_ENB, S1AP_UE_CAPABILITIES_IND);
+  S1AP_UE_CAPABILITIES_IND (msg_p).eNB_ue_s1ap_id = ue_context_pP->ue_context.eNB_ue_s1ap_id;
+  S1AP_UE_CAPABILITIES_IND (msg_p).ue_radio_cap.length = (ret.encoded+7)/8;
+  S1AP_UE_CAPABILITIES_IND (msg_p).ue_radio_cap.buffer = buf2;
+
+  itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p);
 }
 
 //------------------------------------------------------------------------------
@@ -662,15 +682,16 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ(
         S1AP_NAS_FIRST_REQ (message_p).ue_identity.s_tmsi.mme_code = s_TMSI->mme_code;
         S1AP_NAS_FIRST_REQ (message_p).ue_identity.s_tmsi.m_tmsi = s_TMSI->m_tmsi;
         LOG_I(S1AP, "[eNB %d] Build S1AP_NAS_FIRST_REQ with s_TMSI: MME code %u M-TMSI %u ue %x\n",
-        ctxt_pP->module_id,
-        S1AP_NAS_FIRST_REQ (message_p).ue_identity.s_tmsi.mme_code,
-        S1AP_NAS_FIRST_REQ (message_p).ue_identity.s_tmsi.m_tmsi,
-        ue_context_pP->ue_context.rnti);
+            ctxt_pP->module_id,
+            S1AP_NAS_FIRST_REQ (message_p).ue_identity.s_tmsi.mme_code,
+            S1AP_NAS_FIRST_REQ (message_p).ue_identity.s_tmsi.m_tmsi,
+            ue_context_pP->ue_context.rnti);
       }
 
       if (rrcConnectionSetupComplete->registeredMME != NULL) {
         /* Fill GUMMEI */
         struct RegisteredMME *r_mme = rrcConnectionSetupComplete->registeredMME;
+        //int selected_plmn_identity = rrcConnectionSetupComplete->selectedPLMN_Identity;
 
         S1AP_NAS_FIRST_REQ (message_p).ue_identity.presenceMask |= UE_IDENTITIES_gummei;
 
@@ -679,9 +700,9 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ(
             /* Use first indicated PLMN MCC if it is defined */
             S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mcc = *r_mme->plmn_Identity->mcc->list.array[0];
             LOG_I(S1AP, "[eNB %d] Build S1AP_NAS_FIRST_REQ adding in s_TMSI: GUMMEI MCC %u ue %x\n",
-            ctxt_pP->module_id,
-            S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mcc,
-            ue_context_pP->ue_context.rnti);
+                ctxt_pP->module_id,
+                S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mcc,
+                ue_context_pP->ue_context.rnti);
           }
 
           if (r_mme->plmn_Identity->mnc.list.count > 0) {
@@ -692,6 +713,14 @@ rrc_eNB_send_S1AP_NAS_FIRST_REQ(
                   S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mnc,
                   ue_context_pP->ue_context.rnti);
           }
+        } else {
+          const Enb_properties_array_t   *enb_properties_p  = NULL;
+          enb_properties_p = enb_config_get();
+
+          // actually the eNB configuration contains only one PLMN (can be up to 6)
+          S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mcc = enb_properties_p->properties[ctxt_pP->module_id]->mcc;
+          S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mnc = enb_properties_p->properties[ctxt_pP->module_id]->mnc;
+          S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mnc_len = enb_properties_p->properties[ctxt_pP->module_id]->mnc_digit_length;
         }
 
         S1AP_NAS_FIRST_REQ (message_p).ue_identity.gummei.mme_code     = BIT_STRING_to_uint8 (&r_mme->mmec);
@@ -831,15 +860,15 @@ rrc_eNB_process_S1AP_DOWNLINK_NAS(
     LOG_F(RRC,"\n");
 #endif
     /* Transfer data to PDCP */
-    pdcp_rrc_data_req (
-      &ctxt,
-      DCCH,
-      *rrc_eNB_mui++,
-      SDU_CONFIRM_NO,
-      length,
-      buffer,
-      PDCP_TRANSMISSION_MODE_CONTROL);
-
+    rrc_data_req (
+		  &ctxt,
+		  DCCH,
+		  *rrc_eNB_mui++,
+		  SDU_CONFIRM_NO,
+		  length,
+		  buffer,
+		  PDCP_TRANSMISSION_MODE_CONTROL);
+    
     return (0);
   }
 }
@@ -849,7 +878,7 @@ int rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, const char
 {
   uint16_t                        ue_initial_id;
   uint32_t                        eNB_ue_s1ap_id;
-  MessageDef                     *message_gtpv1u_p = NULL;
+  //MessageDef                     *message_gtpv1u_p = NULL;
   gtpv1u_enb_create_tunnel_req_t  create_tunnel_req;
   gtpv1u_enb_create_tunnel_resp_t create_tunnel_resp;
 
@@ -1161,7 +1190,7 @@ int rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND (MessageDef *msg_p, const ch
     */
     {
       int      e_rab;
-      int      mod_id = 0;
+      //int      mod_id = 0;
       MessageDef *msg_delete_tunnels_p = NULL;
 
       MSC_LOG_TX_MESSAGE(
@@ -1180,7 +1209,7 @@ int rrc_eNB_process_S1AP_UE_CONTEXT_RELEASE_COMMAND (MessageDef *msg_p, const ch
       GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).rnti = ue_context_p->ue_context.rnti;
 
       for (e_rab = 0; e_rab < ue_context_p->ue_context.nb_of_e_rabs; e_rab++) {
-        GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).eps_bearer_id[GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_p).num_erab++] =
+        GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).eps_bearer_id[GTPV1U_ENB_DELETE_TUNNEL_REQ(msg_delete_tunnels_p).num_erab++] =
           ue_context_p->ue_context.enb_gtp_ebi[e_rab];
         // erase data
         ue_context_p->ue_context.enb_gtp_teid[e_rab] = 0;
diff --git a/openair2/RRC/LITE/rrc_eNB_S1AP.h b/openair2/RRC/LITE/rrc_eNB_S1AP.h
index ea797e8c20de80664e889f94cd11a5e65b48e81c..93a213c06fbcec73bd74f95c70e44fa2ae20f97e 100644
--- a/openair2/RRC/LITE/rrc_eNB_S1AP.h
+++ b/openair2/RRC/LITE/rrc_eNB_S1AP.h
@@ -63,6 +63,8 @@ rrc_eNB_S1AP_compare_ue_ids(
   struct rrc_ue_s1ap_ids_s* c2_pP
 );
 
+struct rrc_rnti_tree_s;
+
 RB_PROTOTYPE(rrc_rnti_tree_s, rrc_ue_s1ap_ids_s, entries, rrc_eNB_S1AP_compare_ue_ids);
 
 struct rrc_ue_s1ap_ids_s*
diff --git a/openair2/RRC/LITE/vars.h b/openair2/RRC/LITE/vars.h
index 122dea1df2504ac576919c40b1cc002e4c078104..cb6e8c52382975cc77b44679f70cedb83ea120e4 100644
--- a/openair2/RRC/LITE/vars.h
+++ b/openair2/RRC/LITE/vars.h
@@ -88,18 +88,24 @@ struct LogicalChannelConfig__ul_SpecificParameters LCSRB2 =  {3,
 };
 
 
+#ifdef Rel10
+struct LogicalChannelConfig__ext1 logicalChannelSR_Mask_r9_ext1 = {
+         logicalChannelSR_Mask_r9: &logicalChannelSR_Mask_r9
+};
+#endif
+
 // These are the default SRB configurations from 36.331 (Chapter 9, p. 176-179 in v8.6)
-LogicalChannelConfig_t  SRB1_logicalChannelConfig_defaultValue = {&LCSRB1
+LogicalChannelConfig_t  SRB1_logicalChannelConfig_defaultValue = {ul_SpecificParameters: &LCSRB1
 #ifdef Rel10
                                                                   ,
-                                                                  &logicalChannelSR_Mask_r9
+                                                                  ext1: &logicalChannelSR_Mask_r9_ext1
 #endif
                                                                  };
 
-LogicalChannelConfig_t SRB2_logicalChannelConfig_defaultValue = {&LCSRB2
+LogicalChannelConfig_t SRB2_logicalChannelConfig_defaultValue = {ul_SpecificParameters: &LCSRB2
 #ifdef Rel10
                                                                  ,
-                                                                 &logicalChannelSR_Mask_r9
+                                                                 ext1: &logicalChannelSR_Mask_r9_ext1
 #endif
                                                                 };
 
diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_new.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_new.c
index 477887e76f745c589ea308be9cf99ad03b74c5de..2eeae80097f2e85ca6bb40e95d0a5a346c48b6b8 100644
--- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_new.c
+++ b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_freelist/lfds611_freelist_new.c
@@ -48,7 +48,7 @@ int lfds611_freelist_new( struct lfds611_freelist_state **fs, lfds611_atom_t num
 
 
 /****************************************************************************/
-#pragma warning( disable : 4100 )
+//#pragma warning( disable : 4100 )
 
 void lfds611_freelist_use( struct lfds611_freelist_state *fs )
 {
@@ -59,7 +59,7 @@ void lfds611_freelist_use( struct lfds611_freelist_state *fs )
   return;
 }
 
-#pragma warning( default : 4100 )
+//#pragma warning( default : 4100 )
 
 
 
diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_delete.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_delete.c
index 718cfe1ae9fe99bda101828c4134f11de83f600a..a11b501e56f4ff1dde5157e36807e90d190198b6 100644
--- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_delete.c
+++ b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_delete.c
@@ -41,7 +41,7 @@ void lfds611_queue_delete( struct lfds611_queue_state *qs, void (*user_data_dele
 
 
 /****************************************************************************/
-#pragma warning( disable : 4100 )
+//#pragma warning( disable : 4100 )
 
 void lfds611_queue_internal_freelist_delete_function( void *user_data, void *user_state )
 {
@@ -53,5 +53,5 @@ void lfds611_queue_internal_freelist_delete_function( void *user_data, void *use
   return;
 }
 
-#pragma warning( default : 4100 )
+//#pragma warning( default : 4100 )
 
diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_new.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_new.c
index accc6c3769bfb63ba2913f91339039aa998378cf..7fec0a2e9024940431b27a02294953408764bd10 100644
--- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_new.c
+++ b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_new.c
@@ -46,7 +46,7 @@ int lfds611_queue_new( struct lfds611_queue_state **qs, lfds611_atom_t number_el
 
 
 /****************************************************************************/
-#pragma warning( disable : 4100 )
+//#pragma warning( disable : 4100 )
 
 void lfds611_queue_use( struct lfds611_queue_state *qs )
 {
@@ -57,14 +57,14 @@ void lfds611_queue_use( struct lfds611_queue_state *qs )
   return;
 }
 
-#pragma warning( default : 4100 )
+//#pragma warning( default : 4100 )
 
 
 
 
 
 /****************************************************************************/
-#pragma warning( disable : 4100 )
+//#pragma warning( disable : 4100 )
 
 int lfds611_queue_internal_freelist_init_function( void **user_data, void *user_state )
 {
@@ -82,7 +82,7 @@ int lfds611_queue_internal_freelist_init_function( void **user_data, void *user_
   return( rv );
 }
 
-#pragma warning( default : 4100 )
+//#pragma warning( default : 4100 )
 
 
 
diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_query.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_query.c
index 2a546dde39d3f904e4197e6fbfc407db3b1c725a..504485d7b5b278f7232ad093bbc4691926adbf31 100644
--- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_query.c
+++ b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_queue/lfds611_queue_query.c
@@ -5,7 +5,7 @@
 
 
 /****************************************************************************/
-#pragma warning( disable : 4100 )
+//#pragma warning( disable : 4100 )
 
 void lfds611_queue_query( struct lfds611_queue_state *qs, enum lfds611_queue_query_type query_type, void *query_input, void *query_output )
 {
@@ -31,7 +31,7 @@ void lfds611_queue_query( struct lfds611_queue_state *qs, enum lfds611_queue_que
   return;
 }
 
-#pragma warning( default : 4100 )
+//#pragma warning( default : 4100 )
 
 
 
diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_new.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_new.c
index 2fafe52a372ab8603c354b712c8715535639478d..6d8dde2a54adf42fa45277a6af58e7050989078b 100644
--- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_new.c
+++ b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_new.c
@@ -48,7 +48,7 @@ int lfds611_ringbuffer_new( struct lfds611_ringbuffer_state **rs, lfds611_atom_t
 
 
 /****************************************************************************/
-#pragma warning( disable : 4100 )
+//#pragma warning( disable : 4100 )
 
 void lfds611_ringbuffer_use( struct lfds611_ringbuffer_state *rs )
 {
@@ -59,5 +59,5 @@ void lfds611_ringbuffer_use( struct lfds611_ringbuffer_state *rs )
   return;
 }
 
-#pragma warning( default : 4100 )
+//#pragma warning( default : 4100 )
 
diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_query.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_query.c
index ad3d56a7884d066cbeced84815cc3e2456c5768d..11bf8b0b6e0deb1b96d1bc9cc9e62386bfa32b12 100644
--- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_query.c
+++ b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_ringbuffer/lfds611_ringbuffer_query.c
@@ -5,7 +5,7 @@
 
 
 /****************************************************************************/
-#pragma warning( disable : 4100 )
+//#pragma warning( disable : 4100 )
 
 void lfds611_ringbuffer_query( struct lfds611_ringbuffer_state *rs, enum lfds611_ringbuffer_query_type query_type, void *query_input, void *query_output )
 {
@@ -26,7 +26,7 @@ void lfds611_ringbuffer_query( struct lfds611_ringbuffer_state *rs, enum lfds611
   return;
 }
 
-#pragma warning( default : 4100 )
+//#pragma warning( default : 4100 )
 
 
 
diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_new.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_new.c
index 7142694a673c0815f264fec43672f474dec7e4ed..b48e349ab0b2203a369bee7f8a667c970277f2c8 100644
--- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_new.c
+++ b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_slist/lfds611_slist_new.c
@@ -31,7 +31,7 @@ int lfds611_slist_new( struct lfds611_slist_state **ss, void (*user_data_delete_
 
 
 /****************************************************************************/
-#pragma warning( disable : 4100 )
+//#pragma warning( disable : 4100 )
 
 void lfds611_slist_use( struct lfds611_slist_state *ss )
 {
@@ -42,7 +42,7 @@ void lfds611_slist_use( struct lfds611_slist_state *ss )
   return;
 }
 
-#pragma warning( default : 4100 )
+//#pragma warning( default : 4100 )
 
 
 
diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_delete.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_delete.c
index 6a79156a52353189a94a9740e88623b897157ddd..75700e6b3959c3447d846970b3f09c705dc08bec 100644
--- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_delete.c
+++ b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_delete.c
@@ -51,7 +51,7 @@ void lfds611_stack_clear( struct lfds611_stack_state *ss, void (*user_data_clear
 
 
 /****************************************************************************/
-#pragma warning( disable : 4100 )
+//#pragma warning( disable : 4100 )
 
 void lfds611_stack_internal_freelist_delete_function( void *user_data, void *user_state )
 {
@@ -63,5 +63,5 @@ void lfds611_stack_internal_freelist_delete_function( void *user_data, void *use
   return;
 }
 
-#pragma warning( default : 4100 )
+//#pragma warning( default : 4100 )
 
diff --git a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_new.c b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_new.c
index 820e51bcc51642fe48fc54507f856fb787b43c71..927f28c88c8e71f7ba7f78652e4dd8593946dec6 100644
--- a/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_new.c
+++ b/openair2/UTIL/LFDS/liblfds6.1.1/liblfds611/src/lfds611_stack/lfds611_stack_new.c
@@ -42,7 +42,7 @@ int lfds611_stack_new( struct lfds611_stack_state **ss, lfds611_atom_t number_el
 
 
 /****************************************************************************/
-#pragma warning( disable : 4100 )
+//#pragma warning( disable : 4100 )
 
 void lfds611_stack_use( struct lfds611_stack_state *ss )
 {
@@ -53,14 +53,14 @@ void lfds611_stack_use( struct lfds611_stack_state *ss )
   return;
 }
 
-#pragma warning( default : 4100 )
+//#pragma warning( default : 4100 )
 
 
 
 
 
 /****************************************************************************/
-#pragma warning( disable : 4100 )
+//#pragma warning( disable : 4100 )
 
 int lfds611_stack_internal_freelist_init_function( void **user_data, void *user_state )
 {
@@ -78,7 +78,7 @@ int lfds611_stack_internal_freelist_init_function( void **user_data, void *user_
   return( rv );
 }
 
-#pragma warning( default : 4100 )
+//#pragma warning( default : 4100 )
 
 
 
diff --git a/openair2/UTIL/LOG/log.c b/openair2/UTIL/LOG/log.c
index abbdbc01abf341236d01234442c042fbe25699da..0ef8f99d71fab2fd95caa6642226414e0900f659 100755
--- a/openair2/UTIL/LOG/log.c
+++ b/openair2/UTIL/LOG/log.c
@@ -698,6 +698,10 @@ void logRecord_mt(const char *file, const char *func, int line, int comp,
   char *log_start;
   char *log_end;
 
+  /* for no gcc warnings */
+  (void)log_start;
+  (void)log_end;
+
   c = &g_log->log_component[comp];
 
   // do not apply filtering for LOG_F
@@ -971,6 +975,10 @@ void logRecord_mt(const char *file, const char *func, int line, int comp,
    */
   char log_buffer[MAX_LOG_TOTAL];
 
+  /* for no gcc warnings */
+  (void)log_start;
+  (void)log_end;
+
   c = &g_log->log_component[comp];
 
   // do not apply filtering for LOG_F
diff --git a/openair2/UTIL/LOG/log.h b/openair2/UTIL/LOG/log.h
index c6abbfa001033107c8e1c57671f6e000d8514c0e..dce5a190e4d454b3fe8f60ed4fc1a9ada4e6ebdc 100755
--- a/openair2/UTIL/LOG/log.h
+++ b/openair2/UTIL/LOG/log.h
@@ -147,26 +147,40 @@ extern "C" {
 
 // debugging macros
 #ifdef USER_MODE
-#define LOG_G(c, x...) logIt(c, LOG_EMERG, x)
-#define LOG_A(c, x...) logIt(c, LOG_ALERT, x)
-#define LOG_C(c, x...) logIt(c, LOG_CRIT,  x)
-#define LOG_E(c, x...) logIt(c, LOG_ERR, x)
-#define LOG_W(c, x...) logIt(c, LOG_WARNING, x)
-#define LOG_N(c, x...) logIt(c, LOG_NOTICE, x)
-#define LOG_I(c, x...) logIt(c, LOG_INFO, x)
-#define LOG_D(c, x...) logIt(c, LOG_DEBUG, x)
-#define LOG_F(c, x...) logIt(c, LOG_FILE, x)  // log to a file, useful for the MSC chart generation
-#define LOG_T(c, x...) logIt(c, LOG_TRACE, x)
-#else
-#define LOG_G(c, x...) printk(x)
-#define LOG_A(c, x...) printk(x)
-#define LOG_C(c, x...) printk(x)
-#define LOG_E(c, x...) printk(x)
-#define LOG_W(c, x...) printk(x)
-#define LOG_N(c, x...) printk(x)
-#define LOG_I(c, x...) printk(x)
-#define LOG_D(c, x...) printk(x)
-#define LOG_T(c, x...) printk(x)
+#  if T_TRACER
+#    include "T.h"
+#    define LOG_I(c, x...) T(T_LEGACY_ ## c ## _INFO, T_PRINTF(x))
+#    define LOG_W(c, x...) T(T_LEGACY_ ## c ## _WARNING, T_PRINTF(x))
+#    define LOG_E(c, x...) T(T_LEGACY_ ## c ## _ERROR, T_PRINTF(x))
+#    define LOG_D(c, x...) T(T_LEGACY_ ## c ## _DEBUG, T_PRINTF(x))
+#    define LOG_T(c, x...) T(T_LEGACY_ ## c ## _TRACE, T_PRINTF(x))
+#    define LOG_G(c, x...) /* */
+#    define LOG_A(c, x...) /* */
+#    define LOG_C(c, x...) /* */
+#    define LOG_N(c, x...) /* */
+#    define LOG_F(c, x...) /* */
+#  else /* T_TRACER */
+#    define LOG_G(c, x...) logIt(c, LOG_EMERG, x)
+#    define LOG_A(c, x...) logIt(c, LOG_ALERT, x)
+#    define LOG_C(c, x...) logIt(c, LOG_CRIT,  x)
+#    define LOG_E(c, x...) logIt(c, LOG_ERR, x)
+#    define LOG_W(c, x...) logIt(c, LOG_WARNING, x)
+#    define LOG_N(c, x...) logIt(c, LOG_NOTICE, x)
+#    define LOG_I(c, x...) logIt(c, LOG_INFO, x)
+#    define LOG_D(c, x...) logIt(c, LOG_DEBUG, x)
+#    define LOG_F(c, x...) logIt(c, LOG_FILE, x)  // log to a file, useful for the MSC chart generation
+#    define LOG_T(c, x...) logIt(c, LOG_TRACE, x)
+#  endif /* T_TRACER */
+#else /* USER_MODE */
+#  define LOG_G(c, x...) printk(x)
+#  define LOG_A(c, x...) printk(x)
+#  define LOG_C(c, x...) printk(x)
+#  define LOG_E(c, x...) printk(x)
+#  define LOG_W(c, x...) printk(x)
+#  define LOG_N(c, x...) printk(x)
+#  define LOG_I(c, x...) printk(x)
+#  define LOG_D(c, x...) printk(x)
+#  define LOG_T(c, x...) printk(x)
 #endif
 /* @}*/
 
diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.c b/openair2/UTIL/LOG/vcd_signal_dumper.c
index 8dfbfd6ef5cb9d9d666a9c4e09591fa164fbee3f..78e481f3d6c43a7be089b4245342229990d3d082 100644
--- a/openair2/UTIL/LOG/vcd_signal_dumper.c
+++ b/openair2/UTIL/LOG/vcd_signal_dumper.c
@@ -106,6 +106,9 @@ const char* eurecomVariablesNames[] = {
   "lhw_cnt_tx",
   "pck_rx",
   "pck_tx",
+  "rx_seq_num",
+  "rx_seq_num_prv",
+  "tx_seq_num",
   "cnt",
   "dummy_dump",
   "itti_send_msg",
@@ -115,7 +118,62 @@ const char* eurecomVariablesNames[] = {
   "mp_alloc",
   "mp_free",
   "ue_inst_cnt_rx",
-  "ue_inst_cnt_tx"
+  "ue_inst_cnt_tx",
+  "dci_info",
+  "ue0_BSR",
+  "ue0_BO",
+  "ue0_scheduled",
+  "ue0_timing_advance",
+  "ue0_SR_ENERGY",
+  "ue0_SR_THRES",
+  "ue0_rssi0",
+  "ue0_rssi1",
+  "ue0_rssi2",
+  "ue0_rssi3",
+  "ue0_rssi4",
+  "ue0_rssi5",
+  "ue0_rssi6",
+  "ue0_rssi7",
+  "ue0_res0",
+  "ue0_res1",
+  "ue0_res2",
+  "ue0_res3",
+  "ue0_res4",
+  "ue0_res5",
+  "ue0_res6",
+  "ue0_res7",
+  "ue0_MCS0",
+  "ue0_MCS1",
+  "ue0_MCS2",
+  "ue0_MCS3",
+  "ue0_MCS4",
+  "ue0_MCS5",
+  "ue0_MCS6",
+  "ue0_MCS7",
+  "ue0_RB0",
+  "ue0_RB1",
+  "ue0_RB2",
+  "ue0_RB3",
+  "ue0_RB4",
+  "ue0_RB5",
+  "ue0_RB6",
+  "ue0_RB7",
+  "ue0_ROUND0",
+  "ue0_ROUND1",
+  "ue0_ROUND2",
+  "ue0_ROUND3",
+  "ue0_ROUND4",
+  "ue0_ROUND5",
+  "ue0_ROUND6",
+  "ue0_ROUND7",
+  "ue0_SFN0",
+  "ue0_SFN1",
+  "ue0_SFN2",
+  "ue0_SFN3",
+  "ue0_SFN4",
+  "ue0_SFN5",
+  "ue0_SFN6",
+  "ue0_SFN7",
 };
 
 const char* eurecomFunctionsNames[] = {
@@ -197,7 +255,15 @@ const char* eurecomFunctionsNames[] = {
   "macxface_phy_config_sib2_eNB",
   "macxface_phy_config_dedicated_eNB",
   "phy_ue_compute_prach",
-  "phy_enb_ulsch_decoding",
+  "phy_enb_ulsch_msg3",
+  "phy_enb_ulsch_decoding0",
+  "phy_enb_ulsch_decoding1",
+  "phy_enb_ulsch_decoding2",
+  "phy_enb_ulsch_decoding3",
+  "phy_enb_ulsch_decoding4",
+  "phy_enb_ulsch_decoding5",
+  "phy_enb_ulsch_decoding6",
+  "phy_enb_ulsch_decoding7",
   "phy_enb_sfgen",
   "phy_enb_prach_rx",
   "phy_enb_pdcch_tx",
diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.h b/openair2/UTIL/LOG/vcd_signal_dumper.h
index 68257484f0a1c141d3f1a2392f157d729b09d3f9..0592e78b50540ae3ee1f9a23e167814d2099837d 100644
--- a/openair2/UTIL/LOG/vcd_signal_dumper.h
+++ b/openair2/UTIL/LOG/vcd_signal_dumper.h
@@ -78,6 +78,9 @@ typedef enum {
   VCD_SIGNAL_DUMPER_VARIABLES_TX_LHWCNT,
   VCD_SIGNAL_DUMPER_VARIABLES_RX_PCK,
   VCD_SIGNAL_DUMPER_VARIABLES_TX_PCK,
+  VCD_SIGNAL_DUMPER_VARIABLES_RX_SEQ_NUM,
+  VCD_SIGNAL_DUMPER_VARIABLES_RX_SEQ_NUM_PRV,
+  VCD_SIGNAL_DUMPER_VARIABLES_TX_SEQ_NUM,
   VCD_SIGNAL_DUMPER_VARIABLES_CNT,
   VCD_SIGNAL_DUMPER_VARIABLES_DUMMY_DUMP,
   VCD_SIGNAL_DUMPER_VARIABLE_ITTI_SEND_MSG,
@@ -88,6 +91,61 @@ typedef enum {
   VCD_SIGNAL_DUMPER_VARIABLE_MP_FREE,
   VCD_SIGNAL_DUMPER_VARIABLES_UE_INST_CNT_RX,
   VCD_SIGNAL_DUMPER_VARIABLES_UE_INST_CNT_TX,
+  VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_BSR,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_BO,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_SCHEDULED,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_TIMING_ADVANCE,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_SR_ENERGY,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_SR_THRES,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI0,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI1,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI2,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI3,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI4,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI5,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI6,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_RSSI7,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES0,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES1,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES2,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES3,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES4,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES5,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES6,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_RES7,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS0,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS1,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS2,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS3,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS4,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS5,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS6,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_MCS7,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB0,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB1,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB2,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB3,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB4,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB5,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB6,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_RB7,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND0,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND1,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND2,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND3,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND4,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND5,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND6,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_ROUND7,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN0,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN1,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN2,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN3,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN4,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN5,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN6,
+  VCD_SIGNAL_DUMPER_VARIABLES_UE0_SFN7,
   VCD_SIGNAL_DUMPER_VARIABLES_LAST,
   VCD_SIGNAL_DUMPER_VARIABLES_END = VCD_SIGNAL_DUMPER_VARIABLES_LAST,
 } vcd_signal_dump_variables;
@@ -171,7 +229,15 @@ typedef enum {
   VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_CONFIG_SIB2_ENB,
   VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_CONFIG_DEDICATED_ENB,
   VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_UE_COMPUTE_PRACH,
-  VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING,
+  VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_MSG3,
+  VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING0,
+  VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING1,
+  VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING2,
+  VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING3,
+  VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING4,
+  VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING5,
+  VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING6,
+  VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING7,
   VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_SFGEN,
   VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,
   VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,
@@ -309,6 +375,18 @@ void vcd_signal_dumper_dump_function_by_name(vcd_signal_dump_functions  function
 
 extern int ouput_vcd;
 
+#if T_TRACER
+
+#include "T.h"
+
+#define VCD_SIGNAL_DUMPER_INIT(x)         /* nothing */
+#define VCD_SIGNAL_DUMPER_CLOSE()         /* nothing */
+#define VCD_SIGNAL_DUMPER_CREATE_HEADER() /* nothing */
+#define VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(var, val) T_VCD_VARIABLE(var, val)
+#define VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(var, val) T_VCD_FUNCTION(var, val)
+
+#else /* T_TRACER */
+
 #if defined(ENABLE_VCD)
    #define VCD_SIGNAL_DUMPER_INIT(aRgUmEnT)                   vcd_signal_dumper_init(aRgUmEnT)
    #define VCD_SIGNAL_DUMPER_CLOSE()                          vcd_signal_dumper_close()
@@ -323,5 +401,7 @@ extern int ouput_vcd;
    #define VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(vAr1,vAr2)
 #endif
 
+#endif /* T_TRACER */
+
 #endif /* !defined (VCD_SIGNAL_DUMPER_H_) */
 
diff --git a/openair2/UTIL/OCG/OCG_parse_XML.c b/openair2/UTIL/OCG/OCG_parse_XML.c
index 5397cdbd98bab4ca67369cb812d5c8ab689aefe9..0100d742e1b03ce09c70901cae364cfac06d50d3 100644
--- a/openair2/UTIL/OCG/OCG_parse_XML.c
+++ b/openair2/UTIL/OCG/OCG_parse_XML.c
@@ -51,10 +51,6 @@
 #include "UTIL/OPT/opt.h"
 /*----------------------------------------------------------------------------*/
 
-#ifndef HAVE_STRNDUP
-char * strndup (const char *s, size_t size);
-#endif
-
 static int oai_emulation_;  /*!< \brief indicating that the parsing position is now within OAI_Emulation_*/
 
 static int environment_system_config_;    /*!< \brief indicating that the parsing position is now within Envi_Config_*/
diff --git a/openair2/UTIL/OMG/common.c b/openair2/UTIL/OMG/common.c
index dd12cb302aac4e475d0479371d00858bdf094c08..d02ccf63ced28432fa8bfbe1d9ea40cbb1711387 100644
--- a/openair2/UTIL/OMG/common.c
+++ b/openair2/UTIL/OMG/common.c
@@ -158,6 +158,7 @@ remove_node_entry (node_struct * node, node_list * node_vector)
 
       if (list->next->node->id == node->id) {
         toremove = tmp; // TODO delete the entry
+        (void)toremove; /* avoid gcc warning "set but not used" */
         tmp = list->next->next;
 
         if (tmp != NULL) {
@@ -259,13 +260,11 @@ node_list *
 remove_node (node_list * list, int nid, int node_type)
 {
 
-  int found;
   node_list *current = NULL, *previous = NULL;
 
   //int cond=0;
   //int i=0;
   if (list == NULL) {
-    found = 1;    //false
     return NULL;
   } else {
     //start search
@@ -280,12 +279,10 @@ remove_node (node_list * list, int nid, int node_type)
 
     //holds: current = NULL or  type != node_type or.., but not both
     if (current == NULL) {
-      found = 1;
       LOG_E (OMG, " Element to remove is not found\n ");
       return NULL;
     }     //value not found
     else {
-      found = 0;    // true                value found
 
       if (current == list) {
         list = current->next;
@@ -322,7 +319,6 @@ node_struct *
 find_node (node_list * list, int nid, int node_type)
 {
 
-  int found;
   node_list *current;
 
   if (list == NULL) {
@@ -340,7 +336,6 @@ find_node (node_list * list, int nid, int node_type)
 
     //holds: current = NULL or  type != node_type or.., but not both
     if (current == NULL) {
-      found = 1;
       LOG_D (OMG,
              " Element to find in Node_Vector with ID: %d could not be found\n ",
              nid);
@@ -380,7 +375,7 @@ node_list *
 reset_node_list (node_list * list)
 {
   node_list *tmp;
-  node_list *last = list;
+  //node_list *last = list;
 
   if (list == NULL) {
     //printf("Node_list is NULL\n");
diff --git a/openair2/UTIL/OMG/omg.c b/openair2/UTIL/OMG/omg.c
index 11bdc62071207565f6d47c56c778d9b94123d49e..12b9395f750422d37d9d27543f5a5c64eb6d22c6 100644
--- a/openair2/UTIL/OMG/omg.c
+++ b/openair2/UTIL/OMG/omg.c
@@ -301,7 +301,7 @@ set_new_mob_type (int id, int node_t, int mob_t, double cur_time)
 
   int prev_mob;
   node_list *tmp;
-  job_list *tmp2, *prev_job;
+  //job_list *tmp2, *prev_job;
   pair_struct *pair;
   double pause_p;
 
diff --git a/openair2/UTIL/OMG/steadystaterwp.c b/openair2/UTIL/OMG/steadystaterwp.c
index c466f3cd2316a2c044b0e6fbb359e8c276dde3fd..ba2e0d88f7ba535b70bf36c3c4026ec5029cbc0f 100644
--- a/openair2/UTIL/OMG/steadystaterwp.c
+++ b/openair2/UTIL/OMG/steadystaterwp.c
@@ -173,7 +173,7 @@ place_steadystaterwp_node (node_struct * node)
 void
 sleep_steadystaterwp_node (pair_struct * pair, double cur_time)
 {
-  static int initial = 1;
+  //static int initial = 1;
   node_struct *node;
   node = pair->b;
   node->mobile = 0;
@@ -209,10 +209,10 @@ sleep_steadystaterwp_node (pair_struct * pair, double cur_time)
 void
 move_steadystaterwp_node (pair_struct * pair, double cur_time)
 {
-  static int initial = 1;
+  //static int initial = 1;
   double distance, journeytime_next, max_distance;
   double temp_x, temp_y, u1, u2;
-  int loc_num;
+  //int loc_num;
   double pr, block_xmin, block_ymin;
 
   //LOG_D (OMG, "[STEADY_RWP] move node: %d\n", node->ID);
diff --git a/openair2/UTIL/OMG/sumo.c b/openair2/UTIL/OMG/sumo.c
index f709a73e2a946305fee222083416c43d543e079e..4af34d0bc126730d63e844c169fef99d99674c1e 100644
--- a/openair2/UTIL/OMG/sumo.c
+++ b/openair2/UTIL/OMG/sumo.c
@@ -70,7 +70,7 @@ start_sumo_generator (omg_global_param omg_param_list)
 
   if ((pid = fork ()) == 0) {
     // Start SUMO in the child process
-    system (sumo_line);
+    if (system (sumo_line)) ;  /* this if for no gcc warnings */
     //childs addresss space
   }
 
diff --git a/openair2/UTIL/OMG/trace.c b/openair2/UTIL/OMG/trace.c
index 89a9377f93d2dbb7140a2bbf6e412dee0fd498ca..144b9ae597a1cd4384d7256519ab12b7fc4657bc 100644
--- a/openair2/UTIL/OMG/trace.c
+++ b/openair2/UTIL/OMG/trace.c
@@ -55,7 +55,7 @@ int
 start_trace_generator (omg_global_param omg_param_list)
 {
   double cur_time = 0.0;
-  int immobile = 0;
+  //int immobile = 0;
   int node_number;
   node_struct *node = NULL;
   mobility_struct *mobility = NULL;
@@ -235,7 +235,7 @@ schedule_trace_node (pair_struct * pair, node_data * n_data, double cur_time)
 void
 sleep_trace_node (pair_struct * pair, node_data * n_data, double cur_time)
 {
-  double journeytime, distance;
+  //double journeytime, distance;
   node_struct *node = pair->b;
   node->mobile = 0;
   node->mob->speed = 0.0;
diff --git a/openair2/UTIL/OMG/trace_hashtable.c b/openair2/UTIL/OMG/trace_hashtable.c
index 2ecb3922193b0d3473d70308160755b884b99fe7..51f745de8906a234cc9b26126cda5eee0e2c7336 100644
--- a/openair2/UTIL/OMG/trace_hashtable.c
+++ b/openair2/UTIL/OMG/trace_hashtable.c
@@ -58,8 +58,6 @@ hash_table_t **table;
 void
 create_new_table (int node_type)
 {
-  int i;
-
   if(table==NULL)
     table = (hash_table_t **) calloc (MAX_NUM_NODE_TYPES, sizeof (hash_table_t*));
 
diff --git a/openair2/UTIL/OMV/structures.h b/openair2/UTIL/OMV/structures.h
index f3b2b69d73d79e0f4645257a537c76423d050a1a..6c131371cb93f239bd2225fe95586ff5669c6b15 100755
--- a/openair2/UTIL/OMV/structures.h
+++ b/openair2/UTIL/OMV/structures.h
@@ -44,7 +44,9 @@
 #define Maxneighbor 64
 #define NUMBER_OF_UE_MAX 64
 #define NUMBER_OF_eNB_MAX 3
-#define NB_ANTENNAS_RX  4
+#ifndef NB_ANTENNAS_RX
+#  define NB_ANTENNAS_RX  4
+#endif
 #endif
 //
 
diff --git a/openair2/UTIL/OPT/probe.c b/openair2/UTIL/OPT/probe.c
index effd0bee852dba5a298099519ea90a5fc55297fd..eef98ae72975e4e945ed0d4f6cf29d61894a4584 100644
--- a/openair2/UTIL/OPT/probe.c
+++ b/openair2/UTIL/OPT/probe.c
@@ -137,27 +137,15 @@ typedef guint8   gboolean;
 
 //static unsigned char g_PDUBuffer[1600];
 //static unsigned int g_PDUOffset;
-#ifdef JUMBO_FRAME
-static unsigned char g_frameBuffer[9000];
-#else
-static unsigned char g_frameBuffer[1600];
-#endif 
-//static unsigned char g_fileBuffer[1600];
-static unsigned int g_frameOffset;
+
 
 char in_ip[40];
 char in_path[100];
-static uint16_t in_port;
 FILE *file_fd = NULL;
 
 trace_mode_t opt_type = OPT_NONE;
 static radio_type_t radio_type;
 static unsigned int subframesSinceCaptureStart;
-// double  timing_perf[250];
-// clock_t timing_in[250];
-// clock_t timing_out[250];
-int test=0;
-int init_value=0;
 
 static int g_socksd = -1;/* UDP socket used for sending frames */
 static struct sockaddr_in g_serv_addr;
@@ -277,66 +265,73 @@ static void SendFrame(guint8 radioType, guint8 direction, guint8 rntiType,
                       guint8 oob_event, guint8 oob_event_value,
                       uint8_t *pdu_buffer, unsigned int pdu_buffer_size)
 {
+  #ifdef JUMBO_FRAME
+     static unsigned char frameBuffer[9000];
+  #else
+     static unsigned char frameBuffer[1600];
+  #endif 
+  static unsigned int frameOffset;
+
   ssize_t bytesSent;
-  g_frameOffset = 0;
+  frameOffset = 0;
   uint16_t tmp16;
 
   /********************************************************************/
   /* Fixed start to each frame (allowing heuristic dissector to work) */
   /* Not NULL terminated */
-  memset(g_frameBuffer+g_frameOffset, 0, sizeof(mac_lte_info)+pdu_buffer_size + 8);
+  memset(frameBuffer+frameOffset, 0, sizeof(mac_lte_info)+pdu_buffer_size + 8);
 
-  memcpy(g_frameBuffer+g_frameOffset, MAC_LTE_START_STRING,
+  memcpy(frameBuffer+frameOffset, MAC_LTE_START_STRING,
          strlen(MAC_LTE_START_STRING));
-  g_frameOffset += strlen(MAC_LTE_START_STRING);
+  frameOffset += strlen(MAC_LTE_START_STRING);
 
   /******************************************************************************/
   /* Now write out fixed fields (the mandatory elements of struct mac_lte_info) */
-  g_frameBuffer[g_frameOffset++] = radioType;
-  g_frameBuffer[g_frameOffset++] = direction;
-  g_frameBuffer[g_frameOffset++] = rntiType;
+  frameBuffer[frameOffset++] = radioType;
+  frameBuffer[frameOffset++] = direction;
+  frameBuffer[frameOffset++] = rntiType;
 
   /*************************************/
   /* Now optional fields               */
 
   /* RNTI */
-  g_frameBuffer[g_frameOffset++] = MAC_LTE_RNTI_TAG;
+  frameBuffer[frameOffset++] = MAC_LTE_RNTI_TAG;
   tmp16 = htons(rnti);
-  memcpy(g_frameBuffer+g_frameOffset, &tmp16, 2);
-  g_frameOffset += 2;
+  memcpy(frameBuffer+frameOffset, &tmp16, 2);
+  frameOffset += 2;
 
   /* UEId */
-  g_frameBuffer[g_frameOffset++] = MAC_LTE_UEID_TAG;
+  frameBuffer[frameOffset++] = MAC_LTE_UEID_TAG;
   tmp16 = htons(ueid);
-  memcpy(g_frameBuffer+g_frameOffset, &tmp16, 2);
-  g_frameOffset += 2;
+  memcpy(frameBuffer+frameOffset, &tmp16, 2);
+  frameOffset += 2;
 
   /* Subframe number */
-  g_frameBuffer[g_frameOffset++] = MAC_LTE_SUBFRAME_TAG;
+  frameBuffer[frameOffset++] = MAC_LTE_SUBFRAME_TAG;
   tmp16 = htons(subframeNumber); // frame counter : this will give an expert info as wireshark expects SF and not F
-  memcpy(g_frameBuffer+g_frameOffset, &tmp16, 2);
-  g_frameOffset += 2;
+  memcpy(frameBuffer+frameOffset, &tmp16, 2);
+  frameOffset += 2;
 
-  g_frameBuffer[g_frameOffset++] = MAC_LTE_CRC_STATUS_TAG;
-  g_frameBuffer[g_frameOffset++] = crcStatus;
+  frameBuffer[frameOffset++] = MAC_LTE_CRC_STATUS_TAG;
+  frameBuffer[frameOffset++] = crcStatus;
   
 #ifdef WIRESHARK_DEV
-  g_frameOffset += 2;
+  frameOffset += 2;
   tmp16 = htons(subframeNumber); // subframe
-  memcpy(g_frameBuffer+g_frameOffset, &tmp16, 2);
-  g_frameOffset += 2;
+  memcpy(frameBuffer+frameOffset, &tmp16, 2);
+  frameOffset += 2;
 #endif
 
   /***********************************************************/
   /* For these optional fields, no need to encode if value is default */
   if (!isPredefinedData) {
-    g_frameBuffer[g_frameOffset++] = MAC_LTE_PREDEFINED_DATA_TAG;
-    g_frameBuffer[g_frameOffset++] = isPredefinedData;
+    frameBuffer[frameOffset++] = MAC_LTE_PREDEFINED_DATA_TAG;
+    frameBuffer[frameOffset++] = isPredefinedData;
   }
 
   if (retx != 0) {
-    g_frameBuffer[g_frameOffset++] = MAC_LTE_RETX_TAG;
-    g_frameBuffer[g_frameOffset++] = retx;
+    frameBuffer[frameOffset++] = MAC_LTE_RETX_TAG;
+    frameBuffer[frameOffset++] = retx;
   }
 
 #ifdef WIRESHARK_DEV
@@ -347,19 +342,19 @@ static void SendFrame(guint8 radioType, guint8 direction, guint8 rntiType,
     switch (oob_event) {
     case ltemac_send_preamble :
       LOG_D(OPT,"oob event %d %d\n",ltemac_send_preamble );
-      //g_frameBuffer[g_frameOffset++]=0;
-      //g_frameBuffer[g_frameOffset++]=0;
-      //g_frameBuffer[g_frameOffset++]=0;
-      g_frameBuffer[g_frameOffset++] = MAC_LTE_OOB_EVENT_TAG;
-      g_frameBuffer[g_frameOffset++]=ltemac_send_preamble;
-      g_frameBuffer[g_frameOffset++]=rnti; // is the preamble
-      g_frameBuffer[g_frameOffset++]=oob_event_value;
+      //frameBuffer[frameOffset++]=0;
+      //frameBuffer[frameOffset++]=0;
+      //frameBuffer[frameOffset++]=0;
+      frameBuffer[frameOffset++] = MAC_LTE_OOB_EVENT_TAG;
+      frameBuffer[frameOffset++]=ltemac_send_preamble;
+      frameBuffer[frameOffset++]=rnti; // is the preamble
+      frameBuffer[frameOffset++]=oob_event_value;
       break;
 
     case ltemac_send_sr:
-      g_frameBuffer[g_frameOffset++]=ltemac_send_sr;
-      g_frameOffset+=2;
-      g_frameBuffer[g_frameOffset++]=oob_event_value;
+      frameBuffer[frameOffset++]=ltemac_send_sr;
+      frameOffset+=2;
+      frameBuffer[frameOffset++]=oob_event_value;
       break;
 
     case ltemac_sr_failure:
@@ -372,23 +367,23 @@ static void SendFrame(guint8 radioType, guint8 direction, guint8 rntiType,
 #endif
   /***************************************/
   /* Now write the MAC PDU               */
-  g_frameBuffer[g_frameOffset++] = MAC_LTE_PAYLOAD_TAG;
+  frameBuffer[frameOffset++] = MAC_LTE_PAYLOAD_TAG;
   
   /* Append actual PDU  */
-  //memcpy(g_frameBuffer+g_frameOffset, g_PDUBuffer, g_PDUOffset);
-  //g_frameOffset += g_PDUOffset;
+  //memcpy(frameBuffer+frameOffset, g_PDUBuffer, g_PDUOffset);
+  //frameOffset += g_PDUOffset;
   if (pdu_buffer != NULL) {
-    memcpy(g_frameBuffer+g_frameOffset, (void*)pdu_buffer, pdu_buffer_size);
-    g_frameOffset += pdu_buffer_size;
+    memcpy(frameBuffer+frameOffset, (void*)pdu_buffer, pdu_buffer_size);
+    frameOffset += pdu_buffer_size;
   }
 
   /* Send out the data over the UDP socket */
-  bytesSent = sendto(g_socksd, g_frameBuffer, g_frameOffset, 0,
+  bytesSent = sendto(g_socksd, frameBuffer, frameOffset, 0,
                      (const struct sockaddr *)&g_serv_addr, sizeof(g_serv_addr));
 
-  if (bytesSent != g_frameOffset) {
+  if (bytesSent != frameOffset) {
     LOG_W(OPT, "sendto() failed (not a thread-safe func)- expected %d bytes, got %d (errno=%d)\n",
-          g_frameOffset, bytesSent, errno);
+          frameOffset, bytesSent, errno);
     //exit(1);
   }
 }
@@ -509,13 +504,14 @@ void trace_pdu(int direction, uint8_t *pdu_buffer, unsigned int pdu_buffer_size,
 /*---------------------------------------------------*/
 int init_opt(char *path, char *ip, char *port, radio_type_t radio_type_p)
 {
+  uint16_t in_port;
   subframesSinceCaptureStart = 0;
 
   if (path != NULL) {
     strncpy( in_path, path, sizeof(in_path) );
     in_path[sizeof(in_path) - 1] = 0; // terminate string
   } else {
-    strcpy( in_path, "/tmp/oai_opt.pcap" );
+    strcpy( in_path, "/tmp/opt.pcap" );
   }
 
   if (ip != NULL) {
@@ -612,37 +608,4 @@ void terminate_opt(void)
     break;
   }
 }
-/*
-double *timing_analyzer(int index, int direction ){
-//
-int i;
-if (direction==0)// in
-{
-    timing_in[index]=clock();
-    //if(timing_out[index+100]>timing_in[index+100]);
-    //timing_perf[index+100] +=(double)((double)(timing_out[index+100]-timing_in[index+100])/(double)CLOCKS_PER_SEC);
-}
-else
-{
-    timing_out[index]=clock();
-    if(index==5)timing_perf[index]=0;
-    timing_perf[index] +=(double)((double)(timing_out[index]-timing_in[index])/(((double)CLOCKS_PER_SEC)/1000000));
-
-    //LOG_I(OPT,"timing_analyser index %d =%f\n",index,timing_perf[index]);
-    init_value++;
-    if(init_value==500)
-    {
-        for(i=0;i<6;i++)
-        {
-            LOG_I(OPT,"timing_analyser index %d =%f\n",i,timing_perf[i]);
-        }
-        init_value=0;
-    }
 
-    return(&timing_perf[0]);
-
-}
-
-}
-
-*/
diff --git a/openair2/UTIL/OSA/osa_stream_eea.c b/openair2/UTIL/OSA/osa_stream_eea.c
index 0a044e2e01464de3c71a9e454e5b1c56ef9810c1..8e346631ecb13d04c53eef01e89982c1a5d077c7 100644
--- a/openair2/UTIL/OSA/osa_stream_eea.c
+++ b/openair2/UTIL/OSA/osa_stream_eea.c
@@ -78,7 +78,6 @@ int stream_encrypt_eea1(stream_cipher_t *stream_cipher, uint8_t **out)
   int       n ;
   int       i           = 0;
   uint32_t  zero_bit    = 0;
-  uint32_t  byte_length;
   uint32_t *KS;
   uint32_t  K[4],IV[4];
 
@@ -89,7 +88,6 @@ int stream_encrypt_eea1(stream_cipher_t *stream_cipher, uint8_t **out)
 
   n = ( stream_cipher->blength + 31 ) / 32;
   zero_bit = stream_cipher->blength & 0x7;
-  byte_length = stream_cipher->blength >> 3;
 
   memset(&snow_3g_context, 0, sizeof(snow_3g_context));
   /*Initialisation*/
diff --git a/openair2/UTIL/OTG/otg_kpi.c b/openair2/UTIL/OTG/otg_kpi.c
index 3aa55df05faddbd28535377d3de180c8f58d79d6..877150d892205cff1beeebfa3464c6f9b2dde7ad 100644
--- a/openair2/UTIL/OTG/otg_kpi.c
+++ b/openair2/UTIL/OTG/otg_kpi.c
@@ -61,7 +61,7 @@ void tx_throughput(int src, int dst, int application)
     else if (g_otg->flow_start[src][dst][application] < get_ctime() )
       otg_info->tx_throughput[src][dst][application]=((double)otg_info->tx_num_bytes[src][dst][application] *1000*8)/ ((get_ctime() - g_otg->flow_start[src][dst][application])*1024);
     else 
-      LOG_W("[src %d][dst %d][app %d] flow start time less than the simu time (start %d, duration %d, ctime %d)\n",
+      LOG_W(OTG, "[src %d][dst %d][app %d] flow start time less than the simu time (start %d, duration %d, ctime %d)\n",
 	    src, dst, application,
 	    g_otg->flow_start[src][dst][application],
 	    g_otg->flow_duration[src][dst][application],
@@ -94,7 +94,7 @@ if ((g_otg->flow_start[src][dst][application]+g_otg->flow_duration[src][dst][app
     else if (g_otg->flow_start[src][dst][application] < get_ctime() )
       otg_info->rx_goodput[src][dst][application]=((double)otg_info->rx_num_bytes[src][dst][application] *1000*8)/ ((get_ctime() - g_otg->flow_start[src][dst][application])*1024);
     else 
-      LOG_W("[src %d][dst %d][app %d] flow start time less than the simu time (start %d, duration %d, ctime %d)\n",
+      LOG_W(OTG, "[src %d][dst %d][app %d] flow start time less than the simu time (start %d, duration %d, ctime %d)\n",
 	    src, dst, application,
 	    g_otg->flow_start[src][dst][application],
 	    g_otg->flow_duration[src][dst][application],
diff --git a/openair2/UTIL/OTG/otg_rx.c b/openair2/UTIL/OTG/otg_rx.c
index 8331dd84771703efa2057c450d80c3d284af42dc..3f0d35d2238f70e20a4a55fac0f2e16b0fe630b6 100644
--- a/openair2/UTIL/OTG/otg_rx.c
+++ b/openair2/UTIL/OTG/otg_rx.c
@@ -113,7 +113,7 @@ int otg_rx_pkt(const int dst_instanceP, const int ctime, const char * const buff
       dst_instance = otg_hdr_rx->dst_instance;
 
       if (dst_instance != dst_instanceP) {
-#warning "LG: TODO think about multicast traffic"
+//#warning "LG: TODO think about multicast traffic"
         LOG_W(OTG,"[SRC %d][DST %d] [FLOW_idx %d][APP TYPE %d] RX INFO pkt at time %d: flag 0x %x, seq number %d, tx time %d, size (hdr %d, pdcp %d)  not for dest instance %u\n",
               dst_instanceP);
       }
diff --git a/openair3/GTPV1-U/gtpv1u.h b/openair3/GTPV1-U/gtpv1u.h
index 264fedfe774e36cc74c1548eb4a108ade733b185..e2af712f7be04961f3509ed6018bb9371890df68 100644
--- a/openair3/GTPV1-U/gtpv1u.h
+++ b/openair3/GTPV1-U/gtpv1u.h
@@ -54,7 +54,7 @@
 # define GTPU_ERROR(x, args...)   fprintf(stderr, "[GTPU][E]"x, ##args)
 #endif
 
-#warning "TO BE REFINED"
+//#warning "TO BE REFINED"
 # define GTPU_HEADER_OVERHEAD_MAX 64
 
 uint32_t gtpv1u_new_teid(void);
diff --git a/openair3/GTPV1-U/gtpv1u_eNB.c b/openair3/GTPV1-U/gtpv1u_eNB.c
index ca492469b1b87de8aa1ef02b2773ae2d5e3cacfa..9f2475ef37b204abb3f215d4778bf816b29cdd2c 100644
--- a/openair3/GTPV1-U/gtpv1u_eNB.c
+++ b/openair3/GTPV1-U/gtpv1u_eNB.c
@@ -333,7 +333,7 @@ NwGtpv1uRcT gtpv1u_eNB_process_stack_req(
             gtpv1u_teid_data_p->eps_bearer_id);
 #endif
 
-#warning "LG eps bearer mapping to DRB id to do (offset -4)"
+//#warning "LG eps bearer mapping to DRB id to do (offset -4)"
       PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, gtpv1u_teid_data_p->enb_id, ENB_FLAG_YES,  gtpv1u_teid_data_p->ue_id, 0, 0,gtpv1u_teid_data_p->enb_id);
 
       MSC_LOG_TX_MESSAGE(
@@ -611,7 +611,7 @@ gtpv1u_new_data_req(
   if (bearer_p->state != BEARER_UP) {
     LOG_W(GTPU, "Trying to send data over bearer with state(%u) != BEARER_UP\n",
           bearer_p->state);
-#warning  LG: HACK WHILE WAITING FOR NAS, normally return -1
+//#warning  LG: HACK WHILE WAITING FOR NAS, normally return -1
 
     if (bearer_p->state != BEARER_IN_CONFIG)
       return -1;
@@ -673,7 +673,7 @@ gtpv1u_create_s1u_tunnel(
   teid_t                   s1u_teid             = 0;
   gtpv1u_teid_data_t      *gtpv1u_teid_data_p   = NULL;
   gtpv1u_ue_data_t        *gtpv1u_ue_data_p     = NULL;
-  MessageDef              *message_p            = NULL;
+  //MessageDef              *message_p            = NULL;
   hashtable_rc_t           hash_rc              = HASH_TABLE_KEY_NOT_EXISTS;
   int                      i;
   ebi_t                    eps_bearer_id        = 0;
@@ -996,7 +996,7 @@ void *gtpv1u_eNB_task(void *args)
 {
   int                       rc = 0;
   instance_t                instance;
-  const char               *msg_name_p;
+  //const char               *msg_name_p;
 
   rc = gtpv1u_eNB_init();
   AssertFatal(rc == 0, "gtpv1u_eNB_init Failed");
@@ -1014,7 +1014,7 @@ void *gtpv1u_eNB_task(void *args)
     DevAssert(received_message_p != NULL);
 
     instance = ITTI_MSG_INSTANCE(received_message_p);
-    msg_name_p = ITTI_MSG_NAME(received_message_p);
+    //msg_name_p = ITTI_MSG_NAME(received_message_p);
 
     switch (ITTI_MSG_ID(received_message_p)) {
 
@@ -1081,6 +1081,7 @@ void *gtpv1u_eNB_task(void *args)
             LOG_E(GTPU, "nwGtpv1uGpduMsgNew failed: 0x%x\n", rc);
             MSC_LOG_EVENT(MSC_GTPU_ENB,"0 Failed send G-PDU ltid %u rtid %u size %u",
             		enb_s1u_teid,sgw_s1u_teid,data_req_p->length);
+            (void)enb_s1u_teid; /* avoid gcc warning "set but not used" */
           } else {
             rc = nwGtpv1uProcessUlpReq(gtpv1u_data_g.gtpv1u_stack, &stack_req);
 
diff --git a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c b/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c
index 5308c0c86cd982c662c4ed5596517e9f8ab39be9..2301cfe5dcf50b8a11df5d500ff5ba3fecbe1ce0 100644
--- a/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c
+++ b/openair3/GTPV1-U/nw-gtpv1u/src/NwGtpv1u.c
@@ -630,7 +630,7 @@ nwGtpv1uHandleEchoReq(NW_IN NwGtpv1uStackT *thiz,
 
   bufLen = sizeof(NwGtpv1uIeTv1T)+ ((NwGtpv1uMsgT*)hMsg)->msgLen;
 
-#warning CROUX DIRTY +16, TO BE FIXED!!!
+//#warning CROUX DIRTY +16, TO BE FIXED!!!
   /* the +16 is there because by analyzing memory allocation with some external
    * tool, I saw that there were 6 bytes accessed after bufLen in nwGtpv1uCreateAndSendMsg
    * the value "16" has been chosen arbitrarily, just bigger than 6
@@ -694,7 +694,7 @@ nwGtpv1uInitialize( NW_INOUT NwGtpv1uStackHandleT *hGtpuStackHandle, uint32_t st
   if(thiz) {
     thiz->id    = (NwPtrT)thiz;
     thiz->stackType = stackType;
-    thiz->seq   = (uint16_t) ((uint32_t)thiz) ; // FIXME interesting casts... don't know what this is good for...
+    thiz->seq   = (uint16_t) ((uintptr_t)thiz) ; // FIXME interesting casts... don't know what this is good for...
     RB_INIT(&(thiz->outstandingTxSeqNumMap));
     RB_INIT(&(thiz->outstandingRxSeqNumMap));
     RB_INIT(&(thiz->sessionMap));
diff --git a/openair3/NAS/COMMON/API/NETWORK/nas_message.c b/openair3/NAS/COMMON/API/NETWORK/nas_message.c
index 64d996520b3ba3520feea570f1d538cc06d9e2d3..a65e2392f00290bffea5e66309820fe7c0e314d5 100644
--- a/openair3/NAS/COMMON/API/NETWORK/nas_message.c
+++ b/openair3/NAS/COMMON/API/NETWORK/nas_message.c
@@ -323,7 +323,7 @@ int nas_message_decrypt(
 #if defined(NAS_MME)
       //LOG_FUNC_RETURN (TLV_DECODE_MAC_MISMATCH);
 #else
-#warning "added test on integrity algorithm because of SECURITY_MODE_COMMAND not correctly handled in UE (check integrity)"
+//#warning "added test on integrity algorithm because of SECURITY_MODE_COMMAND not correctly handled in UE (check integrity)"
 
       if (emm_security_context->selected_algorithms.integrity !=
           NAS_SECURITY_ALGORITHMS_EIA0) {
@@ -1016,10 +1016,10 @@ static int _nas_message_decrypt(
       stream_cipher.count      = count;
       stream_cipher.bearer     = 0x00; //33.401 section 8.1.1
       stream_cipher.direction  = direction;
-      stream_cipher.message    = src;
+      stream_cipher.message    = (unsigned char *)src;
       /* length in bits */
       stream_cipher.blength    = length << 3;
-      nas_stream_encrypt_eea1(&stream_cipher, dest);
+      nas_stream_encrypt_eea1(&stream_cipher, (unsigned char *)dest);
       /* Decode the first octet (security header type or EPS bearer identity,
        * and protocol discriminator) */
       DECODE_U8(dest, *(uint8_t*)(&header), size);
@@ -1050,10 +1050,10 @@ static int _nas_message_decrypt(
       stream_cipher.count      = count;
       stream_cipher.bearer     = 0x00; //33.401 section 8.1.1
       stream_cipher.direction  = direction;
-      stream_cipher.message    = src;
+      stream_cipher.message    = (unsigned char *)src;
       /* length in bits */
       stream_cipher.blength    = length << 3;
-      nas_stream_encrypt_eea1(&stream_cipher, dest);
+      nas_stream_encrypt_eea1(&stream_cipher, (unsigned char *)dest);
       /* Decode the first octet (security header type or EPS bearer identity,
        * and protocol discriminator) */
       DECODE_U8(dest, *(uint8_t*)(&header), size);
@@ -1178,10 +1178,10 @@ static int _nas_message_encrypt(
       stream_cipher.count      = count;
       stream_cipher.bearer     = 0x00; //33.401 section 8.1.1
       stream_cipher.direction  = direction;
-      stream_cipher.message    = src;
+      stream_cipher.message    = (unsigned char *)src;
       /* length in bits */
       stream_cipher.blength    = length << 3;
-      nas_stream_encrypt_eea1(&stream_cipher, dest);
+      nas_stream_encrypt_eea1(&stream_cipher, (unsigned char *)dest);
 
       LOG_FUNC_RETURN (length);
 
@@ -1209,10 +1209,10 @@ static int _nas_message_encrypt(
       stream_cipher.count      = count;
       stream_cipher.bearer     = 0x00; //33.401 section 8.1.1
       stream_cipher.direction  = direction;
-      stream_cipher.message    = src;
+      stream_cipher.message    = (unsigned char *)src;
       /* length in bits */
       stream_cipher.blength    = length << 3;
-      nas_stream_encrypt_eea2(&stream_cipher, dest);
+      nas_stream_encrypt_eea2(&stream_cipher, (unsigned char *)dest);
 
       LOG_FUNC_RETURN (length);
 
@@ -1344,7 +1344,7 @@ static uint32_t _nas_message_get_mac(
     stream_cipher.count      = count;
     stream_cipher.bearer     = 0x00; //33.401 section 8.1.1
     stream_cipher.direction  = direction;
-    stream_cipher.message    = buffer;
+    stream_cipher.message    = (unsigned char *)buffer;
     /* length in bits */
     stream_cipher.blength    = length << 3;
 
@@ -1390,7 +1390,7 @@ static uint32_t _nas_message_get_mac(
     stream_cipher.count      = count;
     stream_cipher.bearer     = 0x00; //33.401 section 8.1.1
     stream_cipher.direction  = direction;
-    stream_cipher.message    = buffer;
+    stream_cipher.message    = (unsigned char *)buffer;
     /* length in bits */
     stream_cipher.blength    = length << 3;
 
diff --git a/openair3/NAS/COMMON/EMM/MSG/AttachAccept.c b/openair3/NAS/COMMON/EMM/MSG/AttachAccept.c
index 3d800d5c19ef6d2fe9e1e1e687aea2a3cbc588dd..c7e4c3661441200ecc76ffb45d21b360f59f430f 100644
--- a/openair3/NAS/COMMON/EMM/MSG/AttachAccept.c
+++ b/openair3/NAS/COMMON/EMM/MSG/AttachAccept.c
@@ -214,7 +214,7 @@ int encode_attach_accept(attach_accept_msg *attach_accept, uint8_t *buffer, uint
 
   *(buffer + encoded) = (encode_u8_eps_attach_result(&attach_accept->epsattachresult) & 0x0f);
   encoded++;
-#warning "LG TEST override t3412value"
+//#warning "LG TEST override t3412value"
   attach_accept->t3412value.unit = GPRS_TIMER_UNIT_360S;
   attach_accept->t3412value.timervalue = 10;
 
@@ -288,7 +288,7 @@ int encode_attach_accept(attach_accept_msg *attach_accept, uint8_t *buffer, uint
       encoded += encode_result;
   }
 
-#warning "LG TEST override t3402value"
+//#warning "LG TEST override t3402value"
   attach_accept->presencemask |= ATTACH_ACCEPT_T3402_VALUE_PRESENT;
   attach_accept->t3402value.unit = GPRS_TIMER_UNIT_60S;
   attach_accept->t3402value.timervalue = 12;
diff --git a/openair3/NAS/COMMON/IES/MsNetworkFeatureSupport.c b/openair3/NAS/COMMON/IES/MsNetworkFeatureSupport.c
index d8efa5312b765b54c11c4ddb260fcb7c113cfbd0..08fee949a05bc4db8e88fcbda59c79019bcfe2ab 100644
--- a/openair3/NAS/COMMON/IES/MsNetworkFeatureSupport.c
+++ b/openair3/NAS/COMMON/IES/MsNetworkFeatureSupport.c
@@ -54,9 +54,9 @@ int decode_ms_network_feature_support(MsNetworkFeatureSupport *msnetworkfeatures
 }
 int encode_ms_network_feature_support(MsNetworkFeatureSupport *msnetworkfeaturesupport, uint8_t iei, uint8_t *buffer, uint32_t len)
 {
-  uint8_t *lenPtr;
+  //uint8_t *lenPtr;
   uint32_t encoded = 0;
-  int encode_result;
+  //int encode_result;
   /* Checking IEI and pointer */
   CHECK_PDU_POINTER_AND_LENGTH_ENCODER(buffer, MS_NETWORK_FEATURE_SUPPORT_MINIMUM_LENGTH, len);
 #if defined (NAS_DEBUG)
diff --git a/openair3/NAS/COMMON/IES/UeNetworkCapability.c b/openair3/NAS/COMMON/IES/UeNetworkCapability.c
index 41393e7689773f7ef3388d6fddd68b7c68ea1546..902bd1c79cec89bd6bfe18edf3396ec5c776140e 100644
--- a/openair3/NAS/COMMON/IES/UeNetworkCapability.c
+++ b/openair3/NAS/COMMON/IES/UeNetworkCapability.c
@@ -81,7 +81,7 @@ int decode_ue_network_capability(UeNetworkCapability *uenetworkcapability, uint8
         LOG_TRACE(INFO, "uenetworkcapability decoded GPRS\n");
       }
 
-#warning "Force GPRS present if UMTS present"
+//#warning "Force GPRS present if UMTS present"
       uenetworkcapability->gprs_present =1;
     }
   }
@@ -131,7 +131,7 @@ int encode_ue_network_capability(UeNetworkCapability *uenetworkcapability, uint8
   }
 
   if (uenetworkcapability->gprs_present) {
-#warning "Force gea to 0x60"
+//#warning "Force gea to 0x60"
     *(buffer + encoded) = 0x00 | 0x60;
     ////((uenetworkcapability->spare & 0x7) << 5) | // spare coded as zero
     //((uenetworkcapability->csfb  & 0x1) << 4) |
diff --git a/openair3/NAS/TOOLS/network.h b/openair3/NAS/TOOLS/network.h
index 54bf61a7b43c5ec07ae5b469ca10f7be9c13aff8..b2c7977d2d15f91133091d1b50e06987a440bb57 100644
--- a/openair3/NAS/TOOLS/network.h
+++ b/openair3/NAS/TOOLS/network.h
@@ -58,21 +58,23 @@ Description Defines a list of PLMN network operators
 #define SFR1  1
 #define SFR2  2
 #define SFR3  3
-#define TM1   4
-#define FCT1  5
-#define VDF1  6
-#define VDF2  7
-#define VDF3  8
-#define VDF4  9
-#define VDF5  10
+#define OAI_LTEBOX 4
+#define TM1   5
+#define FCT1  6
+#define VDF1  7
+#define VDF2  8
+#define VDF3  9
+#define VDF4  10
+#define VDF5  11
 
 
-#define SELECTED_PLMN SFR1
+#define SELECTED_PLMN OAI_LTEBOX //SFR1
 
 #define TEST_PLMN {0,0,0x0f,1,1,0}  // 00101
 #define SFR_PLMN_1  {0,2,0x0f,8,0,1}  // 20810
 #define SFR_PLMN_2  {0,2,0x0f,8,1,1}  // 20811
 #define SFR_PLMN_3  {0,2,0x0f,8,3,1}  // 20813
+#define OAI_LTEBOX_PLMN  {0,2,0x0f,8,3,9}  //20893
 #define TM_PLMN_1   {1,3,0,0,8,2}       // 310280
 #define FCT_PLMN_1  {1,3,8,0,2,0}       // 310028
 #define VDF_PLMN_1  {2,2,0x0f,2,0,1}  // 22210
@@ -81,6 +83,7 @@ Description Defines a list of PLMN network operators
 #define VDF_PLMN_4  {6,2,0x0f,2,0x0f,2} // 2622
 #define VDF_PLMN_5  {6,2,0x0f,2,0x0f,4} // 2624
 
+
 /****************************************************************************/
 /************************  G L O B A L    T Y P E S  ************************/
 /****************************************************************************/
@@ -110,6 +113,7 @@ network_record_t network_records[] = {
   {20810, SFR_PLMN_1, "SFR France",      "SFR",       0x0001, 0xfffd},
   {20811, SFR_PLMN_2, "SFR France",      "SFR",       0x0001, 0xfffd},
   {20813, SFR_PLMN_3, "SFR France",      "SFR",       0x0001, 0xfffd},
+  {20893, OAI_LTEBOX_PLMN, "OAI LTEBOX",   "OAIALU",  0x0001, 0xfffd},
   {310280,TM_PLMN_1,  "T-Mobile USA",    "T-Mobile",  0x0001, 0xfffd},
   {310028,FCT_PLMN_1, "FICTITIOUS USA",  "FICTITIO",  0x0001, 0xfffd},
   {22210, VDF_PLMN_1, "Vodafone Italia", "VODAFONE",  0x0001, 0xfffd},
diff --git a/openair3/NAS/TOOLS/ue_data.c b/openair3/NAS/TOOLS/ue_data.c
index 478119acdaf817d27003539104b18f9d26ee71fe..e99cb9b84cc6741ee3cd42f52ffac936885d72c5 100644
--- a/openair3/NAS/TOOLS/ue_data.c
+++ b/openair3/NAS/TOOLS/ue_data.c
@@ -354,6 +354,36 @@ static void _gen_emm_data(emm_nvdata_t* data)
      data->rplmn.MNCdigit2 = 0;
      data->rplmn.MNCdigit3 = 0xf;
 #endif
+#if (SELECTED_PLMN == OAI_LTEBOX)
+  /*
+   * International Mobile Subscriber Identity
+   * IMSI = MCC + MNC + MSIN = 208 (France) + 93 (OAI) + 00001110
+   */
+     data->imsi.length = 8;
+     data->imsi.u.num.parity = ODD_PARITY;  // Type of identity = IMSI, even
+     data->imsi.u.num.digit1 = 2;  // MCC digit 1
+     data->imsi.u.num.digit2 = 0;  // MCC digit 2
+     data->imsi.u.num.digit3 = 8;  // MCC digit 3
+     data->imsi.u.num.digit4 = 9;  // MNC digit 1
+     data->imsi.u.num.digit5 = 3;  // MNC digit 2
+     data->imsi.u.num.digit6 = 0;  // MNC digit 3
+     data->imsi.u.num.digit7 = 1;
+     data->imsi.u.num.digit8 = 0;
+     data->imsi.u.num.digit9 = 0;
+     data->imsi.u.num.digit10 = 0;
+     data->imsi.u.num.digit11 = 0;
+     data->imsi.u.num.digit12 = 1;
+     data->imsi.u.num.digit13 = 1;
+     data->imsi.u.num.digit14 = 1;
+     data->imsi.u.num.digit15 = 1;
+
+     data->rplmn.MCCdigit1 = 2;
+     data->rplmn.MCCdigit2 = 0;
+     data->rplmn.MCCdigit3 = 8;
+     data->rplmn.MNCdigit1 = 9;
+     data->rplmn.MNCdigit2 = 3;
+     data->rplmn.MNCdigit3 = 0xf;
+#endif
 #if (SELECTED_PLMN == TEST1)
   /*
    * International Mobile Subscriber Identity
@@ -481,7 +511,7 @@ static void _display_emm_data(const emm_nvdata_t* data)
              data->imsi.u.num.digit13,
              data->imsi.u.num.digit14);
     } else {
-      printf("%u%u%u.%u%u%u.%u%u%u%u%u%u%u%u\n",
+      printf("%u%u%u.%u%u%u.%u%u%u%u%u%u%u%u%u\n",
              data->imsi.u.num.digit1,
              data->imsi.u.num.digit2,
              data->imsi.u.num.digit3,
diff --git a/openair3/NAS/TOOLS/usim_data.c b/openair3/NAS/TOOLS/usim_data.c
index ea046245edbe0189158324f4764db2ddcfba23cf..ffde00c26896dabf9b91ef8a0a11bf918150ba36 100644
--- a/openair3/NAS/TOOLS/usim_data.c
+++ b/openair3/NAS/TOOLS/usim_data.c
@@ -61,7 +61,7 @@ Description Implements the utility used to generate data stored in the
 
 #define KSI     USIM_KSI_NOT_AVAILABLE
 #define KSI_ASME    USIM_KSI_NOT_AVAILABLE
-#define INT_ALGO    USIM_INT_EIA1
+#define INT_ALGO    USIM_INT_EIA2
 #define ENC_ALGO    USIM_ENC_EEA0
 #define SECURITY_ALGORITHMS (ENC_ALGO | INT_ALGO)
 
@@ -159,12 +159,13 @@ int main (int argc, const char* argv[])
     usim_data.imsi.u.num.digit15 = 0b1111;
 #endif
 #if (SELECTED_PLMN == SFR1)
-#warning "IMSI 208.10.00001234"
+
     /*
      * International Mobile Subscriber Identity
      * IMSI = MCC + MNC + MSIN = 208 (France) + 10 (SFR) + 00001234
      */
-    #warning "IMSI 208.10.00001234"
+#warning "IMSI 208.10.00001234"
+
     usim_data.imsi.length = 8;
     usim_data.imsi.u.num.parity = EVEN_PARITY;      // Parity: even
     usim_data.imsi.u.num.digit1 = 2;                // MCC digit 1
@@ -183,6 +184,31 @@ int main (int argc, const char* argv[])
     usim_data.imsi.u.num.digit14 = 4;
     usim_data.imsi.u.num.digit15 = 0b1111;
 #endif
+#if (SELECTED_PLMN == OAI_LTEBOX)
+#warning "IMSI 208.93.00001111"
+    /*
+     * International Mobile Subscriber Identity
+     * IMSI = MCC + MNC + MSIN = 208 (France) + 10 (SFR) + 00001234
+     */
+    #warning "IMSI 208.93.0100001110"
+    usim_data.imsi.length = 8;
+    usim_data.imsi.u.num.parity = ODD_PARITY;      // Parity: even
+    usim_data.imsi.u.num.digit1 = 2;                // MCC digit 1
+    usim_data.imsi.u.num.digit2 = 0;                // MCC digit 2
+    usim_data.imsi.u.num.digit3 = 8;                // MCC digit 3
+    usim_data.imsi.u.num.digit4 = 9;                // MNC digit 1
+    usim_data.imsi.u.num.digit5 = 3;                // MNC digit 2
+    usim_data.imsi.u.num.digit6 = 0;     // MNC digit 3
+    usim_data.imsi.u.num.digit7 = 1;
+    usim_data.imsi.u.num.digit8 = 0;
+    usim_data.imsi.u.num.digit9 = 0;
+    usim_data.imsi.u.num.digit10 = 0;
+    usim_data.imsi.u.num.digit11 = 0;
+    usim_data.imsi.u.num.digit12 = 1;
+    usim_data.imsi.u.num.digit13 = 1;
+    usim_data.imsi.u.num.digit14 = 1;
+    usim_data.imsi.u.num.digit15 = 1;
+#endif
 #if (SELECTED_PLMN == TEST1)
 #warning "IMSI 001.01.000001234"
     usim_data.imsi.length = 8;
@@ -470,13 +496,14 @@ static void _display_usim_data(const usim_data_t* data)
   printf("\tparity\t= %s\n", data->imsi.u.num.parity == EVEN_PARITY ? "Even" : "Odd");
   digits = (data->imsi.length * 2) - 1 - (data->imsi.u.num.parity == EVEN_PARITY ? 1 : 0);
   printf("\tdigits\t= %d\n", digits);
+  
   printf("\tdigits\t= %u%u%u%u%u%x%u%u%u%u",
          data->imsi.u.num.digit1, // MCC digit 1
          data->imsi.u.num.digit2, // MCC digit 2
          data->imsi.u.num.digit3, // MCC digit 3
          data->imsi.u.num.digit4, // MNC digit 1
          data->imsi.u.num.digit5, // MNC digit 2
-         data->imsi.u.num.digit6, // MNC digit 3
+         data->imsi.u.num.digit6==0xf?0:data->imsi.u.num.digit6, // MNC digit 3
          data->imsi.u.num.digit7,
          data->imsi.u.num.digit8,
          data->imsi.u.num.digit9,
diff --git a/openair3/NAS/UE/API/USIM/aka_functions.c b/openair3/NAS/UE/API/USIM/aka_functions.c
index 7670cbfc0b9e066f75b718380b8f7e86e13c1ea9..1c30a17bfd505254e1b37436d55dca259a527aab 100644
--- a/openair3/NAS/UE/API/USIM/aka_functions.c
+++ b/openair3/NAS/UE/API/USIM/aka_functions.c
@@ -21,9 +21,21 @@
 /*--------- Operator Variant Algorithm Configuration Field --------*/
 /*------- Insert your value of OP here -------*/
 /* PFT OP used currently in HSS (OPENAIRHSS/auc/kdf.c) */
+#define OAI_LTEBOX
+
+#ifdef OAI_LTEBOX
+//1006020f0a478bf6b699f15c062e42b3
+/*u8 OP[16] = {0xb3, 0x42, 0x2e, 0x06, 0x5c, 0xf1, 0x99, 0xb6,
+             0xf6, 0x8b, 0x47, 0x0a, 0x0f, 0x02, 0x06, 0x10
+	     };*/
+u8 OP[16] = {0x10, 0x06, 0x02, 0x0f, 0x0a, 0x47, 0x8b, 0xf6,
+             0xb6, 0x99, 0xf1, 0x5c, 0x06, 0x2e, 0x42, 0xb3
+};
+#else
 u8 OP[16] = {0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
              0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
             };
+#endif
 /*------- Insert your value of OP here -------*/
 
 /*-------------------------------------------------------------------
diff --git a/openair3/NAS/UE/API/USIM/usim_api.c b/openair3/NAS/UE/API/USIM/usim_api.c
index 64bc05d0c315b16df1c4cfc00e14401dfc2d42af..807ee467242e030694a2c3c12e5bb49ff5721d53 100644
--- a/openair3/NAS/UE/API/USIM/usim_api.c
+++ b/openair3/NAS/UE/API/USIM/usim_api.c
@@ -77,6 +77,7 @@ Description Implements the API used by the NAS layer to read/write
  * Subscriber authentication security key
  */
 #define USIM_API_K_SIZE         16
+//#define USIM_API_K_VALUE        "fec86ba6eb707ed08905757b1bb44b8f"
 #define USIM_API_K_VALUE        "8BAF473F2F8FD09487CCCBD7097C6862"
 
 static uint8_t _usim_api_k[USIM_API_K_SIZE];
@@ -85,9 +86,13 @@ static uint8_t _usim_api_k[USIM_API_K_SIZE];
 /*
  * List of last used Sequence Numbers SQN
  */
+#define USIM_API_AK_SIZE 6
+#define USIM_API_SQN_SIZE USIM_API_AK_SIZE
+#define USIM_API_SQNMS_SIZE USIM_API_SQN_SIZE
+
 static struct _usim_api_data_s {
   /* Highest sequence number the USIM has ever accepted */
-  uint32_t sqn_ms;
+  uint8_t sqn_ms[USIM_API_SQNMS_SIZE];
   /* List of the last used sequence numbers   */
 #define USIM_API_SQN_LIST_SIZE  32
   uint8_t n_sqns;
@@ -230,25 +235,25 @@ int usim_api_authenticate(const OctetString* rand_pP, const OctetString* autn_pP
   /* Compute the cipher key CK = f3K (RAND) */
   /* Compute the integrity key IK = f4K (RAND) */
   /* Compute the anonymity key AK = f5K (RAND) */
-#define USIM_API_AK_SIZE 6
+
   u8 ak[USIM_API_AK_SIZE];
   f2345(_usim_api_k, rand_pP->value,
         res_pP->value, ck_pP->value, ik_pP->value, ak);
-  LOG_TRACE(DEBUG, "USIM-API  - res(f2)  :%s",dump_octet_string(res_pP));
-  LOG_TRACE(DEBUG, "USIM-API  - ck(f3)   :%s",dump_octet_string(ck_pP));
-  LOG_TRACE(DEBUG, "USIM-API  - ik(f4)   :%s",dump_octet_string(ik_pP));
-  LOG_TRACE(DEBUG, "USIM-API  - ak(f5)   : %02X%02X%02X%02X%02X%02X",
+  LOG_TRACE(INFO, "USIM-API  - res(f2)  :%s",dump_octet_string(res_pP));
+  LOG_TRACE(INFO, "USIM-API  - ck(f3)   :%s",dump_octet_string(ck_pP));
+  LOG_TRACE(INFO, "USIM-API  - ik(f4)   :%s",dump_octet_string(ik_pP));
+  LOG_TRACE(INFO, "USIM-API  - ak(f5)   : %02X%02X%02X%02X%02X%02X",
             ak[0],ak[1],ak[2],ak[3],ak[4],ak[5]);
 
   /* Retrieve the sequence number SQN = (SQN ⊕ AK) ⊕ AK */
-#define USIM_API_SQN_SIZE USIM_API_AK_SIZE
+
   u8 sqn[USIM_API_SQN_SIZE];
 
   for (i = 0; i < USIM_API_SQN_SIZE; i++) {
     sqn[i] = autn_pP->value[i] ^ ak[i];
   }
 
-  LOG_TRACE(DEBUG, "USIM-API  - Retrieved SQN %02X%02X%02X%02X%02X%02X",
+  LOG_TRACE(INFO, "USIM-API  - Retrieved SQN %02X%02X%02X%02X%02X%02X",
             sqn[0],sqn[1],sqn[2],sqn[3],sqn[4],sqn[5]);
 
   /* Compute XMAC = f1K (SQN || RAND || AMF) */
@@ -267,14 +272,15 @@ int usim_api_authenticate(const OctetString* rand_pP, const OctetString* autn_pP
               USIM_API_XMAC_SIZE) != 0 ) {
     LOG_TRACE(INFO,
               "USIM-API  - Comparing the XMAC with the MAC included in AUTN Failed");
+    rc = RETURNerror;
     //LOG_FUNC_RETURN (RETURNerror);
   } else {
     LOG_TRACE(INFO,
               "USIM-API  - Comparing the XMAC with the MAC included in AUTN Succeeded");
+    /* Verify that the received sequence number SQN is in the correct range */
+    rc = _usim_api_check_sqn(*(uint32_t*)(sqn), sqn[USIM_API_SQN_SIZE - 1]);
   }
 
-  /* Verify that the received sequence number SQN is in the correct range */
-  rc = _usim_api_check_sqn(*(uint32_t*)(sqn), sqn[USIM_API_SQN_SIZE - 1]);
 
   if (rc != RETURNok) {
     /* Synchronisation failure; compute the AUTS parameter */
@@ -283,15 +289,17 @@ int usim_api_authenticate(const OctetString* rand_pP, const OctetString* autn_pP
      * Conc(SQNMS) = SQNMS ⊕ f5*K(RAND) */
     f5star(_usim_api_k, rand_pP->value, ak);
 
-#define USIM_API_SQNMS_SIZE USIM_API_SQN_SIZE
+
     u8 sqn_ms[USIM_API_SQNMS_SIZE];
     memset(sqn_ms, 0, USIM_API_SQNMS_SIZE);
-#define USIM_API_SQN_MS_SIZE  3
 
-    for (i = 0; i < USIM_API_SQN_MS_SIZE; i++) {
-#warning "LG:BUG HERE TODO"
+    //#define USIM_API_SQN_MS_SIZE  3
+    printf("_usim_api_data.sqn_ms %p\n",_usim_api_data.sqn_ms);
+    for (i = 0; i < USIM_API_SQNMS_SIZE; i++) {
+      //#warning "LG:BUG HERE TODO"
+      printf("i %d:  ((uint8_t*)(_usim_api_data.sqn_ms))[USIM_API_SQNMS_SIZE - i] %d\n",i, ((uint8_t*)(_usim_api_data.sqn_ms))[USIM_API_SQNMS_SIZE - i]);
       sqn_ms[USIM_API_SQNMS_SIZE - i] =
-        ((uint8_t*)(_usim_api_data.sqn_ms))[USIM_API_SQN_MS_SIZE - i];
+        ((uint8_t*)(_usim_api_data.sqn_ms))[USIM_API_SQNMS_SIZE - i];
     }
 
     u8 sqnms[USIM_API_SQNMS_SIZE];
@@ -317,6 +325,8 @@ int usim_api_authenticate(const OctetString* rand_pP, const OctetString* autn_pP
      * AUTS = Conc(SQNMS) || MACS */
     memcpy(&auts_pP->value[0], sqnms, USIM_API_SQNMS_SIZE);
     memcpy(&auts_pP->value[USIM_API_SQNMS_SIZE], macs, USIM_API_MACS_SIZE);
+    auts_pP->length = USIM_API_SQNMS_SIZE + USIM_API_MACS_SIZE;
+    LOG_FUNC_RETURN (RETURNerror);
   }
 
   LOG_FUNC_RETURN (RETURNok);
diff --git a/openair3/NAS/UE/EMM/Attach.c b/openair3/NAS/UE/EMM/Attach.c
index d7bdeb91208bdf4291347ef2515705354e86db06..8a589fa0a0e121b455fce5c343821e0796b6200f 100755
--- a/openair3/NAS/UE/EMM/Attach.c
+++ b/openair3/NAS/UE/EMM/Attach.c
@@ -249,7 +249,7 @@ int emm_proc_attach(emm_proc_attach_type_t type)
   esm_sap.data.pdn_connect.is_defined = TRUE;
   esm_sap.data.pdn_connect.cid = 1;
   /* TODO: PDN type should be set according to the IP capability of the UE */
-  esm_sap.data.pdn_connect.pdn_type = NET_PDN_TYPE_IPV4V6;
+  esm_sap.data.pdn_connect.pdn_type = NET_PDN_TYPE_IPV4;
   esm_sap.data.pdn_connect.apn = NULL;
   esm_sap.data.pdn_connect.is_emergency = _emm_data.is_emergency;
   rc = esm_sap_send(&esm_sap);
diff --git a/openair3/NAS/UE/EMM/EmmStatusHdl.c b/openair3/NAS/UE/EMM/EmmStatusHdl.c
index 85d423fd236070e7591fb6c64e7df5932ba83c02..126b2a94f6a39b0d83841f847c31e2afe54737e3 100755
--- a/openair3/NAS/UE/EMM/EmmStatusHdl.c
+++ b/openair3/NAS/UE/EMM/EmmStatusHdl.c
@@ -130,7 +130,7 @@ int emm_proc_status(unsigned int ueid, int emm_cause)
   emm_sap_t emm_sap;
 
   emm_security_context_t    *sctx = NULL;
-  struct emm_data_context_s *ctx  = NULL;
+  //struct emm_data_context_s *ctx  = NULL;
 
   LOG_TRACE(INFO,"EMM-PROC  - EMM status procedure requested");
 
diff --git a/openair3/NAS/UE/EMM/LowerLayer.c b/openair3/NAS/UE/EMM/LowerLayer.c
index 130fe1bb5d7e199a8b9f013bbe64f0bdc1259458..6e264d2a54571081cbf1e62bb913ade555b4e424 100755
--- a/openair3/NAS/UE/EMM/LowerLayer.c
+++ b/openair3/NAS/UE/EMM/LowerLayer.c
@@ -261,7 +261,7 @@ int lowerlayer_data_req(unsigned int ueid, const OctetString *data)
   int rc;
   emm_sap_t emm_sap;
   emm_security_context_t    *sctx = NULL;
-  struct emm_data_context_s *ctx  = NULL;
+  //struct emm_data_context_s *ctx  = NULL;
 
   emm_sap.primitive = EMMAS_DATA_REQ;
   emm_sap.u.emm_as.u.data.guti = _emm_data.guti;
diff --git a/openair3/NAS/UE/EMM/SAP/emm_fsm.c b/openair3/NAS/UE/EMM/SAP/emm_fsm.c
index 83c5e5f1db7d406d449b4639793770cdf1d7eb96..dc0e1efa28999da7ca71ad9f22929eb9a08238ac 100755
--- a/openair3/NAS/UE/EMM/SAP/emm_fsm.c
+++ b/openair3/NAS/UE/EMM/SAP/emm_fsm.c
@@ -215,7 +215,7 @@ emm_fsm_state_t _emm_fsm_status[EMM_FSM_NB_UE_MAX];
  ***************************************************************************/
 void emm_fsm_initialize(void)
 {
-  int ueid;
+  //int ueid;
   LOG_FUNC_IN;
 
   _emm_fsm_status[0] = EMM_NULL;
diff --git a/openair3/NAS/UE/EMM/SAP/emm_reg.c b/openair3/NAS/UE/EMM/SAP/emm_reg.c
index 7f20b251519b9738a548595066717e96388a804d..b73f75975a71d132caf378a8b57a8172daac3d54 100755
--- a/openair3/NAS/UE/EMM/SAP/emm_reg.c
+++ b/openair3/NAS/UE/EMM/SAP/emm_reg.c
@@ -114,6 +114,9 @@ int emm_reg_send(const emm_reg_t *msg)
   emm_reg_primitive_t primitive = msg->primitive;
   assert( (primitive > _EMMREG_START) && (primitive < _EMMREG_END));
 
+  /* avoid gcc warnings */
+  (void)primitive;
+
   /* Execute the EMM procedure */
   rc = emm_fsm_process(msg);
 
diff --git a/openair3/NAS/UE/ESM/SAP/esm_send.c b/openair3/NAS/UE/ESM/SAP/esm_send.c
index ab5341062a697d78286d9037913f3cf228a74bc5..51cd96fdc88bcb532894b1a72e8b7602a4c98209 100755
--- a/openair3/NAS/UE/ESM/SAP/esm_send.c
+++ b/openair3/NAS/UE/ESM/SAP/esm_send.c
@@ -181,6 +181,35 @@ int esm_send_pdn_connectivity_request(int pti, int is_emergency, int pdn_type,
     }
   }
 
+  /* Add PCO */
+# define CONFIGURATION_PROTOCOL_PPP          0
+# define PROTOCOL_ID_IPCP                    0x8021
+# define PROTOCOL_ID_DNS_SERVER_IPV4_ADDRESS 0x000D
+# define PROTOCOL_ID_IP_ADDR_NAS_SIGNALING   0x000A
+
+  msg->presencemask |= PDN_CONNECTIVITY_REQUEST_PROTOCOL_CONFIGURATION_OPTIONS_PRESENT;
+  msg->protocolconfigurationoptions.configurationprotol = CONFIGURATION_PROTOCOL_PPP;
+  msg->protocolconfigurationoptions.num_protocol_id_or_container_id = 3;
+  msg->protocolconfigurationoptions.protocolid[0] = PROTOCOL_ID_IPCP;
+  msg->protocolconfigurationoptions.lengthofprotocolid[0] = 16; /* Size of PROTOCOL_ID_IPCP */
+  msg->protocolconfigurationoptions.protocolidcontents[0].value = (uint8_t *)
+  /* PROTOCOL_ID_IPCP data */
+  /* the format is as of RFC 1331 (see page 27) */
+  "\x01"                  /* Configure-Request                    */
+  "\x00"                  /* Indentifier (set to 0)               */
+  "\x00\x10"              /* Length (16 bytes)                    */
+    "\x81"                /* Type = Primary DNS - see RFC 1877    */
+    "\x06"                /* length                               */
+    "\x00\x00\x00\x00"    /* IP address set to 0                  */
+    "\x83"                /* Type = Secondary DNS - see RFC 1877  */
+    "\x06"                /* length                               */
+    "\x00\x00\x00\x00";   /* IP address set to 0                  */
+  msg->protocolconfigurationoptions.protocolidcontents[0].length = 16;
+  msg->protocolconfigurationoptions.protocolid[1] = PROTOCOL_ID_DNS_SERVER_IPV4_ADDRESS;
+  msg->protocolconfigurationoptions.lengthofprotocolid[1] = 0x00;
+  msg->protocolconfigurationoptions.protocolid[2] = PROTOCOL_ID_IP_ADDR_NAS_SIGNALING;
+  msg->protocolconfigurationoptions.lengthofprotocolid[2] = 0x00;
+
   LOG_TRACE(INFO, "ESM-SAP   - Send PDN Connectivity Request message "
             "(pti=%d, ebi=%d)",
             msg->proceduretransactionidentity, msg->epsbeareridentity);
diff --git a/openair3/NAS/UE/ESM/esm_ebr_context.c b/openair3/NAS/UE/ESM/esm_ebr_context.c
index fcf278a2e47216c75627290f01c3308675698578..539403f7e43a4bb10bd8b949a9718585450cec17 100755
--- a/openair3/NAS/UE/ESM/esm_ebr_context.c
+++ b/openair3/NAS/UE/ESM/esm_ebr_context.c
@@ -114,7 +114,7 @@ int esm_ebr_context_create(
   int                 bid     = 0;
   esm_data_context_t *esm_ctx = NULL;
   esm_pdn_t          *pdn     = NULL;
-  unsigned int        ueid    = 0;
+  //unsigned int        ueid    = 0;
 
   LOG_FUNC_IN;
 
@@ -212,7 +212,7 @@ int esm_ebr_context_create(
         {
            char          *tmp          = NULL;
            char           ipv4_addr[INET_ADDRSTRLEN];
-           char           ipv6_addr[INET6_ADDRSTRLEN];
+           //char           ipv6_addr[INET6_ADDRSTRLEN];
            char          *netmask      = NULL;
            char           broadcast[INET_ADDRSTRLEN];
            struct in_addr in_addr;
@@ -221,7 +221,8 @@ int esm_ebr_context_create(
 
            switch (pdn->type) {
            case NET_PDN_TYPE_IPV4V6:
-             ipv6_addr[0] = pdn->ip_addr[4];
+             //ipv6_addr[0] = pdn->ip_addr[4];
+             /* TODO? */
 
              // etc
            case NET_PDN_TYPE_IPV4:
@@ -281,13 +282,16 @@ int esm_ebr_context_create(
              }
 
              res = sprintf(command_line,
-                           "ifconfig oip1 %s netmask %s broadcast %s up",
+                           "ifconfig oip1 %s netmask %s broadcast %s",
                            ipv4_addr, netmask, broadcast);
+             (void)res; /* avoid gcc warning "set but not used" */
              //                            AssertFatal((res > 0) && (res < 128),
              //                                    "error in system command line");
              LOG_TRACE(INFO, "ESM-PROC  - executing %s ",
                        command_line);
-             system(command_line);
+
+             if (system(command_line)) ; /* TODO: what to do? */
+
              break;
 
            case NET_PDN_TYPE_IPV6:
@@ -341,7 +345,7 @@ int esm_ebr_context_release(
   esm_pdn_t *pdn = NULL;
   esm_data_context_t *esm_ctx;
 
-  unsigned int ueid = 0;
+  //unsigned int ueid = 0;
 
   LOG_FUNC_IN;
 
diff --git a/openair3/S1AP/MESSAGES/ASN1/asn1cpatch.p0 b/openair3/S1AP/MESSAGES/ASN1/asn1cpatch.p0
deleted file mode 100644
index b3a5b8d39f5059fabb85b65f03f23ea8f6760784..0000000000000000000000000000000000000000
--- a/openair3/S1AP/MESSAGES/ASN1/asn1cpatch.p0
+++ /dev/null
@@ -1,5082 +0,0 @@
-Index: asn1c/unber.c
-===================================================================
---- asn1c/unber.c	(revision 1516)
-+++ asn1c/unber.c	(working copy)
-@@ -775,4 +775,8 @@
- 
- asn_enc_rval_t OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *cts, void *sptr, asn_per_outp_t *po) { asn_enc_rval_t er = { 0, 0, 0 }; (void)td; (void)cts; (void)sptr; (void)po; return er; }
- 
-+asn_dec_rval_t OCTET_STRING_decode_aper(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *cts, void **sptr, asn_per_data_t *pd) { asn_dec_rval_t rv = { 0, 0 }; (void)ctx; (void)td; (void)cts; (void)sptr; (void)pd; return rv; }
-+
-+asn_enc_rval_t OCTET_STRING_encode_aper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *cts, void *sptr, asn_per_outp_t *po) { asn_enc_rval_t er = { 0, 0, 0 }; (void)td; (void)cts; (void)sptr; (void)po; return er; }
-+
- size_t xer_whitespace_span(const void *chunk_buf, size_t chunk_size) {  (void)chunk_buf; (void)chunk_size; return 0; }
-Index: asn1c/asn1c.c
-===================================================================
---- asn1c/asn1c.c	(revision 1516)
-+++ asn1c/asn1c.c	(working copy)
-@@ -111,6 +111,8 @@
- 			asn1_compiler_flags &= ~A1C_LINK_SKELETONS;
- 		} else if(strcmp(optarg, "link-skeletons") == 0) {
- 			asn1_compiler_flags |= A1C_LINK_SKELETONS;
-+		} else if(strcmp(optarg, "have_native64") == 0) {
-+			asn1_compiler_flags |= A1C_HAVE_NATIVE_64;
- 		} else {
- 			fprintf(stderr, "-f%s: Invalid argument\n", optarg);
- 			exit(EX_USAGE);
-@@ -471,6 +473,7 @@
- "  -fno-include-deps     Do not generate courtesy #includes for dependencies\n"
- "  -funnamed-unions      Enable unnamed unions in structures\n"
- "  -fwide-types          Use INTEGER_t instead of \"long\" by default, etc.\n"
-+"  -fhave_native64       Use int64_t/uint64_t for target platform\n"
- "\n"
- 
- "  -gen-PER              Generate PER support code\n"
-Index: examples/README
-===================================================================
---- examples/README	(revision 1516)
-+++ examples/README	(working copy)
-@@ -25,6 +25,8 @@
-    UserPlane Location Protocol decoder. Before trying to compile, read the
-    README file in that directory.
- 
-+The clyx2asn1.pl script can be used to extract ASN.1 data from LyX editor files.
-+
- The crfc2asn1.pl script can be used to extract ASN.1 data from RFC texts.
- For instance, it is used to extract X.509, MEGACO, and LDAPv3 ASN.1 modules
- from the corresponding RFC texts (rfc3280.txt, rfc3525.txt, rfc4211.txt).
-Index: skeletons/UTF8String.c
-===================================================================
---- skeletons/UTF8String.c	(revision 1516)
-+++ skeletons/UTF8String.c	(working copy)
-@@ -25,6 +25,8 @@
- 	OCTET_STRING_encode_xer_utf8,
- 	OCTET_STRING_decode_uper,
- 	OCTET_STRING_encode_uper,
-+	OCTET_STRING_decode_aper,
-+	OCTET_STRING_encode_aper,
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_UTF8String_tags,
- 	sizeof(asn_DEF_UTF8String_tags)
-Index: skeletons/constr_TYPE.h
-===================================================================
---- skeletons/constr_TYPE.h	(revision 1516)
-+++ skeletons/constr_TYPE.h	(working copy)
-@@ -99,6 +99,8 @@
- 	xer_type_encoder_f *xer_encoder;	/* [Canonical] XER encoder */
- 	per_type_decoder_f *uper_decoder;	/* Unaligned PER decoder */
- 	per_type_encoder_f *uper_encoder;	/* Unaligned PER encoder */
-+	per_type_decoder_f *aper_decoder;	/* Aligned PER decoder */
-+	per_type_encoder_f *aper_encoder;	/* Aligned PER encoder */
- 
- 	/***********************************************************************
- 	 * Internally useful members. Not to be used by applications directly. *
-Index: skeletons/RELATIVE-OID.c
-===================================================================
---- skeletons/RELATIVE-OID.c	(revision 1516)
-+++ skeletons/RELATIVE-OID.c	(working copy)
-@@ -28,6 +28,8 @@
- 	RELATIVE_OID_encode_xer,
- 	OCTET_STRING_decode_uper,
- 	OCTET_STRING_encode_uper,
-+	OCTET_STRING_decode_aper,
-+	OCTET_STRING_encode_aper,
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_RELATIVE_OID_tags,
- 	sizeof(asn_DEF_RELATIVE_OID_tags)
-Index: skeletons/per_encoder.c
-===================================================================
---- skeletons/per_encoder.c	(revision 1516)
-+++ skeletons/per_encoder.c	(working copy)
-@@ -4,6 +4,7 @@
- 
- static asn_enc_rval_t uper_encode_internal(asn_TYPE_descriptor_t *td, asn_per_constraints_t *, void *sptr, asn_app_consume_bytes_f *cb, void *app_key);
- 
-+static asn_enc_rval_t aper_encode_internal(asn_TYPE_descriptor_t *td, asn_per_constraints_t *, void *sptr, asn_app_consume_bytes_f *cb, void *app_key);
- asn_enc_rval_t
- uper_encode(asn_TYPE_descriptor_t *td, void *sptr, asn_app_consume_bytes_f *cb, void *app_key) {
- 	return uper_encode_internal(td, 0, sptr, cb, app_key);
-@@ -41,6 +42,18 @@
- 	return uper_encode_internal(td, 0, sptr, encode_to_buffer_cb, &key);
- }
- 
-+asn_enc_rval_t
-+aper_encode_to_buffer(asn_TYPE_descriptor_t *td, void *sptr, void *buffer, size_t buffer_size) {
-+	enc_to_buf_arg key;
-+	
-+	key.buffer = buffer;
-+	key.left = buffer_size;
-+
-+	if(td) ASN_DEBUG("Encoding \"%s\" using ALIGNED PER", td->name);
-+
-+	return aper_encode_internal(td, 0, sptr, encode_to_buffer_cb, &key);
-+}
-+
- typedef struct enc_dyn_arg {
- 	void *buffer;
- 	size_t length;
-@@ -93,6 +106,35 @@
- 	}
- }
- 
-+ssize_t
-+aper_encode_to_new_buffer(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, void **buffer_r) {
-+	asn_enc_rval_t er;
-+	enc_dyn_arg key;
-+	
-+	memset(&key, 0, sizeof(key));
-+	
-+	er = aper_encode_internal(td, constraints, sptr, encode_dyn_cb, &key);
-+	switch(er.encoded) {
-+		case -1:
-+			FREEMEM(key.buffer);
-+			return -1;
-+		case 0:
-+			FREEMEM(key.buffer);
-+			key.buffer = MALLOC(1);
-+			if(key.buffer) {
-+				*(char *)key.buffer = '\0';
-+				*buffer_r = key.buffer;
-+				return 1;
-+			} else {
-+				return -1;
-+			}
-+		default:
-+			*buffer_r = key.buffer;
-+			ASN_DEBUG("Complete encoded in %ld bits", (long)er.encoded);
-+			return ((er.encoded + 7) >> 3);
-+	}
-+}
-+
- /*
-  * Internally useful functions.
-  */
-@@ -115,6 +157,23 @@
- 	return po->outper(po->tmpspace, buf - po->tmpspace, po->op_key);
- }
- 
-+static int
-+_aper_encode_flush_outp(asn_per_outp_t *po) {
-+	uint8_t *buf;
-+
-+	if(po->nboff == 0 && po->buffer == po->tmpspace)
-+		return 0;
-+
-+	buf = po->buffer + (po->nboff >> 3);
-+	/* Make sure we account for the last, partially filled */
-+	if(po->nboff & 0x07) {
-+		buf[0] &= 0xff << (8 - (po->nboff & 0x07));
-+		buf++;
-+	}
-+
-+	return po->outper(po->tmpspace, buf - po->tmpspace, po->op_key);
-+}
-+
- static asn_enc_rval_t
- uper_encode_internal(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_app_consume_bytes_f *cb, void *app_key) {
- 	asn_per_outp_t po;
-@@ -149,3 +208,37 @@
- 	return er;
- }
- 
-+static asn_enc_rval_t
-+aper_encode_internal(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_app_consume_bytes_f *cb, void *app_key) {
-+	asn_per_outp_t po;
-+	asn_enc_rval_t er;
-+
-+	/*
-+	 * Invoke type-specific encoder.
-+	 */
-+	if(!td || !td->aper_encoder)
-+		_ASN_ENCODE_FAILED;	 /* PER is not compiled in */
-+
-+	po.buffer = po.tmpspace;
-+	po.nboff = 0;
-+	po.nbits = 8 * sizeof(po.tmpspace);
-+	po.outper = cb;
-+	po.op_key = app_key;
-+	po.flushed_bytes = 0;
-+
-+	er = td->aper_encoder(td, constraints, sptr, &po);
-+	if(er.encoded != -1) {
-+		size_t bits_to_flush;
-+
-+		bits_to_flush = ((po.buffer - po.tmpspace) << 3) + po.nboff;
-+
-+		/* Set number of bits encoded to a firm value */
-+		er.encoded = (po.flushed_bytes << 3) + bits_to_flush;
-+
-+		if(_aper_encode_flush_outp(&po))
-+			_ASN_ENCODE_FAILED;
-+	}
-+
-+	return er;
-+}
-+
-Index: skeletons/NumericString.c
-===================================================================
---- skeletons/NumericString.c	(revision 1516)
-+++ skeletons/NumericString.c	(working copy)
-@@ -49,6 +49,8 @@
- 	OCTET_STRING_encode_xer_utf8,
- 	OCTET_STRING_decode_uper,
- 	OCTET_STRING_encode_uper,
-+	OCTET_STRING_decode_aper,
-+	OCTET_STRING_encode_aper,
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_NumericString_tags,
- 	sizeof(asn_DEF_NumericString_tags)
-Index: skeletons/per_encoder.h
-===================================================================
---- skeletons/per_encoder.h	(revision 1516)
-+++ skeletons/per_encoder.h	(working copy)
-@@ -38,6 +38,12 @@
- 	size_t buffer_size	/* Initial buffer size (max) */
- );
- 
-+asn_enc_rval_t aper_encode_to_buffer(
-+	struct asn_TYPE_descriptor_s *type_descriptor,
-+	void *struct_ptr,	   /* Structure to be encoded */
-+	void *buffer,		   /* Pre-allocated buffer */
-+	size_t buffer_size	   /* Initial buffer size (max) */
-+);
- /*
-  * A variant of uper_encode_to_buffer() which allocates buffer itself.
-  * Returns the number of bytes in the buffer or -1 in case of failure.
-@@ -52,6 +58,11 @@
- 	void **buffer_r		/* Buffer allocated and returned */
- );
- 
-+ssize_t
-+aper_encode_to_new_buffer(struct asn_TYPE_descriptor_s *td,
-+						  asn_per_constraints_t *constraints,
-+						  void *sptr,
-+						  void **buffer_r);
- /*
-  * Type of the generic PER encoder function.
-  */
-Index: skeletons/T61String.c
-===================================================================
---- skeletons/T61String.c	(revision 1516)
-+++ skeletons/T61String.c	(working copy)
-@@ -24,6 +24,8 @@
- 	OCTET_STRING_encode_xer,
- 	OCTET_STRING_decode_uper,
- 	OCTET_STRING_encode_uper,
-+	OCTET_STRING_decode_aper,
-+	OCTET_STRING_encode_aper,
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_T61String_tags,
- 	sizeof(asn_DEF_T61String_tags)
-Index: skeletons/TeletexString.c
-===================================================================
---- skeletons/TeletexString.c	(revision 1516)
-+++ skeletons/TeletexString.c	(working copy)
-@@ -24,6 +24,8 @@
- 	OCTET_STRING_encode_xer,
- 	OCTET_STRING_decode_uper,
- 	OCTET_STRING_encode_uper,
-+	OCTET_STRING_decode_aper,
-+	OCTET_STRING_encode_aper,
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_TeletexString_tags,
- 	sizeof(asn_DEF_TeletexString_tags)
-Index: skeletons/BMPString.c
-===================================================================
---- skeletons/BMPString.c	(revision 1516)
-+++ skeletons/BMPString.c	(working copy)
-@@ -35,6 +35,8 @@
- 	BMPString_encode_xer,		/* Convert to UTF-8 */
- 	OCTET_STRING_decode_uper,
- 	OCTET_STRING_encode_uper,
-+	OCTET_STRING_decode_aper,	/* Aligned PER decoder */
-+	OCTET_STRING_encode_aper,	/* Aligned PER encoder */
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_BMPString_tags,
- 	sizeof(asn_DEF_BMPString_tags)
-Index: skeletons/ObjectDescriptor.c
-===================================================================
---- skeletons/ObjectDescriptor.c	(revision 1516)
-+++ skeletons/ObjectDescriptor.c	(working copy)
-@@ -24,6 +24,8 @@
- 	OCTET_STRING_encode_xer_utf8,
- 	OCTET_STRING_decode_uper,
- 	OCTET_STRING_encode_uper,
-+	OCTET_STRING_decode_aper,
-+	OCTET_STRING_encode_aper,
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_ObjectDescriptor_tags,
- 	sizeof(asn_DEF_ObjectDescriptor_tags)
-Index: skeletons/PrintableString.c
-===================================================================
---- skeletons/PrintableString.c	(revision 1516)
-+++ skeletons/PrintableString.c	(working copy)
-@@ -59,6 +59,8 @@
- 	OCTET_STRING_encode_xer_utf8,
- 	OCTET_STRING_decode_uper,
- 	OCTET_STRING_encode_uper,
-+	OCTET_STRING_decode_aper,
-+	OCTET_STRING_encode_aper,
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_PrintableString_tags,
- 	sizeof(asn_DEF_PrintableString_tags)
-Index: skeletons/constr_SET_OF.c
-===================================================================
---- skeletons/constr_SET_OF.c	(revision 1516)
-+++ skeletons/constr_SET_OF.c	(working copy)
-@@ -34,7 +34,7 @@
- #undef	ADVANCE
- #define	ADVANCE(num_bytes)	do {		\
- 		size_t num = num_bytes;		\
--		ptr = ((const void *)ptr) + num;\
-+		ptr = ((const char *)ptr) + num;\
- 		size -= num;			\
- 		if(ctx->left >= 0)		\
- 			ctx->left -= num;	\
-@@ -100,7 +100,7 @@
- 	/*
- 	 * Restore parsing context.
- 	 */
--	ctx = (asn_struct_ctx_t *)((void *)st + specs->ctx_offset);
-+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
- 	
- 	/*
- 	 * Start to parse where left previously
-@@ -457,7 +457,7 @@
- #undef	XER_ADVANCE
- #define	XER_ADVANCE(num_bytes)	do {			\
- 		size_t num = num_bytes;			\
--		buf_ptr = ((const void *)buf_ptr) + num;\
-+		buf_ptr = ((const char *)buf_ptr) + num;\
- 		size -= num;				\
- 		consumed_myself += num;			\
- 	} while(0)
-@@ -505,7 +505,7 @@
- 	/*
- 	 * Restore parsing context.
- 	 */
--	ctx = (asn_struct_ctx_t *)((void *)st + specs->ctx_offset);
-+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
- 
- 	/*
- 	 * Phases of XER/XML processing:
-@@ -627,7 +627,7 @@
- 		t->buffer = p;
- 		t->size = newsize;
- 	}
--	memcpy((void *)t->buffer + t->offset, buffer, size);
-+	memcpy((char *)t->buffer + t->offset, buffer, size);
- 	t->offset += size;
- 	return 0;
- }
-@@ -809,7 +809,7 @@
- 		asn_set_empty(list);	/* Remove (list->array) */
- 
- 		specs = (asn_SET_OF_specifics_t *)td->specifics;
--		ctx = (asn_struct_ctx_t *)((void *)ptr + specs->ctx_offset);
-+		ctx = (asn_struct_ctx_t *)((char *)ptr + specs->ctx_offset);
- 		if(ctx->ptr) {
- 			ASN_STRUCT_FREE(*elm->type, ctx->ptr);
- 			ctx->ptr = 0;
-@@ -884,7 +884,7 @@
- 	if(!st) {
- 		st = *sptr = CALLOC(1, specs->struct_size);
- 		if(!st) _ASN_DECODE_FAILED;
--	}                                                                       
-+	}
- 	list = _A_SET_FROM_VOID(st);
- 
- 	/* Figure out which constraints to use */
-@@ -901,7 +901,7 @@
- 	if(ct && ct->effective_bits >= 0) {
- 		/* X.691, #19.5: No length determinant */
- 		nelems = per_get_few_bits(pd, ct->effective_bits);
--		ASN_DEBUG("Preparing to fetch %ld+%ld elements from %s",
-+		ASN_DEBUG("Preparing to fetch %ld+%"PRIdMAX" elements from %s",
- 			(long)nelems, ct->lower_bound, td->name);
- 		if(nelems < 0)  _ASN_DECODE_STARVED;
- 		nelems += ct->lower_bound;
-@@ -951,3 +951,91 @@
- 	return rv;
- }
- 
-+asn_dec_rval_t
-+SET_OF_decode_aper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
-+				   asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
-+	asn_dec_rval_t rv;
-+	asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics;
-+	asn_TYPE_member_t *elm = td->elements;	/* Single one */
-+	void *st = *sptr;
-+	asn_anonymous_set_ *list;
-+	asn_per_constraint_t *ct;
-+	int repeat = 0;
-+	ssize_t nelems;
-+
-+	if(_ASN_STACK_OVERFLOW_CHECK(opt_codec_ctx))
-+		_ASN_DECODE_FAILED;
-+
-+	/*
-+	 * Create the target structure if it is not present already.
-+	 */
-+	if(!st) {
-+		st = *sptr = CALLOC(1, specs->struct_size);
-+		if(!st) _ASN_DECODE_FAILED;
-+	}
-+	list = _A_SET_FROM_VOID(st);
-+
-+	/* Figure out which constraints to use */
-+	if(constraints) ct = &constraints->size;
-+	else if(td->per_constraints) ct = &td->per_constraints->size;
-+	else ct = 0;
-+
-+	if(ct && ct->flags & APC_EXTENSIBLE) {
-+		int value = per_get_few_bits(pd, 1);
-+		if(value < 0) _ASN_DECODE_STARVED;
-+		if(value) ct = 0;	/* Not restricted! */
-+	}
-+
-+	if(ct && ct->effective_bits >= 0) {
-+		/* X.691, #19.5: No length determinant */
-+// 		nelems = per_get_few_bits(pd, ct->effective_bits);
-+		nelems = aper_get_nsnnwn(pd, ct->upper_bound - ct->lower_bound);
-+		ASN_DEBUG("Preparing to fetch %ld+%"PRIdMAX" elements from %s",
-+			(long)nelems, ct->lower_bound, td->name);
-+		if(nelems < 0)  _ASN_DECODE_STARVED;
-+		nelems += ct->lower_bound;
-+	} else {
-+		nelems = -1;
-+	}
-+
-+	do {
-+		int i;
-+		if(nelems < 0) {
-+			nelems = aper_get_length(pd, ct ? ct->upper_bound - ct->lower_bound + 1 : -1,
-+				ct ? ct->effective_bits : -1, &repeat);
-+			ASN_DEBUG("Got to decode %d elements (eff %d)",
-+				(int)nelems, (int)ct ? ct->effective_bits : -1);
-+			if(nelems < 0) _ASN_DECODE_STARVED;
-+		}
-+
-+		for(i = 0; i < nelems; i++) {
-+			void *ptr = 0;
-+			ASN_DEBUG("SET OF %s decoding", elm->type->name);
-+			rv = elm->type->aper_decoder(opt_codec_ctx, elm->type,
-+				elm->per_constraints, &ptr, pd);
-+			ASN_DEBUG("%s SET OF %s decoded %d, %p",
-+				td->name, elm->type->name, rv.code, ptr);
-+			if(rv.code == RC_OK) {
-+				if(ASN_SET_ADD(list, ptr) == 0)
-+					continue;
-+				ASN_DEBUG("Failed to add element into %s",
-+					td->name);
-+				/* Fall through */
-+				rv.code = RC_FAIL;
-+			} else {
-+				ASN_DEBUG("Failed decoding %s of %s (SET OF)",
-+					elm->type->name, td->name);
-+			}
-+			if(ptr) ASN_STRUCT_FREE(*elm->type, ptr);
-+			return rv;
-+		}
-+
-+		nelems = -1;	/* Allow uper_get_length() */
-+	} while(repeat);
-+
-+	ASN_DEBUG("Decoded %s as SET OF", td->name);
-+
-+	rv.code = RC_OK;
-+	rv.consumed = 0;
-+	return rv;
-+}
-Index: skeletons/NULL.c
-===================================================================
---- skeletons/NULL.c	(revision 1516)
-+++ skeletons/NULL.c	(working copy)
-@@ -25,6 +25,8 @@
- 	NULL_encode_xer,
- 	NULL_decode_uper,	/* Unaligned PER decoder */
- 	NULL_encode_uper,	/* Unaligned PER encoder */
-+	NULL_decode_aper,	/* Aligned PER decoder */
-+	NULL_encode_aper,	/* Aligned PER encoder */
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_NULL_tags,
- 	sizeof(asn_DEF_NULL_tags) / sizeof(asn_DEF_NULL_tags[0]),
-@@ -135,6 +137,34 @@
- 	return rv;
- }
- 
-+asn_dec_rval_t
-+NULL_decode_aper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
-+	asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
-+	asn_dec_rval_t rv;
-+
-+	(void)opt_codec_ctx;
-+	(void)td;
-+	(void)constraints;
-+	(void)pd;
-+
-+	if(!*sptr) {
-+		*sptr = MALLOC(sizeof(NULL_t));
-+		if(*sptr) {
-+			*(NULL_t *)*sptr = 0;
-+		} else {
-+			_ASN_DECODE_FAILED;
-+		}
-+	}
-+
-+	/*
-+	 * NULL type does not have content octets.
-+	 */
-+
-+	rv.code = RC_OK;
-+	rv.consumed = 0;
-+	return rv;
-+}
-+
- asn_enc_rval_t
- NULL_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints,
- 		void *sptr, asn_per_outp_t *po) {
-@@ -148,3 +178,17 @@
- 	er.encoded = 0;
- 	_ASN_ENCODED_OK(er);
- }
-+
-+asn_enc_rval_t
-+NULL_encode_aper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints,
-+	void *sptr, asn_per_outp_t *po) {
-+	asn_enc_rval_t er;
-+
-+	(void)td;
-+	(void)constraints;
-+	(void)sptr;
-+	(void)po;
-+	
-+	er.encoded = 0;
-+	_ASN_ENCODED_OK(er);
-+}
-Index: skeletons/per_decoder.c
-===================================================================
---- skeletons/per_decoder.c	(revision 1516)
-+++ skeletons/per_decoder.c	(working copy)
-@@ -37,6 +37,35 @@
- }
- 
- asn_dec_rval_t
-+aper_decode_complete(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const void *buffer, size_t size) {
-+	asn_dec_rval_t rval;
-+	
-+	rval = aper_decode(opt_codec_ctx, td, sptr, buffer, size, 0, 0);
-+	if(rval.consumed) {
-+		/*
-+		 * We've always given 8-aligned data,
-+		 * so convert bits to integral bytes.
-+		 */
-+		rval.consumed += 7;
-+		rval.consumed >>= 3;
-+	} else if(rval.code == RC_OK) {
-+		if(size) {
-+			if(((const uint8_t *)buffer)[0] == 0) {
-+				rval.consumed = 1;	/* 1 byte */
-+			} else {
-+				ASN_DEBUG("Expecting single zeroed byte");
-+				rval.code = RC_FAIL;
-+			}
-+		} else {
-+			/* Must contain at least 8 bits. */
-+			rval.code = RC_WMORE;
-+		}
-+	}
-+	
-+	return rval;
-+}
-+
-+asn_dec_rval_t
- uper_decode(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const void *buffer, size_t size, int skip_bits, int unused_bits) {
- 	asn_codec_ctx_t s_codec_ctx;
- 	asn_dec_rval_t rval;
-@@ -91,3 +120,57 @@
- 	return rval;
- }
- 
-+asn_dec_rval_t
-+aper_decode(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const void *buffer, size_t size, int skip_bits, int unused_bits) {
-+	asn_codec_ctx_t s_codec_ctx;
-+	asn_dec_rval_t rval;
-+	asn_per_data_t pd;
-+	
-+	if(skip_bits < 0 || skip_bits > 7
-+		|| unused_bits < 0 || unused_bits > 7
-+		|| (unused_bits > 0 && !size))
-+		_ASN_DECODE_FAILED;
-+	
-+	/*
-+	 * Stack checker requires that the codec context
-+	 * must be allocated on the stack.
-+	 */
-+	if(opt_codec_ctx) {
-+		if(opt_codec_ctx->max_stack_size) {
-+			s_codec_ctx = *opt_codec_ctx;
-+			opt_codec_ctx = &s_codec_ctx;
-+		}
-+	} else {
-+		/* If context is not given, be security-conscious anyway */
-+		memset(&s_codec_ctx, 0, sizeof(s_codec_ctx));
-+		s_codec_ctx.max_stack_size = _ASN_DEFAULT_STACK_MAX;
-+		opt_codec_ctx = &s_codec_ctx;
-+	}
-+	
-+	/* Fill in the position indicator */
-+	memset(&pd, 0, sizeof(pd));
-+	pd.buffer = (const uint8_t *)buffer;
-+	pd.nboff = skip_bits;
-+	pd.nbits = 8 * size - unused_bits; /* 8 is CHAR_BIT from <limits.h> */
-+	if(pd.nboff > pd.nbits)
-+		_ASN_DECODE_FAILED;
-+	
-+	/*
-+	 * Invoke type-specific decoder.
-+	 */
-+	if(!td->aper_decoder)
-+		_ASN_DECODE_FAILED;	/* PER is not compiled in */
-+		rval = td->aper_decoder(opt_codec_ctx, td, 0, sptr, &pd);
-+	if(rval.code == RC_OK) {
-+		/* Return the number of consumed bits */
-+		rval.consumed = ((pd.buffer - (const uint8_t *)buffer) << 3)
-+		+ pd.nboff - skip_bits;
-+		ASN_DEBUG("PER decoding consumed %d, counted %d",
-+				  rval.consumed, pd.moved);
-+		assert(rval.consumed == pd.moved);
-+	} else {
-+		/* PER codec is not a restartable */
-+		rval.consumed = 0;
-+	}
-+	return rval;
-+}
-Index: skeletons/constr_SET_OF.h
-===================================================================
---- skeletons/constr_SET_OF.h	(revision 1516)
-+++ skeletons/constr_SET_OF.h	(working copy)
-@@ -34,6 +34,8 @@
- xer_type_encoder_f SET_OF_encode_xer;
- per_type_decoder_f SET_OF_decode_uper;
- per_type_encoder_f SET_OF_encode_uper;
-+per_type_decoder_f SET_OF_decode_aper;
-+per_type_encoder_f SET_OF_encode_aper;
- 
- #ifdef __cplusplus
- }
-Index: skeletons/NULL.h
-===================================================================
---- skeletons/NULL.h	(revision 1516)
-+++ skeletons/NULL.h	(working copy)
-@@ -25,6 +25,8 @@
- xer_type_encoder_f NULL_encode_xer;
- per_type_decoder_f NULL_decode_uper;
- per_type_encoder_f NULL_encode_uper;
-+per_type_decoder_f NULL_decode_aper;
-+per_type_encoder_f NULL_encode_aper;
- 
- #ifdef __cplusplus
- }
-Index: skeletons/per_decoder.h
-===================================================================
---- skeletons/per_decoder.h	(revision 1516)
-+++ skeletons/per_decoder.h	(working copy)
-@@ -38,8 +38,30 @@
- 	int unused_bits		/* Number of unused tailing bits, 0..7 */
- 	);
- 
-+/*
-+ * Aligned PER decoder of a "complete encoding" as per X.691#10.1.
-+ * On success, this call always returns (.consumed >= 1), as per X.691#10.1.3.
-+ */
-+asn_dec_rval_t aper_decode_complete(struct asn_codec_ctx_s *opt_codec_ctx,
-+									struct asn_TYPE_descriptor_s *type_descriptor,	/* Type to decode */
-+									void **struct_ptr,	/* Pointer to a target structure's pointer */
-+									const void *buffer,	/* Data to be decoded */
-+									size_t size		/* Size of data buffer */
-+									);
- 
- /*
-+ * Aligned PER decoder of any ASN.1 type. May be invoked by the application.
-+ * WARNING: This call returns the number of BITS read from the stream. Beware.
-+ */
-+asn_dec_rval_t aper_decode(struct asn_codec_ctx_s *opt_codec_ctx,
-+						   struct asn_TYPE_descriptor_s *type_descriptor,	/* Type to decode */
-+						   void **struct_ptr,	/* Pointer to a target structure's pointer */
-+						   const void *buffer,	/* Data to be decoded */
-+						   size_t size,		/* Size of data buffer */
-+						   int skip_bits,		/* Number of unused leading bits, 0..7 */
-+						   int unused_bits		/* Number of unused tailing bits, 0..7 */
-+					       );
-+/*
-  * Type of the type-specific PER decoder function.
-  */
- typedef asn_dec_rval_t (per_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx,
-Index: skeletons/per_support.c
-===================================================================
---- skeletons/per_support.c	(revision 1516)
-+++ skeletons/per_support.c	(working copy)
-@@ -31,6 +31,16 @@
- 	}
- }
- 
-+int32_t
-+aper_get_align(asn_per_data_t *pd) {
-+
-+	if(pd->nboff & 0x7) {
-+		ASN_DEBUG("Aligning %d bits", 8 - (pd->nboff & 0x7));
-+		return per_get_few_bits(pd, 8 - (pd->nboff & 0x7));
-+	}
-+	return 0;
-+}
-+
- /*
-  * Extract a small number of bits (<= 31) from the specified PER data pointer.
-  */
-@@ -187,6 +197,36 @@
- 	return (16384 * value);
- }
- 
-+ssize_t
-+aper_get_length(asn_per_data_t *pd, int range, int ebits, int *repeat) {
-+	ssize_t value;
-+
-+	*repeat = 0;
-+
-+	if (range <= 65536 && range >= 0)
-+		return aper_get_nsnnwn(pd, range);
-+
-+	if (aper_get_align(pd) < 0)
-+		return -1;
-+
-+	if(ebits >= 0) return per_get_few_bits(pd, ebits);
-+
-+	value = per_get_few_bits(pd, 8);
-+	if(value < 0) return -1;
-+	if((value & 128) == 0)  /* #10.9.3.6 */
-+		return (value & 0x7F);
-+	if((value & 64) == 0) { /* #10.9.3.7 */
-+		value = ((value & 63) << 8) | per_get_few_bits(pd, 8);
-+		if(value < 0) return -1;
-+		return value;
-+	}
-+	value &= 63;	/* this is "m" from X.691, #10.9.3.8 */
-+	if(value < 1 || value > 4)
-+		return -1;
-+	*repeat = 1;
-+	return (16384 * value);
-+}
-+
- /*
-  * Get the normally small length "n".
-  * This procedure used to decode length of extensions bit-maps
-@@ -211,6 +251,25 @@
- 	}
- }
- 
-+ssize_t
-+aper_get_nslength(asn_per_data_t *pd) {
-+	ssize_t length;
-+
-+	ASN_DEBUG("Getting normally small length");
-+
-+	if(per_get_few_bits(pd, 1) == 0) {
-+		length = per_get_few_bits(pd, 6) + 1;
-+		if(length <= 0) return -1;
-+		ASN_DEBUG("l=%d", length);
-+		return length;
-+	} else {
-+		int repeat;
-+		length = aper_get_length(pd, -1, -1, &repeat);
-+		if(length >= 0 && !repeat) return length;
-+		return -1; /* Error, or do not support >16K extensions */
-+	}
-+}
-+
- /*
-  * Get the normally small non-negative whole number.
-  * X.691, #10.6
-@@ -237,6 +296,40 @@
- 	return value;
- }
- 
-+ssize_t
-+aper_get_nsnnwn(asn_per_data_t *pd, int range) {
-+	ssize_t value;
-+	int bytes = 0;
-+
-+	ASN_DEBUG("getting nsnnwn with range %d", range);
-+
-+	if(range <= 255) {
-+		if (range < 0) return -1;
-+		/* 1 -> 8 bits */
-+		int i;
-+		for (i = 1; i <= 8; i++) {
-+			int upper = 1 << i;
-+			if (upper >= range)
-+				break;
-+		}
-+		value = per_get_few_bits(pd, i);
-+		return value;
-+	} else if (range == 256){
-+		/* 1 byte */
-+		bytes = 1;
-+		return -1;
-+	} else if (range <= 65536) {
-+		/* 2 bytes */
-+		bytes = 2;
-+	} else {
-+		return -1;
-+	}
-+	if (aper_get_align(pd) < 0)
-+		return -1;
-+	value = per_get_few_bits(pd, 8 * bytes);
-+	return value;
-+}
-+
- /*
-  * Put the normally small non-negative whole number.
-  * X.691, #10.6
-@@ -263,7 +356,59 @@
- 	return per_put_few_bits(po, n, 8 * bytes);
- }
- 
-+int
-+aper_put_nsnnwn(asn_per_outp_t *po, int range, int number) {
-+	int bytes;
- 
-+	/* 10.5.7.1 X.691 */
-+	if(range < 0) {
-+		int i;
-+		for (i = 1; ; i++) {
-+			int bits = 1 << (8 * i);
-+			if (number <= bits)
-+				break;
-+		}
-+		bytes = i;
-+		assert(i <= 4);
-+	}
-+	if(range <= 255) {
-+		int i;
-+		for (i = 1; i <= 8; i++) {
-+			int bits = 1 << i;
-+			if (range <= bits)
-+				break;
-+		}
-+		return per_put_few_bits(po, number, i);
-+	} else if(range == 256) {
-+		bytes = 1;
-+	} else if(range <= 65536) {
-+		bytes = 2;
-+	} else { /* Ranges > 64K */
-+		int i;
-+		for (i = 1; ; i++) {
-+			int bits = 1 << (8 * i);
-+			if (range <= bits)
-+				break;
-+		}
-+		assert(i <= 4);
-+		bytes = i;
-+	}
-+	if(aper_put_align(po) < 0) /* Aligning on octet */
-+		return -1;
-+
-+	return per_put_few_bits(po, number, 8 * bytes);
-+}
-+
-+int aper_put_align(asn_per_outp_t *po) {
-+
-+	if(po->nboff & 0x7) {
-+		ASN_DEBUG("Aligning %d bits", 8 - (po->nboff & 0x7));
-+		if(per_put_few_bits(po, 0x00, (8 - (po->nboff & 0x7))))
-+			return -1;
-+	}
-+	return 0;
-+}
-+
- /*
-  * Put a small number of bits (<= 31).
-  */
-@@ -392,6 +537,8 @@
- ssize_t
- uper_put_length(asn_per_outp_t *po, size_t length) {
- 
-+	ASN_DEBUG("UPER put length %d", length);
-+
- 	if(length <= 127)	/* #10.9.3.6 */
- 		return per_put_few_bits(po, length, 8)
- 			? -1 : (ssize_t)length;
-@@ -406,7 +553,34 @@
- 			? -1 : (ssize_t)(length << 14);
- }
- 
-+ssize_t
-+aper_put_length(asn_per_outp_t *po, int range, size_t length) {
- 
-+	ASN_DEBUG("APER put length %d with range %d", length, range);
-+
-+	/* 10.9 X.691 Note 2 */
-+	if (range <= 65536 && range >= 0)
-+		return aper_put_nsnnwn(po, range, length);
-+
-+	if (aper_put_align(po) < 0)
-+		return -1;
-+
-+	if(length <= 127)	   /* #10.9.3.6 */{
-+		return per_put_few_bits(po, length, 8)
-+		? -1 : (ssize_t)length;
-+	}
-+	else if(length < 16384) /* #10.9.3.7 */
-+		return per_put_few_bits(po, length|0x8000, 16)
-+		? -1 : (ssize_t)length;
-+	
-+	length >>= 14;
-+	if(length > 4) length = 4;
-+	
-+	return per_put_few_bits(po, 0xC0 | length, 8)
-+	? -1 : (ssize_t)(length << 14);
-+}
-+
-+
- /*
-  * Put the normally small length "n" into the stream.
-  * This procedure used to encode length of extensions bit-maps
-@@ -429,3 +603,19 @@
- 	return 0;
- }
- 
-+int
-+aper_put_nslength(asn_per_outp_t *po, size_t length) {
-+
-+	if(length <= 64) {
-+		/* #10.9.3.4 */
-+		if(length == 0) return -1;
-+		return per_put_few_bits(po, length-1, 7) ? -1 : 0;
-+	} else {
-+		if(aper_put_length(po, -1, length) != (ssize_t)length) {
-+			/* This might happen in case of >16K extensions */
-+			return -1;
-+		}
-+	}
-+
-+	return 0;
-+}
-Index: skeletons/constr_SET.c
-===================================================================
---- skeletons/constr_SET.c	(revision 1516)
-+++ skeletons/constr_SET.c	(working copy)
-@@ -36,7 +36,7 @@
- #undef	ADVANCE
- #define	ADVANCE(num_bytes)	do {		\
- 		size_t num = num_bytes;		\
--		ptr = ((const void *)ptr) + num;\
-+		ptr = ((const char *)ptr) + num;\
- 		size -= num;			\
- 		if(ctx->left >= 0)		\
- 			ctx->left -= num;	\
-@@ -132,7 +132,7 @@
- 	/*
- 	 * Restore parsing context.
- 	 */
--	ctx = (asn_struct_ctx_t *)((void *)st + specs->ctx_offset);
-+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
- 	
- 	/*
- 	 * Start to parse where left previously
-@@ -250,7 +250,7 @@
- 
- 			skip = ber_skip_length(opt_codec_ctx,
- 				BER_TLV_CONSTRUCTED(ptr),
--				(const void *)ptr + tag_len, LEFT - tag_len);
-+				(const char *)ptr + tag_len, LEFT - tag_len);
- 
- 			switch(skip) {
- 			case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
-@@ -271,7 +271,7 @@
- 		 * Check for duplications: must not overwrite
- 		 * already decoded elements.
- 		 */
--		if(ASN_SET_ISPRESENT2((void *)st + specs->pres_offset, edx)) {
-+		if(ASN_SET_ISPRESENT2((char *)st + specs->pres_offset, edx)) {
- 			ASN_DEBUG("SET %s: Duplicate element %s (%d)",
- 				td->name, elements[edx].name, edx);
- 			RETURN(RC_FAIL);
-@@ -284,13 +284,13 @@
- 		 */
- 		if(elements[edx].flags & ATF_POINTER) {
- 			/* Member is a pointer to another structure */
--			memb_ptr2 = (void **)((void *)st + elements[edx].memb_offset);
-+			memb_ptr2 = (void **)((char *)st + elements[edx].memb_offset);
- 		} else {
- 			/*
- 			 * A pointer to a pointer
- 			 * holding the start of the structure
- 			 */
--			memb_ptr = (void *)st + elements[edx].memb_offset;
-+			memb_ptr = (char *)st + elements[edx].memb_offset;
- 			memb_ptr2 = &memb_ptr;
- 		}
- 		/*
-@@ -302,7 +302,7 @@
- 				elements[edx].tag_mode);
- 		switch(rval.code) {
- 		case RC_OK:
--			ASN_SET_MKPRESENT((void *)st + specs->pres_offset, edx);
-+			ASN_SET_MKPRESENT((char *)st + specs->pres_offset, edx);
- 			break;
- 		case RC_WMORE: /* More data expected */
- 			if(!SIZE_VIOLATION) {
-@@ -369,7 +369,7 @@
- 
- 			ll = ber_skip_length(opt_codec_ctx,
- 				BER_TLV_CONSTRUCTED(ptr),
--				(const void *)ptr + tl, LEFT - tl);
-+				(const char *)ptr + tl, LEFT - tl);
- 			switch(ll) {
- 			case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
- 				/* Fall through */
-@@ -404,7 +404,7 @@
- 		unsigned int midx, pres, must;
- 
- 		midx = edx/(8 * sizeof(specs->_mandatory_elements[0]));
--		pres = ((unsigned int *)((void *)st+specs->pres_offset))[midx];
-+		pres = ((unsigned int *)((char *)st+specs->pres_offset))[midx];
- 		must = sys_ntohl(specs->_mandatory_elements[midx]);
- 
- 		if((pres & must) == must) {
-@@ -473,7 +473,7 @@
- 		 * Compute the length of the encoding of this member.
- 		 */
- 		if(elm->flags & ATF_POINTER) {
--			memb_ptr = *(void **)((void *)sptr + elm->memb_offset);
-+			memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
- 			if(!memb_ptr) {
- 				if(!elm->optional)
- 					/* Mandatory elements missing */
-@@ -486,7 +486,7 @@
- 				continue;
- 			}
- 		} else {
--			memb_ptr = (void *)((void *)sptr + elm->memb_offset);
-+			memb_ptr = (void *)((char *)sptr + elm->memb_offset);
- 		}
- 		tmper = elm->type->der_encoder(elm->type, memb_ptr,
- 			elm->tag_mode, elm->tag,
-@@ -547,10 +547,10 @@
- 		elm = &td->elements[t2m[edx].el_no];
- 
- 		if(elm->flags & ATF_POINTER) {
--			memb_ptr = *(void **)((void *)sptr + elm->memb_offset);
-+			memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
- 			if(!memb_ptr) continue;
- 		} else {
--			memb_ptr = (void *)((void *)sptr + elm->memb_offset);
-+			memb_ptr = (void *)((char *)sptr + elm->memb_offset);
- 		}
- 		tmper = elm->type->der_encoder(elm->type, memb_ptr,
- 			elm->tag_mode, elm->tag,
-@@ -570,10 +570,185 @@
- 	_ASN_ENCODED_OK(er);
- }
- 
-+asn_enc_rval_t
-+SET_encode_uper(asn_TYPE_descriptor_t *td,
-+				asn_per_constraints_t *constraints,
-+				void *sptr,
-+				asn_per_outp_t *po) {
-+}
-+
-+asn_dec_rval_t
-+SET_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
-+					 asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
-+}
-+
-+asn_enc_rval_t
-+SET_encode_aper(asn_TYPE_descriptor_t *td,
-+				asn_per_constraints_t *constraints,
-+				void *sptr,
-+				asn_per_outp_t *po) {
-+	asn_SET_specifics_t *specs = (asn_SET_specifics_t *)td->specifics;
-+	asn_enc_rval_t er;
-+	int edx, i;
-+	int t2m_build_own = (specs->tag2el_count != td->elements_count);
-+	asn_TYPE_tag2member_t *t2m;
-+	int t2m_count;
-+
-+	(void)constraints;
-+
-+	if(!sptr)
-+		_ASN_ENCODE_FAILED;
-+
-+	er.encoded = 0;
-+
-+	ASN_DEBUG("Encoding %s as SET (APER) map %d", td->name, specs->_mandatory_elements[0]);
-+
-+	/*
-+	 * Use existing, or build our own tags map.
-+	 */
-+	if(t2m_build_own) {
-+		t2m = (asn_TYPE_tag2member_t *)alloca(
-+			td->elements_count * sizeof(t2m[0]));
-+	if(!t2m) _ASN_ENCODE_FAILED; /* There are such platforms */
-+		t2m_count = 0;
-+	} else {
-+		/*
-+		 * There is no untagged CHOICE in this SET.
-+		 * Employ existing table.
-+		 */
-+		t2m = specs->tag2el;
-+		t2m_count = specs->tag2el_count;
-+	}
-+
-+	/*
-+	 * Gather the length of the underlying members sequence.
-+	 */
-+	for(edx = 0; edx < td->elements_count; edx++) {
-+		asn_TYPE_member_t *elm = &td->elements[edx];
-+		asn_enc_rval_t tmper;
-+		void *memb_ptr;
-+		
-+		/*
-+		 * Compute the length of the encoding of this member.
-+		 */
-+		if(elm->flags & ATF_POINTER) {
-+			memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
-+			if(!memb_ptr) {
-+				if(!elm->optional)
-+				/* Mandatory elements missing */
-+					_ASN_ENCODE_FAILED;
-+				if(t2m_build_own) {
-+					t2m[t2m_count].el_no = edx;
-+					t2m[t2m_count].el_tag = 0;
-+					t2m_count++;
-+				}
-+				continue;
-+			}
-+		} else {
-+			memb_ptr = (void *)((char *)sptr + elm->memb_offset);
-+		}
-+
-+		/*
-+		 * Remember the outmost tag of this member.
-+		 */
-+		if(t2m_build_own) {
-+			t2m[t2m_count].el_no = edx;
-+			t2m[t2m_count].el_tag = asn_TYPE_outmost_tag(
-+				elm->type, memb_ptr, elm->tag_mode, elm->tag);
-+			t2m_count++;
-+		} else {
-+			/*
-+			 * No dynamic sorting is necessary.
-+			 */
-+		}
-+	}
-+
-+	/*
-+	 * Finalize order of the components.
-+	 */
-+	assert(t2m_count == td->elements_count);
-+	if(t2m_build_own) {
-+		/*
-+		 * Sort the underlying members according to their
-+		 * canonical tags order. DER encoding mandates it.
-+		 */
-+		qsort(t2m, t2m_count, sizeof(specs->tag2el[0]), _t2e_cmp);
-+	} else {
-+		/*
-+		 * Tags are already sorted by the compiler.
-+		 */
-+	}
-+
-+	for(edx = 0; edx < td->elements_count; edx++) {
-+		asn_TYPE_member_t *elm = &td->elements[t2m[edx].el_no];
-+		asn_enc_rval_t tmper;
-+		void *memb_ptr;		 /* Pointer to the member */
-+		void **memb_ptr2;	   /* Pointer to that pointer */
-+		int present;
-+
-+		/* Fetch the pointer to this member */
-+		if(elm->flags & ATF_POINTER) {
-+			memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
-+			present = (*memb_ptr2 != 0);
-+		} else {
-+//			 memb_ptr = (void *)((char *)sptr + elm->memb_offset);
-+//			 memb_ptr2 = &memb_ptr;
-+			present = 1;
-+			continue;
-+		}
-+
-+//		 /* Eliminate default values */
-+//		 if(present && elm->default_value
-+//			 && elm->default_value(0, memb_ptr2) == 1)
-+//			 present = 0;
-+
-+		ASN_DEBUG("Element %s %s %s->%s is %s",
-+				  elm->flags & ATF_POINTER ? "ptr" : "inline",
-+				  elm->default_value ? "def" : "wtv",
-+				  td->name, elm->name, present ? "present" : "absent");
-+		if(per_put_few_bits(po, present << 7, 8))
-+			_ASN_ENCODE_FAILED;
-+	}
-+
-+	/*
-+	 * Encode all members.
-+	 */
-+	for(edx = 0; edx < td->elements_count; edx++) {
-+		asn_TYPE_member_t *elm = &td->elements[edx];
-+		asn_enc_rval_t tmper;
-+		void *memb_ptr;		 /* Pointer to the member */
-+		void **memb_ptr2;	   /* Pointer to that pointer */
-+
-+		/* Encode according to the tag order */
-+//		 elm = &td->elements[t2m[edx].el_no];
-+
-+		if(elm->flags & ATF_POINTER) {
-+			memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
-+			if(!*memb_ptr2) {
-+				ASN_DEBUG("Element %s %d not present",
-+						  elm->name, edx);
-+				if(elm->optional)
-+					continue;
-+				/* Mandatory element is missing */
-+				_ASN_ENCODE_FAILED;
-+			}
-+		} else {
-+			memb_ptr = (void *)((char *)sptr + elm->memb_offset);
-+			memb_ptr2 = &memb_ptr;
-+		}
-+		tmper = elm->type->aper_encoder(elm->type, elm->per_constraints,
-+										*memb_ptr2, po);
-+		if(tmper.encoded == -1)
-+			return tmper;
-+	}
-+
-+	_ASN_ENCODED_OK(er);
-+}
-+
- #undef	XER_ADVANCE
- #define	XER_ADVANCE(num_bytes)	do {			\
- 		size_t num = num_bytes;			\
--		buf_ptr = ((const void *)buf_ptr) + num;\
-+		buf_ptr = ((const char *)buf_ptr) + num;\
- 		size -= num;				\
- 		consumed_myself += num;			\
- 	} while(0)
-@@ -613,7 +788,7 @@
- 	/*
- 	 * Restore parsing context.
- 	 */
--	ctx = (asn_struct_ctx_t *)((void *)st + specs->ctx_offset);
-+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
- 
- 	/*
- 	 * Phases of XER/XML processing:
-@@ -637,7 +812,7 @@
- 			void *memb_ptr;		/* Pointer to the member */
- 			void **memb_ptr2;	/* Pointer to that pointer */
- 
--			if(ASN_SET_ISPRESENT2((void *)st + specs->pres_offset,
-+			if(ASN_SET_ISPRESENT2((char *)st + specs->pres_offset,
- 					edx)) {
- 				ASN_DEBUG("SET %s: Duplicate element %s (%d)",
- 				td->name, elements[edx].name, edx);
-@@ -648,10 +823,10 @@
- 
- 			if(elm->flags & ATF_POINTER) {
- 				/* Member is a pointer to another structure */
--				memb_ptr2 = (void **)((void *)st
-+				memb_ptr2 = (void **)((char *)st
- 					+ elm->memb_offset);
- 			} else {
--				memb_ptr = (void *)st + elm->memb_offset;
-+				memb_ptr = (char *)st + elm->memb_offset;
- 				memb_ptr2 = &memb_ptr;
- 			}
- 
-@@ -663,7 +838,7 @@
- 			if(tmprval.code != RC_OK)
- 				RETURN(tmprval.code);
- 			ctx->phase = 1;	/* Back to body processing */
--			ASN_SET_MKPRESENT((void *)st + specs->pres_offset, edx);
-+			ASN_SET_MKPRESENT((char *)st + specs->pres_offset, edx);
- 			ASN_DEBUG("XER/SET phase => %d", ctx->phase);
- 			/* Fall through */
- 		}
-@@ -827,7 +1002,7 @@
- 		mlen = strlen(elm->name);
- 
- 		if(elm->flags & ATF_POINTER) {
--			memb_ptr = *(void **)((void *)sptr + elm->memb_offset);
-+			memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
- 			if(!memb_ptr) {
- 				if(elm->optional)
- 					continue;
-@@ -835,7 +1010,7 @@
- 				_ASN_ENCODE_FAILED;
- 			}
- 		} else {
--			memb_ptr = (void *)((void *)sptr + elm->memb_offset);
-+			memb_ptr = (void *)((char *)sptr + elm->memb_offset);
- 		}
- 
- 		if(!xcan)
-@@ -877,14 +1052,14 @@
- 		const void *memb_ptr;
- 
- 		if(elm->flags & ATF_POINTER) {
--			memb_ptr = *(const void * const *)((const void *)sptr + elm->memb_offset);
-+			memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset);
- 			if(!memb_ptr) {
- 				if(elm->optional) continue;
- 				/* Print <absent> line */
- 				/* Fall through */
- 			}
- 		} else {
--			memb_ptr = (const void *)((const void *)sptr + elm->memb_offset);
-+			memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
- 		}
- 
- 		_i_INDENT(1);
-@@ -919,11 +1094,11 @@
- 		asn_TYPE_member_t *elm = &td->elements[edx];
- 		void *memb_ptr;
- 		if(elm->flags & ATF_POINTER) {
--			memb_ptr = *(void **)((void *)ptr + elm->memb_offset);
-+			memb_ptr = *(void **)((char *)ptr + elm->memb_offset);
- 			if(memb_ptr)
- 				ASN_STRUCT_FREE(*elm->type, memb_ptr);
- 		} else {
--			memb_ptr = (void *)((void *)ptr + elm->memb_offset);
-+			memb_ptr = (void *)((char *)ptr + elm->memb_offset);
- 			ASN_STRUCT_FREE_CONTENTS_ONLY(*elm->type, memb_ptr);
- 		}
- 	}
-@@ -953,7 +1128,7 @@
- 		const void *memb_ptr;
- 
- 		if(elm->flags & ATF_POINTER) {
--			memb_ptr = *(const void * const *)((const void *)sptr + elm->memb_offset);
-+			memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset);
- 			if(!memb_ptr) {
- 				if(elm->optional)
- 					continue;
-@@ -963,7 +1138,7 @@
- 				return -1;
- 			}
- 		} else {
--			memb_ptr = (const void *)((const void *)sptr + elm->memb_offset);
-+			memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
- 		}
- 
- 		if(elm->memb_constraints) {
-Index: skeletons/constr_SEQUENCE_OF.c
-===================================================================
---- skeletons/constr_SEQUENCE_OF.c	(revision 1516)
-+++ skeletons/constr_SEQUENCE_OF.c	(working copy)
-@@ -164,7 +164,7 @@
- 	if(ct) {
- 		int not_in_root = (list->count < ct->lower_bound
- 				|| list->count > ct->upper_bound);
--		ASN_DEBUG("lb %ld ub %ld %s",
-+		ASN_DEBUG("lb %"PRIdMAX" ub %"PRIdMAX" %s",
- 			ct->lower_bound, ct->upper_bound,
- 			ct->flags & APC_EXTENSIBLE ? "ext" : "fix");
- 		if(ct->flags & APC_EXTENSIBLE) {
-@@ -206,3 +206,70 @@
- 	_ASN_ENCODED_OK(er);
- }
- 
-+asn_enc_rval_t
-+SEQUENCE_OF_encode_aper(asn_TYPE_descriptor_t *td,
-+	asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-+	asn_anonymous_sequence_ *list;
-+	asn_per_constraint_t *ct;
-+	asn_enc_rval_t er;
-+	asn_TYPE_member_t *elm = td->elements;
-+	int seq;
-+
-+	if(!sptr) _ASN_ENCODE_FAILED;
-+	list = _A_SEQUENCE_FROM_VOID(sptr);
-+
-+	er.encoded = 0;
-+
-+	ASN_DEBUG("Encoding %s as SEQUENCE OF size (%d) using ALIGNED PER", td->name, list->count);
-+
-+	if(constraints) ct = &constraints->size;
-+	else if(td->per_constraints) ct = &td->per_constraints->size;
-+	else ct = 0;
-+
-+	/* If extensible constraint, check if size is in root */
-+	if(ct) {
-+		int not_in_root = (list->count < ct->lower_bound
-+				|| list->count > ct->upper_bound);
-+		ASN_DEBUG("lb %"PRIdMAX" ub %"PRIdMAX" %s",
-+			ct->lower_bound, ct->upper_bound,
-+			ct->flags & APC_EXTENSIBLE ? "ext" : "fix");
-+		if(ct->flags & APC_EXTENSIBLE) {
-+			/* Declare whether size is in extension root */
-+			if(per_put_few_bits(po, not_in_root, 1))
-+				_ASN_ENCODE_FAILED;
-+			if(not_in_root) ct = 0;
-+		} else if(not_in_root && ct->effective_bits >= 0)
-+			_ASN_ENCODE_FAILED;
-+	}
-+
-+	if(ct && ct->effective_bits >= 0) {
-+		/* X.691, #19.5: No length determinant */
-+//		 if(per_put_few_bits(po, list->count - ct->lower_bound,
-+//				 ct->effective_bits))
-+//			 _ASN_ENCODE_FAILED;
-+		if (aper_put_length(po, ct->upper_bound - ct->lower_bound + 1, list->count - ct->lower_bound) < 0)
-+			_ASN_ENCODE_FAILED;
-+	}
-+
-+	for(seq = -1; seq < list->count;) {
-+		ssize_t mayEncode;
-+		if(seq < 0) seq = 0;
-+		if(ct && ct->effective_bits >= 0) {
-+			mayEncode = list->count;
-+		} else {
-+			mayEncode = aper_put_length(po, -1, list->count - seq);
-+			if(mayEncode < 0) _ASN_ENCODE_FAILED;
-+		}
-+
-+		while(mayEncode--) {
-+			void *memb_ptr = list->array[seq++];
-+			if(!memb_ptr) _ASN_ENCODE_FAILED;
-+			er = elm->type->aper_encoder(elm->type,
-+				elm->per_constraints, memb_ptr, po);
-+			if(er.encoded == -1)
-+				_ASN_ENCODE_FAILED;
-+		}
-+	}
-+
-+	_ASN_ENCODED_OK(er);
-+}
-Index: skeletons/per_support.h
-===================================================================
---- skeletons/per_support.h	(revision 1516)
-+++ skeletons/per_support.h	(working copy)
-@@ -24,8 +24,8 @@
- 	} flags;
- 	int  range_bits;		/* Full number of bits in the range */
- 	int  effective_bits;		/* Effective bits */
--	long lower_bound;		/* "lb" value */
--	long upper_bound;		/* "ub" value */
-+	int64_t lower_bound;		/* "lb" value */
-+	int64_t upper_bound;		/* "ub" value */
- } asn_per_constraint_t;
- typedef struct asn_per_constraints_s {
- 	asn_per_constraint_t value;
-@@ -39,9 +39,9 @@
-  */
- typedef struct asn_per_data_s {
-   const uint8_t *buffer;  /* Pointer to the octet stream */
--         size_t  nboff;   /* Bit offset to the meaningful bit */
--         size_t  nbits;   /* Number of bits in the stream */
--         size_t  moved;   /* Number of bits moved through this bit stream */
-+		 size_t  nboff;   /* Bit offset to the meaningful bit */
-+		 size_t  nbits;   /* Number of bits in the stream */
-+		 size_t  moved;   /* Number of bits moved through this bit stream */
-   int (*refill)(struct asn_per_data_s *);
-   void *refill_key;
- } asn_per_data_t;
-@@ -71,15 +71,22 @@
- 			int effective_bound_bits,
- 			int *repeat);
- 
-+ssize_t aper_get_length(asn_per_data_t *pd,
-+						int range,
-+						int effective_bound_bits,
-+						int *repeat);
-+
- /*
-  * Get the normally small length "n".
-  */
- ssize_t uper_get_nslength(asn_per_data_t *pd);
-+ssize_t aper_get_nslength(asn_per_data_t *pd);
- 
- /*
-  * Get the normally small non-negative whole number.
-  */
- ssize_t uper_get_nsnnwn(asn_per_data_t *pd);
-+ssize_t aper_get_nsnnwn(asn_per_data_t *pd, int range);
- 
- /* Non-thread-safe debugging function, don't use it */
- char *per_data_string(asn_per_data_t *pd);
-@@ -103,6 +110,10 @@
- /* Output a large number of bits */
- int per_put_many_bits(asn_per_outp_t *po, const uint8_t *src, int put_nbits);
- 
-+/* Align the current bit position to octet bundary */
-+int aper_put_align(asn_per_outp_t *po);
-+int32_t aper_get_align(asn_per_data_t *pd);
-+
- /*
-  * Put the length "n" to the Unaligned PER stream.
-  * This function returns the number of units which may be flushed
-@@ -110,17 +121,23 @@
-  */
- ssize_t uper_put_length(asn_per_outp_t *po, size_t whole_length);
- 
-+ssize_t aper_put_length(asn_per_outp_t *po, int range, size_t length);
-+
- /*
-  * Put the normally small length "n" to the Unaligned PER stream.
-  * Returns 0 or -1.
-  */
- int uper_put_nslength(asn_per_outp_t *po, size_t length);
- 
-+int aper_put_nslength(asn_per_outp_t *po, size_t length);
-+
- /*
-  * Put the normally small non-negative whole number.
-  */
- int uper_put_nsnnwn(asn_per_outp_t *po, int n);
- 
-+int aper_put_nsnnwn(asn_per_outp_t *po, int range, int number);
-+
- #ifdef __cplusplus
- }
- #endif
-Index: skeletons/constr_SET.h
-===================================================================
---- skeletons/constr_SET.h	(revision 1516)
-+++ skeletons/constr_SET.h	(working copy)
-@@ -53,7 +53,9 @@
- xer_type_decoder_f SET_decode_xer;
- xer_type_encoder_f SET_encode_xer;
- per_type_decoder_f SET_decode_uper;
-+per_type_decoder_f SET_decode_aper;
- per_type_encoder_f SET_encode_uper;
-+per_type_encoder_f SET_encode_aper;
- 
- /***********************
-  * Some handy helpers. *
-Index: skeletons/constr_SEQUENCE_OF.h
-===================================================================
---- skeletons/constr_SEQUENCE_OF.h	(revision 1516)
-+++ skeletons/constr_SEQUENCE_OF.h	(working copy)
-@@ -22,9 +22,11 @@
- #define	SEQUENCE_OF_decode_ber	SET_OF_decode_ber
- #define	SEQUENCE_OF_decode_xer	SET_OF_decode_xer
- #define	SEQUENCE_OF_decode_uper	SET_OF_decode_uper
-+#define	SEQUENCE_OF_decode_aper	SET_OF_decode_aper
- der_type_encoder_f SEQUENCE_OF_encode_der;
- xer_type_encoder_f SEQUENCE_OF_encode_xer;
- per_type_encoder_f SEQUENCE_OF_encode_uper;
-+per_type_encoder_f SEQUENCE_OF_encode_aper;
- 
- #ifdef __cplusplus
- }
-Index: skeletons/ENUMERATED.c
-===================================================================
---- skeletons/ENUMERATED.c	(revision 1516)
-+++ skeletons/ENUMERATED.c	(working copy)
-@@ -26,6 +26,8 @@
- 	INTEGER_encode_xer,
- 	ENUMERATED_decode_uper,	/* Unaligned PER decoder */
- 	ENUMERATED_encode_uper,	/* Unaligned PER encoder */
-+	ENUMERATED_decode_aper,	/* Aligned PER decoder */
-+	ENUMERATED_encode_aper,	/* Aligned PER encoder */
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_ENUMERATED_tags,
- 	sizeof(asn_DEF_ENUMERATED_tags) / sizeof(asn_DEF_ENUMERATED_tags[0]),
-@@ -57,6 +59,27 @@
- 	return rval;
- }
- 
-+asn_dec_rval_t
-+ENUMERATED_decode_aper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
-+	asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
-+	asn_dec_rval_t rval;
-+	ENUMERATED_t *st = (ENUMERATED_t *)*sptr;
-+	long value;
-+	void *vptr = &value;
-+
-+	if(!st) {
-+		st = (ENUMERATED_t *)(*sptr = CALLOC(1, sizeof(*st)));
-+		if(!st) _ASN_DECODE_FAILED;
-+	}
-+
-+	rval = NativeEnumerated_decode_aper(opt_codec_ctx, td, constraints,
-+			(void **)&vptr, pd);
-+	if(rval.code == RC_OK)
-+		if(asn_long2INTEGER(st, value))
-+			rval.code = RC_FAIL;
-+	return rval;
-+}
-+
- asn_enc_rval_t
- ENUMERATED_encode_uper(asn_TYPE_descriptor_t *td,
- 	asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-@@ -69,3 +92,14 @@
- 	return NativeEnumerated_encode_uper(td, constraints, &value, po);
- }
- 
-+asn_enc_rval_t
-+ENUMERATED_encode_aper(asn_TYPE_descriptor_t *td,
-+	asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-+	ENUMERATED_t *st = (ENUMERATED_t *)sptr;
-+	long value;
-+	
-+	if(asn_INTEGER2long(st, &value))
-+		_ASN_ENCODE_FAILED;
-+	
-+	return NativeEnumerated_encode_aper(td, constraints, &value, po);
-+}
-Index: skeletons/ENUMERATED.h
-===================================================================
---- skeletons/ENUMERATED.h	(revision 1516)
-+++ skeletons/ENUMERATED.h	(working copy)
-@@ -17,6 +17,8 @@
- 
- per_type_decoder_f ENUMERATED_decode_uper;
- per_type_encoder_f ENUMERATED_encode_uper;
-+per_type_decoder_f ENUMERATED_decode_aper;
-+per_type_encoder_f ENUMERATED_encode_aper;
- 
- #ifdef __cplusplus
- }
-Index: skeletons/NativeEnumerated.c
-===================================================================
---- skeletons/NativeEnumerated.c	(revision 1516)
-+++ skeletons/NativeEnumerated.c	(working copy)
-@@ -30,6 +30,8 @@
- 	NativeEnumerated_encode_xer,
- 	NativeEnumerated_decode_uper,
- 	NativeEnumerated_encode_uper,
-+	NativeEnumerated_decode_aper,
-+	NativeEnumerated_encode_aper,
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_NativeEnumerated_tags,
- 	sizeof(asn_DEF_NativeEnumerated_tags) / sizeof(asn_DEF_NativeEnumerated_tags[0]),
-@@ -42,17 +44,17 @@
- 
- asn_enc_rval_t
- NativeEnumerated_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
--        int ilevel, enum xer_encoder_flags_e flags,
--                asn_app_consume_bytes_f *cb, void *app_key) {
-+	int ilevel, enum xer_encoder_flags_e flags,
-+	asn_app_consume_bytes_f *cb, void *app_key) {
- 	asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics;
--        asn_enc_rval_t er;
--        const long *native = (const long *)sptr;
-+	asn_enc_rval_t er;
-+	const long *native = (const long *)sptr;
- 	const asn_INTEGER_enum_map_t *el;
- 
--        (void)ilevel;
--        (void)flags;
-+	(void)ilevel;
-+	(void)flags;
- 
--        if(!native) _ASN_ENCODE_FAILED;
-+	if(!native) _ASN_ENCODE_FAILED;
- 
- 	el = INTEGER_map_value2enum(specs, *native);
- 	if(el) {
-@@ -125,6 +127,66 @@
- 	return rval;
- }
- 
-+asn_dec_rval_t
-+NativeEnumerated_decode_aper(asn_codec_ctx_t *opt_codec_ctx,
-+	asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints,
-+	void **sptr, asn_per_data_t *pd) {
-+	asn_INTEGER_specifics_t *specs = (asn_INTEGER_specifics_t *)td->specifics;
-+	asn_dec_rval_t rval = { RC_OK, 0 };
-+	long *native = (long *)*sptr;
-+	asn_per_constraint_t *ct;
-+	long value;
-+	int freeme = 0;
-+
-+	(void)opt_codec_ctx;
-+
-+	if(constraints) ct = &constraints->value;
-+	else if(td->per_constraints) ct = &td->per_constraints->value;
-+	else _ASN_DECODE_FAILED;	/* Mandatory! */
-+	if(!specs) _ASN_DECODE_FAILED;
-+
-+	if(!native) {
-+		native = (long *)(*sptr = CALLOC(1, sizeof(*native)));
-+		freeme = 1;
-+		if(!native) _ASN_DECODE_FAILED;
-+	}
-+
-+	ASN_DEBUG("Decoding %s as NativeEnumerated", td->name);
-+
-+	if(ct->flags & APC_EXTENSIBLE) {
-+		int inext = per_get_few_bits(pd, 1);
-+		if(inext < 0) _ASN_DECODE_STARVED;
-+		if(inext) ct = 0;
-+	}
-+
-+	if(ct && ct->range_bits >= 0) {
-+		value = per_get_few_bits(pd, ct->range_bits);
-+		if(value < 0) _ASN_DECODE_STARVED;
-+		if(value >= (specs->extension
-+			? specs->extension - 1 : specs->map_count))
-+			_ASN_DECODE_FAILED;
-+	} else {
-+		if(!specs->extension)
-+			_ASN_DECODE_FAILED;
-+		/*
-+		 * X.691, #10.6: normally small non-negative whole number;
-+		 */
-+		value = uper_get_nsnnwn(pd);
-+		if(value < 0) _ASN_DECODE_STARVED;
-+		value += specs->extension - 1;
-+		if(value >= specs->map_count)
-+			_ASN_DECODE_FAILED;
-+	}
-+
-+	*native = specs->value2enum[value].nat_value;
-+	ASN_DEBUG("Decoded %s = %ld", td->name, *native);
-+
-+	if (freeme)
-+		free(native);
-+
-+	return rval;
-+}
-+
- static int
- NativeEnumerated__compar_value2enum(const void *ap, const void *bp) {
- 	const asn_INTEGER_enum_map_t *a = ap;
-@@ -205,3 +267,71 @@
- 	_ASN_ENCODED_OK(er);
- }
- 
-+asn_enc_rval_t
-+NativeEnumerated_encode_aper(asn_TYPE_descriptor_t *td,
-+	asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-+	asn_INTEGER_specifics_t *specs = (asn_INTEGER_specifics_t *)td->specifics;
-+	asn_enc_rval_t er;
-+	long native, value;
-+	asn_per_constraint_t *ct;
-+	int inext = 0;
-+	asn_INTEGER_enum_map_t key;
-+	asn_INTEGER_enum_map_t *kf;
-+
-+	if(!sptr) _ASN_ENCODE_FAILED;
-+	if(!specs) _ASN_ENCODE_FAILED;
-+
-+	if(constraints) ct = &constraints->value;
-+	else if(td->per_constraints) ct = &td->per_constraints->value;
-+	else _ASN_ENCODE_FAILED;	/* Mandatory! */
-+
-+	ASN_DEBUG("Encoding %s as NativeEnumerated", td->name);
-+
-+	er.encoded = 0;
-+
-+	native = *(long *)sptr;
-+	if(native < 0) _ASN_ENCODE_FAILED;
-+
-+	key.nat_value = native;
-+	kf = bsearch(&key, specs->value2enum, specs->map_count,
-+		sizeof(key), NativeEnumerated__compar_value2enum);
-+	if(!kf) {
-+		ASN_DEBUG("No element corresponds to %ld", native);
-+		_ASN_ENCODE_FAILED;
-+	}
-+	value = kf - specs->value2enum;
-+
-+	if(ct->range_bits >= 0) {
-+		int cmpWith = specs->extension
-+				? specs->extension - 1 : specs->map_count;
-+		if(value >= cmpWith)
-+			inext = 1;
-+	}
-+	if(ct->flags & APC_EXTENSIBLE) {
-+		if(per_put_few_bits(po, inext, 1))
-+			_ASN_ENCODE_FAILED;
-+		if(inext) ct = 0;
-+	} else if(inext) {
-+		_ASN_ENCODE_FAILED;
-+	}
-+
-+	if(ct && ct->range_bits >= 0) {
-+		if(per_put_few_bits(po, value, ct->range_bits))
-+			_ASN_ENCODE_FAILED;
-+		_ASN_ENCODED_OK(er);
-+	}
-+
-+	if(!specs->extension)
-+		_ASN_ENCODE_FAILED;
-+
-+	/*
-+	 * X.691, #10.6: normally small non-negative whole number;
-+	 */
-+	ASN_DEBUG("value = %ld, ext = %d, inext = %d, res = %ld",
-+		value, specs->extension, inext,
-+		value - (inext ? (specs->extension - 1) : 0));
-+	if(uper_put_nsnnwn(po, value - (inext ? (specs->extension - 1) : 0)))
-+		_ASN_ENCODE_FAILED;
-+
-+	_ASN_ENCODED_OK(er);
-+}
-Index: skeletons/GeneralString.c
-===================================================================
---- skeletons/GeneralString.c	(revision 1516)
-+++ skeletons/GeneralString.c	(working copy)
-@@ -24,6 +24,8 @@
- 	OCTET_STRING_encode_xer,
- 	OCTET_STRING_decode_uper,    /* Implemented in terms of OCTET STRING */
- 	OCTET_STRING_encode_uper,
-+	OCTET_STRING_decode_aper,
-+	OCTET_STRING_encode_aper,
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_GeneralString_tags,
- 	sizeof(asn_DEF_GeneralString_tags)
-Index: skeletons/IA5String.c
-===================================================================
---- skeletons/IA5String.c	(revision 1516)
-+++ skeletons/IA5String.c	(working copy)
-@@ -29,6 +29,8 @@
- 	OCTET_STRING_encode_xer_utf8,
- 	OCTET_STRING_decode_uper,
- 	OCTET_STRING_encode_uper,
-+	OCTET_STRING_decode_aper,
-+	OCTET_STRING_encode_aper,
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_IA5String_tags,
- 	sizeof(asn_DEF_IA5String_tags)
-Index: skeletons/NativeEnumerated.h
-===================================================================
---- skeletons/NativeEnumerated.h	(revision 1516)
-+++ skeletons/NativeEnumerated.h	(working copy)
-@@ -24,6 +24,8 @@
- xer_type_encoder_f NativeEnumerated_encode_xer;
- per_type_decoder_f NativeEnumerated_decode_uper;
- per_type_encoder_f NativeEnumerated_encode_uper;
-+per_type_decoder_f NativeEnumerated_decode_aper;
-+per_type_encoder_f NativeEnumerated_encode_aper;
- 
- #ifdef __cplusplus
- }
-Index: skeletons/OBJECT_IDENTIFIER.c
-===================================================================
---- skeletons/OBJECT_IDENTIFIER.c	(revision 1516)
-+++ skeletons/OBJECT_IDENTIFIER.c	(working copy)
-@@ -27,6 +27,8 @@
- 	OBJECT_IDENTIFIER_encode_xer,
- 	OCTET_STRING_decode_uper,
- 	OCTET_STRING_encode_uper,
-+	OCTET_STRING_decode_aper,
-+	OCTET_STRING_encode_aper,
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_OBJECT_IDENTIFIER_tags,
- 	sizeof(asn_DEF_OBJECT_IDENTIFIER_tags)
-Index: skeletons/per_opentype.c
-===================================================================
---- skeletons/per_opentype.c	(revision 1516)
-+++ skeletons/per_opentype.c	(working copy)
-@@ -53,6 +53,35 @@
- 	return 0;
- }
- 
-+int
-+aper_open_type_put(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-+	void *buf;
-+	void *bptr;
-+	ssize_t size;
-+	size_t toGo;
-+	
-+	ASN_DEBUG("Open type put %s ...", td->name);
-+	
-+	size = aper_encode_to_new_buffer(td, constraints, sptr, &buf);
-+	if(size <= 0) return -1;
-+
-+	for(bptr = buf, toGo = size; toGo;) {
-+		ssize_t maySave = aper_put_length(po, -1, toGo);
-+		if(maySave < 0) break;
-+		if(per_put_many_bits(po, bptr, maySave * 8)) break;
-+		bptr = (char *)bptr + maySave;
-+		toGo -= maySave;
-+	}
-+	
-+	FREEMEM(buf);
-+	if(toGo) return -1;
-+	
-+	ASN_DEBUG("Open type put %s of length %ld + overhead (1byte?)",
-+		td->name, (long)size);
-+	
-+	return 0;
-+}
-+
- static asn_dec_rval_t
- uper_open_type_get_simple(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td,
- 	asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
-Index: skeletons/VideotexString.c
-===================================================================
---- skeletons/VideotexString.c	(revision 1516)
-+++ skeletons/VideotexString.c	(working copy)
-@@ -24,6 +24,8 @@
- 	OCTET_STRING_encode_xer,
- 	OCTET_STRING_decode_uper,    /* Implemented in terms of OCTET STRING */
- 	OCTET_STRING_encode_uper,
-+	OCTET_STRING_decode_aper,
-+	OCTET_STRING_encode_aper,
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_VideotexString_tags,
- 	sizeof(asn_DEF_VideotexString_tags)
-Index: skeletons/per_opentype.h
-===================================================================
---- skeletons/per_opentype.h	(revision 1516)
-+++ skeletons/per_opentype.h	(working copy)
-@@ -15,6 +15,8 @@
- 
- int uper_open_type_put(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po);
- 
-+int aper_open_type_put(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po);
-+
- #ifdef __cplusplus
- }
- #endif
-Index: skeletons/BOOLEAN.c
-===================================================================
---- skeletons/BOOLEAN.c	(revision 1516)
-+++ skeletons/BOOLEAN.c	(working copy)
-@@ -24,6 +24,8 @@
- 	BOOLEAN_encode_xer,
- 	BOOLEAN_decode_uper,	/* Unaligned PER decoder */
- 	BOOLEAN_encode_uper,	/* Unaligned PER encoder */
-+	BOOLEAN_decode_aper,	/* Aligned PER decoder */
-+	BOOLEAN_encode_aper,	/* Aligned PER encoder */
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_BOOLEAN_tags,
- 	sizeof(asn_DEF_BOOLEAN_tags) / sizeof(asn_DEF_BOOLEAN_tags[0]),
-@@ -264,7 +266,36 @@
- 	return rv;
- }
- 
-+asn_dec_rval_t
-+BOOLEAN_decode_aper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
-+	asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
-+	asn_dec_rval_t rv;
-+	BOOLEAN_t *st = (BOOLEAN_t *)*sptr;
- 
-+	(void)opt_codec_ctx;
-+	(void)constraints;
-+
-+	if(!st) {
-+		st = (BOOLEAN_t *)(*sptr = MALLOC(sizeof(*st)));
-+		if(!st) _ASN_DECODE_FAILED;
-+	}
-+
-+	/*
-+	 * Extract a single bit
-+	 */
-+	switch(per_get_few_bits(pd, 1)) {
-+	case 1: *st = 1; break;
-+	case 0: *st = 0; break;
-+	case -1: default: _ASN_DECODE_STARVED;
-+	}
-+
-+	ASN_DEBUG("%s decoded as %s", td->name, *st ? "TRUE" : "FALSE");
-+
-+	rv.code = RC_OK;
-+	rv.consumed = 1;
-+	return rv;
-+}
-+
- asn_enc_rval_t
- BOOLEAN_encode_uper(asn_TYPE_descriptor_t *td,
- 	asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-@@ -280,3 +311,18 @@
- 
- 	_ASN_ENCODED_OK(er);
- }
-+
-+asn_enc_rval_t
-+BOOLEAN_encode_aper(asn_TYPE_descriptor_t *td,
-+	asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-+	const BOOLEAN_t *st = (const BOOLEAN_t *)sptr;
-+	asn_enc_rval_t er;
-+
-+	(void)constraints;
-+
-+	if(!st) _ASN_ENCODE_FAILED;
-+
-+	per_put_few_bits(po, *st ? 1 : 0, 1);
-+
-+	_ASN_ENCODED_OK(er);
-+}
-Index: skeletons/ISO646String.c
-===================================================================
---- skeletons/ISO646String.c	(revision 1516)
-+++ skeletons/ISO646String.c	(working copy)
-@@ -29,6 +29,8 @@
- 	OCTET_STRING_encode_xer_utf8,
- 	OCTET_STRING_decode_uper,
- 	OCTET_STRING_encode_uper,
-+	OCTET_STRING_decode_aper,
-+	OCTET_STRING_encode_aper,
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_ISO646String_tags,
- 	sizeof(asn_DEF_ISO646String_tags)
-Index: skeletons/constr_CHOICE.c
-===================================================================
---- skeletons/constr_CHOICE.c	(revision 1516)
-+++ skeletons/constr_CHOICE.c	(working copy)
-@@ -34,7 +34,7 @@
- #undef	ADVANCE
- #define	ADVANCE(num_bytes)	do {		\
- 		size_t num = num_bytes;		\
--		ptr = ((const void *)ptr) + num;\
-+		ptr = ((const char *)ptr) + num;\
- 		size -= num;			\
- 		if(ctx->left >= 0)		\
- 			ctx->left -= num;	\
-@@ -133,7 +133,7 @@
- 	/*
- 	 * Restore parsing context.
- 	 */
--	ctx = (asn_struct_ctx_t *)((void *)st + specs->ctx_offset);
-+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
- 	
- 	/*
- 	 * Start to parse where left previously
-@@ -211,7 +211,7 @@
- 
- 				skip = ber_skip_length(opt_codec_ctx,
- 					BER_TLV_CONSTRUCTED(ptr),
--					(const void *)ptr + tag_len,
-+					(const char *)ptr + tag_len,
- 					LEFT - tag_len);
- 
- 				switch(skip) {
-@@ -244,7 +244,7 @@
- 		 */
- 		if(elm->flags & ATF_POINTER) {
- 			/* Member is a pointer to another structure */
--			memb_ptr2 = (void **)((void *)st + elm->memb_offset);
-+			memb_ptr2 = (void **)((char *)st + elm->memb_offset);
- 		} else {
- 			/*
- 			 * A pointer to a pointer
-@@ -390,7 +390,7 @@
- 	 */
- 	elm = &td->elements[present-1];
- 	if(elm->flags & ATF_POINTER) {
--		memb_ptr = *(void **)((void *)sptr + elm->memb_offset);
-+		memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
- 		if(memb_ptr == 0) {
- 			if(elm->optional) {
- 				erval.encoded = 0;
-@@ -400,7 +400,7 @@
- 			_ASN_ENCODE_FAILED;
- 		}
- 	} else {
--		memb_ptr = (void *)((void *)sptr + elm->memb_offset);
-+		memb_ptr = (void *)((char *)sptr + elm->memb_offset);
- 	}
- 
- 	/*
-@@ -463,10 +463,10 @@
- 
- 		if(elm->flags & ATF_POINTER) {
- 			memb_ptr = *(const void * const *)
--					((const void *)ptr + elm->memb_offset);
-+					((const char *)ptr + elm->memb_offset);
- 		} else {
- 			memb_ptr = (const void *)
--					((const void *)ptr + elm->memb_offset);
-+					((const char *)ptr + elm->memb_offset);
- 		}
- 
- 		return asn_TYPE_outmost_tag(elm->type, memb_ptr,
-@@ -498,7 +498,7 @@
- 		const void *memb_ptr;
- 
- 		if(elm->flags & ATF_POINTER) {
--			memb_ptr = *(const void * const *)((const void *)sptr + elm->memb_offset);
-+			memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset);
- 			if(!memb_ptr) {
- 				if(elm->optional)
- 					return 0;
-@@ -508,7 +508,7 @@
- 				return -1;
- 			}
- 		} else {
--			memb_ptr = (const void *)((const void *)sptr + elm->memb_offset);
-+			memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
- 		}
- 
- 		if(elm->memb_constraints) {
-@@ -535,7 +535,7 @@
- #undef	XER_ADVANCE
- #define	XER_ADVANCE(num_bytes)	do {			\
- 		size_t num = num_bytes;			\
--		buf_ptr = ((const void *)buf_ptr) + num;\
-+		buf_ptr = ((const char *)buf_ptr) + num;\
- 		size -= num;				\
- 		consumed_myself += num;			\
- 	} while(0)
-@@ -574,7 +574,7 @@
- 	/*
- 	 * Restore parsing context.
- 	 */
--	ctx = (asn_struct_ctx_t *)((void *)st + specs->ctx_offset);
-+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
- 	if(ctx->phase == 0 && !*xml_tag)
- 		ctx->phase = 1;	/* Skip the outer tag checking phase */
- 
-@@ -605,7 +605,7 @@
- 
- 			if(elm->flags & ATF_POINTER) {
- 				/* Member is a pointer to another structure */
--				memb_ptr2 = (void **)((void *)st
-+				memb_ptr2 = (void **)((char *)st
- 					+ elm->memb_offset);
- 			} else {
- 				memb_ptr = (char *)st + elm->memb_offset;
-@@ -797,10 +797,10 @@
- 		unsigned int mlen = strlen(mname);
- 
- 		if(elm->flags & ATF_POINTER) {
--			memb_ptr = *(void **)((void *)sptr + elm->memb_offset);
-+			memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
- 			if(!memb_ptr) _ASN_ENCODE_FAILED;
- 		} else {
--			memb_ptr = (void *)((void *)sptr + elm->memb_offset);
-+			memb_ptr = (void *)((char *)sptr + elm->memb_offset);
- 		}
- 
- 		er.encoded = 0;
-@@ -884,7 +884,7 @@
- 	elm = &td->elements[value];
- 	if(elm->flags & ATF_POINTER) {
- 		/* Member is a pointer to another structure */
--		memb_ptr2 = (void **)((void *)st + elm->memb_offset);
-+		memb_ptr2 = (void **)((char *)st + elm->memb_offset);
- 	} else {
- 		memb_ptr = (char *)st + elm->memb_offset;
- 		memb_ptr2 = &memb_ptr;
-@@ -904,7 +904,88 @@
- 			elm->name, td->name, rv.code);
- 	return rv;
- }
--   
-+
-+asn_dec_rval_t
-+CHOICE_decode_aper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
-+	asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
-+	asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics;
-+	asn_dec_rval_t rv;
-+	asn_per_constraint_t *ct;
-+	asn_TYPE_member_t *elm;	/* CHOICE's element */
-+	void *memb_ptr;
-+	void **memb_ptr2;
-+	void *st = *sptr;
-+	int value;
-+
-+	if(_ASN_STACK_OVERFLOW_CHECK(opt_codec_ctx))
-+		_ASN_DECODE_FAILED;
-+
-+	/*
-+	 * Create the target structure if it is not present already.
-+	 */
-+	if(!st) {
-+		st = *sptr = CALLOC(1, specs->struct_size);
-+		if(!st) _ASN_DECODE_FAILED;
-+	}
-+
-+	if(constraints) ct = &constraints->value;
-+	else if(td->per_constraints) ct = &td->per_constraints->value;
-+	else ct = 0;
-+
-+	if(ct && ct->flags & APC_EXTENSIBLE) {
-+		value = per_get_few_bits(pd, 1);
-+		if(value < 0) _ASN_DECODE_STARVED;
-+		if(value) ct = 0;	/* Not restricted */
-+	}
-+
-+	if(ct && ct->range_bits >= 0) {
-+		value = per_get_few_bits(pd, ct->range_bits);
-+		if(value < 0) _ASN_DECODE_STARVED;
-+		ASN_DEBUG("CHOICE %s got index %d in range %d",
-+			td->name, value, ct->range_bits);
-+		if(value > ct->upper_bound)
-+			_ASN_DECODE_FAILED;
-+	} else {
-+		if(specs->ext_start == -1)
-+			_ASN_DECODE_FAILED;
-+		value = uper_get_nsnnwn(pd);
-+		if(value < 0) _ASN_DECODE_STARVED;
-+		value += specs->ext_start;
-+		if(value >= td->elements_count)
-+			_ASN_DECODE_FAILED;
-+	}
-+
-+	/* Adjust if canonical order is different from natural order */
-+	if(specs->canonical_order)
-+		value = specs->canonical_order[value];
-+
-+	/* Set presence to be able to free it later */
-+	_set_present_idx(st, specs->pres_offset, specs->pres_size, value + 1);
-+
-+	elm = &td->elements[value];
-+	if(elm->flags & ATF_POINTER) {
-+		/* Member is a pointer to another structure */
-+		memb_ptr2 = (void **)((char *)st + elm->memb_offset);
-+	} else {
-+		memb_ptr = (char *)st + elm->memb_offset;
-+		memb_ptr2 = &memb_ptr;
-+	}
-+	ASN_DEBUG("Discovered CHOICE %s encodes %s", td->name, elm->name);
-+
-+	if(ct && ct->range_bits >= 0) {
-+		rv = elm->type->aper_decoder(opt_codec_ctx, elm->type,
-+			elm->per_constraints, memb_ptr2, pd);
-+	} else {
-+		rv = uper_open_type_get(opt_codec_ctx, elm->type,
-+			elm->per_constraints, memb_ptr2, pd);
-+	}
-+
-+	if(rv.code != RC_OK)
-+		ASN_DEBUG("Failed to decode %s in %s (CHOICE) %d",
-+			elm->name, td->name, rv.code);
-+	return rv;
-+}
-+
- asn_enc_rval_t
- CHOICE_encode_uper(asn_TYPE_descriptor_t *td,
- 	asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-@@ -917,7 +998,7 @@
- 
- 	if(!sptr) _ASN_ENCODE_FAILED;
- 
--	ASN_DEBUG("Encoding %s as CHOICE", td->name);
-+	ASN_DEBUG("Encoding %s as CHOICE using UPER", td->name);
- 
- 	if(constraints) ct = &constraints->value;
- 	else if(td->per_constraints) ct = &td->per_constraints->value;
-@@ -962,7 +1043,7 @@
- 	elm = &td->elements[present];
- 	if(elm->flags & ATF_POINTER) {
- 		/* Member is a pointer to another structure */
--		memb_ptr = *(void **)((void *)sptr + elm->memb_offset);
-+		memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
- 		if(!memb_ptr) _ASN_ENCODE_FAILED;
- 	} else {
- 		memb_ptr = (char *)sptr + elm->memb_offset;
-@@ -987,8 +1068,88 @@
- 		_ASN_ENCODED_OK(rval);
- 	}
- }
--   
- 
-+asn_enc_rval_t
-+CHOICE_encode_aper(asn_TYPE_descriptor_t *td,
-+				   asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-+	asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics;
-+	asn_TYPE_member_t *elm; /* CHOICE's element */
-+	asn_per_constraint_t *ct;
-+	void *memb_ptr;
-+	int present;
-+
-+	if(!sptr) _ASN_ENCODE_FAILED;
-+
-+	ASN_DEBUG("Encoding %s as CHOICE using ALIGNED PER", td->name);
-+
-+	if(constraints) ct = &constraints->value;
-+	else if(td->per_constraints) ct = &td->per_constraints->value;
-+	else ct = 0;
-+	
-+	present = _fetch_present_idx(sptr,
-+								 specs->pres_offset, specs->pres_size);
-+
-+	/*
-+	 * If the structure was not initialized properly, it cannot be encoded:
-+	 * can't deduce what to encode in the choice type.
-+	 */
-+	if(present <= 0 || present > td->elements_count)
-+		_ASN_ENCODE_FAILED;
-+	else
-+		present--;
-+
-+	/* Adjust if canonical order is different from natural order */
-+	if(specs->canonical_order)
-+		present = specs->canonical_order[present];
-+
-+	ASN_DEBUG("Encoding %s CHOICE element %d", td->name, present);
-+
-+	if(ct && ct->range_bits >= 0) {
-+		if(present < ct->lower_bound
-+			|| present > ct->upper_bound) {
-+			if(ct->flags & APC_EXTENSIBLE) {
-+				if(per_put_few_bits(po, 1, 1))
-+					_ASN_ENCODE_FAILED;
-+			} else {
-+				_ASN_ENCODE_FAILED;
-+			}
-+			ct = 0;
-+			}
-+	}
-+	if(ct && ct->flags & APC_EXTENSIBLE) {
-+		if(per_put_few_bits(po, 0, 1))
-+			_ASN_ENCODE_FAILED;
-+	}
-+
-+	elm = &td->elements[present];
-+	if(elm->flags & ATF_POINTER) {
-+		/* Member is a pointer to another structure */
-+		memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
-+		if(!memb_ptr) _ASN_ENCODE_FAILED;
-+	} else {
-+		memb_ptr = (char *)sptr + elm->memb_offset;
-+	}
-+
-+	if(ct && ct->range_bits >= 0) {
-+		if(per_put_few_bits(po, present, ct->range_bits))
-+			_ASN_ENCODE_FAILED;
-+
-+			return elm->type->aper_encoder(elm->type, elm->per_constraints,
-+										   memb_ptr, po);
-+	} else {
-+		asn_enc_rval_t rval;
-+		if(specs->ext_start == -1)
-+			_ASN_ENCODE_FAILED;
-+        if(aper_put_nsnnwn(po, ct->range_bits, present - specs->ext_start))
-+			_ASN_ENCODE_FAILED;
-+		if(aper_open_type_put(elm->type, elm->per_constraints,
-+			memb_ptr, po))
-+			_ASN_ENCODE_FAILED;
-+		rval.encoded = 0;
-+		_ASN_ENCODED_OK(rval);
-+	}
-+}
-+
- int
- CHOICE_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
- 		asn_app_consume_bytes_f *cb, void *app_key) {
-@@ -1010,10 +1171,10 @@
- 		const void *memb_ptr;
- 
- 		if(elm->flags & ATF_POINTER) {
--			memb_ptr = *(const void * const *)((const void *)sptr + elm->memb_offset);
-+			memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset);
- 			if(!memb_ptr) return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
- 		} else {
--			memb_ptr = (const void *)((const void *)sptr + elm->memb_offset);
-+			memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
- 		}
- 
- 		/* Print member's name and stuff */
-@@ -1053,11 +1214,11 @@
- 		void *memb_ptr;
- 
- 		if(elm->flags & ATF_POINTER) {
--			memb_ptr = *(void **)((void *)ptr + elm->memb_offset);
-+			memb_ptr = *(void **)((char *)ptr + elm->memb_offset);
- 			if(memb_ptr)
- 				ASN_STRUCT_FREE(*elm->type, memb_ptr);
- 		} else {
--			memb_ptr = (void *)((void *)ptr + elm->memb_offset);
-+			memb_ptr = (void *)((char *)ptr + elm->memb_offset);
- 			ASN_STRUCT_FREE_CONTENTS_ONLY(*elm->type, memb_ptr);
- 		}
- 	}
-@@ -1082,7 +1243,7 @@
- 	const void *present_ptr;
- 	int present;
- 
--	present_ptr = ((const void *)struct_ptr) + pres_offset;
-+	present_ptr = ((const char *)struct_ptr) + pres_offset;
- 
- 	switch(pres_size) {
- 	case sizeof(int):	present =   *(const int *)present_ptr; break;
-@@ -1100,7 +1261,7 @@
- static void
- _set_present_idx(void *struct_ptr, int pres_offset, int pres_size, int present) {
- 	void *present_ptr;
--	present_ptr = ((void *)struct_ptr) + pres_offset;
-+	present_ptr = ((char *)struct_ptr) + pres_offset;
- 
- 	switch(pres_size) {
- 	case sizeof(int):	*(int *)present_ptr   = present; break;
-Index: skeletons/asn_internal.h
-===================================================================
---- skeletons/asn_internal.h	(revision 1516)
-+++ skeletons/asn_internal.h	(working copy)
-@@ -20,7 +20,7 @@
- #endif
- 
- /* Environment version might be used to avoid running with the old library */
--#define	ASN1C_ENVIRONMENT_VERSION	923	/* Compile-time version */
-+#define	ASN1C_ENVIRONMENT_VERSION	924	/* Compile-time version */
- int get_asn1c_environment_version(void);	/* Run-time version */
- 
- #define	CALLOC(nmemb, size)	calloc(nmemb, size)
-@@ -48,18 +48,22 @@
- #define ASN_DEBUG_INDENT_ADD(i) do { asn_debug_indent += i; } while(0)
- #endif	/* ASN_THREAD_SAFE */
- #define	ASN_DEBUG(fmt, args...)	do {			\
--		int adi = asn_debug_indent;		\
--		while(adi--) fprintf(stderr, " ");	\
--		fprintf(stderr, fmt, ##args);		\
--		fprintf(stderr, " (%s:%d)\n",		\
--			__FILE__, __LINE__);		\
--	} while(0)
-+	int adi = asn_debug_indent;			\
-+	while(adi--) fprintf(stderr, " ");	\
-+	fprintf(stderr, fmt, ##args);		\
-+	fprintf(stderr, " (%s:%d)\n",		\
-+		__FILE__, __LINE__);				\
-+} while(0)
- #else	/* !__GNUC__ */
- void ASN_DEBUG_f(const char *fmt, ...);
- #define	ASN_DEBUG	ASN_DEBUG_f
- #endif	/* __GNUC__ */
- #else	/* EMIT_ASN_DEBUG != 1 */
-+# ifdef EMIT_ASN_DEBUG_EXTERN
-+extern inline void ASN_DEBUG(const char *fmt, ...);
-+# else
- static inline void ASN_DEBUG(const char *fmt, ...) { (void)fmt; }
-+# endif
- #endif	/* EMIT_ASN_DEBUG */
- #endif	/* ASN_DEBUG */
- 
-Index: skeletons/BOOLEAN.h
-===================================================================
---- skeletons/BOOLEAN.h	(revision 1516)
-+++ skeletons/BOOLEAN.h	(working copy)
-@@ -28,6 +28,8 @@
- xer_type_encoder_f BOOLEAN_encode_xer;
- per_type_decoder_f BOOLEAN_decode_uper;
- per_type_encoder_f BOOLEAN_encode_uper;
-+per_type_decoder_f BOOLEAN_decode_aper;
-+per_type_encoder_f BOOLEAN_encode_aper;
- 
- #ifdef __cplusplus
- }
-Index: skeletons/constr_CHOICE.h
-===================================================================
---- skeletons/constr_CHOICE.h	(revision 1516)
-+++ skeletons/constr_CHOICE.h	(working copy)
-@@ -48,6 +48,8 @@
- xer_type_encoder_f CHOICE_encode_xer;
- per_type_decoder_f CHOICE_decode_uper;
- per_type_encoder_f CHOICE_encode_uper;
-+per_type_decoder_f CHOICE_decode_aper;
-+per_type_encoder_f CHOICE_encode_aper;
- asn_outmost_tag_f CHOICE_outmost_tag;
- 
- #ifdef __cplusplus
-Index: skeletons/INTEGER.c
-===================================================================
---- skeletons/INTEGER.c	(revision 1516)
-+++ skeletons/INTEGER.c	(working copy)
-@@ -27,9 +27,13 @@
- #ifdef	ASN_DISABLE_PER_SUPPORT
- 	0,
- 	0,
-+	0,
-+	0,
- #else
- 	INTEGER_decode_uper,	/* Unaligned PER decoder */
- 	INTEGER_encode_uper,	/* Unaligned PER encoder */
-+	INTEGER_decode_aper,
-+	INTEGER_encode_aper,
- #endif	/* ASN_DISABLE_PER_SUPPORT */
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_INTEGER_tags,
-@@ -612,7 +616,7 @@
- 				value = per_get_few_bits(pd, ct->range_bits);
- 				if(value < 0) _ASN_DECODE_STARVED;
- 			}
--			ASN_DEBUG("Got value %ld + low %ld",
-+			ASN_DEBUG("Got value %ld + low %"PRIdMAX,
- 				value, ct->lower_bound);
- 			value += ct->lower_bound;
- 			if((specs && specs->field_unsigned)
-@@ -660,6 +664,158 @@
- 	return rval;
- }
- 
-+asn_dec_rval_t
-+INTEGER_decode_aper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
-+	asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
-+	asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics;
-+	asn_dec_rval_t rval = { RC_OK, 0 };
-+	INTEGER_t *st = (INTEGER_t *)*sptr;
-+	asn_per_constraint_t *ct;
-+	int repeat;
-+
-+	(void)opt_codec_ctx;
-+
-+	if(!st) {
-+		st = (INTEGER_t *)(*sptr = CALLOC(1, sizeof(*st)));
-+		if(!st) _ASN_DECODE_FAILED;
-+	}
-+
-+	if(!constraints) constraints = td->per_constraints;
-+	ct = constraints ? &constraints->value : 0;
-+
-+	if(ct && ct->flags & APC_EXTENSIBLE) {
-+		int inext = per_get_few_bits(pd, 1);
-+		if(inext < 0) _ASN_DECODE_STARVED;
-+		if(inext) ct = 0;
-+	}
-+
-+	FREEMEM(st->buf);
-+	st->buf = 0;
-+	st->size = 0;
-+	if(ct) {
-+		if(ct->flags & APC_SEMI_CONSTRAINED) {
-+			st->buf = (uint8_t *)CALLOC(1, 2);
-+			if(!st->buf) _ASN_DECODE_FAILED;
-+			st->size = 1;
-+		} else if(ct->flags & APC_CONSTRAINED && ct->range_bits >= 0) {
-+			size_t size = (ct->range_bits + 7) >> 3;
-+			st->buf = (uint8_t *)MALLOC(1 + size + 1);
-+			if(!st->buf) _ASN_DECODE_FAILED;
-+			st->size = size;
-+		}
-+	}
-+
-+	/* X.691, #12.2.2 */
-+	if(ct && ct->flags != APC_UNCONSTRAINED) {
-+		/* #10.5.6 */
-+		ASN_DEBUG("Integer with range %d bits", ct->range_bits);
-+		if(ct->range_bits >= 0) {
-+			if (ct->range_bits > 16) {
-+				int max_range_bytes = (ct->range_bits >> 3) +
-+					(((ct->range_bits % 8) > 0) ? 1 : 0);
-+				int length = 0, i;
-+				int64_t value = 0;
-+
-+				for (i = 1; ; i++) {
-+					int upper = 1 << i;
-+					if (upper >= max_range_bytes)
-+						break;
-+				}
-+				ASN_DEBUG("Can encode %d (%d bytes) in %d bits", ct->range_bits,
-+						  max_range_bytes, i);
-+
-+				if ((length = per_get_few_bits(pd, i)) < 0)
-+					_ASN_DECODE_FAILED;
-+
-+				/* X.691 #12.2.6 length determinant + lb (1) */
-+				length += 1;
-+				ASN_DEBUG("Got length %d", length);
-+
-+				if (aper_get_align(pd) != 0)
-+					_ASN_DECODE_STARVED;
-+
-+				while (length--) {
-+					int buf = per_get_few_bits(pd, 8);
-+					if (buf < 0)
-+						_ASN_DECODE_STARVED;
-+					value += (((int64_t)buf) << (8 * length));
-+				}
-+
-+				value += ct->lower_bound;
-+				if((specs && specs->field_unsigned)
-+					? asn_uint642INTEGER(st, value)
-+					: asn_int642INTEGER(st, value))
-+					_ASN_DECODE_FAILED;
-+				ASN_DEBUG("Got value %lld + low %lld",
-+						  value, ct->lower_bound);
-+			} else {
-+				long value = 0;
-+				if (ct->range_bits < 8) {
-+					value = per_get_few_bits(pd, ct->range_bits);
-+					if(value < 0) _ASN_DECODE_STARVED;
-+				} else if (ct->range_bits == 8) {
-+					if (aper_get_align(pd) < 0)
-+						_ASN_DECODE_FAILED;
-+					value = per_get_few_bits(pd, ct->range_bits);
-+					if(value < 0) _ASN_DECODE_STARVED;
-+				} else {
-+					/* Align */
-+					if (aper_get_align(pd) < 0)
-+						_ASN_DECODE_FAILED;
-+					value = per_get_few_bits(pd, 16);
-+					if(value < 0) _ASN_DECODE_STARVED;
-+				}
-+				value += ct->lower_bound;
-+				if((specs && specs->field_unsigned)
-+					? asn_ulong2INTEGER(st, value)
-+					: asn_long2INTEGER(st, value))
-+					_ASN_DECODE_FAILED;
-+					ASN_DEBUG("Got value %ld + low %lld",
-+							  value, ct->lower_bound);
-+			}
-+			return rval;
-+		} else {
-+			_ASN_DECODE_FAILED;
-+		}
-+	} else {
-+		ASN_DEBUG("Decoding unconstrained integer %s", td->name);
-+	}
-+
-+	/* X.691, #12.2.3, #12.2.4 */
-+	do {
-+		ssize_t len;
-+		void *p;
-+		int ret;
-+
-+		/* Get the PER length */
-+		len = aper_get_length(pd, -1, -1, &repeat);
-+		if(len < 0) _ASN_DECODE_STARVED;
-+
-+		p = REALLOC(st->buf, st->size + len + 1);
-+		if(!p) _ASN_DECODE_FAILED;
-+		st->buf = (uint8_t *)p;
-+
-+		ret = per_get_many_bits(pd, &st->buf[st->size], 0, 8 * len);
-+		if(ret < 0) _ASN_DECODE_STARVED;
-+		st->size += len;
-+	} while(repeat);
-+	st->buf[st->size] = 0;	/* JIC */
-+
-+	/* #12.2.3 */
-+	if(ct && ct->lower_bound) {
-+		/*
-+		 * TODO: replace by in-place arithmetics.
-+		 */
-+		long value;
-+		if(asn_INTEGER2long(st, &value))
-+			_ASN_DECODE_FAILED;
-+		if(asn_long2INTEGER(st, value + ct->lower_bound))
-+			_ASN_DECODE_FAILED;
-+	}
-+
-+	return rval;
-+}
-+
- asn_enc_rval_t
- INTEGER_encode_uper(asn_TYPE_descriptor_t *td,
- 	asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-@@ -693,7 +849,7 @@
- 				|| uval > (unsigned long)ct->upper_bound)
- 					inext = 1;
- 			}
--			ASN_DEBUG("Value %lu (%02x/%d) lb %lu ub %lu %s",
-+			ASN_DEBUG("Value %lu (%02x/%d) lb %"PRIuMAX" ub %"PRIuMAX" %s",
- 				uval, st->buf[0], st->size,
- 				ct->lower_bound, ct->upper_bound,
- 				inext ? "ext" : "fix");
-@@ -710,7 +866,7 @@
- 				|| value > ct->upper_bound)
- 					inext = 1;
- 			}
--			ASN_DEBUG("Value %ld (%02x/%d) lb %ld ub %ld %s",
-+			ASN_DEBUG("Value %ld (%02x/%d) lb %"PRIdMAX" ub %"PRIdMAX" %s",
- 				value, st->buf[0], st->size,
- 				ct->lower_bound, ct->upper_bound,
- 				inext ? "ext" : "fix");
-@@ -745,7 +901,7 @@
- 	}
- 
- 	if(ct && ct->lower_bound) {
--		ASN_DEBUG("Adjust lower bound to %ld", ct->lower_bound);
-+		ASN_DEBUG("Adjust lower bound to %"PRIdMAX"\n", ct->lower_bound);
- 		/* TODO: adjust lower bound */
- 		_ASN_ENCODE_FAILED;
- 	}
-@@ -762,6 +918,153 @@
- 	_ASN_ENCODED_OK(er);
- }
- 
-+asn_enc_rval_t
-+INTEGER_encode_aper(asn_TYPE_descriptor_t *td,
-+	asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-+	asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics;
-+	asn_enc_rval_t er;
-+	INTEGER_t *st = (INTEGER_t *)sptr;
-+	const uint8_t *buf;
-+	const uint8_t *end;
-+	asn_per_constraint_t *ct;
-+	int64_t value = 0;
-+
-+	if(!st || st->size == 0) _ASN_ENCODE_FAILED;
-+
-+	if(!constraints) constraints = td->per_constraints;
-+	ct = constraints ? &constraints->value : 0;
-+
-+	er.encoded = 0;
-+
-+	if(ct) {
-+		int inext = 0;
-+		if(specs && specs->field_unsigned) {
-+			uint64_t uval;
-+			if(asn_INTEGER2uint64(st, &uval))
-+				_ASN_ENCODE_FAILED;
-+			/* Check proper range */
-+			if(ct->flags & APC_SEMI_CONSTRAINED) {
-+				if(uval < ct->lower_bound)
-+					inext = 1;
-+			} else if(ct->range_bits >= 0) {
-+				if(uval < ct->lower_bound
-+					|| uval > ct->upper_bound)
-+					inext = 1;
-+			}
-+			ASN_DEBUG("Value %llu (%02x/%d) lb %llu ub %llu %s",
-+								uval, st->buf[0], st->size,
-+								ct->lower_bound, ct->upper_bound,
-+								inext ? "ext" : "fix");
-+						value = uval;
-+		} else {
-+			if(asn_INTEGER2int64(st, &value)) _ASN_ENCODE_FAILED;
-+			/* Check proper range */
-+			if(ct->flags & APC_SEMI_CONSTRAINED) {
-+				if(value < ct->lower_bound)
-+					inext = 1;
-+			} else if(ct->range_bits >= 0) {
-+				if(value < ct->lower_bound
-+					|| value > ct->upper_bound)
-+					inext = 1;
-+			}
-+			ASN_DEBUG("Value %lld (%02x/%d) lb %lld ub %lld %s",
-+					  value, st->buf[0], st->size,
-+					  ct->lower_bound, ct->upper_bound,
-+					  inext ? "ext" : "fix");
-+		}
-+		if(ct->flags & APC_EXTENSIBLE) {
-+			if(per_put_few_bits(po, inext, 1))
-+				_ASN_ENCODE_FAILED;
-+			if(inext) ct = 0;
-+		} else if(inext) {
-+			_ASN_ENCODE_FAILED;
-+		}
-+	}
-+
-+	/* X.691, #12.2.2 */
-+	if(ct && ct->range_bits >= 0) {
-+		/* #10.5.6 */
-+		ASN_DEBUG("Encoding integer with range %d bits",
-+				  ct->range_bits);
-+		
-+		value -= ct->lower_bound;
-+		
-+		/* #12 <= 8 -> alignment ? */
-+		if (ct->range_bits < 8) {
-+			/* Bit field case -> no alignment*/
-+			if(per_put_few_bits(po, 0x00 | value, ct->range_bits))
-+				_ASN_ENCODE_FAILED;
-+		} else if (ct->range_bits == 8) {
-+			if(aper_put_align(po) < 0)
-+				_ASN_ENCODE_FAILED;
-+			if(per_put_few_bits(po, 0x00 | value, ct->range_bits))
-+				_ASN_ENCODE_FAILED;
-+		} else if (ct->range_bits <= 16) {
-+			// Consume the bytes to align on octet
-+			if(aper_put_align(po) < 0)
-+				_ASN_ENCODE_FAILED;
-+			if(per_put_few_bits(po, 0x0000 | value,
-+				16))
-+				_ASN_ENCODE_FAILED;
-+		} else {
-+			/* TODO: extend to >64 bits */
-+			int64_t v = value;
-+			int i, j;
-+			int max_range_bytes = (ct->range_bits >> 3) +
-+			(((ct->range_bits % 8) > 0) ? 1 : 0);
-+
-+			for (i = 1; ; i++) {
-+				int upper = 1 << i;
-+				if (upper >= max_range_bytes)
-+					break;
-+			}
-+
-+			for(j = sizeof(int64_t) - 1; j != 0; j--) {
-+				uint8_t val;
-+				val = v >> (j * 8);
-+				if (val != 0) {
-+					break;
-+				}
-+			}
-+
-+			ASN_DEBUG("Putting n - lb (%"PRIdMAX") with range %d bytes (real size - lb (1)) %d in %d bits",
-+					  v, max_range_bytes, j, i);
-+
-+			/* Putting length in the minimum number of bits ex: 5 = 3bits */
-+			if (per_put_few_bits(po, j, i))
-+				_ASN_ENCODE_FAILED;
-+
-+			// Consume the bits to align on octet
-+			if (aper_put_align(po) < 0)
-+				_ASN_ENCODE_FAILED;
-+
-+			/* Put the value */
-+			for (i = 0; i <= j; i++) {
-+				if(per_put_few_bits(po, (v >> (8 * (j - i))) & 0xff, 8))
-+					_ASN_ENCODE_FAILED;
-+			}
-+		}
-+		_ASN_ENCODED_OK(er);
-+	}
-+
-+	if(ct && ct->lower_bound) {
-+		ASN_DEBUG("Adjust lower bound to %"PRIdMAX, ct->lower_bound);
-+		/* TODO: adjust lower bound */
-+		_ASN_ENCODE_FAILED;
-+	}
-+
-+	for(buf = st->buf, end = st->buf + st->size; buf < end;) {
-+		ssize_t mayEncode = aper_put_length(po, -1, end - buf);
-+		if(mayEncode < 0)
-+			_ASN_ENCODE_FAILED;
-+		if(per_put_many_bits(po, buf, 8 * mayEncode))
-+			_ASN_ENCODE_FAILED;
-+		buf += mayEncode;
-+	}
-+	
-+	_ASN_ENCODED_OK(er);
-+}
-+
- #endif	/* ASN_DISABLE_PER_SUPPORT */
- 
- int
-@@ -825,6 +1128,66 @@
- }
- 
- int
-+asn_INTEGER2int64(const INTEGER_t *iptr, int64_t *lptr) {
-+	uint8_t *b, *end;
-+	size_t size;
-+	int64_t l;
-+	
-+	/* Sanity checking */
-+	if(!iptr || !iptr->buf || !lptr) {
-+		errno = EINVAL;
-+		return -1;
-+	}
-+	
-+	/* Cache the begin/end of the buffer */
-+	b = iptr->buf;	/* Start of the INTEGER buffer */
-+	size = iptr->size;
-+	end = b + size;	/* Where to stop */
-+	
-+	if(size > sizeof(int64_t)) {
-+		uint8_t *end1 = end - 1;
-+		/*
-+		 * Slightly more advanced processing,
-+		 * able to >sizeof(int64_t) bytes,
-+		 * when the actual value is small
-+		 * (0x0000000000abcdef would yield a fine 0x00abcdef)
-+		 */
-+		/* Skip out the insignificant leading bytes */
-+		for(; b < end1; b++) {
-+			switch(*b) {
-+				case 0x00: if((b[1] & 0x80) == 0) continue; break;
-+				case 0xff: if((b[1] & 0x80) != 0) continue; break;
-+			}
-+			break;
-+		}
-+		
-+		size = end - b;
-+		if(size > sizeof(int64_t)) {
-+			/* Still cannot fit the int64_t */
-+			errno = ERANGE;
-+			return -1;
-+		}
-+	}
-+
-+	/* Shortcut processing of a corner case */
-+	if(end == b) {
-+		*lptr = 0;
-+		return 0;
-+	}
-+
-+	/* Perform the sign initialization */
-+	/* Actually l = -(*b >> 7); gains nothing, yet unreadable! */
-+	if((*b >> 7)) l = -1; else l = 0;
-+
-+	/* Conversion engine */
-+	for(; b < end; b++)
-+		l = (l << 8) | *b;
-+
-+	*lptr = l;
-+	return 0;
-+}
-+
-+int
- asn_INTEGER2ulong(const INTEGER_t *iptr, unsigned long *lptr) {
- 	uint8_t *b, *end;
- 	unsigned long l;
-@@ -857,6 +1220,38 @@
- }
- 
- int
-+asn_INTEGER2uint64(const INTEGER_t *iptr, uint64_t *lptr) {
-+	uint8_t *b, *end;
-+	uint64_t l;
-+	size_t size;
-+	
-+	if(!iptr || !iptr->buf || !lptr) {
-+		errno = EINVAL;
-+		return -1;
-+	}
-+	
-+	b = iptr->buf;
-+	size = iptr->size;
-+	end = b + size;
-+	
-+	/* If all extra leading bytes are zeroes, ignore them */
-+	for(; size > sizeof(uint64_t); b++, size--) {
-+		if(*b) {
-+			/* Value won't fit unsigned long */
-+			errno = ERANGE;
-+			return -1;
-+		}
-+	}
-+	
-+	/* Conversion engine */
-+	for(l = 0; b < end; b++)
-+		l = (l << 8) | *b;
-+	
-+	*lptr = l;
-+	return 0;
-+}
-+
-+int
- asn_ulong2INTEGER(INTEGER_t *st, unsigned long value) {
- 	uint8_t *buf;
- 	uint8_t *end;
-@@ -871,7 +1266,7 @@
- 
- 	end = buf + (sizeof(value) + 1);
- 	buf[0] = 0;
--	for(b = buf + 1, shr = (sizeof(long)-1)*8; b < end; shr -= 8, b++)
-+	for(b = buf + 1, shr = (sizeof(unsigned long)-1)*8; b < end; shr -= 8, b++)
- 		*b = (uint8_t)(value >> shr);
- 
- 	if(st->buf) FREEMEM(st->buf);
-@@ -882,6 +1277,31 @@
- }
- 
- int
-+asn_uint642INTEGER(INTEGER_t *st, uint64_t value) {
-+	uint8_t *buf;
-+	uint8_t *end;
-+	uint8_t *b;
-+	int shr;
-+	
-+	if(value <= INT64_MAX)
-+		return asn_int642INTEGER(st, value);
-+	
-+	buf = (uint8_t *)MALLOC(1 + sizeof(value));
-+	if(!buf) return -1;
-+	
-+	end = buf + (sizeof(value) + 1);
-+	buf[0] = 0;
-+	for(b = buf + 1, shr = (sizeof(value)-1)*8; b < end; shr -= 8, b++)
-+		*b = (uint8_t)(value >> shr);
-+	
-+	if(st->buf) FREEMEM(st->buf);
-+	st->buf = buf;
-+	st->size = 1 + sizeof(value);
-+	
-+	return 0;
-+}
-+
-+int
- asn_long2INTEGER(INTEGER_t *st, long value) {
- 	uint8_t *buf, *bp;
- 	uint8_t *p;
-@@ -1024,3 +1444,60 @@
- 	return ASN_STRTOL_OK;
- }
- 
-+
-+int
-+asn_int642INTEGER(INTEGER_t *st, int64_t value) {
-+	uint8_t *buf, *bp;
-+	uint8_t *p;
-+	uint8_t *pstart;
-+	uint8_t *pend1;
-+	int littleEndian = 1;	/* Run-time detection */
-+	int add;
-+
-+	if(!st) {
-+		errno = EINVAL;
-+		return -1;
-+	}
-+
-+	buf = (uint8_t *)MALLOC(sizeof(value));
-+	if(!buf) return -1;
-+
-+	if(*(char *)&littleEndian) {
-+		pstart = (uint8_t *)&value + sizeof(value) - 1;
-+		pend1 = (uint8_t *)&value;
-+		add = -1;
-+	} else {
-+		pstart = (uint8_t *)&value;
-+		pend1 = pstart + sizeof(value) - 1;
-+		add = 1;
-+	}
-+
-+	/*
-+	 * If the contents octet consists of more than one octet,
-+	 * then bits of the first octet and bit 8 of the second octet:
-+	 * a) shall not all be ones; and
-+	 * b) shall not all be zero.
-+	 */
-+	for(p = pstart; p != pend1; p += add) {
-+		switch(*p) {
-+		case 0x00: if((*(p+add) & 0x80) == 0)
-+				continue;
-+			break;
-+		case 0xff: if((*(p+add) & 0x80))
-+				continue;
-+			break;
-+		}
-+		break;
-+	}
-+	/* Copy the integer body */
-+	for(pstart = p, bp = buf, pend1 += add; p != pend1; p += add)
-+		*bp++ = *p;
-+
-+	if(st->buf) FREEMEM(st->buf);
-+	st->buf = buf;
-+	st->size = bp - buf;
-+
-+	return 0;
-+}
-+
-+
-Index: skeletons/constr_SEQUENCE.c
-===================================================================
---- skeletons/constr_SEQUENCE.c	(revision 1516)
-+++ skeletons/constr_SEQUENCE.c	(working copy)
-@@ -34,7 +34,7 @@
- #undef	ADVANCE
- #define	ADVANCE(num_bytes)	do {		\
- 		size_t num = num_bytes;		\
--		ptr = ((const void *)ptr) + num;\
-+		ptr = ((const char *)ptr) + num;\
- 		size -= num;			\
- 		if(ctx->left >= 0)		\
- 			ctx->left -= num;	\
-@@ -144,7 +144,7 @@
- 	/*
- 	 * Restore parsing context.
- 	 */
--	ctx = (asn_struct_ctx_t *)((void *)st + specs->ctx_offset);
-+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
- 	
- 	/*
- 	 * Start to parse where left previously
-@@ -366,7 +366,7 @@
- 					ber_tlv_tag_string(tlv_tag), edx);
- 				skip = ber_skip_length(opt_codec_ctx,
- 					BER_TLV_CONSTRUCTED(ptr),
--					(const void *)ptr + tag_len,
-+					(const char *)ptr + tag_len,
- 					LEFT - tag_len);
- 				ASN_DEBUG("Skip length %d in %s",
- 					(int)skip, td->name);
-@@ -397,13 +397,13 @@
- 		 */
- 		if(elements[edx].flags & ATF_POINTER) {
- 			/* Member is a pointer to another structure */
--			memb_ptr2 = (void **)((void *)st + elements[edx].memb_offset);
-+			memb_ptr2 = (void **)((char *)st + elements[edx].memb_offset);
- 		} else {
- 			/*
- 			 * A pointer to a pointer
- 			 * holding the start of the structure
- 			 */
--			memb_ptr = (void *)st + elements[edx].memb_offset;
-+			memb_ptr = (char *)st + elements[edx].memb_offset;
- 			memb_ptr2 = &memb_ptr;
- 		}
- 		/*
-@@ -489,7 +489,7 @@
- 
- 			ll = ber_skip_length(opt_codec_ctx,
- 				BER_TLV_CONSTRUCTED(ptr),
--				(const void *)ptr + tl, LEFT - tl);
-+				(const char *)ptr + tl, LEFT - tl);
- 			switch(ll) {
- 			case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
- 				/* Fall through */
-@@ -528,14 +528,14 @@
- 		asn_TYPE_member_t *elm = &td->elements[edx];
- 		void *memb_ptr;
- 		if(elm->flags & ATF_POINTER) {
--			memb_ptr = *(void **)((void *)sptr + elm->memb_offset);
-+			memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
- 			if(!memb_ptr) {
- 				if(elm->optional) continue;
- 				/* Mandatory element is missing */
- 				_ASN_ENCODE_FAILED;
- 			}
- 		} else {
--			memb_ptr = (void *)((void *)sptr + elm->memb_offset);
-+			memb_ptr = (void *)((char *)sptr + elm->memb_offset);
- 		}
- 		erval = elm->type->der_encoder(elm->type, memb_ptr,
- 			elm->tag_mode, elm->tag,
-@@ -567,10 +567,10 @@
- 		void *memb_ptr;
- 
- 		if(elm->flags & ATF_POINTER) {
--			memb_ptr = *(void **)((void *)sptr + elm->memb_offset);
-+			memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
- 			if(!memb_ptr) continue;
- 		} else {
--			memb_ptr = (void *)((void *)sptr + elm->memb_offset);
-+			memb_ptr = (void *)((char *)sptr + elm->memb_offset);
- 		}
- 		tmperval = elm->type->der_encoder(elm->type, memb_ptr,
- 			elm->tag_mode, elm->tag,
-@@ -595,7 +595,7 @@
- #undef	XER_ADVANCE
- #define	XER_ADVANCE(num_bytes)	do {			\
- 		size_t num = num_bytes;			\
--		buf_ptr = ((const void *)buf_ptr) + num;\
-+		buf_ptr = ((const char *)buf_ptr) + num;\
- 		size -= num;				\
- 		consumed_myself += num;			\
- 	} while(0)
-@@ -637,7 +637,7 @@
- 	/*
- 	 * Restore parsing context.
- 	 */
--	ctx = (asn_struct_ctx_t *)((void *)st + specs->ctx_offset);
-+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
- 
- 
- 	/*
-@@ -667,9 +667,10 @@
- 
- 			if(elm->flags & ATF_POINTER) {
- 				/* Member is a pointer to another structure */
--				memb_ptr2 = (void **)((void *)st + elm->memb_offset);
-+				memb_ptr2 = (void **)((char *)st
-+					+ elm->memb_offset);
- 			} else {
--				memb_ptr = (void *)st + elm->memb_offset;
-+				memb_ptr = (char *)st + elm->memb_offset;
- 				memb_ptr2 = &memb_ptr;
- 			}
- 
-@@ -739,7 +740,7 @@
- 				if(edx >= td->elements_count
- 				   ||
- 				   /* Explicit OPTIONAL specs reaches the end */
--				    (edx + elements[edx].optional
-+					(edx + elements[edx].optional
- 					== td->elements_count)
- 				   ||
- 				   /* All extensions are optional */
-@@ -869,7 +870,7 @@
- 		unsigned int mlen = strlen(mname);
- 
- 		if(elm->flags & ATF_POINTER) {
--			memb_ptr = *(void **)((void *)sptr + elm->memb_offset);
-+			memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
- 			if(!memb_ptr) {
- 				if(elm->optional)
- 					continue;
-@@ -877,7 +878,7 @@
- 				_ASN_ENCODE_FAILED;
- 			}
- 		} else {
--			memb_ptr = (void *)((void *)sptr + elm->memb_offset);
-+			memb_ptr = (void *)((char *)sptr + elm->memb_offset);
- 		}
- 
- 		if(!xcan) _i_ASN_TEXT_INDENT(1, ilevel);
-@@ -917,14 +918,14 @@
- 		const void *memb_ptr;
- 
- 		if(elm->flags & ATF_POINTER) {
--			memb_ptr = *(const void * const *)((const void *)sptr + elm->memb_offset);
-+			memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset);
- 			if(!memb_ptr) {
- 				if(elm->optional) continue;
- 				/* Print <absent> line */
- 				/* Fall through */
- 			}
- 		} else {
--			memb_ptr = (const void *)((const void *)sptr + elm->memb_offset);
-+			memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
- 		}
- 
- 		/* Indentation */
-@@ -960,11 +961,11 @@
- 		asn_TYPE_member_t *elm = &td->elements[edx];
- 		void *memb_ptr;
- 		if(elm->flags & ATF_POINTER) {
--			memb_ptr = *(void **)((void *)sptr + elm->memb_offset);
-+			memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
- 			if(memb_ptr)
- 				ASN_STRUCT_FREE(*elm->type, memb_ptr);
- 		} else {
--			memb_ptr = (void *)((void *)sptr + elm->memb_offset);
-+			memb_ptr = (void *)((char *)sptr + elm->memb_offset);
- 			ASN_STRUCT_FREE_CONTENTS_ONLY(*elm->type, memb_ptr);
- 		}
- 	}
-@@ -994,7 +995,7 @@
- 		const void *memb_ptr;
- 
- 		if(elm->flags & ATF_POINTER) {
--			memb_ptr = *(const void * const *)((const void *)sptr + elm->memb_offset);
-+			memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset);
- 			if(!memb_ptr) {
- 				if(elm->optional)
- 					continue;
-@@ -1004,7 +1005,7 @@
- 				return -1;
- 			}
- 		} else {
--			memb_ptr = (const void *)((const void *)sptr + elm->memb_offset);
-+			memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
- 		}
- 
- 		if(elm->memb_constraints) {
-@@ -1088,9 +1089,9 @@
- 
- 		/* Fetch the pointer to this member */
- 		if(elm->flags & ATF_POINTER) {
--			memb_ptr2 = (void **)((void *)st + elm->memb_offset);
-+			memb_ptr2 = (void **)((char *)st + elm->memb_offset);
- 		} else {
--			memb_ptr = (void *)st + elm->memb_offset;
-+			memb_ptr = (char *)st + elm->memb_offset;
- 			memb_ptr2 = &memb_ptr;
- 		}
- 
-@@ -1154,11 +1155,224 @@
- 		memset(&epmd, 0, sizeof(epmd));
- 		epmd.buffer = epres;
- 		epmd.nbits = bmlength;
-+		ASN_DEBUG("Read in extensions bitmap for %s of %d bits (%x..)",
-+			td->name, bmlength, *epres);
-+
-+		/* Go over extensions and read them in */
-+		for(edx = specs->ext_after + 1; edx < td->elements_count; edx++) {
-+		asn_TYPE_member_t *elm = &td->elements[edx];
-+		void *memb_ptr;		/* Pointer to the member */
-+		void **memb_ptr2;	/* Pointer to that pointer */
-+		int present;
-+
-+		if(!IN_EXTENSION_GROUP(specs, edx)) {
-+			ASN_DEBUG("%d is not extension", edx);
-+			continue;
-+		}
-+
-+		/* Fetch the pointer to this member */
-+		if(elm->flags & ATF_POINTER) {
-+			memb_ptr2 = (void **)((char *)st + elm->memb_offset);
-+		} else {
-+			memb_ptr = (void *)((char *)st + elm->memb_offset);
-+			memb_ptr2 = &memb_ptr;
-+		}
-+
-+		present = per_get_few_bits(&epmd, 1);
-+		if(present <= 0) {
-+			if(present < 0) break;	/* No more extensions */
-+			continue;
-+		}
-+
-+		ASN_DEBUG("Decoding member %s in %s %p", elm->name, td->name, *memb_ptr2);
-+		rv = uper_open_type_get(opt_codec_ctx, elm->type,
-+			elm->per_constraints, memb_ptr2, pd);
-+		if(rv.code != RC_OK) {
-+			FREEMEM(epres);
-+			return rv;
-+		}
-+		}
-+
-+		/* Skip over overflow extensions which aren't present
-+		 * in this system's version of the protocol */
-+		for(;;) {
-+			ASN_DEBUG("Getting overflow extensions");
-+			switch(per_get_few_bits(&epmd, 1)) {
-+			case -1: break;
-+			case 0: continue;
-+			default:
-+				if(uper_open_type_skip(opt_codec_ctx, pd)) {
-+					FREEMEM(epres);
-+					_ASN_DECODE_STARVED;
-+				}
-+			}
-+			break;
-+		}
-+
-+		FREEMEM(epres);
-+	}
-+
-+	/* Fill DEFAULT members in extensions */
-+	for(edx = specs->roms_count; edx < specs->roms_count
-+			+ specs->aoms_count; edx++) {
-+		asn_TYPE_member_t *elm = &td->elements[edx];
-+		void **memb_ptr2;	/* Pointer to member pointer */
-+
-+		if(!elm->default_value) continue;
-+
-+		/* Fetch the pointer to this member */
-+		if(elm->flags & ATF_POINTER) {
-+			memb_ptr2 = (void **)((char *)st
-+					+ elm->memb_offset);
-+			if(*memb_ptr2) continue;
-+		} else {
-+			continue;	/* Extensions are all optionals */
-+		}
-+
-+		/* Set default value */
-+		if(elm->default_value(1, memb_ptr2)) {
-+			_ASN_DECODE_FAILED;
-+		}
-+	}
-+
-+	rv.consumed = 0;
-+	rv.code = RC_OK;
-+	return rv;
-+}
-+
-+asn_dec_rval_t
-+SEQUENCE_decode_aper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
-+	asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
-+	asn_SEQUENCE_specifics_t *specs = (asn_SEQUENCE_specifics_t *)td->specifics;
-+	void *st = *sptr;	/* Target structure. */
-+	int extpresent;		/* Extension additions are present */
-+	uint8_t *opres;		/* Presence of optional root members */
-+	asn_per_data_t opmd;
-+	asn_dec_rval_t rv;
-+	int edx;
-+
-+	(void)constraints;
-+
-+	if(_ASN_STACK_OVERFLOW_CHECK(opt_codec_ctx))
-+		_ASN_DECODE_FAILED;
-+
-+	if(!st) {
-+		st = *sptr = CALLOC(1, specs->struct_size);
-+		if(!st) _ASN_DECODE_FAILED;
-+	}
-+
-+	ASN_DEBUG("Decoding %s as SEQUENCE (APER)", td->name);
-+
-+	/* Handle extensions */
-+	if(specs->ext_before >= 0) {
-+		extpresent = per_get_few_bits(pd, 1);
-+		if(extpresent < 0) _ASN_DECODE_STARVED;
-+	} else {
-+		extpresent = 0;
-+	}
-+
-+	/* Prepare a place and read-in the presence bitmap */
-+	memset(&opmd, 0, sizeof(opmd));
-+	if(specs->roms_count) {
-+		opres = (uint8_t *)MALLOC(((specs->roms_count + 7) >> 3) + 1);
-+		if(!opres) _ASN_DECODE_FAILED;
-+		/* Get the presence map */
-+		if(per_get_many_bits(pd, opres, 0, specs->roms_count)) {
-+			FREEMEM(opres);
-+			_ASN_DECODE_STARVED;
-+		}
-+		opmd.buffer = opres;
-+		opmd.nbits = specs->roms_count;
-+		ASN_DEBUG("Read in presence bitmap for %s of %d bits (%x..)",
-+			td->name, specs->roms_count, *opres);
-+	} else {
-+		opres = 0;
-+	}
-+
-+	/*
-+	 * Get the sequence ROOT elements.
-+	 */
-+	for(edx = 0; edx < td->elements_count; edx++) {
-+		asn_TYPE_member_t *elm = &td->elements[edx];
-+		void *memb_ptr;		/* Pointer to the member */
-+		void **memb_ptr2;	/* Pointer to that pointer */
-+
-+		if(IN_EXTENSION_GROUP(specs, edx))
-+			continue;
-+
-+		/* Fetch the pointer to this member */
-+		if(elm->flags & ATF_POINTER) {
-+			memb_ptr2 = (void **)((char *)st + elm->memb_offset);
-+		} else {
-+			memb_ptr = (char *)st + elm->memb_offset;
-+			memb_ptr2 = &memb_ptr;
-+		}
-+
-+		/* Deal with optionality */
-+		if(elm->optional) {
-+			int present = per_get_few_bits(&opmd, 1);
-+			ASN_DEBUG("Member %s->%s is optional, p=%d (%d->%d)",
-+				td->name, elm->name, present,
-+				(int)opmd.nboff, (int)opmd.nbits);
-+			if(present == 0) {
-+				/* This element is not present */
-+				if(elm->default_value) {
-+					/* Fill-in DEFAULT */
-+					if(elm->default_value(1, memb_ptr2)) {
-+						FREEMEM(opres);
-+						_ASN_DECODE_FAILED;
-+					}
-+					ASN_DEBUG("Filled-in default");
-+				}
-+				/* The member is just not present */
-+				continue;
-+			}
-+			/* Fall through */
-+		}
-+
-+		/* Fetch the member from the stream */
-+		ASN_DEBUG("Decoding member %s in %s", elm->name, td->name);
-+		rv = elm->type->aper_decoder(opt_codec_ctx, elm->type,
-+			elm->per_constraints, memb_ptr2, pd);
-+		if(rv.code != RC_OK) {
-+			ASN_DEBUG("Failed decode %s in %s",
-+				elm->name, td->name);
-+			FREEMEM(opres);
-+			return rv;
-+		}
-+	}
-+
-+	/* Optionality map is not needed anymore */
-+	FREEMEM(opres);
-+
-+	/*
-+	 * Deal with extensions.
-+	 */
-+	if(extpresent) {
-+		ssize_t bmlength;
-+		uint8_t *epres;		/* Presence of extension members */
-+		asn_per_data_t epmd;
-+
-+		bmlength = uper_get_nslength(pd);
-+		if(bmlength < 0) _ASN_DECODE_STARVED;
-+
-+		ASN_DEBUG("Extensions %d present in %s", bmlength, td->name);
-+
-+		epres = (uint8_t *)MALLOC((bmlength + 15) >> 3);
-+		if(!epres) _ASN_DECODE_STARVED;
-+
-+		/* Get the extensions map */
-+		if(per_get_many_bits(pd, epres, 0, bmlength))
-+			_ASN_DECODE_STARVED;
-+
-+		memset(&epmd, 0, sizeof(epmd));
-+		epmd.buffer = epres;
-+		epmd.nbits = bmlength;
- 		ASN_DEBUG("Read in extensions bitmap for %s of %ld bits (%x..)",
- 			td->name, (long)bmlength, *epres);
- 
--	    /* Go over extensions and read them in */
--	    for(edx = specs->ext_after + 1; edx < td->elements_count; edx++) {
-+		/* Go over extensions and read them in */
-+		for(edx = specs->ext_after + 1; edx < td->elements_count; edx++) {
- 		asn_TYPE_member_t *elm = &td->elements[edx];
- 		void *memb_ptr;		/* Pointer to the member */
- 		void **memb_ptr2;	/* Pointer to that pointer */
-@@ -1171,9 +1385,9 @@
- 
- 		/* Fetch the pointer to this member */
- 		if(elm->flags & ATF_POINTER) {
--			memb_ptr2 = (void **)((void *)st + elm->memb_offset);
-+			memb_ptr2 = (void **)((char *)st + elm->memb_offset);
- 		} else {
--			memb_ptr = (void *)((void *)st + elm->memb_offset);
-+			memb_ptr = (void *)((char *)st + elm->memb_offset);
- 			memb_ptr2 = &memb_ptr;
- 		}
- 
-@@ -1190,7 +1404,7 @@
- 			FREEMEM(epres);
- 			return rv;
- 		}
--	    }
-+		}
- 
- 		/* Skip over overflow extensions which aren't present
- 		 * in this system's version of the protocol */
-@@ -1221,7 +1435,7 @@
- 
- 		/* Fetch the pointer to this member */
- 		if(elm->flags & ATF_POINTER) {
--			memb_ptr2 = (void **)((void *)st
-+			memb_ptr2 = (void **)((char *)st
- 					+ elm->memb_offset);
- 			if(*memb_ptr2) continue;
- 		} else {
-@@ -1265,10 +1479,10 @@
- 
- 		/* Fetch the pointer to this member */
- 		if(elm->flags & ATF_POINTER) {
--			memb_ptr2 = (void **)((void *)sptr + elm->memb_offset);
-+			memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
- 			present = (*memb_ptr2 != 0);
- 		} else {
--			memb_ptr = (void *)((void *)sptr + elm->memb_offset);
-+			memb_ptr = (void *)((char *)sptr + elm->memb_offset);
- 			memb_ptr2 = &memb_ptr;
- 			present = 1;
- 		}
-@@ -1334,10 +1548,10 @@
- 
- 		/* Fetch the pointer to this member */
- 		if(elm->flags & ATF_POINTER) {
--			memb_ptr2 = (void **)((void *)sptr + elm->memb_offset);
-+			memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
- 			present = (*memb_ptr2 != 0);
- 		} else {
--			memb_ptr = (void *)((void *)sptr + elm->memb_offset);
-+			memb_ptr = (void *)((char *)sptr + elm->memb_offset);
- 			memb_ptr2 = &memb_ptr;
- 			present = 1;
- 		}
-@@ -1373,7 +1587,7 @@
- 
- 		/* Fetch the pointer to this member */
- 		if(elm->flags & ATF_POINTER) {
--			memb_ptr2 = (void **)((void *)sptr + elm->memb_offset);
-+			memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
- 			if(!*memb_ptr2) {
- 				ASN_DEBUG("Element %s %d not present",
- 					elm->name, edx);
-@@ -1383,7 +1597,7 @@
- 				_ASN_ENCODE_FAILED;
- 			}
- 		} else {
--			memb_ptr = (void *)((void *)sptr + elm->memb_offset);
-+			memb_ptr = (void *)((char *)sptr + elm->memb_offset);
- 			memb_ptr2 = &memb_ptr;
- 		}
- 
-@@ -1420,3 +1634,130 @@
- 	_ASN_ENCODED_OK(er);
- }
- 
-+asn_enc_rval_t
-+SEQUENCE_encode_aper(asn_TYPE_descriptor_t *td,
-+	asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-+	asn_SEQUENCE_specifics_t *specs
-+		= (asn_SEQUENCE_specifics_t *)td->specifics;
-+	asn_enc_rval_t er;
-+	int n_extensions;
-+	int edx;
-+	int i;
-+
-+	(void)constraints;
-+
-+	if(!sptr)
-+		_ASN_ENCODE_FAILED;
-+
-+	er.encoded = 0;
-+
-+	ASN_DEBUG("Encoding %s as SEQUENCE (APER)", td->name);
-+
-+	/*
-+	 * X.691#18.1 Whether structure is extensible
-+	 * and whether to encode extensions
-+	 */
-+	if(specs->ext_before >= 0) {
-+		n_extensions = SEQUENCE_handle_extensions(td, sptr, 0, 0);
-+		per_put_few_bits(po, n_extensions ? 1 : 0, 1);
-+	} else {
-+		n_extensions = 0;	   /* There are no extensions to encode */
-+	}
-+
-+	/* Encode a presence bitmap */
-+	for(i = 0; i < specs->roms_count; i++) {
-+		asn_TYPE_member_t *elm;
-+		void *memb_ptr;	 /* Pointer to the member */
-+		void **memb_ptr2;	   /* Pointer to that pointer */
-+		int present;
-+
-+		edx = specs->oms[i];
-+		elm = &td->elements[edx];
-+
-+		/* Fetch the pointer to this member */
-+		if(elm->flags & ATF_POINTER) {
-+			memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
-+			present = (*memb_ptr2 != 0);
-+		} else {
-+			memb_ptr = (void *)((char *)sptr + elm->memb_offset);
-+			memb_ptr2 = &memb_ptr;
-+			present = 1;
-+		}
-+
-+		/* Eliminate default values */
-+		if(present && elm->default_value
-+		&& elm->default_value(0, memb_ptr2) == 1)
-+			present = 0;
-+
-+		ASN_DEBUG("Element %s %s %s->%s is %s",
-+			elm->flags & ATF_POINTER ? "ptr" : "inline",
-+			elm->default_value ? "def" : "wtv",
-+			td->name, elm->name, present ? "present" : "absent");
-+		if(per_put_few_bits(po, present, 1))
-+			_ASN_ENCODE_FAILED;
-+	}
-+
-+	/*
-+	 * Encode the sequence ROOT elements.
-+	 */
-+	ASN_DEBUG("ext_after = %d, ec = %d, eb = %d", specs->ext_after, td->elements_count, specs->ext_before);
-+	for(edx = 0; edx < ((specs->ext_after < 0)
-+		? td->elements_count : specs->ext_before - 1); edx++) {
-+
-+		asn_TYPE_member_t *elm = &td->elements[edx];
-+		void *memb_ptr;	 /* Pointer to the member */
-+		void **memb_ptr2;	   /* Pointer to that pointer */
-+
-+		if(IN_EXTENSION_GROUP(specs, edx))
-+			continue;
-+
-+		ASN_DEBUG("About to encode %s", elm->type->name);
-+
-+		/* Fetch the pointer to this member */
-+		if(elm->flags & ATF_POINTER) {
-+			memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
-+			if(!*memb_ptr2) {
-+				ASN_DEBUG("Element %s %d not present",
-+					elm->name, edx);
-+				if(elm->optional)
-+					continue;
-+				/* Mandatory element is missing */
-+				_ASN_ENCODE_FAILED;
-+			}
-+		} else {
-+			memb_ptr = (void *)((char *)sptr + elm->memb_offset);
-+			memb_ptr2 = &memb_ptr;
-+		}
-+
-+		/* Eliminate default values */
-+		if(elm->default_value && elm->default_value(0, memb_ptr2) == 1)
-+			continue;
-+
-+		ASN_DEBUG("Encoding %s->%s", td->name, elm->name);
-+		er = elm->type->aper_encoder(elm->type, elm->per_constraints,
-+			*memb_ptr2, po);
-+		if(er.encoded == -1)
-+			return er;
-+	}
-+
-+	/* No extensions to encode */
-+	if(!n_extensions) _ASN_ENCODED_OK(er);
-+
-+	ASN_DEBUG("Length of %d bit-map", n_extensions);
-+	/* #18.8. Write down the presence bit-map length. */
-+	if(aper_put_nslength(po, n_extensions))
-+		_ASN_ENCODE_FAILED;
-+
-+	ASN_DEBUG("Bit-map of %d elements", n_extensions);
-+	/* #18.7. Encoding the extensions presence bit-map. */
-+	/* TODO: act upon NOTE in #18.7 for canonical PER */
-+	if(SEQUENCE_handle_extensions(td, sptr, po, 0) != n_extensions)
-+		_ASN_ENCODE_FAILED;
-+
-+	ASN_DEBUG("Writing %d extensions", n_extensions);
-+	/* #18.9. Encode extensions as open type fields. */
-+	if(SEQUENCE_handle_extensions(td, sptr, 0, po) != n_extensions)
-+		_ASN_ENCODE_FAILED;
-+
-+	_ASN_ENCODED_OK(er);
-+}
-Index: skeletons/INTEGER.h
-===================================================================
---- skeletons/INTEGER.h	(revision 1516)
-+++ skeletons/INTEGER.h	(working copy)
-@@ -41,6 +41,8 @@
- xer_type_encoder_f INTEGER_encode_xer;
- per_type_decoder_f INTEGER_decode_uper;
- per_type_encoder_f INTEGER_encode_uper;
-+per_type_decoder_f INTEGER_decode_aper;
-+per_type_encoder_f INTEGER_encode_aper;
- 
- /***********************************
-  * Some handy conversion routines. *
-@@ -52,8 +54,12 @@
-  * -1/ERANGE: Value encoded is out of range for long representation
-  * -1/ENOMEM: Memory allocation failed (in asn_long2INTEGER()).
-  */
-+int asn_INTEGER2int64(const INTEGER_t *i, int64_t *l);
-+int asn_INTEGER2uint64(const INTEGER_t *i, uint64_t *l);
- int asn_INTEGER2long(const INTEGER_t *i, long *l);
- int asn_INTEGER2ulong(const INTEGER_t *i, unsigned long *l);
-+int asn_int642INTEGER(INTEGER_t *i, int64_t l);
-+int asn_uint642INTEGER(INTEGER_t *i, uint64_t l);
- int asn_long2INTEGER(INTEGER_t *i, long l);
- int asn_ulong2INTEGER(INTEGER_t *i, unsigned long l);
- 
-Index: skeletons/OCTET_STRING.c
-===================================================================
---- skeletons/OCTET_STRING.c	(revision 1516)
-+++ skeletons/OCTET_STRING.c	(working copy)
-@@ -36,6 +36,8 @@
- 	OCTET_STRING_encode_xer,
- 	OCTET_STRING_decode_uper,	/* Unaligned PER decoder */
- 	OCTET_STRING_encode_uper,	/* Unaligned PER encoder */
-+	OCTET_STRING_decode_aper,	/* Aligned PER decoder */
-+	OCTET_STRING_encode_aper,	/* Aligned PER encoder */
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_OCTET_STRING_tags,
- 	sizeof(asn_DEF_OCTET_STRING_tags)
-@@ -86,7 +88,7 @@
- 			void *ptr;					\
- 			/* Be nice and round to the memory allocator */	\
- 			do { _ns = _ns ? _ns << 1 : 16; }		\
--			    while(_ns <= _es);				\
-+				while(_ns <= _es);				\
- 			/* int is really a typeof(st->size): */		\
- 			if((int)_ns < 0) RETURN(RC_FAIL);		\
- 			ptr = REALLOC(st->buf, _ns);			\
-@@ -195,7 +197,7 @@
- 	}
- 
- 	/* Restore parsing context */
--	ctx = (asn_struct_ctx_t *)((void *)st + specs->ctx_offset);
-+	ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
- 
- 	switch(ctx->phase) {
- 	case 0:
-@@ -416,7 +418,7 @@
- 		ASN_DEBUG("Phase 2: Need %ld bytes, size=%ld, alrg=%ld, wn=%d",
- 			(long)sel->left, (long)size, (long)sel->got,
- 				sel->want_nulls);
--	    {
-+		{
- 		ber_tlv_len_t len;
- 
- 		assert(sel->left >= 0);
-@@ -446,7 +448,7 @@
- 
- 		PREV_PHASE(ctx);
- 		goto phase1;
--	    }
-+		}
- 		break;
- 	case 3:
- 	phase3:
-@@ -1143,7 +1145,7 @@
- 	}
- 
- 	/* Restore parsing context */
--	ctx = (asn_struct_ctx_t *)(((void *)*sptr) + specs->ctx_offset);
-+	ctx = (asn_struct_ctx_t *)(((char *)*sptr) + specs->ctx_offset);
- 
- 	return xer_decode_general(opt_codec_ctx, ctx, *sptr, xml_tag,
- 		buf_ptr, size, opt_unexpected_tag_decoder, body_receiver);
-@@ -1392,7 +1394,7 @@
- 		if(!st) RETURN(RC_FAIL);
- 	}
- 
--	ASN_DEBUG("PER Decoding %s size %ld .. %ld bits %d",
-+	ASN_DEBUG("PER Decoding %s size %"PRIdMAX" .. %"PRIdMAX" bits %d",
- 		csiz->flags & APC_EXTENSIBLE ? "extensible" : "non-extensible",
- 		csiz->lower_bound, csiz->upper_bound, csiz->effective_bits);
- 
-@@ -1423,17 +1425,17 @@
- 	if(csiz->effective_bits == 0) {
- 		int ret;
- 		if(bpc) {
--			ASN_DEBUG("Encoding OCTET STRING size %ld",
-+			ASN_DEBUG("Encoding OCTET STRING size %"PRIdMAX,
- 				csiz->upper_bound);
- 			ret = OCTET_STRING_per_get_characters(pd, st->buf,
- 				csiz->upper_bound, bpc, unit_bits,
- 				cval->lower_bound, cval->upper_bound, pc);
- 			if(ret > 0) RETURN(RC_FAIL);
- 		} else {
--			ASN_DEBUG("Encoding BIT STRING size %ld",
-+			ASN_DEBUG("Encoding BIT STRING size %"PRIdMAX,
- 				csiz->upper_bound);
- 			ret = per_get_many_bits(pd, st->buf, 0,
--					    unit_bits * csiz->upper_bound);
-+						unit_bits * csiz->upper_bound);
- 		}
- 		if(ret < 0) RETURN(RC_WMORE);
- 		consumed_myself += unit_bits * csiz->upper_bound;
-@@ -1492,9 +1494,197 @@
- 	return rval;
- }
- 
-+asn_dec_rval_t
-+OCTET_STRING_decode_aper(asn_codec_ctx_t *opt_codec_ctx,
-+	asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints,
-+	void **sptr, asn_per_data_t *pd) {
-+
-+	asn_OCTET_STRING_specifics_t *specs = td->specifics
-+		? (asn_OCTET_STRING_specifics_t *)td->specifics
-+		: &asn_DEF_OCTET_STRING_specs;
-+	asn_per_constraints_t *pc = constraints ? constraints
-+				: td->per_constraints;
-+	asn_per_constraint_t *cval;
-+	asn_per_constraint_t *csiz;
-+	asn_dec_rval_t rval = { RC_OK, 0 };
-+	BIT_STRING_t *st = (BIT_STRING_t *)*sptr;
-+	ssize_t consumed_myself = 0;
-+	int repeat;
-+	enum {
-+		OS__BPC_BIT	= 0,
-+		OS__BPC_CHAR	= 1,
-+		OS__BPC_U16	= 2,
-+		OS__BPC_U32	= 4
-+	} bpc;	/* Bytes per character */
-+	unsigned int unit_bits;
-+	unsigned int canonical_unit_bits;
-+
-+	(void)opt_codec_ctx;
-+
-+	if(pc) {
-+		cval = &pc->value;
-+		csiz = &pc->size;
-+	} else {
-+		cval = &asn_DEF_OCTET_STRING_constraints.value;
-+		csiz = &asn_DEF_OCTET_STRING_constraints.size;
-+	}
-+
-+	switch(specs->subvariant) {
-+	default:
-+// 	case ASN_OSUBV_ANY:
-+// 		ASN_DEBUG("Unrecognized subvariant %d", specs->subvariant);
-+// 		RETURN(RC_FAIL);
-+	case ASN_OSUBV_BIT:
-+		canonical_unit_bits = unit_bits = 1;
-+		bpc = OS__BPC_BIT;
-+		break;
-+	case ASN_OSUBV_ANY:
-+	case ASN_OSUBV_STR:
-+		canonical_unit_bits = unit_bits = 8;
-+// 		if(cval->flags & APC_CONSTRAINED)
-+// 			unit_bits = cval->range_bits;
-+		bpc = OS__BPC_CHAR;
-+		break;
-+	case ASN_OSUBV_U16:
-+		canonical_unit_bits = unit_bits = 16;
-+		if(cval->flags & APC_CONSTRAINED)
-+			unit_bits = cval->range_bits;
-+		bpc = OS__BPC_U16;
-+		break;
-+	case ASN_OSUBV_U32:
-+		canonical_unit_bits = unit_bits = 32;
-+		if(cval->flags & APC_CONSTRAINED)
-+			unit_bits = cval->range_bits;
-+		bpc = OS__BPC_U32;
-+		break;
-+	}
-+
-+	/*
-+	 * Allocate the string.
-+	 */
-+	if(!st) {
-+		st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
-+		if(!st) RETURN(RC_FAIL);
-+	}
-+
-+	ASN_DEBUG("PER Decoding %s size %"PRIdMAX" .. %"PRIdMAX" bits %d",
-+		csiz->flags & APC_EXTENSIBLE ? "extensible" : "non-extensible",
-+		csiz->lower_bound, csiz->upper_bound, csiz->effective_bits);
-+
-+	if(csiz->flags & APC_EXTENSIBLE) {
-+		int inext = per_get_few_bits(pd, 1);
-+		if(inext < 0) RETURN(RC_WMORE);
-+		if(inext) {
-+			csiz = &asn_DEF_OCTET_STRING_constraints.size;
-+			cval = &asn_DEF_OCTET_STRING_constraints.value;
-+			unit_bits = canonical_unit_bits;
-+		}
-+	}
-+
-+	if(csiz->effective_bits >= 0) {
-+		FREEMEM(st->buf);
-+		if(bpc) {
-+			st->size = csiz->upper_bound * bpc;
-+		} else {
-+			st->size = (csiz->upper_bound + 7) >> 3;
-+		}
-+		st->buf = (uint8_t *)MALLOC(st->size + 1);
-+		if(!st->buf) { st->size = 0; RETURN(RC_FAIL); }
-+	}
-+
-+	/* X.691, #16.5: zero-length encoding */
-+	/* X.691, #16.6: short fixed length encoding (up to 2 octets) */
-+	/* X.691, #16.7: long fixed length encoding (up to 64K octets) */
-+	if(csiz->effective_bits == 0) {
-+		int ret;
-+		if (st->size > 2) { /* X.691 #16 NOTE 1 */
-+			if (aper_get_align(pd) < 0)
-+				RETURN(RC_FAIL);
-+		}
-+		if(bpc) {
-+			ASN_DEBUG("Decoding OCTET STRING size %"PRIdMAX,
-+				csiz->upper_bound);
-+			ret = OCTET_STRING_per_get_characters(pd, st->buf,
-+				csiz->upper_bound, bpc, unit_bits,
-+				cval->lower_bound, cval->upper_bound, pc);
-+			if(ret > 0) RETURN(RC_FAIL);
-+		} else {
-+			ASN_DEBUG("Decoding BIT STRING size %"PRIdMAX,
-+				csiz->upper_bound);
-+			ret = per_get_many_bits(pd, st->buf, 0,
-+						unit_bits * csiz->upper_bound);
-+		}
-+		if(ret < 0) RETURN(RC_WMORE);
-+		consumed_myself += unit_bits * csiz->upper_bound;
-+		st->buf[st->size] = 0;
-+		if(bpc == 0) {
-+			int ubs = (csiz->upper_bound & 0x7);
-+			st->bits_unused = ubs ? 8 - ubs : 0;
-+		}
-+		RETURN(RC_OK);
-+	}
-+
-+	st->size = 0;
-+	do {
-+		ssize_t raw_len;
-+		ssize_t len_bytes;
-+		ssize_t len_bits;
-+		void *p;
-+		int ret;
-+
-+		/* Get the PER length */
-+		if (csiz->upper_bound - csiz->lower_bound == 0)
-+			// Indefinite length case
-+			raw_len = aper_get_length(pd, -1, csiz->effective_bits, &repeat);
-+		else
-+			raw_len = aper_get_length(pd, csiz->upper_bound - csiz->lower_bound + 1, csiz->effective_bits, &repeat);
-+		repeat = 0;
-+		if(raw_len < 0) RETURN(RC_WMORE);
-+		raw_len += csiz->lower_bound;
-+
-+		ASN_DEBUG("Got PER length eb %ld, len %ld, %s (%s)",
-+			(long)csiz->effective_bits, (long)raw_len,
-+			repeat ? "repeat" : "once", td->name);
-+
-+		if (raw_len > 2) { /* X.691 #16 NOTE 1 */
-+			if (aper_get_align(pd) < 0)
-+				RETURN(RC_FAIL);
-+		}
-+
-+		if(bpc) {
-+			len_bytes = raw_len * bpc;
-+			len_bits = len_bytes * unit_bits;
-+		} else {
-+			len_bits = raw_len;
-+			len_bytes = (len_bits + 7) >> 3;
-+			if(len_bits & 0x7)
-+				st->bits_unused = 8 - (len_bits & 0x7);
-+			/* len_bits be multiple of 16K if repeat is set */
-+		}
-+		p = REALLOC(st->buf, st->size + len_bytes + 1);
-+		if(!p) RETURN(RC_FAIL);
-+		st->buf = (uint8_t *)p;
-+
-+		if(bpc) {
-+			ret = OCTET_STRING_per_get_characters(pd,
-+				&st->buf[st->size], raw_len, bpc, unit_bits,
-+				cval->lower_bound, cval->upper_bound, pc);
-+			if(ret > 0) RETURN(RC_FAIL);
-+		} else {
-+			ret = per_get_many_bits(pd, &st->buf[st->size],
-+				0, len_bits);
-+		}
-+		if(ret < 0) RETURN(RC_WMORE);
-+		st->size += len_bytes;
-+	} while(repeat);
-+	st->buf[st->size] = 0;	/* nul-terminate */
-+
-+	return rval;
-+}
-+
- asn_enc_rval_t
- OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td,
--        asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-+		asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
- 
- 	asn_OCTET_STRING_specifics_t *specs = td->specifics
- 		? (asn_OCTET_STRING_specifics_t *)td->specifics
-@@ -1566,7 +1756,7 @@
- 	}
- 
- 	ASN_DEBUG("Encoding %s into %d units of %d bits"
--		" (%ld..%ld, effective %d)%s",
-+		" (%"PRIdMAX"..%"PRIdMAX", effective %d)%s",
- 		td->name, sizeinunits, unit_bits,
- 		csiz->lower_bound, csiz->upper_bound,
- 		csiz->effective_bits, ct_extensible ? " EXT" : "");
-@@ -1598,7 +1788,7 @@
- 	/* X.691, #16.6: short fixed length encoding (up to 2 octets) */
- 	/* X.691, #16.7: long fixed length encoding (up to 64K octets) */
- 	if(csiz->effective_bits >= 0) {
--		ASN_DEBUG("Encoding %d bytes (%ld), length in %d bits",
-+		ASN_DEBUG("Encoding %d bytes (%"PRIdMAX"), length in %d bits",
- 				st->size, sizeinunits - csiz->lower_bound,
- 				csiz->effective_bits);
- 		ret = per_put_few_bits(po, sizeinunits - csiz->lower_bound,
-@@ -1652,6 +1842,173 @@
- 	_ASN_ENCODED_OK(er);
- }
- 
-+asn_enc_rval_t
-+OCTET_STRING_encode_aper(asn_TYPE_descriptor_t *td,
-+		asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-+
-+		asn_OCTET_STRING_specifics_t *specs = td->specifics
-+				? (asn_OCTET_STRING_specifics_t *)td->specifics
-+				: &asn_DEF_OCTET_STRING_specs;
-+		asn_per_constraints_t *pc = constraints ? constraints
-+								: td->per_constraints;
-+		asn_per_constraint_t *cval;
-+		asn_per_constraint_t *csiz;
-+		const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
-+		asn_enc_rval_t er = { 0, 0, 0 };
-+		int inext = 0;		  /* Lies not within extension root */
-+		unsigned int unit_bits;
-+		unsigned int canonical_unit_bits;
-+		unsigned int sizeinunits;
-+		const uint8_t *buf;
-+		int ret;
-+		enum {
-+				OS__BPC_BIT	 = 0,
-+				OS__BPC_CHAR	= 1,
-+				OS__BPC_U16	 = 2,
-+				OS__BPC_U32	 = 4
-+		} bpc;  /* Bytes per character */
-+		int ct_extensible;
-+
-+		if(!st || (!st->buf && st->size))
-+				_ASN_ENCODE_FAILED;
-+
-+		if(pc) {
-+				cval = &pc->value;
-+				csiz = &pc->size;
-+		} else {
-+				cval = &asn_DEF_OCTET_STRING_constraints.value;
-+				csiz = &asn_DEF_OCTET_STRING_constraints.size;
-+		}
-+		ct_extensible = csiz->flags & APC_EXTENSIBLE;
-+
-+		switch(specs->subvariant) {
-+		default:
-+//		 case ASN_OSUBV_ANY:
-+//				 _ASN_ENCODE_FAILED;
-+		case ASN_OSUBV_BIT:
-+				canonical_unit_bits = unit_bits = 1;
-+				bpc = OS__BPC_BIT;
-+				sizeinunits = st->size * 8 - (st->bits_unused & 0x07);
-+				ASN_DEBUG("BIT STRING of %d bits",
-+								sizeinunits);
-+		break;
-+		case ASN_OSUBV_ANY:
-+	case ASN_OSUBV_STR:
-+		canonical_unit_bits = unit_bits = 8;
-+// 		if(cval->flags & APC_CONSTRAINED)
-+// 			unit_bits = 8;
-+		bpc = OS__BPC_CHAR;
-+		sizeinunits = st->size;
-+		break;
-+	case ASN_OSUBV_U16:
-+		canonical_unit_bits = unit_bits = 16;
-+		if(cval->flags & APC_CONSTRAINED)
-+			unit_bits = cval->range_bits;
-+		bpc = OS__BPC_U16;
-+		sizeinunits = st->size / 2;
-+		break;
-+	case ASN_OSUBV_U32:
-+		canonical_unit_bits = unit_bits = 32;
-+		if(cval->flags & APC_CONSTRAINED)
-+			unit_bits = cval->range_bits;
-+		bpc = OS__BPC_U32;
-+		sizeinunits = st->size / 4;
-+		break;
-+	}
-+
-+	ASN_DEBUG("Encoding %s into %d units of %d bits"
-+		" (%"PRIdMAX"..%"PRIdMAX", effective %d)%s",
-+		td->name, sizeinunits, unit_bits,
-+		csiz->lower_bound, csiz->upper_bound,
-+		csiz->effective_bits, ct_extensible ? " EXT" : "");
-+
-+	/* Figure out wheter size lies within PER visible constraint */
-+
-+	if(csiz->effective_bits >= 0) {
-+		if((int)sizeinunits < csiz->lower_bound
-+		|| (int)sizeinunits > csiz->upper_bound) {
-+			if(ct_extensible) {
-+				cval = &asn_DEF_OCTET_STRING_constraints.value;
-+				csiz = &asn_DEF_OCTET_STRING_constraints.size;
-+				unit_bits = canonical_unit_bits;
-+				inext = 1;
-+			} else
-+				_ASN_ENCODE_FAILED;
-+		}
-+	} else {
-+		inext = 0;
-+	}
-+
-+
-+	if(ct_extensible) {
-+		/* Declare whether length is [not] within extension root */
-+		if(per_put_few_bits(po, inext, 1))
-+			_ASN_ENCODE_FAILED;
-+	}
-+
-+	/* X.691, #16.5: zero-length encoding */
-+	/* X.691, #16.6: short fixed length encoding (up to 2 octets) */
-+	/* X.691, #16.7: long fixed length encoding (up to 64K octets) */
-+	if(csiz->effective_bits >= 0) {
-+		ASN_DEBUG("Encoding %d bytes (%"PRIdMAX"), length in %d bits",
-+				st->size, sizeinunits - csiz->lower_bound,
-+				csiz->effective_bits);
-+		ret = per_put_few_bits(po, sizeinunits - csiz->lower_bound,
-+				csiz->effective_bits);
-+		if(ret) _ASN_ENCODE_FAILED;
-+		if (st->size > 2) { /* X.691 #16 NOTE 1 */
-+			if (aper_put_align(po) < 0)
-+				_ASN_ENCODE_FAILED;
-+		}
-+		if(bpc) {
-+			ret = OCTET_STRING_per_put_characters(po, st->buf,
-+				sizeinunits, bpc, unit_bits,
-+				cval->lower_bound, cval->upper_bound, pc);
-+		} else {
-+			ret = per_put_many_bits(po, st->buf,
-+				sizeinunits * unit_bits);
-+		}
-+		if(ret) _ASN_ENCODE_FAILED;
-+		_ASN_ENCODED_OK(er);
-+	}
-+
-+	ASN_DEBUG("Encoding %d bytes", st->size);
-+
-+	if(sizeinunits == 0) {
-+		if(aper_put_length(po, -1, 0))
-+			_ASN_ENCODE_FAILED;
-+		_ASN_ENCODED_OK(er);
-+	}
-+
-+	buf = st->buf;
-+	while(sizeinunits) {
-+		ssize_t maySave = aper_put_length(po, -1, sizeinunits);
-+
-+		if(maySave < 0) _ASN_ENCODE_FAILED;
-+
-+		ASN_DEBUG("Encoding %ld of %ld",
-+			(long)maySave, (long)sizeinunits);
-+
-+		if(bpc) {
-+			ret = OCTET_STRING_per_put_characters(po, buf,
-+				maySave, bpc, unit_bits,
-+				cval->lower_bound, cval->upper_bound, pc);
-+		} else {
-+			ret = per_put_many_bits(po, buf, maySave * unit_bits);
-+		}
-+		if(ret) _ASN_ENCODE_FAILED;
-+
-+		if(bpc)
-+			buf += maySave * bpc;
-+		else
-+			buf += maySave >> 3;
-+		sizeinunits -= maySave;
-+		assert(!(maySave & 0x07) || !sizeinunits);
-+	}
-+
-+	_ASN_ENCODED_OK(er);
-+}
-+
- int
- OCTET_STRING_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
- 	asn_app_consume_bytes_f *cb, void *app_key) {
-@@ -1716,7 +2073,7 @@
- 				? (asn_OCTET_STRING_specifics_t *)td->specifics
- 				: &asn_DEF_OCTET_STRING_specs;
- 	asn_struct_ctx_t *ctx = (asn_struct_ctx_t *)
--					((void *)st + specs->ctx_offset);
-+					((char *)st + specs->ctx_offset);
- 	struct _stack *stck;
- 
- 	if(!td || !st)
-Index: skeletons/BIT_STRING.c
-===================================================================
---- skeletons/BIT_STRING.c	(revision 1516)
-+++ skeletons/BIT_STRING.c	(working copy)
-@@ -29,6 +29,8 @@
- 	BIT_STRING_encode_xer,
- 	OCTET_STRING_decode_uper,	/* Unaligned PER decoder */
- 	OCTET_STRING_encode_uper,	/* Unaligned PER encoder */
-+	OCTET_STRING_decode_aper,	/* Aligned PER decoder */
-+	OCTET_STRING_encode_aper,	/* Aligned PER encoder */
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_BIT_STRING_tags,
- 	sizeof(asn_DEF_BIT_STRING_tags)
-Index: skeletons/NativeInteger.c
-===================================================================
---- skeletons/NativeInteger.c	(revision 1516)
-+++ skeletons/NativeInteger.c	(working copy)
-@@ -31,6 +31,8 @@
- 	NativeInteger_encode_xer,
- 	NativeInteger_decode_uper,	/* Unaligned PER decoder */
- 	NativeInteger_encode_uper,	/* Unaligned PER encoder */
-+	NativeInteger_decode_aper,	/* Aligned PER decoder */
-+	NativeInteger_encode_aper,	/* Aligned PER encoder */
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_NativeInteger_tags,
- 	sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]),
-@@ -267,6 +269,46 @@
- 	return rval;
- }
- 
-+asn_dec_rval_t
-+NativeInteger_decode_aper(asn_codec_ctx_t *opt_codec_ctx,
-+	asn_TYPE_descriptor_t *td,
-+	asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
-+
-+	asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics;
-+	asn_dec_rval_t rval;
-+	long *native = (long *)*sptr;
-+	INTEGER_t tmpint;
-+	void *tmpintptr = &tmpint;
-+	int dynamic = 0;
-+
-+	(void)opt_codec_ctx;
-+	ASN_DEBUG("Decoding NativeInteger %s (APER)", td->name);
-+
-+	if(!native) {
-+		native = (long *)(*sptr = CALLOC(1, sizeof(*native)));
-+		dynamic = 1;
-+		if(!native) _ASN_DECODE_FAILED;
-+	}
-+
-+	memset(&tmpint, 0, sizeof tmpint);
-+	rval = INTEGER_decode_aper(opt_codec_ctx, td, constraints,
-+				   &tmpintptr, pd);
-+	if(rval.code == RC_OK) {
-+		if((specs&&specs->field_unsigned)
-+			? asn_INTEGER2ulong(&tmpint, (unsigned long *)native)
-+			: asn_INTEGER2long(&tmpint, native))
-+			rval.code = RC_FAIL;
-+		else
-+			ASN_DEBUG("NativeInteger %s got value %ld",
-+				td->name, *native);
-+	}
-+	ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
-+	//if (dynamic)
-+	//	free(native);
-+
-+	return rval;
-+}
-+
- asn_enc_rval_t
- NativeInteger_encode_uper(asn_TYPE_descriptor_t *td,
- 	asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-@@ -291,6 +333,44 @@
- 	return er;
- }
- 
-+asn_enc_rval_t
-+NativeInteger_encode_aper(
-+	asn_TYPE_descriptor_t *td,
-+	asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-+
-+	asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics;
-+	asn_enc_rval_t er;
-+	INTEGER_t tmpint;
-+
-+	if(!sptr) _ASN_ENCODE_FAILED;
-+	memset(&tmpint, 0, sizeof(tmpint));
-+
-+	if(specs&&specs->field_unsigned) {
-+		unsigned long native;
-+		native = *(unsigned long *)sptr;
-+
-+		ASN_DEBUG("Encoding NativeInteger %s %lu (APER) (unsigned)", td->name, native);
-+
-+		if(asn_ulong2INTEGER(&tmpint, native))
-+			_ASN_ENCODE_FAILED;
-+	} else {
-+		long native;
-+		native = *(long *)sptr;
-+
-+		ASN_DEBUG("Encoding NativeInteger %s %ld (APER) (unsigned)", td->name, native);
-+		if(asn_long2INTEGER(&tmpint, native))
-+			_ASN_ENCODE_FAILED;
-+	}
-+
-+// 	if((specs&&specs->field_unsigned)
-+// 		? asn_ulong2INTEGER(&tmpint, native)
-+// 		: asn_long2INTEGER(&tmpint, native))
-+// 		_ASN_ENCODE_FAILED;
-+	er = INTEGER_encode_aper(td, constraints, &tmpint, po);
-+	ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
-+	return er;
-+}
-+
- /*
-  * INTEGER specific human-readable output.
-  */
-Index: skeletons/constr_SEQUENCE.h
-===================================================================
---- skeletons/constr_SEQUENCE.h	(revision 1516)
-+++ skeletons/constr_SEQUENCE.h	(working copy)
-@@ -52,6 +52,8 @@
- xer_type_encoder_f SEQUENCE_encode_xer;
- per_type_decoder_f SEQUENCE_decode_uper;
- per_type_encoder_f SEQUENCE_encode_uper;
-+per_type_decoder_f SEQUENCE_decode_aper;
-+per_type_encoder_f SEQUENCE_encode_aper;
- 
- #ifdef __cplusplus
- }
-Index: skeletons/NativeInteger.h
-===================================================================
---- skeletons/NativeInteger.h	(revision 1516)
-+++ skeletons/NativeInteger.h	(working copy)
-@@ -29,6 +29,8 @@
- xer_type_encoder_f NativeInteger_encode_xer;
- per_type_decoder_f NativeInteger_decode_uper;
- per_type_encoder_f NativeInteger_encode_uper;
-+per_type_decoder_f NativeInteger_decode_aper;
-+per_type_encoder_f NativeInteger_encode_aper;
- 
- #ifdef __cplusplus
- }
-Index: skeletons/OCTET_STRING.h
-===================================================================
---- skeletons/OCTET_STRING.h	(revision 1516)
-+++ skeletons/OCTET_STRING.h	(working copy)
-@@ -32,6 +32,8 @@
- xer_type_encoder_f OCTET_STRING_encode_xer_utf8;
- per_type_decoder_f OCTET_STRING_decode_uper;
- per_type_encoder_f OCTET_STRING_encode_uper;
-+per_type_decoder_f OCTET_STRING_decode_aper;
-+per_type_encoder_f OCTET_STRING_encode_aper;
- 
- /******************************
-  * Handy conversion routines. *
-Index: skeletons/UTCTime.c
-===================================================================
---- skeletons/UTCTime.c	(revision 1516)
-+++ skeletons/UTCTime.c	(working copy)
-@@ -40,6 +40,8 @@
- 	UTCTime_encode_xer,
- 	OCTET_STRING_decode_uper,
- 	OCTET_STRING_encode_uper,
-+	OCTET_STRING_decode_aper,
-+	OCTET_STRING_encode_aper,
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_UTCTime_tags,
- 	sizeof(asn_DEF_UTCTime_tags)
-Index: skeletons/REAL.c
-===================================================================
---- skeletons/REAL.c	(revision 1516)
-+++ skeletons/REAL.c	(working copy)
-@@ -45,6 +45,8 @@
- 	REAL_encode_xer,
- 	REAL_decode_uper,
- 	REAL_encode_uper,
-+	REAL_decode_aper,
-+	REAL_encode_aper,
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_REAL_tags,
- 	sizeof(asn_DEF_REAL_tags) / sizeof(asn_DEF_REAL_tags[0]),
-@@ -361,6 +363,21 @@
- 	return OCTET_STRING_encode_uper(td, 0, sptr, po);
- }
- 
-+asn_dec_rval_t
-+REAL_decode_aper(asn_codec_ctx_t *opt_codec_ctx,
-+	asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints,
-+	void **sptr, asn_per_data_t *pd) {
-+	(void)constraints;	/* No PER visible constraints */
-+	return OCTET_STRING_decode_aper(opt_codec_ctx, td, 0, sptr, pd);
-+}
-+
-+asn_enc_rval_t
-+REAL_encode_aper(asn_TYPE_descriptor_t *td,
-+	asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-+	(void)constraints;	/* No PER visible constraints */
-+	return OCTET_STRING_encode_aper(td, 0, sptr, po);
-+}
-+
- int
- asn_REAL2double(const REAL_t *st, double *dbl_value) {
- 	unsigned int octv;
-Index: skeletons/VisibleString.c
-===================================================================
---- skeletons/VisibleString.c	(revision 1516)
-+++ skeletons/VisibleString.c	(working copy)
-@@ -29,6 +29,8 @@
- 	OCTET_STRING_encode_xer_utf8,
- 	OCTET_STRING_decode_uper,
- 	OCTET_STRING_encode_uper,
-+	OCTET_STRING_decode_aper,
-+	OCTET_STRING_encode_aper,
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_VisibleString_tags,
- 	sizeof(asn_DEF_VisibleString_tags)
-Index: skeletons/ANY.c
-===================================================================
---- skeletons/ANY.c	(revision 1516)
-+++ skeletons/ANY.c	(working copy)
-@@ -21,7 +21,10 @@
- 	OCTET_STRING_encode_der,
- 	OCTET_STRING_decode_xer_hex,
- 	ANY_encode_xer,
--	0, 0,
-+	OCTET_STRING_decode_uper,
-+	OCTET_STRING_encode_uper,
-+	OCTET_STRING_decode_aper,
-+	OCTET_STRING_encode_aper,
- 	0, /* Use generic outmost tag fetcher */
- 	0, 0, 0, 0,
- 	0,	/* No PER visible constraints */
-@@ -87,6 +90,37 @@
- 	return 0;
- }
- 
-+int
-+ANY_fromType_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr) {
-+	uint8_t *buffer = NULL;
-+	ssize_t erval;
-+	
-+	if(!st || !td) {
-+		errno = EINVAL;
-+		return -1;
-+	}
-+	
-+	if(!sptr) {
-+		if(st->buf) FREEMEM(st->buf);
-+		st->size = 0;
-+		return 0;
-+	}
-+	
-+	erval = aper_encode_to_new_buffer(td, td->per_constraints, sptr, (void**)&buffer);
-+
-+	if(erval == -1) {
-+		if(buffer) FREEMEM(buffer);
-+		return -1;
-+	}
-+	assert((size_t)erval > 0);
-+	
-+	if(st->buf) FREEMEM(st->buf);
-+	st->buf = buffer;
-+	st->size = erval;
-+	
-+	return 0;
-+}
-+
- ANY_t *
- ANY_new_fromType(asn_TYPE_descriptor_t *td, void *sptr) {
- 	ANY_t tmp;
-@@ -111,6 +145,30 @@
- 	}
- }
- 
-+ANY_t *
-+ANY_new_fromType_aper(asn_TYPE_descriptor_t *td, void *sptr) {
-+	ANY_t tmp;
-+	ANY_t *st;
-+	
-+	if(!td || !sptr) {
-+		errno = EINVAL;
-+		return 0;
-+	}
-+	
-+	memset(&tmp, 0, sizeof(tmp));
-+	
-+	if(ANY_fromType_aper(&tmp, td, sptr)) return 0;
-+	
-+	st = (ANY_t *)CALLOC(1, sizeof(ANY_t));
-+	if(st) {
-+		*st = tmp;
-+		return st;
-+	} else {
-+		FREEMEM(tmp.buf);
-+		return 0;
-+	}
-+}
-+
- int
- ANY_to_type(ANY_t *st, asn_TYPE_descriptor_t *td, void **struct_ptr) {
- 	asn_dec_rval_t rval;
-@@ -138,6 +196,33 @@
- 	}
- }
- 
-+int
-+ANY_to_type_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void **struct_ptr) {
-+	asn_dec_rval_t rval;
-+	void *newst = 0;
-+	
-+	if(!st || !td || !struct_ptr) {
-+		errno = EINVAL;
-+		return -1;
-+	}
-+	
-+	if(st->buf == 0) {
-+		/* Nothing to convert, make it empty. */
-+		*struct_ptr = (void *)0;
-+		return 0;
-+	}
-+	
-+	rval = aper_decode(0, td, (void **)&newst, st->buf, st->size, 0, 0);
-+	if(rval.code == RC_OK) {
-+		*struct_ptr = newst;
-+		return 0;
-+	} else {
-+		/* Remove possibly partially decoded data. */
-+		ASN_STRUCT_FREE(*td, newst);
-+		return -1;
-+	}
-+}
-+
- static int ANY__consume_bytes(const void *buffer, size_t size, void *key) {
- 	struct _callback_arg *arg = (struct _callback_arg *)key;
- 
-Index: skeletons/REAL.h
-===================================================================
---- skeletons/REAL.h	(revision 1516)
-+++ skeletons/REAL.h	(working copy)
-@@ -21,6 +21,8 @@
- xer_type_encoder_f REAL_encode_xer;
- per_type_decoder_f REAL_decode_uper;
- per_type_encoder_f REAL_encode_uper;
-+per_type_decoder_f REAL_decode_aper;
-+per_type_encoder_f REAL_encode_aper;
- 
- /***********************************
-  * Some handy conversion routines. *
-Index: skeletons/NativeReal.c
-===================================================================
---- skeletons/NativeReal.c	(revision 1516)
-+++ skeletons/NativeReal.c	(working copy)
-@@ -32,6 +32,8 @@
- 	NativeReal_encode_xer,
- 	NativeReal_decode_uper,
- 	NativeReal_encode_uper,
-+	NativeReal_decode_aper,
-+	NativeReal_encode_aper,
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_NativeReal_tags,
- 	sizeof(asn_DEF_NativeReal_tags) / sizeof(asn_DEF_NativeReal_tags[0]),
-@@ -123,11 +125,11 @@
- 			tmp.size = length;
- 			memcpy(tmp.buf, buf_ptr, length);
- 			tmp.buf[tmp.size] = '\0';
--			if(asn_REAL2double(&tmp, &d)) {
--				rval.code = RC_FAIL;
--				rval.consumed = 0;
--				return rval;
--			}
-+		if(asn_REAL2double(&tmp, &d)) {
-+			rval.code = RC_FAIL;
-+			rval.consumed = 0;
-+			return rval;
-+		}
- 		} else {
- 			/* This should probably never happen: impractically long value */
- 			tmp.buf = CALLOC(1, length + 1);
-@@ -228,6 +230,43 @@
- 	return rval;
- }
- 
-+asn_dec_rval_t
-+NativeReal_decode_aper(asn_codec_ctx_t *opt_codec_ctx,
-+	asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints,
-+		void **dbl_ptr, asn_per_data_t *pd) {
-+	double *Dbl = (double *)*dbl_ptr;
-+	asn_dec_rval_t rval;
-+	REAL_t tmp;
-+	void *ptmp = &tmp;
-+	int ret;
-+
-+	(void)constraints;
-+
-+	/*
-+	 * If the structure is not there, allocate it.
-+	 */
-+	if(Dbl == NULL) {
-+		*dbl_ptr = CALLOC(1, sizeof(*Dbl));
-+		Dbl = (double *)*dbl_ptr;
-+		if(Dbl == NULL)
-+			_ASN_DECODE_FAILED;
-+	}
-+
-+	memset(&tmp, 0, sizeof(tmp));
-+	rval = OCTET_STRING_decode_aper(opt_codec_ctx, td, NULL,
-+			&ptmp, pd);
-+	if(rval.code != RC_OK) {
-+		ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_REAL, &tmp);
-+		return rval;
-+	}
-+
-+	ret = asn_REAL2double(&tmp, Dbl);
-+	ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_REAL, &tmp);
-+	if(ret) _ASN_DECODE_FAILED;
-+
-+	return rval;
-+}
-+
- /*
-  * Encode the NativeReal using the OCTET STRING PER encoder.
-  */
-@@ -257,6 +296,32 @@
- 	return erval;
- }
- 
-+asn_enc_rval_t
-+NativeReal_encode_aper(asn_TYPE_descriptor_t *td,
-+	asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-+	double Dbl = *(const double *)sptr;
-+	asn_enc_rval_t erval;
-+	REAL_t tmp;
-+
-+	(void)constraints;
-+
-+	/* Prepare a temporary clean structure */
-+	memset(&tmp, 0, sizeof(tmp));
-+
-+	if(asn_double2REAL(&tmp, Dbl))
-+		_ASN_ENCODE_FAILED;
-+
-+	/* Encode a DER REAL */
-+	erval = OCTET_STRING_encode_aper(td, NULL, &tmp, po);
-+	if(erval.encoded == -1)
-+		erval.structure_ptr = sptr;
-+
-+	/* Free possibly allocated members of the temporary structure */
-+	ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_REAL, &tmp);
-+
-+	return erval;
-+}
-+
- /*
-  * Decode the chunk of XML text encoding REAL.
-  */
-Index: skeletons/asn_system.h
-===================================================================
---- skeletons/asn_system.h	(revision 1516)
-+++ skeletons/asn_system.h	(working copy)
-@@ -21,6 +21,11 @@
- #include <stdarg.h>	/* For va_start */
- #include <stddef.h>	/* for offsetof and ptrdiff_t */
- 
-+#if HAVE_STDINT_H
-+# include <stdint.h>
-+# include <inttypes.h>
-+#endif
-+
- #ifdef	_WIN32
- 
- #include <malloc.h>
-Index: skeletons/ANY.h
-===================================================================
---- skeletons/ANY.h	(revision 1516)
-+++ skeletons/ANY.h	(working copy)
-@@ -32,10 +32,13 @@
- 
- /* Convert another ASN.1 type into the ANY. This implies DER encoding. */
- int ANY_fromType(ANY_t *, asn_TYPE_descriptor_t *td, void *struct_ptr);
-+int ANY_fromType_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr);
- ANY_t *ANY_new_fromType(asn_TYPE_descriptor_t *td, void *struct_ptr);
-+ANY_t *ANY_new_fromType_aper(asn_TYPE_descriptor_t *td, void *sptr);
- 
- /* Convert the contents of the ANY type into the specified type. */
- int ANY_to_type(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr);
-+int ANY_to_type_aper(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr);
- 
- #define	ANY_fromBuf(s, buf, size)	OCTET_STRING_fromBuf((s), (buf), (size))
- #define	ANY_new_fromBuf(buf, size)	OCTET_STRING_new_fromBuf(	\
-Index: skeletons/NativeReal.h
-===================================================================
---- skeletons/NativeReal.h	(revision 1516)
-+++ skeletons/NativeReal.h	(working copy)
-@@ -27,6 +27,8 @@
- xer_type_encoder_f NativeReal_encode_xer;
- per_type_decoder_f NativeReal_decode_uper;
- per_type_encoder_f NativeReal_encode_uper;
-+per_type_decoder_f NativeReal_decode_aper;
-+per_type_encoder_f NativeReal_encode_aper;
- 
- #ifdef __cplusplus
- }
-Index: skeletons/UniversalString.c
-===================================================================
---- skeletons/UniversalString.c	(revision 1516)
-+++ skeletons/UniversalString.c	(working copy)
-@@ -35,6 +35,8 @@
- 	UniversalString_encode_xer,	/* Convert into UTF-8 */
- 	OCTET_STRING_decode_uper,
- 	OCTET_STRING_encode_uper,
-+	OCTET_STRING_decode_aper,
-+	OCTET_STRING_encode_aper,
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_UniversalString_tags,
- 	sizeof(asn_DEF_UniversalString_tags)
-Index: skeletons/GraphicString.c
-===================================================================
---- skeletons/GraphicString.c	(revision 1516)
-+++ skeletons/GraphicString.c	(working copy)
-@@ -24,6 +24,8 @@
- 	OCTET_STRING_encode_xer,	/* Can't expect it to be ASCII/UTF8 */
- 	OCTET_STRING_decode_uper,    /* Implemented in terms of OCTET STRING */
- 	OCTET_STRING_encode_uper,
-+	OCTET_STRING_decode_aper,
-+	OCTET_STRING_encode_aper,
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_GraphicString_tags,
- 	sizeof(asn_DEF_GraphicString_tags)
-Index: skeletons/GeneralizedTime.c
-===================================================================
---- skeletons/GeneralizedTime.c	(revision 1516)
-+++ skeletons/GeneralizedTime.c	(working copy)
-@@ -167,6 +167,8 @@
- 	GeneralizedTime_encode_xer,
- 	OCTET_STRING_decode_uper,
- 	OCTET_STRING_encode_uper,
-+	OCTET_STRING_decode_aper,
-+	OCTET_STRING_encode_aper,
- 	0, /* Use generic outmost tag fetcher */
- 	asn_DEF_GeneralizedTime_tags,
- 	sizeof(asn_DEF_GeneralizedTime_tags)
-Index: libasn1compiler/asn1c_out.h
-===================================================================
---- libasn1compiler/asn1c_out.h	(revision 1516)
-+++ libasn1compiler/asn1c_out.h	(working copy)
-@@ -117,16 +117,24 @@
-  * Format LONG_MIN according to C90 rules.
-  */
- #define OINT(iv)	do {					\
--	if(iv == (-2147483647L - 1))				\
-+	if(iv > 4294967295U)						\
-+		OUT("%" PRIdASN"ULL", iv);			\
-+	else if(iv > 2147483647L)				\
-+		OUT("%" PRIdASN"U", iv);				\
-+	else if(iv == (-2147483647L - 1))		\
- 		OUT("(-2147483647L - 1)");			\
--	else							\
-+	else									\
- 		OUT("%" PRIdASN, iv);				\
- } while(0)
- 
- #define OINTS(iv)	do {					\
--	if(iv == (-2147483647L - 1))				\
-+	if(iv > 4294967295U)						\
-+		OUT("%" PRIdASN"ULL", iv);			\
-+	else if(iv > 2147483647L)				\
-+		OUT("%" PRIdASN"U", iv);				\
-+	else if(iv == (-2147483647L - 1))		\
- 		OUT("(-2147483647L - 1)");			\
--	else							\
-+	else									\
- 		OUT("% " PRIdASN, iv);				\
- } while(0)
- 
-Index: libasn1compiler/asn1compiler.h
-===================================================================
---- libasn1compiler/asn1compiler.h	(revision 1516)
-+++ libasn1compiler/asn1compiler.h	(working copy)
-@@ -77,7 +77,14 @@
- 	 * -fline-refs
- 	 * Include ASN.1 module's line numbers in comments.
- 	 */
--	A1C_LINE_REFS       = 0x20000
-+	A1C_LINE_REFS       = 0x20000,
-+ 	/*
-+	 * -fhave_native64
-+	 * Assume target platform has native 64bits support and generate types using
-+	 * int64_t or uint64_t whereas possible
-+	 */
-+	A1C_HAVE_NATIVE_64	= 0x40000
-+
- };
- 
- /*
-Index: libasn1compiler/asn1c_C.c
-===================================================================
---- libasn1compiler/asn1c_C.c	(revision 1516)
-+++ libasn1compiler/asn1c_C.c	(working copy)
-@@ -1242,6 +1242,8 @@
- 	OUT("td->xer_encoder    = asn_DEF_%s.xer_encoder;\n",    type_name);
- 	OUT("td->uper_decoder   = asn_DEF_%s.uper_decoder;\n",   type_name);
- 	OUT("td->uper_encoder   = asn_DEF_%s.uper_encoder;\n",   type_name);
-+	OUT("td->aper_decoder   = asn_DEF_%s.aper_decoder;\n",   type_name);
-+	OUT("td->aper_encoder   = asn_DEF_%s.aper_encoder;\n",   type_name);
- 	if(!terminal && !tags_count) {
- 	  OUT("/* The next four lines are here because of -fknown-extern-type */\n");
- 	  OUT("td->tags           = asn_DEF_%s.tags;\n",         type_name);
-@@ -1394,6 +1396,38 @@
- 	);
- 	OUT("}\n");
- 	OUT("\n");
-+
-+	p = MKID(expr);
-+	if(HIDE_INNER_DEFS) OUT("static ");
-+							OUT("asn_enc_rval_t\n");
-+	OUT("%s", p);
-+	if(HIDE_INNER_DEFS) OUT("_%d", expr->_type_unique_index);
-+		OUT("_encode_aper(asn_TYPE_descriptor_t *td,\n");
-+	INDENTED(
-+	OUT("\tasn_per_constraints_t *constraints,\n");
-+	OUT("\tvoid *structure, asn_per_outp_t *per_out) {\n");
-+	OUT("%s_%d_inherit_TYPE_descriptor(td);\n",
-+		p, expr->_type_unique_index);
-+	OUT("return td->aper_encoder(td, constraints, structure, per_out);\n");
-+	);
-+	OUT("}\n");
-+	OUT("\n");
-+
-+	p = MKID(expr);
-+	
-+	if(HIDE_INNER_DEFS) OUT("static ");
-+	OUT("asn_dec_rval_t\n");
-+	OUT("%s", p);
-+	if(HIDE_INNER_DEFS) OUT("_%d", expr->_type_unique_index);
-+	OUT("_decode_aper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,\n");
-+	INDENTED(
-+		OUT("\tasn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {\n");
-+	OUT("%s_%d_inherit_TYPE_descriptor(td);\n",
-+		p, expr->_type_unique_index);
-+	OUT("return td->aper_decoder(opt_codec_ctx, td, constraints, structure, per_data);\n");
-+	);
-+	OUT("}\n");
-+	OUT("\n");
-   }
- 
- 	REDIR(OT_FUNC_DECLS);
-@@ -1415,6 +1449,8 @@
- 		if(arg->flags & A1C_GEN_PER) {
- 		OUT("per_type_decoder_f %s_decode_uper;\n", p);
- 		OUT("per_type_encoder_f %s_encode_uper;\n", p);
-+		OUT("per_type_decoder_f %s_decode_aper;\n", p);
-+		OUT("per_type_encoder_f %s_encode_aper;\n", p);
- 		}
- 	}
- 
-@@ -1670,12 +1706,11 @@
- 		OUT("%d, ", tag2el[i].el_no);
- 		OUT("%d, ", tag2el[i].toff_first);
- 		OUT("%d ", tag2el[i].toff_last);
--		OUT("}%s /* %s",
-+		OUT("}%s /* %s at %d */\n",
- 			(i + 1 < tag2el_count) ? "," : "",
--			tag2el[i].from_expr->Identifier);
--        if(arg->flags & A1C_LINE_REFS)
--            OUT("at %d", tag2el[i].from_expr->_lineno);
--        OUT(" */\n");
-+			tag2el[i].from_expr->Identifier,
-+			tag2el[i].from_expr->_lineno
-+		);
- 	}
- 	OUT("};\n");
- 
-@@ -2111,19 +2146,22 @@
- try_inline_default(arg_t *arg, asn1p_expr_t *expr, int out) {
- 	int save_target = arg->target->target;
- 	asn1p_expr_type_e etype = expr_get_type(arg, expr);
--	int fits_long = 0;
-+// 	int fits_long = 0;
-+	enum asn1c_fitslong_e fits = FL_NOTFIT;
- 
- 	switch(etype) {
- 	case ASN_BASIC_BOOLEAN:
--		fits_long = 1;
-+// 		fits_long = 1;
-+		fits = FL_FITS_SIGNED;
- 	case ASN_BASIC_INTEGER:
- 	case ASN_BASIC_ENUMERATED:
- 		if(expr->marker.default_value == NULL
- 		|| expr->marker.default_value->type != ATV_INTEGER)
- 			break;
--		if(!fits_long)
--			fits_long = asn1c_type_fits_long(arg, expr)!=FL_NOTFIT;
--		if(fits_long && !expr->marker.default_value->value.v_integer)
-+		if(fits == FL_NOTFIT)
-+// 			fits_long = asn1c_type_fits_long(arg, expr)!=FL_NOTFIT;
-+			fits = asn1c_type_fits_long(arg, expr);
-+		if(fits != FL_NOTFIT && !expr->marker.default_value->value.v_integer)
- 			expr->marker.flags &= ~EM_INDIRECT;
- 		if(!out) {
- 			OUT("asn_DFL_%d_set_%" PRIdASN
-@@ -2150,7 +2188,7 @@
- 		INDENT(+1);
- 		OUT("/* Install default value %" PRIdASN " */\n",
- 			expr->marker.default_value->value.v_integer);
--		if(fits_long) {
-+		if(fits != FL_NOTFIT) {
- 			OUT("*st = ");
- 			OINT(expr->marker.default_value->value.v_integer);
- 			OUT(";\n");
-@@ -2165,7 +2203,7 @@
- 		INDENT(+1);
- 		OUT("/* Test default value %" PRIdASN " */\n",
- 			expr->marker.default_value->value.v_integer);
--		if(fits_long) {
-+		if(fits != FL_NOTFIT) {
- 			OUT("return (*st == %" PRIdASN ");\n",
- 				expr->marker.default_value->value.v_integer);
- 		} else {
-@@ -2455,9 +2493,13 @@
- 		if(arg->flags & A1C_GEN_PER) {
- 			FUNCREF(decode_uper);
- 			FUNCREF(encode_uper);
-+			FUNCREF(decode_aper);
-+			FUNCREF(encode_aper);
- 		} else {
--			OUT("0, 0,\t/* No PER support, "
-+			OUT("0, 0,\t/* No UPER support, "
- 				"use \"-gen-PER\" to enable */\n");
-+			OUT("0, 0,\t/* No APER support, "
-+				"use \"-gen-PER\" to enable */\n");
- 		}
- 
- 		if(!terminal || terminal->expr_type == ASN_CONSTR_CHOICE) {
-Index: libasn1compiler/asn1c_constraint.c
-===================================================================
---- libasn1compiler/asn1c_constraint.c	(revision 1516)
-+++ libasn1compiler/asn1c_constraint.c	(working copy)
-@@ -35,6 +35,7 @@
- 	int alphabet_table_compiled;
- 	int produce_st = 0;
- 	int ulong_optimize = 0;
-+	enum asn1c_fitslong_e fits = FL_NOTFIT;
- 
- 	ct = expr->combined_constraints;
- 	if(ct == NULL)
-@@ -74,7 +75,8 @@
- 	switch(etype) {
- 	case ASN_BASIC_INTEGER:
- 	case ASN_BASIC_ENUMERATED:
--		if(asn1c_type_fits_long(arg, arg->expr) == FL_NOTFIT)
-+		fits = asn1c_type_fits_long(arg, arg->expr);
-+		if(fits == FL_NOTFIT)
- 			produce_st = 1;
- 		break;
- 	case ASN_BASIC_REAL:
-@@ -103,13 +105,19 @@
- 			switch(etype) {
- 			case ASN_BASIC_INTEGER:
- 			case ASN_BASIC_ENUMERATED:
--				if(native_long_sign(r_value) >= 0) {
--					ulong_optimize = ulong_optimization(etype, r_size, r_value);
--					if(!ulong_optimize) {
--						OUT("unsigned long value;\n");
-+				if(fits == FL_FITS_INT64) {
-+					OUT("int64_t value;\n");
-+				} else if(fits == FL_FITS_UINT64) {
-+					OUT("uint64_t value;\n");
-+				} else {
-+					if(native_long_sign(r_value) >= 0) {
-+						ulong_optimize = ulong_optimization(etype, r_size, r_value);
-+						if(!ulong_optimize) {
-+							OUT("unsigned long value;\n");
-+						}
-+					} else {
-+						OUT("long value;\n");
- 					}
--				} else {
--					OUT("long value;\n");
- 				}
- 				break;
- 			case ASN_BASIC_REAL:
-@@ -603,13 +611,19 @@
- 
- static int
- emit_value_determination_code(arg_t *arg, asn1p_expr_type_e etype, asn1cnst_range_t *r_value) {
-+	enum asn1c_fitslong_e fits = FL_NOTFIT;
- 
- 	switch(etype) {
- 	case ASN_BASIC_INTEGER:
- 	case ASN_BASIC_ENUMERATED:
--		if(asn1c_type_fits_long(arg, arg->expr) == FL_FITS_UNSIGN) {
-+		fits = asn1c_type_fits_long(arg, arg->expr);
-+		if(fits == FL_FITS_INT64) {
-+			OUT("value = *(const int64_t *)sptr;\n");
-+		} else if(fits == FL_FITS_UINT64) {
-+			OUT("value = *(const uint64_t *)sptr;\n");
-+		} else if(fits == FL_FITS_UNSIGN) {
- 			OUT("value = *(const unsigned long *)sptr;\n");
--		} else if(asn1c_type_fits_long(arg, arg->expr) != FL_NOTFIT) {
-+		} else if(fits != FL_NOTFIT) {
- 			OUT("value = *(const long *)sptr;\n");
- 		} else {
- 			/*
-Index: libasn1compiler/asn1c_misc.c
-===================================================================
---- libasn1compiler/asn1c_misc.c	(revision 1516)
-+++ libasn1compiler/asn1c_misc.c	(working copy)
-@@ -158,6 +158,7 @@
- 	asn1p_expr_t *terminal;
- 	int stdname = 0;
- 	char *typename;
-+	enum asn1c_fitslong_e fits;
- 
- 	/* Rewind to the topmost parent expression */
- 	if((top_parent = expr->parent_expr))
-@@ -213,15 +214,20 @@
- 	case ASN_BASIC_INTEGER:
- 	case ASN_BASIC_ENUMERATED:
- 	case ASN_BASIC_REAL:
-+		fits = asn1c_type_fits_long(arg, expr);
- 		if((expr->expr_type == ASN_BASIC_REAL
- 			&& !(arg->flags & A1C_USE_WIDE_TYPES))
--		|| asn1c_type_fits_long(arg, expr)) {
-+			|| (fits != FL_NOTFIT)) {
- 			switch(_format) {
- 			case TNF_CTYPE:
- 			case TNF_RSAFE:
- 				if(expr->expr_type == ASN_BASIC_REAL)
- 					return "double";
--				else if(asn1c_type_fits_long(arg, expr) == FL_FITS_UNSIGN)
-+				else if (fits == FL_FITS_INT64)
-+					return "int64_t";
-+				else if (fits == FL_FITS_UINT64)
-+					return "uint64_t";
-+				else if(fits == FL_FITS_UNSIGN)
- 					return "unsigned long";
- 				else
- 					return "long";
-@@ -377,11 +383,33 @@
- 	/* Special case for unsigned */
- 	if(left.type == ARE_VALUE
- 		&& left.value >= 0
--	&& right.type == ARE_VALUE
-+		&& right.type == ARE_VALUE
- 		&& right.value > 2147483647
- 		&& right.value <= 4294967295UL)
- 		return FL_FITS_UNSIGN;
--		
-+	/* Special for native 64 bits integer option */
-+	if (arg->flags & A1C_HAVE_NATIVE_64) {
-+// 		printf("left.value %lld right.value %lld\n", left.value, right.value);
-+		if(left.type == ARE_VALUE
-+			&& left.value >= 0
-+			&& right.type == ARE_VALUE
-+			&& right.value > 9223372036854775807LL
-+			&& right.value <= 18446744073709551615ULL)
-+			return FL_FITS_UINT64;
-+		if(left.type == ARE_VALUE
-+			&& left.value < -2147483648
-+			&& left.value >= -9223372036854775808LL
-+			&& right.type == ARE_VALUE
-+			&& right.value > 2147483647
-+			&& right.value <= 9223372036854775807LL)
-+			return FL_FITS_INT64;
-+		if(left.type == ARE_VALUE
-+			&& left.value >= 0
-+			&& right.type == ARE_VALUE
-+			&& right.value > 4294967295UL
-+			&& right.value <= 9223372036854775807LL)
-+			return FL_FITS_INT64;
-+	}
- 
- 	/* If some fixed value is outside of target range, not fit */
- 	if(left.type == ARE_VALUE
-Index: libasn1compiler/asn1c_misc.h
-===================================================================
---- libasn1compiler/asn1c_misc.h	(revision 1516)
-+++ libasn1compiler/asn1c_misc.h	(working copy)
-@@ -36,6 +36,8 @@
-  */
- enum asn1c_fitslong_e {
- 	FL_NOTFIT,
-+	FL_FITS_INT64,
-+	FL_FITS_UINT64,
- 	FL_FITS_SIGNED,
- 	FL_FITS_UNSIGN,
- 	FL_PRESUMED,
diff --git a/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_2.p0 b/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_2.p0
deleted file mode 100644
index 80835b1b86621a62fde0dda589135082c142ed93..0000000000000000000000000000000000000000
--- a/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_2.p0
+++ /dev/null
@@ -1,22 +0,0 @@
---- skeletons/OCTET_STRING.c.orig	2015-04-28 10:40:04.036970492 +0200
-+++ skeletons/OCTET_STRING.c	2015-04-28 10:40:09.619970869 +0200
-@@ -159,7 +159,7 @@
- }
- 
- static struct _stack *
--_new_stack() {
-+_new_stack(void) {
- 	return (struct _stack *)CALLOC(1, sizeof(struct _stack));
- }
- 
---- skeletons/converter-sample.c.orig	2015-04-28 10:40:32.164972391 +0200
-+++ skeletons/converter-sample.c	2015-04-28 10:40:37.140972727 +0200
-@@ -353,7 +353,7 @@
- } DynamicBuffer;
- 
- static void
--buffer_dump() {
-+buffer_dump(void) {
- 	uint8_t *p = DynamicBuffer.data + DynamicBuffer.offset;
- 	uint8_t *e = p + DynamicBuffer.length - (DynamicBuffer.unbits ? 1 : 0);
- 	if(!opt_debug) return;
diff --git a/openair3/S1AP/MESSAGES/ASN1/asn1tostruct.py b/openair3/S1AP/MESSAGES/ASN1/asn1tostruct.py
index c298e8ae87e3f0a5af5ed860a57906ad1caf4060..446266d6a3779703c89e70926e4cb2130d99b5da 100644
--- a/openair3/S1AP/MESSAGES/ASN1/asn1tostruct.py
+++ b/openair3/S1AP/MESSAGES/ASN1/asn1tostruct.py
@@ -36,7 +36,7 @@ def outputHeaderToFile(f, filename):
     f.write("""/*******************************************************************************
 
   Eurecom OpenAirInterface
-  Copyright(c) 1999 - 2013 Eurecom
+  Copyright(c) 1999 - 2015 Eurecom
 
   This program is free software; you can redistribute it and/or modify it
   under the terms and conditions of the GNU General Public License,
@@ -250,20 +250,31 @@ for key in iesDefs:
     asn1cStruct = re.sub('Item', 'List', asn1cStruct)
     keylowerunderscore = re.sub('-', '_', key.lower())
     firstlower = re.sub('Item', 'List', re.sub('enb', 'eNB', lowerFirstCamelWord(asn1cStruct)))
+
+    f.write("/* %s in iesDefs not in ieofielist.values()  */\n" % (key))
     f.write("/** \\brief Decode function for %s ies.\n" % (key))
     if len(iesDefs[key]["ies"]) != 0:
         f.write(" * \\param %s Pointer to ASN1 structure in which data will be stored\n" % (lowerFirstCamelWord(re.sub('-', '_', key))))
     f.write(" *  \\param any_p Pointer to the ANY value to decode.\n")
     f.write(" **/\n")
     f.write("int %s_decode_%s(\n" % (fileprefix, keylowerunderscore))
-
     if len(iesDefs[key]["ies"]) != 0:
         f.write("    %s_t *%s,\n" % (re.sub('-', '_', key), lowerFirstCamelWord(re.sub('-', '_', key))))
     f.write("    ANY_t *any_p);\n\n")
 
+    f.write("/* %s in iesDefs not in ieofielist.values()  */\n" % (key))
+    f.write("/** \\brief Compare function for %s ies.\n" % (key))
+    f.write(" *  \\param %s Pointer to the ASN1 structure.\n" % (firstlower))
+    f.write(" *  \\param %s Pointer to the ASN1 structure.\n" % (firstlower))
+    f.write(" **/\n")
+    f.write("asn_comp_rval_t *  %s_compare_%s(\n" % (fileprefix, keylowerunderscore))
+    f.write("    %s_t *%s1,\n" % (re.sub('-', '_', key), lowerFirstCamelWord(re.sub('-', '_', key))))
+    f.write("    %s_t *%s2);\n\n" % (re.sub('-', '_', key), lowerFirstCamelWord(re.sub('-', '_', key))))
+
     if len(iesDefs[key]["ies"]) == 0:
         continue
 
+    f.write("/* %s in iesDefs not in ieofielist.values()  */\n" % (key))
     f.write("/** \\brief Encode function for %s ies.\n" % (key))
     f.write(" *  \\param %s Pointer to the ASN1 structure.\n" % (firstlower))
     f.write(" *  \\param %s Pointer to the IES structure.\n" % (lowerFirstCamelWord(re.sub('-', '_', key))))
@@ -272,16 +283,19 @@ for key in iesDefs:
     f.write("    %s_t *%s,\n" % (asn1cStruct, firstlower))
     f.write("    %s_t *%s);\n\n" % (re.sub('-', '_', key), lowerFirstCamelWord(re.sub('-', '_', key))))
 
+
 for key in iesDefs:
     if key not in ieofielist.values():
         continue
     asn1cStruct = re.sub('-', '_', re.sub('IEs', '', key))
     asn1cStruct = re.sub('Item', 'List', asn1cStruct)
     firstlower = re.sub('Item', 'List', re.sub('enb', 'eNB', lowerFirstCamelWord(asn1cStruct)))
+    f.write("/* %s in iesDefs in ieofielist.values()  */\n" % (key))
     f.write("/** \\brief Encode function for %s ies.\n" % (key))
     f.write(" *  \\param %s Pointer to the ASN1 structure.\n" % (firstlower))
     f.write(" *  \\param %s Pointer to the IES structure.\n" % (lowerFirstCamelWord(re.sub('-', '_', key))))
     f.write(" **/\n")
+    f.write("/* %s in iesDefs in ieofielist.values()  */\n" % (key))
     f.write("int %s_encode_%s(\n" % (fileprefix, firstlower.lower()))
     f.write("    %s_t *%s,\n" % (asn1cStruct, firstlower))
     f.write("    %sIEs_t *%sIEs);\n\n" % (asn1cStruct, firstlower))
@@ -289,9 +303,19 @@ for key in iesDefs:
     f.write(" *  \\param any_p Pointer to the ANY value to decode.\n")
     f.write(" *  \\param callback Callback function called when any_p is successfully decoded.\n")
     f.write(" **/\n")
+    f.write("/* %s in iesDefs in ieofielist.values()  */\n" % (key))
     f.write("int %s_decode_%s(\n" % (fileprefix, firstlower.lower()))
     f.write("    %sIEs_t *%sIEs,\n" % (asn1cStruct, firstlower))
     f.write("    %s_t *%s);\n\n" % (asn1cStruct, lowerFirstCamelWord(asn1cStruct)))
+    f.write("/** \\brief Compare function for %s ies.\n" % (key))
+    f.write(" *  \\param %s Pointer to the IES structure.\n" % (firstlower))
+    f.write(" *  \\param %s Pointer to the IES structure.\n" % (firstlower))
+    f.write(" **/\n")
+    f.write("asn_comp_rval_t *  %s_compare_%s(\n" % (fileprefix, firstlower.lower()))
+    f.write("    %sIEs_t *%s1,\n"    % (asn1cStruct, firstlower))
+    f.write("    %sIEs_t *%s2);\n\n" % (asn1cStruct, firstlower))
+
+
 
 for key in iesDefs:
     asn1cStruct = re.sub('-', '_', re.sub('IEs', '', key))
@@ -704,3 +728,170 @@ for (key, value) in iesDefs.items():
         #f.write("cb_failed:\n")
         #f.write("    return er;\n")
     f.write("}\n\n")
+
+
+#Generate xer print functions
+f = open(outdir + fileprefix + '_compare.c', 'w')
+outputHeaderToFile(f, filename)
+f.write("#include <stdlib.h>\n")
+f.write("#include <stdio.h>\n\n")
+f.write("#include <asn_application.h>\n#include <asn_internal.h>\n\n")
+f.write("#include \"%s_common.h\"\n#include \"%s_ies_defs.h\"\n" % (fileprefix, fileprefix))
+f.write("#include \"%s-ProtocolIE-ID.h\"\n\n" % (fileprefix_first_upper))
+
+
+for key in iesDefs:
+    if key in ieofielist.values():
+        continue
+    structName = re.sub('ies', '', key)
+    asn1cStruct = re.sub('-', '_', re.sub('IEs', '', key))
+    asn1cStruct = re.sub('Item', 'List', asn1cStruct)
+    if asn1cStruct.rfind('_') == len(asn1cStruct) - 1:
+        asn1cStruct = asn1cStruct[:-1]
+    asn1cStructfirstlower = asn1cStruct[:1].lower() + asn1cStruct[1:]
+    firstwordlower = re.sub('Item', 'List', re.sub('enb', 'eNB', lowerFirstCamelWord(asn1cStruct)))
+
+    iesaccess = ""
+    if key not in ieofielist.values():
+        iesaccess = "%s_ies." % (firstwordlower)
+
+    keyName = re.sub('-', '_', key)
+    keyupperunderscore = keyName.upper()
+    # No IE to encode...
+    if len(iesDefs[key]["ies"]) == 0:
+        continue
+
+    f.write("asn_comp_rval_t * %s_compare_%s(\n" % (fileprefix, re.sub('-', '_', structName.lower())))
+    f.write("    %s_t *%s1,\n" % (re.sub('-', '_', key), lowerFirstCamelWord(re.sub('-', '_', key))))
+    f.write("    %s_t *%s2) {\n\n" % (re.sub('-', '_', key), lowerFirstCamelWord(re.sub('-', '_', key))))
+
+    f.write("    asn_comp_rval_t *rv = NULL;\n\n")
+    f.write("    asn_comp_rval_t *rv2 = NULL;\n\n")
+
+    f.write("    assert(%s1 != NULL);\n" % (lowerFirstCamelWord(re.sub('-', '_', key))));
+    f.write("    assert(%s2 != NULL);\n" % (lowerFirstCamelWord(re.sub('-', '_', key))));
+
+    loop = 0
+    for ie in iesDefs[key]["ies"]:
+        iename = re.sub('-', '_', re.sub('id-', '', ie[0]))
+        ienameunderscore = re.sub('-', '_', iename)
+        ienamefirstwordlower = lowerFirstCamelWord(iename)
+        ieupperunderscore = re.sub('-', '_', re.sub('id-', '', ie[0])).upper()
+        ietypeunderscore = re.sub('-', '_', ie[2])
+
+        if ie[3] != "mandatory":
+
+            loop = loop + 1
+            if loop == 1:
+                #f.write("    %s_IE_t *ie1 = NULL;\n" % (fileprefix_first_upper))
+                #f.write("    %s_IE_t *ie2 = NULL;\n" % (fileprefix_first_upper))
+                f.write("    if (%s1->presenceMask != %s2->presenceMask) {rv=calloc(1,sizeof(asn_comp_rval_t));rv->name = asn_DEF_%s.name;rv->structure1 = %s1;rv->structure2 = %s2;rv->err_code = COMPARE_ERR_CODE_VALUE_NULL; return rv;}\n" % (lowerFirstCamelWord(re.sub('-', '_', key)), lowerFirstCamelWord(re.sub('-', '_', key)), ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', key)), lowerFirstCamelWord(re.sub('-', '_', key))))
+
+            if ie[3] == "optional":
+                f.write("    /* Optional field */\n")
+            elif ie[3] == "conditional":
+                f.write("    /* Conditional field */\n")
+            f.write("    if (%s1->presenceMask & %s_%s_PRESENT) {\n" % (lowerFirstCamelWord(re.sub('-', '_', key)), keyupperunderscore, ieupperunderscore))
+
+
+            if ie[2] in ieofielist.keys():
+                f.write("        /* collection field */\n")
+                f.write("        rv2 = %s_compare_%s(&%s1->%s, &%s2->%s);\n" % (fileprefix, ietypeunderscore.lower(), lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower ))
+                f.write("        if(rv2) {")
+                f.write("          if (NULL == rv) {")
+                f.write("            rv = rv2;")
+                f.write("          } else {")
+                f.write("            rv2->next = rv;")
+                f.write("            rv = rv2;")
+                f.write("          }")
+                f.write("          rv2 = NULL;")
+                f.write("        }")
+            else:
+                f.write("        /* simple field */\n")
+                f.write("        rv2 = asn_DEF_%s.compare(&asn_DEF_%s, &%s1->%s, &asn_DEF_%s, &%s2->%s); \n" % (ietypeunderscore, ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower, ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower ))
+                f.write("        if (rv2) {")
+                f.write("          if (NULL == rv) {")
+                f.write("            rv = rv2;")
+                f.write("          } else {")
+                f.write("            rv2->next = rv;")
+                f.write("            rv = rv2;")
+                f.write("          }")
+                f.write("          rv2 = NULL;")
+                f.write("          if (!rv->name) rv->name = asn_DEF_%s.name;" % (ietypeunderscore))
+                f.write("        }")
+
+            f.write("        assert(0);\n");
+            f.write("    }\n\n")
+
+        else:
+            if ie[2] in ieofielist.keys():
+                f.write("    /* Mandatory collection field */\n")
+                f.write("    rv2 = %s_compare_%s(&%s1->%s, &%s2->%s);\n" % (fileprefix, ietypeunderscore.lower(), lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower ))
+                f.write("    if (rv2) {\n")
+                f.write("      if (NULL == rv) {\n")
+                f.write("        rv = rv2;\n")
+                f.write("      } else {\n")
+                f.write("        rv2->next = rv;\n")
+                f.write("        rv = rv2;\n")
+                f.write("      }\n")
+                f.write("      rv2 = NULL;\n")
+                f.write("    }\n")
+
+            else:
+                f.write("    /* Mandatory simple field */\n")
+                f.write("    rv2 = asn_DEF_%s.compare(&asn_DEF_%s, &%s1->%s, &asn_DEF_%s, &%s2->%s);\n" % (ietypeunderscore, ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower, ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', key)), ienamefirstwordlower ))
+                f.write("    if(rv2) {\n")
+                f.write("      if (NULL == rv) {\n")
+                f.write("        rv = rv2;\n")
+                f.write("      } else {\n")
+                f.write("        rv2->next = rv;\n")
+                f.write("        rv = rv2;\n")
+                f.write("      }\n")
+                f.write("      rv2 = NULL;\n")
+                f.write("      if (!rv->name) rv->name = asn_DEF_%s.name;\n" % (ietypeunderscore))
+                f.write("    }\n")
+    f.write("    return rv;\n")
+    f.write("}\n\n")
+
+for (key, value) in iesDefs.items():
+    if key not in ieofielist.values():
+        continue
+
+    ie = value["ies"][0]
+    ietypeunderscore = re.sub('-', '_', ie[2])
+    asn1cStruct = re.sub('-', '_', re.sub('IEs', '', re.sub('-IEs', '', key)))
+    asn1cStruct = re.sub('Item', 'List', asn1cStruct)
+    firstwordlower = re.sub('Item', 'List', re.sub('enb', 'eNB', lowerFirstCamelWord(asn1cStruct)))
+
+    for (i, j) in ieofielist.items():
+        if j == key:
+            break
+
+    f.write("extern asn_TYPE_descriptor_t asn_DEF_%s;\n" % (ietypeunderscore))
+
+    f.write("asn_comp_rval_t * %s_compare_%s(\n" % (fileprefix, re.sub('-', '_', i).lower()))
+    f.write("    %sIEs_t *%sIEs1,\n" % (re.sub('-', '_', i), lowerFirstCamelWord(re.sub('-', '_', i))))
+    f.write("    %sIEs_t *%sIEs2) {\n\n" % (re.sub('-', '_', i), lowerFirstCamelWord(re.sub('-', '_', i))))
+    f.write("    int i;\n")
+    f.write("    asn_comp_rval_t *rv = NULL;\n\n")
+    f.write("    asn_comp_rval_t *rv2 = NULL;\n\n")
+
+
+    f.write("    assert(%sIEs1 != NULL);\n" % (lowerFirstCamelWord(re.sub('-', '_', i))));
+    f.write("    assert(%sIEs2 != NULL);\n\n" % (lowerFirstCamelWord(re.sub('-', '_', i))));
+
+    f.write("    for (i = 0; i < %sIEs1->%s.count; i++) {\n" % (lowerFirstCamelWord(re.sub('-', '_', i)), re.sub('IEs', '', lowerFirstCamelWord(re.sub('-', '_', key)))))
+    f.write("        rv2 = asn_DEF_%s.compare(&asn_DEF_%s, %sIEs1->%s.array[i], &asn_DEF_%s, %sIEs2->%s.array[i]);\n" % (ietypeunderscore, ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', i)), re.sub('IEs', '', lowerFirstCamelWord(re.sub('-', '_', key))), ietypeunderscore, lowerFirstCamelWord(re.sub('-', '_', i)), re.sub('IEs', '', lowerFirstCamelWord(re.sub('-', '_', key)))))
+    f.write("        if(rv2) {")
+    f.write("          if (NULL == rv) {")
+    f.write("            rv = rv2;")
+    f.write("          } else {")
+    f.write("            rv2->next = rv;")
+    f.write("            rv = rv2;")
+    f.write("          }")
+    f.write("          rv2 = NULL;")
+    f.write("        }")
+    f.write("    }\n")
+    f.write("    return rv;\n")
+    f.write("}\n\n")
+
diff --git a/openair3/S1AP/s1ap_eNB.c b/openair3/S1AP/s1ap_eNB.c
index c880c3f3b4bd14ec45b217df4a1ffb6be346a5d9..1b683d4aa3441c24dfcd3f175b12d251fcf693f3 100644
--- a/openair3/S1AP/s1ap_eNB.c
+++ b/openair3/S1AP/s1ap_eNB.c
@@ -72,9 +72,9 @@ s1ap_eNB_config_t s1ap_config;
 static int s1ap_eNB_generate_s1_setup_request(
   s1ap_eNB_instance_t *instance_p, s1ap_eNB_mme_data_t *s1ap_mme_data_p);
 
-static
+
 void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *s1ap_register_eNB);
-static
+
 void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp);
 
 uint32_t s1ap_generate_eNB_id(void)
@@ -150,7 +150,7 @@ static void s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p,
   itti_send_msg_to_task(TASK_SCTP, instance_p->instance, message_p);
 }
 
-static
+
 void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *s1ap_register_eNB)
 {
   s1ap_eNB_instance_t *new_instance;
@@ -210,7 +210,6 @@ void s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *
   }
 }
 
-static
 void s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp)
 {
   s1ap_eNB_instance_t *instance_p;
diff --git a/openair3/S1AP/s1ap_eNB_handlers.c b/openair3/S1AP/s1ap_eNB_handlers.c
index 2f6fc5421fe28663c1f6318d71c9f5ae21d59df4..606c43606966c74b69c8d5b8fa4d5b67908a87a0 100644
--- a/openair3/S1AP/s1ap_eNB_handlers.c
+++ b/openair3/S1AP/s1ap_eNB_handlers.c
@@ -859,11 +859,12 @@ int s1ap_eNB_handle_ue_context_release_command(uint32_t               assoc_id,
 
     break;
 
-#warning "TODO mapping mme_ue_s1ap_id  enb_ue_s1ap_id?"
+//#warning "TODO mapping mme_ue_s1ap_id  enb_ue_s1ap_id?"
 
   case S1ap_UE_S1AP_IDs_PR_mME_UE_S1AP_ID:
     mme_ue_s1ap_id = ueContextReleaseCommand_p->uE_S1AP_IDs.choice.mME_UE_S1AP_ID;
     S1AP_ERROR("TO DO mapping mme_ue_s1ap_id  enb_ue_s1ap_id");
+    (void)mme_ue_s1ap_id; /* TODO: remove - it's to remove gcc warning about unused var */
 
   case S1ap_UE_S1AP_IDs_PR_NOTHING:
   default:
diff --git a/openair3/S1AP/s1ap_eNB_nas_procedures.c b/openair3/S1AP/s1ap_eNB_nas_procedures.c
index 0cd4c08cb1244d2ab1a53bf3a2a3ccbbe7fecac0..43f5ad49e53f40edd3d5dd72836ed0df9bfc27ff 100644
--- a/openair3/S1AP/s1ap_eNB_nas_procedures.c
+++ b/openair3/S1AP/s1ap_eNB_nas_procedures.c
@@ -191,7 +191,7 @@ int s1ap_eNB_handle_nas_first_req(
    * The cell identity is defined on 28 bits but as we use macro enb id,
    * we have to pad.
    */
-#warning "TODO get cell id from RRC"
+//#warning "TODO get cell id from RRC"
   MACRO_ENB_ID_TO_CELL_IDENTITY(instance_p->eNB_id,
 		  0, // Cell ID
           &initial_ue_message_p->eutran_cgi.cell_ID);
@@ -400,7 +400,7 @@ int s1ap_eNB_nas_uplink(instance_t instance, s1ap_uplink_nas_t *s1ap_uplink_nas_
     s1ap_eNB_instance_p->mnc_digit_length,
     &uplink_NAS_transport_p->eutran_cgi.pLMNidentity);
 
-#warning "TODO get cell id from RRC"
+//#warning "TODO get cell id from RRC"
   MACRO_ENB_ID_TO_CELL_IDENTITY(s1ap_eNB_instance_p->eNB_id,
           0,
           &uplink_NAS_transport_p->eutran_cgi.cell_ID);
@@ -668,6 +668,8 @@ int s1ap_eNB_ue_capabilities(instance_t instance,
     return -1;
   }
 
+  free(ue_cap_info_ind_p->ue_radio_cap.buffer);
+
   MSC_LOG_TX_MESSAGE(
     MSC_S1AP_ENB,
     MSC_S1AP_MME,
diff --git a/openair3/SCTP/sctp_eNB_task.c b/openair3/SCTP/sctp_eNB_task.c
index c1e7d989e996e2eeec3b181fd0aaa795b39f98f6..6812c6bce3f97053ef634ad0f5d70a639b7b8638 100644
--- a/openair3/SCTP/sctp_eNB_task.c
+++ b/openair3/SCTP/sctp_eNB_task.c
@@ -100,6 +100,7 @@ static STAILQ_HEAD(sctp_cnx_list_head, sctp_cnx_list_elm_s) sctp_cnx_list;
 static uint16_t sctp_nb_cnx = 0;
 
 
+//------------------------------------------------------------------------------
 struct sctp_cnx_list_elm_s *sctp_get_cnx(int32_t assoc_id, int sd)
 {
   struct sctp_cnx_list_elm_s *elm;
@@ -119,6 +120,7 @@ struct sctp_cnx_list_elm_s *sctp_get_cnx(int32_t assoc_id, int sd)
   return NULL;
 }
 
+//------------------------------------------------------------------------------
 void
 sctp_handle_new_association_req(
   const instance_t instance,
@@ -146,7 +148,7 @@ sctp_handle_new_association_req(
   DevAssert(sctp_new_association_req_p != NULL);
 
   /* Create new socket with IPv6 affinity */
-#warning "SCTP may Force IPv4 only, here"
+//#warning "SCTP may Force IPv4 only, here"
 #ifdef NO_VIRTUAL_MACHINE
 
   // in init chunk appears a list of host addresses, IPv4 and IPv4 in an arbitrary (unsorted) order
@@ -388,6 +390,7 @@ sctp_handle_new_association_req(
              sd, sctp_nb_cnx, assoc_id);
 }
 
+  //------------------------------------------------------------------------------
 void sctp_send_data(
   instance_t       instance,
   task_id_t        task_id,
@@ -430,6 +433,7 @@ void sctp_send_data(
              sctp_cnx->assoc_id);
 }
 
+//------------------------------------------------------------------------------
 static int sctp_close_association(
   const instance_t instance,
   const task_id_t  requestor,
@@ -456,6 +460,7 @@ static int sctp_close_association(
   return 0;
 }
 
+//------------------------------------------------------------------------------
 static int sctp_create_new_listener(
   const instance_t instance,
   const task_id_t  requestor,
@@ -580,6 +585,7 @@ err:
   return -1;
 }
 
+//------------------------------------------------------------------------------
 static inline
 void
 sctp_eNB_accept_associations(
@@ -646,6 +652,7 @@ sctp_eNB_accept_associations(
   }
 }
 
+//------------------------------------------------------------------------------
 static inline
 void
 sctp_eNB_read_from_socket(
@@ -770,6 +777,7 @@ sctp_eNB_read_from_socket(
   }
 }
 
+//------------------------------------------------------------------------------
 void
 sctp_eNB_flush_sockets(
   struct epoll_event *events, int nb_events)
@@ -799,6 +807,7 @@ sctp_eNB_flush_sockets(
 }
 
 
+//------------------------------------------------------------------------------
 void *sctp_eNB_task(void *arg)
 {
   int                 nb_events;
diff --git a/openair3/SECU/nas_stream_eea1.c b/openair3/SECU/nas_stream_eea1.c
index 4b69ae823161bedb24f477f519fc3316b36c3907..142df9e0dc650a44b77dd59e3878f72a8303064b 100755
--- a/openair3/SECU/nas_stream_eea1.c
+++ b/openair3/SECU/nas_stream_eea1.c
@@ -49,7 +49,7 @@ int nas_stream_encrypt_eea1(nas_stream_cipher_t *stream_cipher, uint8_t *out)
   int       n ;
   int       i           = 0;
   uint32_t  zero_bit    = 0;
-  uint32_t  byte_length;
+  //uint32_t  byte_length;
   uint32_t *KS;
   uint32_t  K[4],IV[4];
 
@@ -60,7 +60,7 @@ int nas_stream_encrypt_eea1(nas_stream_cipher_t *stream_cipher, uint8_t *out)
 
   n = ( stream_cipher->blength + 31 ) / 32;
   zero_bit = stream_cipher->blength & 0x7;
-  byte_length = stream_cipher->blength >> 3;
+  //byte_length = stream_cipher->blength >> 3;
 
   memset(&snow_3g_context, 0, sizeof(snow_3g_context));
   /*Initialisation*/
diff --git a/openair3/SECU/nas_stream_eia2.c b/openair3/SECU/nas_stream_eia2.c
index f1f64dd90aeef7131f06e723e21c118eaa866393..4841dfc90b1d757d62546c31c50a5fe0f50f4e29 100644
--- a/openair3/SECU/nas_stream_eia2.c
+++ b/openair3/SECU/nas_stream_eia2.c
@@ -112,6 +112,7 @@ int nas_stream_encrypt_eia2(nas_stream_cipher_t *stream_cipher, uint8_t out[4])
   cmac_ctx = CMAC_CTX_new();
   ret = CMAC_Init(cmac_ctx, stream_cipher->key, stream_cipher->key_length, cipher, NULL);
   ret = CMAC_Update(cmac_ctx, m, m_length + 8);
+  (void)ret; /* avoid gcc warning "set but not used" */
   CMAC_Final(cmac_ctx, data, &size);
   CMAC_CTX_free(cmac_ctx);
 
diff --git a/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/attach_complete.pdml b/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/attach_complete.pdml
new file mode 100644
index 0000000000000000000000000000000000000000..f7c27272aab199fceddadcd71d16f0cf09105d2f
--- /dev/null
+++ b/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/attach_complete.pdml
@@ -0,0 +1,4242 @@
+<?xml version="1.0" ?>
+<?xml-stylesheet type="text/xsl" href="pdml2html.xsl"?>
+<!-- You can find pdml2html.xsl in /usr/share/wireshark or at http://anonsvn.wireshark.org/trunk/wireshark/pdml2html.xsl. -->
+<pdml capture_file="./attach_complete.pcapng" creator="wireshark/1.10.6" time="Mon Nov  2 09:22:48 2015" version="0">
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 9: 82 bytes on wire (656 bits), 82 bytes captured (656 bits) on interface 0" size="82">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:34:14.289149000" showname="Arrival Time: Sep 25, 2015 16:34:14.289149000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191654.289149000" showname="Epoch Time: 1443191654.289149000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="1.707367000" showname="Time delta from previous captured frame: 1.707367000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="1.707367000" showname="Time delta from previous displayed frame: 1.707367000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="7.823518000" showname="Time since reference or first frame: 7.823518000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="9" showname="Frame Number: 9" size="0"/>
+      <field name="frame.len" pos="0" show="82" showname="Frame Length: 82 bytes (656 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="82" showname="Capture Length: 82 bytes (656 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp" showname="Protocols in frame: eth:ip:sctp" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.213 (192.168.12.213), Dst: 192.168.12.17 (192.168.12.17)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="68" showname="Total Length: 68" size="2" value="0044"/>
+        <field name="ip.id" pos="18" show="0x0000" showname="Identification: 0x0000 (0)" size="2" value="0000"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0x9ffd" showname="Header checksum: 0x9ffd [validation disabled]" size="2" value="9ffd">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="9ffd"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="9ffd"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.213" showname="Source: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.213" showname="Source Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="ip.dst" pos="30" show="192.168.12.17" showname="Destination: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.17" showname="Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="48">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x00000000" showname="Verification tag: 0x00000000" size="4" value="00000000"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0xbbfe6088" showname="Checksum: 0xbbfe6088 (not verified)" size="4" value="bbfe6088"/>
+          <field name="" pos="46" show="INIT chunk (Outbound streams: 2, inbound streams: 2)" size="36" value="0100002454f837ab0001a00000020002c4fbb8d7000c00060005000080000004c0000004">
+            <field name="sctp.chunk_type" pos="46" show="1" showname="Chunk type: INIT (1)" size="1" value="01">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="01" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="01" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00"/>
+            <field name="sctp.chunk_length" pos="48" show="36" showname="Chunk length: 36" size="2" value="0024"/>
+            <field name="sctp.init_initiate_tag" pos="50" show="0x54f837ab" showname="Initiate tag: 0x54f837ab" size="4" value="54f837ab"/>
+            <field hide="yes" name="sctp.initiate_tag" pos="50" show="0x54f837ab" showname="Initiate tag: 0x54f837ab" size="4" value="54f837ab"/>
+            <field name="sctp.init_credit" pos="54" show="106496" showname="Advertised receiver window credit (a_rwnd): 106496" size="4" value="0001a000"/>
+            <field name="sctp.init_nr_out_streams" pos="58" show="2" showname="Number of outbound streams: 2" size="2" value="0002"/>
+            <field name="sctp.init_nr_in_streams" pos="60" show="2" showname="Number of inbound streams: 2" size="2" value="0002"/>
+            <field name="sctp.init_initial_tsn" pos="62" show="3304831191" showname="Initial TSN: 3304831191" size="4" value="c4fbb8d7"/>
+            <field name="" pos="66" show="Supported address types parameter (Supported types: IPv4)" size="8" value="000c000600050000">
+              <field name="sctp.parameter_type" pos="66" show="0x000c" showname="Parameter type: Supported address types (0x000c)" size="2" value="000c">
+                <field name="sctp.parameter_bit_1" pos="66" show="0" showname="0... .... .... .... = Bit: Stop processing of chunk" size="2" unmaskedvalue="000c" value="0"/>
+                <field name="sctp.parameter_bit_2" pos="66" show="0" showname=".0.. .... .... .... = Bit: Do not report" size="2" unmaskedvalue="000c" value="0"/>
+              </field>
+              <field name="sctp.parameter_length" pos="68" show="6" showname="Parameter length: 6" size="2" value="0006"/>
+              <field name="sctp.parameter_supported_addres_type" pos="70" show="5" showname="Supported address type: IPv4 address (5)" size="2" value="0005"/>
+              <field name="sctp.parameter_padding" pos="72" show="00:00" showname="Parameter padding: 0000" size="2" value="0000"/>
+            </field>
+            <field name="" pos="74" show="ECN parameter" size="4" value="80000004">
+              <field name="sctp.parameter_type" pos="74" show="0x8000" showname="Parameter type: ECN (0x8000)" size="2" value="8000">
+                <field name="sctp.parameter_bit_1" pos="74" show="1" showname="1... .... .... .... = Bit: Skip parameter and continue processing of the chunk" size="2" unmaskedvalue="8000" value="1"/>
+                <field name="sctp.parameter_bit_2" pos="74" show="0" showname=".0.. .... .... .... = Bit: Do not report" size="2" unmaskedvalue="8000" value="0"/>
+              </field>
+              <field name="sctp.parameter_length" pos="76" show="4" showname="Parameter length: 4" size="2" value="0004"/>
+            </field>
+            <field name="" pos="78" show="Forward TSN supported parameter" size="4" value="c0000004">
+              <field name="sctp.parameter_type" pos="78" show="0xc000" showname="Parameter type: Forward TSN supported (0xc000)" size="2" value="c000">
+                <field name="sctp.parameter_bit_1" pos="78" show="1" showname="1... .... .... .... = Bit: Skip parameter and continue processing of the chunk" size="2" unmaskedvalue="c000" value="1"/>
+                <field name="sctp.parameter_bit_2" pos="78" show="1" showname=".1.. .... .... .... = Bit: Do report" size="2" unmaskedvalue="c000" value="1"/>
+              </field>
+              <field name="sctp.parameter_length" pos="80" show="4" showname="Parameter length: 4" size="2" value="0004"/>
+            </field>
+          </field>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 10: 306 bytes on wire (2448 bits), 306 bytes captured (2448 bits) on interface 0" size="306">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:34:14.289229000" showname="Arrival Time: Sep 25, 2015 16:34:14.289229000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191654.289229000" showname="Epoch Time: 1443191654.289229000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.000080000" showname="Time delta from previous captured frame: 0.000080000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.000080000" showname="Time delta from previous displayed frame: 0.000080000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="7.823598000" showname="Time since reference or first frame: 7.823598000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="10" showname="Frame Number: 10" size="0"/>
+      <field name="frame.len" pos="0" show="306" showname="Frame Length: 306 bytes (2448 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="306" showname="Capture Length: 306 bytes (2448 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp" showname="Protocols in frame: eth:ip:sctp" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.17 (192.168.12.17), Dst: 192.168.12.213 (192.168.12.213)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="292" showname="Total Length: 292" size="2" value="0124"/>
+        <field name="ip.id" pos="18" show="0x0000" showname="Identification: 0x0000 (0)" size="2" value="0000"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0x9f1d" showname="Header checksum: 0x9f1d [validation disabled]" size="2" value="9f1d">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="9f1d"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="9f1d"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.17" showname="Source: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.17" showname="Source Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="ip.dst" pos="30" show="192.168.12.213" showname="Destination: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.213" showname="Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="272">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x54f837ab" showname="Verification tag: 0x54f837ab" size="4" value="54f837ab"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0xcf674bda" showname="Checksum: 0xcf674bda (not verified)" size="4" value="cf674bda"/>
+          <field name="" pos="46" show="INIT_ACK chunk (Outbound streams: 2, inbound streams: 2)" size="260" value="020001044cd1eca00001a0000002000277b42707000700e8d2e400842319c2ee3bf2eb94dff99192604ab35900000000000000000000000000000000a0ecd14cab37f85400000000000000000d425e07780c0000020002000727b47702008e3cc0a80cd500000000000000000000000000000000000000003c8e01000000000080020024efa851c90c104714b66409dff40a9f2d30a6e0b1be975e2eb1ee7d28f5b61aa90000000000000000000000000000000000000000000000000000000000000000000000000100002454f837ab0001a00000020002c4fbb8d7000c00060005000080000004c00000040000000000000000000000000000000080000004c0000004">
+            <field name="sctp.chunk_type" pos="46" show="2" showname="Chunk type: INIT_ACK (2)" size="1" value="02">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="02" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="02" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00"/>
+            <field name="sctp.chunk_length" pos="48" show="260" showname="Chunk length: 260" size="2" value="0104"/>
+            <field name="sctp.initack_initiate_tag" pos="50" show="0x4cd1eca0" showname="Initiate tag: 0x4cd1eca0" size="4" value="4cd1eca0"/>
+            <field hide="yes" name="sctp.initiate_tag" pos="50" show="0x4cd1eca0" showname="Initiate tag: 0x4cd1eca0" size="4" value="4cd1eca0"/>
+            <field name="sctp.initack_credit" pos="54" show="106496" showname="Advertised receiver window credit (a_rwnd): 106496" size="4" value="0001a000"/>
+            <field name="sctp.initack_nr_out_streams" pos="58" show="2" showname="Number of outbound streams: 2" size="2" value="0002"/>
+            <field name="sctp.initack_nr_in_streams" pos="60" show="2" showname="Number of inbound streams: 2" size="2" value="0002"/>
+            <field name="sctp.initack_initial_tsn" pos="62" show="2008295175" showname="Initial TSN: 2008295175" size="4" value="77b42707"/>
+            <field name="" pos="66" show="State cookie parameter (Cookie length: 228 bytes)" size="232" value="000700e8d2e400842319c2ee3bf2eb94dff99192604ab35900000000000000000000000000000000a0ecd14cab37f85400000000000000000d425e07780c0000020002000727b47702008e3cc0a80cd500000000000000000000000000000000000000003c8e01000000000080020024efa851c90c104714b66409dff40a9f2d30a6e0b1be975e2eb1ee7d28f5b61aa90000000000000000000000000000000000000000000000000000000000000000000000000100002454f837ab0001a00000020002c4fbb8d7000c00060005000080000004c000000400000000000000000000000000000000">
+              <field name="sctp.parameter_type" pos="66" show="0x0007" showname="Parameter type: State cookie (0x0007)" size="2" value="0007">
+                <field name="sctp.parameter_bit_1" pos="66" show="0" showname="0... .... .... .... = Bit: Stop processing of chunk" size="2" unmaskedvalue="0007" value="0"/>
+                <field name="sctp.parameter_bit_2" pos="66" show="0" showname=".0.. .... .... .... = Bit: Do not report" size="2" unmaskedvalue="0007" value="0"/>
+              </field>
+              <field name="sctp.parameter_length" pos="68" show="232" showname="Parameter length: 232" size="2" value="00e8"/>
+              <field name="sctp.parameter_state_cookie" pos="70" show="d2:e4:00:84:23:19:c2:ee:3b:f2:eb:94:df:f9:91:92:60:4a:b3:59:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:a0:ec:d1:4c:ab:37:f8:54:00:00:00:00:00:00:00:00:0d:42:5e:07:78:0c:00:00:02:00:02:00:07:27:b4:77:02:00:8e:3c:c0:a8:0c:d5:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:3c:8e:01:00:00:00:00:00:80:02:00:24:ef:a8:51:c9:0c:10:47:14:b6:64:09:df:f4:0a:9f:2d:30:a6:e0:b1:be:97:5e:2e:b1:ee:7d:28:f5:b6:1a:a9:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:01:00:00:24:54:f8:37:ab:00:01:a0:00:00:02:00:02:c4:fb:b8:d7:00:0c:00:06:00:05:00:00:80:00:00:04:c0:00:00:04:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00" showname="State cookie: d2e400842319c2ee3bf2eb94dff99192604ab35900000000..." size="228" value="d2e400842319c2ee3bf2eb94dff99192604ab35900000000000000000000000000000000a0ecd14cab37f85400000000000000000d425e07780c0000020002000727b47702008e3cc0a80cd500000000000000000000000000000000000000003c8e01000000000080020024efa851c90c104714b66409dff40a9f2d30a6e0b1be975e2eb1ee7d28f5b61aa90000000000000000000000000000000000000000000000000000000000000000000000000100002454f837ab0001a00000020002c4fbb8d7000c00060005000080000004c000000400000000000000000000000000000000"/>
+            </field>
+            <field name="" pos="298" show="ECN parameter" size="4" value="80000004">
+              <field name="sctp.parameter_type" pos="298" show="0x8000" showname="Parameter type: ECN (0x8000)" size="2" value="8000">
+                <field name="sctp.parameter_bit_1" pos="298" show="1" showname="1... .... .... .... = Bit: Skip parameter and continue processing of the chunk" size="2" unmaskedvalue="8000" value="1"/>
+                <field name="sctp.parameter_bit_2" pos="298" show="0" showname=".0.. .... .... .... = Bit: Do not report" size="2" unmaskedvalue="8000" value="0"/>
+              </field>
+              <field name="sctp.parameter_length" pos="300" show="4" showname="Parameter length: 4" size="2" value="0004"/>
+            </field>
+            <field name="" pos="302" show="Forward TSN supported parameter" size="4" value="c0000004">
+              <field name="sctp.parameter_type" pos="302" show="0xc000" showname="Parameter type: Forward TSN supported (0xc000)" size="2" value="c000">
+                <field name="sctp.parameter_bit_1" pos="302" show="1" showname="1... .... .... .... = Bit: Skip parameter and continue processing of the chunk" size="2" unmaskedvalue="c000" value="1"/>
+                <field name="sctp.parameter_bit_2" pos="302" show="1" showname=".1.. .... .... .... = Bit: Do report" size="2" unmaskedvalue="c000" value="1"/>
+              </field>
+              <field name="sctp.parameter_length" pos="304" show="4" showname="Parameter length: 4" size="2" value="0004"/>
+            </field>
+          </field>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 11: 278 bytes on wire (2224 bits), 278 bytes captured (2224 bits) on interface 0" size="278">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:34:14.289649000" showname="Arrival Time: Sep 25, 2015 16:34:14.289649000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191654.289649000" showname="Epoch Time: 1443191654.289649000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.000420000" showname="Time delta from previous captured frame: 0.000420000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.000420000" showname="Time delta from previous displayed frame: 0.000420000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="7.824018000" showname="Time since reference or first frame: 7.824018000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="11" showname="Frame Number: 11" size="0"/>
+      <field name="frame.len" pos="0" show="278" showname="Frame Length: 278 bytes (2224 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="278" showname="Capture Length: 278 bytes (2224 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp" showname="Protocols in frame: eth:ip:sctp" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.213 (192.168.12.213), Dst: 192.168.12.17 (192.168.12.17)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="264" showname="Total Length: 264" size="2" value="0108"/>
+        <field name="ip.id" pos="18" show="0x0000" showname="Identification: 0x0000 (0)" size="2" value="0000"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0x9f39" showname="Header checksum: 0x9f39 [validation disabled]" size="2" value="9f39">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="9f39"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="9f39"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.213" showname="Source: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.213" showname="Source Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="ip.dst" pos="30" show="192.168.12.17" showname="Destination: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.17" showname="Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="244">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x4cd1eca0" showname="Verification tag: 0x4cd1eca0" size="4" value="4cd1eca0"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0x4056ad0d" showname="Checksum: 0x4056ad0d (not verified)" size="4" value="4056ad0d"/>
+          <field name="" pos="46" show="COOKIE_ECHO chunk (Cookie length: 228 bytes)" size="232" value="0a0000e8d2e400842319c2ee3bf2eb94dff99192604ab35900000000000000000000000000000000a0ecd14cab37f85400000000000000000d425e07780c0000020002000727b47702008e3cc0a80cd500000000000000000000000000000000000000003c8e01000000000080020024efa851c90c104714b66409dff40a9f2d30a6e0b1be975e2eb1ee7d28f5b61aa90000000000000000000000000000000000000000000000000000000000000000000000000100002454f837ab0001a00000020002c4fbb8d7000c00060005000080000004c000000400000000000000000000000000000000">
+            <field name="sctp.chunk_type" pos="46" show="10" showname="Chunk type: COOKIE_ECHO (10)" size="1" value="0a">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="0a" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="0a" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00"/>
+            <field name="sctp.chunk_length" pos="48" show="232" showname="Chunk length: 232" size="2" value="00e8"/>
+            <field name="sctp.cookie" pos="50" show="d2:e4:00:84:23:19:c2:ee:3b:f2:eb:94:df:f9:91:92:60:4a:b3:59:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:a0:ec:d1:4c:ab:37:f8:54:00:00:00:00:00:00:00:00:0d:42:5e:07:78:0c:00:00:02:00:02:00:07:27:b4:77:02:00:8e:3c:c0:a8:0c:d5:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:3c:8e:01:00:00:00:00:00:80:02:00:24:ef:a8:51:c9:0c:10:47:14:b6:64:09:df:f4:0a:9f:2d:30:a6:e0:b1:be:97:5e:2e:b1:ee:7d:28:f5:b6:1a:a9:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:01:00:00:24:54:f8:37:ab:00:01:a0:00:00:02:00:02:c4:fb:b8:d7:00:0c:00:06:00:05:00:00:80:00:00:04:c0:00:00:04:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00" showname="Cookie: d2e400842319c2ee3bf2eb94dff99192604ab35900000000..." size="228" value="d2e400842319c2ee3bf2eb94dff99192604ab35900000000000000000000000000000000a0ecd14cab37f85400000000000000000d425e07780c0000020002000727b47702008e3cc0a80cd500000000000000000000000000000000000000003c8e01000000000080020024efa851c90c104714b66409dff40a9f2d30a6e0b1be975e2eb1ee7d28f5b61aa90000000000000000000000000000000000000000000000000000000000000000000000000100002454f837ab0001a00000020002c4fbb8d7000c00060005000080000004c000000400000000000000000000000000000000"/>
+          </field>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 12: 50 bytes on wire (400 bits), 50 bytes captured (400 bits) on interface 0" size="50">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:34:14.289704000" showname="Arrival Time: Sep 25, 2015 16:34:14.289704000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191654.289704000" showname="Epoch Time: 1443191654.289704000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.000055000" showname="Time delta from previous captured frame: 0.000055000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.000055000" showname="Time delta from previous displayed frame: 0.000055000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="7.824073000" showname="Time since reference or first frame: 7.824073000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="12" showname="Frame Number: 12" size="0"/>
+      <field name="frame.len" pos="0" show="50" showname="Frame Length: 50 bytes (400 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="50" showname="Capture Length: 50 bytes (400 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp" showname="Protocols in frame: eth:ip:sctp" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.17 (192.168.12.17), Dst: 192.168.12.213 (192.168.12.213)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="36" showname="Total Length: 36" size="2" value="0024"/>
+        <field name="ip.id" pos="18" show="0x0000" showname="Identification: 0x0000 (0)" size="2" value="0000"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0xa01d" showname="Header checksum: 0xa01d [validation disabled]" size="2" value="a01d">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="a01d"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="a01d"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.17" showname="Source: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.17" showname="Source Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="ip.dst" pos="30" show="192.168.12.213" showname="Destination: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.213" showname="Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="16">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x54f837ab" showname="Verification tag: 0x54f837ab" size="4" value="54f837ab"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0x629de6e0" showname="Checksum: 0x629de6e0 (not verified)" size="4" value="629de6e0"/>
+          <field name="" pos="46" show="COOKIE_ACK chunk" size="4" value="0b000004">
+            <field name="sctp.chunk_type" pos="46" show="11" showname="Chunk type: COOKIE_ACK (11)" size="1" value="0b">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="0b" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="0b" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00"/>
+            <field name="sctp.chunk_length" pos="48" show="4" showname="Chunk length: 4" size="2" value="0004"/>
+          </field>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 13: 122 bytes on wire (976 bits), 122 bytes captured (976 bits) on interface 0" size="122">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:34:14.290056000" showname="Arrival Time: Sep 25, 2015 16:34:14.290056000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191654.290056000" showname="Epoch Time: 1443191654.290056000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.000352000" showname="Time delta from previous captured frame: 0.000352000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.000352000" showname="Time delta from previous displayed frame: 0.000352000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="7.824425000" showname="Time since reference or first frame: 7.824425000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="13" showname="Frame Number: 13" size="0"/>
+      <field name="frame.len" pos="0" show="122" showname="Frame Length: 122 bytes (976 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="122" showname="Capture Length: 122 bytes (976 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp:s1ap:s1ap:s1ap:s1ap:s1ap:s1ap" showname="Protocols in frame: eth:ip:sctp:s1ap:s1ap:s1ap:s1ap:s1ap:s1ap" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.213 (192.168.12.213), Dst: 192.168.12.17 (192.168.12.17)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="108" showname="Total Length: 108" size="2" value="006c"/>
+        <field name="ip.id" pos="18" show="0x0001" showname="Identification: 0x0001 (1)" size="2" value="0001"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0x9fd4" showname="Header checksum: 0x9fd4 [validation disabled]" size="2" value="9fd4">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="9fd4"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="9fd4"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.213" showname="Source: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.213" showname="Source Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="ip.dst" pos="30" show="192.168.12.17" showname="Destination: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.17" showname="Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="28">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x4cd1eca0" showname="Verification tag: 0x4cd1eca0" size="4" value="4cd1eca0"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0x9981d0bb" showname="Checksum: 0x9981d0bb (not verified)" size="4" value="9981d0bb"/>
+          <field name="" pos="46" show="DATA chunk(ordered, complete segment, TSN: 3304831191, SID: 0, SSN: 0, PPID: 18, payload length: 59 bytes)" size="16" value="0003004bc4fbb8d70000000000000012">
+            <field name="sctp.chunk_type" pos="46" show="0" showname="Chunk type: DATA (0)" size="1" value="00">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="00" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="00" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x03" showname="Chunk flags: 0x03" size="1" value="03">
+              <field name="sctp.data_e_bit" pos="47" show="1" showname=".... ...1 = E-Bit: Last segment" size="1" unmaskedvalue="03" value="1"/>
+              <field name="sctp.data_b_bit" pos="47" show="1" showname=".... ..1. = B-Bit: First segment" size="1" unmaskedvalue="03" value="1"/>
+              <field name="sctp.data_u_bit" pos="47" show="0" showname=".... .0.. = U-Bit: Ordered delivery" size="1" unmaskedvalue="03" value="0"/>
+              <field name="sctp.data_i_bit" pos="47" show="0" showname=".... 0... = I-Bit: Possibly delay SACK" size="1" unmaskedvalue="03" value="0"/>
+            </field>
+            <field name="sctp.chunk_length" pos="48" show="75" showname="Chunk length: 75" size="2" value="004b"/>
+            <field name="sctp.data_tsn" pos="50" show="3304831191" showname="TSN: 3304831191" size="4" value="c4fbb8d7"/>
+            <field name="sctp.data_sid" pos="54" show="0x0000" showname="Stream Identifier: 0x0000" size="2" value="0000"/>
+            <field name="sctp.data_ssn" pos="56" show="0" showname="Stream sequence number: 0" size="2" value="0000"/>
+            <field name="sctp.data_payload_proto_id" pos="58" show="18" showname="Payload protocol identifier: S1 Application Protocol (S1AP) (18)" size="4" value="00000012"/>
+            <field name="sctp.chunk_padding" pos="121" show="00" showname="Chunk padding: 00" size="1" value="00"/>
+          </field>
+          <proto name="s1ap" pos="62" showname="S1 Application Protocol" size="59">
+            <field hide="yes" name="per.extension_bit" pos="62" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+            <field hide="yes" name="per.choice_index" pos="62" show="0" showname="Choice Index: 0" size="1" value="00"/>
+            <field name="s1ap.S1AP_PDU" pos="62" show="0" showname="S1AP-PDU: initiatingMessage (0)" size="59" value="00110037000004003b00080002f8590000e000003c40140880654e425f45757265636f6d5f4c5445426f78004000070000004002f8590089400140">
+              <field name="s1ap.initiatingMessage" pos="62" show="" showname="initiatingMessage" size="59" value="">
+                <field name="s1ap.procedureCode" pos="63" show="17" showname="procedureCode: id-S1Setup (17)" size="1" value="11"/>
+                <field hide="yes" name="per.enum_index" pos="64" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                <field name="s1ap.criticality" pos="64" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                <field hide="yes" name="per.open_type_length" pos="65" show="55" showname="Open Type Length: 55" size="1" value="37"/>
+                <field name="s1ap.value" pos="66" show="" showname="value" size="55" value="">
+                  <field name="s1ap.S1SetupRequest" pos="66" show="" showname="S1SetupRequest" size="55" value="">
+                    <field hide="yes" name="per.extension_bit" pos="66" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                    <field hide="yes" name="per.sequence_of_length" pos="67" show="4" showname="Sequence-Of Length: 4" size="2" value="0004"/>
+                    <field name="s1ap.protocolIEs" pos="69" show="4" showname="protocolIEs: 4 items" size="52" value="003b00080002f8590000e000003c40140880654e425f45757265636f6d5f4c5445426f78004000070000004002f8590089400140">
+                      <field name="" pos="69" show="Item 0: id-Global-ENB-ID" size="12" value="003b00080002f8590000e000">
+                        <field name="s1ap.ProtocolIE_Field" pos="69" show="" showname="ProtocolIE-Field" size="12" value="">
+                          <field name="s1ap.id" pos="69" show="59" showname="id: id-Global-ENB-ID (59)" size="2" value="003b"/>
+                          <field hide="yes" name="per.enum_index" pos="71" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="71" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="72" show="8" showname="Open Type Length: 8" size="1" value="08"/>
+                          <field name="s1ap.value" pos="73" show="" showname="value" size="8" value="">
+                            <field name="s1ap.Global_ENB_ID" pos="73" show="" showname="Global-ENB-ID" size="7" value="">
+                              <field hide="yes" name="per.extension_bit" pos="73" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                              <field hide="yes" name="per.optional_field_bit" pos="73" show="0" showname=".0.. .... Optional Field Bit: False (iE-Extensions is NOT present)" size="1" unmaskedvalue="00" value="0"/>
+                              <field name="s1ap.pLMNidentity" pos="74" show="02:f8:59" showname="pLMNidentity: 02f859" size="3" value="02f859"/>
+                              <field name="e212.mcc" pos="74" show="208" showname="Mobile Country Code (MCC): France (208)" size="2" value="02f8"/>
+                              <field name="e212.mnc" pos="75" show="95" showname="Mobile Network Code (MNC): Unknown (95)" size="2" value="f859"/>
+                              <field hide="yes" name="per.extension_bit" pos="77" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                              <field hide="yes" name="per.choice_index" pos="77" show="0" showname="Choice Index: 0" size="1" value="00"/>
+                              <field name="s1ap.eNB_ID" pos="77" show="0" showname="eNB-ID: macroENB-ID (0)" size="3" value="0000e0">
+                                <field name="s1ap.macroENB_ID" pos="77" show="00:e0:00" showname="macroENB-ID: 00e000 [bit length 20, 4 LSB pad bits, 0000 0000  1110 0000  0000 .... decimal value 3584]" size="3" value="00e000"/>
+                              </field>
+                            </field>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="81" show="Item 1: id-eNBname" size="24" value="003c40140880654e425f45757265636f6d5f4c5445426f78">
+                        <field name="s1ap.ProtocolIE_Field" pos="81" show="" showname="ProtocolIE-Field" size="24" value="">
+                          <field name="s1ap.id" pos="81" show="60" showname="id: id-eNBname (60)" size="2" value="003c"/>
+                          <field hide="yes" name="per.enum_index" pos="83" show="1" showname="Enumerated Index: 1" size="1" value="40"/>
+                          <field name="s1ap.criticality" pos="83" show="1" showname="criticality: ignore (1)" size="1" value="40"/>
+                          <field hide="yes" name="per.open_type_length" pos="84" show="20" showname="Open Type Length: 20" size="1" value="14"/>
+                          <field name="s1ap.value" pos="85" show="" showname="value" size="20" value="">
+                            <field name="per.extension_present_bit" pos="85" show="0" showname="0... .... Extension Present Bit: False" size="1" unmaskedvalue="08" value="0"/>
+                            <field hide="yes" name="per.octet_string_length" pos="85" show="18" showname="Octet String Length: 18" size="1" value="08"/>
+                            <field name="s1ap.ENBname" pos="87" show="eNB_Eurecom_LTEBox" showname="ENBname: eNB_Eurecom_LTEBox" size="18" value="654e425f45757265636f6d5f4c5445426f78"/>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="105" show="Item 2: id-SupportedTAs" size="11" value="004000070000004002f859">
+                        <field name="s1ap.ProtocolIE_Field" pos="105" show="" showname="ProtocolIE-Field" size="11" value="">
+                          <field name="s1ap.id" pos="105" show="64" showname="id: id-SupportedTAs (64)" size="2" value="0040"/>
+                          <field hide="yes" name="per.enum_index" pos="107" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="107" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="108" show="7" showname="Open Type Length: 7" size="1" value="07"/>
+                          <field name="s1ap.value" pos="109" show="" showname="value" size="7" value="">
+                            <field hide="yes" name="per.sequence_of_length" pos="109" show="1" showname="Sequence-Of Length: 1" size="1" value="00"/>
+                            <field name="s1ap.SupportedTAs" pos="110" show="1" showname="SupportedTAs: 1 item" size="6" value="00004002f859">
+                              <field name="" pos="110" show="Item 0" size="6" value="00004002f859">
+                                <field name="s1ap.SupportedTAs_Item" pos="110" show="" showname="SupportedTAs-Item" size="6" value="">
+                                  <field hide="yes" name="per.extension_bit" pos="110" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                                  <field hide="yes" name="per.optional_field_bit" pos="110" show="0" showname=".0.. .... Optional Field Bit: False (iE-Extensions is NOT present)" size="1" unmaskedvalue="00" value="0"/>
+                                  <field name="s1ap.tAC" pos="110" show="00:01" showname="tAC: 0001" size="2" value="0001"/>
+                                  <field hide="yes" name="per.sequence_of_length" pos="112" show="1" showname="Sequence-Of Length: 1" size="1" value="40"/>
+                                  <field name="s1ap.broadcastPLMNs" pos="112" show="1" showname="broadcastPLMNs: 1 item" size="4" value="4002f859">
+                                    <field name="" pos="112" show="Item 0" size="4" value="4002f859">
+                                      <field name="s1ap.PLMNidentity" pos="113" show="02:f8:59" showname="PLMNidentity: 02f859" size="3" value="02f859"/>
+                                      <field name="e212.mcc" pos="113" show="208" showname="Mobile Country Code (MCC): France (208)" size="2" value="02f8"/>
+                                      <field name="e212.mnc" pos="114" show="95" showname="Mobile Network Code (MNC): Unknown (95)" size="2" value="f859"/>
+                                    </field>
+                                  </field>
+                                </field>
+                              </field>
+                            </field>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="116" show="Item 3: id-DefaultPagingDRX" size="5" value="0089400140">
+                        <field name="s1ap.ProtocolIE_Field" pos="116" show="" showname="ProtocolIE-Field" size="5" value="">
+                          <field name="s1ap.id" pos="116" show="137" showname="id: id-DefaultPagingDRX (137)" size="2" value="0089"/>
+                          <field hide="yes" name="per.enum_index" pos="118" show="1" showname="Enumerated Index: 1" size="1" value="40"/>
+                          <field name="s1ap.criticality" pos="118" show="1" showname="criticality: ignore (1)" size="1" value="40"/>
+                          <field hide="yes" name="per.open_type_length" pos="119" show="1" showname="Open Type Length: 1" size="1" value="01"/>
+                          <field name="s1ap.value" pos="120" show="" showname="value" size="1" value="">
+                            <field hide="yes" name="per.extension_present_bit" pos="120" show="0" showname="0... .... Extension Present Bit: False" size="1" unmaskedvalue="40" value="0"/>
+                            <field hide="yes" name="per.enum_index" pos="120" show="2" showname="Enumerated Index: 2" size="1" value="40"/>
+                            <field name="s1ap.PagingDRX" pos="120" show="2" showname="PagingDRX: v128 (2)" size="1" value="40"/>
+                          </field>
+                        </field>
+                      </field>
+                    </field>
+                  </field>
+                </field>
+              </field>
+            </field>
+          </proto>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 14: 62 bytes on wire (496 bits), 62 bytes captured (496 bits) on interface 0" size="62">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:34:14.290087000" showname="Arrival Time: Sep 25, 2015 16:34:14.290087000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191654.290087000" showname="Epoch Time: 1443191654.290087000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.000031000" showname="Time delta from previous captured frame: 0.000031000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.000031000" showname="Time delta from previous displayed frame: 0.000031000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="7.824456000" showname="Time since reference or first frame: 7.824456000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="14" showname="Frame Number: 14" size="0"/>
+      <field name="frame.len" pos="0" show="62" showname="Frame Length: 62 bytes (496 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="62" showname="Capture Length: 62 bytes (496 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp" showname="Protocols in frame: eth:ip:sctp" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.17 (192.168.12.17), Dst: 192.168.12.213 (192.168.12.213)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="48" showname="Total Length: 48" size="2" value="0030"/>
+        <field name="ip.id" pos="18" show="0x0000" showname="Identification: 0x0000 (0)" size="2" value="0000"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0xa011" showname="Header checksum: 0xa011 [validation disabled]" size="2" value="a011">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="a011"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="a011"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.17" showname="Source: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.17" showname="Source Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="ip.dst" pos="30" show="192.168.12.213" showname="Destination: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.213" showname="Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="28">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x54f837ab" showname="Verification tag: 0x54f837ab" size="4" value="54f837ab"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0x1a9ba246" showname="Checksum: 0x1a9ba246 (not verified)" size="4" value="1a9ba246"/>
+          <field name="" pos="46" show="SACK chunk (Cumulative TSN: 3304831191, a_rwnd: 106437, gaps: 0, duplicate TSNs: 0)" size="16" value="03000010c4fbb8d700019fc500000000">
+            <field name="sctp.chunk_type" pos="46" show="3" showname="Chunk type: SACK (3)" size="1" value="03">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="03" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="03" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00">
+              <field name="sctp.sack_nounce_sum" pos="47" show="0" showname=".... ...0 = Nounce sum: 0" size="1" unmaskedvalue="00" value="0"/>
+            </field>
+            <field name="sctp.chunk_length" pos="48" show="16" showname="Chunk length: 16" size="2" value="0010"/>
+            <field name="sctp.sack_cumulative_tsn_ack" pos="50" show="3304831191" showname="Cumulative TSN ACK: 3304831191" size="4" value="c4fbb8d7"/>
+            <field name="sctp.sack_a_rwnd" pos="54" show="106437" showname="Advertised receiver window credit (a_rwnd): 106437" size="4" value="00019fc5"/>
+            <field name="sctp.sack_number_of_gap_blocks" pos="58" show="0" showname="Number of gap acknowledgement blocks: 0" size="2" value="0000"/>
+            <field name="sctp.sack_number_of_duplicated_tsns" pos="60" show="0" showname="Number of duplicated TSNs: 0" size="2" value="0000"/>
+          </field>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 15: 114 bytes on wire (912 bits), 114 bytes captured (912 bits) on interface 0" size="114">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:34:14.290488000" showname="Arrival Time: Sep 25, 2015 16:34:14.290488000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191654.290488000" showname="Epoch Time: 1443191654.290488000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.000401000" showname="Time delta from previous captured frame: 0.000401000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.000401000" showname="Time delta from previous displayed frame: 0.000401000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="7.824857000" showname="Time since reference or first frame: 7.824857000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="15" showname="Frame Number: 15" size="0"/>
+      <field name="frame.len" pos="0" show="114" showname="Frame Length: 114 bytes (912 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="114" showname="Capture Length: 114 bytes (912 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp:s1ap:s1ap:s1ap:s1ap" showname="Protocols in frame: eth:ip:sctp:s1ap:s1ap:s1ap:s1ap" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.17 (192.168.12.17), Dst: 192.168.12.213 (192.168.12.213)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="100" showname="Total Length: 100" size="2" value="0064"/>
+        <field name="ip.id" pos="18" show="0x0000" showname="Identification: 0x0000 (0)" size="2" value="0000"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0x9fdd" showname="Header checksum: 0x9fdd [validation disabled]" size="2" value="9fdd">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="9fdd"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="9fdd"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.17" showname="Source: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.17" showname="Source Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="ip.dst" pos="30" show="192.168.12.213" showname="Destination: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.213" showname="Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="28">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x54f837ab" showname="Verification tag: 0x54f837ab" size="4" value="54f837ab"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0x93a80c99" showname="Checksum: 0x93a80c99 (not verified)" size="4" value="93a80c99"/>
+          <field name="" pos="46" show="DATA chunk(ordered, complete segment, TSN: 2008295175, SID: 0, SSN: 0, PPID: 301989888, payload length: 49 bytes)" size="16" value="0003004177b427070000000012000000">
+            <field name="sctp.chunk_type" pos="46" show="0" showname="Chunk type: DATA (0)" size="1" value="00">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="00" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="00" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x03" showname="Chunk flags: 0x03" size="1" value="03">
+              <field name="sctp.data_e_bit" pos="47" show="1" showname=".... ...1 = E-Bit: Last segment" size="1" unmaskedvalue="03" value="1"/>
+              <field name="sctp.data_b_bit" pos="47" show="1" showname=".... ..1. = B-Bit: First segment" size="1" unmaskedvalue="03" value="1"/>
+              <field name="sctp.data_u_bit" pos="47" show="0" showname=".... .0.. = U-Bit: Ordered delivery" size="1" unmaskedvalue="03" value="0"/>
+              <field name="sctp.data_i_bit" pos="47" show="0" showname=".... 0... = I-Bit: Possibly delay SACK" size="1" unmaskedvalue="03" value="0"/>
+            </field>
+            <field name="sctp.chunk_length" pos="48" show="65" showname="Chunk length: 65" size="2" value="0041"/>
+            <field name="sctp.data_tsn" pos="50" show="2008295175" showname="TSN: 2008295175" size="4" value="77b42707"/>
+            <field name="sctp.data_sid" pos="54" show="0x0000" showname="Stream Identifier: 0x0000" size="2" value="0000"/>
+            <field name="sctp.data_ssn" pos="56" show="0" showname="Stream sequence number: 0" size="2" value="0000"/>
+            <field name="sctp.data_payload_proto_id" pos="58" show="301989888" showname="Payload protocol identifier: Unknown (301989888)" size="4" value="12000000"/>
+            <field name="sctp.chunk_padding" pos="111" show="00:00:00" showname="Chunk padding: 000000" size="3" value="000000"/>
+          </field>
+          <proto name="s1ap" pos="62" showname="S1 Application Protocol" size="49">
+            <field hide="yes" name="per.extension_bit" pos="62" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="20" value="0"/>
+            <field hide="yes" name="per.choice_index" pos="62" show="1" showname="Choice Index: 1" size="1" value="20"/>
+            <field name="s1ap.S1AP_PDU" pos="62" show="1" showname="S1AP-PDU: successfulOutcome (1)" size="49" value="2011002d00000200690021000002f8590006800000040005001e00080009c3650a011e1f2021222324381d08005740010a">
+              <field name="s1ap.successfulOutcome" pos="62" show="" showname="successfulOutcome" size="49" value="">
+                <field name="s1ap.procedureCode" pos="63" show="17" showname="procedureCode: id-S1Setup (17)" size="1" value="11"/>
+                <field hide="yes" name="per.enum_index" pos="64" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                <field name="s1ap.criticality" pos="64" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                <field hide="yes" name="per.open_type_length" pos="65" show="45" showname="Open Type Length: 45" size="1" value="2d"/>
+                <field name="s1ap.value" pos="66" show="" showname="value" size="45" value="">
+                  <field name="s1ap.S1SetupResponse" pos="66" show="" showname="S1SetupResponse" size="45" value="">
+                    <field hide="yes" name="per.extension_bit" pos="66" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                    <field hide="yes" name="per.sequence_of_length" pos="67" show="2" showname="Sequence-Of Length: 2" size="2" value="0002"/>
+                    <field name="s1ap.protocolIEs" pos="69" show="2" showname="protocolIEs: 2 items" size="42" value="00690021000002f8590006800000040005001e00080009c3650a011e1f2021222324381d08005740010a">
+                      <field name="" pos="69" show="Item 0: id-ServedGUMMEIs" size="37" value="00690021000002f8590006800000040005001e00080009c3650a011e1f2021222324381d08">
+                        <field name="s1ap.ProtocolIE_Field" pos="69" show="" showname="ProtocolIE-Field" size="37" value="">
+                          <field name="s1ap.id" pos="69" show="105" showname="id: id-ServedGUMMEIs (105)" size="2" value="0069"/>
+                          <field hide="yes" name="per.enum_index" pos="71" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="71" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="72" show="33" showname="Open Type Length: 33" size="1" value="21"/>
+                          <field name="s1ap.value" pos="73" show="" showname="value" size="33" value="">
+                            <field hide="yes" name="per.sequence_of_length" pos="73" show="1" showname="Sequence-Of Length: 1" size="1" value="00"/>
+                            <field name="s1ap.ServedGUMMEIs" pos="73" show="1" showname="ServedGUMMEIs: 1 item" size="33" value="000002f8590006800000040005001e00080009c3650a011e1f2021222324381d08">
+                              <field name="" pos="73" show="Item 0" size="33" value="000002f8590006800000040005001e00080009c3650a011e1f2021222324381d08">
+                                <field name="s1ap.ServedGUMMEIsItem" pos="73" show="" showname="ServedGUMMEIsItem" size="33" value="">
+                                  <field hide="yes" name="per.extension_bit" pos="73" show="0" showname="...0 .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                                  <field hide="yes" name="per.optional_field_bit" pos="73" show="0" showname=".... 0... Optional Field Bit: False (iE-Extensions is NOT present)" size="1" unmaskedvalue="00" value="0"/>
+                                  <field hide="yes" name="per.sequence_of_length" pos="73" show="1" showname="Sequence-Of Length: 1" size="1" value="00"/>
+                                  <field name="s1ap.servedPLMNs" pos="74" show="1" showname="servedPLMNs: 1 item" size="4" value="0002f859">
+                                    <field name="" pos="74" show="Item 0" size="4" value="0002f859">
+                                      <field name="s1ap.PLMNidentity" pos="75" show="02:f8:59" showname="PLMNidentity: 02f859" size="3" value="02f859"/>
+                                      <field name="e212.mcc" pos="75" show="208" showname="Mobile Country Code (MCC): France (208)" size="2" value="02f8"/>
+                                      <field name="e212.mnc" pos="76" show="95" showname="Mobile Network Code (MNC): Unknown (95)" size="2" value="f859"/>
+                                    </field>
+                                  </field>
+                                  <field hide="yes" name="per.sequence_of_length" pos="78" show="7" showname="Sequence-Of Length: 7" size="2" value="0006"/>
+                                  <field name="s1ap.servedGroupIDs" pos="80" show="7" showname="servedGroupIDs: 7 items" size="14" value="800000040005001e00080009c365">
+                                    <field name="" pos="80" show="Item 0" size="2" value="8000">
+                                      <field name="s1ap.MME_Group_ID" pos="80" show="80:00" showname="MME-Group-ID: 8000" size="2" value="8000"/>
+                                    </field>
+                                    <field name="" pos="82" show="Item 1" size="2" value="0004">
+                                      <field name="s1ap.MME_Group_ID" pos="82" show="00:04" showname="MME-Group-ID: 0004" size="2" value="0004"/>
+                                    </field>
+                                    <field name="" pos="84" show="Item 2" size="2" value="0005">
+                                      <field name="s1ap.MME_Group_ID" pos="84" show="00:05" showname="MME-Group-ID: 0005" size="2" value="0005"/>
+                                    </field>
+                                    <field name="" pos="86" show="Item 3" size="2" value="001e">
+                                      <field name="s1ap.MME_Group_ID" pos="86" show="00:1e" showname="MME-Group-ID: 001e" size="2" value="001e"/>
+                                    </field>
+                                    <field name="" pos="88" show="Item 4" size="2" value="0008">
+                                      <field name="s1ap.MME_Group_ID" pos="88" show="00:08" showname="MME-Group-ID: 0008" size="2" value="0008"/>
+                                    </field>
+                                    <field name="" pos="90" show="Item 5" size="2" value="0009">
+                                      <field name="s1ap.MME_Group_ID" pos="90" show="00:09" showname="MME-Group-ID: 0009" size="2" value="0009"/>
+                                    </field>
+                                    <field name="" pos="92" show="Item 6" size="2" value="c365">
+                                      <field name="s1ap.MME_Group_ID" pos="92" show="c3:65" showname="MME-Group-ID: c365" size="2" value="c365"/>
+                                    </field>
+                                  </field>
+                                  <field hide="yes" name="per.sequence_of_length" pos="94" show="11" showname="Sequence-Of Length: 11" size="1" value="0a"/>
+                                  <field name="s1ap.servedMMECs" pos="95" show="11" showname="servedMMECs: 11 items" size="11" value="011e1f2021222324381d08">
+                                    <field name="" pos="95" show="Item 0" size="1" value="01">
+                                      <field name="s1ap.MME_Code" pos="95" show="01" showname="MME-Code: 01" size="1" value="01"/>
+                                    </field>
+                                    <field name="" pos="96" show="Item 1" size="1" value="1e">
+                                      <field name="s1ap.MME_Code" pos="96" show="1e" showname="MME-Code: 1e" size="1" value="1e"/>
+                                    </field>
+                                    <field name="" pos="97" show="Item 2" size="1" value="1f">
+                                      <field name="s1ap.MME_Code" pos="97" show="1f" showname="MME-Code: 1f" size="1" value="1f"/>
+                                    </field>
+                                    <field name="" pos="98" show="Item 3" size="1" value="20">
+                                      <field name="s1ap.MME_Code" pos="98" show="20" showname="MME-Code: 20" size="1" value="20"/>
+                                    </field>
+                                    <field name="" pos="99" show="Item 4" size="1" value="21">
+                                      <field name="s1ap.MME_Code" pos="99" show="21" showname="MME-Code: 21" size="1" value="21"/>
+                                    </field>
+                                    <field name="" pos="100" show="Item 5" size="1" value="22">
+                                      <field name="s1ap.MME_Code" pos="100" show="22" showname="MME-Code: 22" size="1" value="22"/>
+                                    </field>
+                                    <field name="" pos="101" show="Item 6" size="1" value="23">
+                                      <field name="s1ap.MME_Code" pos="101" show="23" showname="MME-Code: 23" size="1" value="23"/>
+                                    </field>
+                                    <field name="" pos="102" show="Item 7" size="1" value="24">
+                                      <field name="s1ap.MME_Code" pos="102" show="24" showname="MME-Code: 24" size="1" value="24"/>
+                                    </field>
+                                    <field name="" pos="103" show="Item 8" size="1" value="38">
+                                      <field name="s1ap.MME_Code" pos="103" show="38" showname="MME-Code: 38" size="1" value="38"/>
+                                    </field>
+                                    <field name="" pos="104" show="Item 9" size="1" value="1d">
+                                      <field name="s1ap.MME_Code" pos="104" show="1d" showname="MME-Code: 1d" size="1" value="1d"/>
+                                    </field>
+                                    <field name="" pos="105" show="Item 10" size="1" value="08">
+                                      <field name="s1ap.MME_Code" pos="105" show="08" showname="MME-Code: 08" size="1" value="08"/>
+                                    </field>
+                                  </field>
+                                </field>
+                              </field>
+                            </field>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="106" show="Item 1: id-RelativeMMECapacity" size="5" value="005740010a">
+                        <field name="s1ap.ProtocolIE_Field" pos="106" show="" showname="ProtocolIE-Field" size="5" value="">
+                          <field name="s1ap.id" pos="106" show="87" showname="id: id-RelativeMMECapacity (87)" size="2" value="0057"/>
+                          <field hide="yes" name="per.enum_index" pos="108" show="1" showname="Enumerated Index: 1" size="1" value="40"/>
+                          <field name="s1ap.criticality" pos="108" show="1" showname="criticality: ignore (1)" size="1" value="40"/>
+                          <field hide="yes" name="per.open_type_length" pos="109" show="1" showname="Open Type Length: 1" size="1" value="01"/>
+                          <field name="s1ap.value" pos="110" show="" showname="value" size="1" value="">
+                            <field name="s1ap.RelativeMMECapacity" pos="110" show="10" showname="RelativeMMECapacity: 10" size="1" value="0a"/>
+                          </field>
+                        </field>
+                      </field>
+                    </field>
+                  </field>
+                </field>
+              </field>
+            </field>
+          </proto>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 16: 62 bytes on wire (496 bits), 62 bytes captured (496 bits) on interface 0" size="62">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:34:14.290617000" showname="Arrival Time: Sep 25, 2015 16:34:14.290617000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191654.290617000" showname="Epoch Time: 1443191654.290617000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.000129000" showname="Time delta from previous captured frame: 0.000129000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.000129000" showname="Time delta from previous displayed frame: 0.000129000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="7.824986000" showname="Time since reference or first frame: 7.824986000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="16" showname="Frame Number: 16" size="0"/>
+      <field name="frame.len" pos="0" show="62" showname="Frame Length: 62 bytes (496 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="62" showname="Capture Length: 62 bytes (496 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp" showname="Protocols in frame: eth:ip:sctp" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.213 (192.168.12.213), Dst: 192.168.12.17 (192.168.12.17)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="48" showname="Total Length: 48" size="2" value="0030"/>
+        <field name="ip.id" pos="18" show="0x0002" showname="Identification: 0x0002 (2)" size="2" value="0002"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0xa00f" showname="Header checksum: 0xa00f [validation disabled]" size="2" value="a00f">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="a00f"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="a00f"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.213" showname="Source: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.213" showname="Source Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="ip.dst" pos="30" show="192.168.12.17" showname="Destination: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.17" showname="Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="28">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x4cd1eca0" showname="Verification tag: 0x4cd1eca0" size="4" value="4cd1eca0"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0x7385d3c3" showname="Checksum: 0x7385d3c3 (not verified)" size="4" value="7385d3c3"/>
+          <field name="" pos="46" show="SACK chunk (Cumulative TSN: 2008295175, a_rwnd: 106447, gaps: 0, duplicate TSNs: 0)" size="16" value="0300001077b4270700019fcf00000000">
+            <field name="sctp.chunk_type" pos="46" show="3" showname="Chunk type: SACK (3)" size="1" value="03">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="03" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="03" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00">
+              <field name="sctp.sack_nounce_sum" pos="47" show="0" showname=".... ...0 = Nounce sum: 0" size="1" unmaskedvalue="00" value="0"/>
+            </field>
+            <field name="sctp.chunk_length" pos="48" show="16" showname="Chunk length: 16" size="2" value="0010"/>
+            <field name="sctp.sack_cumulative_tsn_ack" pos="50" show="2008295175" showname="Cumulative TSN ACK: 2008295175" size="4" value="77b42707"/>
+            <field name="sctp.sack_a_rwnd" pos="54" show="106447" showname="Advertised receiver window credit (a_rwnd): 106447" size="4" value="00019fcf"/>
+            <field name="sctp.sack_number_of_gap_blocks" pos="58" show="0" showname="Number of gap acknowledgement blocks: 0" size="2" value="0000"/>
+            <field name="sctp.sack_number_of_duplicated_tsns" pos="60" show="0" showname="Number of duplicated TSNs: 0" size="2" value="0000"/>
+          </field>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 56: 98 bytes on wire (784 bits), 98 bytes captured (784 bits) on interface 0" size="98">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:34:46.604468000" showname="Arrival Time: Sep 25, 2015 16:34:46.604468000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191686.604468000" showname="Epoch Time: 1443191686.604468000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.112851000" showname="Time delta from previous captured frame: 0.112851000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.112851000" showname="Time delta from previous displayed frame: 0.112851000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="40.138837000" showname="Time since reference or first frame: 40.138837000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="56" showname="Frame Number: 56" size="0"/>
+      <field name="frame.len" pos="0" show="98" showname="Frame Length: 98 bytes (784 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="98" showname="Capture Length: 98 bytes (784 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp" showname="Protocols in frame: eth:ip:sctp" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.213 (192.168.12.213), Dst: 192.168.12.17 (192.168.12.17)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="84" showname="Total Length: 84" size="2" value="0054"/>
+        <field name="ip.id" pos="18" show="0x0003" showname="Identification: 0x0003 (3)" size="2" value="0003"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0x9fea" showname="Header checksum: 0x9fea [validation disabled]" size="2" value="9fea">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="9fea"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="9fea"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.213" showname="Source: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.213" showname="Source Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="ip.dst" pos="30" show="192.168.12.17" showname="Destination: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.17" showname="Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="64">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x4cd1eca0" showname="Verification tag: 0x4cd1eca0" size="4" value="4cd1eca0"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0x0a5b2e92" showname="Checksum: 0x0a5b2e92 (not verified)" size="4" value="0a5b2e92"/>
+          <field name="" pos="46" show="HEARTBEAT chunk (Information: 48 bytes)" size="52" value="040000340001003002008e3cc0a80c110000000000000000007459d10088ffff1e201d8180932214010000007730e920aa62f65b">
+            <field name="sctp.chunk_type" pos="46" show="4" showname="Chunk type: HEARTBEAT (4)" size="1" value="04">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="04" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="04" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00"/>
+            <field name="sctp.chunk_length" pos="48" show="52" showname="Chunk length: 52" size="2" value="0034"/>
+            <field name="" pos="50" show="Heartbeat info parameter (Information: 44 bytes)" size="48" value="0001003002008e3cc0a80c110000000000000000007459d10088ffff1e201d8180932214010000007730e920aa62f65b">
+              <field name="sctp.parameter_type" pos="50" show="0x0001" showname="Parameter type: Heartbeat info (0x0001)" size="2" value="0001">
+                <field name="sctp.parameter_bit_1" pos="50" show="0" showname="0... .... .... .... = Bit: Stop processing of chunk" size="2" unmaskedvalue="0001" value="0"/>
+                <field name="sctp.parameter_bit_2" pos="50" show="0" showname=".0.. .... .... .... = Bit: Do not report" size="2" unmaskedvalue="0001" value="0"/>
+              </field>
+              <field name="sctp.parameter_length" pos="52" show="48" showname="Parameter length: 48" size="2" value="0030"/>
+              <field name="sctp.parameter_heartbeat_information" pos="54" show="02:00:8e:3c:c0:a8:0c:11:00:00:00:00:00:00:00:00:00:74:59:d1:00:88:ff:ff:1e:20:1d:81:80:93:22:14:01:00:00:00:77:30:e9:20:aa:62:f6:5b" showname="Heartbeat information: 02008e3cc0a80c110000000000000000007459d10088ffff..." size="44" value="02008e3cc0a80c110000000000000000007459d10088ffff1e201d8180932214010000007730e920aa62f65b"/>
+            </field>
+          </field>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 57: 98 bytes on wire (784 bits), 98 bytes captured (784 bits) on interface 0" size="98">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:34:46.604504000" showname="Arrival Time: Sep 25, 2015 16:34:46.604504000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191686.604504000" showname="Epoch Time: 1443191686.604504000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.000036000" showname="Time delta from previous captured frame: 0.000036000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.000036000" showname="Time delta from previous displayed frame: 0.000036000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="40.138873000" showname="Time since reference or first frame: 40.138873000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="57" showname="Frame Number: 57" size="0"/>
+      <field name="frame.len" pos="0" show="98" showname="Frame Length: 98 bytes (784 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="98" showname="Capture Length: 98 bytes (784 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp" showname="Protocols in frame: eth:ip:sctp" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.17 (192.168.12.17), Dst: 192.168.12.213 (192.168.12.213)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="84" showname="Total Length: 84" size="2" value="0054"/>
+        <field name="ip.id" pos="18" show="0x0000" showname="Identification: 0x0000 (0)" size="2" value="0000"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0x9fed" showname="Header checksum: 0x9fed [validation disabled]" size="2" value="9fed">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="9fed"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="9fed"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.17" showname="Source: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.17" showname="Source Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="ip.dst" pos="30" show="192.168.12.213" showname="Destination: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.213" showname="Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="64">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x54f837ab" showname="Verification tag: 0x54f837ab" size="4" value="54f837ab"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0x388245ea" showname="Checksum: 0x388245ea (not verified)" size="4" value="388245ea"/>
+          <field name="" pos="46" show="HEARTBEAT_ACK chunk (Information: 48 bytes)" size="52" value="050000340001003002008e3cc0a80c110000000000000000007459d10088ffff1e201d8180932214010000007730e920aa62f65b">
+            <field name="sctp.chunk_type" pos="46" show="5" showname="Chunk type: HEARTBEAT_ACK (5)" size="1" value="05">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="05" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="05" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00"/>
+            <field name="sctp.chunk_length" pos="48" show="52" showname="Chunk length: 52" size="2" value="0034"/>
+            <field name="" pos="50" show="Heartbeat info parameter (Information: 44 bytes)" size="48" value="0001003002008e3cc0a80c110000000000000000007459d10088ffff1e201d8180932214010000007730e920aa62f65b">
+              <field name="sctp.parameter_type" pos="50" show="0x0001" showname="Parameter type: Heartbeat info (0x0001)" size="2" value="0001">
+                <field name="sctp.parameter_bit_1" pos="50" show="0" showname="0... .... .... .... = Bit: Stop processing of chunk" size="2" unmaskedvalue="0001" value="0"/>
+                <field name="sctp.parameter_bit_2" pos="50" show="0" showname=".0.. .... .... .... = Bit: Do not report" size="2" unmaskedvalue="0001" value="0"/>
+              </field>
+              <field name="sctp.parameter_length" pos="52" show="48" showname="Parameter length: 48" size="2" value="0030"/>
+              <field name="sctp.parameter_heartbeat_information" pos="54" show="02:00:8e:3c:c0:a8:0c:11:00:00:00:00:00:00:00:00:00:74:59:d1:00:88:ff:ff:1e:20:1d:81:80:93:22:14:01:00:00:00:77:30:e9:20:aa:62:f6:5b" showname="Heartbeat information: 02008e3cc0a80c110000000000000000007459d10088ffff..." size="44" value="02008e3cc0a80c110000000000000000007459d10088ffff1e201d8180932214010000007730e920aa62f65b"/>
+            </field>
+          </field>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 60: 98 bytes on wire (784 bits), 98 bytes captured (784 bits) on interface 0" size="98">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:34:47.154133000" showname="Arrival Time: Sep 25, 2015 16:34:47.154133000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191687.154133000" showname="Epoch Time: 1443191687.154133000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.500903000" showname="Time delta from previous captured frame: 0.500903000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.500903000" showname="Time delta from previous displayed frame: 0.500903000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="40.688502000" showname="Time since reference or first frame: 40.688502000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="60" showname="Frame Number: 60" size="0"/>
+      <field name="frame.len" pos="0" show="98" showname="Frame Length: 98 bytes (784 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="98" showname="Capture Length: 98 bytes (784 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp" showname="Protocols in frame: eth:ip:sctp" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.17 (192.168.12.17), Dst: 192.168.12.213 (192.168.12.213)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="84" showname="Total Length: 84" size="2" value="0054"/>
+        <field name="ip.id" pos="18" show="0x0000" showname="Identification: 0x0000 (0)" size="2" value="0000"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0x9fed" showname="Header checksum: 0x9fed [validation disabled]" size="2" value="9fed">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="9fed"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="9fed"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.17" showname="Source: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.17" showname="Source Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="ip.dst" pos="30" show="192.168.12.213" showname="Destination: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.213" showname="Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="64">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x54f837ab" showname="Verification tag: 0x54f837ab" size="4" value="54f837ab"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0x3ecfdb18" showname="Checksum: 0x3ecfdb18 (not verified)" size="4" value="3ecfdb18"/>
+          <field name="" pos="46" show="HEARTBEAT chunk (Information: 48 bytes)" size="52" value="040000340001003002008e3cc0a80cd50000000000000000000000000000000000000000e00c3300010000008db53fb930a0b65f">
+            <field name="sctp.chunk_type" pos="46" show="4" showname="Chunk type: HEARTBEAT (4)" size="1" value="04">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="04" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="04" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00"/>
+            <field name="sctp.chunk_length" pos="48" show="52" showname="Chunk length: 52" size="2" value="0034"/>
+            <field name="" pos="50" show="Heartbeat info parameter (Information: 44 bytes)" size="48" value="0001003002008e3cc0a80cd50000000000000000000000000000000000000000e00c3300010000008db53fb930a0b65f">
+              <field name="sctp.parameter_type" pos="50" show="0x0001" showname="Parameter type: Heartbeat info (0x0001)" size="2" value="0001">
+                <field name="sctp.parameter_bit_1" pos="50" show="0" showname="0... .... .... .... = Bit: Stop processing of chunk" size="2" unmaskedvalue="0001" value="0"/>
+                <field name="sctp.parameter_bit_2" pos="50" show="0" showname=".0.. .... .... .... = Bit: Do not report" size="2" unmaskedvalue="0001" value="0"/>
+              </field>
+              <field name="sctp.parameter_length" pos="52" show="48" showname="Parameter length: 48" size="2" value="0030"/>
+              <field name="sctp.parameter_heartbeat_information" pos="54" show="02:00:8e:3c:c0:a8:0c:d5:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:e0:0c:33:00:01:00:00:00:8d:b5:3f:b9:30:a0:b6:5f" showname="Heartbeat information: 02008e3cc0a80cd500000000000000000000000000000000..." size="44" value="02008e3cc0a80cd50000000000000000000000000000000000000000e00c3300010000008db53fb930a0b65f"/>
+            </field>
+          </field>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 61: 98 bytes on wire (784 bits), 98 bytes captured (784 bits) on interface 0" size="98">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:34:47.154270000" showname="Arrival Time: Sep 25, 2015 16:34:47.154270000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191687.154270000" showname="Epoch Time: 1443191687.154270000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.000137000" showname="Time delta from previous captured frame: 0.000137000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.000137000" showname="Time delta from previous displayed frame: 0.000137000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="40.688639000" showname="Time since reference or first frame: 40.688639000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="61" showname="Frame Number: 61" size="0"/>
+      <field name="frame.len" pos="0" show="98" showname="Frame Length: 98 bytes (784 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="98" showname="Capture Length: 98 bytes (784 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp" showname="Protocols in frame: eth:ip:sctp" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.213 (192.168.12.213), Dst: 192.168.12.17 (192.168.12.17)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="84" showname="Total Length: 84" size="2" value="0054"/>
+        <field name="ip.id" pos="18" show="0x0004" showname="Identification: 0x0004 (4)" size="2" value="0004"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0x9fe9" showname="Header checksum: 0x9fe9 [validation disabled]" size="2" value="9fe9">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="9fe9"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="9fe9"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.213" showname="Source: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.213" showname="Source Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="ip.dst" pos="30" show="192.168.12.17" showname="Destination: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.17" showname="Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="64">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x4cd1eca0" showname="Verification tag: 0x4cd1eca0" size="4" value="4cd1eca0"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0x0c16b060" showname="Checksum: 0x0c16b060 (not verified)" size="4" value="0c16b060"/>
+          <field name="" pos="46" show="HEARTBEAT_ACK chunk (Information: 48 bytes)" size="52" value="050000340001003002008e3cc0a80cd50000000000000000000000000000000000000000e00c3300010000008db53fb930a0b65f">
+            <field name="sctp.chunk_type" pos="46" show="5" showname="Chunk type: HEARTBEAT_ACK (5)" size="1" value="05">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="05" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="05" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00"/>
+            <field name="sctp.chunk_length" pos="48" show="52" showname="Chunk length: 52" size="2" value="0034"/>
+            <field name="" pos="50" show="Heartbeat info parameter (Information: 44 bytes)" size="48" value="0001003002008e3cc0a80cd50000000000000000000000000000000000000000e00c3300010000008db53fb930a0b65f">
+              <field name="sctp.parameter_type" pos="50" show="0x0001" showname="Parameter type: Heartbeat info (0x0001)" size="2" value="0001">
+                <field name="sctp.parameter_bit_1" pos="50" show="0" showname="0... .... .... .... = Bit: Stop processing of chunk" size="2" unmaskedvalue="0001" value="0"/>
+                <field name="sctp.parameter_bit_2" pos="50" show="0" showname=".0.. .... .... .... = Bit: Do not report" size="2" unmaskedvalue="0001" value="0"/>
+              </field>
+              <field name="sctp.parameter_length" pos="52" show="48" showname="Parameter length: 48" size="2" value="0030"/>
+              <field name="sctp.parameter_heartbeat_information" pos="54" show="02:00:8e:3c:c0:a8:0c:d5:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:e0:0c:33:00:01:00:00:00:8d:b5:3f:b9:30:a0:b6:5f" showname="Heartbeat information: 02008e3cc0a80cd500000000000000000000000000000000..." size="44" value="02008e3cc0a80cd50000000000000000000000000000000000000000e00c3300010000008db53fb930a0b65f"/>
+            </field>
+          </field>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 76: 186 bytes on wire (1488 bits), 186 bytes captured (1488 bits) on interface 0" size="186">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:34:53.748321000" showname="Arrival Time: Sep 25, 2015 16:34:53.748321000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191693.748321000" showname="Epoch Time: 1443191693.748321000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="1.074002000" showname="Time delta from previous captured frame: 1.074002000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="1.074002000" showname="Time delta from previous displayed frame: 1.074002000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="47.282690000" showname="Time since reference or first frame: 47.282690000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="76" showname="Frame Number: 76" size="0"/>
+      <field name="frame.len" pos="0" show="186" showname="Frame Length: 186 bytes (1488 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="186" showname="Capture Length: 186 bytes (1488 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp:s1ap:s1ap:s1ap:s1ap:nas-eps:ipcp:s1ap:s1ap:s1ap:s1ap" showname="Protocols in frame: eth:ip:sctp:s1ap:s1ap:s1ap:s1ap:nas-eps:ipcp:s1ap:s1ap:s1ap:s1ap" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.213 (192.168.12.213), Dst: 192.168.12.17 (192.168.12.17)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="172" showname="Total Length: 172" size="2" value="00ac"/>
+        <field name="ip.id" pos="18" show="0x0005" showname="Identification: 0x0005 (5)" size="2" value="0005"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0x9f90" showname="Header checksum: 0x9f90 [validation disabled]" size="2" value="9f90">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="9f90"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="9f90"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.213" showname="Source: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.213" showname="Source Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="ip.dst" pos="30" show="192.168.12.17" showname="Destination: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.17" showname="Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="28">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x4cd1eca0" showname="Verification tag: 0x4cd1eca0" size="4" value="4cd1eca0"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0x47f403e8" showname="Checksum: 0x47f403e8 (not verified)" size="4" value="47f403e8"/>
+          <field name="" pos="46" show="DATA chunk(ordered, complete segment, TSN: 3304831192, SID: 1, SSN: 0, PPID: 18, payload length: 122 bytes)" size="16" value="0003008ac4fbb8d80001000000000012">
+            <field name="sctp.chunk_type" pos="46" show="0" showname="Chunk type: DATA (0)" size="1" value="00">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="00" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="00" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x03" showname="Chunk flags: 0x03" size="1" value="03">
+              <field name="sctp.data_e_bit" pos="47" show="1" showname=".... ...1 = E-Bit: Last segment" size="1" unmaskedvalue="03" value="1"/>
+              <field name="sctp.data_b_bit" pos="47" show="1" showname=".... ..1. = B-Bit: First segment" size="1" unmaskedvalue="03" value="1"/>
+              <field name="sctp.data_u_bit" pos="47" show="0" showname=".... .0.. = U-Bit: Ordered delivery" size="1" unmaskedvalue="03" value="0"/>
+              <field name="sctp.data_i_bit" pos="47" show="0" showname=".... 0... = I-Bit: Possibly delay SACK" size="1" unmaskedvalue="03" value="0"/>
+            </field>
+            <field name="sctp.chunk_length" pos="48" show="138" showname="Chunk length: 138" size="2" value="008a"/>
+            <field name="sctp.data_tsn" pos="50" show="3304831192" showname="TSN: 3304831192" size="4" value="c4fbb8d8"/>
+            <field name="sctp.data_sid" pos="54" show="0x0001" showname="Stream Identifier: 0x0001" size="2" value="0001"/>
+            <field name="sctp.data_ssn" pos="56" show="0" showname="Stream sequence number: 0" size="2" value="0000"/>
+            <field name="sctp.data_payload_proto_id" pos="58" show="18" showname="Payload protocol identifier: S1 Application Protocol (S1AP) (18)" size="4" value="00000012"/>
+            <field name="sctp.chunk_padding" pos="184" show="00:00" showname="Chunk padding: 0000" size="2" value="0000"/>
+          </field>
+          <proto name="s1ap" pos="62" showname="S1 Application Protocol" size="122">
+            <field hide="yes" name="per.extension_bit" pos="62" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+            <field hide="yes" name="per.choice_index" pos="62" show="0" showname="Choice Index: 0" size="1" value="00"/>
+            <field name="s1ap.S1AP_PDU" pos="62" show="0" showname="S1AP-PDU: initiatingMessage (0)" size="122" value="000c0076000006000800048006692d001a00414017c4dba6bb020741010bf602f8598000016c00092002e0e000200201d011271a8080211001000010810600000000830600000000000d00000a005202f8590001004300060002f8590001006440080002f85900e000000086400130004b000700000000800001">
+              <field name="s1ap.initiatingMessage" pos="62" show="" showname="initiatingMessage" size="122" value="">
+                <field name="s1ap.procedureCode" pos="63" show="12" showname="procedureCode: id-initialUEMessage (12)" size="1" value="0c"/>
+                <field hide="yes" name="per.enum_index" pos="64" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                <field name="s1ap.criticality" pos="64" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                <field hide="yes" name="per.open_type_length" pos="65" show="118" showname="Open Type Length: 118" size="1" value="76"/>
+                <field name="s1ap.value" pos="66" show="" showname="value" size="118" value="">
+                  <field name="s1ap.InitialUEMessage" pos="66" show="" showname="InitialUEMessage" size="118" value="">
+                    <field hide="yes" name="per.extension_bit" pos="66" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                    <field hide="yes" name="per.sequence_of_length" pos="67" show="6" showname="Sequence-Of Length: 6" size="2" value="0006"/>
+                    <field name="s1ap.protocolIEs" pos="69" show="6" showname="protocolIEs: 6 items" size="115" value="000800048006692d001a00414017c4dba6bb020741010bf602f8598000016c00092002e0e000200201d011271a8080211001000010810600000000830600000000000d00000a005202f8590001004300060002f8590001006440080002f85900e000000086400130004b000700000000800001">
+                      <field name="" pos="69" show="Item 0: id-eNB-UE-S1AP-ID" size="8" value="000800048006692d">
+                        <field name="s1ap.ProtocolIE_Field" pos="69" show="" showname="ProtocolIE-Field" size="8" value="">
+                          <field name="s1ap.id" pos="69" show="8" showname="id: id-eNB-UE-S1AP-ID (8)" size="2" value="0008"/>
+                          <field hide="yes" name="per.enum_index" pos="71" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="71" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="72" show="4" showname="Open Type Length: 4" size="1" value="04"/>
+                          <field name="s1ap.value" pos="73" show="" showname="value" size="4" value="">
+                            <field name="s1ap.ENB_UE_S1AP_ID" pos="73" show="420141" showname="ENB-UE-S1AP-ID: 420141" size="4" value="8006692d"/>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="77" show="Item 1: id-NAS-PDU" size="69" value="001a00414017c4dba6bb020741010bf602f8598000016c00092002e0e000200201d011271a8080211001000010810600000000830600000000000d00000a005202f8590001">
+                        <field name="s1ap.ProtocolIE_Field" pos="77" show="" showname="ProtocolIE-Field" size="69" value="">
+                          <field name="s1ap.id" pos="77" show="26" showname="id: id-NAS-PDU (26)" size="2" value="001a"/>
+                          <field hide="yes" name="per.enum_index" pos="79" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="79" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="80" show="65" showname="Open Type Length: 65" size="1" value="41"/>
+                          <field name="s1ap.value" pos="81" show="" showname="value" size="65" value="">
+                            <field hide="yes" name="per.octet_string_length" pos="81" show="64" showname="Octet String Length: 64" size="1" value="40"/>
+                            <field name="s1ap.NAS_PDU" pos="82" show="17:c4:db:a6:bb:02:07:41:01:0b:f6:02:f8:59:80:00:01:6c:00:09:20:02:e0:e0:00:20:02:01:d0:11:27:1a:80:80:21:10:01:00:00:10:81:06:00:00:00:00:83:06:00:00:00:00:00:0d:00:00:0a:00:52:02:f8:59:00:01" showname="NAS-PDU: 17c4dba6bb020741010bf602f8598000016c00092002e0e0..." size="64" value="17c4dba6bb020741010bf602f8598000016c00092002e0e000200201d011271a8080211001000010810600000000830600000000000d00000a005202f8590001"/>
+                            <proto name="nas-eps" pos="82" showname="Non-Access-Stratum (NAS)PDU" size="64">
+                              <field name="nas_eps.security_header_type" pos="82" show="1" showname="0001 .... = Security header type: Integrity protected (1)" size="1" unmaskedvalue="17" value="1"/>
+                              <field name="gsm_a.L3_protocol_discriminator" pos="82" show="0x07" showname=".... 0111 = Protocol discriminator: EPS mobility management messages (0x07)" size="1" unmaskedvalue="17" value="7"/>
+                              <field name="nas_eps.msg_auth_code" pos="83" show="0xc4dba6bb" showname="Message authentication code: 0xc4dba6bb" size="4" value="c4dba6bb"/>
+                              <field name="nas_eps.seq_no" pos="87" show="2" showname="Sequence number: 2" size="1" value="02"/>
+                              <field name="nas_eps.security_header_type" pos="88" show="0" showname="0000 .... = Security header type: Plain NAS message, not security protected (0)" size="1" unmaskedvalue="07" value="0"/>
+                              <field name="gsm_a.L3_protocol_discriminator" pos="88" show="0x07" showname=".... 0111 = Protocol discriminator: EPS mobility management messages (0x07)" size="1" unmaskedvalue="07" value="7"/>
+                              <field name="nas_eps.nas_msg_emm_type" pos="89" show="0x41" showname="NAS EPS Mobility Management Message Type: Attach request (0x41)" size="1" value="41"/>
+                              <field name="nas_eps.emm.tsc" pos="90" show="0" showname="0... .... = Type of security context flag (TSC): Native security context (for KSIasme)" size="1" value="01"/>
+                              <field name="nas_eps.emm.nas_key_set_id" pos="90" show="0" showname=".000 .... = NAS key set identifier:  (0)" size="1" value="01"/>
+                              <field name="nas_eps.spare_bits" pos="90" show="0x00" showname=".... 0... = Spare bit(s): 0x00" size="1" value="01"/>
+                              <field name="nas_eps.emm.eps_att_type" pos="90" show="1" showname=".... .001 = EPS attach type: EPS attach (1)" size="1" value="01"/>
+                              <field name="" pos="91" show="EPS mobile identity" size="12" value="0bf602f8598000016c000920">
+                                <field name="gsm_a.len" pos="91" show="11" showname="Length: 11" size="1" value="0b"/>
+                                <field name="nas_eps.emm.odd_even" pos="92" show="0" showname=".... 0... = odd/even indic: 0" size="1" unmaskedvalue="f6" value="0"/>
+                                <field name="nas_eps.emm.type_of_id" pos="92" show="6" showname=".... .110 = Type of identity: GUTI (6)" size="1" unmaskedvalue="f6" value="6"/>
+                                <field name="e212.mcc" pos="93" show="208" showname="Mobile Country Code (MCC): France (208)" size="2" value="02f8"/>
+                                <field name="e212.mnc" pos="94" show="95" showname="Mobile Network Code (MNC): Unknown (95)" size="2" value="f859"/>
+                                <field name="nas_eps.emm.mme_grp_id" pos="96" show="32768" showname="MME Group ID: 32768" size="2" value="8000"/>
+                                <field name="nas_eps.emm.mme_code" pos="98" show="1" showname="MME Code: 1" size="1" value="01"/>
+                                <field name="nas_eps.emm.m_tmsi" pos="99" show="0x6c000920" showname="M-TMSI: 0x6c000920" size="4" value="6c000920"/>
+                              </field>
+                              <field name="" pos="103" show="UE network capability" size="3" value="02e0e0">
+                                <field name="gsm_a.len" pos="103" show="2" showname="Length: 2" size="1" value="02"/>
+                                <field name="nas_eps.emm.eea0" pos="104" show="1" showname="1... .... = EEA0: Supported" size="1" unmaskedvalue="e0" value="1"/>
+                                <field name="nas_eps.emm.128eea1" pos="104" show="1" showname=".1.. .... = 128-EEA1: Supported" size="1" unmaskedvalue="e0" value="1"/>
+                                <field name="nas_eps.emm.128eea2" pos="104" show="1" showname="..1. .... = 128-EEA2: Supported" size="1" unmaskedvalue="e0" value="1"/>
+                                <field name="nas_eps.emm.eea3" pos="104" show="0" showname="...0 .... = 128-EEA3: Not Supported" size="1" unmaskedvalue="e0" value="0"/>
+                                <field name="nas_eps.emm.eea4" pos="104" show="0" showname=".... 0... = EEA4: Not Supported" size="1" unmaskedvalue="e0" value="0"/>
+                                <field name="nas_eps.emm.eea5" pos="104" show="0" showname=".... .0.. = EEA5: Not Supported" size="1" unmaskedvalue="e0" value="0"/>
+                                <field name="nas_eps.emm.eea6" pos="104" show="0" showname=".... ..0. = EEA6: Not Supported" size="1" unmaskedvalue="e0" value="0"/>
+                                <field name="nas_eps.emm.eea7" pos="104" show="0" showname=".... ...0 = EEA7: Not Supported" size="1" unmaskedvalue="e0" value="0"/>
+                                <field name="nas_eps.emm.eia0" pos="105" show="1" showname="1... .... = EIA0: Supported" size="1" unmaskedvalue="e0" value="1"/>
+                                <field name="nas_eps.emm.128eia1" pos="105" show="1" showname=".1.. .... = 128-EIA1: Supported" size="1" unmaskedvalue="e0" value="1"/>
+                                <field name="nas_eps.emm.128eia2" pos="105" show="1" showname="..1. .... = 128-EIA2: Supported" size="1" unmaskedvalue="e0" value="1"/>
+                                <field name="nas_eps.emm.eia3" pos="105" show="0" showname="...0 .... = 128-EIA3: Not Supported" size="1" unmaskedvalue="e0" value="0"/>
+                                <field name="nas_eps.emm.eia4" pos="105" show="0" showname=".... 0... = EIA4: Not Supported" size="1" unmaskedvalue="e0" value="0"/>
+                                <field name="nas_eps.emm.eia5" pos="105" show="0" showname=".... .0.. = EIA5: Not Supported" size="1" unmaskedvalue="e0" value="0"/>
+                                <field name="nas_eps.emm.eia6" pos="105" show="0" showname=".... ..0. = EIA6: Not Supported" size="1" unmaskedvalue="e0" value="0"/>
+                                <field name="nas_eps.emm.eia7" pos="105" show="0" showname=".... ...0 = EIA7: Not Supported" size="1" unmaskedvalue="e0" value="0"/>
+                              </field>
+                              <field name="" pos="106" show="ESM message container" size="34" value="00200201d011271a8080211001000010810600000000830600000000000d00000a00">
+                                <field name="gsm_a.len" pos="106" show="32" showname="Length: 32" size="2" value="0020"/>
+                                <field name="nas_eps.emm.esm_msg_cont" pos="108" show="02:01:d0:11:27:1a:80:80:21:10:01:00:00:10:81:06:00:00:00:00:83:06:00:00:00:00:00:0d:00:00:0a:00" showname="ESM message container contents: 0201d011271a808021100100001081060000000083060000..." size="32" value="0201d011271a8080211001000010810600000000830600000000000d00000a00">
+                                  <field name="nas_eps.bearer_id" pos="108" show="0" showname="0000 .... = EPS bearer identity: No EPS bearer identity assigned (0)" size="1" unmaskedvalue="02" value="0"/>
+                                  <field name="gsm_a.L3_protocol_discriminator" pos="108" show="0x02" showname=".... 0010 = Protocol discriminator: EPS session management messages (0x02)" size="1" unmaskedvalue="02" value="2"/>
+                                  <field name="nas_eps.esm.proc_trans_id" pos="109" show="1" showname="Procedure transaction identity: 1" size="1" value="01"/>
+                                  <field name="nas_eps.nas_msg_esm_type" pos="110" show="0xd0" showname="NAS EPS session management messages: PDN connectivity request (0xd0)" size="1" value="d0"/>
+                                  <field name="nas_eps.esm_pdn_type" pos="111" show="1" showname="0001 .... = PDN type: IPv4 (1)" size="1" value="11"/>
+                                  <field name="nas_eps.esm_request_type" pos="111" show="1" showname=".... 0001 = Request type: initial request (1)" size="1" value="11"/>
+                                  <field name="" pos="112" show="Protocol Configuration Options" size="28" value="271a8080211001000010810600000000830600000000000d00000a00">
+                                    <field name="gsm_a.gm.elem_id" pos="112" show="0x27" showname="Element ID: 0x27" size="1" value="27"/>
+                                    <field name="gsm_a.len" pos="113" show="26" showname="Length: 26" size="1" value="1a"/>
+                                    <field name="gsm_a.gm.sm.link_dir" pos="114" show="0" showname="Link direction: MS to network (0)" size="0"/>
+                                    <field name="gsm_a.gm.sm.ext" pos="114" show="1" showname="1... .... = Extension: True" size="1" unmaskedvalue="80" value="1"/>
+                                    <field name="" pos="114" show="Configuration Protocol: PPP for use with IP PDP type or IP PDN type (0)" size="1" value="80"/>
+                                    <field name="gsm_a.gm.sm.pco_pid" pos="115" show="32801" showname="Protocol or Container ID: Internet Protocol Control Protocol (0x8021)" size="2" value="8021">
+                                      <field name="" pos="117" show="Length: 0x10 (16)" size="1" value="10"/>
+                                      <proto name="ipcp" pos="118" showname="PPP IP Control Protocol" size="16">
+                                        <field name="ppp.code" pos="118" show="1" showname="Code: Configuration Request (1)" size="1" value="01"/>
+                                        <field name="ppp.identifier" pos="119" show="0" showname="Identifier: 0 (0x00)" size="1" value="00"/>
+                                        <field name="ppp.length" pos="120" show="16" showname="Length: 16" size="2" value="0010"/>
+                                        <field name="" pos="122" show="Options: (12 bytes), Primary DNS Server IP Address, Secondary DNS Server IP Address" size="12" value="810600000000830600000000">
+                                          <field name="" pos="122" show="Primary DNS Server IP Address: 0.0.0.0" size="6" value="810600000000">
+                                            <field name="ipcp.opt.type" pos="122" show="129" showname="Type: Primary DNS Server IP Address (129)" size="1" value="81"/>
+                                            <field name="ipcp.opt.length" pos="123" show="6" showname="Length: 6" size="1" value="06"/>
+                                            <field name="ipcp.opt.pri_dns_address" pos="124" show="0.0.0.0" showname="Primary DNS Address: 0.0.0.0 (0.0.0.0)" size="4" value="00000000"/>
+                                          </field>
+                                          <field name="" pos="128" show="Secondary DNS Server IP Address: 0.0.0.0" size="6" value="830600000000">
+                                            <field name="ipcp.opt.type" pos="128" show="131" showname="Type: Secondary DNS Server IP Address (131)" size="1" value="83"/>
+                                            <field name="ipcp.opt.length" pos="129" show="6" showname="Length: 6" size="1" value="06"/>
+                                            <field name="ipcp.opt.sec_dns_address" pos="130" show="0.0.0.0" showname="Secondary DNS Address: 0.0.0.0 (0.0.0.0)" size="4" value="00000000"/>
+                                          </field>
+                                        </field>
+                                      </proto>
+                                    </field>
+                                    <field name="gsm_a.gm.sm.pco_pid" pos="134" show="13" showname="Protocol or Container ID: DNS Server IPv4 Address Request (0x000d)" size="2" value="000d">
+                                      <field name="" pos="136" show="Length: 0x00 (0)" size="1" value="00"/>
+                                    </field>
+                                    <field name="gsm_a.gm.sm.pco_pid" pos="137" show="10" showname="Protocol or Container ID: IP address allocation via NAS signalling (0x000a)" size="2" value="000a">
+                                      <field name="" pos="139" show="Length: 0x00 (0)" size="1" value="00"/>
+                                    </field>
+                                  </field>
+                                </field>
+                              </field>
+                              <field name="" pos="140" show="Tracking area identity - Last visited registered TAI" size="6" value="5202f8590001">
+                                <field name="nas_eps.emm.elem_id" pos="140" show="0x52" showname="Element ID: 0x52" size="1" value="52"/>
+                                <field name="e212.mcc" pos="141" show="208" showname="Mobile Country Code (MCC): France (208)" size="2" value="02f8"/>
+                                <field name="e212.mnc" pos="142" show="95" showname="Mobile Network Code (MNC): Unknown (95)" size="2" value="f859"/>
+                                <field name="nas_eps.emm.tai_tac" pos="144" show="0x0001" showname="Tracking area code(TAC): 0x0001" size="2" value="0001"/>
+                              </field>
+                            </proto>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="146" show="Item 2: id-TAI" size="10" value="004300060002f8590001">
+                        <field name="s1ap.ProtocolIE_Field" pos="146" show="" showname="ProtocolIE-Field" size="10" value="">
+                          <field name="s1ap.id" pos="146" show="67" showname="id: id-TAI (67)" size="2" value="0043"/>
+                          <field hide="yes" name="per.enum_index" pos="148" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="148" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="149" show="6" showname="Open Type Length: 6" size="1" value="06"/>
+                          <field name="s1ap.value" pos="150" show="" showname="value" size="6" value="">
+                            <field name="s1ap.TAI" pos="150" show="" showname="TAI" size="6" value="">
+                              <field hide="yes" name="per.extension_bit" pos="150" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                              <field hide="yes" name="per.optional_field_bit" pos="150" show="0" showname=".0.. .... Optional Field Bit: False (iE-Extensions is NOT present)" size="1" unmaskedvalue="00" value="0"/>
+                              <field name="s1ap.pLMNidentity" pos="151" show="02:f8:59" showname="pLMNidentity: 02f859" size="3" value="02f859"/>
+                              <field name="e212.mcc" pos="151" show="208" showname="Mobile Country Code (MCC): France (208)" size="2" value="02f8"/>
+                              <field name="e212.mnc" pos="152" show="95" showname="Mobile Network Code (MNC): Unknown (95)" size="2" value="f859"/>
+                              <field name="s1ap.tAC" pos="154" show="00:01" showname="tAC: 0001" size="2" value="0001"/>
+                            </field>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="156" show="Item 3: id-EUTRAN-CGI" size="12" value="006440080002f85900e00000">
+                        <field name="s1ap.ProtocolIE_Field" pos="156" show="" showname="ProtocolIE-Field" size="12" value="">
+                          <field name="s1ap.id" pos="156" show="100" showname="id: id-EUTRAN-CGI (100)" size="2" value="0064"/>
+                          <field hide="yes" name="per.enum_index" pos="158" show="1" showname="Enumerated Index: 1" size="1" value="40"/>
+                          <field name="s1ap.criticality" pos="158" show="1" showname="criticality: ignore (1)" size="1" value="40"/>
+                          <field hide="yes" name="per.open_type_length" pos="159" show="8" showname="Open Type Length: 8" size="1" value="08"/>
+                          <field name="s1ap.value" pos="160" show="" showname="value" size="8" value="">
+                            <field name="s1ap.EUTRAN_CGI" pos="160" show="" showname="EUTRAN-CGI" size="7" value="">
+                              <field hide="yes" name="per.extension_bit" pos="160" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                              <field hide="yes" name="per.optional_field_bit" pos="160" show="0" showname=".0.. .... Optional Field Bit: False (iE-Extensions is NOT present)" size="1" unmaskedvalue="00" value="0"/>
+                              <field name="s1ap.pLMNidentity" pos="161" show="02:f8:59" showname="pLMNidentity: 02f859" size="3" value="02f859"/>
+                              <field name="e212.mcc" pos="161" show="208" showname="Mobile Country Code (MCC): France (208)" size="2" value="02f8"/>
+                              <field name="e212.mnc" pos="162" show="95" showname="Mobile Network Code (MNC): Unknown (95)" size="2" value="f859"/>
+                              <field name="s1ap.cell_ID" pos="160" show="00:e0:00:00" showname="cell-ID: 00e00000 [bit length 28, 4 LSB pad bits, 0000 0000  1110 0000  0000 0000  0000 .... decimal value 917504]" size="4" value="00e00000"/>
+                            </field>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="168" show="Item 4: id-RRC-Establishment-Cause" size="5" value="0086400130">
+                        <field name="s1ap.ProtocolIE_Field" pos="168" show="" showname="ProtocolIE-Field" size="5" value="">
+                          <field name="s1ap.id" pos="168" show="134" showname="id: id-RRC-Establishment-Cause (134)" size="2" value="0086"/>
+                          <field hide="yes" name="per.enum_index" pos="170" show="1" showname="Enumerated Index: 1" size="1" value="40"/>
+                          <field name="s1ap.criticality" pos="170" show="1" showname="criticality: ignore (1)" size="1" value="40"/>
+                          <field hide="yes" name="per.open_type_length" pos="171" show="1" showname="Open Type Length: 1" size="1" value="01"/>
+                          <field name="s1ap.value" pos="172" show="" showname="value" size="1" value="">
+                            <field hide="yes" name="per.extension_present_bit" pos="172" show="0" showname="0... .... Extension Present Bit: False" size="1" unmaskedvalue="30" value="0"/>
+                            <field hide="yes" name="per.enum_index" pos="172" show="3" showname="Enumerated Index: 3" size="1" value="30"/>
+                            <field name="s1ap.RRC_Establishment_Cause" pos="172" show="3" showname="RRC-Establishment-Cause: mo-Signalling (3)" size="1" value="30"/>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="173" show="Item 5: id-GUMMEI-ID" size="11" value="004b000700000000800001">
+                        <field name="s1ap.ProtocolIE_Field" pos="173" show="" showname="ProtocolIE-Field" size="11" value="">
+                          <field name="s1ap.id" pos="173" show="75" showname="id: id-GUMMEI-ID (75)" size="2" value="004b"/>
+                          <field hide="yes" name="per.enum_index" pos="175" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="175" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="176" show="7" showname="Open Type Length: 7" size="1" value="07"/>
+                          <field name="s1ap.value" pos="177" show="" showname="value" size="7" value="">
+                            <field name="s1ap.GUMMEI" pos="177" show="" showname="GUMMEI" size="7" value="">
+                              <field hide="yes" name="per.extension_bit" pos="177" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                              <field hide="yes" name="per.optional_field_bit" pos="177" show="0" showname=".0.. .... Optional Field Bit: False (iE-Extensions is NOT present)" size="1" unmaskedvalue="00" value="0"/>
+                              <field name="s1ap.pLMN_Identity" pos="178" show="00:00:00" showname="pLMN-Identity: 000000" size="3" value="000000"/>
+                              <field name="e212.mcc" pos="178" show="0" showname="Mobile Country Code (MCC): Unknown (0)" size="2" value="0000"/>
+                              <field name="e212.mnc" pos="179" show="0" showname="Mobile Network Code (MNC): Unknown (000)" size="2" value="0000"/>
+                              <field name="s1ap.mME_Group_ID" pos="181" show="80:00" showname="mME-Group-ID: 8000" size="2" value="8000"/>
+                              <field name="s1ap.mME_Code" pos="183" show="01" showname="mME-Code: 01" size="1" value="01"/>
+                            </field>
+                          </field>
+                        </field>
+                      </field>
+                    </field>
+                  </field>
+                </field>
+              </field>
+            </field>
+          </proto>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 77: 110 bytes on wire (880 bits), 110 bytes captured (880 bits) on interface 0" size="110">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:34:53.749945000" showname="Arrival Time: Sep 25, 2015 16:34:53.749945000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191693.749945000" showname="Epoch Time: 1443191693.749945000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.001624000" showname="Time delta from previous captured frame: 0.001624000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.001624000" showname="Time delta from previous displayed frame: 0.001624000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="47.284314000" showname="Time since reference or first frame: 47.284314000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="77" showname="Frame Number: 77" size="0"/>
+      <field name="frame.len" pos="0" show="110" showname="Frame Length: 110 bytes (880 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="110" showname="Capture Length: 110 bytes (880 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp:s1ap:s1ap:s1ap:s1ap:s1ap:nas-eps" showname="Protocols in frame: eth:ip:sctp:s1ap:s1ap:s1ap:s1ap:s1ap:nas-eps" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.17 (192.168.12.17), Dst: 192.168.12.213 (192.168.12.213)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="96" showname="Total Length: 96" size="2" value="0060"/>
+        <field name="ip.id" pos="18" show="0x0000" showname="Identification: 0x0000 (0)" size="2" value="0000"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0x9fe1" showname="Header checksum: 0x9fe1 [validation disabled]" size="2" value="9fe1">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="9fe1"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="9fe1"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.17" showname="Source: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.17" showname="Source Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="ip.dst" pos="30" show="192.168.12.213" showname="Destination: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.213" showname="Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="44">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x54f837ab" showname="Verification tag: 0x54f837ab" size="4" value="54f837ab"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0x69f9ecaa" showname="Checksum: 0x69f9ecaa (not verified)" size="4" value="69f9ecaa"/>
+          <field name="" pos="46" show="SACK chunk (Cumulative TSN: 3304831192, a_rwnd: 106496, gaps: 0, duplicate TSNs: 0)" size="16" value="03000010c4fbb8d80001a00000000000">
+            <field name="sctp.chunk_type" pos="46" show="3" showname="Chunk type: SACK (3)" size="1" value="03">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="03" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="03" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00">
+              <field name="sctp.sack_nounce_sum" pos="47" show="0" showname=".... ...0 = Nounce sum: 0" size="1" unmaskedvalue="00" value="0"/>
+            </field>
+            <field name="sctp.chunk_length" pos="48" show="16" showname="Chunk length: 16" size="2" value="0010"/>
+            <field name="sctp.sack_cumulative_tsn_ack" pos="50" show="3304831192" showname="Cumulative TSN ACK: 3304831192" size="4" value="c4fbb8d8"/>
+            <field name="sctp.sack_a_rwnd" pos="54" show="106496" showname="Advertised receiver window credit (a_rwnd): 106496" size="4" value="0001a000"/>
+            <field name="sctp.sack_number_of_gap_blocks" pos="58" show="0" showname="Number of gap acknowledgement blocks: 0" size="2" value="0000"/>
+            <field name="sctp.sack_number_of_duplicated_tsns" pos="60" show="0" showname="Number of duplicated TSNs: 0" size="2" value="0000"/>
+          </field>
+          <field name="" pos="62" show="DATA chunk(ordered, complete segment, TSN: 2008295176, SID: 1, SSN: 0, PPID: 301989888, payload length: 32 bytes)" size="16" value="0003003077b427080001000012000000">
+            <field name="sctp.chunk_type" pos="62" show="0" showname="Chunk type: DATA (0)" size="1" value="00">
+              <field name="sctp.chunk_bit_1" pos="62" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="00" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="62" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="00" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="63" show="0x03" showname="Chunk flags: 0x03" size="1" value="03">
+              <field name="sctp.data_e_bit" pos="63" show="1" showname=".... ...1 = E-Bit: Last segment" size="1" unmaskedvalue="03" value="1"/>
+              <field name="sctp.data_b_bit" pos="63" show="1" showname=".... ..1. = B-Bit: First segment" size="1" unmaskedvalue="03" value="1"/>
+              <field name="sctp.data_u_bit" pos="63" show="0" showname=".... .0.. = U-Bit: Ordered delivery" size="1" unmaskedvalue="03" value="0"/>
+              <field name="sctp.data_i_bit" pos="63" show="0" showname=".... 0... = I-Bit: Possibly delay SACK" size="1" unmaskedvalue="03" value="0"/>
+            </field>
+            <field name="sctp.chunk_length" pos="64" show="48" showname="Chunk length: 48" size="2" value="0030"/>
+            <field name="sctp.data_tsn" pos="66" show="2008295176" showname="TSN: 2008295176" size="4" value="77b42708"/>
+            <field name="sctp.data_sid" pos="70" show="0x0001" showname="Stream Identifier: 0x0001" size="2" value="0001"/>
+            <field name="sctp.data_ssn" pos="72" show="0" showname="Stream sequence number: 0" size="2" value="0000"/>
+            <field name="sctp.data_payload_proto_id" pos="74" show="301989888" showname="Payload protocol identifier: Unknown (301989888)" size="4" value="12000000"/>
+          </field>
+          <proto name="s1ap" pos="78" showname="S1 Application Protocol" size="32">
+            <field hide="yes" name="per.extension_bit" pos="78" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+            <field hide="yes" name="per.choice_index" pos="78" show="0" showname="Choice Index: 0" size="1" value="00"/>
+            <field name="s1ap.S1AP_PDU" pos="78" show="0" showname="S1AP-PDU: initiatingMessage (0)" size="32" value="000b001c00000300000005c0740010d0000800048006692d001a000403075501">
+              <field name="s1ap.initiatingMessage" pos="78" show="" showname="initiatingMessage" size="32" value="">
+                <field name="s1ap.procedureCode" pos="79" show="11" showname="procedureCode: id-downlinkNASTransport (11)" size="1" value="0b"/>
+                <field hide="yes" name="per.enum_index" pos="80" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                <field name="s1ap.criticality" pos="80" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                <field hide="yes" name="per.open_type_length" pos="81" show="28" showname="Open Type Length: 28" size="1" value="1c"/>
+                <field name="s1ap.value" pos="82" show="" showname="value" size="28" value="">
+                  <field name="s1ap.DownlinkNASTransport" pos="82" show="" showname="DownlinkNASTransport" size="28" value="">
+                    <field hide="yes" name="per.extension_bit" pos="82" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                    <field hide="yes" name="per.sequence_of_length" pos="83" show="3" showname="Sequence-Of Length: 3" size="2" value="0003"/>
+                    <field name="s1ap.protocolIEs" pos="85" show="3" showname="protocolIEs: 3 items" size="25" value="00000005c0740010d0000800048006692d001a000403075501">
+                      <field name="" pos="85" show="Item 0: id-MME-UE-S1AP-ID" size="9" value="00000005c0740010d0">
+                        <field name="s1ap.ProtocolIE_Field" pos="85" show="" showname="ProtocolIE-Field" size="9" value="">
+                          <field name="s1ap.id" pos="85" show="0" showname="id: id-MME-UE-S1AP-ID (0)" size="2" value="0000"/>
+                          <field hide="yes" name="per.enum_index" pos="87" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="87" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="88" show="5" showname="Open Type Length: 5" size="1" value="05"/>
+                          <field name="s1ap.value" pos="89" show="" showname="value" size="5" value="">
+                            <field name="s1ap.MME_UE_S1AP_ID" pos="89" show="1946161360" showname="MME-UE-S1AP-ID: 1946161360" size="5" value="c0740010d0"/>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="94" show="Item 1: id-eNB-UE-S1AP-ID" size="8" value="000800048006692d">
+                        <field name="s1ap.ProtocolIE_Field" pos="94" show="" showname="ProtocolIE-Field" size="8" value="">
+                          <field name="s1ap.id" pos="94" show="8" showname="id: id-eNB-UE-S1AP-ID (8)" size="2" value="0008"/>
+                          <field hide="yes" name="per.enum_index" pos="96" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="96" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="97" show="4" showname="Open Type Length: 4" size="1" value="04"/>
+                          <field name="s1ap.value" pos="98" show="" showname="value" size="4" value="">
+                            <field name="s1ap.ENB_UE_S1AP_ID" pos="98" show="420141" showname="ENB-UE-S1AP-ID: 420141" size="4" value="8006692d"/>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="102" show="Item 2: id-NAS-PDU" size="8" value="001a000403075501">
+                        <field name="s1ap.ProtocolIE_Field" pos="102" show="" showname="ProtocolIE-Field" size="8" value="">
+                          <field name="s1ap.id" pos="102" show="26" showname="id: id-NAS-PDU (26)" size="2" value="001a"/>
+                          <field hide="yes" name="per.enum_index" pos="104" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="104" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="105" show="4" showname="Open Type Length: 4" size="1" value="04"/>
+                          <field name="s1ap.value" pos="106" show="" showname="value" size="4" value="">
+                            <field hide="yes" name="per.octet_string_length" pos="106" show="3" showname="Octet String Length: 3" size="1" value="03"/>
+                            <field name="s1ap.NAS_PDU" pos="107" show="07:55:01" showname="NAS-PDU: 075501" size="3" value="075501"/>
+                            <proto name="nas-eps" pos="107" showname="Non-Access-Stratum (NAS)PDU" size="3">
+                              <field name="nas_eps.security_header_type" pos="107" show="0" showname="0000 .... = Security header type: Plain NAS message, not security protected (0)" size="1" unmaskedvalue="07" value="0"/>
+                              <field name="gsm_a.L3_protocol_discriminator" pos="107" show="0x07" showname=".... 0111 = Protocol discriminator: EPS mobility management messages (0x07)" size="1" unmaskedvalue="07" value="7"/>
+                              <field name="nas_eps.nas_msg_emm_type" pos="108" show="0x55" showname="NAS EPS Mobility Management Message Type: Identity request (0x55)" size="1" value="55"/>
+                              <field name="nas_eps.emm.spare_half_octet" pos="109" show="0" showname="0000 .... = Spare half octet: 0" size="1" value="01"/>
+                              <field name="nas_eps.emm.id_type2" pos="109" show="1" showname=".... 0001 = Identity type 2: IMSI (1)" size="1" value="01"/>
+                            </proto>
+                          </field>
+                        </field>
+                      </field>
+                    </field>
+                  </field>
+                </field>
+              </field>
+            </field>
+          </proto>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 78: 146 bytes on wire (1168 bits), 146 bytes captured (1168 bits) on interface 0" size="146">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:34:53.767126000" showname="Arrival Time: Sep 25, 2015 16:34:53.767126000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191693.767126000" showname="Epoch Time: 1443191693.767126000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.017181000" showname="Time delta from previous captured frame: 0.017181000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.017181000" showname="Time delta from previous displayed frame: 0.017181000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="47.301495000" showname="Time since reference or first frame: 47.301495000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="78" showname="Frame Number: 78" size="0"/>
+      <field name="frame.len" pos="0" show="146" showname="Frame Length: 146 bytes (1168 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="146" showname="Capture Length: 146 bytes (1168 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp:s1ap:s1ap:s1ap:s1ap:s1ap:nas-eps:s1ap:s1ap" showname="Protocols in frame: eth:ip:sctp:s1ap:s1ap:s1ap:s1ap:s1ap:nas-eps:s1ap:s1ap" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.213 (192.168.12.213), Dst: 192.168.12.17 (192.168.12.17)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="132" showname="Total Length: 132" size="2" value="0084"/>
+        <field name="ip.id" pos="18" show="0x0006" showname="Identification: 0x0006 (6)" size="2" value="0006"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0x9fb7" showname="Header checksum: 0x9fb7 [validation disabled]" size="2" value="9fb7">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="9fb7"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="9fb7"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.213" showname="Source: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.213" showname="Source Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="ip.dst" pos="30" show="192.168.12.17" showname="Destination: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.17" showname="Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="44">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x4cd1eca0" showname="Verification tag: 0x4cd1eca0" size="4" value="4cd1eca0"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0x6cae2fa5" showname="Checksum: 0x6cae2fa5 (not verified)" size="4" value="6cae2fa5"/>
+          <field name="" pos="46" show="SACK chunk (Cumulative TSN: 2008295176, a_rwnd: 106496, gaps: 0, duplicate TSNs: 0)" size="16" value="0300001077b427080001a00000000000">
+            <field name="sctp.chunk_type" pos="46" show="3" showname="Chunk type: SACK (3)" size="1" value="03">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="03" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="03" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00">
+              <field name="sctp.sack_nounce_sum" pos="47" show="0" showname=".... ...0 = Nounce sum: 0" size="1" unmaskedvalue="00" value="0"/>
+            </field>
+            <field name="sctp.chunk_length" pos="48" show="16" showname="Chunk length: 16" size="2" value="0010"/>
+            <field name="sctp.sack_cumulative_tsn_ack" pos="50" show="2008295176" showname="Cumulative TSN ACK: 2008295176" size="4" value="77b42708"/>
+            <field name="sctp.sack_a_rwnd" pos="54" show="106496" showname="Advertised receiver window credit (a_rwnd): 106496" size="4" value="0001a000"/>
+            <field name="sctp.sack_number_of_gap_blocks" pos="58" show="0" showname="Number of gap acknowledgement blocks: 0" size="2" value="0000"/>
+            <field name="sctp.sack_number_of_duplicated_tsns" pos="60" show="0" showname="Number of duplicated TSNs: 0" size="2" value="0000"/>
+          </field>
+          <field name="" pos="62" show="DATA chunk(ordered, complete segment, TSN: 3304831193, SID: 1, SSN: 1, PPID: 18, payload length: 68 bytes)" size="16" value="00030054c4fbb8d90001000100000012">
+            <field name="sctp.chunk_type" pos="62" show="0" showname="Chunk type: DATA (0)" size="1" value="00">
+              <field name="sctp.chunk_bit_1" pos="62" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="00" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="62" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="00" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="63" show="0x03" showname="Chunk flags: 0x03" size="1" value="03">
+              <field name="sctp.data_e_bit" pos="63" show="1" showname=".... ...1 = E-Bit: Last segment" size="1" unmaskedvalue="03" value="1"/>
+              <field name="sctp.data_b_bit" pos="63" show="1" showname=".... ..1. = B-Bit: First segment" size="1" unmaskedvalue="03" value="1"/>
+              <field name="sctp.data_u_bit" pos="63" show="0" showname=".... .0.. = U-Bit: Ordered delivery" size="1" unmaskedvalue="03" value="0"/>
+              <field name="sctp.data_i_bit" pos="63" show="0" showname=".... 0... = I-Bit: Possibly delay SACK" size="1" unmaskedvalue="03" value="0"/>
+            </field>
+            <field name="sctp.chunk_length" pos="64" show="84" showname="Chunk length: 84" size="2" value="0054"/>
+            <field name="sctp.data_tsn" pos="66" show="3304831193" showname="TSN: 3304831193" size="4" value="c4fbb8d9"/>
+            <field name="sctp.data_sid" pos="70" show="0x0001" showname="Stream Identifier: 0x0001" size="2" value="0001"/>
+            <field name="sctp.data_ssn" pos="72" show="1" showname="Stream sequence number: 1" size="2" value="0001"/>
+            <field name="sctp.data_payload_proto_id" pos="74" show="18" showname="Payload protocol identifier: S1 Application Protocol (S1AP) (18)" size="4" value="00000012"/>
+          </field>
+          <proto name="s1ap" pos="78" showname="S1 Application Protocol" size="68">
+            <field hide="yes" name="per.extension_bit" pos="78" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+            <field hide="yes" name="per.choice_index" pos="78" show="0" showname="Choice Index: 0" size="1" value="00"/>
+            <field name="s1ap.S1AP_PDU" pos="78" show="0" showname="S1AP-PDU: initiatingMessage (0)" size="68" value="000d404000000500000005c0740010d0000800048006692d001a00121117b3e0e284030756082980590000000020006440080002f85900e00000004340060002f8590001">
+              <field name="s1ap.initiatingMessage" pos="78" show="" showname="initiatingMessage" size="68" value="">
+                <field name="s1ap.procedureCode" pos="79" show="13" showname="procedureCode: id-uplinkNASTransport (13)" size="1" value="0d"/>
+                <field hide="yes" name="per.enum_index" pos="80" show="1" showname="Enumerated Index: 1" size="1" value="40"/>
+                <field name="s1ap.criticality" pos="80" show="1" showname="criticality: ignore (1)" size="1" value="40"/>
+                <field hide="yes" name="per.open_type_length" pos="81" show="64" showname="Open Type Length: 64" size="1" value="40"/>
+                <field name="s1ap.value" pos="82" show="" showname="value" size="64" value="">
+                  <field name="s1ap.UplinkNASTransport" pos="82" show="" showname="UplinkNASTransport" size="64" value="">
+                    <field hide="yes" name="per.extension_bit" pos="82" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                    <field hide="yes" name="per.sequence_of_length" pos="83" show="5" showname="Sequence-Of Length: 5" size="2" value="0005"/>
+                    <field name="s1ap.protocolIEs" pos="85" show="5" showname="protocolIEs: 5 items" size="61" value="00000005c0740010d0000800048006692d001a00121117b3e0e284030756082980590000000020006440080002f85900e00000004340060002f8590001">
+                      <field name="" pos="85" show="Item 0: id-MME-UE-S1AP-ID" size="9" value="00000005c0740010d0">
+                        <field name="s1ap.ProtocolIE_Field" pos="85" show="" showname="ProtocolIE-Field" size="9" value="">
+                          <field name="s1ap.id" pos="85" show="0" showname="id: id-MME-UE-S1AP-ID (0)" size="2" value="0000"/>
+                          <field hide="yes" name="per.enum_index" pos="87" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="87" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="88" show="5" showname="Open Type Length: 5" size="1" value="05"/>
+                          <field name="s1ap.value" pos="89" show="" showname="value" size="5" value="">
+                            <field name="s1ap.MME_UE_S1AP_ID" pos="89" show="1946161360" showname="MME-UE-S1AP-ID: 1946161360" size="5" value="c0740010d0"/>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="94" show="Item 1: id-eNB-UE-S1AP-ID" size="8" value="000800048006692d">
+                        <field name="s1ap.ProtocolIE_Field" pos="94" show="" showname="ProtocolIE-Field" size="8" value="">
+                          <field name="s1ap.id" pos="94" show="8" showname="id: id-eNB-UE-S1AP-ID (8)" size="2" value="0008"/>
+                          <field hide="yes" name="per.enum_index" pos="96" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="96" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="97" show="4" showname="Open Type Length: 4" size="1" value="04"/>
+                          <field name="s1ap.value" pos="98" show="" showname="value" size="4" value="">
+                            <field name="s1ap.ENB_UE_S1AP_ID" pos="98" show="420141" showname="ENB-UE-S1AP-ID: 420141" size="4" value="8006692d"/>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="102" show="Item 2: id-NAS-PDU" size="22" value="001a00121117b3e0e284030756082980590000000020">
+                        <field name="s1ap.ProtocolIE_Field" pos="102" show="" showname="ProtocolIE-Field" size="22" value="">
+                          <field name="s1ap.id" pos="102" show="26" showname="id: id-NAS-PDU (26)" size="2" value="001a"/>
+                          <field hide="yes" name="per.enum_index" pos="104" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="104" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="105" show="18" showname="Open Type Length: 18" size="1" value="12"/>
+                          <field name="s1ap.value" pos="106" show="" showname="value" size="18" value="">
+                            <field hide="yes" name="per.octet_string_length" pos="106" show="17" showname="Octet String Length: 17" size="1" value="11"/>
+                            <field name="s1ap.NAS_PDU" pos="107" show="17:b3:e0:e2:84:03:07:56:08:29:80:59:00:00:00:00:20" showname="NAS-PDU: 17b3e0e284030756082980590000000020" size="17" value="17b3e0e284030756082980590000000020"/>
+                            <proto name="nas-eps" pos="107" showname="Non-Access-Stratum (NAS)PDU" size="17">
+                              <field name="nas_eps.security_header_type" pos="107" show="1" showname="0001 .... = Security header type: Integrity protected (1)" size="1" unmaskedvalue="17" value="1"/>
+                              <field name="gsm_a.L3_protocol_discriminator" pos="107" show="0x07" showname=".... 0111 = Protocol discriminator: EPS mobility management messages (0x07)" size="1" unmaskedvalue="17" value="7"/>
+                              <field name="nas_eps.msg_auth_code" pos="108" show="0xb3e0e284" showname="Message authentication code: 0xb3e0e284" size="4" value="b3e0e284"/>
+                              <field name="nas_eps.seq_no" pos="112" show="3" showname="Sequence number: 3" size="1" value="03"/>
+                              <field name="nas_eps.security_header_type" pos="113" show="0" showname="0000 .... = Security header type: Plain NAS message, not security protected (0)" size="1" unmaskedvalue="07" value="0"/>
+                              <field name="gsm_a.L3_protocol_discriminator" pos="113" show="0x07" showname=".... 0111 = Protocol discriminator: EPS mobility management messages (0x07)" size="1" unmaskedvalue="07" value="7"/>
+                              <field name="nas_eps.nas_msg_emm_type" pos="114" show="0x56" showname="NAS EPS Mobility Management Message Type: Identity response (0x56)" size="1" value="56"/>
+                              <field name="" pos="115" show="Mobile identity - IMSI (208950000000002)" size="9" value="082980590000000020">
+                                <field name="gsm_a.len" pos="115" show="8" showname="Length: 8" size="1" value="08"/>
+                                <field name="" pos="116" show="0010 .... = Identity Digit 1: 2" size="1" value="29"/>
+                                <field name="gsm_a.oddevenind" pos="116" show="1" showname=".... 1... = Odd/even indication: Odd number of identity digits" size="1" unmaskedvalue="29" value="1"/>
+                                <field name="gsm_a.ie.mobileid.type" pos="116" show="1" showname=".... .001 = Mobile Identity Type: IMSI (1)" size="1" unmaskedvalue="29" value="1"/>
+                                <field name="gsm_a.imsi" pos="116" show="208950000000002" showname="BCD Digits: 208950000000002" size="8" value="2980590000000020"/>
+                              </field>
+                            </proto>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="124" show="Item 3: id-EUTRAN-CGI" size="12" value="006440080002f85900e00000">
+                        <field name="s1ap.ProtocolIE_Field" pos="124" show="" showname="ProtocolIE-Field" size="12" value="">
+                          <field name="s1ap.id" pos="124" show="100" showname="id: id-EUTRAN-CGI (100)" size="2" value="0064"/>
+                          <field hide="yes" name="per.enum_index" pos="126" show="1" showname="Enumerated Index: 1" size="1" value="40"/>
+                          <field name="s1ap.criticality" pos="126" show="1" showname="criticality: ignore (1)" size="1" value="40"/>
+                          <field hide="yes" name="per.open_type_length" pos="127" show="8" showname="Open Type Length: 8" size="1" value="08"/>
+                          <field name="s1ap.value" pos="128" show="" showname="value" size="8" value="">
+                            <field name="s1ap.EUTRAN_CGI" pos="128" show="" showname="EUTRAN-CGI" size="7" value="">
+                              <field hide="yes" name="per.extension_bit" pos="128" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                              <field hide="yes" name="per.optional_field_bit" pos="128" show="0" showname=".0.. .... Optional Field Bit: False (iE-Extensions is NOT present)" size="1" unmaskedvalue="00" value="0"/>
+                              <field name="s1ap.pLMNidentity" pos="129" show="02:f8:59" showname="pLMNidentity: 02f859" size="3" value="02f859"/>
+                              <field name="e212.mcc" pos="129" show="208" showname="Mobile Country Code (MCC): France (208)" size="2" value="02f8"/>
+                              <field name="e212.mnc" pos="130" show="95" showname="Mobile Network Code (MNC): Unknown (95)" size="2" value="f859"/>
+                              <field name="s1ap.cell_ID" pos="128" show="00:e0:00:00" showname="cell-ID: 00e00000 [bit length 28, 4 LSB pad bits, 0000 0000  1110 0000  0000 0000  0000 .... decimal value 917504]" size="4" value="00e00000"/>
+                            </field>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="136" show="Item 4: id-TAI" size="10" value="004340060002f8590001">
+                        <field name="s1ap.ProtocolIE_Field" pos="136" show="" showname="ProtocolIE-Field" size="10" value="">
+                          <field name="s1ap.id" pos="136" show="67" showname="id: id-TAI (67)" size="2" value="0043"/>
+                          <field hide="yes" name="per.enum_index" pos="138" show="1" showname="Enumerated Index: 1" size="1" value="40"/>
+                          <field name="s1ap.criticality" pos="138" show="1" showname="criticality: ignore (1)" size="1" value="40"/>
+                          <field hide="yes" name="per.open_type_length" pos="139" show="6" showname="Open Type Length: 6" size="1" value="06"/>
+                          <field name="s1ap.value" pos="140" show="" showname="value" size="6" value="">
+                            <field name="s1ap.TAI" pos="140" show="" showname="TAI" size="6" value="">
+                              <field hide="yes" name="per.extension_bit" pos="140" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                              <field hide="yes" name="per.optional_field_bit" pos="140" show="0" showname=".0.. .... Optional Field Bit: False (iE-Extensions is NOT present)" size="1" unmaskedvalue="00" value="0"/>
+                              <field name="s1ap.pLMNidentity" pos="141" show="02:f8:59" showname="pLMNidentity: 02f859" size="3" value="02f859"/>
+                              <field name="e212.mcc" pos="141" show="208" showname="Mobile Country Code (MCC): France (208)" size="2" value="02f8"/>
+                              <field name="e212.mnc" pos="142" show="95" showname="Mobile Network Code (MNC): Unknown (95)" size="2" value="f859"/>
+                              <field name="s1ap.tAC" pos="144" show="00:01" showname="tAC: 0001" size="2" value="0001"/>
+                            </field>
+                          </field>
+                        </field>
+                      </field>
+                    </field>
+                  </field>
+                </field>
+              </field>
+            </field>
+          </proto>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 79: 146 bytes on wire (1168 bits), 146 bytes captured (1168 bits) on interface 0" size="146">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:34:53.771623000" showname="Arrival Time: Sep 25, 2015 16:34:53.771623000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191693.771623000" showname="Epoch Time: 1443191693.771623000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.004497000" showname="Time delta from previous captured frame: 0.004497000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.004497000" showname="Time delta from previous displayed frame: 0.004497000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="47.305992000" showname="Time since reference or first frame: 47.305992000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="79" showname="Frame Number: 79" size="0"/>
+      <field name="frame.len" pos="0" show="146" showname="Frame Length: 146 bytes (1168 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="146" showname="Capture Length: 146 bytes (1168 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp:s1ap:s1ap:s1ap:s1ap:s1ap:nas-eps" showname="Protocols in frame: eth:ip:sctp:s1ap:s1ap:s1ap:s1ap:s1ap:nas-eps" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.17 (192.168.12.17), Dst: 192.168.12.213 (192.168.12.213)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="132" showname="Total Length: 132" size="2" value="0084"/>
+        <field name="ip.id" pos="18" show="0x0000" showname="Identification: 0x0000 (0)" size="2" value="0000"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0x9fbd" showname="Header checksum: 0x9fbd [validation disabled]" size="2" value="9fbd">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="9fbd"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="9fbd"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.17" showname="Source: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.17" showname="Source Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="ip.dst" pos="30" show="192.168.12.213" showname="Destination: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.213" showname="Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="44">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x54f837ab" showname="Verification tag: 0x54f837ab" size="4" value="54f837ab"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0xf61432bc" showname="Checksum: 0xf61432bc (not verified)" size="4" value="f61432bc"/>
+          <field name="" pos="46" show="SACK chunk (Cumulative TSN: 3304831193, a_rwnd: 106496, gaps: 0, duplicate TSNs: 0)" size="16" value="03000010c4fbb8d90001a00000000000">
+            <field name="sctp.chunk_type" pos="46" show="3" showname="Chunk type: SACK (3)" size="1" value="03">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="03" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="03" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00">
+              <field name="sctp.sack_nounce_sum" pos="47" show="0" showname=".... ...0 = Nounce sum: 0" size="1" unmaskedvalue="00" value="0"/>
+            </field>
+            <field name="sctp.chunk_length" pos="48" show="16" showname="Chunk length: 16" size="2" value="0010"/>
+            <field name="sctp.sack_cumulative_tsn_ack" pos="50" show="3304831193" showname="Cumulative TSN ACK: 3304831193" size="4" value="c4fbb8d9"/>
+            <field name="sctp.sack_a_rwnd" pos="54" show="106496" showname="Advertised receiver window credit (a_rwnd): 106496" size="4" value="0001a000"/>
+            <field name="sctp.sack_number_of_gap_blocks" pos="58" show="0" showname="Number of gap acknowledgement blocks: 0" size="2" value="0000"/>
+            <field name="sctp.sack_number_of_duplicated_tsns" pos="60" show="0" showname="Number of duplicated TSNs: 0" size="2" value="0000"/>
+          </field>
+          <field name="" pos="62" show="DATA chunk(ordered, complete segment, TSN: 2008295177, SID: 1, SSN: 1, PPID: 301989888, payload length: 65 bytes)" size="16" value="0003005177b427090001000112000000">
+            <field name="sctp.chunk_type" pos="62" show="0" showname="Chunk type: DATA (0)" size="1" value="00">
+              <field name="sctp.chunk_bit_1" pos="62" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="00" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="62" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="00" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="63" show="0x03" showname="Chunk flags: 0x03" size="1" value="03">
+              <field name="sctp.data_e_bit" pos="63" show="1" showname=".... ...1 = E-Bit: Last segment" size="1" unmaskedvalue="03" value="1"/>
+              <field name="sctp.data_b_bit" pos="63" show="1" showname=".... ..1. = B-Bit: First segment" size="1" unmaskedvalue="03" value="1"/>
+              <field name="sctp.data_u_bit" pos="63" show="0" showname=".... .0.. = U-Bit: Ordered delivery" size="1" unmaskedvalue="03" value="0"/>
+              <field name="sctp.data_i_bit" pos="63" show="0" showname=".... 0... = I-Bit: Possibly delay SACK" size="1" unmaskedvalue="03" value="0"/>
+            </field>
+            <field name="sctp.chunk_length" pos="64" show="81" showname="Chunk length: 81" size="2" value="0051"/>
+            <field name="sctp.data_tsn" pos="66" show="2008295177" showname="TSN: 2008295177" size="4" value="77b42709"/>
+            <field name="sctp.data_sid" pos="70" show="0x0001" showname="Stream Identifier: 0x0001" size="2" value="0001"/>
+            <field name="sctp.data_ssn" pos="72" show="1" showname="Stream sequence number: 1" size="2" value="0001"/>
+            <field name="sctp.data_payload_proto_id" pos="74" show="301989888" showname="Payload protocol identifier: Unknown (301989888)" size="4" value="12000000"/>
+            <field name="sctp.chunk_padding" pos="143" show="00:00:00" showname="Chunk padding: 000000" size="3" value="000000"/>
+          </field>
+          <proto name="s1ap" pos="78" showname="S1 Application Protocol" size="65">
+            <field hide="yes" name="per.extension_bit" pos="78" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+            <field hide="yes" name="per.choice_index" pos="78" show="0" showname="Choice Index: 0" size="1" value="00"/>
+            <field name="s1ap.S1AP_PDU" pos="78" show="0" showname="S1AP-PDU: initiatingMessage (0)" size="65" value="000b003d00000300000005c0740010d0000800048006692d001a00252407520007cefaf5dd90a76da30d2c6775f4e41f10a19ee7945f198000a2a656d4988ff528">
+              <field name="s1ap.initiatingMessage" pos="78" show="" showname="initiatingMessage" size="65" value="">
+                <field name="s1ap.procedureCode" pos="79" show="11" showname="procedureCode: id-downlinkNASTransport (11)" size="1" value="0b"/>
+                <field hide="yes" name="per.enum_index" pos="80" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                <field name="s1ap.criticality" pos="80" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                <field hide="yes" name="per.open_type_length" pos="81" show="61" showname="Open Type Length: 61" size="1" value="3d"/>
+                <field name="s1ap.value" pos="82" show="" showname="value" size="61" value="">
+                  <field name="s1ap.DownlinkNASTransport" pos="82" show="" showname="DownlinkNASTransport" size="61" value="">
+                    <field hide="yes" name="per.extension_bit" pos="82" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                    <field hide="yes" name="per.sequence_of_length" pos="83" show="3" showname="Sequence-Of Length: 3" size="2" value="0003"/>
+                    <field name="s1ap.protocolIEs" pos="85" show="3" showname="protocolIEs: 3 items" size="58" value="00000005c0740010d0000800048006692d001a00252407520007cefaf5dd90a76da30d2c6775f4e41f10a19ee7945f198000a2a656d4988ff528">
+                      <field name="" pos="85" show="Item 0: id-MME-UE-S1AP-ID" size="9" value="00000005c0740010d0">
+                        <field name="s1ap.ProtocolIE_Field" pos="85" show="" showname="ProtocolIE-Field" size="9" value="">
+                          <field name="s1ap.id" pos="85" show="0" showname="id: id-MME-UE-S1AP-ID (0)" size="2" value="0000"/>
+                          <field hide="yes" name="per.enum_index" pos="87" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="87" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="88" show="5" showname="Open Type Length: 5" size="1" value="05"/>
+                          <field name="s1ap.value" pos="89" show="" showname="value" size="5" value="">
+                            <field name="s1ap.MME_UE_S1AP_ID" pos="89" show="1946161360" showname="MME-UE-S1AP-ID: 1946161360" size="5" value="c0740010d0"/>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="94" show="Item 1: id-eNB-UE-S1AP-ID" size="8" value="000800048006692d">
+                        <field name="s1ap.ProtocolIE_Field" pos="94" show="" showname="ProtocolIE-Field" size="8" value="">
+                          <field name="s1ap.id" pos="94" show="8" showname="id: id-eNB-UE-S1AP-ID (8)" size="2" value="0008"/>
+                          <field hide="yes" name="per.enum_index" pos="96" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="96" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="97" show="4" showname="Open Type Length: 4" size="1" value="04"/>
+                          <field name="s1ap.value" pos="98" show="" showname="value" size="4" value="">
+                            <field name="s1ap.ENB_UE_S1AP_ID" pos="98" show="420141" showname="ENB-UE-S1AP-ID: 420141" size="4" value="8006692d"/>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="102" show="Item 2: id-NAS-PDU" size="41" value="001a00252407520007cefaf5dd90a76da30d2c6775f4e41f10a19ee7945f198000a2a656d4988ff528">
+                        <field name="s1ap.ProtocolIE_Field" pos="102" show="" showname="ProtocolIE-Field" size="41" value="">
+                          <field name="s1ap.id" pos="102" show="26" showname="id: id-NAS-PDU (26)" size="2" value="001a"/>
+                          <field hide="yes" name="per.enum_index" pos="104" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="104" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="105" show="37" showname="Open Type Length: 37" size="1" value="25"/>
+                          <field name="s1ap.value" pos="106" show="" showname="value" size="37" value="">
+                            <field hide="yes" name="per.octet_string_length" pos="106" show="36" showname="Octet String Length: 36" size="1" value="24"/>
+                            <field name="s1ap.NAS_PDU" pos="107" show="07:52:00:07:ce:fa:f5:dd:90:a7:6d:a3:0d:2c:67:75:f4:e4:1f:10:a1:9e:e7:94:5f:19:80:00:a2:a6:56:d4:98:8f:f5:28" showname="NAS-PDU: 07520007cefaf5dd90a76da30d2c6775f4e41f10a19ee794..." size="36" value="07520007cefaf5dd90a76da30d2c6775f4e41f10a19ee7945f198000a2a656d4988ff528"/>
+                            <proto name="nas-eps" pos="107" showname="Non-Access-Stratum (NAS)PDU" size="36">
+                              <field name="nas_eps.security_header_type" pos="107" show="0" showname="0000 .... = Security header type: Plain NAS message, not security protected (0)" size="1" unmaskedvalue="07" value="0"/>
+                              <field name="gsm_a.L3_protocol_discriminator" pos="107" show="0x07" showname=".... 0111 = Protocol discriminator: EPS mobility management messages (0x07)" size="1" unmaskedvalue="07" value="7"/>
+                              <field name="nas_eps.nas_msg_emm_type" pos="108" show="0x52" showname="NAS EPS Mobility Management Message Type: Authentication request (0x52)" size="1" value="52"/>
+                              <field name="nas_eps.emm.spare_half_octet" pos="109" show="0" showname="0000 .... = Spare half octet: 0" size="1" value="00"/>
+                              <field name="nas_eps.emm.tsc" pos="109" show="0" showname=".... 0... = Type of security context flag (TSC): Native security context (for KSIasme)" size="1" value="00"/>
+                              <field name="nas_eps.emm.nas_key_set_id" pos="109" show="0" showname=".... .000 = NAS key set identifier:  (0) ASME" size="1" value="00"/>
+                              <field name="" pos="110" show="Authentication Parameter RAND - EPS challenge" size="16" value="07cefaf5dd90a76da30d2c6775f4e41f">
+                                <field name="gsm_a.dtap.rand" pos="110" show="07:ce:fa:f5:dd:90:a7:6d:a3:0d:2c:67:75:f4:e4:1f" showname="RAND value: 07cefaf5dd90a76da30d2c6775f4e41f" size="16" value="07cefaf5dd90a76da30d2c6775f4e41f"/>
+                              </field>
+                              <field name="" pos="126" show="Authentication Parameter AUTN (UMTS and EPS authentication challenge) - EPS challenge" size="17" value="10a19ee7945f198000a2a656d4988ff528">
+                                <field name="gsm_a.len" pos="126" show="16" showname="Length: 16" size="1" value="10"/>
+                                <field name="gsm_a.dtap.autn" pos="127" show="a1:9e:e7:94:5f:19:80:00:a2:a6:56:d4:98:8f:f5:28" showname="AUTN value: a19ee7945f198000a2a656d4988ff528" size="16" value="a19ee7945f198000a2a656d4988ff528">
+                                  <field name="gsm_a.dtap.autn.sqn_xor_ak" pos="127" show="a1:9e:e7:94:5f:19" showname="SQN xor AK: a19ee7945f19" size="6" value="a19ee7945f19"/>
+                                  <field name="gsm_a.dtap.autn.amf" pos="133" show="80:00" showname="AMF: 8000" size="2" value="8000"/>
+                                  <field name="gsm_a.dtap.autn.mac" pos="135" show="a2:a6:56:d4:98:8f:f5:28" showname="MAC: a2a656d4988ff528" size="8" value="a2a656d4988ff528"/>
+                                </field>
+                              </field>
+                            </proto>
+                          </field>
+                        </field>
+                      </field>
+                    </field>
+                  </field>
+                </field>
+              </field>
+            </field>
+          </proto>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 80: 62 bytes on wire (496 bits), 62 bytes captured (496 bits) on interface 0" size="62">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:34:53.971568000" showname="Arrival Time: Sep 25, 2015 16:34:53.971568000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191693.971568000" showname="Epoch Time: 1443191693.971568000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.199945000" showname="Time delta from previous captured frame: 0.199945000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.199945000" showname="Time delta from previous displayed frame: 0.199945000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="47.505937000" showname="Time since reference or first frame: 47.505937000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="80" showname="Frame Number: 80" size="0"/>
+      <field name="frame.len" pos="0" show="62" showname="Frame Length: 62 bytes (496 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="62" showname="Capture Length: 62 bytes (496 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp" showname="Protocols in frame: eth:ip:sctp" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.213 (192.168.12.213), Dst: 192.168.12.17 (192.168.12.17)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="48" showname="Total Length: 48" size="2" value="0030"/>
+        <field name="ip.id" pos="18" show="0x0007" showname="Identification: 0x0007 (7)" size="2" value="0007"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0xa00a" showname="Header checksum: 0xa00a [validation disabled]" size="2" value="a00a">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="a00a"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="a00a"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.213" showname="Source: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.213" showname="Source Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="ip.dst" pos="30" show="192.168.12.17" showname="Destination: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.17" showname="Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="28">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x4cd1eca0" showname="Verification tag: 0x4cd1eca0" size="4" value="4cd1eca0"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0x9017abdf" showname="Checksum: 0x9017abdf (not verified)" size="4" value="9017abdf"/>
+          <field name="" pos="46" show="SACK chunk (Cumulative TSN: 2008295177, a_rwnd: 106496, gaps: 0, duplicate TSNs: 0)" size="16" value="0300001077b427090001a00000000000">
+            <field name="sctp.chunk_type" pos="46" show="3" showname="Chunk type: SACK (3)" size="1" value="03">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="03" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="03" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00">
+              <field name="sctp.sack_nounce_sum" pos="47" show="0" showname=".... ...0 = Nounce sum: 0" size="1" unmaskedvalue="00" value="0"/>
+            </field>
+            <field name="sctp.chunk_length" pos="48" show="16" showname="Chunk length: 16" size="2" value="0010"/>
+            <field name="sctp.sack_cumulative_tsn_ack" pos="50" show="2008295177" showname="Cumulative TSN ACK: 2008295177" size="4" value="77b42709"/>
+            <field name="sctp.sack_a_rwnd" pos="54" show="106496" showname="Advertised receiver window credit (a_rwnd): 106496" size="4" value="0001a000"/>
+            <field name="sctp.sack_number_of_gap_blocks" pos="58" show="0" showname="Number of gap acknowledgement blocks: 0" size="2" value="0000"/>
+            <field name="sctp.sack_number_of_duplicated_tsns" pos="60" show="0" showname="Number of duplicated TSNs: 0" size="2" value="0000"/>
+          </field>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 81: 130 bytes on wire (1040 bits), 130 bytes captured (1040 bits) on interface 0" size="130">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:34:53.977130000" showname="Arrival Time: Sep 25, 2015 16:34:53.977130000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191693.977130000" showname="Epoch Time: 1443191693.977130000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.005562000" showname="Time delta from previous captured frame: 0.005562000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.005562000" showname="Time delta from previous displayed frame: 0.005562000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="47.511499000" showname="Time since reference or first frame: 47.511499000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="81" showname="Frame Number: 81" size="0"/>
+      <field name="frame.len" pos="0" show="130" showname="Frame Length: 130 bytes (1040 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="130" showname="Capture Length: 130 bytes (1040 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp:s1ap:s1ap:s1ap:s1ap:s1ap:nas-eps:s1ap:s1ap" showname="Protocols in frame: eth:ip:sctp:s1ap:s1ap:s1ap:s1ap:s1ap:nas-eps:s1ap:s1ap" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.213 (192.168.12.213), Dst: 192.168.12.17 (192.168.12.17)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="116" showname="Total Length: 116" size="2" value="0074"/>
+        <field name="ip.id" pos="18" show="0x0008" showname="Identification: 0x0008 (8)" size="2" value="0008"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0x9fc5" showname="Header checksum: 0x9fc5 [validation disabled]" size="2" value="9fc5">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="9fc5"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="9fc5"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.213" showname="Source: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.213" showname="Source Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="ip.dst" pos="30" show="192.168.12.17" showname="Destination: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.17" showname="Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="28">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x4cd1eca0" showname="Verification tag: 0x4cd1eca0" size="4" value="4cd1eca0"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0x2fbe8f7d" showname="Checksum: 0x2fbe8f7d (not verified)" size="4" value="2fbe8f7d"/>
+          <field name="" pos="46" show="DATA chunk(ordered, complete segment, TSN: 3304831194, SID: 1, SSN: 2, PPID: 18, payload length: 68 bytes)" size="16" value="00030054c4fbb8da0001000200000012">
+            <field name="sctp.chunk_type" pos="46" show="0" showname="Chunk type: DATA (0)" size="1" value="00">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="00" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="00" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x03" showname="Chunk flags: 0x03" size="1" value="03">
+              <field name="sctp.data_e_bit" pos="47" show="1" showname=".... ...1 = E-Bit: Last segment" size="1" unmaskedvalue="03" value="1"/>
+              <field name="sctp.data_b_bit" pos="47" show="1" showname=".... ..1. = B-Bit: First segment" size="1" unmaskedvalue="03" value="1"/>
+              <field name="sctp.data_u_bit" pos="47" show="0" showname=".... .0.. = U-Bit: Ordered delivery" size="1" unmaskedvalue="03" value="0"/>
+              <field name="sctp.data_i_bit" pos="47" show="0" showname=".... 0... = I-Bit: Possibly delay SACK" size="1" unmaskedvalue="03" value="0"/>
+            </field>
+            <field name="sctp.chunk_length" pos="48" show="84" showname="Chunk length: 84" size="2" value="0054"/>
+            <field name="sctp.data_tsn" pos="50" show="3304831194" showname="TSN: 3304831194" size="4" value="c4fbb8da"/>
+            <field name="sctp.data_sid" pos="54" show="0x0001" showname="Stream Identifier: 0x0001" size="2" value="0001"/>
+            <field name="sctp.data_ssn" pos="56" show="2" showname="Stream sequence number: 2" size="2" value="0002"/>
+            <field name="sctp.data_payload_proto_id" pos="58" show="18" showname="Payload protocol identifier: S1 Application Protocol (S1AP) (18)" size="4" value="00000012"/>
+          </field>
+          <proto name="s1ap" pos="62" showname="S1 Application Protocol" size="68">
+            <field hide="yes" name="per.extension_bit" pos="62" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+            <field hide="yes" name="per.choice_index" pos="62" show="0" showname="Choice Index: 0" size="1" value="00"/>
+            <field name="s1ap.S1AP_PDU" pos="62" show="0" showname="S1AP-PDU: initiatingMessage (0)" size="68" value="000d404000000500000005c0740010d0000800048006692d001a00121117aecd82eb0407530829a497732efc0114006440080002f85900e00000004340060002f8590001">
+              <field name="s1ap.initiatingMessage" pos="62" show="" showname="initiatingMessage" size="68" value="">
+                <field name="s1ap.procedureCode" pos="63" show="13" showname="procedureCode: id-uplinkNASTransport (13)" size="1" value="0d"/>
+                <field hide="yes" name="per.enum_index" pos="64" show="1" showname="Enumerated Index: 1" size="1" value="40"/>
+                <field name="s1ap.criticality" pos="64" show="1" showname="criticality: ignore (1)" size="1" value="40"/>
+                <field hide="yes" name="per.open_type_length" pos="65" show="64" showname="Open Type Length: 64" size="1" value="40"/>
+                <field name="s1ap.value" pos="66" show="" showname="value" size="64" value="">
+                  <field name="s1ap.UplinkNASTransport" pos="66" show="" showname="UplinkNASTransport" size="64" value="">
+                    <field hide="yes" name="per.extension_bit" pos="66" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                    <field hide="yes" name="per.sequence_of_length" pos="67" show="5" showname="Sequence-Of Length: 5" size="2" value="0005"/>
+                    <field name="s1ap.protocolIEs" pos="69" show="5" showname="protocolIEs: 5 items" size="61" value="00000005c0740010d0000800048006692d001a00121117aecd82eb0407530829a497732efc0114006440080002f85900e00000004340060002f8590001">
+                      <field name="" pos="69" show="Item 0: id-MME-UE-S1AP-ID" size="9" value="00000005c0740010d0">
+                        <field name="s1ap.ProtocolIE_Field" pos="69" show="" showname="ProtocolIE-Field" size="9" value="">
+                          <field name="s1ap.id" pos="69" show="0" showname="id: id-MME-UE-S1AP-ID (0)" size="2" value="0000"/>
+                          <field hide="yes" name="per.enum_index" pos="71" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="71" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="72" show="5" showname="Open Type Length: 5" size="1" value="05"/>
+                          <field name="s1ap.value" pos="73" show="" showname="value" size="5" value="">
+                            <field name="s1ap.MME_UE_S1AP_ID" pos="73" show="1946161360" showname="MME-UE-S1AP-ID: 1946161360" size="5" value="c0740010d0"/>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="78" show="Item 1: id-eNB-UE-S1AP-ID" size="8" value="000800048006692d">
+                        <field name="s1ap.ProtocolIE_Field" pos="78" show="" showname="ProtocolIE-Field" size="8" value="">
+                          <field name="s1ap.id" pos="78" show="8" showname="id: id-eNB-UE-S1AP-ID (8)" size="2" value="0008"/>
+                          <field hide="yes" name="per.enum_index" pos="80" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="80" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="81" show="4" showname="Open Type Length: 4" size="1" value="04"/>
+                          <field name="s1ap.value" pos="82" show="" showname="value" size="4" value="">
+                            <field name="s1ap.ENB_UE_S1AP_ID" pos="82" show="420141" showname="ENB-UE-S1AP-ID: 420141" size="4" value="8006692d"/>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="86" show="Item 2: id-NAS-PDU" size="22" value="001a00121117aecd82eb0407530829a497732efc0114">
+                        <field name="s1ap.ProtocolIE_Field" pos="86" show="" showname="ProtocolIE-Field" size="22" value="">
+                          <field name="s1ap.id" pos="86" show="26" showname="id: id-NAS-PDU (26)" size="2" value="001a"/>
+                          <field hide="yes" name="per.enum_index" pos="88" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="88" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="89" show="18" showname="Open Type Length: 18" size="1" value="12"/>
+                          <field name="s1ap.value" pos="90" show="" showname="value" size="18" value="">
+                            <field hide="yes" name="per.octet_string_length" pos="90" show="17" showname="Octet String Length: 17" size="1" value="11"/>
+                            <field name="s1ap.NAS_PDU" pos="91" show="17:ae:cd:82:eb:04:07:53:08:29:a4:97:73:2e:fc:01:14" showname="NAS-PDU: 17aecd82eb0407530829a497732efc0114" size="17" value="17aecd82eb0407530829a497732efc0114"/>
+                            <proto name="nas-eps" pos="91" showname="Non-Access-Stratum (NAS)PDU" size="17">
+                              <field name="nas_eps.security_header_type" pos="91" show="1" showname="0001 .... = Security header type: Integrity protected (1)" size="1" unmaskedvalue="17" value="1"/>
+                              <field name="gsm_a.L3_protocol_discriminator" pos="91" show="0x07" showname=".... 0111 = Protocol discriminator: EPS mobility management messages (0x07)" size="1" unmaskedvalue="17" value="7"/>
+                              <field name="nas_eps.msg_auth_code" pos="92" show="0xaecd82eb" showname="Message authentication code: 0xaecd82eb" size="4" value="aecd82eb"/>
+                              <field name="nas_eps.seq_no" pos="96" show="4" showname="Sequence number: 4" size="1" value="04"/>
+                              <field name="nas_eps.security_header_type" pos="97" show="0" showname="0000 .... = Security header type: Plain NAS message, not security protected (0)" size="1" unmaskedvalue="07" value="0"/>
+                              <field name="gsm_a.L3_protocol_discriminator" pos="97" show="0x07" showname=".... 0111 = Protocol discriminator: EPS mobility management messages (0x07)" size="1" unmaskedvalue="07" value="7"/>
+                              <field name="nas_eps.nas_msg_emm_type" pos="98" show="0x53" showname="NAS EPS Mobility Management Message Type: Authentication response (0x53)" size="1" value="53"/>
+                              <field name="" pos="99" show="Authentication response parameter" size="9" value="0829a497732efc0114">
+                                <field name="gsm_a.len" pos="99" show="8" showname="Length: 8" size="1" value="08"/>
+                                <field name="nas_eps.emm.res" pos="100" show="29:a4:97:73:2e:fc:01:14" showname="RES: 29a497732efc0114" size="8" value="29a497732efc0114"/>
+                              </field>
+                            </proto>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="108" show="Item 3: id-EUTRAN-CGI" size="12" value="006440080002f85900e00000">
+                        <field name="s1ap.ProtocolIE_Field" pos="108" show="" showname="ProtocolIE-Field" size="12" value="">
+                          <field name="s1ap.id" pos="108" show="100" showname="id: id-EUTRAN-CGI (100)" size="2" value="0064"/>
+                          <field hide="yes" name="per.enum_index" pos="110" show="1" showname="Enumerated Index: 1" size="1" value="40"/>
+                          <field name="s1ap.criticality" pos="110" show="1" showname="criticality: ignore (1)" size="1" value="40"/>
+                          <field hide="yes" name="per.open_type_length" pos="111" show="8" showname="Open Type Length: 8" size="1" value="08"/>
+                          <field name="s1ap.value" pos="112" show="" showname="value" size="8" value="">
+                            <field name="s1ap.EUTRAN_CGI" pos="112" show="" showname="EUTRAN-CGI" size="7" value="">
+                              <field hide="yes" name="per.extension_bit" pos="112" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                              <field hide="yes" name="per.optional_field_bit" pos="112" show="0" showname=".0.. .... Optional Field Bit: False (iE-Extensions is NOT present)" size="1" unmaskedvalue="00" value="0"/>
+                              <field name="s1ap.pLMNidentity" pos="113" show="02:f8:59" showname="pLMNidentity: 02f859" size="3" value="02f859"/>
+                              <field name="e212.mcc" pos="113" show="208" showname="Mobile Country Code (MCC): France (208)" size="2" value="02f8"/>
+                              <field name="e212.mnc" pos="114" show="95" showname="Mobile Network Code (MNC): Unknown (95)" size="2" value="f859"/>
+                              <field name="s1ap.cell_ID" pos="112" show="00:e0:00:00" showname="cell-ID: 00e00000 [bit length 28, 4 LSB pad bits, 0000 0000  1110 0000  0000 0000  0000 .... decimal value 917504]" size="4" value="00e00000"/>
+                            </field>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="120" show="Item 4: id-TAI" size="10" value="004340060002f8590001">
+                        <field name="s1ap.ProtocolIE_Field" pos="120" show="" showname="ProtocolIE-Field" size="10" value="">
+                          <field name="s1ap.id" pos="120" show="67" showname="id: id-TAI (67)" size="2" value="0043"/>
+                          <field hide="yes" name="per.enum_index" pos="122" show="1" showname="Enumerated Index: 1" size="1" value="40"/>
+                          <field name="s1ap.criticality" pos="122" show="1" showname="criticality: ignore (1)" size="1" value="40"/>
+                          <field hide="yes" name="per.open_type_length" pos="123" show="6" showname="Open Type Length: 6" size="1" value="06"/>
+                          <field name="s1ap.value" pos="124" show="" showname="value" size="6" value="">
+                            <field name="s1ap.TAI" pos="124" show="" showname="TAI" size="6" value="">
+                              <field hide="yes" name="per.extension_bit" pos="124" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                              <field hide="yes" name="per.optional_field_bit" pos="124" show="0" showname=".0.. .... Optional Field Bit: False (iE-Extensions is NOT present)" size="1" unmaskedvalue="00" value="0"/>
+                              <field name="s1ap.pLMNidentity" pos="125" show="02:f8:59" showname="pLMNidentity: 02f859" size="3" value="02f859"/>
+                              <field name="e212.mcc" pos="125" show="208" showname="Mobile Country Code (MCC): France (208)" size="2" value="02f8"/>
+                              <field name="e212.mnc" pos="126" show="95" showname="Mobile Network Code (MNC): Unknown (95)" size="2" value="f859"/>
+                              <field name="s1ap.tAC" pos="128" show="00:01" showname="tAC: 0001" size="2" value="0001"/>
+                            </field>
+                          </field>
+                        </field>
+                      </field>
+                    </field>
+                  </field>
+                </field>
+              </field>
+            </field>
+          </proto>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 82: 122 bytes on wire (976 bits), 122 bytes captured (976 bits) on interface 0" size="122">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:34:53.978741000" showname="Arrival Time: Sep 25, 2015 16:34:53.978741000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191693.978741000" showname="Epoch Time: 1443191693.978741000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.001611000" showname="Time delta from previous captured frame: 0.001611000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.001611000" showname="Time delta from previous displayed frame: 0.001611000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="47.513110000" showname="Time since reference or first frame: 47.513110000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="82" showname="Frame Number: 82" size="0"/>
+      <field name="frame.len" pos="0" show="122" showname="Frame Length: 122 bytes (976 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="122" showname="Capture Length: 122 bytes (976 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp:s1ap:s1ap:s1ap:s1ap:s1ap:nas-eps" showname="Protocols in frame: eth:ip:sctp:s1ap:s1ap:s1ap:s1ap:s1ap:nas-eps" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.17 (192.168.12.17), Dst: 192.168.12.213 (192.168.12.213)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="108" showname="Total Length: 108" size="2" value="006c"/>
+        <field name="ip.id" pos="18" show="0x0000" showname="Identification: 0x0000 (0)" size="2" value="0000"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0x9fd5" showname="Header checksum: 0x9fd5 [validation disabled]" size="2" value="9fd5">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="9fd5"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="9fd5"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.17" showname="Source: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.17" showname="Source Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="ip.dst" pos="30" show="192.168.12.213" showname="Destination: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.213" showname="Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="44">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x54f837ab" showname="Verification tag: 0x54f837ab" size="4" value="54f837ab"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0x5c01fd01" showname="Checksum: 0x5c01fd01 (not verified)" size="4" value="5c01fd01"/>
+          <field name="" pos="46" show="SACK chunk (Cumulative TSN: 3304831194, a_rwnd: 106496, gaps: 0, duplicate TSNs: 0)" size="16" value="03000010c4fbb8da0001a00000000000">
+            <field name="sctp.chunk_type" pos="46" show="3" showname="Chunk type: SACK (3)" size="1" value="03">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="03" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="03" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00">
+              <field name="sctp.sack_nounce_sum" pos="47" show="0" showname=".... ...0 = Nounce sum: 0" size="1" unmaskedvalue="00" value="0"/>
+            </field>
+            <field name="sctp.chunk_length" pos="48" show="16" showname="Chunk length: 16" size="2" value="0010"/>
+            <field name="sctp.sack_cumulative_tsn_ack" pos="50" show="3304831194" showname="Cumulative TSN ACK: 3304831194" size="4" value="c4fbb8da"/>
+            <field name="sctp.sack_a_rwnd" pos="54" show="106496" showname="Advertised receiver window credit (a_rwnd): 106496" size="4" value="0001a000"/>
+            <field name="sctp.sack_number_of_gap_blocks" pos="58" show="0" showname="Number of gap acknowledgement blocks: 0" size="2" value="0000"/>
+            <field name="sctp.sack_number_of_duplicated_tsns" pos="60" show="0" showname="Number of duplicated TSNs: 0" size="2" value="0000"/>
+          </field>
+          <field name="" pos="62" show="DATA chunk(ordered, complete segment, TSN: 2008295178, SID: 1, SSN: 2, PPID: 301989888, payload length: 42 bytes)" size="16" value="0003003a77b4270a0001000212000000">
+            <field name="sctp.chunk_type" pos="62" show="0" showname="Chunk type: DATA (0)" size="1" value="00">
+              <field name="sctp.chunk_bit_1" pos="62" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="00" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="62" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="00" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="63" show="0x03" showname="Chunk flags: 0x03" size="1" value="03">
+              <field name="sctp.data_e_bit" pos="63" show="1" showname=".... ...1 = E-Bit: Last segment" size="1" unmaskedvalue="03" value="1"/>
+              <field name="sctp.data_b_bit" pos="63" show="1" showname=".... ..1. = B-Bit: First segment" size="1" unmaskedvalue="03" value="1"/>
+              <field name="sctp.data_u_bit" pos="63" show="0" showname=".... .0.. = U-Bit: Ordered delivery" size="1" unmaskedvalue="03" value="0"/>
+              <field name="sctp.data_i_bit" pos="63" show="0" showname=".... 0... = I-Bit: Possibly delay SACK" size="1" unmaskedvalue="03" value="0"/>
+            </field>
+            <field name="sctp.chunk_length" pos="64" show="58" showname="Chunk length: 58" size="2" value="003a"/>
+            <field name="sctp.data_tsn" pos="66" show="2008295178" showname="TSN: 2008295178" size="4" value="77b4270a"/>
+            <field name="sctp.data_sid" pos="70" show="0x0001" showname="Stream Identifier: 0x0001" size="2" value="0001"/>
+            <field name="sctp.data_ssn" pos="72" show="2" showname="Stream sequence number: 2" size="2" value="0002"/>
+            <field name="sctp.data_payload_proto_id" pos="74" show="301989888" showname="Payload protocol identifier: Unknown (301989888)" size="4" value="12000000"/>
+            <field name="sctp.chunk_padding" pos="120" show="00:00" showname="Chunk padding: 0000" size="2" value="0000"/>
+          </field>
+          <proto name="s1ap" pos="78" showname="S1 Application Protocol" size="42">
+            <field hide="yes" name="per.extension_bit" pos="78" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+            <field hide="yes" name="per.choice_index" pos="78" show="0" showname="Choice Index: 0" size="1" value="00"/>
+            <field name="s1ap.S1AP_PDU" pos="78" show="0" showname="S1AP-PDU: initiatingMessage (0)" size="42" value="000b002600000300000005c0740010d0000800048006692d001a000e0d376566048700075d020002e0e0">
+              <field name="s1ap.initiatingMessage" pos="78" show="" showname="initiatingMessage" size="42" value="">
+                <field name="s1ap.procedureCode" pos="79" show="11" showname="procedureCode: id-downlinkNASTransport (11)" size="1" value="0b"/>
+                <field hide="yes" name="per.enum_index" pos="80" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                <field name="s1ap.criticality" pos="80" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                <field hide="yes" name="per.open_type_length" pos="81" show="38" showname="Open Type Length: 38" size="1" value="26"/>
+                <field name="s1ap.value" pos="82" show="" showname="value" size="38" value="">
+                  <field name="s1ap.DownlinkNASTransport" pos="82" show="" showname="DownlinkNASTransport" size="38" value="">
+                    <field hide="yes" name="per.extension_bit" pos="82" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                    <field hide="yes" name="per.sequence_of_length" pos="83" show="3" showname="Sequence-Of Length: 3" size="2" value="0003"/>
+                    <field name="s1ap.protocolIEs" pos="85" show="3" showname="protocolIEs: 3 items" size="35" value="00000005c0740010d0000800048006692d001a000e0d376566048700075d020002e0e0">
+                      <field name="" pos="85" show="Item 0: id-MME-UE-S1AP-ID" size="9" value="00000005c0740010d0">
+                        <field name="s1ap.ProtocolIE_Field" pos="85" show="" showname="ProtocolIE-Field" size="9" value="">
+                          <field name="s1ap.id" pos="85" show="0" showname="id: id-MME-UE-S1AP-ID (0)" size="2" value="0000"/>
+                          <field hide="yes" name="per.enum_index" pos="87" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="87" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="88" show="5" showname="Open Type Length: 5" size="1" value="05"/>
+                          <field name="s1ap.value" pos="89" show="" showname="value" size="5" value="">
+                            <field name="s1ap.MME_UE_S1AP_ID" pos="89" show="1946161360" showname="MME-UE-S1AP-ID: 1946161360" size="5" value="c0740010d0"/>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="94" show="Item 1: id-eNB-UE-S1AP-ID" size="8" value="000800048006692d">
+                        <field name="s1ap.ProtocolIE_Field" pos="94" show="" showname="ProtocolIE-Field" size="8" value="">
+                          <field name="s1ap.id" pos="94" show="8" showname="id: id-eNB-UE-S1AP-ID (8)" size="2" value="0008"/>
+                          <field hide="yes" name="per.enum_index" pos="96" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="96" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="97" show="4" showname="Open Type Length: 4" size="1" value="04"/>
+                          <field name="s1ap.value" pos="98" show="" showname="value" size="4" value="">
+                            <field name="s1ap.ENB_UE_S1AP_ID" pos="98" show="420141" showname="ENB-UE-S1AP-ID: 420141" size="4" value="8006692d"/>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="102" show="Item 2: id-NAS-PDU" size="18" value="001a000e0d376566048700075d020002e0e0">
+                        <field name="s1ap.ProtocolIE_Field" pos="102" show="" showname="ProtocolIE-Field" size="18" value="">
+                          <field name="s1ap.id" pos="102" show="26" showname="id: id-NAS-PDU (26)" size="2" value="001a"/>
+                          <field hide="yes" name="per.enum_index" pos="104" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="104" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="105" show="14" showname="Open Type Length: 14" size="1" value="0e"/>
+                          <field name="s1ap.value" pos="106" show="" showname="value" size="14" value="">
+                            <field hide="yes" name="per.octet_string_length" pos="106" show="13" showname="Octet String Length: 13" size="1" value="0d"/>
+                            <field name="s1ap.NAS_PDU" pos="107" show="37:65:66:04:87:00:07:5d:02:00:02:e0:e0" showname="NAS-PDU: 376566048700075d020002e0e0" size="13" value="376566048700075d020002e0e0"/>
+                            <proto name="nas-eps" pos="107" showname="Non-Access-Stratum (NAS)PDU" size="13">
+                              <field name="nas_eps.security_header_type" pos="107" show="3" showname="0011 .... = Security header type: Integrity protected with new EPS security context (3)" size="1" unmaskedvalue="37" value="3"/>
+                              <field name="gsm_a.L3_protocol_discriminator" pos="107" show="0x07" showname=".... 0111 = Protocol discriminator: EPS mobility management messages (0x07)" size="1" unmaskedvalue="37" value="7"/>
+                              <field name="nas_eps.msg_auth_code" pos="108" show="0x65660487" showname="Message authentication code: 0x65660487" size="4" value="65660487"/>
+                              <field name="nas_eps.seq_no" pos="112" show="0" showname="Sequence number: 0" size="1" value="00"/>
+                              <field name="nas_eps.security_header_type" pos="113" show="0" showname="0000 .... = Security header type: Plain NAS message, not security protected (0)" size="1" unmaskedvalue="07" value="0"/>
+                              <field name="gsm_a.L3_protocol_discriminator" pos="113" show="0x07" showname=".... 0111 = Protocol discriminator: EPS mobility management messages (0x07)" size="1" unmaskedvalue="07" value="7"/>
+                              <field name="nas_eps.nas_msg_emm_type" pos="114" show="0x5d" showname="NAS EPS Mobility Management Message Type: Security mode command (0x5d)" size="1" value="5d"/>
+                              <field name="" pos="115" show="NAS security algorithms - Selected NAS security algorithms" size="1" value="02">
+                                <field name="nas_eps.spare_bits" pos="115" show="0x00" showname="0... .... = Spare bit(s): 0x00" size="1" value="02"/>
+                                <field name="nas_eps.emm.toc" pos="115" show="0" showname=".000 .... = Type of ciphering algorithm: EPS encryption algorithm EEA0 (null ciphering algorithm) (0)" size="1" unmaskedvalue="02" value="0"/>
+                                <field name="nas_eps.spare_bits" pos="115" show="0x00" showname=".... 0... = Spare bit(s): 0x00" size="1" value="02"/>
+                                <field name="nas_eps.emm.toi" pos="115" show="2" showname=".... .010 = Type of integrity protection algorithm: EPS integrity algorithm 128-EIA2 (2)" size="1" unmaskedvalue="02" value="2"/>
+                              </field>
+                              <field name="nas_eps.emm.spare_half_octet" pos="116" show="0" showname="0000 .... = Spare half octet: 0" size="1" value="00"/>
+                              <field name="nas_eps.emm.tsc" pos="116" show="0" showname=".... 0... = Type of security context flag (TSC): Native security context (for KSIasme)" size="1" value="00"/>
+                              <field name="nas_eps.emm.nas_key_set_id" pos="116" show="0" showname=".... .000 = NAS key set identifier:  (0) ASME" size="1" value="00"/>
+                              <field name="" pos="117" show="UE security capability - Replayed UE security capabilities" size="3" value="02e0e0">
+                                <field name="gsm_a.len" pos="117" show="2" showname="Length: 2" size="1" value="02"/>
+                                <field name="nas_eps.emm.eea0" pos="118" show="1" showname="1... .... = EEA0: Supported" size="1" unmaskedvalue="e0" value="1"/>
+                                <field name="nas_eps.emm.128eea1" pos="118" show="1" showname=".1.. .... = 128-EEA1: Supported" size="1" unmaskedvalue="e0" value="1"/>
+                                <field name="nas_eps.emm.128eea2" pos="118" show="1" showname="..1. .... = 128-EEA2: Supported" size="1" unmaskedvalue="e0" value="1"/>
+                                <field name="nas_eps.emm.eea3" pos="118" show="0" showname="...0 .... = 128-EEA3: Not Supported" size="1" unmaskedvalue="e0" value="0"/>
+                                <field name="nas_eps.emm.eea4" pos="118" show="0" showname=".... 0... = EEA4: Not Supported" size="1" unmaskedvalue="e0" value="0"/>
+                                <field name="nas_eps.emm.eea5" pos="118" show="0" showname=".... .0.. = EEA5: Not Supported" size="1" unmaskedvalue="e0" value="0"/>
+                                <field name="nas_eps.emm.eea6" pos="118" show="0" showname=".... ..0. = EEA6: Not Supported" size="1" unmaskedvalue="e0" value="0"/>
+                                <field name="nas_eps.emm.eea7" pos="118" show="0" showname=".... ...0 = EEA7: Not Supported" size="1" unmaskedvalue="e0" value="0"/>
+                                <field name="nas_eps.emm.eia0" pos="119" show="1" showname="1... .... = EIA0: Supported" size="1" unmaskedvalue="e0" value="1"/>
+                                <field name="nas_eps.emm.128eia1" pos="119" show="1" showname=".1.. .... = 128-EIA1: Supported" size="1" unmaskedvalue="e0" value="1"/>
+                                <field name="nas_eps.emm.128eia2" pos="119" show="1" showname="..1. .... = 128-EIA2: Supported" size="1" unmaskedvalue="e0" value="1"/>
+                                <field name="nas_eps.emm.eia3" pos="119" show="0" showname="...0 .... = 128-EIA3: Not Supported" size="1" unmaskedvalue="e0" value="0"/>
+                                <field name="nas_eps.emm.eia4" pos="119" show="0" showname=".... 0... = EIA4: Not Supported" size="1" unmaskedvalue="e0" value="0"/>
+                                <field name="nas_eps.emm.eia5" pos="119" show="0" showname=".... .0.. = EIA5: Not Supported" size="1" unmaskedvalue="e0" value="0"/>
+                                <field name="nas_eps.emm.eia6" pos="119" show="0" showname=".... ..0. = EIA6: Not Supported" size="1" unmaskedvalue="e0" value="0"/>
+                                <field name="nas_eps.emm.eia7" pos="119" show="0" showname=".... ...0 = EIA7: Not Supported" size="1" unmaskedvalue="e0" value="0"/>
+                              </field>
+                            </proto>
+                          </field>
+                        </field>
+                      </field>
+                    </field>
+                  </field>
+                </field>
+              </field>
+            </field>
+          </proto>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 83: 138 bytes on wire (1104 bits), 138 bytes captured (1104 bits) on interface 0" size="138">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:34:53.997356000" showname="Arrival Time: Sep 25, 2015 16:34:53.997356000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191693.997356000" showname="Epoch Time: 1443191693.997356000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.018615000" showname="Time delta from previous captured frame: 0.018615000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.018615000" showname="Time delta from previous displayed frame: 0.018615000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="47.531725000" showname="Time since reference or first frame: 47.531725000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="83" showname="Frame Number: 83" size="0"/>
+      <field name="frame.len" pos="0" show="138" showname="Frame Length: 138 bytes (1104 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="138" showname="Capture Length: 138 bytes (1104 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp:s1ap:s1ap:s1ap:s1ap:s1ap:nas-eps:s1ap:s1ap" showname="Protocols in frame: eth:ip:sctp:s1ap:s1ap:s1ap:s1ap:s1ap:nas-eps:s1ap:s1ap" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.213 (192.168.12.213), Dst: 192.168.12.17 (192.168.12.17)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="124" showname="Total Length: 124" size="2" value="007c"/>
+        <field name="ip.id" pos="18" show="0x0009" showname="Identification: 0x0009 (9)" size="2" value="0009"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0x9fbc" showname="Header checksum: 0x9fbc [validation disabled]" size="2" value="9fbc">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="9fbc"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="9fbc"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.213" showname="Source: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.213" showname="Source Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="ip.dst" pos="30" show="192.168.12.17" showname="Destination: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.17" showname="Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="44">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x4cd1eca0" showname="Verification tag: 0x4cd1eca0" size="4" value="4cd1eca0"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0xd5500667" showname="Checksum: 0xd5500667 (not verified)" size="4" value="d5500667"/>
+          <field name="" pos="46" show="SACK chunk (Cumulative TSN: 2008295178, a_rwnd: 106496, gaps: 0, duplicate TSNs: 0)" size="16" value="0300001077b4270a0001a00000000000">
+            <field name="sctp.chunk_type" pos="46" show="3" showname="Chunk type: SACK (3)" size="1" value="03">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="03" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="03" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00">
+              <field name="sctp.sack_nounce_sum" pos="47" show="0" showname=".... ...0 = Nounce sum: 0" size="1" unmaskedvalue="00" value="0"/>
+            </field>
+            <field name="sctp.chunk_length" pos="48" show="16" showname="Chunk length: 16" size="2" value="0010"/>
+            <field name="sctp.sack_cumulative_tsn_ack" pos="50" show="2008295178" showname="Cumulative TSN ACK: 2008295178" size="4" value="77b4270a"/>
+            <field name="sctp.sack_a_rwnd" pos="54" show="106496" showname="Advertised receiver window credit (a_rwnd): 106496" size="4" value="0001a000"/>
+            <field name="sctp.sack_number_of_gap_blocks" pos="58" show="0" showname="Number of gap acknowledgement blocks: 0" size="2" value="0000"/>
+            <field name="sctp.sack_number_of_duplicated_tsns" pos="60" show="0" showname="Number of duplicated TSNs: 0" size="2" value="0000"/>
+          </field>
+          <field name="" pos="62" show="DATA chunk(ordered, complete segment, TSN: 3304831195, SID: 1, SSN: 3, PPID: 18, payload length: 59 bytes)" size="16" value="0003004bc4fbb8db0001000300000012">
+            <field name="sctp.chunk_type" pos="62" show="0" showname="Chunk type: DATA (0)" size="1" value="00">
+              <field name="sctp.chunk_bit_1" pos="62" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="00" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="62" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="00" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="63" show="0x03" showname="Chunk flags: 0x03" size="1" value="03">
+              <field name="sctp.data_e_bit" pos="63" show="1" showname=".... ...1 = E-Bit: Last segment" size="1" unmaskedvalue="03" value="1"/>
+              <field name="sctp.data_b_bit" pos="63" show="1" showname=".... ..1. = B-Bit: First segment" size="1" unmaskedvalue="03" value="1"/>
+              <field name="sctp.data_u_bit" pos="63" show="0" showname=".... .0.. = U-Bit: Ordered delivery" size="1" unmaskedvalue="03" value="0"/>
+              <field name="sctp.data_i_bit" pos="63" show="0" showname=".... 0... = I-Bit: Possibly delay SACK" size="1" unmaskedvalue="03" value="0"/>
+            </field>
+            <field name="sctp.chunk_length" pos="64" show="75" showname="Chunk length: 75" size="2" value="004b"/>
+            <field name="sctp.data_tsn" pos="66" show="3304831195" showname="TSN: 3304831195" size="4" value="c4fbb8db"/>
+            <field name="sctp.data_sid" pos="70" show="0x0001" showname="Stream Identifier: 0x0001" size="2" value="0001"/>
+            <field name="sctp.data_ssn" pos="72" show="3" showname="Stream sequence number: 3" size="2" value="0003"/>
+            <field name="sctp.data_payload_proto_id" pos="74" show="18" showname="Payload protocol identifier: S1 Application Protocol (S1AP) (18)" size="4" value="00000012"/>
+            <field name="sctp.chunk_padding" pos="137" show="00" showname="Chunk padding: 00" size="1" value="00"/>
+          </field>
+          <proto name="s1ap" pos="78" showname="S1 Application Protocol" size="59">
+            <field hide="yes" name="per.extension_bit" pos="78" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+            <field hide="yes" name="per.choice_index" pos="78" show="0" showname="Choice Index: 0" size="1" value="00"/>
+            <field name="s1ap.S1AP_PDU" pos="78" show="0" showname="S1AP-PDU: initiatingMessage (0)" size="59" value="000d403700000500000005c0740010d0000800048006692d001a0009084795eaf72e00075e006440080002f85900e00000004340060002f8590001">
+              <field name="s1ap.initiatingMessage" pos="78" show="" showname="initiatingMessage" size="59" value="">
+                <field name="s1ap.procedureCode" pos="79" show="13" showname="procedureCode: id-uplinkNASTransport (13)" size="1" value="0d"/>
+                <field hide="yes" name="per.enum_index" pos="80" show="1" showname="Enumerated Index: 1" size="1" value="40"/>
+                <field name="s1ap.criticality" pos="80" show="1" showname="criticality: ignore (1)" size="1" value="40"/>
+                <field hide="yes" name="per.open_type_length" pos="81" show="55" showname="Open Type Length: 55" size="1" value="37"/>
+                <field name="s1ap.value" pos="82" show="" showname="value" size="55" value="">
+                  <field name="s1ap.UplinkNASTransport" pos="82" show="" showname="UplinkNASTransport" size="55" value="">
+                    <field hide="yes" name="per.extension_bit" pos="82" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                    <field hide="yes" name="per.sequence_of_length" pos="83" show="5" showname="Sequence-Of Length: 5" size="2" value="0005"/>
+                    <field name="s1ap.protocolIEs" pos="85" show="5" showname="protocolIEs: 5 items" size="52" value="00000005c0740010d0000800048006692d001a0009084795eaf72e00075e006440080002f85900e00000004340060002f8590001">
+                      <field name="" pos="85" show="Item 0: id-MME-UE-S1AP-ID" size="9" value="00000005c0740010d0">
+                        <field name="s1ap.ProtocolIE_Field" pos="85" show="" showname="ProtocolIE-Field" size="9" value="">
+                          <field name="s1ap.id" pos="85" show="0" showname="id: id-MME-UE-S1AP-ID (0)" size="2" value="0000"/>
+                          <field hide="yes" name="per.enum_index" pos="87" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="87" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="88" show="5" showname="Open Type Length: 5" size="1" value="05"/>
+                          <field name="s1ap.value" pos="89" show="" showname="value" size="5" value="">
+                            <field name="s1ap.MME_UE_S1AP_ID" pos="89" show="1946161360" showname="MME-UE-S1AP-ID: 1946161360" size="5" value="c0740010d0"/>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="94" show="Item 1: id-eNB-UE-S1AP-ID" size="8" value="000800048006692d">
+                        <field name="s1ap.ProtocolIE_Field" pos="94" show="" showname="ProtocolIE-Field" size="8" value="">
+                          <field name="s1ap.id" pos="94" show="8" showname="id: id-eNB-UE-S1AP-ID (8)" size="2" value="0008"/>
+                          <field hide="yes" name="per.enum_index" pos="96" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="96" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="97" show="4" showname="Open Type Length: 4" size="1" value="04"/>
+                          <field name="s1ap.value" pos="98" show="" showname="value" size="4" value="">
+                            <field name="s1ap.ENB_UE_S1AP_ID" pos="98" show="420141" showname="ENB-UE-S1AP-ID: 420141" size="4" value="8006692d"/>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="102" show="Item 2: id-NAS-PDU" size="13" value="001a0009084795eaf72e00075e">
+                        <field name="s1ap.ProtocolIE_Field" pos="102" show="" showname="ProtocolIE-Field" size="13" value="">
+                          <field name="s1ap.id" pos="102" show="26" showname="id: id-NAS-PDU (26)" size="2" value="001a"/>
+                          <field hide="yes" name="per.enum_index" pos="104" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="104" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="105" show="9" showname="Open Type Length: 9" size="1" value="09"/>
+                          <field name="s1ap.value" pos="106" show="" showname="value" size="9" value="">
+                            <field hide="yes" name="per.octet_string_length" pos="106" show="8" showname="Octet String Length: 8" size="1" value="08"/>
+                            <field name="s1ap.NAS_PDU" pos="107" show="47:95:ea:f7:2e:00:07:5e" showname="NAS-PDU: 4795eaf72e00075e" size="8" value="4795eaf72e00075e"/>
+                            <proto name="nas-eps" pos="107" showname="Non-Access-Stratum (NAS)PDU" size="8">
+                              <field name="nas_eps.security_header_type" pos="107" show="4" showname="0100 .... = Security header type: Integrity protected and ciphered with new EPS security context (4)" size="1" unmaskedvalue="47" value="4"/>
+                              <field name="gsm_a.L3_protocol_discriminator" pos="107" show="0x07" showname=".... 0111 = Protocol discriminator: EPS mobility management messages (0x07)" size="1" unmaskedvalue="47" value="7"/>
+                              <field name="nas_eps.msg_auth_code" pos="108" show="0x95eaf72e" showname="Message authentication code: 0x95eaf72e" size="4" value="95eaf72e"/>
+                              <field name="nas_eps.seq_no" pos="112" show="0" showname="Sequence number: 0" size="1" value="00"/>
+                              <field name="nas_eps.security_header_type" pos="113" show="0" showname="0000 .... = Security header type: Plain NAS message, not security protected (0)" size="1" unmaskedvalue="07" value="0"/>
+                              <field name="gsm_a.L3_protocol_discriminator" pos="113" show="0x07" showname=".... 0111 = Protocol discriminator: EPS mobility management messages (0x07)" size="1" unmaskedvalue="07" value="7"/>
+                              <field name="nas_eps.nas_msg_emm_type" pos="114" show="0x5e" showname="NAS EPS Mobility Management Message Type: Security mode complete (0x5e)" size="1" value="5e"/>
+                            </proto>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="115" show="Item 3: id-EUTRAN-CGI" size="12" value="006440080002f85900e00000">
+                        <field name="s1ap.ProtocolIE_Field" pos="115" show="" showname="ProtocolIE-Field" size="12" value="">
+                          <field name="s1ap.id" pos="115" show="100" showname="id: id-EUTRAN-CGI (100)" size="2" value="0064"/>
+                          <field hide="yes" name="per.enum_index" pos="117" show="1" showname="Enumerated Index: 1" size="1" value="40"/>
+                          <field name="s1ap.criticality" pos="117" show="1" showname="criticality: ignore (1)" size="1" value="40"/>
+                          <field hide="yes" name="per.open_type_length" pos="118" show="8" showname="Open Type Length: 8" size="1" value="08"/>
+                          <field name="s1ap.value" pos="119" show="" showname="value" size="8" value="">
+                            <field name="s1ap.EUTRAN_CGI" pos="119" show="" showname="EUTRAN-CGI" size="7" value="">
+                              <field hide="yes" name="per.extension_bit" pos="119" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                              <field hide="yes" name="per.optional_field_bit" pos="119" show="0" showname=".0.. .... Optional Field Bit: False (iE-Extensions is NOT present)" size="1" unmaskedvalue="00" value="0"/>
+                              <field name="s1ap.pLMNidentity" pos="120" show="02:f8:59" showname="pLMNidentity: 02f859" size="3" value="02f859"/>
+                              <field name="e212.mcc" pos="120" show="208" showname="Mobile Country Code (MCC): France (208)" size="2" value="02f8"/>
+                              <field name="e212.mnc" pos="121" show="95" showname="Mobile Network Code (MNC): Unknown (95)" size="2" value="f859"/>
+                              <field name="s1ap.cell_ID" pos="119" show="00:e0:00:00" showname="cell-ID: 00e00000 [bit length 28, 4 LSB pad bits, 0000 0000  1110 0000  0000 0000  0000 .... decimal value 917504]" size="4" value="00e00000"/>
+                            </field>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="127" show="Item 4: id-TAI" size="10" value="004340060002f8590001">
+                        <field name="s1ap.ProtocolIE_Field" pos="127" show="" showname="ProtocolIE-Field" size="10" value="">
+                          <field name="s1ap.id" pos="127" show="67" showname="id: id-TAI (67)" size="2" value="0043"/>
+                          <field hide="yes" name="per.enum_index" pos="129" show="1" showname="Enumerated Index: 1" size="1" value="40"/>
+                          <field name="s1ap.criticality" pos="129" show="1" showname="criticality: ignore (1)" size="1" value="40"/>
+                          <field hide="yes" name="per.open_type_length" pos="130" show="6" showname="Open Type Length: 6" size="1" value="06"/>
+                          <field name="s1ap.value" pos="131" show="" showname="value" size="6" value="">
+                            <field name="s1ap.TAI" pos="131" show="" showname="TAI" size="6" value="">
+                              <field hide="yes" name="per.extension_bit" pos="131" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                              <field hide="yes" name="per.optional_field_bit" pos="131" show="0" showname=".0.. .... Optional Field Bit: False (iE-Extensions is NOT present)" size="1" unmaskedvalue="00" value="0"/>
+                              <field name="s1ap.pLMNidentity" pos="132" show="02:f8:59" showname="pLMNidentity: 02f859" size="3" value="02f859"/>
+                              <field name="e212.mcc" pos="132" show="208" showname="Mobile Country Code (MCC): France (208)" size="2" value="02f8"/>
+                              <field name="e212.mnc" pos="133" show="95" showname="Mobile Network Code (MNC): Unknown (95)" size="2" value="f859"/>
+                              <field name="s1ap.tAC" pos="135" show="00:01" showname="tAC: 0001" size="2" value="0001"/>
+                            </field>
+                          </field>
+                        </field>
+                      </field>
+                    </field>
+                  </field>
+                </field>
+              </field>
+            </field>
+          </proto>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 84: 270 bytes on wire (2160 bits), 270 bytes captured (2160 bits) on interface 0" size="270">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:34:54.002963000" showname="Arrival Time: Sep 25, 2015 16:34:54.002963000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191694.002963000" showname="Epoch Time: 1443191694.002963000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.005607000" showname="Time delta from previous captured frame: 0.005607000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.005607000" showname="Time delta from previous displayed frame: 0.005607000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="47.537332000" showname="Time since reference or first frame: 47.537332000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="84" showname="Frame Number: 84" size="0"/>
+      <field name="frame.len" pos="0" show="270" showname="Frame Length: 270 bytes (2160 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="270" showname="Capture Length: 270 bytes (2160 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp:s1ap:s1ap:s1ap:s1ap:s1ap:s1ap:s1ap:nas-eps:ipcp:s1ap:s1ap" showname="Protocols in frame: eth:ip:sctp:s1ap:s1ap:s1ap:s1ap:s1ap:s1ap:s1ap:nas-eps:ipcp:s1ap:s1ap" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.17 (192.168.12.17), Dst: 192.168.12.213 (192.168.12.213)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="256" showname="Total Length: 256" size="2" value="0100"/>
+        <field name="ip.id" pos="18" show="0x0000" showname="Identification: 0x0000 (0)" size="2" value="0000"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0x9f41" showname="Header checksum: 0x9f41 [validation disabled]" size="2" value="9f41">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="9f41"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="9f41"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.17" showname="Source: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.17" showname="Source Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="ip.dst" pos="30" show="192.168.12.213" showname="Destination: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.213" showname="Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="44">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x54f837ab" showname="Verification tag: 0x54f837ab" size="4" value="54f837ab"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0xcffe2cbf" showname="Checksum: 0xcffe2cbf (not verified)" size="4" value="cffe2cbf"/>
+          <field name="" pos="46" show="SACK chunk (Cumulative TSN: 3304831195, a_rwnd: 106496, gaps: 0, duplicate TSNs: 0)" size="16" value="03000010c4fbb8db0001a00000000000">
+            <field name="sctp.chunk_type" pos="46" show="3" showname="Chunk type: SACK (3)" size="1" value="03">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="03" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="03" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00">
+              <field name="sctp.sack_nounce_sum" pos="47" show="0" showname=".... ...0 = Nounce sum: 0" size="1" unmaskedvalue="00" value="0"/>
+            </field>
+            <field name="sctp.chunk_length" pos="48" show="16" showname="Chunk length: 16" size="2" value="0010"/>
+            <field name="sctp.sack_cumulative_tsn_ack" pos="50" show="3304831195" showname="Cumulative TSN ACK: 3304831195" size="4" value="c4fbb8db"/>
+            <field name="sctp.sack_a_rwnd" pos="54" show="106496" showname="Advertised receiver window credit (a_rwnd): 106496" size="4" value="0001a000"/>
+            <field name="sctp.sack_number_of_gap_blocks" pos="58" show="0" showname="Number of gap acknowledgement blocks: 0" size="2" value="0000"/>
+            <field name="sctp.sack_number_of_duplicated_tsns" pos="60" show="0" showname="Number of duplicated TSNs: 0" size="2" value="0000"/>
+          </field>
+          <field name="" pos="62" show="DATA chunk(ordered, complete segment, TSN: 2008295179, SID: 1, SSN: 3, PPID: 301989888, payload length: 191 bytes)" size="16" value="000300cf77b4270b0001000312000000">
+            <field name="sctp.chunk_type" pos="62" show="0" showname="Chunk type: DATA (0)" size="1" value="00">
+              <field name="sctp.chunk_bit_1" pos="62" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="00" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="62" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="00" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="63" show="0x03" showname="Chunk flags: 0x03" size="1" value="03">
+              <field name="sctp.data_e_bit" pos="63" show="1" showname=".... ...1 = E-Bit: Last segment" size="1" unmaskedvalue="03" value="1"/>
+              <field name="sctp.data_b_bit" pos="63" show="1" showname=".... ..1. = B-Bit: First segment" size="1" unmaskedvalue="03" value="1"/>
+              <field name="sctp.data_u_bit" pos="63" show="0" showname=".... .0.. = U-Bit: Ordered delivery" size="1" unmaskedvalue="03" value="0"/>
+              <field name="sctp.data_i_bit" pos="63" show="0" showname=".... 0... = I-Bit: Possibly delay SACK" size="1" unmaskedvalue="03" value="0"/>
+            </field>
+            <field name="sctp.chunk_length" pos="64" show="207" showname="Chunk length: 207" size="2" value="00cf"/>
+            <field name="sctp.data_tsn" pos="66" show="2008295179" showname="TSN: 2008295179" size="4" value="77b4270b"/>
+            <field name="sctp.data_sid" pos="70" show="0x0001" showname="Stream Identifier: 0x0001" size="2" value="0001"/>
+            <field name="sctp.data_ssn" pos="72" show="3" showname="Stream sequence number: 3" size="2" value="0003"/>
+            <field name="sctp.data_payload_proto_id" pos="74" show="301989888" showname="Payload protocol identifier: Unknown (301989888)" size="4" value="12000000"/>
+            <field name="sctp.chunk_padding" pos="269" show="00" showname="Chunk padding: 00" size="1" value="00"/>
+          </field>
+          <proto name="s1ap" pos="78" showname="S1 Application Protocol" size="191">
+            <field hide="yes" name="per.extension_bit" pos="78" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+            <field hide="yes" name="per.choice_index" pos="78" show="0" showname="Choice Index: 0" size="1" value="00"/>
+            <field name="s1ap.S1AP_PDU" pos="78" show="0" showname="S1AP-PDU: initiatingMessage (0)" size="191" value="00090080ba00000600000005c0740010d0000800048006692d0042000a1805f5e1006002faf080001800670000340062450009040f80c0a80c11000000015327ad0aaa9a010742014a062002f859000100315201c1010909036f616904697076340501c0bc00025e04fefede9e271480802110030000108106c0a86a0c8306c0a80c64500bf602f8598000016c000920172c006b0005100002000000490020d3a2585db3755b592cdd43bd648158eb3d142a9f7295ef2da9003b8f7a7a5929">
+              <field name="s1ap.initiatingMessage" pos="78" show="" showname="initiatingMessage" size="191" value="">
+                <field name="s1ap.procedureCode" pos="79" show="9" showname="procedureCode: id-InitialContextSetup (9)" size="1" value="09"/>
+                <field hide="yes" name="per.enum_index" pos="80" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                <field name="s1ap.criticality" pos="80" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                <field hide="yes" name="per.open_type_length" pos="81" show="186" showname="Open Type Length: 186" size="2" value="80ba"/>
+                <field name="s1ap.value" pos="83" show="" showname="value" size="186" value="">
+                  <field name="s1ap.InitialContextSetupRequest" pos="83" show="" showname="InitialContextSetupRequest" size="186" value="">
+                    <field hide="yes" name="per.extension_bit" pos="83" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                    <field hide="yes" name="per.sequence_of_length" pos="84" show="6" showname="Sequence-Of Length: 6" size="2" value="0006"/>
+                    <field name="s1ap.protocolIEs" pos="86" show="6" showname="protocolIEs: 6 items" size="183" value="00000005c0740010d0000800048006692d0042000a1805f5e1006002faf080001800670000340062450009040f80c0a80c11000000015327ad0aaa9a010742014a062002f859000100315201c1010909036f616904697076340501c0bc00025e04fefede9e271480802110030000108106c0a86a0c8306c0a80c64500bf602f8598000016c000920172c006b0005100002000000490020d3a2585db3755b592cdd43bd648158eb3d142a9f7295ef2da9003b8f7a7a5929">
+                      <field name="" pos="86" show="Item 0: id-MME-UE-S1AP-ID" size="9" value="00000005c0740010d0">
+                        <field name="s1ap.ProtocolIE_Field" pos="86" show="" showname="ProtocolIE-Field" size="9" value="">
+                          <field name="s1ap.id" pos="86" show="0" showname="id: id-MME-UE-S1AP-ID (0)" size="2" value="0000"/>
+                          <field hide="yes" name="per.enum_index" pos="88" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="88" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="89" show="5" showname="Open Type Length: 5" size="1" value="05"/>
+                          <field name="s1ap.value" pos="90" show="" showname="value" size="5" value="">
+                            <field name="s1ap.MME_UE_S1AP_ID" pos="90" show="1946161360" showname="MME-UE-S1AP-ID: 1946161360" size="5" value="c0740010d0"/>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="95" show="Item 1: id-eNB-UE-S1AP-ID" size="8" value="000800048006692d">
+                        <field name="s1ap.ProtocolIE_Field" pos="95" show="" showname="ProtocolIE-Field" size="8" value="">
+                          <field name="s1ap.id" pos="95" show="8" showname="id: id-eNB-UE-S1AP-ID (8)" size="2" value="0008"/>
+                          <field hide="yes" name="per.enum_index" pos="97" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="97" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="98" show="4" showname="Open Type Length: 4" size="1" value="04"/>
+                          <field name="s1ap.value" pos="99" show="" showname="value" size="4" value="">
+                            <field name="s1ap.ENB_UE_S1AP_ID" pos="99" show="420141" showname="ENB-UE-S1AP-ID: 420141" size="4" value="8006692d"/>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="103" show="Item 2: id-uEaggregateMaximumBitrate" size="14" value="0042000a1805f5e1006002faf080">
+                        <field name="s1ap.ProtocolIE_Field" pos="103" show="" showname="ProtocolIE-Field" size="14" value="">
+                          <field name="s1ap.id" pos="103" show="66" showname="id: id-uEaggregateMaximumBitrate (66)" size="2" value="0042"/>
+                          <field hide="yes" name="per.enum_index" pos="105" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="105" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="106" show="10" showname="Open Type Length: 10" size="1" value="0a"/>
+                          <field name="s1ap.value" pos="107" show="" showname="value" size="10" value="">
+                            <field name="s1ap.UEAggregateMaximumBitrate" pos="107" show="" showname="UEAggregateMaximumBitrate" size="10" value="">
+                              <field hide="yes" name="per.extension_bit" pos="107" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="18" value="0"/>
+                              <field hide="yes" name="per.optional_field_bit" pos="107" show="0" showname=".0.. .... Optional Field Bit: False (iE-Extensions is NOT present)" size="1" unmaskedvalue="18" value="0"/>
+                              <field name="s1ap.uEaggregateMaximumBitRateDL" pos="107" show="100000000" showname="uEaggregateMaximumBitRateDL: 100000000" size="5" value="1805f5e100"/>
+                              <field name="s1ap.uEaggregateMaximumBitRateUL" pos="112" show="50000000" showname="uEaggregateMaximumBitRateUL: 50000000" size="5" value="6002faf080"/>
+                            </field>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="117" show="Item 3: id-E-RABToBeSetupListCtxtSUReq" size="107" value="001800670000340062450009040f80c0a80c11000000015327ad0aaa9a010742014a062002f859000100315201c1010909036f616904697076340501c0bc00025e04fefede9e271480802110030000108106c0a86a0c8306c0a80c64500bf602f8598000016c000920172c">
+                        <field name="s1ap.ProtocolIE_Field" pos="117" show="" showname="ProtocolIE-Field" size="107" value="">
+                          <field name="s1ap.id" pos="117" show="24" showname="id: id-E-RABToBeSetupListCtxtSUReq (24)" size="2" value="0018"/>
+                          <field hide="yes" name="per.enum_index" pos="119" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="119" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="120" show="103" showname="Open Type Length: 103" size="1" value="67"/>
+                          <field name="s1ap.value" pos="121" show="" showname="value" size="103" value="">
+                            <field hide="yes" name="per.sequence_of_length" pos="121" show="1" showname="Sequence-Of Length: 1" size="1" value="00"/>
+                            <field name="s1ap.E_RABToBeSetupListCtxtSUReq" pos="122" show="1" showname="E-RABToBeSetupListCtxtSUReq: 1 item" size="102" value="00340062450009040f80c0a80c11000000015327ad0aaa9a010742014a062002f859000100315201c1010909036f616904697076340501c0bc00025e04fefede9e271480802110030000108106c0a86a0c8306c0a80c64500bf602f8598000016c000920172c">
+                              <field name="" pos="122" show="Item 0: id-E-RABToBeSetupItemCtxtSUReq" size="102" value="00340062450009040f80c0a80c11000000015327ad0aaa9a010742014a062002f859000100315201c1010909036f616904697076340501c0bc00025e04fefede9e271480802110030000108106c0a86a0c8306c0a80c64500bf602f8598000016c000920172c">
+                                <field name="s1ap.ProtocolIE_SingleContainer" pos="122" show="" showname="ProtocolIE-SingleContainer" size="102" value="">
+                                  <field name="s1ap.id" pos="122" show="52" showname="id: id-E-RABToBeSetupItemCtxtSUReq (52)" size="2" value="0034"/>
+                                  <field hide="yes" name="per.enum_index" pos="124" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                                  <field name="s1ap.criticality" pos="124" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                                  <field hide="yes" name="per.open_type_length" pos="125" show="98" showname="Open Type Length: 98" size="1" value="62"/>
+                                  <field name="s1ap.value" pos="126" show="" showname="value" size="98" value="">
+                                    <field name="s1ap.E_RABToBeSetupItemCtxtSUReq" pos="126" show="" showname="E-RABToBeSetupItemCtxtSUReq" size="98" value="">
+                                      <field hide="yes" name="per.extension_bit" pos="126" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="45" value="0"/>
+                                      <field hide="yes" name="per.optional_field_bit" pos="126" show="1" showname=".1.. .... Optional Field Bit: True (nAS-PDU is present)" size="1" unmaskedvalue="45" value="1"/>
+                                      <field hide="yes" name="per.optional_field_bit" pos="126" show="0" showname="..0. .... Optional Field Bit: False (iE-Extensions is NOT present)" size="1" unmaskedvalue="45" value="0"/>
+                                      <field hide="yes" name="per.extension_present_bit" pos="126" show="0" showname="...0 .... Extension Present Bit: False" size="1" unmaskedvalue="45" value="0"/>
+                                      <field name="s1ap.e_RAB_ID" pos="126" show="5" showname="e-RAB-ID: 5" size="1" value="45"/>
+                                      <field name="s1ap.e_RABlevelQoSParameters" pos="127" show="" showname="e-RABlevelQoSParameters" size="3" value="">
+                                        <field hide="yes" name="per.extension_bit" pos="127" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                                        <field hide="yes" name="per.optional_field_bit" pos="127" show="0" showname=".0.. .... Optional Field Bit: False (gbrQosInformation is NOT present)" size="1" unmaskedvalue="00" value="0"/>
+                                        <field hide="yes" name="per.optional_field_bit" pos="127" show="0" showname="..0. .... Optional Field Bit: False (iE-Extensions is NOT present)" size="1" unmaskedvalue="00" value="0"/>
+                                        <field name="s1ap.qCI" pos="128" show="9" showname="qCI: 9" size="1" value="09"/>
+                                        <field name="s1ap.allocationRetentionPriority" pos="129" show="" showname="allocationRetentionPriority" size="1" value="">
+                                          <field hide="yes" name="per.extension_bit" pos="129" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="04" value="0"/>
+                                          <field hide="yes" name="per.optional_field_bit" pos="129" show="0" showname=".0.. .... Optional Field Bit: False (iE-Extensions is NOT present)" size="1" unmaskedvalue="04" value="0"/>
+                                          <field name="s1ap.priorityLevel" pos="129" show="1" showname="priorityLevel: highest (1)" size="1" value="04"/>
+                                          <field hide="yes" name="per.enum_index" pos="129" show="0" showname="Enumerated Index: 0" size="1" value="04"/>
+                                          <field name="s1ap.pre_emptionCapability" pos="129" show="0" showname="pre-emptionCapability: shall-not-trigger-pre-emption (0)" size="1" value="04"/>
+                                          <field hide="yes" name="per.enum_index" pos="129" show="0" showname="Enumerated Index: 0" size="1" value="04"/>
+                                          <field name="s1ap.pre_emptionVulnerability" pos="129" show="0" showname="pre-emptionVulnerability: not-pre-emptable (0)" size="1" value="04"/>
+                                        </field>
+                                      </field>
+                                      <field name="per.extension_present_bit" pos="130" show="0" showname="0... .... Extension Present Bit: False" size="1" unmaskedvalue="0f" value="0"/>
+                                      <field hide="yes" name="per.bit_string_length" pos="130" show="32" showname="Bit String Length: 32" size="1" value="0f"/>
+                                      <field name="s1ap.transportLayerAddress" pos="132" show="c0:a8:0c:11" showname="transportLayerAddress: c0a80c11 [bit length 32, 1100 0000  1010 1000  0000 1100  0001 0001 decimal value 3232238609]" size="4" value="c0a80c11">
+                                        <field name="s1ap.transportLayerAddressIPv4" pos="132" show="192.168.12.17" showname="transportLayerAddress(IPv4): 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+                                      </field>
+                                      <field name="s1ap.gTP_TEID" pos="136" show="00:00:00:01" showname="gTP-TEID: 00000001" size="4" value="00000001"/>
+                                      <field hide="yes" name="per.octet_string_length" pos="140" show="83" showname="Octet String Length: 83" size="1" value="53"/>
+                                      <field name="s1ap.nAS_PDU" pos="141" show="27:ad:0a:aa:9a:01:07:42:01:4a:06:20:02:f8:59:00:01:00:31:52:01:c1:01:09:09:03:6f:61:69:04:69:70:76:34:05:01:c0:bc:00:02:5e:04:fe:fe:de:9e:27:14:80:80:21:10:03:00:00:10:81:06:c0:a8:6a:0c:83:06:c0:a8:0c:64:50:0b:f6:02:f8:59:80:00:01:6c:00:09:20:17:2c" showname="nAS-PDU: 27ad0aaa9a010742014a062002f859000100315201c10109..." size="83" value="27ad0aaa9a010742014a062002f859000100315201c1010909036f616904697076340501c0bc00025e04fefede9e271480802110030000108106c0a86a0c8306c0a80c64500bf602f8598000016c000920172c"/>
+                                      <proto name="nas-eps" pos="141" showname="Non-Access-Stratum (NAS)PDU" size="83">
+                                        <field name="nas_eps.security_header_type" pos="141" show="2" showname="0010 .... = Security header type: Integrity protected and ciphered (2)" size="1" unmaskedvalue="27" value="2"/>
+                                        <field name="gsm_a.L3_protocol_discriminator" pos="141" show="0x07" showname=".... 0111 = Protocol discriminator: EPS mobility management messages (0x07)" size="1" unmaskedvalue="27" value="7"/>
+                                        <field name="nas_eps.msg_auth_code" pos="142" show="0xad0aaa9a" showname="Message authentication code: 0xad0aaa9a" size="4" value="ad0aaa9a"/>
+                                        <field name="nas_eps.seq_no" pos="146" show="1" showname="Sequence number: 1" size="1" value="01"/>
+                                        <field name="nas_eps.security_header_type" pos="147" show="0" showname="0000 .... = Security header type: Plain NAS message, not security protected (0)" size="1" unmaskedvalue="07" value="0"/>
+                                        <field name="gsm_a.L3_protocol_discriminator" pos="147" show="0x07" showname=".... 0111 = Protocol discriminator: EPS mobility management messages (0x07)" size="1" unmaskedvalue="07" value="7"/>
+                                        <field name="nas_eps.nas_msg_emm_type" pos="148" show="0x42" showname="NAS EPS Mobility Management Message Type: Attach accept (0x42)" size="1" value="42"/>
+                                        <field name="nas_eps.emm.spare_half_octet" pos="149" show="0" showname="0000 .... = Spare half octet: 0" size="1" value="01"/>
+                                        <field name="nas_eps.spare_bits" pos="149" show="0x00" showname=".... 0... = Spare bit(s): 0x00" size="1" value="01"/>
+                                        <field name="nas_eps.emm.EPS_attach_result" pos="149" show="1" showname=".... .001 = Attach result: EPS only (1)" size="1" value="01"/>
+                                        <field name="" pos="150" show="GPRS Timer - T3412 value" size="1" value="4a">
+                                          <field name="" pos="150" show="GPRS Timer: 60 min" size="1" value="4a">
+                                            <field name="gsm_a.gm.gmm.gprs_timer_unit" pos="150" show="2" showname="010. .... = Unit: value is incremented in multiples of decihours (2)" size="1" unmaskedvalue="4a" value="2"/>
+                                            <field name="gsm_a.gm.gmm.gprs_timer_value" pos="150" show="10" showname="...0 1010 = Timer value: 10" size="1" unmaskedvalue="4a" value="A"/>
+                                          </field>
+                                        </field>
+                                        <field name="" pos="151" show="Tracking area identity list - TAI list" size="7" value="062002f8590001">
+                                          <field name="gsm_a.len" pos="151" show="6" showname="Length: 6" size="1" value="06"/>
+                                          <field name="nas_eps.spare_bits" pos="152" show="0x00" showname="0... .... = Spare bit(s): 0x00" size="1" value="20"/>
+                                          <field name="nas_eps.emm.tai_tol" pos="152" show="1" showname=".01. .... = Type of list: list of TACs belonging to one PLMN, with consecutive TAC values (1)" size="1" unmaskedvalue="20" value="1"/>
+                                          <field name="nas_eps.emm.tai_n_elem" pos="152" show="0" showname="...0 0000 = Number of elements: 0 [+1 = 1 element(s)]" size="1" unmaskedvalue="20" value="0"/>
+                                          <field name="e212.mcc" pos="153" show="208" showname="Mobile Country Code (MCC): France (208)" size="2" value="02f8"/>
+                                          <field name="e212.mnc" pos="154" show="95" showname="Mobile Network Code (MNC): Unknown (95)" size="2" value="f859"/>
+                                          <field name="nas_eps.emm.tai_tac" pos="156" show="0x0001" showname="Tracking area code(TAC): 0x0001" size="2" value="0001"/>
+                                        </field>
+                                        <field name="" pos="158" show="ESM message container" size="51" value="00315201c1010909036f616904697076340501c0bc00025e04fefede9e271480802110030000108106c0a86a0c8306c0a80c64">
+                                          <field name="gsm_a.len" pos="158" show="49" showname="Length: 49" size="2" value="0031"/>
+                                          <field name="nas_eps.emm.esm_msg_cont" pos="160" show="52:01:c1:01:09:09:03:6f:61:69:04:69:70:76:34:05:01:c0:bc:00:02:5e:04:fe:fe:de:9e:27:14:80:80:21:10:03:00:00:10:81:06:c0:a8:6a:0c:83:06:c0:a8:0c:64" showname="ESM message container contents: 5201c1010909036f616904697076340501c0bc00025e04fe..." size="49" value="5201c1010909036f616904697076340501c0bc00025e04fefede9e271480802110030000108106c0a86a0c8306c0a80c64">
+                                            <field name="nas_eps.bearer_id" pos="160" show="5" showname="0101 .... = EPS bearer identity: EPS bearer identity value 5 (5)" size="1" unmaskedvalue="52" value="5"/>
+                                            <field name="gsm_a.L3_protocol_discriminator" pos="160" show="0x02" showname=".... 0010 = Protocol discriminator: EPS session management messages (0x02)" size="1" unmaskedvalue="52" value="2"/>
+                                            <field name="nas_eps.esm.proc_trans_id" pos="161" show="1" showname="Procedure transaction identity: 1" size="1" value="01"/>
+                                            <field name="nas_eps.nas_msg_esm_type" pos="162" show="0xc1" showname="NAS EPS session management messages: Activate default EPS bearer context request (0xc1)" size="1" value="c1"/>
+                                            <field name="" pos="163" show="EPS quality of service" size="2" value="0109">
+                                              <field name="gsm_a.len" pos="163" show="1" showname="Length: 1" size="1" value="01"/>
+                                              <field name="nas_eps.emm.qci" pos="164" show="9" showname="Quality of Service Class Identifier (QCI): QCI 9 (9)" size="1" value="09"/>
+                                            </field>
+                                            <field name="" pos="165" show="Access Point Name" size="10" value="09036f61690469707634">
+                                              <field name="gsm_a.len" pos="165" show="9" showname="Length: 9" size="1" value="09"/>
+                                              <field name="gsm_a.gm.sm.apn" pos="166" show="oai.ipv4" showname="APN: oai.ipv4" size="9" value="036f61690469707634"/>
+                                            </field>
+                                            <field name="" pos="175" show="PDN address" size="6" value="0501c0bc0002">
+                                              <field name="gsm_a.len" pos="175" show="5" showname="Length: 5" size="1" value="05"/>
+                                              <field name="nas_eps.spare_bits" pos="176" show="0x00" showname="0000 0... = Spare bit(s): 0x00" size="1" value="01"/>
+                                              <field name="nas_eps.esm_pdn_type" pos="176" show="1" showname="PDN type: IPv4 (1)" size="1" value="01"/>
+                                              <field name="nas_eps.esm.pdn_ipv4" pos="177" show="192.188.0.2" showname="PDN IPv4: 192.188.0.2 (192.188.0.2)" size="4" value="c0bc0002"/>
+                                            </field>
+                                            <field name="" pos="181" show="APN aggregate maximum bit rate" size="6" value="5e04fefede9e">
+                                              <field name="nas_eps.esm.elem_id" pos="181" show="0x5e" showname="Element ID: 0x5e" size="1" value="5e"/>
+                                              <field name="gsm_a.len" pos="182" show="4" showname="Length: 4" size="1" value="04"/>
+                                              <field name="nas_eps.emm.apn_ambr_dl" pos="183" show="254" showname="APN-AMBR for downlink : 8640 kbps" size="1" value="fe"/>
+                                              <field name="nas_eps.emm.apn_ambr_ul" pos="184" show="254" showname="APN-AMBR for uplink : 8640 kbps" size="1" value="fe"/>
+                                              <field name="nas_eps.emm.apn_ambr_dl_ext" pos="185" show="222" showname="APN-AMBR for downlink (extended) : 200 Mbps" size="1" value="de"/>
+                                              <field name="" pos="185" show="Total APN-AMBR for downlink : 200,000 Mbps" size="1" value="de"/>
+                                              <field name="nas_eps.emm.apn_ambr_ul_ext" pos="186" show="158" showname="APN-AMBR for uplink (extended) : 100 Mbps" size="1" value="9e"/>
+                                              <field name="" pos="186" show="Total APN-AMBR for uplink : 100,000 Mbps" size="1" value="9e"/>
+                                            </field>
+                                            <field name="" pos="187" show="Protocol Configuration Options" size="22" value="271480802110030000108106c0a86a0c8306c0a80c64">
+                                              <field name="gsm_a.gm.elem_id" pos="187" show="0x27" showname="Element ID: 0x27" size="1" value="27"/>
+                                              <field name="gsm_a.len" pos="188" show="20" showname="Length: 20" size="1" value="14"/>
+                                              <field name="gsm_a.gm.sm.link_dir" pos="189" show="1" showname="Link direction: Network to MS (1)" size="0"/>
+                                              <field name="gsm_a.gm.sm.ext" pos="189" show="1" showname="1... .... = Extension: True" size="1" unmaskedvalue="80" value="1"/>
+                                              <field name="" pos="189" show="Configuration Protocol: PPP for use with IP PDP type or IP PDN type (0)" size="1" value="80"/>
+                                              <field name="gsm_a.gm.sm.pco_pid" pos="190" show="32801" showname="Protocol or Container ID: Internet Protocol Control Protocol (0x8021)" size="2" value="8021">
+                                                <field name="" pos="192" show="Length: 0x10 (16)" size="1" value="10"/>
+                                                <proto name="ipcp" pos="193" showname="PPP IP Control Protocol" size="16">
+                                                  <field name="ppp.code" pos="193" show="3" showname="Code: Configuration Nak (3)" size="1" value="03"/>
+                                                  <field name="ppp.identifier" pos="194" show="0" showname="Identifier: 0 (0x00)" size="1" value="00"/>
+                                                  <field name="ppp.length" pos="195" show="16" showname="Length: 16" size="2" value="0010"/>
+                                                  <field name="" pos="197" show="Options: (12 bytes), Primary DNS Server IP Address, Secondary DNS Server IP Address" size="12" value="8106c0a86a0c8306c0a80c64">
+                                                    <field name="" pos="197" show="Primary DNS Server IP Address: 192.168.106.12" size="6" value="8106c0a86a0c">
+                                                      <field name="ipcp.opt.type" pos="197" show="129" showname="Type: Primary DNS Server IP Address (129)" size="1" value="81"/>
+                                                      <field name="ipcp.opt.length" pos="198" show="6" showname="Length: 6" size="1" value="06"/>
+                                                      <field name="ipcp.opt.pri_dns_address" pos="199" show="192.168.106.12" showname="Primary DNS Address: 192.168.106.12 (192.168.106.12)" size="4" value="c0a86a0c"/>
+                                                    </field>
+                                                    <field name="" pos="203" show="Secondary DNS Server IP Address: 192.168.12.100" size="6" value="8306c0a80c64">
+                                                      <field name="ipcp.opt.type" pos="203" show="131" showname="Type: Secondary DNS Server IP Address (131)" size="1" value="83"/>
+                                                      <field name="ipcp.opt.length" pos="204" show="6" showname="Length: 6" size="1" value="06"/>
+                                                      <field name="ipcp.opt.sec_dns_address" pos="205" show="192.168.12.100" showname="Secondary DNS Address: 192.168.12.100 (192.168.12.100)" size="4" value="c0a80c64"/>
+                                                    </field>
+                                                  </field>
+                                                </proto>
+                                              </field>
+                                            </field>
+                                          </field>
+                                        </field>
+                                        <field name="" pos="209" show="EPS mobile identity - GUTI" size="13" value="500bf602f8598000016c000920">
+                                          <field name="nas_eps.emm.elem_id" pos="209" show="0x50" showname="Element ID: 0x50" size="1" value="50"/>
+                                          <field name="gsm_a.len" pos="210" show="11" showname="Length: 11" size="1" value="0b"/>
+                                          <field name="nas_eps.emm.odd_even" pos="211" show="0" showname=".... 0... = odd/even indic: 0" size="1" unmaskedvalue="f6" value="0"/>
+                                          <field name="nas_eps.emm.type_of_id" pos="211" show="6" showname=".... .110 = Type of identity: GUTI (6)" size="1" unmaskedvalue="f6" value="6"/>
+                                          <field name="e212.mcc" pos="212" show="208" showname="Mobile Country Code (MCC): France (208)" size="2" value="02f8"/>
+                                          <field name="e212.mnc" pos="213" show="95" showname="Mobile Network Code (MNC): Unknown (95)" size="2" value="f859"/>
+                                          <field name="nas_eps.emm.mme_grp_id" pos="215" show="32768" showname="MME Group ID: 32768" size="2" value="8000"/>
+                                          <field name="nas_eps.emm.mme_code" pos="217" show="1" showname="MME Code: 1" size="1" value="01"/>
+                                          <field name="nas_eps.emm.m_tmsi" pos="218" show="0x6c000920" showname="M-TMSI: 0x6c000920" size="4" value="6c000920"/>
+                                        </field>
+                                        <field name="" pos="222" show="GPRS Timer - T3402 value" size="2" value="172c">
+                                          <field name="gsm_a.gm.elem_id" pos="222" show="0x17" showname="Element ID: 0x17" size="1" value="17"/>
+                                          <field name="" pos="223" show="GPRS Timer: 12 min" size="1" value="2c">
+                                            <field name="gsm_a.gm.gmm.gprs_timer_unit" pos="223" show="1" showname="001. .... = Unit: value is incremented in multiples of 1 minute (1)" size="1" unmaskedvalue="2c" value="1"/>
+                                            <field name="gsm_a.gm.gmm.gprs_timer_value" pos="223" show="12" showname="...0 1100 = Timer value: 12" size="1" unmaskedvalue="2c" value="C"/>
+                                          </field>
+                                        </field>
+                                      </proto>
+                                    </field>
+                                  </field>
+                                </field>
+                              </field>
+                            </field>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="224" show="Item 4: id-UESecurityCapabilities" size="9" value="006b00051000020000">
+                        <field name="s1ap.ProtocolIE_Field" pos="224" show="" showname="ProtocolIE-Field" size="9" value="">
+                          <field name="s1ap.id" pos="224" show="107" showname="id: id-UESecurityCapabilities (107)" size="2" value="006b"/>
+                          <field hide="yes" name="per.enum_index" pos="226" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="226" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="227" show="5" showname="Open Type Length: 5" size="1" value="05"/>
+                          <field name="s1ap.value" pos="228" show="" showname="value" size="5" value="">
+                            <field name="s1ap.UESecurityCapabilities" pos="228" show="" showname="UESecurityCapabilities" size="4" value="">
+                              <field hide="yes" name="per.extension_bit" pos="228" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="10" value="0"/>
+                              <field hide="yes" name="per.optional_field_bit" pos="228" show="0" showname=".0.. .... Optional Field Bit: False (iE-Extensions is NOT present)" size="1" unmaskedvalue="10" value="0"/>
+                              <field name="per.extension_present_bit" pos="228" show="0" showname="..0. .... Extension Present Bit: False" size="1" unmaskedvalue="10" value="0"/>
+                              <field name="s1ap.encryptionAlgorithms" pos="228" show="80:00" showname="encryptionAlgorithms: 8000 [bit length 16, 1000 0000  0000 0000 decimal value 32768]" size="2" value="8000"/>
+                              <field name="per.extension_present_bit" pos="230" show="0" showname="...0 .... Extension Present Bit: False" size="1" unmaskedvalue="02" value="0"/>
+                              <field name="s1ap.integrityProtectionAlgorithms" pos="228" show="20:00" showname="integrityProtectionAlgorithms: 2000 [bit length 16, 0010 0000  0000 0000 decimal value 8192]" size="2" value="2000"/>
+                            </field>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="233" show="Item 5: id-SecurityKey" size="36" value="00490020d3a2585db3755b592cdd43bd648158eb3d142a9f7295ef2da9003b8f7a7a5929">
+                        <field name="s1ap.ProtocolIE_Field" pos="233" show="" showname="ProtocolIE-Field" size="36" value="">
+                          <field name="s1ap.id" pos="233" show="73" showname="id: id-SecurityKey (73)" size="2" value="0049"/>
+                          <field hide="yes" name="per.enum_index" pos="235" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="235" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="236" show="32" showname="Open Type Length: 32" size="1" value="20"/>
+                          <field name="s1ap.value" pos="237" show="" showname="value" size="32" value="">
+                            <field name="s1ap.SecurityKey" pos="237" show="d3:a2:58:5d:b3:75:5b:59:2c:dd:43:bd:64:81:58:eb:3d:14:2a:9f:72:95:ef:2d:a9:00:3b:8f:7a:7a:59:29" showname="SecurityKey: d3a2585db3755b592cdd43bd648158eb3d142a9f7295ef2d... [bit length 256]" size="32" value="d3a2585db3755b592cdd43bd648158eb3d142a9f7295ef2da9003b8f7a7a5929"/>
+                          </field>
+                        </field>
+                      </field>
+                    </field>
+                  </field>
+                </field>
+              </field>
+            </field>
+          </proto>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 86: 126 bytes on wire (1008 bits), 126 bytes captured (1008 bits) on interface 0" size="126">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:34:54.029328000" showname="Arrival Time: Sep 25, 2015 16:34:54.029328000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191694.029328000" showname="Epoch Time: 1443191694.029328000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.006335000" showname="Time delta from previous captured frame: 0.006335000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.006335000" showname="Time delta from previous displayed frame: 0.006335000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="47.563697000" showname="Time since reference or first frame: 47.563697000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="86" showname="Frame Number: 86" size="0"/>
+      <field name="frame.len" pos="0" show="126" showname="Frame Length: 126 bytes (1008 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="126" showname="Capture Length: 126 bytes (1008 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp:s1ap:s1ap:s1ap:s1ap:s1ap" showname="Protocols in frame: eth:ip:sctp:s1ap:s1ap:s1ap:s1ap:s1ap" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.213 (192.168.12.213), Dst: 192.168.12.17 (192.168.12.17)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="112" showname="Total Length: 112" size="2" value="0070"/>
+        <field name="ip.id" pos="18" show="0x000a" showname="Identification: 0x000a (10)" size="2" value="000a"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0x9fc7" showname="Header checksum: 0x9fc7 [validation disabled]" size="2" value="9fc7">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="9fc7"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="9fc7"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.213" showname="Source: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.213" showname="Source Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="ip.dst" pos="30" show="192.168.12.17" showname="Destination: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.17" showname="Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="44">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x4cd1eca0" showname="Verification tag: 0x4cd1eca0" size="4" value="4cd1eca0"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0x936ee321" showname="Checksum: 0x936ee321 (not verified)" size="4" value="936ee321"/>
+          <field name="" pos="46" show="SACK chunk (Cumulative TSN: 2008295179, a_rwnd: 106496, gaps: 0, duplicate TSNs: 0)" size="16" value="0300001077b4270b0001a00000000000">
+            <field name="sctp.chunk_type" pos="46" show="3" showname="Chunk type: SACK (3)" size="1" value="03">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="03" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="03" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00">
+              <field name="sctp.sack_nounce_sum" pos="47" show="0" showname=".... ...0 = Nounce sum: 0" size="1" unmaskedvalue="00" value="0"/>
+            </field>
+            <field name="sctp.chunk_length" pos="48" show="16" showname="Chunk length: 16" size="2" value="0010"/>
+            <field name="sctp.sack_cumulative_tsn_ack" pos="50" show="2008295179" showname="Cumulative TSN ACK: 2008295179" size="4" value="77b4270b"/>
+            <field name="sctp.sack_a_rwnd" pos="54" show="106496" showname="Advertised receiver window credit (a_rwnd): 106496" size="4" value="0001a000"/>
+            <field name="sctp.sack_number_of_gap_blocks" pos="58" show="0" showname="Number of gap acknowledgement blocks: 0" size="2" value="0000"/>
+            <field name="sctp.sack_number_of_duplicated_tsns" pos="60" show="0" showname="Number of duplicated TSNs: 0" size="2" value="0000"/>
+          </field>
+          <field name="" pos="62" show="DATA chunk(ordered, complete segment, TSN: 3304831196, SID: 1, SSN: 4, PPID: 18, payload length: 48 bytes)" size="16" value="00030040c4fbb8dc0001000400000012">
+            <field name="sctp.chunk_type" pos="62" show="0" showname="Chunk type: DATA (0)" size="1" value="00">
+              <field name="sctp.chunk_bit_1" pos="62" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="00" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="62" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="00" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="63" show="0x03" showname="Chunk flags: 0x03" size="1" value="03">
+              <field name="sctp.data_e_bit" pos="63" show="1" showname=".... ...1 = E-Bit: Last segment" size="1" unmaskedvalue="03" value="1"/>
+              <field name="sctp.data_b_bit" pos="63" show="1" showname=".... ..1. = B-Bit: First segment" size="1" unmaskedvalue="03" value="1"/>
+              <field name="sctp.data_u_bit" pos="63" show="0" showname=".... .0.. = U-Bit: Ordered delivery" size="1" unmaskedvalue="03" value="0"/>
+              <field name="sctp.data_i_bit" pos="63" show="0" showname=".... 0... = I-Bit: Possibly delay SACK" size="1" unmaskedvalue="03" value="0"/>
+            </field>
+            <field name="sctp.chunk_length" pos="64" show="64" showname="Chunk length: 64" size="2" value="0040"/>
+            <field name="sctp.data_tsn" pos="66" show="3304831196" showname="TSN: 3304831196" size="4" value="c4fbb8dc"/>
+            <field name="sctp.data_sid" pos="70" show="0x0001" showname="Stream Identifier: 0x0001" size="2" value="0001"/>
+            <field name="sctp.data_ssn" pos="72" show="4" showname="Stream sequence number: 4" size="2" value="0004"/>
+            <field name="sctp.data_payload_proto_id" pos="74" show="18" showname="Payload protocol identifier: S1 Application Protocol (S1AP) (18)" size="4" value="00000012"/>
+          </field>
+          <proto name="s1ap" pos="78" showname="S1 Application Protocol" size="48">
+            <field hide="yes" name="per.extension_bit" pos="78" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+            <field hide="yes" name="per.choice_index" pos="78" show="0" showname="Choice Index: 0" size="1" value="00"/>
+            <field name="s1ap.S1AP_PDU" pos="78" show="0" showname="S1AP-PDU: initiatingMessage (0)" size="48" value="0016402c00000300000005c0740010d0000800048006692d004a40141381200003001060e0c1f83f07e0fd7837620000">
+              <field name="s1ap.initiatingMessage" pos="78" show="" showname="initiatingMessage" size="48" value="">
+                <field name="s1ap.procedureCode" pos="79" show="22" showname="procedureCode: id-UECapabilityInfoIndication (22)" size="1" value="16"/>
+                <field hide="yes" name="per.enum_index" pos="80" show="1" showname="Enumerated Index: 1" size="1" value="40"/>
+                <field name="s1ap.criticality" pos="80" show="1" showname="criticality: ignore (1)" size="1" value="40"/>
+                <field hide="yes" name="per.open_type_length" pos="81" show="44" showname="Open Type Length: 44" size="1" value="2c"/>
+                <field name="s1ap.value" pos="82" show="" showname="value" size="44" value="">
+                  <field name="s1ap.UECapabilityInfoIndication" pos="82" show="" showname="UECapabilityInfoIndication" size="44" value="">
+                    <field hide="yes" name="per.extension_bit" pos="82" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                    <field hide="yes" name="per.sequence_of_length" pos="83" show="3" showname="Sequence-Of Length: 3" size="2" value="0003"/>
+                    <field name="s1ap.protocolIEs" pos="85" show="3" showname="protocolIEs: 3 items" size="41" value="00000005c0740010d0000800048006692d004a40141381200003001060e0c1f83f07e0fd7837620000">
+                      <field name="" pos="85" show="Item 0: id-MME-UE-S1AP-ID" size="9" value="00000005c0740010d0">
+                        <field name="s1ap.ProtocolIE_Field" pos="85" show="" showname="ProtocolIE-Field" size="9" value="">
+                          <field name="s1ap.id" pos="85" show="0" showname="id: id-MME-UE-S1AP-ID (0)" size="2" value="0000"/>
+                          <field hide="yes" name="per.enum_index" pos="87" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="87" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="88" show="5" showname="Open Type Length: 5" size="1" value="05"/>
+                          <field name="s1ap.value" pos="89" show="" showname="value" size="5" value="">
+                            <field name="s1ap.MME_UE_S1AP_ID" pos="89" show="1946161360" showname="MME-UE-S1AP-ID: 1946161360" size="5" value="c0740010d0"/>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="94" show="Item 1: id-eNB-UE-S1AP-ID" size="8" value="000800048006692d">
+                        <field name="s1ap.ProtocolIE_Field" pos="94" show="" showname="ProtocolIE-Field" size="8" value="">
+                          <field name="s1ap.id" pos="94" show="8" showname="id: id-eNB-UE-S1AP-ID (8)" size="2" value="0008"/>
+                          <field hide="yes" name="per.enum_index" pos="96" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="96" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="97" show="4" showname="Open Type Length: 4" size="1" value="04"/>
+                          <field name="s1ap.value" pos="98" show="" showname="value" size="4" value="">
+                            <field name="s1ap.ENB_UE_S1AP_ID" pos="98" show="420141" showname="ENB-UE-S1AP-ID: 420141" size="4" value="8006692d"/>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="102" show="Item 2: id-UERadioCapability" size="24" value="004a40141381200003001060e0c1f83f07e0fd7837620000">
+                        <field name="s1ap.ProtocolIE_Field" pos="102" show="" showname="ProtocolIE-Field" size="24" value="">
+                          <field name="s1ap.id" pos="102" show="74" showname="id: id-UERadioCapability (74)" size="2" value="004a"/>
+                          <field hide="yes" name="per.enum_index" pos="104" show="1" showname="Enumerated Index: 1" size="1" value="40"/>
+                          <field name="s1ap.criticality" pos="104" show="1" showname="criticality: ignore (1)" size="1" value="40"/>
+                          <field hide="yes" name="per.open_type_length" pos="105" show="20" showname="Open Type Length: 20" size="1" value="14"/>
+                          <field name="s1ap.value" pos="106" show="" showname="value" size="20" value="">
+                            <field hide="yes" name="per.octet_string_length" pos="106" show="19" showname="Octet String Length: 19" size="1" value="13"/>
+                            <field name="s1ap.UERadioCapability" pos="107" show="81:20:00:03:00:10:60:e0:c1:f8:3f:07:e0:fd:78:37:62:00:00" showname="UERadioCapability: 81200003001060e0c1f83f07e0fd7837620000" size="19" value="81200003001060e0c1f83f07e0fd7837620000">
+                              <field name="lte-rrc.UERadioAccessCapabilityInformation" pos="107" show="" showname="UERadioAccessCapabilityInformation" size="1" value="">
+                                <field hide="yes" name="per.choice_index" pos="107" show="1" showname="Choice Index: 1" size="1" value="81"/>
+                                <field name="lte-rrc.criticalExtensions" pos="107" show="1" showname="criticalExtensions: criticalExtensionsFuture (1)" size="1" value="81">
+                                  <field name="lte-rrc.criticalExtensionsFuture" pos="107" show="" showname="criticalExtensionsFuture" size="1" value=""/>
+                                </field>
+                              </field>
+                            </field>
+                          </field>
+                        </field>
+                      </field>
+                    </field>
+                  </field>
+                </field>
+              </field>
+            </field>
+          </proto>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 87: 62 bytes on wire (496 bits), 62 bytes captured (496 bits) on interface 0" size="62">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:34:54.226130000" showname="Arrival Time: Sep 25, 2015 16:34:54.226130000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191694.226130000" showname="Epoch Time: 1443191694.226130000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.196802000" showname="Time delta from previous captured frame: 0.196802000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.196802000" showname="Time delta from previous displayed frame: 0.196802000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="47.760499000" showname="Time since reference or first frame: 47.760499000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="87" showname="Frame Number: 87" size="0"/>
+      <field name="frame.len" pos="0" show="62" showname="Frame Length: 62 bytes (496 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="62" showname="Capture Length: 62 bytes (496 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp" showname="Protocols in frame: eth:ip:sctp" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.17 (192.168.12.17), Dst: 192.168.12.213 (192.168.12.213)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="48" showname="Total Length: 48" size="2" value="0030"/>
+        <field name="ip.id" pos="18" show="0x0000" showname="Identification: 0x0000 (0)" size="2" value="0000"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0xa011" showname="Header checksum: 0xa011 [validation disabled]" size="2" value="a011">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="a011"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="a011"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.17" showname="Source: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.17" showname="Source Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="ip.dst" pos="30" show="192.168.12.213" showname="Destination: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.213" showname="Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="28">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x54f837ab" showname="Verification tag: 0x54f837ab" size="4" value="54f837ab"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0x4bc96ec5" showname="Checksum: 0x4bc96ec5 (not verified)" size="4" value="4bc96ec5"/>
+          <field name="" pos="46" show="SACK chunk (Cumulative TSN: 3304831196, a_rwnd: 106496, gaps: 0, duplicate TSNs: 0)" size="16" value="03000010c4fbb8dc0001a00000000000">
+            <field name="sctp.chunk_type" pos="46" show="3" showname="Chunk type: SACK (3)" size="1" value="03">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="03" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="03" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00">
+              <field name="sctp.sack_nounce_sum" pos="47" show="0" showname=".... ...0 = Nounce sum: 0" size="1" unmaskedvalue="00" value="0"/>
+            </field>
+            <field name="sctp.chunk_length" pos="48" show="16" showname="Chunk length: 16" size="2" value="0010"/>
+            <field name="sctp.sack_cumulative_tsn_ack" pos="50" show="3304831196" showname="Cumulative TSN ACK: 3304831196" size="4" value="c4fbb8dc"/>
+            <field name="sctp.sack_a_rwnd" pos="54" show="106496" showname="Advertised receiver window credit (a_rwnd): 106496" size="4" value="0001a000"/>
+            <field name="sctp.sack_number_of_gap_blocks" pos="58" show="0" showname="Number of gap acknowledgement blocks: 0" size="2" value="0000"/>
+            <field name="sctp.sack_number_of_duplicated_tsns" pos="60" show="0" showname="Number of duplicated TSNs: 0" size="2" value="0000"/>
+          </field>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 88: 186 bytes on wire (1488 bits), 186 bytes captured (1488 bits) on interface 0" size="186">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:34:54.226402000" showname="Arrival Time: Sep 25, 2015 16:34:54.226402000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191694.226402000" showname="Epoch Time: 1443191694.226402000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.000272000" showname="Time delta from previous captured frame: 0.000272000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.000272000" showname="Time delta from previous displayed frame: 0.000272000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="47.760771000" showname="Time since reference or first frame: 47.760771000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="88" showname="Frame Number: 88" size="0"/>
+      <field name="frame.len" pos="0" show="186" showname="Frame Length: 186 bytes (1488 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="186" showname="Capture Length: 186 bytes (1488 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp:s1ap:s1ap:s1ap:s1ap:s1ap:s1ap:s1ap:s1ap:s1ap:s1ap:s1ap:nas-eps:s1ap:s1ap" showname="Protocols in frame: eth:ip:sctp:s1ap:s1ap:s1ap:s1ap:s1ap:s1ap:s1ap:s1ap:s1ap:s1ap:s1ap:nas-eps:s1ap:s1ap" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.213 (192.168.12.213), Dst: 192.168.12.17 (192.168.12.17)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="172" showname="Total Length: 172" size="2" value="00ac"/>
+        <field name="ip.id" pos="18" show="0x000b" showname="Identification: 0x000b (11)" size="2" value="000b"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0x9f8a" showname="Header checksum: 0x9f8a [validation disabled]" size="2" value="9f8a">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="9f8a"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="9f8a"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.213" showname="Source: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.213" showname="Source Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="ip.dst" pos="30" show="192.168.12.17" showname="Destination: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.17" showname="Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="28">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x4cd1eca0" showname="Verification tag: 0x4cd1eca0" size="4" value="4cd1eca0"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0xb000a908" showname="Checksum: 0xb000a908 (not verified)" size="4" value="b000a908"/>
+          <field name="" pos="46" show="DATA chunk(ordered, complete segment, TSN: 3304831197, SID: 1, SSN: 5, PPID: 18, payload length: 43 bytes)" size="16" value="0003003bc4fbb8dd0001000500000012">
+            <field name="sctp.chunk_type" pos="46" show="0" showname="Chunk type: DATA (0)" size="1" value="00">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="00" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="00" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x03" showname="Chunk flags: 0x03" size="1" value="03">
+              <field name="sctp.data_e_bit" pos="47" show="1" showname=".... ...1 = E-Bit: Last segment" size="1" unmaskedvalue="03" value="1"/>
+              <field name="sctp.data_b_bit" pos="47" show="1" showname=".... ..1. = B-Bit: First segment" size="1" unmaskedvalue="03" value="1"/>
+              <field name="sctp.data_u_bit" pos="47" show="0" showname=".... .0.. = U-Bit: Ordered delivery" size="1" unmaskedvalue="03" value="0"/>
+              <field name="sctp.data_i_bit" pos="47" show="0" showname=".... 0... = I-Bit: Possibly delay SACK" size="1" unmaskedvalue="03" value="0"/>
+            </field>
+            <field name="sctp.chunk_length" pos="48" show="59" showname="Chunk length: 59" size="2" value="003b"/>
+            <field name="sctp.data_tsn" pos="50" show="3304831197" showname="TSN: 3304831197" size="4" value="c4fbb8dd"/>
+            <field name="sctp.data_sid" pos="54" show="0x0001" showname="Stream Identifier: 0x0001" size="2" value="0001"/>
+            <field name="sctp.data_ssn" pos="56" show="5" showname="Stream sequence number: 5" size="2" value="0005"/>
+            <field name="sctp.data_payload_proto_id" pos="58" show="18" showname="Payload protocol identifier: S1 Application Protocol (S1AP) (18)" size="4" value="00000012"/>
+            <field name="sctp.chunk_padding" pos="105" show="00" showname="Chunk padding: 00" size="1" value="00"/>
+          </field>
+          <proto name="s1ap" pos="62" showname="S1 Application Protocol" size="43">
+            <field hide="yes" name="per.extension_bit" pos="62" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="20" value="0"/>
+            <field hide="yes" name="per.choice_index" pos="62" show="1" showname="Choice Index: 1" size="1" value="20"/>
+            <field name="s1ap.S1AP_PDU" pos="62" show="1" showname="S1AP-PDU: successfulOutcome (1)" size="43" value="2009002700000300004005c0740010d0000840048006692d0033400f000032400a0a1fc0a80cd5ca6fe0dd">
+              <field name="s1ap.successfulOutcome" pos="62" show="" showname="successfulOutcome" size="43" value="">
+                <field name="s1ap.procedureCode" pos="63" show="9" showname="procedureCode: id-InitialContextSetup (9)" size="1" value="09"/>
+                <field hide="yes" name="per.enum_index" pos="64" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                <field name="s1ap.criticality" pos="64" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                <field hide="yes" name="per.open_type_length" pos="65" show="39" showname="Open Type Length: 39" size="1" value="27"/>
+                <field name="s1ap.value" pos="66" show="" showname="value" size="39" value="">
+                  <field name="s1ap.InitialContextSetupResponse" pos="66" show="" showname="InitialContextSetupResponse" size="39" value="">
+                    <field hide="yes" name="per.extension_bit" pos="66" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                    <field hide="yes" name="per.sequence_of_length" pos="67" show="3" showname="Sequence-Of Length: 3" size="2" value="0003"/>
+                    <field name="s1ap.protocolIEs" pos="69" show="3" showname="protocolIEs: 3 items" size="36" value="00004005c0740010d0000840048006692d0033400f000032400a0a1fc0a80cd5ca6fe0dd">
+                      <field name="" pos="69" show="Item 0: id-MME-UE-S1AP-ID" size="9" value="00004005c0740010d0">
+                        <field name="s1ap.ProtocolIE_Field" pos="69" show="" showname="ProtocolIE-Field" size="9" value="">
+                          <field name="s1ap.id" pos="69" show="0" showname="id: id-MME-UE-S1AP-ID (0)" size="2" value="0000"/>
+                          <field hide="yes" name="per.enum_index" pos="71" show="1" showname="Enumerated Index: 1" size="1" value="40"/>
+                          <field name="s1ap.criticality" pos="71" show="1" showname="criticality: ignore (1)" size="1" value="40"/>
+                          <field hide="yes" name="per.open_type_length" pos="72" show="5" showname="Open Type Length: 5" size="1" value="05"/>
+                          <field name="s1ap.value" pos="73" show="" showname="value" size="5" value="">
+                            <field name="s1ap.MME_UE_S1AP_ID" pos="73" show="1946161360" showname="MME-UE-S1AP-ID: 1946161360" size="5" value="c0740010d0"/>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="78" show="Item 1: id-eNB-UE-S1AP-ID" size="8" value="000840048006692d">
+                        <field name="s1ap.ProtocolIE_Field" pos="78" show="" showname="ProtocolIE-Field" size="8" value="">
+                          <field name="s1ap.id" pos="78" show="8" showname="id: id-eNB-UE-S1AP-ID (8)" size="2" value="0008"/>
+                          <field hide="yes" name="per.enum_index" pos="80" show="1" showname="Enumerated Index: 1" size="1" value="40"/>
+                          <field name="s1ap.criticality" pos="80" show="1" showname="criticality: ignore (1)" size="1" value="40"/>
+                          <field hide="yes" name="per.open_type_length" pos="81" show="4" showname="Open Type Length: 4" size="1" value="04"/>
+                          <field name="s1ap.value" pos="82" show="" showname="value" size="4" value="">
+                            <field name="s1ap.ENB_UE_S1AP_ID" pos="82" show="420141" showname="ENB-UE-S1AP-ID: 420141" size="4" value="8006692d"/>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="86" show="Item 2: id-E-RABSetupListCtxtSURes" size="19" value="0033400f000032400a0a1fc0a80cd5ca6fe0dd">
+                        <field name="s1ap.ProtocolIE_Field" pos="86" show="" showname="ProtocolIE-Field" size="19" value="">
+                          <field name="s1ap.id" pos="86" show="51" showname="id: id-E-RABSetupListCtxtSURes (51)" size="2" value="0033"/>
+                          <field hide="yes" name="per.enum_index" pos="88" show="1" showname="Enumerated Index: 1" size="1" value="40"/>
+                          <field name="s1ap.criticality" pos="88" show="1" showname="criticality: ignore (1)" size="1" value="40"/>
+                          <field hide="yes" name="per.open_type_length" pos="89" show="15" showname="Open Type Length: 15" size="1" value="0f"/>
+                          <field name="s1ap.value" pos="90" show="" showname="value" size="15" value="">
+                            <field hide="yes" name="per.sequence_of_length" pos="90" show="1" showname="Sequence-Of Length: 1" size="1" value="00"/>
+                            <field name="s1ap.E_RABSetupListCtxtSURes" pos="91" show="1" showname="E-RABSetupListCtxtSURes: 1 item" size="14" value="0032400a0a1fc0a80cd5ca6fe0dd">
+                              <field name="" pos="91" show="Item 0: id-E-RABSetupItemCtxtSURes" size="14" value="0032400a0a1fc0a80cd5ca6fe0dd">
+                                <field name="s1ap.ProtocolIE_SingleContainer" pos="91" show="" showname="ProtocolIE-SingleContainer" size="14" value="">
+                                  <field name="s1ap.id" pos="91" show="50" showname="id: id-E-RABSetupItemCtxtSURes (50)" size="2" value="0032"/>
+                                  <field hide="yes" name="per.enum_index" pos="93" show="1" showname="Enumerated Index: 1" size="1" value="40"/>
+                                  <field name="s1ap.criticality" pos="93" show="1" showname="criticality: ignore (1)" size="1" value="40"/>
+                                  <field hide="yes" name="per.open_type_length" pos="94" show="10" showname="Open Type Length: 10" size="1" value="0a"/>
+                                  <field name="s1ap.value" pos="95" show="" showname="value" size="10" value="">
+                                    <field name="s1ap.E_RABSetupItemCtxtSURes" pos="95" show="" showname="E-RABSetupItemCtxtSURes" size="10" value="">
+                                      <field hide="yes" name="per.extension_bit" pos="95" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="0a" value="0"/>
+                                      <field hide="yes" name="per.optional_field_bit" pos="95" show="0" showname=".0.. .... Optional Field Bit: False (iE-Extensions is NOT present)" size="1" unmaskedvalue="0a" value="0"/>
+                                      <field hide="yes" name="per.extension_present_bit" pos="95" show="0" showname="..0. .... Extension Present Bit: False" size="1" unmaskedvalue="0a" value="0"/>
+                                      <field name="s1ap.e_RAB_ID" pos="95" show="5" showname="e-RAB-ID: 5" size="1" value="0a"/>
+                                      <field name="per.extension_present_bit" pos="95" show="0" showname=".... ...0 Extension Present Bit: False" size="1" unmaskedvalue="0a" value="0"/>
+                                      <field hide="yes" name="per.bit_string_length" pos="96" show="32" showname="Bit String Length: 32" size="1" value="1f"/>
+                                      <field name="s1ap.transportLayerAddress" pos="97" show="c0:a8:0c:d5" showname="transportLayerAddress: c0a80cd5 [bit length 32, 1100 0000  1010 1000  0000 1100  1101 0101 decimal value 3232238805]" size="4" value="c0a80cd5">
+                                        <field name="s1ap.transportLayerAddressIPv4" pos="97" show="192.168.12.213" showname="transportLayerAddress(IPv4): 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+                                      </field>
+                                      <field name="s1ap.gTP_TEID" pos="101" show="ca:6f:e0:dd" showname="gTP-TEID: ca6fe0dd" size="4" value="ca6fe0dd"/>
+                                    </field>
+                                  </field>
+                                </field>
+                              </field>
+                            </field>
+                          </field>
+                        </field>
+                      </field>
+                    </field>
+                  </field>
+                </field>
+              </field>
+            </field>
+          </proto>
+        </proto>
+        <proto name="sctp" pos="106" showname="Stream Control Transmission Protocol" size="16">
+          <field name="" pos="106" show="DATA chunk(ordered, complete segment, TSN: 3304831198, SID: 1, SSN: 6, PPID: 18, payload length: 64 bytes)" size="16" value="00030050c4fbb8de0001000600000012">
+            <field name="sctp.chunk_type" pos="106" show="0" showname="Chunk type: DATA (0)" size="1" value="00">
+              <field name="sctp.chunk_bit_1" pos="106" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="00" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="106" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="00" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="107" show="0x03" showname="Chunk flags: 0x03" size="1" value="03">
+              <field name="sctp.data_e_bit" pos="107" show="1" showname=".... ...1 = E-Bit: Last segment" size="1" unmaskedvalue="03" value="1"/>
+              <field name="sctp.data_b_bit" pos="107" show="1" showname=".... ..1. = B-Bit: First segment" size="1" unmaskedvalue="03" value="1"/>
+              <field name="sctp.data_u_bit" pos="107" show="0" showname=".... .0.. = U-Bit: Ordered delivery" size="1" unmaskedvalue="03" value="0"/>
+              <field name="sctp.data_i_bit" pos="107" show="0" showname=".... 0... = I-Bit: Possibly delay SACK" size="1" unmaskedvalue="03" value="0"/>
+            </field>
+            <field name="sctp.chunk_length" pos="108" show="80" showname="Chunk length: 80" size="2" value="0050"/>
+            <field name="sctp.data_tsn" pos="110" show="3304831198" showname="TSN: 3304831198" size="4" value="c4fbb8de"/>
+            <field name="sctp.data_sid" pos="114" show="0x0001" showname="Stream Identifier: 0x0001" size="2" value="0001"/>
+            <field name="sctp.data_ssn" pos="116" show="6" showname="Stream sequence number: 6" size="2" value="0006"/>
+            <field name="sctp.data_payload_proto_id" pos="118" show="18" showname="Payload protocol identifier: S1 Application Protocol (S1AP) (18)" size="4" value="00000012"/>
+          </field>
+          <proto name="s1ap" pos="122" showname="S1 Application Protocol" size="64">
+            <field hide="yes" name="per.extension_bit" pos="122" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+            <field hide="yes" name="per.choice_index" pos="122" show="0" showname="Choice Index: 0" size="1" value="00"/>
+            <field name="s1ap.S1AP_PDU" pos="122" show="0" showname="S1AP-PDU: initiatingMessage (0)" size="64" value="000d403c00000500000005c0740010d0000800048006692d001a000e0d275cf0408901074300035200c2006440080002f85900e00000004340060002f8590001">
+              <field name="s1ap.initiatingMessage" pos="122" show="" showname="initiatingMessage" size="64" value="">
+                <field name="s1ap.procedureCode" pos="123" show="13" showname="procedureCode: id-uplinkNASTransport (13)" size="1" value="0d"/>
+                <field hide="yes" name="per.enum_index" pos="124" show="1" showname="Enumerated Index: 1" size="1" value="40"/>
+                <field name="s1ap.criticality" pos="124" show="1" showname="criticality: ignore (1)" size="1" value="40"/>
+                <field hide="yes" name="per.open_type_length" pos="125" show="60" showname="Open Type Length: 60" size="1" value="3c"/>
+                <field name="s1ap.value" pos="126" show="" showname="value" size="60" value="">
+                  <field name="s1ap.UplinkNASTransport" pos="126" show="" showname="UplinkNASTransport" size="60" value="">
+                    <field hide="yes" name="per.extension_bit" pos="126" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                    <field hide="yes" name="per.sequence_of_length" pos="127" show="5" showname="Sequence-Of Length: 5" size="2" value="0005"/>
+                    <field name="s1ap.protocolIEs" pos="129" show="5" showname="protocolIEs: 5 items" size="57" value="00000005c0740010d0000800048006692d001a000e0d275cf0408901074300035200c2006440080002f85900e00000004340060002f8590001">
+                      <field name="" pos="129" show="Item 0: id-MME-UE-S1AP-ID" size="9" value="00000005c0740010d0">
+                        <field name="s1ap.ProtocolIE_Field" pos="129" show="" showname="ProtocolIE-Field" size="9" value="">
+                          <field name="s1ap.id" pos="129" show="0" showname="id: id-MME-UE-S1AP-ID (0)" size="2" value="0000"/>
+                          <field hide="yes" name="per.enum_index" pos="131" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="131" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="132" show="5" showname="Open Type Length: 5" size="1" value="05"/>
+                          <field name="s1ap.value" pos="133" show="" showname="value" size="5" value="">
+                            <field name="s1ap.MME_UE_S1AP_ID" pos="133" show="1946161360" showname="MME-UE-S1AP-ID: 1946161360" size="5" value="c0740010d0"/>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="138" show="Item 1: id-eNB-UE-S1AP-ID" size="8" value="000800048006692d">
+                        <field name="s1ap.ProtocolIE_Field" pos="138" show="" showname="ProtocolIE-Field" size="8" value="">
+                          <field name="s1ap.id" pos="138" show="8" showname="id: id-eNB-UE-S1AP-ID (8)" size="2" value="0008"/>
+                          <field hide="yes" name="per.enum_index" pos="140" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="140" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="141" show="4" showname="Open Type Length: 4" size="1" value="04"/>
+                          <field name="s1ap.value" pos="142" show="" showname="value" size="4" value="">
+                            <field name="s1ap.ENB_UE_S1AP_ID" pos="142" show="420141" showname="ENB-UE-S1AP-ID: 420141" size="4" value="8006692d"/>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="146" show="Item 2: id-NAS-PDU" size="18" value="001a000e0d275cf0408901074300035200c2">
+                        <field name="s1ap.ProtocolIE_Field" pos="146" show="" showname="ProtocolIE-Field" size="18" value="">
+                          <field name="s1ap.id" pos="146" show="26" showname="id: id-NAS-PDU (26)" size="2" value="001a"/>
+                          <field hide="yes" name="per.enum_index" pos="148" show="0" showname="Enumerated Index: 0" size="1" value="00"/>
+                          <field name="s1ap.criticality" pos="148" show="0" showname="criticality: reject (0)" size="1" value="00"/>
+                          <field hide="yes" name="per.open_type_length" pos="149" show="14" showname="Open Type Length: 14" size="1" value="0e"/>
+                          <field name="s1ap.value" pos="150" show="" showname="value" size="14" value="">
+                            <field hide="yes" name="per.octet_string_length" pos="150" show="13" showname="Octet String Length: 13" size="1" value="0d"/>
+                            <field name="s1ap.NAS_PDU" pos="151" show="27:5c:f0:40:89:01:07:43:00:03:52:00:c2" showname="NAS-PDU: 275cf0408901074300035200c2" size="13" value="275cf0408901074300035200c2"/>
+                            <proto name="nas-eps" pos="151" showname="Non-Access-Stratum (NAS)PDU" size="13">
+                              <field name="nas_eps.security_header_type" pos="151" show="2" showname="0010 .... = Security header type: Integrity protected and ciphered (2)" size="1" unmaskedvalue="27" value="2"/>
+                              <field name="gsm_a.L3_protocol_discriminator" pos="151" show="0x07" showname=".... 0111 = Protocol discriminator: EPS mobility management messages (0x07)" size="1" unmaskedvalue="27" value="7"/>
+                              <field name="nas_eps.msg_auth_code" pos="152" show="0x5cf04089" showname="Message authentication code: 0x5cf04089" size="4" value="5cf04089"/>
+                              <field name="nas_eps.seq_no" pos="156" show="1" showname="Sequence number: 1" size="1" value="01"/>
+                              <field name="nas_eps.security_header_type" pos="157" show="0" showname="0000 .... = Security header type: Plain NAS message, not security protected (0)" size="1" unmaskedvalue="07" value="0"/>
+                              <field name="gsm_a.L3_protocol_discriminator" pos="157" show="0x07" showname=".... 0111 = Protocol discriminator: EPS mobility management messages (0x07)" size="1" unmaskedvalue="07" value="7"/>
+                              <field name="nas_eps.nas_msg_emm_type" pos="158" show="0x43" showname="NAS EPS Mobility Management Message Type: Attach complete (0x43)" size="1" value="43"/>
+                              <field name="" pos="159" show="ESM message container" size="5" value="00035200c2">
+                                <field name="gsm_a.len" pos="159" show="3" showname="Length: 3" size="2" value="0003"/>
+                                <field name="nas_eps.emm.esm_msg_cont" pos="161" show="52:00:c2" showname="ESM message container contents: 5200c2" size="3" value="5200c2">
+                                  <field name="nas_eps.bearer_id" pos="161" show="5" showname="0101 .... = EPS bearer identity: EPS bearer identity value 5 (5)" size="1" unmaskedvalue="52" value="5"/>
+                                  <field name="gsm_a.L3_protocol_discriminator" pos="161" show="0x02" showname=".... 0010 = Protocol discriminator: EPS session management messages (0x02)" size="1" unmaskedvalue="52" value="2"/>
+                                  <field name="nas_eps.esm.proc_trans_id" pos="162" show="0" showname="Procedure transaction identity: 0" size="1" value="00"/>
+                                  <field name="nas_eps.nas_msg_esm_type" pos="163" show="0xc2" showname="NAS EPS session management messages: Activate default EPS bearer context accept (0xc2)" size="1" value="c2"/>
+                                </field>
+                              </field>
+                            </proto>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="164" show="Item 3: id-EUTRAN-CGI" size="12" value="006440080002f85900e00000">
+                        <field name="s1ap.ProtocolIE_Field" pos="164" show="" showname="ProtocolIE-Field" size="12" value="">
+                          <field name="s1ap.id" pos="164" show="100" showname="id: id-EUTRAN-CGI (100)" size="2" value="0064"/>
+                          <field hide="yes" name="per.enum_index" pos="166" show="1" showname="Enumerated Index: 1" size="1" value="40"/>
+                          <field name="s1ap.criticality" pos="166" show="1" showname="criticality: ignore (1)" size="1" value="40"/>
+                          <field hide="yes" name="per.open_type_length" pos="167" show="8" showname="Open Type Length: 8" size="1" value="08"/>
+                          <field name="s1ap.value" pos="168" show="" showname="value" size="8" value="">
+                            <field name="s1ap.EUTRAN_CGI" pos="168" show="" showname="EUTRAN-CGI" size="7" value="">
+                              <field hide="yes" name="per.extension_bit" pos="168" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                              <field hide="yes" name="per.optional_field_bit" pos="168" show="0" showname=".0.. .... Optional Field Bit: False (iE-Extensions is NOT present)" size="1" unmaskedvalue="00" value="0"/>
+                              <field name="s1ap.pLMNidentity" pos="169" show="02:f8:59" showname="pLMNidentity: 02f859" size="3" value="02f859"/>
+                              <field name="e212.mcc" pos="169" show="208" showname="Mobile Country Code (MCC): France (208)" size="2" value="02f8"/>
+                              <field name="e212.mnc" pos="170" show="95" showname="Mobile Network Code (MNC): Unknown (95)" size="2" value="f859"/>
+                              <field name="s1ap.cell_ID" pos="168" show="00:e0:00:00" showname="cell-ID: 00e00000 [bit length 28, 4 LSB pad bits, 0000 0000  1110 0000  0000 0000  0000 .... decimal value 917504]" size="4" value="00e00000"/>
+                            </field>
+                          </field>
+                        </field>
+                      </field>
+                      <field name="" pos="176" show="Item 4: id-TAI" size="10" value="004340060002f8590001">
+                        <field name="s1ap.ProtocolIE_Field" pos="176" show="" showname="ProtocolIE-Field" size="10" value="">
+                          <field name="s1ap.id" pos="176" show="67" showname="id: id-TAI (67)" size="2" value="0043"/>
+                          <field hide="yes" name="per.enum_index" pos="178" show="1" showname="Enumerated Index: 1" size="1" value="40"/>
+                          <field name="s1ap.criticality" pos="178" show="1" showname="criticality: ignore (1)" size="1" value="40"/>
+                          <field hide="yes" name="per.open_type_length" pos="179" show="6" showname="Open Type Length: 6" size="1" value="06"/>
+                          <field name="s1ap.value" pos="180" show="" showname="value" size="6" value="">
+                            <field name="s1ap.TAI" pos="180" show="" showname="TAI" size="6" value="">
+                              <field hide="yes" name="per.extension_bit" pos="180" show="0" showname="0... .... Extension Bit: False" size="1" unmaskedvalue="00" value="0"/>
+                              <field hide="yes" name="per.optional_field_bit" pos="180" show="0" showname=".0.. .... Optional Field Bit: False (iE-Extensions is NOT present)" size="1" unmaskedvalue="00" value="0"/>
+                              <field name="s1ap.pLMNidentity" pos="181" show="02:f8:59" showname="pLMNidentity: 02f859" size="3" value="02f859"/>
+                              <field name="e212.mcc" pos="181" show="208" showname="Mobile Country Code (MCC): France (208)" size="2" value="02f8"/>
+                              <field name="e212.mnc" pos="182" show="95" showname="Mobile Network Code (MNC): Unknown (95)" size="2" value="f859"/>
+                              <field name="s1ap.tAC" pos="184" show="00:01" showname="tAC: 0001" size="2" value="0001"/>
+                            </field>
+                          </field>
+                        </field>
+                      </field>
+                    </field>
+                  </field>
+                </field>
+              </field>
+            </field>
+          </proto>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 89: 62 bytes on wire (496 bits), 62 bytes captured (496 bits) on interface 0" size="62">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:34:54.426135000" showname="Arrival Time: Sep 25, 2015 16:34:54.426135000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191694.426135000" showname="Epoch Time: 1443191694.426135000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.199733000" showname="Time delta from previous captured frame: 0.199733000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.199733000" showname="Time delta from previous displayed frame: 0.199733000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="47.960504000" showname="Time since reference or first frame: 47.960504000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="89" showname="Frame Number: 89" size="0"/>
+      <field name="frame.len" pos="0" show="62" showname="Frame Length: 62 bytes (496 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="62" showname="Capture Length: 62 bytes (496 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp" showname="Protocols in frame: eth:ip:sctp" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.17 (192.168.12.17), Dst: 192.168.12.213 (192.168.12.213)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="48" showname="Total Length: 48" size="2" value="0030"/>
+        <field name="ip.id" pos="18" show="0x0000" showname="Identification: 0x0000 (0)" size="2" value="0000"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0xa011" showname="Header checksum: 0xa011 [validation disabled]" size="2" value="a011">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="a011"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="a011"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.17" showname="Source: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.17" showname="Source Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="ip.dst" pos="30" show="192.168.12.213" showname="Destination: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.213" showname="Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="28">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x54f837ab" showname="Verification tag: 0x54f837ab" size="4" value="54f837ab"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0x2a13ff28" showname="Checksum: 0x2a13ff28 (not verified)" size="4" value="2a13ff28"/>
+          <field name="" pos="46" show="SACK chunk (Cumulative TSN: 3304831198, a_rwnd: 106496, gaps: 0, duplicate TSNs: 0)" size="16" value="03000010c4fbb8de0001a00000000000">
+            <field name="sctp.chunk_type" pos="46" show="3" showname="Chunk type: SACK (3)" size="1" value="03">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="03" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="03" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00">
+              <field name="sctp.sack_nounce_sum" pos="47" show="0" showname=".... ...0 = Nounce sum: 0" size="1" unmaskedvalue="00" value="0"/>
+            </field>
+            <field name="sctp.chunk_length" pos="48" show="16" showname="Chunk length: 16" size="2" value="0010"/>
+            <field name="sctp.sack_cumulative_tsn_ack" pos="50" show="3304831198" showname="Cumulative TSN ACK: 3304831198" size="4" value="c4fbb8de"/>
+            <field name="sctp.sack_a_rwnd" pos="54" show="106496" showname="Advertised receiver window credit (a_rwnd): 106496" size="4" value="0001a000"/>
+            <field name="sctp.sack_number_of_gap_blocks" pos="58" show="0" showname="Number of gap acknowledgement blocks: 0" size="2" value="0000"/>
+            <field name="sctp.sack_number_of_duplicated_tsns" pos="60" show="0" showname="Number of duplicated TSNs: 0" size="2" value="0000"/>
+          </field>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 176: 98 bytes on wire (784 bits), 98 bytes captured (784 bits) on interface 0" size="98">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:35:24.530270000" showname="Arrival Time: Sep 25, 2015 16:35:24.530270000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191724.530270000" showname="Epoch Time: 1443191724.530270000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.030375000" showname="Time delta from previous captured frame: 0.030375000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.030375000" showname="Time delta from previous displayed frame: 0.030375000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="78.064639000" showname="Time since reference or first frame: 78.064639000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="176" showname="Frame Number: 176" size="0"/>
+      <field name="frame.len" pos="0" show="98" showname="Frame Length: 98 bytes (784 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="98" showname="Capture Length: 98 bytes (784 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp" showname="Protocols in frame: eth:ip:sctp" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.17 (192.168.12.17), Dst: 192.168.12.213 (192.168.12.213)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="84" showname="Total Length: 84" size="2" value="0054"/>
+        <field name="ip.id" pos="18" show="0x0000" showname="Identification: 0x0000 (0)" size="2" value="0000"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0x9fed" showname="Header checksum: 0x9fed [validation disabled]" size="2" value="9fed">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="9fed"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="9fed"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.17" showname="Source: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.17" showname="Source Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="ip.dst" pos="30" show="192.168.12.213" showname="Destination: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.213" showname="Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="64">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x54f837ab" showname="Verification tag: 0x54f837ab" size="4" value="54f837ab"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0x73ac7bca" showname="Checksum: 0x73ac7bca (not verified)" size="4" value="73ac7bca"/>
+          <field name="" pos="46" show="HEARTBEAT chunk (Information: 48 bytes)" size="52" value="040000340001003002008e3cc0a80cd5000000000000000000000000000000000000000060313300010000008db53fb930a0b65f">
+            <field name="sctp.chunk_type" pos="46" show="4" showname="Chunk type: HEARTBEAT (4)" size="1" value="04">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="04" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="04" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00"/>
+            <field name="sctp.chunk_length" pos="48" show="52" showname="Chunk length: 52" size="2" value="0034"/>
+            <field name="" pos="50" show="Heartbeat info parameter (Information: 44 bytes)" size="48" value="0001003002008e3cc0a80cd5000000000000000000000000000000000000000060313300010000008db53fb930a0b65f">
+              <field name="sctp.parameter_type" pos="50" show="0x0001" showname="Parameter type: Heartbeat info (0x0001)" size="2" value="0001">
+                <field name="sctp.parameter_bit_1" pos="50" show="0" showname="0... .... .... .... = Bit: Stop processing of chunk" size="2" unmaskedvalue="0001" value="0"/>
+                <field name="sctp.parameter_bit_2" pos="50" show="0" showname=".0.. .... .... .... = Bit: Do not report" size="2" unmaskedvalue="0001" value="0"/>
+              </field>
+              <field name="sctp.parameter_length" pos="52" show="48" showname="Parameter length: 48" size="2" value="0030"/>
+              <field name="sctp.parameter_heartbeat_information" pos="54" show="02:00:8e:3c:c0:a8:0c:d5:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:60:31:33:00:01:00:00:00:8d:b5:3f:b9:30:a0:b6:5f" showname="Heartbeat information: 02008e3cc0a80cd500000000000000000000000000000000..." size="44" value="02008e3cc0a80cd5000000000000000000000000000000000000000060313300010000008db53fb930a0b65f"/>
+            </field>
+          </field>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 177: 98 bytes on wire (784 bits), 98 bytes captured (784 bits) on interface 0" size="98">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:35:24.530415000" showname="Arrival Time: Sep 25, 2015 16:35:24.530415000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191724.530415000" showname="Epoch Time: 1443191724.530415000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.000145000" showname="Time delta from previous captured frame: 0.000145000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.000145000" showname="Time delta from previous displayed frame: 0.000145000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="78.064784000" showname="Time since reference or first frame: 78.064784000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="177" showname="Frame Number: 177" size="0"/>
+      <field name="frame.len" pos="0" show="98" showname="Frame Length: 98 bytes (784 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="98" showname="Capture Length: 98 bytes (784 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp" showname="Protocols in frame: eth:ip:sctp" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.213 (192.168.12.213), Dst: 192.168.12.17 (192.168.12.17)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="84" showname="Total Length: 84" size="2" value="0054"/>
+        <field name="ip.id" pos="18" show="0x000c" showname="Identification: 0x000c (12)" size="2" value="000c"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0x9fe1" showname="Header checksum: 0x9fe1 [validation disabled]" size="2" value="9fe1">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="9fe1"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="9fe1"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.213" showname="Source: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.213" showname="Source Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="ip.dst" pos="30" show="192.168.12.17" showname="Destination: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.17" showname="Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="64">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x4cd1eca0" showname="Verification tag: 0x4cd1eca0" size="4" value="4cd1eca0"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0x417510b2" showname="Checksum: 0x417510b2 (not verified)" size="4" value="417510b2"/>
+          <field name="" pos="46" show="HEARTBEAT_ACK chunk (Information: 48 bytes)" size="52" value="050000340001003002008e3cc0a80cd5000000000000000000000000000000000000000060313300010000008db53fb930a0b65f">
+            <field name="sctp.chunk_type" pos="46" show="5" showname="Chunk type: HEARTBEAT_ACK (5)" size="1" value="05">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="05" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="05" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00"/>
+            <field name="sctp.chunk_length" pos="48" show="52" showname="Chunk length: 52" size="2" value="0034"/>
+            <field name="" pos="50" show="Heartbeat info parameter (Information: 44 bytes)" size="48" value="0001003002008e3cc0a80cd5000000000000000000000000000000000000000060313300010000008db53fb930a0b65f">
+              <field name="sctp.parameter_type" pos="50" show="0x0001" showname="Parameter type: Heartbeat info (0x0001)" size="2" value="0001">
+                <field name="sctp.parameter_bit_1" pos="50" show="0" showname="0... .... .... .... = Bit: Stop processing of chunk" size="2" unmaskedvalue="0001" value="0"/>
+                <field name="sctp.parameter_bit_2" pos="50" show="0" showname=".0.. .... .... .... = Bit: Do not report" size="2" unmaskedvalue="0001" value="0"/>
+              </field>
+              <field name="sctp.parameter_length" pos="52" show="48" showname="Parameter length: 48" size="2" value="0030"/>
+              <field name="sctp.parameter_heartbeat_information" pos="54" show="02:00:8e:3c:c0:a8:0c:d5:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:60:31:33:00:01:00:00:00:8d:b5:3f:b9:30:a0:b6:5f" showname="Heartbeat information: 02008e3cc0a80cd500000000000000000000000000000000..." size="44" value="02008e3cc0a80cd5000000000000000000000000000000000000000060313300010000008db53fb930a0b65f"/>
+            </field>
+          </field>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 185: 98 bytes on wire (784 bits), 98 bytes captured (784 bits) on interface 0" size="98">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:35:25.005065000" showname="Arrival Time: Sep 25, 2015 16:35:25.005065000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191725.005065000" showname="Epoch Time: 1443191725.005065000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.087558000" showname="Time delta from previous captured frame: 0.087558000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.087558000" showname="Time delta from previous displayed frame: 0.087558000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="78.539434000" showname="Time since reference or first frame: 78.539434000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="185" showname="Frame Number: 185" size="0"/>
+      <field name="frame.len" pos="0" show="98" showname="Frame Length: 98 bytes (784 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="98" showname="Capture Length: 98 bytes (784 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp" showname="Protocols in frame: eth:ip:sctp" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.213 (192.168.12.213), Dst: 192.168.12.17 (192.168.12.17)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="84" showname="Total Length: 84" size="2" value="0054"/>
+        <field name="ip.id" pos="18" show="0x000d" showname="Identification: 0x000d (13)" size="2" value="000d"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0x9fe0" showname="Header checksum: 0x9fe0 [validation disabled]" size="2" value="9fe0">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="9fe0"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="9fe0"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.213" showname="Source: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.213" showname="Source Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="ip.dst" pos="30" show="192.168.12.17" showname="Destination: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.17" showname="Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="64">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x4cd1eca0" showname="Verification tag: 0x4cd1eca0" size="4" value="4cd1eca0"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0xac07ffbc" showname="Checksum: 0xac07ffbc (not verified)" size="4" value="ac07ffbc"/>
+          <field name="" pos="46" show="HEARTBEAT chunk (Information: 48 bytes)" size="52" value="040000340001003002008e3cc0a80c110000000000000000007459d10088ffff1e201d8180292314010000007730e920aa62f65b">
+            <field name="sctp.chunk_type" pos="46" show="4" showname="Chunk type: HEARTBEAT (4)" size="1" value="04">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="04" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="04" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00"/>
+            <field name="sctp.chunk_length" pos="48" show="52" showname="Chunk length: 52" size="2" value="0034"/>
+            <field name="" pos="50" show="Heartbeat info parameter (Information: 44 bytes)" size="48" value="0001003002008e3cc0a80c110000000000000000007459d10088ffff1e201d8180292314010000007730e920aa62f65b">
+              <field name="sctp.parameter_type" pos="50" show="0x0001" showname="Parameter type: Heartbeat info (0x0001)" size="2" value="0001">
+                <field name="sctp.parameter_bit_1" pos="50" show="0" showname="0... .... .... .... = Bit: Stop processing of chunk" size="2" unmaskedvalue="0001" value="0"/>
+                <field name="sctp.parameter_bit_2" pos="50" show="0" showname=".0.. .... .... .... = Bit: Do not report" size="2" unmaskedvalue="0001" value="0"/>
+              </field>
+              <field name="sctp.parameter_length" pos="52" show="48" showname="Parameter length: 48" size="2" value="0030"/>
+              <field name="sctp.parameter_heartbeat_information" pos="54" show="02:00:8e:3c:c0:a8:0c:11:00:00:00:00:00:00:00:00:00:74:59:d1:00:88:ff:ff:1e:20:1d:81:80:29:23:14:01:00:00:00:77:30:e9:20:aa:62:f6:5b" showname="Heartbeat information: 02008e3cc0a80c110000000000000000007459d10088ffff..." size="44" value="02008e3cc0a80c110000000000000000007459d10088ffff1e201d8180292314010000007730e920aa62f65b"/>
+            </field>
+          </field>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 186: 98 bytes on wire (784 bits), 98 bytes captured (784 bits) on interface 0" size="98">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:35:25.005098000" showname="Arrival Time: Sep 25, 2015 16:35:25.005098000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191725.005098000" showname="Epoch Time: 1443191725.005098000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.000033000" showname="Time delta from previous captured frame: 0.000033000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.000033000" showname="Time delta from previous displayed frame: 0.000033000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="78.539467000" showname="Time since reference or first frame: 78.539467000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="186" showname="Frame Number: 186" size="0"/>
+      <field name="frame.len" pos="0" show="98" showname="Frame Length: 98 bytes (784 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="98" showname="Capture Length: 98 bytes (784 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp" showname="Protocols in frame: eth:ip:sctp" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.17 (192.168.12.17), Dst: 192.168.12.213 (192.168.12.213)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="84" showname="Total Length: 84" size="2" value="0054"/>
+        <field name="ip.id" pos="18" show="0x0000" showname="Identification: 0x0000 (0)" size="2" value="0000"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0x9fed" showname="Header checksum: 0x9fed [validation disabled]" size="2" value="9fed">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="9fed"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="9fed"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.17" showname="Source: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.17" showname="Source Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="ip.dst" pos="30" show="192.168.12.213" showname="Destination: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.213" showname="Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="64">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x54f837ab" showname="Verification tag: 0x54f837ab" size="4" value="54f837ab"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0x9ede94c4" showname="Checksum: 0x9ede94c4 (not verified)" size="4" value="9ede94c4"/>
+          <field name="" pos="46" show="HEARTBEAT_ACK chunk (Information: 48 bytes)" size="52" value="050000340001003002008e3cc0a80c110000000000000000007459d10088ffff1e201d8180292314010000007730e920aa62f65b">
+            <field name="sctp.chunk_type" pos="46" show="5" showname="Chunk type: HEARTBEAT_ACK (5)" size="1" value="05">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="05" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="05" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00"/>
+            <field name="sctp.chunk_length" pos="48" show="52" showname="Chunk length: 52" size="2" value="0034"/>
+            <field name="" pos="50" show="Heartbeat info parameter (Information: 44 bytes)" size="48" value="0001003002008e3cc0a80c110000000000000000007459d10088ffff1e201d8180292314010000007730e920aa62f65b">
+              <field name="sctp.parameter_type" pos="50" show="0x0001" showname="Parameter type: Heartbeat info (0x0001)" size="2" value="0001">
+                <field name="sctp.parameter_bit_1" pos="50" show="0" showname="0... .... .... .... = Bit: Stop processing of chunk" size="2" unmaskedvalue="0001" value="0"/>
+                <field name="sctp.parameter_bit_2" pos="50" show="0" showname=".0.. .... .... .... = Bit: Do not report" size="2" unmaskedvalue="0001" value="0"/>
+              </field>
+              <field name="sctp.parameter_length" pos="52" show="48" showname="Parameter length: 48" size="2" value="0030"/>
+              <field name="sctp.parameter_heartbeat_information" pos="54" show="02:00:8e:3c:c0:a8:0c:11:00:00:00:00:00:00:00:00:00:74:59:d1:00:88:ff:ff:1e:20:1d:81:80:29:23:14:01:00:00:00:77:30:e9:20:aa:62:f6:5b" showname="Heartbeat information: 02008e3cc0a80c110000000000000000007459d10088ffff..." size="44" value="02008e3cc0a80c110000000000000000007459d10088ffff1e201d8180292314010000007730e920aa62f65b"/>
+            </field>
+          </field>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 421: 98 bytes on wire (784 bits), 98 bytes captured (784 bits) on interface 0" size="98">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:35:55.122133000" showname="Arrival Time: Sep 25, 2015 16:35:55.122133000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191755.122133000" showname="Epoch Time: 1443191755.122133000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.163967000" showname="Time delta from previous captured frame: 0.163967000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.163967000" showname="Time delta from previous displayed frame: 0.163967000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="108.656502000" showname="Time since reference or first frame: 108.656502000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="421" showname="Frame Number: 421" size="0"/>
+      <field name="frame.len" pos="0" show="98" showname="Frame Length: 98 bytes (784 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="98" showname="Capture Length: 98 bytes (784 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp" showname="Protocols in frame: eth:ip:sctp" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.17 (192.168.12.17), Dst: 192.168.12.213 (192.168.12.213)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="84" showname="Total Length: 84" size="2" value="0054"/>
+        <field name="ip.id" pos="18" show="0x0000" showname="Identification: 0x0000 (0)" size="2" value="0000"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0x9fed" showname="Header checksum: 0x9fed [validation disabled]" size="2" value="9fed">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="9fed"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="9fed"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.17" showname="Source: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.17" showname="Source Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="ip.dst" pos="30" show="192.168.12.213" showname="Destination: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.213" showname="Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="64">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x54f837ab" showname="Verification tag: 0x54f837ab" size="4" value="54f837ab"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0x9232c2ba" showname="Checksum: 0x9232c2ba (not verified)" size="4" value="9232c2ba"/>
+          <field name="" pos="46" show="HEARTBEAT chunk (Information: 48 bytes)" size="52" value="040000340001003002008e3cc0a80cd50000000000000000000000000000000000000000404f3300010000008db53fb930a0b65f">
+            <field name="sctp.chunk_type" pos="46" show="4" showname="Chunk type: HEARTBEAT (4)" size="1" value="04">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="04" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="04" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00"/>
+            <field name="sctp.chunk_length" pos="48" show="52" showname="Chunk length: 52" size="2" value="0034"/>
+            <field name="" pos="50" show="Heartbeat info parameter (Information: 44 bytes)" size="48" value="0001003002008e3cc0a80cd50000000000000000000000000000000000000000404f3300010000008db53fb930a0b65f">
+              <field name="sctp.parameter_type" pos="50" show="0x0001" showname="Parameter type: Heartbeat info (0x0001)" size="2" value="0001">
+                <field name="sctp.parameter_bit_1" pos="50" show="0" showname="0... .... .... .... = Bit: Stop processing of chunk" size="2" unmaskedvalue="0001" value="0"/>
+                <field name="sctp.parameter_bit_2" pos="50" show="0" showname=".0.. .... .... .... = Bit: Do not report" size="2" unmaskedvalue="0001" value="0"/>
+              </field>
+              <field name="sctp.parameter_length" pos="52" show="48" showname="Parameter length: 48" size="2" value="0030"/>
+              <field name="sctp.parameter_heartbeat_information" pos="54" show="02:00:8e:3c:c0:a8:0c:d5:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:40:4f:33:00:01:00:00:00:8d:b5:3f:b9:30:a0:b6:5f" showname="Heartbeat information: 02008e3cc0a80cd500000000000000000000000000000000..." size="44" value="02008e3cc0a80cd50000000000000000000000000000000000000000404f3300010000008db53fb930a0b65f"/>
+            </field>
+          </field>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 422: 98 bytes on wire (784 bits), 98 bytes captured (784 bits) on interface 0" size="98">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:35:55.122270000" showname="Arrival Time: Sep 25, 2015 16:35:55.122270000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191755.122270000" showname="Epoch Time: 1443191755.122270000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.000137000" showname="Time delta from previous captured frame: 0.000137000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.000137000" showname="Time delta from previous displayed frame: 0.000137000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="108.656639000" showname="Time since reference or first frame: 108.656639000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="422" showname="Frame Number: 422" size="0"/>
+      <field name="frame.len" pos="0" show="98" showname="Frame Length: 98 bytes (784 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="98" showname="Capture Length: 98 bytes (784 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp" showname="Protocols in frame: eth:ip:sctp" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.213 (192.168.12.213), Dst: 192.168.12.17 (192.168.12.17)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="84" showname="Total Length: 84" size="2" value="0054"/>
+        <field name="ip.id" pos="18" show="0x000e" showname="Identification: 0x000e (14)" size="2" value="000e"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0x9fdf" showname="Header checksum: 0x9fdf [validation disabled]" size="2" value="9fdf">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="9fdf"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="9fdf"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.213" showname="Source: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.213" showname="Source Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="ip.dst" pos="30" show="192.168.12.17" showname="Destination: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.17" showname="Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="64">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x4cd1eca0" showname="Verification tag: 0x4cd1eca0" size="4" value="4cd1eca0"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0xa0eba9c2" showname="Checksum: 0xa0eba9c2 (not verified)" size="4" value="a0eba9c2"/>
+          <field name="" pos="46" show="HEARTBEAT_ACK chunk (Information: 48 bytes)" size="52" value="050000340001003002008e3cc0a80cd50000000000000000000000000000000000000000404f3300010000008db53fb930a0b65f">
+            <field name="sctp.chunk_type" pos="46" show="5" showname="Chunk type: HEARTBEAT_ACK (5)" size="1" value="05">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="05" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="05" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00"/>
+            <field name="sctp.chunk_length" pos="48" show="52" showname="Chunk length: 52" size="2" value="0034"/>
+            <field name="" pos="50" show="Heartbeat info parameter (Information: 44 bytes)" size="48" value="0001003002008e3cc0a80cd50000000000000000000000000000000000000000404f3300010000008db53fb930a0b65f">
+              <field name="sctp.parameter_type" pos="50" show="0x0001" showname="Parameter type: Heartbeat info (0x0001)" size="2" value="0001">
+                <field name="sctp.parameter_bit_1" pos="50" show="0" showname="0... .... .... .... = Bit: Stop processing of chunk" size="2" unmaskedvalue="0001" value="0"/>
+                <field name="sctp.parameter_bit_2" pos="50" show="0" showname=".0.. .... .... .... = Bit: Do not report" size="2" unmaskedvalue="0001" value="0"/>
+              </field>
+              <field name="sctp.parameter_length" pos="52" show="48" showname="Parameter length: 48" size="2" value="0030"/>
+              <field name="sctp.parameter_heartbeat_information" pos="54" show="02:00:8e:3c:c0:a8:0c:d5:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:40:4f:33:00:01:00:00:00:8d:b5:3f:b9:30:a0:b6:5f" showname="Heartbeat information: 02008e3cc0a80cd500000000000000000000000000000000..." size="44" value="02008e3cc0a80cd50000000000000000000000000000000000000000404f3300010000008db53fb930a0b65f"/>
+            </field>
+          </field>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 426: 98 bytes on wire (784 bits), 98 bytes captured (784 bits) on interface 0" size="98">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:35:56.493553000" showname="Arrival Time: Sep 25, 2015 16:35:56.493553000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191756.493553000" showname="Epoch Time: 1443191756.493553000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.655441000" showname="Time delta from previous captured frame: 0.655441000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.655441000" showname="Time delta from previous displayed frame: 0.655441000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="110.027922000" showname="Time since reference or first frame: 110.027922000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="426" showname="Frame Number: 426" size="0"/>
+      <field name="frame.len" pos="0" show="98" showname="Frame Length: 98 bytes (784 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="98" showname="Capture Length: 98 bytes (784 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp" showname="Protocols in frame: eth:ip:sctp" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.213 (192.168.12.213), Dst: 192.168.12.17 (192.168.12.17)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="84" showname="Total Length: 84" size="2" value="0054"/>
+        <field name="ip.id" pos="18" show="0x000f" showname="Identification: 0x000f (15)" size="2" value="000f"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0x9fde" showname="Header checksum: 0x9fde [validation disabled]" size="2" value="9fde">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="9fde"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="9fde"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.213" showname="Source: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.213" showname="Source Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="ip.dst" pos="30" show="192.168.12.17" showname="Destination: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.17" showname="Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="64">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x4cd1eca0" showname="Verification tag: 0x4cd1eca0" size="4" value="4cd1eca0"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0xe0a1e658" showname="Checksum: 0xe0a1e658 (not verified)" size="4" value="e0a1e658"/>
+          <field name="" pos="46" show="HEARTBEAT chunk (Information: 48 bytes)" size="52" value="040000340001003002008e3cc0a80c110000000000000000007459d10088ffff1e201d8180a42314010000007730e920aa62f65b">
+            <field name="sctp.chunk_type" pos="46" show="4" showname="Chunk type: HEARTBEAT (4)" size="1" value="04">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="04" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="04" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00"/>
+            <field name="sctp.chunk_length" pos="48" show="52" showname="Chunk length: 52" size="2" value="0034"/>
+            <field name="" pos="50" show="Heartbeat info parameter (Information: 44 bytes)" size="48" value="0001003002008e3cc0a80c110000000000000000007459d10088ffff1e201d8180a42314010000007730e920aa62f65b">
+              <field name="sctp.parameter_type" pos="50" show="0x0001" showname="Parameter type: Heartbeat info (0x0001)" size="2" value="0001">
+                <field name="sctp.parameter_bit_1" pos="50" show="0" showname="0... .... .... .... = Bit: Stop processing of chunk" size="2" unmaskedvalue="0001" value="0"/>
+                <field name="sctp.parameter_bit_2" pos="50" show="0" showname=".0.. .... .... .... = Bit: Do not report" size="2" unmaskedvalue="0001" value="0"/>
+              </field>
+              <field name="sctp.parameter_length" pos="52" show="48" showname="Parameter length: 48" size="2" value="0030"/>
+              <field name="sctp.parameter_heartbeat_information" pos="54" show="02:00:8e:3c:c0:a8:0c:11:00:00:00:00:00:00:00:00:00:74:59:d1:00:88:ff:ff:1e:20:1d:81:80:a4:23:14:01:00:00:00:77:30:e9:20:aa:62:f6:5b" showname="Heartbeat information: 02008e3cc0a80c110000000000000000007459d10088ffff..." size="44" value="02008e3cc0a80c110000000000000000007459d10088ffff1e201d8180a42314010000007730e920aa62f65b"/>
+            </field>
+          </field>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 427: 98 bytes on wire (784 bits), 98 bytes captured (784 bits) on interface 0" size="98">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:35:56.493586000" showname="Arrival Time: Sep 25, 2015 16:35:56.493586000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191756.493586000" showname="Epoch Time: 1443191756.493586000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.000033000" showname="Time delta from previous captured frame: 0.000033000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.000033000" showname="Time delta from previous displayed frame: 0.000033000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="110.027955000" showname="Time since reference or first frame: 110.027955000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="427" showname="Frame Number: 427" size="0"/>
+      <field name="frame.len" pos="0" show="98" showname="Frame Length: 98 bytes (784 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="98" showname="Capture Length: 98 bytes (784 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp" showname="Protocols in frame: eth:ip:sctp" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.17 (192.168.12.17), Dst: 192.168.12.213 (192.168.12.213)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="84" showname="Total Length: 84" size="2" value="0054"/>
+        <field name="ip.id" pos="18" show="0x0000" showname="Identification: 0x0000 (0)" size="2" value="0000"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0x9fed" showname="Header checksum: 0x9fed [validation disabled]" size="2" value="9fed">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="9fed"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="9fed"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.17" showname="Source: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.17" showname="Source Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="ip.dst" pos="30" show="192.168.12.213" showname="Destination: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.213" showname="Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="64">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x54f837ab" showname="Verification tag: 0x54f837ab" size="4" value="54f837ab"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0xd2788d20" showname="Checksum: 0xd2788d20 (not verified)" size="4" value="d2788d20"/>
+          <field name="" pos="46" show="HEARTBEAT_ACK chunk (Information: 48 bytes)" size="52" value="050000340001003002008e3cc0a80c110000000000000000007459d10088ffff1e201d8180a42314010000007730e920aa62f65b">
+            <field name="sctp.chunk_type" pos="46" show="5" showname="Chunk type: HEARTBEAT_ACK (5)" size="1" value="05">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="05" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="05" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00"/>
+            <field name="sctp.chunk_length" pos="48" show="52" showname="Chunk length: 52" size="2" value="0034"/>
+            <field name="" pos="50" show="Heartbeat info parameter (Information: 44 bytes)" size="48" value="0001003002008e3cc0a80c110000000000000000007459d10088ffff1e201d8180a42314010000007730e920aa62f65b">
+              <field name="sctp.parameter_type" pos="50" show="0x0001" showname="Parameter type: Heartbeat info (0x0001)" size="2" value="0001">
+                <field name="sctp.parameter_bit_1" pos="50" show="0" showname="0... .... .... .... = Bit: Stop processing of chunk" size="2" unmaskedvalue="0001" value="0"/>
+                <field name="sctp.parameter_bit_2" pos="50" show="0" showname=".0.. .... .... .... = Bit: Do not report" size="2" unmaskedvalue="0001" value="0"/>
+              </field>
+              <field name="sctp.parameter_length" pos="52" show="48" showname="Parameter length: 48" size="2" value="0030"/>
+              <field name="sctp.parameter_heartbeat_information" pos="54" show="02:00:8e:3c:c0:a8:0c:11:00:00:00:00:00:00:00:00:00:74:59:d1:00:88:ff:ff:1e:20:1d:81:80:a4:23:14:01:00:00:00:77:30:e9:20:aa:62:f6:5b" showname="Heartbeat information: 02008e3cc0a80c110000000000000000007459d10088ffff..." size="44" value="02008e3cc0a80c110000000000000000007459d10088ffff1e201d8180a42314010000007730e920aa62f65b"/>
+            </field>
+          </field>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 491: 54 bytes on wire (432 bits), 54 bytes captured (432 bits) on interface 0" size="54">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:36:14.355024000" showname="Arrival Time: Sep 25, 2015 16:36:14.355024000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191774.355024000" showname="Epoch Time: 1443191774.355024000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.484347000" showname="Time delta from previous captured frame: 0.484347000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.484347000" showname="Time delta from previous displayed frame: 0.484347000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="127.889393000" showname="Time since reference or first frame: 127.889393000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="491" showname="Frame Number: 491" size="0"/>
+      <field name="frame.len" pos="0" show="54" showname="Frame Length: 54 bytes (432 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="54" showname="Capture Length: 54 bytes (432 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp" showname="Protocols in frame: eth:ip:sctp" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.17 (192.168.12.17), Dst: 192.168.12.213 (192.168.12.213)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="40" showname="Total Length: 40" size="2" value="0028"/>
+        <field name="ip.id" pos="18" show="0x0000" showname="Identification: 0x0000 (0)" size="2" value="0000"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0xa019" showname="Header checksum: 0xa019 [validation disabled]" size="2" value="a019">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="a019"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="a019"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.17" showname="Source: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.17" showname="Source Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="ip.dst" pos="30" show="192.168.12.213" showname="Destination: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.213" showname="Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="20">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x54f837ab" showname="Verification tag: 0x54f837ab" size="4" value="54f837ab"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0xd469a110" showname="Checksum: 0xd469a110 (not verified)" size="4" value="d469a110"/>
+          <field name="" pos="46" show="SHUTDOWN chunk (Cumulative TSN ack: 3304831198)" size="8" value="07000008c4fbb8de">
+            <field name="sctp.chunk_type" pos="46" show="7" showname="Chunk type: SHUTDOWN (7)" size="1" value="07">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="07" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="07" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00"/>
+            <field name="sctp.chunk_length" pos="48" show="8" showname="Chunk length: 8" size="2" value="0008"/>
+            <field name="sctp.shutdown_cumulative_tsn_ack" pos="50" show="3304831198" showname="Cumulative TSN Ack: 3304831198" size="4" value="c4fbb8de"/>
+          </field>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 492: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0" size="60">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:36:14.355162000" showname="Arrival Time: Sep 25, 2015 16:36:14.355162000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191774.355162000" showname="Epoch Time: 1443191774.355162000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.000138000" showname="Time delta from previous captured frame: 0.000138000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.000138000" showname="Time delta from previous displayed frame: 0.000138000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="127.889531000" showname="Time since reference or first frame: 127.889531000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="492" showname="Frame Number: 492" size="0"/>
+      <field name="frame.len" pos="0" show="60" showname="Frame Length: 60 bytes (480 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="60" showname="Capture Length: 60 bytes (480 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp" showname="Protocols in frame: eth:ip:sctp" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.213 (192.168.12.213), Dst: 192.168.12.17 (192.168.12.17)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="36" showname="Total Length: 36" size="2" value="0024"/>
+        <field name="ip.id" pos="18" show="0x0010" showname="Identification: 0x0010 (16)" size="2" value="0010"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0xa00d" showname="Header checksum: 0xa00d [validation disabled]" size="2" value="a00d">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="a00d"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="a00d"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.213" showname="Source: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.213" showname="Source Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="ip.dst" pos="30" show="192.168.12.17" showname="Destination: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.17" showname="Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="16">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x4cd1eca0" showname="Verification tag: 0x4cd1eca0" size="4" value="4cd1eca0"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0xe21454e0" showname="Checksum: 0xe21454e0 (not verified)" size="4" value="e21454e0"/>
+          <field name="" pos="46" show="SHUTDOWN_ACK chunk" size="4" value="08000004">
+            <field name="sctp.chunk_type" pos="46" show="8" showname="Chunk type: SHUTDOWN_ACK (8)" size="1" value="08">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="08" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="08" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00"/>
+            <field name="sctp.chunk_length" pos="48" show="4" showname="Chunk length: 4" size="2" value="0004"/>
+          </field>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+  <packet>
+    <proto name="frame" pos="0" showname="Frame 493: 50 bytes on wire (400 bits), 50 bytes captured (400 bits) on interface 0" size="50">
+      <field name="frame.interface_id" pos="0" show="0" showname="Interface id: 0" size="0"/>
+      <field name="frame.encap_type" pos="0" show="1" showname="Encapsulation type: Ethernet (1)" size="0"/>
+      <field name="frame.time" pos="0" show="Sep 25, 2015 16:36:14.355191000" showname="Arrival Time: Sep 25, 2015 16:36:14.355191000 CEST" size="0"/>
+      <field name="frame.offset_shift" pos="0" show="0.000000000" showname="Time shift for this packet: 0.000000000 seconds" size="0"/>
+      <field name="frame.time_epoch" pos="0" show="1443191774.355191000" showname="Epoch Time: 1443191774.355191000 seconds" size="0"/>
+      <field name="frame.time_delta" pos="0" show="0.000029000" showname="Time delta from previous captured frame: 0.000029000 seconds" size="0"/>
+      <field name="frame.time_delta_displayed" pos="0" show="0.000029000" showname="Time delta from previous displayed frame: 0.000029000 seconds" size="0"/>
+      <field name="frame.time_relative" pos="0" show="127.889560000" showname="Time since reference or first frame: 127.889560000 seconds" size="0"/>
+      <field name="frame.number" pos="0" show="493" showname="Frame Number: 493" size="0"/>
+      <field name="frame.len" pos="0" show="50" showname="Frame Length: 50 bytes (400 bits)" size="0"/>
+      <field name="frame.cap_len" pos="0" show="50" showname="Capture Length: 50 bytes (400 bits)" size="0"/>
+      <field name="frame.marked" pos="0" show="0" showname="Frame is marked: False" size="0"/>
+      <field name="frame.ignored" pos="0" show="0" showname="Frame is ignored: False" size="0"/>
+      <field name="frame.protocols" pos="0" show="eth:ip:sctp" showname="Protocols in frame: eth:ip:sctp" size="0"/>
+      <proto name="ip" pos="14" showname="Internet Protocol Version 4, Src: 192.168.12.17 (192.168.12.17), Dst: 192.168.12.213 (192.168.12.213)" size="20">
+        <field name="ip.version" pos="14" show="4" showname="Version: 4" size="1" value="45"/>
+        <field name="ip.hdr_len" pos="14" show="20" showname="Header length: 20 bytes" size="1" value="45"/>
+        <field name="ip.dsfield" pos="15" show="2" showname="Differentiated Services Field: 0x02 (DSCP 0x00: Default; ECN: 0x02: ECT(0) (ECN-Capable Transport))" size="1" value="02">
+          <field name="ip.dsfield.dscp" pos="15" show="0x00" showname="0000 00.. = Differentiated Services Codepoint: Default (0x00)" size="1" unmaskedvalue="02" value="0"/>
+          <field name="ip.dsfield.ecn" pos="15" show="0x02" showname=".... ..10 = Explicit Congestion Notification: ECT(0) (ECN-Capable Transport) (0x02)" size="1" unmaskedvalue="02" value="2"/>
+        </field>
+        <field name="ip.len" pos="16" show="36" showname="Total Length: 36" size="2" value="0024"/>
+        <field name="ip.id" pos="18" show="0x0000" showname="Identification: 0x0000 (0)" size="2" value="0000"/>
+        <field name="ip.flags" pos="20" show="0x02" showname="Flags: 0x02 (Don't Fragment)" size="1" value="40">
+          <field name="ip.flags.rb" pos="20" show="0" showname="0... .... = Reserved bit: Not set" size="1" value="40"/>
+          <field name="ip.flags.df" pos="20" show="1" showname=".1.. .... = Don't fragment: Set" size="1" value="40"/>
+          <field name="ip.flags.mf" pos="20" show="0" showname="..0. .... = More fragments: Not set" size="1" value="40"/>
+        </field>
+        <field name="ip.frag_offset" pos="20" show="0" showname="Fragment offset: 0" size="2" value="4000"/>
+        <field name="ip.ttl" pos="22" show="64" showname="Time to live: 64" size="1" value="40"/>
+        <field name="ip.proto" pos="23" show="132" showname="Protocol: SCTP (132)" size="1" value="84"/>
+        <field name="ip.checksum" pos="24" show="0xa01d" showname="Header checksum: 0xa01d [validation disabled]" size="2" value="a01d">
+          <field name="ip.checksum_good" pos="24" show="0" showname="Good: False" size="2" value="a01d"/>
+          <field name="ip.checksum_bad" pos="24" show="0" showname="Bad: False" size="2" value="a01d"/>
+        </field>
+        <field name="ip.src" pos="26" show="192.168.12.17" showname="Source: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.addr" pos="26" show="192.168.12.17" showname="Source or Destination Address: 192.168.12.17 (192.168.12.17)" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.src_host" pos="26" show="192.168.12.17" showname="Source Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field hide="yes" name="ip.host" pos="26" show="192.168.12.17" showname="Source or Destination Host: 192.168.12.17" size="4" value="c0a80c11"/>
+        <field name="ip.dst" pos="30" show="192.168.12.213" showname="Destination: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.addr" pos="30" show="192.168.12.213" showname="Source or Destination Address: 192.168.12.213 (192.168.12.213)" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.dst_host" pos="30" show="192.168.12.213" showname="Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field hide="yes" name="ip.host" pos="30" show="192.168.12.213" showname="Source or Destination Host: 192.168.12.213" size="4" value="c0a80cd5"/>
+        <field name="" pos="26" show="Source GeoIP: Unknown" size="4" value="c0a80c11"/>
+        <field name="" pos="30" show="Destination GeoIP: Unknown" size="4" value="c0a80cd5"/>
+        <proto name="sctp" pos="34" showname="Stream Control Transmission Protocol, Src Port: s1-control (36412), Dst Port: s1-control (36412)" size="16">
+          <field name="sctp.srcport" pos="34" show="36412" showname="Source port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.dstport" pos="36" show="36412" showname="Destination port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.verification_tag" pos="38" show="0x54f837ab" showname="Verification tag: 0x54f837ab" size="4" value="54f837ab"/>
+          <field hide="yes" name="sctp.port" pos="34" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field hide="yes" name="sctp.port" pos="36" show="36412" showname="Port: 36412" size="2" value="8e3c"/>
+          <field name="sctp.checksum" pos="42" show="0x29068146" showname="Checksum: 0x29068146 (not verified)" size="4" value="29068146"/>
+          <field name="" pos="46" show="SHUTDOWN_COMPLETE chunk" size="4" value="0e000004">
+            <field name="sctp.chunk_type" pos="46" show="14" showname="Chunk type: SHUTDOWN_COMPLETE (14)" size="1" value="0e">
+              <field name="sctp.chunk_bit_1" pos="46" show="0" showname="0... .... = Bit: Stop processing of the packet" size="1" unmaskedvalue="0e" value="0"/>
+              <field name="sctp.chunk_bit_2" pos="46" show="0" showname=".0.. .... = Bit: Do not report" size="1" unmaskedvalue="0e" value="0"/>
+            </field>
+            <field name="sctp.chunk_flags" pos="47" show="0x00" showname="Chunk flags: 0x00" size="1" value="00">
+              <field name="sctp.shutdown_complete_t_bit" pos="47" show="0" showname=".... ...0 = T-Bit: Tag not reflected" size="1" unmaskedvalue="00" value="0"/>
+            </field>
+            <field name="sctp.chunk_length" pos="48" show="4" showname="Chunk length: 4" size="2" value="0004"/>
+          </field>
+        </proto>
+      </proto>
+    </proto>
+  </packet>
+</pdml>
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf b/openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb.band7.tm1.usrpb210.epc.local.conf
similarity index 100%
rename from targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.local.conf
rename to openair3/TEST/EPC_TEST/TEST_1MME_1ENB_1UE_ATTACH_GUTI/enb.band7.tm1.usrpb210.epc.local.conf
diff --git a/openair3/TEST/EPC_TEST/generate_scenario.c b/openair3/TEST/EPC_TEST/generate_scenario.c
index bd181ce8784062b1fb43175265f64ff0f46e9e59..69e707dcf9a2248717d7a9e0c8c35e12c6fb5119 100644
--- a/openair3/TEST/EPC_TEST/generate_scenario.c
+++ b/openair3/TEST/EPC_TEST/generate_scenario.c
@@ -36,18 +36,33 @@
  */
 
 #include <string.h>
+#include <limits.h>
 #include <libconfig.h>
 #include <inttypes.h>
 #include <getopt.h>
+#include <libgen.h>
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <libxml/xmlmemory.h>
+#include <libxml/debugXML.h>
+#include <libxml/HTMLtree.h>
+#include <libxml/xmlIO.h>
+#include <libxml/DOCBparser.h>
+#include <libxml/xinclude.h>
+#include <libxml/catalog.h>
+#include <libxslt/xslt.h>
+#include <libxslt/xsltInternals.h>
+#include <libxslt/transform.h>
+#include <libxslt/xsltutils.h>
 
 #include "assertions.h"
-#include "enb_config.h"
+#include "generate_scenario.h"
 #include "s1ap_eNB.h"
-#if defined(ENABLE_ITTI)
-# include "intertask_interface.h"
-#endif
-
-#define EPC_TEST_SCENARIO_MAX_ENB                       2
+#include "intertask_interface.h"
 
 #define ENB_CONFIG_STRING_ACTIVE_ENBS                   "Active_eNBs"
 
@@ -79,29 +94,201 @@
 #define ENB_CONFIG_STRING_ENB_PORT_FOR_S1U              "ENB_PORT_FOR_S1U"
 
 
+#define ENB_CONFIG_MAX_XSLT_PARAMS 32
+
 Enb_properties_array_t g_enb_properties;
+char                  *g_test_dir         = NULL;
+char                  *g_pdml_in_origin   = NULL;
+extern int             xmlLoadExtDtdDefaultValue;
+
+#define GENERATE_PDML_FILE           1
+#define GENERATE_SCENARIO    2
+
+#define GS_IS_FILE           1
+#define GS_IS_DIR            2
+
+//------------------------------------------------------------------------------
+// test if file exist in current directory
+int is_file_exists( const char const * file_nameP, const char const *file_roleP)
+{
+  struct stat s;
+  int err = stat(file_nameP, &s);
+  if(-1 == err) {
+    if(ENOENT == errno) {
+      fprintf(stderr, "Please provide a valid %s, %s does not exist\n", file_roleP, file_nameP);
+    } else {
+      perror("stat");
+      exit(1);
+    }
+  } else {
+    if(S_ISREG(s.st_mode)) {
+      return GS_IS_FILE;
+    } else if(S_ISDIR(s.st_mode)) {
+      return GS_IS_DIR;
+    } else {
+      fprintf(stderr, "Please provide a valid test %s, %s exists but is not found valid\n", file_roleP, file_nameP);
+    }
+  }
+  return 0;
+}
+
+
+//------------------------------------------------------------------------------
+int strip_extension(char *in_filename)
+{
+  static const uint8_t name_min_len = 1;
+  static const uint8_t max_ext_len = 5; // .pdml !
+  fprintf(stdout, "strip_extension %s\n", in_filename);
+
+  if (NULL != in_filename) {
+    /* Check chars starting at end of string to find last '.' */
+    for (ssize_t i = strlen(in_filename); i >= name_min_len; i--) {
+      if (in_filename[i] == '.') {
+        in_filename[i] = '\0';
+        return i;
+      }
+    }
+  }
+  return -1;
+}
+//------------------------------------------------------------------------------
+// return number of splitted items
+int split_path( char * pathP, char *** resP)
+{
+  char *  saveptr1;
+  char *  p    = strtok_r (pathP, "/", &saveptr1);
+  int     n_spaces = 0;
+
+  /// split string and append tokens to 'res'
+  while (p) {
+    *resP = realloc (*resP, sizeof (char*) * ++n_spaces);
+    AssertFatal (*resP, "realloc failed");
+    (*resP)[n_spaces-1] = p;
+    p = strtok_r (NULL, "/", &saveptr1);
+  }
+  return n_spaces;
+}
+
+//------------------------------------------------------------------------------
+int generate_test_scenario(const char const * test_nameP, const char const * pdml_in_basenameP)
+//------------------------------------------------------------------------------
+{
+  //int fd_pdml_in;
+  xsltStylesheetPtr cur = NULL;
+  xmlDocPtr         doc, res;
+  FILE             *test_scenario_file = NULL;
+  const char        test_scenario_filename[NAME_MAX];
+  const char       *params[2*ENB_CONFIG_MAX_XSLT_PARAMS];
+  int               nb_params = 0;
+  int               i,j;
+  char              astring[1024];
+  char             *astring2 = NULL;
+  struct in_addr    addr;
+
+  memset(test_scenario_filename, 0, sizeof(test_scenario_filename));
+  memset(astring, 0, sizeof(astring));
+  if (getcwd(astring, sizeof(astring)) != NULL) {
+    fprintf(stdout, "working in %s directory\n", astring);
+  } else {
+    perror("getcwd() error");
+    exit(1);
+  }
+
+  xmlSubstituteEntitiesDefault(1);
+  xmlLoadExtDtdDefaultValue = 1;
+  cur = xsltParseStylesheetFile("/usr/share/oai/xsl/generic_scenario.xsl");
+  if (NULL == cur) {
+    AssertFatal (0, "Could not parse stylesheet file /usr/share/oai/xsl/generic_scenario.xsl!\n");
+  } else {
+    fprintf(stdout, "XSLT style sheet: /usr/share/oai/xsl/generic_scenario.xsl\n");
+  }
+
+  doc = xmlParseFile(pdml_in_basenameP);
+  if (NULL == doc) {
+    AssertFatal (0, "Could not parse pdml file %s!\n", pdml_in_basenameP);
+  } else {
+    fprintf(stdout, "pdml file: %s\n", pdml_in_basenameP);
+  }
+  params[nb_params++] = "test_name";
+  sprintf(astring, "%s", pdml_in_basenameP);
+  if (strip_extension(astring) > 0) {
+    astring2 = strdup(astring);
+    sprintf(astring, "\"%s\"", astring2);
+    free(astring2);
+    astring2 = NULL;
+  } else {
+    fprintf(stderr, "Assigning test name failed: %s\n", astring);
+  }
+  params[nb_params++] = strdup(astring);
+
+  for (i = 0; i < g_enb_properties.number; i++) {
+    // eNB S1-C IPv4 address
+    sprintf(astring, "enb%d_s1c", i);
+    params[nb_params++] = strdup(astring);
+    addr.s_addr = g_enb_properties.properties[i]->enb_ipv4_address_for_S1_MME;
+    sprintf(astring, "\"%s\"", inet_ntoa(addr));
+    params[nb_params++] = strdup(astring);
+
+    // MME S1-C IPv4 address
+    for (j = 0; j < g_enb_properties.properties[i]->nb_mme; j++) {
+      sprintf(astring, "mme%d_s1c_%d", i, j);
+      params[nb_params++] = strdup(astring);
+      AssertFatal (g_enb_properties.properties[i]->mme_ip_address[j].ipv4_address,
+          "Only support MME IPv4 address\n");
+      sprintf(astring, "\"%s\"", g_enb_properties.properties[i]->mme_ip_address[j].ipv4_address);
+      params[nb_params++] = strdup(astring);
+    }
+  }
+  params[nb_params] = NULL;
+  res = xsltApplyStylesheet(cur, doc, params);
+  if (NULL != res) {
+    // since pdml filename is not relative (no path), just filename in current directory we can safely remove
+    sprintf(test_scenario_filename,"%s",pdml_in_basenameP);
+    if (strip_extension(test_scenario_filename) > 0) {
+      strcat(test_scenario_filename, ".xml");
+      test_scenario_file = fopen( test_scenario_filename, "w+");
+      if (NULL != test_scenario_file) {
+        xsltSaveResultToFile(test_scenario_file, res, cur);
+        fclose(test_scenario_file);
+        fprintf(stdout, "Wrote test scenario to %s\n", test_scenario_filename);
+      } else {
+        fprintf(stderr, "Error in fopen(%s)\n", test_scenario_filename);
+      }
+    } else {
+      fprintf(stderr, "Error in strip_extension()\n");
+    }
+  } else {
+    fprintf(stderr, "Error in xsltApplyStylesheet()\n");
+  }
+  xsltFreeStylesheet(cur);
+  xmlFreeDoc(res);
+  xmlFreeDoc(doc);
+
+  xsltCleanupGlobals();
+  xmlCleanupParser();
+}
 
 //------------------------------------------------------------------------------
 static void enb_config_display(void)
 //------------------------------------------------------------------------------
 {
-  int i,j;
+  int i;
 
   printf( "\n----------------------------------------------------------------------\n");
-  printf( " ENB CONFIG FILE CONTENT LOADED (TBC):\n");
+  printf( " ENB CONFIG FILE CONTENT LOADED:\n");
   printf( "----------------------------------------------------------------------\n");
   for (i = 0; i < g_enb_properties.number; i++) {
     printf( "ENB CONFIG for instance %u:\n\n", i);
-    printf( "\teNB name:           \t%s:\n",g_enb_properties.properties[i]->eNB_name);
-    printf( "\teNB ID:             \t%"PRIu32":\n",g_enb_properties.properties[i]->eNB_id);
-    printf( "\tCell type:          \t%s:\n",g_enb_properties.properties[i]->cell_type == CELL_MACRO_ENB ? "CELL_MACRO_ENB":"CELL_HOME_ENB");
-    printf( "\tTAC:                \t%"PRIu16":\n",g_enb_properties.properties[i]->tac);
-    printf( "\tMCC:                \t%"PRIu16":\n",g_enb_properties.properties[i]->mcc);
+    printf( "\teNB name:           \t%s\n",g_enb_properties.properties[i]->eNB_name);
+    printf( "\teNB ID:             \t%"PRIu32"\n",g_enb_properties.properties[i]->eNB_id);
+    printf( "\tCell type:          \t%s\n",g_enb_properties.properties[i]->cell_type == CELL_MACRO_ENB ? "CELL_MACRO_ENB":"CELL_HOME_ENB");
+    printf( "\tTAC:                \t%"PRIu16"\n",g_enb_properties.properties[i]->tac);
+    printf( "\tMCC:                \t%"PRIu16"\n",g_enb_properties.properties[i]->mcc);
 
     if (g_enb_properties.properties[i]->mnc_digit_length == 3) {
-      printf( "\tMNC:                \t%03"PRIu16":\n",g_enb_properties.properties[i]->mnc);
+      printf( "\tMNC:                \t%03"PRIu16"\n",g_enb_properties.properties[i]->mnc);
     } else {
-      printf( "\tMNC:                \t%02"PRIu16":\n",g_enb_properties.properties[i]->mnc);
+      printf( "\tMNC:                \t%02"PRIu16"\n",g_enb_properties.properties[i]->mnc);
     }
     printf( "\n--------------------------------------------------------\n");
   }
@@ -114,13 +301,12 @@ static void enb_config_display(void)
 #define libconfig_int int
 #endif
 //------------------------------------------------------------------------------
-const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
+void enb_config_init(const  char const * lib_config_file_name_pP)
 //------------------------------------------------------------------------------
 {
   config_t          cfg;
   config_setting_t *setting                       = NULL;
   config_setting_t *subsetting                    = NULL;
-  config_setting_t *setting_srb1                  = NULL;
   config_setting_t *setting_mme_addresses         = NULL;
   config_setting_t *setting_mme_address           = NULL;
   config_setting_t *setting_enb                   = NULL;
@@ -128,8 +314,6 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
   int               enb_properties_index          = 0;
   int               num_enbs                      = 0;
   int               num_mme_address               = 0;
-  int               num_otg_elements              =0;
-  int               num_component_carriers        =0;
   int               i                             = 0;
   int               j                             = 0;
   int               parse_errors                  = 0;
@@ -139,12 +323,6 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
   const char*       enb_name                      = NULL;
   const char*       mcc                           = 0;
   const char*       mnc                           = 0;
-  const char*       frame_type                    = NULL;
-  const char*            prefix_type              = NULL;
-  libconfig_int     Nid_cell                      = 0;
-
-  libconfig_int     my_int;
-
   char*             ipv4                          = NULL;
   char*             ipv6                          = NULL;
   char*             active                        = NULL;
@@ -157,21 +335,20 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
   char*             enb_ipv4_address_for_S1_MME   = NULL;
   char             *address                       = NULL;
   char             *cidr                          = NULL;
-  char             *astring                       = NULL;
+
+
+  AssertFatal (lib_config_file_name_pP != NULL,
+               "Bad parameter lib_config_file_name_pP %s , must reference a valid eNB config file\n",
+               lib_config_file_name_pP);
 
   memset((char*)active_enb,     0 , EPC_TEST_SCENARIO_MAX_ENB * sizeof(char*));
 
   config_init(&cfg);
 
-  if (lib_config_file_name_pP != NULL) {
-    /* Read the file. If there is an error, report it and exit. */
-    if (! config_read_file(&cfg, lib_config_file_name_pP)) {
-      config_destroy(&cfg);
-      AssertFatal (0, "Failed to parse eNB configuration file %s!\n", lib_config_file_name_pP);
-    }
-  } else {
+  /* Read the file. If there is an error, report it and exit. */
+  if (! config_read_file(&cfg, lib_config_file_name_pP)) {
     config_destroy(&cfg);
-    AssertFatal (0, "No eNB configuration file provided!\n");
+    AssertFatal (0, "Failed to parse eNB configuration file %s!\n", lib_config_file_name_pP);
   }
 
   // Get list of active eNBs, (only these will be configured)
@@ -195,7 +372,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
   setting = config_lookup(&cfg, ENB_CONFIG_STRING_ENB_LIST);
 
   if (setting != NULL) {
-    enb_properties_index = 0;
+    enb_properties_index = g_enb_properties.number;
     parse_errors      = 0;
     num_enbs = config_setting_length(setting);
 
@@ -332,31 +509,19 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
                 IPV4_STR_ADDR_TO_INT_NWBO ( address, g_enb_properties.properties[enb_properties_index]->enb_ipv4_address_for_S1_MME, "BAD IP ADDRESS FORMAT FOR eNB S1_MME !\n" );
               }
             }
-          }
-        }
-      }
-    }
-  }
+          } // if (subsetting != NULL) {
+          enb_properties_index += 1;
+        } // if (strcmp(active_enb[j], enb_name) == 0)
+      } // for (j=0; j < num_enb_properties; j++)
+    } // for (i = 0; i < num_enbs; i++)
+  } //   if (setting != NULL) {
 
-  g_enb_properties.number = num_enb_properties;
+  g_enb_properties.number += num_enb_properties;
 
-  AssertError (enb_properties_index == num_enb_properties, parse_errors ++,
-               "Failed to parse eNB configuration file %s, mismatch between %u active eNBs and %u corresponding defined eNBs !\n",
-               lib_config_file_name_pP, num_enb_properties, enb_properties_index);
 
   AssertFatal (parse_errors == 0,
                "Failed to parse eNB configuration file %s, found %d error%s !\n",
                lib_config_file_name_pP, parse_errors, parse_errors > 1 ? "s" : "");
-  enb_config_display();
-  return &g_enb_properties;
-
-}
-
-//------------------------------------------------------------------------------
-const Enb_properties_array_t *enb_config_get(void)
-//------------------------------------------------------------------------------
-{
-  return &g_enb_properties;
 }
 
 
@@ -366,19 +531,41 @@ static void usage (
     char *argv[])
 //------------------------------------------------------------------------------
 {
-  fprintf (stdout, "Please report any bug to: openair4g-devel@lists.eurecom.fr\n\n");
+  fprintf (stdout, "Please report any bug to: %s\n",PACKAGE_BUGREPORT);
   fprintf (stdout, "Usage: %s [options]\n\n", argv[0]);
-  fprintf (stdout, "Available options:\n");
-  fprintf (stdout, "\t--help, -h          Print this help and return\n");
-  fprintf (stdout, "\t--test-dir <path>\n");
-  fprintf (stdout, "                      Set the test directory where pdml and original enb(s) config files are located\n");
-  fprintf (stdout, "                      See README in openair3/TEST/EPC_TEST\n");
-  fprintf (stdout, "\t--new-enb-conf-file <file>\n");
-  fprintf (stdout, "                      Provide an updated eNB config file for generating a copy of the original test\n");
-  fprintf (stdout, "                      This option is set as many times as there are some eNB in the original test\n");
+  fprintf (stdout, "\n");
+  fprintf (stdout, "Mandatory options:\n");
+  fprintf (stdout, "\t-c | --enb-conf-file    <file>     Provide the old eNB config file for generating a copy of the original test\n");
+  fprintf (stdout, "\t-d | --test-dir         <dir>      Directory where a set of files related to a particular test are located\n");
+  fprintf (stdout, "\t-p | --pdml             <file>     File name (with no path) in 'test-dir' directory of an original scenario that has to be reworked (IP addresses) with new testbed\n");
+  fprintf (stdout, "\n");
+  fprintf (stdout, "Other options:\n");
+  fprintf (stdout, "\t-h | --help                        Print this help and return\n");
+  fprintf (stdout, "\t-v | --version                     Print informations about the version of this executable\n");
+  fprintf (stdout, "\n");
+  fprintf (stdout, "Example of generate_scenario use case:  \n");
+  fprintf (stdout, "\n");
+  fprintf (stdout, "  Generate a generix xml scenario from a captured pcap file:        \n");
+  fprintf (stdout, "           +---------------------+ \n");
+  fprintf (stdout, "           |captured pcap-ng file| \n");
+  fprintf (stdout, "           +----------+----------+ \n");
+  fprintf (stdout, "                      |\n");
+  fprintf (stdout, "             mme_test_s1_pcap2pdml --pcap_file <`captured pcap-ng file`>\n");
+  fprintf (stdout, "                      |\n");
+  fprintf (stdout, "             +--------V----------+    +--------------------+\n");
+  fprintf (stdout, "             |'pdml-in-orig' file|    |'enb-conf-file' file|\n");
+  fprintf (stdout, "             +--------+----------+    +--------------------+\n");
+  fprintf (stdout, "                      |                            |\n");
+  fprintf (stdout, "                      +----------------------------+\n");
+  fprintf (stdout, "                      |\n");
+  fprintf (stdout, "      generate_scenario -d <dir> -p <'pdml-in-orig' file>  -c <'enb-conf-file' file> \n");
+  fprintf (stdout, "                      |\n");
+  fprintf (stdout, "         +------------V--------------+\n");
+  fprintf (stdout, "         +'xml-test-scenario' file   |\n");
+  fprintf (stdout, "         +---------------------------+\n");
+  fprintf (stdout, "\n");
 }
 
-
 //------------------------------------------------------------------------------
 int
 config_parse_opt_line (
@@ -387,65 +574,119 @@ config_parse_opt_line (
 //------------------------------------------------------------------------------
 {
   int                           option;
-  char                         *enb_config_file_name = NULL;
-  char                         *test_dir             = NULL;
+  int                           rv                         = 0;
+  char                         *enb_config_file_name   = NULL;
+  char                         *pdml_in_file_name          = NULL;
+  char                         *test_dir_name              = NULL;
 
   enum long_option_e {
     LONG_OPTION_START = 0x100, /* Start after regular single char options */
+    LONG_OPTION_ENB_CONF_FILE,
+    LONG_OPTION_PDML,
     LONG_OPTION_TEST_DIR,
-    LONG_OPTION_NEW_ENB_CONF_FILE,
     LONG_OPTION_HELP,
+    LONG_OPTION_VERSION,
   };
 
   static struct option long_options[] = {
-    {"test-dir",               required_argument, 0, LONG_OPTION_TEST_DIR},
-    {"new-enb-conf-file",      required_argument, 0, LONG_OPTION_NEW_ENB_CONF_FILE},
-    {"help",                   required_argument, 0, LONG_OPTION_HELP},
+    {"enb-conf-file",      required_argument, 0, LONG_OPTION_ENB_CONF_FILE},
+    {"pdml ",              required_argument, 0, LONG_OPTION_PDML},
+    {"test-dir",           required_argument, 0, LONG_OPTION_TEST_DIR},
+    {"help",               no_argument,       0, LONG_OPTION_HELP},
+    {"version",            no_argument,       0, LONG_OPTION_VERSION},
     {NULL, 0, NULL, 0}
   };
 
   /*
    * Parsing command line
    */
-  while ((option = getopt_long (argc, argv, "h", long_options, NULL)) != -1) {
+  while ((option = getopt_long (argc, argv, "vhp:n:c:s:d:", long_options, NULL)) != -1) {
     switch (option) {
-      case LONG_OPTION_TEST_DIR:
+      case LONG_OPTION_ENB_CONF_FILE:
+      case 'c':
         if (optarg) {
-          test_dir = strdup(optarg);
-          printf("TEST DIRECTORY IS %s\n", test_dir);
+          enb_config_file_name = optarg;
+          printf("eNB config file name is %s\n", enb_config_file_name);
+          rv |= GENERATE_SCENARIO;
         }
         break;
 
-      case LONG_OPTION_NEW_ENB_CONF_FILE:
+      case LONG_OPTION_PDML:
+      case 'p':
         if (optarg) {
-          enb_config_file_name = strdup(optarg);
-          printf("eNB config file name is %s\n", enb_config_file_name);
-          enb_config_init(enb_config_file_name);
+          pdml_in_file_name = strdup(optarg);
+          printf("PDML input file name is %s\n", pdml_in_file_name);
+          rv |= GENERATE_SCENARIO;
         }
         break;
 
+      case LONG_OPTION_TEST_DIR:
+      case 'd':
         if (optarg) {
-          test_dir = strdup(optarg);
-          printf("TEST DIRECTORY IS %s\n", test_dir);
+          test_dir_name = strdup(optarg);
+          if (is_file_exists(test_dir_name, "test dirname") != GS_IS_DIR) {
+            fprintf(stderr, "Please provide a valid test dirname, %s is not a valid directory name\n", test_dir_name);
+            exit(1);
+          }
+          printf("Test dir name is %s\n", test_dir_name);
         }
         break;
 
+      case LONG_OPTION_VERSION:
+      case 'v':
+        printf("Version %s\n", PACKAGE_VERSION);
+        exit (0);
+        break;
+
       case LONG_OPTION_HELP:
-      case 'h':                  /* Fall through */
+      case 'h':
       default:
         usage (argc, argv);
         exit (0);
     }
   }
-  return 0;
+  if (NULL == test_dir_name) {
+    fprintf(stderr, "Please provide a valid test dirname\n");
+    exit(1);
+  }
+  g_test_dir = test_dir_name; test_dir_name = NULL;
+  if (chdir(g_test_dir) != 0) {
+    fprintf(stderr, "Error: chdir %s returned %s\n", g_test_dir, strerror(errno));
+    exit(1);
+  }
+  if (rv & GENERATE_SCENARIO) {
+    if (NULL == enb_config_file_name) {
+      fprintf(stderr, "Error: please provide the original eNB config file name that should be in %s\n", g_test_dir);
+    }
+    if (is_file_exists(enb_config_file_name, "ENB config file") != GS_IS_FILE) {
+      fprintf(stderr, "Error: eNB config file name %s is not found in dir %s\n", enb_config_file_name, g_test_dir);
+    }
+    enb_config_init(enb_config_file_name);
+    //enb_config_display();
+
+    if (NULL == pdml_in_file_name) {
+      fprintf(stderr, "Error: please provide the PDML file name that should be in %s\n", g_test_dir);
+    }
+    if (is_file_exists(pdml_in_file_name, "PDML file") != GS_IS_FILE) {
+      fprintf(stderr, "Error: PDML file name %s is not found in dir %s\n", pdml_in_file_name, g_test_dir);
+    }
+    g_pdml_in_origin = pdml_in_file_name; pdml_in_file_name = NULL;
+  }
+  return rv;
 }
 
 //------------------------------------------------------------------------------
 int main( int argc, char **argv )
 //------------------------------------------------------------------------------
 {
+  int     actions = 0;
+
   memset((char*) &g_enb_properties, 0 , sizeof(g_enb_properties));
-  config_parse_opt_line (argc, argv); //Command-line options
+
+  actions = config_parse_opt_line (argc, argv); //Command-line options
+  if  (actions & GENERATE_SCENARIO) {
+    generate_test_scenario(g_test_dir, g_pdml_in_origin);
+  }
 
   return 0;
 }
diff --git a/openair3/TEST/EPC_TEST/generate_scenario.h b/openair3/TEST/EPC_TEST/generate_scenario.h
new file mode 100644
index 0000000000000000000000000000000000000000..88c0d28e175b1f5c856196c1d74e95dccb55474b
--- /dev/null
+++ b/openair3/TEST/EPC_TEST/generate_scenario.h
@@ -0,0 +1,132 @@
+/*******************************************************************************
+    OpenAirInterface
+    Copyright(c) 1999 - 2014 Eurecom
+
+    OpenAirInterface is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+
+    OpenAirInterface is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenAirInterface.The full GNU General Public License is
+   included in this distribution in the file called "COPYING". If not,
+   see <http://www.gnu.org/licenses/>.
+
+  Contact Information
+  OpenAirInterface Admin: openair_admin@eurecom.fr
+  OpenAirInterface Tech : openair_tech@eurecom.fr
+  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+
+  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+*******************************************************************************/
+
+/*
+                                generate_scenario.h
+                             -------------------
+  AUTHOR  : Lionel GAUTHIER
+  COMPANY : EURECOM
+  EMAIL   : Lionel.Gauthier@eurecom.fr
+*/
+
+#ifndef GENERATE_SCENARIO_H_
+#define GENERATE_SCENARIO_H_
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include "commonDef.h"
+#include "platform_types.h"
+#include "platform_constants.h"
+#include "PHY/impl_defs_lte.h"
+#include "s1ap_messages_types.h"
+#ifdef CMAKER
+#include "SystemInformationBlockType2.h"
+#else
+#include "RRC/LITE/MESSAGES/SystemInformationBlockType2.h"
+#endif
+
+#define IPV4_STR_ADDR_TO_INT_NWBO(AdDr_StR,NwBo,MeSsAgE ) do {\
+            struct in_addr inp;\
+            if ( inet_aton(AdDr_StR, &inp ) < 0 ) {\
+                AssertFatal (0, MeSsAgE);\
+            } else {\
+                NwBo = inp.s_addr;\
+            }\
+        } while (0);
+
+/** @defgroup _enb_app ENB APP 
+ * @ingroup _oai2
+ * @{
+ */
+
+// Hard to find a defined value for max enb...
+#define EPC_TEST_SCENARIO_MAX_ENB                       4
+
+
+typedef struct mme_ip_address_s {
+  unsigned  ipv4:1;
+  unsigned  ipv6:1;
+  unsigned  active:1;
+  char     *ipv4_address;
+  char     *ipv6_address;
+} mme_ip_address_t;
+
+typedef struct Enb_properties_s {
+  /* Unique eNB_id to identify the eNB within EPC.
+   * For macro eNB ids this field should be 20 bits long.
+   * For home eNB ids this field should be 28 bits long.
+   */
+  uint32_t            eNB_id;
+
+  /* The type of the cell */
+  enum cell_type_e    cell_type;
+
+  /* Optional name for the cell
+   * NOTE: the name can be NULL (i.e no name) and will be cropped to 150
+   * characters.
+   */
+  char               *eNB_name;
+
+  /* Tracking area code */
+  uint16_t            tac;
+
+  /* Mobile Country Code
+   * Mobile Network Code
+   */
+  uint16_t            mcc;
+  uint16_t            mnc;
+  uint8_t             mnc_digit_length;
+
+  /* Nb of MME to connect to */
+  uint8_t             nb_mme;
+  /* List of MME to connect to */
+  mme_ip_address_t    mme_ip_address[S1AP_MAX_NB_MME_IP_ADDRESS];
+
+  int                 sctp_in_streams;
+  int                 sctp_out_streams;
+
+  char               *enb_interface_name_for_S1U;
+  in_addr_t           enb_ipv4_address_for_S1U;
+  tcp_udp_port_t      enb_port_for_S1U;
+
+  char               *enb_interface_name_for_S1_MME;
+  in_addr_t           enb_ipv4_address_for_S1_MME;
+
+} Enb_properties_t;
+
+typedef struct Enb_properties_array_s {
+  int                  number;
+  Enb_properties_t    *properties[EPC_TEST_SCENARIO_MAX_ENB];
+} Enb_properties_array_t;
+
+void enb_config_init(const char const * lib_config_file_name_pP);
+
+#endif /* ENB_CONFIG_H_ */
+/** @} */
diff --git a/openair3/TEST/EPC_TEST/mme_test_s1_pcap2pdml b/openair3/TEST/EPC_TEST/mme_test_s1_pcap2pdml
deleted file mode 100755
index b0a77e60f5ba331498510a251df1b2c47d324ef3..0000000000000000000000000000000000000000
--- a/openair3/TEST/EPC_TEST/mme_test_s1_pcap2pdml
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-import sys
-import subprocess
-import re
-import socket
-import datetime
-from datetime import date
-import os, errno
-import argparse
-import tempfile
-from lxml import etree
-from xml.dom.minidom import parse, parseString
-
-#####################
-# program arguments
-#####################
-parser = argparse.ArgumentParser()
-parser.add_argument("--pcap_file", "-p", type=str,help="input pcap file to be translated")
-args = parser.parse_args()
-
-#####################
-# get xml document from pcap
-#####################
-orig_pcap_file_name = args.pcap_file.strip()
-orig_pdml_string = subprocess.check_output(["tshark", '-T', 'pdml', '-r', orig_pcap_file_name])
-
-orig_dom = parseString(orig_pdml_string)
-
-#####################
-# filtering unwanted packets
-#####################
-#cases = orig_etree.findall(".//proto[@name='sctp']")
-packets = orig_dom.getElementsByTagName("packet")
-for packet in packets:
-    found_sctp = False
-    found_s1ap = False
-    protos = packet.getElementsByTagName("proto")
-    for proto in protos:
-        attrs   = proto.attributes
-        urlnode = attrs['name']
-        if urlnode.nodeValue == 'sctp':
-            found_sctp = True
-        elif urlnode.nodeValue == 's1ap':
-            found_s1ap = True
-        elif urlnode.nodeValue == 'geninfo':
-            packet.removeChild(proto)
-        elif urlnode.nodeValue == 'eth':
-            packet.removeChild(proto)
-    if found_sctp == False:
-        # hopefully it seems to work (remove iterated packet)
-        packet.parentNode.removeChild(packet)
-
-#####################
-# dom to xml string
-#####################
-filtered_pdml_string = orig_dom.toxml()
-cleaned_pdml_string = ""
-#####################
-# remove blank lines in xml string
-#####################
-lines = filtered_pdml_string.splitlines()
-for line in lines:
-    if line[:-1]:
-        cleaned_pdml_string += line + '\r\n'
-#print "'%s'" %  cleaned_pdml_string 
-#####################
-# write pdml string to pdml file
-#####################
-out_pdml_file_name = os.path.dirname(orig_pcap_file_name) + os.path.splitext(os.path.basename(orig_pcap_file_name))[0] + '.pdml'
-out_file = open(out_pdml_file_name, "w")
-out_file.write(cleaned_pdml_string)
-out_file.close()
-
-############################################################
-# DECEIVING HTML BONUS: DO NOT SEEM TO WORK CORRECTLY IN FIREFOX
-# DID NOT INVESTIGATE
-#####################
-# write xml string to html file
-#####################
-xsl_root = etree.fromstring(open('/usr/share/wireshark/pdml2html.xsl').read())
-transform = etree.XSLT(xsl_root)
-xml_root = etree.fromstring(cleaned_pdml_string)
-trans_root = transform(xml_root)
-filtered_html_string = etree.tostring(trans_root)
-#####################
-# write html string to html file
-#####################
-out_html_file_name = os.path.dirname(orig_pcap_file_name) + os.path.splitext(os.path.basename(orig_pcap_file_name))[0] + '.html'
-out_file = open(out_html_file_name, "w")
-out_file.write(filtered_html_string)
-out_file.close()
diff --git a/openair3/TEST/EPC_TEST/play_scenario.c b/openair3/TEST/EPC_TEST/play_scenario.c
new file mode 100644
index 0000000000000000000000000000000000000000..b2207d39d782c36044331b03fcfefbdb1d8f03dd
--- /dev/null
+++ b/openair3/TEST/EPC_TEST/play_scenario.c
@@ -0,0 +1,1250 @@
+/*******************************************************************************
+    OpenAirInterface
+    Copyright(c) 1999 - 2014 Eurecom
+
+    OpenAirInterface is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+
+    OpenAirInterface is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenAirInterface.The full GNU General Public License is
+    included in this distribution in the file called "COPYING". If not,
+    see <http://www.gnu.org/licenses/>.
+
+  Contact Information
+  OpenAirInterface Admin: openair_admin@eurecom.fr
+  OpenAirInterface Tech : openair_tech@eurecom.fr
+  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+
+  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+ *******************************************************************************/
+
+/*
+                                play_scenario.c
+                                -------------------
+  AUTHOR  : Lionel GAUTHIER
+  COMPANY : EURECOM
+  EMAIL   : Lionel.Gauthier@eurecom.fr
+ */
+
+#include <string.h>
+#include <limits.h>
+#include <libconfig.h>
+#include <inttypes.h>
+#include <getopt.h>
+#include <libgen.h>
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <pthread.h>
+
+
+#include "intertask_interface_init.h"
+#include "timer.h"
+#include "assertions.h"
+#include "s1ap_common.h"
+#include "intertask_interface.h"
+#include "play_scenario.h"
+#include "sctp_eNB_task.h"
+#include "sctp_default_values.h"
+#include "log.h"
+//------------------------------------------------------------------------------
+#define PLAY_SCENARIO              1
+#define GS_IS_FILE                 1
+#define GS_IS_DIR                  2
+//------------------------------------------------------------------------------
+Enb_properties_array_t g_enb_properties;
+int                    g_max_speed = 0;
+//------------------------------------------------------------------------------
+extern et_scenario_t  *g_scenario;
+extern int             xmlLoadExtDtdDefaultValue;
+extern int             asn_debug;
+extern int             asn1_xer_print;
+extern pthread_mutex_t g_fsm_lock;
+
+//------------------------------------------------------------------------------
+// MEMO:
+// Scenario with several eNBs: We may have to create ethx.y interfaces
+//
+
+
+
+//------------------------------------------------------------------------------
+// test if file exist in current directory
+int is_file_exists( const char const * file_nameP, const char const *file_roleP)
+{
+  struct stat s;
+  int err = stat(file_nameP, &s);
+  if(-1 == err) {
+    if(ENOENT == errno) {
+      fprintf(stderr, "Please provide a valid %s, %s does not exist\n", file_roleP, file_nameP);
+    } else {
+      perror("stat");
+      exit(1);
+    }
+  } else {
+    if(S_ISREG(s.st_mode)) {
+      return GS_IS_FILE;
+    } else if(S_ISDIR(s.st_mode)) {
+      return GS_IS_DIR;
+    } else {
+      fprintf(stderr, "Please provide a valid test %s, %s exists but is not found valid\n", file_roleP, file_nameP);
+    }
+  }
+  return 0;
+}
+
+
+//------------------------------------------------------------------------------
+int et_strip_extension(char *in_filename)
+{
+  static const uint8_t name_min_len = 1;
+  static const uint8_t max_ext_len = 5; // .pdml !
+  fprintf(stdout, "strip_extension %s\n", in_filename);
+
+  if (NULL != in_filename) {
+    /* Check chars starting at end of string to find last '.' */
+    for (ssize_t i = strlen(in_filename); i > name_min_len; i--) {
+      if (in_filename[i] == '.') {
+        in_filename[i] = '\0';
+        return i;
+      }
+    }
+  }
+  return -1;
+}
+//------------------------------------------------------------------------------
+// return number of splitted items
+void et_get_shift_arg( char * line_argument, shift_packet_t * const shift)
+{
+  int  len       = strlen(line_argument);
+  int  i         = 0;
+  int  j         = 0;
+  int  num_milli = 0;
+  char my_num[64];
+  int  negative  = 0;
+
+
+  while ((line_argument[i] != ':') && (i < len)) {
+    if (isdigit(line_argument[i])) { // may occur '\"'
+      my_num[j++] = line_argument[i];
+    }
+    i += 1;
+  }
+  AssertFatal(':' == line_argument[i], "Bad format");
+  i += 1; // ':'
+  my_num[j++] = '\0';
+  shift->frame_number = atoi(my_num);
+  AssertFatal(i<len, "Shift argument %s bad format", line_argument);
+
+  if (line_argument[i] == '-') {
+    negative = 1;
+    i += 1;
+  } else if (line_argument[i] == '+') {
+    i += 1;
+  }
+  AssertFatal(i<len, "Shift argument %s bad format", line_argument);
+  j = 0;
+  while ((line_argument[i] != '.') && (i < len)) {
+    my_num[j++] = line_argument[i++];
+  }
+  my_num[j] = '\0';
+  j = 0;
+  i += 1;
+  shift->shift_seconds = atoi(my_num);
+  // may omit .mmm, accept .m or .mm or .mmm or ...
+  while ((i < len) && (num_milli++ < 3)){
+    my_num[j++] = line_argument[i++];
+  }
+  while (num_milli++ < 6){
+    my_num[j++] = '0';
+  }
+  my_num[j] = '\0';
+  shift->shift_microseconds = atoi(my_num);
+  if (negative == 1) {
+    shift->shift_seconds      = - shift->shift_seconds;
+    shift->shift_microseconds = - shift->shift_microseconds;
+  }
+}
+//------------------------------------------------------------------------------
+// return number of splitted items
+int split_path( char * pathP, char *** resP)
+{
+  char *  saveptr1;
+  char *  p    = strtok_r (pathP, "/", &saveptr1);
+  int     n_spaces = 0;
+
+  /// split string and append tokens to 'res'
+  while (p) {
+    *resP = realloc (*resP, sizeof (char*) * ++n_spaces);
+    AssertFatal (*resP, "realloc failed");
+    (*resP)[n_spaces-1] = p;
+    p = strtok_r (NULL, "/", &saveptr1);
+  }
+  return n_spaces;
+}
+//------------------------------------------------------------------------------
+void et_free_packet(et_packet_t* packet)
+{
+  if (packet) {
+    switch (packet->sctp_hdr.chunk_type) {
+      case SCTP_CID_DATA:
+        et_free_pointer(packet->sctp_hdr.u.data_hdr.payload.binary_stream);
+        break;
+      default:
+        ;
+    }
+    et_free_pointer(packet);
+  }
+}
+
+//------------------------------------------------------------------------------
+void et_free_scenario(et_scenario_t* scenario)
+{
+  et_packet_t *packet = NULL;
+  et_packet_t *next_packet = NULL;
+  if (scenario) {
+    packet = scenario->list_packet;
+    while (packet) {
+      next_packet = packet->next;
+      et_free_packet(packet);
+      packet = next_packet->next;
+    }
+    et_free_pointer(scenario);
+    pthread_mutex_destroy(&g_fsm_lock);
+  }
+}
+
+//------------------------------------------------------------------------------
+char * et_ip2ip_str(const et_ip_t * const ip)
+{
+  static char str[INET6_ADDRSTRLEN];
+
+  sprintf(str, "ERROR");
+  switch (ip->address_family) {
+    case AF_INET6:
+      inet_ntop(AF_INET6, &(ip->address.ipv6), str, INET6_ADDRSTRLEN);
+      break;
+    case AF_INET:
+      inet_ntop(AF_INET, &(ip->address.ipv4), str, INET_ADDRSTRLEN);
+      break;
+    default:
+      ;
+  }
+  return str;
+}
+//------------------------------------------------------------------------------
+//convert hexstring to len bytes of data
+//returns 0 on success, negative on error
+//data is a buffer of at least len bytes
+//hexstring is upper or lower case hexadecimal, NOT prepended with "0x"
+int et_hex2data(unsigned char * const data, const unsigned char * const hexstring, const unsigned int len)
+{
+  unsigned const char *pos = hexstring;
+  char *endptr = NULL;
+  size_t count = 0;
+
+  fprintf(stdout, "%s(%s,%d)\n", __FUNCTION__, hexstring, len);
+
+  if ((len > 1) && (strlen((const char*)hexstring) % 2)) {
+    //or hexstring has an odd length
+    return -3;
+  }
+
+  if (len == 1)  {
+    char buf[5] = {'0', 'x', 0, pos[0], '\0'};
+    data[0] = strtol(buf, &endptr, 16);
+    /* Check for various possible errors */
+    AssertFatal ((errno == 0) || (data[0] != 0), "ERROR %s() strtol: %s\n", __FUNCTION__, strerror(errno));
+    AssertFatal (endptr != buf, "ERROR %s() No digits were found\n", __FUNCTION__);
+    return 0;
+  }
+
+  for(count = 0; count < len/2; count++) {
+    char buf[5] = {'0', 'x', pos[0], pos[1], 0};
+    data[count] = strtol(buf, &endptr, 16);
+    pos += 2 * sizeof(char);
+    AssertFatal (endptr[0] == '\0', "ERROR %s() non-hexadecimal character encountered buf %p endptr %p buf %s count %zu pos %p\n", __FUNCTION__, buf, endptr, buf, count, pos);
+    AssertFatal (endptr != buf, "ERROR %s() No digits were found\n", __FUNCTION__);
+  }
+  return 0;
+}
+//------------------------------------------------------------------------------
+sctp_cid_t et_chunk_type_str2cid(const xmlChar * const chunk_type_str)
+{
+  if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"DATA")))              { return SCTP_CID_DATA;}
+  if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"INIT")))              { return SCTP_CID_INIT;}
+  if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"INIT_ACK")))          { return SCTP_CID_INIT_ACK;}
+  if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"SACK")))              { return SCTP_CID_SACK;}
+  if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"HEARTBEAT")))         { return SCTP_CID_HEARTBEAT;}
+  if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"HEARTBEAT_ACK")))     { return SCTP_CID_HEARTBEAT_ACK;}
+  if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"ABORT")))             { return SCTP_CID_ABORT;}
+  if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"SHUTDOWN")))          { return SCTP_CID_SHUTDOWN;}
+  if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"SHUTDOWN_ACK")))      { return SCTP_CID_SHUTDOWN_ACK;}
+  if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"ERROR")))             { return SCTP_CID_ERROR;}
+  if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"COOKIE_ECHO")))       { return SCTP_CID_COOKIE_ECHO;}
+  if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"COOKIE_ACK")))        { return SCTP_CID_COOKIE_ACK;}
+  if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"ECN_ECNE")))          { return SCTP_CID_ECN_ECNE;}
+  if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"ECN_CWR")))           { return SCTP_CID_ECN_CWR;}
+  if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"SHUTDOWN_COMPLETE"))) { return SCTP_CID_SHUTDOWN_COMPLETE;}
+  if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"AUTH")))              { return SCTP_CID_AUTH;}
+  if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"FWD_TSN")))           { return SCTP_CID_FWD_TSN;}
+  if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"ASCONF")))            { return SCTP_CID_ASCONF;}
+  if ((!xmlStrcmp(chunk_type_str, (const xmlChar *)"ASCONF_ACK")))        { return SCTP_CID_ASCONF_ACK;}
+  AssertFatal (0, "ERROR: %s() cannot convert: %s\n", __FUNCTION__, chunk_type_str);
+}
+//------------------------------------------------------------------------------
+const char * const et_chunk_type_cid2str(const sctp_cid_t chunk_type)
+{
+  switch (chunk_type) {
+    case  SCTP_CID_DATA:              return "DATA"; break;
+    case  SCTP_CID_INIT:              return "INIT"; break;
+    case  SCTP_CID_INIT_ACK:          return "INIT_ACK"; break;
+    case  SCTP_CID_SACK:              return "SACK"; break;
+    case  SCTP_CID_HEARTBEAT:         return "HEARTBEAT"; break;
+    case  SCTP_CID_HEARTBEAT_ACK:     return "HEARTBEAT_ACK"; break;
+    case  SCTP_CID_ABORT:             return "ABORT"; break;
+    case  SCTP_CID_SHUTDOWN:          return "SHUTDOWN"; break;
+    case  SCTP_CID_SHUTDOWN_ACK:      return "SHUTDOWN_ACK"; break;
+    case  SCTP_CID_ERROR:             return "ERROR"; break;
+    case  SCTP_CID_COOKIE_ECHO:       return "COOKIE_ECHO"; break;
+    case  SCTP_CID_COOKIE_ACK:        return "COOKIE_ACK"; break;
+    case  SCTP_CID_ECN_ECNE:          return "ECN_ECNE"; break;
+    case  SCTP_CID_ECN_CWR:           return "ECN_CWR"; break;
+    case  SCTP_CID_SHUTDOWN_COMPLETE: return "SHUTDOWN_COMPLETE"; break;
+    case  SCTP_CID_AUTH:              return "AUTH"; break;
+    case  SCTP_CID_FWD_TSN:           return "FWD_TSN"; break;
+    case  SCTP_CID_ASCONF:            return "ASCONF"; break;
+    case  SCTP_CID_ASCONF_ACK:        return "ASCONF_ACK"; break;
+    default:
+      AssertFatal (0, "ERROR: Unknown chunk_type %d!\n", chunk_type);
+  }
+}
+//------------------------------------------------------------------------------
+const char * const et_error_match2str(const int err)
+{
+  switch (err) {
+    // from asn_compare.h
+    case  COMPARE_ERR_CODE_NO_MATCH:                   return "CODE_NO_MATCH"; break;
+    case  COMPARE_ERR_CODE_TYPE_MISMATCH:              return "TYPE_MISMATCH"; break;
+    case  COMPARE_ERR_CODE_TYPE_ARG_NULL:              return "TYPE_ARG_NULL"; break;
+    case  COMPARE_ERR_CODE_VALUE_NULL:                 return "VALUE_NULL"; break;
+    case  COMPARE_ERR_CODE_VALUE_ARG_NULL:             return "VALUE_ARG_NULL"; break;
+    case  COMPARE_ERR_CODE_CHOICE_NUM:                 return "CHOICE_NUM"; break;
+    case  COMPARE_ERR_CODE_CHOICE_PRESENT:             return "CHOICE_PRESENT"; break;
+    case  COMPARE_ERR_CODE_CHOICE_MALFORMED:           return "CHOICE_MALFORMED"; break;
+    case  COMPARE_ERR_CODE_SET_MALFORMED:              return "SET_MALFORMED"; break;
+    case  COMPARE_ERR_CODE_COLLECTION_NUM_ELEMENTS:    return "COLLECTION_NUM_ELEMENTS"; break;
+    // from play_scenario.h
+    case  ET_ERROR_MATCH_PACKET_SCTP_CHUNK_TYPE:       return "SCTP_CHUNK_TYPE"; break;
+    case  ET_ERROR_MATCH_PACKET_SCTP_PPID:             return "SCTP_PPID"; break;
+    case  ET_ERROR_MATCH_PACKET_SCTP_ASSOC_ID:         return "SCTP_ASSOC_ID"; break;
+    case  ET_ERROR_MATCH_PACKET_SCTP_STREAM_ID:        return "SCTP_STREAM_ID"; break;
+    case  ET_ERROR_MATCH_PACKET_SCTP_SSN:              return "SCTP_SSN"; break;
+    case  ET_ERROR_MATCH_PACKET_S1AP_PRESENT:          return "S1AP_PRESENT"; break;
+    case  ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE:   return "S1AP_PROCEDURE_CODE"; break;
+    case  ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY:      return "S1AP_CRITICALITY"; break;
+    default:
+      AssertFatal (0, "ERROR: Unknown match error %d!(TODO handle an1c error codes)\n", err);
+  }
+}
+//------------------------------------------------------------------------------
+et_packet_action_t et_action_str2et_action_t(const xmlChar * const action)
+{
+  if ((!xmlStrcmp(action, (const xmlChar *)"SEND")))              { return ET_PACKET_ACTION_S1C_SEND;}
+  if ((!xmlStrcmp(action, (const xmlChar *)"RECEIVE")))              { return ET_PACKET_ACTION_S1C_RECEIVE;}
+  AssertFatal (0, "ERROR: cannot convert: %s\n", action);
+  //if (NULL == action) {return ACTION_S1C_NULL;}
+}
+//------------------------------------------------------------------------------
+void et_ip_str2et_ip(const xmlChar  * const ip_str, et_ip_t * const ip)
+{
+  AssertFatal (NULL != ip_str, "ERROR Cannot convert null string to ip address!\n");
+  AssertFatal (NULL != ip,     "ERROR out parameter pointer is NULL!\n");
+  // store this IP address in sa:
+  if (inet_pton(AF_INET, (const char*)ip_str, (void*)&(ip->address.ipv4)) > 0) {
+    ip->address_family = AF_INET;
+    strncpy((char *)ip->str, (const char *)ip_str, INET_ADDRSTRLEN+1);
+  } else if (inet_pton(AF_INET6, (const char*)ip_str, (void*)&(ip->address.ipv6)) > 0) {
+    ip->address_family = AF_INET6;
+    strncpy((char *)ip->str, (const char *)ip_str, INET6_ADDRSTRLEN+1);
+  } else {
+    ip->address_family = AF_UNSPEC;
+    AssertFatal (0, "ERROR %s() Could not parse ip address %s!\n", __FUNCTION__, ip_str);
+  }
+}
+//------------------------------------------------------------------------------
+int et_compare_et_ip_to_net_ip_address(const et_ip_t * const ip, const net_ip_address_t * const net_ip)
+{
+  AssertFatal (NULL != ip,     "ERROR ip parameter\n");
+  AssertFatal (NULL != net_ip, "ERROR net_ip parameter\n");
+  switch (ip->address_family) {
+    case AF_INET:
+      if (net_ip->ipv4) {
+        //S1AP_DEBUG("%s(%s,%s)=%d\n",__FUNCTION__,ip->str, net_ip->ipv4_address, strcmp(ip->str, net_ip->ipv4_address));
+        return strcmp(ip->str, net_ip->ipv4_address);
+      }
+      //S1AP_DEBUG("%s(%s,%s)=-1 (IP version (4) not matching)\n",__FUNCTION__,ip->str, net_ip->ipv4_address);
+      return -1;
+      break;
+    case AF_INET6:
+      if (net_ip->ipv6) {
+        //S1AP_DEBUG("%s(%s,%s)=%d\n",__FUNCTION__,ip->str, net_ip->ipv4_address, strcmp(ip->str, net_ip->ipv6_address));
+        return strcmp(ip->str, net_ip->ipv6_address);
+      }
+      //S1AP_DEBUG("%s(%s,%s)=-1 (IP version (6) not matching)\n",__FUNCTION__,ip->str, net_ip->ipv6_address);
+      return -1;
+      break;
+    default:
+      S1AP_DEBUG("%s(%s,...)=-1 (unknown IP version)\n",__FUNCTION__,ip->str);
+      return -1;
+  }
+}
+
+#ifdef LIBCONFIG_LONG
+#define libconfig_int long
+#else
+#define libconfig_int int
+#endif
+//------------------------------------------------------------------------------
+void et_enb_config_init(const  char const * lib_config_file_name_pP)
+//------------------------------------------------------------------------------
+{
+  config_t          cfg;
+  config_setting_t *setting                       = NULL;
+  config_setting_t *subsetting                    = NULL;
+  config_setting_t *setting_mme_addresses         = NULL;
+  config_setting_t *setting_mme_address           = NULL;
+  config_setting_t *setting_enb                   = NULL;
+  libconfig_int     my_int;
+  int               num_enb_properties            = 0;
+  int               enb_properties_index          = 0;
+  int               num_enbs                      = 0;
+  int               num_mme_address               = 0;
+  int               i                             = 0;
+  int               j                             = 0;
+  int               parse_errors                  = 0;
+  libconfig_int     enb_id                        = 0;
+  const char*       cell_type                     = NULL;
+  const char*       tac                           = 0;
+  const char*       enb_name                      = NULL;
+  const char*       mcc                           = 0;
+  const char*       mnc                           = 0;
+  char*             ipv4                          = NULL;
+  char*             ipv6                          = NULL;
+  char*             active                        = NULL;
+  char*             preference                    = NULL;
+  const char*       active_enb[MAX_ENB];
+  char*             enb_interface_name_for_S1U    = NULL;
+  char*             enb_ipv4_address_for_S1U      = NULL;
+  libconfig_int     enb_port_for_S1U              = 0;
+  char*             enb_interface_name_for_S1_MME = NULL;
+  char*             enb_ipv4_address_for_S1_MME   = NULL;
+  char             *address                       = NULL;
+  char             *cidr                          = NULL;
+
+
+  AssertFatal (lib_config_file_name_pP != NULL,
+               "Bad parameter lib_config_file_name_pP %s , must reference a valid eNB config file\n",
+               lib_config_file_name_pP);
+
+  memset((char*)active_enb,     0 , MAX_ENB * sizeof(char*));
+
+  config_init(&cfg);
+
+  /* Read the file. If there is an error, report it and exit. */
+  if (! config_read_file(&cfg, lib_config_file_name_pP)) {
+    config_destroy(&cfg);
+    AssertFatal (0, "Failed to parse eNB configuration file %s!\n", lib_config_file_name_pP);
+  }
+
+  // Get list of active eNBs, (only these will be configured)
+  setting = config_lookup(&cfg, ENB_CONFIG_STRING_ACTIVE_ENBS);
+
+  if (setting != NULL) {
+    num_enbs = config_setting_length(setting);
+
+    for (i = 0; i < num_enbs; i++) {
+      setting_enb   = config_setting_get_elem(setting, i);
+      active_enb[i] = config_setting_get_string (setting_enb);
+      AssertFatal (active_enb[i] != NULL,
+                   "Failed to parse config file %s, %uth attribute %s \n",
+                   lib_config_file_name_pP, i, ENB_CONFIG_STRING_ACTIVE_ENBS);
+      active_enb[i] = strdup(active_enb[i]);
+      num_enb_properties += 1;
+    }
+  }
+
+  /* Output a list of all eNBs. */
+  setting = config_lookup(&cfg, ENB_CONFIG_STRING_ENB_LIST);
+
+  if (setting != NULL) {
+    enb_properties_index = g_enb_properties.number;
+    parse_errors      = 0;
+    num_enbs = config_setting_length(setting);
+
+    for (i = 0; i < num_enbs; i++) {
+      setting_enb = config_setting_get_elem(setting, i);
+
+      if (! config_setting_lookup_int(setting_enb, ENB_CONFIG_STRING_ENB_ID, &enb_id)) {
+        /* Calculate a default eNB ID */
+# if defined(ENABLE_USE_MME)
+        uint32_t hash;
+
+        hash = et_s1ap_generate_eNB_id ();
+        enb_id = i + (hash & 0xFFFF8);
+# else
+        enb_id = i;
+# endif
+      }
+
+      if (  !(       config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_CELL_TYPE,           &cell_type)
+                    && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_ENB_NAME,            &enb_name)
+                    && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_TRACKING_AREA_CODE,  &tac)
+                    && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_MOBILE_COUNTRY_CODE, &mcc)
+                    && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_MOBILE_NETWORK_CODE, &mnc)
+
+
+            )
+        ) {
+        AssertError (0, parse_errors ++,
+                     "Failed to parse eNB configuration file %s, %u th enb\n",
+                     lib_config_file_name_pP, i);
+        continue; // FIXME this prevents segfaults below, not sure what happens after function exit
+      }
+
+      // search if in active list
+      for (j=0; j < num_enb_properties; j++) {
+        if (strcmp(active_enb[j], enb_name) == 0) {
+          g_enb_properties.properties[enb_properties_index] = calloc(1, sizeof(Enb_properties_t));
+
+          g_enb_properties.properties[enb_properties_index]->eNB_id   = enb_id;
+
+          if (strcmp(cell_type, "CELL_MACRO_ENB") == 0) {
+            g_enb_properties.properties[enb_properties_index]->cell_type = CELL_MACRO_ENB;
+          } else  if (strcmp(cell_type, "CELL_HOME_ENB") == 0) {
+            g_enb_properties.properties[enb_properties_index]->cell_type = CELL_HOME_ENB;
+          } else {
+            AssertError (0, parse_errors ++,
+                         "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for cell_type choice: CELL_MACRO_ENB or CELL_HOME_ENB !\n",
+                         lib_config_file_name_pP, i, cell_type);
+          }
+
+          g_enb_properties.properties[enb_properties_index]->eNB_name         = strdup(enb_name);
+          g_enb_properties.properties[enb_properties_index]->tac              = (uint16_t)atoi(tac);
+          g_enb_properties.properties[enb_properties_index]->mcc              = (uint16_t)atoi(mcc);
+          g_enb_properties.properties[enb_properties_index]->mnc              = (uint16_t)atoi(mnc);
+          g_enb_properties.properties[enb_properties_index]->mnc_digit_length = strlen(mnc);
+          AssertFatal((g_enb_properties.properties[enb_properties_index]->mnc_digit_length == 2) ||
+                      (g_enb_properties.properties[enb_properties_index]->mnc_digit_length == 3),
+                      "BAD MNC DIGIT LENGTH %d",
+                      g_enb_properties.properties[i]->mnc_digit_length);
+
+
+          setting_mme_addresses = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_MME_IP_ADDRESS);
+          num_mme_address     = config_setting_length(setting_mme_addresses);
+          g_enb_properties.properties[enb_properties_index]->nb_mme = 0;
+
+          for (j = 0; j < num_mme_address; j++) {
+            setting_mme_address = config_setting_get_elem(setting_mme_addresses, j);
+
+            if (  !(
+                   config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IPV4_ADDRESS, (const char **)&ipv4)
+                   && config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IPV6_ADDRESS, (const char **)&ipv6)
+                   && config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE, (const char **)&active)
+                   && config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE, (const char **)&preference)
+                 )
+              ) {
+              AssertError (0, parse_errors ++,
+                           "Failed to parse eNB configuration file %s, %u th enb %u th mme address !\n",
+                           lib_config_file_name_pP, i, j);
+              continue; // FIXME will prevent segfaults below, not sure what happens at function exit...
+            }
+
+            g_enb_properties.properties[enb_properties_index]->nb_mme += 1;
+
+            g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv4_address = strdup(ipv4);
+            g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6_address = strdup(ipv6);
+
+            if (strcmp(active, "yes") == 0) {
+              g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].active = 1;
+            } // else { (calloc)
+
+            if (strcmp(preference, "ipv4") == 0) {
+              g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv4 = 1;
+            } else if (strcmp(preference, "ipv6") == 0) {
+              g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6 = 1;
+            } else if (strcmp(preference, "no") == 0) {
+              g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv4 = 1;
+              g_enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6 = 1;
+            }
+          }
+          // SCTP SETTING
+          g_enb_properties.properties[enb_properties_index]->sctp_out_streams = SCTP_OUT_STREAMS;
+          g_enb_properties.properties[enb_properties_index]->sctp_in_streams  = SCTP_IN_STREAMS;
+          subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_SCTP_CONFIG);
+
+          if (subsetting != NULL) {
+            if ( (config_setting_lookup_int( subsetting, ENB_CONFIG_STRING_SCTP_INSTREAMS, &my_int) )) {
+              g_enb_properties.properties[enb_properties_index]->sctp_in_streams = (uint16_t)my_int;
+            }
+
+            if ( (config_setting_lookup_int( subsetting, ENB_CONFIG_STRING_SCTP_OUTSTREAMS, &my_int) )) {
+              g_enb_properties.properties[enb_properties_index]->sctp_out_streams = (uint16_t)my_int;
+            }
+          }
+
+
+          // NETWORK_INTERFACES
+          subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
+
+          if (subsetting != NULL) {
+            if (  (
+                   config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1_MME,
+                                                 (const char **)&enb_interface_name_for_S1_MME)
+                   && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_IPV4_ADDRESS_FOR_S1_MME,
+                                                    (const char **)&enb_ipv4_address_for_S1_MME)
+                   && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U,
+                                                    (const char **)&enb_interface_name_for_S1U)
+                   && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U,
+                                                    (const char **)&enb_ipv4_address_for_S1U)
+                   && config_setting_lookup_int(subsetting, ENB_CONFIG_STRING_ENB_PORT_FOR_S1U,
+                                                &enb_port_for_S1U)
+                 )
+              ) {
+              g_enb_properties.properties[enb_properties_index]->enb_interface_name_for_S1U = strdup(enb_interface_name_for_S1U);
+              cidr = enb_ipv4_address_for_S1U;
+              address = strtok(cidr, "/");
+
+              if (address) {
+                IPV4_STR_ADDR_TO_INT_NWBO ( address, g_enb_properties.properties[enb_properties_index]->enb_ipv4_address_for_S1U, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" );
+              }
+
+              g_enb_properties.properties[enb_properties_index]->enb_port_for_S1U = enb_port_for_S1U;
+
+              g_enb_properties.properties[enb_properties_index]->enb_interface_name_for_S1_MME = strdup(enb_interface_name_for_S1_MME);
+              cidr = enb_ipv4_address_for_S1_MME;
+              address = strtok(cidr, "/");
+
+              if (address) {
+                IPV4_STR_ADDR_TO_INT_NWBO ( address, g_enb_properties.properties[enb_properties_index]->enb_ipv4_address_for_S1_MME, "BAD IP ADDRESS FORMAT FOR eNB S1_MME !\n" );
+              }
+            }
+          } // if (subsetting != NULL) {
+          enb_properties_index += 1;
+        } // if (strcmp(active_enb[j], enb_name) == 0)
+      } // for (j=0; j < num_enb_properties; j++)
+    } // for (i = 0; i < num_enbs; i++)
+  } //   if (setting != NULL) {
+
+  g_enb_properties.number += num_enb_properties;
+
+
+  AssertFatal (parse_errors == 0,
+               "Failed to parse eNB configuration file %s, found %d error%s !\n",
+               lib_config_file_name_pP, parse_errors, parse_errors > 1 ? "s" : "");
+}
+/*------------------------------------------------------------------------------*/
+const Enb_properties_array_t *et_enb_config_get(void)
+{
+  return &g_enb_properties;
+}
+/*------------------------------------------------------------------------------*/
+void et_eNB_app_register(const Enb_properties_array_t *enb_properties)
+{
+  uint32_t         enb_id = 0;
+  uint32_t         mme_id = 0;
+  MessageDef      *msg_p  = NULL;
+  char            *str    = NULL;
+  struct in_addr   addr   = {.s_addr = 0};
+
+
+  g_scenario->register_enb_pending = 0;
+  for (enb_id = 0; (enb_id < enb_properties->number) ; enb_id++) {
+    {
+      s1ap_register_enb_req_t *s1ap_register_eNB = NULL;
+
+      /* note:  there is an implicit relationship between the data structure and the message name */
+      msg_p = itti_alloc_new_message (TASK_ENB_APP, S1AP_REGISTER_ENB_REQ);
+
+      s1ap_register_eNB = &S1AP_REGISTER_ENB_REQ(msg_p);
+
+      /* Some default/random parameters */
+      s1ap_register_eNB->eNB_id           = enb_properties->properties[enb_id]->eNB_id;
+      s1ap_register_eNB->cell_type        = enb_properties->properties[enb_id]->cell_type;
+      s1ap_register_eNB->eNB_name         = enb_properties->properties[enb_id]->eNB_name;
+      s1ap_register_eNB->tac              = enb_properties->properties[enb_id]->tac;
+      s1ap_register_eNB->mcc              = enb_properties->properties[enb_id]->mcc;
+      s1ap_register_eNB->mnc              = enb_properties->properties[enb_id]->mnc;
+      s1ap_register_eNB->mnc_digit_length = enb_properties->properties[enb_id]->mnc_digit_length;
+
+      s1ap_register_eNB->nb_mme =         enb_properties->properties[enb_id]->nb_mme;
+      AssertFatal (s1ap_register_eNB->nb_mme <= S1AP_MAX_NB_MME_IP_ADDRESS, "Too many MME for eNB %d (%d/%d)!", enb_id, s1ap_register_eNB->nb_mme,
+                   S1AP_MAX_NB_MME_IP_ADDRESS);
+
+      for (mme_id = 0; mme_id < s1ap_register_eNB->nb_mme; mme_id++) {
+        s1ap_register_eNB->mme_ip_address[mme_id].ipv4 = enb_properties->properties[enb_id]->mme_ip_address[mme_id].ipv4;
+        s1ap_register_eNB->mme_ip_address[mme_id].ipv6 = enb_properties->properties[enb_id]->mme_ip_address[mme_id].ipv6;
+        strncpy (s1ap_register_eNB->mme_ip_address[mme_id].ipv4_address,
+                 enb_properties->properties[enb_id]->mme_ip_address[mme_id].ipv4_address,
+                 sizeof(s1ap_register_eNB->mme_ip_address[0].ipv4_address));
+        strncpy (s1ap_register_eNB->mme_ip_address[mme_id].ipv6_address,
+                 enb_properties->properties[enb_id]->mme_ip_address[mme_id].ipv6_address,
+                 sizeof(s1ap_register_eNB->mme_ip_address[0].ipv6_address));
+      }
+
+      s1ap_register_eNB->sctp_in_streams       = enb_properties->properties[enb_id]->sctp_in_streams;
+      s1ap_register_eNB->sctp_out_streams      = enb_properties->properties[enb_id]->sctp_out_streams;
+
+
+      s1ap_register_eNB->enb_ip_address.ipv6 = 0;
+      s1ap_register_eNB->enb_ip_address.ipv4 = 1;
+      addr.s_addr = enb_properties->properties[enb_id]->enb_ipv4_address_for_S1_MME;
+      str = inet_ntoa(addr);
+      strcpy(s1ap_register_eNB->enb_ip_address.ipv4_address, str);
+
+      g_scenario->register_enb_pending++;
+      itti_send_msg_to_task (TASK_S1AP, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
+    }
+  }
+}
+/*------------------------------------------------------------------------------*/
+void *et_eNB_app_task(void *args_p)
+{
+  et_scenario_t                  *scenario = (et_scenario_t*)args_p;
+  MessageDef                     *msg_p           = NULL;
+  const char                     *msg_name        = NULL;
+  instance_t                      instance        = 0;
+  int                             result          = 0;
+
+  itti_mark_task_ready (TASK_ENB_APP);
+
+  do {
+    // Wait for a message
+    itti_receive_msg (TASK_ENB_APP, &msg_p);
+
+    msg_name = ITTI_MSG_NAME (msg_p);
+    instance = ITTI_MSG_INSTANCE (msg_p);
+
+    switch (ITTI_MSG_ID(msg_p)) {
+    case TERMINATE_MESSAGE:
+      itti_exit_task ();
+      break;
+
+    case S1AP_REGISTER_ENB_CNF:
+      LOG_I(ENB_APP, "[eNB %d] Received %s: associated MME %d\n", instance, msg_name,
+            S1AP_REGISTER_ENB_CNF(msg_p).nb_mme);
+
+      DevAssert(scenario->register_enb_pending > 0);
+      scenario->register_enb_pending--;
+
+      /* Check if at least eNB is registered with one MME */
+      if (S1AP_REGISTER_ENB_CNF(msg_p).nb_mme > 0) {
+        scenario->registered_enb++;
+      }
+
+      /* Check if all register eNB requests have been processed */
+      if (scenario->register_enb_pending == 0) {
+        timer_remove(scenario->enb_register_retry_timer_id);
+        if (scenario->registered_enb == scenario->enb_properties->number) {
+          /* If all eNB are registered, start scenario */
+          LOG_D(ENB_APP, " All eNB are now associated with a MME\n");
+          et_event_t event;
+          event.code = ET_EVENT_S1C_CONNECTED;
+          et_scenario_fsm_notify_event(event);
+        } else {
+          uint32_t not_associated = scenario->enb_properties->number - scenario->registered_enb;
+
+          LOG_W(ENB_APP, " %d eNB %s not associated with a MME, retrying registration in %d seconds ...\n",
+                not_associated, not_associated > 1 ? "are" : "is", ET_ENB_REGISTER_RETRY_DELAY);
+
+          /* Restart the eNB registration process in ENB_REGISTER_RETRY_DELAY seconds */
+          if (timer_setup (ET_ENB_REGISTER_RETRY_DELAY, 0, TASK_ENB_APP, INSTANCE_DEFAULT, TIMER_ONE_SHOT,
+                           NULL, &scenario->enb_register_retry_timer_id) < 0) {
+            LOG_E(ENB_APP, " Can not start eNB register retry timer, use \"sleep\" instead!\n");
+
+            sleep(ET_ENB_REGISTER_RETRY_DELAY);
+            /* Restart the registration process */
+            scenario->registered_enb = 0;
+            et_eNB_app_register (scenario->enb_properties);
+          }
+        }
+      }
+
+      break;
+
+    case S1AP_DEREGISTERED_ENB_IND:
+      LOG_W(ENB_APP, "[eNB %d] Received %s: associated MME %d\n", instance, msg_name,
+            S1AP_DEREGISTERED_ENB_IND(msg_p).nb_mme);
+
+      /* TODO handle recovering of registration */
+      break;
+
+    case TIMER_HAS_EXPIRED:
+      LOG_I(ENB_APP, " Received %s: timer_id %d\n", msg_name, TIMER_HAS_EXPIRED(msg_p).timer_id);
+
+      if (TIMER_HAS_EXPIRED (msg_p).timer_id == scenario->enb_register_retry_timer_id) {
+        /* Restart the registration process */
+        scenario->registered_enb = 0;
+        et_eNB_app_register (scenario->enb_properties);
+      }
+      break;
+
+    default:
+      LOG_E(ENB_APP, "Received unexpected message %s\n", msg_name);
+      break;
+    }
+
+    result = itti_free (ITTI_MSG_ORIGIN_ID(msg_p), msg_p);
+    AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
+  } while (1);
+  return NULL;
+}
+
+//------------------------------------------------------------------------------
+int et_play_scenario(et_scenario_t* const scenario, const struct shift_packet_s *shifts)
+{
+  et_event_t             event;
+  struct shift_packet_s *shift                 = shifts;
+  et_packet_t           *packet                = NULL;
+  et_packet_t           *next_packet           = NULL;
+  struct timeval         shift_all_packets     = { .tv_sec = 0, .tv_usec = 0 };
+  struct timeval         relative_last_sent_packet     = { .tv_sec = 0, .tv_usec = 0 };
+  struct timeval         relative_last_received_packet = { .tv_sec = 0, .tv_usec = 0 };
+  struct timeval         initial_time          = { .tv_sec = 0, .tv_usec = 0 };
+  char                   first_packet          = 1;
+  char                   first_sent_packet     = 1;
+  char                   first_received_packet = 1;
+
+  // first apply timing shifts if requested
+  while (shift) {
+    packet = scenario->list_packet;
+    while (packet) {
+      //fprintf(stdout, "*shift: %p\n", shift);
+      //fprintf(stdout, "\tframe_number:       %d\n", shift->frame_number);
+      //fprintf(stdout, "\tshift_seconds:      %ld\n", shift->shift_seconds);
+      //fprintf(stdout, "\tshift_microseconds: %ld\n", shift->shift_microseconds);
+      //fprintf(stdout, "\tsingle:             %d\n\n", shift->single);
+      //fprintf(stdout, "\tshift_all_packets_seconds:      %ld\n", shift_all_packets.tv_sec);
+      //fprintf(stdout, "\tshift_all_packets_microseconds: %ld\n", shift_all_packets.tv_usec);
+
+      AssertFatal((packet->time_relative_to_first_packet.tv_sec >= 0) && (packet->time_relative_to_first_packet.tv_usec >= 0),
+          "Bad timing result time_relative_to_first_packet=%d.%d packet num %u, original frame number %u",
+          packet->time_relative_to_first_packet.tv_sec,
+          packet->time_relative_to_first_packet.tv_usec,
+          packet->packet_number,
+          packet->original_frame_number);
+      AssertFatal((packet->time_relative_to_last_received_packet.tv_sec >= 0) && (packet->time_relative_to_last_received_packet.tv_usec >= 0),
+          "Bad timing result time_relative_to_last_received_packet=%d.%d packet num %u, original frame number %u",
+          packet->time_relative_to_last_received_packet.tv_sec,
+          packet->time_relative_to_last_received_packet.tv_usec,
+          packet->packet_number,
+          packet->original_frame_number);
+      AssertFatal((packet->time_relative_to_last_sent_packet.tv_sec >= 0) && (packet->time_relative_to_last_sent_packet.tv_usec >= 0),
+          "Bad timing result time_relative_to_last_sent_packet=%d.%d packet num %u, original frame number %u",
+          packet->time_relative_to_last_sent_packet.tv_sec,
+          packet->time_relative_to_last_sent_packet.tv_usec,
+          packet->packet_number,
+          packet->original_frame_number);
+//      fprintf(stdout, "\tpacket num %u, original frame number %u time_relative_to_first_packet=%d.%d\n",
+//          packet->packet_number,
+//          packet->original_frame_number,
+//          packet->time_relative_to_first_packet.tv_sec,
+//          packet->time_relative_to_first_packet.tv_usec);
+//      fprintf(stdout, "\tpacket num %u, original frame number %u time_relative_to_last_received_packet=%d.%d\n",
+//          packet->packet_number,
+//          packet->original_frame_number,
+//          packet->time_relative_to_last_received_packet.tv_sec,
+//          packet->time_relative_to_last_received_packet.tv_usec);
+//      fprintf(stdout, "\tpacket num %u, original frame number %u time_relative_to_last_sent_packet=%d.%d\n",
+//          packet->packet_number,
+//          packet->original_frame_number,
+//          packet->time_relative_to_last_sent_packet.tv_sec,
+//          packet->time_relative_to_last_sent_packet.tv_usec);
+
+      if ((shift->single) && (shift->frame_number == packet->original_frame_number)) {
+        struct timeval t_offset     = { .tv_sec = shift->shift_seconds, .tv_usec = shift->shift_microseconds };
+        et_packet_shift_timing(packet, &t_offset);
+        next_packet = packet->next;
+        if (next_packet) {
+          t_offset.tv_sec  = -t_offset.tv_sec;
+          t_offset.tv_usec = -t_offset.tv_usec;
+
+          if (packet->action == ET_PACKET_ACTION_S1C_SEND) {
+            timeval_add(&next_packet->time_relative_to_last_sent_packet, &next_packet->time_relative_to_last_sent_packet, &t_offset);
+          } else if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) {
+            timeval_add(&next_packet->time_relative_to_last_received_packet, &next_packet->time_relative_to_last_received_packet, &t_offset);
+          }
+        }
+      }
+      if ((0 == shift->single) && (shift->frame_number == packet->original_frame_number)) {
+        shift_all_packets.tv_sec = shift->shift_seconds;
+        shift_all_packets.tv_usec = shift->shift_microseconds;
+        timeval_add(&packet->time_relative_to_first_packet, &packet->time_relative_to_first_packet, &shift_all_packets);
+        fprintf(stdout, "\tpacket num %u, now original frame number %u time_relative_to_first_packet=%d.%d\n",
+            packet->packet_number,
+            packet->original_frame_number,
+            packet->time_relative_to_first_packet.tv_sec,
+            packet->time_relative_to_first_packet.tv_usec);
+        AssertFatal((packet->time_relative_to_first_packet.tv_sec >= 0) && (packet->time_relative_to_first_packet.tv_usec >= 0),
+            "Bad timing result time_relative_to_first_packet=%d.%d packet num %u, original frame number %u",
+            packet->time_relative_to_first_packet.tv_sec,
+            packet->time_relative_to_first_packet.tv_usec,
+            packet->packet_number,
+            packet->original_frame_number);
+      } else if ((0 == shift->single)  && (shift->frame_number < packet->original_frame_number)) {
+        timeval_add(&packet->time_relative_to_first_packet, &packet->time_relative_to_first_packet, &shift_all_packets);
+        fprintf(stdout, "\tpacket num %u, now original frame number %u time_relative_to_first_packet=%d.%d\n",
+            packet->packet_number,
+            packet->original_frame_number,
+            packet->time_relative_to_first_packet.tv_sec,
+            packet->time_relative_to_first_packet.tv_usec);
+        AssertFatal((packet->time_relative_to_first_packet.tv_sec >= 0) && (packet->time_relative_to_first_packet.tv_usec >= 0),
+            "Bad timing result time_relative_to_first_packet=%d.%d packet num %u, original frame number %u",
+            packet->time_relative_to_first_packet.tv_sec,
+            packet->time_relative_to_first_packet.tv_usec,
+            packet->packet_number,
+            packet->original_frame_number);
+      }
+      packet = packet->next;
+    }
+    shift = shift->next;
+  }
+  // now recompute time_relative_to_last_received_packet, time_relative_to_last_sent_packet
+  packet = scenario->list_packet;
+  while (packet) {
+    if (first_packet > 0) {
+      initial_time = packet->time_relative_to_first_packet;
+      packet->time_relative_to_first_packet.tv_sec  = 0;
+      packet->time_relative_to_first_packet.tv_usec = 0;
+      first_packet = 0;
+    } else {
+      timersub(&packet->time_relative_to_first_packet, &initial_time,
+          &packet->time_relative_to_first_packet);
+    }
+    if (packet->action == ET_PACKET_ACTION_S1C_SEND) {
+      if (first_sent_packet > 0) {
+        relative_last_sent_packet = packet->time_relative_to_first_packet;
+        packet->time_relative_to_last_sent_packet.tv_sec  = 0;
+        packet->time_relative_to_last_sent_packet.tv_usec = 0;
+        first_sent_packet = 0;
+      } else {
+        timersub(&packet->time_relative_to_first_packet, &relative_last_sent_packet,
+            &packet->time_relative_to_last_sent_packet);
+        relative_last_sent_packet = packet->time_relative_to_first_packet;
+      }
+      if (first_received_packet > 0) {
+        packet->time_relative_to_last_received_packet.tv_sec  = 0;
+        packet->time_relative_to_last_received_packet.tv_usec = 0;
+      } else {
+        timersub(&packet->time_relative_to_first_packet, &relative_last_received_packet,
+            &packet->time_relative_to_last_received_packet);
+      }
+    } else if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) {
+      if (first_received_packet > 0) {
+        relative_last_received_packet.tv_sec = packet->time_relative_to_first_packet.tv_sec;
+        relative_last_received_packet.tv_usec = packet->time_relative_to_first_packet.tv_usec;
+        packet->time_relative_to_last_received_packet.tv_sec  = 0;
+        packet->time_relative_to_last_received_packet.tv_usec = 0;
+        first_received_packet = 0;
+      } else {
+        timersub(&packet->time_relative_to_first_packet, &relative_last_received_packet,
+            &packet->time_relative_to_last_received_packet);
+        relative_last_received_packet = packet->time_relative_to_first_packet;
+      }
+      if (first_sent_packet > 0) {
+        packet->time_relative_to_last_sent_packet.tv_sec  = 0;
+        packet->time_relative_to_last_sent_packet.tv_usec = 0;
+      } else {
+        timersub(&packet->time_relative_to_first_packet, &relative_last_sent_packet,
+            &packet->time_relative_to_last_sent_packet);
+      }
+    }
+    packet = packet->next;
+  }
+  //et_display_scenario(scenario);
+
+  // create SCTP ITTI task: same as eNB code
+  if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) {
+    LOG_E(SCTP, "Create task for SCTP failed\n");
+    return -1;
+  }
+
+  // create S1AP ITTI task: not as same as eNB code
+  if (itti_create_task (TASK_S1AP, et_s1ap_eNB_task, NULL) < 0) {
+    LOG_E(S1AP, "Create task for S1AP failed\n");
+    return -1;
+  }
+
+  // create ENB_APP ITTI task: not as same as eNB code
+  if (itti_create_task (TASK_ENB_APP, et_eNB_app_task, scenario) < 0) {
+    LOG_E(ENB_APP, "Create task for ENB_APP failed\n");
+    return -1;
+  }
+
+  event.code = ET_EVENT_INIT;
+  event.u.init.scenario = scenario;
+  et_scenario_fsm_notify_event(event);
+
+
+  return 0;
+}
+
+//------------------------------------------------------------------------------
+static void et_usage (
+    int argc,
+    char *argv[])
+//------------------------------------------------------------------------------
+{
+  fprintf (stdout, "Please report any bug to: %s\n",PACKAGE_BUGREPORT);
+  fprintf (stdout, "Usage: %s [options]\n\n", argv[0]);
+  fprintf (stdout, "\n");
+  fprintf (stdout, "\t-d | --test-dir       <dir>                  Directory where a set of files related to a particular test are located\n");
+  fprintf (stdout, "\t-c | --enb-conf-file  <file>                 Provide an eNB config file, valid for the testbed\n");
+  fprintf (stdout, "\t-D | --delay-on-exit  <delay-in-sec>         Wait delay-in-sec before exiting\n");
+  fprintf (stdout, "\t-f | --shift-packet   <frame:[+|-]seconds[.usec]> Shift the timing of a packet'\n");
+  fprintf (stdout, "\t-F | --shift-packets  <frame:[+|-]seconds[.usec]> Shift the timing of packets starting at frame 'frame' included\n");
+  fprintf (stdout, "\t-m | --max-speed                             Play scenario as fast as possible without respecting frame timings\n");
+  fprintf (stdout, "\t-s | --scenario       <file>                 File name (with no path) of a test scenario that has to be replayed ()\n");
+  fprintf (stdout, "\n");
+  fprintf (stdout, "Other options:\n");
+  fprintf (stdout, "\t-h | --help                                  Print this help and return\n");
+  fprintf (stdout, "\t-v | --version                               Print informations about the version of this executable\n");
+  fprintf (stdout, "\n");
+}
+
+//------------------------------------------------------------------------------
+int
+et_config_parse_opt_line (
+  int argc,
+  char *argv[],
+  char **et_dir_name,
+  char **scenario_file_name,
+  char **enb_config_file_name,
+  shift_packet_t **shifts,
+  int *delay_on_exit)
+//------------------------------------------------------------------------------
+{
+  int                 option   = 0;
+  int                 rv       = 0;
+  shift_packet_t      *shift   = NULL;
+
+  enum long_option_e {
+    LONG_OPTION_START = 0x100, /* Start after regular single char options */
+    LONG_OPTION_ENB_CONF_FILE,
+    LONG_OPTION_SCENARIO_FILE,
+    LONG_OPTION_MAX_SPEED,
+    LONG_OPTION_TEST_DIR,
+    LONG_OPTION_DELAY_EXIT,
+    LONG_OPTION_SHIFT_PACKET,
+    LONG_OPTION_SHIFT_PACKETS,
+    LONG_OPTION_HELP,
+    LONG_OPTION_VERSION
+  };
+
+  static struct option long_options[] = {
+    {"enb-conf-file",  required_argument, 0, LONG_OPTION_ENB_CONF_FILE},
+    {"scenario ",      required_argument, 0, LONG_OPTION_SCENARIO_FILE},
+    {"max-speed ",     no_argument,       0, LONG_OPTION_MAX_SPEED},
+    {"test-dir",       required_argument, 0, LONG_OPTION_TEST_DIR},
+    {"delay-on-exit",  required_argument, 0, LONG_OPTION_DELAY_EXIT},
+    {"shift-packet",   required_argument, 0, LONG_OPTION_SHIFT_PACKET},
+    {"shift-packets",  required_argument, 0, LONG_OPTION_SHIFT_PACKETS},
+    {"help",           no_argument,       0, LONG_OPTION_HELP},
+    {"version",        no_argument,       0, LONG_OPTION_VERSION},
+     {NULL, 0, NULL, 0}
+  };
+
+  /*
+   * Parsing command line
+   */
+  while ((option = getopt_long (argc, argv, "vhmc:s:d:f:F", long_options, NULL)) != -1) {
+    switch (option) {
+      case LONG_OPTION_ENB_CONF_FILE:
+      case 'c':
+        if (optarg) {
+          *enb_config_file_name = strdup(optarg);
+          printf("eNB config file name is %s\n", *enb_config_file_name);
+          rv |= PLAY_SCENARIO;
+        }
+        break;
+
+      case LONG_OPTION_SCENARIO_FILE:
+      case 's':
+        if (optarg) {
+          *scenario_file_name = strdup(optarg);
+          printf("Scenario file name is %s\n", *scenario_file_name);
+          rv |= PLAY_SCENARIO;
+        }
+        break;
+
+      case LONG_OPTION_TEST_DIR:
+      case 'd':
+        if (optarg) {
+          *et_dir_name = strdup(optarg);
+          if (is_file_exists(*et_dir_name, "test dirname") != GS_IS_DIR) {
+            fprintf(stderr, "Please provide a valid test dirname, %s is not a valid directory name\n", *et_dir_name);
+            exit(1);
+          }
+          printf("Test dir name is %s\n", *et_dir_name);
+        }
+        break;
+
+      case LONG_OPTION_DELAY_EXIT:
+      case 'D':
+        if (optarg) {
+          delay_on_exit = atoi(optarg);
+          if (0 > delay_on_exit) {
+            fprintf(stderr, "Please provide a valid -D/--delay-on-exit argument, %s is not a valid value\n", delay_on_exit);
+            exit(1);
+          }
+          printf("Delay on exit is %d\n", delay_on_exit);
+        }
+        break;
+
+
+      case LONG_OPTION_SHIFT_PACKET:
+      case 'f':
+        if (optarg) {
+          if (NULL == *shifts) {
+            shift = calloc(1, sizeof (*shift));
+            *shifts = shift;
+          } else {
+            shift->next = calloc(1, sizeof (*shift));
+            shift = shift->next;
+          }
+          shift->single = 1;
+          printf("Arg Shift packet %s\n", optarg);
+          et_get_shift_arg(optarg, shift);
+        }
+        break;
+
+      case LONG_OPTION_SHIFT_PACKETS:
+      case 'F':
+        if (optarg) {
+          if (NULL == *shifts) {
+            shift = calloc(1, sizeof (*shift));
+            *shifts = shift;
+          } else {
+            shift->next = calloc(1, sizeof (*shift));
+            shift = shift->next;
+          }
+          et_get_shift_arg(optarg, shift);
+          printf("Arg Shift packets %s\n", optarg);
+        }
+        break;
+
+      case LONG_OPTION_MAX_SPEED:
+      case 'm':
+        g_max_speed = 1;
+        break;
+
+      case LONG_OPTION_VERSION:
+      case 'v':
+        printf("Version %s\n", PACKAGE_VERSION);
+        exit (0);
+        break;
+
+      case LONG_OPTION_HELP:
+      case 'h':
+      default:
+        et_usage (argc, argv);
+        exit (0);
+    }
+  }
+  if (NULL == *et_dir_name) {
+    fprintf(stderr, "Please provide a valid test dirname\n");
+    exit(1);
+  }
+  if (chdir(*et_dir_name) != 0) {
+    fprintf(stderr, "ERROR: chdir %s returned %s\n", *et_dir_name, strerror(errno));
+    exit(1);
+  }
+  if (rv & PLAY_SCENARIO) {
+    if (NULL == *enb_config_file_name) {
+      fprintf(stderr, "ERROR: please provide the original eNB config file name that should be in %s\n", *et_dir_name);
+    }
+    if (is_file_exists(*enb_config_file_name, "eNB config file") != GS_IS_FILE) {
+      fprintf(stderr, "ERROR: original eNB config file name %s is not found in dir %s\n", *enb_config_file_name, *et_dir_name);
+    }
+    et_enb_config_init(*enb_config_file_name);
+
+    if (NULL == *scenario_file_name) {
+      fprintf(stderr, "ERROR: please provide the scenario file name that should be in %s\n", *et_dir_name);
+    }
+    if (is_file_exists(*scenario_file_name, "Scenario file") != GS_IS_FILE) {
+      fprintf(stderr, "ERROR: Scenario file name %s is not found in dir %s\n", *scenario_file_name, *et_dir_name);
+    }
+  }
+  return rv;
+}
+
+//------------------------------------------------------------------------------
+int main( int argc, char **argv )
+//------------------------------------------------------------------------------
+{
+  int              actions              = 0;
+  char            *et_dir_name          = NULL;
+  char            *scenario_file_name   = NULL;
+  char            *enb_config_file_name = NULL;
+  struct shift_packet_s *shifts         = NULL;
+  int              ret                  = 0;
+  int              delay_on_exit        = 0;
+  et_scenario_t   *scenario             = NULL;
+  char             play_scenario_filename[NAME_MAX];
+
+  memset(play_scenario_filename, 0, sizeof(play_scenario_filename));
+
+  // logging
+  logInit();
+  set_glog(LOG_TRACE, LOG_MED);
+
+  itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, NULL);
+
+  set_comp_log(ENB_APP, LOG_TRACE, LOG_MED, 1);
+  set_comp_log(S1AP, LOG_TRACE, LOG_MED, 1);
+  set_comp_log(SCTP, LOG_TRACE, LOG_FULL, 1);
+  asn_debug      = 0;
+  asn1_xer_print = 1;
+
+  //parameters
+  actions = et_config_parse_opt_line (argc, argv, &et_dir_name, &scenario_file_name, &enb_config_file_name, &shifts, &delay_on_exit); //Command-line options
+  if  (actions & PLAY_SCENARIO) {
+    if (et_generate_xml_scenario(et_dir_name, scenario_file_name,enb_config_file_name, play_scenario_filename) == 0) {
+      if (NULL != (scenario = et_generate_scenario(play_scenario_filename))) {
+        ret = et_play_scenario(scenario, shifts);
+      } else {
+        fprintf(stderr, "ERROR: Could not generate scenario from tsml file\n");
+        ret = -1;
+      }
+    } else {
+      fprintf(stderr, "ERROR: Could not generate tsml scenario from xml file\n");
+      ret = -1;
+    }
+    et_free_pointer(et_dir_name);
+    et_free_pointer(scenario_file_name);
+    et_free_pointer(enb_config_file_name);
+  }
+  itti_wait_tasks_end();
+  if (0 < delay_on_exit) {
+    sleep(delay_on_exit);
+  }
+  return ret;
+}
+
+
diff --git a/openair3/TEST/EPC_TEST/play_scenario.h b/openair3/TEST/EPC_TEST/play_scenario.h
new file mode 100644
index 0000000000000000000000000000000000000000..c1458047bd499bdc80f99661cc5c0278ced07e01
--- /dev/null
+++ b/openair3/TEST/EPC_TEST/play_scenario.h
@@ -0,0 +1,508 @@
+/*******************************************************************************
+    OpenAirInterface
+    Copyright(c) 1999 - 2014 Eurecom
+
+    OpenAirInterface is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+
+    OpenAirInterface is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenAirInterface.The full GNU General Public License is
+   included in this distribution in the file called "COPYING". If not,
+   see <http://www.gnu.org/licenses/>.
+
+  Contact Information
+  OpenAirInterface Admin: openair_admin@eurecom.fr
+  OpenAirInterface Tech : openair_tech@eurecom.fr
+  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+
+  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+*******************************************************************************/
+
+/*
+                                play_scenario.h
+                             -------------------
+  AUTHOR  : Lionel GAUTHIER
+  COMPANY : EURECOM
+  EMAIL   : Lionel.Gauthier@eurecom.fr
+*/
+
+#ifndef PLAY_SCENARIO_H_
+#define PLAY_SCENARIO_H_
+#  include <time.h>
+#  include <stdint.h>
+#  include <libxml/tree.h>
+#  include <libxml/xpath.h>
+#  include <netinet/in.h>
+
+#include "S1AP-PDU.h"
+#include "s1ap_ies_defs.h"
+#include "play_scenario_s1ap_eNB_defs.h"
+#include "hashtable.h"
+#include "asn_compare.h"
+
+#define ET_XPATH_EXPRESSION_MAX_LENGTH 400
+
+
+// powers of 2
+#define ET_BIT_MASK_MATCH_SCTP_STREAM 1
+#define ET_BIT_MASK_MATCH_SCTP_SSN    2
+//#define ET_BIT_MASK_MATCH_S1AP_    2
+
+#define MAX_ENB 16
+
+#define ENB_CONFIG_STRING_ACTIVE_ENBS                   "Active_eNBs"
+
+#define ENB_CONFIG_STRING_ENB_LIST                      "eNBs"
+#define ENB_CONFIG_STRING_ENB_ID                        "eNB_ID"
+#define ENB_CONFIG_STRING_CELL_TYPE                     "cell_type"
+#define ENB_CONFIG_STRING_ENB_NAME                      "eNB_name"
+
+#define ENB_CONFIG_STRING_TRACKING_AREA_CODE            "tracking_area_code"
+#define ENB_CONFIG_STRING_MOBILE_COUNTRY_CODE           "mobile_country_code"
+#define ENB_CONFIG_STRING_MOBILE_NETWORK_CODE           "mobile_network_code"
+
+
+#define ENB_CONFIG_STRING_MME_IP_ADDRESS                "mme_ip_address"
+#define ENB_CONFIG_STRING_MME_IPV4_ADDRESS              "ipv4"
+#define ENB_CONFIG_STRING_MME_IPV6_ADDRESS              "ipv6"
+#define ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE         "active"
+#define ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE     "preference"
+
+#define ENB_CONFIG_STRING_SCTP_CONFIG                    "SCTP"
+#define ENB_CONFIG_STRING_SCTP_INSTREAMS                 "SCTP_INSTREAMS"
+#define ENB_CONFIG_STRING_SCTP_OUTSTREAMS                "SCTP_OUTSTREAMS"
+
+#define ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG     "NETWORK_INTERFACES"
+#define ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1_MME "ENB_INTERFACE_NAME_FOR_S1_MME"
+#define ENB_CONFIG_STRING_ENB_IPV4_ADDRESS_FOR_S1_MME   "ENB_IPV4_ADDRESS_FOR_S1_MME"
+#define ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U    "ENB_INTERFACE_NAME_FOR_S1U"
+#define ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U         "ENB_IPV4_ADDRESS_FOR_S1U"
+#define ENB_CONFIG_STRING_ENB_PORT_FOR_S1U              "ENB_PORT_FOR_S1U"
+
+
+typedef struct shift_packet_s {
+  unsigned int           frame_number;      // original frame number
+  int                    shift_seconds;
+  int                    shift_microseconds;
+  int                    single;            // shift timing only for this packet (not also following packets)
+  struct shift_packet_s *next;
+} shift_packet_t;
+
+
+typedef struct mme_ip_address_s {
+  unsigned  ipv4:1;
+  unsigned  ipv6:1;
+  unsigned  active:1;
+  char     *ipv4_address;
+  char     *ipv6_address;
+} mme_ip_address_t;
+
+#define IPV4_STR_ADDR_TO_INT_NWBO(AdDr_StR,NwBo,MeSsAgE ) do {\
+            struct in_addr inp;\
+            if ( inet_aton(AdDr_StR, &inp ) < 0 ) {\
+                AssertFatal (0, MeSsAgE);\
+            } else {\
+                NwBo = inp.s_addr;\
+            }\
+        } while (0);
+
+
+typedef struct Enb_properties_s {
+  /* Unique eNB_id to identify the eNB within EPC.
+   * For macro eNB ids this field should be 20 bits long.
+   * For home eNB ids this field should be 28 bits long.
+   */
+  uint32_t            eNB_id;
+
+  /* The type of the cell */
+  enum cell_type_e    cell_type;
+
+  /* Optional name for the cell
+   * NOTE: the name can be NULL (i.e no name) and will be cropped to 150
+   * characters.
+   */
+  char               *eNB_name;
+
+  /* Tracking area code */
+  uint16_t            tac;
+
+  /* Mobile Country Code
+   * Mobile Network Code
+   */
+  uint16_t            mcc;
+  uint16_t            mnc;
+  uint8_t             mnc_digit_length;
+
+
+
+  /* Physical parameters */
+
+  int16_t                 Nid_cell[1+MAX_NUM_CCs];// for testing, change later
+  /* Nb of MME to connect to */
+  uint8_t             nb_mme;
+  /* List of MME to connect to */
+  mme_ip_address_t    mme_ip_address[S1AP_MAX_NB_MME_IP_ADDRESS];
+
+  int                 sctp_in_streams;
+  int                 sctp_out_streams;
+
+  char               *enb_interface_name_for_S1U;
+  in_addr_t           enb_ipv4_address_for_S1U;
+  tcp_udp_port_t      enb_port_for_S1U;
+
+  char               *enb_interface_name_for_S1_MME;
+  in_addr_t           enb_ipv4_address_for_S1_MME;
+
+} Enb_properties_t;
+
+typedef struct Enb_properties_array_s {
+  int                  number;
+  Enb_properties_t    *properties[MAX_ENB];
+} Enb_properties_array_t;
+
+#  define ET_ENB_REGISTER_RETRY_DELAY 3
+#  define ET_FSM_STATE_WAITING_RX_EVENT_DELAY_SEC 15
+
+typedef enum {
+  ET_PACKET_STATUS_START = 0,
+  ET_PACKET_STATUS_NONE = ET_PACKET_STATUS_START,
+  ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT,
+  ET_PACKET_STATUS_SCHEDULED_FOR_SENDING,
+  ET_PACKET_STATUS_SENT,
+  ET_PACKET_STATUS_SCHEDULED_FOR_RECEIVING,
+  ET_PACKET_STATUS_RECEIVED,
+  ET_PACKET_STATUS_END
+} et_packet_status_t;
+
+typedef enum {
+  ET_FSM_STATE_START = 0,
+  ET_FSM_STATE_NULL = ET_FSM_STATE_START,
+  ET_FSM_STATE_CONNECTING_S1C,
+  ET_FSM_STATE_WAITING_RX_EVENT,
+  ET_FSM_STATE_WAITING_TX_EVENT,
+  ET_FSM_STATE_RUNNING,
+  ET_FSM_STATE_END
+} et_fsm_state_t;
+
+enum COMPARE_ERR_CODE_e;
+
+typedef enum {
+  ET_ERROR_MATCH_START = COMPARE_ERR_CODE_END,
+  ET_ERROR_MATCH_PACKET_SCTP_CHUNK_TYPE = ET_ERROR_MATCH_START,
+  ET_ERROR_MATCH_PACKET_SCTP_PPID,
+  ET_ERROR_MATCH_PACKET_SCTP_ASSOC_ID,
+  ET_ERROR_MATCH_PACKET_SCTP_STREAM_ID,
+  ET_ERROR_MATCH_PACKET_SCTP_SSN,
+  ET_ERROR_MATCH_PACKET_S1AP_PRESENT,
+  ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE,
+  ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY,
+  ET_ERROR_MATCH_END
+} et_error_match_code_t;
+
+
+
+
+typedef enum {
+  ET_PACKET_ACTION_S1C_START = 0,
+  ET_PACKET_ACTION_S1C_NULL  = ET_PACKET_ACTION_S1C_START,
+  ET_PACKET_ACTION_S1C_SEND,
+  ET_PACKET_ACTION_S1C_RECEIVE,
+  ET_PACKET_ACTION_S1C_END
+} et_packet_action_t;
+
+// from kernel source file 3.19/include/linux/sctp.h
+typedef enum {
+  SCTP_CID_DATA                   = 0,
+  SCTP_CID_INIT                   = 1,
+  SCTP_CID_INIT_ACK               = 2,
+  SCTP_CID_SACK                   = 3,
+  SCTP_CID_HEARTBEAT              = 4,
+  SCTP_CID_HEARTBEAT_ACK          = 5,
+  SCTP_CID_ABORT                  = 6,
+  SCTP_CID_SHUTDOWN               = 7,
+  SCTP_CID_SHUTDOWN_ACK           = 8,
+  SCTP_CID_ERROR                  = 9,
+  SCTP_CID_COOKIE_ECHO            = 10,
+  SCTP_CID_COOKIE_ACK             = 11,
+  SCTP_CID_ECN_ECNE               = 12,
+  SCTP_CID_ECN_CWR                = 13,
+  SCTP_CID_SHUTDOWN_COMPLETE      = 14,
+
+  /* AUTH Extension Section 4.1 */
+  SCTP_CID_AUTH                   = 0x0F,
+
+  /* PR-SCTP Sec 3.2 */
+  SCTP_CID_FWD_TSN                = 0xC0,
+
+  /* Use hex, as defined in ADDIP sec. 3.1 */
+  SCTP_CID_ASCONF                 = 0xC1,
+  SCTP_CID_ASCONF_ACK             = 0x80,
+} sctp_cid_t; /* enum */
+
+typedef enum {
+  TEST_S1AP_PDU_TYPE_START = 0,
+  TEST_S1AP_PDU_TYPE_UNKNOWN = TEST_S1AP_PDU_TYPE_START,
+  TEST_S1AP_PDU_TYPE_INITIATING,
+  TEST_S1AP_PDU_TYPE_SUCCESSFUL_OUTCOME,
+  TEST_S1AP_PDU_TYPE_UNSUCCESSFUL_OUTCOME,
+  TEST_S1AP_PDU_TYPE_END
+} et_s1ap_pdu_type_t;
+
+
+typedef struct et_s1ap_s {
+  //et_s1ap_pdu_type_t pdu_type;
+  S1AP_PDU_t           pdu; // decoded ASN1 C type: choice of initiatingMessage, successfulOutcome, unsuccessfulOutcome
+  uint16_t             xml_stream_pos_offset;
+  uint16_t             binary_stream_pos;
+  uint16_t             binary_stream_allocated_size;
+  uint8_t             *binary_stream;
+  s1ap_message         message; // decoded message: information elements
+  xmlDocPtr            doc; // XML representation of the S1AP PDU
+} et_s1ap_t;
+
+
+// from kernel source file 3.19/include/linux/sctp.h, Big Endians
+typedef struct sctp_datahdr_s {
+  uint32_t    tsn;
+  uint16_t    stream;
+  uint16_t    ssn;
+  uint32_t    ppid;
+  uint32_t    assoc_id; // filled when running scenario
+  et_s1ap_t   payload;
+} sctp_datahdr_t;
+
+// from kernel source file 3.19/include/linux/sctp.h, Big Endians
+typedef struct sctp_inithdr {
+  uint32_t init_tag;
+  uint32_t a_rwnd;
+  uint16_t num_outbound_streams;
+  uint16_t num_inbound_streams;
+  uint32_t initial_tsn;
+  uint8_t  params[0];
+}  sctp_inithdr_t;
+
+typedef sctp_inithdr_t sctp_initackhdr_t;
+
+typedef struct et_sctp_hdr_s {
+  unsigned int src_port;
+  unsigned int dst_port;
+  sctp_cid_t   chunk_type;
+  union {
+    sctp_datahdr_t    data_hdr;
+    sctp_inithdr_t    init_hdr;
+    sctp_initackhdr_t init_ack_hdr;
+  } u;
+} et_sctp_hdr_t;
+
+typedef struct et_ip_s {
+  unsigned int  address_family; // AF_INET, AF_INET6
+  union {
+    struct in6_addr  ipv6;
+    in_addr_t        ipv4;
+  }address;
+  char str[INET6_ADDRSTRLEN+1];
+}et_ip_t;
+
+typedef struct et_ip_hdr_s {
+  et_ip_t  src;
+  et_ip_t  dst;
+} et_ip_hdr_t;
+
+typedef struct et_packet_s {
+  et_packet_action_t   action;
+  struct timeval       time_relative_to_first_packet;
+  struct timeval       time_relative_to_last_sent_packet;
+  struct timeval       time_relative_to_last_received_packet;
+  unsigned int         original_frame_number;
+  unsigned int         packet_number;
+  instance_t           enb_instance;
+  et_ip_hdr_t          ip_hdr;
+  et_sctp_hdr_t        sctp_hdr;
+  struct et_packet_s  *next;
+
+  //scenario running vars
+  et_packet_status_t   status;
+  long                 timer_id;         // ITTI timer id for waiting rx packets
+  struct timeval       timestamp_packet; // timestamp when rx or tx packet
+}et_packet_t;
+
+
+typedef struct sctp_epoll_s {
+  /* Array of events monitored by the task.
+   * By default only one fd is monitored (the one used to received messages
+   * from other tasks).
+   * More events can be suscribed later by the task itself.
+   */
+  struct epoll_event *events;
+
+  int epoll_nb_events;
+
+} thread_desc_t;
+
+typedef struct et_scenario_s {
+  xmlChar                *name;
+  et_packet_t            *list_packet;
+  //--------------------------
+  // playing scenario
+  //--------------------------
+  Enb_properties_array_t *enb_properties;
+  uint32_t                register_enb_pending;
+  uint32_t                registered_enb;
+  long                    enb_register_retry_timer_id;
+
+
+  hash_table_t           *hash_mme2association_id;
+  hash_table_t           *hash_old_ue_mme_id2ue_mme_id;
+  struct timeval          time_last_tx_packet;    // Time last sent packet
+  struct timeval          time_last_rx_packet;    // Time last packet received with all previous scenario RX packet received.
+  et_packet_t            *last_rx_packet;         // Last packet received with all previous scenario RX packet received.
+  et_packet_t            *last_tx_packet;         // Last sent packet
+  et_packet_t            *next_packet;            // Next packet to be handled in the scenario (RX or TX packet)
+
+  int                     timer_count;
+} et_scenario_t;
+
+
+typedef enum {
+  ET_EVENT_START = 0,
+  ET_EVENT_INIT = ET_EVENT_START,
+  ET_EVENT_S1C_CONNECTED,
+  ET_EVENT_RX_SCTP_EVENT,
+  ET_EVENT_RX_S1AP,
+  ET_EVENT_RX_PACKET_TIME_OUT,
+  ET_EVENT_TX_TIMED_PACKET,
+  ET_EVENT_TICK,
+  ET_EVENT_END
+} et_event_code_t;
+
+typedef struct et_event_init_s {
+  et_scenario_t *scenario;
+} et_event_init_t;
+
+typedef struct et_event_s1ap_data_ind_s {
+  sctp_datahdr_t sctp_datahdr;
+} et_event_s1ap_data_ind_t;
+
+typedef struct et_event_s1ap_data_req_s {
+
+} et_event_s1ap_data_req_t;
+
+typedef struct et_event_s {
+  et_event_code_t code;
+  union {
+    et_event_init_t           init;
+    et_event_s1ap_data_ind_t  s1ap_data_ind;
+    et_packet_t               *tx_timed_packet;
+    et_packet_t               *rx_packet_time_out;
+  } u;
+} et_event_t;
+
+inline void et_free_pointer(void *p) {if (NULL != p) {free(p); p=NULL;}};
+
+//-------------------------
+void et_free_packet(et_packet_t* packet);
+void et_free_scenario(et_scenario_t* scenario);
+//-------------------------
+void et_display_packet_s1ap_data(const et_s1ap_t * const s1ap);
+void et_display_packet_sctp_init(const sctp_inithdr_t * const sctp);
+void et_display_packet_sctp_initack(const sctp_initackhdr_t * const sctp);
+void et_display_packet_sctp_data(const sctp_datahdr_t * const sctp);
+void et_display_packet_sctp(const et_sctp_hdr_t * const sctp);
+void et_display_packet_ip(const et_ip_hdr_t * const ip);
+void et_display_packet(const et_packet_t * const packet);
+void et_display_scenario(const et_scenario_t * const scenario);
+//-------------------------
+int et_s1ap_decode_initiating_message(s1ap_message *message, S1ap_InitiatingMessage_t *initiating_p);
+int et_s1ap_decode_successful_outcome(s1ap_message *message, S1ap_SuccessfulOutcome_t *successfullOutcome_p);
+int et_s1ap_decode_unsuccessful_outcome(s1ap_message *message, S1ap_UnsuccessfulOutcome_t *unSuccessfullOutcome_p);
+int et_s1ap_decode_pdu(S1AP_PDU_t * const pdu, s1ap_message * const message, const uint8_t * const buffer, const uint32_t length);
+void et_decode_s1ap(et_s1ap_t * const s1ap);
+//-------------------------
+int et_s1ap_eNB_compare_assoc_id( struct s1ap_eNB_mme_data_s *p1, struct s1ap_eNB_mme_data_s *p2);
+uint32_t et_s1ap_generate_eNB_id(void);
+uint16_t et_s1ap_eNB_fetch_add_global_cnx_id(void);
+void et_s1ap_eNB_prepare_internal_data(void);
+void et_s1ap_eNB_insert_new_instance(s1ap_eNB_instance_t *new_instance_p);
+struct s1ap_eNB_mme_data_s *et_s1ap_eNB_get_MME(s1ap_eNB_instance_t *instance_p,int32_t assoc_id, uint16_t cnx_id);
+s1ap_eNB_instance_t *et_s1ap_eNB_get_instance(instance_t instance);
+void et_s1ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,uint32_t buffer_length, uint16_t stream);
+int et_handle_s1ap_mismatch_mme_ue_s1ap_id(et_packet_t * const spacket, et_packet_t * const rx_packet);
+asn_comp_rval_t* et_s1ap_is_matching(et_s1ap_t * const s1ap1, et_s1ap_t * const s1ap2, const uint32_t constraints);
+et_packet_t* et_build_packet_from_s1ap_data_ind(et_event_s1ap_data_ind_t * const s1ap_data_ind);
+int et_scenario_set_packet_received(et_packet_t * const packet);
+int  et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const sctp_data_ind);
+void et_s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t * const sctp_data_ind);
+void et_s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p,
+                                  net_ip_address_t    *mme_ip_address,
+                                  net_ip_address_t    *local_ip_addr,
+                                  uint16_t             in_streams,
+                                  uint16_t             out_streams);
+void et_s1ap_handle_s1_setup_message(s1ap_eNB_mme_data_t *mme_desc_p, int sctp_shutdown);
+void et_s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *s1ap_register_eNB);
+void et_s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp);
+void * et_s1ap_eNB_task(void *arg);
+//-------------------------
+int et_generate_xml_scenario(
+    const char const * xml_in_dir_name,
+    const char const * xml_in_scenario_filename,
+    const char const * enb_config_filename,
+          char const * tsml_out_scenario_filename);
+//-------------------------
+void timeval_add (struct timeval * const result, const struct timeval * const a, const struct timeval * const b);
+int timeval_subtract (struct timeval * const result, struct timeval * const a, struct timeval * const b);
+void et_scenario_wait_rx_packet(et_packet_t * const packet);
+void et_scenario_schedule_tx_packet(et_packet_t * packet);
+et_fsm_state_t et_scenario_fsm_notify_event_state_running(et_event_t event);
+et_fsm_state_t et_scenario_fsm_notify_event_state_waiting_tx(et_event_t event);
+et_fsm_state_t et_scenario_fsm_notify_event_state_waiting_rx(et_event_t event);
+et_fsm_state_t et_scenario_fsm_notify_event_state_connecting_s1c(et_event_t event);
+et_fsm_state_t et_scenario_fsm_notify_event_state_null(et_event_t event);
+et_fsm_state_t et_scenario_fsm_notify_event(et_event_t event);
+//-------------------------
+void et_parse_s1ap(xmlDocPtr doc, const xmlNode const *s1ap_node, et_s1ap_t * const s1ap);
+void et_parse_sctp_data_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_datahdr_t * const sctp_hdr);
+void et_parse_sctp_init_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_inithdr_t * const sctp_hdr);
+void et_parse_sctp_init_ack_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_initackhdr_t * const sctp_hdr);
+void et_parse_sctp(xmlDocPtr doc, const xmlNode const *sctp_node, et_sctp_hdr_t * const sctp_hdr);
+et_packet_t* et_parse_xml_packet(xmlDocPtr doc, xmlNodePtr node);
+et_scenario_t* et_generate_scenario(const char  * const et_scenario_filename);
+//-------------------------
+asn_comp_rval_t * et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1, s1ap_message * const m2, const uint32_t constraints);
+void update_xpath_node_mme_ue_s1ap_id(et_s1ap_t * const s1ap, xmlNode *node, const S1ap_MME_UE_S1AP_ID_t new_id);
+void update_xpath_nodes_mme_ue_s1ap_id(et_s1ap_t * const s1ap_payload, xmlNodeSetPtr nodes, const S1ap_MME_UE_S1AP_ID_t new_id);
+int et_s1ap_update_mme_ue_s1ap_id(et_packet_t * const packet, const S1ap_MME_UE_S1AP_ID_t old_id, const S1ap_MME_UE_S1AP_ID_t new_id);
+//-------------------------
+asn_comp_rval_t * et_sctp_data_is_matching(sctp_datahdr_t * const sctp1, sctp_datahdr_t * const sctp2, const uint32_t constraints);
+asn_comp_rval_t * et_sctp_is_matching(et_sctp_hdr_t * const sctp1, et_sctp_hdr_t * const sctp2, const uint32_t constraints);
+//------------------------------------------------------------------------------
+void et_print_hex_octets(const unsigned char * const byte_stream, const unsigned long int num);
+int  et_is_file_exists ( const char const * file_nameP, const char const *file_roleP);
+int  et_strip_extension( char *in_filename);
+void et_get_shift_arg( char * line_argument, shift_packet_t * const shift);
+int  et_split_path     ( char * pathP, char *** resP);
+void et_display_node   ( xmlNodePtr node, unsigned int indent);
+void et_display_tree   ( xmlNodePtr node, unsigned int indent);
+char * et_ip2ip_str(const et_ip_t * const ip);
+int et_compare_et_ip_to_net_ip_address(const et_ip_t * const ip, const net_ip_address_t * const net_ip);
+int et_hex2data(unsigned char * const data, const unsigned char * const hexstring, const unsigned int len);
+sctp_cid_t et_chunk_type_str2cid(const xmlChar * const chunk_type_str);
+const char * const et_chunk_type_cid2str(const sctp_cid_t chunk_type);
+const char * const et_error_match2str(const int err);
+et_packet_action_t et_action_str2et_action_t(const xmlChar * const action);
+void et_ip_str2et_ip(const xmlChar  * const ip_str, et_ip_t * const ip);
+void et_enb_config_init(const  char const * lib_config_file_name_pP);
+const Enb_properties_array_t *et_enb_config_get(void);
+void et_eNB_app_register(const Enb_properties_array_t *enb_properties);
+void *et_eNB_app_task(void *args_p);
+int et_play_scenario(et_scenario_t* const scenario, const struct shift_packet_s *shifts);
+
+#endif /* PLAY_SCENARIO_H_ */
diff --git a/openair3/TEST/EPC_TEST/play_scenario_decode.c b/openair3/TEST/EPC_TEST/play_scenario_decode.c
new file mode 100644
index 0000000000000000000000000000000000000000..aba1703eb3f4b4b5fcd0d492126ffe0325321045
--- /dev/null
+++ b/openair3/TEST/EPC_TEST/play_scenario_decode.c
@@ -0,0 +1,214 @@
+/*******************************************************************************
+    OpenAirInterface
+    Copyright(c) 1999 - 2014 Eurecom
+
+    OpenAirInterface is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+
+    OpenAirInterface is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenAirInterface.The full GNU General Public License is
+    included in this distribution in the file called "COPYING". If not,
+    see <http://www.gnu.org/licenses/>.
+
+  Contact Information
+  OpenAirInterface Admin: openair_admin@eurecom.fr
+  OpenAirInterface Tech : openair_tech@eurecom.fr
+  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+
+  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+ *******************************************************************************/
+
+/*
+                                play_scenario_decode.c
+                                -------------------
+  AUTHOR  : Lionel GAUTHIER
+  COMPANY : EURECOM
+  EMAIL   : Lionel.Gauthier@eurecom.fr
+ */
+
+#include "intertask_interface.h"
+#include "platform_types.h"
+#include "s1ap_ies_defs.h"
+#include "s1ap_eNB_decoder.h"
+#include "assertions.h"
+#include "play_scenario.h"
+
+//------------------------------------------------------------------------------
+int et_s1ap_decode_initiating_message(s1ap_message *message, S1ap_InitiatingMessage_t *initiating_p)
+{
+  int         ret = -1;
+
+  DevAssert(initiating_p != NULL);
+
+  message->procedureCode = initiating_p->procedureCode;
+  message->criticality   = initiating_p->criticality;
+
+  switch(initiating_p->procedureCode) {
+  case S1ap_ProcedureCode_id_downlinkNASTransport:
+    ret = s1ap_decode_s1ap_downlinknastransporties(&message->msg.s1ap_DownlinkNASTransportIEs,&initiating_p->value);
+    break;
+
+  case S1ap_ProcedureCode_id_InitialContextSetup:
+    ret = s1ap_decode_s1ap_initialcontextsetuprequesties(&message->msg.s1ap_InitialContextSetupRequestIEs, &initiating_p->value);
+    break;
+
+  case S1ap_ProcedureCode_id_UEContextRelease:
+    ret = s1ap_decode_s1ap_uecontextreleasecommandies(&message->msg.s1ap_UEContextReleaseCommandIEs, &initiating_p->value);
+    break;
+
+  case S1ap_ProcedureCode_id_Paging:
+    ret = s1ap_decode_s1ap_pagingies(&message->msg.s1ap_PagingIEs, &initiating_p->value);
+    break;
+
+  case S1ap_ProcedureCode_id_uplinkNASTransport:
+    ret = s1ap_decode_s1ap_uplinknastransporties (&message->msg.s1ap_UplinkNASTransportIEs, &initiating_p->value);
+    break;
+
+  case S1ap_ProcedureCode_id_S1Setup:
+    ret = s1ap_decode_s1ap_s1setuprequesties (&message->msg.s1ap_S1SetupRequestIEs, &initiating_p->value);
+    break;
+
+  case S1ap_ProcedureCode_id_initialUEMessage:
+    ret = s1ap_decode_s1ap_initialuemessageies (&message->msg.s1ap_InitialUEMessageIEs, &initiating_p->value);
+    break;
+
+  case S1ap_ProcedureCode_id_UEContextReleaseRequest:
+    ret = s1ap_decode_s1ap_uecontextreleaserequesties (&message->msg.s1ap_UEContextReleaseRequestIEs, &initiating_p->value);
+    break;
+
+  case S1ap_ProcedureCode_id_UECapabilityInfoIndication:
+    ret = s1ap_decode_s1ap_uecapabilityinfoindicationies (&message->msg.s1ap_UECapabilityInfoIndicationIEs, &initiating_p->value);
+    break;
+
+  case S1ap_ProcedureCode_id_NASNonDeliveryIndication:
+    ret = s1ap_decode_s1ap_nasnondeliveryindication_ies (&message->msg.s1ap_NASNonDeliveryIndication_IEs, &initiating_p->value);
+    break;
+
+  default:
+    AssertFatal( 0 , "Unknown procedure ID (%d) for initiating message\n",
+                 (int)initiating_p->procedureCode);
+    return -1;
+  }
+  return ret;
+}
+
+//------------------------------------------------------------------------------
+int et_s1ap_decode_successful_outcome(s1ap_message *message, S1ap_SuccessfulOutcome_t *successfullOutcome_p)
+{
+  int         ret = -1;
+
+  DevAssert(successfullOutcome_p != NULL);
+
+  message->procedureCode = successfullOutcome_p->procedureCode;
+  message->criticality   = successfullOutcome_p->criticality;
+
+  switch(successfullOutcome_p->procedureCode) {
+  case S1ap_ProcedureCode_id_S1Setup:
+    ret = s1ap_decode_s1ap_s1setupresponseies(
+            &message->msg.s1ap_S1SetupResponseIEs, &successfullOutcome_p->value);
+    break;
+
+  case S1ap_ProcedureCode_id_InitialContextSetup:
+    ret = s1ap_decode_s1ap_initialcontextsetupresponseies (&message->msg.s1ap_InitialContextSetupResponseIEs, &successfullOutcome_p->value);
+    break;
+
+  case S1ap_ProcedureCode_id_UEContextRelease:
+      ret = s1ap_decode_s1ap_uecontextreleasecompleteies (&message->msg.s1ap_UEContextReleaseCompleteIEs, &successfullOutcome_p->value);
+    break;
+
+  default:
+    AssertFatal(0, "Unknown procedure ID (%d) for successfull outcome message\n",
+               (int)successfullOutcome_p->procedureCode);
+    return -1;
+  }
+  return ret;
+}
+
+//------------------------------------------------------------------------------
+int et_s1ap_decode_unsuccessful_outcome(s1ap_message *message, S1ap_UnsuccessfulOutcome_t *unSuccessfullOutcome_p)
+{
+  int ret = -1;
+
+  DevAssert(unSuccessfullOutcome_p != NULL);
+
+  message->procedureCode = unSuccessfullOutcome_p->procedureCode;
+  message->criticality   = unSuccessfullOutcome_p->criticality;
+
+  switch(unSuccessfullOutcome_p->procedureCode) {
+  case S1ap_ProcedureCode_id_S1Setup:
+    ret = s1ap_decode_s1ap_s1setupfailureies(&message->msg.s1ap_S1SetupFailureIEs, &unSuccessfullOutcome_p->value);
+    break;
+
+  case S1ap_ProcedureCode_id_InitialContextSetup:
+    ret = s1ap_decode_s1ap_initialcontextsetupfailureies (&message->msg.s1ap_InitialContextSetupFailureIEs, &unSuccessfullOutcome_p->value);
+    break;
+
+  default:
+    AssertFatal(0,"Unknown procedure ID (%d) for unsuccessfull outcome message\n",
+               (int)unSuccessfullOutcome_p->procedureCode);
+    break;
+  }
+  return ret;
+}
+
+//------------------------------------------------------------------------------
+int et_s1ap_decode_pdu(S1AP_PDU_t * const pdu, s1ap_message * const message, const uint8_t * const buffer, const uint32_t length)
+{
+  asn_dec_rval_t dec_ret;
+
+  DevAssert(buffer != NULL);
+
+  memset((void *)pdu, 0, sizeof(S1AP_PDU_t));
+
+  dec_ret = aper_decode(NULL,
+                        &asn_DEF_S1AP_PDU,
+                        (void **)&pdu,
+                        buffer,
+                        length,
+                        0,
+                        0);
+
+  if (dec_ret.code != RC_OK) {
+    S1AP_ERROR("Failed to decode pdu\n");
+    return -1;
+  }
+
+  message->direction = pdu->present;
+
+  switch(pdu->present) {
+  case S1AP_PDU_PR_initiatingMessage:
+    return et_s1ap_decode_initiating_message(message,
+           &pdu->choice.initiatingMessage);
+
+  case S1AP_PDU_PR_successfulOutcome:
+    return et_s1ap_decode_successful_outcome(message,
+           &pdu->choice.successfulOutcome);
+
+  case S1AP_PDU_PR_unsuccessfulOutcome:
+    return et_s1ap_decode_unsuccessful_outcome(message,
+           &pdu->choice.unsuccessfulOutcome);
+
+  default:
+    AssertFatal(0, "Unknown presence (%d) or not implemented\n", (int)pdu->present);
+    break;
+  }
+  return -1;
+}
+//------------------------------------------------------------------------------
+void et_decode_s1ap(et_s1ap_t * const s1ap)
+{
+  if (NULL != s1ap) {
+    if (et_s1ap_decode_pdu(&s1ap->pdu, &s1ap->message, s1ap->binary_stream, s1ap->binary_stream_allocated_size) < 0) {
+      AssertFatal (0, "ERROR %s() Cannot decode S1AP message!\n", __FUNCTION__);
+    }
+  }
+}
diff --git a/openair3/TEST/EPC_TEST/play_scenario_display.c b/openair3/TEST/EPC_TEST/play_scenario_display.c
new file mode 100644
index 0000000000000000000000000000000000000000..2a924e952c14964cf9bfc759ce802736c630acac
--- /dev/null
+++ b/openair3/TEST/EPC_TEST/play_scenario_display.c
@@ -0,0 +1,314 @@
+/*******************************************************************************
+    OpenAirInterface
+    Copyright(c) 1999 - 2014 Eurecom
+
+    OpenAirInterface is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+
+    OpenAirInterface is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenAirInterface.The full GNU General Public License is
+    included in this distribution in the file called "COPYING". If not,
+    see <http://www.gnu.org/licenses/>.
+
+  Contact Information
+  OpenAirInterface Admin: openair_admin@eurecom.fr
+  OpenAirInterface Tech : openair_tech@eurecom.fr
+  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+
+  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+ *******************************************************************************/
+
+/*
+                                play_scenario_display.c
+                                -------------------
+  AUTHOR  : Lionel GAUTHIER
+  COMPANY : EURECOM
+  EMAIL   : Lionel.Gauthier@eurecom.fr
+ */
+#include <string.h>
+#include <stdio.h>
+
+#include "intertask_interface.h"
+#include "platform_types.h"
+#include "assertions.h"
+#include "s1ap_ies_defs.h"
+#include "s1ap_eNB_decoder.h"
+#include "play_scenario.h"
+//-----------------------------------------------------------------------------
+void et_print_hex_octets(const unsigned char * const byte_stream, const unsigned long int num)
+{
+  unsigned long octet_index = 0;
+
+  if (byte_stream == NULL) {
+    return;
+  }
+
+  fprintf(stdout, "+-----+-------------------------------------------------+\n");
+  fprintf(stdout, "|     |  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f |\n");
+  fprintf(stdout, "+-----+-------------------------------------------------+\n");
+
+  for (octet_index = 0; octet_index < num; octet_index++) {
+    if ((octet_index % 16) == 0) {
+      if (octet_index != 0) {
+        fprintf(stdout, " |\n");
+      }
+
+      fprintf(stdout, " %04ld |", octet_index);
+    }
+
+    /*
+     * Print every single octet in hexadecimal form
+     */
+    fprintf(stdout, " %02x", byte_stream[octet_index]);
+    /*
+     * Align newline and pipes according to the octets in groups of 2
+     */
+  }
+
+  /*
+   * Append enough spaces and put final pipe
+   */
+  unsigned char index;
+
+  for (index = octet_index; index < 16; ++index) {
+    fprintf(stdout, "   ");
+  }
+
+  fprintf(stdout, " |\n");
+}
+
+//------------------------------------------------------------------------------
+void et_display_node(xmlNodePtr node, unsigned int indent)
+{
+  int i = 0;
+  if (node->type == XML_ELEMENT_NODE) {
+    xmlChar *path = xmlGetNodePath(node);
+    for (i=0; i<indent; i++) {
+      printf("  ");
+    }
+    if (node->children != NULL && node->children->type == XML_TEXT_NODE) {
+      xmlChar *content = xmlNodeGetContent(node);
+      printf("%s -> %s\n", path, content);
+      xmlFree(content);
+    } else {
+      printf("%s\n", path);
+    }
+    xmlFree(path);
+  }
+}
+//------------------------------------------------------------------------------
+void et_display_tree(xmlNodePtr node, unsigned int indent)
+{
+  xmlNode *cur_node = NULL;
+
+  for (cur_node = node; cur_node; cur_node = cur_node->next) {
+    if (cur_node->type == XML_ELEMENT_NODE) {
+      et_display_node(cur_node, indent);
+    }
+    et_display_tree(cur_node->children, indent++);
+  }
+}
+//------------------------------------------------------------------------------
+void et_display_packet_s1ap_data(const et_s1ap_t * const s1ap)
+{
+  char       *message_string = NULL;
+
+  if (s1ap) {
+    message_string = calloc(20000, sizeof(char));
+    AssertFatal (NULL != message_string, "ERROR malloc()failed!\n");
+    s1ap_string_total_size = 0;
+    switch(s1ap->pdu.present) {
+    case S1AP_PDU_PR_initiatingMessage:
+      switch(s1ap->pdu.choice.initiatingMessage.procedureCode) {
+      case S1ap_ProcedureCode_id_downlinkNASTransport:      s1ap_xer_print_s1ap_downlinknastransport(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break;
+      case S1ap_ProcedureCode_id_InitialContextSetup:       s1ap_xer_print_s1ap_initialcontextsetuprequest(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break;
+      case S1ap_ProcedureCode_id_UEContextRelease:          s1ap_xer_print_s1ap_uecontextreleasecommand(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break;
+      case S1ap_ProcedureCode_id_Paging:                    s1ap_xer_print_s1ap_paging(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break;
+      case S1ap_ProcedureCode_id_uplinkNASTransport:        s1ap_xer_print_s1ap_uplinknastransport(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break;
+      case S1ap_ProcedureCode_id_S1Setup:                   s1ap_xer_print_s1ap_s1setuprequest(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break;
+      case S1ap_ProcedureCode_id_initialUEMessage:          s1ap_xer_print_s1ap_initialuemessage(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break;
+      case S1ap_ProcedureCode_id_UEContextReleaseRequest:   s1ap_xer_print_s1ap_uecontextreleaserequest(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break;
+      case S1ap_ProcedureCode_id_UECapabilityInfoIndication:s1ap_xer_print_s1ap_uecapabilityinfoindication(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break;
+      case S1ap_ProcedureCode_id_NASNonDeliveryIndication:  s1ap_xer_print_s1ap_nasnondeliveryindication_(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break;
+      default:
+        AssertFatal( 0 , "Unknown procedure ID (%d) for initiating message\n",
+                     (int)s1ap->pdu.choice.initiatingMessage.procedureCode);
+      }
+      break;
+    case S1AP_PDU_PR_successfulOutcome:
+      switch(s1ap->pdu.choice.successfulOutcome.procedureCode) {
+      case S1ap_ProcedureCode_id_S1Setup:                   s1ap_xer_print_s1ap_s1setupresponse(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break;
+      case S1ap_ProcedureCode_id_InitialContextSetup:       s1ap_xer_print_s1ap_initialcontextsetupresponse(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break;
+      case S1ap_ProcedureCode_id_UEContextRelease:          s1ap_xer_print_s1ap_uecontextreleasecomplete(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break;
+      default:
+        AssertFatal(0, "Unknown procedure ID (%d) for successfull outcome message\n",
+                   (int)s1ap->pdu.choice.successfulOutcome.procedureCode);
+      }
+      break;
+
+    case S1AP_PDU_PR_unsuccessfulOutcome:
+      switch(s1ap->pdu.choice.unsuccessfulOutcome.procedureCode) {
+      case S1ap_ProcedureCode_id_S1Setup:                   s1ap_xer_print_s1ap_s1setupfailure(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break;
+      case S1ap_ProcedureCode_id_InitialContextSetup:       s1ap_xer_print_s1ap_initialcontextsetupfailure(s1ap_xer__print2sp, message_string, (s1ap_message *)&s1ap->message);break;
+      default:
+        et_free_pointer(message_string);
+        AssertFatal(0,"Unknown procedure ID (%d) for unsuccessfull outcome message\n",
+                   (int)s1ap->pdu.choice.unsuccessfulOutcome.procedureCode);
+        break;
+      }
+      break;
+    default:
+      AssertFatal(0, "Unknown presence (%d) or not implemented\n", (int)s1ap->pdu.present);
+      break;
+    }
+    fprintf(stdout, "\t\tSCTP.data XML dump:\n%s\n", message_string);
+    et_free_pointer(message_string);
+  }
+}
+//------------------------------------------------------------------------------
+void et_display_packet_sctp_init(const sctp_inithdr_t * const sctp)
+{
+
+  if (sctp) {
+    fprintf(stdout, "\t\tSCTP.init.init_tag               : %u\n", sctp->init_tag);
+    fprintf(stdout, "\t\tSCTP.init.a_rwnd                 : %u\n", sctp->a_rwnd);
+    fprintf(stdout, "\t\tSCTP.init.num_inbound_streams    : %u\n", sctp->num_inbound_streams);
+    fprintf(stdout, "\t\tSCTP.init.num_outbound_streams   : %u\n", sctp->num_outbound_streams);
+    fprintf(stdout, "\t\tSCTP.init.initial_tsn            : %u\n", sctp->initial_tsn);
+  }
+}
+//------------------------------------------------------------------------------
+void et_display_packet_sctp_initack(const sctp_initackhdr_t * const sctp)
+{
+
+  if (sctp) {
+    fprintf(stdout, "\t\tSCTP.initack.init_tag               : %u\n", sctp->init_tag);
+    fprintf(stdout, "\t\tSCTP.initack.a_rwnd                 : %u\n", sctp->a_rwnd);
+    fprintf(stdout, "\t\tSCTP.initack.num_inbound_streams    : %u\n", sctp->num_inbound_streams);
+    fprintf(stdout, "\t\tSCTP.initack.num_outbound_streams   : %u\n", sctp->num_outbound_streams);
+    fprintf(stdout, "\t\tSCTP.initack.initial_tsn            : %u\n", sctp->initial_tsn);
+  }
+}
+//------------------------------------------------------------------------------
+void et_display_packet_sctp_data(const sctp_datahdr_t * const sctp)
+{
+  if (sctp) {
+    fprintf(stdout, "\t\tSCTP.data.tsn                 : %u\n", sctp->tsn);
+    fprintf(stdout, "\t\tSCTP.data.stream              : %u\n", sctp->stream);
+    fprintf(stdout, "\t\tSCTP.data.ssn                 : %u\n", sctp->ssn);
+    fprintf(stdout, "\t\tSCTP.data.ppid                : %u\n", sctp->ppid);
+    if (sctp->ppid == 18) {
+      et_display_packet_s1ap_data(&sctp->payload);
+    }
+    fprintf(stdout, "\t\tSCTP.data.binary_stream_allocated_size : %u\n", sctp->payload.binary_stream_allocated_size);
+    if (NULL != sctp->payload.binary_stream) {
+      fprintf(stdout, "\t\tSCTP.data.binary_stream       :\n");
+      et_print_hex_octets(sctp->payload.binary_stream, sctp->payload.binary_stream_allocated_size);
+    } else {
+      fprintf(stdout, "\t\tSCTP.data.binary_stream       : NULL\n");
+    }
+  }
+}
+
+//------------------------------------------------------------------------------
+void et_display_packet_sctp(const et_sctp_hdr_t * const sctp)
+{
+  if (sctp) {
+    fprintf(stdout, "\t\tSCTP.src_port      : %u\n", sctp->src_port);
+    fprintf(stdout, "\t\tSCTP.dst_port      : %u\n", sctp->dst_port);
+    fprintf(stdout, "\t\tSCTP.chunk_type    : %s\n", et_chunk_type_cid2str(sctp->chunk_type));
+    switch (sctp->chunk_type) {
+      case SCTP_CID_DATA:
+        et_display_packet_sctp_data(&sctp->u.data_hdr);
+        break;
+      case SCTP_CID_INIT:
+        et_display_packet_sctp_initack(&sctp->u.init_hdr);
+        break;
+      case SCTP_CID_INIT_ACK:
+        et_display_packet_sctp_initack(&sctp->u.init_ack_hdr);
+        break;
+      default:
+        ;
+    }
+  }
+}
+//------------------------------------------------------------------------------
+void et_display_packet_ip(const et_ip_hdr_t * const ip)
+{
+  if (ip) {
+    fprintf(stdout, "\t\tSource address      : %s\n", et_ip2ip_str(&ip->src));
+    fprintf(stdout, "\t\tDestination address : %s\n", et_ip2ip_str(&ip->dst));
+  }
+}
+
+//------------------------------------------------------------------------------
+void et_display_packet(const et_packet_t * const packet)
+{
+  if (packet) {
+    fprintf(stdout, "-------------------------------------------------------------------------------\n");
+    fprintf(stdout, "\tPacket:\tnum %u  | original frame number %u \n", packet->packet_number, packet->original_frame_number);
+    fprintf(stdout, "\tPacket:\ttime relative to 1st packet           %ld.%06lu\n",
+        packet->time_relative_to_first_packet.tv_sec, packet->time_relative_to_first_packet.tv_usec);
+    fprintf(stdout, "\tPacket:\ttime relative to last tx packet       %ld.%06lu\n",
+        packet->time_relative_to_last_sent_packet.tv_sec, packet->time_relative_to_last_sent_packet.tv_usec);
+    fprintf(stdout, "\tPacket:\ttime relative to last_received packet %ld.%06lu\n",
+        packet->time_relative_to_last_received_packet.tv_sec, packet->time_relative_to_last_received_packet.tv_usec);
+
+    switch(packet->action) {
+    case   ET_PACKET_ACTION_S1C_SEND:
+      fprintf(stdout, "\tPacket:\tAction SEND\n");
+      break;
+    case   ET_PACKET_ACTION_S1C_RECEIVE:
+      fprintf(stdout, "\tPacket:\tAction RECEIVE\n");
+      break;
+    default:
+      fprintf(stdout, "\tPacket:\tAction UNKNOWN\n");
+    }
+    switch(packet->status) {
+    case   ET_PACKET_STATUS_NONE:
+      fprintf(stdout, "\tPacket:\tStatus NONE\n");
+      break;
+    case   ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT:
+      fprintf(stdout, "\tPacket:\tStatus NOT_TAKEN_IN_ACCOUNT\n");
+      break;
+    case   ET_PACKET_STATUS_SCHEDULED_FOR_SENDING:
+      fprintf(stdout, "\tPacket:\tStatus SCHEDULED_FOR_SENDING\n");
+      break;
+    case   ET_PACKET_STATUS_SENT:
+      fprintf(stdout, "\tPacket:\tStatus SENT\n");
+      break;
+    case   ET_PACKET_STATUS_SCHEDULED_FOR_RECEIVING:
+      fprintf(stdout, "\tPacket:\tStatus SCHEDULED_FOR_RECEIVING\n");
+      break;
+    case   ET_PACKET_STATUS_RECEIVED:
+      fprintf(stdout, "\tPacket:\tStatus RECEIVED\n");
+      break;
+    default:
+      fprintf(stdout, "\tPacket:\tStatus UNKNOWN\n");
+    }
+    et_display_packet_ip(&packet->ip_hdr);
+    et_display_packet_sctp(&packet->sctp_hdr);
+  }
+}
+//------------------------------------------------------------------------------
+void et_display_scenario(const et_scenario_t * const scenario)
+{
+  et_packet_t *packet = NULL;
+  if (scenario) {
+    fprintf(stdout, "Scenario: %s\n", (scenario->name != NULL) ? (char*)scenario->name:"UNKNOWN NAME");
+    packet = scenario->list_packet;
+    while (packet) {
+      et_display_packet(packet);
+      packet = packet->next;
+    }
+  }
+}
diff --git a/openair3/TEST/EPC_TEST/play_scenario_fsm.c b/openair3/TEST/EPC_TEST/play_scenario_fsm.c
new file mode 100644
index 0000000000000000000000000000000000000000..f5b142d2fdbc293d4308a796d7beef6826328192
--- /dev/null
+++ b/openair3/TEST/EPC_TEST/play_scenario_fsm.c
@@ -0,0 +1,567 @@
+/*******************************************************************************
+    OpenAirInterface
+    Copyright(c) 1999 - 2014 Eurecom
+
+    OpenAirInterface is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+
+    OpenAirInterface is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenAirInterface.The full GNU General Public License is
+    included in this distribution in the file called "COPYING". If not,
+    see <http://www.gnu.org/licenses/>.
+
+  Contact Information
+  OpenAirInterface Admin: openair_admin@eurecom.fr
+  OpenAirInterface Tech : openair_tech@eurecom.fr
+  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+
+  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+ *******************************************************************************/
+
+/*
+                                play_scenario_fsm.c
+                                -------------------
+  AUTHOR  : Lionel GAUTHIER
+  COMPANY : EURECOM
+  EMAIL   : Lionel.Gauthier@eurecom.fr
+ */
+#include <stdio.h>
+#include <sys/time.h>
+#include <pthread.h>
+
+#include "intertask_interface.h"
+#include "platform_types.h"
+#include "assertions.h"
+#include "play_scenario.h"
+#include "s1ap_ies_defs.h"
+#include "play_scenario_s1ap_eNB_defs.h"
+#include "timer.h"
+
+//------------------------------------------------------------------------------
+extern int                    g_max_speed;
+//------------------------------------------------------------------------------
+et_scenario_t    *g_scenario  = NULL;
+pthread_mutex_t   g_fsm_lock  = PTHREAD_MUTEX_INITIALIZER;
+et_fsm_state_t    g_fsm_state = ET_FSM_STATE_NULL;
+uint32_t          g_constraints = ET_BIT_MASK_MATCH_SCTP_STREAM | ET_BIT_MASK_MATCH_SCTP_SSN;
+//------------------------------------------------------------------------------
+// it is assumed that if a time is negative tv_sec and tv_usec are both negative
+void timeval_add (struct timeval * const result, const struct timeval * const a, const struct timeval * const b)
+{
+  AssertFatal(((a->tv_sec <= 0) && (a->tv_usec <= 0)) || ((a->tv_sec >= 0) && (a->tv_usec >= 0)), " Bad time format arg a\n");
+  AssertFatal(((b->tv_sec <= 0) && (b->tv_usec <= 0)) || ((b->tv_sec >= 0) && (b->tv_usec >= 0)), " Bad time format arg b\n");
+  // may happen overflows but were are not dealing with very large timings
+  long long int r = a->tv_usec + b->tv_usec + (a->tv_sec + b->tv_sec) * 1000000;
+  result->tv_sec  = r / (long long int)1000000;
+  result->tv_usec = r % (long long int)1000000;
+  if ((result != a) && (result != b)) {
+    LOG_D(ENB_APP, "timeval_add(%ld.%06d, %ld.%06d)=%ld.%06d\n", a->tv_sec, a->tv_usec, b->tv_sec, b->tv_usec, result->tv_sec, result->tv_usec);
+  }
+}
+
+//------------------------------------------------------------------------------
+// it is assumed that if a time is negative tv_sec and tv_usec are both negative
+// return true if result is positive
+int timeval_subtract (struct timeval * const result, struct timeval * const a, struct timeval * const b)
+{
+  AssertFatal(((a->tv_sec <= 0) && (a->tv_usec <= 0)) || ((a->tv_sec >= 0) && (a->tv_usec >= 0)), " Bad time format arg a\n");
+  AssertFatal(((b->tv_sec <= 0) && (b->tv_usec <= 0)) || ((b->tv_sec >= 0) && (b->tv_usec >= 0)), " Bad time format arg b\n");
+  // may happen overflows but were are not dealing with very large timings
+  long long int r = a->tv_usec - b->tv_usec + (a->tv_sec - b->tv_sec) * 1000000;
+  result->tv_sec  = r / (long long int)1000000;
+  result->tv_usec = r % (long long int)1000000;
+  if ((result != a) && (result != b)) {
+    LOG_D(ENB_APP, "timeval_subtract(%ld.%06d, %ld.%06d)=%ld.%06d\n", a->tv_sec, a->tv_usec, b->tv_sec, b->tv_usec, result->tv_sec, result->tv_usec);
+  }
+  return (result->tv_sec >= 0) && (result->tv_usec >= 0);
+}
+
+//------------------------------------------------------------------------------
+void et_scenario_wait_rx_packet(et_packet_t * const packet)
+{
+  packet->status = ET_PACKET_STATUS_SCHEDULED_FOR_RECEIVING;
+  g_fsm_state    = ET_FSM_STATE_WAITING_RX_EVENT;
+  if (timer_setup (ET_FSM_STATE_WAITING_RX_EVENT_DELAY_SEC, 0, TASK_S1AP, INSTANCE_DEFAULT, TIMER_ONE_SHOT,
+        packet, &packet->timer_id) < 0) {
+    AssertFatal(0, " Can not start waiting RX event timer\n");
+  }
+  g_scenario->timer_count++;
+  LOG_D(ENB_APP, "Waiting RX packet num %d original frame number %u\n", packet->packet_number, packet->original_frame_number);
+}
+//------------------------------------------------------------------------------
+void et_scenario_schedule_tx_packet(et_packet_t * packet)
+{
+  s1ap_eNB_instance_t *s1ap_eNB_instance = NULL;
+  struct timeval  now                   = { .tv_sec = 0, .tv_usec = 0 };
+  struct timeval  offset_last_tx_packet = { .tv_sec = 0, .tv_usec = 0 };
+  struct timeval  offset_last_rx_packet = { .tv_sec = 0, .tv_usec = 0 };
+  struct timeval  offset_tx_rx          = { .tv_sec = 0, .tv_usec = 0 };
+  struct timeval  offset                = { .tv_sec = 0, .tv_usec = 0 };
+  int             last_packet_was_rx    = 0;
+  int             we_are_too_late       = 0;
+  int             original_frame_number = -1;
+
+  AssertFatal(NULL != packet, "packet argument is NULL");
+  s1ap_eNB_instance = et_s1ap_eNB_get_instance(packet->enb_instance);
+  AssertFatal(NULL != s1ap_eNB_instance, "Cannot get s1ap_eNB_instance_t for eNB instance %d", packet->enb_instance);
+
+  LOG_D(ENB_APP, "%s\n", __FUNCTION__);
+  g_fsm_state = ET_FSM_STATE_WAITING_TX_EVENT;
+
+  switch (packet->sctp_hdr.chunk_type) {
+    case SCTP_CID_DATA:
+      // check if we can send it now
+      // TODO: BUG we have to discard in scenario all packets that cannot be processed (SACK, COOKIEs, etc)
+      AssertFatal(gettimeofday(&now, NULL) == 0, "gettimeofday failed");
+      timeval_subtract(&offset_last_tx_packet,&now,&g_scenario->time_last_tx_packet);
+      timeval_subtract(&offset_last_rx_packet,&now,&g_scenario->time_last_rx_packet);
+      LOG_D(ENB_APP, "offset_last_tx_packet=%ld.%06d\n", offset_last_tx_packet.tv_sec, offset_last_tx_packet.tv_usec);
+      LOG_D(ENB_APP, "offset_last_rx_packet=%ld.%06d\n", offset_last_rx_packet.tv_sec, offset_last_rx_packet.tv_usec);
+
+      last_packet_was_rx = timeval_subtract(&offset_tx_rx,&offset_last_tx_packet,&offset_last_rx_packet);
+      if (last_packet_was_rx) {
+        LOG_D(ENB_APP, "last_packet_was_rx\n");
+        we_are_too_late = timeval_subtract(&offset,&offset_last_rx_packet,&packet->time_relative_to_last_received_packet);
+        LOG_D(ENB_APP, "we_are_too_late=%d, offset=%ld.%06d\n", we_are_too_late, offset.tv_sec, offset.tv_usec);
+      } else {
+        LOG_D(ENB_APP, "last_packet_was_tx\n");
+        we_are_too_late = timeval_subtract(&offset,&offset_last_tx_packet,&packet->time_relative_to_last_sent_packet);
+        LOG_D(ENB_APP, "we_are_too_late=%d, offset=%ld.%06d\n", we_are_too_late, offset.tv_sec, offset.tv_usec);
+      }
+      if ((0 == we_are_too_late) && (0 == g_max_speed)){
+        // set timer
+        if ((offset.tv_sec <= 0) || (offset.tv_usec <= 0)){
+          offset.tv_sec = -offset.tv_sec;
+          offset.tv_usec = -offset.tv_usec;
+        }
+
+        LOG_D(ENB_APP, "Send packet num %u original frame number %u in %ld.%06d sec\n",
+            packet->packet_number, packet->original_frame_number, offset.tv_sec, offset.tv_usec);
+
+        packet->status = ET_PACKET_STATUS_SCHEDULED_FOR_SENDING;
+        if (timer_setup (offset.tv_sec, offset.tv_usec, TASK_S1AP, INSTANCE_DEFAULT, TIMER_ONE_SHOT,packet, &packet->timer_id) < 0) {
+          AssertFatal(0, " Can not start TX event timer\n");
+        }
+        g_scenario->timer_count++;
+        // Done g_fsm_state = ET_FSM_STATE_WAITING_TX_EVENT;
+      } else {
+        // send immediately
+        AssertFatal(0 == gettimeofday(&packet->timestamp_packet, NULL), "gettimeofday() Failed");
+        original_frame_number = packet->original_frame_number;
+        do {
+          g_scenario->time_last_tx_packet.tv_sec  = packet->timestamp_packet.tv_sec;
+          g_scenario->time_last_tx_packet.tv_usec = packet->timestamp_packet.tv_usec;
+
+          LOG_D(ENB_APP, "Sending packet num %d original frame number %u immediately\n",packet->packet_number, packet->original_frame_number);
+          et_s1ap_eNB_itti_send_sctp_data_req(
+            packet->enb_instance,
+            packet->sctp_hdr.u.data_hdr.assoc_id,
+            packet->sctp_hdr.u.data_hdr.payload.binary_stream,
+            packet->sctp_hdr.u.data_hdr.payload.binary_stream_allocated_size,
+            packet->sctp_hdr.u.data_hdr.stream);
+          packet->status = ET_PACKET_STATUS_SENT;
+          g_scenario->next_packet = g_scenario->next_packet->next;
+          packet = packet->next;
+        } while ((NULL != packet) && (packet->original_frame_number == original_frame_number));
+        g_fsm_state = ET_FSM_STATE_RUNNING;
+      }
+      break;
+    case SCTP_CID_INIT:
+    case SCTP_CID_INIT_ACK:
+      AssertFatal(0, "Invalid case TX packet SCTP_CID_INIT or SCTP_CID_INIT_ACK");
+      break;
+    default:
+      AssertFatal(0, "Invalid case TX packet SCTP_CID %d", packet->sctp_hdr.chunk_type);
+  }
+}
+//------------------------------------------------------------------------------
+et_fsm_state_t et_scenario_fsm_notify_event_state_running(et_event_t event)
+{
+
+  switch (event.code){
+    case ET_EVENT_TICK:
+      while (NULL != g_scenario->next_packet) {
+        LOG_D(ENB_APP, "EVENT_TICK: Considering packet num %d original frame number %u\n", g_scenario->next_packet->packet_number, g_scenario->next_packet->original_frame_number);
+        switch (g_scenario->next_packet->sctp_hdr.chunk_type) {
+          case SCTP_CID_DATA :
+            // no init in this scenario, may be sub-scenario
+            if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_SEND) {
+              if (g_scenario->next_packet->status == ET_PACKET_STATUS_NONE) {
+                et_scenario_schedule_tx_packet(g_scenario->next_packet);
+                pthread_mutex_unlock(&g_fsm_lock);
+
+                et_event_t continue_event;
+                continue_event.code = ET_EVENT_TICK;
+                et_scenario_fsm_notify_event(continue_event);
+
+                return g_fsm_state;
+              } else if (g_scenario->next_packet->status != ET_PACKET_STATUS_SCHEDULED_FOR_SENDING) {
+                AssertFatal(0, "Invalid packet status %d", g_scenario->next_packet->status);
+              }
+            } else if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_RECEIVE) {
+              if (g_scenario->next_packet->status == ET_PACKET_STATUS_RECEIVED) {
+                g_scenario->next_packet    = g_scenario->next_packet->next;
+
+              } else if (g_scenario->next_packet->status == ET_PACKET_STATUS_NONE) {
+                et_scenario_wait_rx_packet(g_scenario->next_packet);
+                pthread_mutex_unlock(&g_fsm_lock);
+                return g_fsm_state;
+              } else {
+                AssertFatal(0, "Invalid packet status %d", g_scenario->next_packet->status);
+              }
+            } else {
+              AssertFatal(0, "Invalid packet action %d", g_scenario->next_packet->action);
+            }
+            break;
+
+          case SCTP_CID_INIT:
+          case SCTP_CID_INIT_ACK:
+          case SCTP_CID_HEARTBEAT:
+          case SCTP_CID_HEARTBEAT_ACK:
+          case SCTP_CID_COOKIE_ECHO:
+          case SCTP_CID_COOKIE_ACK:
+          case SCTP_CID_ECN_ECNE:
+          case SCTP_CID_ECN_CWR:
+            LOG_D(ENB_APP, "EVENT_TICK: Ignoring packet num %d SCTP CID %s\n",
+                g_scenario->next_packet->packet_number,
+                et_chunk_type_cid2str(g_scenario->next_packet->sctp_hdr.chunk_type));
+            g_scenario->next_packet->status = ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT;
+            g_scenario->next_packet = g_scenario->next_packet->next;
+            break;
+
+          case SCTP_CID_ABORT:
+          case SCTP_CID_SHUTDOWN:
+          case SCTP_CID_SHUTDOWN_ACK:
+          case SCTP_CID_ERROR:
+          case SCTP_CID_SHUTDOWN_COMPLETE:
+            AssertFatal(0, "The scenario should be cleaned (packet %s cannot be processed at this time)",
+                et_chunk_type_cid2str(g_scenario->next_packet->sctp_hdr.chunk_type));
+            break;
+
+          default:
+            LOG_D(ENB_APP, "EVENT_TICK: Ignoring packet num %d SCTP CID %s\n",
+                g_scenario->next_packet->packet_number,
+                et_chunk_type_cid2str(g_scenario->next_packet->sctp_hdr.chunk_type));
+            g_scenario->next_packet->status = ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT;
+            g_scenario->next_packet = g_scenario->next_packet->next;
+        }
+      }
+      fprintf(stderr, "No Packet found in this scenario: %s\n", g_scenario->name);
+      g_fsm_state = ET_FSM_STATE_NULL;
+      pthread_mutex_unlock(&g_fsm_lock);
+      if (0 == g_scenario->timer_count) {
+        fprintf(stderr, "End of scenario: %s\n", g_scenario->name);
+        fflush(stderr);
+        fflush(stdout);
+        return 0;
+        //exit(0);
+      }
+      fprintf(stderr, "Remaining timers running: %d\n", g_scenario->timer_count);
+      return g_fsm_state;
+      break;
+    case ET_EVENT_RX_PACKET_TIME_OUT:
+      AssertFatal(0, "Event ET_EVENT_RX_PACKET_TIME_OUT not handled in FSM state ET_FSM_STATE_RUNNING");
+      break;
+    case ET_EVENT_TX_TIMED_PACKET:
+      AssertFatal(0, "Event ET_EVENT_TX_TIMED_PACKET not handled in FSM state ET_FSM_STATE_RUNNING");
+      break;
+    case ET_EVENT_RX_S1AP:
+      et_s1ap_process_rx_packet(&event.u.s1ap_data_ind);
+      break;
+    default:
+      AssertFatal(0, "Case event %d not handled in ET_FSM_STATE_RUNNING", event.code);
+  }
+  pthread_mutex_unlock(&g_fsm_lock);
+  return 0;
+}
+
+//------------------------------------------------------------------------------
+et_fsm_state_t et_scenario_fsm_notify_event_state_waiting_tx(et_event_t event)
+{
+  int           rv                    = 0;
+  int           original_frame_number = -1;
+  et_packet_t  *packet                = NULL;
+
+  switch (event.code){
+    case ET_EVENT_TICK:
+      fprintf(stdout, "EVENT_TICK: waiting for tx event\n");
+      break;
+
+    case ET_EVENT_RX_S1AP:
+      rv = et_s1ap_process_rx_packet(&event.u.s1ap_data_ind);
+      break;
+
+    case ET_EVENT_TX_TIMED_PACKET:
+      // send immediately
+      packet = event.u.tx_timed_packet;
+      AssertFatal(0 == gettimeofday(&packet->timestamp_packet, NULL), "gettimeofday() Failed");
+
+      original_frame_number = packet->original_frame_number;
+      do {
+        g_scenario->time_last_tx_packet.tv_sec  = packet->timestamp_packet.tv_sec;
+        g_scenario->time_last_tx_packet.tv_usec = packet->timestamp_packet.tv_usec;
+
+        LOG_D(ENB_APP, "Sending packet num %d original frame number %u immediately\n",packet->packet_number, packet->original_frame_number);
+        et_s1ap_eNB_itti_send_sctp_data_req(
+            packet->enb_instance,
+            packet->sctp_hdr.u.data_hdr.assoc_id,
+            packet->sctp_hdr.u.data_hdr.payload.binary_stream,
+            packet->sctp_hdr.u.data_hdr.payload.binary_stream_allocated_size,
+            packet->sctp_hdr.u.data_hdr.stream);
+        packet->status = ET_PACKET_STATUS_SENT;
+        packet = packet->next;
+        g_scenario->next_packet    = packet;
+      } while ( (NULL != packet) && (packet->original_frame_number == original_frame_number));
+      g_fsm_state = ET_FSM_STATE_RUNNING;
+      break;
+
+    case ET_EVENT_RX_PACKET_TIME_OUT:
+    default:
+      AssertFatal(0, "Case event %d not handled in ET_FSM_STATE_WAITING_TX", event.code);
+  }
+  pthread_mutex_unlock(&g_fsm_lock);
+  return 0;
+}
+
+//------------------------------------------------------------------------------
+et_fsm_state_t et_scenario_fsm_notify_event_state_waiting_rx(et_event_t event)
+{
+  int rv = 0;
+  switch (event.code){
+    case ET_EVENT_TICK:
+      fprintf(stdout, "EVENT_TICK: waiting for rx event\n");
+      break;
+
+    case ET_EVENT_RX_PACKET_TIME_OUT:
+      fprintf(stderr, "Error The following packet is not received:\n");
+      //et_display_packet(event.u.rx_packet_time_out);
+      AssertFatal(0, "Waited packet not received");
+      break;
+
+    case ET_EVENT_RX_S1AP:
+      rv = et_s1ap_process_rx_packet(&event.u.s1ap_data_ind);
+      // waited packet
+      if (rv == 0) {
+        g_fsm_state = ET_FSM_STATE_RUNNING;
+      }
+      break;
+
+    case ET_EVENT_TX_TIMED_PACKET:
+    default:
+      AssertFatal(0, "Case event %d not handled in ET_FSM_STATE_WAITING_RX", event.code);
+  }
+  pthread_mutex_unlock(&g_fsm_lock);
+  return 0;
+}
+
+//------------------------------------------------------------------------------
+et_fsm_state_t et_scenario_fsm_notify_event_state_connecting_s1c(et_event_t event)
+{
+
+  switch (event.code){
+    case ET_EVENT_TICK:
+      break;
+
+    case ET_EVENT_S1C_CONNECTED:
+      // hack simulate we have been able to get the right timing values for STCP connect
+      AssertFatal(gettimeofday(&g_scenario->time_last_rx_packet, NULL) == 0, "gettimeofday failed");
+
+      while (NULL != g_scenario->next_packet) {
+        switch (g_scenario->next_packet->sctp_hdr.chunk_type) {
+          case SCTP_CID_DATA :
+            // no init in this scenario, may be sub-scenario
+            if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_SEND) {
+              et_scenario_schedule_tx_packet(g_scenario->next_packet);
+              pthread_mutex_unlock(&g_fsm_lock);
+
+              et_event_t continue_event;
+              continue_event.code = ET_EVENT_TICK;
+              et_scenario_fsm_notify_event(continue_event);
+
+              return g_fsm_state;
+            } else if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_RECEIVE) {
+              if (g_scenario->next_packet->status == ET_PACKET_STATUS_RECEIVED) {
+                g_scenario->last_rx_packet = g_scenario->next_packet;
+                g_scenario->time_last_rx_packet = g_scenario->last_rx_packet->timestamp_packet;
+                g_scenario->next_packet    = g_scenario->next_packet->next;
+
+              } else if (g_scenario->next_packet->status == ET_PACKET_STATUS_NONE) {
+                et_scenario_wait_rx_packet(g_scenario->next_packet);
+                pthread_mutex_unlock(&g_fsm_lock);
+                return g_fsm_state;
+              } else {
+                AssertFatal(0, "Invalid packet status %d", g_scenario->next_packet->status);
+              }
+            } else {
+              AssertFatal(0, "Invalid packet action %d", g_scenario->next_packet->action);
+            }
+             break;
+
+          case SCTP_CID_INIT:
+          case SCTP_CID_INIT_ACK:
+          case SCTP_CID_HEARTBEAT:
+          case SCTP_CID_HEARTBEAT_ACK:
+          case SCTP_CID_COOKIE_ECHO:
+          case SCTP_CID_COOKIE_ACK:
+          case SCTP_CID_ECN_ECNE:
+          case SCTP_CID_ECN_CWR:
+            g_scenario->next_packet->status = ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT;
+            g_scenario->next_packet = g_scenario->next_packet->next;
+            break;
+
+          case SCTP_CID_ABORT:
+          case SCTP_CID_SHUTDOWN:
+          case SCTP_CID_SHUTDOWN_ACK:
+          case SCTP_CID_ERROR:
+          case SCTP_CID_SHUTDOWN_COMPLETE:
+            AssertFatal(0, "The scenario should be cleaned (packet %s cannot be processed at this time)",
+                et_chunk_type_cid2str(g_scenario->next_packet->sctp_hdr.chunk_type));
+            break;
+
+          default:
+            g_scenario->next_packet->status = ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT;
+            g_scenario->next_packet = g_scenario->next_packet->next;
+        }
+      }
+      fprintf(stderr, "No Packet found in this scenario: %s\n", g_scenario->name);
+      g_fsm_state = ET_FSM_STATE_NULL;
+      pthread_mutex_unlock(&g_fsm_lock);
+      if (0 == g_scenario->timer_count) {
+        fprintf(stderr, "End of scenario: %s\n", g_scenario->name);
+        fflush(stderr);
+        fflush(stdout);
+        exit(0);
+      }
+      fprintf(stderr, "Remaining timers running: %d\n", g_scenario->timer_count);
+      return g_fsm_state;
+      break;
+
+    default:
+      AssertFatal(0, "Case event %d not handled in ET_FSM_STATE_CONNECTING_S1C", event.code);
+  }
+  pthread_mutex_unlock(&g_fsm_lock);
+  return 0;
+}
+//------------------------------------------------------------------------------
+et_fsm_state_t et_scenario_fsm_notify_event_state_null(et_event_t event)
+{
+  switch (event.code){
+    case ET_EVENT_TICK:
+      break;
+
+    case ET_EVENT_INIT:
+      AssertFatal(NULL == g_scenario, "Current scenario not ended");
+      g_scenario = event.u.init.scenario;
+      g_scenario->next_packet            = g_scenario->list_packet;
+      g_scenario->last_rx_packet         = NULL;
+      g_scenario->last_tx_packet         = NULL;
+
+      while (NULL != g_scenario->next_packet) {
+        switch (g_scenario->next_packet->sctp_hdr.chunk_type) {
+
+          case SCTP_CID_DATA :
+            // no init in this scenario, may be sub-scenario, ...
+            if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_SEND) {
+              et_scenario_schedule_tx_packet(g_scenario->next_packet);
+              pthread_mutex_unlock(&g_fsm_lock);
+
+              et_event_t continue_event;
+              continue_event.code = ET_EVENT_TICK;
+              et_scenario_fsm_notify_event(continue_event);
+
+              return g_fsm_state;
+            } else if (g_scenario->next_packet->action == ET_PACKET_ACTION_S1C_RECEIVE) {
+              if (g_scenario->next_packet->status == ET_PACKET_STATUS_RECEIVED) {
+                g_scenario->last_rx_packet = g_scenario->next_packet;
+                g_scenario->time_last_rx_packet = g_scenario->last_rx_packet->timestamp_packet;
+                g_scenario->next_packet    = g_scenario->next_packet->next;
+
+              } else if (g_scenario->next_packet->status == ET_PACKET_STATUS_NONE) {
+                et_scenario_wait_rx_packet(g_scenario->next_packet);
+                pthread_mutex_unlock(&g_fsm_lock);
+                return g_fsm_state;
+              } else {
+                AssertFatal(0, "Invalid packet status %d", g_scenario->next_packet->status);
+              }
+            } else {
+              AssertFatal(0, "Invalid packet action %d", g_scenario->next_packet->action);
+            }
+            break;
+
+          case SCTP_CID_INIT:
+          case SCTP_CID_INIT_ACK:
+            g_scenario->enb_properties       = (Enb_properties_array_t *)et_enb_config_get();
+            g_scenario->hash_old_ue_mme_id2ue_mme_id = hashtable_create (256,NULL,NULL);
+            g_scenario->hash_mme2association_id      = hashtable_create (256,NULL,NULL);
+            // Try to register each eNB
+            g_scenario->registered_enb       = 0;
+            g_fsm_state            = ET_FSM_STATE_CONNECTING_S1C;
+            AssertFatal(gettimeofday(&g_scenario->time_last_tx_packet, NULL) == 0, "gettimeofday failed");
+            et_eNB_app_register (g_scenario->enb_properties);
+            pthread_mutex_unlock(&g_fsm_lock);
+            return g_fsm_state;
+            break;
+
+          case SCTP_CID_HEARTBEAT:
+          case SCTP_CID_HEARTBEAT_ACK:
+          case SCTP_CID_COOKIE_ECHO:
+          case SCTP_CID_COOKIE_ACK:
+          case SCTP_CID_ECN_ECNE:
+          case SCTP_CID_ECN_CWR:
+            g_scenario->next_packet->status = ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT;
+            g_scenario->next_packet = g_scenario->next_packet->next;
+            break;
+
+          case SCTP_CID_ABORT:
+          case SCTP_CID_SHUTDOWN:
+          case SCTP_CID_SHUTDOWN_ACK:
+          case SCTP_CID_ERROR:
+          case SCTP_CID_SHUTDOWN_COMPLETE:
+            AssertFatal(0, "The scenario should be cleaned (packet %s cannot be processed at this time)",
+                et_chunk_type_cid2str(g_scenario->next_packet->sctp_hdr.chunk_type));
+            break;
+
+          default:
+            g_scenario->next_packet->status = ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT;
+            g_scenario->next_packet = g_scenario->next_packet->next;
+        }
+      }
+      fprintf(stderr, "No Useful packet found in this scenario: %s\n", g_scenario->name);
+      g_fsm_state = ET_FSM_STATE_NULL;
+      pthread_mutex_unlock(&g_fsm_lock);
+      return g_fsm_state;
+      break;
+
+    default:
+      AssertFatal(0, "Case event %d not handled in ET_FSM_STATE_NULL", event.code);
+  }
+  return 0;
+}
+
+//------------------------------------------------------------------------------
+et_fsm_state_t et_scenario_fsm_notify_event(et_event_t event)
+{
+  AssertFatal((event.code >= ET_EVENT_START) && (event.code < ET_EVENT_END), "Unknown et_event_t.code %d", event.code);
+
+  pthread_mutex_lock(&g_fsm_lock);
+  switch (g_fsm_state){
+    case ET_FSM_STATE_NULL: return et_scenario_fsm_notify_event_state_null(event); break;
+    case ET_FSM_STATE_CONNECTING_S1C: return et_scenario_fsm_notify_event_state_connecting_s1c(event); break;
+    case ET_FSM_STATE_WAITING_TX_EVENT: return et_scenario_fsm_notify_event_state_waiting_tx(event); break;
+    case ET_FSM_STATE_WAITING_RX_EVENT: return et_scenario_fsm_notify_event_state_waiting_rx(event); break;
+    case ET_FSM_STATE_RUNNING: return et_scenario_fsm_notify_event_state_running(event); break;
+    default:
+      AssertFatal(0, "Case fsm_state %d not handled", g_fsm_state);
+  }
+  pthread_mutex_unlock(&g_fsm_lock);
+  return g_fsm_state;
+}
diff --git a/openair3/TEST/EPC_TEST/play_scenario_parse.c b/openair3/TEST/EPC_TEST/play_scenario_parse.c
new file mode 100644
index 0000000000000000000000000000000000000000..e4f7b48c5129ce5b55f42cde51f31b09f1b05d11
--- /dev/null
+++ b/openair3/TEST/EPC_TEST/play_scenario_parse.c
@@ -0,0 +1,600 @@
+/*******************************************************************************
+    OpenAirInterface
+    Copyright(c) 1999 - 2014 Eurecom
+
+    OpenAirInterface is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+
+    OpenAirInterface is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenAirInterface.The full GNU General Public License is
+    included in this distribution in the file called "COPYING". If not,
+    see <http://www.gnu.org/licenses/>.
+
+  Contact Information
+  OpenAirInterface Admin: openair_admin@eurecom.fr
+  OpenAirInterface Tech : openair_tech@eurecom.fr
+  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+
+  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+ *******************************************************************************/
+
+/*
+                                play_scenario_parse.c
+                                -------------------
+  AUTHOR  : Lionel GAUTHIER
+  COMPANY : EURECOM
+  EMAIL   : Lionel.Gauthier@eurecom.fr
+ */
+
+#include <libxml/xmlmemory.h>
+#include <libxml/debugXML.h>
+#include <libxml/xmlIO.h>
+#include <libxml/DOCBparser.h>
+#include <libxml/xinclude.h>
+#include <libxml/catalog.h>
+#include <libxml/xmlreader.h>
+#include <libxslt/xslt.h>
+#include <libxslt/xsltInternals.h>
+#include <libxslt/transform.h>
+#include <libxslt/xsltutils.h>
+#include <sys/time.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include "intertask_interface.h"
+#include "platform_types.h"
+#include "assertions.h"
+#include "play_scenario.h"
+//------------------------------------------------------------------------------
+#define ENB_CONFIG_MAX_XSLT_PARAMS 32
+//------------------------------------------------------------------------------
+extern Enb_properties_array_t g_enb_properties;
+//------------------------------------------------------------------------------
+void et_parse_s1ap(xmlDocPtr doc, const xmlNode const *s1ap_node, et_s1ap_t * const s1ap)
+{
+  xmlNodePtr            cur_node  = NULL;
+  xmlChar              *xml_char  = NULL;
+  xmlChar              *xml_char2  = NULL;
+  unsigned int          size = 0;
+  int                   rc = 0;
+  unsigned int          go_deeper_in_tree = 1;
+
+  if ((NULL != s1ap_node) && (NULL != s1ap)) {
+    // see http://www.xmlsoft.org/html/libxml-tree.html#xmlCopyNode
+    if (NULL == s1ap->doc) {
+      xmlUnlinkNode(s1ap_node);
+      //cur_node = xmlCopyNodeList(s1ap_node);
+      //  arg2: if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable)
+      //cur_node = xmlCopyNode(s1ap_node, 1);
+      //AssertFatal(NULL != cur_node, "xmlCopyNode Failed");
+      s1ap->doc = xmlNewDoc(BAD_CAST "1.0");
+      xmlDocSetRootElement(s1ap->doc, s1ap_node);
+    }
+
+    for (cur_node = (xmlNode *)s1ap_node; cur_node; cur_node = cur_node->next) {
+      go_deeper_in_tree = 1;
+      if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"field"))) {
+        // do not get hidden fields
+        xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"hide");
+        if (NULL != xml_char) {
+          if ((!xmlStrcmp(xml_char, (const xmlChar *)"yes"))) {
+            go_deeper_in_tree = 0;
+          }
+          xmlFree(xml_char);
+        }
+        if (0 < go_deeper_in_tree) {
+          // first get size
+          xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"size");
+          if (NULL != xml_char) {
+            size = strtoul((const char *)xml_char, NULL, 0);
+            xmlFree(xml_char);
+            // second: try to get value (always hex)
+            xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"value");
+            if (NULL != xml_char) {
+              xml_char2 = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"name");
+              fprintf(stdout, "s1ap %p field name %s  size %d value %s\n",s1ap, xml_char2, size, xml_char);
+              xmlFree(xml_char2);
+              // if success to get value, do not parse children
+              //AssertFatal ((xmlStrlen(xml_char) == size), "ERROR %s() mismatch in size %d and strlen %d\n", __FUNCTION__, size, xmlStrlen(xml_char));
+              //if (xmlStrlen(xml_char) == size) {
+              AssertFatal ((s1ap->binary_stream_pos+xmlStrlen(xml_char)/2) <= s1ap->binary_stream_allocated_size,
+                "ERROR in buffer size: binary_stream_pos %d xmlStrlen(xml_char)/2=%d\n", s1ap->binary_stream_pos, xmlStrlen(xml_char)/2);
+              rc = et_hex2data( &s1ap->binary_stream[s1ap->binary_stream_pos], xml_char, xmlStrlen(xml_char));
+              s1ap->binary_stream_pos += xmlStrlen(xml_char)/2;
+              //et_display_node(cur_node, 0);
+              AssertFatal (rc >= 0, "ERROR in converting hex string %s len %d size %d rc %d\n", xml_char, xmlStrlen(xml_char), size, rc);
+              go_deeper_in_tree = 0;
+              //}
+              xmlFree(xml_char);
+            }
+          }
+        }
+      }
+      if (0 < go_deeper_in_tree) {
+        et_parse_s1ap(doc, cur_node->children, s1ap);
+      }
+    }
+  }
+}
+
+//------------------------------------------------------------------------------
+void et_parse_sctp_data_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_datahdr_t * const sctp_hdr)
+{
+  xmlNode              *cur_node  = NULL;
+  xmlChar              *xml_char  = NULL;
+  xmlChar              *xml_char2 = NULL;
+
+  if ((NULL != sctp_node) && (NULL != sctp_hdr)) {
+    xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"name");
+    if (NULL != xml_char) {
+      if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.data_payload_proto_id"))) {
+        xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show");
+        if (NULL != xml_char2) {
+          sctp_hdr->ppid = strtoul((const char *)xml_char2, NULL, 0);
+          xmlFree(xml_char2);
+        }
+      } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.data_sid"))) {
+        xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show");
+        if (NULL != xml_char2) {
+          sctp_hdr->stream = strtoul((const char *)xml_char2, NULL, 16);
+          xmlFree(xml_char2);
+        }
+      } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.data_tsn"))) {
+        xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show");
+        if (NULL != xml_char2) {
+          sctp_hdr->tsn = strtoul((const char *)xml_char2, NULL, 0);
+          xmlFree(xml_char2);
+        }
+      } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.data_ssn"))) {
+        xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show");
+        if (NULL != xml_char2) {
+          sctp_hdr->ssn = strtoul((const char *)xml_char2, NULL, 0);
+          xmlFree(xml_char2);
+        }
+      }
+      xmlFree(xml_char);
+    }
+    for (cur_node = sctp_node->children; cur_node; cur_node = cur_node->next) {
+      et_parse_sctp_data_chunk(doc, cur_node, sctp_hdr);
+    }
+  }
+
+}
+//------------------------------------------------------------------------------
+void et_parse_sctp_init_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_inithdr_t * const sctp_hdr)
+{
+  xmlNode              *cur_node  = NULL;
+  xmlChar              *xml_char  = NULL;
+  xmlChar              *xml_char2 = NULL;
+
+  if ((NULL != sctp_node) && (NULL != sctp_hdr)) {
+    xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"name");
+    if (NULL != xml_char) {
+      if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.init_nr_out_streams"))) {
+        xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value");
+        if (NULL != xml_char2) {
+          sctp_hdr->num_outbound_streams = strtoul((const char *)xml_char2, NULL, 0);
+          xmlFree(xml_char2);
+        }
+      } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.init_nr_in_streams"))) {
+        xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value");
+        if (NULL != xml_char2) {
+          sctp_hdr->num_inbound_streams = strtoul((const char *)xml_char2, NULL, 0);
+          xmlFree(xml_char2);
+        }
+      } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.init_credit"))) {
+        xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value");
+        if (NULL != xml_char2) {
+          sctp_hdr->a_rwnd = strtoul((const char *)xml_char2, NULL, 0);
+          xmlFree(xml_char2);
+        }
+      } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.init_initial_tsn"))) {
+        xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show");
+        if (NULL != xml_char2) {
+          sctp_hdr->initial_tsn = strtoul((const char *)xml_char2, NULL, 0);
+          xmlFree(xml_char2);
+        }
+      } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.init_initiate_tag"))) {
+        xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show");
+        if (NULL != xml_char2) {
+          sctp_hdr->init_tag = strtoul((const char *)xml_char2, NULL, 16);
+          xmlFree(xml_char2);
+        }
+      }
+      xmlFree(xml_char);
+    }
+    for (cur_node = sctp_node->children; cur_node; cur_node = cur_node->next) {
+      et_parse_sctp_init_chunk(doc, cur_node, sctp_hdr);
+    }
+  }
+}
+//------------------------------------------------------------------------------
+void et_parse_sctp_init_ack_chunk(xmlDocPtr doc, const xmlNode const *sctp_node, sctp_initackhdr_t * const sctp_hdr)
+{
+  xmlNode              *cur_node  = NULL;
+  xmlChar              *xml_char  = NULL;
+  xmlChar              *xml_char2 = NULL;
+
+  if ((NULL != sctp_node) && (NULL != sctp_hdr)) {
+    xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"name");
+    if (NULL != xml_char) {
+      if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.initack_nr_out_streams"))) {
+        xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value");
+        if (NULL != xml_char2) {
+          sctp_hdr->num_outbound_streams = strtoul((const char *)xml_char2, NULL, 0);
+          xmlFree(xml_char2);
+        }
+      } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.initack_nr_in_streams"))) {
+        xml_char2 = xmlGetProp((xmlNode *)(xmlNode *)sctp_node, (const xmlChar *)"value");
+        if (NULL != xml_char2) {
+          sctp_hdr->num_inbound_streams = strtoul((const char *)xml_char2, NULL, 0);
+          xmlFree(xml_char2);
+        }
+      } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.initack_credit"))) {
+        xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value");
+        if (NULL != xml_char2) {
+          sctp_hdr->a_rwnd = strtoul((const char *)xml_char2, NULL, 0);
+          xmlFree(xml_char2);
+        }
+      } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.initack_initial_tsn"))) {
+        xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show");
+        if (NULL != xml_char2) {
+          sctp_hdr->initial_tsn = strtoul((const char *)xml_char2, NULL, 0);
+          xmlFree(xml_char2);
+        }
+      } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.initack_initiate_tag"))) {
+        xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"show");
+        if (NULL != xml_char2) {
+          sctp_hdr->init_tag = strtoul((const char *)xml_char2, NULL, 16);
+          xmlFree(xml_char2);
+        }
+      }
+      xmlFree(xml_char);
+    }
+    for (cur_node = sctp_node->children; cur_node; cur_node = cur_node->next) {
+      et_parse_sctp_init_ack_chunk(doc, cur_node, sctp_hdr);
+    }
+  }
+}
+//------------------------------------------------------------------------------
+void et_parse_sctp(xmlDocPtr doc, const xmlNode const *sctp_node, et_sctp_hdr_t * const sctp_hdr)
+{
+  xmlNode              *cur_node  = NULL;
+  xmlChar              *xml_char  = NULL;
+  xmlChar              *xml_char2 = NULL;
+
+  if ((NULL != sctp_node) && (NULL != sctp_hdr)) {
+    if ((!xmlStrcmp(sctp_node->name, (const xmlChar *)"proto"))) {
+      xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"name");
+      if (NULL != xml_char) {
+        if ((!xmlStrcmp(xml_char, (const xmlChar *)"s1ap"))) {
+          xmlFree(xml_char);
+          xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"pos");
+          if (NULL != xml_char) {
+            sctp_hdr->u.data_hdr.payload.xml_stream_pos_offset = strtoul((const char *)xml_char, NULL, 0);
+            xmlFree(xml_char);
+
+            xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"size");
+            if (NULL != xml_char2) {
+              sctp_hdr->u.data_hdr.payload.binary_stream_allocated_size = strtoul((const char *)xml_char2, NULL, 0);
+              sctp_hdr->u.data_hdr.payload.binary_stream     = calloc(1, sctp_hdr->u.data_hdr.payload.binary_stream_allocated_size);
+              sctp_hdr->u.data_hdr.payload.binary_stream_pos = 0;
+              fprintf(stdout, "Allocating payload of sctp_hdr %p %u bytes\n", sctp_hdr, sctp_hdr->u.data_hdr.payload.binary_stream_allocated_size);
+              xmlFree(xml_char2);
+            }
+            et_parse_s1ap(doc, sctp_node, &sctp_hdr->u.data_hdr.payload);
+            et_decode_s1ap(&sctp_hdr->u.data_hdr.payload);
+            return;
+          }
+        }
+        xmlFree(xml_char);
+      }
+    }
+    //if ((cur_node->type == XML_ATTRIBUTE_NODE) || (cur_node->type == XML_ELEMENT_NODE)) {
+    xml_char = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"name");
+    if (NULL != xml_char) {
+      if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.srcport"))) {
+        xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value");
+        if (NULL != xml_char2) {
+          sctp_hdr->src_port = strtoul((const char *)xml_char2, NULL, 16);
+          xmlFree(xml_char2);
+        }
+      } else if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.dstport"))) {
+        xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value");
+        if (NULL != xml_char2) {
+          sctp_hdr->dst_port = strtoul((const char *)xml_char2, NULL, 16);
+          xmlFree(xml_char2);
+        }
+      } else  if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp.chunk_type"))) {
+        xml_char2 = xmlGetProp((xmlNode *)sctp_node, (const xmlChar *)"value");
+        if (NULL != xml_char2) {
+          sctp_hdr->chunk_type = strtoul((const char *)xml_char2, NULL, 0);
+          xmlFree(xml_char2);
+          switch (sctp_hdr->chunk_type) {
+            case SCTP_CID_DATA:
+              et_parse_sctp_data_chunk(doc, sctp_node->parent, &sctp_hdr->u.data_hdr);
+              break;
+            case SCTP_CID_INIT:
+              et_parse_sctp_init_chunk(doc, sctp_node->parent, &sctp_hdr->u.init_hdr);
+              break;
+            case SCTP_CID_INIT_ACK:
+              et_parse_sctp_init_ack_chunk(doc, sctp_node->parent, &sctp_hdr->u.init_ack_hdr);
+              break;
+            default:
+              ;
+          }
+        }
+      }
+    }
+    for (cur_node = sctp_node->children; cur_node; cur_node = cur_node->next) {
+      et_parse_sctp(doc, cur_node, sctp_hdr);
+    }
+  }
+}
+//------------------------------------------------------------------------------
+void et_packet_shift_timing(et_packet_t * const packet, const struct timeval * const shift)
+{
+  timeval_add(&packet->time_relative_to_first_packet, &packet->time_relative_to_first_packet, shift);
+  AssertFatal((packet->time_relative_to_first_packet.tv_sec >= 0) && (packet->time_relative_to_first_packet.tv_usec >= 0),
+      "Bad timing result time_relative_to_first_packet=%d.%d packet num %u, original frame number %u",
+      packet->time_relative_to_first_packet.tv_sec,
+      packet->time_relative_to_first_packet.tv_usec,
+      packet->packet_number,
+      packet->original_frame_number);
+
+  timeval_add(&packet->time_relative_to_last_received_packet, &packet->time_relative_to_last_received_packet, shift);
+  AssertFatal((packet->time_relative_to_last_received_packet.tv_sec >= 0) && (packet->time_relative_to_last_received_packet.tv_usec >= 0),
+      "Bad timing result time_relative_to_last_received_packet=%d.%d packet num %u, original frame number %u",
+      packet->time_relative_to_last_received_packet.tv_sec,
+      packet->time_relative_to_last_received_packet.tv_usec,
+      packet->packet_number,
+      packet->original_frame_number);
+
+  timeval_add(&packet->time_relative_to_last_sent_packet, &packet->time_relative_to_last_sent_packet, shift);
+  AssertFatal((packet->time_relative_to_last_sent_packet.tv_sec >= 0) && (packet->time_relative_to_last_sent_packet.tv_usec >= 0),
+      "Bad timing result time_relative_to_last_sent_packet=%d.%d packet num %u, original frame number %u",
+      packet->time_relative_to_last_sent_packet.tv_sec,
+      packet->time_relative_to_last_sent_packet.tv_usec,
+      packet->packet_number,
+      packet->original_frame_number);
+}
+
+//------------------------------------------------------------------------------
+et_packet_t* et_parse_xml_packet(xmlDocPtr doc, xmlNodePtr node)
+{
+
+  et_packet_t          *packet   = NULL;
+  xmlNode              *cur_node = NULL;
+  xmlChar              *xml_char = NULL;
+  float                 afloat    = (float)0.0;
+  static struct timeval initial_time         = { .tv_sec = 0, .tv_usec = 0 };
+  static struct timeval relative_last_sent_packet     = { .tv_sec = 0, .tv_usec = 0 };
+  static struct timeval relative_last_received_packet = { .tv_sec = 0, .tv_usec = 0 };
+  static char           first_packet          = 1;
+  static char           first_sent_packet     = 1;
+  static char           first_received_packet = 1;
+  static unsigned int   packet_number = 1;
+
+
+  if (NULL != node) {
+    packet = calloc(1, sizeof(*packet));
+
+    xml_char = xmlGetProp(node, (const xmlChar *)"action");
+    packet->action = et_action_str2et_action_t(xml_char);
+    packet->status = ET_PACKET_STATUS_NONE;
+    xmlFree(xml_char);
+    packet->packet_number = packet_number++;
+
+    for (cur_node = node->children; cur_node; cur_node = cur_node->next) {
+      //if (cur_node->type == XML_ELEMENT_NODE) {
+        if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"frame.time_relative"))) {
+          xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"value");
+          afloat = atof((const char*)xml_char);
+          xmlFree(xml_char);
+          fprintf(stdout, "Parsing packet frame.time_relative: %f\n", afloat);
+          packet->time_relative_to_first_packet.tv_sec   = (int)afloat;
+          packet->time_relative_to_first_packet.tv_usec  = (int)((afloat - packet->time_relative_to_first_packet.tv_sec)*1000000.0);
+
+          if (first_packet > 0) {
+            initial_time = packet->time_relative_to_first_packet;
+            packet->time_relative_to_first_packet.tv_sec  = 0;
+            packet->time_relative_to_first_packet.tv_usec = 0;
+            first_packet = 0;
+          } else {
+            timersub(&packet->time_relative_to_first_packet, &initial_time,
+                &packet->time_relative_to_first_packet);
+          }
+        } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"frame.number"))) {
+          xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"value");
+          packet->original_frame_number = strtoul((const char *)xml_char, NULL, 0);
+          fprintf(stdout, "Parsing packet frame.number: %u\n", packet->original_frame_number);
+          xmlFree(xml_char);
+        } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"ip.src"))) {
+          xml_char = xmlNodeListGetString(doc, cur_node->xmlChildrenNode, 1);
+          et_ip_str2et_ip(xml_char, &packet->ip_hdr.src);
+          xmlFree(xml_char);
+        } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"ip.dst"))) {
+          xml_char = xmlNodeListGetString(doc, cur_node->xmlChildrenNode, 1);
+          et_ip_str2et_ip(xml_char, &packet->ip_hdr.dst);
+          xmlFree(xml_char);
+        } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"proto"))) {
+          xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"name");
+          if (NULL != xml_char) {
+            if ((!xmlStrcmp(xml_char, (const xmlChar *)"sctp"))) {
+              et_parse_sctp(doc, cur_node, &packet->sctp_hdr);
+            }
+            xmlFree(xml_char);
+          }
+        } else if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"eNB.instance"))) {
+          xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"value");
+          packet->enb_instance = strtoul((const char *)xml_char, NULL, 0);
+          xmlFree(xml_char);
+        }
+      //}
+    }
+  }
+  return packet;
+}
+//------------------------------------------------------------------------------
+et_scenario_t* et_generate_scenario(
+    const char  * const tsml_out_scenario_filename)
+{
+  xmlDocPtr            doc           = NULL;
+  xmlNodePtr           root          = NULL;
+  xmlNodePtr           node          = NULL;
+  xmlChar             *xml_char      = NULL;
+  et_scenario_t       *scenario      = NULL;
+  et_packet_t          *last_packet  = NULL;
+  et_packet_t          *packet       = NULL;
+  et_packet_t         **next_packet  = NULL;
+
+  doc = xmlParseFile(tsml_out_scenario_filename);
+  if (NULL == doc) {
+    AssertFatal (0, "Could not parse scenario xml file %s!\n", tsml_out_scenario_filename);
+  } else {
+    fprintf(stdout, "Test scenario file to play: %s\n", tsml_out_scenario_filename);
+    //xmlDebugDumpDocument(NULL, doc);
+  }
+
+  // Get root
+  root = xmlDocGetRootElement(doc);
+  if (NULL != root) {
+    if ((!xmlStrcmp(root->name, (const xmlChar *)"scenario"))) {
+      xml_char = xmlGetProp(root, (const xmlChar *)"name");
+      printf("scenario name: %s\n", xml_char);
+      scenario            = calloc(1, sizeof(*scenario));
+      scenario->name      = xml_char; // nodup nofree
+
+      next_packet = &scenario->list_packet;
+      for (node = root->children; node != NULL; node = node->next) {
+        if ((!xmlStrcmp(node->name, (const xmlChar *)"packet"))) {
+          packet = et_parse_xml_packet(doc, node);
+          if (NULL != packet) {
+            // special case: S1AP same frame for 2 packets
+            if (NULL != last_packet) {
+              if (last_packet->original_frame_number == packet->original_frame_number) {
+                // updating because these informations are not in 2nd sctp header (same IP packet)
+                packet->sctp_hdr.dst_port = last_packet->sctp_hdr.dst_port;
+                packet->sctp_hdr.src_port = last_packet->sctp_hdr.src_port;
+              }
+            }
+            *next_packet = packet;
+            next_packet = &packet->next;
+          } else {
+            fprintf(stdout, "WARNING omitted packet\n");
+          }
+        }
+        last_packet = packet;
+      }
+    }
+  } else {
+    fprintf(stderr, "Empty xml document\n");
+  }
+  xmlFreeDoc(doc);
+  xmlCleanupParser();
+  return scenario;
+}
+//------------------------------------------------------------------------------
+int et_generate_xml_scenario(
+    const char const * xml_in_dir_name,
+    const char const * xml_in_scenario_filename,
+    const char const * enb_config_filename,
+          char const * tsml_out_scenario_filename)
+//------------------------------------------------------------------------------
+{
+  //int fd_pdml_in;
+  xsltStylesheetPtr cur = NULL;
+  xmlDocPtr         doc, res;
+  FILE             *play_scenario_file = NULL;
+  const char       *params[2*ENB_CONFIG_MAX_XSLT_PARAMS];
+  int               nb_params = 0;
+  int               i,j;
+  char              astring[1024];
+  struct in_addr    addr;
+  int               ret      = 0;
+
+  memset(astring, 0, sizeof(astring));
+  if (getcwd(astring, sizeof(astring)) != NULL) {
+    fprintf(stdout, "working in %s directory\n", astring);
+  } else {
+    perror("getcwd() ERROR");
+    exit(1);
+  }
+
+
+  xmlSubstituteEntitiesDefault(1);
+  xmlLoadExtDtdDefaultValue = 1;
+  cur = xsltParseStylesheetFile((const xmlChar *)"/usr/share/oai/xsl/play_scenario.xsl");
+  if (NULL == cur) {
+    AssertFatal (0, "Could not parse stylesheet file /usr/share/oai/xsl/play_scenario.xsl!\n");
+  } else {
+    fprintf(stdout, "XSLT style sheet: /usr/share/oai/xsl/play_scenario.xsl\n");
+  }
+
+  doc = xmlParseFile(xml_in_scenario_filename);
+  if (NULL == doc) {
+    AssertFatal (0, "Could not parse scenario xml file %s!\n", xml_in_scenario_filename);
+  } else {
+    fprintf(stdout, "Test scenario file: %s\n", xml_in_scenario_filename);
+  }
+
+  for (i = 0; i < g_enb_properties.number; i++) {
+    // eNB S1-C IPv4 address
+    sprintf(astring, "enb%d_s1c", i);
+    params[nb_params++] = strdup(astring);
+    addr.s_addr = g_enb_properties.properties[i]->enb_ipv4_address_for_S1_MME;
+    sprintf(astring, "\"%s\"", inet_ntoa(addr));
+    params[nb_params++] = strdup(astring);
+
+    // MME S1-C IPv4 address
+    for (j = 0; j < g_enb_properties.properties[i]->nb_mme; j++) {
+      sprintf(astring, "mme%d_s1c_%d", i, j);
+      params[nb_params++] = strdup(astring);
+      AssertFatal (g_enb_properties.properties[i]->mme_ip_address[j].ipv4_address,
+          "Only support MME IPv4 address\n");
+      sprintf(astring, "\"%s\"", g_enb_properties.properties[i]->mme_ip_address[j].ipv4_address);
+      params[nb_params++] = strdup(astring);
+    }
+  }
+  params[nb_params] = NULL;
+  res = xsltApplyStylesheet(cur, doc, params);
+  if (NULL != res) {
+    sprintf((char *)tsml_out_scenario_filename,"%s",xml_in_scenario_filename);
+    if (et_strip_extension((char *)tsml_out_scenario_filename) > 0) {
+      strcat((char *)tsml_out_scenario_filename, ".tsml");
+      play_scenario_file = fopen( tsml_out_scenario_filename, "w+");
+      if (NULL != play_scenario_file) {
+        xsltSaveResultToFile(play_scenario_file, res, cur);
+        fclose(play_scenario_file);
+        fprintf(stdout, "Wrote test scenario to %s\n", tsml_out_scenario_filename);
+      } else {
+        fprintf(stderr, "ERROR in fopen(%s)\n", tsml_out_scenario_filename);
+        ret = -1;
+      }
+    } else {
+      fprintf(stderr, "ERROR in strip_extension()\n");
+      ret = -1;
+    }
+  } else {
+    fprintf(stderr, "ERROR in xsltApplyStylesheet()\n");
+    ret = -1;
+  }
+  xsltFreeStylesheet(cur);
+  xmlFreeDoc(doc);
+  xmlFreeDoc(res);
+
+  xsltCleanupGlobals();
+  xmlCleanupParser();
+  return ret;
+}
+
diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c
new file mode 100644
index 0000000000000000000000000000000000000000..64071981fb6ed646001fe969c492d91de02f9677
--- /dev/null
+++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap.c
@@ -0,0 +1,1175 @@
+/*******************************************************************************
+    OpenAirInterface
+    Copyright(c) 1999 - 2014 Eurecom
+
+    OpenAirInterface is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+
+    OpenAirInterface is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenAirInterface.The full GNU General Public License is
+    included in this distribution in the file called "COPYING". If not,
+    see <http://www.gnu.org/licenses/>.
+
+  Contact Information
+  OpenAirInterface Admin: openair_admin@eurecom.fr
+  OpenAirInterface Tech : openair_tech@eurecom.fr
+  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+
+  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+ *******************************************************************************/
+
+/*
+                                play_scenario_s1ap.c
+                                -------------------
+  AUTHOR  : Lionel GAUTHIER
+  COMPANY : EURECOM
+  EMAIL   : Lionel.Gauthier@eurecom.fr
+ */
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <unistd.h>
+#include <crypt.h>
+#include <sys/time.h>
+#include "tree.h"
+#include "queue.h"
+
+
+#include "intertask_interface.h"
+#include "timer.h"
+#include "platform_types.h"
+#include "assertions.h"
+#include "conversions.h"
+#include "s1ap_common.h"
+#include "play_scenario_s1ap_eNB_defs.h"
+#include "play_scenario.h"
+#include "msc.h"
+//------------------------------------------------------------------------------
+s1ap_eNB_internal_data_t s1ap_eNB_internal_data;
+RB_GENERATE(s1ap_mme_map, s1ap_eNB_mme_data_s, entry, et_s1ap_eNB_compare_assoc_id);
+//------------------------------------------------------------------------------
+extern et_scenario_t  *g_scenario;
+extern uint32_t        g_constraints;
+//------------------------------------------------------------------------------
+int et_s1ap_eNB_compare_assoc_id(
+  struct s1ap_eNB_mme_data_s *p1, struct s1ap_eNB_mme_data_s *p2)
+{
+  if (p1->assoc_id == -1) {
+    if (p1->cnx_id < p2->cnx_id) {
+      return -1;
+    }
+    if (p1->cnx_id > p2->cnx_id) {
+      return 1;
+    }
+  } else {
+    if (p1->assoc_id < p2->assoc_id) {
+      return -1;
+    }
+    if (p1->assoc_id > p2->assoc_id) {
+      return 1;
+    }
+  }
+
+  /* Matching reference */
+  return 0;
+}
+//------------------------------------------------------------------------------
+uint32_t et_s1ap_generate_eNB_id(void)
+{
+  char    *out;
+  char     hostname[50];
+  int      ret;
+  uint32_t eNB_id;
+
+  /* Retrieve the host name */
+  ret = gethostname(hostname, sizeof(hostname));
+  DevAssert(ret == 0);
+
+  out = crypt(hostname, "eurecom");
+  DevAssert(out != NULL);
+
+  eNB_id = ((out[0] << 24) | (out[1] << 16) | (out[2] << 8) | out[3]);
+
+  return eNB_id;
+}
+//------------------------------------------------------------------------------
+uint16_t et_s1ap_eNB_fetch_add_global_cnx_id(void)
+{
+  return ++s1ap_eNB_internal_data.global_cnx_id;
+}
+
+//------------------------------------------------------------------------------
+void et_s1ap_eNB_prepare_internal_data(void)
+{
+  memset(&s1ap_eNB_internal_data, 0, sizeof(s1ap_eNB_internal_data));
+  STAILQ_INIT(&s1ap_eNB_internal_data.s1ap_eNB_instances_head);
+}
+
+//------------------------------------------------------------------------------
+void et_s1ap_eNB_insert_new_instance(s1ap_eNB_instance_t *new_instance_p)
+{
+  DevAssert(new_instance_p != NULL);
+
+  STAILQ_INSERT_TAIL(&s1ap_eNB_internal_data.s1ap_eNB_instances_head,
+                     new_instance_p, s1ap_eNB_entries);
+}
+
+//------------------------------------------------------------------------------
+struct s1ap_eNB_mme_data_s *et_s1ap_eNB_get_MME(
+  s1ap_eNB_instance_t *instance_p,
+  int32_t assoc_id, uint16_t cnx_id)
+{
+  struct s1ap_eNB_mme_data_s  temp;
+  struct s1ap_eNB_mme_data_s *found;
+
+  memset(&temp, 0, sizeof(struct s1ap_eNB_mme_data_s));
+
+  temp.assoc_id = assoc_id;
+  temp.cnx_id   = cnx_id;
+
+  if (instance_p == NULL) {
+    STAILQ_FOREACH(instance_p, &s1ap_eNB_internal_data.s1ap_eNB_instances_head,
+                   s1ap_eNB_entries) {
+      found = RB_FIND(s1ap_mme_map, &instance_p->s1ap_mme_head, &temp);
+
+      if (found != NULL) {
+        return found;
+      }
+    }
+  } else {
+    return RB_FIND(s1ap_mme_map, &instance_p->s1ap_mme_head, &temp);
+  }
+
+  return NULL;
+}
+
+//------------------------------------------------------------------------------
+s1ap_eNB_instance_t *et_s1ap_eNB_get_instance(instance_t instance)
+{
+  s1ap_eNB_instance_t *temp = NULL;
+
+  STAILQ_FOREACH(temp, &s1ap_eNB_internal_data.s1ap_eNB_instances_head,
+                 s1ap_eNB_entries) {
+    if (temp->instance == instance) {
+      /* Matching occurence */
+      return temp;
+    }
+  }
+
+  return NULL;
+}
+//------------------------------------------------------------------------------
+void et_s1ap_eNB_itti_send_sctp_data_req(instance_t instance, int32_t assoc_id, uint8_t *buffer,
+                                      uint32_t buffer_length, uint16_t stream)
+{
+  MessageDef      *message_p;
+  sctp_data_req_t *sctp_data_req;
+
+  message_p = itti_alloc_new_message(TASK_S1AP, SCTP_DATA_REQ);
+
+  sctp_data_req = &message_p->ittiMsg.sctp_data_req;
+
+  sctp_data_req->assoc_id      = assoc_id;
+  sctp_data_req->buffer        = buffer;
+  sctp_data_req->buffer_length = buffer_length;
+  sctp_data_req->stream        = stream;
+
+  itti_send_msg_to_task(TASK_SCTP, instance, message_p);
+}
+//------------------------------------------------------------------------------
+int et_handle_s1ap_mismatch_mme_ue_s1ap_id(et_packet_t * const spacket, et_packet_t * const rx_packet)
+{
+  S1ap_MME_UE_S1AP_ID_t scenario_mme_ue_s1ap_id = 0;
+  S1ap_MME_UE_S1AP_ID_t rx_mme_ue_s1ap_id       = 0;
+  S1AP_PDU_PR           present;
+
+  present = rx_packet->sctp_hdr.u.data_hdr.payload.pdu.present;
+
+  switch (rx_packet->sctp_hdr.u.data_hdr.payload.message.procedureCode) {
+    case  S1ap_ProcedureCode_id_HandoverPreparation:
+      if (present == S1AP_PDU_PR_initiatingMessage) {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequiredIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequiredIEs.mme_ue_s1ap_id;
+      } else {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverCommandIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverCommandIEs.mme_ue_s1ap_id;
+      }
+      break;
+
+    case  S1ap_ProcedureCode_id_HandoverResourceAllocation:
+      if (present == S1AP_PDU_PR_initiatingMessage) {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequestIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequestIEs.mme_ue_s1ap_id;
+      } else if (present == S1AP_PDU_PR_successfulOutcome) {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequestAcknowledgeIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverRequestAcknowledgeIEs.mme_ue_s1ap_id;
+      } else if (present == S1AP_PDU_PR_unsuccessfulOutcome) {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverFailureIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverFailureIEs.mme_ue_s1ap_id;
+      }
+      break;
+
+    case  S1ap_ProcedureCode_id_HandoverNotification:
+      rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverNotifyIEs.mme_ue_s1ap_id;
+      scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverNotifyIEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_PathSwitchRequest:
+      //rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_PathSwitchRequestIEs.mme_ue_s1ap_id;
+      //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_PathSwitchRequestIEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_HandoverCancel:
+      rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverCancelIEs.mme_ue_s1ap_id;
+      scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_HandoverCancelIEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_E_RABSetup:
+      if (present == S1AP_PDU_PR_initiatingMessage) {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABSetupRequestIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABSetupRequestIEs.mme_ue_s1ap_id;
+      } else  {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABSetupResponseIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABSetupResponseIEs.mme_ue_s1ap_id;
+      }
+      break;
+
+    case  S1ap_ProcedureCode_id_E_RABModify:
+      if (present == S1AP_PDU_PR_initiatingMessage) {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABModifyRequestIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABModifyRequestIEs.mme_ue_s1ap_id;
+      } else  {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABModifyResponseIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABModifyResponseIEs.mme_ue_s1ap_id;
+      }
+      break;
+
+    case  S1ap_ProcedureCode_id_E_RABRelease:
+      if (present == S1AP_PDU_PR_initiatingMessage) {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABReleaseCommandIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABReleaseCommandIEs.mme_ue_s1ap_id;
+      } else  {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABReleaseResponseIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABReleaseResponseIEs.mme_ue_s1ap_id;
+      }
+      break;
+
+    case  S1ap_ProcedureCode_id_E_RABReleaseIndication:
+      rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABReleaseIndicationIEs.mme_ue_s1ap_id;
+      scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_E_RABReleaseIndicationIEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_InitialContextSetup:
+      if (present == S1AP_PDU_PR_initiatingMessage) {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_InitialContextSetupRequestIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_InitialContextSetupRequestIEs.mme_ue_s1ap_id;
+      } else  {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_InitialContextSetupResponseIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_InitialContextSetupResponseIEs.mme_ue_s1ap_id;
+      }
+      break;
+
+    case  S1ap_ProcedureCode_id_Paging:
+      //rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_PagingIEs.mme_ue_s1ap_id;
+      //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_PagingIEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_downlinkNASTransport:
+      rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkNASTransportIEs.mme_ue_s1ap_id;
+      scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkNASTransportIEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_initialUEMessage:
+      //rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_InitialUEMessageIEs.mme_ue_s1ap_id;
+      //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_InitialUEMessageIEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_uplinkNASTransport:
+      rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkNASTransportIEs.mme_ue_s1ap_id;
+      scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkNASTransportIEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_Reset:
+      //rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ResetIEs.mme_ue_s1ap_id;
+      //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ResetIEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_ErrorIndication:
+      rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ErrorIndicationIEs.mme_ue_s1ap_id;
+      scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ErrorIndicationIEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_NASNonDeliveryIndication:
+      rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_NASNonDeliveryIndication_IEs.mme_ue_s1ap_id;
+      scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_NASNonDeliveryIndication_IEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_S1Setup:
+      /*if (present == S1AP_PDU_PR_initiatingMessage) {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupRequestIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupRequestIEs.mme_ue_s1ap_id;
+      } else if (present == S1AP_PDU_PR_successfulOutcome) {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupResponseIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupResponseIEs.mme_ue_s1ap_id;
+      } else if (present == S1AP_PDU_PR_unsuccessfulOutcome) {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupFailureIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_S1SetupFailureIEs.mme_ue_s1ap_id;
+      }*/
+      break;
+
+    case  S1ap_ProcedureCode_id_UEContextReleaseRequest:
+      rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseRequestIEs.mme_ue_s1ap_id;
+      scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseRequestIEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_DownlinkS1cdma2000tunneling:
+      rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkS1cdma2000tunnelingIEs.mme_ue_s1ap_id;
+      scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkS1cdma2000tunnelingIEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_UplinkS1cdma2000tunneling:
+      rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkS1cdma2000tunnelingIEs.mme_ue_s1ap_id;
+      scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkS1cdma2000tunnelingIEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_UEContextModification:
+      if (present == S1AP_PDU_PR_initiatingMessage) {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextModificationRequestIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextModificationRequestIEs.mme_ue_s1ap_id;
+      } else if (present == S1AP_PDU_PR_successfulOutcome) {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextModificationResponseIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextModificationResponseIEs.mme_ue_s1ap_id;
+      } else if (present == S1AP_PDU_PR_unsuccessfulOutcome) {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextModificationFailureIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextModificationFailureIEs.mme_ue_s1ap_id;
+      }
+      break;
+
+    case  S1ap_ProcedureCode_id_UECapabilityInfoIndication:
+      rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UECapabilityInfoIndicationIEs.mme_ue_s1ap_id;
+      scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UECapabilityInfoIndicationIEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_UEContextRelease:
+      if (present == S1AP_PDU_PR_initiatingMessage) {
+        switch (rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCommandIEs.uE_S1AP_IDs.present) {
+          case S1ap_UE_S1AP_IDs_PR_uE_S1AP_ID_pair:
+            rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCommandIEs.uE_S1AP_IDs.choice.uE_S1AP_ID_pair.mME_UE_S1AP_ID;
+            scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCommandIEs.uE_S1AP_IDs.choice.uE_S1AP_ID_pair.mME_UE_S1AP_ID;
+            break;
+          case S1ap_UE_S1AP_IDs_PR_mME_UE_S1AP_ID:
+            rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCommandIEs.uE_S1AP_IDs.choice.mME_UE_S1AP_ID;
+            scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCommandIEs.uE_S1AP_IDs.choice.mME_UE_S1AP_ID;
+            break;
+        }
+      } else  {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCompleteIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UEContextReleaseCompleteIEs.mme_ue_s1ap_id;
+      }
+      break;
+
+    case  S1ap_ProcedureCode_id_eNBStatusTransfer:
+      rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBStatusTransferIEs.mme_ue_s1ap_id;
+      scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBStatusTransferIEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_MMEStatusTransfer:
+      rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEStatusTransferIEs.mme_ue_s1ap_id;
+      scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEStatusTransferIEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_DeactivateTrace:
+      rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DeactivateTraceIEs.mme_ue_s1ap_id;
+      scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DeactivateTraceIEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_TraceStart:
+      rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_TraceStartIEs.mme_ue_s1ap_id;
+      scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_TraceStartIEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_TraceFailureIndication:
+      rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_TraceFailureIndicationIEs.mme_ue_s1ap_id;
+      scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_TraceFailureIndicationIEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_ENBConfigurationUpdate:
+      /*if (present == S1AP_PDU_PR_initiatingMessage) {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateIEs.mme_ue_s1ap_id;
+      } else if (present == S1AP_PDU_PR_successfulOutcome) {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateAcknowledgeIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateAcknowledgeIEs.mme_ue_s1ap_id;
+      } else {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateFailureIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBConfigurationUpdateFailureIEs.mme_ue_s1ap_id;
+      }*/
+      break;
+
+    case  S1ap_ProcedureCode_id_MMEConfigurationUpdate:
+      /*if (present == S1AP_PDU_PR_initiatingMessage) {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateIEs.mme_ue_s1ap_id;
+      } else if (present == S1AP_PDU_PR_successfulOutcome) {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateAcknowledgeIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateAcknowledgeIEs.mme_ue_s1ap_id;
+      } else {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateFailureIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEConfigurationUpdateFailureIEs.mme_ue_s1ap_id;
+      }*/
+      break;
+
+    case  S1ap_ProcedureCode_id_LocationReportingControl:
+      rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_LocationReportingControlIEs.mme_ue_s1ap_id;
+      scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_LocationReportingControlIEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_LocationReportingFailureIndication:
+      rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_LocationReportingFailureIndicationIEs.mme_ue_s1ap_id;
+      scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_LocationReportingFailureIndicationIEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_LocationReport:
+      rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_LocationReportIEs.mme_ue_s1ap_id;
+      scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_LocationReportIEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_OverloadStart:
+      //rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_OverloadStartIEs.mme_ue_s1ap_id;
+      //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_OverloadStartIEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_OverloadStop:
+      //rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_OverloadStopIEs.mme_ue_s1ap_id;
+      //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_OverloadStopIEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_WriteReplaceWarning:
+      /*if (present == S1AP_PDU_PR_initiatingMessage) {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_WriteReplaceWarningRequestIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_WriteReplaceWarningRequestIEs.mme_ue_s1ap_id;
+      } else  {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_WriteReplaceWarningResponseIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_WriteReplaceWarningResponseIEs.mme_ue_s1ap_id;
+      }*/
+      break;
+
+    case  S1ap_ProcedureCode_id_eNBDirectInformationTransfer:
+      //rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBDirectInformationTransferIEs.mme_ue_s1ap_id;
+      //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_ENBDirectInformationTransferIEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_MMEDirectInformationTransfer:
+      //rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEDirectInformationTransferIEs.mme_ue_s1ap_id;
+      //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_MMEDirectInformationTransferIEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_PrivateMessage:
+    case  S1ap_ProcedureCode_id_eNBConfigurationTransfer:
+    case  S1ap_ProcedureCode_id_MMEConfigurationTransfer:
+      AssertFatal(0, "TODO");
+      break;
+
+    case  S1ap_ProcedureCode_id_CellTrafficTrace:
+      rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_CellTrafficTraceIEs.mme_ue_s1ap_id;
+      scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_CellTrafficTraceIEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_Kill:
+      /*if (present == S1AP_PDU_PR_initiatingMessage) {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_KillRequestIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_KillRequestIEs.mme_ue_s1ap_id;
+      } else  {
+        rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_KillResponseIEs.mme_ue_s1ap_id;
+        scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_KillResponseIEs.mme_ue_s1ap_id;
+      }*/
+      break;
+
+    case  S1ap_ProcedureCode_id_downlinkUEAssociatedLPPaTransport:
+      rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id;
+      scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_uplinkUEAssociatedLPPaTransport:
+      rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id;
+      scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_downlinkNonUEAssociatedLPPaTransport:
+      //rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkNonUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id;
+      //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_DownlinkNonUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id;
+      break;
+
+    case  S1ap_ProcedureCode_id_uplinkNonUEAssociatedLPPaTransport:
+      //rx_mme_ue_s1ap_id       = rx_packet->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkNonUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id;
+      //scenario_mme_ue_s1ap_id = spacket->sctp_hdr.u.data_hdr.payload.message.msg.s1ap_UplinkNonUEAssociatedLPPaTransport_IEs.mme_ue_s1ap_id;
+      break;
+
+    default:
+      AssertFatal(0, "Unknown procedure code %ld", rx_packet->sctp_hdr.u.data_hdr.payload.message.procedureCode);
+  }
+  if (scenario_mme_ue_s1ap_id != rx_mme_ue_s1ap_id) {
+    S1AP_DEBUG("%s() Updating  mme_ue_s1ap_id %u -> %u \n", __FUNCTION__, scenario_mme_ue_s1ap_id, rx_mme_ue_s1ap_id);
+    et_packet_t * p = spacket;
+    while (p) {
+      et_s1ap_update_mme_ue_s1ap_id(p, scenario_mme_ue_s1ap_id, rx_mme_ue_s1ap_id);
+      p = p->next;
+    }
+    return 0;
+  }
+  return 1;
+}
+//------------------------------------------------------------------------------
+asn_comp_rval_t * et_s1ap_is_matching(et_s1ap_t * const s1ap1, et_s1ap_t * const s1ap2, const uint32_t constraints)
+{
+  asn_comp_rval_t *rv = NULL;
+  if (s1ap1->pdu.present != s1ap2->pdu.present)  {rv  = calloc(1, sizeof(asn_comp_rval_t)); rv->err_code = ET_ERROR_MATCH_PACKET_S1AP_PRESENT; return rv;}
+  switch (s1ap1->pdu.present) {
+    case  S1AP_PDU_PR_NOTHING:
+      break;
+    case  S1AP_PDU_PR_initiatingMessage:
+      if (s1ap1->pdu.choice.initiatingMessage.procedureCode != s1ap2->pdu.choice.initiatingMessage.procedureCode)
+        {rv  = calloc(1, sizeof(asn_comp_rval_t)); rv->err_code = ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE; return rv;}
+      if (s1ap1->pdu.choice.initiatingMessage.criticality != s1ap2->pdu.choice.initiatingMessage.criticality)
+        {rv  = calloc(1, sizeof(asn_comp_rval_t)); rv->err_code = ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY; return rv;}
+      break;
+    case  S1AP_PDU_PR_successfulOutcome:
+      if (s1ap1->pdu.choice.successfulOutcome.procedureCode != s1ap2->pdu.choice.successfulOutcome.procedureCode)
+        {rv  = calloc(1, sizeof(asn_comp_rval_t)); rv->err_code = ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE; return rv;}
+      if (s1ap1->pdu.choice.successfulOutcome.criticality != s1ap2->pdu.choice.successfulOutcome.criticality)
+        {rv  = calloc(1, sizeof(asn_comp_rval_t)); rv->err_code = ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY; return rv;}
+      break;
+    case  S1AP_PDU_PR_unsuccessfulOutcome:
+      if (s1ap1->pdu.choice.unsuccessfulOutcome.procedureCode != s1ap2->pdu.choice.unsuccessfulOutcome.procedureCode)
+        {rv  = calloc(1, sizeof(asn_comp_rval_t)); rv->err_code = ET_ERROR_MATCH_PACKET_S1AP_PROCEDURE_CODE; return rv;}
+      if (s1ap1->pdu.choice.unsuccessfulOutcome.criticality != s1ap2->pdu.choice.unsuccessfulOutcome.criticality)
+        {rv  = calloc(1, sizeof(asn_comp_rval_t)); rv->err_code = ET_ERROR_MATCH_PACKET_S1AP_CRITICALITY; return rv;}
+      break;
+    default:
+      AssertFatal(0, "Unknown pdu.present %d", s1ap1->pdu.present);
+  }
+
+  if (s1ap1->binary_stream_allocated_size == s1ap2->binary_stream_allocated_size) {
+    if (memcmp((void*)s1ap1->binary_stream, (void*)s1ap2->binary_stream, s1ap1->binary_stream_allocated_size) ==  0) return NULL;
+  }
+  // if no matching, may be the scenario need minor corrections (same enb_ue_s1ap_id but need to update mme_ue_s1ap_id)
+  return et_s1ap_ies_is_matching(s1ap1->pdu.present, &s1ap1->message, &s1ap2->message, constraints);
+}
+
+//------------------------------------------------------------------------------
+et_packet_t* et_build_packet_from_s1ap_data_ind(et_event_s1ap_data_ind_t * const s1ap_data_ind)
+{
+  et_packet_t     * packet    = NULL;
+  AssertFatal (NULL != s1ap_data_ind, "Bad parameter sctp_data_ind\n");
+  packet = calloc(1, sizeof(*packet));
+  packet->action                                        = ET_PACKET_ACTION_S1C_NULL;
+  //packet->time_relative_to_first_packet.tv_sec          = 0;
+  //packet->time_relative_to_first_packet.tv_usec         = 0;
+  //packet->time_relative_to_last_sent_packet.tv_sec      = 0;
+  //packet->time_relative_to_last_sent_packet.tv_usec     = 0;
+  //packet->time_relative_to_last_received_packet.tv_sec  = 0;
+  //packet->time_relative_to_last_received_packet.tv_usec = 0;
+  //packet->original_frame_number                         = 0;
+  //packet->packet_number                                 = 0;
+  packet->enb_instance = 0; //TODO
+  //packet->ip_hdr;
+  // keep in mind: allocated buffer: sctp_datahdr.payload.binary_stream
+  packet->sctp_hdr.chunk_type = SCTP_CID_DATA;
+  memcpy((void*)&packet->sctp_hdr.u.data_hdr, (void*)&s1ap_data_ind->sctp_datahdr, sizeof(packet->sctp_hdr));
+  //packet->next = NULL;
+  packet->status = ET_PACKET_STATUS_RECEIVED;
+  //packet->timer_id = 0;
+  AssertFatal(0 == gettimeofday(&packet->timestamp_packet, NULL), "gettimeofday() Failed");
+  return packet;
+}
+
+
+//------------------------------------------------------------------------------
+// return 0 if packet was waited
+int et_scenario_set_packet_received(et_packet_t * const packet)
+{
+  et_packet_t * p = NULL;
+  int           rc = 0;
+
+  packet->status = ET_PACKET_STATUS_RECEIVED;
+  S1AP_DEBUG("Packet received:          num %u  | original frame number %u \n", packet->packet_number, packet->original_frame_number);
+  S1AP_DEBUG("Last Packet received:     num %u  | original frame number %u \n", g_scenario->last_rx_packet->packet_number, g_scenario->last_rx_packet->original_frame_number);
+
+  p = g_scenario->last_rx_packet;
+  while (NULL != p) {
+    if (ET_PACKET_ACTION_S1C_RECEIVE == p->action) {
+      if ((ET_PACKET_STATUS_RECEIVED == p->status) || (ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT == p->status)) {
+        g_scenario->last_rx_packet = p;
+        g_scenario->time_last_rx_packet.tv_sec   = p->timestamp_packet.tv_sec;
+        g_scenario->time_last_rx_packet.tv_usec  = p->timestamp_packet.tv_usec;
+        S1AP_DEBUG("Set Last Packet received: num %u  | original frame number %u \n", g_scenario->last_rx_packet->packet_number, g_scenario->last_rx_packet->original_frame_number);
+        S1AP_DEBUG("Set time_last_rx_packet %ld.%06d\n", g_scenario->time_last_rx_packet.tv_sec, g_scenario->time_last_rx_packet.tv_usec);
+      } else {
+        break;
+      }
+    }
+    p = p->next;
+  }
+
+  if (0 != packet->timer_id) {
+    rc = timer_remove(packet->timer_id);
+    AssertFatal(rc == 0, "TODO: Debug Timer on Rx packet num %d unknown", packet->packet_number);
+    g_scenario->timer_count--;
+    return rc;
+  }
+  return 1;
+}
+
+//------------------------------------------------------------------------------
+int et_s1ap_process_rx_packet(et_event_s1ap_data_ind_t * const s1ap_data_ind)
+{
+  et_packet_t      *packet       = NULL;
+  et_packet_t      *rx_packet    = NULL;
+  unsigned long int not_found    = 1;
+  asn_comp_rval_t  *comp_results = NULL;
+  asn_comp_rval_t  *comp_results2 = NULL;
+  unsigned char     error_code   = 0;
+
+  AssertFatal (NULL != s1ap_data_ind, "Bad parameter sctp_data_ind\n");
+  rx_packet = et_build_packet_from_s1ap_data_ind(s1ap_data_ind);
+
+  if (NULL == g_scenario->last_rx_packet) {
+    packet = g_scenario->list_packet;
+    while (NULL != packet) {
+      if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) {
+        if ((ET_PACKET_STATUS_RECEIVED == packet->status) || (ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT == packet->status)) {
+          g_scenario->last_rx_packet = packet;
+          if  (ET_PACKET_STATUS_NOT_TAKEN_IN_ACCOUNT != packet->status) {
+            g_scenario->time_last_rx_packet.tv_sec  = packet->timestamp_packet.tv_sec;
+            g_scenario->time_last_rx_packet.tv_usec = packet->timestamp_packet.tv_usec;
+          }
+          S1AP_DEBUG("Set Last Packet received: num %u  | original frame number %u \n", g_scenario->last_rx_packet->packet_number, g_scenario->last_rx_packet->original_frame_number);
+          S1AP_DEBUG("Set time_last_rx_packet %ld.%06d\n", g_scenario->time_last_rx_packet.tv_sec, g_scenario->time_last_rx_packet.tv_usec);
+        } else {
+          break;
+        }
+      }
+      packet = packet->next;
+    }
+    packet = g_scenario->list_packet;
+  } else {
+    packet = g_scenario->last_rx_packet->next;
+  }
+  // not_found threshold may sure depend on number of mme, may be not sure on number of UE
+  while ((NULL != packet) && (not_found < 9)) {
+    S1AP_DEBUG("%s() Considering packet num %d original frame number %u\n", __FUNCTION__, packet->packet_number, packet->original_frame_number);
+    if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) {
+      comp_results = et_sctp_is_matching(&packet->sctp_hdr, &rx_packet->sctp_hdr, g_constraints);
+      if (NULL == comp_results) {
+        S1AP_DEBUG("Compare RX packet with packet: num %u  | original frame number %u \n", packet->packet_number, packet->original_frame_number);
+        packet->timestamp_packet.tv_sec = rx_packet->timestamp_packet.tv_sec;
+        packet->timestamp_packet.tv_usec = rx_packet->timestamp_packet.tv_usec;
+        return et_scenario_set_packet_received(packet);
+      } else {
+        S1AP_DEBUG("Compare RX packet with packet: num %u  | original frame number %u failed\n",
+          packet->packet_number, packet->original_frame_number);
+        while (comp_results) {
+          S1AP_DEBUG("Result err code %s(%u) ASN1 struct name %s\n",
+              et_error_match2str(comp_results->err_code), comp_results->err_code, comp_results->name);
+          // (each asn1 rc <= 166 (enum e_S1ap_ProtocolIE_ID, in generated file S1ap_ProtocolIE_ID.h))
+          if (comp_results->err_code == COMPARE_ERR_CODE_NO_MATCH) {
+            //TODO MME_UE_S1AP_ID, etc.
+            // get latest error code
+            if (strcmp(comp_results->name, "S1ap-MME-UE-S1AP-ID") == 0) {
+              if (0 == et_handle_s1ap_mismatch_mme_ue_s1ap_id((et_packet_t *const)packet, (et_packet_t *const)rx_packet)) {
+                packet->timestamp_packet.tv_sec = rx_packet->timestamp_packet.tv_sec;
+                packet->timestamp_packet.tv_usec = rx_packet->timestamp_packet.tv_usec;
+                return et_scenario_set_packet_received(packet);
+              }
+            } else if (strcmp(comp_results->name, "S1ap-TransportLayerAddress") == 0) {
+              S1AP_WARN("Some work needed there for %s, TODO in generic_scenario.xsl, add sgw conf file in the process, anyway continuing...\n",comp_results->name);
+              packet->timestamp_packet.tv_sec = rx_packet->timestamp_packet.tv_sec;
+              packet->timestamp_packet.tv_usec = rx_packet->timestamp_packet.tv_usec;
+              return et_scenario_set_packet_received(packet);
+            } else {
+              S1AP_WARN("\n\nRX PACKET:\n");
+              et_display_packet_sctp(&rx_packet->sctp_hdr);
+              S1AP_WARN("\n\nWAITED PACKET:\n");
+              et_display_packet_sctp(&packet->sctp_hdr);
+              AssertFatal(0,"Some work needed there");
+            }
+          }
+          comp_results2 = comp_results;
+          comp_results = comp_results2->next;
+          et_free_pointer(comp_results2);
+        }
+      }
+    }
+    not_found += 1;
+    packet = packet->next;
+  }
+  et_display_packet_sctp(&rx_packet->sctp_hdr);
+  AssertFatal(0, "Rx packet not found in scenario (see dump above)");
+  return -1;
+}
+
+//------------------------------------------------------------------------------
+void et_s1ap_eNB_handle_sctp_data_ind(sctp_data_ind_t * const sctp_data_ind)
+{
+  int            result = 0;
+  et_event_t     event;
+
+  DevAssert(sctp_data_ind != NULL);
+
+  memset((void*)&event, 0, sizeof(event));
+
+  event.code = ET_EVENT_RX_S1AP;
+  event.u.s1ap_data_ind.sctp_datahdr.tsn                       = 0;
+  event.u.s1ap_data_ind.sctp_datahdr.stream                    = sctp_data_ind->stream;
+  event.u.s1ap_data_ind.sctp_datahdr.ssn                       = 0;
+  event.u.s1ap_data_ind.sctp_datahdr.ppid                      = S1AP_SCTP_PPID;
+  event.u.s1ap_data_ind.sctp_datahdr.assoc_id                  = sctp_data_ind->assoc_id;
+
+  event.u.s1ap_data_ind.sctp_datahdr.payload.binary_stream_pos = 0;
+  event.u.s1ap_data_ind.sctp_datahdr.payload.binary_stream_allocated_size = sctp_data_ind->buffer_length;
+  event.u.s1ap_data_ind.sctp_datahdr.payload.binary_stream = NULL;
+  if ((sctp_data_ind->buffer_length > 0) && (NULL != sctp_data_ind->buffer)) {
+    event.u.s1ap_data_ind.sctp_datahdr.payload.binary_stream   = calloc(1, sctp_data_ind->buffer_length);
+    memcpy(event.u.s1ap_data_ind.sctp_datahdr.payload.binary_stream,
+           sctp_data_ind->buffer,
+           sctp_data_ind->buffer_length);
+
+    if (et_s1ap_decode_pdu(
+           &event.u.s1ap_data_ind.sctp_datahdr.payload.pdu,
+           &event.u.s1ap_data_ind.sctp_datahdr.payload.message,
+           event.u.s1ap_data_ind.sctp_datahdr.payload.binary_stream,
+           event.u.s1ap_data_ind.sctp_datahdr.payload.binary_stream_allocated_size) < 0) {
+      AssertFatal (0, "ERROR Cannot decode RX S1AP message!\n");
+    }
+
+  }
+
+  result = itti_free(TASK_UNKNOWN, sctp_data_ind->buffer);
+  AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
+
+  et_scenario_fsm_notify_event(event);
+
+  memset((void*)&event, 0, sizeof(event));
+  event.code = ET_EVENT_TICK;
+  et_scenario_fsm_notify_event(event);
+
+}
+//------------------------------------------------------------------------------
+void et_s1ap_eNB_register_mme(s1ap_eNB_instance_t *instance_p,
+                                  net_ip_address_t    *mme_ip_address,
+                                  net_ip_address_t    *local_ip_addr,
+                                  uint16_t             in_streams,
+                                  uint16_t             out_streams)
+{
+  MessageDef                 *message_p                   = NULL;
+  sctp_new_association_req_t *sctp_new_association_req_p  = NULL;
+  s1ap_eNB_mme_data_t        *s1ap_mme_data_p             = NULL;
+
+  DevAssert(instance_p != NULL);
+  DevAssert(mme_ip_address != NULL);
+
+  message_p = itti_alloc_new_message(TASK_S1AP, SCTP_NEW_ASSOCIATION_REQ);
+
+  sctp_new_association_req_p = &message_p->ittiMsg.sctp_new_association_req;
+
+  sctp_new_association_req_p->port = S1AP_PORT_NUMBER;
+  sctp_new_association_req_p->ppid = S1AP_SCTP_PPID;
+
+  sctp_new_association_req_p->in_streams  = in_streams;
+  sctp_new_association_req_p->out_streams = out_streams;
+
+  memcpy(&sctp_new_association_req_p->remote_address,
+         mme_ip_address,
+         sizeof(*mme_ip_address));
+
+  memcpy(&sctp_new_association_req_p->local_address,
+         local_ip_addr,
+         sizeof(*local_ip_addr));
+
+  /* Create new MME descriptor */
+  s1ap_mme_data_p = calloc(1, sizeof(*s1ap_mme_data_p));
+  DevAssert(s1ap_mme_data_p != NULL);
+
+  s1ap_mme_data_p->cnx_id                = et_s1ap_eNB_fetch_add_global_cnx_id();
+  sctp_new_association_req_p->ulp_cnx_id = s1ap_mme_data_p->cnx_id;
+
+  s1ap_mme_data_p->assoc_id          = -1;
+  s1ap_mme_data_p->s1ap_eNB_instance = instance_p;
+
+  memcpy((void*)&s1ap_mme_data_p->mme_net_ip_address, mme_ip_address, sizeof(*mme_ip_address));
+
+
+  STAILQ_INIT(&s1ap_mme_data_p->served_gummei);
+
+  /* Insert the new descriptor in list of known MME
+   * but not yet associated.
+   */
+  RB_INSERT(s1ap_mme_map, &instance_p->s1ap_mme_head, s1ap_mme_data_p);
+  s1ap_mme_data_p->state = S1AP_ENB_STATE_WAITING;
+  instance_p->s1ap_mme_nb ++;
+  instance_p->s1ap_mme_pending_nb ++;
+
+  itti_send_msg_to_task(TASK_SCTP, instance_p->instance, message_p);
+}
+//------------------------------------------------------------------------------
+void et_s1ap_update_assoc_id_of_packets(const int32_t assoc_id,
+                                        struct s1ap_eNB_instance_s * const s1ap_eNB_instance,
+                                        s1ap_eNB_mme_data_t        * const mme_desc_p)
+{
+  et_packet_t     *packet = NULL;
+  int              ret;
+  unsigned int     old_enb_port = 0;
+  unsigned int     old_mme_port = 0;
+
+  S1AP_DEBUG("%s for SCTP association (%u)\n",__FUNCTION__,assoc_id);
+
+  packet = g_scenario->list_packet;
+  while (NULL != packet) {
+    switch (packet->sctp_hdr.chunk_type) {
+
+      case SCTP_CID_DATA :
+        S1AP_DEBUG("%s for SCTP association (%u) SCTP_CID_DATA\n",__FUNCTION__,assoc_id);
+        if ((ET_PACKET_STATUS_NONE == packet->status) || (ET_PACKET_STATUS_SCHEDULED_FOR_RECEIVING == packet->status)) {
+          if (0 < old_mme_port) {
+            if (packet->action == ET_PACKET_ACTION_S1C_SEND) {
+              ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.dst, &mme_desc_p->mme_net_ip_address);
+              if (0 == ret) {
+                ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.src, &s1ap_eNB_instance->s1c_net_ip_address);
+                if (0 == ret) {
+                  // same IP src, same IP dst
+                  if ((packet->sctp_hdr.dst_port == old_mme_port) && (packet->sctp_hdr.src_port == old_enb_port)) {
+                    packet->sctp_hdr.u.data_hdr.assoc_id = assoc_id;
+                    S1AP_DEBUG("tPacket:\tnum %u  | original frame number %u \n", packet->packet_number, packet->original_frame_number);
+                    S1AP_DEBUG("\tUpdated assoc id: %u\n", assoc_id);
+                  }
+                }
+              }
+            } else if (packet->action == ET_PACKET_ACTION_S1C_RECEIVE) {
+              ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.src, &mme_desc_p->mme_net_ip_address);
+              if (0 == ret) {
+                ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.dst, &s1ap_eNB_instance->s1c_net_ip_address);
+                if (0 == ret) {
+                  // same IP src, same IP dst
+                  if ((packet->sctp_hdr.src_port == old_mme_port) && (packet->sctp_hdr.dst_port == old_enb_port)) {
+                    packet->sctp_hdr.u.data_hdr.assoc_id = assoc_id;
+                    S1AP_DEBUG("tPacket:\tnum %u  | original frame number %u \n", packet->packet_number, packet->original_frame_number);
+                    S1AP_DEBUG("\tUpdated assoc id: %u\n", assoc_id);
+                  }
+                }
+              }
+            }
+          }
+        }
+        break;
+
+        // Strong assumption
+        // in replayed scenario, the order of SCTP INIT packets is supposed to be the same as in the catched scenario
+      case SCTP_CID_INIT:
+        S1AP_DEBUG("%s for SCTP association (%u) SCTP_CID_INIT\n",__FUNCTION__,assoc_id);
+        ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.dst, &mme_desc_p->mme_net_ip_address);
+        if (0 == ret) {
+          ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.src, &s1ap_eNB_instance->s1c_net_ip_address);
+          if (0 == ret) {
+            if (0 == old_enb_port) {
+              if (ET_PACKET_STATUS_NONE == packet->status) {
+                packet->status = ET_PACKET_STATUS_SENT;
+                old_enb_port = packet->sctp_hdr.src_port;
+                S1AP_DEBUG("%s for SCTP association (%u) SCTP_CID_INIT SUCCESS\n",__FUNCTION__,assoc_id);
+              }
+            }
+          }
+        }
+        break;
+
+      case SCTP_CID_INIT_ACK:
+        S1AP_DEBUG("%s for SCTP association (%u) SCTP_CID_INIT_ACK\n",__FUNCTION__,assoc_id);
+        ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.src, &mme_desc_p->mme_net_ip_address);
+        if (0 == ret) {
+          ret = et_compare_et_ip_to_net_ip_address(&packet->ip_hdr.dst, &s1ap_eNB_instance->s1c_net_ip_address);
+          if (0 == ret) {
+            if (old_enb_port == packet->sctp_hdr.dst_port) {
+              if (ET_PACKET_STATUS_NONE == packet->status) {
+                packet->status = ET_PACKET_STATUS_RECEIVED;
+                old_mme_port = packet->sctp_hdr.dst_port;
+                S1AP_DEBUG("%s for SCTP association (%u) SCTP_CID_INIT_ACK SUCCESS\n",__FUNCTION__,assoc_id);
+              }
+            }
+          }
+        }
+        break;
+
+      case SCTP_CID_HEARTBEAT:
+      case SCTP_CID_HEARTBEAT_ACK:
+      case SCTP_CID_COOKIE_ECHO:
+      case SCTP_CID_COOKIE_ACK:
+      case SCTP_CID_ECN_ECNE:
+      case SCTP_CID_ECN_CWR:
+        break;
+
+      case SCTP_CID_ABORT:
+      case SCTP_CID_SHUTDOWN:
+      case SCTP_CID_SHUTDOWN_ACK:
+      case SCTP_CID_ERROR:
+      case SCTP_CID_SHUTDOWN_COMPLETE:
+        //TODO
+        break;
+
+      default:
+        AssertFatal(0, "Unknown chunk_type %d packet num %d", packet->sctp_hdr.chunk_type, packet->packet_number);
+        ;
+    }
+    packet = packet->next;
+  }
+}
+//------------------------------------------------------------------------------
+void et_s1ap_handle_s1_setup_message(s1ap_eNB_mme_data_t *mme_desc_p, int sctp_shutdown)
+{
+  if (sctp_shutdown) {
+    /* A previously connected MME has been shutdown */
+
+    /* TODO check if it was used by some eNB and send a message to inform these eNB if there is no more associated MME */
+    if (mme_desc_p->state == S1AP_ENB_STATE_CONNECTED) {
+      mme_desc_p->state = S1AP_ENB_STATE_DISCONNECTED;
+
+      if (mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb > 0) {
+        /* Decrease associated MME number */
+        mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb --;
+      }
+
+      /* If there are no more associated MME, inform eNB app */
+      if (mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb == 0) {
+        MessageDef                 *message_p;
+
+        message_p = itti_alloc_new_message(TASK_S1AP, S1AP_DEREGISTERED_ENB_IND);
+        S1AP_DEREGISTERED_ENB_IND(message_p).nb_mme = 0;
+        itti_send_msg_to_task(TASK_ENB_APP, mme_desc_p->s1ap_eNB_instance->instance, message_p);
+      }
+    }
+  } else {
+    /* Check that at least one setup message is pending */
+    DevCheck(mme_desc_p->s1ap_eNB_instance->s1ap_mme_pending_nb > 0, mme_desc_p->s1ap_eNB_instance->instance,
+             mme_desc_p->s1ap_eNB_instance->s1ap_mme_pending_nb, 0);
+
+    if (mme_desc_p->s1ap_eNB_instance->s1ap_mme_pending_nb > 0) {
+      /* Decrease pending messages number */
+      mme_desc_p->s1ap_eNB_instance->s1ap_mme_pending_nb --;
+      mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb++;
+    }
+
+    et_s1ap_update_assoc_id_of_packets(mme_desc_p->assoc_id,
+        mme_desc_p->s1ap_eNB_instance,
+        mme_desc_p);
+
+
+    /* If there are no more pending messages, inform eNB app */
+    if (mme_desc_p->s1ap_eNB_instance->s1ap_mme_pending_nb == 0) {
+      MessageDef                 *message_p;
+
+      message_p = itti_alloc_new_message(TASK_S1AP, S1AP_REGISTER_ENB_CNF);
+      S1AP_REGISTER_ENB_CNF(message_p).nb_mme = mme_desc_p->s1ap_eNB_instance->s1ap_mme_associated_nb;
+      itti_send_msg_to_task(TASK_ENB_APP, mme_desc_p->s1ap_eNB_instance->instance, message_p);
+    }
+  }
+}
+//------------------------------------------------------------------------------
+void et_s1ap_eNB_handle_register_eNB(instance_t instance, s1ap_register_enb_req_t *s1ap_register_eNB)
+{
+  s1ap_eNB_instance_t *new_instance;
+  uint8_t index;
+
+  DevAssert(s1ap_register_eNB != NULL);
+
+  /* Look if the provided instance already exists */
+  new_instance = et_s1ap_eNB_get_instance(instance);
+
+  if (new_instance != NULL) {
+    /* Checks if it is a retry on the same eNB */
+    DevCheck(new_instance->eNB_id == s1ap_register_eNB->eNB_id, new_instance->eNB_id, s1ap_register_eNB->eNB_id, 0);
+    DevCheck(new_instance->cell_type == s1ap_register_eNB->cell_type, new_instance->cell_type, s1ap_register_eNB->cell_type, 0);
+    DevCheck(new_instance->tac == s1ap_register_eNB->tac, new_instance->tac, s1ap_register_eNB->tac, 0);
+    DevCheck(new_instance->mcc == s1ap_register_eNB->mcc, new_instance->mcc, s1ap_register_eNB->mcc, 0);
+    DevCheck(new_instance->mnc == s1ap_register_eNB->mnc, new_instance->mnc, s1ap_register_eNB->mnc, 0);
+    DevCheck(new_instance->mnc_digit_length == s1ap_register_eNB->mnc_digit_length, new_instance->mnc_digit_length, s1ap_register_eNB->mnc_digit_length, 0);
+    DevCheck(memcmp((void*)&new_instance->s1c_net_ip_address, (void*)&s1ap_register_eNB->enb_ip_address, sizeof(new_instance->s1c_net_ip_address)) == 0, 0,0,0);
+  } else {
+    new_instance = calloc(1, sizeof(s1ap_eNB_instance_t));
+    DevAssert(new_instance != NULL);
+
+    RB_INIT(&new_instance->s1ap_ue_head);
+    RB_INIT(&new_instance->s1ap_mme_head);
+
+    /* Copy usefull parameters */
+    new_instance->instance         = instance;
+    new_instance->eNB_name         = s1ap_register_eNB->eNB_name;
+    new_instance->eNB_id           = s1ap_register_eNB->eNB_id;
+    new_instance->cell_type        = s1ap_register_eNB->cell_type;
+    new_instance->tac              = s1ap_register_eNB->tac;
+    new_instance->mcc              = s1ap_register_eNB->mcc;
+    new_instance->mnc              = s1ap_register_eNB->mnc;
+    new_instance->mnc_digit_length = s1ap_register_eNB->mnc_digit_length;
+    memcpy((void*)&new_instance->s1c_net_ip_address, (void*)&s1ap_register_eNB->enb_ip_address, sizeof(new_instance->s1c_net_ip_address));
+
+    /* Add the new instance to the list of eNB (meaningfull in virtual mode) */
+    et_s1ap_eNB_insert_new_instance(new_instance);
+
+    S1AP_DEBUG("Registered new eNB[%d] and %s eNB id %u\n",
+               instance,
+               s1ap_register_eNB->cell_type == CELL_MACRO_ENB ? "macro" : "home",
+               s1ap_register_eNB->eNB_id);
+  }
+
+  DevCheck(s1ap_register_eNB->nb_mme <= S1AP_MAX_NB_MME_IP_ADDRESS,
+           S1AP_MAX_NB_MME_IP_ADDRESS, s1ap_register_eNB->nb_mme, 0);
+
+  /* Trying to connect to provided list of MME ip address */
+  for (index = 0; index < s1ap_register_eNB->nb_mme; index++) {
+    et_s1ap_eNB_register_mme(new_instance,
+                      &s1ap_register_eNB->mme_ip_address[index],
+                          &s1ap_register_eNB->enb_ip_address,
+                          s1ap_register_eNB->sctp_in_streams,
+                          s1ap_register_eNB->sctp_out_streams);
+  }
+}
+
+//------------------------------------------------------------------------------
+void et_s1ap_eNB_handle_sctp_association_resp(instance_t instance, sctp_new_association_resp_t *sctp_new_association_resp)
+{
+  s1ap_eNB_instance_t *instance_p      = NULL;
+  s1ap_eNB_mme_data_t *s1ap_mme_data_p = NULL;
+
+  DevAssert(sctp_new_association_resp != NULL);
+
+  instance_p = et_s1ap_eNB_get_instance(instance);
+  DevAssert(instance_p != NULL);
+
+  s1ap_mme_data_p = et_s1ap_eNB_get_MME(instance_p, -1,
+                                     sctp_new_association_resp->ulp_cnx_id);
+  DevAssert(s1ap_mme_data_p != NULL);
+
+  if (sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED) {
+    S1AP_WARN("Received unsuccessful result for SCTP association (%u), instance %d, cnx_id %u\n",
+              sctp_new_association_resp->sctp_state,
+              instance,
+              sctp_new_association_resp->ulp_cnx_id);
+
+    et_s1ap_handle_s1_setup_message(s1ap_mme_data_p, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN);
+
+    return;
+  }
+
+  S1AP_DEBUG("Received successful result for SCTP association (%u), instance %d, cnx_id %u\n",
+             sctp_new_association_resp->sctp_state,
+             instance,
+             sctp_new_association_resp->ulp_cnx_id);
+  /* Update parameters */
+  s1ap_mme_data_p->assoc_id    = sctp_new_association_resp->assoc_id;
+  s1ap_mme_data_p->in_streams  = sctp_new_association_resp->in_streams;
+  s1ap_mme_data_p->out_streams = sctp_new_association_resp->out_streams;
+
+  et_s1ap_handle_s1_setup_message(s1ap_mme_data_p, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN);
+}
+
+//------------------------------------------------------------------------------
+void *et_s1ap_eNB_task(void *arg)
+{
+  MessageDef *received_msg = NULL;
+  int         result;
+
+  S1AP_DEBUG("Starting S1AP layer\n");
+
+  et_s1ap_eNB_prepare_internal_data();
+
+  itti_mark_task_ready(TASK_S1AP);
+  MSC_START_USE();
+
+  while (1) {
+    itti_receive_msg(TASK_S1AP, &received_msg);
+
+    switch (ITTI_MSG_ID(received_msg)) {
+    case TERMINATE_MESSAGE:
+      itti_exit_task();
+      break;
+
+    case S1AP_REGISTER_ENB_REQ: {
+      /* Register a new eNB.
+       * in Virtual mode eNBs will be distinguished using the mod_id/
+       * Each eNB has to send an S1AP_REGISTER_ENB message with its
+       * own parameters.
+       */
+      et_s1ap_eNB_handle_register_eNB(ITTI_MESSAGE_GET_INSTANCE(received_msg),
+                                   &S1AP_REGISTER_ENB_REQ(received_msg));
+    }
+    break;
+
+    case SCTP_NEW_ASSOCIATION_RESP: {
+      et_s1ap_eNB_handle_sctp_association_resp(ITTI_MESSAGE_GET_INSTANCE(received_msg),
+                                            &received_msg->ittiMsg.sctp_new_association_resp);
+    }
+    break;
+
+    case SCTP_DATA_IND: {
+      et_s1ap_eNB_handle_sctp_data_ind(&received_msg->ittiMsg.sctp_data_ind);
+    }
+    break;
+
+    case TIMER_HAS_EXPIRED:
+      LOG_I(S1AP, " Received TIMER_HAS_EXPIRED: timer_id %d\n", TIMER_HAS_EXPIRED(received_msg).timer_id);
+      {
+        et_packet_t * packet = (et_packet_t*)TIMER_HAS_EXPIRED (received_msg).arg;
+        et_event_t    event;
+        g_scenario->timer_count--;
+        if (NULL != packet) {
+          if (packet->status == ET_PACKET_STATUS_SCHEDULED_FOR_RECEIVING) {
+            memset((void*)&event, 0, sizeof(event));
+            event.code = ET_EVENT_RX_PACKET_TIME_OUT;
+            event.u.rx_packet_time_out = packet;
+            et_scenario_fsm_notify_event(event);
+          } else if (packet->status == ET_PACKET_STATUS_SCHEDULED_FOR_SENDING) {
+            memset((void*)&event, 0, sizeof(event));
+            event.code = ET_EVENT_TX_TIMED_PACKET;
+            event.u.tx_timed_packet = packet;
+            et_scenario_fsm_notify_event(event);
+
+            et_event_t continue_event;
+            continue_event.code = ET_EVENT_TICK;
+            et_scenario_fsm_notify_event(continue_event);
+          } else if ((packet->status != ET_PACKET_STATUS_SENT) && ((packet->status != ET_PACKET_STATUS_RECEIVED))) {
+            AssertFatal (0, "Bad status %d of packet timed out!\n", packet->status);
+          }
+        } else {
+          LOG_W(S1AP, " Received TIMER_HAS_EXPIRED: timer_id %d, no packet attached to timer\n", TIMER_HAS_EXPIRED(received_msg).timer_id);
+        }
+      }
+      if (TIMER_HAS_EXPIRED (received_msg).timer_id == g_scenario->enb_register_retry_timer_id) {
+        /* Restart the registration process */
+        g_scenario->registered_enb = 0;
+        et_eNB_app_register (g_scenario->enb_properties);
+      }
+      break;
+
+    default:
+      S1AP_ERROR("Received unhandled message: %d:%s\n",
+                 ITTI_MSG_ID(received_msg), ITTI_MSG_NAME(received_msg));
+      break;
+    }
+
+    result = itti_free (ITTI_MSG_ORIGIN_ID(received_msg), received_msg);
+    AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
+
+    received_msg = NULL;
+  }
+
+  return NULL;
+}
+
+
diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c
new file mode 100644
index 0000000000000000000000000000000000000000..5d43b211ee09af4af44be8f16b73f34a3a54c415
--- /dev/null
+++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap_compare_ie.c
@@ -0,0 +1,634 @@
+/*******************************************************************************
+    OpenAirInterface
+    Copyright(c) 1999 - 2014 Eurecom
+
+    OpenAirInterface is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+
+    OpenAirInterface is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenAirInterface.The full GNU General Public License is
+    included in this distribution in the file called "COPYING". If not,
+    see <http://www.gnu.org/licenses/>.
+
+  Contact Information
+  OpenAirInterface Admin: openair_admin@eurecom.fr
+  OpenAirInterface Tech : openair_tech@eurecom.fr
+  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+
+  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+ *******************************************************************************/
+
+/*
+                                play_scenario_s1ap_compare_ie.c
+                                -------------------
+  AUTHOR  : Lionel GAUTHIER
+  COMPANY : EURECOM
+  EMAIL   : Lionel.Gauthier@eurecom.fr
+ */
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <stdarg.h>
+#include <unistd.h>
+#include <crypt.h>
+#include <errno.h>
+#include <libxml/tree.h>
+#include <libxml/parser.h>
+#include <libxml/xpath.h>
+#include <libxml/xpathInternals.h>
+#include "tree.h"
+#include "queue.h"
+
+
+#include "intertask_interface.h"
+#include "timer.h"
+#include "platform_types.h"
+#include "assertions.h"
+#include "conversions.h"
+#include "s1ap_common.h"
+#include "play_scenario_s1ap_eNB_defs.h"
+#include "play_scenario.h"
+#include "msc.h"
+//------------------------------------------------------------------------------
+extern et_scenario_t  *g_scenario;
+extern uint32_t        g_constraints;
+//------------------------------------------------------------------------------
+
+asn_comp_rval_t * et_s1ap_ies_is_matching(const S1AP_PDU_PR present, s1ap_message * const m1, s1ap_message * const m2, const uint32_t constraints)
+{
+  asn_comp_rval_t *ret = NULL;
+  AssertFatal(m1 != NULL, "bad parameter m1");
+  AssertFatal(m2 != NULL, "bad parameter m2");
+  AssertFatal((present == S1AP_PDU_PR_initiatingMessage) ||
+              (present == S1AP_PDU_PR_successfulOutcome) ||
+              (present == S1AP_PDU_PR_unsuccessfulOutcome) , "Bad parameter S1AP_PDU_PR present ");
+  AssertFatal( m1->procedureCode == m2->procedureCode, "Bad parameters: no matching procedure codes");
+
+
+  // some cases can never occur since uplink only.
+  switch (m1->procedureCode) {
+    case  S1ap_ProcedureCode_id_HandoverPreparation:
+      if (present == S1AP_PDU_PR_initiatingMessage) {
+        ret = s1ap_compare_s1ap_handoverrequiredies(
+                &m1->msg.s1ap_HandoverRequiredIEs,
+                &m2->msg.s1ap_HandoverRequiredIEs);
+      } else {
+        ret = s1ap_compare_s1ap_handovercommandies(
+                &m1->msg.s1ap_HandoverCommandIEs,
+                &m2->msg.s1ap_HandoverCommandIEs);
+      }
+      break;
+
+    case  S1ap_ProcedureCode_id_HandoverResourceAllocation:
+      if (present == S1AP_PDU_PR_initiatingMessage) {
+        ret = s1ap_compare_s1ap_handoverrequesties(
+                &m1->msg.s1ap_HandoverRequestIEs,
+                &m2->msg.s1ap_HandoverRequestIEs);
+      } else if (present == S1AP_PDU_PR_successfulOutcome) {
+        ret = s1ap_compare_s1ap_handoverrequestacknowledgeies(
+                &m1->msg.s1ap_HandoverRequestAcknowledgeIEs,
+                &m2->msg.s1ap_HandoverRequestAcknowledgeIEs);
+      } else if (present == S1AP_PDU_PR_unsuccessfulOutcome) {
+        ret = s1ap_compare_s1ap_handoverfailureies(
+                &m1->msg.s1ap_HandoverFailureIEs,
+                &m2->msg.s1ap_HandoverFailureIEs);
+      }
+      break;
+
+    case  S1ap_ProcedureCode_id_HandoverNotification:
+        ret = s1ap_compare_s1ap_handovernotifyies(
+                &m1->msg.s1ap_HandoverNotifyIEs,
+                &m2->msg.s1ap_HandoverNotifyIEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_PathSwitchRequest:
+      ret = s1ap_compare_s1ap_pathswitchrequesties(
+              &m1->msg.s1ap_PathSwitchRequestIEs,
+              &m2->msg.s1ap_PathSwitchRequestIEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_HandoverCancel:
+      ret = s1ap_compare_s1ap_handovercancelies(
+              &m1->msg.s1ap_HandoverCancelIEs,
+              &m2->msg.s1ap_HandoverCancelIEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_E_RABSetup:
+      if (present == S1AP_PDU_PR_initiatingMessage) {
+        ret = s1ap_compare_s1ap_e_rabsetuprequesties(
+                &m1->msg.s1ap_E_RABSetupRequestIEs,
+                &m2->msg.s1ap_E_RABSetupRequestIEs);
+      } else  {
+        ret = s1ap_compare_s1ap_e_rabsetupresponseies(
+                &m1->msg.s1ap_E_RABSetupResponseIEs,
+                &m2->msg.s1ap_E_RABSetupResponseIEs);
+      }
+      break;
+
+    case  S1ap_ProcedureCode_id_E_RABModify:
+      if (present == S1AP_PDU_PR_initiatingMessage) {
+        ret = s1ap_compare_s1ap_e_rabmodifyrequesties(
+                &m1->msg.s1ap_E_RABModifyRequestIEs,
+                &m2->msg.s1ap_E_RABModifyRequestIEs);
+      } else  {
+        ret = s1ap_compare_s1ap_e_rabmodifyresponseies(
+                &m1->msg.s1ap_E_RABModifyResponseIEs,
+                &m2->msg.s1ap_E_RABModifyResponseIEs);
+      }
+      break;
+
+    case  S1ap_ProcedureCode_id_E_RABRelease:
+      if (present == S1AP_PDU_PR_initiatingMessage) {
+        ret = s1ap_compare_s1ap_e_rabreleasecommandies(
+                &m1->msg.s1ap_E_RABReleaseCommandIEs,
+                &m2->msg.s1ap_E_RABReleaseCommandIEs);
+      } else  {
+        ret = s1ap_compare_s1ap_e_rabreleaseresponseies(
+                &m1->msg.s1ap_E_RABReleaseResponseIEs,
+                &m2->msg.s1ap_E_RABReleaseResponseIEs);
+      }
+      break;
+
+    case  S1ap_ProcedureCode_id_E_RABReleaseIndication:
+      ret = s1ap_compare_s1ap_e_rabreleaseindicationies(
+              &m1->msg.s1ap_E_RABReleaseIndicationIEs,
+              &m2->msg.s1ap_E_RABReleaseIndicationIEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_InitialContextSetup:
+      if (present == S1AP_PDU_PR_initiatingMessage) {
+        ret = s1ap_compare_s1ap_initialcontextsetuprequesties(
+                &m1->msg.s1ap_InitialContextSetupRequestIEs,
+                &m2->msg.s1ap_InitialContextSetupRequestIEs);
+      } else  {
+        ret = s1ap_compare_s1ap_initialcontextsetupresponseies(
+                &m1->msg.s1ap_InitialContextSetupResponseIEs,
+                &m2->msg.s1ap_InitialContextSetupResponseIEs);
+      }
+      break;
+
+    case  S1ap_ProcedureCode_id_Paging:
+      ret = s1ap_compare_s1ap_pagingies(
+              &m1->msg.s1ap_PagingIEs,
+              &m2->msg.s1ap_PagingIEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_downlinkNASTransport:
+      ret = s1ap_compare_s1ap_downlinknastransporties(
+              &m1->msg.s1ap_DownlinkNASTransportIEs,
+              &m2->msg.s1ap_DownlinkNASTransportIEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_initialUEMessage:
+      ret = s1ap_compare_s1ap_initialuemessageies(
+              &m1->msg.s1ap_InitialUEMessageIEs,
+              &m2->msg.s1ap_InitialUEMessageIEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_uplinkNASTransport:
+      ret = s1ap_compare_s1ap_uplinknastransporties(
+              &m1->msg.s1ap_UplinkNASTransportIEs,
+              &m2->msg.s1ap_UplinkNASTransportIEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_Reset:
+      ret = s1ap_compare_s1ap_reseties(
+              &m1->msg.s1ap_ResetIEs,
+              &m2->msg.s1ap_ResetIEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_ErrorIndication:
+      ret = s1ap_compare_s1ap_errorindicationies(
+              &m1->msg.s1ap_ErrorIndicationIEs,
+              &m2->msg.s1ap_ErrorIndicationIEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_NASNonDeliveryIndication:
+      ret = s1ap_compare_s1ap_nasnondeliveryindication_ies(
+              &m1->msg.s1ap_NASNonDeliveryIndication_IEs,
+              &m2->msg.s1ap_NASNonDeliveryIndication_IEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_S1Setup:
+      if (present == S1AP_PDU_PR_initiatingMessage) {
+        ret = s1ap_compare_s1ap_s1setuprequesties(
+                &m1->msg.s1ap_S1SetupRequestIEs,
+                &m2->msg.s1ap_S1SetupRequestIEs);
+      } else if (present == S1AP_PDU_PR_successfulOutcome) {
+        ret = s1ap_compare_s1ap_s1setupresponseies(
+                &m1->msg.s1ap_S1SetupResponseIEs,
+                &m2->msg.s1ap_S1SetupResponseIEs);
+      } else if (present == S1AP_PDU_PR_unsuccessfulOutcome) {
+        ret = s1ap_compare_s1ap_s1setupfailureies(
+                &m1->msg.s1ap_S1SetupFailureIEs,
+                &m2->msg.s1ap_S1SetupFailureIEs);
+      }
+      break;
+
+    case  S1ap_ProcedureCode_id_UEContextReleaseRequest:
+      ret = s1ap_compare_s1ap_uecontextreleaserequesties(
+                &m1->msg.s1ap_UEContextReleaseRequestIEs,
+                &m2->msg.s1ap_UEContextReleaseRequestIEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_DownlinkS1cdma2000tunneling:
+      ret = s1ap_compare_s1ap_downlinks1cdma2000tunnelingies(
+                &m1->msg.s1ap_DownlinkS1cdma2000tunnelingIEs,
+                &m2->msg.s1ap_DownlinkS1cdma2000tunnelingIEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_UplinkS1cdma2000tunneling:
+      ret = s1ap_compare_s1ap_uplinks1cdma2000tunnelingies(
+                &m1->msg.s1ap_UplinkS1cdma2000tunnelingIEs,
+                &m2->msg.s1ap_UplinkS1cdma2000tunnelingIEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_UEContextModification:
+      if (present == S1AP_PDU_PR_initiatingMessage) {
+        ret = s1ap_compare_s1ap_uecontextmodificationrequesties(
+                &m1->msg.s1ap_UEContextModificationRequestIEs,
+                &m2->msg.s1ap_UEContextModificationRequestIEs);
+      } else if (present == S1AP_PDU_PR_successfulOutcome) {
+        ret = s1ap_compare_s1ap_uecontextmodificationresponseies(
+                &m1->msg.s1ap_UEContextModificationResponseIEs,
+                &m2->msg.s1ap_UEContextModificationResponseIEs);
+      } else if (present == S1AP_PDU_PR_unsuccessfulOutcome) {
+        ret = s1ap_compare_s1ap_uecontextmodificationfailureies(
+                &m1->msg.s1ap_UEContextModificationFailureIEs,
+                &m2->msg.s1ap_UEContextModificationFailureIEs);
+      }
+      break;
+
+    case  S1ap_ProcedureCode_id_UECapabilityInfoIndication:
+      ret = s1ap_compare_s1ap_uecapabilityinfoindicationies(
+                &m1->msg.s1ap_UECapabilityInfoIndicationIEs,
+                &m2->msg.s1ap_UECapabilityInfoIndicationIEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_UEContextRelease:
+      if (present == S1AP_PDU_PR_initiatingMessage) {
+        ret = s1ap_compare_s1ap_uecontextreleasecommandies(
+                &m1->msg.s1ap_UEContextReleaseCommandIEs,
+                &m2->msg.s1ap_UEContextReleaseCommandIEs);
+      } else  {
+        ret = s1ap_compare_s1ap_uecontextreleasecompleteies(
+                &m1->msg.s1ap_UEContextReleaseCompleteIEs,
+                &m2->msg.s1ap_UEContextReleaseCompleteIEs);
+      }
+      break;
+
+    case  S1ap_ProcedureCode_id_eNBStatusTransfer:
+      ret = s1ap_compare_s1ap_enbstatustransferies(
+                &m1->msg.s1ap_ENBStatusTransferIEs,
+                &m2->msg.s1ap_ENBStatusTransferIEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_MMEStatusTransfer:
+      ret = s1ap_compare_s1ap_mmestatustransferies(
+                &m1->msg.s1ap_MMEStatusTransferIEs,
+                &m2->msg.s1ap_MMEStatusTransferIEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_DeactivateTrace:
+      ret = s1ap_compare_s1ap_deactivatetraceies(
+                &m1->msg.s1ap_DeactivateTraceIEs,
+                &m2->msg.s1ap_DeactivateTraceIEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_TraceStart:
+      ret = s1ap_compare_s1ap_tracestarties(
+                &m1->msg.s1ap_TraceStartIEs,
+                &m2->msg.s1ap_TraceStartIEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_TraceFailureIndication:
+      ret = s1ap_compare_s1ap_tracefailureindicationies(
+                &m1->msg.s1ap_TraceFailureIndicationIEs,
+                &m2->msg.s1ap_TraceFailureIndicationIEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_ENBConfigurationUpdate:
+      if (present == S1AP_PDU_PR_initiatingMessage) {
+        ret = s1ap_compare_s1ap_enbconfigurationupdateies(
+                &m1->msg.s1ap_ENBConfigurationUpdateIEs,
+                &m2->msg.s1ap_ENBConfigurationUpdateIEs);
+      } else if (present == S1AP_PDU_PR_successfulOutcome) {
+        ret = s1ap_compare_s1ap_enbconfigurationupdateacknowledgeies(
+                &m1->msg.s1ap_ENBConfigurationUpdateAcknowledgeIEs,
+                &m2->msg.s1ap_ENBConfigurationUpdateAcknowledgeIEs);
+      } else {
+        ret = s1ap_compare_s1ap_enbconfigurationupdatefailureies(
+                &m1->msg.s1ap_ENBConfigurationUpdateFailureIEs,
+                &m2->msg.s1ap_ENBConfigurationUpdateFailureIEs);
+      }
+      break;
+
+    case  S1ap_ProcedureCode_id_MMEConfigurationUpdate:
+      if (present == S1AP_PDU_PR_initiatingMessage) {
+        ret = s1ap_compare_s1ap_mmeconfigurationupdateies(
+                &m1->msg.s1ap_MMEConfigurationUpdateIEs,
+                &m2->msg.s1ap_MMEConfigurationUpdateIEs);
+      } else if (present == S1AP_PDU_PR_successfulOutcome) {
+        ret = s1ap_compare_s1ap_mmeconfigurationupdateacknowledgeies(
+                &m1->msg.s1ap_MMEConfigurationUpdateAcknowledgeIEs,
+                &m2->msg.s1ap_MMEConfigurationUpdateAcknowledgeIEs);
+      } else {
+        ret = s1ap_compare_s1ap_mmeconfigurationupdatefailureies(
+                &m1->msg.s1ap_MMEConfigurationUpdateFailureIEs,
+                &m2->msg.s1ap_MMEConfigurationUpdateFailureIEs);
+      }
+      break;
+
+    case  S1ap_ProcedureCode_id_LocationReportingControl:
+      ret = s1ap_compare_s1ap_locationreportingcontrolies(
+                &m1->msg.s1ap_LocationReportingControlIEs,
+                &m2->msg.s1ap_LocationReportingControlIEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_LocationReportingFailureIndication:
+      ret = s1ap_compare_s1ap_locationreportingfailureindicationies(
+                &m1->msg.s1ap_LocationReportingFailureIndicationIEs,
+                &m2->msg.s1ap_LocationReportingFailureIndicationIEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_LocationReport:
+      ret = s1ap_compare_s1ap_locationreporties(
+                &m1->msg.s1ap_LocationReportIEs,
+                &m2->msg.s1ap_LocationReportIEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_OverloadStart:
+      ret = s1ap_compare_s1ap_overloadstarties(
+                &m1->msg.s1ap_OverloadStartIEs,
+                &m2->msg.s1ap_OverloadStartIEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_OverloadStop:
+      ret = s1ap_compare_s1ap_overloadstopies(
+                &m1->msg.s1ap_OverloadStopIEs,
+                &m2->msg.s1ap_OverloadStopIEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_WriteReplaceWarning:
+      if (present == S1AP_PDU_PR_initiatingMessage) {
+        ret = s1ap_compare_s1ap_writereplacewarningrequesties(
+                &m1->msg.s1ap_WriteReplaceWarningRequestIEs,
+                &m2->msg.s1ap_WriteReplaceWarningRequestIEs);
+      } else  {
+        ret = s1ap_compare_s1ap_writereplacewarningresponseies(
+                &m1->msg.s1ap_WriteReplaceWarningResponseIEs,
+                &m2->msg.s1ap_WriteReplaceWarningResponseIEs);
+      }
+      break;
+
+    case  S1ap_ProcedureCode_id_eNBDirectInformationTransfer:
+      ret = s1ap_compare_s1ap_enbdirectinformationtransferies(
+                &m1->msg.s1ap_ENBDirectInformationTransferIEs,
+                &m2->msg.s1ap_ENBDirectInformationTransferIEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_MMEDirectInformationTransfer:
+
+      ret = s1ap_compare_s1ap_mmedirectinformationtransferies(
+                &m1->msg.s1ap_MMEDirectInformationTransferIEs,
+                &m2->msg.s1ap_MMEDirectInformationTransferIEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_PrivateMessage:
+    case  S1ap_ProcedureCode_id_eNBConfigurationTransfer:
+    case  S1ap_ProcedureCode_id_MMEConfigurationTransfer:
+      AssertFatal(0, "TODO");
+      break;
+
+    case  S1ap_ProcedureCode_id_CellTrafficTrace:
+      ret = s1ap_compare_s1ap_celltraffictraceies(
+                &m1->msg.s1ap_CellTrafficTraceIEs,
+                &m2->msg.s1ap_CellTrafficTraceIEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_Kill:
+      if (present == S1AP_PDU_PR_initiatingMessage) {
+        ret = s1ap_compare_s1ap_killrequesties(
+                &m1->msg.s1ap_KillRequestIEs,
+                &m2->msg.s1ap_KillRequestIEs);
+      } else  {
+        ret = s1ap_compare_s1ap_killresponseies(
+                &m1->msg.s1ap_KillResponseIEs,
+                &m2->msg.s1ap_KillResponseIEs);
+      }
+      break;
+
+    case  S1ap_ProcedureCode_id_downlinkUEAssociatedLPPaTransport:
+      ret = s1ap_compare_s1ap_downlinkueassociatedlppatransport_ies(
+                &m1->msg.s1ap_DownlinkUEAssociatedLPPaTransport_IEs,
+                &m2->msg.s1ap_DownlinkUEAssociatedLPPaTransport_IEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_uplinkUEAssociatedLPPaTransport:
+      ret = s1ap_compare_s1ap_uplinkueassociatedlppatransport_ies(
+                &m1->msg.s1ap_UplinkUEAssociatedLPPaTransport_IEs,
+                &m2->msg.s1ap_UplinkUEAssociatedLPPaTransport_IEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_downlinkNonUEAssociatedLPPaTransport:
+      ret = s1ap_compare_s1ap_downlinknonueassociatedlppatransport_ies(
+                &m1->msg.s1ap_DownlinkNonUEAssociatedLPPaTransport_IEs,
+                &m2->msg.s1ap_DownlinkNonUEAssociatedLPPaTransport_IEs);
+      break;
+
+    case  S1ap_ProcedureCode_id_uplinkNonUEAssociatedLPPaTransport:
+      ret = s1ap_compare_s1ap_uplinknonueassociatedlppatransport_ies(
+                &m1->msg.s1ap_UplinkNonUEAssociatedLPPaTransport_IEs,
+                &m2->msg.s1ap_UplinkNonUEAssociatedLPPaTransport_IEs);
+      break;
+
+    default:
+      AssertFatal(0, "Unknown procedure code %ld", m1->procedureCode);
+  }
+  return ret;
+}
+
+
+void update_xpath_node_mme_ue_s1ap_id(et_s1ap_t * const s1ap, xmlNode *node, const S1ap_MME_UE_S1AP_ID_t new_id)
+{
+  xmlNode       *cur_node = NULL;
+  xmlAttrPtr     attr     = NULL;
+  xmlChar       *xml_char = NULL;
+  int            size     = 0;
+  int            pos      = 0;
+  int            go_deeper_in_tree = 1;
+  //S1AP_INFO("%s() mme_ue_s1ap_id %u\n", __FUNCTION__, new_id);
+
+  // modify
+  for (cur_node = (xmlNode *)node; cur_node; cur_node = cur_node->next) {
+    go_deeper_in_tree = 1;
+    if ((!xmlStrcmp(cur_node->name, (const xmlChar *)"field"))) {
+      // do not get hidden fields
+      xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"hide");
+      if (NULL != xml_char) {
+        if ((!xmlStrcmp(xml_char, (const xmlChar *)"yes"))) {
+          go_deeper_in_tree = 0;
+        }
+        xmlFree(xml_char);
+      }
+      if (0 < go_deeper_in_tree) {
+        // first get size
+        xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"pos");
+        if (NULL != xml_char) {
+          pos = strtoul((const char *)xml_char, NULL, 0);
+          pos -= s1ap->xml_stream_pos_offset;
+          AssertFatal(pos >= 0, "Bad pos %d xml_stream_pos_offset %d", pos, s1ap->xml_stream_pos_offset);
+          xmlFree(xml_char);
+          xml_char = xmlGetProp((xmlNode *)cur_node, (const xmlChar *)"size");
+          if (NULL != xml_char) {
+            const xmlChar value_d[32];
+            const xmlChar value_h[20];
+            const xmlChar showname[64];
+            int           ret     = 0;
+            int           pos2    = 0;
+            unsigned long int uli = 0;
+            char          hex[3]  = {0,0,0};
+            char         *end_ptr = NULL;
+
+            size = strtoul((const char *)xml_char, NULL, 0);
+            xmlFree(xml_char);
+            // second: try to set value (always hex)
+            ret = snprintf((char *)value_d, 32, "%ld", new_id);
+            AssertFatal((ret > 0) && (ret < 32), "Could not convert int to dec str");
+            ret = snprintf((char *)value_h, 20, "C0%08X", new_id);
+            AssertFatal((ret > 0) && (ret < 20), "Could not convert int to hex str");
+            ret = snprintf((char *)showname, 64, "MME-UE-S1AP-ID: %d", new_id);
+            AssertFatal((ret > 0) && (ret < 64), "Could not convert int to dec str");
+
+            attr = xmlSetProp((xmlNode *)cur_node, (const xmlChar *)"value", value_h);
+            attr = xmlSetProp((xmlNode *)cur_node, (const xmlChar *)"show", value_d);
+            attr = xmlSetProp((xmlNode *)cur_node, (const xmlChar *)"showname", showname);
+            //TODO update s1ap->binary_stream @pos with new_id_hex, size
+            AssertFatal((pos+size) < s1ap->binary_stream_allocated_size, "Rewrite of mme_ue_s1ap_id out of bounds of binary_stream");
+            //avoid endianess issues
+            do {
+              hex[0] = value_h[pos2++];
+              hex[1] = value_h[pos2++];
+              hex[2] = '\0';
+              end_ptr = hex;
+              uli = strtoul(hex, &end_ptr, 16);
+              AssertFatal((uli != ULONG_MAX) && (end_ptr != NULL) && (*end_ptr == '\0'), "Conversion of hexstring %s failed returned %ld errno %d", hex, uli, errno);
+              s1ap->binary_stream[pos++] = (unsigned char)uli;
+            } while (pos2 < (2*5));
+            // update ASN1
+            et_decode_s1ap(s1ap);
+            //S1AP_INFO("Updated ASN1 for %s\n", showname);
+          }
+        }
+      }
+    }
+    if (0 < go_deeper_in_tree) {
+      update_xpath_node_mme_ue_s1ap_id(s1ap, cur_node->children, new_id);
+    }
+  }
+}
+
+/**
+ * update_xpath_nodes:
+ * @nodes:    the nodes set.
+ * @value:    the new value for the node(s)
+ *
+ * Prints the @nodes content to @output.
+ * From http://www.xmlsoft.org/examples/#xpath2.c
+ */
+void update_xpath_nodes_mme_ue_s1ap_id(et_s1ap_t * const s1ap_payload, xmlNodeSetPtr nodes, const S1ap_MME_UE_S1AP_ID_t new_id)
+{
+  int           size = 0;
+  int           i    = 0;
+  xmlNode      *s1ap_node = NULL;
+
+  size = (nodes) ? nodes->nodeNr : 0;
+  //S1AP_DEBUG("%s() num nodes %u\n", __FUNCTION__, size);
+
+  /*
+   * NOTE: the nodes are processed in reverse order, i.e. reverse document
+   *       order because xmlNodeSetContent can actually free up descendant
+   *       of the node and such nodes may have been selected too ! Handling
+   *       in reverse order ensure that descendant are accessed first, before
+   *       they get removed. Mixing XPath and modifications on a tree must be
+   *       done carefully !
+   */
+  for(i = size - 1; i >= 0; i--) {
+    s1ap_node = nodes->nodeTab[i];
+    AssertFatal(NULL != s1ap_node, "One element of resultset of XPATH expression is NULL\n");
+    update_xpath_node_mme_ue_s1ap_id(s1ap_payload, s1ap_node, new_id);
+    /*
+     * All the elements returned by an XPath query are pointers to
+     * elements from the tree *except* namespace nodes where the XPath
+     * semantic is different from the implementation in libxml2 tree.
+     * As a result when a returned node set is freed when
+     * xmlXPathFreeObject() is called, that routine must check the
+     * element type. But node from the returned set may have been removed
+     * by xmlNodeSetContent() resulting in access to freed data.
+     * This can be exercised by running valgrind
+     * There is 2 ways around it:
+     *   - make a copy of the pointers to the nodes from the result set
+     *     then call xmlXPathFreeObject() and then modify the nodes
+     * or
+     *   - remove the reference to the modified nodes from the node set
+     *     as they are processed, if they are not namespace nodes.
+     */
+    if (nodes->nodeTab[i]->type != XML_NAMESPACE_DECL) {
+      nodes->nodeTab[i] = NULL;
+    }
+  }
+}
+//------------------------------------------------------------------------------
+int et_s1ap_update_mme_ue_s1ap_id(et_packet_t * const packet, const S1ap_MME_UE_S1AP_ID_t old_id, const S1ap_MME_UE_S1AP_ID_t new_id)
+{
+
+
+  xmlChar              xpath_expression[ET_XPATH_EXPRESSION_MAX_LENGTH];
+  int                  ret       = 0;
+  xmlDocPtr            doc       = NULL;
+  xmlXPathContextPtr   xpath_ctx = NULL;
+  xmlXPathObjectPtr    xpath_obj = NULL;
+
+  //S1AP_DEBUG("%s() packet num %u original frame number %u, mme_ue_s1ap_id %u -> %u\n", __FUNCTION__, packet->packet_number, packet->original_frame_number, old_id, new_id);
+
+  ret = snprintf(xpath_expression, ET_XPATH_EXPRESSION_MAX_LENGTH, "//field[@name=\"s1ap.MME_UE_S1AP_ID\"][@show=\"%u\"]", old_id);
+  AssertFatal((ret > 0) && (ret < ET_XPATH_EXPRESSION_MAX_LENGTH), "Could not build XPATH expression err=%d", ret);
+
+  doc = packet->sctp_hdr.u.data_hdr.payload.doc;
+  // Create xpath evaluation context
+  xpath_ctx = xmlXPathNewContext(doc);
+  if(xpath_ctx == NULL) {
+      fprintf(stderr,"Error: unable to create new XPath context\n");
+      xmlFreeDoc(doc);
+      return(-1);
+  }
+
+  // Evaluate xpath expression
+  xpath_obj = xmlXPathEvalExpression(xpath_expression, xpath_ctx);
+  xmlXPathFreeContext(xpath_ctx);
+  AssertFatal(xpath_obj != NULL, "Unable to evaluate XPATH expression \"%s\"\n", xpath_expression);
+
+  if(xmlXPathNodeSetIsEmpty(xpath_obj->nodesetval)){
+    xmlXPathFreeObject(xpath_obj);
+    S1AP_DEBUG("%s() No match \"%s\"packet num %u original frame number %u, mme_ue_s1ap_id %u -> %u\n",
+        __FUNCTION__, xpath_expression, packet->packet_number, packet->original_frame_number, old_id, new_id);
+    return -1;
+  }
+  // update selected nodes
+  update_xpath_nodes_mme_ue_s1ap_id(&packet->sctp_hdr.u.data_hdr.payload, xpath_obj->nodesetval, new_id);
+
+  // Cleanup of XPath data
+  xmlXPathFreeObject(xpath_obj);
+
+  return 0;
+}
diff --git a/openair3/TEST/EPC_TEST/play_scenario_s1ap_eNB_defs.h b/openair3/TEST/EPC_TEST/play_scenario_s1ap_eNB_defs.h
new file mode 100644
index 0000000000000000000000000000000000000000..ac77b88b247281e1508035c83348fab707e4e96b
--- /dev/null
+++ b/openair3/TEST/EPC_TEST/play_scenario_s1ap_eNB_defs.h
@@ -0,0 +1,250 @@
+/*******************************************************************************
+    OpenAirInterface
+    Copyright(c) 1999 - 2014 Eurecom
+
+    OpenAirInterface is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+
+    OpenAirInterface is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenAirInterface.The full GNU General Public License is
+   included in this distribution in the file called "COPYING". If not,
+   see <http://www.gnu.org/licenses/>.
+
+  Contact Information
+  OpenAirInterface Admin: openair_admin@eurecom.fr
+  OpenAirInterface Tech : openair_tech@eurecom.fr
+  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+
+  Address      : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
+
+ *******************************************************************************/
+
+#include <stdint.h>
+
+#include "queue.h"
+#include "tree.h"
+
+#include "sctp_eNB_defs.h"
+
+#ifndef PLAY_SCENARIO_S1AP_ENB_DEFS_H_
+#define PLAY_SCENARIO_S1AP_ENB_DEFS_H_
+
+#define ENB_TAC (1)
+#define ENB_MCC (208)
+#define ENB_MNC (92)
+
+#define ENB_NAME        "Eurecom ENB"
+#define ENB_NAME_FORMAT (ENB_NAME" %u")
+
+#define S1AP_PORT_NUMBER        (36412)
+#define S1AP_SCTP_PPID          (18)
+
+#define X2AP_PORT_NUMBER        (36422)
+#define X2AP_SCTP_PPID          (27)
+
+#define S1AP_ENB_NAME_LENGTH_MAX    (150)
+
+typedef enum {
+  /* Disconnected state: initial state for any association. */
+  S1AP_ENB_STATE_DISCONNECTED = 0x0,
+  /* State waiting for S1 Setup response message if eNB is MME accepted or
+   * S1 Setup failure if MME rejects the eNB.
+   */
+  S1AP_ENB_STATE_WAITING     = 0x1,
+  /* The eNB is successfully connected to MME, UE contexts can be created. */
+  S1AP_ENB_STATE_CONNECTED   = 0x2,
+  /* The MME has sent an overload start message. Once the MME disables the
+   * OVERLOAD marker, the state of the association will be
+   * S1AP_ENB_STATE_CONNECTED.
+   */
+  S1AP_ENB_OVERLOAD          = 0x3,
+  /* Max number of states available */
+  S1AP_ENB_STATE_MAX,
+} s1ap_eNB_state_t;
+
+
+/* If the Overload Action IE in the OVERLOAD START message is set to
+ * - “reject all RRC connection establishments for non-emergency mobile
+ *    originated data transfer “ (i.e. reject traffic corresponding to RRC cause
+ *    “mo-data “ (TS 36.331 [16])), or
+ * - “reject all RRC connection establishments for signalling “ (i.e. reject
+ *    traffic corresponding to RRC cause “modata” and “mo-signalling”
+ *    (TS 36.331 [16])),or
+ * - “only permit RRC connection establishments for emergency sessions and
+ *    mobile terminated services” (i.e. only permit traffic corresponding to RRC
+ *    cause “emergency” and “mt-Access” (TS 36.331 [16])).
+ *
+ * NOTE: When the Overload Action IE is set to “only permit RRC connection
+ * establishments for emergency sessions and mobile terminated services”,
+ * emergency calls with RRC cause “highPriorityAcess” from high priority users
+ * are rejected (TS 24.301 [24]).
+ */
+typedef enum {
+  S1AP_OVERLOAD_REJECT_MO_DATA        = 0x0,
+  S1AP_OVERLOAD_REJECT_ALL_SIGNALLING = 0x1,
+  S1AP_OVERLOAD_ONLY_EMERGENCY_AND_MT = 0x2,
+  S1AP_NO_OVERLOAD                    = 0x3,
+  S1AP_OVERLOAD_MAX,
+} s1ap_overload_state_t;
+
+/* Served PLMN identity element */
+struct plmn_identity_s {
+  uint16_t mcc;
+  uint16_t mnc;
+  uint8_t  mnc_digit_length;
+  STAILQ_ENTRY(plmn_identity_s) next;
+};
+
+/* Served group id element */
+struct served_group_id_s {
+  uint16_t mme_group_id;
+  STAILQ_ENTRY(served_group_id_s) next;
+};
+
+/* Served mme code for a particular MME */
+struct mme_code_s {
+  uint8_t mme_code;
+  STAILQ_ENTRY(mme_code_s) next;
+};
+
+/* Served gummei element */
+struct served_gummei_s {
+  /* Number of MME served PLMNs */
+  uint8_t nb_served_plmns;
+  /* List of served PLMNs by MME */
+  STAILQ_HEAD(served_plmns_s, plmn_identity_s) served_plmns;
+
+  /* Number of group id in list */
+  uint8_t nb_group_id;
+  /* Served group id list */
+  STAILQ_HEAD(served_group_ids_s, served_group_id_s) served_group_ids;
+
+  /* Number of MME code */
+  uint8_t nb_mme_code;
+  /* MME Code to uniquely identify an MME within an MME pool area */
+  STAILQ_HEAD(mme_codes_s, mme_code_s) mme_codes;
+
+  /* Next GUMMEI element */
+  STAILQ_ENTRY(served_gummei_s) next;
+};
+
+struct s1ap_eNB_instance_s;
+
+/* This structure describes association of a eNB to a MME */
+typedef struct s1ap_eNB_mme_data_s {
+  /* MME descriptors tree, ordered by sctp assoc id */
+  RB_ENTRY(s1ap_eNB_mme_data_s) entry;
+
+  /* This is the optional name provided by the MME */
+  char *mme_name;
+  net_ip_address_t    mme_net_ip_address; // useful for joining assoc_id and ip address of packets
+
+  /* List of served GUMMEI per MME. There is one GUMMEI per RAT with a max
+   * number of 8 RATs but in our case only one is used. The LTE related pool
+   * configuration is included on the first place in the list.
+   */
+  STAILQ_HEAD(served_gummeis_s, served_gummei_s) served_gummei;
+
+  /* Relative processing capacity of an MME with respect to the other MMEs
+   * in the pool in order to load-balance MMEs within a pool as defined
+   * in TS 23.401.
+   */
+  uint8_t relative_mme_capacity;
+
+  /* Current MME overload information (if any). */
+  s1ap_overload_state_t overload_state;
+  /* Current eNB->MME S1AP association state */
+  s1ap_eNB_state_t state;
+
+  /* Next usable stream for UE signalling */
+  int32_t nextstream;
+
+  /* Number of input/ouput streams */
+  uint16_t in_streams;
+  uint16_t out_streams;
+
+  /* Connexion id used between SCTP/S1AP */
+  uint16_t cnx_id;
+
+  /* SCTP association id */
+  int32_t  assoc_id;
+
+  /* Only meaningfull in virtual mode */
+  struct s1ap_eNB_instance_s *s1ap_eNB_instance;
+} s1ap_eNB_mme_data_t;
+
+typedef struct s1ap_eNB_instance_s {
+  /* Next s1ap eNB association.
+   * Only used for virtual mode.
+   */
+  STAILQ_ENTRY(s1ap_eNB_instance_s) s1ap_eNB_entries;
+
+  /* Number of MME requested by eNB (tree size) */
+  uint32_t s1ap_mme_nb;
+  /* Number of MME for which association is pending */
+  uint32_t s1ap_mme_pending_nb;
+  /* Number of MME successfully associated to eNB */
+  uint32_t s1ap_mme_associated_nb;
+  /* Tree of S1AP MME associations ordered by association ID */
+  RB_HEAD(s1ap_mme_map, s1ap_eNB_mme_data_s) s1ap_mme_head;
+
+  /* TODO: add a map ordered by relative MME capacity */
+
+  /* Tree of UE ordered by eNB_ue_s1ap_id's */
+  RB_HEAD(s1ap_ue_map, s1ap_eNB_ue_context_s) s1ap_ue_head;
+
+  /* For virtual mode, mod_id as defined in the rest of the L1/L2 stack */
+  instance_t instance;
+
+  /* Displayable name of eNB */
+  char *eNB_name;
+  net_ip_address_t    s1c_net_ip_address;
+
+  /* Unique eNB_id to identify the eNB within EPC.
+   * In our case the eNB is a macro eNB so the id will be 20 bits long.
+   * For Home eNB id, this field should be 28 bits long.
+   */
+  uint32_t eNB_id;
+  /* The type of the cell */
+  enum cell_type_e cell_type;
+
+  /* Tracking area code */
+  uint16_t tac;
+
+  /* Mobile Country Code
+   * Mobile Network Code
+   */
+  uint16_t  mcc;
+  uint16_t  mnc;
+  uint8_t   mnc_digit_length;
+
+} s1ap_eNB_instance_t;
+
+typedef struct {
+  /* List of served eNBs
+   * Only used for virtual mode
+   */
+  STAILQ_HEAD(s1ap_eNB_instances_head_s, s1ap_eNB_instance_s) s1ap_eNB_instances_head;
+  /* Nb of registered eNBs */
+  uint8_t nb_registered_eNBs;
+
+  /* Generate a unique connexion id used between S1AP and SCTP */
+  uint16_t global_cnx_id;
+} s1ap_eNB_internal_data_t;
+
+int s1ap_eNB_compare_assoc_id(
+  struct s1ap_eNB_mme_data_s *p1, struct s1ap_eNB_mme_data_s *p2);
+
+/* Generate the tree management functions */
+RB_PROTOTYPE(s1ap_mme_map, s1ap_eNB_mme_data_s, entry,
+             s1ap_eNB_compare_assoc_id);
+
+#endif /* PLAY_SCENARIO_S1AP_ENB_DEFS_H_ */
diff --git a/openair3/TEST/EPC_TEST/play_scenario_sctp.c b/openair3/TEST/EPC_TEST/play_scenario_sctp.c
new file mode 100644
index 0000000000000000000000000000000000000000..5d5489089b82e7c052123e68c2e8c4b4921902f5
--- /dev/null
+++ b/openair3/TEST/EPC_TEST/play_scenario_sctp.c
@@ -0,0 +1,112 @@
+/*******************************************************************************
+    OpenAirInterface
+    Copyright(c) 1999 - 2014 Eurecom
+
+    OpenAirInterface is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+
+    OpenAirInterface is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenAirInterface.The full GNU General Public License is
+    included in this distribution in the file called "COPYING". If not,
+    see <http://www.gnu.org/licenses/>.
+
+  Contact Information
+  OpenAirInterface Admin: openair_admin@eurecom.fr
+  OpenAirInterface Tech : openair_tech@eurecom.fr
+  OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+
+  Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+ *******************************************************************************/
+
+/*
+                                play_scenario_sctp.c
+                                -------------------
+  AUTHOR  : Lionel GAUTHIER
+  COMPANY : EURECOM
+  EMAIL   : Lionel.Gauthier@eurecom.fr
+ */
+
+
+#include <errno.h>
+
+#include "intertask_interface.h"
+#include "platform_types.h"
+#include "assertions.h"
+#include "play_scenario.h"
+
+//------------------------------------------------------------------------------
+asn_comp_rval_t * et_sctp_data_is_matching(sctp_datahdr_t * const sctp1, sctp_datahdr_t * const sctp2, const uint32_t constraints)
+{
+  asn_comp_rval_t *rv = NULL;
+  // no comparison for ports
+  if (sctp1->ppid     != sctp2->ppid) {
+    S1AP_WARN("No Matching SCTP PPID %u %u\n", sctp1->ppid, sctp2->ppid);
+    rv  = calloc(1, sizeof(asn_comp_rval_t));
+    rv->err_code = ET_ERROR_MATCH_PACKET_SCTP_PPID;
+    return rv;
+  }
+  if (sctp1->assoc_id != sctp2->assoc_id) {
+    S1AP_WARN("No Matching SCTP assoc id %u %u\n", sctp1->assoc_id, sctp2->assoc_id);
+    rv  = calloc(1, sizeof(asn_comp_rval_t));
+    rv->err_code = ET_ERROR_MATCH_PACKET_SCTP_ASSOC_ID;
+    return rv;
+  }
+  if (sctp1->stream != sctp2->stream) {
+    if (constraints & ET_BIT_MASK_MATCH_SCTP_STREAM) {
+      rv  = calloc(1, sizeof(asn_comp_rval_t));
+      rv->err_code = ET_ERROR_MATCH_PACKET_SCTP_STREAM_ID;
+      return rv;
+    } else {
+      S1AP_WARN("No Matching SCTP stream %u %u\n", sctp1->stream, sctp2->stream);
+    }
+  }
+  // We do not have SSN from lower layers
+//  if (sctp1->ssn != sctp2->ssn) {
+//    if (constraints & ET_BIT_MASK_MATCH_SCTP_SSN) {
+//      rv  = calloc(1, sizeof(asn_comp_rval_t));
+//      rv->err_code = ET_ERROR_MATCH_PACKET_SCTP_SSN;
+//      return rv;
+//    } else {
+//      S1AP_WARN("No Matching SCTP STREAM SN %u %u\n", sctp1->ssn, sctp2->ssn);
+//    }
+//  }
+  return et_s1ap_is_matching(&sctp1->payload, &sctp2->payload,  constraints);
+}
+
+//------------------------------------------------------------------------------
+asn_comp_rval_t *  et_sctp_is_matching(et_sctp_hdr_t * const sctp1, et_sctp_hdr_t * const sctp2, const uint32_t constraints)
+{
+  // no comparison for ports
+  asn_comp_rval_t *rv = NULL;
+  if (sctp1->chunk_type != sctp2->chunk_type){
+    S1AP_WARN("No Matching chunk_type %u %u\n", sctp1->chunk_type, sctp2->chunk_type);
+    rv  = calloc(1, sizeof(asn_comp_rval_t));
+    rv->err_code = ET_ERROR_MATCH_PACKET_SCTP_CHUNK_TYPE;
+    return rv;
+  }
+  switch (sctp1->chunk_type) {
+    case SCTP_CID_DATA:
+      return et_sctp_data_is_matching(&sctp1->u.data_hdr, &sctp2->u.data_hdr, constraints);
+      break;
+
+    case SCTP_CID_INIT:
+      AssertFatal(0, "Not needed now");
+      break;
+    case SCTP_CID_INIT_ACK:
+      AssertFatal(0, "Not needed now");
+      break;
+    default:
+      AssertFatal(0, "Not needed now cid %d", sctp1->chunk_type);
+  }
+
+  return NULL;
+}
diff --git a/openair3/UDP/udp_eNB_task.c b/openair3/UDP/udp_eNB_task.c
index 3e53f9f62f01b66989500f01a446a93a7008ba58..d2a73d9b95ad3abfb0f090fa2ba26f5702bfab80 100644
--- a/openair3/UDP/udp_eNB_task.c
+++ b/openair3/UDP/udp_eNB_task.c
@@ -300,8 +300,8 @@ void *udp_eNB_task(void *args_p)
   int                 nb_events;
   struct epoll_event *events;
   MessageDef         *received_message_p    = NULL;
-  const char         *msg_name = NULL;
-  instance_t          instance  = 0;
+  //const char         *msg_name = NULL;
+  //instance_t          instance  = 0;
   udp_enb_init(NULL);
 
   itti_mark_task_ready(TASK_UDP);
@@ -316,8 +316,8 @@ void *udp_eNB_task(void *args_p)
 
     if (received_message_p != NULL) {
 
-      msg_name = ITTI_MSG_NAME (received_message_p);
-      instance = ITTI_MSG_INSTANCE (received_message_p);
+      //msg_name = ITTI_MSG_NAME (received_message_p);
+      //instance = ITTI_MSG_INSTANCE (received_message_p);
 
       switch (ITTI_MSG_ID(received_message_p)) {
       case UDP_INIT: {
diff --git a/openair3/UTILS/conversions.h b/openair3/UTILS/conversions.h
index aaa2b9714f1fbf504c6a934cf2d613c25944312a..47912f0d92eb1e85c9890b125bd5de00d319d151 100644
--- a/openair3/UTILS/conversions.h
+++ b/openair3/UTILS/conversions.h
@@ -275,7 +275,6 @@ do {                                                    \
     (bITsTRING)->size = 3;                              \
     (bITsTRING)->bits_unused = 4;                       \
 } while(0)
-/*
 /* TS 36.413 v10.9.0 section 9.2.1.38:
  * E-UTRAN CGI/Cell Identity
  * The leftmost bits of the Cell
diff --git a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c
index d515a206ae8e0683ff5ba4529107fe6fbb0b6f5a..6cc1d8c5d2dfec4fe75f4e9d4674e0e74124452d 100644
--- a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c
+++ b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c
@@ -37,58 +37,94 @@
 #include <stdlib.h>
 #include <inttypes.h>
 #include "bladerf_lib.h"
+#include "math.h"
+
+/** @addtogroup _BLADERF_PHY_RF_INTERFACE_
+ * @{
+ */
+
+//! Number of BladeRF devices 
+#ifdef __SSE4_1__
+#  include <smmintrin.h>
+#endif
+ 
+#ifdef __AVX2__
+#  include <immintrin.h>
+#endif
 
 int num_devices=0;
+
 /*These items configure the underlying asynch stream used by the the sync interface. 
  */
 
-int trx_brf_init(openair0_device *openair0) {
-  
+/*! \brief BladeRF Init function (not used at the moment)
+ * \param device RF frontend parameters set by application
+ * \returns 0 on success
+ */
+int trx_brf_init(openair0_device *device) {
+   return 0;
 }
 
+/*! \brief get current timestamp
+ *\param device the hardware to use 
+ *\param module the bladeRf module
+ *\returns timestamp of BladeRF
+ */
  
-openair0_timestamp trx_get_timestamp(openair0_device *device) {
+openair0_timestamp trx_get_timestamp(openair0_device *device, bladerf_module module) {
   int status;
   struct bladerf_metadata meta;
   brf_state_t *brf = (brf_state_t*)device->priv;
+  memset(&meta, 0, sizeof(meta));
   
-  if ((status=bladerf_get_timestamp(brf->dev, BLADERF_MODULE_TX, &meta.timestamp)) != 0) {
-    fprintf(stderr,"Failed to get current RX timestamp: %s\n",bladerf_strerror(status));
-  } else {
-    printf("Current TX timestampe  0x%016"PRIx64"\n", meta.timestamp);
-  }
+  if ((status=bladerf_get_timestamp(brf->dev, module, &meta.timestamp)) != 0) {
+    fprintf(stderr,"Failed to get current %s timestamp: %s\n",(module == BLADERF_MODULE_RX ) ? "RX" : "TX", bladerf_strerror(status));
+    return -1; 
+  } // else {printf("Current RX timestampe  0x%016"PRIx64"\n", meta.timestamp); }
+
   return meta.timestamp;
 }
 
-
-int trx_brf_start(openair0_device *openair0) {
+/*! \brief Start BladeRF
+ * \param device the hardware to use 
+ * \returns 0 on success
+ */
+int trx_brf_start(openair0_device *device) {
 
   return 0;
 }
 
-static void trx_brf_stats(openair0_device *device){
-
-
-}
-
-static int trx_brf_write(openair0_device *device,openair0_timestamp ptimestamp, void **buff, int nsamps, int cc) {
+/*! \brief Called to send samples to the BladeRF RF target
+      \param device pointer to the device structure specific to the RF hardware target
+      \param timestamp The timestamp at whicch the first sample MUST be sent 
+      \param buff Buffer which holds the samples
+      \param nsamps number of samples to be sent
+      \param cc index of the component carrier
+      \param flags Ignored for the moment
+      \returns 0 on success
+*/ 
+static int trx_brf_write(openair0_device *device,openair0_timestamp ptimestamp, void **buff, int nsamps, int cc, int flags) {
   
-  int status, i;
+  int status;
   brf_state_t *brf = (brf_state_t*)device->priv;
   /* BRF has only 1 rx/tx chaine : is it correct? */
-  void *samples = (void*)buff[0];
+  int16_t *samples = (int16_t*)buff[0];
   
-  //brf->meta_tx.flags &= ~BLADERF_META_FLAG_TX_NOW;
-  brf->meta_tx.flags = BLADERF_META_FLAG_TX_BURST_START | 
-    BLADERF_META_FLAG_TX_NOW | 
-                       BLADERF_META_FLAG_TX_BURST_END;
-
-  brf->meta_tx.timestamp= (uint64_t) ptimestamp;
-
+  //memset(&brf->meta_tx, 0, sizeof(brf->meta_tx));
+  // When  BLADERF_META_FLAG_TX_NOW is used the timestamp is not used, so one can't schedule a tx 
+  if (brf->meta_tx.flags == 0 ) 
+    brf->meta_tx.flags = (BLADERF_META_FLAG_TX_BURST_START);// | BLADERF_META_FLAG_TX_BURST_END);// |  BLADERF_META_FLAG_TX_NOW);
+  
+  
+  brf->meta_tx.timestamp= (uint64_t) (ptimestamp); 
   status = bladerf_sync_tx(brf->dev, samples, (unsigned int) nsamps, &brf->meta_tx, 2*brf->tx_timeout_ms);
+ 
+  if (brf->meta_tx.flags == BLADERF_META_FLAG_TX_BURST_START) 
+    brf->meta_tx.flags =  BLADERF_META_FLAG_TX_UPDATE_TIMESTAMP;
   
+
   if (status != 0) {
-    fprintf(stderr,"Failed to TX sample: %s\n", bladerf_strerror(status));
+    //fprintf(stderr,"Failed to TX sample: %s\n", bladerf_strerror(status));
     brf->num_tx_errors++;
     brf_error(status);
   } else if (brf->meta_tx.status & BLADERF_META_STATUS_UNDERRUN){
@@ -96,6 +132,8 @@ static int trx_brf_write(openair0_device *device,openair0_timestamp ptimestamp,
     fprintf(stderr, "TX Underrun detected. %u valid samples were read.\n",  brf->meta_tx.actual_count);
     brf->num_underflows++;
   } 
+  //printf("Provided TX timestampe  %u, meta timestame %u\n", ptimestamp,brf->meta_tx.timestamp);
+  
   //    printf("tx status %d \n",brf->meta_tx.status);
   brf->tx_current_ts=brf->meta_tx.timestamp;
   brf->tx_actual_nsamps+=brf->meta_tx.actual_count;
@@ -106,27 +144,41 @@ static int trx_brf_write(openair0_device *device,openair0_timestamp ptimestamp,
   return(0);
 }
 
+/*! \brief Receive samples from hardware.
+ * Read \ref nsamps samples from each channel to buffers. buff[0] is the array for
+ * the first channel. *ptimestamp is the time at which the first sample
+ * was received.
+ * \param device the hardware to use
+ * \param[out] ptimestamp the time at which the first sample was received.
+ * \param[out] buff An array of pointers to buffers for received samples. The buffers must be large enough to hold the number of samples \ref nsamps.
+ * \param nsamps Number of samples. One sample is 2 byte I + 2 byte Q => 4 byte.
+ * \param cc  Index of component carrier
+ * \returns number of samples read
+*/
 static int trx_brf_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) {
-  int status, ret;
-  
-  unsigned int i;
+
+  int status=0;
   brf_state_t *brf = (brf_state_t*)device->priv;
   
   // BRF has only one rx/tx chain
-  void *samples = (void*)buff[0];
- 
-  brf->meta_rx.flags |= BLADERF_META_FLAG_RX_NOW;
+  int16_t *samples = (int16_t*)buff[0];
+  
+  brf->meta_rx.flags = BLADERF_META_FLAG_RX_NOW;
   status = bladerf_sync_rx(brf->dev, samples, (unsigned int) nsamps, &brf->meta_rx, 2*brf->rx_timeout_ms);
   
+  //  printf("Current RX timestampe  %u, nsamps %u, actual %u, cc %d\n",  brf->meta_rx.timestamp, nsamps, brf->meta_rx.actual_count, cc);
+   
   if (status != 0) {
     fprintf(stderr, "RX failed: %s\n", bladerf_strerror(status)); 
+    //    printf("RX failed: %s\n", bladerf_strerror(status)); 
     brf->num_rx_errors++;
   } else if ( brf->meta_rx.status & BLADERF_META_STATUS_OVERRUN) {
     brf->num_overflows++;
-    fprintf(stderr, "RX overrun (%d) is detected. t=0x%"PRIu64". Got %u samples. nsymps %d\n", 
-	    brf->num_overflows,brf->meta_rx.timestamp,  brf->meta_rx.actual_count, nsamps);
-    //brf->meta_rx.timestamp=(unsigned int)(nsamps-brf->meta_rx.actual_count);
-  }
+    printf("RX overrun (%d) is detected. t=" "%" PRIu64 "Got %u samples. nsymps %d\n", 
+	   brf->num_overflows,brf->meta_rx.timestamp,  brf->meta_rx.actual_count, nsamps);
+  } 
+
+  //printf("Current RX timestampe  %u\n",  brf->meta_rx.timestamp);
   //printf("[BRF] (buff %p) ts=0x%"PRIu64" %s\n",samples, brf->meta_rx.timestamp,bladerf_strerror(status));
   brf->rx_current_ts=brf->meta_rx.timestamp;
   brf->rx_actual_nsamps+=brf->meta_rx.actual_count;
@@ -135,12 +187,15 @@ static int trx_brf_read(openair0_device *device, openair0_timestamp *ptimestamp,
   
   
   *ptimestamp = brf->meta_rx.timestamp;
-  
+ 
   return brf->meta_rx.actual_count;
 
 }
 
-int trx_brf_end(openair0_device *device) {
+/*! \brief Terminate operation of the BladeRF transceiver -- free all associated resources 
+ * \param device the hardware to use
+ */
+void trx_brf_end(openair0_device *device) {
 
   int status;
   brf_state_t *brf = (brf_state_t*)device->priv;
@@ -152,58 +207,752 @@ int trx_brf_end(openair0_device *device) {
     fprintf(stderr, "Failed to disable TX module: %s\n",  bladerf_strerror(status));
   }
   bladerf_close(brf->dev);
-  return 0;
 }
 
-
+/*! \brief print the BladeRF statistics  
+* \param device the hardware to use
+* \returns  0 on success
+*/
 int trx_brf_get_stats(openair0_device* device) {
 
   return(0);
 
 }
 
+/*! \brief Reset the BladeRF statistics  
+* \param device the hardware to use
+* \returns  0 on success
+*/
 int trx_brf_reset_stats(openair0_device* device) {
 
   return(0);
 
 }
 
-int trx_brf_stop(openair0_device* device) {
+/*! \brief Stop BladeRF
+ * \param card the hardware to use
+ * \returns 0 in success 
+ */
+int trx_brf_stop(int card) {
 
   return(0);
 
 }
 
-int trx_brf_set_freq(openair0_device* device) {
+/*! \brief Set frequencies (TX/RX)
+ * \param device the hardware to use
+ * \param openair0_cfg1 openair0 Config structure (ignored. It is there to comply with RF common API)
+ * \param exmimo_dump_config (ignored)
+ * \returns 0 in success 
+ */
+int trx_brf_set_freq(openair0_device* device, openair0_config_t *openair0_cfg1,int exmimo_dump_config) {
+
+  int status;
+  brf_state_t *brf = (brf_state_t *)device->priv;
+  openair0_config_t *openair0_cfg = (openair0_config_t *)device->openair0_cfg;
+
+
+  if ((status=bladerf_set_frequency(brf->dev, BLADERF_MODULE_TX, (unsigned int) openair0_cfg->tx_freq[0])) != 0){
+    fprintf(stderr,"Failed to set TX frequency: %s\n",bladerf_strerror(status));
+    brf_error(status);
+  }else 
+    printf("[BRF] set TX Frequency to %u\n", (unsigned int) openair0_cfg->tx_freq[0]);
+
+  if ((status=bladerf_set_frequency(brf->dev, BLADERF_MODULE_RX, (unsigned int) openair0_cfg->rx_freq[0])) != 0){
+    fprintf(stderr,"Failed to set RX frequency: %s\n",bladerf_strerror(status));
+    brf_error(status);
+  } else 
+    printf("[BRF] set RX frequency to %u\n",(unsigned int)openair0_cfg->rx_freq[0]);
 
   return(0);
 
 }
-int trx_brf_set_gains(openair0_device* device) {
+
+/*! \brief Set Gains (TX/RX)
+ * \param device the hardware to use
+ * \param openair0_cfg openair0 Config structure
+ * \returns 0 in success 
+ */
+int trx_brf_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) {
 
   return(0);
 
 }
 
-int openair0_dev_init_bladerf(openair0_device *device, openair0_config_t *openair0_cfg) {
 
-  int status;
-  int card=0;
+
+#define RXDCLENGTH 16384
+int16_t cos_fsover8[8]  = {2047,   1447,      0,  -1448,  -2047,  -1448,     0,   1447};
+int16_t cos_3fsover8[8] = {2047,  -1448,      0,   1447,  -2047,   1447,     0,  -1448};
+
+/*! \brief calibration table for BladeRF */
+rx_gain_calib_table_t calib_table_fx4[] = {
+  {2300000000.0,53.5},
+  {1880000000.0,57.0},
+  {816000000.0,73.0},
+  {-1,0}};
+
+/*! \brief set RX gain offset from calibration table
+ * \param openair0_cfg RF frontend parameters set by application
+ * \param chain_index RF chain ID
+ */
+void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) {
+
+  int i=0;
+  // loop through calibration table to find best adjustment factor for RX frequency
+  double min_diff = 6e9,diff;
+  
+  while (openair0_cfg->rx_gain_calib_table[i].freq>0) {
+    diff = fabs(openair0_cfg->rx_freq[chain_index] - openair0_cfg->rx_gain_calib_table[i].freq);
+    printf("cal %d: freq %f, offset %f, diff %f\n",
+	   i,
+	   openair0_cfg->rx_gain_calib_table[i].freq,
+	   openair0_cfg->rx_gain_calib_table[i].offset,diff);
+    if (min_diff > diff) {
+      min_diff = diff;
+      openair0_cfg->rx_gain_offset[chain_index] = openair0_cfg->rx_gain_calib_table[i].offset;
+    }
+    i++;
+  }
+  
+}
+
+/*! \brief Calibrate LMSSDR RF 
+ * \param device the hardware to use
+ */
+void calibrate_rf(openair0_device *device) {
+
+
+  brf_state_t *brf = (brf_state_t *)device->priv;
+  openair0_timestamp ptimestamp;
+  int16_t *calib_buffp,*calib_tx_buffp;
+  int16_t calib_buff[2*RXDCLENGTH];
+  int16_t calib_tx_buff[2*RXDCLENGTH];
+  int i,j,offI,offQ,offIold,offQold,offInew,offQnew,offphase,offphaseold,offphasenew,offgain,offgainold,offgainnew;
+  int32_t meanI,meanQ,meanIold,meanQold;
+  int cnt=0,loop;
+
+  // put TX on a far-away frequency to avoid interference in RX band
+  bladerf_set_frequency(brf->dev,BLADERF_MODULE_TX, (unsigned int) device->openair0_cfg->rx_freq[0] + 200e6);  
+  // Set gains to close to max
+  bladerf_set_gain(brf->dev, BLADERF_MODULE_RX, 60);
+  bladerf_set_gain(brf->dev, BLADERF_MODULE_TX, 60);
+
+  // fill TX buffer with fs/8 complex sinusoid
+  j=0;
+  for (i=0;i<RXDCLENGTH;i++) {
+    calib_tx_buff[j++] = cos_fsover8[i&7];
+    calib_tx_buff[j++] = cos_fsover8[(i+6)&7];  // sin
+  }
+  calib_buffp = &calib_buff[0];
+  calib_tx_buffp = &calib_tx_buff[0];
+  // Calibrate RX DC offset
+
+  offIold=offQold=2048;
+  bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_LMS_DCOFF_I,offIold);
+  bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_LMS_DCOFF_Q,offQold);
+  for (i=0;i<10;i++)
+    trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
   
+  for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) {
+    meanIold+=calib_buff[j++];
+    meanQold+=calib_buff[j++];
+  }
+  meanIold/=RXDCLENGTH;
+  meanQold/=RXDCLENGTH;
+  printf("[BRF] RX DC: (%d,%d) => (%d,%d)\n",offIold,offQold,meanIold,meanQold);
+
+  offI=offQ=-2048;
+  bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_LMS_DCOFF_I,offI);
+  bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_LMS_DCOFF_Q,offQ);
+  for (i=0;i<10;i++)
+    trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
+  
+  for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
+    meanI+=calib_buff[j++];
+    meanQ+=calib_buff[j++];
+  }
+  meanI/=RXDCLENGTH;
+  meanQ/=RXDCLENGTH;
+  //  printf("[BRF] RX DC: (%d,%d) => (%d,%d)\n",offI,offQ,meanI,meanQ);
+
+  while (cnt++ < 12) {
+
+    offInew=(offIold+offI)>>1;
+    offQnew=(offQold+offQ)>>1;
+
+    if (meanI*meanI < meanIold*meanIold) {
+      meanIold = meanI;
+      offIold = offI;
+      printf("[BRF] *** RX DC: offI %d => %d\n",offIold,meanI);
+    }
+    if (meanQ*meanQ < meanQold*meanQold) {
+      meanQold = meanQ;
+      offQold = offQ;
+      printf("[BRF] *** RX DC: offQ %d => %d\n",offQold,meanQ);
+    }
+    offI = offInew;
+    offQ = offQnew;
+    bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_LMS_DCOFF_I,offI);
+    bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_LMS_DCOFF_Q,offQ);
+
+    for (i=0;i<10;i++)
+      trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
+    
+    for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
+      meanI+=calib_buff[j++];
+      meanQ+=calib_buff[j++];
+    }
+    meanI/=RXDCLENGTH;
+    meanQ/=RXDCLENGTH;
+    printf("[BRF] RX DC: (%d,%d) => (%d,%d)\n",offI,offQ,meanI,meanQ);
+  }
+
+  printf("[BRF] RX DC: (%d,%d) => (%d,%d)\n",offIold,offQold,meanIold,meanQold);
+  bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_LMS_DCOFF_I,offIold);
+  bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_LMS_DCOFF_Q,offQold);
+
+  // TX DC offset
+  // PUT TX as f_RX + fs/4
+  // loop back BLADERF_LB_RF_LNA1
+  bladerf_set_frequency(brf->dev,BLADERF_MODULE_TX, (unsigned int) device->openair0_cfg->rx_freq[0] + (unsigned int) device->openair0_cfg->sample_rate/4);  
+  bladerf_set_loopback (brf->dev,BLADERF_LB_RF_LNA1);
+
+  offIold=2048;
+  bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_I,offIold);
+  for (i=0;i<10;i++) {
+    trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
+    trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
+  }
+  for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) {
+    switch (i&3) {
+    case 0:
+      meanIold+=calib_buff[j++];
+      break;
+    case 1:
+      meanQold+=calib_buff[j++];
+      break;
+    case 2:
+      meanIold-=calib_buff[j++];
+      break;
+    case 3:
+      meanQold-=calib_buff[j++];
+      break;
+    }
+  }
+  //  meanIold/=RXDCLENGTH;
+  //  meanQold/=RXDCLENGTH;
+  printf("[BRF] TX DC (offI): %d => (%d,%d)\n",offIold,meanIold,meanQold);
+
+  offI=-2048;
+  bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_I,offI);
+  for (i=0;i<10;i++) {
+    trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
+    trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
+  }
+  for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
+    switch (i&3) {
+    case 0:
+      meanI+=calib_buff[j++];
+      break;
+    case 1:
+      meanQ+=calib_buff[j++];
+      break;
+    case 2:
+      meanI-=calib_buff[j++];
+      break;
+    case 3:
+      meanQ-=calib_buff[j++];
+      break;
+    }
+  }
+  //  meanI/=RXDCLENGTH;
+  //  meanQ/=RXDCLENGTH;
+  printf("[BRF] TX DC (offI): %d => (%d,%d)\n",offI,meanI,meanQ);
+  cnt = 0;
+  while (cnt++ < 12) {
+
+    offInew=(offIold+offI)>>1;
+    if (meanI*meanI+meanQ*meanQ < meanIold*meanIold +meanQold*meanQold) {
+      printf("[BRF] TX DC (offI): ([%d,%d]) => %d : %d\n",offIold,offI,offInew,meanI*meanI+meanQ*meanQ);
+      meanIold = meanI;
+      meanQold = meanQ;
+      offIold = offI;
+    }
+    offI = offInew;
+    bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_I,offI);
+
+    for (i=0;i<10;i++) {
+      trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
+      trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
+    }
+    for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
+      switch (i&3) {
+      case 0:
+	meanI+=calib_buff[j++];
+	break;
+      case 1:
+	meanQ+=calib_buff[j++];
+	break;
+      case 2:
+	meanI-=calib_buff[j++];
+	break;
+      case 3:
+	meanQ-=calib_buff[j++];
+	break;
+      }
+    }
+    //    meanI/=RXDCLENGTH;
+    //   meanQ/=RXDCLENGTH;
+    //    printf("[BRF] TX DC (offI): %d => (%d,%d)\n",offI,meanI,meanQ);
+  }
+
+  bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_I,offIold);
+
+  offQold=2048;
+  bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_Q,offQold);
+  for (i=0;i<10;i++) {
+    trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
+    trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
+  }
+  // project on fs/4
+  for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) {
+    switch (i&3) {
+    case 0:
+      meanIold+=calib_buff[j++];
+      break;
+    case 1:
+      meanQold+=calib_buff[j++];
+      break;
+    case 2:
+      meanIold-=calib_buff[j++];
+      break;
+    case 3:
+      meanQold-=calib_buff[j++];
+      break;
+    }
+  }
+  //  meanIold/=RXDCLENGTH;
+  //  meanQold/=RXDCLENGTH;
+  printf("[BRF] TX DC (offQ): %d => (%d,%d)\n",offQold,meanIold,meanQold);
+
+  offQ=-2048;
+  bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_Q,offQ);
+  for (i=0;i<10;i++) {
+    trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
+    trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
+  }
+  for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
+    switch (i&3) {
+    case 0:
+      meanI+=calib_buff[j++];
+      break;
+    case 1:
+      meanQ+=calib_buff[j++];
+      break;
+    case 2:
+      meanI-=calib_buff[j++];
+      break;
+    case 3:
+      meanQ-=calib_buff[j++];
+      break;
+    }
+  }
+  //  meanI/=RXDCLENGTH;
+  //  meanQ/=RXDCLENGTH;
+  printf("[BRF] TX DC (offQ): %d => (%d,%d)\n",offQ,meanI,meanQ);
+
+  cnt=0;
+  while (cnt++ < 12) {
+
+    offQnew=(offQold+offQ)>>1;
+    if (meanI*meanI+meanQ*meanQ < meanIold*meanIold +meanQold*meanQold) {
+      printf("[BRF] TX DC (offQ): ([%d,%d]) => %d : %d\n",offQold,offQ,offQnew,meanI*meanI+meanQ*meanQ);
+
+      meanIold = meanI;
+      meanQold = meanQ;
+      offQold = offQ;
+    }
+    offQ = offQnew;
+    bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_Q,offQ);
+
+    for (i=0;i<10;i++) {
+      trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
+      trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
+    }
+    for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
+      switch (i&3) {
+      case 0:
+	meanI+=calib_buff[j++];
+	break;
+      case 1:
+	meanQ+=calib_buff[j++];
+	break;
+      case 2:
+	meanI-=calib_buff[j++];
+	break;
+      case 3:
+	meanQ-=calib_buff[j++];
+	break;
+      }
+    }
+    //    meanI/=RXDCLENGTH;
+    //   meanQ/=RXDCLENGTH;
+    //    printf("[BRF] TX DC (offQ): %d => (%d,%d)\n",offQ,meanI,meanQ);
+  }
+
+  printf("[BRF] TX DC: (%d,%d) => (%d,%d)\n",offIold,offQold,meanIold,meanQold);
+
+  bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_LMS_DCOFF_Q,offQold);
+
+  // TX IQ imbalance
+  for (loop=0;loop<2;loop++) {
+    offphaseold=4096;
+    bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_PHASE,offphaseold);
+    for (i=0;i<10;i++) {
+      trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
+      trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
+    }
+    // project on fs/8 (Image of TX signal in +ve frequencies)
+    for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) {
+      meanIold+= (calib_buff[j]*cos_fsover8[i&7] - calib_buff[j+1]*cos_fsover8[(i+2)&7])>>11;
+      meanQold+= (calib_buff[j]*cos_fsover8[(i+2)&7] + calib_buff[j+1]*cos_fsover8[i&7])>>11;
+      j+=2;
+    }
+    
+    meanIold/=RXDCLENGTH;
+    meanQold/=RXDCLENGTH;
+    printf("[BRF] TX IQ (offphase): %d => (%d,%d)\n",offphaseold,meanIold,meanQold);
+    
+    offphase=-4096;
+    bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_PHASE,offphase);
+    for (i=0;i<10;i++) {
+      trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
+      trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
+    }
+    // project on fs/8 (Image of TX signal in +ve frequencies)
+    for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
+      meanI+= (calib_buff[j]*cos_fsover8[i&7] - calib_buff[j+1]*cos_fsover8[(i+2)&7])>>11;
+      meanQ+= (calib_buff[j]*cos_fsover8[(i+2)&7] + calib_buff[j+1]*cos_fsover8[i&7])>>11;
+      j+=2;
+    }
+    
+    meanI/=RXDCLENGTH;
+    meanQ/=RXDCLENGTH;
+    printf("[BRF] TX IQ (offphase): %d => (%d,%d)\n",offphase,meanI,meanQ);
+    
+    cnt=0;
+    while (cnt++ < 13) {
+      
+      offphasenew=(offphaseold+offphase)>>1;
+      printf("[BRF] TX IQ (offphase): ([%d,%d]) => %d : %d\n",offphaseold,offphase,offphasenew,meanI*meanI+meanQ*meanQ);
+      if (meanI*meanI+meanQ*meanQ < meanIold*meanIold +meanQold*meanQold) {
+
+	
+	meanIold = meanI;
+	meanQold = meanQ;
+	offphaseold = offphase;
+      }
+      offphase = offphasenew;
+      bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_PHASE,offphase);
+      
+      for (i=0;i<10;i++) {
+	trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
+	trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
+      }
+      // project on fs/8 (Image of TX signal in +ve frequencies)
+      for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
+	meanI+= (calib_buff[j]*cos_fsover8[i&7] - calib_buff[j+1]*cos_fsover8[(i+2)&7])>>11;
+	meanQ+= (calib_buff[j]*cos_fsover8[(i+2)&7] + calib_buff[j+1]*cos_fsover8[i&7])>>11;
+	j+=2;
+      }
+      meanI/=RXDCLENGTH;
+      meanQ/=RXDCLENGTH;
+      
+      //    printf("[BRF] TX DC (offQ): %d => (%d,%d)\n",offQ,meanI,meanQ);
+    }
+    
+    printf("[BRF] TX IQ offphase: %d => (%d,%d)\n",offphaseold,meanIold,meanQold);
+    
+    bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_PHASE,offphaseold);
+    
+    offgainold=4096;
+    bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_GAIN,offgainold);
+    for (i=0;i<10;i++) {
+      trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
+      trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
+    }
+    // project on fs/8 (Image of TX signal in +ve frequencies)
+    for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) {
+      meanIold+= (calib_buff[j]*cos_fsover8[i&7] - calib_buff[j+1]*cos_fsover8[(i+2)&7])>>11;
+      meanQold+= (calib_buff[j]*cos_fsover8[(i+2)&7] + calib_buff[j+1]*cos_fsover8[i&7])>>11;
+      j+=2;
+    }
+    
+    meanIold/=RXDCLENGTH;
+    meanQold/=RXDCLENGTH;
+    printf("[BRF] TX IQ (offgain): %d => (%d,%d)\n",offgainold,meanIold,meanQold);
+    
+    offgain=-4096;
+    bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_GAIN,offgain);
+    for (i=0;i<10;i++) {
+      trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
+      trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
+    }
+    // project on fs/8 (Image of TX signal in +ve frequencies)
+    for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
+      meanI+= (calib_buff[j]*cos_fsover8[i&7] - calib_buff[j+1]*cos_fsover8[(i+2)&7])>>11;
+      meanQ+= (calib_buff[j]*cos_fsover8[(i+2)&7] + calib_buff[j+1]*cos_fsover8[i&7])>>11;
+      j+=2;
+    }
+    
+    meanI/=RXDCLENGTH;
+    meanQ/=RXDCLENGTH;
+    printf("[BRF] TX IQ (offgain): %d => (%d,%d)\n",offgain,meanI,meanQ);
+    
+    cnt=0;
+    while (cnt++ < 13) {
+      
+      offgainnew=(offgainold+offgain)>>1;
+      if (meanI*meanI+meanQ*meanQ < meanIold*meanIold +meanQold*meanQold) {
+	printf("[BRF] TX IQ (offgain): ([%d,%d]) => %d : %d\n",offgainold,offgain,offgainnew,meanI*meanI+meanQ*meanQ);
+	
+	meanIold = meanI;
+	meanQold = meanQ;
+	offgainold = offgain;
+      }
+      offgain = offgainnew;
+      bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_GAIN,offgain);
+      
+      for (i=0;i<10;i++) {
+	trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
+	trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
+      }
+      // project on fs/8 (Image of TX signal in +ve frequencies)
+      for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
+	meanI+= (calib_buff[j]*cos_fsover8[i&7] - calib_buff[j+1]*cos_fsover8[(i+2)&7])>>11;
+	meanQ+= (calib_buff[j]*cos_fsover8[(i+2)&7] + calib_buff[j+1]*cos_fsover8[i&7])>>11;
+	j+=2;
+      }
+      meanI/=RXDCLENGTH;
+      meanQ/=RXDCLENGTH;
+      
+      //    printf("[BRF] TX DC (offQ): %d => (%d,%d)\n",offQ,meanI,meanQ);
+    }
+    
+    printf("[BRF] TX IQ offgain: %d => (%d,%d)\n",offgainold,meanIold,meanQold);
+    
+    bladerf_set_correction(brf->dev,BLADERF_MODULE_TX,BLADERF_CORR_FPGA_GAIN,offgainold);
+  }
+
+  // RX IQ imbalance
+  for (loop=0;loop<2;loop++) {
+    offphaseold=4096;
+    bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_PHASE,offphaseold);
+    for (i=0;i<10;i++) {
+      trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
+      trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
+    }
+    // project on -3fs/8 (Image of TX signal in -ve frequencies)
+    for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) {
+      meanIold+= (calib_buff[j]*cos_3fsover8[i&7] - calib_buff[j+1]*cos_3fsover8[(i+2)&7])>>11;
+      meanQold+= (calib_buff[j]*cos_3fsover8[(i+2)&7] + calib_buff[j+1]*cos_3fsover8[i&7])>>11;
+      j+=2;
+    }
+    
+    meanIold/=RXDCLENGTH;
+    meanQold/=RXDCLENGTH;
+    printf("[BRF] RX IQ (offphase): %d => (%d,%d)\n",offphaseold,meanIold,meanQold);
+    
+    offphase=-4096;
+    bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_PHASE,offphase);
+    for (i=0;i<10;i++) {
+      trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
+      trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
+    }
+    // project on -3fs/8 (Image of TX signal in -ve frequencies)
+    for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
+      meanI+= (calib_buff[j]*cos_3fsover8[i&7] - calib_buff[j+1]*cos_3fsover8[(i+2)&7])>>11;
+      meanQ+= (calib_buff[j]*cos_3fsover8[(i+2)&7] + calib_buff[j+1]*cos_3fsover8[i&7])>>11;
+      j+=2;
+    }
+    
+    meanI/=RXDCLENGTH;
+    meanQ/=RXDCLENGTH;
+    printf("[BRF] RX IQ (offphase): %d => (%d,%d)\n",offphase,meanI,meanQ);
+    
+    cnt=0;
+    while (cnt++ < 13) {
+      
+      offphasenew=(offphaseold+offphase)>>1;
+      printf("[BRF] RX IQ (offphase): ([%d,%d]) => %d : %d\n",offphaseold,offphase,offphasenew,meanI*meanI+meanQ*meanQ);
+      if (meanI*meanI+meanQ*meanQ < meanIold*meanIold +meanQold*meanQold) {
+
+	
+	meanIold = meanI;
+	meanQold = meanQ;
+	offphaseold = offphase;
+      }
+      offphase = offphasenew;
+      bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_PHASE,offphase);
+      
+      for (i=0;i<10;i++) {
+	trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
+	trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
+      }
+      // project on -3fs/8 (Image of TX signal in -ve frequencies)
+      for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
+	meanI+= (calib_buff[j]*cos_3fsover8[i&7] - calib_buff[j+1]*cos_3fsover8[(i+2)&7])>>11;
+	meanQ+= (calib_buff[j]*cos_3fsover8[(i+2)&7] + calib_buff[j+1]*cos_3fsover8[i&7])>>11;
+	j+=2;
+      }
+      meanI/=RXDCLENGTH;
+      meanQ/=RXDCLENGTH;
+      
+      //    printf("[BRF] TX DC (offQ): %d => (%d,%d)\n",offQ,meanI,meanQ);
+    }
+    
+    printf("[BRF] RX IQ offphase: %d => (%d,%d)\n",offphaseold,meanIold,meanQold);
+    
+    bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_PHASE,offphaseold);
+    
+    offgainold=4096;
+    bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_GAIN,offgainold);
+    for (i=0;i<10;i++) {
+      trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
+      trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0,0);
+    }
+    // project on -3fs/8 (Image of TX signal in +ve frequencies)
+    for (meanIold=meanQold=i=j=0;i<RXDCLENGTH;i++) {
+      meanIold+= (calib_buff[j]*cos_3fsover8[i&7] - calib_buff[j+1]*cos_3fsover8[(i+2)&7])>>11;
+      meanQold+= (calib_buff[j]*cos_3fsover8[(i+2)&7] + calib_buff[j+1]*cos_3fsover8[i&7])>>11;
+      j+=2;
+    }
+    
+    meanIold/=RXDCLENGTH;
+    meanQold/=RXDCLENGTH;
+    printf("[BRF] RX IQ (offgain): %d => (%d,%d)\n",offgainold,meanIold,meanQold);
+    
+    offgain=-4096;
+    bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_GAIN,offgain);
+    for (i=0;i<10;i++) {
+      trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
+      trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
+    }
+    // project on 3fs/8 (Image of TX signal in -ve frequencies)
+    for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
+      meanI+= (calib_buff[j]*cos_3fsover8[i&7] - calib_buff[j+1]*cos_3fsover8[(i+2)&7])>>11;
+      meanQ+= (calib_buff[j]*cos_3fsover8[(i+2)&7] + calib_buff[j+1]*cos_3fsover8[i&7])>>11;
+      j+=2;
+    }
+    
+    meanI/=RXDCLENGTH;
+    meanQ/=RXDCLENGTH;
+    printf("[BRF] RX IQ (offgain): %d => (%d,%d)\n",offgain,meanI,meanQ);
+    
+    cnt=0;
+    while (cnt++ < 13) {
+      
+      offgainnew=(offgainold+offgain)>>1;
+      if (meanI*meanI+meanQ*meanQ < meanIold*meanIold +meanQold*meanQold) {
+	printf("[BRF] RX IQ (offgain): ([%d,%d]) => %d : %d\n",offgainold,offgain,offgainnew,meanI*meanI+meanQ*meanQ);
+	
+	meanIold = meanI;
+	meanQold = meanQ;
+	offgainold = offgain;
+      }
+      offgain = offgainnew;
+      bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_GAIN,offgain);
+      
+      for (i=0;i<10;i++) {
+	trx_brf_read(device, &ptimestamp, (void **)&calib_buffp, RXDCLENGTH, 0);
+	trx_brf_write(device,ptimestamp+5*RXDCLENGTH, (void **)&calib_tx_buffp, RXDCLENGTH, 0, 0);
+      }
+      // project on -3fs/8 (Image of TX signal in -ve frequencies)
+      for (meanI=meanQ=i=j=0;i<RXDCLENGTH;i++) {
+	meanI+= (calib_buff[j]*cos_3fsover8[i&7] - calib_buff[j+1]*cos_3fsover8[(i+2)&7])>>11;
+	meanQ+= (calib_buff[j]*cos_3fsover8[(i+2)&7] + calib_buff[j+1]*cos_3fsover8[i&7])>>11;
+	j+=2;
+      }
+      meanI/=RXDCLENGTH;
+      meanQ/=RXDCLENGTH;
+      
+      //    printf("[BRF] TX DC (offQ): %d => (%d,%d)\n",offQ,meanI,meanQ);
+    }
+    
+    printf("[BRF] RX IQ offgain: %d => (%d,%d)\n",offgainold,meanIold,meanQold);
+    
+    bladerf_set_correction(brf->dev,BLADERF_MODULE_RX,BLADERF_CORR_FPGA_GAIN,offgainold);
+  }
+
+  bladerf_set_frequency(brf->dev,BLADERF_MODULE_TX, (unsigned int) device->openair0_cfg->tx_freq[0]);  
+  bladerf_set_loopback(brf->dev,BLADERF_LB_NONE);
+  bladerf_set_gain(brf->dev, BLADERF_MODULE_RX, (unsigned int) device->openair0_cfg->rx_gain[0]-device->openair0_cfg[0].rx_gain_offset[0]);
+  bladerf_set_gain(brf->dev, BLADERF_MODULE_TX, (unsigned int) device->openair0_cfg->tx_gain[0]);
+  //  write_output("blade_rf_test.m","rxs",calib_buff,RXDCLENGTH,1,1);
+}
+
+/*! \brief Initialize Openair BLADERF target. It returns 0 if OK 
+ * \param device the hardware to use
+ * \param openair0_cfg RF frontend parameters set by application
+ * \returns 0 on success
+ */
+int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
+  int status;
   brf_state_t *brf = (brf_state_t*)malloc(sizeof(brf_state_t));
   memset(brf, 0, sizeof(brf_state_t));
-  // init required params for BRF
-   brf->num_buffers   = 128;
-   brf->buffer_size   = (unsigned int) openair0_cfg[card].samples_per_packet*sizeof(int32_t); // buffer size = 4096 for sample_len of 1024
-   brf->num_transfers = 16;
-   brf->rx_timeout_ms = 0;  
-   brf->tx_timeout_ms = 0;
-   brf->sample_rate=(unsigned int)openair0_cfg[card].sample_rate;
+  /* device specific */
+  openair0_cfg->txlaunch_wait = 1;//manage when TX processing is triggered
+  openair0_cfg->txlaunch_wait_slotcount = 1; //manage when TX processing is triggered
+  openair0_cfg->iq_txshift = 0;// shift
+  openair0_cfg->iq_rxrescale = 15;//rescale iqs
+  
+  // init required params
+  switch ((int)openair0_cfg->sample_rate) {
+  case 30720000:
+    openair0_cfg->samples_per_packet    = 2048;
+    openair0_cfg->tx_sample_advance     = 0;
+    openair0_cfg->tx_scheduling_advance = 8*openair0_cfg->samples_per_packet;
+    break;
+  case 15360000:
+    openair0_cfg->samples_per_packet    = 2048;
+    openair0_cfg->tx_sample_advance     = 0;
+    openair0_cfg->tx_scheduling_advance = 4*openair0_cfg->samples_per_packet;
+    break;
+  case 7680000:
+    openair0_cfg->samples_per_packet    = 1024;
+    openair0_cfg->tx_sample_advance     = 0;
+    openair0_cfg->tx_scheduling_advance = 4*openair0_cfg->samples_per_packet;
+    break;
+  case 1920000:
+    openair0_cfg->samples_per_packet    = 256;
+    openair0_cfg->tx_sample_advance     = 50;
+    openair0_cfg->tx_scheduling_advance = 8*openair0_cfg->samples_per_packet;
+    break;
+  default:
+    printf("Error: unknown sampling rate %f\n",openair0_cfg->sample_rate);
+    exit(-1);
+    break;
+  }
+  openair0_cfg->iq_txshift= 0;
+  openair0_cfg->iq_rxrescale = 15; /*not sure*/
+  openair0_cfg->rx_gain_calib_table = calib_table_fx4;
 
-   
-   printf("\n[BRF] sampling_rate %d, num_buffers %d,  buffer_size %d, num transfer %d, timeout_ms (rx %d, tx %d)\n", 
-	  brf->sample_rate, brf->num_buffers, brf->buffer_size,brf->num_transfers, brf->rx_timeout_ms, brf->tx_timeout_ms);
+  //  The number of buffers to use in the underlying data stream
+  brf->num_buffers   = 128;
+  // the size of the underlying stream buffers, in samples
+  brf->buffer_size   = (unsigned int) openair0_cfg->samples_per_packet;//*sizeof(int32_t); // buffer size = 4096 for sample_len of 1024
+  brf->num_transfers = 16;
+  brf->rx_timeout_ms = 0;  
+  brf->tx_timeout_ms = 0;
+  brf->sample_rate=(unsigned int)openair0_cfg->sample_rate;
+
+  memset(&brf->meta_rx, 0, sizeof(brf->meta_rx));
+  memset(&brf->meta_tx, 0, sizeof(brf->meta_tx));
 
+  printf("\n[BRF] sampling_rate %d, num_buffers %d,  buffer_size %d, num transfer %d, timeout_ms (rx %d, tx %d)\n", 
+	 brf->sample_rate, brf->num_buffers, brf->buffer_size,brf->num_transfers, brf->rx_timeout_ms, brf->tx_timeout_ms);
+  
   if ((status=bladerf_open(&brf->dev, "")) != 0 ) {
     fprintf(stderr,"Failed to open brf device: %s\n",bladerf_strerror(status));
     brf_error(status);
@@ -217,83 +966,81 @@ int openair0_dev_init_bladerf(openair0_device *device, openair0_config_t *openai
     printf("[BRF] Device does not operates at max speed, change the USB port\n");
     brf_error(BLADERF_ERR_UNSUPPORTED);
   }
-  // RX
+  // RX  
   // Example of CLI output: RX Frequency: 2539999999Hz
   
-  if ((status=bladerf_set_frequency(brf->dev, BLADERF_MODULE_RX, (unsigned int) openair0_cfg[card].rx_freq[0])) != 0){
+  if ((status=bladerf_set_frequency(brf->dev, BLADERF_MODULE_RX, (unsigned int) openair0_cfg->rx_freq[0])) != 0){
     fprintf(stderr,"Failed to set RX frequency: %s\n",bladerf_strerror(status));
     brf_error(status);
   } else 
-    printf("[BRF] set RX frequency to %f\n",openair0_cfg[card].rx_freq[0]);
+    printf("[BRF] set RX frequency to %u\n",(unsigned int)openair0_cfg->rx_freq[0]);
   
- 
-  if ((status=bladerf_set_sample_rate(brf->dev, BLADERF_MODULE_RX, (unsigned int)openair0_cfg[card].sample_rate, NULL)) != 0){
+
+
+  unsigned int actual_value=0;
+  if ((status=bladerf_set_sample_rate(brf->dev, BLADERF_MODULE_RX, (unsigned int) openair0_cfg->sample_rate, &actual_value)) != 0){
     fprintf(stderr,"Failed to set RX sample rate: %s\n", bladerf_strerror(status));
     brf_error(status);
-  }else 
-    printf("[BRF] set RX sample rate to %f\n",openair0_cfg[card].sample_rate);
+  }else  
+    printf("[BRF] set RX sample rate to %u, %u\n", (unsigned int) openair0_cfg->sample_rate, actual_value);
  
-  if ((status=bladerf_set_bandwidth(brf->dev, BLADERF_MODULE_RX, (unsigned int) openair0_cfg[card].rx_bw, NULL)) != 0){
+
+  if ((status=bladerf_set_bandwidth(brf->dev, BLADERF_MODULE_RX, (unsigned int) openair0_cfg->rx_bw*2, &actual_value)) != 0){
     fprintf(stderr,"Failed to set RX bandwidth: %s\n", bladerf_strerror(status));
     brf_error(status);
   }else 
-    printf("[BRF] set RX bandwidth to %f\n",openair0_cfg[card].rx_bw);
+    printf("[BRF] set RX bandwidth to %u, %u\n",(unsigned int)openair0_cfg->rx_bw*2, actual_value);
  
-  if ((status=bladerf_set_gain(brf->dev, BLADERF_MODULE_RX, (int) openair0_cfg[card].rx_gain[0])) != 0) {
+  set_rx_gain_offset(&openair0_cfg[0],0);
+  if ((status=bladerf_set_gain(brf->dev, BLADERF_MODULE_RX, (int) openair0_cfg->rx_gain[0]-openair0_cfg[0].rx_gain_offset[0])) != 0) {
     fprintf(stderr,"Failed to set RX gain: %s\n",bladerf_strerror(status));
     brf_error(status);
   } else 
-    printf("[BRF] set RX gain to %f\n",openair0_cfg[card].rx_gain[0]);
+    printf("[BRF] set RX gain to %d (%d)\n",(int)(openair0_cfg->rx_gain[0]-openair0_cfg[0].rx_gain_offset[0]),(int)openair0_cfg[0].rx_gain_offset[0]);
 
-  /* Configure the device's RX module for use with the sync interface.
-   * SC16 Q11 samples *with* metadata are used. */
-  if ((status=bladerf_sync_config(brf->dev, BLADERF_MODULE_RX, BLADERF_FORMAT_SC16_Q11_META,brf->num_buffers,brf->buffer_size,brf->num_transfers,brf->rx_timeout_ms)) != 0 ) {
-    fprintf(stderr,"Failed to configure RX sync interface: %s\n", bladerf_strerror(status));
-     brf_error(status);
-  }else 
-    printf("[BRF] configured Rx for sync interface \n");
-  
-   /* We must always enable the RX module after calling bladerf_sync_config(), and 
-    * before  attempting to RX samples via  bladerf_sync_rx(). */
-  if ((status=bladerf_enable_module(brf->dev, BLADERF_MODULE_RX, true)) != 0) {
-    fprintf(stderr,"Failed to enable RX module: %s\n", bladerf_strerror(status));
-    brf_error(status);
-  }else 
-    printf("[BRF] RX module enabled \n");
-  
   // TX
-  if ((status=bladerf_set_frequency(brf->dev, BLADERF_MODULE_TX, (unsigned int) openair0_cfg[card].tx_freq[0])) != 0){
+  
+  if ((status=bladerf_set_frequency(brf->dev, BLADERF_MODULE_TX, (unsigned int) openair0_cfg->tx_freq[0])) != 0){
     fprintf(stderr,"Failed to set TX frequency: %s\n",bladerf_strerror(status));
     brf_error(status);
   }else 
-    printf("[BRF] set Tx Frequenct to %f \n", openair0_cfg[card].tx_freq[0]);
+    printf("[BRF] set TX Frequency to %u\n", (unsigned int) openair0_cfg->tx_freq[0]);
 
-  if ((status=bladerf_set_sample_rate(brf->dev, BLADERF_MODULE_TX, (unsigned int) openair0_cfg[card].sample_rate, NULL)) != 0){
+  if ((status=bladerf_set_sample_rate(brf->dev, BLADERF_MODULE_TX, (unsigned int) openair0_cfg->sample_rate, NULL)) != 0){
     fprintf(stderr,"Failed to set TX sample rate: %s\n", bladerf_strerror(status));
     brf_error(status);
   }else 
-    printf("[BRF] set Tx sampling rate to %f \n", openair0_cfg[card].sample_rate);
+    printf("[BRF] set TX sampling rate to %u \n", (unsigned int) openair0_cfg->sample_rate);
 
-  if ((status=bladerf_set_bandwidth(brf->dev, BLADERF_MODULE_TX,(unsigned int)openair0_cfg[card].tx_bw, NULL)) != 0){
-    fprintf(stderr, "Failed to set RX bandwidth: %s\n", bladerf_strerror(status));
+  if ((status=bladerf_set_bandwidth(brf->dev, BLADERF_MODULE_TX,(unsigned int)openair0_cfg->tx_bw*2, NULL)) != 0){
+    fprintf(stderr, "Failed to set TX bandwidth: %s\n", bladerf_strerror(status));
     brf_error(status);
   }else 
-    printf("[BRF] set Tx sampling ratebandwidth to %f \n", openair0_cfg[card].tx_bw);
+    printf("[BRF] set TX bandwidth to %u \n", (unsigned int) openair0_cfg->tx_bw*2);
 
-  if ((status=bladerf_set_gain(brf->dev, BLADERF_MODULE_TX, (int)openair0_cfg[card].tx_gain[0])) != 0) {
+  if ((status=bladerf_set_gain(brf->dev, BLADERF_MODULE_TX, (int) openair0_cfg->tx_gain[0])) != 0) {
     fprintf(stderr,"Failed to set TX gain: %s\n",bladerf_strerror(status));
     brf_error(status);
   }else 
-    printf("[BRF] set the Tx gain to %f \n", openair0_cfg[card].tx_gain[0]);
-
+    printf("[BRF] set the TX gain to %d\n", (int)openair0_cfg->tx_gain[0]);
+  
 
-  /* Configure the device's TX module for use with the sync interface.
+ /* Configure the device's TX module for use with the sync interface.
    * SC16 Q11 samples *with* metadata are used. */
   if ((status=bladerf_sync_config(brf->dev, BLADERF_MODULE_TX,BLADERF_FORMAT_SC16_Q11_META,brf->num_buffers,brf->buffer_size,brf->num_transfers,brf->tx_timeout_ms)) != 0 ) {
     fprintf(stderr,"Failed to configure TX sync interface: %s\n", bladerf_strerror(status));
      brf_error(status);
   }else 
-    printf("[BRF] configured tx for sync interface \n");
+    printf("[BRF] configured TX  sync interface \n");
+
+/* Configure the device's RX module for use with the sync interface.
+   * SC16 Q11 samples *with* metadata are used. */
+  if ((status=bladerf_sync_config(brf->dev, BLADERF_MODULE_RX, BLADERF_FORMAT_SC16_Q11_META,brf->num_buffers,brf->buffer_size,brf->num_transfers,brf->rx_timeout_ms)) != 0 ) {
+    fprintf(stderr,"Failed to configure RX sync interface: %s\n", bladerf_strerror(status));
+    brf_error(status);
+  }else 
+    printf("[BRF] configured Rx sync interface \n");
+
 
    /* We must always enable the TX module after calling bladerf_sync_config(), and 
     * before  attempting to TX samples via  bladerf_sync_tx(). */
@@ -303,11 +1050,33 @@ int openair0_dev_init_bladerf(openair0_device *device, openair0_config_t *openai
   } else 
     printf("[BRF] TX module enabled \n");
  
-  bladerf_log_set_verbosity(get_brf_log_level(openair0_cfg[card].log_level));
+ /* We must always enable the RX module after calling bladerf_sync_config(), and 
+    * before  attempting to RX samples via  bladerf_sync_rx(). */
+  if ((status=bladerf_enable_module(brf->dev, BLADERF_MODULE_RX, true)) != 0) {
+    fprintf(stderr,"Failed to enable RX module: %s\n", bladerf_strerror(status));
+    brf_error(status);
+  }else 
+    printf("[BRF] RX module enabled \n");
+
+  // calibrate 
+    
+ if ((status=bladerf_calibrate_dc(brf->dev, BLADERF_MODULE_TX)) != 0) {
+    fprintf(stderr,"Failed to calibrate TX DC: %s\n", bladerf_strerror(status));
+    brf_error(status);
+  } else 
+    printf("[BRF] TX module calibrated DC \n");
+ 
+  if ((status=bladerf_calibrate_dc(brf->dev, BLADERF_MODULE_RX)) != 0) {
+    fprintf(stderr,"Failed to calibrate RX DC: %s\n", bladerf_strerror(status));
+    brf_error(status);
+  }else 
+    printf("[BRF] RX module calibrated DC \n");
+  
+  bladerf_log_set_verbosity(get_brf_log_level(openair0_cfg->log_level));
   
   printf("BLADERF: Initializing openair0_device\n");
-  device->priv           = brf; 
   device->Mod_id         = num_devices++;
+  device->type             = BLADERF_DEV; 
   device->trx_start_func = trx_brf_start;
   device->trx_end_func   = trx_brf_end;
   device->trx_read_func  = trx_brf_read;
@@ -317,19 +1086,31 @@ int openair0_dev_init_bladerf(openair0_device *device, openair0_config_t *openai
   device->trx_stop_func        = trx_brf_stop;
   device->trx_set_freq_func    = trx_brf_set_freq;
   device->trx_set_gains_func   = trx_brf_set_gains;
-  memcpy((void*)&device->openair0_cfg,(void*)openair0_cfg,sizeof(openair0_config_t));
+  device->openair0_cfg = openair0_cfg;
+  device->priv = (void *)brf;
+
+  calibrate_rf(device);
+
+  //  memcpy((void*)&device->openair0_cfg,(void*)&openair0_cfg[0],sizeof(openair0_config_t));
 
   return 0;
 }
 
+/*! \brief bladeRF error report 
+ * \param status 
+ * \returns 0 on success
+ */
 int brf_error(int status) {
   
   //exit(-1);
-  //return 1; // or status error code
+  return status; // or status error code
 }
 
 
-
+/*! \brief Open BladeRF from serial port
+ * \param serial name of serial port on which to open BladeRF device
+ * \returns bladerf device structure
+ */
 struct bladerf * open_bladerf_from_serial(const char *serial) {
 
   int status;
@@ -356,10 +1137,15 @@ struct bladerf * open_bladerf_from_serial(const char *serial) {
     return dev;
   }
 }
+
+/*! \brief Get BladeRF log level
+ * \param log_level log level
+ * \returns log level of BLADERF device
+ */
 int get_brf_log_level(int log_level){
 
   int level=BLADERF_LOG_LEVEL_INFO;
-  //return  BLADERF_LOG_LEVEL_DEBUG;
+  return  BLADERF_LOG_LEVEL_DEBUG; // BLADERF_LOG_LEVEL_VERBOSE;// BLADERF_LOG_LEVEL_DEBUG; //
   switch(log_level) {
   case LOG_DEBUG:
     level=BLADERF_LOG_LEVEL_DEBUG;
@@ -384,3 +1170,4 @@ int get_brf_log_level(int log_level){
   }
   return level;
 }
+/*@}*/
diff --git a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h
index 15e1d39da744b508138763344ede60c2267f33fe..743baf1bc815cdafd979135d6fb3bcedfe16b425 100644
--- a/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h
+++ b/targets/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h
@@ -37,50 +37,96 @@
 #include "common_lib.h"
 #include "log.h"
 
+/** @addtogroup _BLADERF_PHY_RF_INTERFACE_
+ * @{
+ */
+
+/*! \brief BladeRF specific data structure */ 
 typedef struct {
 
-  // opaque BRF data struct
+  //! opaque BladeRF device struct. An empty ("") or NULL device identifier will result in the first encountered device being opened (using the first discovered backend)
   struct bladerf *dev;
-  // An empty ("") or NULL device identifier will result in the first encountered device being opened (using the first discovered backend)
-
+  
+  //! Number of buffers
   unsigned int num_buffers;
+  //! Buffer size 
   unsigned int buffer_size;
+  //! Number of transfers
   unsigned int num_transfers;
+  //! RX timeout
   unsigned int rx_timeout_ms;
+  //! TX timeout
   unsigned int tx_timeout_ms;
-
+  //! Metadata for RX
   struct bladerf_metadata meta_rx;
+  //!Metadata for TX
   struct bladerf_metadata meta_tx;
-
+  //! Sample rate
   unsigned int sample_rate;
-  // time offset between transmiter timestamp and receiver timestamp;
+  //! time offset between transmiter timestamp and receiver timestamp;
   double tdiff;
-  // use brf_time_offset to get this value
+  //! TX number of forward samples use brf_time_offset to get this value
   int tx_forward_nsamps; //166 for 20Mhz
 
 
   // --------------------------------
   // Debug and output control
   // --------------------------------
+  //! Number of underflows
   int num_underflows;
+  //! Number of overflows
   int num_overflows;
+  //! number of sequential errors
   int num_seq_errors;
+  //! number of RX errors
   int num_rx_errors;
+  //! Number of TX errors
   int num_tx_errors;
 
+  //! timestamp of current TX
   uint64_t tx_current_ts;
+  //! timestamp of current RX
   uint64_t rx_current_ts;
+  //! number of actual samples transmitted
   uint64_t tx_actual_nsamps;
+  //! number of actual samples received
   uint64_t rx_actual_nsamps;
+  //! number of TX samples
   uint64_t tx_nsamps;
+  //! number of RX samples
   uint64_t rx_nsamps;
+  //! number of TX count
   uint64_t tx_count;
+  //! number of RX count
   uint64_t rx_count;
+  //! timestamp of RX packet
   openair0_timestamp rx_timestamp;
 
 } brf_state_t;
 /*
  * func prototypes 
  */
+/*! \brief BladeRF Init function (not used at the moment)
+ * \param device RF frontend parameters set by application
+ */
+int trx_brf_init(openair0_device *device);
 
+/*! \brief get current timestamp
+ *\param device the hardware to use 
+ *\param module the bladeRf module
+ */
+openair0_timestamp trx_get_timestamp(openair0_device *device, bladerf_module module);
+
+/*! \brief Get BladeRF log level
+ * \param log_level log level
+ * \returns log level of BLADERF device
+ */
+int get_brf_log_level(int log_level);
+
+/*! \brief bladeRF error report 
+ * \param status 
+ * \returns 0 on success
+ */
 int brf_error(int status);
+
+/*@}*/
diff --git a/targets/ARCH/COMMON/common_lib.c b/targets/ARCH/COMMON/common_lib.c
index b7700ec06fc04c3225c705739cca1320d2160e75..b82fc9898128df31ea95a680d85ee811c43e2516 100644
--- a/targets/ARCH/COMMON/common_lib.c
+++ b/targets/ARCH/COMMON/common_lib.c
@@ -37,28 +37,147 @@
  * \warning
  */
 #include <stdio.h>
+#include <strings.h>
+#include <dlfcn.h>
+#include <errno.h>
+#include <string.h>
+
 #include "common_lib.h"
 
+int set_device(openair0_device *device) {
+
+  switch (device->type) {
+    
+  case EXMIMO_DEV:
+    printf("[%s] has loaded EXPRESS MIMO device.\n",((device->host_type == BBU_HOST) ? "BBU": "RRH"));
+    break;
+  case USRP_B200_DEV:
+    printf("[%s] has loaded USRP B200 device.\n",((device->host_type == BBU_HOST) ? "BBU": "RRH")); 
+    break;
+case USRP_X300_DEV:
+    printf("[%s] has loaded USRP X300 device.\n",((device->host_type == BBU_HOST) ? "BBU": "RRH")); 
+    break;
+  case BLADERF_DEV:
+    printf("[%s] has loaded BLADERF device.\n",((device->host_type == BBU_HOST) ? "BBU": "RRH")); 
+    break;
+  case LMSSDR_DEV:
+    printf("[%s] has loaded LMSSDR device.\n",((device->host_type == BBU_HOST) ? "BBU": "RRH")); 
+    break;
+  case NONE_DEV:
+    printf("[%s] has not loaded a HW device.\n",((device->host_type == BBU_HOST) ? "BBU": "RRH"));
+    break;    
+  default:
+    printf("[%s] invalid HW device.\n",((device->host_type == BBU_HOST) ? "BBU": "RRH")); 
+    return -1;
+  }
+  return 0;
+}
+
+int set_transport(openair0_device *device) {
+
+  switch (device->transp_type) {
+    
+  case ETHERNET_TP:
+    printf("[%s] has loaded ETHERNET trasport protocol.\n",((device->host_type == BBU_HOST) ? "BBU": "RRH"));
+    return 0;     
+    break;
+  case NONE_TP:
+    printf("[%s] has not loaded a transport protocol.\n",((device->host_type == BBU_HOST) ? "BBU": "RRH"));
+    return 0; 
+    break;    
+  default:
+    printf("[%s] invalid transport protocol.\n",((device->host_type == BBU_HOST) ? "BBU": "RRH")); 
+    return -1;
+    break;
+  }
+  
+}
 
-int openair0_device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
+/* look for the interface library and load it */
+int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t * cfg, uint8_t flag) {
   
-#ifdef ETHERNET 
-  device->type=ETH_IF; 
-  device->func_type = BBU_FUNC;
-  openair0_dev_init_eth(device, openair0_cfg);
-  printf(" openair0_dev_init_eth ...\n");
-#elif EXMIMO
-  device->type=EXMIMO_IF;
-  openair0_dev_init_exmimo(device, openair0_cfg);
-  printf("openair0_dev_init_exmimo...\n");
-#elif OAI_USRP
-  device->type=USRP_B200_IF;
-  openair0_dev_init_usrp(device, openair0_cfg);
-  printf("openair0_dev_init_usrp ...\n");
-#elif OAI_BLADERF  
-  device->type=BLADERF_IF;
-  openair0_dev_init_bladerf(device, openair0_cfg);	
-  printf(" openair0_dev_init_bladerf ...\n");   
-#endif 
-   
+  void *lib_handle;
+  oai_device_initfunc_t dp ;
+  oai_transport_initfunc_t tp ;
+  int ret=0;
+
+  if (flag == BBU_LOCAL_RADIO_HEAD) {
+      lib_handle = dlopen(OAI_RF_LIBNAME, RTLD_LAZY);
+      if (!lib_handle) {
+	fprintf(stderr,"Unable to locate %s: HW device set to NONE_DEV.\n", OAI_RF_LIBNAME);
+	fprintf(stderr,"%s\n",dlerror());
+	return -1;
+      } 
+      
+      dp = dlsym(lib_handle,"device_init");
+      
+      if (dp != NULL ) {
+	ret = dp(device,openair0_cfg);
+	if (ret<0) {
+	  fprintf(stderr, "%s %d:oai device intialization failed %s\n", __FILE__, __LINE__, dlerror());
+	}
+      } else {
+	fprintf(stderr, "%s %d:oai device intializing function not found %s\n", __FILE__, __LINE__, dlerror());
+	return -1;
+      }
+    } else {
+      lib_handle = dlopen(OAI_TP_LIBNAME, RTLD_LAZY);
+      if (!lib_handle) {
+	printf( "Unable to locate %s: transport protocol set to NONE_TP.\n", OAI_TP_LIBNAME);
+	printf( "%s\n",dlerror());
+	return -1;
+      } 
+      
+      tp = dlsym(lib_handle,"transport_init");
+      
+      if (tp != NULL ) {
+	tp(device,openair0_cfg,cfg);
+      } else {
+	fprintf(stderr, "%s %d:oai device intializing function not found %s\n", __FILE__, __LINE__, dlerror());
+	return -1;
+      }
+    } 
+    
+  return ret; 	       
 }
+
+
+
+int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cfg) {
+  
+  int rc=0;
+  //ToDo: EXMIMO harmonization is not complete. That is the reason for this ifdef
+  #ifdef EXMIMO
+  int device_init(openair0_device *device, openair0_config_t *openair0_cfg);
+  rc = device_init(device, openair0_cfg);
+  #else
+  rc=load_lib(device, openair0_cfg, NULL,BBU_LOCAL_RADIO_HEAD );
+  if ( rc >= 0) {       
+    if ( set_device(device) < 0) {
+      fprintf(stderr, "%s %d:Unsupported radio head\n",__FILE__, __LINE__);
+      return -1;		   
+    }   
+  }
+  #endif
+  return rc;
+}
+
+int openair0_transport_load(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t * eth_params) {
+  int rc;
+  rc=load_lib(device, openair0_cfg, eth_params, BBU_REMOTE_RADIO_HEAD);
+  if ( rc >= 0) {       
+    if ( set_transport(device) < 0) {
+      fprintf(stderr, "%s %d:Unsupported transport protocol\n",__FILE__, __LINE__);
+      return -1;		   
+      }   
+  }
+  return rc;
+
+}
+
+
+
+
+
+
+
diff --git a/targets/ARCH/COMMON/common_lib.h b/targets/ARCH/COMMON/common_lib.h
index 156da0c4ce6991c3b54c4901650f34d826d8348f..dc0b31af58c0b974c4597f2d6b540a98c718b591 100644
--- a/targets/ARCH/COMMON/common_lib.h
+++ b/targets/ARCH/COMMON/common_lib.h
@@ -42,11 +42,20 @@
 #include <stdint.h>
 #include <sys/types.h>
 
+/* name of shared library implementing the radio front end */
+#define OAI_RF_LIBNAME        "liboai_device.so"
+/* name of shared library implementing the transport */
+#define OAI_TP_LIBNAME        "liboai_transpro.so"
+
+/* flags for BBU to determine whether the attached radio head is local or remote */
+#define BBU_LOCAL_RADIO_HEAD  0
+#define BBU_REMOTE_RADIO_HEAD 1
+
 typedef int64_t openair0_timestamp;
 typedef volatile int64_t openair0_vtimestamp;
 
  
-/* structrue holds the parameters to configure USRP devices*/
+/*!\brief structrue holds the parameters to configure USRP devices*/
 typedef struct openair0_device_t openair0_device;
 
 
@@ -65,10 +74,56 @@ typedef enum {
 } duplex_mode_t;
 
 
-/** @addtogroup _PHY_RF_INTERFACE_
+
+/** @addtogroup _GENERIC_PHY_RF_INTERFACE_
  * @{
  */
- 
+/*!\brief RF device types
+ */
+typedef enum {
+  MIN_RF_DEV_TYPE = 0,
+  /*!\brief device is ExpressMIMO */
+  EXMIMO_DEV,
+  /*!\brief device is USRP B200/B210*/
+  USRP_B200_DEV,
+  /*!\brief device is USRP X300/X310*/
+  USRP_X300_DEV,
+  /*!\brief device is BLADE RF*/
+  BLADERF_DEV,
+  /*!\brief device is LMSSDR (SoDeRa)*/
+  LMSSDR_DEV,
+  /*!\brief device is NONE*/
+  NONE_DEV,
+  MAX_RF_DEV_TYPE
+
+} dev_type_t;
+
+/*!\brief transport protocol types
+ */
+typedef enum {
+  MIN_TRANSP_TYPE = 0,
+  /*!\brief transport protocol ETHERNET */
+  ETHERNET_TP,
+  /*!\brief no transport protocol*/
+  NONE_TP,
+  MAX_TRANSP_TYPE
+
+} transport_type_t;
+
+
+/*!\brief  openair0 device host type */
+typedef enum {
+  MIN_HOST_TYPE = 0,
+ /*!\brief device functions within a BBU */
+  BBU_HOST,
+ /*!\brief device functions within a RRH */
+  RRH_HOST,
+  MAX_HOST_TYPE
+
+}host_type_t;
+
+
+/*! \brief RF Gain clibration */ 
 typedef struct {
   //! Frequency for which RX chain was calibrated
   double freq;
@@ -76,10 +131,11 @@ typedef struct {
   double offset;
 } rx_gain_calib_table_t;
 
+/*! \brief RF frontend parameters set by application */
 typedef struct {
   //! Module ID for this configuration
   int Mod_id;
-  // device log level
+  //! device log level
   int log_level;
   //! duplexing mode
   duplex_mode_t duplex_mode;
@@ -90,11 +146,15 @@ typedef struct {
   //! the sample rate for both transmit and receive.
   double sample_rate;
   //! number of samples per RX/TX packet (USRP + Ethernet)
-  int samples_per_packet;
+  unsigned int samples_per_packet; 
   //! delay in sending samples (write)  due to hardware access, softmodem processing and fronthaul delay if exist
   int tx_scheduling_advance;
   //! offset in samples between TX and RX paths
   int tx_sample_advance;
+  //! configurable tx thread lauch delay 
+  int txlaunch_wait;               /* 1 or 0 */
+  //! configurable tx thread lauch delay 
+  int txlaunch_wait_slotcount;
   //! number of RX channels (=RX antennas)
   int rx_num_channels;
   //! number of TX channels (=TX antennas)
@@ -125,77 +185,72 @@ typedef struct {
   double tx_bw;
   //! Auto calibration flag
   int autocal[4];
-  //! RRH IP addr for Ethernet interface
-  char *remote_ip;
-  //! RRH port number for Ethernet interface
-  int remote_port;
-  //! my IP addr for Ethernet interface (eNB/BBU, UE)
-  char *my_ip;
-  //! my port number for Ethernet interface (eNB/BBU, UE)
-  int my_port;
-
+  //! rf devices work with x bits iqs when oai have its own iq format
+  //! the two following parameters are used to convert iqs 
+  int iq_txshift;
+  int iq_rxrescale;
+  //! remote IP/MAC addr for Ethernet interface
+  char *remote_addr;
+  //! remote port number for Ethernet interface
+  unsigned int remote_port;
+  //! local IP/MAC addr for Ethernet interface (eNB/BBU, UE)
+  char *my_addr;
+  //! local port number for Ethernet interface (eNB/BBU, UE)
+  unsigned int my_port;
+  //! Configuration file for LMS7002M
+  char *configFilename;
 } openair0_config_t;
 
+/*! \brief RF mapping */ 
 typedef struct {
-  /* card id */
+  //! card id
   int card;
-  /* rf chain id */
+  //! rf chain id
   int chain;
 } openair0_rf_map;
 
 
-
-/*!\brief interface types that apply to modules (RRH_BBU/RRH_UE) created in RRH (rrh_gw.c)
-          and are defined with respect to the RF device that is present in RRH
-          -RRH_BBU modules have two devices, one is by default ETHERNET (will have ETH_IF) and the other one is a
-	  RF device (EXMIMO,USRP,BLADERF) or no device (NONE_IF).
-          -RRH_UE modules have two devices one is by default ETHERNET (will have ETH_IF) 
-	  and the other one by default not present so it will have NONE_IF
- */
-typedef enum {
-  MIN_DEV_TYPE = 0,
-  /*!\brief device is ETH */
-  ETH_IF,
-  /*!\brief device is ExpressMIMO */
-  EXMIMO_IF,
-  /*!\brief device is USRP B200/B210*/
-  USRP_B200_IF,
-  /*!\brief device is USRP X300/X310*/
-  USRP_X300_IF,
-  /*!\brief device is BLADE RF*/
-  BLADERF_IF,
-  /*!\brief device is NONE*/
-  NONE_IF,
-  MAX_DEV_TYPE
-
-} dev_type_t;
-
-
-/*!\brief  openair0 device host type */
-typedef enum {
-  MIN_FUNC_TYPE = 0,
- /*!\brief device functions within a BBU */
-  BBU_FUNC,
- /*!\brief device functions within a RRH */
-  RRH_FUNC,
-  MAX_FUNC_TYPE
-
-}func_type_t;
-
+typedef struct {
+  char *remote_addr;
+  //! remote port number for Ethernet interface
+  uint16_t remote_port;
+  //! local IP/MAC addr for Ethernet interface (eNB/BBU, UE)
+  char *my_addr;
+  //! local port number for Ethernet interface (eNB/BBU, UE)
+  uint16_t  my_port;
+  //! local Ethernet interface (eNB/BBU, UE)
+  char *local_if_name;
+  //! tx_sample_advance for RF + ETH
+  uint8_t tx_sample_advance;
+  //! tx_scheduling_advance for RF + ETH
+  uint8_t tx_scheduling_advance;
+  //! iq_txshift  for RF + ETH
+  uint8_t iq_txshift;
+  //! transport type preference  (RAW/UDP)
+  uint8_t transp_preference;
+  //! radio front end preference (EXMIMO,USRP, BALDERF,LMSSDR)
+  uint8_t rf_preference;
+} eth_params_t;
+
+
+/*!\brief structure holds the parameters to configure USRP devices */
 struct openair0_device_t {
-  /* Module ID of this device */
+  /*!brief Module ID of this device */
   int Mod_id;
   
-  /* Type of this device */
+  /*!brief Type of this device */
   dev_type_t type;
 
-   /* Type of the device's host (BBU/RRH) */
-  func_type_t func_type;
+  /*!brief Transport protocol type that the device suppports (in case I/Q samples need to be transported) */
+  transport_type_t transp_type;
+
+   /*!brief Type of the device's host (BBU/RRH) */
+  host_type_t host_type;
 
-  /* RF frontend parameters set by application */
-  openair0_config_t openair0_cfg;
+  /* !brief RF frontend parameters set by application */
+  openair0_config_t *openair0_cfg;
 
-  /* Can be used by driver to hold internal structure*/
+  /*!brief Can be used by driver to hold internal structure*/
   void *priv;
 
   /* Functions API, which are called by the application*/
@@ -217,7 +272,7 @@ struct openair0_device_t {
       @param msg pointer to the message structure passed between BBU-RRH
       @param msg_len length of the message  
   */  
-  int (*trx_reply_func)(openair0_device *openair0, void *msg, ssize_t msg_len);
+  int (*trx_reply_func)(openair0_device *device, void *msg, ssize_t msg_len);
 
   /*! \brief Called to send samples to the RF target
       @param device pointer to the device structure specific to the RF hardware target
@@ -235,9 +290,9 @@ struct openair0_device_t {
    * was received.
    * \param device the hardware to use
    * \param[out] ptimestamp the time at which the first sample was received.
-   * \param[out] An array of pointers to buffers for received samples. The buffers must be large enough to hold the number of samples \ref nsamps.
+   * \param[out] buff An array of pointers to buffers for received samples. The buffers must be large enough to hold the number of samples \ref nsamps.
    * \param nsamps Number of samples. One sample is 2 byte I + 2 byte Q => 4 byte.
-   * \param cc Number of channels. If cc == 1, only buff[0] is filled with samples.
+   * \param antenna_id Index of antenna for which to receive samples
    * \returns the number of sample read
    */
   int (*trx_read_func)(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps,int antenna_id);
@@ -254,49 +309,64 @@ struct openair0_device_t {
    */
   int (*trx_reset_stats_func)(openair0_device *device);
 
-  /*! \brief Terminate operation of the transceiver -- free all associated resources */
+  /*! \brief Terminate operation of the transceiver -- free all associated resources 
+   * \param device the hardware to use
+   */
   void (*trx_end_func)(openair0_device *device);
 
-  /* Terminate operation  */
+  /*! \brief Stop operation of the transceiver 
+   * \param card RF Card to use
+   */
   int (*trx_stop_func)(int card);
 
   /* Functions API related to UE*/
 
   /*! \brief Set RX feaquencies 
-   * \param 
+   * \param device the hardware to use
+   * \param openair0_cfg RF frontend parameters set by application
+   * \param exmimo_dump_config  dump EXMIMO configuration 
    * \returns 0 in success 
    */
   int (*trx_set_freq_func)(openair0_device* device, openair0_config_t *openair0_cfg,int exmimo_dump_config);
   
   /*! \brief Set gains
-   * \param 
+   * \param device the hardware to use
+   * \param openair0_cfg RF frontend parameters set by application
    * \returns 0 in success 
    */
   int (*trx_set_gains_func)(openair0_device* device, openair0_config_t *openair0_cfg);
 
 };
 
+/* type of device init function, implemented in shared lib */
+typedef int(*oai_device_initfunc_t)(openair0_device *device, openair0_config_t *openair0_cfg);
+/* type of transport init function, implemented in shared lib */
+typedef int(*oai_transport_initfunc_t)(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t * eth_params);
 
 #ifdef __cplusplus
 extern "C"
 {
 #endif
 
-/*! \brief Initialize Openair RF target. It returns 0 if OK */
-  int openair0_device_init(openair0_device* device, openair0_config_t *openair0_cfg);
+
+  /*! \brief Initialize openair RF target. It returns 0 if OK */
+  int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cfg);  
+  /*! \brief Initialize transport protocol . It returns 0 if OK */
+  int openair0_transport_load(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t * eth_params);
+
   
-  //USRP
-/*! \brief Get the current timestamp of USRP */
+ /*! \brief Get current timestamp of USRP
+  * \param device the hardware to use
+  */
   openair0_timestamp get_usrp_time(openair0_device *device);
-/*! \brief Set the RX frequency of USRP RF TARGET */
+
+ /*! \brief Set RX frequencies 
+  * \param device the hardware to use
+  * \param openair0_cfg RF frontend parameters set by application
+  * \returns 0 in success 
+  */
   int openair0_set_rx_frequencies(openair0_device* device, openair0_config_t *openair0_cfg);
-  
-//extern
-/*! \brief Initialize Openair ETHERNET target. It returns 0 if OK */
-  int openair0_dev_init_eth(openair0_device *device, openair0_config_t *openair0_cfg);
-  int openair0_dev_init_bladerf(openair0_device *device, openair0_config_t *openair0_cfg);
-  int openair0_dev_init_usrp(openair0_device* device, openair0_config_t *openair0_cfg);
-  int openair0_dev_init_exmimo(openair0_device *device, openair0_config_t *openair0_cfg);
+
 /*@}*/
 
 #ifdef __cplusplus
diff --git a/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c b/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c
new file mode 100644
index 0000000000000000000000000000000000000000..a360f2655656906a885fde7281847ade2ecc8192
--- /dev/null
+++ b/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c
@@ -0,0 +1,319 @@
+/*******************************************************************************
+    OpenAirInterface
+    Copyright(c) 1999 - 2014 Eurecom
+
+    OpenAirInterface is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+
+    OpenAirInterface is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenAirInterface.The full GNU General Public License is
+    included in this distribution in the file called "COPYING". If not,
+    see <http://www.gnu.org/licenses/>.
+
+   Contact Information
+   OpenAirInterface Admin: openair_admin@eurecom.fr
+   OpenAirInterface Tech : openair_tech@eurecom.fr
+   OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+
+   Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+ *******************************************************************************/
+/*! \file ethernet_lib.c 
+ * \brief API to stream I/Q samples over standard ethernet
+ * \author  add alcatel Katerina Trilyraki, Navid Nikaein, Pedro Dinis, Lucio Ferreira, Raymond Knopp
+ * \date 2015
+ * \version 0.2
+ * \company Eurecom
+ * \maintainer:  navid.nikaein@eurecom.fr
+ * \note
+ * \warning 
+ */
+
+#include <arpa/inet.h>
+#include <linux/if_packet.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#include <netinet/ether.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include "common_lib.h"
+#include "ethernet_lib.h"
+
+#define DEBUG 0
+
+struct sockaddr_ll dest_addr[MAX_INST];
+struct sockaddr_ll local_addr[MAX_INST];
+int addr_len[MAX_INST];
+struct ifreq if_index[MAX_INST];
+struct ether_header eh; 
+
+int eth_socket_init_raw(openair0_device *device) {
+ 
+  int i = 0;
+  eth_state_t *eth = (eth_state_t*)device->priv;
+  int Mod_id = device->Mod_id;
+  const char *local_mac, *remote_mac;
+  int local_port=0, remote_port=0;
+  int sock_dom=0;
+  int sock_type=0;
+  int sock_proto=0;  
+ 
+  if (device->host_type == RRH_HOST ) {  /* RRH doesn't know remote MAC(will be retrieved from first packet send from BBU) and remote port(don't care) */
+    local_mac = device->openair0_cfg->my_addr; 
+    local_port = device->openair0_cfg->my_port;    
+    remote_mac = malloc(ETH_ALEN);
+    memset(remote_mac,0,ETH_ALEN);
+    remote_port = 0;    
+    printf("[%s] local MAC addr %s remote MAC addr %s\n","RRH", local_mac,remote_mac);    
+  } else {
+    local_mac = device->openair0_cfg->my_addr;
+    local_port = device->openair0_cfg->my_port;  
+    remote_mac = device->openair0_cfg->remote_addr;
+    remote_port = device->openair0_cfg->remote_port;  
+    printf("[%s] local MAC addr %s remote MAC addr %s\n","BBU", local_mac,remote_mac);    
+  }
+   
+  
+  /* Open a RAW socket to send on */
+  sock_dom=AF_PACKET;
+  sock_type=SOCK_RAW;
+  sock_proto=IPPROTO_RAW;
+  if ((eth->sockfd[Mod_id] = socket(sock_dom, sock_type, sock_proto)) == -1) {
+    perror("ETHERNET: Error opening RAW socket");
+    exit(0);
+  }
+  
+  /* initialize destination address */
+  for (i=0; i< MAX_INST; i++) {
+    bzero((void *)&(local_addr[i]), sizeof(struct sockaddr_ll));
+    bzero((void *)&(if_index[i]), sizeof(struct ifreq)); 
+  }
+  /* Get the index of the interface to send on */
+  strcpy(if_index[Mod_id].ifr_name,eth->if_name[Mod_id]);
+  if (ioctl(eth->sockfd[Mod_id], SIOCGIFINDEX, &(if_index[Mod_id])) < 0)
+    perror("SIOCGIFINDEX");
+   
+  local_addr[Mod_id].sll_family   = AF_PACKET;
+  local_addr[Mod_id].sll_ifindex  = if_index[Mod_id].ifr_ifindex;
+  /* hear traffic from specific protocol*/
+  local_addr[Mod_id].sll_protocol = htons((short)device->openair0_cfg->my_port);
+  local_addr[Mod_id].sll_halen    = ETH_ALEN;
+  local_addr[Mod_id].sll_pkttype  = PACKET_OTHERHOST;
+  addr_len[Mod_id] = sizeof(struct sockaddr_ll);
+  
+ if (bind(eth->sockfd[Mod_id],(struct sockaddr *)&local_addr[Mod_id],addr_len[Mod_id])<0) {
+   perror("ETHERNET: Cannot bind to socket");
+   exit(0);
+ }
+ 
+ /* Construct the Ethernet header */ 
+ ether_aton_r(local_mac, (struct ether_addr *)(&(eh.ether_shost)));
+ ether_aton_r(remote_mac, (struct ether_addr *)(&(eh.ether_dhost)));
+ eh.ether_type = htons((short)device->openair0_cfg->my_port);
+
+ printf("[%s] binding mod_%d to hardware address %x:%x:%x:%x:%x:%x\n",((device->host_type == BBU_HOST) ? "BBU": "RRH"),Mod_id,eh.ether_shost[0],eh.ether_shost[1],eh.ether_shost[2],eh.ether_shost[3],eh.ether_shost[4],eh.ether_shost[5]);
+ 
+ return 0;
+}
+
+
+int trx_eth_write_raw(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps,int cc, int flags) {
+  
+  int bytes_sent=0;
+  eth_state_t *eth = (eth_state_t*)device->priv;
+  int Mod_id = device->Mod_id;
+  int sendto_flag =0;
+  int i=0;
+  //sendto_flag|=flags;
+
+  eth->tx_nsamps=nsamps;
+
+  for (i=0;i<cc;i++) {	
+    /* buff[i] points to the position in tx buffer where the payload to be sent is
+       buff2 points to the position in tx buffer where the packet header will be placed */
+    void *buff2 = (void*)(buff[i]-APP_HEADER_SIZE_BYTES-MAC_HEADER_SIZE_BYTES); 
+    
+    /* we don't want to ovewrite with the header info the previous tx buffer data so we store it*/
+    struct ether_header temp =  *(struct ether_header *)buff2;
+    int32_t temp0 = *(int32_t *)(buff2 + MAC_HEADER_SIZE_BYTES);
+    openair0_timestamp  temp1 = *(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t));
+    
+    bytes_sent = 0;
+    memcpy(buff2,(void*)&eh,MAC_HEADER_SIZE_BYTES);
+    *(int16_t *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int16_t))=1+(i<<1);
+    *(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t)) = timestamp;
+    
+    /*printf("[RRH]write mod_%d %d , len %d, buff %p \n",
+      Mod_id,eth->sockfd[Mod_id],RAW_PACKET_SIZE_BYTES(nsamps), buff2);*/
+    
+    while(bytes_sent < RAW_PACKET_SIZE_BYTES(nsamps)) {
+#if DEBUG   
+      printf("------- TX ------: buff2 current position=%d remaining_bytes=%d  bytes_sent=%d \n",
+	     (void *)(buff2+bytes_sent), 
+	     RAW_PACKET_SIZE_BYTES(nsamps) - bytes_sent,
+	     bytes_sent);
+#endif
+      /* Send packet */
+      bytes_sent += send(eth->sockfd[Mod_id],
+			   buff2, 
+			   RAW_PACKET_SIZE_BYTES(nsamps),
+			   sendto_flag);
+      if ( bytes_sent == -1) {
+	eth->num_tx_errors++;
+	perror("ETHERNET WRITE: ");
+	exit(-1);
+      } else {
+#if DEBUG
+	printf("------- TX ------: nu=%x an_id=%d ts%d bytes_sent=%d\n",
+	       *(uint8_t *)(buff2+ETH_ALEN),
+	       *(int16_t *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int16_t)),
+	       *(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t)),
+	       bytes_sent);
+    dump_packet((device->host_type == BBU_HOST)? "BBU":"RRH", buff2, RAW_PACKET_SIZE_BYTES(nsamps), TX_FLAG);
+#endif
+    eth->tx_actual_nsamps=bytes_sent>>2;
+    eth->tx_count++;
+      }
+    }    			    
+    
+  /* tx buffer values restored */  
+    *(struct ether_header *)buff2 = temp;
+    *(int32_t *)(buff2 + MAC_HEADER_SIZE_BYTES) = temp0;
+    *(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t)) = temp1;
+  }
+  return (bytes_sent-APP_HEADER_SIZE_BYTES-MAC_HEADER_SIZE_BYTES)>>2;
+}
+
+
+int trx_eth_read_raw(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc) {
+      
+  int bytes_received=0;
+  int i=0;
+  eth_state_t *eth = (eth_state_t*)device->priv;
+  int Mod_id = device->Mod_id;
+  int rcvfrom_flag =0;
+  
+  eth->rx_nsamps=nsamps;
+
+  for (i=0;i<cc;i++) {
+      /* buff[i] points to the position in rx buffer where the payload to be received will be placed
+	 buff2 points to the position in rx buffer where the packet header will be placed */
+      void *buff2 = (void*)(buff[i]-APP_HEADER_SIZE_BYTES-MAC_HEADER_SIZE_BYTES); 
+      
+      /* we don't want to ovewrite with the header info the previous rx buffer data so we store it*/
+      struct ether_header temp =  *(struct ether_header *)buff2;
+      int32_t temp0 = *(int32_t *)(buff2 + MAC_HEADER_SIZE_BYTES);
+      openair0_timestamp  temp1 = *(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t));
+      
+      bytes_received=0;
+      
+      while(bytes_received < RAW_PACKET_SIZE_BYTES(nsamps)) {
+	bytes_received +=recv(eth->sockfd[Mod_id],
+			      buff2,
+			      RAW_PACKET_SIZE_BYTES(nsamps),
+			      rcvfrom_flag);
+	
+	if (bytes_received ==-1) {
+	  eth->num_rx_errors++;
+	  perror("ETHERNET READ: ");
+	  exit(-1);	
+	} else {
+	  /* store the timestamp value from packet's header */
+	  *timestamp =  *(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t));  
+	  eth->rx_actual_nsamps=bytes_received>>2;   
+	  eth->rx_count++;
+	}
+      }
+      
+#if DEBUG   
+      printf("------- RX------: nu=%x an_id=%d ts%d bytes_recv=%d \n",
+	     *(uint8_t *)(buff2+ETH_ALEN),
+	     *(int16_t *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int16_t)),
+	     *(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t)),
+	     bytes_received);
+      dump_packet((device->host_type == BBU_HOST)? "BBU":"RRH", buff2, RAW_PACKET_SIZE_BYTES(nsamps),RX_FLAG);	  
+
+#endif  
+
+     /* tx buffer values restored */  
+      *(struct ether_header *)buff2 = temp;
+      *(int32_t *)(buff2 + MAC_HEADER_SIZE_BYTES) = temp0;
+      *(openair0_timestamp *)(buff2 + MAC_HEADER_SIZE_BYTES + sizeof(int32_t)) = temp1;
+    }
+  return (bytes_received-APP_HEADER_SIZE_BYTES-MAC_HEADER_SIZE_BYTES)>>2;
+}
+
+ 
+
+
+int eth_set_dev_conf_raw(openair0_device *device) {
+
+  int 	       Mod_id = device->Mod_id;
+  eth_state_t *eth = (eth_state_t*)device->priv;
+  void 	      *msg;
+  ssize_t      msg_len;
+  
+  /* a BBU client sends to RRH a set of configuration parameters (openair0_config_t)
+     so that RF front end is configured appropriately and
+     frame/packet size etc. can be set */ 
+  
+  msg = malloc(MAC_HEADER_SIZE_BYTES + sizeof(openair0_config_t));
+  msg_len = MAC_HEADER_SIZE_BYTES + sizeof(openair0_config_t);
+
+  
+  memcpy(msg,(void*)&eh,MAC_HEADER_SIZE_BYTES);	
+  memcpy((msg+MAC_HEADER_SIZE_BYTES),(void*)device->openair0_cfg,sizeof(openair0_config_t));
+ 	  
+  if (send(eth->sockfd[Mod_id],
+	     msg,
+	     msg_len,
+	     0)==-1) {
+    perror("ETHERNET: ");
+    exit(0);
+  }
+  
+  return 0;
+}
+
+
+int eth_get_dev_conf_raw(openair0_device *device) {
+
+  eth_state_t   *eth = (eth_state_t*)device->priv;
+  int 		Mod_id = device->Mod_id;
+  char 		str[INET_ADDRSTRLEN];
+  void 		*msg;
+  ssize_t	msg_len;
+  
+  msg = malloc(MAC_HEADER_SIZE_BYTES + sizeof(openair0_config_t));
+  msg_len = MAC_HEADER_SIZE_BYTES + sizeof(openair0_config_t);
+  
+  /* RRH receives from BBU openair0_config_t */
+  if (recv(eth->sockfd[Mod_id],
+	   msg,
+	   msg_len,
+	   0)==-1) {
+    perror("ETHERNET: ");
+    exit(0);
+  }
+  
+  /* RRH stores the remote MAC address */
+  memcpy(eh.ether_dhost,(msg+ETH_ALEN),ETH_ALEN);	
+  //memcpy((void*)&device->openair0_cfg,(msg + MAC_HEADER_SIZE_BYTES), sizeof(openair0_config_t));
+  device->openair0_cfg=(openair0_config_t *)(msg + MAC_HEADER_SIZE_BYTES);
+  printf("[%s] binding mod_%d to hardware address %x:%x:%x:%x:%x:%x           hardware address %x:%x:%x:%x:%x:%x\n",((device->host_type == BBU_HOST) ? "BBU": "RRH"),Mod_id,eh.ether_shost[0],eh.ether_shost[1],eh.ether_shost[2],eh.ether_shost[3],eh.ether_shost[4],eh.ether_shost[5],eh.ether_dhost[0],eh.ether_dhost[1],eh.ether_dhost[2],eh.ether_dhost[3],eh.ether_dhost[4],eh.ether_dhost[5]);
+ 	  
+  return 0;
+}
diff --git a/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c b/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c
new file mode 100644
index 0000000000000000000000000000000000000000..a9706c73bdd16dad3cce786ead09bca8700b65f2
--- /dev/null
+++ b/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c
@@ -0,0 +1,383 @@
+/*******************************************************************************
+    OpenAirInterface
+    Copyright(c) 1999 - 2014 Eurecom
+
+    OpenAirInterface is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+
+    OpenAirInterface is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenAirInterface.The full GNU General Public License is
+    included in this distribution in the file called "COPYING". If not,
+    see <http://www.gnu.org/licenses/>.
+
+   Contact Information
+   OpenAirInterface Admin: openair_admin@eurecom.fr
+   OpenAirInterface Tech : openair_tech@eurecom.fr
+   OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+
+   Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+ *******************************************************************************/
+/*! \file ethernet_lib.c 
+ * \brief API to stream I/Q samples over standard ethernet
+ * \author  add alcatel Katerina Trilyraki, Navid Nikaein, Pedro Dinis, Lucio Ferreira, Raymond Knopp
+ * \date 2015
+ * \version 0.2
+ * \company Eurecom
+ * \maintainer:  navid.nikaein@eurecom.fr
+ * \note
+ * \warning 
+ */
+
+#include <arpa/inet.h>
+#include <linux/if_packet.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#include <netinet/ether.h>
+#include <unistd.h>
+#include <errno.h>
+#include "vcd_signal_dumper.h"
+
+#include "common_lib.h"
+#include "ethernet_lib.h"
+
+#define DEBUG 0
+struct sockaddr_in dest_addr[MAX_INST];
+struct sockaddr_in local_addr[MAX_INST];
+int addr_len[MAX_INST];
+
+
+uint16_t pck_seq_num = 1;
+uint16_t pck_seq_num_cur=0;
+uint16_t pck_seq_num_prev=0;
+
+ int eth_socket_init_udp(openair0_device *device) {
+
+  int i = 0;
+  eth_state_t *eth = (eth_state_t*)device->priv;
+  int Mod_id = device->Mod_id;  
+  char str_local[INET_ADDRSTRLEN];
+  char str_remote[INET_ADDRSTRLEN];
+  const char *local_ip, *remote_ip;
+  int local_port=0, remote_port=0;
+  int sock_dom=0;
+  int sock_type=0;
+  int sock_proto=0;
+  int enable=1;
+
+  if (device->host_type == RRH_HOST ) {
+    local_ip   = device->openair0_cfg->my_addr;   
+    local_port = device->openair0_cfg->my_port;
+    remote_ip   = "0.0.0.0";   
+    remote_port =  0;   
+    printf("[%s] local ip addr %s port %d\n", "RRH", local_ip, local_port);    
+  } else {
+    local_ip   = device->openair0_cfg->my_addr;   
+    local_port = device->openair0_cfg->my_port;
+    remote_ip   = device->openair0_cfg->remote_addr;
+    remote_port = device->openair0_cfg->remote_port;  
+    printf("[%s] local ip addr %s port %d\n","BBU", local_ip, local_port);    
+  }
+  
+  /* Open socket to send on */
+  sock_dom=AF_INET;
+  sock_type=SOCK_DGRAM;
+  sock_proto=IPPROTO_UDP;
+  
+  if ((eth->sockfd[Mod_id] = socket(sock_dom, sock_type, sock_proto)) == -1) {
+    perror("ETHERNET: Error opening socket");
+    exit(0);
+  }
+  
+  /* initialize addresses */
+  for (i=0; i< MAX_INST; i++) {
+    bzero((void *)&(dest_addr[i]), sizeof(dest_addr[i]));
+    bzero((void *)&(local_addr[i]), sizeof(local_addr[i]));
+  }
+
+  addr_len[Mod_id] = sizeof(struct sockaddr_in);
+
+  dest_addr[Mod_id].sin_family = AF_INET;
+  inet_pton(AF_INET,remote_ip,&(dest_addr[Mod_id].sin_addr.s_addr));
+  dest_addr[Mod_id].sin_port=htons(remote_port);
+  inet_ntop(AF_INET, &(dest_addr[Mod_id].sin_addr), str_remote, INET_ADDRSTRLEN);
+
+
+  local_addr[Mod_id].sin_family = AF_INET;
+  inet_pton(AF_INET,local_ip,&(local_addr[Mod_id].sin_addr.s_addr));
+  local_addr[Mod_id].sin_port=htons(local_port);
+  inet_ntop(AF_INET, &(local_addr[Mod_id].sin_addr), str_local, INET_ADDRSTRLEN);
+
+  
+  /* set reuse address flag */
+  if (setsockopt(eth->sockfd[Mod_id], SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(int))) {
+    perror("ETHERNET: Cannot set SO_REUSEADDR option on socket");
+    exit(0);
+  }
+  
+  /* want to receive -> so bind */   
+    if (bind(eth->sockfd[Mod_id],(struct sockaddr *)&local_addr[Mod_id],addr_len[Mod_id])<0) {
+      perror("ETHERNET: Cannot bind to socket");
+      exit(0);
+    } else {
+      printf("[%s] binding mod_%d to %s:%d\n","RRH",Mod_id,str_local,ntohs(local_addr[Mod_id].sin_port));
+    }
+ 
+  return 0;
+}
+
+int trx_eth_write_udp(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps,int cc, int flags) {	
+  
+  int bytes_sent=0;
+  eth_state_t *eth = (eth_state_t*)device->priv;
+  int Mod_id = device->Mod_id;
+  int sendto_flag =0;
+  int i=0;
+  //sendto_flag|=flags;
+  eth->tx_nsamps=nsamps;
+
+  for (i=0;i<cc;i++) {	
+    /* buff[i] points to the position in tx buffer where the payload to be sent is
+       buff2 points to the position in tx buffer where the packet header will be placed */
+    void *buff2 = (void*)(buff[i]- APP_HEADER_SIZE_BYTES); 
+    
+    /* we don't want to ovewrite with the header info the previous tx buffer data so we store it*/
+    int32_t temp0 = *(int32_t *)buff2;
+    openair0_timestamp  temp1 = *(openair0_timestamp *)(buff2 + sizeof(int32_t));
+    
+    bytes_sent = 0;
+    
+    /* constract application header */
+    // eth->pck_header.seq_num = pck_seq_num;
+    //eth->pck_header.antenna_id = 1+(i<<1);
+    //eth->pck_header.timestamp = timestamp;
+    *(uint16_t *)buff2 = pck_seq_num;
+    *(uint16_t *)(buff2 + sizeof(uint16_t)) = 1+(i<<1);
+    *(openair0_timestamp *)(buff2 + sizeof(int32_t)) = timestamp;
+    VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TX_SEQ_NUM, pck_seq_num);
+
+    while(bytes_sent < UDP_PACKET_SIZE_BYTES(nsamps)) {
+#if DEBUG   
+      printf("------- TX ------: buff2 current position=%d remaining_bytes=%d  bytes_sent=%d \n",
+	     (void *)(buff2+bytes_sent), 
+	     UDP_PACKET_SIZE_BYTES(nsamps) - bytes_sent,
+	     bytes_sent);
+#endif
+      /* Send packet */
+      bytes_sent += sendto(eth->sockfd[Mod_id],
+			   buff2, 
+                           UDP_PACKET_SIZE_BYTES(nsamps),
+			   sendto_flag,
+			   (struct sockaddr*)&dest_addr[Mod_id],
+			   addr_len[Mod_id]);
+      
+      if ( bytes_sent == -1) {
+	eth->num_tx_errors++;
+	perror("ETHERNET WRITE: ");
+	exit(-1);
+      } else {
+#if DEBUG
+    printf("------- TX ------: nu=%d an_id=%d ts%d bytes_send=%d\n",
+	   *(int16_t *)buff2,
+	   *(int16_t *)(buff2 + sizeof(int16_t)),
+	   *(openair0_timestamp *)(buff2 + sizeof(int32_t)),
+	   bytes_sent);
+    dump_packet((device->host_type == BBU_HOST)? "BBU":"RRH", buff2, UDP_PACKET_SIZE_BYTES(nsamps), TX_FLAG);
+#endif
+    eth->tx_actual_nsamps=bytes_sent>>2;
+    eth->tx_count++;
+    pck_seq_num++;
+    if ( pck_seq_num > MAX_PACKET_SEQ_NUM(nsamps,76800) )  pck_seq_num = 1;
+      }
+    }              
+      /* tx buffer values restored */  
+      *(int32_t *)buff2 = temp0;
+      *(openair0_timestamp *)(buff2 + sizeof(int32_t)) = temp1;
+  }
+ 
+  return (bytes_sent-APP_HEADER_SIZE_BYTES)>>2;
+}
+      
+
+
+int trx_eth_read_udp(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc) {
+  
+  int bytes_received=0;
+  eth_state_t *eth = (eth_state_t*)device->priv;
+  openair0_timestamp prev_timestamp = -1;
+  int Mod_id = device->Mod_id;
+  int rcvfrom_flag =0;
+  int block_cnt=0;
+  int again_cnt=0;
+  int i=0;
+
+  eth->rx_nsamps=nsamps;
+
+  for (i=0;i<cc;i++) {
+    /* buff[i] points to the position in rx buffer where the payload to be received will be placed
+       buff2 points to the position in rx buffer where the packet header will be placed */
+    void *buff2 = (void*)(buff[i]- APP_HEADER_SIZE_BYTES);
+    
+    /* we don't want to ovewrite with the header info the previous rx buffer data so we store it*/
+    int32_t temp0 = *(int32_t *)buff2;
+    openair0_timestamp temp1 = *(openair0_timestamp *)(buff2 + sizeof(int32_t));
+    
+    bytes_received=0;
+    block_cnt=0;
+    
+    
+    while(bytes_received < UDP_PACKET_SIZE_BYTES(nsamps)) {
+    again:
+#if DEBUG   
+	   printf("------- RX------: buff2 current position=%d remaining_bytes=%d  bytes_recv=%d \n",
+		  (void *)(buff2+bytes_received),
+		  UDP_PACKET_SIZE_BYTES(nsamps) - bytes_received,
+		  bytes_received);
+#endif
+      bytes_received +=recvfrom(eth->sockfd[Mod_id],
+				buff2,
+	                        UDP_PACKET_SIZE_BYTES(nsamps),
+				rcvfrom_flag,
+				(struct sockaddr *)&dest_addr[Mod_id],
+				(socklen_t *)&addr_len[Mod_id]);
+      
+      if (bytes_received ==-1) {
+	eth->num_rx_errors++;
+	if (errno == EAGAIN) {
+	  again_cnt++;
+	  usleep(10);
+	  if (again_cnt == 1000) {
+	  perror("ETHERNET READ: ");
+	  exit(-1);
+	  } else {
+	    printf("AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN AGAIN \n");
+	    goto again;
+	  }	  
+	} else if (errno == EWOULDBLOCK) {
+	     block_cnt++;
+	     usleep(10);	  
+	     if (block_cnt == 1000) {
+      perror("ETHERNET READ: ");
+      exit(-1);
+    } else {
+	    printf("BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK \n");
+	    goto again;
+	  }
+	}
+      } else {
+#if DEBUG   
+	   printf("------- RX------: nu=%d an_id=%d ts%d bytes_recv=%d\n",
+		  *(int16_t *)buff2,
+		  *(int16_t *)(buff2 + sizeof(int16_t)),
+		  *(openair0_timestamp *)(buff2 + sizeof(int32_t)),
+		  bytes_received);
+	   dump_packet((device->host_type == BBU_HOST)? "BBU":"RRH", buff2, UDP_PACKET_SIZE_BYTES(nsamps),RX_FLAG);	  
+#endif  
+	   
+	   /* store the timestamp value from packet's header */
+	   *timestamp =  *(openair0_timestamp *)(buff2 + sizeof(int32_t));
+	   /* store the sequence number of the previous packet received */    
+	   if (pck_seq_num_cur == 0) {
+	     pck_seq_num_prev = *(uint16_t *)buff2;
+	   } else {
+	     pck_seq_num_prev = pck_seq_num_cur;
+	   }
+	   /* get the packet sequence number from packet's header */
+	   pck_seq_num_cur = *(uint16_t *)buff2;
+	   //printf("cur=%d prev=%d buff=%d\n",pck_seq_num_cur,pck_seq_num_prev,*(uint16_t *)(buff2));
+	   if ( ( pck_seq_num_cur != (pck_seq_num_prev + 1) ) && !((pck_seq_num_prev==75) && (pck_seq_num_cur==1 ))){
+	     printf("out of order packet received1! %d|%d|%d\n",pck_seq_num_cur,pck_seq_num_prev,	*timestamp);
+	   }
+	   VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RX_SEQ_NUM,pck_seq_num_cur);
+	   VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RX_SEQ_NUM_PRV,pck_seq_num_prev);
+						    eth->rx_actual_nsamps=bytes_received>>2;
+						    eth->rx_count++;
+						    }	 
+	     
+      }
+      /* tx buffer values restored */  
+      *(int32_t *)buff2 = temp0;
+      *(openair0_timestamp *)(buff2 + sizeof(int32_t)) = temp1;
+	  
+    }      
+  return (bytes_received-APP_HEADER_SIZE_BYTES)>>2;
+}
+      
+
+
+
+int eth_set_dev_conf_udp(openair0_device *device) {
+
+  int 	       Mod_id = device->Mod_id;
+  eth_state_t *eth = (eth_state_t*)device->priv;
+  void 	      *msg;
+  ssize_t      msg_len;
+
+  
+  /* a BBU client sents to RRH a set of configuration parameters (openair0_config_t)
+     so that RF front end is configured appropriately and
+     frame/packet size etc. can be set */ 
+
+  msg=malloc(sizeof(openair0_config_t));
+  msg_len=sizeof(openair0_config_t);
+  memcpy(msg,(void*)device->openair0_cfg,msg_len);	
+  
+  if (sendto(eth->sockfd[Mod_id],msg,msg_len,0,(struct sockaddr *)&dest_addr[Mod_id],addr_len[Mod_id])==-1) {
+    perror("ETHERNET: ");
+    exit(0);
+  }
+
+  return 0;
+}
+
+int eth_get_dev_conf_udp(openair0_device *device) {
+
+  eth_state_t   *eth = (eth_state_t*)device->priv;
+  int 		Mod_id = device->Mod_id;
+  char 		str1[INET_ADDRSTRLEN],str[INET_ADDRSTRLEN];
+  void 		*msg;
+  ssize_t	msg_len;
+  
+  msg=malloc(sizeof(openair0_config_t));
+  msg_len=sizeof(openair0_config_t);
+
+  inet_ntop(AF_INET, &(local_addr[Mod_id].sin_addr), str, INET_ADDRSTRLEN);
+  inet_ntop(AF_INET, &(dest_addr[Mod_id].sin_addr), str1, INET_ADDRSTRLEN);
+
+  /* RRH receives from BBU openair0_config_t */
+  if (recvfrom(eth->sockfd[Mod_id],
+	       msg,
+	       msg_len,
+	       0,
+	       (struct sockaddr *)&dest_addr[Mod_id],
+	       (socklen_t *)&addr_len[Mod_id])==-1) {
+    perror("ETHERNET: ");
+    exit(0);
+  }
+  device->openair0_cfg=(openair0_config_t *)msg;
+
+   /* get remote ip address and port */
+   /* inet_ntop(AF_INET, &(dest_addr[Mod_id].sin_addr), str1, INET_ADDRSTRLEN); */
+   /* device->openair0_cfg->remote_port =ntohs(dest_addr[Mod_id].sin_port); */
+   /* device->openair0_cfg->remote_addr =str1; */
+
+   /* /\* restore local ip address and port *\/ */
+   /* inet_ntop(AF_INET, &(local_addr[Mod_id].sin_addr), str, INET_ADDRSTRLEN); */
+   /* device->openair0_cfg->my_port =ntohs(local_addr[Mod_id].sin_port); */
+   /* device->openair0_cfg->my_addr =str; */
+
+   /*  printf("[RRH] mod_%d socket %d connected to BBU %s:%d  %s:%d\n", Mod_id, eth->sockfd[Mod_id],str1, device->openair0_cfg->remote_port, str, device->openair0_cfg->my_port);  */
+   return 0;
+}
diff --git a/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c b/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
index ce90d2cff967e03d90d3c82bc401f3b93a156768..f15f2d98ebcabf715273fe03256319358d63b825 100644
--- a/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
+++ b/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
@@ -28,7 +28,7 @@
  *******************************************************************************/
 /*! \file ethernet_lib.c 
  * \brief API to stream I/Q samples over standard ethernet
- * \author Katerina Trilyraki, Navid Nikaein, Pedro Dinis, Lucio Ferreira, Raymond Knopp
+ * \author  add alcatel Katerina Trilyraki, Navid Nikaein, Pedro Dinis, Lucio Ferreira, Raymond Knopp
  * \date 2015
  * \version 0.2
  * \company Eurecom
@@ -52,196 +52,56 @@
 #include "common_lib.h"
 #include "ethernet_lib.h"
 
-//#define DEBUG 1
 
 int num_devices_eth = 0;
+struct sockaddr_in dest_addr[MAX_INST];
 int dest_addr_len[MAX_INST];
-char sendbuf[MAX_INST][BUF_SIZ]; /*TODO*/
-
-
-/*! \fn static int eth_socket_init(openair0_device *device)
-* \brief initialization of UDP Socket to communicate with one destination
-* \param[in] *device openair device for which the socket will be created
-* \param[out]
-* \return 0 on success, otherwise -1
-* \note
-* @ingroup  _oai
-*/
-static int eth_socket_init(openair0_device *device);
-
-/*! \fn static int eth_set_dev_conf(openair0_device *device)
-* \brief 
-* \param[in] *device openair device 
-* \param[out]
-* \return 0 on success, otherwise -1
-* \note
-* @ingroup  _oai
-*/
-static int eth_set_dev_conf(openair0_device *device);
-
-/*! \fn static int eth_get_dev_conf(openair0_device *device)
-* \brief
-* \param[in] *device openair device
-* \param[out]
-* \return 0 on success, otherwise -1
-* \note
-* @ingroup  _oai
-*/
-static int eth_get_dev_conf(openair0_device *device);
-
 
 
 int trx_eth_start(openair0_device *device) {
-  
-  /* initialize socket */
-  if (eth_socket_init(device)!=0) {
-    return -1;
-  }
-  
-  /* RRH gets openair0 device configuration BBU sets openair0 device configuration*/
-  if (device->func_type == BBU_FUNC) {
-    return eth_set_dev_conf(device);
-  } else {
-    return eth_get_dev_conf(device);
-  }
-
-  return 0;
-}
 
-
-int trx_eth_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps,int cc, int flags) {	
-  
-  int n_written=0,i;
-  uint16_t header_size=sizeof(int32_t) + sizeof(openair0_timestamp);
   eth_state_t *eth = (eth_state_t*)device->priv;
-  int Mod_id = device->Mod_id;
-  int sendto_flag =0;
-  sendto_flag|=MSG_DONTWAIT;
   
-  for (i=0;i<cc;i++) {	
-    /* buff[i] points to the position in tx buffer where the payload to be sent is
-       buff2 points to the position in tx buffer where the packet header will be placed */
-    void *buff2 = (void*)(buff[i]-header_size); 
-    
-    /* we don't want to ovewrite with the header info the previous tx buffer data so we store it*/
-    int32_t temp0 = *(int32_t *)buff2;
-    openair0_timestamp  temp1 = *(openair0_timestamp *)(buff2 + sizeof(int32_t));
-    
-    n_written = 0;
-    
-    *(int16_t *)(buff2 + sizeof(int16_t))=1+(i<<1);
-    *(openair0_timestamp *)(buff2 + sizeof(int32_t)) = timestamp;
-    
-    /* printf("[RRH]write mod_%d %d , len %d, buff %p antenna %d\n",
-       Mod_id,eth->sockfd[Mod_id],(nsamps<<2)+header_size, buff2, antenna_id);*/
-    
-    while(n_written < nsamps) {
-      /* Send packet */
-      if ((n_written += sendto(eth->sockfd[Mod_id],
-			       buff2, 
-			       (nsamps<<2)+header_size,
-			       0,
-			       (struct sockaddr*)&eth->dest_addr[Mod_id],
-			       dest_addr_len[Mod_id])) < 0) {
-	perror("ETHERNET WRITE");
-	exit(-1);
-      }
+  /* initialize socket */
+  if ((eth->flags & ETH_RAW_MODE) != 0 ) {     
+    if (eth_socket_init_raw(device)!=0)   return -1;
+    /* RRH gets openair0 device configuration - BBU sets openair0 device configuration*/
+    if (device->host_type == BBU_HOST) {
+      if(eth_set_dev_conf_raw(device)!=0)  return -1;
+    } else {
+      if(eth_get_dev_conf_raw(device)!=0)  return -1;
     }
-
-#if DEBUG
-    printf("Buffer head TX: nu=%d an_id=%d ts%d samples_send=%d i=%d data=%x\n",
-	   *(int16_t *)buff2,
-	   *(int16_t *)(buff2 + sizeof(int16_t)),
-	   *(openair0_timestamp *)(buff2 + sizeof(int32_t)),
-	   n_written>>2,i,*(int32_t *)(buff2 + 20*sizeof(int32_t)));
-#endif
-
-    /* tx buffer values restored */  
-    *(int32_t *)buff2 = temp0;
-    *(openair0_timestamp *)(buff2 + sizeof(int32_t)) = temp1;
-  }
-  return n_written;
-  
-}
-
-int trx_eth_read(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc) {
-
-  int bytes_received=0;
-  int block_cnt=0;
-  int ret=0,i;
-  uint16_t  header_size=sizeof(int32_t) + sizeof(openair0_timestamp);
-
-  eth_state_t *eth = (eth_state_t*)device->priv;
-  int Mod_id = device->Mod_id;
-  
-  for (i=0;i<cc;i++) {
-    /* buff[i] points to the position in rx buffer where the payload to be received will be placed
-       buff2 points to the position in rx buffer where the packet header will be placed */
-    void *buff2 = (void*)(buff[i]-header_size);
-    
-    /* we don't want to ovewrite with the header info the previous rx buffer data so we store it*/
-    int32_t temp0 = *(int32_t *)buff2;
-    openair0_timestamp temp1 = *(openair0_timestamp *)(buff2 + sizeof(int32_t));
-    
-    bytes_received=0;
-    block_cnt=0;
-    ret=0;
-    
-    /* printf("[RRH] read mod_%d %d,len %d, buff %p antenna %d\n",
-       Mod_id,eth->sockfd[Mod_id],(nsamps<<2)+header_size, buff2, antenna_id);*/
-    
-    while(bytes_received < (int)((nsamps<<2))) {
-      ret=recvfrom(eth->sockfd[Mod_id],
-		   buff2+bytes_received,
-		   (nsamps<<2)+header_size-bytes_received,
-		   0,//MSG_DONTWAIT,
-                 (struct sockaddr *)&eth->dest_addr[Mod_id],
-		   (socklen_t *)&dest_addr_len[Mod_id]);
-      
-      if (ret==-1) {
-	if (errno == EAGAIN) {
-	  perror("ETHERNET READ: ");
-	  return((nsamps<<2) + header_size);
-	} else if (errno == EWOULDBLOCK) {
-	  block_cnt++;
-	  usleep(10);
-	  
-	  if (block_cnt == 100) return(-1);
-	}
-      } else {
-	bytes_received+=ret;
-      }
+    /* adjust MTU wrt number of samples per packet */
+    if(ethernet_tune (device,MTU_SIZE,RAW_PACKET_SIZE_BYTES(device->openair0_cfg->samples_per_packet))!=0)  return -1;
+  } else {
+    if (eth_socket_init_udp(device)!=0)   return -1; 
+    /* RRH gets openair0 device configuration - BBU sets openair0 device configuration*/
+    if (device->host_type == BBU_HOST) {
+      if(eth_set_dev_conf_udp(device)!=0)  return -1;
+    } else {
+      if(eth_get_dev_conf_udp(device)!=0)  return -1;
     }
-
-#if DEBUG   
-    printf("Buffer head RX: nu=%d an_id=%d ts%d samples_recv=%d i=%d data=%x\n",
-	   *(int16_t *)buff2,
-	   *(int16_t *)(buff2 + sizeof(int16_t)),
-	   *(openair0_timestamp *)(buff2 + sizeof(int32_t)),
-	   ret>>2,i,*(int32_t *)(buff2 + 20*sizeof(int32_t)));
-#endif  
-
-    /* store the timestamp value from packet's header */
-    *timestamp =  *(openair0_timestamp *)(buff2 + sizeof(int32_t));
-    
-    /* tx buffer values restored */  
-    *(int32_t *)buff2 = temp0;
-    *(openair0_timestamp *)(buff2 + sizeof(int32_t)) = temp1;
+    /* adjust MTU wrt number of samples per packet */
+    //if(ethernet_tune (device,MTU_SIZE,UDP_PACKET_SIZE_BYTES(device->openair0_cfg->samples_per_packet))!=0)  return -1;
   }
-  return nsamps;
+  /* apply additional configuration */
+  if(ethernet_tune (device, SND_BUF_SIZE,2000000000)!=0)  return -1;
+  if(ethernet_tune (device, RCV_BUF_SIZE,2000000000)!=0)  return -1;
   
+  return 0;
 }
 
+
 void trx_eth_end(openair0_device *device) {
 
   eth_state_t *eth = (eth_state_t*)device->priv;
   int Mod_id = device->Mod_id;
-  /*destroys socket only for the processes that call the eth_end fuction-- shutdown() for beaking the pipe */
+  /* destroys socket only for the processes that call the eth_end fuction-- shutdown() for beaking the pipe */
   if ( close(eth->sockfd[Mod_id]) <0 ) {
     perror("ETHERNET: Failed to close socket");
     exit(0);
    } else {
-    printf("[RRH] socket for mod_id %d has been successfully closed.\n",Mod_id);
+    printf("[%s] socket for mod_id %d has been successfully closed.\n",(device->host_type == BBU_HOST)? "BBU":"RRH",Mod_id);
    }
  
 }
@@ -253,7 +113,7 @@ int trx_eth_request(openair0_device *device, void *msg, ssize_t msg_len) {
   eth_state_t *eth = (eth_state_t*)device->priv;
  
   /* BBU sends a message to RRH */
- if (sendto(eth->sockfd[Mod_id],msg,msg_len,0,(struct sockaddr *)&eth->dest_addr[Mod_id],dest_addr_len[Mod_id])==-1) {
+ if (sendto(eth->sockfd[Mod_id],msg,msg_len,0,(struct sockaddr *)&dest_addr[Mod_id],dest_addr_len[Mod_id])==-1) {
     perror("ETHERNET: ");
     exit(0);
   }
@@ -262,7 +122,6 @@ int trx_eth_request(openair0_device *device, void *msg, ssize_t msg_len) {
 }
 
 
-
 int trx_eth_reply(openair0_device *device, void *msg, ssize_t msg_len) {
 
   eth_state_t   *eth = (eth_state_t*)device->priv;
@@ -273,7 +132,7 @@ int trx_eth_reply(openair0_device *device, void *msg, ssize_t msg_len) {
 	       msg,
 	       msg_len,
 	       0,
-	       (struct sockaddr *)&eth->dest_addr[Mod_id],
+	       (struct sockaddr *)&dest_addr[Mod_id],
 	       (socklen_t *)&dest_addr_len[Mod_id])==-1) {
     perror("ETHERNET: ");
     exit(0);
@@ -283,65 +142,6 @@ int trx_eth_reply(openair0_device *device, void *msg, ssize_t msg_len) {
 }
 
 
-static int eth_set_dev_conf(openair0_device *device) {
-
-  int 	       Mod_id = device->Mod_id;
-  eth_state_t *eth = (eth_state_t*)device->priv;
-  void 	      *msg;
-  ssize_t      msg_len;
-
-  
-  /* a BBU client sents to RRH a set of configuration parameters (openair0_config_t)
-     so that RF front end is configured appropriately and
-     frame/packet size etc. can be set */ 
-  
-  msg=malloc(sizeof(openair0_config_t));
-  msg_len=sizeof(openair0_config_t);
-  memcpy(msg,(void*)&device->openair0_cfg,msg_len);	
-  
-  if (sendto(eth->sockfd[Mod_id],msg,msg_len,0,(struct sockaddr *)&eth->dest_addr[Mod_id],dest_addr_len[Mod_id])==-1) {
-    perror("ETHERNET: ");
-    exit(0);
-  }
-     
-  return 0;
-}
-
-
-static int eth_get_dev_conf(openair0_device *device) {
-
-  eth_state_t   *eth = (eth_state_t*)device->priv;
-  int 		Mod_id = device->Mod_id;
-  char 		str[INET_ADDRSTRLEN];
-  void 		*msg;
-  ssize_t	msg_len;
-  
-  msg=malloc(sizeof(openair0_config_t));
-  msg_len=sizeof(openair0_config_t);
-
-  /* RRH receives from BBU openair0_config_t */
-  if (recvfrom(eth->sockfd[Mod_id],
-	       msg,
-	       msg_len,
-	       0,
-	       (struct sockaddr *)&eth->dest_addr[Mod_id],
-	       (socklen_t *)&dest_addr_len[Mod_id])==-1) {
-    perror("ETHERNET: ");
-    exit(0);
-  }
-		
-   memcpy((void*)&device->openair0_cfg,msg,msg_len);	
-   inet_ntop(AF_INET, &(eth->dest_addr[Mod_id].sin_addr), str, INET_ADDRSTRLEN);
-   device->openair0_cfg.remote_port =ntohs(eth->dest_addr[Mod_id].sin_port);
-   device->openair0_cfg.remote_ip=str;
-   /*apply additional configuration*/
-   //ethernet_tune (device, RING_PAR);
-   // printf("[RRH] write mod_%d %d to %s:%d\n",Mod_id,eth->sockfd[Mod_id],str,ntohs(eth->dest_addr[Mod_id].sin_port));
-
-   return 0;
-}
-
-
 
 int trx_eth_stop(int card) {
   return(0);
@@ -364,186 +164,307 @@ int trx_eth_reset_stats(openair0_device* device) {
 }
 
 
-static int eth_socket_init(openair0_device *device) {
-
-  int i = 0;
-  eth_state_t *eth = (eth_state_t*)device->priv;
-  int Mod_id = device->Mod_id;  
-  char str[INET_ADDRSTRLEN];
-  const char *dest_ip;
-  int dest_port=0;
-  
-  if (device->func_type == RRH_FUNC ) {
-    dest_ip   = device->openair0_cfg.my_ip;   
-    dest_port = device->openair0_cfg.my_port;
-    printf("[RRH] ip addr %s port %d\n",dest_ip, dest_port);
-  } else {
-    dest_ip   = device->openair0_cfg.remote_ip;
-    dest_port = device->openair0_cfg.remote_port;
-    printf("[BBU] ip addr %s port %d\n",dest_ip, dest_port);
-  }
-    
-  /* Open RAW socket to send on */
-  if ((eth->sockfd[Mod_id] = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == -1) {
-    perror("ETHERNET: Error opening socket");
-    exit(0);
-  }
-
-  /* initialize destination address */
-  for (i=0; i< MAX_INST; i++) {
-    bzero((void *)&(eth->dest_addr[i]), sizeof(eth->dest_addr[i]));
-  }
-
- // bzero((void *)dest,sizeof(struct sockaddr_in));
-  eth->dest_addr[Mod_id].sin_family = AF_INET;
-  inet_pton(AF_INET,dest_ip,&(eth->dest_addr[Mod_id].sin_addr.s_addr));
-  eth->dest_addr[Mod_id].sin_port=htons(dest_port);
-  dest_addr_len[Mod_id] = sizeof(struct sockaddr_in);
-  inet_ntop(AF_INET, &(eth->dest_addr[Mod_id].sin_addr), str, INET_ADDRSTRLEN);
-  
-  /* if RRH, then I am the server, so bind */
-  if (device->func_type == RRH_FUNC ) {    
-    if (bind(eth->sockfd[Mod_id],(struct sockaddr *)&eth->dest_addr[Mod_id], dest_addr_len[Mod_id])<0) {
-      perror("ETHERNET: Cannot bind to socket");
-      exit(0);
-    } else {
-      printf("[RRH] binding mod_%d to %s:%d\n",Mod_id,str,ntohs(eth->dest_addr[Mod_id].sin_port));
-    }
-    
-  } else {
-    printf("[BBU] Connecting to %s:%d\n",str,ntohs(eth->dest_addr[Mod_id].sin_port));
-  }
-  
-  return 0;
-}
-
-
-int ethernet_tune(openair0_device *device , eth_opt_t option) {
+int ethernet_tune(openair0_device *device, unsigned int option, int value) {
   
   eth_state_t *eth = (eth_state_t*)device->priv;
   int Mod_id=device->Mod_id;
-  
-  unsigned int sndbuf_size=0, rcvbuf_size=0;
-  struct timeval snd_timeout, rcv_timeout;
+  struct timeval timeout;
   struct ifreq ifr;   
   char system_cmd[256]; 
   char* if_name=DEFAULT_IF;
-
-  /****************** socket level options ************************/
-  if (option== SND_BUF_SIZE) {    /* transmit socket buffer size */   
+  struct in_addr ia;
+  struct if_nameindex *ids;
+  int ret=0;
+  int i=0;
+  
+  /****************** socket level options ************************/  
+  switch(option) {
+  case SND_BUF_SIZE:  /* transmit socket buffer size */   
     if (setsockopt(eth->sockfd[Mod_id],  
 		   SOL_SOCKET,  
 		   SO_SNDBUF,  
-		   &sndbuf_size,sizeof(sndbuf_size))) {
+		   &value,sizeof(value))) {
       perror("[ETHERNET] setsockopt()");
     } else {
-      printf( "sndbuf_size= %d bytes\n", sndbuf_size); 
-    }     
-  } else if (option== RCV_BUF_SIZE) {  /* receive socket buffer size */   
+      printf("send buffer size= %d bytes\n",value); 
+    }   
+    break;
+    
+  case RCV_BUF_SIZE:   /* receive socket buffer size */   
     if (setsockopt(eth->sockfd[Mod_id],  
 		   SOL_SOCKET,  
 		   SO_RCVBUF,  
-		   &rcvbuf_size,sizeof(rcvbuf_size))) {
+		   &value,sizeof(value))) {
       perror("[ETHERNET] setsockopt()");
     } else {     
-      printf( "rcvbuf_size= %d bytes\n", rcvbuf_size);    
+      printf("receive bufffer size= %d bytes\n",value);    
     }
-  } else if (option==RCV_TIMEOUT) {
-    rcv_timeout.tv_sec = 0;
-    rcv_timeout.tv_usec = 180;//less than rt_period
+    break;
+    
+  case RCV_TIMEOUT:
+    timeout.tv_sec = value/1000000000;
+    timeout.tv_usec = value%1000000000;//less than rt_period?
     if (setsockopt(eth->sockfd[Mod_id],  
 		   SOL_SOCKET,  
 		   SO_RCVTIMEO,  
-		   (char *)&rcv_timeout,sizeof(rcv_timeout))) {
+		   (char *)&timeout,sizeof(timeout))) {
       perror("[ETHERNET] setsockopt()");  
     } else {   
-      printf( "rcv_timeout= %d usecs\n", rcv_timeout.tv_usec);  
+      printf( "receive timeout= %d,%d sec\n",timeout.tv_sec,timeout.tv_usec);  
     }  
-  } else if (option==SND_TIMEOUT) {
-    snd_timeout.tv_sec = 0;
-    snd_timeout.tv_usec = 180;//less than rt_period
+    break;
+    
+  case SND_TIMEOUT:
+    timeout.tv_sec = value/1000000000;
+    timeout.tv_usec = value%1000000000;//less than rt_period?
     if (setsockopt(eth->sockfd[Mod_id],  
 		   SOL_SOCKET,  
 		   SO_SNDTIMEO,  
-		   (char *)&snd_timeout,sizeof(snd_timeout))) {
+		   (char *)&timeout,sizeof(timeout))) {
       perror("[ETHERNET] setsockopt()");     
     } else {
-      printf( "snd_timeout= %d usecs\n", snd_timeout.tv_usec);    
+      printf( "send timeout= %d,%d sec\n",timeout.tv_sec,timeout.tv_usec);    
     }
-  }
-  
-  /******************* interface level options  *************************/
-  else if (option==MTU_SIZE) {    /* change  MTU of the eth interface */ 
+    break;
+    
+    
+    /******************* interface level options  *************************/
+  case MTU_SIZE: /* change  MTU of the eth interface */ 
     ifr.ifr_addr.sa_family = AF_INET;
-    strncpy(ifr.ifr_name,if_name, sizeof(ifr.ifr_name));
-    ifr.ifr_mtu =8960;
+    strncpy(ifr.ifr_name,eth->if_name[Mod_id], sizeof(ifr.ifr_name));
+    ifr.ifr_mtu =value;
     if (ioctl(eth->sockfd[Mod_id],SIOCSIFMTU,(caddr_t)&ifr) < 0 )
       perror ("[ETHERNET] Can't set the MTU");
     else 
-      printf("[ETHERNET] %s MTU size has changed to %d\n",DEFAULT_IF,ifr.ifr_mtu);
-  } else if (option==TX_Q_LEN) {    /* change TX queue length of eth interface */ 
+      printf("[ETHERNET] %s MTU size has changed to %d\n",eth->if_name[Mod_id],ifr.ifr_mtu);
+    break;
+    
+  case TX_Q_LEN:  /* change TX queue length of eth interface */ 
     ifr.ifr_addr.sa_family = AF_INET;
-    strncpy(ifr.ifr_name,if_name, sizeof(ifr.ifr_name));
-    ifr.ifr_qlen =3000 ;
+    strncpy(ifr.ifr_name,eth->if_name[Mod_id], sizeof(ifr.ifr_name));
+    ifr.ifr_qlen =value;
     if (ioctl(eth->sockfd[Mod_id],SIOCSIFTXQLEN,(caddr_t)&ifr) < 0 )
       perror ("[ETHERNET] Can't set the txqueuelen");
     else 
-      printf("[ETHERNET] %s txqueuelen size has changed to %d\n",DEFAULT_IF,ifr.ifr_qlen);
-
-
+      printf("[ETHERNET] %s txqueuelen size has changed to %d\n",eth->if_name[Mod_id],ifr.ifr_qlen);
+    break;
+    
     /******************* device level options  *************************/
-  } else if (option==COALESCE_PAR) {  
-    if (snprintf(system_cmd,sizeof(system_cmd),"ethtool -C %s rx-usecs 3",DEFAULT_IF) > 0) {
-      system(system_cmd);
+  case COALESCE_PAR:
+    ret=snprintf(system_cmd,sizeof(system_cmd),"ethtool -C %s rx-usecs %d",eth->if_name[Mod_id],value);
+    if (ret > 0) {
+      ret=system(system_cmd);
+      if (ret == -1) {
+	fprintf (stderr,"[ETHERNET] Can't start shell to execute %s %s",system_cmd, strerror(errno));
+      } else {
+	printf ("[ETHERNET] status of %s is %i\n",WEXITSTATUS(ret));
+      }
       printf("[ETHERNET] Coalesce parameters %s\n",system_cmd);
     } else {
       perror("[ETHERNET] Can't set coalesce parameters\n");
     }
+    break;
     
-  } else if (option==PAUSE_PAR ) {  
-    if (snprintf(system_cmd,sizeof(system_cmd),"ethtool -A %s autoneg off rx off tx off",DEFAULT_IF) > 0) {
-      system(system_cmd);
+  case PAUSE_PAR:
+    if (value==1) ret=snprintf(system_cmd,sizeof(system_cmd),"ethtool -A %s autoneg off rx off tx off",eth->if_name[Mod_id]);
+    else if (value==0) ret=snprintf(system_cmd,sizeof(system_cmd),"ethtool -A %s autoneg on rx on tx on",eth->if_name[Mod_id]);
+    else break;
+    if (ret > 0) {
+      ret=system(system_cmd);
+      if (ret == -1) {
+	fprintf (stderr,"[ETHERNET] Can't start shell to execute %s %s",system_cmd, strerror(errno));
+      } else {
+	printf ("[ETHERNET] status of %s is %i\n",WEXITSTATUS(ret));
+      }
       printf("[ETHERNET] Pause parameters %s\n",system_cmd);
     } else {
       perror("[ETHERNET] Can't set pause parameters\n");
     }
-  } else if (option==RING_PAR ) {  
-    if (snprintf(system_cmd,sizeof(system_cmd),"ethtool -G %s rx 4096 tx 4096",DEFAULT_IF) > 0) {
-      system(system_cmd);
+    break;
+    
+  case RING_PAR:
+    ret=snprintf(system_cmd,sizeof(system_cmd),"ethtool -G %s rx %d tx %d",eth->if_name[Mod_id],value);
+    if (ret > 0) {
+      ret=system(system_cmd);
+      if (ret == -1) {
+	fprintf (stderr,"[ETHERNET] Can't start shell to execute %s %s",system_cmd, strerror(errno));
+      } else {
+	printf ("[ETHERNET] status of %s is %i\n",WEXITSTATUS(ret));
+      }            
       printf("[ETHERNET] Ring parameters %s\n",system_cmd);
     } else {
       perror("[ETHERNET] Can't set ring parameters\n");
     }
+    break;
     
+  default:
+    break;
   }
+  
   return 0;
 }
 
 
 
-int openair0_dev_init_eth(openair0_device *device, openair0_config_t *openair0_cfg) {
+int transport_init(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t * eth_params ) {
 
   eth_state_t *eth = (eth_state_t*)malloc(sizeof(eth_state_t));
-  int card = 0;
   memset(eth, 0, sizeof(eth_state_t));
-  eth->buffer_size =  (unsigned int)openair0_cfg[card].samples_per_packet*sizeof(int32_t); // buffer size = 4096 for sample_len of 1024
-  eth->sample_rate = (unsigned int)openair0_cfg[card].sample_rate;
-  device->priv = eth; 	
 
-  printf("ETHERNET: Initializing openair0_device for %s ...\n", ((device->func_type == BBU_FUNC) ? "BBU": "RRH"));
+  if (eth_params->transp_preference == 1) {
+    eth->flags = ETH_RAW_MODE;
+  } else {
+    eth->flags = ETH_UDP_MODE;
+  }
+  
+  printf("[ETHERNET]: Initializing openair0_device for %s ...\n", ((device->host_type == BBU_HOST) ? "BBU": "RRH"));
   device->Mod_id           = num_devices_eth++;
+  device->transp_type      = ETHERNET_TP;
   device->trx_start_func   = trx_eth_start;
   device->trx_request_func = trx_eth_request;
   device->trx_reply_func   = trx_eth_reply;
-  device->trx_write_func   = trx_eth_write;
-  device->trx_read_func    = trx_eth_read;  
   device->trx_get_stats_func   = trx_eth_get_stats;
   device->trx_reset_stats_func = trx_eth_reset_stats;
-  device->trx_end_func = trx_eth_end;
-  device->trx_stop_func = trx_eth_stop;
+  device->trx_end_func         = trx_eth_end;
+  device->trx_stop_func        = trx_eth_stop;
   device->trx_set_freq_func = trx_eth_set_freq;
   device->trx_set_gains_func = trx_eth_set_gains;
-  
-  memcpy((void*)&device->openair0_cfg,(void*)openair0_cfg,sizeof(openair0_config_t));
+
+  if ((eth->flags & ETH_RAW_MODE) != 0 ) {
+    device->trx_write_func   = trx_eth_write_raw;
+    device->trx_read_func    = trx_eth_read_raw;     
+  } else {
+    device->trx_write_func   = trx_eth_write_udp;
+    device->trx_read_func    = trx_eth_read_udp;     
+  }
+
+  eth->if_name[device->Mod_id] = eth_params->local_if_name;
+  device->priv = eth;
+ 	
+  /* device specific */
+  openair0_cfg[0].txlaunch_wait = 0;//manage when TX processing is triggered
+  openair0_cfg[0].txlaunch_wait_slotcount = 0; //manage when TX processing is triggered
+  openair0_cfg[0].iq_rxrescale = 15;//rescale iqs
+  openair0_cfg[0].iq_txshift = eth_params->iq_txshift;// shift
+  openair0_cfg[0].tx_sample_advance = eth_params->tx_sample_advance;
+
+  /* RRH does not have any information to make this configuration atm */
+  if (device->host_type == BBU_HOST) {
+    /*Note scheduling advance values valid only for case 7680000 */    
+    switch ((int)openair0_cfg[0].sample_rate) {
+    case 30720000:
+      openair0_cfg[0].samples_per_packet    = 4096;     
+      break;
+    case 23040000:     
+      openair0_cfg[0].samples_per_packet    = 2048;
+      break;
+    case 15360000:
+      openair0_cfg[0].samples_per_packet    = 2048;      
+      break;
+    case 7680000:
+      openair0_cfg[0].samples_per_packet    = 1024;     
+      break;
+    case 1920000:
+      openair0_cfg[0].samples_per_packet    = 256;     
+      break;
+    default:
+      printf("Error: unknown sampling rate %f\n",openair0_cfg[0].sample_rate);
+      exit(-1);
+      break;
+    }
+    openair0_cfg[0].tx_scheduling_advance = eth_params->tx_scheduling_advance*openair0_cfg[0].samples_per_packet;
+  }
+ 
+  device->openair0_cfg=&openair0_cfg[0];
   return 0;
 }
+
+
+/**************************************************************************************************************************
+ *                                         DEBUGING-RELATED FUNCTIONS                                                     *
+ **************************************************************************************************************************/
+void dump_packet(char *title, unsigned char* pkt, int bytes, unsigned int tx_rx_flag) {
+   
+  static int numSend = 1;
+  static int numRecv = 1;
+  int num, k;
+  char tmp[48];
+  unsigned short int cksum;
+  
+  num = (tx_rx_flag)? numSend++:numRecv++;
+  for (k = 0; k < 24; k++) sprintf(tmp+k, "%02X", pkt[k]);
+  cksum = calc_csum((unsigned short *)pkt, bytes>>2);
+  printf("%s-%s (%06d): %s 0x%04X\n", title,(tx_rx_flag)? "TX":"RX", num, tmp, cksum);
+}
+
+unsigned short calc_csum (unsigned short *buf, int nwords) {
+ 
+ unsigned long sum;
+  for (sum = 0; nwords > 0; nwords--)
+    sum += *buf++;
+  sum = (sum >> 16) + (sum & 0xffff);
+  sum += (sum >> 16);
+  return ~sum;
+}
+
+void dump_dev(openair0_device *device) {
+
+  eth_state_t *eth = (eth_state_t*)device->priv;
+  
+  printf("Ethernet device interface %i configuration:\n" ,device->openair0_cfg->Mod_id);
+  printf("       Log level is %i :\n" ,device->openair0_cfg->log_level);	
+  printf("       RB number: %i, sample rate: %lf \n" ,
+        device->openair0_cfg->num_rb_dl, device->openair0_cfg->sample_rate);
+  printf("       Scheduling_advance: %i, Sample_advance: %u \n" ,
+        device->openair0_cfg->tx_scheduling_advance, device->openair0_cfg->tx_sample_advance);		
+  printf("       BBU configured for %i tx/%i rx channels)\n",
+	device->openair0_cfg->tx_num_channels,device->openair0_cfg->rx_num_channels);
+   printf("       Running flags: %s %s %s\n",      
+	((eth->flags & ETH_RAW_MODE)  ? "RAW socket mode - ":""),
+	((eth->flags & ETH_UDP_MODE)  ? "UDP socket mode - ":""));	  	
+  printf("       Number of iqs dumped when displaying packets: %i\n\n",eth->iqdumpcnt);   
+  
+}
+
+void inline dump_txcounters(openair0_device *device) {
+  eth_state_t *eth = (eth_state_t*)device->priv;  
+  printf("   Ethernet device interface %i, tx counters:\n" ,device->openair0_cfg->Mod_id);
+  printf("   Sent packets: %llu send errors: %i\n",   eth->tx_count, eth->num_tx_errors);	 
+}
+
+void inline dump_rxcounters(openair0_device *device) {
+
+  eth_state_t *eth = (eth_state_t*)device->priv;
+  printf("   Ethernet device interface %i rx counters:\n" ,device->openair0_cfg->Mod_id);
+  printf("   Received packets: %llu missed packets errors: %i\n", eth->rx_count, eth->num_underflows);	 
+}  
+
+void inline dump_buff(openair0_device *device, char *buff,unsigned int tx_rx_flag, int nsamps) {
+  
+  char *strptr;
+  eth_state_t *eth = (eth_state_t*)device->priv;  
+  /*need to add ts number of iqs in printf need to fix dump iqs call */
+  strptr = (( tx_rx_flag == TX_FLAG) ? "TX" : "RX");
+  printf("\n %s, nsamps=%i \n" ,strptr,nsamps);     
+  
+  if (tx_rx_flag == 1) {
+    dump_txcounters(device);
+    printf("  First %i iqs of TX buffer\n",eth->iqdumpcnt);
+    dump_iqs(buff,eth->iqdumpcnt);
+  } else {
+    dump_rxcounters(device);
+    printf("  First %i iqs of RX buffer\n",eth->iqdumpcnt);
+    dump_iqs(buff,eth->iqdumpcnt);      
+  }
+  
+}
+
+void dump_iqs(char * buff, int iq_cnt) {
+  int i;
+  for (i=0;i<iq_cnt;i++) {
+    printf("s%02i: Q=%+ij I=%+i%s",i,
+	   ((iqoai_t *)(buff))[i].q,
+	   ((iqoai_t *)(buff))[i].i,
+	   ((i+1)%3 == 0) ? "\n" : "  ");
+  }   
+}
diff --git a/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h b/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h
index eabec94ebcba082f1c72929664e452919f7cd5bd..b4618bb8254d4abccaf8808ad7024e6cbb53a6b6 100644
--- a/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h
+++ b/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h
@@ -36,6 +36,8 @@
  * \note
  * \warning 
  */
+#ifndef ETHERNET_LIB_H
+#define ETHERNET_LIB_H
 
 #include <arpa/inet.h>
 #include <linux/if_packet.h>
@@ -47,71 +49,90 @@
 #include <net/if.h>
 #include <netinet/ether.h>
 
-#define MAX_INST        4
-#define DEFAULT_IF  "lo"
-#define BUF_SIZ      8960 /*Jumbo frame size*/
+#define MAX_INST      4
+#define DEFAULT_IF   "lo"
 
-typedef struct {
+#define ETH_RAW_MODE        1
+#define ETH_UDP_MODE        0
 
-  // opaque eth data struct
-  //struct eth_if *dev;
-  // An empty ("") or NULL device identifier will result in the first encountered device being opened (using the first discovered backend)
+#define TX_FLAG	        1
+#define RX_FLAG 	0
 
-  int sockfd[MAX_INST];
-  struct sockaddr_in dest_addr[MAX_INST];
+#define MAX_PACKET_SEQ_NUM(spp,spf) (spf/spp)
+#define MAC_HEADER_SIZE_BYTES (sizeof(struct ether_header))
+#define APP_HEADER_SIZE_BYTES (sizeof(int32_t) + sizeof(openair0_timestamp))
+#define PAYLOAD_SIZE_BYTES(nsamps) (nsamps<<2)
+#define UDP_PACKET_SIZE_BYTES(nsamps) (APP_HEADER_SIZE_BYTES + PAYLOAD_SIZE_BYTES(nsamps))
+#define RAW_PACKET_SIZE_BYTES(nsamps) (APP_HEADER_SIZE_BYTES + MAC_HEADER_SIZE_BYTES + PAYLOAD_SIZE_BYTES(nsamps))
 
-  unsigned int buffer_size;
-  unsigned int timeout_ns;
 
-  //struct eth_metadata meta_rx;
-  //struct eth_metadata meta_tx;
-
-  unsigned int sample_rate;
-  // time offset between transmiter timestamp and receiver timestamp;
+/*!\brief opaque ethernet data structure */
+typedef struct {
+  
+  /*!\brief socket file desc */ 
+  int sockfd[MAX_INST];
+  /*!\brief interface name */ 
+  char *if_name[MAX_INST];
+  /*!\brief buffer size */ 
+  unsigned int buffer_size;
+  /*!\brief timeout ms */ 
+  unsigned int rx_timeout_ms;
+  /*!\brief timeout ms */ 
+  unsigned int tx_timeout_ms;
+  /*!\brief runtime flags */ 
+  uint32_t flags;   
+  /*!\ time offset between transmiter timestamp and receiver timestamp */ 
   double tdiff;
-  // use brf_time_offset to get this value
-  int tx_forward_nsamps; //166 for 20Mhz
-
-
+  /*!\ calibration */
+  int tx_forward_nsamps;
+  
   // --------------------------------
   // Debug and output control
   // --------------------------------
+  
+  /*!\brief number of I/Q samples to be printed */ 
+  int iqdumpcnt;
+
+  /*!\brief number of underflows in interface */ 
   int num_underflows;
+  /*!\brief number of overflows in interface */ 
   int num_overflows;
+  /*!\brief number of concesutive errors in interface */ 
   int num_seq_errors;
+  /*!\brief number of errors in interface's receiver */ 
   int num_rx_errors;
+  /*!\brief umber of errors in interface's transmitter */ 
   int num_tx_errors;
-
-  uint64_t tx_actual_nsamps; // actual number of samples transmitted
+  
+  /*!\brief current TX timestamp */ 
+  openair0_timestamp tx_current_ts;
+  /*!\brief socket file desc */ 
+  openair0_timestamp rx_current_ts;
+  /*!\brief actual number of samples transmitted */ 
+  uint64_t tx_actual_nsamps; 
+  /*!\brief actual number of samples received */
   uint64_t rx_actual_nsamps;
-  uint64_t tx_nsamps; // number of planned samples
+  /*!\brief number of samples to be transmitted */
+  uint64_t tx_nsamps; 
+  /*!\brief number of samples to be received */
   uint64_t rx_nsamps;
-  uint64_t tx_count; // number pf packets
+  /*!\brief number of packets transmitted */
+  uint64_t tx_count; 
+  /*!\brief number of packets received */
   uint64_t rx_count;
-  //openair0_timestamp rx_timestamp;
 
 } eth_state_t;
 
-#define 	ETH_META_STATUS_OVERRUN   (1 << 0)
-#define 	ETH_META_STATUS_UNDERRUN  (1 << 1)
-
-struct eth_meta_data{
-	uint64_t 	timestamp;
-	uint32_t 	flags;	 
-	uint32_t 	status;
- 	unsigned int 	actual_count;
-};
-
 
 
 /*!\brief packet header */
 typedef struct {
+  /*!\brief packet sequence number max value=packets per frame*/
+  uint16_t seq_num ;
+  /*!\brief antenna port used to resynchronize */
+  uint16_t antenna_id;
   /*!\brief packet's timestamp */ 
   openair0_timestamp timestamp;
-  /*!\brief variable declared for alignment purposes (sample size=32 bit)  */
-  int16_t not_used;
-  /*!\brief antenna port used to resynchronize */
-  int16_t antenna_id;
 } header_t;
 
 /*!\brief different options for ethernet tuning in socket and driver level */
@@ -138,9 +159,37 @@ typedef enum {
   MAX_OPT
 } eth_opt_t;
 
+/*
+#define SND_BUF_SIZE	1
+#define RCV_BUF_SIZE	1<<1
+#define SND_TIMEOUT	1<<2
+#define RCV_TIMEOUT	1<<3
+#define MTU_SIZE        1<<4
+#define TX_Q_LEN	1<<5
+#define RING_PAR	1<<5
+#define COALESCE_PAR	1<<6
+#define PAUSE_PAR       1<<7
+*/
 
+/*!\brief I/Q samples */
+typedef struct {
+  /*!\brief phase  */
+  short i;
+  /*!\brief quadrature */
+  short q;
+} iqoai_t ;
 
-/*! \fn int ethernet_tune (openair0_device *device, eth_opt_t option)
+void dump_packet(char *title, unsigned char* pkt, int bytes, unsigned int tx_rx_flag);
+unsigned short calc_csum (unsigned short *buf, int nwords);
+void dump_dev(openair0_device *device);
+void inline dump_buff(openair0_device *device, char *buff,unsigned int tx_rx_flag,int nsamps);
+void inline dump_rxcounters(openair0_device *device);
+void inline dump_txcounters(openair0_device *device);
+void dump_iqs(char * buff, int iq_cnt);
+
+
+
+/*! \fn int ethernet_tune (openair0_device *device, unsigned int option, int value);
 * \brief this function allows you to configure certain ethernet parameters in socket or device level
 * \param[in] openair0 device which bears the socket
 * \param[in] name of parameter to configure
@@ -148,6 +197,37 @@ typedef enum {
 * \note
 * @ingroup  _oai
 */
-int ethernet_tune (openair0_device *device, eth_opt_t option);
-int ethernet_write_data(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps,int cc) ;
-int ethernet_read_data(openair0_device *device,openair0_timestamp *timestamp,void **buff, int nsamps,int cc);
+int ethernet_tune(openair0_device *device, unsigned int option, int value);
+
+
+
+/*! \fn int eth_socket_init_udp(openair0_device *device)
+* \brief initialization of UDP Socket to communicate with one destination
+* \param[in] *device openair device for which the socket will be created
+* \param[out]
+* \return 0 on success, otherwise -1
+* \note
+* @ingroup  _oai
+*/
+int eth_socket_init_udp(openair0_device *device);
+int trx_eth_write_udp(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps,int cc, int flags);
+int trx_eth_read_udp(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc);
+int eth_get_dev_conf_udp(openair0_device *device);
+
+/*! \fn static int eth_set_dev_conf_udp(openair0_device *device)
+* \brief
+* \param[in] *device openair device
+* \param[out]
+* \return 0 on success, otherwise -1
+* \note
+* @ingroup  _oai
+*/
+int eth_set_dev_conf_udp(openair0_device *device);
+int eth_socket_init_raw(openair0_device *device);
+int trx_eth_write_raw(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps,int cc, int flags);
+int trx_eth_read_raw(openair0_device *device, openair0_timestamp *timestamp, void **buff, int nsamps, int cc);
+int eth_get_dev_conf_raw(openair0_device *device);
+int eth_set_dev_conf_raw(openair0_device *device);
+
+
+#endif
diff --git a/targets/ARCH/EXMIMO/DRIVER/eurecom/module_main.c b/targets/ARCH/EXMIMO/DRIVER/eurecom/module_main.c
index 4ef187b07361de2c5722d29e817dd1b7e0db8726..ce699a1b4f021aba64a83a83dbad37bf2cae90ff 100755
--- a/targets/ARCH/EXMIMO/DRIVER/eurecom/module_main.c
+++ b/targets/ARCH/EXMIMO/DRIVER/eurecom/module_main.c
@@ -190,15 +190,13 @@ static int __init openair_init_module( void )
     mmio_length[card] = pci_resource_len  (pdev[card], 0);
     mmio_flags[card]  = pci_resource_flags(pdev[card], 0);
 
-    if (check_mem_region(mmio_start[card],256) < 0) {
+    if (request_mem_region(mmio_start[card],256,"openair_rf") == NULL) {
       printk("[openair][INIT_MODULE][FATAL] : Cannot get memory region 0, aborting\n");
       mmio_start[card] = 0;
       openair_cleanup();
       return -EBUSY;
     } else
-      printk("[openair][INIT_MODULE][INFO] : Reserving memory region 0 : mmio_start = 0x%x\n",(unsigned int)mmio_start[card]);
-
-    request_mem_region(mmio_start[card], 256, "openair_rf");
+      printk("[openair][INIT_MODULE][INFO] : Reserved memory region 0 : mmio_start = 0x%x\n",(unsigned int)mmio_start[card]);
 
     bar[card] = pci_iomap( pdev[card], 0, mmio_length[card] );   // get virtual kernel address for BAR0
 
diff --git a/targets/ARCH/EXMIMO/USERSPACE/LIB/gain_control.h b/targets/ARCH/EXMIMO/USERSPACE/LIB/gain_control.h
index dd48683ad03d162702addcda06f5ff67577cdc09..c71b51550e53f72e3b3c49fed6a27a64afce8475 100644
--- a/targets/ARCH/EXMIMO/USERSPACE/LIB/gain_control.h
+++ b/targets/ARCH/EXMIMO/USERSPACE/LIB/gain_control.h
@@ -30,8 +30,10 @@
 #define TARGET_RX_POWER 50    // Target digital power for the AGC
 #define TARGET_RX_POWER_MAX 53    // Maximum digital power for AGC
 #define TARGET_RX_POWER_MIN 48    // Minimum digital power for AGC
+#ifndef min
 #define min(a,b) (((a)<(b))?(a):(b))
 #define max(a,b) (((a)>(b))?(a):(b))
+#endif
 
 void gain_control_all (unsigned int rx_power_fil_dB, unsigned int card);
 void gain_control (unsigned int rx_power_fil_dB, unsigned int ant, unsigned int card);
diff --git a/targets/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c b/targets/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c
index b32db11ea7a365b4684b63a65ce31a3bff163dd0..f9c7e3d4cf6bcc10ad06e816230f39e25885f08d 100644
--- a/targets/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c
+++ b/targets/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c
@@ -247,7 +247,7 @@ int openair0_stop_without_reset(int card)
 #define MY_RF_MODE      (RXEN + TXEN + TXLPFNORM + TXLPFEN + TXLPF25 + RXLPFNORM + RXLPFEN + RXLPF25 + LNA1ON +LNAMax + RFBBNORM + DMAMODE_RX + DMAMODE_TX)
 #define RF_MODE_BASE    (LNA1ON + RFBBNORM)
 
-int openair0_dev_init_exmimo(openair0_device *device, openair0_config_t *openair0_cfg) {
+int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
 
   // Initialize card
   //  exmimo_config_t         *p_exmimo_config;
@@ -287,6 +287,8 @@ int openair0_dev_init_exmimo(openair0_device *device, openair0_config_t *openair
     return(-1);
   }
 
+  device->type             = EXMIMO_DEV; 
+
   return(0);
 }
 
@@ -323,6 +325,12 @@ int openair0_config(openair0_config_t *openair0_cfg, int UE_flag)
     else
       p_exmimo_config->framing.multicard_syncmode=SYNCMODE_SLAVE;
 
+    /* device specific */
+    openair0_cfg[card].txlaunch_wait = 1;//manage when TX processing is triggered
+    openair0_cfg[card].txlaunch_wait_slotcount = 1; //manage when TX processing is triggered
+    openair0_cfg[card].iq_txshift = 4;//shift
+    openair0_cfg[card].iq_rxrescale = 15;//rescale iqs
+
     if (openair0_cfg[card].sample_rate==30.72e6) {
       resampling_factor = 0;
       rx_filter = RXLPF10;
diff --git a/targets/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.h b/targets/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.h
index ae2ff8a36b08a445d0ab2e3f1169720afde6faf5..0abb27dee281c50aca2e280fd18358ae631513ca 100644
--- a/targets/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.h
+++ b/targets/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.h
@@ -98,4 +98,6 @@ unsigned int *openair0_daq_cnt(void);
 // set the TX and RX frequencies (card 0 only for now, to retain USRP compatibility)
 int openair0_set_frequencies(openair0_device* device, openair0_config_t *openair0_cfg,int exmimo_dump_config);
 
+int openair0_set_gains(openair0_device* device, openair0_config_t *openair0_cfg);
+
 #endif
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/Si5351C/CMakeLists.txt b/targets/ARCH/LMSSDR/USERSPACE/LIB/Si5351C/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..c331185e1738799cacd04857d5e7d34448f4022a
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/Si5351C/CMakeLists.txt
@@ -0,0 +1,11 @@
+set(si5351_src_files
+	Si5351C.cpp
+)
+set(CMAKE_CXX_FLAGS
+  "${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -std=c++11 -fPIC"
+)
+
+
+add_library(Si5351C STATIC ${si5351_src_files})
+target_include_directories(Si5351C PUBLIC ../lms7002m ${CMAKE_CURRENT_SOURCE_DIR})
+target_link_libraries(Si5351C LMS7002M)
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/Si5351C/Si5351C.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/Si5351C/Si5351C.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..88bcb74f3d5c29e99495a773b757fd8355160ad4
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/Si5351C/Si5351C.cpp
@@ -0,0 +1,872 @@
+/**
+@file	Si5351C.cpp
+@author	Lime Microsystems
+@brief 	Configuring of Si5351C
+*/
+
+#include "Si5351C.h"
+#include "lmsComms.h"
+#include <math.h>
+#include <iomanip>
+#include <fstream>
+#include <sstream>
+#include <set>
+#include <string.h>
+#include <assert.h>
+#include <iostream>
+using namespace std;
+
+#define Log(msg, type) cout << (msg) << endl;
+
+/// Splits float into fraction integers A + B/C
+void realToFrac(const float real, int &A, int &B, int &C)
+{
+    A = (int)real;
+    B = (int)((real - A) * 1048576 + 0.5);
+    C = 1048576;
+
+    int a = B;
+    int b = C;
+    int temp;
+    while( b!= 0) // greatest common divider
+    {
+        temp = a % b;
+        a = b;
+        b = temp;
+    }
+    B = B/a;
+    C = C/a;
+}
+
+/// Default configuration
+const unsigned char Si5351C::m_defaultConfiguration[] =
+{ 0,0x00,
+  1,0x00,
+  2,0x08,
+  3,0x00,
+  4,0x00,
+  5,0x00,
+  6,0x00,
+  7,0x00,
+  8,0x00,
+  9,0x00,
+ 10,0x00,
+ 11,0x00,
+ 12,0x00,
+ 13,0x00,
+ 14,0x00,
+ 15,0x04,
+ 16,0x4F,
+ 17,0x4F,
+ 18,0x4F,
+ 19,0x4F,
+ 20,0x4F,
+ 21,0x4F,
+ 22,0x0F,
+ 23,0x0F,
+ 24,0x00,
+ 25,0x00,
+ 26,0x00,
+ 27,0x80,
+ 28,0x00,
+ 29,0x0B,
+ 30,0x2F,
+ 31,0x00,
+ 32,0x00,
+ 33,0x00,
+ 34,0x00,
+ 35,0x00,
+ 36,0x00,
+ 37,0x00,
+ 38,0x00,
+ 39,0x00,
+ 40,0x00,
+ 41,0x00,
+ 42,0x00,
+ 43,0x01,
+ 44,0x00,
+ 45,0x0D,
+ 46,0x00,
+ 47,0x00,
+ 48,0x00,
+ 49,0x00,
+ 50,0x00,
+ 51,0x01,
+ 52,0x00,
+ 53,0x0D,
+ 54,0x00,
+ 55,0x00,
+ 56,0x00,
+ 57,0x00,
+ 58,0x00,
+ 59,0x01,
+ 60,0x00,
+ 61,0x0D,
+ 62,0x00,
+ 63,0x00,
+ 64,0x00,
+ 65,0x00,
+ 66,0x00,
+ 67,0x01,
+ 68,0x00,
+ 69,0x0D,
+ 70,0x00,
+ 71,0x00,
+ 72,0x00,
+ 73,0x00,
+ 74,0x00,
+ 75,0x01,
+ 76,0x00,
+ 77,0x0D,
+ 78,0x00,
+ 79,0x00,
+ 80,0x00,
+ 81,0x00,
+ 82,0x00,
+ 83,0x01,
+ 84,0x00,
+ 85,0x0D,
+ 86,0x00,
+ 87,0x00,
+ 88,0x00,
+ 89,0x00,
+ 90,0x1E,
+ 91,0x1E,
+ 92,0x00,
+ 93,0x00,
+ 94,0x00,
+ 95,0x00,
+ 96,0x00,
+ 97,0x00,
+ 98,0x00,
+ 99,0x00,
+100,0x00,
+101,0x00,
+102,0x00,
+103,0x00,
+104,0x00,
+105,0x00,
+106,0x00,
+107,0x00,
+108,0x00,
+109,0x00,
+110,0x00,
+111,0x00,
+112,0x00,
+113,0x00,
+114,0x00,
+115,0x00,
+116,0x00,
+117,0x00,
+118,0x00,
+119,0x00,
+120,0x00,
+121,0x00,
+122,0x00,
+123,0x00,
+124,0x00,
+125,0x00,
+126,0x00,
+127,0x00,
+128,0x00,
+129,0x00,
+130,0x00,
+131,0x00,
+132,0x00,
+133,0x00,
+134,0x00,
+135,0x00,
+136,0x00,
+137,0x00,
+138,0x00,
+139,0x00,
+140,0x00,
+141,0x00,
+142,0x00,
+143,0x00,
+144,0x00,
+145,0x00,
+146,0x00,
+147,0x00,
+148,0x00,
+149,0x00,
+150,0x00,
+151,0x00,
+152,0x00,
+153,0x00,
+154,0x00,
+155,0x00,
+156,0x00,
+157,0x00,
+158,0x00,
+159,0x00,
+160,0x00,
+161,0x00,
+162,0x00,
+163,0x00,
+164,0x00,
+165,0x00,
+166,0x00,
+167,0x00,
+168,0x00,
+169,0x00,
+170,0x00,
+171,0x00,
+172,0x00,
+173,0x00,
+174,0x00,
+175,0x00,
+176,0x00,
+177,0x00,
+178,0x00,
+179,0x00,
+180,0x00,
+181,0x30,
+182,0x00,
+183,0xD2,
+184,0x60,
+185,0x60,
+186,0x00,
+187,0xC0,
+188,0x00,
+189,0x00,
+190,0x00,
+191,0x00,
+192,0x00,
+193,0x00,
+194,0x00,
+195,0x00,
+196,0x00,
+197,0x00,
+198,0x00,
+199,0x00,
+200,0x00,
+201,0x00,
+202,0x00,
+203,0x00,
+204,0x00,
+205,0x00,
+206,0x00,
+207,0x00,
+208,0x00,
+209,0x00,
+210,0x00,
+211,0x00,
+212,0x00,
+213,0x00,
+214,0x00,
+215,0x00,
+216,0x00,
+217,0x00,
+218,0x00,
+219,0x00,
+220,0x00,
+221,0x0D,
+222,0x00,
+223,0x00,
+224,0x00,
+225,0x00,
+226,0x00,
+227,0x00,
+228,0x00,
+229,0x00,
+230,0x00,
+231,0x00,
+232,0x00};
+
+// ---------------------------------------------------------------------------
+Si5351C::Si5351C()
+{
+    memset(m_newConfiguration, 0, 255);
+    for(unsigned int i=0; i<sizeof(m_defaultConfiguration); i+=2)
+    {
+        m_newConfiguration[m_defaultConfiguration[i]] = m_defaultConfiguration[i+1];
+    }
+	device = NULL;
+}
+// ---------------------------------------------------------------------------
+
+Si5351C::~Si5351C()
+{
+
+}
+
+/** @brief Sends Configuration to Si5351C
+*/
+Si5351C::Status Si5351C::UploadConfiguration()
+{
+    LMScomms::GenericPacket pkt;
+    pkt.cmd = CMD_SI5351_WR;
+    
+	if (!device)
+        return FAILED;
+    //Disable outputs
+	pkt.outBuffer.push_back(3);
+    pkt.outBuffer.push_back(0xFF);
+	//Power down all output drivers
+	for(int i=0; i<8; ++i)
+    {
+        pkt.outBuffer.push_back(16 + i);
+        pkt.outBuffer.push_back(0x84);
+    }
+	//write new configuration
+	for (int i = 15; i <= 92; ++i)
+	{
+        pkt.outBuffer.push_back(i);
+        pkt.outBuffer.push_back(m_newConfiguration[i]);
+	}
+	for (int i = 149; i <= 170; ++i)
+	{
+        pkt.outBuffer.push_back(i);
+        pkt.outBuffer.push_back(m_newConfiguration[i]);
+	}
+	//apply soft reset
+    pkt.outBuffer.push_back(177);
+    pkt.outBuffer.push_back(0xAC);
+    //Enabe desired outputs
+    pkt.outBuffer.push_back(3);
+    pkt.outBuffer.push_back(m_newConfiguration[3]);
+
+	if( !device->IsOpen() )
+	{   
+        return FAILED;
+	}        
+    LMScomms::TransferStatus status;
+    status = device->TransferPacket(pkt);
+    if (status != LMScomms::TRANSFER_SUCCESS || pkt.status != STATUS_COMPLETED_CMD)
+    {
+        return FAILED;
+    }
+    return SUCCESS;
+}
+
+// ---------------------------------------------------------------------------
+/**
+    @brief Sets connection manager to use for data transferring Si5351C
+    @param mng connection manager for data transferring
+*/
+void Si5351C::Initialize(LMScomms *mng)
+{
+    assert(mng != nullptr);
+	device = mng;	
+}
+
+/**
+    @brief Loads register values for Si5356A from file
+    @param FName input filename
+*/
+bool Si5351C::LoadRegValuesFromFile(string FName)
+{
+    fstream fin;
+    fin.open(FName.c_str(), ios::in);
+
+    const int len = 1024;
+    char line[len];
+
+    int addr;
+    int value;
+
+    while(!fin.eof())
+    {
+        fin.getline(line, len);
+        if( line[0] == '#')
+            continue;
+        if( strcmp(line, "#END_PROFILE") == 0)
+            break;
+        sscanf(line, "%i,%x",&addr,&value);
+        m_newConfiguration[addr] = value;
+    }
+
+    fin.close();
+	return false;
+};
+
+/** @brief Calculates multisynth dividers and VCO frequencies
+    @param clocks output clocks configuration
+    @param plls plls configurations
+    @param Fmin lowest VCO frequency
+    @param Fmax highest VCO frequency
+*/
+void Si5351C::FindVCO(Si5351_Channel *clocks, Si5351_PLL *plls, const unsigned long Fmin, const unsigned long Fmax)
+{
+    int clockCount = 8;
+    //reset output parameters
+    for(int i=0; i<clockCount; i++)
+    {
+        clocks[i].pllSource = 0;
+        clocks[i].int_mode = 0;
+        clocks[i].multisynthDivider = 8;
+    }
+
+    bool clk6satisfied = !clocks[6].powered;
+    bool clk7satisfied = !clocks[7].powered;
+
+    bool pllAused = false;
+    bool pllBused = false;
+
+    map< unsigned long, int> availableFrequenciesPLLA; //all available frequencies for VCO
+    map< unsigned long, int> availableFrequenciesPLLB; //all available frequencies for VCO
+
+    //if clk6 or clk7 is used make available frequencies according to them
+    if(clocks[6].powered || clocks[7].powered)
+    {
+        set<unsigned long> clk6freqs;
+        set<unsigned long> clk7freqs;
+        set<unsigned long> sharedFreqs;
+        unsigned int mult = 6;
+        if(!clk6satisfied)
+        {
+            unsigned long freq = clocks[6].outputFreqHz;
+            while(freq <= Fmax && mult <= 254)
+            {
+                freq = clocks[6].outputFreqHz*mult;
+                if(freq >= Fmin && freq <= Fmax)
+                {
+                    clk6freqs.insert(freq);
+                }
+                mult += 2;
+            }
+        }
+        mult = 6;
+        if(!clk7satisfied)
+        {
+            unsigned long freq = clocks[7].outputFreqHz;
+            while(freq <= Fmax && mult <= 254)
+            {
+                freq = clocks[7].outputFreqHz*mult;
+                if(freq >= Fmin && freq <= Fmax)
+                {
+                    clk7freqs.insert(freq);
+                }
+                mult += 2;
+            }
+        }
+        bool canShare = false;
+        //find if clk6 and clk7 can share the same pll
+        for (set<unsigned long>::iterator it6=clk6freqs.begin(); it6!=clk6freqs.end(); ++it6)
+        {
+            for (set<unsigned long>::iterator it7=clk7freqs.begin(); it7!=clk7freqs.end(); ++it7)
+            {
+                if(*it6 == *it7)
+                {
+                    canShare = true;
+                    sharedFreqs.insert(*it6);
+                }
+            }
+        }
+        if(canShare) //assign PLLA for both clocks
+        {
+            clocks[6].pllSource = 0;
+            clocks[7].pllSource = 0;
+            pllAused = true;
+            for (set<unsigned long>::iterator it=sharedFreqs.begin(); it!=sharedFreqs.end(); ++it)
+            {
+                availableFrequenciesPLLA.insert( pair<unsigned long, int> (*it, 0) );
+            }
+            clk6satisfied = true;
+            clk7satisfied = true;
+        }
+        else //if clocks 6 and 7 can't share pll, assign pllA to clk6 and pllB to clk7
+        {
+            if(!clk6satisfied)
+            {
+                clocks[6].pllSource = 0;
+                clk6satisfied = true;
+                pllAused = true;
+                for (set<unsigned long>::iterator it6=clk6freqs.begin(); it6!=clk6freqs.end(); ++it6)
+                {
+                    availableFrequenciesPLLA.insert( pair<unsigned long, int>(*it6, 0) );
+                }
+            }
+            if(!clk7satisfied)
+            {
+                clocks[7].pllSource = 1;
+                clk7satisfied = true;
+                pllBused = true;
+                for (set<unsigned long>::iterator it7=clk7freqs.begin(); it7!=clk7freqs.end(); ++it7)
+                {
+                    availableFrequenciesPLLB.insert( pair<unsigned long, int> (*it7, 0) );
+                }
+            }
+        }
+    }
+
+    //PLLA stage, find  all clocks that have integer coefficients with PLLA
+    //if pllA is not used by clk6 or clk7, fill available frequencies according to clk1-clk5 clocks
+    if( availableFrequenciesPLLA.size() == 0 && !pllAused)
+    {
+        for(int i=0; i<6; ++i)
+        {
+            unsigned long freq = clocks[i].outputFreqHz > Fmin ? clocks[i].outputFreqHz : (clocks[i].outputFreqHz*((Fmin/clocks[i].outputFreqHz) + ((Fmin%clocks[i].outputFreqHz)!=0)));
+            while(freq >= Fmin && freq <= Fmax)
+            {
+                //add all output frequency multiples that are in VCO interval
+                availableFrequenciesPLLA.insert( pair<unsigned long, int> (freq, 0));
+                freq += clocks[i].outputFreqHz;
+            }
+        }
+    }
+
+    unsigned int bestScore = 0; //score shows how many outputs have integer dividers
+    //calculate scores for all available frequencies
+    unsigned long bestVCOA = 0;
+    for (map<unsigned long, int>::iterator it=availableFrequenciesPLLA.begin(); it!=availableFrequenciesPLLA.end(); ++it)
+    {
+        for(int i=0; i<8; ++i)
+        {
+            if(clocks[i].outputFreqHz == 0 || !clocks[i].powered)
+                continue;
+
+            if( (it->first % clocks[i].outputFreqHz) == 0)
+            {
+                it->second = it->second+1;
+            }
+        }
+        if(it->second >= bestScore)
+        {
+            bestScore = it->second;
+            bestVCOA = it->first;
+        }
+    }
+    //scores calculated
+    //cout << "PLLA stage: " << endl;
+    //cout << "best score: " << bestScore << "     best VCO: " << bestVCOA << endl;
+    plls[0].VCO_Hz = bestVCOA;
+    plls[0].feedbackDivider = (double)bestVCOA/plls[0].inputFreqHz;
+
+    for(int i=0; i<clockCount; ++i)
+    {
+        if(clocks[i].outputFreqHz == 0 || !clocks[i].powered)
+            continue;
+
+        clocks[i].multisynthDivider = bestVCOA/clocks[i].outputFreqHz;
+        if(bestVCOA%clocks[i].outputFreqHz == 0)
+        {
+            clocks[i].int_mode = true;
+            clocks[i].multisynthDivider = bestVCOA/clocks[i].outputFreqHz;
+        }
+        else
+        {
+            clocks[i].int_mode = false;
+            clocks[i].multisynthDivider = (double)bestVCOA/clocks[i].outputFreqHz;
+        }
+        clocks[i].pllSource = 0;
+    }
+
+
+    //PLLB stage, find  all clocks that have integer coefficients with PLLB
+    //if pllB is not used by clk6 or clk7, fill available frequencies according to clk1-clk5 clocks, that don't have integer dividers
+    if( availableFrequenciesPLLB.size() == 0 && !pllBused)
+    {
+        for(int i=0; i<6; ++i)
+        {
+            if(clocks[i].outputFreqHz == 0 || !clocks[i].powered)
+                continue;
+
+            if(clocks[i].int_mode) //skip clocks with integer dividers
+                continue;
+            unsigned long freq = clocks[i].outputFreqHz > Fmin ? clocks[i].outputFreqHz : (clocks[i].outputFreqHz*((Fmin/clocks[i].outputFreqHz) + ((Fmin%clocks[i].outputFreqHz)!=0)));
+            while(freq >= Fmin && freq <= Fmax)
+            {
+                availableFrequenciesPLLB.insert( pair<unsigned long, int> (freq, 0));
+                freq += clocks[i].outputFreqHz;
+            }
+        }
+    }
+
+    bestScore = 0;
+    //calculate scores for all available frequencies
+    unsigned long bestVCOB = 0;
+    for (map<unsigned long, int>::iterator it=availableFrequenciesPLLB.begin(); it!=availableFrequenciesPLLB.end(); ++it)
+    {
+        for(int i=0; i<8; ++i)
+        {
+            if(clocks[i].outputFreqHz == 0 || !clocks[i].powered)
+                continue;
+
+            if( (it->first % clocks[i].outputFreqHz) == 0)
+            {
+                it->second = it->second+1;
+            }
+        }
+        if(it->second >= bestScore)
+        {
+            bestScore = it->second;
+            bestVCOB = it->first;
+        }
+    }
+    //scores calculated
+//    cout << "PLLB stage: " << endl;
+//    cout << "best score: " << bestScore << "     best VCO: " << bestVCOB << endl;
+    if(bestVCOB == 0) //just in case if pllb is not used make it the same frequency as plla
+        bestVCOB = bestVCOA;
+    plls[1].VCO_Hz = bestVCOB;
+    plls[1].feedbackDivider = (double)bestVCOB/plls[0].inputFreqHz;
+    for(int i=0; i<clockCount; ++i)
+    {
+        if(clocks[i].outputFreqHz == 0 || !clocks[i].powered)
+                continue;
+
+        if(clocks[i].int_mode)
+            continue;
+        clocks[i].multisynthDivider = bestVCOB/clocks[i].outputFreqHz;
+        if(bestVCOB%clocks[i].outputFreqHz == 0)
+        {
+            clocks[i].int_mode = true;
+            clocks[i].multisynthDivider = bestVCOB/clocks[i].outputFreqHz;
+        }
+        else
+        {
+            clocks[i].int_mode = false;
+            clocks[i].multisynthDivider = (double)bestVCOB/clocks[i].outputFreqHz;
+        }
+        clocks[i].pllSource = 1;
+    }
+}
+
+
+/** @brief Modifies register map with clock settings
+    @return true if success
+*/
+Si5351C::Status Si5351C::ConfigureClocks()
+{
+    FindVCO(CLK, PLL, 600000000, 900000000);
+    stringstream ss;
+    int addr;
+    m_newConfiguration[3] = 0;    
+    for(int i=0; i<8; ++i)
+    {
+        m_newConfiguration[3] |= (!CLK[i].powered) << i; //enabled
+        m_newConfiguration[16+i] = 0;
+        m_newConfiguration[16+i] |= !CLK[i].powered << 7; // powered
+
+        if(CLK[i].int_mode)
+        {
+            m_newConfiguration[16+i] |= 1 << 6; //integer mode
+        }
+        else
+            m_newConfiguration[16+i] |= 0 << 6;
+
+        m_newConfiguration[16+i] |= CLK[i].pllSource << 5; //PLL source
+        m_newConfiguration[16+i] |= CLK[i].inverted << 4; // invert
+        m_newConfiguration[16+i] |= 3 << 2;
+        m_newConfiguration[16+i] |= 3;
+
+        addr = 42+i*8;
+        ss.clear();
+        ss.str( string() );
+        ss << "CLK" << i << " fOut = " << CLK[i].outputFreqHz/1000000.0 << " MHz";
+        int DivA;
+        int DivB;
+        int DivC;
+
+        realToFrac(CLK[i].multisynthDivider, DivA, DivB, DivC);
+        ss << "  Multisynth Divider " << DivA << " " << DivB << "/" << DivC;
+        ss << "  R divider = " << CLK[i].outputDivider << " source = " << (CLK[i].pllSource == 0 ? "PLLA" : "PLLB") << endl;
+
+        Log(ss.str(), LOG_INFO);
+
+        if( CLK[i].multisynthDivider < 8 || 900 < CLK[i].multisynthDivider)
+        {
+            Log("Si5351C - Output multisynth divider is outside [8;900] interval.\n", LOG_ERROR);
+            return FAILED;
+        }
+
+        if(i<6)
+        {
+            if(CLK[i].outputFreqHz <= 150000000)
+            {
+                unsigned MSX_P1 = 128 * DivA + floor(128 * ( (float)DivB/DivC)) - 512;
+                unsigned MSX_P2 = 128 * DivB - DivC * floor( 128 * DivB/DivC );
+                unsigned MSX_P3 = DivC;
+
+                m_newConfiguration[addr] = MSX_P3 >> 8;
+                m_newConfiguration[addr+1] = MSX_P3;
+
+                m_newConfiguration[addr+2] = 0;
+                m_newConfiguration[addr+2] |= (MSX_P1 >> 16 ) & 0x03;
+                m_newConfiguration[addr+3] = MSX_P1 >> 8;
+                m_newConfiguration[addr+4] = MSX_P1;
+
+                m_newConfiguration[addr+5] = 0;
+                m_newConfiguration[addr+5] = (MSX_P2 >> 16) & 0x0F;
+                m_newConfiguration[addr+5] |= (MSX_P3 >> 16) << 4;
+
+                m_newConfiguration[addr+6] = MSX_P2;
+                m_newConfiguration[addr+7] = MSX_P2 >> 8;
+            }
+            else if( CLK[i].outputFreqHz <= 160000000) // AVAILABLE ONLY ON 0-5 MULTISYNTHS
+            {
+                Log("Si5351C - clock configuring for more than 150 MHz not implemented\n", LOG_ERROR); 
+                return FAILED;
+            }
+        }
+        else // CLK6 and CLK7 only integer mode
+        {
+            if(CLK[i].outputFreqHz <= 150000000)
+            {
+                if(i==6)
+                {
+                    m_newConfiguration[90] = DivA;
+                    if(DivA%2 != 0)
+                    {
+                        Log("Si5351C - CLK6 multisynth divider is not even integer\n", LOG_ERROR);
+                        return FAILED;
+                    }
+                }
+                else
+                {
+                    m_newConfiguration[91] = DivA;
+                    if(DivA%2 != 0)
+                    {
+                        Log("Si5351C - CLK7 multisynth divider is not even integer\n", LOG_ERROR);
+                        return FAILED;
+                    }
+                }
+            }
+            else if( CLK[i].outputFreqHz <= 160000000) // AVAILABLE ONLY ON 0-5 MULTISYNTHS
+            {
+                Log("Si5351C - clock configuring for more than 150 MHz not implemented\n", LOG_ERROR);
+                return FAILED;
+            }
+        }
+    }
+
+    //configure pll
+    //set input clk source
+    m_newConfiguration[15] = m_newConfiguration[15] & 0xF3;
+    m_newConfiguration[15] |= (PLL[0].CLK_SRC & 1) << 2;
+    m_newConfiguration[15] |= (PLL[1].CLK_SRC & 1) << 3;
+    for(int i=0; i<2; ++i)
+    {
+        addr = 26+i*8;
+        if(PLL[i].feedbackDivider < 15 || PLL[i].feedbackDivider > 90)
+        {
+            Log("Si5351C - VCO frequency divider out of range [15:90].\n", LOG_ERROR);
+            return FAILED;
+        }
+        if( PLL[i].VCO_Hz < 600000000 || PLL[i].VCO_Hz > 900000000)
+        {
+            Log("Si5351C - Can't calculate valid VCO frequency.\n", LOG_ERROR);
+            return FAILED;
+        }
+        ss.clear();
+        ss.str(string());
+        ss << "Si5351C : VCO" << (i==0 ? "A" : "B") << " = " << PLL[i].VCO_Hz/1000000.0 << " MHz";
+
+        //calculate MSNx_P1, MSNx_P2, MSNx_P3
+        int MSNx_P1;
+        int MSNx_P2;
+        int MSNx_P3;
+
+        int DivA;
+        int DivB;
+        int DivC;
+        realToFrac(PLL[i].feedbackDivider, DivA, DivB, DivC);
+        ss << "  Feedback Divider " << DivA << " " << DivB << "/" << DivC << endl;
+        Log(ss.str(), LOG_INFO);
+
+        MSNx_P1 = 128 * DivA + floor(128 * ( (float)DivB/DivC)) - 512;
+        MSNx_P2 = 128 * DivB - DivC * floor( 128 * DivB/DivC );
+        MSNx_P3 = DivC;
+
+        m_newConfiguration[addr+4] = MSNx_P1;
+        m_newConfiguration[addr+3] = MSNx_P1 >> 8;
+        m_newConfiguration[addr+2] = MSNx_P1 >> 16;
+
+        m_newConfiguration[addr+7] = MSNx_P2;
+        m_newConfiguration[addr+6] = MSNx_P2 >> 8;
+        m_newConfiguration[addr+5] = 0;
+        m_newConfiguration[addr+5] = (MSNx_P2 >> 16) & 0x0F;
+
+        m_newConfiguration[addr+5] |= (MSNx_P3 >> 16) << 4;
+        m_newConfiguration[addr+1] |= MSNx_P3;
+        m_newConfiguration[addr] |= MSNx_P3 >> 8;
+    }
+    return SUCCESS;
+}
+
+/** @brief Sets output clock parameters
+    @param id clock id 0-CLK0 1-CLK1 ...
+    @param fOut_Hz output frequency in Hz
+    @param enabled is this output powered
+    @param inverted invert clock
+*/
+void Si5351C::SetClock(unsigned char id, unsigned long fOut_Hz, bool enabled, bool inverted)
+{
+    if( id < 8)
+    {
+        if(fOut_Hz < 8000 || fOut_Hz > 160000000)
+        {
+            stringstream ss;
+            ss << "Si5351C - CLK" << (int)id << " output frequency must be between 8kHz and 160MHz. fOut_MHz = " << fOut_Hz/1000000.0 << endl;
+            Log(ss.str(), LOG_ERROR);
+            return;
+        }
+        CLK[id].powered = enabled;
+        CLK[id].inverted = inverted;
+        CLK[id].outputFreqHz = fOut_Hz;
+    }
+}
+
+/** @brief Sets PLL input frequency
+    @param id PLL id 0-PLLA 1-PLLB
+    @param CLKIN_Hz clock input in Hz
+*/
+void Si5351C::SetPLL(unsigned char id, unsigned long CLKIN_Hz, int CLK_SRC)
+{
+    if (id < 2)
+    {
+        PLL[id].inputFreqHz = CLKIN_Hz;
+        PLL[id].CLK_SRC = CLK_SRC;
+    }
+}
+
+/** @brief Resets configuration registers to default values
+*/
+void Si5351C::Reset()
+{
+    memset(m_newConfiguration, 0, 255);
+    for(unsigned int i=0; i<sizeof(m_defaultConfiguration); i+=2)
+    {
+        m_newConfiguration[m_defaultConfiguration[i]] = m_defaultConfiguration[i+1];
+    }
+}
+
+Si5351C::StatusBits Si5351C::GetStatusBits()
+{
+    StatusBits stat;
+    LMScomms::GenericPacket pkt;
+    pkt.cmd = CMD_SI5351_RD;
+    pkt.outBuffer.push_back(0);
+    pkt.outBuffer.push_back(1);        
+    LMScomms::TransferStatus status;
+    status = device->TransferPacket(pkt);
+    if (status != LMScomms::TRANSFER_SUCCESS || pkt.status != STATUS_COMPLETED_CMD)
+    {
+        return stat;
+    }
+
+    stat.sys_init = (pkt.inBuffer[0] >> 7);
+    stat.lol_b = (pkt.inBuffer[0] >> 6) & 0x1;
+    stat.lol_a = (pkt.inBuffer[0] >> 5) & 0x1;
+    stat.los = (pkt.inBuffer[0] >> 4) & 0x1;
+    stat.sys_init_stky = (pkt.inBuffer[1] >> 7);
+    stat.lol_b_stky = (pkt.inBuffer[1] >> 6) & 0x1;
+    stat.lol_a_stky = (pkt.inBuffer[1] >> 5) & 0x1;
+    stat.los_stky = (pkt.inBuffer[1] >> 4) & 0x1;
+    return stat;
+}
+
+Si5351C::Status Si5351C::ClearStatus()
+{    
+    LMScomms::GenericPacket pkt;
+    pkt.cmd = CMD_SI5351_WR;
+    pkt.outBuffer.push_back(1);
+    pkt.outBuffer.push_back(0x0);    
+    LMScomms::TransferStatus status;
+    status = device->TransferPacket(pkt);
+    if (status != LMScomms::TRANSFER_SUCCESS || pkt.status != STATUS_COMPLETED_CMD)    
+        return FAILED;
+    return SUCCESS;
+}
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/Si5351C/Si5351C.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/Si5351C/Si5351C.h
new file mode 100644
index 0000000000000000000000000000000000000000..971a2d1d69a81a86a2eb67c01fb81aa9d93af2e1
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/Si5351C/Si5351C.h
@@ -0,0 +1,100 @@
+/**
+@file	Si5351C.h
+@brief	Header for Si5351C.cpp
+@author	Lime Microsystems
+*/
+
+#ifndef SI5351C_MODULE
+#define SI5351C_MODULE
+
+#include <stdio.h>
+#include <string>
+using namespace std;
+//---------------------------------------------------------------------------
+
+enum eSi_CLOCK_INPUT
+{
+    Si_CLKIN,
+    Si_XTAL,
+    Si_CMOS
+};
+
+struct Si5351_Channel
+{
+    Si5351_Channel() : outputDivider(1), outputFreqHz(1), multisynthDivider(1), pllSource(0),
+        phaseOffset(0), powered(true), inverted(false), int_mode(false) {};
+    int outputDivider;
+    unsigned long outputFreqHz;
+    float multisynthDivider;
+    int pllSource;
+    float phaseOffset;
+    bool powered;
+    bool inverted;
+    bool int_mode;
+};
+
+struct Si5351_PLL
+{
+    Si5351_PLL() : inputFreqHz(0), VCO_Hz(0), feedbackDivider(0), CLKIN_DIV(1), CLK_SRC(1) {}
+    unsigned long inputFreqHz;
+    float VCO_Hz;
+    float feedbackDivider;
+    int CLKIN_DIV;
+    int CLK_SRC; //0-XTAL, 1-CLKIN
+};
+
+class LMScomms;
+class Si5351C
+{
+public:
+    enum Status
+    {
+        SUCCESS,
+        FAILED,
+    };
+
+    struct StatusBits
+    {
+        StatusBits() : sys_init(0), sys_init_stky(0), lol_b(0), lol_b_stky(0), lol_a(0), lol_a_stky(0), los(0), los_stky(0)
+        {
+
+        }
+        int sys_init;
+        int sys_init_stky;
+        int lol_b;
+        int lol_b_stky;
+        int lol_a;
+        int lol_a_stky;
+        int los;
+        int los_stky;
+    };
+
+    StatusBits GetStatusBits();
+    Status ClearStatus();
+
+	Si5351C();
+	~Si5351C();
+	void Initialize(LMScomms *mng);
+	bool LoadRegValuesFromFile(string FName);
+
+    void SetPLL(unsigned char id, unsigned long CLKIN_Hz, int CLK_SRC);
+    void SetClock(unsigned char id, unsigned long fOut_Hz, bool enabled = true, bool inverted = false);
+
+    Status UploadConfiguration();
+    Status ConfigureClocks();
+	void Reset();
+    
+private:
+    void FindVCO(Si5351_Channel *clocks, Si5351_PLL *plls, const unsigned long Fmin, const unsigned long Fmax);
+    LMScomms *device;
+
+    Si5351_PLL PLL[2];
+    Si5351_Channel CLK[8];
+
+	static const unsigned char m_defaultConfiguration[];
+	unsigned char m_newConfiguration[255];
+
+
+};
+
+#endif // SI5351C_MODULE
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/CMakeLists.txt b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..4613e9ce72b93fdf302268fdfc273de46b7cb780
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/CMakeLists.txt
@@ -0,0 +1,63 @@
+cmake_minimum_required(VERSION 2.8)
+set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE TYPE INTERNAL FORCE)
+project("lms7api")
+#include modules for finding FFTW and CyAPI
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
+cmake_policy(SET CMP0015 OLD)
+if(${CMAKE_MAJOR_VERSION} GREATER 2)
+	cmake_policy(SET CMP0043 NEW)
+endif()
+ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
+if(CMAKE_COMPILER_IS_GNUCXX)
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -fPIC")
+endif()
+
+# set up include-directories
+include_directories(
+  "${PROJECT_SOURCE_DIR}"
+  "${PROJECT_BINARY_DIR}"  
+  cpp-feather-ini-parser
+ )
+
+set(LMS7002M_src_files
+    LMS7002M.cpp
+	LMS7002M_parameters.cpp
+	LMS7002M_statuses.cpp
+	LMS7002M_filtersCalibration.cpp    
+	lmsComms.cpp
+	LMS7002M_RegistersMap.cpp
+)
+
+set(ENABLE_USB_CONNECTION "YES" CACHE BOOL INTERNAL)
+set(ENABLE_SPI_CONNECTION "NO" CACHE BOOL INTERNAL)
+set(CONNECTION_MANAGER_DIR connectionManager)
+set(connectionManager_src_files
+	${CONNECTION_MANAGER_DIR}/ConnectionManager.cpp
+	${CONNECTION_MANAGER_DIR}/ConnectionCOM.cpp
+	${CONNECTION_MANAGER_DIR}/ConnectionManager.h
+	${CONNECTION_MANAGER_DIR}/ConnectionCOM.h
+)
+if(ENABLE_USB_CONNECTION)
+	list(APPEND connectionManager_src_files ${CONNECTION_MANAGER_DIR}/ConnectionUSB.cpp ${CONNECTION_MANAGER_DIR}/ConnectionUSB.h)
+    add_definitions(-DENABLE_USB_CONNECTION)
+endif()
+if(ENABLE_SPI_CONNECTION)
+	list(APPEND connectionManager_src_files ${CONNECTION_MANAGER_DIR}/ConnectionSPI.cpp ${CONNECTION_MANAGER_DIR}/ConnectionSPI.h)
+    add_definitions(-DENABLE_SPI_CONNECTION)
+endif()
+
+add_library(LMS7002M STATIC ${LMS7002M_src_files} ${connectionManager_src_files})
+target_include_directories(LMS7002M PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
+
+if(WIN32 AND ENABLE_USB_CONNECTION)
+	find_package(CyAPI REQUIRED)
+	LINK_DIRECTORIES(${CYAPI_LIBRARIES})	
+	include_directories(${CYAPI_INCLUDE_DIRS})
+	set(CONNECTION_MANAGER_LIBS ${CYAPI_LIBRARIES} SetupAPI)
+	target_link_libraries(LMS7002M ${CONNECTION_MANAGER_LIBS})
+endif()
+if(UNIX AND ENABLE_USB_CONNECTION)	
+	set(CONNECTION_MANAGER_LIBS usb-1.0 -lpthread)
+	target_link_libraries(LMS7002M ${CONNECTION_MANAGER_LIBS})
+endif()
+
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..ded70e114f706d60e981f340bef0f26652a387ab
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M.cpp
@@ -0,0 +1,2612 @@
+/**
+@file LMS7002M.cpp
+@author Lime Microsystems (www.limemicro.com)
+@brief Implementation of LMS7002M transceiver configuring
+*/
+
+#include "LMS7002M.h"
+#include <stdio.h>
+#include <set>
+#include "lmsComms.h"
+#include "INI.h"
+#include <cmath>
+#include <iostream>
+#include <algorithm>
+#include "LMS7002M_RegistersMap.h"
+
+#include <chrono>
+#include <thread>
+
+float_type LMS7002M::gVCO_frequency_table[3][2] = { { 3800, 5222 }, { 4961, 6754 }, {6306, 7714} };
+float_type LMS7002M::gCGEN_VCO_frequencies[2] = {2000, 2700};
+
+///define for parameter enumeration if prefix might be needed
+#define LMS7param(id) id
+
+//module addresses needs to be sorted in ascending order
+const uint16_t LMS7002M::readOnlyRegisters[] =      { 0x002F, 0x008C, 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x0123, 0x0209, 0x020A, 0x020B, 0x040E, 0x040F };
+const uint16_t LMS7002M::readOnlyRegistersMasks[] = { 0x0000, 0x0FFF, 0x007F, 0x0000, 0x0000, 0x0000, 0x0000, 0x003F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 };
+
+/** @brief Simple logging function to print status messages
+    @param text message to print
+    @param type message type for filtering specific information
+*/
+void LMS7002M::Log(const char* text, LogType type)
+{
+    switch(type)
+    {
+    case LOG_INFO:
+        printf("%s\n", text);
+        break;
+    case LOG_WARNING:
+        printf("Warning: %s\n", text);
+        break;
+    case LOG_ERROR:
+        printf("ERROR: %s\n", text);
+        break;
+    case LOG_DATA:
+        printf("DATA: %s\n", text);
+        break;
+    }
+}
+
+LMS7002M::LMS7002M() : controlPort(NULL), mRegistersMap(new LMS7002M_RegistersMap())
+{
+    mRefClkSXR_MHz = 30.72;
+    mRefClkSXT_MHz = 30.72;
+}
+
+/** @brief Creates LMS7002M main control object, it requires LMScomms to communicate with chip
+    @param controlPort data connection for controlling LMS7002 chip registers
+*/
+LMS7002M::LMS7002M(LMScomms* controlPort) :
+    controlPort(controlPort), mRegistersMap(new LMS7002M_RegistersMap())
+{
+    mRefClkSXR_MHz = 30.72;
+    mRefClkSXT_MHz = 30.72;
+
+    //memory intervals for registers tests and calibration algorithms
+    MemorySectionAddresses[LimeLight][0] = 0x0020;
+    MemorySectionAddresses[LimeLight][1] = 0x002F;
+    MemorySectionAddresses[EN_DIR][0] = 0x0081;
+    MemorySectionAddresses[EN_DIR][1] = 0x0081;
+    MemorySectionAddresses[AFE][0] = 0x0082;
+    MemorySectionAddresses[AFE][1] = 0x0082;
+    MemorySectionAddresses[BIAS][0] = 0x0084;
+    MemorySectionAddresses[BIAS][1] = 0x0084;
+    MemorySectionAddresses[XBUF][0] = 0x0085;
+    MemorySectionAddresses[XBUF][1] = 0x0085;
+    MemorySectionAddresses[CGEN][0] = 0x0086;
+    MemorySectionAddresses[CGEN][1] = 0x008C;
+    MemorySectionAddresses[LDO][0] = 0x0092;
+    MemorySectionAddresses[LDO][1] = 0x00A7;
+    MemorySectionAddresses[BIST][0] = 0x00A8;
+    MemorySectionAddresses[BIST][1] = 0x00AC;
+    MemorySectionAddresses[CDS][0] = 0x00AD;
+    MemorySectionAddresses[CDS][1] = 0x00AE;
+    MemorySectionAddresses[TRF][0] = 0x0100;
+    MemorySectionAddresses[TRF][1] = 0x0104;
+    MemorySectionAddresses[TBB][0] = 0x0105;
+    MemorySectionAddresses[TBB][1] = 0x010A;
+    MemorySectionAddresses[RFE][0] = 0x010C;
+    MemorySectionAddresses[RFE][1] = 0x0114;
+    MemorySectionAddresses[RBB][0] = 0x0115;
+    MemorySectionAddresses[RBB][1] = 0x011A;
+    MemorySectionAddresses[SX][0] = 0x011C;
+    MemorySectionAddresses[SX][1] = 0x0124;
+    MemorySectionAddresses[TxTSP][0] = 0x0200;
+    MemorySectionAddresses[TxTSP][1] = 0x020C;
+    MemorySectionAddresses[TxNCO][0] = 0x0240;
+    MemorySectionAddresses[TxNCO][1] = 0x0261;
+    MemorySectionAddresses[TxGFIR1][0] = 0x0280;
+    MemorySectionAddresses[TxGFIR1][1] = 0x02A7;
+    MemorySectionAddresses[TxGFIR2][0] = 0x02C0;
+    MemorySectionAddresses[TxGFIR2][1] = 0x02E7;
+    MemorySectionAddresses[TxGFIR3a][0] = 0x0300;
+    MemorySectionAddresses[TxGFIR3a][1] = 0x0327;
+    MemorySectionAddresses[TxGFIR3b][0] = 0x0340;
+    MemorySectionAddresses[TxGFIR3b][1] = 0x0367;
+    MemorySectionAddresses[TxGFIR3c][0] = 0x0380;
+    MemorySectionAddresses[TxGFIR3c][1] = 0x03A7;
+    MemorySectionAddresses[RxTSP][0] = 0x0400;
+    MemorySectionAddresses[RxTSP][1] = 0x040F;
+    MemorySectionAddresses[RxNCO][0] = 0x0440;
+    MemorySectionAddresses[RxNCO][1] = 0x0461;
+    MemorySectionAddresses[RxGFIR1][0] = 0x0480;
+    MemorySectionAddresses[RxGFIR1][1] = 0x04A7;
+    MemorySectionAddresses[RxGFIR2][0] = 0x04C0;
+    MemorySectionAddresses[RxGFIR2][1] = 0x04E7;
+    MemorySectionAddresses[RxGFIR3a][0] = 0x0500;
+    MemorySectionAddresses[RxGFIR3a][1] = 0x0527;
+    MemorySectionAddresses[RxGFIR3b][0] = 0x0540;
+    MemorySectionAddresses[RxGFIR3b][1] = 0x0567;
+    MemorySectionAddresses[RxGFIR3c][0] = 0x0580;
+    MemorySectionAddresses[RxGFIR3c][1] = 0x05A7;
+
+    mRegistersMap->InitializeDefaultValues(LMS7parameterList);
+}
+
+LMS7002M::~LMS7002M()
+{
+
+}
+
+/** @brief Sends reset signal to chip, after reset enables B channel controls
+    @return 0-success, other-failure
+*/
+liblms7_status LMS7002M::ResetChip()
+{
+    if (controlPort == NULL)
+        return LIBLMS7_NO_CONNECTION_MANAGER;
+    if (controlPort->IsOpen() == false)
+        return LIBLMS7_NOT_CONNECTED;
+
+    LMScomms::GenericPacket pkt;
+    pkt.cmd = CMD_LMS7002_RST;
+    pkt.outBuffer.push_back(LMS_RST_PULSE);
+    controlPort->TransferPacket(pkt);
+    if (pkt.status == STATUS_COMPLETED_CMD)
+    {
+        Modify_SPI_Reg_bits(LMS7param(MIMO_SISO), 0); //enable B channel after reset
+        return LIBLMS7_SUCCESS;
+    }
+    else
+        return LIBLMS7_FAILURE;
+}
+
+liblms7_status LMS7002M::LoadConfigLegacyFile(const char* filename)
+{
+    ifstream f(filename);
+    if (f.good() == false) //file not found
+    {
+        f.close();
+        return LIBLMS7_FILE_NOT_FOUND;
+    }
+    f.close();
+    uint16_t addr = 0;
+    uint16_t value = 0;
+    uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC)); //remember used channel
+    liblms7_status status;
+    typedef INI<string, string, string> ini_t;
+    ini_t parser(filename, true);
+    if (parser.select("FILE INFO") == false)
+        return LIBLMS7_FILE_INVALID_FORMAT;
+
+    string type = "";
+    type = parser.get("type", "undefined");
+    stringstream ss;
+    if (type.find("LMS7002 configuration") == string::npos)
+    {
+        ss << "File " << filename << " not recognized" << endl;
+        return LIBLMS7_FILE_INVALID_FORMAT;
+    }
+
+    int fileVersion = 0;
+    fileVersion = parser.get("version", 0);
+
+    vector<uint16_t> addrToWrite;
+    vector<uint16_t> dataToWrite;
+    if (fileVersion == 1)
+    {
+        if (parser.select("Reference clocks"))
+        {
+            mRefClkSXR_MHz = parser.get("SXR reference frequency MHz", 30.72);
+            mRefClkSXT_MHz = parser.get("SXT reference frequency MHz", 30.72);
+        }
+
+        if (parser.select("LMS7002 registers ch.A") == true)
+        {
+            ini_t::sectionsit_t section = parser.sections.find("LMS7002 registers ch.A");
+
+            uint16_t x0020_value = 0;
+            Modify_SPI_Reg_bits(LMS7param(MAC), 1); //select A channel
+            for (ini_t::keysit_t pairs = section->second->begin(); pairs != section->second->end(); pairs++)
+            {
+                sscanf(pairs->first.c_str(), "%hx", &addr);
+                sscanf(pairs->second.c_str(), "%hx", &value);
+                if (addr == LMS7param(MAC).address) //skip register containing channel selection
+                {
+                    x0020_value = value;
+                    continue;
+                }
+                addrToWrite.push_back(addr);
+                dataToWrite.push_back(value);
+            }
+            status = SPI_write_batch(&addrToWrite[0], &dataToWrite[0], addrToWrite.size());
+            if (status != LIBLMS7_SUCCESS && status != LIBLMS7_NOT_CONNECTED)
+                return status;
+
+            //parse FCW or PHO
+            if (parser.select("NCO Rx ch.A") == true)
+            {
+                char varname[64];
+                int mode = Get_SPI_Reg_bits(LMS7param(MODE_RX));
+                if (mode == 0) //FCW
+                {                   
+                    for (int i = 0; i < 16; ++i)
+                    {
+                        sprintf(varname, "FCW%02i", i);
+                        SetNCOFrequency(LMS7002M::Rx, i, parser.get(varname, 0.0));
+                    }
+                }
+                else
+                {
+                    for (int i = 0; i < 16; ++i)
+                    {
+                        sprintf(varname, "PHO%02i", i);
+                        SetNCOPhaseOffset(LMS7002M::Rx, i, parser.get(varname, 0.0));
+                    }
+                }
+            }
+            if (parser.select("NCO Tx ch.A") == true)
+            {
+                char varname[64];
+                int mode = Get_SPI_Reg_bits(LMS7param(MODE_TX));
+                if (mode == 0) //FCW
+                {
+                    for (int i = 0; i < 16; ++i)
+                    {
+                        sprintf(varname, "FCW%02i", i);
+                        SetNCOFrequency(LMS7002M::Tx, i, parser.get(varname, 0.0));
+                    }
+                }
+                else
+                {
+                    for (int i = 0; i < 16; ++i)
+                    {
+                        sprintf(varname, "PHO%02i", i);
+                        SetNCOPhaseOffset(LMS7002M::Tx, i, parser.get(varname, 0.0));
+                    }
+                }
+            }
+            status = SPI_write(0x0020, x0020_value);
+            if (status != LIBLMS7_SUCCESS && status != LIBLMS7_NOT_CONNECTED)
+                return status;
+        }
+
+        Modify_SPI_Reg_bits(LMS7param(MAC), 2);
+
+        if (parser.select("LMS7002 registers ch.B") == true)
+        {
+            addrToWrite.clear();
+            dataToWrite.clear();
+            ini_t::sectionsit_t section = parser.sections.find("LMS7002 registers ch.B");
+            for (ini_t::keysit_t pairs = section->second->begin(); pairs != section->second->end(); pairs++)
+            {
+                sscanf(pairs->first.c_str(), "%hx", &addr);
+                sscanf(pairs->second.c_str(), "%hx", &value);
+                addrToWrite.push_back(addr);
+                dataToWrite.push_back(value);
+            }
+            Modify_SPI_Reg_bits(LMS7param(MAC), 2); //select B channel
+            status = SPI_write_batch(&addrToWrite[0], &dataToWrite[0], addrToWrite.size());
+            if (status != LIBLMS7_SUCCESS && status != LIBLMS7_NOT_CONNECTED)
+                return status;
+
+            //parse FCW or PHO
+            if (parser.select("NCO Rx ch.B") == true)
+            {
+                char varname[64];
+                int mode = Get_SPI_Reg_bits(LMS7param(MODE_RX));
+                if (mode == 0) //FCW
+                {
+                    for (int i = 0; i < 16; ++i)
+                    {
+                        sprintf(varname, "FCW%02i", i);
+                        SetNCOFrequency(LMS7002M::Rx, i, parser.get(varname, 0.0));
+                    }
+                }
+                else
+                {
+                    for (int i = 0; i < 16; ++i)
+                    {
+                        sprintf(varname, "PHO%02i", i);
+                        SetNCOPhaseOffset(LMS7002M::Rx, i, parser.get(varname, 0.0));
+                    }
+                }
+            }
+            if (parser.select("NCO Tx ch.A") == true)
+            {
+                char varname[64];
+                int mode = Get_SPI_Reg_bits(LMS7param(MODE_TX));
+                if (mode == 0) //FCW
+                {
+                    for (int i = 0; i < 16; ++i)
+                    {
+                        sprintf(varname, "FCW%02i", i);
+                        SetNCOFrequency(LMS7002M::Tx, i, parser.get(varname, 0.0));
+                    }
+                }
+                else
+                {
+                    for (int i = 0; i < 16; ++i)
+                    {
+                        sprintf(varname, "PHO%02i", i);
+                        SetNCOPhaseOffset(LMS7002M::Tx, i, parser.get(varname, 0.0));
+                    }
+                }
+            }
+        }
+        Modify_SPI_Reg_bits(LMS7param(MAC), ch);
+        return LIBLMS7_SUCCESS;
+    }
+    else
+        return LIBLMS7_FILE_INVALID_FORMAT;
+    return LIBLMS7_FAILURE;
+}
+
+/** @brief Reads configuration file and uploads registers to chip
+    @param filename Configuration source file
+    @return 0-success, other-failure
+*/
+liblms7_status LMS7002M::LoadConfig(const char* filename)
+{
+	ifstream f(filename);
+    if (f.good() == false) //file not found
+    {
+        f.close();
+        return LIBLMS7_FILE_NOT_FOUND;
+    }
+    f.close();
+    uint16_t addr = 0;
+    uint16_t value = 0;
+    uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC)); //remember used channel
+
+    liblms7_status status;
+    typedef INI<string, string, string> ini_t;
+    ini_t parser(filename, true);
+    if (parser.select("file_info") == false)
+    {
+        //try loading as legacy format
+        status = LoadConfigLegacyFile(filename);
+        Modify_SPI_Reg_bits(MAC, 1);
+        return status;
+    }
+    string type = "";
+    type = parser.get("type", "undefined");
+    stringstream ss;
+    if (type.find("lms7002m_minimal_config") == string::npos)
+    {
+        ss << "File " << filename << " not recognized" << endl;
+        return LIBLMS7_FILE_INVALID_FORMAT;
+    }
+
+    int fileVersion = 0;
+    fileVersion = parser.get("version", 0);
+
+    vector<uint16_t> addrToWrite;
+    vector<uint16_t> dataToWrite;
+
+    if (fileVersion == 1)
+    {
+        if(parser.select("lms7002_registers_a") == true)
+        {
+            ini_t::sectionsit_t section = parser.sections.find("lms7002_registers_a");
+
+            uint16_t x0020_value = 0;
+            Modify_SPI_Reg_bits(LMS7param(MAC), 1); //select A channel
+            for (ini_t::keysit_t pairs = section->second->begin(); pairs != section->second->end(); pairs++)
+            {
+                sscanf(pairs->first.c_str(), "%hx", &addr);
+                sscanf(pairs->second.c_str(), "%hx", &value);
+                if (addr == LMS7param(MAC).address) //skip register containing channel selection
+                {
+                    x0020_value = value;
+                    continue;
+                }
+                addrToWrite.push_back(addr);
+                dataToWrite.push_back(value);
+            }
+            status = SPI_write_batch(&addrToWrite[0], &dataToWrite[0], addrToWrite.size());
+            if (status != LIBLMS7_SUCCESS && status != LIBLMS7_NOT_CONNECTED)
+                return status;
+            status = SPI_write(0x0020, x0020_value);
+            if (status != LIBLMS7_SUCCESS && status != LIBLMS7_NOT_CONNECTED)
+                return status;
+            Modify_SPI_Reg_bits(LMS7param(MAC), 2);
+            if (status != LIBLMS7_SUCCESS && status != LIBLMS7_NOT_CONNECTED)
+                return status;
+        }
+
+        if (parser.select("lms7002_registers_b") == true)
+        {
+            addrToWrite.clear();
+            dataToWrite.clear();
+            ini_t::sectionsit_t section = parser.sections.find("lms7002_registers_b");
+            for (ini_t::keysit_t pairs = section->second->begin(); pairs != section->second->end(); pairs++)
+            {
+                sscanf(pairs->first.c_str(), "%hx", &addr);
+                sscanf(pairs->second.c_str(), "%hx", &value);
+                addrToWrite.push_back(addr);
+                dataToWrite.push_back(value);
+            }
+            Modify_SPI_Reg_bits(LMS7param(MAC), 2); //select B channel
+            status = SPI_write_batch(&addrToWrite[0], &dataToWrite[0], addrToWrite.size());
+            if (status != LIBLMS7_SUCCESS && status != LIBLMS7_NOT_CONNECTED)
+                return status;
+        }
+        Modify_SPI_Reg_bits(LMS7param(MAC), ch);
+
+        parser.select("reference_clocks");
+        mRefClkSXR_MHz = parser.get("sxr_ref_clk_mhz", 30.72);
+        mRefClkSXT_MHz = parser.get("sxt_ref_clk_mhz", 30.72);
+    }
+
+    Modify_SPI_Reg_bits(MAC, 1);
+    if (controlPort == NULL)
+        return LIBLMS7_NO_CONNECTION_MANAGER;
+    if (controlPort->IsOpen() == false)
+        return LIBLMS7_NOT_CONNECTED;
+    return LIBLMS7_SUCCESS;
+}
+
+/** @brief Reads all registers from chip and saves to file
+    @param filename destination filename
+    @return 0-success, other failure
+*/
+liblms7_status LMS7002M::SaveConfig(const char* filename)
+{
+    liblms7_status status;
+    typedef INI<> ini_t;
+    ini_t parser(filename, true);
+    parser.create("file_info");
+    parser.set("type", "lms7002m_minimal_config");
+    parser.set("version", 1);
+
+    char addr[80];
+    char value[80];
+
+    uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC));
+
+    vector<uint16_t> addrToRead;
+    for (uint8_t i = 0; i < MEMORY_SECTIONS_COUNT; ++i)
+        for (uint16_t addr = MemorySectionAddresses[i][0]; addr <= MemorySectionAddresses[i][1]; ++addr)
+            addrToRead.push_back(addr);
+    vector<uint16_t> dataReceived;
+    dataReceived.resize(addrToRead.size(), 0);
+
+    parser.create("lms7002_registers_a");
+    Modify_SPI_Reg_bits(LMS7param(MAC), 1);
+    for (uint16_t i = 0; i < addrToRead.size(); ++i)
+    {
+        dataReceived[i] = Get_SPI_Reg_bits(addrToRead[i], 15, 0, false);
+        sprintf(addr, "0x%04X", addrToRead[i]);
+        sprintf(value, "0x%04X", dataReceived[i]);
+        parser.set(addr, value);
+    }
+
+    parser.create("lms7002_registers_b");
+    addrToRead.clear(); //add only B channel addresses
+    for (uint8_t i = 0; i < MEMORY_SECTIONS_COUNT; ++i)
+        for (uint16_t addr = MemorySectionAddresses[i][0]; addr <= MemorySectionAddresses[i][1]; ++addr)
+            if (addr >= 0x0100)
+                addrToRead.push_back(addr);
+
+    Modify_SPI_Reg_bits(LMS7param(MAC), 2);
+    for (uint16_t i = 0; i < addrToRead.size(); ++i)
+    {
+        dataReceived[i] = Get_SPI_Reg_bits(addrToRead[i], 15, 0, false);
+        sprintf(addr, "0x%04X", addrToRead[i]);
+        sprintf(value, "0x%04X", dataReceived[i]);
+        parser.set(addr, value);
+    }
+
+    Modify_SPI_Reg_bits(LMS7param(MAC), ch); //retore previously used channel
+
+    parser.create("reference_clocks");
+    parser.set("sxt_ref_clk_mhz", mRefClkSXT_MHz);
+    parser.set("sxr_ref_clk_mhz", mRefClkSXR_MHz);
+    parser.save(filename);
+    return LIBLMS7_SUCCESS;
+}
+
+/**	@brief Returns reference clock in MHz used for SXT or SXR
+	@param Tx transmitter or receiver selection
+*/
+float_type LMS7002M::GetReferenceClk_SX(bool tx)
+{
+	return tx ? mRefClkSXT_MHz : mRefClkSXR_MHz;
+}
+
+/**	@return Current CLKGEN frequency in MHz
+    Returned frequency depends on reference clock used for Receiver
+*/
+float_type LMS7002M::GetFrequencyCGEN_MHz()
+{
+    float_type dMul = (mRefClkSXR_MHz/2.0)/(Get_SPI_Reg_bits(LMS7param(DIV_OUTCH_CGEN))+1); //DIV_OUTCH_CGEN
+    uint16_t gINT = Get_SPI_Reg_bits(0x0088, 13, 0); //read whole register to reduce SPI transfers
+    uint32_t gFRAC = ((gINT & 0xF) * 65536) | Get_SPI_Reg_bits(0x0087, 15, 0);
+    return dMul * (((gINT>>4) + 1 + gFRAC/1048576.0));
+}
+
+/** @brief Returns TSP reference frequency
+    @param tx TxTSP or RxTSP selection
+    @return TSP reference frequency in MHz
+*/
+float_type LMS7002M::GetReferenceClk_TSP_MHz(bool tx)
+{
+    float_type cgenFreq = GetFrequencyCGEN_MHz();
+	float_type clklfreq = cgenFreq/pow(2.0, Get_SPI_Reg_bits(LMS7param(CLKH_OV_CLKL_CGEN)));
+    if(Get_SPI_Reg_bits(LMS7param(EN_ADCCLKH_CLKGN)) == 0)
+        return tx ? clklfreq : cgenFreq/4.0;
+    else
+        return tx ? cgenFreq : clklfreq/4.0;
+}
+
+/** @brief Sets CLKGEN frequency, calculations use receiver'r reference clock
+    @param freq_MHz desired frequency in MHz
+    @return 0-succes, other-cannot deliver desired frequency
+*/
+liblms7_status LMS7002M::SetFrequencyCGEN(const float_type freq_MHz)
+{
+    float_type dFvco;
+    float_type dFrac;
+    int16_t iHdiv;
+
+    //VCO frequency selection according to F_CLKH
+    iHdiv = (int16_t)((gCGEN_VCO_frequencies[1]/ 2) / freq_MHz) - 1;
+	dFvco = 2*(iHdiv+1) * freq_MHz;
+
+    //Integer division
+    uint16_t gINT = (uint16_t)(dFvco/mRefClkSXR_MHz - 1);
+
+    //Fractional division
+    dFrac = dFvco/mRefClkSXR_MHz - (uint32_t)(dFvco/mRefClkSXR_MHz);
+    uint32_t gFRAC = (uint32_t)(dFrac * 1048576);
+
+    Modify_SPI_Reg_bits(LMS7param(INT_SDM_CGEN), gINT); //INT_SDM_CGEN
+    Modify_SPI_Reg_bits(0x0087, 15, 0, gFRAC&0xFFFF); //INT_SDM_CGEN[15:0]
+    Modify_SPI_Reg_bits(0x0088, 3, 0, gFRAC>>16); //INT_SDM_CGEN[19:16]
+    Modify_SPI_Reg_bits(LMS7param(DIV_OUTCH_CGEN), iHdiv); //DIV_OUTCH_CGEN
+
+    return TuneVCO(VCO_CGEN);
+}
+
+/** @brief Performs VCO tuning operations for CLKGEN, SXR, SXT modules
+    @param module module selection for tuning 0-cgen, 1-SXR, 2-SXT
+    @return 0-success, other-failure
+*/
+liblms7_status LMS7002M::TuneVCO(VCO_Module module) // 0-cgen, 1-SXR, 2-SXT
+{
+    if (controlPort == NULL)
+        return LIBLMS7_NO_CONNECTION_MANAGER;
+    if (controlPort->IsOpen() == false)
+        return LIBLMS7_NOT_CONNECTED;
+	int8_t i;
+	uint8_t cmphl; //comparators
+	int16_t csw_lowest = -1;
+	uint16_t addrVCOpd; // VCO power down address
+	uint16_t addrCSW_VCO;
+	uint16_t addrCMP; //comparator address
+	uint8_t lsb; //SWC lsb index
+	uint8_t msb; //SWC msb index
+
+	uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC)); //remember used channel
+
+	if(module != VCO_CGEN) //set addresses to SX module
+	{
+        Modify_SPI_Reg_bits(LMS7param(MAC), module);
+        addrVCOpd = LMS7param(PD_VCO).address;
+        addrCSW_VCO = LMS7param(CSW_VCO).address;
+        lsb = LMS7param(CSW_VCO).lsb;
+        msb = LMS7param(CSW_VCO).msb;
+        addrCMP = LMS7param(VCO_CMPHO).address;
+	}
+	else //set addresses to CGEN module
+    {
+        addrVCOpd = LMS7param(PD_VCO_CGEN).address;
+        addrCSW_VCO = LMS7param(CSW_VCO_CGEN).address;
+        lsb = LMS7param(CSW_VCO_CGEN).lsb;
+        msb = LMS7param(CSW_VCO_CGEN).msb;
+        addrCMP = LMS7param(VCO_CMPHO_CGEN).address;
+    }
+	// Initialization
+	Modify_SPI_Reg_bits (addrVCOpd, 2, 1, 0); //activate VCO and comparator
+    if (Get_SPI_Reg_bits(addrVCOpd, 2, 1) != 0)
+        return LIBLMS7_VCO_IS_POWERED_DOWN;
+	if(module == VCO_CGEN)
+        Modify_SPI_Reg_bits(LMS7param(SPDUP_VCO_CGEN), 1); //SHORT_NOISEFIL=1 SPDUP_VCO_ Short the noise filter resistor to speed up the settling time
+	else
+        Modify_SPI_Reg_bits(LMS7param(SPDUP_VCO), 1); //SHORT_NOISEFIL=1 SPDUP_VCO_ Short the noise filter resistor to speed up the settling time
+	Modify_SPI_Reg_bits (addrCSW_VCO , msb, lsb , 0); //Set SWC_VCO<7:0>=<00000000>
+
+	i=7;
+	while(i>=0)
+	{
+        Modify_SPI_Reg_bits (addrCSW_VCO, lsb + i, lsb + i, 1); // CSW_VCO<i>=1
+        std::this_thread::sleep_for(std::chrono::milliseconds(5));
+        cmphl = (uint8_t)Get_SPI_Reg_bits(addrCMP, 13, 12);
+        if ( (cmphl&0x01) == 1) // reduce CSW
+            Modify_SPI_Reg_bits (addrCSW_VCO, lsb + i, lsb + i, 0); // CSW_VCO<i>=0
+        if( cmphl == 2 && csw_lowest < 0)
+            csw_lowest = Get_SPI_Reg_bits(addrCSW_VCO, msb, lsb);
+		--i;
+	}
+	if(csw_lowest >= 0)
+    {
+        uint16_t csw_highest = Get_SPI_Reg_bits(addrCSW_VCO, msb, lsb);
+        if(csw_lowest == csw_highest)
+        {
+            while(csw_lowest>=0)
+            {
+                Modify_SPI_Reg_bits(addrCSW_VCO, msb, lsb, csw_lowest);
+                std::this_thread::sleep_for(std::chrono::milliseconds(5));
+                if(Get_SPI_Reg_bits(addrCMP, 13, 12) == 0)
+                {
+                    ++csw_lowest;
+                    break;
+                }
+                else
+                    --csw_lowest;
+            }
+        }
+        Modify_SPI_Reg_bits(addrCSW_VCO, msb, lsb, csw_lowest+(csw_highest-csw_lowest)/2);
+    }
+    if (module == VCO_CGEN)
+        Modify_SPI_Reg_bits(LMS7param(SPDUP_VCO_CGEN), 0); //SHORT_NOISEFIL=1 SPDUP_VCO_ Short the noise filter resistor to speed up the settling time
+    else
+        Modify_SPI_Reg_bits(LMS7param(SPDUP_VCO), 0); //SHORT_NOISEFIL=1 SPDUP_VCO_ Short the noise filter resistor to speed up the settling time
+	cmphl = (uint8_t)Get_SPI_Reg_bits(addrCMP, 13, 12);
+    Modify_SPI_Reg_bits(LMS7param(MAC), ch); //restore previously used channel
+	if(cmphl == 2)
+        return LIBLMS7_SUCCESS;
+    else
+        return LIBLMS7_FAILURE;
+}
+
+/** @brief Returns given parameter value from chip register
+    @param param LMS7002M control parameter
+    @param fromChip read directly from chip
+    @return parameter value
+*/
+uint16_t LMS7002M::Get_SPI_Reg_bits(const LMS7Parameter &param, bool fromChip)
+{
+	return Get_SPI_Reg_bits(param.address, param.msb, param.lsb, fromChip);
+}
+
+/** @brief Returns given parameter value from chip register
+    @param address register address
+    @param msb most significant bit index
+    @param lsb least significant bit index
+    @param fromChip read directly from chip
+    @return register bits from selected interval, shifted to right by lsb bits
+*/
+uint16_t LMS7002M::Get_SPI_Reg_bits(uint16_t address, uint8_t msb, uint8_t lsb, bool fromChip)
+{
+    return (SPI_read(address, fromChip) & (~(~0<<(msb+1)))) >> lsb; //shift bits to LSB
+}
+
+/** @brief Change given parameter value
+    @param param LMS7002M control parameter
+    @param fromChip read initial value directly from chip
+    @param value new parameter value
+*/
+liblms7_status LMS7002M::Modify_SPI_Reg_bits(const LMS7Parameter &param, const uint16_t value, bool fromChip)
+{
+    return Modify_SPI_Reg_bits(param.address, param.msb, param.lsb, value, fromChip);
+}
+
+/** @brief Change given parameter value
+    @param address register address
+    @param value new bits value, the value is shifted left by lsb bits
+    @param fromChip read initial value directly from chip
+*/
+liblms7_status LMS7002M::Modify_SPI_Reg_bits(const uint16_t address, const uint8_t msb, const uint8_t lsb, const uint16_t value, bool fromChip)
+{
+    uint16_t spiDataReg = SPI_read(address, fromChip); //read current SPI reg data
+    uint16_t spiMask = (~(~0 << (msb - lsb + 1))) << (lsb); // creates bit mask
+    spiDataReg = (spiDataReg & (~spiMask)) | ((value << lsb) & spiMask);//clear bits
+    return SPI_write(address, spiDataReg); //write modified data back to SPI reg
+}
+
+/** @brief Modifies given registers with values applied using masks
+    @param addr array of register addresses
+    @param masks array of applied masks
+    @param values array of values to be written
+    @param start starting index of given arrays
+    @param stop end index of given arrays
+*/
+liblms7_status LMS7002M::Modify_SPI_Reg_mask(const uint16_t *addr, const uint16_t *masks, const uint16_t *values, uint8_t start, uint8_t stop)
+{
+    liblms7_status status;
+    uint16_t reg_data;
+    vector<uint16_t> addresses;
+    vector<uint16_t> data;
+    while (start <= stop)
+    {
+        reg_data = SPI_read(addr[start], true, &status); //read current SPI reg data
+        reg_data &= ~masks[start];//clear bits
+        reg_data |= (values[start] & masks[start]);
+        addresses.push_back(addr[start]);
+        data.push_back(reg_data);
+        ++start;
+    }
+    if (status != LIBLMS7_SUCCESS)
+        return status;
+    SPI_write_batch(&addresses[0], &data[0], addresses.size());
+    return status;
+}
+
+/** @brief Sets SX frequency
+    @param Tx Rx/Tx module selection
+    @param freq_MHz desired frequency in MHz
+	@param refClk_MHz reference clock in MHz
+    @return 0-success, other-cannot deliver requested frequency
+*/
+liblms7_status LMS7002M::SetFrequencySX(bool tx, float_type freq_MHz, float_type refClk_MHz)
+{
+	if (controlPort == NULL)
+        return LIBLMS7_NO_CONNECTION_MANAGER;
+    if (controlPort->IsOpen() == false)
+        return LIBLMS7_NOT_CONNECTED;
+    const uint8_t sxVCO_N = 2; //number of entries in VCO frequencies
+    const float_type m_dThrF = 5500; //threshold to enable additional divider
+    uint8_t ch; //remember used channel
+    float_type VCOfreq;
+    int8_t div_loch;
+    int8_t sel_vco;
+    bool canDeliverFrequency = false;
+    uint16_t integerPart;
+    uint32_t fractionalPart;
+    int8_t i;
+
+    //find required VCO frequency
+    for (div_loch = 6; div_loch >= 0; --div_loch)
+    {
+        VCOfreq = (1 << (div_loch + 1)) * freq_MHz;
+        if ((VCOfreq >= gVCO_frequency_table[0][0]) && (VCOfreq <= gVCO_frequency_table[2][sxVCO_N - 1]))
+        {
+            canDeliverFrequency = true;
+            break;
+        }
+    }
+    if (canDeliverFrequency == false)
+        return LIBLMS7_CANNOT_DELIVER_FREQUENCY;
+
+    integerPart = (uint16_t)(VCOfreq / (refClk_MHz * (1 + (VCOfreq > m_dThrF))) - 4);
+    fractionalPart = (uint32_t)((VCOfreq / (refClk_MHz * (1 + (VCOfreq > m_dThrF))) - (uint32_t)(VCOfreq / (refClk_MHz * (1 + (VCOfreq > m_dThrF))))) * 1048576);
+
+    ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC));
+    Modify_SPI_Reg_bits(LMS7param(MAC), tx + 1);
+    Modify_SPI_Reg_bits(LMS7param(INT_SDM), integerPart); //INT_SDM
+    Modify_SPI_Reg_bits(0x011D, 15, 0, fractionalPart & 0xFFFF); //FRAC_SDM[15:0]
+    Modify_SPI_Reg_bits(0x011E, 3, 0, (fractionalPart >> 16)); //FRAC_SDM[19:16]
+    Modify_SPI_Reg_bits(LMS7param(DIV_LOCH), div_loch); //DIV_LOCH
+    Modify_SPI_Reg_bits(LMS7param(EN_DIV2_DIVPROG), (VCOfreq > m_dThrF)); //EN_DIV2_DIVPROG
+
+    //find which VCO supports required frequency
+    Modify_SPI_Reg_bits(LMS7param(PD_VCO), 0); //
+    Modify_SPI_Reg_bits(LMS7param(PD_VCO_COMP), 0); //
+    int cswBackup = Get_SPI_Reg_bits(LMS7param(CSW_VCO)); //remember to restore previous tune value
+    canDeliverFrequency = false;
+    int tuneScore[] = { -128, -128, -128 }; //best is closest to 0
+    for (sel_vco = 0; sel_vco < 3; ++sel_vco)
+    {
+        Modify_SPI_Reg_bits(LMS7param(SEL_VCO), sel_vco);
+        liblms7_status status = TuneVCO(tx ? VCO_SXT : VCO_SXR);
+        int csw = Get_SPI_Reg_bits(LMS7param(CSW_VCO), true);
+        tuneScore[sel_vco] = -128 + csw;
+        if (status == LIBLMS7_SUCCESS)
+            canDeliverFrequency = true;
+    }
+    if (abs(tuneScore[0]) < abs(tuneScore[1]))
+    {   
+        if (abs(tuneScore[0]) < abs(tuneScore[2]))
+            sel_vco = 0;
+        else
+            sel_vco = 2;
+    }
+    else
+    {
+        if (abs(tuneScore[1]) < abs(tuneScore[2]))
+            sel_vco = 1;
+        else
+            sel_vco = 2;
+    }
+    Modify_SPI_Reg_bits(LMS7param(SEL_VCO), sel_vco);
+    Modify_SPI_Reg_bits(LMS7param(CSW_VCO), cswBackup);
+    Modify_SPI_Reg_bits(LMS7param(MAC), ch); //restore used channel
+    if (tx)
+        mRefClkSXT_MHz = refClk_MHz;
+    else
+        mRefClkSXR_MHz = refClk_MHz;
+    if (canDeliverFrequency == false)
+        return LIBLMS7_CANNOT_DELIVER_FREQUENCY;
+    return TuneVCO( tx ? VCO_SXT : VCO_SXR); //Rx-1, Tx-2
+}
+
+/**	@brief Returns currently set SXR/SXT frequency
+	@return SX frequency MHz
+*/
+float_type LMS7002M::GetFrequencySX_MHz(bool Tx, float_type refClk_MHz)
+{
+    uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC)); //remember previously used channel
+	float_type dMul;
+	if(Tx)
+        Modify_SPI_Reg_bits(LMS7param(MAC), 2); // Rx mac = 1, Tx max = 2
+	else
+        Modify_SPI_Reg_bits(LMS7param(MAC), 1); // Rx mac = 1, Tx max = 2
+	uint16_t gINT = Get_SPI_Reg_bits(0x011E, 13, 0);	// read whole register to reduce SPI transfers
+    uint32_t gFRAC = ((gINT&0xF) * 65536) | Get_SPI_Reg_bits(0x011D, 15, 0);
+
+    dMul = (float_type)refClk_MHz / (1 << (Get_SPI_Reg_bits(LMS7param(DIV_LOCH)) + 1));
+    //Calculate real frequency according to the calculated parameters
+    dMul = dMul * ((gINT >> 4) + 4 + (float_type)gFRAC / 1048576.0) * (Get_SPI_Reg_bits(LMS7param(EN_DIV2_DIVPROG)) + 1);
+    Modify_SPI_Reg_bits(LMS7param(MAC), ch); //restore used channel
+	return dMul;
+}
+
+/** @brief Loads given DC_REG values into registers
+    @param tx TxTSP or RxTSP selection
+    @param I DC_REG I value
+    @param Q DC_REG Q value
+*/
+liblms7_status LMS7002M::LoadDC_REG_IQ(bool tx, int16_t I, int16_t Q)
+{
+    if(tx)
+    {
+        Modify_SPI_Reg_bits(LMS7param(DC_REG_TXTSP), I);
+        Modify_SPI_Reg_bits(LMS7param(TSGDCLDI_TXTSP), 0);
+        Modify_SPI_Reg_bits(LMS7param(TSGDCLDI_TXTSP), 1);
+        Modify_SPI_Reg_bits(LMS7param(TSGDCLDI_TXTSP), 0);
+        Modify_SPI_Reg_bits(LMS7param(DC_REG_TXTSP), Q);
+        Modify_SPI_Reg_bits(LMS7param(TSGDCLDQ_TXTSP), 0);
+        Modify_SPI_Reg_bits(LMS7param(TSGDCLDQ_TXTSP), 1);
+        Modify_SPI_Reg_bits(LMS7param(TSGDCLDQ_TXTSP), 0);
+        Modify_SPI_Reg_bits(LMS7param(DC_BYP_TXTSP), 0); //DC_BYP
+    }
+    else
+    {
+        Modify_SPI_Reg_bits(LMS7param(DC_REG_RXTSP), I);
+        Modify_SPI_Reg_bits(LMS7param(TSGDCLDI_RXTSP), 0);
+        Modify_SPI_Reg_bits(LMS7param(TSGDCLDI_RXTSP), 1);
+        Modify_SPI_Reg_bits(LMS7param(TSGDCLDI_RXTSP), 0);
+        Modify_SPI_Reg_bits(LMS7param(DC_REG_TXTSP), Q);
+        Modify_SPI_Reg_bits(LMS7param(TSGDCLDQ_RXTSP), 0);
+        Modify_SPI_Reg_bits(LMS7param(TSGDCLDQ_RXTSP), 1);
+        Modify_SPI_Reg_bits(LMS7param(TSGDCLDQ_RXTSP), 0);
+        Modify_SPI_Reg_bits(LMS7param(DC_BYP_RXTSP), 0); //DC_BYP
+    }
+    return LIBLMS7_SUCCESS;
+}
+
+/** @brief Sets chosen NCO's frequency
+    @param tx transmitter or receiver selection
+    @param index NCO index from 0 to 15
+    @param freq_MHz desired NCO frequency
+    @return 0-success, other-failure
+*/
+liblms7_status LMS7002M::SetNCOFrequency(bool tx, uint8_t index, float_type freq_MHz)
+{
+    if(index > 15)
+        return LIBLMS7_INDEX_OUT_OF_RANGE;
+    float_type refClk_MHz = GetReferenceClk_TSP_MHz(tx);
+    uint16_t addr = tx ? 0x0240 : 0x0440;
+	uint32_t fcw = (uint32_t)((freq_MHz/refClk_MHz)*4294967296);
+    SPI_write(addr+2+index*2, (fcw >> 16)); //NCO frequency control word register MSB part.
+    SPI_write(addr+3+index*2, fcw); //NCO frequency control word register LSB part.
+    return LIBLMS7_SUCCESS;
+}
+
+/** @brief Returns chosen NCO's frequency in MHz
+    @param tx transmitter or receiver selection
+    @param index NCO index from 0 to 15
+    @param fromChip read frequency directly from chip or local registers
+    @return NCO frequency in MHz
+*/
+float_type LMS7002M::GetNCOFrequency_MHz(bool tx, uint8_t index, const float_type refClk_MHz, bool fromChip)
+{
+    if(index > 15)
+        return LIBLMS7_INDEX_OUT_OF_RANGE;
+    uint16_t addr = tx ? 0x0240 : 0x0440;
+    uint32_t fcw = 0;
+    fcw |= SPI_read(addr + 2 + index * 2, fromChip) << 16; //NCO frequency control word register MSB part.
+    fcw |= SPI_read(addr + 3 + index * 2, fromChip); //NCO frequency control word register LSB part.
+    return refClk_MHz*(fcw/4294967296.0);
+}
+
+/** @brief Sets chosen NCO phase offset angle when memory table MODE is 0
+@param tx transmitter or receiver selection
+@param angle_deg phase offset angle in degrees
+@return 0-success, other-failure
+*/
+liblms7_status LMS7002M::SetNCOPhaseOffsetForMode0(bool tx, float_type angle_deg)
+{
+    uint16_t addr = tx ? 0x0241 : 0x0441;
+    uint16_t pho = (uint16_t)(65536 * (angle_deg / 360 ));
+    SPI_write(addr, pho);
+    return LIBLMS7_SUCCESS;
+}
+
+/** @brief Sets chosen NCO's phase offset angle
+    @param tx transmitter or receiver selection
+    @param index PHO index from 0 to 15
+    @param angle_deg phase offset angle in degrees
+    @return 0-success, other-failure
+*/
+liblms7_status LMS7002M::SetNCOPhaseOffset(bool tx, uint8_t index, float_type angle_deg)
+{
+    if(index > 15)
+        return LIBLMS7_INDEX_OUT_OF_RANGE;
+    uint16_t addr = tx ? 0x0244 : 0x0444;
+	uint16_t pho = (uint16_t)(65536*(angle_deg / 360));
+    SPI_write(addr+index, pho);
+    return LIBLMS7_SUCCESS;
+}
+
+/** @brief Returns chosen NCO's phase offset angle in radians
+    @param tx transmitter or receiver selection
+    @param index PHO index from 0 to 15
+    @return phase offset angle in degrees
+*/
+float_type LMS7002M::GetNCOPhaseOffset_Deg(bool tx, uint8_t index)
+{
+    uint16_t addr = tx ? 0x0244 : 0x0444;
+    uint16_t pho = SPI_read(addr+index);
+    float_type angle = 360*pho/65536.0;
+    return angle;
+}
+
+/** @brief Uploads given FIR coefficients to chip
+    @param tx Transmitter or receiver selection
+    @param GFIR_index GIR index from 0 to 2
+    @param coef array of coefficients
+    @param coefCount number of coefficients
+    @return 0-success, other-failure
+
+    This function does not change GFIR*_L or GFIR*_N parameters, they have to be set manually
+*/
+liblms7_status LMS7002M::SetGFIRCoefficients(bool tx, uint8_t GFIR_index, const int16_t *coef, uint8_t coefCount)
+{
+    uint8_t index;
+    uint8_t coefLimit;
+    uint16_t startAddr;
+    if (GFIR_index == 0)
+        startAddr = 0x0280;
+    else if (GFIR_index == 1)
+        startAddr = 0x02C0;
+    else
+        startAddr = 0x0300;
+
+    if (tx == false)
+        startAddr += 0x0200;
+    if (GFIR_index < 2)
+        coefLimit = 40;
+    else
+        coefLimit = 120;
+    if (coefCount > coefLimit)
+        return LIBLMS7_TOO_MANY_VALUES;
+    vector<uint16_t> addresses;
+    for (index = 0; index < coefCount; ++index)
+        addresses.push_back(startAddr + index + 24 * (index / 40));
+    SPI_write_batch(&addresses[0], (uint16_t*)coef, coefCount);
+    return LIBLMS7_SUCCESS;
+}
+
+/** @brief Returns currently loaded FIR coefficients
+    @param tx Transmitter or receiver selection
+    @param GFIR_index GIR index from 0 to 2
+    @param coef array of returned coefficients
+    @param coefCount number of coefficients to read
+    @return 0-success, other-failure
+*/
+liblms7_status LMS7002M::GetGFIRCoefficients(bool tx, uint8_t GFIR_index, int16_t *coef, uint8_t coefCount)
+{
+    liblms7_status status = LIBLMS7_FAILURE;
+    uint8_t index;
+    uint8_t coefLimit;
+    uint16_t startAddr;
+    if(GFIR_index == 0)
+        startAddr = 0x0280;
+    else if (GFIR_index == 1)
+        startAddr = 0x02C0;
+    else
+        startAddr = 0x0300;
+
+    if (tx == false)
+        startAddr += 0x0200;
+    if (GFIR_index < 2)
+        coefLimit = 40;
+    else
+        coefLimit = 120;
+    if (coefCount > coefLimit)
+        return LIBLMS7_TOO_MANY_VALUES;
+
+    std::vector<uint16_t> addresses;
+    for (index = 0; index < coefCount; ++index)
+        addresses.push_back(startAddr + index + 24 * (index / 40));
+    uint16_t spiData[120];
+    memset(spiData, 0, 120 * sizeof(uint16_t));
+    if (controlPort->IsOpen())
+    {
+        status = SPI_read_batch(&addresses[0], spiData, coefCount);
+        for (index = 0; index < coefCount; ++index)
+            coef[index] = spiData[index];
+    }
+    else
+    {
+        const int channel = Get_SPI_Reg_bits(LMS7param(MAC), false) > 1 ? 1 : 0;
+        for (index = 0; index < coefCount; ++index)
+            coef[index] = mRegistersMap->GetValue(channel, addresses[index]);
+        status = LIBLMS7_SUCCESS;
+    }
+    
+    return status;
+}
+
+/** @brief Write given data value to whole register
+    @param address SPI address
+    @param data new register value
+    @return 0-succes, other-failure
+*/
+liblms7_status LMS7002M::SPI_write(uint16_t address, uint16_t data)
+{
+    if (controlPort == NULL)
+        return LIBLMS7_NO_CONNECTION_MANAGER;
+
+    if ((mRegistersMap->GetValue(0, LMS7param(MAC).address) & 0x0003) > 1 && address >= 0x0100)
+        mRegistersMap->SetValue(1, address, data);
+    else
+        mRegistersMap->SetValue(0, address, data);
+
+    if (controlPort->IsOpen() == false)
+        return LIBLMS7_NOT_CONNECTED;
+
+    LMScomms::GenericPacket pkt;
+    pkt.cmd = CMD_LMS7002_WR;
+    pkt.outBuffer.push_back(address >> 8);
+    pkt.outBuffer.push_back(address & 0xFF);
+    pkt.outBuffer.push_back(data >> 8);
+    pkt.outBuffer.push_back(data & 0xFF);
+    controlPort->TransferPacket(pkt);
+    if (pkt.status == STATUS_COMPLETED_CMD)
+        return LIBLMS7_SUCCESS;
+    else
+        return LIBLMS7_FAILURE;
+}
+
+/** @brief Reads whole register value from given address
+    @param address SPI address
+    @param status operation status(optional)
+    @param fromChip read value directly from chip
+    @return register value
+*/
+uint16_t LMS7002M::SPI_read(uint16_t address, bool fromChip, liblms7_status *status)
+{
+    if (controlPort == NULL)
+    {
+        if (status)
+            *status = LIBLMS7_NO_CONNECTION_MANAGER;
+    }
+    if (controlPort->IsOpen() == false || fromChip == false)
+    {
+        if ((mRegistersMap->GetValue(0, LMS7param(MAC).address) & 0x0003) > 1 && address >= 0x0100)
+            return mRegistersMap->GetValue(1, address);
+        else
+            return mRegistersMap->GetValue(0, address);
+    }
+
+    LMScomms::GenericPacket pkt;
+    pkt.cmd = CMD_LMS7002_RD;
+    pkt.outBuffer.push_back(address >> 8);
+    pkt.outBuffer.push_back(address & 0xFF);
+    if (controlPort->TransferPacket(pkt) == LMScomms::TRANSFER_SUCCESS)
+    {
+        if (status)
+            *status = (pkt.status == STATUS_COMPLETED_CMD ? LIBLMS7_SUCCESS : LIBLMS7_FAILURE);
+        return (pkt.inBuffer[2] << 8) | pkt.inBuffer[3];
+    }
+    else
+        return 0;
+}
+
+/** @brief Batches multiple register writes into least ammount of transactions
+    @param spiAddr spi register addresses to be written
+    @param spiData registers data to be written
+    @param cnt number of registers to write
+    @return 0-success, other-failure
+*/
+liblms7_status LMS7002M::SPI_write_batch(const uint16_t* spiAddr, const uint16_t* spiData, uint16_t cnt)
+{
+    LMScomms::GenericPacket pkt;
+    pkt.cmd = CMD_LMS7002_WR;
+    uint32_t index = 0;
+    for (uint32_t i = 0; i < cnt; ++i)
+    {
+        pkt.outBuffer.push_back(spiAddr[i] >> 8);
+        pkt.outBuffer.push_back(spiAddr[i] & 0xFF);
+        pkt.outBuffer.push_back(spiData[i] >> 8);
+        pkt.outBuffer.push_back(spiData[i] & 0xFF);
+
+        if ((mRegistersMap->GetValue(0, LMS7param(MAC).address) & 0x0003) > 1)
+            mRegistersMap->SetValue(1, spiAddr[i], spiData[i]);
+        else
+            mRegistersMap->SetValue(0, spiAddr[i], spiData[i]);
+
+    }
+    if (controlPort == NULL)
+        return LIBLMS7_NO_CONNECTION_MANAGER;
+    if (controlPort->IsOpen() == false)
+        return LIBLMS7_NOT_CONNECTED;
+
+    controlPort->TransferPacket(pkt);
+    if (pkt.status == STATUS_COMPLETED_CMD)
+        return LIBLMS7_SUCCESS;
+    else
+        return LIBLMS7_FAILURE;
+}
+
+/** @brief Batches multiple register reads into least amount of transactions
+    @param spiAddr SPI addresses to read
+    @param spiData array for read data
+    @param cnt number of registers to read
+    @return 0-success, other-failure
+*/
+liblms7_status LMS7002M::SPI_read_batch(const uint16_t* spiAddr, uint16_t* spiData, uint16_t cnt)
+{
+    LMScomms::GenericPacket pkt;
+    pkt.cmd = CMD_LMS7002_RD;
+    uint32_t index = 0;
+    for (uint32_t i = 0; i < cnt; ++i)
+    {
+        pkt.outBuffer.push_back(spiAddr[i] >> 8);
+        pkt.outBuffer.push_back(spiAddr[i] & 0xFF);
+    }
+    if (controlPort == NULL)
+        return LIBLMS7_NO_CONNECTION_MANAGER;
+    if (controlPort->IsOpen() == false)
+        return LIBLMS7_NOT_CONNECTED;
+
+    LMScomms::TransferStatus status = controlPort->TransferPacket(pkt);
+    if (status != LMScomms::TRANSFER_SUCCESS)
+        return LIBLMS7_FAILURE;
+
+    for (uint32_t i = 0; i < cnt; ++i)
+    {
+        spiData[i] = (pkt.inBuffer[2*sizeof(uint16_t)*i + 2] << 8) | pkt.inBuffer[2*sizeof(uint16_t)*i + 3];
+        if ((mRegistersMap->GetValue(0, LMS7param(MAC).address) & 0x0003) > 1)
+            mRegistersMap->SetValue(1, spiAddr[i], spiData[i]);
+        else
+            mRegistersMap->SetValue(0, spiAddr[i], spiData[i]);
+    }
+    return pkt.status == STATUS_COMPLETED_CMD ? LIBLMS7_SUCCESS : LIBLMS7_FAILURE;
+    /*
+    for(int i=0; i<cnt; ++i)
+    {
+        spiData[i] = Get_SPI_Reg_bits(spiAddr[i], 15, 0);
+        if ((mRegistersMap->GetValue(0, LMS7param(MAC).address) & 0x0003) > 1)
+            mRegistersMap->SetValue(1, spiAddr[i], spiData[i]);
+        else
+            mRegistersMap->SetValue(0, spiAddr[i], spiData[i]);
+    }
+    return LIBLMS7_SUCCESS;*/
+}
+
+/** @brief Performs registers test by writing known data and confirming readback data
+    @return 0-registers test passed, other-failure
+*/
+liblms7_status LMS7002M::RegistersTest()
+{
+    char chex[16];
+    if (controlPort == NULL)
+        return LIBLMS7_NO_CONNECTION_MANAGER;
+    if (controlPort->IsOpen() == false)
+        return LIBLMS7_NOT_CONNECTED;
+
+    liblms7_status status;
+    uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC));
+
+    //backup both channel data for restoration after test
+    vector<uint16_t> ch1Addresses;
+    for (uint8_t i = 0; i < MEMORY_SECTIONS_COUNT; ++i)
+        for (uint16_t addr = MemorySectionAddresses[i][0]; addr <= MemorySectionAddresses[i][1]; ++addr)
+            ch1Addresses.push_back(addr);
+    vector<uint16_t> ch1Data;
+    ch1Data.resize(ch1Addresses.size(), 0);
+
+    //backup A channel
+    Modify_SPI_Reg_bits(LMS7param(MAC), 1);
+    status = SPI_read_batch(&ch1Addresses[0], &ch1Data[0], ch1Addresses.size());
+    if (status != LIBLMS7_SUCCESS)
+        return status;
+
+    vector<uint16_t> ch2Addresses;
+    for (uint8_t i = 0; i < MEMORY_SECTIONS_COUNT; ++i)
+        for (uint16_t addr = MemorySectionAddresses[i][0]; addr <= MemorySectionAddresses[i][1]; ++addr)
+            if (addr >= 0x0100)
+                ch2Addresses.push_back(addr);
+    vector<uint16_t> ch2Data;
+    ch2Data.resize(ch2Addresses.size(), 0);
+
+    Modify_SPI_Reg_bits(LMS7param(MAC), 2);
+    status = SPI_read_batch(&ch2Addresses[0], &ch2Data[0], ch2Addresses.size());
+    if (status != LIBLMS7_SUCCESS)
+        return status;
+
+    //test registers
+    ResetChip();
+    Modify_SPI_Reg_bits(LMS7param(MIMO_SISO), 0);
+    Modify_SPI_Reg_bits(LMS7param(PD_RX_AFE2), 0);
+    Modify_SPI_Reg_bits(LMS7param(PD_TX_AFE2), 0);
+    Modify_SPI_Reg_bits(LMS7param(MAC), 1);
+
+    stringstream ss;
+
+    //check single channel memory sections
+    vector<MemorySection> modulesToCheck = { AFE, BIAS, XBUF, CGEN, LDO, BIST, CDS, TRF, TBB, RFE, RBB, SX,
+        TxTSP, TxNCO, TxGFIR1, TxGFIR2, TxGFIR3a, TxGFIR3b, TxGFIR3c,
+        RxTSP, RxNCO, RxGFIR1, RxGFIR2, RxGFIR3a, RxGFIR3b, RxGFIR3c, LimeLight };
+    const char* moduleNames[] = { "AFE", "BIAS", "XBUF", "CGEN", "LDO", "BIST", "CDS", "TRF", "TBB", "RFE", "RBB", "SX",
+        "TxTSP", "TxNCO", "TxGFIR1", "TxGFIR2", "TxGFIR3a", "TxGFIR3b", "TxGFIR3c",
+        "RxTSP", "RxNCO", "RxGFIR1", "RxGFIR2", "RxGFIR3a", "RxGFIR3b", "RxGFIR3c", "LimeLight" };
+
+    const uint16_t patterns[] = { 0xAAAA, 0x5555 };
+    const uint8_t patternsCount = 2;
+
+    bool allTestSuccess = true;
+
+    for (unsigned i = 0; i < modulesToCheck.size(); ++i)
+    {
+        bool moduleTestsSuccess = true;
+        uint16_t startAddr = MemorySectionAddresses[modulesToCheck[i]][0];
+        uint16_t endAddr = MemorySectionAddresses[modulesToCheck[i]][1];
+        uint8_t channelCount = startAddr >= 0x0100 ? 2 : 1;
+        for (int cc = 1; cc <= channelCount; ++cc)
+        {
+            Modify_SPI_Reg_bits(LMS7param(MAC), cc);
+            sprintf(chex, "0x%04X", startAddr);
+            ss << moduleNames[i] << "  [" << chex << ":";
+            sprintf(chex, "0x%04X", endAddr);
+            ss << chex << "]";
+            if (startAddr >= 0x0100)
+                ss << " Ch." << (cc == 1 ? "A" : "B");
+                ss << endl;
+            for (uint8_t p = 0; p < patternsCount; ++p)
+                moduleTestsSuccess &= RegistersTestInterval(startAddr, endAddr, patterns[p], ss) == LIBLMS7_SUCCESS;
+        }
+        allTestSuccess &= moduleTestsSuccess;
+    }
+
+    //restore register values
+    Modify_SPI_Reg_bits(LMS7param(MAC), 1);
+    SPI_write_batch(&ch1Addresses[0], &ch1Data[0], ch1Addresses.size());
+    Modify_SPI_Reg_bits(LMS7param(MAC), 2);
+    SPI_write_batch(&ch2Addresses[0], &ch2Data[0], ch2Addresses.size());
+    Modify_SPI_Reg_bits(LMS7param(MAC), ch);
+
+    fstream fout;
+    fout.open("registersTest.txt", ios::out);
+    fout << ss.str() << endl;
+    fout.close();
+
+    return allTestSuccess ? LIBLMS7_SUCCESS : LIBLMS7_FAILURE;
+}
+
+/** @brief Performs registers test for given address interval by writing given pattern data
+    @param startAddr first register address
+    @param endAddr last reigster address
+    @param pattern data to be written into registers
+    @return 0-register test passed, other-failure
+*/
+liblms7_status LMS7002M::RegistersTestInterval(uint16_t startAddr, uint16_t endAddr, uint16_t pattern, stringstream &ss)
+{
+    vector<uint16_t> addrToWrite;
+    vector<uint16_t> dataToWrite;
+    vector<uint16_t> dataReceived;
+    vector<uint16_t> dataMasks;
+
+    for (uint16_t addr = startAddr; addr <= endAddr; ++addr)
+    {
+        addrToWrite.push_back(addr);
+    }
+    dataMasks.resize(addrToWrite.size(), 0xFFFF);
+    for (uint16_t j = 0; j < sizeof(readOnlyRegisters)/sizeof(uint16_t); ++j)
+        for (uint16_t k = 0; k < addrToWrite.size(); ++k)
+            if (readOnlyRegisters[j] == addrToWrite[k])
+            {
+                dataMasks[k] = readOnlyRegistersMasks[j];
+                break;
+            }
+
+    dataToWrite.clear();
+    dataReceived.clear();
+    for (uint16_t j = 0; j < addrToWrite.size(); ++j)
+    {
+        if (addrToWrite[j] == 0x00A6)
+            dataToWrite.push_back(0x1 | pattern & ~0x2);
+        else if (addrToWrite[j] == 0x0084)
+            dataToWrite.push_back(pattern & ~0x19);
+        else
+            dataToWrite.push_back(pattern & dataMasks[j]);
+    }
+    dataReceived.resize(addrToWrite.size(), 0);
+    liblms7_status status;
+    status = SPI_write_batch(&addrToWrite[0], &dataToWrite[0], addrToWrite.size());
+    if (status != LIBLMS7_SUCCESS)
+        return status;
+    status = SPI_read_batch(&addrToWrite[0], &dataReceived[0], addrToWrite.size());
+    if (status != LIBLMS7_SUCCESS)
+        return status;
+    bool registersMatch = true;
+    char ctemp[16];
+    for (uint16_t j = 0; j < dataToWrite.size(); ++j)
+    {
+        if (dataToWrite[j] != (dataReceived[j] & dataMasks[j]))
+        {
+            registersMatch = false;
+            sprintf(ctemp, "0x%04X", addrToWrite[j]);
+            ss << "\t" << ctemp << "(wr/rd): ";
+            sprintf(ctemp, "0x%04X", dataToWrite[j]);
+            ss << ctemp << "/";
+            sprintf(ctemp, "0x%04X", dataReceived[j]);
+            ss << ctemp << endl;
+        }
+    }
+    if (registersMatch)
+    {
+        sprintf(ctemp, "0x%04X", pattern);
+        ss << "\tRegisters OK (" << ctemp << ")\n";
+    }
+    return registersMatch ? LIBLMS7_SUCCESS : LIBLMS7_FAILURE;
+}
+
+/** @brief Parameters setup instructions for Tx calibration
+    @return 0-success, other-failure
+*/
+liblms7_status LMS7002M::CalibrateTxSetup(float_type bandwidth_MHz)
+{
+    //Stage 2
+    uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC));
+    uint8_t sel_band1_trf = (uint8_t)Get_SPI_Reg_bits(LMS7param(SEL_BAND1_TRF));
+    uint8_t sel_band2_trf = (uint8_t)Get_SPI_Reg_bits(LMS7param(SEL_BAND2_TRF));
+
+    //rfe
+    //reset RFE to defaults
+    SetDefaults(RFE);
+    if (sel_band1_trf == 1)
+        Modify_SPI_Reg_bits(LMS7param(SEL_PATH_RFE), 3); //SEL_PATH_RFE 3
+    else if (sel_band2_trf == 1)
+        Modify_SPI_Reg_bits(LMS7param(SEL_PATH_RFE), 2);
+    else
+        return LIBLMS7_BAND_NOT_SELECTED;
+
+    if (ch == 2)
+        Modify_SPI_Reg_bits(LMS7param(EN_NEXTRX_RFE), 1); // EN_NEXTTX_RFE 1
+
+    Modify_SPI_Reg_bits(LMS7param(G_RXLOOPB_RFE), 8); //G_RXLOOPB_RFE 8
+    Modify_SPI_Reg_bits(0x010C, 4, 3, 0); //PD_MXLOBUF_RFE 0, PD_QGEN_RFE 0
+    Modify_SPI_Reg_bits(LMS7param(CCOMP_TIA_RFE), 10); //CCOMP_TIA_RFE 10
+    Modify_SPI_Reg_bits(LMS7param(CFB_TIA_RFE), 2600); //CFB_TIA_RFE 2600
+    Modify_SPI_Reg_bits(LMS7param(ICT_LODC_RFE), 31); //ICT_LODC_RFE 31
+    Modify_SPI_Reg_bits(LMS7param(PD_LNA_RFE), 1);
+
+    //RBB
+    //reset RBB to defaults
+    SetDefaults(RBB);
+    Modify_SPI_Reg_bits(LMS7param(PD_LPFL_RBB), 0); //PD_LPFL_RBB 0
+    Modify_SPI_Reg_bits(LMS7param(RCC_CTL_LPFL_RBB), 0); //RCC_CTL_LPFL_RBB 0
+    Modify_SPI_Reg_bits(LMS7param(C_CTL_LPFL_RBB), 1500); //C_CTL_LPFL_RBB 1500
+    Modify_SPI_Reg_bits(LMS7param(G_PGA_RBB), 22); //G_PGA_RBB 22
+
+    //TRF
+    //reset TRF to defaults
+    //SetDefaults(TRF);
+    Modify_SPI_Reg_bits(LMS7param(L_LOOPB_TXPAD_TRF), 0); //L_LOOPB_TXPAD_TRF 0
+    Modify_SPI_Reg_bits(LMS7param(EN_LOOPB_TXPAD_TRF), 1); //EN_LOOPB_TXPAD_TRF 1
+    Modify_SPI_Reg_bits(LMS7param(EN_G_TRF), 0); //EN_G_TRF 0
+    if (ch == 2)
+        Modify_SPI_Reg_bits(LMS7param(EN_NEXTTX_TRF), 1); //EN_NEXTTX_TRF 1
+    Modify_SPI_Reg_bits(LMS7param(LOSS_LIN_TXPAD_TRF), 0); //LOSS_LIN_TXPAD_TRF 5
+    Modify_SPI_Reg_bits(LMS7param(LOSS_MAIN_TXPAD_TRF), 0); //LOSS_MAIN_TXPAD_TRF 5
+
+    //TBB
+    //reset TBB to defaults
+    /*SetDefaults(TBB);
+    Modify_SPI_Reg_bits(LMS7param(CG_IAMP_TBB), 9); //CG_IAMP_TBB 9
+    Modify_SPI_Reg_bits(LMS7param(ICT_IAMP_FRP_TBB), 1); //ICT_IAMP_FRP_TBB 1
+    Modify_SPI_Reg_bits(LMS7param(ICT_IAMP_GG_FRP_TBB), 6); //ICT_IAMP_GG_FRP_TBB 6
+    Modify_SPI_Reg_bits(LMS7param(RCAL_LPFH_TBB), 125); //RCAL_LPFH_TBB 0
+    */
+    //AFE
+    //reset AFE to defaults
+    uint8_t isel_dac_afe =(uint8_t) Get_SPI_Reg_bits(LMS7param(ISEL_DAC_AFE));
+    SetDefaults(AFE);
+    Modify_SPI_Reg_bits(LMS7param(PD_RX_AFE2), 0); //PD_RX_AFE2 0
+    Modify_SPI_Reg_bits(LMS7param(ISEL_DAC_AFE), isel_dac_afe);
+
+    if (ch == 2)
+        Modify_SPI_Reg_bits(LMS7param(PD_TX_AFE2), 0);
+    //BIAS
+    uint16_t backup = Get_SPI_Reg_bits(LMS7param(RP_CALIB_BIAS));
+    SetDefaults(BIAS);
+    Modify_SPI_Reg_bits(LMS7param(RP_CALIB_BIAS), backup); //RP_CALIB_BIAS
+
+    //XBUF
+    Modify_SPI_Reg_bits(0x0085, 2, 0, 1); //PD_XBUF_RX 0, PD_XBUF_TX 0, EN_G_XBUF 1
+
+    //CGEN
+    //reset CGEN to defaults
+    SetDefaults(CGEN);
+    //power up VCO
+    Modify_SPI_Reg_bits(LMS7param(PD_VCO_CGEN), 0);
+
+    if (SetFrequencyCGEN(122.88) != LIBLMS7_SUCCESS)
+        return LIBLMS7_FAILURE;
+    if (TuneVCO(VCO_CGEN) != LIBLMS7_SUCCESS)
+        return LIBLMS7_FAILURE;
+
+    //SXR
+    Modify_SPI_Reg_bits(LMS7param(MAC), 1);
+    SetDefaults(SX);
+    float_type SXTfreqMHz = GetFrequencySX_MHz(Tx, mRefClkSXT_MHz);
+
+    float_type SXRfreqMHz = SXTfreqMHz - bandwidth_MHz / 4 - 1;
+    if (SetFrequencySX(Rx, SXRfreqMHz, mRefClkSXR_MHz) != LIBLMS7_SUCCESS)
+        return LIBLMS7_FAILURE;
+    if (TuneVCO(VCO_SXR) != LIBLMS7_SUCCESS)
+        return LIBLMS7_FAILURE;
+
+    //SXT
+    Modify_SPI_Reg_bits(LMS7param(MAC), 2);
+    Modify_SPI_Reg_bits(LMS7param(PD_LOCH_T2RBUF), 1); //PD_LOCH_T2RBUF 1
+    if (SetFrequencySX(Tx, SXTfreqMHz, mRefClkSXT_MHz) != LIBLMS7_SUCCESS)
+        return LIBLMS7_FAILURE;
+    if (TuneVCO(VCO_SXT) != LIBLMS7_SUCCESS)
+        return LIBLMS7_FAILURE;
+    Modify_SPI_Reg_bits(LMS7param(MAC), ch);
+
+    //TXTSP
+    SetDefaults(TxTSP);
+    Modify_SPI_Reg_bits(0x0200, 3, 2, 0x3); //TSGMODE 1, INSEL 1
+    Modify_SPI_Reg_bits(0x0208, 6, 4, 0x7); //GFIR3_BYP 1, GFIR2_BYP 1, GFIR1_BYP 1
+    LoadDC_REG_IQ(Tx, (int16_t)0x7FFF, (int16_t)0x8000);
+    Modify_SPI_Reg_bits(LMS7param(MAC), ch);
+    Modify_SPI_Reg_bits(0x0440, 4, 0, 0); //TX SEL[3:0] = 0 & MODE = 0
+
+    float_type offset = 0.2;
+    if (bandwidth_MHz == 8)
+    {
+        //SXR
+        Modify_SPI_Reg_bits(LMS7param(MAC), 1);
+        SetDefaults(SX);
+        float_type SXTfreqMHz = GetFrequencySX_MHz(Tx, mRefClkSXT_MHz);
+
+        float_type sxrFreq = SXTfreqMHz - bandwidth_MHz / 4 - 1 - offset;
+        if (SetFrequencySX(Rx, sxrFreq, mRefClkSXR_MHz) != LIBLMS7_SUCCESS)
+            return LIBLMS7_FAILURE;
+        SetNCOFrequency(Tx, 0, bandwidth_MHz / 4 + offset);
+    }
+    else
+        SetNCOFrequency(Tx, 0, bandwidth_MHz / 4);
+
+    //RXTSP
+    SetDefaults(RxTSP);
+    Modify_SPI_Reg_bits(LMS7param(AGC_MODE_RXTSP), 1); //AGC_MODE 1
+    Modify_SPI_Reg_bits(0x040C, 7, 0, 0xBF);
+    Modify_SPI_Reg_bits(LMS7param(CAPSEL), 0);
+    Modify_SPI_Reg_bits(LMS7param(HBD_OVR_RXTSP), 0); //Decimation HBD ratio
+    Modify_SPI_Reg_bits(LMS7param(AGC_AVG_RXTSP), 0x7); //agc_avg iq corr
+
+    return LIBLMS7_SUCCESS;
+}
+
+/** @brief Flips the CAPTURE bit and returns digital RSSI value
+*/
+uint32_t LMS7002M::GetRSSI()
+{
+    Modify_SPI_Reg_bits(LMS7param(CAPTURE), 0);
+    Modify_SPI_Reg_bits(LMS7param(CAPTURE), 1);
+    return (Get_SPI_Reg_bits(0x040F, 15, 0) << 2) | Get_SPI_Reg_bits(0x040E, 1, 0);
+}
+
+/** @brief Sets Rx Dc offsets by converting two's complementary numbers to sign and magnitude
+*/
+void LMS7002M::SetRxDCOFF(int8_t offsetI, int8_t offsetQ)
+{
+    uint16_t valToSend = 0;
+    if (offsetI < 0)
+        valToSend |= 0x40;
+    valToSend |= labs(offsetI);
+    valToSend = valToSend << 7;
+    if (offsetQ < 0)
+        valToSend |= 0x40;
+    valToSend |= labs(offsetQ);
+    SPI_write(0x010E, valToSend);
+}
+
+/** @brief Calibrates Transmitter. DC correction, IQ gains, IQ phase correction
+    @return 0-success, other-failure
+*/
+liblms7_status LMS7002M::CalibrateTx(float_type bandwidth_MHz)
+{
+    liblms7_status status;
+    Log("Tx calibration started", LOG_INFO);
+    BackupAllRegisters();
+
+    int16_t iqcorr = 0;
+    uint16_t gcorrq = 0;
+    uint16_t gcorri = 0;
+    uint16_t dccorri;
+    uint16_t dccorrq;
+    int16_t corrI = 0;
+    int16_t corrQ = 0;
+    uint32_t minRSSI_i;
+    uint32_t minRSSI_q;
+    uint32_t minRSSI_iq;
+    int16_t i;
+    int16_t offsetI = 0;
+    int16_t offsetQ = 0;
+
+    const short firCoefs[] =
+    {
+        -2531,
+        -517,
+        2708,
+        188,
+        -3059,
+        216,
+        3569,
+        -770,
+        -4199,
+        1541,
+        4886,
+        -2577,
+        -5552,
+        3909,
+        6108,
+        -5537,
+        -6457,
+        7440,
+        6507,
+        -9566,
+        -6174,
+        11845,
+        5391,
+        -14179,
+        -4110,
+        16457,
+        2310,
+        -18561,
+        0,
+        20369,
+        -2780,
+        -21752,
+        5963,
+        22610,
+        -9456,
+        -22859,
+        13127,
+        22444,
+        -16854,
+        -21319,
+        20489,
+        19492,
+        -23883,
+        -17002,
+        26881,
+        13902,
+        -29372,
+        -10313,
+        31226,
+        6345,
+        -32380,
+        -2141,
+        32767,
+        -2141,
+        -32380,
+        6345,
+        31226,
+        -10313,
+        -29372,
+        13902,
+        26881,
+        -17002,
+        -23883,
+        19492,
+        20489,
+        -21319,
+        -16854,
+        22444,
+        13127,
+        -22859,
+        -9456,
+        22610,
+        5963,
+        -21752,
+        -2780,
+        20369,
+        0,
+        -18561,
+        2310,
+        16457,
+        -4110,
+        -14179,
+        5391,
+        11845,
+        -6174,
+        -9566,
+        6507,
+        7440,
+        -6457,
+        -5537,
+        6108,
+        3909,
+        -5552,
+        -2577,
+        4886,
+        1541,
+        -4199,
+        -770,
+        3569,
+        216,
+        -3059,
+        188,
+        2708,
+        -517,
+        -2531
+    };
+
+    uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC));
+    //Stage 1
+    uint8_t sel_band1_trf = (uint8_t)Get_SPI_Reg_bits(LMS7param(SEL_BAND1_TRF));
+    uint8_t sel_band2_trf = (uint8_t)Get_SPI_Reg_bits(LMS7param(SEL_BAND2_TRF));
+    Log("Setup stage", LOG_INFO);
+    status = CalibrateTxSetup(bandwidth_MHz);
+    if (status != LIBLMS7_SUCCESS)
+        goto TxCalibrationEnd; //go to ending stage to restore registers
+
+    //Stage 3
+    //Calibrate Rx DC
+    Log("Rx DC calibration", LOG_INFO);
+    {
+        uint16_t requiredRegs[] = { 0x0400, 0x040A, 0x010D, 0x040C };
+        uint16_t requiredMask[] = { 0x6000, 0x3007, 0x0040, 0x00FF }; //CAPSEL, AGC_MODE, AGC_AVG, EN_DCOFF, Bypasses
+        uint16_t requiredValue[] = { 0x0000, 0x1007, 0x0040, 0x00BD };
+
+        Modify_SPI_Reg_mask(requiredRegs, requiredMask, requiredValue, 0, 3);
+    }
+
+    for (i = 0; i<6; ++i)
+    {
+        FindMinRSSI(LMS7param(DCOFFI_RFE), offsetI, &offsetI, 3, 2, 32 >> i);
+        FindMinRSSI(LMS7param(DCOFFQ_RFE), offsetQ, &offsetQ, 3, 2, 32 >> i);
+    }
+    SetRxDCOFF((int8_t)offsetI, (int8_t)offsetQ);
+    Modify_SPI_Reg_bits(LMS7param(DC_BYP_RXTSP), 0); // DC_BYP 0
+
+    sel_band1_trf = (uint8_t)Get_SPI_Reg_bits(LMS7param(SEL_BAND1_TRF));
+    sel_band2_trf = (uint8_t)Get_SPI_Reg_bits(LMS7param(SEL_BAND2_TRF));
+    //B
+    Modify_SPI_Reg_bits(0x0100, 0, 0, 1); //EN_G_TRF 1
+    if (sel_band1_trf == 1)
+    {
+        Modify_SPI_Reg_bits(LMS7param(PD_RLOOPB_1_RFE), 0); //PD_RLOOPB_1_RFE 0
+        Modify_SPI_Reg_bits(LMS7param(EN_INSHSW_LB1_RFE), 0); //EN_INSHSW_LB1 0
+    }
+    if (sel_band2_trf == 1)
+    {
+        Modify_SPI_Reg_bits(LMS7param(PD_RLOOPB_2_RFE), 0); //PD_RLOOPB_2_RFE 0
+        Modify_SPI_Reg_bits(LMS7param(EN_INSHSW_LB2_RFE), 0); // EN_INSHSW_LB2 0
+    }
+    FixRXSaturation();
+
+    Modify_SPI_Reg_bits(LMS7param(GFIR3_BYP_RXTSP), 0); //GFIR3_BYP 0
+    Modify_SPI_Reg_bits(LMS7param(HBD_OVR_RXTSP), 2);
+    Modify_SPI_Reg_bits(LMS7param(GFIR3_L_RXTSP), 7);
+    Modify_SPI_Reg_bits(LMS7param(GFIR3_N_RXTSP), 7);
+
+    SetGFIRCoefficients(Rx, 2, firCoefs, sizeof(firCoefs) / sizeof(int16_t));
+
+    Log("IQ correction stage", LOG_INFO);
+    Modify_SPI_Reg_bits(LMS7param(GCORRI_TXTSP), 2047);
+    Modify_SPI_Reg_bits(LMS7param(GCORRQ_TXTSP), 2047);
+
+    Modify_SPI_Reg_bits(LMS7param(IQCORR_TXTSP), 0);
+
+    Log("I gain", LOG_INFO);
+    minRSSI_i = FindMinRSSI_Gain(LMS7param(GCORRI_TXTSP), &gcorri);
+
+    Modify_SPI_Reg_bits(LMS7param(GCORRI_TXTSP), 2047);
+    Modify_SPI_Reg_bits(LMS7param(GCORRQ_TXTSP), 2047);
+
+    Log("Q gain", LOG_INFO);
+    minRSSI_q = FindMinRSSI_Gain(LMS7param(GCORRQ_TXTSP), &gcorrq);
+
+    if (minRSSI_i < minRSSI_q)
+        gcorrq = 2047;
+    else
+        gcorri = 2047;
+
+    Modify_SPI_Reg_bits(LMS7param(GCORRI_TXTSP), gcorri);
+    Modify_SPI_Reg_bits(LMS7param(GCORRQ_TXTSP), gcorrq);
+
+    Log("Phase", LOG_INFO);
+    iqcorr = 0;
+    for (uint8_t i = 0; i<9; ++i)
+        minRSSI_iq = FindMinRSSI(LMS7param(IQCORR_TXTSP), iqcorr, &iqcorr, 3, 1, 256 >> i);
+
+    Modify_SPI_Reg_bits(LMS7param(GCORRI_TXTSP), gcorri);
+    Modify_SPI_Reg_bits(LMS7param(GCORRQ_TXTSP), gcorrq);
+    Modify_SPI_Reg_bits(LMS7param(IQCORR_TXTSP), iqcorr);
+
+    Modify_SPI_Reg_bits(LMS7param(MAC), 1);
+    status = SetFrequencySX(Rx, GetFrequencySX_MHz(Tx, mRefClkSXT_MHz)-1, mRefClkSXR_MHz);
+    if (status != LIBLMS7_SUCCESS)
+        goto TxCalibrationEnd; //go to ending stage to restore registers
+
+    //C
+    Modify_SPI_Reg_bits(LMS7param(MAC), ch);
+    Modify_SPI_Reg_bits(LMS7param(AGC_MODE_RXTSP), 1);
+    Modify_SPI_Reg_bits(LMS7param(CAPSEL), 0);
+
+    Log("TX LO calibration", LOG_INFO);
+
+    //Calibrate Tx DC
+    for (uint8_t i = 0; i<7; ++i)
+    {
+        FindMinRSSI(LMS7param(DCCORRI_TXTSP), corrI, &corrI, 3, 1, 64 >> i);
+        FindMinRSSI(LMS7param(DCCORRQ_TXTSP), corrQ, &corrQ, 3, 1, 64 >> i);
+    }
+
+    dccorri = Get_SPI_Reg_bits(LMS7param(DCCORRI_TXTSP));
+    dccorrq = Get_SPI_Reg_bits(LMS7param(DCCORRQ_TXTSP));
+
+    // Stage 4
+TxCalibrationEnd:
+    Log("Restoring registers state", LOG_INFO);
+    Modify_SPI_Reg_bits(LMS7param(MAC), ch);
+    RestoreAllRegisters();
+    if (status != LIBLMS7_SUCCESS)
+    {
+        Log("Tx calibration failed", LOG_WARNING);
+        return status;
+    }
+
+    Modify_SPI_Reg_bits(LMS7param(MAC), ch);
+    Modify_SPI_Reg_bits(LMS7param(DCCORRI_TXTSP), dccorri);
+    Modify_SPI_Reg_bits(LMS7param(DCCORRQ_TXTSP), dccorrq);
+    Modify_SPI_Reg_bits(LMS7param(GCORRI_TXTSP), gcorri);
+    Modify_SPI_Reg_bits(LMS7param(GCORRQ_TXTSP), gcorrq);
+    Modify_SPI_Reg_bits(LMS7param(IQCORR_TXTSP), iqcorr);
+
+    Modify_SPI_Reg_bits(LMS7param(DC_BYP_TXTSP), 0); //DC_BYP
+    Modify_SPI_Reg_bits(0x0208, 1, 0, 0); //GC_BYP PH_BYP
+    Log("Tx calibration finished", LOG_INFO);
+    return LIBLMS7_SUCCESS;
+}
+
+/** @brief Performs Rx DC offsets calibration
+*/
+void LMS7002M::CalibrateRxDC_RSSI()
+{
+    int16_t i;
+    int16_t offsetI = 0;
+    int16_t offsetQ = 0;
+    uint16_t requiredRegs[] = { 0x0400, 0x040A, 0x010D, 0x040C };
+    uint16_t requiredMask[] = { 0x6000, 0x3007, 0x0040, 0x00FF }; //CAPSEL, AGC_MODE, AGC_AVG, EN_DCOFF, Bypasses
+    uint16_t requiredValue[] = { 0x0000, 0x1007, 0x0040, 0x00BD };
+
+    Modify_SPI_Reg_mask(requiredRegs, requiredMask, requiredValue, 0, 3);
+    for (i = 0; i<6; ++i)
+    {
+        FindMinRSSI(LMS7param(DCOFFI_RFE), offsetI, &offsetI, 3, 2, 32 >> i);
+        FindMinRSSI(LMS7param(DCOFFQ_RFE), offsetQ, &offsetQ, 3, 2, 32 >> i);
+    }
+    Modify_SPI_Reg_bits(LMS7param(EN_DCOFF_RXFE_RFE), 1);
+    SetRxDCOFF((int8_t)offsetI, (int8_t)offsetQ);
+    Modify_SPI_Reg_bits(LMS7param(DC_BYP_RXTSP), 0); // DC_BYP 0
+}
+
+/** @brief Tries to detect and fix gains if Rx is saturated
+    @return 0-success, other-failure
+*/
+liblms7_status LMS7002M::FixRXSaturation()
+{
+    uint8_t g_rxloopb = 0;
+    Modify_SPI_Reg_bits(LMS7param(G_RXLOOPB_RFE), g_rxloopb);
+    Modify_SPI_Reg_bits(LMS7param(L_LOOPB_TXPAD_TRF), 3);
+
+    int8_t lLoopb = 3;
+    const uint32_t rssi_saturation_level = 0xD000;
+    while (g_rxloopb < 15)
+    {
+        g_rxloopb += 1;
+        Modify_SPI_Reg_bits(LMS7param(G_RXLOOPB_RFE), g_rxloopb);
+        Modify_SPI_Reg_bits(LMS7param(L_LOOPB_TXPAD_TRF), 3);
+        if (GetRSSI() < rssi_saturation_level)
+        {
+            for (lLoopb = 3; lLoopb >= 0; --lLoopb)
+            {
+                Modify_SPI_Reg_bits(LMS7param(L_LOOPB_TXPAD_TRF), lLoopb);
+                if (GetRSSI() > rssi_saturation_level)
+                {
+                    ++lLoopb;
+                    Modify_SPI_Reg_bits(LMS7param(L_LOOPB_TXPAD_TRF), lLoopb);
+                    goto finished;
+                }
+            }
+        }
+        else
+        {
+            g_rxloopb -= 1;
+            Modify_SPI_Reg_bits(LMS7param(G_RXLOOPB_RFE), g_rxloopb);
+            break;
+        }
+    }
+finished:
+    return GetRSSI() < rssi_saturation_level ? LIBLMS7_SUCCESS : LIBLMS7_FAILURE;
+}
+
+uint32_t LMS7002M::FindMinRSSI(const LMS7Parameter &param, const int16_t startValue, int16_t *result, const uint8_t scanWidth, const uint8_t twoCompl, int8_t stepMult)
+{
+    return FindMinRSSI(param.address, param.msb, param.lsb, startValue, result, scanWidth, twoCompl, stepMult);
+}
+
+/** @brief Searches for minimal RSSI value while changing given address bits
+@param addr address of parameter being changed
+@param msb most significant bit index
+@param lsb least significant bit index
+@param startValue initial value where to start search
+@param result found minimal parameter value will be set here
+@param twoCompl varying parameter value is treated as two's complement
+@return found minimal RSSI value
+*/
+uint32_t LMS7002M::FindMinRSSI(const uint16_t addr, const uint8_t msb, const uint8_t lsb, const int16_t startValue, int16_t *result, const uint8_t scanWidth, const uint8_t twoCompl, int8_t stepMult)
+{
+    if (scanWidth < 1)
+        return ~0;
+    int minI;
+    int min = startValue;
+    int globMin = 0;
+    uint32_t minRSSI = ~0;
+    unsigned int *rssiField = new unsigned int[scanWidth];
+    int minRSSIindex;
+    int i;
+    int maxVal;
+    int minVal = 0;
+    if (twoCompl)
+    {
+        maxVal = (~(~0x0 << (msb - lsb + 1))) / 2;
+        minVal = -(~(~0x0 << (msb - lsb + 1))) / 2 - 1;
+    }
+    else
+        maxVal = (~(~0x0 << (msb - lsb + 1)));
+
+    Modify_SPI_Reg_bits(addr, msb, lsb, startValue);
+
+    Modify_SPI_Reg_bits(LMS7param(AGC_MODE_RXTSP), 1);
+    Modify_SPI_Reg_bits(LMS7param(CAPSEL), 0);
+
+    minRSSIindex = 0;
+    for (i = 0; i<scanWidth; ++i)
+    {
+        short currentValue = min + (i - scanWidth / 2)*stepMult;
+        if (currentValue < minVal)
+            currentValue = minVal;
+        else if (currentValue > maxVal)
+            currentValue = maxVal;
+        if (twoCompl == 2)
+        {
+            uint16_t valToSend = 0;
+            if (currentValue < 0)
+                valToSend |= 0x40;
+            valToSend |= labs(currentValue);
+            Modify_SPI_Reg_bits(addr, msb, lsb, valToSend);
+        }
+        else
+            Modify_SPI_Reg_bits(addr, msb, lsb, currentValue);
+
+        rssiField[i] = GetRSSI();
+    }
+    minI = min;
+    minRSSIindex = 0;
+    for (i = 0; i<scanWidth; ++i)
+        if (rssiField[i] < minRSSI)
+        {
+            minRSSI = rssiField[i];
+            minRSSIindex = i;
+            minI = min + (i - scanWidth / 2)*stepMult;
+            if (minI > maxVal)
+                minI = maxVal;
+            else if (minI < minVal)
+                minI = minVal;
+            globMin = minI;
+        }
+    min = minI;
+
+    Modify_SPI_Reg_bits(addr, msb, lsb, min);
+
+    *result = min;
+    return minRSSI;
+}
+
+/** @brief Sets given module registers to default values
+    @return 0-success, other-failure
+*/
+liblms7_status LMS7002M::SetDefaults(MemorySection module)
+{
+    liblms7_status status = LIBLMS7_SUCCESS;
+    vector<uint16_t> addrs;
+    vector<uint16_t> values;
+    for(uint32_t address = MemorySectionAddresses[module][0]; address <= MemorySectionAddresses[module][1]; ++address)
+    {
+        addrs.push_back(address);
+        values.push_back(mRegistersMap->GetDefaultValue(address));
+    }
+    status = SPI_write_batch(&addrs[0], &values[0], addrs.size());
+    return status;
+}
+
+/** @brief Parameters setup instructions for Rx calibration
+    @param bandwidth_MHz filter bandwidth in MHz
+    @return 0-success, other-failure
+*/
+liblms7_status LMS7002M::CalibrateRxSetup(float_type bandwidth_MHz)
+{
+    uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC));
+
+    //rfe
+    if (ch == 2)
+        Modify_SPI_Reg_bits(LMS7param(EN_NEXTTX_TRF), 1); // EN_NEXTTX_TRF 0
+
+    Modify_SPI_Reg_bits(LMS7param(G_RXLOOPB_RFE), 15); //G_RXLOOPB_RFE 15
+    Modify_SPI_Reg_bits(0x010C, 4, 3, 0); //PD_MXLOBUF_RFE 0, PD_QGEN_RFE 0
+    Modify_SPI_Reg_bits(0x010C, 1, 1, 0); //PD_TIA 0
+    Modify_SPI_Reg_bits(0x010C, 7, 7, 1); //PD_LNA 1
+
+    Modify_SPI_Reg_bits(0x0110, 4, 0, 31); //ICT_LO_RFE 31
+    Modify_SPI_Reg_bits(0x010D, 4, 1, 0xFF); // all short switches are enabled
+
+    //RBB
+    Modify_SPI_Reg_bits(0x0115, 15, 14, 0); //Loopback switches disable
+    Modify_SPI_Reg_bits(0x0119, 15, 15, 0); //OSW_PGA 0
+
+    //TRF
+    //reset TRF to defaults
+    SetDefaults(TRF);
+    Modify_SPI_Reg_bits(LMS7param(L_LOOPB_TXPAD_TRF), 0); //L_LOOPB_TXPAD_TRF 0
+    Modify_SPI_Reg_bits(LMS7param(EN_LOOPB_TXPAD_TRF), 1); //EN_LOOPB_TXPAD_TRF 1
+    Modify_SPI_Reg_bits(LMS7param(EN_G_TRF), 0); //EN_G_TRF 0
+    if (ch == 2)
+        Modify_SPI_Reg_bits(LMS7param(EN_NEXTTX_TRF), 1); //EN_NEXTTX_TRF 1
+    Modify_SPI_Reg_bits(LMS7param(LOSS_LIN_TXPAD_TRF), 0); //LOSS_LIN_TXPAD_TRF 5
+    Modify_SPI_Reg_bits(LMS7param(LOSS_MAIN_TXPAD_TRF), 0); //LOSS_MAIN_TXPAD_TRF 5
+
+    //TBB
+    //reset TBB to defaults
+    SetDefaults(TBB);
+    Modify_SPI_Reg_bits(LMS7param(CG_IAMP_TBB), 9); //CG_IAMP_TBB 9
+    Modify_SPI_Reg_bits(LMS7param(ICT_IAMP_FRP_TBB), 1); //ICT_IAMP_FRP_TBB 1
+    Modify_SPI_Reg_bits(LMS7param(ICT_IAMP_GG_FRP_TBB), 6); //ICT_IAMP_GG_FRP_TBB 6
+
+    //AFE
+    //reset AFE to defaults
+    SetDefaults(AFE);
+    Modify_SPI_Reg_bits(LMS7param(PD_RX_AFE2), 0); //PD_RX_AFE2
+    if (ch == 2)
+    {
+        Modify_SPI_Reg_bits(LMS7param(PD_TX_AFE2), 0); //PD_TX_AFE2
+    }
+    //BIAS
+    uint16_t backup = Get_SPI_Reg_bits(0x0084, 10, 6);
+    SetDefaults(BIAS);
+    Modify_SPI_Reg_bits(0x0084, 10, 6, backup); //RP_CALIB_BIAS
+
+    //XBUF
+    Modify_SPI_Reg_bits(0x0085, 2, 0, 1); //PD_XBUF_RX 0, PD_XBUF_TX 0, EN_G_XBUF 1
+
+    //CGEN
+    //reset CGEN to defaults
+    SetDefaults(CGEN);
+    //power up VCO
+    Modify_SPI_Reg_bits(0x0086, 2, 2, 0);
+
+    liblms7_status status = SetFrequencyCGEN(122.88);
+    if (status != LIBLMS7_SUCCESS)
+        return status;
+
+    //    //SXR
+    Modify_SPI_Reg_bits(LMS7param(MAC), 1);
+    float_type SXRfreqMHz = GetFrequencySX_MHz(Rx, mRefClkSXR_MHz);
+
+    //SXT
+    Modify_SPI_Reg_bits(LMS7param(MAC), 2);
+    Modify_SPI_Reg_bits(LMS7param(PD_LOCH_T2RBUF), 1); //PD_LOCH_t2RBUF 1
+    status = SetFrequencySX(Tx, SXRfreqMHz + bandwidth_MHz / 4, mRefClkSXT_MHz);
+    if ( status != LIBLMS7_SUCCESS)
+        return status;
+    Modify_SPI_Reg_bits(LMS7param(MAC), ch);
+
+    //TXTSP
+    SetDefaults(TxTSP);
+    Modify_SPI_Reg_bits(0x0200, 3, 2, 0x3); //TSGMODE 1, INSEL 1
+    //Modify_SPI_Reg_bits(0x0208, 6, 4, 0xFFFF); //GFIR3_BYP 1, GFIR2_BYP 1, GFIR1_BYP 1
+    Modify_SPI_Reg_bits(0x0208, 6, 6, 1); //GFIR3_BYP 1, GFIR2_BYP 1, GFIR1_BYP 1
+    Modify_SPI_Reg_bits(0x0208, 5, 5, 1); //GFIR3_BYP 1, GFIR2_BYP 1, GFIR1_BYP 1
+    Modify_SPI_Reg_bits(0x0208, 4, 4, 1); //GFIR3_BYP 1, GFIR2_BYP 1, GFIR1_BYP 1
+    LoadDC_REG_IQ(Tx, (int16_t)0x7FFF, (int16_t)0x8000);
+    SetNCOFrequency(Tx, 0, 0);
+
+    //RXTSP
+    SetDefaults(RxTSP);
+    Modify_SPI_Reg_bits(LMS7param(AGC_MODE_RXTSP), 1); //AGC_MODE 1
+    Modify_SPI_Reg_bits(0x040C, 7, 7, 0x1); //CMIX_BYP 1
+    Modify_SPI_Reg_bits(0x040C, 6, 6, 0x0); //AGC_BYP 0
+    Modify_SPI_Reg_bits(0x040C, 5, 5, 1); //
+    Modify_SPI_Reg_bits(0x040C, 4, 4, 1); //
+    Modify_SPI_Reg_bits(0x040C, 3, 3, 1); //
+    Modify_SPI_Reg_bits(0x040C, 2, 2, 1); // DC_BYP
+    Modify_SPI_Reg_bits(0x040C, 1, 1, 1); //
+    Modify_SPI_Reg_bits(0x040C, 0, 0, 1); //
+
+    Modify_SPI_Reg_bits(LMS7param(CAPSEL), 0);
+    Modify_SPI_Reg_bits(LMS7param(HBD_OVR_RXTSP), 2);
+    Modify_SPI_Reg_bits(LMS7param(AGC_AVG_RXTSP), 0x7); //agc_avg iq corr
+    return LIBLMS7_SUCCESS;
+}
+
+/** @brief Calibrates Receiver. DC offset, IQ gains, IQ phase correction
+    @return 0-success, other-failure
+*/
+liblms7_status LMS7002M::CalibrateRx(float_type bandwidth_MHz)
+{
+    liblms7_status status;
+    uint32_t minRSSI_i;
+    uint32_t minRSSI_q;
+    int16_t iqcorr_rx = 0;
+    uint32_t minRSSI_iq;
+    int16_t dcoffi;
+    int16_t dcoffq;
+
+    const int16_t firCoefs[] =
+    {
+        -2531,
+        -517,
+        2708,
+        188,
+        -3059,
+        216,
+        3569,
+        -770,
+        -4199,
+        1541,
+        4886,
+        -2577,
+        -5552,
+        3909,
+        6108,
+        -5537,
+        -6457,
+        7440,
+        6507,
+        -9566,
+        -6174,
+        11845,
+        5391,
+        -14179,
+        -4110,
+        16457,
+        2310,
+        -18561,
+        0,
+        20369,
+        -2780,
+        -21752,
+        5963,
+        22610,
+        -9456,
+        -22859,
+        13127,
+        22444,
+        -16854,
+        -21319,
+        20489,
+        19492,
+        -23883,
+        -17002,
+        26881,
+        13902,
+        -29372,
+        -10313,
+        31226,
+        6345,
+        -32380,
+        -2141,
+        32767,
+        -2141,
+        -32380,
+        6345,
+        31226,
+        -10313,
+        -29372,
+        13902,
+        26881,
+        -17002,
+        -23883,
+        19492,
+        20489,
+        -21319,
+        -16854,
+        22444,
+        13127,
+        -22859,
+        -9456,
+        22610,
+        5963,
+        -21752,
+        -2780,
+        20369,
+        0,
+        -18561,
+        2310,
+        16457,
+        -4110,
+        -14179,
+        5391,
+        11845,
+        -6174,
+        -9566,
+        6507,
+        7440,
+        -6457,
+        -5537,
+        6108,
+        3909,
+        -5552,
+        -2577,
+        4886,
+        1541,
+        -4199,
+        -770,
+        3569,
+        216,
+        -3059,
+        188,
+        2708,
+        -517,
+        -2531
+    };
+
+    Log("Rx calibration started", LOG_INFO);
+    uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC));
+    Log("Saving registers state", LOG_INFO);
+    BackupAllRegisters();
+    uint8_t sel_path_rfe = (uint8_t)Get_SPI_Reg_bits(LMS7param(SEL_PATH_RFE));
+    if (sel_path_rfe == 1 || sel_path_rfe == 0)
+        return LIBLMS7_BAD_SEL_PATH;
+
+    Log("Setup stage", LOG_INFO);
+    status = CalibrateRxSetup(bandwidth_MHz);
+    if (status != LIBLMS7_SUCCESS)
+        goto RxCalibrationEndStage;
+
+    Log("Rx DC calibration", LOG_INFO);
+    CalibrateRxDC_RSSI();
+    dcoffi = Get_SPI_Reg_bits(LMS7param(DCOFFI_RFE));
+    dcoffq = Get_SPI_Reg_bits(LMS7param(DCOFFQ_RFE));
+    Modify_SPI_Reg_bits(LMS7param(EN_G_TRF), 1);
+
+    if (sel_path_rfe == 2)
+    {
+        Modify_SPI_Reg_bits(LMS7param(PD_RLOOPB_2_RFE), 0);
+        Modify_SPI_Reg_bits(0x0103, 10, 10, 1);
+        Modify_SPI_Reg_bits(0x0103, 11, 11, 0);
+        Modify_SPI_Reg_bits(LMS7param(EN_INSHSW_LB2_RFE), 0);
+    }
+    if (sel_path_rfe == 3)
+    {
+        Modify_SPI_Reg_bits(LMS7param(PD_RLOOPB_1_RFE), 0);
+        Modify_SPI_Reg_bits(0x0103, 11, 11, 1);
+        Modify_SPI_Reg_bits(0x0103, 10, 10, 0);
+        Modify_SPI_Reg_bits(LMS7param(EN_INSHSW_LB1_RFE), 0);
+    }
+
+    Modify_SPI_Reg_bits(0x040C, 7, 7, 0); //CMIX_BYP 0
+    Modify_SPI_Reg_bits(0x040C, 2, 0, 0); //DC_BYP 0, GC_BYP 0, PH_BYP 0
+    Modify_SPI_Reg_bits(LMS7param(CMIX_GAIN_RXTSP), 1); //CMIX_GAIN 1  +6 db
+    Modify_SPI_Reg_bits(0x040C, 13, 13, 1); //CMIX_SC 1
+
+    FixRXSaturation();
+
+    Modify_SPI_Reg_bits(0x040C, 5, 5, 0); //GFIR3_BYP 0
+    Modify_SPI_Reg_bits(LMS7param(HBD_OVR_RXTSP), 2);
+    Modify_SPI_Reg_bits(LMS7param(GFIR3_L_RXTSP), 7);
+    Modify_SPI_Reg_bits(LMS7param(GFIR3_N_RXTSP), 7);
+
+    SetGFIRCoefficients(Rx, 2, firCoefs, sizeof(firCoefs) / sizeof(int16_t));
+
+    SetNCOFrequency(Rx, 0, bandwidth_MHz / 4 + 1);
+    Modify_SPI_Reg_bits(LMS7param(GCORRI_RXTSP), 2047);
+    Modify_SPI_Reg_bits(LMS7param(GCORRQ_RXTSP), 2047);
+
+    Log("IQ correction stage", LOG_INFO);
+    iqcorr_rx = 0;
+    for (int i = 0; i<9; ++i)
+        minRSSI_iq = FindMinRSSI(LMS7param(IQCORR_RXTSP), iqcorr_rx, &iqcorr_rx, 3, 1, 256 >> i);
+    Modify_SPI_Reg_bits(LMS7param(IQCORR_RXTSP), iqcorr_rx);
+
+    uint16_t mingcorri;
+    Log("I gain", LOG_INFO);
+    minRSSI_i = FindMinRSSI_Gain(LMS7param(GCORRI_RXTSP), &mingcorri);
+
+    Modify_SPI_Reg_bits(LMS7param(GCORRI_RXTSP), 2047);
+    Modify_SPI_Reg_bits(LMS7param(GCORRQ_RXTSP), 2047);
+
+    Log("Q gain", LOG_INFO);
+    uint16_t mingcorrq;
+    minRSSI_q = FindMinRSSI_Gain(LMS7param(GCORRQ_RXTSP), &mingcorrq);
+
+    if (minRSSI_i < minRSSI_q)
+        mingcorrq = 2047;
+    else
+        mingcorri = 2047;
+
+    Modify_SPI_Reg_bits(LMS7param(GCORRI_RXTSP), mingcorri);
+    Modify_SPI_Reg_bits(LMS7param(GCORRQ_RXTSP), mingcorrq);
+
+    Log("Phase", LOG_INFO);
+    for (int i = 0; i<9; ++i)
+        minRSSI_iq = FindMinRSSI(LMS7param(IQCORR_RXTSP), iqcorr_rx, &iqcorr_rx, 3, 1, 256 >> i);
+
+RxCalibrationEndStage:
+    Log("Restoring registers state", LOG_INFO);
+    RestoreAllRegisters();
+    if (status != LIBLMS7_SUCCESS)
+    {
+        Log("Rx calibration failed", LOG_WARNING);
+        return status;
+    }
+
+    Modify_SPI_Reg_bits(LMS7param(MAC), ch);
+    SetRxDCOFF((int8_t)dcoffi, (int8_t)dcoffq);
+    Modify_SPI_Reg_bits(LMS7param(EN_DCOFF_RXFE_RFE), 1);
+    Modify_SPI_Reg_bits(LMS7param(GCORRI_RXTSP), mingcorri);
+    Modify_SPI_Reg_bits(LMS7param(GCORRQ_RXTSP), mingcorrq);
+    Modify_SPI_Reg_bits(LMS7param(IQCORR_RXTSP), iqcorr_rx);
+    Modify_SPI_Reg_bits(0x040C, 2, 0, 0); //DC_BYP 0, GC_BYP 0, PH_BYP 0
+    Modify_SPI_Reg_bits(0x0110, 4, 0, 31); //ICT_LO_RFE 31
+    Log("Rx calibration finished", LOG_INFO);
+    return LIBLMS7_SUCCESS;
+}
+
+const uint16_t backupAddrs[] = {
+    0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028,
+    0x0029, 0x002A, 0x002B, 0x002C, 0x002E, 0x0081, 0x0082, 0x0084, 0x0085,
+    0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x0092, 0x0093, 0x0094,
+    0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E,
+    0x009F, 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8,
+    0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x0100, 0x0101, 0x0102, 0x0103,
+    0x0104, 0x0105, 0x0106, 0x0107, 0x0108, 0x0109, 0x010A, 0x010C, 0x010D, 0x010E,
+    0x010F, 0x0110, 0x0111, 0x0112, 0x0113, 0x0114, 0x0115, 0x0116, 0x0117, 0x0118,
+    0x0119, 0x011A, 0x011C, 0x011D, 0x011E, 0x011F, 0x0120, 0x0121, 0x0122, 0x0123,
+    0x0124, 0x0200, 0x0201, 0x0202, 0x0203, 0x0204, 0x0205, 0x0206, 0x0207, 0x0208,
+    0x0240, 0x0242, 0x0243, 0x0400, 0x0401, 0x0402,
+    0x0403, 0x0404, 0x0405, 0x0406, 0x0407, 0x0408, 0x0409, 0x040A, 0x040B, 0x040C,
+    0x0440, 0x0442, 0x0443 };
+uint16_t backupRegs[sizeof(backupAddrs) / 2];
+const uint16_t backupSXAddr[] = { 0x011C, 0x011D, 0x011E, 0x011F, 0x01200, 0x0121, 0x0122, 0x0123, 0x0124 };
+uint16_t backupRegsSXR[sizeof(backupSXAddr) / 2];
+uint16_t backupRegsSXT[sizeof(backupSXAddr) / 2];
+
+/** @brief Stores chip current registers state into memory for later restoration
+*/
+void LMS7002M::BackupAllRegisters()
+{
+    uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC));
+    SPI_read_batch(backupAddrs, backupRegs, sizeof(backupAddrs) / sizeof(uint16_t));
+    Modify_SPI_Reg_bits(LMS7param(MAC), 1); // channel A
+    SPI_read_batch(backupSXAddr, backupRegsSXR, sizeof(backupRegsSXR) / sizeof(uint16_t));
+    Modify_SPI_Reg_bits(LMS7param(MAC), 2); // channel B
+    SPI_read_batch(backupSXAddr, backupRegsSXT, sizeof(backupRegsSXR) / sizeof(uint16_t));
+    Modify_SPI_Reg_bits(LMS7param(MAC), ch);
+}
+
+/** @brief Sets chip registers to state that was stored in memory using BackupAllRegisters()
+*/
+void LMS7002M::RestoreAllRegisters()
+{
+    uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC));
+    SPI_write_batch(backupAddrs, backupRegs, sizeof(backupAddrs) / sizeof(uint16_t));
+    Modify_SPI_Reg_bits(LMS7param(MAC), 1); // channel A
+    SPI_write_batch(backupSXAddr, backupRegsSXR, sizeof(backupRegsSXR) / sizeof(uint16_t));
+    Modify_SPI_Reg_bits(LMS7param(MAC), 2); // channel B
+    SPI_write_batch(backupSXAddr, backupRegsSXT, sizeof(backupRegsSXR) / sizeof(uint16_t));
+    Modify_SPI_Reg_bits(LMS7param(MAC), ch);
+}
+
+/** @brief Searches for minimal digital RSSI value by changing given gain parameter
+    @param param LMS7002M gain correction parameter
+    @param foundValue returns value which achieved minimal RSSI
+    @return minimal found RSSI value
+*/
+uint32_t LMS7002M::FindMinRSSI_Gain(const LMS7Parameter &param, uint16_t *foundValue)
+{
+    uint32_t RSSI = ~0 - 2;
+    uint32_t prevRSSI = RSSI + 1;
+    uint8_t decrement = 2;
+    uint16_t gcorr = 2047;
+    while (gcorr > 1024)
+    {
+        Modify_SPI_Reg_bits(param, gcorr);
+        RSSI = GetRSSI();
+        if (RSSI < prevRSSI)
+        {
+            prevRSSI = RSSI;
+            *foundValue = gcorr;
+            gcorr -= decrement;
+            decrement *= 2;
+        }
+        else
+        {
+            if (decrement == 2)
+                break;
+            gcorr -= decrement;
+            decrement = 2;
+        }
+    }
+    return prevRSSI;
+}
+
+/** @brief Reads all chip configuration and checks if it matches with local registers copy
+*/
+bool LMS7002M::IsSynced()
+{
+    if (controlPort->IsOpen() == false)
+        return false;
+    bool isSynced = true;
+    liblms7_status status;
+
+    uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC));
+
+    vector<uint16_t> addrToRead = mRegistersMap->GetUsedAddresses(0);
+    vector<uint16_t> dataReceived;
+    dataReceived.resize(addrToRead.size(), 0);
+
+    Modify_SPI_Reg_bits(LMS7param(MAC), 1);
+    status = SPI_read_batch(&addrToRead[0], &dataReceived[0], addrToRead.size());
+    if (status != LIBLMS7_SUCCESS)
+    {
+        isSynced = false;
+        goto isSyncedEnding;
+    }
+
+    //mask out readonly bits
+    for (uint16_t j = 0; j < sizeof(readOnlyRegisters) / sizeof(uint16_t); ++j)
+        for (uint16_t k = 0; k < addrToRead.size(); ++k)
+            if (readOnlyRegisters[j] == addrToRead[k])
+            {
+                dataReceived[k] &= readOnlyRegistersMasks[j];
+                break;
+            }
+
+    //check if local copy matches chip
+    for (uint16_t i = 0; i < addrToRead.size(); ++i)
+    {
+        if (dataReceived[i] != mRegistersMap->GetValue(0, addrToRead[i]))
+        {
+            isSynced = false;
+            goto isSyncedEnding;
+        }
+    }
+
+    addrToRead.clear(); //add only B channel addresses
+    addrToRead = mRegistersMap->GetUsedAddresses(1);
+
+    //mask out readonly bits
+    for (uint16_t j = 0; j < sizeof(readOnlyRegisters) / sizeof(uint16_t); ++j)
+        for (uint16_t k = 0; k < addrToRead.size(); ++k)
+            if (readOnlyRegisters[j] == addrToRead[k])
+            {
+                dataReceived[k] &= readOnlyRegistersMasks[j];
+                break;
+            }
+
+    Modify_SPI_Reg_bits(LMS7param(MAC), 2);
+    status = SPI_read_batch(&addrToRead[0], &dataReceived[0], addrToRead.size());
+    if (status != LIBLMS7_SUCCESS)
+        return false;
+    //check if local copy matches chip
+    for (uint16_t i = 0; i < addrToRead.size(); ++i)
+        if (dataReceived[i] != mRegistersMap->GetValue(1, addrToRead[i]))
+        {
+            isSynced = false;
+            break;
+        }
+
+isSyncedEnding:
+    Modify_SPI_Reg_bits(LMS7param(MAC), ch); //restore previously used channel
+    return isSynced;
+}
+
+/** @brief Writes all registers from host to chip
+
+When used on Novena board, also changes gpios to match rx path and tx band selections
+*/
+liblms7_status LMS7002M::UploadAll()
+{
+    if (controlPort == NULL)
+        return LIBLMS7_NO_CONNECTION_MANAGER;
+    if (controlPort->IsOpen() == false)
+        return LIBLMS7_NOT_CONNECTED;
+
+    uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC)); //remember used channel
+
+    liblms7_status status;
+
+    vector<uint16_t> addrToWrite;
+    vector<uint16_t> dataToWrite;
+
+    uint16_t x0020_value = mRegistersMap->GetValue(0, 0x0020);
+    Modify_SPI_Reg_bits(LMS7param(MAC), 1); //select A channel
+
+    addrToWrite = mRegistersMap->GetUsedAddresses(0);
+    //remove 0x0020 register from list, to not change MAC
+    addrToWrite.erase( find(addrToWrite.begin(), addrToWrite.end(), 0x0020) );
+    for (auto address : addrToWrite)
+        dataToWrite.push_back(mRegistersMap->GetValue(0, address));
+
+    status = SPI_write_batch(&addrToWrite[0], &dataToWrite[0], addrToWrite.size());
+    status = LIBLMS7_SUCCESS;
+    if (status != LIBLMS7_SUCCESS)
+        return status;
+    //after all channel A registers have been written, update 0x0020 register value
+    status = SPI_write(0x0020, x0020_value);
+    if (status != LIBLMS7_SUCCESS)
+        return status;
+    Modify_SPI_Reg_bits(LMS7param(MAC), 2);
+    if (status != LIBLMS7_SUCCESS)
+        return status;
+
+    addrToWrite = mRegistersMap->GetUsedAddresses(1);
+    dataToWrite.clear();
+   for (auto address : addrToWrite)
+    {
+        dataToWrite.push_back(mRegistersMap->GetValue(1, address));
+    }
+    Modify_SPI_Reg_bits(LMS7param(MAC), 2); //select B channel
+    status = SPI_write_batch(&addrToWrite[0], &dataToWrite[0], addrToWrite.size());
+    if (status != LIBLMS7_SUCCESS)
+        return status;
+    Modify_SPI_Reg_bits(LMS7param(MAC), ch); //restore last used channel
+
+    //in case of Novena board, need to update GPIO
+    if(controlPort->GetInfo().device == LMS_DEV_NOVENA)
+    {
+        uint16_t regValue = SPI_read(0x0706) & 0xFFF8;
+        //lms_gpio2 - tx output selection:
+		//		0 - TX1_A and TX1_B (Band 1),
+		//		1 - TX2_A and TX2_B (Band 2)
+        regValue |= Get_SPI_Reg_bits(LMS7param(SEL_BAND2_TRF)) << 2; //gpio2
+        //RX active paths
+        //lms_gpio0 | lms_gpio1      	RX_A		RX_B
+        //  0 			0       =>  	no active path
+        //  1   		0 		=>	LNAW_A  	LNAW_B
+        //  0			1		=>	LNAH_A  	LNAH_B
+        //  1			1		=>	LNAL_A 	 	LNAL_B
+        switch(Get_SPI_Reg_bits(LMS7param(SEL_PATH_RFE)))
+        {
+            //set gpio1:gpio0
+            case 0: regValue |= 0x0; break;
+            case 1: regValue |= 0x2; break;
+            case 2: regValue |= 0x3; break;
+            case 3: regValue |= 0x1; break;
+        }
+        SPI_write(0x0706, regValue);
+    }
+    return LIBLMS7_SUCCESS;
+}
+
+/** @brief Reads all registers from the chip to host
+
+When used on Novena board, also updates gpios to match rx path and tx band selections
+*/
+liblms7_status LMS7002M::DownloadAll()
+{
+    if (controlPort == nullptr)
+        return LIBLMS7_NO_CONNECTION_MANAGER;
+    if (controlPort->IsOpen() == false)
+        return LIBLMS7_NOT_CONNECTED;
+    liblms7_status status;
+    uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC), false);
+
+    vector<uint16_t> addrToRead = mRegistersMap->GetUsedAddresses(0);
+    vector<uint16_t> dataReceived;
+    dataReceived.resize(addrToRead.size(), 0);
+    Modify_SPI_Reg_bits(LMS7param(MAC), 1);
+    status = SPI_read_batch(&addrToRead[0], &dataReceived[0], addrToRead.size());
+    if (status != LIBLMS7_SUCCESS)
+        return status;
+
+    for (uint16_t i = 0; i < addrToRead.size(); ++i)
+    {
+        uint16_t adr = addrToRead[i];
+        uint16_t val = dataReceived[i];
+        mRegistersMap->SetValue(0, addrToRead[i], dataReceived[i]);
+    }
+
+    addrToRead.clear(); //add only B channel addresses
+    addrToRead = mRegistersMap->GetUsedAddresses(1);
+    dataReceived.resize(addrToRead.size(), 0);
+
+    Modify_SPI_Reg_bits(LMS7param(MAC), 2);
+    status = SPI_read_batch(&addrToRead[0], &dataReceived[0], addrToRead.size());
+    if (status != LIBLMS7_SUCCESS)
+        return status;
+    for (uint16_t i = 0; i < addrToRead.size(); ++i)
+        mRegistersMap->SetValue(1, addrToRead[i], dataReceived[i]);
+
+    Modify_SPI_Reg_bits(LMS7param(MAC), ch); //retore previously used channel
+
+    //in case of Novena board, update GPIO
+    if(controlPort->GetInfo().device == LMS_DEV_NOVENA)
+    {
+        uint16_t regValue = SPI_read(0x0706) & 0xFFF8;
+        //lms_gpio2 - tx output selection:
+		//		0 - TX1_A and TX1_B (Band 1),
+		//		1 - TX2_A and TX2_B (Band 2)
+        regValue |= Get_SPI_Reg_bits(LMS7param(SEL_BAND2_TRF)) << 2; //gpio2
+        //RX active paths
+        //lms_gpio0 | lms_gpio1      	RX_A		RX_B
+        //  0 			0       =>  	no active path
+        //  1   		0 		=>	LNAW_A  	LNAW_B
+        //  0			1		=>	LNAH_A  	LNAH_B
+        //  1			1		=>	LNAL_A 	 	LNAL_B
+        switch(Get_SPI_Reg_bits(LMS7param(SEL_PATH_RFE)))
+        {
+            //set gpio1:gpio0
+            case 0: regValue |= 0x0; break;
+            case 1: regValue |= 0x2; break;
+            case 2: regValue |= 0x3; break;
+            case 3: regValue |= 0x1; break;
+        }
+        SPI_write(0x0706, regValue);
+    }
+
+    return LIBLMS7_SUCCESS;
+}
+
+/** @brief Configures interfaces for desired frequency
+    Sets interpolation and decimation, changes MCLK sources and TSP clock dividers accordingly to selected interpolation and decimation
+*/
+liblms7_status LMS7002M::SetInterfaceFrequency(float_type cgen_freq_MHz, const uint8_t interpolation, const uint8_t decimation)
+{
+    Modify_SPI_Reg_bits(LMS7param(HBD_OVR_RXTSP), decimation);
+    Modify_SPI_Reg_bits(LMS7param(HBI_OVR_TXTSP), interpolation);
+    liblms7_status status = SetFrequencyCGEN(cgen_freq_MHz);
+    if (status != LIBLMS7_SUCCESS)
+        return status;
+
+    if (decimation == 7 || decimation == 0) //bypass
+    {
+        Modify_SPI_Reg_bits(LMS7param(RXTSPCLKA_DIV), 0);
+        Modify_SPI_Reg_bits(LMS7param(RXDIVEN), false);
+        Modify_SPI_Reg_bits(LMS7param(MCLK2SRC), 3);
+    }
+    else
+    {
+        uint8_t divider = (uint8_t)pow(2.0, decimation);
+        if (divider > 1)
+            Modify_SPI_Reg_bits(LMS7param(RXTSPCLKA_DIV), (divider / 2) - 1);
+        else
+            Modify_SPI_Reg_bits(LMS7param(RXTSPCLKA_DIV), 0);
+        Modify_SPI_Reg_bits(LMS7param(RXDIVEN), true);
+        Modify_SPI_Reg_bits(LMS7param(MCLK2SRC), 1);
+    }
+    if (interpolation == 7 || interpolation == 0) //bypass
+    {
+        Modify_SPI_Reg_bits(LMS7param(TXTSPCLKA_DIV), 0);
+        Modify_SPI_Reg_bits(LMS7param(TXDIVEN), false);
+        Modify_SPI_Reg_bits(LMS7param(MCLK1SRC), 2);
+    }
+    else
+    {
+        uint8_t divider = (uint8_t)pow(2.0, interpolation);
+        if (divider > 1)
+            Modify_SPI_Reg_bits(LMS7param(TXTSPCLKA_DIV), (divider / 2) - 1);
+        else
+            Modify_SPI_Reg_bits(LMS7param(TXTSPCLKA_DIV), 0);
+        Modify_SPI_Reg_bits(LMS7param(TXDIVEN), true);
+        Modify_SPI_Reg_bits(LMS7param(MCLK1SRC), 0);
+    }
+    return status;
+}
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M.h
new file mode 100644
index 0000000000000000000000000000000000000000..81234c28a3fa7686041eaed5efc5c518e8f745d5
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M.h
@@ -0,0 +1,177 @@
+/**
+@file	LMS7002M.h
+@author Lime Microsystems (www.limemicro.com)
+@brief	LMS7002M transceiver configuration interface
+*/
+
+#ifndef LMS7API_H
+#define LMS7API_H
+
+#include "LMS7002M_statuses.h"
+#include "LMS7002M_parameters.h"
+#include "typedefs.h"
+
+#include <sstream>
+
+class LMScomms;
+class LMS7002M_RegistersMap;
+
+class LMS7002M
+{
+public:
+    enum
+    {
+        Rx, Tx
+    };
+
+	LMS7002M();
+    LMS7002M(LMScomms* controlPort);
+	virtual ~LMS7002M();
+
+    ///@name Registers writing and reading
+    liblms7_status UploadAll();
+    liblms7_status DownloadAll();
+    bool IsSynced();
+
+	liblms7_status ResetChip();
+	liblms7_status LoadConfig(const char* filename);
+	liblms7_status SaveConfig(const char* filename);
+    ///@}
+
+    ///@name Registers writing and reading
+    uint16_t Get_SPI_Reg_bits(const LMS7Parameter &param, bool fromChip = true);
+    uint16_t Get_SPI_Reg_bits(uint16_t address, uint8_t msb, uint8_t lsb, bool fromChip = true);
+    liblms7_status Modify_SPI_Reg_bits(const LMS7Parameter &param, const uint16_t value, bool fromChip = true);
+    liblms7_status Modify_SPI_Reg_bits(uint16_t address, uint8_t msb, uint8_t lsb, uint16_t value, bool fromChip = true);
+    liblms7_status SPI_write(uint16_t address, uint16_t data);
+    uint16_t SPI_read(uint16_t address, bool fromChip = true, liblms7_status *status = 0);
+    liblms7_status RegistersTest();
+    ///@}
+
+    ///@name Transmitter, Receiver calibrations
+	liblms7_status CalibrateRx(float_type bandwidth_MHz);
+	liblms7_status CalibrateTx(float_type bandwidth_MHz);
+    ///@}
+
+    ///@name Filters tuning
+	enum TxFilter
+	{
+		TX_LADDER, TX_REALPOLE, TX_HIGHBAND
+	};
+    enum RxFilter
+    {
+        RX_TIA, RX_LPF_LOWBAND, RX_LPF_HIGHBAND
+    };
+	liblms7_status TuneTxFilter(TxFilter filterType, float_type bandwidth_MHz);
+	liblms7_status TuneTxFilterLowBandChain(float_type ladder_bw_MHz, float_type realpole_bw_MHz);
+	liblms7_status TuneRxFilter(RxFilter filterType, float_type bandwidth_MHz);
+    ///@}
+
+    ///@name CGEN and PLL
+	float_type GetReferenceClk_SX(bool tx);
+	float_type GetFrequencyCGEN_MHz();
+	liblms7_status SetFrequencyCGEN(float_type freq_MHz);
+	float_type GetFrequencySX_MHz(bool tx, float_type refClk_MHz);
+	liblms7_status SetFrequencySX(bool tx, float_type freq_MHz, float_type refClk_MHz);
+    ///VCO modules available for tuning
+    enum VCO_Module
+    {
+        VCO_CGEN, VCO_SXR, VCO_SXT
+    };
+    liblms7_status TuneVCO(VCO_Module module);
+    ///@}
+
+    ///@name TSP
+	liblms7_status LoadDC_REG_IQ(bool tx, int16_t I, int16_t Q);
+	liblms7_status SetNCOFrequency(bool tx, uint8_t index, float_type freq_MHz);
+	float_type GetNCOFrequency_MHz(bool tx, uint8_t index, float_type refClk_MHz, bool fromChip = true);
+    liblms7_status SetNCOPhaseOffsetForMode0(bool tx, float_type angle_Deg);
+	liblms7_status SetNCOPhaseOffset(bool tx, uint8_t index, float_type angle_Deg);
+	float_type GetNCOPhaseOffset_Deg(bool tx, uint8_t index);
+	liblms7_status SetGFIRCoefficients(bool tx, uint8_t GFIR_index, const int16_t *coef, uint8_t coefCount);
+	liblms7_status GetGFIRCoefficients(bool tx, uint8_t GFIR_index, int16_t *coef, uint8_t coefCount);
+    float_type GetReferenceClk_TSP_MHz(bool tx);
+    ///@}
+
+    liblms7_status SetInterfaceFrequency(float_type cgen_freq_MHz, const uint8_t interpolation, const uint8_t decimation);
+
+    ///enumeration to indicate module registers intervals
+    enum MemorySection
+    {
+        LimeLight = 0, EN_DIR, AFE, BIAS, XBUF, CGEN, LDO, BIST, CDS,
+        TRF, TBB, RFE, RBB, SX, TxTSP,
+        TxNCO, TxGFIR1, TxGFIR2, TxGFIR3a, TxGFIR3b, TxGFIR3c,
+        RxTSP, RxNCO, RxGFIR1, RxGFIR2, RxGFIR3a, RxGFIR3b, RxGFIR3c,
+        MEMORY_SECTIONS_COUNT
+    };
+    virtual liblms7_status SetDefaults(MemorySection module);
+	LMScomms* GetControlPort() const { return controlPort;};
+
+    static const float_type gLadder_lower_limit;
+    static const float_type gLadder_higher_limit;
+    static const float_type gRealpole_lower_limit;
+    static const float_type gRealpole_higher_limit;
+    static const float_type gHighband_lower_limit;
+    static const float_type  gHighband_higher_limit;
+
+    static const float_type gRxTIA_higher_limit;
+    static const float_type gRxTIA_lower_limit_g1;
+    static const float_type gRxTIA_lower_limit_g23;
+    static const float_type gRxLPF_low_lower_limit;
+    static const float_type gRxLPF_low_higher_limit;
+    static const float_type gRxLPF_high_lower_limit;
+    static const float_type gRxLPF_high_higher_limit;
+
+    static float_type gVCO_frequency_table[3][2];
+    static float_type gCGEN_VCO_frequencies[2];
+
+    //protected:
+    LMS7002M_RegistersMap *mRegistersMap;
+    static const uint16_t readOnlyRegisters[];
+    static const uint16_t readOnlyRegistersMasks[];
+
+    uint16_t MemorySectionAddresses[MEMORY_SECTIONS_COUNT][2];
+    ///@name Algorithms functions
+    void BackupAllRegisters();
+    void RestoreAllRegisters();
+    uint32_t GetRSSI();
+    void SetRxDCOFF(int8_t offsetI, int8_t offsetQ);
+    uint32_t FindMinRSSI_Gain(const LMS7Parameter &param, uint16_t *foundValue);
+    uint32_t FindMinRSSI(const LMS7Parameter &param, const int16_t startValue, int16_t *result, const uint8_t scanWidth, const uint8_t twoCompl, int8_t stepMult = 1);
+    uint32_t FindMinRSSI(const uint16_t addr, const uint8_t msb, const uint8_t lsb, const int16_t startValue, int16_t *result, const uint8_t scanWidth, const uint8_t twoCompl, int8_t stepMult = 1);
+    void CalibrateRxDC_RSSI();
+    liblms7_status CalibrateTxSetup(float_type bandwidth_MHz);
+    liblms7_status CalibrateRxSetup(float_type bandwidth_MHz);
+    liblms7_status FixRXSaturation();
+    void FilterTuning_AdjustGains();
+    liblms7_status TuneTxFilterSetup(TxFilter type, float_type cutoff_MHz);
+    liblms7_status TuneRxFilterSetup(RxFilter type, float_type cutoff_MHz);
+    liblms7_status RFE_TIA_Calibration(float_type TIA_freq_MHz);
+    liblms7_status RxLPFLow_Calibration(float_type RxLPFL_freq_MHz);
+    liblms7_status RxLPFHigh_Calibration(float_type RxLPFH_freq_MHz);
+
+    liblms7_status RegistersTestInterval(uint16_t startAddr, uint16_t endAddr, uint16_t pattern, std::stringstream &ss);
+    liblms7_status SPI_write_batch(const uint16_t* spiAddr, const uint16_t* spiData, uint16_t cnt);
+    liblms7_status SPI_read_batch(const uint16_t* spiAddr, uint16_t* spiData, uint16_t cnt);
+    liblms7_status Modify_SPI_Reg_mask(const uint16_t *addr, const uint16_t *masks, const uint16_t *values, uint8_t start, uint8_t stop);
+    ///@}
+    ///Reference clock used for Receiver frequency calculations
+    float_type mRefClkSXR_MHz;
+    ///Reference clock used for Transmitter frequency calculations
+    float_type mRefClkSXT_MHz;
+
+    enum LogType
+    {
+        LOG_INFO,
+        LOG_WARNING,
+        LOG_ERROR,
+        LOG_DATA
+    };
+    virtual void Log(const char* text, LogType type);
+
+    ///port used for communicating with LMS7002M
+    LMScomms* controlPort;
+
+    liblms7_status LoadConfigLegacyFile(const char* filename);
+};
+#endif
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_RegistersMap.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_RegistersMap.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..8c870ffcc0da6869ab73b8d6c734766554a5a65e
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_RegistersMap.cpp
@@ -0,0 +1,68 @@
+#include "LMS7002M_RegistersMap.h"
+#include "LMS7002M_parameters.h"
+
+LMS7002M_RegistersMap::LMS7002M_RegistersMap()
+{
+
+}
+
+LMS7002M_RegistersMap::~LMS7002M_RegistersMap()
+{
+
+}
+
+uint16_t LMS7002M_RegistersMap::GetDefaultValue(uint16_t address) const
+{
+    std::map<uint16_t, Register>::const_iterator iter = mChannelA.find(address);
+    if( iter != mChannelA.end())
+        return iter->second.defaultValue;
+    else
+        return 0;
+}
+
+void LMS7002M_RegistersMap::InitializeDefaultValues(const std::vector<const LMS7Parameter*> parameterList)
+{
+    for(auto parameter : parameterList)
+    {
+        uint16_t regValue = mChannelA[parameter->address].defaultValue;
+        mChannelA[parameter->address].defaultValue = regValue | (parameter->defaultValue << parameter->lsb);
+        mChannelA[parameter->address].value = mChannelA[parameter->address].defaultValue;
+        if(parameter->address >= 0x0100)
+            mChannelB[parameter->address].value = mChannelA[parameter->address].value;
+    }
+}
+
+void LMS7002M_RegistersMap::SetValue(uint8_t channel, const uint16_t address, const uint16_t value)
+{
+    if(channel == 0)
+        mChannelA[address].value = value;
+    else if(channel == 1)
+        mChannelB[address].value = value;
+}
+
+uint16_t LMS7002M_RegistersMap::GetValue(uint8_t channel, uint16_t address) const
+{
+    const std::map<const uint16_t, Register> *regMap;
+    if(channel == 0)
+        regMap = &mChannelA;
+    else if(channel == 1)
+        regMap = &mChannelB;
+    std::map<const uint16_t, Register>::const_iterator iter;
+    iter = regMap->find(address);
+    if (iter != regMap->end())
+        return iter->second.value;
+    else
+        return 0;
+}
+
+std::vector<uint16_t> LMS7002M_RegistersMap::GetUsedAddresses(const uint8_t channel) const
+{
+    std::vector<uint16_t> addresses;
+    if(channel == 0)
+        for(auto iter : mChannelA)
+            addresses.push_back(iter.first);
+    else if(channel == 1)
+        for(auto iter : mChannelB)
+            addresses.push_back(iter.first);
+    return addresses;
+}
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_RegistersMap.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_RegistersMap.h
new file mode 100644
index 0000000000000000000000000000000000000000..5ccda752db36187ef2626f751df312af5d4f4663
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_RegistersMap.h
@@ -0,0 +1,35 @@
+#ifndef LMS7002M_REGISTERS_MAP_H
+#define LMS7002M_REGISTERS_MAP_H
+
+#include <vector>
+#include <map>
+#include <typedefs.h>
+
+struct LMS7Parameter;
+
+class LMS7002M_RegistersMap
+{
+public:
+    struct Register
+    {
+        uint16_t value;
+        uint16_t defaultValue;
+        uint16_t mask;
+    };
+
+    LMS7002M_RegistersMap();
+    ~LMS7002M_RegistersMap();
+
+    uint16_t GetValue(uint8_t channel, uint16_t address) const;
+    void SetValue(uint8_t channel, const uint16_t address, const uint16_t value);
+
+    void InitializeDefaultValues(const std::vector<const LMS7Parameter*> parameterList);
+    uint16_t GetDefaultValue(uint16_t address) const;
+    std::vector<uint16_t> GetUsedAddresses(const uint8_t channel) const;
+
+protected:
+    std::map<const uint16_t, Register> mChannelA;
+    std::map<const uint16_t, Register> mChannelB;
+};
+
+#endif
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_filtersCalibration.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_filtersCalibration.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..2f3d38c1b587ae0cad7f5134857af0ffc444bb54
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_filtersCalibration.cpp
@@ -0,0 +1,861 @@
+/**
+@file	LMS7002M_filtersCalibration.cpp
+@author Lime Microsystems (www.limemicro.com)
+@brief	Implementation of LMS7002M transceiver filters calibration algorithms
+*/
+
+#include "LMS7002M.h"
+#include <cmath>
+
+///define for parameter enumeration if prefix might be needed
+#define LMS7param(id) id
+
+const float_type LMS7002M::gLadder_lower_limit = 2;
+const float_type LMS7002M::gLadder_higher_limit = 16;
+const float_type LMS7002M::gRealpole_lower_limit = 0.8;
+const float_type LMS7002M::gRealpole_higher_limit = 3.2;
+const float_type LMS7002M::gHighband_lower_limit = 28;
+const float_type LMS7002M::gHighband_higher_limit = 70;
+
+const float_type LMS7002M::gRxTIA_higher_limit = 60;
+const float_type LMS7002M::gRxTIA_lower_limit_g1 = 1.5;
+const float_type LMS7002M::gRxTIA_lower_limit_g23 = 0.5;
+const float_type LMS7002M::gRxLPF_low_lower_limit = 1;
+const float_type LMS7002M::gRxLPF_low_higher_limit = 20;
+const float_type LMS7002M::gRxLPF_high_lower_limit = 20;
+const float_type LMS7002M::gRxLPF_high_higher_limit = 70;
+
+liblms7_status LMS7002M::TuneTxFilterSetup(LMS7002M::TxFilter type, float_type cutoff_MHz)
+{
+    Modify_SPI_Reg_bits(LMS7param(EN_G_RFE), 0);
+    Modify_SPI_Reg_bits(LMS7param(EN_G_TRF), 0);
+
+    //RBB
+    SetDefaults(RBB);
+    Modify_SPI_Reg_bits(LMS7param(PD_LPFL_RBB), 1);
+    Modify_SPI_Reg_bits(LMS7param(INPUT_CTL_PGA_RBB), 3);
+    Modify_SPI_Reg_bits(LMS7param(ICT_PGA_OUT_RBB), 20);
+    Modify_SPI_Reg_bits(LMS7param(ICT_PGA_IN_RBB), 20);
+    Modify_SPI_Reg_bits(LMS7param(C_CTL_PGA_RBB), 3);
+
+    //TBB
+    SetDefaults(TBB);
+    Modify_SPI_Reg_bits(LMS7param(CG_IAMP_TBB), 1);
+    Modify_SPI_Reg_bits(LMS7param(ICT_IAMP_FRP_TBB), 1);
+    Modify_SPI_Reg_bits(LMS7param(ICT_IAMP_GG_FRP_TBB), 6);
+
+    //AFE
+    uint8_t isel_dac_afe = (uint8_t)Get_SPI_Reg_bits(0x0082, 15, 13);
+    SetDefaults(AFE);
+    if (Get_SPI_Reg_bits(LMS7param(MAC)) == 2)
+    {
+        Modify_SPI_Reg_bits(LMS7param(PD_TX_AFE2), 0); //PD_RX_AFE2 0
+        Modify_SPI_Reg_bits(LMS7param(PD_RX_AFE2), 0); //PD_RX_AFE2 0
+    }
+    Modify_SPI_Reg_bits(0x0082, 15, 13, isel_dac_afe);
+
+    //BIAS
+    uint8_t rpcalib_bias = (uint8_t)Get_SPI_Reg_bits(LMS7param(RP_CALIB_BIAS));
+    SetDefaults(BIAS);
+    Modify_SPI_Reg_bits(LMS7param(RP_CALIB_BIAS), rpcalib_bias);
+
+    //XBUF
+    Modify_SPI_Reg_bits(LMS7param(PD_XBUF_RX), 0);
+    Modify_SPI_Reg_bits(LMS7param(PD_XBUF_TX), 0);
+    Modify_SPI_Reg_bits(LMS7param(EN_G_XBUF), 1);
+
+    //CGEN
+    SetDefaults(CGEN);
+
+    //txtsp
+    SetDefaults(TxTSP);
+    Modify_SPI_Reg_bits(LMS7param(TSGMODE_TXTSP), 1);
+    Modify_SPI_Reg_bits(LMS7param(INSEL_TXTSP), 1);
+    Modify_SPI_Reg_bits(0x0208, 6, 4, 7);
+    LoadDC_REG_IQ(Tx, (int16_t)0x7FFF, (int16_t)0x8000);
+    float_type txNCOfreq = 0.05;
+    SetNCOFrequency(Tx, 0, txNCOfreq);
+
+    //rxtsp
+    SetDefaults(RxTSP);    
+    SetNCOFrequency(Rx, 0, txNCOfreq - 1);
+
+    Modify_SPI_Reg_bits(LMS7param(AGC_MODE_RXTSP), 1);
+    Modify_SPI_Reg_bits(0x040C, 6, 3, 0x07);
+
+    Modify_SPI_Reg_bits(LMS7param(AGC_AVG_RXTSP), 7);
+    Modify_SPI_Reg_bits(LMS7param(CMIX_GAIN_RXTSP), 1);
+
+    return LIBLMS7_SUCCESS;
+}
+
+
+liblms7_status LMS7002M::TuneTxFilter(LMS7002M::TxFilter type, float_type cutoff_MHz)
+{   
+    liblms7_status status;
+    float_type lowLimit = 0;
+    float_type highLimit = 1000;
+    uint32_t rssi = 0;
+    int8_t dir;
+    uint8_t ccal_lpflad_tbb;
+    uint32_t rssi_value_100k;
+    int16_t rcal;
+
+    float_type ncoFreq = 0.05;
+    float_type cgenFreq;
+    uint8_t loopb_tbb;
+    uint8_t cg_iamp_tbb = 1;
+    uint8_t bypladder_tbb;
+    uint8_t pd_lpfh_tbb;
+    uint8_t pd_lpflad_tbb;
+    uint8_t pd_lpfs5;
+    uint8_t en_g_tbb = 1;
+    uint8_t pd_iamp_tbb = 0;
+    uint8_t tstin_tbb = 0;
+
+    BackupAllRegisters();    
+    //float_type userCLKGENfreq = GetFrequencyCGEN_MHz();
+
+    status = TuneTxFilterSetup(type, cutoff_MHz);
+    if (status != LIBLMS7_SUCCESS)
+        goto TxFilterTuneEnd;    
+    cgenFreq = cutoff_MHz * 20;
+    if (cgenFreq < 60)
+        cgenFreq = 60;
+    if (cgenFreq > 640)
+        cgenFreq = 640;
+    if (type == TX_LADDER)
+    {
+        loopb_tbb = 2;
+        bypladder_tbb = 0;
+        pd_lpfh_tbb = 1;
+        pd_lpflad_tbb = 0;
+        pd_lpfs5 = 1;
+        lowLimit = gLadder_lower_limit;
+        highLimit = gLadder_higher_limit;
+    }
+    else if (type == TX_REALPOLE)
+    {
+        loopb_tbb = 3;
+        bypladder_tbb = 1;
+        pd_lpfh_tbb = 1;
+        pd_lpflad_tbb = 1;
+        pd_lpfs5 = 0;
+        lowLimit = gRealpole_lower_limit;
+        highLimit = gRealpole_higher_limit;
+    }
+    else if (type == TX_HIGHBAND)
+    {
+        loopb_tbb = 3;
+        bypladder_tbb = 0;
+        pd_lpfh_tbb = 0;
+        pd_lpflad_tbb = 1;
+        pd_lpfs5 = 1;
+        lowLimit = gHighband_lower_limit;
+        highLimit = gHighband_higher_limit;
+    }
+    if (cutoff_MHz == cgenFreq / 16)
+        cgenFreq -= 10;
+
+    if (cutoff_MHz < lowLimit || cutoff_MHz > highLimit)
+    {
+        status = LIBLMS7_FREQUENCY_OUT_OF_RANGE;
+        goto TxFilterTuneEnd;
+    }
+
+    status = SetFrequencyCGEN(cgenFreq);
+    if (status != LIBLMS7_SUCCESS)
+        goto TxFilterTuneEnd;
+
+    Modify_SPI_Reg_bits(LMS7param(LOOPB_TBB), loopb_tbb);
+    Modify_SPI_Reg_bits(LMS7param(CG_IAMP_TBB), cg_iamp_tbb);
+    Modify_SPI_Reg_bits(LMS7param(BYPLADDER_TBB), bypladder_tbb);
+    Modify_SPI_Reg_bits(LMS7param(TSTIN_TBB), tstin_tbb);
+    Modify_SPI_Reg_bits(LMS7param(PD_LPFH_TBB), pd_lpfh_tbb);
+    Modify_SPI_Reg_bits(LMS7param(PD_LPFIAMP_TBB), pd_iamp_tbb);
+    Modify_SPI_Reg_bits(LMS7param(PD_LPFLAD_TBB), pd_lpflad_tbb);
+    Modify_SPI_Reg_bits(LMS7param(PD_LPFS5_TBB), pd_lpfs5);
+    Modify_SPI_Reg_bits(LMS7param(EN_G_TBB), en_g_tbb);
+
+    //B
+    //LADDER coefficients
+    float_type p1, p2, p3, p4, p5;
+    switch (type)
+    {
+    case TX_LADDER:
+        p1 = 1.29858903647958E-16;
+        p2 = -0.000110746929967704;
+        p3 = 0.00277593485991029;
+        p4 = 21.0384293169607;
+        p5 = -48.4092606238297;
+        break;
+    case TX_REALPOLE:
+        p1 = 1.93821841029921E-15;
+        p2 = -0.0429694461214244;
+        p3 = 0.253501254059498;
+        p4 = 88.9545445989649;
+        p5 = -48.0847491316861;
+        break;
+    case TX_HIGHBAND:
+        p1 = 1.10383E-06;
+        p2 = -0.0002108;
+        p3 = 0.019049487;
+        p4 = 1.433174459;
+        p5 = -47.69507793;
+        break;
+    }
+    rcal = (int16_t)(pow(cutoff_MHz, 4)*p1 + pow(cutoff_MHz, 3)*p2 + pow(cutoff_MHz, 2)*p3 + cutoff_MHz * p4 + p5);
+    if (rcal < 0)
+        rcal = 0;
+    if (rcal > 255)
+        rcal = 255;
+
+    if (type == TX_REALPOLE)
+        Modify_SPI_Reg_bits(LMS7param(RCAL_LPFS5_TBB), rcal);
+    else if (type == TX_LADDER)
+        Modify_SPI_Reg_bits(LMS7param(RCAL_LPFLAD_TBB), rcal);
+    else if (type == TX_HIGHBAND)
+        Modify_SPI_Reg_bits(LMS7param(RCAL_LPFH_TBB), rcal);
+
+    FilterTuning_AdjustGains();
+
+    rssi_value_100k = (uint32_t)( GetRSSI()*0.707 );
+
+    SetNCOFrequency(Tx, 0, cutoff_MHz);
+    SetNCOFrequency(Rx, 0, cutoff_MHz - 1);
+
+    for (ccal_lpflad_tbb = 31; ccal_lpflad_tbb > 0; --ccal_lpflad_tbb)
+    {
+        Modify_SPI_Reg_bits(LMS7param(CCAL_LPFLAD_TBB), ccal_lpflad_tbb);
+        rssi = GetRSSI();
+        if (rssi > rssi_value_100k && ccal_lpflad_tbb == 31)
+            break; //skip this search, continue to advanced search
+        if (rssi > rssi_value_100k)
+        {
+            status = LIBLMS7_SUCCESS;
+            goto TxFilterTuneEnd; //found correct value
+        }
+    }
+
+
+    //advanced search for c and r values
+    status = LIBLMS7_FAILURE;
+    dir = ccal_lpflad_tbb == 31 ? -1 : 1;
+    while (rcal > 0 && rcal < 255)
+    {
+        rcal += 5 * dir;
+        if (rcal < 0 && rcal > 255)
+            break;
+        if (type == TX_REALPOLE)
+            Modify_SPI_Reg_bits(LMS7param(RCAL_LPFS5_TBB), rcal);
+        else if (type == TX_LADDER)
+            Modify_SPI_Reg_bits(LMS7param(RCAL_LPFLAD_TBB), rcal);
+        else if (type == TX_HIGHBAND)
+            Modify_SPI_Reg_bits(LMS7param(RCAL_LPFH_TBB), rcal);
+        SetNCOFrequency(Tx, 0, ncoFreq);
+        SetNCOFrequency(Rx, 0, ncoFreq - 1);
+        Modify_SPI_Reg_bits(LMS7param(CCAL_LPFLAD_TBB), 16);
+        rssi_value_100k = GetRSSI();
+        SetNCOFrequency(Tx, 0, cutoff_MHz);
+        SetNCOFrequency(Rx, 0, cutoff_MHz - 1);
+        for (ccal_lpflad_tbb = 31; ccal_lpflad_tbb > 0; --ccal_lpflad_tbb)
+        {
+            Modify_SPI_Reg_bits(LMS7param(CCAL_LPFLAD_TBB), ccal_lpflad_tbb);
+            rssi = GetRSSI();
+            if (rssi > rssi_value_100k*0.707 && ccal_lpflad_tbb == 31)
+                break; //skip c search, need to change r value
+            if (rssi > rssi_value_100k*0.707)
+            {
+                status = LIBLMS7_SUCCESS;
+                goto TxFilterTuneEnd;
+            }
+        }
+    }
+
+    //end
+TxFilterTuneEnd:
+    RestoreAllRegisters();
+    if (status != LIBLMS7_SUCCESS)
+        return status;    
+    Modify_SPI_Reg_bits(LMS7param(CCAL_LPFLAD_TBB), ccal_lpflad_tbb);
+    Modify_SPI_Reg_bits(LMS7param(ICT_IAMP_FRP_TBB), 1);
+    Modify_SPI_Reg_bits(LMS7param(ICT_IAMP_GG_FRP_TBB), 6);
+
+    if (type == TX_REALPOLE)
+        Modify_SPI_Reg_bits(LMS7param(RCAL_LPFS5_TBB), rcal);
+    else if (type == TX_LADDER)
+        Modify_SPI_Reg_bits(LMS7param(RCAL_LPFLAD_TBB), rcal);
+    else if (type == TX_HIGHBAND)
+    {
+        Modify_SPI_Reg_bits(LMS7param(RCAL_LPFH_TBB), rcal);
+        Modify_SPI_Reg_bits(0x0105, 4, 0, 0x7); //set powerdowns
+    }
+    return LIBLMS7_SUCCESS;
+}
+
+void LMS7002M::FilterTuning_AdjustGains()
+{
+    uint8_t cg_iamp_tbb;
+    uint32_t rssi = 0;
+    const uint32_t rssi_required = 0x8400;
+    uint8_t g_pga_rbb = (uint8_t)Get_SPI_Reg_bits(LMS7param(G_PGA_RBB));
+
+    while (g_pga_rbb < 31)
+    {
+        cg_iamp_tbb = 0;
+        while (cg_iamp_tbb < 63 && rssi < rssi_required)
+        {
+            Modify_SPI_Reg_bits(LMS7param(CG_IAMP_TBB), cg_iamp_tbb);
+            rssi = GetRSSI();
+            if (rssi > rssi_required)
+                return;
+            ++cg_iamp_tbb;
+        }
+        g_pga_rbb += 6;
+        if (g_pga_rbb > 31)
+            g_pga_rbb = 31;
+        Modify_SPI_Reg_bits(LMS7param(G_PGA_RBB), g_pga_rbb);
+    }
+}
+
+liblms7_status LMS7002M::TuneTxFilterLowBandChain(float_type bandwidth, float_type realpole_MHz)
+{
+    uint32_t rssi;
+    uint32_t rssi_value_10k;
+    bool prevRSSIbigger;
+    int16_t rcal;
+    float_type p1,p2,p3,p4,p5;
+    float_type ncoFreq = 0.05;
+    float_type cgenFreq;
+    BackupAllRegisters();
+
+    liblms7_status status = TuneTxFilter(TX_LADDER, bandwidth);
+    uint8_t ladder_c_value = (uint8_t)Get_SPI_Reg_bits(LMS7param(CCAL_LPFLAD_TBB));
+    uint8_t ladder_r_value = (uint8_t)Get_SPI_Reg_bits(LMS7param(RCAL_LPFLAD_TBB));
+    status = TuneTxFilterSetup(TX_LADDER, bandwidth);
+
+    if (bandwidth < gLadder_lower_limit || bandwidth > gLadder_higher_limit)
+    {
+        status = LIBLMS7_FREQUENCY_OUT_OF_RANGE;
+        goto TxFilterLowBandChainEnd;
+    }
+
+    //realpole calibration
+    //float userCLKGENfreq = GetFrequencyCGEN();
+
+    cgenFreq = realpole_MHz * 20;
+    if (cgenFreq < 60)
+        cgenFreq = 60;
+    if (cgenFreq > 640)
+        cgenFreq = 640;
+
+    if (realpole_MHz < gRealpole_lower_limit || realpole_MHz > gRealpole_higher_limit)
+    {
+        status = LIBLMS7_FREQUENCY_OUT_OF_RANGE;
+        goto TxFilterLowBandChainEnd;
+    }
+
+    status = SetFrequencyCGEN(cgenFreq);
+    if (status != LIBLMS7_SUCCESS)
+        goto TxFilterLowBandChainEnd;
+
+    Modify_SPI_Reg_bits(LMS7param(LOOPB_TBB), 3);
+    Modify_SPI_Reg_bits(LMS7param(CG_IAMP_TBB), 1);
+    Modify_SPI_Reg_bits(LMS7param(BYPLADDER_TBB), 1);
+    Modify_SPI_Reg_bits(LMS7param(TSTIN_TBB), 0);
+    Modify_SPI_Reg_bits(LMS7param(PD_LPFH_TBB), 1);
+    Modify_SPI_Reg_bits(LMS7param(PD_LPFIAMP_TBB), 0);
+    Modify_SPI_Reg_bits(LMS7param(PD_LPFLAD_TBB), 1);
+    Modify_SPI_Reg_bits(LMS7param(PD_LPFS5_TBB), 0);
+    Modify_SPI_Reg_bits(LMS7param(EN_G_TBB), 1);
+
+    //B
+    p1 = 1.93821841029921E-15;
+    p2 = -0.0429694461214244;
+    p3 = 0.253501254059498;
+    p4 = 88.9545445989649;
+    p5 = -48.0847491316861;
+    rcal = (int16_t)(pow(realpole_MHz, 4)*p1 + pow(realpole_MHz, 3)*p2 + pow(realpole_MHz, 2)*p3 + realpole_MHz * p4 + p5);
+    if (rcal < 0)
+        rcal = 0;
+    if (rcal > 255)
+        rcal = 255;
+    Modify_SPI_Reg_bits(LMS7param(RCAL_LPFS5_TBB), rcal);
+
+    FilterTuning_AdjustGains();
+
+    rssi_value_10k = GetRSSI();
+    SetNCOFrequency(Tx, 0, realpole_MHz);
+    SetNCOFrequency(Rx, 0, realpole_MHz - 1);
+
+    prevRSSIbigger = GetRSSI() > rssi_value_10k*0.707;
+    status = LIBLMS7_FAILURE; //assuming r value is not found
+    while (rcal >= 0 && rcal < 256)
+    {
+        Modify_SPI_Reg_bits(LMS7param(RCAL_LPFS5_TBB), rcal);
+        SetNCOFrequency(Tx, 0, ncoFreq);
+        SetNCOFrequency(Rx, 0, ncoFreq - 1);
+        rssi_value_10k = (uint32_t)( GetRSSI()*0.707 );
+
+        SetNCOFrequency(Tx, 0, realpole_MHz);
+        SetNCOFrequency(Rx, 0, realpole_MHz - 1);
+
+        rssi = GetRSSI();
+        if (rssi > rssi_value_10k)
+            --rcal;
+        else
+        {
+            if (prevRSSIbigger)
+            {
+                --rcal;
+                status = LIBLMS7_SUCCESS;
+                goto TxFilterLowBandChainEnd;
+            }
+            ++rcal;
+        }
+        prevRSSIbigger = rssi > rssi_value_10k;
+    }
+
+    //end
+TxFilterLowBandChainEnd:
+    RestoreAllRegisters();    
+    if (status != LIBLMS7_SUCCESS)
+        return status;
+
+    Modify_SPI_Reg_bits(LMS7param(CCAL_LPFLAD_TBB), ladder_c_value);
+    Modify_SPI_Reg_bits(LMS7param(RCAL_LPFLAD_TBB), ladder_r_value);
+    Modify_SPI_Reg_bits(LMS7param(ICT_IAMP_FRP_TBB), 1);
+    Modify_SPI_Reg_bits(LMS7param(ICT_IAMP_GG_FRP_TBB), 6);
+    Modify_SPI_Reg_bits(LMS7param(RCAL_LPFS5_TBB), rcal);
+    Modify_SPI_Reg_bits(0x0105, 4, 0, 0x11); //set powerdowns
+
+    return LIBLMS7_SUCCESS;
+}
+
+liblms7_status LMS7002M::TuneRxFilter(RxFilter filter, float_type bandwidth_MHz)
+{
+    liblms7_status status;
+    uint16_t cfb_tia_rfe;
+    uint16_t c_ctl_lpfl_rbb;
+    uint8_t ccomp_tia_rfe;
+    uint8_t rcomp_tia_rfe;
+    uint8_t c_ctl_lpfh_rbb;
+    uint8_t ict_pga_out;
+    uint8_t ict_pga_in;
+    uint8_t r_ctl_lpf_rbb;
+    uint8_t c_ctl_pga_rbb;
+    uint8_t rcc_ctl_lpfl_rbb;
+    uint8_t rcc_ctl_lpfh_rbb;
+    float_type lowerLimit;
+    float_type higherLimit;
+    if (filter == RX_TIA)
+    {
+        lowerLimit = Get_SPI_Reg_bits(LMS7param(G_TIA_RFE)) == 1 ? gRxTIA_lower_limit_g1 : gRxTIA_lower_limit_g23;
+        higherLimit = gRxTIA_higher_limit;
+    }
+    else if (filter == RX_LPF_LOWBAND)
+    {
+        lowerLimit = gRxLPF_low_lower_limit;
+        higherLimit = gRxLPF_low_higher_limit;
+    }
+    else if (filter == RX_LPF_HIGHBAND)
+    {
+        lowerLimit = gRxLPF_high_lower_limit;
+        higherLimit = gRxLPF_high_higher_limit;
+    }
+    if (bandwidth_MHz < lowerLimit || bandwidth_MHz > higherLimit)
+        return LIBLMS7_FREQUENCY_OUT_OF_RANGE;
+
+    BackupAllRegisters();
+
+    status = TuneRxFilterSetup(filter, bandwidth_MHz);
+    if (status != LIBLMS7_SUCCESS)
+        goto RxFilterTuneEnd;
+
+    if (filter == RX_TIA)
+        status = RFE_TIA_Calibration(bandwidth_MHz);
+    else if (filter == RX_LPF_LOWBAND)
+        status = RxLPFLow_Calibration(bandwidth_MHz);
+    else if (filter == RX_LPF_HIGHBAND)
+        status = RxLPFHigh_Calibration(bandwidth_MHz);
+
+    cfb_tia_rfe = Get_SPI_Reg_bits(LMS7param(CFB_TIA_RFE));
+    c_ctl_lpfl_rbb = Get_SPI_Reg_bits(LMS7param(C_CTL_LPFL_RBB));
+    ccomp_tia_rfe = (int8_t)Get_SPI_Reg_bits(LMS7param(CCOMP_TIA_RFE));
+    rcomp_tia_rfe = (int8_t)Get_SPI_Reg_bits(LMS7param(RCOMP_TIA_RFE));
+    c_ctl_lpfh_rbb = (int8_t)Get_SPI_Reg_bits(LMS7param(C_CTL_LPFH_RBB));
+    ict_pga_out = (int8_t)Get_SPI_Reg_bits(LMS7param(ICT_PGA_OUT_RBB));
+    ict_pga_in = (int8_t)Get_SPI_Reg_bits(LMS7param(ICT_PGA_IN_RBB));
+    r_ctl_lpf_rbb = (int8_t)Get_SPI_Reg_bits(LMS7param(R_CTL_LPF_RBB));
+    c_ctl_pga_rbb = (int8_t)Get_SPI_Reg_bits(LMS7param(C_CTL_PGA_RBB));
+    rcc_ctl_lpfl_rbb = (int8_t)Get_SPI_Reg_bits(LMS7param(RCC_CTL_LPFL_RBB));
+    rcc_ctl_lpfh_rbb = (int8_t)Get_SPI_Reg_bits(LMS7param(RCC_CTL_LPFH_RBB));
+
+RxFilterTuneEnd:
+    RestoreAllRegisters();
+    if (status != LIBLMS7_SUCCESS)
+        return status;
+
+    if (filter == RX_TIA)
+    {
+        Modify_SPI_Reg_bits(LMS7param(ICT_TIAMAIN_RFE), 2);
+        Modify_SPI_Reg_bits(LMS7param(ICT_TIAOUT_RFE), 2);
+        Modify_SPI_Reg_bits(LMS7param(RFB_TIA_RFE), 16);
+        Modify_SPI_Reg_bits(LMS7param(CFB_TIA_RFE), cfb_tia_rfe);
+        Modify_SPI_Reg_bits(LMS7param(CCOMP_TIA_RFE), ccomp_tia_rfe);
+        Modify_SPI_Reg_bits(LMS7param(RCOMP_TIA_RFE), rcomp_tia_rfe);
+        Modify_SPI_Reg_bits(0x010c, 1, 0, 0x1);
+    }
+    else if (filter == RX_LPF_LOWBAND)
+    {
+        Modify_SPI_Reg_bits(LMS7param(RCC_CTL_LPFL_RBB), rcc_ctl_lpfl_rbb);
+        Modify_SPI_Reg_bits(LMS7param(C_CTL_LPFL_RBB), c_ctl_lpfl_rbb);
+        Modify_SPI_Reg_bits(LMS7param(ICT_PGA_OUT_RBB), ict_pga_out);
+        Modify_SPI_Reg_bits(LMS7param(ICT_PGA_IN_RBB), ict_pga_in);
+        Modify_SPI_Reg_bits(LMS7param(R_CTL_LPF_RBB), r_ctl_lpf_rbb);
+        Modify_SPI_Reg_bits(LMS7param(C_CTL_PGA_RBB), c_ctl_pga_rbb);
+        Modify_SPI_Reg_bits(0x0115, 3, 0, 0x9);
+        Modify_SPI_Reg_bits(0x0118, 15, 13, 0x1);
+    }
+    else if (filter == RX_LPF_HIGHBAND)
+    {
+        Modify_SPI_Reg_bits(LMS7param(RCC_CTL_LPFH_RBB), rcc_ctl_lpfh_rbb);
+        Modify_SPI_Reg_bits(LMS7param(C_CTL_LPFH_RBB), c_ctl_lpfh_rbb);
+        Modify_SPI_Reg_bits(LMS7param(ICT_PGA_OUT_RBB), ict_pga_out);
+        Modify_SPI_Reg_bits(LMS7param(ICT_PGA_IN_RBB), ict_pga_in);
+        Modify_SPI_Reg_bits(LMS7param(R_CTL_LPF_RBB), r_ctl_lpf_rbb);
+        Modify_SPI_Reg_bits(LMS7param(C_CTL_PGA_RBB), c_ctl_pga_rbb);
+        Modify_SPI_Reg_bits(0x0115, 3, 0, 0x5);
+        Modify_SPI_Reg_bits(0x0118, 15, 13, 0x0);
+    }
+    return LIBLMS7_SUCCESS;
+}
+
+liblms7_status LMS7002M::TuneRxFilterSetup(RxFilter type, float_type cutoff_MHz)
+{
+    liblms7_status status;
+    uint8_t ch = (uint8_t)Get_SPI_Reg_bits(LMS7param(MAC));
+
+    //RFE
+    uint8_t g_tia_rfe = (uint8_t)Get_SPI_Reg_bits(LMS7param(G_TIA_RFE));
+    SetDefaults(RFE);
+    Modify_SPI_Reg_bits(LMS7param(SEL_PATH_RFE), 2);
+
+    if (ch == 2)
+        Modify_SPI_Reg_bits(LMS7param(EN_NEXTRX_RFE), 1);
+    else
+        Modify_SPI_Reg_bits(LMS7param(EN_NEXTRX_RFE), 0);
+
+    Modify_SPI_Reg_bits(LMS7param(G_RXLOOPB_RFE), 8);
+    Modify_SPI_Reg_bits(LMS7param(PD_RLOOPB_2_RFE), 0);
+    Modify_SPI_Reg_bits(LMS7param(EN_INSHSW_LB2_RFE), 0);
+    Modify_SPI_Reg_bits(LMS7param(PD_MXLOBUF_RFE), 0);
+    Modify_SPI_Reg_bits(LMS7param(PD_QGEN_RFE), 0);
+    Modify_SPI_Reg_bits(LMS7param(ICT_TIAMAIN_RFE), 2);
+    Modify_SPI_Reg_bits(LMS7param(ICT_TIAOUT_RFE), 2);
+    Modify_SPI_Reg_bits(LMS7param(RFB_TIA_RFE), 16);
+    Modify_SPI_Reg_bits(LMS7param(G_TIA_RFE), g_tia_rfe);
+
+    //RBB
+    SetDefaults(RBB);
+    Modify_SPI_Reg_bits(LMS7param(ICT_PGA_OUT_RBB), 20);
+    Modify_SPI_Reg_bits(LMS7param(ICT_PGA_IN_RBB), 20);
+    Modify_SPI_Reg_bits(LMS7param(C_CTL_PGA_RBB), 3);
+
+    //TRF
+    SetDefaults(TRF);
+    Modify_SPI_Reg_bits(LMS7param(L_LOOPB_TXPAD_TRF), 0);
+    Modify_SPI_Reg_bits(LMS7param(EN_LOOPB_TXPAD_TRF), 1);
+    if (ch == 2)
+        Modify_SPI_Reg_bits(LMS7param(EN_NEXTTX_TRF), 1);
+    else
+        Modify_SPI_Reg_bits(LMS7param(EN_NEXTTX_TRF), 0);
+    Modify_SPI_Reg_bits(LMS7param(SEL_BAND1_TRF), 0);
+    Modify_SPI_Reg_bits(LMS7param(SEL_BAND2_TRF), 1);
+
+    //TBB
+    SetDefaults(TBB);
+    Modify_SPI_Reg_bits(LMS7param(CG_IAMP_TBB), 1);
+    Modify_SPI_Reg_bits(LMS7param(ICT_IAMP_FRP_TBB), 1);
+    Modify_SPI_Reg_bits(LMS7param(ICT_IAMP_GG_FRP_TBB), 6);
+
+    //AFE
+    SetDefaults(AFE);
+    if (ch == 2)
+    {
+        Modify_SPI_Reg_bits(LMS7param(PD_TX_AFE2), 0);
+        Modify_SPI_Reg_bits(LMS7param(PD_RX_AFE2), 0);
+    }
+    //BIAS
+    uint8_t rp_calib_bias = (uint8_t)Get_SPI_Reg_bits(LMS7param(RP_CALIB_BIAS));
+    SetDefaults(BIAS);
+    Modify_SPI_Reg_bits(LMS7param(RP_CALIB_BIAS), rp_calib_bias);
+
+    //XBUF
+    Modify_SPI_Reg_bits(LMS7param(PD_XBUF_RX), 0);
+    Modify_SPI_Reg_bits(LMS7param(PD_XBUF_TX), 0);
+    Modify_SPI_Reg_bits(LMS7param(EN_G_TRF), 1);
+
+    //CLKGEN
+    SetDefaults(CGEN);
+
+    //SXR
+    Modify_SPI_Reg_bits(LMS7param(MAC), 1);
+    SetDefaults(SX);
+    status = SetFrequencySX(Rx, 499.95, mRefClkSXR_MHz);
+    if (status != LIBLMS7_SUCCESS)
+        return status;
+    Modify_SPI_Reg_bits(LMS7param(PD_VCO), 0);
+
+    //SXT
+    Modify_SPI_Reg_bits(LMS7param(MAC), 2);
+    SetDefaults(SX);
+    status = SetFrequencySX(Tx, 500, mRefClkSXT_MHz);
+    if (status != LIBLMS7_SUCCESS)
+        return status;
+    Modify_SPI_Reg_bits(LMS7param(PD_VCO), 0);
+
+    Modify_SPI_Reg_bits(LMS7param(MAC), ch);
+    //TxTSP
+    SetDefaults(TxTSP);
+    Modify_SPI_Reg_bits(LMS7param(TSGMODE_TXTSP), 1);
+    Modify_SPI_Reg_bits(LMS7param(INSEL_TXTSP), 1);
+    Modify_SPI_Reg_bits(0x0208, 8, 8, 1);
+    Modify_SPI_Reg_bits(0x0208, 6, 4, 0x7);
+    LoadDC_REG_IQ(Tx, (int16_t)0x7FFF, (int16_t)0x8000);
+    SetNCOFrequency(Tx, 0, 0);
+
+    //RxTSP
+    SetDefaults(RxTSP);
+    Modify_SPI_Reg_bits(LMS7param(AGC_MODE_RXTSP), 1);
+    Modify_SPI_Reg_bits(0x040C, 5, 3, 0x7);
+    Modify_SPI_Reg_bits(LMS7param(AGC_AVG_RXTSP), 7);
+    Modify_SPI_Reg_bits(LMS7param(CMIX_GAIN_RXTSP), 1);
+
+    float_type sxtfreq = GetFrequencySX_MHz(Tx, mRefClkSXT_MHz);
+    float_type sxrfreq = GetFrequencySX_MHz(Rx, mRefClkSXR_MHz);
+    SetNCOFrequency(Rx, 0, sxtfreq - sxrfreq - 1);
+    return LIBLMS7_SUCCESS;
+}
+
+liblms7_status LMS7002M::RFE_TIA_Calibration(float_type TIA_freq_MHz)
+{
+    liblms7_status status;
+    bool prevRSSIbigger;
+    uint8_t ccomp_tia_rfe_value;
+    int16_t rcomp_tia_rfe;
+    float_type cgenFreq = TIA_freq_MHz * 20;
+    uint32_t rssi;
+    uint32_t rssi_value_50k;
+    //RFE
+    uint8_t g_tia_rfe = (uint8_t)Get_SPI_Reg_bits(LMS7param(G_TIA_RFE));
+    int16_t cfb_tia_rfe_value;
+    if (g_tia_rfe == 1)
+        cfb_tia_rfe_value = (uint16_t)(5400 / TIA_freq_MHz - 15);
+    else if (g_tia_rfe > 1)
+        cfb_tia_rfe_value = (uint16_t)(1680 / TIA_freq_MHz - 10);
+    else
+        return LIBLMS7_FAILURE;
+    Modify_SPI_Reg_bits(LMS7param(CFB_TIA_RFE), cfb_tia_rfe_value);
+
+    if (g_tia_rfe == 1)
+        ccomp_tia_rfe_value = (uint8_t)(cfb_tia_rfe_value / 100 + 1);
+    else if (g_tia_rfe > 1)
+        ccomp_tia_rfe_value = (uint8_t)(cfb_tia_rfe_value / 100);
+    else
+        return LIBLMS7_FAILURE;
+    if (ccomp_tia_rfe_value > 15)
+        ccomp_tia_rfe_value = 15;
+
+    Modify_SPI_Reg_bits(LMS7param(CCOMP_TIA_RFE), ccomp_tia_rfe_value);
+
+    rcomp_tia_rfe = (int16_t)(15 - cfb_tia_rfe_value * 2 / 100);
+    if (rcomp_tia_rfe < 0)
+        rcomp_tia_rfe = 0;
+    Modify_SPI_Reg_bits(LMS7param(RCOMP_TIA_RFE), rcomp_tia_rfe);
+
+    //RBB
+    Modify_SPI_Reg_bits(LMS7param(INPUT_CTL_PGA_RBB), 2);
+    Modify_SPI_Reg_bits(LMS7param(PD_LPFL_RBB), 1);
+
+    //CLKGEN
+    if (cgenFreq < 60)
+        cgenFreq = 60;
+    if (cgenFreq > 640)
+        cgenFreq = 640;
+
+    if (cgenFreq / 16 == TIA_freq_MHz)
+        status = SetFrequencyCGEN(cgenFreq - 10);
+    else
+        status = SetFrequencyCGEN(cgenFreq);
+    if (status != LIBLMS7_SUCCESS)
+        return status;
+
+    FilterTuning_AdjustGains();
+
+    rssi_value_50k = (uint32_t)( GetRSSI() * 0.707 );
+    status = SetFrequencySX(Rx, GetFrequencySX_MHz(Tx, mRefClkSXT_MHz) - TIA_freq_MHz, mRefClkSXR_MHz);
+    if (status != LIBLMS7_SUCCESS)
+        return status;
+    SetNCOFrequency(Rx, 0, GetFrequencySX_MHz(Tx, mRefClkSXT_MHz) - GetFrequencySX_MHz(Rx, mRefClkSXR_MHz) - 1);
+
+    prevRSSIbigger = GetRSSI() > rssi_value_50k;
+    while (cfb_tia_rfe_value >= 0 && cfb_tia_rfe_value < 4096)
+    {
+        Modify_SPI_Reg_bits(LMS7param(CFB_TIA_RFE), cfb_tia_rfe_value);
+        rssi = GetRSSI();
+        if (rssi > rssi_value_50k)
+            ++cfb_tia_rfe_value;
+        else
+        {
+            --cfb_tia_rfe_value;
+            if (prevRSSIbigger)
+                return LIBLMS7_SUCCESS; //found correct value
+        }
+        prevRSSIbigger = rssi > rssi_value_50k;
+    }
+    return LIBLMS7_FAILURE;
+}
+
+liblms7_status LMS7002M::RxLPFLow_Calibration(float_type RxLPFL_freq_MHz)
+{
+    liblms7_status status;
+    uint32_t rssi;
+    uint32_t rssi_value_50k;
+    int32_t c_ctl_lpfl_rbb;
+    bool prevRSSIbigger;
+    float_type cgenFreq_MHz = RxLPFL_freq_MHz * 20;
+    //RFE
+    Modify_SPI_Reg_bits(LMS7param(CFB_TIA_RFE), 15);
+    Modify_SPI_Reg_bits(LMS7param(CCOMP_TIA_RFE), 1);
+    Modify_SPI_Reg_bits(LMS7param(RCOMP_TIA_RFE), 15);
+    Modify_SPI_Reg_bits(LMS7param(G_TIA_RFE), 1);
+
+    //RBB
+    c_ctl_lpfl_rbb = (int32_t)(2160 / RxLPFL_freq_MHz - 103);
+    if (c_ctl_lpfl_rbb < 0)
+        c_ctl_lpfl_rbb = 0;
+    if (c_ctl_lpfl_rbb > 2047)
+        c_ctl_lpfl_rbb = 2047;
+    Modify_SPI_Reg_bits(LMS7param(C_CTL_LPFL_RBB), c_ctl_lpfl_rbb);
+
+    if (RxLPFL_freq_MHz >= 15)
+        Modify_SPI_Reg_bits(LMS7param(RCC_CTL_LPFL_RBB), 5);
+    else if (RxLPFL_freq_MHz >= 10)
+        Modify_SPI_Reg_bits(LMS7param(RCC_CTL_LPFL_RBB), 4);
+    else if (RxLPFL_freq_MHz >= 5)
+        Modify_SPI_Reg_bits(LMS7param(RCC_CTL_LPFL_RBB), 3);
+    else if (RxLPFL_freq_MHz >= 3)
+        Modify_SPI_Reg_bits(LMS7param(RCC_CTL_LPFL_RBB), 2);
+    else if (RxLPFL_freq_MHz >= 1.4)
+        Modify_SPI_Reg_bits(LMS7param(RCC_CTL_LPFL_RBB), 1);
+    else
+        Modify_SPI_Reg_bits(LMS7param(RCC_CTL_LPFL_RBB), 0);
+
+    //CLKGEN
+    if (cgenFreq_MHz < 60)
+        cgenFreq_MHz = 60;
+    if (cgenFreq_MHz > 640)
+        cgenFreq_MHz = 640;
+    if (cgenFreq_MHz / 16 == RxLPFL_freq_MHz)
+        status = SetFrequencyCGEN(cgenFreq_MHz - 10);
+    else
+        status = SetFrequencyCGEN(cgenFreq_MHz);
+    if (status != LIBLMS7_SUCCESS)
+        return status;
+
+    FilterTuning_AdjustGains();
+
+    rssi_value_50k = (uint32_t)( GetRSSI() * 0.707 );
+    status = SetFrequencySX(Rx, GetFrequencySX_MHz(Tx, mRefClkSXT_MHz) - RxLPFL_freq_MHz, mRefClkSXR_MHz);
+    if (status != LIBLMS7_SUCCESS)
+        return status;
+    SetNCOFrequency(Rx, 0, GetFrequencySX_MHz(Tx, mRefClkSXT_MHz) - GetFrequencySX_MHz(Rx, mRefClkSXR_MHz) - 1);
+
+    prevRSSIbigger = GetRSSI() > rssi_value_50k;
+    while (c_ctl_lpfl_rbb >= 0 && c_ctl_lpfl_rbb < 2048)
+    {
+        Modify_SPI_Reg_bits(LMS7param(C_CTL_LPFL_RBB), c_ctl_lpfl_rbb);
+        rssi = GetRSSI();
+        if (rssi > rssi_value_50k)
+            ++c_ctl_lpfl_rbb;
+        else
+        {
+            --c_ctl_lpfl_rbb;
+            if (prevRSSIbigger)
+                return LIBLMS7_SUCCESS; //found correct value
+        }
+        prevRSSIbigger = rssi > rssi_value_50k;
+    }
+    return LIBLMS7_FAILURE;
+}
+
+liblms7_status LMS7002M::RxLPFHigh_Calibration(float_type RxLPFH_freq_MHz)
+{
+    liblms7_status status;
+    int16_t c_ctl_lpfh_rbb;
+    int16_t rcc_ctl_lpfh_rbb;
+    float_type cgenFreq = RxLPFH_freq_MHz * 20;
+    uint32_t rssi;
+    uint32_t rssi_value_50k;
+    bool prevRSSIbigger;
+    //RFE
+    Modify_SPI_Reg_bits(LMS7param(CFB_TIA_RFE), 15);
+    Modify_SPI_Reg_bits(LMS7param(CCOMP_TIA_RFE), 1);
+    Modify_SPI_Reg_bits(LMS7param(RCOMP_TIA_RFE), 15);
+    Modify_SPI_Reg_bits(LMS7param(G_TIA_RFE), 1);
+
+    //RBB
+    c_ctl_lpfh_rbb = (int16_t)(6000 / RxLPFH_freq_MHz - 50);
+    if (c_ctl_lpfh_rbb < 0)
+        c_ctl_lpfh_rbb = 0;
+    if (c_ctl_lpfh_rbb > 255)
+        c_ctl_lpfh_rbb = 255;
+    Modify_SPI_Reg_bits(LMS7param(C_CTL_LPFH_RBB), c_ctl_lpfh_rbb);
+
+    rcc_ctl_lpfh_rbb = (int16_t)(RxLPFH_freq_MHz / 10 - 3);
+    if (rcc_ctl_lpfh_rbb < 0)
+        rcc_ctl_lpfh_rbb = 0;
+    Modify_SPI_Reg_bits(LMS7param(RCC_CTL_LPFH_RBB), rcc_ctl_lpfh_rbb);
+
+    Modify_SPI_Reg_bits(LMS7param(INPUT_CTL_PGA_RBB), 1);
+    Modify_SPI_Reg_bits(LMS7param(PD_LPFL_RBB), 1);
+    Modify_SPI_Reg_bits(LMS7param(PD_LPFH_RBB), 0);
+
+    //CLKGEN
+    if (cgenFreq < 60)
+        cgenFreq = 60;
+    if (cgenFreq > 640)
+        cgenFreq = 640;
+    if (cgenFreq / 16 == RxLPFH_freq_MHz)
+        status = SetFrequencyCGEN(cgenFreq - 10);
+    else
+        status = SetFrequencyCGEN(cgenFreq);
+    if (status != LIBLMS7_SUCCESS)
+        return status;
+
+    FilterTuning_AdjustGains();
+
+    rssi_value_50k = (uint32_t)( GetRSSI() * 0.707);
+    status = SetFrequencySX(Rx, GetFrequencySX_MHz(Tx, mRefClkSXT_MHz) - RxLPFH_freq_MHz, mRefClkSXR_MHz);
+    if (status != LIBLMS7_SUCCESS)
+        return status;
+    SetNCOFrequency(Rx, 0, GetFrequencySX_MHz(Tx, mRefClkSXT_MHz) - GetFrequencySX_MHz(Rx, mRefClkSXR_MHz) - 1);
+
+    prevRSSIbigger = GetRSSI() > rssi_value_50k;
+    while (c_ctl_lpfh_rbb >= 0 && c_ctl_lpfh_rbb < 256)
+    {
+        Modify_SPI_Reg_bits(LMS7param(C_CTL_LPFH_RBB), c_ctl_lpfh_rbb);
+        rssi = GetRSSI();
+        if (rssi > rssi_value_50k)
+            ++c_ctl_lpfh_rbb;
+        else
+        {
+            --c_ctl_lpfh_rbb;
+            if (prevRSSIbigger)
+                return LIBLMS7_SUCCESS; //found correct value
+        }
+        prevRSSIbigger = rssi > rssi_value_50k;
+    }
+    return LIBLMS7_FAILURE;
+}
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_parameters.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_parameters.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..b28887d776de04f458c823529a6697ebb425fc32
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_parameters.cpp
@@ -0,0 +1,601 @@
+/**
+@file	LMS7002M_parameters.cpp
+@author Lime Microsystems (www.limemicro.com)
+@brief 	Definition of LMS7002M transceiver control parameters registers
+*/
+
+#include "LMS7002M_parameters.h"
+
+std::vector<const LMS7Parameter*> LMS7parameterList;
+
+const struct LMS7Parameter LRST_TX_B = { 0x0020, 15, 15, 1, "LRST_TX_B", "Resets all the logic registers to the default state for Tx MIMO channel B" };
+const struct LMS7Parameter MRST_TX_B = { 0x0020, 14, 14, 1, "MRST_TX_B", "Resets all the configuration memory to the default state for Tx MIMO channel B" };
+const struct LMS7Parameter LRST_TX_A = { 0x0020, 13, 13, 1, "LRST_TX_A", "Resets all the logic registers to the default state for Tx MIMO channel A" };
+const struct LMS7Parameter MRST_TX_A = { 0x0020, 12, 12, 1, "MRST_TX_A", "Resets all the configuration memory to the default state for Tx MIMO channel A" };
+const struct LMS7Parameter LRST_RX_B = { 0x0020, 11, 11, 1, "LRST_RX_B", "Resets all the logic registers to the default state for Rx MIMO channel B" };
+const struct LMS7Parameter MRST_RX_B = { 0x0020, 10, 10, 1, "MRST_RX_B", "Resets all the configuration memory to the default state for Rx MIMO channel B" };
+const struct LMS7Parameter LRST_RX_A = { 0x0020, 9, 9, 1, "LRST_RX_A", "Resets all the logic registers to the default state for Rx MIMO channel A" };
+const struct LMS7Parameter MRST_RX_A = { 0x0020, 8, 8, 1, "MRST_RX_A", "Resets all the configuration memory to the default state for Rx MIMO channel A" };
+const struct LMS7Parameter SRST_RXFIFO = { 0x0020, 7, 7, 1, "SRST_RXFIFO", "RX FIFO soft reset (LimeLight Interface)" };
+const struct LMS7Parameter SRST_TXFIFO = { 0x0020, 6, 6, 1, "SRST_TXFIFO", "TX FIFO soft reset (LimeLight Interface)" };
+const struct LMS7Parameter RXEN_B = { 0x0020, 5, 5, 1, "RXEN_B", "Power control for Rx MIMO channel B" };
+const struct LMS7Parameter RXEN_A = { 0x0020, 4, 4, 1, "RXEN_A", "Power control for Rx MIMO channel A" };
+const struct LMS7Parameter TXEN_B = { 0x0020, 3, 3, 1, "TXEN_B", "Power control for Tx MIMO channel B" };
+const struct LMS7Parameter TXEN_A = { 0x0020, 2, 2, 1, "TXEN_A", "Power control for Tx MIMO channel A" };
+const struct LMS7Parameter MAC = { 0x0020, 1, 0, 3, "MAC", "Selects MIMO channel for communication" };
+const struct LMS7Parameter TX_CLK_PE = { 0x0021, 11, 11, 1, "TX_CLK_PE", "Pull up control of TX_CLK pad" };
+const struct LMS7Parameter RX_CLK_PE = { 0x0021, 10, 10, 1, "RX_CLK_PE", "Pull up control of RX_CLK pad" };
+const struct LMS7Parameter SDA_PE = { 0x0021, 9, 9, 1, "SDA_PE", "Pull up control of SDA pad" };
+const struct LMS7Parameter SDA_DS = { 0x0021, 8, 8, 0, "SDA_DS", "Driver strength of SDA pad" };
+const struct LMS7Parameter SCL_PE = { 0x0021, 7, 7, 1, "SCL_PE", "Pull up control of SCL pad" };
+const struct LMS7Parameter SCL_DS = { 0x0021, 6, 6, 0, "SCL_DS", "Driver strength of SCL pad" };
+const struct LMS7Parameter SDIO_DS = { 0x0021, 5, 5, 0, "SDIO_DS", "Driver strength of SDIO pad" };
+const struct LMS7Parameter SDIO_PE = { 0x0021, 4, 4, 1, "SDIO_PE", "Pull up control of SDIO pad" };
+const struct LMS7Parameter SDO_PE = { 0x0021, 3, 3, 1, "SDO_PE", "Pull up control of SDO pad" };
+const struct LMS7Parameter SCLK_PE = { 0x0021, 2, 2, 1, "SCLK_PE", "Pull up control of SCLK pad" };
+const struct LMS7Parameter SEN_PE = { 0x0021, 1, 1, 1, "SEN_PE", "Pull up control of SEN pad" };
+const struct LMS7Parameter SPIMODE = { 0x0021, 0, 0, 1, "SPIMODE", "SPI communication mode" };
+const struct LMS7Parameter DIQ2_DS = { 0x0022, 11, 11, 0, "DIQ2_DS", "Driver strength of DIQ2 pad" };
+const struct LMS7Parameter DIQ2_PE = { 0x0022, 10, 10, 1, "DIQ2_PE", "Pull up control of DIQ2 pad" };
+const struct LMS7Parameter IQ_SEL_EN_2_PE = { 0x0022, 9, 9, 1, "IQ_SEL_EN_2_PE", "Pull up control of IQ_SEL_EN_2 pad" };
+const struct LMS7Parameter TXNRX2_PE = { 0x0022, 8, 8, 1, "TXNRX2_PE", "Pull up control of TXNRX2 pad" };
+const struct LMS7Parameter FCLK2_PE = { 0x0022, 7, 7, 1, "FCLK2_PE", "Pull up control of FCLK2 pad" };
+const struct LMS7Parameter MCLK2_PE = { 0x0022, 6, 6, 1, "MCLK2_PE", "Pull up control of MCLK2 pad" };
+const struct LMS7Parameter DIQ1_DS = { 0x0022, 5, 5, 0, "DIQ1_DS", "Pull up control of MCLK2 pad" };
+const struct LMS7Parameter DIQ1_PE = { 0x0022, 4, 4, 1, "DIQ1_PE", "Pull up control of DIQ1 pad" };
+const struct LMS7Parameter IQ_SEL_EN_1_PE = { 0x0022, 3, 3, 1, "IQ_SEL_EN_1_PE", "Pull up control of IQ_SEL_EN_1 pad" };
+const struct LMS7Parameter TXNRX1_PE = { 0x0022, 2, 2, 1, "TXNRX1_PE", "Pull up control of TXNRX1 pad" };
+const struct LMS7Parameter FCLK1_PE = { 0x0022, 1, 1, 1, "FCLK1_PE", "Pull up control of FCLK1 pad" };
+const struct LMS7Parameter MCLK1_PE = { 0x0022, 0, 0, 1, "MCLK1_PE", "Pull up control of MCLK1 pad" };
+const struct LMS7Parameter DIQDIRCTR2 = { 0x0023, 15, 15, 0, "DIQDIRCTR2", "DIQ2 direction control mode" };
+const struct LMS7Parameter DIQDIR2 = { 0x0023, 14, 14, 1, "DIQDIR2", "DIQ2 direction" };
+const struct LMS7Parameter DIQDIRCTR1 = { 0x0023, 13, 13, 0, "DIQDIRCTR1", "DIQ1 direction control mode" };
+const struct LMS7Parameter DIQDIR1 = { 0x0023, 12, 12, 1, "DIQDIR1", "DIQ1 direction" };
+const struct LMS7Parameter ENABLEDIRCTR2 = { 0x0023, 11, 11, 0, "ENABLEDIRCTR2", "ENABLE2 direction control mode" };
+const struct LMS7Parameter ENABLEDIR2 = { 0x0023, 10, 10, 1, "ENABLEDIR2", "ENABLE2 direction" };
+const struct LMS7Parameter ENABLEDIRCTR1 = { 0x0023, 9, 9, 0, "ENABLEDIRCTR1", "ENABLE1 direction control mode" };
+const struct LMS7Parameter ENABLEDIR1 = { 0x0023, 8, 8, 1, "ENABLEDIR1", "ENABLE1 direction." };
+const struct LMS7Parameter MOD_EN = { 0x0023, 6, 6, 1, "MOD_EN", "LimeLight interface enable" };
+const struct LMS7Parameter LML2_FIDM = { 0x0023, 5, 5, 0, "LML2_FIDM", "Frame start ID selection for Port 2 when LML_MODE2 = 0" };
+const struct LMS7Parameter LML2_TXNRXIQ = { 0x0023, 4, 4, 1, "LML2_TXNRXIQ", "TXIQ/RXIQ mode selection for Port 2 when LML_MODE2 = 0" };
+const struct LMS7Parameter LML2_MODE = { 0x0023, 3, 3, 1, "LML2_MODE", "Mode of LimeLight Port 2" };
+const struct LMS7Parameter LML1_FIDM = { 0x0023, 2, 2, 0, "LML1_FIDM", "Frame start ID selection for Port 1 when LML_MODE1 = 0" };
+const struct LMS7Parameter LML1_TXNRXIQ = { 0x0023, 1, 1, 0, "LML1_TXNRXIQ", "TXIQ/RXIQ mode selection for Port 1 when LML_MODE1 = 0" };
+const struct LMS7Parameter LML1_MODE = { 0x0023, 0, 0, 1, "LML1_MODE", "Mode of LimeLight Port 1" };
+const struct LMS7Parameter LML1_S3S = { 0x0024, 15, 14, 3, "LML1_S3S", "Sample source in position 3, when Port 1 is RF2BB" };
+const struct LMS7Parameter LML1_S2S = { 0x0024, 13, 12, 2, "LML1_S2S", "Sample source in position 2, when Port 1 is RF2BB" };
+const struct LMS7Parameter LML1_S1S = { 0x0024, 11, 10, 1, "LML1_S1S", "Sample source in position 1, when Port 1 is RF2BB" };
+const struct LMS7Parameter LML1_S0S = { 0x0024, 9, 8, 0, "LML1_S0S", "Sample source in position 0, when Port 1 is RF2BB" };
+const struct LMS7Parameter LML1_BQP = { 0x0024, 7, 6, 3, "LML1_BQP", "BQ sample position in frame, when Port 1 is BB2RF" };
+const struct LMS7Parameter LML1_BIP = { 0x0024, 5, 4, 2, "LML1_BIP", "BI sample position in frame, when Port 1 is BB2RF" };
+const struct LMS7Parameter LML1_AQP = { 0x0024, 3, 2, 1, "LML1_AQP", "AQ sample position in frame, when Port 1 is BB2RF" };
+const struct LMS7Parameter LML1_AIP = { 0x0024, 1, 0, 0, "LML1_AIP", "AI sample position in frame, when Port 1 is BB2RF" };
+const struct LMS7Parameter LML1_BB2RF_PST = { 0x0025, 15, 8, 1, "LML1_BB2RF_PST", "Number of clock cycles to wait before data drive stop after burst stop is detected in JESD207 mode on Port 1 and Port 1 BB2RF" };
+const struct LMS7Parameter LML1_BB2RF_PRE = { 0x0025, 7, 0, 1, "LML1_BB2RF_PRE", "Number of clock cycles to wait before data drive start after burst start is detected in JESD207 mode on Port 1 and Port 1 BB2RF" };
+const struct LMS7Parameter LML1_RF2BB_PST = { 0x0026, 15, 8, 1, "LML1_RF2BB_PST", "Number of clock cycles to wait before data capture stop after burst stop is detected in JESD207 mode on Port 1 and Port 1 is RF2BB" };
+const struct LMS7Parameter LML1_RF2BB_PRE = { 0x0026, 7, 0, 1, "LML1_RF2BB_PRE", "Number of clock cycles to wait before data capture start after burst start is detected in JESD207 mode on Port 1 and Port 1 RF2BB" };
+const struct LMS7Parameter LML2_S3S = { 0x0027, 15, 14, 3, "LML2_S3S", "Sample source in position 3, when Port 2 is RF2BB" };
+const struct LMS7Parameter LML2_S2S = { 0x0027, 13, 12, 2, "LML2_S2S", "Sample source in position 2, when Port 2 is RF2BB" };
+const struct LMS7Parameter LML2_S1S = { 0x0027, 11, 10, 1, "LML2_S1S", "Sample source in position 1, when Port 2 is RF2BB" };
+const struct LMS7Parameter LML2_S0S = { 0x0027, 9, 8, 0, "LML2_S0S", "Sample source in position 0, when Port 2 is RF2BB" };
+const struct LMS7Parameter LML2_BQP = { 0x0027, 7, 6, 3, "LML2_BQP", "BQ sample position in frame, when Port 2 is BB2RF" };
+const struct LMS7Parameter LML2_BIP = { 0x0027, 5, 4, 2, "LML2_BIP", "BI sample position in frame, when Port 2 is BB2RF" };
+const struct LMS7Parameter LML2_AQP = { 0x0027, 3, 2, 1, "LML2_AQP", "AQ sample position in frame, when Port 2 is BB2RF" };
+const struct LMS7Parameter LML2_AIP = { 0x0027, 1, 0, 0, "LML2_AIP", "AI sample position in frame, when Port 2 is BB2RF" };
+const struct LMS7Parameter LML2_BB2RF_PST = { 0x0028, 15, 8, 1, "LML2_BB2RF_PST", "Number of clock cycles to wait before data drive stop after burst stop is detected in JESD207 mode on Port 2 and Port 2 BB2RF" };
+const struct LMS7Parameter LML2_BB2RF_PRE = { 0x0028, 7, 0, 1, "LML2_BB2RF_PRE", "Number of clock cycles to wait before data drive start after burst start is detected in JESD207 mode on Port 2 and Port 2 BB2RF" };
+const struct LMS7Parameter LML2_RF2BB_PST = { 0x0029, 15, 8, 1, "LML2_RF2BB_PST", "Number of clock cycles to wait before data capture stop after burst stop is detected in JESD207 mode on Port 2 and Port 2 RF2BB" };
+const struct LMS7Parameter LML2_RF2BB_PRE = { 0x0029, 7, 0, 1, "LML2_RF2BB_PRE", "Number of clock cycles to wait before data capture start after burst start is detected in JESD207 mode on Port 2 and Port 2 RF2BB" };
+const struct LMS7Parameter FCLK2_DLY = { 0x002A, 15, 14, 0, "FCLK2_DLY", "" };
+const struct LMS7Parameter FCLK1_DLY = { 0x002A, 13, 12, 0, "FCLK1_DLY", "" };
+const struct LMS7Parameter RX_MUX = { 0x002A, 11, 10, 0, "RX_MUX", "RxFIFO data source selection" };
+const struct LMS7Parameter TX_MUX = { 0x002A, 9, 8, 0, "TX_MUX", "Port selection for data transmit to TSP" };
+const struct LMS7Parameter TXRDCLK_MUX = { 0x002A, 7, 6, 2, "TXRDCLK_MUX", "TX FIFO read clock selection" };
+const struct LMS7Parameter TXWRCLK_MUX = { 0x002A, 5, 4, 0, "TXWRCLK_MUX", "TX FIFO write clock selection" };
+const struct LMS7Parameter RXRDCLK_MUX = { 0x002A, 3, 2, 1, "RXRDCLK_MUX", "RX FIFO read clock selection" };
+const struct LMS7Parameter RXWRCLK_MUX = { 0x002A, 1, 0, 2, "RXWRCLK_MUX", "RX FIFO write clock selection" };
+const struct LMS7Parameter FCLK2_INV = { 0x002B, 15, 15, 0, "FCLK2_INV", "FCLK2 clock inversion" };
+const struct LMS7Parameter FCLK1_INV = { 0x002B, 14, 14, 0, "FCLK1_INV", "FCLK1 clock inversion" };
+const struct LMS7Parameter MCLK2DLY = { 0x002B, 13, 12, 0, "MCLK2DLY", "MCLK2 clock internal delay" };
+const struct LMS7Parameter MCLK1DLY = { 0x002B, 11, 10, 0, "MCLK1DLY", "MCLK1 clock internal delay" };
+const struct LMS7Parameter MCLK2SRC = { 0x002B, 5, 4, 1, "MCLK2SRC", "MCLK2 clock source" };
+const struct LMS7Parameter MCLK1SRC = { 0x002B, 3, 2, 0, "MCLK1SRC", "MCLK1 clock source" };
+const struct LMS7Parameter TXDIVEN = { 0x002B, 1, 1, 0, "TXDIVEN", "TX clock divider enable" };
+const struct LMS7Parameter RXDIVEN = { 0x002B, 0, 0, 0, "RXDIVEN", "RX clock divider enable" };
+const struct LMS7Parameter TXTSPCLKA_DIV = { 0x002C, 15, 8, 255, "TXTSPCLKA_DIV", "TxTSP clock divider, used to produce MCLK(1/2). Clock division ratio is 2(TXTSPCLKA_DIV + 1)"};
+const struct LMS7Parameter RXTSPCLKA_DIV = { 0x002C, 7, 0, 255, "RXTSPCLKA_DIV", "RxTSP clock divider, used to produce MCLK(1/2). Clock division ratio is 2(RXTSPCLKA_DIV + 1)"};
+const struct LMS7Parameter MIMO_SISO = { 0x002E, 15, 15, 0, "MIMO_SISO", "MIMO channel B enable control" };
+const struct LMS7Parameter VER = { 0x002F, 15, 11, 7, "VER", "" };
+const struct LMS7Parameter REV = { 0x002F, 10, 6, 1, "REV", "" };
+const struct LMS7Parameter MASK = { 0x002F, 5, 0, 0, "MASK", "" };
+const struct LMS7Parameter EN_DIR_LDO = { 0x0081, 3, 3, 0, "EN_DIR_LDO", "" };
+const struct LMS7Parameter EN_DIR_CGEN = { 0x0081, 2, 2, 0, "EN_DIR_CGEN", "" };
+const struct LMS7Parameter EN_DIR_XBUF = { 0x0081, 1, 1, 0, "EN_DIR_XBUF", "" };
+const struct LMS7Parameter EN_DIR_AFE = { 0x0081, 0, 0, 0, "EN_DIR_AFE", "" };
+const struct LMS7Parameter ISEL_DAC_AFE = { 0x0082, 15, 13, 4, "ISEL_DAC_AFE", "Controls the peak current of the DAC output current" };
+const struct LMS7Parameter MODE_INTERLEAVE_AFE = { 0x0082, 12, 12, 0, "MODE_INTERLEAVE_AFE", "time interleaves the two ADCs into one ADC" };
+const struct LMS7Parameter MUX_AFE_1 = { 0x0082, 11, 10, 0, "MUX_AFE_1", "Controls the MUX at the input of the ADC channel 1" };
+const struct LMS7Parameter MUX_AFE_2 = { 0x0082, 9, 8, 0, "MUX_AFE_2", "Controls the MUX at the input of the ADC channel 2" };
+const struct LMS7Parameter PD_AFE = { 0x0082, 5, 5, 0, "PD_AFE", "Power down control for the AFE current mirror in BIAS_TOP" };
+const struct LMS7Parameter PD_RX_AFE1 = { 0x0082, 4, 4, 0, "PD_RX_AFE1", "Power down control for the ADC of  channel 1" };
+const struct LMS7Parameter PD_RX_AFE2 = { 0x0082, 3, 3, 1, "PD_RX_AFE2", "Power down control for the ADC of channel 2" };
+const struct LMS7Parameter PD_TX_AFE1 = { 0x0082, 2, 2, 0, "PD_TX_AFE1", "Power down control for the DAC of channel 1" };
+const struct LMS7Parameter PD_TX_AFE2 = { 0x0082, 1, 1, 1, "PD_TX_AFE2", "Power down control for the DAC of channel 2" };
+const struct LMS7Parameter EN_G_AFE = { 0x0082, 0, 0, 1, "EN_G_AFE", "Enable control for all the AFE power downs" };
+const struct LMS7Parameter MUX_BIAS_OUT = { 0x0084, 12, 11, 0, "MUX_BIAS_OUT", "Test mode of the BIAS_TOP" };
+const struct LMS7Parameter RP_CALIB_BIAS = { 0x0084, 10, 6, 16, "RP_CALIB_BIAS", "Calibration code for rppolywo. This code is set by the calibration algorithm: BIAS_RPPOLY_calibration" };
+const struct LMS7Parameter PD_FRP_BIAS = { 0x0084, 4, 4, 0, "PD_FRP_BIAS", "Power down signal for Fix/RP block" };
+const struct LMS7Parameter PD_F_BIAS = { 0x0084, 3, 3, 0, "PD_F_BIAS", "Power down signal for Fix" };
+const struct LMS7Parameter PD_PTRP_BIAS = { 0x0084, 2, 2, 0, "PD_PTRP_BIAS", "Power down signal for PTAT/RP block" };
+const struct LMS7Parameter PD_PT_BIAS = { 0x0084, 1, 1, 0, "PD_PT_BIAS", "Power down signal for PTAT block" };
+const struct LMS7Parameter PD_BIAS_MASTER = { 0x0084, 0, 0, 0, "PD_BIAS_MASTER", "Enable signal for central bias block" };
+const struct LMS7Parameter SLFB_XBUF_RX = { 0x0085, 8, 8, 0, "SLFB_XBUF_RX", "Self biasing digital contol SLFB_XBUF_RX" };
+const struct LMS7Parameter SLFB_XBUF_TX = { 0x0085, 7, 7, 0, "SLFB_XBUF_TX", "Self biasing digital contol SLFB_XBUF_TX" };
+const struct LMS7Parameter BYP_XBUF_RX = { 0x0085, 6, 6, 0, "BYP_XBUF_RX", "Shorts the Input 3.3V buffer in XBUF" };
+const struct LMS7Parameter BYP_XBUF_TX = { 0x0085, 5, 5, 0, "BYP_XBUF_TX", "Shorts the Input 3.3V buffer in XBUF" };
+const struct LMS7Parameter EN_OUT2_XBUF_TX = { 0x0085, 4, 4, 0, "EN_OUT2_XBUF_TX", "Enables the 2nd output of TX XBUF. This 2nd buffer goes to XBUF_RX. This should be active when only 1 XBUF is to be used" };
+const struct LMS7Parameter EN_TBUFIN_XBUF_RX = { 0x0085, 3, 3, 0, "EN_TBUFIN_XBUF_RX", "Disables the input from the external XOSC and buffers the 2nd input signal (from TX XBUF 2nd output) to the RX. This should be active when only 1 XBUF is to be used" };
+const struct LMS7Parameter PD_XBUF_RX = { 0x0085, 2, 2, 0, "PD_XBUF_RX", "Power down signal PD_XBUF_RX" };
+const struct LMS7Parameter PD_XBUF_TX = { 0x0085, 1, 1, 0, "PD_XBUF_TX", "Power down signal PD_XBUF_TX" };
+const struct LMS7Parameter EN_G_XBUF = { 0x0085, 0, 0, 1, "EN_G_XBUF", "Enable control for all the XBUF power downs" };
+const struct LMS7Parameter SPDUP_VCO_CGEN = { 0x0086, 15, 15, 0, "SPDUP_VCO_CGEN", "Bypasses the noise filter resistor for fast setlling time. It should be connected to a 1us pulse" };
+const struct LMS7Parameter RESET_N_CGEN = { 0x0086, 14, 14, 1, "RESET_N_CGEN", "A pulse should be used in the start-up to reset ( 1-normal operation)" };
+const struct LMS7Parameter EN_ADCCLKH_CLKGN = { 0x0086, 11, 11, 1, "EN_ADCCLKH_CLKGN", "Selects if F_CLKH or F_CLKL is connected to FCLK_ADC" };
+const struct LMS7Parameter EN_COARSE_CKLGEN = { 0x0086, 10, 10, 0, "EN_COARSE_CKLGEN", "Enable signal for coarse tuning block" };
+const struct LMS7Parameter EN_INTONLY_SDM_CGEN = { 0x0086, 9, 9, 0, "EN_INTONLY_SDM_CGEN", "Enables INTEGER-N mode of the SX " };
+const struct LMS7Parameter EN_SDM_CLK_CGEN = { 0x0086, 8, 8, 1, "EN_SDM_CLK_CGEN", "Enables/Disables SDM clock. In INT-N mode or for noise testing, SDM clock can be disabled" };
+const struct LMS7Parameter PD_CP_CGEN = { 0x0086, 6, 6, 0, "PD_CP_CGEN", "Power down for Charge Pump" };
+const struct LMS7Parameter PD_FDIV_FB_CGEN = { 0x0086, 5, 5, 0, "PD_FDIV_FB_CGEN", "Power down for feedback frequency divider" };
+const struct LMS7Parameter PD_FDIV_O_CGEN = { 0x0086, 4, 4, 0, "PD_FDIV_O_CGEN", "Power down for forward frequency divider of the CGEN block" };
+const struct LMS7Parameter PD_SDM_CGEN = { 0x0086, 3, 3, 0, "PD_SDM_CGEN", "Power down for SDM" };
+const struct LMS7Parameter PD_VCO_CGEN = { 0x0086, 2, 2, 0, "PD_VCO_CGEN", "Power down for VCO" };
+const struct LMS7Parameter PD_VCO_COMP_CGEN = { 0x0086, 1, 1, 0, "PD_VCO_COMP_CGEN", "Power down for VCO comparator" };
+const struct LMS7Parameter EN_G_CGEN = { 0x0086, 0, 0, 1, "EN_G_CGEN", "Enable control for all the CGEN power downs" };
+const struct LMS7Parameter FRAC_SDM_CGEN_LSB = { 0x0087, 15, 0, 0x0400, "FRAC_SDM_CGEN_LSB", "" };
+const struct LMS7Parameter INT_SDM_CGEN = { 0x0088, 13, 4, 120, "INT_SDM_CGEN", "" };
+const struct LMS7Parameter FRAC_SDM_CGEN_MSB = { 0x0088, 3, 0, 0, "FRAC_SDM_CGEN_MSB", "" };
+const struct LMS7Parameter REV_SDMCLK_CGEN = { 0x0089, 15, 15, 0, "REV_SDMCLK_CGEN", "Reverses the SDM clock" };
+const struct LMS7Parameter SEL_SDMCLK_CGEN = { 0x0089, 14, 14, 0, "SEL_SDMCLK_CGEN", "Selects between the feedback divider output and Fref for SDM" };
+const struct LMS7Parameter SX_DITHER_EN_CGEN = { 0x0089, 13, 13, 0, "SX_DITHER_EN_CGEN", "Enabled dithering in SDM" };
+const struct LMS7Parameter CLKH_OV_CLKL_CGEN = { 0x0089, 12, 11, 0, "CLKH_OV_CLKL_CGEN", "FCLKL here is ADC clock. FCLKH is the clock to the DAC and if no division is added to the ADC as well" };
+const struct LMS7Parameter DIV_OUTCH_CGEN = { 0x0089, 10, 3, 4, "DIV_OUTCH_CGEN", "" };
+const struct LMS7Parameter TST_CGEN = { 0x0089, 2, 0, 0, "TST_CGEN",
+"Controls the test mode of the SX\n\
+0 - TST disabled; RSSI analog outputs enabled if RSSI blocks active and when all PLL test signals are off\n\
+1 - tstdo[0] = ADC clock; tstdo[1] = DAC clock; tstao = High impedance;\n\
+2 - tstdo[0] = SDM clock; tstdo[1] = feedback divider output; tstao = VCO tune through a 60kOhm resistor;\n\
+3 - tstdo[0] = Reference clock; tstdo[1] = feedback divider output; tstao = VCO tune through a 10kOhm resistor;\n\
+4 - tstdo[0] = High impedance; tstdo[1] = High impedance; tstao = High impedance;\n\
+5 - tstdo[0] = Charge pump Down signal; tstdo[1] = Charge pump Up signal; tstao = High impedance;\n\
+6 - tstdo[0] = High impedance; tstdo[1] = High impedance; tstao = VCO tune through a 60kOhm resistor;\n\
+7 - tstdo[0] = High impedance; tstdo[1] = High impedance; tstao = VCO tune through a 10kOhm resistor;\n\
+if TST_SX[2] = 1 --> VCO_TSTBUF active generating VCO_TST_DIV20 and VCO_TST_DIV40"};
+const struct LMS7Parameter REV_CLKDAC_CGEN = { 0x008A, 14, 14, 0, "REV_CLKDAC_CGEN", "Inverts the clock F_CLKL" };
+const struct LMS7Parameter CMPLO_CTRL_CGEN = { 0x008A, 27, 14, 0, "CMPLO_CTRL_CGEN", "" };
+const struct LMS7Parameter REV_CLKADC_CGEN = { 0x008A, 13, 13, 0, "REV_CLKADC_CGEN", "Inverts the clock F_CLKL" };
+const struct LMS7Parameter REVPH_PFD_CGEN = { 0x008A, 12, 12, 0, "REVPH_PFD_CGEN", "Reverse the pulses of PFD. It can be used to reverse the polarity of the PLL loop (positive feedback to negative feedback)" };
+const struct LMS7Parameter IOFFSET_CP_CGEN = { 0x008A, 11, 6, 20, "IOFFSET_CP_CGEN", "Scales the offset current of the charge pump, 0-->63. This current is used in Fran-N mode to create an offset in the CP response and avoide the non-linear section" };
+const struct LMS7Parameter IPULSE_CP_CGEN = { 0x008A, 5, 0, 20, "IPULSE_CP_CGEN", "Scales the pulse current of the charge pump" };
+const struct LMS7Parameter ICT_VCO_CGEN = { 0x008B, 13, 9, 16, "ICT_VCO_CGEN", "Scales the VCO bias current from 0 to 2.5xInom" };
+const struct LMS7Parameter CSW_VCO_CGEN = { 0x008B, 8, 1, 128, "CSW_VCO_CGEN", "" };
+const struct LMS7Parameter COARSE_START_CGEN = { 0x008B, 0, 0, 0, "COARSE_START_CGEN", "Control signal for coarse tuning algorithm (SX_SWC_calibration)" };
+const struct LMS7Parameter COARSE_STEPDONE_CGEN = { 0x008C, 15, 15, 0, "COARSE_STEPDONE_CGEN", "" };
+const struct LMS7Parameter COARSEPLL_COMPO_CGEN = { 0x008C, 14, 14, 0, "COARSEPLL_COMPO_CGEN", "" };
+const struct LMS7Parameter VCO_CMPHO_CGEN = { 0x008C, 13, 13, 0, "VCO_CMPHO_CGEN", "" };
+const struct LMS7Parameter VCO_CMPLO_CGEN = { 0x008C, 12, 12, 0, "VCO_CMPLO_CGEN", "" };
+const struct LMS7Parameter CP2_CGEN = { 0x008C, 11, 8, 6, "CP2_CGEN", "Controls the value of CP2 (cap from CP output to GND) in the PLL filter" };
+const struct LMS7Parameter CP3_CGEN = { 0x008C, 7, 4, 7, "CP3_CGEN", "Controls the value of CP3 (cap from VCO Vtune input to GND) in the PLL filter" };
+const struct LMS7Parameter CZ_CGEN = { 0x008C, 3, 0, 11, "CZ_CGEN", "Controls the value of CZ (Zero capacitor) in the PLL filter" };
+const struct LMS7Parameter EN_LDO_DIG = { 0x0092, 15, 15, 0, "EN_LDO_DIG", "Enables the LDO" };
+const struct LMS7Parameter EN_LDO_DIGGN = { 0x0092, 14, 14, 0, "EN_LDO_DIGGN", "Enables the LDO" };
+const struct LMS7Parameter EN_LDO_DIGSXR = { 0x0092, 13, 13, 0, "EN_LDO_DIGSXR", "Enables the LDO" };
+const struct LMS7Parameter EN_LDO_DIGSXT = { 0x0092, 12, 12, 0, "EN_LDO_DIGSXT", "Enables the LDO" };
+const struct LMS7Parameter EN_LDO_DIVGN = { 0x0092, 11, 11, 0, "EN_LDO_DIVGN", "Enables the LDO" };
+const struct LMS7Parameter EN_LDO_DIVSXR = { 0x0092, 10, 10, 0, "EN_LDO_DIVSXR", "Enables the LDO" };
+const struct LMS7Parameter EN_LDO_DIVSXT = { 0x0092, 9, 9, 0, "EN_LDO_DIVSXT", "Enables the LDO" };
+const struct LMS7Parameter EN_LDO_LNA12 = { 0x0092, 8, 8, 0, "EN_LDO_LNA12", "Enables the LDO" };
+const struct LMS7Parameter EN_LDO_LNA14 = { 0x0092, 7, 7, 0, "EN_LDO_LNA14", "Enables the LDO" };
+const struct LMS7Parameter EN_LDO_MXRFE = { 0x0092, 6, 6, 0, "EN_LDO_MXRFE", "Enables the LDO" };
+const struct LMS7Parameter EN_LDO_RBB = { 0x0092, 5, 5, 0, "EN_LDO_RBB", "Enables the LDO" };
+const struct LMS7Parameter EN_LDO_RXBUF = { 0x0092, 4, 4, 0, "EN_LDO_RXBUF", "Enables the LDO" };
+const struct LMS7Parameter EN_LDO_TBB = { 0x0092, 3, 3, 0, "EN_LDO_TBB", "Enables the LDO" };
+const struct LMS7Parameter EN_LDO_TIA12 = { 0x0092, 2, 2, 0, "EN_LDO_TIA12", "Enables the LDO" };
+const struct LMS7Parameter EN_LDO_TIA14 = { 0x0092, 1, 1, 0, "EN_LDO_TIA14", "Enables the LDO" };
+const struct LMS7Parameter EN_G_LDO = { 0x0092, 0, 0, 1, "EN_G_LDO", "Enable control for all the LDO power downs" };
+const struct LMS7Parameter EN_LOADIMP_LDO_TLOB = { 0x0093, 15, 15, 0, "EN_LOADIMP_LDO_TLOB", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter EN_LOADIMP_LDO_TPAD = { 0x0093, 14, 14, 0, "EN_LOADIMP_LDO_TPAD", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter EN_LOADIMP_LDO_TXBUF = { 0x0093, 13, 13, 0, "EN_LOADIMP_LDO_TXBUF", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter EN_LOADIMP_LDO_VCOGN = { 0x0093, 12, 12, 0, "EN_LOADIMP_LDO_VCOGN", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter EN_LOADIMP_LDO_VCOSXR = { 0x0093, 11, 11, 0, "EN_LOADIMP_LDO_VCOSXR", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter EN_LOADIMP_LDO_VCOSXT = { 0x0093, 10, 10, 0, "EN_LOADIMP_LDO_VCOSXT", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter EN_LDO_AFE = { 0x0093, 9, 9, 0, "EN_LDO_AFE", "Enables the LDO" };
+const struct LMS7Parameter EN_LDO_CPGN = { 0x0093, 8, 8, 0, "EN_LDO_CPGN", "Enables the LDO" };
+const struct LMS7Parameter EN_LDO_CPSXR = { 0x0093, 7, 7, 0, "EN_LDO_CPSXR", "Enables the LDO" };
+const struct LMS7Parameter EN_LDO_TLOB = { 0x0093, 6, 6, 0, "EN_LDO_TLOB", "Enables the LDO" };
+const struct LMS7Parameter EN_LDO_TPAD = { 0x0093, 5, 5, 0, "EN_LDO_TPAD", "Enables the LDO" };
+const struct LMS7Parameter EN_LDO_TXBUF = { 0x0093, 4, 4, 0, "EN_LDO_TXBUF", "Enables the LDO" };
+const struct LMS7Parameter EN_LDO_VCOGN = { 0x0093, 3, 3, 0, "EN_LDO_VCOGN", "Enables the LDO" };
+const struct LMS7Parameter EN_LDO_VCOSXR = { 0x0093, 2, 2, 0, "EN_LDO_VCOSXR", "Enables the LDO" };
+const struct LMS7Parameter EN_LDO_VCOSXT = { 0x0093, 1, 1, 0, "EN_LDO_VCOSXT", "Enables the LDO" };
+const struct LMS7Parameter EN_LDO_CPSXT = { 0x0093, 0, 0, 0, "EN_LDO_CPSXT", "Enables the LDO" };
+const struct LMS7Parameter EN_LOADIMP_LDO_CPSXT = { 0x0094, 15, 15, 0, "EN_LOADIMP_LDO_CPSXT", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter EN_LOADIMP_LDO_DIG = { 0x0094, 14, 14, 0, "EN_LOADIMP_LDO_DIG", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter EN_LOADIMP_LDO_DIGGN = { 0x0094, 13, 13, 0, "EN_LOADIMP_LDO_DIGGN", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter EN_LOADIMP_LDO_DIGSXR = { 0x0094, 12, 12, 0, "EN_LOADIMP_LDO_DIGSXR", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter EN_LOADIMP_LDO_DIGSXT = { 0x0094, 11, 11, 0, "EN_LOADIMP_LDO_DIGSXT", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter EN_LOADIMP_LDO_DIVGN = { 0x0094, 10, 10, 0, "EN_LOADIMP_LDO_DIVGN", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter EN_LOADIMP_LDO_DIVSXR = { 0x0094, 9, 9, 0, "EN_LOADIMP_LDO_DIVSXR", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter EN_LOADIMP_LDO_DIVSXT = { 0x0094, 8, 8, 0, "EN_LOADIMP_LDO_DIVSXT", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter EN_LOADIMP_LDO_LNA12 = { 0x0094, 7, 7, 0, "EN_LOADIMP_LDO_LNA12", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter EN_LOADIMP_LDO_LNA14 = { 0x0094, 6, 6, 0, "EN_LOADIMP_LDO_LNA14", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter EN_LOADIMP_LDO_MXRFE = { 0x0094, 5, 5, 0, "EN_LOADIMP_LDO_MXRFE", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter EN_LOADIMP_LDO_RBB = { 0x0094, 4, 4, 0, "EN_LOADIMP_LDO_RBB", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter EN_LOADIMP_LDO_RXBUF = { 0x0094, 3, 3, 0, "EN_LOADIMP_LDO_RXBUF", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter EN_LOADIMP_LDO_TBB = { 0x0094, 2, 2, 0, "EN_LOADIMP_LDO_TBB", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter EN_LOADIMP_LDO_TIA12 = { 0x0094, 1, 1, 0, "EN_LOADIMP_LDO_TIA12", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter EN_LOADIMP_LDO_TIA14 = { 0x0094, 0, 0, 0, "EN_LOADIMP_LDO_TIA14", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter BYP_LDO_TBB = { 0x0095, 15, 15, 0, "BYP_LDO_TBB", "Bypass signal for the LDO" };
+const struct LMS7Parameter BYP_LDO_TIA12 = { 0x0095, 14, 14, 0, "BYP_LDO_TIA12", "Bypass signal for the LDO" };
+const struct LMS7Parameter BYP_LDO_TIA14 = { 0x0095, 13, 13, 0, "BYP_LDO_TIA14", "Bypass signal for the LDO" };
+const struct LMS7Parameter BYP_LDO_TLOB = { 0x0095, 12, 12, 0, "BYP_LDO_TLOB", "Bypass signal for the LDO" };
+const struct LMS7Parameter BYP_LDO_TPAD = { 0x0095, 11, 11, 0, "BYP_LDO_TPAD", "Bypass signal for the LDO" };
+const struct LMS7Parameter BYP_LDO_TXBUF = { 0x0095, 10, 10, 0, "BYP_LDO_TXBUF", "Bypass signal for the LDO" };
+const struct LMS7Parameter BYP_LDO_VCOGN = { 0x0095, 9, 9, 0, "BYP_LDO_VCOGN", "Bypass signal for the LDO" };
+const struct LMS7Parameter BYP_LDO_VCOSXR = { 0x0095, 8, 8, 0, "BYP_LDO_VCOSXR", "Bypass signal for the LDO" };
+const struct LMS7Parameter BYP_LDO_VCOSXT = { 0x0095, 7, 7, 0, "BYP_LDO_VCOSXT", "Bypass signal for the LDO" };
+const struct LMS7Parameter EN_LOADIMP_LDO_AFE = { 0x0095, 2, 2, 0, "EN_LOADIMP_LDO_AFE", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter EN_LOADIMP_LDO_CPGN = { 0x0095, 1, 1, 0, "EN_LOADIMP_LDO_CPGN", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter EN_LOADIMP_LDO_CPSXR = { 0x0095, 0, 0, 0, "EN_LOADIMP_LDO_CPSXR", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter BYP_LDO_AFE = { 0x0096, 15, 15, 0, "BYP_LDO_AFE", "Bypass signal for the LDO" };
+const struct LMS7Parameter BYP_LDO_CPGN = { 0x0096, 14, 14, 0, "BYP_LDO_CPGN", "Bypass signal for the LDO" };
+const struct LMS7Parameter BYP_LDO_CPSXR = { 0x0096, 13, 13, 0, "BYP_LDO_CPSXR", "Bypass signal for the LDO" };
+const struct LMS7Parameter BYP_LDO_CPSXT = { 0x0096, 12, 12, 0, "BYP_LDO_CPSXT", "Bypass signal for the LDO" };
+const struct LMS7Parameter BYP_LDO_DIG = { 0x0096, 11, 11, 0, "BYP_LDO_DIG", "Bypass signal for the LDO" };
+const struct LMS7Parameter BYP_LDO_DIGGN = { 0x0096, 10, 10, 0, "BYP_LDO_DIGGN", "Bypass signal for the LDO" };
+const struct LMS7Parameter BYP_LDO_DIGSXR = { 0x0096, 9, 9, 0, "BYP_LDO_DIGSXR", "Bypass signal for the LDO" };
+const struct LMS7Parameter BYP_LDO_DIGSXT = { 0x0096, 8, 8, 0, "BYP_LDO_DIGSXT", "Bypass signal for the LDO" };
+const struct LMS7Parameter BYP_LDO_DIVGN = { 0x0096, 7, 7, 0, "BYP_LDO_DIVGN", "Bypass signal for the LDO" };
+const struct LMS7Parameter BYP_LDO_DIVSXR = { 0x0096, 6, 6, 0, "BYP_LDO_DIVSXR", "Bypass signal for the LDO" };
+const struct LMS7Parameter BYP_LDO_DIVSXT = { 0x0096, 5, 5, 0, "BYP_LDO_DIVSXT", "Bypass signal for the LDO" };
+const struct LMS7Parameter BYP_LDO_LNA12 = { 0x0096, 4, 4, 0, "BYP_LDO_LNA12", "Bypass signal for the LDO" };
+const struct LMS7Parameter BYP_LDO_LNA14 = { 0x0096, 3, 3, 0, "BYP_LDO_LNA14", "Bypass signal for the LDO" };
+const struct LMS7Parameter BYP_LDO_MXRFE = { 0x0096, 2, 2, 0, "BYP_LDO_MXRFE", "Bypass signal for the LDO" };
+const struct LMS7Parameter BYP_LDO_RBB = { 0x0096, 1, 1, 0, "BYP_LDO_RBB", "Bypass signal for the LDO" };
+const struct LMS7Parameter BYP_LDO_RXBUF = { 0x0096, 0, 0, 0, "BYP_LDO_RXBUF", "Bypass signal for the LDO" };
+const struct LMS7Parameter SPDUP_LDO_DIVSXR = { 0x0097, 15, 15, 0, "SPDUP_LDO_DIVSXR", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter SPDUP_LDO_DIVSXT = { 0x0097, 14, 14, 0, "SPDUP_LDO_DIVSXT", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter SPDUP_LDO_LNA12 = { 0x0097, 13, 13, 0, "SPDUP_LDO_LNA12", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter SPDUP_LDO_LNA14 = { 0x0097, 12, 12, 0, "SPDUP_LDO_LNA14", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter SPDUP_LDO_MXRFE = { 0x0097, 11, 11, 0, "SPDUP_LDO_MXRFE", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter SPDUP_LDO_RBB = { 0x0097, 10, 10, 0, "SPDUP_LDO_RBB", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter SPDUP_LDO_RXBUF = { 0x0097, 9, 9, 0, "SPDUP_LDO_RXBUF", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter SPDUP_LDO_TBB = { 0x0097, 8, 8, 0, "SPDUP_LDO_TBB", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter SPDUP_LDO_TIA12 = { 0x0097, 7, 7, 0, "SPDUP_LDO_TIA12", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter SPDUP_LDO_TIA14 = { 0x0097, 6, 6, 0, "SPDUP_LDO_TIA14", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter SPDUP_LDO_TLOB = { 0x0097, 5, 5, 0, "SPDUP_LDO_TLOB", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter SPDUP_LDO_TPAD = { 0x0097, 4, 4, 0, "SPDUP_LDO_TPAD", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter SPDUP_LDO_TXBUF = { 0x0097, 3, 3, 0, "SPDUP_LDO_TXBUF", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter SPDUP_LDO_VCOGN = { 0x0097, 2, 2, 0, "SPDUP_LDO_VCOGN", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter SPDUP_LDO_VCOSXR = { 0x0097, 1, 1, 0, "SPDUP_LDO_VCOSXR", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter SPDUP_LDO_VCOSXT = { 0x0097, 0, 0, 0, "SPDUP_LDO_VCOSXT", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter SPDUP_LDO_AFE = { 0x0098, 8, 8, 0, "SPDUP_LDO_AFE", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter SPDUP_LDO_CPGN = { 0x0098, 7, 7, 0, "SPDUP_LDO_CPGN", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter SPDUP_LDO_CPSXR = { 0x0098, 6, 6, 0, "SPDUP_LDO_CPSXR", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter SPDUP_LDO_CPSXT = { 0x0098, 5, 5, 0, "SPDUP_LDO_CPSXT", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter SPDUP_LDO_DIG = { 0x0098, 4, 4, 0, "SPDUP_LDO_DIG", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter SPDUP_LDO_DIGGN = { 0x0098, 3, 3, 0, "SPDUP_LDO_DIGGN", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter SPDUP_LDO_DIGSXR = { 0x0098, 2, 2, 0, "SPDUP_LDO_DIGSXR", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter SPDUP_LDO_DIGSXT = { 0x0098, 1, 1, 0, "SPDUP_LDO_DIGSXT", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter SPDUP_LDO_DIVGN = { 0x0098, 0, 0, 0, "SPDUP_LDO_DIVGN", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter RDIV_VCOSXR = { 0x0099, 15, 8, 101, "RDIV_VCOSXR", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter RDIV_VCOSXT = { 0x0099, 7, 0, 101, "RDIV_VCOSXT", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter RDIV_TXBUF = { 0x009A, 15, 8, 101, "RDIV_TXBUF", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter RDIV_VCOGN = { 0x009A, 7, 0, 140, "RDIV_VCOGN", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter RDIV_TLOB = { 0x009B, 15, 8, 101, "RDIV_TLOB", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter RDIV_TPAD = { 0x009B, 7, 0, 101, "RDIV_TPAD", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter RDIV_TIA12 = { 0x009C, 15, 8, 101, "RDIV_TIA12", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter RDIV_TIA14 = { 0x009C, 7, 0, 140, "RDIV_TIA14", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter RDIV_RXBUF = { 0x009D, 15, 8, 101, "RDIV_RXBUF", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter RDIV_TBB = { 0x009D, 7, 0, 101, "RDIV_TBB", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter RDIV_MXRFE = { 0x009E, 15, 8, 101, "RDIV_MXRFE", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter RDIV_RBB = { 0x009E, 7, 0, 140, "RDIV_RBB", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter RDIV_LNA12 = { 0x009F, 15, 8, 101, "RDIV_LNA12", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter RDIV_LNA14 = { 0x009F, 7, 0, 140, "RDIV_LNA14", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter RDIV_DIVSXR = { 0x00A0, 15, 8, 101, "RDIV_DIVSXR", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter RDIV_DIVSXT = { 0x00A0, 7, 0, 101, "RDIV_DIVSXT", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter RDIV_DIGSXT = { 0x00A1, 15, 8, 101, "RDIV_DIGSXT", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter RDIV_DIVGN = { 0x00A1, 7, 0, 101, "RDIV_DIVGN", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter RDIV_DIGGN = { 0x00A2, 15, 8, 101, "RDIV_DIGGN", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter RDIV_DIGSXR = { 0x00A2, 7, 0, 101, "RDIV_DIGSXR", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter RDIV_CPSXT = { 0x00A3, 15, 8, 101, "RDIV_CPSXT", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter RDIV_DIG = { 0x00A3, 7, 0, 101, "RDIV_DIG", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter RDIV_CPGN = { 0x00A4, 15, 8, 101, "RDIV_CPGN", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter RDIV_CPSXR = { 0x00A4, 7, 0, 101, "RDIV_CPSXR", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter RDIV_SPIBUF = { 0x00A5, 15, 8, 101, "RDIV_SPIBUF", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter RDIV_AFE = { 0x00A5, 7, 0, 101, "RDIV_AFE", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter SPDUP_LDO_SPIBUF = { 0x00A6, 12, 12, 0, "SPDUP_LDO_SPIBUF", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter SPDUP_LDO_DIGIp2 = { 0x00A6, 11, 11, 0, "SPDUP_LDO_DIGIp2", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter SPDUP_LDO_DIGIp1 = { 0x00A6, 10, 10, 0, "SPDUP_LDO_DIGIp1", "Short the noise filter resistor to speed up the settling time" };
+const struct LMS7Parameter BYP_LDO_SPIBUF = { 0x00A6, 9, 9, 0, "BYP_LDO_SPIBUF", "Bypass signal for the LDO" };
+const struct LMS7Parameter BYP_LDO_DIGIp2 = { 0x00A6, 8, 8, 0, "BYP_LDO_DIGIp2", "Bypass signal for the LDO" };
+const struct LMS7Parameter BYP_LDO_DIGIp1 = { 0x00A6, 7, 7, 0, "BYP_LDO_DIGIp1", "Bypass signal for the LDO" };
+const struct LMS7Parameter EN_LOADIMP_LDO_SPIBUF = { 0x00A6, 6, 6, 0, "EN_LOADIMP_LDO_SPIBUF", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter EN_LOADIMP_LDO_DIGIp2 = { 0x00A6, 5, 5, 0, "EN_LOADIMP_LDO_DIGIp2", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter EN_LOADIMP_LDO_DIGIp1 = { 0x00A6, 4, 4, 0, "EN_LOADIMP_LDO_DIGIp1", "Enables the load dependent bias to optimize the load regulation" };
+const struct LMS7Parameter PD_LDO_SPIBUF = { 0x00A6, 3, 3, 1, "PD_LDO_SPIBUF", "Enables the LDO" };
+const struct LMS7Parameter PD_LDO_DIGIp2 = { 0x00A6, 2, 2, 1, "PD_LDO_DIGIp2", "Enables the LDO" };
+const struct LMS7Parameter PD_LDO_DIGIp1 = { 0x00A6, 1, 1, 1, "PD_LDO_DIGIp1", "Enables the LDO" };
+const struct LMS7Parameter EN_G_LDOP = { 0x00A6, 0, 0, 1, "EN_G_LDOP", "Enable control for all the LDO power downs" };
+const struct LMS7Parameter RDIV_DIGIp2 = { 0x00A7, 15, 8, 101, "RDIV_DIGIp2", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter RDIV_DIGIp1 = { 0x00A7, 7, 0, 101, "RDIV_DIGIp1", "Controls the output voltage of the LDO by setting the resistive voltage divider ratio" };
+const struct LMS7Parameter BSIGT = { 0x00A8, 31, 9, 0, "BSIGT", "" };
+const struct LMS7Parameter BSTATE = { 0x00A8, 8, 8, 0, "BSTATE", "" };
+const struct LMS7Parameter EN_SDM_TSTO_SXT = { 0x00A8, 6, 6, 0, "EN_SDM_TSTO_SXT", "Enables the SDM_TSTO_SXT" };
+const struct LMS7Parameter EN_SDM_TSTO_SXR = { 0x00A8, 5, 5, 0, "EN_SDM_TSTO_SXR", "Enables the SDM_TSTO_SXR" };
+const struct LMS7Parameter EN_SDM_TSTO_CGEN = { 0x00A8, 4, 4, 0, "EN_SDM_TSTO_CGEN", "Enables the SDM_TSTO_CGEN" };
+const struct LMS7Parameter BENC = { 0x00A8, 3, 3, 0, "BENC", "enables CGEN BIST" };
+const struct LMS7Parameter BENR = { 0x00A8, 2, 2, 0, "BENR", "enables SXR BIST" };
+const struct LMS7Parameter BENT = { 0x00A8, 1, 1, 0, "BENT", "enables SXT BIST" };
+const struct LMS7Parameter BSTART = { 0x00A8, 0, 0, 0, "BSTART", "Starts delta sigma built in self test. Keep it at 1 one at least three clock cycles" };
+const struct LMS7Parameter BSIGR = { 0x00AA, 22, 0, 0, "BSIGR", "" };
+const struct LMS7Parameter BSIGC = { 0x00AB, 29, 7, 0, "BSIGC", "" };
+const struct LMS7Parameter CDS_MCLK2 = { 0x00AD, 15, 14, 0, "CDS_MCLK2", "MCLK2 clock delay" };
+const struct LMS7Parameter CDS_MCLK1 = { 0x00AD, 13, 12, 0, "CDS_MCLK1", "MCLK1 clock delay" };
+const struct LMS7Parameter CDSN_TXBTSP = { 0x00AD, 9, 9, 1, "CDSN_TXBTSP", "TX TSPB clock inversion control" };
+const struct LMS7Parameter CDSN_TXATSP = { 0x00AD, 8, 8, 1, "CDSN_TXATSP", "TX TSPA clock inversion control" };
+const struct LMS7Parameter CDSN_RXBTSP = { 0x00AD, 7, 7, 1, "CDSN_RXBTSP", "RX TSPB clock inversion control" };
+const struct LMS7Parameter CDSN_RXATSP = { 0x00AD, 6, 6, 1, "CDSN_RXATSP", "RX TSPA clock inversion control" };
+const struct LMS7Parameter CDSN_TXBLML = { 0x00AD, 5, 5, 1, "CDSN_TXBLML", "TX LMLB clock inversion control" };
+const struct LMS7Parameter CDSN_TXALML = { 0x00AD, 4, 4, 1, "CDSN_TXALML", "TX LMLA clock inversion control" };
+const struct LMS7Parameter CDSN_RXBLML = { 0x00AD, 3, 3, 1, "CDSN_RXBLML", "RX LMLB clock inversion control" };
+const struct LMS7Parameter CDSN_RXALML = { 0x00AD, 2, 2, 1, "CDSN_RXALML", "RX LMLA clock inversion control" };
+const struct LMS7Parameter CDSN_MCLK2 = { 0x00AD, 1, 1, 1, "CDSN_MCLK2", "MCLK2 clock inversion control" };
+const struct LMS7Parameter CDSN_MCLK1 = { 0x00AD, 0, 0, 1, "CDSN_MCLK1", "MCLK1 clock inversion control" };
+const struct LMS7Parameter CDS_TXBTSP = { 0x00AE, 15, 14, 0, "CDS_TXBTSP", "TX TSP B clock delay" };
+const struct LMS7Parameter CDS_TXATSP = { 0x00AE, 13, 12, 0, "CDS_TXATSP", "TX TSP A clock delay" };
+const struct LMS7Parameter CDS_RXBTSP = { 0x00AE, 11, 10, 0, "CDS_RXBTSP", "RX TSP B clock delay" };
+const struct LMS7Parameter CDS_RXATSP = { 0x00AE, 9, 8, 0, "CDS_RXATSP", "RX TSP A clock delay" };
+const struct LMS7Parameter CDS_TXBLML = { 0x00AE, 7, 6, 0, "CDS_TXBLML", "TX LML B clock delay" };
+const struct LMS7Parameter CDS_TXALML = { 0x00AE, 5, 4, 0, "CDS_TXALML", "TX LML A clock delay" };
+const struct LMS7Parameter CDS_RXBLML = { 0x00AE, 3, 2, 0, "CDS_RXBLML", "RX LML B clock delay" };
+const struct LMS7Parameter CDS_RXALML = { 0x00AE, 1, 0, 0, "CDS_RXALML", "RX LML A clock delay" };
+const struct LMS7Parameter EN_LOWBWLOMX_TMX_TRF = { 0x0100, 15, 15, 0, "EN_LOWBWLOMX_TMX_TRF", "Controls the high pass pole frequency of the RC biasing the gate of the mixer switches" };
+const struct LMS7Parameter EN_NEXTTX_TRF = { 0x0100, 14, 14, 0, "EN_NEXTTX_TRF", "Enables the daisy change LO buffer going from TRF_1 to TRF2" };
+const struct LMS7Parameter EN_AMPHF_PDET_TRF = { 0x0100, 13, 12, 3, "EN_AMPHF_PDET_TRF", "Enables the TXPAD power detector preamplifier" };
+const struct LMS7Parameter LOADR_PDET_TRF = { 0x0100, 11, 10, 1, "LOADR_PDET_TRF", "Controls the resistive load of the Power detector" };
+const struct LMS7Parameter PD_PDET_TRF = { 0x0100, 3, 3, 1, "PD_PDET_TRF", "Powerdown signal for Power Detector" };
+const struct LMS7Parameter PD_TLOBUF_TRF = { 0x0100, 2, 2, 0, "PD_TLOBUF_TRF", "Powerdown signal for TX LO buffer" };
+const struct LMS7Parameter PD_TXPAD_TRF = { 0x0100, 1, 1, 0, "PD_TXPAD_TRF", "Powerdown signal for TXPAD" };
+const struct LMS7Parameter EN_G_TRF = { 0x0100, 0, 0, 1, "EN_G_TRF", "Enable control for all the TRF_1 power downs" };
+const struct LMS7Parameter F_TXPAD_TRF = { 0x0101, 15, 13, 3, "F_TXPAD_TRF", "Controls the switched capacitor at the TXPAD output. Is used for fine tuning of the TXPAD output" };
+const struct LMS7Parameter L_LOOPB_TXPAD_TRF = { 0x0101, 12, 11, 3, "L_LOOPB_TXPAD_TRF", "Controls the loss of the of the loopback path at the TX side" };
+const struct LMS7Parameter LOSS_LIN_TXPAD_TRF = { 0x0101, 10, 6, 0, "LOSS_LIN_TXPAD_TRF", "Controls the gain of the linearizing part of of the TXPAD" };
+const struct LMS7Parameter LOSS_MAIN_TXPAD_TRF = { 0x0101, 5, 1, 0, "LOSS_MAIN_TXPAD_TRF", "Controls the gain  output power of the TXPAD" };
+const struct LMS7Parameter EN_LOOPB_TXPAD_TRF = { 0x0101, 0, 0, 0, "EN_LOOPB_TXPAD_TRF", "Enables the TXPAD loopback path" };
+const struct LMS7Parameter GCAS_GNDREF_TXPAD_TRF = { 0x0102, 15, 15, 0, "GCAS_GNDREF_TXPAD_TRF", "Controls if the TXPAD cascode transistor gate bias is referred to VDD or GND" };
+const struct LMS7Parameter ICT_LIN_TXPAD_TRF = { 0x0102, 14, 10, 12, "ICT_LIN_TXPAD_TRF", "Control the bias current of the linearization section of the TXPAD" };
+const struct LMS7Parameter ICT_MAIN_TXPAD_TRF = { 0x0102, 9, 5, 12, "ICT_MAIN_TXPAD_TRF", "Control the bias current of the main gm section of the TXPAD" };
+const struct LMS7Parameter VGCAS_TXPAD_TRF = { 0x0102, 4, 0, 0, "VGCAS_TXPAD_TRF", "Controls the bias voltage at the gate of TXPAD cascade" };
+const struct LMS7Parameter SEL_BAND1_TRF = { 0x0103, 11, 11, 1, "SEL_BAND1_TRF", "" };
+const struct LMS7Parameter SEL_BAND2_TRF = { 0x0103, 10, 10, 0, "SEL_BAND2_TRF", "" };
+const struct LMS7Parameter LOBIASN_TXM_TRF = { 0x0103, 9, 5, 16, "LOBIASN_TXM_TRF", "Controls the bias at the gate of the mixer NMOS" };
+const struct LMS7Parameter LOBIASP_TXX_TRF = { 0x0103, 4, 0, 18, "LOBIASP_TXX_TRF", "Controls the bias at the gate of the mixer PMOS" };
+const struct LMS7Parameter CDC_I_TRF = { 0x0104, 7, 4, 8, "CDC_I_TRF", "" };
+const struct LMS7Parameter CDC_Q_TRF = { 0x0104, 3, 0, 8, "CDC_Q_TRF", "" };
+const struct LMS7Parameter STATPULSE_TBB = { 0x0105, 15, 15, 0, "STATPULSE_TBB", "" };
+const struct LMS7Parameter LOOPB_TBB = { 0x0105, 14, 12, 0, "LOOPB_TBB", "This controls which signal is connected to the loopback output pins. Note: when both the lowpass ladder and real pole are powered down, the output of the active highband biquad is routed to the loopb output" };
+const struct LMS7Parameter PD_LPFH_TBB = { 0x0105, 4, 4, 0, "PD_LPFH_TBB", "This selectively powers down the LPFH_TBB biquad" };
+const struct LMS7Parameter PD_LPFIAMP_TBB = { 0x0105, 3, 3, 0, "PD_LPFIAMP_TBB", "selectively powers down the LPFIAMP_TBB front-end current amp of the transmitter baseband" };
+const struct LMS7Parameter PD_LPFLAD_TBB = { 0x0105, 2, 2, 1, "PD_LPFLAD_TBB", "This selectively powers down the LPFLAD_TBB low pass ladder filter of the transmitter baseband" };
+const struct LMS7Parameter PD_LPFS5_TBB = { 0x0105, 1, 1, 1, "PD_LPFS5_TBB", "This selectively powers down the LPFS5_TBB low pass real-pole filter of the transmitter baseband" };
+const struct LMS7Parameter EN_G_TBB = { 0x0105, 0, 0, 1, "EN_G_TBB", "Enable control for all the TBB_TOP power downs" };
+const struct LMS7Parameter ICT_LPFS5_F_TBB = { 0x0106, 14, 10, 12, "ICT_LPFS5_F_TBB", "This controls the operational amplifier's output stage bias current of the low band real pole filter of the transmitter's baseband" };
+const struct LMS7Parameter ICT_LPFS5_PT_TBB = { 0x0106, 9, 5, 12, "ICT_LPFS5_PT_TBB", "This controls the operational amplifier's input stage bias current of the low band real pole filter of the transmitter's baseband" };
+const struct LMS7Parameter ICT_LPF_H_PT_TBB = { 0x0106, 4, 0, 12, "ICT_LPF_H_PT_TBB", "This controls the operational amplifiers input stage bias reference current of the high band low pass filter of the transmitter's baseband " };
+const struct LMS7Parameter ICT_LPFH_F_TBB = { 0x0107, 14, 10, 12, "ICT_LPFH_F_TBB", "controls the operational amplifiers output stage bias reference current of the high band low pass filter of the transmitter's baseband (LPFH_TBB)" };
+const struct LMS7Parameter ICT_LPFLAD_F_TBB = { 0x0107, 9, 5, 12, "ICT_LPFLAD_F_TBB", "This controls the operational amplfiers' output stages bias referene current of the low band ladder filter of the transmisster's baseband" };
+const struct LMS7Parameter ICT_LPFLAD_PT_TBB = { 0x0107, 4, 0, 12, "ICT_LPFLAD_PT_TBB", "This controls the operational amplifers' input stages bias reference current of the low band ladder filter of the transmitter's baseband" };
+const struct LMS7Parameter CG_IAMP_TBB = { 0x0108, 15, 10, 37, "CG_IAMP_TBB", "This controls the frontend gain of the TBB. For a given gain value, this control value varies with the set TX mode. After resistance calibration, the following table gives the nominal values for each frequency setting. However, this table is to be updated and corrected after calibration" };
+const struct LMS7Parameter ICT_IAMP_FRP_TBB = { 0x0108, 9, 5, 1, "ICT_IAMP_FRP_TBB", "This controls the reference bias current of the IAMP main bias current sources" };
+const struct LMS7Parameter ICT_IAMP_GG_FRP_TBB = { 0x0108, 4, 0, 6, "ICT_IAMP_GG_FRP_TBB", "This controls the reference bias current of the IAMP's cascode transistors gate voltages that set the IAMP's input voltage level. The IAMP's input is connected to the DAC output" };
+const struct LMS7Parameter RCAL_LPFH_TBB = { 0x0109, 15, 8, 97, "RCAL_LPFH_TBB", "This controls the value of the equivalent resistance of the resistor banks of the biquad filter stage (of the high band section) of the transmitter baseband(TBB)" };
+const struct LMS7Parameter RCAL_LPFLAD_TBB = { 0x0109, 7, 0, 193, "RCAL_LPFLAD_TBB", "This controls the value of the equivalent resistance of the resistor banks of the low pass filter ladder (of the low band section) of the transmitter baseband(TBB)" };
+const struct LMS7Parameter TSTIN_TBB = { 0x010A, 15, 14, 0, "TSTIN_TBB", "This control selects where the input test signal (vinp/n_aux_bbq/i) is routed to as well as disabling the route." };
+const struct LMS7Parameter BYPLADDER_TBB = { 0x010A, 13, 13, 0, "BYPLADDER_TBB", "This signal bypasses the LPF ladder of TBB and directly connects the output of current amplifier to the null port of the real pole stage of TBB low pass filter" };
+const struct LMS7Parameter CCAL_LPFLAD_TBB = { 0x010A, 12, 8, 16, "CCAL_LPFLAD_TBB", "A common control signal for all the capacitor banks of TBB filters (including the ladder, real pole, and the high band biquad). It is the calibrated value of the banks control that sets the value of the banks' equivalent capacitor to their respective nominal values" };
+const struct LMS7Parameter RCAL_LPFS5_TBB = { 0x010A, 7, 0, 76, "RCAL_LPFS5_TBB", "This controls the value of the equivalent resistance of the resistor banks of the real pole filter stage (of the low band section) of the transmitter baseband (TBB). Following is a nominal values table that are corrected for any process variation after calibration" };
+const struct LMS7Parameter CDC_I_RFE = { 0x010C, 15, 12, 8, "CDC_I_RFE", "" };
+const struct LMS7Parameter CDC_Q_RFE = { 0x010C, 11, 8, 8, "CDC_Q_RFE", "" };
+const struct LMS7Parameter PD_LNA_RFE = { 0x010C, 7, 7, 1, "PD_LNA_RFE", "Power control signal for LNA_RFE" };
+const struct LMS7Parameter PD_RLOOPB_1_RFE = { 0x010C, 6, 6, 1, "PD_RLOOPB_1_RFE", "Power control signal for RXFE loopback 1" };
+const struct LMS7Parameter PD_RLOOPB_2_RFE = { 0x010C, 5, 5, 1, "PD_RLOOPB_2_RFE", "Power control signal for RXFE loopback 2" };
+const struct LMS7Parameter PD_MXLOBUF_RFE = { 0x010C, 4, 4, 1, "PD_MXLOBUF_RFE", "Power control signal for RXFE mixer lo buffer" };
+const struct LMS7Parameter PD_QGEN_RFE = { 0x010C, 3, 3, 1, "PD_QGEN_RFE", "Power control signal for RXFE Quadrature LO generator" };
+const struct LMS7Parameter PD_RSSI_RFE = { 0x010C, 2, 2, 1, "PD_RSSI_RFE", "Power control signal for RXFE RSSI" };
+const struct LMS7Parameter PD_TIA_RFE = { 0x010C, 1, 1, 0, "PD_TIA_RFE", "Power control signal for RXFE TIA" };
+const struct LMS7Parameter EN_G_RFE = { 0x010C, 0, 0, 1, "EN_G_RFE", "Enable control for all the RFE_1 power downs" };
+const struct LMS7Parameter SEL_PATH_RFE = { 0x010D, 8, 7, 1, "SEL_PATH_RFE", "Selects the active path of the RXFE" };
+const struct LMS7Parameter EN_DCOFF_RXFE_RFE = { 0x010D, 6, 6, 0, "EN_DCOFF_RXFE_RFE", "Enables the DCOFFSET block for the RXFE" };
+const struct LMS7Parameter EN_INSHSW_LB1_RFE = { 0x010D, 4, 4, 1, "EN_INSHSW_LB1_RFE", "Enables the input shorting switch at the input  of the loopback 1 (in parallel with LNAL mixer)" };
+const struct LMS7Parameter EN_INSHSW_LB2_RFE = { 0x010D, 3, 3, 1, "EN_INSHSW_LB2_RFE", "Enables the input shorting switch at the input  of the loopback 2 (in parallel with LNAW mixer)" };
+const struct LMS7Parameter EN_INSHSW_L_RFE = { 0x010D, 2, 2, 1, "EN_INSHSW_L_RFE", "Enables the input shorting switch at the input  of the LNAL" };
+const struct LMS7Parameter EN_INSHSW_W_RFE = { 0x010D, 1, 1, 1, "EN_INSHSW_W_RFE", "Enables the input shorting switch at the input  of the LNAW" };
+const struct LMS7Parameter EN_NEXTRX_RFE = { 0x010D, 0, 0, 0, "EN_NEXTRX_RFE", "Enables the daisy chain LO buffer going from RXFE1  to RXFE2" };
+const struct LMS7Parameter DCOFFI_RFE = { 0x010E, 13, 7, 64, "DCOFFI_RFE", "Controls DC offset at the output of the TIA by injecting current to the input of the TIA (I side)" };
+const struct LMS7Parameter DCOFFQ_RFE = { 0x010E, 6, 0, 64, "DCOFFQ_RFE", "Controls DC offset at the output of the TIA by injecting current to the input of the TIA (Q side)" };
+const struct LMS7Parameter ICT_LOOPB_RFE = { 0x010F, 14, 10, 12, "ICT_LOOPB_RFE", "Controls the reference current of the RXFE loopback amplifier" };
+const struct LMS7Parameter ICT_TIAMAIN_RFE = { 0x010F, 9, 5, 2, "ICT_TIAMAIN_RFE", "Controls the reference current of the RXFE TIA first stage" };
+const struct LMS7Parameter ICT_TIAOUT_RFE = { 0x010F, 4, 0, 2, "ICT_TIAOUT_RFE", "Controls the reference current of the RXFE TIA 2nd stage" };
+const struct LMS7Parameter ICT_LNACMO_RFE = { 0x0110, 14, 10, 2, "ICT_LNACMO_RFE", "Controls the current generating LNA output common mode voltage" };
+const struct LMS7Parameter ICT_LNA_RFE = { 0x0110, 9, 5, 31, "ICT_LNA_RFE", "Controls the current of the LNA core" };
+const struct LMS7Parameter ICT_LODC_RFE = { 0x0110, 4, 0, 20, "ICT_LODC_RFE", "Controls the DC of the mixer LO signal at the gate of the mixer switches" };
+const struct LMS7Parameter CAP_RXMXO_RFE = { 0x0111, 9, 5, 4, "CAP_RXMXO_RFE", "Control the decoupling cap at the output of the RX Mixer" };
+const struct LMS7Parameter CGSIN_LNA_RFE = { 0x0111, 4, 0, 3, "CGSIN_LNA_RFE", "Controls the cap parallel with the LNA input input NMOS CGS to control the Q of the maching circuit and provides trade off between gain/NF and IIP. The higher the frequency, the lower CGSIN_LNA_RFE should be. Also, the higher CGSIN, the lower the Q, The lower the gain, the higher the NF, and the higher the IIP3" };
+const struct LMS7Parameter CCOMP_TIA_RFE = { 0x0112, 15, 12, 12, "CCOMP_TIA_RFE", "Compensation capacitor for TIA" };
+const struct LMS7Parameter CFB_TIA_RFE = { 0x0112, 11, 0, 230, "CFB_TIA_RFE", "Feeback capacitor for TIA. Controls the 3dB BW of the TIA. Should be set with calibration through digital baseband" };
+const struct LMS7Parameter G_LNA_RFE = { 0x0113, 9, 6, 15, "G_LNA_RFE", "Controls the gain of the LNA" };
+const struct LMS7Parameter G_RXLOOPB_RFE = { 0x0113, 5, 2, 0, "G_RXLOOPB_RFE", "Controls RXFE loopback gain" };
+const struct LMS7Parameter G_TIA_RFE = { 0x0113, 1, 0, 3, "G_TIA_RFE", "Controls the Gain of the TIA" };
+const struct LMS7Parameter RCOMP_TIA_RFE = { 0x0114, 8, 5, 4, "RCOMP_TIA_RFE", "Controls the compensation resistors of the TIA opamp" };
+const struct LMS7Parameter RFB_TIA_RFE = { 0x0114, 4, 0, 13, "RFB_TIA_RFE", "Sets the feedback resistor to the nominal value" };
+const struct LMS7Parameter EN_LB_LPFH_RBB = { 0x0115, 15, 15, 0, "EN_LB_LPFH_RBB", "" };
+const struct LMS7Parameter EN_LB_LPFL_RBB = { 0x0115, 14, 14, 0, "EN_LB_LPFL_RBB", "" };
+const struct LMS7Parameter PD_LPFH_RBB = { 0x0115, 3, 3, 1, "PD_LPFH_RBB", "Power down of the LPFH block" };
+const struct LMS7Parameter PD_LPFL_RBB = { 0x0115, 2, 2, 0, "PD_LPFL_RBB", "Power down of the LPFL block" };
+const struct LMS7Parameter PD_PGA_RBB = { 0x0115, 1, 1, 0, "PD_PGA_RBB", "Power down of the PGA block" };
+const struct LMS7Parameter EN_G_RBB = { 0x0115, 0, 0, 1, "EN_G_RBB", "Enable control for all the RBB_1 power downs" };
+const struct LMS7Parameter R_CTL_LPF_RBB = { 0x0116, 15, 11, 16, "R_CTL_LPF_RBB", "Controls the absolute value of the resistance of the RC time constant of the RBB_LPF blocks (both Low and High)" };
+const struct LMS7Parameter RCC_CTL_LPFH_RBB = { 0x0116, 10, 8, 1, "RCC_CTL_LPFH_RBB", "Controls the stability passive compensation of the LPFH_RBB operational amplifier" };
+const struct LMS7Parameter C_CTL_LPFH_RBB = { 0x0116, 7, 0, 128, "C_CTL_LPFH_RBB", "Controls the capacitance value of the RC time constant of RBB_LPFH and it varies with the respective rxMode from 37MHz to 108MHz" };
+const struct LMS7Parameter RCC_CTL_LPFL_RBB = { 0x0117, 13, 11, 5, "RCC_CTL_LPFL_RBB", "Controls the stability passive compensation of the LPFL_RBB operational amplifier" };
+const struct LMS7Parameter C_CTL_LPFL_RBB = { 0x0117, 10, 0, 12, "C_CTL_LPFL_RBB", "Controls the capacitance value of the RC time constant of RBB_LPFH and it varies with the respective rxMode from 1.4MHz to 20MHz." };
+const struct LMS7Parameter INPUT_CTL_PGA_RBB = { 0x0118, 15, 13, 0, "INPUT_CTL_PGA_RBB", "There are a total of four different differential inputs to the PGA. Only one of them is active at a time" };
+const struct LMS7Parameter ICT_LPF_IN_RBB = { 0x0118, 9, 5, 12, "ICT_LPF_IN_RBB", "Controls the reference bias current of the input stage of the operational amplifier used in RBB_LPF blocks (Low or High). " };
+const struct LMS7Parameter ICT_LPF_OUT_RBB = { 0x0118, 4, 0, 12, "ICT_LPF_OUT_RBB", "The reference bias current of the output stage of the operational amplifier used in RBB_LPF blocks (low or High)" };
+const struct LMS7Parameter OSW_PGA_RBB = { 0x0119, 15, 15, 0, "OSW_PGA_RBB", "There are two instances of the PGA circuit in the design. The output of the RBB_LPF blocks are connected the input of these PGA blocks (common). The output of one of them is connected to two pads pgaoutn and pgaoutp and the output of the other PGA is connected directly to the ADC input" };
+const struct LMS7Parameter ICT_PGA_OUT_RBB = { 0x0119, 14, 10, 6, "ICT_PGA_OUT_RBB", "Controls the output stage reference bias current of the operational amplifier used in the PGA circuit" };
+const struct LMS7Parameter ICT_PGA_IN_RBB = { 0x0119, 9, 5, 6, "ICT_PGA_IN_RBB", "Controls the input stage reference bias current of the operational amplifier used in the PGA circuit" };
+const struct LMS7Parameter G_PGA_RBB = { 0x0119, 4, 0, 11, "G_PGA_RBB", "This is the gain of the PGA" };
+const struct LMS7Parameter RCC_CTL_PGA_RBB = { 0x011A, 13, 9, 23, "RCC_CTL_PGA_RBB", "Controls the stability passive compensation of the PGA_RBB operational amplifier" };
+const struct LMS7Parameter C_CTL_PGA_RBB = { 0x011A, 6, 0, 2, "C_CTL_PGA_RBB", "Control the value of the feedback capacitor of the PGA that is used to help against the parasitic cap at the virtual node for stability" };
+const struct LMS7Parameter RESET_N = { 0x011C, 15, 15, 1, "RESET_N", "Resets SX. A pulse should be used in the start-up to reset" };
+const struct LMS7Parameter SPDUP_VCO = { 0x011C, 14, 14, 0, "SPDUP_VCO", "Bypasses the noise filter resistor for fast settling time. It should be connected to a 1uS pulse" };
+const struct LMS7Parameter BYPLDO_VCO = { 0x011C, 13, 13, 1, "BYPLDO_VCO", "Controls the bypass signal for the SX LDO" };
+const struct LMS7Parameter EN_COARSEPLL = { 0x011C, 12, 12, 0, "EN_COARSEPLL", "Enable signal for coarse tuning block" };
+const struct LMS7Parameter CURLIM_VCO = { 0x011C, 11, 11, 1, "CURLIM_VCO", "Enables the output current limitation in the VCO regulator" };
+const struct LMS7Parameter EN_DIV2_DIVPROG = { 0x011C, 10, 10, 1, "EN_DIV2_DIVPROG", "" };
+const struct LMS7Parameter EN_INTONLY_SDM = { 0x011C, 9, 9, 0, "EN_INTONLY_SDM", "Enables INTEGER-N mode of the SX " };
+const struct LMS7Parameter EN_SDM_CLK = { 0x011C, 8, 8, 1, "EN_SDM_CLK", "Enables/Disables SDM clock. In INT-N mode or for noise testing, SDM clock can be disabled" };
+const struct LMS7Parameter PD_FBDIV = { 0x011C, 7, 7, 0, "PD_FBDIV", "Power down the feedback divider block" };
+const struct LMS7Parameter PD_LOCH_T2RBUF = { 0x011C, 6, 6, 1, "PD_LOCH_T2RBUF", "Power down for LO buffer from SXT to SXR. To be active only in the TDD mode" };
+const struct LMS7Parameter PD_CP = { 0x011C, 5, 5, 0, "PD_CP", "Power down for Charge Pump" };
+const struct LMS7Parameter PD_FDIV = { 0x011C, 4, 4, 0, "PD_FDIV", "Power down for feedback frequency and forward dividers" };
+const struct LMS7Parameter PD_SDM = { 0x011C, 3, 3, 0, "PD_SDM", "Power down for SDM" };
+const struct LMS7Parameter PD_VCO_COMP = { 0x011C, 2, 2, 0, "PD_VCO_COMP", "Power down for VCO comparator" };
+const struct LMS7Parameter PD_VCO = { 0x011C, 1, 1, 1, "PD_VCO", "Power down for VCO" };
+const struct LMS7Parameter EN_G = { 0x011C, 0, 0, 1, "EN_G", "Enable control for all the SXT power downs" };
+const struct LMS7Parameter FRAC_SDM_LSB = { 0x011D, 15, 0, 0x0400, "FRAC_SDM_LSB", "" };
+const struct LMS7Parameter INT_SDM = { 0x011E, 13, 4, 120, "INT_SDM", "" };
+const struct LMS7Parameter FRAC_SDM_MSB = { 0x011E, 3, 0, 0, "FRAC_SDM_MSB", "" };
+const struct LMS7Parameter PW_DIV2_LOCH = { 0x011F, 14, 12, 3, "PW_DIV2_LOCH", "trims the duty cycle of DIV2 LOCH. Only works when forward divider is dividing by at least 2 (excluding quadrature block division). If in bypass mode, this does not work" };
+const struct LMS7Parameter PW_DIV4_LOCH = { 0x011F, 11, 9, 3, "PW_DIV4_LOCH", "trims the duty cycle of DIV4 LOCH. Only works when forward divider is dividing by at least 4 (excluding quadrature block division). If in bypass mode, this does not work" };
+const struct LMS7Parameter DIV_LOCH = { 0x011F, 8, 6, 1, "DIV_LOCH", "Controls the division ratio in the LOCH_DIV" };
+const struct LMS7Parameter TST_SX = { 0x011F, 5, 3, 0, "TST_SX",
+"Controls the test mode of PLLs. TST signal lines are shared between all PLLs (CGEN, RX and TX). Only one TST signal of any PLL should be active at a given time.\n\
+0 - TST disabled; RSSI analog outputs enabled if RSSI blocks active and when all PLL test signals are off(default)\n\
+1 - tstdo[0] = VCO / 20 clock*; tstdo[1] = VCO / 40 clock*; tstao = High impedance;\n\
+2 - tstdo[0] = SDM clock; tstdo[1] = feedback divider output; tstao = VCO tune through a 60kOhm resistor;\n\
+3 - tstdo[0] = Reference clock; tstdo[1] = feedback divider output; tstao = VCO tune through a 10kOhm resistor;\n\
+4 - tstdo[0] = High impedance; tstdo[1] = High impedance; tstao = High impedance;\n\
+5 - tstdo[0] = Charge pump Down signal; tstdo[1] = Charge pump Up signal; tstao = High impedance;\n\
+6 - tstdo[0] = High impedance; tstdo[1] = High impedance; tstao = VCO tune through a 60kOhm resistor;\n\
+7 - tstdo[0] = High impedance; tstdo[1] = High impedance; tstao = VCO tune through a 10kOhm resistor;\n\
+if TST_SX[2] = 1 --> VCO_TSTBUF active generating VCO_TST_DIV20 and VCO_TST_DIV40\n\
+* When EN_DIV2_DIVPROG_(SXR, SXT) is active, the division ratio must be multiplied by 2 (40 / 80)"};
+const struct LMS7Parameter SEL_SDMCLK = { 0x011F, 2, 2, 0, "SEL_SDMCLK", "Selects between the feedback divider output and Fref for SDM" };
+const struct LMS7Parameter SX_DITHER_EN = { 0x011F, 1, 1, 0, "SX_DITHER_EN", "Enabled dithering in SDM" };
+const struct LMS7Parameter REV_SDMCLK = { 0x011F, 0, 0, 0, "REV_SDMCLK", "Reverses the SDM clock" };
+const struct LMS7Parameter VDIV_VCO = { 0x0120, 15, 8, 185, "VDIV_VCO", "Controls VCO LDO output voltage" };
+const struct LMS7Parameter ICT_VCO = { 0x0120, 7, 0, 255, "ICT_VCO", "Scales the VCO bias current from 0 to 2.5xInom" };
+const struct LMS7Parameter RSEL_LDO_VCO = { 0x0121, 15, 11, 6, "RSEL_LDO_VCO", "Set the reference voltage that supplies bias voltage of switch-cap array and varactor" };
+const struct LMS7Parameter CSW_VCO = { 0x0121, 10, 3, 128, "CSW_VCO", "Coarse control of VCO frequency, 0 for lowest frequency and 255 for highest. This control is set by SX_SWC_calibration" };
+const struct LMS7Parameter SEL_VCO = { 0x0121, 2, 1, 2, "SEL_VCO", "Selects the active VCO. It is set by SX_SWC_calibration" };
+const struct LMS7Parameter COARSE_START = { 0x0121, 0, 0, 0, "COARSE_START", "" };
+const struct LMS7Parameter REVPH_PFD = { 0x0122, 12, 12, 0, "REVPH_PFD", "Reverse the pulses of PFD. It can be used to reverse the polarity of the PLL loop (positive feedback to negative feedback)" };
+const struct LMS7Parameter IOFFSET_CP = { 0x0122, 11, 6, 12, "IOFFSET_CP", "Scales the offset current of the charge pump, 0-->63. This current is used in Fran-N mode to create an offset in the CP response and avoid the non-linear section" };
+const struct LMS7Parameter IPULSE_CP = { 0x0122, 5, 0, 63, "IPULSE_CP", "Scales the pulse current of the charge pump" };
+const struct LMS7Parameter COARSE_STEPDONE = { 0x0123, 15, 15, 0, "COARSE_STEPDONE", "" };
+const struct LMS7Parameter COARSEPLL_COMPO = { 0x0123, 14, 14, 0, "COARSEPLL_COMPO", "" };
+const struct LMS7Parameter VCO_CMPHO = { 0x0123, 13, 13, 0, "VCO_CMPHO", "" };
+const struct LMS7Parameter VCO_CMPLO = { 0x0123, 12, 12, 0, "VCO_CMPLO", "" };
+const struct LMS7Parameter CP2_PLL = { 0x0123, 11, 8, 6, "CP2_PLL", "Controls the value of CP2 (cap from CP output to GND) in the PLL filter" };
+const struct LMS7Parameter CP3_PLL = { 0x0123, 7, 4, 7, "CP3_PLL", "Controls the value of CP3 (cap from VCO Vtune input to GND) in the PLL filter" };
+const struct LMS7Parameter CZ = { 0x0123, 3, 0, 11, "CZ", "Controls the value of CZ (Zero capacitor) in the PLL filter" };
+const struct LMS7Parameter EN_DIR_SXRSXT = { 0x0124, 4, 4, 0, "EN_DIR_SXRSXT", "Enables direct control of PDs and ENs for SXR/SXT module" };
+const struct LMS7Parameter EN_DIR_RBB = { 0x0124, 3, 3, 0, "EN_DIR_RBB", "Enables direct control of PDs and ENs for RBB module" };
+const struct LMS7Parameter EN_DIR_RFE = { 0x0124, 2, 2, 0, "EN_DIR_RFE", "Enables direct control of PDs and ENs for RFE module" };
+const struct LMS7Parameter EN_DIR_TBB = { 0x0124, 1, 1, 0, "EN_DIR_TBB", "Enables direct control of PDs and ENs for TBB module" };
+const struct LMS7Parameter EN_DIR_TRF = { 0x0124, 0, 0, 0, "EN_DIR_TRF", "Enables direct control of PDs and ENs for TRF module" };
+const struct LMS7Parameter TSGFC_TXTSP = { 0x0200, 9, 9, 0, "TSGFC_TXTSP", "TSG full scale control" };
+const struct LMS7Parameter TSGFCW_TXTSP = { 0x0200, 8, 7, 1, "TSGFCW_TXTSP", "Set frequency of TSG's NCO" };
+const struct LMS7Parameter TSGDCLDQ_TXTSP = { 0x0200, 6, 6, 0, "TSGDCLDQ_TXTSP", "" };
+const struct LMS7Parameter TSGDCLDI_TXTSP = { 0x0200, 5, 5, 0, "TSGDCLDI_TXTSP", "" };
+const struct LMS7Parameter TSGSWAPIQ_TXTSP = { 0x0200, 4, 4, 0, "TSGSWAPIQ_TXTSP", "Swap signals at test signal generator's output" };
+const struct LMS7Parameter TSGMODE_TXTSP = { 0x0200, 3, 3, 0, "TSGMODE_TXTSP", "Test signal generator mode" };
+const struct LMS7Parameter INSEL_TXTSP = { 0x0200, 2, 2, 0, "INSEL_TXTSP", "Input source of TxTSP" };
+const struct LMS7Parameter BSTART_TXTSP = { 0x0200, 1, 1, 0, "BSTART_TXTSP", "Starts delta sigma built in self test. Keep it at 1 one at least three clock cycles" };
+const struct LMS7Parameter EN_TXTSP = { 0x0200, 0, 0, 1, "EN_TXTSP", "TxTSP modules enable" };
+const struct LMS7Parameter GCORRQ_TXTSP = { 0x0201, 10, 0, 2047, "GCORRQ_TXTSP", "corrector value, channel Q Unsigned integer" };
+const struct LMS7Parameter GCORRI_TXTSP = { 0x0202, 10, 0, 2047, "GCORRI_TXTSP", "corrector value, channel I Unsigned integer" };
+const struct LMS7Parameter HBI_OVR_TXTSP = { 0x0203, 14, 12, 0, "HBI_OVR_TXTSP", "HBI interpolation ratio" };
+const struct LMS7Parameter IQCORR_TXTSP = { 0x0203, 11, 0, 0, "IQCORR_TXTSP", "Phase corrector value (tan(Alpha/2)). Integer, 2's complement" };
+const struct LMS7Parameter DCCORRI_TXTSP = { 0x0204, 15, 8, 0, "DCCORRI_TXTSP", "DC corrector value, channel I. Integer, 2's complement" };
+const struct LMS7Parameter DCCORRQ_TXTSP = { 0x0204, 7, 0, 0, "DCCORRQ_TXTSP", "DC corrector value, channel Q. Integer, 2's complement" };
+const struct LMS7Parameter GFIR1_L_TXTSP = { 0x0205, 10, 8, 0, "GFIR1_L_TXTSP", "Parameter l of GFIR1 (l = roundUp(CoeffN/5)-1). Unsigned integer" };
+const struct LMS7Parameter GFIR1_N_TXTSP = { 0x0205, 7, 0, 0, "GFIR1_N_TXTSP", "Clock division ratio of GFIR1 is GFIR1_N + 1. Unsigned integer" };
+const struct LMS7Parameter GFIR2_L_TXTSP = { 0x0206, 10, 8, 0, "GFIR2_L_TXTSP", "Parameter l of GFIR2 (l = roundUp(CoeffN/5)-1). Unsigned integer" };
+const struct LMS7Parameter GFIR2_N_TXTSP = { 0x0206, 7, 0, 0, "GFIR2_N_TXTSP", "Clock division ratio of GFIR2 is GFIR2_N + 1. Unsigned integer" };
+const struct LMS7Parameter GFIR3_L_TXTSP = { 0x0207, 10, 8, 0, "GFIR3_L_TXTSP", "Parameter l of GFIR3 (l = roundUp(CoeffN/5)-1). Unsigned integer" };
+const struct LMS7Parameter GFIR3_N_TXTSP = { 0x0207, 7, 0, 0, "GFIR3_N_TXTSP", "Clock division ratio of GFIR3 is GFIR3_N + 1. Unsigned integer" };
+const struct LMS7Parameter CMIX_GAIN_TXTSP = { 0x0208, 15, 14, 0, "CMIX_GAIN_TXTSP", "Gain of CMIX output" };
+const struct LMS7Parameter CMIX_SC_TXTSP = { 0x0208, 13, 13, 0, "CMIX_SC_TXTSP", "Spectrum control of CMIX" };
+const struct LMS7Parameter CMIX_BYP_TXTSP = { 0x0208, 8, 8, 0, "CMIX_BYP_TXTSP", "CMIX bypass" };
+const struct LMS7Parameter ISINC_BYP_TXTSP = { 0x0208, 7, 7, 0, "ISINC_BYP_TXTSP", "ISINC bypass" };
+const struct LMS7Parameter GFIR3_BYP_TXTSP = { 0x0208, 6, 6, 0, "GFIR3_BYP_TXTSP", "GFIR3 bypass" };
+const struct LMS7Parameter GFIR2_BYP_TXTSP = { 0x0208, 5, 5, 0, "GFIR2_BYP_TXTSP", "GFIR2 bypass" };
+const struct LMS7Parameter GFIR1_BYP_TXTSP = { 0x0208, 4, 4, 0, "GFIR1_BYP_TXTSP", "GFIR1 bypass" };
+const struct LMS7Parameter DC_BYP_TXTSP = { 0x0208, 3, 3, 0, "DC_BYP_TXTSP", "DC corrector bypass" };
+const struct LMS7Parameter GC_BYP_TXTSP = { 0x0208, 1, 1, 0, "GC_BYP_TXTSP", "Gain corrector bypass" };
+const struct LMS7Parameter PH_BYP_TXTSP = { 0x0208, 0, 0, 0, "PH_BYP_TXTSP", "Phase corrector bypass" };
+const struct LMS7Parameter BSIGI_TXTSP = { 0x0209, 23, 1, 0, "BSIGI_TXTSP", "" };
+const struct LMS7Parameter BSTATE_TXTSP = { 0x0209, 0, 0, 0, "BSTATE_TXTSP", "" };
+const struct LMS7Parameter BSIGQ_TXTSP = { 0x020A, 30, 8, 0, "BSIGQ_TXTSP", "" };
+const struct LMS7Parameter DC_REG_TXTSP = { 0x020C, 15, 0, 0, "DC_REG_TXTSP", "" };
+const struct LMS7Parameter DTHBIT_TX = { 0x0240, 8, 5, 1, "DTHBIT_TX", "NCO bits to dither" };
+const struct LMS7Parameter SEL_TX = { 0x0240, 4, 1, 0, "SEL_TX", "" };
+const struct LMS7Parameter MODE_TX = { 0x0240, 0, 0, 0, "MODE_TX", "" };
+const struct LMS7Parameter CAPTURE = { 0x0400, 15, 15, 0, "CAPTURE", "" };
+const struct LMS7Parameter CAPSEL = { 0x0400, 14, 13, 0, "CAPSEL", "" };
+const struct LMS7Parameter CAPSEL_ADC = { 0x0400, 12, 12, 0, "CAPSEL_ADC", "" };
+const struct LMS7Parameter TSGFC_RXTSP = { 0x0400, 9, 9, 0, "TSGFC_RXTSP", "TSG full scale control" };
+const struct LMS7Parameter TSGFCW_RXTSP = { 0x0400, 8, 7, 1, "TSGFCW_RXTSP", "Set frequency of TSG's NCO" };
+const struct LMS7Parameter TSGDCLDQ_RXTSP = { 0x0400, 6, 6, 0, "TSGDCLDQ_RXTSP", "" };
+const struct LMS7Parameter TSGDCLDI_RXTSP = { 0x0400, 5, 5, 0, "TSGDCLDI_RXTSP", "" };
+const struct LMS7Parameter TSGSWAPIQ_RXTSP = { 0x0400, 4, 4, 0, "TSGSWAPIQ_RXTSP", "Swap signals at test signal generator's output" };
+const struct LMS7Parameter TSGMODE_RXTSP = { 0x0400, 3, 3, 0, "TSGMODE_RXTSP", "Test signal generator mode" };
+const struct LMS7Parameter INSEL_RXTSP = { 0x0400, 2, 2, 0, "INSEL_RXTSP", "Input source of RxTSP" };
+const struct LMS7Parameter BSTART_RXTSP = { 0x0400, 1, 1, 0, "BSTART_RXTSP", "Starts delta sigma built in self test. Keep it at 1 one at least three clock cycles" };
+const struct LMS7Parameter EN_RXTSP = { 0x0400, 0, 0, 1, "EN_RXTSP", "RxTSP modules enable" };
+const struct LMS7Parameter GCORRQ_RXTSP = { 0x0401, 10, 0, 2047, "GCORRQ_RXTSP", "corrector value, channel Q Unsigned integer" };
+const struct LMS7Parameter GCORRI_RXTSP = { 0x0402, 10, 0, 2047, "GCORRI_RXTSP", "corrector value, channel I Unsigned integer" };
+const struct LMS7Parameter HBD_OVR_RXTSP = { 0x0403, 14, 12, 0, "HBD_OVR_RXTSP", "HBD interpolation ratio. Interpolation ratio is 2HBD_OVR+1" };
+const struct LMS7Parameter IQCORR_RXTSP = { 0x0403, 11, 0, 0, "IQCORR_RXTSP", "Phase corrector value (tan(Alpha/2)). Integer, 2's complement" };
+const struct LMS7Parameter HBD_DLY = { 0x0404, 15, 13, 0, "HBD_DLY", "" };
+const struct LMS7Parameter DCLOOP_BYP = { 0x0404, 8, 8, 0, "DCLOOP_BYP", "" };
+const struct LMS7Parameter DCCORR_AVG_RXTSP = { 0x0404, 2, 0, 0, "DCCORR_AVG_RXTSP", "Number of samples to average for Automatic DC corrector. Number of samples to average is 2DCCORR_AVG + 12" };
+const struct LMS7Parameter GFIR1_L_RXTSP = { 0x0405, 10, 8, 0, "GFIR1_L_RXTSP", "Parameter l of GFIR1 (l = roundUp(CoeffN/5)-1). Unsigned integer" };
+const struct LMS7Parameter GFIR1_N_RXTSP = { 0x0405, 7, 0, 0, "GFIR1_N_RXTSP", "Clock division ratio of GFIR1 is GFIR1_N + 1. Unsigned integer" };
+const struct LMS7Parameter GFIR2_L_RXTSP = { 0x0406, 10, 8, 0, "GFIR2_L_RXTSP", "Parameter l of GFIR2 (l = roundUp(CoeffN/5)-1). Unsigned integer" };
+const struct LMS7Parameter GFIR2_N_RXTSP = { 0x0406, 7, 0, 0, "GFIR2_N_RXTSP", "Clock division ratio of GFIR2 is GFIR2_N + 1. Unsigned integer" };
+const struct LMS7Parameter GFIR3_L_RXTSP = { 0x0407, 10, 8, 0, "GFIR3_L_RXTSP", "Parameter l of GFIR3 (l = roundUp(CoeffN/5)-1). Unsigned integer" };
+const struct LMS7Parameter GFIR3_N_RXTSP = { 0x0407, 7, 0, 0, "GFIR3_N_RXTSP", "Clock division ratio of GFIR3 is GFIR3_N + 1. Unsigned integer" };
+const struct LMS7Parameter AGC_K_RXTSP = { 0x0408, 17, 0, 0, "AGC_K_RXTSP", "AGC loop gain" };
+const struct LMS7Parameter AGC_ADESIRED_RXTSP = { 0x0409, 15, 4, 0, "AGC_ADESIRED_RXTSP", "AGC_ADESIRED" };
+const struct LMS7Parameter RSSI_MODE = { 0x040A, 15, 14, 0, "RSSI_MODE", "" };
+const struct LMS7Parameter AGC_MODE_RXTSP = { 0x040A, 13, 12, 0, "AGC_MODE_RXTSP", "" };
+const struct LMS7Parameter AGC_AVG_RXTSP = { 0x040A, 2, 0, 0, "AGC_AVG_RXTSP", "AGC Averaging window size" };
+const struct LMS7Parameter DC_REG_RXTSP = { 0x040B, 15, 0, 0, "DC_REG_RXTSP", "" };
+const struct LMS7Parameter CMIX_GAIN_RXTSP = { 0x040C, 15, 14, 0, "CMIX_GAIN_RXTSP", "Gain of CMIX output" };
+const struct LMS7Parameter CMIX_SC_RXTSP = { 0x040C, 13, 13, 0, "CMIX_SC_RXTSP", "Spectrum control of CMIX" };
+const struct LMS7Parameter CMIX_BYP_RXTSP = { 0x040C, 7, 7, 0, "CMIX_BYP_RXTSP", "CMIX bypass" };
+const struct LMS7Parameter AGC_BYP_RXTSP = { 0x040C, 6, 6, 0, "AGC_BYP_RXTSP", "AGC bypass" };
+const struct LMS7Parameter GFIR3_BYP_RXTSP = { 0x040C, 5, 5, 0, "GFIR3_BYP_RXTSP", "GFIR3 bypass" };
+const struct LMS7Parameter GFIR2_BYP_RXTSP = { 0x040C, 4, 4, 0, "GFIR2_BYP_RXTSP", "GFIR2 bypass" };
+const struct LMS7Parameter GFIR1_BYP_RXTSP = { 0x040C, 3, 3, 0, "GFIR1_BYP_RXTSP", "GFIR1 bypass" };
+const struct LMS7Parameter DC_BYP_RXTSP = { 0x040C, 2, 2, 0, "DC_BYP_RXTSP", "DC corrector bypass" };
+const struct LMS7Parameter GC_BYP_RXTSP = { 0x040C, 1, 1, 0, "GC_BYP_RXTSP", "Gain corrector bypass" };
+const struct LMS7Parameter PH_BYP_RXTSP = { 0x040C, 0, 0, 0, "PH_BYP_RXTSP", "Phase corrector bypass" };
+const struct LMS7Parameter CAPD = { 0x040E, 31, 0, 0, "CAPD", "" };
+const struct LMS7Parameter DTHBIT_RX = { 0x0440, 8, 5, 1, "DTHBIT_RX", "NCO bits to dither" };
+const struct LMS7Parameter SEL_RX = { 0x0440, 4, 1, 0, "SEL_RX", "" };
+const struct LMS7Parameter MODE_RX = { 0x0440, 0, 0, 0, "MODE_RX", "" };
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_parameters.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_parameters.h
new file mode 100644
index 0000000000000000000000000000000000000000..3fc4e0be6bbc956592d42cc99ae00b95851805af
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_parameters.h
@@ -0,0 +1,613 @@
+/**
+@file	LMS7002M_parameters.h
+@author Lime Microsystems (www.limemicro.com)
+@brief 	List of LMS7002M transceiver control parameters
+*/
+
+#ifndef LMS7002M_PARAMETERS_H
+#define LMS7002M_PARAMETERS_H
+
+#include "typedefs.h"
+#include <vector>
+
+struct LMS7Parameter;
+extern std::vector<const LMS7Parameter*> LMS7parameterList;
+
+struct LMS7Parameter
+{
+    LMS7Parameter() : address(0), msb(0), lsb(0), defaultValue(0), name(nullptr), tooltip(nullptr)
+    {
+    }
+
+    LMS7Parameter(uint16_t address, uint8_t msb, uint8_t lsb, uint16_t defaultValue, const char *name, const char* tooltip)
+        : address(address), msb(msb), lsb(lsb), defaultValue(defaultValue), name(name), tooltip(tooltip)
+    {
+        LMS7parameterList.push_back(this);
+    }
+
+    uint16_t address;
+    uint8_t msb;
+    uint8_t lsb;
+    uint16_t defaultValue;
+    const char* name;
+    const char* tooltip;
+    inline bool operator==(const LMS7Parameter& obj)
+    {
+        if (address == obj.address && msb == obj.msb && lsb == obj.lsb)
+            return true;
+        return false;
+    };
+};
+
+extern const struct LMS7Parameter LRST_TX_B;
+extern const struct LMS7Parameter MRST_TX_B;
+extern const struct LMS7Parameter LRST_TX_A;
+extern const struct LMS7Parameter MRST_TX_A;
+extern const struct LMS7Parameter LRST_RX_B;
+extern const struct LMS7Parameter MRST_RX_B;
+extern const struct LMS7Parameter LRST_RX_A;
+extern const struct LMS7Parameter MRST_RX_A;
+extern const struct LMS7Parameter SRST_RXFIFO;
+extern const struct LMS7Parameter SRST_TXFIFO;
+extern const struct LMS7Parameter RXEN_B;
+extern const struct LMS7Parameter RXEN_A;
+extern const struct LMS7Parameter TXEN_B;
+extern const struct LMS7Parameter TXEN_A;
+extern const struct LMS7Parameter MAC;
+extern const struct LMS7Parameter TX_CLK_PE;
+extern const struct LMS7Parameter RX_CLK_PE;
+extern const struct LMS7Parameter SDA_PE;
+extern const struct LMS7Parameter SDA_DS;
+extern const struct LMS7Parameter SCL_PE;
+extern const struct LMS7Parameter SCL_DS;
+extern const struct LMS7Parameter SDIO_DS;
+extern const struct LMS7Parameter SDIO_PE;
+extern const struct LMS7Parameter SDO_PE;
+extern const struct LMS7Parameter SCLK_PE;
+extern const struct LMS7Parameter SEN_PE;
+extern const struct LMS7Parameter SPIMODE;
+extern const struct LMS7Parameter DIQ2_DS;
+extern const struct LMS7Parameter DIQ2_PE;
+extern const struct LMS7Parameter IQ_SEL_EN_2_PE;
+extern const struct LMS7Parameter TXNRX2_PE;
+extern const struct LMS7Parameter FCLK2_PE;
+extern const struct LMS7Parameter MCLK2_PE;
+extern const struct LMS7Parameter DIQ1_DS;
+extern const struct LMS7Parameter DIQ1_PE;
+extern const struct LMS7Parameter IQ_SEL_EN_1_PE;
+extern const struct LMS7Parameter TXNRX1_PE;
+extern const struct LMS7Parameter FCLK1_PE;
+extern const struct LMS7Parameter MCLK1_PE;
+extern const struct LMS7Parameter DIQDIRCTR2;
+extern const struct LMS7Parameter DIQDIR2;
+extern const struct LMS7Parameter DIQDIRCTR1;
+extern const struct LMS7Parameter DIQDIR1;
+extern const struct LMS7Parameter ENABLEDIRCTR2;
+extern const struct LMS7Parameter ENABLEDIR2;
+extern const struct LMS7Parameter ENABLEDIRCTR1;
+extern const struct LMS7Parameter ENABLEDIR1;
+extern const struct LMS7Parameter MOD_EN;
+extern const struct LMS7Parameter LML2_FIDM;
+extern const struct LMS7Parameter LML2_TXNRXIQ;
+extern const struct LMS7Parameter LML2_MODE;
+extern const struct LMS7Parameter LML1_FIDM;
+extern const struct LMS7Parameter LML1_TXNRXIQ;
+extern const struct LMS7Parameter LML1_MODE;
+extern const struct LMS7Parameter LML1_S3S;
+extern const struct LMS7Parameter LML1_S2S;
+extern const struct LMS7Parameter LML1_S1S;
+extern const struct LMS7Parameter LML1_S0S;
+extern const struct LMS7Parameter LML1_BQP;
+extern const struct LMS7Parameter LML1_BIP;
+extern const struct LMS7Parameter LML1_AQP;
+extern const struct LMS7Parameter LML1_AIP;
+extern const struct LMS7Parameter LML1_BB2RF_PST;
+extern const struct LMS7Parameter LML1_BB2RF_PRE;
+extern const struct LMS7Parameter LML1_RF2BB_PST;
+extern const struct LMS7Parameter LML1_RF2BB_PRE;
+extern const struct LMS7Parameter LML2_S3S;
+extern const struct LMS7Parameter LML2_S2S;
+extern const struct LMS7Parameter LML2_S1S;
+extern const struct LMS7Parameter LML2_S0S;
+extern const struct LMS7Parameter LML2_BQP;
+extern const struct LMS7Parameter LML2_BIP;
+extern const struct LMS7Parameter LML2_AQP;
+extern const struct LMS7Parameter LML2_AIP;
+extern const struct LMS7Parameter LML2_BB2RF_PST;
+extern const struct LMS7Parameter LML2_BB2RF_PRE;
+extern const struct LMS7Parameter LML2_RF2BB_PST;
+extern const struct LMS7Parameter LML2_RF2BB_PRE;
+extern const struct LMS7Parameter FCLK2_DLY;
+extern const struct LMS7Parameter FCLK1_DLY;
+extern const struct LMS7Parameter RX_MUX;
+extern const struct LMS7Parameter TX_MUX;
+extern const struct LMS7Parameter TXRDCLK_MUX;
+extern const struct LMS7Parameter TXWRCLK_MUX;
+extern const struct LMS7Parameter RXRDCLK_MUX;
+extern const struct LMS7Parameter RXWRCLK_MUX;
+extern const struct LMS7Parameter FCLK2_INV;
+extern const struct LMS7Parameter FCLK1_INV;
+extern const struct LMS7Parameter MCLK2DLY;
+extern const struct LMS7Parameter MCLK1DLY;
+extern const struct LMS7Parameter MCLK2SRC;
+extern const struct LMS7Parameter MCLK1SRC;
+extern const struct LMS7Parameter TXDIVEN;
+extern const struct LMS7Parameter RXDIVEN;
+extern const struct LMS7Parameter TXTSPCLKA_DIV;
+extern const struct LMS7Parameter RXTSPCLKA_DIV;
+extern const struct LMS7Parameter MIMO_SISO;
+extern const struct LMS7Parameter VER;
+extern const struct LMS7Parameter REV;
+extern const struct LMS7Parameter MASK;
+extern const struct LMS7Parameter EN_DIR_LDO;
+extern const struct LMS7Parameter EN_DIR_CGEN;
+extern const struct LMS7Parameter EN_DIR_XBUF;
+extern const struct LMS7Parameter EN_DIR_AFE;
+extern const struct LMS7Parameter ISEL_DAC_AFE;
+extern const struct LMS7Parameter MODE_INTERLEAVE_AFE;
+extern const struct LMS7Parameter MUX_AFE_1;
+extern const struct LMS7Parameter MUX_AFE_2;
+extern const struct LMS7Parameter PD_AFE;
+extern const struct LMS7Parameter PD_RX_AFE1;
+extern const struct LMS7Parameter PD_RX_AFE2;
+extern const struct LMS7Parameter PD_TX_AFE1;
+extern const struct LMS7Parameter PD_TX_AFE2;
+extern const struct LMS7Parameter EN_G_AFE;
+extern const struct LMS7Parameter MUX_BIAS_OUT;
+extern const struct LMS7Parameter RP_CALIB_BIAS;
+extern const struct LMS7Parameter PD_FRP_BIAS;
+extern const struct LMS7Parameter PD_F_BIAS;
+extern const struct LMS7Parameter PD_PTRP_BIAS;
+extern const struct LMS7Parameter PD_PT_BIAS;
+extern const struct LMS7Parameter PD_BIAS_MASTER;
+extern const struct LMS7Parameter SLFB_XBUF_RX;
+extern const struct LMS7Parameter SLFB_XBUF_TX;
+extern const struct LMS7Parameter BYP_XBUF_RX;
+extern const struct LMS7Parameter BYP_XBUF_TX;
+extern const struct LMS7Parameter EN_OUT2_XBUF_TX;
+extern const struct LMS7Parameter EN_TBUFIN_XBUF_RX;
+extern const struct LMS7Parameter PD_XBUF_RX;
+extern const struct LMS7Parameter PD_XBUF_TX;
+extern const struct LMS7Parameter EN_G_XBUF;
+extern const struct LMS7Parameter SPDUP_VCO_CGEN;
+extern const struct LMS7Parameter RESET_N_CGEN;
+extern const struct LMS7Parameter EN_ADCCLKH_CLKGN;
+extern const struct LMS7Parameter EN_COARSE_CKLGEN;
+extern const struct LMS7Parameter EN_INTONLY_SDM_CGEN;
+extern const struct LMS7Parameter EN_SDM_CLK_CGEN;
+extern const struct LMS7Parameter PD_CP_CGEN;
+extern const struct LMS7Parameter PD_FDIV_FB_CGEN;
+extern const struct LMS7Parameter PD_FDIV_O_CGEN;
+extern const struct LMS7Parameter PD_SDM_CGEN;
+extern const struct LMS7Parameter PD_VCO_CGEN;
+extern const struct LMS7Parameter PD_VCO_COMP_CGEN;
+extern const struct LMS7Parameter EN_G_CGEN;
+extern const struct LMS7Parameter FRAC_SDM_CGEN_LSB;
+extern const struct LMS7Parameter INT_SDM_CGEN;
+extern const struct LMS7Parameter FRAC_SDM_CGEN_MSB;
+extern const struct LMS7Parameter REV_SDMCLK_CGEN;
+extern const struct LMS7Parameter SEL_SDMCLK_CGEN;
+extern const struct LMS7Parameter SX_DITHER_EN_CGEN;
+extern const struct LMS7Parameter CLKH_OV_CLKL_CGEN;
+extern const struct LMS7Parameter DIV_OUTCH_CGEN;
+extern const struct LMS7Parameter TST_CGEN;
+extern const struct LMS7Parameter REV_CLKDAC_CGEN;
+extern const struct LMS7Parameter CMPLO_CTRL_CGEN;
+extern const struct LMS7Parameter REV_CLKADC_CGEN;
+extern const struct LMS7Parameter REVPH_PFD_CGEN;
+extern const struct LMS7Parameter IOFFSET_CP_CGEN;
+extern const struct LMS7Parameter IPULSE_CP_CGEN;
+extern const struct LMS7Parameter ICT_VCO_CGEN;
+extern const struct LMS7Parameter CSW_VCO_CGEN;
+extern const struct LMS7Parameter COARSE_START_CGEN;
+extern const struct LMS7Parameter COARSE_STEPDONE_CGEN;
+extern const struct LMS7Parameter COARSEPLL_COMPO_CGEN;
+extern const struct LMS7Parameter VCO_CMPHO_CGEN;
+extern const struct LMS7Parameter VCO_CMPLO_CGEN;
+extern const struct LMS7Parameter CP2_CGEN;
+extern const struct LMS7Parameter CP3_CGEN;
+extern const struct LMS7Parameter CZ_CGEN;
+extern const struct LMS7Parameter EN_LDO_DIG;
+extern const struct LMS7Parameter EN_LDO_DIGGN;
+extern const struct LMS7Parameter EN_LDO_DIGSXR;
+extern const struct LMS7Parameter EN_LDO_DIGSXT;
+extern const struct LMS7Parameter EN_LDO_DIVGN;
+extern const struct LMS7Parameter EN_LDO_DIVSXR;
+extern const struct LMS7Parameter EN_LDO_DIVSXT;
+extern const struct LMS7Parameter EN_LDO_LNA12;
+extern const struct LMS7Parameter EN_LDO_LNA14;
+extern const struct LMS7Parameter EN_LDO_MXRFE;
+extern const struct LMS7Parameter EN_LDO_RBB;
+extern const struct LMS7Parameter EN_LDO_RXBUF;
+extern const struct LMS7Parameter EN_LDO_TBB;
+extern const struct LMS7Parameter EN_LDO_TIA12;
+extern const struct LMS7Parameter EN_LDO_TIA14;
+extern const struct LMS7Parameter EN_G_LDO;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_TLOB;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_TPAD;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_TXBUF;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_VCOGN;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_VCOSXR;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_VCOSXT;
+extern const struct LMS7Parameter EN_LDO_AFE;
+extern const struct LMS7Parameter EN_LDO_CPGN;
+extern const struct LMS7Parameter EN_LDO_CPSXR;
+extern const struct LMS7Parameter EN_LDO_TLOB;
+extern const struct LMS7Parameter EN_LDO_TPAD;
+extern const struct LMS7Parameter EN_LDO_TXBUF;
+extern const struct LMS7Parameter EN_LDO_VCOGN;
+extern const struct LMS7Parameter EN_LDO_VCOSXR;
+extern const struct LMS7Parameter EN_LDO_VCOSXT;
+extern const struct LMS7Parameter EN_LDO_CPSXT;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_CPSXT;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_DIG;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_DIGGN;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_DIGSXR;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_DIGSXT;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_DIVGN;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_DIVSXR;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_DIVSXT;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_LNA12;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_LNA14;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_MXRFE;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_RBB;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_RXBUF;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_TBB;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_TIA12;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_TIA14;
+extern const struct LMS7Parameter BYP_LDO_TBB;
+extern const struct LMS7Parameter BYP_LDO_TIA12;
+extern const struct LMS7Parameter BYP_LDO_TIA14;
+extern const struct LMS7Parameter BYP_LDO_TLOB;
+extern const struct LMS7Parameter BYP_LDO_TPAD;
+extern const struct LMS7Parameter BYP_LDO_TXBUF;
+extern const struct LMS7Parameter BYP_LDO_VCOGN;
+extern const struct LMS7Parameter BYP_LDO_VCOSXR;
+extern const struct LMS7Parameter BYP_LDO_VCOSXT;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_AFE;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_CPGN;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_CPSXR;
+extern const struct LMS7Parameter BYP_LDO_AFE;
+extern const struct LMS7Parameter BYP_LDO_CPGN;
+extern const struct LMS7Parameter BYP_LDO_CPSXR;
+extern const struct LMS7Parameter BYP_LDO_CPSXT;
+extern const struct LMS7Parameter BYP_LDO_DIG;
+extern const struct LMS7Parameter BYP_LDO_DIGGN;
+extern const struct LMS7Parameter BYP_LDO_DIGSXR;
+extern const struct LMS7Parameter BYP_LDO_DIGSXT;
+extern const struct LMS7Parameter BYP_LDO_DIVGN;
+extern const struct LMS7Parameter BYP_LDO_DIVSXR;
+extern const struct LMS7Parameter BYP_LDO_DIVSXT;
+extern const struct LMS7Parameter BYP_LDO_LNA12;
+extern const struct LMS7Parameter BYP_LDO_LNA14;
+extern const struct LMS7Parameter BYP_LDO_MXRFE;
+extern const struct LMS7Parameter BYP_LDO_RBB;
+extern const struct LMS7Parameter BYP_LDO_RXBUF;
+extern const struct LMS7Parameter SPDUP_LDO_DIVSXR;
+extern const struct LMS7Parameter SPDUP_LDO_DIVSXT;
+extern const struct LMS7Parameter SPDUP_LDO_LNA12;
+extern const struct LMS7Parameter SPDUP_LDO_LNA14;
+extern const struct LMS7Parameter SPDUP_LDO_MXRFE;
+extern const struct LMS7Parameter SPDUP_LDO_RBB;
+extern const struct LMS7Parameter SPDUP_LDO_RXBUF;
+extern const struct LMS7Parameter SPDUP_LDO_TBB;
+extern const struct LMS7Parameter SPDUP_LDO_TIA12;
+extern const struct LMS7Parameter SPDUP_LDO_TIA14;
+extern const struct LMS7Parameter SPDUP_LDO_TLOB;
+extern const struct LMS7Parameter SPDUP_LDO_TPAD;
+extern const struct LMS7Parameter SPDUP_LDO_TXBUF;
+extern const struct LMS7Parameter SPDUP_LDO_VCOGN;
+extern const struct LMS7Parameter SPDUP_LDO_VCOSXR;
+extern const struct LMS7Parameter SPDUP_LDO_VCOSXT;
+extern const struct LMS7Parameter SPDUP_LDO_AFE;
+extern const struct LMS7Parameter SPDUP_LDO_CPGN;
+extern const struct LMS7Parameter SPDUP_LDO_CPSXR;
+extern const struct LMS7Parameter SPDUP_LDO_CPSXT;
+extern const struct LMS7Parameter SPDUP_LDO_DIG;
+extern const struct LMS7Parameter SPDUP_LDO_DIGGN;
+extern const struct LMS7Parameter SPDUP_LDO_DIGSXR;
+extern const struct LMS7Parameter SPDUP_LDO_DIGSXT;
+extern const struct LMS7Parameter SPDUP_LDO_DIVGN;
+extern const struct LMS7Parameter RDIV_VCOSXR;
+extern const struct LMS7Parameter RDIV_VCOSXT;
+extern const struct LMS7Parameter RDIV_TXBUF;
+extern const struct LMS7Parameter RDIV_VCOGN;
+extern const struct LMS7Parameter RDIV_TLOB;
+extern const struct LMS7Parameter RDIV_TPAD;
+extern const struct LMS7Parameter RDIV_TIA12;
+extern const struct LMS7Parameter RDIV_TIA14;
+extern const struct LMS7Parameter RDIV_RXBUF;
+extern const struct LMS7Parameter RDIV_TBB;
+extern const struct LMS7Parameter RDIV_MXRFE;
+extern const struct LMS7Parameter RDIV_RBB;
+extern const struct LMS7Parameter RDIV_LNA12;
+extern const struct LMS7Parameter RDIV_LNA14;
+extern const struct LMS7Parameter RDIV_DIVSXR;
+extern const struct LMS7Parameter RDIV_DIVSXT;
+extern const struct LMS7Parameter RDIV_DIGSXT;
+extern const struct LMS7Parameter RDIV_DIVGN;
+extern const struct LMS7Parameter RDIV_DIGGN;
+extern const struct LMS7Parameter RDIV_DIGSXR;
+extern const struct LMS7Parameter RDIV_CPSXT;
+extern const struct LMS7Parameter RDIV_DIG;
+extern const struct LMS7Parameter RDIV_CPGN;
+extern const struct LMS7Parameter RDIV_CPSXR;
+extern const struct LMS7Parameter RDIV_SPIBUF;
+extern const struct LMS7Parameter RDIV_AFE;
+extern const struct LMS7Parameter SPDUP_LDO_SPIBUF;
+extern const struct LMS7Parameter SPDUP_LDO_DIGIp2;
+extern const struct LMS7Parameter SPDUP_LDO_DIGIp1;
+extern const struct LMS7Parameter BYP_LDO_SPIBUF;
+extern const struct LMS7Parameter BYP_LDO_DIGIp2;
+extern const struct LMS7Parameter BYP_LDO_DIGIp1;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_SPIBUF;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_DIGIp2;
+extern const struct LMS7Parameter EN_LOADIMP_LDO_DIGIp1;
+extern const struct LMS7Parameter PD_LDO_SPIBUF;
+extern const struct LMS7Parameter PD_LDO_DIGIp2;
+extern const struct LMS7Parameter PD_LDO_DIGIp1;
+extern const struct LMS7Parameter EN_G_LDOP;
+extern const struct LMS7Parameter RDIV_DIGIp2;
+extern const struct LMS7Parameter RDIV_DIGIp1;
+extern const struct LMS7Parameter BSIGT;
+extern const struct LMS7Parameter BSTATE;
+extern const struct LMS7Parameter EN_SDM_TSTO_SXT;
+extern const struct LMS7Parameter EN_SDM_TSTO_SXR;
+extern const struct LMS7Parameter EN_SDM_TSTO_CGEN;
+extern const struct LMS7Parameter BENC;
+extern const struct LMS7Parameter BENR;
+extern const struct LMS7Parameter BENT;
+extern const struct LMS7Parameter BSTART;
+extern const struct LMS7Parameter BSIGR;
+extern const struct LMS7Parameter BSIGC;
+extern const struct LMS7Parameter CDS_MCLK2;
+extern const struct LMS7Parameter CDS_MCLK1;
+extern const struct LMS7Parameter CDSN_TXBTSP;
+extern const struct LMS7Parameter CDSN_TXATSP;
+extern const struct LMS7Parameter CDSN_RXBTSP;
+extern const struct LMS7Parameter CDSN_RXATSP;
+extern const struct LMS7Parameter CDSN_TXBLML;
+extern const struct LMS7Parameter CDSN_TXALML;
+extern const struct LMS7Parameter CDSN_RXBLML;
+extern const struct LMS7Parameter CDSN_RXALML;
+extern const struct LMS7Parameter CDSN_MCLK2;
+extern const struct LMS7Parameter CDSN_MCLK1;
+extern const struct LMS7Parameter CDS_TXBTSP;
+extern const struct LMS7Parameter CDS_TXATSP;
+extern const struct LMS7Parameter CDS_RXBTSP;
+extern const struct LMS7Parameter CDS_RXATSP;
+extern const struct LMS7Parameter CDS_TXBLML;
+extern const struct LMS7Parameter CDS_TXALML;
+extern const struct LMS7Parameter CDS_RXBLML;
+extern const struct LMS7Parameter CDS_RXALML;
+extern const struct LMS7Parameter EN_LOWBWLOMX_TMX_TRF;
+extern const struct LMS7Parameter EN_NEXTTX_TRF;
+extern const struct LMS7Parameter EN_AMPHF_PDET_TRF;
+extern const struct LMS7Parameter LOADR_PDET_TRF;
+extern const struct LMS7Parameter PD_PDET_TRF;
+extern const struct LMS7Parameter PD_TLOBUF_TRF;
+extern const struct LMS7Parameter PD_TXPAD_TRF;
+extern const struct LMS7Parameter EN_G_TRF;
+extern const struct LMS7Parameter F_TXPAD_TRF;
+extern const struct LMS7Parameter L_LOOPB_TXPAD_TRF;
+extern const struct LMS7Parameter LOSS_LIN_TXPAD_TRF;
+extern const struct LMS7Parameter LOSS_MAIN_TXPAD_TRF;
+extern const struct LMS7Parameter EN_LOOPB_TXPAD_TRF;
+extern const struct LMS7Parameter GCAS_GNDREF_TXPAD_TRF;
+extern const struct LMS7Parameter ICT_LIN_TXPAD_TRF;
+extern const struct LMS7Parameter ICT_MAIN_TXPAD_TRF;
+extern const struct LMS7Parameter VGCAS_TXPAD_TRF;
+extern const struct LMS7Parameter SEL_BAND1_TRF;
+extern const struct LMS7Parameter SEL_BAND2_TRF;
+extern const struct LMS7Parameter LOBIASN_TXM_TRF;
+extern const struct LMS7Parameter LOBIASP_TXX_TRF;
+extern const struct LMS7Parameter CDC_I_TRF;
+extern const struct LMS7Parameter CDC_Q_TRF;
+extern const struct LMS7Parameter STATPULSE_TBB;
+extern const struct LMS7Parameter LOOPB_TBB;
+extern const struct LMS7Parameter PD_LPFH_TBB;
+extern const struct LMS7Parameter PD_LPFIAMP_TBB;
+extern const struct LMS7Parameter PD_LPFLAD_TBB;
+extern const struct LMS7Parameter PD_LPFS5_TBB;
+extern const struct LMS7Parameter EN_G_TBB;
+extern const struct LMS7Parameter ICT_LPFS5_F_TBB;
+extern const struct LMS7Parameter ICT_LPFS5_PT_TBB;
+extern const struct LMS7Parameter ICT_LPF_H_PT_TBB;
+extern const struct LMS7Parameter ICT_LPFH_F_TBB;
+extern const struct LMS7Parameter ICT_LPFLAD_F_TBB;
+extern const struct LMS7Parameter ICT_LPFLAD_PT_TBB;
+extern const struct LMS7Parameter CG_IAMP_TBB;
+extern const struct LMS7Parameter ICT_IAMP_FRP_TBB;
+extern const struct LMS7Parameter ICT_IAMP_GG_FRP_TBB;
+extern const struct LMS7Parameter RCAL_LPFH_TBB;
+extern const struct LMS7Parameter RCAL_LPFLAD_TBB;
+extern const struct LMS7Parameter TSTIN_TBB;
+extern const struct LMS7Parameter BYPLADDER_TBB;
+extern const struct LMS7Parameter CCAL_LPFLAD_TBB;
+extern const struct LMS7Parameter RCAL_LPFS5_TBB;
+extern const struct LMS7Parameter CDC_I_RFE;
+extern const struct LMS7Parameter CDC_Q_RFE;
+extern const struct LMS7Parameter PD_LNA_RFE;
+extern const struct LMS7Parameter PD_RLOOPB_1_RFE;
+extern const struct LMS7Parameter PD_RLOOPB_2_RFE;
+extern const struct LMS7Parameter PD_MXLOBUF_RFE;
+extern const struct LMS7Parameter PD_QGEN_RFE;
+extern const struct LMS7Parameter PD_RSSI_RFE;
+extern const struct LMS7Parameter PD_TIA_RFE;
+extern const struct LMS7Parameter EN_G_RFE;
+extern const struct LMS7Parameter SEL_PATH_RFE;
+extern const struct LMS7Parameter EN_DCOFF_RXFE_RFE;
+extern const struct LMS7Parameter EN_INSHSW_LB1_RFE;
+extern const struct LMS7Parameter EN_INSHSW_LB2_RFE;
+extern const struct LMS7Parameter EN_INSHSW_L_RFE;
+extern const struct LMS7Parameter EN_INSHSW_W_RFE;
+extern const struct LMS7Parameter EN_NEXTRX_RFE;
+extern const struct LMS7Parameter DCOFFI_RFE;
+extern const struct LMS7Parameter DCOFFQ_RFE;
+extern const struct LMS7Parameter ICT_LOOPB_RFE;
+extern const struct LMS7Parameter ICT_TIAMAIN_RFE;
+extern const struct LMS7Parameter ICT_TIAOUT_RFE;
+extern const struct LMS7Parameter ICT_LNACMO_RFE;
+extern const struct LMS7Parameter ICT_LNA_RFE;
+extern const struct LMS7Parameter ICT_LODC_RFE;
+extern const struct LMS7Parameter CAP_RXMXO_RFE;
+extern const struct LMS7Parameter CGSIN_LNA_RFE;
+extern const struct LMS7Parameter CCOMP_TIA_RFE;
+extern const struct LMS7Parameter CFB_TIA_RFE;
+extern const struct LMS7Parameter G_LNA_RFE;
+extern const struct LMS7Parameter G_RXLOOPB_RFE;
+extern const struct LMS7Parameter G_TIA_RFE;
+extern const struct LMS7Parameter RCOMP_TIA_RFE;
+extern const struct LMS7Parameter RFB_TIA_RFE;
+extern const struct LMS7Parameter EN_LB_LPFH_RBB;
+extern const struct LMS7Parameter EN_LB_LPFL_RBB;
+extern const struct LMS7Parameter PD_LPFH_RBB;
+extern const struct LMS7Parameter PD_LPFL_RBB;
+extern const struct LMS7Parameter PD_PGA_RBB;
+extern const struct LMS7Parameter EN_G_RBB;
+extern const struct LMS7Parameter R_CTL_LPF_RBB;
+extern const struct LMS7Parameter RCC_CTL_LPFH_RBB;
+extern const struct LMS7Parameter C_CTL_LPFH_RBB;
+extern const struct LMS7Parameter RCC_CTL_LPFL_RBB;
+extern const struct LMS7Parameter C_CTL_LPFL_RBB;
+extern const struct LMS7Parameter INPUT_CTL_PGA_RBB;
+extern const struct LMS7Parameter ICT_LPF_IN_RBB;
+extern const struct LMS7Parameter ICT_LPF_OUT_RBB;
+extern const struct LMS7Parameter OSW_PGA_RBB;
+extern const struct LMS7Parameter ICT_PGA_OUT_RBB;
+extern const struct LMS7Parameter ICT_PGA_IN_RBB;
+extern const struct LMS7Parameter G_PGA_RBB;
+extern const struct LMS7Parameter RCC_CTL_PGA_RBB;
+extern const struct LMS7Parameter C_CTL_PGA_RBB;
+extern const struct LMS7Parameter RESET_N;
+extern const struct LMS7Parameter SPDUP_VCO;
+extern const struct LMS7Parameter BYPLDO_VCO;
+extern const struct LMS7Parameter EN_COARSEPLL;
+extern const struct LMS7Parameter CURLIM_VCO;
+extern const struct LMS7Parameter EN_DIV2_DIVPROG;
+extern const struct LMS7Parameter EN_INTONLY_SDM;
+extern const struct LMS7Parameter EN_SDM_CLK;
+extern const struct LMS7Parameter PD_FBDIV;
+extern const struct LMS7Parameter PD_LOCH_T2RBUF;
+extern const struct LMS7Parameter PD_CP;
+extern const struct LMS7Parameter PD_FDIV;
+extern const struct LMS7Parameter PD_SDM;
+extern const struct LMS7Parameter PD_VCO_COMP;
+extern const struct LMS7Parameter PD_VCO;
+extern const struct LMS7Parameter EN_G;
+extern const struct LMS7Parameter FRAC_SDM_LSB;
+extern const struct LMS7Parameter INT_SDM;
+extern const struct LMS7Parameter FRAC_SDM_MSB;
+extern const struct LMS7Parameter PW_DIV2_LOCH;
+extern const struct LMS7Parameter PW_DIV4_LOCH;
+extern const struct LMS7Parameter DIV_LOCH;
+extern const struct LMS7Parameter TST_SX;
+extern const struct LMS7Parameter SEL_SDMCLK;
+extern const struct LMS7Parameter SX_DITHER_EN;
+extern const struct LMS7Parameter REV_SDMCLK;
+extern const struct LMS7Parameter VDIV_VCO;
+extern const struct LMS7Parameter ICT_VCO;
+extern const struct LMS7Parameter RSEL_LDO_VCO;
+extern const struct LMS7Parameter CSW_VCO;
+extern const struct LMS7Parameter SEL_VCO;
+extern const struct LMS7Parameter COARSE_START;
+extern const struct LMS7Parameter REVPH_PFD;
+extern const struct LMS7Parameter IOFFSET_CP;
+extern const struct LMS7Parameter IPULSE_CP;
+extern const struct LMS7Parameter COARSE_STEPDONE;
+extern const struct LMS7Parameter COARSEPLL_COMPO;
+extern const struct LMS7Parameter VCO_CMPHO;
+extern const struct LMS7Parameter VCO_CMPLO;
+extern const struct LMS7Parameter CP2_PLL;
+extern const struct LMS7Parameter CP3_PLL;
+extern const struct LMS7Parameter CZ;
+extern const struct LMS7Parameter EN_DIR_SXRSXT;
+extern const struct LMS7Parameter EN_DIR_RBB;
+extern const struct LMS7Parameter EN_DIR_RFE;
+extern const struct LMS7Parameter EN_DIR_TBB;
+extern const struct LMS7Parameter EN_DIR_TRF;
+extern const struct LMS7Parameter TSGFC_TXTSP;
+extern const struct LMS7Parameter TSGFCW_TXTSP;
+extern const struct LMS7Parameter TSGDCLDQ_TXTSP;
+extern const struct LMS7Parameter TSGDCLDI_TXTSP;
+extern const struct LMS7Parameter TSGSWAPIQ_TXTSP;
+extern const struct LMS7Parameter TSGMODE_TXTSP;
+extern const struct LMS7Parameter INSEL_TXTSP;
+extern const struct LMS7Parameter BSTART_TXTSP;
+extern const struct LMS7Parameter EN_TXTSP;
+extern const struct LMS7Parameter GCORRQ_TXTSP;
+extern const struct LMS7Parameter GCORRI_TXTSP;
+extern const struct LMS7Parameter HBI_OVR_TXTSP;
+extern const struct LMS7Parameter IQCORR_TXTSP;
+extern const struct LMS7Parameter DCCORRI_TXTSP;
+extern const struct LMS7Parameter DCCORRQ_TXTSP;
+extern const struct LMS7Parameter GFIR1_L_TXTSP;
+extern const struct LMS7Parameter GFIR1_N_TXTSP;
+extern const struct LMS7Parameter GFIR2_L_TXTSP;
+extern const struct LMS7Parameter GFIR2_N_TXTSP;
+extern const struct LMS7Parameter GFIR3_L_TXTSP;
+extern const struct LMS7Parameter GFIR3_N_TXTSP;
+extern const struct LMS7Parameter CMIX_GAIN_TXTSP;
+extern const struct LMS7Parameter CMIX_SC_TXTSP;
+extern const struct LMS7Parameter CMIX_BYP_TXTSP;
+extern const struct LMS7Parameter ISINC_BYP_TXTSP;
+extern const struct LMS7Parameter GFIR3_BYP_TXTSP;
+extern const struct LMS7Parameter GFIR2_BYP_TXTSP;
+extern const struct LMS7Parameter GFIR1_BYP_TXTSP;
+extern const struct LMS7Parameter DC_BYP_TXTSP;
+extern const struct LMS7Parameter GC_BYP_TXTSP;
+extern const struct LMS7Parameter PH_BYP_TXTSP;
+extern const struct LMS7Parameter BSIGI_TXTSP;
+extern const struct LMS7Parameter BSTATE_TXTSP;
+extern const struct LMS7Parameter BSIGQ_TXTSP;
+extern const struct LMS7Parameter DC_REG_TXTSP;
+extern const struct LMS7Parameter DTHBIT_TX;
+extern const struct LMS7Parameter SEL_TX;
+extern const struct LMS7Parameter MODE_TX;
+extern const struct LMS7Parameter CAPTURE;
+extern const struct LMS7Parameter CAPSEL;
+extern const struct LMS7Parameter CAPSEL_ADC;
+extern const struct LMS7Parameter TSGFC_RXTSP;
+extern const struct LMS7Parameter TSGFCW_RXTSP;
+extern const struct LMS7Parameter TSGDCLDQ_RXTSP;
+extern const struct LMS7Parameter TSGDCLDI_RXTSP;
+extern const struct LMS7Parameter TSGSWAPIQ_RXTSP;
+extern const struct LMS7Parameter TSGMODE_RXTSP;
+extern const struct LMS7Parameter INSEL_RXTSP;
+extern const struct LMS7Parameter BSTART_RXTSP;
+extern const struct LMS7Parameter EN_RXTSP;
+extern const struct LMS7Parameter GCORRQ_RXTSP;
+extern const struct LMS7Parameter GCORRI_RXTSP;
+extern const struct LMS7Parameter HBD_OVR_RXTSP;
+extern const struct LMS7Parameter IQCORR_RXTSP;
+extern const struct LMS7Parameter HBD_DLY;
+extern const struct LMS7Parameter DCLOOP_BYP;
+extern const struct LMS7Parameter DCCORR_AVG_RXTSP;
+extern const struct LMS7Parameter GFIR1_L_RXTSP;
+extern const struct LMS7Parameter GFIR1_N_RXTSP;
+extern const struct LMS7Parameter GFIR2_L_RXTSP;
+extern const struct LMS7Parameter GFIR2_N_RXTSP;
+extern const struct LMS7Parameter GFIR3_L_RXTSP;
+extern const struct LMS7Parameter GFIR3_N_RXTSP;
+extern const struct LMS7Parameter AGC_K_RXTSP;
+extern const struct LMS7Parameter AGC_ADESIRED_RXTSP;
+extern const struct LMS7Parameter RSSI_MODE;
+extern const struct LMS7Parameter AGC_MODE_RXTSP;
+extern const struct LMS7Parameter AGC_AVG_RXTSP;
+extern const struct LMS7Parameter DC_REG_RXTSP;
+extern const struct LMS7Parameter CMIX_GAIN_RXTSP;
+extern const struct LMS7Parameter CMIX_SC_RXTSP;
+extern const struct LMS7Parameter CMIX_BYP_RXTSP;
+extern const struct LMS7Parameter AGC_BYP_RXTSP;
+extern const struct LMS7Parameter GFIR3_BYP_RXTSP;
+extern const struct LMS7Parameter GFIR2_BYP_RXTSP;
+extern const struct LMS7Parameter GFIR1_BYP_RXTSP;
+extern const struct LMS7Parameter DC_BYP_RXTSP;
+extern const struct LMS7Parameter GC_BYP_RXTSP;
+extern const struct LMS7Parameter PH_BYP_RXTSP;
+extern const struct LMS7Parameter CAPD;
+extern const struct LMS7Parameter DTHBIT_RX;
+extern const struct LMS7Parameter SEL_RX;
+extern const struct LMS7Parameter MODE_RX;
+
+#endif
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_statuses.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_statuses.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..4e00854e1443956870826ab0830dbed0c9a52498
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_statuses.cpp
@@ -0,0 +1,16 @@
+/**
+@file	LMS7002M_statuses.cpp
+@author Lime Microsystems (www.limemicro.com)
+*/
+
+#include "LMS7002M_statuses.h"
+
+const char* undefinedStatusStr = "undefined status";
+
+const char* liblms7_status2string(liblms7_status status)
+{
+    if (status >= 0 && status < LIBLMS7_STATUS_COUNT)
+        return liblms7_status_strings[status];
+    else
+        return undefinedStatusStr;
+}
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_statuses.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_statuses.h
new file mode 100644
index 0000000000000000000000000000000000000000..43b736bfd52f541581742a703ba2010356ec6ce4
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/LMS7002M_statuses.h
@@ -0,0 +1,48 @@
+/**
+@file	LMS7002M_statuses.h
+@author Lime Microsystems (www.limemicro.com)
+@brief 	LMS7002M control library statuses enumerations
+*/
+
+#ifndef LMS7API_STATUSES_H
+#define LMS7API_STATUSES_H
+
+const char liblms7_status_strings[][64] =
+{
+"success",
+"failure",
+"index out of range",
+"too many values",
+"connection manager is NULL",
+"port not connected",
+"frequency out of range",
+"cannot deliver frequency",
+"VCO is powered down",
+"Bad SEL_PATH_RFE",
+"Band not selected",
+"file not found",
+"file invalid format",
+};
+
+enum liblms7_status
+{
+	LIBLMS7_SUCCESS = 0,
+	LIBLMS7_FAILURE,
+	LIBLMS7_INDEX_OUT_OF_RANGE,
+    LIBLMS7_TOO_MANY_VALUES,
+    LIBLMS7_NO_CONNECTION_MANAGER,
+    LIBLMS7_NOT_CONNECTED,
+    LIBLMS7_FREQUENCY_OUT_OF_RANGE,    
+    LIBLMS7_CANNOT_DELIVER_FREQUENCY,
+    LIBLMS7_VCO_IS_POWERED_DOWN,
+    LIBLMS7_BAD_SEL_PATH,
+    LIBLMS7_BAND_NOT_SELECTED,
+    LIBLMS7_FILE_NOT_FOUND,
+    LIBLMS7_FILE_INVALID_FORMAT,
+
+    LIBLMS7_STATUS_COUNT
+};
+
+const char* liblms7_status2string(liblms7_status status);
+
+#endif
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionCOM.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionCOM.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..6c7fc0d8290d5c26a8ae575fbcc98b4058cae124
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionCOM.cpp
@@ -0,0 +1,596 @@
+/**
+    @file   ConnectionCOM.cpp
+    @author Lime Microsystems (www.limemicro.com)
+    @brief  Implementation of communications through COM port
+*/
+
+#include "ConnectionCOM.h"
+
+#include "string.h"
+#ifdef __unix__
+#include <fstream>
+#include <errno.h>
+#include <unistd.h>
+#include <termios.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <iostream>
+#include <stdio.h>
+#endif // LINUX
+
+const int COM_RETRY_INTERVAL = 20; //ms
+const int COM_TOTAL_TIMEOUT = 300; //ms
+
+/** @brief Initializes com port connection
+*/
+ConnectionCOM::ConnectionCOM()
+{
+    currentDeviceIndex = -1;
+	connected = false;
+	comPortList.clear();
+	m_deviceNames.clear();
+	m_connectionType = COM_PORT;
+#ifndef __unix__
+	hComm = INVALID_HANDLE_VALUE;
+#else
+    hComm = -1;
+#endif
+	comBaudrate = 9600;
+}
+
+/** @brief When object is destroyed it closes it's opened COM port
+*/
+ConnectionCOM::~ConnectionCOM()
+{
+	Close();
+}
+
+/** @brief Opens connection to first found chip
+    @return 0-success
+*/
+IConnection::DeviceStatus ConnectionCOM::Open()
+{
+	comPortList.clear();
+	if(comPortList.size() == 0)
+		FindAllComPorts();
+
+	m_deviceNames.clear();
+	if(m_deviceNames.size() == 0)
+		RefreshDeviceList();
+
+	for(unsigned int i=0; i<m_deviceNames.size(); i++)
+	{
+		if( Open(i) == SUCCESS)
+		{
+			currentDeviceIndex = i;
+			return SUCCESS;
+		}
+	}
+	return FAILURE;
+}
+
+/** @brief Opens connection to selected chip
+    @param index chip index in device list
+    @return 0-success
+*/
+IConnection::DeviceStatus ConnectionCOM::Open(unsigned index)
+{
+    unsigned int toOpen = index;
+	Close();
+	if(toOpen < m_deviceNames.size() && m_deviceNames.size() > 0 )
+	{
+		comPortName = m_deviceNames[toOpen];
+		IConnection::DeviceStatus status = Open(comPortName.c_str(), comBaudrate);
+		if( status == SUCCESS )
+			currentDeviceIndex = toOpen;
+        return status;
+	}
+	return FAILURE;
+}
+
+/** @brief Closes connection to chip
+*/
+void ConnectionCOM::Close()
+{
+    connected = false;
+    currentDeviceIndex = -1;
+#ifndef __unix__
+	if (hComm != INVALID_HANDLE_VALUE)
+	{
+		SetCommTimeouts(hComm, &m_ctmoOld);
+		CloseHandle(hComm);
+	}
+	hComm = INVALID_HANDLE_VALUE;
+#else
+    if( hComm >= 0)
+    {
+        close(hComm);
+    }
+    hComm = -1;
+#endif
+}
+
+/** @brief Returns whether chip is connected
+    @return chip is connected
+*/
+bool ConnectionCOM::IsOpen()
+{
+#ifndef __unix__
+	if (hComm != INVALID_HANDLE_VALUE && TestConnectivity() )
+		return true;
+#else
+    if( hComm != -1 && TestConnectivity() )
+        return true;
+#endif
+    return false;
+}
+
+int ConnectionCOM::GetOpenedIndex()
+{
+    return currentDeviceIndex;
+}
+
+/** @brief Sends data through COM port
+    @param buffer data buffer to send
+    @param length size of data buffer
+    @param timeout_ms timeout limit for operation in milliseconds
+    @return Number of bytes sent
+*/
+int ConnectionCOM::Write(const unsigned char *buffer, int length, int timeout_ms)
+{
+    if(timeout_ms == 0)
+    {
+        timeout_ms = COM_TOTAL_TIMEOUT;
+    }
+    int retryCount = 0;
+    const int maxRetries = (timeout_ms/COM_RETRY_INTERVAL) > 1 ? (timeout_ms/COM_RETRY_INTERVAL) : 1;
+    bool status = false;
+#ifndef __unix__
+	unsigned long bytesWriten = 0;
+	m_osWOverlap.InternalHigh = 0;
+
+	for(int i = 0; i<maxRetries && status == false; ++i)
+    {
+        if (!WriteFile(hComm, buffer, length , &bytesWriten, NULL))
+        {
+            status = false;
+        }
+        else
+            status = true;
+        ++retryCount;
+    }
+#else
+    long bytesWriten = 0;
+    for(int i = 0; i<maxRetries && bytesWriten == 0; ++i)
+    {
+        bytesWriten = write(hComm, buffer, length);
+        if(bytesWriten <= 0)
+        {
+//            if(bytesWriten < 0)
+//                MessageLog::getInstance()->write("COM PORT: error writing data\n", LOG_ERROR);
+//            if(bytesWriten == 0)
+//                MessageLog::getInstance()->write("COM PORT: data bytes sent 0\n", LOG_WARNING);
+            status = false;
+        }
+        else
+            status = true;
+        ++retryCount;
+    }
+#endif
+    if(bytesWriten == length)
+        status = true;
+
+	return bytesWriten;
+}
+
+/** @brief Reads data from COM port
+    @param buffer pointer to data buffer for receiving
+    @param length number of bytes to read
+    @param timeout_ms timeout limit for operation in milliseconds
+    @return Number of bytes received
+*/
+int ConnectionCOM::Read(unsigned char *buffer, int length, int timeout_ms)
+{
+    if(timeout_ms == 0)
+    {
+        timeout_ms = COM_TOTAL_TIMEOUT;
+    }
+    int retryCount = 0;
+    const int maxRetries = (timeout_ms/COM_RETRY_INTERVAL) > 1 ? (timeout_ms/COM_RETRY_INTERVAL) : 1;
+    bool status = false;
+
+    memset(buffer, 0, length);
+	long bytesReaded = 0;
+	unsigned long totalBytesReaded = 0;
+	char cRawData[COM_BUFFER_LENGTH];
+	unsigned long bytesToRead = length;
+
+	memset(cRawData, '\0', sizeof(cRawData[0])*COM_BUFFER_LENGTH);
+
+	for(int i=0; i<maxRetries && status == false; ++i)
+    {
+        memset(cRawData, '\0', sizeof(cRawData[0])*COM_BUFFER_LENGTH);
+#ifndef __unix__
+
+        DWORD bytesReceived = 0;
+        if ( !ReadFile(hComm, cRawData, bytesToRead, &bytesReceived, NULL) )
+        {
+            status = false;
+        }
+
+        bytesReaded = bytesReceived;
+#else
+        bytesReaded = read(hComm, cRawData, bytesToRead);
+        if(bytesReaded <= 0)
+        {
+//            if(bytesReaded < 0)
+//                MessageLog::getInstance()->write("COM PORT: error reading data\n", LOG_ERROR);
+//            if(bytesReaded == 0)
+//                MessageLog::getInstance()->write("COM PORT: reading 0 bytes\n", LOG_WARNING);
+            status = false;
+        }
+#endif
+        retryCount++;
+
+        for(int j=0; j<bytesReaded; ++j)
+        {
+            buffer[totalBytesReaded+j] = cRawData[j];
+        }
+
+        totalBytesReaded += bytesReaded;
+        if(totalBytesReaded == bytesToRead)
+            status = true;
+    }
+
+//    ss << " read(" << totalBytesReaded << "): ";
+//    for(unsigned int i=0; i<64; ++i)
+//        ss << int2hex(buffer[i], 1) << " ";
+//    ss <<  " - retries: " << retryCount-1 << endl;
+    //MessageLog::getInstance()->write(ss.str(), LOG_DATA);
+
+//	if(retryCount == maxRetries)
+//        MessageLog::getInstance()->write("COM PORT: read data timeout\n", LOG_WARNING);
+//
+//    if(totalBytesReaded > length)
+//        MessageLog::getInstance()->write("COM PORT: read data corrupted, received length > requested length\n", LOG_ERROR);
+	return totalBytesReaded;
+}
+
+/** @brief Searches for available COM ports and adds them to list
+*/
+void ConnectionCOM::FindAllComPorts()
+{
+    Close();
+	comPortList.clear();
+#ifndef __unix__
+	HKEY hSERIALCOMM;
+	if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("HARDWARE\\DEVICEMAP\\SERIALCOMM"),	0, KEY_QUERY_VALUE, &hSERIALCOMM) == ERROR_SUCCESS)
+	{
+		// Get the max value name and max value lengths
+		DWORD dwMaxValueNameLen;
+		DWORD dwMaxValueLen;
+		DWORD dwQueryInfo = RegQueryInfoKey(hSERIALCOMM, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &dwMaxValueNameLen, &dwMaxValueLen, NULL, NULL);
+		if (dwQueryInfo == ERROR_SUCCESS)
+		{
+			DWORD dwMaxValueNameSizeInChars = dwMaxValueNameLen + 1;
+			// Include space for the NULL terminator
+			DWORD dwMaxValueNameSizeInBytes = dwMaxValueNameSizeInChars*sizeof(TCHAR);
+			DWORD dwMaxValueDataSizeInChars = dwMaxValueLen / sizeof(TCHAR) + 1;
+			// Include space for the NULL terminator
+			DWORD dwMaxValueDataSizeInBytes = dwMaxValueDataSizeInChars*sizeof(TCHAR);
+
+			// Allocate some space for the value name and value data
+			TCHAR* szValueName = new TCHAR[dwMaxValueNameSizeInChars];
+			TCHAR* byValue = new TCHAR[dwMaxValueDataSizeInBytes];
+			if (szValueName && byValue)
+			{
+				// Enumerate all the values underneath HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM
+				DWORD dwIndex = 0;
+				DWORD dwType;
+				DWORD dwValueNameSize = dwMaxValueNameSizeInChars;
+				DWORD dwDataSize = dwMaxValueDataSizeInBytes;
+				memset(szValueName, 0, dwMaxValueNameSizeInBytes);
+				memset(byValue, 0, dwMaxValueDataSizeInBytes);
+				LONG nEnum = RegEnumValue(hSERIALCOMM, dwIndex, szValueName, &dwValueNameSize, NULL, &dwType, (LPBYTE)byValue, &dwDataSize);
+				while (nEnum == ERROR_SUCCESS)
+				{
+					// If the value is of the correct type, then add it to the array
+					if (dwType == REG_SZ)
+					{
+					    char portname[512];
+						TCHAR* szPort = byValue;
+						int nUserNameLenUnicode = lstrlen( szPort ); // Convert all UNICODE characters
+						int nUserNameLen = WideCharToMultiByte( CP_ACP, // ANSI Code Page
+                        0, // No special handling of unmapped chars
+                        (LPCWSTR)szPort, // wide-character string to be converted
+                        nUserNameLenUnicode,
+                        NULL, 0, // No output buffer since we are calculating length
+                        NULL, NULL ); // Unrepresented char replacement - Use Default
+                        TCHAR* pszUserName = new TCHAR[ nUserNameLen ]; // nUserNameLen includes the NULL character
+                        WideCharToMultiByte( CP_ACP, // ANSI Code Page
+                        0, // No special handling of unmapped chars
+						(LPCWSTR)szPort, // wide-character string to be converted
+                        nUserNameLenUnicode,
+                        portname,
+                        nUserNameLen,
+                        NULL, NULL ); // Unrepresented char replacement - Use Default
+						portname[nUserNameLen] = 0;
+#ifdef UNICODE
+                        comPortList.push_back(portname);
+#else
+                        comPortList.push_back(szPort);
+#endif
+					}
+					// Prepare for the next time around
+					dwValueNameSize = dwMaxValueNameSizeInChars;
+					dwDataSize = dwMaxValueDataSizeInBytes;
+					memset(szValueName, 0, dwMaxValueNameSizeInBytes);
+					memset(byValue, 0, dwMaxValueDataSizeInBytes);
+					++dwIndex;
+					nEnum = RegEnumValue(hSERIALCOMM, dwIndex, szValueName,	&dwValueNameSize, NULL, &dwType, (LPBYTE)byValue, &dwDataSize);
+				}
+			}
+			delete szValueName;
+			delete byValue;
+		}
+		// Close the registry key now that we are finished with it
+		RegCloseKey(hSERIALCOMM);
+
+		if (dwQueryInfo != ERROR_SUCCESS)
+			SetLastError(dwQueryInfo);
+	}
+#else
+    char tempBuffer[256];
+    string result = "";
+#warning Currently searching only for ACM connections
+    system( "ls /dev | grep ttyACM > /tmp/foundSerialPorts.txt");
+
+    fstream fin;
+    fin.open("/tmp/foundSerialPorts.txt", ios::in);
+    while(!fin.eof())
+    {
+        fin.getline(tempBuffer, 256);
+        result = "/dev/";
+        result.append(tempBuffer);
+        if( strlen(tempBuffer) > 3 ) //longer than tty
+            comPortList.push_back(result);
+    }
+    fin.close();
+#endif
+}
+
+/** @brief Opens COM port
+    @param comName COM port name
+    @param baudrate COM port baudrate
+    @return 0 on success
+*/
+IConnection::DeviceStatus ConnectionCOM::Open(const char *comName, int baudrate)
+{
+	Close();
+	if (strlen(comName) == 0)
+		return FAILURE;
+
+	DeviceStatus errorCode = SUCCESS;
+
+#ifndef __unix__
+	// Initialize Overlap structures
+	m_osROverlap.Internal = 0;
+	m_osROverlap.InternalHigh = 0;
+	m_osROverlap.Offset = 0;
+	m_osROverlap.OffsetHigh = 0;
+	m_osROverlap.hEvent = CreateEvent(NULL, false, false, NULL);
+
+	m_osWOverlap.Internal = 0;
+	m_osWOverlap.InternalHigh = 0;
+	m_osWOverlap.Offset = 0;
+	m_osWOverlap.OffsetHigh = 0;
+	m_osWOverlap.hEvent = CreateEvent(NULL, false, false, NULL);
+
+	// Initialize DSB structure
+	memset(&m_dcbCommPort, 0, sizeof(m_dcbCommPort));
+
+	m_dcbCommPort.BaudRate = comBaudrate;
+	m_dcbCommPort.fBinary = 1;
+	m_dcbCommPort.fParity = 0;
+	m_dcbCommPort.fOutxCtsFlow = 0;
+	m_dcbCommPort.fOutxDsrFlow = 0;
+	m_dcbCommPort.fDtrControl = 0;
+	m_dcbCommPort.fDsrSensitivity = 0;
+	m_dcbCommPort.fTXContinueOnXoff = 0;
+	m_dcbCommPort.fOutX = 0;
+	m_dcbCommPort.fInX = 0;
+	m_dcbCommPort.fErrorChar = 0;
+	m_dcbCommPort.fNull = 0;
+	m_dcbCommPort.fRtsControl = 0;
+	m_dcbCommPort.fAbortOnError = 0;
+	m_dcbCommPort.fDummy2 = 0;
+	// m_dcbCommPort.wReserved = 0;
+	m_dcbCommPort.XonLim = 512;
+	m_dcbCommPort.XoffLim = 512;
+	m_dcbCommPort.ByteSize = 8;
+	m_dcbCommPort.Parity = 0;
+	m_dcbCommPort.StopBits = 0;
+	//m_dcbCommPort.StopBits = 1;
+	m_dcbCommPort.XonChar = 17;
+	m_dcbCommPort.XoffChar = 19;
+	m_dcbCommPort.ErrorChar = 0;
+	m_dcbCommPort.EofChar = 26;
+	m_dcbCommPort.EvtChar = 0;
+	m_dcbCommPort.wReserved1 = 0;
+	m_dcbCommPort.DCBlength = sizeof(DCB);
+
+	// Initialize Timeout's
+	m_ctmoNew.ReadIntervalTimeout = 50;
+	m_ctmoNew.ReadTotalTimeoutMultiplier = 0;
+	m_ctmoNew.ReadTotalTimeoutConstant = 100; // 1;
+	m_ctmoNew.WriteTotalTimeoutMultiplier = 0;
+	m_ctmoNew.WriteTotalTimeoutConstant = 100;
+
+	// Open COM port
+	string stmp;
+	stmp = "\\\\.\\";
+	stmp.append(comName);
+	hComm = CreateFileA(stmp.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
+
+	if (hComm != INVALID_HANDLE_VALUE)
+	{
+		// Set Events
+		if (!SetCommMask(hComm, 0))
+			errorCode = FAILURE;
+
+		// Set Timeouts
+		GetCommTimeouts(hComm, &m_ctmoOld);
+		if (!SetCommTimeouts(hComm, &m_ctmoNew))
+			errorCode = FAILURE;
+
+		// Set DCB
+		if (!SetCommState(hComm, &m_dcbCommPort))
+			errorCode = FAILURE;
+	}
+	else
+	{
+		errorCode = FAILURE;
+	};
+
+	// Check the results
+	if (errorCode != 0)
+	{
+		//unsigned long err = GetLastError();
+		CloseHandle(hComm);
+		hComm = INVALID_HANDLE_VALUE;
+		return errorCode;
+	}
+	else
+	{
+		PurgeComm(hComm, PURGE_TXCLEAR | PURGE_RXCLEAR);
+		return SUCCESS;
+	}
+#else
+    hComm = open(comName, O_RDWR | O_NOCTTY | O_SYNC);
+    if(hComm < 0)
+    {
+//        printf("%s",strerror(errno));
+//        MessageLog::getInstance()->write("Connection manager: failed opening COM port\n", LOG_ERROR);
+        return FAILURE;
+    }
+
+    struct termios tty;
+    memset(&tty, 0, sizeof(tty));
+    if( tcgetattr(hComm, &tty) != 0)
+    {
+//        MessageLog::getInstance()->write("Connection Manager: error from tcgetattr\n", LOG_ERROR);
+        return FAILURE;
+    }
+    int speed = B9600;
+    cfsetospeed(&tty, speed);
+    cfsetispeed(&tty, speed);
+
+    tty.c_cflag = (tty.c_cflag & ~CSIZE) | CS8;
+    tty.c_iflag &= ~IGNBRK;
+    tty.c_lflag = 0;
+    tty.c_oflag = 0;
+    tty.c_cc[VMIN] = 0; // read non blocking
+    tty.c_cc[VTIME] = 5; // 0.5 seconds read timeout
+
+    tty.c_iflag &= ~(IXON | IXOFF | IXANY);
+    tty.c_cflag |= (CLOCAL | CREAD);
+
+    if(tcsetattr(hComm, TCSANOW, &tty) != 0)
+    {
+//        MessageLog::getInstance()->write("Connection manager: error from tcsetattr\n", LOG_ERROR);
+        return FAILURE;
+    }
+#endif
+    return SUCCESS;
+}
+
+/** @brief Checks if chip is connected to currently open port
+    @return chip is connected
+*/
+bool ConnectionCOM::TestConnectivity()
+{
+//currently set to always return true to show all com ports
+    return true;
+#ifndef __unix__
+	if (hComm != INVALID_HANDLE_VALUE)
+#else
+    if( hComm >= 0)
+#endif
+	{
+//	    unsigned char out[64];
+//	    unsigned char in[64];
+//	    memset(in, 0, 64);
+//	    out[0] = CMD_GET_INFO;
+//        SendData(out, 64);
+//        ReadData(in, 64);
+//        if(in[0] == CMD_GET_INFO && in[1] == 0x01)
+//            return true;
+//        else
+//            return false;
+	}
+	return false;
+}
+
+/** @brief Finds all chips connected to com ports
+    @return number of devices found
+*/
+int ConnectionCOM::RefreshDeviceList()
+{
+    int wasOpen = -1;
+    string wasOpenName = "";
+    if(IsOpen())
+    {
+        wasOpen = GetOpenedIndex();
+        wasOpenName = comPortName;
+    }
+    Close();
+    comPortList.clear();
+	if(comPortList.size() == 0)
+		FindAllComPorts();
+
+	m_deviceNames.clear();
+	string comName;
+	for(unsigned int i=0; i<comPortList.size(); i++)
+	{
+	    comName = comPortList[i];
+#ifndef __unix__
+		if( Open(comName.c_str(), comBaudrate) == SUCCESS)
+		{
+			if( TestConnectivity() ) //if responds add it to device list
+				m_deviceNames.push_back(comName);
+		}
+		Close();
+#else
+        m_deviceNames.push_back(comName);
+#endif
+	}
+	if(wasOpen != -1)
+    {
+        for(unsigned i=0; i<m_deviceNames.size(); ++i)
+            if(m_deviceNames[i] == wasOpenName)
+            {
+                Open(i);
+                break;
+            }
+    }
+	return m_deviceNames.size();
+}
+
+/** @brief Returns found devices names
+    @return vector of device names
+*/
+vector<string> ConnectionCOM::GetDeviceNames()
+{
+    return m_deviceNames;
+}
+
+/** @brief Purges communication buffers
+*/
+void ConnectionCOM::ClearComm()
+{
+#ifndef __unix__
+    PurgeComm(hComm, PURGE_TXCLEAR|PURGE_RXCLEAR);
+#endif
+}
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionCOM.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionCOM.h
new file mode 100644
index 0000000000000000000000000000000000000000..0549472db1b9efb7312d75f906b3c7614e1455a7
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionCOM.h
@@ -0,0 +1,62 @@
+/**
+@file   ConnectionCOM.h
+@author Lime Microsystems (www.limemicro.com)
+@brief  Class for data communications through COM port
+*/
+
+#ifndef CONNECTION_COM_PORT_H
+#define CONNECTION_COM_PORT_H
+
+#ifndef __unix__
+	#include "windows.h"
+#endif
+
+#include "IConnection.h"
+
+class ConnectionCOM : public IConnection
+{
+public:
+    static const int COM_BUFFER_LENGTH = 1024; //max buffer size for data
+
+	ConnectionCOM();
+	~ConnectionCOM();
+
+	DeviceStatus Open();
+	DeviceStatus Open(unsigned i);
+	void Close();
+	bool IsOpen();
+	int GetOpenedIndex();
+
+	int Write(const unsigned char *buffer, int length, int timeout_ms = 0);
+	int Read(unsigned char *buffer, int length, int timeout_ms = 0);
+
+	std::vector<std::string> GetDeviceNames();
+	int RefreshDeviceList();
+	void ClearComm();
+private:
+	void FindAllComPorts();
+	DeviceStatus Open(const char *comName, int baudrate);
+
+	bool TestConnectivity();
+
+	std::string comPortName;
+	int comBaudrate;
+	bool connected;
+
+	int currentDeviceIndex;
+	std::vector<std::string> comPortList;
+	std::vector<std::string> m_deviceNames;
+
+#ifndef __unix__
+	HANDLE hComm;
+	COMMTIMEOUTS m_ctmoNew;
+	COMMTIMEOUTS m_ctmoOld;
+	OVERLAPPED m_osROverlap;
+	OVERLAPPED m_osWOverlap;
+	DCB m_dcbCommPort;
+#else
+    int hComm; //com port file descriptor
+#endif
+
+};
+#endif
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionManager.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionManager.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..36f73da5d75af7f5ff15ceb64b6164fdcd5a8a1d
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionManager.cpp
@@ -0,0 +1,314 @@
+/**
+    @file ConnectionManager.cpp
+    @author Lime Microsystems (www.limemicro.com)
+    @brief Implementation of various connection types to devices
+*/
+
+#include "ConnectionManager.h"
+#include "ConnectionCOM.h"
+
+#ifdef ENABLE_USB_CONNECTION
+    #include "ConnectionUSB.h"
+#endif
+#ifdef ENABLE_SPI_CONNECTION
+    #include "ConnectionSPI.h"
+#endif
+
+#include <sstream>
+#include <iomanip>
+#include <iostream>
+
+/** @brief Creates connection interfaces
+*/
+ConnectionManager::ConnectionManager() : activeControlPort(NULL)
+{
+    mLogData = false;
+    mOpenedDevice = -1;
+    m_connections[IConnection::COM_PORT] = new ConnectionCOM();
+#ifdef ENABLE_USB_CONNECTION
+    m_connections[IConnection::USB_PORT] = new ConnectionUSB();
+#endif
+#ifdef ENABLE_SPI_CONNECTION
+    m_connections[IConnection::SPI_PORT] = new ConnectionSPI();
+#endif
+}
+
+/** @brief Destroys connection interfaces
+*/
+ConnectionManager::~ConnectionManager()
+{
+	for (auto iter = m_connections.begin(); iter != m_connections.end(); ++iter)
+	{
+		delete iter->second;
+	}
+}
+
+/** @brief Checks if connection to device is opened
+    @return True if device is connected
+*/
+bool ConnectionManager::IsOpen()
+{
+    return activeControlPort ? activeControlPort->IsOpen() : false;
+}
+
+/** @brief Opens connection to first available device
+    @return True if connected to device
+*/
+bool ConnectionManager::Open()
+{
+    return Open(0);
+}
+
+/** @brief Connects to selected device
+    @param i device index from device list
+    @return 1:Success, 0:failure
+*/
+int ConnectionManager::Open(unsigned i)
+{
+    if(i >= mDevices.size())
+        return 0;
+
+    if(activeControlPort)
+        activeControlPort->Close();
+    switch(mDevices[i].port)
+    {
+    case IConnection::COM_PORT:
+        activeControlPort = m_connections[IConnection::COM_PORT];
+        break;
+    case IConnection::USB_PORT:
+		activeControlPort = m_connections[IConnection::USB_PORT];
+        break;
+    case IConnection::SPI_PORT:
+		activeControlPort = m_connections[IConnection::SPI_PORT];
+        break;
+    default:
+        return 0;
+    }
+    mOpenedDevice = -1;
+    if( i < mDevices.size() )
+    {
+        if( activeControlPort->Open(mDevices[i].portIndex) )
+        {
+            mOpenedDevice = i;
+            return 1;
+        }
+    }
+    return 0;
+}
+
+/** @brief Closes connection to device
+*/
+void ConnectionManager::Close()
+{
+    if(activeControlPort)
+    {
+        activeControlPort->Close();
+		//Notify(LMS_Message(MSG_BOARD_DISCONNECTED, "", 0, 0));
+    }
+    mOpenedDevice = -1;
+}
+
+/** @brief Finds all currently connected devices and forms device list
+    @return number of devices found
+*/
+int ConnectionManager::RefreshDeviceList()
+{
+    mDeviceList.clear();
+    mDevices.clear();
+    DeviceInfo dev;
+    for (auto iter = m_connections.begin(); iter != m_connections.end(); ++iter)
+    {
+        vector<string> names;
+        IConnection *port = iter->second;
+        if(port->RefreshDeviceList() > 0)
+        {
+            names = port->GetDeviceNames();
+            for(unsigned i=0; i<names.size(); ++i)
+            {
+                dev.name = names[i];
+                dev.port = iter->first;
+                dev.portIndex = i;
+                mDevices.push_back(dev);
+            }
+        }
+    }
+    for(unsigned i=0; i<mDevices.size(); ++i)
+        mDeviceList.push_back(mDevices[i].name);
+    return mDevices.size();
+}
+
+/** @brief Returns currently opened connection index
+*/
+int ConnectionManager::GetOpenedIndex()
+{
+    return mOpenedDevice;
+}
+
+/** @brief Writes given data to currently opened connection
+    @param buffer outcomming data buffer
+    @param length bytes to write
+    @param timeout_ms timeout in milliseconds
+    @return number of bytes written, on failure negative values
+*/
+int ConnectionManager::Write(const unsigned char *buffer, const int length, int timeout_ms)
+{
+    if(activeControlPort)
+    {
+        int bytesTransferred = activeControlPort->Write(buffer, length, timeout_ms);
+#ifndef NDEBUG
+        if(mLogData)
+        {
+            stringstream ss;
+            ss << "WR(" <<  (bytesTransferred>=0?bytesTransferred: 0) << "): ";
+            ss << std::hex << std::setfill('0');
+            int repeatedZeros = 0;
+            for(int i=length-1; i>=0; --i)
+                if(buffer[i] == 0)
+                    ++repeatedZeros;
+                else break;
+            if(repeatedZeros == 1)
+                repeatedZeros = 0;
+            repeatedZeros = repeatedZeros - (repeatedZeros & 0x1);
+            for(int i=0; i<length-repeatedZeros; ++i)
+                //casting to short to print as numbers
+                ss << " " << std::setw(2) << (unsigned short)buffer[i];
+            if(repeatedZeros > 1)
+                ss << " (00 x " << std::dec << repeatedZeros << " times)";
+            cout << ss.str() << endl;
+        }
+#endif
+        return bytesTransferred;
+    }
+    return -1;
+}
+
+/** @brief Receives data from currently opened connection
+    @param buffer incomming data buffer, must be big enough for length bytes
+    @param length bytes to read
+    @param timeout_ms timeout in milliseconds
+    @return number of bytes received
+*/
+int ConnectionManager::Read(unsigned char *buffer, int length, int timeout_ms)
+{
+    if(activeControlPort)
+    {
+        int bytesTransferred = activeControlPort->Read(buffer, length, timeout_ms);
+#ifndef NDEBUG
+        if(mLogData)
+        {
+            stringstream ss;
+            ss << "RD(" <<  (bytesTransferred>=0?bytesTransferred: 0) << "): ";
+            ss << std::hex << std::setfill('0');
+            int repeatedZeros = 0;
+            for(int i=length-1; i>=0; --i)
+                if(buffer[i] == 0)
+                    ++repeatedZeros;
+                else break;
+            if(repeatedZeros == 2)
+                repeatedZeros = 0;
+            repeatedZeros = repeatedZeros - (repeatedZeros & 0x1);
+            for(int i=0; i<length-repeatedZeros; ++i)
+                //casting to short to print as numbers
+                ss << " " << std::setw(2) << (unsigned short)buffer[i];
+            if(repeatedZeros > 2)
+                ss << " (00 x " << std::dec << repeatedZeros << " times)";
+            cout << ss.str() << endl;
+        }
+#endif
+        return bytesTransferred;
+    }
+    return -1;
+}
+
+int ConnectionManager::WriteStream(const char *buffer, int length)
+{
+	return 0;
+}
+
+int ConnectionManager::ReadStream(char *buffer, int length, unsigned int timeout_ms)
+{
+	/*int handle = activeControlPort->BeginDataReading(buffer, length);
+    activeControlPort->WaitForReading(handle, timeout_ms);
+	long received = length;
+	activeControlPort->FinishDataReading(buffer, received, handle);
+	return received;
+    */
+    long len = length;
+    int status = activeControlPort->ReadDataBlocking(buffer, len, 0);
+    return len;
+}
+
+
+int ConnectionManager::BeginDataReading(char *buffer, long length)
+{
+    return activeControlPort->BeginDataReading(buffer, length);
+}
+/**
+@brief Blocks until data is received or set number of milliseconds have passed.
+@param contextHandle handle returned by BeginDataReading()
+@param timeout_ms number of milliseconds to wait
+@return 1-data received, 0-data not received
+*/
+int ConnectionManager::WaitForReading(int contextHandle, unsigned int timeout_ms)
+{
+    return activeControlPort->WaitForReading(contextHandle, timeout_ms);
+}
+/**
+@brief Finished asynchronous data reading.
+@param buffer where to put received data
+@param length number of bytes to read, will be changed to actual number of bytes received
+@param contextHandle context handle returned by BeginDataReading()
+@return received data length
+*/
+int ConnectionManager::FinishDataReading(char *buffer, long &length, int contextHandle)
+{
+    return activeControlPort->FinishDataReading(buffer, length, contextHandle);
+}
+
+/**
+@brief Aborts reading operations
+*/
+void ConnectionManager::AbortReading()
+{
+    activeControlPort->AbortReading();
+}
+
+/**
+@brief Start asynchronous data sending.
+@param buffer data buffer to be sent
+@param length number of bytes to send.
+@return context handle
+*/
+int ConnectionManager::BeginDataSending(const char *buffer, long length)
+{
+    return activeControlPort->BeginDataSending(buffer, length);
+}
+/**
+@brief Blocks until data is sent or set number of miliseconds have passed.
+@param contextHandle handle returned by BeginDataReading()
+@param timeout_ms number of miliseconds to wait
+@return 1-data sent, 0-data not sent
+*/
+int ConnectionManager::WaitForSending(int contextHandle, unsigned int timeout_ms)
+{
+    return activeControlPort->WaitForSending(contextHandle, timeout_ms);
+}
+/**
+@brief Finished asynchronous data sending.
+@param buffer where to put received data
+@param length number of bytes to send, will be changed to actual number of bytes sent
+@param contextHandle context handle returned by BeginDataReading()
+@return sent data length
+*/
+int ConnectionManager::FinishDataSending(const char *buffer, long &length, int contextHandle)
+{
+    return activeControlPort->FinishDataSending(buffer, length, contextHandle);
+}
+
+/**
+@brief Aborts sending operations
+*/
+void ConnectionManager::AbortSending()
+{
+    activeControlPort->AbortSending();
+}
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionManager.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionManager.h
new file mode 100644
index 0000000000000000000000000000000000000000..edd01d38332ae3b730f06a4e6c623f75fee10e0a
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionManager.h
@@ -0,0 +1,60 @@
+/**
+    @file ConnectionManager.h
+    @author Lime Microsystems (www.limemicro.com)
+    @brief Class for managing connection to devices
+*/
+
+#ifndef LMS_CONNECTION_MANAGER_H
+#define LMS_CONNECTION_MANAGER_H
+
+#include "IConnection.h"
+#include <map>
+
+class ConnectionManager
+{
+public:
+    struct DeviceInfo
+    {
+        std::string name;
+        IConnection::eConnectionType port;
+        int portIndex;
+    };
+
+    ConnectionManager();
+    ~ConnectionManager();
+    bool IsOpen();
+    bool Open();
+    int Open(unsigned i);
+    void Close();
+    int RefreshDeviceList();
+    int GetOpenedIndex();
+    std::vector<std::string> GetDeviceList(){return mDeviceList;};
+
+    int Write(const unsigned char *buffer, int length, int timeout_ms = 0);
+	int Read(unsigned char *buffer, int length, int timeout_ms = 0);
+
+	int WriteStream(const char *buffer, int length);
+	int ReadStream(char *buffer, int length, unsigned int timeout_ms);
+
+    int BeginDataReading(char *buffer, long length);
+    int WaitForReading(int contextHandle, unsigned int timeout_ms);
+    int FinishDataReading(char *buffer, long &length, int contextHandle);
+    void AbortReading();
+
+    int BeginDataSending(const char *buffer, long length);
+    int WaitForSending(int contextHandle, unsigned int timeout_ms);
+    int FinishDataSending(const char *buffer, long &length, int contextHandle);
+    void AbortSending();
+
+protected:
+    bool mLogData;
+    /// Port used for communication.
+	IConnection *activeControlPort;
+    std::vector<DeviceInfo> mDevices;
+    std::vector<std::string> mDeviceList;
+    int mOpenedDevice;
+    std::map<IConnection::eConnectionType, IConnection*> m_connections;
+};
+
+#endif // LMS_CONNECTION_MANAGER_H
+
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionSPI.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionSPI.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..e490db4dab480f4105e114809e11838cbd5e339d
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionSPI.cpp
@@ -0,0 +1,290 @@
+/**
+    @file   ConnectionSPI.cpp
+    @author Lime Microsystems (www.limemicro.com)
+    @brief  Implementation of communications through SPI port
+*/
+
+#include "ConnectionSPI.h"
+
+#include "string.h"
+#ifdef __unix__
+#include <fstream>
+#include <errno.h>
+#include <unistd.h>
+#include <termios.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/ioctl.h>
+#include <linux/types.h>
+#include <linux/spi/spidev.h>
+#include <linux/i2c-dev.h>
+#endif // LINUX
+
+#include <iostream>
+#include <sstream>
+
+const int ConnectionSPI::cSPI_BUF_SIZE = 128;
+const int ConnectionSPI::cSPI_SPEED_HZ = 2000000;
+
+/** @brief Tries to read EEPROM for Novena board signature
+    @return true if Novena board
+*/
+bool IsNovenaBoard()
+{
+#ifdef __unix__
+    char data[8];
+    int count = 6;
+    memset(data, 0, 8);
+    int addr = 0;
+    struct i2c_rdwr_ioctl_data session;
+    struct i2c_msg messages[2];
+    char set_addr_buf[2];
+    memset(set_addr_buf, 0, sizeof(set_addr_buf));
+    memset(data, 0, count);
+    set_addr_buf[0] = addr>>8;
+    set_addr_buf[1] = addr;
+    messages[0].addr = 0xac>>1;
+    messages[0].flags = 0;
+    messages[0].len = sizeof(set_addr_buf);
+    messages[0].buf = set_addr_buf;
+    messages[1].addr = 0xac>>1;
+    messages[1].flags = I2C_M_RD;
+    messages[1].len = count;
+    messages[1].buf = data;
+    session.msgs = messages;
+    session.nmsgs = 2;
+
+    bool isNovena = false;
+
+    int fd = open("/dev/i2c-2", O_RDWR);
+    if(fd > 0)
+    {
+        if(ioctl(fd, I2C_RDWR, &session) < 0)
+        {
+            perror("Unable to communicate with i2c device");
+            isNovena = false;
+        }
+        if(strcmp("Novena", data) == 0)
+            isNovena = true;
+    }
+    close(fd);
+    return isNovena;
+#else
+    return false;
+#endif
+}
+
+/** @brief Initializes SPI port and exports needed GPIO
+*/
+ConnectionSPI::ConnectionSPI()
+{
+    fd = -1;
+    m_connectionType = SPI_PORT;
+    std::fstream gpio;
+    //export SEN pin
+    gpio.open("/sys/class/gpio/export", ios::out);
+    if(gpio.good())
+    {
+        gpio << 122;
+        gpio.flush();
+        gpio.close();
+        gpio.open("/sys/class/gpio/gpio122/direction", ios::out);
+        gpio << "out";
+        gpio.flush();
+        gpio.close();
+        m_SEN.open("/sys/class/gpio/gpio122/value", ios::out);
+        m_SEN<< 1;
+        m_SEN.flush();
+        cout << "GPIO122: set to 1" << endl;
+    }
+}
+
+ConnectionSPI::~ConnectionSPI()
+{
+    Close();
+    m_SEN.close();
+}
+
+/** @brief Opens connection to first found chip
+    @return 0-success
+*/
+IConnection::DeviceStatus ConnectionSPI::Open()
+{
+	Close();
+#ifdef __unix__
+	fd = open("/dev/spidev2.0", O_RDWR | O_SYNC);
+	if (fd < 0)
+	{
+        //MessageLog::getInstance()->write("SPI PORT: device not found\n", LOG_ERROR);
+		return IConnection::FAILURE;
+	}
+	int mode = SPI_MODE_0;
+	int ret = ioctl(fd, SPI_IOC_WR_MODE, &mode);
+	if (ret == -1)
+		printf("can't set spi mode");
+
+	ret = ioctl(fd, SPI_IOC_RD_MODE, &mode);
+	if (ret == -1)
+		printf("can't get spi mode");
+
+	/*
+	 * bits per word
+	 */
+    int bits = 8;
+	ret = ioctl(fd, SPI_IOC_WR_BITS_PER_WORD, &bits);
+	if (ret == -1)
+		printf("can't set bits per word");
+
+	ret = ioctl(fd, SPI_IOC_RD_BITS_PER_WORD, &bits);
+	if (ret == -1)
+		printf("can't get bits per word");
+
+	/*
+	 * max speed hz
+	 */
+	int speed = cSPI_SPEED_HZ;
+	ret = ioctl(fd, SPI_IOC_WR_MAX_SPEED_HZ, &speed);
+	if (ret == -1)
+		printf("can't set max speed hz");
+
+	ret = ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &speed);
+	if (ret == -1)
+		printf("can't get max speed hz");
+
+	printf("spi mode: 0x%x\n", mode);
+	printf("bits per word: %d\n", bits);
+	printf("max speed: %d Hz (%d KHz)\n", speed, speed/1000);
+    return IConnection::SUCCESS;
+#else
+    return IConnection::FAILURE;
+#endif
+}
+
+/** @brief Opens connection to selected chip
+    @param index chip index in device list
+    @return 0-success
+*/
+IConnection::DeviceStatus ConnectionSPI::Open(unsigned index)
+{
+    return Open();
+}
+
+/** @brief Closes connection to chip
+*/
+void ConnectionSPI::Close()
+{
+#ifdef __unix__
+    close(fd);
+    fd = -1;
+#endif
+}
+
+/** @brief Returns whether chip is connected
+    @return chip is connected
+*/
+bool ConnectionSPI::IsOpen()
+{
+    return (fd >= 0);
+}
+
+/** @brief Sends data through SPI port
+    @param buffer data buffer to send
+    @param length size of data buffer
+    @param timeout_ms timeout limit for operation in milliseconds
+    @return Number of bytes sent
+*/
+int ConnectionSPI::Write(const unsigned char *buffer, int length, int timeout_ms)
+{
+    #ifdef __unix__
+    if(fd < 0)
+        return 0;
+    m_SEN << 0;
+    m_SEN.flush();
+    unsigned long bytesWritten = 0;
+    rxbuf.clear();
+    int bytesReceived = 0;
+    char rxbytes[2];
+    while(bytesWritten < length)
+    {
+        int toWrite = length-bytesWritten > cSPI_BUF_SIZE ? cSPI_BUF_SIZE : length-bytesWritten;
+        for(int i=0; i<toWrite; i+=2)
+        {
+            if(buffer[i] < 0x80) //reading
+            {
+                write(fd, &buffer[i+bytesWritten], 2);
+                bytesReceived += read(fd, rxbytes, 2);
+                rxbuf.push_back(rxbytes[0]);
+                rxbuf.push_back(rxbytes[1]);
+            }
+            else //writing
+            {
+                write(fd, &buffer[i+bytesWritten], 4);
+                i+=2; //data bytes have been written
+            }
+        }
+        bytesWritten += toWrite;
+    }
+    m_SEN << 1;
+    m_SEN.flush();
+    return bytesWritten;
+#else
+    return 0;
+#endif
+}
+
+/** @brief Reads data from SPI port
+    @param buffer pointer to data buffer for receiving
+    @param length number of bytes to read
+    @param timeout_ms timeout limit for operation in milliseconds
+    @return Number of bytes received
+*/
+int ConnectionSPI::Read(unsigned char *buffer, int length, int timeout_ms)
+{
+#ifdef __unix__
+    if(fd < 0)
+        return 0;
+    //because transfer is done in full duplex, function returns data from last transfer
+    int tocpy = length > rxbuf.size() ? rxbuf.size() : length;
+    memcpy(buffer, &rxbuf[0], tocpy);
+    rxbuf.clear();
+    return tocpy;
+#else
+    return 0;
+#endif
+}
+
+/** @brief Finds SPI port
+    @return number of devices found
+*/
+int ConnectionSPI::RefreshDeviceList()
+{
+    m_deviceNames.clear();
+#ifdef __unix__
+    int spidev = open("/dev/spidev2.0", O_RDWR);
+	if (spidev >= 0)
+	{
+	    if(IsNovenaBoard() == true)
+            m_deviceNames.push_back("SPI (Novena)");
+        else
+            m_deviceNames.push_back("SPI");
+	}
+    close(spidev);
+#endif
+    return m_deviceNames.size();
+}
+
+/** @brief Returns found devices names
+    @return vector of device names
+*/
+vector<string> ConnectionSPI::GetDeviceNames()
+{
+    return m_deviceNames;
+}
+
+int ConnectionSPI::GetOpenedIndex()
+{
+    return 0;
+}
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionSPI.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionSPI.h
new file mode 100644
index 0000000000000000000000000000000000000000..79d9bd9b9b690c470f156acfb1ebdd2a11e0b4ae
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionSPI.h
@@ -0,0 +1,41 @@
+/**
+@file   ConnectionSPI.h
+@author Lime Microsystems (www.limemicro.com)
+@brief  Class for data communications through SPI port
+*/
+
+#ifndef CONNECTION_SPI_PORT_H
+#define CONNECTION_SPI_PORT_H
+
+#include "IConnection.h"
+#include <fstream>
+#include <string>
+#include <vector>
+
+class ConnectionSPI : public IConnection
+{
+public:
+    static const int cSPI_BUF_SIZE;
+    static const int cSPI_SPEED_HZ;
+
+	ConnectionSPI();
+	~ConnectionSPI();
+
+	DeviceStatus Open();
+	DeviceStatus Open(unsigned i);
+	void Close();
+	bool IsOpen();
+	int GetOpenedIndex();
+
+	int Write(const unsigned char *buffer, int length, int timeout_ms = 0);
+	int Read(unsigned char *buffer, int length, int timeout_ms = 0);
+
+	std::vector<std::string> GetDeviceNames();
+	int RefreshDeviceList();
+protected:
+    std::vector<std::string> m_deviceNames;
+	std::vector<unsigned char> rxbuf;
+    int fd;
+    std::fstream m_SEN;
+};
+#endif
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionUSB.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionUSB.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..b99fe6490bc30013bab77583e19deaa74b16c4b8
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionUSB.cpp
@@ -0,0 +1,762 @@
+/**
+@file   ConnectionUSB.cpp
+@author Lime Microsystems (www.limemicro.com)
+@brief  Data writing and reading through USB port
+*/
+
+#include "ConnectionUSB.h"
+#include <string.h>
+
+#ifdef __unix__
+    #include <thread>
+    #include <chrono>
+#endif
+
+#define USB_TIMEOUT 1000
+
+#define HW_LDIGIRED L"DigiRed"
+#define HW_LDIGIGREEN L"DigiGreen"
+#define HW_LSTREAMER L"Stream"
+
+#define HW_DIGIRED "DigiRed"
+#define HW_DIGIGREEN "DigiGreen"
+#define HW_STREAMER "Stream"
+
+#define CTR_W_REQCODE 0xC1
+#define CTR_W_VALUE 0x0000
+#define CTR_W_INDEX 0x0000
+
+#define CTR_R_REQCODE 0xC0
+#define CTR_R_VALUE 0x0000
+#define CTR_R_INDEX 0x0000
+
+/**	@brief Initializes port type and object necessary to communicate to usb device.
+*/
+ConnectionUSB::ConnectionUSB()
+{
+    m_hardwareName = "";
+    isConnected = false;
+    m_connectionType = USB_PORT;
+#ifndef __unix__
+    USBDevicePrimary = new CCyUSBDevice(NULL);
+    OutCtrEndPt = NULL;
+    InCtrEndPt = NULL;
+	InCtrlEndPt3 = NULL;
+	OutCtrlEndPt3 = NULL;
+#else
+    dev_handle = 0;
+    devs = 0;
+    int r = libusb_init(&ctx); //initialize the library for the session we just declared
+    if(r < 0)
+        printf("Init Error %i\n", r); //there was an error
+    libusb_set_debug(ctx, 3); //set verbosity level to 3, as suggested in the documentation
+#endif
+    currentDeviceIndex = -1;
+}
+
+/**	@brief Closes connection to chip and deallocates used memory.
+*/
+ConnectionUSB::~ConnectionUSB()
+{
+    Close();
+#ifndef __unix__
+    delete USBDevicePrimary;
+#else
+    libusb_exit(ctx);
+#endif
+}
+
+/**	@brief Automatically open first available chip connected to usb port.
+	@return 0-success, other-failure
+*/
+IConnection::DeviceStatus ConnectionUSB::Open()
+{
+    currentDeviceIndex = -1;
+    if(m_deviceNames.size() == 0)
+        RefreshDeviceList();
+
+#ifndef __unix__
+    for(int i=0; i<USBDevicePrimary->DeviceCount(); ++i)
+        if( Open(i) == SUCCESS)
+        {
+            currentDeviceIndex = i;
+            return SUCCESS;
+        }
+#else
+    if(Open(0) == SUCCESS)
+        return SUCCESS;
+#endif
+    return FAILURE;
+}
+
+/**	@brief Tries to open connected USB device and find communication endpoints.
+	@return Returns 1-Success, 0-EndPoints not found or device didn't connect.
+*/
+IConnection::DeviceStatus ConnectionUSB::Open(unsigned index)
+{
+#ifndef __unix__
+	wstring m_hardwareDesc = L"";
+	if( index < USBDevicePrimary->DeviceCount())
+	{
+		if(USBDevicePrimary->Open(index))
+		{
+            m_hardwareDesc = USBDevicePrimary->Product;
+            unsigned int pos;
+            //determine connected board type
+            pos = m_hardwareDesc.find(HW_LDIGIRED, 0);
+            if( pos != wstring::npos )
+                m_hardwareName = HW_DIGIRED;
+            else if (m_hardwareDesc.find(HW_LSTREAMER, 0) != wstring::npos)
+                m_hardwareName = HW_STREAMER;
+            else
+				m_hardwareName = HW_STREAMER;
+
+
+			if (InCtrlEndPt3)
+			{
+				delete InCtrlEndPt3;
+				InCtrlEndPt3 = NULL;
+			}
+			InCtrlEndPt3 = new CCyControlEndPoint(*USBDevicePrimary->ControlEndPt);
+
+			if (OutCtrlEndPt3)
+			{
+				delete OutCtrlEndPt3;
+				OutCtrlEndPt3 = NULL;
+			}
+			OutCtrlEndPt3 = new CCyControlEndPoint(*USBDevicePrimary->ControlEndPt);
+
+			InCtrlEndPt3->ReqCode = CTR_R_REQCODE;
+			InCtrlEndPt3->Value = CTR_R_VALUE;
+			InCtrlEndPt3->Index = CTR_R_INDEX;
+
+			OutCtrlEndPt3->ReqCode = CTR_W_REQCODE;
+			OutCtrlEndPt3->Value = CTR_W_VALUE;
+			OutCtrlEndPt3->Index = CTR_W_INDEX;
+
+			for (int i=0; i<USBDevicePrimary->EndPointCount(); i++)
+				if(USBDevicePrimary->EndPoints[i]->Address == 0x01)
+				{
+					OutEndPt = USBDevicePrimary->EndPoints[i];
+					long len = OutEndPt->MaxPktSize * 64;
+					OutEndPt->SetXferSize(len);
+					break;
+				}
+			for (int i=0; i<USBDevicePrimary->EndPointCount(); i++)
+				if(USBDevicePrimary->EndPoints[i]->Address == 0x81)
+				{
+					InEndPt = USBDevicePrimary->EndPoints[i];
+					long len = InEndPt->MaxPktSize * 64;
+					InEndPt->SetXferSize(len);
+					break;
+				}
+			isConnected = true;
+			return SUCCESS;
+		} //successfully opened device
+	} //if has devices
+    return FAILURE;
+#else
+    if(index >= 0 && index < m_dev_pid_vid.size())
+    {
+		dev_handle = libusb_open_device_with_vid_pid(ctx, m_dev_pid_vid[index].second, m_dev_pid_vid[index].first);
+
+		if(dev_handle == 0)
+            return FAILURE;
+        if(libusb_kernel_driver_active(dev_handle, 0) == 1)   //find out if kernel driver is attached
+        {
+            printf("Kernel Driver Active\n");
+            if(libusb_detach_kernel_driver(dev_handle, 0) == 0) //detach it
+                printf("Kernel Driver Detached!\n");
+        }
+        int r = libusb_claim_interface(dev_handle, 0); //claim interface 0 (the first) of device
+        if(r < 0)
+        {
+            printf("Cannot Claim Interface\n");
+            return CANNOT_CLAIM_INTERFACE;
+        }
+        printf("Claimed Interface\n");
+        isConnected = true;
+        return SUCCESS;
+    }
+    else
+    {
+        return FAILURE;
+    }
+#endif
+}
+
+/**	@brief Closes communication to device.
+*/
+void ConnectionUSB::Close()
+{
+    #ifndef __unix__
+	USBDevicePrimary->Close();
+	InEndPt = NULL;
+	OutEndPt = NULL;
+	if (InCtrlEndPt3)
+	{
+		delete InCtrlEndPt3;
+		InCtrlEndPt3 = NULL;
+	}
+	if (OutCtrlEndPt3)
+	{
+		delete OutCtrlEndPt3;
+		OutCtrlEndPt3 = NULL;
+	}
+    #else
+    if(dev_handle != 0)
+    {
+        libusb_release_interface(dev_handle, 0);
+        libusb_close(dev_handle);
+        dev_handle = 0;
+    }
+    #endif
+    isConnected = false;
+}
+
+/**	@brief Returns connection status
+	@return 1-connection open, 0-connection closed.
+*/
+bool ConnectionUSB::IsOpen()
+{
+    #ifndef __unix__
+    return USBDevicePrimary->IsOpen() && isConnected;
+    #else
+    return isConnected;
+    #endif
+}
+
+/**	@brief Sends given data buffer to chip through USB port.
+	@param buffer data buffer, must not be longer than 64 bytes.
+	@param length given buffer size.
+    @param timeout_ms timeout limit for operation in milliseconds
+	@return number of bytes sent.
+*/
+int ConnectionUSB::Write(const unsigned char *buffer, const int length, int timeout_ms)
+{
+    long len = length;
+    if(IsOpen())
+    {
+		unsigned char* wbuffer = new unsigned char[length];
+		memcpy(wbuffer, buffer, length);
+        if(m_hardwareName == HW_DIGIRED || m_hardwareName == HW_STREAMER)
+        {
+            #ifndef __unix__
+            if(OutCtrlEndPt3)
+                OutCtrlEndPt3->Write(wbuffer, len);
+            else
+                len = 0;
+            #else
+                len = libusb_control_transfer(dev_handle, LIBUSB_REQUEST_TYPE_VENDOR,CTR_W_REQCODE ,CTR_W_VALUE, CTR_W_INDEX, wbuffer, length, USB_TIMEOUT);
+            #endif
+        }
+        else
+        {
+            #ifndef __unix__
+            if(OutCtrEndPt)
+                OutCtrEndPt->XferData(wbuffer, len);
+            else
+                len = 0;
+            #else
+                int actual = 0;
+                libusb_bulk_transfer(dev_handle, 0x01, wbuffer, len, &actual, USB_TIMEOUT);
+                len = actual;
+            #endif
+        }
+		delete wbuffer;
+    }
+    else
+        return 0;
+    return len;
+}
+
+/**	@brief Reads data coming from the chip through USB port.
+	@param buffer pointer to array where received data will be copied, array must be
+	big enough to fit received data.
+	@param length number of bytes to read from chip.
+    @param timeout_ms timeout limit for operation in milliseconds
+	@return number of bytes received.
+*/
+int ConnectionUSB::Read(unsigned char *buffer, const int length, int timeout_ms)
+{
+    long len = length;
+    if(IsOpen())
+    {
+        if(m_hardwareName == HW_DIGIRED || m_hardwareName == HW_STREAMER)
+        {
+            #ifndef __unix__
+            if(InCtrlEndPt3)
+                InCtrlEndPt3->Read(buffer, len);
+            else
+                len = 0;
+            #else
+            len = libusb_control_transfer(dev_handle, LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_IN ,CTR_R_REQCODE ,CTR_R_VALUE, CTR_R_INDEX, buffer, len, USB_TIMEOUT);
+            #endif
+        }
+        else
+        {
+            #ifndef __unix__
+            if(InCtrEndPt)
+                InCtrEndPt->XferData(buffer, len);
+            else
+                len = 0;
+            #else
+                int actual = 0;
+                libusb_bulk_transfer(dev_handle, 0x81, buffer, len, &actual, USB_TIMEOUT);
+                len = actual;
+            #endif
+        }
+    }
+    return len;
+}
+
+#ifdef __unix__
+/**	@brief Function for handling libusb callbacks
+*/
+void callback_libusbtransfer(libusb_transfer *trans)
+{
+	USBTransferContext *context = reinterpret_cast<USBTransferContext*>(trans->user_data);
+	switch(trans->status)
+	{
+    case LIBUSB_TRANSFER_CANCELLED:
+        printf("Transfer canceled\n" );
+        context->bytesXfered = trans->actual_length;
+        context->done = true;
+        context->used = false;
+        context->reset();
+        break;
+    case LIBUSB_TRANSFER_COMPLETED:
+        if(trans->actual_length == context->bytesExpected)
+		{
+			context->bytesXfered = trans->actual_length;
+			context->done = true;
+		}
+		//printf("Transfer complete %i\n", trans->actual_length);
+        break;
+    case LIBUSB_TRANSFER_ERROR:
+        printf("TRANSFER ERRRO\n");
+        break;
+    case LIBUSB_TRANSFER_TIMED_OUT:
+        printf("transfer timed out\n");
+
+        break;
+    case LIBUSB_TRANSFER_OVERFLOW:
+        printf("transfer overflow\n");
+
+        break;
+    case LIBUSB_TRANSFER_STALL:
+        printf("transfer stalled\n");
+        break;
+	}
+    context->mPacketProcessed.notify_one();
+}
+#endif
+
+/** @brief Finds all chips connected to usb ports
+    @return number of devices found
+*/
+int ConnectionUSB::RefreshDeviceList()
+{
+    #ifndef __unix__
+    USBDevicePrimary->Close();
+    currentDeviceIndex = -1;
+    m_deviceNames.clear();
+    string name;
+    if (USBDevicePrimary->DeviceCount())
+    {
+        for (int i=0; i<USBDevicePrimary->DeviceCount(); ++i)
+        {
+            Open(i);
+            name = DeviceName();
+            m_deviceNames.push_back(name);
+        }
+        currentDeviceIndex = -1;
+    }
+    #else
+    m_dev_pid_vid.clear();
+    m_deviceNames.clear();
+    int usbDeviceCount = libusb_get_device_list(ctx, &devs);
+    if(usbDeviceCount > 0)
+    {
+        libusb_device_descriptor desc;
+        for(int i=0; i<usbDeviceCount; ++i)
+        {
+            int r = libusb_get_device_descriptor(devs[i], &desc);
+            if(r<0)
+                printf("failed to get device description\n");
+            int pid = desc.idProduct;
+            int vid = desc.idVendor;
+
+            if( vid == 1204)
+            {
+                if(pid == 34323)
+                {
+                    m_hardwareName = HW_DIGIGREEN;
+                    m_deviceNames.push_back("DigiGreen");
+                    m_dev_pid_vid.push_back( pair<int,int>(pid,vid));
+                }
+                else if(pid == 241)
+                {
+                    m_hardwareName = HW_DIGIRED;
+                    libusb_device_handle *tempDev_handle;
+                    tempDev_handle = libusb_open_device_with_vid_pid(ctx, vid, pid);
+                    if(libusb_kernel_driver_active(tempDev_handle, 0) == 1)   //find out if kernel driver is attached
+                    {
+                        if(libusb_detach_kernel_driver(tempDev_handle, 0) == 0) //detach it
+                            printf("Kernel Driver Detached!\n");
+                    }
+                    if(libusb_claim_interface(tempDev_handle, 0) < 0) //claim interface 0 (the first) of device
+                    {
+                        printf("Cannot Claim Interface\n");
+                    }
+
+                    string fullName;
+                    //check operating speed
+                    int speed = libusb_get_device_speed(devs[i]);
+                    if(speed == LIBUSB_SPEED_HIGH)
+                        fullName = "USB 2.0";
+                    else if(speed == LIBUSB_SPEED_SUPER)
+                        fullName = "USB 3.0";
+                    else
+                        fullName = "USB";
+                    fullName += " (";
+                    //read device name
+                    char data[255];
+                    memset(data, 0, 255);
+                    int st = libusb_get_string_descriptor_ascii(tempDev_handle, 2, (unsigned char*)data, 255);
+                    if(strlen(data) > 0)
+                        fullName += data;
+                    fullName += ")";
+                    libusb_close(tempDev_handle);
+
+                    m_deviceNames.push_back(fullName);
+                    m_dev_pid_vid.push_back( pair<int,int>(pid,vid));
+                }
+            }
+        }
+    }
+    else
+    {
+        libusb_free_device_list(devs, 1);
+        return 0;
+    }
+    #endif
+    return m_deviceNames.size();
+}
+
+void ConnectionUSB::ClearComm()
+{
+}
+
+/**	@return name of currently opened device as string.
+*/
+string ConnectionUSB::DeviceName()
+{
+#ifndef __unix__
+	string name;
+	char tempName[USB_STRING_MAXLEN];
+	//memcpy(tempName, USBDevicePrimary->FriendlyName, USB_STRING_MAXLEN);
+    //name = tempName;
+
+	for (int i = 0; i < USB_STRING_MAXLEN; ++i)
+		tempName[i] = USBDevicePrimary->DeviceName[i];
+    if (USBDevicePrimary->bSuperSpeed == true)
+        name = "USB 3.0";
+    else if (USBDevicePrimary->bHighSpeed == true)
+        name = "USB 2.0";
+    else
+        name = "USB";
+    name += " (";
+	name += tempName;
+	name += ")";
+    return name;
+#else
+    if(dev_handle != 0)
+    {
+        char data[255];
+        int st = libusb_get_string_descriptor_ascii(dev_handle, 2, (unsigned char*)data, 255);
+        return string(data);
+    }
+    return "no name";
+#endif
+}
+
+/**
+	@brief Starts asynchronous data reading from board
+	@param *buffer buffer where to store received data
+	@param length number of bytes to read
+	@return handle of transfer context
+*/
+int ConnectionUSB::BeginDataReading(char *buffer, long length)
+{
+    int i = 0;
+	bool contextFound = false;
+	//find not used context
+    for(i = 0; i<USB_MAX_CONTEXTS; i++)
+    {
+        if(!contexts[i].used)
+        {
+            contextFound = true;
+            break;
+        }
+    }
+    if(!contextFound)
+        return -1;
+    contexts[i].used = true;
+    #ifndef __unix__
+    if(InEndPt)
+        contexts[i].context = InEndPt->BeginDataXfer((unsigned char*)buffer, length, contexts[i].inOvLap);
+	return i;
+    #else
+    unsigned int Timeout = 1000;
+    libusb_transfer *tr = contexts[i].transfer;
+	libusb_fill_bulk_transfer(tr, dev_handle, 0x81, (unsigned char*)buffer, length, callback_libusbtransfer, &contexts[i], Timeout);
+	contexts[i].done = false;
+	contexts[i].bytesXfered = 0;
+	contexts[i].bytesExpected = length;
+    int status = libusb_submit_transfer(tr);
+    int actual = 0;
+    //int status = libusb_bulk_transfer(dev_handle, 0x81, (unsigned char*)buffer, length, &actual, USB_TIMEOUT);
+    if(status != 0)
+        printf("ERROR BEGIN DATA TRANSFER %s\n", libusb_error_name(status));
+    #endif
+    return i;
+}
+
+/**
+	@brief Waits for asynchronous data reception
+	@param contextHandle handle of which context data to wait
+	@param timeout_ms number of miliseconds to wait
+	@return 1-data received, 0-data not received
+*/
+int ConnectionUSB::WaitForReading(int contextHandle, unsigned int timeout_ms)
+{
+    if( contexts[contextHandle].used == true && contextHandle >= 0)
+    {
+    int status = 0;
+    #ifndef __unix__
+	if(InEndPt)
+        status = InEndPt->WaitForXfer(contexts[contextHandle].inOvLap, timeout_ms);
+	return status;
+    #else
+    auto t1 = chrono::high_resolution_clock::now();
+    auto t2 = chrono::high_resolution_clock::now();
+    while(contexts[contextHandle].done == false && std::chrono::duration_cast<std::chrono::milliseconds>(t2 - t1).count() < timeout_ms)
+	{
+	    struct timeval tv;
+	    tv.tv_sec = 1;
+	    tv.tv_usec = 0;
+		//if(libusb_handle_events(ctx) != 0)
+		if(libusb_handle_events_timeout_completed(ctx, &tv, NULL) != 0)
+            printf("error libusb_handle_events %i\n", status);
+		t2 = chrono::high_resolution_clock::now();
+		std::this_thread::sleep_for(std::chrono::milliseconds(1));
+	}
+    std::unique_lock<std::mutex> lck(contexts[contextHandle].m_lock);
+    while(contexts[contextHandle].done == false) //is changed in libusb callback
+    {
+        if(contexts[contextHandle].mPacketProcessed.wait_for(lck, std::chrono::milliseconds(timeout_ms)) == std::cv_status::timeout)
+            return 0;
+    }
+	return contexts[contextHandle].done == true;
+    #endif
+    }
+    else
+        return 0;
+}
+
+/**
+	@brief Finishes asynchronous data reading from board
+	@param buffer array where to store received data
+	@param length number of bytes to read, function changes this value to number of bytes actually received
+	@param contextHandle handle of which context to finish
+	@return false failure, true number of bytes received
+*/
+int ConnectionUSB::FinishDataReading(char *buffer, long &length, int contextHandle)
+{
+    if( contexts[contextHandle].used == true && contextHandle >= 0)
+    {
+    #ifndef __unix__
+    int status = 0;
+    if(InEndPt)
+        status = InEndPt->FinishDataXfer((unsigned char*)buffer, length, contexts[contextHandle].inOvLap, contexts[contextHandle].context);
+    contexts[contextHandle].used = false;
+    contexts[contextHandle].reset();
+    return length;
+    #else
+	length = contexts[contextHandle].bytesXfered;
+	contexts[contextHandle].used = false;
+	contexts[contextHandle].reset();
+	return length;
+    #endif
+    }
+    else
+        return 0;
+}
+
+int ConnectionUSB::ReadDataBlocking(char *buffer, long &length, int timeout_ms)
+{
+#ifndef __unix__
+    return InEndPt->XferData((unsigned char*)buffer, length);
+#else
+    return 0;
+#endif
+}
+
+
+/**
+	@brief Aborts reading operations
+*/
+void ConnectionUSB::AbortReading()
+{
+#ifndef __unix__
+	InEndPt->Abort();
+#else
+    for(int i=0; i<USB_MAX_CONTEXTS; ++i)
+    {
+        libusb_cancel_transfer( contexts[i].transfer );
+    }
+#endif
+}
+
+/**
+	@brief Starts asynchronous data Sending to board
+	@param *buffer buffer to send
+	@param length number of bytes to send
+	@return handle of transfer context
+*/
+int ConnectionUSB::BeginDataSending(const char *buffer, long length)
+{
+    int i = 0;
+	//find not used context
+	bool contextFound = false;
+    for(i = 0; i<USB_MAX_CONTEXTS; i++)
+    {
+        if(!contextsToSend[i].used)
+        {
+            contextFound = true;
+            break;
+        }
+    }
+    if(!contextFound)
+        return -1;
+    contextsToSend[i].used = true;
+    #ifndef __unix__
+    if(OutEndPt)
+        contextsToSend[i].context = OutEndPt->BeginDataXfer((unsigned char*)buffer, length, contextsToSend[i].inOvLap);
+	return i;
+    #else
+    unsigned int Timeout = 1000;
+    libusb_transfer *tr = contextsToSend[i].transfer;
+    //libusb_set_iso_packet_lengths(contexts[i].transfer, 512*64);
+	libusb_fill_bulk_transfer(tr, dev_handle, 0x1, (unsigned char*)buffer, length, callback_libusbtransfer, &contextsToSend[i], Timeout);
+	contextsToSend[i].done = false;
+	contextsToSend[i].bytesXfered = 0;
+	contextsToSend[i].bytesExpected = length;
+    libusb_submit_transfer(tr);
+    #endif
+    return i;
+}
+
+/**
+	@brief Waits for asynchronous data sending
+	@param contextHandle handle of which context data to wait
+	@param timeout_ms number of miliseconds to wait
+	@return 1-data received, 0-data not received
+*/
+int ConnectionUSB::WaitForSending(int contextHandle, unsigned int timeout_ms)
+{
+    if( contextsToSend[contextHandle].used == true )
+    {
+    #ifndef __unix__
+	int status = 0;
+	if(OutEndPt)
+        status = OutEndPt->WaitForXfer(contextsToSend[contextHandle].inOvLap, timeout_ms);
+	return status;
+    #else
+    auto t1 = chrono::high_resolution_clock::now();
+    auto t2 = chrono::high_resolution_clock::now();
+    while(contextsToSend[contextHandle].done == false && std::chrono::duration_cast<std::chrono::milliseconds>(t2 - t1).count() < timeout_ms)
+	{
+	    struct timeval tv;
+	    tv.tv_sec = 1;
+	    tv.tv_usec = 0;
+        int status = libusb_handle_events_timeout_completed(ctx, &tv, NULL);
+        if(status != 0)
+            printf("error libusb_handle_events %i\n", status);
+        t2 = chrono::high_resolution_clock::now();
+        std::this_thread::sleep_for(std::chrono::milliseconds(1));
+	}
+	std::unique_lock<std::mutex> lck(contextsToSend[contextHandle].m_lock);
+    while(contextsToSend[contextHandle].done == false) //is changed in libusb callback
+    {
+        if(contextsToSend[contextHandle].mPacketProcessed.wait_for(lck, std::chrono::milliseconds(timeout_ms)) == std::cv_status::timeout)
+            return 0;
+    }
+	return contextsToSend[contextHandle].done == true;
+    #endif
+    }
+    else
+        return 0;
+}
+
+/**
+	@brief Finishes asynchronous data sending to board
+	@param buffer array where to store received data
+	@param length number of bytes to read, function changes this value to number of bytes acctually received
+	@param contextHandle handle of which context to finish
+	@return false failure, true number of bytes sent
+*/
+int ConnectionUSB::FinishDataSending(const char *buffer, long &length, int contextHandle)
+{
+    if( contextsToSend[contextHandle].used == true)
+    {
+    #ifndef __unix__
+	if(OutEndPt)
+        OutEndPt->FinishDataXfer((unsigned char*)buffer, length, contextsToSend[contextHandle].inOvLap, contextsToSend[contextHandle].context);
+    contextsToSend[contextHandle].used = false;
+    contextsToSend[contextHandle].reset();
+    return length;
+    #else
+	length = contextsToSend[contextHandle].bytesXfered;
+	contextsToSend[contextHandle].used = false;
+    contextsToSend[contextHandle].reset();
+	return length;
+    #endif
+    }
+    else
+        return 0;
+}
+
+/**
+	@brief Aborts sending operations
+*/
+void ConnectionUSB::AbortSending()
+{
+#ifndef __unix__
+	OutEndPt->Abort();
+#else
+    for (int i = 0; i<USB_MAX_CONTEXTS; ++i)
+    {
+        libusb_cancel_transfer(contextsToSend[i].transfer);
+    }
+    for(int i=0; i<USB_MAX_CONTEXTS; ++i)
+    {
+        contextsToSend[i].used = false;
+        contextsToSend[i].reset();
+    }
+#endif
+}
+
+int ConnectionUSB::GetOpenedIndex()
+{
+    return currentDeviceIndex;
+}
+
+/** @brief Returns found devices names
+    @return vector of device names
+*/
+vector<string> ConnectionUSB::GetDeviceNames()
+{
+    return m_deviceNames;
+}
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionUSB.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionUSB.h
new file mode 100644
index 0000000000000000000000000000000000000000..f3048c184200e5bb5bdb875392c957ca45c75a7b
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/ConnectionUSB.h
@@ -0,0 +1,144 @@
+/**
+@file   ConnectionUSB.h
+@author Lime Microsystems (www.limemicro.com)
+@brief  Class for data writing and reading through USB port
+*/
+
+#ifndef USB_PORT_CONNECTION_H
+#define USB_PORT_CONNECTION_H
+
+#include "IConnection.h"
+
+#ifndef __unix__
+#include "windows.h"
+#include "CyAPI.h"
+#else
+#include <libusb-1.0/libusb.h>
+#include <mutex>
+#include <condition_variable>
+#include <chrono>
+#endif
+
+#define USB_MAX_CONTEXTS 64 //maximum number of contexts for asynchronous transfers
+
+/** @brief Wrapper class for holding USB asynchronous transfers contexts
+*/
+class USBTransferContext
+{
+public:
+	USBTransferContext() : used(false)
+	{
+		#ifndef __unix__
+		inOvLap = new OVERLAPPED;
+		memset(inOvLap, 0, sizeof(OVERLAPPED));
+		inOvLap->hEvent = CreateEvent(NULL, false, false, NULL);
+		context = NULL;
+		#else
+		transfer = libusb_alloc_transfer(0);
+		bytesXfered = 0;
+		bytesExpected = 0;
+		done = 0;
+		#endif
+	}
+	~USBTransferContext()
+	{
+		#ifndef __unix__
+		CloseHandle(inOvLap->hEvent);
+		delete inOvLap;
+		#else
+		libusb_free_transfer(transfer);
+		#endif
+	}
+	bool reset()
+	{
+        if(used)
+            return false;
+        #ifndef __unix__
+        CloseHandle(inOvLap->hEvent);
+        memset(inOvLap, 0, sizeof(OVERLAPPED));
+        inOvLap->hEvent = CreateEvent(NULL, false, false, NULL);
+        #endif
+        return true;
+	}
+	bool used;
+	#ifndef __unix__
+	PUCHAR context;
+	OVERLAPPED *inOvLap;
+	#else
+	libusb_transfer* transfer;
+	long bytesXfered;
+	long bytesExpected;
+	bool done;
+	std::mutex m_lock;
+    std::condition_variable mPacketProcessed;
+	#endif
+};
+
+class ConnectionUSB : public IConnection
+{
+public:
+	ConnectionUSB();
+	~ConnectionUSB();
+
+    void FindDevices();
+	DeviceStatus Open();
+	DeviceStatus Open(unsigned index);
+	void Close();
+	bool IsOpen();
+	int GetOpenedIndex();
+
+	int Write(const unsigned char *buffer, int length, int timeout_ms = 0);
+	int Read(unsigned char *buffer, int length, int timeout_ms = 0);
+
+	virtual int BeginDataReading(char *buffer, long length);
+	virtual int WaitForReading(int contextHandle, unsigned int timeout_ms);
+	virtual int FinishDataReading(char *buffer, long &length, int contextHandle);
+	virtual void AbortReading();
+    virtual int ReadDataBlocking(char *buffer, long &length, int timeout_ms);
+
+	virtual int BeginDataSending(const char *buffer, long length);
+	virtual int WaitForSending(int contextHandle, unsigned int timeout_ms);
+	virtual int FinishDataSending(const char *buffer, long &length, int contextHandle);
+	virtual void AbortSending();
+
+	std::vector<std::string> GetDeviceNames();
+	int RefreshDeviceList();
+	void ClearComm();
+private:
+    int currentDeviceIndex;
+    std::string DeviceName();
+
+    std::vector<std::string> m_deviceNames;
+    std::string m_hardwareName;
+    int m_hardwareVer;
+
+	USBTransferContext contexts[USB_MAX_CONTEXTS];
+	USBTransferContext contextsToSend[USB_MAX_CONTEXTS];
+	void Initialize();
+
+	bool isConnected;
+	int currentPortIndex;
+
+	#ifndef __unix__
+	CCyUSBDevice *USBDevicePrimary;
+	//control endpoints for DigiRed
+	CCyControlEndPoint *InCtrlEndPt3;
+	CCyControlEndPoint *OutCtrlEndPt3;
+
+    //control endpoints for DigiGreen
+	CCyUSBEndPoint *OutCtrEndPt;
+	CCyUSBEndPoint *InCtrEndPt;
+
+    //end points for samples reading and writing
+	CCyUSBEndPoint *InEndPt;
+	CCyUSBEndPoint *OutEndPt;
+
+	#else
+    libusb_device **devs; //pointer to pointer of device, used to retrieve a list of devices
+    libusb_device_handle *dev_handle; //a device handle
+    libusb_context *ctx; //a libusb session
+    std::vector<std::pair<int,int> > m_dev_pid_vid;
+	#endif
+};
+
+#endif
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/IConnection.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/IConnection.h
new file mode 100644
index 0000000000000000000000000000000000000000..5804f1149f104c4d834c710eaf6f38f75bc9a6d3
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/connectionManager/IConnection.h
@@ -0,0 +1,68 @@
+/**
+    @file IConnection.h
+    @author Lime Microsystems
+    @brief Interface class for connection types
+*/
+
+#ifndef ICONNECTION_H
+#define ICONNECTION_H
+
+#include <string>
+#include <vector>
+
+using namespace std;
+
+class IConnection
+{
+public:
+    /// Supported connection types.
+    enum eConnectionType
+    {
+	    CONNECTION_UNDEFINED = -1,
+	    COM_PORT = 0,
+	    USB_PORT = 1,
+	    SPI_PORT = 2,
+	    //insert new types here
+	    CONNECTION_TYPES_COUNT //used only for memory allocation
+    };
+
+    enum DeviceStatus
+    {
+        SUCCESS,
+        FAILURE,
+        END_POINTS_NOT_FOUND,
+        CANNOT_CLAIM_INTERFACE
+    };
+
+	IConnection() : m_connectionType(CONNECTION_UNDEFINED){};
+	virtual ~IConnection(){};
+	virtual int RefreshDeviceList() = 0;
+	virtual DeviceStatus Open(unsigned i) = 0;
+	virtual void Close() = 0;
+	virtual bool IsOpen() = 0;
+	virtual int GetOpenedIndex() = 0;
+
+	virtual int Write(const unsigned char *buffer, int length, int timeout_ms = 0) = 0;
+	virtual int Read(unsigned char *buffer, int length, int timeout_ms = 0) = 0;
+
+	virtual std::vector<std::string> GetDeviceNames() = 0;
+
+	virtual eConnectionType GetType() { return m_connectionType; };
+	virtual bool SetParam(const char *name, const char* value) {return false;};
+
+	virtual int BeginDataReading(char *buffer, long length){ return -1; };
+	virtual int WaitForReading(int contextHandle, unsigned int timeout_ms){ return 0;};
+	virtual int FinishDataReading(char *buffer, long &length, int contextHandle){ return 0;}
+	virtual void AbortReading(){};
+    virtual int ReadDataBlocking(char *buffer, long &length, int timeout_ms){ return 0; }
+
+	virtual int BeginDataSending(const char *buffer, long length){ return -1; };
+	virtual int WaitForSending(int contextHandle, unsigned int timeout_ms){ return 0;};
+	virtual int FinishDataSending(const char *buffer, long &length, int contextHandle){ return 0;}
+	virtual void AbortSending(){};
+protected:
+	eConnectionType m_connectionType;
+};
+
+#endif
+
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/INI.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/INI.h
new file mode 100644
index 0000000000000000000000000000000000000000..de54b4e7b49d9b8b113aa5abf7cc2849dce4df53
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/INI.h
@@ -0,0 +1,639 @@
+/*
+   Feather INI Parser - 1.40
+   You are free to use this however you wish.
+
+   If you find a bug, please attept to debug the cause.
+   Post your environment details and the cause or fix in the issues section of GitHub.
+
+   Written by Turbine.
+
+   Website:
+   https://github.com/Turbine1991/feather-ini-parser
+   http://code.google.com/p/feather-ini-parser/downloads
+
+   Help:
+   Bundled example & readme.
+   http://code.google.com/p/feather-ini-parser/wiki/Tutorials
+*/
+
+#pragma once
+
+#include <string>
+#include <fstream>
+#include <sstream>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#define FINI_SAFE
+#define FINI_BUFFER_SIZE 128
+
+#if __cplusplus >= 201103L
+  #include <unordered_map>
+  #define FINI_CPP11
+  #define ALLOCATE_SECTIONS 100
+  #define ALLOCATE_KEYS 5
+#else
+  #include <map>
+#endif
+
+#ifdef FINI_WIDE_SUPPORT
+  #include <wchar.h>
+
+  typedef std::wstringstream fini_sstream_t;
+  typedef std::wstring fini_string_t;
+  typedef wchar_t fini_char_t;
+  typedef std::wifstream fini_ifstream_t;
+  typedef std::wofstream fini_ofstream_t;
+
+  #define fini_strlen(a) wcslen(a)
+  #define fini_strncpy(a, b) wcscpy(a, b)
+  #define fini_strncpy(a, b, c) wcsncpy(a, b, c)
+  #define fini_strtok(a, b) wcstok(a, b)
+
+  #define _T(x) L ##x
+#else
+  #include <cstring>
+
+  typedef std::stringstream fini_sstream_t;
+  typedef std::string fini_string_t;
+  typedef char fini_char_t;
+  typedef std::ifstream fini_ifstream_t;
+  typedef std::ofstream fini_ofstream_t;
+
+  #define fini_strlen(a) strlen(a)
+  #define fini_strcpy(a, b) strcpy(a, b)
+  #define fini_strncpy(a, b, c) strncpy(a, b, c)
+  #define fini_strtok(a, b) strtok(a, b)
+
+  #define _T(x) x
+#endif
+
+#define CHAR_SIZE sizeof(fini_char_t)
+
+///Simple converter using templates and streams to effectively required for the flexibility of handling native types
+class Converters
+{
+public:
+   template <typename T, typename U>
+     static T Convert(U value);
+   template <typename T>
+      static void GetLine(fini_sstream_t& out, T& value);
+   static void GetLine(fini_sstream_t& out, fini_string_t& value);
+   template <typename T>
+      static size_t GetDataSize(T& value);
+   static size_t GetDataSize(fini_string_t value);
+};
+
+///
+template <typename T = fini_string_t, typename U = fini_string_t, typename V = fini_string_t>
+   class INI
+{
+public:
+   typedef T section_t;
+   typedef U key_t;
+   typedef V value_t;
+   typedef INI<section_t, key_t, value_t> ini_t;
+
+///Type definition declarations
+#ifdef FINI_CPP11
+   typedef typename std::unordered_map<key_t, value_t> keys_t;
+   typedef typename std::unordered_map<section_t, keys_t*> sections_t;
+#else
+   typedef typename std::map<key_t, value_t> keys_t;
+   typedef typename std::map<section_t, keys_t*> sections_t;
+#endif
+
+   typedef typename keys_t::iterator keysit_t;
+   typedef typename sections_t::iterator sectionsit_t;
+
+   typedef typename std::pair<key_t, value_t> keyspair_t;
+   typedef typename std::pair<section_t, keys_t*> sectionspair_t;
+
+   typedef char data_t;
+
+   enum source_e {SOURCE_FILE, SOURCE_MEMORY};
+
+///Data members
+   std::string filename;
+   data_t* data;
+   size_t dataSize;
+   keys_t* current;
+   sections_t sections;
+   source_e source;
+
+///Constuctor/Destructor
+   //Specify the filename to associate and whether to parse immediately
+   INI(const std::string filename, bool doParse): filename(filename)
+   {
+      init(SOURCE_FILE, doParse);
+   }
+
+   //Used for loading INI from memory
+   INI(void* data, size_t dataSize, bool doParse): data((data_t*)data), dataSize(dataSize)
+   {
+      init(SOURCE_MEMORY, doParse);
+   }
+
+   ~INI()
+   {
+      clear();
+   }
+
+///Access Content
+   //Provide bracket access to section contents
+   keys_t& operator[](section_t section)
+   {
+   #ifdef FINI_SAFE
+     if (!sections[section])
+       sections[section] = new keys_t;
+   #endif
+
+      return *sections[section];
+   }
+
+   //Create a new section and select it
+   bool create(const section_t section)
+   {
+      if (select(section))
+         return false;
+
+      current = new keys_t;
+      sections[section] = current;
+
+      reserveKeys(current);
+
+      return true;
+   }
+
+   //Select a section for performing operations
+   bool select(const section_t section)
+   {
+      sectionsit_t sectionsit = sections.find(section);
+      if (sectionsit == sections.end())
+         return false;
+
+      current = sectionsit->second;
+
+      return true;
+   }
+
+///Set
+   //Assign a value for key under the selected section
+   bool set(const key_t key, const value_t value)
+   {
+      if (current == NULL)
+         return false;
+
+      (*current)[key] = value;
+
+      return true;
+   }
+
+   template <typename W, typename X>
+      bool set(const W key, const X value)
+         { return set(Converters::Convert<key_t>(key), Converters::Convert<value_t>(value)); }
+
+///Get
+   value_t get(const key_t key, value_t def = value_t())
+   {
+      keysit_t it = current->find(key);
+      if (current == NULL || it == current->end())
+         return def;
+
+      return it->second;
+   }
+
+   value_t get(const section_t section, const key_t key, value_t def)
+   {
+      if (!select(section))
+         return def;
+
+      return get(key, def);
+   }
+
+   template <typename W, typename X>
+      X get(const W key, const X def = value_t())
+         { return Converters::Convert<X>(get(Converters::Convert<key_t>(key), Converters::Convert<value_t>(def))); }
+
+   template <typename W>
+      fini_string_t get(const W key, const fini_char_t* def = _T(""))  //Handle C string default value without casting
+         { return Converters::Convert<fini_string_t>(get(Converters::Convert<key_t>(key), Converters::Convert<value_t>(def))); }
+
+   template <typename W, typename X, typename Y>
+      Y get(const W section, const X key, const Y def)
+         { return Converters::Convert<Y>(get(Converters::Convert<section_t>(section), Converters::Convert<key_t>(key), Converters::Convert<value_t>(def))); }
+
+   template <typename W, typename X>
+      fini_string_t get(const W section, const X key, const fini_char_t* def)  //Handle C string default value without casting
+         { return Converters::Convert<fini_string_t>(Converters::Convert<section_t>(section), get(Converters::Convert<key_t>(key), Converters::Convert<value_t>(def))); }
+
+///Functions
+   void parse(std::istream& file)
+   {
+      fini_char_t line[FINI_BUFFER_SIZE];
+      bool first = true;
+      fini_sstream_t out;
+
+      while(!file.eof())
+      {
+         file.getline(line, FINI_BUFFER_SIZE);
+
+         if (first)
+         {
+            first = false;
+            if (line[0] == 0xEF) //Allows handling of UTF-16/32 documents
+            {
+               memmove(line, line + (CHAR_SIZE * 3), CHAR_SIZE * (FINI_BUFFER_SIZE - 3));
+               return;
+            }
+         }
+
+         nake(line);
+
+         if (line[0])
+         {
+            size_t len = fini_strlen(line);
+            if (len > 0 && !((len >= 2 && (line[0] == '/' && line[1] == '/')) || (len >= 1 && line[0] == '#')))  //Ignore comment and empty lines
+            {
+               if (line[0] == '[')  //Section
+               {
+                  section_t section;
+                  size_t length = fini_strlen(line) - 2;  //Without section brackets
+                  while(isspace(line[length + 1]))  //Leave out any additional new line characters, not "spaces" as the name suggests
+                     --length;
+
+                  fini_char_t* ssection = (fini_char_t*)calloc(CHAR_SIZE, length + 1);
+                  fini_strncpy(ssection, line + 1, length);  //Count after first bracket
+
+                  current = new keys_t;
+
+                  out << ssection;
+                  free(ssection);
+                  Converters::GetLine(out, section);
+
+                  sections[section] = current;
+               }
+               else  //Key
+               {
+                  key_t key;
+                  value_t value;
+
+                  fini_char_t* skey;
+                  fini_char_t* svalue;
+
+                  skey = fini_strtok(line, _T("="));
+                  svalue = fini_strtok(NULL, _T("\n"));
+
+                  if (skey && svalue)
+                  {
+                     size_t index = 0;  //Without section brackets
+                     while(isspace(skey[index]))  //Leave out any additional new line characters, not "spaces" as the name suggests
+                        index++;
+
+                     if (index != 0)  //Has preceeding white space
+                        fini_strcpy(skey, skey + index);
+
+                     out << skey;
+
+                     Converters::GetLine(out, key);
+
+                     out.clear();
+                     out.str(fini_string_t());
+
+                     out << svalue;
+                     Converters::GetLine(out, value);
+
+                     if (value != value_t())
+                       (*current)[key] = value;
+                  }
+               }
+
+               out.clear();
+               out.str(fini_string_t()); //Clear existing stream;
+            }
+         }
+      }
+   }
+
+   //Parse an INI's contents into memory from the filename given during construction
+   bool parse()
+   {
+      switch(source)
+      {
+      case SOURCE_FILE: {
+            fini_ifstream_t file(filename.c_str());
+
+            if (!file.is_open())
+               return false;
+
+            parse(file);
+
+            file.close();
+         }
+         break;
+
+      case SOURCE_MEMORY: {
+            std::stringstream sstream;
+            sstream.rdbuf()->pubsetbuf(data, dataSize);
+
+            parse(sstream);
+         }
+         break;
+      }
+
+      return true;
+   }
+
+   bool parseBinary()
+   {
+      fini_ifstream_t file(filename.c_str(), std::ios::binary);
+      if (!file.is_open())
+         return false;
+
+      size_t sectionCount;
+      size_t keyCount;
+      key_t key;
+      value_t value;
+      section_t section;
+
+      //file.read((fini_char_t*)&sectionCount, sizeof(sectionCount));
+      file >> sectionCount;
+
+      for(size_t i = 0; i < sectionCount; i++)
+      {
+         if (i > 0)
+            file.seekg(1 + file.tellg());
+
+         file.read((fini_char_t*)&keyCount, sizeof(keyCount));
+         file >> section;
+
+         create(section);
+
+         for(size_t j = 0; j < keyCount; j++)
+         {
+            file >> key;
+            file >> value;
+            set(key, value);
+         }
+      }
+
+      file.close();
+
+      return true;
+   }
+
+   //Clear the contents from memory
+   void clear()
+   {
+      clean();
+      sections.clear();
+   }
+
+///Output
+   //Save from memory into file
+   bool save(const std::string filename = "")
+   {
+      if (!hasFileAssociation(filename))
+         return false;
+
+      fini_ofstream_t file(((filename == "")? this->filename: filename).c_str(), std::ios::trunc);
+      if (!file.is_open())
+         return false;
+
+      //Loop through sections
+      for(typename INI::sectionsit_t i = sections.begin(); i != sections.end(); i++)
+      {
+         if (i->second->size() == 0)  //No keys/values in section, skip to next
+            continue;
+
+         //Write section
+         const fini_string_t temp = makeSection(i->first);
+         const fini_char_t* line = temp.c_str();
+         file.write(line, fini_strlen(line));
+
+         for(typename INI::keysit_t j = i->second->begin(); j != i->second->end(); j++)
+         {
+            //Write key and value
+            const fini_string_t temp = makeKeyValue(j->first, j->second);
+            const fini_char_t* line = temp.c_str();
+            file.write(line, fini_strlen(line));
+         }
+      }
+
+      file.close();
+
+      return true;
+   }
+
+   //Saves it without any conventional INI formatting characters, however it only uses string streams
+   bool saveBinary(const std::string filename = "")
+   {
+      if (!hasFileAssociation(filename))
+         return false;
+
+      fini_ofstream_t file(((filename == "")? this->filename: filename).c_str(), std::ios::trunc | std::ios::binary);
+      if (!file.is_open())
+         return false;
+
+      size_t sectionCount = sections.size();
+      size_t keyCount;
+
+      file.write((fini_char_t*)&sectionCount, sizeof(sectionCount));
+
+      //Loop through sections
+      for(typename INI::sectionsit_t i = sections.begin(); i != sections.end(); i++)
+      {
+         keyCount = i->second->size();
+         file.write((fini_char_t*)&keyCount, sizeof(keyCount));
+
+         file << i->first << std::endl;
+
+         for(typename INI::keysit_t j = i->second->begin(); j != i->second->end(); j++)
+         {
+            file << j->first << std::endl;
+            file << j->second << std::endl;
+         }
+      }
+
+      file.close();
+
+      return true;
+   }
+
+   //Saves it as a true binary file, intended to replace the existing one. Don't bother using it with all strings.
+   bool saveBinaryExperimental(std::string filename = "")
+   {
+      if (!hasFileAssociation(filename))
+         return false;
+
+      fini_ofstream_t file(((filename == "")? this->filename: filename).c_str(), std::ios::trunc | std::ios::binary);
+      if (!file.is_open())
+         return false;
+
+      size_t sectionCount = sections.size();
+      size_t keyCount;
+
+      file.write((fini_char_t*)&sectionCount, sizeof(sectionCount));
+
+      //Loop through sections
+      for(typename INI::sectionsit_t i = sections.begin(); i != sections.end(); i++)
+      {
+         keyCount = i->second->size();
+         file.write((fini_char_t*)&keyCount, sizeof(keyCount));
+
+         file.write((fini_char_t*)&i->first, Converters::GetDataSize(i->first));
+
+         for(typename INI::keysit_t j = i->second->begin(); j != i->second->end(); j++)
+         {
+            file.write((fini_char_t*)&j->first, Converters::GetDataSize(j->first));
+            file.write((fini_char_t*)&j->second, Converters::GetDataSize(j->second));
+         }
+      }
+
+      file.close();
+
+      return true;
+   }
+
+   //Alows another INI's contents to be insert into another, with the ability to retain the original values
+   void merge(ini_t& other, bool retainValues = true)
+   {
+      for(typename INI::sectionsit_t i = other.sections.begin(); i != other.sections.end(); i++)
+      {
+         if (!select(i->first)) //Create and insert all key values into a missing section
+         {
+            keys_t* keys = new keys_t(*i->second);
+            sections.insert(std::make_pair(i->first, keys));
+         }
+         else
+         {
+            for(typename INI::keysit_t j = i->second->begin(); j != i->second->end(); j++)
+            {
+               keysit_t it = current->find(j->first);
+               if (it == current->end())
+                  current->insert(std::make_pair(j->first, j->second));
+               else if (!retainValues)
+                  it->second = j->second;
+            }
+         }
+      }
+   }
+
+private:
+///Functions
+   //Init the INI in with values set by constructor
+   void init(source_e source, bool doParse)
+   {
+      this->source = source;
+
+      reserveSections();
+      if (doParse)
+         parse();
+   }
+
+   //Clean the contents for descruction
+   void clean()
+   {
+      for(sectionsit_t i = sections.begin(); i != sections.end(); i++)
+         delete i->second;
+
+      current = NULL;
+   }
+
+   //Make any alterations to the raw line
+   void nake(const fini_char_t*)  //Strip the line of any non-interpretable characters
+   {
+
+   }
+
+   void reserveSections()
+   {
+   #ifdef FINI_CPP11
+      sections.reserve(ALLOCATE_SECTIONS);
+   #endif
+   }
+
+   void reserveKeys(keys_t* current)
+   {
+   #ifdef FINI_CPP11
+      current->reserve(ALLOCATE_KEYS);
+   #endif
+   }
+
+   bool hasFileAssociation(std::string filename)
+   {
+      if (source == SOURCE_MEMORY && filename == "") //No association to a file
+         return false;
+
+      return true;
+   }
+
+///Output
+   //Creates a section as a string
+   fini_string_t makeSection(const section_t& section)
+   {
+      fini_sstream_t line;
+      line << '[' << section << ']' << std::endl;
+
+      return line.str();
+   }
+
+   //Creates a key and a value as a string
+   fini_string_t makeKeyValue(const key_t& key, const value_t& value)
+   {
+      fini_sstream_t line;
+      line << key << '=' << value << std::endl;
+
+      return line.str();
+   }
+};
+
+///Definitions
+template <typename T, typename U>
+  inline T Converters::Convert(U value)
+{
+  fini_sstream_t sout;
+  T result;
+
+  sout << value;
+  sout >> result;
+
+  sout.str(fini_string_t());
+
+  return result;
+}
+
+template <>
+  inline fini_string_t Converters::Convert<fini_string_t, fini_string_t>(fini_string_t value)
+{
+  return value;
+}
+
+template <>
+  inline fini_string_t Converters::Convert<fini_string_t>(const fini_char_t* value)
+{
+  return value;
+}
+
+template <typename T>
+  inline void Converters::GetLine(fini_sstream_t& out, T& value)
+{
+  out >> value;
+}
+
+inline void Converters::GetLine(fini_sstream_t& out, fini_string_t& value)
+{
+  std::getline(out, value);
+}
+
+template <typename T>
+   inline size_t Converters::GetDataSize(T& value)
+{
+   return sizeof(value);
+}
+
+inline size_t Converters::GetDataSize(fini_string_t value)
+{
+   return value.size() + 1;
+}
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/LICENSE b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..7d961cc6e56bcf624d2b15806266311da47fe28a
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Turbine1991
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/README.md b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..f1245971cd05a49f7c070347e304c444b003d480
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/README.md
@@ -0,0 +1,47 @@
+feather-ini-parser
+==================
+
+Simple like your girlfriend, fast, lightweight, header, portable INI parser for ANSI C++.
+
+Why use feather-ini-parser? It's a fast, intuitive, uses C++, supports native data types, wide char support (enable), converting to data types simply by setting a default value or providing the type as a template parameter.
+
+##Methods
+
+Statement     | Return Type
+------------- | -------------
+ini(filename, doParse)|constructor
+ini(data, dataSize, doParse)|constructor
+ini.parse()|bool
+ini.merge(other INI, retainValues)|void
+ini.create(section)|bool
+ini.select(section)|bool
+ini.set(key, value)|bool
+ini.get(key, dvalue = value_t())|dvalue_t
+ini.save(filename = "")|bool
+ini.clear()|bool
+ini[section][key]|value_t&
+ini[section]|keys_t&
+
+##Example
+```
+#include <iostream>
+#include "INI.h"
+
+using namespace std;
+```
+...
+```
+typedef INI<> ini_t;
+//or
+//typedef INI<section_t, key_t, value_t> ini_t;
+
+ini_t ini("filename.ini", true);
+ini.create("section1"); //Create and select section1
+ini.set("key", "value");
+cout << ini.get("keynumeric", -1) << endl;
+ini["section2"]["key"] = "value";
+ini.save();
+```
+
+##More
+Please see the example .cpp file and Code::Blocks .cbp project for a compilable GCC and VSC++ example. Additionally includes enabling wide char support and iterating through contents.
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/example.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/example.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..462dd241dcd3525320d3d01001ea9ac209afccee
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/example.cpp
@@ -0,0 +1,130 @@
+#include <iostream>
+#include <cstring>
+#include <stdint.h>
+#include "../INI.h"
+
+using namespace std;
+
+void centerString(string str); //Printing to console
+std::string getStringFromFile(const std::string& path); //Source for data loading from memory.
+
+int main()
+{
+   ///Declare
+   typedef INI<> ini_t;  //Makes things shorter/easier to write <Section, Key, Value>
+   //or
+   //typedef INI<string, string, string> ini_t;  //Equivelant to previous line when wide characters are disabled
+   ini_t ini("file.ini", true);  //File to open/default save filename. The constuctor is set to parse by default, unless specified as false
+
+   ///Manipulate and access contents
+   centerString("########## Access & Manipulate Contents ##########");
+
+   //Common usage
+   ini.create("Section 1");
+   ini.create("Section 2");
+   ini.get("Key1", "DefaultValue");
+   ini.select("Section 1");
+   ini.set("Key2", "Value");
+   ini.save(); //Save contents to file, optional filename parameter available
+   ini.clear(); //Clear INI contents from memory
+
+   //Extended usage
+   ini["Section Name"]["Key"] = "Value";  //You are not required to create a section first
+
+   ini.create("Section1");  //Also selects as current section
+   ini.create("Section2");  //Current
+
+   ini.set("Key1", "Value1");  //Added pair under section "Section2"
+
+   ini.select("Section1");  //Current
+   cout << ini.get("Key1", "-1") << endl;  //Returns "-1" as no key exists, no default will return NULL for data type, eg int() is 0
+
+   ini.select("Section2");
+   ini.set("Key1", "1.123");
+   cout << ini.get("Key1", -1.0) << endl;  //Return value as double
+   ini.set(123, 123);  //Will convert to provided INI data type for key/value, in this case string for both
+
+   ini.save();
+   ini.clear();
+   ini.parse();  //Parses file into objects in memory
+
+   cout << ini["Section2"]["Key1"] << endl;  //Returns "Value1", slightly more overhead involved seeking section, avoid using excessively
+
+   ///Iterate through sections and keys for both C++11 and C++98
+   centerString("########## Iterate Contents ##########");
+
+#ifdef FINI_CPP11
+   for(auto i: ini.sections)
+   {
+      cout << "[" << i.first << "]" << endl;
+
+      //for(auto j = i.second->begin(); j != i.second->end(); j++)
+      for(auto j: *i.second)
+      {
+         cout << " " << j.first << "=" << j.second << endl;
+      }
+   }
+#else
+   for(ini_t::sectionsit_t i = ini.sections.begin(); i != ini.sections.end(); i++)
+   {
+      //Section name as ini_t::section_t
+      cout << i->first << endl;
+
+      if (i->second->size() == 0)  //No keys/values in section, skip to next
+         continue;
+
+      for(ini_t::keysit_t j = i->second->begin(); j != i->second->end(); j++)
+      {
+         //Name as ini_t::key_t & Value as ini_t::key_t
+         cout << " " << j->first << "=" << j->second << endl;
+      }
+   }
+#endif
+
+///Example with different data types
+   typedef INI <unsigned char, string, float> ini_int_t;  //Makes things shorter/easier to write <Section, Key, Value>
+   ini_int_t ini_int("file_ints.ini", false);  //File to open/default save filename. The constuctor is set to parse by default, unless specified as false
+   for(int i = 1; i <= 200; i++)
+   {
+      ini_int.create(i); //Section
+      ini_int.set("Key", i / 2.f);
+   }
+
+   ini_int.save();
+
+///Wide char support example (please define FINI_WIDE_SUPPORT in project)
+   /*
+   ini_t ini_w("file.ini", true);
+   wcout << ini_w[L"Section2"][L"Key1"] << endl;
+   */
+
+///Load from memory
+   std::string str = getStringFromFile("config/test.ini"); //Allows us to tap into a source for the purpose of this example
+
+   ini_t ini_mem((void*)str.c_str(), str.size(), true); //This is the line which parses data from memory
+
+///Merge contents and keep values
+   ini_t inid("file.ini", true);
+   ini_t inis("merge.ini", true);
+   inid.merge(inis, true);
+   inid.save("merged.ini");
+
+   return EXIT_SUCCESS;
+}
+
+void centerString(string str)
+{
+   const char* s = str.c_str();
+   int l = strlen(s);
+   int pos = (int)((80 - l) / 2);
+   for(int i = 0; i < pos; i++)
+   cout << " ";
+   cout << s << endl;
+}
+
+std::string getStringFromFile(const std::string& path) {
+  std::ostringstream buf;
+  std::ifstream input (path.c_str());
+  buf << input.rdbuf();
+  return buf.str();
+}
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/file.ini b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/file.ini
new file mode 100644
index 0000000000000000000000000000000000000000..e1c485ba2a657cf56d497a7aefc6e51daf0f0608
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/file.ini
@@ -0,0 +1,5 @@
+[Section2]
+123=123
+Key1=1.123
+[Section Name]
+Key=Value
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/file_ints.ini b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/file_ints.ini
new file mode 100644
index 0000000000000000000000000000000000000000..3d71e76cae1ae33de74f9c0735021ea51e655b60
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/file_ints.ini
@@ -0,0 +1,400 @@
+[200]
+Key=100
+[199]
+Key=99.5
+[198]
+Key=99
+[197]
+Key=98.5
+[196]
+Key=98
+[195]
+Key=97.5
+[194]
+Key=97
+[193]
+Key=96.5
+[192]
+Key=96
+[191]
+Key=95.5
+[190]
+Key=95
+[189]
+Key=94.5
+[188]
+Key=94
+[187]
+Key=93.5
+[186]
+Key=93
+[185]
+Key=92.5
+[184]
+Key=92
+[183]
+Key=91.5
+[182]
+Key=91
+[181]
+Key=90.5
+[180]
+Key=90
+[179]
+Key=89.5
+[178]
+Key=89
+[177]
+Key=88.5
+[176]
+Key=88
+[175]
+Key=87.5
+[174]
+Key=87
+[173]
+Key=86.5
+[172]
+Key=86
+[171]
+Key=85.5
+[170]
+Key=85
+[169]
+Key=84.5
+[168]
+Key=84
+[167]
+Key=83.5
+[166]
+Key=83
+[165]
+Key=82.5
+[164]
+Key=82
+[163]
+Key=81.5
+[162]
+Key=81
+[161]
+Key=80.5
+[160]
+Key=80
+[159]
+Key=79.5
+[158]
+Key=79
+[157]
+Key=78.5
+[156]
+Key=78
+[155]
+Key=77.5
+[154]
+Key=77
+[153]
+Key=76.5
+[152]
+Key=76
+[151]
+Key=75.5
+[150]
+Key=75
+[149]
+Key=74.5
+[148]
+Key=74
+[147]
+Key=73.5
+[146]
+Key=73
+[145]
+Key=72.5
+[144]
+Key=72
+[143]
+Key=71.5
+[142]
+Key=71
+[141]
+Key=70.5
+[140]
+Key=70
+[139]
+Key=69.5
+[138]
+Key=69
+[137]
+Key=68.5
+[136]
+Key=68
+[135]
+Key=67.5
+[134]
+Key=67
+[133]
+Key=66.5
+[132]
+Key=66
+[131]
+Key=65.5
+[130]
+Key=65
+[129]
+Key=64.5
+[128]
+Key=64
+[127]
+Key=63.5
+[126]
+Key=63
+[125]
+Key=62.5
+[124]
+Key=62
+[123]
+Key=61.5
+[122]
+Key=61
+[121]
+Key=60.5
+[120]
+Key=60
+[119]
+Key=59.5
+[118]
+Key=59
+[117]
+Key=58.5
+[116]
+Key=58
+[115]
+Key=57.5
+[114]
+Key=57
+[113]
+Key=56.5
+[112]
+Key=56
+[111]
+Key=55.5
+[110]
+Key=55
+[109]
+Key=54.5
+[108]
+Key=54
+[107]
+Key=53.5
+[106]
+Key=53
+[105]
+Key=52.5
+[104]
+Key=52
+[103]
+Key=51.5
+[1]
+Key=0.5
+[2]
+Key=1
+[3]
+Key=1.5
+[4]
+Key=2
+[5]
+Key=2.5
+[6]
+Key=3
+[7]
+Key=3.5
+[8]
+Key=4
+[9]
+Key=4.5
+[10]
+Key=5
+[11]
+Key=5.5
+[12]
+Key=6
+[13]
+Key=6.5
+[14]
+Key=7
+[15]
+Key=7.5
+[16]
+Key=8
+[17]
+Key=8.5
+[18]
+Key=9
+[19]
+Key=9.5
+[20]
+Key=10
+[21]
+Key=10.5
+[22]
+Key=11
+[23]
+Key=11.5
+[24]
+Key=12
+[25]
+Key=12.5
+[26]
+Key=13
+[27]
+Key=13.5
+[28]
+Key=14
+[29]
+Key=14.5
+[30]
+Key=15
+[31]
+Key=15.5
+[32]
+Key=16
+[33]
+Key=16.5
+[34]
+Key=17
+[35]
+Key=17.5
+[36]
+Key=18
+[37]
+Key=18.5
+[38]
+Key=19
+[39]
+Key=19.5
+[40]
+Key=20
+[41]
+Key=20.5
+[42]
+Key=21
+[43]
+Key=21.5
+[44]
+Key=22
+[45]
+Key=22.5
+[46]
+Key=23
+[47]
+Key=23.5
+[48]
+Key=24
+[49]
+Key=24.5
+[50]
+Key=25
+[51]
+Key=25.5
+[52]
+Key=26
+[53]
+Key=26.5
+[54]
+Key=27
+[55]
+Key=27.5
+[56]
+Key=28
+[57]
+Key=28.5
+[58]
+Key=29
+[59]
+Key=29.5
+[60]
+Key=30
+[61]
+Key=30.5
+[62]
+Key=31
+[63]
+Key=31.5
+[64]
+Key=32
+[65]
+Key=32.5
+[66]
+Key=33
+[67]
+Key=33.5
+[68]
+Key=34
+[69]
+Key=34.5
+[70]
+Key=35
+[71]
+Key=35.5
+[72]
+Key=36
+[73]
+Key=36.5
+[74]
+Key=37
+[75]
+Key=37.5
+[76]
+Key=38
+[77]
+Key=38.5
+[78]
+Key=39
+[79]
+Key=39.5
+[80]
+Key=40
+[81]
+Key=40.5
+[82]
+Key=41
+[83]
+Key=41.5
+[84]
+Key=42
+[85]
+Key=42.5
+[86]
+Key=43
+[87]
+Key=43.5
+[88]
+Key=44
+[89]
+Key=44.5
+[90]
+Key=45
+[91]
+Key=45.5
+[92]
+Key=46
+[93]
+Key=46.5
+[94]
+Key=47
+[95]
+Key=47.5
+[96]
+Key=48
+[97]
+Key=48.5
+[98]
+Key=49
+[99]
+Key=49.5
+[100]
+Key=50
+[101]
+Key=50.5
+[102]
+Key=51
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/merge.ini b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/merge.ini
new file mode 100644
index 0000000000000000000000000000000000000000..dfdc38108414680c510f65309feed47bf3e6c4d5
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/merge.ini
@@ -0,0 +1,5 @@
+[NewSection]
+Key=Value
+[Section2]
+NewKey=Value
+123=456
\ No newline at end of file
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/project.cbp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/project.cbp
new file mode 100644
index 0000000000000000000000000000000000000000..913928a1159426daa67f8f0b6cfaa71596d6ca1f
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/project.cbp
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+	<FileVersion major="1" minor="6" />
+	<Project>
+		<Option title="project" />
+		<Option pch_mode="2" />
+		<Option compiler="gcc" />
+		<Build>
+			<Target title="gcc_mingw">
+				<Option output="bin/gcc_mingw/example" prefix_auto="1" extension_auto="1" />
+				<Option object_output="obj/gcc_mingw/" />
+				<Option type="1" />
+				<Option compiler="gcc" />
+				<Compiler>
+					<Add option="-O2" />
+					<Add option="-Wall" />
+					<Add option="-std=c++0x" />
+				</Compiler>
+			</Target>
+			<Target title="vs_2013">
+				<Option output="bin/vs/example" prefix_auto="1" extension_auto="1" />
+				<Option object_output="obj/vs_2013/" />
+				<Option type="1" />
+				<Option compiler="microsoft_visual_c_2013" />
+				<Compiler>
+					<Add option="/EHa" />
+					<Add option="/W2" />
+					<Add directory="C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/include" />
+				</Compiler>
+				<Linker>
+					<Add directory="C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/lib" />
+					<Add directory="C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib" />
+				</Linker>
+			</Target>
+			<Target title="vs_2010">
+				<Option output="bin/vs/example" prefix_auto="1" extension_auto="1" />
+				<Option object_output="obj/vs_2010/" />
+				<Option type="1" />
+				<Option compiler="msvc10" />
+				<Compiler>
+					<Add option="/EHa" />
+					<Add option="/W2" />
+				</Compiler>
+				<Linker>
+					<Add directory="C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib" />
+				</Linker>
+			</Target>
+		</Build>
+		<Unit filename="../INI.h" />
+		<Unit filename="example.cpp" />
+		<Extensions>
+			<code_completion />
+			<envvars />
+			<debugger />
+		</Extensions>
+	</Project>
+</CodeBlocks_project_file>
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/project.depend b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/project.depend
new file mode 100644
index 0000000000000000000000000000000000000000..02c743092d1328388f1f3db9b6b14c7dc2ac01bb
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/cpp-feather-ini-parser/example/project.depend
@@ -0,0 +1,802 @@
+# depslib dependency file v1.0
+1399614205 source:d:\projects\feather-ini-parser\example\example.cpp
+	<iostream>
+	<cstring>
+	<stdint.h>
+	"../INI.h"
+
+1399625159 d:\projects\feather-ini-parser\ini.h
+	<string>
+	<fstream>
+	<sstream>
+	<stdint.h>
+	<stdio.h>
+	<stdlib.h>
+	<unordered_map>
+	<map>
+	<wchar.h>
+	<cstring>
+
+1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\iostream
+	<istream>
+
+1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\istream
+	<ostream>
+
+1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\ostream
+	<ios>
+
+1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\ios
+	<xlocnum>
+
+1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xlocnum
+	<climits>
+	<cmath>
+	<cstdio>
+	<cstdlib>
+	<streambuf>
+
+1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\climits
+	<yvals.h>
+	<limits.h>
+
+1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\yvals.h
+	<xkeycheck.h>
+	<crtdefs.h>
+	<use_ansi.h>
+	<crtwrn.h>
+
+1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xkeycheck.h
+
+1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\crtdefs.h
+	<sal.h>
+	<vadefs.h>
+	<winapifamily.h>
+
+1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\sal.h
+	"codeanalysis\sourceannotations.h"
+	<ConcurrencySal.h>
+
+1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\codeanalysis\sourceannotations.h
+
+1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\concurrencysal.h
+
+1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\vadefs.h
+	<cruntime.h>
+
+1379495880 c:\program files (x86)\microsoft visual studio 12.0\vc\include\use_ansi.h
+
+1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\crtwrn.h
+	<crtdefs.h>
+
+1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\limits.h
+	<crtdefs.h>
+
+1375351090 c:\program files (x86)\microsoft visual studio 12.0\vc\include\cmath
+	<yvals.h>
+	<math.h>
+	<xtgmath.h>
+	<math.h>
+	<xtgmath.h>
+
+1379495880 c:\program files (x86)\microsoft visual studio 12.0\vc\include\math.h
+	<crtdefs.h>
+
+1379495880 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xtgmath.h
+	<xtr1common>
+
+1374412938 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xtr1common
+	<yvals.h>
+
+1375351090 c:\program files (x86)\microsoft visual studio 12.0\vc\include\cstdio
+	<yvals.h>
+	<stdio.h>
+	<stdio.h>
+
+1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\stdio.h
+	<crtdefs.h>
+	<swprintf.inl>
+
+1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\swprintf.inl
+	<vadefs.h>
+
+1375351090 c:\program files (x86)\microsoft visual studio 12.0\vc\include\cstdlib
+	<yvals.h>
+	<stdlib.h>
+	<stdlib.h>
+
+1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\stdlib.h
+	<crtdefs.h>
+	<limits.h>
+
+1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\streambuf
+	<xiosbase>
+
+1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xiosbase
+	<xlocale>
+	<system_error>
+	<share.h>
+
+1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xlocale
+	<climits>
+	<cstring>
+	<stdexcept>
+	<typeinfo>
+	<xlocinfo>
+	<xdebug>
+	<xfacet>
+
+1375351090 c:\program files (x86)\microsoft visual studio 12.0\vc\include\cstring
+	<yvals.h>
+	<string.h>
+	<string.h>
+
+1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\string.h
+	<crtdefs.h>
+
+1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\stdexcept
+	<exception>
+	<xstring>
+
+1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\exception
+	<xstddef>
+	<eh.h>
+	<malloc.h>
+	<string.h>
+
+1374412938 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xstddef
+	<stdlib.h>
+	<cstddef>
+	<initializer_list>
+	<xtr1common>
+
+1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\cstddef
+	<yvals.h>
+	<stddef.h>
+	<stddef.h>
+
+1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\stddef.h
+	<crtdefs.h>
+
+1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\initializer_list
+	<cstddef>
+
+1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\eh.h
+	<crtdefs.h>
+
+1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\malloc.h
+	<crtdefs.h>
+
+1374412938 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xstring
+	<xmemory0>
+
+1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory0
+	<cstdlib>
+	<limits>
+	<new>
+	<xutility>
+	<xatomic0.h>
+	<intrin.h>
+	<xatomic.h>
+
+1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\limits
+	<ymath.h>
+	<cfloat>
+	<climits>
+	<cmath>
+	<cwchar>
+	<xstddef>
+
+1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\ymath.h
+	<yvals.h>
+
+1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\cfloat
+	<yvals.h>
+	<float.h>
+
+1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\float.h
+	<crtdefs.h>
+	<crtwrn.h>
+
+1375351090 c:\program files (x86)\microsoft visual studio 12.0\vc\include\cwchar
+	<yvals.h>
+	<wchar.h>
+	<wchar.h>
+
+1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\wchar.h
+	<crtdefs.h>
+	<swprintf.inl>
+	<wtime.inl>
+
+1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\wtime.inl
+
+1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\new
+	<exception>
+
+1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xutility
+	<climits>
+	<cstdlib>
+	<utility>
+
+1374412938 c:\program files (x86)\microsoft visual studio 12.0\vc\include\utility
+	<xstddef>
+	<iosfwd>
+	<type_traits>
+
+1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\iosfwd
+	<cstdio>
+	<cstring>
+	<cwchar>
+	<xstddef>
+	<crtdbg.h>
+
+1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\crtdbg.h
+	<crtdefs.h>
+
+1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\type_traits
+	<xstddef>
+	<xrefwrap>
+
+1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xrefwrap
+
+1374412938 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xatomic0.h
+	<yvals.h>
+
+1379495880 c:\program files (x86)\microsoft visual studio 12.0\vc\include\intrin.h
+	<crtdefs.h>
+	<setjmp.h>
+	<stddef.h>
+	<immintrin.h>
+	<ammintrin.h>
+	<mm3dnow.h>
+	<armintr.h>
+
+1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\setjmp.h
+	<crtdefs.h>
+	<setjmpex.h>
+
+1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\setjmpex.h
+	<setjmp.h>
+
+1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\immintrin.h
+	<wmmintrin.h>
+
+1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\wmmintrin.h
+	<nmmintrin.h>
+
+1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\nmmintrin.h
+	<smmintrin.h>
+
+1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\smmintrin.h
+	<tmmintrin.h>
+
+1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\tmmintrin.h
+	<pmmintrin.h>
+
+1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\pmmintrin.h
+	<emmintrin.h>
+
+1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\emmintrin.h
+	<xmmintrin.h>
+
+1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmmintrin.h
+	<mmintrin.h>
+	"xmm_func.h"
+	<malloc.h>
+
+1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\mmintrin.h
+	<crtdefs.h>
+
+1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\ammintrin.h
+
+1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\mm3dnow.h
+	<crtdefs.h>
+	<mmintrin.h>
+	<xmmintrin.h>
+
+1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\armintr.h
+
+1374412938 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xatomic.h
+	<xatomic0.h>
+	<stddef.h>
+	<stdlib.h>
+	<string.h>
+	<intrin.h>
+	<xutility>
+
+1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\typeinfo
+	<xstddef>
+	<string.h>
+	<exception>
+
+1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xlocinfo
+	<xlocinfo.h>
+	<cstdlib>
+	<xstddef>
+
+1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xlocinfo.h
+	<ctype.h>
+	<locale.h>
+	<wchar.h>
+	<yvals.h>
+
+1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\ctype.h
+	<crtdefs.h>
+
+1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\locale.h
+	<crtdefs.h>
+
+1374412938 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xdebug
+	<yvals.h>
+	<crtdbg.h>
+	<xmemory>
+
+1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xmemory
+	<xmemory0>
+
+1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xfacet
+	<yvals.h>
+
+1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\system_error
+	<cerrno>
+	<cstdlib>
+	<stdexcept>
+
+1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\cerrno
+	<yvals.h>
+	<errno.h>
+	<errno.h>
+
+1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\errno.h
+	<crtdefs.h>
+
+1374412934 c:\program files (x86)\microsoft visual studio 12.0\vc\include\share.h
+
+1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\stdint.h
+	<crtdefs.h>
+
+1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\string
+	<iterator>
+
+1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\iterator
+	<istream>
+	<xutility>
+
+1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\fstream
+	<istream>
+
+1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\sstream
+	<string>
+
+1374412938 c:\program files (x86)\microsoft visual studio 12.0\vc\include\unordered_map
+	<xhash>
+	<tuple>
+
+1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xhash
+	<cstring>
+	<cwchar>
+	<list>
+	<vector>
+
+1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\list
+	<xmemory>
+	<stdexcept>
+
+1374410776 c:\program files (x86)\microsoft visual studio 12.0\vc\include\vector
+	<xmemory>
+	<stdexcept>
+
+1374412938 c:\program files (x86)\microsoft visual studio 12.0\vc\include\tuple
+	<type_traits>
+	<xutility>
+	<new>
+
+1374412936 c:\program files (x86)\microsoft visual studio 12.0\vc\include\map
+	<xtree>
+	<tuple>
+
+1374726946 c:\program files (x86)\microsoft visual studio 12.0\vc\include\xtree
+	<xmemory>
+	<stdexcept>
+
+1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\iostream
+	<istream>
+
+1257671184 c:\program files (x86)\microsoft visual studio 10.0\vc\include\istream
+	<ostream>
+
+1257671184 c:\program files (x86)\microsoft visual studio 10.0\vc\include\ostream
+	<ios>
+
+1257671184 c:\program files (x86)\microsoft visual studio 10.0\vc\include\ios
+	<xlocnum>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xlocnum
+	<climits>
+	<cmath>
+	<cstdio>
+	<cstdlib>
+	<streambuf>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\climits
+	<yvals.h>
+	<limits.h>
+
+1258271576 c:\program files (x86)\microsoft visual studio 10.0\vc\include\yvals.h
+	<crtdefs.h>
+	<xkeycheck.h>
+	<crtwrn.h>
+	<use_ansi.h>
+	<crtwrn.h>
+	<crtwrn.h>
+
+1260264954 c:\program files (x86)\microsoft visual studio 10.0\vc\include\crtdefs.h
+	<sal.h>
+	<vadefs.h>
+
+1263987576 c:\program files (x86)\microsoft visual studio 10.0\vc\include\sal.h
+	"codeanalysis\sourceannotations.h"
+
+1263303828 c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\vadefs.h
+
+1251647994 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xkeycheck.h
+
+1257671184 c:\program files (x86)\microsoft visual studio 10.0\vc\include\crtwrn.h
+	<crtdefs.h>
+
+1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\use_ansi.h
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\limits.h
+	<crtdefs.h>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\cmath
+	<yvals.h>
+	<math.h>
+	<math.h>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h
+	<crtdefs.h>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\cstdio
+	<yvals.h>
+	<stdio.h>
+	<stdio.h>
+
+1257335008 c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h
+	<crtdefs.h>
+	<swprintf.inl>
+
+1256197836 c:\program files (x86)\microsoft visual studio 10.0\vc\include\swprintf.inl
+	<vadefs.h>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\cstdlib
+	<yvals.h>
+	<stdlib.h>
+	<stdlib.h>
+
+1257671184 c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdlib.h
+	<crtdefs.h>
+	<limits.h>
+
+1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\streambuf
+	<xiosbase>
+
+1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xiosbase
+	<xlocale>
+	<system_error>
+	<share.h>
+
+1263118342 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xlocale
+	<climits>
+	<cstring>
+	<stdexcept>
+	<typeinfo>
+	<xlocinfo>
+	<xdebug>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\cstring
+	<yvals.h>
+	<string.h>
+	<string.h>
+
+1260264954 c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h
+	<crtdefs.h>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdexcept
+	<exception>
+	<xstring>
+
+1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\exception
+	<xstddef>
+	<eh.h>
+	<malloc.h>
+	<string.h>
+
+1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xstddef
+	<yvals.h>
+	<cstddef>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\cstddef
+	<yvals.h>
+	<stddef.h>
+	<stddef.h>
+
+1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\stddef.h
+	<crtdefs.h>
+
+1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\eh.h
+	<crtdefs.h>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\malloc.h
+	<crtdefs.h>
+
+1257671184 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xstring
+	<xmemory>
+
+1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xmemory
+	<cstdlib>
+	<new>
+	<xutility>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\new
+	<exception>
+
+1258271576 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility
+	<climits>
+	<cstdlib>
+	<utility>
+
+1257671184 c:\program files (x86)\microsoft visual studio 10.0\vc\include\utility
+	<xstddef>
+	<iosfwd>
+	<type_traits>
+
+1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\iosfwd
+	<cstdio>
+	<cstring>
+	<cwchar>
+	<xstddef>
+	<crtdbg.h>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\cwchar
+	<yvals.h>
+	<wchar.h>
+	<wchar.h>
+
+1257335008 c:\program files (x86)\microsoft visual studio 10.0\vc\include\wchar.h
+	<crtdefs.h>
+	<swprintf.inl>
+	<wtime.inl>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\wtime.inl
+
+1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\crtdbg.h
+	<crtdefs.h>
+
+1263118342 c:\program files (x86)\microsoft visual studio 10.0\vc\include\type_traits
+	<limits>
+	<xtr1common>
+	<xfwrap>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\limits
+	<ymath.h>
+	<cfloat>
+	<climits>
+	<cmath>
+	<cwchar>
+	<xstddef>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\ymath.h
+	<yvals.h>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\cfloat
+	<yvals.h>
+	<float.h>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\float.h
+	<crtdefs.h>
+	<crtwrn.h>
+
+1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xtr1common
+	<yvals.h>
+
+1263118342 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfwrap
+	<xfwrap1>
+	<xfwrap1>
+	<xfwrap1>
+	<xfwrap1>
+	<xfwrap1>
+	<xfwrap1>
+	<xfwrap1>
+	<xfwrap1>
+	<xfwrap1>
+	<xfwrap1>
+	<xfwrap1>
+
+1263118342 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfwrap1
+	<xxbind1>
+	<xxcallfun>
+	<xxcallobj>
+	<xxcallpmf>
+	<xxfunction>
+	<xxmem_fn>
+	<xxpmfcaller>
+	<xxrefwrap>
+	<xxresult>
+	<xxshared>
+	<xxtuple0>
+	<xxtuple1>
+	<xxtype_traits>
+
+1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxbind1
+
+1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxcallfun
+
+1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxcallobj
+
+1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxcallpmf
+
+1257671184 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxfunction
+
+1251647994 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxmem_fn
+
+1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxpmfcaller
+
+1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxrefwrap
+
+1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxresult
+
+1251647994 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxshared
+
+1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxtuple0
+
+1251647994 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxtuple1
+
+1251647994 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xxtype_traits
+
+1257671184 c:\program files (x86)\microsoft visual studio 10.0\vc\include\typeinfo
+	<xstddef>
+	<string.h>
+	<exception>
+
+1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xlocinfo
+	<xlocinfo.h>
+	<cstdlib>
+	<xstddef>
+
+1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xlocinfo.h
+	<ctype.h>
+	<locale.h>
+	<wchar.h>
+	<yvals.h>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\ctype.h
+	<crtdefs.h>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\locale.h
+	<crtdefs.h>
+
+1263118342 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xdebug
+	<yvals.h>
+	<crtdbg.h>
+	<xmemory>
+
+1260264954 c:\program files (x86)\microsoft visual studio 10.0\vc\include\system_error
+	<cerrno>
+	<cstdlib>
+	<stdexcept>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\cerrno
+	<yvals.h>
+	<errno.h>
+	<errno.h>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\errno.h
+	<crtdefs.h>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\share.h
+
+1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h
+	<yvals.h>
+
+1257671184 c:\program files (x86)\microsoft visual studio 10.0\vc\include\string
+	<istream>
+
+1263118342 c:\program files (x86)\microsoft visual studio 10.0\vc\include\fstream
+	<istream>
+
+1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\sstream
+	<string>
+
+1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\unordered_map
+	<xhash>
+
+1263720180 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xhash
+	<cstring>
+	<cwchar>
+	<xfunctional>
+	<list>
+	<vector>
+
+1251647994 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional
+	<cstdlib>
+	<xstring>
+
+1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\list
+	<xfunctional>
+	<memory>
+	<stdexcept>
+
+1267607544 c:\program files (x86)\microsoft visual studio 10.0\vc\include\memory
+	<xmemory>
+	<exception>
+	<typeinfo>
+	<type_traits>
+	<intrin.h>
+	<xfwrap>
+	<xfwrap>
+	<xfwrap>
+
+1263118342 c:\program files (x86)\microsoft visual studio 10.0\vc\include\intrin.h
+	<crtdefs.h>
+	<setjmp.h>
+	<stddef.h>
+	<immintrin.h>
+	<mm3dnow.h>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\setjmp.h
+	<crtdefs.h>
+	<setjmpex.h>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\setjmpex.h
+	<setjmp.h>
+
+1251647992 c:\program files (x86)\microsoft visual studio 10.0\vc\include\immintrin.h
+	<wmmintrin.h>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\wmmintrin.h
+	<nmmintrin.h>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\nmmintrin.h
+	<smmintrin.h>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\smmintrin.h
+	<tmmintrin.h>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\tmmintrin.h
+	<pmmintrin.h>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\pmmintrin.h
+	<emmintrin.h>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\emmintrin.h
+	<xmmintrin.h>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xmmintrin.h
+	<mmintrin.h>
+	"xmm_func.h"
+	<malloc.h>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\mmintrin.h
+	<crtdefs.h>
+
+1251642866 c:\program files (x86)\microsoft visual studio 10.0\vc\include\mm3dnow.h
+	<crtdefs.h>
+	<mmintrin.h>
+	<xmmintrin.h>
+
+1258271576 c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector
+	<memory>
+	<stdexcept>
+	<xfunctional>
+
+1254299028 c:\program files (x86)\microsoft visual studio 10.0\vc\include\map
+	<xtree>
+
+1258271576 c:\program files (x86)\microsoft visual studio 10.0\vc\include\xtree
+	<xfunctional>
+	<memory>
+	<stdexcept>
+
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/lms7002_defines.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/lms7002_defines.h
new file mode 100644
index 0000000000000000000000000000000000000000..6b06a51c7eda7c8add40ccfe19f60adde64b4053
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/lms7002_defines.h
@@ -0,0 +1,218 @@
+/**
+@file	lms7002_defines.h
+@author Lime Microsystems
+@brief	enumerations of available LMS7002M commands and statuses
+*/
+#pragma once
+
+const int LMS_RST_DEACTIVATE = 0;
+const int LMS_RST_ACTIVATE = 1;
+const int LMS_RST_PULSE = 2;
+
+enum eLMS_DEV
+{
+	LMS_DEV_UNKNOWN,
+	LMS_DEV_EVB6,
+	LMS_DEV_DIGIGREEN,
+	LMS_DEV_DIGIRED,
+	LMS_DEV_EVB7,
+	LMS_DEV_ZIPPER,
+	LMS_DEV_SOCKETBOARD,
+	LMS_DEV_EVB7V2,
+	LMS_DEV_STREAM,
+	LMS_DEV_NOVENA,
+	LMS_DEV_DATASPARK,
+	LMS_DEV_RFSPARK,
+	LMS_DEV_LMS6002USB,
+	LMS_DEV_RFESPARK,
+	LMS_DEV_SODERA,
+	
+	LMS_DEV_COUNT
+};
+
+const char LMS_DEV_NAMES[][80] = 
+{
+	"UNKNOWN",
+	"EVB6",
+	"DigiGreen",
+	"DigiRed",
+	"EVB7",
+	"ZIPPER",
+	"Socket Board",
+	"EVB7_v2",
+	"Stream",
+	"Novena",
+	"DataSpark",
+	"RF-Spark",
+	"LMS6002-USB Stick",
+	"RF-ESpark",
+	"SoDeRa",
+};
+
+static const char* GetDeviceName(const eLMS_DEV device)
+{
+    if (LMS_DEV_UNKNOWN < device && device < LMS_DEV_COUNT)
+        return LMS_DEV_NAMES[device];
+    else
+        return LMS_DEV_NAMES[LMS_DEV_UNKNOWN];
+}
+
+enum eEXP_BOARD 
+{
+	EXP_BOARD_UNKNOWN,
+	EXP_BOARD_UNSUPPORTED,
+	EXP_BOARD_NO,
+	EXP_BOARD_MYRIAD1,
+	EXP_BOARD_MYRIAD2,
+	EXP_BOARD_MYRIAD_NOVENA,
+	EXP_BOARD_HPM1000,
+	EXP_BOARD_MYRIAD7,
+	EXP_BOARD_HPM7,
+	
+	EXP_BOARD_COUNT
+};
+
+const char EXP_BOARD_NAMES[][80] = 
+{
+	"UNKNOWN", 
+	"UNSUPPORTED", 
+	"NOT AVAILABLE",
+	"Myriad1",
+	"Myriad2",
+	"Novena",
+	"HPM1000",
+	"Myriad7",
+	"HMP7"
+};
+
+static const char* GetExpansionBoardName(const eEXP_BOARD board)
+{
+    if (EXP_BOARD_UNKNOWN < board && board < EXP_BOARD_COUNT)
+        return EXP_BOARD_NAMES[board];
+    else
+        return EXP_BOARD_NAMES[EXP_BOARD_UNKNOWN];
+}
+			
+struct LMS64C_Info
+{
+	unsigned char firmware;
+    unsigned char deviceType;
+    unsigned char protocol;
+    unsigned char hardware;
+    unsigned char expansionBoard;
+};
+
+enum eCMD_LMS
+{
+    CMD_GET_INFO = 0x00,
+    CMD_LMS6002_RST = 0x10,
+    ///Writes data to SI5356 synthesizer via I2C
+    CMD_SI5356_WR = 0x11,
+    ///Reads data from SI5356 synthesizer via I2C
+    CMD_SI5356_RD = 0x12,
+    ///Writes data to SI5351 synthesizer via I2C
+    CMD_SI5351_WR = 0x13,
+    ///Reads data from SI5351 synthesizer via I2C
+    CMD_SI5351_RD = 0x14,
+    ///PanelBus DVI (HDMI) Transmitter control
+    CMD_TFP410_WR = 0x15,
+    ///PanelBus DVI (HDMI) Transmitter control
+    CMD_TFP410_RD = 0x16,
+    ///Sets new LMS7002M chip’s RESET pin level (0, 1, pulse)
+    CMD_LMS7002_RST = 0x20,
+    ///Writes data to LMS7002M chip via SPI
+    CMD_LMS7002_WR = 0x21,
+    ///Reads data from LMS7002M chip via SPI
+    CMD_LMS7002_RD = 0x22,
+    ///Writes data to LMS6002 chip via SPI
+    CMD_LMS6002_WR = 0x23,
+    ///Reads data from LMS6002 chip via SPI
+    CMD_LMS6002_RD = 0x24,
+
+    CMD_LMS_LNA = 0x2A,
+    CMD_LMS_PA = 0x2B,
+
+    CMD_PROG_MCU = 0x2C,
+    ///Writes data to ADF4002 chip via SPI
+    CMD_ADF4002_WR = 0x31,
+
+    CMD_USB_FIFO_RST = 0x40,
+    CMD_PE636040_WR = 0x41,
+	CMD_PE636040_RD = 0x42,
+
+	CMD_GPIO_WR = 0x51,
+	CMD_GPIO_RD = 0x52,
+
+	CMD_ALTERA_FPGA_GW_WR = 0x53,
+	CMD_ALTERA_FPGA_GW_RD = 0x54,
+
+	CMD_BRDSPI_WR = 0x55,//16 bit spi for stream, dataspark control
+    CMD_BRDSPI_RD = 0x56,//16 bit spi for stream, dataspark control
+	CMD_BRDSPI8_WR = 0x57, //8 + 8 bit spi for stream, dataspark control
+	CMD_BRDSPI8_RD = 0x58, //8 + 8 bit spi for stream, dataspark control
+	
+	CMD_BRDCONF_WR = 0x5D, //write config data to board
+	CMD_BRDCONF_RD = 0x5E, //read config data from board
+	
+	CMD_ANALOG_VAL_WR = 0x61, //write analog value
+	CMD_ANALOG_VAL_RD = 0x62, //read analog value
+
+	CMD_MYRIAD_RST = 0x80,
+	CMD_MYRIAD_WR = 0x81,
+	CMD_MYRIAD_RD = 0x82,
+	CMD_MYRIAD_PROG = 0x8C
+};
+
+enum eCMD_STATUS
+{
+    STATUS_UNDEFINED,
+    STATUS_COMPLETED_CMD,
+    STATUS_UNKNOWN_CMD,
+    STATUS_BUSY_CMD,
+    STATUS_MANY_BLOCKS_CMD,
+    STATUS_ERROR_CMD,
+    STATUS_WRONG_ORDER_CMD,
+	STATUS_RESOURCE_DENIED_CMD,
+    STATUS_COUNT
+};
+
+static const char  status_text[][32]=
+{
+    "Undefined/Failure",
+    "Completed",
+    "Unknown command",
+    "Busy",
+    "Too many blocks",
+    "Error",
+    "Wrong order",
+    "Resource denied"
+};
+
+static const char* status2string(const int status)
+{
+    if(status >= 0 && status < STATUS_COUNT)
+        return status_text[status];
+    else
+        return "Unknown status";
+}
+
+enum eADC_UNITS
+{
+	RAW,
+	VOLTAGE,
+	CURRENT,
+	RESISTANCE,
+	POWER,
+	TEMPERATURE,
+	ADC_UNITS_COUNT
+};
+
+static const char  adc_units_text[][8] = {"", "V", "A", "Ohm", "W", "C"};
+
+static const char* adcUnits2string(const unsigned units)
+{
+	if (units < ADC_UNITS_COUNT)
+		return adc_units_text[units];
+	else
+		return " unknown";
+}
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/lmsComms.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/lmsComms.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..5b74ef8975782a56f4c386714a48431e78ff2a1a
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/lmsComms.cpp
@@ -0,0 +1,326 @@
+/**
+@file   LMScomms.cpp
+@author Lime Microsystems (www.limemicro.com)
+@brief  Implementation of data transmission to LMS boards
+*/
+
+#include "lmsComms.h"
+
+LMScomms::LMScomms()
+{
+    callback_logData = nullptr;
+    unsigned short test = 0x1234;
+    unsigned char* bytes = (unsigned char*)&test;
+    if(bytes[0] == 0x12 && bytes[1] == 0x34)
+        mSystemBigEndian = true;
+    else
+        mSystemBigEndian = false;
+}
+
+LMScomms::~LMScomms()
+{
+}
+
+/** @brief Transfers data between packet and connected device
+    @param pkt packet containing output data and to receive incomming data
+    @return 0: success, other: failure
+*/
+LMScomms::TransferStatus LMScomms::TransferPacket(GenericPacket& pkt)
+{
+    std::lock_guard<std::mutex> lock(mControlPortLock);
+	TransferStatus status = TRANSFER_SUCCESS;
+    if(IsOpen() == false)
+        return NOT_CONNECTED;
+
+    int packetLen;
+    eLMS_PROTOCOL protocol = LMS_PROTOCOL_UNDEFINED;
+    if(activeControlPort->GetType() == IConnection::SPI_PORT)
+        protocol = LMS_PROTOCOL_NOVENA;
+    else
+        protocol = LMS_PROTOCOL_LMS64C;
+    switch(protocol)
+    {
+    case LMS_PROTOCOL_UNDEFINED:
+        return TRANSFER_FAILED;
+    case LMS_PROTOCOL_LMS64C:
+        packetLen = ProtocolLMS64C::pktLength;
+        break;
+    case LMS_PROTOCOL_NOVENA:
+        packetLen = pkt.outBuffer.size() > ProtocolNovena::pktLength ? ProtocolNovena::pktLength : pkt.outBuffer.size();
+        break;
+    default:
+        packetLen = 0;
+        return TRANSFER_FAILED;
+    }
+    int outLen = 0;
+    unsigned char* outBuffer = NULL;
+    outBuffer = PreparePacket(pkt, outLen, protocol);
+    unsigned char* inBuffer = new unsigned char[outLen];
+    memset(inBuffer, 0, outLen);
+
+    int outBufPos = 0;
+    int inDataPos = 0;
+    if(outLen == 0)
+    {
+        //printf("packet outlen = 0\n");
+        outLen = 1;
+    }
+
+    if(protocol == LMS_PROTOCOL_NOVENA)
+    {
+        bool transferData = true; //some commands are fake, so don't need transferring
+        if(pkt.cmd == CMD_GET_INFO)
+        {
+            //spi does not have GET INFO, fake it to inform what device it is
+            pkt.status = STATUS_COMPLETED_CMD;
+            pkt.inBuffer.clear();
+            pkt.inBuffer.resize(64, 0);
+            pkt.inBuffer[0] = 0; //firmware
+            pkt.inBuffer[1] = LMS_DEV_NOVENA; //device
+            pkt.inBuffer[2] = 0; //protocol
+            pkt.inBuffer[3] = 0; //hardware
+            pkt.inBuffer[4] = EXP_BOARD_UNSUPPORTED; //expansion
+            transferData = false;
+        }
+
+        if(transferData)
+        {
+            if (callback_logData)
+                callback_logData(true, outBuffer, outLen);
+            int bytesWritten = Write(outBuffer, outLen);
+            if( bytesWritten == outLen)
+            {
+                if(pkt.cmd == CMD_LMS7002_RD)
+                {
+                    inDataPos = Read(&inBuffer[inDataPos], outLen);
+                    if(inDataPos != outLen)
+                        status = TRANSFER_FAILED;
+                    else
+                    {
+                        if (callback_logData)
+                            callback_logData(false, inBuffer, inDataPos);
+                    }
+                }
+                ParsePacket(pkt, inBuffer, inDataPos, protocol);
+            }
+            else
+                status = TRANSFER_FAILED;
+        }
+    }
+    else
+    {
+        for(int i=0; i<outLen; i+=packetLen)
+        {
+            int bytesToSend = packetLen;
+            if (callback_logData)
+                callback_logData(true, &outBuffer[outBufPos], bytesToSend);
+            if( Write(&outBuffer[outBufPos], bytesToSend) )
+            {
+                outBufPos += packetLen;
+                long readLen = packetLen;
+                int bread = Read(&inBuffer[inDataPos], readLen);
+                if(bread != readLen && protocol != LMS_PROTOCOL_NOVENA)
+                {
+                    status = TRANSFER_FAILED;
+                    break;
+                }
+                if (callback_logData)
+                    callback_logData(false, &inBuffer[inDataPos], bread);
+                inDataPos += bread;
+            }
+            else
+            {
+                status = TRANSFER_FAILED;
+                break;
+            }
+        }
+        ParsePacket(pkt, inBuffer, inDataPos, protocol);
+    }
+    delete outBuffer;
+    delete inBuffer;
+    return status;
+}
+
+/** @brief Returns connected device information
+*/
+LMSinfo LMScomms::GetInfo()
+{
+    LMSinfo info;
+    info.device = LMS_DEV_UNKNOWN;
+    info.expansion = EXP_BOARD_UNKNOWN;
+    info.firmware = 0;
+    info.hardware = 0;
+    info.protocol = 0;
+    GenericPacket pkt;
+    pkt.cmd = CMD_GET_INFO;
+    LMScomms::TransferStatus status = TransferPacket(pkt);
+    if (status == LMScomms::TRANSFER_SUCCESS && pkt.inBuffer.size() >= 5)
+    {
+        info.firmware = pkt.inBuffer[0];
+        info.device = pkt.inBuffer[1] < LMS_DEV_COUNT ? (eLMS_DEV)pkt.inBuffer[1] : LMS_DEV_UNKNOWN;
+        info.protocol = pkt.inBuffer[2];
+        info.hardware = pkt.inBuffer[3];
+        info.expansion = pkt.inBuffer[4] < EXP_BOARD_COUNT ? (eEXP_BOARD)pkt.inBuffer[4] : EXP_BOARD_UNKNOWN;
+    }
+    return info;
+}
+
+/** @brief Takes generic packet and converts to specific protocol buffer
+    @param pkt generic data packet to convert
+    @param length returns length of returned buffer
+    @param protocol which protocol to use for data
+    @return pointer to data buffer, must be manually deleted after use
+*/
+unsigned char* LMScomms::PreparePacket(const GenericPacket& pkt, int& length, const eLMS_PROTOCOL protocol)
+{
+    unsigned char* buffer = NULL;
+    if(protocol == LMS_PROTOCOL_UNDEFINED)
+        return NULL;
+
+    if(protocol == LMS_PROTOCOL_LMS64C)
+    {
+        ProtocolLMS64C packet;
+        int maxDataLength = packet.maxDataLength;
+        packet.cmd = pkt.cmd;
+        packet.status = pkt.status;
+        int byteBlockRatio = 1; //block ratio - how many bytes in one block
+        switch( packet.cmd )
+        {
+        case CMD_PROG_MCU:
+        case CMD_GET_INFO:
+        case CMD_SI5351_RD:
+        case CMD_SI5356_RD:
+            byteBlockRatio = 1;
+            break;
+        case CMD_SI5351_WR:
+        case CMD_SI5356_WR:
+            byteBlockRatio = 2;
+            break;
+        case CMD_LMS7002_RD:
+        case CMD_BRDSPI_RD:
+        case CMD_BRDSPI8_RD:
+            byteBlockRatio = 2;
+            break;
+        case CMD_ADF4002_WR:
+            byteBlockRatio = 3;
+            break;
+        case CMD_LMS7002_WR:
+        case CMD_BRDSPI_WR:
+        case CMD_ANALOG_VAL_WR:
+            byteBlockRatio = 4;
+            break;
+        default:
+            byteBlockRatio = 1;
+        }
+        if (packet.cmd == CMD_LMS7002_RD || packet.cmd == CMD_BRDSPI_RD)
+            maxDataLength = maxDataLength/2;
+        if (packet.cmd == CMD_ANALOG_VAL_RD)
+            maxDataLength = maxDataLength / 4;
+        int blockCount = pkt.outBuffer.size()/byteBlockRatio;
+        int bufLen = blockCount/(maxDataLength/byteBlockRatio)
+                    +(blockCount%(maxDataLength/byteBlockRatio)!=0);
+        bufLen *= packet.pktLength;
+        if(bufLen == 0)
+            bufLen = packet.pktLength;
+        buffer = new unsigned char[bufLen];
+        memset(buffer, 0, bufLen);
+        int srcPos = 0;
+        for(int j=0; j*packet.pktLength<bufLen; ++j)
+        {
+            int pktPos = j*packet.pktLength;
+            buffer[pktPos] = packet.cmd;
+            buffer[pktPos+1] = packet.status;
+            if(blockCount > (maxDataLength/byteBlockRatio))
+            {
+                buffer[pktPos+2] = maxDataLength/byteBlockRatio;
+                blockCount -= buffer[pktPos+2];
+            }
+            else
+                buffer[pktPos+2] = blockCount;
+            memcpy(&buffer[pktPos+3], packet.reserved, sizeof(packet.reserved));
+            int bytesToPack = (maxDataLength/byteBlockRatio)*byteBlockRatio;
+            for (int k = 0; k<bytesToPack && srcPos < pkt.outBuffer.size(); ++srcPos, ++k)
+                buffer[pktPos + 8 + k] = pkt.outBuffer[srcPos];
+        }
+        length = bufLen;
+    }
+    else if(protocol == LMS_PROTOCOL_NOVENA)
+    {
+        const uint16_t NOVENA_GPIO_ADDR = 0x0706;
+        if(pkt.cmd == CMD_LMS7002_RST)
+        {
+            buffer = new unsigned char[8];
+            buffer[0] = (NOVENA_GPIO_ADDR >> 8) | 0x80;
+            buffer[1] = NOVENA_GPIO_ADDR & 0xFF;
+            buffer[2] = 0x00;
+            buffer[3] = 0x18;
+            buffer[4] = (NOVENA_GPIO_ADDR >> 8) | 0x80;
+            buffer[5] = NOVENA_GPIO_ADDR & 0xFF;
+            buffer[6] = 0x00;
+            buffer[7] = 0x38;
+            length = 8;
+        }
+        else
+        {
+            buffer = new unsigned char[pkt.outBuffer.size()];
+            memcpy(buffer, &pkt.outBuffer[0], pkt.outBuffer.size());
+            if (pkt.cmd == CMD_LMS7002_WR)
+            {
+                for(int i=0; i<pkt.outBuffer.size(); i+=4)
+                    buffer[i] |= 0x80;
+            }
+            length = pkt.outBuffer.size();
+        }
+    }
+    return buffer;
+}
+
+/** @brief Parses given data buffer into generic packet
+    @param pkt destination packet
+    @param buffer received data from board
+    @param length received buffer length
+    @param protocol which protocol to use for data parsing
+    @return 1:success, 0:failure
+*/
+int LMScomms::ParsePacket(GenericPacket& pkt, const unsigned char* buffer, const int length, const eLMS_PROTOCOL protocol)
+{
+    if(protocol == LMS_PROTOCOL_UNDEFINED)
+        return -1;
+
+    if(protocol == LMS_PROTOCOL_LMS64C)
+    {
+        ProtocolLMS64C packet;
+        int inBufPos = 0;
+        pkt.inBuffer.resize(packet.maxDataLength*(length / packet.pktLength + (length % packet.pktLength)), 0);
+        for(int i=0; i<length; i+=packet.pktLength)
+        {
+            pkt.cmd = (eCMD_LMS)buffer[i];
+            pkt.status = (eCMD_STATUS)buffer[i+1];
+            memcpy(&pkt.inBuffer[inBufPos], &buffer[i+8], packet.maxDataLength);
+            inBufPos += packet.maxDataLength;
+        }
+    }
+    else if(protocol == LMS_PROTOCOL_NOVENA)
+    {
+        pkt.cmd = CMD_LMS7002_RD;
+        pkt.status = STATUS_COMPLETED_CMD;
+        pkt.inBuffer.clear();
+        for(int i=0; i<length; i+=2)
+        {
+            //reading from spi returns only registers values
+            //fill addresses as zeros to match generic format of address, value pairs
+            pkt.inBuffer.push_back(0); //should be address msb
+            pkt.inBuffer.push_back(0); //should be address lsb
+            pkt.inBuffer.push_back(buffer[i]);
+            pkt.inBuffer.push_back(buffer[i+1]);
+        }
+    }
+    return 1;
+}
+
+/** @brief Sets callback function which gets called each time data is sent or received
+*/
+void LMScomms::SetDataLogCallback(std::function<void(bool, const unsigned char*, const unsigned int)> callback)
+{
+    callback_logData = callback;
+}
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/lmsComms.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/lmsComms.h
new file mode 100644
index 0000000000000000000000000000000000000000..3d94d8ece236d3e96dfb1484dd31263c4d440492
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/lmsComms.h
@@ -0,0 +1,111 @@
+/**
+@file   LMScomms.h
+@author Lime Microsystems (www.limemicro.com)
+@brief  Class for handling data transmission to LMS boards
+*/
+
+#ifndef LMS_COMMS_H
+#define LMS_COMMS_H
+
+#include "lms7002_defines.h"
+#include "connectionManager/ConnectionManager.h"
+#include <string.h>
+#include <mutex>
+
+struct LMSinfo
+{
+    eLMS_DEV device;
+    eEXP_BOARD expansion;
+    int firmware;
+    int hardware;
+    int protocol;
+};
+
+/*  @brief Class for abstracting transfering data to and from chip
+*/
+class LMScomms : public ConnectionManager
+{	
+public:
+	enum TransferStatus
+	{
+		TRANSFER_SUCCESS,
+		TRANSFER_FAILED,
+		NOT_CONNECTED
+	};
+
+    enum eLMS_PROTOCOL
+    {
+        LMS_PROTOCOL_UNDEFINED = 0,
+        LMS_PROTOCOL_DIGIC,
+        LMS_PROTOCOL_LMS64C,
+        LMS_PROTOCOL_NOVENA,
+    };
+    struct ProtocolDIGIC
+    {
+        static const int pktLength = 64;
+        static const int maxDataLength = 60;
+        ProtocolDIGIC() : cmd(0), i2cAddr(0), blockCount(0) {};
+        unsigned char cmd;
+        unsigned char i2cAddr;
+        unsigned char blockCount;
+        unsigned char reserved;
+        unsigned char data[maxDataLength];
+    };
+
+    struct ProtocolLMS64C
+    {
+        static const int pktLength = 64;
+        static const int maxDataLength = 56;
+        ProtocolLMS64C() :cmd(0),status(STATUS_UNDEFINED),blockCount(0)
+        {
+            memset(reserved, 0, 5);
+        };
+        unsigned char cmd;
+        unsigned char status;
+        unsigned char blockCount;
+        unsigned char reserved[5];
+        unsigned char data[maxDataLength];
+    };
+
+    struct ProtocolNovena
+    {
+        static const int pktLength = 128;
+        static const int maxDataLength = 128;
+        ProtocolNovena() :cmd(0),status(0) {};
+        unsigned char cmd;
+        unsigned char status;
+        unsigned char blockCount;
+        unsigned char data[maxDataLength];
+    };
+
+    struct GenericPacket
+    {   
+        GenericPacket()
+        {
+            cmd = CMD_GET_INFO;
+            status = STATUS_UNDEFINED;
+        }
+
+        eCMD_LMS cmd;
+        eCMD_STATUS status;
+        vector<unsigned char> outBuffer;
+        vector<unsigned char> inBuffer;
+    };
+
+    LMScomms();
+    ~LMScomms();
+
+    virtual TransferStatus TransferPacket(GenericPacket &pkt);
+    LMSinfo GetInfo();
+    void SetDataLogCallback(std::function<void(bool, const unsigned char*, const unsigned int)> callback);
+protected:
+    std::function<void(bool, const unsigned char*, const unsigned int)> callback_logData;
+    std::mutex mControlPortLock;
+    unsigned char* PreparePacket(const GenericPacket &pkt, int &length, const eLMS_PROTOCOL protocol);
+    int ParsePacket(GenericPacket &pkt, const unsigned char* buffer, const int length, const eLMS_PROTOCOL protocol);
+protected:
+    bool mSystemBigEndian;
+};
+
+#endif // LMS_COMMS_H
+
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/typedefs.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/typedefs.h
new file mode 100644
index 0000000000000000000000000000000000000000..9ae0c25d93843298f9a95236aa2e10c3272ac3db
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms7002m/typedefs.h
@@ -0,0 +1,18 @@
+/**
+@file	typedefs.h
+@author Lime Microsystems (www.limemicro.com)
+@brief 	Variables types definitions
+*/
+
+#ifndef LMS7002M_TYPEDEFS_H
+#define LMS7002M_TYPEDEFS_H
+
+typedef unsigned int uint32_t;
+typedef int int32_t;
+typedef unsigned short uint16_t;
+typedef short int16_t;
+typedef signed char int8_t;
+typedef unsigned char uint8_t;
+typedef double float_type;
+
+#endif
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/CMakeLists.txt b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..0225e1d4d6148af3df4055101eadb954c86768d8
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/CMakeLists.txt
@@ -0,0 +1,58 @@
+cmake_minimum_required(VERSION 2.8)
+set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE TYPE INTERNAL FORCE)
+project("matlab_StreamDLL")
+#include modules for finding CyAPI
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
+cmake_policy(SET CMP0015 OLD)
+if(${CMAKE_MAJOR_VERSION} GREATER 2)
+	cmake_policy(SET CMP0043 NEW)
+endif()
+ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
+if(CMAKE_COMPILER_IS_GNUCXX)
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -fPIC")
+endif()
+
+# Add sub-directories
+add_subdirectory(LMS_StreamBoard)
+include_directories(LMS_StreamBoard)
+add_subdirectory(connectionManager)
+include_directories(connectionManager)
+
+set(BINARY_OUTPUT_DIR "${CMAKE_BINARY_DIR}/bin")
+	
+if (MSVC)
+	SET( MSVC_MULTITHREAD_COMPILE_FLAGS "/MP")
+	SET( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} ${MSVC_MULTITHREAD_COMPILE_FLAGS}" )
+endif(MSVC)
+
+set(Library_file_list LMS_SDR.cpp )
+
+set(BUILD_STATIC_LIB OFF CACHE BOOL "Build static or dynamic library")
+if( BUILD_STATIC_LIB )
+	add_library(LMS_SDR STATIC ${Library_file_list})
+else()
+	add_library(LMS_SDR SHARED ${Library_file_list})
+endif(BUILD_STATIC_LIB)
+
+set(AUTO_UPDATE_VERSION OFF CACHE BOOL "Uses python script to increment version")
+if(AUTO_UPDATE_VERSION)
+	add_custom_target(updateVersion ALL COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/auto_version.py WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})	
+	add_dependencies(LMS_SDR updateVersion)
+endif()
+
+target_link_libraries(LMS_SDR
+	LMS_StreamBoard 
+	${CYAPI_LIBRARIES}
+	)
+	
+if(WIN32)
+	find_package(CyAPI REQUIRED)
+	LINK_DIRECTORIES(${CYAPI_LIBRARIES})	
+	include_directories(${CYAPI_INCLUDE_DIRS})
+	set(CONNECTION_MANAGER_LIBS ${CYAPI_LIBRARIES} SetupAPI)	
+endif()
+if(UNIX)	
+	set(CONNECTION_MANAGER_LIBS usb-1.0 -lpthread)	
+endif()
+
+target_link_libraries(LMS_SDR ${CONNECTION_MANAGER_LIBS})
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_SDR.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_SDR.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..1ff4bbf1de7b1a3f9587f8183a74b14e53c8f2b9
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_SDR.cpp
@@ -0,0 +1,334 @@
+/**
+@author Lime Microsystems
+@brief  Stream board communications for Matlab
+*/
+
+#include "LMS_SDR.h"
+
+#include "lmsComms.h"
+#include "LMS_StreamBoard.h"
+#include "ringBuffer.h"
+#include "IConnection.h"
+#include "fifo.h"
+#include "dataTypes.h"
+#include <unistd.h>
+#include <thread>
+
+#include <vector>
+#include <atomic>
+#include <thread>
+#include <mutex>
+#include <chrono>
+
+#define _USE_MATH_DEFINES
+#include <math.h>
+
+using namespace std;
+
+typedef enum
+{
+    LMS_SUCCESS = 0,
+    LMS_ERROR
+} LMS_STATUS;
+
+LMS_SamplesFIFO rxBuffer(1);
+static thread rxThread;
+atomic<bool> rxStop(1);
+atomic<bool> rxRunning(0);
+atomic<unsigned long> rxDroppedSamples(0);
+atomic<long> RxDataRate(0);
+atomic<uint32_t> rxSamplingRate(0);
+
+LMS_SamplesFIFO txBuffer(1);
+static thread txThread;
+atomic<bool> txStop(1);
+atomic<bool> txRunning(0);
+atomic<long> txDroppedSamples(0);
+atomic<long> TxDataRate(0);
+atomic<uint32_t> txSamplingRate(0);
+
+LMScomms comPort(IConnection::COM_PORT);
+LMScomms usbPort(IConnection::USB_PORT);
+LMS_StreamBoard streamer(&usbPort);
+
+const int samplesInPacket = 1024;
+unsigned int opMode = 0;
+
+DLL_EXPORT void LMS_Stats(uint32_t *RxBufSize, uint32_t *RxBufFilled, uint32_t *RxSamplingRate, uint32_t *TxBufSize, uint32_t *TxBufFilled, uint32_t *TxSamplingRate)
+{   
+    LMS_SamplesFIFO::BufferInfo rxStats = rxBuffer.GetInfo();
+    LMS_SamplesFIFO::BufferInfo txStats = txBuffer.GetInfo();
+    if (RxBufSize)
+        *RxBufSize = rxStats.size*samplesInPacket;
+    if (RxBufFilled)
+        *RxBufFilled = rxStats.itemsFilled*samplesInPacket;
+    if (TxBufSize)
+        *TxBufSize = txStats.size*samplesInPacket;
+    if (TxBufFilled)
+        *TxBufFilled = txStats.itemsFilled*samplesInPacket;
+    if (TxSamplingRate)
+        *TxSamplingRate = txSamplingRate.load();
+    if (RxSamplingRate)
+        *RxSamplingRate = rxSamplingRate.load();
+}
+
+DLL_EXPORT int LMS_Init(const int OperationMode, uint32_t trxBuffersLength)
+{   
+    opMode = OperationMode;
+    unsigned int packetsNeeded = trxBuffersLength / samplesInPacket;
+    if (trxBuffersLength % samplesInPacket != 0)
+        ++packetsNeeded;
+    if (packetsNeeded >= (uint32_t)(1 << 31))
+        packetsNeeded = (uint32_t)(1 << 31);
+    for (int i = 0; i < 32; ++i)
+        if ((1 << i) >= packetsNeeded)
+        {
+            packetsNeeded = (1 << i);
+            break;
+        }
+    rxBuffer.Reset(packetsNeeded);
+    txBuffer.Reset(packetsNeeded);
+    return LMS_SUCCESS;
+}
+
+DLL_EXPORT int LMS_Destroy()
+{
+    LMS_RxStop();
+    //buffers size is reduced to lower memory consumption when not used
+    rxBuffer.Reset(1);
+    txBuffer.Reset(1);
+    return LMS_SUCCESS;
+}
+
+DLL_EXPORT LMScomms* LMS_GetUSBPort()
+{
+	return &usbPort;
+}
+
+DLL_EXPORT LMScomms* LMS_GetCOMPort()
+{
+	return &comPort;
+}
+
+const int maxDevListLen = 32;
+const int maxDevNameLen = 256; //each device name not longer than 256
+static char DeviceNames[maxDevListLen][maxDevNameLen];
+
+DLL_EXPORT int LMS_UpdateDeviceList(LMScomms* port)
+{   
+    memset(DeviceNames, 0, maxDevListLen*maxDevNameLen);
+    port->Close();
+    int devCount = port->RefreshDeviceList();
+    vector<string> names = port->GetDeviceList();
+    int charsWritten = 0;
+    for (unsigned int i = 0; i < names.size() && i < maxDevListLen; ++i)
+    {   
+        charsWritten += sprintf(DeviceNames[i], "[%i] %.*s", i, maxDevNameLen, names[i].c_str());
+    }
+    return devCount;
+}
+
+DLL_EXPORT const char* LMS_GetDeviceName(LMScomms* port, unsigned int deviceIndex)
+{   
+    if (deviceIndex < maxDevListLen)
+        return DeviceNames[deviceIndex];
+    else
+        return "";
+}
+
+DLL_EXPORT int LMS_DeviceOpen(LMScomms* port, const uint32_t deviceIndex)
+{
+    port->Close();
+    int status = port->Open(deviceIndex);
+    if (status == 1)
+    {
+        return LMS_SUCCESS;
+    }
+    else
+    {
+        return LMS_ERROR;
+    }    
+}
+
+DLL_EXPORT void LMS_DeviceClose(LMScomms* port)
+{
+    port->Close();
+}
+
+DLL_EXPORT uint32_t LMS_ControlWrite(LMScomms* port, const uint8_t *buffer, const uint16_t bufLen)
+{
+    return port->Write(buffer, bufLen, 0);
+}
+
+DLL_EXPORT uint32_t LMS_ControlRead(LMScomms* port, uint8_t* buffer, const uint16_t bufLen)
+{
+    return port->Read(buffer, bufLen, 0);
+}
+
+
+
+const int RX_BUFF_SZ (1020*1024/4);
+uint32_t rx_buffer[RX_BUFF_SZ];
+uint64_t start_timestamp = 0;;
+uint32_t wr_pos = 0;
+uint32_t rd_pos = 0;
+
+void ReceivePackets()
+{
+    rxRunning.store(true);
+    uint32_t samplesCollected = 0;
+
+    const int bufferSize = 4096;// 4096;
+    const int buffersCount = 32; // must be power of 2
+    const int buffersCountMask = buffersCount - 1;
+    int handles[buffersCount]= {0}; 
+    char buffers[buffersCount*bufferSize]={0};
+    
+    struct sched_param sp;
+    sp.sched_priority = sched_get_priority_max(SCHED_FIFO);
+    if (pthread_setschedparam(pthread_self(),SCHED_FIFO,&sp)!=0)
+    {
+     printf("Shed prams failed\n");  
+    }
+
+    //switch off Rx
+    uint16_t regVal = streamer.SPI_read(0x0005);
+    streamer.SPI_write(0x0005, regVal & ~0x6);
+    //USB FIFO reset
+    LMScomms::GenericPacket ctrPkt;
+    ctrPkt.cmd = CMD_USB_FIFO_RST;
+    ctrPkt.outBuffer.push_back(0x01);
+    usbPort.TransferPacket(ctrPkt);
+    ctrPkt.outBuffer[0] = 0x00;
+    usbPort.TransferPacket(ctrPkt);
+
+    streamer.SPI_write(0x0005, regVal | 0x6);  
+    
+    streamer.SPI_write(0x0001, 0x0001);
+    streamer.SPI_write(0x0007, 0x0000);
+    
+    for (int i = 0; i<buffersCount; ++i)
+        handles[i] = usbPort.BeginDataReading(&buffers[i*bufferSize], bufferSize);
+
+    int bi = 0;
+
+    while (rxStop.load() != true)
+    {
+        if (usbPort.WaitForReading(handles[bi], 1000) == false)
+            break;
+
+        long bytesToRead = bufferSize;
+        long bytesReceived = usbPort.FinishDataReading(&buffers[bi*bufferSize], bytesToRead, handles[bi]);
+        if (bytesReceived > 0)
+        {	
+            PacketLTE* pkt = (PacketLTE*)&buffers[bi*bufferSize];
+            for(uint16_t sampleIndex = 0; sampleIndex < sizeof(pkt->samples)/sizeof(int16_t); sampleIndex++)
+            {
+                    pkt->samples[sampleIndex] <<= 4;
+                    pkt->samples[sampleIndex] >>= 4;		
+            }
+
+            rxBuffer.push_samples((complex16_t*)pkt->samples, 1020, pkt->counter, 100);                  
+        }
+        // Re-submit this request to keep the queue full
+        memset(&buffers[bi*bufferSize], 0, bufferSize);
+        handles[bi] = usbPort.BeginDataReading(&buffers[bi*bufferSize], bufferSize);
+        bi = (bi + 1) & buffersCountMask;
+        pthread_yield();
+    }
+    
+    usbPort.AbortReading();
+    for (int j = 0; j<buffersCount; j++)
+    {
+        long bytesToRead = bufferSize;
+        usbPort.WaitForReading(handles[j], 1000);
+        usbPort.FinishDataReading(&buffers[j*bufferSize], bytesToRead, handles[j]);
+    }
+    rxRunning.store(false);
+}
+
+
+DLL_EXPORT uint32_t LMS_TRxWrite(const int16_t *data, const uint32_t samplesCount, const uint32_t antenna_id, uint64_t timestamp)
+{
+    static uint32_t tx_buffer[1020];
+    static int index = 0;
+  
+    const int bufferSize = 1024 * 4;
+    const int buffersCount = 32; // must be power of 2
+    const int buffersCountMask = buffersCount - 1;
+
+    static int handles[buffersCount] = {0};
+    static char buffers[buffersCount*bufferSize]={0};
+    static bool bufferUsed[buffersCount] = {0};    
+    static int bi = 0; //buffer index
+    PacketLTE* pkt;
+
+    uint64_t ts = timestamp - index;
+
+    pkt = (PacketLTE*)&buffers[bi*bufferSize];
+
+    for (int i=0;i<samplesCount;i++)
+    {
+      ((uint32_t*)pkt->samples)[index++]=(((uint32_t*)data)[i]& 0xFFF0FFF) | 0x1000;
+
+      if (index == 1020)
+      {    
+       pkt->counter = ts;
+
+       if (bufferUsed[bi])
+       {
+              if (usbPort.WaitForSending(handles[bi], 1000) == false)
+                  return -1;
+              // Must always call FinishDataXfer to release memory of contexts[i]
+              long tempToSend = sizeof(PacketLTE);
+              usbPort.FinishDataSending(&buffers[bi*bufferSize], tempToSend, handles[bi]);
+
+              bufferUsed[bi] = false;
+         }
+        handles[bi] = usbPort.BeginDataSending(&buffers[bi*bufferSize], sizeof(PacketLTE));
+        bufferUsed[bi] = true;
+        bi = (bi + 1) & buffersCountMask;  
+        pkt = (PacketLTE*)&buffers[bi*bufferSize];
+        ts += 1020;
+        index = 0;       
+      }
+    } 
+}
+
+vector<PacketLTE> PacketsBuffer(2048, PacketLTE());
+DLL_EXPORT uint32_t LMS_TRxRead(int16_t *buffer, const uint32_t samplesCount, const uint32_t antenna_id, uint64_t *timestamp, const uint32_t timeout_ms)
+{
+	if (usbPort.IsOpen() == false && opMode != -1)
+        return 0;
+    pthread_yield();
+    uint32_t samplesPopped = rxBuffer.pop_samples((complex16_t*)buffer, samplesCount, timestamp, timeout_ms);
+    return samplesPopped;
+}
+
+
+DLL_EXPORT int LMS_RxStart()
+{
+    if (rxRunning.load())
+        return 1;
+    if (usbPort.IsOpen() == false && opMode != -1)
+        return 1;
+    rxStop.store(false);
+    unsigned int bufSz = rxBuffer.GetInfo().size;
+    rxBuffer.Reset(bufSz);
+    rxThread = thread(ReceivePackets);
+    return 0;
+}
+
+DLL_EXPORT int LMS_RxStop()
+{
+    if (rxRunning.load())
+    {        
+        if (rxThread.joinable())
+        {
+            rxStop.store(true);
+            rxThread.join();
+        }
+        rxStop.store(true);
+    }
+    return 0;
+}
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_SDR.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_SDR.h
new file mode 100644
index 0000000000000000000000000000000000000000..27a72e351a63ba5b71e2b92add5614a40ef654b9
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_SDR.h
@@ -0,0 +1,143 @@
+/**
+@author Lime Microsystems
+@brief  Interface for implementing SDR using Lime microsystems boards
+*/
+
+#ifndef LMS_SDR_INTERFACE_H
+#define LMS_SDR_INTERFACE_H
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+class LMScomms;
+#else
+typedef void LMScomms;
+#endif
+
+#define BUILD_DLL
+#ifndef __unix__
+#ifdef BUILD_DLL
+    #define DLL_EXPORT __declspec(dllexport)
+#else
+    #define DLL_EXPORT __declspec(dllimport)
+#endif
+#else
+#define DLL_EXPORT
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief Returns stats of internal buffers
+    @param RxBufSize Receiver buffer size in samples
+    @param RxBufFilled Number of samples currently in the receiver buffer
+    @param RxSamplingRate Approximate receiver sampling rate, calculated from incomming data
+    @param TxBufSize Transmitter buffer size in samples
+    @param TxBufFilled Number of samples currently in the transmitter buffer
+    @param TxSamplingRate Approximate transmitter sampling rate, calculated from incomming data
+*/
+DLL_EXPORT void LMS_Stats(uint32_t *RxBufSize, uint32_t *RxBufFilled, uint32_t *RxSamplingRate, uint32_t *TxBufSize, uint32_t *TxBufFilled, uint32_t *TxSamplingRate);
+
+/**	@brief Initializes internal memory for samples buffering to hardware
+    @param OperationMode samples transfering mode: 0-packets synchronized, 1-packets not synchronized
+    @param trxBuffersLength Rx and Tx internal buffers size in samples
+	@return 0 success, -1 failure
+
+    Generally trxBuffersSamplesCount should be more than 65536
+*/
+DLL_EXPORT int LMS_Init(const int OperationMode, uint32_t trxBuffersLength);
+
+/**	@brief Stops internal threads and frees internal buffers memory
+	@return 0 success, -1 failure
+*/
+DLL_EXPORT int LMS_Destroy();
+
+///@name Device connection
+/**	@return object for communicating over USB port
+*/
+DLL_EXPORT LMScomms* LMS_GetUSBPort();
+
+/**	@return object for communicating over COM port
+*/
+DLL_EXPORT LMScomms* LMS_GetCOMPort();
+
+/** @brief Refreshes currently connected device list
+    @param port Communications port to update
+    @return number of devices connected
+*/
+DLL_EXPORT int LMS_UpdateDeviceList(LMScomms* port);
+
+/** @brief Returns pointer to static null terminated c-string name of selected device
+    @param port Communications port object
+    @param deviceIndex index from communications port device list
+*/
+DLL_EXPORT const char* LMS_GetDeviceName(LMScomms* port, unsigned int deviceIndex);
+
+/**	@brief Connects to selected device on given port
+    @param port Communications port object
+    @param deviceIndex index from communications port device list
+	@return 0-success
+*/
+DLL_EXPORT int LMS_DeviceOpen(LMScomms* port, const uint32_t deviceIndex);
+
+/**	@brief Closes connection on given port
+    @param port Communications port to close
+*/
+DLL_EXPORT void LMS_DeviceClose(LMScomms* port);
+///@}
+
+///@name Communications
+/**	@brief Writes given data to control port
+	@param port Port for communications
+    @param buffer data to be written
+    @param bufLen buffer length in bytes
+    @return number of bytes written
+*/
+DLL_EXPORT uint32_t LMS_ControlWrite(LMScomms* port, const uint8_t *buffer, const uint16_t bufLen);
+
+/**	@brief Reads given data from SPI regiter
+    @param port Port for communications
+    @param buffer destination buffer for data
+    @param bufLen number of bytes to read
+	@return number of bytes read
+*/
+DLL_EXPORT uint32_t LMS_ControlRead(LMScomms* port, uint8_t* buffer, const uint16_t bufLen);
+
+/** @brief Starts thread for samples receiving
+    @return 0-success
+*/
+DLL_EXPORT int LMS_RxStart();
+
+/** @brief Stops samples receiving thread
+    @return 0:success, 1:failed
+*/
+DLL_EXPORT int LMS_RxStop();
+
+/** @brief Adds given samples to transmitter buffer, to be sent at specified timestamp
+@param buffer source array for interleaved values (IQIQIQ...), each value amplitude should be from -2048 to 2047
+@param samplesCount number of samples in buffer, 1 sample = 2 bytes I + 2 bytes Q
+@param channel_id destination channel
+@param timestamp timestamp when the first sample in buffer should be transmitted (used only in synchronized operating mode)
+@param timeout_ms time amount in milliseconds to try adding samples
+@return number of samples written
+*/
+DLL_EXPORT uint32_t LMS_TRxWrite(const int16_t *buffer, const uint32_t samplesCount, const uint32_t channel_id, uint64_t timestamp);
+
+/** @brief Reads samples from receiver buffer
+@param buffer destination array for interleaved values (IQIQIQ...), must be big enough to store requested number of samples, each value amplitude will be from -2048 to 2047
+@param samplesCount number of samples to read, 1 sample = 2 bytes I + 2 bytes Q
+@param antenna_id source channel
+@param timestamp returns timestamp of the first sample in the buffer (used only in synchronized operating mode)
+@param timeout_ms time amount in milliseconds to try reading samples
+@return number of samples read
+*/
+DLL_EXPORT uint32_t LMS_TRxRead(int16_t *buffer, const uint32_t samplesCount, const uint32_t channel_id, uint64_t *timestamp, const uint32_t timeout_ms);
+
+///@}
+
+#ifdef __cplusplus
+} //extern "C"
+#endif
+
+#endif //LMS_SDR_INTERFACE_H
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/CMakeLists.txt b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..02e6bb5ab92be2e0ea821285697f5dd771fc189a
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/CMakeLists.txt
@@ -0,0 +1,22 @@
+set(streamBoard_src_files
+	LMS_StreamBoard.cpp
+)
+
+add_library(LMS_StreamBoard STATIC ${streamBoard_src_files})
+target_include_directories(LMS_StreamBoard PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
+
+target_link_libraries(LMS_StreamBoard ConnectionManager)	
+
+if(WIN32 AND ENABLE_USB_CONNECTION)
+	find_package(CyAPI REQUIRED)
+	LINK_DIRECTORIES(${CYAPI_LIBRARIES})	
+	include_directories(${CYAPI_INCLUDE_DIRS})
+	set(CONNECTION_MANAGER_LIBS ${CYAPI_LIBRARIES} SetupAPI)
+	target_link_libraries(LMS_StreamBoard ${CONNECTION_MANAGER_LIBS})	
+endif()
+if(UNIX AND ENABLE_USB_CONNECTION)	
+	set(CONNECTION_MANAGER_LIBS usb-1.0 -lpthread)
+	target_link_libraries(LMS_StreamBoard ${CONNECTION_MANAGER_LIBS})
+endif()
+
+
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/LMS_StreamBoard.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/LMS_StreamBoard.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..da9e4a7b8e6e97ab27c22f4757bd7ddba3141cf9
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/LMS_StreamBoard.cpp
@@ -0,0 +1,770 @@
+#include "LMS_StreamBoard.h"
+#include "lmsComms.h"
+#include "lms7002_defines.h"
+#include <assert.h>
+#include <iostream>
+
+/** @brief Configures Stream board FPGA clocks
+    @param serPort Communications port to send data
+    @param fOutTx_MHz transmitter frequency in MHz
+    @param fOutRx_MHz receiver frequency in MHz
+    @param phaseShift_deg IQ phase shift in degrees
+    @return 0-success, other-failure
+*/
+LMS_StreamBoard::Status LMS_StreamBoard::ConfigurePLL(LMScomms *serPort, const float fOutTx_MHz, const float fOutRx_MHz, const float phaseShift_deg)
+{
+    assert(serPort != nullptr);
+    if (serPort == NULL)
+        return FAILURE;
+    if (serPort->IsOpen() == false)
+        return FAILURE;
+    const float vcoLimits_MHz[2] = { 600, 1300 };
+    int M, C;
+    const short bufSize = 64;
+
+    float fOut_MHz = fOutTx_MHz;
+    float coef = 0.8*vcoLimits_MHz[1] / fOut_MHz;
+    M = C = (int)coef;
+    int chigh = (((int)coef) / 2) + ((int)(coef) % 2);
+    int clow = ((int)coef) / 2;
+
+    LMScomms::GenericPacket pkt;
+    pkt.cmd = CMD_BRDSPI_WR;
+    
+    if (fOut_MHz*M > vcoLimits_MHz[0] && fOut_MHz*M < vcoLimits_MHz[1])
+    {   
+        pkt.outBuffer.push_back(0x00);
+        pkt.outBuffer.push_back(0x0F);
+        pkt.outBuffer.push_back(0x15); //c4-c2_bypassed
+        pkt.outBuffer.push_back(0x01 | ((M % 2 != 0) ? 0x08 : 0x00) | ((C % 2 != 0) ? 0x20 : 0x00)); //N_bypassed
+
+        pkt.outBuffer.push_back(0x00);
+        pkt.outBuffer.push_back(0x08);
+        pkt.outBuffer.push_back(1); //N_high_cnt
+        pkt.outBuffer.push_back(1);//N_low_cnt
+        pkt.outBuffer.push_back(0x00);
+        pkt.outBuffer.push_back(0x09);
+        pkt.outBuffer.push_back(chigh); //M_high_cnt
+        pkt.outBuffer.push_back(clow);	 //M_low_cnt
+        for (int i = 0; i <= 1; ++i)
+        {
+            pkt.outBuffer.push_back(0x00);
+            pkt.outBuffer.push_back(0x0A + i);
+            pkt.outBuffer.push_back(chigh); //cX_high_cnt
+            pkt.outBuffer.push_back(clow);	 //cX_low_cnt
+        }
+
+        float Fstep_us = 1 / (8 * fOutTx_MHz*C);
+        float Fstep_deg = (360 * Fstep_us) / (1 / fOutTx_MHz);
+        short nSteps = phaseShift_deg / Fstep_deg;
+        unsigned short reg2 = 0x0400 | (nSteps & 0x3FF);
+        pkt.outBuffer.push_back(0x00);
+        pkt.outBuffer.push_back(0x02);
+        pkt.outBuffer.push_back((reg2 >> 8));
+        pkt.outBuffer.push_back(reg2); //phase
+
+        pkt.outBuffer.push_back(0x00);
+        pkt.outBuffer.push_back(0x03);
+        pkt.outBuffer.push_back(0x00);
+        pkt.outBuffer.push_back(0x01);
+
+        pkt.outBuffer.push_back(0x00);
+        pkt.outBuffer.push_back(0x03);
+        pkt.outBuffer.push_back(0x00);
+        pkt.outBuffer.push_back(0x00);
+
+        reg2 = reg2 | 0x800;
+        pkt.outBuffer.push_back(0x00);
+        pkt.outBuffer.push_back(0x02);
+        pkt.outBuffer.push_back((reg2 >> 8));
+        pkt.outBuffer.push_back(reg2);
+
+        if(serPort->TransferPacket(pkt) != LMScomms::TRANSFER_SUCCESS || pkt.status != STATUS_COMPLETED_CMD)
+            return FAILURE;
+    }
+    else
+        return FAILURE;
+
+    fOut_MHz = fOutRx_MHz;
+    coef = 0.8*vcoLimits_MHz[1] / fOut_MHz;
+    M = C = (int)coef;
+    chigh = (((int)coef) / 2) + ((int)(coef) % 2);
+    clow = ((int)coef) / 2;
+    if (fOut_MHz*M > vcoLimits_MHz[0] && fOut_MHz*M < vcoLimits_MHz[1])
+    {
+        short index = 0;
+        pkt.outBuffer.clear();
+        pkt.outBuffer.push_back(0x00);
+        pkt.outBuffer.push_back(0x0F);
+        pkt.outBuffer.push_back(0x15); //c4-c2_bypassed
+        pkt.outBuffer.push_back(0x41 | ((M % 2 != 0) ? 0x08 : 0x00) | ((C % 2 != 0) ? 0x20 : 0x00)); //N_bypassed, c1 bypassed
+
+        pkt.outBuffer.push_back(0x00);
+        pkt.outBuffer.push_back(0x08);
+        pkt.outBuffer.push_back(1); //N_high_cnt
+        pkt.outBuffer.push_back(1);//N_low_cnt
+        pkt.outBuffer.push_back(0x00);
+        pkt.outBuffer.push_back(0x09);
+        pkt.outBuffer.push_back(chigh); //M_high_cnt
+        pkt.outBuffer.push_back(clow);	 //M_low_cnt
+        for (int i = 0; i <= 1; ++i)
+        {
+            pkt.outBuffer.push_back(0x00);
+            pkt.outBuffer.push_back(0x0A + i);
+            pkt.outBuffer.push_back(chigh); //cX_high_cnt
+            pkt.outBuffer.push_back(clow);	 //cX_low_cnt
+        }
+
+        pkt.outBuffer.push_back(0x00);
+        pkt.outBuffer.push_back(0x03);
+        pkt.outBuffer.push_back(0x00);
+        pkt.outBuffer.push_back(0x02);
+
+        pkt.outBuffer.push_back(0x00);
+        pkt.outBuffer.push_back(0x03);
+        pkt.outBuffer.push_back(0x00);
+        pkt.outBuffer.push_back(0x00);
+
+        if (serPort->TransferPacket(pkt) != LMScomms::TRANSFER_SUCCESS || pkt.status != STATUS_COMPLETED_CMD)
+            return FAILURE;
+    }
+    else
+        return FAILURE;
+    return SUCCESS;
+}
+
+/** @brief Captures IQ samples from Stream board, this is blocking function, it blocks until desired frames count is captured
+    @param isamples destination array for I samples, must be big enough to contain samplesCount
+    @param qsamples destination array for Q samples, must be big enough to contain samplesCount
+    @param framesCount number of IQ frames to capture
+    @param frameStart frame start indicator 0 or 1
+    @return 0-success, other-failure
+*/
+LMS_StreamBoard::Status LMS_StreamBoard::CaptureIQSamples(LMScomms *dataPort, int16_t *isamples, int16_t *qsamples, const uint32_t framesCount, const bool frameStart)
+{
+    assert(dataPort != nullptr);
+    if (dataPort == NULL)
+        return FAILURE;
+    if (dataPort->IsOpen() == false)
+        return FAILURE;
+
+    int16_t sample_value;
+    const uint32_t bufSize = framesCount * 2 * sizeof(uint16_t);
+    char *buffer = new char[bufSize];
+    if (buffer == 0)
+    {
+#ifndef NDEBUG
+        std::cout << "Failed to allocate memory for samples buffer" << std::endl;
+#endif
+        return FAILURE;
+    }
+    memset(buffer, 0, bufSize);
+
+    LMScomms::GenericPacket pkt;
+    pkt.cmd = CMD_BRDSPI_RD;
+    pkt.outBuffer.push_back(0x00);
+    pkt.outBuffer.push_back(0x05);
+    dataPort->TransferPacket(pkt);
+    if (pkt.status != STATUS_COMPLETED_CMD)
+        return FAILURE;
+
+    uint16_t regVal = (pkt.inBuffer[2] * 256) + pkt.inBuffer[3];
+    pkt.cmd = CMD_BRDSPI_WR;
+    pkt.outBuffer.clear();
+    pkt.outBuffer.push_back(0x00);
+    pkt.outBuffer.push_back(0x05);
+    pkt.outBuffer.push_back(0);
+    pkt.outBuffer.push_back(regVal | 0x4);    
+    dataPort->TransferPacket(pkt);
+    if (pkt.status != STATUS_COMPLETED_CMD)
+        return FAILURE;
+
+    int bytesReceived = 0;
+    for(int i = 0; i<3; ++i)
+        bytesReceived = dataPort->ReadStream(buffer, bufSize, 5000);
+    if (bytesReceived > 0)
+    {
+        bool iqSelect = false;
+        int16_t frameCounter = 0;        
+        for (uint32_t b = 0; b < bufSize;)
+        {
+            sample_value = buffer[b++] & 0xFF;
+            sample_value |= (buffer[b++] & 0x0F) << 8;
+            sample_value = sample_value << 4; //shift left then right to fill sign bits
+            sample_value = sample_value >> 4;
+            if (iqSelect == false)
+                isamples[frameCounter] = sample_value;
+            else
+                qsamples[frameCounter] = sample_value;
+            frameCounter += iqSelect;
+            iqSelect = !iqSelect;
+        }        
+    }
+    pkt.cmd = CMD_BRDSPI_RD;
+    pkt.outBuffer.clear();
+    pkt.outBuffer.push_back(0x00);
+    pkt.outBuffer.push_back(0x01);
+    pkt.outBuffer.push_back(0x00);
+    pkt.outBuffer.push_back(0x05);    
+    dataPort->TransferPacket(pkt);
+
+    regVal = (pkt.inBuffer[2] * 256) + pkt.inBuffer[3];
+    pkt.cmd = CMD_BRDSPI_WR;
+    pkt.outBuffer.clear();
+    pkt.outBuffer.push_back(0x00);
+    pkt.outBuffer.push_back(0x05);
+    pkt.outBuffer.push_back(0);
+    pkt.outBuffer.push_back(regVal & ~0x4);    
+    dataPort->TransferPacket(pkt);
+
+    delete[] buffer;
+    return SUCCESS;
+}
+
+/** @brief Blocking operation to upload IQ samples to Stream board RAM
+    @param serPort port to use for communication
+    @param isamples I channel samples
+    @param qsamples Q channel samples
+    @param framesCount number of samples in arrays
+    @return 0-success, other-failure
+*/
+LMS_StreamBoard::Status LMS_StreamBoard::UploadIQSamples(LMScomms* serPort, int16_t *isamples, int16_t *qsamples, const uint32_t framesCount)
+{
+    int bufferSize = framesCount * 2;
+    uint16_t *buffer = new uint16_t[bufferSize];
+    memset(buffer, 0, bufferSize*sizeof(uint16_t));
+    int bufPos = 0;
+    for (unsigned i = 0; i<framesCount; ++i)
+    {   
+        buffer[bufPos] = (isamples[i] & 0xFFF);
+        buffer[bufPos + 1] = (qsamples[i] & 0xFFF) | 0x1000;
+        bufPos += 2;
+    }
+    const long outLen = bufPos * 2;
+    int packetSize = 65536;
+    int sent = 0;
+    bool success = true;
+
+    LMScomms::GenericPacket pkt;
+    pkt.cmd = CMD_BRDSPI_RD;
+    pkt.outBuffer.push_back(0x00);
+    pkt.outBuffer.push_back(0x05);
+
+    serPort->TransferPacket(pkt);
+    pkt.cmd = CMD_BRDSPI_WR;
+    pkt.outBuffer.clear();
+    pkt.outBuffer.push_back(0x00);
+    pkt.outBuffer.push_back(0x05);
+    pkt.outBuffer.push_back(pkt.inBuffer[2]);
+    pkt.outBuffer.push_back(pkt.inBuffer[3] & ~0x7);
+    serPort->TransferPacket(pkt);
+
+    while (sent<outLen)
+    {
+        char *outBuf = (char*)buffer;
+        const long toSendBytes = outLen - sent > packetSize ? packetSize : outLen - sent;
+        long toSend = toSendBytes;
+        int context = serPort->BeginDataSending(&outBuf[sent], toSend);
+        if (serPort->WaitForSending(context, 5000) == false)
+        {
+            success = false;
+            serPort->FinishDataSending(&outBuf[sent], toSend, context);
+            break;
+        }
+        sent += serPort->FinishDataSending(&outBuf[sent], toSend, context);
+    }
+    
+    pkt.cmd = CMD_BRDSPI_RD;
+    pkt.outBuffer.push_back(0x00);
+    pkt.outBuffer.push_back(0x05);
+
+    serPort->TransferPacket(pkt);
+    pkt.cmd = CMD_BRDSPI_WR;
+    pkt.outBuffer.clear();
+    pkt.outBuffer.push_back(0x00);
+    pkt.outBuffer.push_back(0x05);
+    pkt.outBuffer.push_back(pkt.inBuffer[2]);
+    pkt.outBuffer.push_back(pkt.inBuffer[3] | 0x3);
+    serPort->TransferPacket(pkt);
+    return success ? SUCCESS : FAILURE;
+}
+
+LMS_StreamBoard::LMS_StreamBoard(LMScomms* dataPort)
+{
+    mRxFrameStart.store(true);
+    mDataPort = dataPort;
+    mRxFIFO = new LMS_StreamBoard_FIFO<SamplesPacket>(1024*4);
+    mTxFIFO = new LMS_StreamBoard_FIFO<SamplesPacket>(1024*4);
+    mStreamRunning.store(false);
+    mTxCyclicRunning.store(false);
+}
+
+LMS_StreamBoard::~LMS_StreamBoard()
+{
+    StopReceiving();
+    delete mRxFIFO;
+    delete mTxFIFO;
+}
+
+/** @brief Crates threads for packets receiving, processing and transmitting
+*/
+LMS_StreamBoard::Status LMS_StreamBoard::StartReceiving(unsigned int fftSize)
+{
+    if (mStreamRunning.load() == true)
+        return FAILURE;
+    if (mDataPort->IsOpen() == false)
+        return FAILURE;
+    mRxFIFO->reset();    
+    stopRx.store(false);
+    threadRx = std::thread(ReceivePackets, this);
+    mStreamRunning.store(true);
+    return SUCCESS;
+}
+
+/** @brief Stops receiving, processing and transmitting threads
+*/
+LMS_StreamBoard::Status LMS_StreamBoard::StopReceiving()
+{
+    if (mStreamRunning.load() == false)
+        return FAILURE;
+    stopTx.store(true);
+    stopRx.store(true);    
+    threadRx.join();
+    mStreamRunning.store(false);
+    return SUCCESS;
+}
+
+/** @brief Function dedicated for receiving data samples from board
+*/
+void LMS_StreamBoard::ReceivePackets(LMS_StreamBoard* pthis)
+{
+    SamplesPacket pkt;
+    int samplesCollected = 0;
+    auto t1 = chrono::high_resolution_clock::now();
+    auto t2 = chrono::high_resolution_clock::now();
+
+    const int buffer_size = 65536;// 4096;
+    const int buffers_count = 16; // must be power of 2
+    const int buffers_count_mask = buffers_count - 1;
+    int handles[buffers_count];
+    memset(handles, 0, sizeof(int)*buffers_count);
+    char *buffers = NULL;
+    buffers = new char[buffers_count*buffer_size];
+    if (buffers == 0)
+    {
+        printf("error allocating buffers\n");
+        return;
+    }
+    memset(buffers, 0, buffers_count*buffer_size);
+
+    //USB FIFO reset
+    LMScomms::GenericPacket ctrPkt;
+    ctrPkt.cmd = CMD_USB_FIFO_RST;
+    ctrPkt.outBuffer.push_back(0x01);
+    pthis->mDataPort->TransferPacket(ctrPkt);
+    ctrPkt.outBuffer[0] = 0x00;
+    pthis->mDataPort->TransferPacket(ctrPkt);
+
+    uint16_t regVal = pthis->SPI_read(0x0005);
+    pthis->SPI_write(0x0005, regVal | 0x4);
+
+    for (int i = 0; i<buffers_count; ++i)
+        handles[i] = pthis->mDataPort->BeginDataReading(&buffers[i*buffer_size], buffer_size);
+
+    int bi = 0;
+    int packetsReceived = 0;
+    unsigned long BytesReceived = 0;
+    int m_bufferFailures = 0;    
+    short sample;
+
+    bool frameStart = pthis->mRxFrameStart.load();
+    while (pthis->stopRx.load() == false)
+    {
+        if (pthis->mDataPort->WaitForReading(handles[bi], 1000) == false)
+            ++m_bufferFailures;
+
+        long bytesToRead = buffer_size;
+        long bytesReceived = pthis->mDataPort->FinishDataReading(&buffers[bi*buffer_size], bytesToRead, handles[bi]);
+        if (bytesReceived > 0)
+        {
+            ++packetsReceived;
+            BytesReceived += bytesReceived;
+            char* bufStart = &buffers[bi*buffer_size];
+            
+            for (int p = 0; p < bytesReceived; p+=2)
+            {
+                if (samplesCollected == 0) //find frame start
+                {
+                    int frameStartOffset = FindFrameStart(&bufStart[p], bytesReceived-p, frameStart);
+                    if (frameStartOffset < 0) 
+                        break; //frame start was not found, move on to next buffer
+                    p += frameStartOffset;
+                }
+                sample = (bufStart[p+1] & 0x0F);
+                sample = sample << 8;
+                sample |= (bufStart[p] & 0xFF);
+                sample = sample << 4;
+                sample = sample >> 4;
+                pkt.iqdata[samplesCollected] = sample;
+                ++samplesCollected;
+                if (pkt.samplesCount == samplesCollected)
+                {
+                    samplesCollected = 0;
+                    if (pthis->mRxFIFO->push_back(pkt, 200) == false)
+                        ++m_bufferFailures;
+                }
+            }
+        }
+        else
+        {
+            ++m_bufferFailures;
+        }
+
+        t2 = chrono::high_resolution_clock::now();
+        long timePeriod = std::chrono::duration_cast<std::chrono::milliseconds>(t2 - t1).count();
+        if (timePeriod >= 1000)
+        {
+            // periodically update frame start, user might change it during operation
+            frameStart = pthis->mRxFrameStart.load();
+            float m_dataRate = 1000.0*BytesReceived / timePeriod;
+            t1 = t2;
+            BytesReceived = 0;
+            LMS_StreamBoard_FIFO<SamplesPacket>::Status rxstats = pthis->mRxFIFO->GetStatus();
+
+            pthis->mRxDataRate.store(m_dataRate);
+            pthis->mRxFIFOfilled.store(100.0*rxstats.filledElements / rxstats.maxElements);
+#ifndef NDEBUG
+            printf("Rx: %.1f%% \t rate: %.0f kB/s failures:%i\n", 100.0*rxstats.filledElements / rxstats.maxElements, m_dataRate / 1000.0, m_bufferFailures);
+#endif
+            m_bufferFailures = 0;
+        }
+
+        // Re-submit this request to keep the queue full
+        memset(&buffers[bi*buffer_size], 0, buffer_size);
+        handles[bi] = pthis->mDataPort->BeginDataReading(&buffers[bi*buffer_size], buffer_size);
+        bi = (bi + 1) & buffers_count_mask;
+    }
+    pthis->mDataPort->AbortReading();
+    for (int j = 0; j<buffers_count; j++)
+    {
+        long bytesToRead = buffer_size;
+        pthis->mDataPort->WaitForReading(handles[j], 1000);
+        pthis->mDataPort->FinishDataReading(&buffers[j*buffer_size], bytesToRead, handles[j]);
+    }
+
+    regVal = pthis->SPI_read(0x0005);
+    pthis->SPI_write(0x0005, regVal & ~0x4);
+
+    delete[] buffers;
+#ifndef NDEBUG
+    printf("Rx finished\n");
+#endif
+}
+
+/** @brief Function dedicated for transmitting samples to board
+*/
+void LMS_StreamBoard::TransmitPackets(LMS_StreamBoard* pthis)
+{
+    const int packetsToBatch = 16;
+    const int buffer_size = sizeof(SamplesPacket)*packetsToBatch;
+    const int buffers_count = 16; // must be power of 2
+    const int buffers_count_mask = buffers_count - 1;
+    int handles[buffers_count];
+    memset(handles, 0, sizeof(int)*buffers_count);
+    char *buffers = NULL;
+    buffers = new char[buffers_count*buffer_size];
+    if (buffers == 0)
+    {
+        printf("error allocating buffers\n");
+    }
+    memset(buffers, 0, buffers_count*buffer_size);
+    bool *bufferUsed = new bool[buffers_count];
+    memset(bufferUsed, 0, sizeof(bool)*buffers_count);
+
+    int bi = 0; //buffer index
+
+    SamplesPacket* pkt = new SamplesPacket[packetsToBatch];
+    int m_bufferFailures = 0;
+    long bytesSent = 0;
+    auto t1 = chrono::high_resolution_clock::now();
+    auto t2 = chrono::high_resolution_clock::now();
+    long totalBytesSent = 0;
+
+    unsigned long outputCounter = 0;
+
+    while (pthis->stopTx.load() == false)
+    {
+        for (int i = 0; i < packetsToBatch; ++i)
+        {
+            if (pthis->mTxFIFO->pop_front(&pkt[i], 200) == false)
+            {
+                printf("Error popping from TX\n");
+                if (pthis->stopTx.load() == false)
+                    break;
+                continue;
+            }
+        }
+        //wait for desired slot buffer to be transferred
+        if (bufferUsed[bi])
+        {
+            if (pthis->mDataPort->WaitForSending(handles[bi], 1000) == false)
+            {
+                ++m_bufferFailures;
+            }
+            // Must always call FinishDataXfer to release memory of contexts[i]
+            long bytesToSend = buffer_size;
+            bytesSent = pthis->mDataPort->FinishDataSending(&buffers[bi*buffer_size], bytesToSend, handles[bi]);
+            if (bytesSent > 0)
+                totalBytesSent += bytesSent;
+            else
+                ++m_bufferFailures;
+            bufferUsed[bi] = false;
+        }
+
+        memcpy(&buffers[bi*buffer_size], &pkt[0], sizeof(SamplesPacket)*packetsToBatch);
+        handles[bi] = pthis->mDataPort->BeginDataSending(&buffers[bi*buffer_size], buffer_size);
+        bufferUsed[bi] = true;
+
+        t2 = chrono::high_resolution_clock::now();
+        long timePeriod = std::chrono::duration_cast<std::chrono::milliseconds>(t2 - t1).count();
+        if (timePeriod >= 1000)
+        {
+            float m_dataRate = 1000.0*totalBytesSent / timePeriod;
+            t1 = t2;
+            totalBytesSent = 0;
+#ifndef NDEBUG
+            cout << "Tx rate: " << m_dataRate / 1000 << " kB/s\t failures: " << m_bufferFailures << endl;
+#endif
+            LMS_StreamBoard_FIFO<SamplesPacket>::Status txstats = pthis->mTxFIFO->GetStatus();
+            pthis->mTxDataRate.store(m_dataRate);
+            pthis->mTxFIFOfilled.store(100.0*txstats.filledElements / txstats.maxElements);
+            m_bufferFailures = 0;
+        }
+        bi = (bi + 1) & buffers_count_mask;
+    }
+
+    // Wait for all the queued requests to be cancelled
+    pthis->mDataPort->AbortSending();
+    for (int j = 0; j<buffers_count; j++)
+    {
+        long bytesToSend = buffer_size;
+        if (bufferUsed[bi])
+        {
+            pthis->mDataPort->WaitForSending(handles[j], 1000);
+            pthis->mDataPort->FinishDataSending(&buffers[j*buffer_size], bytesToSend, handles[j]);
+        }
+    }
+
+    delete[] buffers;
+    delete[] bufferUsed;
+    delete[] pkt;
+#ifndef NDEBUG
+    printf("Tx finished\n");
+#endif
+}
+
+/** @brief Returns current data state for user interface
+*/
+LMS_StreamBoard::DataToGUI LMS_StreamBoard::GetIncomingData()
+{
+    std::unique_lock<std::mutex> lck(mLockIncomingPacket);
+    return mIncomingPacket;
+}
+
+/** @brief Returns data rate info and Tx Rx FIFO fill percentage
+*/
+LMS_StreamBoard::ProgressStats LMS_StreamBoard::GetStats()
+{
+    ProgressStats stats;
+    stats.RxRate_Bps = mRxDataRate.load();
+    stats.TxRate_Bps = mTxDataRate.load();
+    stats.RxFIFOfilled = mRxFIFOfilled.load();
+    stats.TxFIFOfilled = mTxFIFOfilled.load();
+    return stats;
+}
+
+/** @brief Helper function to write board spi regiters
+    @param address spi address
+    @param data register value
+*/
+LMS_StreamBoard::Status LMS_StreamBoard::SPI_write(uint16_t address, uint16_t data)
+{
+    assert(mDataPort != nullptr);
+    LMScomms::GenericPacket ctrPkt;
+    ctrPkt.cmd = CMD_BRDSPI_WR;
+    ctrPkt.outBuffer.push_back((address >> 8) & 0xFF);
+    ctrPkt.outBuffer.push_back(address & 0xFF);
+    ctrPkt.outBuffer.push_back((data >> 8) & 0xFF);
+    ctrPkt.outBuffer.push_back(data & 0xFF);
+    mDataPort->TransferPacket(ctrPkt);
+    return ctrPkt.status == 1 ? SUCCESS : FAILURE;
+}
+
+/** @brief Helper function to read board spi registers
+    @param address spi address
+    @return register value
+*/
+uint16_t LMS_StreamBoard::SPI_read(uint16_t address)
+{
+    assert(mDataPort != nullptr);
+    LMScomms::GenericPacket ctrPkt;
+    ctrPkt.cmd = CMD_BRDSPI_RD;
+    ctrPkt.outBuffer.push_back((address >> 8) & 0xFF);
+    ctrPkt.outBuffer.push_back(address & 0xFF);
+    mDataPort->TransferPacket(ctrPkt);
+    if (ctrPkt.status == STATUS_COMPLETED_CMD && ctrPkt.inBuffer.size() >= 4)
+        return ctrPkt.inBuffer[2] * 256 + ctrPkt.inBuffer[3];
+    else
+        return 0;
+}
+
+/** @brief Changes which frame start to look for when receiving data
+*/
+void LMS_StreamBoard::SetRxFrameStart(const bool startValue)
+{
+    mRxFrameStart.store(startValue);
+}
+
+/** @brief Searches for frame start index in given buffer
+    @return frameStart index in buffer, -1 if frame start was not found
+    Frame start indicator is 13th bit inside each I and Q sample
+*/
+int LMS_StreamBoard::FindFrameStart(const char* buffer, const int bufLen, const bool frameStart)
+{
+    int startIndex = -1;
+    for (int i = 0; i < bufLen; i+=2)
+        if ((buffer[i+1] & 0x10)>0 == frameStart)
+        {
+            startIndex = i;
+            break;
+        }
+    return startIndex;
+}
+
+/** @brief Starts a thread for continuous cyclic transmitting of given samples
+    @param isamples I channel samples
+    @param qsamples Q channel samples
+    @param framesCount number of samples in given arrays
+    @return 0:success, other:failure
+*/
+LMS_StreamBoard::Status LMS_StreamBoard::StartCyclicTransmitting(const int16_t* isamples, const int16_t* qsamples, uint32_t framesCount)
+{   
+    if (mDataPort->IsOpen() == false)
+        return FAILURE;
+
+    stopTxCyclic.store(false);
+    threadTxCyclic = std::thread([](LMS_StreamBoard* pthis)
+    {
+        const int buffer_size = 65536;
+        const int buffers_count = 16; // must be power of 2
+        const int buffers_count_mask = buffers_count - 1;
+        int handles[buffers_count];
+        memset(handles, 0, sizeof(int)*buffers_count);
+        char *buffers = NULL;
+        buffers = new char[buffers_count*buffer_size];
+        if (buffers == 0)
+        {
+            printf("error allocating buffers\n");
+            return 0;
+        }
+        memset(buffers, 0, buffers_count*buffer_size);
+
+        //timers for data rate calculation
+        auto t1 = chrono::high_resolution_clock::now();
+        auto t2 = chrono::high_resolution_clock::now();
+
+        int bi = 0; //buffer index
+
+        //setup output data
+        int dataIndex = 0;
+        for (int i = 0; i < buffers_count; ++i)
+        {
+            for (int j = 0; j < buffer_size; ++j)
+            {
+                buffers[i*buffer_size + j] = pthis->mCyclicTransmittingSourceData[dataIndex];
+                ++dataIndex;
+                if (dataIndex > pthis->mCyclicTransmittingSourceData.size())
+                    dataIndex = 0;
+            }
+        }
+
+        for (int i = 0; i < buffers_count; ++i)
+            handles[i] = pthis->mDataPort->BeginDataSending(&buffers[i*buffer_size], buffer_size);
+
+        int m_bufferFailures = 0;
+        int bytesSent = 0;
+        int totalBytesSent = 0;
+        int sleepTime = 200;
+        while (pthis->stopTxCyclic.load() != true)
+        {
+            if (pthis->mDataPort->WaitForSending(handles[bi], 1000) == false)
+            {
+                ++m_bufferFailures;
+            }
+            long bytesToSend = buffer_size;
+            bytesSent = pthis->mDataPort->FinishDataSending(&buffers[bi*buffer_size], bytesToSend, handles[bi]);
+            if (bytesSent > 0)
+                totalBytesSent += bytesSent;
+            else
+            {
+                ++m_bufferFailures;
+            }
+
+            t2 = chrono::high_resolution_clock::now();
+            long timePeriod = std::chrono::duration_cast<std::chrono::milliseconds>(t2 - t1).count();
+            if (timePeriod >= 1000)
+            {
+                pthis->mTxDataRate.store(1000.0*totalBytesSent / timePeriod);
+                t1 = t2;
+                totalBytesSent = 0;
+#ifndef NDEBUG
+                printf("Upload rate: %f\t failures:%li\n", 1000.0*totalBytesSent / timePeriod, m_bufferFailures);
+#endif
+                m_bufferFailures = 0;
+            }
+
+            //fill up next buffer		
+            for (int j = 0; j < buffer_size; ++j)
+            {
+                buffers[bi*buffer_size + j] = pthis->mCyclicTransmittingSourceData[dataIndex];
+                ++dataIndex;
+                if (dataIndex >= pthis->mCyclicTransmittingSourceData.size())
+                    dataIndex = 0;
+            }
+
+            // Re-submit this request to keep the queue full
+            handles[bi] = pthis->mDataPort->BeginDataSending(&buffers[bi*buffer_size], buffer_size);
+            bi = (bi + 1) & buffers_count_mask;
+        }
+
+        // Wait for all the queued requests to be cancelled
+        pthis->mDataPort->AbortSending();
+        for (int j = 0; j < buffers_count; j++)
+        {
+            long bytesToSend = buffer_size;
+            pthis->mDataPort->WaitForSending(handles[j], 1000);
+            pthis->mDataPort->FinishDataSending(&buffers[j*buffer_size], bytesToSend, handles[j]);
+        }
+#ifndef NDEBUG
+        printf("Cyclic transmitting FULLY STOPPED\n");
+#endif
+        delete[] buffers;
+        return 0;
+    }, this);
+    mTxCyclicRunning.store(true);
+
+    return LMS_StreamBoard::SUCCESS;
+}
+
+/** @brief Stops cyclic transmitting thread
+*/
+LMS_StreamBoard::Status LMS_StreamBoard::StopCyclicTransmitting()
+{
+    stopTxCyclic.store(true);
+    if (mTxCyclicRunning.load() == true)
+    {
+        threadTxCyclic.join();
+        mTxCyclicRunning.store(false);
+    }
+    return LMS_StreamBoard::SUCCESS;
+}
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/LMS_StreamBoard.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/LMS_StreamBoard.h
new file mode 100644
index 0000000000000000000000000000000000000000..99b363633607c8fb7d8b88c316bb1c44cfd68da8
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/LMS_StreamBoard.h
@@ -0,0 +1,107 @@
+#ifndef STREAM_BOARD_API_H
+#define STREAM_BOARD_API_H
+
+#include <stdint.h>
+#include <mutex>
+#include <atomic>
+#include <thread>
+#include "LMS_StreamBoard_FIFO.h"
+
+class LMScomms;
+
+class LMS_StreamBoard
+{
+public:
+    struct SamplesPacket
+    {
+    public:
+        SamplesPacket() : channel(0)
+        {}
+        ~SamplesPacket()
+        {}
+
+        SamplesPacket& operator=(const SamplesPacket& obj)
+        {
+            memcpy(this->iqdata, obj.iqdata, sizeof(float)*samplesCount);
+            this->channel = obj.channel;
+            return *this;
+        }
+        const static int samplesCount = 32768;
+        float iqdata[samplesCount];
+        int channel;
+    };
+
+
+    enum Status
+    {
+        SUCCESS,
+        FAILURE,
+    };
+
+    static Status CaptureIQSamples(LMScomms* serPort, int16_t *isamples, int16_t *qsamples, uint32_t framesCount, bool frameStart);
+    static Status UploadIQSamples(LMScomms* serPort, int16_t *isamples, int16_t *qsamples, uint32_t framesCount);
+    static Status ConfigurePLL(LMScomms *serPort, const float fOutTx_MHz, const float fOutRx_MHz, const float phaseShift_deg);
+
+    struct DataToGUI
+    {
+        std::vector<double> samplesI;
+        std::vector<double> samplesQ;
+        std::vector<double> fftBins_dbFS;
+        float nyquist_MHz;
+    };
+
+    struct ProgressStats
+    {
+        float RxRate_Bps;
+        float TxRate_Bps;
+        float RxFIFOfilled;
+        float TxFIFOfilled;
+    };
+
+    LMS_StreamBoard(LMScomms* dataPort);
+    virtual ~LMS_StreamBoard();
+
+    void SetRxFrameStart(const bool startValue);
+    virtual Status StartReceiving(unsigned int fftSize);
+    virtual Status StopReceiving();
+
+	virtual Status StartCyclicTransmitting(const int16_t* isamples, const int16_t* qsamples, uint32_t framesCount);
+    virtual Status StopCyclicTransmitting();
+
+    DataToGUI GetIncomingData();
+    ProgressStats GetStats();
+
+    Status SPI_write(uint16_t address, uint16_t data);
+    uint16_t SPI_read(uint16_t address);
+protected:
+    static int FindFrameStart(const char* buffer, const int bufLen, const bool frameStart);
+    std::mutex mLockIncomingPacket;
+    DataToGUI mIncomingPacket;
+
+    LMS_StreamBoard_FIFO<SamplesPacket> *mRxFIFO;
+    LMS_StreamBoard_FIFO<SamplesPacket> *mTxFIFO;
+
+    static void ReceivePackets(LMS_StreamBoard* pthis);
+    static void TransmitPackets(LMS_StreamBoard* pthis);
+
+    std::atomic_bool mRxFrameStart;
+    std::atomic_bool mStreamRunning;
+    std::atomic_bool stopRx;
+    std::atomic_bool stopTx;
+
+    std::thread threadRx;
+    std::thread threadTx;
+    LMScomms* mDataPort;
+
+    std::atomic<unsigned long> mRxDataRate;
+    std::atomic<unsigned long> mTxDataRate;
+    std::atomic<int> mRxFIFOfilled;
+    std::atomic<int> mTxFIFOfilled;
+
+    std::vector<int16_t> mCyclicTransmittingSourceData;
+    std::atomic_bool mTxCyclicRunning;
+    std::thread threadTxCyclic;
+    std::atomic_bool stopTxCyclic;
+};
+#endif
+
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/LMS_StreamBoard_FIFO.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/LMS_StreamBoard_FIFO.h
new file mode 100644
index 0000000000000000000000000000000000000000..833f7a37c008c63123ca4774e8477b78037ca8a8
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/LMS_StreamBoard_FIFO.h
@@ -0,0 +1,122 @@
+/**
+@file 	LMS_StreamBoard_FIFO.h
+@author Lime Microsystems (www.limemicro.com)
+@brief 	blocking FIFO for packets storing
+*/
+
+#ifndef LMS_STREAMBOARD_FIFO_H
+#define LMS_STREAMBOARD_FIFO_H
+
+#include <string.h>
+#include <stdio.h>
+#include <assert.h>
+#include <vector>
+#include <mutex>
+#include <chrono>
+#include <condition_variable>
+
+template<class T>
+class LMS_StreamBoard_FIFO
+{
+private:
+    LMS_StreamBoard_FIFO(){};
+public:
+    struct Status
+    {
+        uint32_t maxElements;
+        uint32_t filledElements;
+        uint32_t head;
+        uint32_t tail;
+    };
+
+    LMS_StreamBoard_FIFO(uint64_t FIFO_length)
+    {        
+        mHead = 0;
+        mTail = 0;
+		mElements.resize(FIFO_length);    
+		mElementsFilled = 0;
+    }
+
+    ~LMS_StreamBoard_FIFO()
+    {
+        
+    }
+
+    /** @brief Copies given src element to queue.
+        @param src Source data
+        @return true if element was inserted
+
+        Copies element to queue. This function blocks until element is copied to
+        queue or certain amount of time has passed.
+    */
+    bool push_back(const T &src, unsigned int timeout_ms = 200)
+    {        
+        std::unique_lock<std::mutex> lck(mElementsLock);         
+        while (mElementsFilled == mElements.size())
+        {
+            if (canWrite.wait_for(lck, std::chrono::milliseconds(timeout_ms)) == std::cv_status::timeout)
+                return false;            
+        }
+        memcpy(&mElements[mTail], &src, sizeof(T));		
+		mTail = (mTail+1) % mElements.size();
+		++mElementsFilled;
+        canRead.notify_one();
+		return true;		
+    }
+
+    /** @brief Copies and removes first element from queue to dest.
+        @param dest destination container for data
+        @return true if element was copied
+        Copies element from queue to destination and then removes it.
+        This function blocks until element is returned, or certain amount of time
+        has passed.
+    */
+    bool pop_front(T *dest, unsigned int timeout_ms = 200)
+    {
+        assert(dest != nullptr);   
+        std::unique_lock<std::mutex> lck(mElementsLock);
+        while (mElementsFilled == 0)
+        {
+            if (canRead.wait_for(lck, std::chrono::milliseconds(timeout_ms)) == std::cv_status::timeout)
+                return false;
+        }                
+        if (mElementsFilled == 0)
+            return false;
+        *dest = mElements[mHead];
+        memcpy(dest, &mElements[mHead], sizeof(T));
+        mHead = (mHead + 1) % mElements.size();
+        --mElementsFilled;
+        canWrite.notify_one();
+        return true;        
+    }
+    void reset()
+    {
+        std::unique_lock<std::mutex> lck(mElementsLock);
+        mElementsFilled = 0;
+        mHead = 0;
+        mTail = 0;
+    }    
+
+    Status GetStatus()
+    {
+        Status stats;
+        std::unique_lock<std::mutex> lck(mElementsLock);
+        stats.maxElements = mElements.size();
+        stats.filledElements = mElementsFilled;
+        stats.head = mHead;
+        stats.tail = mTail;
+        return stats;
+    };
+
+protected:
+    uint32_t mHead; //reading pos
+    uint32_t mTail; //writing pos
+	uint32_t mElementsFilled;
+
+    std::mutex mElementsLock; // condition variable for critical section  	
+    std::vector<T> mElements;
+    std::condition_variable canWrite;
+    std::condition_variable canRead;
+};
+
+#endif // LMS_STREAMBOARD_FIFO_H
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/lms7002_defines.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/lms7002_defines.h
new file mode 100644
index 0000000000000000000000000000000000000000..c098dfe9657d2e80be7ad38599124090ed96cfae
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/LMS_StreamBoard/lms7002_defines.h
@@ -0,0 +1,215 @@
+/**
+@file	lms7002_defines.h
+@author Lime Microsystems
+@brief	enumerations of available LMS7002M commands and statuses
+*/
+#pragma once
+
+const int LMS_RST_DEACTIVATE = 0;
+const int LMS_RST_ACTIVATE = 1;
+const int LMS_RST_PULSE = 2;
+
+enum eLMS_DEV
+{
+	LMS_DEV_UNKNOWN,
+	LMS_DEV_EVB6,
+	LMS_DEV_DIGIGREEN,
+	LMS_DEV_DIGIRED,
+	LMS_DEV_EVB7,
+	LMS_DEV_ZIPPER,
+	LMS_DEV_SOCKETBOARD,
+	LMS_DEV_EVB7V2,
+	LMS_DEV_STREAM,
+	LMS_DEV_NOVENA,
+	LMS_DEV_DATASPARK,
+	LMS_DEV_RFSPARK,
+	LMS_DEV_LMS6002USB,
+	LMS_DEV_RFESPARK,
+	
+	LMS_DEV_COUNT
+};
+
+const char LMS_DEV_NAMES[][80] = 
+{
+	"UNKNOWN",
+	"EVB6",
+	"DigiGreen",
+	"DigiRed",
+	"EVB7",
+	"ZIPPER",
+	"Socket Board",
+	"EVB7_v2",
+	"Stream",
+	"Novena",
+	"DataSpark",
+	"RF-Spark",
+	"LMS6002-USB Stick",
+	"RF-ESpark"
+};
+
+static const char* GetDeviceName(const eLMS_DEV device)
+{
+    if (LMS_DEV_UNKNOWN < device && device < LMS_DEV_COUNT)
+        return LMS_DEV_NAMES[device];
+    else
+        return LMS_DEV_NAMES[LMS_DEV_UNKNOWN];
+}
+
+enum eEXP_BOARD 
+{
+	EXP_BOARD_UNKNOWN,
+	EXP_BOARD_UNSUPPORTED,
+	EXP_BOARD_NO,
+	EXP_BOARD_MYRIAD1,
+	EXP_BOARD_MYRIAD2,
+	EXP_BOARD_MYRIAD_NOVENA,
+	EXP_BOARD_HPM1000,
+	EXP_BOARD_MYRIAD7,
+	EXP_BOARD_HPM7,
+	
+	EXP_BOARD_COUNT
+};
+
+const char EXP_BOARD_NAMES[][80] = 
+{
+	"UNKNOWN", 
+	"UNSUPPORTED", 
+	"NOT AVAILABLE",
+	"Myriad1",
+	"Myriad2",
+	"Novena",
+	"HPM1000",
+	"Myriad7",
+	"HMP7"
+};
+
+static const char* GetExpansionBoardName(const eEXP_BOARD board)
+{
+    if (EXP_BOARD_UNKNOWN < board && board < EXP_BOARD_COUNT)
+        return EXP_BOARD_NAMES[board];
+    else
+        return EXP_BOARD_NAMES[EXP_BOARD_UNKNOWN];
+}
+			
+struct LMS64C_Info
+{
+	unsigned char firmware;
+    unsigned char deviceType;
+    unsigned char protocol;
+    unsigned char hardware;
+    unsigned char expansionBoard;
+};
+
+enum eCMD_LMS
+{
+    CMD_GET_INFO = 0x00,
+    CMD_LMS6002_RST = 0x10,
+    ///Writes data to SI5356 synthesizer via I2C
+    CMD_SI5356_WR = 0x11,
+    ///Reads data from SI5356 synthesizer via I2C
+    CMD_SI5356_RD = 0x12,
+    ///Writes data to SI5351 synthesizer via I2C
+    CMD_SI5351_WR = 0x13,
+    ///Reads data from SI5351 synthesizer via I2C
+    CMD_SI5351_RD = 0x14,
+    ///PanelBus DVI (HDMI) Transmitter control
+    CMD_TFP410_WR = 0x15,
+    ///PanelBus DVI (HDMI) Transmitter control
+    CMD_TFP410_RD = 0x16,
+    ///Sets new LMS7002M chip’s RESET pin level (0, 1, pulse)
+    CMD_LMS7002_RST = 0x20,
+    ///Writes data to LMS7002M chip via SPI
+    CMD_LMS7002_WR = 0x21,
+    ///Reads data from LMS7002M chip via SPI
+    CMD_LMS7002_RD = 0x22,
+    ///Writes data to LMS6002 chip via SPI
+    CMD_LMS6002_WR = 0x23,
+    ///Reads data from LMS6002 chip via SPI
+    CMD_LMS6002_RD = 0x24,
+
+    CMD_LMS_LNA = 0x2A,
+    CMD_LMS_PA = 0x2B,
+
+    CMD_PROG_MCU = 0x2C,
+    ///Writes data to ADF4002 chip via SPI
+    CMD_ADF4002_WR = 0x31,
+
+    CMD_USB_FIFO_RST = 0x40,
+    CMD_PE636040_WR = 0x41,
+	CMD_PE636040_RD = 0x42,
+
+	CMD_GPIO_WR = 0x51,
+	CMD_GPIO_RD = 0x52,
+
+	CMD_ALTERA_FPGA_GW_WR = 0x53,
+	CMD_ALTERA_FPGA_GW_RD = 0x54,
+
+	CMD_BRDSPI_WR = 0x55,//16 bit spi for stream, dataspark control
+    CMD_BRDSPI_RD = 0x56,//16 bit spi for stream, dataspark control
+	CMD_BRDSPI8_WR = 0x57, //8 + 8 bit spi for stream, dataspark control
+	CMD_BRDSPI8_RD = 0x58, //8 + 8 bit spi for stream, dataspark control
+	
+	CMD_BRDCONF_WR = 0x5D, //write config data to board
+	CMD_BRDCONF_RD = 0x5E, //read config data from board
+	
+	CMD_ANALOG_VAL_WR = 0x61, //write analog value
+	CMD_ANALOG_VAL_RD = 0x62, //read analog value
+
+	CMD_MYRIAD_RST = 0x80,
+	CMD_MYRIAD_WR = 0x81,
+	CMD_MYRIAD_RD = 0x82,
+	CMD_MYRIAD_PROG = 0x8C
+};
+
+enum eCMD_STATUS
+{
+    STATUS_UNDEFINED,
+    STATUS_COMPLETED_CMD,
+    STATUS_UNKNOWN_CMD,
+    STATUS_BUSY_CMD,
+    STATUS_MANY_BLOCKS_CMD,
+    STATUS_ERROR_CMD,
+    STATUS_WRONG_ORDER_CMD,
+	STATUS_RESOURCE_DENIED_CMD,
+    STATUS_COUNT
+};
+
+static const char  status_text[][32]=
+{
+    "Undefined/Failure",
+    "Completed",
+    "Unknown command",
+    "Busy",
+    "Too many blocks",
+    "Error",
+    "Wrong order",
+    "Resource denied"
+};
+
+static const char* status2string(const int status)
+{
+    if(status >= 0 && status < STATUS_COUNT)
+        return status_text[status];
+    else
+        return "Unknown status";
+}
+
+enum eADC_UNITS
+{
+	RAW,
+	VOLTAGE,
+	CURRENT,
+	RESISTANCE,
+	POWER,
+	ADC_UNITS_COUNT
+};
+
+static const char  adc_units_text[][8] = {"", "V", "A", "Ohm", "W"};
+
+static const char* adcUnits2string(const unsigned units)
+{
+	if (units < ADC_UNITS_COUNT)
+		return adc_units_text[units];
+	else
+		return " unknown";
+}
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/CMakeLists.txt b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..d9124aaef13d009fedc0b4fb5dc7b1998701fde2
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/CMakeLists.txt
@@ -0,0 +1,34 @@
+set(ENABLE_USB_CONNECTION "YES" CACHE BOOL INTERNAL)
+set(ENABLE_SPI_CONNECTION "NO" CACHE BOOL INTERNAL)
+set(CONNECTION_MANAGER_DIR connectionManager)
+set(connectionManager_src_files
+	ConnectionManager.cpp
+	ConnectionCOM.cpp
+	ConnectionManager.h
+	ConnectionCOM.h
+	lmsComms.h
+	lmsComms.cpp
+)
+if(ENABLE_USB_CONNECTION)
+	list(APPEND connectionManager_src_files ConnectionUSB.cpp ConnectionUSB.h)
+    add_definitions(-DENABLE_USB_CONNECTION)
+endif()
+if(ENABLE_SPI_CONNECTION)
+	list(APPEND connectionManager_src_files ConnectionSPI.cpp ConnectionSPI.h)
+    add_definitions(-DENABLE_SPI_CONNECTION)
+endif()
+
+add_library(ConnectionManager STATIC ${connectionManager_src_files})
+target_include_directories(ConnectionManager PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
+
+if(WIN32 AND ENABLE_USB_CONNECTION)
+	find_package(CyAPI REQUIRED)
+	LINK_DIRECTORIES(${CYAPI_LIBRARIES})	
+	include_directories(${CYAPI_INCLUDE_DIRS})
+	set(CONNECTION_MANAGER_LIBS ${CYAPI_LIBRARIES} SetupAPI)
+	target_link_libraries(ConnectionManager ${CONNECTION_MANAGER_LIBS})
+endif()
+if(UNIX AND ENABLE_USB_CONNECTION)	
+	set(CONNECTION_MANAGER_LIBS usb-1.0 -lpthread)
+	target_link_libraries(ConnectionManager ${CONNECTION_MANAGER_LIBS})
+endif()
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionCOM.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionCOM.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..6c7fc0d8290d5c26a8ae575fbcc98b4058cae124
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionCOM.cpp
@@ -0,0 +1,596 @@
+/**
+    @file   ConnectionCOM.cpp
+    @author Lime Microsystems (www.limemicro.com)
+    @brief  Implementation of communications through COM port
+*/
+
+#include "ConnectionCOM.h"
+
+#include "string.h"
+#ifdef __unix__
+#include <fstream>
+#include <errno.h>
+#include <unistd.h>
+#include <termios.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <iostream>
+#include <stdio.h>
+#endif // LINUX
+
+const int COM_RETRY_INTERVAL = 20; //ms
+const int COM_TOTAL_TIMEOUT = 300; //ms
+
+/** @brief Initializes com port connection
+*/
+ConnectionCOM::ConnectionCOM()
+{
+    currentDeviceIndex = -1;
+	connected = false;
+	comPortList.clear();
+	m_deviceNames.clear();
+	m_connectionType = COM_PORT;
+#ifndef __unix__
+	hComm = INVALID_HANDLE_VALUE;
+#else
+    hComm = -1;
+#endif
+	comBaudrate = 9600;
+}
+
+/** @brief When object is destroyed it closes it's opened COM port
+*/
+ConnectionCOM::~ConnectionCOM()
+{
+	Close();
+}
+
+/** @brief Opens connection to first found chip
+    @return 0-success
+*/
+IConnection::DeviceStatus ConnectionCOM::Open()
+{
+	comPortList.clear();
+	if(comPortList.size() == 0)
+		FindAllComPorts();
+
+	m_deviceNames.clear();
+	if(m_deviceNames.size() == 0)
+		RefreshDeviceList();
+
+	for(unsigned int i=0; i<m_deviceNames.size(); i++)
+	{
+		if( Open(i) == SUCCESS)
+		{
+			currentDeviceIndex = i;
+			return SUCCESS;
+		}
+	}
+	return FAILURE;
+}
+
+/** @brief Opens connection to selected chip
+    @param index chip index in device list
+    @return 0-success
+*/
+IConnection::DeviceStatus ConnectionCOM::Open(unsigned index)
+{
+    unsigned int toOpen = index;
+	Close();
+	if(toOpen < m_deviceNames.size() && m_deviceNames.size() > 0 )
+	{
+		comPortName = m_deviceNames[toOpen];
+		IConnection::DeviceStatus status = Open(comPortName.c_str(), comBaudrate);
+		if( status == SUCCESS )
+			currentDeviceIndex = toOpen;
+        return status;
+	}
+	return FAILURE;
+}
+
+/** @brief Closes connection to chip
+*/
+void ConnectionCOM::Close()
+{
+    connected = false;
+    currentDeviceIndex = -1;
+#ifndef __unix__
+	if (hComm != INVALID_HANDLE_VALUE)
+	{
+		SetCommTimeouts(hComm, &m_ctmoOld);
+		CloseHandle(hComm);
+	}
+	hComm = INVALID_HANDLE_VALUE;
+#else
+    if( hComm >= 0)
+    {
+        close(hComm);
+    }
+    hComm = -1;
+#endif
+}
+
+/** @brief Returns whether chip is connected
+    @return chip is connected
+*/
+bool ConnectionCOM::IsOpen()
+{
+#ifndef __unix__
+	if (hComm != INVALID_HANDLE_VALUE && TestConnectivity() )
+		return true;
+#else
+    if( hComm != -1 && TestConnectivity() )
+        return true;
+#endif
+    return false;
+}
+
+int ConnectionCOM::GetOpenedIndex()
+{
+    return currentDeviceIndex;
+}
+
+/** @brief Sends data through COM port
+    @param buffer data buffer to send
+    @param length size of data buffer
+    @param timeout_ms timeout limit for operation in milliseconds
+    @return Number of bytes sent
+*/
+int ConnectionCOM::Write(const unsigned char *buffer, int length, int timeout_ms)
+{
+    if(timeout_ms == 0)
+    {
+        timeout_ms = COM_TOTAL_TIMEOUT;
+    }
+    int retryCount = 0;
+    const int maxRetries = (timeout_ms/COM_RETRY_INTERVAL) > 1 ? (timeout_ms/COM_RETRY_INTERVAL) : 1;
+    bool status = false;
+#ifndef __unix__
+	unsigned long bytesWriten = 0;
+	m_osWOverlap.InternalHigh = 0;
+
+	for(int i = 0; i<maxRetries && status == false; ++i)
+    {
+        if (!WriteFile(hComm, buffer, length , &bytesWriten, NULL))
+        {
+            status = false;
+        }
+        else
+            status = true;
+        ++retryCount;
+    }
+#else
+    long bytesWriten = 0;
+    for(int i = 0; i<maxRetries && bytesWriten == 0; ++i)
+    {
+        bytesWriten = write(hComm, buffer, length);
+        if(bytesWriten <= 0)
+        {
+//            if(bytesWriten < 0)
+//                MessageLog::getInstance()->write("COM PORT: error writing data\n", LOG_ERROR);
+//            if(bytesWriten == 0)
+//                MessageLog::getInstance()->write("COM PORT: data bytes sent 0\n", LOG_WARNING);
+            status = false;
+        }
+        else
+            status = true;
+        ++retryCount;
+    }
+#endif
+    if(bytesWriten == length)
+        status = true;
+
+	return bytesWriten;
+}
+
+/** @brief Reads data from COM port
+    @param buffer pointer to data buffer for receiving
+    @param length number of bytes to read
+    @param timeout_ms timeout limit for operation in milliseconds
+    @return Number of bytes received
+*/
+int ConnectionCOM::Read(unsigned char *buffer, int length, int timeout_ms)
+{
+    if(timeout_ms == 0)
+    {
+        timeout_ms = COM_TOTAL_TIMEOUT;
+    }
+    int retryCount = 0;
+    const int maxRetries = (timeout_ms/COM_RETRY_INTERVAL) > 1 ? (timeout_ms/COM_RETRY_INTERVAL) : 1;
+    bool status = false;
+
+    memset(buffer, 0, length);
+	long bytesReaded = 0;
+	unsigned long totalBytesReaded = 0;
+	char cRawData[COM_BUFFER_LENGTH];
+	unsigned long bytesToRead = length;
+
+	memset(cRawData, '\0', sizeof(cRawData[0])*COM_BUFFER_LENGTH);
+
+	for(int i=0; i<maxRetries && status == false; ++i)
+    {
+        memset(cRawData, '\0', sizeof(cRawData[0])*COM_BUFFER_LENGTH);
+#ifndef __unix__
+
+        DWORD bytesReceived = 0;
+        if ( !ReadFile(hComm, cRawData, bytesToRead, &bytesReceived, NULL) )
+        {
+            status = false;
+        }
+
+        bytesReaded = bytesReceived;
+#else
+        bytesReaded = read(hComm, cRawData, bytesToRead);
+        if(bytesReaded <= 0)
+        {
+//            if(bytesReaded < 0)
+//                MessageLog::getInstance()->write("COM PORT: error reading data\n", LOG_ERROR);
+//            if(bytesReaded == 0)
+//                MessageLog::getInstance()->write("COM PORT: reading 0 bytes\n", LOG_WARNING);
+            status = false;
+        }
+#endif
+        retryCount++;
+
+        for(int j=0; j<bytesReaded; ++j)
+        {
+            buffer[totalBytesReaded+j] = cRawData[j];
+        }
+
+        totalBytesReaded += bytesReaded;
+        if(totalBytesReaded == bytesToRead)
+            status = true;
+    }
+
+//    ss << " read(" << totalBytesReaded << "): ";
+//    for(unsigned int i=0; i<64; ++i)
+//        ss << int2hex(buffer[i], 1) << " ";
+//    ss <<  " - retries: " << retryCount-1 << endl;
+    //MessageLog::getInstance()->write(ss.str(), LOG_DATA);
+
+//	if(retryCount == maxRetries)
+//        MessageLog::getInstance()->write("COM PORT: read data timeout\n", LOG_WARNING);
+//
+//    if(totalBytesReaded > length)
+//        MessageLog::getInstance()->write("COM PORT: read data corrupted, received length > requested length\n", LOG_ERROR);
+	return totalBytesReaded;
+}
+
+/** @brief Searches for available COM ports and adds them to list
+*/
+void ConnectionCOM::FindAllComPorts()
+{
+    Close();
+	comPortList.clear();
+#ifndef __unix__
+	HKEY hSERIALCOMM;
+	if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT("HARDWARE\\DEVICEMAP\\SERIALCOMM"),	0, KEY_QUERY_VALUE, &hSERIALCOMM) == ERROR_SUCCESS)
+	{
+		// Get the max value name and max value lengths
+		DWORD dwMaxValueNameLen;
+		DWORD dwMaxValueLen;
+		DWORD dwQueryInfo = RegQueryInfoKey(hSERIALCOMM, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &dwMaxValueNameLen, &dwMaxValueLen, NULL, NULL);
+		if (dwQueryInfo == ERROR_SUCCESS)
+		{
+			DWORD dwMaxValueNameSizeInChars = dwMaxValueNameLen + 1;
+			// Include space for the NULL terminator
+			DWORD dwMaxValueNameSizeInBytes = dwMaxValueNameSizeInChars*sizeof(TCHAR);
+			DWORD dwMaxValueDataSizeInChars = dwMaxValueLen / sizeof(TCHAR) + 1;
+			// Include space for the NULL terminator
+			DWORD dwMaxValueDataSizeInBytes = dwMaxValueDataSizeInChars*sizeof(TCHAR);
+
+			// Allocate some space for the value name and value data
+			TCHAR* szValueName = new TCHAR[dwMaxValueNameSizeInChars];
+			TCHAR* byValue = new TCHAR[dwMaxValueDataSizeInBytes];
+			if (szValueName && byValue)
+			{
+				// Enumerate all the values underneath HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM
+				DWORD dwIndex = 0;
+				DWORD dwType;
+				DWORD dwValueNameSize = dwMaxValueNameSizeInChars;
+				DWORD dwDataSize = dwMaxValueDataSizeInBytes;
+				memset(szValueName, 0, dwMaxValueNameSizeInBytes);
+				memset(byValue, 0, dwMaxValueDataSizeInBytes);
+				LONG nEnum = RegEnumValue(hSERIALCOMM, dwIndex, szValueName, &dwValueNameSize, NULL, &dwType, (LPBYTE)byValue, &dwDataSize);
+				while (nEnum == ERROR_SUCCESS)
+				{
+					// If the value is of the correct type, then add it to the array
+					if (dwType == REG_SZ)
+					{
+					    char portname[512];
+						TCHAR* szPort = byValue;
+						int nUserNameLenUnicode = lstrlen( szPort ); // Convert all UNICODE characters
+						int nUserNameLen = WideCharToMultiByte( CP_ACP, // ANSI Code Page
+                        0, // No special handling of unmapped chars
+                        (LPCWSTR)szPort, // wide-character string to be converted
+                        nUserNameLenUnicode,
+                        NULL, 0, // No output buffer since we are calculating length
+                        NULL, NULL ); // Unrepresented char replacement - Use Default
+                        TCHAR* pszUserName = new TCHAR[ nUserNameLen ]; // nUserNameLen includes the NULL character
+                        WideCharToMultiByte( CP_ACP, // ANSI Code Page
+                        0, // No special handling of unmapped chars
+						(LPCWSTR)szPort, // wide-character string to be converted
+                        nUserNameLenUnicode,
+                        portname,
+                        nUserNameLen,
+                        NULL, NULL ); // Unrepresented char replacement - Use Default
+						portname[nUserNameLen] = 0;
+#ifdef UNICODE
+                        comPortList.push_back(portname);
+#else
+                        comPortList.push_back(szPort);
+#endif
+					}
+					// Prepare for the next time around
+					dwValueNameSize = dwMaxValueNameSizeInChars;
+					dwDataSize = dwMaxValueDataSizeInBytes;
+					memset(szValueName, 0, dwMaxValueNameSizeInBytes);
+					memset(byValue, 0, dwMaxValueDataSizeInBytes);
+					++dwIndex;
+					nEnum = RegEnumValue(hSERIALCOMM, dwIndex, szValueName,	&dwValueNameSize, NULL, &dwType, (LPBYTE)byValue, &dwDataSize);
+				}
+			}
+			delete szValueName;
+			delete byValue;
+		}
+		// Close the registry key now that we are finished with it
+		RegCloseKey(hSERIALCOMM);
+
+		if (dwQueryInfo != ERROR_SUCCESS)
+			SetLastError(dwQueryInfo);
+	}
+#else
+    char tempBuffer[256];
+    string result = "";
+#warning Currently searching only for ACM connections
+    system( "ls /dev | grep ttyACM > /tmp/foundSerialPorts.txt");
+
+    fstream fin;
+    fin.open("/tmp/foundSerialPorts.txt", ios::in);
+    while(!fin.eof())
+    {
+        fin.getline(tempBuffer, 256);
+        result = "/dev/";
+        result.append(tempBuffer);
+        if( strlen(tempBuffer) > 3 ) //longer than tty
+            comPortList.push_back(result);
+    }
+    fin.close();
+#endif
+}
+
+/** @brief Opens COM port
+    @param comName COM port name
+    @param baudrate COM port baudrate
+    @return 0 on success
+*/
+IConnection::DeviceStatus ConnectionCOM::Open(const char *comName, int baudrate)
+{
+	Close();
+	if (strlen(comName) == 0)
+		return FAILURE;
+
+	DeviceStatus errorCode = SUCCESS;
+
+#ifndef __unix__
+	// Initialize Overlap structures
+	m_osROverlap.Internal = 0;
+	m_osROverlap.InternalHigh = 0;
+	m_osROverlap.Offset = 0;
+	m_osROverlap.OffsetHigh = 0;
+	m_osROverlap.hEvent = CreateEvent(NULL, false, false, NULL);
+
+	m_osWOverlap.Internal = 0;
+	m_osWOverlap.InternalHigh = 0;
+	m_osWOverlap.Offset = 0;
+	m_osWOverlap.OffsetHigh = 0;
+	m_osWOverlap.hEvent = CreateEvent(NULL, false, false, NULL);
+
+	// Initialize DSB structure
+	memset(&m_dcbCommPort, 0, sizeof(m_dcbCommPort));
+
+	m_dcbCommPort.BaudRate = comBaudrate;
+	m_dcbCommPort.fBinary = 1;
+	m_dcbCommPort.fParity = 0;
+	m_dcbCommPort.fOutxCtsFlow = 0;
+	m_dcbCommPort.fOutxDsrFlow = 0;
+	m_dcbCommPort.fDtrControl = 0;
+	m_dcbCommPort.fDsrSensitivity = 0;
+	m_dcbCommPort.fTXContinueOnXoff = 0;
+	m_dcbCommPort.fOutX = 0;
+	m_dcbCommPort.fInX = 0;
+	m_dcbCommPort.fErrorChar = 0;
+	m_dcbCommPort.fNull = 0;
+	m_dcbCommPort.fRtsControl = 0;
+	m_dcbCommPort.fAbortOnError = 0;
+	m_dcbCommPort.fDummy2 = 0;
+	// m_dcbCommPort.wReserved = 0;
+	m_dcbCommPort.XonLim = 512;
+	m_dcbCommPort.XoffLim = 512;
+	m_dcbCommPort.ByteSize = 8;
+	m_dcbCommPort.Parity = 0;
+	m_dcbCommPort.StopBits = 0;
+	//m_dcbCommPort.StopBits = 1;
+	m_dcbCommPort.XonChar = 17;
+	m_dcbCommPort.XoffChar = 19;
+	m_dcbCommPort.ErrorChar = 0;
+	m_dcbCommPort.EofChar = 26;
+	m_dcbCommPort.EvtChar = 0;
+	m_dcbCommPort.wReserved1 = 0;
+	m_dcbCommPort.DCBlength = sizeof(DCB);
+
+	// Initialize Timeout's
+	m_ctmoNew.ReadIntervalTimeout = 50;
+	m_ctmoNew.ReadTotalTimeoutMultiplier = 0;
+	m_ctmoNew.ReadTotalTimeoutConstant = 100; // 1;
+	m_ctmoNew.WriteTotalTimeoutMultiplier = 0;
+	m_ctmoNew.WriteTotalTimeoutConstant = 100;
+
+	// Open COM port
+	string stmp;
+	stmp = "\\\\.\\";
+	stmp.append(comName);
+	hComm = CreateFileA(stmp.c_str(), GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
+
+	if (hComm != INVALID_HANDLE_VALUE)
+	{
+		// Set Events
+		if (!SetCommMask(hComm, 0))
+			errorCode = FAILURE;
+
+		// Set Timeouts
+		GetCommTimeouts(hComm, &m_ctmoOld);
+		if (!SetCommTimeouts(hComm, &m_ctmoNew))
+			errorCode = FAILURE;
+
+		// Set DCB
+		if (!SetCommState(hComm, &m_dcbCommPort))
+			errorCode = FAILURE;
+	}
+	else
+	{
+		errorCode = FAILURE;
+	};
+
+	// Check the results
+	if (errorCode != 0)
+	{
+		//unsigned long err = GetLastError();
+		CloseHandle(hComm);
+		hComm = INVALID_HANDLE_VALUE;
+		return errorCode;
+	}
+	else
+	{
+		PurgeComm(hComm, PURGE_TXCLEAR | PURGE_RXCLEAR);
+		return SUCCESS;
+	}
+#else
+    hComm = open(comName, O_RDWR | O_NOCTTY | O_SYNC);
+    if(hComm < 0)
+    {
+//        printf("%s",strerror(errno));
+//        MessageLog::getInstance()->write("Connection manager: failed opening COM port\n", LOG_ERROR);
+        return FAILURE;
+    }
+
+    struct termios tty;
+    memset(&tty, 0, sizeof(tty));
+    if( tcgetattr(hComm, &tty) != 0)
+    {
+//        MessageLog::getInstance()->write("Connection Manager: error from tcgetattr\n", LOG_ERROR);
+        return FAILURE;
+    }
+    int speed = B9600;
+    cfsetospeed(&tty, speed);
+    cfsetispeed(&tty, speed);
+
+    tty.c_cflag = (tty.c_cflag & ~CSIZE) | CS8;
+    tty.c_iflag &= ~IGNBRK;
+    tty.c_lflag = 0;
+    tty.c_oflag = 0;
+    tty.c_cc[VMIN] = 0; // read non blocking
+    tty.c_cc[VTIME] = 5; // 0.5 seconds read timeout
+
+    tty.c_iflag &= ~(IXON | IXOFF | IXANY);
+    tty.c_cflag |= (CLOCAL | CREAD);
+
+    if(tcsetattr(hComm, TCSANOW, &tty) != 0)
+    {
+//        MessageLog::getInstance()->write("Connection manager: error from tcsetattr\n", LOG_ERROR);
+        return FAILURE;
+    }
+#endif
+    return SUCCESS;
+}
+
+/** @brief Checks if chip is connected to currently open port
+    @return chip is connected
+*/
+bool ConnectionCOM::TestConnectivity()
+{
+//currently set to always return true to show all com ports
+    return true;
+#ifndef __unix__
+	if (hComm != INVALID_HANDLE_VALUE)
+#else
+    if( hComm >= 0)
+#endif
+	{
+//	    unsigned char out[64];
+//	    unsigned char in[64];
+//	    memset(in, 0, 64);
+//	    out[0] = CMD_GET_INFO;
+//        SendData(out, 64);
+//        ReadData(in, 64);
+//        if(in[0] == CMD_GET_INFO && in[1] == 0x01)
+//            return true;
+//        else
+//            return false;
+	}
+	return false;
+}
+
+/** @brief Finds all chips connected to com ports
+    @return number of devices found
+*/
+int ConnectionCOM::RefreshDeviceList()
+{
+    int wasOpen = -1;
+    string wasOpenName = "";
+    if(IsOpen())
+    {
+        wasOpen = GetOpenedIndex();
+        wasOpenName = comPortName;
+    }
+    Close();
+    comPortList.clear();
+	if(comPortList.size() == 0)
+		FindAllComPorts();
+
+	m_deviceNames.clear();
+	string comName;
+	for(unsigned int i=0; i<comPortList.size(); i++)
+	{
+	    comName = comPortList[i];
+#ifndef __unix__
+		if( Open(comName.c_str(), comBaudrate) == SUCCESS)
+		{
+			if( TestConnectivity() ) //if responds add it to device list
+				m_deviceNames.push_back(comName);
+		}
+		Close();
+#else
+        m_deviceNames.push_back(comName);
+#endif
+	}
+	if(wasOpen != -1)
+    {
+        for(unsigned i=0; i<m_deviceNames.size(); ++i)
+            if(m_deviceNames[i] == wasOpenName)
+            {
+                Open(i);
+                break;
+            }
+    }
+	return m_deviceNames.size();
+}
+
+/** @brief Returns found devices names
+    @return vector of device names
+*/
+vector<string> ConnectionCOM::GetDeviceNames()
+{
+    return m_deviceNames;
+}
+
+/** @brief Purges communication buffers
+*/
+void ConnectionCOM::ClearComm()
+{
+#ifndef __unix__
+    PurgeComm(hComm, PURGE_TXCLEAR|PURGE_RXCLEAR);
+#endif
+}
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionCOM.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionCOM.h
new file mode 100644
index 0000000000000000000000000000000000000000..0549472db1b9efb7312d75f906b3c7614e1455a7
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionCOM.h
@@ -0,0 +1,62 @@
+/**
+@file   ConnectionCOM.h
+@author Lime Microsystems (www.limemicro.com)
+@brief  Class for data communications through COM port
+*/
+
+#ifndef CONNECTION_COM_PORT_H
+#define CONNECTION_COM_PORT_H
+
+#ifndef __unix__
+	#include "windows.h"
+#endif
+
+#include "IConnection.h"
+
+class ConnectionCOM : public IConnection
+{
+public:
+    static const int COM_BUFFER_LENGTH = 1024; //max buffer size for data
+
+	ConnectionCOM();
+	~ConnectionCOM();
+
+	DeviceStatus Open();
+	DeviceStatus Open(unsigned i);
+	void Close();
+	bool IsOpen();
+	int GetOpenedIndex();
+
+	int Write(const unsigned char *buffer, int length, int timeout_ms = 0);
+	int Read(unsigned char *buffer, int length, int timeout_ms = 0);
+
+	std::vector<std::string> GetDeviceNames();
+	int RefreshDeviceList();
+	void ClearComm();
+private:
+	void FindAllComPorts();
+	DeviceStatus Open(const char *comName, int baudrate);
+
+	bool TestConnectivity();
+
+	std::string comPortName;
+	int comBaudrate;
+	bool connected;
+
+	int currentDeviceIndex;
+	std::vector<std::string> comPortList;
+	std::vector<std::string> m_deviceNames;
+
+#ifndef __unix__
+	HANDLE hComm;
+	COMMTIMEOUTS m_ctmoNew;
+	COMMTIMEOUTS m_ctmoOld;
+	OVERLAPPED m_osROverlap;
+	OVERLAPPED m_osWOverlap;
+	DCB m_dcbCommPort;
+#else
+    int hComm; //com port file descriptor
+#endif
+
+};
+#endif
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionManager.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionManager.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..9ec16e0d8845a9902ce9bffa4ea9b5e1309a91a4
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionManager.cpp
@@ -0,0 +1,319 @@
+/**
+    @file ConnectionManager.cpp
+    @author Lime Microsystems (www.limemicro.com)
+    @brief Implementation of various connection types to devices
+*/
+
+#include "ConnectionManager.h"
+#include "ConnectionCOM.h"
+
+#ifdef ENABLE_USB_CONNECTION
+    #include "ConnectionUSB.h"
+#endif
+#ifdef ENABLE_SPI_CONNECTION
+    #include "ConnectionSPI.h"
+#endif
+
+#include <sstream>
+#include <iomanip>
+#include <iostream>
+
+/** @brief Creates connection interfaces
+*/
+ConnectionManager::ConnectionManager(const IConnection::eConnectionType port_type) : activeControlPort(NULL)
+{
+    mLogData = false;
+    mOpenedDevice = -1;
+    if (port_type == IConnection::COM_PORT)
+        m_connections[IConnection::COM_PORT] = new ConnectionCOM();
+#ifdef ENABLE_USB_CONNECTION
+    if (port_type == IConnection::USB_PORT)
+        m_connections[IConnection::USB_PORT] = new ConnectionUSB();
+#endif
+#ifdef ENABLE_SPI_CONNECTION
+    m_connections[IConnection::SPI_PORT] = new ConnectionSPI();
+#endif
+}
+
+/** @brief Destroys connection interfaces
+*/
+ConnectionManager::~ConnectionManager()
+{
+	for (auto iter = m_connections.begin(); iter != m_connections.end(); ++iter)
+	{
+		delete iter->second;
+	}
+}
+
+/** @brief Checks if connection to device is opened
+    @return True if device is connected
+*/
+bool ConnectionManager::IsOpen()
+{
+    return activeControlPort ? activeControlPort->IsOpen() : false;
+}
+
+/** @brief Opens connection to first available device
+    @return True if connected to device
+*/
+bool ConnectionManager::Open()
+{
+    return Open(0);
+}
+
+/** @brief Connects to selected device
+    @param i device index from device list
+    @return 1:Success, 0:failure
+*/
+int ConnectionManager::Open(unsigned i)
+{
+    if(i >= mDevices.size())
+        return 0;
+
+    if(activeControlPort)
+        activeControlPort->Close();
+    switch(mDevices[i].port)
+    {
+    case IConnection::COM_PORT:
+        activeControlPort = m_connections[IConnection::COM_PORT];
+        break;
+    case IConnection::USB_PORT:
+		activeControlPort = m_connections[IConnection::USB_PORT];
+        break;
+    case IConnection::SPI_PORT:
+		activeControlPort = m_connections[IConnection::SPI_PORT];
+        break;
+    default:
+        return 0;
+    }
+    mOpenedDevice = -1;
+    if( i < mDevices.size() )
+    {
+        if (activeControlPort->Open(mDevices[i].portIndex) == IConnection::SUCCESS)
+        {
+            mOpenedDevice = i;
+            return 1;
+        }
+    }
+    return 0;
+}
+
+/** @brief Closes connection to device
+*/
+void ConnectionManager::Close()
+{
+    if(activeControlPort)
+    {
+        activeControlPort->Close();
+		//Notify(LMS_Message(MSG_BOARD_DISCONNECTED, "", 0, 0));
+    }
+    mOpenedDevice = -1;
+}
+
+/** @brief Finds all currently connected devices and forms device list
+    @return number of devices found
+*/
+int ConnectionManager::RefreshDeviceList()
+{
+    mDeviceList.clear();
+    mDevices.clear();
+    DeviceInfo dev;
+    for (auto iter = m_connections.begin(); iter != m_connections.end(); ++iter)
+    {
+        vector<string> names;
+        IConnection *port = iter->second;
+        if(port->RefreshDeviceList() > 0)
+        {
+            names = port->GetDeviceNames();
+            for(unsigned i=0; i<names.size(); ++i)
+            {
+                dev.name = names[i];
+                dev.port = iter->first;
+                dev.portIndex = i;
+                mDevices.push_back(dev);
+            }
+        }
+    }
+    for(unsigned i=0; i<mDevices.size(); ++i)
+        mDeviceList.push_back(mDevices[i].name);
+    return mDevices.size();
+}
+
+/** @brief Returns currently opened connection index
+*/
+int ConnectionManager::GetOpenedIndex()
+{
+    return mOpenedDevice;
+}
+
+/** @brief Writes given data to currently opened connection
+    @param buffer outcomming data buffer
+    @param length bytes to write
+    @param timeout_ms timeout in milliseconds
+    @return number of bytes written, on failure negative values
+*/
+int ConnectionManager::Write(const unsigned char *buffer, const int length, int timeout_ms)
+{
+    if(activeControlPort)
+    {
+        int bytesTransferred = activeControlPort->Write(buffer, length, timeout_ms);
+#ifndef NDEBUG
+        if(mLogData)
+        {
+            stringstream ss;
+            ss << "WR(" <<  (bytesTransferred>=0?bytesTransferred: 0) << "): ";
+            ss << std::hex << std::setfill('0');
+            int repeatedZeros = 0;
+            for(int i=length-1; i>=0; --i)
+                if(buffer[i] == 0)
+                    ++repeatedZeros;
+                else break;
+            if(repeatedZeros == 1)
+                repeatedZeros = 0;
+            repeatedZeros = repeatedZeros - (repeatedZeros & 0x1);
+            for(int i=0; i<length-repeatedZeros; ++i)
+                //casting to short to print as numbers
+                ss << " " << std::setw(2) << (unsigned short)buffer[i];
+            if(repeatedZeros > 1)
+                ss << " (00 x " << std::dec << repeatedZeros << " times)";
+            cout << ss.str() << endl;
+#ifndef __unix__
+            OutputDebugString(ss.str().c_str());
+#endif
+        }
+#endif
+        return bytesTransferred;
+    }
+    return -1;
+}
+
+/** @brief Receives data from currently opened connection
+    @param buffer incomming data buffer, must be big enough for length bytes
+    @param length bytes to read
+    @param timeout_ms timeout in milliseconds
+    @return number of bytes received
+*/
+int ConnectionManager::Read(unsigned char *buffer, int length, int timeout_ms)
+{
+    if(activeControlPort)
+    {
+        int bytesTransferred = activeControlPort->Read(buffer, length, timeout_ms);
+#ifndef NDEBUG
+        if(mLogData)
+        {
+            stringstream ss;
+            ss << "RD(" <<  (bytesTransferred>=0?bytesTransferred: 0) << "): ";
+            ss << std::hex << std::setfill('0');
+            int repeatedZeros = 0;
+            for(int i=length-1; i>=0; --i)
+                if(buffer[i] == 0)
+                    ++repeatedZeros;
+                else break;
+            if(repeatedZeros == 2)
+                repeatedZeros = 0;
+            repeatedZeros = repeatedZeros - (repeatedZeros & 0x1);
+            for(int i=0; i<length-repeatedZeros; ++i)
+                //casting to short to print as numbers
+                ss << " " << std::setw(2) << (unsigned short)buffer[i];
+            if(repeatedZeros > 2)
+                ss << " (00 x " << std::dec << repeatedZeros << " times)";
+            cout << ss.str() << endl;
+        }
+#endif
+        return bytesTransferred;
+    }
+    return -1;
+}
+
+int ConnectionManager::WriteStream(const char *buffer, int length)
+{
+	return 0;
+}
+
+int ConnectionManager::ReadStream(char *buffer, int length, unsigned int timeout_ms)
+{
+	/*int handle = activeControlPort->BeginDataReading(buffer, length);
+    activeControlPort->WaitForReading(handle, timeout_ms);
+	long received = length;
+	activeControlPort->FinishDataReading(buffer, received, handle);
+	return received;
+    */
+    long len = length;
+    int status = activeControlPort->ReadDataBlocking(buffer, len, 0);
+    return len;
+}
+
+
+int ConnectionManager::BeginDataReading(char *buffer, long length)
+{
+    return activeControlPort->BeginDataReading(buffer, length);
+}
+/**
+@brief Blocks until data is received or set number of milliseconds have passed.
+@param contextHandle handle returned by BeginDataReading()
+@param timeout_ms number of milliseconds to wait
+@return 1-data received, 0-data not received
+*/
+int ConnectionManager::WaitForReading(int contextHandle, unsigned int timeout_ms)
+{
+    return activeControlPort->WaitForReading(contextHandle, timeout_ms);
+}
+/**
+@brief Finished asynchronous data reading.
+@param buffer where to put received data
+@param length number of bytes to read, will be changed to actual number of bytes received
+@param contextHandle context handle returned by BeginDataReading()
+@return received data length
+*/
+int ConnectionManager::FinishDataReading(char *buffer, long &length, int contextHandle)
+{
+    return activeControlPort->FinishDataReading(buffer, length, contextHandle);
+}
+
+/**
+@brief Aborts reading operations
+*/
+void ConnectionManager::AbortReading()
+{
+    activeControlPort->AbortReading();
+}
+
+/**
+@brief Start asynchronous data sending.
+@param buffer data buffer to be sent
+@param length number of bytes to send.
+@return context handle
+*/
+int ConnectionManager::BeginDataSending(const char *buffer, long length)
+{
+    return activeControlPort->BeginDataSending(buffer, length);
+}
+/**
+@brief Blocks until data is sent or set number of miliseconds have passed.
+@param contextHandle handle returned by BeginDataReading()
+@param timeout_ms number of miliseconds to wait
+@return 1-data sent, 0-data not sent
+*/
+int ConnectionManager::WaitForSending(int contextHandle, unsigned int timeout_ms)
+{
+    return activeControlPort->WaitForSending(contextHandle, timeout_ms);
+}
+/**
+@brief Finished asynchronous data sending.
+@param buffer where to put received data
+@param length number of bytes to send, will be changed to actual number of bytes sent
+@param contextHandle context handle returned by BeginDataReading()
+@return sent data length
+*/
+int ConnectionManager::FinishDataSending(const char *buffer, long &length, int contextHandle)
+{
+    return activeControlPort->FinishDataSending(buffer, length, contextHandle);
+}
+
+/**
+@brief Aborts sending operations
+*/
+void ConnectionManager::AbortSending()
+{
+    activeControlPort->AbortSending();
+}
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionManager.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionManager.h
new file mode 100644
index 0000000000000000000000000000000000000000..68819011ffaca85af49acc67956937144f8dab36
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionManager.h
@@ -0,0 +1,60 @@
+/**
+    @file ConnectionManager.h
+    @author Lime Microsystems (www.limemicro.com)
+    @brief Class for managing connection to devices
+*/
+
+#ifndef LMS_CONNECTION_MANAGER_H
+#define LMS_CONNECTION_MANAGER_H
+
+#include "IConnection.h"
+#include <map>
+
+class ConnectionManager
+{
+public:
+    struct DeviceInfo
+    {
+        std::string name;
+        IConnection::eConnectionType port;
+        int portIndex;
+    };
+
+    ConnectionManager(const IConnection::eConnectionType port_type);
+    ~ConnectionManager();
+    bool IsOpen();
+    bool Open();
+    int Open(unsigned i);
+    void Close();
+    int RefreshDeviceList();
+    int GetOpenedIndex();
+    std::vector<std::string> GetDeviceList(){return mDeviceList;};
+
+    int Write(const unsigned char *buffer, int length, int timeout_ms = 0);
+	int Read(unsigned char *buffer, int length, int timeout_ms = 0);
+
+	int WriteStream(const char *buffer, int length);
+	int ReadStream(char *buffer, int length, unsigned int timeout_ms);
+
+    int BeginDataReading(char *buffer, long length);
+    int WaitForReading(int contextHandle, unsigned int timeout_ms);
+    int FinishDataReading(char *buffer, long &length, int contextHandle);
+    void AbortReading();
+
+    int BeginDataSending(const char *buffer, long length);
+    int WaitForSending(int contextHandle, unsigned int timeout_ms);
+    int FinishDataSending(const char *buffer, long &length, int contextHandle);
+    void AbortSending();
+
+protected:
+    bool mLogData;
+    /// Port used for communication.
+	IConnection *activeControlPort;
+    std::vector<DeviceInfo> mDevices;
+    std::vector<std::string> mDeviceList;
+    int mOpenedDevice;
+    std::map<IConnection::eConnectionType, IConnection*> m_connections;
+};
+
+#endif // LMS_CONNECTION_MANAGER_H
+
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionSPI.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionSPI.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..fb305f9c1ccfe627c70006f96d84dbc758310056
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionSPI.cpp
@@ -0,0 +1,313 @@
+/**
+    @file   ConnectionSPI.cpp
+    @author Lime Microsystems (www.limemicro.com)
+    @brief  Implementation of communications through SPI port
+*/
+
+#include "ConnectionSPI.h"
+
+#include "string.h"
+#ifdef __unix__
+#include <fstream>
+#include <errno.h>
+#include <unistd.h>
+#include <termios.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/ioctl.h>
+#include <linux/types.h>
+#include <linux/spi/spidev.h>
+#include <linux/i2c-dev.h>
+#endif // LINUX
+
+#include <iostream>
+#include <sstream>
+
+const int ConnectionSPI::cSPI_BUF_SIZE = 128;
+const int ConnectionSPI::cSPI_SPEED_HZ = 2000000;
+
+/** @brief Tries to read EEPROM for Novena board signature
+    @return true if Novena board
+*/
+bool IsNovenaBoard()
+{
+#ifdef __unix__
+    char data[8];
+    int count = 6;
+    memset(data, 0, 8);
+    int addr = 0;
+    struct i2c_rdwr_ioctl_data session;
+    struct i2c_msg messages[2];
+    char set_addr_buf[2];
+    memset(set_addr_buf, 0, sizeof(set_addr_buf));
+    memset(data, 0, count);
+    set_addr_buf[0] = addr>>8;
+    set_addr_buf[1] = addr;
+    messages[0].addr = 0xac>>1;
+    messages[0].flags = 0;
+    messages[0].len = sizeof(set_addr_buf);
+    messages[0].buf = set_addr_buf;
+    messages[1].addr = 0xac>>1;
+    messages[1].flags = I2C_M_RD;
+    messages[1].len = count;
+    messages[1].buf = data;
+    session.msgs = messages;
+    session.nmsgs = 2;
+
+    bool isNovena = false;
+
+    int fd = open("/dev/i2c-2", O_RDWR);
+    if(fd > 0)
+    {
+        if(ioctl(fd, I2C_RDWR, &session) < 0)
+        {
+            perror("Unable to communicate with i2c device");
+            isNovena = false;
+        }
+        if(strcmp("Novena", data) == 0)
+            isNovena = true;
+    }
+    close(fd);
+    return isNovena;
+#else
+    return false;
+#endif
+}
+
+/** @brief Initializes SPI port and exports needed GPIO
+*/
+ConnectionSPI::ConnectionSPI()
+{
+    fd = -1;
+    m_connectionType = SPI_PORT;
+    std::fstream gpio;
+    //export SEN pin
+    gpio.open("/sys/class/gpio/export", ios::out);
+    if(gpio.good())
+    {
+        gpio << 122;
+        gpio.flush();
+        gpio.close();
+        gpio.open("/sys/class/gpio/gpio122/direction", ios::out);
+        gpio << "out";
+        gpio.flush();
+        gpio.close();
+        m_SEN.open("/sys/class/gpio/gpio122/value", ios::out);
+        m_SEN<< 1;
+        m_SEN.flush();
+        cout << "GPIO122: set to 1" << endl;
+    }
+}
+
+ConnectionSPI::~ConnectionSPI()
+{
+    Close();
+    m_SEN.close();
+}
+
+/** @brief Opens connection to first found chip
+    @return 0-success
+*/
+IConnection::DeviceStatus ConnectionSPI::Open()
+{
+	Close();
+#ifdef __unix__
+	fd = open("/dev/spidev2.0", O_RDWR | O_SYNC);
+	if (fd < 0)
+	{
+        //MessageLog::getInstance()->write("SPI PORT: device not found\n", LOG_ERROR);
+		return IConnection::FAILURE;
+	}
+	int mode = SPI_MODE_0;
+	int ret = ioctl(fd, SPI_IOC_WR_MODE, &mode);
+	if (ret == -1)
+		printf("can't set spi mode");
+
+	ret = ioctl(fd, SPI_IOC_RD_MODE, &mode);
+	if (ret == -1)
+		printf("can't get spi mode");
+
+	/*
+	 * bits per word
+	 */
+    int bits = 8;
+	ret = ioctl(fd, SPI_IOC_WR_BITS_PER_WORD, &bits);
+	if (ret == -1)
+		printf("can't set bits per word");
+
+	ret = ioctl(fd, SPI_IOC_RD_BITS_PER_WORD, &bits);
+	if (ret == -1)
+		printf("can't get bits per word");
+
+	/*
+	 * max speed hz
+	 */
+	int speed = cSPI_SPEED_HZ;
+	ret = ioctl(fd, SPI_IOC_WR_MAX_SPEED_HZ, &speed);
+	if (ret == -1)
+		printf("can't set max speed hz");
+
+	ret = ioctl(fd, SPI_IOC_RD_MAX_SPEED_HZ, &speed);
+	if (ret == -1)
+		printf("can't get max speed hz");
+
+	printf("spi mode: 0x%x\n", mode);
+	printf("bits per word: %d\n", bits);
+	printf("max speed: %d Hz (%d KHz)\n", speed, speed/1000);
+    return IConnection::SUCCESS;
+#else
+    return IConnection::FAILURE;
+#endif
+}
+
+/** @brief Opens connection to selected chip
+    @param index chip index in device list
+    @return 0-success
+*/
+IConnection::DeviceStatus ConnectionSPI::Open(unsigned index)
+{
+    return Open();
+}
+
+/** @brief Closes connection to chip
+*/
+void ConnectionSPI::Close()
+{
+#ifdef __unix__
+    close(fd);
+    fd = -1;
+#endif
+}
+
+/** @brief Returns whether chip is connected
+    @return chip is connected
+*/
+bool ConnectionSPI::IsOpen()
+{
+    return (fd >= 0);
+}
+
+/** @brief Sends data through COM port
+    @param buffer data buffer to send
+    @param length size of data buffer
+    @param timeout_ms timeout limit for operation in milliseconds
+    @return Number of bytes sent
+*/
+int ConnectionSPI::Write(const unsigned char *buffer, int length, int timeout_ms)
+{
+    #ifdef __unix__
+    if(fd < 0)
+        return 0;
+    m_SEN << 0;
+    m_SEN.flush();
+    unsigned long bytesWritten = 0;
+    rxbuf.clear();
+    int bytesReceived = 0;
+    char rxbytes[2];
+    while(bytesWritten < length)
+    {
+        int toWrite = length-bytesWritten > cSPI_BUF_SIZE ? cSPI_BUF_SIZE : length-bytesWritten;
+        for(int i=0; i<toWrite; i+=2)
+        {
+            if(buffer[i] < 0x80) //reading
+            {
+                write(fd, &buffer[i+bytesWritten], 2);
+                bytesReceived += read(fd, rxbytes, 2);
+                rxbuf.push_back(rxbytes[0]);
+                rxbuf.push_back(rxbytes[1]);
+            }
+            else //writing
+            {
+                write(fd, &buffer[i+bytesWritten], 4);
+                i+=2; //data bytes have been written
+            }
+        }
+//        stringstream ss;
+//        ss << "write(" << toWrite << "): ";
+//        for(int i=0; i<toWrite; ++i)
+//        {
+//            char ctemp[16];
+//            sprintf(ctemp, "%02X", buffer[bytesWritten+i]);
+//            ss << ctemp << " ";
+//        }
+//        ss << endl;
+//        if(bytesReceived > 0)
+//        {
+//            ss << " re443ad(" << toWrite << "): ";
+//            for(int i=0; i<toWrite; ++i)
+//            {
+//                char ctemp[16];
+//                sprintf(ctemp, "%02X", rxbuf[bytesWritten+i]);
+//                ss << ctemp << " ";
+//            }
+//            ss << endl;
+//        }
+//        cout << ss.str() << endl;
+//        MessageLog::getInstance()->write(ss.str(), LOG_DATA);
+
+        bytesWritten += toWrite;
+    }
+    m_SEN << 1;
+    m_SEN.flush();
+    return bytesWritten;
+#else
+    return 0;
+#endif
+}
+
+/** @brief Reads data from COM port
+    @param buffer pointer to data buffer for receiving
+    @param length number of bytes to read
+    @param timeout_ms timeout limit for operation in milliseconds
+    @return Number of bytes received
+*/
+int ConnectionSPI::Read(unsigned char *buffer, int length, int timeout_ms)
+{
+#ifdef __unix__
+    if(fd < 0)
+        return 0;
+    //because transfer is done in full duplex, function returns data from last transfer
+    int tocpy = length > rxbuf.size() ? rxbuf.size() : length;
+    memcpy(buffer, &rxbuf[0], tocpy);
+    rxbuf.clear();
+    return tocpy;
+#else
+    return 0;
+#endif
+}
+
+/** @brief Finds all chips connected to com ports
+    @return number of devices found
+*/
+int ConnectionSPI::RefreshDeviceList()
+{
+    m_deviceNames.clear();
+#ifdef __unix__
+    int spidev = open("/dev/spidev2.0", O_RDWR);
+	if (spidev >= 0)
+	{
+	    if(IsNovenaBoard() == true)
+            m_deviceNames.push_back("SPI (Novena)");
+        else
+            m_deviceNames.push_back("SPI");
+	}
+    close(spidev);
+#endif
+    return m_deviceNames.size();
+}
+
+/** @brief Returns found devices names
+    @return vector of device names
+*/
+vector<string> ConnectionSPI::GetDeviceNames()
+{
+    return m_deviceNames;
+}
+
+int ConnectionSPI::GetOpenedIndex()
+{
+    return 0;
+}
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionSPI.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionSPI.h
new file mode 100644
index 0000000000000000000000000000000000000000..79d9bd9b9b690c470f156acfb1ebdd2a11e0b4ae
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionSPI.h
@@ -0,0 +1,41 @@
+/**
+@file   ConnectionSPI.h
+@author Lime Microsystems (www.limemicro.com)
+@brief  Class for data communications through SPI port
+*/
+
+#ifndef CONNECTION_SPI_PORT_H
+#define CONNECTION_SPI_PORT_H
+
+#include "IConnection.h"
+#include <fstream>
+#include <string>
+#include <vector>
+
+class ConnectionSPI : public IConnection
+{
+public:
+    static const int cSPI_BUF_SIZE;
+    static const int cSPI_SPEED_HZ;
+
+	ConnectionSPI();
+	~ConnectionSPI();
+
+	DeviceStatus Open();
+	DeviceStatus Open(unsigned i);
+	void Close();
+	bool IsOpen();
+	int GetOpenedIndex();
+
+	int Write(const unsigned char *buffer, int length, int timeout_ms = 0);
+	int Read(unsigned char *buffer, int length, int timeout_ms = 0);
+
+	std::vector<std::string> GetDeviceNames();
+	int RefreshDeviceList();
+protected:
+    std::vector<std::string> m_deviceNames;
+	std::vector<unsigned char> rxbuf;
+    int fd;
+    std::fstream m_SEN;
+};
+#endif
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionUSB.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionUSB.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..148b7b776bc776c8ac5f7fbd2bb1bc923a98dbb4
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionUSB.cpp
@@ -0,0 +1,771 @@
+/**
+@file   ConnectionUSB.cpp
+@author Lime Microsystems (www.limemicro.com)
+@brief  Data writing and reading through USB port
+*/
+
+#include "ConnectionUSB.h"
+#include <string.h>
+
+#ifdef __unix__
+    #include <thread>
+    #include <chrono>
+#endif
+
+#define USB_TIMEOUT 1000
+
+#define HW_LDIGIRED L"DigiRed"
+#define HW_LDIGIGREEN L"DigiGreen"
+#define HW_LSTREAMER L"Stream"
+
+#define HW_DIGIRED "DigiRed"
+#define HW_DIGIGREEN "DigiGreen"
+#define HW_STREAMER "Stream"
+
+#define CTR_W_REQCODE 0xC1
+#define CTR_W_VALUE 0x0000
+#define CTR_W_INDEX 0x0000
+
+#define CTR_R_REQCODE 0xC0
+#define CTR_R_VALUE 0x0000
+#define CTR_R_INDEX 0x0000
+
+/**	@brief Initializes port type and object necessary to communicate to usb device.
+*/
+ConnectionUSB::ConnectionUSB()
+{
+    m_hardwareName = "";
+    isConnected = false;
+    m_connectionType = USB_PORT;
+#ifndef __unix__
+    USBDevicePrimary = new CCyUSBDevice(NULL);
+    OutCtrEndPt = NULL;
+    InCtrEndPt = NULL;
+	InCtrlEndPt3 = NULL;
+	OutCtrlEndPt3 = NULL;
+#else
+    dev_handle = 0;
+    devs = 0;
+    int r = libusb_init(&ctx); //initialize the library for the session we just declared
+    if(r < 0)
+        printf("Init Error %i\n", r); //there was an error
+    libusb_set_debug(ctx, 3); //set verbosity level to 3, as suggested in the documentation
+#endif
+    currentDeviceIndex = -1;
+}
+
+/**	@brief Closes connection to chip and deallocates used memory.
+*/
+ConnectionUSB::~ConnectionUSB()
+{
+    Close();
+#ifndef __unix__
+    delete USBDevicePrimary;
+#else
+    libusb_exit(ctx);
+#endif
+}
+
+/**	@brief Automatically open first available chip connected to usb port.
+	@return 0-success, other-failure
+*/
+IConnection::DeviceStatus ConnectionUSB::Open()
+{
+    currentDeviceIndex = -1;
+    if(m_deviceNames.size() == 0)
+        RefreshDeviceList();
+
+#ifndef __unix__
+    for(int i=0; i<USBDevicePrimary->DeviceCount(); ++i)
+        if( Open(i) == SUCCESS)
+        {
+            currentDeviceIndex = i;
+            return SUCCESS;
+        }
+#else
+    if(Open(0) == SUCCESS)
+        return SUCCESS;
+#endif
+    return FAILURE;
+}
+
+/**	@brief Tries to open connected USB device and find communication endpoints.
+	@return Returns 1-Success, 0-EndPoints not found or device didn't connect.
+*/
+IConnection::DeviceStatus ConnectionUSB::Open(unsigned index)
+{
+#ifndef __unix__
+	wstring m_hardwareDesc = L"";
+	if( index < USBDevicePrimary->DeviceCount())
+	{
+		if(USBDevicePrimary->Open(index))
+		{
+            m_hardwareDesc = USBDevicePrimary->Product;
+            unsigned int pos;
+            //determine connected board type
+            pos = m_hardwareDesc.find(HW_LDIGIRED, 0);
+            if( pos != wstring::npos )
+                m_hardwareName = HW_DIGIRED;
+            else if (m_hardwareDesc.find(HW_LSTREAMER, 0) != wstring::npos)
+                m_hardwareName = HW_STREAMER;
+            else
+				m_hardwareName = HW_STREAMER;
+
+
+			if (InCtrlEndPt3)
+			{
+				delete InCtrlEndPt3;
+				InCtrlEndPt3 = NULL;
+			}
+			InCtrlEndPt3 = new CCyControlEndPoint(*USBDevicePrimary->ControlEndPt);
+
+			if (OutCtrlEndPt3)
+			{
+				delete OutCtrlEndPt3;
+				OutCtrlEndPt3 = NULL;
+			}
+			OutCtrlEndPt3 = new CCyControlEndPoint(*USBDevicePrimary->ControlEndPt);
+
+			InCtrlEndPt3->ReqCode = CTR_R_REQCODE;
+			InCtrlEndPt3->Value = CTR_R_VALUE;
+			InCtrlEndPt3->Index = CTR_R_INDEX;
+
+			OutCtrlEndPt3->ReqCode = CTR_W_REQCODE;
+			OutCtrlEndPt3->Value = CTR_W_VALUE;
+			OutCtrlEndPt3->Index = CTR_W_INDEX;
+
+			for (int i=0; i<USBDevicePrimary->EndPointCount(); i++)
+				if(USBDevicePrimary->EndPoints[i]->Address == 0x01)
+				{
+					OutEndPt = USBDevicePrimary->EndPoints[i];
+					long len = OutEndPt->MaxPktSize * 64;
+					OutEndPt->SetXferSize(len);
+					break;
+				}
+			for (int i=0; i<USBDevicePrimary->EndPointCount(); i++)
+				if(USBDevicePrimary->EndPoints[i]->Address == 0x81)
+				{
+					InEndPt = USBDevicePrimary->EndPoints[i];
+					long len = InEndPt->MaxPktSize * 64;
+					InEndPt->SetXferSize(len);
+					break;
+				}
+			isConnected = true;
+			return SUCCESS;
+		} //successfully opened device
+	} //if has devices
+    return FAILURE;
+#else
+    if(index >= 0 && index < m_dev_pid_vid.size())
+    {
+		dev_handle = libusb_open_device_with_vid_pid(ctx, m_dev_pid_vid[index].second, m_dev_pid_vid[index].first);
+
+		if(dev_handle == 0)
+            return FAILURE;
+        if(libusb_kernel_driver_active(dev_handle, 0) == 1)   //find out if kernel driver is attached
+        {
+            printf("Kernel Driver Active\n");
+            if(libusb_detach_kernel_driver(dev_handle, 0) == 0) //detach it
+                printf("Kernel Driver Detached!\n");
+        }
+        int r = libusb_claim_interface(dev_handle, 0); //claim interface 0 (the first) of device
+        if(r < 0)
+        {
+            printf("Cannot Claim Interface\n");
+            return CANNOT_CLAIM_INTERFACE;
+        }
+        printf("Claimed Interface\n");
+        isConnected = true;
+        return SUCCESS;
+    }
+    else
+    {
+        return FAILURE;
+    }
+#endif
+}
+
+/**	@brief Closes communication to device.
+*/
+void ConnectionUSB::Close()
+{
+    #ifndef __unix__
+	USBDevicePrimary->Close();
+	InEndPt = NULL;
+	OutEndPt = NULL;
+	if (InCtrlEndPt3)
+	{
+		delete InCtrlEndPt3;
+		InCtrlEndPt3 = NULL;
+	}
+	if (OutCtrlEndPt3)
+	{
+		delete OutCtrlEndPt3;
+		OutCtrlEndPt3 = NULL;
+	}
+    #else
+    if(dev_handle != 0)
+    {
+        libusb_release_interface(dev_handle, 0);
+        libusb_close(dev_handle);
+        dev_handle = 0;
+    }
+    #endif
+    isConnected = false;
+}
+
+/**	@brief Returns connection status
+	@return 1-connection open, 0-connection closed.
+*/
+bool ConnectionUSB::IsOpen()
+{
+    #ifndef __unix__
+    return USBDevicePrimary->IsOpen() && isConnected;
+    #else
+    return isConnected;
+    #endif
+}
+
+/**	@brief Sends given data buffer to chip through USB port.
+	@param buffer data buffer, must not be longer than 64 bytes.
+	@param length given buffer size.
+    @param timeout_ms timeout limit for operation in milliseconds
+	@return number of bytes sent.
+*/
+int ConnectionUSB::Write(const unsigned char *buffer, const int length, int timeout_ms)
+{
+    long len = length;
+    if(IsOpen())
+    {
+		unsigned char* wbuffer = new unsigned char[length];
+		memcpy(wbuffer, buffer, length);
+        if(m_hardwareName == HW_DIGIRED || m_hardwareName == HW_STREAMER)
+        {
+            #ifndef __unix__
+            if(OutCtrlEndPt3)
+                OutCtrlEndPt3->Write(wbuffer, len);
+            else
+                len = 0;
+            #else
+                len = libusb_control_transfer(dev_handle, LIBUSB_REQUEST_TYPE_VENDOR,CTR_W_REQCODE ,CTR_W_VALUE, CTR_W_INDEX, wbuffer, length, USB_TIMEOUT);
+            #endif
+        }
+        else
+        {
+            #ifndef __unix__
+            if(OutCtrEndPt)
+                OutCtrEndPt->XferData(wbuffer, len);
+            else
+                len = 0;
+            #else
+                int actual = 0;
+                libusb_bulk_transfer(dev_handle, 0x01, wbuffer, len, &actual, USB_TIMEOUT);
+                len = actual;
+            #endif
+        }
+		delete wbuffer;
+    }
+    else
+        return 0;
+    return len;
+}
+
+/**	@brief Reads data coming from the chip through USB port.
+	@param buffer pointer to array where received data will be copied, array must be
+	big enough to fit received data.
+	@param length number of bytes to read from chip.
+    @param timeout_ms timeout limit for operation in milliseconds
+	@return number of bytes received.
+*/
+int ConnectionUSB::Read(unsigned char *buffer, const int length, int timeout_ms)
+{
+    long len = length;
+    if(IsOpen())
+    {
+        if(m_hardwareName == HW_DIGIRED || m_hardwareName == HW_STREAMER)
+        {
+            #ifndef __unix__
+            if(InCtrlEndPt3)
+                InCtrlEndPt3->Read(buffer, len);
+            else
+                len = 0;
+            #else
+            len = libusb_control_transfer(dev_handle, LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_ENDPOINT_IN ,CTR_R_REQCODE ,CTR_R_VALUE, CTR_R_INDEX, buffer, len, USB_TIMEOUT);
+            #endif
+        }
+        else
+        {
+            #ifndef __unix__
+            if(InCtrEndPt)
+                InCtrEndPt->XferData(buffer, len);
+            else
+                len = 0;
+            #else
+                int actual = 0;
+                libusb_bulk_transfer(dev_handle, 0x81, buffer, len, &actual, USB_TIMEOUT);
+                len = actual;
+            #endif
+        }
+    }
+    return len;
+}
+
+#ifdef __unix__
+/**	@brief Function for handling libusb callbacks
+*/
+void callback_libusbtransfer(libusb_transfer *trans)
+{
+	USBTransferContext *context = reinterpret_cast<USBTransferContext*>(trans->user_data);
+	switch(trans->status)
+	{
+    case LIBUSB_TRANSFER_CANCELLED:
+        printf("Transfer canceled\n" );
+        context->bytesXfered = trans->actual_length;
+        context->done = true;
+        context->used = false;
+        context->reset();
+        break;
+    case LIBUSB_TRANSFER_COMPLETED:
+        if(trans->actual_length == context->bytesExpected)
+		{
+			context->bytesXfered = trans->actual_length;
+			context->done = true;
+		}
+		//printf("Transfer complete %i\n", trans->actual_length);
+        break;
+    case LIBUSB_TRANSFER_ERROR:
+        printf("TRANSFER ERRRO\n");
+        break;
+    case LIBUSB_TRANSFER_TIMED_OUT:
+        printf("transfer timed out\n");
+
+        break;
+    case LIBUSB_TRANSFER_OVERFLOW:
+        printf("transfer overflow\n");
+
+        break;
+    case LIBUSB_TRANSFER_STALL:
+        printf("transfer stalled\n");
+        break;
+	}
+    context->mPacketProcessed.notify_one();
+}
+#endif
+
+/** @brief Finds all chips connected to usb ports
+    @return number of devices found
+*/
+int ConnectionUSB::RefreshDeviceList()
+{
+    #ifndef __unix__
+    USBDevicePrimary->Close();
+    currentDeviceIndex = -1;
+    m_deviceNames.clear();
+    string name;
+    if (USBDevicePrimary->DeviceCount())
+    {
+        for (int i=0; i<USBDevicePrimary->DeviceCount(); ++i)
+        {
+            Open(i);
+            name = DeviceName();
+            m_deviceNames.push_back(name);
+        }
+        currentDeviceIndex = -1;
+    }
+    #else
+    m_dev_pid_vid.clear();
+    m_deviceNames.clear();
+    int usbDeviceCount = libusb_get_device_list(ctx, &devs);
+    if(usbDeviceCount > 0)
+    {
+        libusb_device_descriptor desc;
+        for(int i=0; i<usbDeviceCount; ++i)
+        {
+            int r = libusb_get_device_descriptor(devs[i], &desc);
+            if(r<0)
+                printf("failed to get device description\n");
+            int pid = desc.idProduct;
+            int vid = desc.idVendor;
+
+            if( vid == 1204)
+            {
+                if(pid == 34323)
+                {
+                    m_hardwareName = HW_DIGIGREEN;
+                    m_deviceNames.push_back("DigiGreen");
+                    m_dev_pid_vid.push_back( pair<int,int>(pid,vid));
+                }
+                else if(pid == 241)
+                {
+                    m_hardwareName = HW_DIGIRED;
+                    libusb_device_handle *tempDev_handle;
+                    tempDev_handle = libusb_open_device_with_vid_pid(ctx, vid, pid);
+                    if(libusb_kernel_driver_active(tempDev_handle, 0) == 1)   //find out if kernel driver is attached
+                    {
+                        if(libusb_detach_kernel_driver(tempDev_handle, 0) == 0) //detach it
+                            printf("Kernel Driver Detached!\n");
+                    }
+                    if(libusb_claim_interface(tempDev_handle, 0) < 0) //claim interface 0 (the first) of device
+                    {
+                        printf("Cannot Claim Interface\n");
+                    }
+
+                    string fullName;
+                    //check operating speed
+                    int speed = libusb_get_device_speed(devs[i]);
+                    if(speed == LIBUSB_SPEED_HIGH)
+                        fullName = "USB 2.0";
+                    else if(speed == LIBUSB_SPEED_SUPER)
+                        fullName = "USB 3.0";
+                    else
+                        fullName = "USB";
+                    fullName += " (";
+                    //read device name
+                    char data[255];
+                    memset(data, 0, 255);
+                    int st = libusb_get_string_descriptor_ascii(tempDev_handle, 2, (unsigned char*)data, 255);
+                    if(strlen(data) > 0)
+                        fullName += data;
+                    fullName += ")";
+                    libusb_close(tempDev_handle);
+
+                    m_deviceNames.push_back(fullName);
+                    m_dev_pid_vid.push_back( pair<int,int>(pid,vid));
+                }
+            }
+        }
+    }
+    else
+    {
+        libusb_free_device_list(devs, 1);
+        return 0;
+    }
+    #endif
+    return m_deviceNames.size();
+}
+
+void ConnectionUSB::ClearComm()
+{
+}
+
+/**	@return name of currently opened device as string.
+*/
+string ConnectionUSB::DeviceName()
+{
+#ifndef __unix__
+	string name;
+	char tempName[USB_STRING_MAXLEN];
+	//memcpy(tempName, USBDevicePrimary->FriendlyName, USB_STRING_MAXLEN);
+    //name = tempName;
+
+	for (int i = 0; i < USB_STRING_MAXLEN; ++i)
+		tempName[i] = USBDevicePrimary->DeviceName[i];
+    if (USBDevicePrimary->bSuperSpeed == true)
+        name = "USB 3.0";
+    else if (USBDevicePrimary->bHighSpeed == true)
+        name = "USB 2.0";
+    else
+        name = "USB";
+    name += " (";
+	name += tempName;
+	name += ")";
+    return name;
+#else
+    if(dev_handle != 0)
+    {
+        char data[255];
+        int st = libusb_get_string_descriptor_ascii(dev_handle, 2, (unsigned char*)data, 255);
+        return string(data);
+    }
+    return "no name";
+#endif
+}
+
+/**
+	@brief Starts asynchronous data reading from board
+	@param *buffer buffer where to store received data
+	@param length number of bytes to read
+	@return handle of transfer context
+*/
+int ConnectionUSB::BeginDataReading(char *buffer, long length)
+{
+    int i = 0;
+	bool contextFound = false;
+	//find not used context
+    for(i = 0; i<USB_MAX_CONTEXTS; i++)
+    {
+        if(!contexts[i].used)
+        {
+            contextFound = true;
+            break;
+        }
+    }
+    if(!contextFound)
+        return -1;
+    contexts[i].used = true;
+    #ifndef __unix__
+    if(InEndPt)
+        contexts[i].context = InEndPt->BeginDataXfer((unsigned char*)buffer, length, contexts[i].inOvLap);
+	return i;
+    #else
+    unsigned int Timeout = 1000;
+    libusb_transfer *tr = contexts[i].transfer;
+	libusb_fill_bulk_transfer(tr, dev_handle, 0x81, (unsigned char*)buffer, length, callback_libusbtransfer, &contexts[i], Timeout);
+	contexts[i].done = false;
+	contexts[i].bytesXfered = 0;
+	contexts[i].bytesExpected = length;
+    int status = libusb_submit_transfer(tr);
+    int actual = 0;
+    //int status = libusb_bulk_transfer(dev_handle, 0x81, (unsigned char*)buffer, length, &actual, USB_TIMEOUT);
+    if(status != 0)
+        printf("ERROR BEGIN DATA TRANSFER %s\n", libusb_error_name(status));
+    #endif
+    return i;
+}
+
+/**
+	@brief Waits for asynchronous data reception
+	@param contextHandle handle of which context data to wait
+	@param timeout_ms number of miliseconds to wait
+	@return 1-data received, 0-data not received
+*/
+int ConnectionUSB::WaitForReading(int contextHandle, unsigned int timeout_ms)
+{
+    if( contexts[contextHandle].used == true && contextHandle >= 0)
+    {
+    int status = 0;
+    #ifndef __unix__
+	if(InEndPt)
+        status = InEndPt->WaitForXfer(contexts[contextHandle].inOvLap, timeout_ms);
+	return status;
+    #else
+
+    struct timeval tv;
+    tv.tv_sec = 0;
+    tv.tv_usec = 0;  
+    if(libusb_handle_events_timeout_completed(ctx, &tv, NULL) != 0)
+    printf("error libusb_handle_events %i\n", status);
+            
+    auto t1 = chrono::high_resolution_clock::now();
+    auto t2 = chrono::high_resolution_clock::now();
+    
+    while(contexts[contextHandle].done == false && std::chrono::duration_cast<std::chrono::milliseconds>(t2 - t1).count() < timeout_ms)
+	{
+	    struct timeval tv;
+	    tv.tv_sec = 0;
+	    tv.tv_usec = 300;
+            std::this_thread::yield();
+		//if(libusb_handle_events(ctx) != 0)
+            if(libusb_handle_events_timeout_completed(ctx, &tv, NULL) != 0)
+            printf("error libusb_handle_events %i\n", status);
+            t2 = chrono::high_resolution_clock::now();        
+            //std::this_thread::sleep_for(std::chrono::milliseconds(1));
+	}
+    std::unique_lock<std::mutex> lck(contexts[contextHandle].m_lock);
+    while(contexts[contextHandle].done == false) //is changed in libusb callback
+    {
+        if(contexts[contextHandle].mPacketProcessed.wait_for(lck, std::chrono::milliseconds(timeout_ms)) == std::cv_status::timeout)
+            return 0;
+    }
+	return contexts[contextHandle].done == true;
+    #endif
+    }
+    else
+        return 0;
+}
+
+/**
+	@brief Finishes asynchronous data reading from board
+	@param buffer array where to store received data
+	@param length number of bytes to read, function changes this value to number of bytes actually received
+	@param contextHandle handle of which context to finish
+	@return false failure, true number of bytes received
+*/
+int ConnectionUSB::FinishDataReading(char *buffer, long &length, int contextHandle)
+{
+    if( contexts[contextHandle].used == true && contextHandle >= 0)
+    {
+    #ifndef __unix__
+    int status = 0;
+    if(InEndPt)
+        status = InEndPt->FinishDataXfer((unsigned char*)buffer, length, contexts[contextHandle].inOvLap, contexts[contextHandle].context);
+    contexts[contextHandle].used = false;
+    contexts[contextHandle].reset();
+    return length;
+    #else
+	length = contexts[contextHandle].bytesXfered;
+	contexts[contextHandle].used = false;
+	contexts[contextHandle].reset();
+	return length;
+    #endif
+    }
+    else
+        return 0;
+}
+
+int ConnectionUSB::ReadDataBlocking(char *buffer, long &length, int timeout_ms)
+{
+#ifndef __unix__
+    return InEndPt->XferData((unsigned char*)buffer, length);
+#else
+    return 0;
+#endif
+}
+
+
+/**
+	@brief Aborts reading operations
+*/
+void ConnectionUSB::AbortReading()
+{
+#ifndef __unix__
+	InEndPt->Abort();
+#else
+    for(int i=0; i<USB_MAX_CONTEXTS; ++i)
+    {
+        libusb_cancel_transfer( contexts[i].transfer );
+    }
+#endif
+}
+
+/**
+	@brief Starts asynchronous data Sending to board
+	@param *buffer buffer to send
+	@param length number of bytes to send
+	@return handle of transfer context
+*/
+int ConnectionUSB::BeginDataSending(const char *buffer, long length)
+{
+    int i = 0;
+	//find not used context
+	bool contextFound = false;
+    for(i = 0; i<USB_MAX_CONTEXTS; i++)
+    {
+        if(!contextsToSend[i].used)
+        {
+            contextFound = true;
+            break;
+        }
+    }
+    if(!contextFound)
+        return -1;
+    contextsToSend[i].used = true;
+    #ifndef __unix__
+    if(OutEndPt)
+        contextsToSend[i].context = OutEndPt->BeginDataXfer((unsigned char*)buffer, length, contextsToSend[i].inOvLap);
+	return i;
+    #else
+    unsigned int Timeout = 1000;
+    libusb_transfer *tr = contextsToSend[i].transfer;
+    //libusb_set_iso_packet_lengths(contexts[i].transfer, 512*64);
+	libusb_fill_bulk_transfer(tr, dev_handle, 0x1, (unsigned char*)buffer, length, callback_libusbtransfer, &contextsToSend[i], Timeout);
+	contextsToSend[i].done = false;
+	contextsToSend[i].bytesXfered = 0;
+	contextsToSend[i].bytesExpected = length;
+    libusb_submit_transfer(tr);
+    #endif
+    return i;
+}
+
+/**
+	@brief Waits for asynchronous data sending
+	@param contextHandle handle of which context data to wait
+	@param timeout_ms number of miliseconds to wait
+	@return 1-data received, 0-data not received
+*/
+int ConnectionUSB::WaitForSending(int contextHandle, unsigned int timeout_ms)
+{
+    if( contextsToSend[contextHandle].used == true )
+    {
+    #ifndef __unix__
+	int status = 0;
+	if(OutEndPt)
+        status = OutEndPt->WaitForXfer(contextsToSend[contextHandle].inOvLap, timeout_ms);
+	return status;
+    #else
+    auto t1 = chrono::high_resolution_clock::now();
+    auto t2 = chrono::high_resolution_clock::now();
+    while(contextsToSend[contextHandle].done == false && std::chrono::duration_cast<std::chrono::milliseconds>(t2 - t1).count() < timeout_ms)
+	{
+	  /*  struct timeval tv;
+	    tv.tv_sec = 1;
+	    tv.tv_usec = 0;
+        int status = libusb_handle_events_timeout_completed(ctx, &tv, NULL);
+        if(status != 0)
+            printf("error libusb_handle_events %i\n", status);*/
+        t2 = chrono::high_resolution_clock::now();
+        //std::this_thread::sleep_for(std::chrono::milliseconds(1));
+	}
+	std::unique_lock<std::mutex> lck(contextsToSend[contextHandle].m_lock);
+    while(contextsToSend[contextHandle].done == false) //is changed in libusb callback
+    {
+        if(contextsToSend[contextHandle].mPacketProcessed.wait_for(lck, std::chrono::milliseconds(timeout_ms)) == std::cv_status::timeout)
+            return 0;
+    }
+	return contextsToSend[contextHandle].done == true;
+    #endif
+    }
+    else
+        return 0;
+}
+
+/**
+	@brief Finishes asynchronous data sending to board
+	@param buffer array where to store received data
+	@param length number of bytes to read, function changes this value to number of bytes acctually received
+	@param contextHandle handle of which context to finish
+	@return false failure, true number of bytes sent
+*/
+int ConnectionUSB::FinishDataSending(const char *buffer, long &length, int contextHandle)
+{
+    if( contextsToSend[contextHandle].used == true)
+    {
+    #ifndef __unix__
+	if(OutEndPt)
+        OutEndPt->FinishDataXfer((unsigned char*)buffer, length, contextsToSend[contextHandle].inOvLap, contextsToSend[contextHandle].context);
+    contextsToSend[contextHandle].used = false;
+    contextsToSend[contextHandle].reset();
+    return length;
+    #else
+	length = contextsToSend[contextHandle].bytesXfered;
+	contextsToSend[contextHandle].used = false;
+    contextsToSend[contextHandle].reset();
+	return length;
+    #endif
+    }
+    else
+        return 0;
+}
+
+/**
+	@brief Aborts sending operations
+*/
+void ConnectionUSB::AbortSending()
+{
+#ifndef __unix__
+	OutEndPt->Abort();
+#else
+    for (int i = 0; i<USB_MAX_CONTEXTS; ++i)
+    {
+        libusb_cancel_transfer(contextsToSend[i].transfer);
+    }
+    for(int i=0; i<USB_MAX_CONTEXTS; ++i)
+    {
+        contextsToSend[i].used = false;
+        contextsToSend[i].reset();
+    }
+#endif
+}
+
+int ConnectionUSB::GetOpenedIndex()
+{
+    return currentDeviceIndex;
+}
+
+/** @brief Returns found devices names
+    @return vector of device names
+*/
+vector<string> ConnectionUSB::GetDeviceNames()
+{
+    return m_deviceNames;
+}
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionUSB.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionUSB.h
new file mode 100644
index 0000000000000000000000000000000000000000..f3048c184200e5bb5bdb875392c957ca45c75a7b
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/ConnectionUSB.h
@@ -0,0 +1,144 @@
+/**
+@file   ConnectionUSB.h
+@author Lime Microsystems (www.limemicro.com)
+@brief  Class for data writing and reading through USB port
+*/
+
+#ifndef USB_PORT_CONNECTION_H
+#define USB_PORT_CONNECTION_H
+
+#include "IConnection.h"
+
+#ifndef __unix__
+#include "windows.h"
+#include "CyAPI.h"
+#else
+#include <libusb-1.0/libusb.h>
+#include <mutex>
+#include <condition_variable>
+#include <chrono>
+#endif
+
+#define USB_MAX_CONTEXTS 64 //maximum number of contexts for asynchronous transfers
+
+/** @brief Wrapper class for holding USB asynchronous transfers contexts
+*/
+class USBTransferContext
+{
+public:
+	USBTransferContext() : used(false)
+	{
+		#ifndef __unix__
+		inOvLap = new OVERLAPPED;
+		memset(inOvLap, 0, sizeof(OVERLAPPED));
+		inOvLap->hEvent = CreateEvent(NULL, false, false, NULL);
+		context = NULL;
+		#else
+		transfer = libusb_alloc_transfer(0);
+		bytesXfered = 0;
+		bytesExpected = 0;
+		done = 0;
+		#endif
+	}
+	~USBTransferContext()
+	{
+		#ifndef __unix__
+		CloseHandle(inOvLap->hEvent);
+		delete inOvLap;
+		#else
+		libusb_free_transfer(transfer);
+		#endif
+	}
+	bool reset()
+	{
+        if(used)
+            return false;
+        #ifndef __unix__
+        CloseHandle(inOvLap->hEvent);
+        memset(inOvLap, 0, sizeof(OVERLAPPED));
+        inOvLap->hEvent = CreateEvent(NULL, false, false, NULL);
+        #endif
+        return true;
+	}
+	bool used;
+	#ifndef __unix__
+	PUCHAR context;
+	OVERLAPPED *inOvLap;
+	#else
+	libusb_transfer* transfer;
+	long bytesXfered;
+	long bytesExpected;
+	bool done;
+	std::mutex m_lock;
+    std::condition_variable mPacketProcessed;
+	#endif
+};
+
+class ConnectionUSB : public IConnection
+{
+public:
+	ConnectionUSB();
+	~ConnectionUSB();
+
+    void FindDevices();
+	DeviceStatus Open();
+	DeviceStatus Open(unsigned index);
+	void Close();
+	bool IsOpen();
+	int GetOpenedIndex();
+
+	int Write(const unsigned char *buffer, int length, int timeout_ms = 0);
+	int Read(unsigned char *buffer, int length, int timeout_ms = 0);
+
+	virtual int BeginDataReading(char *buffer, long length);
+	virtual int WaitForReading(int contextHandle, unsigned int timeout_ms);
+	virtual int FinishDataReading(char *buffer, long &length, int contextHandle);
+	virtual void AbortReading();
+    virtual int ReadDataBlocking(char *buffer, long &length, int timeout_ms);
+
+	virtual int BeginDataSending(const char *buffer, long length);
+	virtual int WaitForSending(int contextHandle, unsigned int timeout_ms);
+	virtual int FinishDataSending(const char *buffer, long &length, int contextHandle);
+	virtual void AbortSending();
+
+	std::vector<std::string> GetDeviceNames();
+	int RefreshDeviceList();
+	void ClearComm();
+private:
+    int currentDeviceIndex;
+    std::string DeviceName();
+
+    std::vector<std::string> m_deviceNames;
+    std::string m_hardwareName;
+    int m_hardwareVer;
+
+	USBTransferContext contexts[USB_MAX_CONTEXTS];
+	USBTransferContext contextsToSend[USB_MAX_CONTEXTS];
+	void Initialize();
+
+	bool isConnected;
+	int currentPortIndex;
+
+	#ifndef __unix__
+	CCyUSBDevice *USBDevicePrimary;
+	//control endpoints for DigiRed
+	CCyControlEndPoint *InCtrlEndPt3;
+	CCyControlEndPoint *OutCtrlEndPt3;
+
+    //control endpoints for DigiGreen
+	CCyUSBEndPoint *OutCtrEndPt;
+	CCyUSBEndPoint *InCtrEndPt;
+
+    //end points for samples reading and writing
+	CCyUSBEndPoint *InEndPt;
+	CCyUSBEndPoint *OutEndPt;
+
+	#else
+    libusb_device **devs; //pointer to pointer of device, used to retrieve a list of devices
+    libusb_device_handle *dev_handle; //a device handle
+    libusb_context *ctx; //a libusb session
+    std::vector<std::pair<int,int> > m_dev_pid_vid;
+	#endif
+};
+
+#endif
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/IConnection.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/IConnection.h
new file mode 100644
index 0000000000000000000000000000000000000000..5804f1149f104c4d834c710eaf6f38f75bc9a6d3
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/IConnection.h
@@ -0,0 +1,68 @@
+/**
+    @file IConnection.h
+    @author Lime Microsystems
+    @brief Interface class for connection types
+*/
+
+#ifndef ICONNECTION_H
+#define ICONNECTION_H
+
+#include <string>
+#include <vector>
+
+using namespace std;
+
+class IConnection
+{
+public:
+    /// Supported connection types.
+    enum eConnectionType
+    {
+	    CONNECTION_UNDEFINED = -1,
+	    COM_PORT = 0,
+	    USB_PORT = 1,
+	    SPI_PORT = 2,
+	    //insert new types here
+	    CONNECTION_TYPES_COUNT //used only for memory allocation
+    };
+
+    enum DeviceStatus
+    {
+        SUCCESS,
+        FAILURE,
+        END_POINTS_NOT_FOUND,
+        CANNOT_CLAIM_INTERFACE
+    };
+
+	IConnection() : m_connectionType(CONNECTION_UNDEFINED){};
+	virtual ~IConnection(){};
+	virtual int RefreshDeviceList() = 0;
+	virtual DeviceStatus Open(unsigned i) = 0;
+	virtual void Close() = 0;
+	virtual bool IsOpen() = 0;
+	virtual int GetOpenedIndex() = 0;
+
+	virtual int Write(const unsigned char *buffer, int length, int timeout_ms = 0) = 0;
+	virtual int Read(unsigned char *buffer, int length, int timeout_ms = 0) = 0;
+
+	virtual std::vector<std::string> GetDeviceNames() = 0;
+
+	virtual eConnectionType GetType() { return m_connectionType; };
+	virtual bool SetParam(const char *name, const char* value) {return false;};
+
+	virtual int BeginDataReading(char *buffer, long length){ return -1; };
+	virtual int WaitForReading(int contextHandle, unsigned int timeout_ms){ return 0;};
+	virtual int FinishDataReading(char *buffer, long &length, int contextHandle){ return 0;}
+	virtual void AbortReading(){};
+    virtual int ReadDataBlocking(char *buffer, long &length, int timeout_ms){ return 0; }
+
+	virtual int BeginDataSending(const char *buffer, long length){ return -1; };
+	virtual int WaitForSending(int contextHandle, unsigned int timeout_ms){ return 0;};
+	virtual int FinishDataSending(const char *buffer, long &length, int contextHandle){ return 0;}
+	virtual void AbortSending(){};
+protected:
+	eConnectionType m_connectionType;
+};
+
+#endif
+
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/lmsComms.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/lmsComms.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..0e5ec667621f7b3c797aacba8ffc89742645c96f
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/lmsComms.cpp
@@ -0,0 +1,325 @@
+/**
+@file   LMScomms.cpp
+@author Lime Microsystems (www.limemicro.com)
+@brief  Implementation of data transmission to LMS boards
+*/
+
+#include "lmsComms.h"
+
+LMScomms::LMScomms(const IConnection::eConnectionType port_type) : ConnectionManager(port_type)
+{
+    callback_logData = nullptr;
+    unsigned short test = 0x1234;
+    unsigned char* bytes = (unsigned char*)&test;
+    if(bytes[0] == 0x12 && bytes[1] == 0x34)
+        mSystemBigEndian = true;
+    else
+        mSystemBigEndian = false;
+}
+
+LMScomms::~LMScomms()
+{
+}
+
+/** @brief Transfers data between packet and connected device
+    @param pkt packet containing output data and to receive incomming data
+    @return 0: success, other: failure
+*/
+LMScomms::TransferStatus LMScomms::TransferPacket(GenericPacket& pkt)
+{
+    std::lock_guard<std::mutex> lock(mControlPortLock);
+	TransferStatus status = TRANSFER_SUCCESS;
+    if(IsOpen() == false)
+        return NOT_CONNECTED;
+
+    int packetLen;
+    eLMS_PROTOCOL protocol = LMS_PROTOCOL_UNDEFINED;
+    if(activeControlPort->GetType() == IConnection::SPI_PORT)
+        protocol = LMS_PROTOCOL_NOVENA;
+    else
+        protocol = LMS_PROTOCOL_LMS64C;
+    switch(protocol)
+    {
+    case LMS_PROTOCOL_UNDEFINED:
+        return TRANSFER_FAILED;
+    case LMS_PROTOCOL_LMS64C:
+        packetLen = ProtocolLMS64C::pktLength;
+        break;
+    case LMS_PROTOCOL_NOVENA:
+        packetLen = pkt.outBuffer.size() > ProtocolNovena::pktLength ? ProtocolNovena::pktLength : pkt.outBuffer.size();
+        break;
+    default:
+        packetLen = 0;
+        return TRANSFER_FAILED;
+    }
+    int outLen = 0;
+    unsigned char* outBuffer = NULL;
+    outBuffer = PreparePacket(pkt, outLen, protocol);
+    unsigned char* inBuffer = new unsigned char[outLen];
+    memset(inBuffer, 0, outLen);
+
+    int outBufPos = 0;
+    int inDataPos = 0;
+    if(outLen == 0)
+    {
+        //printf("packet outlen = 0\n");
+        outLen = 1;
+    }
+
+    if(protocol == LMS_PROTOCOL_NOVENA)
+    {
+        bool transferData = true; //some commands are fake, so don't need transferring
+        if(pkt.cmd == CMD_GET_INFO)
+        {
+            //spi does not have GET INFO, fake it to inform what device it is
+            pkt.status = STATUS_COMPLETED_CMD;
+            pkt.inBuffer.clear();
+            pkt.inBuffer.resize(64, 0);
+            pkt.inBuffer[0] = 0; //firmware
+            pkt.inBuffer[1] = LMS_DEV_NOVENA; //device
+            pkt.inBuffer[2] = 0; //protocol
+            pkt.inBuffer[3] = 0; //hardware
+            pkt.inBuffer[4] = EXP_BOARD_UNSUPPORTED; //expansion
+            transferData = false;
+        }
+
+        if(transferData)
+        {
+            if (callback_logData)
+                callback_logData(true, outBuffer, outLen);
+            int bytesWritten = Write(outBuffer, outLen);
+            if( bytesWritten == outLen)
+            {
+                if(pkt.cmd == CMD_LMS7002_RD)
+                {
+                    inDataPos = Read(&inBuffer[inDataPos], outLen);
+                    if(inDataPos != outLen)
+                        status = TRANSFER_FAILED;
+                    else
+                    {
+                        if (callback_logData)
+                            callback_logData(false, inBuffer, inDataPos);
+                    }
+                }
+                ParsePacket(pkt, inBuffer, inDataPos, protocol);
+            }
+            else
+                status = TRANSFER_FAILED;
+        }
+    }
+    else
+    {
+        for(int i=0; i<outLen; i+=packetLen)
+        {
+            int bytesToSend = packetLen;
+            if (callback_logData)
+                callback_logData(true, &outBuffer[outBufPos], bytesToSend);
+            if( Write(&outBuffer[outBufPos], bytesToSend) )
+            {
+                outBufPos += packetLen;
+                long readLen = packetLen;
+                int bread = Read(&inBuffer[inDataPos], readLen);
+                if(bread != readLen && protocol != LMS_PROTOCOL_NOVENA)
+                {
+                    status = TRANSFER_FAILED;
+                    break;
+                }
+                if (callback_logData)
+                    callback_logData(false, &inBuffer[inDataPos], bread);
+                inDataPos += bread;
+            }
+            else
+            {
+                status = TRANSFER_FAILED;
+                break;
+            }
+        }
+        ParsePacket(pkt, inBuffer, inDataPos, protocol);
+    }
+    delete outBuffer;
+    delete inBuffer;
+    return status;
+}
+
+/** @brief Returns connected device information
+*/
+LMSinfo LMScomms::GetInfo()
+{
+    LMSinfo info;
+    info.device = LMS_DEV_UNKNOWN;
+    info.expansion = EXP_BOARD_UNKNOWN;
+    info.firmware = 0;
+    info.hardware = 0;
+    info.protocol = 0;
+    GenericPacket pkt;
+    pkt.cmd = CMD_GET_INFO;
+    LMScomms::TransferStatus status = TransferPacket(pkt);
+    if (status == LMScomms::TRANSFER_SUCCESS && pkt.inBuffer.size() >= 5)
+    {
+        info.firmware = pkt.inBuffer[0];
+        info.device = pkt.inBuffer[1] < LMS_DEV_COUNT ? (eLMS_DEV)pkt.inBuffer[1] : LMS_DEV_UNKNOWN;
+        info.protocol = pkt.inBuffer[2];
+        info.hardware = pkt.inBuffer[3];
+        info.expansion = pkt.inBuffer[4] < EXP_BOARD_COUNT ? (eEXP_BOARD)pkt.inBuffer[4] : EXP_BOARD_UNKNOWN;
+    }
+    return info;
+}
+
+/** @brief Takes generic packet and converts to specific protocol buffer
+    @param pkt generic data packet to convert
+    @param length returns length of returned buffer
+    @param protocol which protocol to use for data
+    @return pointer to data buffer, must be manually deleted after use
+*/
+unsigned char* LMScomms::PreparePacket(const GenericPacket& pkt, int& length, const eLMS_PROTOCOL protocol)
+{
+    unsigned char* buffer = NULL;
+    if(protocol == LMS_PROTOCOL_UNDEFINED)
+        return NULL;
+
+    if(protocol == LMS_PROTOCOL_LMS64C)
+    {
+        ProtocolLMS64C packet;
+        int maxDataLength = packet.maxDataLength;
+        packet.cmd = pkt.cmd;
+        packet.status = pkt.status;
+        int byteBlockRatio = 1; //block ratio - how many bytes in one block
+        switch( packet.cmd )
+        {
+        case CMD_PROG_MCU:
+        case CMD_GET_INFO:
+        case CMD_SI5351_RD:
+        case CMD_SI5356_RD:
+            byteBlockRatio = 1;
+            break;
+        case CMD_SI5351_WR:
+        case CMD_SI5356_WR:
+            byteBlockRatio = 2;
+            break;
+        case CMD_LMS7002_RD:
+        case CMD_BRDSPI_RD:
+        case CMD_BRDSPI8_RD:
+            byteBlockRatio = 2;
+            break;
+        case CMD_ADF4002_WR:
+            byteBlockRatio = 3;
+            break;
+        case CMD_LMS7002_WR:
+        case CMD_BRDSPI_WR:
+        case CMD_ANALOG_VAL_WR:
+            byteBlockRatio = 4;
+            break;
+        default:
+            byteBlockRatio = 1;
+        }
+        if (packet.cmd == CMD_LMS7002_RD || packet.cmd == CMD_BRDSPI_RD)
+            maxDataLength = maxDataLength/2;
+        if (packet.cmd == CMD_ANALOG_VAL_RD)
+            maxDataLength = maxDataLength / 4;
+        int blockCount = pkt.outBuffer.size()/byteBlockRatio;
+        int bufLen = blockCount/(maxDataLength/byteBlockRatio)
+                    +(blockCount%(maxDataLength/byteBlockRatio)!=0);
+        bufLen *= packet.pktLength;
+        if(bufLen == 0)
+            bufLen = packet.pktLength;
+        buffer = new unsigned char[bufLen];
+        memset(buffer, 0, bufLen);
+        int srcPos = 0;
+        for(int j=0; j*packet.pktLength<bufLen; ++j)
+        {
+            int pktPos = j*packet.pktLength;
+            buffer[pktPos] = packet.cmd;
+            buffer[pktPos+1] = packet.status;
+            if(blockCount > (maxDataLength/byteBlockRatio))
+            {
+                buffer[pktPos+2] = maxDataLength/byteBlockRatio;
+                blockCount -= buffer[pktPos+2];
+            }
+            else
+                buffer[pktPos+2] = blockCount;
+            memcpy(&buffer[pktPos+3], packet.reserved, sizeof(packet.reserved));
+            int bytesToPack = (maxDataLength/byteBlockRatio)*byteBlockRatio;
+            for (int k = 0; k<bytesToPack && srcPos < pkt.outBuffer.size(); ++srcPos, ++k)
+                buffer[pktPos + 8 + k] = pkt.outBuffer[srcPos];
+        }
+        length = bufLen;
+    }
+    else if(protocol == LMS_PROTOCOL_NOVENA)
+    {
+        if(pkt.cmd == CMD_LMS7002_RST)
+        {
+            buffer = new unsigned char[8];
+            buffer[0] = 0x88;
+            buffer[1] = 0x06;
+            buffer[2] = 0x00;
+            buffer[3] = 0x18;
+            buffer[4] = 0x88;
+            buffer[5] = 0x06;
+            buffer[6] = 0x00;
+            buffer[7] = 0x38;
+            length = 8;
+        }
+        else
+        {
+            buffer = new unsigned char[pkt.outBuffer.size()];
+            memcpy(buffer, &pkt.outBuffer[0], pkt.outBuffer.size());
+            if (pkt.cmd == CMD_LMS7002_WR)
+            {
+                for(int i=0; i<pkt.outBuffer.size(); i+=4)
+                    buffer[i] |= 0x80;
+            }
+            length = pkt.outBuffer.size();
+        }
+    }
+    return buffer;
+}
+
+/** @brief Parses given data buffer into generic packet
+    @param pkt destination packet
+    @param buffer received data from board
+    @param length received buffer length
+    @param protocol which protocol to use for data parsing
+    @return 1:success, 0:failure
+*/
+int LMScomms::ParsePacket(GenericPacket& pkt, const unsigned char* buffer, const int length, const eLMS_PROTOCOL protocol)
+{
+    if(protocol == LMS_PROTOCOL_UNDEFINED)
+        return -1;
+
+    if(protocol == LMS_PROTOCOL_LMS64C)
+    {
+        ProtocolLMS64C packet;
+        int inBufPos = 0;
+        pkt.inBuffer.resize(packet.maxDataLength*(length / packet.pktLength + (length % packet.pktLength)), 0);
+        for(int i=0; i<length; i+=packet.pktLength)
+        {
+            pkt.cmd = (eCMD_LMS)buffer[i];
+            pkt.status = (eCMD_STATUS)buffer[i+1];
+            memcpy(&pkt.inBuffer[inBufPos], &buffer[i+8], packet.maxDataLength);
+            inBufPos += packet.maxDataLength;
+        }
+    }
+    else if(protocol == LMS_PROTOCOL_NOVENA)
+    {
+        pkt.cmd = CMD_LMS7002_RD;
+        pkt.status = STATUS_COMPLETED_CMD;
+        pkt.inBuffer.clear();
+        for(int i=0; i<length; i+=2)
+        {
+            //reading from spi returns only registers values
+            //fill addresses as zeros to match generic format of address, value pairs
+            pkt.inBuffer.push_back(0); //should be address msb
+            pkt.inBuffer.push_back(0); //should be address lsb
+            pkt.inBuffer.push_back(buffer[i]);
+            pkt.inBuffer.push_back(buffer[i+1]);
+        }
+    }
+    return 1;
+}
+
+/** @brief Sets callback function which gets called each time data is sent or received
+*/
+void LMScomms::SetDataLogCallback(std::function<void(bool, const unsigned char*, const unsigned int)> callback)
+{
+    callback_logData = callback;
+}
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/lmsComms.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/lmsComms.h
new file mode 100644
index 0000000000000000000000000000000000000000..f811d293025e0e7c2dce6289dd6e0cbaf04ba278
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/connectionManager/lmsComms.h
@@ -0,0 +1,111 @@
+/**
+@file   LMScomms.h
+@author Lime Microsystems (www.limemicro.com)
+@brief  Class for handling data transmission to LMS boards
+*/
+
+#ifndef LMS_COMMS_H
+#define LMS_COMMS_H
+
+#include "lms7002_defines.h"
+#include "ConnectionManager.h"
+#include <string.h>
+#include <mutex>
+
+struct LMSinfo
+{
+    eLMS_DEV device;
+    eEXP_BOARD expansion;
+    int firmware;
+    int hardware;
+    int protocol;
+};
+
+/*  @brief Class for abstracting transfering data to and from chip
+*/
+class LMScomms : public ConnectionManager
+{	
+public:
+	enum TransferStatus
+	{
+		TRANSFER_SUCCESS,
+		TRANSFER_FAILED,
+		NOT_CONNECTED
+	};
+
+    enum eLMS_PROTOCOL
+    {
+        LMS_PROTOCOL_UNDEFINED = 0,
+        LMS_PROTOCOL_DIGIC,
+        LMS_PROTOCOL_LMS64C,
+        LMS_PROTOCOL_NOVENA,
+    };
+    struct ProtocolDIGIC
+    {
+        static const int pktLength = 64;
+        static const int maxDataLength = 60;
+        ProtocolDIGIC() : cmd(0), i2cAddr(0), blockCount(0) {};
+        unsigned char cmd;
+        unsigned char i2cAddr;
+        unsigned char blockCount;
+        unsigned char reserved;
+        unsigned char data[maxDataLength];
+    };
+
+    struct ProtocolLMS64C
+    {
+        static const int pktLength = 64;
+        static const int maxDataLength = 56;
+        ProtocolLMS64C() :cmd(0),status(STATUS_UNDEFINED),blockCount(0)
+        {
+            memset(reserved, 0, 5);
+        };
+        unsigned char cmd;
+        unsigned char status;
+        unsigned char blockCount;
+        unsigned char reserved[5];
+        unsigned char data[maxDataLength];
+    };
+
+    struct ProtocolNovena
+    {
+        static const int pktLength = 128;
+        static const int maxDataLength = 128;
+        ProtocolNovena() :cmd(0),status(0) {};
+        unsigned char cmd;
+        unsigned char status;
+        unsigned char blockCount;
+        unsigned char data[maxDataLength];
+    };
+
+    struct GenericPacket
+    {   
+        GenericPacket()
+        {
+            cmd = CMD_GET_INFO;
+            status = STATUS_UNDEFINED;
+        }
+
+        eCMD_LMS cmd;
+        eCMD_STATUS status;
+        vector<unsigned char> outBuffer;
+        vector<unsigned char> inBuffer;
+    };
+
+    LMScomms(const IConnection::eConnectionType port_type);
+    ~LMScomms();
+
+    virtual TransferStatus TransferPacket(GenericPacket &pkt);
+    LMSinfo GetInfo();
+    void SetDataLogCallback(std::function<void(bool, const unsigned char*, const unsigned int)> callback);
+protected:
+    std::function<void(bool, const unsigned char*, const unsigned int)> callback_logData;
+    std::mutex mControlPortLock;
+    unsigned char* PreparePacket(const GenericPacket &pkt, int &length, const eLMS_PROTOCOL protocol);
+    int ParsePacket(GenericPacket &pkt, const unsigned char* buffer, const int length, const eLMS_PROTOCOL protocol);
+protected:
+    bool mSystemBigEndian;
+};
+
+#endif // LMS_COMMS_H
+
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/dataTypes.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/dataTypes.h
new file mode 100644
index 0000000000000000000000000000000000000000..c97ac7857df021918df23abbddee645ed18e35e1
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/dataTypes.h
@@ -0,0 +1,34 @@
+#ifndef LMS_DATA_TYPES_H
+#define LMS_DATA_TYPES_H
+
+typedef struct
+{
+    uint8_t reserved[8];
+    uint64_t counter;
+    int16_t samples[2040];
+} PacketLTE;
+
+typedef struct
+{
+    int16_t i;
+    int16_t q;
+} complex16_t;
+
+class SamplesPacket
+{
+  public:
+    uint64_t timestamp; //timestamp of the packet
+    uint16_t first; //index of first unused sample in samples[]
+    uint16_t last; //end index of samples
+    static const uint16_t samplesCount = 1024; //maximum number of samples in packet
+    complex16_t samples[samplesCount]; //must be power of two    
+};
+
+complex16_t operator &=(complex16_t & other1, const complex16_t & other) // copy assignment
+{    
+    other1.i = other.i;
+    other1.q = other.q;
+    return other1;
+}
+
+#endif
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/fifo.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/fifo.h
new file mode 100644
index 0000000000000000000000000000000000000000..1868c64af71d1205e0aeb422c9ab9ea87635a747
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/fifo.h
@@ -0,0 +1,180 @@
+#ifndef LMS_FIFO_BUFFER_H
+#define LMS_FIFO_BUFFER_H
+
+#include <mutex>
+#include <atomic>
+#include <vector>
+#include <thread>
+#include <condition_variable>
+#include "dataTypes.h"
+
+class LMS_SamplesFIFO
+{
+public:
+    struct BufferInfo
+    {
+        uint32_t size;
+        uint32_t itemsFilled;
+    };
+
+    BufferInfo GetInfo()
+    {
+        std::unique_lock<std::mutex> lck2(readLock);
+        std::unique_lock<std::mutex> lck(writeLock);
+        BufferInfo stats;
+        stats.size = (uint32_t)mBuffer.size();
+        stats.itemsFilled = mElementsFilled.load();
+        return stats;
+    }
+
+	LMS_SamplesFIFO(uint32_t bufLength)
+	{
+        Reset(bufLength);
+	}
+	
+	~LMS_SamplesFIFO(){};
+	
+    /** @brief inserts items to ring buffer
+        @param buffer data source
+        @param itemCount number of buffer items to insert
+        @param timeout_ms timeout duration for operation
+        @param overwrite enable to overwrite oldest items inside the buffer
+        @return number of items added
+    */
+	uint32_t push_packet(SamplesPacket *buffer, const uint32_t itemCount, const uint32_t timeout_ms, const bool overwrite = true)
+	{	
+        uint32_t addedItems = 0;
+        std::unique_lock<std::mutex> lck(writeLock);
+        while (addedItems < itemCount)
+        {            
+            while (mElementsFilled.load() >= mBuffer.size()) //wait for free space to insert items
+            {
+                if (canWrite.wait_for(lck, std::chrono::milliseconds(timeout_ms)) == std::cv_status::timeout)
+                    return addedItems; //dropped all items
+            }
+
+            uint32_t itemsToInsert = itemCount - addedItems;
+            uint32_t itemsToEnd = (uint32_t)mBuffer.size() - mTail.load(); //might need to split memcpy into two operations
+            if (itemsToInsert > itemsToEnd)
+            {
+                memcpy(&mBuffer[mTail], &buffer[addedItems], itemsToEnd*sizeof(SamplesPacket));
+                memcpy(&mBuffer[0], &buffer[addedItems+itemsToEnd], (itemsToInsert - itemsToEnd)*sizeof(SamplesPacket));
+            }
+            else
+                memcpy(&mBuffer[mTail], &buffer[addedItems], itemsToInsert*sizeof(SamplesPacket));
+            mTail.store((mTail.load() + itemsToInsert) & (mBuffer.size() - 1));
+            mElementsFilled.fetch_add(itemsToInsert);
+            canRead.notify_one();
+            addedItems += itemsToInsert;
+        }
+        return addedItems;
+	}
+
+    /** @brief inserts items to ring buffer
+    @param buffer data source
+    @param itemCount number of buffer items to insert
+    @param timeout_ms timeout duration for operation
+    @param overwrite enable to overwrite oldest items inside the buffer
+    @return number of items added
+    */
+    uint32_t push_samples(const complex16_t *buffer, const uint32_t samplesCount, uint64_t timestamp, const uint32_t timeout_ms, const bool overwrite = true)
+    {
+        assert(buffer != nullptr);
+        const int samplesInPacket = SamplesPacket::samplesCount;
+        uint32_t samplesTaken = 0;
+        std::unique_lock<std::mutex> lck(writeLock);
+        while (samplesTaken < samplesCount)
+        {   
+            while (mElementsFilled.load() >= mBuffer.size()) //buffer might be full, wait for free slots
+            {
+                if (canWrite.wait_for(lck, std::chrono::milliseconds(timeout_ms)) == std::cv_status::timeout)
+                    return samplesTaken;
+            }
+
+            int tailIndex = mTail.load(); //which element to fill
+            while (mElementsFilled.load() < mBuffer.size() && samplesTaken < samplesCount) // not to release lock too often
+            {
+                mBuffer[tailIndex].timestamp = timestamp + samplesTaken;
+                mBuffer[tailIndex].first = 0;
+                mBuffer[tailIndex].last = 0;
+                while (mBuffer[tailIndex].last < samplesInPacket && samplesTaken < samplesCount)
+                {
+                    mBuffer[tailIndex].samples[mBuffer[tailIndex].last++] = buffer[samplesTaken++];
+                }
+                mTail.store((tailIndex + 1) & (mBuffer.size() - 1));//advance to next one
+                tailIndex = mTail.load();
+                mElementsFilled.fetch_add(1);
+                canRead.notify_one();
+            }
+        }
+        return samplesTaken;
+    }
+	
+    /** @brief Takes items out of ring buffer
+        @param buffer data destination
+        @param samplesCount number of samples to pop
+		@param timestamp returns timestamp of the first sample in buffer
+        @param timeout_ms timeout duration for operation
+        @return number of samples returned
+    */
+    uint32_t pop_samples(complex16_t* buffer, const uint32_t samplesCount, uint64_t *timestamp, const uint32_t timeout_ms)
+	{
+        assert(buffer != nullptr);
+        const int samplesInPacket = SamplesPacket::samplesCount;
+        uint32_t samplesFilled = 0;		
+		*timestamp = 0;
+        std::unique_lock<std::mutex> lck(readLock);
+        while (samplesFilled < samplesCount)
+        {   
+            while (mElementsFilled.load() == 0) //buffer might be empty, wait for packets
+            {
+                if (canRead.wait_for(lck, std::chrono::milliseconds(timeout_ms)) == std::cv_status::timeout)
+                    return samplesFilled;
+            }
+			if(samplesFilled == 0)
+                *timestamp = mBuffer[mHead.load()].timestamp + mBuffer[mHead.load()].first;
+			
+			while(mElementsFilled.load() > 0 && samplesFilled < samplesCount)
+			{	
+				int headIndex = mHead.load();
+                while (mBuffer[headIndex].first < mBuffer[headIndex].last && samplesFilled < samplesCount)
+				{
+					buffer[samplesFilled++] = mBuffer[headIndex].samples[mBuffer[headIndex].first++];
+				}
+                if (mBuffer[headIndex].first == mBuffer[headIndex].last) //packet depleated
+				{
+                    mBuffer[headIndex].first = 0;
+                    mBuffer[headIndex].last = 0;
+                    mBuffer[headIndex].timestamp = 0;
+					mHead.store( (headIndex + 1) & (mBuffer.size() - 1) );//advance to next one
+                    headIndex = mHead.load();
+					mElementsFilled.fetch_sub(1);
+                    canWrite.notify_one();
+				}
+			}
+        }
+        return samplesFilled;
+	}
+	
+	void Reset(uint32_t bufLength)
+	{
+        std::unique_lock<std::mutex> lck(writeLock);
+        std::unique_lock<std::mutex> lck2(readLock);
+		mBuffer.resize(bufLength);
+		mHead.store(0);
+		mTail.store(0);
+        mElementsFilled.store(0);
+	}
+	
+protected:
+	std::vector<SamplesPacket> mBuffer;
+    std::atomic<uint32_t> mHead;
+    std::atomic<uint32_t> mTail;
+    std::mutex writeLock;
+    std::mutex readLock;
+	std::atomic<uint32_t> mElementsFilled;
+    std::condition_variable canWrite;
+    std::condition_variable canRead;
+};
+
+#endif
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/ringBuffer.h b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/ringBuffer.h
new file mode 100644
index 0000000000000000000000000000000000000000..e4882f8924cf624b6554b6e04aa95898ff40d66d
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lmsSDR/ringBuffer.h
@@ -0,0 +1,143 @@
+#ifndef LMS_RING_BUFFER_H
+#define LMS_RING_BUFFER_H
+
+#include <mutex>
+#include <atomic>
+#include <vector>
+#include <condition_variable>
+
+template<class T>
+class RingBuffer
+{
+public:
+    struct BufferInfo
+    {
+        uint32_t size;
+        uint32_t itemsFilled;
+    };
+
+    BufferInfo GetInfo()
+    {
+        unique_lock<mutex> lck(mLock);
+        BufferInfo stats;
+        stats.size = (uint32_t)mBuffer.size();
+        stats.itemsFilled = mElementsFilled;
+        return stats;
+    }
+
+	RingBuffer(uint32_t bufLength)
+	{
+        Reset(bufLength);
+	}
+	~RingBuffer(){};
+	
+    /** @brief inserts items to ring buffer
+        @param buffer data source
+        @param itemCount number of buffer items to insert
+        @param timeout_ms timeout duration for operation
+        @return number of items added
+    */
+	uint32_t push_back(const T* buffer, const uint32_t itemCount, const uint32_t timeout_ms)
+	{	
+        uint32_t addedItems = 0;
+        while (addedItems < itemCount)
+        {
+            unique_lock<mutex> lck(mLock);
+            while (mElementsFilled >= mBuffer.size()) //wait for free space to insert items
+            {
+                if (canWrite.wait_for(lck, std::chrono::milliseconds(timeout_ms)) == std::cv_status::timeout)
+                    return addedItems; //dropped all items
+            }
+
+            uint32_t itemsToInsert = itemCount - addedItems;
+            uint32_t itemsToEnd = (uint32_t)mBuffer.size() - mTail.load(); //might need to split memcpy into two operations
+            if (itemsToInsert > itemsToEnd)
+            {
+                memcpy(&mBuffer[mTail], &buffer[addedItems], itemsToEnd*sizeof(T));
+                memcpy(&mBuffer[0], &buffer[addedItems+itemsToEnd], (itemsToInsert - itemsToEnd)*sizeof(T));
+            }
+            else
+                memcpy(&mBuffer[mTail], &buffer[addedItems], itemsToInsert*sizeof(T));
+            mTail.store((mTail.load() + itemsToInsert) & (mBuffer.size() - 1));
+            mElementsFilled += itemsToInsert;            
+            lck.unlock();
+            canRead.notify_one();
+            addedItems += itemsToInsert;
+        }
+        return addedItems;
+	}
+	
+    /** @brief Takes items out of ring buffer
+        @param buffer data destination
+        @param itemCount number of items to extract from ring buffer
+        @param timeout_ms timeout duration for operation
+        @return number of items returned
+    */
+	uint32_t pop_front(T* buffer, const uint32_t itemCount, const uint32_t timeout_ms)
+	{
+        assert(buffer != nullptr);
+        uint32_t itemsTaken = 0;
+        T* destBuffer = buffer;
+        while (itemsTaken < itemCount)
+        {
+            unique_lock<mutex> lck(mLock);
+            while (mElementsFilled == 0) //buffer might be empty, wait for items
+            {
+                if (canRead.wait_for(lck, std::chrono::milliseconds(timeout_ms)) == std::cv_status::timeout)
+                    return itemsTaken;
+            }
+
+            unsigned int itemsToCopy = itemCount - itemsTaken;
+            if (itemsToCopy > mElementsFilled)
+                itemsToCopy = mElementsFilled;
+            unsigned int itemsToEnd = (uint32_t)mBuffer.size() - mHead.load(); //migth need to split memcpy into two operations
+            if (itemsToEnd < itemsToCopy)
+            {
+                memcpy(&destBuffer[itemsTaken], &mBuffer[mHead.load()], sizeof(T)*itemsToEnd);
+                memcpy(&destBuffer[itemsTaken+itemsToEnd], &mBuffer[0], sizeof(T)*(itemsToCopy - itemsToEnd));
+                mHead.store((itemsToCopy - itemsToEnd) & (mBuffer.size() - 1));
+            }
+            else
+            {
+                memcpy(&destBuffer[itemsTaken], &mBuffer[mHead.load()], sizeof(T)*itemsToCopy);
+                int headVal = mHead.load();
+                int valueToStore = (headVal + itemsToCopy) & (mBuffer.size() - 1);
+                mHead.store(valueToStore);
+                headVal = mHead.load();
+            }
+            mElementsFilled -= itemsToCopy;
+            lck.unlock();
+            canWrite.notify_one();
+            itemsTaken += itemsToCopy;
+        }
+        return itemsTaken;
+	}
+	
+	void Reset(uint32_t bufLength)
+	{
+        std::unique_lock<std::mutex> lck(mLock);        
+        if (bufLength >= (uint32_t)(1 << 31))
+            bufLength = (uint32_t)(1 << 31);
+        for (int i = 0; i < 32; ++i)
+            if ((1 << i) >= bufLength)
+            {
+                bufLength = (1 << i);
+                break;
+            }
+        mBuffer.resize(bufLength);
+		mHead.store(0);
+		mTail.store(0);
+		mElementsFilled = 0;
+	}
+	
+protected:
+	std::vector<T> mBuffer;
+    std::atomic<uint32_t> mHead;
+    std::atomic<uint32_t> mTail;
+    std::mutex mLock;
+	uint32_t mElementsFilled;
+    std::condition_variable canWrite;
+    std::condition_variable canRead;
+};
+
+#endif
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..4be796e5888ace3f274bef977dc53ba24c68fe03
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp
@@ -0,0 +1,461 @@
+/*******************************************************************************
+    OpenAirInterface
+    Copyright(c) 1999 - 2014 Eurecom
+
+    OpenAirInterface is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+
+    OpenAirInterface is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenAirInterface.The full GNU General Public License is
+    included in this distribution in the file called "COPYING". If not,
+    see <http://www.gnu.org/licenses/>.
+
+   Contact Information
+   OpenAirInterface Admin: openair_admin@eurecom.fr
+   OpenAirInterface Tech : openair_tech@eurecom.fr
+   OpenAirInterface Dev  : openair4g-devel@eurecom.fr
+
+   Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+ *******************************************************************************/
+
+
+#include <arpa/inet.h>
+#include <linux/if_packet.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#include <netinet/ether.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include "common_lib.h"
+#include "LMS_SDR.h"
+#include "LMS7002M.h"
+#include "Si5351C.h"
+#include "LMS_StreamBoard.h"
+#include "LMS7002M_RegistersMap.h"
+
+#include <cmath>
+
+/** @addtogroup _LMSSDR_PHY_RF_INTERFACE_
+ * @{
+ */
+
+///define for parameter enumeration if prefix might be needed
+#define LMS7param(id) id
+
+LMScomms* usbport;
+LMScomms* comport;
+LMS7002M* lms7;
+Si5351C* Si;
+LMS_StreamBoard *lmsStream;
+
+#define RXDCLENGTH 4096
+#define NUMBUFF 40
+int16_t cos_fsover8[8]  = {2047,   1447,      0,  -1448,  -2047,  -1448,     0,   1447};
+int16_t cos_3fsover8[8] = {2047,  -1448,      0,   1447,  -2047,   1447,     0,  -1448};
+
+extern "C"
+{
+int write_output(const char *fname,const char *vname,void *data,int length,int dec,char format);
+}
+
+/*! \brief Called to send samples to the LMSSDR RF target
+      \param device pointer to the device structure specific to the RF hardware target
+      \param timestamp The timestamp at whicch the first sample MUST be sent 
+      \param buff Buffer which holds the samples
+      \param nsamps number of samples to be sent
+      \param antenna_id index of the antenna
+      \param flags Ignored for the moment
+      \returns 0 on success
+*/ 
+int trx_lms_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int antenna_id, int flags) {
+  
+ LMS_TRxWrite((int16_t*)buff[0], nsamps,0, timestamp);
+
+ return nsamps;
+}
+
+/*! \brief Receive samples from hardware.
+ * Read \ref nsamps samples from each channel to buffers. buff[0] is the array for
+ * the first channel. *ptimestamp is the time at which the first sample
+ * was received.
+ * \param device the hardware to use
+ * \param[out] ptimestamp the time at which the first sample was received.
+ * \param[out] buff An array of pointers to buffers for received samples. The buffers must be large enough to hold the number of samples \ref nsamps.
+ * \param nsamps Number of samples. One sample is 2 byte I + 2 byte Q => 4 byte.
+ * \param antenna_id  Index of antenna port
+ * \returns number of samples read
+*/
+int trx_lms_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int antenna_id) {
+    
+  uint64_t timestamp;
+  int16_t *dst_ptr = (int16_t*) buff[0];
+  int ret;
+  ret = LMS_TRxRead(dst_ptr, nsamps,0,&timestamp, 10);
+  *ptimestamp=timestamp;
+
+  return ret;   
+}
+
+/*! \brief set RX gain offset from calibration table
+ * \param openair0_cfg RF frontend parameters set by application
+ * \param chain_index RF chain ID
+ */
+void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) {
+
+  int i=0;
+  // loop through calibration table to find best adjustment factor for RX frequency
+  double min_diff = 6e9,diff;
+
+  while (openair0_cfg->rx_gain_calib_table[i].freq>0) {
+    diff = fabs(openair0_cfg->rx_freq[chain_index] - openair0_cfg->rx_gain_calib_table[i].freq);
+    printf("cal %d: freq %f, offset %f, diff %f\n",
+	   i,
+	   openair0_cfg->rx_gain_calib_table[i].freq,
+	   openair0_cfg->rx_gain_calib_table[i].offset,diff);
+    if (min_diff > diff) {
+      min_diff = diff;
+      openair0_cfg->rx_gain_offset[chain_index] = openair0_cfg->rx_gain_calib_table[i].offset;
+    }
+    i++;
+  }
+  
+}
+
+/*! \brief Set Gains (TX/RX) on LMSSDR
+ * \param device the hardware to use
+ * \param openair0_cfg openair0 Config structure
+ * \returns 0 in success 
+ */
+
+int trx_lms_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) {
+
+  double gv = openair0_cfg[0].rx_gain[0] - openair0_cfg[0].rx_gain_offset[0];
+
+  if (gv > 31) {
+    printf("RX Gain 0 too high, reduce by %f dB\n",gv-31);
+    gv = 31;
+  }
+  if (gv < 0) {
+    printf("RX Gain 0 too low, increase by %f dB\n",-gv);
+    gv = 0;
+  }
+  printf("[LMS] Setting 7002M G_PGA_RBB to %d\n", (int16_t)gv);
+  lms7->Modify_SPI_Reg_bits(LMS7param(G_PGA_RBB),(int16_t)gv);
+
+  return(0);
+}
+
+/*! \brief Start LMSSDR
+ * \param device the hardware to use 
+ * \returns 0 on success
+ */
+int trx_lms_start(openair0_device *device){
+ 
+
+ LMS_Init(0, 128*1024);   
+ usbport = LMS_GetUSBPort();
+ //connect data stream port
+  LMS_UpdateDeviceList(usbport);
+  const char *name = LMS_GetDeviceName(usbport, 0);
+  printf("Connecting to device: %s\n",name);
+
+
+
+  if (LMS_DeviceOpen(usbport, 0)==0)
+  {
+    Si = new Si5351C();
+    lms7 = new LMS7002M(usbport);
+    liblms7_status opStatus;
+
+    printf("Configuring Si5351C\n");
+    Si->Initialize(usbport);
+    Si->SetPLL(0, 25000000, 0);
+    Si->SetPLL(1, 25000000, 0);
+    Si->SetClock(0, 27000000, true, false);
+    Si->SetClock(1, 27000000, true, false);
+    for (int i = 2; i < 8; ++i)
+      Si->SetClock(i, 27000000, false, false);
+    Si5351C::Status status = Si->ConfigureClocks();
+    if (status != Si5351C::SUCCESS)
+      {
+	printf("Failed to configure Si5351C");
+	exit(-1);
+      }
+    status = Si->UploadConfiguration();
+    if (status != Si5351C::SUCCESS)
+      printf("Failed to upload Si5351C configuration");
+    
+
+
+    lms7->ResetChip();
+
+    opStatus = lms7->LoadConfig(device->openair0_cfg[0].configFilename);
+    
+    if (opStatus != LIBLMS7_SUCCESS) {
+      printf("Failed to load configuration file %s\n",device->openair0_cfg[0].configFilename);
+      exit(-1);
+    }
+    opStatus = lms7->UploadAll();
+
+    if (opStatus != LIBLMS7_SUCCESS) {
+      printf("Failed to upload configuration file\n");
+      exit(-1);
+    }
+
+    // Set TX filter
+    
+    printf("Tuning TX filter\n");
+    opStatus = lms7->TuneTxFilter(LMS7002M::TxFilter::TX_HIGHBAND,device->openair0_cfg[0].tx_bw/1e6);
+
+    if (opStatus != LIBLMS7_SUCCESS) {
+      printf("Warning: Could not tune TX filter to %f MHz\n",device->openair0_cfg[0].tx_bw/1e6);
+    }
+    
+    printf("Tuning RX filter\n");
+    
+    opStatus = lms7->TuneRxFilter(LMS7002M::RxFilter::RX_LPF_LOWBAND,device->openair0_cfg[0].rx_bw/1e6);
+
+    if (opStatus != LIBLMS7_SUCCESS) {
+      printf("Warning: Could not tune RX filter to %f MHz\n",device->openair0_cfg[0].rx_bw/1e6);
+    }
+
+    /*    printf("Tuning TIA filter\n");
+    opStatus = lms7->TuneRxFilter(LMS7002M::RxFilter::RX_TIA,7.0);
+
+    if (opStatus != LIBLMS7_SUCCESS) {
+      printf("Warning: Could not tune RX TIA filter\n");
+      }*/
+
+    opStatus = lms7->SetInterfaceFrequency(lms7->GetFrequencyCGEN_MHz(), 
+					   lms7->Get_SPI_Reg_bits(HBI_OVR_TXTSP), 
+					   lms7->Get_SPI_Reg_bits(HBD_OVR_RXTSP));
+    if (opStatus != LIBLMS7_SUCCESS) {
+      printf("SetInterfaceFrequency failed: %f,%d,%d\n",
+	     lms7->GetFrequencyCGEN_MHz(), 
+	     lms7->Get_SPI_Reg_bits(HBI_OVR_TXTSP), 
+	     lms7->Get_SPI_Reg_bits(HBD_OVR_RXTSP));
+    }
+    else {
+      printf("SetInterfaceFrequency as %f,%d,%d\n",
+	     lms7->GetFrequencyCGEN_MHz(), 
+	     lms7->Get_SPI_Reg_bits(HBI_OVR_TXTSP), 
+	     lms7->Get_SPI_Reg_bits(HBD_OVR_RXTSP));
+    } 
+    lmsStream = new LMS_StreamBoard(usbport);    
+    LMS_StreamBoard::Status opStreamStatus; 
+    // this will configure that sampling rate at output of FPGA
+    opStreamStatus = lmsStream->ConfigurePLL(usbport,
+					     device->openair0_cfg[0].sample_rate,
+					     device->openair0_cfg[0].sample_rate,90);
+    if (opStatus != LIBLMS7_SUCCESS){
+      printf("Sample rate programming failed\n");
+      exit(-1);
+    }
+
+    opStatus = lms7->SetFrequencySX(LMS7002M::Tx, device->openair0_cfg[0].tx_freq[0]/1e6,30.72);
+
+    if (opStatus != LIBLMS7_SUCCESS) {
+      printf("Cannot set TX frequency %f MHz\n",device->openair0_cfg[0].tx_freq[0]/1e6);
+      exit(-1);
+    }
+    else {
+      printf("Set TX frequency %f MHz\n",device->openair0_cfg[0].tx_freq[0]/1e6);
+    }
+    opStatus = lms7->SetFrequencySX(LMS7002M::Rx, device->openair0_cfg[0].rx_freq[0]/1e6,30.72);
+
+    if (opStatus != LIBLMS7_SUCCESS) {
+      printf("Cannot set RX frequency %f MHz\n",device->openair0_cfg[0].rx_freq[0]/1e6);
+      exit(-1);
+    }
+    else {
+      printf("Set RX frequency %f MHz\n",device->openair0_cfg[0].rx_freq[0]/1e6);
+    }
+
+    trx_lms_set_gains(device, device->openair0_cfg);
+    // Run calibration procedure
+    //    calibrate_rf(device);
+    //lms7->CalibrateTx(5.0);
+    LMS_RxStart();
+  }
+  else
+  {
+   return(-1);
+  }
+  
+ //connect control port 
+
+ /* comport = LMS_GetCOMPort();
+  LMS_UpdateDeviceList(comport);
+  name = LMS_GetDeviceName(comport, 0);
+  if (*name == 0)
+      comport = usbport;  //attempt to use data port 
+  else
+  {
+    printf("Connecting to device: %s\n",name);
+    if (LMS_DeviceOpen(comport, 0)!=0)
+        return (-1);
+  }
+   lms7 = new LMS7002M(comport);
+   if( access( "./config.ini", F_OK ) != -1 ) //load config file
+   lms7->LoadConfig("./config.ini");
+   //calibration takes too long
+   //lms7->CalibrateRx(5.0);  
+   //lms7->CalibrateTx(5.0);
+ */
+
+  return 0;
+}
+
+/*! \brief Stop LMSSDR
+ * \param card Index of the RF card to use 
+ * \returns 0 on success
+ */
+int trx_lms_stop(int card) {
+  /*
+  LMS_DeviceClose(usbport);
+  LMS_DeviceClose(comport);
+  delete lms7;
+  return LMS_Destroy();
+  */
+}
+
+/*! \brief Set frequencies (TX/RX)
+ * \param device the hardware to use
+ * \param openair0_cfg openair0 Config structure (ignored. It is there to comply with RF common API)
+ * \param exmimo_dump_config (ignored)
+ * \returns 0 in success 
+ */
+int trx_lms_set_freq(openair0_device* device, openair0_config_t *openair0_cfg,int exmimo_dump_config) {
+  //Control port must be connected 
+   
+  lms7->SetFrequencySX(LMS7002M::Tx,openair0_cfg->tx_freq[0]/1e6,30.72);
+  lms7->SetFrequencySX(LMS7002M::Rx,openair0_cfg->rx_freq[0]/1e6,30.72);
+  printf ("[LMS] rx frequency:%f;\n",openair0_cfg->rx_freq[0]/1e6);
+  set_rx_gain_offset(openair0_cfg,0);
+  return(0);
+    
+}
+
+// 31 = 19 dB => 105 dB total gain @ 2.6 GHz
+/*! \brief calibration table for LMSSDR */
+rx_gain_calib_table_t calib_table_sodera[] = {
+  {3500000000.0,70.0},
+  {2660000000.0,80.0},
+  {2300000000.0,80.0},
+  {1880000000.0,74.0},  // on W PAD
+  {816000000.0,76.0},   // on W PAD
+  {-1,0}};
+
+
+
+
+
+/*! \brief Get LMSSDR Statistics
+ * \param device the hardware to use
+ * \returns 0 in success 
+ */
+int trx_lms_get_stats(openair0_device* device) {
+
+  return(0);
+
+}
+
+/*! \brief Reset LMSSDR Statistics
+ * \param device the hardware to use
+ * \returns 0 in success 
+ */
+int trx_lms_reset_stats(openair0_device* device) {
+
+  return(0);
+
+}
+
+
+/*! \brief Terminate operation of the LMSSDR transceiver -- free all associated resources 
+ * \param device the hardware to use
+ */
+void trx_lms_end(openair0_device *device) {
+
+
+}
+
+extern "C" {
+/*! \brief Initialize Openair LMSSDR target. It returns 0 if OK
+* \param device the hardware to use
+* \param openair0_cfg RF frontend parameters set by application
+*/
+int device_init(openair0_device *device, openair0_config_t *openair0_cfg){
+
+  device->type=LMSSDR_DEV;
+  printf("LMSSDR: Initializing openair0_device for %s ...\n", ((device->host_type == BBU_HOST) ? "BBU": "RRH"));
+
+  switch ((int)openair0_cfg[0].sample_rate) {
+  case 30720000:
+    // from usrp_time_offset
+    openair0_cfg[0].samples_per_packet    = 2048;
+    openair0_cfg[0].tx_sample_advance     = 15;
+    openair0_cfg[0].tx_bw                 = 30.72e6;
+    openair0_cfg[0].rx_bw                 = 30.72e6;
+    openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet;
+    break;
+  case 15360000:
+    openair0_cfg[0].samples_per_packet    = 2048;
+    openair0_cfg[0].tx_sample_advance     = 45;
+    openair0_cfg[0].tx_bw                 = 28e6;
+    openair0_cfg[0].rx_bw                 = 10e6;
+    openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet;
+    break;
+  case 7680000:
+    openair0_cfg[0].samples_per_packet    = 1024;
+    openair0_cfg[0].tx_sample_advance     = 70;
+    openair0_cfg[0].tx_bw                 = 28e6;
+    openair0_cfg[0].rx_bw                 = 5.0e6;
+    openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet;
+    break;
+  case 1920000:
+    openair0_cfg[0].samples_per_packet    = 256;
+    openair0_cfg[0].tx_sample_advance     = 50;
+    openair0_cfg[0].tx_bw                 = 1.25e6;
+    openair0_cfg[0].rx_bw                 = 1.25e6;
+    openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet;
+    break;
+  default:
+    printf("Error: unknown sampling rate %f\n",openair0_cfg[0].sample_rate);
+    exit(-1);
+    break;
+  }
+
+  openair0_cfg[0].rx_gain_calib_table = calib_table_sodera;
+  set_rx_gain_offset(openair0_cfg,0);
+
+  device->Mod_id           = 1;
+  device->trx_start_func   = trx_lms_start;
+  device->trx_write_func   = trx_lms_write;
+  device->trx_read_func    = trx_lms_read;  
+  device->trx_get_stats_func   = trx_lms_get_stats;
+  device->trx_reset_stats_func = trx_lms_reset_stats;
+  device->trx_end_func = trx_lms_end;
+  device->trx_stop_func = trx_lms_stop;
+  device->trx_set_freq_func = trx_lms_set_freq;
+  device->trx_set_gains_func = trx_lms_set_gains;
+  
+  device->openair0_cfg = openair0_cfg;
+
+  return 0;
+}
+}
+/*@}*/
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/sodera_lib.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/sodera_lib.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..30a2106b340b047c98942b5818bc547930b95166
--- /dev/null
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/sodera_lib.cpp
@@ -0,0 +1,723 @@
+/*******************************************************************************
+    OpenAirInterface 
+    Copyright(c) 1999 - 2014 Eurecom
+
+    OpenAirInterface is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+
+    OpenAirInterface is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenAirInterface.The full GNU General Public License is 
+    included in this distribution in the file called "COPYING". If not, 
+    see <http://www.gnu.org/licenses/>.
+
+   Contact Information
+   OpenAirInterface Admin: openair_admin@eurecom.fr
+   OpenAirInterface Tech : openair_tech@eurecom.fr
+   OpenAirInterface Dev  : openair4g-devel@lists.eurecom.fr
+  
+   Address      : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+ *******************************************************************************/
+
+/** sodera_lib.c
+ *
+ * Author: Raymond Knopp
+ */
+ 
+#include <vector>
+#include <string>
+#include <stdio.h>
+#include <stdlib.h>
+#include <inttypes.h>
+#include <string.h>
+#include <pthread.h>
+#include <unistd.h>
+
+
+#include <iostream>
+#include <complex>
+#include <fstream>
+#include <cmath>
+
+#include "common_lib.h"
+
+#include "lmsComms.h"
+#include "LMS7002M.h"
+#include "Si5351C.h"
+#include "LMS_StreamBoard.h"
+
+#ifdef __SSE4_1__
+#  include <smmintrin.h>
+#endif
+ 
+#ifdef __AVX2__
+#  include <immintrin.h>
+#endif
+
+using namespace std;
+
+int num_devices=0;
+/*These items configure the underlying asynch stream used by the the sync interface. 
+ */
+
+#define BUFFERSIZE 4096
+#define BUFFERSCOUNT 32
+typedef struct
+{
+
+  // --------------------------------
+  // variables for SoDeRa configuration
+  // --------------------------------
+
+  LMScomms Port;
+  Si5351C Si;
+  LMS7002M lmsControl;
+  LMS_StreamBoard *lmsStream;
+
+  char buffers_rx[BUFFERSIZE*BUFFERSCOUNT];
+  int handles[BUFFERSCOUNT];
+  int current_handle;
+  int samples_left_buffer;
+
+  double sample_rate;
+  // time offset between transmiter timestamp and receiver timestamp;
+  double tdiff;
+
+  int channelscount;
+  // --------------------------------
+  // Debug and output control
+  // --------------------------------
+  int num_underflows;
+  int num_overflows;
+  int num_seq_errors;
+
+  int64_t tx_count;
+  int64_t rx_count;
+  openair0_timestamp rx_timestamp;
+
+} sodera_t;
+
+typedef struct {
+  uint8_t reserved[8];
+  uint64_t counter;
+  char data[4080];
+} StreamPacket_t;
+
+sodera_t sodera_state;
+
+enum STATUS {
+  SUCCESS,
+  FAILURE
+};
+
+STATUS SPI_write(LMScomms* dataPort, uint16_t address, uint16_t data)
+{
+  assert(dataPort != nullptr);
+  LMScomms::GenericPacket ctrPkt;
+  ctrPkt.cmd = CMD_BRDSPI_WR;
+  ctrPkt.outBuffer.push_back((address >> 8) & 0xFF);
+  ctrPkt.outBuffer.push_back(address & 0xFF);
+  ctrPkt.outBuffer.push_back((data >> 8) & 0xFF);
+  ctrPkt.outBuffer.push_back(data & 0xFF);
+  dataPort->TransferPacket(ctrPkt);
+  return ctrPkt.status == 1 ? SUCCESS : FAILURE;
+}
+
+uint16_t SPI_read(LMScomms* dataPort, uint16_t address)
+{
+  assert(dataPort != nullptr);
+  LMScomms::GenericPacket ctrPkt;
+  ctrPkt.cmd = CMD_BRDSPI_RD;
+  ctrPkt.outBuffer.push_back((address >> 8) & 0xFF);
+  ctrPkt.outBuffer.push_back(address & 0xFF);
+  dataPort->TransferPacket(ctrPkt);
+  if (ctrPkt.inBuffer.size() > 4)
+    return ctrPkt.inBuffer[2] * 256 + ctrPkt.inBuffer[3];
+  else
+    return 0;
+}
+
+static int trx_sodera_start(openair0_device *device)
+{
+  sodera_t *s = (sodera_t*)device->priv;
+
+
+  // init recv and send streaming
+
+  printf("Starting LMS Streaming\n");
+  s->rx_count = 0;
+  s->tx_count = 0;
+  s->rx_timestamp = 0;
+  s->current_handle = 0;
+
+  // switch off RX
+  uint16_t regVal = SPI_read(&s->Port,0x0005);
+  SPI_write(&s->Port,0x0005,regVal & ~0x6);
+
+
+
+
+
+
+  // USB FIFO reset
+  LMScomms::GenericPacket ctrPkt; 
+  ctrPkt.cmd = CMD_USB_FIFO_RST;
+  ctrPkt.outBuffer.push_back(0x01);
+  s->Port.TransferPacket(ctrPkt);
+  ctrPkt.outBuffer[0]=0x00;
+  s->Port.TransferPacket(ctrPkt);
+ 
+  regVal = SPI_read(&s->Port,0x0005);
+  // provide timestamp, set streamTXEN, set TX/RX enable 
+  SPI_write(&s->Port,0x0005,(regVal & ~0x20) | 0x6);
+
+
+  if (s->channelscount==2) {
+    SPI_write(&s->Port,0x0001,0x0003);
+    SPI_write(&s->Port,0x0007,0x000A);
+  }
+  else {
+    SPI_write(&s->Port,0x0001,0x0001);
+    SPI_write(&s->Port,0x0007,0x0008);
+  }
+
+
+  for (int i=0; i< BUFFERSCOUNT ; i++) 
+    s->handles[i] = s->Port.BeginDataReading(&s->buffers_rx[i*BUFFERSIZE],BUFFERSIZE);
+  printf("Armed %d transfers\n",BUFFERSCOUNT);
+  return 0;
+}
+
+static void trx_sodera_end(openair0_device *device)
+{
+  sodera_t *s = (sodera_t*)device->priv;
+
+
+  // stop TX/RX if they were active
+  uint16_t regVal = SPI_read(&s->Port,0x0005);
+  SPI_write(&s->Port,0x0005,regVal & ~0x6);
+
+}
+
+static int trx_sodera_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags)
+{
+  sodera_t *s = (sodera_t*)device->priv;
+
+
+  return 0;
+}
+
+#define DEBUG_READ 1
+
+static int trx_sodera_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc)
+{
+   sodera_t *s = (sodera_t*)device->priv;
+   int samples_received=0,i,j;
+   int nsamps2;  // aligned to upper 32 or 16 byte boundary
+   StreamPacket_t *p;
+   int16_t sampleI,sampleQ;
+   char *pktStart;
+   int offset = 0;
+   int num_p;
+   int ind=0;
+   int buffsize;
+   int spp;
+   int bufindex;
+
+   // this assumes that each request is of size 4096 bytes (spp = 4080/4/channelscount)
+   spp = sizeof(p->data)>>2; // spp = size of payload in samples  
+   spp /= s->channelscount;
+
+#ifdef DEBUG_READ
+   printf("\nIn trx_read\n");
+   printf("s->current_handle %d\n", s->current_handle);
+   printf("s->samples_left_buffer %d\n",s->samples_left_buffer);
+#endif
+   // first get rid of remaining samples
+   if (s->samples_left_buffer > 0) {
+     buffsize = min(s->samples_left_buffer,nsamps);
+     pktStart = ((StreamPacket_t*)&s->buffers_rx[s->current_handle*BUFFERSIZE])->data;
+     pktStart += (spp-s->samples_left_buffer);
+     const int stepSize = s->channelscount * 3;
+
+     for (int b=0;b<buffsize<<2;b+=stepSize) {
+       for (int ch=0;ch<s->channelscount;ch++) {
+	 // I sample
+	 sampleI = (pktStart[b + 1 + 3*ch]&0x0F)<<8;
+	 sampleI |= (pktStart[b + 3*ch]&0xFF);
+	 sampleI = (sampleI<<4)>>4;
+	 // Q sample
+	 sampleQ = (pktStart[b + 2 + 3*ch]&0x0F)<<8;
+	 sampleQ |= (pktStart[b + 1 + 3*ch]&0xFF);
+	 sampleQ = (sampleQ<<4)>>4;
+	 ((uint32_t*)buff[ch])[ind] = ((uint32_t)sampleI) | (((uint32_t)sampleQ)<<16);
+       }
+       ind++;
+     }
+   }
+   if (ind == nsamps) {
+     s->samples_left_buffer -= nsamps;
+     s->rx_count += nsamps;
+     *ptimestamp = s->rx_timestamp;
+     s->rx_timestamp+=nsamps;
+      
+     return(nsamps);
+   }
+   else {
+     s->samples_left_buffer = 0;
+     nsamps -= ind;
+     samples_received = ind;
+   }
+
+   // This is for the left-over part => READ from USB
+
+
+
+   num_p = nsamps / spp;
+   if ((nsamps%spp) > 0)
+     num_p++;
+   s->samples_left_buffer = (num_p*spp)-nsamps;
+  
+
+#ifdef DEBUG_READ
+   printf("num_p %d\n",num_p);
+#endif
+   const int stepSize = s->channelscount * 3;
+
+   for (i=0;i<num_p;i++) {
+
+     bufindex = (s->current_handle+i)&(BUFFERSCOUNT-1);
+     if (s->Port.WaitForReading(s->handles[bufindex],1000) == false) {
+       printf("[recv] Error: request %d samples (%d/%d) WaitForReading timed out\n",nsamps,bufindex,num_p);
+       *ptimestamp = s->rx_timestamp;
+       s->rx_timestamp+=samples_received;
+       return(samples_received);
+     }
+     long bytesToRead=BUFFERSIZE;
+     if (s->Port.FinishDataReading(&s->buffers_rx[bufindex*BUFFERSIZE],bytesToRead,s->handles[bufindex]) != BUFFERSIZE) {  
+       printf("[recv] Error: request %d samples (%d/%d) WaitForReading timed out\n",nsamps,bufindex,num_p);
+       *ptimestamp = s->rx_timestamp;
+       s->rx_timestamp+=samples_received;
+       return(samples_received);
+     }
+    
+     p = (StreamPacket_t*)&s->buffers_rx[bufindex*BUFFERSIZE];
+     // handle timestamp
+     if ((i==0) & (ind==0)) { // grab the timestamp from HW
+       *ptimestamp = p->counter;
+       s->rx_timestamp = p->counter+nsamps; // for next time
+#ifdef DEBUG_READ
+       printf("RX timestamp %d\n",s->rx_timestamp);
+#endif
+     }
+     else { // check the timestamp
+       if (i==0) {
+	 if ((s->rx_timestamp + ind) != p->counter) {
+	   printf("Error, RX timestamp error, got %llu, should be %llu\n",p->counter,s->rx_timestamp+ind);
+	   return(ind);
+	 }
+       }
+       *ptimestamp = s->rx_timestamp;
+       s->rx_timestamp+=nsamps;
+     }
+     pktStart = p->data;
+     for (uint16_t b=0;b<sizeof(p->data);b+=stepSize) {
+       for (int ch=0;ch < s->channelscount;ch++) {
+	 // I sample
+	 sampleI = (pktStart[b + 1 + 3*ch]&0x0F)<<8;
+	 sampleI |= (pktStart[b + 3*ch]&0xFF);
+	 sampleI = (sampleI<<4)>>4;
+	 // Q sample
+	 sampleQ = (pktStart[b + 2 + 3*ch]&0x0F)<<8;
+	 sampleQ |= (pktStart[b + 1 + 3*ch]&0xFF);
+	 sampleQ = (sampleQ<<4)>>4;
+	 ((uint32_t*)buff[ch])[ind] = ((uint32_t)sampleI) | (((uint32_t)sampleQ)<<16);
+       }
+       ind++;	        
+     }
+     samples_received+=spp;
+     // schedule a new transmission for this index
+     s->handles[bufindex] = s->Port.BeginDataReading(&s->buffers_rx[bufindex*BUFFERSIZE],BUFFERSIZE);
+     s->current_handle=(s->current_handle+1)&(BUFFERSCOUNT-1);
+   }   
+
+  //handle the error code
+
+  s->rx_count += samples_received;
+  //  s->rx_timestamp = s->rx_md.time_spec.to_ticks(s->sample_rate);
+
+  return samples_received;
+}
+
+
+
+static bool is_equal(double a, double b)
+{
+  return fabs(a-b) < 1e-6;
+}
+
+int trx_sodera_set_freq(openair0_device* device, openair0_config_t *openair0_cfg, int dummy) {
+
+  sodera_t *s = (sodera_t*)device->priv;
+
+  //  s->usrp->set_tx_freq(openair0_cfg[0].tx_freq[0]);
+  //  s->usrp->set_rx_freq(openair0_cfg[0].rx_freq[0]);
+
+  return(0);
+  
+}
+
+int openair0_set_rx_frequencies(openair0_device* device, openair0_config_t *openair0_cfg) {
+
+  sodera_t *s = (sodera_t*)device->priv;
+  static int first_call=1;
+  static double rf_freq,diff;
+
+  //  uhd::tune_request_t rx_tune_req(openair0_cfg[0].rx_freq[0]);
+
+  //  rx_tune_req.rf_freq_policy = uhd::tune_request_t::POLICY_MANUAL;
+  //  rx_tune_req.rf_freq = openair0_cfg[0].rx_freq[0];
+  //  rf_freq=openair0_cfg[0].rx_freq[0];
+  //  s->usrp->set_rx_freq(rx_tune_req);
+
+  return(0);
+  
+}
+
+int trx_sodera_set_gains(openair0_device* device, 
+		       openair0_config_t *openair0_cfg) {
+
+  sodera_t *s = (sodera_t*)device->priv;
+
+  //  s->usrp->set_tx_gain(openair0_cfg[0].tx_gain[0]);
+  //  ::uhd::gain_range_t gain_range = s->usrp->get_rx_gain_range(0);
+  // limit to maximum gain
+  /* if (openair0_cfg[0].rx_gain[0]-openair0_cfg[0].rx_gain_offset[0] > gain_range.stop()) {
+    
+    printf("RX Gain 0 too high, reduce by %f dB\n",
+	   openair0_cfg[0].rx_gain[0]-openair0_cfg[0].rx_gain_offset[0] - gain_range.stop());	   
+    exit(-1);
+  }
+  s->usrp->set_rx_gain(openair0_cfg[0].rx_gain[0]-openair0_cfg[0].rx_gain_offset[0]);
+  printf("Setting SODERA RX gain to %f (rx_gain %f,gain_range.stop() %f)\n", openair0_cfg[0].rx_gain[0]-openair0_cfg[0].rx_gain_offset[0],openair0_cfg[0].rx_gain[0],gain_range.stop());
+  */
+  return(0);
+}
+
+int trx_sodera_stop(int card) {
+  return(0);
+}
+
+
+rx_gain_calib_table_t calib_table_sodera[] = {
+  {3500000000.0,44.0},
+  {2660000000.0,49.0},
+  {2300000000.0,50.0},
+  {1880000000.0,53.0},
+  {816000000.0,58.0},
+  {-1,0}};
+
+void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index,int bw_gain_adjust) {
+
+  int i=0;
+  // loop through calibration table to find best adjustment factor for RX frequency
+  double min_diff = 6e9,diff,gain_adj=0.0;
+  if (bw_gain_adjust==1) {
+    switch ((int)openair0_cfg[0].sample_rate) {
+    case 30720000:      
+      break;
+    case 23040000:
+      gain_adj=1.25;
+      break;
+    case 15360000:
+      gain_adj=3.0;
+      break;
+    case 7680000:
+      gain_adj=6.0;
+      break;
+    case 3840000:
+      gain_adj=9.0;
+      break;
+    case 1920000:
+      gain_adj=12.0;
+      break;
+    default:
+      printf("unknown sampling rate %d\n",(int)openair0_cfg[0].sample_rate);
+      exit(-1);
+      break;
+    }
+  }
+  while (openair0_cfg->rx_gain_calib_table[i].freq>0) {
+    diff = fabs(openair0_cfg->rx_freq[chain_index] - openair0_cfg->rx_gain_calib_table[i].freq);
+    printf("cal %d: freq %f, offset %f, diff %f\n",
+	   i,
+	   openair0_cfg->rx_gain_calib_table[i].freq,
+	   openair0_cfg->rx_gain_calib_table[i].offset,diff);
+    if (min_diff > diff) {
+      min_diff = diff;
+      openair0_cfg->rx_gain_offset[chain_index] = openair0_cfg->rx_gain_calib_table[i].offset+gain_adj;
+    }
+    i++;
+  }
+  
+}
+
+
+int trx_sodera_get_stats(openair0_device* device) {
+
+  return(0);
+
+}
+int trx_sodera_reset_stats(openair0_device* device) {
+
+  return(0);
+
+}
+
+
+int openair0_dev_init_sodera(openair0_device* device, openair0_config_t *openair0_cfg)
+{
+
+  sodera_t *s=&sodera_state;
+
+  size_t i;
+
+  // Initialize SODERA device
+  s->Port.RefreshDeviceList();
+  vector<string> deviceNames=s->Port.GetDeviceList();
+
+  if (deviceNames.size() == 1) {
+    if (s->Port.Open(0) != IConnection::SUCCESS) {
+      printf("Cannot open SoDeRa\n");
+      exit(-1);
+    }
+    LMSinfo devInfo = s->Port.GetInfo();
+    printf("Device %s, HW: %d, FW: %d, Protocol %d\n",
+	   GetDeviceName(devInfo.device),
+	   (int)devInfo.hardware,
+	   (int)devInfo.firmware,
+	   (int)devInfo.protocol);
+    
+    printf("Configuring Si5351C\n");
+    s->Si.Initialize(&s->Port);
+    s->Si.SetPLL(0, 25000000, 0);
+    s->Si.SetPLL(1, 25000000, 0);
+    s->Si.SetClock(0, 27000000, true, false);
+    s->Si.SetClock(1, 27000000, true, false);
+    for (int i = 2; i < 8; ++i)
+      s->Si.SetClock(i, 27000000, false, false);
+    Si5351C::Status status = s->Si.ConfigureClocks();
+    if (status != Si5351C::SUCCESS)
+      {
+	printf("Failed to configure Si5351C");
+	exit(-1);
+      }
+    status = s->Si.UploadConfiguration();
+    if (status != Si5351C::SUCCESS)
+      printf("Failed to upload Si5351C configuration");
+    
+
+    printf("Configuring LMS7002\n");
+    
+    int bw_gain_adjust=0;
+
+   
+    openair0_cfg[0].rx_gain_calib_table = calib_table_sodera;
+
+    switch ((int)openair0_cfg[0].sample_rate) {
+    case 30720000:
+      // from usrp_time_offset
+      openair0_cfg[0].samples_per_packet    = 2048;
+      openair0_cfg[0].tx_sample_advance     = 15;
+      openair0_cfg[0].tx_bw                 = 20e6;
+      openair0_cfg[0].rx_bw                 = 20e6;
+      openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet;
+      break;
+    case 15360000:
+      openair0_cfg[0].samples_per_packet    = 2048;
+      openair0_cfg[0].tx_sample_advance     = 45;
+      openair0_cfg[0].tx_bw                 = 10e6;
+      openair0_cfg[0].rx_bw                 = 10e6;
+      openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet;
+      break;
+    case 7680000:
+      openair0_cfg[0].samples_per_packet    = 1024;
+      openair0_cfg[0].tx_sample_advance     = 50;
+      openair0_cfg[0].tx_bw                 = 5e6;
+      openair0_cfg[0].rx_bw                 = 5e6;
+      openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet;
+      break;
+    case 1920000:
+      openair0_cfg[0].samples_per_packet    = 256;
+      openair0_cfg[0].tx_sample_advance     = 50;
+      openair0_cfg[0].tx_bw                 = 1.25e6;
+      openair0_cfg[0].rx_bw                 = 1.25e6;
+      openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet;
+      break;
+    default:
+      printf("Error: unknown sampling rate %f\n",openair0_cfg[0].sample_rate);
+      exit(-1);
+      break;
+
+    }
+
+    s->lmsControl = LMS7002M(&s->Port);
+
+    liblms7_status opStatus;
+    s->lmsControl.ResetChip();
+    opStatus = s->lmsControl.LoadConfig(openair0_cfg[0].configFilename);
+    
+    if (opStatus != LIBLMS7_SUCCESS) {
+      printf("Failed to load configuration file %s\n",openair0_cfg[0].configFilename);
+      exit(-1);
+    }
+    opStatus = s->lmsControl.UploadAll();
+
+    if (opStatus != LIBLMS7_SUCCESS) {
+      printf("Failed to upload configuration file\n");
+      exit(-1);
+    }
+    
+    opStatus = s->lmsControl.SetFrequencySX(LMS7002M::Tx, openair0_cfg[0].tx_freq[0]/1e6,30.72);
+
+    if (opStatus != LIBLMS7_SUCCESS) {
+      printf("Cannot set TX frequency %f MHz\n",openair0_cfg[0].tx_freq[0]/1e6);
+      exit(-1);
+    }
+
+    opStatus = s->lmsControl.SetFrequencySX(LMS7002M::Rx, openair0_cfg[0].rx_freq[0]/1e6,30.72);
+
+    if (opStatus != LIBLMS7_SUCCESS) {
+      printf("Cannot set RX frequency %f MHz\n",openair0_cfg[0].rx_freq[0]/1e6);
+      exit(-1);
+    }
+
+
+    
+    // this makes RX/TX sampling rates equal
+    opStatus = s->lmsControl.Modify_SPI_Reg_bits(EN_ADCCLKH_CLKGN,0);
+    if (opStatus != LIBLMS7_SUCCESS) {
+      printf("Cannot modify SPI (EN_ADCCLKH_CLKGN)\n");
+      exit(-1);
+    }
+    opStatus = s->lmsControl.Modify_SPI_Reg_bits(CLKH_OV_CLKL_CGEN,2);
+    if (opStatus != LIBLMS7_SUCCESS) {
+      printf("Cannot modify SPI (CLKH_OV_CLKL_CGEN)\n");
+      exit(-1);
+    }
+
+    const float cgen_freq_MHz = 245.76;
+    const int interpolation   = 0; // real interpolation = 2
+    const int decimation      = 0; // real decimation = 2
+    opStatus = s->lmsControl.SetInterfaceFrequency(cgen_freq_MHz,interpolation,decimation);
+    if (opStatus != LIBLMS7_SUCCESS) {
+      printf("Cannot SetInterfaceFrequency (%f,%d,%d)\n",cgen_freq_MHz,interpolation,decimation);
+      exit(-1);
+    }
+    /*
+    // Run calibration procedure
+    float txrx_calibrationBandwidth_MHz = 5;
+    opStatus = s->lmsControl.CalibrateTx(txrx_calibrationBandwidth_MHz);
+    if (opStatus != LIBLMS7_SUCCESS){
+      printf("TX Calibration failed\n");
+      exit(-1);
+    }
+    opStatus = s->lmsControl.CalibrateRx(txrx_calibrationBandwidth_MHz);
+    if (opStatus != LIBLMS7_SUCCESS){
+      printf("RX Calibration failed\n");
+      exit(-1);
+    }
+    */
+        
+    s->lmsStream = new LMS_StreamBoard(&s->Port);    
+    LMS_StreamBoard::Status opStreamStatus; 
+    // this will configure that sampling rate at output of FPGA
+    opStreamStatus = s->lmsStream->ConfigurePLL(&s->Port,openair0_cfg[0].sample_rate,openair0_cfg[0].sample_rate,90);
+    if (opStatus != LIBLMS7_SUCCESS){
+      printf("Sample rate programming failed\n");
+      exit(-1);
+    }
+    
+    /*
+      ::uhd::gain_range_t gain_range = s->usrp->get_rx_gain_range(i);
+      // limit to maximum gain
+      if (openair0_cfg[0].rx_gain[i]-openair0_cfg[0].rx_gain_offset[i] > gain_range.stop()) {
+	
+        printf("RX Gain %lu too high, lower by %f dB\n",i,openair0_cfg[0].rx_gain[i]-openair0_cfg[0].rx_gain_offset[i] - gain_range.stop());
+	exit(-1);
+      }
+      s->usrp->set_rx_gain(openair0_cfg[0].rx_gain[i]-openair0_cfg[0].rx_gain_offset[i],i);
+      printf("RX Gain %lu %f (%f) => %f (max %f)\n",i,
+	     openair0_cfg[0].rx_gain[i],openair0_cfg[0].rx_gain_offset[i],
+	     openair0_cfg[0].rx_gain[i]-openair0_cfg[0].rx_gain_offset[i],gain_range.stop());
+    }
+  }
+  for(i=0;i<s->usrp->get_tx_num_channels();i++) {
+    if (i<openair0_cfg[0].tx_num_channels) {
+      s->usrp->set_tx_rate(openair0_cfg[0].sample_rate,i);
+      s->usrp->set_tx_bandwidth(openair0_cfg[0].tx_bw,i);
+      printf("Setting tx freq/gain on channel %lu/%lu: BW %f (readback %f)\n",i,s->usrp->get_tx_num_channels(),openair0_cfg[0].tx_bw/1e6,s->usrp->get_tx_bandwidth(i)/1e6);
+      s->usrp->set_tx_freq(openair0_cfg[0].tx_freq[i],i);
+      s->usrp->set_tx_gain(openair0_cfg[0].tx_gain[i],i);
+    }
+  }
+  */
+
+  // create tx & rx streamer
+
+  //stream_args_rx.args["spp"] = str(boost::format("%d") % 2048);//(openair0_cfg[0].rx_num_channels*openair0_cfg[0].samples_per_packet));
+  
+  /*
+  for (i=0;i<openair0_cfg[0].rx_num_channels;i++) {
+    if (i<openair0_cfg[0].rx_num_channels) {
+      printf("RX Channel %lu\n",i);
+      std::cout << boost::format("Actual RX sample rate: %fMSps...") % (s->usrp->get_rx_rate(i)/1e6) << std::endl;
+      std::cout << boost::format("Actual RX frequency: %fGHz...") % (s->usrp->get_rx_freq(i)/1e9) << std::endl;
+      std::cout << boost::format("Actual RX gain: %f...") % (s->usrp->get_rx_gain(i)) << std::endl;
+      std::cout << boost::format("Actual RX bandwidth: %fM...") % (s->usrp->get_rx_bandwidth(i)/1e6) << std::endl;
+      std::cout << boost::format("Actual RX antenna: %s...") % (s->usrp->get_rx_antenna(i)) << std::endl;
+    }
+  }
+  
+  for (i=0;i<openair0_cfg[0].tx_num_channels;i++) {
+
+    if (i<openair0_cfg[0].tx_num_channels) { 
+      printf("TX Channel %lu\n",i);
+      std::cout << std::endl<<boost::format("Actual TX sample rate: %fMSps...") % (s->usrp->get_tx_rate(i)/1e6) << std::endl;
+      std::cout << boost::format("Actual TX frequency: %fGHz...") % (s->usrp->get_tx_freq(i)/1e9) << std::endl;
+      std::cout << boost::format("Actual TX gain: %f...") % (s->usrp->get_tx_gain(i)) << std::endl;
+      std::cout << boost::format("Actual TX bandwidth: %fM...") % (s->usrp->get_tx_bandwidth(i)/1e6) << std::endl;
+      std::cout << boost::format("Actual TX antenna: %s...") % (s->usrp->get_tx_antenna(i)) << std::endl;
+    }
+  */
+  }
+  else {
+    printf("Please connect SoDeRa\n");
+    exit(-1);
+  }
+
+  device->priv = s;
+  device->trx_start_func = trx_sodera_start;
+  device->trx_write_func = trx_sodera_write;
+  device->trx_read_func  = trx_sodera_read;
+  device->trx_get_stats_func = trx_sodera_get_stats;
+  device->trx_reset_stats_func = trx_sodera_reset_stats;
+  device->trx_end_func   = trx_sodera_end;
+  device->trx_stop_func  = trx_sodera_stop;
+  device->trx_set_freq_func = trx_sodera_set_freq;
+  device->trx_set_gains_func   = trx_sodera_set_gains;
+  
+  s->sample_rate   = openair0_cfg[0].sample_rate;
+  s->channelscount = openair0_cfg[0].rx_num_channels;
+
+  // TODO:
+  return 0;
+}
diff --git a/targets/ARCH/LMSSDR/enb_sodera_highband_10MHz_rx19dB_txfull.ini b/targets/ARCH/LMSSDR/enb_sodera_highband_10MHz_rx19dB_txfull.ini
new file mode 100644
index 0000000000000000000000000000000000000000..e4e420c33435b03ab74cd530465f70c11f20854d
--- /dev/null
+++ b/targets/ARCH/LMSSDR/enb_sodera_highband_10MHz_rx19dB_txfull.ini
@@ -0,0 +1,1128 @@
+[file_info]
+type=lms7002m_minimal_config
+version=1
+[lms7002_registers_a]
+0x0493=0x0000
+0x0492=0x0000
+0x0491=0x0000
+0x029B=0x0000
+0x048E=0x0000
+0x0022=0x07FF
+0x0283=0x0000
+0x0487=0x0000
+0x0486=0x0000
+0x045F=0x0000
+0x0480=0x0000
+0x0460=0x0000
+0x0447=0x0000
+0x045A=0x0000
+0x02DA=0x0000
+0x0458=0x0000
+0x0314=0x0000
+0x0456=0x0000
+0x0559=0xACB9
+0x0451=0x0000
+0x0390=0x0000
+0x044B=0x0000
+0x0448=0x0000
+0x0454=0x0000
+0x0446=0x0000
+0x04CA=0x0000
+0x0444=0x0000
+0x0443=0x0000
+0x0508=0xEF99
+0x0441=0x0000
+0x040D=0x0000
+0x040B=0x000F
+0x0409=0x0000
+0x0580=0xEFF2
+0x0407=0x0000
+0x0405=0x0000
+0x0254=0x0000
+0x0404=0x0000
+0x00A0=0x6565
+0x0560=0x174B
+0x0403=0x0013
+0x0402=0x07D9
+0x055E=0xDB10
+0x03A7=0x0000
+0x0520=0x174B
+0x03A5=0x0000
+0x03A4=0x0000
+0x03A3=0x0000
+0x03A2=0x0000
+0x051C=0x0000
+0x048D=0x0000
+0x059A=0x0000
+0x03A1=0x0000
+0x02A2=0x0000
+0x04E1=0x0000
+0x039F=0x0000
+0x0248=0x0000
+0x039B=0x0000
+0x0408=0x0000
+0x0398=0x0000
+0x0393=0x0000
+0x0305=0x0000
+0x038E=0x0000
+0x0324=0x0000
+0x02E7=0x0000
+0x038D=0x0000
+0x0387=0x0000
+0x03A0=0x0000
+0x02D0=0x0000
+0x009A=0x658C
+0x054E=0x8184
+0x0386=0x0000
+0x040F=0x43E4
+0x04E3=0x0000
+0x0389=0x0000
+0x054F=0x18C9
+0x0385=0x0000
+0x0315=0x0000
+0x0384=0x0000
+0x0382=0x0000
+0x0288=0x0000
+0x0366=0x0000
+0x0365=0x0000
+0x0364=0x0000
+0x0325=0x0000
+0x0081=0x0000
+0x0362=0x0000
+0x038A=0x0000
+0x035E=0x0000
+0x035D=0x0000
+0x0442=0x0000
+0x0449=0x0000
+0x035A=0x0000
+0x02C8=0x0000
+0x0452=0x0000
+0x0299=0x0000
+0x0359=0x0000
+0x0358=0x0000
+0x048B=0x0000
+0x0354=0x0000
+0x0351=0x0000
+0x03A6=0x0000
+0x0293=0x0000
+0x034E=0x0000
+0x035C=0x0000
+0x034D=0x0000
+0x034B=0x0000
+0x011A=0x2E14
+0x0455=0x0000
+0x034A=0x0000
+0x0348=0x0000
+0x0084=0x0400
+0x0498=0x0000
+0x035B=0x0000
+0x0505=0x00D8
+0x0345=0x0000
+0x0484=0x0000
+0x0586=0x196B
+0x0344=0x0000
+0x0561=0xAB08
+0x0343=0x0000
+0x0342=0x0000
+0x0380=0x0000
+0x0327=0x0000
+0x0322=0x0000
+0x059B=0x0000
+0x0321=0x0000
+0x045E=0x0000
+0x0440=0x0024
+0x031D=0x0000
+0x0363=0x0000
+0x031A=0x0000
+0x031C=0x0000
+0x028F=0x0000
+0x0341=0x0000
+0x0287=0x0000
+0x0318=0x0000
+0x031F=0x0000
+0x0316=0x0000
+0x030D=0x0000
+0x040E=0x0003
+0x0352=0x0000
+0x028C=0x0000
+0x0360=0x0000
+0x0313=0x0000
+0x0461=0x0000
+0x010A=0x104C
+0x051B=0xB77F
+0x0312=0x0000
+0x0346=0x0000
+0x024E=0x0000
+0x0311=0x0000
+0x02D6=0x0000
+0x030C=0x0000
+0x04DF=0x0000
+0x030B=0x0000
+0x0392=0x0000
+0x030A=0x0000
+0x029F=0x0000
+0x0309=0x0000
+0x048A=0x0000
+0x0308=0x0000
+0x0588=0xE6C7
+0x0397=0x0000
+0x02E3=0x0000
+0x049C=0x0000
+0x044A=0x0000
+0x04A4=0x0000
+0x0306=0x0000
+0x0304=0x0000
+0x04D5=0x0000
+0x0303=0x0000
+0x0302=0x0000
+0x0510=0xE6C7
+0x044E=0x0000
+0x0300=0x0000
+0x034F=0x0000
+0x045B=0x0000
+0x02E6=0x0000
+0x00A3=0x6565
+0x04DA=0x0000
+0x025E=0x0000
+0x020A=0x0080
+0x0102=0x3180
+0x020C=0x8000
+0x05A2=0x0000
+0x040A=0x1000
+0x0556=0xA2B5
+0x0243=0x0000
+0x051D=0x4F91
+0x0259=0x0000
+0x02D5=0x0000
+0x02E1=0x0000
+0x011D=0xAAAA
+0x039E=0x0000
+0x0252=0x0000
+0x0204=0xC016
+0x0255=0x0000
+0x0281=0x0000
+0x0200=0x0301
+0x0594=0xF40D
+0x02C5=0x0000
+0x0406=0x0000
+0x030F=0x0000
+0x025D=0x0000
+0x0319=0x0000
+0x0121=0x3760
+0x0101=0x7800
+0x025B=0x0000
+0x02C6=0x0000
+0x0558=0x5009
+0x0021=0x0E9F
+0x04C2=0x0000
+0x0290=0x0000
+0x02DF=0x0000
+0x0291=0x0000
+0x0296=0x0000
+0x029C=0x0000
+0x028D=0x0000
+0x02A1=0x0000
+0x008B=0x2756
+0x02A3=0x0000
+0x05A4=0x0000
+0x02A7=0x0000
+0x0483=0x0000
+0x0201=0x07FF
+0x02C2=0x0000
+0x02C4=0x0000
+0x044D=0x0000
+0x02E2=0x0000
+0x02D1=0x0000
+0x0546=0x8D44
+0x04C8=0x0000
+0x0207=0x0000
+0x04C6=0x0000
+0x0096=0x0000
+0x0093=0x0000
+0x0250=0x0000
+0x02CB=0x0000
+0x02D3=0x0000
+0x0494=0x0000
+0x04CF=0x0000
+0x025F=0x0000
+0x0251=0x0000
+0x0488=0x0000
+0x0496=0x0000
+0x04C3=0x0000
+0x0100=0x3409
+0x04CC=0x0000
+0x02A5=0x0000
+0x0257=0x0000
+0x04D6=0x0000
+0x04A6=0x0000
+0x049A=0x0000
+0x049B=0x0000
+0x0097=0x0000
+0x011E=0x0A2A
+0x0285=0x0000
+0x0280=0x0000
+0x049E=0x0000
+0x0020=0xFFFD
+0x02DD=0x0000
+0x0297=0x0000
+0x049F=0x0000
+0x0522=0xDB10
+0x044C=0x0000
+0x0355=0x0000
+0x04A0=0x0000
+0x02CF=0x0000
+0x04D1=0x0000
+0x0526=0xBE2A
+0x0092=0x0001
+0x031B=0x0000
+0x0541=0x4C24
+0x0518=0xEFF2
+0x0543=0xBD96
+0x02C0=0x0000
+0x0499=0x0000
+0x04A1=0x0000
+0x058D=0xF5EF
+0x02D7=0x0000
+0x0513=0xDAA2
+0x0549=0x18C9
+0x0552=0x8D44
+0x0521=0x5852
+0x0509=0x0605
+0x0286=0x0000
+0x024F=0x0000
+0x04E0=0x0000
+0x0545=0x364E
+0x0349=0x0000
+0x0555=0xBD96
+0x04E4=0x0000
+0x02E4=0x0000
+0x0551=0xD7B7
+0x055D=0xA6B5
+0x0298=0x0000
+0x055F=0x5852
+0x009E=0x658C
+0x0547=0xD7B7
+0x0598=0xF61D
+0x0123=0x067B
+0x0497=0x0000
+0x04A5=0x0000
+0x0565=0xB77F
+0x0124=0x0000
+0x0592=0x0DF1
+0x0591=0xFCFE
+0x0548=0x79FA
+0x04D2=0x0000
+0x0599=0x0000
+0x0511=0x1D10
+0x0506=0x0DF1
+0x0595=0x00BC
+0x0584=0xE7E2
+0x0242=0x0000
+0x025A=0x0000
+0x04E2=0x0000
+0x04C5=0x0000
+0x058C=0xEA50
+0x0450=0x0000
+0x0596=0x0A94
+0x05A7=0x0000
+0x058A=0x17DC
+0x059D=0x0000
+0x0485=0x0000
+0x058E=0x1316
+0x0550=0x79FA
+0x0554=0x6901
+0x0593=0x00D8
+0x0542=0xA2B5
+0x0553=0x364E
+0x0563=0x4F91
+0x024D=0x0000
+0x0567=0x4049
+0x055A=0xBE2A
+0x0295=0x0000
+0x0566=0x0906
+0x028A=0x0000
+0x059C=0x0000
+0x04DD=0x0000
+0x054C=0x7FFF
+0x0582=0x150F
+0x0585=0xDAA2
+0x0109=0x8CC1
+0x04A2=0x0000
+0x0292=0x0000
+0x059F=0x0000
+0x0583=0x2E45
+0x050E=0x17DC
+0x0516=0x150F
+0x0523=0xA6B5
+0x0525=0x57AC
+0x0206=0x0000
+0x051A=0x0906
+0x055C=0x3347
+0x0514=0xE7E2
+0x050F=0xEA5F
+0x05A6=0x0000
+0x051E=0xF524
+0x050A=0x1316
+0x04C7=0x0000
+0x049D=0x0000
+0x0527=0xACB9
+0x050C=0xEA50
+0x0087=0x0000
+0x0399=0x0000
+0x050B=0xF5EF
+0x0507=0xFCFE
+0x010D=0x00DE
+0x04C4=0x0000
+0x0495=0x0000
+0x0246=0x0000
+0x0503=0x00BC
+0x0320=0x0000
+0x0323=0x0000
+0x02E5=0x0000
+0x055B=0x57AC
+0x0114=0x0110
+0x04D8=0x0000
+0x04E7=0x0000
+0x04D0=0x0000
+0x04E6=0x0000
+0x00AE=0x0000
+0x0544=0x6901
+0x0258=0x0000
+0x0502=0x0A94
+0x04DE=0x0000
+0x058B=0x0F45
+0x0028=0x0101
+0x029E=0x0000
+0x04DC=0x0000
+0x04D9=0x0000
+0x0557=0x4C24
+0x058F=0x0605
+0x04DB=0x0000
+0x04D7=0x0000
+0x059E=0x0000
+0x024C=0x0000
+0x02DC=0x0000
+0x04D4=0x0000
+0x0504=0xF40D
+0x02C3=0x0000
+0x04C1=0x0000
+0x04D3=0x0000
+0x0590=0xEF99
+0x04CE=0x0000
+0x05A5=0x0000
+0x04A7=0x0000
+0x0489=0x0000
+0x02E0=0x0000
+0x0118=0x018C
+0x002A=0x0086
+0x0245=0x0000
+0x045D=0x0000
+0x0581=0xC89D
+0x02D2=0x0000
+0x039C=0x0000
+0x002B=0x4032
+0x02A0=0x0000
+0x010E=0x0285
+0x0394=0x0000
+0x0459=0x0000
+0x0088=0x04F0
+0x0085=0x0001
+0x0089=0x0048
+0x0256=0x0000
+0x0111=0x0099
+0x0095=0x0000
+0x0203=0x2F99
+0x030E=0x0000
+0x0482=0x0000
+0x05A0=0x0000
+0x009C=0x658C
+0x0381=0x0000
+0x0122=0x033F
+0x0110=0x0BFF
+0x0026=0x0101
+0x0294=0x0000
+0x009D=0x6565
+0x0524=0x3347
+0x0106=0x3182
+0x028E=0x0000
+0x0326=0x0000
+0x0113=0x03C3
+0x0391=0x0000
+0x04CB=0x0000
+0x010F=0x3042
+0x0119=0x18DF
+0x02A6=0x0000
+0x05A1=0x0000
+0x02C9=0x0000
+0x0500=0xF61D
+0x039D=0x0000
+0x011F=0x3600
+0x0395=0x0000
+0x024B=0x0000
+0x045C=0x0000
+0x0247=0x0000
+0x0512=0x196B
+0x04E5=0x0000
+0x0024=0x50D8
+0x0353=0x0000
+0x050D=0x0F45
+0x02CD=0x0000
+0x0490=0x0000
+0x0501=0xFDFB
+0x034C=0x0000
+0x00AA=0x0000
+0x0350=0x0000
+0x0445=0x0000
+0x048F=0x0000
+0x008A=0x0491
+0x0453=0x0000
+0x0260=0x0000
+0x00A1=0x6565
+0x0356=0x0000
+0x0241=0x0000
+0x008C=0x267B
+0x038F=0x0000
+0x054A=0x8184
+0x00A4=0x6565
+0x0401=0x07FF
+0x04CD=0x0000
+0x0249=0x0000
+0x002C=0x0000
+0x054D=0xF7A3
+0x00A6=0x0001
+0x002D=0xFFFF
+0x00AC=0x2000
+0x0253=0x0000
+0x028B=0x0000
+0x040C=0x40F8
+0x0310=0x0000
+0x0099=0x6565
+0x00A2=0x6565
+0x0589=0xEA5F
+0x002F=0x3840
+0x035F=0x0000
+0x0597=0xFDFB
+0x0116=0x8180
+0x02CC=0x0000
+0x0025=0x0101
+0x0562=0xF524
+0x011C=0xA941
+0x0289=0x0000
+0x0282=0x0000
+0x0307=0x0000
+0x038C=0x0000
+0x02C7=0x0000
+0x054B=0xF7A3
+0x0519=0x4049
+0x009F=0x658C
+0x025C=0x0000
+0x0515=0x2E45
+0x00A5=0x6565
+0x0301=0x0000
+0x02C1=0x0000
+0x0481=0x0000
+0x0517=0xC89D
+0x00A8=0x0000
+0x0564=0x0000
+0x00AB=0x0040
+0x0261=0x0000
+0x002E=0x0000
+0x02DE=0x0000
+0x02A4=0x0000
+0x0540=0x5009
+0x00AD=0x03FF
+0x0029=0x0101
+0x024A=0x0000
+0x00A7=0x6565
+0x0027=0x05E4
+0x0117=0x100C
+0x0098=0x0000
+0x0108=0xFC26
+0x020B=0x4000
+0x0383=0x0000
+0x0202=0x0794
+0x0086=0x4101
+0x010C=0x8865
+0x02D8=0x0000
+0x0347=0x0000
+0x0457=0x0000
+0x0103=0x0612
+0x0104=0x0088
+0x0357=0x0000
+0x02DB=0x0000
+0x0400=0x0101
+0x009B=0x6565
+0x0105=0x0007
+0x05A3=0x0000
+0x0240=0x0028
+0x0367=0x0000
+0x044F=0x0000
+0x038B=0x0000
+0x02D9=0x0000
+0x02CE=0x0000
+0x0284=0x0000
+0x0396=0x0000
+0x029A=0x0000
+0x051F=0xAB08
+0x0361=0x0000
+0x0205=0x0000
+0x031E=0x0000
+0x04C0=0x0000
+0x0587=0x1D10
+0x0023=0x5550
+0x048C=0x0000
+0x0112=0x3171
+0x039A=0x0000
+0x0115=0x0009
+0x00A9=0x8000
+0x0317=0x0000
+0x0244=0x0000
+0x0094=0x0000
+0x0340=0x0000
+0x0208=0x0170
+0x04A3=0x0000
+0x029D=0x0000
+0x0388=0x0000
+0x0120=0xB9FF
+0x04C9=0x0000
+0x02CA=0x0000
+0x0209=0x0000
+0x0082=0x8001
+0x02D4=0x0000
+0x0107=0x318C
+[lms7002_registers_b]
+0x04E1=0x0000
+0x03A1=0x0000
+0x02A2=0x0000
+0x04E0=0x0000
+0x04DE=0x0000
+0x058B=0x0000
+0x04DC=0x0000
+0x04DB=0x0000
+0x04D9=0x0000
+0x04D5=0x0000
+0x0304=0x0000
+0x04D4=0x0000
+0x0504=0x0000
+0x04D3=0x0000
+0x04D2=0x0000
+0x0548=0x0000
+0x04D0=0x0000
+0x04CF=0x0000
+0x025F=0x0000
+0x04CE=0x0000
+0x04CC=0x0000
+0x02A5=0x0000
+0x04C6=0x0000
+0x0207=0x0000
+0x04C1=0x0000
+0x02C3=0x0000
+0x04C9=0x0000
+0x02CA=0x0000
+0x04C0=0x0000
+0x031E=0x0000
+0x04D6=0x0000
+0x0257=0x0000
+0x04A6=0x0000
+0x04A5=0x0000
+0x04A2=0x0000
+0x0109=0x61C1
+0x049D=0x0000
+0x04C7=0x0000
+0x049C=0x0000
+0x0397=0x0000
+0x02E3=0x0000
+0x0499=0x0000
+0x02C0=0x0000
+0x0496=0x0000
+0x04C3=0x0000
+0x0493=0x0000
+0x04A1=0x0000
+0x0492=0x0000
+0x0491=0x0000
+0x029B=0x0000
+0x048E=0x0000
+0x0283=0x0000
+0x048C=0x0000
+0x048B=0x0000
+0x0358=0x0000
+0x0487=0x0000
+0x0486=0x0000
+0x045F=0x0000
+0x0480=0x0000
+0x0460=0x0000
+0x0447=0x0000
+0x045A=0x0000
+0x02DA=0x0000
+0x0458=0x0000
+0x0314=0x0000
+0x0456=0x0000
+0x0559=0x0000
+0x0453=0x0000
+0x0451=0x0000
+0x0390=0x0000
+0x044D=0x0000
+0x02E2=0x0000
+0x044B=0x0000
+0x0448=0x0000
+0x0454=0x0000
+0x0446=0x0000
+0x04CA=0x0000
+0x0444=0x0000
+0x0443=0x0000
+0x0508=0x0000
+0x0441=0x0000
+0x040D=0x0000
+0x040B=0x7FFF
+0x0409=0x0000
+0x0580=0x0000
+0x0407=0x0000
+0x0405=0x0000
+0x0254=0x0000
+0x0404=0x0000
+0x0560=0x0000
+0x04D8=0x0000
+0x0403=0x0000
+0x0402=0x07FF
+0x055E=0x0000
+0x03A7=0x0000
+0x0520=0x0000
+0x03A5=0x0000
+0x03A4=0x0000
+0x03A3=0x0000
+0x03A2=0x0000
+0x051C=0x0000
+0x048D=0x0000
+0x059A=0x0000
+0x049E=0x0000
+0x039F=0x0000
+0x0248=0x0000
+0x039B=0x0000
+0x0399=0x0000
+0x0408=0x0000
+0x0398=0x0000
+0x0497=0x0000
+0x0123=0x267B
+0x0394=0x0000
+0x0459=0x0000
+0x0393=0x0000
+0x0305=0x0000
+0x038E=0x0000
+0x0324=0x0000
+0x02E7=0x0000
+0x038D=0x0000
+0x0395=0x0000
+0x038A=0x0000
+0x0362=0x0000
+0x0387=0x0000
+0x0200=0x0081
+0x0594=0x0000
+0x02C5=0x0000
+0x02A7=0x0000
+0x0318=0x0000
+0x0544=0x0000
+0x049A=0x0000
+0x0388=0x0000
+0x0120=0xB9FF
+0x020A=0x0080
+0x0102=0x3180
+0x0290=0x0000
+0x02DF=0x0000
+0x0291=0x0000
+0x0295=0x0000
+0x055A=0x0000
+0x029C=0x0000
+0x010E=0x2040
+0x02A0=0x0000
+0x010F=0x3042
+0x02A6=0x0000
+0x0119=0x18CB
+0x02D2=0x0000
+0x039C=0x0000
+0x028D=0x0000
+0x02A1=0x0000
+0x02C2=0x0000
+0x045E=0x0000
+0x031D=0x0000
+0x0440=0x0020
+0x02C4=0x0000
+0x04D1=0x0000
+0x02CF=0x0000
+0x02C1=0x0000
+0x02C7=0x0000
+0x054B=0x0000
+0x02D3=0x0000
+0x04C8=0x0000
+0x02D1=0x0000
+0x0546=0x0000
+0x0306=0x0000
+0x02D7=0x0000
+0x058D=0x0000
+0x0457=0x0000
+0x02D8=0x0000
+0x0347=0x0000
+0x0103=0x0A12
+0x0104=0x0088
+0x0357=0x0000
+0x02DB=0x0000
+0x0400=0x0081
+0x0209=0x0000
+0x0297=0x0000
+0x02DD=0x0000
+0x029E=0x0000
+0x02DE=0x0000
+0x0527=0x0000
+0x02D5=0x0000
+0x02E1=0x0000
+0x0259=0x0000
+0x0481=0x0000
+0x0517=0x0000
+0x029A=0x0000
+0x051F=0x0000
+0x0483=0x0000
+0x0201=0x07FF
+0x0507=0x0000
+0x0321=0x0000
+0x034F=0x0000
+0x0296=0x0000
+0x0510=0x0000
+0x0302=0x0000
+0x038C=0x0000
+0x0307=0x0000
+0x0282=0x0000
+0x0392=0x0000
+0x030B=0x0000
+0x0588=0x0000
+0x0308=0x0000
+0x048A=0x0000
+0x044A=0x0000
+0x04A4=0x0000
+0x04C4=0x0000
+0x010D=0x009E
+0x0300=0x0000
+0x0587=0x0000
+0x044E=0x0000
+0x0309=0x0000
+0x0585=0x0000
+0x02E5=0x0000
+0x055B=0x0000
+0x0114=0x008D
+0x0323=0x0000
+0x0320=0x0000
+0x0503=0x0000
+0x0513=0x0000
+0x0319=0x0000
+0x0260=0x0000
+0x0549=0x0000
+0x0552=0x0000
+0x0509=0x0000
+0x0521=0x0000
+0x0286=0x0000
+0x04D7=0x0000
+0x059E=0x0000
+0x0557=0x0000
+0x058F=0x0000
+0x0322=0x0000
+0x059B=0x0000
+0x0545=0x0000
+0x0349=0x0000
+0x0555=0x0000
+0x02E4=0x0000
+0x04E4=0x0000
+0x0551=0x0000
+0x0312=0x0000
+0x055D=0x0000
+0x0298=0x0000
+0x055F=0x0000
+0x011D=0xAAAA
+0x039E=0x0000
+0x0547=0x0000
+0x0598=0x0000
+0x0449=0x0000
+0x0564=0x0000
+0x0242=0x0000
+0x0525=0x0000
+0x0523=0x0000
+0x0565=0x0000
+0x0124=0x0000
+0x0592=0x0000
+0x0591=0x0000
+0x0563=0x0000
+0x024D=0x0000
+0x0567=0x0000
+0x05A5=0x0000
+0x0566=0x0000
+0x030A=0x0000
+0x029F=0x0000
+0x054C=0x0000
+0x0582=0x0000
+0x0599=0x0000
+0x0511=0x0000
+0x0506=0x0000
+0x0301=0x0000
+0x0595=0x0000
+0x0584=0x0000
+0x058C=0x0000
+0x051E=0x0000
+0x05A6=0x0000
+0x050F=0x0000
+0x0590=0x0000
+0x05A0=0x0000
+0x0596=0x0000
+0x05A7=0x0000
+0x0562=0x0000
+0x058A=0x0000
+0x059D=0x0000
+0x0485=0x0000
+0x0581=0x0000
+0x045D=0x0000
+0x0245=0x0000
+0x0310=0x0000
+0x058E=0x0000
+0x05A2=0x0000
+0x054D=0x0000
+0x020C=0x7FFF
+0x0589=0x0000
+0x0522=0x0000
+0x049F=0x0000
+0x031F=0x0000
+0x0292=0x0000
+0x059F=0x0000
+0x0583=0x0000
+0x0543=0x0000
+0x0317=0x0000
+0x0244=0x0000
+0x0554=0x0000
+0x0593=0x0000
+0x05A4=0x0000
+0x02A3=0x0000
+0x0553=0x0000
+0x0542=0x0000
+0x0519=0x0000
+0x024F=0x0000
+0x0524=0x0000
+0x0518=0x0000
+0x0354=0x0000
+0x0526=0x0000
+0x031B=0x0000
+0x050E=0x0000
+0x0516=0x0000
+0x02CB=0x0000
+0x0250=0x0000
+0x031C=0x0000
+0x028F=0x0000
+0x051A=0x0000
+0x055C=0x0000
+0x0514=0x0000
+0x050A=0x0000
+0x050C=0x0000
+0x050B=0x0000
+0x04E7=0x0000
+0x04E6=0x0000
+0x04E5=0x0000
+0x0512=0x0000
+0x0206=0x0000
+0x0550=0x0000
+0x0360=0x0000
+0x030E=0x0000
+0x0203=0x0000
+0x0482=0x0000
+0x0541=0x0000
+0x0122=0x033F
+0x0110=0x0BF4
+0x0204=0x0000
+0x0252=0x0000
+0x011E=0x0AA7
+0x049B=0x0000
+0x0294=0x0000
+0x011C=0xA941
+0x02D6=0x0000
+0x0311=0x0000
+0x0117=0x280C
+0x02A4=0x0000
+0x0540=0x0000
+0x02E0=0x0000
+0x0118=0x018C
+0x0489=0x0000
+0x04A7=0x0000
+0x0101=0x7800
+0x0558=0x0000
+0x02C6=0x0000
+0x05A1=0x0000
+0x02C9=0x0000
+0x039D=0x0000
+0x0500=0x0000
+0x0450=0x0000
+0x011F=0x3600
+0x030C=0x0000
+0x04DF=0x0000
+0x0281=0x0000
+0x0106=0x3182
+0x028E=0x0000
+0x0326=0x0000
+0x0113=0x03C3
+0x04CB=0x0000
+0x0391=0x0000
+0x0105=0x0007
+0x02D9=0x0000
+0x02CE=0x0000
+0x038B=0x0000
+0x044F=0x0000
+0x02D4=0x0000
+0x0107=0x318C
+0x0495=0x0000
+0x0246=0x0000
+0x0303=0x0000
+0x02E6=0x0000
+0x045B=0x0000
+0x0100=0x3409
+0x0340=0x0000
+0x0208=0x0070
+0x0111=0x0083
+0x0247=0x0000
+0x024B=0x0000
+0x045C=0x0000
+0x0383=0x0000
+0x0202=0x07FF
+0x054A=0x0000
+0x0401=0x07FF
+0x0341=0x0000
+0x0287=0x0000
+0x034C=0x0000
+0x0501=0x0000
+0x030F=0x0000
+0x025D=0x0000
+0x0406=0x0000
+0x0313=0x0000
+0x010A=0x104C
+0x0461=0x0000
+0x051B=0x0000
+0x0121=0x31FA
+0x0115=0x0009
+0x0112=0xC0E6
+0x039A=0x0000
+0x02CC=0x0000
+0x0116=0x8180
+0x04A0=0x0000
+0x0108=0x9442
+0x020B=0x4000
+0x0251=0x0000
+0x0488=0x0000
+0x0241=0x0000
+0x038F=0x0000
+0x02DC=0x0000
+0x024C=0x0000
+0x0494=0x0000
+0x051D=0x0000
+0x0243=0x0000
+0x0556=0x0000
+0x040A=0x0000
+0x04CD=0x0000
+0x0249=0x0000
+0x0261=0x0000
+0x024A=0x0000
+0x0285=0x0000
+0x0280=0x0000
+0x0346=0x0000
+0x024E=0x0000
+0x0253=0x0000
+0x028B=0x0000
+0x040C=0x0000
+0x0255=0x0000
+0x0258=0x0000
+0x0502=0x0000
+0x05A3=0x0000
+0x0367=0x0000
+0x0240=0x0020
+0x0256=0x0000
+0x025A=0x0000
+0x04E2=0x0000
+0x04C5=0x0000
+0x025B=0x0000
+0x0205=0x0000
+0x0361=0x0000
+0x0515=0x0000
+0x025C=0x0000
+0x0355=0x0000
+0x044C=0x0000
+0x010C=0x88FD
+0x0284=0x0000
+0x0396=0x0000
+0x0363=0x0000
+0x031A=0x0000
+0x0289=0x0000
+0x028A=0x0000
+0x04DD=0x0000
+0x059C=0x0000
+0x0352=0x0000
+0x028C=0x0000
+0x04C2=0x0000
+0x04DA=0x0000
+0x025E=0x0000
+0x0327=0x0000
+0x0380=0x0000
+0x0342=0x0000
+0x0343=0x0000
+0x0344=0x0000
+0x0561=0x0000
+0x035A=0x0000
+0x02C8=0x0000
+0x0484=0x0000
+0x0586=0x0000
+0x0597=0x0000
+0x035F=0x0000
+0x0345=0x0000
+0x0505=0x0000
+0x035B=0x0000
+0x034A=0x0000
+0x0455=0x0000
+0x011A=0x2E02
+0x034B=0x0000
+0x034D=0x0000
+0x035C=0x0000
+0x034E=0x0000
+0x0293=0x0000
+0x03A6=0x0000
+0x0350=0x0000
+0x0445=0x0000
+0x048F=0x0000
+0x0351=0x0000
+0x0353=0x0000
+0x050D=0x0000
+0x02CD=0x0000
+0x0490=0x0000
+0x0498=0x0000
+0x0348=0x0000
+0x0356=0x0000
+0x030D=0x0000
+0x0316=0x0000
+0x040E=0x0000
+0x04A3=0x0000
+0x029D=0x0000
+0x0359=0x0000
+0x0299=0x0000
+0x0452=0x0000
+0x0442=0x0000
+0x035D=0x0000
+0x035E=0x0000
+0x0325=0x0000
+0x0364=0x0000
+0x0365=0x0000
+0x0366=0x0000
+0x0381=0x0000
+0x0288=0x0000
+0x0382=0x0000
+0x0384=0x0000
+0x0315=0x0000
+0x0385=0x0000
+0x04E3=0x0000
+0x040F=0x0000
+0x0389=0x0000
+0x054F=0x0000
+0x0386=0x0000
+0x02D0=0x0000
+0x054E=0x0000
+0x03A0=0x0000
+[reference_clocks]
+sxt_ref_clk_mhz=30.72
+sxr_ref_clk_mhz=30.72
diff --git a/targets/ARCH/LMSSDR/enb_sodera_highband_5MHz_rx19dB_txfull.ini b/targets/ARCH/LMSSDR/enb_sodera_highband_5MHz_rx19dB_txfull.ini
new file mode 100644
index 0000000000000000000000000000000000000000..a3c1aa2e6f40fb1bd38e3fb22aa5706905ec8724
--- /dev/null
+++ b/targets/ARCH/LMSSDR/enb_sodera_highband_5MHz_rx19dB_txfull.ini
@@ -0,0 +1,1128 @@
+[reference_clocks]
+sxr_ref_clk_mhz=30.72
+sxt_ref_clk_mhz=30.72
+[lms7002_registers_b]
+0x03A0=0x0000
+0x054E=0x0000
+0x02D0=0x0000
+0x0386=0x0000
+0x054F=0x0000
+0x0389=0x0000
+0x040F=0x0000
+0x04E3=0x0000
+0x0385=0x0000
+0x0315=0x0000
+0x0384=0x0000
+0x0382=0x0000
+0x0288=0x0000
+0x0381=0x0000
+0x0366=0x0000
+0x0365=0x0000
+0x0364=0x0000
+0x0325=0x0000
+0x035E=0x0000
+0x035D=0x0000
+0x0442=0x0000
+0x0452=0x0000
+0x0299=0x0000
+0x0359=0x0000
+0x029D=0x0000
+0x04A3=0x0000
+0x040E=0x0000
+0x0316=0x0000
+0x030D=0x0000
+0x0356=0x0000
+0x0348=0x0000
+0x0498=0x0000
+0x0490=0x0000
+0x02CD=0x0000
+0x050D=0x0000
+0x0353=0x0000
+0x0351=0x0000
+0x048F=0x0000
+0x0445=0x0000
+0x0350=0x0000
+0x03A6=0x0000
+0x0293=0x0000
+0x034E=0x0000
+0x035C=0x0000
+0x034D=0x0000
+0x034B=0x0000
+0x011A=0x2E02
+0x0455=0x0000
+0x034A=0x0000
+0x035B=0x0000
+0x0505=0x0000
+0x0345=0x0000
+0x035F=0x0000
+0x0597=0x0000
+0x0586=0x0000
+0x0484=0x0000
+0x02C8=0x0000
+0x035A=0x0000
+0x0561=0x0000
+0x0344=0x0000
+0x0343=0x0000
+0x0342=0x0000
+0x0380=0x0000
+0x0327=0x0000
+0x025E=0x0000
+0x04DA=0x0000
+0x04C2=0x0000
+0x028C=0x0000
+0x0352=0x0000
+0x059C=0x0000
+0x04DD=0x0000
+0x028A=0x0000
+0x0289=0x0000
+0x031A=0x0000
+0x0363=0x0000
+0x0396=0x0000
+0x0284=0x0000
+0x010C=0x88FD
+0x044C=0x0000
+0x0355=0x0000
+0x025C=0x0000
+0x0515=0x0000
+0x0361=0x0000
+0x0205=0x0000
+0x025B=0x0000
+0x04C5=0x0000
+0x04E2=0x0000
+0x025A=0x0000
+0x0256=0x0000
+0x0240=0x0020
+0x0367=0x0000
+0x05A3=0x0000
+0x0502=0x0000
+0x0258=0x0000
+0x0255=0x0000
+0x040C=0x0000
+0x028B=0x0000
+0x0253=0x0000
+0x024E=0x0000
+0x0346=0x0000
+0x0280=0x0000
+0x0285=0x0000
+0x024A=0x0000
+0x0261=0x0000
+0x0249=0x0000
+0x04CD=0x0000
+0x040A=0x0000
+0x0556=0x0000
+0x0243=0x0000
+0x051D=0x0000
+0x0494=0x0000
+0x024C=0x0000
+0x02DC=0x0000
+0x038F=0x0000
+0x0241=0x0000
+0x0488=0x0000
+0x0251=0x0000
+0x020B=0x4000
+0x0108=0x9442
+0x04A0=0x0000
+0x0116=0x8180
+0x02CC=0x0000
+0x039A=0x0000
+0x0112=0xC0E6
+0x0307=0x0000
+0x038C=0x0000
+0x0282=0x0000
+0x0321=0x0000
+0x0507=0x0000
+0x0483=0x0000
+0x0201=0x07FF
+0x02E1=0x0000
+0x0517=0x0000
+0x0481=0x0000
+0x02D5=0x0000
+0x0259=0x0000
+0x0527=0x0000
+0x02DD=0x0000
+0x0209=0x0000
+0x0297=0x0000
+0x0400=0x0081
+0x0104=0x0088
+0x0103=0x0A12
+0x0347=0x0000
+0x02D8=0x0000
+0x0457=0x0000
+0x0306=0x0000
+0x02D1=0x0000
+0x04C8=0x0000
+0x0546=0x0000
+0x0440=0x0020
+0x045E=0x0000
+0x031D=0x0000
+0x039C=0x0000
+0x02D2=0x0000
+0x010E=0x2040
+0x02A0=0x0000
+0x0544=0x0000
+0x029C=0x0000
+0x055A=0x0000
+0x0295=0x0000
+0x02CF=0x0000
+0x04D1=0x0000
+0x0291=0x0000
+0x02DF=0x0000
+0x0290=0x0000
+0x020A=0x0080
+0x0102=0x3180
+0x0120=0xB9FF
+0x0388=0x0000
+0x0318=0x0000
+0x02A7=0x0000
+0x0200=0x0081
+0x0594=0x0000
+0x02C5=0x0000
+0x028D=0x0000
+0x02A1=0x0000
+0x0362=0x0000
+0x038A=0x0000
+0x0395=0x0000
+0x058D=0x0000
+0x02D7=0x0000
+0x0305=0x0000
+0x0393=0x0000
+0x0398=0x0000
+0x0408=0x0000
+0x039B=0x0000
+0x049E=0x0000
+0x02DB=0x0000
+0x0357=0x0000
+0x02C2=0x0000
+0x0514=0x0000
+0x051C=0x0000
+0x03A2=0x0000
+0x03A4=0x0000
+0x03A3=0x0000
+0x0493=0x0000
+0x0454=0x0000
+0x0448=0x0000
+0x0397=0x0000
+0x02E3=0x0000
+0x049C=0x0000
+0x040D=0x0000
+0x0281=0x0000
+0x048C=0x0000
+0x049A=0x0000
+0x0119=0x18CB
+0x010F=0x3042
+0x02A6=0x0000
+0x0257=0x0000
+0x04D6=0x0000
+0x04A6=0x0000
+0x0324=0x0000
+0x038E=0x0000
+0x02E7=0x0000
+0x034F=0x0000
+0x04E0=0x0000
+0x0123=0x267B
+0x0497=0x0000
+0x0459=0x0000
+0x0394=0x0000
+0x04A5=0x0000
+0x04D9=0x0000
+0x0304=0x0000
+0x04D5=0x0000
+0x0508=0x0000
+0x0443=0x0000
+0x0301=0x0000
+0x0548=0x0000
+0x04D2=0x0000
+0x0592=0x0000
+0x0591=0x0000
+0x04C7=0x0000
+0x049D=0x0000
+0x029A=0x0000
+0x051F=0x0000
+0x0309=0x0000
+0x0585=0x0000
+0x03A5=0x0000
+0x02D3=0x0000
+0x0451=0x0000
+0x0390=0x0000
+0x0562=0x0000
+0x02C4=0x0000
+0x029E=0x0000
+0x031E=0x0000
+0x04C0=0x0000
+0x04DC=0x0000
+0x04DE=0x0000
+0x058B=0x0000
+0x04DB=0x0000
+0x04D0=0x0000
+0x0492=0x0000
+0x04A1=0x0000
+0x054B=0x0000
+0x02C7=0x0000
+0x05A0=0x0000
+0x044B=0x0000
+0x0100=0x3409
+0x04CA=0x0000
+0x0446=0x0000
+0x02E4=0x0000
+0x04E4=0x0000
+0x04C3=0x0000
+0x0496=0x0000
+0x04CF=0x0000
+0x025F=0x0000
+0x04D4=0x0000
+0x0504=0x0000
+0x04CE=0x0000
+0x02DE=0x0000
+0x0399=0x0000
+0x050C=0x0000
+0x02A5=0x0000
+0x04CC=0x0000
+0x03A1=0x0000
+0x04E1=0x0000
+0x02A2=0x0000
+0x040B=0x7FFF
+0x0283=0x0000
+0x048E=0x0000
+0x0580=0x0000
+0x0409=0x0000
+0x039F=0x0000
+0x0248=0x0000
+0x048B=0x0000
+0x0358=0x0000
+0x0589=0x0000
+0x038D=0x0000
+0x0487=0x0000
+0x0510=0x0000
+0x0302=0x0000
+0x0486=0x0000
+0x045F=0x0000
+0x0480=0x0000
+0x0567=0x0000
+0x02DA=0x0000
+0x045A=0x0000
+0x0254=0x0000
+0x0405=0x0000
+0x0387=0x0000
+0x0458=0x0000
+0x0314=0x0000
+0x0360=0x0000
+0x0559=0x0000
+0x0456=0x0000
+0x0453=0x0000
+0x02E2=0x0000
+0x044D=0x0000
+0x0441=0x0000
+0x02C3=0x0000
+0x04C1=0x0000
+0x04D3=0x0000
+0x0444=0x0000
+0x0207=0x0000
+0x04C6=0x0000
+0x0296=0x0000
+0x0555=0x0000
+0x0349=0x0000
+0x0109=0x61C1
+0x04A2=0x0000
+0x0447=0x0000
+0x0460=0x0000
+0x048D=0x0000
+0x059A=0x0000
+0x0407=0x0000
+0x02C0=0x0000
+0x0499=0x0000
+0x0543=0x0000
+0x04C9=0x0000
+0x02CA=0x0000
+0x0404=0x0000
+0x0560=0x0000
+0x02C1=0x0000
+0x04D8=0x0000
+0x0403=0x0000
+0x0491=0x0000
+0x029B=0x0000
+0x04C4=0x0000
+0x010D=0x009E
+0x0402=0x07FF
+0x055E=0x0000
+0x03A7=0x0000
+0x0520=0x0000
+0x0392=0x0000
+0x030B=0x0000
+0x0588=0x0000
+0x0308=0x0000
+0x048A=0x0000
+0x044A=0x0000
+0x04A4=0x0000
+0x0300=0x0000
+0x0587=0x0000
+0x044E=0x0000
+0x055B=0x0000
+0x02E5=0x0000
+0x0114=0x008D
+0x0323=0x0000
+0x0320=0x0000
+0x0503=0x0000
+0x0513=0x0000
+0x0319=0x0000
+0x0260=0x0000
+0x0549=0x0000
+0x0552=0x0000
+0x0509=0x0000
+0x0521=0x0000
+0x0286=0x0000
+0x04D7=0x0000
+0x059E=0x0000
+0x058F=0x0000
+0x0557=0x0000
+0x0322=0x0000
+0x059B=0x0000
+0x049F=0x0000
+0x0522=0x0000
+0x0545=0x0000
+0x0551=0x0000
+0x0312=0x0000
+0x055D=0x0000
+0x0298=0x0000
+0x055F=0x0000
+0x011D=0xAAAA
+0x039E=0x0000
+0x0547=0x0000
+0x0598=0x0000
+0x0449=0x0000
+0x0564=0x0000
+0x0242=0x0000
+0x0525=0x0000
+0x0523=0x0000
+0x0565=0x0000
+0x0124=0x0000
+0x0563=0x0000
+0x024D=0x0000
+0x05A5=0x0000
+0x0566=0x0000
+0x030A=0x0000
+0x029F=0x0000
+0x054C=0x0000
+0x0582=0x0000
+0x0599=0x0000
+0x0511=0x0000
+0x0506=0x0000
+0x0595=0x0000
+0x0584=0x0000
+0x058C=0x0000
+0x05A6=0x0000
+0x051E=0x0000
+0x050F=0x0000
+0x0590=0x0000
+0x0596=0x0000
+0x05A7=0x0000
+0x058A=0x0000
+0x059D=0x0000
+0x0485=0x0000
+0x0581=0x0000
+0x045D=0x0000
+0x0245=0x0000
+0x0310=0x0000
+0x058E=0x0000
+0x05A2=0x0000
+0x054D=0x0000
+0x020C=0x7FFF
+0x031F=0x0000
+0x0292=0x0000
+0x059F=0x0000
+0x0583=0x0000
+0x0317=0x0000
+0x0244=0x0000
+0x0554=0x0000
+0x0593=0x0000
+0x05A4=0x0000
+0x02A3=0x0000
+0x0553=0x0000
+0x0542=0x0000
+0x0519=0x0000
+0x024F=0x0000
+0x0524=0x0000
+0x0518=0x0000
+0x0354=0x0000
+0x0526=0x0000
+0x031B=0x0000
+0x050E=0x0000
+0x0516=0x0000
+0x02CB=0x0000
+0x0250=0x0000
+0x031C=0x0000
+0x028F=0x0000
+0x051A=0x0000
+0x055C=0x0000
+0x050A=0x0000
+0x050B=0x0000
+0x04E7=0x0000
+0x04E6=0x0000
+0x04E5=0x0000
+0x0512=0x0000
+0x0206=0x0000
+0x0550=0x0000
+0x030E=0x0000
+0x0203=0x0000
+0x0482=0x0000
+0x0541=0x0000
+0x0122=0x033F
+0x0110=0x0BF4
+0x0204=0x0000
+0x0252=0x0000
+0x011E=0x0AA7
+0x049B=0x0000
+0x0294=0x0000
+0x011C=0xA941
+0x02D6=0x0000
+0x0311=0x0000
+0x0117=0x280C
+0x02A4=0x0000
+0x0540=0x0000
+0x02E0=0x0000
+0x0118=0x018C
+0x0489=0x0000
+0x04A7=0x0000
+0x0101=0x7800
+0x0558=0x0000
+0x02C6=0x0000
+0x05A1=0x0000
+0x02C9=0x0000
+0x039D=0x0000
+0x0500=0x0000
+0x0450=0x0000
+0x011F=0x3600
+0x030C=0x0000
+0x04DF=0x0000
+0x0106=0x3182
+0x028E=0x0000
+0x0326=0x0000
+0x0113=0x03C3
+0x04CB=0x0000
+0x0391=0x0000
+0x0105=0x0007
+0x02D9=0x0000
+0x02CE=0x0000
+0x044F=0x0000
+0x038B=0x0000
+0x02D4=0x0000
+0x0107=0x318C
+0x0495=0x0000
+0x0246=0x0000
+0x0303=0x0000
+0x02E6=0x0000
+0x045B=0x0000
+0x0340=0x0000
+0x0208=0x0070
+0x0111=0x0083
+0x0247=0x0000
+0x024B=0x0000
+0x045C=0x0000
+0x0383=0x0000
+0x0202=0x07FF
+0x054A=0x0000
+0x0401=0x07FF
+0x0341=0x0000
+0x0287=0x0000
+0x034C=0x0000
+0x0501=0x0000
+0x030F=0x0000
+0x025D=0x0000
+0x0406=0x0000
+0x0313=0x0000
+0x010A=0x104C
+0x0461=0x0000
+0x051B=0x0000
+0x0121=0x31FA
+0x0115=0x0009
+[lms7002_registers_a]
+0x0107=0x318C
+0x02D4=0x0000
+0x0082=0x8001
+0x0209=0x0000
+0x02CA=0x0000
+0x04C9=0x0000
+0x0120=0xB9FF
+0x0388=0x0000
+0x029D=0x0000
+0x04A3=0x0000
+0x0208=0x0170
+0x0340=0x0000
+0x0094=0x0000
+0x0244=0x0000
+0x0317=0x0000
+0x00A9=0x8000
+0x0115=0x0009
+0x039A=0x0000
+0x0112=0x3171
+0x048C=0x0000
+0x0023=0x5550
+0x0587=0x1D10
+0x04C0=0x0000
+0x031E=0x0000
+0x0205=0x0000
+0x0361=0x0000
+0x051F=0xAB08
+0x029A=0x0000
+0x0396=0x0000
+0x0284=0x0000
+0x02CE=0x0000
+0x02D9=0x0000
+0x038B=0x0000
+0x044F=0x0000
+0x0367=0x0000
+0x0240=0x0028
+0x05A3=0x0000
+0x0105=0x0007
+0x009B=0x6565
+0x0400=0x0101
+0x02DB=0x0000
+0x0357=0x0000
+0x0104=0x0088
+0x0103=0x0612
+0x0457=0x0000
+0x0347=0x0000
+0x02D8=0x0000
+0x010C=0x8865
+0x0086=0x4101
+0x0202=0x0794
+0x0383=0x0000
+0x020B=0x4000
+0x0108=0xFC26
+0x0098=0x0000
+0x0117=0x100C
+0x0027=0x05E4
+0x00A7=0x6565
+0x024A=0x0000
+0x0029=0x0101
+0x00AD=0x03FF
+0x0540=0x5009
+0x02A4=0x0000
+0x02DE=0x0000
+0x002E=0x0000
+0x0261=0x0000
+0x00AB=0x0040
+0x0564=0x0000
+0x00A8=0x0000
+0x0517=0xC89D
+0x0481=0x0000
+0x02C1=0x0000
+0x0301=0x0000
+0x00A5=0x6565
+0x0515=0x2E45
+0x025C=0x0000
+0x009F=0x658C
+0x0519=0x4049
+0x054B=0xF7A3
+0x02C7=0x0000
+0x038C=0x0000
+0x0307=0x0000
+0x0282=0x0000
+0x0289=0x0000
+0x011C=0xA941
+0x0562=0xF524
+0x0025=0x0101
+0x02CC=0x0000
+0x0116=0x8180
+0x0597=0xFDFB
+0x035F=0x0000
+0x002F=0x3840
+0x0589=0xEA5F
+0x00A2=0x6565
+0x0099=0x6565
+0x0310=0x0000
+0x040C=0x40F8
+0x028B=0x0000
+0x0253=0x0000
+0x00AC=0x2000
+0x002D=0xFFFF
+0x00A6=0x0001
+0x054D=0xF7A3
+0x002C=0x0000
+0x0249=0x0000
+0x04CD=0x0000
+0x0401=0x07FF
+0x00A4=0x6565
+0x054A=0x8184
+0x038F=0x0000
+0x008C=0x267B
+0x0241=0x0000
+0x0356=0x0000
+0x00A1=0x6565
+0x0260=0x0000
+0x0453=0x0000
+0x008A=0x0491
+0x048F=0x0000
+0x0445=0x0000
+0x0350=0x0000
+0x00AA=0x0000
+0x034C=0x0000
+0x0501=0xFDFB
+0x0490=0x0000
+0x02CD=0x0000
+0x050D=0x0F45
+0x0353=0x0000
+0x0024=0x50D8
+0x04E5=0x0000
+0x0512=0x196B
+0x0247=0x0000
+0x045C=0x0000
+0x024B=0x0000
+0x0395=0x0000
+0x011F=0x3600
+0x039D=0x0000
+0x0500=0xF61D
+0x02C9=0x0000
+0x05A1=0x0000
+0x02A6=0x0000
+0x0119=0x18DF
+0x010F=0x3042
+0x04CB=0x0000
+0x0391=0x0000
+0x0113=0x03C3
+0x0326=0x0000
+0x028E=0x0000
+0x0106=0x3182
+0x0524=0x3347
+0x009D=0x6565
+0x0294=0x0000
+0x0026=0x0101
+0x0110=0x0BFF
+0x0122=0x033F
+0x0381=0x0000
+0x009C=0x658C
+0x05A0=0x0000
+0x0482=0x0000
+0x030E=0x0000
+0x0203=0x2F99
+0x0095=0x0000
+0x0111=0x0099
+0x0256=0x0000
+0x0089=0x00A0
+0x0085=0x0001
+0x0088=0x0530
+0x0459=0x0000
+0x0394=0x0000
+0x010E=0x0285
+0x02A0=0x0000
+0x002B=0x4038
+0x039C=0x0000
+0x02D2=0x0000
+0x0581=0xC89D
+0x045D=0x0000
+0x0245=0x0000
+0x002A=0x0086
+0x0118=0x018C
+0x02E0=0x0000
+0x0489=0x0000
+0x04A7=0x0000
+0x039E=0x0000
+0x011D=0xAAAA
+0x02E1=0x0000
+0x0259=0x0000
+0x02D5=0x0000
+0x051D=0x4F91
+0x0243=0x0000
+0x0556=0xA2B5
+0x040A=0x1000
+0x05A2=0x0000
+0x020C=0x8000
+0x020A=0x0080
+0x0102=0x3180
+0x034F=0x0000
+0x0303=0x0000
+0x0306=0x0000
+0x0255=0x0000
+0x0300=0x0000
+0x044E=0x0000
+0x0309=0x0000
+0x0585=0xDAA2
+0x0527=0xACB9
+0x044A=0x0000
+0x04A4=0x0000
+0x048A=0x0000
+0x0392=0x0000
+0x030B=0x0000
+0x05A7=0x0000
+0x0252=0x0000
+0x0204=0xC016
+0x0308=0x0000
+0x0588=0xE6C7
+0x0321=0x0000
+0x0507=0xFCFE
+0x0312=0x0000
+0x050B=0xF5EF
+0x0360=0x0000
+0x0021=0x0E9F
+0x04C2=0x0000
+0x030D=0x0000
+0x040E=0x0003
+0x0316=0x0000
+0x031F=0x0000
+0x030C=0x0000
+0x04DF=0x0000
+0x0318=0x0000
+0x0250=0x0000
+0x02CB=0x0000
+0x045E=0x0000
+0x0440=0x0024
+0x031D=0x0000
+0x058D=0xF5EF
+0x02D7=0x0000
+0x0380=0x0000
+0x0342=0x0000
+0x0343=0x0000
+0x0566=0x0906
+0x0345=0x0000
+0x049C=0x0000
+0x02E3=0x0000
+0x0397=0x0000
+0x035B=0x0000
+0x0505=0x00D8
+0x028D=0x0000
+0x02A1=0x0000
+0x028F=0x0000
+0x031C=0x0000
+0x031A=0x0000
+0x0363=0x0000
+0x0596=0x0A94
+0x0354=0x0000
+0x0518=0xEFF2
+0x035C=0x0000
+0x034D=0x0000
+0x0344=0x0000
+0x0561=0xAB08
+0x0096=0x0000
+0x010D=0x00DE
+0x04C4=0x0000
+0x0351=0x0000
+0x0311=0x0000
+0x02D6=0x0000
+0x02D1=0x0000
+0x0546=0x8D44
+0x04C8=0x0000
+0x048B=0x0000
+0x0358=0x0000
+0x0522=0xDB10
+0x049F=0x0000
+0x034A=0x0000
+0x0455=0x0000
+0x0359=0x0000
+0x03A4=0x0000
+0x03A3=0x0000
+0x0341=0x0000
+0x0287=0x0000
+0x04DA=0x0000
+0x025E=0x0000
+0x0580=0xEFF2
+0x0409=0x0000
+0x059A=0x0000
+0x048D=0x0000
+0x0514=0xE7E2
+0x039B=0x0000
+0x0101=0x7800
+0x0558=0x5009
+0x02C6=0x0000
+0x051B=0xB77F
+0x0313=0x0000
+0x010A=0x104C
+0x0461=0x0000
+0x0406=0x0000
+0x030F=0x0000
+0x025D=0x0000
+0x034B=0x0000
+0x011A=0x2E14
+0x029F=0x0000
+0x030A=0x0000
+0x034E=0x0000
+0x0293=0x0000
+0x03A6=0x0000
+0x0560=0x174B
+0x0404=0x0000
+0x00A0=0x6565
+0x0547=0xD7B7
+0x0454=0x0000
+0x0448=0x0000
+0x0327=0x0000
+0x0305=0x0000
+0x0393=0x0000
+0x0510=0xE6C7
+0x0302=0x0000
+0x0486=0x0000
+0x045F=0x0000
+0x0365=0x0000
+0x048E=0x0000
+0x0022=0x07FF
+0x0283=0x0000
+0x044B=0x0000
+0x045A=0x0000
+0x02DA=0x0000
+0x04E4=0x0000
+0x02E4=0x0000
+0x03A5=0x0000
+0x040B=0x000F
+0x0366=0x0000
+0x0443=0x0000
+0x0508=0xEF99
+0x00A3=0x6565
+0x02E2=0x0000
+0x044D=0x0000
+0x0314=0x0000
+0x0458=0x0000
+0x0493=0x0000
+0x0346=0x0000
+0x024E=0x0000
+0x055E=0xDB10
+0x0402=0x07D9
+0x0384=0x0000
+0x02E6=0x0000
+0x045B=0x0000
+0x0480=0x0000
+0x0567=0x4049
+0x04CA=0x0000
+0x0446=0x0000
+0x0447=0x0000
+0x0460=0x0000
+0x0559=0xACB9
+0x0456=0x0000
+0x0441=0x0000
+0x0444=0x0000
+0x0390=0x0000
+0x0451=0x0000
+0x049E=0x0000
+0x0324=0x0000
+0x02E7=0x0000
+0x038E=0x0000
+0x0403=0x0013
+0x04D8=0x0000
+0x029B=0x0000
+0x0491=0x0000
+0x03A1=0x0000
+0x04E1=0x0000
+0x02A2=0x0000
+0x051C=0x0000
+0x03A2=0x0000
+0x0407=0x0000
+0x0258=0x0000
+0x0502=0x0A94
+0x038A=0x0000
+0x0362=0x0000
+0x028C=0x0000
+0x0352=0x0000
+0x0385=0x0000
+0x0315=0x0000
+0x040D=0x0000
+0x039F=0x0000
+0x0248=0x0000
+0x0405=0x0000
+0x0254=0x0000
+0x0398=0x0000
+0x0408=0x0000
+0x0487=0x0000
+0x038D=0x0000
+0x035E=0x0000
+0x03A7=0x0000
+0x0520=0x174B
+0x0449=0x0000
+0x02C8=0x0000
+0x035A=0x0000
+0x0387=0x0000
+0x0386=0x0000
+0x0452=0x0000
+0x0299=0x0000
+0x0084=0x0400
+0x0498=0x0000
+0x0348=0x0000
+0x02D0=0x0000
+0x054E=0x8184
+0x03A0=0x0000
+0x009A=0x658C
+0x055D=0xA6B5
+0x0298=0x0000
+0x0364=0x0000
+0x0081=0x0000
+0x0325=0x0000
+0x040F=0x43E4
+0x04E3=0x0000
+0x050E=0x17DC
+0x0516=0x150F
+0x0389=0x0000
+0x054F=0x18C9
+0x0304=0x0000
+0x04D5=0x0000
+0x059B=0x0000
+0x0322=0x0000
+0x0442=0x0000
+0x035D=0x0000
+0x0492=0x0000
+0x04A1=0x0000
+0x0382=0x0000
+0x0288=0x0000
+0x0296=0x0000
+0x0555=0xBD96
+0x0349=0x0000
+0x0484=0x0000
+0x0586=0x196B
+0x0281=0x0000
+0x0200=0x0301
+0x0594=0xF40D
+0x02C5=0x0000
+0x0319=0x0000
+0x0121=0x3760
+0x025B=0x0000
+0x0290=0x0000
+0x02DF=0x0000
+0x0291=0x0000
+0x029C=0x0000
+0x008B=0x278A
+0x02A3=0x0000
+0x05A4=0x0000
+0x02A7=0x0000
+0x0483=0x0000
+0x0201=0x07FF
+0x02C2=0x0000
+0x02C4=0x0000
+0x0207=0x0000
+0x04C6=0x0000
+0x0093=0x0000
+0x02D3=0x0000
+0x0494=0x0000
+0x04CF=0x0000
+0x025F=0x0000
+0x0251=0x0000
+0x0488=0x0000
+0x0496=0x0000
+0x04C3=0x0000
+0x0100=0x3409
+0x04CC=0x0000
+0x02A5=0x0000
+0x0257=0x0000
+0x04D6=0x0000
+0x04A6=0x0000
+0x049A=0x0000
+0x049B=0x0000
+0x0097=0x0000
+0x011E=0x0A2A
+0x0285=0x0000
+0x0280=0x0000
+0x0020=0xFFFD
+0x02DD=0x0000
+0x0297=0x0000
+0x044C=0x0000
+0x0355=0x0000
+0x04A0=0x0000
+0x02CF=0x0000
+0x04D1=0x0000
+0x0526=0xBE2A
+0x0092=0x0001
+0x031B=0x0000
+0x0541=0x4C24
+0x0543=0xBD96
+0x02C0=0x0000
+0x0499=0x0000
+0x0513=0xDAA2
+0x0549=0x18C9
+0x0552=0x8D44
+0x0521=0x5852
+0x0509=0x0605
+0x0286=0x0000
+0x024F=0x0000
+0x04E0=0x0000
+0x0545=0x364E
+0x0551=0xD7B7
+0x055F=0x5852
+0x009E=0x658C
+0x0598=0xF61D
+0x0123=0x067B
+0x0497=0x0000
+0x04A5=0x0000
+0x0565=0xB77F
+0x0124=0x0000
+0x0592=0x0DF1
+0x0591=0xFCFE
+0x0548=0x79FA
+0x04D2=0x0000
+0x0599=0x0000
+0x0511=0x1D10
+0x0506=0x0DF1
+0x0595=0x00BC
+0x0584=0xE7E2
+0x0242=0x0000
+0x025A=0x0000
+0x04E2=0x0000
+0x04C5=0x0000
+0x058C=0xEA50
+0x0450=0x0000
+0x058A=0x17DC
+0x059D=0x0000
+0x0485=0x0000
+0x058E=0x1316
+0x0550=0x79FA
+0x0554=0x6901
+0x0593=0x00D8
+0x0553=0x364E
+0x0542=0xA2B5
+0x0563=0x4F91
+0x024D=0x0000
+0x055A=0xBE2A
+0x0295=0x0000
+0x028A=0x0000
+0x059C=0x0000
+0x04DD=0x0000
+0x054C=0x7FFF
+0x0582=0x150F
+0x0109=0x8CC1
+0x04A2=0x0000
+0x0292=0x0000
+0x0583=0x2E45
+0x059F=0x0000
+0x0525=0x57AC
+0x0523=0xA6B5
+0x0206=0x0000
+0x051A=0x0906
+0x055C=0x3347
+0x05A6=0x0000
+0x050F=0xEA5F
+0x051E=0xF524
+0x050A=0x1316
+0x04C7=0x0000
+0x049D=0x0000
+0x050C=0xEA50
+0x0087=0x0000
+0x0399=0x0000
+0x0495=0x0000
+0x0246=0x0000
+0x0503=0x00BC
+0x0320=0x0000
+0x0323=0x0000
+0x055B=0x57AC
+0x0114=0x0110
+0x02E5=0x0000
+0x04E7=0x0000
+0x04D0=0x0000
+0x04E6=0x0000
+0x00AE=0x0000
+0x0544=0x6901
+0x04DE=0x0000
+0x058B=0x0F45
+0x0028=0x0101
+0x029E=0x0000
+0x04DC=0x0000
+0x04D9=0x0000
+0x058F=0x0605
+0x0557=0x4C24
+0x04DB=0x0000
+0x04D7=0x0000
+0x059E=0x0000
+0x024C=0x0000
+0x02DC=0x0000
+0x04D4=0x0000
+0x0504=0xF40D
+0x02C3=0x0000
+0x04C1=0x0000
+0x04D3=0x0000
+0x0590=0xEF99
+0x04CE=0x0000
+0x05A5=0x0000
+[file_info]
+version=1
+type=lms7002m_minimal_config
diff --git a/targets/ARCH/LMSSDR/enb_sodera_lowband_Lrx_10MHz_rx19dB_txfull.ini b/targets/ARCH/LMSSDR/enb_sodera_lowband_Lrx_10MHz_rx19dB_txfull.ini
new file mode 100644
index 0000000000000000000000000000000000000000..f47d3bf433b617f82c7cd66b0b53ee22557a2726
--- /dev/null
+++ b/targets/ARCH/LMSSDR/enb_sodera_lowband_Lrx_10MHz_rx19dB_txfull.ini
@@ -0,0 +1,1128 @@
+[reference_clocks]
+sxr_ref_clk_mhz=30.72
+sxt_ref_clk_mhz=30.72
+[lms7002_registers_b]
+0x05A7=0x0000
+0x05A5=0x0000
+0x05A2=0x0000
+0x05A0=0x0000
+0x0599=0x0000
+0x0598=0x0000
+0x0596=0x0000
+0x0594=0x0000
+0x0592=0x0000
+0x0591=0x0000
+0x0590=0x0000
+0x058E=0x0000
+0x058C=0x0000
+0x059D=0x0000
+0x058A=0x0000
+0x0589=0x0000
+0x0587=0x0000
+0x0585=0x0000
+0x0595=0x0000
+0x0584=0x0000
+0x059F=0x0000
+0x0583=0x0000
+0x0582=0x0000
+0x0567=0x0000
+0x0566=0x0000
+0x0565=0x0000
+0x0564=0x0000
+0x0563=0x0000
+0x0562=0x0000
+0x055F=0x0000
+0x055D=0x0000
+0x055A=0x0000
+0x058F=0x0000
+0x0557=0x0000
+0x0593=0x0000
+0x0554=0x0000
+0x0552=0x0000
+0x0551=0x0000
+0x0550=0x0000
+0x054D=0x0000
+0x054C=0x0000
+0x0549=0x0000
+0x0547=0x0000
+0x0546=0x0000
+0x0545=0x0000
+0x0544=0x0000
+0x0543=0x0000
+0x0553=0x0000
+0x0542=0x0000
+0x0541=0x0000
+0x0527=0x0000
+0x0526=0x0000
+0x0524=0x0000
+0x0525=0x0000
+0x0523=0x0000
+0x0521=0x0000
+0x055C=0x0000
+0x051A=0x0000
+0x0519=0x0000
+0x0518=0x0000
+0x0514=0x0000
+0x0513=0x0000
+0x0511=0x0000
+0x05A6=0x0000
+0x051E=0x0000
+0x050F=0x0000
+0x0516=0x0000
+0x050E=0x0000
+0x050C=0x0000
+0x050B=0x0000
+0x050A=0x0000
+0x0509=0x0000
+0x0507=0x0000
+0x0506=0x0000
+0x0503=0x0000
+0x04E7=0x0000
+0x04E6=0x0000
+0x0512=0x0000
+0x04E5=0x0000
+0x04E4=0x0000
+0x0321=0x0000
+0x0320=0x0000
+0x0323=0x0000
+0x031B=0x0000
+0x0319=0x0000
+0x0260=0x0000
+0x031F=0x0000
+0x0360=0x0000
+0x0312=0x0000
+0x0310=0x0000
+0x0245=0x0000
+0x0581=0x0000
+0x045D=0x0000
+0x030E=0x0000
+0x0203=0x0000
+0x0482=0x0000
+0x0588=0x0000
+0x0308=0x0000
+0x048A=0x0000
+0x0307=0x0000
+0x0282=0x0000
+0x038C=0x0000
+0x0510=0x0000
+0x0302=0x0000
+0x0301=0x0000
+0x0309=0x0000
+0x0300=0x0000
+0x044E=0x0000
+0x034F=0x0000
+0x055B=0x0000
+0x0114=0x008D
+0x02E5=0x0000
+0x02E4=0x0000
+0x02E1=0x0000
+0x02D5=0x0000
+0x0259=0x0000
+0x0517=0x0000
+0x0481=0x0000
+0x030B=0x0000
+0x0392=0x0000
+0x02DE=0x0000
+0x02DD=0x0000
+0x0297=0x0000
+0x0209=0x0000
+0x0400=0x0081
+0x02D8=0x0000
+0x0104=0x0088
+0x0103=0x0A12
+0x0347=0x0000
+0x0457=0x0000
+0x058D=0x0000
+0x02D7=0x0000
+0x02D1=0x0000
+0x04C8=0x0000
+0x02D3=0x0000
+0x02CB=0x0000
+0x0250=0x0000
+0x0306=0x0000
+0x04A4=0x0000
+0x044A=0x0000
+0x054B=0x0000
+0x02C7=0x0000
+0x02C1=0x0000
+0x031D=0x0000
+0x0440=0x0020
+0x045E=0x0000
+0x02C4=0x0000
+0x02C2=0x0000
+0x02DB=0x0000
+0x0357=0x0000
+0x0201=0x07FF
+0x0483=0x0000
+0x05A4=0x0000
+0x02A3=0x0000
+0x02A1=0x0000
+0x028D=0x0000
+0x02D2=0x0000
+0x039C=0x0000
+0x02A0=0x0000
+0x010E=0x2040
+0x030A=0x0000
+0x029F=0x0000
+0x029C=0x0000
+0x029E=0x0000
+0x011D=0x9555
+0x039E=0x0000
+0x0296=0x0000
+0x0555=0x0000
+0x0349=0x0000
+0x0295=0x0000
+0x010D=0x009E
+0x04C4=0x0000
+0x0292=0x0000
+0x02CF=0x0000
+0x04D1=0x0000
+0x0291=0x0000
+0x02DF=0x0000
+0x0290=0x0000
+0x020A=0x0080
+0x0102=0x3180
+0x0388=0x0000
+0x0120=0xB9FF
+0x0317=0x0000
+0x0244=0x0000
+0x059B=0x0000
+0x0322=0x0000
+0x010F=0x3042
+0x0119=0x18CB
+0x02A6=0x0000
+0x051F=0x0000
+0x029A=0x0000
+0x049A=0x0000
+0x059E=0x0000
+0x04D7=0x0000
+0x0318=0x0000
+0x02A7=0x0000
+0x0200=0x0081
+0x02C5=0x0000
+0x0122=0x033F
+0x0110=0x0BF4
+0x0204=0x0000
+0x0252=0x0000
+0x011E=0x05DC
+0x049B=0x0000
+0x0294=0x0000
+0x011C=0xAD41
+0x02D6=0x0000
+0x0311=0x0000
+0x0117=0x280C
+0x0540=0x0000
+0x02A4=0x0000
+0x0485=0x0000
+0x02E0=0x0000
+0x0118=0x018C
+0x0489=0x0000
+0x04A7=0x0000
+0x0101=0x7800
+0x0558=0x0000
+0x02C6=0x0000
+0x05A1=0x0000
+0x02C9=0x0000
+0x0500=0x0000
+0x039D=0x0000
+0x011F=0x3680
+0x030C=0x0000
+0x04DF=0x0000
+0x0281=0x0000
+0x0106=0x3182
+0x028E=0x0000
+0x0326=0x0000
+0x0113=0x03C3
+0x04CB=0x0000
+0x0391=0x0000
+0x0105=0x0007
+0x02D9=0x0000
+0x02CE=0x0000
+0x044F=0x0000
+0x038B=0x0000
+0x02D4=0x0000
+0x0107=0x318C
+0x0495=0x0000
+0x0246=0x0000
+0x0303=0x0000
+0x02E6=0x0000
+0x045B=0x0000
+0x0100=0x3409
+0x0340=0x0000
+0x0208=0x0070
+0x0111=0x0083
+0x0247=0x0000
+0x024B=0x0000
+0x045C=0x0000
+0x024D=0x0000
+0x0202=0x07FF
+0x0383=0x0000
+0x054A=0x0000
+0x0401=0x07FF
+0x0206=0x0000
+0x0124=0x0000
+0x0341=0x0000
+0x0287=0x0000
+0x0501=0x0000
+0x034C=0x0000
+0x030F=0x0000
+0x025D=0x0000
+0x0406=0x0000
+0x051B=0x0000
+0x0313=0x0000
+0x010A=0x104C
+0x0461=0x0000
+0x0121=0x356A
+0x0115=0x0009
+0x0112=0xC0E6
+0x039A=0x0000
+0x02CC=0x0000
+0x0116=0x8180
+0x04A0=0x0000
+0x0108=0x9442
+0x020B=0x4000
+0x0251=0x0000
+0x0488=0x0000
+0x0241=0x0000
+0x038F=0x0000
+0x02DC=0x0000
+0x024C=0x0000
+0x0494=0x0000
+0x051D=0x0000
+0x0243=0x0000
+0x0556=0x0000
+0x040A=0x0000
+0x04CD=0x0000
+0x0249=0x0000
+0x0261=0x0000
+0x024A=0x0000
+0x0285=0x0000
+0x0280=0x0000
+0x0346=0x0000
+0x024E=0x0000
+0x024F=0x0000
+0x0253=0x0000
+0x0255=0x0000
+0x0502=0x0000
+0x0258=0x0000
+0x0298=0x0000
+0x05A3=0x0000
+0x0367=0x0000
+0x0240=0x0020
+0x0256=0x0000
+0x0242=0x0000
+0x025A=0x0000
+0x04E2=0x0000
+0x04C5=0x0000
+0x025B=0x0000
+0x020C=0x7FFF
+0x0205=0x0000
+0x0361=0x0000
+0x0515=0x0000
+0x025C=0x0000
+0x0355=0x0000
+0x044C=0x0000
+0x010C=0x88FD
+0x0284=0x0000
+0x0396=0x0000
+0x0286=0x0000
+0x028F=0x0000
+0x031C=0x0000
+0x031A=0x0000
+0x0363=0x0000
+0x0289=0x0000
+0x059C=0x0000
+0x04DD=0x0000
+0x028A=0x0000
+0x040C=0x0000
+0x028B=0x0000
+0x0450=0x0000
+0x0352=0x0000
+0x028C=0x0000
+0x04C2=0x0000
+0x025E=0x0000
+0x04DA=0x0000
+0x0327=0x0000
+0x0380=0x0000
+0x0342=0x0000
+0x0343=0x0000
+0x0561=0x0000
+0x0344=0x0000
+0x0586=0x0000
+0x0484=0x0000
+0x0345=0x0000
+0x0505=0x0000
+0x035B=0x0000
+0x034A=0x0000
+0x0455=0x0000
+0x011A=0x2E02
+0x034B=0x0000
+0x034D=0x0000
+0x035C=0x0000
+0x034E=0x0000
+0x0293=0x0000
+0x03A6=0x0000
+0x0350=0x0000
+0x0445=0x0000
+0x048F=0x0000
+0x0351=0x0000
+0x0353=0x0000
+0x050D=0x0000
+0x02CD=0x0000
+0x0490=0x0000
+0x0354=0x0000
+0x0348=0x0000
+0x0498=0x0000
+0x0356=0x0000
+0x0316=0x0000
+0x030D=0x0000
+0x040E=0x0000
+0x0522=0x0000
+0x049F=0x0000
+0x029D=0x0000
+0x04A3=0x0000
+0x0359=0x0000
+0x0299=0x0000
+0x0452=0x0000
+0x02C8=0x0000
+0x035A=0x0000
+0x0449=0x0000
+0x0442=0x0000
+0x035D=0x0000
+0x035E=0x0000
+0x0597=0x0000
+0x035F=0x0000
+0x0325=0x0000
+0x0364=0x0000
+0x0365=0x0000
+0x0366=0x0000
+0x0381=0x0000
+0x0288=0x0000
+0x0382=0x0000
+0x0384=0x0000
+0x0315=0x0000
+0x0385=0x0000
+0x054F=0x0000
+0x0389=0x0000
+0x04E3=0x0000
+0x040F=0x0000
+0x0386=0x0000
+0x054E=0x0000
+0x02D0=0x0000
+0x03A0=0x0000
+0x0387=0x0000
+0x0362=0x0000
+0x038A=0x0000
+0x0395=0x0000
+0x038D=0x0000
+0x02E7=0x0000
+0x0324=0x0000
+0x038E=0x0000
+0x0305=0x0000
+0x0393=0x0000
+0x0459=0x0000
+0x0394=0x0000
+0x0123=0x267B
+0x0497=0x0000
+0x0398=0x0000
+0x0408=0x0000
+0x0399=0x0000
+0x039B=0x0000
+0x0248=0x0000
+0x039F=0x0000
+0x049E=0x0000
+0x059A=0x0000
+0x048D=0x0000
+0x051C=0x0000
+0x03A2=0x0000
+0x03A3=0x0000
+0x03A4=0x0000
+0x03A5=0x0000
+0x0520=0x0000
+0x03A7=0x0000
+0x055E=0x0000
+0x0402=0x07FF
+0x0403=0x0000
+0x04D8=0x0000
+0x0560=0x0000
+0x0404=0x0000
+0x0254=0x0000
+0x0405=0x0000
+0x0407=0x0000
+0x0580=0x0000
+0x0409=0x0000
+0x040B=0x7FFF
+0x040D=0x0000
+0x0441=0x0000
+0x0508=0x0000
+0x0443=0x0000
+0x0444=0x0000
+0x04CA=0x0000
+0x0446=0x0000
+0x0454=0x0000
+0x0448=0x0000
+0x044B=0x0000
+0x02E2=0x0000
+0x044D=0x0000
+0x0390=0x0000
+0x0451=0x0000
+0x0453=0x0000
+0x0559=0x0000
+0x0456=0x0000
+0x0314=0x0000
+0x0458=0x0000
+0x02DA=0x0000
+0x045A=0x0000
+0x0447=0x0000
+0x0460=0x0000
+0x0480=0x0000
+0x045F=0x0000
+0x0486=0x0000
+0x0487=0x0000
+0x0358=0x0000
+0x048B=0x0000
+0x048C=0x0000
+0x0283=0x0000
+0x048E=0x0000
+0x029B=0x0000
+0x0491=0x0000
+0x0492=0x0000
+0x04A1=0x0000
+0x0493=0x0000
+0x04C3=0x0000
+0x0496=0x0000
+0x02C0=0x0000
+0x0499=0x0000
+0x02E3=0x0000
+0x0397=0x0000
+0x049C=0x0000
+0x04C7=0x0000
+0x049D=0x0000
+0x0109=0x61C1
+0x04A2=0x0000
+0x04A5=0x0000
+0x04A6=0x0000
+0x0257=0x0000
+0x04D6=0x0000
+0x031E=0x0000
+0x04C0=0x0000
+0x02CA=0x0000
+0x04C9=0x0000
+0x02C3=0x0000
+0x04C1=0x0000
+0x0207=0x0000
+0x04C6=0x0000
+0x02A5=0x0000
+0x04CC=0x0000
+0x04CE=0x0000
+0x025F=0x0000
+0x04CF=0x0000
+0x04D0=0x0000
+0x0548=0x0000
+0x04D2=0x0000
+0x04D3=0x0000
+0x0504=0x0000
+0x04D4=0x0000
+0x0304=0x0000
+0x04D5=0x0000
+0x04D9=0x0000
+0x04DB=0x0000
+0x04DC=0x0000
+0x058B=0x0000
+0x04DE=0x0000
+0x04E0=0x0000
+0x02A2=0x0000
+0x03A1=0x0000
+0x04E1=0x0000
+[lms7002_registers_a]
+0x05A7=0x0000
+0x05A5=0x0000
+0x05A2=0x0000
+0x0599=0x0000
+0x0598=0xF61D
+0x0596=0x0A94
+0x0594=0xF40D
+0x0592=0x0DF1
+0x0591=0xFCFE
+0x0590=0xEF99
+0x058E=0x1316
+0x058C=0xEA50
+0x059D=0x0000
+0x058A=0x17DC
+0x0585=0xDAA2
+0x0595=0x00BC
+0x0584=0xE7E2
+0x059F=0x0000
+0x0583=0x2E45
+0x0582=0x150F
+0x0567=0x4049
+0x0566=0x0906
+0x0565=0xB77F
+0x0563=0x4F91
+0x055F=0x5852
+0x055D=0xA6B5
+0x055A=0xBE2A
+0x058F=0x0605
+0x0557=0x4C24
+0x0593=0x00D8
+0x0554=0x6901
+0x0552=0x8D44
+0x0551=0xD7B7
+0x0550=0x79FA
+0x054C=0x7FFF
+0x0549=0x18C9
+0x0547=0xD7B7
+0x0546=0x8D44
+0x0545=0x364E
+0x0544=0x6901
+0x0543=0xBD96
+0x0553=0x364E
+0x0542=0xA2B5
+0x0541=0x4C24
+0x0527=0xACB9
+0x0526=0xBE2A
+0x0525=0x57AC
+0x0523=0xA6B5
+0x0521=0x5852
+0x055C=0x3347
+0x051A=0x0906
+0x0518=0xEFF2
+0x0514=0xE7E2
+0x0513=0xDAA2
+0x0511=0x1D10
+0x05A6=0x0000
+0x051E=0xF524
+0x050F=0xEA5F
+0x0516=0x150F
+0x050E=0x17DC
+0x050C=0xEA50
+0x050B=0xF5EF
+0x050A=0x1316
+0x0509=0x0605
+0x0507=0xFCFE
+0x0506=0x0DF1
+0x0503=0x00BC
+0x04E7=0x0000
+0x04E6=0x0000
+0x04E4=0x0000
+0x04E0=0x0000
+0x058B=0x0F45
+0x04DE=0x0000
+0x04DC=0x0000
+0x04DB=0x0000
+0x04D9=0x0000
+0x04D8=0x0000
+0x059E=0x0000
+0x04D7=0x0000
+0x0504=0xF40D
+0x04D4=0x0000
+0x04D3=0x0000
+0x0548=0x79FA
+0x04D2=0x0000
+0x04D1=0x0000
+0x04D0=0x0000
+0x04CE=0x0000
+0x04C8=0x0000
+0x04E2=0x0000
+0x04C5=0x0000
+0x04C4=0x0000
+0x04C2=0x0000
+0x04A7=0x0000
+0x04A6=0x0000
+0x04A5=0x0000
+0x04A1=0x0000
+0x04A0=0x0000
+0x0522=0xDB10
+0x049F=0x0000
+0x049E=0x0000
+0x04C7=0x0000
+0x049D=0x0000
+0x049B=0x0000
+0x049A=0x0000
+0x04C3=0x0000
+0x0496=0x0000
+0x0494=0x0000
+0x02D3=0x0000
+0x02D1=0x0000
+0x02CB=0x0000
+0x0250=0x0000
+0x0096=0x0000
+0x04C1=0x0000
+0x02C3=0x0000
+0x02C4=0x0000
+0x02C2=0x0000
+0x0499=0x0000
+0x02C0=0x0000
+0x0201=0x07FF
+0x0483=0x0000
+0x05A4=0x0000
+0x02A3=0x0000
+0x008B=0x2756
+0x02A1=0x0000
+0x028D=0x0000
+0x029C=0x0000
+0x029E=0x0000
+0x0297=0x0000
+0x0296=0x0000
+0x0555=0xBD96
+0x0349=0x0000
+0x010D=0x015C
+0x02CF=0x0000
+0x0291=0x0000
+0x02DF=0x0000
+0x0290=0x0000
+0x0021=0x0E9F
+0x0450=0x0000
+0x0558=0x5009
+0x02C6=0x0000
+0x0101=0x7800
+0x059C=0x0000
+0x04DD=0x0000
+0x028A=0x0000
+0x0121=0x3652
+0x0285=0x0000
+0x0280=0x0000
+0x0319=0x0000
+0x04CF=0x0000
+0x025F=0x0000
+0x025D=0x0000
+0x030F=0x0000
+0x0406=0x0000
+0x02C5=0x0000
+0x0200=0x0301
+0x0281=0x0000
+0x04A2=0x0000
+0x0109=0x8CC1
+0x0355=0x0000
+0x044C=0x0000
+0x025B=0x0000
+0x0298=0x0000
+0x0502=0x0A94
+0x0258=0x0000
+0x0255=0x0000
+0x04D6=0x0000
+0x0257=0x0000
+0x0252=0x0000
+0x0204=0xC016
+0x024F=0x0000
+0x04CC=0x0000
+0x02A5=0x0000
+0x0497=0x0000
+0x0123=0x067B
+0x0495=0x0000
+0x0246=0x0000
+0x051D=0x4F91
+0x0243=0x0000
+0x0556=0xA2B5
+0x040A=0x1000
+0x025A=0x0000
+0x0242=0x0000
+0x020C=0x8000
+0x0251=0x0000
+0x02DD=0x0000
+0x0020=0xFFFD
+0x0488=0x0000
+0x020A=0x0080
+0x0102=0x3180
+0x04C6=0x0000
+0x0207=0x0000
+0x04DA=0x0000
+0x025E=0x0000
+0x0206=0x0000
+0x00A3=0x6565
+0x02E2=0x0000
+0x044D=0x0000
+0x0292=0x0000
+0x002A=0x0086
+0x0245=0x0000
+0x0581=0xC89D
+0x045D=0x0000
+0x024D=0x0000
+0x002B=0x4032
+0x02A0=0x0000
+0x010E=0x0285
+0x0286=0x0000
+0x009E=0x658C
+0x0088=0x04F0
+0x0085=0x0001
+0x0295=0x0000
+0x0089=0x0048
+0x0256=0x0000
+0x0093=0x0000
+0x0092=0x0001
+0x031B=0x0000
+0x0111=0x0099
+0x0095=0x0000
+0x02A7=0x0000
+0x0203=0x2F99
+0x030E=0x0000
+0x0482=0x0000
+0x05A0=0x0000
+0x009C=0x658C
+0x0381=0x0000
+0x0122=0x033F
+0x0110=0x0BFF
+0x0100=0xB409
+0x0028=0x0101
+0x0026=0x0101
+0x0524=0x3347
+0x009D=0x6565
+0x0294=0x0000
+0x0106=0x3182
+0x028E=0x0000
+0x0326=0x0000
+0x0113=0x03C3
+0x04CB=0x0000
+0x0391=0x0000
+0x05A1=0x0000
+0x02C9=0x0000
+0x0500=0xF61D
+0x039D=0x0000
+0x011F=0x3680
+0x0395=0x0000
+0x024B=0x0000
+0x045C=0x0000
+0x0247=0x0000
+0x0512=0x196B
+0x04E5=0x0000
+0x0024=0x50D8
+0x0353=0x0000
+0x050D=0x0F45
+0x02CD=0x0000
+0x0490=0x0000
+0x0501=0xFDFB
+0x034C=0x0000
+0x00AA=0x0000
+0x0350=0x0000
+0x0445=0x0000
+0x048F=0x0000
+0x008A=0x0491
+0x0453=0x0000
+0x0124=0x0000
+0x0260=0x0000
+0x00A1=0x6565
+0x0356=0x0000
+0x0241=0x0000
+0x04CD=0x0000
+0x0249=0x0000
+0x002C=0x0000
+0x038F=0x0000
+0x008C=0x267B
+0x0459=0x0000
+0x0394=0x0000
+0x054D=0xF7A3
+0x00A6=0x0001
+0x002D=0xFFFF
+0x00AC=0x2000
+0x0253=0x0000
+0x028B=0x0000
+0x040C=0x40F8
+0x0099=0x6565
+0x0310=0x0000
+0x00A2=0x6565
+0x0589=0xEA5F
+0x002F=0x3840
+0x0597=0xFDFB
+0x035F=0x0000
+0x0562=0xF524
+0x0025=0x0101
+0x011C=0xAD41
+0x011D=0x2AAA
+0x039E=0x0000
+0x0289=0x0000
+0x0282=0x0000
+0x0307=0x0000
+0x038C=0x0000
+0x0087=0x0000
+0x0399=0x0000
+0x054B=0xF7A3
+0x02C7=0x0000
+0x0519=0x4049
+0x009F=0x658C
+0x0515=0x2E45
+0x025C=0x0000
+0x00A5=0x6565
+0x0301=0x0000
+0x02C1=0x0000
+0x0259=0x0000
+0x02D5=0x0000
+0x02E1=0x0000
+0x0517=0xC89D
+0x0481=0x0000
+0x00A8=0x0000
+0x02D2=0x0000
+0x039C=0x0000
+0x0564=0x0000
+0x00AB=0x0040
+0x0261=0x0000
+0x002E=0x0000
+0x02DE=0x0000
+0x0540=0x5009
+0x02A4=0x0000
+0x0485=0x0000
+0x0489=0x0000
+0x00AD=0x03FF
+0x024A=0x0000
+0x0029=0x0101
+0x0097=0x0000
+0x011E=0x061D
+0x00AE=0x0000
+0x00A7=0x6565
+0x020B=0x4000
+0x0098=0x0000
+0x0108=0xFC26
+0x0027=0x05E4
+0x0117=0x100C
+0x0383=0x0000
+0x0202=0x0794
+0x054A=0x8184
+0x00A4=0x6565
+0x0401=0x07FF
+0x0086=0x4101
+0x010C=0x8865
+0x02D8=0x0000
+0x0347=0x0000
+0x0457=0x0000
+0x0103=0x0A12
+0x0104=0x0088
+0x0357=0x0000
+0x02DB=0x0000
+0x0400=0x0101
+0x009B=0x6565
+0x0105=0x0007
+0x05A3=0x0000
+0x0240=0x0028
+0x0367=0x0000
+0x044F=0x0000
+0x038B=0x0000
+0x0284=0x0000
+0x0396=0x0000
+0x051F=0xAB08
+0x029A=0x0000
+0x0361=0x0000
+0x0205=0x0000
+0x0119=0x18DF
+0x02A6=0x0000
+0x010F=0x3042
+0x04C0=0x0000
+0x031E=0x0000
+0x02CC=0x0000
+0x0116=0x8180
+0x0587=0x1D10
+0x0023=0x5550
+0x048C=0x0000
+0x0112=0x3171
+0x039A=0x0000
+0x0320=0x0000
+0x0323=0x0000
+0x0115=0x0009
+0x00A9=0x8000
+0x0244=0x0000
+0x0094=0x0000
+0x0317=0x0000
+0x0208=0x0170
+0x0340=0x0000
+0x058D=0xF5EF
+0x02D7=0x0000
+0x04A3=0x0000
+0x029D=0x0000
+0x0388=0x0000
+0x0120=0xB9FF
+0x04C9=0x0000
+0x02CA=0x0000
+0x0209=0x0000
+0x0082=0x8001
+0x0107=0x318C
+0x02D4=0x0000
+0x02CE=0x0000
+0x02D9=0x0000
+0x02E4=0x0000
+0x024C=0x0000
+0x02DC=0x0000
+0x0118=0x018C
+0x02E0=0x0000
+0x055B=0x57AC
+0x0114=0x0110
+0x02E5=0x0000
+0x02E6=0x0000
+0x045B=0x0000
+0x034F=0x0000
+0x0300=0x0000
+0x044E=0x0000
+0x0510=0xE6C7
+0x0302=0x0000
+0x0303=0x0000
+0x04D5=0x0000
+0x0304=0x0000
+0x0306=0x0000
+0x04A4=0x0000
+0x044A=0x0000
+0x049C=0x0000
+0x02E3=0x0000
+0x0397=0x0000
+0x0588=0xE6C7
+0x0308=0x0000
+0x048A=0x0000
+0x0309=0x0000
+0x029F=0x0000
+0x030A=0x0000
+0x0392=0x0000
+0x030B=0x0000
+0x04DF=0x0000
+0x030C=0x0000
+0x02D6=0x0000
+0x0311=0x0000
+0x024E=0x0000
+0x0346=0x0000
+0x0312=0x0000
+0x051B=0xB77F
+0x010A=0x104C
+0x0461=0x0000
+0x0313=0x0000
+0x0360=0x0000
+0x028C=0x0000
+0x0352=0x0000
+0x040E=0x0003
+0x030D=0x0000
+0x0316=0x0000
+0x031F=0x0000
+0x0318=0x0000
+0x0287=0x0000
+0x0341=0x0000
+0x028F=0x0000
+0x031C=0x0000
+0x031A=0x0000
+0x0363=0x0000
+0x031D=0x0000
+0x0440=0x0024
+0x045E=0x0000
+0x0321=0x0000
+0x059B=0x0000
+0x0322=0x0000
+0x0327=0x0000
+0x0380=0x0000
+0x0342=0x0000
+0x0343=0x0000
+0x0561=0xAB08
+0x0344=0x0000
+0x0586=0x196B
+0x0484=0x0000
+0x0345=0x0000
+0x0505=0x00D8
+0x035B=0x0000
+0x0498=0x0000
+0x0084=0x0400
+0x0348=0x0000
+0x034A=0x0000
+0x0455=0x0000
+0x011A=0x2E14
+0x034B=0x0000
+0x034D=0x0000
+0x035C=0x0000
+0x034E=0x0000
+0x0293=0x0000
+0x03A6=0x0000
+0x0351=0x0000
+0x0354=0x0000
+0x048B=0x0000
+0x0358=0x0000
+0x0359=0x0000
+0x0299=0x0000
+0x0452=0x0000
+0x02C8=0x0000
+0x035A=0x0000
+0x0449=0x0000
+0x0442=0x0000
+0x035D=0x0000
+0x035E=0x0000
+0x038A=0x0000
+0x0362=0x0000
+0x0081=0x0000
+0x0325=0x0000
+0x0364=0x0000
+0x0365=0x0000
+0x0366=0x0000
+0x0288=0x0000
+0x0382=0x0000
+0x0384=0x0000
+0x0315=0x0000
+0x0385=0x0000
+0x054F=0x18C9
+0x0389=0x0000
+0x04E3=0x0000
+0x040F=0x43E4
+0x0386=0x0000
+0x054E=0x8184
+0x009A=0x658C
+0x02D0=0x0000
+0x03A0=0x0000
+0x0387=0x0000
+0x038D=0x0000
+0x02E7=0x0000
+0x0324=0x0000
+0x038E=0x0000
+0x0305=0x0000
+0x0393=0x0000
+0x0398=0x0000
+0x0408=0x0000
+0x039B=0x0000
+0x0248=0x0000
+0x039F=0x0000
+0x04E1=0x0000
+0x02A2=0x0000
+0x03A1=0x0000
+0x059A=0x0000
+0x048D=0x0000
+0x051C=0x0000
+0x03A2=0x0000
+0x03A3=0x0000
+0x03A4=0x0000
+0x03A5=0x0000
+0x0520=0x174B
+0x03A7=0x0000
+0x055E=0xDB10
+0x0402=0x07D9
+0x0403=0x0013
+0x0560=0x174B
+0x00A0=0x6565
+0x0404=0x0000
+0x0254=0x0000
+0x0405=0x0000
+0x0407=0x0000
+0x0580=0xEFF2
+0x0409=0x0000
+0x040B=0x000F
+0x040D=0x0000
+0x0441=0x0000
+0x0508=0xEF99
+0x0443=0x0000
+0x0444=0x0000
+0x04CA=0x0000
+0x0446=0x0000
+0x0454=0x0000
+0x0448=0x0000
+0x044B=0x0000
+0x0390=0x0000
+0x0451=0x0000
+0x0559=0xACB9
+0x0456=0x0000
+0x0314=0x0000
+0x0458=0x0000
+0x02DA=0x0000
+0x045A=0x0000
+0x0447=0x0000
+0x0460=0x0000
+0x0480=0x0000
+0x045F=0x0000
+0x0486=0x0000
+0x0487=0x0000
+0x0283=0x0000
+0x0022=0x07FF
+0x048E=0x0000
+0x029B=0x0000
+0x0491=0x0000
+0x0492=0x0000
+0x0493=0x0000
+[file_info]
+version=1
+type=lms7002m_minimal_config
diff --git a/targets/ARCH/LMSSDR/enb_sodera_lowband_Lrx_5MHz_rx19dB_txfull.ini b/targets/ARCH/LMSSDR/enb_sodera_lowband_Lrx_5MHz_rx19dB_txfull.ini
new file mode 100644
index 0000000000000000000000000000000000000000..34ce70c888f089f0498a5000848e4d99858de8ce
--- /dev/null
+++ b/targets/ARCH/LMSSDR/enb_sodera_lowband_Lrx_5MHz_rx19dB_txfull.ini
@@ -0,0 +1,1128 @@
+[reference_clocks]
+sxr_ref_clk_mhz=30.72
+sxt_ref_clk_mhz=30.72
+[lms7002_registers_b]
+0x05A7=0x0000
+0x05A5=0x0000
+0x05A2=0x0000
+0x05A0=0x0000
+0x0599=0x0000
+0x0598=0x0000
+0x0596=0x0000
+0x0594=0x0000
+0x0592=0x0000
+0x0591=0x0000
+0x0590=0x0000
+0x058E=0x0000
+0x058C=0x0000
+0x059D=0x0000
+0x058A=0x0000
+0x0589=0x0000
+0x0587=0x0000
+0x0585=0x0000
+0x0595=0x0000
+0x0584=0x0000
+0x059F=0x0000
+0x0583=0x0000
+0x0582=0x0000
+0x0567=0x0000
+0x0566=0x0000
+0x0565=0x0000
+0x0564=0x0000
+0x0563=0x0000
+0x0562=0x0000
+0x055F=0x0000
+0x055D=0x0000
+0x055A=0x0000
+0x058F=0x0000
+0x0557=0x0000
+0x0593=0x0000
+0x0554=0x0000
+0x0552=0x0000
+0x0551=0x0000
+0x0550=0x0000
+0x054D=0x0000
+0x054C=0x0000
+0x0549=0x0000
+0x0547=0x0000
+0x0546=0x0000
+0x0545=0x0000
+0x0544=0x0000
+0x0543=0x0000
+0x0553=0x0000
+0x0542=0x0000
+0x0541=0x0000
+0x0527=0x0000
+0x0526=0x0000
+0x0524=0x0000
+0x0525=0x0000
+0x0523=0x0000
+0x0521=0x0000
+0x055C=0x0000
+0x051A=0x0000
+0x0519=0x0000
+0x0518=0x0000
+0x0514=0x0000
+0x0513=0x0000
+0x0511=0x0000
+0x05A6=0x0000
+0x051E=0x0000
+0x050F=0x0000
+0x0516=0x0000
+0x050E=0x0000
+0x050C=0x0000
+0x050B=0x0000
+0x050A=0x0000
+0x0509=0x0000
+0x0507=0x0000
+0x0506=0x0000
+0x0503=0x0000
+0x04E7=0x0000
+0x04E6=0x0000
+0x0512=0x0000
+0x04E5=0x0000
+0x04E4=0x0000
+0x0321=0x0000
+0x0320=0x0000
+0x0323=0x0000
+0x031B=0x0000
+0x0319=0x0000
+0x0260=0x0000
+0x031F=0x0000
+0x0360=0x0000
+0x0312=0x0000
+0x0310=0x0000
+0x0245=0x0000
+0x0581=0x0000
+0x045D=0x0000
+0x030E=0x0000
+0x0203=0x0000
+0x0482=0x0000
+0x0588=0x0000
+0x0308=0x0000
+0x048A=0x0000
+0x0307=0x0000
+0x0282=0x0000
+0x038C=0x0000
+0x0510=0x0000
+0x0302=0x0000
+0x0301=0x0000
+0x0309=0x0000
+0x0300=0x0000
+0x044E=0x0000
+0x034F=0x0000
+0x055B=0x0000
+0x0114=0x008D
+0x02E5=0x0000
+0x02E4=0x0000
+0x02E1=0x0000
+0x02D5=0x0000
+0x0259=0x0000
+0x0517=0x0000
+0x0481=0x0000
+0x030B=0x0000
+0x0392=0x0000
+0x02DE=0x0000
+0x02DD=0x0000
+0x0297=0x0000
+0x0209=0x0000
+0x0400=0x0081
+0x02D8=0x0000
+0x0104=0x0088
+0x0103=0x0A12
+0x0347=0x0000
+0x0457=0x0000
+0x058D=0x0000
+0x02D7=0x0000
+0x02D1=0x0000
+0x04C8=0x0000
+0x02D3=0x0000
+0x02CB=0x0000
+0x0250=0x0000
+0x0306=0x0000
+0x04A4=0x0000
+0x044A=0x0000
+0x054B=0x0000
+0x02C7=0x0000
+0x02C1=0x0000
+0x031D=0x0000
+0x0440=0x0020
+0x045E=0x0000
+0x02C4=0x0000
+0x02C2=0x0000
+0x02DB=0x0000
+0x0357=0x0000
+0x0201=0x07FF
+0x0483=0x0000
+0x05A4=0x0000
+0x02A3=0x0000
+0x02A1=0x0000
+0x028D=0x0000
+0x02D2=0x0000
+0x039C=0x0000
+0x02A0=0x0000
+0x010E=0x2040
+0x030A=0x0000
+0x029F=0x0000
+0x029C=0x0000
+0x029E=0x0000
+0x011D=0x699D
+0x039E=0x0000
+0x0296=0x0000
+0x0555=0x0000
+0x0349=0x0000
+0x0295=0x0000
+0x010D=0x009E
+0x04C4=0x0000
+0x0292=0x0000
+0x02CF=0x0000
+0x04D1=0x0000
+0x0291=0x0000
+0x02DF=0x0000
+0x0290=0x0000
+0x020A=0x0080
+0x0102=0x3180
+0x0388=0x0000
+0x0120=0xB9FF
+0x0317=0x0000
+0x0244=0x0000
+0x059B=0x0000
+0x0322=0x0000
+0x010F=0x3042
+0x0119=0x18CB
+0x02A6=0x0000
+0x051F=0x0000
+0x029A=0x0000
+0x049A=0x0000
+0x059E=0x0000
+0x04D7=0x0000
+0x0318=0x0000
+0x02A7=0x0000
+0x0200=0x0081
+0x02C5=0x0000
+0x0122=0x033F
+0x0110=0x0BF4
+0x0204=0x0000
+0x0252=0x0000
+0x011E=0x06B9
+0x049B=0x0000
+0x0294=0x0000
+0x011C=0xAD41
+0x02D6=0x0000
+0x0311=0x0000
+0x0117=0x280C
+0x0540=0x0000
+0x02A4=0x0000
+0x0485=0x0000
+0x02E0=0x0000
+0x0118=0x018C
+0x0489=0x0000
+0x04A7=0x0000
+0x0101=0x7800
+0x0558=0x0000
+0x02C6=0x0000
+0x05A1=0x0000
+0x02C9=0x0000
+0x0500=0x0000
+0x039D=0x0000
+0x011F=0x3680
+0x030C=0x0000
+0x04DF=0x0000
+0x0281=0x0000
+0x0106=0x3182
+0x028E=0x0000
+0x0326=0x0000
+0x0113=0x03C3
+0x04CB=0x0000
+0x0391=0x0000
+0x0105=0x0007
+0x02D9=0x0000
+0x02CE=0x0000
+0x044F=0x0000
+0x038B=0x0000
+0x02D4=0x0000
+0x0107=0x318C
+0x0495=0x0000
+0x0246=0x0000
+0x0303=0x0000
+0x02E6=0x0000
+0x045B=0x0000
+0x0100=0x3409
+0x0340=0x0000
+0x0208=0x0070
+0x0111=0x0083
+0x0247=0x0000
+0x024B=0x0000
+0x045C=0x0000
+0x024D=0x0000
+0x0202=0x07FF
+0x0383=0x0000
+0x054A=0x0000
+0x0401=0x07FF
+0x0206=0x0000
+0x0124=0x0000
+0x0341=0x0000
+0x0287=0x0000
+0x0501=0x0000
+0x034C=0x0000
+0x030F=0x0000
+0x025D=0x0000
+0x0406=0x0000
+0x051B=0x0000
+0x0313=0x0000
+0x010A=0x104C
+0x0461=0x0000
+0x0121=0x333C
+0x0115=0x0009
+0x0112=0xC0E6
+0x039A=0x0000
+0x02CC=0x0000
+0x0116=0x8180
+0x04A0=0x0000
+0x0108=0x9442
+0x020B=0x4000
+0x0251=0x0000
+0x0488=0x0000
+0x0241=0x0000
+0x038F=0x0000
+0x02DC=0x0000
+0x024C=0x0000
+0x0494=0x0000
+0x051D=0x0000
+0x0243=0x0000
+0x0556=0x0000
+0x040A=0x0000
+0x04CD=0x0000
+0x0249=0x0000
+0x0261=0x0000
+0x024A=0x0000
+0x0285=0x0000
+0x0280=0x0000
+0x0346=0x0000
+0x024E=0x0000
+0x024F=0x0000
+0x0253=0x0000
+0x0255=0x0000
+0x0502=0x0000
+0x0258=0x0000
+0x0298=0x0000
+0x05A3=0x0000
+0x0367=0x0000
+0x0240=0x0020
+0x0256=0x0000
+0x0242=0x0000
+0x025A=0x0000
+0x04E2=0x0000
+0x04C5=0x0000
+0x025B=0x0000
+0x020C=0x7FFF
+0x0205=0x0000
+0x0361=0x0000
+0x0515=0x0000
+0x025C=0x0000
+0x0355=0x0000
+0x044C=0x0000
+0x010C=0x88FD
+0x0284=0x0000
+0x0396=0x0000
+0x0286=0x0000
+0x028F=0x0000
+0x031C=0x0000
+0x031A=0x0000
+0x0363=0x0000
+0x0289=0x0000
+0x059C=0x0000
+0x04DD=0x0000
+0x028A=0x0000
+0x040C=0x0000
+0x028B=0x0000
+0x0450=0x0000
+0x0352=0x0000
+0x028C=0x0000
+0x04C2=0x0000
+0x025E=0x0000
+0x04DA=0x0000
+0x0327=0x0000
+0x0380=0x0000
+0x0342=0x0000
+0x0343=0x0000
+0x0561=0x0000
+0x0344=0x0000
+0x0586=0x0000
+0x0484=0x0000
+0x0345=0x0000
+0x0505=0x0000
+0x035B=0x0000
+0x034A=0x0000
+0x0455=0x0000
+0x011A=0x2E02
+0x034B=0x0000
+0x034D=0x0000
+0x035C=0x0000
+0x034E=0x0000
+0x0293=0x0000
+0x03A6=0x0000
+0x0350=0x0000
+0x0445=0x0000
+0x048F=0x0000
+0x0351=0x0000
+0x0353=0x0000
+0x050D=0x0000
+0x02CD=0x0000
+0x0490=0x0000
+0x0354=0x0000
+0x0348=0x0000
+0x0498=0x0000
+0x0356=0x0000
+0x0316=0x0000
+0x030D=0x0000
+0x040E=0x0000
+0x0522=0x0000
+0x049F=0x0000
+0x029D=0x0000
+0x04A3=0x0000
+0x0359=0x0000
+0x0299=0x0000
+0x0452=0x0000
+0x02C8=0x0000
+0x035A=0x0000
+0x0449=0x0000
+0x0442=0x0000
+0x035D=0x0000
+0x035E=0x0000
+0x0597=0x0000
+0x035F=0x0000
+0x0325=0x0000
+0x0364=0x0000
+0x0365=0x0000
+0x0366=0x0000
+0x0381=0x0000
+0x0288=0x0000
+0x0382=0x0000
+0x0384=0x0000
+0x0315=0x0000
+0x0385=0x0000
+0x054F=0x0000
+0x0389=0x0000
+0x04E3=0x0000
+0x040F=0x0000
+0x0386=0x0000
+0x054E=0x0000
+0x02D0=0x0000
+0x03A0=0x0000
+0x0387=0x0000
+0x0362=0x0000
+0x038A=0x0000
+0x0395=0x0000
+0x038D=0x0000
+0x02E7=0x0000
+0x0324=0x0000
+0x038E=0x0000
+0x0305=0x0000
+0x0393=0x0000
+0x0459=0x0000
+0x0394=0x0000
+0x0123=0x267B
+0x0497=0x0000
+0x0398=0x0000
+0x0408=0x0000
+0x0399=0x0000
+0x039B=0x0000
+0x0248=0x0000
+0x039F=0x0000
+0x049E=0x0000
+0x059A=0x0000
+0x048D=0x0000
+0x051C=0x0000
+0x03A2=0x0000
+0x03A3=0x0000
+0x03A4=0x0000
+0x03A5=0x0000
+0x0520=0x0000
+0x03A7=0x0000
+0x055E=0x0000
+0x0402=0x07FF
+0x0403=0x0000
+0x04D8=0x0000
+0x0560=0x0000
+0x0404=0x0000
+0x0254=0x0000
+0x0405=0x0000
+0x0407=0x0000
+0x0580=0x0000
+0x0409=0x0000
+0x040B=0x7FFF
+0x040D=0x0000
+0x0441=0x0000
+0x0508=0x0000
+0x0443=0x0000
+0x0444=0x0000
+0x04CA=0x0000
+0x0446=0x0000
+0x0454=0x0000
+0x0448=0x0000
+0x044B=0x0000
+0x02E2=0x0000
+0x044D=0x0000
+0x0390=0x0000
+0x0451=0x0000
+0x0453=0x0000
+0x0559=0x0000
+0x0456=0x0000
+0x0314=0x0000
+0x0458=0x0000
+0x02DA=0x0000
+0x045A=0x0000
+0x0447=0x0000
+0x0460=0x0000
+0x0480=0x0000
+0x045F=0x0000
+0x0486=0x0000
+0x0487=0x0000
+0x0358=0x0000
+0x048B=0x0000
+0x048C=0x0000
+0x0283=0x0000
+0x048E=0x0000
+0x029B=0x0000
+0x0491=0x0000
+0x0492=0x0000
+0x04A1=0x0000
+0x0493=0x0000
+0x04C3=0x0000
+0x0496=0x0000
+0x02C0=0x0000
+0x0499=0x0000
+0x02E3=0x0000
+0x0397=0x0000
+0x049C=0x0000
+0x04C7=0x0000
+0x049D=0x0000
+0x0109=0x61C1
+0x04A2=0x0000
+0x04A5=0x0000
+0x04A6=0x0000
+0x0257=0x0000
+0x04D6=0x0000
+0x031E=0x0000
+0x04C0=0x0000
+0x02CA=0x0000
+0x04C9=0x0000
+0x02C3=0x0000
+0x04C1=0x0000
+0x0207=0x0000
+0x04C6=0x0000
+0x02A5=0x0000
+0x04CC=0x0000
+0x04CE=0x0000
+0x025F=0x0000
+0x04CF=0x0000
+0x04D0=0x0000
+0x0548=0x0000
+0x04D2=0x0000
+0x04D3=0x0000
+0x0504=0x0000
+0x04D4=0x0000
+0x0304=0x0000
+0x04D5=0x0000
+0x04D9=0x0000
+0x04DB=0x0000
+0x04DC=0x0000
+0x058B=0x0000
+0x04DE=0x0000
+0x04E0=0x0000
+0x02A2=0x0000
+0x03A1=0x0000
+0x04E1=0x0000
+[lms7002_registers_a]
+0x05A7=0x0000
+0x05A5=0x0000
+0x05A2=0x0000
+0x0599=0x0000
+0x0598=0xF61D
+0x0596=0x0A94
+0x0594=0xF40D
+0x0592=0x0DF1
+0x0591=0xFCFE
+0x0590=0xEF99
+0x058E=0x1316
+0x058C=0xEA50
+0x059D=0x0000
+0x058A=0x17DC
+0x0585=0xDAA2
+0x0595=0x00BC
+0x0584=0xE7E2
+0x059F=0x0000
+0x0583=0x2E45
+0x0582=0x150F
+0x0567=0x4049
+0x0566=0x0906
+0x0565=0xB77F
+0x0563=0x4F91
+0x055F=0x5852
+0x055D=0xA6B5
+0x055A=0xBE2A
+0x058F=0x0605
+0x0557=0x4C24
+0x0593=0x00D8
+0x0554=0x6901
+0x0552=0x8D44
+0x0551=0xD7B7
+0x0550=0x79FA
+0x054C=0x7FFF
+0x0549=0x18C9
+0x0547=0xD7B7
+0x0546=0x8D44
+0x0545=0x364E
+0x0544=0x6901
+0x0543=0xBD96
+0x0553=0x364E
+0x0542=0xA2B5
+0x0541=0x4C24
+0x0527=0xACB9
+0x0526=0xBE2A
+0x0525=0x57AC
+0x0523=0xA6B5
+0x0521=0x5852
+0x055C=0x3347
+0x051A=0x0906
+0x0518=0xEFF2
+0x0514=0xE7E2
+0x0513=0xDAA2
+0x0511=0x1D10
+0x05A6=0x0000
+0x051E=0xF524
+0x050F=0xEA5F
+0x0516=0x150F
+0x050E=0x17DC
+0x050C=0xEA50
+0x050B=0xF5EF
+0x050A=0x1316
+0x0509=0x0605
+0x0507=0xFCFE
+0x0506=0x0DF1
+0x0503=0x00BC
+0x04E7=0x0000
+0x04E6=0x0000
+0x04E4=0x0000
+0x04E0=0x0000
+0x058B=0x0F45
+0x04DE=0x0000
+0x04DC=0x0000
+0x04DB=0x0000
+0x04D9=0x0000
+0x04D8=0x0000
+0x059E=0x0000
+0x04D7=0x0000
+0x0504=0xF40D
+0x04D4=0x0000
+0x04D3=0x0000
+0x0548=0x79FA
+0x04D2=0x0000
+0x04D1=0x0000
+0x04D0=0x0000
+0x04CE=0x0000
+0x04C8=0x0000
+0x04E2=0x0000
+0x04C5=0x0000
+0x04C4=0x0000
+0x04C2=0x0000
+0x04A7=0x0000
+0x04A6=0x0000
+0x04A5=0x0000
+0x04A1=0x0000
+0x04A0=0x0000
+0x0522=0xDB10
+0x049F=0x0000
+0x049E=0x0000
+0x04C7=0x0000
+0x049D=0x0000
+0x049B=0x0000
+0x049A=0x0000
+0x04C3=0x0000
+0x0496=0x0000
+0x0494=0x0000
+0x02D3=0x0000
+0x02D1=0x0000
+0x02CB=0x0000
+0x0250=0x0000
+0x0096=0x0000
+0x04C1=0x0000
+0x02C3=0x0000
+0x02C4=0x0000
+0x02C2=0x0000
+0x0499=0x0000
+0x02C0=0x0000
+0x0201=0x07FF
+0x0483=0x0000
+0x05A4=0x0000
+0x02A3=0x0000
+0x008B=0x278A
+0x02A1=0x0000
+0x028D=0x0000
+0x029C=0x0000
+0x029E=0x0000
+0x0297=0x0000
+0x0296=0x0000
+0x0555=0xBD96
+0x0349=0x0000
+0x010D=0x015C
+0x02CF=0x0000
+0x0291=0x0000
+0x02DF=0x0000
+0x0290=0x0000
+0x0021=0x0E9F
+0x0450=0x0000
+0x0558=0x5009
+0x02C6=0x0000
+0x0101=0x7800
+0x059C=0x0000
+0x04DD=0x0000
+0x028A=0x0000
+0x0121=0x313C
+0x0285=0x0000
+0x0280=0x0000
+0x0319=0x0000
+0x04CF=0x0000
+0x025F=0x0000
+0x025D=0x0000
+0x030F=0x0000
+0x0406=0x0000
+0x02C5=0x0000
+0x0200=0x0301
+0x0281=0x0000
+0x04A2=0x0000
+0x0109=0x03C1
+0x0355=0x0000
+0x044C=0x0000
+0x025B=0x0000
+0x0298=0x0000
+0x0502=0x0A94
+0x0258=0x0000
+0x0255=0x0000
+0x04D6=0x0000
+0x0257=0x0000
+0x0252=0x0000
+0x0204=0xFFAD
+0x024F=0x0000
+0x04CC=0x0000
+0x02A5=0x0000
+0x0497=0x0000
+0x0123=0x267B
+0x0495=0x0000
+0x0246=0x0000
+0x051D=0x4F91
+0x0243=0x0000
+0x0556=0xA2B5
+0x040A=0x1000
+0x025A=0x0000
+0x0242=0x0000
+0x020C=0x8000
+0x0251=0x0000
+0x02DD=0x0000
+0x0020=0xFFFD
+0x0488=0x0000
+0x020A=0x0000
+0x0102=0x3180
+0x04C6=0x0000
+0x0207=0x0000
+0x04DA=0x0000
+0x025E=0x0000
+0x0206=0x0000
+0x00A3=0x6565
+0x02E2=0x0000
+0x044D=0x0000
+0x0292=0x0000
+0x002A=0x0086
+0x0245=0x0000
+0x0581=0xC89D
+0x045D=0x0000
+0x024D=0x0000
+0x002B=0x4032
+0x02A0=0x0000
+0x010E=0x070C
+0x0286=0x0000
+0x009E=0x658C
+0x0088=0x0530
+0x0085=0x0001
+0x0295=0x0000
+0x0089=0x00A0
+0x0256=0x0000
+0x0093=0x0000
+0x0092=0x0001
+0x031B=0x0000
+0x0111=0x0099
+0x0095=0x0000
+0x02A7=0x0000
+0x0203=0x2F6C
+0x030E=0x0000
+0x0482=0x0000
+0x05A0=0x0000
+0x009C=0x658C
+0x0381=0x0000
+0x0122=0x033F
+0x0110=0x0BFF
+0x0100=0xB409
+0x0028=0x0101
+0x0026=0x0101
+0x0524=0x3347
+0x009D=0x6565
+0x0294=0x0000
+0x0106=0x3182
+0x028E=0x0000
+0x0326=0x0000
+0x0113=0x03C3
+0x04CB=0x0000
+0x0391=0x0000
+0x05A1=0x0000
+0x02C9=0x0000
+0x0500=0xF61D
+0x039D=0x0000
+0x011F=0x3680
+0x0395=0x0000
+0x024B=0x0000
+0x045C=0x0000
+0x0247=0x0000
+0x0512=0x196B
+0x04E5=0x0000
+0x0024=0x50D8
+0x0353=0x0000
+0x050D=0x0F45
+0x02CD=0x0000
+0x0490=0x0000
+0x0501=0xFDFB
+0x034C=0x0000
+0x00AA=0x0000
+0x0350=0x0000
+0x0445=0x0000
+0x048F=0x0000
+0x008A=0x0491
+0x0453=0x0000
+0x0124=0x0000
+0x0260=0x0000
+0x00A1=0x6565
+0x0356=0x0000
+0x0241=0x0000
+0x04CD=0x0000
+0x0249=0x0000
+0x002C=0x0100
+0x038F=0x0000
+0x008C=0x267B
+0x0459=0x0000
+0x0394=0x0000
+0x054D=0xF7A3
+0x00A6=0x0001
+0x002D=0xFFFF
+0x00AC=0x2000
+0x0253=0x0000
+0x028B=0x0000
+0x040C=0x40F8
+0x0099=0x6565
+0x0310=0x0000
+0x00A2=0x6565
+0x0589=0xEA5F
+0x002F=0x3840
+0x0597=0xFDFB
+0x035F=0x0000
+0x0562=0xF524
+0x0025=0x0101
+0x011C=0xAD41
+0x011D=0xFEEE
+0x039E=0x0000
+0x0289=0x0000
+0x0282=0x0000
+0x0307=0x0000
+0x038C=0x0000
+0x0087=0x0000
+0x0399=0x0000
+0x054B=0xF7A3
+0x02C7=0x0000
+0x0519=0x4049
+0x009F=0x658C
+0x0515=0x2E45
+0x025C=0x0000
+0x00A5=0x6565
+0x0301=0x0000
+0x02C1=0x0000
+0x0259=0x0000
+0x02D5=0x0000
+0x02E1=0x0000
+0x0517=0xC89D
+0x0481=0x0000
+0x00A8=0x0000
+0x02D2=0x0000
+0x039C=0x0000
+0x0564=0x0000
+0x00AB=0x0040
+0x0261=0x0000
+0x002E=0x0000
+0x02DE=0x0000
+0x0540=0x5009
+0x02A4=0x0000
+0x0485=0x0000
+0x0489=0x0000
+0x00AD=0x03FF
+0x024A=0x0000
+0x0029=0x0101
+0x0097=0x0000
+0x011E=0x0663
+0x00AE=0x0000
+0x00A7=0x6565
+0x020B=0x0000
+0x0098=0x0000
+0x0108=0xFC26
+0x0027=0x05E4
+0x0117=0x1939
+0x0383=0x0000
+0x0202=0x07F9
+0x054A=0x8184
+0x00A4=0x6565
+0x0401=0x07ED
+0x0086=0x4101
+0x010C=0x8865
+0x02D8=0x0000
+0x0347=0x0000
+0x0457=0x0000
+0x0103=0x0A12
+0x0104=0x0088
+0x0357=0x0000
+0x02DB=0x0000
+0x0400=0x0101
+0x009B=0x6565
+0x0105=0x0007
+0x05A3=0x0000
+0x0240=0x0028
+0x0367=0x0000
+0x044F=0x0000
+0x038B=0x0000
+0x0284=0x0000
+0x0396=0x0000
+0x051F=0xAB08
+0x029A=0x0000
+0x0361=0x0000
+0x0205=0x0000
+0x0119=0x529F
+0x02A6=0x0000
+0x010F=0x3042
+0x04C0=0x0000
+0x031E=0x0000
+0x02CC=0x0000
+0x0116=0x8180
+0x0587=0x1D10
+0x0023=0x5550
+0x048C=0x0000
+0x0112=0x20E5
+0x039A=0x0000
+0x0320=0x0000
+0x0323=0x0000
+0x0115=0x0009
+0x00A9=0x8000
+0x0244=0x0000
+0x0094=0x0000
+0x0317=0x0000
+0x0208=0x0170
+0x0340=0x0000
+0x058D=0xF5EF
+0x02D7=0x0000
+0x04A3=0x0000
+0x029D=0x0000
+0x0388=0x0000
+0x0120=0xB9FF
+0x04C9=0x0000
+0x02CA=0x0000
+0x0209=0x0000
+0x0082=0x8001
+0x0107=0x318C
+0x02D4=0x0000
+0x02CE=0x0000
+0x02D9=0x0000
+0x02E4=0x0000
+0x024C=0x0000
+0x02DC=0x0000
+0x0118=0x218C
+0x02E0=0x0000
+0x055B=0x57AC
+0x0114=0x0170
+0x02E5=0x0000
+0x02E6=0x0000
+0x045B=0x0000
+0x034F=0x0000
+0x0300=0x0000
+0x044E=0x0000
+0x0510=0xE6C7
+0x0302=0x0000
+0x0303=0x0000
+0x04D5=0x0000
+0x0304=0x0000
+0x0306=0x0000
+0x04A4=0x0000
+0x044A=0x0000
+0x049C=0x0000
+0x02E3=0x0000
+0x0397=0x0000
+0x0588=0xE6C7
+0x0308=0x0000
+0x048A=0x0000
+0x0309=0x0000
+0x029F=0x0000
+0x030A=0x0000
+0x0392=0x0000
+0x030B=0x0000
+0x04DF=0x0000
+0x030C=0x0000
+0x02D6=0x0000
+0x0311=0x0000
+0x024E=0x0000
+0x0346=0x0000
+0x0312=0x0000
+0x051B=0xB77F
+0x010A=0x184C
+0x0461=0x0000
+0x0313=0x0000
+0x0360=0x0000
+0x028C=0x0000
+0x0352=0x0000
+0x040E=0x0000
+0x030D=0x0000
+0x0316=0x0000
+0x031F=0x0000
+0x0318=0x0000
+0x0287=0x0000
+0x0341=0x0000
+0x028F=0x0000
+0x031C=0x0000
+0x031A=0x0000
+0x0363=0x0000
+0x031D=0x0000
+0x0440=0x0024
+0x045E=0x0000
+0x0321=0x0000
+0x059B=0x0000
+0x0322=0x0000
+0x0327=0x0000
+0x0380=0x0000
+0x0342=0x0000
+0x0343=0x0000
+0x0561=0xAB08
+0x0344=0x0000
+0x0586=0x196B
+0x0484=0x0000
+0x0345=0x0000
+0x0505=0x00D8
+0x035B=0x0000
+0x0498=0x0000
+0x0084=0x0400
+0x0348=0x0000
+0x034A=0x0000
+0x0455=0x0000
+0x011A=0x2E03
+0x034B=0x0000
+0x034D=0x0000
+0x035C=0x0000
+0x034E=0x0000
+0x0293=0x0000
+0x03A6=0x0000
+0x0351=0x0000
+0x0354=0x0000
+0x048B=0x0000
+0x0358=0x0000
+0x0359=0x0000
+0x0299=0x0000
+0x0452=0x0000
+0x02C8=0x0000
+0x035A=0x0000
+0x0449=0x0000
+0x0442=0x0000
+0x035D=0x0000
+0x035E=0x0000
+0x038A=0x0000
+0x0362=0x0000
+0x0081=0x0000
+0x0325=0x0000
+0x0364=0x0000
+0x0365=0x0000
+0x0366=0x0000
+0x0288=0x0000
+0x0382=0x0000
+0x0384=0x0000
+0x0315=0x0000
+0x0385=0x0000
+0x054F=0x18C9
+0x0389=0x0000
+0x04E3=0x0000
+0x040F=0x0000
+0x0386=0x0000
+0x054E=0x8184
+0x009A=0x658C
+0x02D0=0x0000
+0x03A0=0x0000
+0x0387=0x0000
+0x038D=0x0000
+0x02E7=0x0000
+0x0324=0x0000
+0x038E=0x0000
+0x0305=0x0000
+0x0393=0x0000
+0x0398=0x0000
+0x0408=0x0000
+0x039B=0x0000
+0x0248=0x0000
+0x039F=0x0000
+0x04E1=0x0000
+0x02A2=0x0000
+0x03A1=0x0000
+0x059A=0x0000
+0x048D=0x0000
+0x051C=0x0000
+0x03A2=0x0000
+0x03A3=0x0000
+0x03A4=0x0000
+0x03A5=0x0000
+0x0520=0x174B
+0x03A7=0x0000
+0x055E=0xDB10
+0x0402=0x07FF
+0x0403=0x009C
+0x0560=0x174B
+0x00A0=0x6565
+0x0404=0x0000
+0x0254=0x0000
+0x0405=0x0000
+0x0407=0x0000
+0x0580=0xEFF2
+0x0409=0x0000
+0x040B=0x000F
+0x040D=0x0000
+0x0441=0x0000
+0x0508=0xEF99
+0x0443=0x0000
+0x0444=0x0000
+0x04CA=0x0000
+0x0446=0x0000
+0x0454=0x0000
+0x0448=0x0000
+0x044B=0x0000
+0x0390=0x0000
+0x0451=0x0000
+0x0559=0xACB9
+0x0456=0x0000
+0x0314=0x0000
+0x0458=0x0000
+0x02DA=0x0000
+0x045A=0x0000
+0x0447=0x0000
+0x0460=0x0000
+0x0480=0x0000
+0x045F=0x0000
+0x0486=0x0000
+0x0487=0x0000
+0x0283=0x0000
+0x0022=0x07FF
+0x048E=0x0000
+0x029B=0x0000
+0x0491=0x0000
+0x0492=0x0000
+0x0493=0x0000
+[file_info]
+version=1
+type=lms7002m_minimal_config
diff --git a/targets/ARCH/LMSSDR/enb_sodera_lowband_Wrx_10MHz_rx19dB_txfull.ini b/targets/ARCH/LMSSDR/enb_sodera_lowband_Wrx_10MHz_rx19dB_txfull.ini
new file mode 100644
index 0000000000000000000000000000000000000000..a0793ad395949aa35627581aa24d9a004f56792d
--- /dev/null
+++ b/targets/ARCH/LMSSDR/enb_sodera_lowband_Wrx_10MHz_rx19dB_txfull.ini
@@ -0,0 +1,1128 @@
+[reference_clocks]
+sxr_ref_clk_mhz=30.72
+sxt_ref_clk_mhz=30.72
+[lms7002_registers_b]
+0x03A0=0x0000
+0x054E=0x0000
+0x02D0=0x0000
+0x0386=0x0000
+0x054F=0x0000
+0x0389=0x0000
+0x040F=0x0000
+0x04E3=0x0000
+0x0385=0x0000
+0x0315=0x0000
+0x0384=0x0000
+0x0382=0x0000
+0x0288=0x0000
+0x0381=0x0000
+0x0366=0x0000
+0x0365=0x0000
+0x0364=0x0000
+0x0325=0x0000
+0x035E=0x0000
+0x035D=0x0000
+0x0442=0x0000
+0x0452=0x0000
+0x0299=0x0000
+0x0359=0x0000
+0x029D=0x0000
+0x04A3=0x0000
+0x040E=0x0000
+0x0316=0x0000
+0x030D=0x0000
+0x0356=0x0000
+0x0348=0x0000
+0x0498=0x0000
+0x0490=0x0000
+0x02CD=0x0000
+0x050D=0x0000
+0x0353=0x0000
+0x0351=0x0000
+0x048F=0x0000
+0x0445=0x0000
+0x0350=0x0000
+0x03A6=0x0000
+0x0293=0x0000
+0x034E=0x0000
+0x035C=0x0000
+0x034D=0x0000
+0x034B=0x0000
+0x011A=0x2E02
+0x0455=0x0000
+0x034A=0x0000
+0x035B=0x0000
+0x0505=0x0000
+0x0345=0x0000
+0x035F=0x0000
+0x0597=0x0000
+0x0586=0x0000
+0x0484=0x0000
+0x02C8=0x0000
+0x035A=0x0000
+0x0561=0x0000
+0x0344=0x0000
+0x0343=0x0000
+0x0342=0x0000
+0x0380=0x0000
+0x0327=0x0000
+0x025E=0x0000
+0x04DA=0x0000
+0x04C2=0x0000
+0x028C=0x0000
+0x0352=0x0000
+0x059C=0x0000
+0x04DD=0x0000
+0x028A=0x0000
+0x0289=0x0000
+0x031A=0x0000
+0x0363=0x0000
+0x0396=0x0000
+0x0284=0x0000
+0x010C=0x88FD
+0x044C=0x0000
+0x0355=0x0000
+0x025C=0x0000
+0x0515=0x0000
+0x0361=0x0000
+0x0205=0x0000
+0x025B=0x0000
+0x04C5=0x0000
+0x04E2=0x0000
+0x025A=0x0000
+0x0256=0x0000
+0x0240=0x0020
+0x0367=0x0000
+0x05A3=0x0000
+0x0502=0x0000
+0x0258=0x0000
+0x0255=0x0000
+0x040C=0x0000
+0x028B=0x0000
+0x0253=0x0000
+0x024E=0x0000
+0x0346=0x0000
+0x0280=0x0000
+0x0285=0x0000
+0x024A=0x0000
+0x0261=0x0000
+0x0249=0x0000
+0x04CD=0x0000
+0x040A=0x0000
+0x0556=0x0000
+0x0243=0x0000
+0x051D=0x0000
+0x0494=0x0000
+0x024C=0x0000
+0x02DC=0x0000
+0x038F=0x0000
+0x0241=0x0000
+0x0488=0x0000
+0x0251=0x0000
+0x020B=0x4000
+0x0108=0x9442
+0x04A0=0x0000
+0x0116=0x8180
+0x02CC=0x0000
+0x039A=0x0000
+0x0112=0xC0E6
+0x0307=0x0000
+0x038C=0x0000
+0x0282=0x0000
+0x0321=0x0000
+0x0507=0x0000
+0x0483=0x0000
+0x0201=0x07FF
+0x02E1=0x0000
+0x0517=0x0000
+0x0481=0x0000
+0x02D5=0x0000
+0x0259=0x0000
+0x0527=0x0000
+0x02DD=0x0000
+0x0209=0x0000
+0x0297=0x0000
+0x0400=0x0081
+0x0104=0x0088
+0x0103=0x0A12
+0x0347=0x0000
+0x02D8=0x0000
+0x0457=0x0000
+0x0306=0x0000
+0x02D1=0x0000
+0x04C8=0x0000
+0x0546=0x0000
+0x0440=0x0020
+0x045E=0x0000
+0x031D=0x0000
+0x039C=0x0000
+0x02D2=0x0000
+0x010E=0x2040
+0x02A0=0x0000
+0x0544=0x0000
+0x029C=0x0000
+0x055A=0x0000
+0x0295=0x0000
+0x02CF=0x0000
+0x04D1=0x0000
+0x0291=0x0000
+0x02DF=0x0000
+0x0290=0x0000
+0x020A=0x0080
+0x0102=0x3180
+0x0120=0xB9FF
+0x0388=0x0000
+0x0318=0x0000
+0x02A7=0x0000
+0x0200=0x0081
+0x0594=0x0000
+0x02C5=0x0000
+0x028D=0x0000
+0x02A1=0x0000
+0x0362=0x0000
+0x038A=0x0000
+0x0395=0x0000
+0x058D=0x0000
+0x02D7=0x0000
+0x0305=0x0000
+0x0393=0x0000
+0x0398=0x0000
+0x0408=0x0000
+0x039B=0x0000
+0x049E=0x0000
+0x02DB=0x0000
+0x0357=0x0000
+0x02C2=0x0000
+0x0514=0x0000
+0x051C=0x0000
+0x03A2=0x0000
+0x03A4=0x0000
+0x03A3=0x0000
+0x0493=0x0000
+0x0454=0x0000
+0x0448=0x0000
+0x0397=0x0000
+0x02E3=0x0000
+0x049C=0x0000
+0x040D=0x0000
+0x0281=0x0000
+0x048C=0x0000
+0x049A=0x0000
+0x0119=0x18CB
+0x010F=0x3042
+0x02A6=0x0000
+0x0257=0x0000
+0x04D6=0x0000
+0x04A6=0x0000
+0x0324=0x0000
+0x038E=0x0000
+0x02E7=0x0000
+0x034F=0x0000
+0x04E0=0x0000
+0x0123=0x267B
+0x0497=0x0000
+0x0459=0x0000
+0x0394=0x0000
+0x04A5=0x0000
+0x04D9=0x0000
+0x0304=0x0000
+0x04D5=0x0000
+0x0508=0x0000
+0x0443=0x0000
+0x0301=0x0000
+0x0548=0x0000
+0x04D2=0x0000
+0x0592=0x0000
+0x0591=0x0000
+0x04C7=0x0000
+0x049D=0x0000
+0x029A=0x0000
+0x051F=0x0000
+0x0309=0x0000
+0x0585=0x0000
+0x03A5=0x0000
+0x02D3=0x0000
+0x0451=0x0000
+0x0390=0x0000
+0x0562=0x0000
+0x02C4=0x0000
+0x029E=0x0000
+0x031E=0x0000
+0x04C0=0x0000
+0x04DC=0x0000
+0x04DE=0x0000
+0x058B=0x0000
+0x04DB=0x0000
+0x04D0=0x0000
+0x0492=0x0000
+0x04A1=0x0000
+0x054B=0x0000
+0x02C7=0x0000
+0x05A0=0x0000
+0x044B=0x0000
+0x0100=0x3409
+0x04CA=0x0000
+0x0446=0x0000
+0x02E4=0x0000
+0x04E4=0x0000
+0x04C3=0x0000
+0x0496=0x0000
+0x04CF=0x0000
+0x025F=0x0000
+0x04D4=0x0000
+0x0504=0x0000
+0x04CE=0x0000
+0x02DE=0x0000
+0x0399=0x0000
+0x050C=0x0000
+0x02A5=0x0000
+0x04CC=0x0000
+0x03A1=0x0000
+0x04E1=0x0000
+0x02A2=0x0000
+0x040B=0x7FFF
+0x0283=0x0000
+0x048E=0x0000
+0x0580=0x0000
+0x0409=0x0000
+0x039F=0x0000
+0x0248=0x0000
+0x048B=0x0000
+0x0358=0x0000
+0x0589=0x0000
+0x038D=0x0000
+0x0487=0x0000
+0x0510=0x0000
+0x0302=0x0000
+0x0486=0x0000
+0x045F=0x0000
+0x0480=0x0000
+0x0567=0x0000
+0x02DA=0x0000
+0x045A=0x0000
+0x0254=0x0000
+0x0405=0x0000
+0x0387=0x0000
+0x0458=0x0000
+0x0314=0x0000
+0x0360=0x0000
+0x0559=0x0000
+0x0456=0x0000
+0x0453=0x0000
+0x02E2=0x0000
+0x044D=0x0000
+0x0441=0x0000
+0x02C3=0x0000
+0x04C1=0x0000
+0x04D3=0x0000
+0x0444=0x0000
+0x0207=0x0000
+0x04C6=0x0000
+0x0296=0x0000
+0x0555=0x0000
+0x0349=0x0000
+0x0109=0x61C1
+0x04A2=0x0000
+0x0447=0x0000
+0x0460=0x0000
+0x048D=0x0000
+0x059A=0x0000
+0x0407=0x0000
+0x02C0=0x0000
+0x0499=0x0000
+0x0543=0x0000
+0x04C9=0x0000
+0x02CA=0x0000
+0x0404=0x0000
+0x0560=0x0000
+0x02C1=0x0000
+0x04D8=0x0000
+0x0403=0x0000
+0x0491=0x0000
+0x029B=0x0000
+0x04C4=0x0000
+0x010D=0x009E
+0x0402=0x07FF
+0x055E=0x0000
+0x03A7=0x0000
+0x0520=0x0000
+0x0392=0x0000
+0x030B=0x0000
+0x0588=0x0000
+0x0308=0x0000
+0x048A=0x0000
+0x044A=0x0000
+0x04A4=0x0000
+0x0300=0x0000
+0x0587=0x0000
+0x044E=0x0000
+0x055B=0x0000
+0x02E5=0x0000
+0x0114=0x008D
+0x0323=0x0000
+0x0320=0x0000
+0x0503=0x0000
+0x0513=0x0000
+0x0319=0x0000
+0x0260=0x0000
+0x0549=0x0000
+0x0552=0x0000
+0x0509=0x0000
+0x0521=0x0000
+0x0286=0x0000
+0x04D7=0x0000
+0x059E=0x0000
+0x058F=0x0000
+0x0557=0x0000
+0x0322=0x0000
+0x059B=0x0000
+0x049F=0x0000
+0x0522=0x0000
+0x0545=0x0000
+0x0551=0x0000
+0x0312=0x0000
+0x055D=0x0000
+0x0298=0x0000
+0x055F=0x0000
+0x011D=0x9555
+0x039E=0x0000
+0x0547=0x0000
+0x0598=0x0000
+0x0449=0x0000
+0x0564=0x0000
+0x0242=0x0000
+0x0525=0x0000
+0x0523=0x0000
+0x0565=0x0000
+0x0124=0x0000
+0x0563=0x0000
+0x024D=0x0000
+0x05A5=0x0000
+0x0566=0x0000
+0x030A=0x0000
+0x029F=0x0000
+0x054C=0x0000
+0x0582=0x0000
+0x0599=0x0000
+0x0511=0x0000
+0x0506=0x0000
+0x0595=0x0000
+0x0584=0x0000
+0x058C=0x0000
+0x05A6=0x0000
+0x051E=0x0000
+0x050F=0x0000
+0x0590=0x0000
+0x0596=0x0000
+0x05A7=0x0000
+0x058A=0x0000
+0x059D=0x0000
+0x0485=0x0000
+0x0581=0x0000
+0x045D=0x0000
+0x0245=0x0000
+0x0310=0x0000
+0x058E=0x0000
+0x05A2=0x0000
+0x054D=0x0000
+0x020C=0x7FFF
+0x031F=0x0000
+0x0292=0x0000
+0x059F=0x0000
+0x0583=0x0000
+0x0317=0x0000
+0x0244=0x0000
+0x0554=0x0000
+0x0593=0x0000
+0x05A4=0x0000
+0x02A3=0x0000
+0x0553=0x0000
+0x0542=0x0000
+0x0519=0x0000
+0x024F=0x0000
+0x0524=0x0000
+0x0518=0x0000
+0x0354=0x0000
+0x0526=0x0000
+0x031B=0x0000
+0x050E=0x0000
+0x0516=0x0000
+0x02CB=0x0000
+0x0250=0x0000
+0x031C=0x0000
+0x028F=0x0000
+0x051A=0x0000
+0x055C=0x0000
+0x050A=0x0000
+0x050B=0x0000
+0x04E7=0x0000
+0x04E6=0x0000
+0x04E5=0x0000
+0x0512=0x0000
+0x0206=0x0000
+0x0550=0x0000
+0x030E=0x0000
+0x0203=0x0000
+0x0482=0x0000
+0x0541=0x0000
+0x0122=0x033F
+0x0110=0x0BF4
+0x0204=0x0000
+0x0252=0x0000
+0x011E=0x05DC
+0x049B=0x0000
+0x0294=0x0000
+0x011C=0xAD41
+0x02D6=0x0000
+0x0311=0x0000
+0x0117=0x280C
+0x02A4=0x0000
+0x0540=0x0000
+0x02E0=0x0000
+0x0118=0x018C
+0x0489=0x0000
+0x04A7=0x0000
+0x0101=0x7800
+0x0558=0x0000
+0x02C6=0x0000
+0x05A1=0x0000
+0x02C9=0x0000
+0x039D=0x0000
+0x0500=0x0000
+0x0450=0x0000
+0x011F=0x3680
+0x030C=0x0000
+0x04DF=0x0000
+0x0106=0x3182
+0x028E=0x0000
+0x0326=0x0000
+0x0113=0x03C3
+0x04CB=0x0000
+0x0391=0x0000
+0x0105=0x0007
+0x02D9=0x0000
+0x02CE=0x0000
+0x044F=0x0000
+0x038B=0x0000
+0x02D4=0x0000
+0x0107=0x318C
+0x0495=0x0000
+0x0246=0x0000
+0x0303=0x0000
+0x02E6=0x0000
+0x045B=0x0000
+0x0340=0x0000
+0x0208=0x0070
+0x0111=0x0083
+0x0247=0x0000
+0x024B=0x0000
+0x045C=0x0000
+0x0383=0x0000
+0x0202=0x07FF
+0x054A=0x0000
+0x0401=0x07FF
+0x0341=0x0000
+0x0287=0x0000
+0x034C=0x0000
+0x0501=0x0000
+0x030F=0x0000
+0x025D=0x0000
+0x0406=0x0000
+0x0313=0x0000
+0x010A=0x104C
+0x0461=0x0000
+0x051B=0x0000
+0x0121=0x356A
+0x0115=0x0009
+[lms7002_registers_a]
+0x0107=0x318C
+0x02D4=0x0000
+0x0082=0x8001
+0x0209=0x0000
+0x02CA=0x0000
+0x04C9=0x0000
+0x0120=0xB9FF
+0x0388=0x0000
+0x029D=0x0000
+0x04A3=0x0000
+0x0208=0x0170
+0x0340=0x0000
+0x0094=0x0000
+0x0244=0x0000
+0x0317=0x0000
+0x00A9=0x8000
+0x0115=0x0009
+0x039A=0x0000
+0x0112=0x3171
+0x048C=0x0000
+0x0023=0x5550
+0x0587=0x1D10
+0x04C0=0x0000
+0x031E=0x0000
+0x0205=0x0000
+0x0361=0x0000
+0x051F=0xAB08
+0x029A=0x0000
+0x0396=0x0000
+0x0284=0x0000
+0x02CE=0x0000
+0x02D9=0x0000
+0x038B=0x0000
+0x044F=0x0000
+0x0367=0x0000
+0x0240=0x0028
+0x05A3=0x0000
+0x0105=0x0007
+0x009B=0x6565
+0x0400=0x0101
+0x02DB=0x0000
+0x0357=0x0000
+0x0104=0x0088
+0x0103=0x0A12
+0x0457=0x0000
+0x0347=0x0000
+0x02D8=0x0000
+0x010C=0x8865
+0x0086=0x4101
+0x0202=0x0794
+0x0383=0x0000
+0x020B=0x4000
+0x0108=0xFC26
+0x0098=0x0000
+0x0117=0x100C
+0x0027=0x05E4
+0x00A7=0x6565
+0x024A=0x0000
+0x0029=0x0101
+0x00AD=0x03FF
+0x0540=0x5009
+0x02A4=0x0000
+0x02DE=0x0000
+0x002E=0x0000
+0x0261=0x0000
+0x00AB=0x0040
+0x0564=0x0000
+0x00A8=0x0000
+0x0517=0xC89D
+0x0481=0x0000
+0x02C1=0x0000
+0x0301=0x0000
+0x00A5=0x6565
+0x0515=0x2E45
+0x025C=0x0000
+0x009F=0x658C
+0x0519=0x4049
+0x054B=0xF7A3
+0x02C7=0x0000
+0x038C=0x0000
+0x0307=0x0000
+0x0282=0x0000
+0x0289=0x0000
+0x011C=0xAD41
+0x0562=0xF524
+0x0025=0x0101
+0x02CC=0x0000
+0x0116=0x8180
+0x0597=0xFDFB
+0x035F=0x0000
+0x002F=0x3840
+0x0589=0xEA5F
+0x00A2=0x6565
+0x0099=0x6565
+0x0310=0x0000
+0x040C=0x40F8
+0x028B=0x0000
+0x0253=0x0000
+0x00AC=0x2000
+0x002D=0xFFFF
+0x00A6=0x0001
+0x054D=0xF7A3
+0x002C=0x0000
+0x0249=0x0000
+0x04CD=0x0000
+0x0401=0x07FF
+0x00A4=0x6565
+0x054A=0x8184
+0x038F=0x0000
+0x008C=0x267B
+0x0241=0x0000
+0x0356=0x0000
+0x00A1=0x6565
+0x0260=0x0000
+0x0453=0x0000
+0x008A=0x0491
+0x048F=0x0000
+0x0445=0x0000
+0x0350=0x0000
+0x00AA=0x0000
+0x034C=0x0000
+0x0501=0xFDFB
+0x0490=0x0000
+0x02CD=0x0000
+0x050D=0x0F45
+0x0353=0x0000
+0x0024=0x50D8
+0x04E5=0x0000
+0x0512=0x196B
+0x0247=0x0000
+0x045C=0x0000
+0x024B=0x0000
+0x0395=0x0000
+0x011F=0x3680
+0x039D=0x0000
+0x0500=0xF61D
+0x02C9=0x0000
+0x05A1=0x0000
+0x02A6=0x0000
+0x0119=0x18DF
+0x010F=0x3042
+0x04CB=0x0000
+0x0391=0x0000
+0x0113=0x03C3
+0x0326=0x0000
+0x028E=0x0000
+0x0106=0x3182
+0x0524=0x3347
+0x009D=0x6565
+0x0294=0x0000
+0x0026=0x0101
+0x0110=0x0BFF
+0x0122=0x033F
+0x0381=0x0000
+0x009C=0x658C
+0x05A0=0x0000
+0x0482=0x0000
+0x030E=0x0000
+0x0203=0x2F99
+0x0095=0x0000
+0x0111=0x0099
+0x0256=0x0000
+0x0089=0x0048
+0x0085=0x0001
+0x0088=0x04F0
+0x0459=0x0000
+0x0394=0x0000
+0x010E=0x0285
+0x02A0=0x0000
+0x002B=0x4032
+0x039C=0x0000
+0x02D2=0x0000
+0x0581=0xC89D
+0x045D=0x0000
+0x0245=0x0000
+0x002A=0x0086
+0x0118=0x018C
+0x02E0=0x0000
+0x0489=0x0000
+0x04A7=0x0000
+0x039E=0x0000
+0x011D=0x2AAA
+0x02E1=0x0000
+0x0259=0x0000
+0x02D5=0x0000
+0x051D=0x4F91
+0x0243=0x0000
+0x0556=0xA2B5
+0x040A=0x1000
+0x05A2=0x0000
+0x020C=0x8000
+0x020A=0x0080
+0x0102=0x3180
+0x034F=0x0000
+0x0303=0x0000
+0x0306=0x0000
+0x0255=0x0000
+0x0300=0x0000
+0x044E=0x0000
+0x0309=0x0000
+0x0585=0xDAA2
+0x0527=0xACB9
+0x044A=0x0000
+0x04A4=0x0000
+0x048A=0x0000
+0x0392=0x0000
+0x030B=0x0000
+0x05A7=0x0000
+0x0252=0x0000
+0x0204=0xC016
+0x0308=0x0000
+0x0588=0xE6C7
+0x0321=0x0000
+0x0507=0xFCFE
+0x0312=0x0000
+0x050B=0xF5EF
+0x0360=0x0000
+0x0021=0x0E9F
+0x04C2=0x0000
+0x030D=0x0000
+0x040E=0x0003
+0x0316=0x0000
+0x031F=0x0000
+0x030C=0x0000
+0x04DF=0x0000
+0x0318=0x0000
+0x0250=0x0000
+0x02CB=0x0000
+0x045E=0x0000
+0x0440=0x0024
+0x031D=0x0000
+0x058D=0xF5EF
+0x02D7=0x0000
+0x0380=0x0000
+0x0342=0x0000
+0x0343=0x0000
+0x0566=0x0906
+0x0345=0x0000
+0x049C=0x0000
+0x02E3=0x0000
+0x0397=0x0000
+0x035B=0x0000
+0x0505=0x00D8
+0x028D=0x0000
+0x02A1=0x0000
+0x028F=0x0000
+0x031C=0x0000
+0x031A=0x0000
+0x0363=0x0000
+0x0596=0x0A94
+0x0354=0x0000
+0x0518=0xEFF2
+0x035C=0x0000
+0x034D=0x0000
+0x0344=0x0000
+0x0561=0xAB08
+0x0096=0x0000
+0x010D=0x01DC
+0x04C4=0x0000
+0x0351=0x0000
+0x0311=0x0000
+0x02D6=0x0000
+0x02D1=0x0000
+0x0546=0x8D44
+0x04C8=0x0000
+0x048B=0x0000
+0x0358=0x0000
+0x0522=0xDB10
+0x049F=0x0000
+0x034A=0x0000
+0x0455=0x0000
+0x0359=0x0000
+0x03A4=0x0000
+0x03A3=0x0000
+0x0341=0x0000
+0x0287=0x0000
+0x04DA=0x0000
+0x025E=0x0000
+0x0580=0xEFF2
+0x0409=0x0000
+0x059A=0x0000
+0x048D=0x0000
+0x0514=0xE7E2
+0x039B=0x0000
+0x0101=0x7800
+0x0558=0x5009
+0x02C6=0x0000
+0x051B=0xB77F
+0x0313=0x0000
+0x010A=0x104C
+0x0461=0x0000
+0x0406=0x0000
+0x030F=0x0000
+0x025D=0x0000
+0x034B=0x0000
+0x011A=0x2E14
+0x029F=0x0000
+0x030A=0x0000
+0x034E=0x0000
+0x0293=0x0000
+0x03A6=0x0000
+0x0560=0x174B
+0x0404=0x0000
+0x00A0=0x6565
+0x0547=0xD7B7
+0x0454=0x0000
+0x0448=0x0000
+0x0327=0x0000
+0x0305=0x0000
+0x0393=0x0000
+0x0510=0xE6C7
+0x0302=0x0000
+0x0486=0x0000
+0x045F=0x0000
+0x0365=0x0000
+0x048E=0x0000
+0x0022=0x07FF
+0x0283=0x0000
+0x044B=0x0000
+0x045A=0x0000
+0x02DA=0x0000
+0x04E4=0x0000
+0x02E4=0x0000
+0x03A5=0x0000
+0x040B=0x000F
+0x0366=0x0000
+0x0443=0x0000
+0x0508=0xEF99
+0x00A3=0x6565
+0x02E2=0x0000
+0x044D=0x0000
+0x0314=0x0000
+0x0458=0x0000
+0x0493=0x0000
+0x0346=0x0000
+0x024E=0x0000
+0x055E=0xDB10
+0x0402=0x07D9
+0x0384=0x0000
+0x02E6=0x0000
+0x045B=0x0000
+0x0480=0x0000
+0x0567=0x4049
+0x04CA=0x0000
+0x0446=0x0000
+0x0447=0x0000
+0x0460=0x0000
+0x0559=0xACB9
+0x0456=0x0000
+0x0441=0x0000
+0x0444=0x0000
+0x0390=0x0000
+0x0451=0x0000
+0x049E=0x0000
+0x0324=0x0000
+0x02E7=0x0000
+0x038E=0x0000
+0x0403=0x0013
+0x04D8=0x0000
+0x029B=0x0000
+0x0491=0x0000
+0x03A1=0x0000
+0x04E1=0x0000
+0x02A2=0x0000
+0x051C=0x0000
+0x03A2=0x0000
+0x0407=0x0000
+0x0258=0x0000
+0x0502=0x0A94
+0x038A=0x0000
+0x0362=0x0000
+0x028C=0x0000
+0x0352=0x0000
+0x0385=0x0000
+0x0315=0x0000
+0x040D=0x0000
+0x039F=0x0000
+0x0248=0x0000
+0x0405=0x0000
+0x0254=0x0000
+0x0398=0x0000
+0x0408=0x0000
+0x0487=0x0000
+0x038D=0x0000
+0x035E=0x0000
+0x03A7=0x0000
+0x0520=0x174B
+0x0449=0x0000
+0x02C8=0x0000
+0x035A=0x0000
+0x0387=0x0000
+0x0386=0x0000
+0x0452=0x0000
+0x0299=0x0000
+0x0084=0x0400
+0x0498=0x0000
+0x0348=0x0000
+0x02D0=0x0000
+0x054E=0x8184
+0x03A0=0x0000
+0x009A=0x658C
+0x055D=0xA6B5
+0x0298=0x0000
+0x0364=0x0000
+0x0081=0x0000
+0x0325=0x0000
+0x040F=0x43E4
+0x04E3=0x0000
+0x050E=0x17DC
+0x0516=0x150F
+0x0389=0x0000
+0x054F=0x18C9
+0x0304=0x0000
+0x04D5=0x0000
+0x059B=0x0000
+0x0322=0x0000
+0x0442=0x0000
+0x035D=0x0000
+0x0492=0x0000
+0x04A1=0x0000
+0x0382=0x0000
+0x0288=0x0000
+0x0296=0x0000
+0x0555=0xBD96
+0x0349=0x0000
+0x0484=0x0000
+0x0586=0x196B
+0x0281=0x0000
+0x0200=0x0301
+0x0594=0xF40D
+0x02C5=0x0000
+0x0319=0x0000
+0x0121=0x3652
+0x025B=0x0000
+0x0290=0x0000
+0x02DF=0x0000
+0x0291=0x0000
+0x029C=0x0000
+0x008B=0x2756
+0x02A3=0x0000
+0x05A4=0x0000
+0x02A7=0x0000
+0x0483=0x0000
+0x0201=0x07FF
+0x02C2=0x0000
+0x02C4=0x0000
+0x0207=0x0000
+0x04C6=0x0000
+0x0093=0x0000
+0x02D3=0x0000
+0x0494=0x0000
+0x04CF=0x0000
+0x025F=0x0000
+0x0251=0x0000
+0x0488=0x0000
+0x0496=0x0000
+0x04C3=0x0000
+0x0100=0xB409
+0x04CC=0x0000
+0x02A5=0x0000
+0x0257=0x0000
+0x04D6=0x0000
+0x04A6=0x0000
+0x049A=0x0000
+0x049B=0x0000
+0x0097=0x0000
+0x011E=0x061D
+0x0285=0x0000
+0x0280=0x0000
+0x0020=0xFFFD
+0x02DD=0x0000
+0x0297=0x0000
+0x044C=0x0000
+0x0355=0x0000
+0x04A0=0x0000
+0x02CF=0x0000
+0x04D1=0x0000
+0x0526=0xBE2A
+0x0092=0x0001
+0x031B=0x0000
+0x0541=0x4C24
+0x0543=0xBD96
+0x02C0=0x0000
+0x0499=0x0000
+0x0513=0xDAA2
+0x0549=0x18C9
+0x0552=0x8D44
+0x0521=0x5852
+0x0509=0x0605
+0x0286=0x0000
+0x024F=0x0000
+0x04E0=0x0000
+0x0545=0x364E
+0x0551=0xD7B7
+0x055F=0x5852
+0x009E=0x658C
+0x0598=0xF61D
+0x0123=0x067B
+0x0497=0x0000
+0x04A5=0x0000
+0x0565=0xB77F
+0x0124=0x0000
+0x0592=0x0DF1
+0x0591=0xFCFE
+0x0548=0x79FA
+0x04D2=0x0000
+0x0599=0x0000
+0x0511=0x1D10
+0x0506=0x0DF1
+0x0595=0x00BC
+0x0584=0xE7E2
+0x0242=0x0000
+0x025A=0x0000
+0x04E2=0x0000
+0x04C5=0x0000
+0x058C=0xEA50
+0x0450=0x0000
+0x058A=0x17DC
+0x059D=0x0000
+0x0485=0x0000
+0x058E=0x1316
+0x0550=0x79FA
+0x0554=0x6901
+0x0593=0x00D8
+0x0553=0x364E
+0x0542=0xA2B5
+0x0563=0x4F91
+0x024D=0x0000
+0x055A=0xBE2A
+0x0295=0x0000
+0x028A=0x0000
+0x059C=0x0000
+0x04DD=0x0000
+0x054C=0x7FFF
+0x0582=0x150F
+0x0109=0x8CC1
+0x04A2=0x0000
+0x0292=0x0000
+0x0583=0x2E45
+0x059F=0x0000
+0x0525=0x57AC
+0x0523=0xA6B5
+0x0206=0x0000
+0x051A=0x0906
+0x055C=0x3347
+0x05A6=0x0000
+0x050F=0xEA5F
+0x051E=0xF524
+0x050A=0x1316
+0x04C7=0x0000
+0x049D=0x0000
+0x050C=0xEA50
+0x0087=0x0000
+0x0399=0x0000
+0x0495=0x0000
+0x0246=0x0000
+0x0503=0x00BC
+0x0320=0x0000
+0x0323=0x0000
+0x055B=0x57AC
+0x0114=0x0110
+0x02E5=0x0000
+0x04E7=0x0000
+0x04D0=0x0000
+0x04E6=0x0000
+0x00AE=0x0000
+0x0544=0x6901
+0x04DE=0x0000
+0x058B=0x0F45
+0x0028=0x0101
+0x029E=0x0000
+0x04DC=0x0000
+0x04D9=0x0000
+0x058F=0x0605
+0x0557=0x4C24
+0x04DB=0x0000
+0x04D7=0x0000
+0x059E=0x0000
+0x024C=0x0000
+0x02DC=0x0000
+0x04D4=0x0000
+0x0504=0xF40D
+0x02C3=0x0000
+0x04C1=0x0000
+0x04D3=0x0000
+0x0590=0xEF99
+0x04CE=0x0000
+0x05A5=0x0000
+[file_info]
+version=1
+type=lms7002m_minimal_config
diff --git a/targets/ARCH/LMSSDR/enb_sodera_lowband_Wrx_5MHz_rx19dB_txfull.ini b/targets/ARCH/LMSSDR/enb_sodera_lowband_Wrx_5MHz_rx19dB_txfull.ini
new file mode 100644
index 0000000000000000000000000000000000000000..0243742f32e2297a96e2cf49f8ca19545cfee859
--- /dev/null
+++ b/targets/ARCH/LMSSDR/enb_sodera_lowband_Wrx_5MHz_rx19dB_txfull.ini
@@ -0,0 +1,1128 @@
+[file_info]
+type=lms7002m_minimal_config
+version=1
+[lms7002_registers_a]
+0x0493=0x0000
+0x0492=0x0000
+0x0491=0x0000
+0x029B=0x0000
+0x048E=0x0000
+0x0022=0x07FF
+0x0283=0x0000
+0x0487=0x0000
+0x0486=0x0000
+0x045F=0x0000
+0x0480=0x0000
+0x0460=0x0000
+0x0447=0x0000
+0x045A=0x0000
+0x02DA=0x0000
+0x0458=0x0000
+0x0314=0x0000
+0x0456=0x0000
+0x0559=0xACB9
+0x0451=0x0000
+0x0390=0x0000
+0x044B=0x0000
+0x0448=0x0000
+0x0454=0x0000
+0x0446=0x0000
+0x04CA=0x0000
+0x0444=0x0000
+0x0443=0x0000
+0x0508=0xEF99
+0x0441=0x0000
+0x040D=0x0000
+0x040B=0x000F
+0x0409=0x0000
+0x0580=0xEFF2
+0x0407=0x0000
+0x0405=0x0000
+0x0254=0x0000
+0x0404=0x0000
+0x00A0=0x6565
+0x0560=0x174B
+0x0403=0x009C
+0x0402=0x07FF
+0x055E=0xDB10
+0x03A7=0x0000
+0x0520=0x174B
+0x03A5=0x0000
+0x03A4=0x0000
+0x03A3=0x0000
+0x03A2=0x0000
+0x051C=0x0000
+0x048D=0x0000
+0x059A=0x0000
+0x03A1=0x0000
+0x02A2=0x0000
+0x04E1=0x0000
+0x039F=0x0000
+0x0248=0x0000
+0x039B=0x0000
+0x0408=0x0000
+0x0398=0x0000
+0x0393=0x0000
+0x0305=0x0000
+0x038E=0x0000
+0x0324=0x0000
+0x02E7=0x0000
+0x038D=0x0000
+0x0387=0x0000
+0x03A0=0x0000
+0x02D0=0x0000
+0x009A=0x658C
+0x054E=0x8184
+0x0386=0x0000
+0x040F=0x0000
+0x04E3=0x0000
+0x0389=0x0000
+0x054F=0x18C9
+0x0385=0x0000
+0x0315=0x0000
+0x0384=0x0000
+0x0382=0x0000
+0x0288=0x0000
+0x0366=0x0000
+0x0365=0x0000
+0x0364=0x0000
+0x0325=0x0000
+0x0081=0x0000
+0x0362=0x0000
+0x038A=0x0000
+0x035E=0x0000
+0x035D=0x0000
+0x0442=0x0000
+0x0449=0x0000
+0x035A=0x0000
+0x02C8=0x0000
+0x0452=0x0000
+0x0299=0x0000
+0x0359=0x0000
+0x0358=0x0000
+0x048B=0x0000
+0x0354=0x0000
+0x0351=0x0000
+0x03A6=0x0000
+0x0293=0x0000
+0x034E=0x0000
+0x035C=0x0000
+0x034D=0x0000
+0x034B=0x0000
+0x011A=0x2E03
+0x0455=0x0000
+0x034A=0x0000
+0x0348=0x0000
+0x0084=0x0400
+0x0498=0x0000
+0x035B=0x0000
+0x0505=0x00D8
+0x0345=0x0000
+0x0484=0x0000
+0x0586=0x196B
+0x0344=0x0000
+0x0561=0xAB08
+0x0343=0x0000
+0x0342=0x0000
+0x0380=0x0000
+0x0327=0x0000
+0x0322=0x0000
+0x059B=0x0000
+0x0321=0x0000
+0x045E=0x0000
+0x0440=0x0024
+0x031D=0x0000
+0x0363=0x0000
+0x031A=0x0000
+0x031C=0x0000
+0x028F=0x0000
+0x0341=0x0000
+0x0287=0x0000
+0x0318=0x0000
+0x031F=0x0000
+0x0316=0x0000
+0x030D=0x0000
+0x040E=0x0000
+0x0352=0x0000
+0x028C=0x0000
+0x0360=0x0000
+0x0313=0x0000
+0x0461=0x0000
+0x010A=0x184C
+0x051B=0xB77F
+0x0312=0x0000
+0x0346=0x0000
+0x024E=0x0000
+0x0311=0x0000
+0x02D6=0x0000
+0x030C=0x0000
+0x04DF=0x0000
+0x030B=0x0000
+0x0392=0x0000
+0x030A=0x0000
+0x029F=0x0000
+0x0309=0x0000
+0x048A=0x0000
+0x0308=0x0000
+0x0588=0xE6C7
+0x0397=0x0000
+0x02E3=0x0000
+0x049C=0x0000
+0x044A=0x0000
+0x04A4=0x0000
+0x0306=0x0000
+0x0304=0x0000
+0x04D5=0x0000
+0x0303=0x0000
+0x0302=0x0000
+0x0510=0xE6C7
+0x044E=0x0000
+0x0300=0x0000
+0x034F=0x0000
+0x045B=0x0000
+0x02E6=0x0000
+0x00A3=0x6565
+0x04DA=0x0000
+0x025E=0x0000
+0x020A=0x0000
+0x0102=0x3180
+0x020C=0x8000
+0x05A2=0x0000
+0x040A=0x1000
+0x0556=0xA2B5
+0x0243=0x0000
+0x051D=0x4F91
+0x0259=0x0000
+0x02D5=0x0000
+0x02E1=0x0000
+0x011D=0xFEEE
+0x039E=0x0000
+0x0252=0x0000
+0x0204=0xFFAD
+0x0255=0x0000
+0x0281=0x0000
+0x0200=0x0301
+0x0594=0xF40D
+0x02C5=0x0000
+0x0406=0x0000
+0x030F=0x0000
+0x025D=0x0000
+0x0319=0x0000
+0x0121=0x313C
+0x0101=0x7800
+0x025B=0x0000
+0x02C6=0x0000
+0x0558=0x5009
+0x0021=0x0E9F
+0x04C2=0x0000
+0x0290=0x0000
+0x02DF=0x0000
+0x0291=0x0000
+0x0296=0x0000
+0x029C=0x0000
+0x028D=0x0000
+0x02A1=0x0000
+0x008B=0x278A
+0x02A3=0x0000
+0x05A4=0x0000
+0x02A7=0x0000
+0x0483=0x0000
+0x0201=0x07FF
+0x02C2=0x0000
+0x02C4=0x0000
+0x044D=0x0000
+0x02E2=0x0000
+0x02D1=0x0000
+0x0546=0x8D44
+0x04C8=0x0000
+0x0207=0x0000
+0x04C6=0x0000
+0x0096=0x0000
+0x0093=0x0000
+0x0250=0x0000
+0x02CB=0x0000
+0x02D3=0x0000
+0x0494=0x0000
+0x04CF=0x0000
+0x025F=0x0000
+0x0251=0x0000
+0x0488=0x0000
+0x0496=0x0000
+0x04C3=0x0000
+0x0100=0xB409
+0x04CC=0x0000
+0x02A5=0x0000
+0x0257=0x0000
+0x04D6=0x0000
+0x04A6=0x0000
+0x049A=0x0000
+0x049B=0x0000
+0x0097=0x0000
+0x011E=0x0663
+0x0285=0x0000
+0x0280=0x0000
+0x049E=0x0000
+0x0020=0xFFFD
+0x02DD=0x0000
+0x0297=0x0000
+0x049F=0x0000
+0x0522=0xDB10
+0x044C=0x0000
+0x0355=0x0000
+0x04A0=0x0000
+0x02CF=0x0000
+0x04D1=0x0000
+0x0526=0xBE2A
+0x0092=0x0001
+0x031B=0x0000
+0x0541=0x4C24
+0x0518=0xEFF2
+0x0543=0xBD96
+0x02C0=0x0000
+0x0499=0x0000
+0x04A1=0x0000
+0x058D=0xF5EF
+0x02D7=0x0000
+0x0513=0xDAA2
+0x0549=0x18C9
+0x0552=0x8D44
+0x0521=0x5852
+0x0509=0x0605
+0x0286=0x0000
+0x024F=0x0000
+0x04E0=0x0000
+0x0545=0x364E
+0x0349=0x0000
+0x0555=0xBD96
+0x04E4=0x0000
+0x02E4=0x0000
+0x0551=0xD7B7
+0x055D=0xA6B5
+0x0298=0x0000
+0x055F=0x5852
+0x009E=0x658C
+0x0547=0xD7B7
+0x0598=0xF61D
+0x0123=0x267B
+0x0497=0x0000
+0x04A5=0x0000
+0x0565=0xB77F
+0x0124=0x0000
+0x0592=0x0DF1
+0x0591=0xFCFE
+0x0548=0x79FA
+0x04D2=0x0000
+0x0599=0x0000
+0x0511=0x1D10
+0x0506=0x0DF1
+0x0595=0x00BC
+0x0584=0xE7E2
+0x0242=0x0000
+0x025A=0x0000
+0x04E2=0x0000
+0x04C5=0x0000
+0x058C=0xEA50
+0x0450=0x0000
+0x0596=0x0A94
+0x05A7=0x0000
+0x058A=0x17DC
+0x059D=0x0000
+0x0485=0x0000
+0x058E=0x1316
+0x0550=0x79FA
+0x0554=0x6901
+0x0593=0x00D8
+0x0542=0xA2B5
+0x0553=0x364E
+0x0563=0x4F91
+0x024D=0x0000
+0x0567=0x4049
+0x055A=0xBE2A
+0x0295=0x0000
+0x0566=0x0906
+0x028A=0x0000
+0x059C=0x0000
+0x04DD=0x0000
+0x054C=0x7FFF
+0x0582=0x150F
+0x0585=0xDAA2
+0x0109=0x03C1
+0x04A2=0x0000
+0x0292=0x0000
+0x059F=0x0000
+0x0583=0x2E45
+0x050E=0x17DC
+0x0516=0x150F
+0x0523=0xA6B5
+0x0525=0x57AC
+0x0206=0x0000
+0x051A=0x0906
+0x055C=0x3347
+0x0514=0xE7E2
+0x050F=0xEA5F
+0x05A6=0x0000
+0x051E=0xF524
+0x050A=0x1316
+0x04C7=0x0000
+0x049D=0x0000
+0x0527=0xACB9
+0x050C=0xEA50
+0x0087=0x0000
+0x0399=0x0000
+0x050B=0xF5EF
+0x0507=0xFCFE
+0x010D=0x01DC
+0x04C4=0x0000
+0x0495=0x0000
+0x0246=0x0000
+0x0503=0x00BC
+0x0320=0x0000
+0x0323=0x0000
+0x02E5=0x0000
+0x055B=0x57AC
+0x0114=0x0170
+0x04D8=0x0000
+0x04E7=0x0000
+0x04D0=0x0000
+0x04E6=0x0000
+0x00AE=0x0000
+0x0544=0x6901
+0x0258=0x0000
+0x0502=0x0A94
+0x04DE=0x0000
+0x058B=0x0F45
+0x0028=0x0101
+0x029E=0x0000
+0x04DC=0x0000
+0x04D9=0x0000
+0x0557=0x4C24
+0x058F=0x0605
+0x04DB=0x0000
+0x04D7=0x0000
+0x059E=0x0000
+0x024C=0x0000
+0x02DC=0x0000
+0x04D4=0x0000
+0x0504=0xF40D
+0x02C3=0x0000
+0x04C1=0x0000
+0x04D3=0x0000
+0x0590=0xEF99
+0x04CE=0x0000
+0x05A5=0x0000
+0x04A7=0x0000
+0x0489=0x0000
+0x02E0=0x0000
+0x0118=0x218C
+0x002A=0x0086
+0x0245=0x0000
+0x045D=0x0000
+0x0581=0xC89D
+0x02D2=0x0000
+0x039C=0x0000
+0x002B=0x4032
+0x02A0=0x0000
+0x010E=0x070C
+0x0394=0x0000
+0x0459=0x0000
+0x0088=0x0530
+0x0085=0x0001
+0x0089=0x00A0
+0x0256=0x0000
+0x0111=0x0099
+0x0095=0x0000
+0x0203=0x2F6C
+0x030E=0x0000
+0x0482=0x0000
+0x05A0=0x0000
+0x009C=0x658C
+0x0381=0x0000
+0x0122=0x033F
+0x0110=0x0BFF
+0x0026=0x0101
+0x0294=0x0000
+0x009D=0x6565
+0x0524=0x3347
+0x0106=0x3182
+0x028E=0x0000
+0x0326=0x0000
+0x0113=0x03C3
+0x0391=0x0000
+0x04CB=0x0000
+0x010F=0x3042
+0x0119=0x529F
+0x02A6=0x0000
+0x05A1=0x0000
+0x02C9=0x0000
+0x0500=0xF61D
+0x039D=0x0000
+0x011F=0x3680
+0x0395=0x0000
+0x024B=0x0000
+0x045C=0x0000
+0x0247=0x0000
+0x0512=0x196B
+0x04E5=0x0000
+0x0024=0x50D8
+0x0353=0x0000
+0x050D=0x0F45
+0x02CD=0x0000
+0x0490=0x0000
+0x0501=0xFDFB
+0x034C=0x0000
+0x00AA=0x0000
+0x0350=0x0000
+0x0445=0x0000
+0x048F=0x0000
+0x008A=0x0491
+0x0453=0x0000
+0x0260=0x0000
+0x00A1=0x6565
+0x0356=0x0000
+0x0241=0x0000
+0x008C=0x267B
+0x038F=0x0000
+0x054A=0x8184
+0x00A4=0x6565
+0x0401=0x07ED
+0x04CD=0x0000
+0x0249=0x0000
+0x002C=0x0100
+0x054D=0xF7A3
+0x00A6=0x0001
+0x002D=0xFFFF
+0x00AC=0x2000
+0x0253=0x0000
+0x028B=0x0000
+0x040C=0x40F8
+0x0310=0x0000
+0x0099=0x6565
+0x00A2=0x6565
+0x0589=0xEA5F
+0x002F=0x3840
+0x035F=0x0000
+0x0597=0xFDFB
+0x0116=0x8180
+0x02CC=0x0000
+0x0025=0x0101
+0x0562=0xF524
+0x011C=0xAD41
+0x0289=0x0000
+0x0282=0x0000
+0x0307=0x0000
+0x038C=0x0000
+0x02C7=0x0000
+0x054B=0xF7A3
+0x0519=0x4049
+0x009F=0x658C
+0x025C=0x0000
+0x0515=0x2E45
+0x00A5=0x6565
+0x0301=0x0000
+0x02C1=0x0000
+0x0481=0x0000
+0x0517=0xC89D
+0x00A8=0x0000
+0x0564=0x0000
+0x00AB=0x0040
+0x0261=0x0000
+0x002E=0x0000
+0x02DE=0x0000
+0x02A4=0x0000
+0x0540=0x5009
+0x00AD=0x03FF
+0x0029=0x0101
+0x024A=0x0000
+0x00A7=0x6565
+0x0027=0x05E4
+0x0117=0x1939
+0x0098=0x0000
+0x0108=0xFC26
+0x020B=0x0000
+0x0383=0x0000
+0x0202=0x07F9
+0x0086=0x4101
+0x010C=0x8865
+0x02D8=0x0000
+0x0347=0x0000
+0x0457=0x0000
+0x0103=0x0A12
+0x0104=0x0088
+0x0357=0x0000
+0x02DB=0x0000
+0x0400=0x0101
+0x009B=0x6565
+0x0105=0x0007
+0x05A3=0x0000
+0x0240=0x0028
+0x0367=0x0000
+0x044F=0x0000
+0x038B=0x0000
+0x02D9=0x0000
+0x02CE=0x0000
+0x0284=0x0000
+0x0396=0x0000
+0x029A=0x0000
+0x051F=0xAB08
+0x0361=0x0000
+0x0205=0x0000
+0x031E=0x0000
+0x04C0=0x0000
+0x0587=0x1D10
+0x0023=0x5550
+0x048C=0x0000
+0x0112=0x20E5
+0x039A=0x0000
+0x0115=0x0009
+0x00A9=0x8000
+0x0317=0x0000
+0x0244=0x0000
+0x0094=0x0000
+0x0340=0x0000
+0x0208=0x0170
+0x04A3=0x0000
+0x029D=0x0000
+0x0388=0x0000
+0x0120=0xB9FF
+0x04C9=0x0000
+0x02CA=0x0000
+0x0209=0x0000
+0x0082=0x8001
+0x02D4=0x0000
+0x0107=0x318C
+[lms7002_registers_b]
+0x04E1=0x0000
+0x03A1=0x0000
+0x02A2=0x0000
+0x04E0=0x0000
+0x04DE=0x0000
+0x058B=0x0000
+0x04DC=0x0000
+0x04DB=0x0000
+0x04D9=0x0000
+0x04D5=0x0000
+0x0304=0x0000
+0x04D4=0x0000
+0x0504=0x0000
+0x04D3=0x0000
+0x04D2=0x0000
+0x0548=0x0000
+0x04D0=0x0000
+0x04CF=0x0000
+0x025F=0x0000
+0x04CE=0x0000
+0x04CC=0x0000
+0x02A5=0x0000
+0x04C6=0x0000
+0x0207=0x0000
+0x04C1=0x0000
+0x02C3=0x0000
+0x04C9=0x0000
+0x02CA=0x0000
+0x04C0=0x0000
+0x031E=0x0000
+0x04D6=0x0000
+0x0257=0x0000
+0x04A6=0x0000
+0x04A5=0x0000
+0x04A2=0x0000
+0x0109=0x61C1
+0x049D=0x0000
+0x04C7=0x0000
+0x049C=0x0000
+0x0397=0x0000
+0x02E3=0x0000
+0x0499=0x0000
+0x02C0=0x0000
+0x0496=0x0000
+0x04C3=0x0000
+0x0493=0x0000
+0x04A1=0x0000
+0x0492=0x0000
+0x0491=0x0000
+0x029B=0x0000
+0x048E=0x0000
+0x0283=0x0000
+0x048C=0x0000
+0x048B=0x0000
+0x0358=0x0000
+0x0487=0x0000
+0x0486=0x0000
+0x045F=0x0000
+0x0480=0x0000
+0x0460=0x0000
+0x0447=0x0000
+0x045A=0x0000
+0x02DA=0x0000
+0x0458=0x0000
+0x0314=0x0000
+0x0456=0x0000
+0x0559=0x0000
+0x0453=0x0000
+0x0451=0x0000
+0x0390=0x0000
+0x044D=0x0000
+0x02E2=0x0000
+0x044B=0x0000
+0x0448=0x0000
+0x0454=0x0000
+0x0446=0x0000
+0x04CA=0x0000
+0x0444=0x0000
+0x0443=0x0000
+0x0508=0x0000
+0x0441=0x0000
+0x040D=0x0000
+0x040B=0x7FFF
+0x0409=0x0000
+0x0580=0x0000
+0x0407=0x0000
+0x0405=0x0000
+0x0254=0x0000
+0x0404=0x0000
+0x0560=0x0000
+0x04D8=0x0000
+0x0403=0x0000
+0x0402=0x07FF
+0x055E=0x0000
+0x03A7=0x0000
+0x0520=0x0000
+0x03A5=0x0000
+0x03A4=0x0000
+0x03A3=0x0000
+0x03A2=0x0000
+0x051C=0x0000
+0x048D=0x0000
+0x059A=0x0000
+0x049E=0x0000
+0x039F=0x0000
+0x0248=0x0000
+0x039B=0x0000
+0x0399=0x0000
+0x0408=0x0000
+0x0398=0x0000
+0x0497=0x0000
+0x0123=0x267B
+0x0394=0x0000
+0x0459=0x0000
+0x0393=0x0000
+0x0305=0x0000
+0x038E=0x0000
+0x0324=0x0000
+0x02E7=0x0000
+0x038D=0x0000
+0x0395=0x0000
+0x038A=0x0000
+0x0362=0x0000
+0x0387=0x0000
+0x0200=0x0081
+0x0594=0x0000
+0x02C5=0x0000
+0x02A7=0x0000
+0x0318=0x0000
+0x0544=0x0000
+0x049A=0x0000
+0x0388=0x0000
+0x0120=0xB9FF
+0x020A=0x0080
+0x0102=0x3180
+0x0290=0x0000
+0x02DF=0x0000
+0x0291=0x0000
+0x0295=0x0000
+0x055A=0x0000
+0x029C=0x0000
+0x010E=0x2040
+0x02A0=0x0000
+0x010F=0x3042
+0x02A6=0x0000
+0x0119=0x18CB
+0x02D2=0x0000
+0x039C=0x0000
+0x028D=0x0000
+0x02A1=0x0000
+0x02C2=0x0000
+0x045E=0x0000
+0x031D=0x0000
+0x0440=0x0020
+0x02C4=0x0000
+0x04D1=0x0000
+0x02CF=0x0000
+0x02C1=0x0000
+0x02C7=0x0000
+0x054B=0x0000
+0x02D3=0x0000
+0x04C8=0x0000
+0x02D1=0x0000
+0x0546=0x0000
+0x0306=0x0000
+0x02D7=0x0000
+0x058D=0x0000
+0x0457=0x0000
+0x02D8=0x0000
+0x0347=0x0000
+0x0103=0x0A12
+0x0104=0x0088
+0x0357=0x0000
+0x02DB=0x0000
+0x0400=0x0081
+0x0209=0x0000
+0x0297=0x0000
+0x02DD=0x0000
+0x029E=0x0000
+0x02DE=0x0000
+0x0527=0x0000
+0x02D5=0x0000
+0x02E1=0x0000
+0x0259=0x0000
+0x0481=0x0000
+0x0517=0x0000
+0x029A=0x0000
+0x051F=0x0000
+0x0483=0x0000
+0x0201=0x07FF
+0x0507=0x0000
+0x0321=0x0000
+0x034F=0x0000
+0x0296=0x0000
+0x0510=0x0000
+0x0302=0x0000
+0x038C=0x0000
+0x0307=0x0000
+0x0282=0x0000
+0x0392=0x0000
+0x030B=0x0000
+0x0588=0x0000
+0x0308=0x0000
+0x048A=0x0000
+0x044A=0x0000
+0x04A4=0x0000
+0x04C4=0x0000
+0x010D=0x009E
+0x0300=0x0000
+0x0587=0x0000
+0x044E=0x0000
+0x0309=0x0000
+0x0585=0x0000
+0x02E5=0x0000
+0x055B=0x0000
+0x0114=0x008D
+0x0323=0x0000
+0x0320=0x0000
+0x0503=0x0000
+0x0513=0x0000
+0x0319=0x0000
+0x0260=0x0000
+0x0549=0x0000
+0x0552=0x0000
+0x0509=0x0000
+0x0521=0x0000
+0x0286=0x0000
+0x04D7=0x0000
+0x059E=0x0000
+0x0557=0x0000
+0x058F=0x0000
+0x0322=0x0000
+0x059B=0x0000
+0x0545=0x0000
+0x0349=0x0000
+0x0555=0x0000
+0x02E4=0x0000
+0x04E4=0x0000
+0x0551=0x0000
+0x0312=0x0000
+0x055D=0x0000
+0x0298=0x0000
+0x055F=0x0000
+0x011D=0x699D
+0x039E=0x0000
+0x0547=0x0000
+0x0598=0x0000
+0x0449=0x0000
+0x0564=0x0000
+0x0242=0x0000
+0x0525=0x0000
+0x0523=0x0000
+0x0565=0x0000
+0x0124=0x0000
+0x0592=0x0000
+0x0591=0x0000
+0x0563=0x0000
+0x024D=0x0000
+0x0567=0x0000
+0x05A5=0x0000
+0x0566=0x0000
+0x030A=0x0000
+0x029F=0x0000
+0x054C=0x0000
+0x0582=0x0000
+0x0599=0x0000
+0x0511=0x0000
+0x0506=0x0000
+0x0301=0x0000
+0x0595=0x0000
+0x0584=0x0000
+0x058C=0x0000
+0x051E=0x0000
+0x05A6=0x0000
+0x050F=0x0000
+0x0590=0x0000
+0x05A0=0x0000
+0x0596=0x0000
+0x05A7=0x0000
+0x0562=0x0000
+0x058A=0x0000
+0x059D=0x0000
+0x0485=0x0000
+0x0581=0x0000
+0x045D=0x0000
+0x0245=0x0000
+0x0310=0x0000
+0x058E=0x0000
+0x05A2=0x0000
+0x054D=0x0000
+0x020C=0x7FFF
+0x0589=0x0000
+0x0522=0x0000
+0x049F=0x0000
+0x031F=0x0000
+0x0292=0x0000
+0x059F=0x0000
+0x0583=0x0000
+0x0543=0x0000
+0x0317=0x0000
+0x0244=0x0000
+0x0554=0x0000
+0x0593=0x0000
+0x05A4=0x0000
+0x02A3=0x0000
+0x0553=0x0000
+0x0542=0x0000
+0x0519=0x0000
+0x024F=0x0000
+0x0524=0x0000
+0x0518=0x0000
+0x0354=0x0000
+0x0526=0x0000
+0x031B=0x0000
+0x050E=0x0000
+0x0516=0x0000
+0x02CB=0x0000
+0x0250=0x0000
+0x031C=0x0000
+0x028F=0x0000
+0x051A=0x0000
+0x055C=0x0000
+0x0514=0x0000
+0x050A=0x0000
+0x050C=0x0000
+0x050B=0x0000
+0x04E7=0x0000
+0x04E6=0x0000
+0x04E5=0x0000
+0x0512=0x0000
+0x0206=0x0000
+0x0550=0x0000
+0x0360=0x0000
+0x030E=0x0000
+0x0203=0x0000
+0x0482=0x0000
+0x0541=0x0000
+0x0122=0x033F
+0x0110=0x0BF4
+0x0204=0x0000
+0x0252=0x0000
+0x011E=0x06B9
+0x049B=0x0000
+0x0294=0x0000
+0x011C=0xAD41
+0x02D6=0x0000
+0x0311=0x0000
+0x0117=0x280C
+0x02A4=0x0000
+0x0540=0x0000
+0x02E0=0x0000
+0x0118=0x018C
+0x0489=0x0000
+0x04A7=0x0000
+0x0101=0x7800
+0x0558=0x0000
+0x02C6=0x0000
+0x05A1=0x0000
+0x02C9=0x0000
+0x039D=0x0000
+0x0500=0x0000
+0x0450=0x0000
+0x011F=0x3680
+0x030C=0x0000
+0x04DF=0x0000
+0x0281=0x0000
+0x0106=0x3182
+0x028E=0x0000
+0x0326=0x0000
+0x0113=0x03C3
+0x04CB=0x0000
+0x0391=0x0000
+0x0105=0x0007
+0x02D9=0x0000
+0x02CE=0x0000
+0x038B=0x0000
+0x044F=0x0000
+0x02D4=0x0000
+0x0107=0x318C
+0x0495=0x0000
+0x0246=0x0000
+0x0303=0x0000
+0x02E6=0x0000
+0x045B=0x0000
+0x0100=0x3409
+0x0340=0x0000
+0x0208=0x0070
+0x0111=0x0083
+0x0247=0x0000
+0x024B=0x0000
+0x045C=0x0000
+0x0383=0x0000
+0x0202=0x07FF
+0x054A=0x0000
+0x0401=0x07FF
+0x0341=0x0000
+0x0287=0x0000
+0x034C=0x0000
+0x0501=0x0000
+0x030F=0x0000
+0x025D=0x0000
+0x0406=0x0000
+0x0313=0x0000
+0x010A=0x104C
+0x0461=0x0000
+0x051B=0x0000
+0x0121=0x333C
+0x0115=0x0009
+0x0112=0xC0E6
+0x039A=0x0000
+0x02CC=0x0000
+0x0116=0x8180
+0x04A0=0x0000
+0x0108=0x9442
+0x020B=0x4000
+0x0251=0x0000
+0x0488=0x0000
+0x0241=0x0000
+0x038F=0x0000
+0x02DC=0x0000
+0x024C=0x0000
+0x0494=0x0000
+0x051D=0x0000
+0x0243=0x0000
+0x0556=0x0000
+0x040A=0x0000
+0x04CD=0x0000
+0x0249=0x0000
+0x0261=0x0000
+0x024A=0x0000
+0x0285=0x0000
+0x0280=0x0000
+0x0346=0x0000
+0x024E=0x0000
+0x0253=0x0000
+0x028B=0x0000
+0x040C=0x0000
+0x0255=0x0000
+0x0258=0x0000
+0x0502=0x0000
+0x05A3=0x0000
+0x0367=0x0000
+0x0240=0x0020
+0x0256=0x0000
+0x025A=0x0000
+0x04E2=0x0000
+0x04C5=0x0000
+0x025B=0x0000
+0x0205=0x0000
+0x0361=0x0000
+0x0515=0x0000
+0x025C=0x0000
+0x0355=0x0000
+0x044C=0x0000
+0x010C=0x88FD
+0x0284=0x0000
+0x0396=0x0000
+0x0363=0x0000
+0x031A=0x0000
+0x0289=0x0000
+0x028A=0x0000
+0x04DD=0x0000
+0x059C=0x0000
+0x0352=0x0000
+0x028C=0x0000
+0x04C2=0x0000
+0x04DA=0x0000
+0x025E=0x0000
+0x0327=0x0000
+0x0380=0x0000
+0x0342=0x0000
+0x0343=0x0000
+0x0344=0x0000
+0x0561=0x0000
+0x035A=0x0000
+0x02C8=0x0000
+0x0484=0x0000
+0x0586=0x0000
+0x0597=0x0000
+0x035F=0x0000
+0x0345=0x0000
+0x0505=0x0000
+0x035B=0x0000
+0x034A=0x0000
+0x0455=0x0000
+0x011A=0x2E02
+0x034B=0x0000
+0x034D=0x0000
+0x035C=0x0000
+0x034E=0x0000
+0x0293=0x0000
+0x03A6=0x0000
+0x0350=0x0000
+0x0445=0x0000
+0x048F=0x0000
+0x0351=0x0000
+0x0353=0x0000
+0x050D=0x0000
+0x02CD=0x0000
+0x0490=0x0000
+0x0498=0x0000
+0x0348=0x0000
+0x0356=0x0000
+0x030D=0x0000
+0x0316=0x0000
+0x040E=0x0000
+0x04A3=0x0000
+0x029D=0x0000
+0x0359=0x0000
+0x0299=0x0000
+0x0452=0x0000
+0x0442=0x0000
+0x035D=0x0000
+0x035E=0x0000
+0x0325=0x0000
+0x0364=0x0000
+0x0365=0x0000
+0x0366=0x0000
+0x0381=0x0000
+0x0288=0x0000
+0x0382=0x0000
+0x0384=0x0000
+0x0315=0x0000
+0x0385=0x0000
+0x04E3=0x0000
+0x040F=0x0000
+0x0389=0x0000
+0x054F=0x0000
+0x0386=0x0000
+0x02D0=0x0000
+0x054E=0x0000
+0x03A0=0x0000
+[reference_clocks]
+sxt_ref_clk_mhz=30.72
+sxr_ref_clk_mhz=30.72
diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
index 0885ef6dd15f0ef1741f9580bb02c36032d8fa4c..72e79b44de53eaa0813bc5a2baaddea1d0ae8efe 100644
--- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
+++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
@@ -29,7 +29,7 @@
 
 /** usrp_lib.cpp
  *
- * Author: HongliangXU : hong-liang-xu@agilent.com
+ * \author: HongliangXU : hong-liang-xu@agilent.com
  */
 
 #include <string.h>
@@ -38,6 +38,7 @@
 #include <stdio.h>
 #include <uhd/utils/thread_priority.hpp>
 #include <uhd/usrp/multi_usrp.hpp>
+#include <uhd/version.hpp>
 #include <boost/lexical_cast.hpp>
 #include <boost/algorithm/string.hpp>
 #include <iostream>
@@ -54,47 +55,75 @@
 #  include <immintrin.h>
 #endif
 
+#ifdef __arm__
+#  include <arm_neon.h>
+#endif
+
+/** @addtogroup _USRP_PHY_RF_INTERFACE_
+ * @{
+ */
+
+/*! \brief USRP Configuration */ 
 typedef struct
 {
 
   // --------------------------------
   // variables for USRP configuration
   // --------------------------------
+  //! USRP device pointer
   uhd::usrp::multi_usrp::sptr usrp;
   //uhd::usrp::multi_usrp::sptr rx_usrp;
   
   //create a send streamer and a receive streamer
+  //! USRP TX Stream
   uhd::tx_streamer::sptr tx_stream;
+  //! USRP RX Stream
   uhd::rx_streamer::sptr rx_stream;
 
+  //! USRP TX Metadata
   uhd::tx_metadata_t tx_md;
+  //! USRP RX Metadata
   uhd::rx_metadata_t rx_md;
 
+  //! USRP Timestamp Information
   uhd::time_spec_t tm_spec;
+
   //setup variables and allocate buffer
+  //! USRP Metadata
   uhd::async_metadata_t async_md;
 
+  //! Sampling rate
   double sample_rate;
-  // time offset between transmiter timestamp and receiver timestamp;
+
+  //! time offset between transmiter timestamp and receiver timestamp;
   double tdiff;
-  // use usrp_time_offset to get this value
+
+  //! TX forward samples. We use usrp_time_offset to get this value
   int tx_forward_nsamps; //166 for 20Mhz
 
 
   // --------------------------------
   // Debug and output control
   // --------------------------------
+  //! Number of underflows
   int num_underflows;
+  //! Number of overflows
   int num_overflows;
+  
+  //! Number of sequential errors
   int num_seq_errors;
-
+  //! tx count
   int64_t tx_count;
+  //! rx count
   int64_t rx_count;
+  //! timestamp of RX packet
   openair0_timestamp rx_timestamp;
 
 } usrp_state_t;
 
-
+/*! \brief Called to start the USRP transceiver. Return 0 if OK, < 0 if error
+    @param device pointer to the device structure specific to the RF hardware target
+*/
 static int trx_usrp_start(openair0_device *device)
 {
   usrp_state_t *s = (usrp_state_t*)device->priv;
@@ -117,7 +146,9 @@ static int trx_usrp_start(openair0_device *device)
 
   return 0;
 }
-
+/*! \brief Terminate operation of the USRP transceiver -- free all associated resources 
+ * \param device the hardware to use
+ */
 static void trx_usrp_end(openair0_device *device)
 {
   usrp_state_t *s = (usrp_state_t*)device->priv;
@@ -131,6 +162,14 @@ static void trx_usrp_end(openair0_device *device)
   
 }
 
+/*! \brief Called to send samples to the USRP RF target
+      @param device pointer to the device structure specific to the RF hardware target
+      @param timestamp The timestamp at whicch the first sample MUST be sent 
+      @param buff Buffer which holds the samples
+      @param nsamps number of samples to be sent
+      @param antenna_id index of the antenna if the device has multiple anteannas
+      @param flags flags must be set to TRUE if timestamp parameter needs to be applied
+*/ 
 static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags)
 {
   usrp_state_t *s = (usrp_state_t*)device->priv;
@@ -152,6 +191,17 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
   return 0;
 }
 
+/*! \brief Receive samples from hardware.
+ * Read \ref nsamps samples from each channel to buffers. buff[0] is the array for
+ * the first channel. *ptimestamp is the time at which the first sample
+ * was received.
+ * \param device the hardware to use
+ * \param[out] ptimestamp the time at which the first sample was received.
+ * \param[out] buff An array of pointers to buffers for received samples. The buffers must be large enough to hold the number of samples \ref nsamps.
+ * \param nsamps Number of samples. One sample is 2 byte I + 2 byte Q => 4 byte.
+ * \param antenna_id Index of antenna for which to receive samples
+ * \returns the number of sample read
+*/
 static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc)
 {
    usrp_state_t *s = (usrp_state_t*)device->priv;
@@ -171,7 +221,7 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
 #endif
 
 
-  if (device->type == USRP_B200_IF) {  
+  if (device->type == USRP_B200_DEV) {  
     if (cc>1) {
     // receive multiple channels (e.g. RF A and RF B)
       std::vector<void *> buff_ptrs;
@@ -197,7 +247,7 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
 #endif
       }
     }
-  } else if (device->type == USRP_X300_IF) {
+  } else if (device->type == USRP_X300_DEV) {
     if (cc>1) {
     // receive multiple channels (e.g. RF A and RF B)
       std::vector<void *> buff_ptrs;
@@ -237,6 +287,9 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
   return samples_received;
 }
 
+/*! \brief Get current timestamp of USRP
+ * \param device the hardware to use
+*/
 openair0_timestamp get_usrp_time(openair0_device *device) 
 {
  
@@ -245,15 +298,26 @@ openair0_timestamp get_usrp_time(openair0_device *device)
   return s->usrp->get_time_now().to_ticks(s->sample_rate);
 } 
 
+/*! \brief Compares two variables within precision
+ * \param a first variable
+ * \param b second variable
+*/
 static bool is_equal(double a, double b)
 {
   return std::fabs(a-b) < std::numeric_limits<double>::epsilon();
 }
 
+/*! \brief Set frequencies (TX/RX)
+ * \param device the hardware to use
+ * \param openair0_cfg RF frontend parameters set by application
+ * \param dummy dummy variable not used
+ * \returns 0 in success 
+ */
 int trx_usrp_set_freq(openair0_device* device, openair0_config_t *openair0_cfg, int dummy) {
 
   usrp_state_t *s = (usrp_state_t*)device->priv;
 
+  printf("Setting USRP TX Freq %f, RX Freq %f\n",openair0_cfg[0].tx_freq[0],openair0_cfg[0].rx_freq[0]);
   s->usrp->set_tx_freq(openair0_cfg[0].tx_freq[0]);
   s->usrp->set_rx_freq(openair0_cfg[0].rx_freq[0]);
 
@@ -261,6 +325,11 @@ int trx_usrp_set_freq(openair0_device* device, openair0_config_t *openair0_cfg,
   
 }
 
+/*! \brief Set RX frequencies 
+ * \param device the hardware to use
+ * \param openair0_cfg RF frontend parameters set by application
+ * \returns 0 in success 
+ */
 int openair0_set_rx_frequencies(openair0_device* device, openair0_config_t *openair0_cfg) {
 
   usrp_state_t *s = (usrp_state_t*)device->priv;
@@ -278,6 +347,11 @@ int openair0_set_rx_frequencies(openair0_device* device, openair0_config_t *open
   
 }
 
+/*! \brief Set Gains (TX/RX)
+ * \param device the hardware to use
+ * \param openair0_cfg RF frontend parameters set by application
+ * \returns 0 in success 
+ */
 int trx_usrp_set_gains(openair0_device* device, 
 		       openair0_config_t *openair0_cfg) {
 
@@ -298,33 +372,75 @@ int trx_usrp_set_gains(openair0_device* device,
   return(0);
 }
 
+/*! \brief Stop USRP
+ * \param card refers to the hardware index to use
+ */
 int trx_usrp_stop(int card) {
   return(0);
 }
 
-
+/*! \brief USRPB210 RX calibration table */
 rx_gain_calib_table_t calib_table_b210[] = {
-  {3500000000.0,46.0},
-  {2660000000.0,53.0},
-  {2300000000.0,54.0},
-  {1880000000.0,55.0},
-  {816000000.0,62.0},
+  {3500000000.0,44.0},
+  {2660000000.0,49.0},
+  {2300000000.0,50.0},
+  {1880000000.0,53.0},
+  {816000000.0,58.0},
+  {-1,0}};
+
+/*! \brief USRPB210 RX calibration table */
+rx_gain_calib_table_t calib_table_b210_38[] = {
+  {3500000000.0,44.0},
+  {2660000000.0,49.8},
+  {2300000000.0,51.0},
+  {1880000000.0,53.0},
+  {816000000.0,57.0},
   {-1,0}};
 
+/*! \brief USRPx310 RX calibration table */
 rx_gain_calib_table_t calib_table_x310[] = {
   {3500000000.0,77.0},
-  {2660000000.0,80.0},
+  {2660000000.0,81.0},
   {2300000000.0,81.0},
   {1880000000.0,82.0},
   {816000000.0,85.0},
   {-1,0}};
 
-void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) {
+/*! \brief Set RX gain offset 
+ * \param openair0_cfg RF frontend parameters set by application
+ * \param chain_index RF chain to apply settings to
+ * \returns 0 in success 
+ */
+void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index,int bw_gain_adjust) {
 
   int i=0;
   // loop through calibration table to find best adjustment factor for RX frequency
-  double min_diff = 6e9,diff;
-  
+  double min_diff = 6e9,diff,gain_adj=0.0;
+  if (bw_gain_adjust==1) {
+    switch ((int)openair0_cfg[0].sample_rate) {
+    case 30720000:      
+      break;
+    case 23040000:
+      gain_adj=1.25;
+      break;
+    case 15360000:
+      gain_adj=3.0;
+      break;
+    case 7680000:
+      gain_adj=6.0;
+      break;
+    case 3840000:
+      gain_adj=9.0;
+      break;
+    case 1920000:
+      gain_adj=12.0;
+      break;
+    default:
+      printf("unknown sampling rate %d\n",(int)openair0_cfg[0].sample_rate);
+      exit(-1);
+      break;
+    }
+  }
   while (openair0_cfg->rx_gain_calib_table[i].freq>0) {
     diff = fabs(openair0_cfg->rx_freq[chain_index] - openair0_cfg->rx_gain_calib_table[i].freq);
     printf("cal %d: freq %f, offset %f, diff %f\n",
@@ -333,19 +449,27 @@ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) {
 	   openair0_cfg->rx_gain_calib_table[i].offset,diff);
     if (min_diff > diff) {
       min_diff = diff;
-      openair0_cfg->rx_gain_offset[chain_index] = openair0_cfg->rx_gain_calib_table[i].offset;
+      openair0_cfg->rx_gain_offset[chain_index] = openair0_cfg->rx_gain_calib_table[i].offset+gain_adj;
     }
     i++;
   }
   
 }
 
-
+/*! \brief print the USRP statistics  
+* \param device the hardware to use
+* \returns  0 on success
+*/
 int trx_usrp_get_stats(openair0_device* device) {
 
   return(0);
 
 }
+
+/*! \brief Reset the USRP statistics  
+* \param device the hardware to use
+* \returns  0 on success
+*/
 int trx_usrp_reset_stats(openair0_device* device) {
 
   return(0);
@@ -353,21 +477,33 @@ int trx_usrp_reset_stats(openair0_device* device) {
 }
 
 
-int openair0_dev_init_usrp(openair0_device* device, openair0_config_t *openair0_cfg)
-{
-  uhd::set_thread_priority_safe(1.0);
-  usrp_state_t *s = (usrp_state_t*)malloc(sizeof(usrp_state_t));
-  memset(s, 0, sizeof(usrp_state_t));
 
-  // Initialize USRP device
+extern "C" {
+/*! \brief Initialize Openair USRP target. It returns 0 if OK
+* \param device the hardware to use
+* \param openair0_cfg RF frontend parameters set by application
+*/
+  int device_init(openair0_device* device, openair0_config_t *openair0_cfg) {
+    
+    uhd::set_thread_priority_safe(1.0);
+    usrp_state_t *s = (usrp_state_t*)malloc(sizeof(usrp_state_t));
+    memset(s, 0, sizeof(usrp_state_t));
+    
+    // Initialize USRP device
+
 
   std::string args = "type=b200";
 
 
   uhd::device_addrs_t device_adds = uhd::device::find(args);
   size_t i;
+  
+  int vers=0,subvers=0,subsubvers=0;
+  int bw_gain_adjust=0;
+
+  sscanf(uhd::get_version_string().c_str(),"%d.%d.%d",&vers,&subvers,&subsubvers);
 
-  printf("Checking for USRPs\n");
+  printf("Checking for USRPs : UHD %s (%d.%d.%d)\n",uhd::get_version_string().c_str(),vers,subvers,subsubvers);
   
   if(device_adds.size() == 0)
   {
@@ -388,6 +524,7 @@ int openair0_dev_init_usrp(openair0_device* device, openair0_config_t *openair0_
 
     }
 
+
     printf("Found USRP X300\n");
     s->usrp = uhd::usrp::multi_usrp::make(args);
     //  s->usrp->set_rx_subdev_spec(rx_subdev);
@@ -397,34 +534,42 @@ int openair0_dev_init_usrp(openair0_device* device, openair0_config_t *openair0_
     s->usrp->set_clock_source("internal");
     
     //Setting device type to USRP X300/X310 
-    device->type=USRP_X300_IF;
+    device->type=USRP_X300_DEV;
 
     // this is not working yet, master clock has to be set via constructor
     // set master clock rate and sample rate for tx & rx for streaming
     //s->usrp->set_master_clock_rate(usrp_master_clock);
 
     openair0_cfg[0].rx_gain_calib_table = calib_table_x310;
-
+    
     switch ((int)openair0_cfg[0].sample_rate) {
     case 30720000:
             // from usrp_time_offset
       openair0_cfg[0].samples_per_packet    = 2048;
       openair0_cfg[0].tx_sample_advance     = 15;
+      openair0_cfg[0].tx_bw                 = 20e6;
+      openair0_cfg[0].rx_bw                 = 20e6;
       openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet;
       break;
     case 15360000:
       openair0_cfg[0].samples_per_packet    = 2048;
       openair0_cfg[0].tx_sample_advance     = 45;
+      openair0_cfg[0].tx_bw                 = 10e6;
+      openair0_cfg[0].rx_bw                 = 10e6;
       openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet;
       break;
     case 7680000:
       openair0_cfg[0].samples_per_packet    = 1024;
       openair0_cfg[0].tx_sample_advance     = 50;
+      openair0_cfg[0].tx_bw                 = 5e6;
+      openair0_cfg[0].rx_bw                 = 5e6;
       openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet;
       break;
     case 1920000:
       openair0_cfg[0].samples_per_packet    = 256;
       openair0_cfg[0].tx_sample_advance     = 50;
+      openair0_cfg[0].tx_bw                 = 1.25e6;
+      openair0_cfg[0].rx_bw                 = 1.25e6;
       openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet;
       break;
     default:
@@ -435,41 +580,68 @@ int openair0_dev_init_usrp(openair0_device* device, openair0_config_t *openair0_
 
   } else {
     printf("Found USRP B200");
+    args += ",num_recv_frames=256" ; 
     s->usrp = uhd::usrp::multi_usrp::make(args);
 
     //  s->usrp->set_rx_subdev_spec(rx_subdev);
     //  s->usrp->set_tx_subdev_spec(tx_subdev);
-
-// do not explicitly set the clock to "internal", because this will disable the gpsdo
-//    // lock mboard clocks
-//    s->usrp->set_clock_source("internal");
+    
+    // do not explicitly set the clock to "internal", because this will disable the gpsdo
+    //    // lock mboard clocks
+    //    s->usrp->set_clock_source("internal");
     // set master clock rate and sample rate for tx & rx for streaming
 
-    device->type = USRP_B200_IF;
-    s->usrp->set_master_clock_rate(30.72e6);
+    device->type = USRP_B200_DEV;
 
-    openair0_cfg[0].rx_gain_calib_table = calib_table_b210;
+
+    if ((vers == 3) && (subvers == 9) && (subsubvers>=2)) {
+      openair0_cfg[0].rx_gain_calib_table = calib_table_b210;
+      bw_gain_adjust=0;
+    }
+    else {
+      openair0_cfg[0].rx_gain_calib_table = calib_table_b210_38;
+      bw_gain_adjust=1;
+    }
 
     switch ((int)openair0_cfg[0].sample_rate) {
     case 30720000:
-            // from usrp_time_offset
-      openair0_cfg[0].samples_per_packet    = 2048;
+      s->usrp->set_master_clock_rate(30.72e6);
+      openair0_cfg[0].samples_per_packet    = 4096;
       openair0_cfg[0].tx_sample_advance     = 115;
+      openair0_cfg[0].tx_bw                 = 20e6;
+      openair0_cfg[0].rx_bw                 = 20e6;
       openair0_cfg[0].tx_scheduling_advance = 11*openair0_cfg[0].samples_per_packet;
       break;
-    case 15360000:
+    case 23040000:
+      s->usrp->set_master_clock_rate(23.04e6); //to be checked
       openair0_cfg[0].samples_per_packet    = 2048;
       openair0_cfg[0].tx_sample_advance     = 113;
-      openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet;
+      openair0_cfg[0].tx_bw                 = 20e6;
+      openair0_cfg[0].rx_bw                 = 20e6;
+      openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet;
+      break;
+    case 15360000:
+      s->usrp->set_master_clock_rate(30.72e06);
+      openair0_cfg[0].samples_per_packet    = 2048;
+      openair0_cfg[0].tx_sample_advance     = 103; 
+      openair0_cfg[0].tx_bw                 = 20e6;
+      openair0_cfg[0].rx_bw                 = 20e6;
+      openair0_cfg[0].tx_scheduling_advance = 10240;
       break;
     case 7680000:
+      s->usrp->set_master_clock_rate(30.72e6);
       openair0_cfg[0].samples_per_packet    = 1024;
-      openair0_cfg[0].tx_sample_advance     = 103;
+      openair0_cfg[0].tx_sample_advance     = 80;
+      openair0_cfg[0].tx_bw                 = 20e6;
+      openair0_cfg[0].rx_bw                 = 20e6;
       openair0_cfg[0].tx_scheduling_advance = 5*openair0_cfg[0].samples_per_packet;
       break;
     case 1920000:
+      s->usrp->set_master_clock_rate(7.68e6);
       openair0_cfg[0].samples_per_packet    = 256;
       openair0_cfg[0].tx_sample_advance     = 40;
+      openair0_cfg[0].tx_bw                 = 20e6;
+      openair0_cfg[0].rx_bw                 = 20e6;
       openair0_cfg[0].tx_scheduling_advance = 8*openair0_cfg[0].samples_per_packet;
       break;
     default:
@@ -479,15 +651,19 @@ int openair0_dev_init_usrp(openair0_device* device, openair0_config_t *openair0_
     }
   }
 
-   
-
+  /* device specific */
+  openair0_cfg[0].txlaunch_wait = 1;//manage when TX processing is triggered
+  openair0_cfg[0].txlaunch_wait_slotcount = 1; //manage when TX processing is triggered
+  openair0_cfg[0].iq_txshift = 4;//shift
+  openair0_cfg[0].iq_rxrescale = 15;//rescale iqs
+  
   for(i=0;i<s->usrp->get_rx_num_channels();i++) {
     if (i<openair0_cfg[0].rx_num_channels) {
       s->usrp->set_rx_rate(openair0_cfg[0].sample_rate,i);
-      s->usrp->set_rx_bandwidth(openair0_cfg[0].rx_bw,i);
-      printf("Setting rx freq/gain on channel %lu/%lu\n",i,s->usrp->get_rx_num_channels());
+      //s->usrp->set_rx_bandwidth(openair0_cfg[0].rx_bw,i);
+      //printf("Setting rx freq/gain on channel %lu/%lu : BW %f (readback %f)\n",i,s->usrp->get_rx_num_channels(),openair0_cfg[0].rx_bw/1e6,s->usrp->get_rx_bandwidth(i)/1e6);
       s->usrp->set_rx_freq(openair0_cfg[0].rx_freq[i],i);
-      set_rx_gain_offset(&openair0_cfg[0],i);
+      set_rx_gain_offset(&openair0_cfg[0],i,bw_gain_adjust);
 
       ::uhd::gain_range_t gain_range = s->usrp->get_rx_gain_range(i);
       // limit to maximum gain
@@ -505,8 +681,8 @@ int openair0_dev_init_usrp(openair0_device* device, openair0_config_t *openair0_
   for(i=0;i<s->usrp->get_tx_num_channels();i++) {
     if (i<openair0_cfg[0].tx_num_channels) {
       s->usrp->set_tx_rate(openair0_cfg[0].sample_rate,i);
-      s->usrp->set_tx_bandwidth(openair0_cfg[0].tx_bw,i);
-      printf("Setting tx freq/gain on channel %lu/%lu\n",i,s->usrp->get_tx_num_channels());
+      //s->usrp->set_tx_bandwidth(openair0_cfg[0].tx_bw,i);
+      //printf("Setting tx freq/gain on channel %lu/%lu: BW %f (readback %f)\n",i,s->usrp->get_tx_num_channels(),openair0_cfg[0].tx_bw/1e6,s->usrp->get_tx_bandwidth(i)/1e6);
       s->usrp->set_tx_freq(openair0_cfg[0].tx_freq[i],i);
       s->usrp->set_tx_gain(openair0_cfg[0].tx_gain[i],i);
     }
@@ -515,6 +691,8 @@ int openair0_dev_init_usrp(openair0_device* device, openair0_config_t *openair0_
 
   // display USRP settings
   std::cout << boost::format("Actual master clock: %fMHz...") % (s->usrp->get_master_clock_rate()/1e6) << std::endl;
+  
+  sleep(1);
 
   // create tx & rx streamer
   uhd::stream_args_t stream_args_rx("sc16", "sc16");
@@ -533,11 +711,22 @@ int openair0_dev_init_usrp(openair0_device* device, openair0_config_t *openair0_
   std::cout << boost::format("tx_max_num_samps %u") % (s->tx_stream->get_max_num_samps()) << std::endl;
 
 
-  s->usrp->set_time_now(uhd::time_spec_t(0.0));
-
-
+ /* Setting TX/RX BW after streamers are created due to USRP calibration issue */
+  for(i=0;i<s->usrp->get_tx_num_channels();i++) {
+    if (i<openair0_cfg[0].tx_num_channels) {
+      s->usrp->set_tx_bandwidth(openair0_cfg[0].tx_bw,i);
+      printf("Setting tx freq/gain on channel %lu/%lu: BW %f (readback %f)\n",i,s->usrp->get_tx_num_channels(),openair0_cfg[0].tx_bw/1e6,s->usrp->get_tx_bandwidth(i)/1e6);
+    }
+  }
+  for(i=0;i<s->usrp->get_rx_num_channels();i++) {
+    if (i<openair0_cfg[0].rx_num_channels) {
+      s->usrp->set_rx_bandwidth(openair0_cfg[0].rx_bw,i);
+      printf("Setting rx freq/gain on channel %lu/%lu : BW %f (readback %f)\n",i,s->usrp->get_rx_num_channels(),openair0_cfg[0].rx_bw/1e6,s->usrp->get_rx_bandwidth(i)/1e6);
+    }
+  }
 
-  
+  s->usrp->set_time_now(uhd::time_spec_t(0.0));
+ 
 
   for (i=0;i<openair0_cfg[0].rx_num_channels;i++) {
     if (i<openair0_cfg[0].rx_num_channels) {
@@ -585,4 +774,6 @@ int openair0_dev_init_usrp(openair0_device* device, openair0_config_t *openair0_
   if(is_equal(s->sample_rate, (double)7.68e6))
     s->tx_forward_nsamps = 50;
   return 0;
+  }
 }
+/*@}*/
diff --git a/targets/DOCS/Doxyfile b/targets/DOCS/Doxyfile
index 0d32a3ffad73ffc7d69b0870a28f2fd394979ef9..a060f6597ab894c046e427960ed42c2ba1084000 100644
--- a/targets/DOCS/Doxyfile
+++ b/targets/DOCS/Doxyfile
@@ -793,7 +793,11 @@ INPUT                  = $(OPENAIR1_DIR)/PHY/defs.h \
                          $(OPENAIR2_DIR)/LAYER2/RLC/UM_v9.3.0/rlc_um.h \
                          $(OPENAIR2_DIR)/LAYER2/RLC/UM_v9.3.0/rlc_um_entity.h \
                          $(OPENAIR2_DIR)/NETWORK_DRIVER/MESH/proto_extern.h \
-                         $(OPENAIR_TARGETS)/ARCH/COMMON/common_lib.h
+                         $(OPENAIR_TARGETS)/ARCH/COMMON/common_lib.h \
+                         $(OPENAIR_TARGETS)/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp \
+                         $(OPENAIR_TARGETS)/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c \
+                         $(OPENAIR_TARGETS)/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h \
+                         $(OPENAIR_TARGETS)/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp
 
 # This tag can be used to specify the character encoding of the source files
 # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.lmssdr.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.lmssdr.conf
new file mode 100644
index 0000000000000000000000000000000000000000..b81ac861f616f8c844300f40cd15321226b815a5
--- /dev/null
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.lmssdr.conf
@@ -0,0 +1,171 @@
+Active_eNBs = ( "eNB_Eurecom_LTEBox");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+
+eNBs =
+(
+ {
+    ////////// Identification parameters:
+    eNB_ID    =  0xe00;
+
+    cell_type =  "CELL_MACRO_ENB";
+
+    eNB_name  =  "eNB_Eurecom_LTEBox";
+
+    // Tracking area code, 0x0000 and 0xfffe are reserved values
+    tracking_area_code  =  "1";
+
+    mobile_country_code =  "208";
+
+    mobile_network_code =  "93";
+
+       ////////// Physical parameters:
+
+    component_carriers = (
+      {
+      frame_type					      = "FDD";
+      tdd_config 					      = 3;
+      tdd_config_s            			      = 0;
+      prefix_type             			      = "NORMAL";
+      eutra_band              			      = 13;
+      downlink_frequency      			      = 751000000L;
+      uplink_frequency_offset 			      = 31000000;
+      Nid_cell					      = 0;
+      N_RB_DL                 			      = 50;
+      Nid_cell_mbsfn          			      = 0;
+      nb_antennas_tx          			      = 1;
+      nb_antennas_rx          			      = 1;
+      tx_gain                                            = 90;
+      rx_gain                                            = 125;
+      prach_root              			      = 0;
+      prach_config_index      			      = 0;
+      prach_high_speed        			      = "DISABLE";
+      prach_zero_correlation  			      = 1;
+      prach_freq_offset       			      = 2;
+      pucch_delta_shift       			      = 1;
+      pucch_nRB_CQI           			      = 1;
+      pucch_nCS_AN            			      = 0;
+      pucch_n1_AN             			      = 32;
+      pdsch_referenceSignalPower 			      = -20;
+      pdsch_p_b                  			      = 0;
+      pusch_n_SB                 			      = 1;
+      pusch_enable64QAM          			      = "DISABLE";
+      pusch_hoppingMode                                  = "interSubFrame";
+      pusch_hoppingOffset                                = 0;
+      pusch_groupHoppingEnabled  			      = "ENABLE";
+      pusch_groupAssignment      			      = 0;
+      pusch_sequenceHoppingEnabled		   	      = "DISABLE";
+      pusch_nDMRS1                                       = 1;
+      phich_duration                                     = "NORMAL";
+      phich_resource                                     = "ONESIXTH";
+      srs_enable                                         = "DISABLE";
+      /*  srs_BandwidthConfig                                =;
+      srs_SubframeConfig                                 =;
+      srs_ackNackST                                      =;
+      srs_MaxUpPts                                       =;*/
+
+      pusch_p0_Nominal                                   = -90;
+      pusch_alpha                                        = "AL1";
+      pucch_p0_Nominal                                   = -96;
+      msg3_delta_Preamble                                = 6;
+      pucch_deltaF_Format1                               = "deltaF2";
+      pucch_deltaF_Format1b                              = "deltaF3";
+      pucch_deltaF_Format2                               = "deltaF0";
+      pucch_deltaF_Format2a                              = "deltaF0";
+      pucch_deltaF_Format2b		    	      = "deltaF0";
+
+      rach_numberOfRA_Preambles                          = 64;
+      rach_preamblesGroupAConfig                         = "DISABLE";
+      /*
+      rach_sizeOfRA_PreamblesGroupA                      = ;
+      rach_messageSizeGroupA                             = ;
+      rach_messagePowerOffsetGroupB                      = ;
+      */
+      rach_powerRampingStep                              = 4;
+      rach_preambleInitialReceivedTargetPower            = -108;
+      rach_preambleTransMax                              = 10;
+      rach_raResponseWindowSize                          = 10;
+      rach_macContentionResolutionTimer                  = 48;
+      rach_maxHARQ_Msg3Tx                                = 4;
+
+      pcch_default_PagingCycle                           = 128;
+      pcch_nB                                            = "oneT";
+      bcch_modificationPeriodCoeff			      = 2;
+      ue_TimersAndConstants_t300			      = 1000;
+      ue_TimersAndConstants_t301			      = 1000;
+      ue_TimersAndConstants_t310			      = 1000;
+      ue_TimersAndConstants_t311			      = 10000;
+      ue_TimersAndConstants_n310			      = 20;
+      ue_TimersAndConstants_n311			      = 1;
+
+      }
+    );
+
+
+    srb1_parameters :
+    {
+        # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
+        timer_poll_retransmit    = 80;
+
+        # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
+        timer_reordering         = 35;
+
+        # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
+        timer_status_prohibit    = 0;
+
+        # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
+        poll_pdu                 =  4;
+
+        # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
+        poll_byte                =  99999;
+
+        # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
+        max_retx_threshold       =  4;
+    }
+
+    # ------- SCTP definitions
+    SCTP :
+    {
+        # Number of streams to use in input/output
+        SCTP_INSTREAMS  = 2;
+        SCTP_OUTSTREAMS = 2;
+    };
+
+
+    ////////// MME parameters:
+    mme_ip_address      = ( { ipv4       = "127.0.0.3";
+                              ipv6       = "192:168:30::17";
+                              active     = "yes";
+                              preference = "ipv4";
+                            }
+                          );
+
+    NETWORK_INTERFACES :
+    {
+        ENB_INTERFACE_NAME_FOR_S1_MME            = "lo";
+        ENB_IPV4_ADDRESS_FOR_S1_MME              = "127.0.0.2/24";
+
+        ENB_INTERFACE_NAME_FOR_S1U               = "lo";
+        ENB_IPV4_ADDRESS_FOR_S1U                 = "127.0.0.4/24";
+        ENB_PORT_FOR_S1U                         = 2152; # Spec 2152
+    };
+
+    log_config :
+    {
+      global_log_level                      ="info";
+      global_log_verbosity                  ="medium";
+      hw_log_level                          ="info";
+      hw_log_verbosity                      ="medium";
+      phy_log_level                         ="info";
+      phy_log_verbosity                     ="medium";
+      mac_log_level                         ="info";
+      mac_log_verbosity                     ="high";
+      rlc_log_level                         ="info";
+      rlc_log_verbosity                     ="medium";
+      pdcp_log_level                        ="info";
+      pdcp_log_verbosity                    ="medium";
+      rrc_log_level                         ="info";
+      rrc_log_verbosity                     ="medium";
+   };
+  }
+);
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.sedora.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.sedora.conf
new file mode 100644
index 0000000000000000000000000000000000000000..2d0b63e4b0a2f1135cb420b14d066006d2c2337e
--- /dev/null
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.sedora.conf
@@ -0,0 +1,171 @@
+Active_eNBs = ( "eNB_Eurecom_LTEBox");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+
+eNBs =
+(
+ {
+    ////////// Identification parameters:
+    eNB_ID    =  0xe00;
+    
+    cell_type =  "CELL_MACRO_ENB";
+    
+    eNB_name  =  "eNB_Eurecom_LTEBox";
+    
+    // Tracking area code, 0x0000 and 0xfffe are reserved values
+    tracking_area_code  =  "1";
+    
+    mobile_country_code =  "208";
+    
+    mobile_network_code =  "93";
+    
+       ////////// Physical parameters:
+  
+    component_carriers = (
+    		       	 {
+  			   frame_type					      = "FDD";	
+                           tdd_config 					      = 3;
+                           tdd_config_s            			      = 0;
+ 			   prefix_type             			      = "NORMAL";
+  			   eutra_band              			      = 7;
+                           downlink_frequency      			      = 751000000L;
+                           uplink_frequency_offset 			      = 30000000;
+  			   Nid_cell					      = 0;
+                           N_RB_DL                 			      = 50;
+                           Nid_cell_mbsfn          			      = 0;
+                           nb_antennas_tx          			      = 1;
+                           nb_antennas_rx          			      = 1; 
+			   tx_gain                                            = 60;
+			   rx_gain                                            = 111;
+                           prach_root              			      = 0;
+                           prach_config_index      			      = 0;
+                           prach_high_speed        			      = "DISABLE";
+  	                   prach_zero_correlation  			      = 1;
+                           prach_freq_offset       			      = 2;
+			   pucch_delta_shift       			      = 1;
+                           pucch_nRB_CQI           			      = 1;
+                           pucch_nCS_AN            			      = 0;
+                           pucch_n1_AN             			      = 32;
+                           pdsch_referenceSignalPower 			      = -29;
+                           pdsch_p_b                  			      = 0;
+                           pusch_n_SB                 			      = 1; 
+                           pusch_enable64QAM          			      = "DISABLE";
+			   pusch_hoppingMode                                  = "interSubFrame";
+			   pusch_hoppingOffset                                = 0;
+     	                   pusch_groupHoppingEnabled  			      = "ENABLE";
+	                   pusch_groupAssignment      			      = 0;
+	                   pusch_sequenceHoppingEnabled		   	      = "DISABLE";
+	                   pusch_nDMRS1                                       = 1;
+	                   phich_duration                                     = "NORMAL";
+	                   phich_resource                                     = "ONESIXTH";
+	                   srs_enable                                         = "DISABLE";
+	               /*  srs_BandwidthConfig                                =;
+	                   srs_SubframeConfig                                 =;
+	                   srs_ackNackST                                      =;
+	                   srs_MaxUpPts                                       =;*/  
+
+	                   pusch_p0_Nominal                                   = -85; 
+	                   pusch_alpha                                        = "AL1";
+	                   pucch_p0_Nominal                                   = -96;
+	                   msg3_delta_Preamble                                = 6;
+	                   pucch_deltaF_Format1                               = "deltaF2";
+	                   pucch_deltaF_Format1b                              = "deltaF3";
+	                   pucch_deltaF_Format2                               = "deltaF0";
+	                   pucch_deltaF_Format2a                              = "deltaF0";
+  	                   pucch_deltaF_Format2b		    	      = "deltaF0";
+	
+                           rach_numberOfRA_Preambles                          = 64;
+                           rach_preamblesGroupAConfig                         = "DISABLE";
+/*
+                           rach_sizeOfRA_PreamblesGroupA                      = ;
+                           rach_messageSizeGroupA                             = ;
+                           rach_messagePowerOffsetGroupB                      = ; 
+*/
+                           rach_powerRampingStep                              = 4;
+	                   rach_preambleInitialReceivedTargetPower            = -100;
+                           rach_preambleTransMax                              = 10;
+	                   rach_raResponseWindowSize                          = 10;
+	                   rach_macContentionResolutionTimer                  = 48;
+	                   rach_maxHARQ_Msg3Tx                                = 4;
+
+			   pcch_default_PagingCycle                           = 128;
+			   pcch_nB                                            = "oneT";
+			   bcch_modificationPeriodCoeff			      = 2;
+			   ue_TimersAndConstants_t300			      = 1000;
+			   ue_TimersAndConstants_t301			      = 1000;
+			   ue_TimersAndConstants_t310			      = 1000;
+			   ue_TimersAndConstants_t311			      = 10000;
+			   ue_TimersAndConstants_n310			      = 20;
+			   ue_TimersAndConstants_n311			      = 1;
+
+			 }
+			 );
+
+
+    srb1_parameters :
+    {
+        # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] 
+        timer_poll_retransmit    = 80;
+        
+        # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
+        timer_reordering         = 35;
+        
+        # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
+        timer_status_prohibit    = 0;
+        
+        # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
+        poll_pdu                 =  4;
+        
+        # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
+        poll_byte                =  99999;
+        
+        # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
+        max_retx_threshold       =  4;
+    }
+    
+    # ------- SCTP definitions
+    SCTP :
+    {
+        # Number of streams to use in input/output
+        SCTP_INSTREAMS  = 2;
+        SCTP_OUTSTREAMS = 2;
+    };
+        
+    ////////// MME parameters:
+    mme_ip_address      = ( { ipv4       = "192.168.12.11";
+                              ipv6       = "192:168:30::17";
+                              active     = "yes";
+                              preference = "ipv4";
+                            }
+                          );
+
+    NETWORK_INTERFACES : 
+    {
+        ENB_INTERFACE_NAME_FOR_S1_MME            = "eth0";
+        ENB_IPV4_ADDRESS_FOR_S1_MME              = "192.168.12.215/24";
+
+        ENB_INTERFACE_NAME_FOR_S1U               = "eth0";
+        ENB_IPV4_ADDRESS_FOR_S1U                 = "192.168.12.215/24";
+        ENB_PORT_FOR_S1U                         = 2152; # Spec 2152
+    };
+    
+    log_config : 
+    {
+	global_log_level                      ="info"; 
+    	global_log_verbosity                  ="medium";
+	hw_log_level                          ="info"; 
+    	hw_log_verbosity                      ="medium";
+	phy_log_level                         ="info"; 
+    	phy_log_verbosity                     ="medium";
+	mac_log_level                         ="info"; 
+    	mac_log_verbosity                     ="high";
+	rlc_log_level                         ="info"; 
+    	rlc_log_verbosity                     ="medium";
+	pdcp_log_level                        ="info"; 
+    	pdcp_log_verbosity                    ="medium";
+	rrc_log_level                         ="info"; 
+    	rrc_log_verbosity                     ="medium";
+   };	
+   
+  }
+);
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.lmssdr.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.lmssdr.conf
new file mode 100644
index 0000000000000000000000000000000000000000..266e5aae25bb3281f27ef9d074d7ede2a31bc98a
--- /dev/null
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.lmssdr.conf
@@ -0,0 +1,171 @@
+Active_eNBs = ( "eNB_Eurecom_LTEBox");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+
+eNBs =
+(
+ {
+    ////////// Identification parameters:
+    eNB_ID    =  0xe00;
+
+    cell_type =  "CELL_MACRO_ENB";
+
+    eNB_name  =  "eNB_Eurecom_LTEBox";
+
+    // Tracking area code, 0x0000 and 0xfffe are reserved values
+    tracking_area_code  =  "1";
+
+    mobile_country_code =  "208";
+
+    mobile_network_code =  "93";
+
+       ////////// Physical parameters:
+
+    component_carriers = (
+      {
+      frame_type					      = "FDD";
+      tdd_config 					      = 3;
+      tdd_config_s            			      = 0;
+      prefix_type             			      = "NORMAL";
+      eutra_band              			      = 13;
+      downlink_frequency      			      = 751000000L;
+      uplink_frequency_offset 			      = 31000000;
+      Nid_cell					      = 0;
+      N_RB_DL                 			      = 25;
+      Nid_cell_mbsfn          			      = 0;
+      nb_antennas_tx          			      = 1;
+      nb_antennas_rx          			      = 1;
+      tx_gain                                            = 90;
+      rx_gain                                            = 107;
+      prach_root              			      = 0;
+      prach_config_index      			      = 0;
+      prach_high_speed        			      = "DISABLE";
+      prach_zero_correlation  			      = 1;
+      prach_freq_offset       			      = 2;
+      pucch_delta_shift       			      = 1;
+      pucch_nRB_CQI           			      = 1;
+      pucch_nCS_AN            			      = 0;
+      pucch_n1_AN             			      = 32;
+      pdsch_referenceSignalPower 			      = -17;
+      pdsch_p_b                  			      = 0;
+      pusch_n_SB                 			      = 1;
+      pusch_enable64QAM          			      = "DISABLE";
+      pusch_hoppingMode                                  = "interSubFrame";
+      pusch_hoppingOffset                                = 0;
+      pusch_groupHoppingEnabled  			      = "ENABLE";
+      pusch_groupAssignment      			      = 0;
+      pusch_sequenceHoppingEnabled		   	      = "DISABLE";
+      pusch_nDMRS1                                       = 1;
+      phich_duration                                     = "NORMAL";
+      phich_resource                                     = "ONESIXTH";
+      srs_enable                                         = "DISABLE";
+      /*  srs_BandwidthConfig                                =;
+      srs_SubframeConfig                                 =;
+      srs_ackNackST                                      =;
+      srs_MaxUpPts                                       =;*/
+
+      pusch_p0_Nominal                                   = -90;
+      pusch_alpha                                        = "AL1";
+      pucch_p0_Nominal                                   = -96;
+      msg3_delta_Preamble                                = 6;
+      pucch_deltaF_Format1                               = "deltaF2";
+      pucch_deltaF_Format1b                              = "deltaF3";
+      pucch_deltaF_Format2                               = "deltaF0";
+      pucch_deltaF_Format2a                              = "deltaF0";
+      pucch_deltaF_Format2b		    	      = "deltaF0";
+
+      rach_numberOfRA_Preambles                          = 64;
+      rach_preamblesGroupAConfig                         = "DISABLE";
+      /*
+      rach_sizeOfRA_PreamblesGroupA                      = ;
+      rach_messageSizeGroupA                             = ;
+      rach_messagePowerOffsetGroupB                      = ;
+      */
+      rach_powerRampingStep                              = 4;
+      rach_preambleInitialReceivedTargetPower            = -108;
+      rach_preambleTransMax                              = 10;
+      rach_raResponseWindowSize                          = 10;
+      rach_macContentionResolutionTimer                  = 48;
+      rach_maxHARQ_Msg3Tx                                = 4;
+
+      pcch_default_PagingCycle                           = 128;
+      pcch_nB                                            = "oneT";
+      bcch_modificationPeriodCoeff			      = 2;
+      ue_TimersAndConstants_t300			      = 1000;
+      ue_TimersAndConstants_t301			      = 1000;
+      ue_TimersAndConstants_t310			      = 1000;
+      ue_TimersAndConstants_t311			      = 10000;
+      ue_TimersAndConstants_n310			      = 20;
+      ue_TimersAndConstants_n311			      = 1;
+
+      }
+    );
+
+
+    srb1_parameters :
+    {
+        # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
+        timer_poll_retransmit    = 80;
+
+        # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
+        timer_reordering         = 35;
+
+        # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
+        timer_status_prohibit    = 0;
+
+        # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
+        poll_pdu                 =  4;
+
+        # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
+        poll_byte                =  99999;
+
+        # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
+        max_retx_threshold       =  4;
+    }
+
+    # ------- SCTP definitions
+    SCTP :
+    {
+        # Number of streams to use in input/output
+        SCTP_INSTREAMS  = 2;
+        SCTP_OUTSTREAMS = 2;
+    };
+
+
+    ////////// MME parameters:
+    mme_ip_address      = ( { ipv4       = "192.168.12.11";
+                              ipv6       = "192:168:30::17";
+                              active     = "yes";
+                              preference = "ipv4";
+                            }
+                          );
+
+    NETWORK_INTERFACES :
+    {
+        ENB_INTERFACE_NAME_FOR_S1_MME            = "eth0";
+        ENB_IPV4_ADDRESS_FOR_S1_MME              = "192.168.12.212/24";
+
+        ENB_INTERFACE_NAME_FOR_S1U               = "eth0";
+        ENB_IPV4_ADDRESS_FOR_S1U                 = "192.168.12.212/24";
+        ENB_PORT_FOR_S1U                         = 2152; # Spec 2152
+    };
+
+    log_config :
+    {
+      global_log_level                      ="info";
+      global_log_verbosity                  ="medium";
+      hw_log_level                          ="info";
+      hw_log_verbosity                      ="medium";
+      phy_log_level                         ="info";
+      phy_log_verbosity                     ="medium";
+      mac_log_level                         ="info";
+      mac_log_verbosity                     ="high";
+      rlc_log_level                         ="info";
+      rlc_log_verbosity                     ="medium";
+      pdcp_log_level                        ="info";
+      pdcp_log_verbosity                    ="medium";
+      rrc_log_level                         ="info";
+      rrc_log_verbosity                     ="medium";
+   };
+  }
+);
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.rrh.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.rrh.usrpb210.conf
new file mode 100644
index 0000000000000000000000000000000000000000..98226144ab062cbef4a3b0835b524d7cea58a765
--- /dev/null
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.rrh.usrpb210.conf
@@ -0,0 +1,190 @@
+Active_eNBs = ( "eNB_Eurecom_LTEBox");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+
+eNBs =
+(
+ {
+    ////////// Identification parameters:
+    eNB_ID    =  0xe00;
+
+    cell_type =  "CELL_MACRO_ENB";
+
+    eNB_name  =  "eNB_Eurecom_LTEBox";
+
+    // Tracking area code, 0x0000 and 0xfffe are reserved values
+    tracking_area_code  =  "1";
+
+    mobile_country_code =  "208";
+
+    mobile_network_code =  "95";
+
+       ////////// Physical parameters:
+
+    component_carriers = (
+      {
+      frame_type					      = "FDD";
+      tdd_config 					      = 3;
+      tdd_config_s            			      = 0;
+      prefix_type             			      = "NORMAL";
+      eutra_band              			      = 13;
+      downlink_frequency      			      = 751000000L;
+      uplink_frequency_offset 			      = 31000000;
+      Nid_cell					      = 0;
+      N_RB_DL                 			      = 25;
+      Nid_cell_mbsfn          			      = 0;
+      nb_antennas_tx          			      = 1;
+      nb_antennas_rx          			      = 1;
+      tx_gain                                            = 90;
+      rx_gain                                            = 100;
+      prach_root              			      = 0;
+      prach_config_index      			      = 0;
+      prach_high_speed        			      = "DISABLE";
+      prach_zero_correlation  			      = 1;
+      prach_freq_offset       			      = 2;
+      pucch_delta_shift       			      = 1;
+      pucch_nRB_CQI           			      = 1;
+      pucch_nCS_AN            			      = 0;
+      pucch_n1_AN             			      = 32;
+      pdsch_referenceSignalPower 			      = -15;
+      pdsch_p_b                  			      = 0;
+      pusch_n_SB                 			      = 1;
+      pusch_enable64QAM          			      = "DISABLE";
+      pusch_hoppingMode                                  = "interSubFrame";
+      pusch_hoppingOffset                                = 0;
+      pusch_groupHoppingEnabled  			      = "ENABLE";
+      pusch_groupAssignment      			      = 0;
+      pusch_sequenceHoppingEnabled		   	      = "DISABLE";
+      pusch_nDMRS1                                       = 1;
+      phich_duration                                     = "NORMAL";
+      phich_resource                                     = "ONESIXTH";
+      srs_enable                                         = "DISABLE";
+      /*  srs_BandwidthConfig                                =;
+      srs_SubframeConfig                                 =;
+      srs_ackNackST                                      =;
+      srs_MaxUpPts                                       =;*/
+
+      pusch_p0_Nominal                                   = -86;
+      pusch_alpha                                        = "AL1";
+      pucch_p0_Nominal                                   = -96;
+      msg3_delta_Preamble                                = 6;
+      pucch_deltaF_Format1                               = "deltaF2";
+      pucch_deltaF_Format1b                              = "deltaF3";
+      pucch_deltaF_Format2                               = "deltaF0";
+      pucch_deltaF_Format2a                              = "deltaF0";
+      pucch_deltaF_Format2b		    	      = "deltaF0";
+
+      rach_numberOfRA_Preambles                          = 64;
+      rach_preamblesGroupAConfig                         = "DISABLE";
+      /*
+      rach_sizeOfRA_PreamblesGroupA                      = ;
+      rach_messageSizeGroupA                             = ;
+      rach_messagePowerOffsetGroupB                      = ;
+      */
+      rach_powerRampingStep                              = 4;
+      rach_preambleInitialReceivedTargetPower            = -108;
+      rach_preambleTransMax                              = 10;
+      rach_raResponseWindowSize                          = 10;
+      rach_macContentionResolutionTimer                  = 48;
+      rach_maxHARQ_Msg3Tx                                = 4;
+
+      pcch_default_PagingCycle                           = 128;
+      pcch_nB                                            = "oneT";
+      bcch_modificationPeriodCoeff			      = 2;
+      ue_TimersAndConstants_t300			      = 1000;
+      ue_TimersAndConstants_t301			      = 1000;
+      ue_TimersAndConstants_t310			      = 1000;
+      ue_TimersAndConstants_t311			      = 10000;
+      ue_TimersAndConstants_n310			      = 20;
+      ue_TimersAndConstants_n311			      = 1;
+
+      }
+    );
+
+
+    srb1_parameters :
+    {
+        # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
+        timer_poll_retransmit    = 80;
+
+        # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
+        timer_reordering         = 35;
+
+        # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
+        timer_status_prohibit    = 0;
+
+        # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
+        poll_pdu                 =  4;
+
+        # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
+        poll_byte                =  99999;
+
+        # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
+        max_retx_threshold       =  4;
+    }
+
+    # ------- SCTP definitions
+    SCTP :
+    {
+        # Number of streams to use in input/output
+        SCTP_INSTREAMS  = 2;
+        SCTP_OUTSTREAMS = 2;
+    };
+
+
+    ////////// MME parameters:
+    mme_ip_address      = ( { ipv4       = "192.168.12.62";
+                              ipv6       = "192:168:30::17";
+                              active     = "yes";
+                              preference = "ipv4";
+                            }
+                          );
+
+rrh_gw_config = (
+ {			  
+    local_if_name = "eth0";			  
+    #remote_address = "169.254.10.158";	
+    #local_address = "169.254.8.15";				  
+    remote_address = "74:d4:35:cc:88:45";
+    local_address = "98:90:96:df:66:07";    
+    local_port = 50000;	#for raw option local port must be the same to remote	       
+    remote_port = 50000; 
+    rrh_gw_active = "yes";
+    tr_preference = "raw";
+    rf_preference = "usrp_b200";
+    iq_txshift = 5;
+    tx_sample_advance = 70;	
+    tx_scheduling_advance = 9; 	                
+                             
+}
+);  
+
+    NETWORK_INTERFACES :
+    {
+        ENB_INTERFACE_NAME_FOR_S1_MME            = "eth4";
+        ENB_IPV4_ADDRESS_FOR_S1_MME              = "192.168.12.242/24";
+
+        ENB_INTERFACE_NAME_FOR_S1U               = "eth4";
+        ENB_IPV4_ADDRESS_FOR_S1U                 = "192.168.12.242/24";
+        ENB_PORT_FOR_S1U                         = 2152; # Spec 2152
+    };
+
+    log_config :
+    {
+      global_log_level                      ="info";
+      global_log_verbosity                  ="medium";
+      hw_log_level                          ="info";
+      hw_log_verbosity                      ="medium";
+      phy_log_level                         ="info";
+      phy_log_verbosity                     ="medium";
+      mac_log_level                         ="info";
+      mac_log_verbosity                     ="high";
+      rlc_log_level                         ="info";
+      rlc_log_verbosity                     ="medium";
+      pdcp_log_level                        ="info";
+      pdcp_log_verbosity                    ="medium";
+      rrc_log_level                         ="info";
+      rrc_log_verbosity                     ="medium";
+   };
+  }
+);
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.usrpb210.conf
new file mode 100644
index 0000000000000000000000000000000000000000..1bf3c6fbf29d6e4edab9162ee392857eee526f7f
--- /dev/null
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.usrpb210.conf
@@ -0,0 +1,171 @@
+Active_eNBs = ( "eNB_Eurecom_LTEBox");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+
+eNBs =
+(
+ {
+    ////////// Identification parameters:
+    eNB_ID    =  0xe00;
+
+    cell_type =  "CELL_MACRO_ENB";
+
+    eNB_name  =  "eNB_Eurecom_LTEBox";
+
+    // Tracking area code, 0x0000 and 0xfffe are reserved values
+    tracking_area_code  =  "1";
+
+    mobile_country_code =  "208";
+
+    mobile_network_code =  "95";
+
+       ////////// Physical parameters:
+
+    component_carriers = (
+      {
+      frame_type					      = "FDD";
+      tdd_config 					      = 3;
+      tdd_config_s            			      = 0;
+      prefix_type             			      = "NORMAL";
+      eutra_band              			      = 13;
+      downlink_frequency      			      = 751000000L;
+      uplink_frequency_offset 			      = 31000000;
+      Nid_cell					      = 0;
+      N_RB_DL                 			      = 50;
+      Nid_cell_mbsfn          			      = 0;
+      nb_antennas_tx          			      = 1;
+      nb_antennas_rx          			      = 1;
+      tx_gain                                            = 90;
+      rx_gain                                            = 110;
+      prach_root              			      = 0;
+      prach_config_index      			      = 0;
+      prach_high_speed        			      = "DISABLE";
+      prach_zero_correlation  			      = 1;
+      prach_freq_offset       			      = 2;
+      pucch_delta_shift       			      = 1;
+      pucch_nRB_CQI           			      = 1;
+      pucch_nCS_AN            			      = 0;
+      pucch_n1_AN             			      = 32;
+      pdsch_referenceSignalPower 			      = -15;
+      pdsch_p_b                  			      = 0;
+      pusch_n_SB                 			      = 1;
+      pusch_enable64QAM          			      = "DISABLE";
+      pusch_hoppingMode                                  = "interSubFrame";
+      pusch_hoppingOffset                                = 0;
+      pusch_groupHoppingEnabled  			      = "ENABLE";
+      pusch_groupAssignment      			      = 0;
+      pusch_sequenceHoppingEnabled		   	      = "DISABLE";
+      pusch_nDMRS1                                       = 1;
+      phich_duration                                     = "NORMAL";
+      phich_resource                                     = "ONESIXTH";
+      srs_enable                                         = "DISABLE";
+      /*  srs_BandwidthConfig                                =;
+      srs_SubframeConfig                                 =;
+      srs_ackNackST                                      =;
+      srs_MaxUpPts                                       =;*/
+
+      pusch_p0_Nominal                                   = -90;
+      pusch_alpha                                        = "AL1";
+      pucch_p0_Nominal                                   = -96;
+      msg3_delta_Preamble                                = 6;
+      pucch_deltaF_Format1                               = "deltaF2";
+      pucch_deltaF_Format1b                              = "deltaF3";
+      pucch_deltaF_Format2                               = "deltaF0";
+      pucch_deltaF_Format2a                              = "deltaF0";
+      pucch_deltaF_Format2b		    	      = "deltaF0";
+
+      rach_numberOfRA_Preambles                          = 64;
+      rach_preamblesGroupAConfig                         = "DISABLE";
+      /*
+      rach_sizeOfRA_PreamblesGroupA                      = ;
+      rach_messageSizeGroupA                             = ;
+      rach_messagePowerOffsetGroupB                      = ;
+      */
+      rach_powerRampingStep                              = 4;
+      rach_preambleInitialReceivedTargetPower            = -100;
+      rach_preambleTransMax                              = 10;
+      rach_raResponseWindowSize                          = 10;
+      rach_macContentionResolutionTimer                  = 48;
+      rach_maxHARQ_Msg3Tx                                = 4;
+
+      pcch_default_PagingCycle                           = 128;
+      pcch_nB                                            = "oneT";
+      bcch_modificationPeriodCoeff			      = 2;
+      ue_TimersAndConstants_t300			      = 1000;
+      ue_TimersAndConstants_t301			      = 1000;
+      ue_TimersAndConstants_t310			      = 1000;
+      ue_TimersAndConstants_t311			      = 10000;
+      ue_TimersAndConstants_n310			      = 20;
+      ue_TimersAndConstants_n311			      = 1;
+
+      }
+    );
+
+
+    srb1_parameters :
+    {
+        # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
+        timer_poll_retransmit    = 80;
+
+        # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
+        timer_reordering         = 35;
+
+        # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
+        timer_status_prohibit    = 0;
+
+        # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
+        poll_pdu                 =  4;
+
+        # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
+        poll_byte                =  99999;
+
+        # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
+        max_retx_threshold       =  4;
+    }
+
+    # ------- SCTP definitions
+    SCTP :
+    {
+        # Number of streams to use in input/output
+        SCTP_INSTREAMS  = 2;
+        SCTP_OUTSTREAMS = 2;
+    };
+
+
+    ////////// MME parameters:
+    mme_ip_address      = ( { ipv4       = "172.27.8.52";
+                              ipv6       = "192:168:30::17";
+                              active     = "yes";
+                              preference = "ipv4";
+                            }
+                          );
+
+    NETWORK_INTERFACES :
+    {
+        ENB_INTERFACE_NAME_FOR_S1_MME            = "eth0";
+        ENB_IPV4_ADDRESS_FOR_S1_MME              = "172.27.8.51/23";
+
+        ENB_INTERFACE_NAME_FOR_S1U               = "eth0";
+        ENB_IPV4_ADDRESS_FOR_S1U                 = "172.27.8.51/23";
+        ENB_PORT_FOR_S1U                         = 2152; # Spec 2152
+    };
+
+    log_config :
+    {
+      global_log_level                      ="info";
+      global_log_verbosity                  ="medium";
+      hw_log_level                          ="info";
+      hw_log_verbosity                      ="medium";
+      phy_log_level                         ="info";
+      phy_log_verbosity                     ="medium";
+      mac_log_level                         ="info";
+      mac_log_verbosity                     ="high";
+      rlc_log_level                         ="info";
+      rlc_log_verbosity                     ="medium";
+      pdcp_log_level                        ="info";
+      pdcp_log_verbosity                    ="medium";
+      rrc_log_level                         ="info";
+      rrc_log_verbosity                     ="medium";
+   };
+  }
+);
\ No newline at end of file
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band3.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band3.tm1.usrpb210.conf
index 1a383524099db3e01af7fe4aeca09b193889c2d9..0a6def775741f7203b9e7110d6f10f220f9357b8 100644
--- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band3.tm1.usrpb210.conf
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band3.tm1.usrpb210.conf
@@ -17,7 +17,7 @@ eNBs =
 
     mobile_country_code =  "208";
 
-    mobile_network_code =  "92";
+    mobile_network_code =  "93";
 
        ////////// Physical parameters:
 
@@ -36,7 +36,7 @@ eNBs =
         nb_antennas_tx          			      = 1;
         nb_antennas_rx          			      = 1;
         tx_gain                                            = 90;
-        rx_gain                                            = 135;
+        rx_gain                                            = 125;
         prach_root              			      = 0;
         prach_config_index      			      = 0;
         prach_high_speed        			      = "DISABLE";
@@ -131,7 +131,7 @@ eNBs =
     };
 
     ////////// MME parameters:
-    mme_ip_address      = ( { ipv4       = "192.168.13.11";
+    mme_ip_address      = ( { ipv4       = "192.168.12.11";
                               ipv6       = "192:168:30::17";
                               active     = "yes";
                               preference = "ipv4";
@@ -141,10 +141,10 @@ eNBs =
     NETWORK_INTERFACES :
     {
         ENB_INTERFACE_NAME_FOR_S1_MME            = "eth0";
-        ENB_IPV4_ADDRESS_FOR_S1_MME              = "192.168.13.10/24";
+        ENB_IPV4_ADDRESS_FOR_S1_MME              = "192.168.12.215/24";
 
         ENB_INTERFACE_NAME_FOR_S1U               = "eth0";
-        ENB_IPV4_ADDRESS_FOR_S1U                 = "192.168.13.10/24";
+        ENB_IPV4_ADDRESS_FOR_S1U                 = "192.168.12.215/24";
         ENB_PORT_FOR_S1U                         = 2152; # Spec 2152
     };
 
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.generic.oaisim.local_no_mme.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.generic.oaisim.local_no_mme.conf
new file mode 100644
index 0000000000000000000000000000000000000000..ae989b5c8d8f5d00c0fe006a2659ac35e3feea9c
--- /dev/null
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band38.generic.oaisim.local_no_mme.conf
@@ -0,0 +1,146 @@
+Active_eNBs = ( "eNB_Eurecom_LTEBox");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+
+eNBs =
+(
+ {
+    ////////// Identification parameters:
+    eNB_ID    =  0xe00;
+
+    cell_type =  "CELL_MACRO_ENB";
+
+    eNB_name  =  "eNB_Eurecom_LTEBox";
+
+    // Tracking area code, 0x0000 and 0xfffe are reserved values
+    tracking_area_code  =  "1";
+
+    mobile_country_code =  "208";
+
+    mobile_network_code =  "10";
+
+       ////////// Physical parameters:
+
+    component_carriers = (
+      {
+        frame_type					      = "TDD";
+        tdd_config 					      = 3;
+        tdd_config_s            			      = 0;
+        prefix_type             			      = "NORMAL";
+        eutra_band              			      = 38;
+        downlink_frequency      			      = 2580000000L;
+        uplink_frequency_offset 			      = 0;
+        Nid_cell					      = 0;
+        N_RB_DL                 			      = 25;
+        Nid_cell_mbsfn          			      = 0;
+        nb_antennas_tx          			      = 1;
+        nb_antennas_rx          			      = 1;
+        tx_gain                                               = 25;
+        rx_gain                                               = 20;
+        prach_root              			      = 0;
+        prach_config_index      			      = 0;
+        prach_high_speed        			      = "DISABLE";
+        prach_zero_correlation  			      = 1;
+        prach_freq_offset       			      = 2;
+        pucch_delta_shift       			      = 1;
+        pucch_nRB_CQI           			      = 1;
+        pucch_nCS_AN            			      = 0;
+        pucch_n1_AN             			      = 32;
+        pdsch_referenceSignalPower 			      = 0;
+        pdsch_p_b                  			      = 0;
+        pusch_n_SB                 			      = 1;
+        pusch_enable64QAM          			      = "DISABLE";
+        pusch_hoppingMode                                     = "interSubFrame";
+        pusch_hoppingOffset                                   = 0;
+        pusch_groupHoppingEnabled  			      = "ENABLE";
+        pusch_groupAssignment      			      = 0;
+        pusch_sequenceHoppingEnabled		   	  = "DISABLE";
+        pusch_nDMRS1                              = 0;
+        phich_duration                            = "NORMAL";
+        phich_resource                            = "ONESIXTH";
+        srs_enable                                = "DISABLE";
+        /*  srs_BandwidthConfig                   =;
+        srs_SubframeConfig                        =;
+        srs_ackNackST                             =;
+        srs_MaxUpPts                              =;*/
+
+        pusch_p0_Nominal                          = -108;
+        pusch_alpha                               = "AL1";
+        pucch_p0_Nominal                          = -108;
+        msg3_delta_Preamble                       = 6;
+        pucch_deltaF_Format1                      = "deltaF2";
+        pucch_deltaF_Format1b                     = "deltaF3";
+        pucch_deltaF_Format2                      = "deltaF0";
+        pucch_deltaF_Format2a                     = "deltaF0";
+        pucch_deltaF_Format2b		    	      = "deltaF0";
+
+        rach_numberOfRA_Preambles                 = 64;
+        rach_preamblesGroupAConfig                = "DISABLE";
+        /*
+        rach_sizeOfRA_PreamblesGroupA             = ;
+        rach_messageSizeGroupA                    = ;
+        rach_messagePowerOffsetGroupB             = ;
+        */
+        rach_powerRampingStep                     = 2;
+        rach_preambleInitialReceivedTargetPower   = -100;
+        rach_preambleTransMax                     = 10;
+        rach_raResponseWindowSize                 = 10;
+        rach_macContentionResolutionTimer         = 48;
+        rach_maxHARQ_Msg3Tx                       = 4;
+
+        pcch_default_PagingCycle                  = 128;
+        pcch_nB                                   = "oneT";
+        bcch_modificationPeriodCoeff			  = 2;
+        ue_TimersAndConstants_t300			      = 1000;
+        ue_TimersAndConstants_t301			      = 1000;
+        ue_TimersAndConstants_t310			      = 1000;
+        ue_TimersAndConstants_t311			      = 10000;
+        ue_TimersAndConstants_n310			      = 20;
+        ue_TimersAndConstants_n311			      = 1;
+      }
+    );
+
+    ////////// MME parameters:
+    mme_ip_address      = ( { ipv4       = "0.0.0.0";
+                              ipv6       = "0::0";
+                              active     = "yes";
+                              preference = "ipv4";
+                            }
+                          );
+
+    NETWORK_INTERFACES :
+    {
+        ENB_INTERFACE_NAME_FOR_S1_MME            = "none";
+        ENB_IPV4_ADDRESS_FOR_S1_MME              = "0.0.0.0/24";
+
+        ENB_INTERFACE_NAME_FOR_S1U               = "none";
+        ENB_IPV4_ADDRESS_FOR_S1U                 = "0.0.0.0/24";
+        ENB_PORT_FOR_S1U                         = 2153; # Spec 2152
+    };
+
+    log_config :
+    {
+      global_log_level                      ="trace";
+      global_log_verbosity                  ="medium";
+      hw_log_level                          ="info";
+      hw_log_verbosity                      ="medium";
+      phy_log_level                         ="trace";
+      phy_log_verbosity                     ="medium";
+      mac_log_level                         ="trace";
+      mac_log_verbosity                     ="medium";
+      rlc_log_level                         ="trace";
+      rlc_log_verbosity                     ="medium";
+      pdcp_log_level                        ="trace";
+      pdcp_log_verbosity                    ="medium";
+      rrc_log_level                         ="trace";
+      rrc_log_verbosity                     ="medium";
+      gtpu_log_level                        ="debug";
+      gtpu_log_verbosity                    ="medium";
+      udp_log_level                         ="debug";
+      udp_log_verbosity                     ="medium";
+      osa_log_level                         ="debug";
+      osa_log_verbosity                     ="low";
+   };
+
+  }
+);
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band4.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band4.tm1.usrpb210.conf
index ee4700c771fd8343246cf7f4b7ebfce230736585..853db14393ea2a084eb42866cdb26beb13ac9e14 100644
--- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band4.tm1.usrpb210.conf
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band4.tm1.usrpb210.conf
@@ -17,7 +17,7 @@ eNBs =
 
     mobile_country_code =  "208";
 
-    mobile_network_code =  "92";
+    mobile_network_code =  "93";
 
        ////////// Physical parameters:
 
@@ -36,7 +36,7 @@ eNBs =
         nb_antennas_tx          			      = 1;
         nb_antennas_rx          			      = 1;
         tx_gain                                            = 90;
-        rx_gain                                            = 120;
+        rx_gain                                            = 128;
         prach_root              			      = 0;
         prach_config_index      			      = 0;
         prach_high_speed        			      = "DISABLE";
@@ -66,7 +66,7 @@ eNBs =
 
         pusch_p0_Nominal                                   = -90;
         pusch_alpha                                        = "AL1";
-        pucch_p0_Nominal                                   = -108;
+        pucch_p0_Nominal                                   = -96;
         msg3_delta_Preamble                                = 6;
         pucch_deltaF_Format1                               = "deltaF2";
         pucch_deltaF_Format1b                              = "deltaF3";
@@ -131,7 +131,7 @@ eNBs =
     };
 
     ////////// MME parameters:
-    mme_ip_address      = ( { ipv4       = "192.168.13.11";
+    mme_ip_address      = ( { ipv4       = "192.168.12.11";
                               ipv6       = "192:168:30::17";
                               active     = "yes";
                               preference = "ipv4";
@@ -141,10 +141,10 @@ eNBs =
     NETWORK_INTERFACES :
     {
       ENB_INTERFACE_NAME_FOR_S1_MME            = "eth0";
-      ENB_IPV4_ADDRESS_FOR_S1_MME              = "192.168.13.10/24";
+      ENB_IPV4_ADDRESS_FOR_S1_MME              = "192.168.12.215/24";
 
       ENB_INTERFACE_NAME_FOR_S1U               = "eth0";
-      ENB_IPV4_ADDRESS_FOR_S1U                 = "192.168.13.10/24";
+      ENB_IPV4_ADDRESS_FOR_S1U                 = "192.168.12.215/24";
       ENB_PORT_FOR_S1U                         = 2152; # Spec 2152
     };
 
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf
index 1d47abdd60841208eded5833d54685844981c5f1..7d34889f6787782594f69f2398c58c0f39f39633 100644
--- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf
@@ -17,7 +17,7 @@ eNBs =
 
     mobile_country_code =  "208";
 
-    mobile_network_code =  "92";
+    mobile_network_code =  "93";
 
        ////////// Physical parameters:
 
@@ -28,7 +28,7 @@ eNBs =
         tdd_config_s            			      = 0;
         prefix_type             			      = "NORMAL";
         eutra_band              			      = 7;
-        downlink_frequency      			      = 2660000000L;
+        downlink_frequency      			      = 2680000000L;
         uplink_frequency_offset 			      = -120000000;
         Nid_cell					      = 0;
         N_RB_DL                 			      = 100;
@@ -36,7 +36,7 @@ eNBs =
         nb_antennas_tx          			      = 1;
         nb_antennas_rx          			      = 1;
         tx_gain                                            = 90;
-        rx_gain                                            = 120;
+        rx_gain                                            = 125;
         prach_root              			      = 0;
         prach_config_index      			      = 0;
         prach_high_speed        			      = "DISABLE";
@@ -66,7 +66,7 @@ eNBs =
 
         pusch_p0_Nominal                                   = -90;
         pusch_alpha                                        = "AL1";
-        pucch_p0_Nominal                                   = -108;
+        pucch_p0_Nominal                                   = -100;
         msg3_delta_Preamble                                = 6;
         pucch_deltaF_Format1                               = "deltaF2";
         pucch_deltaF_Format1b                              = "deltaF3";
@@ -130,7 +130,7 @@ eNBs =
     };
 
     ////////// MME parameters:
-    mme_ip_address      = ( { ipv4       = "192.168.13.11";
+    mme_ip_address      = ( { ipv4       = "192.168.12.11";
                               ipv6       = "192:168:30::17";
                               active     = "yes";
                               preference = "ipv4";
@@ -140,10 +140,10 @@ eNBs =
     NETWORK_INTERFACES :
     {
         ENB_INTERFACE_NAME_FOR_S1_MME            = "eth0";
-        ENB_IPV4_ADDRESS_FOR_S1_MME              = "192.168.13.10/24";
+        ENB_IPV4_ADDRESS_FOR_S1_MME              = "192.168.12.215/24";
 
         ENB_INTERFACE_NAME_FOR_S1U               = "eth0";
-        ENB_IPV4_ADDRESS_FOR_S1U                 = "192.168.13.10/24";
+        ENB_IPV4_ADDRESS_FOR_S1U                 = "192.168.12.215/24";
         ENB_PORT_FOR_S1U                         = 2152; # Spec 2152
     };
 
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.bladerfx40.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.bladerfx40.conf
new file mode 100644
index 0000000000000000000000000000000000000000..eb3895dc6d60a82465550128a353274cfb00595e
--- /dev/null
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.bladerfx40.conf
@@ -0,0 +1,171 @@
+Active_eNBs = ( "eNB_Eurecom_LTEBox");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+
+eNBs =
+(
+ {
+    ////////// Identification parameters:
+    eNB_ID    =  0xe00;
+    
+    cell_type =  "CELL_MACRO_ENB";
+    
+    eNB_name  =  "eNB_Eurecom_LTEBox";
+    
+    // Tracking area code, 0x0000 and 0xfffe are reserved values
+    tracking_area_code  =  "1";
+    
+    mobile_country_code =  "208";
+    
+    mobile_network_code =  "93";
+    
+       ////////// Physical parameters:
+  
+    component_carriers = (
+    		       	 {
+  			   frame_type					      = "FDD";	
+                           tdd_config 					      = 3;
+                           tdd_config_s            			      = 0;
+ 			   prefix_type             			      = "NORMAL";
+  			   eutra_band              			      = 7;
+                           downlink_frequency      			      = 2680000000L;
+                           uplink_frequency_offset 			      = -120000000;
+  			   Nid_cell					      = 0;
+                           N_RB_DL                 			      = 50;
+                           Nid_cell_mbsfn          			      = 0;
+                           nb_antennas_tx          			      = 1;
+                           nb_antennas_rx          			      = 1; 
+			   tx_gain                                            = 60;
+			   rx_gain                                            = 60;
+                           prach_root              			      = 0;
+                           prach_config_index      			      = 0;
+                           prach_high_speed        			      = "DISABLE";
+  	                   prach_zero_correlation  			      = 1;
+                           prach_freq_offset       			      = 2;
+			   pucch_delta_shift       			      = 1;
+                           pucch_nRB_CQI           			      = 1;
+                           pucch_nCS_AN            			      = 0;
+                           pucch_n1_AN             			      = 32;
+                           pdsch_referenceSignalPower 			      = -26;
+                           pdsch_p_b                  			      = 0;
+                           pusch_n_SB                 			      = 1; 
+                           pusch_enable64QAM          			      = "DISABLE";
+			   pusch_hoppingMode                                  = "interSubFrame";
+			   pusch_hoppingOffset                                = 0;
+     	                   pusch_groupHoppingEnabled  			      = "ENABLE";
+	                   pusch_groupAssignment      			      = 0;
+	                   pusch_sequenceHoppingEnabled		   	      = "DISABLE";
+	                   pusch_nDMRS1                                       = 1;
+	                   phich_duration                                     = "NORMAL";
+	                   phich_resource                                     = "ONESIXTH";
+	                   srs_enable                                         = "DISABLE";
+	               /*  srs_BandwidthConfig                                =;
+	                   srs_SubframeConfig                                 =;
+	                   srs_ackNackST                                      =;
+	                   srs_MaxUpPts                                       =;*/  
+
+	                   pusch_p0_Nominal                                   = -90; 
+	                   pusch_alpha                                        = "AL1";
+	                   pucch_p0_Nominal                                   = -108;
+	                   msg3_delta_Preamble                                = 6;
+	                   pucch_deltaF_Format1                               = "deltaF2";
+	                   pucch_deltaF_Format1b                              = "deltaF3";
+	                   pucch_deltaF_Format2                               = "deltaF0";
+	                   pucch_deltaF_Format2a                              = "deltaF0";
+  	                   pucch_deltaF_Format2b		    	      = "deltaF0";
+	
+                           rach_numberOfRA_Preambles                          = 64;
+                           rach_preamblesGroupAConfig                         = "DISABLE";
+/*
+                           rach_sizeOfRA_PreamblesGroupA                      = ;
+                           rach_messageSizeGroupA                             = ;
+                           rach_messagePowerOffsetGroupB                      = ; 
+*/
+                           rach_powerRampingStep                              = 4;
+	                   rach_preambleInitialReceivedTargetPower            = -108;
+                           rach_preambleTransMax                              = 10;
+	                   rach_raResponseWindowSize                          = 10;
+	                   rach_macContentionResolutionTimer                  = 48;
+	                   rach_maxHARQ_Msg3Tx                                = 4;
+
+			   pcch_default_PagingCycle                           = 128;
+			   pcch_nB                                            = "oneT";
+			   bcch_modificationPeriodCoeff			      = 2;
+			   ue_TimersAndConstants_t300			      = 1000;
+			   ue_TimersAndConstants_t301			      = 1000;
+			   ue_TimersAndConstants_t310			      = 1000;
+			   ue_TimersAndConstants_t311			      = 10000;
+			   ue_TimersAndConstants_n310			      = 20;
+			   ue_TimersAndConstants_n311			      = 1;
+
+			 }
+			 );
+
+
+    srb1_parameters :
+    {
+        # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] 
+        timer_poll_retransmit    = 80;
+        
+        # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
+        timer_reordering         = 35;
+        
+        # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
+        timer_status_prohibit    = 0;
+        
+        # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
+        poll_pdu                 =  4;
+        
+        # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
+        poll_byte                =  99999;
+        
+        # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
+        max_retx_threshold       =  4;
+    }
+    
+    # ------- SCTP definitions
+    SCTP :
+    {
+        # Number of streams to use in input/output
+        SCTP_INSTREAMS  = 2;
+        SCTP_OUTSTREAMS = 2;
+    };
+        
+    ////////// MME parameters:
+    mme_ip_address      = ( { ipv4       = "192.168.12.11";
+                              ipv6       = "192:168:30::17";
+                              active     = "yes";
+                              preference = "ipv4";
+                            }
+                          );
+
+    NETWORK_INTERFACES : 
+    {
+        ENB_INTERFACE_NAME_FOR_S1_MME            = "eth0";
+        ENB_IPV4_ADDRESS_FOR_S1_MME              = "192.168.12.215/24";
+
+        ENB_INTERFACE_NAME_FOR_S1U               = "eth0";
+        ENB_IPV4_ADDRESS_FOR_S1U                 = "192.168.12.215/24";
+        ENB_PORT_FOR_S1U                         = 2152; # Spec 2152
+    };
+    
+    log_config : 
+    {
+	global_log_level                      ="info"; 
+    	global_log_verbosity                  ="medium";
+	hw_log_level                          ="info"; 
+    	hw_log_verbosity                      ="medium";
+	phy_log_level                         ="info"; 
+    	phy_log_verbosity                     ="medium";
+	mac_log_level                         ="info"; 
+    	mac_log_verbosity                     ="high";
+	rlc_log_level                         ="info"; 
+    	rlc_log_verbosity                     ="medium";
+	pdcp_log_level                        ="info"; 
+    	pdcp_log_verbosity                    ="medium";
+	rrc_log_level                         ="info"; 
+    	rrc_log_verbosity                     ="medium";
+   };	
+   
+  }
+);
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.lmssdr.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.lmssdr.conf
new file mode 100644
index 0000000000000000000000000000000000000000..dae0187f18732e178551ff69747a772f8c145e33
--- /dev/null
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.lmssdr.conf
@@ -0,0 +1,171 @@
+Active_eNBs = ( "eNB_Eurecom_LTEBox");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+
+eNBs =
+(
+ {
+    ////////// Identification parameters:
+    eNB_ID    =  0xe00;
+    
+    cell_type =  "CELL_MACRO_ENB";
+    
+    eNB_name  =  "eNB_Eurecom_LTEBox";
+    
+    // Tracking area code, 0x0000 and 0xfffe are reserved values
+    tracking_area_code  =  "1";
+    
+    mobile_country_code =  "208";
+    
+    mobile_network_code =  "95";
+    
+       ////////// Physical parameters:
+  
+    component_carriers = (
+    		       	 {
+  			   frame_type					      = "FDD";	
+                           tdd_config 					      = 3;
+                           tdd_config_s            			      = 0;
+ 			   prefix_type             			      = "NORMAL";
+  			   eutra_band              			      = 7;
+                           downlink_frequency      			      = 2660000000L;
+                           uplink_frequency_offset 			      = -120000000;
+  			   Nid_cell					      = 0;
+                           N_RB_DL                 			      = 50;
+                           Nid_cell_mbsfn          			      = 0;
+                           nb_antennas_tx          			      = 1;
+                           nb_antennas_rx          			      = 1; 
+			   tx_gain                                            = 60;
+			   rx_gain                                            = 111;
+                           prach_root              			      = 0;
+                           prach_config_index      			      = 0;
+                           prach_high_speed        			      = "DISABLE";
+  	                   prach_zero_correlation  			      = 1;
+                           prach_freq_offset       			      = 2;
+			   pucch_delta_shift       			      = 1;
+                           pucch_nRB_CQI           			      = 1;
+                           pucch_nCS_AN            			      = 0;
+                           pucch_n1_AN             			      = 32;
+                           pdsch_referenceSignalPower 			      = -29;
+                           pdsch_p_b                  			      = 0;
+                           pusch_n_SB                 			      = 1; 
+                           pusch_enable64QAM          			      = "DISABLE";
+			   pusch_hoppingMode                                  = "interSubFrame";
+			   pusch_hoppingOffset                                = 0;
+     	                   pusch_groupHoppingEnabled  			      = "ENABLE";
+	                   pusch_groupAssignment      			      = 0;
+	                   pusch_sequenceHoppingEnabled		   	      = "DISABLE";
+	                   pusch_nDMRS1                                       = 1;
+	                   phich_duration                                     = "NORMAL";
+	                   phich_resource                                     = "ONESIXTH";
+	                   srs_enable                                         = "DISABLE";
+	               /*  srs_BandwidthConfig                                =;
+	                   srs_SubframeConfig                                 =;
+	                   srs_ackNackST                                      =;
+	                   srs_MaxUpPts                                       =;*/  
+
+	                   pusch_p0_Nominal                                   = -85; 
+	                   pusch_alpha                                        = "AL1";
+	                   pucch_p0_Nominal                                   = -96;
+	                   msg3_delta_Preamble                                = 6;
+	                   pucch_deltaF_Format1                               = "deltaF2";
+	                   pucch_deltaF_Format1b                              = "deltaF3";
+	                   pucch_deltaF_Format2                               = "deltaF0";
+	                   pucch_deltaF_Format2a                              = "deltaF0";
+  	                   pucch_deltaF_Format2b		    	      = "deltaF0";
+	
+                           rach_numberOfRA_Preambles                          = 64;
+                           rach_preamblesGroupAConfig                         = "DISABLE";
+/*
+                           rach_sizeOfRA_PreamblesGroupA                      = ;
+                           rach_messageSizeGroupA                             = ;
+                           rach_messagePowerOffsetGroupB                      = ; 
+*/
+                           rach_powerRampingStep                              = 4;
+	                   rach_preambleInitialReceivedTargetPower            = -100;
+                           rach_preambleTransMax                              = 10;
+	                   rach_raResponseWindowSize                          = 10;
+	                   rach_macContentionResolutionTimer                  = 48;
+	                   rach_maxHARQ_Msg3Tx                                = 4;
+
+			   pcch_default_PagingCycle                           = 128;
+			   pcch_nB                                            = "oneT";
+			   bcch_modificationPeriodCoeff			      = 2;
+			   ue_TimersAndConstants_t300			      = 1000;
+			   ue_TimersAndConstants_t301			      = 1000;
+			   ue_TimersAndConstants_t310			      = 1000;
+			   ue_TimersAndConstants_t311			      = 10000;
+			   ue_TimersAndConstants_n310			      = 20;
+			   ue_TimersAndConstants_n311			      = 1;
+
+			 }
+			 );
+
+
+    srb1_parameters :
+    {
+        # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] 
+        timer_poll_retransmit    = 80;
+        
+        # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
+        timer_reordering         = 35;
+        
+        # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
+        timer_status_prohibit    = 0;
+        
+        # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
+        poll_pdu                 =  4;
+        
+        # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
+        poll_byte                =  99999;
+        
+        # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
+        max_retx_threshold       =  4;
+    }
+    
+    # ------- SCTP definitions
+    SCTP :
+    {
+        # Number of streams to use in input/output
+        SCTP_INSTREAMS  = 2;
+        SCTP_OUTSTREAMS = 2;
+    };
+        
+    ////////// MME parameters:
+    mme_ip_address      = ( { ipv4       = "192.168.12.62";
+                              ipv6       = "192:168:30::17";
+                              active     = "yes";
+                              preference = "ipv4";
+                            }
+                          );
+
+    NETWORK_INTERFACES : 
+    {
+        ENB_INTERFACE_NAME_FOR_S1_MME            = "eth4";
+        ENB_IPV4_ADDRESS_FOR_S1_MME              = "192.168.12.242/24";
+
+        ENB_INTERFACE_NAME_FOR_S1U               = "eth4";
+        ENB_IPV4_ADDRESS_FOR_S1U                 = "192.168.12.242/24";
+        ENB_PORT_FOR_S1U                         = 2152; # Spec 2152
+    };
+    
+    log_config : 
+    {
+	global_log_level                      ="info"; 
+    	global_log_verbosity                  ="medium";
+	hw_log_level                          ="info"; 
+    	hw_log_verbosity                      ="medium";
+	phy_log_level                         ="info"; 
+    	phy_log_verbosity                     ="medium";
+	mac_log_level                         ="info"; 
+    	mac_log_verbosity                     ="high";
+	rlc_log_level                         ="info"; 
+    	rlc_log_verbosity                     ="medium";
+	pdcp_log_level                        ="info"; 
+    	pdcp_log_verbosity                    ="medium";
+	rrc_log_level                         ="info"; 
+    	rrc_log_verbosity                     ="medium";
+   };	
+   
+  }
+);
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.rrh.lmssdr.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.rrh.lmssdr.conf
new file mode 100644
index 0000000000000000000000000000000000000000..4cd761645b3e339c9b4cff404e974352a5f1f832
--- /dev/null
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.rrh.lmssdr.conf
@@ -0,0 +1,192 @@
+Active_eNBs = ( "eNB_Eurecom_LTEBox");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+
+eNBs =
+(
+ {
+    ////////// Identification parameters:
+    eNB_ID    =  0xe00;
+    
+    cell_type =  "CELL_MACRO_ENB";
+    
+    eNB_name  =  "eNB_Eurecom_LTEBox";
+    
+    // Tracking area code, 0x0000 and 0xfffe are reserved values
+    tracking_area_code  =  "1";
+    
+    mobile_country_code =  "208";
+    
+    mobile_network_code =  "93";
+    
+       ////////// Physical parameters:
+  
+    component_carriers = (
+    		       	 {
+  			   frame_type					      = "FDD";	
+                           tdd_config 					      = 3;
+                           tdd_config_s            			      = 0;
+ 			   prefix_type             			      = "NORMAL";
+  			   eutra_band              			      = 7;
+                           downlink_frequency      			      = 2660000000L;
+                           uplink_frequency_offset 			      = -120000000;
+  			   Nid_cell					      = 0;
+                           N_RB_DL                 			      = 50;
+                           Nid_cell_mbsfn          			      = 0;
+                           nb_antennas_tx          			      = 1;
+                           nb_antennas_rx          			      = 1; 
+			   tx_gain                                            = 60;
+			   rx_gain                                            = 111;
+                           prach_root              			      = 0;
+                           prach_config_index      			      = 0;
+                           prach_high_speed        			      = "DISABLE";
+  	                   prach_zero_correlation  			      = 1;
+                           prach_freq_offset       			      = 2;
+			   pucch_delta_shift       			      = 1;
+                           pucch_nRB_CQI           			      = 1;
+                           pucch_nCS_AN            			      = 0;
+                           pucch_n1_AN             			      = 32;
+                           pdsch_referenceSignalPower 			      = -29;
+                           pdsch_p_b                  			      = 0;
+                           pusch_n_SB                 			      = 1; 
+                           pusch_enable64QAM          			      = "DISABLE";
+			   pusch_hoppingMode                                  = "interSubFrame";
+			   pusch_hoppingOffset                                = 0;
+     	                   pusch_groupHoppingEnabled  			      = "ENABLE";
+	                   pusch_groupAssignment      			      = 0;
+	                   pusch_sequenceHoppingEnabled		   	      = "DISABLE";
+	                   pusch_nDMRS1                                       = 1;
+	                   phich_duration                                     = "NORMAL";
+	                   phich_resource                                     = "ONESIXTH";
+	                   srs_enable                                         = "DISABLE";
+	               /*  srs_BandwidthConfig                                =;
+	                   srs_SubframeConfig                                 =;
+	                   srs_ackNackST                                      =;
+	                   srs_MaxUpPts                                       =;*/  
+
+	                   pusch_p0_Nominal                                   = -85; 
+	                   pusch_alpha                                        = "AL1";
+	                   pucch_p0_Nominal                                   = -96;
+	                   msg3_delta_Preamble                                = 6;
+	                   pucch_deltaF_Format1                               = "deltaF2";
+	                   pucch_deltaF_Format1b                              = "deltaF3";
+	                   pucch_deltaF_Format2                               = "deltaF0";
+	                   pucch_deltaF_Format2a                              = "deltaF0";
+  	                   pucch_deltaF_Format2b		    	      = "deltaF0";
+	
+                           rach_numberOfRA_Preambles                          = 64;
+                           rach_preamblesGroupAConfig                         = "DISABLE";
+/*
+                           rach_sizeOfRA_PreamblesGroupA                      = ;
+                           rach_messageSizeGroupA                             = ;
+                           rach_messagePowerOffsetGroupB                      = ; 
+*/
+                           rach_powerRampingStep                              = 4;
+	                   rach_preambleInitialReceivedTargetPower            = -100;
+                           rach_preambleTransMax                              = 10;
+	                   rach_raResponseWindowSize                          = 10;
+	                   rach_macContentionResolutionTimer                  = 48;
+	                   rach_maxHARQ_Msg3Tx                                = 4;
+
+			   pcch_default_PagingCycle                           = 128;
+			   pcch_nB                                            = "oneT";
+			   bcch_modificationPeriodCoeff			      = 2;
+			   ue_TimersAndConstants_t300			      = 1000;
+			   ue_TimersAndConstants_t301			      = 1000;
+			   ue_TimersAndConstants_t310			      = 1000;
+			   ue_TimersAndConstants_t311			      = 10000;
+			   ue_TimersAndConstants_n310			      = 20;
+			   ue_TimersAndConstants_n311			      = 1;
+
+			 }
+			 );
+
+
+    srb1_parameters :
+    {
+        # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] 
+        timer_poll_retransmit    = 80;
+        
+        # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
+        timer_reordering         = 35;
+        
+        # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
+        timer_status_prohibit    = 0;
+        
+        # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
+        poll_pdu                 =  4;
+        
+        # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
+        poll_byte                =  99999;
+        
+        # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
+        max_retx_threshold       =  4;
+    }
+ 
+    # ------- SCTP definitions
+    SCTP :
+    {
+        # Number of streams to use in input/output
+        SCTP_INSTREAMS  = 2;
+        SCTP_OUTSTREAMS = 2;
+    };
+
+
+    ////////// MME parameters:
+    mme_ip_address      = ( { ipv4       = "192.168.12.170";
+                              ipv6       = "192:168:30::17";
+                              active     = "yes";
+                              preference = "ipv4";
+                            }
+                          );
+
+rrh_gw_config = (
+ {			  
+    local_if_name = "eth0";			  
+    #remote_address = "169.254.10.158";	
+    #local_address = "169.254.8.15";        
+    remote_address = "74:d4:35:cc:88:45";
+    local_address = "d4:be:d9:22:0a:ac";
+    local_port = 50000;	    #for raw option local port must be the same to remote	       
+    remote_port = 50000; 
+    rrh_gw_active = "yes";
+    tr_preference = "raw";
+    rf_preference = "lmssdr";
+    iq_txshift = 0;
+    tx_sample_advance = 45;	
+    tx_scheduling_advance = 8; 	                
+                             
+}
+);  
+
+    NETWORK_INTERFACES :
+    {
+        ENB_INTERFACE_NAME_FOR_S1_MME            = "eth6";
+        ENB_IPV4_ADDRESS_FOR_S1_MME              = "192.168.12.118/24";
+
+        ENB_INTERFACE_NAME_FOR_S1U               = "eth6";
+
+
+        ENB_IPV4_ADDRESS_FOR_S1U                 = "192.168.12.118/24";
+        ENB_PORT_FOR_S1U                         = 2152; # Spec 2152
+    };
+
+    log_config :
+    {
+      global_log_level                      ="info";
+      global_log_verbosity                  ="medium";
+      hw_log_level                          ="info";
+      hw_log_verbosity                      ="medium";
+      phy_log_level                         ="info";
+      phy_log_verbosity                     ="medium";
+      mac_log_level                         ="info";
+      mac_log_verbosity                     ="high";
+      rlc_log_level                         ="info";
+      rlc_log_verbosity                     ="medium";
+      pdcp_log_level                        ="info";
+      pdcp_log_verbosity                    ="medium";
+      rrc_log_level                         ="info";
+      rrc_log_verbosity                     ="medium";
+   };
+  }
+);
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.rrh.usrpb210.conf
similarity index 83%
rename from targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf
rename to targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.rrh.usrpb210.conf
index d4b88383e249fac091e2e8bbb6ecfe779398e191..434dd056b45af43cc6d87f4ddc14dacbf51a0f6c 100644
--- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpx310.epc.remote.conf
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.rrh.usrpb210.conf
@@ -5,7 +5,7 @@ Asn1_verbosity = "none";
 eNBs =
 (
  {
-    ////////// Identification parameters:
+     ////////// Identification parameters:
     eNB_ID    =  0xe00;
 
     cell_type =  "CELL_MACRO_ENB";
@@ -16,6 +16,7 @@ eNBs =
     tracking_area_code  =  "1";
 
     mobile_country_code =  "208";
+
     mobile_network_code =  "92";
 
        ////////// Physical parameters:
@@ -27,15 +28,15 @@ eNBs =
         tdd_config_s            			      = 0;
         prefix_type             			      = "NORMAL";
         eutra_band              			      = 7;
-        downlink_frequency      			      = 2660000000L;
+        downlink_frequency      			      = 2680000000L;
         uplink_frequency_offset 			      = -120000000;
         Nid_cell					      = 0;
-        N_RB_DL                 			      = 25;
+        N_RB_DL                 			      = 50;
         Nid_cell_mbsfn          			      = 0;
         nb_antennas_tx          			      = 1;
         nb_antennas_rx          			      = 1;
-        tx_gain                                            = 32;
-        rx_gain                                            = 116;
+        tx_gain                                            = 90;
+        rx_gain                                            = 125;
         prach_root              			      = 0;
         prach_config_index      			      = 0;
         prach_high_speed        			      = "DISABLE";
@@ -45,7 +46,7 @@ eNBs =
         pucch_nRB_CQI           			      = 1;
         pucch_nCS_AN            			      = 0;
         pucch_n1_AN             			      = 32;
-        pdsch_referenceSignalPower 			      = -16;
+        pdsch_referenceSignalPower 			      = -29;
         pdsch_p_b                  			      = 0;
         pusch_n_SB                 			      = 1;
         pusch_enable64QAM          			      = "DISABLE";
@@ -58,14 +59,14 @@ eNBs =
         phich_duration                                     = "NORMAL";
         phich_resource                                     = "ONESIXTH";
         srs_enable                                         = "DISABLE";
-      /*  srs_BandwidthConfig                                =;
+        /*  srs_BandwidthConfig                                =;
         srs_SubframeConfig                                 =;
         srs_ackNackST                                      =;
         srs_MaxUpPts                                       =;*/
 
         pusch_p0_Nominal                                   = -90;
         pusch_alpha                                        = "AL1";
-        pucch_p0_Nominal                                   = -108;
+        pucch_p0_Nominal                                   = -96;
         msg3_delta_Preamble                                = 6;
         pucch_deltaF_Format1                               = "deltaF2";
         pucch_deltaF_Format1b                              = "deltaF3";
@@ -75,11 +76,11 @@ eNBs =
 
         rach_numberOfRA_Preambles                          = 64;
         rach_preamblesGroupAConfig                         = "DISABLE";
-      /*
+        /*
         rach_sizeOfRA_PreamblesGroupA                      = ;
         rach_messageSizeGroupA                             = ;
         rach_messagePowerOffsetGroupB                      = ;
-      */
+        */
         rach_powerRampingStep                              = 4;
         rach_preambleInitialReceivedTargetPower            = -108;
         rach_preambleTransMax                              = 10;
@@ -99,7 +100,6 @@ eNBs =
       }
     );
 
-
     srb1_parameters :
     {
         # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
@@ -129,6 +129,7 @@ eNBs =
         SCTP_OUTSTREAMS = 2;
     };
 
+
     ////////// MME parameters:
     mme_ip_address      = ( { ipv4       = "192.168.12.26";
                               ipv6       = "192:168:30::17";
@@ -137,19 +138,38 @@ eNBs =
                             }
                           );
 
+rrh_gw_config = (
+ {			  
+    local_if_name = "eth0";			  
+    #remote_address = "169.254.10.158";	
+    #local_address = "169.254.8.15";
+    remote_address = "74:d4:35:cc:88:45";
+    local_address = "98:90:96:df:66:07";
+    local_port = 50000;	    #for raw option local port must be the same to remote	       
+    remote_port = 50000; 
+    rrh_gw_active = "yes";
+    tr_preference = "raw";
+    rf_preference = "usrp_b200";
+    iq_txshift = 4;
+    tx_sample_advance = 103;	
+    tx_scheduling_advance = 9; 	                
+                             
+}
+);  
+
     NETWORK_INTERFACES :
     {
-        ENB_INTERFACE_NAME_FOR_S1_MME            = "eth0";
+        ENB_INTERFACE_NAME_FOR_S1_MME            = "eth4";
         ENB_IPV4_ADDRESS_FOR_S1_MME              = "192.168.12.111/24";
 
-        ENB_INTERFACE_NAME_FOR_S1U               = "eth0";
+        ENB_INTERFACE_NAME_FOR_S1U               = "eth4";
         ENB_IPV4_ADDRESS_FOR_S1U                 = "192.168.12.111/24";
         ENB_PORT_FOR_S1U                         = 2152; # Spec 2152
     };
 
     log_config :
     {
-      global_log_level                      ="debug";
+      global_log_level                      ="info";
       global_log_verbosity                  ="medium";
       hw_log_level                          ="info";
       hw_log_verbosity                      ="medium";
@@ -164,6 +184,5 @@ eNBs =
       rrc_log_level                         ="info";
       rrc_log_verbosity                     ="medium";
    };
-
   }
-);
+);
\ No newline at end of file
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf
index 8f9dc280ae1c2e1746176bcf887e4ac6f635481b..d00482edcab59bc95cf847b58e359172b3a7a6ac 100644
--- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf
@@ -36,7 +36,7 @@ eNBs =
         nb_antennas_tx          			      = 1;
         nb_antennas_rx          			      = 1;
         tx_gain                                            = 90;
-        rx_gain                                            = 118;
+        rx_gain                                            = 125;
         prach_root              			      = 0;
         prach_config_index      			      = 0;
         prach_high_speed        			      = "DISABLE";
@@ -64,9 +64,9 @@ eNBs =
         srs_ackNackST                                      =;
         srs_MaxUpPts                                       =;*/
 
-        pusch_p0_Nominal                                   = -90;
+        pusch_p0_Nominal                                   = -96;
         pusch_alpha                                        = "AL1";
-        pucch_p0_Nominal                                   = -108;
+        pucch_p0_Nominal                                   = -103;
         msg3_delta_Preamble                                = 6;
         pucch_deltaF_Format1                               = "deltaF2";
         pucch_deltaF_Format1b                              = "deltaF3";
@@ -82,7 +82,7 @@ eNBs =
         rach_messagePowerOffsetGroupB                      = ;
         */
         rach_powerRampingStep                              = 4;
-        rach_preambleInitialReceivedTargetPower            = -108;
+        rach_preambleInitialReceivedTargetPower            = -104;
         rach_preambleTransMax                              = 10;
         rach_raResponseWindowSize                          = 10;
         rach_macContentionResolutionTimer                  = 48;
@@ -130,7 +130,7 @@ eNBs =
     };
 
     ////////// MME parameters:
-    mme_ip_address      = ( { ipv4       = "192.168.12.11";
+    mme_ip_address      = ( { ipv4       = "127.0.0.3";
                               ipv6       = "192:168:30::17";
                               active     = "yes";
                               preference = "ipv4";
@@ -139,11 +139,11 @@ eNBs =
 
     NETWORK_INTERFACES :
     {
-        ENB_INTERFACE_NAME_FOR_S1_MME            = "eth0";
-        ENB_IPV4_ADDRESS_FOR_S1_MME              = "192.168.12.213/24";
+        ENB_INTERFACE_NAME_FOR_S1_MME            = "lo";
+        ENB_IPV4_ADDRESS_FOR_S1_MME              = "127.0.0.2/24";
 
-        ENB_INTERFACE_NAME_FOR_S1U               = "eth0";
-        ENB_IPV4_ADDRESS_FOR_S1U                 = "192.168.12.213/24";
+        ENB_INTERFACE_NAME_FOR_S1U               = "lo";
+        ENB_IPV4_ADDRESS_FOR_S1U                 = "127.0.0.4/24";
         ENB_PORT_FOR_S1U                         = 2152; # Spec 2152
     };
 
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf
index 4c760e19c2ca4f362c55278a9791d38ab18786aa..d0488f2d37b3812faf9887ceb60781a8a278b631 100644
--- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpx310.conf
@@ -35,7 +35,7 @@ eNBs =
         nb_antennas_tx          			      = 1;
         nb_antennas_rx          			      = 1;
         tx_gain                                            = 32;
-        rx_gain                                            = 120;
+        rx_gain                                            = 118;
         prach_root              			      = 0;
         prach_config_index      			      = 0;
         prach_high_speed        			      = "DISABLE";
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf
index bdbb46a98b40fc7e3c272b116b3f1514fab20cec..5a6a9a462bdeabd1fde804c0788cc52f7366c427 100644
--- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.bladerfx40.conf
@@ -17,7 +17,7 @@ eNBs =
     
     mobile_country_code =  "208";
     
-    mobile_network_code =  "92";
+    mobile_network_code =  "93";
     
        ////////// Physical parameters:
   
@@ -35,8 +35,8 @@ eNBs =
                            Nid_cell_mbsfn          			      = 0;
                            nb_antennas_tx          			      = 1;
                            nb_antennas_rx          			      = 1; 
-			   tx_gain                                            = 20;
-			   rx_gain                                            = 20;
+			   tx_gain                                            = 60;
+			   rx_gain                                            = 120;
                            prach_root              			      = 0;
                            prach_config_index      			      = 0;
                            prach_high_speed        			      = "DISABLE";
@@ -46,7 +46,7 @@ eNBs =
                            pucch_nRB_CQI           			      = 1;
                            pucch_nCS_AN            			      = 0;
                            pucch_n1_AN             			      = 32;
-                           pdsch_referenceSignalPower 			      = -26;
+                           pdsch_referenceSignalPower 			      = -29;
                            pdsch_p_b                  			      = 0;
                            pusch_n_SB                 			      = 1; 
                            pusch_enable64QAM          			      = "DISABLE";
@@ -132,7 +132,7 @@ eNBs =
     };
         
     ////////// MME parameters:
-    mme_ip_address      = ( { ipv4       = "192.168.13.11";
+    mme_ip_address      = ( { ipv4       = "192.168.12.11";
                               ipv6       = "192:168:30::17";
                               active     = "yes";
                               preference = "ipv4";
@@ -142,10 +142,10 @@ eNBs =
     NETWORK_INTERFACES : 
     {
         ENB_INTERFACE_NAME_FOR_S1_MME            = "eth0";
-        ENB_IPV4_ADDRESS_FOR_S1_MME              = "192.168.13.10/24";
+        ENB_IPV4_ADDRESS_FOR_S1_MME              = "192.168.12.215/24";
 
         ENB_INTERFACE_NAME_FOR_S1U               = "eth0";
-        ENB_IPV4_ADDRESS_FOR_S1U                 = "192.168.13.10/24";
+        ENB_IPV4_ADDRESS_FOR_S1U                 = "192.168.12.215/24";
         ENB_PORT_FOR_S1U                         = 2152; # Spec 2152
     };
     
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf
index 3ce32398f7ac5d6fe42720447565c0fb6326213a..f1160e78ca43cfc91050d0e278e467e96baeca1a 100644
--- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.conf
@@ -64,9 +64,9 @@ eNBs =
         srs_ackNackST                                      =;
         srs_MaxUpPts                                       =;*/
 
-        pusch_p0_Nominal                                   = -80; /*-85;*/
+        pusch_p0_Nominal                                   = -90; /*-85;*/
         pusch_alpha                                        = "AL1";
-        pucch_p0_Nominal                                   = -108; /* -108 */
+        pucch_p0_Nominal                                   = -100; /* -108 */
         msg3_delta_Preamble                                = 6;
         pucch_deltaF_Format1                               = "deltaF2";
         pucch_deltaF_Format1b                              = "deltaF3";
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf
new file mode 100644
index 0000000000000000000000000000000000000000..47e2179d18a264782163ec0ecae9ceceddb6a495
--- /dev/null
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.lmssdr.conf
@@ -0,0 +1,171 @@
+Active_eNBs = ( "eNB_Eurecom_LTEBox");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+
+eNBs =
+(
+ {
+    ////////// Identification parameters:
+    eNB_ID    =  0xe00;
+    
+    cell_type =  "CELL_MACRO_ENB";
+    
+    eNB_name  =  "eNB_Eurecom_LTEBox";
+    
+    // Tracking area code, 0x0000 and 0xfffe are reserved values
+    tracking_area_code  =  "1";
+    
+    mobile_country_code =  "208";
+    
+    mobile_network_code =  "92";
+    
+       ////////// Physical parameters:
+  
+    component_carriers = (
+    		       	 {
+  			   frame_type					      = "FDD";	
+                           tdd_config 					      = 3;
+                           tdd_config_s            			      = 0;
+ 			   prefix_type             			      = "NORMAL";
+  			   eutra_band              			      = 7;
+                           downlink_frequency      			      = 2660000000L;
+                           uplink_frequency_offset 			      = -120000000;
+  			   Nid_cell					      = 0;
+                           N_RB_DL                 			      = 25;
+                           Nid_cell_mbsfn          			      = 0;
+                           nb_antennas_tx          			      = 1;
+                           nb_antennas_rx          			      = 1; 
+			   tx_gain                                            = 60;
+			   rx_gain                                            = 111;
+                           prach_root              			      = 0;
+                           prach_config_index      			      = 0;
+                           prach_high_speed        			      = "DISABLE";
+  	                   prach_zero_correlation  			      = 1;
+                           prach_freq_offset       			      = 2;
+			   pucch_delta_shift       			      = 1;
+                           pucch_nRB_CQI           			      = 1;
+                           pucch_nCS_AN            			      = 0;
+                           pucch_n1_AN             			      = 32;
+                           pdsch_referenceSignalPower 			      = -29;
+                           pdsch_p_b                  			      = 0;
+                           pusch_n_SB                 			      = 1; 
+                           pusch_enable64QAM          			      = "DISABLE";
+			   pusch_hoppingMode                                  = "interSubFrame";
+			   pusch_hoppingOffset                                = 0;
+     	                   pusch_groupHoppingEnabled  			      = "ENABLE";
+	                   pusch_groupAssignment      			      = 0;
+	                   pusch_sequenceHoppingEnabled		   	      = "DISABLE";
+	                   pusch_nDMRS1                                       = 1;
+	                   phich_duration                                     = "NORMAL";
+	                   phich_resource                                     = "ONESIXTH";
+	                   srs_enable                                         = "DISABLE";
+	               /*  srs_BandwidthConfig                                =;
+	                   srs_SubframeConfig                                 =;
+	                   srs_ackNackST                                      =;
+	                   srs_MaxUpPts                                       =;*/  
+
+	                   pusch_p0_Nominal                                   = -85; 
+	                   pusch_alpha                                        = "AL1";
+	                   pucch_p0_Nominal                                   = -96;
+	                   msg3_delta_Preamble                                = 6;
+	                   pucch_deltaF_Format1                               = "deltaF2";
+	                   pucch_deltaF_Format1b                              = "deltaF3";
+	                   pucch_deltaF_Format2                               = "deltaF0";
+	                   pucch_deltaF_Format2a                              = "deltaF0";
+  	                   pucch_deltaF_Format2b		    	      = "deltaF0";
+	
+                           rach_numberOfRA_Preambles                          = 64;
+                           rach_preamblesGroupAConfig                         = "DISABLE";
+/*
+                           rach_sizeOfRA_PreamblesGroupA                      = ;
+                           rach_messageSizeGroupA                             = ;
+                           rach_messagePowerOffsetGroupB                      = ; 
+*/
+                           rach_powerRampingStep                              = 4;
+	                   rach_preambleInitialReceivedTargetPower            = -100;
+                           rach_preambleTransMax                              = 10;
+	                   rach_raResponseWindowSize                          = 10;
+	                   rach_macContentionResolutionTimer                  = 48;
+	                   rach_maxHARQ_Msg3Tx                                = 4;
+
+			   pcch_default_PagingCycle                           = 128;
+			   pcch_nB                                            = "oneT";
+			   bcch_modificationPeriodCoeff			      = 2;
+			   ue_TimersAndConstants_t300			      = 1000;
+			   ue_TimersAndConstants_t301			      = 1000;
+			   ue_TimersAndConstants_t310			      = 1000;
+			   ue_TimersAndConstants_t311			      = 10000;
+			   ue_TimersAndConstants_n310			      = 20;
+			   ue_TimersAndConstants_n311			      = 1;
+
+			 }
+			 );
+
+
+    srb1_parameters :
+    {
+        # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] 
+        timer_poll_retransmit    = 80;
+        
+        # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
+        timer_reordering         = 35;
+        
+        # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
+        timer_status_prohibit    = 0;
+        
+        # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
+        poll_pdu                 =  4;
+        
+        # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
+        poll_byte                =  99999;
+        
+        # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
+        max_retx_threshold       =  4;
+    }
+    
+    # ------- SCTP definitions
+    SCTP :
+    {
+        # Number of streams to use in input/output
+        SCTP_INSTREAMS  = 2;
+        SCTP_OUTSTREAMS = 2;
+    };
+        
+    ////////// MME parameters:
+    mme_ip_address      = ( { ipv4       = "192.168.12.170";
+                              ipv6       = "192:168:30::17";
+                              active     = "yes";
+                              preference = "ipv4";
+                            }
+                          );
+
+    NETWORK_INTERFACES : 
+    {
+        ENB_INTERFACE_NAME_FOR_S1_MME            = "eth4";
+        ENB_IPV4_ADDRESS_FOR_S1_MME              = "192.168.12.242/24";
+
+        ENB_INTERFACE_NAME_FOR_S1U               = "eth4";
+        ENB_IPV4_ADDRESS_FOR_S1U                 = "192.168.12.242/24";
+        ENB_PORT_FOR_S1U                         = 2152; # Spec 2152
+    };
+    
+    log_config : 
+    {
+	global_log_level                      ="info"; 
+    	global_log_verbosity                  ="medium";
+	hw_log_level                          ="info"; 
+    	hw_log_verbosity                      ="medium";
+	phy_log_level                         ="info"; 
+    	phy_log_verbosity                     ="medium";
+	mac_log_level                         ="info"; 
+    	mac_log_verbosity                     ="high";
+	rlc_log_level                         ="info"; 
+    	rlc_log_verbosity                     ="medium";
+	pdcp_log_level                        ="info"; 
+    	pdcp_log_verbosity                    ="medium";
+	rrc_log_level                         ="info"; 
+    	rrc_log_verbosity                     ="medium";
+   };	
+   
+  }
+);
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.lmssdr.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.lmssdr.conf
new file mode 100644
index 0000000000000000000000000000000000000000..9b052bf7ba9a888bb1b26cc8f654191513524982
--- /dev/null
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.lmssdr.conf
@@ -0,0 +1,192 @@
+Active_eNBs = ( "eNB_Eurecom_LTEBox");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+
+eNBs =
+(
+ {
+    ////////// Identification parameters:
+    eNB_ID    =  0xe00;
+    
+    cell_type =  "CELL_MACRO_ENB";
+    
+    eNB_name  =  "eNB_Eurecom_LTEBox";
+    
+    // Tracking area code, 0x0000 and 0xfffe are reserved values
+    tracking_area_code  =  "1";
+    
+    mobile_country_code =  "208";
+    
+    mobile_network_code =  "92";
+    
+       ////////// Physical parameters:
+  
+    component_carriers = (
+    		       	 {
+  			   frame_type					      = "FDD";	
+                           tdd_config 					      = 3;
+                           tdd_config_s            			      = 0;
+ 			   prefix_type             			      = "NORMAL";
+  			   eutra_band              			      = 7;
+                           downlink_frequency      			      = 2660000000L;
+                           uplink_frequency_offset 			      = -120000000;
+  			   Nid_cell					      = 0;
+                           N_RB_DL                 			      = 25;
+                           Nid_cell_mbsfn          			      = 0;
+                           nb_antennas_tx          			      = 1;
+                           nb_antennas_rx          			      = 1; 
+			   tx_gain                                            = 60;
+			   rx_gain                                            = 111;
+                           prach_root              			      = 0;
+                           prach_config_index      			      = 0;
+                           prach_high_speed        			      = "DISABLE";
+  	                   prach_zero_correlation  			      = 1;
+                           prach_freq_offset       			      = 2;
+			   pucch_delta_shift       			      = 1;
+                           pucch_nRB_CQI           			      = 1;
+                           pucch_nCS_AN            			      = 0;
+                           pucch_n1_AN             			      = 32;
+                           pdsch_referenceSignalPower 			      = -29;
+                           pdsch_p_b                  			      = 0;
+                           pusch_n_SB                 			      = 1; 
+                           pusch_enable64QAM          			      = "DISABLE";
+			   pusch_hoppingMode                                  = "interSubFrame";
+			   pusch_hoppingOffset                                = 0;
+     	                   pusch_groupHoppingEnabled  			      = "ENABLE";
+	                   pusch_groupAssignment      			      = 0;
+	                   pusch_sequenceHoppingEnabled		   	      = "DISABLE";
+	                   pusch_nDMRS1                                       = 1;
+	                   phich_duration                                     = "NORMAL";
+	                   phich_resource                                     = "ONESIXTH";
+	                   srs_enable                                         = "DISABLE";
+	               /*  srs_BandwidthConfig                                =;
+	                   srs_SubframeConfig                                 =;
+	                   srs_ackNackST                                      =;
+	                   srs_MaxUpPts                                       =;*/  
+
+	                   pusch_p0_Nominal                                   = -85; 
+	                   pusch_alpha                                        = "AL1";
+	                   pucch_p0_Nominal                                   = -96;
+	                   msg3_delta_Preamble                                = 6;
+	                   pucch_deltaF_Format1                               = "deltaF2";
+	                   pucch_deltaF_Format1b                              = "deltaF3";
+	                   pucch_deltaF_Format2                               = "deltaF0";
+	                   pucch_deltaF_Format2a                              = "deltaF0";
+  	                   pucch_deltaF_Format2b		    	      = "deltaF0";
+	
+                           rach_numberOfRA_Preambles                          = 64;
+                           rach_preamblesGroupAConfig                         = "DISABLE";
+/*
+                           rach_sizeOfRA_PreamblesGroupA                      = ;
+                           rach_messageSizeGroupA                             = ;
+                           rach_messagePowerOffsetGroupB                      = ; 
+*/
+                           rach_powerRampingStep                              = 4;
+	                   rach_preambleInitialReceivedTargetPower            = -100;
+                           rach_preambleTransMax                              = 10;
+	                   rach_raResponseWindowSize                          = 10;
+	                   rach_macContentionResolutionTimer                  = 48;
+	                   rach_maxHARQ_Msg3Tx                                = 4;
+
+			   pcch_default_PagingCycle                           = 128;
+			   pcch_nB                                            = "oneT";
+			   bcch_modificationPeriodCoeff			      = 2;
+			   ue_TimersAndConstants_t300			      = 1000;
+			   ue_TimersAndConstants_t301			      = 1000;
+			   ue_TimersAndConstants_t310			      = 1000;
+			   ue_TimersAndConstants_t311			      = 10000;
+			   ue_TimersAndConstants_n310			      = 20;
+			   ue_TimersAndConstants_n311			      = 1;
+
+			 }
+			 );
+
+
+    srb1_parameters :
+    {
+        # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] 
+        timer_poll_retransmit    = 80;
+        
+        # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
+        timer_reordering         = 35;
+        
+        # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
+        timer_status_prohibit    = 0;
+        
+        # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
+        poll_pdu                 =  4;
+        
+        # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
+        poll_byte                =  99999;
+        
+        # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
+        max_retx_threshold       =  4;
+    }
+    
+    # ------- SCTP definitions
+    SCTP :
+    {
+        # Number of streams to use in input/output
+        SCTP_INSTREAMS  = 2;
+        SCTP_OUTSTREAMS = 2;
+    };
+
+
+    ////////// MME parameters:
+    mme_ip_address      = ( { ipv4       = "192.168.12.170";
+                              ipv6       = "192:168:30::17";
+                              active     = "yes";
+                              preference = "ipv4";
+                            }
+                          );
+
+rrh_gw_config = (
+ {			  
+    local_if_name = "eth0";			  
+    #remote_address = "169.254.10.158";	
+    #local_address = "169.254.8.15";				  
+    remote_address = "74:d4:35:cc:88:45";
+    local_address = "d4:be:d9:22:0a:ac";
+    local_port = 50000;	    #for raw option local port must be the same to remote	       
+    remote_port = 50000; 
+    rrh_gw_active = "yes";
+    tr_preference = "raw";
+    rf_preference = "lmssdr";
+    iq_txshift = 0;
+    tx_sample_advance = 70;	
+    tx_scheduling_advance = 8; 	                
+                             
+}
+);  
+
+    NETWORK_INTERFACES :
+    {
+        ENB_INTERFACE_NAME_FOR_S1_MME            = "eth6";
+        ENB_IPV4_ADDRESS_FOR_S1_MME              = "192.168.12.118/24";
+
+        ENB_INTERFACE_NAME_FOR_S1U               = "eth6";
+
+
+        ENB_IPV4_ADDRESS_FOR_S1U                 = "192.168.12.118/24";
+        ENB_PORT_FOR_S1U                         = 2152; # Spec 2152
+    };
+
+    log_config :
+    {
+      global_log_level                      ="info";
+      global_log_verbosity                  ="medium";
+      hw_log_level                          ="info";
+      hw_log_verbosity                      ="medium";
+      phy_log_level                         ="info";
+      phy_log_verbosity                     ="medium";
+      mac_log_level                         ="info";
+      mac_log_verbosity                     ="high";
+      rlc_log_level                         ="info";
+      rlc_log_verbosity                     ="medium";
+      pdcp_log_level                        ="info";
+      pdcp_log_verbosity                    ="medium";
+      rrc_log_level                         ="info";
+      rrc_log_verbosity                     ="medium";
+   };
+  }
+);
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf
new file mode 100644
index 0000000000000000000000000000000000000000..894781fdfd3a2a53f3253a595cd287acef2e4536
--- /dev/null
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.rrh.usrpb210.conf
@@ -0,0 +1,189 @@
+Active_eNBs = ( "eNB_Eurecom_LTEBox");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+
+eNBs =
+(
+ {
+    ////////// Identification parameters:
+    eNB_ID    =  0xe00;
+
+    cell_type =  "CELL_MACRO_ENB";
+
+    eNB_name  =  "eNB_Eurecom_LTEBox";
+
+    // Tracking area code, 0x0000 and 0xfffe are reserved values
+    tracking_area_code  =  "1";
+
+    mobile_country_code =  "208";
+
+    mobile_network_code =  "93";
+
+       ////////// Physical parameters:
+
+    component_carriers = (
+      {
+      frame_type					      = "FDD";
+      tdd_config 					      = 3;
+      tdd_config_s            			      = 0;
+      prefix_type             			      = "NORMAL";
+      eutra_band              			      = 7;
+      downlink_frequency      			      = 2660000000L;
+      uplink_frequency_offset 			      = -120000000;
+      Nid_cell					      = 0;
+      N_RB_DL                 			      = 25;
+      Nid_cell_mbsfn          			      = 0;
+      nb_antennas_tx          			      = 1;
+      nb_antennas_rx          			      = 1;
+      tx_gain                                            = 90;
+      rx_gain                                            = 125;
+      prach_root              			      = 0;
+      prach_config_index      			      = 0;
+      prach_high_speed        			      = "DISABLE";
+      prach_zero_correlation  			      = 1;
+      prach_freq_offset       			      = 2;
+      pucch_delta_shift       			      = 1;
+      pucch_nRB_CQI           			      = 1;
+      pucch_nCS_AN            			      = 0;
+      pucch_n1_AN             			      = 32;
+      pdsch_referenceSignalPower 			      = -29;
+      pdsch_p_b                  			      = 0;
+      pusch_n_SB                 			      = 1;
+      pusch_enable64QAM          			      = "DISABLE";
+      pusch_hoppingMode                                  = "interSubFrame";
+      pusch_hoppingOffset                                = 0;
+      pusch_groupHoppingEnabled  			      = "ENABLE";
+      pusch_groupAssignment      			      = 0;
+      pusch_sequenceHoppingEnabled		   	      = "DISABLE";
+      pusch_nDMRS1                                       = 1;
+      phich_duration                                     = "NORMAL";
+      phich_resource                                     = "ONESIXTH";
+      srs_enable                                         = "DISABLE";
+      /*  srs_BandwidthConfig                                =;
+      srs_SubframeConfig                                 =;
+      srs_ackNackST                                      =;
+      srs_MaxUpPts                                       =;*/
+
+      pusch_p0_Nominal                                   = -90;
+      pusch_alpha                                        = "AL1";
+      pucch_p0_Nominal                                   = -96;
+      msg3_delta_Preamble                                = 6;
+      pucch_deltaF_Format1                               = "deltaF2";
+      pucch_deltaF_Format1b                              = "deltaF3";
+      pucch_deltaF_Format2                               = "deltaF0";
+      pucch_deltaF_Format2a                              = "deltaF0";
+      pucch_deltaF_Format2b		    	      = "deltaF0";
+
+      rach_numberOfRA_Preambles                          = 64;
+      rach_preamblesGroupAConfig                         = "DISABLE";
+      /*
+      rach_sizeOfRA_PreamblesGroupA                      = ;
+      rach_messageSizeGroupA                             = ;
+      rach_messagePowerOffsetGroupB                      = ;
+      */
+      rach_powerRampingStep                              = 4;
+      rach_preambleInitialReceivedTargetPower            = -108;
+      rach_preambleTransMax                              = 10;
+      rach_raResponseWindowSize                          = 10;
+      rach_macContentionResolutionTimer                  = 48;
+      rach_maxHARQ_Msg3Tx                                = 4;
+
+      pcch_default_PagingCycle                           = 128;
+      pcch_nB                                            = "oneT";
+      bcch_modificationPeriodCoeff			      = 2;
+      ue_TimersAndConstants_t300			      = 1000;
+      ue_TimersAndConstants_t301			      = 1000;
+      ue_TimersAndConstants_t310			      = 1000;
+      ue_TimersAndConstants_t311			      = 10000;
+      ue_TimersAndConstants_n310			      = 20;
+      ue_TimersAndConstants_n311			      = 1;
+
+      }
+    );
+
+
+    srb1_parameters :
+    {
+        # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
+        timer_poll_retransmit    = 80;
+
+        # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
+        timer_reordering         = 35;
+
+        # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
+        timer_status_prohibit    = 0;
+
+        # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
+        poll_pdu                 =  4;
+
+        # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
+        poll_byte                =  99999;
+
+        # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
+        max_retx_threshold       =  4;
+    }
+
+    # ------- SCTP definitions
+    SCTP :
+    {
+        # Number of streams to use in input/output
+        SCTP_INSTREAMS  = 2;
+        SCTP_OUTSTREAMS = 2;
+    };
+
+
+    ////////// MME parameters:
+    mme_ip_address      = ( { ipv4       = "192.168.12.11";
+                              ipv6       = "192:168:30::17";
+                              active     = "yes";
+                              preference = "ipv4";
+                            }
+                          );
+
+    NETWORK_INTERFACES :
+    {
+
+        ENB_INTERFACE_NAME_FOR_S1_MME            = "eth3";
+        ENB_IPV4_ADDRESS_FOR_S1_MME              = "192.168.12.215/24";
+        ENB_INTERFACE_NAME_FOR_S1U               = "eth3";
+        ENB_IPV4_ADDRESS_FOR_S1U                 = "192.168.12.215/24";
+        ENB_PORT_FOR_S1U                         = 2152; # Spec 2152
+    };
+
+    rrh_gw_config = (
+    {			  
+        local_if_name = "eth0";			  
+    	#remote_address = "169.254.10.158";	
+    	#local_address = "169.254.8.15";				  
+   	remote_address = "74:d4:35:cc:88:e3";
+    	local_address = "74:d4:35:cc:88:d1";    
+    	local_port = 50000;	#for raw option local port must be the same to remote	       
+    	remote_port = 50000; 
+    	rrh_gw_active = "yes";
+    	tr_preference = "raw";
+    	rf_preference = "usrp_b200";
+    	iq_txshift = 4;
+    	tx_sample_advance = 80;	
+    	tx_scheduling_advance = 9; 	                
+    }
+    );  
+
+    log_config :
+    {
+      global_log_level                      ="info";
+      global_log_verbosity                  ="medium";
+      hw_log_level                          ="info";
+      hw_log_verbosity                      ="medium";
+      phy_log_level                         ="info";
+      phy_log_verbosity                     ="medium";
+      mac_log_level                         ="info";
+      mac_log_verbosity                     ="high";
+      rlc_log_level                         ="info";
+      rlc_log_verbosity                     ="medium";
+      pdcp_log_level                        ="info";
+      pdcp_log_verbosity                    ="medium";
+      rrc_log_level                         ="info";
+      rrc_log_verbosity                     ="medium";
+   };
+  }
+);
\ No newline at end of file
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
index 2f11e42ba9d817b5e5c11c1f6ed91bd9475b8e0d..967b0c0ca87df9807e778d8395a949cf04987407 100644
--- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -23,46 +23,46 @@ eNBs =
 
     component_carriers = (
       {
-      frame_type					      = "FDD";
-      tdd_config 					      = 3;
-      tdd_config_s            			      = 0;
-      prefix_type             			      = "NORMAL";
-      eutra_band              			      = 7;
-      downlink_frequency      			      = 2680000000L;
-      uplink_frequency_offset 			      = -120000000;
-      Nid_cell					      = 0;
-      N_RB_DL                 			      = 25;
-      Nid_cell_mbsfn          			      = 0;
-      nb_antennas_tx          			      = 1;
-      nb_antennas_rx          			      = 1;
-      tx_gain                                            = 90;
-      rx_gain                                            = 120;
-      prach_root              			      = 0;
-      prach_config_index      			      = 0;
-      prach_high_speed        			      = "DISABLE";
-      prach_zero_correlation  			      = 1;
-      prach_freq_offset       			      = 2;
-      pucch_delta_shift       			      = 1;
-      pucch_nRB_CQI           			      = 1;
-      pucch_nCS_AN            			      = 0;
-      pucch_n1_AN             			      = 32;
-      pdsch_referenceSignalPower 			      = -29;
-      pdsch_p_b                  			      = 0;
-      pusch_n_SB                 			      = 1;
-      pusch_enable64QAM          			      = "DISABLE";
-      pusch_hoppingMode                                  = "interSubFrame";
-      pusch_hoppingOffset                                = 0;
-      pusch_groupHoppingEnabled  			      = "ENABLE";
-      pusch_groupAssignment      			      = 0;
-      pusch_sequenceHoppingEnabled		   	      = "DISABLE";
-      pusch_nDMRS1                                       = 1;
-      phich_duration                                     = "NORMAL";
-      phich_resource                                     = "ONESIXTH";
-      srs_enable                                         = "DISABLE";
-      /*  srs_BandwidthConfig                                =;
-      srs_SubframeConfig                                 =;
-      srs_ackNackST                                      =;
-      srs_MaxUpPts                                       =;*/
+        frame_type					      = "FDD";
+        tdd_config 					      = 3;
+        tdd_config_s            			      = 0;
+        prefix_type             			      = "NORMAL";
+        eutra_band              			      = 7;
+        downlink_frequency      			      = 2680000000L;
+        uplink_frequency_offset 			      = -120000000;
+        Nid_cell					      = 0;
+        N_RB_DL                 			      = 25;
+        Nid_cell_mbsfn          			      = 0;
+        nb_antennas_tx          			      = 1;
+        nb_antennas_rx          			      = 1;
+        tx_gain                                            = 90;
+        rx_gain                                            = 125;
+        prach_root              			      = 0;
+        prach_config_index      			      = 0;
+        prach_high_speed        			      = "DISABLE";
+        prach_zero_correlation  			      = 1;
+        prach_freq_offset       			      = 2;
+        pucch_delta_shift       			      = 1;
+        pucch_nRB_CQI           			      = 1;
+        pucch_nCS_AN            			      = 0;
+        pucch_n1_AN             			      = 32;
+        pdsch_referenceSignalPower 			      = -29;
+        pdsch_p_b                  			      = 0;
+        pusch_n_SB                 			      = 1;
+        pusch_enable64QAM          			      = "DISABLE";
+        pusch_hoppingMode                                  = "interSubFrame";
+        pusch_hoppingOffset                                = 0;
+        pusch_groupHoppingEnabled  			      = "ENABLE";
+        pusch_groupAssignment      			      = 0;
+        pusch_sequenceHoppingEnabled		   	      = "DISABLE";
+        pusch_nDMRS1                                       = 1;
+        phich_duration                                     = "NORMAL";
+        phich_resource                                     = "ONESIXTH";
+        srs_enable                                         = "DISABLE";
+        /*  srs_BandwidthConfig                                =;
+        srs_SubframeConfig                                 =;
+        srs_ackNackST                                      =;
+        srs_MaxUpPts                                       =;*/
 
       pusch_p0_Nominal                                   = -90;
       pusch_alpha                                        = "AL1";
@@ -74,34 +74,32 @@ eNBs =
       pucch_deltaF_Format2a                              = "deltaF0";
       pucch_deltaF_Format2b		    	      = "deltaF0";
 
-      rach_numberOfRA_Preambles                          = 64;
-      rach_preamblesGroupAConfig                         = "DISABLE";
-      /*
-      rach_sizeOfRA_PreamblesGroupA                      = ;
-      rach_messageSizeGroupA                             = ;
-      rach_messagePowerOffsetGroupB                      = ;
-      */
-      rach_powerRampingStep                              = 4;
-      rach_preambleInitialReceivedTargetPower            = -108;
-      rach_preambleTransMax                              = 10;
-      rach_raResponseWindowSize                          = 10;
-      rach_macContentionResolutionTimer                  = 48;
-      rach_maxHARQ_Msg3Tx                                = 4;
-
-      pcch_default_PagingCycle                           = 128;
-      pcch_nB                                            = "oneT";
-      bcch_modificationPeriodCoeff			      = 2;
-      ue_TimersAndConstants_t300			      = 1000;
-      ue_TimersAndConstants_t301			      = 1000;
-      ue_TimersAndConstants_t310			      = 1000;
-      ue_TimersAndConstants_t311			      = 10000;
-      ue_TimersAndConstants_n310			      = 20;
-      ue_TimersAndConstants_n311			      = 1;
-
+        rach_numberOfRA_Preambles                          = 64;
+        rach_preamblesGroupAConfig                         = "DISABLE";
+        /*
+        rach_sizeOfRA_PreamblesGroupA                      = ;
+        rach_messageSizeGroupA                             = ;
+        rach_messagePowerOffsetGroupB                      = ;
+        */
+        rach_powerRampingStep                              = 4;
+        rach_preambleInitialReceivedTargetPower            = -108;
+        rach_preambleTransMax                              = 10;
+        rach_raResponseWindowSize                          = 10;
+        rach_macContentionResolutionTimer                  = 48;
+        rach_maxHARQ_Msg3Tx                                = 4;
+
+        pcch_default_PagingCycle                           = 128;
+        pcch_nB                                            = "oneT";
+        bcch_modificationPeriodCoeff			      = 2;
+        ue_TimersAndConstants_t300			      = 1000;
+        ue_TimersAndConstants_t301			      = 1000;
+        ue_TimersAndConstants_t310			      = 1000;
+        ue_TimersAndConstants_t311			      = 10000;
+        ue_TimersAndConstants_n310			      = 20;
+        ue_TimersAndConstants_n311			      = 1;
       }
     );
 
-
     srb1_parameters :
     {
         # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
@@ -131,7 +129,6 @@ eNBs =
         SCTP_OUTSTREAMS = 2;
     };
 
-
     ////////// MME parameters:
     mme_ip_address      = ( { ipv4       = "192.168.12.11";
                               ipv6       = "192:168:30::17";
@@ -143,10 +140,10 @@ eNBs =
     NETWORK_INTERFACES :
     {
         ENB_INTERFACE_NAME_FOR_S1_MME            = "eth0";
-        ENB_IPV4_ADDRESS_FOR_S1_MME              = "192.168.12.216/24";
+        ENB_IPV4_ADDRESS_FOR_S1_MME              = "192.168.12.213/24";
 
         ENB_INTERFACE_NAME_FOR_S1U               = "eth0";
-        ENB_IPV4_ADDRESS_FOR_S1U                 = "192.168.12.216/24";
+        ENB_IPV4_ADDRESS_FOR_S1U                 = "192.168.12.213/24";
         ENB_PORT_FOR_S1U                         = 2152; # Spec 2152
     };
 
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf
deleted file mode 100644
index 7bc8e8593ac5297209ebad2acb2ca3cf2ac64b7c..0000000000000000000000000000000000000000
--- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.epc.remote.conf
+++ /dev/null
@@ -1,167 +0,0 @@
-Active_eNBs = ( "eNB_Eurecom_LTEBox");
-# Asn1_verbosity, choice in: none, info, annoying
-Asn1_verbosity = "none";
-
-eNBs =
-(
- {
-    ////////// Identification parameters:
-    eNB_ID    =  0xe00;
-
-    cell_type =  "CELL_MACRO_ENB";
-
-    eNB_name  =  "eNB_Eurecom_LTEBox";
-
-    // Tracking area code, 0x0000 and 0xfffe are reserved values
-    tracking_area_code  =  "1";
-
-    mobile_country_code =  "208";
-    mobile_network_code =  "92";
-
-       ////////// Physical parameters:
-
-    component_carriers = (
-      {
-        frame_type					      = "FDD";
-        tdd_config 					      = 3;
-        tdd_config_s            			      = 0;
-        prefix_type             			      = "NORMAL";
-        eutra_band              			      = 7;
-        downlink_frequency      			      = 2660000000L;
-        uplink_frequency_offset 			      = -120000000;
-        Nid_cell					      = 0;
-        N_RB_DL                 			      = 25;
-        Nid_cell_mbsfn          			      = 0;
-        nb_antennas_tx          			      = 1;
-        nb_antennas_rx          			      = 1;
-        tx_gain                                            = 90;
-        rx_gain                                            = 119;
-        prach_root              			      = 0;
-        prach_config_index      			      = 0;
-        prach_high_speed        			      = "DISABLE";
-        prach_zero_correlation  			      = 1;
-        prach_freq_offset       			      = 2;
-        pucch_delta_shift       			      = 1;
-        pucch_nRB_CQI           			      = 1;
-        pucch_nCS_AN            			      = 0;
-        pucch_n1_AN             			      = 32;
-        pdsch_referenceSignalPower 			      = -26;
-        pdsch_p_b                  			      = 0;
-        pusch_n_SB                 			      = 1;
-        pusch_enable64QAM          			      = "DISABLE";
-        pusch_hoppingMode                                  = "interSubFrame";
-        pusch_hoppingOffset                                = 0;
-        pusch_groupHoppingEnabled  			      = "ENABLE";
-        pusch_groupAssignment      			      = 0;
-        pusch_sequenceHoppingEnabled		   	      = "DISABLE";
-        pusch_nDMRS1                                       = 1;
-        phich_duration                                     = "NORMAL";
-        phich_resource                                     = "ONESIXTH";
-        srs_enable                                         = "DISABLE";
-      /*  srs_BandwidthConfig                                =;
-        srs_SubframeConfig                                 =;
-        srs_ackNackST                                      =;
-        srs_MaxUpPts                                       =;*/
-
-        pusch_p0_Nominal                                   = -90;
-        pusch_alpha                                        = "AL1";
-        pucch_p0_Nominal                                   = -108;
-        msg3_delta_Preamble                                = 6;
-        pucch_deltaF_Format1                               = "deltaF2";
-        pucch_deltaF_Format1b                              = "deltaF3";
-        pucch_deltaF_Format2                               = "deltaF0";
-        pucch_deltaF_Format2a                              = "deltaF0";
-        pucch_deltaF_Format2b		    	      = "deltaF0";
-
-        rach_numberOfRA_Preambles                          = 64;
-        rach_preamblesGroupAConfig                         = "DISABLE";
-      /*
-        rach_sizeOfRA_PreamblesGroupA                      = ;
-        rach_messageSizeGroupA                             = ;
-        rach_messagePowerOffsetGroupB                      = ;
-      */
-        rach_powerRampingStep                              = 4;
-        rach_preambleInitialReceivedTargetPower            = -108;
-        rach_preambleTransMax                              = 10;
-        rach_raResponseWindowSize                          = 10;
-        rach_macContentionResolutionTimer                  = 48;
-        rach_maxHARQ_Msg3Tx                                = 4;
-
-        pcch_default_PagingCycle                           = 128;
-        pcch_nB                                            = "oneT";
-        bcch_modificationPeriodCoeff			      = 2;
-        ue_TimersAndConstants_t300			      = 1000;
-        ue_TimersAndConstants_t301			      = 1000;
-        ue_TimersAndConstants_t310			      = 1000;
-        ue_TimersAndConstants_t311			      = 10000;
-        ue_TimersAndConstants_n310			      = 20;
-        ue_TimersAndConstants_n311			      = 1;
-      }
-    );
-
-
-    srb1_parameters :
-    {
-        # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
-        timer_poll_retransmit    = 80;
-
-        # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
-        timer_reordering         = 35;
-
-        # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
-        timer_status_prohibit    = 0;
-
-        # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
-        poll_pdu                 =  4;
-
-        # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
-        poll_byte                =  99999;
-
-        # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
-        max_retx_threshold       =  4;
-    }
-
-    # ------- SCTP definitions
-    SCTP :
-    {
-        # Number of streams to use in input/output
-        SCTP_INSTREAMS  = 2;
-        SCTP_OUTSTREAMS = 2;
-    };
-
-    ////////// MME parameters:
-    mme_ip_address      = ( {ipv4 = "192.168.12.26";
-                              ipv6="192:168:30::17";
-                              active="yes";
-                              preference="ipv4";});
-
-    NETWORK_INTERFACES :
-    {
-        ENB_INTERFACE_NAME_FOR_S1_MME            = "eth1";
-        ENB_IPV4_ADDRESS_FOR_S1_MME              = "192.168.12.82/24";
-
-        ENB_INTERFACE_NAME_FOR_S1U               = "eth1";
-        ENB_IPV4_ADDRESS_FOR_S1U                 = "192.168.12.82/24";
-        ENB_PORT_FOR_S1U                         = 2152; # Spec 2152
-    };
-
-    log_config :
-    {
-      global_log_level                      ="debug";
-      global_log_verbosity                  ="medium";
-      hw_log_level                          ="info";
-      hw_log_verbosity                      ="medium";
-      phy_log_level                         ="info";
-      phy_log_verbosity                     ="medium";
-      mac_log_level                         ="info";
-      mac_log_verbosity                     ="high";
-      rlc_log_level                         ="info";
-      rlc_log_verbosity                     ="medium";
-      pdcp_log_level                        ="info";
-      pdcp_log_verbosity                    ="medium";
-      rrc_log_level                         ="info";
-      rrc_log_verbosity                     ="medium";
-   };
-
-  }
-);
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.usrpb210.conf
index 57a43fb4146d320c25580c96429639132c9a59e4..6e3357e49b5ee8cef961837ffeefbea21e3a29da 100644
--- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.usrpb210.conf
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.usrpb210.conf
@@ -36,7 +36,7 @@ eNBs =
                            nb_antennas_tx          			      = 2;
                            nb_antennas_rx          			      = 2; 
 			   tx_gain                                            = 90;
-			   rx_gain                                            = 115;
+			   rx_gain                                            = 132;
                            prach_root              			      = 0;
                            prach_config_index      			      = 0;
                            prach_high_speed        			      = "DISABLE";
@@ -132,7 +132,7 @@ eNBs =
     };
     
     ////////// MME parameters:
-    mme_ip_address      = ( { ipv4       = "192.168.13.11";
+    mme_ip_address      = ( { ipv4       = "192.168.12.11";
                               ipv6       = "192:168:30::17";
                               active     = "yes";
                               preference = "ipv4";
@@ -142,10 +142,10 @@ eNBs =
     NETWORK_INTERFACES : 
     {
         ENB_INTERFACE_NAME_FOR_S1_MME            = "eth0";
-        ENB_IPV4_ADDRESS_FOR_S1_MME              = "192.168.13.10/24";
+        ENB_IPV4_ADDRESS_FOR_S1_MME              = "192.168.12.213/24";
 
         ENB_INTERFACE_NAME_FOR_S1U               = "eth0";
-        ENB_IPV4_ADDRESS_FOR_S1U                 = "192.168.13.10/24";
+        ENB_IPV4_ADDRESS_FOR_S1U                 = "192.168.12.213/24";
         ENB_PORT_FOR_S1U                         = 2152; # Spec 2152
     };
     
diff --git a/targets/RT/USER/Makefile b/targets/RT/USER/Makefile
index c0efdd2f7c5f6e790059a0f04e7d159532d7ec6a..621f30c5f41268f8009ee53646d652dcd3628719 100644
--- a/targets/RT/USER/Makefile
+++ b/targets/RT/USER/Makefile
@@ -8,14 +8,14 @@ include $(OPENAIR_TARGETS)/Makefile.common
 
 KERNEL_VERSION:=$(shell echo `uname -r | cut -d. -f-2`)
 KERNEL_TYPE:=$(shell echo `uname -r | cut -d. -f-3 | cut -d- -f3`)
-LOWLATENCY_KERNEL:=$(shell if [ $(KERNEL_TYPE) = "lowlatency" ]; then echo "1" ; else echo "0" ; fi)
+DEADLINE_SCHEDULER_KERNEL:=$(shell if [ $(KERNEL_TYPE) = "lowlatency" ]; then echo "1" ; else echo "0" ; fi)
 
 include $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc
 
 ifdef EXMIMO
-#ifdef LOWLATENCY # this ifdef is to be removed after the debugging
-ifeq ($(LOWLATENCY_KERNEL),1)
-CFLAGS+=-DLOWLATENCY
+#ifdef DEADLINE_SCHEDULER # this ifdef is to be removed after the debugging
+ifeq ($(DEADLINE_SCHEDULER_KERNEL),1)
+CFLAGS+=-DDEADLINE_SCHEDULER
 endif 
 #endif 
 endif
@@ -431,7 +431,7 @@ show:
 	@echo IS_REL10 is $(IS_REL10)
 	@echo openssl $(OPENSSL_FOUND) 
 	@echo nettle $(NETTLE_FOUND)
-	@echo lowlatency kernel: $(LOWLATENCY_KERNEL)
+	@echo lowlatency kernel: $(DEADLINE_SCHEDULER_KERNEL)
 
 beautiful:
 	astyle --style=gnu -s2 $(SRC)
diff --git a/targets/RT/USER/UE_transport_IQ.c b/targets/RT/USER/UE_transport_IQ.c
index a52e3654aec845ab9666e7402fc0db65f2db81d1..a45b8ba43b40171e106689ea91ef32d90fdbb852 100644
--- a/targets/RT/USER/UE_transport_IQ.c
+++ b/targets/RT/USER/UE_transport_IQ.c
@@ -148,7 +148,7 @@ void *rrh_proc_UE_thread(void * arg) {
   unsigned int                  samples_per_frame=0;
   rrh_module_t 	*dev=(rrh_module_t *)arg;
   
-  samples_per_frame= dev->eth_dev.openair0_cfg.samples_per_frame;
+  samples_per_frame= dev->eth_dev.openair0_cfg->samples_per_frame;
   AssertFatal(samples_per_frame <=0, "invalide samples_per_frame !%u\n",samples_per_frame);
 
   time_req.tv_sec = 0;
@@ -260,7 +260,7 @@ void *rrh_UE_thread(void *arg) {
   void 			*tmp;
   unsigned int          samples_per_frame=0;
   
-  samples_per_frame= dev->eth_dev.openair0_cfg.samples_per_frame;
+  samples_per_frame= dev->eth_dev.openair0_cfg->samples_per_frame;
   time_req_1us.tv_sec = 0;
   time_req_1us.tv_nsec = 1000;
   
@@ -269,26 +269,26 @@ void *rrh_UE_thread(void *arg) {
     cmd=dev->eth_dev.trx_start_func(&dev->eth_dev);
     
     /* allocate memory for TX/RX buffers */
-    rx_buffer_UE = (int32_t**)malloc16(dev->eth_dev.openair0_cfg.rx_num_channels*sizeof(int32_t*));
-    tx_buffer_UE = (int32_t**)malloc16(dev->eth_dev.openair0_cfg.tx_num_channels*sizeof(int32_t*));
+    rx_buffer_UE = (int32_t**)malloc16(dev->eth_dev.openair0_cfg->rx_num_channels*sizeof(int32_t*));
+    tx_buffer_UE = (int32_t**)malloc16(dev->eth_dev.openair0_cfg->tx_num_channels*sizeof(int32_t*));
     
-    for (i=0; i<dev->eth_dev.openair0_cfg.rx_num_channels; i++) {
+    for (i=0; i<dev->eth_dev.openair0_cfg->rx_num_channels; i++) {
       tmp=(void *)malloc(sizeof(int32_t)*(samples_per_frame+4));
       memset(tmp,0,sizeof(int32_t)*(samples_per_frame+4));
       rx_buffer_UE[i]=(tmp+4*sizeof(int32_t));  
     }
     
-    for (i=0; i<dev->eth_dev.openair0_cfg.tx_num_channels; i++) {
+    for (i=0; i<dev->eth_dev.openair0_cfg->tx_num_channels; i++) {
       tmp=(void *)malloc(sizeof(int32_t)*(samples_per_frame+4));
       memset(tmp,0,sizeof(int32_t)*(samples_per_frame+4));
       tx_buffer_UE[i]=(tmp+4*sizeof(int32_t));  
     }
     
-    printf("Client %s:%d is connected (DL_RB=%d) rt=%d|%d. \n" ,   dev->eth_dev.openair0_cfg.remote_ip,
-	   dev->eth_dev.openair0_cfg.remote_port,
-	   dev->eth_dev.openair0_cfg.num_rb_dl,
-	   dev->eth_dev.openair0_cfg.rx_num_channels,
-	   dev->eth_dev.openair0_cfg.tx_num_channels);
+    printf("Client %s:%d is connected (DL_RB=%d) rt=%d|%d. \n" ,   dev->eth_dev.openair0_cfg->remote_addr,
+	   dev->eth_dev.openair0_cfg->remote_port,
+	   dev->eth_dev.openair0_cfg->num_rb_dl,
+	   dev->eth_dev.openair0_cfg->rx_num_channels,
+	   dev->eth_dev.openair0_cfg->tx_num_channels);
     
     if (cmd==START_CMD) {
       
@@ -348,8 +348,8 @@ void *rrh_UE_rx_thread(void *arg) {
   openair0_timestamp  temp, last_hw_counter=0;
   
   antenna_index     = 0;
-  nsamps	    = dev->eth_dev.openair0_cfg.samples_per_packet;
-  samples_per_frame = dev->eth_dev.openair0_cfg.samples_per_frame;
+  nsamps	    = dev->eth_dev.openair0_cfg->samples_per_packet;
+  samples_per_frame = dev->eth_dev.openair0_cfg->samples_per_frame;
   
   while (rrh_exit == 0) {
     if (!UE_rx_started) {
@@ -492,8 +492,8 @@ void *rrh_UE_tx_thread(void *arg) {
   unsigned int          samples_per_frame=0;
   
   antenna_index    = 0;
-  nsamps 	   = dev->eth_dev.openair0_cfg.samples_per_packet;
-  samples_per_frame = dev->eth_dev.openair0_cfg.samples_per_frame;
+  nsamps 	   = dev->eth_dev.openair0_cfg->samples_per_packet;
+  samples_per_frame = dev->eth_dev.openair0_cfg->samples_per_frame;
   
   
   while (rrh_exit == 0) {
diff --git a/targets/RT/USER/dot11.c b/targets/RT/USER/dot11.c
deleted file mode 100644
index 00e535a21d4304bee99a00424dfbeb723e2a13cb..0000000000000000000000000000000000000000
--- a/targets/RT/USER/dot11.c
+++ /dev/null
@@ -1,1275 +0,0 @@
-/*******************************************************************************
-
-  Eurecom OpenAirInterface
-  Copyright(c) 1999 - 2011 Eurecom
-
-  This program is free software; you can redistribute it and/or modify it
-  under the terms and conditions of the GNU General Public License,
-  version 2, as published by the Free Software Foundation.
-
-  This program is distributed in the hope it will be useful, but WITHOUT
-  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-  more details.
-
-  You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc.,
-  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
-
-  The full GNU General Public License is included in this distribution in
-  the file called "COPYING".
-
-  Contact Information
-  Openair Admin: openair_admin@eurecom.fr
-  Openair Tech : openair_tech@eurecom.fr
-  Forums       : http://forums.eurecom.fsr/openairinterface
-  Address      : Eurecom, 2229, route des crêtes, 06560 Valbonne Sophia Antipolis, France
-
-*******************************************************************************/
-
-<<<<<<< .mine
-/*! \file dot11.c
-* \brief main program to control HW and scheduling for openairITS dot11 MODEM
-* \author R. Knopp, F. Kaltenberger
-* \date 2012
-* \version 0.1
-* \company Eurecom
-* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr
-* \note
-* \warning
-*/
-=======
-  /*! \file dot11.c
-   * \brief main program to control HW and scheduling for openairITS dot11 MODEM
-   * \author R. Knopp, F. Kaltenberger
-   * \date 2012
-   * \version 0.1
-   * \company Eurecom
-   * \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr
-   * \note
-   * \warning
-   */
-  >>>>>>> .r3153
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <sched.h>
-#include <signal.h>
-#include <execinfo.h>
-#include <getopt.h>
-
-#include <rtai_lxrt.h>
-#include <rtai_sem.h>
-#include <rtai_msg.h>
-
-#include "PHY/types.h"
-#include "PHY/defs.h"
-
-#include "ARCH/COMMON/defs.h"
-#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h"
-#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_pci.h"
-#include "SIMULATION/LTE_PHY/openair_hw.h"
-
-#include "ARCH/CBMIMO1/DEVICE_DRIVER/vars.h"
-#include "SCHED/defs.h"
-#include "SCHED/vars.h"
-
-
-  <<<<<<< .mine
-#include "phy/DOT11/defs.h"
-#include "phy/DOT11/commonvars.h"
-#include <malloc.h>
-  =======
-#include "phy/DOT11/defs.h"
-#include "phy/DOT11/commonvars.h"
-#include "PHY/TOOLS/defs.h"
-    >>>>>>> .r3153
-
-    <<<<<<< .mine
-    =======
-#include <malloc.h>
-      >>>>>>> .r3153
-
-      <<<<<<< .mine
-#include "UTIL/LOG/log.h"
-      =======
-        >>>>>>> .r3153
-
-        <<<<<<< .mine
-#define FRAME_LENGTH_SAMPLES_MAX 100000
-
-        uint16_t rev64[64];
-
-int generate_test_tx=0;
-
-
-
-
-=======
-#include "UTIL/LOG/log.h"
-#include "ieee80211p-netlinkapi.h"
-
-#define FRAME_LENGTH_SAMPLES_MAX 100000
-
-  uint16_t rev64[64];
-
-int generate_test_tx=0;
-
-
-
-
->>>>>>> .r3153
-#define FRAME_PERIOD 100000000ULL
-#define DAQ_PERIOD 66666ULL
-
-
-#undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all
-enum nl80211_band {
-  NL80211_BAND_2GHZ,
-  NL80211_BAND_5GHZ,
-  NL80211_BAND_5_9GHZ,
-  NL80211_BAND_0_8GHZ,
-};
-
-<<<<<<< .mine
-
-=======
-  enum ieee80211_band {
-    IEEE80211_BAND_2GHZ = NL80211_BAND_2GHZ,
-    IEEE80211_BAND_5GHZ = NL80211_BAND_5GHZ,
-    IEEE80211_BAND_5_9GHZ = NL80211_BAND_5_9GHZ,
-    IEEE80211_BAND_0_8GHZ = NL80211_BAND_0_8GHZ,
-  };
-
-struct ieee80211p_rx_status {
-  short data_len; //frame data length in bytes
-  char  rssi;     //received power in dBm
-  char  rate;     //reveived data rate in units of 100 kbps
-  enum ieee80211_band band;
-  char  flags;    //RX flags
-}; /* struct ieee80211p_rx_status */
-
-
->>>>>>> .r3153
-//static CND *cond;
-
-static int thread1;
-static int thread2;
-
-static int sync_thread;
-
-
-static int instance_cnt=-1; //0 means worker is busy, -1 means its free
-int instance_cnt_ptr_kern,*instance_cnt_ptr_user;
-int pci_interface_ptr_kern;
-
-extern unsigned int bigphys_top;
-extern unsigned int mem_base;
-
-int openair_fd = 0;
-
-int oai_exit = 0;
-
-//PCI_interface_t *pci_interface[3];
-
-unsigned int *DAQ_MBOX;
-
-unsigned int time_offset[4] = {0,0,0,0};
-
-int fs4_test=0;
-char UE_flag=0;
-
-struct timing_info_t {
-  unsigned int frame, hw_slot, last_slot, next_slot;
-  RTIME time0, time1, time2;
-  unsigned int mbox0, mbox1, mbox2, mbox_target;
-} timing_info[20];
-
-extern s16* sync_corr_ue0;
-extern s16 prach_ifft[4][1024*2];
-
-typedef enum {normal_txrx=0,rx_calib_ue=1,rx_calib_ue_med=2,rx_calib_ue_byp=3} runmode_t;
-
-runmode_t mode;
-int rx_input_level_dBm;
-
-
-int otg_enabled = 0;
-
-TX_RX_VARS dummy_tx_rx_vars;
-unsigned int bigphys_top;
-unsigned int mem_base;
-
-<<<<<<< .mine
-uint32_t *txdata[2],*rxdata[2];
-
-uint8_t *data_ind = NULL;
-
-extern int dot11_netlink_init();
-extern void *rx_thread(void *);
-extern void *tx_thread(void *);
-
-
-void dot11_init()
-{
-
-
-
-  set_taus_seed(0);
-
-  // Basic initializations
-  init_fft(64,6,rev64);
-  init_interleavers();
-  ccodedot11_init();
-  ccodedot11_init_inv();
-  phy_generate_viterbi_tables();
-
-  init_crc32();
-
-}
-=======
-  uint32_t *txdata[2],*rxdata[2];
->>>>>>> .r3153
-
-<<<<<<< .mine
-void generate_test_tx_signal()
-{
-  =======
-    uint8_t *data_ind = NULL;
-  >>>>>>> .r3153
-
-  <<<<<<< .mine
-  TX_VECTOR_t tx_vector;
-  int i;
-
-  if (data_ind == NULL) {
-    data_ind = (uint8_t*)malloc(4095+2+1);
-    data_ind[0] = 0;
-    data_ind[1] = 0;
-  }
-
-
-  tx_vector.rate=1;
-  tx_vector.sdu_length=512;
-  tx_vector.service=0;
-
-  for (i=0; i<tx_vector.sdu_length; i++)
-    data_ind[i+2] = taus();  // randomize packet
-
-  data_ind[tx_vector.sdu_length+2+4]=0;  // Tail byte
-
-
-  printf("Generating signal at %p\n",txdata[0]);
-  phy_tx_start(&tx_vector,txdata[0],0,data_ind);
-
-}
-
-void signal_handler(int sig)
-{
-  void *array[10];
-  size_t size;
-  =======
-    CHANNEL_STATUS_t dot11_state = IDLE;
-  extern int Ndbps[8];
-  >>>>>>> .r3153
-
-  extern int32_t rxDATA_F_comp_aggreg3[48*1024];
-  extern int32_t rxDATA_F_comp_aggreg2[48*1024];
-
-#define FRAME_LENGTH_SAMPLES 76800
-#define RX_THRES 60
-
-#define SLOT_DURATION_5MHz 105
-#define RX_THRES_dB 300
-
-  u32 rxgain[4]= {30,30,30,30};
-  unsigned int rxg_max[4]= {133,133,133,133}, rxg_med[4]= {127,127,127,127}, rxg_byp[4]= {120,120,120,120};
-
-  extern int tx_sdu_active;
-  extern int tx_sdu_length;
-  extern char rxsdu[2000];
-  int n;
-
-  static void *rx_thread(void *arg) {
-
-    int fd = *((int*)arg);
-    int rx_offset;
-    RX_VECTOR_t *rxv;
-    uint8_t *data_ind_rx;
-    int i;
-    struct ieee80211p_rx_status *rs;
-    int ret,frame;
-    RT_TASK *task;
-    int16_t rx_energy;
-    int initial_sample_offset = 0,off=0;
-    int dlen,dlen_symb;
-    int mbox_off = 0,old_mbox,mbox_diff;
-    int rt_skip_cond;
-    int pos_crc=0,neg_crc=0;
-    int sdu_received;
-    int sample_threshold;
-    int log2_maxh;
-    struct sched_param mysched;
-    int skip=0;
-    int txlen;
-
-    /*  mysched.sched_priority = 99;
-
-        sched_setscheduler( 0, SCHED_FIFO, &mysched);
-    */
-    char dummy_data[16];
-
-
-    if (fd>0) {
-      printf("rx_thread starting, fd %d\n",fd);
-
-      data_ind_rx = (uint8_t*)malloc(4095+2+1+12);
-
-      task = rt_task_init_schmod(nam2num("TASK0"), 0, 0, 0, SCHED_FIFO, 0xF);
-      mlockall(MCL_CURRENT | MCL_FUTURE);
-
-      //  rt_make_hard_real_time();
-
-
-      //  printf("Started rx_thread ... MBOX %d\n",((unsigned int *)DAQ_MBOX)[0]);
-      // wait until MBOX gets around to zero
-      i=0;
-
-      while (((volatile unsigned int *)DAQ_MBOX)[0] != 0) {
-        rt_sleep(nano2count(10000));
-
-        if (i>1000) {
-          printf("HW not counting,exiting rx_thread\n");
-          return(0);
-        }
-      }
-
-      //  printf("Got first MBOX = 0\n");
-      // wait for first 120us
-      while (((unsigned int *)DAQ_MBOX)[0] < 2)
-        rt_sleep(nano2count(2*66666));
-
-      old_mbox = ((unsigned int *)DAQ_MBOX)[0];
-
-      //  printf("MBOX = %d\n",((unsigned int *)DAQ_MBOX)[0]);
-      i = 0;
-      frame = 0;
-      //  oai_exit=1;
-      rt_skip_cond=0;
-
-      while (!oai_exit) {
-
-        //    printf("While in ... mbox %d\n",((unsigned int *)DAQ_MBOX)[0]);
-
-        rx_energy = dB_fixed_times10(signal_energy((int32_t*)(rxdata[0]+(initial_sample_offset&(~0x1))),
-                                     SLOT_DURATION_5MHz - (SLOT_DURATION_5MHz&1)));
-
-        sdu_received = 0;
-
-        if (rx_energy>RX_THRES_dB) {
-          if (initial_sample_offset < SLOT_DURATION_5MHz)
-            off = initial_sample_offset + FRAME_LENGTH_SAMPLES - SLOT_DURATION_5MHz;
-          else
-            off = initial_sample_offset - SLOT_DURATION_5MHz;
-
-          if (((dot11_state = initial_sync(&rxv,
-                                           &rx_offset,
-                                           &log2_maxh,
-                                           rxdata[0],
-                                           FRAME_LENGTH_SAMPLES,
-                                           off,
-                                           1)) == BUSY)) {
-
-
-            //if ((frame % 100) == 0)
-            //  printf("Channel is busy, rxv %p, offset %d\n",(void*)rxv,rx_offset);
-
-            if (rxv) {
-              rx_energy = dB_fixed_times10(signal_energy((int32_t*)(rxdata[0]+rx_offset),
-                                           80));
-              //    if ((frame%100) == 0)
-              printf("Frame %d: Rate %d, SDU_LENGTH %d,rx_offset %d,log2_maxh %d, rxp %f dBm (dig %f,rxgain %d)\n",
-                     frame,rxv->rate,rxv->sdu_length,rx_offset,log2_maxh,(rx_energy/10.0)-rxg_max[0]+30-rxgain[0],
-                     rx_energy/10.0,rxg_max[0]-30+rxgain[0]);
-
-              if ((rxv->sdu_length > 1500) || (rxv->rate > 3) )
-                printf("ERROR: Frame %d: Rate %d, SDU_LENGTH %d,rx_offset %d,log2_maxh %d, rxp %f dBm (dig %f,rxgain %d)\n",
-                       frame,rxv->rate,rxv->sdu_length,rx_offset,log2_maxh,(rx_energy/10.0)-rxg_max[0]+30-rxgain[0],
-                       rx_energy/10.0,rxg_max[0]-30+rxgain[0]);
-              else {
-                memset((void*)&data_ind_rx[10],0,rxv->sdu_length+4+2+1+16);
-
-                <<<<<<< .mine
-                =======
-
-                  if (data_detection(rxv,&data_ind_rx[10],
-                                     (uint32_t*)rxdata[0],
-                76800,rx_offset,log2_maxh,NULL)) {
-                  pos_crc++;
-                  printf("Received SDU with positive CRC\n");
-
-                  if (fd) {
-                    rs = (struct ieee80211p_rx_status *)&data_ind_rx[0];
-                    rs->data_len = rxv->sdu_length;
-                    rs->rssi = (char)((rx_energy/10.0)-rxg_max[0]+30-rxgain[0]);
-                    rs->rate = 60;
-                    rs->band = IEEE80211_BAND_0_8GHZ;
-                    rs->flags = 0;
-                    ret = netlink_send(fd,NLCMD_DATA,128,&data_ind_rx[0]);
-                  }
-
-                } else {
-                  neg_crc++;
-                  printf("Received SDU with negative CRC\n");
-                  oai_exit=1;
-                  write_output("rxDATA_F_comp_aggreg3.m","rxDAT_F_comp_aggreg3", rxDATA_F_comp_aggreg3,48*200,1,1);
-                  write_output("rxsig_sdu.m","rxsig_sdu",&rxdata[0][rx_offset],80*40,1,1);
-
-                  //    write_output("rxDATA_F_comp_aggreg2.m","rxDAT_F_comp_aggreg2", rxDATA_F_comp_aggreg2,48*200,1,1);
-                }
-
-                sdu_received = 1;
-
-                //  oai_exit = 1;
-                dlen      = 32+16+6+(rxv->sdu_length<<3); // data length is 32-bits CRC + sdu + 16 service + 6 tail
-                dlen_symb = dlen/Ndbps[rxv->rate];
-
-                if ((dlen%Ndbps[rxv->rate])>0)
-                  dlen_symb++;
-
-                //      printf("after dd: initial_sample_offset %d =>",initial_sample_offset);
-                initial_sample_offset = rx_offset + (80*dlen_symb);
-                //    printf("%d\n",initial_sample_offset);
-              }
-            } else {
-              printf("BUSY, no synch (off %d) Frame %d (%llu us): rxp %f dBm (dig %f,rxgain %d)\n",
-                     off,frame,rt_get_time_ns()/1000,(rx_energy/10.0)-rxg_max[0]+30-rxgain[0],
-                     rx_energy/10.0,rxg_max[0]-30+rxgain[0]);
-            }
-          } else {
-            /*  printf("Frame %d (%llu us): rxp %d dBm (dig %d,rxgain %d)\n",
-            frame,rt_get_time_ns()/1000,rx_energy-rxg_max[0]+30-rxgain[0],
-            rx_energy,rxg_max[0]-30+rxgain[0]);
-            */
-          }
-
-        } else {
-
-          if (((frame%100) == 0) && (initial_sample_offset < 2*SLOT_DURATION_5MHz)) {
-            printf("Frame %d (%llu us): rxp %f dBm (dig %f,rxgain %d)\n",
-                   frame,rt_get_time_ns()/1000,(rx_energy/10.0)-rxg_max[0]+30-rxgain[0],
-                   rx_energy/10.0,rxg_max[0]-30+rxgain[0]);
-
-          }
-
-          if ((frame > 100) &&
-              (tx_sdu_active == 1) &&
-              (initial_sample_offset < 60000)) {
-
-            printf("Frame %d: Generating SDU of length %d (%p), initial_sample_offset %d, MBOX <<9 %d\n",frame,tx_sdu_length,rxsdu,initial_sample_offset,DAQ_MBOX[0]<<9); /*
-                                            for (n=0;n<tx_sdu_length;n++)
-                                            printf("%2hhx.",rxsdu[n]);
-                                            printf("\n");
-                                          */
-            initial_sample_offset += (8*512);
-
-            if (initial_sample_offset > FRAME_LENGTH_SAMPLES)
-              initial_sample_offset -= FRAME_LENGTH_SAMPLES;
-
-
-
-            txlen= generate_tx_signal(initial_sample_offset);
-            // wait until TX is finished
-
-            printf("TX: txlen %d, initial_sample_offset %d\n",txlen,initial_sample_offset);
-            //oai_exit=1;
-
-            rt_sleep(nano2count((66666*8)+((txlen*66666)>>9)));
-            skip = initial_sample_offset+txlen-FRAME_LENGTH_SAMPLES;
-
-            if (skip < 0)
-              skip = 0;
-
-            printf("TX: erasing signal, MBOX %d (%d)\n",DAQ_MBOX[0],DAQ_MBOX[0]<<9);
-
-            // erase TX signal
-            for (i=0; i<(txlen-skip); i++)
-              txdata[0][initial_sample_offset+i] = 0x00010001;
-
-            for (i=0; i<skip; i++)
-              txdata[0][i] = 0x00010001;
-
-
-            initial_sample_offset += txlen;
-
-            if (initial_sample_offset > FRAME_LENGTH_SAMPLES) {
-              initial_sample_offset -= FRAME_LENGTH_SAMPLES;
-              frame++;
-              mbox_off = 0;
-            }
-
-            tx_sdu_active = 0;
-            old_mbox = DAQ_MBOX[0];
-
-          }
-
-
-          //rt_sleep(nano2count(10000));
-          //      printf("back from sleep 10000 ... mbox %d\n",((unsigned int *)DAQ_MBOX)[0]);
-
-        }
-
-
-        initial_sample_offset+=SLOT_DURATION_5MHz;
-
-        if (initial_sample_offset>FRAME_LENGTH_SAMPLES) {
-          initial_sample_offset-=FRAME_LENGTH_SAMPLES;
-          mbox_off = 0;
-          frame++;
-          //  if ((frame%100) == 0)
-          //printf("**** New frame %d\n",frame);
-
-          if (frame == 100000)
-            oai_exit = 1;
-        }
-
-        // sleep until HW has filled enough samples
-
-
-        mbox_diff = ((unsigned int*)DAQ_MBOX)[0]-old_mbox;
-        //   if ((frame%100) == 0)
-        //     printf("frame %d, old_mbox %d, mbox %d (initial_sample_offset %d : mbox<<9 %d)\n",frame,old_mbox,((unsigned int*)DAQ_MBOX)[0],initial_sample_offset,((unsigned int*)DAQ_MBOX)[0]<<9);
-
-
-        if ((mbox_diff>10) && (sdu_received == 0)) {
-          mbox_off = 0;
-          initial_sample_offset = ((unsigned int*)DAQ_MBOX)[0]<<9;
-          //      printf("initial_sample_offset adjusted %d\n",initial_sample_offset);
-          rt_skip_cond++;
-          //      printf("old_mbox %d, mbox %d (initial_sample_offset %d : mbox<<9 %d)\n",
-          //       old_mbox,((unsigned int*)DAQ_MBOX)[0],initial_sample_offset,((unsigned int*)DAQ_MBOX)[0]<<9);
-          old_mbox = ((unsigned int *)DAQ_MBOX)[0];
-
-        } else {
-          if (old_mbox > ((unsigned int *)DAQ_MBOX)[0])
-            mbox_off = 150;
-
-          old_mbox = ((unsigned int *)DAQ_MBOX)[0];
-        }
-
-        /*
-        printf("off: %d (%d,%d), mbox_off %d => rx_energy %d\n",initial_sample_offset,
-        ((unsigned int *)DAQ_MBOX)[0],
-        (initial_sample_offset>>9),mbox_off,
-        rx_energy);
-        */
-
-        sample_threshold = initial_sample_offset+1024;
-
-        if (sample_threshold > FRAME_LENGTH_SAMPLES)
-          sample_threshold -= FRAME_LENGTH_SAMPLES;
-
-        while (old_mbox+mbox_off <= (sample_threshold>>9)) {
-          //     if ((frame % 100) == 0)
-          //  printf("sleeping (mbox %d, mbox_off %d, initial_sample_offset>>9 %d\n",
-          //         old_mbox,mbox_off,(initial_sample_offset>>9));
-          rt_sleep(nano2count(66666));
-
-          if (old_mbox > ((unsigned int *)DAQ_MBOX)[0])
-            mbox_off = 150;
-
-          old_mbox = ((unsigned int *)DAQ_MBOX)[0];
-        }
-
-        //    printf("While out ... mbox %d\n",((unsigned int *)DAQ_MBOX)[0]);
-
-      }
-
-      printf("rt_skip_cond %d, frames %d, pos_crc %d, neg_crc %d\n",
-             rt_skip_cond,frame,pos_crc,neg_crc);
-
-      printf("Dumping IS stats\n");
-      print_is_stats();
-      print_dd_stats();
-
-      write_output("rxsig0.m","rxs", rxdata[0],76800,1,1);
-      write_output("txsig0.m","txs", txdata[0],76800,1,1);
-      write_output("rxDATA_F_comp_aggreg3.m","rxDAT_F_comp_aggreg3", rxDATA_F_comp_aggreg3,48*200,1,1);
-      write_output("rxDATA_F_comp_aggreg2.m","rxDAT_F_comp_aggreg2", rxDATA_F_comp_aggreg2,48*200,1,1);
-
-      printf("[DOT11][PHY] Leaving rx_thread\n");
-      free(data_ind_rx);
-    } else {
-      printf("[DOT11][PHY] No netlink, exiting\n");
-    }
-
-    return(0);
-
-
-  }
-
-  //extern int dot11_netlink_init();
-  //extern int dot11_rx_thread_init();
-
-  //extern void *rx_thread(void *);
-  extern void *tx_thread(void *);
-
-
-  void dot11_init() {
-
-
-
-    set_taus_seed(0);
-
-    // Basic initializations
-    init_fft(64,6,rev64);
-    init_interleavers();
-    ccodedot11_init();
-    ccodedot11_init_inv();
-    phy_generate_viterbi_tables();
-
-    init_crc32();
-
-  }
-
-  int generate_tx_signal(int tx_offset) {
-
-    TX_VECTOR_t tx_vector;
-    int i;
-
-    printf("Generating Signal @ %d (MBOX << 9 = %d)\n",
-           tx_offset,DAQ_MBOX[0]<<9);
-
-    if (data_ind == NULL) {
-      data_ind = (uint8_t*)malloc(4095+2+1);
-      data_ind[0] = 0;
-      data_ind[1] = 0;
-    }
-
-
-    tx_vector.rate=1;
-    tx_vector.sdu_length=tx_sdu_length;
-    tx_vector.service=0;
-
-    for (i=0; i<tx_vector.sdu_length; i++)
-      data_ind[i+2] = rxsdu[i];
-
-    data_ind[tx_vector.sdu_length+2+4]=0;  // Tail byte
-
-    >>>>>>> .r3153
-
-    //  printf("Generating signal at %p\n",txdata[0]);
-    return(phy_tx_start(&tx_vector,txdata[0],tx_offset,FRAME_LENGTH_SAMPLES,data_ind));
-
-  }
-
-  void signal_handler(int sig) {
-    void *array[10];
-    size_t size;
-
-    oai_exit=1;
-
-    // get void*'s for all entries on the stack
-    size = backtrace(array, 10);
-
-    // print out all the frames to stderr
-    fprintf(stderr, "Error: signal %d:\n", sig);
-    backtrace_symbols_fd(array, size, 2);
-    exit(-1);
-  }
-
-  void exit_fun(const char* s) {
-    void *array[10];
-    size_t size;
-    int fd;
-
-    printf("Exiting: %s\n",s);
-
-    oai_exit=1;
-    rt_sleep(nano2count(FRAME_PERIOD));
-
-    // cleanup
-    stop_rt_timer();
-
-    fd = 0;
-    ioctl(openair_fd,openair_STOP,&fd);
-    munmap((void*)mem_base, BIGPHYS_NUMPAGES*4096);
-
-    exit (-1);
-  }
-
-  int dummy_tx_buffer[3840*4] __attribute__((aligned(16)));
-
-  /* This is the main dot11 thread. */
-  static void *dot11_thread(void *arg) {
-    RT_TASK *task;
-    int slot=0,hw_slot,last_slot, next_slot,frame=0;
-    unsigned int msg1;
-    unsigned int aa,slot_offset, slot_offset_F;
-    int diff;
-    int delay_cnt;
-    RTIME time_in;
-    int mbox_target=0,mbox_current=0;
-    int i;
-
-    task = rt_task_init_schmod(nam2num("TASK0"), 0, 0, 0, SCHED_FIFO, 0xF);
-    mlockall(MCL_CURRENT | MCL_FUTURE);
-
-#ifdef HARD_RT
-    <<<<<<< .mine
-    rt_printk("Started dot11 thread (id %p)\n",task);
-
-
-    rt_make_hard_real_time();
-#else
-
-    printf("Started dot11 thread (id %p)\n",task);
-#endif
-    =======
-      rt_printk("Started dot11 thread (id %p)\n",task);
-    >>>>>>> .r3153
-
-    <<<<<<< .mine
-
-    while (!oai_exit) {
-      //      rt_printk("eNB: slot %d\n",slot);
-      =======
-        >>>>>>> .r3153
-
-        <<<<<<< .mine
-        =======
-          rt_make_hard_real_time();
-#else
-      >>>>>>> .r3153
-
-      printf("Started dot11 thread (id %p)\n",task);
-
-
-      <<<<<<< .mine
-
-      if (frame>5) {
-        if ((frame%100)==0)
-#ifdef HARD_RT
-          rt_printk("slot %d, hw_slot %d, next_slot %d (before): DAQ_MBOX %d\n", slot, hw_slot,next_slot,DAQ_MBOX[0]);
-
-#else
-          printf("frame %d slot %d, hw_slot %d, next_slot %d (before): DAQ_MBOX %d\n", frame,slot, hw_slot,next_slot,DAQ_MBOX[0]);
-#endif
-
-        if (fs4_test==0) {
-          if ((next_slot == 0) && (generate_test_tx==1) && ((frame%100)==0)) {
-            printf("Generating tx_signal in frame %d ...",frame);
-            generate_test_tx_signal();
-            printf("done\n");
-
-          } else { // Check for normal TX packet
-            /*for (i=0;i<3840;i++) {
-            ((uint32_t *)txdata[0] + (3840*next_slot))[i] = 0x00010001;
-            }*/
-          }
-        }
-
-
-      }
-
-
-
-      =======
-
-      while (!oai_exit) {
-        //      rt_printk("eNB: slot %d\n",slot);
-
-        hw_slot = (((((unsigned int *)DAQ_MBOX)[0]+1)%150)<<1)/15;
-        //this is the mbox counter where we should be
-        mbox_target = ((((slot+1)%20)*15+1)>>1)%150;
-        //this is the mbox counter where we are
-        mbox_current = ((unsigned int *)DAQ_MBOX)[0];
-
-        //this is the time we need to sleep in order to synchronize with the hw (in multiples of DAQ_PERIOD)
-        if ((mbox_current>=135) && (mbox_target<15)) //handle the frame wrap-arround
-          diff = 150-mbox_current+mbox_target;
-        else if ((mbox_current<15) && (mbox_target>=135))
-          diff = -150+mbox_target-mbox_current;
-        else
-          diff = mbox_target - mbox_current;
-
-        if (diff < (-5)) {
-          printf("[dot11_thread] Frame %d: missed slot, proceeding with next one (slot %d, hw_slot %d, diff %d)\n",frame, slot, hw_slot, diff);
-          >>>>>>> .r3153
-          slot++;
-
-          if (slot==20)
-            <<<<<<< .mine
-            slot=0;
-
-          //slot++;
-          if ((slot%20)==0)
-            frame++;
-
-          =======
-            slot=0;
-          continue;
-          >>>>>>> .r3153
-        }
-
-        if (diff>8)
-          printf("[dot11_thread] eNB Frame %d: skipped slot, waiting for hw to catch up (slot %d, hw_slot %d, mbox_current %d, mbox_target %d, diff %d)\n",frame, slot, hw_slot, mbox_current, mbox_target, diff);
-
-        delay_cnt = 0;
-
-        while ((diff>0) && (!oai_exit)) {
-          time_in = rt_get_time_ns();
-          //rt_printk("eNB Frame %d delaycnt %d : hw_slot %d (%d), slot %d, (slot+1)*15=%d, diff %d, time %llu\n",frame,delay_cnt,hw_slot,((unsigned int *)DAQ_MBOX)[0],slot,(((slot+1)*15)>>1),diff,time_in);
-          //rt_printk("Frame %d: slot %d, sleeping for %llu\n", frame, slot, diff*DAQ_PERIOD);
-          rt_sleep(nano2count(diff*DAQ_PERIOD));
-          hw_slot = (((((unsigned int *)DAQ_MBOX)[0]+1)%150)<<1)/15;
-          //rt_printk("eNB Frame %d : hw_slot %d, time %llu\n",frame,hw_slot,rt_get_time_ns());
-          delay_cnt++;
-
-          if (delay_cnt == 10) {
-            oai_exit = 1;
-            printf("[dot11_thread]eNB Frame %d: HW stopped ... \n",frame);
-          }
-
-          mbox_current = ((unsigned int *)DAQ_MBOX)[0];
-
-          if ((mbox_current>=135) && (mbox_target<15)) //handle the frame wrap-arround
-            diff = 150-mbox_current+mbox_target;
-          else
-            diff = mbox_target - mbox_current;
-        }
-
-
-        last_slot = (slot)%LTE_SLOTS_PER_FRAME;
-
-        if (last_slot <0)
-          last_slot+=20;
-
-        next_slot = (slot+3)%LTE_SLOTS_PER_FRAME;
-
-        <<<<<<< .mine
-
-
-        =======
-
-        if (frame>5) {
-          if ((frame%100)==0)
-#ifdef HARD_RT
-            rt_printk("slot %d, hw_slot %d, next_slot %d (before): DAQ_MBOX %d\n", slot, hw_slot,next_slot,DAQ_MBOX[0]);
-
-#else
-            printf("frame %d slot %d, hw_slot %d, next_slot %d (before): DAQ_MBOX %d\n", frame,slot, hw_slot,next_slot,DAQ_MBOX[0]);
-#endif
-
-          if (fs4_test==0) {
-            if ((next_slot == 0) && (generate_test_tx==1) && ((frame%100)==0)) {
-              printf("Generating tx_signal in frame %d ...",frame);
-              //generate_test_tx_signal();
-              printf("done\n");
-
-            } else { // Check for normal TX packet
-              /*for (i=0;i<3840;i++) {
-                ((uint32_t *)txdata[0] + (3840*next_slot))[i] = 0x00010001;
-                }*/
-            }
-          }
-
-
-        }
-
-
-
-        slot++;
-
-        if (slot==20)
-          slot=0;
-
-        //slot++;
-        if ((slot%20)==0)
-          frame++;
-      }
-
-      rt_printk("fun0: finished, ran %d times.\n",slot);
-
-#ifdef HARD_RT
-      rt_make_soft_real_time();
-#endif
-
-      // clean task
-      rt_task_delete(task);
-      rt_printk("Task deleted. returning\n");
-      return 0;
-    }
-
-
-
-    >>>>>>> .r3153
-    int main(int argc, char **argv) {
-
-      RT_TASK *task;
-      int i,j,aa;
-
-      LTE_DL_FRAME_PARMS *frame_parms;
-
-      u32 carrier_freq[4]= {1907600000,1907600000,1907600000,1907600000};
-      u32 rf_mode_max[4]     = {55231,55231,55231,55231};
-      u32 rf_mode_med[4]     = {39375,39375,39375,39375};
-      u32 rf_mode_byp[4]     = {22991,22991,22991,22991};
-
-      u32 rf_local[4]    = {8255000,8255000,8255000,8255000}; // UE zepto
-      //{8254617, 8254617, 8254617, 8254617}; //eNB khalifa
-      //{8255067,8254810,8257340,8257340}; // eNB PETRONAS
-
-      u32 rf_vcocal[4]   = {2340,2340,2340,2340};
-      u32 rf_rxdc[4]     = {32896,32896,32896,32896};
-      <<<<<<< .mine
-      u32 rxgain[4]= {20,20,20,20};
-      =======
-        >>>>>>> .r3153
-
-        <<<<<<< .mine
-
-        =======
-
-
-          >>>>>>> .r3153
-          u8  eNB_id=0,UE_id=0;
-      u16 Nid_cell = 0;
-      u8  cooperation_flag=0, transmission_mode=1, abstraction_flag=0;
-      u8 beta_ACK=0,beta_RI=0,beta_CQI=2;
-
-      int c;
-      char do_forms=0;
-      unsigned int fd,dot11_netlink_fd;
-      unsigned int tcxo = 114;
-
-      int amp;
-
-      char rxg_fname[100];
-      char rflo_fname[100];
-      FILE *rxg_fd=NULL;
-      FILE *rflo_fd=NULL;
-
-      <<<<<<< .mine
-      =======
-
-        >>>>>>> .r3153
-        const struct option long_options[] = {
-        {"calib-rx", required_argument, NULL, 256},
-        {"calib-rx-med", required_argument, NULL, 257},
-        {"calib-rx-byp", required_argument, NULL, 258},
-        {NULL, 0, NULL, 0}
-      };
-
-      mode = normal_txrx;
-
-
-      while ((c = getopt_long (argc, argv, "C:ST:dF:t",long_options,NULL)) != -1) {
-        switch (c) {
-        case 'd':
-          do_forms=1;
-          break;
-
-        case 't':
-          generate_test_tx = 1;
-          break;
-
-        case 'C':
-          carrier_freq[0] = atoi(optarg);
-          carrier_freq[1] = atoi(optarg);
-          carrier_freq[2] = atoi(optarg);
-          carrier_freq[3] = atoi(optarg);
-          break;
-
-        case 'S':
-          fs4_test=1;
-          break;
-
-        case 'T':
-          tcxo=atoi(optarg);
-          break;
-
-        case 'F':
-          sprintf(rxg_fname,"%srxg.lime",optarg);
-          rxg_fd = fopen(rxg_fname,"r");
-
-          if (rxg_fd) {
-            printf("Loading RX Gain parameters from %s\n",rxg_fname);
-            fscanf(rxg_fd,"%d %d %d %d",&rxg_max[0],&rxg_max[1],&rxg_max[2],&rxg_max[3]);
-            fscanf(rxg_fd,"%d %d %d %d",&rxg_med[0],&rxg_med[1],&rxg_med[2],&rxg_med[3]);
-            fscanf(rxg_fd,"%d %d %d %d",&rxg_byp[0],&rxg_byp[1],&rxg_byp[2],&rxg_byp[3]);
-          } else
-            printf("%s not found, running with defaults\n",rxg_fname);
-
-          sprintf(rflo_fname,"%srflo.lime",optarg);
-          rflo_fd = fopen(rflo_fname,"r");
-
-          if (rflo_fd) {
-            printf("Loading RF LO parameters from %s\n",rflo_fname);
-            fscanf(rflo_fd,"%d %d %d %d",&rf_local[0],&rf_local[1],&rf_local[2],&rf_local[3]);
-          } else
-            printf("%s not found, running with defaults\n",rflo_fname);
-
-          break;
-
-        case 256:
-          mode = rx_calib_ue;
-          rx_input_level_dBm = atoi(optarg);
-          printf("Running with UE calibration on (LNA max), input level %d dBm\n",rx_input_level_dBm);
-          break;
-
-        case 257:
-          mode = rx_calib_ue_med;
-          rx_input_level_dBm = atoi(optarg);
-          printf("Running with UE calibration on (LNA med), input level %d dBm\n",rx_input_level_dBm);
-          break;
-
-        case 258:
-          mode = rx_calib_ue_byp;
-          rx_input_level_dBm = atoi(optarg);
-          printf("Running with UE calibration on (LNA byp), input level %d dBm\n",rx_input_level_dBm);
-          break;
-
-        default:
-          break;
-        }
-      }
-
-
-      // to make a graceful exit when ctrl-c is pressed
-      signal(SIGSEGV, signal_handler);
-
-      // init the parameters
-      frame_parms = (LTE_DL_FRAME_PARMS*) malloc(sizeof(LTE_DL_FRAME_PARMS));
-      frame_parms->N_RB_DL            = 25;
-      frame_parms->N_RB_UL            = 25;
-      frame_parms->Ncp                = 0;
-      frame_parms->Ncp_UL             = 0;
-      frame_parms->Nid_cell           = Nid_cell;
-      frame_parms->nushift            = 0;
-      frame_parms->nb_antennas_tx     = 1;
-      frame_parms->nb_antennas_rx     = 1;
-      frame_parms->mode1_flag         = 1; //default == SISO
-      frame_parms->frame_type         = 1;
-
-      if (fs4_test==1)
-        frame_parms->tdd_config         = 255;
-      else
-        frame_parms->tdd_config         = 3;
-
-      frame_parms->tdd_config_S       = 0;
-      frame_parms->phich_config_common.phich_resource = oneSixth;
-      frame_parms->phich_config_common.phich_duration = normal;
-      frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = 0;//n_DMRS1 set to 0
-
-      frame_parms->node_id = NODE;
-
-      // for Express MIMO
-      for (i=0; i<4; i++) {
-        frame_parms->carrier_freq[i] = carrier_freq[i];
-        frame_parms->carrier_freqtx[i] = carrier_freq[i];
-
-        <<<<<<< .mine
-        frame_parms->rxgain[i]       = rxgain[i];
-        =======
-          frame_parms->rxgain[i]       = rxgain[i];
-
-        frame_parms->rflocal[i]      = rf_local[i];
-        frame_parms->rfvcolocal[i]   = rf_vcocal[i];
-        frame_parms->rxdc[i]         = rf_rxdc[i];
-        frame_parms->rfmode[i] = rf_mode_max[i];
-
-        >>>>>>> .r3153
-      }
-
-      printf("Freq %d,%d,%d,%d, Gain %d,%d,%d,%d, RFmode %d, RXDC %d, RF_local %d, rf_vcocal %d\n",
-             frame_parms->carrier_freq[0],frame_parms->carrier_freq[1],frame_parms->carrier_freq[2],frame_parms->carrier_freq[3],
-             frame_parms->rxgain[0],frame_parms->rxgain[1],frame_parms->rxgain[2],frame_parms->rxgain[3],
-             frame_parms->rfmode[0],frame_parms->rflocal[0],
-             frame_parms->rxdc[0],frame_parms->rfvcolocal[0]);
-
-
-      frame_parms->nb_prefix_samples0 = 40;
-      frame_parms->nb_prefix_samples = 36;
-      frame_parms->symbols_per_tti = 14;
-      frame_parms->ofdm_symbol_size = 512;
-
-      frame_parms->log2_symbol_size = 9;
-      frame_parms->samples_per_tti = 7680;
-      frame_parms->first_carrier_offset = frame_parms->ofdm_symbol_size - 150;
-
-      openair_fd = setup_oai_hw(frame_parms);
-      printf("Setting up buffers for Antenna port 0\n");
-      setup_dot11_buffers(&(rxdata[0]),&(txdata[0]),0);
-      printf("Setting up buffers for Antenna port 1\n");
-      setup_dot11_buffers(&(rxdata[1]),&(txdata[1]),1);
-
-      <<<<<<< .mine
-      printf("Initializing dot11 DSP functions\n");
-      dot11_init();
-      dot11_netlink_fd = dot11_netlink_init();
-      =======
-        >>>>>>> .r3153
-
-        <<<<<<< .mine
-
-        for (j=0; j<76800; j+=4)
-        for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
-          amp = 0x8000;
-          //  ((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+1] = 0;
-          //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+3] = amp-1;
-          //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+5] = 0;
-          //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+7] = amp;
-          //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j] = amp-1;
-          //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+2] = 0;
-          //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+4] = amp;
-          //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+6] = 0;
-        }
-
-      sleep(1);
-      printf("Calling openair_GET_PCI_INTERFACE %x\n",openair_GET_PCI_INTERFACE);
-      ioctl(openair_fd,openair_GET_PCI_INTERFACE,&pci_interface_ptr_kern);
-
-      if (pci_interface_ptr_kern == 0) {
-        printf("null pci_interface_ptr, exiting\n");
-        exit(-1);
-      }
-
-      =======
-
-        for (j=0; j<76800; j+=4)
-        for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
-          amp = 0x8000;
-          //  ((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+1] = 0;
-          //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+3] = amp-1;
-          //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+5] = 0;
-          //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+7] = amp;
-          //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j] = amp-1;
-          //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+2] = 0;
-          //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+4] = amp;
-          //((short*)PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][aa])[2*j+6] = 0;
-        }
-
-      sleep(1);
-      printf("Calling openair_GET_PCI_INTERFACE %x\n",openair_GET_PCI_INTERFACE);
-      ioctl(openair_fd,openair_GET_PCI_INTERFACE,&pci_interface_ptr_kern);
-
-      if (pci_interface_ptr_kern == 0) {
-        printf("null pci_interface_ptr, exiting\n");
-        exit(-1);
-      }
-
-      exmimo_pci_interface = (exmimo_pci_interface_t*) (pci_interface_ptr_kern-bigphys_top+mem_base);
-      printf("pci_interface_ptr_kern = %p, exmimo_pci_interface = %p\n", (void*) pci_interface_ptr_kern, exmimo_pci_interface);
-      DAQ_MBOX = (unsigned int *)(0xc0000000+exmimo_pci_interface->rf.mbox-bigphys_top+mem_base);
-
-      printf("Initializing dot11 DSP functions\n");
-      dot11_init();
-      dot11_netlink_fd = netlink_init();
-      >>>>>>> .r3153
-      exmimo_pci_interface = (exmimo_pci_interface_t*) (pci_interface_ptr_kern-bigphys_top+mem_base);
-      printf("pci_interface_ptr_kern = %p, exmimo_pci_interface = %p\n", (void*) pci_interface_ptr_kern, exmimo_pci_interface);
-      DAQ_MBOX = (unsigned int *)(0xc0000000+exmimo_pci_interface->rf.mbox-bigphys_top+mem_base);
-
-      <<<<<<< .mine
-      =======
-        printf("dot11_netlink_fd %d\n",dot11_netlink_fd);
-
-
-
-      >>>>>>> .r3153
-      // make main thread LXRT soft realtime
-      printf("Starting LXRT ...");
-      task = rt_task_init_schmod(nam2num("MYTASK"), 9, 0, 0, SCHED_FIFO, 0xF);
-      mlockall(MCL_CURRENT | MCL_FUTURE);
-
-      // start realtime timer and scheduler
-      //rt_set_oneshot_mode();
-      rt_set_periodic_mode();
-      start_rt_timer(0);
-      <<<<<<< .mine
-      printf(" done\n");
-      =======
-        printf(" done\n");
-
-      >>>>>>> .r3153
-      <<<<<<< .mine
-      //now = rt_get_time() + 10*PERIOD;
-      //rt_task_make_periodic(task, now, PERIOD);
-
-      // initialize the instance cnt before starting the thread
-      //  instance_cnt_ptr_user = &instance_cnt;
-
-
-
-      // signal the driver to set up for user-space operation
-      // this will initialize the semaphore and the task pointers in the kernel
-      // further we receive back the pointer to the shared instance counter which is used to signal if the thread is busy or not. This pointer needs to be mapped to user space.
-      /*
-      ioctl(openair_fd,openair_START_LXRT,&instance_cnt_ptr_kern);
-      instance_cnt_ptr_user = (int*) (instance_cnt_ptr_kern -bigphys_top+mem_base);
-      *instance_cnt_ptr_user = -1;
-      printf("instance_cnt_ptr_kern %p, instance_cnt_ptr_user %p, *instance_cnt_ptr_user %d\n", (void*) instance_cnt_ptr_kern, (void*) instance_cnt_ptr_user,*instance_cnt_ptr_user);
-      */
-
-      =======
-        >>>>>>> .r3153
-
-        <<<<<<< .mine
-
-
-        rt_sleep(nano2count(FRAME_PERIOD));
-      =======
-        >>>>>>> .r3153
-        // this starts the DMA transfers
-        <<<<<<< .mine
-        =======
-          ioctl(openair_fd,openair_START_TX_SIG,NULL);
-      //ioctl(openair_fd,openair_GET_BUFFER,NULL);
-      >>>>>>> .r3153
-
-      <<<<<<< .mine
-      ioctl(openair_fd,openair_START_TX_SIG,NULL);
-
-
-      =======
-        >>>>>>> .r3153
-        rt_sleep(nano2count(10*FRAME_PERIOD));
-
-
-      <<<<<<< .mine
-      thread1 = rt_thread_create(dot11_thread, NULL, 100000000);
-      =======
-        //thread1 = rt_thread_create(dot11_thread, NULL, 100000000);
-        >>>>>>> .r3153
-
-
-        <<<<<<< .mine
-        printf("thread created\n");
-      =======
-        thread1 = rt_thread_create(rx_thread, &dot11_netlink_fd, 10000000);
-      >>>>>>> .r3153
-
-      thread2 = rt_thread_create(tx_thread, &dot11_netlink_fd, 10000000);
-
-      // wait for end of program
-      printf("TYPE <ENTER> TO TERMINATE main thread\n");
-      getchar();
-
-      // stop threads
-      rt_sleep(nano2count(FRAME_PERIOD));
-
-      stop_rt_timer();
-
-      fd = 0;
-      ioctl(openair_fd,openair_STOP,&fd);
-      munmap((void*)mem_base, BIGPHYS_NUMPAGES*4096);
-
-      return 0;
-    }
diff --git a/targets/RT/USER/eNB_transport_IQ.c b/targets/RT/USER/eNB_transport_IQ.c
index af3873ef76cfd4b940988333c93f4c9d586f5fb7..86080c2c331bd01eb0254526b4fcf2627240c9ca 100644
--- a/targets/RT/USER/eNB_transport_IQ.c
+++ b/targets/RT/USER/eNB_transport_IQ.c
@@ -127,7 +127,7 @@ static void check_dev_config( rrh_module_t *mod_enb);
  * \note
  * @ingroup  _oai
  */
-static void calc_rt_period_ns( openair0_config_t openair0_cfg);
+static void calc_rt_period_ns( openair0_config_t *openair0_cfg);
 
 
 
@@ -140,104 +140,37 @@ void config_BBU_mod( rrh_module_t *mod_enb, uint8_t RT_flag, uint8_t NRT_flag) {
   
   RT_flag_eNB=RT_flag;
   NRT_flag_eNB=NRT_flag;
-    
-  /* handshake with client to exchange parameters */
+  
+  /* init socket and have handshake-like msg with client to exchange parameters */
   mod_enb->eth_dev.trx_start_func(&mod_enb->eth_dev);//change port  make it plus_id
- 
- /* if a RF iterface is added to RRH module get the  configuration parameters sent from eNB  */
-  if (mod_enb->devs->type != NONE_IF ) {  
 
-    memcpy((void*)&mod_enb->devs->openair0_cfg,(void *)&mod_enb->eth_dev.openair0_cfg,sizeof(openair0_config_t));
-    
-    /* certain parameters have to be updated (calibration related)*/
-    if ( mod_enb->devs->type == EXMIMO_IF ) {
-      if ( mod_enb->devs->openair0_cfg.num_rb_dl == 100 ) {
-	mod_enb->devs->openair0_cfg.samples_per_packet = 2048;
-	mod_enb->devs->openair0_cfg.tx_forward_nsamps = 175;
-	mod_enb->devs->openair0_cfg.tx_delay = 8;
-      }
-      else if ( mod_enb->devs->openair0_cfg.num_rb_dl == 50 ) {
-	mod_enb->devs->openair0_cfg.samples_per_packet = 2048;
-	mod_enb->devs->openair0_cfg.tx_forward_nsamps = 95;
-	mod_enb->devs->openair0_cfg.tx_delay = 5;
-      }
-      else if ( mod_enb->devs->openair0_cfg.num_rb_dl == 25 ) {
-	mod_enb->devs->openair0_cfg.samples_per_packet = 1024;
-	mod_enb->devs->openair0_cfg.tx_forward_nsamps = 70;
-	mod_enb->devs->openair0_cfg.tx_delay = 6;
-      }
-      else if ( mod_enb->devs->openair0_cfg.num_rb_dl == 6 ) {
-	mod_enb->devs->openair0_cfg.samples_per_packet = 256;
-	mod_enb->devs->openair0_cfg.tx_forward_nsamps = 40;
-	mod_enb->devs->openair0_cfg.tx_delay = 8;
-      }
-    }
-    else if ((mod_enb->devs->type == USRP_B200_IF )||(mod_enb->devs->type == USRP_X300_IF )) {
-      if ( mod_enb->devs->openair0_cfg.num_rb_dl == 100 ) {
-	mod_enb->devs->openair0_cfg.samples_per_packet = 2048;
-	mod_enb->devs->openair0_cfg.tx_forward_nsamps = 175;
-	mod_enb->devs->openair0_cfg.tx_delay = 8;
-      }
-      else if ( mod_enb->devs->openair0_cfg.num_rb_dl == 50 ) {
-	mod_enb->devs->openair0_cfg.samples_per_packet = 2048;
-	mod_enb->devs->openair0_cfg.tx_forward_nsamps = 95;
-	mod_enb->devs->openair0_cfg.tx_delay = 5;
-      }
-      else if ( mod_enb->devs->openair0_cfg.num_rb_dl == 25 ) {
-	mod_enb->devs->openair0_cfg.samples_per_packet = 1024;
-	mod_enb->devs->openair0_cfg.tx_forward_nsamps = 70;
-	mod_enb->devs->openair0_cfg.tx_delay = 6;
-      }
-      else if ( mod_enb->devs->openair0_cfg.num_rb_dl == 6 ) {
-	mod_enb->devs->openair0_cfg.samples_per_packet = 256;
-	mod_enb->devs->openair0_cfg.tx_forward_nsamps = 40;
-	mod_enb->devs->openair0_cfg.tx_delay = 8;
-      }
-    }
-    else if(mod_enb->devs->type == BLADERF_IF) {
-      if ( mod_enb->devs->openair0_cfg.num_rb_dl == 100 ) {
-	mod_enb->devs->openair0_cfg.samples_per_packet = 2048;
-	mod_enb->devs->openair0_cfg.tx_forward_nsamps = 175;
-	mod_enb->devs->openair0_cfg.tx_delay = 8;
-      }
-      else if ( mod_enb->devs->openair0_cfg.num_rb_dl == 50 ) {
-	mod_enb->devs->openair0_cfg.samples_per_packet = 2048;
-	mod_enb->devs->openair0_cfg.tx_forward_nsamps = 95;
-	mod_enb->devs->openair0_cfg.tx_delay = 5;
-      }
-      else if ( mod_enb->devs->openair0_cfg.num_rb_dl == 25 ) {
-	mod_enb->devs->openair0_cfg.samples_per_packet = 1024;
-	mod_enb->devs->openair0_cfg.tx_forward_nsamps = 70;
-	mod_enb->devs->openair0_cfg.tx_delay = 6;
+  mod_enb->devs->openair0_cfg = mod_enb->eth_dev.openair0_cfg;
+
+  /* check sanity of configuration parameters and print */
+  check_dev_config(mod_enb);  
+  if (rf_config_file[0] == '\0')  
+    mod_enb->devs->openair0_cfg->configFilename = NULL;
+  else
+    mod_enb->devs->openair0_cfg->configFilename = rf_config_file;
+  /* initialize and configure the RF device */
+  if (openair0_device_load(mod_enb->devs, mod_enb->devs->openair0_cfg)<0) {
+    LOG_E(RRH,"Exiting, cannot initialize RF device.\n");
+    exit(-1);
+  } else {   
+    if (mod_enb->devs->type != NONE_DEV) {
+      /* start RF device */
+      if (mod_enb->devs->type == EXMIMO_DEV) {
+	//call start function for exmino
+      } else {
+
+	if (mod_enb->devs->trx_start_func(mod_enb->devs)!=0)
+	  LOG_E(RRH,"Unable to initiate RF device.\n");
+	else
+	  LOG_I(RRH,"RF device has been initiated.\n");
       }
-      else if ( mod_enb->devs->openair0_cfg.num_rb_dl == 6 ) {
-	mod_enb->devs->openair0_cfg.samples_per_packet = 256;
-	mod_enb->devs->openair0_cfg.tx_forward_nsamps = 40;
-	mod_enb->devs->openair0_cfg.tx_delay = 8;
-      }           
-    }  
-    
-    /* check sanity of configuration parameters and print */
-    check_dev_config(mod_enb);    
-    
-    /* initialize and configure the RF device */
-    if (openair0_device_init(mod_enb->devs, &mod_enb->devs->openair0_cfg)<0){
-      LOG_E(RRH,"Exiting, cannot initialize RF device.\n");
-      exit(-1);
-    }
-    else {
-      LOG_I(RRH,"RF device has been successfully initialized.\n");
-    }    
-
-    /* start RF device */
-    if (mod_enb->devs->type == EXMIMO_IF ) {
       
-    } else {
-      if (mod_enb->devs->trx_start_func(mod_enb->devs)!=0)
-	LOG_E(RRH,"Unable to initiate RF device.\n");
     }
-    LOG_I(RRH,"RF device has been initiated.\n");
-  }
+  }  
   
   /* create main eNB module thread
      main_rrh_eNB_thread allocates memory 
@@ -266,7 +199,7 @@ void *rrh_eNB_thread(void *arg) {
   void 			*tmp;
   unsigned int          samples_per_frame=0;
   
-  samples_per_frame = dev->eth_dev.openair0_cfg.samples_per_frame;    
+  samples_per_frame = dev->eth_dev.openair0_cfg->samples_per_frame;    
 
   while (rrh_exit==0) {
     
@@ -278,42 +211,42 @@ void *rrh_eNB_thread(void *arg) {
     /* allocate memory for TX/RX buffers
        each antenna port has a TX and a RX buffer
        each TX and RX buffer is of (samples_per_frame + HEADER_SIZE) samples (size of samples is 4 bytes) */
-    rx_buffer_eNB = (int32_t**)malloc16(dev->eth_dev.openair0_cfg.rx_num_channels*sizeof(int32_t*));
-    tx_buffer_eNB = (int32_t**)malloc16(dev->eth_dev.openair0_cfg.tx_num_channels*sizeof(int32_t*));    
+    rx_buffer_eNB = (int32_t**)malloc16(dev->eth_dev.openair0_cfg->rx_num_channels*sizeof(int32_t*));
+    tx_buffer_eNB = (int32_t**)malloc16(dev->eth_dev.openair0_cfg->tx_num_channels*sizeof(int32_t*));    
     LOG_D(RRH,"rx_buffer_eNB address =%p tx_buffer_eNB address =%p  \n",rx_buffer_eNB,tx_buffer_eNB);
     
     /* rx_buffer_eNB points to the beginning of data */
-    for (i=0; i<dev->eth_dev.openair0_cfg.rx_num_channels; i++) {
+    for (i=0; i<dev->eth_dev.openair0_cfg->rx_num_channels; i++) {
       tmp=(void *)malloc16(sizeof(int32_t)*(samples_per_frame + 32));
       memset(tmp,0,sizeof(int32_t)*(samples_per_frame + 32));
       rx_buffer_eNB[i]=( tmp + (32*sizeof(int32_t)) );  
       LOG_D(RRH,"i=%d rx_buffer_eNB[i]=%p tmp= %p\n",i,rx_buffer_eNB[i],tmp);
     }
     /* tx_buffer_eNB points to the beginning of data */
-    for (i=0; i<dev->eth_dev.openair0_cfg.tx_num_channels; i++) {
+    for (i=0; i<dev->eth_dev.openair0_cfg->tx_num_channels; i++) {
       tmp=(void *)malloc16(sizeof(int32_t)*(samples_per_frame + 32));
       memset(tmp,0,sizeof(int32_t)*(samples_per_frame + 32));
       tx_buffer_eNB[i]=( tmp + (32*sizeof(int32_t)) );  
       LOG_D(RRH,"i= %d tx_buffer_eNB[i]=%p tmp= %p \n",i,tx_buffer_eNB[i],tmp);
     }
     /* dummy initialization for TX/RX buffers */
-    for (i=0; i<dev->eth_dev.openair0_cfg.rx_num_channels; i++) {
+    for (i=0; i<dev->eth_dev.openair0_cfg->rx_num_channels; i++) {
       for (j=0; j<samples_per_frame; j++) {
 	rx_buffer_eNB[i][j]=32+i; 
       } 
     }
     /* dummy initialization for TX/RX buffers */
-    for (i=0; i<dev->eth_dev.openair0_cfg.tx_num_channels; i++) {
+    for (i=0; i<dev->eth_dev.openair0_cfg->tx_num_channels; i++) {
       for (j=0; j<samples_per_frame; j++) {
 	tx_buffer_eNB[i][j]=12+i; 
       } 
     }    
     /* allocate TX/RX buffers pointers used in write/read operations */
-    rx_eNB = (void**)malloc16(dev->eth_dev.openair0_cfg.rx_num_channels*sizeof(int32_t*));
-    tx_eNB = (void**)malloc16(dev->eth_dev.openair0_cfg.tx_num_channels*sizeof(int32_t*));
+    rx_eNB = (void**)malloc16(dev->eth_dev.openair0_cfg->rx_num_channels*sizeof(int32_t*));
+    tx_eNB = (void**)malloc16(dev->eth_dev.openair0_cfg->tx_num_channels*sizeof(int32_t*));
 
     /* init mutexes */    
-    for (i=0; i<dev->eth_dev.openair0_cfg.tx_num_channels; i++) {
+    for (i=0; i<dev->eth_dev.openair0_cfg->tx_num_channels; i++) {
       pthread_mutex_init(&sync_eNB_mutex[i],NULL);
       pthread_cond_init(&sync_eNB_cond[i],NULL);
     }
@@ -321,7 +254,7 @@ void *rrh_eNB_thread(void *arg) {
     pthread_mutex_init(&sync_trx_mutex,NULL);
 
     /* create eNB module's TX/RX threads */    
-#ifdef LOWLATENCY
+#ifdef DEADLINE_SCHEDULER
     error_code_eNB_rx = pthread_create(&eNB_rx_thread, NULL, rrh_eNB_rx_thread, (void *)dev);
     error_code_eNB_tx = pthread_create(&eNB_tx_thread, NULL, rrh_eNB_tx_thread, (void *)dev);
     LOG_I(RRH,"[eNB][SCHED] deadline scheduling applied to eNB TX/RX threads\n");	
@@ -353,7 +286,7 @@ void *rrh_eNB_thread(void *arg) {
     }
    
     /* create timer thread; when no RF device is present a software clock is generated */    
-    if (dev->devs->type == NONE_IF) {
+    if (dev->devs->type == NONE_DEV) {
 
       int 			error_code_timer;
       pthread_t 		main_timer_proc_thread;
@@ -369,7 +302,7 @@ void *rrh_eNB_thread(void *arg) {
       timerspec.it_interval.tv_nsec = rt_period%1000000000;
       
       
-#ifdef LOWLATENCY
+#ifdef DEADLINE_SCHEDULER
       error_code_timer = pthread_create(&main_timer_proc_thread, NULL, timer_proc, (void *)&timerspec);
       LOG_I(RRH,"[eNB][SCHED] deadline scheduling applied to timer thread \n");
 #else 
@@ -405,10 +338,11 @@ void *rrh_eNB_thread(void *arg) {
   return(0);
 }
 
+/* Receive from RF and transmit to RRH */
 
 void *rrh_eNB_rx_thread(void *arg) {
 
-  /* measuremnt related vars */
+  /* measurement related vars */
   struct timespec time0,time1,time2;
   unsigned long long max_rx_time=0, min_rx_time=rt_period, total_rx_time=0, average_rx_time=rt_period, s_period=0, trial=0;
   int trace_cnt=0;
@@ -425,16 +359,16 @@ void *rrh_eNB_rx_thread(void *arg) {
 
   time_req_1us.tv_sec = 0;
   time_req_1us.tv_nsec =1000;  //time_req_1us.tv_nsec = (int)rt_period/2;--->granularity issue
-  spp_eth =  dev->eth_dev.openair0_cfg.samples_per_packet;
-  spp_rf  =  dev->devs->openair0_cfg.samples_per_packet;
+  spp_eth =  dev->eth_dev.openair0_cfg->samples_per_packet;
+  spp_rf  =  dev->devs->openair0_cfg->samples_per_packet;
 
-  samples_per_frame = dev->eth_dev.openair0_cfg.samples_per_frame;
+  samples_per_frame = dev->eth_dev.openair0_cfg->samples_per_frame;
   samples_per_subframe = (unsigned int)samples_per_frame/10;
   loopback = dev->loopback;
   measurements = dev->measurements;
   next_rx_pos = spp_eth;
 
-#ifdef LOWLATENCY
+#ifdef DEADLINE_SCHEDULER
   struct sched_attr attr;
   unsigned int flags = 0;
 
@@ -456,14 +390,14 @@ void *rrh_eNB_rx_thread(void *arg) {
 
   while (rrh_exit == 0) {    
     while (rx_pos <(1 + subframe)*samples_per_subframe) {
-      LOG_D(RRH,"starting a new send:%d  %d\n",sync_trx,frame);
+      //LOG_D(RRH,"starting a new send:%d  %d\n",sync_trx,frame);
       VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_RX, 1 );
       VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_HW_FRAME_RX, frame);
       VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_HW_SUBFRAME_RX, subframe );  
       VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RX_PCK, pck_rx );
       LOG_D(RRH,"pack=%d    rx_pos=%d    subframe=%d frame=%d\n ",pck_rx, rx_pos, subframe,frame);
       
-      if (dev->devs->type == NONE_IF) {	
+      if (dev->devs->type == NONE_DEV) {	
 	VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RX_HWCNT, hw_counter );
 	VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RX_LHWCNT, last_hw_counter );
 	VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_CNT, s_cnt );
@@ -501,19 +435,19 @@ void *rrh_eNB_rx_thread(void *arg) {
 	}
        }
        
-       for (i=0; i<dev->eth_dev.openair0_cfg.rx_num_channels; i++) {
+       for (i=0; i<dev->eth_dev.openair0_cfg->rx_num_channels; i++) {
 	 rx_eNB[i] = (void*)&rx_buffer_eNB[i][rx_pos];
 	 LOG_D(RRH," rx_eNB[i]=%p rx_buffer_eNB[i][rx_pos]=%p ,rx_pos=%d, i=%d ts=%d\n",rx_eNB[i],&rx_buffer_eNB[i][rx_pos],rx_pos,i,timestamp_rx);	 
        }  
        VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RXCNT, rx_pos );
-       if (dev->devs->type != NONE_IF) {
+       if (dev->devs->type != NONE_DEV) {
 	 VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_RF, 1 ); 
 	 /* Read operation to RF device (RX)*/
 	 if ( dev->devs->trx_read_func (dev->devs,
 					&timestamp_rx,
 					rx_eNB,
 					spp_rf,
-					dev->devs->openair0_cfg.rx_num_channels
+					dev->devs->openair0_cfg->rx_num_channels
 					)<0) {
 	   perror("RRH eNB : USRP read");
 	 }
@@ -526,14 +460,14 @@ void *rrh_eNB_rx_thread(void *arg) {
 						      timestamp_rx,
 						      rx_eNB,
 						      spp_eth,
-						      dev->eth_dev.openair0_cfg.rx_num_channels,
+						      dev->eth_dev.openair0_cfg->rx_num_channels,
 						      0))<0) {
 	 perror("RRH eNB : ETHERNET write");
        }    
        VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 );
 
        /* when there is no RF timestamp is updated by number of samples */
-       if (dev->devs->type == NONE_IF) {
+       if (dev->devs->type == NONE_DEV) {
 	 timestamp_rx+=spp_eth;
 	 last_hw_counter=hw_counter;
        }
@@ -559,7 +493,7 @@ void *rrh_eNB_rx_thread(void *arg) {
 	   }
 	   if (s_period++ == PRINTF_PERIOD) {
 	     s_period=0;
-	     LOG_I(RRH,"Average eNB RX time : %lu\tMax RX time : %lu\tMin RX time : %lu\n",average_rx_time,max_rx_time,min_rx_time);
+	     LOG_I(RRH,"Average eNB RX time : %lu ns\tMax RX time : %lu ns\tMin RXX time : %lu ns\n",average_rx_time,max_rx_time,min_rx_time);
 	   }
 	 }
 	 
@@ -577,7 +511,7 @@ void *rrh_eNB_rx_thread(void *arg) {
        next_rx_pos=(rx_pos+spp_eth);
        
        VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_RX, 0 );
-       /**/
+       /*
        if (frame>50) {
 	 pthread_mutex_lock(&sync_trx_mutex);
 	 while (sync_trx) {
@@ -587,7 +521,7 @@ void *rrh_eNB_rx_thread(void *arg) {
 	 LOG_D(RRH,"out of while send:%d  %d\n",sync_trx,frame);
 	 pthread_cond_signal(&sync_trx_cond);
 	 pthread_mutex_unlock(&sync_trx_mutex);
-       }
+	 }*/
     } // while 
     
     subframe++;
@@ -609,6 +543,7 @@ void *rrh_eNB_rx_thread(void *arg) {
   return 0;
 }
 
+/* Receive from eNB and transmit to RF */
 
 void *rrh_eNB_tx_thread(void *arg) {
 
@@ -625,7 +560,7 @@ void *rrh_eNB_tx_thread(void *arg) {
   unsigned int subframe=0,frame=0;
   unsigned int pck_tx=0;
   
-#ifdef LOWLATENCY
+#ifdef DEADLINE_SCHEDULER
   struct sched_attr attr;
   unsigned int flags = 0;
   
@@ -647,60 +582,34 @@ void *rrh_eNB_tx_thread(void *arg) {
   
   time_req_1us.tv_sec = 1;
   time_req_1us.tv_nsec = 0;
-  spp_eth = dev->eth_dev.openair0_cfg.samples_per_packet;
-  spp_rf =  dev->devs->openair0_cfg.samples_per_packet;
-  samples_per_frame = dev->eth_dev.openair0_cfg.samples_per_frame;
+  spp_eth = dev->eth_dev.openair0_cfg->samples_per_packet;
+  spp_rf =  dev->devs->openair0_cfg->samples_per_packet;
+  samples_per_frame = dev->eth_dev.openair0_cfg->samples_per_frame;
   samples_per_subframe = (unsigned int)samples_per_frame/10;
   tx_pos=0;
-  //tx_pos_rf=spp_rf*dev->devs->openair0_cfg.tx_delay;
-  
+
   loopback = dev->loopback;
   measurements = dev->measurements;
   
   while (rrh_exit == 0) {     
     while (tx_pos < (1 + subframe)*samples_per_subframe) {
       
-      LOG_D(RRH,"bef lock read:%d  %d\n",sync_trx,frame);
-      pthread_mutex_lock(&sync_trx_mutex);
+      //LOG_D(RRH,"bef lock read:%d  %d\n",sync_trx,frame);
+      //pthread_mutex_lock(&sync_trx_mutex);
       
-      while (!sync_trx) {
-	LOG_D(RRH,"in sync read:%d  %d\n",sync_trx,frame);
-	pthread_cond_wait(&sync_trx_cond,&sync_trx_mutex);
-      }
-      LOG_D(RRH,"out of while read:%d  %d\n",sync_trx,frame);
+      //while (!sync_trx) {
+      //LOG_D(RRH,"in sync read:%d  %d\n",sync_trx,frame);
+      //pthread_cond_wait(&sync_trx_cond,&sync_trx_mutex);
+      //}
+      //LOG_D(RRH,"out of while read:%d  %d\n",sync_trx,frame);
       
       VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_TX, 1 );
       VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_HW_FRAME, frame);
       VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_HW_SUBFRAME, subframe );
       VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TX_PCK, pck_tx );
-      
-      /*	
-		if (dev->devs->type == NONE_IF) {  
-		VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TX_HWCNT, hw_counter );
-		VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TX_LHWCNT, last_hw_counter );    
-		
-		if (!eNB_tx_started) {
-		eNB_tx_started=1; // set this flag to 1 to indicate that eNB started
-		if (RT_flag_eNB==1) {
-		last_hw_counter=hw_counter;
-		}
-		} else {
-		if (RT_flag_eNB==1) {
-		if (hw_counter > last_hw_counter+1) {
-		printf("LT");
-		} else {
-		while ((hw_counter < last_hw_counter+1)) {
-		VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_TX_SLEEP, 1 );
-		nanosleep(&time_req_1us,&time_rem_1us);
-		VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_TX_SLEEP, 0 );
-		}
-		}
-		}
-		}
-		}    */
-      
+          
       if (measurements == 1 ) 	clock_gettime(CLOCK_MONOTONIC,&time1); 
-      for (i=0; i<dev->eth_dev.openair0_cfg.tx_num_channels; i++) tx_eNB[i] = (void*)&tx_buffer_eNB[i][tx_pos];	//RF!!!!!		
+      for (i=0; i<dev->eth_dev.openair0_cfg->tx_num_channels; i++) tx_eNB[i] = (void*)&tx_buffer_eNB[i][tx_pos];		
       
       VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TXCNT, tx_pos );
       VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 1 );
@@ -710,12 +619,12 @@ void *rrh_eNB_tx_thread(void *arg) {
 							&timestamp_tx,
 							tx_eNB,
 							spp_eth,
-							dev->eth_dev.openair0_cfg.tx_num_channels))<0) {
+							dev->eth_dev.openair0_cfg->tx_num_channels))<0) {
 	perror("RRH eNB : ETHERNET read");
       }		
       VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 );	
       
-      if (dev->devs->type != NONE_IF) {  
+      if (dev->devs->type != NONE_DEV) {  
 	LOG_D(RRH," tx_buffer_eNB[i][tx_pos]=%x t_buffer_eNB[i][tx_pos+1]=%x t_buffer_eNB[i][tx_pos+2]=%x \n",tx_buffer_eNB[0][tx_pos],tx_buffer_eNB[0][tx_pos+1],tx_buffer_eNB[0][tx_pos+2]);	 
 	VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_RF, 1 );    
 	/* Write operation to RF device (TX)*/
@@ -723,8 +632,8 @@ void *rrh_eNB_tx_thread(void *arg) {
 					timestamp_tx,
 					tx_eNB,
 					spp_rf,
-					dev->devs->openair0_cfg.tx_num_channels,
-					0)<0){
+					dev->devs->openair0_cfg->tx_num_channels,
+					1)<0){
 	  perror("RRH eNB : USRP write");
 	}
 	VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_RF, 0 );
@@ -733,7 +642,7 @@ void *rrh_eNB_tx_thread(void *arg) {
       VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TX_TS, timestamp_tx&0xffffffff ); 
       
             
-      if (dev->devs->type == NONE_IF)	last_hw_counter=hw_counter;
+      if (dev->devs->type == NONE_DEV)	last_hw_counter=hw_counter;
     
     
       if (loopback ==1 ) { 
@@ -754,10 +663,10 @@ void *rrh_eNB_tx_thread(void *arg) {
       tx_pos += spp_eth;
       pck_tx++;   
       
-      VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_TX, 0 );
-      sync_trx=0;
-      pthread_cond_signal(&sync_trx_cond);
-      pthread_mutex_unlock(&sync_trx_mutex);
+      //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_TX, 0 );
+      //sync_trx=0;
+      //pthread_cond_signal(&sync_trx_cond);
+      //pthread_mutex_unlock(&sync_trx_mutex);
     }
 
     /* wrap around tx buffer index */
@@ -775,72 +684,67 @@ void *rrh_eNB_tx_thread(void *arg) {
 }
 
 
-static void calc_rt_period_ns( openair0_config_t openair0_cfg) {
+static void calc_rt_period_ns( openair0_config_t *openair0_cfg) {
 
-  rt_period= (double)(openair0_cfg.samples_per_packet/(openair0_cfg.samples_per_frame/10.0)*1000000);
+  rt_period= (double)(openair0_cfg->samples_per_packet/(openair0_cfg->samples_per_frame/10.0)*1000000);
   AssertFatal(rt_period > 0, "Invalid rt period !%u\n", rt_period);
   LOG_I(RRH,"[eNB] Real time period is set to %u ns\n", rt_period);	
 }
 
 
 static void check_dev_config( rrh_module_t *mod_enb) {
-  
-  
-  AssertFatal( (mod_enb->devs->openair0_cfg.num_rb_dl==100 || mod_enb->devs->openair0_cfg.num_rb_dl==50 || mod_enb->devs->openair0_cfg.num_rb_dl==25 || mod_enb->devs->openair0_cfg.num_rb_dl==6) , "Invalid number of resource blocks! %d\n", mod_enb->devs->openair0_cfg.num_rb_dl);
- AssertFatal( mod_enb->devs->openair0_cfg.samples_per_frame  > 0 ,  "Invalid number of samples per frame! %d\n",mod_enb->devs->openair0_cfg.samples_per_frame); 
- AssertFatal( mod_enb->devs->openair0_cfg.sample_rate        > 0.0, "Invalid sample rate! %f\n", mod_enb->devs->openair0_cfg.sample_rate);
- AssertFatal( mod_enb->devs->openair0_cfg.samples_per_packet > 0 ,  "Invalid number of samples per packet! %d\n",mod_enb->devs->openair0_cfg.samples_per_packet);
- AssertFatal( mod_enb->devs->openair0_cfg.rx_num_channels    > 0 ,  "Invalid number of RX antennas! %d\n", mod_enb->devs->openair0_cfg.rx_num_channels); 
- AssertFatal( mod_enb->devs->openair0_cfg.tx_num_channels    > 0 ,  "Invalid number of TX antennas! %d\n", mod_enb->devs->openair0_cfg.tx_num_channels);
- AssertFatal( mod_enb->devs->openair0_cfg.rx_freq[0]         > 0.0 ,"Invalid RX frequency! %f\n", mod_enb->devs->openair0_cfg.rx_freq[0]); 
- AssertFatal( mod_enb->devs->openair0_cfg.tx_freq[0]         > 0.0 ,"Invalid TX frequency! %f\n", mod_enb->devs->openair0_cfg.tx_freq[0]);
- AssertFatal( mod_enb->devs->openair0_cfg.rx_gain[0]         > 0.0 ,"Invalid RX gain! %f\n", mod_enb->devs->openair0_cfg.rx_gain[0]); 
- AssertFatal( mod_enb->devs->openair0_cfg.tx_gain[0]         > 0.0 ,"Invalid TX gain! %f\n", mod_enb->devs->openair0_cfg.tx_gain[0]);
- AssertFatal( mod_enb->devs->openair0_cfg.rx_bw              > 0.0 ,"Invalid RX bw! %f\n", mod_enb->devs->openair0_cfg.rx_bw); 
- AssertFatal( mod_enb->devs->openair0_cfg.tx_bw              > 0.0 ,"Invalid RX bw! %f\n", mod_enb->devs->openair0_cfg.tx_bw);
- AssertFatal( mod_enb->devs->openair0_cfg.autocal[0]         > 0 ,  "Invalid auto calibration choice! %d\n", mod_enb->devs->openair0_cfg.autocal[0]);
+    
+ AssertFatal( (mod_enb->devs->openair0_cfg->num_rb_dl==100 || mod_enb->devs->openair0_cfg->num_rb_dl==50 || mod_enb->devs->openair0_cfg->num_rb_dl==25 || mod_enb->devs->openair0_cfg->num_rb_dl==6) , "Invalid number of resource blocks! %d\n", mod_enb->devs->openair0_cfg->num_rb_dl);
+ AssertFatal( mod_enb->devs->openair0_cfg->samples_per_frame  > 0 ,  "Invalid number of samples per frame! %d\n",mod_enb->devs->openair0_cfg->samples_per_frame); 
+ AssertFatal( mod_enb->devs->openair0_cfg->sample_rate        > 0.0, "Invalid sample rate! %f\n", mod_enb->devs->openair0_cfg->sample_rate);
+ AssertFatal( mod_enb->devs->openair0_cfg->samples_per_packet > 0 ,  "Invalid number of samples per packet! %d\n",mod_enb->devs->openair0_cfg->samples_per_packet);
+ AssertFatal( mod_enb->devs->openair0_cfg->rx_num_channels    > 0 ,  "Invalid number of RX antennas! %d\n", mod_enb->devs->openair0_cfg->rx_num_channels); 
+ AssertFatal( mod_enb->devs->openair0_cfg->tx_num_channels    > 0 ,  "Invalid number of TX antennas! %d\n", mod_enb->devs->openair0_cfg->tx_num_channels);
+ AssertFatal( mod_enb->devs->openair0_cfg->rx_freq[0]         > 0.0 ,"Invalid RX frequency! %f\n", mod_enb->devs->openair0_cfg->rx_freq[0]); 
+ AssertFatal( mod_enb->devs->openair0_cfg->tx_freq[0]         > 0.0 ,"Invalid TX frequency! %f\n", mod_enb->devs->openair0_cfg->tx_freq[0]);
+ AssertFatal( mod_enb->devs->openair0_cfg->rx_gain[0]         > 0.0 ,"Invalid RX gain! %f\n", mod_enb->devs->openair0_cfg->rx_gain[0]); 
+ AssertFatal( mod_enb->devs->openair0_cfg->tx_gain[0]         > 0.0 ,"Invalid TX gain! %f\n", mod_enb->devs->openair0_cfg->tx_gain[0]);
+ AssertFatal( mod_enb->devs->openair0_cfg->rx_bw              > 0.0 ,"Invalid RX bw! %f\n", mod_enb->devs->openair0_cfg->rx_bw); 
+ AssertFatal( mod_enb->devs->openair0_cfg->tx_bw              > 0.0 ,"Invalid RX bw! %f\n", mod_enb->devs->openair0_cfg->tx_bw);
+ AssertFatal( mod_enb->devs->openair0_cfg->autocal[0]         > 0 ,  "Invalid auto calibration choice! %d\n", mod_enb->devs->openair0_cfg->autocal[0]);
  
  printf("\n---------------------RF device configuration parameters---------------------\n");
  
- printf("\tMod_id=%d\n \tlog level=%d\n \tDL_RB=%d\n \tsamples_per_frame=%d\n \tsample_rate=%f\n \tsamples_per_packet=%d\n \ttx_delay=%d\n \ttx_forward_nsamps=%d\n \trx_num_channels=%d\n \ttx_num_channels=%d\n \trx_freq_0=%f\n \ttx_freq_0=%f\n \trx_freq_1=%f\n \ttx_freq_1=%f\n \trx_freq_2=%f\n \ttx_freq_2=%f\n \trx_freq_3=%f\n \ttx_freq_3=%f\n \trxg_mode=%d\n \trx_gain_0=%f\n \ttx_gain_0=%f\n  \trx_gain_1=%f\n \ttx_gain_1=%f\n  \trx_gain_2=%f\n \ttx_gain_2=%f\n  \trx_gain_3=%f\n \ttx_gain_3=%f\n \trx_gain_offset_2=%f\n \ttx_gain_offset_3=%f\n  \trx_bw=%f\n \ttx_bw=%f\n \tautocal=%d\n \trem_addr %s:%d\n \tmy_addr %s:%d\n",	
-	mod_enb->devs->openair0_cfg.Mod_id,
-	mod_enb->devs->openair0_cfg.log_level,
-	mod_enb->devs->openair0_cfg.num_rb_dl,
-	mod_enb->devs->openair0_cfg.samples_per_frame,
-	mod_enb->devs->openair0_cfg.sample_rate,
-	mod_enb->devs->openair0_cfg.samples_per_packet,
-	mod_enb->devs->openair0_cfg.tx_delay,
-	mod_enb->devs->openair0_cfg.tx_forward_nsamps,
-	mod_enb->devs->openair0_cfg.rx_num_channels,
-	mod_enb->devs->openair0_cfg.tx_num_channels,
-	mod_enb->devs->openair0_cfg.rx_freq[0],
-	mod_enb->devs->openair0_cfg.tx_freq[0],
-	mod_enb->devs->openair0_cfg.rx_freq[1],
-	mod_enb->devs->openair0_cfg.tx_freq[1],
-	mod_enb->devs->openair0_cfg.rx_freq[2],
-	mod_enb->devs->openair0_cfg.tx_freq[2],
-	mod_enb->devs->openair0_cfg.rx_freq[3],
-	mod_enb->devs->openair0_cfg.tx_freq[3],
-	mod_enb->devs->openair0_cfg.rxg_mode[0],
-	mod_enb->devs->openair0_cfg.rx_gain[0],
-	mod_enb->devs->openair0_cfg.tx_gain[0],
-	mod_enb->devs->openair0_cfg.rx_gain[1],
-	mod_enb->devs->openair0_cfg.tx_gain[1],
-	mod_enb->devs->openair0_cfg.rx_gain[2],
-	mod_enb->devs->openair0_cfg.tx_gain[2],
-	mod_enb->devs->openair0_cfg.rx_gain[3],
-	mod_enb->devs->openair0_cfg.tx_gain[3],
-	//mod_enb->devs->openair0_cfg.rx_gain_offset[0],
-	//mod_enb->devs->openair0_cfg.rx_gain_offset[1],
-	mod_enb->devs->openair0_cfg.rx_gain_offset[2],
-	mod_enb->devs->openair0_cfg.rx_gain_offset[3],
-	mod_enb->devs->openair0_cfg.rx_bw,
-	mod_enb->devs->openair0_cfg.tx_bw,
-	mod_enb->devs->openair0_cfg.autocal[0],
-	mod_enb->devs->openair0_cfg.remote_ip,
-	mod_enb->devs->openair0_cfg.remote_port,
-	mod_enb->devs->openair0_cfg.my_ip,
-	mod_enb->devs->openair0_cfg.my_port  
+ printf("\tMod_id=%d\n \tlog level=%d\n \tDL_RB=%d\n \tsamples_per_frame=%d\n \tsample_rate=%f\n \tsamples_per_packet=%d\n \ttx_scheduling_advance=%d\n \ttx_sample_advance=%d\n \trx_num_channels=%d\n \ttx_num_channels=%d\n \trx_freq_0=%f\n \ttx_freq_0=%f\n \trx_freq_1=%f\n \ttx_freq_1=%f\n \trx_freq_2=%f\n \ttx_freq_2=%f\n \trx_freq_3=%f\n \ttx_freq_3=%f\n \trxg_mode=%d\n \trx_gain_0=%f\n \ttx_gain_0=%f\n  \trx_gain_1=%f\n \ttx_gain_1=%f\n  \trx_gain_2=%f\n \ttx_gain_2=%f\n  \trx_gain_3=%f\n \ttx_gain_3=%f\n \trx_gain_offset_2=%f\n \ttx_gain_offset_3=%f\n  \trx_bw=%f\n \ttx_bw=%f\n \tautocal=%d\n",	
+	mod_enb->devs->openair0_cfg->Mod_id,
+	mod_enb->devs->openair0_cfg->log_level,
+	mod_enb->devs->openair0_cfg->num_rb_dl,
+	mod_enb->devs->openair0_cfg->samples_per_frame,
+	mod_enb->devs->openair0_cfg->sample_rate,
+	mod_enb->devs->openair0_cfg->samples_per_packet,
+	mod_enb->devs->openair0_cfg->tx_scheduling_advance,
+	mod_enb->devs->openair0_cfg->tx_sample_advance,
+	mod_enb->devs->openair0_cfg->rx_num_channels,
+	mod_enb->devs->openair0_cfg->tx_num_channels,
+	mod_enb->devs->openair0_cfg->rx_freq[0],
+	mod_enb->devs->openair0_cfg->tx_freq[0],
+	mod_enb->devs->openair0_cfg->rx_freq[1],
+	mod_enb->devs->openair0_cfg->tx_freq[1],
+	mod_enb->devs->openair0_cfg->rx_freq[2],
+	mod_enb->devs->openair0_cfg->tx_freq[2],
+	mod_enb->devs->openair0_cfg->rx_freq[3],
+	mod_enb->devs->openair0_cfg->tx_freq[3],
+	mod_enb->devs->openair0_cfg->rxg_mode[0],
+	mod_enb->devs->openair0_cfg->tx_gain[0],
+	mod_enb->devs->openair0_cfg->tx_gain[0],
+	mod_enb->devs->openair0_cfg->rx_gain[1],
+	mod_enb->devs->openair0_cfg->tx_gain[1],
+	mod_enb->devs->openair0_cfg->rx_gain[2],
+	mod_enb->devs->openair0_cfg->tx_gain[2],
+	mod_enb->devs->openair0_cfg->rx_gain[3],
+	mod_enb->devs->openair0_cfg->tx_gain[3],
+	//mod_enb->devs->openair0_cfg->rx_gain_offset[0],
+	//mod_enb->devs->openair0_cfg->rx_gain_offset[1],
+	mod_enb->devs->openair0_cfg->rx_gain_offset[2],
+	mod_enb->devs->openair0_cfg->rx_gain_offset[3],
+	mod_enb->devs->openair0_cfg->rx_bw,
+	mod_enb->devs->openair0_cfg->tx_bw,
+	mod_enb->devs->openair0_cfg->autocal[0]  
 	);
  
  printf("----------------------------------------------------------------------------\n");
diff --git a/targets/RT/USER/eNB_usrp.gtkw b/targets/RT/USER/eNB_usrp.gtkw
index ca9427a38de4e00b1588cdeb652feb389725bb25..935bf68b2eb49084c0e2738d758b106215bc7571 100644
--- a/targets/RT/USER/eNB_usrp.gtkw
+++ b/targets/RT/USER/eNB_usrp.gtkw
@@ -1,17 +1,17 @@
 [*]
 [*] GTKWave Analyzer v3.3.58 (w)1999-2014 BSI
-[*] Wed Sep  9 13:51:16 2015
+[*] Sun Apr 10 20:34:38 2016
 [*]
-[dumpfile] "/homes/kaltenbe/openair_dump_eNB_usrp_note4.gtk"
-[dumpfile_mtime] "Wed Sep  9 13:39:25 2015"
-[dumpfile_size] 323681028
-[savefile] "/homes/kaltenbe/Devel/openair/openair4G/trunk/targets/RT/USER/eNB.gtkw"
-[timestart] 63022760000
-[size] 1855 1056
-[pos] -851 -429
-*-22.793451 63031840000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-[sst_width] 224
-[signals_width] 230
+[dumpfile] "/tmp/openair_dump_eNB.vcd"
+[dumpfile_mtime] "Sun Apr 10 20:26:57 2016"
+[dumpfile_size] 181182776
+[savefile] "/home/papillon/openairinterface5g/targets/RT/USER/eNB_usrp.gtkw"
+[timestart] 19787100000
+[size] 1535 876
+[pos] -1 -1
+*-21.793451 19795882832 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
+[sst_width] 284
+[signals_width] 238
 [sst_expanded] 1
 [sst_vpaned_height] 294
 @24
@@ -50,16 +50,120 @@ functions.eNB_thread_rx9
 functions.eNB_thread_tx9
 functions.phy_procedures_eNb_tx
 functions.phy_procedures_eNb_rx
+@24
+variables.dci_info[63:0]
+variables.ue0_BO[63:0]
+@420
+variables.ue0_BSR[63:0]
+variables.ue0_timing_advance[63:0]
+@28
+functions.macxface_initiate_ra_proc
+functions.macxface_terminate_ra_proc
+functions.phy_enb_ulsch_msg3
+functions.macxface_SR_indication
+@420
+variables.ue0_SR_ENERGY[63:0]
+variables.ue0_SR_THRES[63:0]
+@25
+variables.dci_info[63:0]
+@28
+functions.phy_enb_ulsch_decoding0
+@24
+variables.ue0_res0[63:0]
+@420
+variables.ue0_rssi0[63:0]
+variables.ue0_MCS0[63:0]
+variables.ue0_RB0[63:0]
+@24
+variables.ue0_ROUND0[63:0]
+variables.ue0_SFN0[63:0]
+@28
+functions.phy_enb_ulsch_decoding1
+@24
+variables.ue0_res1[63:0]
+@420
+variables.ue0_rssi1[63:0]
+variables.ue0_MCS1[63:0]
+variables.ue0_RB1[63:0]
+@24
+variables.ue0_ROUND1[63:0]
+variables.ue0_SFN1[63:0]
+@28
+functions.phy_enb_ulsch_decoding2
+@24
+variables.ue0_res2[63:0]
+@420
+variables.ue0_rssi2[63:0]
+variables.ue0_MCS2[63:0]
+variables.ue0_RB2[63:0]
+@24
+variables.ue0_ROUND2[63:0]
+variables.ue0_SFN2[63:0]
+@28
+functions.phy_enb_ulsch_decoding3
+@24
+variables.ue0_res3[63:0]
+@420
+variables.ue0_rssi3[63:0]
+variables.ue0_MCS3[63:0]
+variables.ue0_RB3[63:0]
+@24
+variables.ue0_ROUND3[63:0]
+variables.ue0_SFN3[63:0]
+@28
+functions.phy_enb_ulsch_decoding4
+@420
+variables.ue0_rssi4[63:0]
+@24
+variables.ue0_res4[63:0]
+@420
+variables.ue0_MCS4[63:0]
+variables.ue0_RB4[63:0]
+@24
+variables.ue0_ROUND4[63:0]
+variables.ue0_SFN4[63:0]
+@28
+functions.phy_enb_ulsch_decoding5
+@24
+variables.ue0_res5[63:0]
+@420
+variables.ue0_rssi5[63:0]
+variables.ue0_MCS5[63:0]
+variables.ue0_RB5[63:0]
+@24
+variables.ue0_ROUND5[63:0]
+variables.ue0_SFN5[63:0]
+@28
+functions.phy_enb_ulsch_decoding6
+@24
+variables.ue0_res6[63:0]
+@420
+variables.ue0_rssi6[63:0]
+variables.ue0_MCS6[63:0]
+variables.ue0_RB6[63:0]
+@24
+variables.ue0_ROUND6[63:0]
+variables.ue0_SFN6[63:0]
+@28
+functions.phy_enb_ulsch_decoding7
+@24
+variables.ue0_res7[63:0]
+@420
+variables.ue0_rssi7[63:0]
+variables.ue0_MCS7[63:0]
+variables.ue0_RB7[63:0]
+@24
+variables.ue0_ROUND7[63:0]
+variables.ue0_SFN7[63:0]
+@28
 functions.phy_enb_prach_rx
 functions.phy_eNB_dlsch_encoding
 functions.phy_eNB_dlsch_modulation
 functions.phy_eNB_dlsch_scrambling
 functions.phy_enb_pdcch_tx
-functions.phy_enb_ulsch_decoding
 functions.phy_enb_rs_tx
 functions.rrc_mac_config_req
 functions.rlc_data_req
-@29
 functions.udp_enb_task
 [pattern_trace] 1
 [pattern_trace] 0
diff --git a/targets/RT/USER/ieee80211p-softmodem.c b/targets/RT/USER/ieee80211p-softmodem.c
deleted file mode 100644
index ffd630d40bc710738d5cc06ddc02c9978de62694..0000000000000000000000000000000000000000
--- a/targets/RT/USER/ieee80211p-softmodem.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/******************************************************************************
- *
- * Copyright(c) EURECOM / Thales Communications & Security
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * The full GNU General Public License is included in this distribution in the
- * file called LICENSE.
- *
- * Contact Information:
- * Thales Communications & Security <philippe.agostini@thalesgroup.com>
- *
- *****************************************************************************/
-
-/******************************************************************************
- *
- * Includes
- *
- *****************************************************************************/
-
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include "ieee80211p-netlinkapi.h"
-#include "phy/DOT11/defs.h"
-#include "PHY/TOOLS/defs.h"
-#include <stdint.h>
-#include <string.h>
-#include <pthread.h>
-
-#include <rtai_lxrt.h>
-#include <rtai_sem.h>
-#include <rtai_msg.h>
-
-
-/******************************************************************************
- *
- * Definitions
- *
- *****************************************************************************/
-
-enum nl80211_band {
-  NL80211_BAND_2GHZ,
-  NL80211_BAND_5GHZ,
-  NL80211_BAND_5_9GHZ,
-  NL80211_BAND_0_8GHZ,
-};
-
-enum ieee80211_band {
-  IEEE80211_BAND_2GHZ = NL80211_BAND_2GHZ,
-  IEEE80211_BAND_5GHZ = NL80211_BAND_5GHZ,
-  IEEE80211_BAND_5_9GHZ = NL80211_BAND_5_9GHZ,
-  IEEE80211_BAND_0_8GHZ = NL80211_BAND_0_8GHZ,
-};
-
-struct ieee80211p_rx_status {
-  short data_len; //frame data length in bytes
-  char  rssi;     //received power in dBm
-  char  rate;     //reveived data rate in units of 100 kbps
-  enum ieee80211_band band;
-  char  flags;    //RX flags
-}; /* struct ieee80211p_rx_status */
-
-extern uint32_t *txdata[2],*rxdata[2];
-//CHANNEL_STATUS_t dot11_state = IDLE;
-extern int oai_exit;
-
-extern unsigned int *DAQ_MBOX;
-
-extern int Ndbps[8];
-
-extern int32_t rxDATA_F_comp_aggreg2[48*1024];
-extern int32_t rxDATA_F_comp_aggreg3[48*1024];
-
-extern uint32_t rxgain[4];
-extern uint32_t rxg_max[4], rxg_med[4], rxg_byp[4];
-
-#define FRAME_LENGTH_SAMPLES 76800
-#define RX_THRES 60
-
-#define SLOT_DURATION_5MHz 105
-#define RX_THRES_dB 40
-
-int tx_sdu_active = 0;
-int tx_sdu_length = 0;
-char rxsdu[2000];
-
-void *tx_thread(void *arg)
-{
-
-  int fd=*((int*)arg);
-  RT_TASK *task;
-  int ret;
-  int i;
-  char dummy_data[10];
-
-
-  if (fd > 0) {
-
-    ret = netlink_send(fd,NLCMD_INIT,10,&dummy_data[0]);
-
-    printf("tx_thread starting, fd %d\n",fd);
-
-    task = rt_task_init_schmod(nam2num("TASK1"), 0, 0, 0, SCHED_FIFO, 0xF);
-    mlockall(MCL_CURRENT | MCL_FUTURE);
-    //  rt_make_hard_real_time();
-
-    while (!oai_exit) {
-
-      if (tx_sdu_active == 1)
-        printf("tx_thread: waiting (MBOX %d)\n",((unsigned int*)DAQ_MBOX)[0]);
-
-      while(((volatile int)tx_sdu_active) != 0) {
-        rt_sleep(nano2count(66666));
-      }
-
-      printf("tx_thread: calling netlink\n");
-      ret = netlink_recv(fd,rxsdu);
-      tx_sdu_active = 1;
-      tx_sdu_length = ret;
-
-      /*
-      if (ret > 0) {
-
-      printf("received TX SDU: ");
-      for (i=0;i<ret;i++) {
-      printf("%02hhx ",rxsdu[i]);
-      }
-
-      printf("\n");
-
-      }
-      */
-
-    }
-  } else {
-    printf("tx_thread: no netlink\n");
-  }
-
-  printf("tx_thread exiting\n");
-
-  return(0);
-}
-
-
-/******************************************************************************
- *
- * Main
- *
- *****************************************************************************/
-
-/*
-int dot11_netlink_init() {
-
-  int fd;
-  int ret;
-  int i;
-  char txdata[10];
-
-  fd = netlink_init();
-
-  if (fd < 0) {
-    return -1;
-  }
-
-  ret = netlink_send(fd,NLCMD_INIT,10,&txdata[0]);
-
-
-
-  return(fd);
-}
-
-*/
-
diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c
index 60863b442f4629a7f47e702bd497ec204a55d6e2..d2bdd5c5043fd63acc9aebf15b95af82c1f858f3 100644
--- a/targets/RT/USER/lte-softmodem.c
+++ b/targets/RT/USER/lte-softmodem.c
@@ -50,8 +50,12 @@
 #include <signal.h>
 #include <execinfo.h>
 #include <getopt.h>
+#include <sys/sysinfo.h>
+
+#include "T.h"
 
 #include "rt_wrapper.h"
+
 #undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all
 
 #include "assertions.h"
@@ -77,8 +81,6 @@ struct gps_fix_t dummy_gps_data;
 //#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
 
 #include "PHY/vars.h"
-#include "MAC_INTERFACE/vars.h"
-//#include "SCHED/defs.h"
 #include "SCHED/vars.h"
 #include "LAYER2/MAC/vars.h"
 
@@ -88,13 +90,11 @@ struct gps_fix_t dummy_gps_data;
 #include "SCHED/phy_procedures_emos.h"
 #endif
 
-#ifdef OPENAIR2
 #include "LAYER2/MAC/defs.h"
 #include "LAYER2/MAC/vars.h"
 #include "LAYER2/MAC/proto.h"
 #include "RRC/LITE/vars.h"
 #include "PHY_INTERFACE/vars.h"
-#endif
 
 #ifdef SMBV
 #include "PHY/TOOLS/smbv.h"
@@ -164,7 +164,7 @@ FD_lte_phy_scope_ue  *form_ue[NUMBER_OF_UE_MAX];
 FD_lte_phy_scope_enb *form_enb[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
 FD_stats_form                  *form_stats=NULL,*form_stats_l2=NULL;
 char title[255];
-unsigned char                   scope_enb_num_ue = 1;
+unsigned char                   scope_enb_num_ue = 2;
 #endif //XFORMS
 
 #ifdef RTAI
@@ -179,7 +179,7 @@ pthread_t                       main_ue_thread;
 pthread_attr_t                  attr_dlsch_threads;
 pthread_attr_t                  attr_UE_thread;
 
-#ifndef LOWLATENCY
+#ifndef DEADLINE_SCHEDULER
 struct sched_param              sched_param_dlsch;
 #endif
 #endif
@@ -195,7 +195,7 @@ struct sched_param              sched_param_UE_thread;
 
 pthread_attr_t                  attr_eNB_proc_tx[MAX_NUM_CCs][NUM_ENB_THREADS];
 pthread_attr_t                  attr_eNB_proc_rx[MAX_NUM_CCs][NUM_ENB_THREADS];
-#ifndef LOWLATENCY
+#ifndef DEADLINE_SCHEDULER
 struct sched_param              sched_param_eNB_proc_tx[MAX_NUM_CCs][NUM_ENB_THREADS];
 struct sched_param              sched_param_eNB_proc_rx[MAX_NUM_CCs][NUM_ENB_THREADS];
 #endif
@@ -235,6 +235,7 @@ static int                      time_offset[4] = {0,0,0,0};
 static char                     UE_flag=0;
 //static uint8_t                  eNB_id=0,UE_id=0;
 
+static char                     threequarter_fs=0;
 
 uint32_t                 downlink_frequency[MAX_NUM_CCs][4];
 int32_t                  uplink_frequency_offset[MAX_NUM_CCs][4];
@@ -289,7 +290,10 @@ double bw = 10.0e6;
 
 static int                      tx_max_power[MAX_NUM_CCs]; /* =  {0,0}*/;
 
+char   rf_config_file[1024];
+
 int chain_offset=0;
+int phy_test = 0;
 
 #ifndef EXMIMO
 char ref[128] = "internal";
@@ -315,7 +319,8 @@ static LTE_DL_FRAME_PARMS      *frame_parms[MAX_NUM_CCs];
 
 int multi_thread=1;
 uint32_t target_dl_mcs = 28; //maximum allowed mcs
-uint32_t target_ul_mcs = 10;
+uint32_t target_ul_mcs = 20;
+uint32_t timing_advance = 0;
 uint8_t exit_missed_slots=1;
 uint64_t num_missed_slots=0; // counter for the number of missed slots
 
@@ -328,7 +333,6 @@ void reset_opp_meas(void);
 void print_opp_meas(void);
 int transmission_mode=1;
 
-
 int16_t           glog_level         = LOG_INFO;
 int16_t           glog_verbosity     = LOG_MED;
 int16_t           hw_log_level       = LOG_INFO;
@@ -359,16 +363,60 @@ int16_t           osa_log_verbosity  = LOG_MED;
 
 
 #ifdef ETHERNET
-char rrh_eNB_ip[20] = "127.0.0.1";
-int rrh_eNB_port = 50000;
 char *rrh_UE_ip = "127.0.0.1";
 int rrh_UE_port = 51000;
 #endif
 
+/* flag set by eNB conf file to specify if the radio head is local or remote (default option is local) */
+uint8_t local_remote_radio = BBU_LOCAL_RADIO_HEAD;
+/* struct for ethernet specific parameters given in eNB conf file */
+eth_params_t *eth_params;
+
 char uecap_xer[1024],uecap_xer_in=0;
 extern void *UE_thread(void *arg);
 extern void init_UE_threads(void);
 
+/*---------------------BMC: timespec helpers -----------------------------*/
+
+struct timespec min_diff_time = { .tv_sec = 0, .tv_nsec = 0 };
+struct timespec max_diff_time = { .tv_sec = 0, .tv_nsec = 0 };
+
+struct timespec clock_difftime(struct timespec start, struct timespec end)
+{
+    struct timespec temp;
+    if ((end.tv_nsec-start.tv_nsec)<0) {
+        temp.tv_sec = end.tv_sec-start.tv_sec-1;
+	temp.tv_nsec = 1000000000+end.tv_nsec-start.tv_nsec;
+    } else {
+        temp.tv_sec = end.tv_sec-start.tv_sec;
+	temp.tv_nsec = end.tv_nsec-start.tv_nsec;
+    }
+    return temp;
+}
+
+void print_difftimes(void)
+{
+#ifdef DEBUG
+    printf("difftimes min = %lu ns ; max = %lu ns\n", min_diff_time.tv_nsec, max_diff_time.tv_nsec);
+#else
+    LOG_I(HW,"difftimes min = %lu ns ; max = %lu ns\n", min_diff_time.tv_nsec, max_diff_time.tv_nsec);
+#endif
+}
+
+void update_difftimes(struct timespec start, struct timespec end)
+{
+    struct timespec diff_time = { .tv_sec = 0, .tv_nsec = 0 };
+    int             changed = 0;
+    diff_time = clock_difftime(start, end);
+    if ((min_diff_time.tv_nsec == 0) || (diff_time.tv_nsec < min_diff_time.tv_nsec)) { min_diff_time.tv_nsec = diff_time.tv_nsec; changed = 1; }
+    if ((max_diff_time.tv_nsec == 0) || (diff_time.tv_nsec > max_diff_time.tv_nsec)) { max_diff_time.tv_nsec = diff_time.tv_nsec; changed = 1; }
+#if 1
+    if (changed) print_difftimes();
+#endif
+}
+
+/*------------------------------------------------------------------------*/
+
 unsigned int build_rflocal(int txi, int txq, int rxi, int rxq)
 {
   return (txi + (txq<<6) + (rxi<<12) + (rxq<<18));
@@ -409,6 +457,7 @@ void help (void) {
   printf("  sudo -E lte-softmodem [options]\n");
   printf("  sudo -E ./lte-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.exmimo2.openEPC.conf -S -V -m 26 -t 16 -x 1 --ulsch-max-errors 100 -W\n\n");
   printf("Options:\n");
+  printf("  --rf-config-file Configuration file for front-end (e.g. LMS7002M)\n");
   printf("  --ulsch-max-errors set the max ULSCH erros\n");
   printf("  --calib-ue-rx set UE RX calibration\n");
   printf("  --calib-ue-rx-med \n");
@@ -424,11 +473,10 @@ void help (void) {
   printf("  -d Enable soft scope and L1 and L2 stats (Xforms)\n");
   printf("  -F Calibrate the EXMIMO borad, available files: exmimo2_2arxg.lime exmimo2_2brxg.lime \n");
   printf("  -g Set the global log level, valide options: (9:trace, 8/7:debug, 6:info, 4:warn, 3:error)\n");
-  printf("  -G Set the global log level \n");
+  printf("  -G Set the global log verbosity \n");
   printf("  -h provides this help message!\n");
   printf("  -K Generate ITTI analyzser logs (similar to wireshark logs but with more details)\n");
   printf("  -m Set the maximum downlink MCS\n");
-  printf("  -M IP address of RRH\n");
   printf("  -O eNB configuration file (located in targets/PROJECTS/GENERIC-LTE-EPC/CONF\n");
   printf("  -q Enable processing timing measurement of lte softmodem on per subframe basis \n");
   printf("  -r Set the PRB, valid values: 6, 25, 50, 100  \n");    
@@ -438,8 +486,14 @@ void help (void) {
   printf("  -U Set the lte softmodem as a UE\n");
   printf("  -W Enable L2 wireshark messages on localhost \n");
   printf("  -V Enable VCD (generated file will be located atopenair_dump_eNB.vcd, read it with target/RT/USER/eNB.gtkw\n");
-  printf("  -x Set the transmission mode, valid options: 1 \n"RESET);    
-
+  printf("  -x Set the transmission mode, valid options: 1 \n");
+#if T_TRACER
+  printf("  --T_port [port]    use given port\n");
+  printf("  --T_nowait         don't wait for tracer, start immediately\n");
+  printf("  --T_dont_fork      to ease debugging with gdb\n");
+#endif
+  printf(RESET);
+  fflush(stdout);
 }
 void exit_fun(const char* s)
 {
@@ -469,7 +523,7 @@ void reset_stats(FL_OBJECT *button, long arg)
 
   for (i=0; i<NUMBER_OF_UE_MAX; i++) {
     for (k=0; k<8; k++) { //harq_processes
-      for (j=0; j<phy_vars_eNB->dlsch_eNB[i][0]->Mdlharq; j++) {
+      for (j=0; j<phy_vars_eNB->dlsch_eNB[i][0]->Mlimit; j++) {
         phy_vars_eNB->eNB_UE_stats[i].dlsch_NAK[k][j]=0;
         phy_vars_eNB->eNB_UE_stats[i].dlsch_ACK[k][j]=0;
         phy_vars_eNB->eNB_UE_stats[i].dlsch_trials[k][j]=0;
@@ -479,7 +533,7 @@ void reset_stats(FL_OBJECT *button, long arg)
       phy_vars_eNB->eNB_UE_stats[i].ulsch_errors[k]=0;
       phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors=0;
 
-      for (j=0; j<phy_vars_eNB->ulsch_eNB[i]->Mdlharq; j++) {
+      for (j=0; j<phy_vars_eNB->ulsch_eNB[i]->Mlimit; j++) {
         phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts[k][j]=0;
         phy_vars_eNB->eNB_UE_stats[i].ulsch_decoding_attempts_last[k][j]=0;
         phy_vars_eNB->eNB_UE_stats[i].ulsch_round_errors[k][j]=0;
@@ -502,6 +556,7 @@ static void *scope_thread(void *arg)
   int len = 0;
   struct sched_param sched_param;
   int UE_id, CC_id;
+  int ue_cnt=0;
 
   sched_param.sched_priority = sched_get_priority_min(SCHED_FIFO)+1;
   sched_setscheduler(0, SCHED_FIFO,&sched_param);
@@ -530,12 +585,12 @@ static void *scope_thread(void *arg)
                    0,7);
 
     } else {
-#ifdef OPENAIR2
-      len = dump_eNB_l2_stats (stats_buffer, 0);
-      //fl_set_object_label(form_stats_l2->stats_text, stats_buffer);
-      fl_clear_browser(form_stats_l2->stats_text);
-      fl_add_browser_line(form_stats_l2->stats_text, stats_buffer);
-#endif
+      if (PHY_vars_eNB_g[0][0]->mac_enabled==1) {
+	len = dump_eNB_l2_stats (stats_buffer, 0);
+	//fl_set_object_label(form_stats_l2->stats_text, stats_buffer);
+	fl_clear_browser(form_stats_l2->stats_text);
+	fl_add_browser_line(form_stats_l2->stats_text, stats_buffer);
+      }
       len = dump_eNB_stats (PHY_vars_eNB_g[0][0], stats_buffer, 0);
 
       if (MAX_NUM_CCs>1)
@@ -545,11 +600,15 @@ static void *scope_thread(void *arg)
       fl_clear_browser(form_stats->stats_text);
       fl_add_browser_line(form_stats->stats_text, stats_buffer);
 
-      for(UE_id=0; UE_id<scope_enb_num_ue; UE_id++) {
+      ue_cnt=0;
+      for(UE_id=0; UE_id<NUMBER_OF_UE_MAX; UE_id++) {
 	for(CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
-	  phy_scope_eNB(form_enb[CC_id][UE_id],
-			PHY_vars_eNB_g[0][CC_id],
-			UE_id);
+	  if ((PHY_vars_eNB_g[0][CC_id]->dlsch_eNB[UE_id][0]->rnti>0) && (ue_cnt<scope_enb_num_ue)) {
+	    phy_scope_eNB(form_enb[CC_id][ue_cnt],
+			  PHY_vars_eNB_g[0][CC_id],
+			  UE_id);
+	    ue_cnt++;
+	  }
 	}
       }
 
@@ -885,11 +944,11 @@ void *l2l1_task(void *arg)
 #endif
 
 
-  int dummy_tx_b[7680*4] __attribute__((aligned(16)));
 void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB)
 {
 
   unsigned int aa,slot_offset, slot_offset_F;
+  int dummy_tx_b[7680*4] __attribute__((aligned(32)));
   int i, tx_offset;
   int slot_sizeF = (phy_vars_eNB->lte_frame_parms.ofdm_symbol_size)*
                    ((phy_vars_eNB->lte_frame_parms.Ncp==1) ? 6 : 7);
@@ -909,13 +968,13 @@ void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB)
       if (phy_vars_eNB->lte_frame_parms.Ncp == EXTENDED) {
         PHY_ofdm_mod(&phy_vars_eNB->lte_eNB_common_vars.txdataF[0][aa][slot_offset_F],
                      dummy_tx_b,
-                     phy_vars_eNB->lte_frame_parms.log2_symbol_size,
+                     phy_vars_eNB->lte_frame_parms.ofdm_symbol_size,
                      6,
                      phy_vars_eNB->lte_frame_parms.nb_prefix_samples,
                      CYCLIC_PREFIX);
         PHY_ofdm_mod(&phy_vars_eNB->lte_eNB_common_vars.txdataF[0][aa][slot_offset_F+slot_sizeF],
                      dummy_tx_b+(phy_vars_eNB->lte_frame_parms.samples_per_tti>>1),
-                     phy_vars_eNB->lte_frame_parms.log2_symbol_size,
+                     phy_vars_eNB->lte_frame_parms.ofdm_symbol_size,
                      6,
                      phy_vars_eNB->lte_frame_parms.nb_prefix_samples,
                      CYCLIC_PREFIX);
@@ -958,7 +1017,14 @@ void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB)
       }
 #endif
 
-     for (i=0; i<len; i++) {
+      /*
+      for (i=0;i<len;i+=4) {
+	dummy_tx_b[i] = 0x100;
+	dummy_tx_b[i+1] = 0x01000000;
+	dummy_tx_b[i+2] = 0xff00;
+	dummy_tx_b[i+3] = 0xff000000;
+	}*/
+      for (i=0; i<len; i++) {
         tx_offset = (int)slot_offset+time_offset[aa]+i;
 
         if (tx_offset<0)
@@ -967,22 +1033,9 @@ void do_OFDM_mod_rt(int subframe,PHY_VARS_eNB *phy_vars_eNB)
         if (tx_offset>=(LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*phy_vars_eNB->lte_frame_parms.samples_per_tti))
           tx_offset -= LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*phy_vars_eNB->lte_frame_parms.samples_per_tti;
 
-        ((short*)&phy_vars_eNB->lte_eNB_common_vars.txdata[0][aa][tx_offset])[0]=
-#ifdef EXMIMO
-          ((short*)dummy_tx_b)[2*i]<<4;
-#elif OAI_BLADRF
-	((short*)dummy_tx_b)[2*i];
-#else
-          ((short*)dummy_tx_b)[2*i]<<4;
-#endif
-	  ((short*)&phy_vars_eNB->lte_eNB_common_vars.txdata[0][aa][tx_offset])[1]=
-#ifdef EXMIMO
-	    ((short*)dummy_tx_b)[2*i+1]<<4;
-#elif OAI_BLADRF
-	  ((short*)dummy_tx_b)[2*i+1];
-#else
-	  ((short*)dummy_tx_b)[2*i+1]<<4;
-#endif
+	((short*)&phy_vars_eNB->lte_eNB_common_vars.txdata[0][aa][tx_offset])[0] = ((short*)dummy_tx_b)[2*i]<<openair0_cfg[0].iq_txshift;
+	
+	((short*)&phy_vars_eNB->lte_eNB_common_vars.txdata[0][aa][tx_offset])[1] = ((short*)dummy_tx_b)[2*i+1]<<openair0_cfg[0].iq_txshift;
      }
      // if S-subframe switch to RX in second subframe
      if (subframe_select(&phy_vars_eNB->lte_frame_parms,subframe) == SF_S) {
@@ -1035,8 +1088,9 @@ while(1) pause();
   static int eNB_thread_tx_status[NUM_ENB_THREADS];
 
   eNB_proc_t *proc = (eNB_proc_t*)param;
-  FILE  *tx_time_file;
+  FILE  *tx_time_file = NULL;
   char tx_time_name[101];
+
   if (opp_enabled == 1) {
     snprintf(tx_time_name, 100,"/tmp/%s_tx_time_thread_sf_%d", "eNB", proc->subframe);
     tx_time_file = fopen(tx_time_name,"w");
@@ -1064,16 +1118,12 @@ while(1) pause();
   }
 
 #else
-#ifdef LOWLATENCY
+#ifdef DEADLINE_SCHEDULER
   struct sched_attr attr;
   unsigned int flags = 0;
-  uint64_t runtime  = (uint64_t) (get_runtime_tx(proc->subframe, runtime_phy_tx, target_dl_mcs,frame_parms[0]->N_RB_DL,cpuf,PHY_vars_eNB_g[0][0]->lte_frame_parms.nb_antennas_tx) *  1000000); 
-  uint64_t deadline = 1   *  1000000; // each tx thread will finish within 1ms
+  uint64_t runtime  = 850000 ;  
+  uint64_t deadline = 1   *  1000000 ; // each tx thread will finish within 1ms
   uint64_t period   = 1   * 10000000; // each tx thread has a period of 10ms from the starting point
-  if (runtime > 1000000 ){
-    LOG_W(HW,"estimated runtime %d is larger than 1ms, adjusting\n",runtime);
-    runtime = (0.97 * 100) * 10000; 
-  }
 
   attr.size = sizeof(attr);
   attr.sched_flags = 0;
@@ -1092,7 +1142,74 @@ while(1) pause();
 
   LOG_I( HW, "[SCHED] eNB TX deadline thread %d(TID %ld) started on CPU %d\n", proc->subframe, gettid(), sched_getcpu() );
 #else
-  LOG_I( HW, "[SCHED][eNB] TX thread %d started on CPU %d TID %d\n", proc->subframe, sched_getcpu(),gettid() );
+  int policy, s, j;
+  struct sched_param sparam;
+  char cpu_affinity[1024];
+  cpu_set_t cpuset;
+
+  /* Set affinity mask to include CPUs 1 to MAX_CPUS */
+  /* CPU 0 is reserved for UHD threads */
+  /* CPU 1 is reserved for all TX threads */
+  /* Enable CPU Affinity only if number of CPUs >2 */
+  CPU_ZERO(&cpuset);
+
+  #ifdef CPU_AFFINITY
+  if (get_nprocs() > 2)
+  {
+    for (j = 1; j < get_nprocs(); j++)
+        CPU_SET(j, &cpuset);
+    s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
+    if (s != 0)
+    {
+      perror( "pthread_setaffinity_np");
+      exit_fun("Error setting processor affinity");
+    }
+  }
+  #endif
+
+  /* Check the actual affinity mask assigned to the thread */
+
+  s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
+  if (s != 0)
+  {
+    perror( "pthread_getaffinity_np");
+    exit_fun("Error getting processor affinity ");
+  }
+  memset(cpu_affinity,0,sizeof(cpu_affinity));
+  for (j = 0; j < CPU_SETSIZE; j++)
+     if (CPU_ISSET(j, &cpuset))
+     {  
+        char temp[1024];
+        sprintf (temp, " CPU_%d", j);
+        strcat(cpu_affinity, temp);
+     }
+
+  memset(&sparam, 0 , sizeof (sparam));
+  sparam.sched_priority = sched_get_priority_max(SCHED_FIFO)-1;
+  policy = SCHED_FIFO ; 
+  
+  s = pthread_setschedparam(pthread_self(), policy, &sparam);
+  if (s != 0)
+     {
+     perror("pthread_setschedparam : ");
+     exit_fun("Error setting thread priority");
+     }
+  s = pthread_getschedparam(pthread_self(), &policy, &sparam);
+  if (s != 0)
+   {
+     perror("pthread_getschedparam : ");
+     exit_fun("Error getting thread priority");
+
+   }
+
+ LOG_I( HW, "[SCHED][eNB] TX thread %d started on CPU %d TID %ld, sched_policy = %s , priority = %d, CPU Affinity=%s \n", proc->subframe, sched_getcpu(),gettid(),
+                   (policy == SCHED_FIFO)  ? "SCHED_FIFO" :
+                   (policy == SCHED_RR)    ? "SCHED_RR" :
+                   (policy == SCHED_OTHER) ? "SCHED_OTHER" :
+                   "???",
+                   sparam.sched_priority, cpu_affinity );
+
+
 #endif
 
 #endif
@@ -1178,7 +1295,20 @@ SUBFRAME_TX = proc->subframe;
     }
 
     do_OFDM_mod_rt( proc->subframe_tx, PHY_vars_eNB_g[0][proc->CC_id] );
-
+    /*
+    short *txdata = (short*)&PHY_vars_eNB_g[0][proc->CC_id]->lte_eNB_common_vars.txdata[0][0][proc->subframe_tx*PHY_vars_eNB_g[0][proc->CC_id]->lte_frame_parms.samples_per_tti];
+    int i;
+    for (i=0;i<PHY_vars_eNB_g[0][proc->CC_id]->lte_frame_parms.samples_per_tti*2;i+=8) {
+      txdata[i] = 2047;
+      txdata[i+1] = 0;
+      txdata[i+2] = 0;
+      txdata[i+3] = 2047;
+      txdata[i+4] = -2047;
+      txdata[i+5] = 0;
+      txdata[i+6] = 0;
+      txdata[i+7] = -2047;
+    }
+    */
     if (pthread_mutex_lock(&proc->mutex_tx) != 0) {
       LOG_E( PHY, "[SCHED][eNB] error locking mutex for eNB TX proc %d\n", proc->subframe );
       exit_fun("nothing to add");
@@ -1198,7 +1328,7 @@ SUBFRAME_TX = proc->subframe;
     if (proc->frame_tx==1024)
       proc->frame_tx=0;
     stop_meas( &softmodem_stats_tx_sf[proc->subframe] );
-#ifdef LOWLATENCY
+#ifdef DEADLINE_SCHEDULER
     if (opp_enabled){
       if(softmodem_stats_tx_sf[proc->subframe].diff_now/(cpuf) > attr.sched_runtime){
 	VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RUNTIME_TX_ENB, (softmodem_stats_tx_sf[proc->subframe].diff_now/cpuf - attr.sched_runtime)/1000000.0);
@@ -1243,9 +1373,9 @@ while(1) pause();
 
   eNB_proc_t *proc = (eNB_proc_t*)param;
 
-  FILE  *rx_time_file;
+  FILE  *rx_time_file = NULL;
   char rx_time_name[101];
-  int i;
+  //int i;
 
   if (opp_enabled == 1){
     snprintf(rx_time_name, 100,"/tmp/%s_rx_time_thread_sf_%d", "eNB", proc->subframe);
@@ -1274,18 +1404,13 @@ while(1) pause();
   }
 
 #else
-#ifdef LOWLATENCY
+#ifdef DEADLINE_SCHEDULER
   struct sched_attr attr;
   unsigned int flags = 0;
-  uint64_t runtime  = get_runtime_rx(proc->subframe, runtime_phy_rx, target_ul_mcs,frame_parms[0]->N_RB_DL,cpuf,PHY_vars_eNB_g[0][0]->lte_frame_parms.nb_antennas_rx)  *  1000000; 
+  uint64_t runtime  = 870000 ;
   uint64_t deadline = 1   *  1000000;
   uint64_t period   = 1   * 10000000; // each rx thread has a period of 10ms from the starting point
-  if (runtime  > 2300000 ) {
-    LOG_W(HW,"estimated rx runtime %d is larger than expected, adjusting\n",runtime);
-    runtime   = 2300000;
-    deadline  = runtime + 100000;
-  }
-
+ 
   attr.size = sizeof(attr);
   attr.sched_flags = 0;
   attr.sched_nice = 0;
@@ -1303,7 +1428,79 @@ while(1) pause();
 
   LOG_I( HW, "[SCHED] eNB RX deadline thread %d(TID %ld) started on CPU %d\n", proc->subframe, gettid(), sched_getcpu() );
 #else
-  LOG_I( HW, "[SCHED][eNB] RX thread %d started on CPU %d TID %d\n", proc->subframe, sched_getcpu(),gettid() );
+    int policy, s, j;
+  struct sched_param sparam;
+  char cpu_affinity[1024];
+  cpu_set_t cpuset;
+
+  /* Set affinity mask to include CPUs 1 to MAX_CPUS */
+  /* CPU 0 is reserved for UHD */
+  /* CPU 1 is reserved for all TX threads */
+  /* CPU 2..MAX_CPUS is reserved for all RX threads */
+  /* Set CPU Affinity only if number of CPUs >2 */
+  CPU_ZERO(&cpuset);
+  #ifdef CPU_AFFINITY
+  if (get_nprocs() >2)
+  {
+    for (j = 1; j < get_nprocs(); j++)
+       CPU_SET(j, &cpuset);
+  
+    s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
+    if (s != 0)
+    {
+      perror( "pthread_setaffinity_np");  
+      exit_fun (" Error setting processor affinity :");
+    }
+  }
+  #endif
+  /* Check the actual affinity mask assigned to the thread */
+
+  s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
+  if (s != 0)
+  {
+     perror ("pthread_getaffinity_np");
+     exit_fun (" Error getting processor affinity :");
+  }
+  memset(cpu_affinity,0, sizeof(cpu_affinity));
+
+  for (j = 0; j < CPU_SETSIZE; j++)
+     if (CPU_ISSET(j, &cpuset))
+     {  
+        char temp[1024];
+        sprintf (temp, " CPU_%d", j);
+        strcat(cpu_affinity, temp);
+     }
+
+
+  memset(&sparam, 0 , sizeof (sparam)); 
+  sparam.sched_priority = sched_get_priority_max(SCHED_FIFO)-1;
+
+  policy = SCHED_FIFO ; 
+  s = pthread_setschedparam(pthread_self(), policy, &sparam);
+  if (s != 0)
+     {
+     perror("pthread_setschedparam : ");
+     exit_fun("Error setting thread priority");
+     }
+
+  memset(&sparam, 0 , sizeof (sparam));
+
+  s = pthread_getschedparam(pthread_self(), &policy, &sparam);
+  if (s != 0)
+   {
+     perror("pthread_getschedparam");
+     exit_fun("Error getting thread priority");
+   }
+
+
+LOG_I( HW, "[SCHED][eNB] RX thread %d started on CPU %d TID %ld, sched_policy = %s, priority = %d, CPU Affinity = %s\n", proc->subframe, sched_getcpu(),gettid(),
+       (policy == SCHED_FIFO)  ? "SCHED_FIFO" :
+       (policy == SCHED_RR)    ? "SCHED_RR" :
+       (policy == SCHED_OTHER) ? "SCHED_OTHER" :
+        "???",
+        sparam.sched_priority, cpu_affinity);
+
+
 #endif
 #endif // RTAI
 
@@ -1373,7 +1570,7 @@ SUBFRAME_RX = proc->subframe;
       proc->frame_rx=0;
 
     stop_meas( &softmodem_stats_rx_sf[proc->subframe] );
-#ifdef LOWLATENCY
+#ifdef DEADLINE_SCHEDULER
     if (opp_enabled){
       if(softmodem_stats_rx_sf[proc->subframe].diff_now/(cpuf) > attr.sched_runtime){
 	VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RUNTIME_RX_ENB, (softmodem_stats_rx_sf[proc->subframe].diff_now/cpuf - attr.sched_runtime)/1000000.0);
@@ -1415,7 +1612,7 @@ void init_eNB_proc(void)
       // set the stack size
      
 
-#ifndef LOWLATENCY 
+#ifndef DEADLINE_SCHEDULER 
       /*  
        pthread_attr_init( &attr_eNB_proc_tx[CC_id][i] );
        if (pthread_attr_setstacksize( &attr_eNB_proc_tx[CC_id][i], 64 *PTHREAD_STACK_MIN ) != 0)
@@ -1442,7 +1639,7 @@ void init_eNB_proc(void)
       pthread_mutex_init( &PHY_vars_eNB_g[0][CC_id]->proc[i].mutex_rx, NULL);
       pthread_cond_init( &PHY_vars_eNB_g[0][CC_id]->proc[i].cond_tx, NULL);
       pthread_cond_init( &PHY_vars_eNB_g[0][CC_id]->proc[i].cond_rx, NULL);
-#ifndef LOWLATENCY
+#ifndef DEADLINE_SCHEDULER
       pthread_create( &PHY_vars_eNB_g[0][CC_id]->proc[i].pthread_tx, &attr_eNB_proc_tx[CC_id][i], eNB_thread_tx, &PHY_vars_eNB_g[0][CC_id]->proc[i] );
       pthread_create( &PHY_vars_eNB_g[0][CC_id]->proc[i].pthread_rx, &attr_eNB_proc_rx[CC_id][i], eNB_thread_rx, &PHY_vars_eNB_g[0][CC_id]->proc[i] );
 #else 
@@ -1622,10 +1819,15 @@ static void* eNB_thread( void* arg )
   int CC_id=0;	
   struct timespec trx_time0, trx_time1, trx_time2;
 
+  /* avoid gcc warnings */
+  (void)trx_time0;
+  (void)trx_time1;
+  (void)trx_time2;
+
 #ifdef RTAI
   RT_TASK* task = rt_task_init_schmod(nam2num("eNBmain"), 0, 0, 0, SCHED_FIFO, 0xF);
 #else
-#ifdef LOWLATENCY
+#ifdef DEADLINE_SCHEDULER
   struct sched_attr attr;
   unsigned int flags = 0;
 
@@ -1641,11 +1843,6 @@ static void* eNB_thread( void* arg )
   attr.sched_deadline = (0.9 * 100) * 10000;
   attr.sched_period   = 1 * 1000000;
 
-  /* pin the eNB main thread to CPU0*/
-  /* if (pthread_setaffinity_np(pthread_self(), sizeof(mask),&mask) <0) {
-     perror("[MAIN_ENB_THREAD] pthread_setaffinity_np failed\n");
-     }*/
-
   if (sched_setattr(0, &attr, flags) < 0 ) {
     perror("[SCHED] main eNB thread: sched_setattr failed\n");
     exit_fun("Nothing to add");
@@ -1667,6 +1864,75 @@ CPU_ZERO(&cpuset);
 CPU_SET(3, &cpuset);
 if (pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset)) abort();
 
+#else //DEADLINE_SCHEDULER
+
+  int policy, s, j;
+  struct sched_param sparam;
+  char cpu_affinity[1024];
+  cpu_set_t cpuset;
+
+  /* Set affinity mask to include CPUs 1 to MAX_CPUS */
+  /* CPU 0 is reserved for UHD threads */
+  CPU_ZERO(&cpuset);
+  #ifdef CPU_AFFINITY
+  if (get_nprocs() >2)
+  {
+    for (j = 1; j < get_nprocs(); j++)
+      CPU_SET(j, &cpuset);
+
+    s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
+    if (s != 0)
+    {
+      perror( "pthread_setaffinity_np");
+      exit_fun("Error setting processor affinity");
+    }
+  }
+  #endif
+
+  /* Check the actual affinity mask assigned to the thread */
+
+  s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
+  if (s != 0)
+  {
+    perror( "pthread_getaffinity_np");
+    exit_fun("Error getting processor affinity ");
+  }
+  memset(cpu_affinity, 0 , sizeof(cpu_affinity));
+  for (j = 0; j < CPU_SETSIZE; j++)
+  if (CPU_ISSET(j, &cpuset))
+  {  
+     char temp[1024];
+     sprintf(temp, " CPU_%d ", j);    
+     strcat(cpu_affinity, temp);
+  }
+
+  memset(&sparam, 0 , sizeof (sparam));
+  sparam.sched_priority = sched_get_priority_max(SCHED_FIFO);
+  policy = SCHED_FIFO ; 
+  
+  s = pthread_setschedparam(pthread_self(), policy, &sparam);
+  if (s != 0)
+     {
+     perror("pthread_setschedparam : ");
+     exit_fun("Error setting thread priority");
+     }
+  s = pthread_getschedparam(pthread_self(), &policy, &sparam);
+  if (s != 0)
+   {
+     perror("pthread_getschedparam : ");
+     exit_fun("Error getting thread priority");
+
+   }
+
+
+  LOG_I( HW, "[SCHED][eNB] Started eNB main thread on CPU %d TID %ld , sched_policy = %s, priority = %d, CPU Affinity = %s \n", (int)sched_getcpu(), gettid(),
+                   (policy == SCHED_FIFO)  ? "SCHED_FIFO" :
+                   (policy == SCHED_RR)    ? "SCHED_RR" :
+                   (policy == SCHED_OTHER) ? "SCHED_OTHER" :
+                   "???",
+                   (int) sparam.sched_priority, cpu_affinity);
+
+
 #endif
 #endif
 
@@ -1676,9 +1942,7 @@ if (pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset)) abort();
     goto eNB_thread_cleanup;
 
 #ifdef RTAI
-  printf( "[SCHED][eNB] Started eNB main thread (id %p)\n", task );
-#else
-  printf( "[SCHED][eNB] Started eNB main thread on CPU %d TID %d\n", sched_getcpu(), gettid());
+  LOG_I( HW, "[SCHED][eNB] Started eNB main thread (id %p)\n", task );
 #endif
 
 #ifdef HARD_RT
@@ -1702,6 +1966,8 @@ if (pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset)) abort();
 
   pthread_mutex_unlock(&sync_mutex);
 
+  printf( "got sync (eNB_thread)\n" );
+
   int frame = 0;
 
 #ifndef EXMIMO
@@ -1709,6 +1975,10 @@ if (pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset)) abort();
   tx_pos     = openair0_cfg[0].tx_scheduling_advance;
 #endif
 
+#if defined(ENABLE_ITTI)
+  wait_system_ready ("Waiting for eNB application to be ready %s\r", &start_eNB);
+#endif 
+
   while (!oai_exit) {
     start_meas( &softmodem_stats_mt );
 
@@ -1851,7 +2121,9 @@ if (pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset)) abort();
 				     PHY_vars_eNB_g[0][0]->lte_frame_parms.nb_antennas_rx);
       
       stop_meas( &softmodem_stats_hw );
-      clock_gettime( CLOCK_MONOTONIC, &trx_time1 );
+      if (frame > 50) { 
+	  clock_gettime( CLOCK_MONOTONIC, &trx_time1 );
+      }
 
       if (frame > 20){ 
 	if (rxs != spp)
@@ -1860,8 +2132,6 @@ if (pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset)) abort();
       VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 );
 
       // Transmit TX buffer based on timestamp from RX
-
-
     
       VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 );
       // prepare tx buffer pointers
@@ -1881,16 +2151,28 @@ if (pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset)) abort();
       VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (timestamp+(openair0_cfg[card].tx_scheduling_advance)-openair0_cfg[card].tx_sample_advance)&0xffffffff );
 
       stop_meas( &softmodem_stats_mt );
-      clock_gettime( CLOCK_MONOTONIC, &trx_time2 );
+      if (frame > 50) { 
+	  clock_gettime( CLOCK_MONOTONIC, &trx_time2 );
+	  //update_difftimes(trx_time1, trx_time2);
+      }
+
 
       VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE,0);
 #else
       // USRP_DEBUG is active
       rt_sleep_ns(1000000);
 #endif
-
-      if ((tx_launched == 0) &&
-          (rx_pos >= (((2*hw_subframe)+1)*PHY_vars_eNB_g[0][0]->lte_frame_parms.samples_per_tti>>1))) {
+      /* FT configurable tx lauch delay (in slots): txlaunch_wait, txlaunch_wait_slotcount is device specific and 
+	 set in the corresponding library (with txlaunch_wait=1 and txlaunch_wait_slotcount=1 the check is as it previously was) */
+      /* old check:
+	 if ((frame>50) &&
+	 (tx_launched == 0) &&
+	 (rx_pos >= (((2*hw_subframe)+1)*PHY_vars_eNB_g[0][0]->lte_frame_parms.samples_per_tti>>1))) {*/
+      if ( (frame>50) && (tx_launched == 0) &&
+	   ((openair0_cfg[card].txlaunch_wait == 0) ||
+	    ((openair0_cfg[card].txlaunch_wait == 1) &&
+	     (rx_pos >= (((2*hw_subframe)+openair0_cfg[card].txlaunch_wait_slotcount)*PHY_vars_eNB_g[0][0]->lte_frame_parms.samples_per_tti>>1))))) { 
+	
         tx_launched = 1;
 
         for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
@@ -1959,52 +2241,56 @@ if (pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset)) abort();
       int sf = hw_subframe;
 #endif
 
+      /* TODO: is it the right place for master tick? */
+      T(T_ENB_MASTER_TICK, T_INT(0), T_INT(frame % 1024), T_INT(sf));
 #if 0
-      for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
+      if (frame>50) {
+	for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
 #ifdef EXMIMO
-
-        if (pthread_mutex_lock(&PHY_vars_eNB_g[0][CC_id]->proc[sf].mutex_tx) != 0) {
-          LOG_E(PHY,"[eNB] ERROR pthread_mutex_lock for eNB TX thread %d (IC %d)\n",sf,PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt_tx);
-        } else {
-          //          LOG_I(PHY,"[eNB] Waking up eNB process %d (IC %d)\n",sf,PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt);
-          PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt_tx++;
-          pthread_mutex_unlock(&PHY_vars_eNB_g[0][CC_id]->proc[sf].mutex_tx);
-
-          if (PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt_tx == 0) {
-            if (pthread_cond_signal(&PHY_vars_eNB_g[0][CC_id]->proc[sf].cond_tx) != 0) {
-              LOG_E(PHY,"[eNB] ERROR pthread_cond_signal for eNB TX thread %d\n",sf);
+	  
+	  if (pthread_mutex_lock(&PHY_vars_eNB_g[0][CC_id]->proc[sf].mutex_tx) != 0) {
+	    LOG_E(PHY,"[eNB] ERROR pthread_mutex_lock for eNB TX thread %d (IC %d)\n",sf,PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt_tx);
+	  } else {
+	    //          LOG_I(PHY,"[eNB] Waking up eNB process %d (IC %d)\n",sf,PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt);
+	    PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt_tx++;
+	    pthread_mutex_unlock(&PHY_vars_eNB_g[0][CC_id]->proc[sf].mutex_tx);
+	    
+	    if (PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt_tx == 0) {
+	      if (pthread_cond_signal(&PHY_vars_eNB_g[0][CC_id]->proc[sf].cond_tx) != 0) {
+		LOG_E(PHY,"[eNB] ERROR pthread_cond_signal for eNB TX thread %d\n",sf);
+		exit_fun("nothing to add");
+	      }
+	    } else {
+	      LOG_W(PHY,"[eNB] Frame %d, eNB TX thread %d busy!!\n",PHY_vars_eNB_g[0][CC_id]->proc[sf].frame_tx,sf);
 	      exit_fun("nothing to add");
-            }
-          } else {
-            LOG_W(PHY,"[eNB] Frame %d, eNB TX thread %d busy!!\n",PHY_vars_eNB_g[0][CC_id]->proc[sf].frame_tx,sf);
-            exit_fun("nothing to add");
-          }
-        }
-
+	    }
+	  }
+	  
 #endif
 
-        if (pthread_mutex_lock(&PHY_vars_eNB_g[0][CC_id]->proc[sf].mutex_rx) != 0) {
-          LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB RX thread %d (IC %d)\n", sf, PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt_rx );
-          exit_fun( "error locking mutex_rx" );
-          break;
-        }
-
-        int cnt_rx = ++PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt_rx;
-
-        pthread_mutex_unlock( &PHY_vars_eNB_g[0][CC_id]->proc[sf].mutex_rx );
-
-        if (cnt_rx == 0) {
-          // the thread was presumably waiting where it should and can now be woken up
-          if (pthread_cond_signal(&PHY_vars_eNB_g[0][CC_id]->proc[sf].cond_rx) != 0) {
-            LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB RX thread %d\n", sf );
-            exit_fun( "ERROR pthread_cond_signal" );
-            break;
-          }
-        } else {
-          LOG_W( PHY, "[eNB] Frame %d, eNB RX thread %d busy!! instance_cnt %d CC_id %d\n", PHY_vars_eNB_g[0][CC_id]->proc[sf].frame_rx, sf, PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt_rx, CC_id );
-          exit_fun( "RX thread busy" );
-          break;
-        }
+	  if (pthread_mutex_lock(&PHY_vars_eNB_g[0][CC_id]->proc[sf].mutex_rx) != 0) {
+	    LOG_E( PHY, "[eNB] ERROR pthread_mutex_lock for eNB RX thread %d (IC %d)\n", sf, PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt_rx );
+	    exit_fun( "error locking mutex_rx" );
+	    break;
+	  }
+	  
+	  int cnt_rx = ++PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt_rx;
+	  
+	  pthread_mutex_unlock( &PHY_vars_eNB_g[0][CC_id]->proc[sf].mutex_rx );
+	  
+	  if (cnt_rx == 0) {
+	    // the thread was presumably waiting where it should and can now be woken up
+	    if (pthread_cond_signal(&PHY_vars_eNB_g[0][CC_id]->proc[sf].cond_rx) != 0) {
+	      LOG_E( PHY, "[eNB] ERROR pthread_cond_signal for eNB RX thread %d\n", sf );
+	      exit_fun( "ERROR pthread_cond_signal" );
+	      break;
+	    }
+	  } else {
+	    LOG_W( PHY, "[eNB] Frame %d, eNB RX thread %d busy!! instance_cnt %d CC_id %d\n", PHY_vars_eNB_g[0][CC_id]->proc[sf].frame_rx, sf, PHY_vars_eNB_g[0][CC_id]->proc[sf].instance_cnt_rx, CC_id );
+	    exit_fun( "RX thread busy" );
+	    break;
+	  }
+	}
       }
 #endif
 
@@ -2084,6 +2370,9 @@ eNB_thread_cleanup:
 #endif
 
   eNB_thread_status = 0;
+
+  // print_difftimes();
+
   return &eNB_thread_status;
 }
 
@@ -2113,6 +2402,7 @@ static void get_options (int argc, char **argv)
 
   enum long_option_e {
     LONG_OPTION_START = 0x100, /* Start after regular single char options */
+    LONG_OPTION_RF_CONFIG_FILE,
     LONG_OPTION_ULSCH_MAX_CONSECUTIVE_ERRORS,
     LONG_OPTION_CALIB_UE_RX,
     LONG_OPTION_CALIB_UE_RX_MED,
@@ -2125,10 +2415,18 @@ static void get_options (int argc, char **argv)
     LONG_OPTION_SCANCARRIER,
     LONG_OPTION_MAXPOWER,
     LONG_OPTION_DUMP_FRAME,
-    LONG_OPTION_LOOPMEMORY
+    LONG_OPTION_LOOPMEMORY,
+    LONG_OPTION_PHYTEST,
+
+#if T_TRACER
+    LONG_OPTION_T_PORT,
+    LONG_OPTION_T_NOWAIT,
+    LONG_OPTION_T_DONT_FORK,
+#endif
   };
 
   static const struct option long_options[] = {
+    {"rf-config-file",required_argument,  NULL, LONG_OPTION_RF_CONFIG_FILE},
     {"ulsch-max-errors",required_argument,  NULL, LONG_OPTION_ULSCH_MAX_CONSECUTIVE_ERRORS},
     {"calib-ue-rx",     required_argument,  NULL, LONG_OPTION_CALIB_UE_RX},
     {"calib-ue-rx-med", required_argument,  NULL, LONG_OPTION_CALIB_UE_RX_MED},
@@ -2142,16 +2440,35 @@ static void get_options (int argc, char **argv)
     {"ue-max-power",   required_argument,  NULL, LONG_OPTION_MAXPOWER},
     {"ue-dump-frame", no_argument, NULL, LONG_OPTION_DUMP_FRAME},
     {"loop-memory", required_argument, NULL, LONG_OPTION_LOOPMEMORY},
+    {"phy-test", no_argument, NULL, LONG_OPTION_PHYTEST},
+
+#if T_TRACER
+    {"T_port",                 required_argument, 0, LONG_OPTION_T_PORT},
+    {"T_nowait",               no_argument,       0, LONG_OPTION_T_NOWAIT},
+    {"T_dont_fork",            no_argument,       0, LONG_OPTION_T_DONT_FORK},
+#endif
+
     {NULL, 0, NULL, 0}
   };
 
-  while ((c = getopt_long (argc, argv, "a:C:dK:g:F:G:hqO:m:SUVRM:r:P:Ws:t:Tx:",long_options,NULL)) != -1) {
+  while ((c = getopt_long (argc, argv, "A:a:C:dEK:g:F:G:hqO:m:SUVRM:r:P:Ws:t:Tx:",long_options,NULL)) != -1) {
     switch (c) {
+    case LONG_OPTION_RF_CONFIG_FILE:
+      if ((strcmp("null", optarg) == 0) || (strcmp("NULL", optarg) == 0)) {
+	printf("no configuration filename is provided\n");
+      }
+      else if (strlen(optarg)<=1024){
+	strcpy(rf_config_file,optarg);
+      }else {
+         printf("Configuration filename is too long\n");
+         exit(-1);   
+      }
+      break;
     case LONG_OPTION_MAXPOWER:
       tx_max_power[0]=atoi(optarg);
       for (CC_id=1;CC_id<MAX_NUM_CCs;CC_id++)
 	tx_max_power[CC_id]=tx_max_power[0];
-
+      break;
     case LONG_OPTION_ULSCH_MAX_CONSECUTIVE_ERRORS:
       ULSCH_max_consecutive_errors = atoi(optarg);
       printf("Set ULSCH_max_consecutive_errors = %d\n",ULSCH_max_consecutive_errors);
@@ -2210,14 +2527,37 @@ static void get_options (int argc, char **argv)
       AssertFatal(input_fd != NULL,"Please provide an input file\n");
       break;
 
-   case LONG_OPTION_DUMP_FRAME:
-     mode = rx_dump_frame;
-     break;
+    case LONG_OPTION_DUMP_FRAME:
+      mode = rx_dump_frame;
+      break;
+      
+    case LONG_OPTION_PHYTEST:
+      phy_test = 1;
+      break;
+      
+#if T_TRACER
+    case LONG_OPTION_T_PORT: {
+      extern int T_port;
+      if (optarg == NULL) abort();  /* should not happen */
+      T_port = atoi(optarg);
+      break;
+    }
+
+    case LONG_OPTION_T_NOWAIT: {
+      extern int T_wait;
+      T_wait = 0;
+      break;
+    }
 
-    case 'M':
-#ifdef ETHERNET
-      strcpy(rrh_eNB_ip,optarg);
+    case LONG_OPTION_T_DONT_FORK: {
+      extern int T_dont_fork;
+      T_dont_fork = 1;
+      break;
+    }
 #endif
+
+    case 'A':
+      timing_advance = atoi (optarg);
       break;
 
     case 'C':
@@ -2243,6 +2583,10 @@ static void get_options (int argc, char **argv)
       printf("Running with XFORMS!\n");
 #endif
       break;
+      
+    case 'E':
+      threequarter_fs=1;
+      break;
 
     case 'K':
 #if defined(ENABLE_ITTI)
@@ -2267,7 +2611,6 @@ static void get_options (int argc, char **argv)
     case 't':
       target_ul_mcs = atoi (optarg);
       break;
-#ifdef OPENAIR2
 
     case 'W':
       opt_enabled=1;
@@ -2302,7 +2645,6 @@ static void get_options (int argc, char **argv)
       }
 
       break;
-#endif
 
     case 'V':
       ouput_vcd = 1;
@@ -2410,8 +2752,8 @@ static void get_options (int argc, char **argv)
     case 'x':
       transmission_mode = atoi(optarg);
 
-      if (transmission_mode > 2) {
-        printf("Transmission mode > 2 (%d) not supported for the moment\n",transmission_mode);
+      if (transmission_mode > 7) {
+        printf("Transmission mode %d not supported for the moment\n",transmission_mode);
         exit(-1);
       }
       break;
@@ -2454,6 +2796,41 @@ static void get_options (int argc, char **argv)
                    "lte-softmodem compiled with MAX_NUM_CCs=%d, but only %d CCs configured for eNB %d!",
                    MAX_NUM_CCs, enb_properties->properties[i]->nb_cc, i);
 
+      for (j=0; j<enb_properties->properties[i]->nb_rrh_gw; j++) {
+	
+	if (enb_properties->properties[i]->rrh_gw_config[j].active == 1 ) {
+	  local_remote_radio = BBU_REMOTE_RADIO_HEAD;
+	  eth_params = (eth_params_t*)malloc(sizeof(eth_params_t));
+	  memset(eth_params, 0, sizeof(eth_params_t));
+	  
+	  eth_params->local_if_name             = enb_properties->properties[i]->rrh_gw_if_name;
+	  eth_params->my_addr                   = enb_properties->properties[i]->rrh_gw_config[j].local_address;
+	  eth_params->my_port                   = enb_properties->properties[i]->rrh_gw_config[j].local_port;
+	  eth_params->remote_addr               = enb_properties->properties[i]->rrh_gw_config[j].remote_address;
+	  eth_params->remote_port               = enb_properties->properties[i]->rrh_gw_config[j].remote_port;
+	  eth_params->transp_preference         = enb_properties->properties[i]->rrh_gw_config[j].raw;	 
+	  eth_params->iq_txshift                = enb_properties->properties[i]->rrh_gw_config[j].iq_txshift;
+	  eth_params->tx_sample_advance         = enb_properties->properties[i]->rrh_gw_config[j].tx_sample_advance;
+	  eth_params->tx_scheduling_advance     = enb_properties->properties[i]->rrh_gw_config[j].tx_scheduling_advance;
+	  if (enb_properties->properties[i]->rrh_gw_config[j].exmimo == 1) {
+	     eth_params->rf_preference          = EXMIMO_DEV;
+	  } else if (enb_properties->properties[i]->rrh_gw_config[j].usrp_b200 == 1) {
+	    eth_params->rf_preference          = USRP_B200_DEV;
+	  } else if (enb_properties->properties[i]->rrh_gw_config[j].usrp_x300 == 1) {
+	   eth_params->rf_preference          = USRP_X300_DEV;
+	  } else if (enb_properties->properties[i]->rrh_gw_config[j].bladerf == 1) {
+	    eth_params->rf_preference          = BLADERF_DEV;
+	  } else if (enb_properties->properties[i]->rrh_gw_config[j].lmssdr == 1) {
+	    //eth_params->rf_preference          = LMSSDR_DEV;
+	  } else {
+	    eth_params->rf_preference          = 0;
+	  } 
+	} else {
+	  local_remote_radio = BBU_LOCAL_RADIO_HEAD; 
+	}
+	
+      }
+
       for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
         frame_parms[CC_id]->frame_type =       enb_properties->properties[i]->frame_type[CC_id];
         frame_parms[CC_id]->tdd_config =       enb_properties->properties[i]->tdd_config[CC_id];
@@ -2479,8 +2856,6 @@ fprintf(stderr, "CC %d ID %d\n", CC_id, frame_parms[CC_id]->Nid_cell);
       }
 
 
-#ifdef OPENAIR2
-
       init_all_otg(0);
       g_otg->seed = 0;
       init_seeds(g_otg->seed);
@@ -2498,7 +2873,6 @@ fprintf(stderr, "CC %d ID %d\n", CC_id, frame_parms[CC_id]->Nid_cell);
 
       init_predef_traffic(enb_properties->properties[i]->num_otg_elements, 1);
 
-#endif
 
       glog_level                     = enb_properties->properties[i]->glog_level;
       glog_verbosity                 = enb_properties->properties[i]->glog_verbosity;
@@ -2550,6 +2924,12 @@ fprintf(stderr, "CC %d ID %d\n", CC_id, frame_parms[CC_id]->Nid_cell);
   }
 }
 
+#if T_TRACER
+int T_wait = 1;       /* by default we wait for the tracer */
+int T_port = 2021;    /* default port to listen to to wait for the tracer */
+int T_dont_fork = 0;  /* default is to fork, see 'T_init' to understand */
+#endif
+
 int main( int argc, char **argv )
 {
   int i,aa,card=0;
@@ -2560,9 +2940,7 @@ int main( int argc, char **argv )
   int CC_id;
   uint16_t Nid_cell = 0;
   uint8_t  cooperation_flag=0,  abstraction_flag=0;
-#ifndef OPENAIR2
   uint8_t beta_ACK=0,beta_RI=0,beta_CQI=2;
-#endif
 
 #ifdef ENABLE_TCXO
   unsigned int tcxo = 114;
@@ -2614,9 +2992,17 @@ int main( int argc, char **argv )
   }
   logInit();
  
+  rf_config_file[0]='\0';
   get_options (argc, argv); //Command-line options
- 
+  if (rf_config_file[0] == '\0')
+    openair0_cfg[0].configFilename = NULL;
+  else
+    openair0_cfg[0].configFilename = rf_config_file;
   
+#if T_TRACER
+  T_init(T_port, T_wait, T_dont_fork);
+#endif
+
   // initialize the log (see log.h for details)
   set_glog(glog_level, glog_verbosity);
 
@@ -2626,8 +3012,8 @@ int main( int argc, char **argv )
   if (UE_flag==1) {
     printf("configuring for UE\n");
 
-    set_comp_log(HW,      LOG_INFO,  LOG_HIGH, 1);
-    set_comp_log(PHY,     LOG_INFO,   LOG_HIGH, 1);
+    set_comp_log(HW,      LOG_DEBUG,  LOG_HIGH, 1);
+    set_comp_log(PHY,     LOG_DEBUG,   LOG_HIGH, 1);
     set_comp_log(MAC,     LOG_INFO,   LOG_HIGH, 1);
     set_comp_log(RLC,     LOG_INFO,   LOG_HIGH, 1);
     set_comp_log(PDCP,    LOG_INFO,   LOG_HIGH, 1);
@@ -2643,15 +3029,9 @@ int main( int argc, char **argv )
     printf("configuring for eNB\n");
 
     set_comp_log(HW,      hw_log_level, hw_log_verbosity, 1);
-#ifdef OPENAIR2
     set_comp_log(PHY,     phy_log_level,   phy_log_verbosity, 1);
-
     if (opt_enabled == 1 )
       set_comp_log(OPT,   opt_log_level,      opt_log_verbosity, 1);
-
-#else
-    set_comp_log(PHY,     LOG_INFO,   LOG_HIGH, 1);
-#endif
     set_comp_log(MAC,     mac_log_level,  mac_log_verbosity, 1);
     set_comp_log(RLC,     rlc_log_level,   rlc_log_verbosity, 1);
     set_comp_log(PDCP,    pdcp_log_level,  pdcp_log_verbosity, 1);
@@ -2707,8 +3087,6 @@ int main( int argc, char **argv )
   MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX);
 #endif
  
-#ifdef OPENAIR2
-
   if (opt_type != OPT_NONE) {
     radio_type_t radio_type;
 
@@ -2721,7 +3099,6 @@ int main( int argc, char **argv )
       LOG_E(OPT,"failed to run OPT \n");
   }
 
-#endif
 #ifdef PDCP_USE_NETLINK
   netlink_init();
 #if defined(PDCP_USE_NETLINK_QUEUES)
@@ -2760,6 +3137,7 @@ int main( int argc, char **argv )
     frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = 0;
     frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = 0;
     frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = 0;
+    frame_parms[CC_id]->threequarter_fs = threequarter_fs;
     init_ul_hopping(frame_parms[CC_id]);
     init_frame_parms(frame_parms[CC_id],1);
     //   phy_init_top(frame_parms[CC_id]);
@@ -2790,21 +3168,24 @@ int main( int argc, char **argv )
       PHY_vars_UE_g[0][CC_id] = init_lte_UE(frame_parms[CC_id], 0,abstraction_flag,transmission_mode);
       UE[CC_id] = PHY_vars_UE_g[0][CC_id];
       printf("PHY_vars_UE_g[0][%d] = %p\n",CC_id,UE[CC_id]);
-#ifndef OPENAIR2
 
-      for (i=0; i<NUMBER_OF_CONNECTED_eNB_MAX; i++) {
-        UE[CC_id]->pusch_config_dedicated[i].betaOffset_ACK_Index = beta_ACK;
-        UE[CC_id]->pusch_config_dedicated[i].betaOffset_RI_Index  = beta_RI;
-        UE[CC_id]->pusch_config_dedicated[i].betaOffset_CQI_Index = beta_CQI;
+      if (phy_test==1)
+	UE[CC_id]->mac_enabled = 0;
+      else 
+	UE[CC_id]->mac_enabled = 1;
 
-        UE[CC_id]->scheduling_request_config[i].sr_PUCCH_ResourceIndex = 0;
-        UE[CC_id]->scheduling_request_config[i].sr_ConfigIndex = 7+(0%3);
-        UE[CC_id]->scheduling_request_config[i].dsr_TransMax = sr_n4;
+      if (UE[CC_id]->mac_enabled == 0) {
+	for (i=0; i<NUMBER_OF_CONNECTED_eNB_MAX; i++) {
+	  UE[CC_id]->pusch_config_dedicated[i].betaOffset_ACK_Index = beta_ACK;
+	  UE[CC_id]->pusch_config_dedicated[i].betaOffset_RI_Index  = beta_RI;
+	  UE[CC_id]->pusch_config_dedicated[i].betaOffset_CQI_Index = beta_CQI;
+	  
+	  UE[CC_id]->scheduling_request_config[i].sr_PUCCH_ResourceIndex = 0;
+	  UE[CC_id]->scheduling_request_config[i].sr_ConfigIndex = 7+(0%3);
+	  UE[CC_id]->scheduling_request_config[i].dsr_TransMax = sr_n4;
+	}
       }
 
-#endif
-
-
       UE[CC_id]->UE_scan = UE_scan;
       UE[CC_id]->UE_scan_carrier = UE_scan_carrier;
       UE[CC_id]->mode    = mode;
@@ -2813,13 +3194,12 @@ int main( int argc, char **argv )
                         UE[CC_id]->lte_frame_parms.frame_type,
                         UE[CC_id]->X_u);
 
-      UE[CC_id]->lte_ue_pdcch_vars[0]->crnti = 0x1234;
-#ifndef OPENAIR2
-      UE[CC_id]->lte_ue_pdcch_vars[0]->crnti = 0x1235;
-#endif
+      if (UE[CC_id]->mac_enabled == 1) 
+	UE[CC_id]->lte_ue_pdcch_vars[0]->crnti = 0x1234;
+      else
+	UE[CC_id]->lte_ue_pdcch_vars[0]->crnti = 0x1235;
 
 #ifdef EXMIMO
-
       for (i=0; i<4; i++) {
         UE[CC_id]->rx_gain_max[i] = rxg_max[i];
         UE[CC_id]->rx_gain_med[i] = rxg_med[i];
@@ -2853,9 +3233,7 @@ int main( int argc, char **argv )
       UE[CC_id]->tx_power_max_dBm = tx_max_power[CC_id];
 
 
-
 #ifdef EXMIMO
-
       //N_TA_offset
       if (UE[CC_id]->lte_frame_parms.frame_type == TDD) {
         if (UE[CC_id]->lte_frame_parms.N_RB_DL == 100)
@@ -2867,7 +3245,6 @@ int main( int argc, char **argv )
       } else {
         UE[CC_id]->N_TA_offset = 0;
       }
-
 #else
       //already taken care of in lte-softmodem
       UE[CC_id]->N_TA_offset = 0;
@@ -2891,20 +3268,23 @@ int main( int argc, char **argv )
       PHY_vars_eNB_g[0][CC_id] = init_lte_eNB(frame_parms[CC_id],0,frame_parms[CC_id]->Nid_cell,cooperation_flag,transmission_mode,abstraction_flag);
       PHY_vars_eNB_g[0][CC_id]->CC_id = CC_id;
 
-#ifndef OPENAIR2
+      if (phy_test==1)
+	PHY_vars_eNB_g[0][CC_id]->mac_enabled = 0;
+      else 
+	PHY_vars_eNB_g[0][CC_id]->mac_enabled = 1;
 
-      for (i=0; i<NUMBER_OF_UE_MAX; i++) {
-        PHY_vars_eNB_g[0][CC_id]->pusch_config_dedicated[i].betaOffset_ACK_Index = beta_ACK;
-        PHY_vars_eNB_g[0][CC_id]->pusch_config_dedicated[i].betaOffset_RI_Index  = beta_RI;
-        PHY_vars_eNB_g[0][CC_id]->pusch_config_dedicated[i].betaOffset_CQI_Index = beta_CQI;
-
-        PHY_vars_eNB_g[0][CC_id]->scheduling_request_config[i].sr_PUCCH_ResourceIndex = i;
-        PHY_vars_eNB_g[0][CC_id]->scheduling_request_config[i].sr_ConfigIndex = 7+(i%3);
-        PHY_vars_eNB_g[0][CC_id]->scheduling_request_config[i].dsr_TransMax = sr_n4;
+      if (PHY_vars_eNB_g[0][CC_id]->mac_enabled == 0) {
+	for (i=0; i<NUMBER_OF_UE_MAX; i++) {
+	  PHY_vars_eNB_g[0][CC_id]->pusch_config_dedicated[i].betaOffset_ACK_Index = beta_ACK;
+	  PHY_vars_eNB_g[0][CC_id]->pusch_config_dedicated[i].betaOffset_RI_Index  = beta_RI;
+	  PHY_vars_eNB_g[0][CC_id]->pusch_config_dedicated[i].betaOffset_CQI_Index = beta_CQI;
+	  
+	  PHY_vars_eNB_g[0][CC_id]->scheduling_request_config[i].sr_PUCCH_ResourceIndex = i;
+	  PHY_vars_eNB_g[0][CC_id]->scheduling_request_config[i].sr_ConfigIndex = 7+(i%3);
+	  PHY_vars_eNB_g[0][CC_id]->scheduling_request_config[i].dsr_TransMax = sr_n4;
+	}
       }
 
-#endif
-
       compute_prach_seq(&PHY_vars_eNB_g[0][CC_id]->lte_frame_parms.prach_config_common,
                         PHY_vars_eNB_g[0][CC_id]->lte_frame_parms.frame_type,
                         PHY_vars_eNB_g[0][CC_id]->X_u);
@@ -2965,10 +3345,18 @@ int main( int argc, char **argv )
   for (card=0; card<MAX_CARDS; card++) {
 
     if(frame_parms[0]->N_RB_DL == 100) {
-      openair0_cfg[card].sample_rate=30.72e6;
-      openair0_cfg[card].samples_per_frame = 307200; 
-      openair0_cfg[card].tx_bw = 10e6;
-      openair0_cfg[card].rx_bw = 10e6;
+      if (frame_parms[0]->threequarter_fs) {
+	openair0_cfg[card].sample_rate=23.04e6;
+	openair0_cfg[card].samples_per_frame = 230400; 
+	openair0_cfg[card].tx_bw = 10e6;
+	openair0_cfg[card].rx_bw = 10e6;
+      }
+      else {
+	openair0_cfg[card].sample_rate=30.72e6;
+	openair0_cfg[card].samples_per_frame = 307200; 
+	openair0_cfg[card].tx_bw = 10e6;
+	openair0_cfg[card].rx_bw = 10e6;
+      }
     } else if(frame_parms[0]->N_RB_DL == 50) {
       openair0_cfg[card].sample_rate=15.36e6;
       openair0_cfg[card].samples_per_frame = 153600;
@@ -2979,7 +3367,6 @@ int main( int argc, char **argv )
       openair0_cfg[card].samples_per_frame = 76800;
       openair0_cfg[card].tx_bw = 2.5e6;
       openair0_cfg[card].rx_bw = 2.5e6;
-
     } else if (frame_parms[0]->N_RB_DL == 6) {
       openair0_cfg[card].sample_rate=1.92e6;
       openair0_cfg[card].samples_per_frame = 19200;
@@ -2992,20 +3379,13 @@ int main( int argc, char **argv )
     else //FDD
       openair0_cfg[card].duplex_mode = duplex_mode_FDD;
 
-#ifdef ETHERNET
-
-    //calib needed
-    openair0_cfg[card].tx_scheduling_advance = 0;
-    openair0_cfg[card].tx_sample_advance = 0;
-    
-    if (frame_parms[0]->N_RB_DL == 6) 
-      openair0_cfg[card].samples_per_packet = 256;
-    else 
-      openair0_cfg[card].samples_per_packet = 1024;
-
-    printf("HW: samples_per_packet %d\n",openair0_cfg[card].samples_per_packet);
-#endif
 
+    if (local_remote_radio == BBU_REMOTE_RADIO_HEAD) {      
+      openair0_cfg[card].remote_addr    = eth_params->remote_addr;
+      openair0_cfg[card].remote_port    = eth_params->remote_port;
+      openair0_cfg[card].my_addr        = eth_params->my_addr;
+      openair0_cfg[card].my_port        = eth_params->my_port;    
+    }
 
     printf("HW: Configuring card %d, nb_antennas_tx/rx %d/%d\n",card,
            ((UE_flag==0) ? PHY_vars_eNB_g[0][0]->lte_frame_parms.nb_antennas_tx : PHY_vars_UE_g[0][0]->lte_frame_parms.nb_antennas_tx),
@@ -3015,13 +3395,10 @@ int main( int argc, char **argv )
 
     if (UE_flag) {
       printf("ETHERNET: Configuring UE ETH for %s:%d\n",rrh_UE_ip,rrh_UE_port);
-      openair0_cfg[card].remote_ip   = &rrh_UE_ip[0];
+      openair0_cfg[card].remote_addr   = &rrh_UE_ip[0];
       openair0_cfg[card].remote_port = rrh_UE_port;
-    } else {
-      printf("ETHERNET: Configuring eNB ETH for %s:%d\n",rrh_eNB_ip,rrh_eNB_port);
-      openair0_cfg[card].remote_ip   = &rrh_eNB_ip[0];
-      openair0_cfg[card].remote_port = rrh_eNB_port;
-    }
+    } 
+
     openair0_cfg[card].num_rb_dl=frame_parms[0]->N_RB_DL;
 #endif
 
@@ -3048,9 +3425,10 @@ int main( int argc, char **argv )
 	openair0_cfg[card].rx_gain[i] = PHY_vars_eNB_g[0][0]->rx_total_gain_eNB_dB;
       }
       else {
-	openair0_cfg[card].rx_gain[i] = PHY_vars_UE_g[0][0]->rx_total_gain_dB;// - USRP_GAIN_OFFSET;  // calibrated for USRP B210 @ 2.6 GHz, 30.72 MS/s
+	openair0_cfg[card].rx_gain[i] = PHY_vars_UE_g[0][0]->rx_total_gain_dB;
       }
-      
+
+#if 0  // UHD 3.8     
       switch(frame_parms[0]->N_RB_DL) {
       case 6:
         openair0_cfg[card].rx_gain[i] -= 12;
@@ -3071,38 +3449,99 @@ int main( int argc, char **argv )
       default:
         break;
       }
-      
+#endif      
 
     }
 
 #endif
   }
 
-  openair0.func_type = BBU_FUNC;
-  openair0_cfg[0].log_level = glog_level;
+#ifndef DEADLINE_SCHEDULER
 
-  if ((mode!=loop_through_memory) && 
-      (openair0_device_init(&openair0, &openair0_cfg[0]) <0)) {
-    printf("Exiting, cannot initialize device\n");
-    exit(-1);
+  /* Currently we set affinity for UHD to CPU 0 for eNB/UE and only if number of CPUS >2 */
+  
+  cpu_set_t cpuset;
+  int s;
+  char cpu_affinity[1024];
+  CPU_ZERO(&cpuset);
+  #ifdef CPU_AFFINITY
+  if (get_nprocs() > 2)
+  {
+    CPU_SET(0, &cpuset);
+    s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
+    if (s != 0)
+    {
+      perror( "pthread_setaffinity_np");
+      exit_fun("Error setting processor affinity");
+    }
+    LOG_I(HW, "Setting the affinity of main function to CPU 0, for device library to use CPU 0 only!\n");
   }
-  else if (mode==loop_through_memory) {    
+  #endif
+
+  /* Check the actual affinity mask assigned to the thread */
+  s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
+  if (s != 0)
+  {
+    perror( "pthread_getaffinity_np");
+    exit_fun("Error getting processor affinity ");
   }
- 
+  memset(cpu_affinity, 0 , sizeof(cpu_affinity));
+  for (int j = 0; j < CPU_SETSIZE; j++)
+  {
+    if (CPU_ISSET(j, &cpuset))
+    {  
+      char temp[1024];
+      sprintf(temp, " CPU_%d ", j);    
+      strcat(cpu_affinity, temp);
+    }
+  }
+  LOG_I(HW, "CPU Affinity of main() function is... %s\n", cpu_affinity);
+#endif
+
+  /* device host type is set*/
+  openair0.host_type = BBU_HOST;
+  /* device type is initialized NONE_DEV (no RF device) when the RF device will be initiated device type will be set */
+  openair0.type = NONE_DEV;
+  /* transport type is initialized NONE_TP (no transport protocol) when the transport protocol will be initiated transport protocol type will be set */
+  openair0.transp_type = NONE_TP;
+  openair0_cfg[0].log_level = glog_level;
+
+  int returns=-1;
+  /* BBU can have either a local or a remote radio head */  
+  if (local_remote_radio == BBU_LOCAL_RADIO_HEAD) { //local radio head active  - load library of radio head and initiate it
+    if (mode!=loop_through_memory) {
+      returns=openair0_device_load(&openair0, &openair0_cfg[0]);
+      printf("openair0_device_init returns %d\n",returns);
+      if (returns<0) {
+	printf("Exiting, cannot initialize device\n");
+	exit(-1);
+      }
+    }
+    else if (mode==loop_through_memory) {    
+    }
+  }  else { //remote radio head active - load library of transport protocol and initiate it 
+    if (mode!=loop_through_memory) {
+      returns=openair0_transport_load(&openair0, &openair0_cfg[0], eth_params);
+      printf("openair0_transport_init returns %d\n",returns);
+      if (returns<0) { 
+	printf("Exiting, cannot initialize transport protocol\n");
+	exit(-1);
+      }
+    }
+    else if (mode==loop_through_memory) {    
+    }
+  }   
+  
   printf("Done\n");
 
   mac_xface = malloc(sizeof(MAC_xface));
 
-#ifdef OPENAIR2
   int eMBMS_active=0;
-
+  
   l2_init(frame_parms[0],eMBMS_active,(uecap_xer_in==1)?uecap_xer:NULL,
-          0,// cba_group_active
-          0); // HO flag
-
-
-#endif
-
+	  0,// cba_group_active
+	  0); // HO flag
+  
   mac_xface->macphy_exit = &exit_fun;
 
 #if defined(ENABLE_ITTI)
@@ -3115,15 +3554,14 @@ int main( int argc, char **argv )
   printf("ITTI tasks created\n");
 #endif
 
-#ifdef OPENAIR2
-  if (UE_flag==1) {
-    printf("Filling UE band info\n");
-    fill_ue_band_info();
-    mac_xface->dl_phy_sync_success (0, 0, 0, 1);
-  } else
-    mac_xface->mrbch_phy_sync_failure (0, 0, 0);
-
-#endif
+  if (phy_test==0) {
+    if (UE_flag==1) {
+      printf("Filling UE band info\n");
+      fill_ue_band_info();
+      mac_xface->dl_phy_sync_success (0, 0, 0, 1);
+    } else
+      mac_xface->mrbch_phy_sync_failure (0, 0, 0);
+  }
 
   /* #ifdef OPENAIR2
   //if (otg_enabled) {
@@ -3159,7 +3597,7 @@ int main( int argc, char **argv )
   // connect the TX/RX buffers
   if (UE_flag==1) {
 #ifdef OAI_USRP
-    openair_daq_vars.timing_advance = 0;
+    openair_daq_vars.timing_advance = timing_advance;
 #else
     openair_daq_vars.timing_advance = 160;
 #endif
@@ -3179,10 +3617,11 @@ int main( int argc, char **argv )
 
     if (input_fd) {
       printf("Reading in from file to antenna buffer %d\n",0);
-      fread(UE[0]->lte_ue_common_vars.rxdata[0],
-	    sizeof(int32_t),
-	    frame_parms[0]->samples_per_tti*10,
-	    input_fd);
+      if (fread(UE[0]->lte_ue_common_vars.rxdata[0],
+	        sizeof(int32_t),
+	        frame_parms[0]->samples_per_tti*10,
+	        input_fd) != frame_parms[0]->samples_per_tti*10)
+        printf("error reading from file\n");
     }
     //p_exmimo_config->framing.tdd_config = TXRXSWITCH_TESTRX;
   } else {
@@ -3242,17 +3681,6 @@ openair0_cfg[0].rx_freq[1] = 0;
   pthread_cond_init(&sync_cond,NULL);
   pthread_mutex_init(&sync_mutex, NULL);
 
-#if defined(ENABLE_ITTI)
-
-  // Wait for eNB application initialization to be complete (eNB registration to MME)
-  if (UE_flag==0) {
-    printf("Waiting for eNB application to be ready\n");
-    wait_system_ready ("Waiting for eNB application to be ready %s\r", &start_eNB);
-  }
-
-#endif
-
-
   // this starts the DMA transfers
 #ifdef EXMIMO
 
@@ -3332,7 +3760,7 @@ openair0_cfg[0].rx_freq[1] = 0;
   pthread_attr_init (&attr_UE_thread);
   pthread_attr_setstacksize(&attr_UE_thread,8192);//5*PTHREAD_STACK_MIN);
 
-#ifndef LOWLATENCY
+#ifndef DEADLINE_SCHEDULER
   sched_param_UE_thread.sched_priority = sched_get_priority_max(SCHED_FIFO);
   pthread_attr_setschedparam(&attr_UE_thread,&sched_param_UE_thread);
   sched_param_dlsch.sched_priority = sched_get_priority_max(SCHED_FIFO); //OPENAIR_THREAD_PRIORITY;
@@ -3369,6 +3797,16 @@ openair0_cfg[0].rx_freq[1] = 0;
 
 #endif
     printf("UE threads created\n");
+#ifdef USE_MME
+
+    while (start_UE == 0) {
+      sleep(1);
+    }
+
+#endif
+
+
+
   } else {
     if (multi_thread>0) {
       init_eNB_proc();
@@ -3398,13 +3836,7 @@ openair0_cfg[0].rx_freq[1] = 0;
   // Sleep to allow all threads to setup
   sleep(1);
 
-#ifdef USE_MME
 
-  while (start_UE == 0) {
-    sleep(1);
-  }
-
-#endif
 
 #ifndef EXMIMO
 
@@ -3417,6 +3849,7 @@ openair0_cfg[0].rx_freq[1] = 0;
 
 #endif
 
+  printf("Sending sync to all threads\n");
 
   pthread_mutex_lock(&sync_mutex);
   sync_var=0;
@@ -3509,13 +3942,9 @@ openair0_cfg[0].rx_freq[1] = 0;
     if (multi_thread>0) {
       printf("Killing eNB processing threads\n");
       kill_eNB_proc();
-
     }
   }
 
-#ifdef OPENAIR2
-  //cleanup_pdcp_thread();
-#endif
 
 #ifdef RTAI
   stop_rt_timer();
@@ -3550,13 +3979,9 @@ openair0_cfg[0].rx_freq[1] = 0;
   if (ouput_vcd)
     VCD_SIGNAL_DUMPER_CLOSE();
 
-#ifdef OPENAIR2
-
   if (opt_enabled == 1)
     terminate_opt();
 
-#endif
-
   logClean();
 
   return 0;
@@ -3601,10 +4026,6 @@ int setup_eNB_buffers(PHY_VARS_eNB **phy_vars_eNB, openair0_config_t *openair0_c
 
 #endif
 
-
-
-
-
     // replace RX signal buffers with mmaped HW versions
 #ifdef EXMIMO
     openair0_cfg[CC_id].tx_num_channels = 0;
diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c
index 7aa2213d949dcc40af02580bdbf2f4e26324c287..0e834a53ab0e42b165036951b0313dfabdcd95de 100644
--- a/targets/RT/USER/lte-ue.c
+++ b/targets/RT/USER/lte-ue.c
@@ -53,6 +53,7 @@
 #include <execinfo.h>
 #include <getopt.h>
 #include <syscall.h>
+#include <sys/sysinfo.h>
 
 #include "rt_wrapper.h"
 #include "assertions.h"
@@ -75,13 +76,9 @@
 #endif
 
 #include "PHY/extern.h"
-#include "MAC_INTERFACE/extern.h"
-//#include "SCHED/defs.h"
 #include "SCHED/extern.h"
-#ifdef OPENAIR2
 #include "LAYER2/MAC/extern.h"
 #include "LAYER2/MAC/proto.h"
-#endif
 
 #include "UTIL/LOG/log_extern.h"
 #include "UTIL/OTG/otg_tx.h"
@@ -215,6 +212,76 @@ static void *UE_thread_synch(void *arg)
   printf("UE_thread_sync in with PHY_vars_UE %p\n",arg);
   printf("waiting for sync (UE_thread_synch) \n");
 
+#ifndef DEADLINE_SCHEDULER
+  int policy, s, j;
+  struct sched_param sparam;
+  char cpu_affinity[1024];
+  cpu_set_t cpuset;
+
+  /* Set affinity mask to include CPUs 1 to MAX_CPUS */
+  /* CPU 0 is reserved for UHD threads */
+  CPU_ZERO(&cpuset);
+
+  #ifdef CPU_AFFINITY
+  if (get_nprocs() >2)
+  {
+    for (j = 1; j < get_nprocs(); j++)
+      CPU_SET(j, &cpuset);
+
+    s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
+    if (s != 0)
+    {
+      perror( "pthread_setaffinity_np");
+      exit_fun("Error setting processor affinity");
+    }
+  }
+  #endif
+
+  /* Check the actual affinity mask assigned to the thread */
+
+  s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
+  if (s != 0)
+  {
+    perror( "pthread_getaffinity_np");
+    exit_fun("Error getting processor affinity ");
+  }
+  memset(cpu_affinity, 0 , sizeof(cpu_affinity));
+  for (j = 0; j < CPU_SETSIZE; j++)
+  if (CPU_ISSET(j, &cpuset))
+  {  
+     char temp[1024];
+     sprintf(temp, " CPU_%d ", j);    
+     strcat(cpu_affinity, temp);
+  }
+
+  memset(&sparam, 0 , sizeof (sparam));
+  sparam.sched_priority = sched_get_priority_max(SCHED_FIFO)-1;
+  policy = SCHED_FIFO ; 
+  
+  s = pthread_setschedparam(pthread_self(), policy, &sparam);
+  if (s != 0)
+     {
+     perror("pthread_setschedparam : ");
+     exit_fun("Error setting thread priority");
+     }
+  s = pthread_getschedparam(pthread_self(), &policy, &sparam);
+  if (s != 0)
+   {
+     perror("pthread_getschedparam : ");
+     exit_fun("Error getting thread priority");
+
+   }
+
+  LOG_I( HW, "[SCHED][UE] Started UE synch thread on CPU %d TID %ld , sched_policy = %s, priority = %d, CPU Affinity = %s \n", (int)sched_getcpu(), gettid(),
+                   (policy == SCHED_FIFO)  ? "SCHED_FIFO" :
+                   (policy == SCHED_RR)    ? "SCHED_RR" :
+                   (policy == SCHED_OTHER) ? "SCHED_OTHER" :
+                   "???",
+                   (int) sparam.sched_priority, cpu_affinity);
+
+#endif
+
+
   pthread_mutex_lock(&sync_mutex);
   printf("Locked sync_mutex, waiting (UE_sync_thread)\n");
 
@@ -279,7 +346,7 @@ static void *UE_thread_synch(void *arg)
 #ifdef OAI_USRP
         openair0_cfg[card].rx_gain[i] = UE->rx_total_gain_dB;//-USRP_GAIN_OFFSET;
 
-	
+#if 0 // UHD 3.8	
         switch(UE->lte_frame_parms.N_RB_DL) {
         case 6:
           openair0_cfg[card].rx_gain[i] -= 12;
@@ -301,7 +368,7 @@ static void *UE_thread_synch(void *arg)
           printf( "Unknown number of RBs %d\n", UE->lte_frame_parms.N_RB_DL );
           break;
         }
-	
+#endif
         printf( "UE synch: setting RX gain (%d,%d) to %f\n", card, i, openair0_cfg[card].rx_gain[i] );
 #endif
       }
@@ -357,7 +424,8 @@ static void *UE_thread_synch(void *arg)
           openair0_cfg[card].tx_freq[i] = downlink_frequency[card][i]+uplink_frequency_offset[card][i];
 #ifdef OAI_USRP
           openair0_cfg[card].rx_gain[i] = UE->rx_total_gain_dB;//-USRP_GAIN_OFFSET;  // 65 calibrated for USRP B210 @ 2.6 GHz
-	  
+
+#if 0 // UHD 3.8	  
           switch(UE->lte_frame_parms.N_RB_DL) {
           case 6:
             openair0_cfg[card].rx_gain[i] -= 12;
@@ -379,7 +447,7 @@ static void *UE_thread_synch(void *arg)
             printf("Unknown number of RBs %d\n",UE->lte_frame_parms.N_RB_DL);
             break;
           }
-	  
+#endif	  
 
           printf("UE synch: setting RX gain (%d,%d) to %f\n",card,i,openair0_cfg[card].rx_gain[i]);
 #endif
@@ -400,7 +468,7 @@ static void *UE_thread_synch(void *arg)
  
     case pbch:
 
-      
+      LOG_I(PHY,"[UE thread Synch] Running Initial Synch\n");
       if (initial_sync( UE, UE->mode ) == 0) {
 
         hw_slot_offset = (UE->rx_offset<<1) / UE->lte_frame_parms.samples_per_tti;
@@ -423,31 +491,31 @@ static void *UE_thread_synch(void *arg)
 	    openair0_cfg[0].sample_rate =1.92e6;
 	    openair0_cfg[0].rx_bw          =.96e6;
 	    openair0_cfg[0].tx_bw          =.96e6;
-            openair0_cfg[0].rx_gain[0] -= 12;
+	    //            openair0_cfg[0].rx_gain[0] -= 12;
 	    break;
 	  case 25:
 	    openair0_cfg[0].sample_rate =7.68e6;
 	    openair0_cfg[0].rx_bw          =2.5e6;
 	    openair0_cfg[0].tx_bw          =2.5e6;
-            openair0_cfg[0].rx_gain[0] -= 6;
+	    //            openair0_cfg[0].rx_gain[0] -= 6;
 	    break;
 	  case 50:
 	    openair0_cfg[0].sample_rate =15.36e6;
 	    openair0_cfg[0].rx_bw          =5.0e6;
 	    openair0_cfg[0].tx_bw          =5.0e6;
-            openair0_cfg[0].rx_gain[0] -= 3;
+	    //            openair0_cfg[0].rx_gain[0] -= 3;
 	    break;
 	  case 100:
 	    openair0_cfg[0].sample_rate=30.72e6;
 	    openair0_cfg[0].rx_bw=10.0e6;
 	    openair0_cfg[0].tx_bw=10.0e6;
-            openair0_cfg[0].rx_gain[0] -= 0;
+	    //            openair0_cfg[0].rx_gain[0] -= 0;
 	    break;
 	  }
 #ifndef EXMIMO
 	  openair0.trx_set_freq_func(&openair0,&openair0_cfg[0],0);
-	  openair0.trx_set_gains_func(&openair0,&openair0_cfg[0]);
-	  openair0.trx_stop_func(0);	  
+	  //openair0.trx_set_gains_func(&openair0,&openair0_cfg[0]);
+	  //openair0.trx_stop_func(0);	  
 #else
 	  openair0_set_frequencies(&openair0,&openair0_cfg[0],0);
 	  openair0_set_gains(&openair0,&openair0_cfg[0]);
@@ -462,7 +530,7 @@ static void *UE_thread_synch(void *arg)
 	 if( UE->mode == rx_dump_frame ){
 	   FILE *fd;
 	   if ((UE->frame_rx&1) == 0) {  // this guarantees SIB1 is present 
-	     if (fd = fopen("rxsig_frame0.dat","w")) {
+	     if ((fd = fopen("rxsig_frame0.dat","w")) != NULL) {
 	       fwrite((void*)&UE->lte_ue_common_vars.rxdata[0][0],
 		      sizeof(int32_t),
 		      10*UE->lte_frame_parms.samples_per_tti,
@@ -503,6 +571,16 @@ static void *UE_thread_synch(void *arg)
 	
 	  if (abs(freq_offset) > 7500) {
 	    LOG_I( PHY, "[initial_sync] No cell synchronization found, abandoning\n" );
+	    FILE *fd;
+	    if ((fd = fopen("rxsig_frame0.dat","w"))!=NULL) {
+	      fwrite((void*)&UE->lte_ue_common_vars.rxdata[0][0],
+		     sizeof(int32_t),
+		     10*UE->lte_frame_parms.samples_per_tti,
+		     fd);
+	      LOG_I(PHY,"Dummping Frame ... bye bye \n");
+	      fclose(fd);
+	      exit(0);
+	    }
 	    mac_xface->macphy_exit("No cell synchronization found, abandoning");
 	    return &UE_thread_synch_retval; // not reached
 	  }
@@ -520,10 +598,6 @@ static void *UE_thread_synch(void *arg)
           for (i=0; i<openair0_cfg[card].rx_num_channels; i++) {
             openair0_cfg[card].rx_freq[i] = downlink_frequency[card][i]+freq_offset;
             openair0_cfg[card].tx_freq[i] = downlink_frequency[card][i]+uplink_frequency_offset[card][i]+freq_offset;
-#ifdef OAI_USRP
-            openair0_cfg[card].rx_gain[i] = UE->rx_total_gain_dB;//-USRP_GAIN_OFFSET;
-	    
-	    
 #ifndef EXMIMO
 	    openair0.trx_set_freq_func(&openair0,&openair0_cfg[0],0);
 	    
@@ -531,6 +605,12 @@ static void *UE_thread_synch(void *arg)
 	    openair0_set_frequencies(&openair0,&openair0_cfg[0],0);
 	    
 #endif
+
+#if defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
+            openair0_cfg[card].rx_gain[i] = UE->rx_total_gain_dB;//-USRP_GAIN_OFFSET;
+	    
+	    
+#if 0
             switch(UE->lte_frame_parms.N_RB_DL) {
             case 6:
               openair0_cfg[card].rx_gain[i] -= 12;
@@ -552,7 +632,7 @@ static void *UE_thread_synch(void *arg)
               printf("Unknown number of RBs %d\n",UE->lte_frame_parms.N_RB_DL);
               break;
             }
-	    
+#endif	    
 #endif
           }
         }
@@ -604,7 +684,7 @@ static void *UE_thread_synch(void *arg)
 static void *UE_thread_tx(void *arg)
 {
   static int UE_thread_tx_retval;
-  int ret;
+  //int ret;
 
   PHY_VARS_UE *UE = (PHY_VARS_UE*)arg;
 
@@ -621,7 +701,7 @@ static void *UE_thread_tx(void *arg)
   LOG_D(HW,"Started UE TX thread (id %p)\n",task);
 #else
 
-#ifdef LOWLATENCY
+#ifdef DEADLINE_SCHEDULER
   struct sched_attr attr;
   unsigned int flags = 0;
 
@@ -643,9 +723,72 @@ static void *UE_thread_tx(void *arg)
   }
 
 #else
-  struct sched_param sp;
-  sp.sched_priority = sched_get_priority_max(SCHED_FIFO)-1;
-  pthread_setschedparam(pthread_self(),SCHED_FIFO,&sp);
+  int policy, s, j;
+  struct sched_param sparam;
+  char cpu_affinity[1024];
+  cpu_set_t cpuset;
+
+  /* Set affinity mask to include CPUs 1 to MAX_CPUS */
+  /* CPU 0 is reserved for UHD threads */
+  CPU_ZERO(&cpuset);
+
+  #ifdef CPU_AFFINITY
+  if (get_nprocs() >2)
+  {
+    for (j = 1; j < get_nprocs(); j++)
+      CPU_SET(j, &cpuset);
+
+    s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
+    if (s != 0)
+    {
+      perror( "pthread_setaffinity_np");
+      exit_fun("Error setting processor affinity");
+    }
+  }
+  #endif
+
+  /* Check the actual affinity mask assigned to the thread */
+
+  s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
+  if (s != 0)
+  {
+    perror( "pthread_getaffinity_np");
+    exit_fun("Error getting processor affinity ");
+  }
+  memset(cpu_affinity, 0 , sizeof(cpu_affinity));
+  for (j = 0; j < CPU_SETSIZE; j++)
+  if (CPU_ISSET(j, &cpuset))
+  {  
+     char temp[1024];
+     sprintf(temp, " CPU_%d ", j);    
+     strcat(cpu_affinity, temp);
+  }
+
+  memset(&sparam, 0 , sizeof (sparam));
+  sparam.sched_priority = sched_get_priority_max(SCHED_FIFO)-1;
+  policy = SCHED_FIFO ; 
+  
+  s = pthread_setschedparam(pthread_self(), policy, &sparam);
+  if (s != 0)
+     {
+     perror("pthread_setschedparam : ");
+     exit_fun("Error setting thread priority");
+     }
+  s = pthread_getschedparam(pthread_self(), &policy, &sparam);
+  if (s != 0)
+   {
+     perror("pthread_getschedparam : ");
+     exit_fun("Error getting thread priority");
+
+   }
+
+  LOG_I( HW, "[SCHED][UE] Started UE thread TX on CPU %d TID %ld , sched_policy = %s, priority = %d, CPU Affinity = %s \n", (int)sched_getcpu(), gettid(),
+                   (policy == SCHED_FIFO)  ? "SCHED_FIFO" :
+                   (policy == SCHED_RR)    ? "SCHED_RR" :
+                   (policy == SCHED_OTHER) ? "SCHED_OTHER" :
+                   "???",
+                   (int) sparam.sched_priority, cpu_affinity);
+
 
 #endif
 #endif
@@ -777,7 +920,7 @@ static void *UE_thread_rx(void *arg)
   LOG_D(HW,"Started UE RX thread (id %p)\n",task);
 #else
 
-#ifdef LOWLATENCY
+#ifdef DEADLINE_SCHEDULER
   struct sched_attr attr;
   unsigned int flags = 0;
 
@@ -798,9 +941,72 @@ static void *UE_thread_rx(void *arg)
   }
 
 #else
-  struct sched_param sp;
-  sp.sched_priority = sched_get_priority_max(SCHED_FIFO)-1;
-  pthread_setschedparam(pthread_self(),SCHED_FIFO,&sp);
+  int policy, s, j;
+  struct sched_param sparam;
+  char cpu_affinity[1024];
+  cpu_set_t cpuset;
+
+  /* Set affinity mask to include CPUs 1 to MAX_CPUS */
+  /* CPU 0 is reserved for UHD threads */
+  CPU_ZERO(&cpuset);
+
+  #ifdef CPU_AFFINITY
+  if (get_nprocs() >2)
+  {
+    for (j = 1; j < get_nprocs(); j++)
+      CPU_SET(j, &cpuset);
+
+    s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
+    if (s != 0)
+    {
+      perror( "pthread_setaffinity_np");
+      exit_fun("Error setting processor affinity");
+    }
+  }
+  #endif
+
+  /* Check the actual affinity mask assigned to the thread */
+
+  s = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
+  if (s != 0)
+  {
+    perror( "pthread_getaffinity_np");
+    exit_fun("Error getting processor affinity ");
+  }
+  memset(cpu_affinity, 0 , sizeof(cpu_affinity));
+  for (j = 0; j < CPU_SETSIZE; j++)
+  if (CPU_ISSET(j, &cpuset))
+  {  
+     char temp[1024];
+     sprintf(temp, " CPU_%d ", j);    
+     strcat(cpu_affinity, temp);
+  }
+
+  memset(&sparam, 0 , sizeof (sparam));
+  sparam.sched_priority = sched_get_priority_max(SCHED_FIFO)-1;
+  policy = SCHED_FIFO ; 
+  
+  s = pthread_setschedparam(pthread_self(), policy, &sparam);
+  if (s != 0)
+     {
+     perror("pthread_setschedparam : ");
+     exit_fun("Error setting thread priority");
+     }
+  s = pthread_getschedparam(pthread_self(), &policy, &sparam);
+  if (s != 0)
+   {
+     perror("pthread_getschedparam : ");
+     exit_fun("Error getting thread priority");
+
+   }
+
+  LOG_I( HW, "[SCHED][UE] Started UE RX thread on CPU %d TID %ld , sched_policy = %s, priority = %d, CPU Affinity = %s \n", (int)sched_getcpu(), gettid(),
+                   (policy == SCHED_FIFO)  ? "SCHED_FIFO" :
+                   (policy == SCHED_RR)    ? "SCHED_RR" :
+                   (policy == SCHED_OTHER) ? "SCHED_OTHER" :
+                   "???",
+                   (int) sparam.sched_priority, cpu_affinity);
+
 
 #endif
 #endif
@@ -922,9 +1128,7 @@ static void *UE_thread_rx(void *arg)
         phy_procedures_UE_RX( UE, 0, 0, UE->mode, no_relay, NULL );
       }
 
-#ifdef OPENAIR2
-
-      if (i==0) {
+      if ((UE->mac_enabled==1) && (i==0)) {
         ret = mac_xface->ue_scheduler(UE->Mod_id,
                                       UE->frame_tx,
                                       UE->slot_rx>>1,
@@ -947,7 +1151,6 @@ static void *UE_thread_rx(void *arg)
         }
       }
 
-#endif
       UE->slot_rx++;
 
       if (UE->slot_rx == 20) {
@@ -1003,7 +1206,7 @@ void *UE_thread(void *arg)
   static int UE_thread_retval;
   PHY_VARS_UE *UE = PHY_vars_UE_g[0][0];
   int spp = openair0_cfg[0].samples_per_packet;
-  int slot=1, frame=0, hw_subframe=0, rxpos=0, txpos=spp*openair0_cfg[0].tx_scheduling_advance;
+  int slot=1, frame=0, hw_subframe=0, rxpos=0, txpos=openair0_cfg[0].tx_scheduling_advance;
 #ifdef __AVX2__
   int dummy[2][spp] __attribute__((aligned(32)));
 #else
@@ -1020,6 +1223,10 @@ void *UE_thread(void *arg)
 
   openair0_timestamp timestamp;
 
+#ifdef NAS_UE
+  MessageDef *message_p;
+#endif
+
 #ifdef RTAI
   RT_TASK *task = rt_task_init_schmod(nam2num("UE thread"), 0, 0, 0, SCHED_FIFO, 0xF);
 
@@ -1030,7 +1237,7 @@ void *UE_thread(void *arg)
 
 #else
 
-#ifdef LOWLATENCY
+#ifdef DEADLINE_SCHEDULER
   struct sched_attr attr;
   unsigned int flags = 0;
 
@@ -1075,6 +1282,11 @@ void *UE_thread(void *arg)
 
   printf("starting UE thread\n");
 
+#ifdef NAS_UE
+  message_p = itti_alloc_new_message(TASK_NAS_UE, INITIALIZE_MESSAGE);
+  itti_send_msg_to_task (TASK_NAS_UE, INSTANCE_DEFAULT, message_p);
+#endif
+
   T0 = rt_get_time_ns();
   first_rx = 1;
   rxpos=0;
@@ -1095,10 +1307,10 @@ void *UE_thread(void *arg)
 
       for (int i=0; i<UE->lte_frame_parms.nb_antennas_rx; i++)
         rxp[i] = (dummy_dump==0) ? (void*)&rxdata[i][rxpos] : (void*)dummy[i];
-      /*
-      if (dummy_dump == 0)
-      	printf("writing %d samples to %d (first_rx %d)\n",spp - ((first_rx==1) ? rx_off_diff : 0),rxpos,first_rx);
-      */
+      
+      /*      if (dummy_dump == 0)
+	      printf("writing %d samples to %d (first_rx %d)\n",spp - ((first_rx==1) ? rx_off_diff : 0),rxpos,first_rx);*/
+      
       if (UE->mode != loop_through_memory) {
 	rxs = openair0.trx_read_func(&openair0,
 				     &timestamp,
@@ -1107,8 +1319,11 @@ void *UE_thread(void *arg)
 				     UE->lte_frame_parms.nb_antennas_rx);
 
 	if (rxs != (spp- ((first_rx==1) ? rx_off_diff : 0))) {
-	  exit_fun("problem in rx");
-	  return &UE_thread_retval;
+	  printf("rx error: asked %d got %d ",spp - ((first_rx==1) ? rx_off_diff : 0),rxs);
+	  if (UE->is_synchronized == 1) {
+	    exit_fun("problem in rx");
+	    return &UE_thread_retval;
+	  }
 	}
       }
 
@@ -1214,7 +1429,7 @@ void *UE_thread(void *arg)
           }
         } else {
           LOG_E( PHY, "[SCHED][UE] UE RX thread busy (IC %d)!!\n", instance_cnt_rx);
-	  if (instance_cnt_rx > 1) {
+	  if (instance_cnt_rx > 2) {
 	    exit_fun("instance_cnt_rx > 1");
 	    return &UE_thread_retval;
 	  }
@@ -1250,7 +1465,7 @@ void *UE_thread(void *arg)
 
           } else {
             LOG_E( PHY, "[SCHED][UE] UE TX thread busy (IC %d)!!\n" );
-	    if (instance_cnt_tx>1) {
+	    if (instance_cnt_tx>2) {
 	      exit_fun("instance_cnt_tx > 1");
 	      return &UE_thread_retval;
 	    }
@@ -1325,6 +1540,7 @@ void *UE_thread(void *arg)
 
 #ifndef USRP_DEBUG
 	    if (UE->mode != loop_through_memory) {
+	      LOG_I(PHY,"Resynchronizing RX by %d samples\n",UE->rx_offset);
 	      rxs = openair0.trx_read_func(&openair0,
 					   &timestamp,
 					   (void**)rxdata,
@@ -1388,19 +1604,19 @@ void *UE_thread(void *arg)
   RT_TASK *task;
 #endif
   // RTIME in, out, diff;
-  int slot=0,frame=0,hw_slot,last_slot,next_slot;
+  int slot=0,frame=0,hw_slot;
   // unsigned int aa;
   int delay_cnt;
   RTIME time_in;
-  int hw_slot_offset=0,rx_offset_mbox=0,mbox_target=0,mbox_current=0;
+  int /* hw_slot_offset=0, */ rx_offset_mbox=0,mbox_target=0,mbox_current=0;
   int diff2;
-  int i, ret;
-  int CC_id,card;
+  int /* i, */ ret;
+  int /* CC_id, */ card;
   volatile unsigned int *DAQ_MBOX = openair0_daq_cnt();
 
   int wait_sync_cnt = 0;
   int first_synch = 1;
-#ifdef LOWLATENCY
+#ifdef DEADLINE_SCHEDULER
   struct sched_attr attr;
   unsigned int flags = 0;
   //  unsigned long mask = 1; // processor 0
@@ -1424,7 +1640,7 @@ void *UE_thread(void *arg)
 #endif
 
 
-#ifdef LOWLATENCY
+#ifdef DEADLINE_SCHEDULER
   attr.size = sizeof(attr);
   attr.sched_flags = 0;
   attr.sched_nice = 0;
@@ -1675,7 +1891,7 @@ void *UE_thread(void *arg)
         frame++;
       }
     } else if (UE->is_synchronized == 0) { // we are not yet synchronized
-      hw_slot_offset = 0;
+      //hw_slot_offset = 0;
       first_synch = 1;
       slot = 0;
 
diff --git a/targets/RT/USER/rrh.gtkw b/targets/RT/USER/rrh.gtkw
index 22a5a9f575b252528a9bb701ba3940c826296adc..891f23ada52417ffd360f617eab2eeecd2ef16cd 100644
--- a/targets/RT/USER/rrh.gtkw
+++ b/targets/RT/USER/rrh.gtkw
@@ -1,19 +1,19 @@
 [*]
 [*] GTKWave Analyzer v3.3.58 (w)1999-2014 BSI
-[*] Thu Sep 17 14:23:43 2015
+[*] Fri Jan 29 16:34:46 2016
 [*]
 [dumpfile] "/tmp/openair_dump_rrh.vcd"
-[dumpfile_mtime] "Thu Sep 17 14:21:43 2015"
-[dumpfile_size] 636509125
-[savefile] "/home/guepe/openair4G/targets/RT/USER/rrh.gtkw"
-[timestart] 17746655400
-[size] 1855 1056
-[pos] -1 -1
-*-15.826077 17746846200 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
+[dumpfile_mtime] "Fri Jan 29 16:20:55 2016"
+[dumpfile_size] 224259458
+[savefile] "/home/guepe/openairinterface5g_rrh/openairinterface5g/targets/RT/USER/rrh.gtkw"
+[timestart] 31315875900
+[size] 1004 1028
+[pos] 926 -1
+*-17.429794 31316090054 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
 [sst_width] 224
-[signals_width] 230
+[signals_width] 261
 [sst_expanded] 1
-[sst_vpaned_height] 287
+[sst_vpaned_height] 278
 @24
 [color] 1
 variables.hw_frame_rx[63:0]
@@ -23,7 +23,10 @@ variables.hw_subframe_rx[63:0]
 [color] 1
 functions.eNB_rx
 functions.eNB_rx_sleep
-functions.trx_write_rf
+[color] 3
+functions.trx_read_rf
+[color] 7
+functions.trx_write
 @c00024
 variables.rxcnt[63:0]
 @28
@@ -95,24 +98,97 @@ variables.rxcnt[63:0]
 -group_end
 @24
 variables.pck_rx[63:0]
+variables.rx_ts[63:0]
+@c00024
+variables.tx_seq_num[63:0]
+@28
+(0)variables.tx_seq_num[63:0]
+(1)variables.tx_seq_num[63:0]
+(2)variables.tx_seq_num[63:0]
+(3)variables.tx_seq_num[63:0]
+(4)variables.tx_seq_num[63:0]
+(5)variables.tx_seq_num[63:0]
+(6)variables.tx_seq_num[63:0]
+(7)variables.tx_seq_num[63:0]
+(8)variables.tx_seq_num[63:0]
+(9)variables.tx_seq_num[63:0]
+(10)variables.tx_seq_num[63:0]
+(11)variables.tx_seq_num[63:0]
+(12)variables.tx_seq_num[63:0]
+(13)variables.tx_seq_num[63:0]
+(14)variables.tx_seq_num[63:0]
+(15)variables.tx_seq_num[63:0]
+(16)variables.tx_seq_num[63:0]
+(17)variables.tx_seq_num[63:0]
+(18)variables.tx_seq_num[63:0]
+(19)variables.tx_seq_num[63:0]
+(20)variables.tx_seq_num[63:0]
+(21)variables.tx_seq_num[63:0]
+(22)variables.tx_seq_num[63:0]
+(23)variables.tx_seq_num[63:0]
+(24)variables.tx_seq_num[63:0]
+(25)variables.tx_seq_num[63:0]
+(26)variables.tx_seq_num[63:0]
+(27)variables.tx_seq_num[63:0]
+(28)variables.tx_seq_num[63:0]
+(29)variables.tx_seq_num[63:0]
+(30)variables.tx_seq_num[63:0]
+(31)variables.tx_seq_num[63:0]
+(32)variables.tx_seq_num[63:0]
+(33)variables.tx_seq_num[63:0]
+(34)variables.tx_seq_num[63:0]
+(35)variables.tx_seq_num[63:0]
+(36)variables.tx_seq_num[63:0]
+(37)variables.tx_seq_num[63:0]
+(38)variables.tx_seq_num[63:0]
+(39)variables.tx_seq_num[63:0]
+(40)variables.tx_seq_num[63:0]
+(41)variables.tx_seq_num[63:0]
+(42)variables.tx_seq_num[63:0]
+(43)variables.tx_seq_num[63:0]
+(44)variables.tx_seq_num[63:0]
+(45)variables.tx_seq_num[63:0]
+(46)variables.tx_seq_num[63:0]
+(47)variables.tx_seq_num[63:0]
+(48)variables.tx_seq_num[63:0]
+(49)variables.tx_seq_num[63:0]
+(50)variables.tx_seq_num[63:0]
+(51)variables.tx_seq_num[63:0]
+(52)variables.tx_seq_num[63:0]
+(53)variables.tx_seq_num[63:0]
+(54)variables.tx_seq_num[63:0]
+(55)variables.tx_seq_num[63:0]
+(56)variables.tx_seq_num[63:0]
+(57)variables.tx_seq_num[63:0]
+(58)variables.tx_seq_num[63:0]
+(59)variables.tx_seq_num[63:0]
+(60)variables.tx_seq_num[63:0]
+(61)variables.tx_seq_num[63:0]
+(62)variables.tx_seq_num[63:0]
+(63)variables.tx_seq_num[63:0]
+@1401200
+-group_end
+@24
 variables.hw_frame[63:0]
 variables.hw_subframe[63:0]
 @28
 [color] 1
 functions.eNB_tx
 functions.eNB_tx_sleep
-functions.trx_read_rf
-[color] 7
-functions.trx_write
 [color] 7
 functions.trx_read
+[color] 3
+functions.trx_write_rf
 @24
 variables.txcnt[63:0]
-variables.rx_ts[63:0]
+variables.pck_tx[63:0]
 variables.tx_ts[63:0]
+@25
+variables.rx_seq_num_prv[63:0]
+@24
+variables.rx_seq_num[63:0]
 variables.hw_cnt_rx[63:0]
 variables.lhw_cnt_rx[63:0]
-@25
 [color] 3
 variables.cnt[63:0]
 [pattern_trace] 1
diff --git a/targets/RT/USER/rrh_gw.c b/targets/RT/USER/rrh_gw.c
index 89c8679554ef7053b2853dc8b10d4ea01145ded9..4fd687a3a568aa656e58b96e052f27b1b223a37d 100644
--- a/targets/RT/USER/rrh_gw.c
+++ b/targets/RT/USER/rrh_gw.c
@@ -51,9 +51,9 @@
 #include <time.h>
 
 #include "common_lib.h"
-#include "rrh_gw.h" // change to rrh_new.h, put externs in rrh_extern.h
+#include "rrh_gw.h"
 #include "rt_wrapper.h"
-#include "rrh_gw_externs.h" // change to rrh_new.h, put externs in rrh_extern.h
+#include "rrh_gw_externs.h"
 
 
 #include "log_if.h"
@@ -71,8 +71,9 @@
  *****************************************************************************************/
 
 
-
-char rrh_ip[20] = "192.168.12.242"; // there is code to detect the my ip address
+/* local IP/MAC address is detected*/
+char rrh_ip[20] = "0.0.0.0"; 
+unsigned char rrh_mac[6] = "0:0:0:0:0:0"; 
 int  rrh_port = 50000; // has to be an option
 
 /* log */
@@ -86,7 +87,7 @@ int16_t           ue_log_level        = LOG_INFO;
 int16_t           ue_log_verbosity    = LOG_MED;
 
 
-/* flags definitions */
+/* flag definitions */
 uint8_t 	eNB_flag=0;
 uint8_t 	UE_flag=0;
 uint8_t 	EXMIMO_flag=0;
@@ -102,18 +103,15 @@ uint8_t         measurements_flag=0;
    - default ethernet interface is local */
 uint8_t 	    num_eNB_mod=0;
 uint8_t 	    num_UE_mod=0;
-uint8_t 	    num_EXMIMO_mod=0;
-uint8_t 	    num_USRP_mod=0;
-uint8_t             hardware_target=NONE_IF;
-char*               if_name="lo";
+char*           if_name="lo";
+uint8_t         eth_mode=ETH_UDP_MODE;
 
 rrh_module_t 	        *enb_array;
 rrh_module_t            *ue_array;
 
 openair0_vtimestamp 	hw_counter=0;
 
-
-
+char   rf_config_file[1024];
 
 static void debug_init(void);
 static void get_options(int argc, char *argv[]);
@@ -128,14 +126,14 @@ static void print_help(void);
 */
 static rrh_module_t new_module(unsigned int id);
 
-/*!\fn static int get_ip_address(char* if_name)
+/*!\fn static int get_address(char* if_name, uint8_t flag);
  * \brief retrieves IP address from the specified network interface
  * \param[in] name of network interface
  * \return 0 
  * \note
  * @ingroup  _oai
  */
-static int get_ip_address(char* if_name);
+static int get_address(char* if_name, uint8_t flag);
 
 
 
@@ -144,7 +142,7 @@ static int get_ip_address(char* if_name);
 int main(int argc, char **argv) {
   
   unsigned int i;
-  
+  rf_config_file[0]='\0';
   /* parse input arguments */
   get_options(argc, argv);
   /* initialize logger and signal analyzer */
@@ -192,48 +190,53 @@ static rrh_module_t new_module (unsigned int id) {
   rrh_mod.measurements=measurements_flag;
 
   /* each module is associated with an ethernet device */
-  rrh_mod.eth_dev.type=ETH_IF;
+  rrh_mod.eth_dev.type=NONE_DEV;
+  rrh_mod.eth_dev.transp_type=NONE_TP;
   /* ethernet device is functioning within RRH */
-  rrh_mod.eth_dev.func_type=RRH_FUNC; 
-  /* specify IP address */
-  get_ip_address(if_name);
-  openair0_cfg.my_ip=&rrh_ip[0];
-  openair0_cfg.my_port=rrh_port;
+  rrh_mod.eth_dev.host_type=RRH_HOST;
+  /* */
+  rrh_mod.eth_dev.openair0_cfg = (openair0_config_t*)malloc(sizeof(openair0_config_t));
+  memset(rrh_mod.eth_dev.openair0_cfg,0,sizeof(openair0_config_t));
+  /* get IP and MAC address */
+  get_address(if_name,eth_mode);
+  
+  if(eth_mode==ETH_UDP_MODE) {
+    openair0_cfg.my_addr = &rrh_ip[0];
+    openair0_cfg.my_port = rrh_port;
+    LOG_I(RRH,"UDP mode selected for ethernet.\n");
+  } else if (eth_mode==ETH_RAW_MODE) {
+    openair0_cfg.my_addr = &rrh_mac[0];
+    openair0_cfg.my_port = rrh_port;
+    LOG_I(RRH,"RAW mode selected for ethernet.\n");
+  } 
+
+  /* */
+  eth_params_t *eth_params = (eth_params_t*)malloc(sizeof(eth_params_t));
+  memset(eth_params, 0, sizeof(eth_params_t));
+  eth_params->local_if_name     = if_name;
+  eth_params->transp_preference = eth_mode;
 
   /* ethernet device initialization */
-  if (openair0_dev_init_eth(&rrh_mod.eth_dev, &openair0_cfg)<0){
+  if (openair0_transport_load(&rrh_mod.eth_dev, &openair0_cfg,eth_params)<0) {
     LOG_E(RRH,"Exiting, cannot initialize ethernet interface.\n");
     exit(-1);
   }
 
   /* allocate space and specify associated RF device */
   openair0_device *oai_dv = (openair0_device *)malloc(sizeof(openair0_device));
-  memset(oai_dv,0, sizeof(openair0_device));
+  memset(oai_dv,0,sizeof(openair0_device));
 
-#ifdef EXMIMO
   rrh_mod.devs=oai_dv;   
-  rrh_mod.devs->type=EXMIMO_IF;
-  LOG_I(RRH,"Setting RF device to EXMIMO\n");	   
-#elif OAI_USRP
-  rrh_mod.devs=oai_dv;	
-  rrh_mod.devs->type=USRP_B200_IF;
-  LOG_I(RRH,"Setting RF device to USRP\n");    	 
-#elif OAI_BLADERF
-  rrh_mod.devs=oai_dv;	
-  rrh_mod.devs->type=BLADERF_IF;
-  LOG_I(RRH,"Setting RF device to BLADERF\n");
-#else
-  rrh_mod.devs=oai_dv;
-  rrh_mod.devs->type=NONE_IF;
-  LOG_I(RRH,"Setting RF interface to NONE_IF... \n");
-#endif  
-  
+  rrh_mod.devs->type=NONE_DEV;
+  rrh_mod.devs->transp_type=NONE_TP;
+  rrh_mod.devs->host_type=RRH_HOST; 
+
   return rrh_mod;
 }
 
 static void debug_init(void) {
   
-  // log initialization
+  /* log initialization */
   logInit();
   set_glog(glog_level,  glog_verbosity);
   
@@ -241,7 +244,7 @@ static void debug_init(void) {
   //set_comp_log(ENB_LOG, enb_log_level,   enb_log_verbosity, 1);
   //set_comp_log(UE_LOG,  ue_log_level,    ue_log_verbosity,  1);
   
-  // vcd initialization
+  /* vcd initialization */
   if (ouput_vcd) {
     vcd_signal_dumper_init("/tmp/openair_dump_rrh.vcd");
     
@@ -253,7 +256,7 @@ static void get_options(int argc, char *argv[]) {
 
   int 	opt;
 
-  while ((opt = getopt(argc, argv, "xvhlte:n:u:g:r:w:i:")) != -1) {
+  while ((opt = getopt(argc, argv, "xvhlte:n:u:g:r:m:i:f:")) != -1) {
     
     switch (opt) {
     case 'n':
@@ -273,6 +276,9 @@ static void get_options(int argc, char *argv[]) {
 	printf("RRH interface name is set to %s\n", if_name);	
       }
       break;
+    case 'm':  
+      eth_mode=atoi(optarg);      
+      break;
     case 'r':
       //rrh_log_level=atoi(optarg);
       break;
@@ -292,17 +298,27 @@ static void get_options(int argc, char *argv[]) {
       /*In loopback mode rrh sends back to bbu what it receives*/
       loopback_flag=1; 
       break;
+    case 'f':
+      if (optarg){
+	if ((strcmp("null", optarg) == 0) || (strcmp("NULL", optarg) == 0)) {
+	  printf("no configuration filename is provided\n");
+	}
+	else if (strlen(optarg)<=1024){
+	  // rf_config_file = strdup(optarg);
+	  strcpy(rf_config_file,optarg);
+	}else {
+	  printf("Configuration filename is too long\n");
+	  exit(-1);   
+	}
+      }
+      break;
     case 't':
-      /*When measurements are enabled statistics related to TX/RX time are printed*/
+      /* When measurements are enabled statistics related to TX/RX time are printed */
       measurements_flag=1; 
-      break;
-    case 'w':
-      /* force to use this target*/    
-      hardware_target=1;
-      break;
-  case 'h':
-    print_help();
-    exit(-1);
+      break;      
+    case 'h':
+      print_help();
+      exit(-1);
     default: /* '?' */
       //fprintf(stderr, "Usage: \n", argv[0]);
       exit(-1);
@@ -311,31 +327,34 @@ static void get_options(int argc, char *argv[]) {
 
 }
 
-static int get_ip_address(char* if_name) {
+static int get_address(char* if_name, uint8_t flag) {
   
   int fd;
   struct ifreq ifr;
-  
-  
-  fd = socket(AF_INET, SOCK_DGRAM, 0);
-  
+    
+  fd = socket(AF_INET, SOCK_DGRAM, 0);  
   /* I want to get an IPv4 IP address */
-  ifr.ifr_addr.sa_family = AF_INET;
-  
+  ifr.ifr_addr.sa_family = AF_INET;  
   /* I want IP address attached to "if_name" */
   strncpy(ifr.ifr_name, if_name, IFNAMSIZ-1);
-  
-  if ( ioctl(fd, SIOCGIFADDR, &ifr)<0 ) {
-    perror("IOCTL:");
-    exit(-1);
-  } 
+
+  if (flag==ETH_UDP_MODE) {
+    if ( ioctl(fd, SIOCGIFADDR, &ifr)<0 ) {
+      perror("IOCTL:");
+      exit(-1);
+    } 
+    snprintf(&rrh_ip[0],20,"%s", inet_ntoa(((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr));
+    LOG_I(RRH,"%s: IP address: %s\n",if_name,rrh_ip);
+  } else if (flag==ETH_RAW_MODE) {
+    if ( ioctl(fd, SIOCGIFHWADDR, &ifr)<0 ) {
+      perror("IOCTL:");
+      exit(-1);
+    } 
+    ether_ntoa_r ((unsigned char *)ifr.ifr_hwaddr.sa_data, rrh_mac);
+    LOG_I(RRH,"%s: MAC address: %s\n",if_name,rrh_mac);    
+  }
   
   close(fd);
-  
-  /* display result */
-  snprintf(&rrh_ip[0],20,"%s", inet_ntoa(((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr));
-  LOG_I(RRH,"Got IP address %s from interface %s\n", rrh_ip,if_name);
-
   return 0;
 }
 
@@ -343,19 +362,19 @@ static int get_ip_address(char* if_name) {
 static void print_help(void) {
 
   puts("Usage: \n");
-  puts("     sudo -E chrt 99 ./rrh -n1 -g6 -v -t");
+  puts("     sudo -E chrt 99 ./rrh -n1 -g6 -v -t -i lo -m1");
   puts("Options:\n");
   puts("\t -n create eNB module\n");
   puts("\t -u create UE module\n");
   puts("\t -g define global log level\n");
   puts("\t -i set the RRH interface (default lo)\n");
+  puts("\t -m set ethernet mode to be used by RRH, valid options: (1:raw, 0:udp) \n");
   puts("\t -r define rrh log level\n");
   puts("\t -e define eNB log level\n");
   puts("\t -x enable real time bahaviour\n");
   puts("\t -v enable vcd dump\n");
   puts("\t -l enable loopback mode\n");
   puts("\t -t enable measurements\n");
-  puts("\t -w force to use specified HW\n");
   puts("\t -h display info\n");
 
 }
@@ -368,7 +387,7 @@ void *timer_proc(void *arg) {
   struct itimerspec   *old_value;
 
   
-#ifdef LOWLATENCY
+#ifdef DEADLINE_SCHEDULER
   struct sched_attr attr;
   unsigned int flags = 0;
   
diff --git a/targets/RT/USER/rrh_gw_externs.h b/targets/RT/USER/rrh_gw_externs.h
index 8d2d1d7e5e8484a8bc697efc297d7404e24355a0..df59b9b1af323e4786a1280bc129dd582241318f 100644
--- a/targets/RT/USER/rrh_gw_externs.h
+++ b/targets/RT/USER/rrh_gw_externs.h
@@ -39,6 +39,7 @@
 
 #ifndef RRH_GW_EXTERNS_H_
 #define RRH_GW_EXTERNS_H_
+extern char   rf_config_file[1024];
 
 extern openair0_timestamp 	timestamp_UE_tx[4] ,timestamp_UE_rx[4] ,timestamp_eNB_rx[4],timestamp_eNB_tx[4];
 extern openair0_vtimestamp 	hw_counter;
diff --git a/targets/RT/USER/rt_wrapper.c b/targets/RT/USER/rt_wrapper.c
index 0242dab3d82a18382e12ac69c31b872e09b8b267..ed9eb4e79833152366c9dbc2109afd1437589b86 100644
--- a/targets/RT/USER/rt_wrapper.c
+++ b/targets/RT/USER/rt_wrapper.c
@@ -28,7 +28,7 @@
  *******************************************************************************/
 
 /*! \file rt_wrapper.h
-* \brief provides a wrapper for the timing function, runtime calculations for real-time opeartions depending on weather RTAI or LOWLATENCY kernels are used or not
+* \brief provides a wrapper for the timing function, runtime calculations for real-time opeartions depending on weather RTAI or DEADLINE_SCHEDULER kernels are used or not
 * \author F. Kaltenberger and Navid Nikaein
 * \date 2013
 * \version 0.1
@@ -38,6 +38,10 @@
 * \warning
 */
 
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
 #include "rt_wrapper.h"
 static int latency_target_fd = -1;
 static int32_t latency_target_value = 0;
@@ -154,6 +158,7 @@ int fill_modeled_runtime_table(uint16_t runtime_phy_rx[29][6],
       runtime_phy_tx[i][j] = cell_processing_dl[j] + platform_processing_dl + user_processing_dl_err[j] + user_processing_dl_a[j]*i+  user_processing_dl_b[j];
     }
   }
+  return 0;
 }
  
 // int runtime_upper_layers[6]; // values for different RBs
@@ -236,7 +241,7 @@ double get_runtime_rx(int rx_subframe, uint16_t runtime_phy_rx[29][6], uint32_t
    return runtime;	
 }
 
-#ifdef LOWLATENCY
+#ifdef DEADLINE_SCHEDULER
 int sched_setattr(pid_t pid, const struct sched_attr *attr, unsigned int flags)
 {
 
diff --git a/targets/RT/USER/rt_wrapper.h b/targets/RT/USER/rt_wrapper.h
index 88a3d96efa88f70246146fd0279a3b39c103242e..d67632054b7ee2a14f7c555b7d509452d1851bba 100644
--- a/targets/RT/USER/rt_wrapper.h
+++ b/targets/RT/USER/rt_wrapper.h
@@ -72,7 +72,7 @@ double get_runtime_rx(int rx_subframe, uint16_t runtime_phy_rx[29][6], uint32_t
  * see https://www.kernel.org/doc/Documentation/scheduler/sched-deadline.txt  or
  * http://www.blaess.fr/christophe/2014/04/05/utiliser-un-appel-systeme-inconnu-de-la-libc/
  */
-#ifdef LOWLATENCY
+#ifdef DEADLINE_SCHEDULER
 
 #define gettid() syscall(__NR_gettid)
 
diff --git a/targets/RT/USER/sched_dlsch.c b/targets/RT/USER/sched_dlsch.c
index d582e79310486bfbcd7fb4447dbb13e46b25e2cd..48fac642a9c1b63d52425ef6b97657c2c81fc724 100644
--- a/targets/RT/USER/sched_dlsch.c
+++ b/targets/RT/USER/sched_dlsch.c
@@ -51,14 +51,6 @@
 
 #include "SCHED/defs.h"
 
-#include "MAC_INTERFACE/extern.h"
-
-#ifdef CBMIMO1
-#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h"
-#include "ARCH/CBMIMO1/DEVICE_DRIVER/extern.h"
-#include "ARCH/CBMIMO1/DEVICE_DRIVER/defs.h"
-#endif // CBMIMO1
-
 #include "UTIL/LOG/vcd_signal_dumper.h"
 
 #define DEBUG_PHY
diff --git a/targets/RT/USER/sched_rx_pdsch.c b/targets/RT/USER/sched_rx_pdsch.c
index be1ffbd752611f818ccf96bd6aa75a4ae32e3cfe..e792fe737d936c2fb21f981cc52be3d957a67c86 100644
--- a/targets/RT/USER/sched_rx_pdsch.c
+++ b/targets/RT/USER/sched_rx_pdsch.c
@@ -51,8 +51,6 @@
 #include "SCHED/defs.h"
 #include "SCHED/extern.h"
 
-#include "MAC_INTERFACE/extern.h"
-
 #include "UTIL/LOG/vcd_signal_dumper.h"
 
 RTIME time0,time1;
diff --git a/targets/RT/USER/ue_usrp.gtkw b/targets/RT/USER/ue_usrp.gtkw
new file mode 100644
index 0000000000000000000000000000000000000000..81940b564362944ca250a9c66d54866861c5290a
--- /dev/null
+++ b/targets/RT/USER/ue_usrp.gtkw
@@ -0,0 +1,53 @@
+[*]
+[*] GTKWave Analyzer v3.3.58 (w)1999-2014 BSI
+[*] Sun Mar 20 18:27:06 2016
+[*]
+[dumpfile] "/tmp/openair_dump_UE.vcd"
+[dumpfile_mtime] "Sun Mar 20 18:14:17 2016"
+[dumpfile_size] 92262400
+[savefile] "/home/papillon/openairinterface5g/targets/RT/USER/ue_usrp.gtkw"
+[timestart] 30032830000
+[size] 1215 640
+[pos] 105 102
+*-22.292629 30041590000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
+[sst_width] 224
+[signals_width] 262
+[sst_expanded] 1
+[sst_vpaned_height] 155
+@24
+variables.hw_subframe[63:0]
+@28
+functions.trx_read
+functions.trx_write
+@24
+variables.subframe_number_RX_UE[63:0]
+variables.subframe_number_TX_UE[63:0]
+@28
+functions.ue_thread_rx
+functions.ue_thread_tx
+@420
+variables.ue_inst_cnt_rx[63:0]
+variables.ue_inst_cnt_tx[63:0]
+@28
+functions.phy_procedures_ue_rx
+functions.phy_procedures_ue_tx
+@24
+variables.frame_number_RX_UE[63:0]
+variables.frame_number_TX_UE[63:0]
+@28
+functions.ue_slot_fep
+functions.lte_ue_measurement_procedures
+functions.ue_rrc_measurements
+functions.ue_gain_control
+functions.ue_adjust_synch
+functions.lte_ue_pbch_procedures
+functions.lte_ue_pdcch_procedures
+functions.rx_pdcch
+functions.dci_decoding
+functions.phy_ue_generate_prach
+functions.phy_ue_ulsch_encoding
+functions.phy_ue_ulsch_modulation
+functions.phy_ue_ulsch_scrambling
+functions.phy_ue_config_sib2
+[pattern_trace] 1
+[pattern_trace] 0
diff --git a/targets/SIMU/USER/channel_sim.c b/targets/SIMU/USER/channel_sim.c
index bba32a5a29b0d7bdf0f48c7bf50edcd546125696..187f1109c0fb8fad67259bf2a69e871ebb3447b6 100644
--- a/targets/SIMU/USER/channel_sim.c
+++ b/targets/SIMU/USER/channel_sim.c
@@ -39,7 +39,6 @@
 #include "PHY/types.h"
 #include "PHY/defs.h"
 #include "PHY/extern.h"
-#include "MAC_INTERFACE/extern.h"
 
 #ifdef OPENAIR2
 #include "LAYER2/MAC/defs.h"
@@ -97,7 +96,7 @@ void do_DL_sig(double **r_re0,double **r_im0,
   double rx_pwr;
   int32_t rx_pwr2;
   uint32_t i,aa;
-  uint32_t slot_offset,slot_offset_meas;
+  uint32_t slot_offset,slot_offset_meas = 0;
 
   double min_path_loss=-200;
   uint8_t hold_channel=0;
@@ -105,7 +104,7 @@ void do_DL_sig(double **r_re0,double **r_im0,
   uint8_t nb_antennas_rx = eNB2UE[0][0][CC_id]->nb_rx; // number of rx antennas at UE
   uint8_t nb_antennas_tx = eNB2UE[0][0][CC_id]->nb_tx; // number of tx antennas at eNB
 
-  LTE_DL_FRAME_PARMS *fp;
+  //LTE_DL_FRAME_PARMS *fp;
   //  int subframe_sched = ((next_slot>>1) == 0) ? 9 : ((next_slot>>1)-1);
 
 
@@ -169,8 +168,6 @@ void do_DL_sig(double **r_re0,double **r_im0,
       int32_t **dl_channel_est = PHY_vars_UE_g[UE_id][CC_id]->lte_ue_common_vars.dl_ch_estimates[0];
       //      double scale = pow(10.0,(enb_data[att_eNB_id]->tx_power_dBm + eNB2UE[att_eNB_id][UE_id]->path_loss_dB + (double) PHY_vars_UE_g[UE_id]->rx_total_gain_dB)/20.0);
       double scale = pow(10.0,(frame_parms->pdsch_config_common.referenceSignalPower+eNB2UE[att_eNB_id][UE_id][CC_id]->path_loss_dB + (double) PHY_vars_UE_g[UE_id][CC_id]->rx_total_gain_dB)/20.0);
-      //this factor is not really needed (it was actually wrong in the non abstraction mode)
-      //scale = scale * sqrt(512.0/300.0); //TODO: make this variable for all BWs
       LOG_D(OCM,"scale =%lf (%d dB)\n",scale,(int) (20*log10(scale)));
       // freq_channel(desc1,frame_parms->N_RB_DL,nb_samples);
       //write_output("channel.m","ch",desc1->ch[0],desc1->channel_length,1,8);
@@ -204,12 +201,13 @@ void do_DL_sig(double **r_re0,double **r_im0,
 
       // calculate the SNR for the attached eNB (this assumes eNB always uses PMI stored in eNB_UE_stats; to be improved)
       init_snr(eNB2UE[att_eNB_id][UE_id][CC_id], enb_data[att_eNB_id], ue_data[UE_id], PHY_vars_UE_g[UE_id][CC_id]->sinr_dB, &PHY_vars_UE_g[UE_id][CC_id]->N0,
-               PHY_vars_UE_g[UE_id][CC_id]->transmission_mode[att_eNB_id], PHY_vars_eNB_g[att_eNB_id][CC_id]->eNB_UE_stats[UE_id].DL_pmi_single,PHY_vars_eNB_g[att_eNB_id][CC_id]->mu_mimo_mode[UE_id].dl_pow_off);
+               PHY_vars_UE_g[UE_id][CC_id]->transmission_mode[att_eNB_id], PHY_vars_eNB_g[att_eNB_id][CC_id]->eNB_UE_stats[UE_id].DL_pmi_single,
+	       PHY_vars_eNB_g[att_eNB_id][CC_id]->mu_mimo_mode[UE_id].dl_pow_off,PHY_vars_eNB_g[att_eNB_id][CC_id]->lte_frame_parms.N_RB_DL);
 
       // calculate sinr here
       for (eNB_id = 0; eNB_id < NB_eNB_INST; eNB_id++) {
         if (att_eNB_id != eNB_id) {
-          calculate_sinr(eNB2UE[eNB_id][UE_id][CC_id], enb_data[eNB_id], ue_data[UE_id], PHY_vars_UE_g[UE_id][CC_id]->sinr_dB);
+          calculate_sinr(eNB2UE[eNB_id][UE_id][CC_id], enb_data[eNB_id], ue_data[UE_id], PHY_vars_UE_g[UE_id][CC_id]->sinr_dB,PHY_vars_eNB_g[att_eNB_id][CC_id]->lte_frame_parms.N_RB_DL);
         }
       }
     } // hold channel
@@ -220,18 +218,6 @@ void do_DL_sig(double **r_re0,double **r_im0,
        Call do_OFDM_mod from phy_procedures_eNB_TX function
     */
 
-
-
-    //for (UE_id=0;UE_id<NB_UE_INST;UE_id++) {
-    // Compute RX signal for UE = UE_id
-    /*
-    for (i=0;i<(frame_parms->samples_per_tti>>1);i++) {
-    for (aa=0;aa<nb_antennas_rx;aa++) {
-    r_re[aa][i]=0.0;
-    r_im[aa][i]=0.0;
-    }
-    }
-    */
     //      printf("r_re[0] %p\n",r_re[0]);
     for (aa=0; aa<nb_antennas_rx; aa++) {
       memset((void*)r_re[aa],0,(frame_parms->samples_per_tti>>1)*sizeof(double));
diff --git a/targets/SIMU/USER/event_handler.c b/targets/SIMU/USER/event_handler.c
index 4072c6bfe776f493f2d4c78de4f5b1e78c622bf4..1f7ecde72e72671d636a5d3b8475cd985a1999e2 100644
--- a/targets/SIMU/USER/event_handler.c
+++ b/targets/SIMU/USER/event_handler.c
@@ -208,15 +208,15 @@ void schedule_events()
 
   a = 5;
 
-  uint16_t *priority[11];//={1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2};
+  //uint16_t *priority[11];//={1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2};
 
 
-  int tab[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX];
+  //int tab[NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX];
   Application_Config* application_config;
   application_config = malloc(sizeof(Application_Config));
 
   for(i=0; i<NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX; i++) {
-    tab[i]=i;
+    //tab[i]=i;
     application_config->customized_traffic.aggregation_level[i]=i;
   }
 
@@ -249,7 +249,7 @@ void schedule_events()
   //schedule(READ, MAC_ET, 500, NULL, "");
   //schedule(WRITE, MAC_ET, 100, NULL, "");
   //schedule(READ, TOPO_ET,110,NULL,"",0,0);
-  double b = (double) 45;
+  //double b = (double) 45;
   //schedule(READ, APP_ET,111,NULL,"",0,0);
   //schedule(READ, SYS_ET,112,NULL,"",0,0);
   //schedule(READ, EMU_ET,113,NULL,"",-1,-1);
@@ -1844,7 +1844,6 @@ void update_emu_model(Event_t event)
   printf("\n\n\nA NEW EMU MODEL\n\n\n");
   OAI_Emulation *oai_emulation;
   oai_emulation = get_OAI_emulation();
-  int i=0;
 
   if(event.optype == READ) {
     if(event.key == NULL) {
diff --git a/targets/SIMU/USER/init_lte.c b/targets/SIMU/USER/init_lte.c
index d798b0968a1d6a36a7dba32c5187c6add11d96b9..861bfa6cbf9bd0eab11a964f4f584086b96a042c 100644
--- a/targets/SIMU/USER/init_lte.c
+++ b/targets/SIMU/USER/init_lte.c
@@ -38,14 +38,11 @@
 #include "init_lte.h"
 
 #include "PHY/extern.h"
-#include "MAC_INTERFACE/extern.h"
 
-#ifdef OPENAIR2
 #include "LAYER2/MAC/defs.h"
 #include "LAYER2/MAC/extern.h"
 #include "UTIL/LOG/log_if.h"
 #include "PHY_INTERFACE/extern.h"
-#endif
 
 
 
@@ -76,7 +73,7 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
 
   for (i=0; i<NUMBER_OF_UE_MAX; i++) {
     for (j=0; j<2; j++) {
-      PHY_vars_eNB->dlsch_eNB[i][j] = new_eNB_dlsch(1,NUMBER_OF_HARQ_PID_MAX,frame_parms->N_RB_DL,abstraction_flag);
+      PHY_vars_eNB->dlsch_eNB[i][j] = new_eNB_dlsch(1,8,NSOFT,frame_parms->N_RB_DL,abstraction_flag);
 
       if (!PHY_vars_eNB->dlsch_eNB[i][j]) {
         LOG_E(PHY,"Can't get eNB dlsch structures for UE %d \n", i);
@@ -87,7 +84,7 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
       }
     }
 
-    PHY_vars_eNB->ulsch_eNB[1+i] = new_eNB_ulsch(NUMBER_OF_HARQ_PID_MAX,MAX_TURBO_ITERATIONS, frame_parms->N_RB_UL, abstraction_flag);
+    PHY_vars_eNB->ulsch_eNB[1+i] = new_eNB_ulsch(MAX_TURBO_ITERATIONS,frame_parms->N_RB_UL, abstraction_flag);
 
     if (!PHY_vars_eNB->ulsch_eNB[1+i]) {
       LOG_E(PHY,"Can't get eNB ulsch structures\n");
@@ -121,18 +118,18 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
   }
 
   // ULSCH for RA
-  PHY_vars_eNB->ulsch_eNB[0] = new_eNB_ulsch(NUMBER_OF_HARQ_PID_MAX,MAX_TURBO_ITERATIONS, frame_parms->N_RB_UL, abstraction_flag);
+  PHY_vars_eNB->ulsch_eNB[0] = new_eNB_ulsch(MAX_TURBO_ITERATIONS, frame_parms->N_RB_UL, abstraction_flag);
 
   if (!PHY_vars_eNB->ulsch_eNB[0]) {
     LOG_E(PHY,"Can't get eNB ulsch structures\n");
     exit(-1);
   }
 
-  PHY_vars_eNB->dlsch_eNB_SI  = new_eNB_dlsch(1,1,frame_parms->N_RB_DL, abstraction_flag);
+  PHY_vars_eNB->dlsch_eNB_SI  = new_eNB_dlsch(1,8,NSOFT,frame_parms->N_RB_DL, abstraction_flag);
   LOG_D(PHY,"eNB %d : SI %p\n",eNB_id,PHY_vars_eNB->dlsch_eNB_SI);
-  PHY_vars_eNB->dlsch_eNB_ra  = new_eNB_dlsch(1,1,frame_parms->N_RB_DL, abstraction_flag);
+  PHY_vars_eNB->dlsch_eNB_ra  = new_eNB_dlsch(1,8,NSOFT,frame_parms->N_RB_DL, abstraction_flag);
   LOG_D(PHY,"eNB %d : RA %p\n",eNB_id,PHY_vars_eNB->dlsch_eNB_ra);
-  PHY_vars_eNB->dlsch_eNB_MCH = new_eNB_dlsch(1,NUMBER_OF_HARQ_PID_MAX,frame_parms->N_RB_DL, 0);
+  PHY_vars_eNB->dlsch_eNB_MCH = new_eNB_dlsch(1,8,NSOFT,frame_parms->N_RB_DL, 0);
   LOG_D(PHY,"eNB %d : MCH %p\n",eNB_id,PHY_vars_eNB->dlsch_eNB_MCH);
 
 
@@ -169,7 +166,7 @@ PHY_VARS_UE* init_lte_UE(LTE_DL_FRAME_PARMS *frame_parms,
 
   for (i=0; i<NUMBER_OF_CONNECTED_eNB_MAX; i++) {
     for (j=0; j<2; j++) {
-      PHY_vars_UE->dlsch_ue[i][j]  = new_ue_dlsch(1,NUMBER_OF_HARQ_PID_MAX,MAX_TURBO_ITERATIONS,frame_parms->N_RB_DL, abstraction_flag);
+      PHY_vars_UE->dlsch_ue[i][j]  = new_ue_dlsch(1,NUMBER_OF_HARQ_PID_MAX,NSOFT,MAX_TURBO_ITERATIONS,frame_parms->N_RB_DL, abstraction_flag);
 
       if (!PHY_vars_UE->dlsch_ue[i][j]) {
         LOG_E(PHY,"Can't get ue dlsch structures\n");
@@ -180,22 +177,22 @@ PHY_VARS_UE* init_lte_UE(LTE_DL_FRAME_PARMS *frame_parms,
 
 
 
-    PHY_vars_UE->ulsch_ue[i]  = new_ue_ulsch(NUMBER_OF_HARQ_PID_MAX,frame_parms->N_RB_UL, abstraction_flag);
+    PHY_vars_UE->ulsch_ue[i]  = new_ue_ulsch(frame_parms->N_RB_UL, abstraction_flag);
 
     if (!PHY_vars_UE->ulsch_ue[i]) {
       LOG_E(PHY,"Can't get ue ulsch structures\n");
       exit(-1);
     }
 
-    PHY_vars_UE->dlsch_ue_SI[i]  = new_ue_dlsch(1,1,MAX_TURBO_ITERATIONS,frame_parms->N_RB_DL, abstraction_flag);
-    PHY_vars_UE->dlsch_ue_ra[i]  = new_ue_dlsch(1,1,MAX_TURBO_ITERATIONS,frame_parms->N_RB_DL, abstraction_flag);
+    PHY_vars_UE->dlsch_ue_SI[i]  = new_ue_dlsch(1,1,NSOFT,MAX_TURBO_ITERATIONS,frame_parms->N_RB_DL, abstraction_flag);
+    PHY_vars_UE->dlsch_ue_ra[i]  = new_ue_dlsch(1,1,NSOFT,MAX_TURBO_ITERATIONS,frame_parms->N_RB_DL, abstraction_flag);
 
     PHY_vars_UE->transmission_mode[i] = transmission_mode;
   }
 
   PHY_vars_UE->lte_frame_parms.pucch_config_common.deltaPUCCH_Shift = 1;
 
-  PHY_vars_UE->dlsch_ue_MCH[0]  = new_ue_dlsch(1,NUMBER_OF_HARQ_PID_MAX,MAX_TURBO_ITERATIONS_MBSFN,frame_parms->N_RB_DL,0);
+  PHY_vars_UE->dlsch_ue_MCH[0]  = new_ue_dlsch(1,NUMBER_OF_HARQ_PID_MAX,NSOFT,MAX_TURBO_ITERATIONS_MBSFN,frame_parms->N_RB_DL,0);
 
   return (PHY_vars_UE);
 }
@@ -211,11 +208,11 @@ PHY_VARS_RN* init_lte_RN(LTE_DL_FRAME_PARMS *frame_parms,
 
   if (eMBMS_active_state == multicast_relay) {
     for (i=0; i < 10 ; i++) { // num SF in a frame
-      PHY_vars_RN->dlsch_rn_MCH[i] = new_ue_dlsch(1,1,MAX_TURBO_ITERATIONS_MBSFN,frame_parms->N_RB_DL, 0);
+      PHY_vars_RN->dlsch_rn_MCH[i] = new_ue_dlsch(1,1,NSOFT,MAX_TURBO_ITERATIONS_MBSFN,frame_parms->N_RB_DL, 0);
       LOG_D(PHY,"eNB %d : MCH[%d] %p\n",RN_id,i,PHY_vars_RN->dlsch_rn_MCH[i]);
     }
   } else {
-    PHY_vars_RN->dlsch_rn_MCH[0] = new_ue_dlsch(1,1,MAX_TURBO_ITERATIONS,frame_parms->N_RB_DL, 0);
+    PHY_vars_RN->dlsch_rn_MCH[0] = new_ue_dlsch(1,1,NSOFT,MAX_TURBO_ITERATIONS,frame_parms->N_RB_DL, 0);
     LOG_D(PHY,"eNB %d : MCH[0] %p\n",RN_id,PHY_vars_RN->dlsch_rn_MCH[0]);
   }
 
@@ -250,6 +247,7 @@ void init_lte_vars(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs],
     (frame_parms[CC_id])->phich_config_common.phich_resource = oneSixth;
     (frame_parms[CC_id])->phich_config_common.phich_duration = normal;
     (frame_parms[CC_id])->Ncp                = extended_prefix_flag;
+    (frame_parms[CC_id])->Ncp_UL             = extended_prefix_flag; 
     (frame_parms[CC_id])->Nid_cell           = Nid_cell;
     (frame_parms[CC_id])->nushift            = (Nid_cell%6);
     (frame_parms[CC_id])->nb_antennas_tx     = (transmission_mode == 1) ? 1 : 2;
diff --git a/targets/SIMU/USER/oaisim.c b/targets/SIMU/USER/oaisim.c
index c1d4d64ef69b5414b336f0fc363918545575cee9..744952b5d0d23d4affe9cea28653a4d959404c7d 100644
--- a/targets/SIMU/USER/oaisim.c
+++ b/targets/SIMU/USER/oaisim.c
@@ -53,7 +53,6 @@
 #include "PHY/defs.h"
 #include "PHY/LTE_TRANSPORT/proto.h"
 #include "PHY/vars.h"
-#include "MAC_INTERFACE/vars.h"
 
 #include "SIMULATION/ETH_TRANSPORT/proto.h"
 
@@ -75,9 +74,9 @@
 #include "SCHED/defs.h"
 #include "SCHED/vars.h"
 
-#ifdef XFORMS
+//#ifdef XFORMS
 #include "PHY/TOOLS/lte_phy_scope.h"
-#endif
+//#endif
 
 #ifdef SMBV
 // Rohde&Schwarz SMBV100A vector signal generator
@@ -114,6 +113,8 @@ char smbv_ip[16];
 # include "create_tasks.h"
 #endif
 
+#include "T.h"
+
 /*
  DCI0_5MHz_TDD0_t          UL_alloc_pdu;
  DCI1A_5MHz_TDD_1_6_t      CCCH_alloc_pdu;
@@ -163,9 +164,10 @@ extern uint16_t Nid_cell;
 
 extern LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
 
-#ifdef XFORMS
+//#ifdef XFORMS
 int otg_enabled;
-#endif
+int xforms=0;
+//#endif
 
 time_stats_t oaisim_stats;
 time_stats_t oaisim_stats_f;
@@ -245,6 +247,11 @@ help (void)
   printf ("-Y Set the global log verbosity (none, low, medium, high, full) \n");
   printf ("-z Set the cooperation flag (0 for no cooperation, 1 for delay diversity and 2 for distributed alamouti\n");
   printf ("-Z Reserved\n");
+#if T_TRACER
+  printf ("--T_port [port]    use given port\n");
+  printf ("--T_nowait         don't wait for tracer, start immediately\n");
+  printf ("--T_dont_fork      to ease debugging with gdb\n");
+#endif
 }
 
 pthread_t log_thread;
@@ -446,17 +453,19 @@ l2l1_task (void *args_p)
   char fname[64], vname[64];
   int sf;
   protocol_ctxt_t  ctxt;
-#ifdef XFORMS
+  //#ifdef XFORMS
   // current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0)
   // at eNB 0, an UL scope for every UE
-  FD_lte_phy_scope_ue *form_ue[NUMBER_OF_UE_MAX];
+  FD_lte_phy_scope_ue *form_ue[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
   FD_lte_phy_scope_enb *form_enb[NUMBER_OF_UE_MAX];
   char title[255];
   char xname[32] = "oaisim";
   int xargc = 1;
   char *xargv[1];
-#endif
+  //#endif
 
+#undef PRINT_STATS /* this undef is to avoid gcc warnings */
+#define PRINT_STATS
 #ifdef PRINT_STATS
   int len;
   FILE *UE_stats[NUMBER_OF_UE_MAX];
@@ -485,31 +494,34 @@ l2l1_task (void *args_p)
       PHY_vars_eNB_g[eNB_inst][CC_id]->proc[9].frame_tx = 1;
     }
 
-#ifdef XFORMS
-  xargv[0] = xname;
-  fl_initialize (&xargc, xargv, NULL, 0, 0);
-  eNB_inst = 0;
-
-  for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++) {
-    // DL scope at UEs
-    form_ue[UE_inst] = create_lte_phy_scope_ue();
-    sprintf (title, "LTE DL SCOPE eNB %d to UE %d", eNB_inst, UE_inst);
-    fl_show_form (form_ue[UE_inst]->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
-
-    // UL scope at eNB 0
-    form_enb[UE_inst] = create_lte_phy_scope_enb();
-    sprintf (title, "LTE UL SCOPE UE %d to eNB %d", UE_inst, eNB_inst);
-    fl_show_form (form_enb[UE_inst]->lte_phy_scope_enb, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
-
-    if (openair_daq_vars.use_ia_receiver == 1) {
-      fl_set_button(form_ue[UE_inst]->button_0,1);
-      fl_set_object_label(form_ue[UE_inst]->button_0, "IA Receiver ON");
-      fl_set_object_color(form_ue[UE_inst]->button_0, FL_GREEN, FL_GREEN);
+  //#ifdef XFORMS
+  if (xforms==1) {
+    xargv[0] = xname;
+    fl_initialize (&xargc, xargv, NULL, 0, 0);
+    eNB_inst = 0;
+    
+    for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++) {
+      for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
+	// DL scope at UEs
+	form_ue[CC_id][UE_inst] = create_lte_phy_scope_ue();
+	sprintf (title, "LTE DL SCOPE eNB %d to UE %d CC_id %d", eNB_inst, UE_inst, CC_id);
+	fl_show_form (form_ue[CC_id][UE_inst]->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
+
+	if (openair_daq_vars.use_ia_receiver == 1) {
+	  fl_set_button(form_ue[CC_id][UE_inst]->button_0,1);
+	  fl_set_object_label(form_ue[CC_id][UE_inst]->button_0, "IA Receiver ON");
+	  fl_set_object_color(form_ue[CC_id][UE_inst]->button_0, FL_GREEN, FL_GREEN);
+	}
+	
+      }
+      // UL scope at eNB 0
+      form_enb[UE_inst] = create_lte_phy_scope_enb();
+      sprintf (title, "LTE UL SCOPE UE %d to eNB %d", UE_inst, eNB_inst);
+      fl_show_form (form_enb[UE_inst]->lte_phy_scope_enb, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
+      
     }
-
   }
-
-#endif
+  //#endif
 
 #ifdef PRINT_STATS
 
@@ -525,19 +537,23 @@ l2l1_task (void *args_p)
 
   if(abstraction_flag==0) {
     for (UE_inst=0; UE_inst<NB_UE_INST; UE_inst++) {
-      sprintf(UE_stats_th_filename,"UE_stats_th%d_tx%d.txt",UE_inst,oai_emulation.info.transmission_mode);
+      /* TODO: transmission_mode is defined per CC, we set 0 for now */
+      sprintf(UE_stats_th_filename,"UE_stats_th%d_tx%d.txt",UE_inst,oai_emulation.info.transmission_mode[0]);
       UE_stats_th[UE_inst] = fopen (UE_stats_th_filename, "w");
     }
 
-    sprintf(eNB_stats_th_filename,"eNB_stats_th_tx%d.txt",oai_emulation.info.transmission_mode);
+    /* TODO: transmission_mode is defined per CC, we set 0 for now */
+    sprintf(eNB_stats_th_filename,"eNB_stats_th_tx%d.txt",oai_emulation.info.transmission_mode[0]);
     eNB_avg_thr = fopen (eNB_stats_th_filename, "w");
   } else {
     for (UE_inst=0; UE_inst<NB_UE_INST; UE_inst++) {
-      sprintf(UE_stats_th_filename,"UE_stats_abs_th%d_tx%d.txt",UE_inst,oai_emulation.info.transmission_mode);
+      /* TODO: transmission_mode is defined per CC, we set 0 for now */
+      sprintf(UE_stats_th_filename,"UE_stats_abs_th%d_tx%d.txt",UE_inst,oai_emulation.info.transmission_mode[0]);
       UE_stats_th[UE_inst] = fopen (UE_stats_th_filename, "w");
     }
 
-    sprintf(eNB_stats_th_filename,"eNB_stats_abs_th_tx%d.txt",oai_emulation.info.transmission_mode);
+    /* TODO: transmission_mode is defined per CC, we set 0 for now */
+    sprintf(eNB_stats_th_filename,"eNB_stats_abs_th_tx%d.txt",oai_emulation.info.transmission_mode[0]);
     eNB_avg_thr = fopen (eNB_stats_th_filename, "w");
   }
 
@@ -599,8 +615,9 @@ l2l1_task (void *args_p)
   start_meas (&oaisim_stats);
 
   for (frame = 0;
-       (l2l1_state != L2L1_TERMINATED)
-       && (frame < oai_emulation.info.n_frames);
+       (l2l1_state != L2L1_TERMINATED) &&
+	 ((oai_emulation.info.n_frames_flag == 0) ||
+	  (frame < oai_emulation.info.n_frames));
        frame++) {
 
 #if defined(ENABLE_ITTI)
@@ -662,12 +679,6 @@ l2l1_task (void *args_p)
     //oai_emulation.info.time_ms += 1;
     oai_emulation.info.time_s += 0.01; // emu time in s, each frame lasts for 10 ms // JNote: TODO check the coherency of the time and frame (I corrected it to 10 (instead of 0.01)
 
-    // if n_frames not set by the user or is greater than max num frame then set adjust the frame counter
-    if ((oai_emulation.info.n_frames_flag == 0)
-        || (oai_emulation.info.n_frames >= 0xffff)) {
-      frame %= (oai_emulation.info.n_frames - 1);
-    }
-
     update_omg (frame); // frequency is defined in the omg_global params configurable by the user
 
     update_omg_ocm ();
@@ -699,7 +710,7 @@ l2l1_task (void *args_p)
       wait_for_slot_isr ();
 
 #if defined(ENABLE_ITTI)
-      itti_update_lte_time(frame, slot);
+      itti_update_lte_time(frame % MAX_FRAME_NUMBER, slot);
 #endif
 
       last_slot = (slot - 1) % 20;
@@ -735,17 +746,19 @@ l2l1_task (void *args_p)
                  + oai_emulation.info.nb_enb_local));
              eNB_inst++) {
           if (oai_emulation.info.cli_start_enb[eNB_inst] != 0) {
-            if ((slot & 1) == 0)
+            if ((slot & 1) == 0) {
+              T(T_ENB_MASTER_TICK, T_INT(eNB_inst), T_INT(frame % 1024), T_INT(slot/2));
               LOG_D(EMU,
                     "PHY procedures eNB %d for frame %d, slot %d (subframe TX %d, RX %d) TDD %d/%d Nid_cell %d\n",
                     eNB_inst,
-                    frame,
+                    frame % MAX_FRAME_NUMBER,
                     slot,
                     PHY_vars_eNB_g[eNB_inst][0]->proc[slot >> 1].subframe_tx,
                     PHY_vars_eNB_g[eNB_inst][0]->proc[slot >> 1].subframe_rx,
                     PHY_vars_eNB_g[eNB_inst][0]->lte_frame_parms.frame_type,
                     PHY_vars_eNB_g[eNB_inst][0]->lte_frame_parms.tdd_config,
                     PHY_vars_eNB_g[eNB_inst][0]->lte_frame_parms.Nid_cell);
+            }
 
 #ifdef OPENAIR2
                         //Application: traffic gen
@@ -814,27 +827,27 @@ l2l1_task (void *args_p)
             {
               LOG_D(EMU,
                     "PHY procedures UE %d for frame %d, slot %d (subframe TX %d, RX %d)\n",
-                    UE_inst, frame, slot, next_slot >> 1,
+                    UE_inst, frame % MAX_FRAME_NUMBER, slot, next_slot >> 1,
                     last_slot >> 1);
 
               if (PHY_vars_UE_g[UE_inst][0]->UE_mode[0]
                   != NOT_SYNCHED) {
                 if (frame > 0) {
-                  PHY_vars_UE_g[UE_inst][0]->frame_rx = frame;
+                  PHY_vars_UE_g[UE_inst][0]->frame_rx = frame % MAX_FRAME_NUMBER;
                   PHY_vars_UE_g[UE_inst][0]->slot_rx =  last_slot;
                   PHY_vars_UE_g[UE_inst][0]->slot_tx = next_slot;
 
                   if (next_slot > 1)
-                    PHY_vars_UE_g[UE_inst][0]->frame_tx = frame;
+                    PHY_vars_UE_g[UE_inst][0]->frame_tx = frame % MAX_FRAME_NUMBER;
                   else
-                    PHY_vars_UE_g[UE_inst][0]->frame_tx = frame + 1;
+                    PHY_vars_UE_g[UE_inst][0]->frame_tx = (frame + 1) % MAX_FRAME_NUMBER;
 
 #ifdef OPENAIR2
                   //Application
                   update_otg_UE (UE_inst, oai_emulation.info.time_ms);
 
                   //Access layer
-		  PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, UE_inst, 0, ENB_FLAG_NO, NOT_A_RNTI, frame, next_slot);
+		  PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, UE_inst, 0, ENB_FLAG_NO, NOT_A_RNTI, frame % MAX_FRAME_NUMBER, next_slot);
                   pdcp_run (&ctxt);
 #endif
 
@@ -886,7 +899,7 @@ l2l1_task (void *args_p)
 
               if(last_slot==2 && frame%10==0) {
                 if (UE_stats_th[UE_inst]) {
-                  fprintf(UE_stats_th[UE_inst],"%d %d\n",frame, PHY_vars_UE_g[UE_inst][0]->bitrate[0]/1000);
+                  fprintf(UE_stats_th[UE_inst],"%d %d\n",frame % MAX_FRAME_NUMBER, PHY_vars_UE_g[UE_inst][0]->bitrate[0]/1000);
                 }
               }
 
@@ -920,7 +933,7 @@ l2l1_task (void *args_p)
             exit(-1);
           }
 
-          PHY_vars_RN_g[RN_id]->frame = frame;
+          PHY_vars_RN_g[RN_id]->frame = frame % MAX_FRAME_NUMBER;
 
           if ( oai_emulation.info.frame_type == 0) {
             // RN == UE
@@ -928,12 +941,12 @@ l2l1_task (void *args_p)
               if (PHY_vars_UE_g[UE_inst][0]->UE_mode[0] != NOT_SYNCHED) {
                 LOG_D(EMU,"[RN %d] PHY procedures UE %d for frame %d, slot %d (subframe TX %d, RX %d)\n",
                       RN_id, UE_inst, frame, slot, next_slot >> 1,last_slot>>1);
-                PHY_vars_UE_g[UE_inst][0]->frame_rx = frame;
+                PHY_vars_UE_g[UE_inst][0]->frame_rx = frame % MAX_FRAME_NUMBER;
                 PHY_vars_UE_g[UE_inst][0]->slot_rx = last_slot;
                 PHY_vars_UE_g[UE_inst][0]->slot_tx = next_slot;
 
-                if (next_slot>1) PHY_vars_UE_g[UE_inst][0]->frame_tx = frame;
-                else PHY_vars_UE_g[UE_inst][0]->frame_tx = frame+1;
+                if (next_slot>1) PHY_vars_UE_g[UE_inst][0]->frame_tx = frame % MAX_FRAME_NUMBER;
+                else PHY_vars_UE_g[UE_inst][0]->frame_tx = (frame+1) % MAX_FRAME_NUMBER;
 
                 phy_procedures_UE_lte (PHY_vars_UE_g[UE_inst][0], 0, abstraction_flag,normal_txrx,
                                        r_type, PHY_vars_RN_g[RN_id]);
@@ -944,7 +957,7 @@ l2l1_task (void *args_p)
 
             // RN == eNB
             LOG_D(EMU,"[RN %d] PHY procedures eNB %d for frame %d, slot %d (subframe TX %d, RX %d)\n",
-                  RN_id, eNB_inst, frame, slot, next_slot >> 1,last_slot>>1);
+                  RN_id, eNB_inst, frame % MAX_FRAME_NUMBER, slot, next_slot >> 1,last_slot>>1);
             phy_procedures_eNB_lte(slot>>1, PHY_vars_eNB_g[eNB_inst], abstraction_flag,
                                    r_type, PHY_vars_RN_g[RN_id]);
           } else {
@@ -954,7 +967,7 @@ l2l1_task (void *args_p)
         }
 
 #endif
-        emu_transport (frame, last_slot, next_slot, direction,
+        emu_transport (frame % MAX_FRAME_NUMBER, last_slot, next_slot, direction,
                        oai_emulation.info.frame_type[0], ethernet_flag);
 
         if ((direction == SF_DL)
@@ -972,7 +985,7 @@ l2l1_task (void *args_p)
 
           for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++)
             for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
-#warning figure out what to do with UE frame_parms during initial_sync
+//#warning figure out what to do with UE frame_parms during initial_sync
               do_DL_sig (r_re0,
                          r_im0,
                          r_re,
@@ -995,12 +1008,12 @@ l2l1_task (void *args_p)
           start_meas (&ul_chan_stats);
 
           for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
-#warning figure out what to do with UE frame_parms during initial_sync
+//#warning figure out what to do with UE frame_parms during initial_sync
             do_UL_sig (r_re0, r_im0, r_re, r_im, s_re, s_im, UE2eNB,
                        enb_data, ue_data, next_slot,
                        abstraction_flag,
                        &PHY_vars_eNB_g[0][CC_id]->lte_frame_parms,
-                       frame, CC_id);
+                       frame % MAX_FRAME_NUMBER, CC_id);
           }
 
           stop_meas (&ul_chan_stats);
@@ -1029,7 +1042,7 @@ l2l1_task (void *args_p)
 
             for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++)
               for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
-#warning  check dimensions of r_reN,r_imN for multiple CCs
+//#warning  check dimensions of r_reN,r_imN for multiple CCs
                 do_DL_sig (r_re0,
                            r_im0,
                            r_re,
@@ -1056,7 +1069,7 @@ l2l1_task (void *args_p)
             start_meas (&ul_chan_stats);
 
             for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
-#warning  check dimensions of r_reN,r_imN for multiple CCs
+//#warning  check dimensions of r_reN,r_imN for multiple CCs
               do_UL_sig (r_re0,
                          r_im0,
                          r_re,
@@ -1069,7 +1082,7 @@ l2l1_task (void *args_p)
                          next_slot,
                          abstraction_flag,
                          &PHY_vars_eNB_g[0][CC_id]->lte_frame_parms,
-                         frame, CC_id);
+                         frame % MAX_FRAME_NUMBER, CC_id);
             }
 
             stop_meas (&ul_chan_stats);
@@ -1086,7 +1099,7 @@ l2l1_task (void *args_p)
           }
         }
 
-        if ((last_slot == 1) && (frame == 0) && (abstraction_flag == 0)
+        if ((last_slot == 1) && ((frame % MAX_FRAME_NUMBER) == 0) && (abstraction_flag == 0)
             && (oai_emulation.info.n_frames == 1)) {
 
           write_output ("dlchan0.m",
@@ -1134,40 +1147,40 @@ l2l1_task (void *args_p)
         &&(Channel_Flag==0)
 #endif
        ) {
-      sprintf (fname, "UEtxsig%d.m", frame);
-      sprintf (vname, "txs%d", frame);
+      sprintf (fname, "UEtxsig%d.m", frame % MAX_FRAME_NUMBER);
+      sprintf (vname, "txs%d", frame % MAX_FRAME_NUMBER);
       write_output (fname,
                     vname,
                     PHY_vars_UE_g[0][0]->lte_ue_common_vars.txdata[0],
                     PHY_vars_UE_g[0][0]->lte_frame_parms.samples_per_tti
                     * 10,
                     1, 1);
-      sprintf (fname, "eNBtxsig%d.m", frame);
-      sprintf (vname, "txs%d", frame);
+      sprintf (fname, "eNBtxsig%d.m", frame % MAX_FRAME_NUMBER);
+      sprintf (vname, "txs%d", frame % MAX_FRAME_NUMBER);
       write_output (fname,
                     vname,
                     PHY_vars_eNB_g[0][0]->lte_eNB_common_vars.txdata[0][0],
                     PHY_vars_UE_g[0][0]->lte_frame_parms.samples_per_tti
                     * 10,
                     1, 1);
-      sprintf (fname, "eNBtxsigF%d.m", frame);
-      sprintf (vname, "txsF%d", frame);
+      sprintf (fname, "eNBtxsigF%d.m", frame % MAX_FRAME_NUMBER);
+      sprintf (vname, "txsF%d", frame % MAX_FRAME_NUMBER);
       write_output (fname,
                     vname,
                     PHY_vars_eNB_g[0][0]->lte_eNB_common_vars.txdataF[0][0],
                     PHY_vars_eNB_g[0][0]->lte_frame_parms.symbols_per_tti
                     * PHY_vars_eNB_g[0][0]->lte_frame_parms.ofdm_symbol_size,
                     1, 1);
-      sprintf (fname, "UErxsig%d.m", frame);
-      sprintf (vname, "rxs%d", frame);
+      sprintf (fname, "UErxsig%d.m", frame % MAX_FRAME_NUMBER);
+      sprintf (vname, "rxs%d", frame % MAX_FRAME_NUMBER);
       write_output (fname,
                     vname,
                     PHY_vars_UE_g[0][0]->lte_ue_common_vars.rxdata[0],
                     PHY_vars_UE_g[0][0]->lte_frame_parms.samples_per_tti
                     * 10,
                     1, 1);
-      sprintf (fname, "eNBrxsig%d.m", frame);
-      sprintf (vname, "rxs%d", frame);
+      sprintf (fname, "eNBrxsig%d.m", frame % MAX_FRAME_NUMBER);
+      sprintf (vname, "rxs%d", frame % MAX_FRAME_NUMBER);
       write_output (fname,
                     vname,
                     PHY_vars_eNB_g[0][0]->lte_eNB_common_vars.rxdata[0][0],
@@ -1176,28 +1189,31 @@ l2l1_task (void *args_p)
                     1, 1);
     }
 
-#ifdef XFORMS
+    //#ifdef XFORMS
+    if (xforms==1) {
     eNB_inst = 0;
 
     for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++) {
-      phy_scope_UE(form_ue[UE_inst],
-                   PHY_vars_UE_g[UE_inst][0],
-                   eNB_inst,
-                   UE_inst,
-                   7);
+      for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
+	phy_scope_UE(form_ue[CC_id][UE_inst],
+		     PHY_vars_UE_g[UE_inst][CC_id],
+		     eNB_inst,
+		     UE_inst,
+		     7);
+      }
 
       phy_scope_eNB(form_enb[UE_inst],
                     PHY_vars_eNB_g[eNB_inst][0],
                     UE_inst);
 
     }
-
-#endif
+    }
+    //#endif
 
 #ifdef SMBV
 
     // Rohde&Schwarz SMBV100A vector signal generator
-    if ((frame == config_frames[0]) || (frame == config_frames[1]) || (frame == config_frames[2]) || (frame == config_frames[3])) {
+    if ((frame % MAX_FRAME_NUMBER == config_frames[0]) || (frame % MAX_FRAME_NUMBER == config_frames[1]) || (frame % MAX_FRAME_NUMBER == config_frames[2]) || (frame % MAX_FRAME_NUMBER == config_frames[3])) {
       smbv_frame_cnt++;
     }
 
@@ -1240,6 +1256,12 @@ l2l1_task (void *args_p)
   return NULL;
 }
 
+#if T_TRACER
+int T_wait = 1;       /* by default we wait for the tracer */
+int T_port = 2021;    /* default port to listen to to wait for the tracer */
+int T_dont_fork = 0;  /* default is to fork, see 'T_init' to understand */
+#endif
+
 /*------------------------------------------------------------------------------*/
 int
 main (int argc, char **argv)
@@ -1256,8 +1278,9 @@ main (int argc, char **argv)
   int node_id;
   int port,Process_Flag=0,wgt,Channel_Flag=0,temp;
 #endif
+
   //default parameters
-  oai_emulation.info.n_frames = 0xffff; //1024;          //10;
+  oai_emulation.info.n_frames = MAX_FRAME_NUMBER; //1024;          //10;
   oai_emulation.info.n_frames_flag = 0; //fixme
   snr_dB = 30;
 
@@ -1272,6 +1295,10 @@ main (int argc, char **argv)
   // get command-line options
   get_simulation_options (argc, argv); //Command-line options
 
+#if T_TRACER
+  T_init(T_port, T_wait, T_dont_fork);
+#endif
+
   // Initialize VCD LOG module
   VCD_SIGNAL_DUMPER_INIT (oai_emulation.info.vcd_file);
 
@@ -1762,6 +1789,7 @@ print_opp_meas (void)
 
 }
 
+#if !defined(ENABLE_ITTI)
 static void *
 sigh (void *arg)
 {
@@ -1797,6 +1825,7 @@ sigh (void *arg)
 
   pthread_exit (NULL);
 }
+#endif /* !defined(ENABLE_ITTI) */
 
 void
 oai_shutdown (void)
diff --git a/targets/SIMU/USER/oaisim.h b/targets/SIMU/USER/oaisim.h
index 216acaa653aec2654c2b427e03add4c3dc99f4cb..6fb16b82db56ddc83fa395a4fff85cbd86df0baa 100644
--- a/targets/SIMU/USER/oaisim.h
+++ b/targets/SIMU/USER/oaisim.h
@@ -62,9 +62,9 @@ void extract_position(node_list* input_node_list, node_desc_t**, int nb_nodes);/
 void get_beta_map(void);//Abstraction changes
 void get_MIESM_param(void);
 
-void init_snr(channel_desc_t *,  node_desc_t *, node_desc_t *, double*, double*, uint8_t, uint16_t, uint8_t);//Abstraction changes
+void init_snr(channel_desc_t *,  node_desc_t *, node_desc_t *, double*, double*, uint8_t, uint16_t, uint8_t, uint16_t);//Abstraction changes
 void init_snr_up(channel_desc_t *,  node_desc_t *, node_desc_t *, double*, double*, uint16_t, uint16_t);//Abstraction changes
-void calculate_sinr(channel_desc_t *,  node_desc_t *, node_desc_t *, double *sinr_dB);//Abstraction changes
+void calculate_sinr(channel_desc_t *,  node_desc_t *, node_desc_t *, double *sinr_dB, uint16_t);//Abstraction changes
 void get_beta_map(void);
 int dlsch_abstraction_EESM(double* sinr_dB, uint32_t rb_alloc[4], uint8_t mcs, uint8_t); //temporary testing for PHY abstraction
 int dlsch_abstraction_MIESM(double* sinr_dB,uint8_t TM, uint32_t rb_alloc[4], uint8_t mcs,uint8_t);
@@ -73,7 +73,7 @@ int ulsch_abstraction(double* sinr_dB,uint8_t TM, uint8_t mcs,uint16_t nb_rb, ui
 
 void calc_path_loss(node_desc_t* node_tx, node_desc_t* node_rx, channel_desc_t *ch_desc, Environment_System_Config env_desc, double **SF);
 
-void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, frame_t frame, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms);
+void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, frame_t frame, uint16_t next_slot, LTE_DL_FRAME_PARMS *frame_parms);
 
 void reset_opp_meas(void);
 void print_opp_meas(void);
diff --git a/targets/SIMU/USER/oaisim_functions.c b/targets/SIMU/USER/oaisim_functions.c
index ca1ec9fccb9a839317a59733367ed9e764d8bd0a..a5acb2616a81054ad9dbea9f9d39248fd5d11d03 100644
--- a/targets/SIMU/USER/oaisim_functions.c
+++ b/targets/SIMU/USER/oaisim_functions.c
@@ -51,7 +51,6 @@
 #include "oaisim_functions.h"
 
 #include "PHY/extern.h"
-#include "MAC_INTERFACE/extern.h"
 #include "LAYER2/MAC/extern.h"
 #ifdef OPENAIR2
 #include "LAYER2/MAC/proto.h"
@@ -136,6 +135,8 @@ int             td                  = 0;
 int             td_avg              = 0;
 int             sleep_time_us       = 0;
 
+int phy_test = 0;
+
 #ifdef OPENAIR2
 // omv related info
 //pid_t omv_pid;
@@ -170,6 +171,8 @@ extern pdcp_mbms_t pdcp_mbms_array_eNB[NUMBER_OF_eNB_MAX][maxServiceCount][maxSe
 extern time_stats_t dl_chan_stats;
 extern time_stats_t ul_chan_stats;
 
+extern int xforms;
+
 void get_simulation_options(int argc, char *argv[])
 {
   int                           option;
@@ -206,6 +209,15 @@ void get_simulation_options(int argc, char *argv[])
     LONG_OPTION_MALLOC_TRACE_ENABLED,
 
     LONG_OPTION_CBA_BACKOFF_TIMER,
+
+    LONG_OPTION_PHYTEST,
+    LONG_OPTION_XFORMS,
+
+#if T_TRACER
+    LONG_OPTION_T_PORT,
+    LONG_OPTION_T_NOWAIT,
+    LONG_OPTION_T_DONT_FORK,
+#endif
   };
 
   static struct option long_options[] = {
@@ -237,11 +249,24 @@ void get_simulation_options(int argc, char *argv[])
 
     {"cba-backoff",            required_argument, 0, LONG_OPTION_CBA_BACKOFF_TIMER},
 
+    {"phy-test", no_argument, NULL, LONG_OPTION_PHYTEST},
+    {"xforms",                 no_argument,       0, LONG_OPTION_XFORMS},
+
+#if T_TRACER
+    {"T_port",                 required_argument, 0, LONG_OPTION_T_PORT},
+    {"T_nowait",               no_argument,       0, LONG_OPTION_T_NOWAIT},
+    {"T_dont_fork",            no_argument,       0, LONG_OPTION_T_DONT_FORK},
+#endif
+
     {NULL, 0, NULL, 0}
   };
 
   while ((option = getopt_long (argc, argv, "aA:b:B:c:C:D:d:eE:f:FGg:hHi:IJ:j:k:K:l:L:m:M:n:N:oO:p:P:qQ:rR:s:S:t:T:u:U:vV:w:W:x:X:y:Y:z:Z:", long_options, NULL)) != -1) {
     switch (option) {
+    case LONG_OPTION_PHYTEST:
+      phy_test = 1;
+      break;
+
     case LONG_OPTION_ENB_CONF:
       if (optarg) {
         free(conf_config_file_name); // prevent memory leak if option is used multiple times
@@ -396,6 +421,31 @@ void get_simulation_options(int argc, char *argv[])
       break;
 #endif
 
+    case LONG_OPTION_XFORMS:
+      xforms=1;
+      break;
+
+#if T_TRACER
+    case LONG_OPTION_T_PORT: {
+      extern int T_port;
+      if (optarg == NULL) abort();  /* should not happen */
+      T_port = atoi(optarg);
+      break;
+    }
+
+    case LONG_OPTION_T_NOWAIT: {
+      extern int T_wait;
+      T_wait = 0;
+      break;
+    }
+
+    case LONG_OPTION_T_DONT_FORK: {
+      extern int T_dont_fork;
+      T_dont_fork = 1;
+      break;
+    }
+#endif
+
     case 'a':
       abstraction_flag = 1;
       break;
@@ -939,7 +989,7 @@ void init_openair1(void)
   openair_daq_vars.rx_gain_mode = DAQ_AGC_ON;
 
   openair_daq_vars.dlsch_transmission_mode = oai_emulation.info.transmission_mode[0];
-#warning "NN->FK: OAI EMU channel abstraction does not work for MCS higher than"
+//#warning "NN->FK: OAI EMU channel abstraction does not work for MCS higher than"
   openair_daq_vars.target_ue_dl_mcs = cmin(target_dl_mcs,16);
   openair_daq_vars.target_ue_ul_mcs = target_ul_mcs;
   openair_daq_vars.ue_dl_rb_alloc=0x1fff;
@@ -976,13 +1026,21 @@ void init_openair1(void)
     }
   }
 
+  for (eNB_id=0; eNB_id<NB_eNB_INST; eNB_id++)
+    for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
+      if (phy_test==1)
+	PHY_vars_eNB_g[eNB_id][CC_id]->mac_enabled=0;
+      else
+	PHY_vars_eNB_g[eNB_id][CC_id]->mac_enabled=1;
+    }
+
   // init_ue_status();
   for (UE_id=0; UE_id<NB_UE_INST; UE_id++)
     for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
 
       PHY_vars_UE_g[UE_id][CC_id]->tx_power_max_dBm=23;
 
-      PHY_vars_UE_g[UE_id][CC_id]->rx_total_gain_dB=160;
+      PHY_vars_UE_g[UE_id][CC_id]->rx_total_gain_dB=100;
 
       // update UE_mode for each eNB_id not just 0
       if (abstraction_flag == 0)
@@ -992,6 +1050,11 @@ void init_openair1(void)
         PHY_vars_UE_g[UE_id][CC_id]->UE_mode[0] = PRACH;
       }
 
+      if (phy_test==1)
+	PHY_vars_UE_g[UE_id][CC_id]->mac_enabled=0;
+      else
+	PHY_vars_UE_g[UE_id][CC_id]->mac_enabled=1;
+
       PHY_vars_UE_g[UE_id][CC_id]->lte_ue_pdcch_vars[0]->crnti = 0x1235 + UE_id;
       PHY_vars_UE_g[UE_id][CC_id]->current_dlsch_cqi[0] = 10;
 
@@ -1018,7 +1081,7 @@ void init_openair2(void)
   module_id_t enb_id;
   module_id_t UE_id;
   int CC_id;
-#warning "eNB index is hard coded to zero"
+//#warning "eNB index is hard coded to zero"
 
   for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++)
     l2_init (&PHY_vars_eNB_g[0][CC_id]->lte_frame_parms,
@@ -1239,10 +1302,10 @@ void update_ocm()
           LOG_I(OCM,"Path loss (CCid %d) between eNB %d at (%f,%f) and UE %d at (%f,%f) is %f, angle %f\n",
                 CC_id,eNB_id,enb_data[eNB_id]->x,enb_data[eNB_id]->y,UE_id,ue_data[UE_id]->x,ue_data[UE_id]->y,
                 eNB2UE[eNB_id][UE_id][CC_id]->path_loss_dB, eNB2UE[eNB_id][UE_id][CC_id]->aoa);
-          double dx, dy, distance;
-          dx = enb_data[eNB_id]->x - ue_data[UE_id]->x;
-          dy = enb_data[eNB_id]->y - ue_data[UE_id]->y;
-          distance = sqrt(dx * dx + dy * dy);
+          //double dx, dy, distance;
+          //dx = enb_data[eNB_id]->x - ue_data[UE_id]->x;
+          //dy = enb_data[eNB_id]->y - ue_data[UE_id]->y;
+          //distance = sqrt(dx * dx + dy * dy);
           /*LOG_D(LOCALIZE, " OCM distance between eNB %d at (%f,%f) and UE %d at (%f,%f) is %f \n",
                   eNB_id, enb_data[eNB_id]->x,enb_data[eNB_id]->y,
                   UE_id, ue_data[UE_id]->x,ue_data[UE_id]->y,
@@ -1260,8 +1323,7 @@ void update_ocm()
           //pathloss: -132.24 dBm/15kHz RE + target SNR - eNB TX power per RE
           if (eNB_id == (UE_id % NB_eNB_INST)) {
             eNB2UE[eNB_id][UE_id][CC_id]->path_loss_dB = -132.24 + snr_dB - PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower;
-            UE2eNB[UE_id][eNB_id][CC_id]->path_loss_dB = -132.24 + snr_dB -
-                PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower; //+20 to offset the difference in tx power of the UE wrt eNB
+            UE2eNB[UE_id][eNB_id][CC_id]->path_loss_dB = -132.24 + snr_dB - PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower; 
           } else {
             eNB2UE[eNB_id][UE_id][CC_id]->path_loss_dB = -132.24 + sinr_dB - PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower;
             UE2eNB[UE_id][eNB_id][CC_id]->path_loss_dB = -132.24 + sinr_dB - PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower;
@@ -1280,9 +1342,10 @@ void update_ocm()
 #ifdef OPENAIR2
 void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
 {
+
 #if defined(USER_MODE) && defined(OAI_EMU)
 
-  int rrc_state=0; 
+  //int rrc_state=0;
 
   if (oai_emulation.info.otg_enabled ==1 ) {
 
diff --git a/targets/SIMU/USER/sinr_sim.c b/targets/SIMU/USER/sinr_sim.c
index 317fe53c6093228bbb7ad413259628df95e14afe..b235e16585d086e1dbafb642e1e0e45f249fb73f 100644
--- a/targets/SIMU/USER/sinr_sim.c
+++ b/targets/SIMU/USER/sinr_sim.c
@@ -40,7 +40,6 @@
 #include "PHY/types.h"
 #include "PHY/defs.h"
 #include "PHY/extern.h"
-#include "MAC_INTERFACE/extern.h"
 #include "oaisim_config.h"
 
 #ifdef OPENAIR2
@@ -244,20 +243,19 @@ void calc_path_loss(node_desc_t* enb_data, node_desc_t* ue_data, channel_desc_t
 
 
 
-void init_snr(channel_desc_t* eNB2UE, node_desc_t *enb_data, node_desc_t *ue_data, double* sinr_dB, double* N0, uint8_t transmission_mode, uint16_t q, uint8_t dl_power_off)
+void init_snr(channel_desc_t* eNB2UE, node_desc_t *enb_data, node_desc_t *ue_data, double* sinr_dB, double* N0, uint8_t transmission_mode, uint16_t q, uint8_t dl_power_off, uint16_t nb_rb)
 {
 
-  uint16_t nb_rb = 25; //No. of resource blocks
   double thermal_noise,abs_channel,channelx, channely,channelx_i, channely_i ;
   int count;
   int aarx,aatx;
   uint8_t qq;
 
-  /* Thermal noise is calculated using 10log10(K*T*B) K = Boltzmann's constant T = room temperature B = bandwidth */
-  thermal_noise = -174 + 10*log10(eNB2UE->sampling_rate*1e6); //value in dBm
+  /* Thermal noise is calculated using 10log10(K*T*B) K = Boltzmann's constant T = room temperature B = bandwidth*/
+  thermal_noise = -174 + 10*log10(15000); //per RE; value in dBm
 
   //for (aarx=0; aarx<eNB2UE->nb_rx; aarx++)
-  *N0 = thermal_noise + ue_data->rx_noise_level;//? all the element have the same noise level?????
+  *N0 = thermal_noise + ue_data->rx_noise_level;
 
   LOG_D(OCM,"Path loss %lf, noise (N0) %lf, signal %lf, snr %lf\n",
         eNB2UE->path_loss_dB,
@@ -549,15 +547,14 @@ void init_snr_up(channel_desc_t* UE2eNB, node_desc_t *enb_data, node_desc_t *ue_
 
 #endif
 
-void calculate_sinr(channel_desc_t* eNB2UE, node_desc_t *enb_data, node_desc_t *ue_data, double *sinr_dB)
+void calculate_sinr(channel_desc_t* eNB2UE, node_desc_t *enb_data, node_desc_t *ue_data, double *sinr_dB, uint16_t nb_rb)
 {
 
   double sir, thermal_noise;
-  short nb_rb = 25; //No. of resource blocks
   short count;
 
   /* Thermal noise is calculated using 10log10(K*T*B) K = Boltzmann's constant T = room temperature B = bandwidth */
-  thermal_noise = -174 + 10*log10(eNB2UE->sampling_rate*1e6); //value in dBm
+  thermal_noise = -174 + 10*log10(15000); //per RE, value in dBm
 
   for (count = 0; count < 12 * nb_rb; count++) {
     sir = enb_data->tx_power_dBm
diff --git a/targets/TEST/OAI/case13.py b/targets/TEST/OAI/case13.py
index 1744bcb32c4eae8b3404ea4c952cfdaa029c9574..2148ddb52fe59f0246771081f9f21d1324b2cb29 100644
--- a/targets/TEST/OAI/case13.py
+++ b/targets/TEST/OAI/case13.py
@@ -49,15 +49,16 @@ NUM_eNB=1
 NUM_TRIALS=3
 
 PRB=[25,50,100]
-MCS=[0,4,9,10,13,16,17,22,27]
+MCS=[3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28]
+#MCS=[0,4,9,10,13,16,17,22,27]
 #PRB=[100]
 #MCS=[16]
-ANT_TX=1  # 2 
+ANT_TX=2  # 2 
 ANT_RX=2  # 2 
 CHANNEL=["N"]
 #CHANNEL=["C","E","F","G","H","I","L","M"] # A,B,C,D,E,F,
 TX_MODE=2 # 2, 
-MIN_SNR=0 
+MIN_SNR=10 
 MAX_SNR=40
 PERF=75
 OPT="-L"
@@ -69,9 +70,9 @@ FRAME=2000
 def execute(oai, user, pw, host,logfile,logdir,debug,cpu):
     
     case = '10'
-    oai.send('cd $OPENAIR1_DIR;')     
-    oai.send('cd SIMULATION/LTE_PHY;')   
-    
+    oai.send('cd $OPENAIR_TARGETS;')     
+    oai.send('cd bin;')   
+    oai.send('cp ./ulsim.Rel10 ./ulsim.Rel10.'+host)
     try:
         log.start()
         test = '300'
@@ -80,13 +81,13 @@ def execute(oai, user, pw, host,logfile,logdir,debug,cpu):
         diag = 'ulsim is not running normally (Segmentation fault / Exiting / FATAL), debugging might be needed'
         trace = logdir + '/log_' + host + case + test + '_1.txt;'
         tee = ' 2>&1 | tee ' + trace
-        oai.send_expect_false('./ulsim.rel8.'+ host + ' ' + conf + tee, 'Segmentation fault', 30)
+        oai.send_expect_false('./ulsim.Rel10.'+ host + ' ' + conf + tee, 'Segmentation fault', 30)
         trace = logdir + '/log_' + host + case + test + '_2.txt;'
         tee = ' 2>&1 | tee ' + trace
-        oai.send_expect_false('./ulsim.rel8.'+ host + ' ' + conf + tee, 'Exiting', 30)
+        oai.send_expect_false('./ulsim.Rel10.'+ host + ' ' + conf + tee, 'Exiting', 30)
         trace = logdir + '/log_' + host + case + test + '_3.txt;'
         tee = ' 2>&1 | tee ' + trace
-        oai.send_expect_false('./ulsim.rel8.'+ host + ' ' + conf + tee, 'FATAL', 30)
+        oai.send_expect_false('./ulsim.Rel10.'+ host + ' ' + conf + tee, 'FATAL', 30)
 
     except log.err, e:
         log.fail(case, test, name, conf, e.value, diag, logfile,trace)
@@ -100,42 +101,47 @@ def execute(oai, user, pw, host,logfile,logdir,debug,cpu):
         diag = 'no diagnostic is available, check the log file'
         for i in range(len(PRB)):
             for o in range(len(CHANNEL)):
-                MIN_SNR=0
+                MIN_SNR=10
                 for j in range(len(MCS)):
                     for m in range (1,ANT_RX):
                         for p in range(1,TX_MODE):
-                            for q in range(MIN_SNR,MAX_SNR): 
-                                #if  if PRB[i] :
-                                
-                                conf = '-B' + str(PRB[i]) + ' -m'+str(MCS[j]) + ' -y'+str(m) + ' -g'+str(CHANNEL[o]) + ' -x'+str(p) + ' -s'+str(q) + ' -w1.0 -e.1 -P -n'+str(FRAME)+' -O'+str(PERF)+' '+ OPT  
-                                trace = logdir + '/time_meas' + '_prb'+str(PRB[i])+'_mcs'+ str(MCS[j])+ '_antrx' + str(m)  + '_channel' +str(CHANNEL[o]) + '_tx' +str(p) + '_snr' +str(q)+'.'+case+str(test)+ '.log'
-                                tee = ' 2>&1 | tee ' + trace
-                                if cpu > -1 :
-                                    cmd = 'taskset -c ' + str(cpu) + ' ./ulsim.rel8.'+ host + ' ' + conf + tee
-                                else :
-                                    cmd = './ulsim.rel8.'+ host + ' ' + conf + tee
-                                
-                                if debug :
-                                    print cmd
+                              for r in range(5,PRB[i]):
+                                  for q in range(MIN_SNR,MAX_SNR): 
+                              
+                                  
+                                    if r ==7 or r ==11 or r ==14 or r == 17 or r==19 or r == 21 or r == 23 or r == 26 or r == 28  : 
+                                        continue
                                 
-                               # match = oai.send_expect_re(cmd, 'passed', 0, 1000)
-                                match =1
-                                if match :
-                                    log.ok(case, str(test), name, conf, '', logfile)
-                                    MIN_SNR = q - 1 # just to speed up the test
-                                    test+=1
-                                    break # found the smallest snr
-                                else :
-                                    if q == MAX_SNR -1 :
-                                        log.skip(case,str(test), name, conf,'','',logfile) 
+                                    conf = '-B' + str(PRB[i]) + ' -r'+str(r) + ' -m'+str(MCS[j]) + ' -y'+str(m) + ' -g'+str(CHANNEL[o]) + ' -x'+str(p) + ' -s'+str(q) + ' -w1.0 -e.1 -P -n'+str(FRAME)+' -O'+str(PERF)+' '+ OPT  
+                                    trace = logdir + '/time_meas' + '_prb'+str(PRB[i])+ '_rb'+str(r)+'_mcs'+ str(MCS[j])+ '_antrx' + str(m)  + '_channel' +str(CHANNEL[o]) + '_tx' +str(p) + '_snr' +str(q)+'.'+case+str(test)+ '.log'
+                                    tee = ' 2>&1 | tee ' + trace
+                                    if cpu > -1 :
+                                        cmd = 'taskset -c ' + str(cpu) + ' ./ulsim.Rel10.'+ host + ' ' + conf + tee
+                                    else :
+                                        cmd = './ulsim.Rel10.'+ host + ' ' + conf + tee
+                                        
+                                    if debug :
+                                        print cmd
+                                        
+                                    match = oai.send_expect_re(cmd, 'passed', 0, 1000)
+                                    #match =1
+                                    if match :
+                                       
+                                        log.ok(case, str(test), name, conf, '', logfile)
+                                        MIN_SNR = q - 1 # just to speed up the test
                                         test+=1
-                                        break
-                                    try:  
-                                        if os.path.isfile(trace) :
-                                            os.remove(trace)
-                                    except OSError, e:  ## if failed, report it back to the user ##
-                                        print ("Error: %s - %s." % (e.filename,e.strerror))
-                                
+                                        break # found the smallest snr
+                                    else :
+                                        if q == MAX_SNR -1 :
+                                            log.skip(case,str(test), name, conf,'','',logfile) 
+                                            test+=1
+                                            break
+                                        try:  
+                                            if os.path.isfile(trace) :
+                                                os.remove(trace)
+                                        except OSError, e:  ## if failed, report it back to the user ##
+                                            print ("Error: %s - %s." % (e.filename,e.strerror))
+                                            
                                 
                                             
     except log.err, e: