diff --git a/README.txt b/README.txt
index 04d02bf9c71c2577cadb6bc829169b9c2f4bca93..bff09c7a2a0cc911d21f9ef7309ccdcb50e98a43 100644
--- a/README.txt
+++ b/README.txt
@@ -39,3 +39,7 @@ v0.3 -> Last stable commit on develop branch before the merge of feature-131-new
 v0.4 -> Merge of feature-131-new-license. It closes issue#131 and changes the license to OAI Public License V1.0
 v0.5 -> Merge of enhancement-10-harmony-lts. It includes fixes for Ubuntu 16.04 support
 v0.5.1 -> Merge of bugfix-137-uplink-fixes. It includes stablity fixes for eNB
+v0.5.2 -> Last version with old code for oaisim (abstraction mode works)
+v0.6 -> RRH functionality, UE greatly improved, better TDD support,
+        a lot of bugs fixed. WARNING: oaisim in PHY abstraction mode does not
+        work, you need to use v0.5.2 for that.
diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt
index 045192cb648f4e7174c289496ef6befd293aba44..e4318a41cc5a25f387dd499d7b6ce4d3ba675b64 100644
--- a/cmake_targets/CMakeLists.txt
+++ b/cmake_targets/CMakeLists.txt
@@ -499,18 +499,18 @@ set(HWLIB_EXMIMO_SOURCE
 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} )
+target_link_libraries(oai_usrpdevif uhd)
 
 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} )
+target_link_libraries(oai_bladerfdevif bladeRF)
 
 include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/")
 
@@ -518,6 +518,8 @@ set(HWLIB_LMSSDR_SOURCE
   ${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp
   )
 add_library(oai_lmssdrdevif MODULE ${HWLIB_LMSSDR_SOURCE} )
+target_include_directories(oai_lmssdrdevif PRIVATE /usr/local/include/lime)
+target_link_libraries(oai_lmssdrdevif LimeSuite )
 
 include_directories("${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/")
 set(TPLIB_ETHERNET_SOURCE
@@ -528,70 +530,6 @@ set(TPLIB_ETHERNET_SOURCE
 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/")
-  include_directories ("${OPENAIR_TARGETS}/ARCH/EXMIMO/DEFS/")
-  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/")
-  include_directories("/opt/include/uhd")
-  set(HW_SOURCE ${HW_SOURCE}
-    ${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp)
-  LINK_DIRECTORIES("/opt/lib")
-  set(option_HW_lib "-luhd -rdynamic -ldl -lboost_system")
-
-elseif (${RF_BOARD} STREQUAL "OAI_BLADERF")
-  include_directories("${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/")
-  include_directories("${OPENAIR2_DIR}/UTIL/LOG")
-  include_directories("/usr/include")
-  set(HW_SOURCE ${HW_SOURCE}
-    ${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c
-    )
-  LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu")
-
-  set(option_HW_lib "bladeRF -rdynamic -ldl")
-
-elseif (${RF_BOARD} STREQUAL "OAI_LMSSDR")
-  include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB")
-  include_directories("/usr/local/include/lime")
-  include_directories("/usr/include/lime")
-  LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu")
-  LINK_DIRECTORIES("/usr/local/lib")
-  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 "-lLimeSuite -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")
-
-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")
@@ -1773,8 +1711,6 @@ add_executable(lte-softmodem
   ${OPENAIR_DIR}/common/utils/utils.c
   ${OPENAIR_DIR}/common/utils/system.c
   ${GTPU_need_ITTI}
-  ${HW_SOURCE}
-  ${TRANSPORT_SOURCE}
   ${RTAI_SOURCE}
   ${XFORMS_SOURCE}
   ${XFORMS_SOURCE_SOFTMODEM}
@@ -1787,7 +1723,7 @@ target_link_libraries (lte-softmodem -ldl
   -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} ${option_TP_lib} ${XFORMS_LIBRARIES} ${PROTOBUF_LIB}  ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
+target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp  ${XFORMS_LIBRARIES} ${PROTOBUF_LIB}  ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
 target_link_libraries (lte-softmodem ${LIB_LMS_LIBRARIES})
 target_link_libraries (lte-softmodem ${T_LIB})
 
@@ -1809,8 +1745,6 @@ add_executable(lte-softmodem-nos1
   ${OPENAIR2_DIR}/RRC/NAS/rb_config.c
   ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
   ${OPENAIR_DIR}/common/utils/system.c
-  ${HW_SOURCE}
-  ${TRANSPORT_SOURCE}
   ${RTAI_SOURCE}
   ${XFORMS_SOURCE}
   ${XFORMS_SOURCE_SOFTMODEM}
@@ -1822,7 +1756,7 @@ 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} ${option_TP_lib} ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
+target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES}   ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
 target_link_libraries (lte-softmodem-nos1  ${LIB_LMS_LIBRARIES})
 target_link_libraries (lte-softmodem-nos1 ${T_LIB})
 
@@ -1835,24 +1769,17 @@ add_executable(rrh_gw
   ${OPENAIR_TARGETS}/RT/USER/UE_transport_IQ.c
   ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
   ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
-  ${HW_SOURCE}
-  ${TRANSPORT_SOURCE}
   ${T_SOURCE}
   )
 target_include_directories(rrh_gw PRIVATE  ${OPENAIR_DIR}/common/utils/itti)
 target_link_libraries(rrh_gw
   -Wl,--start-group
-  UTIL LFDS
+  UTIL LFDS -ldl
   -Wl,--end-group )
 target_link_libraries (rrh_gw rt pthread m )
-target_link_libraries (rrh_gw  ${option_HW_lib} ${option_TP_lib})
 target_link_libraries (rrh_gw ${LIB_LMS_LIBRARIES})
 target_link_libraries (rrh_gw ${T_LIB})
 
-Message("-- option_HW_lib=${option_HW_lib}")
-Message("-- HW_SOURCE=${HW_SOURCE}")
-Message("-- option_TP_lib=${option_TP_lib}")
-Message("-- TRANSPORT_SOURCE=${TRANSPORT_SOURCE}")
 
 # USIM process
 #################
@@ -1907,8 +1834,6 @@ add_executable(oaisim
   ${OPENAIR_DIR}/common/utils/system.c
   ${GTPU_need_ITTI}
   ${OPENAIR_TARGETS}/COMMON/create_tasks.c
-  ${HW_SOURCE}
-  ${TRANSPORT_SOURCE}
   ${XFORMS_SOURCE}
   ${T_SOURCE}
 )
@@ -1921,7 +1846,7 @@ 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} ${option_TP_lib}
+target_link_libraries (oaisim pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES}  ${NETTLE_LIBRARIES} sctp 
   ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${OPENPGM_LIBRARIES})
 #Force link with forms, regardless XFORMS option
 target_link_libraries (oaisim forms)
@@ -1952,8 +1877,6 @@ add_executable(oaisim_nos1
   ${OPENAIR2_DIR}/RRC/NAS/rb_config.c
   ${OPENAIR_TARGETS}/COMMON/create_tasks.c
   ${OPENAIR_DIR}/common/utils/system.c
-  ${HW_SOURCE}
-  ${TRANSPORT_SOURCE}
   ${XFORMS_SOURCE}
   ${T_SOURCE}
 )
@@ -1964,7 +1887,7 @@ 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} ${option_TP_lib}
+target_link_libraries (oaisim_nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES}  ${NETTLE_LIBRARIES}  
   ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${OPENPGM_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
 #Force link with forms, regardless XFORMS option
 target_link_libraries (oaisim_nos1 forms)
diff --git a/cmake_targets/autotests/testsuite_ue_noS1.xml b/cmake_targets/autotests/testsuite_ue_noS1.xml
index c5403feab237aeba20fe2b196d27e0db7983573a..f88244e7ef2a8efa10580fcb5f485f67433827e2 100644
--- a/cmake_targets/autotests/testsuite_ue_noS1.xml
+++ b/cmake_targets/autotests/testsuite_ue_noS1.xml
@@ -3208,6 +3208,316 @@
 
 
 
+ <!--20 MHz test -->
+
+<testCase id="039400" >
+        <class>lte-softmodem-noS1</class>
+        <desc></desc>
+        <eNB>imb182-desktop</eNB>
+        <UE>yanbo-M4HM87P-00</UE>
+        <TimeOut_cmd>300</TimeOut_cmd>
+        <eNB_working_dir>/tmp</eNB_working_dir>
+        <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf  downlink_frequency 2680000000L</eNB_config_file>
+        <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+        <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+        <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+        <eNB_pre_exec_args></eNB_pre_exec_args>
+        <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+        <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf -m 28 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+        <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+        <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+        <UE_pre_exec_args></UE_pre_exec_args>
+        <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2680000000 -r100 --ue-scan-carrier --ue-txgain 85 --ue-rxgain 100 -S --phy-test</UE_main_exec>
+        <UE_main_exec_args></UE_main_exec_args>
+        <UE_traffic_exec></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_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "55008"/>
+        <UE_metric  id="UE_FREQ_OFFSET" 
+                description="UE downlink frequency channel offset"  
+                regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+                unit_of_meas = "Hz"/> 
+        <UE_metric  id="UE_RX_OFFSET" 
+                description="UE downlink rx sample offset"  
+                regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+                unit_of_meas = ""/> 
+        <tags>UE_USRP.NOS1.PHYTEST_PERF.BAND7.20MHZ.MCS28</tags>
+	<nruns>3</nruns><max_ntries>6</max_ntries>
+    </testCase> 
+
+
+ <testCase id="036600" >
+        <class>lte-softmodem-noS1</class>
+        <desc></desc>
+        <eNB>imb182-desktop</eNB>
+        <UE>yanbo-M4HM87P-00</UE>
+        <TimeOut_cmd>300</TimeOut_cmd>
+        <eNB_working_dir>/tmp</eNB_working_dir>
+        <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf  downlink_frequency 2680000000L</eNB_config_file>
+        <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+        <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+        <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+        <eNB_pre_exec_args></eNB_pre_exec_args>
+        <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+        <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf -m 0 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+        <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+        <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+        <UE_pre_exec_args></UE_pre_exec_args>
+        <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2680000000 -r100 --ue-scan-carrier --ue-txgain 85 --ue-rxgain 100 -S --phy-test</UE_main_exec>
+        <UE_main_exec_args></UE_main_exec_args>
+        <UE_traffic_exec></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_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "2040"/>
+        <UE_metric  id="UE_FREQ_OFFSET" 
+                description="UE downlink frequency channel offset"  
+                regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+                unit_of_meas = "Hz"/> 
+        <UE_metric  id="UE_RX_OFFSET" 
+                description="UE downlink rx sample offset"  
+                regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+                unit_of_meas = ""/> 
+        <tags>UE_USRP.NOS1.PHYTEST_PERF.BAND7.20MHZ.MCS0</tags>
+	<nruns>3</nruns><max_ntries>6</max_ntries>
+    </testCase> 
+
+
+ <testCase id="038400" >
+        <class>lte-softmodem-noS1</class>
+        <desc></desc>
+        <eNB>imb182-desktop</eNB>
+        <UE>yanbo-M4HM87P-00</UE>
+        <TimeOut_cmd>300</TimeOut_cmd>
+        <eNB_working_dir>/tmp</eNB_working_dir>
+        <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf  downlink_frequency 2680000000L</eNB_config_file>
+        <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+        <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+        <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+        <eNB_pre_exec_args></eNB_pre_exec_args>
+        <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+        <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf -m 18 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+        <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+        <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+        <UE_pre_exec_args></UE_pre_exec_args>
+        <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2680000000 -r100 --ue-scan-carrier --ue-txgain 85 --ue-rxgain 100 -S --phy-test</UE_main_exec>
+        <UE_main_exec_args></UE_main_exec_args>
+        <UE_traffic_exec></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_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "23976"/>
+        <UE_metric  id="UE_FREQ_OFFSET" 
+                description="UE downlink frequency channel offset"  
+                regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+                unit_of_meas = "Hz"/> 
+        <UE_metric  id="UE_RX_OFFSET" 
+                description="UE downlink rx sample offset"  
+                regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+                unit_of_meas = ""/> 
+        <tags>UE_USRP.NOS1.PHYTEST_PERF.BAND7.20MHZ.MCS18</tags>
+	<nruns>3</nruns><max_ntries>6</max_ntries>
+    </testCase> 
+
+
+
+ <testCase id="036630" >
+        <class>lte-softmodem-noS1</class>
+        <desc></desc>
+        <eNB>imb182-desktop</eNB>
+        <UE>yanbo-M4HM87P-00</UE>
+        <TimeOut_cmd>700</TimeOut_cmd>
+        <eNB_working_dir>/tmp</eNB_working_dir>
+        <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf  downlink_frequency 2680000000L</eNB_config_file>
+        <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+        <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+        <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+        <eNB_pre_exec_args></eNB_pre_exec_args>
+        <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+        <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf -m 0</eNB_main_exec_args>
+        <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 2M</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+        <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+        <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+        <UE_pre_exec_args></UE_pre_exec_args>
+        <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2680000000 -r100 --ue-scan-carrier --ue-txgain 85 --ue-rxgain 100 </UE_main_exec>
+        <UE_main_exec_args></UE_main_exec_args>
+        <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec>
+        <UE_traffic_exec_args></UE_traffic_exec_args>
+        <UE_search_expr_true>600</UE_search_expr_true>
+        <UE_search_expr_false></UE_search_expr_false>
+        <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+        <UE_metric  id="UE_DLSCH_BITRATE" 
+                description="UE downlink physical throughput"  
+                regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+                unit_of_meas = "kbps"/> 
+        <UE_metric  id="UE_FREQ_OFFSET" 
+                description="UE downlink frequency channel offset"  
+                regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+                unit_of_meas = "Hz"/> 
+        <UE_metric  id="UE_RX_OFFSET" 
+                description="UE downlink rx sample offset"  
+                regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+                unit_of_meas = ""/> 
+        <tags>UE_USRP.NOS1.DATA_IPERF_DL.BAND7.20MHZ.MCS0</tags>
+	<nruns>3</nruns><max_ntries>6</max_ntries>
+    </testCase> 
+
+ 
+ <testCase id="038430" >
+        <class>lte-softmodem-noS1</class>
+        <desc></desc>
+        <eNB>imb182-desktop</eNB>
+        <UE>yanbo-M4HM87P-00</UE>
+        <TimeOut_cmd>700</TimeOut_cmd>
+        <eNB_working_dir>/tmp</eNB_working_dir>
+        <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf  downlink_frequency 2680000000L</eNB_config_file>
+        <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+        <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+        <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+        <eNB_pre_exec_args></eNB_pre_exec_args>
+        <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+        <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf -m 18</eNB_main_exec_args>
+        <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 24M</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+        <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+        <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+        <UE_pre_exec_args></UE_pre_exec_args>
+        <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2680000000 -r100 --ue-scan-carrier --ue-txgain 85 --ue-rxgain 100 </UE_main_exec>
+        <UE_main_exec_args></UE_main_exec_args>
+        <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec>
+        <UE_traffic_exec_args></UE_traffic_exec_args>
+        <UE_search_expr_true>600</UE_search_expr_true>
+        <UE_search_expr_false></UE_search_expr_false>
+        <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+        <UE_metric  id="UE_DLSCH_BITRATE" 
+                description="UE downlink physical throughput"  
+                regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+                unit_of_meas = "kbps"/> 
+        <UE_metric  id="UE_FREQ_OFFSET" 
+                description="UE downlink frequency channel offset"  
+                regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+                unit_of_meas = "Hz"/> 
+        <UE_metric  id="UE_RX_OFFSET" 
+                description="UE downlink rx sample offset"  
+                regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+                unit_of_meas = ""/> 
+        <tags>UE_USRP.NOS1.DATA_IPERF_DL.BAND7.20MHZ.MCS18</tags>
+	<nruns>3</nruns><max_ntries>6</max_ntries>
+    </testCase> 
+
+
+
+ <testCase id="039430" >
+        <class>lte-softmodem-noS1</class>
+        <desc></desc>
+        <eNB>imb182-desktop</eNB>
+        <UE>yanbo-M4HM87P-00</UE>
+        <TimeOut_cmd>700</TimeOut_cmd>
+        <eNB_working_dir>/tmp</eNB_working_dir>
+        <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf  downlink_frequency 2680000000L</eNB_config_file>
+        <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+        <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+        <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+        <eNB_pre_exec_args></eNB_pre_exec_args>
+        <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+        <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf -m 28</eNB_main_exec_args>
+        <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 55M</eNB_traffic_exec> <!-- PHY max TP 73.334Mbps -> 75% = 55Mbps -->
+        <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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+        <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+        <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+        <UE_pre_exec_args></UE_pre_exec_args>
+        <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2680000000 -r100 --ue-scan-carrier --ue-txgain 85 --ue-rxgain 100 </UE_main_exec>
+        <UE_main_exec_args></UE_main_exec_args>
+        <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec>
+        <UE_traffic_exec_args></UE_traffic_exec_args>
+        <UE_search_expr_true>600</UE_search_expr_true>
+        <UE_search_expr_false></UE_search_expr_false>
+        <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+        <UE_metric  id="UE_DLSCH_BITRATE" 
+                description="UE downlink physical throughput"  
+                regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+                unit_of_meas = "kbps"/> 
+        <UE_metric  id="UE_FREQ_OFFSET" 
+                description="UE downlink frequency channel offset"  
+                regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+                unit_of_meas = "Hz"/> 
+        <UE_metric  id="UE_RX_OFFSET" 
+                description="UE downlink rx sample offset"  
+                regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+                unit_of_meas = ""/> 
+        <tags>UE_USRP.NOS1.DATA_IPERF_DL.BAND7.20MHZ.MCS28</tags>
+	<nruns>3</nruns><max_ntries>6</max_ntries>
+    </testCase> 
+
+
 
 
   </testCaseList>
diff --git a/cmake_targets/autotests/testsuite_ue_noS1_TCL.xml b/cmake_targets/autotests/testsuite_ue_noS1_TCL.xml
new file mode 100644
index 0000000000000000000000000000000000000000..971819ade587c7d578da052e43ab7cc7de55a8b6
--- /dev/null
+++ b/cmake_targets/autotests/testsuite_ue_noS1_TCL.xml
@@ -0,0 +1,3516 @@
+<testCaseList>
+
+<MachineList>TCT-Labo1 TCT-Labo3</MachineList> <!-- ued-PRM-130 -->
+ <NFSResultsShare>/mnt/sradio/TEST_RESULTS/</NFSResultsShare>
+ <GitOAI5GRepo> https://gitlab.eurecom.fr/oai/openairinterface5g.git</GitOAI5GRepo>
+ <!-- <GitOAI5GRepo>https://gitlab.eurecom.fr/oai/openairinterface5g.git</GitOAI5GRepo> -->
+ <!-- <GitOAI5GRepo>git@gitlab.com:TCL_Communications/openairinterface5g.git</GitOAI5GRepo> -->
+ <GitOpenair-cnRepo>https://gitlab.eurecom.fr/oai/openair-cn.git</GitOpenair-cnRepo> -->
+ <!--<GitOAI5GRepoBranch>develop_integration_w15</GitOAI5GRepoBranch>-->
+ <GitOAI5GRepoBranch>eNB_phy-test_fix_20MHz</GitOAI5GRepoBranch>
+ <GitOAI5GHeadVersion>eNB_phy-test_fix_20MHz</GitOAI5GHeadVersion> -->
+ <!-- <GitOAI5GHeadVersion>425b6fd525d9c4b0b3c2357926bbac5685e4b1e5</GitOAI5GHeadVersion> -->
+ <!-- <GitOAI5GHeadVersion>23822ea203e00f2100fa41c7ee3084ec55b884fe</GitOAI5GHeadVersion> --> 
+ <!-- <GitOAI5GHeadVersion></GitOAI5GHeadVersion>--> 
+ <!-- <OAI5GPatchDir></OAI5GPatchDir>--> 
+
+ <!--
+ <OAI5GPatchFile name="phy_test_dl_harq_reset.patch"/>
+ <OAI5GPatchFile name="phy_test__target_dl_mcs.patch"/>
+ <OAI5GPatchFile name="pdcp_fifo_netlink.patch"/>
+-->
+
+ <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</CleanUpOldProgs>	
+ <CleanUpAluLteBox>sudo -S -E /opt/ltebox/tools/stop_ltebox</CleanUpAluLteBox>
+<ExmimoRfStop>$OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; 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></TestCaseExclusionList>
+ <nruns_lte-softmodem></nruns_lte-softmodem>
+ <MachineListGeneric>TCT-Labo3</MachineListGeneric>
+
+
+<!-- USRP Testcases performances  030000 030030 030100 030900 030930 031000 031030 031600 031630 031700 031730 031800 031900 031930 032000 032100 032200 032300 032400 032500 032600 032700 032710 032730 032740 032800 032810 032830 032840 032870 036000 036100 036130 036170 -->
+
+<!-- USRP Testcases performances  030000 030030  030900 030930 031000 031030 031600 031630 031700 031730 031900 031930 032700 032730 032800 036000 036100 036130 032740 032710 -->
+
+<!-- Stability 032740 032710 -->
+
+
+    <!-- USRP Band 7 5MHz SISO Iperf downlink performances : 030030 030930 031030 031630 031730 031930 032730 032830 -->
+
+
+
+
+<!-- PHY-TEST DOWNLINK PERFORMANCE -->
+
+
+ <testCase id="030000" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>TCT-Labo3</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 0 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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_metric  id="UE_DLSCH_BITRATE" 
+        description="UE downlink physical throughput"  
+        regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+        unit_of_meas = "kbps"
+        pass_fail_stat = "mean_value"
+        min_limit = "510"/>
+    <tags>UE_USRP.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS00</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+ <testCase id="030001" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>ued-PRM-130</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 0 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w EXMIMO --noS1 --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C 2660000000 -r25 --ue-scan-carrier --ue-txgain 0 --ue-rxgain 5 -S -A 6 -F myriadRF_FMX --ue-max-power -25 --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "510"/>
+    <tags>UE_UEDV1.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS00</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+ <testCase id="030100" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>TCT-Labo3</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 1 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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_metric  id="UE_DLSCH_BITRATE" 
+                description="UE downlink physical throughput"  
+                regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+                unit_of_meas = "kbps"
+                pass_fail_stat = "mean_value"
+                min_limit = "678"/>
+    <tags>UE_USRP.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS01</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+ <testCase id="030101" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>ued-PRM-130</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 1 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w EXMIMO --noS1 --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C 2660000000 -r25 --ue-scan-carrier --ue-txgain 0 --ue-rxgain 5 -S -A 6 -F myriadRF_FMX --ue-max-power -25 --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "678"/>
+    <tags>UE_UEDV1.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS01</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+
+
+
+
+
+<testCase id="030900" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>TCT-Labo3</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 9 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "3006"/>
+    <tags>UE_USRP.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS09</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+ <testCase id="030901" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>ued-PRM-130</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 9 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w EXMIMO --noS1 --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C 2660000000 -r25 --ue-scan-carrier --ue-txgain 0 --ue-rxgain 5 -S -A 6 -F myriadRF_FMX --ue-max-power -25 --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "3006"/>
+    <tags>UE_UEDV1.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS09</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+<testCase id="031600" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>TCT-Labo3</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 16 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "3726"/>
+    <tags>UE_USRP.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS16</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+ <testCase id="031601" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>ued-PRM-130</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 16 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w EXMIMO --noS1 --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C 2660000000 -r25 --ue-scan-carrier --ue-txgain 0 --ue-rxgain 5 -S -A 6 -F myriadRF_FMX --ue-max-power -25 --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "3726"/>
+    <tags>UE_UEDV1.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS16</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+<testCase id="031000" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>TCT-Labo3</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 10 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_USRP.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS10</tags>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+        description="UE downlink physical throughput"  
+        regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+        unit_of_meas = "kbps"
+        pass_fail_stat = "mean_value"
+        min_limit = "3006"/>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+ <testCase id="031001" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>ued-PRM-130</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 10 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w EXMIMO --noS1 --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C 2660000000 -r25 --ue-scan-carrier --ue-txgain 0 --ue-rxgain 5 -S -A 6 -F myriadRF_FMX --ue-max-power -25 --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_UEDV1.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS10</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "3006"/>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+<testCase id="031700" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>TCT-Labo3</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 17 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_USRP.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS17</tags>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+        description="UE downlink physical throughput"  
+        regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+        unit_of_meas = "kbps"
+        pass_fail_stat = "mean_value"
+        min_limit = "5802"/>    
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+ <testCase id="031701" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>ued-PRM-130</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 17 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w EXMIMO --noS1 --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C 2660000000 -r25 --ue-scan-carrier --ue-txgain 0 --ue-rxgain 5 -S -A 6 -F myriadRF_FMX --ue-max-power -25 --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_UEDV1.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS17</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+        description="UE downlink physical throughput"  
+        regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+        unit_of_meas = "kbps"
+        pass_fail_stat = "mean_value"
+        min_limit = "5802"/>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+<testCase id="031800" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>TCT-Labo3</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 18 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_USRP.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS18</tags>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "5994"/>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+ <testCase id="031801" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>ued-PRM-130</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 18 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w EXMIMO --noS1 --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C 2660000000 -r25 --ue-scan-carrier --ue-txgain 0 --ue-rxgain 5 -S -A 6 -F myriadRF_FMX --ue-max-power -25 --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_UEDV1.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS18</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "5994"/>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+<testCase id="031900" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>TCT-Labo3</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 19 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_USRP.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS19</tags>
+     <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "6858"/>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+ <testCase id="031901" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>ued-PRM-130</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 19 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w EXMIMO --noS1 --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C 2660000000 -r25 --ue-scan-carrier --ue-txgain 0 --ue-rxgain 5 -S -A 6 -F myriadRF_FMX --ue-max-power -25 --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_UEDV1.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS19</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+     <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "6858"/>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+
+<testCase id="032000" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>TCT-Labo3</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 20 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_USRP.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS20</tags>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "7434"/>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+ <testCase id="032001" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>ued-PRM-130</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 20 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w EXMIMO --noS1 --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C 2660000000 -r25 --ue-scan-carrier --ue-txgain 0 --ue-rxgain 5 -S -A 6 -F myriadRF_FMX --ue-max-power -25 --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_UEDV1.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS20</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "7434"/>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+    <testCase id="032100" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>TCT-Labo3</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 21 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_USRP.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS21</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "8010"/>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+ <testCase id="032101" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>ued-PRM-130</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 21 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w EXMIMO --noS1 --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C 2660000000 -r25 --ue-scan-carrier --ue-txgain 0 --ue-rxgain 5 -S -A 6 -F myriadRF_FMX --ue-max-power -25 --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_UEDV1.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS21</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+     <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "8010"/>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+<testCase id="032200" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>TCT-Labo3</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 22 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_USRP.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS22</tags>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+        description="UE downlink physical throughput"  
+        regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+        unit_of_meas = "kbps"
+        pass_fail_stat = "mean_value"
+        min_limit = "8586"/>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+ <testCase id="032201" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>ued-PRM-130</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 22 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w EXMIMO --noS1 --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C 2660000000 -r25 --ue-scan-carrier --ue-txgain 0 --ue-rxgain 5 -S -A 6 -F myriadRF_FMX --ue-max-power -25 --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_UEDV1.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS22</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+        description="UE downlink physical throughput"  
+        regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+        unit_of_meas = "kbps"
+        pass_fail_stat = "mean_value"
+        min_limit = "8586"/>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+<testCase id="032300" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>TCT-Labo3</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 23 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_USRP.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS23</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+        description="UE downlink physical throughput"  
+        regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+        unit_of_meas = "kbps"
+        pass_fail_stat = "mean_value"
+        min_limit = "9432"/>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+ <testCase id="032301" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>ued-PRM-130</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 23 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w EXMIMO --noS1 --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C 2660000000 -r25 --ue-scan-carrier --ue-txgain 0 --ue-rxgain 5 -S -A 6 -F myriadRF_FMX --ue-max-power -25 --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_UEDV1.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS23</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "9432"/>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+<testCase id="032400" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>TCT-Labo3</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 24 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_USRP.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS24</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+        description="UE downlink physical throughput"  
+        regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+        unit_of_meas = "kbps"
+        pass_fail_stat = "mean_value"
+        min_limit = "10152"/>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+ <testCase id="032401" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>ued-PRM-130</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 24 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w EXMIMO --noS1 --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C 2660000000 -r25 --ue-scan-carrier --ue-txgain 0 --ue-rxgain 5 -S -A 6 -F myriadRF_FMX --ue-max-power -25 --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_UEDV1.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS24</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "10152"/>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+
+<testCase id="032500" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>TCT-Labo3</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 25 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_USRP.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS25</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+     <UE_metric  id="UE_DLSCH_BITRATE" 
+        description="UE downlink physical throughput"  
+        regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+        unit_of_meas = "kbps"
+        pass_fail_stat = "mean_value"
+        min_limit = "10584"/>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+ <testCase id="032501" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>ued-PRM-130</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 25 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w EXMIMO --noS1 --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C 2660000000 -r25 --ue-scan-carrier --ue-txgain 0 --ue-rxgain 5 -S -A 6 -F myriadRF_FMX --ue-max-power -25 --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_UEDV1.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS25</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+     <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "10584"/>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+<testCase id="032600" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>TCT-Labo3</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 26 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_USRP.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS26</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "11448"/>       
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+ <testCase id="032601" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>ued-PRM-130</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 26 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w EXMIMO --noS1 --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C 2660000000 -r25 --ue-scan-carrier --ue-txgain 0 --ue-rxgain 5 -S -A 6 -F myriadRF_FMX --ue-max-power -25 --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_UEDV1.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS26</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "11448"/>    
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+<testCase id="032700" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>TCT-Labo3</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 27 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_USRP.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS27</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "11880"/> 
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+ <testCase id="032701" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>ued-PRM-130</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 27 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w EXMIMO --noS1 --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C 2660000000 -r25 --ue-scan-carrier --ue-txgain 0 --ue-rxgain 5 -S -A 6 -F myriadRF_FMX --ue-max-power -25 --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_UEDV1.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS27</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "11880"/>    
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+ <testCase id="032801" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>ued-PRM-130</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 28 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w EXMIMO --noS1 --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C 2660000000 -r25 --ue-scan-carrier --ue-txgain 0 --ue-rxgain 5 -S -A 6 -F myriadRF_FMX --ue-max-power -25 --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_UEDV1.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS28</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+   <UE_metric  id="UE_DLSCH_BITRATE" 
+        description="UE downlink physical throughput"  
+        regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+        unit_of_meas = "kbps"
+        pass_fail_stat = "mean_value"
+        min_limit = "13752"/>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+
+<testCase id="032710" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>TCT-Labo3</UE>
+    <TimeOut_cmd>3600</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 27 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_USRP.NOS1.PHYTEST_STAB.BAND7.5MHZ.MCS27</tags>
+    <nruns>1</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "11880"/>    
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+ <testCase id="032711" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>ued-PRM-130</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 27 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w EXMIMO --noS1 --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C 2660000000 -r25 --ue-scan-carrier --ue-txgain 0 --ue-rxgain 5 -S -A 6 -F myriadRF_FMX --ue-max-power -25 --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_UEDV1.NOS1.PHYTEST_STAB.BAND7.5MHZ.MCS27</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "11880"/>    
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+
+ <testCase id="036000" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>TCT-Labo3</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf -W -m 27 --single-thread-disable --phy-test </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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2685000000 -r50 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_USRP.NOS1.PHYTEST_PERF.BAND7.10MHZ.MCS27</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "22193"/>    
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+ <testCase id="036001" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>ued-PRM-130</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf -W -m 27 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w EXMIMO --noS1 --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2685000000 -r50 --ue-scan-carrier --ue-txgain 0 --ue-rxgain 5 -S -A 6 -F myriadRF_FMX --ue-max-power -25 --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_UEDV1.NOS1.PHYTEST_PERF.BAND7.10MHZ.MCS27</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "22193"/>    
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+
+ <testCase id="036100" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>TCT-Labo3</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf -W -m 28 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2685000000 -r50 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_USRP.NOS1.PHYTEST_PERF.BAND7.10MHZ.MCS28</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "25687"/>    
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+
+
+ <testCase id="035201" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>ued-PRM-130</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf -W -m 19 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w EXMIMO --noS1 --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2685000000 -r50 --ue-scan-carrier --ue-txgain 0 --ue-rxgain 5 -S -A 6 -F myriadRF_FMX --ue-max-power -25 --phy-test</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec></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>
+    <tags>UE_UEDV1.NOS1.PHYTEST_PERF.BAND7.10MHZ.MCS19</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "12835"/>
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+
+
+ <testCase id="036130" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>TCT-Labo3</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf -W -m 28 </eNB_main_exec_args>
+    <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 30M</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2685000000 -r50 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>200</UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <tags>UE_USRP.NOS1.DATA_IPERF.BAND7.10MHZ.MCS28</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"/> 
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+
+
+
+
+ <testCase id="030031" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>ued-PRM-130</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 0</eNB_main_exec_args>
+    <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 512K</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w EXMIMO --noS1 --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C 2660000000 -r25 --ue-scan-carrier --ue-txgain 15 --ue-rxgain 5 -S -A 6 -F myriadRF_FMX --ue-max-power -25</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>200</UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>  
+    <tags>UE_UEDV1.NOS1.DATA_IPERF.BAND7.5MHZ.MCS00</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"/> 
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+
+
+ <testCase id="030931" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>ued-PRM-130</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 9 </eNB_main_exec_args>
+    <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 2M</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w EXMIMO --noS1 --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C 2660000000 -r25 --ue-scan-carrier --ue-txgain 15 --ue-rxgain 5 -S -A 6 -F myriadRF_FMX --ue-max-power -25</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>200</UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <tags>UE_UEDV1.NOS1.DATA_IPERF.BAND7.5MHZ.MCS09</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"/> 
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+
+
+ <testCase id="031031" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>ued-PRM-130</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 10 </eNB_main_exec_args>
+    <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 2M</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w EXMIMO --noS1 --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C 2660000000 -r25 --ue-scan-carrier --ue-txgain 15 --ue-rxgain 5 -S -A 6 -F myriadRF_FMX --ue-max-power -25</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>200</UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <tags>UE_UEDV1.NOS1.DATA_IPERF.BAND7.5MHZ.MCS10</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"/> 
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+
+
+
+
+ <testCase id="031631" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>ued-PRM-130</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 16 </eNB_main_exec_args>
+    <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 2M</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w EXMIMO --noS1 --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C 2660000000 -r25 --ue-scan-carrier --ue-txgain 15 --ue-rxgain 5 -S -A 6 -F myriadRF_FMX --ue-max-power -25</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>200</UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <tags>UE_UEDV1.NOS1.DATA_IPERF.BAND7.5MHZ.MCS16</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"/> 
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+
+
+
+ <testCase id="031731" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>ued-PRM-130</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 17 </eNB_main_exec_args>
+    <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 2M</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w EXMIMO --noS1 --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C 2660000000 -r25 --ue-scan-carrier --ue-txgain 15 --ue-rxgain 5 -S -A 6 -F myriadRF_FMX --ue-max-power -25</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>200</UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <tags>UE_UEDV1.NOS1.DATA_IPERF.BAND7.5MHZ.MCS17</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"/> 
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+
+
+
+
+
+
+ <testCase id="031931" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>ued-PRM-130</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 19 </eNB_main_exec_args>
+    <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 10M</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w EXMIMO --noS1 --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C 2660000000 -r25 --ue-scan-carrier --ue-txgain 15 --ue-rxgain 5 -S -A 6 -F myriadRF_FMX --ue-max-power -25</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>200</UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <tags>UE_UEDV1.NOS1.DATA_IPERF.BAND7.5MHZ.MCS19</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"/> 
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+
+
+
+ <testCase id="032740" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>TCT-Labo3</UE>
+    <TimeOut_cmd>3600</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 27 </eNB_main_exec_args>
+    <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 2M</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>2800</UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <tags>UE_USRP.NOS1.DATA_IPERF_STAB.BAND7.5MHZ.MCS27</tags>
+    <nruns>1</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"/> 
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+
+ <testCase id="032731" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>ued-PRM-130</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 27 </eNB_main_exec_args>
+    <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 2M</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w EXMIMO --noS1 --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C 2660000000 -r25 --ue-scan-carrier --ue-txgain 15 --ue-rxgain 5 -S -A 6 -F myriadRF_FMX --ue-max-power -25</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>200</UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <tags>UE_UEDV1.NOS1.DATA_IPERF.BAND7.5MHZ.MCS27</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"/> 
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+
+    <!-- USRP Band 7 5MHz SISO Iperf downlink performances -->
+    <!-- 030030 030930 031030 031630 031730 031930 032730 032830 -->
+
+    <testCase id="030030" >
+        <class>lte-softmodem-noS1</class>
+        <desc></desc>
+        <eNB>TCT-Labo1</eNB>
+        <UE>TCT-Labo3</UE>
+        <TimeOut_cmd>300</TimeOut_cmd>
+        <eNB_working_dir>/tmp</eNB_working_dir>
+        <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+        <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+        <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+        <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+        <eNB_pre_exec_args></eNB_pre_exec_args>
+        <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+        <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 0 </eNB_main_exec_args>
+        <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 512K</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+        <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+        <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+        <UE_pre_exec_args></UE_pre_exec_args>
+        <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S</UE_main_exec>
+        <UE_main_exec_args></UE_main_exec_args>
+        <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec>
+        <UE_traffic_exec_args></UE_traffic_exec_args>
+        <UE_search_expr_true>200</UE_search_expr_true>
+        <UE_search_expr_false></UE_search_expr_false>
+        <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+        <tags>UE_USRP.NOS1.DATA_IPERF.BAND7.5MHZ.MCS00</tags>
+        <nruns>3</nruns><max_ntries>6</max_ntries>
+        <UE_metric  id="UE_DLSCH_BITRATE" 
+                description="UE downlink physical throughput"  
+                regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+                unit_of_meas = "kbps"/> 
+        <UE_metric  id="UE_FREQ_OFFSET" 
+                description="UE downlink frequency channel offset"  
+                regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+                unit_of_meas = "Hz"/> 
+        <UE_metric  id="UE_RX_OFFSET" 
+                description="UE downlink rx sample offset"  
+                regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+                unit_of_meas = ""/> 
+    </testCase> 
+
+
+
+    <testCase id="030930" >
+        <class>lte-softmodem-noS1</class>
+        <desc></desc>
+        <eNB>TCT-Labo1</eNB>
+        <UE>TCT-Labo3</UE>
+        <TimeOut_cmd>300</TimeOut_cmd>
+        <eNB_working_dir>/tmp</eNB_working_dir>
+        <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+        <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+        <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+        <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+        <eNB_pre_exec_args></eNB_pre_exec_args>
+        <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+        <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 9 </eNB_main_exec_args>
+        <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 2M</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+        <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+        <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+        <UE_pre_exec_args></UE_pre_exec_args>
+        <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S</UE_main_exec>
+        <UE_main_exec_args></UE_main_exec_args>
+        <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec>
+        <UE_traffic_exec_args></UE_traffic_exec_args>
+        <UE_search_expr_true>200</UE_search_expr_true>
+        <UE_search_expr_false></UE_search_expr_false>
+        <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+        <tags>UE_USRP.NOS1.DATA_IPERF.BAND7.5MHZ.MCS09</tags>
+        <nruns>3</nruns><max_ntries>6</max_ntries>
+        <UE_metric  id="UE_DLSCH_BITRATE" 
+                description="UE downlink physical throughput"  
+                regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+                unit_of_meas = "kbps"/> 
+        <UE_metric  id="UE_FREQ_OFFSET" 
+                description="UE downlink frequency channel offset"  
+                regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+                unit_of_meas = "Hz"/> 
+        <UE_metric  id="UE_RX_OFFSET" 
+                description="UE downlink rx sample offset"  
+                regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+                unit_of_meas = ""/> 
+    </testCase> 
+    
+    
+ <testCase id="031030" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>TCT-Labo3</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 10 </eNB_main_exec_args>
+    <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 2M</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>200</UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <tags>UE_USRP.NOS1.DATA_IPERF.BAND7.5MHZ.MCS10</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"/> 
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+
+
+ <testCase id="031630" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>TCT-Labo3</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 16 </eNB_main_exec_args>
+    <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 2M</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>200</UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <tags>UE_USRP.NOS1.DATA_IPERF.BAND7.5MHZ.MCS16</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"/> 
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+    
+    
+ <testCase id="031730" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>TCT-Labo3</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 17 </eNB_main_exec_args>
+    <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 2M</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>200</UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <tags>UE_USRP.NOS1.DATA_IPERF.BAND7.5MHZ.MCS17</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"/> 
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+    
+     <testCase id="031930" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>TCT-Labo3</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 19 </eNB_main_exec_args>
+    <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 2M</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S</UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>200</UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <tags>UE_USRP.NOS1.DATA_IPERF.BAND7.5MHZ.MCS19</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"/> 
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+    
+    
+     <testCase id="032730" >
+    <class>lte-softmodem-noS1</class>
+    <desc></desc>
+    <eNB>TCT-Labo1</eNB>
+    <UE>TCT-Labo3</UE>
+    <TimeOut_cmd>300</TimeOut_cmd>
+    <eNB_working_dir>/tmp</eNB_working_dir>
+    <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+    <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+    <eNB_compile_prog_args>-c -w USRP --eNB --noS1 </eNB_compile_prog_args>
+    <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+    <eNB_pre_exec_args></eNB_pre_exec_args>
+    <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+    <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 27 </eNB_main_exec_args>
+    <eNB_traffic_exec>sleep 30;iperf -c 10.0.1.9 -i 1 -u -b 15M</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+    <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+    <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+    <UE_pre_exec_args></UE_pre_exec_args>
+    <UE_main_exec>sleep 5; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S </UE_main_exec>
+    <UE_main_exec_args></UE_main_exec_args>
+    <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec>
+    <UE_traffic_exec_args></UE_traffic_exec_args>
+    <UE_search_expr_true>200</UE_search_expr_true>
+    <UE_search_expr_false></UE_search_expr_false>
+    <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+    <tags>UE_USRP.NOS1.DATA_IPERF.BAND7.5MHZ.MCS27</tags>
+    <nruns>3</nruns><max_ntries>6</max_ntries>
+    <UE_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"/> 
+    <UE_metric  id="UE_FREQ_OFFSET" 
+            description="UE downlink frequency channel offset"  
+            regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+            unit_of_meas = "Hz"/> 
+    <UE_metric  id="UE_RX_OFFSET" 
+            description="UE downlink rx sample offset"  
+            regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+            unit_of_meas = ""/> 
+    </testCase> 
+
+
+
+
+
+
+
+
+
+
+
+    <testCase id="032800" >
+        <class>lte-softmodem-noS1</class>
+        <desc></desc>
+        <eNB>TCT-Labo1</eNB>
+        <UE>TCT-Labo3</UE>
+        <TimeOut_cmd>300</TimeOut_cmd>
+        <eNB_working_dir>/tmp</eNB_working_dir>
+        <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+        <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+        <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+        <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+        <eNB_pre_exec_args></eNB_pre_exec_args>
+        <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+        <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 28 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+        <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+        <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+        <UE_pre_exec_args></UE_pre_exec_args>
+        <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S --phy-test</UE_main_exec>
+        <UE_main_exec_args></UE_main_exec_args>
+        <UE_traffic_exec></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_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "13752"/>
+        <UE_metric  id="UE_FREQ_OFFSET" 
+                description="UE downlink frequency channel offset"  
+                regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+                unit_of_meas = "Hz"/> 
+        <UE_metric  id="UE_RX_OFFSET" 
+                description="UE downlink rx sample offset"  
+                regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+                unit_of_meas = ""/> 
+        <tags>UE_USRP.NOS1.PHYTEST_PERF.BAND7.5MHZ.MCS28</tags>
+        <nruns>3</nruns><max_ntries>6</max_ntries>
+    </testCase> 
+
+    <testCase id="032810" >
+        <class>lte-softmodem-noS1</class>
+        <desc></desc>
+        <eNB>TCT-Labo1</eNB>
+        <UE>TCT-Labo3</UE>
+        <TimeOut_cmd>18000</TimeOut_cmd>
+        <eNB_working_dir>/tmp</eNB_working_dir>
+        <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+        <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+        <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+        <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+        <eNB_pre_exec_args></eNB_pre_exec_args>
+        <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+        <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 28 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+        <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+        <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+        <UE_pre_exec_args></UE_pre_exec_args>
+        <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S --phy-test</UE_main_exec>
+        <UE_main_exec_args></UE_main_exec_args>
+        <UE_traffic_exec></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_metric  id="UE_DLSCH_BITRATE" 
+                description="UE downlink physical throughput"  
+                regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+                unit_of_meas = "kbps"
+                pass_fail_stat = "mean_value"
+                min_limit = "11880"/>    
+        <UE_metric  id="UE_FREQ_OFFSET" 
+                description="UE downlink frequency channel offset"  
+                regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+                unit_of_meas = "Hz"/> 
+        <UE_metric  id="UE_RX_OFFSET" 
+                description="UE downlink rx sample offset"  
+                regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+                unit_of_meas = ""/> 
+        <tags>UE_USRP.NOS1.PHYTEST_STAB.BAND7.5MHZ.MCS28</tags>
+        <nruns>1</nruns><max_ntries>6</max_ntries>
+    </testCase> 
+    
+
+    <testCase id="032830" >
+        <class>lte-softmodem-noS1</class>
+        <desc></desc>
+        <eNB>TCT-Labo1</eNB>
+        <UE>TCT-Labo3</UE>
+        <TimeOut_cmd>300</TimeOut_cmd>
+        <eNB_working_dir>/tmp</eNB_working_dir>
+        <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+        <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+        <eNB_compile_prog_args>-c -w USRP --eNB --noS1 </eNB_compile_prog_args>
+        <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+        <eNB_pre_exec_args></eNB_pre_exec_args>
+        <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+        <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 28 </eNB_main_exec_args>
+        <eNB_traffic_exec>sleep 30;iperf -c 10.0.1.9 -i 1 -u -b 13700K</eNB_traffic_exec> <!-- PHY max TP 18.336Mbps -> 75% = 13.70Mbps -->
+        <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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+        <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+        <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+        <UE_pre_exec_args></UE_pre_exec_args>
+        <UE_main_exec>sleep 5; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S </UE_main_exec>
+        <UE_main_exec_args></UE_main_exec_args>
+        <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec>
+        <UE_traffic_exec_args></UE_traffic_exec_args>
+        <UE_search_expr_true>200</UE_search_expr_true>
+        <UE_search_expr_false></UE_search_expr_false>
+        <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+        <UE_metric  id="UE_DLSCH_BITRATE" 
+                description="UE downlink physical throughput"  
+                regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+                unit_of_meas = "kbps"/> 
+        <UE_metric  id="UE_FREQ_OFFSET" 
+                description="UE downlink frequency channel offset"  
+                regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+                unit_of_meas = "Hz"/> 
+        <UE_metric  id="UE_RX_OFFSET" 
+                description="UE downlink rx sample offset"  
+                regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+                unit_of_meas = ""/> 
+        <UE_traffic_metric
+                mode="UDP"
+                duration_min="200"
+
+        />
+        <tags>UE_USRP.NOS1.DATA_IPERF_DL.BAND7.5MHZ.MCS28</tags>
+        <nruns>3</nruns><max_ntries>6</max_ntries>
+    </testCase> 
+
+
+    <testCase id="032840" >
+        <class>lte-softmodem-noS1</class>
+        <desc></desc>
+        <eNB>TCT-Labo1</eNB>
+        <UE>TCT-Labo3</UE>
+        <TimeOut_cmd>3600</TimeOut_cmd>
+        <tags>UE_USRP.NOS1.DATA_IPERF_STAB_DL.BAND7.5MHZ.MCS28</tags>
+        <nruns>1</nruns><max_ntries>6</max_ntries>
+
+        <eNB_working_dir>/tmp</eNB_working_dir>
+        <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+        <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+        <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+        <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+        <eNB_pre_exec_args></eNB_pre_exec_args>
+        <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+        <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 28 </eNB_main_exec_args>
+        <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 2M</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+        <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+        <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+        <UE_pre_exec_args></UE_pre_exec_args>
+        <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S</UE_main_exec>
+        <UE_main_exec_args></UE_main_exec_args>
+        <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec>
+        <UE_traffic_exec_args></UE_traffic_exec_args>
+        <UE_search_expr_true>2800</UE_search_expr_true>
+        <UE_search_expr_false></UE_search_expr_false>
+        <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+        <UE_metric  id="UE_DLSCH_BITRATE" 
+                description="UE downlink physical throughput"  
+                regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+                unit_of_meas = "kbps"/> 
+        <UE_metric  id="UE_FREQ_OFFSET" 
+                description="UE downlink frequency channel offset"  
+                regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+                unit_of_meas = "Hz"/> 
+        <UE_metric  id="UE_RX_OFFSET" 
+                description="UE downlink rx sample offset"  
+                regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+                unit_of_meas = ""/> 
+
+    </testCase> 
+
+
+
+    <testCase id="032870" >
+        <class>lte-softmodem-noS1</class>
+        <desc></desc>
+        <eNB>TCT-Labo1</eNB>
+        <UE>TCT-Labo3</UE>
+        <TimeOut_cmd>300</TimeOut_cmd>
+        <eNB_working_dir>/tmp</eNB_working_dir>
+        <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+        <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+        <eNB_compile_prog_args>-c -w USRP --eNB --noS1 </eNB_compile_prog_args>
+        <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+        <eNB_pre_exec_args></eNB_pre_exec_args>
+        <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+        <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf -W -m 28 </eNB_main_exec_args>
+        <eNB_traffic_exec>sleep 30;iperf -c 10.0.1.9 -i 1</eNB_traffic_exec> <!-- PHY max TP 18.336Mbps -> 75% = 13.70Mbps -->
+        <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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+        <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+        <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+        <UE_pre_exec_args></UE_pre_exec_args>
+        <UE_main_exec>sleep 5; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2660000000 -r25 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100 -S </UE_main_exec>
+        <UE_main_exec_args></UE_main_exec_args>
+        <UE_traffic_exec>iperf -s -i 1</UE_traffic_exec>
+        <UE_traffic_exec_args></UE_traffic_exec_args>
+        <UE_search_expr_true>200</UE_search_expr_true>
+        <UE_search_expr_false></UE_search_expr_false>
+        <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+        <UE_metric  id="UE_DLSCH_BITRATE" 
+                description="UE downlink physical throughput"  
+                regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+                unit_of_meas = "kbps"/> 
+        <UE_metric  id="UE_FREQ_OFFSET" 
+                description="UE downlink frequency channel offset"  
+                regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+                unit_of_meas = "Hz"/> 
+        <UE_metric  id="UE_RX_OFFSET" 
+                description="UE downlink rx sample offset"  
+                regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+                unit_of_meas = ""/> 
+        <UE_traffic_metric
+                mode="TCP"
+                duration_min="200"
+                bandwidth_min="13.7"
+        />
+        <tags>UE_USRP.NOS1.DATA_IPERF_TCP_DL.BAND7.5MHZ.MCS28</tags>
+        <nruns>3</nruns><max_ntries>6</max_ntries>
+    </testCase> 
+
+
+    <testCase id="036170" >
+        <class>lte-softmodem-noS1</class>
+        <desc></desc>
+        <eNB>TCT-Labo1</eNB>
+        <UE>TCT-Labo3</UE>
+        <TimeOut_cmd>300</TimeOut_cmd>
+        <eNB_working_dir>/tmp</eNB_working_dir>
+        <eNB_config_file>/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf  downlink_frequency 2660000000L</eNB_config_file>
+        <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+        <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+        <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+        <eNB_pre_exec_args></eNB_pre_exec_args>
+        <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+        <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf -W -m 28 </eNB_main_exec_args>
+        <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+        <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+        <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+        <UE_pre_exec_args></UE_pre_exec_args>
+        <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2685000000 -r50 --ue-scan-carrier --ue-txgain 85 -A 24 --ue-rxgain 100  -S</UE_main_exec>
+        <UE_main_exec_args></UE_main_exec_args>
+        <UE_traffic_exec>iperf -s -i 1</UE_traffic_exec>
+        <UE_traffic_exec_args></UE_traffic_exec_args>
+        <UE_search_expr_true>200</UE_search_expr_true>
+        <UE_search_expr_false></UE_search_expr_false>
+        <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+        <tags>UE_USRP.NOS1.DATA_IPERF_TCP_DL.BAND7.10MHZ.MCS28</tags>
+        <nruns>3</nruns><max_ntries>6</max_ntries>
+        <UE_metric  id="UE_DLSCH_BITRATE" 
+                description="UE downlink physical throughput"  
+                regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+                unit_of_meas = "kbps"/> 
+        <UE_metric  id="UE_FREQ_OFFSET" 
+                description="UE downlink frequency channel offset"  
+                regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+                unit_of_meas = "Hz"/> 
+        <UE_metric  id="UE_RX_OFFSET" 
+                description="UE downlink rx sample offset"  
+                regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+                unit_of_meas = ""/> 
+        <UE_traffic_metric
+                mode="TCP"
+                duration_min="200"
+                bandwidth_min="27.5"
+        />
+    </testCase> 
+
+
+ <!--20 MHz test -->
+
+<testCase id="039400" >
+        <class>lte-softmodem-noS1</class>
+        <desc></desc>
+        <eNB>TCT-Labo1</eNB>
+        <UE>TCT-Labo3</UE>
+        <TimeOut_cmd>300</TimeOut_cmd>
+        <eNB_working_dir>/tmp</eNB_working_dir>
+        <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf  downlink_frequency 2680000000L</eNB_config_file>
+        <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+        <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+        <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+        <eNB_pre_exec_args></eNB_pre_exec_args>
+        <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+        <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf -m 28 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+        <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+        <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+        <UE_pre_exec_args></UE_pre_exec_args>
+        <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2680000000 -r100 --ue-scan-carrier --ue-txgain 85 --ue-rxgain 100 -S --phy-test</UE_main_exec>
+        <UE_main_exec_args></UE_main_exec_args>
+        <UE_traffic_exec></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_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "55008"/>
+        <UE_metric  id="UE_FREQ_OFFSET" 
+                description="UE downlink frequency channel offset"  
+                regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+                unit_of_meas = "Hz"/> 
+        <UE_metric  id="UE_RX_OFFSET" 
+                description="UE downlink rx sample offset"  
+                regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+                unit_of_meas = ""/> 
+        <tags>UE_USRP.NOS1.PHYTEST_PERF.BAND7.20MHZ.MCS28</tags>
+	<nruns>3</nruns><max_ntries>6</max_ntries>
+    </testCase> 
+
+
+ <testCase id="036600" >
+        <class>lte-softmodem-noS1</class>
+        <desc></desc>
+        <eNB>TCT-Labo1</eNB>
+        <UE>TCT-Labo3</UE>
+        <TimeOut_cmd>300</TimeOut_cmd>
+        <eNB_working_dir>/tmp</eNB_working_dir>
+        <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf  downlink_frequency 2680000000L</eNB_config_file>
+        <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+        <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+        <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+        <eNB_pre_exec_args></eNB_pre_exec_args>
+        <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+        <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf -m 0 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+        <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+        <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+        <UE_pre_exec_args></UE_pre_exec_args>
+        <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2680000000 -r100 --ue-scan-carrier --ue-txgain 85 --ue-rxgain 100 -S --phy-test</UE_main_exec>
+        <UE_main_exec_args></UE_main_exec_args>
+        <UE_traffic_exec></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_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "2040"/>
+        <UE_metric  id="UE_FREQ_OFFSET" 
+                description="UE downlink frequency channel offset"  
+                regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+                unit_of_meas = "Hz"/> 
+        <UE_metric  id="UE_RX_OFFSET" 
+                description="UE downlink rx sample offset"  
+                regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+                unit_of_meas = ""/> 
+        <tags>UE_USRP.NOS1.PHYTEST_PERF.BAND7.20MHZ.MCS0</tags>
+	<nruns>3</nruns><max_ntries>6</max_ntries>
+    </testCase> 
+
+
+ <testCase id="038400" >
+        <class>lte-softmodem-noS1</class>
+        <desc></desc>
+        <eNB>TCT-Labo1</eNB>
+        <UE>TCT-Labo3</UE>
+        <TimeOut_cmd>300</TimeOut_cmd>
+        <eNB_working_dir>/tmp</eNB_working_dir>
+        <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf  downlink_frequency 2680000000L</eNB_config_file>
+        <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+        <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+        <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+        <eNB_pre_exec_args></eNB_pre_exec_args>
+        <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+        <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf -m 18 --single-thread-disable --phy-test</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+        <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+        <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+        <UE_pre_exec_args></UE_pre_exec_args>
+        <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2680000000 -r100 --ue-scan-carrier --ue-txgain 85 --ue-rxgain 100 -S --phy-test</UE_main_exec>
+        <UE_main_exec_args></UE_main_exec_args>
+        <UE_traffic_exec></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_metric  id="UE_DLSCH_BITRATE" 
+            description="UE downlink physical throughput"  
+            regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+            unit_of_meas = "kbps"
+            pass_fail_stat = "mean_value"
+            min_limit = "23976"/>
+        <UE_metric  id="UE_FREQ_OFFSET" 
+                description="UE downlink frequency channel offset"  
+                regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+                unit_of_meas = "Hz"/> 
+        <UE_metric  id="UE_RX_OFFSET" 
+                description="UE downlink rx sample offset"  
+                regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+                unit_of_meas = ""/> 
+        <tags>UE_USRP.NOS1.PHYTEST_PERF.BAND7.20MHZ.MCS18</tags>
+	<nruns>3</nruns><max_ntries>6</max_ntries>
+    </testCase> 
+
+
+
+ <testCase id="036630" >
+        <class>lte-softmodem-noS1</class>
+        <desc></desc>
+        <eNB>TCT-Labo1</eNB>
+        <UE>TCT-Labo3</UE>
+        <TimeOut_cmd>700</TimeOut_cmd>
+        <eNB_working_dir>/tmp</eNB_working_dir>
+        <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf  downlink_frequency 2680000000L</eNB_config_file>
+        <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+        <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+        <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+        <eNB_pre_exec_args></eNB_pre_exec_args>
+        <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+        <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf -m 0</eNB_main_exec_args>
+        <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 2M</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+        <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+        <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+        <UE_pre_exec_args></UE_pre_exec_args>
+        <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2680000000 -r100 --ue-scan-carrier --ue-txgain 85 --ue-rxgain 100 </UE_main_exec>
+        <UE_main_exec_args></UE_main_exec_args>
+        <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec>
+        <UE_traffic_exec_args></UE_traffic_exec_args>
+        <UE_search_expr_true>600</UE_search_expr_true>
+        <UE_search_expr_false></UE_search_expr_false>
+        <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+        <UE_metric  id="UE_DLSCH_BITRATE" 
+                description="UE downlink physical throughput"  
+                regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+                unit_of_meas = "kbps"/> 
+        <UE_metric  id="UE_FREQ_OFFSET" 
+                description="UE downlink frequency channel offset"  
+                regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+                unit_of_meas = "Hz"/> 
+        <UE_metric  id="UE_RX_OFFSET" 
+                description="UE downlink rx sample offset"  
+                regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+                unit_of_meas = ""/> 
+        <tags>UE_USRP.NOS1.DATA_IPERF_DL.BAND7.20MHZ.MCS0</tags>
+	<nruns>3</nruns><max_ntries>6</max_ntries>
+    </testCase> 
+
+ 
+ <testCase id="038430" >
+        <class>lte-softmodem-noS1</class>
+        <desc></desc>
+        <eNB>TCT-Labo1</eNB>
+        <UE>TCT-Labo3</UE>
+        <TimeOut_cmd>700</TimeOut_cmd>
+        <eNB_working_dir>/tmp</eNB_working_dir>
+        <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf  downlink_frequency 2680000000L</eNB_config_file>
+        <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+        <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+        <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+        <eNB_pre_exec_args></eNB_pre_exec_args>
+        <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+        <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf -m 18</eNB_main_exec_args>
+        <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 24M</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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+        <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+        <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+        <UE_pre_exec_args></UE_pre_exec_args>
+        <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2680000000 -r100 --ue-scan-carrier --ue-txgain 85 --ue-rxgain 100 </UE_main_exec>
+        <UE_main_exec_args></UE_main_exec_args>
+        <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec>
+        <UE_traffic_exec_args></UE_traffic_exec_args>
+        <UE_search_expr_true>600</UE_search_expr_true>
+        <UE_search_expr_false></UE_search_expr_false>
+        <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+        <UE_metric  id="UE_DLSCH_BITRATE" 
+                description="UE downlink physical throughput"  
+                regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+                unit_of_meas = "kbps"/> 
+        <UE_metric  id="UE_FREQ_OFFSET" 
+                description="UE downlink frequency channel offset"  
+                regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+                unit_of_meas = "Hz"/> 
+        <UE_metric  id="UE_RX_OFFSET" 
+                description="UE downlink rx sample offset"  
+                regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+                unit_of_meas = ""/> 
+        <tags>UE_USRP.NOS1.DATA_IPERF_DL.BAND7.20MHZ.MCS18</tags>
+	<nruns>3</nruns><max_ntries>6</max_ntries>
+    </testCase> 
+
+
+
+ <testCase id="039430" >
+        <class>lte-softmodem-noS1</class>
+        <desc></desc>
+        <eNB>TCT-Labo1</eNB>
+        <UE>TCT-Labo3</UE>
+        <TimeOut_cmd>700</TimeOut_cmd>
+        <eNB_working_dir>/tmp</eNB_working_dir>
+        <eNB_config_file>targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf  downlink_frequency 2680000000L</eNB_config_file>
+        <eNB_compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</eNB_compile_prog>
+        <eNB_compile_prog_args>-c -w USRP --eNB --noS1</eNB_compile_prog_args>
+        <eNB_pre_exec>source $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 eNB</eNB_pre_exec>
+        <eNB_pre_exec_args></eNB_pre_exec_args>
+        <eNB_main_exec>$OPENAIR_DIR/cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1</eNB_main_exec>
+        <eNB_main_exec_args> -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf -m 28</eNB_main_exec_args>
+        <eNB_traffic_exec>sleep 80;iperf -c 10.0.1.9 -i 1 -u -b 55M</eNB_traffic_exec> <!-- PHY max TP 73.334Mbps -> 75% = 55Mbps -->
+        <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>$OPENAIR_DIR/cmake_targets/build_oai</UE_compile_prog>
+        <UE_compile_prog_args>-c --UE -w USRP --noS1 --eNB --ue-autotest-trace </UE_compile_prog_args>
+        <UE_pre_exec>source ./targets/bin/init_nas_nos1 UE</UE_pre_exec>
+        <UE_pre_exec_args></UE_pre_exec_args>
+        <UE_main_exec>sleep 20; ./cmake_targets/autotests/tools/run_gdb ./cmake_targets/lte_noS1_build_oai/build/lte-softmodem-nos1 -U -C2680000000 -r100 --ue-scan-carrier --ue-txgain 85 --ue-rxgain 100 </UE_main_exec>
+        <UE_main_exec_args></UE_main_exec_args>
+        <UE_traffic_exec>iperf -s -i 1 -u</UE_traffic_exec>
+        <UE_traffic_exec_args></UE_traffic_exec_args>
+        <UE_search_expr_true>600</UE_search_expr_true>
+        <UE_search_expr_false></UE_search_expr_false>
+        <UE_terminate_missing_procs>False</UE_terminate_missing_procs>
+        <UE_metric  id="UE_DLSCH_BITRATE" 
+                description="UE downlink physical throughput"  
+                regex='(UE_DLSCH_BITRATE) =\s+(\d+\.\d+) kbps.+frame = (\d+)\)' 
+                unit_of_meas = "kbps"/> 
+        <UE_metric  id="UE_FREQ_OFFSET" 
+                description="UE downlink frequency channel offset"  
+                regex='(UE_FREQ_OFFSET) =\s+(-?\d+) Hz.+frame = (\d+)\)' 
+                unit_of_meas = "Hz"/> 
+        <UE_metric  id="UE_RX_OFFSET" 
+                description="UE downlink rx sample offset"  
+                regex='(UE_RX_OFFSET) =\s+(-?\d+).+frame = (\d+)\)' 
+                unit_of_meas = ""/> 
+        <tags>UE_USRP.NOS1.DATA_IPERF_DL.BAND7.20MHZ.MCS28</tags>
+	<nruns>3</nruns><max_ntries>6</max_ntries>
+    </testCase> 
+
+
+
+
+  </testCaseList>
+
diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai
index 119c013832691f4c3c11555421171dcef922c5d4..93a7ac073ee88a9d2b359025a4c33c743ce19efc 100755
--- a/cmake_targets/build_oai
+++ b/cmake_targets/build_oai
@@ -33,6 +33,13 @@ ORIGIN_PATH=$PWD
 THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
 source $THIS_SCRIPT_PATH/tools/build_helper
 
+# set environment variables (OPENAIR_HOME, ...)
+set_openair_env
+
+#variables for UE data generation
+gen_nvram_path=$OPENAIR_DIR/targets/bin
+conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf
+
 MSC_GEN="False"
 XFORMS="True"
 FLEXRAN_AGENT_SB_IF="True"
@@ -55,11 +62,10 @@ T_TRACER="False"
 DISABLE_HARDWARE_DEPENDENCY="False"
 CMAKE_BUILD_TYPE=""
 UE_AUTOTEST_TRACE="False"
+BUILD_ECLIPSE=0
+CMAKE_CMD='cmake'
 trap handle_ctrl_c INT
 
-gen_nvram_path=$OPENAIR_DIR/targets/bin
-conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf
-
 function print_help() {
   echo_info "
 This program installs OpenAirInterface Software
@@ -141,6 +147,8 @@ Options
    Disable HW dependency during installation
 --ue-autotest-trace
     Enable specific traces for UE autotest framework
+--build-eclipse
+   Build eclipse project files. Paths are auto corrected by fixprj.sh
 Usage (first build):
  oaisim (eNB + UE): ./build_oai -I  --oaisim -x --install-system-files
  Eurecom EXMIMO + COTS UE : ./build_oai -I  --eNB -x --install-system-files
@@ -179,6 +187,7 @@ function main() {
             GDB=1
             CMAKE_BUILD_TYPE="Debug"
             echo_info "Will Compile with gdb symbols and disable compiler optimization"
+            CMAKE_CMD="$CMAKE_CMD -DCMAKE_BUILD_TYPE=Debug"
             shift;;
        --eNB)
             eNB=1
@@ -311,6 +320,11 @@ function main() {
             UHD_IMAGES_DIR=$2
             echo_info "Downloading UHD images in the indicated location"
             shift 2;;
+       --build-eclipse)
+            BUILD_ECLIPSE=1
+            CMAKE_CMD="$CMAKE_CMD"' -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=TRUE -G"Eclipse CDT4 - Unix Makefiles"'
+            echo_info "Enabling build eclipse project support"
+            shift 1;;			
         -h | --help)
             print_help
             exit 1;;
@@ -321,6 +335,9 @@ function main() {
    esac
   done
   
+  CMAKE_CMD="$CMAKE_CMD .."
+  echo_info "CMAKE_CMD=$CMAKE_CMD"
+  
   #########################################################
   # check validity of HW and TP parameters for RRH and eNB
   #########################################################
@@ -391,7 +408,6 @@ function main() {
 
   echo_info "2. Setting the OAI PATHS ..."
 
-  set_openair_env
   cecho "OPENAIR_DIR    = $OPENAIR_DIR" $green
 
   # for conf files copy in this bash script
@@ -495,7 +511,7 @@ function main() {
     fi
     echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
     cd  $DIR/$lte_build_dir/build
-    cmake ..
+    eval $CMAKE_CMD
   fi
 
   if [ "$eNB" = "1" -o "$UE" = "1" ] ; then
@@ -524,7 +540,7 @@ function main() {
 
 #    mkdir -p $DIR/at_commands/build
 #    cd $DIR/at_commands/build
-#    cmake ..
+#    eval $CMAKE_CMD
 #    compilations \
 #      at_commands at_nas_ue \
 #      at_nas_ue $dbin/at_nas_ue
@@ -533,7 +549,7 @@ function main() {
     mkdir -p $DIR/nas_sim_tools/build
     cd $DIR/nas_sim_tools/build
     
-    cmake ..
+    eval $CMAKE_CMD
     compilations \
       nas_sim_tools usim \
       usim $dbin/usim
@@ -562,7 +578,7 @@ function main() {
     mkdir -p build
     cd build
     rm -f *sim
-    cmake ..
+    eval $CMAKE_CMD
   fi
 
   if [ "$SIMUS_PHY" = "1" ] ; then
@@ -640,7 +656,7 @@ function main() {
     [ "$CLEAN" = "1" ] && rm -rf $DIR/$oaisim_build_dir/build
     mkdir -p $DIR/$oaisim_build_dir/build
     cd $DIR/$oaisim_build_dir/build
-    cmake ..
+    eval $CMAKE_CMD
     compilations \
 	  $oaisim_build_dir $oaisim_exec \
 	  $oaisim_exec $dbin/$oaisim_exec.$REL
@@ -651,7 +667,7 @@ function main() {
     	echo_info "Compiling at_nas_ue"
 	mkdir -p $DIR/at_commands/build
 	cd $DIR/at_commands/build
-	cmake ..
+	eval $CMAKE_CMD
 	compilations \
 	    at_commands at_nas_ue \
 	    at_nas_ue $dbin/at_nas_ue
@@ -665,7 +681,7 @@ function main() {
 	[ "$CLEAN" = "1" ] && rm -rf $DIR/nas_sim_tools/build
 	mkdir -p $DIR/nas_sim_tools/build
 	cd $DIR/nas_sim_tools/build
-	cmake ..
+	eval $CMAKE_CMD
 	compilations \
 	    nas_sim_tools usim \
 	    usim $dbin/usim
@@ -722,7 +738,7 @@ function main() {
     #[ "$CLEAN" = "1" ] && rm -rf $DIR/oaisim_mme_build_oai/build
     #mkdir -p $DIR/oaisim_mme_build_oai/build
     #cd $DIR/oaisim_mme_build_oai/build
-    #cmake ..
+    #eval $CMAKE_CMD
     #compilations \
 	#  oaisim_mme_build_oai oaisim_mme \
 	#  oaisim_mme $dbin/oaisim_mme.$REL
@@ -752,7 +768,7 @@ function main() {
      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 ..
+     eval $CMAKE_CMD
      compilations \
 	 rrh_gw rrh_gw \
 	 rrh_gw $dbin/rrh_gw
@@ -761,28 +777,27 @@ function main() {
   
   # build RF device and transport protocol libraries
   #####################################
-  if [ "$eNB" = "1" -o  "$RRH" = "1" ] ; then
+  if [ "$eNB" = "1" -o "$UE" = "1" -o  "$RRH" = "1" ] ; then
 
-      if [ "$eNB" = "1" ] ; then
+      if [ "$eNB" = "1" -o "$UE" = "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)
+      # build RF device libraries
       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
 	      compilations \
 		  $build_dir oai_exmimodevif \
 		  liboai_exmimodevif.so $dbin/liboai_exmimodevif.so.$REL
+
+	      ln -sf liboai_exmimodevif.so liboai_device.so
+	      ln -sf $dbin/liboai_exmimodevif.so.$REL $dbin/liboai_device.so
 	      echo_info "liboai_device.so is linked to EXMIMO device library"       
 	  elif [ "$HW" == "OAI_USRP" ] ; then
 	      if [ -d "/usr/include/uhd" ] ; then
@@ -847,7 +862,7 @@ fi
     [ "$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 ..
+    eval $CMAKE_CMD
     make doc
     ) >& $doxygen_log
   fi
diff --git a/cmake_targets/build_ue b/cmake_targets/build_ue
new file mode 100644
index 0000000000000000000000000000000000000000..9d9ca839d10c0164f038a8b6eb4a79f772e01d70
--- /dev/null
+++ b/cmake_targets/build_ue
@@ -0,0 +1,6 @@
+#!/bin/bash
+#sudo ./build_oai -c -C -I --install-optional-packages --install-system-files --UE -w USRP -V 
+#sudo ./build_oai -c -C -I --install-optional-packages --UE -w USRP -V 
+#sudo ./build_oai -c -C --UE -w USRP -V
+sudo ./build_oai -c -C --UE -w USRP
+#sudo ./build_oai -c -C --UE -w USRP --build-eclipse
diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper
index ede8ef4196edea80c6656ddf9f1455d95b285cfa..a57040449c7223d191be4df7c928ed036b4e5d62 100755
--- a/cmake_targets/tools/build_helper
+++ b/cmake_targets/tools/build_helper
@@ -243,7 +243,7 @@ check_install_bladerf_driver(){
 		$SUDO add-apt-repository -y ppa:bladerf/bladerf
 		$SUDO apt-get update
 	fi
-	$SUDO apt-get install -y--allow-unauthenticated  bladerf libbladerf-dev
+	$SUDO apt-get install -y --allow-unauthenticated  bladerf libbladerf-dev
 	$SUDO apt-get install -y --allow-unauthenticated bladerf-firmware-fx3
 	$SUDO apt-get install -y --allow-unauthenticated bladerf-fpga-hostedx40	
 }
@@ -252,6 +252,21 @@ flash_firmware_bladerf() {
 	$SUDO bladeRF-cli --flash-firmware /usr/share/Nuand/bladeRF/bladeRF_fw.img
 }
 
+check_install_lmssdr_driver(){
+	if ( [ -d "/usr/local/include/lime" ] &&
+             [ -f "/usr/local/include/lime/LimeSuite.h" ] )
+	then
+  		echo_success "Found lmssdr drivers and tools installed from source"
+        else
+                echo_error "lmssdr support implies installing lmssdr drivers and tools" \
+                           " from sources. check:"
+                echo_info "https://open-cells.com/index.php/2017/05/10/limesdr-installation/"
+                echo_fatal "Cannot compile lmssdr device" 
+	fi
+
+
+}
+
 check_install_additional_tools (){
     $SUDO apt-get update
     $SUDO apt-get install -y \
diff --git a/cmake_targets/tools/init_nas_s1 b/cmake_targets/tools/init_nas_s1
index 5f27c5283741a122fadce4cb0c94ca0b05af58bd..003a3ae600a12cfa225b6d627af6d0c6d93a2814 100644
--- a/cmake_targets/tools/init_nas_s1
+++ b/cmake_targets/tools/init_nas_s1
@@ -33,7 +33,7 @@
 #
 #######################################
 
-LTEIF=oip0
+LTEIF=oip1
 #OPENAIR_DIR=/home/oai/svn-oai/openair4G
 
 load_module() {
@@ -48,11 +48,11 @@ load_module() {
   sudo insmod $1
 }
 
-load_module $OPENAIR_DIR/targets/bin/ue_ip.ko
+load_module ../../targets/bin/ue_ip.ko
 
 if [ "$1" = "UE" ]; then
-  echo "bring up oip0 interface for UE"
-  ifconfig oip0 up
+  echo "bring up $LTEIF interface for UE"
+  ifconfig $LTEIF up
 fi
 
 ip route flush cache
diff --git a/cmake_targets/tools/run_enb_ue_virt_noS1 b/cmake_targets/tools/run_enb_ue_virt_noS1
index a0f23ecb01bc90a649d5dc6be540ea2917760f88..a5139d4b44c250ab7e1c056d45ef014988f4798b 100755
--- a/cmake_targets/tools/run_enb_ue_virt_noS1
+++ b/cmake_targets/tools/run_enb_ue_virt_noS1
@@ -150,7 +150,7 @@ function main()
 #      -u | --num-ue )
 	    
       -V | --vcd)
-        "setting gtk-wave output"
+        echo "setting gtk-wave output"
         exe_arguments="$exe_arguments -V /tmp/oai_gtk_wave.vcd"
         shift ;
         ;;
@@ -164,6 +164,11 @@ function main()
 	exe_arguments="$exe_arguments -n $2"
         shift 2;
 	;; 
+      -x | --xforms)
+        echo "running with xforms"
+        exe_arguments="$exe_arguments --xforms"
+        shift 1;
+        ;;
       *)   
         echo "Unknown option $1"
         help
@@ -212,11 +217,11 @@ function main()
   fi
   
   if [ $run_gdb -eq 0 ]; then 
-    exec $SUDO $OPENAIR_DIR/targets/bin/oaisim_nos1.Rel10 $exe_arguments | tee /tmp/enb_ue_nos1.log.txt
+    exec $SUDO $OPENAIR_DIR/targets/bin/oaisim_nos1.Rel14 $exe_arguments | tee /tmp/enb_ue_nos1.log.txt
   else
     touch      ~/.gdb_enb_ue_nos1
     chmod 777  ~/.gdb_enb_ue_nos1
-    echo "file $OPENAIR_DIR/targets/bin/oaisim_nos1.Rel10" > ~/.gdb_enb_ue_nos1
+    echo "file $OPENAIR_DIR/targets/bin/oaisim_nos1.Rel14" > ~/.gdb_enb_ue_nos1
     echo "set args $exe_arguments" >> ~/.gdb_enb_ue_nos1
     echo "run"                        >> ~/.gdb_enb_ue_nos1
     cat ~/.gdb_enb_ue_nos1
diff --git a/cmake_targets/tools/run_enb_ue_virt_s1 b/cmake_targets/tools/run_enb_ue_virt_s1
index ff659468038f21939eb5ae9f45fd05343aafcb65..8e717f393a28b637771b9698e61b7f547bb3c444 100755
--- a/cmake_targets/tools/run_enb_ue_virt_s1
+++ b/cmake_targets/tools/run_enb_ue_virt_s1
@@ -174,7 +174,7 @@ function main()
         ;;      
 
       -V | --vcd)
-        "setting gtk-wave output"
+        echo "setting gtk-wave output"
         exe_arguments="$exe_arguments -V /tmp/oai_gtk_wave.vcd"
         shift ;
         ;;
@@ -183,6 +183,11 @@ function main()
         exe_arguments="$exe_arguments -P wireshark"
         shift 2;
         ;;
+      -x | --xforms)
+        echo "running with xforms"
+        exe_arguments="$exe_arguments --xforms"
+        shift 1;
+        ;;
       *)   
         echo "Unknown option $1"
         help
@@ -258,11 +263,11 @@ function main()
   fi
    
   if [ $run_gdb -eq 0 ]; then 
-    exec $OPENAIR_DIR/targets/bin/oaisim.Rel10 $exe_arguments | tee /tmp/enb_ue_s1.log.txt
+    exec $OPENAIR_DIR/targets/bin/oaisim.Rel14 $exe_arguments | tee /tmp/enb_ue_s1.log.txt
   else
     touch      ~/.gdb_enb_ue_s1
     chmod 777  ~/.gdb_enb_ue_s1
-    echo "file $OPENAIR_DIR/targets/bin/oaisim.Rel10" > ~/.gdb_enb_ue_s1
+    echo "file $OPENAIR_DIR/targets/bin/oaisim.Rel14" > ~/.gdb_enb_ue_s1
     echo "set args $exe_arguments" >> ~/.gdb_enb_ue_s1
     echo "run"                        >> ~/.gdb_enb_ue_s1
     cat ~/.gdb_enb_ue_s1
diff --git a/cmake_targets/tools/run_ue_s1 b/cmake_targets/tools/run_ue_s1
new file mode 100644
index 0000000000000000000000000000000000000000..56b18d72b926d983b1ee64da8b600682f647bb06
--- /dev/null
+++ b/cmake_targets/tools/run_ue_s1
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+# Carrier frequency in Hz
+#FREQ=2660000000 #FDD
+FREQ=2350000000 #TDD
+NRB=50
+TA=0
+
+#9:trace, 8/7:debug, 6:info, 4:warn, 3:error
+LOGLEVEL=6
+
+#enable or disable soft scope
+#SCOPE=''
+SCOPE='-d'
+
+#enable or disable VCD logging
+VCD=''
+#VCD='-V'
+
+ISTDD='-T'
+#ISTDD=''
+
+#use external clock
+ECLK="--external-clock"
+#ECLK=""
+
+#UE scan carrier
+#ISSCAN="--ue-scan-carrier"
+ISSCAN=""
+
+sudo sh -c './init_nas_s1 UE'
+cd ../../targets/bin/ 
+sudo -E ./lte-softmodem.Rel10 -U -C$FREQ -r$NRB $ISSCAN --ue-txgain 70 --ue-rxgain 80 -A $TA $ECLK -W $ISTDD -g $LOGLEVEL $SCOPE 2>&1 | sudo tee /tmp/UE.log 
diff --git a/common/utils/T/T_messages.txt b/common/utils/T/T_messages.txt
index 09ed098ee0fb591bc2fa1b878601d9eec14ca6de..c78bc92d364c183fac608cf71ad462a251644749 100644
--- a/common/utils/T/T_messages.txt
+++ b/common/utils/T/T_messages.txt
@@ -28,7 +28,7 @@ ID = ENB_PHY_DLSCH_UE_NACK
 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 : int,mcs : int,round : int,first_rb : int,nb_rb : int,TBS
+    FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid : int,mcs : int,round : int,first_rb : int,nb_rb : int,TBS : int,L : int,firstCCE
 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
diff --git a/common/utils/itti/memory_pools.c b/common/utils/itti/memory_pools.c
index b317cfd2fa50ba9542c98346133681481d68bc01..955e29440ac24f96dcf37dc24c3b981a985762ca 100644
--- a/common/utils/itti/memory_pools.c
+++ b/common/utils/itti/memory_pools.c
@@ -77,7 +77,7 @@ typedef struct items_group_s {
 } items_group_t;
 
 /*------------------------------------------------------------------------------*/
-static const items_group_position_t ITEMS_GROUP_POSITION_INVALID    = -1;
+//static const items_group_position_t ITEMS_GROUP_POSITION_INVALID    = -1;
 static const items_group_index_t    ITEMS_GROUP_INDEX_INVALID       = -1;
 
 /*------------------------------------------------------------------------------*/
diff --git a/openair1/PHY/INIT/README.txt b/openair1/PHY/INIT/README.txt
index d40d0feecd1a816f4f7a9a5fd04577680520618d..520e0acd4fa2d6fc23130677a6c874e70a7491c6 100644
--- a/openair1/PHY/INIT/README.txt
+++ b/openair1/PHY/INIT/README.txt
@@ -2,4 +2,6 @@ This directory contains files related to initialization of variables/structures
 
 init_top.c : initialize top-level variables and signal buffers, FFT twiddle factors, etc.
 lte_init.c : LTE specific initlization routines (DLSCH/ULSCH signal buffers for RX, data buffers for TX, etc.)
-init.c     : non-LTE initialization routines (to be removed)
+lte_param_init.c: used only in unitary simulations. initializes the global variables eNB and UE.
+lte_parms.c: contains init_frame_parms to initialize frame parameters structure
+
diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c
old mode 100755
new mode 100644
diff --git a/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c
index b34331eb8d4614d3a13b83c9583b722d89b0d649..9743c68a22a2071e84fef4ed29c36293c8441429 100644
--- a/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c
+++ b/openair1/PHY/LTE_ESTIMATION/lte_dl_channel_estimation.c
@@ -23,6 +23,7 @@
 #include <string.h>
 #endif
 #include "defs.h"
+#include "SCHED/defs.h"
 #include "PHY/defs.h"
 #include "filt96_32.h"
 #include "T.h"
@@ -637,105 +638,129 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
                                            32767-ue->ch_est_alpha,
                                            dl_ch-(ue->frame_parms.ofdm_symbol_size<<1),0,ue->frame_parms.ofdm_symbol_size);
       } else { // high_speed_flag == 1
-        if (symbol == 0) {
-          //      printf("Interpolating %d->0\n",4-ue->frame_parms.Ncp);
-          //      dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][(4-ue->frame_parms.Ncp)*(ue->frame_parms.ofdm_symbol_size)];
+            if ((symbol == 0)) {
+              //      printf("Interpolating %d->0\n",4-ue->frame_parms.Ncp);
+              //      dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][(4-ue->frame_parms.Ncp)*(ue->frame_parms.ofdm_symbol_size)];
           if(((Ns>>1)!=0) || ( ((Ns>>1)==0) && interpolateS11S12))
           {
-              //LOG_D(PHY,"Interpolate s11-->s0 to get s12 and s13  Ns %d \n", Ns);
-              dl_ch_prev = (int16_t *)&dl_ch_estimates_previous[(p<<1)+aarx][pilot3*(ue->frame_parms.ofdm_symbol_size)];
+                  //LOG_I(PHY,"Interpolate s11-->s0 to get s12 and s13  Ns %d \n", Ns);
+                  dl_ch_prev = (int16_t *)&dl_ch_estimates_previous[(p<<1)+aarx][pilot3*(ue->frame_parms.ofdm_symbol_size)];
+
+                  multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
+                  multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
+
+                  multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
+                  multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
+           }
+
+              interpolateS11S12 = 1;
+            } // this is 1/3,2/3 combination for pilots spaced by 3 symbols
+            else if (symbol == pilot1) {
+              dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][0];
+
+              //LOG_I(PHY,"Interpolate s0-->s4 to get s1 s2 and s3 Ns %d \n", Ns);
+              if (ue->frame_parms.Ncp==0) {// pilot spacing 4 symbols (1/4,1/2,3/4 combination)
+
+                uint8_t previous_subframe;
+                if(Ns>>1 == 0)
+                    previous_subframe = 9;
+                else
+                    previous_subframe = ((Ns>>1) - 1 )%9;
+
+                if((subframe_select(&ue->frame_parms,previous_subframe) == SF_UL))
+                {
+
+                    multadd_complex_vector_real_scalar(dl_ch_prev,328,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
+                    multadd_complex_vector_real_scalar(dl_ch,32440,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
+
+                    multadd_complex_vector_real_scalar(dl_ch_prev,328,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
+                    multadd_complex_vector_real_scalar(dl_ch,32440,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
+
+                    multadd_complex_vector_real_scalar(dl_ch_prev,8192,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
+                    multadd_complex_vector_real_scalar(dl_ch,32440,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
+                }
+                else
+                {
+                    multadd_complex_vector_real_scalar(dl_ch_prev,24576,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
+                    multadd_complex_vector_real_scalar(dl_ch,8192,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
+
+                    multadd_complex_vector_real_scalar(dl_ch_prev,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
+                    multadd_complex_vector_real_scalar(dl_ch,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
+
+                    multadd_complex_vector_real_scalar(dl_ch_prev,8192,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
+                    multadd_complex_vector_real_scalar(dl_ch,24576,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
+
+                    }
+              } else {
+                multadd_complex_vector_real_scalar(dl_ch_prev,328,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
+                multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
+
+                multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)<<1),1,ue->frame_parms.ofdm_symbol_size);
+                multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
+              } // pilot spacing 3 symbols (1/3,2/3 combination)
+            } else if (symbol == pilot2) {
+              dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot1*(ue->frame_parms.ofdm_symbol_size)];
 
               multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
               multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
 
               multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
               multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
-          }
-
-          interpolateS11S12 = 1;
-        } // this is 1/3,2/3 combination for pilots spaced by 3 symbols
-        else if (symbol == pilot1) {
-          dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][0];
-
-          if (ue->frame_parms.Ncp==0) {// pilot spacing 4 symbols (1/4,1/2,3/4 combination)
-            multadd_complex_vector_real_scalar(dl_ch_prev,24576,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
-            multadd_complex_vector_real_scalar(dl_ch,8192,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
-
-            multadd_complex_vector_real_scalar(dl_ch_prev,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
-            multadd_complex_vector_real_scalar(dl_ch,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
-
-            multadd_complex_vector_real_scalar(dl_ch_prev,8192,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
-            multadd_complex_vector_real_scalar(dl_ch,24576,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
-          } else {
-            multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
-            multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
-
-            multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)<<1),1,ue->frame_parms.ofdm_symbol_size);
-            multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
-          } // pilot spacing 3 symbols (1/3,2/3 combination)
-        } else if (symbol == pilot2) {
-          dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot1*(ue->frame_parms.ofdm_symbol_size)];
-
-          multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
-          multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
-
-          multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
-          multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
-        } else { // symbol == pilot3
-          //      printf("Interpolating 0->%d\n",4-ue->frame_parms.Ncp);
-          dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot2*(ue->frame_parms.ofdm_symbol_size)];
-
-          if (ue->frame_parms.Ncp==0) {// pilot spacing 4 symbols (1/4,1/2,3/4 combination)
-            multadd_complex_vector_real_scalar(dl_ch_prev,24576,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
-            multadd_complex_vector_real_scalar(dl_ch,8192,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
-
-            multadd_complex_vector_real_scalar(dl_ch_prev,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
-            multadd_complex_vector_real_scalar(dl_ch,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
-
-            multadd_complex_vector_real_scalar(dl_ch_prev,8192,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
-            multadd_complex_vector_real_scalar(dl_ch,24576,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
-          } else {
-            multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
-            multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
-
-            multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)<<1),1,ue->frame_parms.ofdm_symbol_size);
-            multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
-          } // pilot spacing 3 symbols (1/3,2/3 combination)
-
-          if((ue->rx_offset_diff !=0) && ((Ns>>1) == 9))
-          {
-              //LOG_D(PHY,"Extrapolate s7-->s11 to get s12 and s13 Ns %d\n", Ns);
-              interpolateS11S12 = 0;
-              //LOG_E(PHY,"Interpolate s7--s11 s12 s13 pilot 3 Ns %d l %d symbol %d \n", Ns, l, symbol);
-              int16_t *dlChEst_ofdm11 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot3*(ue->frame_parms.ofdm_symbol_size)];
-              int16_t *dlChEst_ofdm7  = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot2*(ue->frame_parms.ofdm_symbol_size)];
-
-              // interpolate ofdm s12: 5/4*ofdms11 + -1/4*ofdms7 5/4 q1.15 40960 -1/4 q1.15 8192
-              int16_t *dlChEst_ofdm12 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][12*ue->frame_parms.ofdm_symbol_size];
-              for(int i=0; i<(2*ue->frame_parms.ofdm_symbol_size); i++)
-              {
-                  int64_t tmp_mult = 0;
-                  tmp_mult = ((int64_t)dlChEst_ofdm11[i] * 40960 - (int64_t)dlChEst_ofdm7[i] * 8192);
+            } else { // symbol == pilot3
+              //      printf("Interpolating 0->%d\n",4-ue->frame_parms.Ncp);
+              dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot2*(ue->frame_parms.ofdm_symbol_size)];
 
-                  tmp_mult = tmp_mult >> 15;
-                  dlChEst_ofdm12[i] = tmp_mult;
-              }
+              if (ue->frame_parms.Ncp==0) {// pilot spacing 4 symbols (1/4,1/2,3/4 combination)
+                multadd_complex_vector_real_scalar(dl_ch_prev,24576,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
+                multadd_complex_vector_real_scalar(dl_ch,8192,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
 
-              // interpolate ofdm s13: 3/2*ofdms11 + -1/2*ofdms7 3/2 q1.15 49152 1/2 q1.15 16384
-              int16_t *dlChEst_ofdm13 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][13*ue->frame_parms.ofdm_symbol_size];
-              for(int i=0; i<(2*ue->frame_parms.ofdm_symbol_size); i++)
-              {
-                  int64_t tmp_mult = 0;
-                  tmp_mult = ((int64_t)dlChEst_ofdm11[i] * 49152 - (int64_t)dlChEst_ofdm7[i] * 16384);
+                multadd_complex_vector_real_scalar(dl_ch_prev,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
+                multadd_complex_vector_real_scalar(dl_ch,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
+
+                multadd_complex_vector_real_scalar(dl_ch_prev,8192,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
+                multadd_complex_vector_real_scalar(dl_ch,24576,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
+              } else {
+                multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
+                multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
+
+                multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)<<1),1,ue->frame_parms.ofdm_symbol_size);
+                multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
+              } // pilot spacing 3 symbols (1/3,2/3 combination)
 
-                  tmp_mult = tmp_mult >> 15;
-                  dlChEst_ofdm13[i] = tmp_mult;
+              if((ue->rx_offset_diff !=0) && ((Ns>>1) == 9))
+              {
+                  //LOG_I(PHY,"Extrapolate s7-->s11 to get s12 and s13 Ns %d\n", Ns);
+                  interpolateS11S12 = 0;
+                  //LOG_E(PHY,"Interpolate s7--s11 s12 s13 pilot 3 Ns %d l %d symbol %d \n", Ns, l, symbol);
+                  int16_t *dlChEst_ofdm11 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot3*(ue->frame_parms.ofdm_symbol_size)];
+                  int16_t *dlChEst_ofdm7  = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot2*(ue->frame_parms.ofdm_symbol_size)];
+
+                  // interpolate ofdm s12: 5/4*ofdms11 + -1/4*ofdms7 5/4 q1.15 40960 -1/4 q1.15 8192
+                  int16_t *dlChEst_ofdm12 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][12*ue->frame_parms.ofdm_symbol_size];
+                  for(int i=0; i<(2*ue->frame_parms.ofdm_symbol_size); i++)
+                  {
+                      int64_t tmp_mult = 0;
+                      tmp_mult = ((int64_t)dlChEst_ofdm11[i] * 40960 - (int64_t)dlChEst_ofdm7[i] * 8192);
+
+                      tmp_mult = tmp_mult >> 15;
+                      dlChEst_ofdm12[i] = tmp_mult;
+                  }
+
+                  // interpolate ofdm s13: 3/2*ofdms11 + -1/2*ofdms7 3/2 q1.15 49152 1/2 q1.15 16384
+                  int16_t *dlChEst_ofdm13 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][13*ue->frame_parms.ofdm_symbol_size];
+                  for(int i=0; i<(2*ue->frame_parms.ofdm_symbol_size); i++)
+                  {
+                      int64_t tmp_mult = 0;
+                      tmp_mult = ((int64_t)dlChEst_ofdm11[i] * 49152 - (int64_t)dlChEst_ofdm7[i] * 16384);
+
+                      tmp_mult = tmp_mult >> 15;
+                      dlChEst_ofdm13[i] = tmp_mult;
+                  }
               }
-          }
 
+            }
         }
 
-      }
     }
   }
 
diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c
index 0e2dfd672a8b6f4d7d51dfc780c1b19d69f86eef..c47a64ae36c92515771ca25f6c006b096e730816 100644
--- a/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c
+++ b/openair1/PHY/LTE_ESTIMATION/lte_ue_measurements.c
@@ -174,20 +174,25 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
 {
 
   uint8_t subframe = slot>>1;
-  int aarx,rb,n;
+  int aarx,rb;
+  uint8_t pss_symb;
+  uint8_t sss_symb;
+
+  int32_t **rxdataF;
   int16_t *rxF,*rxF_pss,*rxF_sss;
 
   uint16_t Nid_cell = ue->frame_parms.Nid_cell;
   uint8_t eNB_offset,nu,l,nushift,k;
   uint16_t off;
 
-  uint8_t isPss; // indicate if this is a slot for extracting PSS
-  uint8_t isSss; // indicate if this is a slot for extracting SSS
-  int32_t pss_ext[4][72]; // contain the extracted 6*12 REs for mapping the PSS
-  int32_t sss_ext[4][72]; // contain the extracted 6*12 REs for mapping the SSS
-  int32_t (*xss_ext)[72]; // point to either pss_ext or sss_ext for common calculation
-  int16_t *re,*im; // real and imag part of each 32-bit xss_ext[][] value
+  //uint8_t isPss; // indicate if this is a slot for extracting PSS
+  //uint8_t isSss; // indicate if this is a slot for extracting SSS
+  //int32_t pss_ext[4][72]; // contain the extracted 6*12 REs for mapping the PSS
+  //int32_t sss_ext[4][72]; // contain the extracted 6*12 REs for mapping the SSS
+  //int32_t (*xss_ext)[72]; // point to either pss_ext or sss_ext for common calculation
+  //int16_t *re,*im; // real and imag part of each 32-bit xss_ext[][] value
 
+  //LOG_I(PHY,"UE RRC MEAS Start Subframe %d Frame Type %d slot %d \n",subframe,ue->frame_parms.frame_type,slot);
   for (eNB_offset = 0; eNB_offset<1+ue->measurements.n_adj_cells; eNB_offset++) {
 
     if (eNB_offset==0) {
@@ -195,25 +200,26 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
       //ue->measurements.n0_power_tot = 0;
 
       if (abstraction_flag == 0) {
-        if ((ue->frame_parms.frame_type == FDD) &&
-            ((subframe == 0) || (subframe == 5))) {  // FDD PSS/SSS, compute noise in DTX REs
+        if ( ((ue->frame_parms.frame_type == FDD) && ((subframe == 0) || (subframe == 5))) ||
+             ((ue->frame_parms.frame_type == TDD) && ((subframe == 1) || (subframe == 6)))
+                )
+        {  // FDD PSS/SSS, compute noise in DTX REs
 
           if (ue->frame_parms.Ncp==NORMAL) {
             for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
 
-              rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(5*ue->frame_parms.ofdm_symbol_size)];
-              rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)];
-
+          if(ue->frame_parms.frame_type == FDD)
+          {
+          rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(5*ue->frame_parms.ofdm_symbol_size)];
+          rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)];
+          }
+          else
+          {
+              rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)&0x1].rxdataF[aarx][(13*ue->frame_parms.ofdm_symbol_size)];
+              rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(2*ue->frame_parms.ofdm_symbol_size)];
+          }
               //-ve spectrum from SSS
-              //              printf("slot %d: SSS DTX: %d,%d, non-DTX %d,%d\n",slot,rxF_pss[-72],rxF_pss[-71],rxF_pss[-36],rxF_pss[-35]);
 
-              //              ue->measurements.n0_power[aarx] = (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71]));
-              //              printf("sssn36 %d\n",ue->measurements.n0_power[aarx]);
-              ue->measurements.n0_power[aarx] = (((int32_t)rxF_pss[-70]*rxF_pss[-70])+((int32_t)rxF_pss[-69]*rxF_pss[-69]));
-              ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-68]*rxF_pss[-68])+((int32_t)rxF_pss[-67]*rxF_pss[-67]));
-              ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-66]*rxF_pss[-66])+((int32_t)rxF_pss[-65]*rxF_pss[-65]));
-              //              ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-64]*rxF_pss[-64])+((int32_t)rxF_pss[-63]*rxF_pss[-63]));
-              //              printf("sssm32 %d\n",ue->measurements.n0_power[aarx]);
               //+ve spectrum from SSS
               ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+70]*rxF_sss[2+70])+((int32_t)rxF_sss[2+69]*rxF_sss[2+69]));
               ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+68]*rxF_sss[2+68])+((int32_t)rxF_sss[2+67]*rxF_sss[2+67]));
@@ -224,108 +230,97 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
               ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+70]*rxF_pss[2+70])+((int32_t)rxF_pss[2+69]*rxF_pss[2+69]));
               ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+68]*rxF_pss[2+68])+((int32_t)rxF_pss[2+67]*rxF_pss[2+67]));
               ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+66]*rxF_pss[2+66])+((int32_t)rxF_pss[2+65]*rxF_pss[2+65]));
-              //              ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+64]*rxF_pss[2+64])+((int32_t)rxF_pss[2+63]*rxF_pss[2+63]));
-              //              printf("pss32 %d\n",ue->measurements.n0_power[aarx]);              //-ve spectrum from PSS
-              rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)];
-              //              ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71]));
-              //              printf("pssm36 %d\n",ue->measurements.n0_power[aarx]);
+          //              ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+64]*rxF_pss[2+64])+((int32_t)rxF_pss[2+63]*rxF_pss[2+63]));
+          //          printf("pss32 %d\n",ue->measurements.n0_power[aarx]);              //-ve spectrum from PSS
+              if(ue->frame_parms.frame_type == FDD)
+              {
+                  rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)];
+                  rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)];
+              }
+              else
+              {
+                  rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)&0x1].rxdataF[aarx][(14*ue->frame_parms.ofdm_symbol_size)];
+                  rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(3*ue->frame_parms.ofdm_symbol_size)];
+              }
+          //              ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71]));
+          //          printf("pssm36 %d\n",ue->measurements.n0_power[aarx]);
               ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-70]*rxF_pss[-70])+((int32_t)rxF_pss[-69]*rxF_pss[-69]));
               ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-68]*rxF_pss[-68])+((int32_t)rxF_pss[-67]*rxF_pss[-67]));
               ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-66]*rxF_pss[-66])+((int32_t)rxF_pss[-65]*rxF_pss[-65]));
-              //              ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-64]*rxF_pss[-64])+((int32_t)rxF_pss[-63]*rxF_pss[-63]));
-              //              printf("pssm32 %d\n",ue->measurements.n0_power[aarx]);
+
+              ue->measurements.n0_power[aarx] = (((int32_t)rxF_sss[-70]*rxF_sss[-70])+((int32_t)rxF_sss[-69]*rxF_sss[-69]));
+              ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[-68]*rxF_sss[-68])+((int32_t)rxF_sss[-67]*rxF_sss[-67]));
+              ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[-66]*rxF_sss[-66])+((int32_t)rxF_sss[-65]*rxF_sss[-65]));
+
+          //              ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-64]*rxF_pss[-64])+((int32_t)rxF_pss[-63]*rxF_pss[-63]));
+          //          printf("pssm32 %d\n",ue->measurements.n0_power[aarx]);
               ue->measurements.n0_power_dB[aarx] = (unsigned short) dB_fixed(ue->measurements.n0_power[aarx]/12);
               ue->measurements.n0_power_tot /*+=*/ = ue->measurements.n0_power[aarx];
-            }
+        }
 
-            ue->measurements.n0_power_tot_dB = (unsigned short) dB_fixed(ue->measurements.n0_power_tot/(12*aarx));
-            ue->measurements.n0_power_tot_dBm = ue->measurements.n0_power_tot_dB - ue->rx_total_gain_dB - dB_fixed(ue->frame_parms.ofdm_symbol_size);
-          } else {
+            //LOG_I(PHY,"Subframe %d RRC UE MEAS Noise Level %d \n", subframe, ue->measurements.n0_power_tot);
+
+        ue->measurements.n0_power_tot_dB = (unsigned short) dB_fixed(ue->measurements.n0_power_tot/(12*aarx));
+        ue->measurements.n0_power_tot_dBm = ue->measurements.n0_power_tot_dB - ue->rx_total_gain_dB - dB_fixed(ue->frame_parms.ofdm_symbol_size);
+        } else {
             LOG_E(PHY, "Not yet implemented: noise power calculation when prefix length = EXTENDED\n");
-          }
+        }
         }
         else if ((ue->frame_parms.frame_type == TDD) &&
-            ((slot == 2) || (slot == 12) || (slot == 1) || (slot == 11))) {  // TDD PSS/SSS, compute noise in DTX REs // 2016-09-29 wilson fix incorrect noise power calculation
-
-#if 1 // fixing REs extraction in noise power calculation
+                 ((subframe == 1) || (subframe == 6))) {  // TDD PSS/SSS, compute noise in DTX REs // 2016-09-29 wilson fix incorrect noise power calculation
 
-          // check if this slot has a PSS or SSS sequence
-          if ((slot == 2) || (slot == 12)) {
-            isPss = 1;
-          } else {
-            isPss = 0;
-          }
-          if ((slot == 1) || (slot == 11)) {
-            isSss = 1;
-          } else {
-            isSss = 0;
-          }
-
-          if (isPss) {
-            pss_only_extract(ue, pss_ext);
-            xss_ext = pss_ext;
-          }
 
-          if (isSss) {
-            sss_only_extract(ue, sss_ext);
-            xss_ext = sss_ext;
-          }
-
-          // calculate noise power
-          int num_tot=0; // number of REs totally used in calculating noise power
-          for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
-
-            int num_per_rx=0; // number of REs used in caluclaing noise power for this RX antenna
-            ue->measurements.n0_power[aarx] = 0;
-            for (n=2; n<70; n++) { // skip the 2 REs next to PDSCH, i.e. n={0,1,70,71}
-              if (n==5) {n=67;}
-
-              re = (int16_t*)(&(xss_ext[aarx][n]));
-              im = re+1;
-              ue->measurements.n0_power[aarx] += (*re)*(*re) + (*im)*(*im);
-              num_per_rx++;
-              num_tot++;
-            }
-
-            ue->measurements.n0_power_dB[aarx] = (unsigned short) dB_fixed(ue->measurements.n0_power[aarx]/(num_per_rx));
-            ue->measurements.n0_power_tot /*+=*/ =  ue->measurements.n0_power[aarx];
-          }
-
-          ue->measurements.n0_power_tot_dB = (unsigned short) dB_fixed(ue->measurements.n0_power_tot/(num_tot));
-          ue->measurements.n0_power_tot_dBm = ue->measurements.n0_power_tot_dB - ue->rx_total_gain_dB - dB_fixed(ue->frame_parms.ofdm_symbol_size);
-
-#else
+          pss_symb = 2;
+          sss_symb = ue->frame_parms.symbols_per_tti-1;
           if (ue->frame_parms.Ncp==NORMAL) {
             for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
 
-              rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)];
-              // note this is a dummy pointer, the pss is not really there!
-              // in FDD the pss is in the symbol after the sss, but not in TDD
-
-              rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)];
-
-              //-ve spectrum from SSS
-              //              ue->measurements.n0_power[aarx] = (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71]));
-              ue->measurements.n0_power[aarx] = (((int32_t)rxF_pss[-70]*rxF_pss[-70])+((int32_t)rxF_pss[-69]*rxF_pss[-69]));
-              ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-68]*rxF_pss[-68])+((int32_t)rxF_pss[-67]*rxF_pss[-67]));
-              ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-66]*rxF_pss[-66])+((int32_t)rxF_pss[-65]*rxF_pss[-65]));
-              //              ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-64]*rxF_pss[-64])+((int32_t)rxF_pss[-63]*rxF_pss[-63]));
-              //+ve spectrum from SSS
-              //              ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+72]*rxF_sss[2+72])+((int32_t)rxF_sss[2+71]*rxF_sss[2+71]));
-              ue->measurements.n0_power[aarx] = (((int32_t)rxF_sss[2+70]*rxF_sss[2+70])+((int32_t)rxF_sss[2+69]*rxF_sss[2+69]));
-              ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+68]*rxF_sss[2+68])+((int32_t)rxF_sss[2+67]*rxF_sss[2+67]));
-              ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+66]*rxF_sss[2+66])+((int32_t)rxF_sss[2+65]*rxF_sss[2+65]));
-              //              ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+64]*rxF_sss[2+64])+((int32_t)rxF_sss[2+63]*rxF_sss[2+63]));
+                rxdataF  =  ue->common_vars.common_vars_rx_data_per_thread[(subframe&0x1)].rxdataF;
+                rxF_pss  = (int16_t *) &rxdataF[aarx][((pss_symb*(ue->frame_parms.ofdm_symbol_size)))];
+
+                rxdataF  =  ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)&0x1].rxdataF;
+                rxF_sss  = (int16_t *) &rxdataF[aarx][((sss_symb*(ue->frame_parms.ofdm_symbol_size)))];
+
+                //-ve spectrum from SSS
+            //          printf("slot %d: SSS DTX: %d,%d, non-DTX %d,%d\n",slot,rxF_pss[-72],rxF_pss[-71],rxF_pss[-36],rxF_pss[-35]);
+
+            //              ue->measurements.n0_power[aarx] = (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71]));
+            //          printf("sssn36 %d\n",ue->measurements.n0_power[aarx]);
+                ue->measurements.n0_power[aarx] = (((int32_t)rxF_pss[-70]*rxF_pss[-70])+((int32_t)rxF_pss[-69]*rxF_pss[-69]));
+                ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-68]*rxF_pss[-68])+((int32_t)rxF_pss[-67]*rxF_pss[-67]));
+                ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-66]*rxF_pss[-66])+((int32_t)rxF_pss[-65]*rxF_pss[-65]));
+            //              ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-64]*rxF_pss[-64])+((int32_t)rxF_pss[-63]*rxF_pss[-63]));
+            //          printf("sssm32 %d\n",ue->measurements.n0_power[aarx]);
+                //+ve spectrum from SSS
+            ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+70]*rxF_sss[2+70])+((int32_t)rxF_sss[2+69]*rxF_sss[2+69]));
+                ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+68]*rxF_sss[2+68])+((int32_t)rxF_sss[2+67]*rxF_sss[2+67]));
+                ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+66]*rxF_sss[2+66])+((int32_t)rxF_sss[2+65]*rxF_sss[2+65]));
+            //          ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+64]*rxF_sss[2+64])+((int32_t)rxF_sss[2+63]*rxF_sss[2+63]));
+            //          printf("sssp32 %d\n",ue->measurements.n0_power[aarx]);
+                //+ve spectrum from PSS
+                ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+70]*rxF_pss[2+70])+((int32_t)rxF_pss[2+69]*rxF_pss[2+69]));
+                ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+68]*rxF_pss[2+68])+((int32_t)rxF_pss[2+67]*rxF_pss[2+67]));
+                ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+66]*rxF_pss[2+66])+((int32_t)rxF_pss[2+65]*rxF_pss[2+65]));
+            //              ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+64]*rxF_pss[2+64])+((int32_t)rxF_pss[2+63]*rxF_pss[2+63]));
+            //          printf("pss32 %d\n",ue->measurements.n0_power[aarx]);              //-ve spectrum from PSS
+                rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)];
+            //              ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71]));
+            //          printf("pssm36 %d\n",ue->measurements.n0_power[aarx]);
+                ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-70]*rxF_pss[-70])+((int32_t)rxF_pss[-69]*rxF_pss[-69]));
+                ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-68]*rxF_pss[-68])+((int32_t)rxF_pss[-67]*rxF_pss[-67]));
+                ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-66]*rxF_pss[-66])+((int32_t)rxF_pss[-65]*rxF_pss[-65]));
+            //              ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-64]*rxF_pss[-64])+((int32_t)rxF_pss[-63]*rxF_pss[-63]));
+            //          printf("pssm32 %d\n",ue->measurements.n0_power[aarx]);
+                ue->measurements.n0_power_dB[aarx] = (unsigned short) dB_fixed(ue->measurements.n0_power[aarx]/12);
+                ue->measurements.n0_power_tot /*+=*/ = ue->measurements.n0_power[aarx];
+        }
 
-              ue->measurements.n0_power_dB[aarx] = (unsigned short) dB_fixed(ue->measurements.n0_power[aarx]/(6));
-              ue->measurements.n0_power_tot +=  ue->measurements.n0_power[aarx];
-            }
-            ue->measurements.n0_power_tot_dB = (unsigned short) dB_fixed(ue->measurements.n0_power_tot/(6*aarx));
-            ue->measurements.n0_power_tot_dBm = ue->measurements.n0_power_tot_dB - ue->rx_total_gain_dB - dB_fixed(ue->frame_parms.ofdm_symbol_size);
+        ue->measurements.n0_power_tot_dB = (unsigned short) dB_fixed(ue->measurements.n0_power_tot/(12*aarx));
+        ue->measurements.n0_power_tot_dBm = ue->measurements.n0_power_tot_dB - ue->rx_total_gain_dB - dB_fixed(ue->frame_parms.ofdm_symbol_size);
 
+        //LOG_I(PHY,"Subframe %d RRC UE MEAS Noise Level %d \n", subframe, ue->measurements.n0_power_tot);
 
           }
-#endif
         }
       }
     }
@@ -576,6 +571,8 @@ void lte_ue_measurements(PHY_VARS_UE *ue,
           (((k1*((long long int)(ue->measurements.rx_power_avg[eNB_id]))) +
             (k2*((long long int)(ue->measurements.rx_power_tot[eNB_id]))))>>10);
 
+    //LOG_I(PHY,"Noise Power Computation: k1 %d k2 %d n0 avg %d n0 tot %d\n", k1, k2, ue->measurements.n0_power_avg,
+    //    ue->measurements.n0_power_tot);
     ue->measurements.n0_power_avg = (int)
         (((k1*((long long int) (ue->measurements.n0_power_avg))) +
           (k2*((long long int) (ue->measurements.n0_power_tot))))>>10);
@@ -593,8 +590,9 @@ void lte_ue_measurements(PHY_VARS_UE *ue,
     ue->measurements.wideband_cqi_avg[eNB_id] = dB_fixed2(ue->measurements.rx_power_avg[eNB_id],ue->measurements.n0_power_avg);
     ue->measurements.rx_rssi_dBm[eNB_id] = ue->measurements.rx_power_avg_dB[eNB_id] - ue->rx_total_gain_dB;
 #ifdef DEBUG_MEAS_UE
-    LOG_I(PHY,"[eNB %d] RSSI %d dBm, RSSI (digital) %d dB, WBandCQI %d dB, rxPwrAvg %d, n0PwrAvg %d\n",
+      LOG_I(PHY,"[eNB %d] Subframe %d, RSSI %d dBm, RSSI (digital) %d dB, WBandCQI %d dB, rxPwrAvg %d, n0PwrAvg %d\n",
             eNB_id,
+            subframe,
             ue->measurements.rx_rssi_dBm[eNB_id],
             ue->measurements.rx_power_avg_dB[eNB_id],
             ue->measurements.wideband_cqi_avg[eNB_id],
diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c
old mode 100644
new mode 100755
index 21c4c8aba84c57cb312e0edb0900955e965db662..8b7a81829795a21d92ffe99587f072f174d3ba01
--- a/openair1/PHY/LTE_TRANSPORT/dci.c
+++ b/openair1/PHY/LTE_TRANSPORT/dci.c
@@ -1979,6 +1979,9 @@ uint8_t get_num_pdcch_symbols(uint8_t num_dci,
   uint16_t numCCE = 0;
   uint8_t i;
   uint8_t nCCEmin = 0;
+  uint16_t CCE_max_used_index = 0;
+  uint16_t firstCCE_max = dci_alloc[0].firstCCE;
+  uint8_t  L = dci_alloc[0].L;
 
   // check pdcch duration imposed by PHICH duration (Section 6.9 of 36-211)
   if (frame_parms->Ncp==1) { // extended prefix
@@ -1995,16 +1998,22 @@ uint8_t get_num_pdcch_symbols(uint8_t num_dci,
   for (i=0; i<num_dci; i++) {
     //     printf("dci %d => %d\n",i,dci_alloc[i].L);
     numCCE += (1<<(dci_alloc[i].L));
+
+    if(firstCCE_max < dci_alloc[i].firstCCE) {
+      firstCCE_max = dci_alloc[i].firstCCE;
+      L            = dci_alloc[i].L;
+    }
   }
+  CCE_max_used_index = firstCCE_max + (1<<L) - 1;
 
   //if ((9*numCCE) <= (frame_parms->N_RB_DL*2))
-  if (numCCE <= get_nCCE(1, frame_parms, get_mi(frame_parms, subframe)))
+  if (CCE_max_used_index < get_nCCE(1, frame_parms, get_mi(frame_parms, subframe)))
     return(cmax(1,nCCEmin));
   //else if ((9*numCCE) <= (frame_parms->N_RB_DL*((frame_parms->nb_antenna_ports_eNB==4) ? 4 : 5)))
-  else if (numCCE <= get_nCCE(2, frame_parms, get_mi(frame_parms, subframe)))
+  else if (CCE_max_used_index < get_nCCE(2, frame_parms, get_mi(frame_parms, subframe)))
     return(cmax(2,nCCEmin));
   //else if ((9*numCCE) <= (frame_parms->N_RB_DL*((frame_parms->nb_antenna_ports_eNB==4) ? 7 : 8)))
-  else if (numCCE <= get_nCCE(3, frame_parms, get_mi(frame_parms, subframe)))
+  else if (CCE_max_used_index < get_nCCE(3, frame_parms, get_mi(frame_parms, subframe)))
     return(cmax(3,nCCEmin));
   else if (frame_parms->N_RB_DL<=10) {
     if (frame_parms->Ncp == 0) { // normal CP
diff --git a/openair1/PHY/LTE_TRANSPORT/dci.h b/openair1/PHY/LTE_TRANSPORT/dci.h
index 2987f026e04663ddd8ee68e2adb2b321a95d128a..a9a5dda29ef14f5fd7475469f513809b5be112dd 100644
--- a/openair1/PHY/LTE_TRANSPORT/dci.h
+++ b/openair1/PHY/LTE_TRANSPORT/dci.h
@@ -230,7 +230,7 @@ typedef struct DCI1A_10MHz_TDD_1_6 DCI1A_10MHz_TDD_1_6_t;
 ///  DCI Format Type 0 (20 MHz,TDD1-6, 27 bits)
 struct DCI0_20MHz_TDD_1_6 {
   /// Padding
-  uint32_t padding:2;
+  uint32_t padding:3;
   /// CQI request
   uint32_t cqi_req:1;
   /// DAI
diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c
index d834e9caedf11900b029dd759a1e19ac4e813872..d1944d54367b42832fa3965515207c66b9f3f512 100644
--- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c
+++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c
@@ -4799,7 +4799,7 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format,
         return(0);
     }
 
-    if(harq_pid >8)
+    if(harq_pid>=8)
     {
         LOG_I(PHY,"bad harq id \n");
         return(0);
@@ -4888,7 +4888,7 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format,
 
     if(rballoc > RIV_max)
     {
-        LOG_I(PHY,"bad dci rballoc rballoc %d  RIV_max %d \n",rballoc, RIV_max);
+        LOG_I(PHY,"bad dci rballoc rballoc %d  RIV_max %lld \n",rballoc, RIV_max);
         // DCI false detection
         return(0);
     }
@@ -5013,7 +5013,7 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format,
 #endif
 
     // I- check dci content minimum coherency
-    if(harq_pid >8)
+    if(harq_pid>=8)
     {
         LOG_I(PHY,"bad harq pid\n");
       return(0);
@@ -5124,7 +5124,7 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format,
    if( (rballoc > RIV_max) && (rah == 1) )
    {
       // DCI false detection
-       LOG_I(PHY,"bad rballoc %d RIV_max %d\n", rballoc, RIV_max);
+       LOG_I(PHY,"bad rballoc %d RIV_max %lld\n", rballoc, RIV_max);
       return(0);
    }
 
@@ -8642,13 +8642,20 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
     ulsch->bundling = 1-AckNackFBMode;
 
     if (frame_parms->frame_type == FDD) {
-      int dl_subframe = (subframe<4) ? (subframe+6) : (subframe-4);
+      //int dl_subframe = (subframe<4) ? (subframe+6) : (subframe-4);
+      int dl_subframe = subframe;
 
       if (ue->dlsch[dl_subframe&0x1][eNB_id][0]->harq_ack[dl_subframe].send_harq_status>0) { // we have downlink transmission
         ulsch->harq_processes[harq_pid]->O_ACK = 1;
       } else {
         ulsch->harq_processes[harq_pid]->O_ACK = 0;
       }
+      /*LOG_I(PHY,"DCI 0 Processing: dl_subframe %d send_harq_status Odd %d send_harq_status Even %d harq_pid %d O_ACK %d\n", dl_subframe,
+              ue->dlsch[0][eNB_id][0]->harq_ack[dl_subframe].send_harq_status,
+              ue->dlsch[1][eNB_id][0]->harq_ack[dl_subframe].send_harq_status,
+              harq_pid,
+              ulsch->harq_processes[harq_pid]->O_ACK);*/
+
     } else {
       if (ulsch->bundling)
         ulsch->harq_processes[harq_pid]->O_ACK = (dai == 3)? 0 : 1;
@@ -8660,10 +8667,16 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
 
     dlsch[0]->harq_ack[subframe].vDAI_UL = dai+1;
 
-    LOG_D(PHY, "[PUSCH %d] Format0 DCI %s, CQI_req=%d, cshift=%d, TPC=%d, DAI=%d, vDAI_UL[sf#%d]=%d, NDI=%d, MCS=%d, RBalloc=%d, first_rb=%d, harq_pid=%d, nb_rb=%d, subframe_scheduling_flag=%d\n",
+
+    /*LOG_I(PHY, "[PUSCH %d] Format0 DCI %s, CQI_req=%d, cshift=%d, TPC=%d, DAI=%d, vDAI_UL[sf#%d]=%d, NDI=%d, MCS=%d, RBalloc=%d, first_rb=%d, harq_pid=%d, nb_rb=%d, subframe_scheduling_flag=%d"
+            "   ulsch->bundling %d, O_ACK %d \n",
         harq_pid,
         (frame_parms->frame_type == TDD? "TDD" : "FDD"),
-        cqi_req, cshift, TPC, dai, subframe, dlsch[0]->harq_ack[subframe].vDAI_UL, ndi, mcs, rballoc, ulsch->harq_processes[harq_pid]->first_rb, harq_pid, ulsch->harq_processes[harq_pid]->nb_rb, ulsch->harq_processes[harq_pid]->subframe_scheduling_flag);
+        cqi_req, cshift, TPC, dai, subframe, dlsch[0]->harq_ack[subframe].vDAI_UL, ndi, mcs, rballoc,
+        ulsch->harq_processes[harq_pid]->first_rb, harq_pid, ulsch->harq_processes[harq_pid]->nb_rb,
+        ulsch->harq_processes[harq_pid]->subframe_scheduling_flag,
+        ulsch->bundling,
+        ulsch->harq_processes[harq_pid]->O_ACK);*/
 
     ulsch->beta_offset_cqi_times8                = beta_cqi[ue->pusch_config_dedicated[eNB_id].betaOffset_CQI_Index];//18;
     ulsch->beta_offset_ri_times8                 = beta_ri[ue->pusch_config_dedicated[eNB_id].betaOffset_RI_Index];//10;
diff --git a/openair1/PHY/LTE_TRANSPORT/defs.h b/openair1/PHY/LTE_TRANSPORT/defs.h
old mode 100755
new mode 100644
index f6293bf1b2d73689d6769a1270bfe0ad53fc418b..dced65fa2cbe84432a11a6bf5611ae36da28068c
--- a/openair1/PHY/LTE_TRANSPORT/defs.h
+++ b/openair1/PHY/LTE_TRANSPORT/defs.h
@@ -777,7 +777,8 @@ typedef enum {
   pucch_format1b,
   pucch_format2,
   pucch_format2a,
-  pucch_format2b
+  pucch_format2b,
+  pucch_format3    // PUCCH format3
 } PUCCH_FMT_t;
 
 
diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c
index 9f8ee6cec79a861403653fabbc6348f534647fa6..05f458e94a2e05b49172e1d8b5351181faaa7888 100644
--- a/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c
+++ b/openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c
@@ -461,11 +461,11 @@ uint32_t  dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
     //#ifndef __AVX2__
 #if 1
     if (err_flag == 0) {
-
-        LOG_D(PHY, "turbo algo Kr=%d cb_cnt=%d C=%d nbRB=%d TBSInput=%d TBSHarq=%d TBSplus24=%d mcs=%d Qm=%d RIV=%d round=%d maxIter %d\n",
-                            Kr,r,harq_process->C,harq_process->nb_rb,A,harq_process->TBS,
+/*
+        LOG_I(PHY, "turbo algo Kr=%d cb_cnt=%d C=%d nbRB=%d crc_type %d TBSInput=%d TBSHarq=%d TBSplus24=%d mcs=%d Qm=%d RIV=%d round=%d maxIter %d\n",
+                            Kr,r,harq_process->C,harq_process->nb_rb,crc_type,A,harq_process->TBS,
                             harq_process->B,harq_process->mcs,harq_process->Qm,harq_process->rvidx,harq_process->round,dlsch->max_turbo_iterations);
-
+*/
     	if (llr8_flag) {
     		AssertFatal (Kr >= 256, "turbo algo issue Kr=%d cb_cnt=%d C=%d nbRB=%d TBSInput=%d TBSHarq=%d TBSplus24=%d mcs=%d Qm=%d RIV=%d round=%d\n",
     				Kr,r,harq_process->C,harq_process->nb_rb,A,harq_process->TBS,harq_process->B,harq_process->mcs,harq_process->Qm,harq_process->rvidx,harq_process->round);
@@ -641,8 +641,8 @@ uint32_t  dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
   frame_rx_prev = frame_rx_prev%1024;
 
   if (err_flag == 1) {
-    LOG_D(PHY,"[UE %d] DLSCH: Setting NAK for SFN/SF %d/%d (pid %d, round %d, subframe %d)\n",
-        phy_vars_ue->Mod_id, frame_rx_prev, subframe_rx_prev, harq_pid, harq_process->round, subframe);
+    //LOG_I(PHY,"[UE %d] DLSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d) Kr %d r %d harq_process->round %d\n",
+    //    phy_vars_ue->Mod_id, frame, subframe, harq_pid,harq_process->status, harq_process->round,harq_process->TBS,harq_process->mcs,Kr,r,harq_process->round);
 
     dlsch->harq_ack[subframe].ack = 0;
     dlsch->harq_ack[subframe].harq_id = harq_pid;
@@ -665,13 +665,16 @@ uint32_t  dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
     return((1+dlsch->max_turbo_iterations));
   } else {
 
+      //LOG_I(PHY,"[UE %d] DLSCH: Setting ACK for subframe %d TBS %d harq_process->mcs %d harq_process->nb_rb %d\n",
+                   //phy_vars_ue->Mod_id,subframe,harq_process->TBS,harq_process->mcs,harq_process->nb_rb);
+
     harq_process->status = SCH_IDLE;
     harq_process->round  = 0;
     dlsch->harq_ack[subframe].ack = 1;
     dlsch->harq_ack[subframe].harq_id = harq_pid;
     dlsch->harq_ack[subframe].send_harq_status = 1;
-    LOG_D(PHY,"[UE %d] DLSCH: Setting ACK for SFN/SF %d/%d (pid %d, pid status %d, round %d, subframe %d)\n",
-        phy_vars_ue->Mod_id, frame_rx_prev, subframe_rx_prev, harq_pid, harq_process->status, harq_process->round, subframe);
+    //LOG_I(PHY,"[UE %d] DLSCH: Setting ACK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d)\n",
+      //  phy_vars_ue->Mod_id, frame, subframe, harq_pid, harq_process->status, harq_process->round,harq_process->TBS,harq_process->mcs);
 
     if(is_crnti)
     {
diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c
index 4e5c3ac156846945115396b7d9ff28b1ad7458ad..42b01a2ccc2fe043aab23789311049f2ef32a56e 100644
--- a/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c
+++ b/openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c
@@ -31,6 +31,7 @@
  */
 //#include "PHY/defs.h"
 #include "PHY/extern.h"
+#include "SCHED/defs.h"
 #include "defs.h"
 #include "extern.h"
 #include "PHY/sse_intrin.h"
@@ -264,12 +265,12 @@ int rx_pdsch(PHY_VARS_UE *ue,
                                    ue->high_speed_flag,
                                    frame_parms,
                                    dlsch0_harq->mimo_mode);
-//#ifdef DEBUG_DLSCH_MOD
-    /*   printf("dlsch: using pmi %lx, rb_alloc %x, pmi_ext ",pmi2hex_2Ar1(dlsch0_harq->pmi_alloc),*rballoc);
+#ifdef DEBUG_DLSCH_MOD
+      printf("dlsch: using pmi %lx, rb_alloc %x, pmi_ext ",pmi2hex_2Ar1(dlsch0_harq->pmi_alloc),*rballoc);
        for (rb=0;rb<nb_rb;rb++)
           printf("%d",pdsch_vars[eNB_id]->pmi_ext[rb]);
-       printf("\n");*/
-//#endif
+       printf("\n");
+#endif
 
    if (rx_type >= rx_IC_single_stream) {
       if (eNB_id_i<ue->n_connected_eNB) // we are in TM5
@@ -361,7 +362,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
 
 
 #ifdef DEBUG_PHY
-  LOG_D(PHY,"[DLSCH] log2_maxh = %d (%d,%d)\n",pdsch_vars[eNB_id]->log2_maxh,avg[0],avgs);
+  LOG_D(PHY,"[DLSCH] nb_rb %d log2_maxh = %d (%d,%d)\n",nb_rb,pdsch_vars[eNB_id]->log2_maxh,avg[0],avgs);
   LOG_D(PHY,"[DLSCH] mimo_mode = %d\n", dlsch0_harq->mimo_mode);
 #endif
 
@@ -469,11 +470,12 @@ int rx_pdsch(PHY_VARS_UE *ue,
                               symbol,
                               nb_rb);
 #ifdef DEBUG_PHY
-    LOG_I(PHY,"[DLSCH] log2_maxh = %d [log2_maxh0 %d log2_maxh1 %d] (%d,%d)\n",pdsch_vars[eNB_id]->log2_maxh,
+    LOG_I(PHY,"[DLSCH] AbsSubframe %d.%d log2_maxh = %d [log2_maxh0 %d log2_maxh1 %d] (%d,%d)\n",
+            frame%1024,subframe, pdsch_vars[eNB_id]->log2_maxh,
                                                  pdsch_vars[eNB_id]->log2_maxh0,
                                                  pdsch_vars[eNB_id]->log2_maxh1,
                                                  avg[0],avgs);
-    LOG_I(PHY,"[DLSCH] mimo_mode = %d\n", dlsch0_harq->mimo_mode);
+    LOG_D(PHY,"[DLSCH] mimo_mode = %d\n", dlsch0_harq->mimo_mode);
 #endif
   }
 
@@ -748,6 +750,8 @@ int rx_pdsch(PHY_VARS_UE *ue,
     //i_mod should have been passed as a parameter
   }
 
+  //printf("LLR dlsch0_harq->Qm %d rx_type %d cw0 %d cw1 %d symbol %d \n",dlsch0_harq->Qm,rx_type,codeword_TB0,codeword_TB1,symbol);
+
   switch (dlsch0_harq->Qm) {
   case 2 :
     if ((rx_type==rx_standard) || (codeword_TB1 == -1)) {
@@ -1080,15 +1084,15 @@ int rx_pdsch(PHY_VARS_UE *ue,
 
 // Please keep it: useful for debugging
 #if 0
-  if( (symbol == 13) && (dlsch0_harq->mimo_mode == 2) )
+  if( (symbol == 13) && (subframe==0) && (dlsch0_harq->Qm == 6) /*&& (nb_rb==25)*/)
   {
       LOG_E(PHY,"Dump Phy Chan Est \n");
-      if(subframe&0x1)
+      if(1)
       {
 #if 1
-      //write_output("rxdataF0.m"    , "rxdataF0",             &common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1);
+      write_output("rxdataF0.m"    , "rxdataF0",             &common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1);
       //write_output("rxdataF1.m"    , "rxdataF1",             &common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1);
-      //write_output("dl_ch_estimates00.m", "dl_ch_estimates00",   &common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][0],14*frame_parms->ofdm_symbol_size,1,1);
+      write_output("dl_ch_estimates00.m", "dl_ch_estimates00",   &common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][0],14*frame_parms->ofdm_symbol_size,1,1);
       //write_output("dl_ch_estimates01.m", "dl_ch_estimates01",   &common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][1][0],14*frame_parms->ofdm_symbol_size,1,1);
       //write_output("dl_ch_estimates10.m", "dl_ch_estimates10",   &common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2][0],14*frame_parms->ofdm_symbol_size,1,1);
       //write_output("dl_ch_estimates11.m", "dl_ch_estimates11",   &common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][3][0],14*frame_parms->ofdm_symbol_size,1,1);
@@ -1099,16 +1103,16 @@ int rx_pdsch(PHY_VARS_UE *ue,
       //write_output("rxdataF_ext10.m"    , "rxdataF_ext10",       &pdsch_vars[eNB_id]->rxdataF_ext[2][0],14*frame_parms->N_RB_DL*12,1,1);
       //write_output("rxdataF_ext11.m"    , "rxdataF_ext11",       &pdsch_vars[eNB_id]->rxdataF_ext[3][0],14*frame_parms->N_RB_DL*12,1,1);
       write_output("dl_ch_estimates_ext00.m", "dl_ch_estimates_ext00", &pdsch_vars[eNB_id]->dl_ch_estimates_ext[0][0],14*frame_parms->N_RB_DL*12,1,1);
-      write_output("dl_ch_estimates_ext01.m", "dl_ch_estimates_ext01", &pdsch_vars[eNB_id]->dl_ch_estimates_ext[1][0],14*frame_parms->N_RB_DL*12,1,1);
-      write_output("dl_ch_estimates_ext10.m", "dl_ch_estimates_ext10", &pdsch_vars[eNB_id]->dl_ch_estimates_ext[2][0],14*frame_parms->N_RB_DL*12,1,1);
-      write_output("dl_ch_estimates_ext11.m", "dl_ch_estimates_ext11", &pdsch_vars[eNB_id]->dl_ch_estimates_ext[3][0],14*frame_parms->N_RB_DL*12,1,1);
+      //write_output("dl_ch_estimates_ext01.m", "dl_ch_estimates_ext01", &pdsch_vars[eNB_id]->dl_ch_estimates_ext[1][0],14*frame_parms->N_RB_DL*12,1,1);
+      //write_output("dl_ch_estimates_ext10.m", "dl_ch_estimates_ext10", &pdsch_vars[eNB_id]->dl_ch_estimates_ext[2][0],14*frame_parms->N_RB_DL*12,1,1);
+      //write_output("dl_ch_estimates_ext11.m", "dl_ch_estimates_ext11", &pdsch_vars[eNB_id]->dl_ch_estimates_ext[3][0],14*frame_parms->N_RB_DL*12,1,1);
       write_output("rxdataF_comp00.m","rxdataF_comp00",              &pdsch_vars[eNB_id]->rxdataF_comp0[0][0],14*frame_parms->N_RB_DL*12,1,1);
-      write_output("rxdataF_comp01.m","rxdataF_comp01",              &pdsch_vars[eNB_id]->rxdataF_comp0[1][0],14*frame_parms->N_RB_DL*12,1,1);
-      write_output("rxdataF_comp10.m","rxdataF_comp10",              &pdsch_vars[eNB_id]->rxdataF_comp1[harq_pid][round][0][0],14*frame_parms->N_RB_DL*12,1,1);
-      write_output("rxdataF_comp11.m","rxdataF_comp11",              &pdsch_vars[eNB_id]->rxdataF_comp1[harq_pid][round][1][0],14*frame_parms->N_RB_DL*12,1,1);
+      //write_output("rxdataF_comp01.m","rxdataF_comp01",              &pdsch_vars[eNB_id]->rxdataF_comp0[1][0],14*frame_parms->N_RB_DL*12,1,1);
+      //write_output("rxdataF_comp10.m","rxdataF_comp10",              &pdsch_vars[eNB_id]->rxdataF_comp1[harq_pid][round][0][0],14*frame_parms->N_RB_DL*12,1,1);
+      //write_output("rxdataF_comp11.m","rxdataF_comp11",              &pdsch_vars[eNB_id]->rxdataF_comp1[harq_pid][round][1][0],14*frame_parms->N_RB_DL*12,1,1);
 #endif
       write_output("llr0.m","llr0",  &pdsch_vars[eNB_id]->llr[0][0],(14*nb_rb*12*dlsch1_harq->Qm) - 4*(nb_rb*4*dlsch1_harq->Qm),1,0);
-      write_output("llr1.m","llr1",  &pdsch_vars[eNB_id]->llr[1][0],(14*nb_rb*12*dlsch1_harq->Qm) - 4*(nb_rb*4*dlsch1_harq->Qm),1,0);
+      //write_output("llr1.m","llr1",  &pdsch_vars[eNB_id]->llr[1][0],(14*nb_rb*12*dlsch1_harq->Qm) - 4*(nb_rb*4*dlsch1_harq->Qm),1,0);
 
 
       AssertFatal(0," ");
@@ -3358,7 +3362,7 @@ void dlsch_scale_channel(int **dl_ch_estimates_ext,
 
 ch_amp = ((pilots) ? (dlsch_ue[0]->sqrt_rho_b) : (dlsch_ue[0]->sqrt_rho_a));
 
-    LOG_D(PHY,"Scaling PDSCH Chest in OFDM symbol %d by %d\n",symbol_mod,ch_amp);
+    LOG_D(PHY,"Scaling PDSCH Chest in OFDM symbol %d by %d, pilots %d nb_rb %d NCP %d symbol %d\n",symbol_mod,ch_amp,pilots,nb_rb,frame_parms->Ncp,symbol);
    // printf("Scaling PDSCH Chest in OFDM symbol %d by %d\n",symbol_mod,ch_amp);
 
   ch_amp128 = _mm_set1_epi16(ch_amp); // Q3.13
diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c
index a344d2b2085fe6eaac7cfa2c033dec65e5e7de99..051a3d5d83782d6607dfe52a6e0c5e94f8c51cc3 100644
--- a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c
+++ b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c
@@ -583,7 +583,7 @@ int allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
   LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->frame_parms;
 
 
-  int first_layer0; //= dlsch0_harq->first_layer;
+  int first_layer0 = -1; //= dlsch0_harq->first_layer;
   int Nlayers0 = -1; //  = dlsch0_harq->Nlayers;
   uint8_t mod_order0=0; // = get_Qm(dlsch0_harq->mcs);
   uint8_t mod_order1=0; //=2;
diff --git a/openair1/PHY/LTE_TRANSPORT/if4_tools.c b/openair1/PHY/LTE_TRANSPORT/if4_tools.c
old mode 100755
new mode 100644
diff --git a/openair1/PHY/LTE_TRANSPORT/phich.c b/openair1/PHY/LTE_TRANSPORT/phich.c
index d363d4dcf65faf9312a1dc70357f45eab7f5f6a8..17b9540e4a0ff92792b51240572c002f819129b6 100644
--- a/openair1/PHY/LTE_TRANSPORT/phich.c
+++ b/openair1/PHY/LTE_TRANSPORT/phich.c
@@ -135,6 +135,17 @@ unsigned char subframe2_ul_harq(LTE_DL_FRAME_PARMS *frame_parms,unsigned char su
 
     break;
 
+  case 4:
+     if ( (subframe == 8) || (subframe == 9) ) {
+       return(subframe-8);
+     } else {
+       LOG_E(PHY,"phich.c: subframe2_ul_harq, illegal subframe %d for tdd_config %d\n",
+             subframe,frame_parms->tdd_config);
+       return(0);
+     }
+
+     break;
+
   }
 
   return(0);
@@ -1396,6 +1407,7 @@ void rx_phich(PHY_VARS_UE *ue,
             HI16,
             nseq_PHICH,
             ngroup_PHICH,
+            ulsch->harq_processes[harq_pid]->round,
             ulsch->Mlimit);
       //#endif
 
diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h
index b9b50c578a056addf5e8c6a5917b1271f3aaf686..54054ed90f765dee7d478b07cad642b7b0f81984 100644
--- a/openair1/PHY/LTE_TRANSPORT/proto.h
+++ b/openair1/PHY/LTE_TRANSPORT/proto.h
@@ -1382,7 +1382,8 @@ int pss_sss_extract(PHY_VARS_UE *phy_vars_ue,
   @returns 0 on success
 */
 int pss_only_extract(PHY_VARS_UE *phy_vars_ue,
-                    int32_t pss_ext[4][72]);
+                    int32_t pss_ext[4][72],
+                    uint8_t subframe);
 
 /*! \brief Extract only SSS resource elements
   @param phy_vars_ue Pointer to UE variables
@@ -1390,7 +1391,8 @@ int pss_only_extract(PHY_VARS_UE *phy_vars_ue,
   @returns 0 on success
 */
 int sss_only_extract(PHY_VARS_UE *phy_vars_ue,
-                    int32_t sss_ext[4][72]);
+                    int32_t sss_ext[4][72],
+                    uint8_t subframe);
 
 /*! \brief Performs detection of SSS to find cell ID and other framing parameters (FDD/TDD, normal/extended prefix)
   @param phy_vars_ue Pointer to UE variables
@@ -2047,6 +2049,17 @@ void generate_pucch2x(int32_t **txdataF,
                       uint8_t subframe,
                       uint16_t rnti);
 
+void generate_pucch3x(int32_t **txdataF,
+                    LTE_DL_FRAME_PARMS *frame_parms,
+                    uint8_t ncs_cell[20][7],
+                    PUCCH_FMT_t fmt,
+                    PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
+                    uint16_t n3_pucch,
+                    uint8_t shortened_format,
+                    uint8_t *payload,
+                    int16_t amp,
+                    uint8_t subframe,
+                    uint16_t rnti);
 
 void generate_pucch_emul(PHY_VARS_UE *phy_vars_ue,
                          UE_rxtx_proc_t *proc,
diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c
index 1efad912af5a0f54ff6efe37c99f73f4cce001e6..8adc693b31c7d668785ea011da34c21ed581ad5b 100644
--- a/openair1/PHY/LTE_TRANSPORT/pucch.c
+++ b/openair1/PHY/LTE_TRANSPORT/pucch.c
@@ -115,6 +115,182 @@ 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"};
 
+/* PUCCH format3 >> */
+#define D_I             0
+#define D_Q             1
+#define D_IQDATA        2
+#define D_NSLT1SF       2
+#define D_NSYM1SLT      7
+#define D_NSYM1SF       2*7
+#define D_NSC1RB        12
+#define D_NRB1PUCCH     2
+#define D_NPUCCH_SF5    5
+#define D_NPUCCH_SF4    4
+
+uint8_t chcod_tbl[128][48] = { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+  {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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
+  {1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1},
+  {0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0},
+  {0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0},
+  {1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1},
+  {1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1},
+  {0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0},
+  {0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0},
+  {1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1},
+  {1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1},
+  {0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0},
+  {0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0},
+  {1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1},
+  {1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1},
+  {0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0},
+  {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1},
+  {1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0},
+  {1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0},
+  {0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1},
+  {0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1},
+  {1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0},
+  {1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0},
+  {0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1},
+  {0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1},
+  {1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0},
+  {1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0},
+  {0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1},
+  {0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1},
+  {1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0},
+  {1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0},
+  {0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1},
+  {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1},
+  {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0},
+  {1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0},
+  {0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1},
+  {0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1},
+  {1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0},
+  {1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0},
+  {0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1},
+  {0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1},
+  {1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0},
+  {1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0},
+  {0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1},
+  {0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1},
+  {1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0},
+  {1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0},
+  {0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1},
+  {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},
+  {1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1},
+  {1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1},
+  {0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0},
+  {0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0},
+  {1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1},
+  {1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1},
+  {0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0},
+  {0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0},
+  {1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1},
+  {1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1},
+  {0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0},
+  {0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0},
+  {1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1},
+  {1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1},
+  {0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0},
+  {0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1},
+  {1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0},
+  {1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0},
+  {0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1},
+  {0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},
+  {1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
+  {1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0},
+  {0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1},
+  {0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1},
+  {1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0},
+  {1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0},
+  {0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1},
+  {0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1},
+  {1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0},
+  {1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0},
+  {0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1},
+  {0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0},
+  {1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1},
+  {1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1},
+  {0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0},
+  {0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0},
+  {1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1},
+  {1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1},
+  {0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0},
+  {0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0},
+  {1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1},
+  {1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1},
+  {0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0},
+  {0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0},
+  {1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1},
+  {1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1},
+  {0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0},
+  {0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0},
+  {1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1},
+  {1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1},
+  {0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0},
+  {0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0},
+  {1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1},
+  {1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1},
+  {0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0},
+  {0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0},
+  {1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1},
+  {1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1},
+  {0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0},
+  {0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0},
+  {1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1},
+  {1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1},
+  {0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0},
+  {0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1},
+  {1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0},
+  {1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0},
+  {0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1},
+  {0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1},
+  {1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0},
+  {1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0},
+  {0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1},
+  {0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1},
+  {1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0},
+  {1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0},
+  {0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1},
+  {0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1},
+  {1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0},
+  {1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0},
+  {0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1} };
+
+// W5_TBL
+int16_t W5_fmt3_re[5][5] = { {32767, 32767, 32767, 32767, 32767},
+  {32767, 10125, -26509, -26509, 10125},
+  {32767, -26509, 10125, 10125, -26509},
+  {32767, -26509, 10125, 10125, -26509},
+  {32767, 10125, -26509, -26509, 10125} };
+
+int16_t W5_fmt3_im[5][5] = { {0, 0, 0, 0, 0},
+  {0, 31163, 19259, -19259, -31163},
+  {0, 19259, -31163, 31163, -19259},
+  {0, -19259, 31163, -31163, 19259},
+  {0, -31163, -19259, 19259, 31163} };
+
+int16_t W4_fmt3[4][4] = { {32767, 32767, 32767, 32767},
+  {32767, -32767, 32767, -32767},
+  {32767, 32767, -32767, -32767},
+  {32767, -32767, -32767, 32767} };
+
+// W2 TBL
+int16_t W2[2] = {32767, 32767};
+
+// e^j*pai*floor (ncs_cell(ns,l)/64)/2
+int16_t RotTBL_re[4] = {32767, 0, -32767, 0};
+int16_t RotTBL_im[4] = {0, 32767, 0, -32767};
+
+//np4_tbl, np5_tbl
+uint8_t Np5_TBL[5] = {0, 3, 6, 8, 10};
+uint8_t Np4_TBL[4] = {0, 3, 6, 9};
+
+// alpha_TBL
+int16_t alphaTBL_re[12] = {32767, 28377, 16383, 0, -16383, -28377, -32767, -28377, -16383, 0, 16383, 28377};
+int16_t alphaTBL_im[12] = {0, 16383, 28377, 32767, 28377, 16383, 0, -16383, -28377, -32767, -28377, -16383};
+
+/* PUCCH format3 << */
+
 void generate_pucch1x(int32_t **txdataF,
 		      LTE_DL_FRAME_PARMS *frame_parms,
 		      uint8_t ncs_cell[20][7],
@@ -336,6 +512,10 @@ void generate_pucch1x(int32_t **txdataF,
           case pucch_format2b:
             AssertFatal(1==0,"should not go here\n");
             break;
+
+          case pucch_format3:
+            fprintf(stderr, "PUCCH format 3 not handled\n");
+            abort();
           } // switch fmt
         } else { // These are PUCCH reference symbols
 
@@ -660,11 +840,935 @@ void generate_pucch2x(int32_t **txdataF,
   }
 }
 
+/* PUCCH format3 >> */
+/* DFT */
+void pucchfmt3_Dft( int16_t *x, int16_t *y )
+{
+  int16_t i, k;
+  int16_t tmp[2];
+  int16_t calctmp[D_NSC1RB*2]={0};
+
+  for (i=0; i<D_NSC1RB; i++) {
+    for(k=0; k<D_NSC1RB; k++) {
+      tmp[0] = alphaTBL_re[(12-((i*k)%12))%12];
+      tmp[1] = alphaTBL_im[(12-((i*k)%12))%12];
+
+      calctmp[2*i] += (((int32_t)x[2*k] * tmp[0] - (int32_t)x[2*k+1] * tmp[1])>>15);
+      calctmp[2*i+1] += (((int32_t)x[2*k+1] * tmp[0] + (int32_t)x[2*k] * tmp[1])>>15);
+    }
+    y[2*i] = (int16_t)( (double) calctmp[2*i] / sqrt(D_NSC1RB));
+    y[2*i+1] = (int16_t)((double) calctmp[2*i+1] / sqrt(D_NSC1RB));
+  }
+}
+
+void generate_pucch3x(int32_t **txdataF,
+                    LTE_DL_FRAME_PARMS *frame_parms,
+                    uint8_t ncs_cell[20][7],
+                    PUCCH_FMT_t fmt,
+                    PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
+                    uint16_t n3_pucch,
+                    uint8_t shortened_format,
+                    uint8_t *payload,
+                    int16_t amp,
+                    uint8_t subframe,
+                    uint16_t rnti)
+{
+
+  uint32_t u, v;
+  uint16_t i, j, re_offset;
+  uint32_t z[12*14], *zptr;
+  uint32_t y_tilda[12*14]={}, *y_tilda_ptr;
+  uint8_t ns, nsymb, n_oc, n_oc0, n_oc1;
+  uint8_t N_UL_symb = (frame_parms->Ncp==0) ? 7 : 6;
+  uint8_t m, l;
+  uint8_t n_cs;
+  int16_t tmp_re, tmp_im, W_re=0, W_im=0;
+  int32_t *txptr;
+  uint32_t symbol_offset;
+  
+  uint32_t u0 = (frame_parms->Nid_cell + frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[subframe<<1]) % 30;
+  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)];
+
+  // variables for channel coding
+  uint8_t chcod_tbl_idx = 0;
+  //uint8_t chcod_dt[48] = {};
+
+  // variables for Scrambling
+  uint32_t cinit = 0;
+  uint32_t x1;
+  uint32_t s,s0,s1;
+  uint8_t  C[48] ={};
+  uint8_t  scr_dt[48]={};
+
+  // variables for Modulation
+  int16_t d_re[24]={};
+  int16_t d_im[24]={};
+
+  // variables for orthogonal sequence selection
+  uint8_t N_PUCCH_SF0 = 5;
+  uint8_t N_PUCCH_SF1 = (shortened_format==0)? 5:4;
+  uint8_t first_slot  = 0;
+  int16_t rot_re=0;
+  int16_t rot_im=0;
+
+  uint8_t dt_offset;
+  uint8_t sym_offset;
+  int16_t y_re[14][12]; //={0};
+  int16_t y_im[14][12]; //={0};
+
+  // DMRS
+  uint8_t alpha_idx=0;
+  uint8_t m_alpha_idx=0;
+
+  // TODO
+  // "SR+ACK/NACK" length is only 7 bits.
+  // This restriction will be lifted in the future.
+  // "CQI/PMI/RI+ACK/NACK" will be supported in the future.
+
+    // Channel Coding
+    for (uint8_t i=0; i<7; i++) {
+      chcod_tbl_idx += (payload[i]<<i); 
+    }
+
+    // Scrambling
+    cinit = (subframe + 1) * ((2 * frame_parms->Nid_cell + 1)<<16) + rnti;
+    s0 = lte_gold_generic(&x1,&cinit,1);
+    s1 = lte_gold_generic(&x1,&cinit,0);
+
+    for (i=0; i<48; i++) {
+      s = (i<32)? s0:s1;
+      j = (i<32)? i:(i-32);
+      C[i] = ((s>>j)&1);
+    }
+
+    for (i=0; i<48; i++) {
+      scr_dt[i] = chcod_tbl[chcod_tbl_idx][i] ^ C[i];
+    }
+
+    // Modulation
+    for (uint8_t i=0; i<48; i+=2){
+      if (scr_dt[i]==0 && scr_dt[i+1]==0){
+        d_re[ i>>1] = ((ONE_OVER_SQRT2_Q15 * amp) >>15);
+        d_im[ i>>1] = ((ONE_OVER_SQRT2_Q15 * amp) >>15);
+      } else if (scr_dt[i]==0 && scr_dt[i+1]==1) {
+        d_re[ i>>1] = ((ONE_OVER_SQRT2_Q15 * amp) >>15);
+        d_im[ i>>1] = -1 * ((ONE_OVER_SQRT2_Q15 * amp) >>15);
+      } else if (scr_dt[i]==1 && scr_dt[i+1]==0) {
+        d_re[ i>>1] = -1 * ((ONE_OVER_SQRT2_Q15 * amp)>>15);
+        d_im[ i>>1] = ((ONE_OVER_SQRT2_Q15 * amp)>>15);
+      } else if (scr_dt[i]==1 && scr_dt[i+1]==1) {
+        d_re[ i>>1] = -1 * ((ONE_OVER_SQRT2_Q15 * amp)>>15);
+        d_im[ i>>1] = -1 * ((ONE_OVER_SQRT2_Q15 * amp)>>15);
+      } else {
+        //***log Modulation Error!
+      }
+    }
+
+    // Calculate Orthogonal Sequence index
+    n_oc0 = n3_pucch % N_PUCCH_SF1;
+    if (N_PUCCH_SF1 == 5) {
+      n_oc1 = (3 * n_oc0) % N_PUCCH_SF1;
+    } else {
+      n_oc1 = n_oc0 % N_PUCCH_SF1;
+    }
+
+    y_tilda_ptr = y_tilda;
+    zptr = z;
+
+    // loop over 2 slots
+    for (ns=(subframe<<1), u=u0, v=v0; ns<(2+(subframe<<1)); ns++, u=u1, v=v1) {
+      first_slot = (ns==(subframe<<1))?1:0;
+
+      //loop over symbols in slot
+      for (l=0; l<N_UL_symb; l++) {
+        rot_re = RotTBL_re[(uint8_t) ncs_cell[ns][l]/64] ;
+        rot_im = RotTBL_im[(uint8_t) ncs_cell[ns][l]/64] ;
+
+        // Comput W_noc(m) (36.211 p. 19)
+        if ( first_slot == 0 && shortened_format==1) {  // second slot and shortened format
+          n_oc = n_oc1;
+
+          if (l<1) {                                         // data
+            W_re=W4_fmt3[n_oc][l];
+            W_im=0;
+          } else if (l==1) {                                  // DMRS
+            W_re=W2[0];
+            W_im=0;
+          } else if (l>=2 && l<5) {                          // data
+            W_re=W4_fmt3[n_oc][l-1];
+            W_im=0;
+          } else if (l==5) {                                 // DMRS
+            W_re=W2[1];
+            W_im=0;
+          } else if ((l>=N_UL_symb-2)) {                      // data
+            ;
+          } else {
+            //***log W Select Error!
+          }
+        } else {
+          if (first_slot == 1) {                       // 1st slot or 2nd slot and not shortened
+            n_oc=n_oc0;
+          } else {
+            n_oc=n_oc1;
+          }
+
+          if (l<1) {                                         // data
+            W_re=W5_fmt3_re[n_oc][l];
+            W_im=W5_fmt3_im[n_oc][l];
+          } else if (l==1) {                                  // DMRS
+            W_re=W2[0];
+            W_im=0;
+          } else if (l>=2 && l<5) {                          // data
+            W_re=W5_fmt3_re[n_oc][l-1];
+            W_im=W5_fmt3_im[n_oc][l-1];
+          } else if (l==5) {                                 // DMRS
+            W_re=W2[1];
+            W_im=0;
+          } else if ((l>=N_UL_symb-1)) {                     // data
+            W_re=W5_fmt3_re[n_oc][l-N_UL_symb+5];
+            W_im=W5_fmt3_im[n_oc][l-N_UL_symb+5];
+          } else {
+            //***log W Select Error!
+          }
+        }  // W Selection end
+
+        // Compute n_cs (36.211 p. 18)
+        n_cs = ncs_cell[ns][l];
+        if (N_PUCCH_SF1 == 5) {
+          alpha_idx = (n_cs + Np5_TBL[n_oc]) % 12;
+        } else {
+          alpha_idx = (n_cs + Np4_TBL[n_oc]) % 12;
+        }
+
+        // generate pucch data
+        dt_offset = (first_slot == 1) ? 0:12;
+        sym_offset = (first_slot == 1) ? 0:7;
+
+        for (i=0; i<12; i++) {
+          // Calculate yn(i) 
+          tmp_re = (((int32_t) (W_re*rot_re - W_im*rot_im)) >>15);
+          tmp_im = (((int32_t) (W_re*rot_im + W_im*rot_re)) >>15);
+          y_re[l+sym_offset][i] = (((int32_t) (tmp_re*d_re[i+dt_offset] - tmp_im*d_im[i+dt_offset]))>>15);
+          y_im[l+sym_offset][i] = (((int32_t) (tmp_re*d_im[i+dt_offset] + tmp_im*d_re[i+dt_offset]))>>15);
+
+          // cyclic shift
+          ((int16_t *)&y_tilda_ptr[(l+sym_offset)*12+(i-(ncs_cell[ns][l]%12)+12)%12])[0] = y_re[l+sym_offset][i];
+          ((int16_t *)&y_tilda_ptr[(l+sym_offset)*12+(i-(ncs_cell[ns][l]%12)+12)%12])[1] = y_im[l+sym_offset][i];
+
+          // DMRS
+          m_alpha_idx = (alpha_idx * i) % 12;
+          if (l==1 || l==5) {
+            ((int16_t *)&zptr[(l+sym_offset)*12+i])[0] =(((((int32_t) alphaTBL_re[m_alpha_idx]*ul_ref_sigs[u][v][0][i<<1] - (int32_t) alphaTBL_im[m_alpha_idx] * ul_ref_sigs[u][v][0][1+(i<<1)])>>15) * (int32_t)amp)>>15);
+            ((int16_t *)&zptr[(l+sym_offset)*12+i])[1] =(((((int32_t) alphaTBL_re[m_alpha_idx]*ul_ref_sigs[u][v][0][1+(i<<1)] + (int32_t) alphaTBL_im[m_alpha_idx] * ul_ref_sigs[u][v][0][i<<1])>>15) * (int32_t)amp)>>15);
+          }
+        }
+
+      } // l loop
+    } // ns
+
+    // DFT for pucch-data
+    for (l=0; l<14; l++) {
+      if (l==1 || l==5 || l==8 || l==12) {
+        ;
+      } else {
+         pucchfmt3_Dft((int16_t*)&y_tilda_ptr[l*12],(int16_t*)&zptr[l*12]);
+      }
+    }
+
+
+    // Mapping
+    m = n3_pucch / N_PUCCH_SF0;
+
+    if (shortened_format == 1) {
+      nsymb = (N_UL_symb<<1) - 1;
+    } else {
+      nsymb = (N_UL_symb<<1);
+   }
+
+    for (j=0,l=0; l<(nsymb); l++) {
+
+      if ((l<7) && ((m&1) == 0))
+        re_offset = (m*6) + frame_parms->first_carrier_offset;
+      else if ((l<7) && ((m&1) == 1))
+        re_offset = frame_parms->first_carrier_offset + (frame_parms->N_RB_DL - (m>>1) - 1)*12;
+      else if ((m&1) == 0)
+        re_offset = frame_parms->first_carrier_offset + (frame_parms->N_RB_DL - (m>>1) - 1)*12;
+      else
+        re_offset = ((m-1)*6) + frame_parms->first_carrier_offset;
+
+      if (re_offset > frame_parms->ofdm_symbol_size)
+        re_offset -= (frame_parms->ofdm_symbol_size);
+
+      symbol_offset = (unsigned int)frame_parms->ofdm_symbol_size*(l+(subframe*14));
+      txptr = &txdataF[0][symbol_offset];
+
+      for (i=0; i<12; i++,j++) {
+          txptr[re_offset++] = z[j];
+
+        if (re_offset==frame_parms->ofdm_symbol_size)
+          re_offset = 0;
+
+#ifdef DEBUG_PUCCH_TX
+        msg("[PHY] PUCCH subframe %d (%d,%d,%d,%d) => %d,%d\n",subframe,l,i,re_offset-1,m,((int16_t *)&z[j])[0],((int16_t *)&z[j])[1]);
+#endif
+      }
+    }
+
+}
+
+/* PUCCH format3 << */
+
 
 //#define Amax 13
 //void init_pucch2x_rx() {};
 
 
+/* PUCCH format3 >> */
+/* SubCarrier Demap */
+uint16_t pucchfmt3_subCarrierDeMapping( PHY_VARS_eNB *eNB,
+                                        int16_t SubCarrierDeMapData[NB_ANTENNAS_RX][14][12][2],
+                                        uint16_t n3_pucch )
+{
+    LTE_eNB_COMMON *eNB_common_vars  = &eNB->common_vars;
+    LTE_DL_FRAME_PARMS  *frame_parms = &eNB->frame_parms;
+    int16_t             *rxptr;
+    uint8_t             N_UL_symb    = D_NSYM1SLT;                      // only Normal CP format
+    uint16_t            m;                                              // Mapping to physical resource blocks(m)
+    uint32_t            aa;
+    uint16_t            k, l;
+    uint32_t            symbol_offset;
+    uint16_t            carrier_offset;
+    
+    
+    m = n3_pucch / D_NPUCCH_SF5;
+    
+    // Do detection
+    for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
+        
+        for (l=0; l<D_NSYM1SF; l++) {
+            
+            if ((l<N_UL_symb) && ((m&1) == 0))
+                carrier_offset = (m*6) + frame_parms->first_carrier_offset;
+            else if ((l<N_UL_symb) && ((m&1) == 1))
+                carrier_offset = frame_parms->first_carrier_offset + (frame_parms->N_RB_DL - (m>>1) - 1)*12;
+            else if ((m&1) == 0)
+                carrier_offset = frame_parms->first_carrier_offset + (frame_parms->N_RB_DL - (m>>1) - 1)*12;
+            else
+                carrier_offset = (((m-1)*6) + frame_parms->first_carrier_offset);
+            
+            if (carrier_offset > frame_parms->ofdm_symbol_size)
+                carrier_offset -= (frame_parms->ofdm_symbol_size);
+            
+            symbol_offset = (unsigned int)frame_parms->ofdm_symbol_size*l;
+            rxptr = (int16_t *)&eNB_common_vars->rxdataF[0][aa][symbol_offset];
+            
+            for (k=0; k<12; k++,carrier_offset++) {
+                SubCarrierDeMapData[aa][l][k][0] = (int16_t)rxptr[carrier_offset<<1];      // DeMapping Data I
+                SubCarrierDeMapData[aa][l][k][1] = (int16_t)rxptr[1+(carrier_offset<<1)];  // DeMapping Date Q
+                
+                if (carrier_offset==frame_parms->ofdm_symbol_size)
+                    carrier_offset = 0;
+                
+                #ifdef DEBUG_PUCCH_RX
+                    LOG_D(PHY,"[eNB] PUCCH subframe %d (%d,%d,%d,%d) : (%d,%d)\n",subframe,l,k,carrier_offset,m,
+                    SubCarrierDeMapData[aa][l][k][0],SubCarrierDeMapData[aa][l][k][1]);
+                #endif
+            }
+        }
+    }
+    return 0;
+}
+
+/* cyclic shift hopping remove */
+uint16_t pucchfmt3_Baseseq_csh_remove( int16_t SubCarrierDeMapData[NB_ANTENNAS_RX][14][12][2],
+                                       int16_t CshData_fmt3[NB_ANTENNAS_RX][14][12][2],
+                                       LTE_DL_FRAME_PARMS *frame_parms,
+                                       uint8_t subframe,
+                                       uint8_t ncs_cell[20][7] )
+{
+    //int16_t     calctmp_baSeq[2];
+    int16_t     calctmp_beta[2];
+    int16_t     calctmp_alphak[2];
+    int16_t     calctmp_SCDeMapData_alphak[2];
+    int32_t     n_cell_cs_div64;
+    int32_t     n_cell_cs_modNSC_RB;
+    
+    //int32_t     NSlot1subframe  = D_NSLT1SF;
+    int32_t     NSym1slot       = D_NSYM1SLT; // Symbol per 1slot
+    int32_t     NSym1subframe   = D_NSYM1SF;  // Symbol per 1subframe
+    int32_t     aa, symNo, slotNo, sym, k;
+    
+    
+    for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {  // Antenna
+        for (symNo=0; symNo<NSym1subframe; symNo++) {   // Symbol
+            slotNo = symNo / NSym1slot;
+            sym = symNo % NSym1slot;
+            
+            n_cell_cs_div64 = (int32_t)(ncs_cell[2*subframe+slotNo][sym]/64.0);
+            n_cell_cs_modNSC_RB = ncs_cell[2*subframe+slotNo][sym] % 12;
+            
+            // for canceling e^(j*PI|_n_cs^cell(ns,l)/64_|/2).
+            calctmp_beta[0] = RotTBL_re[(n_cell_cs_div64)&0x3];
+            calctmp_beta[1] = RotTBL_im[(n_cell_cs_div64)&0x3];
+            
+            for (k=0; k<12; k++) {  // Sub Carrier
+                
+                // for canceling being cyclically shifted"(i+n_cs^cell(ns,l))".
+                // e^((j*2PI(n_cs^cell(ns,l) mod N_SC)/N_SC)*k).
+                calctmp_alphak[0] = alphaTBL_re[((n_cell_cs_modNSC_RB)*k)%12];
+                calctmp_alphak[1] = alphaTBL_im[((n_cell_cs_modNSC_RB)*k)%12];
+                
+                // e^(-alphar*k)*r_l,m,n,k
+                calctmp_SCDeMapData_alphak[0] = (((int32_t)SubCarrierDeMapData[aa][symNo][k][0] * calctmp_alphak[0] + (int32_t)SubCarrierDeMapData[aa][symNo][k][1] * calctmp_alphak[1])>>15);
+                calctmp_SCDeMapData_alphak[1] = (((int32_t)SubCarrierDeMapData[aa][symNo][k][1] * calctmp_alphak[0] - (int32_t)SubCarrierDeMapData[aa][symNo][k][0] * calctmp_alphak[1])>>15);
+                
+                // (e^(-alphar*k)*r_l,m,n,k) * e^(-beta)
+                CshData_fmt3[aa][symNo][k][0] = (((int32_t)calctmp_SCDeMapData_alphak[0] * calctmp_beta[0] + (int32_t)calctmp_SCDeMapData_alphak[1] * calctmp_beta[1])>>15);
+                CshData_fmt3[aa][symNo][k][1] = (((int32_t)calctmp_SCDeMapData_alphak[1] * calctmp_beta[0] - (int32_t)calctmp_SCDeMapData_alphak[0] * calctmp_beta[1])>>15);
+            }
+        }
+    }
+    return 0;
+}
+
+#define MAXROW_TBL_SF5_OS_IDX    (5)    // Orthogonal sequence index
+const int16_t TBL_3_SF5_GEN_N_DASH_NS[MAXROW_TBL_SF5_OS_IDX] = {0,3,6,8,10};
+
+#define MAXROW_TBL_SF4_OS_IDX    (4)    // Orthogonal sequence index
+const int16_t TBL_3_SF4_GEN_N_DASH_NS[MAXROW_TBL_SF4_OS_IDX] = {0,3,6,9};
+
+/* Channel estimation */
+uint16_t pucchfmt3_ChannelEstimation( int16_t SubCarrierDeMapData[NB_ANTENNAS_RX][14][12][2],
+                                      double delta_theta[NB_ANTENNAS_RX][12],
+                                      int16_t ChestValue[NB_ANTENNAS_RX][2][12][2],
+                                      int16_t *Interpw,
+                                      uint8_t subframe,
+                                      uint8_t shortened_format,
+                                      LTE_DL_FRAME_PARMS *frame_parms,
+                                      uint16_t n3_pucch,
+                                      uint16_t n3_pucch_array[NUMBER_OF_UE_MAX],
+                                      uint8_t ncs_cell[20][7] )
+{
+    uint32_t        aa, symNo, k, slotNo, sym, i, j;
+    int16_t         np, np_n, ip_ind;
+    //int16_t         npucch_sf;
+    int16_t         calctmp[2];
+    int16_t         BsCshData[NB_ANTENNAS_RX][D_NSYM1SF][D_NSC1RB][2];
+    //int16_t         delta_theta_calctmp[NB_ANTENNAS_RX][4][D_NSC1RB][2], delta_theta_comp[NB_ANTENNAS_RX][D_NSC1RB][2];
+    int16_t         delta_theta_comp[NB_ANTENNAS_RX][D_NSC1RB][2];
+    int16_t         CsData_allavg[NB_ANTENNAS_RX][14][2];
+    int16_t         CsData_temp[NB_ANTENNAS_RX][D_NSYM1SF][D_NSC1RB][2];
+    int32_t         IP_CsData_allsfavg[NB_ANTENNAS_RX][14][4][2];
+    int32_t         IP_allavg[D_NPUCCH_SF5];
+    //int16_t         temp_ch[2];
+	int16_t         m[NUMBER_OF_UE_MAX], m_self, same_m_number;
+	uint16_t        n3_pucch_sameRB[NUMBER_OF_UE_MAX];
+	int16_t         n_oc0[NUMBER_OF_UE_MAX];
+	int16_t         n_oc1[NUMBER_OF_UE_MAX];
+	int16_t         np_n_array[2][NUMBER_OF_UE_MAX]; //Cyclic shift
+	uint8_t N_PUCCH_SF0 = 5;
+	uint8_t N_PUCCH_SF1 = (shortened_format==0)? 5:4;
+    
+    uint32_t u0 = (frame_parms->Nid_cell + frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[subframe<<1]) % 30;
+    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)];
+    
+    uint32_t u=u0;
+    uint32_t v=v0;
+    
+    //double d_theta[32]={0.0};
+    //int32_t temp_theta[32][2]={0};
+    
+    for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
+        for (symNo=0; symNo<D_NSYM1SF; symNo++){
+            for(ip_ind=0; ip_ind<D_NPUCCH_SF5-1; ip_ind++) {
+                IP_CsData_allsfavg[aa][symNo][ip_ind][0] = 0;
+                IP_CsData_allsfavg[aa][symNo][ip_ind][1] = 0;
+            }
+        }
+    }
+	
+	// compute m[], m_self
+	for(i=0; i<NUMBER_OF_UE_MAX; i++) {
+		m[i] = n3_pucch_array[i] / N_PUCCH_SF0; // N_PUCCH_SF0 = 5
+		if(n3_pucch_array[i] == n3_pucch) {
+			m_self = i;
+		}
+	}
+	
+	for(i=0; i<NUMBER_OF_UE_MAX; i++) {
+		//printf("n3_pucch_array[%d]=%d, m[%d]=%d \n", i, n3_pucch_array[i], i, m[i]);
+	}
+	//printf("m_self=%d \n", m_self);
+	
+	// compute n3_pucch_sameRB[] // Not 4 not be equally divided
+	for(i=0, same_m_number=0; i<NUMBER_OF_UE_MAX; i++) {
+		if(m[i] == m[m_self]) {
+			n3_pucch_sameRB[same_m_number] = n3_pucch_array[i];
+			same_m_number++;
+		}
+	}
+	//printf("same_m_number = %d \n", same_m_number);
+	for(i=0; i<same_m_number; i++) {
+		//printf("n3_pucch_sameRB[%d]=%d \n", i, n3_pucch_sameRB[i]);
+	}
+	
+	// compute n_oc1[], n_oc0[]
+	for(i=0; i<same_m_number; i++) {
+		n_oc0[i] = n3_pucch_sameRB[i] % N_PUCCH_SF1; //N_PUCCH_SF1 = (shortened_format==0)? 5:4;
+		if (N_PUCCH_SF1 == 5) {
+			n_oc1[i] = (3 * n_oc0[i]) % N_PUCCH_SF1;
+		} else {
+			n_oc1[i] = n_oc0[i] % N_PUCCH_SF1;
+		}
+	}
+	for(i=0; i<same_m_number; i++) {
+		//printf("n_oc0[%d]=%d, n_oc1[%d]=%d \n", i, n_oc0[i], i, n_oc1[i]);
+	}
+	
+	
+	// np_n_array[][]
+	for(i=0; i<same_m_number; i++) {
+		if (N_PUCCH_SF1 == 5) {
+			np_n_array[0][i] = TBL_3_SF5_GEN_N_DASH_NS[n_oc0[i]]; //slot0
+			np_n_array[1][i] = TBL_3_SF5_GEN_N_DASH_NS[n_oc1[i]]; //slot1
+		} else {
+			np_n_array[0][i] = TBL_3_SF4_GEN_N_DASH_NS[n_oc0[i]];
+			np_n_array[1][i] = TBL_3_SF4_GEN_N_DASH_NS[n_oc1[i]];
+		}
+	}
+	for(i=0; i<same_m_number; i++) {
+		//printf("np_n_array[0][%d]=%d ,np_n_array[1][%d]=%d \n", i, np_n_array[0][i], i, np_n_array[1][i]);
+	}
+    
+    for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
+        for (symNo=0; symNo<D_NSYM1SF; symNo++){ // #define D_NSYM1SF       2*7
+            slotNo = symNo / D_NSYM1SLT;
+            sym = symNo % D_NSYM1SLT;
+            
+            for (k=0; k<D_NSC1RB; k++) { // #define D_NSC1RB        12
+                
+                // remove Base Sequence (c_r^*)*(r_l,m,m,n,k) = BsCshData
+                BsCshData[aa][symNo][k][0] = (((int32_t)SubCarrierDeMapData[aa][symNo][k][0] * ul_ref_sigs[u][v][0][k<<1] + (int32_t)SubCarrierDeMapData[aa][symNo][k][1] * ul_ref_sigs[u][v][0][1+(k<<1)])>>15);
+                BsCshData[aa][symNo][k][1] = (((int32_t)SubCarrierDeMapData[aa][symNo][k][1] * ul_ref_sigs[u][v][0][k<<1] - (int32_t)SubCarrierDeMapData[aa][symNo][k][0] * ul_ref_sigs[u][v][0][1+(k<<1)])>>15);
+                
+                if(shortened_format == 1) {
+                    if (symNo < D_NSYM1SLT) { 
+                        np = n3_pucch % D_NPUCCH_SF4;		// np = n_oc
+                        np_n = TBL_3_SF4_GEN_N_DASH_NS[np]; //
+                    } else {
+                        np = n3_pucch % D_NPUCCH_SF4;		//
+                        np_n = TBL_3_SF4_GEN_N_DASH_NS[np]; //
+                    }
+                    //npucch_sf = D_NPUCCH_SF4;// = 4
+                } else {
+                    if (symNo < D_NSYM1SLT) {
+                        np = n3_pucch % D_NPUCCH_SF5;
+                        np_n = TBL_3_SF5_GEN_N_DASH_NS[np];
+                    } else {
+                        np = (3 * n3_pucch) % D_NPUCCH_SF5;
+                        np_n = TBL_3_SF5_GEN_N_DASH_NS[np];
+                    }
+                    //npucch_sf = D_NPUCCH_SF5;// = 5
+                }
+                // cyclic shift e^(-j * beta_n * k)
+                calctmp[0] = alphaTBL_re[(((ncs_cell[2*subframe+slotNo][sym] + np_n)%D_NSC1RB)*k)%12];
+                calctmp[1] = alphaTBL_im[(((ncs_cell[2*subframe+slotNo][sym] + np_n)%D_NSC1RB)*k)%12];
+                
+                // Channel Estimation 1A, g'(n_cs)_l,m,n
+            	// CsData_temp = g_l,m,n,k
+                // remove cyclic shift BsCshData * e^(-j * beta_n * k)
+                CsData_temp[aa][symNo][k][0]=((((int32_t)BsCshData[aa][symNo][k][0] * calctmp[0] + (int32_t)BsCshData[aa][symNo][k][1] * calctmp[1])/ D_NSC1RB)>>15);
+                CsData_temp[aa][symNo][k][1]=((((int32_t)BsCshData[aa][symNo][k][1] * calctmp[0] - (int32_t)BsCshData[aa][symNo][k][0] * calctmp[1])/ D_NSC1RB)>>15);
+                
+            	// Interference power for Channel Estimation 1A, No use Cyclic Shift g'(n_cs)_l,m,n
+            	// Calculated by the cyclic shift that is not used  S(ncs)_est
+            	ip_ind = 0;
+	        	for(i=0; i<N_PUCCH_SF1; i++) {
+					for(j=0; j<same_m_number; j++) {	//np_n_array Loop
+						if(shortened_format == 1) {
+							if(symNo < D_NSYM1SLT) { // if SF==1 slot0
+								if(TBL_3_SF4_GEN_N_DASH_NS[i] == np_n_array[0][j]) {
+									break;
+								}
+            				} else { // if SF==1 slot1
+								if(TBL_3_SF4_GEN_N_DASH_NS[i] == np_n_array[1][j]) {
+									break;
+								}
+            				}
+						} else {
+							if(symNo < D_NSYM1SLT) { // if SF==0 slot0
+								if(TBL_3_SF5_GEN_N_DASH_NS[i] == np_n_array[0][j]) {
+									break;
+								}
+            				} else { // if SF==0 slot1
+								if(TBL_3_SF5_GEN_N_DASH_NS[i] == np_n_array[1][j]) {
+									break;
+								}
+            				}
+						}
+						if(j == same_m_number - 1) { //when even once it has not been used
+							if(shortened_format == 1) {
+								calctmp[0] = alphaTBL_re[(((ncs_cell[2*subframe+slotNo][sym] + TBL_3_SF4_GEN_N_DASH_NS[i])%D_NSC1RB)*k)%12]; //D_NSC1RB =12
+		                        calctmp[1] = alphaTBL_im[(((ncs_cell[2*subframe+slotNo][sym] + TBL_3_SF4_GEN_N_DASH_NS[i])%D_NSC1RB)*k)%12];
+							} else {
+								calctmp[0] = alphaTBL_re[(((ncs_cell[2*subframe+slotNo][sym] + TBL_3_SF5_GEN_N_DASH_NS[i])%D_NSC1RB)*k)%12];
+		                        calctmp[1] = alphaTBL_im[(((ncs_cell[2*subframe+slotNo][sym] + TBL_3_SF5_GEN_N_DASH_NS[i])%D_NSC1RB)*k)%12];
+							}
+							// IP_CsData_allsfavg = g'(n_cs)_l,m,n
+	                        IP_CsData_allsfavg[aa][symNo][ip_ind][0] += ((((int32_t)BsCshData[aa][symNo][k][0] * calctmp[0] + (int32_t)BsCshData[aa][symNo][k][1] * calctmp[1]))>>15);
+	                        IP_CsData_allsfavg[aa][symNo][ip_ind][1] += ((((int32_t)BsCshData[aa][symNo][k][1] * calctmp[0] - (int32_t)BsCshData[aa][symNo][k][0] * calctmp[1]))>>15);
+							if((symNo == 1 || symNo == 5 || symNo == 8 || symNo == 12)) {
+							}
+	                        ip_ind++;
+		        		}
+					}
+	        	}
+            }
+            if(symNo > D_NSYM1SLT-1) {
+                u=u1;
+                v=v1;
+            }
+        }
+    }
+    
+    for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
+        for (symNo=0; symNo<D_NSYM1SF; symNo++){
+            CsData_allavg[aa][symNo][0] = 0;
+            CsData_allavg[aa][symNo][1] = 0;
+            for (k=0; k<D_NSC1RB; k++) {
+              CsData_allavg[aa][symNo][0] += (int16_t)((double)CsData_temp[aa][symNo][k][0]);
+              CsData_allavg[aa][symNo][1] += (int16_t)((double)CsData_temp[aa][symNo][k][1]);
+            }
+        }
+    }
+    
+    // Frequency deviation estimation
+    for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
+        for (k=0; k<12; k++) {
+            delta_theta_comp[aa][k][0] = 0;
+            delta_theta_comp[aa][k][1] = 0;
+            
+            delta_theta_comp[aa][k][0] += (((int32_t)CsData_temp[aa][1][k][0] * CsData_temp[aa][5][k][0] + (int32_t)((CsData_temp[aa][1][k][1])*CsData_temp[aa][5][k][1]))>>8);
+            delta_theta_comp[aa][k][1] += (((int32_t)CsData_temp[aa][1][k][0]*CsData_temp[aa][5][k][1] - (int32_t)((CsData_temp[aa][1][k][1])*CsData_temp[aa][5][k][0]) )>>8);
+            
+            delta_theta_comp[aa][k][0] += (((int32_t)CsData_temp[aa][8][k][0] * CsData_temp[aa][12][k][0] + (int32_t)((CsData_temp[aa][8][k][1])*CsData_temp[aa][12][k][1]))>>8);
+            delta_theta_comp[aa][k][1] += (((int32_t)CsData_temp[aa][8][k][0]*CsData_temp[aa][12][k][1] - (int32_t)((CsData_temp[aa][8][k][1])*CsData_temp[aa][12][k][0]))>>8);
+            
+            delta_theta[aa][k] = atan2((double)delta_theta_comp[aa][k][1], (double)delta_theta_comp[aa][k][0]) / 4.0;
+        }
+    }
+    
+    for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
+        for (k=0; k<D_NSC1RB; k++) {
+            ChestValue[aa][0][k][0] = (int16_t)((CsData_allavg[aa][1][0] + (int16_t)(((double)CsData_allavg[aa][5][0] * cos(delta_theta[aa][k]*4)) + ((double)CsData_allavg[aa][5][1] * sin(delta_theta[aa][k]*4)))) /(2*D_NSC1RB)) ;
+            ChestValue[aa][0][k][1] = (int16_t)((CsData_allavg[aa][1][1] + (int16_t)(((double)CsData_allavg[aa][5][1] * cos(delta_theta[aa][k]*4)) - ((double)CsData_allavg[aa][5][0] * sin(delta_theta[aa][k]*4)))) /(2*D_NSC1RB)) ;
+            ChestValue[aa][1][k][0] = (int16_t)((CsData_allavg[aa][8][0] + (int16_t)(((double)CsData_allavg[aa][12][0] * cos(delta_theta[aa][k]*4)) + ((double)CsData_allavg[aa][12][1] * sin(delta_theta[aa][k]*4)))) /(2*D_NSC1RB)) ;
+            ChestValue[aa][1][k][1] = (int16_t)((CsData_allavg[aa][8][1] + (int16_t)(((double)CsData_allavg[aa][12][1] * cos(delta_theta[aa][k]*4)) - ((double)CsData_allavg[aa][12][0] * sin(delta_theta[aa][k]*4)))) /(2*D_NSC1RB)) ;
+        }
+    }
+    
+    *Interpw = 0;
+    for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
+    	if(ip_ind == 0) {//ip_ind= The total number of cyclic shift of non-use
+    		*Interpw = 1;
+    		break;
+    	}
+        for(i=0; i<ip_ind; i++) {
+            IP_allavg[i] = 0;
+            
+            IP_allavg[i] += (((int32_t)IP_CsData_allsfavg[aa][1][i][0] * IP_CsData_allsfavg[aa][1][i][0] + (int32_t)IP_CsData_allsfavg[aa][1][i][1]*IP_CsData_allsfavg[aa][1][i][1])>>8);
+        	IP_allavg[i] += (((int32_t)IP_CsData_allsfavg[aa][5][i][0] * IP_CsData_allsfavg[aa][5][i][0] + (int32_t)IP_CsData_allsfavg[aa][5][i][1]*IP_CsData_allsfavg[aa][5][i][1])>>8);
+            IP_allavg[i] += (((int32_t)IP_CsData_allsfavg[aa][8][i][0] * IP_CsData_allsfavg[aa][8][i][0] + (int32_t)IP_CsData_allsfavg[aa][8][i][1]*IP_CsData_allsfavg[aa][8][i][1])>>8);
+            IP_allavg[i] += (((int32_t)IP_CsData_allsfavg[aa][12][i][0] * IP_CsData_allsfavg[aa][12][i][0] + (int32_t)IP_CsData_allsfavg[aa][12][i][1]*IP_CsData_allsfavg[aa][12][i][1])>>8);
+        	*Interpw += IP_allavg[i]/(2*D_NSLT1SF*frame_parms->nb_antennas_rx*ip_ind*12);
+        }
+    }
+    return 0;
+}
+
+/* Channel Equalization */
+uint16_t pucchfmt3_Equalization( int16_t CshData_fmt3[NB_ANTENNAS_RX][14][12][2],
+                                 int16_t ChdetAfterValue_fmt3[NB_ANTENNAS_RX][14][12][2],
+                                 int16_t ChestValue[NB_ANTENNAS_RX][2][12][2],
+                                 LTE_DL_FRAME_PARMS *frame_parms)
+{
+    int16_t aa, sltNo, symNo, k;
+    
+    for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
+        sltNo = 0;
+        for (symNo=0; symNo<D_NSYM1SF; symNo++){
+            if(symNo >= D_NSYM1SLT) {
+                sltNo = 1;
+            }
+            for (k=0; k<D_NSC1RB; k++){
+                ChdetAfterValue_fmt3[aa][symNo][k][0] = (((int32_t)CshData_fmt3[aa][symNo][k][0] * ChestValue[aa][sltNo][k][0] + (int32_t)CshData_fmt3[aa][symNo][k][1] * ChestValue[aa][sltNo][k][1])>>8);
+                ChdetAfterValue_fmt3[aa][symNo][k][1] = (((int32_t)CshData_fmt3[aa][symNo][k][1] * ChestValue[aa][sltNo][k][0] - (int32_t)CshData_fmt3[aa][symNo][k][0] * ChestValue[aa][sltNo][k][1])>>8);
+            }
+        }
+    }
+    return 0;
+}
+
+/* Frequency deviation remove AFC */
+uint16_t pucchfmt3_FrqDevRemove( int16_t ChdetAfterValue_fmt3[NB_ANTENNAS_RX][14][12][2],
+                             double delta_theta[NB_ANTENNAS_RX][12],
+                             int16_t RemoveFrqDev_fmt3[NB_ANTENNAS_RX][2][5][12][2],
+                             LTE_DL_FRAME_PARMS *frame_parms )
+{
+    int16_t aa, sltNo, symNo1slt, k, n;
+    double calctmp[2];
+    
+    for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
+        for(sltNo = 0; sltNo<D_NSLT1SF; sltNo++)
+        {
+            n=0;
+            for (symNo1slt=0, n=0; symNo1slt<D_NSYM1SLT; symNo1slt++){
+                if(!((symNo1slt==1) || (symNo1slt==5))) {
+                    for (k=0; k<D_NSC1RB; k++) {
+                        calctmp[0] = cos(delta_theta[aa][k] * (n-1));
+                        calctmp[1] = sin(delta_theta[aa][k] * (n-1));
+                        
+                        RemoveFrqDev_fmt3[aa][sltNo][n][k][0] = (int16_t)((double)ChdetAfterValue_fmt3[aa][(sltNo*D_NSYM1SLT)+symNo1slt][k][0] * calctmp[0] 
+                                                                + (double)ChdetAfterValue_fmt3[aa][(sltNo*D_NSYM1SLT)+symNo1slt][k][1] * calctmp[1]);
+                        RemoveFrqDev_fmt3[aa][sltNo][n][k][1] = (int16_t)((double)ChdetAfterValue_fmt3[aa][(sltNo*D_NSYM1SLT)+symNo1slt][k][1] * calctmp[0] 
+                                                                - (double)ChdetAfterValue_fmt3[aa][(sltNo*D_NSYM1SLT)+symNo1slt][k][0] * calctmp[1]);
+                    }
+                    n++;
+                }
+            }
+        }
+    }
+    return 0;
+}
+
+//for opt.Lev.2 
+#define  MAXROW_TBL_SF5  5
+#define  MAXCLM_TBL_SF5  5
+const int16_t TBL_3_SF5[MAXROW_TBL_SF5][MAXCLM_TBL_SF5][2] = 
+                         {{ {32767,0}, {32767,0}, {32767,0}, {32767,0}, {32767,0}},
+                          { {32767,0}, {10126, 31163}, {-26509, 19260}, {-26509, -19260}, {10126, -31163}},
+                          { {32767,0}, {-26509, 19260}, {10126, -31163}, {10126, 31163}, {-26509, -19260}},
+                          { {32767,0}, {-26509, -19260}, {10126, 31163}, {10126, -31163}, {-26509, 19260}},
+                          { {32767,0}, {10126, -31163}, {-26509, -19260}, {-26509, 19260}, {10126, 31163}}};
+
+#define  MAXROW_TBL_SF4_fmt3 4
+#define  MAXCLM_TBL_SF4      4
+const int16_t TBL_3_SF4[MAXROW_TBL_SF4_fmt3][MAXCLM_TBL_SF4][2] = 
+                         {{ {32767,0}, {32767,0}, {32767,0}, {32767,0}},
+                          { {32767,0}, {-32767,0}, {32767,0}, {-32767,0}},
+                          { {32767,0}, {32767,0}, {-32767,0}, {-32767,0}},
+                          { {32767,0}, {-32767,0}, {-32767,0}, {32767,0}}};
+
+/* orthogonal sequence remove */
+uint16_t pucchfmt3_OrthSeqRemove( int16_t RemoveFrqDev_fmt3[NB_ANTENNAS_RX][2][5][12][2],
+                                  int16_t Fmt3xDataRmvOrth[NB_ANTENNAS_RX][2][5][12][2],
+                                  uint8_t shortened_format,
+                                  uint16_t n3_pucch,
+                                  LTE_DL_FRAME_PARMS *frame_parms )
+{
+    int16_t aa, sltNo, n, k;
+    int16_t Npucch_sf;
+    int16_t noc;
+    
+    for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
+        for (sltNo=0; sltNo<D_NSLT1SF; sltNo++){
+            if(shortened_format == 1) {
+                if(sltNo == 0) {
+                    noc = n3_pucch % D_NPUCCH_SF4;
+                    Npucch_sf = D_NPUCCH_SF5;
+                } else {
+                    noc = n3_pucch % D_NPUCCH_SF4;
+                    Npucch_sf = D_NPUCCH_SF4;
+                }
+            } else {
+                if(sltNo == 0) {
+                    noc = n3_pucch % D_NPUCCH_SF5;
+                    Npucch_sf = D_NPUCCH_SF5;
+                } else {
+                    noc = (3 * n3_pucch) % D_NPUCCH_SF5;
+                    Npucch_sf = D_NPUCCH_SF5;
+                }
+            }
+            for (n=0; n<Npucch_sf; n++){
+                for (k=0; k<D_NSC1RB; k++) {
+                    if ((sltNo == 1) && (shortened_format == 1)) {
+                      Fmt3xDataRmvOrth[aa][sltNo][n][k][0] = (((int32_t)RemoveFrqDev_fmt3[aa][sltNo][n][k][0] * TBL_3_SF4[noc][n][0] + (int32_t)RemoveFrqDev_fmt3[aa][sltNo][n][k][1] * TBL_3_SF4[noc][n][1])>>15);
+                      Fmt3xDataRmvOrth[aa][sltNo][n][k][1] = (((int32_t)RemoveFrqDev_fmt3[aa][sltNo][n][k][1] * TBL_3_SF4[noc][n][0] - (int32_t)RemoveFrqDev_fmt3[aa][sltNo][n][k][0] * TBL_3_SF4[noc][n][1])>>15);
+                    } else {
+                      Fmt3xDataRmvOrth[aa][sltNo][n][k][0] = (((int32_t)RemoveFrqDev_fmt3[aa][sltNo][n][k][0] * TBL_3_SF5[noc][n][0] + (int32_t)RemoveFrqDev_fmt3[aa][sltNo][n][k][1] * TBL_3_SF5[noc][n][1])>>15);
+                      Fmt3xDataRmvOrth[aa][sltNo][n][k][1] = (((int32_t)RemoveFrqDev_fmt3[aa][sltNo][n][k][1] * TBL_3_SF5[noc][n][0] - (int32_t)RemoveFrqDev_fmt3[aa][sltNo][n][k][0] * TBL_3_SF5[noc][n][1])>>15);
+                    }
+                }
+            }
+        }
+    }
+    return 0;
+}
+
+/* averaging antenna */
+uint16_t pucchfmt3_AvgAnt( int16_t Fmt3xDataRmvOrth[NB_ANTENNAS_RX][2][5][12][2],
+                           int16_t Fmt3xDataAvgAnt[2][5][12][2],
+                           uint8_t shortened_format,
+                           LTE_DL_FRAME_PARMS *frame_parms )
+{
+    int16_t aa, sltNo, n, k;
+    int16_t Npucch_sf;
+    
+    for (sltNo=0; sltNo<D_NSLT1SF; sltNo++){
+        if((sltNo == 1) && (shortened_format == 1)) {
+            Npucch_sf = D_NPUCCH_SF4;
+        } else {
+            Npucch_sf = D_NPUCCH_SF5;
+        }
+        for (n=0; n<Npucch_sf; n++){
+            for (k=0; k<D_NSC1RB; k++) {
+                Fmt3xDataAvgAnt[sltNo][n][k][0] = 0;
+                Fmt3xDataAvgAnt[sltNo][n][k][1] = 0;
+                for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
+                    Fmt3xDataAvgAnt[sltNo][n][k][0] += Fmt3xDataRmvOrth[aa][sltNo][n][k][0]  / frame_parms->nb_antennas_rx;
+                    Fmt3xDataAvgAnt[sltNo][n][k][1] += Fmt3xDataRmvOrth[aa][sltNo][n][k][1]  / frame_parms->nb_antennas_rx;
+                }
+            }
+        }
+    }
+    return 0;
+}
+
+/* averaging symbol */
+uint16_t pucchfmt3_AvgSym( int16_t Fmt3xDataAvgAnt[2][5][12][2],
+                           int16_t Fmt3xDataAvgSym[2][12][2],
+                           uint8_t shortened_format )
+{
+    int16_t sltNo, n, k;
+    int16_t Npucch_sf;
+    
+    for (sltNo=0; sltNo<D_NSLT1SF; sltNo++){
+        if((sltNo == 1) && (shortened_format == 1)) {
+            Npucch_sf = D_NPUCCH_SF4;
+        } else {
+            Npucch_sf = D_NPUCCH_SF5;
+        }
+        for (k=0; k<D_NSC1RB; k++) {
+            Fmt3xDataAvgSym[sltNo][k][0] = 0;
+            Fmt3xDataAvgSym[sltNo][k][1] = 0;
+            for (n=0; n<Npucch_sf; n++){
+                Fmt3xDataAvgSym[sltNo][k][0] += Fmt3xDataAvgAnt[sltNo][n][k][0] / Npucch_sf;
+                Fmt3xDataAvgSym[sltNo][k][1] += Fmt3xDataAvgAnt[sltNo][n][k][1] / Npucch_sf;
+            }
+        }
+    }
+    return 0;
+}
+
+/* iDFT */
+void pucchfmt3_IDft2( int16_t *x, int16_t *y )
+{
+  int16_t i, k;
+  int16_t tmp[2];
+  int16_t calctmp[D_NSC1RB*2]={0};
+  
+  for(k=0; k<D_NSC1RB; k++) {
+    for (i=0; i<D_NSC1RB; i++) {
+      tmp[0] = alphaTBL_re[((i*k)%12)];
+      tmp[1] = alphaTBL_im[((i*k)%12)];
+      
+      calctmp[2*k] += (((int32_t)x[2*i] * tmp[0] - (int32_t)x[2*i+1] * tmp[1])>>15);
+      calctmp[2*k+1] += (((int32_t)x[2*i+1] * tmp[0] + (int32_t)x[2*i] * tmp[1])>>15);
+    }
+    y[2*k] = (int16_t)( (double) calctmp[2*k] / sqrt(D_NSC1RB));
+    y[2*k+1] = (int16_t)((double) calctmp[2*k+1] / sqrt(D_NSC1RB));
+  }
+}
+
+/* descramble */
+uint16_t pucchfmt3_Descramble( int16_t IFFTOutData_Fmt3[2][12][2],
+                               int16_t b[48],
+                               uint8_t subframe,
+                               uint32_t Nid_cell,
+                               uint32_t rnti
+                              )
+{
+    int16_t m, k, c,i,j;
+    uint32_t cinit = 0;
+    uint32_t x1;
+    uint32_t s,s0,s1;
+    cinit = (subframe + 1) * ((2 * Nid_cell + 1)<<16) + rnti;
+    s0 = lte_gold_generic(&x1,&cinit,1);
+    s1 = lte_gold_generic(&x1,&cinit,0);
+    i=0;
+    for (m=0; m<D_NSLT1SF; m++){
+        for(k=0; k<D_NSC1RB; k++) {
+            s = (i<32)? s0:s1;
+            j = (i<32)? i:(i-32);
+            c=((s>>j)&1);
+            b[i] = (IFFTOutData_Fmt3[m][k][0] * (1 - 2*c));
+            i++;
+          
+            s = (i<32)? s0:s1;
+            j = (i<32)? i:(i-32);
+            c=((s>>j)&1);
+            b[i] = (IFFTOutData_Fmt3[m][k][1] * (1 - 2*c));
+            i++;
+        }
+    }
+    return 0;
+}
+
+int16_t pucchfmt3_Decode( int16_t b[48],
+                          uint8_t subframe,
+                          int16_t DTXthreshold,
+                          int16_t Interpw,
+                          uint8_t do_sr)
+{
+    int16_t c, i;
+    int32_t Rho_tmp;
+    int16_t c_max;
+    int32_t Rho_max;
+    int16_t bit_pattern;
+    
+    /* Is payload 6bit or 7bit? */
+    if( do_sr == 1 ) {
+        bit_pattern = 128;
+    } else {
+        bit_pattern = 64;
+    }
+    
+    c=0;
+    Rho_tmp = 0;
+    for (i=0;i<48;i++) {
+        Rho_tmp += b[i] * (1-2*chcod_tbl[c][i]);
+    }
+    c_max = c;
+    Rho_max = Rho_tmp;
+    
+    for(c=1; c<bit_pattern; c++) {
+        Rho_tmp = 0;
+        for (i=0;i<48;i++) {
+            Rho_tmp += b[i] * (1-2*chcod_tbl[c][i]);
+        }
+        if (Rho_tmp > Rho_max) {
+            c_max = c;
+            Rho_max = Rho_tmp;
+        }
+    }
+    if(Interpw<1){
+      Interpw=1;
+    }
+    if((Rho_max/Interpw) > DTXthreshold) {
+        // ***Log
+        return c_max;
+    } else {
+        // ***Log
+        return -1;
+    }
+}
+
+/* PUCCH format3 << */
+
 uint32_t rx_pucch(PHY_VARS_eNB *eNB,
 		  PUCCH_FMT_t fmt,
 		  uint8_t UE_id,
@@ -716,6 +1820,34 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
   uint32_t v1=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[1+(subframe<<1)];
   int chL;
 
+  /* PUCCH format3 >> */
+  uint16_t Ret = 0;
+  int16_t SubCarrierDeMapData[NB_ANTENNAS_RX][14][12][2];       //[Antenna][Symbol][Subcarrier][Complex]
+  int16_t CshData_fmt3[NB_ANTENNAS_RX][14][12][2];              //[Antenna][Symbol][Subcarrier][Complex]
+  double delta_theta[NB_ANTENNAS_RX][12];                      //[Antenna][Subcarrier][Complex]
+  int16_t ChestValue[NB_ANTENNAS_RX][2][12][2];                 //[Antenna][Slot][Subcarrier][Complex]
+  int16_t ChdetAfterValue_fmt3[NB_ANTENNAS_RX][14][12][2];      //[Antenna][Symbol][Subcarrier][Complex]
+  int16_t RemoveFrqDev_fmt3[NB_ANTENNAS_RX][2][5][12][2];       //[Antenna][Slot][PUCCH_Symbol][Subcarrier][Complex]
+  int16_t Fmt3xDataRmvOrth[NB_ANTENNAS_RX][2][5][12][2];        //[Antenna][Slot][PUCCH_Symbol][Subcarrier][Complex]
+  int16_t Fmt3xDataAvgAnt[2][5][12][2];                         //[Slot][PUCCH_Symbol][Subcarrier][Complex]
+  int16_t Fmt3xDataAvgSym[2][12][2];                            //[Slot][Subcarrier][Complex]
+  int16_t IFFTOutData_Fmt3[2][12][2];                           //[Slot][Subcarrier][Complex]
+  int16_t b[48];                                                //[bit]
+  //int16_t IP_CsData_allavg[NB_ANTENNAS_RX][12][4][2];           //[Antenna][Symbol][Nouse Cyclic Shift][Complex]
+  int16_t payload_entity = -1;
+  int16_t Interpw;
+  int16_t payload_max;
+  
+  // TODO
+  // When using PUCCH format3, it must be an argument of rx_pucch function
+  uint16_t n3_pucch = 20;
+  uint16_t n3_pucch_array[NUMBER_OF_UE_MAX]={1};
+  n3_pucch_array[0]=n3_pucch;
+  uint8_t do_sr = 1;
+  uint16_t crnti=0x1234;
+  int16_t DTXthreshold = 10;
+  /* PUCCH format3 << */
+
   if (first_call == 1) {
     for (i=0;i<10;i++) {
       for (j=0;j<NUMBER_OF_UE_MAX;j++) {
@@ -745,7 +1877,13 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
   }
   */  
 
-    
+  if(fmt!=pucch_format3) {  /* PUCCH format3 */
+  
+  // TODO
+  // "SR+ACK/NACK" length is only 7 bits.
+  // This restriction will be lifted in the future.
+  // "CQI/PMI/RI+ACK/NACK" will be supported in the future.
+
   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);
@@ -1293,6 +2431,83 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
   } else {
     LOG_E(PHY,"[eNB] PUCCH fmt2/2a/2b not supported\n");
   }
+  
+  /* PUCCH format3 >> */
+  } else {
+    /* SubCarrier Demap */
+    Ret = pucchfmt3_subCarrierDeMapping( eNB, SubCarrierDeMapData, n3_pucch );
+    if(Ret != 0) {
+        //***log pucchfmt3_subCarrierDeMapping Error!
+        return(-1);
+    }
+    
+    /* cyclic shift hopping remove */
+    Ret = pucchfmt3_Baseseq_csh_remove( SubCarrierDeMapData, CshData_fmt3, frame_parms, subframe, eNB->ncs_cell );
+    if(Ret != 0) {
+        //***log pucchfmt3_Baseseq_csh_remove Error!
+        return(-1);
+    }
+    
+    /* Channel Estimation */
+    Ret = pucchfmt3_ChannelEstimation( SubCarrierDeMapData, delta_theta, ChestValue, &Interpw, subframe, shortened_format, frame_parms, n3_pucch, n3_pucch_array, eNB->ncs_cell );
+    if(Ret != 0) {
+        //***log pucchfmt3_ChannelEstimation Error!
+        return(-1);
+    }
+    
+    /* Channel Equalization */
+    Ret = pucchfmt3_Equalization( CshData_fmt3, ChdetAfterValue_fmt3, ChestValue, frame_parms );
+    if(Ret != 0) {
+        //***log pucchfmt3_Equalization Error!
+        return(-1);
+    }
+    
+    /* Frequency deviation remove AFC */
+    Ret = pucchfmt3_FrqDevRemove( ChdetAfterValue_fmt3, delta_theta, RemoveFrqDev_fmt3, frame_parms );
+    if(Ret != 0) {
+        //***log pucchfmt3_FrqDevRemove Error!
+        return(-1);
+    }
+    
+    /* orthogonal sequence remove */
+    Ret = pucchfmt3_OrthSeqRemove( RemoveFrqDev_fmt3, Fmt3xDataRmvOrth, shortened_format, n3_pucch, frame_parms );
+    if(Ret != 0) {
+        //***log pucchfmt3_OrthSeqRemove Error!
+        return(-1);
+    }
+    
+    /* averaging antenna */
+    pucchfmt3_AvgAnt( Fmt3xDataRmvOrth, Fmt3xDataAvgAnt, shortened_format, frame_parms );
+    
+    /* averaging symbol */
+    pucchfmt3_AvgSym( Fmt3xDataAvgAnt, Fmt3xDataAvgSym, shortened_format );
+    
+    /* IDFT */
+    pucchfmt3_IDft2( (int16_t*)Fmt3xDataAvgSym[0], (int16_t*)IFFTOutData_Fmt3[0] );
+    pucchfmt3_IDft2( (int16_t*)Fmt3xDataAvgSym[1], (int16_t*)IFFTOutData_Fmt3[1] );
+    
+    /* descramble */
+    pucchfmt3_Descramble(IFFTOutData_Fmt3, b, subframe, frame_parms->Nid_cell, crnti);
+
+    /* Is payload 6bit or 7bit? */
+    if( do_sr == 1 ) {
+        payload_max = 7;
+    } else {
+        payload_max = 6;
+    }
+    
+    /* decode */
+    payload_entity = pucchfmt3_Decode( b, subframe, DTXthreshold, Interpw, do_sr );
+    if (payload_entity == -1) {
+        //***log pucchfmt3_Decode Error!
+        return(-1);
+    }
+    
+    for(i=0; i<payload_max; i++) {
+      *(payload+i) = (uint8_t)((payload_entity>>i) & 0x01);
+    }
+  }
+  /* PUCCH format3 << */
 
   return((int32_t)stat_max);
 
diff --git a/openair1/PHY/LTE_TRANSPORT/rar_tools.c b/openair1/PHY/LTE_TRANSPORT/rar_tools.c
index 2629c6ba7f2505c6944fa9b000e2a637b4ce4a48..2d29d8c13fc07c35e851a6f30004909ba182790e 100644
--- a/openair1/PHY/LTE_TRANSPORT/rar_tools.c
+++ b/openair1/PHY/LTE_TRANSPORT/rar_tools.c
@@ -238,7 +238,7 @@ int generate_ue_ulsch_params_from_rar(PHY_VARS_UE *ue,
 
 
 
-  ulsch->harq_processes[harq_pid]->TPC                                   = (rar[3]>>3)&7;//rar->TPC;
+  ulsch->harq_processes[harq_pid]->TPC                                   = (rar[3]>>2)&7;//rar->TPC;
 
   rballoc = (((uint16_t)(rar[1]&7))<<7)|(rar[2]>>1);
   cqireq=rar[3]&1;
@@ -258,7 +258,7 @@ int generate_ue_ulsch_params_from_rar(PHY_VARS_UE *ue,
 
   if (ulsch->harq_processes[harq_pid]->nb_rb > 4) {
     msg("rar_tools.c: unlikely rb count for RAR grant : nb_rb > 3\n");
-    return(-1);
+	// return(-1);
   }
 
   //  ulsch->harq_processes[harq_pid]->Ndi                                   = 1;
diff --git a/openair1/PHY/LTE_TRANSPORT/sss.c b/openair1/PHY/LTE_TRANSPORT/sss.c
index fc5e7f0d1bd7c995002c961983e63b4c6970f681..5eada8bc9c3eef2af838b2ae7901644d0a806d29 100644
--- a/openair1/PHY/LTE_TRANSPORT/sss.c
+++ b/openair1/PHY/LTE_TRANSPORT/sss.c
@@ -166,6 +166,7 @@ int _do_pss_sss_extract(PHY_VARS_UE *ue,
 
   int32_t **rxdataF;
 
+  //LOG_I(PHY,"do_pss_sss_extract subframe %d \n",subframe);
   for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
 
 	  if (frame_parms->frame_type == FDD) {
@@ -180,11 +181,26 @@ int _do_pss_sss_extract(PHY_VARS_UE *ue,
 	    pss_symb = 2;
 	    sss_symb = frame_parms->symbols_per_tti-1;
 
+	    if(subframe==5 || subframe==0)
+	    {
 	    rxdataF  =  ue->common_vars.common_vars_rx_data_per_thread[(subframe&0x1)].rxdataF;
 	    sss_rxF  =  &rxdataF[aarx][(rx_offset + (sss_symb*(frame_parms->ofdm_symbol_size)))];
 
 	    rxdataF  =  ue->common_vars.common_vars_rx_data_per_thread[((subframe+1)&0x1)].rxdataF;
 	    pss_rxF  =  &rxdataF[aarx][(rx_offset + (pss_symb*(frame_parms->ofdm_symbol_size)))];
+	    }
+	    else if(subframe==6 || subframe==1)
+	    {
+		    rxdataF  =  ue->common_vars.common_vars_rx_data_per_thread[(subframe&0x1)].rxdataF;
+		    pss_rxF  =  &rxdataF[aarx][(rx_offset + (pss_symb*(frame_parms->ofdm_symbol_size)))];
+
+		    rxdataF  =  ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)&0x1].rxdataF;
+		    sss_rxF  =  &rxdataF[aarx][(rx_offset + (sss_symb*(frame_parms->ofdm_symbol_size)))];
+	    }
+	    else
+	    {
+	    	AssertFatal(0,"");
+	    }
 
 	  }
     //printf("extract_rbs: symbol_mod=%d, rx_offset=%d, ch_offset=%d\n",symbol_mod,
@@ -204,11 +220,26 @@ int _do_pss_sss_extract(PHY_VARS_UE *ue,
         }
         else
         {
+        	if(subframe==5 || subframe==0)
+        	{
     	    rxdataF  =  ue->common_vars.common_vars_rx_data_per_thread[(subframe&0x1)].rxdataF;
     	    sss_rxF  =  &rxdataF[aarx][(1 + (sss_symb*(frame_parms->ofdm_symbol_size)))];
 
     	    rxdataF  =  ue->common_vars.common_vars_rx_data_per_thread[((subframe+1)&0x1)].rxdataF;
     	    pss_rxF  =  &rxdataF[aarx][(1 + (pss_symb*(frame_parms->ofdm_symbol_size)))];
+        	}
+    	    else if(subframe==6 || subframe==1)
+    	    {
+    		    rxdataF  =  ue->common_vars.common_vars_rx_data_per_thread[(subframe&0x1)].rxdataF;
+    		    pss_rxF  =  &rxdataF[aarx][(rx_offset + (pss_symb*(frame_parms->ofdm_symbol_size)))];
+
+    		    rxdataF  =  ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)&0x1].rxdataF;
+    		    sss_rxF  =  &rxdataF[aarx][(rx_offset + (sss_symb*(frame_parms->ofdm_symbol_size)))];
+    	    }
+    	    else
+    	    {
+    	    	AssertFatal(0,"");
+    	    }
         }
       }
 
@@ -237,18 +268,20 @@ int pss_sss_extract(PHY_VARS_UE *phy_vars_ue,
 }
 
 int pss_only_extract(PHY_VARS_UE *phy_vars_ue,
-                    int32_t pss_ext[4][72])
+                    int32_t pss_ext[4][72],
+                    uint8_t subframe)
 {
   static int32_t dummy[4][72];
-  return _do_pss_sss_extract(phy_vars_ue, pss_ext, dummy, 1 /* doPss */, 0 /* doSss */, 0);
+  return _do_pss_sss_extract(phy_vars_ue, pss_ext, dummy, 1 /* doPss */, 0 /* doSss */, subframe);
 }
 
 
 int sss_only_extract(PHY_VARS_UE *phy_vars_ue,
-                    int32_t sss_ext[4][72])
+                    int32_t sss_ext[4][72],
+                    uint8_t subframe)
 {
   static int32_t dummy[4][72];
-  return _do_pss_sss_extract(phy_vars_ue, dummy, sss_ext, 0 /* doPss */, 1 /* doSss */, 0);
+  return _do_pss_sss_extract(phy_vars_ue, dummy, sss_ext, 0 /* doPss */, 1 /* doSss */, subframe);
 }
 
 
diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c
index bd49fdacb06dc4c177a9182f6ee5d57759a49577..9ae1dc6603e985dbb5e9480301ac1557ad3be61d 100644
--- a/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c
+++ b/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c
@@ -242,7 +242,7 @@ uint32_t ulsch_encoding(uint8_t *a,
     return(-1);
   }
 
-  if (harq_pid > 7) {
+  if (harq_pid >= 8) {
     LOG_E(PHY,"Illegal harq_pid %d\n",harq_pid);
     return(-1);
   }
diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
index a26f3a876bd53be7a4db161878d735070490cf83..51a9d1e9469d8862088c2d17fb9fe32640d2e8a1 100644
--- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
+++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
@@ -2067,7 +2067,8 @@ uint32_t ulsch_decoding_emul(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc,
     if ((UE_index >= oai_emulation.info.first_ue_local) ||(UE_index <(oai_emulation.info.first_ue_local+oai_emulation.info.nb_ue_local))) {
       get_ack(&eNB->frame_parms,
               PHY_vars_UE_g[UE_id][CC_id]->dlsch[0][0][0]->harq_ack,
-              subframe,
+              proc->subframe_tx,
+              proc->subframe_rx,
               eNB->ulsch[UE_index]->harq_processes[harq_pid]->o_ACK,0);
     } else { // get remote UEs' ack
       eNB->ulsch[UE_index]->harq_processes[harq_pid]->o_ACK[0] = PHY_vars_UE_g[UE_id][CC_id]->ulsch[0]->o_ACK[0];
diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c b/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c
index a4bcd802f5c7551a646aa025fd559f1b8f6ec3d7..6dced43b5f65b951785e9224ba5da10ef10a8bfc 100644
--- a/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c
+++ b/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c
@@ -402,7 +402,7 @@ void ulsch_modulation(int32_t **txdataF,
   // x1 is set in lte_gold_generic
   x2 = (ulsch->rnti<<14) + (subframe<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1
 
-  if (harq_pid > 7) {
+  if (harq_pid>=8) {
     printf("ulsch_modulation.c: Illegal harq_pid %d\n",harq_pid);
     return;
   }
diff --git a/openair1/PHY/TOOLS/lte_dfts.c b/openair1/PHY/TOOLS/lte_dfts.c
index 1ba997af17fc247e950e4ee1bb9cd5183654adba..0aaea70d7d4a95f517e6d832f2f235dd23f2fb48 100644
--- a/openair1/PHY/TOOLS/lte_dfts.c
+++ b/openair1/PHY/TOOLS/lte_dfts.c
@@ -2510,6 +2510,8 @@ const static int16_t tw64[96] __attribute__((aligned(32))) = {
 -30273,12539,-25330,20787,-18205,27244,-9512,31356
                                                 };
 
+#if 0
+/* this is defined but not used, let's comment */
 const static 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,
@@ -2524,6 +2526,7 @@ const static int16_t tw64rep[192] __attribute__((aligned(32))) = {
 -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
                                                 };
+#endif
 
 const static int16_t tw64a[96] __attribute__((aligned(32))) = { 
 32767,0,32609,3212,32137,6393,31356,9512,
@@ -2539,6 +2542,8 @@ const static int16_t tw64a[96] __attribute__((aligned(32))) = {
 -23170,23170,-28898,15447,-32138,6393,-32610,-3211,
 -30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356
                                                  };
+#if 0
+/* this is defined but not used, let's comment */
 const static 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,
@@ -2553,6 +2558,7 @@ const static int16_t tw64arep[192] __attribute__((aligned(32))) = {
 -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
                                                  };
+#endif
 
 const static int16_t tw64b[96] __attribute__((aligned(32))) = { 
 0,32767,-3212,32609,-6393,32137,-9512,31356,
@@ -2569,6 +2575,8 @@ const static int16_t tw64b[96] __attribute__((aligned(32))) = {
 12539,-30273,20787,-25330,27244,-18205,31356,-9512
                                                  };
 
+#if 0
+/* this is defined but not used, let's comment */
 const static 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,
@@ -2583,6 +2591,7 @@ const static int16_t tw64brep[192] __attribute__((aligned(32))) = {
 -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
                                                  };
+#endif
 
 const static int16_t tw64c[96] __attribute__((aligned(32))) = { 
 0,32767,3212,32609,6393,32137,9512,31356,
@@ -2599,6 +2608,8 @@ const static int16_t tw64c[96] __attribute__((aligned(32))) = {
 -12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512
                                                  };
 
+#if 0
+/* this is defined but not used, let's comment */
 const static 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,
@@ -2613,6 +2624,7 @@ const static int16_t tw64crep[192] __attribute__((aligned(32))) = {
 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
                                                  };
+#endif
 
 
 #if defined(__x86_64__) || defined(__i386__)
diff --git a/openair1/PHY/TOOLS/lte_phy_scope.c b/openair1/PHY/TOOLS/lte_phy_scope.c
index dd057f997513a2cc6a4bc45fe4545689dc5068a6..cea702ef7804d69da774a5eca5e9027df3a05b8f 100644
--- a/openair1/PHY/TOOLS/lte_phy_scope.c
+++ b/openair1/PHY/TOOLS/lte_phy_scope.c
@@ -493,7 +493,8 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
   int16_t **chest_f;
   int16_t *pdsch_llr;
   int16_t *pdsch_comp;
-  int8_t *pdcch_llr;
+  int16_t *pdsch_mag;
+  int8_t  *pdcch_llr;
   int16_t *pdcch_comp;
   int8_t *pbch_llr;
   int16_t *pbch_comp;
@@ -571,6 +572,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
   pdsch_llr = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->llr[0]; // stream 0
   //    pdsch_llr = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars_SI[eNB_id]->llr[0]; // stream 0
   pdsch_comp = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp0[0];
+  pdsch_mag = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_mag0[0];
 
   // Received signal in time domain of receive antenna 0
   if (rxsig_t != NULL) {
@@ -752,8 +754,9 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
 
     for (k=0; k<frame_parms->symbols_per_tti; k++) {
       for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
-        I[ind] = pdsch_comp[(2*frame_parms->N_RB_DL*12*k)+4*i];
-        Q[ind] = pdsch_comp[(2*frame_parms->N_RB_DL*12*k)+4*i+1];
+    	int j = (2*frame_parms->N_RB_DL*12*k)+4*i;
+        I[ind] = (pdsch_mag[j  ]!=0? 1.0/pdsch_mag[j  ]: 0.0) * pdsch_comp[j  ]*1.0;
+        Q[ind] = (pdsch_mag[j+1]!=0? 1.0/pdsch_mag[j+1]: 0.0) * pdsch_comp[j+1]*1.0;
         ind++;
       }
     }
diff --git a/openair1/PHY/TOOLS/lte_phy_scope_tm4.c b/openair1/PHY/TOOLS/lte_phy_scope_tm4.c
old mode 100755
new mode 100644
diff --git a/openair1/PHY/impl_defs_lte.h b/openair1/PHY/impl_defs_lte.h
old mode 100755
new mode 100644
diff --git a/openair1/README.TXT b/openair1/README.TXT
index 34d3144105dfe8eafef6370d68be93a6f4d97c7f..23c86e888e47f697adb8d1509630d5958e5be693 100644
--- a/openair1/README.TXT
+++ b/openair1/README.TXT
@@ -1,40 +1,5 @@
 This folder contains the software for the device driver of CBMIMO1 and the physical layer signal processing.
 
-
-|-- ARCH   	    	   // contains drivers for hardware
-|   |-- CBMIMO1		   // contains everything related to CBMIMO1
-|   |   `-- DEVICE_DRIVER  
-|   |       |-- Makefile             // main Makefile used to compile the driver; usually invoked from the top level Makefile
-|   |       |-- cbmimo1_device.c     // main file for device driver (initializes the card, bigphys, main variables)
-|   |       |-- cbmimo1_device.h
-|   |       |-- cbmimo1_dma.c
-|   |       |-- cbmimo1_fileops.c    // file that processes IOCTL commands coming from the userspace control utility (USERSPACE_TOOLS/OPENAIR_RF/)
-|   |       |-- cbmimo1_generate_fs4.c   // generates test signals (DEBUGGING)
-|   |       |-- cbmimo1_generate_ofdm.c  // generates test signals (DEBUGGING)
-|   |       |-- cbmimo1_get_frame.c      // code to grab a frame from the card
-|   |       |-- cbmimo1_init.c		 // code to set up the registers of the card
-|   |       |-- cbmimo1_pci.h
-|   |       |-- cbmimo1_proc.c           // generates the proc entries /proc/openair1/bch_stats and /proc/openair1/openair1_state 
-|   |       |-- cbmimo1_rf_cntl.c	 // controls the RF chipset on the card
-|   |       |-- cbmimo1_test.c
-|   |       |-- from_grlib_softconfig.h
-|   |       |-- from_grlib_softregs.h
-|   |       |-- defs.h
-|   |       |-- extern.h
-|   |       `-- vars.h
-|   |-- COMMON		   // common for all hardware (mainly bigphys)
-|   |-- EXPRESS_MIMO	   // contains everything related to EXPRESS MIMO
-|-- DOCS		   // Documentation
-|   |-- DOXYGEN		   // Automaitcally generated DOXYGEN documentation in latex and html
-|   `-- PAPERS		   // papers related to openair1
-|-- EMOS		   // this contains everything related to Eurecom MIMO Openair Sounder (EMOS)
-|   |-- DOC		   
-|   |-- DUMP		   // program that dumps channel estimate to disk using a FIFO
-|   |-- GUI		   
-|   |-- MATLAB		   // Matlab code to process measurements
-|   |-- SIM		   // EMOS simulator (for DEBUGGING)
-|   `-- UTIL
-|-- MAC_INTERFACE	   // interface with MAC layer (in openair2)
 |-- PHY			   // contains all signal processing related to physical layer (used in real-time AND simulation)
 
 General remarks: every directory contains at least defs.h (for declaration of structure and functions), vars.h (for definitions of variables), and extern.h (variables are defined only once in cbmimo1_device.c (for real-time HW operation) or a top-level simulation (in SIMULATION/xxx), if variables are needed in another file, use extern.h)
@@ -57,17 +22,19 @@ General remarks: every directory contains at least defs.h (for declaration of st
 |   |-- spec_defs_top.h
 |   |-- types.h
 |   `-- vars.h		  
-|-- SCHED		  // schedules the different PHY functions according to the nodes role (CH=BS, MR=UE)
+|-- SCHED		  // schedules the different PHY functions according to the nodes role 
 |   |-- defs.h
 |   |-- extern.h
-|   |-- phy_procedures.c         // non-LTE PHY procedures this is used in synchronized mode to schedule the slot processing
 |   |-- phy_procedures_emos.c    // non-LTE PHY procedures for EMOS
 |   |-- phy_procedures_emos.h
 |   |-- phy_procedures_lte_eNb.c // LTE PHY procedures for eNB (from 36-213) 
 |   |-- phy_procedures_lte_ue.c  // LTE PHY procedures for UE (from 36-213)
+|   |-- phy_procedures_lte_common.c  // LTE PHY procedures common for UE and eNB (from 36-213)
+|   |-- phy_mac_stub.c  //MAC stub that generates channels when used in phy-test-mode
+|   |-- pucch_pc.c // power control for PUCCH
+|   |-- pusch_pc.c // power control for PUSCH
+|   |-- srs_pc.c // power control for SRS
 |   |-- rt_compat.h
-|   |-- sched.c		  // contains the top level scheduler (only for CBMIMO1 HW)
-|   |-- sched_lte.c	  // same as sched.c for LTE (only for CBMIMO1 HW)
 |   `-- vars.h
 |-- SIMULATION		 // contains simulation routines to test PHY
 |   |-- LTE_PHY          // LTE simulation testbenches for unitary simulation of transport/physical channels
@@ -76,17 +43,9 @@ General remarks: every directory contains at least defs.h (for declaration of st
 |   |   |-- dlsim.c         // PDSCH simulation testbench
 |   |   |-- ulsim.c         // PUSCH simulation testbench
 |   |   |-- pucchsim.c      // PUCCH simulation testbench
-|   |-- LTE_PHY_L2       // LTE simulation testbench for full system simulation (PHY,MAC,RLC,RRC,PDCP)
-|   `-- TOOLS
 |   |-- RF
-|-- USERSPACE_TOOLS     // tools that run in userspace (not kernel)
-|   |-- OCTAVE
-|   |   |-- AGILE_RF_TOOLS // octave tools to test agile RF  
-|   |   |-- CBMIMO1_TOOLS // octave interface for CBMIMO1
-|   |   |-- GPIB       // octave tools to control signal generator (used for calibration)
-|   |   `-- PHY_SIM    // octave implementation of sync
-|   |-- OPENAIR_RF     // tool to interface with the device driver using IOCTL
-|   |-- SCOPE	       // tool to visualize data from PHY (channel estimates, IQ plots, etc.). Communicates with kernel module using shared memory.
-|   `-- SENSING        // tools related to sensing
+|   |-- ETH_TRANSPORT
+|   `-- TOOLS
+
 
 
diff --git a/openair1/SCHED/defs.h b/openair1/SCHED/defs.h
index a6223bef5b6f4ec508c39daa8584bce30c26d4cf..10d9d69c5219287de740513132754ca1d77cf10d 100644
--- a/openair1/SCHED/defs.h
+++ b/openair1/SCHED/defs.h
@@ -212,6 +212,7 @@ void prach_procedures(PHY_VARS_eNB *eNB);
 
 lte_subframe_t subframe_select(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
 
+
 /*! \brief Function to compute which type of DCIs to detect in the given subframe
   @param frame_parms Pointer to DL frame parameter descriptor
   @param subframe Subframe index
@@ -305,7 +306,7 @@ uint8_t pdcch_alloc2ul_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n);
   @param o_ACK Pointer to ACK/NAK payload for PUCCH/PUSCH
   @returns status indicator for PUCCH/PUSCH transmission
 */
-uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,harq_status_t *harq_ack,uint8_t subframe,uint8_t *o_ACK, uint8_t cw_idx);
+uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,harq_status_t *harq_ack,uint8_t subframe_tx,uint8_t subframe_rx,uint8_t *o_ACK, uint8_t cw_idx);
 
 /*! \brief Reset ACK/NACK information
   @param frame_parms Pointer to DL frame parameter descriptor
@@ -316,8 +317,10 @@ uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,harq_status_t *harq_ack,uint8_t
 */
 uint8_t reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
                 harq_status_t *harq_ack,
-                unsigned char subframe,
+                unsigned char subframe_tx,
+                unsigned char subframe_rx,
                 unsigned char *o_ACK,
+                uint8_t *pN_bundled,
                 uint8_t cw_idx);
 
 /*! \brief Compute UL ACK subframe from DL subframe. This is used to retrieve corresponding DLSCH HARQ pid at eNB upon reception of ACK/NAK information on PUCCH/PUSCH.  Derived from Table 10.1-1 in 36.213 (p. 69 in version 8.6)
diff --git a/openair1/SCHED/phy_mac_stub.c b/openair1/SCHED/phy_mac_stub.c
index 04a98f69c1fcbf7166d04077eb4f570265cb8d31..f750253c6787a329aee900c8171778beb45c37a6 100644
--- a/openair1/SCHED/phy_mac_stub.c
+++ b/openair1/SCHED/phy_mac_stub.c
@@ -70,7 +70,7 @@ void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
   uint32_t bcch_pdu;
   uint64_t dlsch_pdu;
 
-  LOG_I(PHY,"frame %d, subframe %d, transmission_mode %d\n",proc->frame_tx,proc->subframe_tx,transmission_mode);
+  LOG_D(PHY,"frame %d, subframe %d, transmission_mode %d\n",proc->frame_tx,proc->subframe_tx,transmission_mode);
 
   DCI_pdu->Num_common_dci = 0;
   DCI_pdu->Num_ue_spec_dci=0;
@@ -380,25 +380,25 @@ void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
         if (eNB->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);
+          harq_pid_value = (  ((proc->frame_tx * 10) + subframe) % 8 );
+
+          if (!(subframe&1)) // even subframe
+            dci_ndi_toggle_tmp = &(dci_ndi_toggle_even[harq_pid_value]);
+          else // odd subframe
+            dci_ndi_toggle_tmp = &(dci_ndi_toggle_odd[harq_pid_value]);
+
+          ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rballoc          = 0x1ffffff; //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)->harq_pid         = harq_pid_value;
           ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->mcs              = eNB->target_ue_dl_mcs;
-          //((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs             = (unsigned char) ((eNB->frame%1024)%28);
-          ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->ndi              = subframe / 5;
+          ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->ndi              = (*dci_ndi_toggle_tmp);
           ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rv               = 0;
           ((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rah              = 0;
 
+          (*dci_ndi_toggle_tmp) = ((*dci_ndi_toggle_tmp) + 1) & 1;
+
           memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_20MHz_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         = subframe % 5;
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs              = eNB->target_ue_dl_mcs;
-          //((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs              = (unsigned char) ((eNB->frame%1024)%28);
-          ((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi              = subframe/5;
-          ((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;
diff --git a/openair1/SCHED/phy_procedures_lte_common.c b/openair1/SCHED/phy_procedures_lte_common.c
index e5753483daf8c7966fd4684b985dc4d7c03f51f4..07793413340866a16b5e36ace4ed0f4f08222dda 100644
--- a/openair1/SCHED/phy_procedures_lte_common.c
+++ b/openair1/SCHED/phy_procedures_lte_common.c
@@ -105,7 +105,47 @@ void get_Msg3_alloc(LTE_DL_FRAME_PARMS *frame_parms,
         *frame = (current_frame+2) & 1023;
         break;
       }
-    }
+    } else if (frame_parms->tdd_config == 4) {
+        switch (current_subframe) {
+
+        case 0:
+        case 4:
+        case 5:
+        case 6:
+          *subframe = 2;
+          *frame = (current_frame+1) & 1023;
+          break;
+
+        case 7:
+          *subframe = 3;
+          *frame = (current_frame+1) & 1023;
+          break;
+
+        case 8:
+        case 9:
+          *subframe = 2;
+          *frame = (current_frame+2) & 1023;
+          break;
+        }
+      } else if (frame_parms->tdd_config == 5) {
+          switch (current_subframe) {
+
+          case 0:
+          case 4:
+          case 5:
+          case 6:
+            *subframe = 2;
+            *frame = (current_frame+1) & 1023;
+            break;
+
+          case 7:
+          case 8:
+          case 9:
+            *subframe = 2;
+            *frame = (current_frame+2) & 1023;
+            break;
+          }
+        }
   }
 }
 
@@ -137,6 +177,13 @@ void get_Msg3_alloc_ret(LTE_DL_FRAME_PARMS *frame_parms,
       // original PUSCH in 3, PHICH in 9, ret in 3 next frame
       // original PUSCH in 4, PHICH in 0, ret in 4 next frame
       *frame=(current_frame+1) & 1023;
+    } else if (frame_parms->tdd_config == 4) {
+        // original PUSCH in 2, PHICH in 8, ret in 2 next frame
+        // original PUSCH in 3, PHICH in 9, ret in 3 next frame
+        *frame=(current_frame+1) & 1023;
+    } else if (frame_parms->tdd_config == 5) {
+        // original PUSCH in 2, PHICH in 8, ret in 2 next frame
+        *frame=(current_frame+1) & 1023;
     }
   }
 }
@@ -253,6 +300,24 @@ unsigned char ul_ACK_subframe2_dl_subframe(LTE_DL_FRAME_PARMS *frame_parms,unsig
 
       break;
 
+    case 4:
+          if (subframe == 2) {  // ACK subframes 0, 4 and 5
+            //if (ACK_index==2)
+            //  return(1); TBC
+            if (ACK_index==2)
+            return(0);
+
+            return(4+ACK_index);
+          } else if (subframe == 3) { // ACK subframes 6, 7 8 and 9
+            return(6+ACK_index);  // To be updated
+          } else {
+            LOG_E(PHY,"phy_procedures_lte_common.c/subframe2_dl_harq_pid: illegal subframe %d for tdd_config %d\n",
+                  subframe,frame_parms->tdd_config);
+            return(0);
+          }
+
+          break;
+
     case 1:
       if (subframe == 2) {  // ACK subframes 5 and 6
         return(5+ACK_index);
@@ -297,6 +362,30 @@ unsigned char ul_ACK_subframe2_M(LTE_DL_FRAME_PARMS *frame_parms,unsigned char s
 
       break;
 
+    case 4:
+          if (subframe == 2) {  // ACK subframes 0,4 and 5
+            return(3); // should be 4
+          } else if (subframe == 3) { // ACK subframes 6,7,8 and 9
+            return(4);
+          } else {
+            LOG_E(PHY,"phy_procedures_lte_common.c/subframe2_dl_harq_pid: illegal subframe %d for tdd_config %d\n",
+                  subframe,frame_parms->tdd_config);
+            return(0);
+          }
+
+          break;
+
+    case 5:
+              if (subframe == 2) {  // ACK subframes 0,3,4,5,6,7,8 and 9
+                return(8); // should be 3
+              } else {
+                LOG_E(PHY,"phy_procedures_lte_common.c/subframe2_dl_harq_pid: illegal subframe %d for tdd_config %d\n",
+                      subframe,frame_parms->tdd_config);
+                return(0);
+              }
+
+              break;
+
     case 1:
       if (subframe == 2) {  // ACK subframes 5 and 6
         return(2);
@@ -323,70 +412,73 @@ unsigned char ul_ACK_subframe2_M(LTE_DL_FRAME_PARMS *frame_parms,unsigned char s
 // return the number 'Nbundled'
 uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
                 harq_status_t *harq_ack,
-                unsigned char subframe,
+                unsigned char subframe_tx,
+                unsigned char subframe_rx,
                 unsigned char *o_ACK,
+                uint8_t *pN_bundled,
                 uint8_t cw_idx,
                 uint8_t do_reset) // 1 to reset ACK/NACK status : 0 otherwise
 {
   uint8_t status=0;
-  uint8_t subframe_ul=0xff, subframe_dl0=0xff, subframe_dl1=0xff;
+  uint8_t subframe_ul=0xff, subframe_dl0=0xff, subframe_dl1=0xff,subframe_dl2=0xff, subframe_dl3=0xff;
 
   //  printf("get_ack: SF %d\n",subframe);
   if (frame_parms->frame_type == FDD) {
-    if (subframe < 4)
-      subframe_dl0 = subframe + 6;
+    if (subframe_tx < 4)
+      subframe_dl0 = subframe_tx + 6;
     else
-      subframe_dl0 = subframe - 4;
+      subframe_dl0 = subframe_tx - 4;
 
     o_ACK[cw_idx] = harq_ack[subframe_dl0].ack;
     status = harq_ack[subframe_dl0].send_harq_status;
 
+    //LOG_I(PHY,"dl subframe %d send_harq_status %d cw_idx %d, reset %d\n",subframe_dl0, status, cw_idx, do_reset);
     if(do_reset)
     	harq_ack[subframe_dl0].send_harq_status = 0;
     //printf("get_ack: Getting ACK/NAK for PDSCH (subframe %d) => %d\n",subframe_dl,o_ACK[0]);
   } else {
     switch (frame_parms->tdd_config) {
     case 1:
-      if (subframe == 2) {  // ACK subframes 5,6
+      if (subframe_tx == 2) {  // ACK subframes 5,6
         subframe_ul  = 6;
         subframe_dl0 = 5;
         subframe_dl1 = 6;
-      } else if (subframe == 3) { // ACK subframe 9
+      } else if (subframe_tx == 3) { // ACK subframe 9
         subframe_ul  = 9;
         subframe_dl0 = 9;
         subframe_dl1 = 0xff;
-      } else if (subframe == 4) { // nothing
+      } else if (subframe_tx == 4) { // nothing
         subframe_ul  = 0xff;
         subframe_dl0 = 0xff; // invalid subframe number indicates ACK/NACK is not needed
         subframe_dl1 = 0xff;
-      } else if (subframe == 7) { // ACK subframes 0,1
+      } else if (subframe_tx == 7) { // ACK subframes 0,1
         subframe_ul  = 1;
         subframe_dl0 = 0;
         subframe_dl1 = 1;
-      } else if (subframe == 8) { // ACK subframes 4
+      } else if (subframe_tx == 8) { // ACK subframes 4
         subframe_ul  = 4;
         subframe_dl0 = 4;
         subframe_dl1 = 0xff;
       } else {
-        LOG_E(PHY,"phy_procedures_lte.c: get_ack, illegal subframe %d for tdd_config %d\n",
-              subframe,frame_parms->tdd_config);
+        LOG_E(PHY,"phy_procedures_lte.c: get_ack, illegal subframe_tx %d for tdd_config %d\n",
+              subframe_tx,frame_parms->tdd_config);
         return(0);
       }
 
       // report ACK/NACK status
-      o_ACK[0] = 1;
+      o_ACK[cw_idx] = 1;
       status = 0;
       if ((subframe_dl0 < 10) && (harq_ack[subframe_dl0].send_harq_status)) {
-        o_ACK[0] &= harq_ack[subframe_dl0].ack;
+        o_ACK[cw_idx] &= harq_ack[subframe_dl0].ack;
         status = harq_ack[subframe_dl0].send_harq_status;
       }
       if ((subframe_dl1 < 10) && (harq_ack[subframe_dl1].send_harq_status)) {
-        o_ACK[0] &= harq_ack[subframe_dl1].ack;
+        o_ACK[cw_idx] &= harq_ack[subframe_dl1].ack;
         status = harq_ack[subframe_dl1].send_harq_status;
       }
       // report status = Nbundled
       if (!status) {
-        o_ACK[0] = 0;
+        o_ACK[cw_idx] = 0;
       } else {
         if (harq_ack[subframe_ul].vDAI_UL < 0xff) {
           status = harq_ack[subframe_ul].vDAI_UL;
@@ -396,26 +488,26 @@ uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
       if (!do_reset && (subframe_ul < 10)) {
         if ((subframe_dl0 < 10) && (subframe_dl1 < 10)) {
           LOG_D(PHY,"ul-sf#%d vDAI_UL[sf#%d]=%d Nbundled=%d: dlsf#%d ACK=%d harq_status=%d vDAI_DL=%d, dlsf#%d ACK=%d harq_status=%d vDAI_DL=%d, o_ACK[0]=%d status=%d\n",
-              subframe, subframe_ul, harq_ack[subframe_ul].vDAI_UL, status,
+              subframe_tx, subframe_ul, harq_ack[subframe_ul].vDAI_UL, status,
               subframe_dl0, harq_ack[subframe_dl0].ack, harq_ack[subframe_dl0].send_harq_status, harq_ack[subframe_dl0].vDAI_DL,
               subframe_dl1, harq_ack[subframe_dl1].ack, harq_ack[subframe_dl1].send_harq_status, harq_ack[subframe_dl1].vDAI_DL,
-              o_ACK[0], status);
+              o_ACK[cw_idx], status);
         } else if (subframe_dl0 < 10) {
           LOG_D(PHY,"ul-sf#%d vDAI_UL[sf#%d]=%d Nbundled=%d: dlsf#%d ACK=%d status=%d vDAI_DL=%d, o_ACK[0]=%d status=%d\n",
-              subframe, subframe_ul, harq_ack[subframe_ul].vDAI_UL, status,
+              subframe_tx, subframe_ul, harq_ack[subframe_ul].vDAI_UL, status,
               subframe_dl0, harq_ack[subframe_dl0].ack, harq_ack[subframe_dl0].send_harq_status, harq_ack[subframe_dl0].vDAI_DL,
-              o_ACK[0], status);
+              o_ACK[cw_idx], status);
         }else if (subframe_dl1 < 10) {
           LOG_D(PHY,"ul-sf#%d vDAI_UL[sf#%d]=%d Nbundled=%d: dlsf#%d ACK=%d status=%d vDAI_DL=%d, o_ACK[0]=%d status=%d\n",
-              subframe, subframe_ul, harq_ack[subframe_ul].vDAI_UL, status,
+              subframe_tx, subframe_ul, harq_ack[subframe_ul].vDAI_UL, status,
               subframe_dl1, harq_ack[subframe_dl1].ack, harq_ack[subframe_dl1].send_harq_status, harq_ack[subframe_dl1].vDAI_DL,
-              o_ACK[0], status);
+              o_ACK[cw_idx], status);
         }
       }
 
       // reset ACK/NACK status
       if (do_reset) {
-        LOG_D(PHY,"ul-sf#%d ACK/NACK status resetting @ dci0-sf#%d, dci1x/2x-sf#%d, dci1x/2x-sf#%d\n", subframe, subframe_ul, subframe_dl0, subframe_dl1);
+        LOG_D(PHY,"ul-sf#%d ACK/NACK status resetting @ dci0-sf#%d, dci1x/2x-sf#%d, dci1x/2x-sf#%d\n", subframe_tx, subframe_ul, subframe_dl0, subframe_dl1);
         if (subframe_ul < 10) {
           harq_ack[subframe_ul].vDAI_UL = 0xff;
         }
@@ -434,36 +526,44 @@ uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
       break;
 
     case 3:
-      if (subframe == 2) {  // ACK subframes 5 and 6
+      if (subframe_tx == 2) {  // ACK subframes 5 and 6
         subframe_dl0 = 5;
         subframe_dl1 = 6;
-        //printf("Subframe 2, TDD config 3: harq_ack[5] = %d (%d),harq_ack[6] = %d (%d)\n",harq_ack[5].ack,harq_ack[5].send_harq_status,harq_ack[6].ack,harq_ack[6].send_harq_status);
-      } else if (subframe == 3) { // ACK subframes 7 and 8
+        subframe_ul  = 2;
+        //printf("subframe_tx 2, TDD config 3: harq_ack[5] = %d (%d),harq_ack[6] = %d (%d)\n",harq_ack[5].ack,harq_ack[5].send_harq_status,harq_ack[6].ack,harq_ack[6].send_harq_status);
+      } else if (subframe_tx == 3) { // ACK subframes 7 and 8
         subframe_dl0 = 7;
         subframe_dl1 = 8;
+        subframe_ul  = 3;
         //printf("Subframe 3, TDD config 3: harq_ack[7] = %d,harq_ack[8] = %d\n",harq_ack[7].ack,harq_ack[8].ack);
         //printf("status %d : o_ACK (%d,%d)\n", status,o_ACK[0],o_ACK[1]);
-      } else if (subframe == 4) { // ACK subframes 9 and 0
+      } else if (subframe_tx == 4) { // ACK subframes 9 and 0
         subframe_dl0 = 9;
         subframe_dl1 = 0;
+        subframe_ul  = 4;
         //printf("Subframe 4, TDD config 3: harq_ack[9] = %d,harq_ack[0] = %d\n",harq_ack[9].ack,harq_ack[0].ack);
       } else {
-        LOG_E(PHY,"phy_procedures_lte.c: get_ack, illegal subframe %d for tdd_config %d\n",
-              subframe,frame_parms->tdd_config);
+        LOG_E(PHY,"phy_procedures_lte.c: get_ack, illegal subframe_tx %d for tdd_config %d\n",
+              subframe_tx,frame_parms->tdd_config);
         return(0);
       }
 
       // report ACK/NACK status
+      o_ACK[cw_idx] = 0;
       if (harq_ack[subframe_dl0].send_harq_status == 1) {
-        o_ACK[0] = harq_ack[subframe_dl0].ack;
+        o_ACK[cw_idx] = harq_ack[subframe_dl0].ack;
 
         if (harq_ack[subframe_dl1].send_harq_status == 1)
-          o_ACK[1] = harq_ack[subframe_dl1].ack;
+          o_ACK[cw_idx] &= harq_ack[subframe_dl1].ack;
       } else if (harq_ack[subframe_dl1].send_harq_status == 1)
-        o_ACK[0] = harq_ack[subframe_dl1].ack;
+        o_ACK[cw_idx] = harq_ack[subframe_dl1].ack;
 
-      status = harq_ack[subframe_dl0].send_harq_status + (harq_ack[subframe_dl1].send_harq_status<<1);
+      pN_bundled[0] = harq_ack[subframe_rx].vDAI_UL;
+      status = harq_ack[subframe_dl0].send_harq_status + harq_ack[subframe_dl1].send_harq_status;
 
+      //LOG_D(PHY,"TDD Config3 UL Sfn %d, dl Sfn0 %d status %d o_Ack %d, dl Sfn1 %d status %d o_Ack %d subframe_rx %d N_bundled %d \n",
+      //	  subframe_tx, subframe_dl0, harq_ack[subframe_dl0].send_harq_status,harq_ack[subframe_dl0].ack,
+      //    subframe_dl1, harq_ack[subframe_dl1].send_harq_status,harq_ack[subframe_dl1].ack, subframe_rx, pN_bundled[0]);
       if (do_reset) {
         // reset ACK/NACK status
         harq_ack[subframe_dl0].ack = 2;
@@ -474,6 +574,63 @@ uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
 
       break;
 
+    case 4:
+          if (subframe_tx == 2) {  // ACK subframes 4, 5 and 0
+            subframe_dl0 = 4;
+            subframe_dl1 = 5;
+            subframe_dl2 = 0;
+            subframe_ul  = 2;
+            //printf("subframe_tx 2, TDD config 3: harq_ack[5] = %d (%d),harq_ack[6] = %d (%d)\n",harq_ack[5].ack,harq_ack[5].send_harq_status,harq_ack[6].ack,harq_ack[6].send_harq_status);
+          } else if (subframe_tx == 3) { // ACK subframes 6, 7 8 and 9
+            subframe_dl0 = 6;
+            subframe_dl1 = 7;
+            subframe_dl2 = 8;
+            subframe_dl3 = 9;
+            subframe_ul  = 3;
+            //printf("Subframe 3, TDD config 3: harq_ack[7] = %d,harq_ack[8] = %d\n",harq_ack[7].ack,harq_ack[8].ack);
+            //printf("status %d : o_ACK (%d,%d)\n", status,o_ACK[0],o_ACK[1]);
+          } else {
+            LOG_E(PHY,"phy_procedures_lte.c: get_ack, illegal subframe_tx %d for tdd_config %d\n",
+                  subframe_tx,frame_parms->tdd_config);
+            return(0);
+          }
+
+          // report ACK/NACK status
+          o_ACK[cw_idx] = 0;
+          if (harq_ack[subframe_dl0].send_harq_status == 1)
+            o_ACK[cw_idx] = harq_ack[subframe_dl0].ack;
+
+          if (harq_ack[subframe_dl1].send_harq_status == 1)
+            o_ACK[cw_idx] &= harq_ack[subframe_dl1].ack;
+
+          if (harq_ack[subframe_dl2].send_harq_status == 1)
+            o_ACK[cw_idx] &= harq_ack[subframe_dl2].ack;
+
+          if (harq_ack[subframe_dl3].send_harq_status == 1)
+            o_ACK[cw_idx] &= harq_ack[subframe_dl3].ack;
+
+          pN_bundled[0] = harq_ack[subframe_rx].vDAI_UL;
+          status = harq_ack[subframe_dl0].send_harq_status + harq_ack[subframe_dl1].send_harq_status + harq_ack[subframe_dl2].send_harq_status + harq_ack[subframe_dl3].send_harq_status;
+
+          LOG_I(PHY,"TDD Config3 UL Sfn %d, dl Sfn0 %d status %d o_Ack %d, dl Sfn1 %d status %d o_Ack %d dl Sfn2 %d status %d o_Ack %d dl Sfn3 %d status %d o_Ack %d subframe_rx %d N_bundled %d status %d\n",
+                subframe_tx, subframe_dl0, harq_ack[subframe_dl0].send_harq_status,harq_ack[subframe_dl0].ack,
+              subframe_dl1, harq_ack[subframe_dl1].send_harq_status,harq_ack[subframe_dl1].ack,
+              subframe_dl2, harq_ack[subframe_dl2].send_harq_status,harq_ack[subframe_dl2].ack,
+              subframe_dl3, harq_ack[subframe_dl3].send_harq_status,harq_ack[subframe_dl3].ack,subframe_rx, pN_bundled[0], status);
+          if (do_reset) {
+            // reset ACK/NACK status
+            harq_ack[subframe_dl0].ack = 2;
+            harq_ack[subframe_dl1].ack = 2;
+            harq_ack[subframe_dl2].ack = 2;
+            harq_ack[subframe_dl3].ack = 2;
+            harq_ack[subframe_dl0].send_harq_status = 0;
+            harq_ack[subframe_dl1].send_harq_status = 0;
+            harq_ack[subframe_dl2].send_harq_status = 0;
+            harq_ack[subframe_dl3].send_harq_status = 0;
+          }
+
+          break;
+
     }
   }
 
@@ -484,20 +641,24 @@ uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
 
 uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,
                 harq_status_t *harq_ack,
-                unsigned char subframe,
+                unsigned char subframe_tx,
+                unsigned char subframe_rx,
                 unsigned char *o_ACK,
                 uint8_t cw_idx)
 {
-  return get_reset_ack(frame_parms, harq_ack, subframe, o_ACK, cw_idx, 0);
+    uint8_t N_bundled = 0;
+  return get_reset_ack(frame_parms, harq_ack, subframe_tx, subframe_rx, o_ACK, &N_bundled, cw_idx, 0);
 }
 
 uint8_t reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
                 harq_status_t *harq_ack,
-                unsigned char subframe,
+                unsigned char subframe_tx,
+                unsigned char subframe_rx,
                 unsigned char *o_ACK,
+                uint8_t *pN_bundled,
                 uint8_t cw_idx)
 {
-  return get_reset_ack(frame_parms, harq_ack, subframe, o_ACK, cw_idx, 1);
+  return get_reset_ack(frame_parms, harq_ack, subframe_tx, subframe_rx, o_ACK, pN_bundled, cw_idx, 1);
 }
 
 
@@ -594,6 +755,29 @@ lte_subframe_t subframe_select(LTE_DL_FRAME_PARMS *frame_parms,unsigned char sub
       return(255);
     }
 
+  case 4:
+      if  ((subframe<1) || (subframe>=4))
+        return(SF_DL);
+      else if ((subframe>1) && (subframe < 4))
+        return(SF_UL);
+      else if (subframe==1)
+        return (SF_S);
+      else  {
+        LOG_E(PHY,"[PHY_PROCEDURES_LTE] Unknown subframe number\n");
+        return(255);
+      }
+
+  case 5:
+        if  ((subframe<1) || (subframe>=3))
+          return(SF_DL);
+        else if ((subframe>1) && (subframe < 3))
+          return(SF_UL);
+        else if (subframe==1)
+          return (SF_S);
+        else  {
+          LOG_E(PHY,"[PHY_PROCEDURES_LTE] Unknown subframe number\n");
+          return(255);
+        }
     break;
 
   default:
@@ -668,13 +852,13 @@ unsigned int is_phich_subframe(LTE_DL_FRAME_PARMS *frame_parms,unsigned char sub
       break;
 
     case 4:
-      if ((subframe == 0) || (subframe == 8) )
+      if ((subframe == 8) || (subframe == 9) )
         return(1);
 
       break;
 
     case 5:
-      if (subframe == 0)
+      if (subframe == 8)
         return(1);
 
       break;
diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c
index a9142a9918928efd65955715fc8c8abceb5a84c4..f8b9a9ae5965be7f4fd4fee20623e0a168ac7e4b 100644
--- a/openair1/SCHED/phy_procedures_lte_eNb.c
+++ b/openair1/SCHED/phy_procedures_lte_eNb.c
@@ -190,7 +190,7 @@ int mac_phy_remove_ue(module_id_t Mod_idP,rnti_t rntiP) {
     eNB = PHY_vars_eNB_g[Mod_idP][CC_id];
     for (i=0; i<NUMBER_OF_UE_MAX; i++) {
       if ((eNB->dlsch[i]==NULL) || (eNB->ulsch[i]==NULL)) {
-	MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (ENOMEM)", rnti);
+	MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (ENOMEM)", rntiP);
 	LOG_E(PHY,"Can't remove UE, not enough memory allocated\n");
 	return(-1);
       } else {
@@ -906,7 +906,9 @@ void generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC
     T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->round),
     T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->first_rb),
     T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->nb_rb),
-    T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->TBS));
+    T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->TBS),
+    T_INT(dci_alloc->L),
+    T_INT(dci_alloc->firstCCE));
 }
 
 void pdsch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t *dlsch1,LTE_eNB_UE_stats *ue_stats,int ra_flag,int num_pdcch_symbols) {
@@ -2272,7 +2274,7 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq
 
         if ((fp->frame_type==FDD) ||
           (bundling_flag==bundling)    ||
-          ((fp->frame_type==TDD)&&(fp->tdd_config==1)&&((subframe!=2)||(subframe!=7)))) {
+          ((fp->frame_type==TDD)&&(fp->tdd_config==1)&&((subframe!=2)&&(subframe!=7)))) {
           format = pucch_format1a;
         } else {
           format = pucch_format1b;
diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c
index d081090fc907c5eeaf7bdc3133f228afff4c416e..efe0e695bcd7b655905ba1f7761231a666c5d7ba 100644
--- a/openair1/SCHED/phy_procedures_lte_ue.c
+++ b/openair1/SCHED/phy_procedures_lte_ue.c
@@ -444,8 +444,26 @@ uint8_t is_ri_TXOp(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id)
     return(0);
 }
 
+void compute_cqi_ri_resources(PHY_VARS_UE *ue,
+                              LTE_UE_ULSCH_t *ulsch,
+                              uint8_t eNB_id,
+                              uint16_t rnti,
+                              uint16_t p_rnti,
+                              uint16_t cba_rnti,
+                              uint8_t cqi_status,
+                              uint8_t ri_status)
+{
+    //PHY_MEASUREMENTS *meas = &ue->measurements;
+    //uint8_t transmission_mode = ue->transmission_mode[eNB_id];
 
 
+    //LOG_I(PHY,"compute_cqi_ri_resources O_RI %d O %d uci format %d \n",ulsch->O_RI,ulsch->O,ulsch->uci_format);
+    if (cqi_status == 1 || ri_status == 1)
+    {
+        ulsch->O = 4;
+    }
+}
+
 void ue_compute_srs_occasion(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t isSubframeSRS)
 {
 
@@ -511,7 +529,7 @@ void ue_compute_srs_occasion(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id
               uint8_t pucch_ack_payload[2];
               if (get_ack(&ue->frame_parms,
                       ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack,
-                      subframe_tx,pucch_ack_payload,0) > 0)
+                      subframe_tx,proc->subframe_rx,pucch_ack_payload,0) > 0)
               {
                   is_sr_an_subframe = 1;
               }
@@ -634,6 +652,14 @@ PUCCH_FMT_t get_pucch_format(lte_frame_type_t frame_type,
       if(SR_payload == 1)
       {
           return pucch_format1;
+          /*
+          if (frame_type == FDD) {
+              return pucch_format1;
+          } else if (frame_type == TDD) {
+              return pucch_format1b;
+          } else {
+              AssertFatal(1==0,"Unknown frame_type");
+          }*/
       }
   }
   else
@@ -674,13 +700,14 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue,
 {
 
   LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms;
-  uint8_t nCCE0,nCCE1,harq_ack1,harq_ack0;
+  uint8_t nCCE0,nCCE1,nCCE2,nCCE3,harq_ack1,harq_ack0,harq_ack3,harq_ack2;
   ANFBmode_t bundling_flag;
-  uint16_t n1_pucch0=0,n1_pucch1=0;
+  uint16_t n1_pucch0=0,n1_pucch1=0,n1_pucch2=0,n1_pucch3=0,n1_pucch_inter;
   static uint8_t candidate_dl[9]; // which downlink(s) the current ACK/NACK is associating to
   uint8_t last_dl=0xff; // the last downlink with valid DL-DCI. for calculating the PUCCH resource index
   int sf;
   int M;
+  uint8_t ack_counter=0;
   // clear this, important for case where n1_pucch selection is not used
   int subframe=proc->subframe_tx;
 
@@ -700,10 +727,10 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue,
 #ifdef DEBUG_PHY_PROC
 
     if (bundling_flag==bundling) {
-      LOG_D(PHY,"[UE%d] Frame %d subframe %d : get_n1_pucch, bundling, SR %d/%d\n",ue->Mod_id,proc->frame_tx,subframe,SR,
+      LOG_I(PHY,"[UE%d] Frame %d subframe %d : get_n1_pucch, bundling, SR %d/%d\n",ue->Mod_id,proc->frame_tx,subframe,SR,
             ue->scheduling_request_config[eNB_id].sr_PUCCH_ResourceIndex);
     } else {
-      LOG_D(PHY,"[UE%d] Frame %d subframe %d : get_n1_pucch, multiplexing, SR %d/%d\n",ue->Mod_id,proc->frame_tx,subframe,SR,
+      LOG_I(PHY,"[UE%d] Frame %d subframe %d : get_n1_pucch, multiplexing, SR %d/%d\n",ue->Mod_id,proc->frame_tx,subframe,SR,
             ue->scheduling_request_config[eNB_id].sr_PUCCH_ResourceIndex);
     }
 
@@ -729,7 +756,7 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue,
       } else if (subframe == 8) { // ACK subframes 4
         candidate_dl[0] = 4;
       } else {
-        LOG_E(PHY,"[UE%d] : Frame %d phy_procedures_lte.c: get_n1pucch, illegal subframe %d for tdd_config %d\n",
+        LOG_E(PHY,"[UE%d] : Frame %d phy_procedures_lte.c: get_n1pucch, illegal tx-subframe %d for tdd_config %d\n",
               ue->Mod_id,proc->frame_tx,subframe,frame_parms->tdd_config);
         return(0);
       }
@@ -743,8 +770,8 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue,
         }
       }
       if (last_dl >= 10) {
-        LOG_E(PHY,"[UE%d] : Frame %d phy_procedures_lte.c: get_n1pucch, illegal subframe %d for tdd_config %d\n",
-              ue->Mod_id,proc->frame_tx,last_dl,frame_parms->tdd_config);
+        LOG_E(PHY,"[UE%d] : Frame %d phy_procedures_lte.c: get_n1pucch, illegal rx-subframe %d (tx-subframe %d) for tdd_config %d\n",
+              ue->Mod_id,proc->frame_tx,last_dl,subframe,frame_parms->tdd_config);
         return (0);
       }
 
@@ -809,6 +836,11 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue,
       if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[5+last_dl].send_harq_status>0)  // n-6 // subframe 5 is to be ACK/NAKed
         harq_ack0 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[5+last_dl].ack;
 
+      LOG_D(PHY,"SFN/SF %d/%d calculating n1_pucch cce0=%d n1_pucch0=%d cce1=%d n1_pucch1=%d\n",
+                                      proc->frame_tx%1024,
+                                      proc->subframe_tx,
+                                      nCCE0,n1_pucch0,
+                                      nCCE1,n1_pucch1);
 
       if (harq_ack1!=2) { // n-6 // subframe 6,8,0 and maybe 5,7,9 is to be ACK/NAKed
 
@@ -865,6 +897,239 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue,
 
       break;
 
+    case 4:  // DL:S:UL:UL:DL:DL:DL:DL:DL:DL
+          // in this configuration we have M=4 from pg 68 of 36.213 (v8.6)
+          // Note: this doesn't allow using subframe 1 for PDSCH transmission!!! (i.e. SF 1 cannot be acked in SF 2)
+          // set ACK/NAKs to DTX
+          harq_ack3 = 2; // DTX
+          harq_ack2 = 2; // DTX
+          harq_ack1 = 2; // DTX
+          harq_ack0 = 2; // DTX
+          // This is the offset for a particular subframe (2,3,4) => (0,2,4)
+          //last_dl = (subframe-2)<<1;
+          if (subframe == 2) {
+          // i=0
+          //nCCE0 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[2+subframe];
+          nCCE0 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(8+subframe)%10];
+          n1_pucch0 = 2*get_Np(frame_parms->N_RB_DL,nCCE0,0) + nCCE0+ frame_parms->pucch_config_common.n1PUCCH_AN;
+          // i=1
+          nCCE1 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[2+subframe];
+          n1_pucch1 = get_Np(frame_parms->N_RB_DL,nCCE1,0) + get_Np(frame_parms->N_RB_DL,nCCE1,1) + nCCE1 + frame_parms->pucch_config_common.n1PUCCH_AN;
+          // i=2
+          nCCE2 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(8+subframe)%10];
+          n1_pucch2 = 2*get_Np(frame_parms->N_RB_DL,nCCE2,1) + nCCE2+ frame_parms->pucch_config_common.n1PUCCH_AN;
+          // i=3
+          //nCCE3 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(9+subframe)%10];
+          //n1_pucch3 = get_Np(frame_parms->N_RB_DL,nCCE3,1) + nCCE3 + frame_parms->pucch_config_common.n1PUCCH_AN;
+
+          // set ACK/NAK to values if not DTX
+          if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(8+subframe)%10].send_harq_status>0)  // n-6 // subframe 6 is to be ACK/NAKed
+            harq_ack0 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(8+subframe)%10].ack;
+
+          if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[2+subframe].send_harq_status>0)  // n-6 // subframe 5 is to be ACK/NAKed
+            harq_ack1 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[2+subframe].ack;
+
+          if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[3+subframe].send_harq_status>0)  // n-6 // subframe 6 is to be ACK/NAKed
+            harq_ack2 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[3+subframe].ack;
+
+          //if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(9+subframe)%10].send_harq_status>0)  // n-6 // subframe 5 is to be ACK/NAKed
+            //harq_ack3 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(9+subframe)%10].ack;
+          //LOG_I(PHY,"SFN/SF %d/%d calculating n1_pucch cce0=%d n1_pucch0=%d cce1=%d n1_pucch1=%d cce2=%d n1_pucch2=%d\n",
+          //                      proc->frame_tx%1024,
+          //                      proc->subframe_tx,
+          //                      nCCE0,n1_pucch0,
+          //                      nCCE1,n1_pucch1, nCCE2, n1_pucch2);
+          }else if (subframe == 3) {
+          // i=0
+
+          nCCE0 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[4+subframe];
+          n1_pucch0 = 3*get_Np(frame_parms->N_RB_DL,nCCE0,0) + nCCE0+ frame_parms->pucch_config_common.n1PUCCH_AN;
+          // i=1
+          nCCE1 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[5+subframe];
+          n1_pucch1 = 2*get_Np(frame_parms->N_RB_DL,nCCE1,0) + get_Np(frame_parms->N_RB_DL,nCCE1,1) + nCCE1 + frame_parms->pucch_config_common.n1PUCCH_AN;
+          // i=2
+          nCCE2 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(6+subframe)];
+          n1_pucch2 = get_Np(frame_parms->N_RB_DL,nCCE2,0) + 2*get_Np(frame_parms->N_RB_DL,nCCE2,1) + nCCE2+ frame_parms->pucch_config_common.n1PUCCH_AN;
+          // i=3
+          nCCE3 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(3+subframe)];
+          n1_pucch3 = 3*get_Np(frame_parms->N_RB_DL,nCCE3,1) + nCCE3 + frame_parms->pucch_config_common.n1PUCCH_AN;
+
+          // set ACK/NAK to values if not DTX
+          if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[4+subframe].send_harq_status>0)  // n-6 // subframe 6 is to be ACK/NAKed
+          harq_ack0 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[4+subframe].ack;
+
+          if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[5+subframe].send_harq_status>0)  // n-6 // subframe 5 is to be ACK/NAKed
+          harq_ack1 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[5+subframe].ack;
+
+          if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(6+subframe)].send_harq_status>0)  // n-6 // subframe 6 is to be ACK/NAKed
+          harq_ack2 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(6+subframe)].ack;
+
+          if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(3+subframe)].send_harq_status>0)  // n-6 // subframe 5 is to be ACK/NAKed
+          harq_ack3 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(3+subframe)].ack;
+          }
+
+          //LOG_I(PHY,"SFN/SF %d/%d calculating n1_pucch cce0=%d n1_pucch0=%d harq_ack0=%d cce1=%d n1_pucch1=%d harq_ack1=%d cce2=%d n1_pucch2=%d harq_ack2=%d cce3=%d n1_pucch3=%d harq_ack3=%d bundling_flag=%d\n",
+          //                                proc->frame_tx%1024,
+          //                                proc->subframe_tx,
+          //                                nCCE0,n1_pucch0,harq_ack0,
+          //                                nCCE1,n1_pucch1,harq_ack1, nCCE2, n1_pucch2, harq_ack2,
+          //                                nCCE3, n1_pucch3, harq_ack3, bundling_flag);
+
+          if ((bundling_flag==bundling)&&(SR == 0)) {  // This is for bundling without SR,
+             if ((harq_ack0!=2) ) {
+                b[0] = harq_ack0;
+                n1_pucch_inter = n1_pucch0;
+             }
+             if ((harq_ack1!=2) ) {
+                b[0] = b[0]&harq_ack1;
+                n1_pucch_inter = n1_pucch1;
+             }
+             if ((harq_ack2!=2) ) {
+                b[0] = b[0]&harq_ack2;
+                n1_pucch_inter = n1_pucch2;
+             }
+             if ((harq_ack3!=2) ) {
+                b[0] = b[0]&harq_ack3;
+                n1_pucch_inter = n1_pucch3;
+             }
+
+             if (subframe == 3) {
+                n1_pucch_inter = n1_pucch2;
+             } else if (subframe == 2) {
+                n1_pucch_inter = n1_pucch2;
+             }
+
+             //LOG_I(PHY,"SFN/SF %d/%d calculating n1_pucch n1_pucch_inter=%d  b[0]=%d b[1]=%d \n",
+             //                                           proc->frame_tx%1024,
+             //                                           proc->subframe_tx,n1_pucch_inter,
+             //                                           b[0],b[1]);
+
+              return(n1_pucch_inter);
+
+            } else if ((bundling_flag==multiplexing)&&(SR==0)) { // Table 10.1
+
+              if ((harq_ack0 == 1) && (harq_ack1 == 1) && (harq_ack2 == 1) && (harq_ack3 == 1)) {
+                b[1] = 1;
+                b[0] = 1;
+                return(n1_pucch1);
+              } else if ((harq_ack0 == 1) && (harq_ack1 == 1) && (harq_ack2 == 1) && ((harq_ack3 == 2) || (harq_ack3 == 0))) {
+                b[0] = 1;
+                b[1] = 0;
+                return(n1_pucch1);
+              } else if (((harq_ack0 == 0) || (harq_ack0 == 2)) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && (harq_ack2 == 0) && (harq_ack3 == 2)) {
+                b[1] = 1;
+                b[0] = 1;
+                return(n1_pucch2);
+              } else if ((harq_ack0 == 1) && (harq_ack1 == 1) && ((harq_ack2 == 2) || (harq_ack2 == 0)) && (harq_ack3 == 1)) {
+                b[1] = 1;
+                b[0] = 0;
+                return(n1_pucch1);
+              } else if ((harq_ack0 == 0) && (harq_ack1 == 2) && (harq_ack2 == 2) && (harq_ack3 == 2)) {
+                b[1] = 1;
+                b[0] = 0;
+                return(n1_pucch0);
+              } else if ((harq_ack0 == 1) && (harq_ack1 == 1) && ((harq_ack2 == 2) || (harq_ack2 == 0)) && ((harq_ack3 == 2) || (harq_ack3 == 0))) {
+                b[1] = 1;
+                b[0] = 0;
+                return(n1_pucch1);
+              } else if ((harq_ack0 == 1) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && (harq_ack2 == 1) && (harq_ack3 == 1)) {
+                b[0] = 0;
+                b[1] = 1;
+                return(n1_pucch3);
+              } else if (((harq_ack0 == 0) || (harq_ack0 == 2)) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && ((harq_ack2 == 2) || (harq_ack2 == 0)) && (harq_ack3 == 0)) {
+                b[1] = 1;
+                b[0] = 1;
+                return(n1_pucch3);
+              } else if ((harq_ack0 == 1) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && (harq_ack2 == 1) && ((harq_ack3 == 2) || (harq_ack3 == 0))) {
+                b[0] = 0;
+                b[1] = 1;
+                return(n1_pucch2);
+              } else if ((harq_ack0 == 1) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && ((harq_ack2 == 2) || (harq_ack2 == 0)) && (harq_ack3 == 1)) {
+                b[0] = 0;
+                b[1] = 1;
+                return(n1_pucch0);
+              } else if ((harq_ack0 == 1) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && ((harq_ack2 == 2) || (harq_ack2 == 0)) && ((harq_ack3 == 2) || (harq_ack3 == 0))) {
+                b[0] = 0;
+                b[1] = 1;
+                return(n1_pucch0);
+              } else if (((harq_ack0 == 2) || (harq_ack0 == 0)) && (harq_ack1 == 1) && (harq_ack2 == 1) && (harq_ack3 == 1)) {
+                b[0] = 0;
+                b[1] = 1;
+                return(n1_pucch3);
+              } else if (((harq_ack0 == 2) || (harq_ack0 == 0)) && (harq_ack1 == 0) && (harq_ack2 == 2) && (harq_ack3 == 2)) {
+                b[0] = 0;
+                b[1] = 0;
+                return(n1_pucch1);
+              } else if (((harq_ack0 == 2) || (harq_ack0 == 0)) && (harq_ack1 == 1) && (harq_ack2 == 1) && ((harq_ack3 == 2) || (harq_ack3 == 0))) {
+                b[0] = 1;
+                b[1] = 0;
+                return(n1_pucch2);
+              } else if (((harq_ack0 == 2) || (harq_ack0 == 0)) && (harq_ack1 == 1) && ((harq_ack2 == 2) || (harq_ack2 == 0)) && (harq_ack3 == 1)) {
+                b[0] = 1;
+                b[1] = 0;
+                return(n1_pucch3);
+              } else if (((harq_ack0 == 2) || (harq_ack0 == 0)) && (harq_ack1 == 1) && ((harq_ack2 == 2) || (harq_ack2 == 0)) && ((harq_ack3 == 2) || (harq_ack3 == 0))) {
+                b[0] = 0;
+                b[1] = 1;
+                return(n1_pucch1);
+              } else if (((harq_ack0 == 2) || (harq_ack0 == 0)) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && (harq_ack2 == 1) && (harq_ack3 == 1)) {
+                b[0] = 0;
+                b[1] = 1;
+                return(n1_pucch3);
+              } else if (((harq_ack0 == 2) || (harq_ack0 == 0)) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && (harq_ack2 == 1) && ((harq_ack3 == 2) || (harq_ack3 == 0))) {
+                b[0] = 0;
+                b[1] = 0;
+                return(n1_pucch2);
+              } else if (((harq_ack0 == 2) || (harq_ack0 == 0)) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && (harq_ack3 == 1) && ((harq_ack2 == 2) || (harq_ack2 == 0))) {
+                b[0] = 0;
+                b[1] = 0;
+                return(n1_pucch3);
+                }
+
+            } else if (SR==1) { // SR and 0,1,or 2 ACKS, (first 3 entries in Table 7.3-1 of 36.213)
+              // this should be number of ACKs (including
+              if (harq_ack0==1)
+                 ack_counter ++;
+              if (harq_ack1==1)
+                 ack_counter ++;
+              if (harq_ack2==1)
+                 ack_counter ++;
+              if (harq_ack3==1)
+                 ack_counter ++;
+
+            switch (ack_counter) {
+               case 0:
+                 b[0] = 0;
+                 b[1] = 0;
+               break;
+
+               case 1:
+                 b[0] = 1;
+                 b[1] = 1;
+               break;
+
+               case 2:
+                 b[0] = 1;
+                 b[1] = 0;
+               break;
+
+               case 3:
+                 b[0] = 0;
+                 b[1] = 1;
+               break;
+
+               case 4:
+                 b[0] = 1;
+                 b[1] = 1;
+               break;
+            }
+
+            ack_counter = 0;
+            return(ue->scheduling_request_config[eNB_id].sr_PUCCH_ResourceIndex);
+          }
+
+          break;
+
     }  // switch tdd_config
   }
 
@@ -1210,9 +1475,11 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
   uint8_t ulsch_input_buffer[5477] __attribute__ ((aligned(32)));
   uint8_t access_mode;
   uint8_t Nbundled=0;
+  uint8_t NbundledCw1=0;
   uint8_t ack_status_cw0=0;
   uint8_t ack_status_cw1=0;
-
+  uint8_t cqi_status = 0;
+  uint8_t ri_status  = 0;
   VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_UESPEC,VCD_FUNCTION_IN);
 
   // get harq_pid from subframe relationship
@@ -1315,22 +1582,44 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
     ack_status_cw0 = reset_ack(&ue->frame_parms,
             ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack,
             subframe_tx,
-            ue->ulsch[eNB_id]->o_ACK,0);
+            proc->subframe_rx,
+            ue->ulsch[eNB_id]->o_ACK,
+            &Nbundled,
+            0);
     ack_status_cw1 = reset_ack(&ue->frame_parms,
             ue->dlsch[proc->subframe_rx&0x1][eNB_id][1]->harq_ack,
             subframe_tx,
-            ue->ulsch[eNB_id]->o_ACK,1);
+            proc->subframe_rx,
+            ue->ulsch[eNB_id]->o_ACK,
+            &NbundledCw1,
+            1);
 
-    Nbundled = ack_status_cw0;
+    //Nbundled = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack;
+    //ue->ulsch[eNB_id]->bundling = Nbundled;
 
     first_rb = ue->ulsch[eNB_id]->harq_processes[harq_pid]->first_rb;
     nb_rb = ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb;
 
+
+    // check Periodic CQI/RI reporting
+    cqi_status = ((ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PMI_ConfigIndex>0)&&
+        (is_cqi_TXOp(ue,proc,eNB_id)==1));
+
+    ri_status = ((ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.ri_ConfigIndex>0) &&
+             (is_ri_TXOp(ue,proc,eNB_id)==1));
+
+    // compute CQI/RI resources
+    compute_cqi_ri_resources(ue, ue->ulsch[eNB_id], eNB_id, ue->ulsch[eNB_id]->rnti, P_RNTI, CBA_RNTI, cqi_status, ri_status);
+
     if (ack_status_cw0 > 0) {
 
       // check if we received a PDSCH at subframe_tx - 4
       // ==> send ACK/NACK on PUSCH
-      ue->ulsch[eNB_id]->harq_processes[harq_pid]->O_ACK = ack_status_cw0 + ack_status_cw1;
+      if (ue->frame_parms.frame_type == FDD)
+      {
+        ue->ulsch[eNB_id]->harq_processes[harq_pid]->O_ACK = ack_status_cw0 + ack_status_cw1;
+      }
+
 
 #if T_TRACER
     if(ue->ulsch[eNB_id]->o_ACK[0])
@@ -1357,8 +1646,9 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
 
 #ifdef DEBUG_PHY_PROC
         LOG_D(PHY,
-              "[UE  %d][PUSCH %d] AbsSubframe %d.%d %d Generating PUSCH : first_rb %d, nb_rb %d, round %d, mcs %d, rv %d, cyclic_shift %d (cyclic_shift_common %d,n_DMRS2 %d,n_PRS %d), ACK (%d,%d), O_ACK %d, bundling %d\n",
-          Mod_id,harq_pid,frame_tx,subframe_tx,proc->subframe_rx,
+              "[UE  %d][PUSCH %d] AbsSubframe %d.%d Generating PUSCH : first_rb %d, nb_rb %d, round %d, mcs %d, rv %d, "
+              "cyclic_shift %d (cyclic_shift_common %d,n_DMRS2 %d,n_PRS %d), ACK (%d,%d), O_ACK %d, ack_status_cw0 %d ack_status_cw1 %d bundling %d, Nbundled %d, CQI %d, RI %d\n",
+          Mod_id,harq_pid,frame_tx%1024,subframe_tx,
           first_rb,nb_rb,
           ue->ulsch[eNB_id]->harq_processes[harq_pid]->round,
           ue->ulsch[eNB_id]->harq_processes[harq_pid]->mcs,
@@ -1371,7 +1661,11 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
           ue->frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[subframe_tx<<1],
           ue->ulsch[eNB_id]->o_ACK[0],ue->ulsch[eNB_id]->o_ACK[1],
           ue->ulsch[eNB_id]->harq_processes[harq_pid]->O_ACK,
-          ue->ulsch[eNB_id]->bundling);
+          ack_status_cw0,
+          ack_status_cw1,
+          ue->ulsch[eNB_id]->bundling, Nbundled,
+          cqi_status,
+          ri_status);
 #endif
 
 
@@ -1609,11 +1903,16 @@ int16_t get_pucch2_cqi(PHY_VARS_UE *ue,int eNB_id,int *len) {
   if ((ue->transmission_mode[eNB_id]<4)||
       (ue->transmission_mode[eNB_id]==7)) { // Mode 1-0 feedback
     // 4-bit CQI message
+          /*LOG_I(PHY,"compute CQI value, TM %d, length 4, Cqi Avg %d, value %d \n", ue->transmission_mode[eNB_id],
+                          ue->measurements.wideband_cqi_avg[eNB_id],
+                          sinr2cqi((double)ue->measurements.wideband_cqi_avg[eNB_id],
+                                    ue->transmission_mode[eNB_id]));*/
     *len=4;
     return(sinr2cqi((double)ue->measurements.wideband_cqi_avg[eNB_id],
         ue->transmission_mode[eNB_id]));
   }
   else { // Mode 1-1 feedback, later
+          //LOG_I(PHY,"compute CQI value, TM %d, length 0, Cqi Avg 0 \n", ue->transmission_mode[eNB_id]);
     *len=0;
     // 2-antenna ports RI=1, 6 bits (2 PMI, 4 CQI)
 
@@ -1684,6 +1983,10 @@ void get_pucch_param(PHY_VARS_UE    *ue,
     case pucch_format2b:
         LOG_E(PHY,"NO Resource available for PUCCH 2a/2b \n");
     break;
+
+    case pucch_format3:
+      fprintf(stderr, "PUCCH format 3 not handled\n");
+      abort();
     }
 }
 
@@ -1771,19 +2074,21 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
       }
   }
 
-  ack_status_cw0 = reset_ack(&ue->frame_parms,
+  ack_status_cw0 = get_ack(&ue->frame_parms,
                        ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack,
                        subframe_tx,
+                       proc->subframe_rx,
                        pucch_ack_payload,
                        0);
 
-  ack_status_cw1 = reset_ack(&ue->frame_parms,
+  ack_status_cw1 = get_ack(&ue->frame_parms,
                        ue->dlsch[proc->subframe_rx&0x1][eNB_id][1]->harq_ack,
                        subframe_tx,
+                       proc->subframe_rx,
                        pucch_ack_payload,
                        1);
 
-  nb_cw = ack_status_cw0 + ack_status_cw1;
+  nb_cw = ( (ack_status_cw0 != 0) ? 1:0) + ( (ack_status_cw1 != 0) ? 1:0);
 
   cqi_status = ((ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PMI_ConfigIndex>0)&&
       (is_cqi_TXOp(ue,proc,eNB_id)==1));
@@ -1793,7 +2098,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
 
   // Part - II
   // if nothing to report ==> exit function
-  if( (nb_cw==0) && (SR_payload==0) && (cqi_status==0) && (ri_status==0))
+  if( (nb_cw==0) && (SR_payload==0) && (cqi_status==0) && (ri_status==0) )
   {
       LOG_D(PHY,"PUCCH No feedback AbsSubframe %d.%d SR_payload %d nb_cw %d pucch_ack_payload[0] %d pucch_ack_payload[1] %d cqi_status %d Return \n",
             frame_tx%1024, subframe_tx, SR_payload, nb_cw, pucch_ack_payload[0], pucch_ack_payload[1], cqi_status);
@@ -1820,7 +2125,8 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
                   (uint8_t *)&pucch_payload,
                   &len);
 
-  LOG_D(PHY,"PUCCH feedback AbsSubframe %d.%d SR %d NbCW %d AckNack %d.%d CQI %d RI %d format %d pucch_resource %d pucch_payload %d %d \n",
+  LOG_D(PHY,"PUCCH feedback AbsSubframe %d.%d SR %d NbCW %d (%d %d) AckNack %d.%d CQI %d RI %d format %d pucch_resource %d pucch_payload %d %d \n",
+          frame_tx%1024, subframe_tx, SR_payload, nb_cw, ack_status_cw0, ack_status_cw1, pucch_ack_payload[0], pucch_ack_payload[1], cqi_status, ri_status, format, pucch_resource,pucch_payload[0],pucch_payload[1]);
 
           frame_tx%1024, subframe_tx, SR_payload, nb_cw, pucch_ack_payload[0], pucch_ack_payload[1], cqi_status, ri_status, format, pucch_resource,pucch_payload[0],pucch_payload[1]);
 
@@ -1985,13 +2291,13 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
   break;
 
   case pucch_format2a:
-      LOG_I(PHY,"[UE  %d][RNTI %x] AbsSubFrame %d.%d Generating PUCCH 2a (RI or CQI) Ack/Nack 1bit \n",
+      LOG_D(PHY,"[UE  %d][RNTI %x] AbsSubFrame %d.%d Generating PUCCH 2a (RI or CQI) Ack/Nack 1bit \n",
               Mod_id,
               ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->rnti,
               frame_tx%1024, subframe_tx);
       break;
   case pucch_format2b:
-      LOG_I(PHY,"[UE  %d][RNTI %x] AbsSubFrame %d.%d Generating PUCCH 2b (RI or CQI) Ack/Nack 2bits\n",
+      LOG_D(PHY,"[UE  %d][RNTI %x] AbsSubFrame %d.%d Generating PUCCH 2b (RI or CQI) Ack/Nack 2bits\n",
               Mod_id,
               ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->rnti,
               frame_tx%1024, subframe_tx);
@@ -2136,17 +2442,33 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui
   }
 
   // reset DL ACK/NACK status
+  uint8_t N_bundled = 0;
   if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0] != NULL)
+  {
     reset_ack(&ue->frame_parms,
                ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack,
                subframe_tx,
-               ue->ulsch[eNB_id]->o_ACK,0);
+               proc->subframe_rx,
+               ue->ulsch[eNB_id]->o_ACK,
+               &N_bundled,
+               0);
+    reset_ack(&ue->frame_parms,
+               ue->dlsch[(proc->subframe_rx+1)&0x1][eNB_id][0]->harq_ack,
+               subframe_tx,
+               proc->subframe_rx,
+               ue->ulsch[eNB_id]->o_ACK,
+               &N_bundled,
+               0);
+  }
 
   if (ue->dlsch_SI[eNB_id] != NULL)
     reset_ack(&ue->frame_parms,
              ue->dlsch_SI[eNB_id]->harq_ack,
              subframe_tx,
-             ue->ulsch[eNB_id]->o_ACK,0);
+             proc->subframe_rx,
+             ue->ulsch[eNB_id]->o_ACK,
+             &N_bundled,
+             0);
 
 
   VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT);
@@ -2182,6 +2504,7 @@ void ue_measurement_procedures(
     uint16_t slot, // slot index of each radio frame [0..19]
     uint8_t abstraction_flag,runmode_t mode)
 {
+  //LOG_I(PHY,"ue_measurement_procedures l %d Ncp %d\n",l,ue->frame_parms.Ncp);
 
   LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms;
 
@@ -2224,6 +2547,7 @@ void ue_measurement_procedures(
   if (l==(6-ue->frame_parms.Ncp)) {
 
     // make sure we have signal from PSS/SSS for N0 measurement
+         // LOG_I(PHY," l==(6-ue->frame_parms.Ncp) ue_rrc_measurements\n");
 
     VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_RRC_MEASUREMENTS, VCD_FUNCTION_IN);
     ue_rrc_measurements(ue,
@@ -3133,6 +3457,48 @@ void ue_pmch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,int eNB_id,int abs
   } // is_pmch_subframe=true
 }
 
+void copy_harq_proc_struct(LTE_DL_UE_HARQ_t *harq_processes_dest, LTE_DL_UE_HARQ_t *current_harq_processes)
+{
+      harq_processes_dest->B              = current_harq_processes->B              ;
+      harq_processes_dest->C              = current_harq_processes->C              ;
+      harq_processes_dest->Cminus         = current_harq_processes->Cminus         ;
+      harq_processes_dest->Cplus          = current_harq_processes->Cplus          ;
+      harq_processes_dest->DCINdi         = current_harq_processes->DCINdi         ;
+      harq_processes_dest->F              = current_harq_processes->F              ;
+      harq_processes_dest->G              = current_harq_processes->G              ;
+      harq_processes_dest->Kminus         = current_harq_processes->Kminus         ;
+      harq_processes_dest->Kplus          = current_harq_processes->Kplus          ;
+      harq_processes_dest->Nl             = current_harq_processes->Nl             ;
+      harq_processes_dest->Qm             = current_harq_processes->Qm             ;
+      harq_processes_dest->TBS            = current_harq_processes->TBS            ;
+      harq_processes_dest->b              = current_harq_processes->b              ;
+      harq_processes_dest->codeword       = current_harq_processes->codeword       ;
+      harq_processes_dest->delta_PUCCH    = current_harq_processes->delta_PUCCH    ;
+      harq_processes_dest->dl_power_off   = current_harq_processes->dl_power_off   ;
+      harq_processes_dest->first_tx       = current_harq_processes->first_tx       ;
+      harq_processes_dest->mcs            = current_harq_processes->mcs            ;
+      harq_processes_dest->mimo_mode      = current_harq_processes->mimo_mode      ;
+      harq_processes_dest->nb_rb          = current_harq_processes->nb_rb          ;
+      harq_processes_dest->pmi_alloc      = current_harq_processes->pmi_alloc      ;
+      harq_processes_dest->rb_alloc_even[0]  = current_harq_processes->rb_alloc_even[0] ;
+      harq_processes_dest->rb_alloc_even[1]  = current_harq_processes->rb_alloc_even[1] ;
+      harq_processes_dest->rb_alloc_even[2]  = current_harq_processes->rb_alloc_even[2] ;
+      harq_processes_dest->rb_alloc_even[3]  = current_harq_processes->rb_alloc_even[3] ;
+      harq_processes_dest->rb_alloc_odd[0]  = current_harq_processes->rb_alloc_odd[0]  ;
+      harq_processes_dest->rb_alloc_odd[1]  = current_harq_processes->rb_alloc_odd[1]  ;
+      harq_processes_dest->rb_alloc_odd[2]  = current_harq_processes->rb_alloc_odd[2]  ;
+      harq_processes_dest->rb_alloc_odd[3]  = current_harq_processes->rb_alloc_odd[3]  ;
+      harq_processes_dest->round          = current_harq_processes->round          ;
+      harq_processes_dest->rvidx          = current_harq_processes->rvidx          ;
+      harq_processes_dest->status         = current_harq_processes->status         ;
+      harq_processes_dest->vrb_type       = current_harq_processes->vrb_type       ;
+}
+
+void copy_ack_struct(harq_status_t *harq_ack_dest, harq_status_t *current_harq_ack)
+{
+    memcpy(harq_ack_dest, current_harq_ack, sizeof(harq_status_t));
+}
+
 void ue_pdsch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, PDSCH_t pdsch, LTE_UE_DLSCH_t *dlsch0, LTE_UE_DLSCH_t *dlsch1, int s0, int s1, int abstraction_flag) {
 
   int subframe_rx = proc->subframe_rx;
@@ -3148,7 +3514,8 @@ void ue_pdsch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, PDSC
 
     if (dlsch0 && (!dlsch1))  {
       harq_pid = dlsch0->current_harq_pid;
-      LOG_D(PHY,"[UE %d] PDSCH active in subframe %d, harq_pid %d\n",ue->Mod_id,subframe_rx,harq_pid);
+      LOG_D(PHY,"[UE %d] PDSCH active in subframe %d, harq_pid %d Symbol %d\n",ue->Mod_id,subframe_rx,harq_pid,m);
+
       if ((pdsch==PDSCH) &&
           (ue->transmission_mode[eNB_id] == 5) &&
           (dlsch0->harq_processes[harq_pid]->dl_power_off==0) &&
@@ -3232,7 +3599,8 @@ void process_rar(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, runmode_t mo
                                                  ue->prach_resources[eNB_id]->ra_RNTI,
                                                  dlsch0->harq_processes[0]->b,
                                                  &ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti,
-                                                 ue->prach_resources[eNB_id]->ra_PreambleIndex);
+                                                 ue->prach_resources[eNB_id]->ra_PreambleIndex,
+                                                 dlsch0->harq_processes[0]->b); // alter the 'b' buffer so it contains only the selected RAR header and RAR payload
 
       ue->pdcch_vars[(subframe_rx+1) & 0x1][eNB_id]->crnti = ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti;
 
@@ -3916,6 +4284,27 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
   }
 
   start_meas(&ue->generic_stat);
+
+#if 0
+  if(subframe_rx==5 &&  ue->dlsch[subframe_rx&0x1][eNB_id][0]->harq_processes[ue->dlsch[subframe_rx&0x1][eNB_id][0]->current_harq_pid]->nb_rb > 20){
+       //write_output("decoder_llr.m","decllr",dlsch_llr,G,1,0);
+       //write_output("llr.m","llr",  &ue->pdsch_vars[eNB_id]->llr[0][0],(14*nb_rb*12*dlsch1_harq->Qm) - 4*(nb_rb*4*dlsch1_harq->Qm),1,0);
+
+       write_output("rxdataF0_current.m"    , "rxdataF0", &ue->common_vars.common_vars_rx_data_per_thread[subframe_rx&0x1].rxdataF[0][0],14*ue->frame_parms.ofdm_symbol_size,1,1);
+       //write_output("rxdataF0_previous.m"    , "rxdataF0_prev_sss", &ue->common_vars.common_vars_rx_data_per_thread[(subframe_rx+1)&0x1].rxdataF[0][0],14*ue->frame_parms.ofdm_symbol_size,1,1);
+
+       //write_output("rxdataF0_previous.m"    , "rxdataF0_prev", &ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)&0x1].rxdataF[0][0],14*ue->frame_parms.ofdm_symbol_size,1,1);
+
+       write_output("dl_ch_estimates.m", "dl_ch_estimates_sfn5", &ue->common_vars.common_vars_rx_data_per_thread[subframe_rx&0x1].dl_ch_estimates[0][0][0],14*ue->frame_parms.ofdm_symbol_size,1,1);
+       write_output("dl_ch_estimates_ext.m", "dl_ch_estimatesExt_sfn5", &ue->pdsch_vars[subframe_rx&0x1][0]->dl_ch_estimates_ext[0][0],14*ue->frame_parms.N_RB_DL*12,1,1);
+       write_output("rxdataF_comp00.m","rxdataF_comp00",         &ue->pdsch_vars[subframe_rx&0x1][0]->rxdataF_comp0[0][0],14*ue->frame_parms.N_RB_DL*12,1,1);
+       //write_output("magDLFirst.m", "magDLFirst", &phy_vars_ue->pdsch_vars[subframe&0x1][0]->dl_ch_mag0[0][0],14*frame_parms->N_RB_DL*12,1,1);
+       //write_output("magDLSecond.m", "magDLSecond", &phy_vars_ue->pdsch_vars[subframe&0x1][0]->dl_ch_magb0[0][0],14*frame_parms->N_RB_DL*12,1,1);
+
+       AssertFatal (0,"");
+  }
+#endif
+
   // do procedures for SI-RNTI
   if ((ue->dlsch_SI[eNB_id]) && (ue->dlsch_SI[eNB_id]->active == 1)) {
     ue_pdsch_procedures(ue,
@@ -3986,6 +4375,18 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
     ue->dlsch_ra[eNB_id]->active = 0;
   }
 
+  // duplicate harq structure
+
+  uint8_t          current_harq_pid        = ue->dlsch[subframe_rx&0x1][eNB_id][0]->current_harq_pid;
+  LTE_DL_UE_HARQ_t *current_harq_processes = ue->dlsch[subframe_rx&0x1][eNB_id][0]->harq_processes[current_harq_pid];
+  LTE_DL_UE_HARQ_t *harq_processes_dest    = ue->dlsch[(subframe_rx+1)&0x1][eNB_id][0]->harq_processes[current_harq_pid];
+
+  harq_status_t *current_harq_ack = &ue->dlsch[subframe_rx&0x1][eNB_id][0]->harq_ack[subframe_rx];
+  harq_status_t *harq_ack_dest    = &ue->dlsch[(subframe_rx+1)&0x1][eNB_id][0]->harq_ack[subframe_rx];
+
+  copy_harq_proc_struct(harq_processes_dest, current_harq_processes);
+  copy_ack_struct(harq_ack_dest, current_harq_ack);
+
   if (subframe_rx==9) {
     if (frame_rx % 10 == 0) {
       if ((ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]) != 0)
diff --git a/openair1/SCHED/pucch_pc.c b/openair1/SCHED/pucch_pc.c
index ae831238622a91fef15d58e9be8d7d0f65ae28a5..92e756fa7376ece8f4cdd0d79bf81e226cbcac74 100644
--- a/openair1/SCHED/pucch_pc.c
+++ b/openair1/SCHED/pucch_pc.c
@@ -31,6 +31,7 @@
  */
 
 #include "PHY/defs.h"
+#include "SCHED/defs.h"
 #include "PHY/LTE_TRANSPORT/proto.h"
 #include "PHY/extern.h"
 
@@ -85,6 +86,10 @@ int16_t pucch_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t subframe,u
     }
 
     break;
+
+  case pucch_format3:
+    fprintf(stderr, "PUCCH format 3 not handled\n");
+    abort();
   }
 
   if (pucch_fmt!=pucch_format1) {
diff --git a/openair1/SIMULATION/ETH_TRANSPORT/multicast_link.c b/openair1/SIMULATION/ETH_TRANSPORT/multicast_link.c
index 306ec12ad28c50b8f9a0ae9609d3203cb9125083..d161da6a74d13ce32e7518f84e428d1ed69a751e 100644
--- a/openair1/SIMULATION/ETH_TRANSPORT/multicast_link.c
+++ b/openair1/SIMULATION/ETH_TRANSPORT/multicast_link.c
@@ -308,10 +308,10 @@ void* multicast_link_main_loop (void *param)
 }
 
 void multicast_link_start(void (*rx_handlerP) (unsigned int, char *),
-                          unsigned char multicast_group, char *multicast_ifname)
+                          unsigned char _multicast_group, char *multicast_ifname)
 {
   rx_handler = rx_handlerP;
-  multicast_group = multicast_group;
+  multicast_group = _multicast_group;
   multicast_if =  multicast_ifname;
   LOG_I(EMU, "[MULTICAST] LINK START on interface=%s for group=%d: handler=%p\n",
         (multicast_if == NULL) ? "not specified" : multicast_if, multicast_group,
diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c
index aa8e9360eaba031b2da454ffa882e76c5f144108..951b5f75f65c9450ee6b32f54308dff21a0c8af7 100644
--- a/openair1/SIMULATION/LTE_PHY/dlsim.c
+++ b/openair1/SIMULATION/LTE_PHY/dlsim.c
@@ -1301,7 +1301,7 @@ int main(int argc, char **argv)
   unsigned int ret;
   unsigned int coded_bits_per_codeword=0,nsymb; //,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;//,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[4]={0,0,0,0};//,num_layers;
   //int re_allocated;
   char fname[32],vname[32];
   FILE *bler_fd;
@@ -1341,7 +1341,7 @@ int main(int argc, char **argv)
   //int iii;
 
   int ch_realization;
-  int pmi_feedback=0;
+  //int pmi_feedback=0;
   int hold_channel=0;
 
   // void *data;
@@ -1379,6 +1379,7 @@ int main(int argc, char **argv)
   uint8_t Kmimo;
   uint8_t ue_category=4;
   uint32_t Nsoft;
+  int sf;
 
 
 
@@ -1390,7 +1391,7 @@ int main(int argc, char **argv)
 
   FILE *csv_fd=NULL;
   char csv_fname[32];
-  int dci_flag=1;
+  //int dci_flag=1;
   int two_thread_flag=0;
   int DLSCH_RB_ALLOC = 0;
 
@@ -1452,9 +1453,9 @@ int main(int argc, char **argv)
       Nid_cell = atoi(optarg);
       break;
 
-    case 'd':
-      dci_flag = 1;
-      break;
+    //case 'd':
+    //  dci_flag = 1;
+    //  break;
 
     case 'D':
       frame_type=TDD;
@@ -1481,7 +1482,7 @@ int main(int argc, char **argv)
     case 'i':
       input_fd = fopen(optarg,"r");
       input_file=1;
-      dci_flag = 1;
+      //dci_flag = 1;
       break;
 
     case 'I':
@@ -1998,7 +1999,7 @@ int main(int argc, char **argv)
     }
   */
 
-  UE->pdcch_vars[0][0]->crnti = n_rnti;
+  UE->pdcch_vars[subframe & 0x1][0]->crnti = n_rnti;
 
   // Fill in UL_alloc
   UL_alloc_pdu.type    = 0;
@@ -2104,15 +2105,22 @@ int main(int argc, char **argv)
     }
   }
 
-  for (i=0; i<2; i++) {
-    UE->dlsch[subframe&0x1][0][i]  = new_ue_dlsch(Kmimo,8,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0);
+  /* allocate memory for both subframes (only one is really used
+   * but there is now "copy_harq_proc_struct" which needs both
+   * to be valid)
+   * TODO: refine this somehow (necessary?)
+   */
+  for (sf = 0; sf < 2; sf++) {
+    for (i=0; i<2; i++) {
+      UE->dlsch[sf][0][i]  = new_ue_dlsch(Kmimo,8,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0);
 
-    if (!UE->dlsch[subframe&0x1][0][i]) {
-      printf("Can't get ue dlsch structures\n");
-      exit(-1);
-    }
+      if (!UE->dlsch[sf][0][i]) {
+        printf("Can't get ue dlsch structures\n");
+        exit(-1);
+      }
 
-    UE->dlsch[subframe&0x1][0][i]->rnti   = n_rnti;
+      UE->dlsch[sf][0][i]->rnti   = n_rnti;
+    }
   }
 
     UE->dlsch_SI[0]  = new_ue_dlsch(1,1,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0);
@@ -2246,7 +2254,10 @@ int main(int argc, char **argv)
       round_trials[2] = 0;
       round_trials[3] = 0;
 
-      dci_errors=0;
+      dci_errors[0]=0;
+      dci_errors[1]=0;
+      dci_errors[2]=0;
+      dci_errors[3]=0;
       //      avg_ber = 0;
 
       round=0;
@@ -2314,10 +2325,10 @@ int main(int argc, char **argv)
 	  //	  printf("Trial %d, round %d\n",trials,round);
           round_trials[round]++;
 
-          if(transmission_mode>=5)
-            pmi_feedback=1;
-          else
-            pmi_feedback=0;
+          //if(transmission_mode>=5)
+          //  pmi_feedback=1;
+          //else
+          //  pmi_feedback=0;
 
           if (abstx) {
             if (trials==0 && round==0 && SNR==snr0)  //generate a new channel
@@ -2499,6 +2510,9 @@ int main(int argc, char **argv)
 
 	  if (UE->dlsch[subframe&0x1][0][0]->active == 0) {
 	    //printf("DCI not received\n");
+	    dci_errors[round]++;
+	    UE->dlsch_errors[0] = 1;
+
 	    /*
 	    write_output("pdcchF0_ext.m","pdcchF_ext", UE->pdcch_vars[eNB_id]->rxdataF_ext[0],2*3*UE->frame_parms.ofdm_symbol_size,1,1);
 	    write_output("pdcch00_ch0_ext.m","pdcch00_ch0_ext",UE->pdcch_vars[eNB_id]->dl_ch_estimates_ext[0],12*UE->frame_parms.N_RB_DL*3,1,1);
@@ -2837,13 +2851,13 @@ int main(int argc, char **argv)
       double std_phy_proc_rx_demod=0;
       double std_phy_proc_rx_dec=0;
 
-      effective_rate = ((double)(round_trials[0]-dci_errors)/((double)round_trials[0] + round_trials[1] + round_trials[2] + round_trials[3]));
+      effective_rate = 1.0-((double)(errs[0]+errs[1]+errs[2]+errs[3])/((double)round_trials[0] + round_trials[1] + round_trials[2] + round_trials[3]));
 
       printf("\n**********************SNR = %f dB (tx_lev %f)**************************\n",
              SNR,
              (double)tx_lev_dB+10*log10(UE->frame_parms.ofdm_symbol_size/(NB_RB*12)));
 
-      printf("Errors (%d(%d)/%d %d/%d %d/%d %d/%d), Pe = (%e,%e,%e,%e), dci_errors %d/%d, Pe = %e => effective rate %f  (%2.1f%%,%f, %f), normalized delay %f (%f)\n",
+      printf("Errors (%d(%d)/%d %d/%d %d/%d %d/%d), Pe = (%e,%e,%e,%e), dci_errors %d/%d, Pe = %e => effective rate %f, normalized delay %f (%f)\n",
              errs[0],
              errs2[0],
              round_trials[0],
@@ -2857,13 +2871,13 @@ int main(int argc, char **argv)
              (double)errs[1]/(round_trials[0]),
              (double)errs[2]/(round_trials[0]),
              (double)errs[3]/(round_trials[0]),
-             dci_errors,
-             round_trials[0],
-             (double)dci_errors/(round_trials[0]),
-             rate*effective_rate,
+             dci_errors[0]+dci_errors[1]+dci_errors[2]+dci_errors[3],
+             round_trials[0]+round_trials[1]+round_trials[2]+round_trials[3],
+             (double)(dci_errors[0]+dci_errors[1]+dci_errors[2]+dci_errors[3])/(round_trials[0]+round_trials[1]+round_trials[2]+round_trials[3]),
+             //rate*effective_rate,
              100*effective_rate,
-             rate,
-             rate*get_Qm(UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->mcs),
+             //rate,
+             //rate*get_Qm(UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->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)eNB->dlsch[0][0]->harq_processes[0]->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]));
@@ -2986,7 +3000,7 @@ int main(int argc, char **argv)
                 round_trials[2],
                 errs[3],
                 round_trials[3],
-                dci_errors);
+                dci_errors[0]);
       } else {
         fprintf(bler_fd,"%f;%d;%d;%d;%d;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d\n",
                 SNR,
@@ -3002,7 +3016,7 @@ int main(int argc, char **argv)
                 round_trials[2],
                 errs[3],
                 round_trials[3],
-                dci_errors);
+                dci_errors[0]);
       }
 
 
@@ -3035,7 +3049,7 @@ int main(int argc, char **argv)
                   round_trials[2],
                   errs[3],
                   round_trials[3],
-                  dci_errors);
+                  dci_errors[0]);
 
           //fprintf(time_meas_fd,"SNR; MCS; TBS; rate; DL_DECOD_ITER; err0; trials0; err1; trials1; err2; trials2; err3; trials3; PE; dci_err;PE;ND;\n");
           fprintf(time_meas_fd,"%f;%d;%d;%f; %2.1f%%;%f;%f;%d;%d;%d;%d;%d;%d;%d;%d;%e;%e;%e;%e;%d;%d;%e;%f;%f;",
@@ -3058,9 +3072,9 @@ int main(int argc, char **argv)
                   (double)errs[1]/(round_trials[0]),
                   (double)errs[2]/(round_trials[0]),
                   (double)errs[3]/(round_trials[0]),
-                  dci_errors,
+                  dci_errors[0],
                   round_trials[0],
-                  (double)dci_errors/(round_trials[0]),
+                  (double)dci_errors[0]/(round_trials[0]),
                   (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)eNB->dlsch[0][0]->harq_processes[0]->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]));
@@ -3079,7 +3093,7 @@ int main(int argc, char **argv)
                   round_trials[2],
                   errs[3],
                   round_trials[3],
-                  dci_errors);
+                  dci_errors[0]);
 
           //fprintf(time_meas_fd,"SNR; MCS; TBS; rate; DL_DECOD_ITER; err0; trials0; err1; trials1; err2; trials2; err3; trials3; PE; dci_err;PE;ND;\n");
           fprintf(time_meas_fd,"%f;%d;%d;%d;%d;%f;%2.1f;%f;%f;%d;%d;%d;%d;%d;%d;%d;%d;%e;%e;%e;%e;%d;%d;%e;%f;%f;",
@@ -3103,9 +3117,9 @@ int main(int argc, char **argv)
                   (double)errs[1]/(round_trials[0]),
                   (double)errs[2]/(round_trials[0]),
                   (double)errs[3]/(round_trials[0]),
-                  dci_errors,
+                  dci_errors[0],
                   round_trials[0],
-                  (double)dci_errors/(round_trials[0]),
+                  (double)dci_errors[0]/(round_trials[0]),
                   (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)eNB->dlsch[0][0]->harq_processes[0]->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/LTE_PHY/pdcchsim.c b/openair1/SIMULATION/LTE_PHY/pdcchsim.c
index 4c50aaa5d540ca3c18a7718ff6f904db7844c26d..2b13449c6172498a3ee2c07fd49ec41e2fb9b7e5 100644
--- a/openair1/SIMULATION/LTE_PHY/pdcchsim.c
+++ b/openair1/SIMULATION/LTE_PHY/pdcchsim.c
@@ -653,6 +653,7 @@ int main(int argc, char **argv)
       printf("-h This message\n");
       printf("-a Use AWGN channel and not multipath\n");
       printf("-c TDD config\n");
+      printf("-S Subframe number (0..9)\n");
       printf("-R N_RB_DL\n");
       printf("-F use FDD frame\n");
       printf("-p Use extended prefix mode\n");
diff --git a/openair1/SIMULATION/LTE_PHY/pucchsim.c b/openair1/SIMULATION/LTE_PHY/pucchsim.c
index d1db3c29e13067486b16e628d5820c58b270f3cc..3869851f712d875c09f6c8bbd82db821eda52fb7 100644
--- a/openair1/SIMULATION/LTE_PHY/pucchsim.c
+++ b/openair1/SIMULATION/LTE_PHY/pucchsim.c
@@ -85,11 +85,13 @@ int main(int argc, char **argv)
 
   //  double pucch_sinr;
   uint8_t osf=1,N_RB_DL=25;
-  uint32_t pucch_tx=0,pucch1_missed=0,pucch1_false=0,sig;
+  uint32_t pucch_tx=0,pucch1_missed=0,pucch1_false=0,pucch3_false=0,sig;
   PUCCH_FMT_t pucch_format = pucch_format1;
   PUCCH_CONFIG_DEDICATED pucch_config_dedicated;
   uint8_t subframe=0;
   uint8_t pucch_payload,pucch_payload_rx;
+  uint8_t pucch3_payload_size=7;
+  uint8_t pucch3_payload[21],pucch3_payload_rx[21];
   double tx_gain=1.0;
   int32_t stat;
   double stat_no_sig,stat_sig;
@@ -98,6 +100,9 @@ int main(int argc, char **argv)
 
   uint16_t n1_pucch = 0;
   uint16_t n2_pucch = 0;
+  uint16_t n3_pucch = 20;
+  
+  uint16_t n_rnti=0x1234;
 
   number_of_cards = 1;
 
@@ -118,6 +123,8 @@ int main(int argc, char **argv)
         pucch_format = pucch_format1a;
       else if (atoi(optarg)==2)
         pucch_format = pucch_format1b;
+      else if (atoi(optarg)==6) // 3,4,5 is reserved for format2,2a,2b
+        pucch_format = pucch_format3;
       else {
         printf("Unsupported pucch_format %d\n",atoi(optarg));
         exit(-1);
@@ -282,7 +289,7 @@ int main(int argc, char **argv)
       printf("-N Noise variance in dB\n");
       printf("-R N_RB_DL\n");
       printf("-O oversampling factor (1,2,4,8,16)\n");
-      printf("-f PUCCH format (0=1,1=1a,2=1b), formats 2/2a/2b not supported\n");
+      printf("-f PUCCH format (0=1,1=1a,2=1b,6=3), formats 2/2a/2b not supported\n");
       printf("-F Input filename (.txt format) for RX conformance testing\n");
       exit (-1);
       break;
@@ -362,18 +369,34 @@ int main(int argc, char **argv)
   UE->frame_parms.pucch_config_common.nRB_CQI          = 4;
   UE->frame_parms.pucch_config_common.nCS_AN           = 6;
 
-  pucch_payload = 0;
-
-  generate_pucch1x(UE->common_vars.txdataF,
-		   frame_parms,
-		   UE->ncs_cell,
-		   pucch_format,
-		   &pucch_config_dedicated,
-		   n1_pucch,
-		   0, //shortened_format,
-		   &pucch_payload,
-		   AMP, //amp,
-		   subframe); //subframe
+
+  if( (pucch_format == pucch_format1) || (pucch_format == pucch_format1a) || (pucch_format == pucch_format1b) ){
+    pucch_payload = 0;
+    generate_pucch1x(UE->common_vars.txdataF,
+  		   frame_parms,
+  		   UE->ncs_cell,
+  		   pucch_format,
+  		   &pucch_config_dedicated,
+  		   n1_pucch,
+  		   0, //shortened_format,
+  		   &pucch_payload,
+  		   AMP, //amp,
+  		   subframe); //subframe
+  }else if( pucch_format == pucch_format3){
+    for(i=0;i<pucch3_payload_size;i++)
+      pucch3_payload[i]=(uint8_t)(taus()&0x1);
+    generate_pucch3x(UE->common_vars.txdataF,
+  		   frame_parms,
+  		   UE->ncs_cell,
+  		   pucch_format,
+  		   &pucch_config_dedicated,
+  		   n3_pucch,
+  		   0, //shortened_format,
+  		   pucch3_payload,
+  		   AMP, //amp,
+  		   subframe, //subframe
+         n_rnti);  //rnti
+  }
   write_output("txsigF0.m","txsF0", &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;
@@ -429,6 +452,7 @@ int main(int argc, char **argv)
     pucch_tx = 0;
     pucch1_missed=0;
     pucch1_false=0;
+    pucch3_false=0;
 
     stat_no_sig = 0;
     stat_sig = 0;
@@ -540,7 +564,7 @@ int main(int argc, char **argv)
                         n1_pucch,
                         n2_pucch,
                         0, //shortened_format,
-                        &pucch_payload_rx, //payload,
+                        (pucch_format==pucch_format3) ? pucch3_payload_rx : &pucch_payload_rx, //payload,
                         0 /* frame not defined, let's pass 0 */,
                         subframe,
                         pucch1_thres);
@@ -561,8 +585,15 @@ int main(int argc, char **argv)
           printf("EXIT\n");
           exit(-1);
           }*/
-        } else {
+        } else if( (pucch_format==pucch_format1a) || (pucch_format==pucch_format1b) ) {
           pucch1_false = (pucch_payload_rx != pucch_payload) ? (pucch1_false+1) : pucch1_false;
+        } else if (pucch_format==pucch_format3){
+          for(i=0;i<pucch3_payload_size;i++){
+            if(pucch3_payload[i]!=pucch3_payload_rx[i]){
+              pucch3_false = (pucch3_false+1);
+              break;
+            }
+          }
         }
 
         //      printf("sig %d\n",sig);
@@ -576,7 +607,8 @@ int main(int argc, char **argv)
       printf("pucch_trials %d : pucch1a_errors %d\n",pucch_tx,pucch1_false);
     else if (pucch_format==pucch_format1b)
       printf("pucch_trials %d : pucch1b_errors %d\n",pucch_tx,pucch1_false);
-
+    else if (pucch_format==pucch_format3)
+      printf("pucch_trials %d : pucch3_errors %d\n",pucch_tx,pucch3_false);
   }
 
   if (n_frames==1) {
diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c
index f3abbb7e3def69fe995d6ccee869200cb6d1414c..dbce85851695fb10b49f1a655221806ac2b93a02 100644
--- a/openair1/SIMULATION/LTE_PHY/ulsim.c
+++ b/openair1/SIMULATION/LTE_PHY/ulsim.c
@@ -253,7 +253,7 @@ int main(int argc, char **argv)
 
   uint8_t N_RB_DL=25,osf=1;
 
-  uint8_t cyclic_shift = 0;
+  //uint8_t cyclic_shift = 0;
   uint8_t cooperation_flag = 0; //0 no cooperation, 1 delay diversity, 2 Alamouti
   uint8_t beta_ACK=0,beta_RI=0,beta_CQI=2;
   uint8_t tdd_config=3,frame_type=FDD;
@@ -275,6 +275,7 @@ int main(int argc, char **argv)
   uint8_t max_turbo_iterations=4;
   uint8_t parallel_flag=0;
   int nb_rb_set = 0;
+  int sf;
 
   int threequarter_fs=0;
   int ndi;
@@ -462,9 +463,9 @@ int main(int argc, char **argv)
       first_rb = atoi(optarg);
       break;
 
-    case 'c':
-      cyclic_shift = atoi(optarg);
-      break;
+    //case 'c':
+    //  cyclic_shift = atoi(optarg);
+    //  break;
 
     case 'E':
       threequarter_fs=1;
@@ -556,7 +557,9 @@ int main(int argc, char **argv)
 
     case 'h':
     default:
-      printf("%s -h(elp) -a(wgn on) -m mcs -n n_frames -s snr0 -t delay_spread -p (extended prefix on) -r nb_rb -f first_rb -c cyclic_shift -o (srs on) -g channel_model [A:M] Use 3GPP 25.814 SCM-A/B/C/D('A','B','C','D') or 36-101 EPA('E'), EVA ('F'),ETU('G') models (ignores delay spread and Ricean factor), Rayghleigh8 ('H'), Rayleigh1('I'), Rayleigh1_corr('J'), Rayleigh1_anticorr ('K'), Rice8('L'), Rice1('M'), -d Channel delay, -D maximum Doppler shift \n",
+      /* option "-c cyclic_shift" is not used, let's remove from documentation */
+      //printf("%s -h(elp) -a(wgn on) -m mcs -n n_frames -s snr0 -t delay_spread -p (extended prefix on) -r nb_rb -f first_rb -c cyclic_shift -o (srs on) -g channel_model [A:M] Use 3GPP 25.814 SCM-A/B/C/D('A','B','C','D') or 36-101 EPA('E'), EVA ('F'),ETU('G') models (ignores delay spread and Ricean factor), Rayghleigh8 ('H'), Rayleigh1('I'), Rayleigh1_corr('J'), Rayleigh1_anticorr ('K'), Rice8('L'), Rice1('M'), -d Channel delay, -D maximum Doppler shift \n",
+      printf("%s -h(elp) -a(wgn on) -m mcs -n n_frames -s snr0 -t delay_spread -p (extended prefix on) -r nb_rb -f first_rb -o (srs on) -g channel_model [A:M] Use 3GPP 25.814 SCM-A/B/C/D('A','B','C','D') or 36-101 EPA('E'), EVA ('F'),ETU('G') models (ignores delay spread and Ricean factor), Rayghleigh8 ('H'), Rayleigh1('I'), Rayleigh1_corr('J'), Rayleigh1_anticorr ('K'), Rice8('L'), Rice1('M'), -d Channel delay, -D maximum Doppler shift \n",
              argv[0]);
       exit(1);
       break;
@@ -709,22 +712,27 @@ int main(int argc, char **argv)
   // Create transport channel structures for 2 transport blocks (MIMO)
   for (i=0; i<2; i++) {
     eNB->dlsch[0][i] = new_eNB_dlsch(1,8,1827072,N_RB_DL,0,&eNB->frame_parms);
-    UE->dlsch[subframe&1][0][i]  = new_ue_dlsch(1,8,1827072,MAX_TURBO_ITERATIONS,N_RB_DL,0);
-
     if (!eNB->dlsch[0][i]) {
       printf("Can't get eNB dlsch structures\n");
       exit(-1);
     }
-
-    if (!UE->dlsch[subframe&1][0][i]) {
-      printf("Can't get ue dlsch structures\n");
-      exit(-1);
-    }
-
     eNB->dlsch[0][i]->rnti = 14;
-    UE->dlsch[subframe&1][0][i]->rnti   = 14;
-
-  } 
+  }
+  /* allocate memory for both subframes (only one is really used
+   * but there is now "copy_harq_proc_struct" which needs both
+   * to be valid)
+   * TODO: refine this somehow (necessary?)
+   */
+  for (sf = 0; sf < 2; sf++) {
+    for (i=0; i<2; i++) {
+      UE->dlsch[sf][0][i]  = new_ue_dlsch(1,8,1827072,MAX_TURBO_ITERATIONS,N_RB_DL,0);
+      if (!UE->dlsch[sf][0][i]) {
+        printf("Can't get ue dlsch structures\n");
+        exit(-1);
+      }
+      UE->dlsch[sf][0][i]->rnti   = 14;
+    }
+  }
 
   UE->dlsch_SI[0]  = new_ue_dlsch(1,1,1827072,MAX_TURBO_ITERATIONS,N_RB_DL,0);
   UE->dlsch_ra[0]  = new_ue_dlsch(1,1,1827072,MAX_TURBO_ITERATIONS,N_RB_DL,0);
diff --git a/openair1/SIMULATION/TOOLS/random_channel.c b/openair1/SIMULATION/TOOLS/random_channel.c
index ea8781e216943e6d6f9b0b1eeab9d6becf0b2c21..98988ea4cb88097ae89d4b64586e610c8bf7e205 100644
--- a/openair1/SIMULATION/TOOLS/random_channel.c
+++ b/openair1/SIMULATION/TOOLS/random_channel.c
@@ -101,7 +101,7 @@ void fill_channel_desc(channel_desc_t *chan_desc,
 
   LOG_D(OCM,"[CHANNEL] Filling a (nb_taps %d)\n",nb_taps);
   for (i = 0; i<nb_taps; i++) {
-    LOG_D(OCM,"tap %d (%p,%d)\n",i,&chan_desc->a[i],nb_tx*nb_rx * sizeof(struct complex));
+    LOG_D(OCM,"tap %d (%p,%zu)\n",i,&chan_desc->a[i],nb_tx*nb_rx * sizeof(struct complex));
     chan_desc->a[i]         = (struct complex*) malloc(nb_tx*nb_rx * sizeof(struct complex));
   }
 
diff --git a/openair2/COMMON/mac_rrc_primitives.h b/openair2/COMMON/mac_rrc_primitives.h
index 79172276f5d51b5e22a7f9afa68d157556cdc407..9a8c363b02a23c5ef8a77761a4fba3b70c146f8f 100644
--- a/openair2/COMMON/mac_rrc_primitives.h
+++ b/openair2/COMMON/mac_rrc_primitives.h
@@ -388,9 +388,9 @@ typedef struct {
                             struct PMCH_InfoList_r9 *pmch_InfoList
 #endif
                            );
-  unsigned int (*mac_rlc_data_req)(module_id_t, unsigned int, char*);
+  unsigned int (*mac_rlc_data_req)(module_id_t, unsigned int, const unsigned int,char*);
   void (*mac_rlc_data_ind)(module_id_t, logical_chan_id_t, char*, tb_size_t, num_tb_t, crc_t* );
-  mac_rlc_status_resp_t (*mac_rlc_status_ind)     (module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t frameP, eNB_flag_t eNB_flagP, MBMS_flag_t MBMS_flagP,
+  mac_rlc_status_resp_t (*mac_rlc_status_ind)     (module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t frameP, sub_frame_t subframeP, eNB_flag_t eNB_flagP, MBMS_flag_t MBMS_flagP,
       logical_chan_id_t channel_idP, tb_size_t tb_sizeP);
   signed int (*rrc_rlc_data_req)(module_id_t, rb_id_t, mui_t, confirm_t, sdu_size_t, char *);
   void (*rrc_rlc_register_rrc) (void (*rrc_data_indP)(module_id_t , rb_id_t , sdu_size_t , char* ),
diff --git a/openair2/ENB_APP/flexran_agent_common.c b/openair2/ENB_APP/flexran_agent_common.c
index f2d00145a05c9f752db5544fc14f35acb0ef9d86..073bb8029cfca92266973a5b172f028001c08900 100644
--- a/openair2/ENB_APP/flexran_agent_common.c
+++ b/openair2/ENB_APP/flexran_agent_common.c
@@ -562,14 +562,16 @@ int flexran_get_ue_wcqi (mid_t mod_id, mid_t ue_id) {
 int flexran_get_tx_queue_size(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id) {
   rnti_t rnti = flexran_get_ue_crnti(mod_id,ue_id);
   uint16_t frame = (uint16_t) flexran_get_current_frame(mod_id);
-  mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id,rnti, mod_id,frame,ENB_FLAG_YES,MBMS_FLAG_NO, channel_id, 0);
+  uint16_t subframe = (uint16_t) flexran_get_current_subframe(mod_id);
+  mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id,rnti, mod_id,frame,subframe,ENB_FLAG_YES,MBMS_FLAG_NO, channel_id, 0);
   return rlc_status.bytes_in_buffer;
 }
 
 int flexran_get_hol_delay(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id) {
   rnti_t rnti = flexran_get_ue_crnti(mod_id,ue_id);
   uint16_t frame = (uint16_t) flexran_get_current_frame(mod_id);
-  mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id, rnti, mod_id, frame, ENB_FLAG_YES, MBMS_FLAG_NO, channel_id, 0);
+  uint16_t subframe = (uint16_t) flexran_get_current_subframe(mod_id);
+  mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id, rnti, mod_id, frame, subframe, ENB_FLAG_YES, MBMS_FLAG_NO, channel_id, 0);
   return rlc_status.head_sdu_creation_time;
 }
 
diff --git a/openair2/LAYER2/MAC/config.c b/openair2/LAYER2/MAC/config.c
index 12dbeecf16fcc7431953e46dc58fbefa80409664..ecbe0b68bae612c1e2a334fb191123a6d3a7b01b 100644
--- a/openair2/LAYER2/MAC/config.c
+++ b/openair2/LAYER2/MAC/config.c
@@ -332,15 +332,17 @@ rrc_mac_config_req(
   if (eNB_flagP == 0) {
     if (measObj!= NULL) {
       if (measObj[0]!= NULL) {
-        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);
+        if (measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList != NULL) {
+          UE_mac_inst[Mod_idP].n_adj_cells = measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList->list.count;
+          LOG_D(MAC,"Number of adjacent cells %d\n",UE_mac_inst[Mod_idP].n_adj_cells);
 
-        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]);
-        }
+          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_D(MAC,"Cell %d : Nid_cell %d\n",i,UE_mac_inst[Mod_idP].adj_cell_id[i]);
+          }
 
-        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);
+          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);
+          }
       }
 
       /*
diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c
index 6509471124a52a4d3efe011c203e6b6c6d0f225b..e7fbbce3c9507ad16380810adde1fc9a9cda1478 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler.c
@@ -140,10 +140,14 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
 
     rnti = UE_RNTI(module_idP, i);
     CC_id = UE_PCCID(module_idP, i);
-    if ((frameP==0)&&(subframeP==0))
-      LOG_I(MAC,"UE  rnti %x : %s, PHR %d dB\n", rnti, 
-	    UE_list->UE_sched_ctrl[i].ul_out_of_sync==0 ? "in synch" : "out of sync",
-	    UE_list->UE_template[CC_id][i].phr_info);
+    if ((frameP==0)&&(subframeP==0)) {
+      LTE_eNB_UE_stats *eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP, CC_id, rnti);
+      int cqi = eNB_UE_stats == NULL ? -1 : eNB_UE_stats->DL_cqi[0];
+      LOG_I(MAC,"UE  rnti %x : %s, PHR %d dB CQI %d\n", rnti,
+            UE_list->UE_sched_ctrl[i].ul_out_of_sync==0 ? "in synch" : "out of sync",
+            UE_list->UE_template[CC_id][i].phr_info,
+            cqi);
+    }
 
     PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_bsr[i][(frameP*10)+subframeP]=-63;
     if (i==UE_list->head)
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
old mode 100644
new mode 100755
index a15e6bbdaed9fa3b020162c221de5c8def28ae9a..68f99bf7218013ee44148f411982a6c739a57819
--- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
@@ -426,8 +426,8 @@ schedule_ue_spec(
   int                   N_RBG[MAX_NUM_CCs];
   unsigned char         aggregation;
   mac_rlc_status_resp_t rlc_status;
-  unsigned char         header_len_dcch=0, header_len_dcch_tmp=0;
-  unsigned char         header_len_dtch=0, header_len_dtch_tmp=0, header_len_dtch_last=0;
+  unsigned char         header_len_dcch=0, header_len_dcch_tmp=0; 
+  unsigned char         header_len_dtch=0, header_len_dtch_tmp=0, header_len_dtch_last=0; 
   unsigned char         ta_len=0;
   unsigned char         sdu_lcids[NB_RB_MAX],lcid,offset,num_sdus=0;
   uint16_t              nb_rb,nb_rb_temp,total_nb_available_rb[MAX_NUM_CCs],nb_available_rb;
@@ -472,7 +472,7 @@ schedule_ue_spec(
     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]--;
+	total_nb_available_rb[CC_id]--;
 
     N_RBG[CC_id] = frame_parms[CC_id]->N_RBG;
 
@@ -520,25 +520,27 @@ schedule_ue_spec(
         //  mac_xface->macphy_exit("[MAC][eNB] Cannot find eNB_UE_stats\n");
         continue_flag=1;
       }
-      
-      switch(mac_xface->get_transmission_mode(module_idP,CC_id,rnti)){
-      case 1:
-      case 2:
-      case 7:
-	aggregation = get_aggregation(get_bw_index(module_idP,CC_id), 
+
+      if (continue_flag != 1){
+        switch(mac_xface->get_transmission_mode(module_idP,CC_id,rnti)){
+        case 1:
+        case 2:
+        case 7:
+	  aggregation = get_aggregation(get_bw_index(module_idP,CC_id), 
 				      eNB_UE_stats->DL_cqi[0],
 				      format1);
-	break;
-      case 3:
-	aggregation = get_aggregation(get_bw_index(module_idP,CC_id), 
+	  break;
+        case 3:
+	  aggregation = get_aggregation(get_bw_index(module_idP,CC_id), 
 				      eNB_UE_stats->DL_cqi[0],
 				      format2A);
-	break;
-      default:
-	LOG_W(MAC,"Unsupported transmission mode %d\n", mac_xface->get_transmission_mode(module_idP,CC_id,rnti));
-	aggregation = 2;
-      }
-      
+	  break;
+        default:
+	  LOG_W(MAC,"Unsupported transmission mode %d\n", mac_xface->get_transmission_mode(module_idP,CC_id,rnti));
+	  aggregation = 2;
+        }
+      } /* if (continue_flag != 1 */
+
       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)
 	  ) {
@@ -574,7 +576,7 @@ schedule_ue_spec(
       round = ue_sched_ctl->round[CC_id];
       UE_list->eNB_UE_stats[CC_id][UE_id].crnti= rnti;
       UE_list->eNB_UE_stats[CC_id][UE_id].rrc_status=mac_eNB_get_rrc_status(module_idP,rnti);
-      UE_list->eNB_UE_stats[CC_id][UE_id].harq_pid = harq_pid;
+      UE_list->eNB_UE_stats[CC_id][UE_id].harq_pid = harq_pid; 
       UE_list->eNB_UE_stats[CC_id][UE_id].harq_round = round;
 
       sdu_length_total=0;
@@ -599,7 +601,7 @@ schedule_ue_spec(
       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,
-            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
@@ -610,17 +612,15 @@ schedule_ue_spec(
 
       if (round > 0) {
 
-        if (frame_parms[CC_id]->frame_type == TDD) {
-          UE_list->UE_template[CC_id][UE_id].DAI++;
-          update_ul_dci(module_idP,CC_id,rnti,UE_list->UE_template[CC_id][UE_id].DAI);
-          LOG_D(MAC,"DAI update: CC_id %d subframeP %d: UE %d, DAI %d\n",
-                CC_id,subframeP,UE_id,UE_list->UE_template[CC_id][UE_id].DAI);
-        }
-
         // get freq_allocation
         nb_rb = UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid];
 
         if (nb_rb <= nb_available_rb) {
+          if (frame_parms[CC_id]->frame_type == TDD) {
+            UE_list->UE_template[CC_id][UE_id].DAI++;
+            update_ul_dci(module_idP,CC_id,rnti,UE_list->UE_template[CC_id][UE_id].DAI);
+            LOG_D(MAC,"DAI update: CC_id %d subframeP %d: UE %d, DAI %d\n", CC_id,subframeP,UE_id,UE_list->UE_template[CC_id][UE_id].DAI);
+          }
 
           if(nb_rb == ue_sched_ctl->pre_nb_available_rbs[CC_id]) {
             for(j=0; j<frame_parms[CC_id]->N_RBG; j++) { // for indicating the rballoc for each sub-band
@@ -743,8 +743,8 @@ schedule_ue_spec(
             }
 
             break;
-            /*
-            // this code is disabled for now - needs to be done properly
+	    /* 
+	    // this code is disabled for now - needs to be done properly
           case 4:
             //    if (nb_rb>10) {
             ((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->ndi1 = 0;
@@ -782,7 +782,7 @@ schedule_ue_spec(
             ((DCI1E_5MHz_2A_M10PRB_TDD_t*)DLSCH_dci)->dai = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3;
             ((DCI1E_5MHz_2A_M10PRB_TDD_t*)DLSCH_dci)->dl_power_off = 1;//dl_pow_off[UE_id];
             break;
-            */
+	    */
           }
 
           add_ue_dlsch_info(module_idP,
@@ -819,8 +819,9 @@ schedule_ue_spec(
           rlc_status = mac_rlc_status_ind(
                          module_idP,
                          rnti,
-                         module_idP,
+			 module_idP,
                          frameP,
+						 subframeP,
                          ENB_FLAG_YES,
                          MBMS_FLAG_NO,
                          DCCH,
@@ -832,14 +833,15 @@ schedule_ue_spec(
             LOG_D(MAC,"[eNB %d] Frame %d, DL-DCCH->DLSCH CC_id %d, Requesting %d bytes from RLC (RRC message)\n",
                   module_idP,frameP,CC_id,TBS-header_len_dcch);
             sdu_lengths[0] = mac_rlc_data_req(
-                                              module_idP,
-                                              rnti,
-                                              module_idP,
-                                              frameP,
-                                              ENB_FLAG_YES,
-                                              MBMS_FLAG_NO,
-                                              DCCH,
-                                              (char *)&dlsch_buffer[0]);
+					      module_idP,
+					      rnti,
+					      module_idP,
+					      frameP,
+					      ENB_FLAG_YES,
+					      MBMS_FLAG_NO,
+					      DCCH,
+						  TBS, //not used
+					      (char *)&dlsch_buffer[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]));
@@ -864,20 +866,21 @@ schedule_ue_spec(
             sdu_length_total = 0;
           }
         }
-
+	
         // check for DCCH1 and update header information (assume 2 byte sub-header)
         if (TBS-ta_len-header_len_dcch-sdu_length_total > 0 ) {
           rlc_status = mac_rlc_status_ind(
                          module_idP,
                          rnti,
-                         module_idP,
+			 module_idP,
                          frameP,
+						 subframeP,
                          ENB_FLAG_YES,
                          MBMS_FLAG_NO,
                          DCCH+1,
                          (TBS-ta_len-header_len_dcch-sdu_length_total)); // transport block set size less allocations for timing advance and
           // DCCH SDU
-          sdu_lengths[num_sdus] = 0;
+	  sdu_lengths[num_sdus] = 0;
 
           if (rlc_status.bytes_in_buffer > 0) {
             LOG_I(MAC,"[eNB %d], Frame %d, DCCH1->DLSCH, CC_id %d, Requesting %d bytes from RLC (RRC message)\n",
@@ -885,11 +888,12 @@ schedule_ue_spec(
             sdu_lengths[num_sdus] += mac_rlc_data_req(
                                        module_idP,
                                        rnti,
-                                       module_idP,
+				       module_idP,
                                        frameP,
                                        ENB_FLAG_YES,
                                        MBMS_FLAG_NO,
                                        DCCH+1,
+									   TBS, //not used
                                        (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),
@@ -900,7 +904,7 @@ schedule_ue_spec(
             header_len_dcch += 2;
             UE_list->eNB_UE_stats[CC_id][UE_id].num_pdu_tx[DCCH1]+=1;
             UE_list->eNB_UE_stats[CC_id][UE_id].num_bytes_tx[DCCH1]+=sdu_lengths[num_sdus];
-            num_sdus++;
+	    num_sdus++;
 #ifdef DEBUG_eNB_SCHEDULER
             LOG_T(MAC,"[eNB %d][DCCH1] CC_id %d Got %d bytes :",module_idP,CC_id,sdu_lengths[num_sdus]);
 
@@ -911,85 +915,87 @@ schedule_ue_spec(
             LOG_T(MAC,"\n");
 #endif
 
-          }
+	  }
         }
 
-        // assume the max dtch header size, and adjust it later
-        header_len_dtch=0;
-        header_len_dtch_last=0; // the header length of the last mac sdu
-        // lcid has to be sorted before the actual allocation (similar struct as ue_list).
-        for (lcid=NB_RB_MAX-1; lcid>=DTCH ; lcid--){
-          // TBD: check if the lcid is active
-
-          header_len_dtch+=3;
-          header_len_dtch_last=3;
-          LOG_D(MAC,"[eNB %d], Frame %d, DTCH%d->DLSCH, Checking RLC status (tbs %d, len %d)\n",
-                module_idP,frameP,lcid,TBS,
-                TBS-ta_len-header_len_dcch-sdu_length_total-header_len_dtch);
-
-          if (TBS-ta_len-header_len_dcch-sdu_length_total-header_len_dtch > 0 ) { // NN: > 2 ?
-            rlc_status = mac_rlc_status_ind(module_idP,
-                                            rnti,
-                                            module_idP,
-                                            frameP,
-                                            ENB_FLAG_YES,
-                                            MBMS_FLAG_NO,
-                                            lcid,
-                                            TBS-ta_len-header_len_dcch-sdu_length_total-header_len_dtch);
-
-
-            if (rlc_status.bytes_in_buffer > 0) {
-
-              LOG_D(MAC,"[eNB %d][USER-PLANE DEFAULT DRB] Frame %d : DTCH->DLSCH, Requesting %d bytes from RLC (lcid %d total hdr len %d)\n",
-                    module_idP,frameP,TBS-header_len_dcch-sdu_length_total-header_len_dtch,lcid, header_len_dtch);
-              sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,
-                                                       rnti,
-                                                       module_idP,
-                                                       frameP,
-                                                       ENB_FLAG_YES,
-                                                       MBMS_FLAG_NO,
-                                                       lcid,
-                                                       (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),
+	// assume the max dtch header size, and adjust it later
+	header_len_dtch=0;
+	header_len_dtch_last=0; // the header length of the last mac sdu
+	// lcid has to be sorted before the actual allocation (similar struct as ue_list).
+	for (lcid=NB_RB_MAX-1; lcid>=DTCH ; lcid--){
+	  // TBD: check if the lcid is active
+	  
+	  header_len_dtch+=3; 
+	  header_len_dtch_last=3;
+	  LOG_D(MAC,"[eNB %d], Frame %d, DTCH%d->DLSCH, Checking RLC status (tbs %d, len %d)\n",
+		module_idP,frameP,lcid,TBS,
+		TBS-ta_len-header_len_dcch-sdu_length_total-header_len_dtch);
+	  
+	  if (TBS-ta_len-header_len_dcch-sdu_length_total-header_len_dtch > 0 ) { // NN: > 2 ? 
+	    rlc_status = mac_rlc_status_ind(module_idP,
+					    rnti,
+					    module_idP,
+					    frameP,
+						subframeP,
+					    ENB_FLAG_YES,
+					    MBMS_FLAG_NO,
+					    lcid,
+					    TBS-ta_len-header_len_dcch-sdu_length_total-header_len_dtch);
+	   
+
+	    if (rlc_status.bytes_in_buffer > 0) {
+	      
+	      LOG_D(MAC,"[eNB %d][USER-PLANE DEFAULT DRB] Frame %d : DTCH->DLSCH, Requesting %d bytes from RLC (lcid %d total hdr len %d)\n",
+		    module_idP,frameP,TBS-header_len_dcch-sdu_length_total-header_len_dtch,lcid, header_len_dtch);
+	      sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,
+						       rnti,
+						       module_idP,
+						       frameP,
+						       ENB_FLAG_YES,
+						       MBMS_FLAG_NO,
+						       lcid,
+							   TBS,	//not used
+						       (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(lcid), T_INT(sdu_lengths[num_sdus]));
 
-              LOG_D(MAC,"[eNB %d][USER-PLANE DEFAULT DRB] Got %d bytes for DTCH %d \n",module_idP,sdu_lengths[num_sdus],lcid);
-              sdu_lcids[num_sdus] = lcid;
-              sdu_length_total += sdu_lengths[num_sdus];
-              UE_list->eNB_UE_stats[CC_id][UE_id].num_pdu_tx[lcid]+=1;
-              UE_list->eNB_UE_stats[CC_id][UE_id].num_bytes_tx[lcid]+=sdu_lengths[num_sdus];
-              if (sdu_lengths[num_sdus] < 128) {
-                header_len_dtch--;
-                header_len_dtch_last--;
-              }
-              num_sdus++;
-            } // no data for this LCID
-            else {
-              header_len_dtch-=3;
-            }
-          } // no TBS left
-          else {
-            header_len_dtch-=3;
-            break;
-          }
-        }
-        if (header_len_dtch == 0 )
-          header_len_dtch_last= 0;
-        // there is at least one SDU
-        // if (num_sdus > 0 ){
-        if ((sdu_length_total + header_len_dcch + header_len_dtch )> 0) {
-
-          // Now compute number of required RBs for total sdu length
-          // Assume RAH format 2
-          // adjust  header lengths
-          header_len_dcch_tmp = header_len_dcch;
-          header_len_dtch_tmp = header_len_dtch;
-          if (header_len_dtch==0) {
-            header_len_dcch = (header_len_dcch >0) ? 1 : 0;//header_len_dcch;  // remove length field
-          } else {
-            header_len_dtch_last-=1; // now use it to find how many bytes has to be removed for the last MAC SDU
-            header_len_dtch = (header_len_dtch > 0) ? header_len_dtch - header_len_dtch_last  :header_len_dtch;     // remove length field for the last SDU
-          }
+	      LOG_D(MAC,"[eNB %d][USER-PLANE DEFAULT DRB] Got %d bytes for DTCH %d \n",module_idP,sdu_lengths[num_sdus],lcid);
+	      sdu_lcids[num_sdus] = lcid;
+	      sdu_length_total += sdu_lengths[num_sdus];
+	      UE_list->eNB_UE_stats[CC_id][UE_id].num_pdu_tx[lcid]+=1;
+	      UE_list->eNB_UE_stats[CC_id][UE_id].num_bytes_tx[lcid]+=sdu_lengths[num_sdus];
+	      if (sdu_lengths[num_sdus] < 128) {
+		header_len_dtch--;
+		header_len_dtch_last--;
+	      }
+	      num_sdus++;
+	    } // no data for this LCID
+	    else {
+	      header_len_dtch-=3;
+	    }
+	  } // no TBS left
+	  else {
+	    header_len_dtch-=3;
+	    break; 
+	  }
+	}
+	if (header_len_dtch == 0 )
+	  header_len_dtch_last= 0;
+	// there is at least one SDU 
+	// if (num_sdus > 0 ){
+	if ((sdu_length_total + header_len_dcch + header_len_dtch )> 0) {
+	  
+	  // Now compute number of required RBs for total sdu length
+	  // Assume RAH format 2
+	  // adjust  header lengths
+	  header_len_dcch_tmp = header_len_dcch;
+	  header_len_dtch_tmp = header_len_dtch;
+	  if (header_len_dtch==0) {
+	    header_len_dcch = (header_len_dcch >0) ? 1 : 0;//header_len_dcch;  // remove length field
+	  } else {
+	    header_len_dtch_last-=1; // now use it to find how many bytes has to be removed for the last MAC SDU 
+	    header_len_dtch = (header_len_dtch > 0) ? header_len_dtch - header_len_dtch_last  :header_len_dtch;     // remove length field for the last SDU
+	  }
 
           mcs = eNB_UE_stats->dlsch_mcs1;
 
@@ -1103,7 +1109,7 @@ schedule_ue_spec(
                   "[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,
                   ue_sched_ctl->ta_update,padding,post_padding,mcs,TBS,nb_rb,header_len_dcch,header_len_dtch);
-          }
+	  }
           //#endif
 #ifdef DEBUG_eNB_SCHEDULER
           LOG_T(MAC,"[eNB %d] First 16 bytes of DLSCH : \n");
@@ -1164,44 +1170,44 @@ schedule_ue_spec(
             update_ul_dci(module_idP,CC_id,rnti,UE_list->UE_template[CC_id][UE_id].DAI);
           }
 
-          // do PUCCH power control
+	  // do PUCCH power control
           // 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) + 20;
-
+	  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) + 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
-          int32_t framex10psubframe = UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_frame*10+UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_subframe;
+	  // make sure that we are only sending a tpc update once a frame, otherwise the control loop will freak out
+	  int32_t framex10psubframe = UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_frame*10+UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_subframe;
           if (((framex10psubframe+10)<=(frameP*10+subframeP)) || //normal case
-              ((framex10psubframe>(frameP*10+subframeP)) && (((10240-framex10psubframe+frameP*10+subframeP)>=10)))) //frame wrap-around
-            if (eNB_UE_stats->Po_PUCCH_update == 1) {
-              eNB_UE_stats->Po_PUCCH_update = 0;
-
-              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--;
-              } else if (normalized_rx_power<(target_rx_power-1)) {
-                tpc = 2; //+1
-                tpc_accumulated++;
-              } else {
-                tpc = 1; //0
-              }
-              /*
-              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);*/
-
-            } // Po_PUCCH has been updated
-            else {
-              tpc = 1; //0
-            } // time to do TPC update
-          else {
-            tpc = 1; //0
-          }
+	      ((framex10psubframe>(frameP*10+subframeP)) && (((10240-framex10psubframe+frameP*10+subframeP)>=10)))) //frame wrap-around
+	    if (eNB_UE_stats->Po_PUCCH_update == 1) { 
+	      eNB_UE_stats->Po_PUCCH_update = 0;
+
+	      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--;
+	      } else if (normalized_rx_power<(target_rx_power-1)) {
+		tpc = 2; //+1
+		tpc_accumulated++;
+	      } else {
+		tpc = 1; //0
+	      }
+	      /*	      
+	      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);*/
+
+	    } // Po_PUCCH has been updated 
+	    else {
+	      tpc = 1; //0
+	    } // time to do TPC update 
+	  else {
+	    tpc = 1; //0
+	  }
 
           switch (mac_xface->get_transmission_mode(module_idP,CC_id,rnti)) {
           case 1:
@@ -1324,7 +1330,7 @@ schedule_ue_spec(
                 ((DCI2A_5MHz_2A_TDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
                 ((DCI2A_5MHz_2A_TDD_t*)DLSCH_dci)->rv1 = 0;
                 ((DCI2A_5MHz_2A_TDD_t*)DLSCH_dci)->dai      = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3;
-                ((DCI2A_5MHz_2A_TDD_t*)DLSCH_dci)->TPC = tpc;
+		((DCI2A_5MHz_2A_TDD_t*)DLSCH_dci)->TPC = tpc;
 
                 // deactivate TB2
                 ((DCI2A_5MHz_2A_TDD_t*)DLSCH_dci)->mcs2 = 0;
@@ -1339,7 +1345,7 @@ schedule_ue_spec(
                 ((DCI2A_10MHz_2A_TDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
                 ((DCI2A_10MHz_2A_TDD_t*)DLSCH_dci)->rv1 = 0;
                 ((DCI2A_10MHz_2A_TDD_t*)DLSCH_dci)->dai      = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3;
-                ((DCI2A_10MHz_2A_TDD_t*)DLSCH_dci)->TPC = tpc;
+		((DCI2A_10MHz_2A_TDD_t*)DLSCH_dci)->TPC = tpc;
 
                 // deactivate TB2
                 ((DCI2A_10MHz_2A_TDD_t*)DLSCH_dci)->mcs2 = 0;
@@ -1352,7 +1358,7 @@ schedule_ue_spec(
                 ((DCI2A_20MHz_2A_TDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
                 ((DCI2A_20MHz_2A_TDD_t*)DLSCH_dci)->rv1 = 0;
                 ((DCI2A_20MHz_2A_TDD_t*)DLSCH_dci)->dai      = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3;
-                ((DCI2A_20MHz_2A_TDD_t*)DLSCH_dci)->TPC = tpc;
+		((DCI2A_20MHz_2A_TDD_t*)DLSCH_dci)->TPC = tpc;
 
                 // deactivate TB2
                 ((DCI2A_20MHz_2A_TDD_t*)DLSCH_dci)->mcs2 = 0;
@@ -1365,7 +1371,7 @@ schedule_ue_spec(
                 ((DCI2A_5MHz_2A_TDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
                 ((DCI2A_5MHz_2A_TDD_t*)DLSCH_dci)->rv1 = 0;
                 ((DCI2A_5MHz_2A_TDD_t*)DLSCH_dci)->dai      = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3;
-                ((DCI2A_5MHz_2A_TDD_t*)DLSCH_dci)->TPC = tpc;
+		((DCI2A_5MHz_2A_TDD_t*)DLSCH_dci)->TPC = tpc;
 
                 // deactivate TB2
                 ((DCI2A_5MHz_2A_TDD_t*)DLSCH_dci)->mcs2 = 0;
@@ -1379,7 +1385,7 @@ schedule_ue_spec(
                 ((DCI2A_1_5MHz_2A_FDD_t*)DLSCH_dci)->harq_pid = harq_pid;
                 ((DCI2A_1_5MHz_2A_FDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
                 ((DCI2A_1_5MHz_2A_FDD_t*)DLSCH_dci)->rv1 = 0;
-                ((DCI2A_1_5MHz_2A_FDD_t*)DLSCH_dci)->TPC = tpc;
+		((DCI2A_1_5MHz_2A_FDD_t*)DLSCH_dci)->TPC = tpc;
 
                 // deactivate TB2
                 ((DCI2A_1_5MHz_2A_FDD_t*)DLSCH_dci)->mcs2 = 0;
@@ -1391,7 +1397,7 @@ schedule_ue_spec(
                 ((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->harq_pid = harq_pid;
                 ((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
                 ((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->rv1 = 0;
-                ((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->TPC = tpc;
+		((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->TPC = tpc;
 
                 // deactivate TB2
                 ((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->mcs2 = 0;
@@ -1403,7 +1409,7 @@ schedule_ue_spec(
                 ((DCI2A_10MHz_2A_FDD_t*)DLSCH_dci)->harq_pid = harq_pid;
                 ((DCI2A_10MHz_2A_FDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
                 ((DCI2A_10MHz_2A_FDD_t*)DLSCH_dci)->rv1 = 0;
-                ((DCI2A_10MHz_2A_FDD_t*)DLSCH_dci)->TPC = tpc;
+		((DCI2A_10MHz_2A_FDD_t*)DLSCH_dci)->TPC = tpc;
                 // deactivate TB2
                 ((DCI2A_10MHz_2A_FDD_t*)DLSCH_dci)->mcs2 = 0;
                 ((DCI2A_10MHz_2A_FDD_t*)DLSCH_dci)->rv2 = 1;
@@ -1414,7 +1420,7 @@ schedule_ue_spec(
                 ((DCI2A_20MHz_2A_FDD_t*)DLSCH_dci)->harq_pid = harq_pid;
                 ((DCI2A_20MHz_2A_FDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
                 ((DCI2A_20MHz_2A_FDD_t*)DLSCH_dci)->rv1 = 0;
-                ((DCI2A_20MHz_2A_FDD_t*)DLSCH_dci)->TPC = tpc;
+		((DCI2A_20MHz_2A_FDD_t*)DLSCH_dci)->TPC = tpc;
 
                 // deactivate TB2
                 ((DCI2A_20MHz_2A_FDD_t*)DLSCH_dci)->mcs2 = 0;
@@ -1426,7 +1432,7 @@ schedule_ue_spec(
                 ((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->harq_pid = harq_pid;
                 ((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
                 ((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->rv1 = 0;
-                ((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->TPC = tpc;
+		((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->TPC = tpc;
 
                 // deactivate TB2
                 ((DCI2A_5MHz_2A_FDD_t*)DLSCH_dci)->mcs2 = 0;
@@ -1437,8 +1443,8 @@ schedule_ue_spec(
 
             break;
 
-            /*
-            // disabled for now as this needs to be done properly
+	    /*
+	    // disabled for now as this needs to be done properly
           case 4:
             if (frame_parms[CC_id]->frame_type == TDD) {
               switch (frame_parms[CC_id]->N_RB_DL) {
@@ -1460,8 +1466,8 @@ schedule_ue_spec(
 
               case 25:
                 ((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->tpmi = 0;
-                ((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->mcs1 = mcs;
-                ((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->harq_pid = harq_pid;
+            ((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->mcs1 = mcs;
+            ((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->harq_pid = harq_pid;
                 ((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
                 ((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->rv1 = 0;
                 ((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->dai      = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3;
@@ -1508,8 +1514,8 @@ schedule_ue_spec(
                 ((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->harq_pid = harq_pid;
                 ((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->ndi1 = 1-UE_list->UE_template[CC_id][UE_id].oldNDI[harq_pid];
                 ((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->rv1 = 0;
-                ((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->dai      = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3;
-                ((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->TPC = tpc;
+            ((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->dai = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3;
+	    ((DCI2_5MHz_2A_TDD_t*)DLSCH_dci)->TPC = tpc;
 
 
                 // deactivate TB2
@@ -1530,7 +1536,7 @@ schedule_ue_spec(
                 // deactivate TB2
                 ((DCI2_1_5MHz_2A_FDD_t*)DLSCH_dci)->mcs2 = 0;
                 ((DCI2_1_5MHz_2A_FDD_t*)DLSCH_dci)->rv2 = 1;
-                break;
+            break;
 
               case 25:
                 ((DCI2_5MHz_2A_FDD_t*)DLSCH_dci)->tpmi = 0;
@@ -1598,7 +1604,7 @@ schedule_ue_spec(
             ((DCI1E_5MHz_2A_M10PRB_TDD_t*)DLSCH_dci)->ndi = 1;
             ((DCI1E_5MHz_2A_M10PRB_TDD_t*)DLSCH_dci)->rv = round&3;
             ((DCI1E_5MHz_2A_M10PRB_TDD_t*)DLSCH_dci)->dai = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3;
-            ((DCI1E_5MHz_2A_M10PRB_TDD_t*)DLSCH_dci)->TPC = tpc;
+	    ((DCI1E_5MHz_2A_M10PRB_TDD_t*)DLSCH_dci)->TPC = tpc;
 
             if(ue_sched_ctl->dl_pow_off[CC_id] == 2) {
               ue_sched_ctl->dl_pow_off[CC_id] = 1;
@@ -1616,10 +1622,10 @@ schedule_ue_spec(
             ((DCI1E_5MHz_2A_M10PRB_TDD_t*)DLSCH_dci)->dai = (UE_list->UE_template[CC_id][UE_id].DAI-1)&3;
             ((DCI1E_5MHz_2A_M10PRB_TDD_t*)DLSCH_dci)->dl_power_off = 1;
             ((DCI1E_5MHz_2A_M10PRB_TDD_t*)DLSCH_dci)->tpmi = 5;
-            ((DCI1E_5MHz_2A_M10PRB_TDD_t*)DLSCH_dci)->TPC = tpc;
+	    ((DCI1E_5MHz_2A_M10PRB_TDD_t*)DLSCH_dci)->TPC = tpc;
 
             break;
-            */
+	    */
           }
 
           // Toggle NDI for next time
@@ -1648,11 +1654,11 @@ schedule_ue_spec(
 //------------------------------------------------------------------------------
 void
 fill_DLSCH_dci(
-               module_id_t module_idP,
-               frame_t frameP,
-               sub_frame_t subframeP,
-               int* mbsfn_flagP
-               )
+	       module_id_t module_idP,
+	       frame_t frameP,
+	       sub_frame_t subframeP,
+	       int* mbsfn_flagP
+	       )
 //------------------------------------------------------------------------------
 {
 
@@ -1687,7 +1693,7 @@ fill_DLSCH_dci(
       continue;
 
     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]) {
@@ -1698,8 +1704,8 @@ fill_DLSCH_dci(
         // clear scheduling flag
         eNB_dlsch_info[module_idP][CC_id][UE_id].status = S_DL_WAITING;
         rnti = UE_RNTI(module_idP,UE_id);
-        //        mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,frameP,subframeP,&harq_pid,&round,0);
-        harq_pid = UE_list->UE_sched_ctrl[UE_id].harq_pid[CC_id];
+	//        mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,frameP,subframeP,&harq_pid,&round,0);
+	harq_pid = UE_list->UE_sched_ctrl[UE_id].harq_pid[CC_id];
         nb_rb = UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid];
 
         DLSCH_dci = (void *)UE_list->UE_template[CC_id][UE_id].DLSCH_DCI[harq_pid];
@@ -1906,7 +1912,7 @@ fill_DLSCH_dci(
 
           break;
 
-          /*
+	  /*
         case 4:
 
           // DCI format 2_2A
@@ -1949,7 +1955,7 @@ fill_DLSCH_dci(
                           format1E_2A_M10PRB,
                           0);
           break;
-          */
+	  */
 
         }
       }
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_mch.c b/openair2/LAYER2/MAC/eNB_scheduler_mch.c
index acf28c805f101245bf61095c8be0707e9cf8b1b3..56582f936cc714e7de66ba02f2a394805c211809 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_mch.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_mch.c
@@ -87,7 +87,7 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
   unsigned char header_len_mcch=0,header_len_msi=0,header_len_mtch=0, header_len_mtch_temp=0, header_len_mcch_temp=0, header_len_msi_temp=0;
   int ii=0, msi_pos=0;
   int mcch_mcs = -1;
-  uint16_t TBS,j,padding=0,post_padding=0;
+  uint16_t TBS,j=-1,padding=0,post_padding=0;
   mac_rlc_status_resp_t rlc_status;
   int num_mtch;
   int msi_length,i,k;
@@ -504,7 +504,7 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
           module_idP,CC_id,frameP,MTCH,TBS,
           TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch);
 
-    rlc_status = mac_rlc_status_ind(module_idP,0,frameP,module_idP,ENB_FLAG_YES,MBMS_FLAG_YES,MTCH,
+    rlc_status = mac_rlc_status_ind(module_idP,0,frameP,subframeP,module_idP,ENB_FLAG_YES,MBMS_FLAG_YES,MTCH,
                                     TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch);
     LOG_D(MAC,"e-MBMS log channel %u frameP %d, subframeP %d,  rlc_status.bytes_in_buffer is %d\n",
           MTCH,frameP,subframeP, rlc_status.bytes_in_buffer);
@@ -521,6 +521,7 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
                                 ENB_FLAG_YES,
                                 MBMS_FLAG_YES,
                                 MTCH,
+								0,	//not used
                                 (char*)&mch_buffer[sdu_length_total]);
       //sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,frameP, MBMS_FLAG_NO,  MTCH+(MAX_NUM_RB*(NUMBER_OF_UE_MAX+1)), (char*)&mch_buffer[sdu_length_total]);
       LOG_I(MAC,"[eNB %d][MBMS USER-PLANE] CC_id %d Got %d bytes for MTCH %d\n",module_idP,CC_id,sdu_lengths[num_sdus],MTCH);
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
index 585d9c2c1c7c7ac9443b60fb895553233d2d062d..6d0044b346a2484aeccedb1a4932572eb8e1b7cd 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
@@ -885,7 +885,7 @@ abort();
               rb_table_index=UE_template->pre_allocated_rb_table_index_ul;
             } else {
 	      mcs=10;//cmin (10, openair_daq_vars.target_ue_ul_mcs);
-              rb_table_index=13; // for PHR
+              rb_table_index=5; // for PHR
 	    }
 
             UE_list->eNB_UE_stats[CC_id][UE_id].ulsch_mcs2=mcs;
diff --git a/openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c b/openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c
index 9c8b23df07a3545188c260f9fbbe7165dfb0ae93..38f39e50e10e613a2f979ae8e32a6eaf0cf1901a 100644
--- a/openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c
+++ b/openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c
@@ -174,6 +174,7 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id,
 	   				  rnti,
 	   				  mod_id,
 	   				  frame,
+					  subframe,
 	   				  ENB_FLAG_YES,
 	   				  MBMS_FLAG_NO,
 	   				  lcid,
@@ -193,6 +194,7 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id,
 					    rnti,
 					    mod_id,
 					    frame,
+						subframe,
 					    ENB_FLAG_YES,
 					    MBMS_FLAG_NO,
 					    lcid,
@@ -209,6 +211,7 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id,
 						ENB_FLAG_YES,
 						MBMS_FLAG_NO,
 						lcid,
+						rlc_size, //not used
 						(char *)&dlsch_buffer[sdu_length_total]);
 	      
 	      LOG_D(MAC,"[eNB %d][LCID %d] CC_id %d Got %d bytes from RLC\n",mod_id, lcid, CC_id, sdu_lengths[j]);
diff --git a/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c
index 00027f04ce1f46ffdceefbe1bfd0e2b56a16b3e7..5f1df6766340f637634343be389c027dec12d0a0 100644
--- a/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c
+++ b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c
@@ -160,7 +160,7 @@ void _store_dlsch_buffer (module_id_t Mod_id,
 
     for(i=0; i< MAX_NUM_LCID; i++) { // loop over all the logical channels
 
-      rlc_status = mac_rlc_status_ind(Mod_id,rnti, Mod_id,frameP,ENB_FLAG_YES,MBMS_FLAG_NO,i,0 );
+      rlc_status = mac_rlc_status_ind(Mod_id,rnti, Mod_id,frameP,subframeP,ENB_FLAG_YES,MBMS_FLAG_NO,i,0 );
       UE_template->dl_buffer_info[i] = rlc_status.bytes_in_buffer; //storing the dlsch buffer for each logical channel
       UE_template->dl_pdus_in_buffer[i] = rlc_status.pdus_in_buffer;
       UE_template->dl_buffer_head_sdu_creation_time[i] = rlc_status.head_sdu_creation_time ;
@@ -1241,6 +1241,7 @@ flexran_schedule_ue_spec_common(mid_t   mod_id,
 					     rnti,
 					     mod_id,
 					     frame,
+						 subframe,
 					     ENB_FLAG_YES,
 					     MBMS_FLAG_NO,
 					     j,
diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c
index 6e73e353f019954e954e757ac10b4984e48d2731..1be9a2ba3a112b128927a2d4addfcb3d3c314461 100644
--- a/openair2/LAYER2/MAC/pre_processor.c
+++ b/openair2/LAYER2/MAC/pre_processor.c
@@ -66,14 +66,29 @@
 */
 
 /* this function checks that get_eNB_UE_stats returns
- * a non-NULL pointer for all CCs for a given UE
+ * a non-NULL pointer for all the active CCs of an UE
  */
 int phy_stats_exist(module_id_t Mod_id, int rnti)
 {
   int CC_id;
-  for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++)
+  int i;
+  int UE_id          = find_UE_id(Mod_id, rnti);
+  UE_list_t *UE_list = &eNB_mac_inst[Mod_id].UE_list;
+  if (UE_id == -1) {
+    LOG_W(MAC, "[eNB %d] UE %x not found, should be there (in phy_stats_exist)\n",
+	  Mod_id, rnti);
+    return 0;
+  }
+  if (UE_list->numactiveCCs[UE_id] == 0) {
+    LOG_W(MAC, "[eNB %d] UE %x has no active CC (in phy_stats_exist)\n",
+	  Mod_id, rnti);
+    return 0;
+  }
+  for (i = 0; i < UE_list->numactiveCCs[UE_id]; i++) {
+    CC_id = UE_list->ordered_CCids[i][UE_id];
     if (mac_xface->get_eNB_UE_stats(Mod_id, CC_id, rnti) == NULL)
       return 0;
+  }
   return 1;
 }
 
@@ -109,7 +124,7 @@ void store_dlsch_buffer (module_id_t Mod_id,
 
     for(i=0; i< MAX_NUM_LCID; i++) { // loop over all the logical channels
 
-      rlc_status = mac_rlc_status_ind(Mod_id,rnti, Mod_id,frameP,ENB_FLAG_YES,MBMS_FLAG_NO,i,0 );
+      rlc_status = mac_rlc_status_ind(Mod_id,rnti, Mod_id,frameP,subframeP,ENB_FLAG_YES,MBMS_FLAG_NO,i,0 );
       UE_template->dl_buffer_info[i] = rlc_status.bytes_in_buffer; //storing the dlsch buffer for each logical channel
       UE_template->dl_pdus_in_buffer[i] = rlc_status.pdus_in_buffer;
       UE_template->dl_buffer_head_sdu_creation_time[i] = rlc_status.head_sdu_creation_time ;
diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h
index 3343e8821e9479e63e883ed30a0f0dccc70e7e48..ea264f1bfdfed36579df9d7f5b2b7e6c162b9ea7 100644
--- a/openair2/LAYER2/MAC/proto.h
+++ b/openair2/LAYER2/MAC/proto.h
@@ -454,6 +454,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,u
 @param t_crnti Pointer to PHY variable containing the T_CRNTI
 @param preamble_index Preamble Index used by PHY to transmit the PRACH.  This should match the received RAR to trigger the rest of
 random-access procedure
+@param selected_rar_buffer the output buffer for storing the selected RAR header and RAR payload
 @returns timing advance or 0xffff if preamble doesn't match
 */
 uint16_t
@@ -464,7 +465,8 @@ ue_process_rar(
   const rnti_t ra_rnti,
   uint8_t * const dlsch_buffer,
   rnti_t * const t_crnti,
-  const uint8_t preamble_index
+  const uint8_t preamble_index,
+  uint8_t* selected_rar_buffer
 );
 
 
diff --git a/openair2/LAYER2/MAC/ra_procedures.c b/openair2/LAYER2/MAC/ra_procedures.c
index 8264699f439a758f9d261cfdbea767070c66d7a3..d2d52383b007c34a0a7b98417fbd58147fee6194 100644
--- a/openair2/LAYER2/MAC/ra_procedures.c
+++ b/openair2/LAYER2/MAC/ra_procedures.c
@@ -394,7 +394,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,
         } else if (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[DCCH]] > 0) {
           // This is for triggering a transmission on DCCH using PRACH (during handover, or sending SR for example)
           dcch_header_len = 2 + 2;  /// SHORT Subheader + C-RNTI control element
-          rlc_status = mac_rlc_status_ind(module_idP,UE_mac_inst[module_idP].crnti, eNB_indexP,frameP,ENB_FLAG_NO,MBMS_FLAG_NO,
+          rlc_status = mac_rlc_status_ind(module_idP,UE_mac_inst[module_idP].crnti, eNB_indexP,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO,
                                           DCCH,
                                           6);
 
@@ -409,6 +409,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,
           sdu_lengths[0] = mac_rlc_data_req(module_idP, UE_mac_inst[module_idP].crnti,
                                             eNB_indexP, frameP,ENB_FLAG_NO, MBMS_FLAG_NO,
                                             DCCH,
+											6,	//not used
                                             (char *)&ulsch_buff[0]);
 
           LOG_D(MAC,"[UE %d] TX Got %d bytes for DCCH\n",module_idP,sdu_lengths[0]);
diff --git a/openair2/LAYER2/MAC/rar_tools.c b/openair2/LAYER2/MAC/rar_tools.c
index 2de22c067affe4fae4833400f5d735e77de4d9c0..51900d8f3a655dbce4cd10b62e1a6b0f21a48ed5 100644
--- a/openair2/LAYER2/MAC/rar_tools.c
+++ b/openair2/LAYER2/MAC/rar_tools.c
@@ -136,15 +136,48 @@ ue_process_rar(
   const rnti_t ra_rnti,
   uint8_t* const dlsch_buffer,
   rnti_t* const t_crnti,
-  const uint8_t preamble_index
+  const uint8_t preamble_index,
+  uint8_t* selected_rar_buffer // output argument for storing the selected RAR header and RAR payload
 )
 //------------------------------------------------------------------------------
 {
+	uint16_t ret = 0; // return value
 
   RA_HEADER_RAPID *rarh = (RA_HEADER_RAPID *)dlsch_buffer;
   //  RAR_PDU *rar = (RAR_PDU *)(dlsch_buffer+1);
   uint8_t *rar = (uint8_t *)(dlsch_buffer+1);
 
+        // get the last RAR payload for working with CMW500
+	uint8_t n_rarpy = 0; // number of RAR payloads
+	uint8_t n_rarh = 0; // number of MAC RAR subheaders
+	uint8_t best_rx_rapid = -1; // the closest RAPID receive from all RARs
+	while (1) {
+		n_rarh++;
+		if (rarh->T == 1) {
+			n_rarpy++;
+			LOG_D(MAC, "RAPID %d\n", rarh->RAPID);
+		}
+
+		if (rarh->RAPID == preamble_index) {
+			LOG_D(PHY, "Found RAR with the intended RAPID %d\n", rarh->RAPID);
+			rar = (uint8_t *)(dlsch_buffer+n_rarh + (n_rarpy-1)*6);
+			break;
+		}
+
+		if (abs((int)rarh->RAPID - (int)preamble_index) < abs((int)best_rx_rapid - (int)preamble_index)) {
+			best_rx_rapid = rarh->RAPID;
+			rar = (uint8_t *)(dlsch_buffer+n_rarh + (n_rarpy-1)*6);
+		}
+
+		if (rarh->E == 0) {
+			LOG_I(PHY, "No RAR found with the intended RAPID. The closest RAPID in all RARs is %d\n", best_rx_rapid);
+			break;
+		} else {
+			rarh++;
+		}
+	};
+	LOG_D(MAC, "number of RAR subheader %d; number of RAR pyloads %d\n", n_rarh, n_rarpy);
+
   if (CC_id>0) {
     LOG_W(MAC,"Should not have received RAR on secondary CCs! \n");
     return(0xffff);
@@ -172,7 +205,7 @@ ue_process_rar(
   if (opt_enabled) {
     LOG_D(OPT,"[UE %d][RAPROC] CC_id %d RAR Frame %d trace pdu for ra-RNTI %x\n",
           module_idP, CC_id, frameP, ra_rnti);
-    trace_pdu(1, (uint8_t*)rarh, 7, module_idP, 2, ra_rnti,
+    trace_pdu(1, (uint8_t*)dlsch_buffer, n_rarh + n_rarpy*6, module_idP, 2, ra_rnti,
         UE_mac_inst[module_idP].rxFrame, UE_mac_inst[module_idP].rxSubframe, 0, 0);
   }
 
@@ -180,9 +213,16 @@ ue_process_rar(
     *t_crnti = (uint16_t)rar[5]+(rar[4]<<8);//rar->t_crnti;
     UE_mac_inst[module_idP].crnti = *t_crnti;//rar->t_crnti;
     //return(rar->Timing_Advance_Command);
-    return((((uint16_t)(rar[0]&0x7f))<<4) + (rar[1]>>4));
+    ret = ((((uint16_t)(rar[0]&0x7f))<<4) + (rar[1]>>4));
   } else {
     UE_mac_inst[module_idP].crnti=0;
-    return(0xffff);
+    ret = (0xffff);
   }
+
+  // move the selected RAR to the front of the RA_PDSCH buffer
+  memcpy(selected_rar_buffer+0, (uint8_t*)rarh, 1);
+  memcpy(selected_rar_buffer+1, (uint8_t*)rar , 6);
+
+  return ret;
+
 }
diff --git a/openair2/LAYER2/MAC/ue_procedures.c b/openair2/LAYER2/MAC/ue_procedures.c
index c27c0d524eaf8a7b2e036cfe46103630d4f6e114..f9488ce5437d97169a94b90f1d9a39d9afe800fb 100644
--- a/openair2/LAYER2/MAC/ue_procedures.c
+++ b/openair2/LAYER2/MAC/ue_procedures.c
@@ -353,7 +353,7 @@ ue_send_sdu(
 
   if (opt_enabled) {
     trace_pdu(1, sdu, sdu_len, module_idP, 3, UE_mac_inst[module_idP].crnti,
-        UE_mac_inst[module_idP].rxFrame, UE_mac_inst[module_idP].rxSubframe, 0, 0);
+        frameP, subframeP, 0, 0);
     LOG_D(OPT,"[UE %d][DLSCH] Frame %d trace pdu for rnti %x  with size %d\n",
           module_idP, frameP, UE_mac_inst[module_idP].crnti, sdu_len);
   }
@@ -1265,13 +1265,13 @@ unsigned char generate_ulsch_header(uint8_t *mac_header,
 void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subframe, uint8_t eNB_index,uint8_t *ulsch_buffer,uint16_t buflen, uint8_t *access_mode)
 {
 
-  mac_rlc_status_resp_t rlc_status;
   uint8_t total_rlc_pdu_header_len=0, rlc_pdu_header_len_last=0 ;
   uint16_t buflen_remain = 0;
   uint8_t bsr_len=0,bsr_ce_len=0,bsr_header_len=0;
   uint8_t phr_header_len=0, phr_ce_len=0,phr_len=0;
   uint8_t lcid=0,lcid_rlc_pdu_count=0;
   boolean_t is_lcid_processed = FALSE;
+  boolean_t is_all_lcid_processed = FALSE;
   uint16_t sdu_lengths[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
   uint8_t sdu_lcids[8]    = { 0, 0, 0, 0, 0, 0, 0, 0 };
   uint8_t payload_offset=0,num_sdus=0;
@@ -1291,6 +1291,7 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf
   int lcg_id_bsr_trunc = 0;
   int highest_priority = 16;
   int num_lcg_id_with_data = 0;
+  rlc_buffer_occupancy_t lcid_buffer_occupancy_old=0, lcid_buffer_occupancy_new=0;
   
   LOG_D(MAC,"[UE %d] MAC PROCESS UL TRANSPORT BLOCK at frame%d subframe %d TBS=%d\n",
                         module_idP, frameP, subframe, buflen);
@@ -1400,16 +1401,32 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf
   // check for UL bandwidth requests and add SR control element
 
   // Check for DCCH first
-// TO DO: Unrool the loop to do it at least once to avoid the if num_sdu
-for (lcid=DCCH; lcid < DTCH ; lcid++) {
+// TO DO: Multiplex in the order defined by the logical channel prioritization
+for (lcid=DCCH; (lcid < MAX_NUM_LCID) && (is_all_lcid_processed == FALSE) ; lcid++) {
   if (UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid] == LCID_NOT_EMPTY) {
 
-      is_lcid_processed = FALSE;
       lcid_rlc_pdu_count = 0;
+      is_lcid_processed	= FALSE;
+      lcid_buffer_occupancy_old = mac_rlc_get_buffer_occupancy_ind(module_idP,
+              	  	  	  	  	  	  	  	  	  	  	  	  	  UE_mac_inst[module_idP].crnti,
+																  eNB_index,
+																  frameP,
+																  subframe,
+																  ENB_FLAG_NO,
+																  lcid);
+
+      lcid_buffer_occupancy_new = lcid_buffer_occupancy_old;
+
+      AssertFatal (lcid_buffer_occupancy_new == UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid], "LCID=%d RLC has BO %d bytes but MAC has stored %d bytes\n",
+      					lcid,lcid_buffer_occupancy_new,UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid]);
+
+      AssertFatal (lcid_buffer_occupancy_new <= UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]], "LCID=%d RLC has more BO %d bytes than BSR = %d bytes\n",
+      					lcid,lcid_buffer_occupancy_new,UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]]);
+
 
       //Multiplex all available DCCH RLC PDUs considering to multiplex the last PDU each time for maximize the data
       //Adjust at the end of the loop
-      while ((!is_lcid_processed) && (bsr_len + phr_len + total_rlc_pdu_header_len + sdu_length_total + MIN_MAC_HDR_RLC_SIZE <= buflen)) {
+      while ((!is_lcid_processed) && (lcid_buffer_occupancy_new) && (bsr_len + phr_len + total_rlc_pdu_header_len + sdu_length_total + MIN_MAC_HDR_RLC_SIZE <= buflen)) {
 
     	  // Workaround for issue in OAI eNB or EPC which are not able to process SRB2 message multiplexed with SRB1 on the same MAC PDU
     	  if ((usim_test == 0) && (lcid == DCCH1) && (lcid_rlc_pdu_count == 0) && (num_sdus)) {
@@ -1420,253 +1437,103 @@ for (lcid=DCCH; lcid < DTCH ; lcid++) {
 
           buflen_remain = buflen - (bsr_len + phr_len + total_rlc_pdu_header_len + sdu_length_total + 1);
 
-          rlc_status = mac_rlc_status_ind(module_idP,
-                          UE_mac_inst[module_idP].crnti,
-                          eNB_index,
-                          frameP,
-                          ENB_FLAG_NO,
-                          MBMS_FLAG_NO, // eNB_index
-                                          lcid,
-                                          buflen_remain);
-
-          // Workaround for BO issue in RLC AM ReTx : RLC BO can not be bigger than stored MAC BO
-          if (UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid] <  rlc_status.bytes_in_buffer) {
-
-        	  LOG_I(MAC, "[UE %d] Frame %d Subframe%d: WARNING Inconsistent BO! for LCID=%d MAC=%d RLC=%d RLC PDU nb=%d\n",
-        	                          module_idP,frameP,subframe,
-									  lcid,UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid],rlc_status.bytes_in_buffer,lcid_rlc_pdu_count);
-
-        	  // Skip multiplexing for the LCID
-        	  break;
-          }
-
-          /*
-          AssertFatal ( UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid] >=  rlc_status.bytes_in_buffer, "Inconsistent BO! for LCID=%d MAC=%d RLC=%d RLC PDU nb=%d Frame %d Subrame %d\n",
-                  lcid,UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid],rlc_status.bytes_in_buffer,lcid_rlc_pdu_count,frameP,subframe);
-                  */
-
-          if (rlc_status.bytes_in_buffer > 0) {
-
-
-          LOG_D(MAC, "[UE %d] Frame %d : UL-DCCH -> ULSCH, RLC SRB%d has %d bytes to "
-                "send (Transport Block size %d BSR size=%d PHR=%d SDU Length Total %d , mac header len %d BSR byte before Tx=%d)\n",
-                module_idP,frameP, lcid,UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid],buflen,bsr_len,phr_len,sdu_length_total,total_rlc_pdu_header_len,UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]]);
-
 
-          sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,
-                             UE_mac_inst[module_idP].crnti,
-                             eNB_index,
-                             frameP,
-                             ENB_FLAG_NO,
-                             MBMS_FLAG_NO,
-                                             lcid,
-                                             (char *)&ulsch_buff[sdu_length_total]);
+		  LOG_D(MAC, "[UE %d] Frame %d : UL-DXCH -> ULSCH, RLC %d has %d bytes to "
+				"send (Transport Block size %d BSR size=%d PHR=%d SDU Length Total %d , mac header len %d BSR byte before Tx=%d)\n",
+				module_idP,frameP, lcid,lcid_buffer_occupancy_new,buflen,bsr_len,phr_len,sdu_length_total,total_rlc_pdu_header_len,UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]]);
 
 
-            AssertFatal (UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid] >= sdu_lengths[num_sdus], "LCID=%d RLC has segmented %d bytes but MAC has max=%d\n",
-                    lcid,sdu_lengths[num_sdus],UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid]);
+		  sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,
+							 UE_mac_inst[module_idP].crnti,
+							 eNB_index,
+							 frameP,
+							 ENB_FLAG_NO,
+							 MBMS_FLAG_NO,
+							 lcid,
+							 buflen_remain,
+							 (char *)&ulsch_buff[sdu_length_total]);
 
 
+		  AssertFatal (buflen_remain >= sdu_lengths[num_sdus], "LCID=%d RLC has segmented %d bytes but MAC has max=%d\n",
+					lcid,sdu_lengths[num_sdus],buflen_remain);
 
-          sdu_length_total += sdu_lengths[num_sdus];
-          sdu_lcids[num_sdus] = lcid;
-          LOG_D(MAC,"[UE %d] TX Multiplex RLC PDU TX Got %d bytes for SRB%d\n",module_idP,sdu_lengths[num_sdus],lcid);
-          //header_len +=2;
-          // update LCID remain buffer
-          UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid] -= sdu_lengths[num_sdus];
-          /* Update BSR : substract transmitted data */
-          if (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]] >= sdu_lengths[num_sdus]){
-              UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]] -= sdu_lengths[num_sdus] ;
-          }
-          else {
-              LOG_I(MAC, "[UE %d] Frame %d Subframe%d: WARNING Buffer occupancy =%d for LCGID%d is lower than data transmitted=%d for LCID%d\n",
-                        module_idP,frameP,subframe,
-                        UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]],
-                        UE_mac_inst[module_idP].scheduling_info.LCGID[lcid],
-                        sdu_lengths[num_sdus],lcid);
-              UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]] = 0;
-          }
-
-          //Update the number of LCGID with data as BSR shall reflect status after BSR transmission
-          if ((num_lcg_id_with_data > 1) && (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]] == 0))
-          {
-              num_lcg_id_with_data --;
-              // Change BSR size to BSR SHORT if num_lcg_id_with_data becomes to 1
-              if ((bsr_len) && (num_lcg_id_with_data == 1))
-              {
-                  bsr_ce_len = sizeof(BSR_SHORT);
-                  bsr_len = bsr_ce_len + bsr_header_len;
-              }
 
-          }
-
-          if (buflen == (bsr_len + phr_len + total_rlc_pdu_header_len + sdu_length_total + 1)) {
-              //No more remaining TBS after this PDU
-              //exit the function
-              rlc_pdu_header_len_last = 1;
-              is_lcid_processed = TRUE;
-          }
-          else {
-              rlc_pdu_header_len_last = (sdu_lengths[num_sdus] > 128 ) ? 3 : 2 ;
-
-              //Change to 1 byte if it does not fit in the TBS, ie last PDU
-              if (buflen <= (bsr_len + phr_len + total_rlc_pdu_header_len + rlc_pdu_header_len_last + sdu_length_total)) {
-                  rlc_pdu_header_len_last = 1;
-                  is_lcid_processed = TRUE;
-              }
-          }
-
-          //Update number of SDU
-          num_sdus ++;
-
-          //Update total MAC Header size for RLC PDUs and save last one
-          total_rlc_pdu_header_len += rlc_pdu_header_len_last;
+		  if (sdu_lengths[num_sdus])
+		  {
+			  sdu_length_total += sdu_lengths[num_sdus];
+			  sdu_lcids[num_sdus] = lcid;
+			  LOG_D(MAC,"[UE %d] TX Multiplex RLC PDU TX Got %d bytes for LcId%d\n",module_idP,sdu_lengths[num_sdus],lcid);
+
+			  if (buflen == (bsr_len + phr_len + total_rlc_pdu_header_len + sdu_length_total + 1)) {
+				  //No more remaining TBS after this PDU
+				  //exit the function
+				  rlc_pdu_header_len_last = 1;
+				  is_lcid_processed = TRUE;
+				  is_all_lcid_processed = TRUE;
+			  }
+			  else {
+				  rlc_pdu_header_len_last = (sdu_lengths[num_sdus] > 128 ) ? 3 : 2 ;
+
+				  //Change to 1 byte if it does not fit in the TBS, ie last PDU
+				  if (buflen <= (bsr_len + phr_len + total_rlc_pdu_header_len + rlc_pdu_header_len_last + sdu_length_total)) {
+					  rlc_pdu_header_len_last = 1;
+					  is_lcid_processed = TRUE;
+					  is_all_lcid_processed = TRUE;
+				  }
+			  }
+
+			  //Update number of SDU
+			  num_sdus ++;
+
+			  //Update total MAC Header size for RLC PDUs and save last one
+			  total_rlc_pdu_header_len += rlc_pdu_header_len_last;
+
+			  lcid_rlc_pdu_count ++;
+		  }
+		  else
+		  {
+			  /* avoid infinite loop ... */
+			  is_lcid_processed = TRUE;
+		  }
 
-          } //end if (rlc_status.bytes_in_buffer > 0)
-          else {
-              // Switch to next LCID or exit the whole loop
-              is_lcid_processed = TRUE;
-          }
-          lcid_rlc_pdu_count ++;
-   }
+          /* Get updated BO after multiplexing this PDU */
+          lcid_buffer_occupancy_new = mac_rlc_get_buffer_occupancy_ind(module_idP,
+                        	  	  	  	  	  	  	  	  	  	  	  	  	  UE_mac_inst[module_idP].crnti,
+          																  eNB_index,
+          																  frameP,
+          																  subframe,
+          																  ENB_FLAG_NO,
+          																  lcid);
 
-    UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid] = LCID_EMPTY;
+          is_lcid_processed = (is_lcid_processed) || (lcid_buffer_occupancy_new <= 0);
    }
-}
-
 
-// Now Check for DTCH first
-// TO DO: do it according to Logical Channel Prioritization if at least 2 DTCH
-for (lcid=DTCH; lcid < MAX_NUM_LCID ; lcid++) {
-if (UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid] == LCID_NOT_EMPTY) {
+    //Update Buffer remain and BSR bytes after transmission
 
-    is_lcid_processed = FALSE;
-    lcid_rlc_pdu_count = 0;
+    AssertFatal (lcid_buffer_occupancy_new <=  lcid_buffer_occupancy_old, "MAC UE Tx error : Buffer Occupancy After Tx=%d greater than before=%d BO! for LCID=%d RLC PDU nb=%d Frame %d Subrame %d\n",
+    		lcid_buffer_occupancy_new,lcid_buffer_occupancy_old,lcid,lcid_rlc_pdu_count,frameP,subframe);
 
-    //Multiplex all available DTCH RLC PDUs considering to multiplex the last PDU each time for maximize the data
-    //Adjust at the end of the loop
-    while ((!is_lcid_processed) && (bsr_len + phr_len + total_rlc_pdu_header_len + sdu_length_total + MIN_MAC_HDR_RLC_SIZE <= buflen)) {
+    UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid] = lcid_buffer_occupancy_new;
+    UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]] += (lcid_buffer_occupancy_new - lcid_buffer_occupancy_old);
 
-        buflen_remain = buflen - (bsr_len + phr_len + total_rlc_pdu_header_len + sdu_length_total + 1);
-
-        rlc_status = mac_rlc_status_ind(module_idP,
-                        UE_mac_inst[module_idP].crnti,
-                        eNB_index,
-                        frameP,
-                        ENB_FLAG_NO,
-                        MBMS_FLAG_NO, // eNB_index
-                                        lcid,
-                                        buflen_remain);
-
-        // Workaround for BO issue in RLC AM ReTx : RLC BO can not be bigger than stored MAC BO
-        if (UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid] <  rlc_status.bytes_in_buffer) {
-
-      	  LOG_I(MAC, "[UE %d] Frame %d Subframe%d: WARNING Inconsistent BO! for LCID=%d MAC=%d RLC=%d RLC PDU nb=%d\n",
-      	                          module_idP,frameP,subframe,
-									  lcid,UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid],rlc_status.bytes_in_buffer,lcid_rlc_pdu_count);
-
-      	  // Skip multiplexing for the LCID
-      	  break;
-        }
-
-        /*
-        AssertFatal ( UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid] >=  rlc_status.bytes_in_buffer, "Inconsistent BO! for LCID=%d MAC=%d RLC=%d RLC PDU nb=%d Frame %d Subrame %d\n",
-                  lcid,UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid],rlc_status.bytes_in_buffer,lcid_rlc_pdu_count,frameP,subframe);
-        */
-
-        if (rlc_status.bytes_in_buffer > 0) {
-
-
-        LOG_D(MAC, "[UE %d] Frame %d : UL-DTCH -> ULSCH, RLC LCID%d has %d bytes to "
-              "send (Transport Block size %d BSR size=%d PHR=%d SDU Length Total %d , mac header len %d BSR byte before Tx=%d)\n",
-              module_idP,frameP, lcid,UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid],buflen,bsr_len,phr_len,sdu_length_total,total_rlc_pdu_header_len,UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]]);
-
-
-        sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,
-                           UE_mac_inst[module_idP].crnti,
-                           eNB_index,
-                           frameP,
-                           ENB_FLAG_NO,
-                           MBMS_FLAG_NO,
-                                           lcid,
-                                           (char *)&ulsch_buff[sdu_length_total]);
-
-        AssertFatal (sdu_lengths[num_sdus] < MAX_ULSCH_PAYLOAD_BYTES, "LCID=%d RLC PDU size = %d is too big\n",
-                lcid,sdu_lengths[num_sdus]);
-
-
-          AssertFatal (UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid] >= sdu_lengths[num_sdus], "LCID=%d RLC has segmented %d bytes but MAC has max=%d\n",
-                  lcid,sdu_lengths[num_sdus],UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid]);
-
-
-
-        sdu_length_total += sdu_lengths[num_sdus];
-        sdu_lcids[num_sdus] = lcid;
-        LOG_D(MAC,"[UE %d] TX Multiplex RLC PDU TX Got %d bytes for LCID%d\n",module_idP,sdu_lengths[num_sdus],lcid);
-        //header_len +=2;
-        // update LCID remain buffer
-        UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid] -= sdu_lengths[num_sdus];
-        /* Update BSR : substract transmitted data */
-        if (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]] >= sdu_lengths[num_sdus]){
-            UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]] -= sdu_lengths[num_sdus] ;
-        }
-        else {
-            LOG_I(MAC, "[UE %d] Frame %d Subframe%d: WARNING Buffer occupancy =%d for LCGID%d is lower than data transmitted=%d for LCID%d\n",
-                      module_idP,frameP,subframe,
-                      UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]],
-                      UE_mac_inst[module_idP].scheduling_info.LCGID[lcid],
-                      sdu_lengths[num_sdus],lcid);
-            UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]] = 0;
-        }
-
-        //Update the number of LCGID with data as BSR shall reflect status after BSR transmission
-        if ((num_lcg_id_with_data > 1) && (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]] == 0))
+    //Update the number of LCGID with data as BSR shall reflect status after BSR transmission
+    if ((num_lcg_id_with_data > 1) && (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]] == 0))
+    {
+        num_lcg_id_with_data --;
+        // Change BSR size to BSR SHORT if num_lcg_id_with_data becomes to 1
+        if ((bsr_len) && (num_lcg_id_with_data == 1))
         {
-            num_lcg_id_with_data --;
-            // Change BSR size to BSR SHORT if num_lcg_id_with_data becomes to 1
-            if ((bsr_len) && (num_lcg_id_with_data == 1))
-            {
-                bsr_ce_len = sizeof(BSR_SHORT);
-                bsr_len = bsr_ce_len + bsr_header_len;
-            }
-
+            bsr_ce_len = sizeof(BSR_SHORT);
+            bsr_len = bsr_ce_len + bsr_header_len;
         }
+    }
 
-        if (buflen == (bsr_len + phr_len + total_rlc_pdu_header_len + sdu_length_total + 1)) {
-            //No more remaining TBS after this PDU
-            //exit the function
-            rlc_pdu_header_len_last = 1;
-            is_lcid_processed = TRUE;
-        }
-        else {
-            rlc_pdu_header_len_last = (sdu_lengths[num_sdus] > 128 ) ? 3 : 2 ;
-
-            //Change to 1 byte if it does not fit in the TBS, ie last PDU
-            if (buflen <= (bsr_len + phr_len + total_rlc_pdu_header_len + rlc_pdu_header_len_last + sdu_length_total)) {
-                rlc_pdu_header_len_last = 1;
-                is_lcid_processed = TRUE;
-            }
-        }
-
-        //Update number of SDU
-        num_sdus ++;
-
-        //Update total MAC Header size for RLC PDUs and save last one
-        total_rlc_pdu_header_len += rlc_pdu_header_len_last;
 
-        } //end if (rlc_status.bytes_in_buffer > 0)
-        else {
-            // Switch to next LCID or exit the whole loop
-            is_lcid_processed = TRUE;
-        }
-        lcid_rlc_pdu_count ++;
+    UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid] = LCID_EMPTY;
+   }
  }
 
-  UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid] = LCID_EMPTY;
- }
-}
 
-  //lcgid= get_bsr_lcgid(module_idP);
 
   // Compute BSR Values and update Nb LCGID with data after multiplexing
   num_lcg_id_with_data = 0;
@@ -1923,7 +1790,7 @@ if (UE_mac_inst[module_idP].scheduling_info.LCID_status[lcid] == LCID_NOT_EMPTY)
   if (opt_enabled) {
     trace_pdu(0, ulsch_buffer, buflen, module_idP, 3, UE_mac_inst[module_idP].crnti, UE_mac_inst[module_idP].txFrame, UE_mac_inst[module_idP].txSubframe, 0, 0);
     LOG_D(OPT,"[UE %d][ULSCH] Frame %d subframe %d trace pdu for rnti %x  with size %d\n",
-          module_idP, UE_mac_inst[module_idP].txFrame, UE_mac_inst[module_idP].txSubframe, UE_mac_inst[module_idP].crnti, buflen);
+          module_idP, frameP, subframe, UE_mac_inst[module_idP].crnti, buflen);
   }
 }
 
@@ -2104,7 +1971,7 @@ ue_scheduler(
       /*
       if (lcid == DCCH) {    
         LOG_D(MAC,"[UE %d][SR] Frame %d subframe %d Pending data for SRB1=%d for LCGID %d \n",                  
-        module_idP, frameP,subframeP,UE_mac_inst[module_idP].scheduling_info.BSR[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]],                  
+        module_idP, txFrameP,txSubframeP,UE_mac_inst[module_idP].scheduling_info.BSR[UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]],                  
 //         UE_mac_inst[module_idP].scheduling_info.LCGID[lcid]);
       }
       */
@@ -2396,9 +2263,9 @@ boolean_t  update_bsr(module_id_t module_idP, frame_t frameP, sub_frame_t subfra
 			  	lcgid_buffer_remain[lcgid] += UE_mac_inst[module_idP].scheduling_info.LCID_buffer_remain[lcid];
 		  	}
 
-		    rlc_status = mac_rlc_status_ind(module_idP, UE_mac_inst[module_idP].crnti,eNB_index,frameP,ENB_FLAG_NO,MBMS_FLAG_NO,
+		    rlc_status = mac_rlc_status_ind(module_idP, UE_mac_inst[module_idP].crnti,eNB_index,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO,
 		                                    lcid,
-		                                    0);
+		                                    0xFFFF); //TBS is not used in RLC at this step, set a special value for debug
 
 		    lcid_bytes_in_buffer[lcid] = rlc_status.bytes_in_buffer;
 
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
index 0da894df82c4821d1c8c3f072c6890dc7491615c..2ebcf64cad6db3fac635da1cdeafcd064b90918d 100644
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_fifo.c
@@ -545,7 +545,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const  ctxt_pP)
           pdcp_read_state_g = 0;
           // print_active_requests()
 #ifdef PDCP_DEBUG
-          LOG_D(PDCP, "[PDCP][NETLINK] Something in socket, length %d \n",
+          LOG_D(PDCP, "[PDCP][NETLINK] Something in socket, length %zu\n",
                 nas_nlh_rx->nlmsg_len - sizeof(struct nlmsghdr));
 #endif
 
@@ -603,7 +603,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const  ctxt_pP)
 
               if (h_rc == HASH_TABLE_OK) {
 #ifdef PDCP_DEBUG
-                LOG_D(PDCP, "[FRAME %5u][eNB][NETLINK][IP->PDCP] INST %d: Received socket with length %d (nlmsg_len = %d) on Rab %d \n",
+                LOG_D(PDCP, "[FRAME %5u][eNB][NETLINK][IP->PDCP] INST %d: Received socket with length %d (nlmsg_len = %zu) on Rab %d \n",
                       ctxt.frame,
                       pdcp_read_header_g.inst,
                       len,
@@ -693,7 +693,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const  ctxt_pP)
               if (h_rc == HASH_TABLE_OK) {
                 rab_id = pdcp_p->rb_id;
 #ifdef PDCP_DEBUG
-                LOG_D(PDCP, "[FRAME %5u][UE][NETLINK][IP->PDCP] INST %d: Received socket with length %d (nlmsg_len = %d) on Rab %d \n",
+                LOG_D(PDCP, "[FRAME %5u][UE][NETLINK][IP->PDCP] INST %d: Received socket with length %d (nlmsg_len = %zu) on Rab %d \n",
                       ctxt.frame,
                       pdcp_read_header_g.inst,
                       len,
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 726b52be53381f89d79f90c26bbda5c90796692c..03fabf47b31facd3d84479c1a7cc874713cfc88c 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.c
@@ -43,61 +43,148 @@
 #include "DL-AM-RLC.h"
 
 
+//-----------------------------------------------------------------------------
+uint32_t
+rlc_am_get_status_pdu_buffer_occupancy(
+  rlc_am_entity_t * const      rlc_pP){
+
+	//Compute Max Status PDU size according to what has been received and not received in the window [vrR vrMS[
+
+    // minimum header size in bits to be transmitted: D/C + CPT + ACK_SN + E1
+	uint32_t                    nb_bits_to_transmit	  = RLC_AM_PDU_D_C_BITS + RLC_AM_STATUS_PDU_CPT_LENGTH + RLC_AM_SN_BITS + RLC_AM_PDU_E_BITS;
+	mem_block_t                  *cursor_p              = rlc_pP->receiver_buffer.head;
+    rlc_am_pdu_info_t            *pdu_info_cursor_p     = NULL;
+    int                           waited_so             = 0;
+
+	rlc_sn_t sn_cursor = rlc_pP->vr_r;
+	rlc_sn_t sn_prev = rlc_pP->vr_r;
+	rlc_sn_t sn_end = rlc_pP->vr_ms;
+	boolean_t	segment_loop_end	  = false;
+
+
+	if (sn_prev != sn_end)
+	{
+		while ((RLC_AM_DIFF_SN(sn_prev,rlc_pP->vr_r) < RLC_AM_DIFF_SN(sn_end,rlc_pP->vr_r)) && (cursor_p != NULL))
+		{
+			pdu_info_cursor_p     = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
+			sn_cursor             = pdu_info_cursor_p->sn;
+
+			// Add holes between sn_prev and sn_cursor
+			while ((sn_prev != sn_cursor) && (sn_prev != sn_end))
+			{
+				  /* Add 1 NACK_SN + E1 + E2 */
+				  nb_bits_to_transmit += (RLC_AM_SN_BITS + (RLC_AM_PDU_E_BITS << 1));
+				  sn_prev = RLC_AM_NEXT_SN(sn_prev);
+			} //end while (sn_prev != sn_cursor)
+
+			/* Handle case sn_cursor is partially received */
+			/* Each gap will add NACK_SN + E1 + E2 + SOStart + SOEnd */
+			if ((((rlc_am_rx_pdu_management_t*)(cursor_p->data))->all_segments_received == 0) && (RLC_AM_DIFF_SN(sn_cursor,rlc_pP->vr_r) < RLC_AM_DIFF_SN(sn_end,rlc_pP->vr_r)))
+			{
+                 /* Check lsf */
+				  segment_loop_end = (pdu_info_cursor_p->lsf == 1);
+
+	    		  /* Fill for [0 SO[ if SO not null */
+	    		  if (pdu_info_cursor_p->so) {
+	    			  nb_bits_to_transmit += (RLC_AM_SN_BITS + (RLC_AM_PDU_E_BITS << 1) + (RLC_AM_STATUS_PDU_SO_LENGTH << 1));
+	                  waited_so = pdu_info_cursor_p->so + pdu_info_cursor_p->payload_size;
+	    		  }
+	    		  else {
+	        		  waited_so = pdu_info_cursor_p->payload_size;
+	    		  }
+
+                  /* Go to next segment */
+                  cursor_p = cursor_p->next;
+                  if (cursor_p != NULL)
+                  {
+                      pdu_info_cursor_p     = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
+                  }
+
+	    		  /* Fill following gaps if any */
+	    		  while (!segment_loop_end)
+	    		  {
+	    			  if ((cursor_p != NULL) && (pdu_info_cursor_p->sn == sn_cursor))
+	    			  {
+		                  /* Check lsf */
+	    				  segment_loop_end = (pdu_info_cursor_p->lsf == 1);
+
+            			  if (waited_so < pdu_info_cursor_p->so) {
+    	                      nb_bits_to_transmit += (RLC_AM_SN_BITS + (RLC_AM_PDU_E_BITS << 1) + (RLC_AM_STATUS_PDU_SO_LENGTH << 1));
+            			  }
+            			  else {
+            				  /* contiguous segment: only update waited_so */
+            				  /* Assuming so and payload_size updated according to duplication removal done at reception ... */
+            				  waited_so += pdu_info_cursor_p->payload_size;
+            			  }
+
+            			  /* Go to next received PDU or PDU Segment */
+            			  cursor_p = cursor_p->next;
+    	                  if (cursor_p != NULL)
+    	                  {
+    		                  pdu_info_cursor_p     = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
+    	                  }
+	    			  }
+	    			  else
+	    			  {
+	    				  /* Fill last gap assuming LSF is not received */
+	    				  nb_bits_to_transmit += (RLC_AM_SN_BITS + (RLC_AM_PDU_E_BITS << 1) + (RLC_AM_STATUS_PDU_SO_LENGTH << 1));
+	    				  segment_loop_end = true;
+	    			  }
+	    		  } // end while (!segment_loop_end)
+			} // end if segments
+			else
+			{
+				  /* Go to next received PDU or PDU segment with different SN */
+				  do
+				  {
+					  cursor_p = cursor_p->next;
+				  } while ((cursor_p != NULL) && (((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info.sn == sn_cursor));
+			}
+
+			sn_prev = RLC_AM_NEXT_SN(sn_cursor);
+		}
+	} // end if (sn_prev != sn_end)
+
+	// round up to the greatest byte
+	return ((nb_bits_to_transmit + 7) >> 3);
+
+}
+
 //-----------------------------------------------------------------------------
 uint32_t
 rlc_am_get_buffer_occupancy_in_bytes (
   const protocol_ctxt_t* const ctxt_pP,
   rlc_am_entity_t * const      rlc_pP)
 {
-  uint32_t max_li_overhead;
-  uint32_t header_overhead;
-
   // priority of control trafic
   rlc_pP->status_buffer_occupancy = 0;
-  if (rlc_pP->status_requested) {
-    if (rlc_pP->t_status_prohibit.running == 0) {
+  if ((rlc_pP->status_requested) && !(rlc_pP->status_requested & RLC_AM_STATUS_NO_TX_MASK)) {
+      rlc_pP->status_buffer_occupancy = rlc_am_get_status_pdu_buffer_occupancy(rlc_pP);
 #if TRACE_RLC_AM_BO
 
-      if (((15  +  rlc_pP->num_nack_sn*(10+1)  +  rlc_pP->num_nack_so*(15+15+1) + 7) >> 3) > 0) {
         LOG_D(RLC, PROTOCOL_CTXT_FMT RB_AM_FMT" BO : CONTROL PDU %d bytes \n",
               PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
-              ((15  +  rlc_pP->num_nack_sn*(10+1)  +  rlc_pP->num_nack_so*(15+15+1) + 7) >> 3));
-      }
+			rlc_pP->status_buffer_occupancy);
 
 #endif
-      rlc_pP->status_buffer_occupancy = ((15  +  rlc_pP->num_nack_sn*(10+1)  +  rlc_pP->num_nack_so*(15+15+1) + 7) >> 3);
-    }
-  }
-
-  // data traffic
-  if (rlc_pP->nb_sdu_no_segmented <= 1) {
-    max_li_overhead = 0;
-  } else {
-    max_li_overhead = (((rlc_pP->nb_sdu_no_segmented - 1) * 3) / 2) + ((rlc_pP->nb_sdu_no_segmented - 1) % 2);
-  }
-
-  if (rlc_pP->sdu_buffer_occupancy == 0) {
-    header_overhead = 0;
-  } else {
-    header_overhead = 2;
   }
 
 
 #if TRACE_RLC_AM_BO
 
-  if ((rlc_pP->status_buffer_occupancy + rlc_pP->retransmission_buffer_occupancy + rlc_pP->sdu_buffer_occupancy + max_li_overhead + header_overhead) > 0) {
+  if ((rlc_pP->status_buffer_occupancy + rlc_pP->retrans_num_bytes_to_retransmit + rlc_pP->sdu_buffer_occupancy + max_li_overhead + header_overhead) > 0) {
     LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" BO : STATUS  BUFFER %d bytes \n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), rlc_pP->status_buffer_occupancy);
-    LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" BO : RETRANS BUFFER %d bytes \n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), rlc_pP->retransmission_buffer_occupancy);
+    LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" BO : RETRANS BUFFER %d bytes \n", PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP), rlc_pP->retrans_num_bytes_to_retransmit);
     LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" BO : SDU     BUFFER %d bytes + li_overhead %d bytes header_overhead %d bytes (nb sdu not segmented %d)\n",
           PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
           rlc_pP->sdu_buffer_occupancy,
-          max_li_overhead,
-          header_overhead,
+          0,
+          0,
           rlc_pP->nb_sdu_no_segmented);
   }
 
 #endif
-  return rlc_pP->status_buffer_occupancy + rlc_pP->retrans_num_bytes_to_retransmit + 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;
 }
 //-----------------------------------------------------------------------------
 void
@@ -150,9 +237,9 @@ config_req_rlc_am (
           PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p));
   }
 }
-uint32_t pollPDU_tab[PollPDU_pInfinity+1]= {4,8,16,32,64,128,256,1024}; // What is PollPDU_pInfinity??? 1024 for now
+uint16_t pollPDU_tab[PollPDU_pInfinity+1]= {4,8,16,32,64,128,256,RLC_AM_POLL_PDU_INFINITE}; //PollPDU_pInfinity is chosen to 0xFFFF for now
 uint32_t maxRetxThreshold_tab[UL_AM_RLC__maxRetxThreshold_t32+1]= {1,2,3,4,6,8,16,32};
-uint32_t pollByte_tab[PollByte_spare1]= {25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,10000}; // What is PollByte_kBinfinity??? 10000 for now
+uint32_t pollByte_tab[PollByte_spare1]= {25000,50000,75000,100000,125000,250000,375000,500000,750000,1000000,1250000,1500000,2000000,3000000,RLC_AM_POLL_BYTE_INFINITE}; // PollByte_kBinfinity is chosen to 0xFFFFFFFF for now
 #if defined(Rel14)
 uint32_t PollRetransmit_tab[T_PollRetransmit_spare5]= {5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110,115,120,125,130,135,140,145,150,155,160,165,170,175,180,185,190,195,200,205,210,215,220,225,230,235,240,245,250,300,350,400,450,500,800,1000,2000,4000};
 uint32_t am_t_Reordering_tab[32]= {0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,110,120,130,140,150,160,170,180,190,200,1600};
@@ -318,7 +405,7 @@ rlc_am_get_pdus (
   rlc_am_entity_t * const      rlc_pP
 )
 {
-  int display_flag = 0;
+  //int display_flag = 0;
   // 5.1.3.1 Transmit operations
   // 5.1.3.1.1
   // General
@@ -335,7 +422,8 @@ rlc_am_get_pdus (
   case RLC_DATA_TRANSFER_READY_STATE:
 
     // TRY TO SEND CONTROL PDU FIRST
-    if ((rlc_pP->nb_bytes_requested_by_mac > 2) && (rlc_pP->status_requested)) {
+    if ((rlc_pP->nb_bytes_requested_by_mac >= 2) &&
+    		((rlc_pP->status_requested) && !(rlc_pP->status_requested & RLC_AM_STATUS_NO_TX_MASK))) {
       // When STATUS reporting has been triggered, the receiving side of an AM RLC entity shall:
       // - if t-StatusProhibit is not running:
       //     - at the first transmission opportunity indicated by lower layer, construct a STATUS PDU and deliver it to lower layer;
@@ -346,140 +434,39 @@ rlc_am_get_pdus (
       //
       // When a STATUS PDU has been delivered to lower layer, the receiving side of an AM RLC entity shall:
       //     - start t-StatusProhibit.
-      if (rlc_pP->t_status_prohibit.running == 0) {
+
         rlc_am_send_status_pdu(ctxt_pP, rlc_pP);
         mem_block_t* pdu = list_remove_head(&rlc_pP->control_pdu_list);
 
         if (pdu) {
           list_add_tail_eurecom (pdu, &rlc_pP->pdus_to_mac_layer);
-          rlc_pP->status_requested = 0;
+          RLC_AM_CLEAR_ALL_STATUS(rlc_pP->status_requested);
           rlc_pP->status_buffer_occupancy = 0;
           rlc_am_start_timer_status_prohibit(ctxt_pP, rlc_pP);
           return;
         }
-      } else {
-        LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" DELAYED SENT STATUS PDU BECAUSE T-STATUS-PROHIBIT RUNNING (TIME-OUT %u)\n",
-              PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
-              rlc_pP->t_status_prohibit.ms_time_out);
       }
+      else {
+              LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" DELAYED SENT STATUS PDU (Available MAC Data %u)(T-PROHIBIT %u) (DELAY FLAG %u)\n",
+              PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
+					rlc_pP->nb_bytes_requested_by_mac,rlc_pP->t_status_prohibit.ms_time_out,(rlc_pP->status_requested & RLC_AM_STATUS_TRIGGERED_DELAYED));
     }
 
-    /*while ((rlc_pP->nb_bytes_requested_by_mac > 0) && (stay_on_this_list)) {
-        mem_block_t* pdu = list_get_head(&rlc_pP->control_pdu_list);
-        if (pdu != NULL {
-            if ( ((rlc_am_tx_control_pdu_management_t*)(pdu->data))->size <= rlc_pP->nb_bytes_requested_by_mac) {
-                pdu = list_remove_head(&rlc_pP->control_pdu_list);
-    #if TRACE_RLC_AM_TX
-                msg ("[FRAME %5u][%s][RLC_AM][MOD %u/%u][RB %u] SEND CONTROL PDU\n", ((rlc_am_entity_t *) rlc_pP)->module_id,((rlc_am_entity_t *) rlc_pP)->rb_id, ctxt_pP->frame);
-    #endif
-                list_add_tail_eurecom (pdu, &rlc_pP->pdus_to_mac_layer);
-                rlc_pP->nb_bytes_requested_by_mac = rlc_pP->nb_bytes_requested_by_mac - ((rlc_am_tx_control_pdu_management_t*)(pdu->data))->size;
-            } else {
-              stay_on_this_list = 0;
-            }
-        } else {
-            stay_on_this_list = 0;
-        }
-    }*/
     // THEN TRY TO SEND RETRANS PDU
-    if (rlc_pP->first_retrans_pdu_sn >= 0) {
-      rlc_am_tx_data_pdu_management_t* tx_data_pdu_management;
-
-      // tx min 3 bytes because of the size of the RLC header
-      while ((rlc_pP->nb_bytes_requested_by_mac > 2) &&
-             (rlc_pP->first_retrans_pdu_sn  >= 0) &&
-             (rlc_pP->first_retrans_pdu_sn != rlc_pP->vt_s)) {
-
-        tx_data_pdu_management = &rlc_pP->pdu_retrans_buffer[rlc_pP->first_retrans_pdu_sn];
-
-        if ((tx_data_pdu_management->header_and_payload_size <= rlc_pP->nb_bytes_requested_by_mac) && (tx_data_pdu_management->retx_count >= 0)
-            && (tx_data_pdu_management->nack_so_start == 0) && (tx_data_pdu_management->nack_so_stop == 0x7FFF)) {
-          mem_block_t* copy = rlc_am_retransmit_get_copy(ctxt_pP, rlc_pP, rlc_pP->first_retrans_pdu_sn);
-          LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" RE-SEND DATA PDU SN %04d   %d BYTES\n",
-                PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
-                rlc_pP->first_retrans_pdu_sn,
-                tx_data_pdu_management->header_and_payload_size);
-          rlc_pP->stat_tx_data_pdu                   += 1;
-          rlc_pP->stat_tx_retransmit_pdu             += 1;
-          rlc_pP->stat_tx_retransmit_pdu_by_status   += 1;
-          rlc_pP->stat_tx_data_bytes                 += tx_data_pdu_management->header_and_payload_size;
-          rlc_pP->stat_tx_retransmit_bytes           += tx_data_pdu_management->header_and_payload_size;
-          rlc_pP->stat_tx_retransmit_bytes_by_status += tx_data_pdu_management->header_and_payload_size;
-
-          list_add_tail_eurecom (copy, &rlc_pP->pdus_to_mac_layer);
-          rlc_pP->nb_bytes_requested_by_mac = rlc_pP->nb_bytes_requested_by_mac - tx_data_pdu_management->header_and_payload_size;
-
-          tx_data_pdu_management->retx_count += 1;
-          return;
-        } else if ((tx_data_pdu_management->retx_count >= 0) && (rlc_pP->nb_bytes_requested_by_mac >= RLC_AM_MIN_SEGMENT_SIZE_REQUEST)) {
-          LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" SEND SEGMENT OF DATA PDU SN %04d MAC BYTES %d SIZE %d RTX COUNT %d  nack_so_start %d nack_so_stop %04X(hex)\n",
-                PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
-                rlc_pP->first_retrans_pdu_sn,
-                rlc_pP->nb_bytes_requested_by_mac,
-                tx_data_pdu_management->header_and_payload_size,
-                tx_data_pdu_management->retx_count,
-                tx_data_pdu_management->nack_so_start,
-                tx_data_pdu_management->nack_so_stop);
-
-          mem_block_t* copy = rlc_am_retransmit_get_subsegment(
-                                ctxt_pP,
-                                rlc_pP,
-                                rlc_pP->first_retrans_pdu_sn,
-                                &rlc_pP->nb_bytes_requested_by_mac);
-          LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" SEND SEGMENT OF DATA PDU SN %04d (NEW SO %05d)\n",
-                PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
-                rlc_pP->first_retrans_pdu_sn,
-                tx_data_pdu_management->nack_so_start);
-
-          rlc_pP->stat_tx_data_pdu                   += 1;
-          rlc_pP->stat_tx_retransmit_pdu             += 1;
-          rlc_pP->stat_tx_retransmit_pdu_by_status   += 1;
-          rlc_pP->stat_tx_data_bytes                 += (((struct mac_tb_req*)(copy->data))->tb_size);
-          rlc_pP->stat_tx_retransmit_bytes           += (((struct mac_tb_req*)(copy->data))->tb_size);
-          rlc_pP->stat_tx_retransmit_bytes_by_status += (((struct mac_tb_req*)(copy->data))->tb_size);
-          list_add_tail_eurecom (copy, &rlc_pP->pdus_to_mac_layer);
-        } else {
-          break;
-        }
+      if ((rlc_pP->retrans_num_bytes_to_retransmit) && (rlc_pP->nb_bytes_requested_by_mac > 2)) {
 
-        // update first_retrans_pdu_sn
-        while ((rlc_pP->first_retrans_pdu_sn != rlc_pP->vt_s) &&
-               (!(rlc_pP->pdu_retrans_buffer[rlc_pP->first_retrans_pdu_sn].flags.retransmit))) {
-          rlc_pP->first_retrans_pdu_sn = (rlc_pP->first_retrans_pdu_sn+1) & RLC_AM_SN_MASK;
-          LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" UPDATED first_retrans_pdu_sn SN %04d\n",
-                PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
-                rlc_pP->first_retrans_pdu_sn);
-        };
-
-        display_flag = 1;
-
-        if (rlc_pP->first_retrans_pdu_sn == rlc_pP->vt_s) {
-          // no more pdu to be retransmited
-          rlc_pP->first_retrans_pdu_sn = -1;
-          display_flag = 0;
-          LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" CLEAR first_retrans_pdu_sn\n",
-                PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
-        }
+      /* Get 1 AM data PDU or PDU segment to retransmit */
+      mem_block_t* pdu_retx = rlc_am_get_pdu_to_retransmit(ctxt_pP, rlc_pP);
 
-        if (display_flag > 0) {
-          LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" UPDATED first_retrans_pdu_sn %04d\n",
-                PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
-                rlc_pP->first_retrans_pdu_sn);
-        }
+      if (pdu_retx != NULL) {
+    	  list_add_tail_eurecom (pdu_retx, &rlc_pP->pdus_to_mac_layer);
 
-        return;
-
-        /* ONLY ONE TB PER TTI
-                            if ((tx_data_pdu_management->retx_count >= 0) && (rlc_pP->nb_bytes_requested_by_mac < RLC_AM_MIN_SEGMENT_SIZE_REQUEST)) {
-        #if TRACE_RLC_AM_TX
-                              msg ("[FRAME %5u][%s][RLC_AM][MOD %u/%u][RB %u] BREAK LOOP ON RETRANSMISSION BECAUSE ONLY %d BYTES ALLOWED TO TRANSMIT BY MAC\n",ctxt_pP->frame,  ((rlc_am_entity_t *) rlc_pP)->module_id,((rlc_am_entity_t *) rlc_pP)->rb_id, rlc_pP->nb_bytes_requested_by_mac);
-        #endif
-                              break;
-                            }*/
-      }
-    }
+          return;
+        }
+        }
 
-    if ((rlc_pP->nb_bytes_requested_by_mac > 2) && (rlc_pP->vt_s != rlc_pP->vt_ms)) {
+    // THEN TRY TO SEND NEW DATA PDU
+    if ((rlc_pP->nb_bytes_requested_by_mac > 2) && (rlc_pP->sdu_buffer_occupancy) && (rlc_pP->vt_s != rlc_pP->vt_ms)) {
       rlc_am_segment_10(ctxt_pP, rlc_pP);
       list_add_list (&rlc_pP->segmentation_pdu_list, &rlc_pP->pdus_to_mac_layer);
 
@@ -490,29 +477,6 @@ rlc_am_get_pdus (
       }
     }
 
-    if ((rlc_pP->pdus_to_mac_layer.head == NULL) &&
-        (rlc_am_is_timer_poll_retransmit_timed_out(ctxt_pP, rlc_pP)) &&
-        (rlc_pP->nb_bytes_requested_by_mac > 2)) {
-      rlc_am_retransmit_any_pdu(ctxt_pP, rlc_pP);
-      return;
-    } else {
-      LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" COULD NOT RETRANSMIT ANY PDU BECAUSE ",
-            PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
-
-      if (rlc_pP->pdus_to_mac_layer.head != NULL) {
-        LOG_D(RLC, "THERE ARE SOME PDUS READY TO TRANSMIT ");
-      }
-
-      if (!(rlc_am_is_timer_poll_retransmit_timed_out(ctxt_pP, rlc_pP))) {
-        LOG_D(RLC, "TIMER POLL DID NOT TIMED OUT (RUNNING = %d NUM PDUS TO RETRANS = %d  NUM BYTES TO RETRANS = %d) ", rlc_pP->t_poll_retransmit.running,
-              rlc_pP->retrans_num_pdus, rlc_pP->retrans_num_bytes_to_retransmit);
-      }
-
-      if (rlc_pP->nb_bytes_requested_by_mac <= 2) {
-        LOG_D(RLC, "NUM BYTES REQUESTED BY MAC = %d", rlc_pP->nb_bytes_requested_by_mac);
-      }
-      LOG_D(RLC, "\n");
-    }
 
     break;
 
@@ -554,7 +518,8 @@ rlc_am_mac_status_indication (
   const protocol_ctxt_t* const ctxt_pP,
   void * const                 rlc_pP,
   const uint16_t               tb_sizeP,
-  struct mac_status_ind        tx_statusP)
+  struct mac_status_ind        tx_statusP,
+  const eNB_flag_t enb_flagP)
 {
   struct mac_status_resp  status_resp;
   uint16_t  sdu_size = 0;
@@ -578,18 +543,38 @@ rlc_am_mac_status_indication (
    */
   if (rlc->input_sdus == NULL) return status_resp;
 
-  if (rlc->last_frame_status_indication != ctxt_pP->frame) {
+  if (rlc->last_absolute_subframe_status_indication != (PROTOCOL_CTXT_TIME_MILLI_SECONDS(ctxt_pP))) {
     rlc_am_check_timer_poll_retransmit(ctxt_pP, rlc);
     rlc_am_check_timer_reordering(ctxt_pP, rlc);
     rlc_am_check_timer_status_prohibit(ctxt_pP, rlc);
   }
 
-  rlc->last_frame_status_indication = ctxt_pP->frame;
+  rlc->last_absolute_subframe_status_indication = PROTOCOL_CTXT_TIME_MILLI_SECONDS(ctxt_pP);
 
   rlc->nb_bytes_requested_by_mac = tb_sizeP;
 
   status_resp.buffer_occupancy_in_bytes = rlc_am_get_buffer_occupancy_in_bytes(ctxt_pP, rlc);
 
+  // For eNB scheduler : Add Max RLC header size for new PDU
+  // For UE : do not add RLC header part to be compliant with BSR definition in 36.321
+  if (enb_flagP == ENB_FLAG_YES) {
+	  uint32_t max_li_overhead = 0;
+	  uint32_t header_overhead = 0;
+
+	   if (rlc->nb_sdu_no_segmented > 1) {
+	   	/* This computation assumes there is no SDU with size greater than 2047 bytes, otherwise a new PDU must be built except for LI15 configuration from Rel12*/
+	 	  uint32_t num_li = rlc->nb_sdu_no_segmented - 1;
+	       max_li_overhead = num_li + (num_li >> 1) + (num_li & 1);
+	   }
+
+	   if (rlc->sdu_buffer_occupancy > 0) {
+	     header_overhead = 2;
+	   }
+
+	   status_resp.buffer_occupancy_in_bytes += (header_overhead + max_li_overhead);
+  }
+
+
   if ((rlc->input_sdus[rlc->current_sdu_index].mem_block != NULL) && (status_resp.buffer_occupancy_in_bytes)) {
 
     //status_resp.buffer_occupancy_in_bytes += ((rlc_am_entity_t *) rlc)->tx_header_min_length_in_bytes;
@@ -610,32 +595,16 @@ rlc_am_mac_status_indication (
     }
 
   } else {
-	  if (rlc_am_is_timer_poll_retransmit_timed_out(ctxt_pP, rlc)) {
-		  if ((status_resp.buffer_occupancy_in_bytes == 0) && (rlc->input_sdus[rlc->current_sdu_index].mem_block == NULL) && (rlc->nb_sdu > 0)) {
-			  // force BO to be > 0
-			  rlc_sn_t             sn           = (rlc->vt_s - 1) & RLC_AM_SN_MASK;
-			  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) {
-			    if (rlc->pdu_retrans_buffer[sn].mem_block != NULL) {
-			      if (!found_pdu) {
-			        found_pdu = 1;
-			        found_pdu_sn = sn;
-			      }
-			      status_resp.buffer_occupancy_in_bytes = rlc->pdu_retrans_buffer[sn].header_and_payload_size;
-			      status_resp.buffer_occupancy_in_pdus  = rlc->nb_sdu;
-			      status_resp.head_sdu_remaining_size_to_send  = status_resp.buffer_occupancy_in_bytes;
-			      // TODO head_sdu_is_segmented
-			      break;
+	  /* Not so many possibilities ... */
+	  /* either buffer_occupancy_in_bytes = 0 and that's it */
+	  /* or we have segmented all received SDUs and buffer occupancy is then made of retransmissions and/or status pdu pending */
+	  /* then consider only retransmission buffer for the specific BO values used by eNB scheduler (not used up to now...) */
+	  if (rlc->retrans_num_bytes_to_retransmit) {
+		  status_resp.buffer_occupancy_in_pdus = rlc->retrans_num_pdus;
+		  status_resp.head_sdu_remaining_size_to_send = rlc->retrans_num_bytes_to_retransmit;
+		  status_resp.head_sdu_is_segmented = 1;
 			    }
 			  }
-		  }
-	  }
-  }
 #if MESSAGE_CHART_GENERATOR_RLC_MAC
   MSC_LOG_RX_MESSAGE(
     (ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,
@@ -678,11 +647,23 @@ rlc_am_mac_status_indication (
 #endif
   return status_resp;
 }
+
+//-----------------------------------------------------------------------------
+void
+rlc_am_set_nb_bytes_requested_by_mac (
+  void * const            rlc_pP,
+  const tb_size_t         tb_sizeP
+)
+{
+	((rlc_am_entity_t *) rlc_pP)->nb_bytes_requested_by_mac = tb_sizeP;
+}
+
 //-----------------------------------------------------------------------------
 struct mac_data_req
 rlc_am_mac_data_request (
   const protocol_ctxt_t* const ctxt_pP,
-  void * const                 rlc_pP
+  void * const                 rlc_pP,
+  const eNB_flag_t        enb_flagP
 )
 {
   struct mac_data_req data_req;
@@ -720,7 +701,10 @@ rlc_am_mac_data_request (
           data_req.data.nb_elements);
   }
 
+  if (enb_flagP) {
+	  // redundant in UE MAC Tx processing and not used in eNB ...
   data_req.buffer_occupancy_in_bytes   = rlc_am_get_buffer_occupancy_in_bytes(ctxt_pP, l_rlc_p);
+  }
   data_req.rlc_info.rlc_protocol_state = l_rlc_p->protocol_state;
 
 #if TRACE_RLC_AM_PDU || MESSAGE_CHART_GENERATOR
@@ -1267,14 +1251,19 @@ rlc_am_data_req (
     l_rlc_p->input_sdus[l_rlc_p->next_sdu_index].flags.no_new_sdu_segmented_in_last_pdu = 0;
     //l_rlc_p->input_sdus[l_rlc_p->next_sdu_index].li_index_for_discard = -1;
     l_rlc_p->next_sdu_index = (l_rlc_p->next_sdu_index + 1) % RLC_AM_SDU_CONTROL_BUFFER_SIZE;
-    LOG_I(RLC, PROTOCOL_RLC_AM_CTXT_FMT" RLC_AM_DATA_REQ size %d Bytes,  NB SDU %d current_sdu_index=%d next_sdu_index=%d conf %d mui %d\n",
+    if (l_rlc_p->channel_id <3)
+    {
+    LOG_I(RLC, PROTOCOL_RLC_AM_CTXT_FMT" RLC_AM_DATA_REQ size %d Bytes,  NB SDU %d current_sdu_index=%d next_sdu_index=%d conf %d mui %d vtA %d vtS %d\n",
           PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p),
           data_size,
           l_rlc_p->nb_sdu,
           l_rlc_p->current_sdu_index,
           l_rlc_p->next_sdu_index,
           conf,
-          mui);
+          mui,
+		  l_rlc_p->vt_a,
+		  l_rlc_p->vt_s);
+    }
   } else {
 #if MESSAGE_CHART_GENERATOR
     mui         = ((struct rlc_am_data_req*) (sdu_pP->data))->mui;
@@ -1291,12 +1280,14 @@ rlc_am_data_req (
       data_size,
       mui);
 #endif
-    LOG_W(RLC, PROTOCOL_RLC_AM_CTXT_FMT" RLC_AM_DATA_REQ BUFFER FULL, NB SDU %d current_sdu_index=%d next_sdu_index=%d size_input_sdus_buffer=%d\n",
+    LOG_W(RLC, PROTOCOL_RLC_AM_CTXT_FMT" RLC_AM_DATA_REQ BUFFER FULL, NB SDU %d current_sdu_index=%d next_sdu_index=%d size_input_sdus_buffer=%d vtA=%d vtS=%d\n",
           PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,l_rlc_p),
           l_rlc_p->nb_sdu,
           l_rlc_p->current_sdu_index,
           l_rlc_p->next_sdu_index,
-          RLC_AM_SDU_CONTROL_BUFFER_SIZE);
+          RLC_AM_SDU_CONTROL_BUFFER_SIZE,
+		  l_rlc_p->vt_a,
+		  l_rlc_p->vt_s);
     LOG_W(RLC, "                                        input_sdus[].mem_block=%p next input_sdus[].flags.segmented=%d\n",
           l_rlc_p->input_sdus[l_rlc_p->next_sdu_index].mem_block, l_rlc_p->input_sdus[l_rlc_p->next_sdu_index].flags.segmented);
     l_rlc_p->stat_tx_pdcp_sdu_discarded   += 1;
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.h
index 61c6a043cc0ba424571e2cba9d662461802563b6..4619a07315fa67cc6d6836a5b125c2ba208e0960 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.h
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am.h
@@ -267,23 +267,32 @@ private_rlc_am(   void     rlc_am_get_pdus (const protocol_ctxt_t* const ctxtP,v
 */
 protected_rlc_am( void     rlc_am_rx (const protocol_ctxt_t* const ctxtP,void * const rlc_pP, struct mac_data_ind);)
 
-/*! \fn struct mac_status_resp rlc_am_mac_status_indication (const protocol_ctxt_t* const ctxtP,void * const rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP)
+/*! \fn struct mac_status_resp rlc_am_mac_status_indication (const protocol_ctxt_t* const ctxtP,void * const rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP,const eNB_flag_t enb_flagP)
 * \brief    Request the maximum number of bytes that can be served by RLC instance to MAC and fix the amount of bytes requested by MAC for next RLC transmission.
 * \param[in]  ctxt_pP          Running context.
 * \param[in]  rlc_pP           RLC AM protocol instance pointer.
 * \param[in]  tbs_sizeP                 Number of bytes requested by MAC for next transmission.
 * \param[in]  tx_statusP                Transmission status given by MAC on previous MAC transmission of the PDU.
+* \param[in]  enb_flagP        eNB or UE flag indication.
 * \return     The maximum number of bytes that can be served by RLC instance to MAC.
 */
-public_rlc_am(    struct mac_status_resp rlc_am_mac_status_indication (const protocol_ctxt_t* const ctxtP, void * const rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP);)
+public_rlc_am(    struct mac_status_resp rlc_am_mac_status_indication (const protocol_ctxt_t* const ctxtP, void * const rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP,const eNB_flag_t enb_flagP);)
 
-/*! \fn struct mac_data_req rlc_am_mac_data_request (const protocol_ctxt_t* const ctxtP,void * const rlc_pP)
+/*! \fn void rlc_am_set_nb_bytes_requested_by_mac (void * const            rlc_pP,const tb_size_t         tb_sizeP)
+* \brief    Set available TBS for RLC Tx just before am_mac_data_request. Used for UE only.
+* \param[in]  rlc_pP           RLC AM protocol instance pointer.
+* \param[in]  tb_sizeP         Available Tx Transport Block size in bytes.
+*/
+public_rlc_am(		void rlc_am_set_nb_bytes_requested_by_mac (void * const            rlc_pP,const tb_size_t         tb_sizeP);)
+
+/*! \fn struct mac_data_req rlc_am_mac_data_request (const protocol_ctxt_t* const ctxtP,void * const rlc_pP,const eNB_flag_t   enb_flagP)
 * \brief    Gives PDUs to lower layer MAC.
 * \param[in]  ctxt_pP          Running context.
 * \param[in]  rlc_pP           RLC AM protocol instance pointer.
+* \param[in]  enb_flagP        eNB or UE flag
 * \return     A PDU of the previously requested number of bytes, and the updated maximum number of bytes that can be served by RLC instance to MAC for next RLC transmission.
 */
-public_rlc_am(    struct mac_data_req rlc_am_mac_data_request (const protocol_ctxt_t* const ctxtP,void * const rlc_pP);)
+public_rlc_am(    struct mac_data_req rlc_am_mac_data_request (const protocol_ctxt_t* const ctxtP,void * const rlc_pP,const eNB_flag_t  enb_flagP);)
 
 /*! \fn void     rlc_am_mac_data_indication (const protocol_ctxt_t* const ctxtP,void * const rlc_pP, struct mac_data_ind data_indP)
 * \brief    Receive PDUs from lower layer MAC.
@@ -293,6 +302,13 @@ public_rlc_am(    struct mac_data_req rlc_am_mac_data_request (const protocol_ct
 */
 public_rlc_am(    void     rlc_am_mac_data_indication (const protocol_ctxt_t* const ctxtP,void * const rlc_pP, struct mac_data_ind data_indP);)
 
+/*! \fn uint32_t rlc_am_get_buffer_occupancy_in_bytes (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const      rlc_pP)
+* \brief   Get Tx Buffer Occupancy.
+* \param[in]  ctxt_pP          Running context.
+* \param[in]  rlc_pP           RLC AM protocol instance pointer.
+*/
+public_rlc_am(    uint32_t rlc_am_get_buffer_occupancy_in_bytes (const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t * const      rlc_pP);)
+
 /*! \fn void     rlc_am_data_req (const protocol_ctxt_t* const ctxtP,void * const rlc_pP, mem_block_t *sduP)
 * \brief    Interface with higher layers, buffer higher layer SDUS for transmission.
 * \param[in]  ctxt_pP          Running context.
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_constants.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_constants.h
index dcc5f2de8fe511da69b6b57d641db400d1033bf3..12af0279a8143fcd966f72c4b4d83e6f92b1fc12 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_constants.h
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_constants.h
@@ -48,19 +48,22 @@
 #    define RLC_AM_SDU_DATA_BUFFER_SIZE           64*1024
 
 /** Max number of incoming SDUs from upper layer that can be buffered in a RLC AM protocol instance. */
-#    define RLC_AM_SDU_CONTROL_BUFFER_SIZE        128
+#    define RLC_AM_SDU_CONTROL_BUFFER_SIZE        1024
 
 /** Size of the retransmission buffer (number of PDUs). */
-#    define RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE RLC_AM_SN_MODULO
+#    define RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE RLC_AM_WINDOW_SIZE
 
 /** PDU minimal header size in bytes. */
 #    define RLC_AM_HEADER_MIN_SIZE                2
 
+/** PDU Segment minimal header size in bytes = PDU header + SOStart + SOEnd. */
+#    define RLC_AM_PDU_SEGMENT_HEADER_MIN_SIZE    4
+
 /** If we want to send a segment of a PDU, then the min transport block size requested by MAC should be this amount. */
 #    define RLC_AM_MIN_SEGMENT_SIZE_REQUEST       8
 
 /** Max SDUs that can fit in a PDU. */
-#    define RLC_AM_MAX_SDU_IN_PDU                 32
+#    define RLC_AM_MAX_SDU_IN_PDU                 128
 
 /** Max fragments for a SDU. */
 #    define RLC_AM_MAX_SDU_FRAGMENTS              32
@@ -69,6 +72,99 @@
 #    define RLC_AM_MAX_NACK_IN_STATUS_PDU         1023
 
 /** Max holes created by NACK_SN with segment offsets for a PDU in the retransmission buffer. */
-#    define RLC_AM_MAX_HOLES_REPORT_PER_PDU       32
+#    define RLC_AM_MAX_HOLES_REPORT_PER_PDU       16
 /** @} */
-#    endif
+
+#define	RLC_AM_POLL_PDU_INFINITE				0xFFFF
+#define	RLC_AM_POLL_BYTE_INFINITE				0xFFFFFFFF
+
+/* MACRO DEFINITIONS */
+
+#define RLC_AM_NEXT_SN(sn)         (((sn)+1) & (RLC_AM_SN_MASK))
+#define RLC_AM_PREV_SN(sn)         (((sn)+(RLC_AM_SN_MODULO)-1) & (RLC_AM_SN_MASK))
+
+#define RLC_DIFF_SN(sn,snref,modulus)  ((sn+(modulus)-snref) & ((modulus)-1))
+#define RLC_SN_IN_WINDOW(sn,snref,modulus)  ((RLC_DIFF_SN(sn,snref,modulus)) < ((modulus) >> 1))
+
+#define RLC_AM_DIFF_SN(sn,snref)       (RLC_DIFF_SN(sn,snref,RLC_AM_SN_MODULO))
+#define RLC_AM_SN_IN_WINDOW(sn,snref)  (RLC_SN_IN_WINDOW(sn,snref,RLC_AM_SN_MODULO))
+
+#define RLC_SET_BIT(x,offset)      ((x) |= (1 << (offset)))
+#define RLC_GET_BIT(x,offset)      (((x) & (1 << (offset))) >> (offset))
+#define RLC_CLEAR_BIT(x,offset)    ((x) &= ~(1 << (offset)))
+
+#define RLC_SET_EVENT(x,event)         ((x) |= (event))
+#define RLC_GET_EVENT(x,event)         ((x) & (event))
+#define RLC_CLEAR_EVENT(x,event)       ((x) &= (~(event)))
+
+/* Common to Data and Status PDU */
+#define RLC_AM_SN_BITS				10
+#define RLC_AM_PDU_D_C_BITS          1
+#define RLC_AM_PDU_E_BITS            1
+#define RLC_AM_PDU_FI_BITS           2
+#define RLC_AM_PDU_POLL_BITS         1
+#define RLC_AM_PDU_RF_BITS           1
+
+
+#define RLC_AM_LI_BITS				11
+#define RLC_AM_LI_MASK				0x7FF
+
+
+/* AM Data PDU */
+#define RLC_AM_PDU_E_OFFSET                2
+#define RLC_AM_PDU_FI_OFFSET               (RLC_AM_PDU_E_OFFSET + RLC_AM_PDU_E_BITS)
+#define RLC_AM_PDU_POLL_OFFSET             (RLC_AM_PDU_FI_OFFSET + RLC_AM_PDU_FI_BITS)
+#define RLC_AM_PDU_RF_OFFSET               (RLC_AM_PDU_POLL_OFFSET + RLC_AM_PDU_POLL_BITS)
+#define RLC_AM_PDU_D_C_OFFSET              (RLC_AM_PDU_RF_OFFSET + RLC_AM_PDU_RF_BITS)
+
+#define RLC_AM_PDU_GET_FI_START(px)       (RLC_GET_BIT((px),RLC_AM_PDU_FI_OFFSET + 1))
+#define RLC_AM_PDU_GET_FI_END(px)       (RLC_GET_BIT((px),RLC_AM_PDU_FI_OFFSET))
+
+#define RLC_AM_PDU_GET_LI(x,offset)       (((x) >> (offset)) & RLC_AM_LI_MASK)
+#define RLC_AM_PDU_SET_LI(x,li,offset)       ((x) |= (((li) & RLC_AM_LI_MASK) << (offset)))
+
+#define RLC_AM_PDU_SET_E(px)      	(RLC_SET_BIT((px),RLC_AM_PDU_E_OFFSET))
+#define RLC_AM_PDU_SET_D_C(px)      (RLC_SET_BIT((px),RLC_AM_PDU_D_C_OFFSET))
+#define RLC_AM_PDU_SET_RF(px)       (RLC_SET_BIT((px),RLC_AM_PDU_RF_OFFSET))
+#define RLC_AM_PDU_SET_POLL(px)     (RLC_SET_BIT((px),RLC_AM_PDU_POLL_OFFSET))
+#define RLC_AM_PDU_CLEAR_POLL(px)   (RLC_CLEAR_BIT((px),RLC_AM_PDU_POLL_OFFSET))
+
+#define RLC_AM_PDU_SEGMENT_SO_LENGTH       15
+#define RLC_AM_PDU_SEGMENT_SO_BYTES        2
+#define RLC_AM_PDU_SEGMENT_SO_OFFSET       0
+#define RLC_AM_PDU_LSF_OFFSET              (RLC_AM_PDU_SEGMENT_SO_OFFSET + RLC_AM_PDU_SEGMENT_SO_LENGTH)
+
+#define RLC_AM_PDU_SET_LSF(px)      	(RLC_SET_BIT((px),RLC_AM_PDU_LSF_OFFSET))
+
+#define RLC_AM_HEADER_LI_LENGTH(li)          ((li) + ((li)>>1) + ((li)&1))
+#define RLC_AM_PDU_SEGMENT_HEADER_SIZE(numLis) (RLC_AM_PDU_SEGMENT_HEADER_MIN_SIZE + RLC_AM_HEADER_LI_LENGTH(numLis))
+
+/* STATUS PDU */
+#define RLC_AM_STATUS_PDU_CPT_STATUS           0
+
+#define RLC_AM_STATUS_PDU_CPT_OFFSET           4
+#define RLC_AM_STATUS_PDU_CPT_LENGTH           3
+
+#define RLC_AM_STATUS_PDU_ACK_SN_OFFSET        2
+
+#define RLC_AM_STATUS_PDU_SO_LENGTH            15
+
+#define RLC_AM_STATUS_PDU_SO_END_ALL_BYTES     0x7FFF
+
+
+/* Uplink STATUS PDU trigger events */
+#define RLC_AM_STATUS_NOT_TRIGGERED               0
+#define RLC_AM_STATUS_TRIGGERED_POLL              0x01    /* Status Report is triggered by a received poll */
+#define RLC_AM_STATUS_TRIGGERED_T_REORDERING      0x02    /* Status Report is triggered by Timer Reordering Expiry */
+#define RLC_AM_STATUS_TRIGGERED_DELAYED           0x10    /* Status is delayed until SN(receivedPoll) < VR(MS) */
+#define RLC_AM_STATUS_PROHIBIT                    0x20    /* TimerStatusProhibit still running */
+#define RLC_AM_STATUS_NO_TX_MASK				  (RLC_AM_STATUS_PROHIBIT | RLC_AM_STATUS_TRIGGERED_DELAYED)
+
+/* Status triggered (bit 5-7) will be concatenated with Poll triggered (bit 0-4) for RLCdec. RLC_AM_STATUS_TRIGGERED_DELAYED is not recorded. */
+#define RLC_AM_SET_STATUS(x,event)     (RLC_SET_EVENT(x,event))
+#define RLC_AM_GET_STATUS(x,event)     (RLC_GET_EVENT(x,event))
+#define RLC_AM_CLEAR_STATUS(x,event)   (RLC_CLEAR_EVENT(x,event))
+#define RLC_AM_CLEAR_ALL_STATUS(x)     ((x) = (RLC_AM_STATUS_NOT_TRIGGERED))
+
+
+#endif
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_entity.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_entity.h
index 42114d42691d20659f7d255c5781a885513651a6..602e8e98c2f7ff1bc3abef94b3ba07c1fe8fe45c 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_entity.h
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_entity.h
@@ -57,7 +57,6 @@ typedef struct rlc_am_entity_s {
   boolean_t         is_data_plane;                      /*!< \brief To know if the RLC belongs to a data radio bearer or a signalling radio bearer, for statistics and trace purpose. */
 
   rlc_buffer_occupancy_t sdu_buffer_occupancy;               /*!< \brief Number of bytes of unsegmented SDUs. */
-  rlc_buffer_occupancy_t retransmission_buffer_occupancy;    /*!< \brief Number of bytes of PDUs in retransmission buffer waiting for a ACK. */
   rlc_buffer_occupancy_t status_buffer_occupancy;            /*!< \brief Number of bytes of control PDUs waiting for transmission. */
 
   rlc_am_control_pdu_info_t  control_pdu_info;
@@ -69,17 +68,14 @@ typedef struct rlc_am_entity_s {
   pthread_mutex_t      lock_input_sdus;
   rlc_am_tx_sdu_management_t   *input_sdus;           /*!< \brief Input SDU buffer (for SDUs coming from upper layers). */
   signed int      nb_sdu;                             /*!< \brief Total number of valid rlc_am_tx_sdu_management_t in input_sdus[]. */
-  signed int      nb_sdu_no_segmented;                /*!< \brief Total number of SDUs not segmented and partially segmented. */
+  signed int      nb_sdu_no_segmented;                /*!< \brief Total number of SDUs not segmented and partially segmented. nb_sdu_no_segmented = next_sdu_index - current_sdu_index */
   signed int      next_sdu_index;                     /*!< \brief Next SDU index in input_sdus array where for a new incoming SDU. */
-  signed int      current_sdu_index;                  /*!< \brief Current SDU index in input_sdus array to be segmented. */
+  signed int      current_sdu_index;                  /*!< \brief Current SDU index in input_sdus array to be segmented which is not segmented or partially segmented. */
 
 
-  rlc_am_tx_data_pdu_management_t *pdu_retrans_buffer;       /*!< \brief Retransmission buffer. */
+  rlc_am_tx_data_pdu_management_t *tx_data_pdu_buffer;       /*!< \brief Transmission PDU data buffer. Used also for retransmissions */
   signed int      retrans_num_pdus;                          /*!< \brief Number of PDUs in the retransmission buffer. */
-  signed int      retrans_num_bytes;                         /*!< \brief Number of bytes in the retransmission buffer. */
-  signed int      retrans_num_bytes_to_retransmit;           /*!< \brief Number of bytes in the retransmission buffer to be retransmitted. */
-  unsigned int    num_nack_so;                               /*!< \brief Number of segment offsets asked to be retransmitted by peer RLC entity. */
-  unsigned int    num_nack_sn;                               /*!< \brief Number of segment asked to be retransmitted by peer RLC entity. */
+  signed int      retrans_num_bytes_to_retransmit;           /*!< \brief Number of bytes in the retransmission buffer to be retransmitted. Only payload is taken into account */
   boolean_t       force_poll;                                /*!< \brief force poll due to t_poll_retransmit time-out. */
 
   //---------------------------------------------------------------------
@@ -137,7 +133,7 @@ typedef struct rlc_am_entity_s {
   //-----------------------------
   uint16_t           max_retx_threshold; /*!< \brief This parameter is used by the transmitting side of each AM RLC entity to limit the number of retransmissions of an AMD PDU. */
   uint16_t           poll_pdu;           /*!< \brief This parameter is used by the transmitting side of each AM RLC entity to trigger a poll for every pollPDU PDUs. */
-  uint16_t           poll_byte;          /*!< \brief This parameter is used by the transmitting side of each AM RLC entity to trigger a poll for every pollByte bytes. */
+  uint32_t           poll_byte;          /*!< \brief This parameter is used by the transmitting side of each AM RLC entity to trigger a poll for every pollByte bytes. */
 
   //---------------------------------------------------------------------
   // STATISTICS
@@ -176,14 +172,14 @@ typedef struct rlc_am_entity_s {
   //---------------------------------------------------------------------
   // OUTPUTS
   //---------------------------------------------------------------------
-  sdu_size_t        nb_bytes_requested_by_mac;  /*!< \brief Number of bytes requested by lower layer for next transmission. */
+  sdu_size_t        nb_bytes_requested_by_mac;  /*!< \brief Number of remaining bytes available for transmission of any RLC PDU indicated by lower layer */
   list_t            pdus_to_mac_layer;          /*!< \brief PDUs buffered for transmission to MAC layer. */
   list_t            control_pdu_list;           /*!< \brief Control PDUs buffered for transmission to MAC layer. */
-  rlc_sn_t          first_retrans_pdu_sn;       /*!< \brief Lowest sequence number of PDU to be retransmitted. */
   list_t            segmentation_pdu_list;      /*!< \brief List of "freshly" segmented PDUs. */
 
-  boolean_t         status_requested;             /*!< \brief Status requested by peer. */
-  frame_t           last_frame_status_indication; /*!< \brief The last frame number a  MAC status indication has been received by RLC. */
+  uint8_t           status_requested;             /*!< \brief Status bitmap requested by peer. */
+  rlc_sn_t		    sn_status_triggered_delayed;   /*!< \brief SN of the last received poll for which Status is delayed until SN is out of Rx Window. */
+  uint32_t          last_absolute_subframe_status_indication; /*!< \brief The last absolute subframe number a  MAC status indication has been received by RLC. */
   //-----------------------------
   // buffer occupancy measurements sent to MAC
   //-----------------------------
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_in_sdu.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_in_sdu.c
index 0f0b0e75e1b70f24862309c86ac5c48ccfe5bde0..4b5c173d4b6e891c5d98b7eb7c1d95ade8e60719 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_in_sdu.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_in_sdu.c
@@ -41,21 +41,28 @@ void rlc_am_free_in_sdu(
   const unsigned int            index_in_bufferP)
 {
   if (index_in_bufferP <= RLC_AM_SDU_CONTROL_BUFFER_SIZE) {
+	/* BugFix:  SDU shall have been already freed during initial PDU segmentation or concatenation !! */
+	  AssertFatal(rlcP->input_sdus[index_in_bufferP].mem_block == NULL, "RLC AM Tx SDU Conf: Data Part is not empty index=%d LcId=%d\n",
+				index_in_bufferP,rlcP->channel_id);
+	/*
     if (rlcP->input_sdus[index_in_bufferP].mem_block != NULL) {
       free_mem_block(rlcP->input_sdus[index_in_bufferP].mem_block, __func__);
       rlcP->input_sdus[index_in_bufferP].mem_block = NULL;
       rlcP->nb_sdu_no_segmented -= 1;
       rlcP->input_sdus[index_in_bufferP].sdu_remaining_size = 0;
     }
+    */
 
     rlcP->nb_sdu -= 1;
     memset(&rlcP->input_sdus[index_in_bufferP], 0, sizeof(rlc_am_tx_sdu_management_t));
     rlcP->input_sdus[index_in_bufferP].flags.transmitted_successfully = 1;
 
+    // case when either one SDU needs to be removed from segmentation or SDU buffer is full
     if (rlcP->current_sdu_index == index_in_bufferP) {
       rlcP->current_sdu_index = (rlcP->current_sdu_index + 1) % RLC_AM_SDU_CONTROL_BUFFER_SIZE;
     }
 
+    // wrapping and reset current_sdu_index to next_sdu_index when all transmitted SDUs have been acknowledged
     while ((rlcP->current_sdu_index != rlcP->next_sdu_index) &&
            (rlcP->input_sdus[rlcP->current_sdu_index].flags.transmitted_successfully == 1)) {
       rlcP->current_sdu_index = (rlcP->current_sdu_index + 1) % RLC_AM_SDU_CONTROL_BUFFER_SIZE;
@@ -100,3 +107,41 @@ rlc_am_in_sdu_is_empty(
 
   return 0;
 }
+
+// called when PDU is ACKED
+//-----------------------------------------------------------------------------
+void
+rlc_am_pdu_sdu_data_cnf(
+  const protocol_ctxt_t* const ctxt_pP,
+  rlc_am_entity_t* const       rlc_pP,
+  const rlc_sn_t           snP)
+{
+	  int          pdu_sdu_index;
+	  int          sdu_index;
+
+      for (pdu_sdu_index = 0; pdu_sdu_index < rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE].nb_sdus; pdu_sdu_index++) {
+        sdu_index = rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE].sdus_index[pdu_sdu_index];
+        assert(sdu_index >= 0);
+        assert(sdu_index < RLC_AM_SDU_CONTROL_BUFFER_SIZE);
+        rlc_pP->input_sdus[sdu_index].nb_pdus_ack += 1;
+
+        if ((rlc_pP->input_sdus[sdu_index].nb_pdus_ack == rlc_pP->input_sdus[sdu_index].nb_pdus) &&
+            (rlc_pP->input_sdus[sdu_index].sdu_remaining_size == 0)) {
+  #if TEST_RLC_AM
+          rlc_am_v9_3_0_test_data_conf (
+            rlc_pP->module_id,
+            rlc_pP->rb_id,
+            rlc_pP->input_sdus[sdu_index].mui,
+            RLC_SDU_CONFIRM_YES);
+  #else
+          rlc_data_conf(
+            ctxt_pP,
+            rlc_pP->rb_id,
+            rlc_pP->input_sdus[sdu_index].mui,
+            RLC_SDU_CONFIRM_YES,
+            rlc_pP->is_data_plane);
+  #endif
+          rlc_am_free_in_sdu(ctxt_pP, rlc_pP, sdu_index);
+        }
+      }
+}
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_in_sdu.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_in_sdu.h
index 3201dfc94169374cf9c508f9ec9f9adbe1ec007b..c596bc671accf0c97b013c0342a6b7a21675d0d6 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_in_sdu.h
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_in_sdu.h
@@ -77,5 +77,13 @@ protected_rlc_am_in_sdu(void rlc_am_free_in_sdu_data (const protocol_ctxt_t* con
 * \return 1 if the buffer is empty, else 0.
 */
 protected_rlc_am_in_sdu(signed int rlc_am_in_sdu_is_empty(const protocol_ctxt_t* const  ctxt_pP, rlc_am_entity_t *rlcP);)
+
+/*! \fn void rlc_am_pdu_sdu_data_cnf(const protocol_ctxt_t* const ctxt_pP,rlc_am_entity_t* const       rlc_pP,const rlc_sn_t           snP)
+* \brief    Process SDU cnf of a ACKED PDU for all SDUs concatenated in this PDU.
+* \param[in]  ctxtP                     Running context.
+* \param[in]  rlcP                      RLC AM protocol instance pointer.
+* \param[in]  snP                       Sequence number of the PDU.
+*/
+protected_rlc_am_in_sdu(void rlc_am_pdu_sdu_data_cnf(const protocol_ctxt_t* const ctxt_pP,rlc_am_entity_t* const       rlc_pP,const rlc_sn_t           snP);)
 /** @} */
 #    endif
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 cb03e28c4b457d8e9ce39344dbe32213f5d3bb26..129d4ffb0f97f621cc3d17898006a17082c39a5d 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_init.c
@@ -51,16 +51,16 @@ 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"
-    //        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_pP->tx_data_pdu_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->tx_data_pdu_buffer       = calloc(1, (uint32_t)((unsigned int)RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE*(unsigned int)sizeof(
                                          rlc_am_tx_data_pdu_management_t)));
     LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[AM INIT] input_sdus[] = %p  element size=%zu\n",
           PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
           rlc_pP->input_sdus,
           sizeof(rlc_am_tx_sdu_management_t));
-    LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[AM INIT] pdu_retrans_buffer[] = %p element size=%zu\n",
+    LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[AM INIT] tx_data_pdu_buffer[] = %p element size=%zu\n",
           PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
-          rlc_pP->pdu_retrans_buffer,
+          rlc_pP->tx_data_pdu_buffer,
           sizeof(rlc_am_tx_data_pdu_management_t));
 
     // TX state variables
@@ -74,12 +74,12 @@ rlc_am_init(
     // RX state variables
     //rlc_pP->vr_r    = 0;
     rlc_pP->vr_mr   = rlc_pP->vr_r + RLC_AM_WINDOW_SIZE;
-    //rlc_pP->vr_x    = 0;
+    rlc_pP->vr_x    = RLC_SN_UNDEFINED;
     //rlc_pP->vr_ms   = 0;
     //rlc_pP->vr_h    = 0;
+    rlc_pP->sn_status_triggered_delayed = RLC_SN_UNDEFINED;
 
-    rlc_pP->last_frame_status_indication = 123456; // any value > 1
-    rlc_pP->first_retrans_pdu_sn         = -1;
+    rlc_pP->last_absolute_subframe_status_indication = 0xFFFFFFFF; // any value > 1
 
     rlc_pP->initialized                  = TRUE;
   }
@@ -128,12 +128,13 @@ rlc_am_reestablish(
   // RX state variables
   rlc_pP->vr_r    = 0;
   rlc_pP->vr_mr   = rlc_pP->vr_r + RLC_AM_WINDOW_SIZE;
-  rlc_pP->vr_x    = 0;
+  rlc_pP->vr_x    = RLC_SN_UNDEFINED;
   rlc_pP->vr_ms   = 0;
   rlc_pP->vr_h    = 0;
+  rlc_pP->sn_status_triggered_delayed = RLC_SN_UNDEFINED;
+  rlc_pP->status_requested	= RLC_AM_STATUS_NOT_TRIGGERED;
 
-  rlc_pP->last_frame_status_indication = 123456; // any value > 1
-  rlc_pP->first_retrans_pdu_sn         = -1;
+  rlc_pP->last_absolute_subframe_status_indication = 0xFFFFFFFF; // any value > 1
 
   rlc_pP->initialized                  = TRUE;
 
@@ -172,16 +173,16 @@ rlc_am_cleanup(
 
   pthread_mutex_destroy(&rlc_pP->lock_input_sdus);
 
-  if (rlc_pP->pdu_retrans_buffer != NULL) {
+  if (rlc_pP->tx_data_pdu_buffer != NULL) {
     for (i=0; i < RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE; i++) {
-      if (rlc_pP->pdu_retrans_buffer[i].mem_block != NULL) {
-        free_mem_block(rlc_pP->pdu_retrans_buffer[i].mem_block, __func__);
-        rlc_pP->pdu_retrans_buffer[i].mem_block = NULL;
+      if (rlc_pP->tx_data_pdu_buffer[i % RLC_AM_WINDOW_SIZE].mem_block != NULL) {
+        free_mem_block(rlc_pP->tx_data_pdu_buffer[i % RLC_AM_WINDOW_SIZE].mem_block, __func__);
+        rlc_pP->tx_data_pdu_buffer[i % RLC_AM_WINDOW_SIZE].mem_block = NULL;
       }
     }
 
-    free(rlc_pP->pdu_retrans_buffer);
-    rlc_pP->pdu_retrans_buffer       = NULL;
+    free(rlc_pP->tx_data_pdu_buffer);
+    rlc_pP->tx_data_pdu_buffer       = NULL;
   }
 
   memset(rlc_pP, 0, sizeof(rlc_am_entity_t));
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.c
index 873e51fbfe395c0e6aa48909a11c46830d682a59..4202443a5a4e02c5248836e0607a61a9a5ce9bf7 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.c
@@ -91,7 +91,7 @@ rlc_am_send_sdu (
   const protocol_ctxt_t* const ctxt_pP,
   rlc_am_entity_t * const      rlc_pP)
 {
-#   if TRACE_RLC_UM_PDU
+#   if TRACE_RLC_AM_PDU
   char                 message_string[7000];
   size_t               message_string_size = 0;
 #if ENABLE_ITTI
@@ -212,7 +212,8 @@ void
 rlc_am_reassemble_pdu(
   const protocol_ctxt_t* const ctxt_pP,
   rlc_am_entity_t * const      rlc_pP,
-  mem_block_t * const          tb_pP)
+  mem_block_t * const          tb_pP,
+  boolean_t free_rlc_pdu)
 {
   int i,j;
 
@@ -397,5 +398,7 @@ rlc_am_reassemble_pdu(
     }
   }
 
-  free_mem_block(tb_pP, __func__);
+  if (free_rlc_pdu) {
+	  free_mem_block(tb_pP, __func__);
+  }
 }
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.h
index fece9ae5709c9ecfae4dd718b736f032192e3a25..4b780ce4414c2735074a4477b93fbf3e58c5e5e9 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.h
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_reassembly.h
@@ -72,13 +72,14 @@ private_rlc_am_reassembly(   void rlc_am_reassembly   (const protocol_ctxt_t* co
 */
 private_rlc_am_reassembly(   void rlc_am_send_sdu     (const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP);)
 
-/*! \fn void rlc_am_reassemble_pdu(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, const  mem_block_t* const tb_pP)
+/*! \fn void rlc_am_reassemble_pdu(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, const  mem_block_t* const tb_pP,boolean_t free_rlc_pdu)
 * \brief    Reassembly a RLC AM PDU, depending of the content of this PDU, data will be reassemblied to the current output SDU, the current will be sent to higher layers or not, after or before the reassembly, or no send of SDU will be triggered, depending on FI field in PDU header.
 * \param[in]  ctxtP                       Running context.
 * \param[in]  rlc_pP                      RLC AM protocol instance pointer.
 * \param[in]  tb_pP                       RLC AM PDU embedded in a mem_block_t.
+* \param[in]  free_rlc_pdu                Flag for freeing RLC AM PDU after reassembly.
 */
-protected_rlc_am_reassembly( void rlc_am_reassemble_pdu(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, mem_block_t* const tb_pP);)
+protected_rlc_am_reassembly( void rlc_am_reassemble_pdu(const protocol_ctxt_t* const ctxtP, rlc_am_entity_t * const rlc_pP, mem_block_t* const tb_pP,boolean_t free_rlc_pdu);)
 /** @} */
 #endif
 
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.c
index d783684893565fa74cf32aef762d604823d706a9..d2a5cc985e848881c26fda350b996a6e5bb5485e 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_receiver.c
@@ -31,6 +31,7 @@
 #include "LAYER2/MAC/extern.h"
 #include "UTIL/LOG/log.h"
 
+
 //-----------------------------------------------------------------------------
 signed int
 rlc_am_get_data_pdu_infos(
@@ -40,14 +41,15 @@ rlc_am_get_data_pdu_infos(
   int16_t total_sizeP,
   rlc_am_pdu_info_t* pdu_info_pP)
 {
-  memset(pdu_info_pP, 0, sizeof (rlc_am_pdu_info_t));
+    memset(pdu_info_pP, 0, sizeof (rlc_am_pdu_info_t));
 
-  int16_t          sum_li = 0;
-  pdu_info_pP->d_c = header_pP->b1 >> 7;
-  pdu_info_pP->num_li = 0;
+    int16_t          sum_li = 0;
+    pdu_info_pP->d_c = header_pP->b1 >> 7;
+    pdu_info_pP->num_li = 0;
 
 
-  if (pdu_info_pP->d_c) {
+    AssertFatal (pdu_info_pP->d_c != 0, "RLC AM Rx PDU Data D/C Header Error LcId=%d\n", rlc_pP->channel_id);
+
     pdu_info_pP->rf  = (header_pP->b1 >> 6) & 0x01;
     pdu_info_pP->p   = (header_pP->b1 >> 5) & 0x01;
     pdu_info_pP->fi  = (header_pP->b1 >> 3) & 0x03;
@@ -117,12 +119,6 @@ rlc_am_get_data_pdu_infos(
     }
 
     return 0;
-  } else {
-    LOG_W(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[GET DATA PDU INFO]  SN %04d ERROR CONTROL PDU ",
-          PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
-          pdu_info_pP->sn);
-    return -1;
-  }
 }
 //-----------------------------------------------------------------------------
 void
@@ -181,26 +177,22 @@ rlc_am_rx_update_vr_ms(
     do {
       pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
 
-      if (((rlc_am_rx_pdu_management_t*)(cursor_p->data))->all_segments_received == 0) {
+      if ((((rlc_am_rx_pdu_management_t*)(cursor_p->data))->all_segments_received == 0) ||
+          (rlc_pP->vr_ms != pdu_info_cursor_p->sn)) {
+
 #if TRACE_RLC_AM_RX
         LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[UPDATE VR(MS)] UPDATED VR(MS) %04d -> %04d\n",
               PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
               rlc_pP->vr_ms, pdu_info_cursor_p->sn);
 #endif
-        rlc_pP->vr_ms = pdu_info_cursor_p->sn;
+
         return;
       }
 
+      rlc_pP->vr_ms = RLC_AM_NEXT_SN(pdu_info_cursor_p->sn);
       cursor_p = cursor_p->next;
-    } while (cursor_p != NULL);
+    } while ((cursor_p != NULL) && (rlc_pP->vr_ms != rlc_pP->vr_h));
 
-#if TRACE_RLC_AM_RX
-    LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[UPDATE VR(MS)] UPDATED VR(MS) %04d -> %04d\n",
-          PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
-          rlc_pP->vr_ms,
-          (pdu_info_cursor_p->sn + 1)  & RLC_AM_SN_MASK);
-#endif
-    rlc_pP->vr_ms = (pdu_info_cursor_p->sn + 1)  & RLC_AM_SN_MASK;
   }
 }
 // assumed the sn of the tb_p is equal to VR(R)
@@ -322,34 +314,30 @@ rlc_am_receive_process_data_pdu (
   //             - discard the duplicate byte segments.
   rlc_am_pdu_info_t*  pdu_info_p         = &((rlc_am_rx_pdu_management_t*)(tb_pP->data))->pdu_info;
   rlc_am_pdu_sn_10_t* rlc_am_pdu_sn_10_p = (rlc_am_pdu_sn_10_t*)first_byte_pP;
+  rlc_am_rx_pdu_status_t pdu_status		= RLC_AM_DATA_PDU_STATUS_OK;
+  boolean_t		reassemble = false;
 
   if (rlc_am_get_data_pdu_infos(ctxt_pP,rlc_pP, rlc_am_pdu_sn_10_p, tb_size_in_bytesP, pdu_info_p) >= 0) {
 
     ((rlc_am_rx_pdu_management_t*)(tb_pP->data))->all_segments_received = 0;
 
-    if (rlc_am_in_rx_window(ctxt_pP, rlc_pP, pdu_info_p->sn)) {
-
-      if (pdu_info_p->p) {
-        LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[PROCESS RX PDU]  POLL BIT SET, STATUS REQUESTED:\n",
-              PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
-        rlc_pP->status_requested = 1;
-      }
+      if (RLC_AM_SN_IN_WINDOW(pdu_info_p->sn, rlc_pP->vr_r)) {
 
-      LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[PROCESS RX PDU] VR(R) %04d VR(H) %04d VR(MR) %04d VR(MS) %04d VR(X) %04d\n",
+      LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[PROCESS RX PDU SN=%04d] VR(R) %04d VR(H) %04d VR(MR) %04d VR(MS) %04d VR(X) %04d\n",
             PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
+            pdu_info_p->sn,
             rlc_pP->vr_r,
             rlc_pP->vr_h,
             rlc_pP->vr_mr,
             rlc_pP->vr_ms,
             rlc_pP->vr_x);
 
-      if (rlc_am_rx_list_insert_pdu(ctxt_pP, rlc_pP,tb_pP) < 0) {
+      pdu_status = rlc_am_rx_list_check_duplicate_insert_pdu(ctxt_pP, rlc_pP,tb_pP);
+      if (pdu_status != RLC_AM_DATA_PDU_STATUS_OK) {
         rlc_pP->stat_rx_data_pdu_dropped     += 1;
         rlc_pP->stat_rx_data_bytes_dropped   += tb_size_in_bytesP;
-        free_mem_block (tb_pP, __func__);
-        LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[PROCESS RX PDU]  PDU DISCARDED, STATUS REQUESTED:\n",
-              PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
-        rlc_pP->status_requested = 1;
+        LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[PROCESS RX PDU]  PDU DISCARDED CAUSE=%d SN=%d\n",
+              PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),pdu_status,pdu_info_p->sn);
 #if RLC_STOP_ON_LOST_PDU
         AssertFatal( 0 == 1,
                      PROTOCOL_RLC_AM_CTXT_FMT" LOST PDU DETECTED\n",
@@ -394,12 +382,15 @@ rlc_am_receive_process_data_pdu (
         rlc_am_rx_list_display(rlc_pP, "rlc_am_receive_process_data_pdu AFTER INSERTION ");
 #endif
 
-        if (rlc_am_sn_gte_vr_h(ctxt_pP, rlc_pP, pdu_info_p->sn) > 0) {
-          rlc_pP->vr_h = (pdu_info_p->sn + 1) & RLC_AM_SN_MASK;
+        /* 1) Update vrH if sn >= vrH */
+        if (RLC_AM_DIFF_SN(pdu_info_p->sn,rlc_pP->vr_r) >= RLC_AM_DIFF_SN(rlc_pP->vr_h,rlc_pP->vr_r))
+        {
+        	rlc_pP->vr_h = RLC_AM_NEXT_SN(pdu_info_p->sn);
         }
 
         rlc_am_rx_check_all_byte_segments(ctxt_pP, rlc_pP, tb_pP);
 
+        /* 2) Reordering Window Processing: Update vr_ms if sn = vr_ms and all bytes received for sn */
         if ((pdu_info_p->sn == rlc_pP->vr_ms) && (((rlc_am_rx_pdu_management_t*)(tb_pP->data))->all_segments_received)) {
           rlc_am_rx_update_vr_ms(ctxt_pP, rlc_pP,  tb_pP);
         }
@@ -410,39 +401,114 @@ rlc_am_receive_process_data_pdu (
             rlc_pP->vr_mr = (rlc_pP->vr_r + RLC_AM_WINDOW_SIZE) & RLC_AM_SN_MASK;
           }
 
-          rlc_am_rx_list_reassemble_rlc_sdus(ctxt_pP, rlc_pP);
+          reassemble = rlc_am_rx_check_vr_reassemble(ctxt_pP, rlc_pP);
+          //TODO : optimization : check whether a reassembly is needed by looking at LI, FI, SO, etc...
+
         }
 
         //FNA: fix check VrX out of receiving window
-        if (rlc_pP->t_reordering.running) {
-          if ((rlc_pP->vr_x == rlc_pP->vr_r) || ((rlc_am_in_rx_window(ctxt_pP, rlc_pP, rlc_pP->vr_x) == 0) && (rlc_pP->vr_x != rlc_pP->vr_mr))) {
+        if ((rlc_pP->t_reordering.running) || ((rlc_pP->t_reordering.ms_duration == 0) && (rlc_pP->vr_x != RLC_SN_UNDEFINED))) {
+          if ((rlc_pP->vr_x == rlc_pP->vr_r) || (!(RLC_AM_SN_IN_WINDOW(rlc_pP->vr_x, rlc_pP->vr_r)) && (rlc_pP->vr_x != rlc_pP->vr_mr))) {
             rlc_am_stop_and_reset_timer_reordering(ctxt_pP, rlc_pP);
+            rlc_pP->vr_x = RLC_SN_UNDEFINED;
           }
         }
 
         if (!(rlc_pP->t_reordering.running)) {
           if (rlc_pP->vr_h != rlc_pP->vr_r) { // - if VR (H) > VR(R) translated to - if VR (H) != VR(R)
-            rlc_am_start_timer_reordering(ctxt_pP, rlc_pP);
             rlc_pP->vr_x = rlc_pP->vr_h;
+            if (rlc_pP->t_reordering.ms_duration != 0) {
+                rlc_am_start_timer_reordering(ctxt_pP, rlc_pP);
+            }
+            else {
+            	/* specific case for no timer reordering configured */
+            	/* reordering window directly advances with vrH */
+            	rlc_pP->vr_ms = rlc_pP->vr_h;
+
+				/* Trigger a Status and clear any existing Delay Flag */
+				RLC_AM_SET_STATUS(rlc_pP->status_requested,RLC_AM_STATUS_TRIGGERED_T_REORDERING);
+				RLC_AM_CLEAR_STATUS(rlc_pP->status_requested,RLC_AM_STATUS_TRIGGERED_DELAYED);
+				rlc_pP->sn_status_triggered_delayed = RLC_SN_UNDEFINED;
+            }
           }
         }
       }
 
-      LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[PROCESS RX PDU] VR(R) %04d VR(H) %04d  VR(MS) %04d  VR(MR) %04d\n",
+      LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[PROCESS RX PDU SN=%04d] NEW VR(R) %04d VR(H) %04d  VR(MS) %04d  VR(MR) %04d VR(X) %04d reassemble=%d\n",
             PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
+            pdu_info_p->sn,
             rlc_pP->vr_r,
             rlc_pP->vr_h,
             rlc_pP->vr_ms,
-            rlc_pP->vr_mr);
+            rlc_pP->vr_mr,
+            rlc_pP->vr_x,
+            reassemble);
     } else {
       rlc_pP->stat_rx_data_pdu_out_of_window     += 1;
       rlc_pP->stat_rx_data_bytes_out_of_window   += tb_size_in_bytesP;
-      free_mem_block (tb_pP, __func__);
-      LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[PROCESS RX PDU]  PDU OUT OF RX WINDOW, DISCARDED, STATUS REQUESTED:\n",
-            PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
-      rlc_pP->status_requested = 1;
+      pdu_status = RLC_AM_DATA_PDU_STATUS_SN_OUTSIDE_WINDOW;
+      LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[PROCESS RX PDU]  PDU OUT OF RX WINDOW, DISCARDED, SN=%d\n",
+            PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),pdu_info_p->sn);
     }
+
+      /* 3) Check for triggering a Tx Status PDU if a poll is received or if a pending status was delayed */
+      if ((pdu_info_p->p) && (pdu_status < RLC_AM_DATA_PDU_STATUS_BUFFER_FULL)) {
+        LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[PROCESS RX PDU]  POLL BIT SET, STATUS REQUESTED:\n",
+              PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
+
+        /* Polling Info Saving for In and Out of Window PDU */
+        /* avoid multi status trigger */
+        if ((RLC_AM_GET_STATUS(rlc_pP->status_requested,RLC_AM_STATUS_TRIGGERED_DELAYED)) ||
+            !(RLC_AM_GET_STATUS(rlc_pP->status_requested,(RLC_AM_STATUS_TRIGGERED_POLL | RLC_AM_STATUS_TRIGGERED_T_REORDERING))))
+        {
+            RLC_AM_SET_STATUS(rlc_pP->status_requested,RLC_AM_STATUS_TRIGGERED_POLL);
+
+            if ((pdu_status != RLC_AM_DATA_PDU_STATUS_OK) || ((pdu_status == RLC_AM_DATA_PDU_STATUS_OK) &&
+                                                           (!(RLC_AM_SN_IN_WINDOW(pdu_info_p->sn,rlc_pP->vr_r)) ||
+                                                            (RLC_AM_DIFF_SN(pdu_info_p->sn,rlc_pP->vr_r) < RLC_AM_DIFF_SN(rlc_pP->vr_ms,rlc_pP->vr_r)))
+                                                          )
+               )
+            {
+                /* Conditions are met for sending a Status Report */
+                /* Then clear Delay Flag and reset its corresponding sn */
+                RLC_AM_CLEAR_STATUS(rlc_pP->status_requested,RLC_AM_STATUS_TRIGGERED_DELAYED);
+                rlc_pP->sn_status_triggered_delayed = RLC_SN_UNDEFINED;
+            }
+            else if (rlc_pP->sn_status_triggered_delayed == RLC_SN_UNDEFINED)
+            {
+                /* Delay status trigger if pdustatus OK and sn>= vr_ms */
+                /* Note: vr_r and vr_ms have been updated */
+                RLC_AM_SET_STATUS(rlc_pP->status_requested,RLC_AM_STATUS_TRIGGERED_DELAYED);
+                rlc_pP->sn_status_triggered_delayed = pdu_info_p->sn;
+            }
+        }
+      }
+
+      /* ReEnable a previously delayed Status Trigger if PDU discarded or */
+      /* sn no more in RxWindow due to RxWindow advance or sn < vr_ms */
+      if ((RLC_AM_GET_STATUS(rlc_pP->status_requested,RLC_AM_STATUS_TRIGGERED_DELAYED)) &&
+          (pdu_status == RLC_AM_DATA_PDU_STATUS_OK)  &&
+          (!(RLC_AM_SN_IN_WINDOW(rlc_pP->sn_status_triggered_delayed,rlc_pP->vr_r)) ||
+           (RLC_AM_DIFF_SN(rlc_pP->sn_status_triggered_delayed,rlc_pP->vr_r) < RLC_AM_DIFF_SN(rlc_pP->vr_ms,rlc_pP->vr_r)))
+         )
+      {
+          RLC_AM_CLEAR_STATUS(rlc_pP->status_requested,RLC_AM_STATUS_TRIGGERED_DELAYED);
+          rlc_pP->sn_status_triggered_delayed = RLC_SN_UNDEFINED;
+      }
+
+
   } else {
-    free_mem_block (tb_pP, __func__);
+	  pdu_status = RLC_AM_DATA_PDU_STATUS_HEADER_ERROR;
+      LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[PROCESS RX PDU]  PDU DISCARDED BAD HEADER FORMAT SN=%d\n",
+            PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),pdu_info_p->sn);
+  }
+
+  if (pdu_status != RLC_AM_DATA_PDU_STATUS_OK) {
+	  /* Discard received block if out of window, duplicate or header error */
+      free_mem_block (tb_pP, __func__);
+  }
+  else if (reassemble) {
+	  /* Reassemble SDUs */
+	  rlc_am_rx_list_reassemble_rlc_sdus(ctxt_pP, rlc_pP);
   }
 }
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c
index 7fb801b33d717c6d686c2eb8985a07399c7d71a5..f80a46695d21baef203f4eaa59ec03b8267358ae 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.c
@@ -30,12 +30,13 @@
 #include "UTIL/LOG/log.h"
 #include "msc.h"
 //-----------------------------------------------------------------------------
-void rlc_am_nack_pdu (
+boolean_t rlc_am_nack_pdu (
   const protocol_ctxt_t* const  ctxt_pP,
   rlc_am_entity_t *const rlc_pP,
   const rlc_sn_t snP,
-  const sdu_size_t so_startP,
-  const sdu_size_t so_endP)
+  const rlc_sn_t prev_nack_snP,
+  sdu_size_t so_startP,
+  sdu_size_t so_endP)
 {
   // 5.2.1 Retransmission
   // ...
@@ -50,55 +51,124 @@ void rlc_am_nack_pdu (
   //         - indicate to upper layers that max retransmission has been reached.
 
 
-  mem_block_t* mb_p         = rlc_pP->pdu_retrans_buffer[snP].mem_block;
-  int          pdu_sdu_index;
-  int          sdu_index;
+  mem_block_t* mb_p         = rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE].mem_block;
+  rlc_am_tx_data_pdu_management_t *tx_data_pdu_buffer_p = &rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE];
+  //int          pdu_sdu_index;
+  //int          sdu_index;
+  boolean_t status = TRUE;
+  boolean_t retx_count_increment = FALSE;
+  sdu_size_t pdu_data_to_retx = 0;
 
   if (mb_p != NULL) {
-    rlc_pP->num_nack_sn += 1;
     assert(so_startP <= so_endP);
 
-    //-----------------------------------------
-    // allow holes in reports
-    // it is assumed that hole reports are done in byte offset
-    // increasing order among calls refering to only one status PDU
-    //  and among time
-    //-----------------------------------------
-    if (rlc_pP->pdu_retrans_buffer[snP].last_nack_time != ctxt_pP->frame) {
-      rlc_pP->pdu_retrans_buffer[snP].last_nack_time = ctxt_pP->frame;
-      rlc_am_clear_holes(ctxt_pP, rlc_pP, snP);
-    }
+    // Handle full PDU NACK first
+    if ((so_startP == 0) && (so_endP == 0x7FFF)) {
+    	if ((prev_nack_snP != snP) && (tx_data_pdu_buffer_p->flags.ack == 0) && (tx_data_pdu_buffer_p->flags.max_retransmit == 0)) {
+    		pdu_data_to_retx = tx_data_pdu_buffer_p->payload_size;
+            /* Increment VtReTxNext if this is the first NACK or if some segments have already been transmitted */
+            if ((tx_data_pdu_buffer_p->flags.retransmit == 0) || (tx_data_pdu_buffer_p->nack_so_start))
+            {
+            	retx_count_increment = TRUE;
+            }
 
-    if (!((so_startP == 0) && (so_endP == 0x7FFF))) {
-      rlc_pP->num_nack_so += 1;
+            tx_data_pdu_buffer_p->nack_so_start = 0;
+            tx_data_pdu_buffer_p->num_holes     = 0;
+            tx_data_pdu_buffer_p->retx_hole_index = 0;
+            tx_data_pdu_buffer_p->nack_so_stop  = tx_data_pdu_buffer_p->payload_size - 1;
+        #if TRACE_RLC_AM_HOLE
+            LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[HOLE] SN %04d GLOBAL NACK 0->%05d\n",
+                  PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
+                  snP,
+                  so_stopP);
+        #endif
+            assert(tx_data_pdu_buffer_p->nack_so_start < tx_data_pdu_buffer_p->payload_size);
+    	}
+    	else {
+    		status = FALSE;
+    	}
+      }
+    else if (tx_data_pdu_buffer_p->flags.max_retransmit == 0) {
+    	// Handle Segment offset
+		if (so_endP == 0x7FFF) {
+			so_endP = tx_data_pdu_buffer_p->payload_size - 1;
+		}
+
+		// Check consistency
+		if ((so_startP <= so_endP) && (so_endP < tx_data_pdu_buffer_p->payload_size)) {
+	    	if (prev_nack_snP != snP) {
+	    		/* New NACK_SN with SO */
+                /* check whether a new segment is to be placed in Retransmission Buffer, then increment vrReTx */
+                if ((tx_data_pdu_buffer_p->flags.retransmit == 0) || (so_startP < tx_data_pdu_buffer_p->nack_so_start)) {
+                	retx_count_increment = TRUE;
+                }
+
+	            tx_data_pdu_buffer_p->num_holes     = 1;
+	            tx_data_pdu_buffer_p->retx_hole_index = 0;
+	            tx_data_pdu_buffer_p->hole_so_start[0] = so_startP;
+	            tx_data_pdu_buffer_p->hole_so_stop[0] = so_endP;
+	            tx_data_pdu_buffer_p->nack_so_start = so_startP;
+	            tx_data_pdu_buffer_p->nack_so_stop = so_endP;
+	            pdu_data_to_retx = so_endP - so_startP + 1;
+
+	    	}
+	    	else if ((tx_data_pdu_buffer_p->num_holes) && (tx_data_pdu_buffer_p->num_holes < RLC_AM_MAX_HOLES_REPORT_PER_PDU)) {
+	    		/* New SOStart/SOEnd for the same NACK_SN than before */
+	    		/* check discontinuity */
+	    		if (so_startP > tx_data_pdu_buffer_p->hole_so_stop[tx_data_pdu_buffer_p->num_holes - 1]) {
+		            tx_data_pdu_buffer_p->hole_so_start[tx_data_pdu_buffer_p->num_holes] = so_startP;
+		            tx_data_pdu_buffer_p->hole_so_stop[tx_data_pdu_buffer_p->num_holes] = so_endP;
+		            tx_data_pdu_buffer_p->nack_so_stop = so_endP;
+		            tx_data_pdu_buffer_p->num_holes ++;
+		            pdu_data_to_retx = so_endP - so_startP + 1;
+	    		}
+	    		else {
+	    			status = FALSE;
+	    		}
+	    	}
+	    	else {
+	    		status = FALSE;
+	    	}
+		}
+		else {
+			status = FALSE;
+		}
     }
-
-    rlc_am_add_hole(ctxt_pP, rlc_pP, snP, so_startP, so_endP);
-
-    if (rlc_pP->first_retrans_pdu_sn < 0) {
-      rlc_pP->first_retrans_pdu_sn = snP;
-    } else if (rlc_am_tx_sn1_gt_sn2(ctxt_pP, rlc_pP, rlc_pP->first_retrans_pdu_sn, snP)) {
-      rlc_pP->first_retrans_pdu_sn = snP;
+    else {
+    	status = FALSE;
     }
 
-    LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[NACK-PDU] NACK PDU SN %04d previous retx_count %d  1ST_RETRANS_PDU %04d\n",
-          PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
-          snP,
-          rlc_pP->pdu_retrans_buffer[snP].retx_count,
-          rlc_pP->first_retrans_pdu_sn);
-
-    rlc_pP->pdu_retrans_buffer[snP].flags.retransmit = 1;
-
-    if (rlc_pP->pdu_retrans_buffer[snP].retx_count == -1) {
-      rlc_pP->pdu_retrans_buffer[snP].retx_count = 0;
-      rlc_pP->retrans_num_bytes_to_retransmit += rlc_pP->pdu_retrans_buffer[snP].header_and_payload_size;
-    } else {
-      rlc_pP->pdu_retrans_buffer[snP].retx_count += 1;
+    if (status) {
+    	tx_data_pdu_buffer_p->flags.nack = 1;
+    	if ((retx_count_increment) && (tx_data_pdu_buffer_p->retx_count == tx_data_pdu_buffer_p->retx_count_next)) {
+    		tx_data_pdu_buffer_p->retx_count_next ++;
+    	}
+    	if (tx_data_pdu_buffer_p->flags.retransmit == 1) {
+            if (prev_nack_snP != snP) {
+                /* if first process of this NACK_SN and data already pending for retx */
+            	rlc_pP->retrans_num_bytes_to_retransmit += (pdu_data_to_retx - tx_data_pdu_buffer_p->retx_payload_size);
+            	tx_data_pdu_buffer_p->retx_payload_size = pdu_data_to_retx;
+            }
+            else if (tx_data_pdu_buffer_p->num_holes > 1) {
+                /* Segment case : SOStart and SOEnd already received for same NACK_SN */
+                /* filter case where a NACK_SN is received twice with SO first time and no SO second time */
+            	rlc_pP->retrans_num_bytes_to_retransmit += pdu_data_to_retx;
+            	tx_data_pdu_buffer_p->retx_payload_size += pdu_data_to_retx;
+            }
+    	}
+        else {
+        	tx_data_pdu_buffer_p->flags.retransmit = 1;
+        	rlc_pP->retrans_num_bytes_to_retransmit += pdu_data_to_retx;
+        	tx_data_pdu_buffer_p->retx_payload_size = pdu_data_to_retx;
+        	rlc_pP->retrans_num_pdus ++;
+        }
     }
 
-    if (rlc_pP->pdu_retrans_buffer[snP].retx_count >= rlc_pP->max_retx_threshold) {
-      for (pdu_sdu_index = 0; pdu_sdu_index < rlc_pP->pdu_retrans_buffer[snP].nb_sdus; pdu_sdu_index++) {
-        sdu_index = rlc_pP->pdu_retrans_buffer[snP].sdus_index[pdu_sdu_index];
+    /* TODO: Move this part in UL SCH processing */
+#if 0
+    if (rlc_pP->tx_data_pdu_buffer[snP].retx_count >= rlc_pP->max_retx_threshold) {
+      for (pdu_sdu_index = 0; pdu_sdu_index < rlc_pP->tx_data_pdu_buffer[snP].nb_sdus; pdu_sdu_index++) {
+        sdu_index = rlc_pP->tx_data_pdu_buffer[snP].sdus_index[pdu_sdu_index];
         assert(pdu_sdu_index < RLC_AM_MAX_SDU_IN_PDU);
         assert(sdu_index < RLC_AM_SDU_CONTROL_BUFFER_SIZE);
         rlc_pP->input_sdus[sdu_index].nb_pdus_ack += 1;
@@ -122,12 +192,15 @@ void rlc_am_nack_pdu (
         }
       }
     }
+#endif
   } else {
     LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[NACK-PDU] ERROR NACK MISSING PDU SN %05d\n",
           PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
           snP);
-    //assert(2==3);
+    status = FALSE;
   }
+
+  return status;
 }
 //-----------------------------------------------------------------------------
 void rlc_am_ack_pdu (
@@ -135,100 +208,27 @@ void rlc_am_ack_pdu (
   rlc_am_entity_t *const rlc_pP,
   const rlc_sn_t snP)
 {
-  mem_block_t* mb_p         = rlc_pP->pdu_retrans_buffer[snP].mem_block;
-  int          pdu_sdu_index;
-  int          sdu_index;
+  mem_block_t* mb_p         = rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE].mem_block;
+  rlc_am_tx_data_pdu_management_t *tx_data_pdu_buffer = &rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE];
 
-  rlc_pP->pdu_retrans_buffer[snP].flags.retransmit = 0;
+  tx_data_pdu_buffer->flags.retransmit = 0;
 
-  if ((rlc_pP->pdu_retrans_buffer[snP].flags.ack == 0) && (mb_p != NULL)) {
+  if ((tx_data_pdu_buffer->flags.ack == 0) && (mb_p != NULL)) {
     //if (mb_pP != NULL) {
     free_mem_block(mb_p, __func__);
-    rlc_pP->pdu_retrans_buffer[snP].mem_block = NULL;
+    tx_data_pdu_buffer->mem_block = NULL;
     LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[ACK-PDU] ACK PDU SN %05d previous retx_count %d \n",
           PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
           snP,
-          rlc_pP->pdu_retrans_buffer[snP].retx_count);
-    rlc_pP->retrans_num_pdus  -= 1;
-    rlc_pP->retrans_num_bytes -= rlc_pP->pdu_retrans_buffer[snP].header_and_payload_size;
-
-    if (rlc_pP->pdu_retrans_buffer[snP].retx_count >= 0) {
-      rlc_pP->retrans_num_bytes_to_retransmit -= rlc_pP->pdu_retrans_buffer[snP].header_and_payload_size;
-    }
-
-    for (pdu_sdu_index = 0; pdu_sdu_index < rlc_pP->pdu_retrans_buffer[snP].nb_sdus; pdu_sdu_index++) {
-      sdu_index = rlc_pP->pdu_retrans_buffer[snP].sdus_index[pdu_sdu_index];
-      assert(sdu_index >= 0);
-      assert(sdu_index < RLC_AM_SDU_CONTROL_BUFFER_SIZE);
-      rlc_pP->input_sdus[sdu_index].nb_pdus_ack += 1;
+		  tx_data_pdu_buffer->retx_count);
 
-      if ((rlc_pP->input_sdus[sdu_index].nb_pdus_ack == rlc_pP->input_sdus[sdu_index].nb_pdus) &&
-          (rlc_pP->input_sdus[sdu_index].sdu_remaining_size == 0)) {
-#if TEST_RLC_AM
-        rlc_am_v9_3_0_test_data_conf (
-          rlc_pP->module_id,
-          rlc_pP->rb_id,
-          rlc_pP->input_sdus[sdu_index].mui,
-          RLC_SDU_CONFIRM_YES);
-#else
-        rlc_data_conf(
-          ctxt_pP,
-          rlc_pP->rb_id,
-          rlc_pP->input_sdus[sdu_index].mui,
-          RLC_SDU_CONFIRM_YES,
-          rlc_pP->is_data_plane);
-#endif
-        rlc_am_free_in_sdu(ctxt_pP, rlc_pP, sdu_index);
-      }
+    if (tx_data_pdu_buffer->retx_payload_size) {
+      rlc_pP->retrans_num_bytes_to_retransmit -= tx_data_pdu_buffer->retx_payload_size;
+      tx_data_pdu_buffer->retx_payload_size = 0;
+      tx_data_pdu_buffer->num_holes = 0;
+      rlc_pP->retrans_num_pdus --;
     }
 
-    // 7.1...
-    // VT(A) – Acknowledgement state variable
-    // This state variable holds the value of the SN of the next AMD PDU for which a positive acknowledgment is to be
-    // received in-sequence, and it serves as the lower edge of the transmitting window. It is initially set to 0, and is updated
-    // whenever the AM RLC entity receives a positive acknowledgment for an AMD PDU with SN = VT(A).
-    rlc_pP->pdu_retrans_buffer[snP].flags.ack = 1;
-
-    if (snP == rlc_pP->vt_a) {
-      //rlc_pP->pdu_retrans_buffer[snP].flags.ack = 1;
-      do {
-        memset(&rlc_pP->pdu_retrans_buffer[rlc_pP->vt_a], 0, sizeof(rlc_am_tx_data_pdu_management_t));
-
-        if (rlc_pP->vt_a == rlc_pP->first_retrans_pdu_sn) {
-          rlc_pP->first_retrans_pdu_sn = (rlc_pP->vt_a  + 1) & RLC_AM_SN_MASK;
-        }
-
-        rlc_pP->vt_a = (rlc_pP->vt_a  + 1) & RLC_AM_SN_MASK;
-      } while ((rlc_pP->pdu_retrans_buffer[rlc_pP->vt_a].flags.ack == 1) && (rlc_pP->vt_a != rlc_pP->vt_s));
-
-
-      rlc_pP->vt_ms   = (rlc_pP->vt_a + RLC_AM_WINDOW_SIZE) & RLC_AM_SN_MASK;
-      LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[ACK-PDU] UPDATED VT(A) %04d VT(MS) %04d  VT(S) %04d\n",
-            PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
-            rlc_pP->vt_a,
-            rlc_pP->vt_ms,
-            rlc_pP->vt_s);
-    }
-
-    if (snP == rlc_pP->first_retrans_pdu_sn) {
-      do {
-        rlc_pP->first_retrans_pdu_sn = (rlc_pP->first_retrans_pdu_sn  + 1) & RLC_AM_SN_MASK;
-
-        if (rlc_pP->pdu_retrans_buffer[rlc_pP->first_retrans_pdu_sn].retx_count >= 0) {
-          LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[ACK-PDU] UPDATED  first_retrans_pdu_sn -> %04d\n",
-                PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
-                rlc_pP->first_retrans_pdu_sn);
-          break;
-        }
-      } while (rlc_pP->first_retrans_pdu_sn != rlc_pP->vt_s);
-
-      if (rlc_pP->vt_s == rlc_pP->first_retrans_pdu_sn) {
-        rlc_pP->first_retrans_pdu_sn = -1;
-        LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[ACK-PDU] UPDATED  first_retrans_pdu_sn -> %04d\n",
-              PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
-              rlc_pP->first_retrans_pdu_sn);
-      }
-    }
   } else {
     LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[ACK-PDU] WARNING ACK PDU SN %05d -> NO PDU TO ACK\n",
           PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
@@ -236,31 +236,13 @@ void rlc_am_ack_pdu (
 
     if (mb_p != NULL) {
       free_mem_block(mb_p, __func__);
-      rlc_pP->pdu_retrans_buffer[snP].mem_block = NULL;
-    }
-
-    if (rlc_pP->pdu_retrans_buffer[snP].flags.ack > 0) {
-      if (snP == rlc_pP->vt_a) {
-        //rlc_pP->pdu_retrans_buffer[snP].flags.ack = 1;
-        do {
-          memset(&rlc_pP->pdu_retrans_buffer[rlc_pP->vt_a], 0, sizeof(rlc_am_tx_data_pdu_management_t));
-
-          if (rlc_pP->vt_a == rlc_pP->first_retrans_pdu_sn) {
-            rlc_pP->first_retrans_pdu_sn = (rlc_pP->vt_a  + 1) & RLC_AM_SN_MASK;
-          }
-
-          rlc_pP->vt_a = (rlc_pP->vt_a  + 1) & RLC_AM_SN_MASK;
-        } while ((rlc_pP->pdu_retrans_buffer[rlc_pP->vt_a].flags.ack == 1) && (rlc_pP->vt_a != rlc_pP->vt_s));
-
-        rlc_pP->vt_ms   = (rlc_pP->vt_a + RLC_AM_WINDOW_SIZE) & RLC_AM_SN_MASK;
-        LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[ACK-PDU] UPDATED VT(A) %04d VT(MS) %04d  VT(S) %04d\n",
-              PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
-              rlc_pP->vt_a,
-              rlc_pP->vt_ms,
-              rlc_pP->vt_s);
-      }
+      tx_data_pdu_buffer->mem_block = NULL;
     }
   }
+  tx_data_pdu_buffer->flags.ack = 1;
+  tx_data_pdu_buffer->flags.transmitted = 0;
+  tx_data_pdu_buffer->flags.retransmit = 0;
+
 }
 //-----------------------------------------------------------------------------
 mem_block_t* rlc_am_retransmit_get_copy (
@@ -268,27 +250,414 @@ mem_block_t* rlc_am_retransmit_get_copy (
   rlc_am_entity_t *const rlc_pP,
   const rlc_sn_t snP)
 {
-  mem_block_t* mb_original_p = rlc_pP->pdu_retrans_buffer[snP].mem_block;
+  mem_block_t* mb_original_p = rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE].mem_block;
 
-  if (mb_original_p != NULL) {
+  AssertFatal (mb_original_p != NULL, "RLC AM PDU Copy Error: Empty block sn=%d vtA=%d vtS=%d LcId=%d !\n",
+		  snP,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
 
-    rlc_am_tx_data_pdu_management_t *pdu_mngt = &rlc_pP->pdu_retrans_buffer[snP % RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE];
+  rlc_am_tx_data_pdu_management_t *pdu_mngt = &rlc_pP->tx_data_pdu_buffer[snP % RLC_AM_WINDOW_SIZE];
 
-    int size             = pdu_mngt->header_and_payload_size + sizeof(struct mac_tb_req);
-    mem_block_t* mb_copy = get_free_mem_block(size, __func__);
-    memcpy(mb_copy->data, mb_original_p->data, size);
+  /* We need to allocate a new buffer and copy to it because header content may change for Polling bit */
+  int size             = pdu_mngt->header_and_payload_size + sizeof(struct mac_tb_req);
+  mem_block_t* mb_copy = get_free_mem_block(size, __func__);
+  memcpy(mb_copy->data, mb_original_p->data, size);
 
-    rlc_am_pdu_sn_10_t *pdu_p                         = (rlc_am_pdu_sn_10_t*) (&mb_copy->data[sizeof(struct mac_tb_req)]);
-    ((struct mac_tb_req*)(mb_copy->data))->data_ptr = (uint8_t*)pdu_p;
+  rlc_am_pdu_sn_10_t *pdu_p                         = (rlc_am_pdu_sn_10_t*) (&mb_copy->data[sizeof(struct mac_tb_req)]);
+  ((struct mac_tb_req*)(mb_copy->data))->data_ptr = (uint8_t*)pdu_p;
 
-    pdu_mngt->flags.retransmit = 0;
+  return mb_copy;
+}
 
-    rlc_am_pdu_polling(ctxt_pP, rlc_pP, pdu_p, pdu_mngt->payload_size);
-    return mb_copy;
-  } else {
-    return NULL;
-  }
+//-----------------------------------------------------------------------------
+mem_block_t* rlc_am_retransmit_get_am_segment(
+  const protocol_ctxt_t* const  ctxt_pP,
+  rlc_am_entity_t *const rlc_pP,
+  rlc_am_tx_data_pdu_management_t *const pdu_mngt,
+  sdu_size_t * const payload_sizeP /* in-out*/)
+{
+	int16_t          sdus_segment_size[RLC_AM_MAX_SDU_IN_PDU];
+	mem_block_t*   mb_original_p  = pdu_mngt->mem_block;
+	mem_block_t*   mem_pdu_segment_p = NULL;
+	uint8_t              *pdu_original_header_p        = NULL;
+	uint8_t              *pdu_segment_header_p        = NULL;
+	sdu_size_t     retx_so_start,retx_so_stop; //starting and ending SO for retransmission in this PDU
+	rlc_sn_t sn = pdu_mngt->sn;
+	uint16_t	header_so_part;
+	boolean_t fi_start, fi_end;
+	uint8_t sdu_index = 0;
+	uint8_t sdu_segment_index = 0;
+	uint8_t num_LIs_pdu_segment = pdu_mngt->nb_sdus - 1;
+	uint8_t li_bit_offset = 4; /* toggle between 0 and 4 */
+	uint8_t li_jump_offset = 1; /* toggle between 1 and 2 */
+
+
+	AssertFatal (mb_original_p != NULL, "RLC AM PDU Segment Error: Empty block sn=%d vtA=%d vtS=%d LcId=%d !\n",
+			sn,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
+
+
+	AssertFatal (pdu_mngt->payload == mb_original_p->data + sizeof(struct mac_tb_req) + pdu_mngt->header_and_payload_size - pdu_mngt->payload_size,
+			"RLC AM PDU Segment Error: Inconsistent data pointers p1=%p p2=%p sn = %d total size = %d data size = %d LcId=%d !\n",
+			pdu_mngt->payload,mb_original_p->data + sizeof(struct mac_tb_req),pdu_mngt->header_and_payload_size,pdu_mngt->payload_size,sn,rlc_pP->channel_id);
+
+	/* Init ReTx Hole list if not configured, ie the whole PDU has to be retransmitted */
+	if (pdu_mngt->num_holes == 0)
+	{
+		AssertFatal (pdu_mngt->retx_payload_size == pdu_mngt->payload_size,"RLC AM PDU ReTx Segment: Expecting full PDU size ReTxSize=%d DataSize=%d sn=%d vtA=%d vtS=%d LcId=%d !\n",
+				pdu_mngt->retx_payload_size,pdu_mngt->payload_size,sn,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
+		pdu_mngt->retx_hole_index = 0;
+		pdu_mngt->hole_so_start[0] = 0;
+		pdu_mngt->hole_so_stop[0] = pdu_mngt->payload_size - 1;
+		pdu_mngt->num_holes = 1;
+	}
+
+	/* Init SO Start and SO Stop */
+	retx_so_start = pdu_mngt->hole_so_start[pdu_mngt->retx_hole_index];
+	retx_so_stop = pdu_mngt->hole_so_stop[pdu_mngt->retx_hole_index];
+
+	AssertFatal ((retx_so_start <= retx_so_stop) && (retx_so_stop - retx_so_start + 1 <= pdu_mngt->payload_size),
+			"RLC AM Tx PDU Segment Data SO Error: retx_so_start=%d retx_so_stop=%d OriginalPDUDataLength=%d sn=%d LcId=%d!\n",
+			retx_so_start,retx_so_stop,pdu_mngt->payload_size,sn,rlc_pP->channel_id);
+
+	/* Init FI to the same value as original PDU */
+	fi_start = (!(RLC_AM_PDU_GET_FI_START(*(pdu_mngt->first_byte))));
+	fi_end = (!(RLC_AM_PDU_GET_FI_END(*(pdu_mngt->first_byte))));
+
+	/* Handle no LI case first */
+	if (num_LIs_pdu_segment == 0)
+	{
+		/* Bound retx_so_stop to available TBS */
+		if (retx_so_stop - retx_so_start + 1 + RLC_AM_PDU_SEGMENT_HEADER_MIN_SIZE > rlc_pP->nb_bytes_requested_by_mac)
+		{
+			retx_so_stop = retx_so_start + rlc_pP->nb_bytes_requested_by_mac - RLC_AM_PDU_SEGMENT_HEADER_MIN_SIZE - 1;
+		}
+
+		*payload_sizeP = retx_so_stop - retx_so_start + 1;
+
+		mem_pdu_segment_p = get_free_mem_block((*payload_sizeP + RLC_AM_PDU_SEGMENT_HEADER_MIN_SIZE + sizeof(struct mac_tb_req)), __func__);
+		pdu_segment_header_p        = (uint8_t *)&mem_pdu_segment_p->data[sizeof(struct mac_tb_req)];
+		((struct mac_tb_req*)(mem_pdu_segment_p->data))->data_ptr = pdu_segment_header_p;
+		((struct mac_tb_req*)(mem_pdu_segment_p->data))->tb_size = RLC_AM_PDU_SEGMENT_HEADER_MIN_SIZE + *payload_sizeP;
+
+		/* clear all PDU segment */
+		memset(pdu_segment_header_p, 0, *payload_sizeP + RLC_AM_PDU_SEGMENT_HEADER_MIN_SIZE);
+		/* copy data part */
+		memcpy(pdu_segment_header_p + RLC_AM_PDU_SEGMENT_HEADER_MIN_SIZE, pdu_mngt->payload + retx_so_start, *payload_sizeP);
+
+		/* Set FI part to false if SO Start and SO End are different from PDU boundaries */
+		if (retx_so_start)
+		{
+			fi_start = FALSE;
+		}
+		if (retx_so_stop < pdu_mngt->payload_size - 1)
+		{
+			fi_end = FALSE;
+		}
+
+		/* Header content is filled at the end */
+	}
+	else
+	{
+		/* Step 1 */
+		/* Find the SDU index in the original PDU containing retx_so_start */
+		sdu_size_t sdu_size = 0;
+		sdu_size_t data_size = 0;
+		*payload_sizeP = 0;
+		sdu_size_t header_segment_length = RLC_AM_PDU_SEGMENT_HEADER_MIN_SIZE;
+		pdu_original_header_p = pdu_mngt->first_byte + 2;
+		li_bit_offset = 4; /* toggle between 0 and 4 */
+		li_jump_offset = 1; /* toggle between 1 and 2 */
+		uint16_t temp_read = ((*pdu_original_header_p) << 8) | (*(pdu_original_header_p + 1));
+
+
+		/* Read first LI */
+		sdu_size = RLC_AM_PDU_GET_LI(temp_read,li_bit_offset);
+		pdu_original_header_p += li_jump_offset;
+		li_bit_offset ^= 0x4;
+		li_jump_offset ^= 0x3;
+		data_size += sdu_size;
+		sdu_index = 1;
+
+		/* Loop on all original LIs */
+		while ((data_size < retx_so_start + 1) && (sdu_index < pdu_mngt->nb_sdus))
+		{
+			if (sdu_index < pdu_mngt->nb_sdus - 1)
+			{
+				temp_read = ((*pdu_original_header_p) << 8) | (*(pdu_original_header_p + 1));
+				sdu_size = RLC_AM_PDU_GET_LI(temp_read,li_bit_offset);
+				pdu_original_header_p += li_jump_offset;
+				li_bit_offset ^= 0x4;
+				li_jump_offset ^= 0x3;
+				data_size += sdu_size;
+			}
+			else
+			{
+				/* if retx_so_start is still not included then set data_size with full original PDU data size */
+				/* Set fi_start to FALSE in this case */
+				data_size = pdu_mngt->payload_size;
+			}
+			sdu_index ++;
+		}
+
+		if (retx_so_start == data_size)
+		{
+			/* Set FI Start if retx_so_start = cumulated data size */
+			fi_start = TRUE;
+			/* there must be at least one SDU more */
+			AssertFatal (sdu_index < pdu_mngt->nb_sdus, "RLC AM Tx PDU Segment Error: sdu_index=%d nb_sdus=%d sn=%d LcId=%d !\n",
+					sdu_index,pdu_mngt->nb_sdus,sn,rlc_pP->channel_id);
+			if (sdu_index < pdu_mngt->nb_sdus - 1)
+			{
+				temp_read = ((*pdu_original_header_p) << 8) | (*(pdu_original_header_p + 1));
+				sdu_size = RLC_AM_PDU_GET_LI(temp_read,li_bit_offset);
+				pdu_original_header_p += li_jump_offset;
+				li_bit_offset ^= 0x4;
+				li_jump_offset ^= 0x3;
+				data_size += sdu_size;
+			}
+			else
+			{
+				/* It was the last LI, then set data_size to full original PDU size */
+				data_size = pdu_mngt->payload_size;
+			}
+			/* Go to next SDU */
+			sdu_index ++;
+		}
+		else if (retx_so_start != 0)
+		{
+			/* in all other cases set fi_start to FALSE if it SO Start is not 0 */
+			fi_start = FALSE;
+		}
+
+		/* Set first SDU portion of the segment */
+		sdus_segment_size[0] = data_size - retx_so_start;
+
+		/* Check if so end is in the first SDU portion */
+		if (sdus_segment_size[0] >= retx_so_stop - retx_so_start + 1)
+		{
+			sdus_segment_size[0] = retx_so_stop - retx_so_start + 1;
+			*payload_sizeP = sdus_segment_size[0];
+			num_LIs_pdu_segment = 0;
+		}
+
+		/* Bound first SDU segment to available TBS if necessary */
+		if (sdus_segment_size[0] + RLC_AM_PDU_SEGMENT_HEADER_MIN_SIZE >= rlc_pP->nb_bytes_requested_by_mac)
+		{
+			sdus_segment_size[0] = rlc_pP->nb_bytes_requested_by_mac - RLC_AM_PDU_SEGMENT_HEADER_MIN_SIZE;
+			*payload_sizeP = sdus_segment_size[0];
+			num_LIs_pdu_segment = 0;
+		}
+
+
+		/* Now look for the end if it was not set previously */
+		if (*payload_sizeP == 0)
+		{
+			sdu_segment_index ++;
+			while ((sdu_index < pdu_mngt->nb_sdus) && (data_size < retx_so_stop + 1))
+			{
+				if (sdu_index < pdu_mngt->nb_sdus - 1)
+				{
+					temp_read = ((*pdu_original_header_p) << 8) | (*(pdu_original_header_p + 1));
+					sdu_size = RLC_AM_PDU_GET_LI(temp_read,li_bit_offset);
+					pdu_original_header_p += li_jump_offset;
+					li_bit_offset ^= 0x4;
+					li_jump_offset ^= 0x3;
+					data_size += sdu_size;
+				}
+				else
+				{
+					sdu_size = pdu_mngt->payload_size - data_size;
+					data_size = pdu_mngt->payload_size;
+				}
+
+				sdus_segment_size[sdu_segment_index] = sdu_size;
+				sdu_index ++;
+				sdu_segment_index ++;
+			}
+
+
+			if (data_size > retx_so_stop + 1)
+			{
+				sdus_segment_size[sdu_segment_index - 1] = retx_so_stop - (data_size - sdu_size) + 1;
+			}
+
+			/* Set number of LIs in the segment */
+			num_LIs_pdu_segment = sdu_segment_index - 1;
+
+			AssertFatal (num_LIs_pdu_segment <=  pdu_mngt->nb_sdus - 1, "RLC AM Tx PDU Segment Data Error: nbLISegment=%d nbLIPDU=%d sn=%d LcId=%d !\n",
+					num_LIs_pdu_segment,pdu_mngt->nb_sdus - 1,sn,rlc_pP->channel_id);
+
+			/* Bound to available TBS taking into account min PDU segment header*/
+			sdu_segment_index = 0;
+			while ((sdu_segment_index < num_LIs_pdu_segment + 1) && (rlc_pP->nb_bytes_requested_by_mac > *payload_sizeP + RLC_AM_PDU_SEGMENT_HEADER_SIZE(sdu_segment_index)))
+			{
+				AssertFatal (sdus_segment_size[sdu_segment_index] > 0, "RLC AM Tx PDU Segment Data Error: EMpty LI index=%d numLISegment=%d numLIPDU=%d PDULength=%d SOStart=%d SOStop=%d sn=%d LcId=%d !\n",
+						sdu_segment_index,num_LIs_pdu_segment,pdu_mngt->nb_sdus - 1,pdu_mngt->payload_size,retx_so_start,retx_so_stop,sn,rlc_pP->channel_id);
+
+				/* Add next sdu_segment_index to data part */
+				if (RLC_AM_PDU_SEGMENT_HEADER_SIZE(sdu_segment_index) + (*payload_sizeP) + sdus_segment_size[sdu_segment_index] <= rlc_pP->nb_bytes_requested_by_mac)
+				{
+					(*payload_sizeP) += sdus_segment_size[sdu_segment_index];
+				}
+				else
+				{
+					/* bound to available TBS size */
+					sdus_segment_size[sdu_segment_index] = rlc_pP->nb_bytes_requested_by_mac - RLC_AM_PDU_SEGMENT_HEADER_SIZE(sdu_segment_index) - (*payload_sizeP);
+					(*payload_sizeP) += sdus_segment_size[sdu_segment_index];
+				}
+				header_segment_length = RLC_AM_PDU_SEGMENT_HEADER_SIZE(sdu_segment_index);
+				sdu_segment_index ++;
+			}
+
+			num_LIs_pdu_segment = sdu_segment_index - 1;
+		}
+
+
+		/* update retx_so_stop */
+		retx_so_stop = retx_so_start + (*payload_sizeP) - 1;
+
+		AssertFatal ((retx_so_stop <= pdu_mngt->payload_size - 1) && (retx_so_stop - retx_so_start + 1 < pdu_mngt->payload_size),
+				"RLC AM Tx PDU Segment Data Error: retx_so_stop=%d OriginalPDUDataLength=%d SOStart=%d SegmentLength=%d numLISegment=%d numLIPDU=%d sn=%d LcId=%d !\n",
+				retx_so_stop,pdu_mngt->payload_size,retx_so_start,*payload_sizeP,num_LIs_pdu_segment,pdu_mngt->nb_sdus - 1,sn,rlc_pP->channel_id);
+
+		/* init FI End to FALSE if retx_so_stop is not end of PDU */
+		if (retx_so_stop != pdu_mngt->payload_size - 1)
+		{
+			fi_end = FALSE;
+		}
+
+		/* Check consistency between sdus_segment_size and payload_sizeP */
+		/* And Set FI End if retx_so_stop = cumulated data size and this is not last SDU */
+		data_size = 0;
+		for (int i = 0; i < num_LIs_pdu_segment + 1; i++)
+		{
+			data_size += sdus_segment_size[i];
+			if ((retx_so_stop == data_size - 1) && (i < num_LIs_pdu_segment))
+			{
+				fi_end = TRUE;
+			}
+		}
+
+		AssertFatal (data_size == *payload_sizeP, "RLC AM Tx PDU Segment Data Error: SduSum=%d Data=%d sn=%d LcId=%d !\n",
+				data_size,*payload_sizeP,sn,rlc_pP->channel_id);
+
+
+
+		/* Allocation */
+		AssertFatal (header_segment_length + *payload_sizeP <= pdu_mngt->header_and_payload_size + 2, "RLC AM PDU Segment Error: Hdr=%d Data=%d Original Hdr+Data =%d sn=%d LcId=%d !\n",
+				header_segment_length,*payload_sizeP,pdu_mngt->header_and_payload_size,sn,rlc_pP->channel_id);
+		mem_pdu_segment_p = get_free_mem_block((*payload_sizeP + header_segment_length + sizeof(struct mac_tb_req)), __func__);
+		pdu_segment_header_p        = (uint8_t *)&mem_pdu_segment_p->data[sizeof(struct mac_tb_req)];
+		((struct mac_tb_req*)(mem_pdu_segment_p->data))->data_ptr = pdu_segment_header_p;
+		((struct mac_tb_req*)(mem_pdu_segment_p->data))->tb_size = header_segment_length + *payload_sizeP;
+
+		/* clear all PDU segment */
+		memset(pdu_segment_header_p, 0, *payload_sizeP + header_segment_length);
+		/* copy data part */
+		memcpy(pdu_segment_header_p + header_segment_length, pdu_mngt->payload + retx_so_start, *payload_sizeP);
+	}
+
+	/* Last step : update contexts and fill PDU Segment Header */
+	if (mem_pdu_segment_p != NULL)
+	{
+		/* Update PDU Segment contexts */
+		if (*payload_sizeP == pdu_mngt->hole_so_stop[pdu_mngt->retx_hole_index] - pdu_mngt->hole_so_start[pdu_mngt->retx_hole_index] + 1)
+		{
+			/* All data in the segment are transmitted : switch to next one */
+			pdu_mngt->retx_hole_index ++;
+			if (pdu_mngt->retx_hole_index < pdu_mngt->num_holes)
+			{
+				/* Set min SOStart to the value of next hole : assumption is holes are ordered by increasing SOStart */
+				pdu_mngt->nack_so_start = pdu_mngt->hole_so_start[pdu_mngt->retx_hole_index];
+			}
+			else
+			{
+				/* no more scheduled Retx: reset values */
+				/* Retx size is reset in the calling function */
+				pdu_mngt->num_holes = 0;
+				pdu_mngt->retx_hole_index = 0;
+				pdu_mngt->nack_so_start = 0;
+			}
+		}
+		else
+		{
+			/* not all segment data could be transmitted, just update SoStart */
+			pdu_mngt->hole_so_start[pdu_mngt->retx_hole_index] += (*payload_sizeP);
+			pdu_mngt->nack_so_start = pdu_mngt->hole_so_start[pdu_mngt->retx_hole_index];
+		}
+
+		/* Content is supposed to be init with 0 so with FIStart=FIEnd=TRUE */
+		RLC_AM_PDU_SET_D_C(*pdu_segment_header_p);
+		RLC_AM_PDU_SET_RF(*pdu_segment_header_p);
+		/* Change FI */
+		if (!fi_start)
+		{
+			// Set to not starting
+			(*pdu_segment_header_p) |= (1 << (RLC_AM_PDU_FI_OFFSET + 1));
+		}
+		if (!fi_end)
+		{
+			// Set to not starting
+			(*pdu_segment_header_p) |= (1 << (RLC_AM_PDU_FI_OFFSET));
+		}
+		/* Set SN */
+		(*pdu_segment_header_p) |= ((sn >> 8) & 0x3);
+		(*(pdu_segment_header_p + 1)) |= (sn & 0xFF);
+
+		/* Segment Offset */
+		header_so_part = retx_so_start;
+
+		/* Last Segment Flag (LSF) */
+		if (retx_so_stop == pdu_mngt->payload_size - 1)
+		{
+			RLC_AM_PDU_SET_LSF(header_so_part);
+		}
+
+		/* Store SO bytes */
+		* (pdu_segment_header_p + 2)  = (header_so_part >> 8) & 0xFF;
+		* (pdu_segment_header_p + 3)  = header_so_part & 0xFF;
+
+		/* Fill LI part */
+		if (num_LIs_pdu_segment)
+		{
+			uint16_t index = 0;
+			uint16_t temp = 0;
+			/* Set Extension bit in first byte */
+			RLC_AM_PDU_SET_E(*pdu_segment_header_p);
+
+			/* loop on nb of LIs */
+			pdu_segment_header_p += RLC_AM_PDU_SEGMENT_HEADER_MIN_SIZE;
+			li_bit_offset = 4; /* toggle between 0 and 4 */
+			li_jump_offset = 1; /* toggle between 1 and 2 */
+
+			while (index < num_LIs_pdu_segment)
+			{
+				/* Set E bit for next LI if present */
+				if (index < num_LIs_pdu_segment - 1)
+					RLC_SET_BIT(temp,li_bit_offset + RLC_AM_LI_BITS);
+				/* Set LI */
+				RLC_AM_PDU_SET_LI(temp,sdus_segment_size[index],li_bit_offset);
+				*pdu_segment_header_p = temp >> 8;
+				*(pdu_segment_header_p + 1) = temp & 0xFF;
+				pdu_segment_header_p += li_jump_offset;
+				li_bit_offset ^= 0x4;
+				li_jump_offset ^= 0x3;
+
+				temp = ((*pdu_segment_header_p) << 8) | (*(pdu_segment_header_p + 1));
+				index ++;
+			}
+		}
+	}
+	else
+	{
+		LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] OUT OF MEMORY PDU SN %04d\n",
+		              PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
+					  sn);
+	}
+
+	return mem_pdu_segment_p;
 }
+
+#if 0
 //-----------------------------------------------------------------------------
 mem_block_t* rlc_am_retransmit_get_subsegment(
   const protocol_ctxt_t* const  ctxt_pP,
@@ -340,7 +709,7 @@ mem_block_t* rlc_am_retransmit_get_subsegment(
   //    - set the header of the new AMD PDU segment in accordance with the description in sub clause 6.;
   //    - set the P field according to sub clause 5.2.2.
 
-  mem_block_t*           mb_original_p     = rlc_pP->pdu_retrans_buffer[snP].mem_block;
+  mem_block_t*           mb_original_p     = rlc_pP->tx_data_pdu_buffer[snP].mem_block;
 
   if (mb_original_p != NULL) {
     mem_block_t*           mb_sub_segment_p  = get_free_mem_block(*sizeP + sizeof(struct mac_tb_req), __func__);
@@ -353,10 +722,10 @@ mem_block_t* rlc_am_retransmit_get_subsegment(
 
     ((struct mac_tb_req*)(mb_sub_segment_p->data))->data_ptr         = (uint8_t*)&(mb_sub_segment_p->data[sizeof(struct mac_tb_req)]);
 
-    if (rlc_am_get_data_pdu_infos(ctxt_pP, rlc_pP, pdu_original_p, rlc_pP->pdu_retrans_buffer[snP].header_and_payload_size, &pdu_info) >= 0) {
+    if (rlc_am_get_data_pdu_infos(ctxt_pP, rlc_pP, pdu_original_p, rlc_pP->tx_data_pdu_buffer[snP].header_and_payload_size, &pdu_info) >= 0) {
       int li_index = 0;
-      int start_offset       = rlc_pP->pdu_retrans_buffer[snP].nack_so_start;
-      int stop_offset        = rlc_pP->pdu_retrans_buffer[snP].nack_so_stop;
+      int start_offset       = rlc_pP->tx_data_pdu_buffer[snP].nack_so_start;
+      int stop_offset        = rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop;
 
       LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] ORIGINAL PDU SN %04d:\n",
             PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
@@ -366,8 +735,8 @@ mem_block_t* rlc_am_retransmit_get_subsegment(
       // all 15 bits set to 1 (indicate that the missing portion of the AMD PDU includes all bytes
       // to the last byte of the AMD PDU)
       if (stop_offset == 0x7FFF) {
-        rlc_pP->pdu_retrans_buffer[snP].nack_so_stop = rlc_pP->pdu_retrans_buffer[snP].payload_size - 1;
-        stop_offset = rlc_pP->pdu_retrans_buffer[snP].nack_so_stop;
+        rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop = rlc_pP->tx_data_pdu_buffer[snP].payload_size - 1;
+        stop_offset = rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop;
         LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] UPDATED RETRANS PDU SN %04d nack_so_stop FROM 0x7FFF to %05d\n",
               PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
               snP,
@@ -627,7 +996,7 @@ mem_block_t* rlc_am_retransmit_get_subsegment(
               PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
         test_pdu_copy_size = max_copy_payload_size;
 
-        if ((stop_offset ==  (start_offset + max_copy_payload_size - 1)) && (stop_offset == rlc_pP->pdu_retrans_buffer[snP].payload_size - 1)) {
+        if ((stop_offset ==  (start_offset + max_copy_payload_size - 1)) && (stop_offset == rlc_pP->tx_data_pdu_buffer[snP].payload_size - 1)) {
           not_test_fi = (not_test_fi & 0x2) | (not_fi_original & 0x1);  // set b0 idendical to the b0 of the non segmented PDU
         } else {
           not_test_fi = not_test_fi & 0x2;  // clear b0 because no SDU ending in this PDU
@@ -635,7 +1004,7 @@ mem_block_t* rlc_am_retransmit_get_subsegment(
       }
 
       //---------------------------------------------------------------
-      /*if (stop_offset == (rlc_pP->pdu_retrans_buffer[snP].payload_size - 1)) {
+      /*if (stop_offset == (rlc_pP->tx_data_pdu_buffer[snP].payload_size - 1)) {
               test_fi = (test_fi & 0x02) | (fi_original & 0x01);
       }*/
       //---------------------------------------------------------------
@@ -692,16 +1061,16 @@ mem_block_t* rlc_am_retransmit_get_subsegment(
       // copy payload to retransmit
       //---------------------------------------------------------------
       memcpy(fill_payload_p,
-             &rlc_pP->pdu_retrans_buffer[snP].payload[start_offset],
+             &rlc_pP->tx_data_pdu_buffer[snP].payload[start_offset],
              test_pdu_copy_size);
 
       ((struct mac_tb_req*)(mb_sub_segment_p->data))->tb_size  = (tb_size_t)(((uint64_t)fill_payload_p)+ test_pdu_copy_size) - ((uint64_t)(&pdu_sub_segment_p->b1));
 
       // set LSF
-      if ((test_pdu_copy_size + start_offset) == rlc_pP->pdu_retrans_buffer[snP].payload_size) {
+      if ((test_pdu_copy_size + start_offset) == rlc_pP->tx_data_pdu_buffer[snP].payload_size) {
         pdu_sub_segment_p->data[0] = pdu_sub_segment_p->data[0] | 0x80;
 
-        rlc_pP->pdu_retrans_buffer[snP].flags.retransmit = 0;
+        rlc_pP->tx_data_pdu_buffer[snP].flags.retransmit = 0;
 
         LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] RE-SEND DATA PDU SN %04d SO %d %d BYTES PAYLOAD %d BYTES LSF!\n",
               PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
@@ -728,15 +1097,15 @@ mem_block_t* rlc_am_retransmit_get_subsegment(
       // update nack_so_start
       //---------------------------------------------------------------
       rlc_am_remove_hole(ctxt_pP, rlc_pP, snP, start_offset, test_pdu_copy_size+start_offset - 1);
-      //rlc_pP->pdu_retrans_buffer[snP].nack_so_start = rlc_pP->pdu_retrans_buffer[snP].nack_so_start + test_pdu_copy_size;
+      //rlc_pP->tx_data_pdu_buffer[snP].nack_so_start = rlc_pP->tx_data_pdu_buffer[snP].nack_so_start + test_pdu_copy_size;
       LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] RE-SEND DATA PDU SN %04d NOW nack_so_start %d nack_so_stop %d\n",
             PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
             snP,
-            rlc_pP->pdu_retrans_buffer[snP].nack_so_start,
-            rlc_pP->pdu_retrans_buffer[snP].nack_so_stop);
-      /*if (rlc_pP->pdu_retrans_buffer[snP].nack_so_start == rlc_pP->pdu_retrans_buffer[snP].nack_so_stop) {
-          rlc_pP->pdu_retrans_buffer[snP].nack_so_start = 0;
-          rlc_pP->pdu_retrans_buffer[snP].nack_so_stop  = 0x7FFF;
+            rlc_pP->tx_data_pdu_buffer[snP].nack_so_start,
+            rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop);
+      /*if (rlc_pP->tx_data_pdu_buffer[snP].nack_so_start == rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop) {
+          rlc_pP->tx_data_pdu_buffer[snP].nack_so_start = 0;
+          rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop  = 0x7FFF;
       }*/
     } else {
       LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] COULD NOT GET INFO FOR DATA PDU SN %04d -> RETURN NULL\n",
@@ -744,8 +1113,6 @@ mem_block_t* rlc_am_retransmit_get_subsegment(
             snP);
       return NULL;
     }
-
-    rlc_am_pdu_polling(ctxt_pP, rlc_pP, pdu_sub_segment_p, test_pdu_copy_size);
     return mb_sub_segment_p;
   } else {
     LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RE-SEGMENT] RE-SEND DATA PDU SN %04d BUT NO PDU AVAILABLE -> RETURN NULL\n",
@@ -755,6 +1122,7 @@ mem_block_t* rlc_am_retransmit_get_subsegment(
     return NULL;
   }
 }
+#endif
 //-----------------------------------------------------------------------------
 void rlc_am_tx_buffer_display (
   const protocol_ctxt_t* const  ctxt_pP,
@@ -763,6 +1131,7 @@ void rlc_am_tx_buffer_display (
 {
   rlc_sn_t       sn = rlc_pP->vt_a;
   int            i, loop = 0;
+  rlc_am_tx_data_pdu_management_t *tx_data_pdu_buffer_p;
 
   if (message_pP) {
     LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" Retransmission buffer %s VT(A)=%04d VT(S)=%04d:",
@@ -778,25 +1147,26 @@ void rlc_am_tx_buffer_display (
   }
 
   while (rlc_pP->vt_s != sn) {
-    if (rlc_pP->pdu_retrans_buffer[sn].mem_block) {
+	  tx_data_pdu_buffer_p = &rlc_pP->tx_data_pdu_buffer[sn % RLC_AM_WINDOW_SIZE];
+    if (tx_data_pdu_buffer_p->mem_block) {
       if ((loop % 1) == 0) {
         LOG_D(RLC, "\nTX SN:\t");
       }
 
-      if (rlc_pP->pdu_retrans_buffer[sn].flags.retransmit) {
-        LOG_D(RLC, "%04d %d/%d Bytes (NACK RTX:%02d ",sn, rlc_pP->pdu_retrans_buffer[sn].header_and_payload_size, rlc_pP->pdu_retrans_buffer[sn].payload_size,
-              rlc_pP->pdu_retrans_buffer[sn].retx_count);
+      if (tx_data_pdu_buffer_p->flags.retransmit) {
+        LOG_D(RLC, "%04d %d/%d Bytes (NACK RTX:%02d ",sn, tx_data_pdu_buffer_p->header_and_payload_size, tx_data_pdu_buffer_p->payload_size,
+        		tx_data_pdu_buffer_p->retx_count);
       } else {
-        LOG_D(RLC, "%04d %d/%d Bytes (RTX:%02d ",sn, rlc_pP->pdu_retrans_buffer[sn].header_and_payload_size, rlc_pP->pdu_retrans_buffer[sn].payload_size,
-              rlc_pP->pdu_retrans_buffer[sn].retx_count);
+        LOG_D(RLC, "%04d %d/%d Bytes (RTX:%02d ",sn, tx_data_pdu_buffer_p->header_and_payload_size, tx_data_pdu_buffer_p->payload_size,
+        		tx_data_pdu_buffer_p->retx_count);
       }
 
-      if (rlc_pP->pdu_retrans_buffer[sn].num_holes == 0) {
-        LOG_D(RLC, "SO:%04d->%04d)\t", rlc_pP->pdu_retrans_buffer[sn].nack_so_start, rlc_pP->pdu_retrans_buffer[sn].nack_so_stop);
+      if (tx_data_pdu_buffer_p->num_holes == 0) {
+        LOG_D(RLC, "SO:%04d->%04d)\t", tx_data_pdu_buffer_p->nack_so_start, tx_data_pdu_buffer_p->nack_so_stop);
       } else {
-        for (i=0; i<rlc_pP->pdu_retrans_buffer[sn].num_holes; i++) {
+        for (i=0; i<tx_data_pdu_buffer_p->num_holes; i++) {
           assert(i < RLC_AM_MAX_HOLES_REPORT_PER_PDU);
-          LOG_D(RLC, "SO:%04d->%04d)\t", rlc_pP->pdu_retrans_buffer[sn].hole_so_start[i], rlc_pP->pdu_retrans_buffer[sn].hole_so_stop[i]);
+          LOG_D(RLC, "SO:%04d->%04d)\t", tx_data_pdu_buffer_p->hole_so_start[i], tx_data_pdu_buffer_p->hole_so_stop[i]);
         }
       }
 
@@ -808,6 +1178,132 @@ void rlc_am_tx_buffer_display (
 
   LOG_D(RLC, "\n");
 }
+
+//-----------------------------------------------------------------------------
+mem_block_t * rlc_am_get_pdu_to_retransmit(
+  const protocol_ctxt_t* const  ctxt_pP,
+  rlc_am_entity_t* const rlc_pP)
+{
+	  rlc_sn_t             sn          = rlc_pP->vt_a;
+	  rlc_sn_t             sn_end      = rlc_pP->vt_s;
+	  mem_block_t*         pdu_p        = NULL;
+	  rlc_am_tx_data_pdu_management_t* tx_data_pdu_management;
+
+	  AssertFatal ((rlc_pP->retrans_num_pdus > 0) && (rlc_pP->vt_a !=  rlc_pP->vt_s), "RLC AM ReTx start process Error: NbPDUtoRetx=%d vtA=%d vtS=%d  LcId=%d !\n",
+			  rlc_pP->retrans_num_pdus,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
+
+	  do
+	  {
+		  tx_data_pdu_management = &rlc_pP->tx_data_pdu_buffer[sn % RLC_AM_WINDOW_SIZE];
+		  if ((tx_data_pdu_management->flags.retransmit) && (tx_data_pdu_management->flags.max_retransmit == 0))
+		  {
+			  AssertFatal (tx_data_pdu_management->sn == sn, "RLC AM ReTx PDU Error: SN Error pdu_sn=%d sn=%d vtA=%d vtS=%d LcId=%d !\n",
+					  tx_data_pdu_management->sn,sn,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
+			  AssertFatal (tx_data_pdu_management->flags.transmitted == 1, "RLC AM ReTx PDU Error: State Error sn=%d vtA=%d vtS=%d LcId=%d !\n",
+			  					  sn,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
+			  AssertFatal (tx_data_pdu_management->retx_payload_size > 0, "RLC AM ReTx PDU Error: No Data to Retx sn=%d vtA=%d vtS=%d LcId=%d !\n",
+					  sn,rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
+
+			  /* Either the whole RLC PDU is to be transmitted and there is enough MAC TBS or there is minimum TBS size for transmitting 1 AM PDU segment */
+			  if ((tx_data_pdu_management->retx_payload_size == tx_data_pdu_management->payload_size) && (rlc_pP->nb_bytes_requested_by_mac >= tx_data_pdu_management->header_and_payload_size))
+			  {
+				  /* check maxretx is not hit */
+				  if (tx_data_pdu_management->retx_count_next <= rlc_pP->max_retx_threshold)
+				  {
+					  pdu_p = rlc_am_retransmit_get_copy(ctxt_pP, rlc_pP, sn);
+
+					  if (pdu_p != NULL)
+					  {
+						  rlc_pP->retrans_num_bytes_to_retransmit -= tx_data_pdu_management->retx_payload_size;
+						  rlc_pP->retrans_num_pdus --;
+						  tx_data_pdu_management->retx_payload_size = 0;
+						  tx_data_pdu_management->flags.retransmit = 0;
+
+				    	  // update stats
+				          rlc_pP->stat_tx_data_pdu                   += 1;
+				          rlc_pP->stat_tx_retransmit_pdu             += 1;
+				          rlc_pP->stat_tx_retransmit_pdu_by_status   += 1;
+				          rlc_pP->stat_tx_data_bytes                 += tx_data_pdu_management->payload_size;
+				          rlc_pP->stat_tx_retransmit_bytes           += tx_data_pdu_management->payload_size;
+				          rlc_pP->stat_tx_retransmit_bytes_by_status += tx_data_pdu_management->payload_size;
+
+					  }
+				  }
+				  else
+				  {
+					  // TO DO : RLC Notification to RRC + ReEstablishment procedure
+					  tx_data_pdu_management->flags.max_retransmit = 1;
+					  LOG_W(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RLC AM MAX RETX=%d] SN %04d\n",
+					                PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
+									tx_data_pdu_management->retx_count_next,
+					                sn);
+				  }
+			  }
+			  else if (rlc_pP->nb_bytes_requested_by_mac >= 5)
+			  {
+				  /* Resegmentation case */
+				  /* check maxretx is not hit */
+				  if (tx_data_pdu_management->retx_count_next <= rlc_pP->max_retx_threshold)
+				  {
+					  sdu_size_t pdu_data_size = 0;
+
+					  pdu_p = rlc_am_retransmit_get_am_segment(ctxt_pP, rlc_pP, tx_data_pdu_management,&pdu_data_size);
+
+					  if (pdu_p != NULL)
+					  {
+						  AssertFatal ((tx_data_pdu_management->retx_payload_size >= pdu_data_size) && (rlc_pP->retrans_num_bytes_to_retransmit >= pdu_data_size), "RLC AM ReTx PDU Segment Error: DataSize=%d PDUReTxsize=%d TotalReTxsize=%d sn=%d LcId=%d !\n",
+								  pdu_data_size,tx_data_pdu_management->retx_payload_size,rlc_pP->retrans_num_bytes_to_retransmit,sn,rlc_pP->channel_id);
+
+						  tx_data_pdu_management->retx_payload_size -= pdu_data_size;
+						  rlc_pP->retrans_num_bytes_to_retransmit -= pdu_data_size;
+						  if (tx_data_pdu_management->retx_payload_size == 0)
+						  {
+							  rlc_pP->retrans_num_pdus --;
+							  tx_data_pdu_management->retx_payload_size = 0;
+							  tx_data_pdu_management->flags.retransmit = 0;
+						  }
+
+				    	  // update stats
+				          rlc_pP->stat_tx_data_pdu                   += 1;
+				          rlc_pP->stat_tx_retransmit_pdu             += 1;
+				          rlc_pP->stat_tx_retransmit_pdu_by_status   += 1;
+				          rlc_pP->stat_tx_data_bytes                 += pdu_data_size;
+				          rlc_pP->stat_tx_retransmit_bytes           += pdu_data_size;
+				          rlc_pP->stat_tx_retransmit_bytes_by_status += pdu_data_size;
+
+					  }
+				  }
+				  else
+				  {
+					  // TO DO : RLC Notification to RRC + ReEstablishment procedure
+					  tx_data_pdu_management->flags.max_retransmit = 1;
+					  LOG_W(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[RLC AM MAX RETX=%d] SN %04d\n",
+					  					                PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
+					  									tx_data_pdu_management->retx_count_next,
+					  					                sn);
+				  }
+			  }
+
+			  if (pdu_p != NULL)
+			  {
+				  /* check polling */
+				  rlc_am_pdu_sn_10_t* pdu_header_p   = (rlc_am_pdu_sn_10_t*) (&pdu_p->data[sizeof(struct mac_tb_req)]);
+				  rlc_am_pdu_polling(ctxt_pP, rlc_pP, pdu_header_p, tx_data_pdu_management->payload_size,false);
+
+				  tx_data_pdu_management->retx_count = tx_data_pdu_management->retx_count_next;
+
+				  break;
+			  }
+
+		  }
+
+		  sn = RLC_AM_NEXT_SN(sn);
+	  } while((sn != sn_end) && (rlc_pP->retrans_num_pdus > 0));
+
+	  return pdu_p;
+}
+
+#if 0
 //-----------------------------------------------------------------------------
 void rlc_am_retransmit_any_pdu(
   const protocol_ctxt_t* const  ctxt_pP,
@@ -824,13 +1320,13 @@ void rlc_am_retransmit_any_pdu(
         PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
 
   while (sn != sn_end) {
-    if (rlc_pP->pdu_retrans_buffer[sn].mem_block != NULL) {
+    if (rlc_pP->tx_data_pdu_buffer[sn].mem_block != NULL) {
       if (!found_pdu) {
         found_pdu = 1;
         found_pdu_sn = sn;
       }
 
-      if (rlc_pP->pdu_retrans_buffer[sn].header_and_payload_size <= rlc_pP->nb_bytes_requested_by_mac) {
+      if (rlc_pP->tx_data_pdu_buffer[sn].header_and_payload_size <= rlc_pP->nb_bytes_requested_by_mac) {
         LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[FORCE-TRAFFIC] RE-SEND DATA PDU SN %04d\n",
               PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
               sn);
@@ -843,12 +1339,13 @@ void rlc_am_retransmit_any_pdu(
         // no need for update rlc_pP->nb_bytes_requested_by_mac
         pdu_p = rlc_am_retransmit_get_copy(ctxt_pP, rlc_pP, sn);
         pdu_sn_10_p = (rlc_am_pdu_sn_10_t*) (&pdu_p->data[sizeof(struct mac_tb_req)]);
-        rlc_am_pdu_polling(ctxt_pP, rlc_pP, pdu_sn_10_p, rlc_pP->pdu_retrans_buffer[sn].header_and_payload_size);
-        pdu_sn_10_p->b1 = pdu_sn_10_p->b1 | 0x20;
-        rlc_pP->c_pdu_without_poll     = 0;
-        rlc_pP->c_byte_without_poll    = 0;
+        rlc_am_pdu_polling(ctxt_pP, rlc_pP, pdu_sn_10_p, rlc_pP->tx_data_pdu_buffer[sn].header_and_payload_size,false);
+        //BugFix: polling is checked and done in function above !
+        //pdu_sn_10_p->b1 = pdu_sn_10_p->b1 | 0x20;
+        //BugFix : pdu_without_poll and byte_without_poll are reset only if a Poll is transmitted
+        //rlc_pP->c_pdu_without_poll     = 0;
+        //rlc_pP->c_byte_without_poll    = 0;
         //rlc_pP->poll_sn = (rlc_pP->vt_s -1) & RLC_AM_SN_MASK;
-        rlc_am_start_timer_poll_retransmit(ctxt_pP, rlc_pP);
         rlc_pP->stat_tx_data_pdu                   += 1;
         rlc_pP->stat_tx_retransmit_pdu             += 1;
         rlc_pP->stat_tx_data_bytes                 += ((struct mac_tb_req*)(pdu_p->data))->tb_size;
@@ -877,12 +1374,11 @@ void rlc_am_retransmit_any_pdu(
       rlc_am_nack_pdu (ctxt_pP, rlc_pP, found_pdu_sn, 0, 0x7FFF);
       pdu_p = rlc_am_retransmit_get_subsegment(ctxt_pP, rlc_pP, found_pdu_sn, &rlc_pP->nb_bytes_requested_by_mac);
       pdu_sn_10_p = (rlc_am_pdu_sn_10_t*) (&pdu_p->data[sizeof(struct mac_tb_req)]);
-      rlc_am_pdu_polling(ctxt_pP, rlc_pP, pdu_sn_10_p, rlc_pP->pdu_retrans_buffer[found_pdu_sn].header_and_payload_size);
+      rlc_am_pdu_polling(ctxt_pP, rlc_pP, pdu_sn_10_p, rlc_pP->tx_data_pdu_buffer[found_pdu_sn].header_and_payload_size,false);
       pdu_sn_10_p->b1 = pdu_sn_10_p->b1 | 0x20;
       rlc_pP->c_pdu_without_poll     = 0;
       rlc_pP->c_byte_without_poll    = 0;
       //rlc_pP->poll_sn = (rlc_pP->vt_s -1) & RLC_AM_SN_MASK;
-      rlc_am_start_timer_poll_retransmit(ctxt_pP, rlc_pP);
       rlc_pP->stat_tx_data_pdu                   += 1;
       rlc_pP->stat_tx_retransmit_pdu             += 1;
       rlc_pP->stat_tx_data_bytes                 += ((struct mac_tb_req*)(pdu_p->data))->tb_size;
@@ -896,3 +1392,4 @@ void rlc_am_retransmit_any_pdu(
     }
   }
 }
+#endif
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.h
index 99570e5d7f4d8be8ef57823503887c797bcca9b6..338bc791968565aba6640d19f2e6dc181c30695c 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.h
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_retransmit.h
@@ -50,21 +50,24 @@
 #                define public_rlc_am_retransmit(x)     extern x
 #            endif
 #        endif
-/*! \fn void  rlc_am_nack_pdu (const protocol_ctxt_t* const  ctxt_pP, rlc_am_entity_t *rlcP, uint16_t snP, sdu_size_t so_startP, sdu_size_t so_endP)
+/*! \fn boolean_t  rlc_am_nack_pdu (const protocol_ctxt_t* const  ctxt_pP, rlc_am_entity_t *rlcP, int16_t snP, int16_t prev_nack_snP,sdu_size_t so_startP, sdu_size_t so_endP)
 * \brief      The RLC AM PDU which have the sequence number snP is marked NACKed with segment offset fields.
 * \param[in]  ctxtP        Running context.
 * \param[in]  rlcP         RLC AM protocol instance pointer.
 * \param[in]  snP          Sequence number of the PDU that is negative acknowledged.
+* \param[in]  prev_nack_snP  Sequence number of previous PDU that is negative acknowledged.
 * \param[in]  so_startP    Start of the segment offset of the PDU that .
 * \param[in]  so_endP      Transport blocks received from MAC layer.
+* \return                  OK/KO
 * \note It may appear a new hole in the retransmission buffer depending on the segment offset informations. Depending on the state of the retransmission buffer, negative confirmation can be sent to higher layers about the drop by the RLC AM instance of a particular SDU.
 */
-protected_rlc_am_retransmit(void         rlc_am_nack_pdu (
+protected_rlc_am_retransmit(boolean_t         rlc_am_nack_pdu (
                               const protocol_ctxt_t* const  ctxt_pP,
                               rlc_am_entity_t *const rlcP,
                               const rlc_sn_t snP,
-                              const sdu_size_t so_startP,
-                              const sdu_size_t so_endP);)
+							  const rlc_sn_t prev_nack_snP,
+                              sdu_size_t so_startP,
+                              sdu_size_t so_endP);)
 
 /*! \fn void rlc_am_ack_pdu (const protocol_ctxt_t* const  ctxt_pP,rlc_am_entity_t *rlcP, rlc_sn_t snP)
 * \brief      The RLC AM PDU which have the sequence number snP is marked ACKed.
@@ -90,6 +93,7 @@ protected_rlc_am_retransmit(mem_block_t* rlc_am_retransmit_get_copy (
                               rlc_am_entity_t *const rlcP,
                               const rlc_sn_t snP));
 
+#if 0
 /*! \fn mem_block_t* rlc_am_retransmit_get_subsegment (const protocol_ctxt_t* const  ctxt_pP,rlc_am_entity_t *rlcP,rlc_sn_t snP, sdu_size_t *sizeP)
 * \brief      The RLC AM PDU which have the sequence number snP is marked ACKed.
 * \param[in]  ctxtP        Running context.
@@ -103,7 +107,18 @@ protected_rlc_am_retransmit(mem_block_t* rlc_am_retransmit_get_subsegment (
                               rlc_am_entity_t *const rlcP,
                               const rlc_sn_t snP,
                               sdu_size_t *const sizeP));
+#endif
 
+/*! \fn mem_block_t* rlc_am_get_pdu_to_retransmit(const protocol_ctxt_t* const  ctxt_pP, rlc_am_entity_t* rlcP)
+* \brief      Find a PDU or PDU segment to retransmit.
+* \param[in]  ctxtP        Running context.
+* \param[in]  rlcP         RLC AM protocol instance pointer.
+* \return                  A copy of the retransmitted PDU or PDU segment or NULL if TBS was not big enough
+*/
+protected_rlc_am_retransmit(mem_block_t* rlc_am_get_pdu_to_retransmit(
+                              const protocol_ctxt_t* const  ctxt_pP,
+                              rlc_am_entity_t* const rlcP);)
+#if 0
 /*! \fn void rlc_am_retransmit_any_pdu(const protocol_ctxt_t* const  ctxt_pP, rlc_am_entity_t* rlcP)
 * \brief      Retransmit any PDU in order to unblock peer entity, if no suitable PDU is found (depending on requested MAC size) to be retransmitted, then try to retransmit a subsegment of any PDU.
 * \param[in]  ctxtP        Running context.
@@ -112,6 +127,7 @@ protected_rlc_am_retransmit(mem_block_t* rlc_am_retransmit_get_subsegment (
 protected_rlc_am_retransmit(void rlc_am_retransmit_any_pdu(
                               const protocol_ctxt_t* const  ctxt_pP,
                               rlc_am_entity_t* const rlcP);)
+#endif
 
 /*! \fn void rlc_am_tx_buffer_display (const protocol_ctxt_t* const  ctxt_pP,rlc_am_entity_t* rlcP,  char* message_pP)
 * \brief      Display the dump of the retransmission buffer.
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.c
index a9f0bdbf7e64e82155decfd4d8cd205415a99e45..cad1a776a8244503a7257fca0d3799c9d43d05d3 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.c
@@ -31,7 +31,812 @@
 #include "UTIL/LOG/log.h"
 
 
+boolean_t rlc_am_rx_check_vr_reassemble(
+		  const protocol_ctxt_t* const ctxt_pP,
+		  const rlc_am_entity_t* const rlc_pP)
+{
+	mem_block_t*       cursor_p                    = rlc_pP->receiver_buffer.head;
+	rlc_am_rx_pdu_management_t * pdu_cursor_mgnt_p = NULL;
+	sdu_size_t          next_waited_so = 0;
+	boolean_t reassemble = FALSE;
+
+	if (cursor_p != NULL) {
+
+		rlc_am_pdu_info_t* pdu_info_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
+		rlc_usn_t sn_ref = pdu_info_p->sn;
+
+		if (sn_ref != rlc_pP->vr_r) {
+			/* Case vrR has advanced from head : most likely case */
+
+			reassemble = TRUE;
+			/* Handle first SN if it is made of PDU segments : set them all to be reassembled */
+			if (pdu_info_p->rf) {
+				pdu_cursor_mgnt_p = (rlc_am_rx_pdu_management_t *) (cursor_p->data);
+				next_waited_so = 0;
+				AssertFatal(pdu_cursor_mgnt_p->all_segments_received > 0,"AM Rx Check Reassembly head SN=%d with PDU segments != vrR=%d should be fully received LCID=%d\n",
+						sn_ref,rlc_pP->vr_r,rlc_pP->channel_id);
+				while ((cursor_p != NULL) && (pdu_info_p->sn == sn_ref) && (pdu_info_p->so == next_waited_so)) {
+					if (pdu_cursor_mgnt_p->segment_reassembled == RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_NO) {
+						pdu_cursor_mgnt_p->segment_reassembled = RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_PENDING;
+					}
+					next_waited_so += pdu_info_p->payload_size;
+					cursor_p = cursor_p->next;
+					if (cursor_p != NULL) {
+						pdu_cursor_mgnt_p = (rlc_am_rx_pdu_management_t *) (cursor_p->data);
+						pdu_info_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
+					}
+				}
+			}
+
+			/* Now jump up to vrR */
+			while ((RLC_AM_DIFF_SN(pdu_info_p->sn,sn_ref) < RLC_AM_DIFF_SN(rlc_pP->vr_r,sn_ref)) && (cursor_p != NULL)) {
+				cursor_p = cursor_p->next;
+				if (cursor_p != NULL) {
+					pdu_info_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
+				}
+			}
+
+			/* Handle vrR if it is made of incomplete PDU Segments */
+			if ((cursor_p != NULL) && (pdu_info_p->sn == rlc_pP->vr_r)) {
+				pdu_cursor_mgnt_p = (rlc_am_rx_pdu_management_t *) (cursor_p->data);
+				next_waited_so = 0;
+				AssertFatal(pdu_cursor_mgnt_p->all_segments_received == 0,"AM Rx Check Reassembly vr=%d should be partly received SNHead=%d LCID=%d\n",
+						rlc_pP->vr_r,sn_ref,rlc_pP->channel_id);
+				while ((cursor_p != NULL) && (pdu_info_p->sn == rlc_pP->vr_r) && (pdu_info_p->so == next_waited_so)) {
+					if (pdu_cursor_mgnt_p->segment_reassembled == RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_NO) {
+						pdu_cursor_mgnt_p->segment_reassembled = RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_PENDING;
+					}
+					next_waited_so += pdu_info_p->payload_size;
+					cursor_p = cursor_p->next;
+					if (cursor_p != NULL) {
+						pdu_cursor_mgnt_p = (rlc_am_rx_pdu_management_t *) (cursor_p->data);
+						pdu_info_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
+					}
+				}
+			}
+		} /* end sn_ref != rlc_pP->vr_r */
+		else {
+			/* case vrR = partially received */
+
+			pdu_cursor_mgnt_p = (rlc_am_rx_pdu_management_t *) (cursor_p->data);
+			next_waited_so = 0;
+			AssertFatal(pdu_cursor_mgnt_p->all_segments_received == 0,"AM Rx Check Reassembly SNHead=vr=%d should be partly received LCID=%d\n",
+					rlc_pP->vr_r,rlc_pP->channel_id);
+			while ((cursor_p != NULL) && (pdu_info_p->sn == rlc_pP->vr_r) && (pdu_info_p->so == next_waited_so)) {
+				if (pdu_cursor_mgnt_p->segment_reassembled == RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_NO) {
+					pdu_cursor_mgnt_p->segment_reassembled = RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_PENDING;
+					reassemble = TRUE;
+				}
+				next_waited_so += pdu_info_p->payload_size;
+				cursor_p = cursor_p->next;
+				if (cursor_p != NULL) {
+					pdu_cursor_mgnt_p = (rlc_am_rx_pdu_management_t *) (cursor_p->data);
+					pdu_info_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
+				}
+			}
+		} /*end sn_ref == rlc_pP->vr_r */
+	}
+	return reassemble;
+}
+
+mem_block_t * create_new_segment_from_pdu(
+		mem_block_t* const tb_pP,
+		uint16_t so_offset, /* offset from the data part of the PDU to copy */
+		sdu_size_t	data_length_to_copy)
+{
+	rlc_am_pdu_info_t* pdu_rx_info_p	= &((rlc_am_rx_pdu_management_t*)(tb_pP->data))->pdu_info;
+	rlc_am_pdu_info_t* pdu_new_segment_info_p = NULL;
+	mem_block_t *	new_segment_p		= NULL;
+	int16_t  new_li_list[RLC_AM_MAX_SDU_IN_PDU];
+	int16_t header_size = 0;
+	uint8_t	num_li = 0;
+	boolean_t fi_start, fi_end, lsf;
+
+	/* Init some PDU Segment header fixed parameters */
+	fi_start = !((pdu_rx_info_p->fi & 0x2) >> 1);
+	fi_end = !(pdu_rx_info_p->fi & 0x1);
+	lsf = ((pdu_rx_info_p->lsf == 1) || (pdu_rx_info_p->rf == 0));
+
+	/* Handle NO Li case fist */
+	if (pdu_rx_info_p->num_li == 0) {
+
+		header_size = RLC_AM_PDU_SEGMENT_HEADER_MIN_SIZE;
+
+		if (so_offset) {
+			fi_start = FALSE;
+		}
+		if (so_offset + data_length_to_copy != pdu_rx_info_p->payload_size) {
+			fi_end = FALSE;
+			lsf = FALSE;
+		}
+	} // end no LI in original segment
+	else {
+
+		uint8_t	li_index = 0;
+		uint16_t li_sum = 0;
+		num_li = pdu_rx_info_p->num_li;
+
+		/* set LSF to false if we know that end of the original segment will not be copied */
+		if (so_offset + data_length_to_copy != pdu_rx_info_p->payload_size) {
+			lsf = FALSE;
+		}
+
+		/* catch the first LI containing so_offset */
+		while ((li_index < pdu_rx_info_p->num_li) && (li_sum + pdu_rx_info_p->li_list[li_index] <= so_offset)) {
+			li_sum += pdu_rx_info_p->li_list[li_index];
+			num_li --;
+			li_index ++;
+		}
+
+		/* set FI start if so_offset = LI sum and at least one LI have been read  */
+		if ((li_index) && (so_offset == li_sum)) {
+			fi_start = TRUE;
+		}
+
+		/* Fill LI until the end */
+		if (num_li) {
+			sdu_size_t	remaining_size = data_length_to_copy;
+			uint8_t	j = 0;
+			new_li_list[0] = li_sum + pdu_rx_info_p->li_list[li_index] - so_offset;
+			if (data_length_to_copy <= new_li_list[0]) {
+				num_li = 0;
+			}
+			else {
+				remaining_size -= new_li_list[0];
+				j++;
+				li_index ++;
+				while ((li_index < pdu_rx_info_p->num_li) && (remaining_size >= pdu_rx_info_p->li_list[li_index])) {
+					remaining_size -= pdu_rx_info_p->li_list[li_index];
+					new_li_list[j] = pdu_rx_info_p->li_list[li_index];
+					j++;
+					li_index ++;
+				}
+
+				/* update number of LI in the segment */
+				num_li = j;
+				/* set FI End if remaining size = 0  */
+				if (remaining_size == 0) {
+					fi_end = TRUE;
+				}
+			}
+		}
+
+		/* compute header size */
+		header_size = RLC_AM_PDU_SEGMENT_HEADER_SIZE(num_li);
+
+	} // end LIs in original segment
+
+	/* Allocate new buffer */
+	new_segment_p = get_free_mem_block(sizeof (mac_rlc_max_rx_header_size_t) + header_size + data_length_to_copy, __func__);
+
+	/* Fill PDU  Segment Infos and Header */
+	if (new_segment_p != NULL) {
+		pdu_new_segment_info_p	= &((rlc_am_rx_pdu_management_t*)(new_segment_p->data))->pdu_info;
+		rlc_am_rx_pdu_management_t * pdu_cursor_mgnt_p = (rlc_am_rx_pdu_management_t *) (new_segment_p->data);
+		uint8_t   *pdu_segment_header_p        	= (uint8_t *)&(new_segment_p->data[sizeof (mac_rlc_max_rx_header_size_t)]);
+
+		pdu_cursor_mgnt_p->segment_reassembled	= RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_NO; //to be updated after if SN = vrR
+
+		pdu_new_segment_info_p->d_c 			= pdu_rx_info_p->d_c;
+		pdu_new_segment_info_p->sn				= pdu_rx_info_p->sn;
+		pdu_new_segment_info_p->p				= pdu_rx_info_p->p;
+		pdu_new_segment_info_p->rf				= 1;
+		pdu_new_segment_info_p->fi				= (((fi_start ? 0: 1) << 1) | (fi_end ? 0: 1));
+		pdu_new_segment_info_p->num_li			= num_li;
+		pdu_new_segment_info_p->e				= (num_li ? 1: 0);
+		pdu_new_segment_info_p->lsf				= (lsf ? 1: 0);
+		pdu_new_segment_info_p->so				= pdu_rx_info_p->so + so_offset;
+		pdu_new_segment_info_p->payload			= pdu_segment_header_p + header_size;
+		pdu_new_segment_info_p->header_size 	= header_size;
+		pdu_new_segment_info_p->payload_size	= data_length_to_copy;
+		pdu_new_segment_info_p->hidden_size		= data_length_to_copy;
+		for (int i=0; i < num_li; i++) {
+			pdu_new_segment_info_p->li_list[i] = new_li_list[i];
+			pdu_new_segment_info_p->hidden_size -= new_li_list[i];
+		}
+
+		/* Fill Header part in the buffer */
+		/* Content is supposed to be init with 0 so with FIStart=FIEnd=TRUE */
+		/* copy first two bytes from original: D/C + RF + FI + E+ SN*/
+		memset(pdu_segment_header_p, 0, header_size);
+		RLC_AM_PDU_SET_D_C(*pdu_segment_header_p);
+		RLC_AM_PDU_SET_RF(*pdu_segment_header_p);
+		if (pdu_new_segment_info_p->p) {
+			RLC_AM_PDU_SET_POLL(*pdu_segment_header_p);
+		}
+		/* Change FI */
+		if (!fi_start)
+		{
+			// Set to not starting
+			(*pdu_segment_header_p) |= (1 << (RLC_AM_PDU_FI_OFFSET + 1));
+
+		}
+		if (!fi_end)
+		{
+			// Set to not starting
+			(*pdu_segment_header_p) |= (1 << (RLC_AM_PDU_FI_OFFSET));
+
+		}
+		/* E */
+		if (pdu_new_segment_info_p->e) {
+			RLC_AM_PDU_SET_E(*pdu_segment_header_p);
+		}
+		/* SN */
+		(*pdu_segment_header_p) |= ((pdu_new_segment_info_p->sn >> 8) & 0x3);
+		*(pdu_segment_header_p + 1) = (pdu_new_segment_info_p->sn & 0xFF);
+
+		pdu_segment_header_p += 2;
+
+		/* Last Segment Flag (LSF) */
+		if (lsf)
+		{
+			RLC_AM_PDU_SET_LSF(*pdu_segment_header_p);
+		}
+		/* Store SO bytes */
+		* (pdu_segment_header_p )  		|= ((pdu_new_segment_info_p->so >> 8) & 0x7F);
+		* (pdu_segment_header_p + 1)  	= pdu_new_segment_info_p->so & 0xFF;
+
+		if (num_li) {
+			uint16_t index = 0;
+			uint16_t temp = 0;
+			uint8_t li_bit_offset = 4; /* toggle between 0 and 4 */
+			uint8_t li_jump_offset = 1; /* toggle between 1 and 2 */
+
+			/* loop on nb of LIs */
+			pdu_segment_header_p += 2;
+
+			while (index < num_li)
+			{
+				/* Set E bit for next LI if present */
+				if (index < num_li - 1)
+					RLC_SET_BIT(temp,li_bit_offset + RLC_AM_LI_BITS);
+				/* Set LI */
+				RLC_AM_PDU_SET_LI(temp,new_li_list[index],li_bit_offset);
+				*pdu_segment_header_p = temp >> 8;
+				*(pdu_segment_header_p + 1) = temp & 0xFF;
+				pdu_segment_header_p += li_jump_offset;
+				li_bit_offset ^= 0x4;
+				li_jump_offset ^= 0x3;
+
+				temp = ((*pdu_segment_header_p) << 8) | (*(pdu_segment_header_p + 1));
+				index ++;
+			}
+		}
+
+		/* copy data part */
+		/* Fill mem_block contexts */
+		((struct mac_tb_ind *) (new_segment_p->data))->first_bit = 0;
+		((struct mac_tb_ind *) (new_segment_p->data))->data_ptr = (uint8_t*)&new_segment_p->data[sizeof (mac_rlc_max_rx_header_size_t)];
+		((struct mac_tb_ind *) (new_segment_p->data))->size = data_length_to_copy + header_size;
+		memcpy(pdu_new_segment_info_p->payload,pdu_rx_info_p->payload + so_offset,data_length_to_copy);
+	}
+
+	return new_segment_p;
+}
+
+rlc_am_rx_pdu_status_t rlc_am_rx_list_handle_pdu_segment(
+		const protocol_ctxt_t* const  ctxt_pP,
+		rlc_am_entity_t* const rlc_pP,
+		mem_block_t* const tb_pP)
+{
+	  rlc_am_pdu_info_t* pdu_rx_info_p                  = &((rlc_am_rx_pdu_management_t*)(tb_pP->data))->pdu_info;
+	  rlc_am_pdu_info_t* pdu_info_cursor_p           = NULL;
+	  rlc_am_pdu_info_t* pdu_info_previous_cursor_p  = NULL;
+	  mem_block_t*       cursor_p                    = rlc_pP->receiver_buffer.head;
+	  mem_block_t*       previous_cursor_p           = NULL;
+	  mem_block_t*       next_cursor_p           	 = NULL;
+	  uint16_t so_start_min = 0;
+	  uint16_t so_end = 0;
+	  uint16_t so_start_segment = pdu_rx_info_p->so;
+	  uint16_t so_end_segment = pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1;
+
+	  /*****************************************************/
+	  // 1) Find previous cursor to the PDU to insert
+	  /*****************************************************/
+	  AssertFatal(cursor_p != NULL,"AM Rx PDU Error, received buffer empty LcID=%d\n",rlc_pP->channel_id);
+
+	  do {
+		  pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
+
+		  // Stop if Cursor SN >= Received SN
+		  if (RLC_AM_DIFF_SN(pdu_info_cursor_p->sn,rlc_pP->vr_r) >= RLC_AM_DIFF_SN(pdu_rx_info_p->sn,rlc_pP->vr_r)) {
+			  break;
+		  }
+
+          previous_cursor_p = cursor_p;
+          pdu_info_previous_cursor_p = pdu_info_cursor_p;
+          cursor_p = cursor_p->next;
+	  } while (cursor_p != NULL);
+
+	  /*****************************************************/
+	  // 2) Store the received Segment
+	  /*****************************************************/
+	  // First case : cursor_p is NULL or its SN is different from the received one, it means the SN is received for the first time
+	  // Insert PDU after previous_cursor_p
+	  if ((cursor_p == NULL) || (pdu_info_cursor_p->sn != pdu_rx_info_p->sn)) {
+          if (previous_cursor_p != NULL) {
+                LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[PROCESS RX PDU SEGMENT SN=%d] PDU SEGMENT INSERTED AFTER PDU SN=%d\n",
+                            PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),pdu_rx_info_p->sn,
+							pdu_info_previous_cursor_p->sn);
+              list2_insert_after_element(tb_pP, previous_cursor_p, &rlc_pP->receiver_buffer);
+          }
+          else { /* SN of head of Rx PDU list is higher than received PDU SN */
+              LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[PROCESS RX PDU SEGMENT SN=%d] PDU SEGMENT INSERTED BEFORE PDU SN=%d\n",
+                            PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),pdu_rx_info_p->sn,
+                            pdu_info_cursor_p->sn);
+              list2_insert_before_element(tb_pP, cursor_p, &rlc_pP->receiver_buffer);
+          }
+
+		  return RLC_AM_DATA_PDU_STATUS_OK;
+	  }
+
+	  /********************************************/
+	  /* Now handle case cursor->sn = received SN */
+	  /********************************************/
+
+	  rlc_am_rx_pdu_management_t * pdu_cursor_mgnt_p = (rlc_am_rx_pdu_management_t *) (cursor_p->data);
+
+	  // Filter out SN duplicate
+	  if (pdu_cursor_mgnt_p->all_segments_received) {
+		  return RLC_AM_DATA_PDU_STATUS_AM_SEGMENT_DUPLICATE;
+	  }
+
+	  // Try to catch a segment duplicate
+	  next_cursor_p = cursor_p;
+	  while ((next_cursor_p != NULL) && (pdu_info_cursor_p->sn == pdu_rx_info_p->sn)) {
+		  if ((so_start_segment >= pdu_info_cursor_p->so) && (so_end_segment <= pdu_info_cursor_p->so + pdu_info_cursor_p->payload_size - 1)) {
+			  LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[PROCESS RX PDU SEGMENT]  DISCARD : DUPLICATE SEGMENT SN=%d\n",
+							  PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),pdu_rx_info_p->sn);
+			  return RLC_AM_DATA_PDU_STATUS_AM_SEGMENT_DUPLICATE;
+		  }
+		  next_cursor_p = next_cursor_p->next;
+		  if (next_cursor_p != NULL) {
+			  pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(next_cursor_p->data))->pdu_info;
+		  }
+	  }
+
+	  // Reset pdu_info_cursor_p because of the loop before
+	  pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
+
+	  // Try to Handle the most likely cases first
+	  if (pdu_info_cursor_p->so == 0) {
+
+		  /* Loop on stored segments and find the stored segment containing received SOStart */
+		  previous_cursor_p = cursor_p;
+		  pdu_info_previous_cursor_p = pdu_info_cursor_p;
+		  while ((cursor_p != NULL) && (pdu_info_cursor_p->sn == pdu_rx_info_p->sn)
+				  && ((pdu_info_cursor_p->so + pdu_info_cursor_p->payload_size) <= so_start_segment)) {
+			  previous_cursor_p = cursor_p;
+			  pdu_info_previous_cursor_p = pdu_info_cursor_p;
+			  cursor_p = cursor_p->next;
+			  if (cursor_p != NULL) {
+				  pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
+			  }
+		  }
+
+		  // Most likely case : no duplicate, the segment is put after all stored segments which are contiguous
+		  if ((cursor_p == NULL) || (pdu_info_cursor_p->sn != pdu_rx_info_p->sn) || (pdu_info_cursor_p->so > so_end_segment)) {
+              LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[PROCESS RX PDU SEGMENT SN=%d SOSTART=%d] PDU SEGMENT INSERTED AFTER PDU SEGMENT WITH SOEND=%d\n",
+                          PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),pdu_rx_info_p->sn,so_start_segment,
+						  pdu_info_previous_cursor_p->so + pdu_info_previous_cursor_p->payload_size - 1);
+
+			  list2_insert_after_element(tb_pP, previous_cursor_p, &rlc_pP->receiver_buffer);
+			  return RLC_AM_DATA_PDU_STATUS_OK;
+		  }
+
+		  // Duplicate case : Resume contiguous scan and update previous_cursor_p
+		  so_start_min = pdu_info_previous_cursor_p->so;
+		  so_end = so_start_min + pdu_info_previous_cursor_p->payload_size;
+		  cursor_p = previous_cursor_p->next;
+		  if (cursor_p != NULL) {
+			  pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
+		  }
+		  while ((cursor_p != NULL) && (pdu_info_cursor_p->sn == pdu_rx_info_p->sn)
+				  && (pdu_info_cursor_p->so == so_end)) {
+			  previous_cursor_p = cursor_p;
+			  pdu_info_previous_cursor_p = pdu_info_cursor_p;
+			  so_end += pdu_info_cursor_p->payload_size;
+			  cursor_p = cursor_p->next;
+			  if (cursor_p != NULL) {
+				  pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
+			  }
+		  }
+
+		  /* Now discard the PDU segment if it is within so_start_min and so_end */
+		  if ((so_start_min <= so_start_segment) && (so_end_segment <= so_end - 1)) {
+			  LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[PROCESS RX PDU SEGMENT]  DISCARD : DUPLICATE SEGMENT SN=%d\n",
+							  PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),pdu_rx_info_p->sn);
+			  return RLC_AM_DATA_PDU_STATUS_AM_SEGMENT_DUPLICATE;
+		  }
+
+		  // Discard potential embedded segments in the received PDU segment
+		  // The first one is discontigous
+		  next_cursor_p = cursor_p;
+		  while ((next_cursor_p != NULL) && (pdu_info_cursor_p->sn == pdu_rx_info_p->sn) &&
+				  (so_end_segment >= pdu_info_cursor_p->so + pdu_info_cursor_p->payload_size - 1)) {
+			  /* Discard the segment */
+			  cursor_p = next_cursor_p;
+			  next_cursor_p = next_cursor_p->next;
+			  list2_remove_element (cursor_p, &rlc_pP->receiver_buffer);
+			  free_mem_block(cursor_p, __func__);
+
+			  if (next_cursor_p != NULL) {
+				  pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(next_cursor_p->data))->pdu_info;
+			  }
+		  }
+		  cursor_p = next_cursor_p;
+
+		  //Remove duplicate at the begining
+		  if (so_start_segment < pdu_info_previous_cursor_p->so) {
+			  so_start_segment = pdu_info_previous_cursor_p->so + pdu_info_previous_cursor_p->payload_size;
+		  }
+		  else if (so_start_segment < pdu_info_previous_cursor_p->so + pdu_info_previous_cursor_p->payload_size){
+			  so_start_segment += (pdu_info_previous_cursor_p->so + pdu_info_previous_cursor_p->payload_size - so_start_segment);
+		  }
+
+		  // Now remove duplicate at the end, only valid if cursor_p SN has the same received SN
+		  if (cursor_p != NULL) {
+			  pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(next_cursor_p->data))->pdu_info;
+
+			  if ((pdu_info_cursor_p->sn == pdu_rx_info_p->sn) && (so_end_segment >= pdu_info_cursor_p->so)) {
+				  so_end_segment = pdu_info_cursor_p->so - 1;
+			  }
+		  }
+
+		  AssertFatal((so_start_segment <= so_end_segment) && (pdu_rx_info_p->so <= so_start_segment) &&
+				  (so_end_segment <= pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1),
+				  " AM RX PDU Segment Duplicate elimination error FirstSO=0 OldSOStart=%d OldSOEnd=%d newSOStart=%d newSOEnd =%d SN=%d\n",
+				  pdu_rx_info_p->so,pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1,so_start_segment,so_end_segment,pdu_rx_info_p->sn);
+
+	  } // end pdu_info_cursor_p->so == 0
+	  else {
+		  // Handle most likely case : PDU Segment without duplicate is inserted before first stored PDU segment
+		  if (so_end_segment < pdu_info_cursor_p->so) {
+              LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[PROCESS RX PDU SEGMENT SN=%d SOSTART=%d SOEND=%d] PDU SEGMENT INSERTED BEFORE PDU SEGMENT WITH SOSTART=%d\n",
+                            PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),pdu_rx_info_p->sn,so_start_segment,so_end_segment,
+							pdu_info_cursor_p->so);
+
+			  list2_insert_before_element(tb_pP, cursor_p, &rlc_pP->receiver_buffer);
+			  return RLC_AM_DATA_PDU_STATUS_OK;
+		  }
+
+		  // Handle duplicate case
+		  if (so_start_segment < pdu_info_cursor_p->so) {
+			  // First Case : only duplicate at the end
+			  // Scan for embedded segments to be discarded
+			  next_cursor_p = cursor_p;
+			  while ((next_cursor_p != NULL) && (pdu_info_cursor_p->sn == pdu_rx_info_p->sn) &&
+					  (so_end_segment >= pdu_info_cursor_p->so + pdu_info_cursor_p->payload_size - 1)) {
+				  /* Discard the segment */
+				  cursor_p = next_cursor_p;
+				  next_cursor_p = next_cursor_p->next;
+				  list2_remove_element (cursor_p, &rlc_pP->receiver_buffer);
+				  free_mem_block(cursor_p, __func__);
+
+				  if (next_cursor_p != NULL) {
+					  pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(next_cursor_p->data))->pdu_info;
+				  }
+			  }
+			  cursor_p = next_cursor_p;
+
+			  // Now remove duplicate at the end, only valid if cursor_p SN has the same received SN
+			  if (cursor_p != NULL) {
+				  pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(next_cursor_p->data))->pdu_info;
+
+				  if ((pdu_info_cursor_p->sn == pdu_rx_info_p->sn) && (so_end_segment >= pdu_info_cursor_p->so)) {
+					  so_end_segment = pdu_info_cursor_p->so - 1;
+				  }
+			  }
+
+			  AssertFatal((so_start_segment <= so_end_segment) &&
+					  (so_end_segment <= pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1),
+					  " AM RX PDU Segment Duplicate elimination at the end error FirstSO!=0 SOStart=%d OldSOEnd=%d newSOEnd =%d SN=%d\n",
+					  pdu_rx_info_p->so,pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1,so_end_segment,pdu_rx_info_p->sn);
+
+		  }
+		  else {
+			  // Second Case: Duplicate at the begining and potentially at the end
+			  /* Loop on stored segments and find the stored segment containing received SOStart */
+
+			  previous_cursor_p = cursor_p;
+			  pdu_info_previous_cursor_p = pdu_info_cursor_p;
+			  while ((cursor_p != NULL) && (pdu_info_cursor_p->sn == pdu_rx_info_p->sn)
+					  && ((pdu_info_cursor_p->so + pdu_info_cursor_p->payload_size) <= so_start_segment)) {
+				  previous_cursor_p = cursor_p;
+				  pdu_info_previous_cursor_p = pdu_info_cursor_p;
+				  cursor_p = cursor_p->next;
+				  if (cursor_p != NULL) {
+					  pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
+				  }
+			  }
+
+			  // Most likely case : no duplicate, the segment is put after all stored segments which are contiguous
+			  if ((cursor_p == NULL) || (pdu_info_cursor_p->sn != pdu_rx_info_p->sn) || (pdu_info_cursor_p->so > so_end_segment)) {
+	              LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[PROCESS RX PDU SEGMENT SN=%d SOSTART=%d] PDU SEGMENT INSERTED AFTER PDU SEGMENT WITH SOEND=%d\n",
+	                          PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),pdu_rx_info_p->sn,so_start_segment,
+							  pdu_info_previous_cursor_p->so + pdu_info_previous_cursor_p->payload_size - 1);
+
+				  list2_insert_after_element(tb_pP, previous_cursor_p, &rlc_pP->receiver_buffer);
+				  return RLC_AM_DATA_PDU_STATUS_OK;
+			  }
+
+			  // Now look for contiguous segments to check whether the received segment is not fully duplicate
+			  so_start_min = pdu_info_previous_cursor_p->so;
+			  so_end = so_start_min + pdu_info_previous_cursor_p->payload_size;
+			  cursor_p = previous_cursor_p->next;
+			  if (cursor_p != NULL) {
+				  pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
+			  }
+			  while ((cursor_p != NULL) && (pdu_info_cursor_p->sn == pdu_rx_info_p->sn)
+					  && (pdu_info_cursor_p->so == so_end)) {
+				  previous_cursor_p = cursor_p;
+				  pdu_info_previous_cursor_p = pdu_info_cursor_p;
+				  so_end += pdu_info_cursor_p->payload_size;
+				  cursor_p = cursor_p->next;
+				  if (cursor_p != NULL) {
+					  pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
+				  }
+			  }
+
+			  /* Now discard the PDU segment if it is within so_start_min and so_end */
+			  if ((so_start_min <= so_start_segment) && (so_end_segment < so_end)) {
+				  LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[PROCESS RX PDU SEGMENT]  DISCARD : DUPLICATE SEGMENT SN=%d\n",
+								  PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),pdu_rx_info_p->sn);
+				  return RLC_AM_DATA_PDU_STATUS_AM_SEGMENT_DUPLICATE;
+			  }
+
+			  //Remove duplicate at the begining
+			  if (so_start_segment < pdu_info_previous_cursor_p->so) {
+				  so_start_segment = pdu_info_previous_cursor_p->so + pdu_info_previous_cursor_p->payload_size;
+			  }
+			  else if (so_start_segment < pdu_info_previous_cursor_p->so + pdu_info_previous_cursor_p->payload_size){
+				  so_start_segment += (pdu_info_previous_cursor_p->so + pdu_info_previous_cursor_p->payload_size - so_start_segment);
+			  }
+
+
+			  // Now Scan for embedded segments to be discarded
+			  next_cursor_p = cursor_p;
+			  while ((next_cursor_p != NULL) && (pdu_info_cursor_p->sn == pdu_rx_info_p->sn) &&
+					  (so_end_segment >= pdu_info_cursor_p->so + pdu_info_cursor_p->payload_size - 1)) {
+				  /* Discard the segment */
+				  cursor_p = next_cursor_p;
+				  next_cursor_p = next_cursor_p->next;
+				  list2_remove_element (cursor_p, &rlc_pP->receiver_buffer);
+				  free_mem_block(cursor_p, __func__);
+
+				  if (next_cursor_p != NULL) {
+					  pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(next_cursor_p->data))->pdu_info;
+				  }
+			  }
+			  cursor_p = next_cursor_p;
+
+			  // Now remove duplicate at the end, only valid if cursor_p SN has the same received SN
+			  if (cursor_p != NULL) {
+				  pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(next_cursor_p->data))->pdu_info;
+
+				  if ((pdu_info_cursor_p->sn == pdu_rx_info_p->sn) && (so_end_segment >= pdu_info_cursor_p->so)) {
+					  so_end_segment = pdu_info_cursor_p->so - 1;
+				  }
+			  }
+
+			  AssertFatal((so_start_segment <= so_end_segment) && (pdu_rx_info_p->so <= so_start_segment) &&
+					  (so_end_segment <= pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1),
+					  " AM RX PDU Segment Duplicate elimination error FirstSO!=0 OldSOStart=%d OldSOEnd=%d newSOStart=%d newSOEnd =%d SN=%d\n",
+					  pdu_rx_info_p->so,pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1,so_start_segment,so_end_segment,pdu_rx_info_p->sn);
+		  }
+
+	  } // end pdu_info_cursor_p->so != 0
+
+
+	  /* Last step :  duplicate bytes had been removed, build a new PDU segment */
+	  AssertFatal((pdu_rx_info_p->so != so_start_segment) || (so_end_segment != pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1),
+			  " AM RX PDU Segment Duplicate elimination error FirstSO!=0 OldSOStart=%d OldSOEnd=%d newSOStart=%d newSOEnd =%d SN=%d\n",
+			  pdu_rx_info_p->so,pdu_rx_info_p->so + pdu_rx_info_p->payload_size - 1,so_start_segment,so_end_segment,pdu_rx_info_p->sn);
+
+	  mem_block_t* trunc_segment = create_new_segment_from_pdu(tb_pP,so_start_segment - pdu_rx_info_p->so,so_end_segment - so_start_segment + 1);
+	  if (trunc_segment != NULL) {
+		  LOG_I(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[PROCESS RX PDU SEGMENT]  CREATE SEGMENT FROM SEGMENT OFFSET=%d DATA LENGTH=%d SN=%d\n",
+						  PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),so_start_segment - pdu_rx_info_p->so,so_end_segment - so_start_segment + 1,pdu_rx_info_p->sn);
+
+		  if (previous_cursor_p != NULL) {
+			  list2_insert_after_element(trunc_segment, previous_cursor_p, &rlc_pP->receiver_buffer);
+		  }
+		  else {
+			  list2_insert_before_element(trunc_segment, rlc_pP->receiver_buffer.head, &rlc_pP->receiver_buffer);
+		  }
+
+		  /* Free original PDU Segment */
+		  free_mem_block(tb_pP, __func__);
+
+		  return RLC_AM_DATA_PDU_STATUS_OK;
+	  }
+	  else {
+		  return RLC_AM_DATA_PDU_STATUS_BUFFER_FULL;
+	  }
+
+}
+
+rlc_am_rx_pdu_status_t rlc_am_rx_list_handle_pdu(
+		const protocol_ctxt_t* const  ctxt_pP,
+		rlc_am_entity_t* const rlc_pP,
+		mem_block_t* const tb_pP)
+{
+	  rlc_am_pdu_info_t* pdu_rx_info_p                  = &((rlc_am_rx_pdu_management_t*)(tb_pP->data))->pdu_info;
+	  rlc_am_pdu_info_t* pdu_info_cursor_p           = NULL;
+	  mem_block_t*       cursor_p                    = rlc_pP->receiver_buffer.head;
+	  mem_block_t*       previous_cursor_p           = NULL;
+	  rlc_am_rx_pdu_status_t pdu_status = RLC_AM_DATA_PDU_STATUS_OK;
+	  // it is assumed this pdu is in rx window
+
+
+	  /*****************************************************/
+	  // 1) Find previous cursor to the PDU to insert
+	  /*****************************************************/
+	  AssertFatal(cursor_p != NULL,"AM Rx PDU Error, received buffer empty LcID=%d\n",rlc_pP->channel_id);
+
+	  do {
+		  pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
+
+		  // Stop if Cursor SN >= Received SN
+		  if (RLC_AM_DIFF_SN(pdu_info_cursor_p->sn,rlc_pP->vr_r) >= RLC_AM_DIFF_SN(pdu_rx_info_p->sn,rlc_pP->vr_r)) {
+			  break;
+		  }
+
+          previous_cursor_p = cursor_p;
+          cursor_p = cursor_p->next;
+	  } while (cursor_p != NULL);
+
+	  /*****************************************************/
+	  // 2) Insert PDU by removing byte duplicate if required
+	  /*****************************************************/
+	  // First case : cursor_p is NULL or SN are different, it means the SN is received for the first time
+	  // Insert PDU after previous_cursor_p
+	  if ((cursor_p == NULL) || (pdu_info_cursor_p->sn != pdu_rx_info_p->sn)) {
+	      if (previous_cursor_p != NULL) {
+	            LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[PROCESS RX PDU SN=%d] PDU INSERTED AFTER PDU SN=%d\n",
+	                        PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),pdu_rx_info_p->sn,
+	                        ((rlc_am_rx_pdu_management_t*)(previous_cursor_p->data))->pdu_info.sn);
+	          list2_insert_after_element(tb_pP, previous_cursor_p, &rlc_pP->receiver_buffer);
+	      }
+	      else { /* SN of head of Rx PDU list is higher than received PDU SN */
+              LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[PROCESS RX PDU SN=%d] PDU INSERTED BEFORE PDU SN=%d\n",
+                            PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),pdu_rx_info_p->sn,
+                            pdu_info_cursor_p->sn);
+	          list2_insert_before_element(tb_pP, cursor_p, &rlc_pP->receiver_buffer);
+	      }
+
+		  return pdu_status;
+	  }
+
+	  // Filter out SN duplicate
+	  // SN of received PDU has already data stored
+	  rlc_am_rx_pdu_management_t * pdu_cursor_mgnt_p = (rlc_am_rx_pdu_management_t *) (cursor_p->data);
+
+	  if (pdu_cursor_mgnt_p->all_segments_received) {
+		  return RLC_AM_DATA_PDU_STATUS_SN_DUPLICATE;
+	  }
+
+	  /* check if the received PDU is equal to vrR */
+	  if ((pdu_rx_info_p->sn != rlc_pP->vr_r) || (pdu_info_cursor_p->so != 0)) {
+		  /* The full received PDU can replace the allready received PDU Segments. */
+		  /* clean them and append this PDU */
+		  mem_block_t*       cursor_next_p = cursor_p;
+		  while (cursor_next_p) {
+			  cursor_p = cursor_next_p;
+			  cursor_next_p = cursor_next_p->next;
+			  list2_remove_element (cursor_p, &rlc_pP->receiver_buffer);
+			  free_mem_block(cursor_p, __func__);
+			  if (cursor_next_p != NULL) {
+				  pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_next_p->data))->pdu_info;
+				  if (pdu_info_cursor_p->sn != pdu_rx_info_p->sn) {
+					  break;
+				  }
+			  }
+		  }
+
+	      LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[PROCESS RX PDU]  PDU REPLACES STORED PDU SEGMENTS SN=%d\n",
+	              PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),pdu_rx_info_p->sn);
+
+	      if (previous_cursor_p != NULL) {
+	          list2_insert_after_element(tb_pP, previous_cursor_p, &rlc_pP->receiver_buffer);
+	      }
+	      else {
+	          list2_insert_before_element(tb_pP, cursor_next_p, &rlc_pP->receiver_buffer);
+	      }
+
+		  return pdu_status;
+	  } // End SN != vrR or SO != 0
+	  else {
+		  /* First update cursor until discontinuity */
+		  previous_cursor_p = cursor_p;
+		  AssertFatal(pdu_info_cursor_p->rf != 0,"AM Rx PDU Error, stored SN=%d should be a PDU segment\n",pdu_info_cursor_p->sn);
+		  AssertFatal(((rlc_am_rx_pdu_management_t *) (cursor_p->data))->all_segments_received == 0,
+				  "AM Rx PDU Error, stored SN=%d already fully received\n",pdu_info_cursor_p->sn);
+		  sdu_size_t          next_waited_so = 0;
+		  while ((cursor_p != NULL) && (pdu_info_cursor_p->sn == pdu_rx_info_p->sn) && (pdu_info_cursor_p->so == next_waited_so)) {
+			  next_waited_so += pdu_info_cursor_p->payload_size;
+	          previous_cursor_p = cursor_p;
+	          cursor_p = cursor_p->next;
+	          if (cursor_p != NULL) {
+	        	  pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
+	          }
+		  }
+		  /* Create a new PDU segment by removing first next_waited_so bytes */
+		  mem_block_t* trunc_pdu = create_new_segment_from_pdu(tb_pP,next_waited_so,pdu_rx_info_p->payload_size - next_waited_so);
+
+		  if (trunc_pdu != NULL) {
+			  /* Insert PDU Segment */
+			  list2_insert_after_element(trunc_pdu, previous_cursor_p, &rlc_pP->receiver_buffer);
+
+		      LOG_I(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[PROCESS RX PDU]  CREATE PDU SEGMENT FROM PDU OFFSET =%d SN=%d\n",
+		              PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),next_waited_so,pdu_rx_info_p->sn);
+
+			  /* clean previous stored segments in duplicate */
+			  if ((cursor_p != NULL) && (pdu_info_cursor_p->sn == pdu_rx_info_p->sn)) {
+				  mem_block_t*       cursor_next_p = cursor_p;
+				  while (cursor_next_p) {
+					  cursor_p = cursor_next_p;
+					  cursor_next_p = cursor_next_p->next;
+					  list2_remove_element (cursor_p, &rlc_pP->receiver_buffer);
+					  free_mem_block(cursor_p, __func__);
+					  if (cursor_next_p != NULL) {
+						  pdu_info_cursor_p = &((rlc_am_rx_pdu_management_t*)(cursor_next_p->data))->pdu_info;
+						  if (pdu_info_cursor_p->sn != pdu_rx_info_p->sn) {
+							  break;
+						  }
+					  }
+				  }
+			  }
+
+			  /* Free original PDU */
+			  free_mem_block(tb_pP, __func__);
+
+			  return pdu_status;
+		  }
+		  else {
+			  return RLC_AM_DATA_PDU_STATUS_BUFFER_FULL;
+		  }
+	  }
+}
 
+// returns 0 if success
+// returns neg value if failure
+//-----------------------------------------------------------------------------
+rlc_am_rx_pdu_status_t
+rlc_am_rx_list_check_duplicate_insert_pdu(
+  const protocol_ctxt_t* const  ctxt_pP,
+  rlc_am_entity_t* const rlc_pP,
+  mem_block_t* const tb_pP)
+{
+	  rlc_am_pdu_info_t* pdu_rx_info_p                  = &((rlc_am_rx_pdu_management_t*)(tb_pP->data))->pdu_info;
+	  mem_block_t*       cursor_p                    = NULL;
+	  cursor_p = rlc_pP->receiver_buffer.head;
+	  rlc_am_rx_pdu_status_t pdu_status = RLC_AM_DATA_PDU_STATUS_OK;
+	  // it is assumed this pdu is in rx window
+
+	  /* Init Reassembly status */
+	  ((rlc_am_rx_pdu_management_t*)(tb_pP->data))->segment_reassembled = RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_NO;
+
+	  if (cursor_p == NULL)  {
+		    LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[INSERT PDU] LINE %d RX PDU SN %04d (only inserted)\n",
+		          PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
+		          __LINE__,
+				  pdu_rx_info_p->sn);
+		    list2_add_head(tb_pP, &rlc_pP->receiver_buffer);
+		    return pdu_status;
+	  }
+
+
+	  if (pdu_rx_info_p->rf == 0) { // Case normal PDU received
+		  pdu_status = rlc_am_rx_list_handle_pdu(ctxt_pP,rlc_pP,tb_pP);
+	  }
+	  else {
+		  pdu_status = rlc_am_rx_list_handle_pdu_segment(ctxt_pP,rlc_pP,tb_pP);
+	  }
+
+	  return pdu_status;
+}
+#if 0
 // returns 0 if success
 // returns neg value if failure
 //-----------------------------------------------------------------------------
@@ -49,6 +854,10 @@ rlc_am_rx_list_insert_pdu(
   cursor_p = rlc_pP->receiver_buffer.head;
   // it is assumed this pdu is in rx window
 
+  //TODO : check for duplicate
+  // should be rewrite
+  /* look for previous SN */
+
   if (cursor_p) {
     if (rlc_pP->vr_mr < rlc_pP->vr_r) {
       if (pdu_info_p->sn >= rlc_pP->vr_r) {
@@ -479,6 +1288,8 @@ rlc_am_rx_list_insert_pdu(
         pdu_info_p->sn);
   return -1;
 }
+#endif
+
 //-----------------------------------------------------------------------------
 void
 rlc_am_rx_check_all_byte_segments(
@@ -519,8 +1330,10 @@ rlc_am_rx_check_all_byte_segments(
   // in case all first segments up to tb_pP are in list
   // the so field of the first PDU should be 0
   //cursor_p = list.head;
+  //we start from the first stored PDU segment of this SN
   pdu_info_p = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
 
+  // if the first segment does not have SO = 0 then no need to continue
   if (pdu_info_p->so != 0) {
     return;
   }
@@ -549,13 +1362,15 @@ rlc_am_rx_check_all_byte_segments(
           next_waited_so = next_waited_so + pdu_info_p->payload_size;
           //msg("rlc_am_rx_check_all_byte_segments(%d) @6\n",sn);
         } else { // assumed pdu_info_p->so + pdu_info_p->payload_size > next_waited_so
-          next_waited_so = (next_waited_so + pdu_info_p->payload_size) - (next_waited_so - pdu_info_p->so);
+          //next_waited_so = (next_waited_so + pdu_info_p->payload_size) - (next_waited_so - pdu_info_p->so);
           //msg("rlc_am_rx_check_all_byte_segments(%d) @7\n",sn);
+        	return;
         }
 
         if (pdu_info_p->lsf > 0) {
           //msg("rlc_am_rx_check_all_byte_segments(%d) @8\n",sn);
           rlc_am_rx_mark_all_segments_received(ctxt_pP, rlc_pP,  first_cursor_p);
+          return;
         }
       }
 
@@ -599,13 +1414,15 @@ rlc_am_rx_mark_all_segments_received(
   }
 }
 //-----------------------------------------------------------------------------
+//#define		RLC_AM_DEBUG_REASSEMBLY
 void
 rlc_am_rx_list_reassemble_rlc_sdus(
   const protocol_ctxt_t* const  ctxt_pP,
   rlc_am_entity_t* const        rlc_pP)
 {
-  mem_block_t*                cursor_p                     = NULL;
-  rlc_am_rx_pdu_management_t* rlc_am_rx_old_pdu_management = NULL;
+  mem_block_t*                cursor_p                     	= NULL;
+  rlc_am_rx_pdu_management_t* rlc_am_rx_old_pdu_management 	= NULL;
+  rlc_am_pdu_info_t* pdu_info_p								= NULL;
 
   cursor_p = list2_get_head(&rlc_pP->receiver_buffer);
 
@@ -614,20 +1431,79 @@ rlc_am_rx_list_reassemble_rlc_sdus(
   }
 
   rlc_am_rx_pdu_management_t* rlc_am_rx_pdu_management_p = ((rlc_am_rx_pdu_management_t*)(cursor_p->data));
+  pdu_info_p	= &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
+#ifdef RLC_AM_DEBUG_REASSEMBLY
+  rlc_usn_t sn_reass_start = pdu_info_p->sn;
+#endif
+
+  /* Specific process for the first SN if all PDU segments had been reassembled but not freed */
+  if ((rlc_am_rx_pdu_management_p->all_segments_received > 0) && (pdu_info_p->rf != 0)) {
+	  rlc_sn_t sn = pdu_info_p->sn;
+	  while ((cursor_p != NULL) && (((rlc_am_rx_pdu_management_t*)(cursor_p->data))->segment_reassembled == RLC_AM_RX_PDU_SEGMENT_REASSEMBLED)
+			  && ((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info.sn == sn) {
+	      cursor_p = list2_remove_head(&rlc_pP->receiver_buffer);
+	      free_mem_block(cursor_p, __func__);
+	      cursor_p = list2_get_head(&rlc_pP->receiver_buffer);
+	  }
+
+	  /* Reset Management pointers */
+	  if (cursor_p != NULL) {
+		  rlc_am_rx_pdu_management_p = ((rlc_am_rx_pdu_management_t*)(cursor_p->data));
+		  /* Next SN must be the same or SN+1 */
+		  if (RLC_AM_DIFF_SN(rlc_am_rx_pdu_management_p->pdu_info.sn,sn) > 1) {
+			  return;
+		  }
+	  }
+	  else {
+		  return;
+	  }
+  }
 
   do {
     if (rlc_am_rx_pdu_management_p->all_segments_received > 0) {
       cursor_p = list2_remove_head(&rlc_pP->receiver_buffer);
-      rlc_am_reassemble_pdu(ctxt_pP, rlc_pP, cursor_p);
+      rlc_am_reassemble_pdu(ctxt_pP, rlc_pP, cursor_p,TRUE);
       rlc_am_rx_old_pdu_management = rlc_am_rx_pdu_management_p;
       cursor_p = list2_get_head(&rlc_pP->receiver_buffer);
 
       if (cursor_p == NULL) {
+#ifdef RLC_AM_DEBUG_REASSEMBLY
+    	  LOG_D(RLC, "RLC AM REASSEMBLY from sn=%d to ALL, vrR=%d vrMS=%d\n",
+    			  sn_reass_start,rlc_pP->vr_r,rlc_pP->vr_ms);
+#endif
         return;
       }
 
       rlc_am_rx_pdu_management_p = ((rlc_am_rx_pdu_management_t*)(cursor_p->data));
-    } else {
+    }
+    else if (rlc_am_rx_pdu_management_p->segment_reassembled == RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_PENDING) {
+    	rlc_am_rx_pdu_management_p->segment_reassembled = RLC_AM_RX_PDU_SEGMENT_REASSEMBLED;
+
+        rlc_am_reassemble_pdu(ctxt_pP, rlc_pP, cursor_p,FALSE);
+        rlc_am_rx_old_pdu_management = rlc_am_rx_pdu_management_p;
+        cursor_p = cursor_p->next;
+
+        if (cursor_p == NULL) {
+#ifdef RLC_AM_DEBUG_REASSEMBLY
+      	  LOG_D(RLC, "RLC AM REASSEMBLY from sn=%d to ALL, Last is Segment, vrR=%d vrMS=%d\n",
+      			  sn_reass_start,rlc_pP->vr_r,rlc_pP->vr_ms);
+#endif
+          return;
+        }
+
+        rlc_am_rx_pdu_management_p = ((rlc_am_rx_pdu_management_t*)(cursor_p->data));
+    }
+    else if (rlc_am_rx_pdu_management_p->segment_reassembled == RLC_AM_RX_PDU_SEGMENT_REASSEMBLED) {
+        rlc_am_rx_old_pdu_management = rlc_am_rx_pdu_management_p;
+        cursor_p = cursor_p->next;
+
+        if (cursor_p == NULL) {
+          return;
+        }
+
+        rlc_am_rx_pdu_management_p = ((rlc_am_rx_pdu_management_t*)(cursor_p->data));
+    }
+    else {
 #if RLC_STOP_ON_LOST_PDU
 
       if (list2_get_head(&rlc_pP->receiver_buffer) != cursor_p) {
@@ -637,11 +1513,28 @@ rlc_am_rx_list_reassemble_rlc_sdus(
       }
 
 #endif
+#ifdef RLC_AM_DEBUG_REASSEMBLY
+	  LOG_D(RLC, "RLC AM REASSEMBLY from sn=%d to ALL, vrR=%d vrMS=%d\n",
+			  sn_reass_start,rlc_pP->vr_r,rlc_pP->vr_ms);
+#endif
+      return;
+    }
+
+  } while (((RLC_AM_DIFF_SN(rlc_am_rx_pdu_management_p->pdu_info.sn,rlc_am_rx_old_pdu_management->pdu_info.sn) < 2) && (rlc_am_rx_old_pdu_management->all_segments_received > 0))
+           || ((rlc_am_rx_pdu_management_p->pdu_info.sn == rlc_am_rx_old_pdu_management->pdu_info.sn) && (rlc_am_rx_pdu_management_p->segment_reassembled != RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_NO)));
+
+#ifdef RLC_AM_DEBUG_REASSEMBLY
+  mem_block_t* cursor_head_p = list2_get_head(&rlc_pP->receiver_buffer);
+  if (cursor_head_p == NULL) {
       return;
     }
 
-  } while ((rlc_am_rx_pdu_management_p->pdu_info.sn == ((rlc_am_rx_old_pdu_management->pdu_info.sn + 1) & RLC_AM_SN_MASK))
-           || ((rlc_am_rx_pdu_management_p->pdu_info.sn == rlc_am_rx_old_pdu_management->pdu_info.sn) && (rlc_am_rx_pdu_management_p->all_segments_received > 0)));
+  rlc_am_pdu_info_t* pdu_info_head_p	= &((rlc_am_rx_pdu_management_t*)(cursor_head_p->data))->pdu_info;
+
+  LOG_D(RLC, "RLC AM REASSEMBLY from sn=%d to sn=%d, next_sn=%d head sn=%d vrR=%d vrMS=%d\n",
+		  sn_reass_start,rlc_am_rx_old_pdu_management->pdu_info.sn,rlc_am_rx_pdu_management_p->pdu_info.sn,pdu_info_head_p->sn,rlc_pP->vr_r,rlc_pP->vr_ms);
+#endif
+
 }
 //-----------------------------------------------------------------------------
 mem_block_t *
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.h
index c75255c4fac76e605bc84d911baa0cf587b6d970..e6e043dd0a579092223189ba1464519bc931be15 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.h
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_rx_list.h
@@ -59,6 +59,16 @@
 #include "PHY/defs.h"
 
 //-----------------------------------------------------------------------------
+/*! \fn rlc_am_rx_pdu_status_t rlc_am_rx_list_check_duplicate_insert_pdu(const protocol_ctxt_t* const  ctxt_pP,rlc_am_entity_t* const rlc_pP,mem_block_t* const tb_pP)
+* \brief      Insert a PDU in the RX buffer after removing byte duplicate (implemented with a list).
+* \param[in]  ctxt_pP        Running context.
+* \param[in]  rlcP         RLC AM protocol instance pointer.
+* \param[in]  tbP          A PDU embedded in a mem_block_t.
+* \return     Zero if the PDU could be inserted in the RX buffer, a negative value if the PDU could not be inserted.
+*/
+protected_rlc_am_rx_list( rlc_am_rx_pdu_status_t rlc_am_rx_list_check_duplicate_insert_pdu(const protocol_ctxt_t* const  ctxt_pP,rlc_am_entity_t* const rlc_pP,mem_block_t* const tb_pP);)
+
+#if 0
 /*! \fn signed int rlc_am_rx_list_insert_pdu(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP , mem_block_t* const tbP)
 * \brief      Insert a PDU in the RX buffer (implemented with a list).
 * \param[in]  ctxt_pP        Running context.
@@ -67,6 +77,15 @@
 * \return     Zero if the PDU could be inserted in the RX buffer, a negative value if the PDU could not be inserted.
 */
 protected_rlc_am_rx_list( signed int rlc_am_rx_list_insert_pdu(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP,  mem_block_t* const tbP);)
+#endif
+
+/*! \fn boolean_t rlc_am_rx_check_vr_reassemble(const protocol_ctxt_t* const ctxt_pP,const rlc_am_entity_t* const rlc_pP)
+* \brief      Check if reassembly taking into account potential new vrR value
+* \param[in]  ctxt_pP        Running context.
+* \param[in]  rlcP         RLC AM protocol instance pointer.
+* \return     TRUE if reassembly must be done, FALSE else
+*/
+protected_rlc_am_rx_list( boolean_t rlc_am_rx_check_vr_reassemble(const protocol_ctxt_t* const ctxt_pP,const rlc_am_entity_t* const rlc_pP);)
 
 /*! \fn void rlc_am_rx_check_all_byte_segments(const protocol_ctxt_t* const ctxt_pP, rlc_am_entity_t* const rlcP, mem_block_t* const tbP)
 * \brief      Check if all sub-segments of a PDU are received, if yes then call rlc_am_rx_mark_all_segments_received() procedure.
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 893588d65e28fbc7651b7ef36bfec7e424309a67..113ee7d048a61677c67fac3d7f818dde03b3374b 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.c
@@ -39,7 +39,8 @@ void rlc_am_pdu_polling (
   const protocol_ctxt_t* const  ctxt_pP,
   rlc_am_entity_t *const rlc_pP,
   rlc_am_pdu_sn_10_t *const pdu_pP,
-  const int16_t payload_sizeP)
+  const int16_t payload_sizeP,
+  boolean_t is_new_pdu)
 {
   // 5.2.2 Polling
   // An AM RLC entity can poll its peer AM RLC entity in order to trigger STATUS reporting at the peer AM RLC entity.
@@ -68,49 +69,59 @@ void rlc_am_pdu_polling (
   //         - start t-PollRetransmit;
   //     - else:
   //         - restart t-PollRetransmit;
-  rlc_pP->c_pdu_without_poll     += 1;
-  rlc_pP->c_byte_without_poll    += payload_sizeP;
+
+  if (is_new_pdu) {
+	  if (rlc_pP->poll_pdu != RLC_AM_POLL_PDU_INFINITE) {
+		  rlc_pP->c_pdu_without_poll     += 1;
+	  }
+
+	  if (rlc_pP->poll_byte != RLC_AM_POLL_BYTE_INFINITE) {
+		  rlc_pP->c_byte_without_poll    += payload_sizeP;
+	  }
+  }
 
   if (
-    (rlc_pP->c_pdu_without_poll >= rlc_pP->poll_pdu) ||
-    (rlc_pP->c_byte_without_poll >= rlc_pP->poll_byte) ||
+    ((is_new_pdu) && ((rlc_pP->c_pdu_without_poll >= rlc_pP->poll_pdu) ||
+    (rlc_pP->c_byte_without_poll >= rlc_pP->poll_byte))) ||
     ((rlc_pP->sdu_buffer_occupancy == 0) && (rlc_pP->retrans_num_bytes_to_retransmit == 0)) ||
     (rlc_pP->vt_s == rlc_pP->vt_ms) ||
-    (rlc_pP->force_poll == TRUE)
+    (rlc_pP->force_poll == true)
   ) {
-	rlc_pP->force_poll = FALSE;
+	rlc_pP->force_poll = false;
 
-    if (rlc_pP->c_pdu_without_poll >= rlc_pP->poll_pdu) {
+    if ((is_new_pdu) && (rlc_pP->c_pdu_without_poll >= rlc_pP->poll_pdu)) {
       LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[POLL] SET POLL BECAUSE TX NUM PDU THRESHOLD %d  HAS BEEN REACHED\n",
             PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
             rlc_pP->poll_pdu);
-    } else
-    if (rlc_pP->c_byte_without_poll >= rlc_pP->poll_byte) {
+    }
+    if ((is_new_pdu) && (rlc_pP->c_byte_without_poll >= rlc_pP->poll_byte)) {
       LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[POLL] SET POLL BECAUSE TX NUM BYTES THRESHOLD %d  HAS BEEN REACHED\n",
             PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
             rlc_pP->poll_byte);
-    } else
+    }
     if ((rlc_pP->sdu_buffer_occupancy == 0) && (rlc_pP->retrans_num_bytes_to_retransmit == 0)) {
       LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[POLL] SET POLL BECAUSE TX BUFFERS ARE EMPTY\n",
             PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
-    } else
+    }
     if (rlc_pP->vt_s == rlc_pP->vt_ms) {
       LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[POLL] SET POLL BECAUSE OF WINDOW STALLING\n",
             PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
     }
 
-    pdu_pP->b1 = pdu_pP->b1 | 0x20;
+    RLC_AM_PDU_SET_POLL(pdu_pP->b1);
     rlc_pP->c_pdu_without_poll     = 0;
     rlc_pP->c_byte_without_poll    = 0;
 
-    rlc_pP->poll_sn = (rlc_pP->vt_s -1) & RLC_AM_SN_MASK;
+    // vt_s shall have been updated before in case of new transmission
+    rlc_pP->poll_sn = RLC_AM_PREV_SN(rlc_pP->vt_s);
     //optimisation if (!rlc_pP->t_poll_retransmit.running) {
     rlc_am_start_timer_poll_retransmit(ctxt_pP, rlc_pP);
     //optimisation } else {
     //optimisation     rlc_pP->t_poll_retransmit.frame_time_out = ctxt_pP->frame + rlc_pP->t_poll_retransmit.time_out;
     //optimisation }
   } else {
-    pdu_pP->b1 = pdu_pP->b1 & 0xDF;
+	  // Need to clear poll bit as it may be a copy(retransmission case) of the original RLC PDU which was containing a poll
+	RLC_AM_PDU_CLEAR_POLL(pdu_pP->b1);
   }
 }
 //-----------------------------------------------------------------------------
@@ -178,7 +189,9 @@ void rlc_am_segment_10 (
       if (rlc_pP->nb_sdu_no_segmented <= 1) {
         max_li_overhead = 0;
       } else {
-        max_li_overhead = (((rlc_pP->nb_sdu_no_segmented - 1) * 3) / 2) + ((rlc_pP->nb_sdu_no_segmented - 1) % 2);
+    	/* This computation assumes there is no SDU with size greater than 2047 bytes, otherwise a new PDU must be built except for LI15 configuration from Rel12*/
+    	test_num_li = rlc_pP->nb_sdu_no_segmented - 1;
+        max_li_overhead = test_num_li + (test_num_li >> 1) + (test_num_li & 1);
       }
 
       LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEGMENT] max_li_overhead %d\n",
@@ -210,7 +223,7 @@ void rlc_am_segment_10 (
       pdu_remaining_size = data_pdu_size - RLC_AM_HEADER_MIN_SIZE;
       pdu_p        = (rlc_am_pdu_sn_10_t*) (&pdu_mem_p->data[sizeof(struct mac_tb_req)]);
       pdu_tb_req_p = (struct mac_tb_req*) (pdu_mem_p->data);
-      pdu_mngt_p   = &rlc_pP->pdu_retrans_buffer[rlc_pP->vt_s % RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE];
+      pdu_mngt_p   = &rlc_pP->tx_data_pdu_buffer[rlc_pP->vt_s % RLC_AM_PDU_RETRANSMISSION_BUFFER_SIZE];
       memset(pdu_mngt_p, 0, sizeof (rlc_am_tx_data_pdu_management_t));
 
       memset (pdu_mem_p->data, 0, sizeof (rlc_am_pdu_sn_10_t)+sizeof(struct mac_tb_req));
@@ -485,11 +498,11 @@ void rlc_am_segment_10 (
       fi = fi + 1;
     }
 
-    pdu_p->b1 = pdu_p->b1 | (fi << 3);
+    pdu_p->b1 = pdu_p->b1 | (fi << RLC_AM_PDU_FI_OFFSET);
 
     // set fist e bit
     if (fill_num_li > 0) {
-      pdu_p->b1 = pdu_p->b1 | 0x04;
+    	RLC_AM_PDU_SET_E(pdu_p->b1);
     }
 
     LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEGMENT] SEND PDU SN %04d  SIZE %d BYTES PAYLOAD SIZE %d BYTES\n",
@@ -501,8 +514,9 @@ void rlc_am_segment_10 (
     rlc_pP->stat_tx_data_pdu   += 1;
     rlc_pP->stat_tx_data_bytes += (data_pdu_size - pdu_remaining_size);
 
-    //pdu_p->sn = rlc_pP->vt_s;
-    pdu_p->b1 = pdu_p->b1 | 0x80; // DATA/CONTROL field is DATA PDU
+    // set DATA/CONTROL field is DATA PDU(1)
+    RLC_AM_PDU_SET_D_C(pdu_p->b1);
+    // set sn = rlc_pP->vt_s;
     pdu_p->b1 = pdu_p->b1 | (rlc_pP->vt_s >> 8);
     pdu_p->b2 = rlc_pP->vt_s & 0xFF;
     rlc_pP->vt_s = (rlc_pP->vt_s+1) & RLC_AM_SN_MASK;
@@ -511,24 +525,28 @@ void rlc_am_segment_10 (
     pdu_tb_req_p->tb_size         = data_pdu_size - pdu_remaining_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);
+    rlc_am_pdu_polling(ctxt_pP, rlc_pP, pdu_p, pdu_mngt_p->payload_size,true);
 
     //list_add_tail_eurecom (pdu_mem_p, &rlc_pP->segmentation_pdu_list);
     pdu_mngt_p->mem_block  = pdu_mem_p;
     pdu_mngt_p->first_byte = (unsigned char*)pdu_p;
     pdu_mngt_p->header_and_payload_size  = data_pdu_size - pdu_remaining_size;
-    pdu_mngt_p->retx_count = -1;
+    pdu_mngt_p->retx_count = 0;
+    pdu_mngt_p->retx_count_next = 0;
+    pdu_mngt_p->flags.retransmit = 0;
+    pdu_mngt_p->flags.transmitted = 1;
+    pdu_mngt_p->sn = RLC_AM_PREV_SN(rlc_pP->vt_s);
 
-    rlc_pP->retrans_num_pdus  += 1;
-    rlc_pP->retrans_num_bytes += pdu_mngt_p->header_and_payload_size;
 
+    //TBC: What for resetting local pointers at the end ??
     pdu_p = NULL;
     pdu_mem_p = NULL;
 
     //nb_bytes_to_transmit = nb_bytes_to_transmit - data_pdu_size;
     nb_bytes_to_transmit = 0; // 1 PDU only
 
-    mem_block_t* copy = rlc_am_retransmit_get_copy (ctxt_pP, rlc_pP, (rlc_pP->vt_s-1) & RLC_AM_SN_MASK);
+    /* We need to copy the PDU to pass to MAC in order to keep it in the buffer for potential retransmissions */
+    mem_block_t* copy = rlc_am_retransmit_get_copy (ctxt_pP, rlc_pP, RLC_AM_PREV_SN(rlc_pP->vt_s));
     list_add_tail_eurecom (copy, &rlc_pP->segmentation_pdu_list);
 
   }
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.h
index 6b67758b80bd81a89f7467c50b45e01fbad63122..b52b3e5aaa5d87e78b413e911504df7aa337f030 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.h
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segment.h
@@ -51,14 +51,14 @@
 #            endif
 #        endif
 
-/*! \fn void rlc_am_pdu_polling (const protocol_ctxt_t* const  ctxt_pP, rlc_am_entity_t *const rlcP, rlc_am_pdu_sn_10_t *pduP, int16_t payload_sizeP)
+/*! \fn void rlc_am_pdu_polling (const protocol_ctxt_t* const  ctxt_pP, rlc_am_entity_t *const rlcP, rlc_am_pdu_sn_10_t *pduP, int16_t payload_sizeP,boolean_t is_new_pdu)
 * \brief      Set or not the poll bit in the PDU header depending on RLC AM protocol variables.
 * \param[in]  ctxt_pP          Running context.
 * \param[in]  rlcP           RLC AM protocol instance pointer.
 * \param[in]  pduP           Pointer on the header of the PDU in order to be able to set the poll bit if necessary.
 * \param[in]  payload_sizeP  Size of the payload of the PDU.
 */
-protected_rlc_am_segment(void rlc_am_pdu_polling (const protocol_ctxt_t* const  ctxt_pP, rlc_am_entity_t *const rlcP, rlc_am_pdu_sn_10_t *pduP, int16_t payload_sizeP);)
+protected_rlc_am_segment(void rlc_am_pdu_polling (const protocol_ctxt_t* const  ctxt_pP, rlc_am_entity_t *const rlcP, rlc_am_pdu_sn_10_t *pduP, int16_t payload_sizeP,boolean_t is_new_pdu);)
 
 /*! \fn void rlc_am_segment_10 (const protocol_ctxt_t* const  ctxt_pP, rlc_am_entity_t * const rlcP)
 * \brief      Segment a PDU with 10 bits sequence number, based on segmentation information given by MAC (size to transmit).
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segments_holes.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segments_holes.c
index 37e9b13508e9fd133e068aa6e89ec01e3d4717a6..46a656e65a5961058625c4b973659ab729f21595 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segments_holes.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segments_holes.c
@@ -19,6 +19,7 @@
  *      contact@openairinterface.org
  */
 
+#if 0
 #define RLC_AM_MODULE 1
 #define RLC_AM_SEGMENT_HOLES_C 1
 //-----------------------------------------------------------------------------
@@ -32,7 +33,7 @@ void rlc_am_clear_holes (
   rlc_am_entity_t *const rlc_pP,
   const rlc_sn_t snP)
 {
-  rlc_pP->pdu_retrans_buffer[snP].num_holes         = 0;
+  rlc_pP->tx_data_pdu_buffer[snP].num_holes         = 0;
 }
 //-----------------------------------------------------------------------------
 void rlc_am_shift_down_holes (
@@ -43,12 +44,12 @@ void rlc_am_shift_down_holes (
 {
   int i;
 
-  for (i=indexP; i < rlc_pP->pdu_retrans_buffer[snP].num_holes - 1; i++) {
-    rlc_pP->pdu_retrans_buffer[snP].hole_so_start[i]   = rlc_pP->pdu_retrans_buffer[snP].hole_so_start[i+1];
-    rlc_pP->pdu_retrans_buffer[snP].hole_so_stop[i]    = rlc_pP->pdu_retrans_buffer[snP].hole_so_stop[i+1];
+  for (i=indexP; i < rlc_pP->tx_data_pdu_buffer[snP].num_holes - 1; i++) {
+    rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[i]   = rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[i+1];
+    rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[i]    = rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[i+1];
   }
 
-  rlc_pP->pdu_retrans_buffer[snP].num_holes =  rlc_pP->pdu_retrans_buffer[snP].num_holes - 1;
+  rlc_pP->tx_data_pdu_buffer[snP].num_holes =  rlc_pP->tx_data_pdu_buffer[snP].num_holes - 1;
 }
 //-----------------------------------------------------------------------------
 void rlc_am_shift_up_holes (
@@ -60,13 +61,13 @@ void rlc_am_shift_up_holes (
   // shift include indexP
   int i;
 
-  for (i=rlc_pP->pdu_retrans_buffer[snP].num_holes; i > indexP; i--) {
-    rlc_pP->pdu_retrans_buffer[snP].hole_so_start[i]   = rlc_pP->pdu_retrans_buffer[snP].hole_so_start[i-1];
-    rlc_pP->pdu_retrans_buffer[snP].hole_so_stop[i]    = rlc_pP->pdu_retrans_buffer[snP].hole_so_stop[i-1];
+  for (i=rlc_pP->tx_data_pdu_buffer[snP].num_holes; i > indexP; i--) {
+    rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[i]   = rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[i-1];
+    rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[i]    = rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[i-1];
   }
 
-  rlc_pP->pdu_retrans_buffer[snP].num_holes =  rlc_pP->pdu_retrans_buffer[snP].num_holes + 1;
-  assert(rlc_pP->pdu_retrans_buffer[snP].num_holes < RLC_AM_MAX_HOLES_REPORT_PER_PDU);
+  rlc_pP->tx_data_pdu_buffer[snP].num_holes =  rlc_pP->tx_data_pdu_buffer[snP].num_holes + 1;
+  assert(rlc_pP->tx_data_pdu_buffer[snP].num_holes < RLC_AM_MAX_HOLES_REPORT_PER_PDU);
 }
 //-----------------------------------------------------------------------------
 void rlc_am_remove_hole (
@@ -79,81 +80,81 @@ void rlc_am_remove_hole (
   int i;
 #if TRACE_RLC_AM_HOLE
   LOG_D(RLC,
-        PROTOCOL_RLC_AM_CTXT_FMT"[HOLE] REMOVE HOLE SN %04d  so_startP %05d so_stopP %05d rlc_pP->pdu_retrans_buffer[snP].nack_so_start %05d rlc_pP->pdu_retrans_buffer[snP].nack_so_stop %05d\n",
+        PROTOCOL_RLC_AM_CTXT_FMT"[HOLE] REMOVE HOLE SN %04d  so_startP %05d so_stopP %05d rlc_pP->tx_data_pdu_buffer[snP].nack_so_start %05d rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop %05d\n",
         PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
         snP,
         so_startP,
         so_stopP,
-        rlc_pP->pdu_retrans_buffer[snP].nack_so_start,
-        rlc_pP->pdu_retrans_buffer[snP].nack_so_stop);
+        rlc_pP->tx_data_pdu_buffer[snP].nack_so_start,
+        rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop);
 #endif
   assert(so_startP <= so_stopP);
 
-  if (rlc_pP->pdu_retrans_buffer[snP].num_holes == 0) {
-    assert(so_startP == rlc_pP->pdu_retrans_buffer[snP].nack_so_start);
-    assert(so_stopP  <= rlc_pP->pdu_retrans_buffer[snP].nack_so_stop);
+  if (rlc_pP->tx_data_pdu_buffer[snP].num_holes == 0) {
+    assert(so_startP == rlc_pP->tx_data_pdu_buffer[snP].nack_so_start);
+    assert(so_stopP  <= rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop);
 #if TRACE_RLC_AM_HOLE
     LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[HOLE] REMOVE HOLE SN %04d  MODIFIED nack_so_start %05d->%05d\n",
           PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
           snP,
-          rlc_pP->pdu_retrans_buffer[snP].nack_so_start,
+          rlc_pP->tx_data_pdu_buffer[snP].nack_so_start,
           so_stopP+1);
 #endif
-    rlc_pP->pdu_retrans_buffer[snP].nack_so_start = so_stopP+1;
+    rlc_pP->tx_data_pdu_buffer[snP].nack_so_start = so_stopP+1;
 
-    if (rlc_pP->pdu_retrans_buffer[snP].nack_so_start >= rlc_pP->pdu_retrans_buffer[snP].nack_so_stop) {
-      rlc_pP->pdu_retrans_buffer[snP].nack_so_start = 0;
-      rlc_pP->pdu_retrans_buffer[snP].nack_so_stop  = 0x7FFF;
+    if (rlc_pP->tx_data_pdu_buffer[snP].nack_so_start >= rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop) {
+      rlc_pP->tx_data_pdu_buffer[snP].nack_so_start = 0;
+      rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop  = 0x7FFF;
     }
   } else {
     // normally should be removed in increasing order...
-    for (i = 0; i < rlc_pP->pdu_retrans_buffer[snP].num_holes; i++) {
-      if (so_startP <= rlc_pP->pdu_retrans_buffer[snP].hole_so_start[i]) {
-        if (so_stopP >= rlc_pP->pdu_retrans_buffer[snP].hole_so_stop[i]) {
+    for (i = 0; i < rlc_pP->tx_data_pdu_buffer[snP].num_holes; i++) {
+      if (so_startP <= rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[i]) {
+        if (so_stopP >= rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[i]) {
           rlc_am_shift_down_holes(ctxt_pP, rlc_pP, snP, i);
           i = i - 1;
         } else {
-          rlc_pP->pdu_retrans_buffer[snP].hole_so_start[i] = so_stopP;
+          rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[i] = so_stopP;
 
-          if (rlc_pP->pdu_retrans_buffer[snP].num_holes == 0) {
-            rlc_pP->pdu_retrans_buffer[snP].nack_so_start = 0;
-            rlc_pP->pdu_retrans_buffer[snP].nack_so_stop  = 0x7FFF;
+          if (rlc_pP->tx_data_pdu_buffer[snP].num_holes == 0) {
+            rlc_pP->tx_data_pdu_buffer[snP].nack_so_start = 0;
+            rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop  = 0x7FFF;
           } else {
-            rlc_pP->pdu_retrans_buffer[snP].nack_so_start = rlc_pP->pdu_retrans_buffer[snP].hole_so_start[0];
-            rlc_pP->pdu_retrans_buffer[snP].nack_so_stop  = rlc_pP->pdu_retrans_buffer[snP].hole_so_stop[rlc_pP->pdu_retrans_buffer[snP].num_holes - 1];
+            rlc_pP->tx_data_pdu_buffer[snP].nack_so_start = rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[0];
+            rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop  = rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[rlc_pP->tx_data_pdu_buffer[snP].num_holes - 1];
           }
 
 #if TRACE_RLC_AM_HOLE
           LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[HOLE] REMOVE HOLE SN %04d  NOW nack_so_start %05d nack_so_stop %05d num holes %d\n",
                 PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
                 snP,
-                rlc_pP->pdu_retrans_buffer[snP].nack_so_start,
-                rlc_pP->pdu_retrans_buffer[snP].nack_so_stop,
-                rlc_pP->pdu_retrans_buffer[snP].num_holes);
+                rlc_pP->tx_data_pdu_buffer[snP].nack_so_start,
+                rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop,
+                rlc_pP->tx_data_pdu_buffer[snP].num_holes);
 #endif
           return;
         }
-      } else if (so_startP > rlc_pP->pdu_retrans_buffer[snP].hole_so_start[i]) {
-        if (so_startP <= rlc_pP->pdu_retrans_buffer[snP].hole_so_stop[i]) {
-          if (so_stopP < rlc_pP->pdu_retrans_buffer[snP].hole_so_stop[i]) {
+      } else if (so_startP > rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[i]) {
+        if (so_startP <= rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[i]) {
+          if (so_stopP < rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[i]) {
             // BAD CASE: 1 HOLE IS SPLITTED IN 2 HOLES
             rlc_am_shift_up_holes(ctxt_pP, rlc_pP, snP, i+1);
-            rlc_pP->pdu_retrans_buffer[snP].hole_so_start[i+1] = so_startP+1;
-            rlc_pP->pdu_retrans_buffer[snP].hole_so_stop[i+1] = rlc_pP->pdu_retrans_buffer[snP].hole_so_stop[i];
-            rlc_pP->pdu_retrans_buffer[snP].hole_so_stop[i] = so_startP - 1;
+            rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[i+1] = so_startP+1;
+            rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[i+1] = rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[i];
+            rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[i] = so_startP - 1;
           } else {
-            rlc_pP->pdu_retrans_buffer[snP].hole_so_stop[i] = so_startP;
+            rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[i] = so_startP;
           }
         }
       }
     }
 
-    if (rlc_pP->pdu_retrans_buffer[snP].num_holes == 0) {
-      rlc_pP->pdu_retrans_buffer[snP].nack_so_start = 0;
-      rlc_pP->pdu_retrans_buffer[snP].nack_so_stop  = 0x7FFF;
+    if (rlc_pP->tx_data_pdu_buffer[snP].num_holes == 0) {
+      rlc_pP->tx_data_pdu_buffer[snP].nack_so_start = 0;
+      rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop  = 0x7FFF;
     } else {
-      rlc_pP->pdu_retrans_buffer[snP].nack_so_start = rlc_pP->pdu_retrans_buffer[snP].hole_so_start[0];
-      rlc_pP->pdu_retrans_buffer[snP].nack_so_stop  = rlc_pP->pdu_retrans_buffer[snP].hole_so_stop[rlc_pP->pdu_retrans_buffer[snP].num_holes - 1];
+      rlc_pP->tx_data_pdu_buffer[snP].nack_so_start = rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[0];
+      rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop  = rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[rlc_pP->tx_data_pdu_buffer[snP].num_holes - 1];
     }
   }
 
@@ -161,11 +162,11 @@ void rlc_am_remove_hole (
   LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[HOLE] REMOVE HOLE SN %04d  NOW nack_so_start %05d nack_so_stop %05d num holes %d\n",
         PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
         snP,
-        rlc_pP->pdu_retrans_buffer[snP].nack_so_start,
-        rlc_pP->pdu_retrans_buffer[snP].nack_so_stop,
-        rlc_pP->pdu_retrans_buffer[snP].num_holes);
+        rlc_pP->tx_data_pdu_buffer[snP].nack_so_start,
+        rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop,
+        rlc_pP->tx_data_pdu_buffer[snP].num_holes);
 #endif
-  assert(rlc_pP->pdu_retrans_buffer[snP].nack_so_start < rlc_pP->pdu_retrans_buffer[snP].payload_size);
+  assert(rlc_pP->tx_data_pdu_buffer[snP].nack_so_start < rlc_pP->tx_data_pdu_buffer[snP].payload_size);
 }
 //-----------------------------------------------------------------------------
 void rlc_am_get_next_hole (
@@ -175,9 +176,9 @@ void rlc_am_get_next_hole (
   sdu_size_t* const             so_startP,
   sdu_size_t* const             so_stopP)
 {
-  if (rlc_pP->pdu_retrans_buffer[snP].num_holes == 0) {
-    *so_startP = rlc_pP->pdu_retrans_buffer[snP].nack_so_start;
-    *so_stopP  = rlc_pP->pdu_retrans_buffer[snP].nack_so_stop;
+  if (rlc_pP->tx_data_pdu_buffer[snP].num_holes == 0) {
+    *so_startP = rlc_pP->tx_data_pdu_buffer[snP].nack_so_start;
+    *so_stopP  = rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop;
 #if TRACE_RLC_AM_HOLE
     LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[HOLE] rlc_am_get_next_hole(SN %04d) %05d->%05d (NUM HOLES == 0)\n",
           PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
@@ -186,15 +187,15 @@ void rlc_am_get_next_hole (
           *so_stopP);
 #endif
   } else {
-    *so_startP = rlc_pP->pdu_retrans_buffer[snP].hole_so_start[0];
-    *so_stopP  = rlc_pP->pdu_retrans_buffer[snP].hole_so_stop[0];
+    *so_startP = rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[0];
+    *so_stopP  = rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[0];
 #if TRACE_RLC_AM_HOLE
     LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[HOLE] rlc_am_get_next_hole(SN %04d) %05d->%05d (NUM HOLES == %d)\n",
           PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
           snP,
           *so_startP,
           *so_stopP,
-          rlc_pP->pdu_retrans_buffer[snP].num_holes);
+          rlc_pP->tx_data_pdu_buffer[snP].num_holes);
 #endif
   }
 }
@@ -214,33 +215,33 @@ void rlc_am_add_hole (
 
 
   // if global NACK
-  if ((so_startP == 0) && ((so_stopP == 0x7FFF) || (so_stopP == rlc_pP->pdu_retrans_buffer[snP].payload_size - 1))) {
-    rlc_pP->pdu_retrans_buffer[snP].num_holes         = 0;
-    rlc_pP->pdu_retrans_buffer[snP].nack_so_start = so_startP;
-    rlc_pP->pdu_retrans_buffer[snP].nack_so_stop  = so_stopP;
+  if ((so_startP == 0) && ((so_stopP == 0x7FFF) || (so_stopP == rlc_pP->tx_data_pdu_buffer[snP].payload_size - 1))) {
+    rlc_pP->tx_data_pdu_buffer[snP].num_holes         = 0;
+    rlc_pP->tx_data_pdu_buffer[snP].nack_so_start = so_startP;
+    rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop  = so_stopP;
 #if TRACE_RLC_AM_HOLE
     LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[HOLE] SN %04d GLOBAL NACK 0->%05d\n",
           PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
           snP,
           so_stopP);
 #endif
-    assert(rlc_pP->pdu_retrans_buffer[snP].nack_so_start < rlc_pP->pdu_retrans_buffer[snP].payload_size);
+    assert(rlc_pP->tx_data_pdu_buffer[snP].nack_so_start < rlc_pP->tx_data_pdu_buffer[snP].payload_size);
     return;
   }
 
   if (so_stopP == 0x7FFF) {
-    so_stopP = rlc_pP->pdu_retrans_buffer[snP].payload_size - 1;
+    so_stopP = rlc_pP->tx_data_pdu_buffer[snP].payload_size - 1;
   }
 
   // first hole
-  if (rlc_pP->pdu_retrans_buffer[snP].num_holes == 0) {
-    rlc_pP->pdu_retrans_buffer[snP].hole_so_start[0] = so_startP;
-    rlc_pP->pdu_retrans_buffer[snP].hole_so_stop [0] = so_stopP;
+  if (rlc_pP->tx_data_pdu_buffer[snP].num_holes == 0) {
+    rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[0] = so_startP;
+    rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop [0] = so_stopP;
 
-    rlc_pP->pdu_retrans_buffer[snP].num_holes         = 1;
+    rlc_pP->tx_data_pdu_buffer[snP].num_holes         = 1;
 
-    rlc_pP->pdu_retrans_buffer[snP].nack_so_start = so_startP;
-    rlc_pP->pdu_retrans_buffer[snP].nack_so_stop  = so_stopP;
+    rlc_pP->tx_data_pdu_buffer[snP].nack_so_start = so_startP;
+    rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop  = so_stopP;
 #if TRACE_RLC_AM_HOLE
     LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[HOLE] FIRST HOLE SN %04d GLOBAL NACK %05d->%05d\n",
           PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
@@ -248,44 +249,44 @@ void rlc_am_add_hole (
           so_startP,
           so_stopP);
 #endif
-    assert(rlc_pP->pdu_retrans_buffer[snP].nack_so_start < rlc_pP->pdu_retrans_buffer[snP].payload_size);
+    assert(rlc_pP->tx_data_pdu_buffer[snP].nack_so_start < rlc_pP->tx_data_pdu_buffer[snP].payload_size);
     return;
   }
 
   hole_index = 0;
 
-  while (hole_index < rlc_pP->pdu_retrans_buffer[snP].num_holes) {
-    if (so_stopP < rlc_pP->pdu_retrans_buffer[snP].hole_so_start[hole_index]) {
-      assert(rlc_pP->pdu_retrans_buffer[snP].num_holes < RLC_AM_MAX_HOLES_REPORT_PER_PDU);
+  while (hole_index < rlc_pP->tx_data_pdu_buffer[snP].num_holes) {
+    if (so_stopP < rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[hole_index]) {
+      assert(rlc_pP->tx_data_pdu_buffer[snP].num_holes < RLC_AM_MAX_HOLES_REPORT_PER_PDU);
 
       if (hole_index > 0) {
-        assert(so_startP > rlc_pP->pdu_retrans_buffer[snP].hole_so_stop[hole_index-1]);
+        assert(so_startP > rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[hole_index-1]);
       }
 
-      for (i=rlc_pP->pdu_retrans_buffer[snP].num_holes; i >= hole_index; i--) {
-        rlc_pP->pdu_retrans_buffer[snP].hole_so_start[i]   = rlc_pP->pdu_retrans_buffer[snP].hole_so_start[i-1];
-        rlc_pP->pdu_retrans_buffer[snP].hole_so_stop[i]    = rlc_pP->pdu_retrans_buffer[snP].hole_so_stop[i-1];
+      for (i=rlc_pP->tx_data_pdu_buffer[snP].num_holes; i >= hole_index; i--) {
+        rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[i]   = rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[i-1];
+        rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[i]    = rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[i-1];
       }
 
-      rlc_pP->pdu_retrans_buffer[snP].hole_so_start[hole_index]   = so_startP;
-      rlc_pP->pdu_retrans_buffer[snP].hole_so_stop[hole_index]    = so_stopP;
+      rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[hole_index]   = so_startP;
+      rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[hole_index]    = so_stopP;
 
       // update nack "window" vars nack_so_start, nack_so_stop
       if (hole_index == 0) {
-        rlc_pP->pdu_retrans_buffer[snP].nack_so_start = so_startP;
+        rlc_pP->tx_data_pdu_buffer[snP].nack_so_start = so_startP;
       }
 
-      rlc_pP->pdu_retrans_buffer[snP].num_holes += 1;
+      rlc_pP->tx_data_pdu_buffer[snP].num_holes += 1;
 #if TRACE_RLC_AM_HOLE
       LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[HOLE] INSERT %d th HOLE SN %04d GLOBAL NACK %05d->%05d\n",
             PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
-            rlc_pP->pdu_retrans_buffer[snP].num_holes,
+            rlc_pP->tx_data_pdu_buffer[snP].num_holes,
             snP,
             so_startP,
             so_stopP);
 #endif
-      assert(rlc_pP->pdu_retrans_buffer[snP].nack_so_start < rlc_pP->pdu_retrans_buffer[snP].payload_size);
-      assert(rlc_pP->pdu_retrans_buffer[snP].num_holes < RLC_AM_MAX_HOLES_REPORT_PER_PDU);
+      assert(rlc_pP->tx_data_pdu_buffer[snP].nack_so_start < rlc_pP->tx_data_pdu_buffer[snP].payload_size);
+      assert(rlc_pP->tx_data_pdu_buffer[snP].num_holes < RLC_AM_MAX_HOLES_REPORT_PER_PDU);
       return;
     }
 
@@ -293,17 +294,17 @@ void rlc_am_add_hole (
   }
 
   // if here insert to the "tail"
-  if (so_startP > rlc_pP->pdu_retrans_buffer[snP].hole_so_stop[hole_index - 1]) {
-    assert(rlc_pP->pdu_retrans_buffer[snP].num_holes < RLC_AM_MAX_HOLES_REPORT_PER_PDU);
-    rlc_pP->pdu_retrans_buffer[snP].hole_so_start[hole_index]   = so_startP;
-    rlc_pP->pdu_retrans_buffer[snP].hole_so_stop[hole_index]    = so_stopP;
-    rlc_pP->pdu_retrans_buffer[snP].num_holes += 1;
+  if (so_startP > rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[hole_index - 1]) {
+    assert(rlc_pP->tx_data_pdu_buffer[snP].num_holes < RLC_AM_MAX_HOLES_REPORT_PER_PDU);
+    rlc_pP->tx_data_pdu_buffer[snP].hole_so_start[hole_index]   = so_startP;
+    rlc_pP->tx_data_pdu_buffer[snP].hole_so_stop[hole_index]    = so_stopP;
+    rlc_pP->tx_data_pdu_buffer[snP].num_holes += 1;
     // update nack "window" vars nack_so_start, nack_so_stop
-    rlc_pP->pdu_retrans_buffer[snP].nack_so_stop = so_stopP;
+    rlc_pP->tx_data_pdu_buffer[snP].nack_so_stop = so_stopP;
 #if TRACE_RLC_AM_HOLE
     LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[HOLE] INSERT THE %d th LAST HOLE SN %04d GLOBAL NACK %05d->%05d\n",
           PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
-          rlc_pP->pdu_retrans_buffer[snP].num_holes,
+          rlc_pP->tx_data_pdu_buffer[snP].num_holes,
           snP,
           so_startP,
           so_stopP);
@@ -312,6 +313,7 @@ void rlc_am_add_hole (
     assert(1==2);
   }
 
-  assert(rlc_pP->pdu_retrans_buffer[snP].num_holes < RLC_AM_MAX_HOLES_REPORT_PER_PDU);
-  assert(rlc_pP->pdu_retrans_buffer[snP].nack_so_start < rlc_pP->pdu_retrans_buffer[snP].payload_size);
+  assert(rlc_pP->tx_data_pdu_buffer[snP].num_holes < RLC_AM_MAX_HOLES_REPORT_PER_PDU);
+  assert(rlc_pP->tx_data_pdu_buffer[snP].nack_so_start < rlc_pP->tx_data_pdu_buffer[snP].payload_size);
 }
+#endif
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segments_holes.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segments_holes.h
index 902bc5930612c8789df8c6493e06af0306ce7613..68200c0f996fedfab863267f84714534ac078154 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segments_holes.h
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_segments_holes.h
@@ -32,7 +32,7 @@
 * @ingroup _rlc_am_internal_segment_impl_
 * @{
 */
-
+#if 0
 #ifndef __RLC_AM_SEGMENT_HOLES_H__
 #    define __RLC_AM_SEGMENT_HOLES_H__
 //-----------------------------------------------------------------------------
@@ -108,3 +108,4 @@ protected_rlc_am_segments_holes(void rlc_am_add_hole (
                                   sdu_size_t so_stopP);)
 /** @} */
 #endif
+#endif
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.c
index d687bf8606f31ad4ec3b3c8bad31886e49286f53..c07e9cd6f3fbd65f51ec07a584784bb6b799ad3d 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_status_report.c
@@ -268,6 +268,14 @@ rlc_am_receive_process_control_pdu(
 {
   rlc_am_pdu_sn_10_t *rlc_am_pdu_sn_10_p = (rlc_am_pdu_sn_10_t*)*first_byte_ppP;
   sdu_size_t          initial_pdu_size   = *tb_size_in_bytes_pP;
+  rlc_sn_t        ack_sn    = RLC_AM_NEXT_SN(rlc_pP->vt_a);
+  rlc_sn_t        sn_cursor = rlc_pP->vt_a;
+  rlc_sn_t		vt_a_new  = rlc_pP->vt_a;
+  rlc_sn_t		sn_data_cnf;
+  rlc_sn_t        nack_sn,prev_nack_sn;
+  sdu_size_t		data_cnf_so_stop = 0x7FFF;
+  unsigned int nack_index;
+  boolean_t status = TRUE;
 
   if (rlc_am_get_control_pdu_infos(rlc_am_pdu_sn_10_p, tb_size_in_bytes_pP, &rlc_pP->control_pdu_info) >= 0) {
 
@@ -280,11 +288,7 @@ rlc_am_receive_process_control_pdu(
           rlc_pP->control_pdu_info.ack_sn);
     rlc_am_display_control_pdu_infos(&rlc_pP->control_pdu_info);
 
-    rlc_sn_t        ack_sn    = rlc_pP->control_pdu_info.ack_sn;
-    rlc_sn_t        sn_cursor = rlc_pP->vt_a;
-    rlc_sn_t        nack_sn;
-    unsigned int nack_index;
-
+    ack_sn    = rlc_pP->control_pdu_info.ack_sn;
     // 5.2.1 Retransmission
     //
     // The transmitting side of an AM RLC entity can receive a negative acknowledgement (notification of reception failure
@@ -308,64 +312,127 @@ rlc_am_receive_process_control_pdu(
     assert(ack_sn < RLC_AM_SN_MODULO);
     assert(rlc_pP->control_pdu_info.num_nack < RLC_AM_MAX_NACK_IN_STATUS_PDU);
 
-    if (rlc_am_in_tx_window(ctxt_pP, rlc_pP, ack_sn) > 0) {
-      rlc_pP->num_nack_so = 0;
-      rlc_pP->num_nack_sn = 0;
-
+    /* Note : ackSn can be equal to current vtA only in case the status pdu contains a list of nack_sn with same value = vtA with SOStart/SOEnd */
+    /* and meaning the report is not complete due to not enough ressources to fill all SOStart/SOEnd of this NACK_SN */
+    if (RLC_AM_DIFF_SN(rlc_pP->vt_s,rlc_pP->vt_a) >= RLC_AM_DIFF_SN(ack_sn,rlc_pP->vt_a))
+    {
       if (rlc_pP->control_pdu_info.num_nack == 0) {
         while (sn_cursor != ack_sn) {
-          if (sn_cursor == rlc_pP->poll_sn) {
-            rlc_am_stop_and_reset_timer_poll_retransmit(ctxt_pP, rlc_pP);
-          }
-
           rlc_am_ack_pdu(ctxt_pP, rlc_pP, sn_cursor);
-          sn_cursor = (sn_cursor + 1)  & RLC_AM_SN_MASK;
+          sn_cursor = RLC_AM_NEXT_SN(sn_cursor);
         }
+
+        vt_a_new = ack_sn;
+        sn_data_cnf = RLC_AM_PREV_SN(vt_a_new);
       } else {
         nack_index = 0;
         nack_sn   = rlc_pP->control_pdu_info.nack_list[nack_index].nack_sn;
+        prev_nack_sn = 0x3FFF;
 
-        while (sn_cursor != ack_sn) {
-          if (sn_cursor == rlc_pP->poll_sn) {
-            rlc_am_stop_and_reset_timer_poll_retransmit(ctxt_pP, rlc_pP);
-          }
+        while (sn_cursor != nack_sn) {
+            rlc_am_ack_pdu(ctxt_pP, rlc_pP, sn_cursor);
+            sn_cursor = RLC_AM_NEXT_SN(sn_cursor);
+        }
+
+        vt_a_new = nack_sn;
+
+        // catch DataCfn
+        rlc_am_tx_data_pdu_management_t *tx_data_pdu_buffer_p = &rlc_pP->tx_data_pdu_buffer[nack_sn % RLC_AM_WINDOW_SIZE];
+        if (tx_data_pdu_buffer_p->retx_payload_size == tx_data_pdu_buffer_p->payload_size) {
+        	sn_data_cnf   = RLC_AM_PREV_SN(nack_sn);
+        }
+        else if (tx_data_pdu_buffer_p->nack_so_start != 0) {
+        	sn_data_cnf       = nack_sn;
+        	data_cnf_so_stop    = tx_data_pdu_buffer_p->nack_so_start - 1;
+        }
+        else {
+        	sn_data_cnf       = RLC_AM_PREV_SN(nack_sn);
+        }
 
+
+        while ((sn_cursor != ack_sn) && (status)) {
           if (sn_cursor != nack_sn) {
             rlc_am_ack_pdu(ctxt_pP,
                            rlc_pP,
                            sn_cursor);
           } else {
-            rlc_am_nack_pdu (ctxt_pP,
+        	status = rlc_am_nack_pdu (ctxt_pP,
                              rlc_pP,
-                             sn_cursor,
+							 nack_sn,
+							 prev_nack_sn,
                              rlc_pP->control_pdu_info.nack_list[nack_index].so_start,
                              rlc_pP->control_pdu_info.nack_list[nack_index].so_end);
 
             nack_index = nack_index + 1;
+            prev_nack_sn = nack_sn;
 
-            if (nack_index == rlc_pP->control_pdu_info.num_nack) {
-              nack_sn = 0xFFFF; // value never reached by sn
-            } else {
-              nack_sn = rlc_pP->control_pdu_info.nack_list[nack_index].nack_sn;
+            if (nack_index < rlc_pP->control_pdu_info.num_nack) {
+               nack_sn = rlc_pP->control_pdu_info.nack_list[nack_index].nack_sn;
+            }
+            else if (nack_sn != ack_sn) {
+            	/* general case*/
+            	nack_sn = ack_sn;
+            }
+            else {
+            	/*specific case when the sender did not have enough TBS to fill all SOStart SOEnd for this NACK_SN */
+            	break;
             }
           }
-
-          if ((nack_index <  rlc_pP->control_pdu_info.num_nack) && (nack_index > 0)) {
-            if (rlc_pP->control_pdu_info.nack_list[nack_index].nack_sn != rlc_pP->control_pdu_info.nack_list[nack_index-1].nack_sn) {
+          if (prev_nack_sn != nack_sn) {
+        	  /* do not increment sn_cursor in case of several informations for the same nack_sn */
               sn_cursor = (sn_cursor + 1)  & RLC_AM_SN_MASK;
-            }
-          } else {
-            sn_cursor = (sn_cursor + 1)  & RLC_AM_SN_MASK;
           }
         }
       }
+
+
     } else {
-      LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT" WARNING CONTROL PDU ACK SN OUT OF WINDOW\n",
-            PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
+      LOG_N(RLC, PROTOCOL_RLC_AM_CTXT_FMT" WARNING CONTROL PDU ACK SN %d OUT OF WINDOW vtA=%d vtS=%d\n",
+            PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),ack_sn,rlc_pP->vt_a,rlc_pP->vt_s);
+      status = FALSE;
     }
   } else {
     LOG_W(RLC, PROTOCOL_RLC_AM_CTXT_FMT" ERROR IN DECODING CONTROL PDU\n",
           PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
+    status = FALSE;
+  }
+
+  if (status) {
+      /* Check for Stopping TpollReTx */
+      if ((rlc_pP->poll_sn != RLC_SN_UNDEFINED) &&
+          (RLC_AM_DIFF_SN(ack_sn,rlc_pP->vt_a) > RLC_AM_DIFF_SN(rlc_pP->poll_sn,rlc_pP->vt_a))) {
+        rlc_am_stop_and_reset_timer_poll_retransmit(ctxt_pP, rlc_pP);
+        rlc_pP->poll_sn = RLC_SN_UNDEFINED;
+      }
+
+      //TODO : this part does not cover all cases of Data Cnf and move it at the end of Status PDU processing
+      sn_cursor = rlc_pP->vt_a;
+
+      // Fix Issue 238 : check sn_data_cnf has been transmitted
+      if ((rlc_pP->tx_data_pdu_buffer[sn_data_cnf % RLC_AM_WINDOW_SIZE].flags.transmitted) &&
+    		  (rlc_pP->tx_data_pdu_buffer[sn_data_cnf % RLC_AM_WINDOW_SIZE].sn == sn_data_cnf)) {
+    	  /* Handle all acked PDU up to and excluding sn_data_cnf */
+          while (sn_cursor != sn_data_cnf) {
+        	  rlc_am_pdu_sdu_data_cnf(ctxt_pP,rlc_pP,sn_cursor);
+        	  sn_cursor = RLC_AM_NEXT_SN(sn_cursor);
+          }
+
+          // Handle last SN. TO DO : case of PDU partially ACKED with SDU to be data conf
+          if (data_cnf_so_stop == 0x7FFF) {
+        	  rlc_am_pdu_sdu_data_cnf(ctxt_pP,rlc_pP,sn_data_cnf);
+          }
+
+          LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" RECEIVE STATUS PDU ACK_SN=%d NewvtA=%d OldvtA=%d SnDataCnf=%d DataCnfSOStop=%d vtS=%d\n",
+                      PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),ack_sn,vt_a_new,rlc_pP->vt_a,sn_data_cnf,data_cnf_so_stop,rlc_pP->vt_s);
+      }
+      else {
+          LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" RECEIVE STATUS PDU WITH NO SDU CNF ACK_SN=%d NewvtA=%d OldvtA=%d vtS=%d\n",
+                      PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),ack_sn,vt_a_new,rlc_pP->vt_a,rlc_pP->vt_s);
+      }
+
+      /* Update vtA and vtMS */
+      rlc_pP->vt_a = vt_a_new;
+      rlc_pP->vt_ms = (rlc_pP->vt_a + RLC_AM_WINDOW_SIZE) & RLC_AM_SN_MASK;
   }
 
   *first_byte_ppP = (uint8_t*)((uint64_t)*first_byte_ppP + initial_pdu_size - *tb_size_in_bytes_pP);
@@ -449,6 +516,357 @@ rlc_am_send_status_pdu(
   //     - set the ACK_SN to the SN of the next not received RLC Data PDU which is not indicated as missing in the
   //       resulting STATUS PDU.
 
+  signed int                    nb_bits_to_transmit   = rlc_pP->nb_bytes_requested_by_mac << 3;
+  // minimum header size in bits to be transmitted: D/C + CPT + ACK_SN + E1
+  signed int                    nb_bits_transmitted	  = RLC_AM_PDU_D_C_BITS + RLC_AM_STATUS_PDU_CPT_LENGTH + RLC_AM_SN_BITS + RLC_AM_PDU_E_BITS;
+  rlc_am_control_pdu_info_t     control_pdu_info;
+  rlc_am_pdu_info_t            *pdu_info_cursor_p     = NULL;
+  rlc_sn_t                      sn_cursor             = 0;
+  rlc_sn_t                      sn_nack               = rlc_pP->vr_r;
+  mem_block_t                  *cursor_p              = rlc_pP->receiver_buffer.head;
+  int                           all_segments_received = 0;
+  int                           waited_so             = 0;
+  mem_block_t                  *tb_p                  = NULL;
+  sdu_size_t                    pdu_size              = 0;
+  boolean_t						status_report_completed	= false;
+  boolean_t						segment_loop_end	  = false;
+
+  memset(&control_pdu_info, 0, sizeof(rlc_am_control_pdu_info_t));
+
+#if TRACE_RLC_AM_STATUS_CREATION
+  LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] nb_bits_to_transmit %d (15 already allocated for header)\n",
+        PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
+        nb_bits_to_transmit);
+  rlc_am_rx_list_display(rlc_pP, " DISPLAY BEFORE CONSTRUCTION OF STATUS REPORT");
+#endif
+
+  /* Handle no NACK first */
+  if (rlc_pP->vr_r == rlc_pP->vr_ms) {
+
+	  control_pdu_info.ack_sn = rlc_pP->vr_ms;
+	  status_report_completed = true;
+#if TRACE_RLC_AM_STATUS_CREATION
+          LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] LINE %d ALL ACK WITH ACK_SN %04d\n",
+                PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
+                __LINE__,
+				rlc_pP->vr_ms);
+#endif
+  }
+  else if ((cursor_p != NULL) && ((nb_bits_transmitted + RLC_AM_SN_BITS + (RLC_AM_PDU_E_BITS << 1)) <= nb_bits_to_transmit)) {
+
+    pdu_info_cursor_p       = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
+    sn_cursor             = pdu_info_cursor_p->sn;
+
+    /* Set E1 bit for the presence of first NACK_SN/E1/E2 */
+    control_pdu_info.e1 = 1;
+
+    // 12 bits = size of NACK_SN field + E1, E2 bits
+    // 42 bits = size of NACK_SN field + SO_START, SO_END fields, E1, E2 bits
+    while ((!status_report_completed) && (RLC_AM_DIFF_SN(sn_nack,rlc_pP->vr_r) < RLC_AM_DIFF_SN(rlc_pP->vr_ms,rlc_pP->vr_r))
+    		&& (cursor_p != NULL) && (nb_bits_transmitted <= nb_bits_to_transmit)) {
+
+      pdu_info_cursor_p       = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
+      sn_cursor             = pdu_info_cursor_p->sn;
+      all_segments_received = ((rlc_am_rx_pdu_management_t*)(cursor_p->data))->all_segments_received;
+
+      /* First fill NACK_SN with each missing PDU between current sn_nack and sn_cursor */
+      while ((sn_nack != sn_cursor) && (RLC_AM_DIFF_SN(sn_nack,rlc_pP->vr_r) < RLC_AM_DIFF_SN(rlc_pP->vr_ms,rlc_pP->vr_r))) {
+    	  if (nb_bits_transmitted + RLC_AM_SN_BITS + (RLC_AM_PDU_E_BITS << 1) <= nb_bits_to_transmit) {
+    		  /* Fill NACK_SN infos */
+              control_pdu_info.nack_list[control_pdu_info.num_nack].nack_sn   = sn_nack;
+              control_pdu_info.nack_list[control_pdu_info.num_nack].so_start  = 0;
+              control_pdu_info.nack_list[control_pdu_info.num_nack].so_end    = RLC_AM_STATUS_PDU_SO_END_ALL_BYTES;
+              control_pdu_info.nack_list[control_pdu_info.num_nack].e2        = 0;
+              /* Set E1 for next NACK_SN. The last one will be cleared */
+              control_pdu_info.nack_list[control_pdu_info.num_nack].e1  = 1;
+              control_pdu_info.num_nack += 1;
+              nb_bits_transmitted += (RLC_AM_SN_BITS + (RLC_AM_PDU_E_BITS << 1));
+#if TRACE_RLC_AM_STATUS_CREATION
+          LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] LINE %d PREPARE SENDING NACK %04d\n",
+                PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
+                __LINE__,
+				sn_nack);
+#endif
+    		  sn_nack = RLC_AM_NEXT_SN(sn_nack);
+    	  }
+    	  else {
+    		  /* Not enough UL TBS*/
+    		  /* latest value of sn_nack shall be used as ACK_SN */
+    		  control_pdu_info.ack_sn = sn_nack;
+    		  status_report_completed = true;
+#if TRACE_RLC_AM_STATUS_CREATION
+          LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] LINE %d NOT ENOUGH TBS STOP WITH ACK_SN %04d\n",
+                PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
+                __LINE__,
+				sn_nack);
+#endif
+    		  break;
+    	  }
+      }
+
+      if (sn_nack == rlc_pP->vr_ms) {
+    	  break;
+      }
+
+      /* Now process all Segments of sn_cursor if PDU not fully received */
+      if ((!status_report_completed) && (all_segments_received == 0) && (sn_cursor != rlc_pP->vr_ms)) {
+    	  AssertFatal (sn_nack == sn_cursor, "RLC AM Tx Status PDU Data sn_nack=%d and sn_cursor=%d should be equal LcId=%d\n",sn_nack,sn_cursor, rlc_pP->channel_id);
+
+    	  /* First ensure there is enough TBS for at least 1 SOStart/SOEnd, else break */
+    	  if ((nb_bits_transmitted + RLC_AM_SN_BITS + (RLC_AM_PDU_E_BITS << 1) + (RLC_AM_STATUS_PDU_SO_LENGTH << 1)) <= nb_bits_to_transmit) {
+    		  /* Init loop flags */
+              /* Check lsf */
+    		  segment_loop_end = (pdu_info_cursor_p->lsf == 1);
+
+    		  /* Init first SO Start according to first segment */
+    		  if (pdu_info_cursor_p->so) {
+    			  /* Fill the first SO */
+                  control_pdu_info.nack_list[control_pdu_info.num_nack].nack_sn   = sn_cursor;
+                  control_pdu_info.nack_list[control_pdu_info.num_nack].so_start  = 0;
+                  control_pdu_info.nack_list[control_pdu_info.num_nack].so_end    = pdu_info_cursor_p->so - 1;
+                  control_pdu_info.nack_list[control_pdu_info.num_nack].e2        = 1;
+                  /* Set E1 for next NACK_SN. The last one will be cleared */
+                  control_pdu_info.nack_list[control_pdu_info.num_nack].e1  = 1;
+                  control_pdu_info.num_nack += 1;
+                  nb_bits_transmitted += (RLC_AM_SN_BITS + (RLC_AM_PDU_E_BITS << 1) + (RLC_AM_STATUS_PDU_SO_LENGTH << 1));
+#if TRACE_RLC_AM_STATUS_CREATION
+            LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] LINE %d PREPARE SENDING NACK %04d SO START %05d SO END %05d\n",
+                  PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
+                  __LINE__,
+				  sn_cursor,
+                  0,
+				  pdu_info_cursor_p->so - 1);
+#endif
+                  waited_so = pdu_info_cursor_p->so + pdu_info_cursor_p->payload_size;
+    		  }
+    		  else {
+        		  waited_so = pdu_info_cursor_p->payload_size;
+    		  }
+
+              /* Go to next segment */
+              cursor_p = cursor_p->next;
+              if (cursor_p != NULL)
+              {
+                  pdu_info_cursor_p     = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
+              }
+
+    		  /* Find the first discontinuity and then fill SOStart/SOEnd */
+    		  while (!segment_loop_end) {
+    			  if ((cursor_p != NULL) && (pdu_info_cursor_p->sn == sn_cursor)) {
+
+					  /* PDU segment is for the same SN*/
+					  /* Check lsf */
+					  segment_loop_end = (pdu_info_cursor_p->lsf == 1);
+
+					  if (waited_so < pdu_info_cursor_p->so) {
+						  /* SO is greater than previous received portion : gap identified to fill */
+						  if ((nb_bits_transmitted + RLC_AM_SN_BITS + (RLC_AM_PDU_E_BITS << 1) + (RLC_AM_STATUS_PDU_SO_LENGTH << 1)) <= nb_bits_to_transmit) {
+							  control_pdu_info.nack_list[control_pdu_info.num_nack].nack_sn   = sn_cursor;
+							  control_pdu_info.nack_list[control_pdu_info.num_nack].so_start  = waited_so;
+							  control_pdu_info.nack_list[control_pdu_info.num_nack].so_end    = pdu_info_cursor_p->so - 1;
+							  control_pdu_info.nack_list[control_pdu_info.num_nack].e2        = 1;
+							  /* Set E1 for next NACK_SN. The last one will be cleared */
+							  control_pdu_info.nack_list[control_pdu_info.num_nack].e1  = 1;
+							  control_pdu_info.num_nack += 1;
+							  nb_bits_transmitted += (RLC_AM_SN_BITS + (RLC_AM_PDU_E_BITS << 1) + (RLC_AM_STATUS_PDU_SO_LENGTH << 1));
+#if TRACE_RLC_AM_STATUS_CREATION
+		LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] LINE %d PREPARE SENDING NACK %04d SO START %05d SO END %05d\n",
+			  PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
+			  __LINE__,
+			  sn_cursor,
+			  waited_so,
+			  pdu_info_cursor_p->so);
+#endif
+						  }
+						  else {
+							  /* Not enough resources to set a SOStart/SEnd, then set ACK_SN to current NACK_SN and stop Status PDU build */
+							  control_pdu_info.ack_sn = sn_cursor;
+							  status_report_completed = true;
+							  segment_loop_end = true;
+							  break;
+						  }
+					  }
+					  else {
+						  /* contiguous segment: only update waited_so */
+						  /* Assuming so and payload_size updated according to duplication removal done at reception ... */
+						  waited_so += pdu_info_cursor_p->payload_size;
+					  }
+
+					  /* Go to next received PDU or PDU Segment */
+					  cursor_p = cursor_p->next;
+	                  if (cursor_p != NULL)
+	                  {
+		                  pdu_info_cursor_p     = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
+	                  }
+
+    			  } //end if (cursor_p != NULL) && (pdu_info_cursor_p->sn == sn_cursor)
+    			  else {
+    				  /* Previous PDU segment was the last one and did not have lsf indication : fill the latest gap */
+    		    	  if ((nb_bits_transmitted + RLC_AM_SN_BITS + (RLC_AM_PDU_E_BITS << 1) + (RLC_AM_STATUS_PDU_SO_LENGTH << 1)) <= nb_bits_to_transmit) {
+    	                      control_pdu_info.nack_list[control_pdu_info.num_nack].nack_sn   = sn_cursor;
+    	                      control_pdu_info.nack_list[control_pdu_info.num_nack].so_start  = waited_so;
+    	                      control_pdu_info.nack_list[control_pdu_info.num_nack].so_end    = RLC_AM_STATUS_PDU_SO_END_ALL_BYTES;
+    	                      control_pdu_info.nack_list[control_pdu_info.num_nack].e2        = 1;
+    	                      /* Set E1 for next NACK_SN. The last one will be cleared */
+    	                      control_pdu_info.nack_list[control_pdu_info.num_nack].e1  = 1;
+    	                      control_pdu_info.num_nack += 1;
+    	                      nb_bits_transmitted += (RLC_AM_SN_BITS + (RLC_AM_PDU_E_BITS << 1) + (RLC_AM_STATUS_PDU_SO_LENGTH << 1));
+#if TRACE_RLC_AM_STATUS_CREATION
+            LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] LINE %d PREPARE SENDING LAST NACK %04d SO START %05d SO END %05d\n",
+                  PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
+                  __LINE__,
+				  sn_cursor,
+				  waited_so,
+				  RLC_AM_STATUS_PDU_SO_END_ALL_BYTES);
+#endif
+     		    	  }
+    		    	  else {
+    		    		  /* Not enough resources to set a SOStart/SEnd, then set ACK_SN to current NACK_SN and stop Status PDU build */
+    		    		  control_pdu_info.ack_sn = sn_cursor;
+    		    		  status_report_completed = true;
+    		    	  }
+
+    		    	  segment_loop_end = true;
+    			  }
+    		  } //end  while (!segment_loop_end)
+    	  } // end if enough resource for transmitting at least one SOStart/SOEnd
+    	  else {
+    		  /* Not enough UL TBS to set at least one SOStart/SOEnd */
+    		  /* latest value of sn_nack shall be used as ACK_SN */
+    		  control_pdu_info.ack_sn = sn_nack;
+    		  status_report_completed = true;
+    	  }
+      } // end while on all PDU segments of sn_cursor
+      else {
+    	  /* Go to next received PDU or PDU segment with different SN */
+    	  do {
+    		  	  cursor_p = cursor_p->next;
+    	  	  } while ((cursor_p != NULL) && (((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info.sn == sn_cursor));
+      }
+
+      /* Increment sn_nack except if sn_cursor = vrMS and if current SN was not fully received */
+      if (RLC_AM_DIFF_SN(sn_cursor,rlc_pP->vr_r) < RLC_AM_DIFF_SN(rlc_pP->vr_ms,rlc_pP->vr_r)) {
+    	  sn_nack = RLC_AM_NEXT_SN(sn_cursor);
+      }
+      else {
+    	  sn_nack = rlc_pP->vr_ms;
+      }
+
+
+    } // End main while NACK_SN
+
+    /* Clear E1 of last nack_sn entry */
+	AssertFatal ((control_pdu_info.num_nack) || (all_segments_received == 0), "RLC AM Tx Status PDU Data Error no NACK_SN vrR=%d vrMS=%d lastSN_NACK=%d Completed=%d NbBytesAvailable=%d LcId=%d\n",
+	        rlc_pP->vr_r,rlc_pP->vr_ms,sn_nack,status_report_completed,(nb_bits_to_transmit >> 3),rlc_pP->channel_id);
+	if (control_pdu_info.num_nack) {
+	    control_pdu_info.nack_list[control_pdu_info.num_nack - 1].e1  = 0;
+	}
+
+
+    /* Set ACK_SN unless it was set before */
+    if (!status_report_completed){
+
+    	control_pdu_info.ack_sn = sn_nack;
+    }
+
+  } else {
+	/* reception buffer empty or not enough TBS for filling at least 1 NACK_SN + E1 + E2 */
+    control_pdu_info.ack_sn = rlc_pP->vr_r;
+#if TRACE_RLC_AM_STATUS_CREATION
+    LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] LINE %d PREPARE SENDING ACK %04d  = VR(R)\n",
+          PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
+          __LINE__,
+          control_pdu_info.ack_sn);
+#endif
+  }
+
+
+  //msg ("[FRAME %5u][%s][RLC_AM][MOD %u/%u][RB %u] nb_bits_to_transmit %d\n",
+  //     rlc_pP->module_id, rlc_pP->rb_id, ctxt_pP->frame,nb_bits_to_transmit);
+
+#if TRACE_RLC_AM_STATUS_CREATION
+  LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] LINE %d PREPARE SENDING ACK %04d NUM NACK %d\n",
+        PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
+        __LINE__,
+        control_pdu_info.ack_sn,
+        control_pdu_info.num_nack);
+#endif
+
+
+  /* encode the control pdu */
+  pdu_size = (nb_bits_transmitted + 7) >> 3;
+  AssertFatal (pdu_size <= rlc_pP->nb_bytes_requested_by_mac, "RLC AM Tx Status PDU Data size=%d bigger than remaining TBS=%d nb_bits_transmitted=%d LcId=%d\n",
+		  pdu_size,rlc_pP->nb_bytes_requested_by_mac,nb_bits_transmitted, rlc_pP->channel_id);
+
+
+#if TRACE_RLC_AM_STATUS_CREATION
+  LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] LINE %d forecast pdu_size %d\n",
+        PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
+        __LINE__,
+        pdu_size);
+#endif
+  tb_p = get_free_mem_block(sizeof(struct mac_tb_req) + pdu_size, __func__);
+  memset(tb_p->data, 0, sizeof(struct mac_tb_req) + pdu_size);
+  //estimation only ((struct mac_tb_req*)(tb_p->data))->tb_size  = pdu_size;
+  ((struct mac_tb_req*)(tb_p->data))->data_ptr         = (uint8_t*)&(tb_p->data[sizeof(struct mac_tb_req)]);
+
+  // warning reuse of pdu_size
+  // TODO : rlc_am_write_status_pdu should be rewritten as not very tested ...
+  pdu_size = rlc_am_write_status_pdu(ctxt_pP, rlc_pP,(rlc_am_pdu_sn_10_t*)(((struct mac_tb_req*)(tb_p->data))->data_ptr), &control_pdu_info);
+  ((struct mac_tb_req*)(tb_p->data))->tb_size  = pdu_size;
+  //assert((((struct mac_tb_req*)(tb_p->data))->tb_size) < 3000);
+
+#if TRACE_RLC_AM_STATUS_CREATION
+  LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[SEND-STATUS] SEND STATUS PDU SIZE %d, rlc_pP->nb_bytes_requested_by_mac %d, nb_bits_to_transmit>>3 %d\n",
+        PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
+        pdu_size,
+        rlc_pP->nb_bytes_requested_by_mac,
+        nb_bits_to_transmit >> 3);
+#endif
+
+  AssertFatal (pdu_size == ((nb_bits_transmitted + 7) >> 3), "RLC AM Tx Status PDU Data encoding size=%d different than expected=%d LcId=%d\n",
+  		  pdu_size,((nb_bits_transmitted + 7) >> 3), rlc_pP->channel_id);
+
+  // remaining bytes to transmit for RLC (retrans pdus and new data pdus)
+  rlc_pP->nb_bytes_requested_by_mac = rlc_pP->nb_bytes_requested_by_mac - pdu_size;
+  // put pdu in trans
+  list_add_head(tb_p, &rlc_pP->control_pdu_list);
+  rlc_pP->stat_tx_control_pdu   += 1;
+  rlc_pP->stat_tx_control_bytes += pdu_size;
+
+}
+
+
+#if 0
+//-----------------------------------------------------------------------------
+void
+rlc_am_send_status_pdu_backup(
+  const protocol_ctxt_t* const  ctxt_pP,
+  rlc_am_entity_t *const rlc_pP
+)
+{
+  // When STATUS reporting has been triggered, the receiving side of an AM RLC entity shall:
+  // - if t-StatusProhibit is not running:
+  //     - at the first transmission opportunity indicated by lower layer, construct a STATUS PDU and deliver it to lower layer;
+  // - else:
+  //     - at the first transmission opportunity indicated by lower layer after t-StatusProhibit expires, construct a single
+  //       STATUS PDU even if status reporting was triggered several times while t-StatusProhibit was running and
+  //       deliver it to lower layer;
+  //
+  // When a STATUS PDU has been delivered to lower layer, the receiving side of an AM RLC entity shall:
+  //     - start t-StatusProhibit.
+  //
+  // When constructing a STATUS PDU, the AM RLC entity shall:
+  //     - for the AMD PDUs with SN such that VR(R) <= SN < VR(MR) that has not been completely received yet, in
+  //       increasing SN of PDUs and increasing byte segment order within PDUs, starting with SN = VR(R) up to
+  //       the point where the resulting STATUS PDU still fits to the total size of RLC PDU(s) indicated by lower layer:
+  //         - for an AMD PDU for which no byte segments have been received yet::
+  //             - include in the STATUS PDU a NACK_SN which is set to the SN of the AMD PDU;
+  //         - for a continuous sequence of byte segments of a partly received AMD PDU that have not been received yet:
+  //             - include in the STATUS PDU a set of NACK_SN, SOstart and SOend
+  //     - set the ACK_SN to the SN of the next not received RLC Data PDU which is not indicated as missing in the
+  //       resulting STATUS PDU.
+
   signed int                    nb_bits_to_transmit   = rlc_pP->nb_bytes_requested_by_mac << 3;
   rlc_am_control_pdu_info_t     control_pdu_info;
   rlc_am_pdu_info_t            *pdu_info_cursor_p     = NULL;
@@ -470,11 +888,12 @@ rlc_am_send_status_pdu(
   rlc_am_rx_list_display(rlc_pP, " DISPLAY BEFORE CONSTRUCTION OF STATUS REPORT");
 #endif
 
+
   if (cursor_p != NULL) {
     pdu_info_cursor_p       = &((rlc_am_rx_pdu_management_t*)(cursor_p->data))->pdu_info;
     sn_cursor             = pdu_info_cursor_p->sn;
 
-    while (rlc_am_in_rx_window(ctxt_pP, rlc_pP, sn_cursor) == 0) {
+    while (!(RLC_AM_SN_IN_WINDOW(sn_cursor, rlc_pP->vr_r))) {
       cursor_p                = cursor_p->next;
       previous_sn_cursor    = sn_cursor;
 
@@ -757,3 +1176,5 @@ end_push_nack:
   rlc_pP->stat_tx_control_bytes += pdu_size;
 
 }
+#endif
+
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_structs.h b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_structs.h
index 02112fe736783ba6c997d3f1292c799698ff65b6..2b75cb21a7a8eaf63a9d42a9239e654bb366cb37 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_structs.h
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_structs.h
@@ -88,9 +88,12 @@ typedef struct rlc_am_tx_sdu_management {
 * \brief Structure containing PDU variables related to its retransmission.
 */
 typedef struct pdu_management_flags {
+  uint8_t transmitted:1;            /*!< \brief Boolean telling that this PDU is not empty and has been at least transmitted once. */
   uint8_t ack:1;            /*!< \brief Boolean telling that this PDU has been acknowledged. */
+  uint8_t nack:1;            /*!< \brief Boolean telling that this PDU has been acknowledged negatively. */
   uint8_t retransmit:1;       /*!< \brief Boolean telling a retransmission is scheduled for this PDU. */
-  uint8_t dummy:6;            /*!< \brief Free bits. */
+  uint8_t max_retransmit:1;       /*!< \brief Boolean telling max retransmission has been hit for this PDU. */
+  uint8_t dummy:3;            /*!< \brief Free bits. */
 } pdu_management_flags_t;
 
 
@@ -107,15 +110,17 @@ typedef struct rlc_am_tx_data_pdu_management {
   sdu_size_t       hole_so_start  [RLC_AM_MAX_HOLES_REPORT_PER_PDU]; /*!< \brief Array containing the start segment offsets for marking a hole (negative acknowledged area) in the PDU. */
   sdu_size_t       hole_so_stop   [RLC_AM_MAX_HOLES_REPORT_PER_PDU]; /*!< \brief Array containing the stop segment offsets for marking a hole (negative acknowledged area) in the PDU. */
   uint8_t          num_holes;                         /*!< \brief Number of registereg holes in hole_so_start[], hole_so_stop[]. */
+  uint8_t          retx_hole_index;                   /*!< \brief Next index of registered holes to retransmit. */
   sdu_size_t       header_and_payload_size;           /*!< \brief Size of the PDU in bytes, including header and payload. */
   sdu_size_t       payload_size;                      /*!< \brief Size of the PDU payload in bytes. */
+  sdu_size_t	   retx_payload_size;				  /*!< \brief Size of the PDU payload to be retransmitted in bytes including all Segment portions. */
   rlc_sn_t         sn;                                /*!< \brief Sequence number of the PDU. */
   sdu_size_t       nack_so_start; /*!< \brief Lowest NACK start segment offset, must be set to 0 if global NACK. */
-  sdu_size_t       nack_so_stop;  /*!< \brief Highest NACK stop segment offset, must be set to data_size if global NACK */
+  sdu_size_t       nack_so_stop;  /*!< \brief Highest NACK stop segment offset, must be set to data_size - 1 if global NACK */
 
   int8_t           nb_sdus;       /*!< \brief Number of sdu having segments in this pdu. */
-  int8_t
-  retx_count;    /*!< \brief Counts the number of retransmissions of an AMD PDU (see subclause 5.2.1). There is one RETX_COUNT counter per PDU that needs to be retransmitted. there is one VT(DAT) for each PDU and it is incremented each time the PDU is transmitted. */
+  int8_t           retx_count;    /*!< \brief Counts the number of already occurred retransmissions of an AMD PDU (see subclause 5.2.1). */
+  int8_t           retx_count_next;    /*!< \brief Counts the number of already occurred retransmissions plus the latest pending one. */
 
   pdu_management_flags_t  flags; /*!< \brief PDU variables related to its retransmission. */
 } rlc_am_tx_data_pdu_management_t;
@@ -228,14 +233,48 @@ typedef struct rlc_am_timer {
 * @{
 */
 
+typedef enum rlc_am_rx_segment_reassemble_info
+{
+    /** No Reassembly scheduled */
+    RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_NO           = 0,
+    /** Reassembly scheduled */
+	RLC_AM_RX_PDU_SEGMENT_REASSEMBLE_PENDING      = 1,
+    /** Reassembly done */
+	RLC_AM_RX_PDU_SEGMENT_REASSEMBLED             = 2
+
+} rlc_am_rx_segment_reassemble_info_t;
+
 /*! \struct  rlc_am_rx_pdu_management_t
 * \brief Structure for storing decoded informations from the header of a AMD PDU or AMD PDU segment and information on reassembly.
 */
 typedef struct rlc_am_rx_pdu_management {
   rlc_am_pdu_info_t pdu_info; /*!< \brief Field for storing decoded informations from the header of a AMD PDU or AMD PDU segment. */
   uint8_t              all_segments_received; /*!< \brief Is all segments of PDU SN have been received. */
+  rlc_am_rx_segment_reassemble_info_t			   segment_reassembled; /*!< \brief if the segment for SN=vrR is reassembled but not discarded yet. */
 } rlc_am_rx_pdu_management_t;
 /** @} */
+
+typedef enum rlc_am_rx_pdu_status
+{
+    /** PDU okay. */
+    RLC_AM_DATA_PDU_STATUS_OK                     = 0,
+    /** SN outside RX window */
+	RLC_AM_DATA_PDU_STATUS_SN_OUTSIDE_WINDOW      = 1,
+    /** SN already available */
+	RLC_AM_DATA_PDU_STATUS_SN_DUPLICATE           = 2,
+    /** SN already available */
+	RLC_AM_DATA_PDU_STATUS_AM_SEGMENT_DUPLICATE   = 3,
+    /** Buffer full */
+	RLC_AM_DATA_PDU_STATUS_BUFFER_FULL            = 4,
+    /** Header Error (LI,SO...) */
+	RLC_AM_DATA_PDU_STATUS_HEADER_ERROR           = 5,
+    /** Unknown bearer */
+	RLC_AM_DATA_PDU_STATUS_INVALID_BEARER         = 6,
+    /** RLC in wrong state */
+	RLC_AM_DATA_PDU_STATUS_WRONG_STATE            = 7
+
+} rlc_am_rx_pdu_status_t;
+
 /*! \cond PRIVATE */
 //-----------------------------------------------------------------------------
 //  interlayers optimizations
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_test.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_test.c
index 8e201a949b84796288ee65a9b5797d4528495131..86cafb89ce441ab8cad42825bc661a8ac131cc11 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_test.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_test.c
@@ -228,7 +228,7 @@ void rlc_am_v9_3_0_test_read_write_bit_field()
   uint8_t*        byte_pos_read      = g_buffer;
   uint16_t        read_value;
 
-  memset (g_buffer, 0, 1024);
+  memset (g_buffer, 0, sizeof(g_buffer));
   // byte 0
   rlc_am_write8_bit_field(&byte_pos_write, &bit_pos_write, 1, 1);
   rlc_am_write8_bit_field(&byte_pos_write, &bit_pos_write, 1, 0);
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c
index aa3fdb909a90313e6c76e94f38f3601eda79a5f7..2dfa472523f5a536f7515ccaaa8d1fbbc218168b 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_poll_retransmit.c
@@ -77,10 +77,41 @@ rlc_am_check_timer_poll_retransmit(
       LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T_POLL_RETRANSMIT] TIME-OUT\n",
             PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
 
+      /* Check for any retransmittable PDU if Buffer Occupancy empty or window stall */
+	  if (((rlc_pP->sdu_buffer_occupancy == 0) && (rlc_pP->retrans_num_bytes_to_retransmit == 0)) ||
+			    (rlc_pP->vt_s == rlc_pP->vt_ms)) {
+		  // force BO to be > 0
+		  rlc_sn_t             sn           = RLC_AM_PREV_SN(rlc_pP->vt_s);
+		  rlc_sn_t             sn_end       = RLC_AM_PREV_SN(rlc_pP->vt_a);
+		  rlc_am_tx_data_pdu_management_t *tx_data_pdu_buffer_p;
+
+          /* Look for the first retransmittable PDU starting from vtS - 1 */
+		  while (sn != sn_end) {
+			tx_data_pdu_buffer_p = &rlc_pP->tx_data_pdu_buffer[sn % RLC_AM_WINDOW_SIZE];
+			AssertFatal (tx_data_pdu_buffer_p->mem_block != NULL, "RLC AM Tpoll Retx expiry sn=%d is empty vtA=%d vtS=%d LcId=%d\n",
+					sn, rlc_pP->vt_a,rlc_pP->vt_s,rlc_pP->channel_id);
+		    if ((tx_data_pdu_buffer_p->flags.ack == 0) && (tx_data_pdu_buffer_p->flags.max_retransmit == 0)) {
+		    	tx_data_pdu_buffer_p->flags.retransmit = 1;
+		    	tx_data_pdu_buffer_p->retx_payload_size = tx_data_pdu_buffer_p->payload_size;
+		    	if (tx_data_pdu_buffer_p->retx_count == tx_data_pdu_buffer_p->retx_count_next) {
+		    		tx_data_pdu_buffer_p->retx_count_next ++;
+		    	}
+		    	rlc_pP->retrans_num_pdus += 1;
+		    	rlc_pP->retrans_num_bytes_to_retransmit += tx_data_pdu_buffer_p->payload_size;
+		        LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T_POLL_RETRANSMIT] TIME-OUT PUT SN=%d in ReTx Buffer\n",
+		              PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),tx_data_pdu_buffer_p->sn);
+		    	break;
+		    }
+		    else
+		    {
+		    	sn = RLC_AM_PREV_SN(sn);
+		    }
+		  }
+	  }
+
 
       rlc_pP->force_poll= TRUE;
-      //#warning         TO DO rlc_am_check_timer_poll_retransmit
-      rlc_pP->t_poll_retransmit.ms_time_out = PROTOCOL_CTXT_TIME_MILLI_SECONDS(ctxt_pP) + rlc_pP->t_poll_retransmit.ms_duration;
+      //BugFix : new ms_time_out is computed when next poll is transmitter
     }
   }
 }
@@ -119,9 +150,9 @@ rlc_am_start_timer_poll_retransmit(
   rlc_am_entity_t * const      rlc_pP
 )
 {
-  rlc_pP->t_poll_retransmit.timed_out       = 0;
+  /* Stop timer if it was previously running */
+  rlc_am_stop_and_reset_timer_poll_retransmit(ctxt_pP,rlc_pP);
 
-  if (rlc_pP->t_poll_retransmit.running == 0) {
     if (rlc_pP->t_poll_retransmit.ms_duration > 0) {
       rlc_pP->t_poll_retransmit.running         = 1;
       rlc_pP->t_poll_retransmit.ms_time_out     = PROTOCOL_CTXT_TIME_MILLI_SECONDS(ctxt_pP) + rlc_pP->t_poll_retransmit.ms_duration;
@@ -138,14 +169,7 @@ rlc_am_start_timer_poll_retransmit(
     LOG_T(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T_POLL_RETRANSMIT] NOT STARTED, CAUSE CONFIGURED 0 ms\n",
           PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
     }
-  } else {
-#if MESSAGE_CHART_GENERATOR_RLC_MAC
-      MSC_LOG_EVENT((ctxt_pP->enb_flag == ENB_FLAG_YES) ? MSC_RLC_ENB:MSC_RLC_UE,\
-                             "0 "PROTOCOL_RLC_AM_MSC_FMT" t_poll_retransmit not restarted (TO %u ms)",\
-                             PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP), rlc_pP->t_poll_retransmit.ms_time_out);
-#endif
 
-  }
 }
 //-----------------------------------------------------------------------------
 void
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.c
index 3bbc2e87ac1aa70de07d2f0892eb84ffb34116a3..cec0dffd1d726ea6027e809b630cff5504ae4c46 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_reordering.c
@@ -70,6 +70,8 @@ rlc_am_check_timer_reordering(
                              PROTOCOL_RLC_AM_MSC_ARGS(ctxt_pP,rlc_pP));
 #endif
 
+      AssertFatal (rlc_pP->vr_x != RLC_SN_UNDEFINED, "RLC AM TReordering Expiry vrX not defined LcId=%d\n", rlc_pP->channel_id);
+
       rlc_pP->t_reordering.running   = 0;
       rlc_pP->t_reordering.timed_out = 1;
       rlc_pP->stat_timer_reordering_timed_out += 1;
@@ -77,38 +79,56 @@ rlc_am_check_timer_reordering(
       rlc_am_pdu_info_t* pdu_info;
       mem_block_t*       cursor;
       cursor    =  rlc_pP->receiver_buffer.head;
+      rlc_usn_t vr_ms_new = rlc_pP->vr_x;
 
-      if (cursor) {
-        do {
-          pdu_info =  &((rlc_am_rx_pdu_management_t*)(cursor->data))->pdu_info;
+      AssertFatal (cursor != NULL, "RLC AM TReordering Expiry Rx PDU list empty LcId=%d\n", rlc_pP->channel_id);
 
-          // NOT VERY SURE ABOUT THAT, THINK ABOUT IT
-          rlc_pP->vr_ms = (pdu_info->sn + 1) & RLC_AM_SN_MASK;
+      /* go to memblock up to vrX*/
+      pdu_info =  &((rlc_am_rx_pdu_management_t*)(cursor->data))->pdu_info;
+      while ((cursor != NULL) && (RLC_AM_DIFF_SN(pdu_info->sn,rlc_pP->vr_r) < RLC_AM_DIFF_SN(vr_ms_new,rlc_pP->vr_r))) {
+    	  cursor = cursor->next;
+    	  if (cursor != NULL) {
+    		  pdu_info =  &((rlc_am_rx_pdu_management_t*)(cursor->data))->pdu_info;
+    	  }
+      }
 
-          if (rlc_am_sn_gte_vr_x(ctxt_pP, rlc_pP, pdu_info->sn)) {
-            if (((rlc_am_rx_pdu_management_t*)(cursor->data))->all_segments_received == 0) {
-              rlc_pP->vr_ms = pdu_info->sn;
-              break;
-            }
-          }
+      /* Now find a SN for which either no PDU is received or partially received */
+      while ((cursor != NULL) && (vr_ms_new != rlc_pP->vr_h) && (pdu_info->sn == vr_ms_new) && (((rlc_am_rx_pdu_management_t*)(cursor->data))->all_segments_received > 0)) {
+    	  /* Increment vrMS if the PDU is fully received or if this is the last PDU segment */
+    	  if ((pdu_info->rf == 0) || (pdu_info->lsf == 1)) {
+        	  vr_ms_new = RLC_AM_NEXT_SN(vr_ms_new);
+    	  }
+    	  cursor = cursor->next;
+    	  if (cursor != NULL) {
+    		  pdu_info =  &((rlc_am_rx_pdu_management_t*)(cursor->data))->pdu_info;
+    	  }
+      }
 
-          cursor = cursor->next;
-        } while (cursor != NULL);
+	  /* Update vr_ms */
+	  rlc_pP->vr_ms = vr_ms_new;
 
-        LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-REORDERING] TIME-OUT UPDATED VR(MS) %04d\n",
-              PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
-              rlc_pP->vr_ms);
-      }
 
-      if (rlc_am_sn_gt_vr_ms(ctxt_pP, rlc_pP, rlc_pP->vr_h)) {
+	LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-REORDERING] TIME-OUT UPDATED VR(MS) %04d\n",
+		  PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
+		  rlc_pP->vr_ms);
+
+	  /* if new vrMS is lower than vrH, update vrX and restart timerReordering */
+      if (rlc_pP->vr_ms != rlc_pP->vr_h) {
         rlc_pP->vr_x = rlc_pP->vr_h;
         rlc_pP->t_reordering.ms_time_out = PROTOCOL_CTXT_TIME_MILLI_SECONDS(ctxt_pP) + rlc_pP->t_reordering.ms_duration;
+
+
         LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-REORDERING] TIME-OUT, RESTARTED T-REORDERING, UPDATED VR(X) to VR(R) %04d\n",
               PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
               rlc_pP->vr_x);
       }
 
-      rlc_pP->status_requested = 1;
+      /* Trigger a STATUS report */
+      RLC_AM_SET_STATUS(rlc_pP->status_requested,RLC_AM_STATUS_TRIGGERED_T_REORDERING);
+      // Clear Delay flag if it was setup as it is useless due to Status PDU to be sent for TReordering expiry
+      RLC_AM_CLEAR_STATUS(rlc_pP->status_requested,RLC_AM_STATUS_TRIGGERED_DELAYED);
+      rlc_pP->sn_status_triggered_delayed = RLC_SN_UNDEFINED;
+
     }
   }
 }
diff --git a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.c b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.c
index b41fa1c17fd9bda1e1e5bf493d5f974f9fd6fe94..65ea0561205b6d09d28026edac333978e9a0b364 100644
--- a/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.c
+++ b/openair2/LAYER2/RLC/AM_v9.3.0/rlc_am_timer_status_prohibit.c
@@ -70,6 +70,8 @@ rlc_am_check_timer_status_prohibit(
               PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP));
         //#warning         TO DO rlc_am_check_timer_status_prohibit
         rlc_am_stop_and_reset_timer_status_prohibit(ctxt_pP, rlc_pP);
+        /* Clear StatusProhibit flag */
+        RLC_AM_CLEAR_STATUS(rlc_pP->status_requested,RLC_AM_STATUS_PROHIBIT);
         //rlc_pP->t_status_prohibit.frame_time_out = ctxt_pP->frame + rlc_pP->t_status_prohibit.time_out;
       }
     }
@@ -110,6 +112,7 @@ rlc_am_start_timer_status_prohibit(
       rlc_pP->t_status_prohibit.running        = 1;
       rlc_pP->t_status_prohibit.ms_time_out    = rlc_pP->t_status_prohibit.ms_duration + PROTOCOL_CTXT_TIME_MILLI_SECONDS(ctxt_pP);
       rlc_pP->t_status_prohibit.ms_start       = PROTOCOL_CTXT_TIME_MILLI_SECONDS(ctxt_pP);
+      RLC_AM_SET_STATUS(rlc_pP->status_requested,RLC_AM_STATUS_PROHIBIT);
       LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT"[T-STATUS-PROHIBIT] STARTED (TIME-OUT = %u ms)\n",
           PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
           rlc_pP->t_status_prohibit.ms_time_out);
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 51440d0bfa33bbd6688374173bb5e2d9ad630f28..e3322d9410b62829e2a4bede9937d70adb0b8b2b 100644
--- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c
+++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.c
@@ -434,7 +434,6 @@ rlc_um_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP
   int32_t diff_time=0;
   rlc_um_entity_t   *rlc_p = NULL;
   mem_block_t       *mb_p = NULL;
-  unsigned int       max_li_overhead = 0;
 
   status_resp.buffer_occupancy_in_pdus         = 0;
   status_resp.buffer_occupancy_in_bytes        = 0;
@@ -454,20 +453,11 @@ rlc_um_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP
 
     if ((status_resp.buffer_occupancy_in_bytes > 0) && ((mb_p = list_get_head(&rlc_p->input_sdus)) != NULL)) {
 
-        //Fix on full Header size
-        if (enb_flagP == ENB_FLAG_NO)
-        {
-            // compute Length Indicator overhead to inform MAC of maximum full RLC PDU size according to stored SDUs
-            // For UE scheduler
-            // Could be useful for eNB: to be checked
-            if (rlc_p->input_sdus.nb_elements <= 1) {
-                max_li_overhead = 0;
-            } else {
-                unsigned int       num_li = rlc_p->input_sdus.nb_elements - 1;
-                max_li_overhead = num_li + (num_li >> 1) + (num_li & 1);
-            }
-        }
-      status_resp.buffer_occupancy_in_bytes += (rlc_p->tx_header_min_length_in_bytes + max_li_overhead);
+      if (enb_flagP == ENB_FLAG_YES) {
+    	  /* For eNB: add minimum RLC UM header size for the scheduler */
+    	  /* For UE : RLC header part is not taken into account for BSR reporting (cf 36.321) */
+          status_resp.buffer_occupancy_in_bytes += rlc_p->tx_header_min_length_in_bytes;
+      }
       status_resp.buffer_occupancy_in_pdus = rlc_p->input_sdus.nb_elements;
 
       diff_time =   ctxt_pP->frame - ((struct rlc_um_tx_sdu_management *)mb_p->data)->sdu_creation_time;
@@ -520,9 +510,19 @@ rlc_um_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP
   return status_resp;
 }
 
+//-----------------------------------------------------------------------------
+void
+rlc_um_set_nb_bytes_requested_by_mac (
+  void *				rlc_pP,
+  const tb_size_t		tb_sizeP
+)
+{
+	((rlc_um_entity_t *) rlc_pP)->nb_bytes_requested_by_mac = tb_sizeP;
+}
+
 //-----------------------------------------------------------------------------
 struct mac_data_req
-rlc_um_mac_data_request (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP)
+rlc_um_mac_data_request (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP,const eNB_flag_t  enb_flagP)
 {
   struct mac_data_req data_req;
   int16_t               tb_size_in_bytes;
@@ -544,10 +544,13 @@ rlc_um_mac_data_request (const protocol_ctxt_t* const ctxt_pP, void *rlc_pP)
   list_add_list (&l_rlc_p->pdus_to_mac_layer, &data_req.data);
 
 
-  data_req.buffer_occupancy_in_bytes = rlc_um_get_buffer_occupancy (l_rlc_p);
+  if (enb_flagP) {
+	  // redundant in UE MAC Tx processing and not used in eNB scheduler ...
+	  data_req.buffer_occupancy_in_bytes = rlc_um_get_buffer_occupancy (l_rlc_p);
 
-  if (data_req.buffer_occupancy_in_bytes > 0) {
-    data_req.buffer_occupancy_in_bytes += l_rlc_p->tx_header_min_length_in_bytes;
+	  if (data_req.buffer_occupancy_in_bytes > 0) {
+	    data_req.buffer_occupancy_in_bytes += l_rlc_p->tx_header_min_length_in_bytes;
+	  }
   }
 
   data_req.rlc_info.rlc_protocol_state = l_rlc_p->protocol_state;
diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.h b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.h
index 5951eaf1490c58f9b62cc4fca0aabeb4875ce163..87cf2e2f3764b8d17c60b917070aa013c4ccba75 100644
--- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.h
+++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um.h
@@ -188,13 +188,21 @@ protected_rlc_um( void     rlc_um_rx (const protocol_ctxt_t* const ctxt_pP, rlc_
 */
 public_rlc_um(    struct mac_status_resp rlc_um_mac_status_indication (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, uint16_t tbs_sizeP, struct mac_status_ind tx_statusP, const eNB_flag_t enb_flagP);)
 
-/*! \fn struct mac_data_req rlc_um_mac_data_request (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP)
+/*! \fn void     rlc_um_set_nb_bytes_requested_by_mac (rlc_um_entity_t * const rlc_pP, const tb_size_t		tb_sizeP)
+* \brief    Set available TBS size for MAC Tx.
+* \param[in]  rlc_pP                    RLC UM protocol instance pointer.
+* \param[in]  tb_sizeP                 remaining TBS in bytes.
+*/
+public_rlc_um(   void     rlc_um_set_nb_bytes_requested_by_mac (rlc_um_entity_t * const rlc_pP, const tb_size_t		tb_sizeP);)
+
+/*! \fn struct mac_data_req rlc_um_mac_data_request (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP,const eNB_flag_t  enb_flagP)
 * \brief    Gives PDUs to lower layer MAC.
 * \param[in]  ctxt_pP                   Running context.
 * \param[in]  rlc_pP                    RLC UM protocol instance pointer.
+* \param[in]  enb_flagP                 eNB or UE flag.
 * \return     A PDU of the previously requested number of bytes, and the updated maximum number of bytes that can be served by RLC instance to MAC for next RLC transmission.
 */
-public_rlc_um(    struct mac_data_req rlc_um_mac_data_request (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP);)
+public_rlc_um(    struct mac_data_req rlc_um_mac_data_request (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP,const eNB_flag_t  enb_flagP);)
 
 
 /*! \fn void     rlc_um_mac_data_indication (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP,struct mac_data_ind data_indP)
@@ -205,6 +213,11 @@ public_rlc_um(    struct mac_data_req rlc_um_mac_data_request (const protocol_ct
 */
 public_rlc_um(   void     rlc_um_mac_data_indication (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, struct mac_data_ind data_indP);)
 
+/*! \fn uint32_t rlc_um_get_buffer_occupancy (rlc_um_entity_t *rlc_pP)
+* \brief    Gets Tx Buffer Occupancy.
+* \param[in]  rlc_pP                    RLC UM protocol instance pointer.)
+*/
+public_rlc_um(    uint32_t rlc_um_get_buffer_occupancy (rlc_um_entity_t *rlc_pP);)
 
 /*! \fn void     rlc_um_data_req (const protocol_ctxt_t* const ctxt_pP, rlc_um_entity_t * const rlc_pP, mem_block_t *sduP)
 * \brief    Interface with higher layers, buffer higher layer SDUS for transmission.
diff --git a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_constants.h b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_constants.h
index 2d0a875edb51ee6c585ce9906d3879abc47f9726..34d97de59d35b96cb7ebfb0403d23d5e8269a813 100644
--- a/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_constants.h
+++ b/openair2/LAYER2/RLC/UM_v9.3.0/rlc_um_constants.h
@@ -53,7 +53,7 @@
 // UM_Window_Size = 512 when a 10 bit SN is configured and UM_Window_Size = 0
 // when the receiving UM RLC entity is configured for MCCH or MTCH.
 // li field (values shifted 1 bit left)
-#        define RLC_UM_SEGMENT_NB_MAX_LI_PER_PDU            24
+#        define RLC_UM_SEGMENT_NB_MAX_LI_PER_PDU            128
 //----------------------------------------------------------
 // Events defined for state model of the acknowledged mode entity
 /** Internal event defined for state model of the RLC UM. */
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 4255464e3a220b4c2f5227bf47b63f5fcfd47b0b..c00e87c4e09fa3a29cb599f792c4e9bc82d719d4 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
@@ -183,7 +183,7 @@ int rlc_um_read_length_indicators(unsigned char**data_ppP, rlc_um_e_li_t* e_liP,
       // AssertFatal(*data_size_pP >= 0, "Invalid data_size!");
     }
 
-    if (*num_li_pP >= RLC_UM_SEGMENT_NB_MAX_LI_PER_PDU) {
+    if (*num_li_pP > RLC_UM_SEGMENT_NB_MAX_LI_PER_PDU) {
       return -1;
     }
   }
diff --git a/openair2/LAYER2/RLC/rlc.h b/openair2/LAYER2/RLC/rlc.h
index 465492bec9298dcbab10aa1c019c0e7ee9c02264..3d6be205249b0284c2f9062c838a38a88051964c 100644
--- a/openair2/LAYER2/RLC/rlc.h
+++ b/openair2/LAYER2/RLC/rlc.h
@@ -436,10 +436,11 @@ public_rlc_rrc(void rrc_rlc_register_rrc (rrc_data_ind_cb_t rrc_data_indP, rrc_d
 * \param [in]     eNB_flagP        Flag to indicate eNB (1) or UE (0)
 * \param [in]     MBMS_flagP       Flag to indicate whether this is the MBMS service (1) or not (0)
 * \param [in]     rb_idP           Radio bearer identifier.
+* \param [in]     tb_sizeP         Available Tx TBS in bytes. For UE only.
 * \param [in,out] bufferP          Memory area to fill with the bytes requested by MAC.
 * \return     A status about the processing, OK or error code.
 */
-public_rlc_mac(tbs_size_t            mac_rlc_data_req     (const module_id_t, const rnti_t, const eNB_index_t, const frame_t, const  eNB_flag_t, const  MBMS_flag_t, logical_chan_id_t, char*);)
+public_rlc_mac(tbs_size_t            mac_rlc_data_req     (const module_id_t, const rnti_t, const eNB_index_t, const frame_t, const  eNB_flag_t, const  MBMS_flag_t, logical_chan_id_t, const tb_size_t,char*);)
 
 /*! \fn void mac_rlc_data_ind     (const module_id_t mod_idP, const rnti_t rntiP, const frame_t frameP, const  eNB_flag_t eNB_flagP, const  MBMS_flag_t MBMS_flagP, logical_chan_id_t rb_idP, uint32_t frameP, char* bufferP, tb_size_t tb_sizeP, num_tb_t num_tbP, crc_t *crcs)
 * \brief    Interface with MAC layer, deserialize the transport blocks sent by MAC, then map data indication to the RLC instance corresponding to the radio bearer identifier.
@@ -457,18 +458,31 @@ public_rlc_mac(tbs_size_t            mac_rlc_data_req     (const module_id_t, co
 public_rlc_mac(void                  mac_rlc_data_ind     (const module_id_t, const rnti_t, const eNB_index_t,const frame_t, const  eNB_flag_t, const  MBMS_flag_t, logical_chan_id_t, char*, tb_size_t, num_tb_t,
                crc_t* );)
 
-/*! \fn mac_rlc_status_resp_t mac_rlc_status_ind     (const module_id_t mod_idP, const rnti_t rntiP, const frame_t frameP, const  eNB_flag_t eNB_flagP, const  MBMS_flag_t MBMS_flagP, logical_chan_id_t rb_idP, tb_size_t tb_sizeP)
+/*! \fn mac_rlc_status_resp_t mac_rlc_status_ind     (const module_id_t mod_idP, const rnti_t rntiP, const frame_t frameP, const sub_frame_t subframeP, const  eNB_flag_t eNB_flagP, const  MBMS_flag_t MBMS_flagP, logical_chan_id_t rb_idP, tb_size_t tb_sizeP)
 * \brief    Interface with MAC layer, request and set the number of bytes scheduled for transmission by the RLC instance corresponding to the radio bearer identifier.
 * \param[in]  mod_idP          Virtualized module identifier.
 * \param[in]  rntiP            UE identifier.
 * \param[in]  frameP            Frame index.
+* \param[in]  subframeP         SubFrame index.
 * \param[in]  eNB_flagP         Flag to indicate eNB operation (1 true, 0 false)
 * \param[in]  MBMS_flagP       Flag to indicate whether this is the MBMS service (1) or not (0)
 * \param[in]  rb_idP           Radio bearer identifier.
 * \param[in]  tb_sizeP         Size of a transport block set in bytes.
 * \return     The maximum number of bytes that the RLC instance can send in the next transmission sequence.
 */
-public_rlc_mac(mac_rlc_status_resp_t mac_rlc_status_ind   (const module_id_t, const rnti_t, const eNB_index_t, const frame_t, const  eNB_flag_t, const  MBMS_flag_t, logical_chan_id_t, tb_size_t );)
+public_rlc_mac(mac_rlc_status_resp_t mac_rlc_status_ind   (const module_id_t, const rnti_t, const eNB_index_t, const frame_t, const sub_frame_t, const  eNB_flag_t, const  MBMS_flag_t, logical_chan_id_t, tb_size_t );)
+
+/*! \fn rlc_buffer_occupancy_t mac_rlc_get_buffer_occupancy_ind(const module_id_t module_idP, const rnti_t rntiP, const eNB_index_t eNB_index, const frame_t frameP, const sub_frame_t subframeP,const eNB_flag_t enb_flagP, const logical_chan_id_t channel_idP)
+* \brief    Interface with MAC layer, UE only: request and get the number of bytes scheduled for transmission by the RLC instance corresponding to the radio bearer identifier.
+* \param[in]  mod_idP          Virtualized module identifier.
+* \param[in]  rntiP            UE identifier.
+* \param[in]  frameP            Frame index.
+* \param[in]  subframeP         SubFrame index.
+* \param[in]  eNB_flagP         Flag to indicate eNB operation (1 true, 0 false)
+* \param[in]  channel_idP       Logical Channel identifier.
+* \return     The maximum number of bytes that the RLC instance can send in the next transmission sequence.
+*/
+public_rlc_mac(rlc_buffer_occupancy_t mac_rlc_get_buffer_occupancy_ind(const module_id_t, const rnti_t, const eNB_index_t, const frame_t, const sub_frame_t, const eNB_flag_t, const logical_chan_id_t );)
 //-----------------------------------------------------------------------------
 //   RLC methods
 //-----------------------------------------------------------------------------
diff --git a/openair2/LAYER2/RLC/rlc_def.h b/openair2/LAYER2/RLC/rlc_def.h
index 124ba509b5b2825fa48a2beff0318c7db1268d59..929d66b70bc55f77f4dbe26c02d874d32edcc021 100644
--- a/openair2/LAYER2/RLC/rlc_def.h
+++ b/openair2/LAYER2/RLC/rlc_def.h
@@ -64,6 +64,7 @@ enum RLC_OPERATION_MODE { TRANSMITTER_ONLY = 0x00,
 // dimensions
 #    define SN_12BITS_MASK                            0x0FFF
 #    define RLC_SN_OVERFLOW                           0xFFFF
+#    define RLC_SN_UNDEFINED                          RLC_SN_OVERFLOW
 //----------------------------------------------------------
 // DISCARD
 //----------------------------------------------------------
diff --git a/openair2/LAYER2/RLC/rlc_mac.c b/openair2/LAYER2/RLC/rlc_mac.c
index d43a90ed6a5d5d982f3a9d26ec094d9597182fd1..b4061ad29f9b9adc1e1adc2d57897541da7a2d8e 100644
--- a/openair2/LAYER2/RLC/rlc_mac.c
+++ b/openair2/LAYER2/RLC/rlc_mac.c
@@ -125,6 +125,7 @@ tbs_size_t mac_rlc_data_req(
   const eNB_flag_t        enb_flagP,
   const MBMS_flag_t       MBMS_flagP,
   const logical_chan_id_t channel_idP,
+  const tb_size_t         tb_sizeP,
   char             *buffer_pP)
 {
   //-----------------------------------------------------------------------------
@@ -189,12 +190,14 @@ tbs_size_t mac_rlc_data_req(
     break;
 
   case RLC_MODE_AM:
-    data_request = rlc_am_mac_data_request(&ctxt, &rlc_union_p->rlc.am);
+    if (!enb_flagP) rlc_am_set_nb_bytes_requested_by_mac(&rlc_union_p->rlc.am,tb_sizeP);
+	data_request = rlc_am_mac_data_request(&ctxt, &rlc_union_p->rlc.am,enb_flagP);
     ret_tb_size =mac_rlc_serialize_tb(buffer_pP, data_request.data);
     break;
 
   case RLC_MODE_UM:
-    data_request = rlc_um_mac_data_request(&ctxt, &rlc_union_p->rlc.um);
+	if (!enb_flagP) rlc_um_set_nb_bytes_requested_by_mac(&rlc_union_p->rlc.um,tb_sizeP);
+	data_request = rlc_um_mac_data_request(&ctxt, &rlc_union_p->rlc.um,enb_flagP);
     ret_tb_size = mac_rlc_serialize_tb(buffer_pP, data_request.data);
     break;
 
@@ -320,6 +323,7 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
   const rnti_t            rntiP,
   const eNB_index_t       eNB_index,
   const frame_t           frameP,
+  const sub_frame_t 	  subframeP,
   const eNB_flag_t        enb_flagP,
   const MBMS_flag_t       MBMS_flagP,
   const logical_chan_id_t channel_idP,
@@ -337,7 +341,7 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
   srb_flag_t             srb_flag    = (channel_idP <= 2) ? SRB_FLAG_YES : SRB_FLAG_NO;
   protocol_ctxt_t     ctxt;
 
-  PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, enb_flagP, rntiP, frameP, 0, eNB_index);
+  PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, enb_flagP, rntiP, frameP, subframeP, eNB_index);
 
   VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_MAC_RLC_STATUS_IND,VCD_FUNCTION_IN);
   memset (&mac_rlc_status_resp, 0, sizeof(mac_rlc_status_resp_t));
@@ -397,7 +401,7 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
     break;
 
   case RLC_MODE_AM:
-    status_resp = rlc_am_mac_status_indication(&ctxt, &rlc_union_p->rlc.am, tb_sizeP, tx_status);
+    status_resp = rlc_am_mac_status_indication(&ctxt, &rlc_union_p->rlc.am, tb_sizeP, tx_status,enb_flagP);
     mac_rlc_status_resp.bytes_in_buffer                 = status_resp.buffer_occupancy_in_bytes;
     mac_rlc_status_resp.head_sdu_creation_time          = status_resp.head_sdu_creation_time;
     mac_rlc_status_resp.head_sdu_remaining_size_to_send = status_resp.head_sdu_remaining_size_to_send;
@@ -430,3 +434,65 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
   return mac_rlc_status_resp;
 }
 
+//-----------------------------------------------------------------------------
+rlc_buffer_occupancy_t mac_rlc_get_buffer_occupancy_ind(
+  const module_id_t       module_idP,
+  const rnti_t            rntiP,
+  const eNB_index_t       eNB_index,
+  const frame_t           frameP,
+  const sub_frame_t 	  subframeP,
+  const eNB_flag_t        enb_flagP,
+  const logical_chan_id_t channel_idP)
+{
+  //-----------------------------------------------------------------------------
+  rlc_buffer_occupancy_t  mac_rlc_buffer_occupancy_resp = 0;
+  rlc_mode_t             rlc_mode    = RLC_MODE_NONE;
+  rlc_union_t           *rlc_union_p = NULL;
+  hash_key_t             key         = HASHTABLE_NOT_A_KEY_VALUE;
+  hashtable_rc_t         h_rc;
+  srb_flag_t             srb_flag    = (channel_idP <= 2) ? SRB_FLAG_YES : SRB_FLAG_NO;
+  protocol_ctxt_t     ctxt;
+
+  PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, enb_flagP, rntiP, frameP, 0, eNB_index);
+
+  //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_MAC_RLC_GET_BUFFER_OCCUPANCY_IND,VCD_FUNCTION_IN);
+
+
+  /* Assumptions : for UE only */
+  /* At each TTI, Buffer Occupancy is first computed in mac_rlc_status_ind called by MAC ue_scheduler() function */
+  /* Then this function is called during MAC multiplexing ue_get_sdu(), and it may be call several times for the same bearer if it is in AM mode and there are several PDU types to transmit */
+  AssertFatal(enb_flagP == FALSE,"RLC Tx mac_rlc_get_buffer_occupancy_ind function is not implemented for eNB LcId=%d\n", channel_idP);
+
+
+  key = RLC_COLL_KEY_LCID_VALUE(module_idP, rntiP, enb_flagP, channel_idP, srb_flag);
+
+
+  h_rc = hashtable_get(rlc_coll_p, key, (void**)&rlc_union_p);
+
+  if (h_rc == HASH_TABLE_OK) {
+    rlc_mode = rlc_union_p->mode;
+  } else {
+    rlc_mode = RLC_MODE_NONE;
+    //LOG_W(RLC , "[%s] RLC not configured rb id %u lcid %u module %u!\n", __FUNCTION__, rb_id, channel_idP, ue_module_idP);
+    //LOG_D(RLC , "[%s] RLC not configured rb id %u lcid %u module %u!\n", __FUNCTION__, rb_id, channel_idP, ue_module_idP);
+  }
+
+  switch (rlc_mode) {
+   case RLC_MODE_AM:
+    mac_rlc_buffer_occupancy_resp = rlc_am_get_buffer_occupancy_in_bytes(&ctxt, &rlc_union_p->rlc.am);
+    break;
+
+  case RLC_MODE_UM:
+	mac_rlc_buffer_occupancy_resp = rlc_um_get_buffer_occupancy(&rlc_union_p->rlc.um);
+    break;
+
+  default:
+	  mac_rlc_buffer_occupancy_resp                 = 0 ;
+  }
+
+  //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_MAC_RLC_GET_BUFFER_OCCUPANCY_IND,VCD_FUNCTION_OUT);
+
+  return mac_rlc_buffer_occupancy_resp;
+}
+
+
diff --git a/openair2/PHY_INTERFACE/defs.h b/openair2/PHY_INTERFACE/defs.h
index 5769d94a377002ed48e11839fce424970080dc99..effc4c78776ccf0a1de61a991be44a525fdaf609 100644
--- a/openair2/PHY_INTERFACE/defs.h
+++ b/openair2/PHY_INTERFACE/defs.h
@@ -170,7 +170,7 @@ typedef struct {
   PRACH_RESOURCES_t* (*ue_get_rach)(module_id_t Mod_id,int CC_id,frame_t frameP,uint8_t Msg3_flag,sub_frame_t subframe);
 
   /// Process Random-Access Response
-  uint16_t (*ue_process_rar)(module_id_t Mod_id,int CC_id,frame_t frameP, uint16_t ra_rnti, uint8_t *dlsch_buffer, uint16_t *t_crnti,uint8_t preamble_index);
+  uint16_t (*ue_process_rar)(module_id_t Mod_id,int CC_id,frame_t frameP, uint16_t ra_rnti, uint8_t *dlsch_buffer, uint16_t *t_crnti,uint8_t preamble_index, uint8_t* selected_rar_buffer);
 
   /// Get SR payload (0,1) from UE MAC
   uint32_t (*ue_get_SR)(module_id_t Mod_id,int CC_id,frame_t frameP,uint8_t eNB_id,rnti_t rnti,sub_frame_t subframe);
diff --git a/openair2/RRC/LITE/rrc_UE.c b/openair2/RRC/LITE/rrc_UE.c
index cedf5a11f5eba2f4ee933e714f4eafa25347cc88..6798212fb2e5f4082f7ea92a0a68d841e0dc7935 100644
--- a/openair2/RRC/LITE/rrc_UE.c
+++ b/openair2/RRC/LITE/rrc_UE.c
@@ -404,6 +404,7 @@ void rrc_ue_generate_RRCConnectionRequest( const protocol_ctxt_t* const ctxt_pP,
 
 mui_t rrc_mui=0;
 
+#if !(defined(ENABLE_ITTI) && defined(ENABLE_USE_MME))
 /* NAS Attach request with IMSI */
 static const char const nas_attach_req_imsi[] = {
   0x07, 0x41,
@@ -417,7 +418,9 @@ static const char const nas_attach_req_imsi[] = {
   0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x0A, 0x00, 0x52, 0x12, 0xF2,
   0x01, 0x27, 0x11,
 };
+#endif /* !(defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)) */
 
+#if 0
 /* NAS Attach request with GUTI */
 static const char const nas_attach_req_guti[] = {
   0x07, 0x41,
@@ -431,6 +434,7 @@ static const char const nas_attach_req_guti[] = {
   0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x0A, 0x00, 0x52, 0x12, 0xF2,
   0x01, 0x27, 0x11,
 };
+#endif
 
 //-----------------------------------------------------------------------------
 static void rrc_ue_generate_RRCConnectionSetupComplete( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index, const uint8_t Transaction_id )
@@ -743,10 +747,10 @@ rrc_ue_establish_drb(
 #        ifdef OAI_EMU
     oai_emulation.info.oai_ifup[ue_mod_idP]=1;
 #        endif
-    LOG_I(OIP,"[UE %d] Config the oai%d to send/receive pkt on DRB %d to/from the protocol stack\n",
+    LOG_I(OIP,"[UE %d] Config the oai%d to send/receive pkt on DRB %ld to/from the protocol stack\n",
           ue_mod_idP,
           ip_addr_offset3+ue_mod_idP,
-          (eNB_index * maxDRB) + DRB_config->drb_Identity);
+          (long int)((eNB_index * maxDRB) + DRB_config->drb_Identity));
 
     rb_conf_ipv4(0,//add
                  ue_mod_idP,//cx align with the UE index
@@ -975,6 +979,8 @@ rrc_ue_update_radioResourceConfigDedicated(RadioResourceConfigDedicated_t* radio
     physicalConfigDedicated2->pusch_ConfigDedicated         = CALLOC(1,sizeof(*physicalConfigDedicated2->pusch_ConfigDedicated));
     physicalConfigDedicated2->pucch_ConfigDedicated         = CALLOC(1,sizeof(*physicalConfigDedicated2->pucch_ConfigDedicated));
     physicalConfigDedicated2->cqi_ReportConfig              = CALLOC(1,sizeof(*physicalConfigDedicated2->cqi_ReportConfig));
+    physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic
+                                                            = CALLOC(1,sizeof(*physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic));
     physicalConfigDedicated2->soundingRS_UL_ConfigDedicated = CALLOC(1,sizeof(*physicalConfigDedicated2->soundingRS_UL_ConfigDedicated));
     physicalConfigDedicated2->schedulingRequestConfig       = CALLOC(1,sizeof(*physicalConfigDedicated2->schedulingRequestConfig));
     physicalConfigDedicated2->antennaInfo                   = CALLOC(1,sizeof(*physicalConfigDedicated2->antennaInfo));
@@ -1036,14 +1042,25 @@ rrc_ue_update_radioResourceConfigDedicated(RadioResourceConfigDedicated_t* radio
     // Update cqi_ReportConfig
     if(radioResourceConfigDedicated->physicalConfigDedicated->cqi_ReportConfig != NULL)
     {
-        LOG_I(RRC,"Update cqi_ReportConfig config \n");
+        LOG_I(RRC,"Update cqi_ReportConfig config (size=%zu,%zu)\n", sizeof(*physicalConfigDedicated2->cqi_ReportConfig), sizeof(CQI_ReportConfig_t));
 
         if(UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index]->cqi_ReportConfig == NULL)
             UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index]->cqi_ReportConfig = CALLOC(1,sizeof(CQI_ReportConfig_t));
 
         memcpy((char*)UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index]->cqi_ReportConfig,
                 (char*)radioResourceConfigDedicated->physicalConfigDedicated->cqi_ReportConfig,
-                sizeof(physicalConfigDedicated2->cqi_ReportConfig));
+                sizeof(*physicalConfigDedicated2->cqi_ReportConfig));
+
+        if (radioResourceConfigDedicated->physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic != NULL) {
+          LOG_I(RRC,"Update cqi_ReportPeriodic config (size=%zu,%zu)\n", sizeof(*physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic), sizeof(CQI_ReportPeriodic_t));
+
+          if(UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index]->cqi_ReportConfig->cqi_ReportPeriodic == NULL)
+            UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index]->cqi_ReportConfig->cqi_ReportPeriodic = CALLOC(1,sizeof(CQI_ReportPeriodic_t));
+
+          memcpy((char*)UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index]->cqi_ReportConfig->cqi_ReportPeriodic,
+                  (char*)radioResourceConfigDedicated->physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic,
+                  sizeof(*physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic));
+        }
     }
     else
     {
diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c
index da9d93c19a2f0ccb5b8107b7087722c1664c6c2e..659f1c57b0e3f6595bdb1b8c52386c509d1ea563 100644
--- a/openair2/RRC/LITE/rrc_eNB.c
+++ b/openair2/RRC/LITE/rrc_eNB.c
@@ -2268,8 +2268,8 @@ rrc_eNB_process_MeasurementReport(
   LOG_I(RRC, "RSRP of Source %ld\n", measResults2->measResultPCell.rsrpResult);
   LOG_I(RRC, "RSRQ of Source %ld\n", measResults2->measResultPCell.rsrqResult);
 #else
-  LOG_I(RRC, "RSRP of Source %d\n", measResults2->measResultServCell.rsrpResult);
-  LOG_I(RRC, "RSRQ of Source %d\n", measResults2->measResultServCell.rsrqResult);
+  LOG_I(RRC, "RSRP of Source %ld\n", measResults2->measResultServCell.rsrpResult);
+  LOG_I(RRC, "RSRQ of Source %ld\n", measResults2->measResultServCell.rsrqResult);
 #endif
 
   if (ue_context_pP->ue_context.handover_info->ho_prepare != 0xF0) {
@@ -3613,9 +3613,9 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
             dest_ip_offset = 8;
 #      endif
             LOG_I(OIP,
-                  "[eNB %d] Config the oai%d to send/receive pkt on DRB %d to/from the protocol stack\n",
+                  "[eNB %d] Config the oai%d to send/receive pkt on DRB %ld to/from the protocol stack\n",
                   ctxt_pP->module_id, ctxt_pP->module_id,
-                  (ue_context_pP->local_uid * maxDRB) + DRB_configList->list.array[i]->drb_Identity);
+                  (long int)((ue_context_pP->local_uid * maxDRB) + DRB_configList->list.array[i]->drb_Identity));
             ue_module_id = oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[ctxt_pP->module_id][ue_context_pP->local_uid];
             rb_conf_ipv4(0, //add
                          ue_module_id,  //cx
diff --git a/openair2/RRC/LITE/rrc_eNB_S1AP.c b/openair2/RRC/LITE/rrc_eNB_S1AP.c
index 3642d02a1c32f3c782fb0b6cf0d93f42e843bbca..f3c22abeff3b432010cdfa5a35c4ac973ec9b221 100644
--- a/openair2/RRC/LITE/rrc_eNB_S1AP.c
+++ b/openair2/RRC/LITE/rrc_eNB_S1AP.c
@@ -287,10 +287,10 @@ rrc_eNB_process_security(
 
   // translation
   LOG_D(RRC,
-        "[eNB %d] NAS security_capabilities.encryption_algorithms %u AS ciphering_algorithm %u NAS security_capabilities.integrity_algorithms %u AS integrity_algorithm %u\n",
+        "[eNB %d] NAS security_capabilities.encryption_algorithms %u AS ciphering_algorithm %lu NAS security_capabilities.integrity_algorithms %u AS integrity_algorithm %u\n",
         ctxt_pP->module_id,
         ue_context_pP->ue_context.security_capabilities.encryption_algorithms,
-        ue_context_pP->ue_context.ciphering_algorithm,
+        (unsigned long)ue_context_pP->ue_context.ciphering_algorithm,
         ue_context_pP->ue_context.security_capabilities.integrity_algorithms,
         ue_context_pP->ue_context.integrity_algorithm);
   /* Select relevant algorithms */
@@ -308,11 +308,11 @@ rrc_eNB_process_security(
     changed = TRUE;
   }
 
-  LOG_I (RRC, "[eNB %d][UE %x] Selected security algorithms (%p): %x, %x, %s\n",
+  LOG_I (RRC, "[eNB %d][UE %x] Selected security algorithms (%p): %lx, %x, %s\n",
          ctxt_pP->module_id,
          ue_context_pP->ue_context.rnti,
          security_capabilities_pP,
-         cipheringAlgorithm,
+         (unsigned long)cipheringAlgorithm,
          integrityProtAlgorithm,
          changed ? "changed" : "same");
 
diff --git a/openair2/UTIL/LISTS/list2.c b/openair2/UTIL/LISTS/list2.c
index abd9d2aacce6b139df6ef993ec70cf4a82ff3137..8daa19bfa4515c3b00adb7deddfa90966655c9bd 100644
--- a/openair2/UTIL/LISTS/list2.c
+++ b/openair2/UTIL/LISTS/list2.c
@@ -233,6 +233,8 @@ list2_add_head (mem_block_t * elementP, list2_t * listP)
 
     // almost one element
     if (head == NULL) {
+      elementP->previous = NULL;
+      elementP->next = NULL;
       listP->head = elementP;
       listP->tail = elementP;
     } else {
diff --git a/openair2/UTIL/LOG/log.c b/openair2/UTIL/LOG/log.c
index 9a2d6a96ef1735d18a8c4e6825ce5cf75f82fef4..9c28c4b68d0900afb21775314102bbeb9199b2f0 100644
--- a/openair2/UTIL/LOG/log.c
+++ b/openair2/UTIL/LOG/log.c
@@ -28,6 +28,7 @@
 
 */
 
+#define _GNU_SOURCE  /* required for pthread_getname_np */
 //#define LOG_TEST 1
 
 #define COMPONENT_LOG
@@ -1032,6 +1033,19 @@ void logRecord_mt(const char *file, const char *func, int line, int comp,
       if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
     }
 
+    if ( (g_log->flag & FLAG_THREAD) || (c->flag & FLAG_THREAD) ) {
+#     define THREAD_NAME_LEN 128
+      char threadname[THREAD_NAME_LEN];
+      if (pthread_getname_np(pthread_self(), threadname, THREAD_NAME_LEN) != 0)
+      {
+        perror("pthread_getname_np : ");
+      } else {
+        len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%s]", threadname);
+        if (len > MAX_LOG_TOTAL) len = MAX_LOG_TOTAL;
+      }
+#     undef THREAD_NAME_LEN
+    }
+
     if ( (g_log->flag & FLAG_FUNCT) || (c->flag & FLAG_FUNCT) ) {
       len += snprintf(&log_buffer[len], MAX_LOG_TOTAL - len, "[%s] ",
                       func);
@@ -1287,11 +1301,15 @@ int set_comp_log(int component, int level, int verbosity, int interval)
            LOG_EMERG);
   DevCheck((interval > 0) && (interval <= 0xFF), interval, 0, 0xFF);
 
+#if 0
   if ((verbosity == LOG_NONE) || (verbosity == LOG_LOW) ||
       (verbosity == LOG_MED) || (verbosity == LOG_FULL) ||
       (verbosity == LOG_HIGH)) {
     g_log->log_component[component].flag = verbosity;
   }
+#else
+  g_log->log_component[component].flag = verbosity;
+#endif
 
   g_log->log_component[component].level = level;
   g_log->log_component[component].interval = interval;
diff --git a/openair2/UTIL/LOG/log.h b/openair2/UTIL/LOG/log.h
index 3a67e85d3d9495e01ef3ec7ec35aa4e9a1cd1ced..5140a08dbd4489b77c7ca86b5aeb2383a82277b7 100644
--- a/openair2/UTIL/LOG/log.h
+++ b/openair2/UTIL/LOG/log.h
@@ -259,8 +259,8 @@ void log_set_instance_type (log_instance_type_t instance);
 #    include "log_if.h"
 /*----------------------------------------------------------------------------*/
 int  logInit (void);
-void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...);
-void logRecord(const char *file, const char *func, int line,int comp, int level, const char *format, ...);
+void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));
+void logRecord(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));
 int  set_comp_log(int component, int level, int verbosity, int interval);
 int  set_log(int component, int level, int interval);
 void set_glog(int level, int verbosity);
diff --git a/openair2/UTIL/OTG/otg_rx_socket.c b/openair2/UTIL/OTG/otg_rx_socket.c
index 2caeee4f5274bcf30b2bebe0071acd1a110dda24..98e03532a15403982f9c1560d46cd3ab1beae798 100644
--- a/openair2/UTIL/OTG/otg_rx_socket.c
+++ b/openair2/UTIL/OTG/otg_rx_socket.c
@@ -98,7 +98,7 @@ void *recv_ip4_tcp(void* csock)
 
 
       LOG_I(OTG,"SOCKET:: TCP-IP4 :: size=%d  received=%d, Received buffer: %s   \n\n\n", strlen(buffer),  sock_rcv, buffer);
-      buffer[PAYLOAD_MAX] != '\0';
+      //buffer[PAYLOAD_MAX] != '\0';
 
     }
 
diff --git a/openair3/NAS/TOOLS/display.c b/openair3/NAS/TOOLS/display.c
index 7d145d1f3b6dd648e229bb41c7900132dbe86b2d..363fae76b8eed58ee56e959058a03a3df705403a 100644
--- a/openair3/NAS/TOOLS/display.c
+++ b/openair3/NAS/TOOLS/display.c
@@ -248,6 +248,14 @@ void display_usim_data(const char *filename) {
 	memcpy(key, data.keys.ik, USIM_IK_SIZE);
 	printf("\tIK\t: \"%s\"\n", key);
 
+        printf("\n\tusim_api_k:");
+        for (int i = 0; i < 16; i++)
+          printf(" %2.2x", data.keys.usim_api_k[i]);
+        printf("\n\topc       :");
+        for (int i = 0; i < 16; i++)
+          printf(" %2.2x", data.keys.opc[i]);
+        printf("\n\n");
+
 	printf("EPS NAS security context:\n");
 	printf("\tKSIasme\t: 0x%.2x\n", data.securityctx.KSIasme.value[0]);
 	char kasme[USIM_K_ASME_SIZE + 1];
diff --git a/openair3/NAS/UE/EMM/emm_main.c b/openair3/NAS/UE/EMM/emm_main.c
index c64fd6df2614381083d16a66f8555daf64f0b679..8f3ed17e4cae7e03f61d9d4246ed1398ca9f358c 100644
--- a/openair3/NAS/UE/EMM/emm_main.c
+++ b/openair3/NAS/UE/EMM/emm_main.c
@@ -203,6 +203,52 @@ void emm_main_initialize(nas_user_t *user, emm_indication_callback_t cb, const c
     LOG_TRACE(INFO, "EMM-MAIN  - USIM application data successfully read");
     user->emm_data->usim_is_valid = TRUE;
 
+    /* print keys (for debugging) */
+    {
+      char usim_api_k[256];
+      char opc[256];
+      sprintf(usim_api_k,
+              "%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x "
+              "%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x",
+              user->usim_data.keys.usim_api_k[0],
+              user->usim_data.keys.usim_api_k[1],
+              user->usim_data.keys.usim_api_k[2],
+              user->usim_data.keys.usim_api_k[3],
+              user->usim_data.keys.usim_api_k[4],
+              user->usim_data.keys.usim_api_k[5],
+              user->usim_data.keys.usim_api_k[6],
+              user->usim_data.keys.usim_api_k[7],
+              user->usim_data.keys.usim_api_k[8],
+              user->usim_data.keys.usim_api_k[9],
+              user->usim_data.keys.usim_api_k[10],
+              user->usim_data.keys.usim_api_k[11],
+              user->usim_data.keys.usim_api_k[12],
+              user->usim_data.keys.usim_api_k[13],
+              user->usim_data.keys.usim_api_k[14],
+              user->usim_data.keys.usim_api_k[15]);
+      sprintf(opc,
+              "%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x "
+              "%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x",
+              user->usim_data.keys.opc[0],
+              user->usim_data.keys.opc[1],
+              user->usim_data.keys.opc[2],
+              user->usim_data.keys.opc[3],
+              user->usim_data.keys.opc[4],
+              user->usim_data.keys.opc[5],
+              user->usim_data.keys.opc[6],
+              user->usim_data.keys.opc[7],
+              user->usim_data.keys.opc[8],
+              user->usim_data.keys.opc[9],
+              user->usim_data.keys.opc[10],
+              user->usim_data.keys.opc[11],
+              user->usim_data.keys.opc[12],
+              user->usim_data.keys.opc[13],
+              user->usim_data.keys.opc[14],
+              user->usim_data.keys.opc[15]);
+      LOG_TRACE(INFO, "EMM-MAIN  - usim_api_k: %s", usim_api_k);
+      LOG_TRACE(INFO, "EMM-MAIN  - opc:        %s", opc);
+    }
+
     /* Get the Home PLMN derived from the IMSI */
     user->emm_data->hplmn.MCCdigit1 = user->usim_data.imsi.u.num.digit1;
     user->emm_data->hplmn.MCCdigit2 = user->usim_data.imsi.u.num.digit2;
diff --git a/targets/ARCH/COMMON/common_lib.c b/targets/ARCH/COMMON/common_lib.c
index 7433b5d6187ae0418f35dd1ccda7458c5089b5e9..19036de20461bebb4a90a103e43d88898d378975 100644
--- a/targets/ARCH/COMMON/common_lib.c
+++ b/targets/ARCH/COMMON/common_lib.c
@@ -139,11 +139,6 @@ int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_param
 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) {
@@ -151,7 +146,6 @@ int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cf
       return -1;		   
     }   
   }
-  #endif
   return rc;
 }
 
diff --git a/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c b/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
index bb9435413d72259da98b71c4f08c2f3b92be5a69..f22206eec8018a16da10289772488d0edcdd56f5 100644
--- a/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
+++ b/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
@@ -297,7 +297,7 @@ int ethernet_tune(openair0_device *device, unsigned int option, int value) {
       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] status of %s is %d\n", system_cmd, WEXITSTATUS(ret));
       }
       printf("[ETHERNET] Coalesce parameters %s\n",system_cmd);
     } else {
@@ -314,7 +314,7 @@ int ethernet_tune(openair0_device *device, unsigned int option, int value) {
       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] status of %s is %d\n", system_cmd, WEXITSTATUS(ret));
       }
       printf("[ETHERNET] Pause parameters %s\n",system_cmd);
     } else {
@@ -329,7 +329,7 @@ int ethernet_tune(openair0_device *device, unsigned int option, int value) {
       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] status of %s is %d\n", system_cmd, WEXITSTATUS(ret));
       }            
       printf("[ETHERNET] Ring parameters %s\n",system_cmd);
     } else {
diff --git a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp
index f2d2af55c7ee35697f193ba75667b1cac70f80d8..2dec4ff22df96683b897b76352eb924f44ec4abf 100644
--- a/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp
+++ b/targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp
@@ -45,6 +45,14 @@ lms_device_t* lms_device;
 lms_stream_t rx_stream;
 lms_stream_t tx_stream;
 
+/* We have a strange behavior when we just start reading
+ * from the device (inconsistent values of the timestamp).
+ * A quick solution is to discard the very first read packet
+ * after a "start".
+ * The following global variable "first_rx" serves that purpose.
+ */
+static int first_rx = 0;
+
 #define RXDCLENGTH 4096
 #define NUMBUFF 32
 
@@ -94,6 +102,10 @@ int trx_lms_read(openair0_device *device, openair0_timestamp *ptimestamp, void *
     meta.flushPartialPacket = false;
 
     int ret;
+    if (first_rx == 1) {
+      first_rx = 0;
+      ret = LMS_RecvStream(&rx_stream,buff[0],nsamps,&meta,50);
+    }
     ret = LMS_RecvStream(&rx_stream,buff[0],nsamps,&meta,50);
     *ptimestamp = meta.timestamp;
     return ret;
@@ -223,6 +235,8 @@ int trx_lms_start(openair0_device *device){
     }
 
 
+    first_rx = 1;
+
     rx_stream.channel = 0;
     rx_stream.fifoSize = 256*1024;
     rx_stream.throughputVsLatency = 0.1;
@@ -355,7 +369,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg){
     break;
   case 15360000:
     openair0_cfg[0].samples_per_packet    = 2048;
-    openair0_cfg[0].tx_sample_advance     = 450;
+    openair0_cfg[0].tx_sample_advance     = 50;   /* TODO: to be refined */
     openair0_cfg[0].tx_bw                 = 15.36e6;
     openair0_cfg[0].rx_bw                 = 15.36e6;
     break;
diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
index dc2589de44dcea18be20583e209f305acc6613fd..df91796049332360b9265b4f7b982108d1319568 100644
--- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
+++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
@@ -261,7 +261,7 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
         LOG_E(PHY,"[recv] received %d samples out of %d\n",samples_received,nsamps);
 
     if ( s->rx_md.error_code != uhd::rx_metadata_t::ERROR_CODE_NONE)
-        LOG_E(PHY,s->rx_md.to_pp_string(true).c_str());
+        LOG_E(PHY, "%s\n", s->rx_md.to_pp_string(true).c_str());
 
     s->rx_count += nsamps;
     s->rx_timestamp = s->rx_md.time_spec.to_ticks(s->sample_rate);
@@ -664,7 +664,7 @@ extern "C" {
 	LOG_I(PHY,"RF board max packet size %u, size for 100µs jitter %d \n", max, samples);
 	if ( samples < max )
 	  stream_args_rx.args["spp"] = str(boost::format("%d") % samples );
-	LOG_I(PHY,"rx_max_num_samps %u\n",
+	LOG_I(PHY,"rx_max_num_samps %zu\n",
 	      s->usrp->get_rx_stream(stream_args_rx)->get_max_num_samps());
 
         for (int i = 0; i<openair0_cfg[0].rx_num_channels; i++)
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.generic.oaisim.local_no_mme.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.generic.oaisim.local_no_mme.conf
index 8db3e2304dfd2f05afeca060a4bbf9866543fb03..140d215b9cb680169243ca15f277f206b7e592bf 100644
--- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.generic.oaisim.local_no_mme.conf
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.generic.oaisim.local_no_mme.conf
@@ -34,7 +34,7 @@ eNBs =
         downlink_frequency      			      = 2680000000L;
         uplink_frequency_offset 			      = -120000000;
         Nid_cell					              = 0;
-        N_RB_DL                 			      = 50;
+        N_RB_DL                 			      = 25;
         Nid_cell_mbsfn          			      = 0;
 	nb_antenna_ports				      = 1;
         nb_antennas_tx          			      = 1;
@@ -62,7 +62,7 @@ eNBs =
         pusch_nDMRS1                              = 0;
         phich_duration                            = "NORMAL";
         phich_resource                            = "ONESIXTH";
-        srs_enable                                = "ENABLE";
+        srs_enable                                = "DISABLE";
         srs_BandwidthConfig                       =2;
         srs_SubframeConfig                        =13;
         srs_ackNackST                             ="DISABLE";
diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c
index b88b094f0880782b3d3613424216c4d6ea7247ea..a3ecbeb9142467eaaae9f90fa5209fbd027dd8c6 100644
--- a/targets/RT/USER/lte-enb.c
+++ b/targets/RT/USER/lte-enb.c
@@ -972,8 +972,8 @@ void rx_rf(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
       end_rf_ts = proc->timestamp_rx+eNB->ts_offset+(tx_sfoffset*fp->samples_per_tti)-openair0_cfg[0].tx_sample_advance;
       if (recv_if_count != 0 ) {
         recv_if_count = recv_if_count-1;
-        LOG_D(HW,"[From Timestamp %d to Timestamp %d] RTT_RF: %"PRId64"; RTT_RF\n", start_rf_prev_ts, end_rf_ts, clock_difftime_ns(start_rf_prev, end_rf));
-        LOG_D(HW,"[From Timestamp %d to Timestamp %d] RTT_RF: %"PRId64"; RTT_RF\n",start_rf_prev2_ts, end_rf_ts, clock_difftime_ns(start_rf_prev2, end_rf));
+        LOG_D(HW,"[From Timestamp %"PRId64" to Timestamp %"PRId64"] RTT_RF: %"PRId64"; RTT_RF\n", start_rf_prev_ts, end_rf_ts, clock_difftime_ns(start_rf_prev, end_rf));
+        LOG_D(HW,"[From Timestamp %"PRId64" to Timestamp %"PRId64"] RTT_RF: %"PRId64"; RTT_RF\n",start_rf_prev2_ts, end_rf_ts, clock_difftime_ns(start_rf_prev2, end_rf));
       }
       VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 );
       
diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c
index 2ad68765e30cc0001c88e65684def3d9d8ca91e6..68fcbc49d5eb2e88dec2d63221044b53c2b5505f 100644
--- a/targets/RT/USER/lte-softmodem.c
+++ b/targets/RT/USER/lte-softmodem.c
@@ -329,6 +329,7 @@ void help (void) {
   printf("  --external-clock tells hardware to use an external clock reference\n");
   printf("  --usim-test use XOR autentication algo in case of test usim mode\n"); 
   printf("  --single-thread-disable. Disables single-thread mode in lte-softmodem\n"); 
+  printf("  -A Set timing_advance\n");
   printf("  -C Set the downlink frequency for all component carriers\n");
   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");
@@ -1386,6 +1387,7 @@ int main( int argc, char **argv ) {
     memset(&openair0_cfg[0],0,sizeof(openair0_config_t)*MAX_CARDS);
 
     memset(tx_max_power,0,sizeof(int)*MAX_NUM_CCs);
+
     set_latency_target();
 
     // set default parameters
@@ -1417,7 +1419,7 @@ int main( int argc, char **argv ) {
         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(RLC,     LOG_INFO,   LOG_HIGH | FLAG_THREAD, 1);
         set_comp_log(PDCP,    LOG_INFO,   LOG_HIGH, 1);
         set_comp_log(OTG,     LOG_INFO,   LOG_HIGH, 1);
         set_comp_log(RRC,     LOG_INFO,   LOG_HIGH, 1);
@@ -1517,6 +1519,12 @@ int main( int argc, char **argv ) {
 
     check_clock();
 
+#ifndef PACKAGE_VERSION
+#  define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL"
+#endif
+
+  LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
+
   // init the parameters
   for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
 
diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c
index 8a0b646fc35204a6b136f2202a39b50d5741b87a..f07a0628f8979d6093ac92e8cabbbd81a0d4daff 100644
--- a/targets/RT/USER/lte-ue.c
+++ b/targets/RT/USER/lte-ue.c
@@ -323,11 +323,11 @@ static void *UE_thread_synch(void *arg) {
                        downlink_frequency[0][0]+uplink_frequency_offset[0][0]+freq_offset,
                        UE->UE_scan_carrier );
 
-                if (UE->UE_scan_carrier == 1) {
-                    UE->UE_scan_carrier = 0;
+
                     // rerun with new cell parameters and frequency-offset
                     for (i=0; i<openair0_cfg[UE->rf_map.card].rx_num_channels; i++) {
                         openair0_cfg[UE->rf_map.card].rx_gain[UE->rf_map.chain+i] = UE->rx_total_gain_dB;//-USRP_GAIN_OFFSET;
+			if (UE->UE_scan_carrier == 1) {
                         if (freq_offset >= 0)
                             openair0_cfg[UE->rf_map.card].rx_freq[UE->rf_map.chain+i] += abs(UE->common_vars.freq_offset);
                         else
@@ -337,6 +337,7 @@ static void *UE_thread_synch(void *arg) {
                         downlink_frequency[CC_id][i] = openair0_cfg[CC_id].rx_freq[i];
                         freq_offset=0;
                     }
+	  }
 
                     // reconfigure for potentially different bandwidth
                     switch(UE->frame_parms.N_RB_DL) {
@@ -375,6 +376,10 @@ static void *UE_thread_synch(void *arg) {
                         LOG_E(HW,"Could not start the device\n");
                         oai_exit=1;
                     }*/
+
+		if (UE->UE_scan_carrier == 1) {
+
+		  UE->UE_scan_carrier = 0;
                 } else {
                     AssertFatal ( 0== pthread_mutex_lock(&UE->proc.mutex_synch), "");
                     UE->is_synchronized = 1;
diff --git a/targets/SIMU/PROC/Process.c b/targets/SIMU/PROC/Process.c
index ee3d6d5c53ceee0d7072cb89ccf9c658d2bfe5ef..9d80c74d99bd70faf341d1f62e3c38672de3b062 100644
--- a/targets/SIMU/PROC/Process.c
+++ b/targets/SIMU/PROC/Process.c
@@ -284,8 +284,12 @@ void Channel_Inst(int node_id,int port,double **s_re[MAX_eNB+MAX_UE],double **s_
       u2e_t[UE_id][eNB_id]->next_slot=&next_slot;
       u2e_t[UE_id][eNB_id]->abstraction_flag=&abstraction_flag;
       u2e_t[UE_id][eNB_id]->frame_parms=frame_parms;
-      u2e_t[UE_id][eNB_id]->tx_data[3]=tx[eNB_id][3];
-      u2e_t[UE_id][eNB_id]->rx_data[3]=rx[NB_eNB_INST+UE_id][3];
+
+      for (int i=0;i<3;i++)
+      {
+          u2e_t[UE_id][eNB_id]->tx_data[i]=tx[eNB_id][i];
+          u2e_t[UE_id][eNB_id]->rx_data[i]=rx[NB_eNB_INST+UE_id][i];
+      }
 
       if(pthread_cond_init (&downlink_cond[eNB_id][UE_id], NULL)) exit(1);
 
@@ -316,8 +320,11 @@ void Channel_Inst(int node_id,int port,double **s_re[MAX_eNB+MAX_UE],double **s_
       e2u_t[eNB_id][UE_id]->next_slot=&next_slot;
       e2u_t[eNB_id][UE_id]->abstraction_flag=&abstraction_flag;
       e2u_t[eNB_id][UE_id]->frame_parms=frame_parms;
-      e2u_t[eNB_id][UE_id]->tx_data[3]=tx[NB_eNB_INST+UE_id][3];
-      e2u_t[eNB_id][UE_id]->rx_data[3]=rx[eNB_id][3];
+      for (int i=0;i<3;i++)
+      {
+          e2u_t[eNB_id][UE_id]->tx_data[i]=tx[NB_eNB_INST+UE_id][i];
+          e2u_t[eNB_id][UE_id]->rx_data[i]=rx[eNB_id][i];
+      }
 
       if(pthread_cond_init (&uplink_cond[UE_id][eNB_id], NULL)) exit(1);
 
diff --git a/targets/SIMU/PROC/channel_sim_proc.c b/targets/SIMU/PROC/channel_sim_proc.c
index 0ffdd97ce09501304c79bc1928ad8e27b611bcb4..b54fe36460cbe2831747d9984278d31716d3c920 100644
--- a/targets/SIMU/PROC/channel_sim_proc.c
+++ b/targets/SIMU/PROC/channel_sim_proc.c
@@ -183,8 +183,13 @@ void do_DL_sig_channel_T(void *param)
   next_slot=(cthread->next_slot);
   abstraction_flag=*(cthread->abstraction_flag);
   thread_id=(cthread->thread_id);
-  tx_data[3]=cthread->tx_data[3];
-  rx_data[3]=cthread->rx_data[3];
+
+  for (int i=0;i<3;i++)
+  {
+      tx_data[i]=cthread->tx_data[i];
+      rx_data[i]=cthread->rx_data[i];
+  }
+
   s32 att_eNB_id=-1;
   s32 **txdata,**rxdata;
 
diff --git a/targets/SIMU/USER/channel_sim.c b/targets/SIMU/USER/channel_sim.c
index 3913de60168524e8db18af473563c521e3fd95c1..04d7e1d2331fec3bd8f11b05249ef7cb1ab8f110 100644
--- a/targets/SIMU/USER/channel_sim.c
+++ b/targets/SIMU/USER/channel_sim.c
@@ -281,7 +281,7 @@ void do_DL_sig(channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][MAX_N
       LOG_D(OCM,"[SIM][DL] UE %d : rx_pwr %f dBm/RE (%f dBm RSSI)for subframe %d\n",UE_id,
             10*log10(rx_pwr),
             10*log10(rx_pwr*(double)frame_parms->N_RB_DL*12),subframe);
-      LOG_D(OCM,"[SIM][DL] UE %d : rx_pwr (noise) -132 dBm/RE (N0fs = %.1f dBm, N0B = %.1f dBm) for slot %d (subframe %d)\n",
+      LOG_D(OCM,"[SIM][DL] UE %d : rx_pwr (noise) -132 dBm/RE (N0fs = %.1f dBm, N0B = %.1f dBm) for subframe %d\n",
             UE_id,
             10*log10(eNB2UE[eNB_id][UE_id][CC_id]->sampling_rate*1e6)-174,
             10*log10(eNB2UE[eNB_id][UE_id][CC_id]->sampling_rate*1e6*12*frame_parms->N_RB_DL/(double)frame_parms->ofdm_symbol_size)-174,
diff --git a/targets/SIMU/USER/event_handler.c b/targets/SIMU/USER/event_handler.c
index f2199ca910b311099e554027619aa010dffe5486..c140dab50b6fd4bf4530354c3b85e0e5ae194db9 100644
--- a/targets/SIMU/USER/event_handler.c
+++ b/targets/SIMU/USER/event_handler.c
@@ -513,7 +513,7 @@ void update_mac(Event_t event)
             if(&mac_config[i].mac_ContentionResolutionTimer !=NULL) {
               oai_emulation->mac_config[i].mac_ContentionResolutionTimer= mac_config[i].mac_ContentionResolutionTimer;
               UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer = oai_emulation->mac_config[i].mac_ContentionResolutionTimer;
-              LOG_I(EMU,"mac_ContentionResolutionTimer UE %:", i);
+              LOG_I(EMU,"mac_ContentionResolutionTimer UE %d:", i);
               LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer);
             }
 
@@ -637,7 +637,7 @@ void update_mac(Event_t event)
           if(&mac_config[i].mac_ContentionResolutionTimer !=NULL) {
             oai_emulation->mac_config[i].mac_ContentionResolutionTimer= mac_config[i].mac_ContentionResolutionTimer;
             UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer = oai_emulation->mac_config[i].mac_ContentionResolutionTimer;
-            LOG_I(EMU,"mac_ContentionResolutionTimer UE %:", i);
+            LOG_I(EMU,"mac_ContentionResolutionTimer UE %d:", i);
             LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer);
           }
 
@@ -903,13 +903,13 @@ void update_mac(Event_t event)
         for(i=UE_list->head; i>=0; i=UE_list->next[i]) {
           oai_emulation->mac_config[i].cqiSchedInterval= mac_config[i].cqiSchedInterval;
           UE_list->UE_sched_ctrl[i].cqiSchedInterval = oai_emulation->mac_config[i].cqiSchedInterval;
-          LOG_I(EMU,"cqiSchedInterval UE :\n", i);
+          LOG_I(EMU,"cqiSchedInterval UE %d:\n", i);
           LOG_I(EMU,"%" PRIu16 "\n",UE_list->UE_sched_ctrl[i].cqiSchedInterval);
         }
       } else {
         oai_emulation->mac_config[event.ue].cqiSchedInterval= mac_config[event.ue].cqiSchedInterval;
         UE_list->UE_sched_ctrl[event.ue].cqiSchedInterval = oai_emulation->mac_config[event.ue].cqiSchedInterval;
-        LOG_I(EMU,"cqiSchedInterval UE :\n", event.ue);
+        LOG_I(EMU,"cqiSchedInterval UE %d:\n", event.ue);
         LOG_I(EMU,"%" PRIu16 "\n",UE_list->UE_sched_ctrl[event.ue].cqiSchedInterval);
       }
     } else if(!strcmp((char *) event.key, "mac_ContentionResolutionTimer") && event.value!=NULL && validate_mac(event)) {
@@ -923,13 +923,13 @@ void update_mac(Event_t event)
         for(i=UE_list->head; i>=0; i=UE_list->next[i]) {
           oai_emulation->mac_config[i].mac_ContentionResolutionTimer= mac_config[i].mac_ContentionResolutionTimer;
           UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer = oai_emulation->mac_config[i].mac_ContentionResolutionTimer;
-          LOG_I(EMU,"mac_ContentionResolutionTimer UE :\n", i);
+          LOG_I(EMU,"mac_ContentionResolutionTimer UE %d:\n", i);
           LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer);
         }
       } else {
         oai_emulation->mac_config[event.ue].mac_ContentionResolutionTimer= mac_config[event.ue].mac_ContentionResolutionTimer;
         UE_list->UE_sched_ctrl[event.ue].mac_ContentionResolutionTimer = oai_emulation->mac_config[event.ue].mac_ContentionResolutionTimer;
-        LOG_I(EMU,"mac_ContentionResolutionTimer UE :\n", event.ue);
+        LOG_I(EMU,"mac_ContentionResolutionTimer UE %d:\n", event.ue);
         LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[event.ue].mac_ContentionResolutionTimer);
       }
     } else if(!strcmp((char *) event.key, "max_allowed_rbs") && event.value!=NULL && validate_mac(event)) {
@@ -1040,7 +1040,7 @@ void update_sys_model(Event_t event)
       LOG_I(EMU,"free_space_model_parameters.pathloss_exponent %G\n",oai_emulation->environment_system_config.fading.free_space_model_parameters.pathloss_exponent);
       LOG_I(EMU,"free_space_model_parameters.pathloss_0_dB %G\n",oai_emulation->environment_system_config.fading.free_space_model_parameters.pathloss_0_dB);
 
-      LOG_I(EMU,"ricean_8tap.rice_factor_dB %G\n",oai_emulation->environment_system_config.fading.ricean_8tap.rice_factor_dB);
+      LOG_I(EMU,"ricean_8tap.rice_factor_dB %d\n",oai_emulation->environment_system_config.fading.ricean_8tap.rice_factor_dB);
 
       //Antenna
       LOG_I(EMU,"antenna.eNB_antenna.number_of_sectors %d\n",oai_emulation->environment_system_config.antenna.eNB_antenna.number_of_sectors);
@@ -1103,7 +1103,7 @@ void update_sys_model(Event_t event)
     } else if(!strcmp((char *) event.key, "free_space_model_parameters.pathloss_0_dB")) {
       LOG_I(EMU,"free_space_model_parameters.pathloss_0_dB %G\n",oai_emulation->environment_system_config.fading.free_space_model_parameters.pathloss_0_dB);
     } else if(!strcmp((char *) event.key, "ricean_8tap.rice_factor_dB")) {
-      LOG_I(EMU,"ricean_8tap.rice_factor_dB %G\n",oai_emulation->environment_system_config.fading.ricean_8tap.rice_factor_dB);
+      LOG_I(EMU,"ricean_8tap.rice_factor_dB %d\n",oai_emulation->environment_system_config.fading.ricean_8tap.rice_factor_dB);
     } else if(!strcmp((char *) event.key, "antenna.eNB_antenna.number_of_sectors")) {
       LOG_I(EMU,"antenna.eNB_antenna.number_of_sectors %d\n",oai_emulation->environment_system_config.antenna.eNB_antenna.number_of_sectors);
     } else if(!strcmp((char *) event.key, "antenna.eNB_antenna.beam_width_dB")) {
@@ -1202,8 +1202,8 @@ void update_topo_model(Event_t event)
       LOG_I(EMU,"UE_moving_dynamics_max_speed_mps %G\n",oai_emulation->topology_config.mobility.UE_mobility.UE_moving_dynamics.max_speed_mps);
       LOG_I(EMU,"UE_moving_dynamics_min_journey_time_ms %G\n",oai_emulation->topology_config.mobility.UE_mobility.UE_moving_dynamics.min_journey_time_ms);
       LOG_I(EMU,"UE_moving_dynamics_max_journey_time_ms %G\n",oai_emulation->topology_config.mobility.UE_mobility.UE_moving_dynamics.max_journey_time_ms);
-      LOG_I(EMU,"grid_map_horizontal_grid %G\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.horizontal_grid);
-      LOG_I(EMU,"grid_map_vertical_grid %G\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.vertical_grid);
+      LOG_I(EMU,"grid_map_horizontal_grid %d\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.horizontal_grid);
+      LOG_I(EMU,"grid_map_vertical_grid %d\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.vertical_grid);
       LOG_I(EMU,"UE_initial_distribution_selected_option %s\n",oai_emulation->topology_config.mobility.UE_mobility.UE_initial_distribution.selected_option);
       LOG_I(EMU,"random_UE_distribution_number_of_nodes %d\n",oai_emulation->topology_config.mobility.UE_mobility.random_UE_distribution.number_of_nodes);
       LOG_I(EMU,"concentrated_UE_distribution_number_of_nodes %d\n",oai_emulation->topology_config.mobility.UE_mobility.concentrated_UE_distribution.number_of_nodes);
@@ -1245,9 +1245,9 @@ void update_topo_model(Event_t event)
     } else if(!strcmp((char *) event.key, "UE_moving_dynamics_max_journey_time_ms")) {
       LOG_I(EMU,"UE_moving_dynamics_max_journey_time_ms %G\n",oai_emulation->topology_config.mobility.UE_mobility.UE_moving_dynamics.max_journey_time_ms);
     } else if(!strcmp((char *) event.key, "grid_map_horizontal_grid")) {
-      LOG_I(EMU,"grid_map_horizontal_grid %G\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.horizontal_grid);
+      LOG_I(EMU,"grid_map_horizontal_grid %d\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.horizontal_grid);
     } else if(!strcmp((char *) event.key, "grid_map_vertical_grid")) {
-      LOG_I(EMU,"grid_map_vertical_grid %G\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.vertical_grid);
+      LOG_I(EMU,"grid_map_vertical_grid %d\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.vertical_grid);
     } else if(!strcmp((char *) event.key, "UE_initial_distribution_selected_option")) {
       LOG_I(EMU,"UE_initial_distribution_selected_option %s\n",oai_emulation->topology_config.mobility.UE_mobility.UE_initial_distribution.selected_option);
     } else if(!strcmp((char *) event.key, "random_UE_distribution_number_of_nodes")) {
diff --git a/targets/SIMU/USER/oaisim.c b/targets/SIMU/USER/oaisim.c
index c783ebe0755aac4fecb45565d2e612c90215d8c8..d07cd759d1c84885d0987b1bc38865bb7e46fbb3 100644
--- a/targets/SIMU/USER/oaisim.c
+++ b/targets/SIMU/USER/oaisim.c
@@ -243,7 +243,7 @@ help (void)
   printf ("-L [0-1] 0 to disable new link adaptation, 1 to enable new link adapatation\n");
   printf ("-m Gives a fixed DL mcs for eNB scheduler\n");
   printf ("-M Set the machine ID for Ethernet-based emulation\n");
-  printf ("-n Set the number of frames for the simulation\n");
+  printf ("-n Set the number of frames for the simulation. 0 for no limit\n");
   printf ("-O [enb_conf_file] eNB configuration file name\n");
   printf ("-p Set the total number of machine in emulation - valid if M is set\n");
   printf ("-P [trace type] Enable protocol analyzer. Possible values for OPT:\n");
@@ -1188,6 +1188,15 @@ 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
 
+static void print_current_directory(void)
+{
+  char dir[8192]; /* arbitrary size (should be big enough) */
+  if (getcwd(dir, 8192) == NULL)
+    printf("ERROR getting working directory\n");
+  else
+    printf("working directory: %s\n", dir);
+}
+
 /*------------------------------------------------------------------------------*/
 int
 main (int argc, char **argv)
@@ -1195,6 +1204,8 @@ main (int argc, char **argv)
 
   clock_t t;
 
+  print_current_directory();
+
   start_background_system();
 
 #ifdef SMBV
@@ -1350,6 +1361,11 @@ main (int argc, char **argv)
   LOG_N(EMU,
         ">>>>>>>>>>>>>>>>>>>>>>>>>>> OAIEMU initialization done <<<<<<<<<<<<<<<<<<<<<<<<<<\n\n");
 
+#ifndef PACKAGE_VERSION
+#  define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL"
+#endif
+  LOG_I(EMU, "Version: %s\n", PACKAGE_VERSION);
+
 #if defined(ENABLE_ITTI)
 
   // Handle signals until all tasks are terminated
diff --git a/targets/SIMU/USER/oaisim_config.c b/targets/SIMU/USER/oaisim_config.c
index e3aac4f481aec3d6723955fd956ee10183526621..70728875f590b985683821b81eaf007f1dcdc3da 100644
--- a/targets/SIMU/USER/oaisim_config.c
+++ b/targets/SIMU/USER/oaisim_config.c
@@ -468,7 +468,7 @@ int ocg_config_env(void)
       oai_emulation.info.frame_type[CC_id] = map_str_to_int(frame_type_names, oai_emulation.info.frame_type_name[CC_id]);
 
       if (oai_emulation.info.frame_type[CC_id] == -1) {
-        LOG_E(EMU,"frame type incorrect %s, set it to TDD \n",oai_emulation.info.frame_type_name);
+        LOG_E(EMU,"frame type incorrect %s, set it to TDD \n",oai_emulation.info.frame_type_name[CC_id]);
         oai_emulation.info.frame_type[CC_id]=TDD;
       } else
         LOG_I(EMU,"Frame type is %s \n",oai_emulation.info.frame_type_name[CC_id]);
@@ -478,7 +478,7 @@ int ocg_config_env(void)
           LOG_E(EMU,"TDD config %d out of range, set it to 3\n",oai_emulation.info.tdd_config[CC_id]);
           oai_emulation.info.tdd_config[CC_id]=3;
         } else
-          LOG_I(EMU,"TDD config is set to \n",oai_emulation.info.tdd_config[CC_id]);
+          LOG_I(EMU,"TDD config is set to %d\n",oai_emulation.info.tdd_config[CC_id]);
       }
     }
   }
@@ -1087,8 +1087,8 @@ int ocg_config_app(void)
               oai_emulation.application_config.customized_traffic.holding_time_pe_off[customized_traffic_config_index];
 
 
-            LOG_I(OTG,"customized:: OCG_config_OTG: (2) FORMAT (%d:%d) source = %d, dest = %d, dist type for size = %d start/duration %d/%d\n", source_id_start, source_id_end, source_id_index,
-                  destination_id_index, g_otg->size_dist[source_id_index][destination_id_index][0],
+            LOG_I(OTG,"customized:: OCG_config_OTG: (2) FORMAT (%s:%s) source = %d, dest = %d, dist type for size = %d [TODO: check code, printed value may not be correct, checks the indexes of the arry access] start/duration %d/%d\n", source_id_start, source_id_end, source_id_index,
+                  destination_id_index, g_otg->size_dist[source_id_index][destination_id_index][0][0],
                   g_otg->flow_start[source_id_index][destination_id_index][g_otg->application_idx[source_id_index][destination_id_index]],
                   g_otg->flow_duration[source_id_index][destination_id_index][g_otg->application_idx[source_id_index][destination_id_index]]);
             per_source_id = strtok(NULL, comma);
diff --git a/targets/SIMU/USER/oaisim_functions.c b/targets/SIMU/USER/oaisim_functions.c
index 8f357458ec7cc610a9bf6d975f8e113d598db3e4..71304aea8ece1c2e35a4a1f9ffbb35b121e2a29c 100644
--- a/targets/SIMU/USER/oaisim_functions.c
+++ b/targets/SIMU/USER/oaisim_functions.c
@@ -1050,15 +1050,15 @@ int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void *
 
   *ptimestamp = last_eNB_rx_timestamp[eNB_id][CC_id];
 
-  LOG_D(EMU,"eNB_trx_read nsamps %d TS(%llu,%llu) => subframe %d\n",nsamps,
-        (unsigned long long)current_eNB_rx_timestamp[eNB_id][CC_id],
-        (unsigned long long)last_eNB_rx_timestamp[eNB_id][CC_id],
-	(*ptimestamp/PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.samples_per_tti)%10);
+  LOG_D(EMU,"eNB_trx_read nsamps %d TS(%"PRId64",%"PRId64") => subframe %d\n",nsamps,
+        current_eNB_rx_timestamp[eNB_id][CC_id],
+        last_eNB_rx_timestamp[eNB_id][CC_id],
+	(int)((*ptimestamp/PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.samples_per_tti)%10));
   // if we're at a subframe boundary generate UL signals for this eNB
 
   while (nsamps) {
     while (current_eNB_rx_timestamp[eNB_id][CC_id] == last) {
-      LOG_D(EMU,"eNB: current TS %llu, last TS %llu, sleeping\n",current_eNB_rx_timestamp[eNB_id][CC_id],last_eNB_rx_timestamp[eNB_id][CC_id]);
+      LOG_D(EMU,"eNB: current TS %"PRId64", last TS %"PRId64", sleeping\n",current_eNB_rx_timestamp[eNB_id][CC_id],last_eNB_rx_timestamp[eNB_id][CC_id]);
       usleep(500);
     }
 
@@ -1126,7 +1126,7 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
       usleep(500);
     }
     while (current_UE_rx_timestamp[UE_id][CC_id] == last) {
-      LOG_D(EMU,"UE_trx_read : current TS %d, last TS %d, sleeping\n",current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]);
+      LOG_D(EMU,"UE_trx_read : current TS %"PRId64", last TS %"PRId64", sleeping\n",current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]);
 
       usleep(500);
     }
@@ -1486,7 +1486,7 @@ void init_ocm(void)
     break;
 
   case TDD:
-    frame_type = "FDD";
+    frame_type = "TDD";
     break;
   }