diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d0f7aaf76f..2a59202686 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -8,6 +8,8 @@ job1:
- echo $EXTERNAL_SHARE_DIR
- echo $SHELL
- echo $OAI_TEST_CASE_GROUP
+ - echo $MACHINELIST
+ - echo $MACHINELISTGENERIC
- git rev-parse --abbrev-ref HEAD
- git_repo=`git config --get remote.origin.url`
- git_head=`git rev-parse HEAD`
@@ -25,8 +27,8 @@ job1:
- echo $NRUNS_LTE_SOFTMODEM
- echo $TIMEOUT_CMD
- mkdir -p $OPENAIR_DIR/cmake_targets/autotests/log
- - python $OPENAIR_DIR/cmake_targets/autotests/run_exec_lte-softmodem_tests.py -c -5GRepo $git_repo -5GRepoHeadVersion $git_head -n $NFS_SHARE_DIR -u $OAI_USER -p $OAI_PASS $OAI_EXTRA_ARGS -g "$OAI_TEST_CASE_GROUP">& $OPENAIR_DIR/cmake_targets/autotests/python_autotest_cleanup.log
- - python $OPENAIR_DIR/cmake_targets/autotests/run_exec_lte-softmodem_tests.py -r -5GRepo $git_repo -5GRepoHeadVersion $git_head -n $NFS_SHARE_DIR -u $OAI_USER -p $OAI_PASS `echo $OAI_EXTRA_ARGS` -g "$OAI_TEST_CASE_GROUP" --nrun_lte_softmodem $NRUNS_LTE_SOFTMODEM --timeout_cmd $TIMEOUT_CMD >& $OPENAIR_DIR/cmake_targets/autotests/python_autotest.log
+ - python $OPENAIR_DIR/cmake_targets/autotests/run_exec_lte-softmodem_tests.py -c -5GRepo $git_repo -MachineList "$MACHINELIST" -MachineListGeneric "$MACHINELISTGENERIC" -5GRepoHeadVersion $git_head -n $NFS_SHARE_DIR -u $OAI_USER -p $OAI_PASS $OAI_EXTRA_ARGS -g "$OAI_TEST_CASE_GROUP">& $OPENAIR_DIR/cmake_targets/autotests/python_autotest_cleanup.log
+ - python $OPENAIR_DIR/cmake_targets/autotests/run_exec_lte-softmodem_tests.py -r -5GRepo $git_repo -MachineList "$MACHINELIST" -MachineListGeneric "$MACHINELISTGENERIC" -5GRepoHeadVersion $git_head -n $NFS_SHARE_DIR -u $OAI_USER -p $OAI_PASS `echo $OAI_EXTRA_ARGS` -g "$OAI_TEST_CASE_GROUP" --nrun_lte_softmodem $NRUNS_LTE_SOFTMODEM --timeout_cmd $TIMEOUT_CMD >& $OPENAIR_DIR/cmake_targets/autotests/python_autotest.log
- mv $OPENAIR_DIR/cmake_targets/autotests/python_autotest.log $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest.log
- mv $OPENAIR_DIR/cmake_targets/autotests/python_autotest_cleanup.log $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest_cleanup.log
- sshpass -p "$OAI_PASS" rsync -az -e "ssh -o StrictHostKeyChecking=no " --rsync-path="mkdir -p $NFS_TEST_RESULTS_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$NFS_TEST_RESULTS_DIR
diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt
index 553309f237..e1396b6398 100644
--- a/cmake_targets/CMakeLists.txt
+++ b/cmake_targets/CMakeLists.txt
@@ -126,6 +126,7 @@ endmacro(add_list_string_option)
if (CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
endif()
+message("CMAKE_BUILD_TYPE is ${CMAKE_BUILD_TYPE}")
add_list_string_option(CMAKE_BUILD_TYPE "RelWithDebInfo" "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." Debug Release RelWithDebInfo MinSizeRel)
Message("Architecture is ${CMAKE_SYSTEM_PROCESSOR}")
@@ -922,7 +923,14 @@ add_library(SECU_CN ${SECU_CN_SRC})
# Scheduler
################################"
-file(GLOB SCHED_SRC ${OPENAIR1_DIR}/SCHED/*.c)
+set(SCHED_SRC
+ ${OPENAIR1_DIR}/SCHED/phy_procedures_lte_eNb.c
+ ${OPENAIR1_DIR}/SCHED/phy_procedures_lte_ue.c
+ ${OPENAIR1_DIR}/SCHED/phy_procedures_lte_common.c
+ ${OPENAIR1_DIR}/SCHED/phy_mac_stub.c
+ ${OPENAIR1_DIR}/SCHED/pucch_pc.c
+ ${OPENAIR1_DIR}/SCHED/pusch_pc.c
+)
add_library(SCHED_LIB ${SCHED_SRC})
# Layer 1
@@ -952,6 +960,7 @@ set(PHY_SRC
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pucch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/prach.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pmch.c
+ ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/pch.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/group_hopping.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/srs_modulation.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/drs_modulation.c
@@ -1624,10 +1633,9 @@ target_link_libraries (lte-softmodem -ldl
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${MIH_LIB}
-Wl,--end-group )
-
target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES})
target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${option_HW_lib} ${option_TP_lib} ${XFORMS_LIBRARIES} )
-target_link_libraries (lte-softmodem ${LIBBOOST_LIBRARIES})
+target_link_libraries (lte-softmodem ${LIBBOOST_LIBRARIES} -lboost_system) #Added manually as it is not found for some reason for USRP
target_link_libraries (lte-softmodem ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-softmodem ${T_LIB})
@@ -1662,7 +1670,7 @@ target_link_libraries (lte-softmodem-nos1
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} )
-target_link_libraries (lte-softmodem-nos1 ${LIBBOOST_LIBRARIES})
+target_link_libraries (lte-softmodem-nos1 ${LIBBOOST_LIBRARIES} -lboost_system) #Added manually as it is not found for some reason for USRP
target_link_libraries (lte-softmodem-nos1 ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-softmodem-nos1 ${T_LIB})
@@ -1685,7 +1693,7 @@ target_link_libraries(rrh_gw
UTIL LFDS
-Wl,--end-group )
target_link_libraries (rrh_gw rt pthread m )
-target_link_libraries (rrh_gw ${option_HW_lib} ${option_TP_lib} ${LIBBOOST_LIBRARIES} )
+target_link_libraries (rrh_gw ${option_HW_lib} ${option_TP_lib} ${LIBBOOST_LIBRARIES} -lboost_system ) #Added manually as it is not found for some reason for USRP
target_link_libraries (rrh_gw ${LIB_LMS_LIBRARIES})
target_link_libraries (rrh_gw ${T_LIB})
diff --git a/cmake_targets/autotests/README.txt b/cmake_targets/autotests/README.txt
index cf1e28dd05..245b235ebf 100644
--- a/cmake_targets/autotests/README.txt
+++ b/cmake_targets/autotests/README.txt
@@ -16,17 +16,22 @@ Obj.# Case# Test# Description
01 01 20 Build lte-softmodem.USRP.Rel10
01 01 21 Build lte-softmodem.EXMIMO.Rel10
01 01 22 Build lte-softmodem.BLADERF.Rel10
-01 01 23 Build lte-softmodem.ETHERNET.Rel10
+01 01 23 Build lte-softmodem.ETHERNET.Rel10 (RCC)
01 01 24 Build lte-softmodem.LMSSDR.Rel10
01 01 30 Build (dlsim.Rel10 + ulsim.Rel10 + pucchsim.Rel10 + prachsim.Rel10 + pdcchsim.Rel10 + pbchsim.Rel10 + mbmssim.Rel10
secu_knas_encrypt_eia1.Rel10 secu_kenb.Rel10 aes128_ctr_encrypt.Rel10 aes128_ctr_decrypt.Rel10 secu_knas_encrypt_eea2.Rel10
secu_knas.Rel10 secu_knas_encrypt_eea1.Rel10 kdf.Rel10 aes128_cmac_encrypt.Rel10 secu_knas_encrypt_eia2.Rel10)
-01 01 40 Build RRH Gateway for USRP (Rel 10)
-01 01 41 Build RRH Gateway for EXMIMO (Rel 10)
-01 01 42 Build RRH Gateway for BLADERF (Rel 10)
-01 01 43 Build RRH Gateway for LMSSDR (Rel 10)
+01 01 40 Build RRH Gateway (time domain) for USRP (Rel 10)
+01 01 41 Build RRH Gateway (time domain) for EXMIMO (Rel 10)
+01 01 42 Build RRH Gateway (time domain) for BLADERF (Rel 10)
+01 01 43 Build RRH Gateway (time domain) for LMSSDR (Rel 10)
+
+01 01 50 Build RRU (NGFI) for USRP (Rel 10) w/ ETHERNET transport
+01 01 51 Build RRU (NGFI) for EXMIMO (Rel 10) w/ ETHERNET transport
+01 01 52 Build RRU (NGFI) for BLADERF (Rel 10) w/ ETHERNET transport
+01 01 53 Build RRU (NGFI) for LMSSDR (Rel 10) w/ ETHERNET transport
01 02 Run OAISIM-NOS1 Rel10 (TDD + 5MHz/10MHz/20MHz + TM 1,2), and check the operation
@@ -249,4 +254,4 @@ Obj.# Case# Test# Description
#TODO: Add test cases for 10,20 MHz
#TODO: Add test cases for TDD/FDD
#TODO: Test and compile seperately for Rel8/Rel10
-#TODO: Case03.py eMBMS test case
\ No newline at end of file
+#TODO: Case03.py eMBMS test case
diff --git a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py
index b25bc08427..eed2fffb77 100755
--- a/cmake_targets/autotests/run_exec_lte-softmodem_tests.py
+++ b/cmake_targets/autotests/run_exec_lte-softmodem_tests.py
@@ -313,7 +313,7 @@ def SSHSessionWrapper(machine, username, key_file, password, logdir_remote, logd
# \param CleanUpAluLteBox program to terminate AlU Bell Labs LTE Box
# \param ExmimoRfStop String to stop EXMIMO card (specified in test_case_list.xml)
def cleanOldPrograms(oai, programList, CleanUpAluLteBox, ExmimoRfStop, logdir, logdirOAI5GRepo):
- cmd = 'killall -9 -q -r ' + programList
+ cmd = 'sudo -E killall -9 -q -r ' + programList
result = oai.send(cmd, True)
print "Killing old programs..." + result
programArray = programList.split()
@@ -1020,6 +1020,13 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
run_result=0
run_result_string = ' RUN_'+str(run) + ' = FAIL(Thread_Busy)'
+ #If there is Segmentation fault, we mark the test case as failure as most likely eNB crashed
+ cmd = "grep -ilr \"segmentation fault\" " + logdir_local_testcase + " | cat "
+ cmd_out = subprocess.check_output ([cmd], shell=True)
+ if len(cmd_out) !=0:
+ run_result=0
+ run_result_string = ' RUN_'+str(run) + ' = FAIL(SEGFAULT)'
+
run_result_string = run_result_string + tput_run_string
test_result=test_result & run_result
@@ -1261,7 +1268,8 @@ except KeyError:
sys.exit(1)
print "Killing zombie ssh sessions from earlier sessions..."
-cmd='ps aux |grep \"/usr/bin/ssh -q -l guptar\"|tr -s \" \" :|cut -f 2 -d :|xargs kill -9 '
+cmd='ps aux |grep \"/usr/bin/ssh -q -l guptar\"| awk \'{print $2}\' | sudo xargs kill -9 '
+
os.system(cmd)
if flag_start_testcase == False:
@@ -1426,13 +1434,25 @@ for oai in oai_list:
setuplogfile = logdir + '/setup_log_' + MachineList[index] + '_.txt'
setup_script = locallogdir + '/setup_script_' + MachineList[index] + '_.txt'
+
+ #Sometimes git fails so the script below retries in that case
+ localfile = os.path.expandvars('$OPENAIR_DIR/cmake_targets/autotests/tools/git-retry.sh')
+ remotefile = logdir + '/git-retry.sh'
+ paramList=[]
+ port=22
+ paramList.append ( {"operation":'put', "localfile":localfile, "remotefile":remotefile} )
+ sftp_log = os.path.expandvars(locallogdir + '/sftp_module.log')
+ sftp_module (user, pw, MachineList[index], port, paramList, sftp_log)
+
+
cmd = ' ( \n'
#cmd = cmd + 'rm -fR ' + logdir + '\n'
#cmd = cmd + 'mkdir -p ' + logdir + '\n'
cmd = cmd + 'cd '+ logdir + '\n'
- cmd = cmd + 'git config --global http.sslVerify false \n'
- cmd = cmd + 'git clone '+ GitOAI5GRepo +' \n'
- cmd = cmd + 'git clone '+ GitOpenaircnRepo + ' \n'
+ cmd = cmd + 'sudo apt-get install -y git \n'
+ cmd = cmd + 'chmod 700 ' + logdir + '/git-retry.sh \n'
+ cmd = cmd + logdir + '/git-retry.sh clone '+ GitOAI5GRepo +' \n'
+ cmd = cmd + logdir + '/git-retry.sh clone '+ GitOpenaircnRepo + ' \n'
cmd = cmd + 'cd ' + logdirOAI5GRepo + '\n'
cmd = cmd + 'git checkout ' + GitOAI5GRepoBranch + '\n'
#cmd = cmd + 'git checkout ' + GitOAI5GHeadVersion + '\n'
diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml
index 11a0c172db..696b732fb4 100644
--- a/cmake_targets/autotests/test_case_list.xml
+++ b/cmake_targets/autotests/test_case_list.xml
@@ -1,18 +1,18 @@
-mozart tique stevens amerique
+mozart hutch starsky stevens amerique calisson nano
/mnt/sradio/TEST_RESULTS/
https://gitlab.eurecom.fr/oai/openairinterface5g.git
https://gitlab.eurecom.fr/oai/openair-cn.git
develop
develop
- 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
+ oaisim oaisim_nos1 lte-softmodem lte-softmodem-nos1 mme_gw run_epc auth_request run_hss oai_hss mme spgw hss hss_sim configure_cots* wvdial iperf iperf_script iperf_script_phone ping tshark rrh_gw iperf3 iperf3_script iperf3_script_phone pppd starthss start_ltebox stop_ltebox configure_cots_sony_experia_m4_ue configure_cots_huaweiE398_ue configure_cots_bandrich_ue
sudo -S -E /opt/ltebox/tools/stop_ltebox
-$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
+exmimo_pci=`lspci -m | grep Xilinx`; if [ -n "$exmimo_pci" ] ; then $OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; fi; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py --reset-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue; uname -a; sudo -E dmesg
36000
- 010141 0102+ 010304 010305 0104+ 015506 015507 015508 015509 015510 015511 015602 015605 015702 015705 016102 016105 016502 016505 017002 017005 017502 017505 018002 018005 018502 018505
+ 010141 0102+ 010304 010305 0104+ 015506 015507 015508 015509 015510 015511 015602 015605 015702 015705 016102 016105 016502 016505 017002 017005 017502 017505 018002 018005
3
- mozart tique stevens amerique
+ mozart hutch starsky stevens amerique calisson
compilation
Build oaisim.Rel8
@@ -381,6 +381,85 @@
1
+
+ compilation
+ Build RRU (NGFI) for USRP (Rel 10) w/ ETHERNET transport
+
+ $OPENAIR_DIR/cmake_targets/build_oai
+ --eNB -w USRP -t ETHERNET -c
+ $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/lte_build_oai/build/liboai_usrpdevif.so
+ $OPENAIR_DIR/cmake_targets/lte_build_oai/build/liboai_eth_transpro.so
+ $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
+
+
+
+
+
+ RRU.USRP.Rel10
+ 1
+
+
+
+ compilation
+ Build RRU (NGFI) for EXMIMO (Rel 10) w/ ETHERNET transport
+
+ $OPENAIR_DIR/cmake_targets/build_oai
+ --eNB -w EXMIMO -t ETHERNET -c
+ $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/lte_build_oai/build/CMakeFiles/openair_rf/openair_rf.ko
+ $OPENAIR_DIR/cmake_targets/lte_build_oai/build/updatefw
+ $OPENAIR_DIR/cmake_targets/lte_build_oai/build/oarf_config_exmimo.oct
+ $OPENAIR_DIR/cmake_targets/lte_build_oai/build/liboai_exmimodevif.so
+ $OPENAIR_DIR/cmake_targets/lte_build_oai/build/liboai_eth_transpro.so
+ $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
+
+
+
+
+
+ RRU.EXMIMO.Rel10
+ 1
+
+
+
+ compilation
+ Build RRU (NGFI) for BLADERF (Rel 10) w/ ETHERNET transport
+
+ $OPENAIR_DIR/cmake_targets/build_oai
+ --eNB -w BLADERF -t ETHERNET -c
+ $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/lte_build_oai/build/liboai_bladerfdevif.so
+ $OPENAIR_DIR/cmake_targets/lte_build_oai/build/liboai_eth_transpro.so
+ $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
+
+
+
+
+
+ RRU.BLADERF.Rel10
+ 1
+
+
+
+ compilation
+ Build RRU (NGFI) for LMSSDR (Rel 10) w/ ETHERNET transport
+
+ $OPENAIR_DIR/cmake_targets/build_oai
+ --eNB -w LMSSDR -t ETHERNET -c
+ $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/lte_build_oai/build/liboai_lmssdrdevif.so
+ $OPENAIR_DIR/cmake_targets/lte_build_oai/build/liboai_eth_transpro.so
+ $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
+
+
+
+
+
+ RRU.LMSSDR.Rel10
+ 1
+
+
execution
Run OAISIM Rel10 TDD, 1 eNB + 1 UE (5 MHz/10MHz/20MHz), (TM 1,2) and search for errors, segmentation fault or exit
@@ -929,7 +1008,7 @@
lte-softmodem
- tique
+ hutch
stevens
amerique
390
@@ -946,16 +1025,16 @@
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -1004,7 +1083,7 @@
lte-softmodem
- tique
+ hutch
stevens
amerique
390
@@ -1021,16 +1100,16 @@
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -1078,7 +1157,7 @@
lte-softmodem
- tique
+ hutch
stevens
amerique
390
@@ -1096,17 +1175,17 @@
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
- -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ -E -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -1153,7 +1232,7 @@
lte-softmodem
- tique
+ hutch
stevens
amerique
390
@@ -1170,16 +1249,16 @@
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -1226,7 +1305,7 @@
lte-softmodem
- tique
+ hutch
stevens
amerique
390
@@ -1243,16 +1322,16 @@
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -1299,7 +1378,7 @@
lte-softmodem
- tique
+ hutch
stevens
amerique
390
@@ -1317,17 +1396,17 @@
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
- -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ -E -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -1375,7 +1454,7 @@
lte-softmodem
- calisson
+ hutch
stevens
amerique
390
@@ -1392,16 +1471,16 @@
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 2
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 2
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -1450,7 +1529,7 @@
lte-softmodem
- calisson
+ hutch
stevens
amerique
390
@@ -1467,16 +1546,16 @@
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 2
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 2
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -1523,7 +1602,7 @@
lte-softmodem
- calisson
+ hutch
stevens
amerique
390
@@ -1540,16 +1619,16 @@
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 2
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 2
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -1597,7 +1676,7 @@
lte-softmodem
- calisson
+ hutch
stevens
amerique
390
@@ -1614,16 +1693,16 @@
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 2
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 2
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -1671,7 +1750,7 @@
lte-softmodem
- calisson
+ hutch
stevens
amerique
390
@@ -1688,16 +1767,16 @@
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 2
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 2
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -1745,7 +1824,7 @@
lte-softmodem
- calisson
+ hutch
stevens
amerique
390
@@ -1762,17 +1841,17 @@
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 2
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 2
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth5\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.82/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth5\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.82/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
- -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ -E -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -1819,7 +1898,7 @@
lte-softmodem
- tique
+ hutch
stevens
amerique
390
@@ -1836,16 +1915,16 @@
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -1894,7 +1973,7 @@
lte-softmodem
- tique
+ hutch
stevens
amerique
390
@@ -1911,16 +1990,16 @@
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -1968,7 +2047,7 @@
lte-softmodem
- tique
+ hutch
stevens
amerique
390
@@ -1986,17 +2065,17 @@
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
- -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ -E -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -2043,7 +2122,7 @@
lte-softmodem
- tique
+ hutch
stevens
amerique
390
@@ -2060,16 +2139,16 @@
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -2116,7 +2195,7 @@
lte-softmodem
- tique
+ hutch
stevens
amerique
390
@@ -2133,16 +2212,16 @@
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -2189,7 +2268,7 @@
lte-softmodem
- tique
+ hutch
stevens
amerique
390
@@ -2207,17 +2286,17 @@
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
- -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ -E -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -3314,7 +3393,6 @@ c
sudo mkdir -p /usr/local/etc/oai/freeDiamter; sudo cp -vf $OPENAIRCN_DIR/ETC/hss.conf /usr/local/etc/oai ; sudo cp -vf $OPENAIRCN_DIR/ETC/hss_fd.conf /usr/local/etc/oai/freeDiameter ; $OPENAIRCN_DIR/SCRIPTS/check_hss_s6a_certificate /usr/local/etc/oai/freeDiameter/ hss.openair4G.eur; $OPENAIRCN_DIR/SCRIPTS/build_hss -c
-c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E ifconfig eth0 add 192.172.0.1
sleep 10;$OPENAIRCN_DIR/TEST/autotests/tools/run_epc
@@ -3358,7 +3436,7 @@ c
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf
@@ -3430,7 +3508,7 @@ c
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf
@@ -3502,7 +3580,7 @@ c
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf
@@ -3574,7 +3652,7 @@ c
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf
@@ -3645,7 +3723,7 @@ c
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail
sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf
@@ -3717,7 +3795,7 @@ c
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf
@@ -3788,7 +3866,7 @@ c
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf
@@ -3860,7 +3938,7 @@ c
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf
@@ -3932,7 +4010,7 @@ c
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf
@@ -4004,7 +4082,7 @@ c
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf
@@ -4075,7 +4153,7 @@ c
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail
sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf
@@ -4147,7 +4225,7 @@ c
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/configure_usrpb210.py --stop-usrpb210 ; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf
@@ -4220,7 +4298,7 @@ c
--eNB -w USRP -x -c
sleep 15; $OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash ; sudo -E -S /usr/local/bin/niusrprio_pcie start ; dmesg|tail ; cp $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf $OPENAIR_TESTDIR/enb.conf
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpx310.conf
@@ -7015,7 +7093,7 @@ c
lte-softmodem
- tique
+ hutch
stevens
amerique
390
@@ -7032,16 +7110,16 @@ c
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -7090,7 +7168,7 @@ c
lte-softmodem
- tique
+ hutch
stevens
amerique
390
@@ -7107,16 +7185,16 @@ c
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -7164,7 +7242,7 @@ c
lte-softmodem
- tique
+ hutch
stevens
amerique
390
@@ -7182,17 +7260,17 @@ c
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
- -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -E
@@ -7239,7 +7317,7 @@ c
lte-softmodem
- tique
+ hutch
stevens
amerique
390
@@ -7256,17 +7334,17 @@ c
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
- -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -7313,7 +7391,7 @@ c
lte-softmodem
- tique
+ hutch
stevens
amerique
390
@@ -7330,16 +7408,16 @@ c
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -7387,7 +7465,7 @@ c
lte-softmodem
- tique
+ hutch
stevens
amerique
390
@@ -7405,17 +7483,17 @@ c
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
- -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf -E
@@ -7462,7 +7540,7 @@ c
lte-softmodem
- tique
+ hutch
stevens
amerique
390
@@ -7479,16 +7557,16 @@ c
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -7537,7 +7615,7 @@ c
lte-softmodem
- tique
+ hutch
stevens
amerique
390
@@ -7554,16 +7632,16 @@ c
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -7611,7 +7689,7 @@ c
lte-softmodem
- tique
+ hutch
stevens
amerique
390
@@ -7629,17 +7707,17 @@ c
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
- -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ -E -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -7686,7 +7764,7 @@ c
lte-softmodem
- tique
+ hutch
stevens
amerique
390
@@ -7703,16 +7781,16 @@ c
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
-O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -7760,7 +7838,7 @@ c
lte-softmodem
- tique
+ hutch
stevens
amerique
390
@@ -7777,17 +7855,17 @@ c
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
- -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ -E -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -7834,7 +7912,7 @@ c
lte-softmodem
- tique
+ hutch
stevens
amerique
390
@@ -7852,17 +7930,17 @@ c
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf frame_type \"FDD\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_rx 1
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf nb_antennas_tx 1
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.147/24\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth1\"
- targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.147/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1_MME \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1_MME \"192.168.12.19/24\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_INTERFACE_NAME_FOR_S1U \"eth0\"
+ targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_IPV4_ADDRESS_FOR_S1U \"192.168.12.19/24\"
targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf ENB_PORT_FOR_S1U 2152
$OPENAIR_DIR/cmake_targets/build_oai
--eNB -w USRP -x -c
$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash
- $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
- -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
+ $OPENAIR_DIR/cmake_targets/autotests/tools/run_gdb $OPENAIR_DIR/cmake_targets/lte_build_oai/build/lte-softmodem
+ -E -O $OPENAIR_DIR/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.usrpb210.conf
@@ -7909,7 +7987,3 @@ c
-
-
-
-
diff --git a/cmake_targets/autotests/tools/git-retry.sh b/cmake_targets/autotests/tools/git-retry.sh
new file mode 100755
index 0000000000..b897ba379d
--- /dev/null
+++ b/cmake_targets/autotests/tools/git-retry.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+#Simple script to retry git clone in case of failure
+
+REALGIT=/usr/bin/git
+
+RETRIES=10
+DELAY=10
+COUNT=1
+while [ $COUNT -lt $RETRIES ]; do
+ $REALGIT $* >> git-clone-`hostname`-log.txt 2>&1
+ if [ $? -eq 0 ]; then
+ RETRIES=0
+ break
+ fi
+ let COUNT=$COUNT+1
+ sleep $DELAY
+done
diff --git a/cmake_targets/autotests/tools/remove_old_programs.bash b/cmake_targets/autotests/tools/remove_old_programs.bash
index 772ba11f58..c5c26e3752 100755
--- a/cmake_targets/autotests/tools/remove_old_programs.bash
+++ b/cmake_targets/autotests/tools/remove_old_programs.bash
@@ -1,7 +1,32 @@
#!/bin/bash
#$1 programs to be killed and checked
-var=`ps -A |grep -E -i $1`
+echo "removing old programs..."
+echo "args = $1"
+echo "script name = $0"
+filename=$(basename "$0")
+echo "filename = $filename"
+echo "programs to be killed...$1"
+
+echo "bash PID = $$"
+pid="$$"
+echo "pid = $pid"
+
+echo "Killing programs now..."
+
+ps -aux |grep -E -i -w "$1"
+
+var=`ps -aux |grep -E -i -w "$1" |awk '{print $2}'| tr '\n' ' ' | sed "s/$pid/ /"`
+echo "Killing processes...$var"
+#var=`ps -aux |grep -E -i '$1' |awk '{print $2}'| tr '\n' ' ' | sed "s/$pid/ /"`
+#echo $var
+if [ -n "$var" ] ; then sudo kill -9 $var ; fi
+
+#| sudo xargs kill -9
+
+echo "checking for old programs..."
+var=`ps -aux |grep -E -i -w '$1' |grep -Ev 'grep' | grep -Ev '$filename'`
+
echo $var
if [ -n "$var" ]; then echo 'Match found'; else echo 'Match not found' ;fi
diff --git a/cmake_targets/autotests/tools/run_gdb b/cmake_targets/autotests/tools/run_gdb
new file mode 100755
index 0000000000..a12d6ce21d
--- /dev/null
+++ b/cmake_targets/autotests/tools/run_gdb
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+#arg0 -> Name of executable
+#args[1...N] -> arguments to be passed to executable
+if [ -z "$OPENAIR_DIR" ]
+then
+ echo "OPENAIR_DIR environment not set. Exiting.."
+ exit
+fi
+
+source $OPENAIR_DIR/cmake_targets/tools/build_helper
+
+args=($*)
+exec_name=${args[0]}
+exe_args=(${args[@]:1})
+gdb_file=$OPENAIR_DIR/targets/bin/gdb_file
+gdb_log=$OPENAIR_DIR/targets/bin/gdb_log.bt
+
+echo "args = ${args[@]}"
+echo "exec_name = $exec_name"
+echo "exe_args = ${exe_args[@]}"
+echo "gdb log file = $gdb_log"
+
+$SUDO rm -fr $gdb_file $gdb_log
+$SUDO touch $gdb_file $gdb_log
+$SUDO chmod 777 $gdb_file $gdb_log
+
+$SUDO echo "file $exec_name" >> $gdb_file
+$SUDO echo "set args ${exe_args[@]}" >> $gdb_file
+$SUDO echo "run" >> $gdb_file
+$SUDO echo "set logging overwrite on" >> $gdb_file
+$SUDO echo "set logging file $gdb_log" >> $gdb_file
+$SUDO echo "set logging on" >> $gdb_file
+$SUDO echo "set pagination off" >> $gdb_file
+$SUDO echo "handle SIG33 pass nostop noprint" >> $gdb_file
+$SUDO echo "echo backtrace:\n" >> $gdb_file
+$SUDO echo "backtrace full" >> $gdb_file
+$SUDO echo "echo \n\nVariables:\n" >> $gdb_file
+$SUDO echo "info variables" >> $gdb_file
+$SUDO echo "echo \n\nlocals:\n" >> $gdb_file
+$SUDO echo "info locals" >> $gdb_file
+$SUDO echo "echo \n\nregisters:\n" >> $gdb_file
+$SUDO echo "info registers" >> $gdb_file
+$SUDO echo "echo \n\ncurrent instructions:\n" >> $gdb_file
+$SUDO echo "x/16i \$pc" >> $gdb_file
+$SUDO echo "echo \n\nthreads backtrace:\n" >> $gdb_file
+$SUDO echo "thread apply all backtrace" >> $gdb_file
+$SUDO echo "set logging off" >> $gdb_file
+$SUDO echo "quit" >> $gdb_file
+
+echo "Contents of gdb_file...start"
+$SUDO cat $gdb_file
+echo "Contents of gdb_file...finish"
+
+$SUDO gdb -n -x $gdb_file 2>&1
+
diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai
index 7ff2673b6b..967c92f557 100755
--- a/cmake_targets/build_oai
+++ b/cmake_targets/build_oai
@@ -61,6 +61,7 @@ TEST_CASE_GROUP=""
BUILD_DOXYGEN=0
T_TRACER="False"
DISABLE_HARDWARE_DEPENDENCY="False"
+CMAKE_BUILD_TYPE=""
trap handle_ctrl_c INT
function print_help() {
@@ -82,7 +83,7 @@ Options
--install-optional-packages
Install useful but not mandatory packages such as valgrind
-g | --run-with-gdb
- Add debugging symbols to compilation directives
+ Add debugging symbols to compilation directives. It also disables any compiler optimization.
-h | --help
Print this help
--eNB
@@ -170,7 +171,8 @@ function main() {
shift;;
-g | --run-with-gdb)
GDB=1
- echo_info "Will Compile with gdb symbols"
+ CMAKE_BUILD_TYPE="Debug"
+ echo_info "Will Compile with gdb symbols and disable compiler optimization"
shift;;
--eNB)
eNB=1
@@ -443,6 +445,7 @@ function main() {
if [ "$NOS1" = "1" ] ; then
cat $DIR/$lte_build_dir/CMakeLists.template >> $cmake_file
fi
+ echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file
echo "set ( XFORMS $XFORMS )" >> $cmake_file
echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
@@ -568,6 +571,8 @@ function main() {
cp $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 $dbin
fi
+ # oaisim compilation
+ ###############
if [ "$oaisim" = "1" ] ; then
dconf=$OPENAIR_DIR/targets/bin
if [ "$NOS1" = "1" ] ; then
@@ -581,6 +586,7 @@ function main() {
echo_info "Compiling $oaisim_exec ($oaisim_build_dir)"
cmake_file=$DIR/$oaisim_build_dir/CMakeLists.txt
cp $DIR/$oaisim_build_dir/CMakeLists.template $cmake_file
+ echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file
echo "set ( XFORMS $XFORMS )" >> $cmake_file
echo "set ( PRINT_STATS $PRINT_STATS )" >> $cmake_file
@@ -649,9 +655,10 @@ function main() {
cmake_file=$DIR/oaisim_mme_build_oai/CMakeLists.txt
cp $DIR/oaisim_mme_build_oai/CMakeLists.template $cmake_file
- echo "set(XFORMS $XFORMS )" >> $cmake_file
- echo "set(RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
- echo "set(ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
+ echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
+ echo "set ( XFORMS $XFORMS )" >> $cmake_file
+ echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
+ echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
echo "set ( T_TRACER $T_TRACER )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
#[ "$CLEAN" = "1" ] && rm -rf $DIR/oaisim_mme_build_oai/build
@@ -676,13 +683,14 @@ function main() {
mkdir -p $DIR/$rrh_build_dir/build
cmake_file=$DIR/$rrh_build_dir/CMakeLists.txt
echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file
- echo "set(ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
- echo "set(ENABLE_ITTI False )" >> $cmake_file
- echo "set(RF_BOARD \"${HW}\")" >> $cmake_file
- echo "set(TRANSP_PRO \"${TP}\")" >> $cmake_file
- echo 'set(PACKAGE_NAME "\"rrh_gw\"")' >> $cmake_file
- echo "set (DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )" >>$cmake_file
- echo "set (CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >>$cmake_file
+ echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
+ echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
+ echo "set ( ENABLE_ITTI False )" >> $cmake_file
+ echo "set ( RF_BOARD \"${HW}\")" >> $cmake_file
+ echo "set ( TRANSP_PRO \"${TP}\")" >> $cmake_file
+ echo 'set ( PACKAGE_NAME "\"rrh_gw\"")' >> $cmake_file
+ echo "set ( DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )" >>$cmake_file
+ echo "set ( CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >>$cmake_file
echo "set ( T_TRACER $T_TRACER )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
cd $DIR/$rrh_build_dir/build
diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper
index 19ebe9e30f..94e80e2358 100755
--- a/cmake_targets/tools/build_helper
+++ b/cmake_targets/tools/build_helper
@@ -318,7 +318,6 @@ check_install_oai_software() {
libxml2 \
libxml2-dev \
libxslt1-dev \
- linux-headers-`uname -r` \
mscgen \
octave \
octave-signal \
@@ -333,7 +332,8 @@ check_install_oai_software() {
wget
$SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so
- $SUDO apt-get install libgnutls-dev nettle-dev nettle-bin
+ $SUDO apt-get install libgnutls-dev nettle-dev nettle-bin
+
install_asn1c_from_source
}
@@ -341,13 +341,9 @@ install_asn1c_from_source(){
asn1_install_log=$OPENAIR_DIR/cmake_targets/log/asn1c_install_log.txt
echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_log "
(
- $SUDO rm -rf /tmp/asn1c-r1516
- svn co https://github.com/vlm/asn1c/trunk /tmp/asn1c-r1516 -r 1516
- cd /tmp/asn1c-r1516
- patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch.p0
- patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_2.p0
- patch -p0 < $OPENAIR_DIR/openair2/RRC/LITE/MESSAGES/asn1c/asn1cpatch.p0
- patch -p0 < $OPENAIR_DIR/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0
+ $SUDO rm -rf /tmp/asn1c
+ git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c
+ cd /tmp/asn1c
./configure
make -j`nproc`
$SUDO make install
diff --git a/cmake_targets/tools/run_enb_ue_virt_s1 b/cmake_targets/tools/run_enb_ue_virt_s1
index 8f7255332a..9f325c7243 100755
--- a/cmake_targets/tools/run_enb_ue_virt_s1
+++ b/cmake_targets/tools/run_enb_ue_virt_s1
@@ -252,7 +252,7 @@ function main()
# Check table 200 lte in /etc/iproute2/rt_tables
fgrep lte /etc/iproute2/rt_tables > /dev/null
if [ $? -ne 0 ]; then
- bash -c echo "200 lte " >> /etc/iproute2/rt_tables
+ echo "200 lte " >> /etc/iproute2/rt_tables
fi
ip rule add fwmark 1 table lte
ifconfig oip1 up
diff --git a/common/utils/T/.gitignore b/common/utils/T/.gitignore
index a52d9a3667..f5724e6ff8 100644
--- a/common/utils/T/.gitignore
+++ b/common/utils/T/.gitignore
@@ -9,4 +9,5 @@ tracer/record
tracer/replay
tracer/textlog
tracer/vcd
+tracer/macpdu2wireshark
tracee/tracee
diff --git a/common/utils/T/tracer/Makefile b/common/utils/T/tracer/Makefile
index ee289aae59..71f1d25f92 100644
--- a/common/utils/T/tracer/Makefile
+++ b/common/utils/T/tracer/Makefile
@@ -5,7 +5,7 @@ CFLAGS=-Wall -g -pthread -DT_TRACER -I.
LIBS=-lX11 -lm -lpng -lXft
-all: record replay extract_config textlog enb vcd
+all: record replay extract_config textlog enb vcd macpdu2wireshark
record: utils.o record.o database.o config.o
$(CC) $(CFLAGS) -o record $^ $(LIBS)
@@ -31,6 +31,10 @@ vcd: utils.o vcd.o database.o event.o handler.o config.o \
filter/filter.a
$(CC) $(CFLAGS) -o vcd $^ $(LIBS)
+macpdu2wireshark: macpdu2wireshark.o database.o utils.o handler.o event.o \
+ config.o
+ $(CC) $(CFLAGS) -o $@ $^ $(LIBS)
+
.PHONY: all gui/gui.a view/view.a logger/logger.a filter/filter.a
gui/gui.a:
@@ -50,7 +54,7 @@ filter/filter.a:
clean:
rm -f *.o core tracer_remote textlog enb vcd record replay
- rm -f extract_config
+ rm -f extract_config macpdu2wireshark
cd gui && make clean
cd view && make clean
cd logger && make clean
diff --git a/common/utils/T/tracer/macpdu2wireshark.c b/common/utils/T/tracer/macpdu2wireshark.c
new file mode 100644
index 0000000000..886638f5ef
--- /dev/null
+++ b/common/utils/T/tracer/macpdu2wireshark.c
@@ -0,0 +1,260 @@
+#include
+#include
+#include
+#include
+#include
+#include
+#include "database.h"
+#include "event.h"
+#include "handler.h"
+#include "config.h"
+#include "utils.h"
+#include "packet-mac-lte.h"
+
+#define DEFAULT_IP "127.0.0.1"
+#define DEFAULT_PORT 9999
+
+typedef struct {
+ int socket;
+ struct sockaddr_in to;
+ OBUF buf;
+ /* ul */
+ int ul_rnti;
+ int ul_frame;
+ int ul_subframe;
+ int ul_data;
+ /* dl */
+ int dl_rnti;
+ int dl_frame;
+ int dl_subframe;
+ int dl_data;
+} ev_data;
+
+void ul(void *_d, event e)
+{
+ ev_data *d = _d;
+ ssize_t ret;
+ int fsf;
+ int i;
+
+ d->buf.osize = 0;
+
+ PUTS(&d->buf, MAC_LTE_START_STRING);
+ PUTC(&d->buf, FDD_RADIO);
+ PUTC(&d->buf, DIRECTION_UPLINK);
+ PUTC(&d->buf, C_RNTI);
+
+ PUTC(&d->buf, MAC_LTE_RNTI_TAG);
+ PUTC(&d->buf, (e.e[d->ul_rnti].i>>8) & 255);
+ PUTC(&d->buf, e.e[d->ul_rnti].i & 255);
+
+ /* for newer version of wireshark? */
+ fsf = (e.e[d->ul_frame].i << 4) + e.e[d->ul_subframe].i;
+ /* for older version? */
+ fsf = e.e[d->ul_subframe].i;
+ PUTC(&d->buf, MAC_LTE_FRAME_SUBFRAME_TAG);
+ PUTC(&d->buf, (fsf>>8) & 255);
+ PUTC(&d->buf, fsf & 255);
+
+ PUTC(&d->buf, MAC_LTE_PAYLOAD_TAG);
+ for (i = 0; i < e.e[d->ul_data].bsize; i++)
+ PUTC(&d->buf, ((char*)e.e[d->ul_data].b)[i]);
+
+ ret = sendto(d->socket, d->buf.obuf, d->buf.osize, 0,
+ (struct sockaddr *)&d->to, sizeof(struct sockaddr_in));
+ if (ret != d->buf.osize) abort();
+}
+
+void dl(void *_d, event e)
+{
+ ev_data *d = _d;
+ ssize_t ret;
+ int fsf;
+ int i;
+
+ d->buf.osize = 0;
+
+ PUTS(&d->buf, MAC_LTE_START_STRING);
+ PUTC(&d->buf, FDD_RADIO);
+ PUTC(&d->buf, DIRECTION_DOWNLINK);
+ PUTC(&d->buf, C_RNTI);
+
+ PUTC(&d->buf, MAC_LTE_RNTI_TAG);
+ PUTC(&d->buf, (e.e[d->dl_rnti].i>>8) & 255);
+ PUTC(&d->buf, e.e[d->dl_rnti].i & 255);
+
+ /* for newer version of wireshark? */
+ fsf = (e.e[d->dl_frame].i << 4) + e.e[d->dl_subframe].i;
+ /* for older version? */
+ fsf = e.e[d->dl_subframe].i;
+ PUTC(&d->buf, MAC_LTE_FRAME_SUBFRAME_TAG);
+ PUTC(&d->buf, (fsf>>8) & 255);
+ PUTC(&d->buf, fsf & 255);
+
+ PUTC(&d->buf, MAC_LTE_PAYLOAD_TAG);
+ for (i = 0; i < e.e[d->dl_data].bsize; i++)
+ PUTC(&d->buf, ((char*)e.e[d->dl_data].b)[i]);
+
+ ret = sendto(d->socket, d->buf.obuf, d->buf.osize, 0,
+ (struct sockaddr *)&d->to, sizeof(struct sockaddr_in));
+ if (ret != d->buf.osize) abort();
+}
+
+void setup_data(ev_data *d, void *database, int ul_id, int dl_id)
+{
+ database_event_format f;
+ int i;
+
+ d->ul_rnti = -1;
+ d->ul_frame = -1;
+ d->ul_subframe = -1;
+ d->ul_data = -1;
+
+ d->dl_rnti = -1;
+ d->dl_frame = -1;
+ d->dl_subframe = -1;
+ d->dl_data = -1;
+
+#define G(var_name, var_type, var) \
+ if (!strcmp(f.name[i], var_name)) { \
+ if (strcmp(f.type[i], var_type)) goto error; \
+ var = i; \
+ continue; \
+ }
+
+ /* ul: rnti, frame, subframe, data */
+ f = get_format(database, ul_id);
+ for (i = 0; i < f.count; i++) {
+ G("rnti", "int", d->ul_rnti);
+ G("frame", "int", d->ul_frame);
+ G("subframe", "int", d->ul_subframe);
+ G("data", "buffer", d->ul_data);
+ }
+ if (d->ul_rnti == -1 || d->ul_frame == -1 || d->ul_subframe == -1 ||
+ d->ul_data == -1) goto error;
+
+ /* dl: rnti, frame, subframe, data */
+ f = get_format(database, dl_id);
+ for (i = 0; i < f.count; i++) {
+ G("rnti", "int", d->dl_rnti);
+ G("frame", "int", d->dl_frame);
+ G("subframe", "int", d->dl_subframe);
+ G("data", "buffer", d->dl_data);
+ }
+ if (d->dl_rnti == -1 || d->dl_frame == -1 || d->dl_subframe == -1 ||
+ d->dl_data == -1) goto error;
+
+#undef G
+
+ return;
+
+error:
+ printf("bad T_messages.txt\n");
+ abort();
+}
+
+void *receiver(void *_d)
+{
+ ev_data *d = _d;
+ int s;
+ char buf[100000];
+
+ s = socket(AF_INET, SOCK_DGRAM, 0);
+ if (s == -1) { perror("socket"); abort(); }
+
+ if (bind(s, (struct sockaddr *)&d->to, sizeof(struct sockaddr_in)) == -1)
+ { perror("bind"); abort(); }
+
+ while (1) {
+ if (recv(s, buf, 100000, 0) <= 0) abort();
+ }
+
+ return 0;
+}
+
+void usage(void)
+{
+ printf(
+"options:\n"
+" -d this option is mandatory\n"
+" -in read events from this dump file\n"
+" -ip send packets to this IP address (default %s)\n"
+" -p send packets to this port (default %d)\n",
+ DEFAULT_IP,
+ DEFAULT_PORT
+ );
+ exit(1);
+}
+
+int main(int n, char **v)
+{
+ char *database_filename = NULL;
+ char *input_filename = NULL;
+ void *database;
+ event_handler *h;
+ int in;
+ int i;
+ int ul_id, dl_id;
+ ev_data d;
+ char *ip = DEFAULT_IP;
+ int port = DEFAULT_PORT;
+
+ memset(&d, 0, sizeof(ev_data));
+
+ for (i = 1; i < n; i++) {
+ if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage();
+ if (!strcmp(v[i], "-d"))
+ { if (i > n-2) usage(); database_filename = v[++i]; continue; }
+ if (!strcmp(v[i], "-in"))
+ { if (i > n-2) usage(); input_filename = v[++i]; continue; }
+ if (!strcmp(v[i], "-ip")) { if (i > n-2) usage(); ip = v[++i]; continue; }
+ if (!strcmp(v[i], "-p")) {if(i>n-2)usage(); port=atoi(v[++i]); continue; }
+ usage();
+ }
+
+ if (database_filename == NULL) {
+ printf("ERROR: provide a database file (-d)\n");
+ exit(1);
+ }
+
+ if (input_filename == NULL) {
+ printf("ERROR: provide an input file (-i)\n");
+ exit(1);
+ }
+
+ in = open(input_filename, O_RDONLY);
+ if (in == -1) { perror(input_filename); return 1; }
+
+ database = parse_database(database_filename);
+ load_config_file(database_filename);
+
+ h = new_handler(database);
+
+ ul_id = event_id_from_name(database, "ENB_MAC_UE_UL_PDU_WITH_DATA");
+ dl_id = event_id_from_name(database, "ENB_MAC_UE_DL_PDU_WITH_DATA");
+ setup_data(&d, database, ul_id, dl_id);
+
+ register_handler_function(h, ul_id, ul, &d);
+ register_handler_function(h, dl_id, dl, &d);
+
+ d.socket = socket(AF_INET, SOCK_DGRAM, 0);
+ if (d.socket == -1) { perror("socket"); exit(1); }
+
+ d.to.sin_family = AF_INET;
+ d.to.sin_port = htons(port);
+ d.to.sin_addr.s_addr = inet_addr(ip);
+
+ new_thread(receiver, &d);
+
+ /* read messages */
+ while (1) {
+ char v[T_BUFFER_MAX];
+ event e;
+ e = get_event(in, v, database);
+ if (e.type == -1) break;
+ if (!(e.type == ul_id || e.type == dl_id)) continue;
+ handle_event(h, e);
+ }
+
+ return 0;
+}
diff --git a/common/utils/T/tracer/packet-mac-lte.h b/common/utils/T/tracer/packet-mac-lte.h
new file mode 100644
index 0000000000..039b9dc3c4
--- /dev/null
+++ b/common/utils/T/tracer/packet-mac-lte.h
@@ -0,0 +1,404 @@
+/* packet-mac-lte.h
+ *
+ * Martin Mathieson
+ *
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs
+ * Copyright 1998 Gerald Combs
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * This header file may also be distributed under
+ * the terms of the BSD Licence as follows:
+ *
+ * Copyright (C) 2009 Martin Mathieson. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE
+ */
+
+//#include "ws_symbol_export.h"
+
+/* radioType */
+#define FDD_RADIO 1
+#define TDD_RADIO 2
+
+/* Direction */
+#define DIRECTION_UPLINK 0
+#define DIRECTION_DOWNLINK 1
+
+/* rntiType */
+#define NO_RNTI 0
+#define P_RNTI 1
+#define RA_RNTI 2
+#define C_RNTI 3
+#define SI_RNTI 4
+#define SPS_RNTI 5
+#define M_RNTI 6
+#define SL_BCH_RNTI 7
+#define SL_RNTI 8
+#define SC_RNTI 9
+#define G_RNTI 10
+
+#if 0
+typedef enum mac_lte_oob_event {
+ ltemac_send_preamble,
+ ltemac_send_sr,
+ ltemac_sr_failure
+} mac_lte_oob_event;
+
+typedef enum mac_lte_dl_retx {
+ dl_retx_no,
+ dl_retx_yes,
+ dl_retx_unknown
+} mac_lte_dl_retx;
+
+typedef enum mac_lte_crc_status {
+ crc_fail = 0,
+ crc_success = 1,
+ crc_high_code_rate = 2,
+ crc_pdsch_lost = 3,
+ crc_duplicate_nonzero_rv = 4,
+ crc_false_dci = 5
+} mac_lte_crc_status;
+
+typedef enum mac_lte_carrier_id {
+ carrier_id_primary,
+ carrier_id_secondary_1,
+ carrier_id_secondary_2,
+ carrier_id_secondary_3,
+ carrier_id_secondary_4
+} mac_lte_carrier_id;
+
+typedef enum mac_lte_ce_mode {
+ no_ce_mode = 0,
+ ce_mode_a = 1,
+ ce_mode_b = 2
+} mac_lte_ce_mode;
+
+typedef enum mac_lte_nb_mode {
+ no_nb_mode = 0,
+ nb_mode = 1
+} mac_lte_nb_mode;
+
+/* Context info attached to each LTE MAC frame */
+typedef struct mac_lte_info
+{
+ /* Needed for decode */
+ guint8 radioType;
+ guint8 direction;
+ guint8 rntiType;
+
+ /* Extra info to display */
+ guint16 rnti;
+ guint16 ueid;
+
+ /* Timing info */
+ guint16 sysframeNumber;
+ guint16 subframeNumber;
+
+ /* Optional field. More interesting for TDD (FDD is always -4 subframeNumber) */
+ gboolean subframeNumberOfGrantPresent;
+ guint16 subframeNumberOfGrant;
+
+ /* Flag set only if doing PHY-level data test - i.e. there may not be a
+ well-formed MAC PDU so just show as raw data */
+ gboolean isPredefinedData;
+
+ /* Length of DL PDU or UL grant size in bytes */
+ guint16 length;
+
+ /* 0=newTx, 1=first-retx, etc */
+ guint8 reTxCount;
+ guint8 isPHICHNACK; /* FALSE=PDCCH retx grant, TRUE=PHICH NACK */
+
+ /* UL only. Indicates if the R10 extendedBSR-Sizes parameter is set */
+ gboolean isExtendedBSRSizes;
+
+ /* UL only. Indicates if the R10 simultaneousPUCCH-PUSCH parameter is set for PCell */
+ gboolean isSimultPUCCHPUSCHPCell;
+
+ /* UL only. Indicates if the R10 extendedBSR-Sizes parameter is set for PSCell */
+ gboolean isSimultPUCCHPUSCHPSCell;
+
+ /* Status of CRC check. For UE it is DL only. For eNodeB it is UL
+ only. For an analyzer, it is present for both DL and UL. */
+ gboolean crcStatusValid;
+ mac_lte_crc_status crcStatus;
+
+ /* Carrier ID */
+ mac_lte_carrier_id carrierId;
+
+ /* DL only. Is this known to be a retransmission? */
+ mac_lte_dl_retx dl_retx;
+
+ /* DL only. CE mode to be used for RAR decoding */
+ mac_lte_ce_mode ceMode;
+
+ /* DL and UL. NB-IoT mode of the UE */
+ mac_lte_nb_mode nbMode;
+
+ /* More Physical layer info (see direction above for which side of union to use) */
+ union {
+ struct mac_lte_ul_phy_info
+ {
+ guint8 present; /* Remaining UL fields are present and should be displayed */
+ guint8 modulation_type;
+ guint8 tbs_index;
+ guint8 resource_block_length;
+ guint8 resource_block_start;
+ guint8 harq_id;
+ gboolean ndi;
+ } ul_info;
+ struct mac_lte_dl_phy_info
+ {
+ guint8 present; /* Remaining DL fields are present and should be displayed */
+ guint8 dci_format;
+ guint8 resource_allocation_type;
+ guint8 aggregation_level;
+ guint8 mcs_index;
+ guint8 redundancy_version_index;
+ guint8 resource_block_length;
+ guint8 harq_id;
+ gboolean ndi;
+ guint8 transport_block; /* 0..1 */
+ } dl_info;
+ } detailed_phy_info;
+
+ /* Relating to out-of-band events */
+ /* N.B. dissector will only look to these fields if length is 0... */
+ mac_lte_oob_event oob_event;
+ guint8 rapid;
+ guint8 rach_attempt_number;
+ #define MAX_SRs 20
+ guint16 number_of_srs;
+ guint16 oob_ueid[MAX_SRs];
+ guint16 oob_rnti[MAX_SRs];
+} mac_lte_info;
+
+
+typedef struct mac_lte_tap_info {
+ /* Info from context */
+ guint16 rnti;
+ guint16 ueid;
+ guint8 rntiType;
+ guint8 isPredefinedData;
+ gboolean crcStatusValid;
+ mac_lte_crc_status crcStatus;
+ guint8 direction;
+
+ guint8 isPHYRetx;
+ guint16 ueInTTI;
+
+ nstime_t mac_lte_time;
+
+ /* Number of bytes (which part is used depends upon context settings) */
+ guint32 single_number_of_bytes;
+ guint32 bytes_for_lcid[11];
+ guint32 sdus_for_lcid[11];
+ guint8 number_of_rars;
+ guint8 number_of_paging_ids;
+
+ /* Number of padding bytes includes padding subheaders and trailing padding */
+ guint16 padding_bytes;
+ guint16 raw_length;
+} mac_lte_tap_info;
+
+
+/* Accessor function to check if a frame was considered to be ReTx */
+int is_mac_lte_frame_retx(packet_info *pinfo, guint8 direction);
+
+#endif
+
+/*****************************************************************/
+/* UDP framing format */
+/* ----------------------- */
+/* Several people have asked about dissecting MAC by framing */
+/* PDUs over IP. A suggested format over UDP has been created */
+/* and implemented by this dissector, using the definitions */
+/* below. A link to an example program showing you how to encode */
+/* these headers and send LTE MAC PDUs on a UDP socket is */
+/* provided at https://wiki.wireshark.org/MAC-LTE */
+/* */
+/* A heuristic dissecter (enabled by a preference) will */
+/* recognise a signature at the beginning of these frames. */
+/*****************************************************************/
+
+
+/* Signature. Rather than try to define a port for this, or make the
+ port number a preference, frames will start with this string (with no
+ terminating NULL */
+#define MAC_LTE_START_STRING "mac-lte"
+
+/* Fixed fields. This is followed by the following 3 mandatory fields:
+ - radioType (1 byte)
+ - direction (1 byte)
+ - rntiType (1 byte)
+ (where the allowed values are defined above */
+
+/* Optional fields. Attaching this info to frames will allow you
+ to show you display/filter/plot/add-custom-columns on these fields, so should
+ be added if available.
+ The format is to have the tag, followed by the value (there is no length field,
+ it's implicit from the tag) */
+
+#define MAC_LTE_RNTI_TAG 0x02
+/* 2 bytes, network order */
+
+#define MAC_LTE_UEID_TAG 0x03
+/* 2 bytes, network order */
+
+#define MAC_LTE_FRAME_SUBFRAME_TAG 0x04
+/* 2 bytes, network order, SFN is stored in 12 MSB and SF in 4 LSB */
+
+#define MAC_LTE_PREDEFINED_DATA_TAG 0x05
+/* 1 byte */
+
+#define MAC_LTE_RETX_TAG 0x06
+/* 1 byte */
+
+#define MAC_LTE_CRC_STATUS_TAG 0x07
+/* 1 byte */
+
+#define MAC_LTE_EXT_BSR_SIZES_TAG 0x08
+/* 0 byte */
+
+#define MAC_LTE_SEND_PREAMBLE_TAG 0x09
+/* 2 bytes, RAPID value (1 byte) followed by RACH attempt number (1 byte) */
+
+#define MAC_LTE_CARRIER_ID_TAG 0x0A
+/* 1 byte */
+
+#define MAC_LTE_PHY_TAG 0x0B
+/* variable length, length (1 byte) then depending on direction
+ in UL: modulation type (1 byte), TBS index (1 byte), RB length (1 byte),
+ RB start (1 byte), HARQ id (1 byte), NDI (1 byte)
+ in DL: DCI format (1 byte), resource allocation type (1 byte), aggregation level (1 byte),
+ MCS index (1 byte), redundancy version (1 byte), resource block length (1 byte),
+ HARQ id (1 byte), NDI (1 byte), TB (1 byte), DL reTx (1 byte) */
+
+#define MAC_LTE_SIMULT_PUCCH_PUSCH_PCELL 0x0C
+/* 0 byte */
+
+#define MAC_LTE_SIMULT_PUCCH_PUSCH_PSCELL 0x0D
+/* 0 byte */
+
+#define MAC_LTE_CE_MODE 0x0E
+/* 1 byte containing mac_lte_ce_mode enum value */
+
+#define MAC_LTE_NB_MODE 0x0F
+/* 1 byte containing mac_lte_nb_mode enum value */
+
+/* MAC PDU. Following this tag comes the actual MAC PDU (there is no length, the PDU
+ continues until the end of the frame) */
+#define MAC_LTE_PAYLOAD_TAG 0x01
+
+
+#if 0
+
+/* Type to store parameters for configuring LCID->RLC channel settings for DRB */
+/* Some are optional, and may not be seen (e.g. on reestablishment) */
+typedef struct drb_mapping_t
+{
+ guint16 ueid; /* Mandatory */
+ guint8 drbid; /* Mandatory */
+ gboolean lcid_present;
+ guint8 lcid; /* Part of LogicalChannelConfig - optional */
+ gboolean rlcMode_present;
+ guint8 rlcMode; /* Part of RLC config - optional */
+ gboolean rlc_ul_ext_li_field; /* Part of RLC config - optional */
+ gboolean rlc_dl_ext_li_field; /* Part of RLC config - optional */
+ gboolean rlc_ul_ext_am_sn; /* Part of RLC config - optional */
+ gboolean rlc_dl_ext_am_sn; /* Part of RLC config - optional */
+ gboolean um_sn_length_present;
+ guint8 um_sn_length; /* Part of RLC config - optional */
+ gboolean ul_priority_present;
+ guint8 ul_priority; /* Part of LogicalChannelConfig - optional */
+ gboolean pdcp_sn_size_present;
+ guint8 pdcp_sn_size; /* Part of pdcp-Config - optional */
+} drb_mapping_t;
+
+
+/* Set details of an LCID -> drb channel mapping. To be called from
+ configuration protocol (e.g. RRC) */
+void set_mac_lte_channel_mapping(drb_mapping_t *drb_mapping);
+
+
+/* Dedicated DRX config. Used to verify that a sensible config is given.
+ Also, beginning to configure MAC with this config and (optionally) show
+ DRX config and state (cycles/timers) attached to each UL/DL PDU! */
+typedef struct drx_config_t {
+ gboolean configured;
+ guint32 frameNum;
+ guint32 previousFrameNum;
+
+ guint32 onDurationTimer;
+ guint32 inactivityTimer;
+ guint32 retransmissionTimer;
+ guint32 longCycle;
+ guint32 cycleOffset;
+ /* Optional Short cycle */
+ gboolean shortCycleConfigured;
+ guint32 shortCycle;
+ guint32 shortCycleTimer;
+} drx_config_t;
+
+/* Functions to set/release up dedicated DRX config */
+void set_mac_lte_drx_config(guint16 ueid, drx_config_t *drx_config, packet_info *pinfo);
+void set_mac_lte_drx_config_release(guint16 ueid, packet_info *pinfo);
+
+/* RRC can tell this dissector which RAPIDs are Group A, Group A&B */
+void set_mac_lte_rapid_ranges(guint groupA, guint all_RA);
+
+/* RRC can indicate whether extended BSR sizes are used */
+void set_mac_lte_extended_bsr_sizes(guint16 ueid, gboolean use_ext_bsr_sizes, packet_info *pinfo);
+
+/* RRC can indicate whether simultaneous PUCCH/PUSCH is used */
+typedef enum {
+ SIMULT_PUCCH_PUSCH_PCELL = 0,
+ SIMULT_PUCCH_PUSCH_PSCELL
+} simult_pucch_pusch_cell_type;
+void set_mac_lte_simult_pucch_pusch(guint16 ueid, simult_pucch_pusch_cell_type cell_type, gboolean use_simult_pucch_pusch, packet_info *pinfo);
+
+/* Functions to be called from outside this module (e.g. in a plugin, where mac_lte_info
+ isn't available) to get/set per-packet data */
+WS_DLL_PUBLIC
+mac_lte_info *get_mac_lte_proto_data(packet_info *pinfo);
+WS_DLL_PUBLIC
+void set_mac_lte_proto_data(packet_info *pinfo, mac_lte_info *p_mac_lte_info);
+
+/* Function to attempt to populate p_mac_lte_info using framing definition above */
+gboolean dissect_mac_lte_context_fields(struct mac_lte_info *p_mac_lte_info, tvbuff_t *tvb,
+ gint *p_offset);
+
+#endif
diff --git a/common/utils/itti/assertions.h b/common/utils/itti/assertions.h
index c047ef6b76..f6a6b772cd 100644
--- a/common/utils/itti/assertions.h
+++ b/common/utils/itti/assertions.h
@@ -34,7 +34,7 @@
#include
#endif
-#if defined(ENB_MODE)
+#if defined(ENB_MODE2)
# define display_backtrace()
#else
# include "backtrace.h"
@@ -59,7 +59,7 @@ do { \
"In %s() %s:%d\n" fORMAT, \
__FUNCTION__, __FILE__, __LINE__, ##aRGS); \
aCTION; \
- } \
+ } \
} while(0)
#define AssertFatal(cOND, fORMAT, aRGS...) _Assert_(cOND, _Assert_Exit_, fORMAT, ##aRGS)
diff --git a/common/utils/itti/backtrace.c b/common/utils/itti/backtrace.c
index 3d984cbf11..f0b22c16be 100644
--- a/common/utils/itti/backtrace.c
+++ b/common/utils/itti/backtrace.c
@@ -44,7 +44,8 @@ void display_backtrace(void)
size_t size;
char **strings;
size_t i;
-
+ char* test=getenv("NO_BACKTRACE");
+ if (test!=0) *((int*)0)=0;
size = backtrace(array, 10);
strings = backtrace_symbols(array, size);
diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c
index 4386ca5d47..67d30bbb15 100644
--- a/openair1/PHY/INIT/lte_init.c
+++ b/openair1/PHY/INIT/lte_init.c
@@ -26,9 +26,6 @@
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
-#ifdef EXMIMO
-#include "openair0_lib.h"
-#endif
#include "defs.h"
#include "SCHED/defs.h"
#include "PHY/extern.h"
@@ -48,7 +45,7 @@ extern uint16_t prach_root_sequence_map4[138];
uint8_t dmrs1_tab[8] = {0,2,3,4,6,8,9,10};
// FIXME not used anywhere
-void phy_config_mib(LTE_DL_FRAME_PARMS *frame_parms,
+void phy_config_mib(LTE_DL_FRAME_PARMS *fp,
uint8_t N_RB_DL,
uint8_t Nid_cell,
uint8_t Ncp,
@@ -57,14 +54,14 @@ void phy_config_mib(LTE_DL_FRAME_PARMS *frame_parms,
PHICH_CONFIG_COMMON *phich_config)
{
- frame_parms->N_RB_DL = N_RB_DL;
- frame_parms->Nid_cell = Nid_cell;
- frame_parms->nushift = Nid_cell%6;
- frame_parms->Ncp = Ncp;
- frame_parms->frame_type = frame_type;
- frame_parms->nb_antennas_tx_eNB = p_eNB;
- frame_parms->phich_config_common.phich_resource = phich_config->phich_resource;
- frame_parms->phich_config_common.phich_duration = phich_config->phich_duration;
+ fp->N_RB_DL = N_RB_DL;
+ fp->Nid_cell = Nid_cell;
+ fp->nushift = Nid_cell%6;
+ fp->Ncp = Ncp;
+ fp->frame_type = frame_type;
+ fp->nb_antennas_tx_eNB = p_eNB;
+ fp->phich_config_common.phich_resource = phich_config->phich_resource;
+ fp->phich_config_common.phich_duration = phich_config->phich_duration;
}
void phy_config_sib1_eNB(uint8_t Mod_id,
@@ -74,15 +71,15 @@ void phy_config_sib1_eNB(uint8_t Mod_id,
uint16_t SIPeriod)
{
- LTE_DL_FRAME_PARMS *frame_parms = &PHY_vars_eNB_g[Mod_id][CC_id]->frame_parms;
+ LTE_DL_FRAME_PARMS *fp = &PHY_vars_eNB_g[Mod_id][CC_id]->frame_parms;
if (tdd_Config) {
- frame_parms->tdd_config = tdd_Config->subframeAssignment;
- frame_parms->tdd_config_S = tdd_Config->specialSubframePatterns;
+ fp->tdd_config = tdd_Config->subframeAssignment;
+ fp->tdd_config_S = tdd_Config->specialSubframePatterns;
}
- frame_parms->SIwindowsize = SIwindowsize;
- frame_parms->SIPeriod = SIPeriod;
+ fp->SIwindowsize = SIwindowsize;
+ fp->SIPeriod = SIPeriod;
}
void phy_config_sib1_ue(uint8_t Mod_id,int CC_id,
@@ -92,15 +89,15 @@ void phy_config_sib1_ue(uint8_t Mod_id,int CC_id,
uint16_t SIperiod)
{
- LTE_DL_FRAME_PARMS *frame_parms = &PHY_vars_UE_g[Mod_id][CC_id]->frame_parms;
+ LTE_DL_FRAME_PARMS *fp = &PHY_vars_UE_g[Mod_id][CC_id]->frame_parms;
if (tdd_Config) {
- frame_parms->tdd_config = tdd_Config->subframeAssignment;
- frame_parms->tdd_config_S = tdd_Config->specialSubframePatterns;
+ fp->tdd_config = tdd_Config->subframeAssignment;
+ fp->tdd_config_S = tdd_Config->specialSubframePatterns;
}
- frame_parms->SIwindowsize = SIwindowsize;
- frame_parms->SIPeriod = SIperiod;
+ fp->SIwindowsize = SIwindowsize;
+ fp->SIPeriod = SIperiod;
}
void phy_config_sib2_eNB(uint8_t Mod_id,
@@ -112,132 +109,132 @@ void phy_config_sib2_eNB(uint8_t Mod_id,
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList)
{
- LTE_DL_FRAME_PARMS *frame_parms = &PHY_vars_eNB_g[Mod_id][CC_id]->frame_parms;
+ LTE_DL_FRAME_PARMS *fp = &PHY_vars_eNB_g[Mod_id][CC_id]->frame_parms;
//LTE_eNB_UE_stats *eNB_UE_stats = PHY_vars_eNB_g[Mod_id][CC_id]->eNB_UE_stats;
//int32_t rx_total_gain_eNB_dB = PHY_vars_eNB_g[Mod_id][CC_id]->rx_total_gain_eNB_dB;
int i;
LOG_D(PHY,"[eNB%d] CCid %d: Applying radioResourceConfigCommon\n",Mod_id,CC_id);
- frame_parms->prach_config_common.rootSequenceIndex =radioResourceConfigCommon->prach_Config.rootSequenceIndex;
- LOG_D(PHY,"prach_config_common.rootSequenceIndex = %d\n",frame_parms->prach_config_common.rootSequenceIndex );
+ fp->prach_config_common.rootSequenceIndex =radioResourceConfigCommon->prach_Config.rootSequenceIndex;
+ LOG_D(PHY,"prach_config_common.rootSequenceIndex = %d\n",fp->prach_config_common.rootSequenceIndex );
- frame_parms->prach_config_common.prach_Config_enabled=1;
+ fp->prach_config_common.prach_Config_enabled=1;
- frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_ConfigIndex;
- LOG_D(PHY,"prach_config_common.prach_ConfigInfo.prach_ConfigIndex = %d\n",frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex);
+ fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_ConfigIndex;
+ LOG_D(PHY,"prach_config_common.prach_ConfigInfo.prach_ConfigIndex = %d\n",fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex);
- frame_parms->prach_config_common.prach_ConfigInfo.highSpeedFlag =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.highSpeedFlag;
- LOG_D(PHY,"prach_config_common.prach_ConfigInfo.highSpeedFlag = %d\n",frame_parms->prach_config_common.prach_ConfigInfo.highSpeedFlag);
- frame_parms->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.zeroCorrelationZoneConfig;
- LOG_D(PHY,"prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig = %d\n",frame_parms->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig);
- frame_parms->prach_config_common.prach_ConfigInfo.prach_FreqOffset =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_FreqOffset;
- LOG_D(PHY,"prach_config_common.prach_ConfigInfo.prach_FreqOffset = %d\n",frame_parms->prach_config_common.prach_ConfigInfo.prach_FreqOffset);
- compute_prach_seq(&frame_parms->prach_config_common,frame_parms->frame_type,
+ fp->prach_config_common.prach_ConfigInfo.highSpeedFlag =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.highSpeedFlag;
+ LOG_D(PHY,"prach_config_common.prach_ConfigInfo.highSpeedFlag = %d\n",fp->prach_config_common.prach_ConfigInfo.highSpeedFlag);
+ fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.zeroCorrelationZoneConfig;
+ LOG_D(PHY,"prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig = %d\n",fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig);
+ fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_FreqOffset;
+ LOG_D(PHY,"prach_config_common.prach_ConfigInfo.prach_FreqOffset = %d\n",fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset);
+ compute_prach_seq(&fp->prach_config_common,fp->frame_type,
PHY_vars_eNB_g[Mod_id][CC_id]->X_u);
- frame_parms->pucch_config_common.deltaPUCCH_Shift = 1+radioResourceConfigCommon->pucch_ConfigCommon.deltaPUCCH_Shift;
- frame_parms->pucch_config_common.nRB_CQI = radioResourceConfigCommon->pucch_ConfigCommon.nRB_CQI;
- frame_parms->pucch_config_common.nCS_AN = radioResourceConfigCommon->pucch_ConfigCommon.nCS_AN;
- frame_parms->pucch_config_common.n1PUCCH_AN = radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN;
+ fp->pucch_config_common.deltaPUCCH_Shift = 1+radioResourceConfigCommon->pucch_ConfigCommon.deltaPUCCH_Shift;
+ fp->pucch_config_common.nRB_CQI = radioResourceConfigCommon->pucch_ConfigCommon.nRB_CQI;
+ fp->pucch_config_common.nCS_AN = radioResourceConfigCommon->pucch_ConfigCommon.nCS_AN;
+ fp->pucch_config_common.n1PUCCH_AN = radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN;
- frame_parms->pdsch_config_common.referenceSignalPower = radioResourceConfigCommon->pdsch_ConfigCommon.referenceSignalPower;
- frame_parms->pdsch_config_common.p_b = radioResourceConfigCommon->pdsch_ConfigCommon.p_b;
+ fp->pdsch_config_common.referenceSignalPower = radioResourceConfigCommon->pdsch_ConfigCommon.referenceSignalPower;
+ fp->pdsch_config_common.p_b = radioResourceConfigCommon->pdsch_ConfigCommon.p_b;
- frame_parms->pusch_config_common.n_SB = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.n_SB;
- LOG_D(PHY,"pusch_config_common.n_SB = %d\n",frame_parms->pusch_config_common.n_SB );
+ fp->pusch_config_common.n_SB = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.n_SB;
+ LOG_D(PHY,"pusch_config_common.n_SB = %d\n",fp->pusch_config_common.n_SB );
- frame_parms->pusch_config_common.hoppingMode = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.hoppingMode;
- LOG_D(PHY,"pusch_config_common.hoppingMode = %d\n",frame_parms->pusch_config_common.hoppingMode);
+ fp->pusch_config_common.hoppingMode = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.hoppingMode;
+ LOG_D(PHY,"pusch_config_common.hoppingMode = %d\n",fp->pusch_config_common.hoppingMode);
- frame_parms->pusch_config_common.pusch_HoppingOffset = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.pusch_HoppingOffset;
- LOG_D(PHY,"pusch_config_common.pusch_HoppingOffset = %d\n",frame_parms->pusch_config_common.pusch_HoppingOffset);
+ fp->pusch_config_common.pusch_HoppingOffset = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.pusch_HoppingOffset;
+ LOG_D(PHY,"pusch_config_common.pusch_HoppingOffset = %d\n",fp->pusch_config_common.pusch_HoppingOffset);
- frame_parms->pusch_config_common.enable64QAM = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.enable64QAM;
- LOG_D(PHY,"pusch_config_common.enable64QAM = %d\n",frame_parms->pusch_config_common.enable64QAM );
+ fp->pusch_config_common.enable64QAM = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.enable64QAM;
+ LOG_D(PHY,"pusch_config_common.enable64QAM = %d\n",fp->pusch_config_common.enable64QAM );
- frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupHoppingEnabled;
- LOG_D(PHY,"pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = %d\n",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled);
+ fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupHoppingEnabled;
+ LOG_D(PHY,"pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = %d\n",fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled);
- frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH;
- LOG_D(PHY,"pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = %d\n",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH);
+ fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH;
+ LOG_D(PHY,"pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = %d\n",fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH);
- frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled;
- LOG_D(PHY,"pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = %d\n",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled);
+ fp->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled;
+ LOG_D(PHY,"pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = %d\n",fp->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled);
- frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = dmrs1_tab[radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.cyclicShift];
- LOG_D(PHY,"pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = %d\n",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift);
+ fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = dmrs1_tab[radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.cyclicShift];
+ LOG_D(PHY,"pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = %d\n",fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift);
- init_ul_hopping(frame_parms);
+ init_ul_hopping(fp);
- frame_parms->soundingrs_ul_config_common.enabled_flag = 0;
+ fp->soundingrs_ul_config_common.enabled_flag = 0;
if (radioResourceConfigCommon->soundingRS_UL_ConfigCommon.present==SoundingRS_UL_ConfigCommon_PR_setup) {
- frame_parms->soundingrs_ul_config_common.enabled_flag = 1;
- frame_parms->soundingrs_ul_config_common.srs_BandwidthConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_BandwidthConfig;
- frame_parms->soundingrs_ul_config_common.srs_SubframeConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_SubframeConfig;
- frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission;
+ fp->soundingrs_ul_config_common.enabled_flag = 1;
+ fp->soundingrs_ul_config_common.srs_BandwidthConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_BandwidthConfig;
+ fp->soundingrs_ul_config_common.srs_SubframeConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_SubframeConfig;
+ fp->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission;
if (radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts)
- frame_parms->soundingrs_ul_config_common.srs_MaxUpPts = 1;
+ fp->soundingrs_ul_config_common.srs_MaxUpPts = 1;
else
- frame_parms->soundingrs_ul_config_common.srs_MaxUpPts = 0;
+ fp->soundingrs_ul_config_common.srs_MaxUpPts = 0;
}
- frame_parms->ul_power_control_config_common.p0_NominalPUSCH = radioResourceConfigCommon->uplinkPowerControlCommon.p0_NominalPUSCH;
- frame_parms->ul_power_control_config_common.alpha = radioResourceConfigCommon->uplinkPowerControlCommon.alpha;
- frame_parms->ul_power_control_config_common.p0_NominalPUCCH = radioResourceConfigCommon->uplinkPowerControlCommon.p0_NominalPUCCH;
- frame_parms->ul_power_control_config_common.deltaPreambleMsg3 = radioResourceConfigCommon->uplinkPowerControlCommon.deltaPreambleMsg3;
- frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format1 = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format1;
- frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format1b = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format1b;
- frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format2 = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2;
- frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format2a = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2a;
- frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format2b = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2b;
+ fp->ul_power_control_config_common.p0_NominalPUSCH = radioResourceConfigCommon->uplinkPowerControlCommon.p0_NominalPUSCH;
+ fp->ul_power_control_config_common.alpha = radioResourceConfigCommon->uplinkPowerControlCommon.alpha;
+ fp->ul_power_control_config_common.p0_NominalPUCCH = radioResourceConfigCommon->uplinkPowerControlCommon.p0_NominalPUCCH;
+ fp->ul_power_control_config_common.deltaPreambleMsg3 = radioResourceConfigCommon->uplinkPowerControlCommon.deltaPreambleMsg3;
+ fp->ul_power_control_config_common.deltaF_PUCCH_Format1 = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format1;
+ fp->ul_power_control_config_common.deltaF_PUCCH_Format1b = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format1b;
+ fp->ul_power_control_config_common.deltaF_PUCCH_Format2 = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2;
+ fp->ul_power_control_config_common.deltaF_PUCCH_Format2a = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2a;
+ fp->ul_power_control_config_common.deltaF_PUCCH_Format2b = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2b;
- frame_parms->maxHARQ_Msg3Tx = radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx;
+ fp->maxHARQ_Msg3Tx = radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx;
// Now configure some of the Physical Channels
// PUCCH
- init_ncs_cell(frame_parms,PHY_vars_eNB_g[Mod_id][CC_id]->ncs_cell);
+ init_ncs_cell(fp,PHY_vars_eNB_g[Mod_id][CC_id]->ncs_cell);
- init_ul_hopping(frame_parms);
+ init_ul_hopping(fp);
// MBSFN
if (mbsfn_SubframeConfigList != NULL) {
- frame_parms->num_MBSFN_config = mbsfn_SubframeConfigList->list.count;
+ fp->num_MBSFN_config = mbsfn_SubframeConfigList->list.count;
for (i=0; ilist.count; i++) {
- frame_parms->MBSFN_config[i].radioframeAllocationPeriod = mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationPeriod;
- frame_parms->MBSFN_config[i].radioframeAllocationOffset = mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationOffset;
+ fp->MBSFN_config[i].radioframeAllocationPeriod = mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationPeriod;
+ fp->MBSFN_config[i].radioframeAllocationOffset = mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationOffset;
if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame) {
- frame_parms->MBSFN_config[i].fourFrames_flag = 0;
- frame_parms->MBSFN_config[i].mbsfn_SubframeConfig = mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]; // 6-bit subframe configuration
+ fp->MBSFN_config[i].fourFrames_flag = 0;
+ fp->MBSFN_config[i].mbsfn_SubframeConfig = mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]; // 6-bit subframe configuration
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %ld\n", i,
- frame_parms->MBSFN_config[i].mbsfn_SubframeConfig);
+ fp->MBSFN_config[i].mbsfn_SubframeConfig);
} else if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames) { // 24-bit subframe configuration
- frame_parms->MBSFN_config[i].fourFrames_flag = 1;
- frame_parms->MBSFN_config[i].mbsfn_SubframeConfig =
+ fp->MBSFN_config[i].fourFrames_flag = 1;
+ fp->MBSFN_config[i].mbsfn_SubframeConfig =
mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]|
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[1]<<8)|
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[2]<<16);
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %ld\n", i,
- frame_parms->MBSFN_config[i].mbsfn_SubframeConfig);
+ fp->MBSFN_config[i].mbsfn_SubframeConfig);
}
}
} else
- frame_parms->num_MBSFN_config = 0;
+ fp->num_MBSFN_config = 0;
}
@@ -250,106 +247,109 @@ void phy_config_sib2_ue(uint8_t Mod_id,int CC_id,
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList)
{
- LTE_DL_FRAME_PARMS *frame_parms = &PHY_vars_UE_g[Mod_id][CC_id]->frame_parms;
+ PHY_VARS_UE *ue = PHY_vars_UE_g[Mod_id][CC_id];
+ LTE_DL_FRAME_PARMS *fp = &ue->frame_parms;
int i;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_UE_CONFIG_SIB2, VCD_FUNCTION_IN);
LOG_I(PHY,"[UE%d] Applying radioResourceConfigCommon from eNB%d\n",Mod_id,CH_index);
- frame_parms->prach_config_common.rootSequenceIndex =radioResourceConfigCommon->prach_Config.rootSequenceIndex;
+ fp->prach_config_common.rootSequenceIndex =radioResourceConfigCommon->prach_Config.rootSequenceIndex;
- frame_parms->prach_config_common.prach_Config_enabled=1;
- frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_ConfigIndex;
- frame_parms->prach_config_common.prach_ConfigInfo.highSpeedFlag =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.highSpeedFlag;
- frame_parms->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.zeroCorrelationZoneConfig;
- frame_parms->prach_config_common.prach_ConfigInfo.prach_FreqOffset =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_FreqOffset;
+ fp->prach_config_common.prach_Config_enabled=1;
+ fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_ConfigIndex;
+ fp->prach_config_common.prach_ConfigInfo.highSpeedFlag =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.highSpeedFlag;
+ fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.zeroCorrelationZoneConfig;
+ fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_FreqOffset;
- compute_prach_seq(&frame_parms->prach_config_common,frame_parms->frame_type,PHY_vars_UE_g[Mod_id][CC_id]->X_u);
+ compute_prach_seq(&fp->prach_config_common,fp->frame_type,ue->X_u);
- frame_parms->pucch_config_common.deltaPUCCH_Shift = 1+radioResourceConfigCommon->pucch_ConfigCommon.deltaPUCCH_Shift;
- frame_parms->pucch_config_common.nRB_CQI = radioResourceConfigCommon->pucch_ConfigCommon.nRB_CQI;
- frame_parms->pucch_config_common.nCS_AN = radioResourceConfigCommon->pucch_ConfigCommon.nCS_AN;
- frame_parms->pucch_config_common.n1PUCCH_AN = radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN;
+ fp->pucch_config_common.deltaPUCCH_Shift = 1+radioResourceConfigCommon->pucch_ConfigCommon.deltaPUCCH_Shift;
+ fp->pucch_config_common.nRB_CQI = radioResourceConfigCommon->pucch_ConfigCommon.nRB_CQI;
+ fp->pucch_config_common.nCS_AN = radioResourceConfigCommon->pucch_ConfigCommon.nCS_AN;
+ fp->pucch_config_common.n1PUCCH_AN = radioResourceConfigCommon->pucch_ConfigCommon.n1PUCCH_AN;
- frame_parms->pdsch_config_common.referenceSignalPower = radioResourceConfigCommon->pdsch_ConfigCommon.referenceSignalPower;
- frame_parms->pdsch_config_common.p_b = radioResourceConfigCommon->pdsch_ConfigCommon.p_b;
+ fp->pdsch_config_common.referenceSignalPower = radioResourceConfigCommon->pdsch_ConfigCommon.referenceSignalPower;
+ fp->pdsch_config_common.p_b = radioResourceConfigCommon->pdsch_ConfigCommon.p_b;
- frame_parms->pusch_config_common.n_SB = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.n_SB;
- frame_parms->pusch_config_common.hoppingMode = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.hoppingMode;
- frame_parms->pusch_config_common.pusch_HoppingOffset = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.pusch_HoppingOffset;
- frame_parms->pusch_config_common.enable64QAM = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.enable64QAM;
- frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupHoppingEnabled;
- frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH;
- frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled;
- frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = dmrs1_tab[radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.cyclicShift];
+ fp->pusch_config_common.n_SB = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.n_SB;
+ fp->pusch_config_common.hoppingMode = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.hoppingMode;
+ fp->pusch_config_common.pusch_HoppingOffset = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.pusch_HoppingOffset;
+ fp->pusch_config_common.enable64QAM = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.enable64QAM;
+ fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupHoppingEnabled;
+ fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH;
+ fp->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled;
+ fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = dmrs1_tab[radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.cyclicShift];
- init_ul_hopping(frame_parms);
- frame_parms->soundingrs_ul_config_common.enabled_flag = 0;
+ init_ul_hopping(fp);
+ fp->soundingrs_ul_config_common.enabled_flag = 0;
if (radioResourceConfigCommon->soundingRS_UL_ConfigCommon.present==SoundingRS_UL_ConfigCommon_PR_setup) {
- frame_parms->soundingrs_ul_config_common.enabled_flag = 1;
- frame_parms->soundingrs_ul_config_common.srs_BandwidthConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_BandwidthConfig;
- frame_parms->soundingrs_ul_config_common.srs_SubframeConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_SubframeConfig;
- frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission;
+ fp->soundingrs_ul_config_common.enabled_flag = 1;
+ fp->soundingrs_ul_config_common.srs_BandwidthConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_BandwidthConfig;
+ fp->soundingrs_ul_config_common.srs_SubframeConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_SubframeConfig;
+ fp->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission = radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission;
if (radioResourceConfigCommon->soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts)
- frame_parms->soundingrs_ul_config_common.srs_MaxUpPts = 1;
+ fp->soundingrs_ul_config_common.srs_MaxUpPts = 1;
else
- frame_parms->soundingrs_ul_config_common.srs_MaxUpPts = 0;
+ fp->soundingrs_ul_config_common.srs_MaxUpPts = 0;
}
- frame_parms->ul_power_control_config_common.p0_NominalPUSCH = radioResourceConfigCommon->uplinkPowerControlCommon.p0_NominalPUSCH;
- frame_parms->ul_power_control_config_common.alpha = radioResourceConfigCommon->uplinkPowerControlCommon.alpha;
- frame_parms->ul_power_control_config_common.p0_NominalPUCCH = radioResourceConfigCommon->uplinkPowerControlCommon.p0_NominalPUCCH;
- frame_parms->ul_power_control_config_common.deltaPreambleMsg3 = radioResourceConfigCommon->uplinkPowerControlCommon.deltaPreambleMsg3;
- frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format1 = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format1;
- frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format1b = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format1b;
- frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format2 = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2;
- frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format2a = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2a;
- frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format2b = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2b;
+ fp->ul_power_control_config_common.p0_NominalPUSCH = radioResourceConfigCommon->uplinkPowerControlCommon.p0_NominalPUSCH;
+ fp->ul_power_control_config_common.alpha = radioResourceConfigCommon->uplinkPowerControlCommon.alpha;
+ fp->ul_power_control_config_common.p0_NominalPUCCH = radioResourceConfigCommon->uplinkPowerControlCommon.p0_NominalPUCCH;
+ fp->ul_power_control_config_common.deltaPreambleMsg3 = radioResourceConfigCommon->uplinkPowerControlCommon.deltaPreambleMsg3;
+ fp->ul_power_control_config_common.deltaF_PUCCH_Format1 = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format1;
+ fp->ul_power_control_config_common.deltaF_PUCCH_Format1b = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format1b;
+ fp->ul_power_control_config_common.deltaF_PUCCH_Format2 = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2;
+ fp->ul_power_control_config_common.deltaF_PUCCH_Format2a = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2a;
+ fp->ul_power_control_config_common.deltaF_PUCCH_Format2b = radioResourceConfigCommon->uplinkPowerControlCommon.deltaFList_PUCCH.deltaF_PUCCH_Format2b;
- frame_parms->maxHARQ_Msg3Tx = radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx;
+ fp->maxHARQ_Msg3Tx = radioResourceConfigCommon->rach_ConfigCommon.maxHARQ_Msg3Tx;
// Now configure some of the Physical Channels
// PUCCH
- init_ncs_cell(frame_parms,PHY_vars_UE_g[Mod_id][CC_id]->ncs_cell);
+ init_ncs_cell(fp,ue->ncs_cell);
- init_ul_hopping(frame_parms);
+ init_ul_hopping(fp);
+ // PCH
+ init_ue_paging_info(ue,radioResourceConfigCommon->pcch_Config.defaultPagingCycle,radioResourceConfigCommon->pcch_Config.nB);
// MBSFN
if (mbsfn_SubframeConfigList != NULL) {
- frame_parms->num_MBSFN_config = mbsfn_SubframeConfigList->list.count;
+ fp->num_MBSFN_config = mbsfn_SubframeConfigList->list.count;
for (i=0; ilist.count; i++) {
- frame_parms->MBSFN_config[i].radioframeAllocationPeriod = mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationPeriod;
- frame_parms->MBSFN_config[i].radioframeAllocationOffset = mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationOffset;
+ fp->MBSFN_config[i].radioframeAllocationPeriod = mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationPeriod;
+ fp->MBSFN_config[i].radioframeAllocationOffset = mbsfn_SubframeConfigList->list.array[i]->radioframeAllocationOffset;
if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame) {
- frame_parms->MBSFN_config[i].fourFrames_flag = 0;
- frame_parms->MBSFN_config[i].mbsfn_SubframeConfig = mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]; // 6-bit subframe configuration
+ fp->MBSFN_config[i].fourFrames_flag = 0;
+ fp->MBSFN_config[i].mbsfn_SubframeConfig = mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]; // 6-bit subframe configuration
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %ld\n", i,
- frame_parms->MBSFN_config[i].mbsfn_SubframeConfig);
+ fp->MBSFN_config[i].mbsfn_SubframeConfig);
} else if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames) { // 24-bit subframe configuration
- frame_parms->MBSFN_config[i].fourFrames_flag = 1;
- frame_parms->MBSFN_config[i].mbsfn_SubframeConfig =
+ fp->MBSFN_config[i].fourFrames_flag = 1;
+ fp->MBSFN_config[i].mbsfn_SubframeConfig =
mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]|
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[1]<<8)|
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[2]<<16);
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %ld\n", i,
- frame_parms->MBSFN_config[i].mbsfn_SubframeConfig);
+ fp->MBSFN_config[i].mbsfn_SubframeConfig);
}
}
}
@@ -362,17 +362,17 @@ void phy_config_sib13_ue(uint8_t Mod_id,int CC_id,uint8_t CH_index,int mbsfn_Are
long mbsfn_AreaId_r9)
{
- LTE_DL_FRAME_PARMS *frame_parms = &PHY_vars_UE_g[Mod_id][CC_id]->frame_parms;
+ LTE_DL_FRAME_PARMS *fp = &PHY_vars_UE_g[Mod_id][CC_id]->frame_parms;
LOG_I(PHY,"[UE%d] Applying MBSFN_Area_id %d for index %d\n",Mod_id,mbsfn_AreaId_r9,mbsfn_Area_idx);
if (mbsfn_Area_idx == 0) {
- frame_parms->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9;
+ fp->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9;
LOG_N(PHY,"Fix me: only called when mbsfn_Area_idx == 0)\n");
}
- lte_gold_mbsfn(frame_parms,PHY_vars_UE_g[Mod_id][CC_id]->lte_gold_mbsfn_table,frame_parms->Nid_cell_mbsfn);
+ lte_gold_mbsfn(fp,PHY_vars_UE_g[Mod_id][CC_id]->lte_gold_mbsfn_table,fp->Nid_cell_mbsfn);
}
@@ -381,17 +381,17 @@ void phy_config_sib13_eNB(uint8_t Mod_id,int CC_id,int mbsfn_Area_idx,
long mbsfn_AreaId_r9)
{
- LTE_DL_FRAME_PARMS *frame_parms = &PHY_vars_eNB_g[Mod_id][CC_id]->frame_parms;
+ LTE_DL_FRAME_PARMS *fp = &PHY_vars_eNB_g[Mod_id][CC_id]->frame_parms;
LOG_I(PHY,"[eNB%d] Applying MBSFN_Area_id %d for index %d\n",Mod_id,mbsfn_AreaId_r9,mbsfn_Area_idx);
if (mbsfn_Area_idx == 0) {
- frame_parms->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9;
+ fp->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9;
LOG_N(PHY,"Fix me: only called when mbsfn_Area_idx == 0)\n");
}
- lte_gold_mbsfn(frame_parms,PHY_vars_eNB_g[Mod_id][CC_id]->lte_gold_mbsfn_table,frame_parms->Nid_cell_mbsfn);
+ lte_gold_mbsfn(fp,PHY_vars_eNB_g[Mod_id][CC_id]->lte_gold_mbsfn_table,fp->Nid_cell_mbsfn);
}
@@ -400,6 +400,7 @@ void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *eNB)
uint8_t UE_id;
struct PhysicalConfigDedicated *physicalConfigDedicated;
+ LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
for (UE_id=0; UE_idphysicalConfigDedicated[UE_id];
@@ -421,7 +422,7 @@ void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *eNB)
eNB->pucch_config_dedicated[UE_id].ackNackRepetition=1;
}
- if (eNB->frame_parms.frame_type == FDD) {
+ if (fp->frame_type == FDD) {
eNB->pucch_config_dedicated[UE_id].tdd_AckNackFeedbackMode = multiplexing;
} else {
if (physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode)
@@ -508,7 +509,7 @@ void phy_config_afterHO_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_id, Mobility
PHY_vars_UE_g[Mod_id][CC_id]->ho_triggered = 1;
//PHY_vars_UE_g[UE_id]->UE_mode[0] = PRACH;
- LTE_DL_FRAME_PARMS *frame_parms = &PHY_vars_UE_g[Mod_id][CC_id]->frame_parms;
+ LTE_DL_FRAME_PARMS *fp = &PHY_vars_UE_g[Mod_id][CC_id]->frame_parms;
// int N_ZC;
// uint8_t prach_fmt;
// int u;
@@ -516,88 +517,88 @@ void phy_config_afterHO_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_id, Mobility
LOG_I(PHY,"[UE%d] Handover triggered: Applying radioResourceConfigCommon from eNB %d\n",
Mod_id,eNB_id);
- frame_parms->prach_config_common.rootSequenceIndex =radioResourceConfigCommon->prach_Config.rootSequenceIndex;
- frame_parms->prach_config_common.prach_Config_enabled=1;
- frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->prach_ConfigIndex;
- frame_parms->prach_config_common.prach_ConfigInfo.highSpeedFlag =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->highSpeedFlag;
- frame_parms->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->zeroCorrelationZoneConfig;
- frame_parms->prach_config_common.prach_ConfigInfo.prach_FreqOffset =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->prach_FreqOffset;
+ fp->prach_config_common.rootSequenceIndex =radioResourceConfigCommon->prach_Config.rootSequenceIndex;
+ fp->prach_config_common.prach_Config_enabled=1;
+ fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->prach_ConfigIndex;
+ fp->prach_config_common.prach_ConfigInfo.highSpeedFlag =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->highSpeedFlag;
+ fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->zeroCorrelationZoneConfig;
+ fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->prach_FreqOffset;
- // prach_fmt = get_prach_fmt(radioResourceConfigCommon->prach_Config.prach_ConfigInfo->prach_ConfigIndex,frame_parms->frame_type);
+ // prach_fmt = get_prach_fmt(radioResourceConfigCommon->prach_Config.prach_ConfigInfo->prach_ConfigIndex,fp->frame_type);
// N_ZC = (prach_fmt <4)?839:139;
- // u = (prach_fmt < 4) ? prach_root_sequence_map0_3[frame_parms->prach_config_common.rootSequenceIndex] :
- // prach_root_sequence_map4[frame_parms->prach_config_common.rootSequenceIndex];
+ // u = (prach_fmt < 4) ? prach_root_sequence_map0_3[fp->prach_config_common.rootSequenceIndex] :
+ // prach_root_sequence_map4[fp->prach_config_common.rootSequenceIndex];
//compute_prach_seq(u,N_ZC, PHY_vars_UE_g[Mod_id]->X_u);
compute_prach_seq(&PHY_vars_UE_g[Mod_id][CC_id]->frame_parms.prach_config_common,
- frame_parms->frame_type,
+ fp->frame_type,
PHY_vars_UE_g[Mod_id][CC_id]->X_u);
- frame_parms->pucch_config_common.deltaPUCCH_Shift = 1+radioResourceConfigCommon->pucch_ConfigCommon->deltaPUCCH_Shift;
- frame_parms->pucch_config_common.nRB_CQI = radioResourceConfigCommon->pucch_ConfigCommon->nRB_CQI;
- frame_parms->pucch_config_common.nCS_AN = radioResourceConfigCommon->pucch_ConfigCommon->nCS_AN;
- frame_parms->pucch_config_common.n1PUCCH_AN = radioResourceConfigCommon->pucch_ConfigCommon->n1PUCCH_AN;
- frame_parms->pdsch_config_common.referenceSignalPower = radioResourceConfigCommon->pdsch_ConfigCommon->referenceSignalPower;
- frame_parms->pdsch_config_common.p_b = radioResourceConfigCommon->pdsch_ConfigCommon->p_b;
+ fp->pucch_config_common.deltaPUCCH_Shift = 1+radioResourceConfigCommon->pucch_ConfigCommon->deltaPUCCH_Shift;
+ fp->pucch_config_common.nRB_CQI = radioResourceConfigCommon->pucch_ConfigCommon->nRB_CQI;
+ fp->pucch_config_common.nCS_AN = radioResourceConfigCommon->pucch_ConfigCommon->nCS_AN;
+ fp->pucch_config_common.n1PUCCH_AN = radioResourceConfigCommon->pucch_ConfigCommon->n1PUCCH_AN;
+ fp->pdsch_config_common.referenceSignalPower = radioResourceConfigCommon->pdsch_ConfigCommon->referenceSignalPower;
+ fp->pdsch_config_common.p_b = radioResourceConfigCommon->pdsch_ConfigCommon->p_b;
- frame_parms->pusch_config_common.n_SB = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.n_SB;
- frame_parms->pusch_config_common.hoppingMode = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.hoppingMode;
- frame_parms->pusch_config_common.pusch_HoppingOffset = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.pusch_HoppingOffset;
- frame_parms->pusch_config_common.enable64QAM = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.enable64QAM;
- frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupHoppingEnabled;
- frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH;
- frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled;
- frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.cyclicShift;
+ fp->pusch_config_common.n_SB = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.n_SB;
+ fp->pusch_config_common.hoppingMode = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.hoppingMode;
+ fp->pusch_config_common.pusch_HoppingOffset = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.pusch_HoppingOffset;
+ fp->pusch_config_common.enable64QAM = radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.enable64QAM;
+ fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupHoppingEnabled;
+ fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH;
+ fp->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled;
+ fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = radioResourceConfigCommon->pusch_ConfigCommon.ul_ReferenceSignalsPUSCH.cyclicShift;
- init_ul_hopping(frame_parms);
- frame_parms->soundingrs_ul_config_common.enabled_flag = 0;
+ init_ul_hopping(fp);
+ fp->soundingrs_ul_config_common.enabled_flag = 0;
if (radioResourceConfigCommon->soundingRS_UL_ConfigCommon->present==SoundingRS_UL_ConfigCommon_PR_setup) {
- frame_parms->soundingrs_ul_config_common.enabled_flag = 1;
- frame_parms->soundingrs_ul_config_common.srs_BandwidthConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon->choice.setup.srs_BandwidthConfig;
- frame_parms->soundingrs_ul_config_common.srs_SubframeConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon->choice.setup.srs_SubframeConfig;
- frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission = radioResourceConfigCommon->soundingRS_UL_ConfigCommon->choice.setup.ackNackSRS_SimultaneousTransmission;
+ fp->soundingrs_ul_config_common.enabled_flag = 1;
+ fp->soundingrs_ul_config_common.srs_BandwidthConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon->choice.setup.srs_BandwidthConfig;
+ fp->soundingrs_ul_config_common.srs_SubframeConfig = radioResourceConfigCommon->soundingRS_UL_ConfigCommon->choice.setup.srs_SubframeConfig;
+ fp->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission = radioResourceConfigCommon->soundingRS_UL_ConfigCommon->choice.setup.ackNackSRS_SimultaneousTransmission;
if (radioResourceConfigCommon->soundingRS_UL_ConfigCommon->choice.setup.srs_MaxUpPts)
- frame_parms->soundingrs_ul_config_common.srs_MaxUpPts = 1;
+ fp->soundingrs_ul_config_common.srs_MaxUpPts = 1;
else
- frame_parms->soundingrs_ul_config_common.srs_MaxUpPts = 0;
+ fp->soundingrs_ul_config_common.srs_MaxUpPts = 0;
}
- frame_parms->ul_power_control_config_common.p0_NominalPUSCH = radioResourceConfigCommon->uplinkPowerControlCommon->p0_NominalPUSCH;
- frame_parms->ul_power_control_config_common.alpha = radioResourceConfigCommon->uplinkPowerControlCommon->alpha;
- frame_parms->ul_power_control_config_common.p0_NominalPUCCH = radioResourceConfigCommon->uplinkPowerControlCommon->p0_NominalPUCCH;
- frame_parms->ul_power_control_config_common.deltaPreambleMsg3 = radioResourceConfigCommon->uplinkPowerControlCommon->deltaPreambleMsg3;
- frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format1 = radioResourceConfigCommon->uplinkPowerControlCommon->deltaFList_PUCCH.deltaF_PUCCH_Format1;
- frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format1b = radioResourceConfigCommon->uplinkPowerControlCommon->deltaFList_PUCCH.deltaF_PUCCH_Format1b;
- frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format2 = radioResourceConfigCommon->uplinkPowerControlCommon->deltaFList_PUCCH.deltaF_PUCCH_Format2;
- frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format2a = radioResourceConfigCommon->uplinkPowerControlCommon->deltaFList_PUCCH.deltaF_PUCCH_Format2a;
- frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format2b = radioResourceConfigCommon->uplinkPowerControlCommon->deltaFList_PUCCH.deltaF_PUCCH_Format2b;
+ fp->ul_power_control_config_common.p0_NominalPUSCH = radioResourceConfigCommon->uplinkPowerControlCommon->p0_NominalPUSCH;
+ fp->ul_power_control_config_common.alpha = radioResourceConfigCommon->uplinkPowerControlCommon->alpha;
+ fp->ul_power_control_config_common.p0_NominalPUCCH = radioResourceConfigCommon->uplinkPowerControlCommon->p0_NominalPUCCH;
+ fp->ul_power_control_config_common.deltaPreambleMsg3 = radioResourceConfigCommon->uplinkPowerControlCommon->deltaPreambleMsg3;
+ fp->ul_power_control_config_common.deltaF_PUCCH_Format1 = radioResourceConfigCommon->uplinkPowerControlCommon->deltaFList_PUCCH.deltaF_PUCCH_Format1;
+ fp->ul_power_control_config_common.deltaF_PUCCH_Format1b = radioResourceConfigCommon->uplinkPowerControlCommon->deltaFList_PUCCH.deltaF_PUCCH_Format1b;
+ fp->ul_power_control_config_common.deltaF_PUCCH_Format2 = radioResourceConfigCommon->uplinkPowerControlCommon->deltaFList_PUCCH.deltaF_PUCCH_Format2;
+ fp->ul_power_control_config_common.deltaF_PUCCH_Format2a = radioResourceConfigCommon->uplinkPowerControlCommon->deltaFList_PUCCH.deltaF_PUCCH_Format2a;
+ fp->ul_power_control_config_common.deltaF_PUCCH_Format2b = radioResourceConfigCommon->uplinkPowerControlCommon->deltaFList_PUCCH.deltaF_PUCCH_Format2b;
- frame_parms->maxHARQ_Msg3Tx = radioResourceConfigCommon->rach_ConfigCommon->maxHARQ_Msg3Tx;
+ fp->maxHARQ_Msg3Tx = radioResourceConfigCommon->rach_ConfigCommon->maxHARQ_Msg3Tx;
// Now configure some of the Physical Channels
if (radioResourceConfigCommon->antennaInfoCommon)
- frame_parms->nb_antennas_tx = (1<antennaInfoCommon->antennaPortsCount);
+ fp->nb_antennas_tx = (1<antennaInfoCommon->antennaPortsCount);
else
- frame_parms->nb_antennas_tx = 1;
+ fp->nb_antennas_tx = 1;
//PHICH
if (radioResourceConfigCommon->antennaInfoCommon) {
- frame_parms->phich_config_common.phich_resource = radioResourceConfigCommon->phich_Config->phich_Resource;
- frame_parms->phich_config_common.phich_duration = radioResourceConfigCommon->phich_Config->phich_Duration;
+ fp->phich_config_common.phich_resource = radioResourceConfigCommon->phich_Config->phich_Resource;
+ fp->phich_config_common.phich_duration = radioResourceConfigCommon->phich_Config->phich_Duration;
}
//Target CellId
- frame_parms->Nid_cell = mobilityControlInfo->targetPhysCellId;
- frame_parms->nushift = frame_parms->Nid_cell%6;
+ fp->Nid_cell = mobilityControlInfo->targetPhysCellId;
+ fp->nushift = fp->Nid_cell%6;
// PUCCH
- init_ncs_cell(frame_parms,PHY_vars_UE_g[Mod_id][CC_id]->ncs_cell);
+ init_ncs_cell(fp,PHY_vars_UE_g[Mod_id][CC_id]->ncs_cell);
- init_ul_hopping(frame_parms);
+ init_ul_hopping(fp);
// RNTI
@@ -676,46 +677,13 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
ARFCN_ValueEUTRA_t dl_CarrierFreq_r10 = sCellToAddMod_r10->cellIdentification_r10->dl_CarrierFreq_r10;
uint32_t carrier_freq_local;
-#ifdef EXMIMO
-#ifdef DRIVER2013
- // exmimo_config_t *p_exmimo_config = openair0_exmimo_pci[rf_map[CC_id].card].exmimo_config_ptr;
-#endif
-#endif
-
if ((dl_CarrierFreq_r10>=36000) && (dl_CarrierFreq_r10<=36199)) {
carrier_freq_local = 1900000000 + (dl_CarrierFreq_r10-36000)*100000; //band 33 from 3GPP 36.101 v 10.9 Table 5.7.3-1
LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %d) for UE %d\n",Mod_id,/*eNB->frame*/0,CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id);
- /*
-#ifdef EXMIMO
-#ifdef DRIVER2013
- //carrier_freq[CC_id] = carrier_freq_local;
- //openair_daq_vars.freq_offset = -6540;
- p_exmimo_config->rf.rf_freq_rx[rf_map[CC_id].chain] = carrier_freq_local;//+openair_daq_vars.freq_offset2;
- p_exmimo_config->rf.rf_freq_tx[rf_map[CC_id].chain] = carrier_freq_local;//+openair_daq_vars.freq_offset2;
- p_exmimo_config->rf.tx_gain[rf_map[CC_id].chain][0] = 25;
- p_exmimo_config->rf.rf_vcocal[rf_map[CC_id].chain] = 910;
- p_exmimo_config->rf.rf_local[rf_map[CC_id].chain] = 8255063; //this should be taken form calibration file
- p_exmimo_config->rf.rffe_band_mode[rf_map[CC_id].chain] = B19G_TDD;
-#endif
-#endif*/
} else if ((dl_CarrierFreq_r10>=6150) && (dl_CarrierFreq_r10<=6449)) {
carrier_freq_local = 832000000 + (dl_CarrierFreq_r10-6150)*100000; //band 20 from 3GPP 36.101 v 10.9 Table 5.7.3-1
// this is actually for the UL only, but we use it for DL too, since there is no TDD mode for this band
LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %d) for UE %d\n",Mod_id,/*eNB->frame*/0,CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id);
-/*
-#ifdef EXMIMO
-#ifdef DRIVER2013
- //carrier_freq[CC_id] = carrier_freq_local;
- //openair_daq_vars.freq_offset = -2000;
- p_exmimo_config->rf.rf_freq_rx[rf_map[CC_id].chain] = carrier_freq_local;//+openair_daq_vars.freq_offset2;
- p_exmimo_config->rf.rf_freq_tx[rf_map[CC_id].chain] = carrier_freq_local;//+openair_daq_vars.freq_offset2;
- p_exmimo_config->rf.tx_gain[rf_map[CC_id].chain][0] = 10;
- p_exmimo_config->rf.rf_vcocal[rf_map[CC_id].chain] = 2015;
- p_exmimo_config->rf.rf_local[rf_map[CC_id].chain] = 8254992; //this should be taken form calibration file
- p_exmimo_config->rf.rffe_band_mode[rf_map[CC_id].chain] = DD_TDD;
-#endif
-#endif
-*/
} else {
LOG_E(PHY,"[eNB %d] Frame %d: ARFCN %d of SCell %d for UE %d not supported\n",Mod_id,/*eNB->frame*/0,dl_CarrierFreq_r10,CC_id,UE_id);
}
@@ -906,11 +874,11 @@ void phy_init_lte_top(LTE_DL_FRAME_PARMS *frame_parms)
* \param[in] frame_parms LTE_DL_FRAME_PARMS structure.
* \note This function is optimistic in that it expects malloc() to succeed.
*/
-void phy_init_lte_ue__PDSCH( LTE_UE_PDSCH* const pdsch, const LTE_DL_FRAME_PARMS* const frame_parms )
+void phy_init_lte_ue__PDSCH( LTE_UE_PDSCH* const pdsch, const LTE_DL_FRAME_PARMS* const fp )
{
AssertFatal( pdsch, "pdsch==0" );
- pdsch->pmi_ext = (uint8_t*)malloc16_clear( frame_parms->N_RB_DL );
+ pdsch->pmi_ext = (uint8_t*)malloc16_clear( fp->N_RB_DL );
pdsch->llr[0] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
pdsch->llr128 = (int16_t**)malloc16_clear( sizeof(int16_t*) );
pdsch->llr128_2ndstream = (int16_t**)malloc16_clear( sizeof(int16_t*) );
@@ -918,7 +886,7 @@ void phy_init_lte_ue__PDSCH( LTE_UE_PDSCH* const pdsch, const LTE_DL_FRAME_PARMS
pdsch->rxdataF_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->rxdataF_comp0 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
- pdsch->rho = (int32_t**)malloc16_clear( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
+ pdsch->rho = (int32_t**)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t*) );
pdsch->dl_ch_estimates_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->dl_ch_rho_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch->dl_ch_rho2_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
@@ -926,14 +894,14 @@ void phy_init_lte_ue__PDSCH( LTE_UE_PDSCH* const pdsch, const LTE_DL_FRAME_PARMS
pdsch->dl_ch_magb0 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
// the allocated memory size is fixed:
- AssertFatal( frame_parms->nb_antennas_rx <= 2, "nb_antennas_rx > 2" );
+ AssertFatal( fp->nb_antennas_rx <= 2, "nb_antennas_rx > 2" );
- for (int i=0; inb_antennas_rx; i++) {
- pdsch->rho[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(frame_parms->N_RB_DL*12*7*2) );
+ for (int i=0; inb_antennas_rx; i++) {
+ pdsch->rho[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->N_RB_DL*12*7*2) );
- for (int j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++)
+ for (int j=0; j<4; j++) { //fp->nb_antennas_tx; j++)
const int idx = (j<<1)+i;
- const size_t num = 7*2*frame_parms->N_RB_DL*12;
+ const size_t num = 7*2*fp->N_RB_DL*12;
pdsch->rxdataF_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->rxdataF_comp0[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdsch->dl_ch_estimates_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
@@ -952,7 +920,7 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
{
// create shortcuts
- LTE_DL_FRAME_PARMS* const frame_parms = &ue->frame_parms;
+ LTE_DL_FRAME_PARMS* const fp = &ue->frame_parms;
LTE_UE_COMMON* const common_vars = &ue->common_vars;
LTE_UE_PDSCH** const pdsch_vars = ue->pdsch_vars;
LTE_UE_PDSCH** const pdsch_vars_SI = ue->pdsch_vars_SI;
@@ -965,11 +933,11 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
int i,j,k;
int eNB_id;
- printf("Initializing UE vars (abstraction %"PRIu8") for eNB TXant %"PRIu8", UE RXant %"PRIu8"\n",abstraction_flag,frame_parms->nb_antennas_tx,frame_parms->nb_antennas_rx);
+ printf("Initializing UE vars (abstraction %"PRIu8") for eNB TXant %"PRIu8", UE RXant %"PRIu8"\n",abstraction_flag,fp->nb_antennas_tx,fp->nb_antennas_rx);
LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_UE][MOD %02u][]\n", ue->Mod_id+NB_eNB_INST);
// many memory allocation sizes are hard coded
- AssertFatal( frame_parms->nb_antennas_rx <= 2, "hard coded allocation for ue_common_vars->dl_ch_estimates[eNB_id]" );
+ AssertFatal( fp->nb_antennas_rx <= 2, "hard coded allocation for ue_common_vars->dl_ch_estimates[eNB_id]" );
AssertFatal( ue->n_connected_eNB <= NUMBER_OF_CONNECTED_eNB_MAX, "n_connected_eNB is too large" );
// init phy_vars_ue
@@ -988,31 +956,32 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
ue->total_received_bits[eNB_id] = 0;
}
- ue->tx_power_dBm=-127;
+ for (i=0;i<10;i++)
+ ue->tx_power_dBm[i]=-127;
if (abstraction_flag == 0) {
// init TX buffers
- common_vars->txdata = (int32_t**)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t*) );
- common_vars->txdataF = (int32_t **)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t*) );
+ common_vars->txdata = (int32_t**)malloc16( fp->nb_antennas_tx*sizeof(int32_t*) );
+ common_vars->txdataF = (int32_t **)malloc16( fp->nb_antennas_tx*sizeof(int32_t*) );
- for (i=0; inb_antennas_tx; i++) {
+ for (i=0; inb_antennas_tx; i++) {
- common_vars->txdata[i] = (int32_t*)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(int32_t) );
- common_vars->txdataF[i] = (int32_t *)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t) );
+ common_vars->txdata[i] = (int32_t*)malloc16_clear( fp->samples_per_tti*10*sizeof(int32_t) );
+ common_vars->txdataF[i] = (int32_t *)malloc16_clear( fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t) );
}
// init RX buffers
- common_vars->rxdata = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
- common_vars->rxdataF = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
- common_vars->rxdataF2 = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
+ common_vars->rxdata = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
+ common_vars->rxdataF = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
+ common_vars->rxdataF2 = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
- for (i=0; inb_antennas_rx; i++) {
- common_vars->rxdata[i] = (int32_t*) malloc16_clear( (FRAME_LENGTH_COMPLEX_SAMPLES+2048)*sizeof(int32_t) );
- common_vars->rxdataF[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(frame_parms->ofdm_symbol_size*14) );
- common_vars->rxdataF2[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti*10) );
+ for (i=0; inb_antennas_rx; i++) {
+ common_vars->rxdata[i] = (int32_t*) malloc16_clear( (fp->samples_per_tti*10+2048)*sizeof(int32_t) );
+ common_vars->rxdataF[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->ofdm_symbol_size*14) );
+ common_vars->rxdataF2[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->ofdm_symbol_size*fp->symbols_per_tti*10) );
}
}
@@ -1021,11 +990,11 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
common_vars->dl_ch_estimates[eNB_id] = (int32_t**)malloc16_clear(8*sizeof(int32_t*));
common_vars->dl_ch_estimates_time[eNB_id] = (int32_t**)malloc16_clear(8*sizeof(int32_t*));
- for (i=0; inb_antennas_rx; i++)
+ for (i=0; inb_antennas_rx; i++)
for (j=0; j<4; j++) {
int idx = (j<<1) + i;
- common_vars->dl_ch_estimates[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*frame_parms->symbols_per_tti*(frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH) );
- common_vars->dl_ch_estimates_time[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*frame_parms->ofdm_symbol_size*2 );
+ common_vars->dl_ch_estimates[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->symbols_per_tti*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH) );
+ common_vars->dl_ch_estimates_time[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 );
}
}
@@ -1040,9 +1009,9 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
pbch_vars[eNB_id] = (LTE_UE_PBCH *)malloc16_clear(sizeof(LTE_UE_PBCH));
if (abstraction_flag == 0) {
- phy_init_lte_ue__PDSCH( pdsch_vars[eNB_id], frame_parms );
+ phy_init_lte_ue__PDSCH( pdsch_vars[eNB_id], fp );
- pdsch_vars[eNB_id]->llr_shifts = (uint8_t*)malloc16_clear(7*2*frame_parms->N_RB_DL*12);
+ pdsch_vars[eNB_id]->llr_shifts = (uint8_t*)malloc16_clear(7*2*fp->N_RB_DL*12);
pdsch_vars[eNB_id]->llr_shifts_p = pdsch_vars[eNB_id]->llr_shifts;
pdsch_vars[eNB_id]->dl_ch_mag1 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdsch_vars[eNB_id]->dl_ch_magb1 = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
@@ -1051,19 +1020,19 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
for (k=0; k<8; k++)
pdsch_vars[eNB_id]->rxdataF_comp1[k] = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
- for (i=0; inb_antennas_rx; i++)
+ for (i=0; inb_antennas_rx; i++)
for (j=0; j<4; j++) {
int idx = (j<<1)+i;
- pdsch_vars[eNB_id]->dl_ch_mag1[idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(frame_parms->N_RB_DL*12) );
- pdsch_vars[eNB_id]->dl_ch_magb1[idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(frame_parms->N_RB_DL*12) );
+ pdsch_vars[eNB_id]->dl_ch_mag1[idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
+ pdsch_vars[eNB_id]->dl_ch_magb1[idx] = (int32_t*)malloc16_clear( 7*2*sizeof(int32_t)*(fp->N_RB_DL*12) );
for (k=0; k<8; k++)
- pdsch_vars[eNB_id]->rxdataF_comp1[idx][k] = (int32_t*)malloc16_clear( sizeof(int32_t)*(frame_parms->N_RB_DL*12*14) );
+ pdsch_vars[eNB_id]->rxdataF_comp1[idx][k] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->N_RB_DL*12*14) );
}
- phy_init_lte_ue__PDSCH( pdsch_vars_SI[eNB_id], frame_parms );
- phy_init_lte_ue__PDSCH( pdsch_vars_ra[eNB_id], frame_parms );
- phy_init_lte_ue__PDSCH( pdsch_vars_mch[eNB_id], frame_parms );
+ phy_init_lte_ue__PDSCH( pdsch_vars_SI[eNB_id], fp );
+ phy_init_lte_ue__PDSCH( pdsch_vars_ra[eNB_id], fp );
+ phy_init_lte_ue__PDSCH( pdsch_vars_mch[eNB_id], fp );
// 100 PRBs * 12 REs/PRB * 4 PDCCH SYMBOLS * 2 LLRs/RE
pdcch_vars[eNB_id]->llr = (uint16_t*)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
pdcch_vars[eNB_id]->llr16 = (uint16_t*)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
@@ -1072,17 +1041,17 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
pdcch_vars[eNB_id]->rxdataF_comp = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdcch_vars[eNB_id]->dl_ch_rho_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
- pdcch_vars[eNB_id]->rho = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
+ pdcch_vars[eNB_id]->rho = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
pdcch_vars[eNB_id]->rxdataF_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdcch_vars[eNB_id]->dl_ch_estimates_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
- for (i=0; inb_antennas_rx; i++) {
- //ue_pdcch_vars[eNB_id]->rho[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(frame_parms->N_RB_DL*12*7*2) );
+ for (i=0; inb_antennas_rx; i++) {
+ //ue_pdcch_vars[eNB_id]->rho[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->N_RB_DL*12*7*2) );
pdcch_vars[eNB_id]->rho[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(100*12*4) );
- for (j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++)
+ for (j=0; j<4; j++) { //fp->nb_antennas_tx; j++)
int idx = (j<<1)+i;
- // size_t num = 7*2*frame_parms->N_RB_DL*12;
+ // size_t num = 7*2*fp->N_RB_DL*12;
size_t num = 4*100*12; // 4 symbols, 100 PRBs, 12 REs per PRB
pdcch_vars[eNB_id]->rxdataF_comp[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdcch_vars[eNB_id]->dl_ch_rho_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
@@ -1092,17 +1061,17 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
}
// PBCH
- pbch_vars[eNB_id]->rxdataF_ext = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
+ pbch_vars[eNB_id]->rxdataF_ext = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
pbch_vars[eNB_id]->rxdataF_comp = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pbch_vars[eNB_id]->dl_ch_estimates_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pbch_vars[eNB_id]->llr = (int8_t*)malloc16_clear( 1920 );
- prach_vars[eNB_id]->prachF = (int16_t*)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(frame_parms->ofdm_symbol_size*12)) );
- prach_vars[eNB_id]->prach = (int16_t*)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(frame_parms->ofdm_symbol_size*12)) );
+ prach_vars[eNB_id]->prachF = (int16_t*)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) );
+ prach_vars[eNB_id]->prach = (int16_t*)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) );
- for (i=0; inb_antennas_rx; i++) {
+ for (i=0; inb_antennas_rx; i++) {
pbch_vars[eNB_id]->rxdataF_ext[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*6*12*4 );
- for (j=0; j<4; j++) {//frame_parms->nb_antennas_tx;j++) {
+ for (j=0; j<4; j++) {//fp->nb_antennas_tx;j++) {
int idx = (j<<1)+i;
pbch_vars[eNB_id]->rxdataF_comp[idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*6*12*4 );
pbch_vars[eNB_id]->dl_ch_estimates_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*6*12*4 );
@@ -1120,14 +1089,14 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
pdsch_vars_ra[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear( sizeof(LTE_UE_PDSCH) );
if (abstraction_flag == 0) {
- phy_init_lte_ue__PDSCH( pdsch_vars[eNB_id], frame_parms );
+ phy_init_lte_ue__PDSCH( pdsch_vars[eNB_id], fp );
pdsch_vars[eNB_id]->llr[1] = (int16_t*)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
} else { //abstraction == 1
- ue->sinr_dB = (double*) malloc16_clear( frame_parms->N_RB_DL*12*sizeof(double) );
+ ue->sinr_dB = (double*) malloc16_clear( fp->N_RB_DL*12*sizeof(double) );
}
- ue->sinr_CQI_dB = (double*) malloc16_clear( frame_parms->N_RB_DL*12*sizeof(double) );
+ ue->sinr_CQI_dB = (double*) malloc16_clear( fp->N_RB_DL*12*sizeof(double) );
ue->init_averaging = 1;
ue->pdsch_config_dedicated->p_a = dB0; // default value until overwritten by RRCConnectionReconfiguration
@@ -1148,7 +1117,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
{
// shortcuts
- LTE_DL_FRAME_PARMS* const frame_parms = &eNB->frame_parms;
+ LTE_DL_FRAME_PARMS* const fp = &eNB->frame_parms;
LTE_eNB_COMMON* const common_vars = &eNB->common_vars;
LTE_eNB_PUSCH** const pusch_vars = eNB->pusch_vars;
LTE_eNB_SRS* const srs_vars = eNB->srs_vars;
@@ -1162,14 +1131,14 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
LOG_I(PHY,"[eNB %"PRIu8"] Initializing DL_FRAME_PARMS : N_RB_DL %"PRIu8", PHICH Resource %d, PHICH Duration %d\n",
eNB->Mod_id,
- frame_parms->N_RB_DL,frame_parms->phich_config_common.phich_resource,
- frame_parms->phich_config_common.phich_duration);
+ fp->N_RB_DL,fp->phich_config_common.phich_resource,
+ fp->phich_config_common.phich_duration);
LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_eNB][MOD %02"PRIu8"][]\n", eNB->Mod_id);
if (eNB->node_function != NGFI_RRU_IF4p5) {
- lte_gold(frame_parms,eNB->lte_gold_table,frame_parms->Nid_cell);
- generate_pcfich_reg_mapping(frame_parms);
- generate_phich_reg_mapping(frame_parms);
+ lte_gold(fp,eNB->lte_gold_table,fp->Nid_cell);
+ generate_pcfich_reg_mapping(fp);
+ generate_phich_reg_mapping(fp);
for (UE_id=0; UE_idfirst_run_timing_advance[UE_id] =
@@ -1191,35 +1160,35 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
// TX vars
if (eNB->node_function != NGFI_RCC_IF4p5)
- common_vars->txdata[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t*) );
- common_vars->txdataF[eNB_id] = (int32_t **)malloc16( frame_parms->nb_antennas_tx*sizeof(int32_t*) );
+ common_vars->txdata[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_tx*sizeof(int32_t*) );
+ common_vars->txdataF[eNB_id] = (int32_t **)malloc16( fp->nb_antennas_tx*sizeof(int32_t*) );
- for (i=0; inb_antennas_tx; i++) {
+ for (i=0; inb_antennas_tx; i++) {
if (eNB->node_function != NGFI_RCC_IF4p5)
- common_vars->txdata[eNB_id][i] = (int32_t*)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(int32_t) );
- common_vars->txdataF[eNB_id][i] = (int32_t*)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t) );
+ common_vars->txdata[eNB_id][i] = (int32_t*)malloc16_clear( fp->samples_per_tti*10*sizeof(int32_t) );
+ common_vars->txdataF[eNB_id][i] = (int32_t*)malloc16_clear( fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t) );
#ifdef DEBUG_PHY
printf("[openair][LTE_PHY][INIT] common_vars->txdata[%d][%d] = %p\n",eNB_id,i,common_vars->txdata[eNB_id][i]);
printf("[openair][LTE_PHY][INIT] common_vars->txdataF[%d][%d] = %p (%d bytes)\n",
eNB_id,i,common_vars->txdataF[eNB_id][i],
- FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t));
+ fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t));
#endif
}
// RX vars
if (eNB->node_function != NGFI_RCC_IF4p5) {
- common_vars->rxdata[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
- common_vars->rxdata_7_5kHz[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
+ common_vars->rxdata[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
+ common_vars->rxdata_7_5kHz[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
}
- common_vars->rxdataF[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
+ common_vars->rxdataF[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
- for (i=0; inb_antennas_rx; i++) {
+ for (i=0; inb_antennas_rx; i++) {
if (eNB->node_function != NGFI_RCC_IF4p5) {
- common_vars->rxdata[eNB_id][i] = (int32_t*)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(int32_t) );
- common_vars->rxdata_7_5kHz[eNB_id][i] = (int32_t*)malloc16_clear( frame_parms->samples_per_tti*sizeof(int32_t) );
+ common_vars->rxdata[eNB_id][i] = (int32_t*)malloc16_clear( fp->samples_per_tti*10*sizeof(int32_t) );
+ common_vars->rxdata_7_5kHz[eNB_id][i] = (int32_t*)malloc16_clear( fp->samples_per_tti*sizeof(int32_t) );
}
- common_vars->rxdataF[eNB_id][i] = (int32_t*)malloc16_clear(sizeof(int32_t)*(frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti) );
+ common_vars->rxdataF[eNB_id][i] = (int32_t*)malloc16_clear(sizeof(int32_t)*(fp->ofdm_symbol_size*fp->symbols_per_tti) );
#ifdef DEBUG_PHY
printf("[openair][LTE_PHY][INIT] common_vars->rxdata[%d][%d] = %p\n",eNB_id,i,common_vars->rxdata[eNB_id][i]);
printf("[openair][LTE_PHY][INIT] common_vars->rxdata_7_5kHz[%d][%d] = %p\n",eNB_id,i,common_vars->rxdata_7_5kHz[eNB_id][i]);
@@ -1230,19 +1199,19 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
// Channel estimates for SRS
for (UE_id=0; UE_idnb_antennas_rx*sizeof(int32_t*) );
- srs_vars[UE_id].srs_ch_estimates_time[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
+ srs_vars[UE_id].srs_ch_estimates[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
+ srs_vars[UE_id].srs_ch_estimates_time[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
- for (i=0; inb_antennas_rx; i++) {
- srs_vars[UE_id].srs_ch_estimates[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*frame_parms->ofdm_symbol_size );
- srs_vars[UE_id].srs_ch_estimates_time[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*frame_parms->ofdm_symbol_size*2 );
+ for (i=0; inb_antennas_rx; i++) {
+ srs_vars[UE_id].srs_ch_estimates[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size );
+ srs_vars[UE_id].srs_ch_estimates_time[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 );
}
} //UE_id
- common_vars->sync_corr[eNB_id] = (uint32_t*)malloc16_clear( LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(uint32_t)*frame_parms->samples_per_tti );
+ common_vars->sync_corr[eNB_id] = (uint32_t*)malloc16_clear( LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(uint32_t)*fp->samples_per_tti );
}
} else { //UPLINK abstraction = 1
- eNB->sinr_dB = (double*) malloc16_clear( frame_parms->N_RB_DL*12*sizeof(double) );
+ eNB->sinr_dB = (double*) malloc16_clear( fp->N_RB_DL*12*sizeof(double) );
}
} //eNB_id
@@ -1254,7 +1223,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
// SRS
for (UE_id=0; UE_idofdm_symbol_size*sizeof(int32_t));
+ srs_vars[UE_id].srs = (int32_t*)malloc16_clear(2*fp->ofdm_symbol_size*sizeof(int32_t));
}
}
}
@@ -1267,19 +1236,19 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
prach_vars->prachF = (int16_t*)malloc16_clear( 1024*2*sizeof(int16_t) );
/* number of elements of an array X is computed as sizeof(X) / sizeof(X[0]) */
- AssertFatal(frame_parms->nb_antennas_rx <= sizeof(prach_vars->rxsigF) / sizeof(prach_vars->rxsigF[0]),
+ AssertFatal(fp->nb_antennas_rx <= sizeof(prach_vars->rxsigF) / sizeof(prach_vars->rxsigF[0]),
"nb_antennas_rx too large");
- for (i=0; inb_antennas_rx; i++) {
- prach_vars->rxsigF[i] = (int16_t*)malloc16_clear( frame_parms->ofdm_symbol_size*12*2*sizeof(int16_t) );
+ for (i=0; inb_antennas_rx; i++) {
+ prach_vars->rxsigF[i] = (int16_t*)malloc16_clear( fp->ofdm_symbol_size*12*2*sizeof(int16_t) );
#ifdef DEBUG_PHY
printf("[openair][LTE_PHY][INIT] prach_vars->rxsigF[%d] = %p\n",i,prach_vars->rxsigF[i]);
#endif
}
if (eNB->node_function != NGFI_RRU_IF4p5) {
- AssertFatal(frame_parms->nb_antennas_rx <= sizeof(prach_vars->prach_ifft) / sizeof(prach_vars->prach_ifft[0]),
+ AssertFatal(fp->nb_antennas_rx <= sizeof(prach_vars->prach_ifft) / sizeof(prach_vars->prach_ifft[0]),
"nb_antennas_rx too large");
- for (i=0; inb_antennas_rx; i++) {
+ for (i=0; inb_antennas_rx; i++) {
prach_vars->prach_ifft[i] = (int16_t*)malloc16_clear(1024*2*sizeof(int16_t));
#ifdef DEBUG_PHY
printf("[openair][LTE_PHY][INIT] prach_vars->prach_ifft[%d] = %p\n",i,prach_vars->prach_ifft[i]);
@@ -1294,61 +1263,61 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
if (abstraction_flag==0) {
for (eNB_id=0; eNB_id<3; eNB_id++) {
- pusch_vars[UE_id]->rxdataF_ext[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
- pusch_vars[UE_id]->rxdataF_ext2[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
- pusch_vars[UE_id]->drs_ch_estimates[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
- pusch_vars[UE_id]->drs_ch_estimates_time[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
- pusch_vars[UE_id]->rxdataF_comp[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
- pusch_vars[UE_id]->ul_ch_mag[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
- pusch_vars[UE_id]->ul_ch_magb[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
+ pusch_vars[UE_id]->rxdataF_ext[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
+ pusch_vars[UE_id]->rxdataF_ext2[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
+ pusch_vars[UE_id]->drs_ch_estimates[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
+ pusch_vars[UE_id]->drs_ch_estimates_time[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
+ pusch_vars[UE_id]->rxdataF_comp[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
+ pusch_vars[UE_id]->ul_ch_mag[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
+ pusch_vars[UE_id]->ul_ch_magb[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
- for (i=0; inb_antennas_rx; i++) {
+ for (i=0; inb_antennas_rx; i++) {
// RK 2 times because of output format of FFT!
// FIXME We should get rid of this
- pusch_vars[UE_id]->rxdataF_ext[eNB_id][i] = (int32_t*)malloc16_clear( 2*sizeof(int32_t)*frame_parms->N_RB_UL*12*frame_parms->symbols_per_tti );
- pusch_vars[UE_id]->rxdataF_ext2[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*frame_parms->N_RB_UL*12*frame_parms->symbols_per_tti );
- pusch_vars[UE_id]->drs_ch_estimates[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*frame_parms->N_RB_UL*12*frame_parms->symbols_per_tti );
- pusch_vars[UE_id]->drs_ch_estimates_time[eNB_id][i] = (int32_t*)malloc16_clear( 2*2*sizeof(int32_t)*frame_parms->ofdm_symbol_size );
- pusch_vars[UE_id]->rxdataF_comp[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*frame_parms->N_RB_UL*12*frame_parms->symbols_per_tti );
- pusch_vars[UE_id]->ul_ch_mag[eNB_id][i] = (int32_t*)malloc16_clear( frame_parms->symbols_per_tti*sizeof(int32_t)*frame_parms->N_RB_UL*12 );
- pusch_vars[UE_id]->ul_ch_magb[eNB_id][i] = (int32_t*)malloc16_clear( frame_parms->symbols_per_tti*sizeof(int32_t)*frame_parms->N_RB_UL*12 );
+ pusch_vars[UE_id]->rxdataF_ext[eNB_id][i] = (int32_t*)malloc16_clear( 2*sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
+ pusch_vars[UE_id]->rxdataF_ext2[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
+ pusch_vars[UE_id]->drs_ch_estimates[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
+ pusch_vars[UE_id]->drs_ch_estimates_time[eNB_id][i] = (int32_t*)malloc16_clear( 2*2*sizeof(int32_t)*fp->ofdm_symbol_size );
+ pusch_vars[UE_id]->rxdataF_comp[eNB_id][i] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
+ pusch_vars[UE_id]->ul_ch_mag[eNB_id][i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
+ pusch_vars[UE_id]->ul_ch_magb[eNB_id][i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
}
// In case of Distributed Alamouti Collabrative scheme separate channel estimates are required for both the UEs
if (cooperation_flag == 2) {
- pusch_vars[UE_id]->drs_ch_estimates_0[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) ); // UE 0 DRS estimates
- pusch_vars[UE_id]->drs_ch_estimates_1[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) ); // UE 1 DRS estimates
+ pusch_vars[UE_id]->drs_ch_estimates_0[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) ); // UE 0 DRS estimates
+ pusch_vars[UE_id]->drs_ch_estimates_1[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) ); // UE 1 DRS estimates
- for (i=0; inb_antennas_rx; i++) {
- pusch_vars[UE_id]->drs_ch_estimates_0[eNB_id][i] = (int32_t*)malloc16_clear( frame_parms->symbols_per_tti*sizeof(int32_t)*frame_parms->N_RB_UL*12 );
- pusch_vars[UE_id]->drs_ch_estimates_1[eNB_id][i] = (int32_t*)malloc16_clear( frame_parms->symbols_per_tti*sizeof(int32_t)*frame_parms->N_RB_UL*12 );
+ for (i=0; inb_antennas_rx; i++) {
+ pusch_vars[UE_id]->drs_ch_estimates_0[eNB_id][i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
+ pusch_vars[UE_id]->drs_ch_estimates_1[eNB_id][i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
}
// Compensated data for the case of Distributed Alamouti Scheme
- pusch_vars[UE_id]->rxdataF_comp_0[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) ); // it will contain(y)*(h0*)
- pusch_vars[UE_id]->rxdataF_comp_1[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) ); // it will contain(y*)*(h1)
+ pusch_vars[UE_id]->rxdataF_comp_0[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) ); // it will contain(y)*(h0*)
+ pusch_vars[UE_id]->rxdataF_comp_1[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) ); // it will contain(y*)*(h1)
- for (i=0; inb_antennas_rx; i++) {
- pusch_vars[UE_id]->rxdataF_comp_0[eNB_id][i] = (int32_t*)malloc16_clear( frame_parms->symbols_per_tti*sizeof(int32_t)*frame_parms->N_RB_UL*12 );
- pusch_vars[UE_id]->rxdataF_comp_1[eNB_id][i] = (int32_t*)malloc16_clear( frame_parms->symbols_per_tti*sizeof(int32_t)*frame_parms->N_RB_UL*12 );
+ for (i=0; inb_antennas_rx; i++) {
+ pusch_vars[UE_id]->rxdataF_comp_0[eNB_id][i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
+ pusch_vars[UE_id]->rxdataF_comp_1[eNB_id][i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
}
// UE 0
- pusch_vars[UE_id]->ul_ch_mag_0[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
- pusch_vars[UE_id]->ul_ch_magb_0[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
+ pusch_vars[UE_id]->ul_ch_mag_0[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
+ pusch_vars[UE_id]->ul_ch_magb_0[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
- for (i=0; inb_antennas_rx; i++) {
- pusch_vars[UE_id]->ul_ch_mag_0[eNB_id][i] = (int32_t*)malloc16_clear( frame_parms->symbols_per_tti*sizeof(int32_t)*frame_parms->N_RB_UL*12 );
- pusch_vars[UE_id]->ul_ch_magb_0[eNB_id][i] = (int32_t*)malloc16_clear( frame_parms->symbols_per_tti*sizeof(int32_t)*frame_parms->N_RB_UL*12 );
+ for (i=0; inb_antennas_rx; i++) {
+ pusch_vars[UE_id]->ul_ch_mag_0[eNB_id][i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
+ pusch_vars[UE_id]->ul_ch_magb_0[eNB_id][i] = (int32_t*)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
}
// UE 1
- pusch_vars[UE_id]->ul_ch_mag_1[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
- pusch_vars[UE_id]->ul_ch_magb_1[eNB_id] = (int32_t**)malloc16( frame_parms->nb_antennas_rx*sizeof(int32_t*) );
+ pusch_vars[UE_id]->ul_ch_mag_1[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
+ pusch_vars[UE_id]->ul_ch_magb_1[eNB_id] = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
- for (i=0; inb_antennas_rx; i++) {
- pusch_vars[UE_id]->ul_ch_mag_1[eNB_id][i] = (int32_t*)malloc16( frame_parms->symbols_per_tti*sizeof(int32_t)*frame_parms->N_RB_UL*12 );
- pusch_vars[UE_id]->ul_ch_magb_1[eNB_id][i] = (int32_t*)malloc16( frame_parms->symbols_per_tti*sizeof(int32_t)*frame_parms->N_RB_UL*12 );
+ for (i=0; inb_antennas_rx; i++) {
+ pusch_vars[UE_id]->ul_ch_mag_1[eNB_id][i] = (int32_t*)malloc16( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
+ pusch_vars[UE_id]->ul_ch_magb_1[eNB_id][i] = (int32_t*)malloc16( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
}
}//cooperation_flag
} //eNB_id
@@ -1373,15 +1342,15 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
return(-1);
}
- for (j=0; jframe_parms.nb_antennas_tx; j++) {
- eNB->dl_precoder_SeNB[eNB_id][j] = (int *)malloc16(2*sizeof(int)*(eNB->frame_parms.ofdm_symbol_size)); // repeated format (hence the '2*')
+ for (j=0; jnb_antennas_tx; j++) {
+ eNB->dl_precoder_SeNB[eNB_id][j] = (int *)malloc16(2*sizeof(int)*(fp->ofdm_symbol_size)); // repeated format (hence the '2*')
if (eNB->dl_precoder_SeNB[eNB_id][j]) {
#ifdef DEBUG_PHY
printf("[openair][LTE_PHY][INIT] eNB->dl_precoder_SeNB[%d][%d] allocated at %p\n",eNB_id,j,
eNB->dl_precoder_SeNB[eNB_id][j]);
#endif
- memset(eNB->dl_precoder_SeNB[eNB_id][j],0,2*sizeof(int)*(eNB->frame_parms.ofdm_symbol_size));
+ memset(eNB->dl_precoder_SeNB[eNB_id][j],0,2*sizeof(int)*(fp->ofdm_symbol_size));
} else {
printf("[openair][LTE_PHY][INIT] eNB->dl_precoder_SeNB[%d][%d] not allocated\n",eNB_id,j);
return(-1);
diff --git a/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c b/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c
index b78a7e24fd..c2be7ad1bd 100644
--- a/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c
+++ b/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync.c
@@ -30,6 +30,8 @@
#include "PHY/defs.h"
#include "PHY/extern.h"
+#include "UTIL/LOG/vcd_signal_dumper.h"
+
#define DEBUG_PHY
// Adjust location synchronization point to account for drift
@@ -48,6 +50,8 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
int diff;
short Re,Im,ncoef;
+ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ADJUST_SYNCH, VCD_FUNCTION_IN);
+
ncoef = 32767 - coef;
#ifdef DEBUG_PHY
@@ -98,6 +102,7 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
ue->proc.proc_rxtx[0].frame_rx,ue->rx_offset,max_pos,max_pos_fil,temp);
#endif //DEBUG_PHY
+ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ADJUST_SYNCH, VCD_FUNCTION_OUT);
}
diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c
index 0117c8e7d2..5667740aec 100644
--- a/openair1/PHY/LTE_TRANSPORT/dci.c
+++ b/openair1/PHY/LTE_TRANSPORT/dci.c
@@ -2664,8 +2664,10 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars,
uint8_t mi,
uint16_t si_rnti,
uint16_t ra_rnti,
+ uint16_t p_rnti,
uint8_t L,
uint8_t format_si,
+ uint8_t format_p,
uint8_t format_ra,
uint8_t format_c,
uint8_t sizeof_bits,
@@ -2797,6 +2799,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars,
#endif
if (((L>1) && ((crc == si_rnti)||
+ (crc == p_rnti)||
(crc == ra_rnti)))||
(crc == pdcch_vars[eNB_id]->crnti)) {
dci_alloc[*dci_cnt].dci_length = sizeof_bits;
@@ -2831,6 +2834,9 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars,
if (crc==si_rnti) {
dci_alloc[*dci_cnt].format = format_si;
*dci_cnt = *dci_cnt+1;
+ } else if (crc==p_rnti) {
+ dci_alloc[*dci_cnt].format = format_p;
+ *dci_cnt = *dci_cnt+1;
} else if (crc==ra_rnti) {
dci_alloc[*dci_cnt].format = format_ra;
// store first nCCE of group for PUCCH transmission of ACK/NAK
@@ -3118,7 +3124,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
if (ue->prach_resources[eNB_id])
ra_rnti = ue->prach_resources[eNB_id]->ra_RNTI;
- // First check common search spaces at aggregation 4 (SI_RNTI and RA_RNTI format 0/1A),
+ // First check common search spaces at aggregation 4 (SI_RNTI, P_RNTI and RA_RNTI format 0/1A),
// and UE_SPEC format0 (PUSCH) too while we're at it
dci_decoding_procedure0(pdcch_vars,1,subframe,
dci_alloc,
@@ -3127,9 +3133,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
+ P_RNTI,
2,
format1A,
format1A,
+ format1A,
format0,
format1A_size_bits,
format1A_size_bytes,
@@ -3144,7 +3152,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
((format0_found==1)&&(format_c_found==1)))
return(dci_cnt);
- // Now check common search spaces at aggregation 4 (SI_RNTI and RA_RNTI and C-RNTI format 1C),
+ // Now check common search spaces at aggregation 4 (SI_RNTI,P_RNTI and RA_RNTI and C-RNTI format 1C),
// and UE_SPEC format0 (PUSCH) too while we're at it
dci_decoding_procedure0(pdcch_vars,1,subframe,
dci_alloc,
@@ -3153,10 +3161,12 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
+ P_RNTI,
2,
format1C,
format1C,
format1C,
+ format1C,
format1C_size_bits,
format1C_size_bytes,
&dci_cnt,
@@ -3170,7 +3180,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
((format0_found==1)&&(format_c_found==1)))
return(dci_cnt);
- // Now check common search spaces at aggregation 8 (SI_RNTI and RA_RNTI format 1A),
+ // Now check common search spaces at aggregation 8 (SI_RNTI,P_RNTI and RA_RNTI format 1A),
// and UE_SPEC format0 (PUSCH) too while we're at it
// printf("[DCI search] doing common search/format0 aggregation 3\n");
#ifdef DEBUG_DCI_DECODING
@@ -3182,10 +3192,12 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
frame_parms,
mi,
SI_RNTI,
+ P_RNTI,
ra_rnti,
3,
format1A,
format1A,
+ format1A,
format0,
format1A_size_bits,
format1A_size_bytes,
@@ -3209,7 +3221,9 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
- 3,
+ P_RNTI,
+ 3,
+ format1C,
format1C,
format1C,
format1C,
@@ -3241,7 +3255,9 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
- 3,
+ P_RNTI,
+ 3,
+ format1A,
format1A,
format1A,
format0,
@@ -3268,7 +3284,9 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
- 2,
+ P_RNTI,
+ 2,
+ format1A,
format1A,
format1A,
format0,
@@ -3299,9 +3317,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
+ P_RNTI,
1,
format1A,
format1A,
+ format1A,
format0,
format0_size_bits,
format0_size_bytes,
@@ -3326,9 +3346,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
+ P_RNTI,
0,
format1A,
format1A,
+ format1A,
format0,
format0_size_bits,
format0_size_bytes,
@@ -3357,9 +3379,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
+ P_RNTI,
0,
format1A,
format1A,
+ format1A,
format1,
format1_size_bits,
format1_size_bytes,
@@ -3386,9 +3410,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
+ P_RNTI,
1,
format1A,
format1A,
+ format1A,
format1,
format1_size_bits,
format1_size_bytes,
@@ -3416,7 +3442,9 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
- 2,
+ P_RNTI,
+ 2,
+ format1A,
format1A,
format1A,
format1,
@@ -3446,9 +3474,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
+ P_RNTI,
3,
format1A,
format1A,
+ format1A,
format1,
format1_size_bits,
format1_size_bytes,
@@ -3479,9 +3509,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
+ P_RNTI,
0,
format1A,
format1A,
+ format1A,
format2A,
format2A_size_bits,
format2A_size_bytes,
@@ -3508,9 +3540,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
+ P_RNTI,
1,
format1A,
format1A,
+ format1A,
format2A,
format2A_size_bits,
format2A_size_bytes,
@@ -3537,9 +3571,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
+ P_RNTI,
2,
format1A,
format1A,
+ format1A,
format2A,
format2A_size_bits,
format2A_size_bytes,
@@ -3567,9 +3603,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
+ P_RNTI,
3,
format1A,
format1A,
+ format1A,
format2A,
format2A_size_bits,
format2A_size_bytes,
@@ -3591,9 +3629,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
+ P_RNTI,
0,
format1A,
format1A,
+ format1A,
format2,
format2_size_bits,
format2_size_bytes,
@@ -3620,9 +3660,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
+ P_RNTI,
1,
format1A,
format1A,
+ format1A,
format2,
format2_size_bits,
format2_size_bytes,
@@ -3649,9 +3691,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
+ P_RNTI,
2,
format1A,
format1A,
+ format1A,
format2,
format2_size_bits,
format2_size_bytes,
@@ -3679,9 +3723,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
+ P_RNTI,
3,
format1A,
format1A,
+ format1A,
format2,
format2_size_bits,
format2_size_bytes,
@@ -3706,9 +3752,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
+ P_RNTI,
0,
format1A,
format1A,
+ format1A,
format1E_2A_M10PRB,
sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t,
sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t),
@@ -3736,9 +3784,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
+ P_RNTI,
1,
format1A,
format1A,
+ format1A,
format1E_2A_M10PRB,
sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t,
sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t),
@@ -3765,9 +3815,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
+ P_RNTI,
2,
format1A,
format1A,
+ format1A,
format1E_2A_M10PRB,
sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t,
sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t),
@@ -3796,9 +3848,11 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
+ P_RNTI,
3,
format1A,
format1A,
+ format1A,
format1E_2A_M10PRB,
sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t,
sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t),
diff --git a/openair1/PHY/LTE_TRANSPORT/defs.h b/openair1/PHY/LTE_TRANSPORT/defs.h
index 141e5a95dc..090ae4637f 100644
--- a/openair1/PHY/LTE_TRANSPORT/defs.h
+++ b/openair1/PHY/LTE_TRANSPORT/defs.h
@@ -729,6 +729,7 @@ typedef enum {format0,
typedef enum {
SI_PDSCH=0,
RA_PDSCH,
+ P_PDSCH,
PDSCH,
PDSCH1,
PMCH
diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c
index 034dc0ada8..48b3f53be4 100644
--- a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c
+++ b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c
@@ -328,7 +328,7 @@ int allocate_REs_in_RB_no_pilots_64QAM_siso(LTE_DL_FRAME_PARMS *frame_parms,
for (x0p=&x0[*jj],tti_offset=symbol_offset+re_offset,re=0;
re<12;
- re++,x0p+=6,tti_offset++) {
+ re+=4,x0p+=24,tti_offset+=4) {
qam64_table_offset_re=FOUR[x0p[0]];
qam64_table_offset_im=FOUR[x0p[1]];
@@ -338,6 +338,33 @@ int allocate_REs_in_RB_no_pilots_64QAM_siso(LTE_DL_FRAME_PARMS *frame_parms,
qam64_table_offset_im+=x0p[5];
((int16_t *)&txdataF[0][tti_offset])[0]=qam_table_s0[qam64_table_offset_re];
((int16_t *)&txdataF[0][tti_offset])[1]=qam_table_s0[qam64_table_offset_im];
+
+ qam64_table_offset_re=FOUR[x0p[6]];
+ qam64_table_offset_im=FOUR[x0p[7]];
+ qam64_table_offset_re+=TWO[x0p[8]];
+ qam64_table_offset_im+=TWO[x0p[9]];
+ qam64_table_offset_re+=x0p[10];
+ qam64_table_offset_im+=x0p[11];
+ ((int16_t *)&txdataF[0][tti_offset])[2]=qam_table_s0[qam64_table_offset_re];
+ ((int16_t *)&txdataF[0][tti_offset])[3]=qam_table_s0[qam64_table_offset_im];
+
+ qam64_table_offset_re=FOUR[x0p[12]];
+ qam64_table_offset_im=FOUR[x0p[13]];
+ qam64_table_offset_re+=TWO[x0p[14]];
+ qam64_table_offset_im+=TWO[x0p[15]];
+ qam64_table_offset_re+=x0p[16];
+ qam64_table_offset_im+=x0p[17];
+ ((int16_t *)&txdataF[0][tti_offset])[4]=qam_table_s0[qam64_table_offset_re];
+ ((int16_t *)&txdataF[0][tti_offset])[5]=qam_table_s0[qam64_table_offset_im];
+
+ qam64_table_offset_re=FOUR[x0p[18]];
+ qam64_table_offset_im=FOUR[x0p[19]];
+ qam64_table_offset_re+=TWO[x0p[20]];
+ qam64_table_offset_im+=TWO[x0p[21]];
+ qam64_table_offset_re+=x0p[22];
+ qam64_table_offset_im+=x0p[23];
+ ((int16_t *)&txdataF[0][tti_offset])[6]=qam_table_s0[qam64_table_offset_re];
+ ((int16_t *)&txdataF[0][tti_offset])[7]=qam_table_s0[qam64_table_offset_im];
}
}
else {
diff --git a/openair1/PHY/LTE_TRANSPORT/pch.c b/openair1/PHY/LTE_TRANSPORT/pch.c
new file mode 100644
index 0000000000..167d9c19ae
--- /dev/null
+++ b/openair1/PHY/LTE_TRANSPORT/pch.c
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ OpenAirInterface
+ Copyright(c) 1999 - 2014 Eurecom
+
+ OpenAirInterface is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+
+ OpenAirInterface is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with OpenAirInterface.The full GNU General Public License is
+ included in this distribution in the file called "COPYING". If not,
+ see .
+
+ Contact Information
+ OpenAirInterface Admin: openair_admin@eurecom.fr
+ OpenAirInterface Tech : openair_tech@eurecom.fr
+ OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
+
+ Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
+
+ *******************************************************************************/
+#include "PHY/defs.h"
+#include "PHY/extern.h"
+#include "assertions.h"
+
+const unsigned int Ttab[4] = {32,64,128,256};
+
+// This function implements the initialization of paging parameters for UE (See Section 7, 36.304)
+// It must be called after setting IMSImod1024 during UE startup and after receiving SIB2
+int init_ue_paging_info(PHY_VARS_UE *ue, long defaultPagingCycle, long nB) {
+
+ LTE_DL_FRAME_PARMS *fp = &ue->frame_parms;
+
+ unsigned int T = Ttab[defaultPagingCycle];
+ unsigned int N = (nB<=2) ? T : (T>>(nB-2));
+ unsigned int Ns = (nB<2) ? (1<<(2-nB)) : 1;
+ unsigned int UE_ID = ue->IMSImod1024;
+ unsigned int i_s = (UE_ID/N)%Ns;
+
+
+ ue->PF = (T/N) * (UE_ID % N);
+
+ // This implements Section 7.2 from 36.304
+ if (Ns==1)
+ ue->PO = (fp->frame_type==FDD) ? 9 : 0;
+ else if (Ns==2)
+ ue->PO = (fp->frame_type==FDD) ? (4+(5*i_s)) : (5*i_s);
+ else if (Ns==4)
+ ue->PO = (fp->frame_type==FDD) ? (4*(i_s&1)+(5*(i_s>>1))) : ((i_s&1)+(5*(i_s>>1)));
+ else
+ AssertFatal(1==0,"init_ue_paging_info: Ns is %d\n",Ns);
+
+ return(0);
+}
diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h
index c3922b13d5..d0d38b34a6 100644
--- a/openair1/PHY/LTE_TRANSPORT/proto.h
+++ b/openair1/PHY/LTE_TRANSPORT/proto.h
@@ -1339,6 +1339,14 @@ int32_t generate_drs_pusch(PHY_VARS_UE *phy_vars_ue,
@param frame_parms Pointer to a LTE_DL_FRAME_PARMS structure (eNB or UE)*/
void init_ul_hopping(LTE_DL_FRAME_PARMS *frame_parms);
+
+/*!
+ \brief This function implements the initialization of paging parameters for UE (See Section 7, 36.304).It must be called after setting IMSImod1024 during UE startup and after receiving SIB2
+ @param ue Pointer to UE context
+ @param defaultPagingCycle T from 36.304 (0=32,1=64,2=128,3=256)
+ @param nB nB from 36.304 (0=4T,1=2T,2=T,3=T/2,4=T/4,5=T/8,6=T/16,7=T/32*/
+int init_ue_paging_info(PHY_VARS_UE *ue, long defaultPagingCycle, long nB);
+
int32_t compareints (const void * a, const void * b);
diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
index 6ed0f91101..b0c1aa1886 100644
--- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
+++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
@@ -127,7 +127,7 @@ LTE_eNB_ULSCH_t *new_eNB_ulsch(uint8_t max_turbo_iterations,uint8_t N_RB_UL, uin
ulsch->Mlimit = 4;
for (i=0; i<8; i++) {
- // msg("new_ue_ulsch: Harq process %d\n",i);
+ // printf("new_ue_ulsch: Harq process %d\n",i);
ulsch->harq_processes[i] = (LTE_UL_eNB_HARQ_t *)malloc16(sizeof(LTE_UL_eNB_HARQ_t));
if (ulsch->harq_processes[i]) {
@@ -202,11 +202,11 @@ uint8_t extract_cqi_crc(uint8_t *cqi,uint8_t CQI_LENGTH)
uint8_t crc;
crc = cqi[CQI_LENGTH>>3];
- // msg("crc1: %x, shift %d\n",crc,CQI_LENGTH&0x7);
+ // printf("crc1: %x, shift %d\n",crc,CQI_LENGTH&0x7);
crc = (crc<<(CQI_LENGTH&0x7));
// clear crc bits
// ((char *)cqi)[CQI_LENGTH>>3] &= 0xff>>(8-(CQI_LENGTH&0x7));
- // msg("crc2: %x, cqi0 %x\n",crc,cqi[1+(CQI_LENGTH>>3)]);
+ // printf("crc2: %x, cqi0 %x\n",crc,cqi[1+(CQI_LENGTH>>3)]);
crc |= (cqi[1+(CQI_LENGTH>>3)])>>(8-(CQI_LENGTH&0x7));
// clear crc bits
//(((char *)cqi)[1+(CQI_LENGTH>>3)]) = 0;
@@ -258,7 +258,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
// uint8_t ytag2[6*14*1200],*ytag2_ptr;
int16_t cseq[6*14*1200];
int off;
- int status[20];
+
int subframe = proc->subframe_rx;
LTE_UL_eNB_HARQ_t *ulsch_harq;
@@ -312,7 +312,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
#ifdef DEBUG_ULSCH_DECODING
- msg("ulsch_decoding (Nid_cell %d, rnti %x, x2 %x): round %d, RV %d, mcs %d, O_RI %d, O_ACK %d, G %d, subframe %d\n",
+ printf("ulsch_decoding (Nid_cell %d, rnti %x, x2 %x): round %d, RV %d, mcs %d, O_RI %d, O_ACK %d, G %d, subframe %d\n",
frame_parms->Nid_cell,ulsch->rnti,x2,
ulsch_harq->round,
ulsch_harq->rvidx,
@@ -401,7 +401,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
// Q_ACK = Qprime * Q_m;
Qprime_ACK = Qprime;
#ifdef DEBUG_ULSCH_DECODING
- msg("ulsch_decoding.c: Qprime_ACK %d, Msc_initial %d, Nsymb_initial %d, sumKr %d\n",
+ printf("ulsch_decoding.c: Qprime_ACK %d, Msc_initial %d, Nsymb_initial %d, sumKr %d\n",
Qprime_ACK,ulsch_harq->Msc_initial,ulsch_harq->Nsymb_initial,sumKr);
#endif
@@ -430,7 +430,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
Q_CQI = Q_m * Qprime;
#ifdef DEBUG_ULSCH_DECODING
- msg("ulsch_decoding: G %d, Q_RI %d, Q_CQI %d (L %d, Or1 %d) O_ACK %d\n",G,Q_RI,Q_CQI,L,ulsch_harq->Or1,ulsch_harq->O_ACK);
+ printf("ulsch_decoding: G %d, Q_RI %d, Q_CQI %d (L %d, Or1 %d) O_ACK %d\n",G,Q_RI,Q_CQI,L,ulsch_harq->Or1,ulsch_harq->O_ACK);
#endif
G = G - Q_RI - Q_CQI;
@@ -531,7 +531,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
}
#ifdef DEBUG_ULSCH_DECODING
- msg("ulsch_decoding.c: ACK i %d, r %d, j %d, ColumnSet[j] %d\n",i,r,j,columnset[j]);
+ printf("ulsch_decoding.c: ACK i %d, r %d, j %d, ColumnSet[j] %d\n",i,r,j,columnset[j]);
#endif
j=(j+3)&3;
}
@@ -964,15 +964,15 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
}
#ifdef DEBUG_ULSCH_DECODING
- msg("ulsch_decoding: Or1=%d\n",ulsch_harq->Or1);
+ printf("ulsch_decoding: Or1=%d\n",ulsch_harq->Or1);
for (i=0; i<1+((8+ulsch_harq->Or1)/8); i++)
- msg("ulsch_decoding: O[%d] %d\n",i,ulsch_harq->o[i]);
+ printf("ulsch_decoding: O[%d] %d\n",i,ulsch_harq->o[i]);
if (ulsch_harq->cqi_crc_status == 1)
- msg("RX CQI CRC OK (%x)\n",extract_cqi_crc(o_flip,ulsch_harq->Or1));
+ printf("RX CQI CRC OK (%x)\n",extract_cqi_crc(o_flip,ulsch_harq->Or1));
else
- msg("RX CQI CRC NOT OK (%x)\n",extract_cqi_crc(o_flip,ulsch_harq->Or1));
+ printf("RX CQI CRC NOT OK (%x)\n",extract_cqi_crc(o_flip,ulsch_harq->Or1));
#endif
}
@@ -985,6 +985,10 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
r_offset = 0;
+ offset = 0;
+
+ ret = 1;
+
for (r=0; rC; r++) {
// printf("before subblock deinterleaving c[%d] = %p\n",r,ulsch_harq->c[r]);
@@ -1010,7 +1014,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
}
#ifdef DEBUG_ULSCH_DECODING
- msg("f1 %d, f2 %d, F %d\n",f1f2mat_old[2*iind],f1f2mat_old[1+(2*iind)],(r==0) ? ulsch_harq->F : 0);
+ printf("f1 %d, f2 %d, F %d\n",f1f2mat_old[2*iind],f1f2mat_old[1+(2*iind)],(r==0) ? ulsch_harq->F : 0);
#endif
memset(&dummy_w[r][0],0,3*(6144+64)*sizeof(short));
@@ -1019,7 +1023,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
(r==0) ? ulsch_harq->F : 0);
#ifdef DEBUG_ULSCH_DECODING
- msg("Rate Matching Segment %d (coded bits (G) %d,unpunctured/repeated bits %d, Q_m %d, nb_rb %d, Nl %d)...\n",
+ printf("Rate Matching Segment %d (coded bits (G) %d,unpunctured/repeated bits %d, Q_m %d, nb_rb %d, Nl %d)...\n",
r, G,
Kr*3,
Q_m,
@@ -1056,75 +1060,63 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
&ulsch_harq->d[r][96],
ulsch_harq->w[r]);
stop_meas(&eNB->ulsch_deinterleaving_stats);
- }
+
- for (r=0; rC; r++) {
+ if (ulsch_harq->C == 1)
+ crc_type = CRC24_A;
+ else
+ crc_type = CRC24_B;
+
+ start_meas(&eNB->ulsch_turbo_decoding_stats);
+
+ ret = tc(&ulsch_harq->d[r][96],
+ ulsch_harq->c[r],
+ Kr,
+ f1f2mat_old[iind*2],
+ f1f2mat_old[(iind*2)+1],
+ ulsch->max_turbo_iterations,//MAX_TURBO_ITERATIONS,
+ crc_type,
+ (r==0) ? ulsch_harq->F : 0,
+ &eNB->ulsch_tc_init_stats,
+ &eNB->ulsch_tc_alpha_stats,
+ &eNB->ulsch_tc_beta_stats,
+ &eNB->ulsch_tc_gamma_stats,
+ &eNB->ulsch_tc_ext_stats,
+ &eNB->ulsch_tc_intl1_stats,
+ &eNB->ulsch_tc_intl2_stats);
+
+ stop_meas(&eNB->ulsch_turbo_decoding_stats);
+
- /* printf("c[%d] : %p\n",r,
- ulsch_harq->c[r]);
- */
-
- if (ulsch_harq->C == 1)
- crc_type = CRC24_A;
- else
- crc_type = CRC24_B;
-
- start_meas(&eNB->ulsch_turbo_decoding_stats);
-
- ret = tc(&ulsch_harq->d[r][96],
- ulsch_harq->c[r],
- Kr,
- f1f2mat_old[iind*2],
- f1f2mat_old[(iind*2)+1],
- ulsch->max_turbo_iterations,//MAX_TURBO_ITERATIONS,
- crc_type,
- (r==0) ? ulsch_harq->F : 0,
- &eNB->ulsch_tc_init_stats,
- &eNB->ulsch_tc_alpha_stats,
- &eNB->ulsch_tc_beta_stats,
- &eNB->ulsch_tc_gamma_stats,
- &eNB->ulsch_tc_ext_stats,
- &eNB->ulsch_tc_intl1_stats,
- &eNB->ulsch_tc_intl2_stats);
-
- stop_meas(&eNB->ulsch_turbo_decoding_stats);
-
- status[r] = ret;
-
- }
+
+
// Reassembly of Transport block here
- offset = 0;
- ret = 1;
-
- for (r=0; rC; r++) {
- if (status[r] != (1+ulsch->max_turbo_iterations)) {
+ if (ret != (1+ulsch->max_turbo_iterations)) {
if (rCminus)
- Kr = ulsch_harq->Kminus;
+ Kr = ulsch_harq->Kminus;
else
- Kr = ulsch_harq->Kplus;
-
+ Kr = ulsch_harq->Kplus;
+
Kr_bytes = Kr>>3;
-
+
if (r==0) {
- memcpy(ulsch_harq->b,
- &ulsch_harq->c[0][(ulsch_harq->F>>3)],
- Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0));
- offset = Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0);
+ memcpy(ulsch_harq->b,
+ &ulsch_harq->c[0][(ulsch_harq->F>>3)],
+ Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0));
+ offset = Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0);
} else {
- memcpy(ulsch_harq->b+offset,
- ulsch_harq->c[r],
- Kr_bytes - ((ulsch_harq->C>1)?3:0));
- offset += (Kr_bytes- ((ulsch_harq->C>1)?3:0));
+ memcpy(ulsch_harq->b+offset,
+ ulsch_harq->c[r],
+ Kr_bytes - ((ulsch_harq->C>1)?3:0));
+ offset += (Kr_bytes- ((ulsch_harq->C>1)?3:0));
}
-
- if (ret != (1+ulsch->max_turbo_iterations))
- ret = status[r];
+
} else {
- ret = 1+ulsch->max_turbo_iterations;
+ break;
}
-
+
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_ULSCH_DECODING0+harq_pid,0);
@@ -1208,7 +1200,7 @@ int ulsch_abstraction_MIESM(double* sinr_dB,uint8_t TM, uint8_t mcs,uint16_t nrb
sinr_db1 = sinr_dB[offset*2];
sinr_db2 = sinr_dB[offset*2+1];
- msg("sinr_db1=%f\n,sinr_db2=%f\n",sinr_db1,sinr_db2);
+ printf("sinr_db1=%f\n,sinr_db2=%f\n",sinr_db1,sinr_db2);
//rounding up for the table lookup
sinr_db1 *= 10;
@@ -1462,7 +1454,7 @@ int ulsch_abstraction_MIESM(double* sinr_dB,uint8_t TM, uint8_t mcs,uint16_t nrb
sinr_eff = sinr_eff * beta2_dlsch_MI[TM][mcs];
}
- msg("SINR_Eff = %e\n",sinr_eff);
+ printf("SINR_Eff = %e\n",sinr_eff);
sinr_eff *= 10;
sinr_eff = floor(sinr_eff);
@@ -1470,7 +1462,7 @@ int ulsch_abstraction_MIESM(double* sinr_dB,uint8_t TM, uint8_t mcs,uint16_t nrb
// sinr_eff += 1;
// }
sinr_eff /= 10;
- msg("sinr_eff after rounding = %f\n",sinr_eff);
+ printf("sinr_eff after rounding = %f\n",sinr_eff);
for (index = 0; index < 16; index++) {
if(index == 0) {
@@ -1488,10 +1480,10 @@ int ulsch_abstraction_MIESM(double* sinr_dB,uint8_t TM, uint8_t mcs,uint16_t nrb
#ifdef USER_MODE // need to be adapted for the emulation in the kernel space
if (uniformrandom() < bler) {
- msg("abstraction_decoding failed (mcs=%d, sinr_eff=%f, bler=%f)\n",mcs,sinr_eff,bler);
+ printf("abstraction_decoding failed (mcs=%d, sinr_eff=%f, bler=%f)\n",mcs,sinr_eff,bler);
return(0);
} else {
- msg("abstraction_decoding successful (mcs=%d, sinr_eff=%f, bler=%f)\n",mcs,sinr_eff,bler);
+ printf("abstraction_decoding successful (mcs=%d, sinr_eff=%f, bler=%f)\n",mcs,sinr_eff,bler);
return(1);
}
diff --git a/openair1/PHY/TOOLS/defs.h b/openair1/PHY/TOOLS/defs.h
index 8d30a7ea10..3a8a58b6f2 100644
--- a/openair1/PHY/TOOLS/defs.h
+++ b/openair1/PHY/TOOLS/defs.h
@@ -296,10 +296,10 @@ int32_t subcarrier_energy(int32_t *,uint32_t, int32_t* subcarrier_energy, uint16
*/
int32_t signal_energy_nodc(int32_t *,uint32_t);
-/*!\fn double signal_energy_fp(double **, double **,uint32_t, uint32_t,uint32_t);
+/*!\fn double signal_energy_fp(double s_re[2][30720], double s_im[2][30720],uint32_t, uint32_t,uint32_t);
\brief Computes the signal energy per subcarrier
*/
-double signal_energy_fp(double **s_re, double **s_im, uint32_t nb_antennas, uint32_t length,uint32_t offset);
+double signal_energy_fp(double s_re[2][30720], double s_im[2][30720], uint32_t nb_antennas, uint32_t length,uint32_t offset);
/*!\fn double signal_energy_fp2(struct complex *, uint32_t);
\brief Computes the signal energy per subcarrier
diff --git a/openair1/PHY/TOOLS/lte_dfts.c b/openair1/PHY/TOOLS/lte_dfts.c
index 00e1b0b5ce..b50e6c5e34 100644
--- a/openair1/PHY/TOOLS/lte_dfts.c
+++ b/openair1/PHY/TOOLS/lte_dfts.c
@@ -58,10 +58,10 @@
#define print_ints(s,x) printf("%s %d %d %d %d\n",s,(x)[0],(x)[1],(x)[2],(x)[3])
-static int16_t conjugatedft[32] __attribute__((aligned(32))) = {-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1};
+const static int16_t conjugatedft[32] __attribute__((aligned(32))) = {-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1};
-static int16_t reflip[32] __attribute__((aligned(32))) = {1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1};
+const static int16_t reflip[32] __attribute__((aligned(32))) = {1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1};
#if defined(__x86_64__) || defined(__i386__)
static inline void cmac(__m128i a,__m128i b, __m128i *re32, __m128i *im32) __attribute__((always_inline));
@@ -474,33 +474,33 @@ static inline int16x8_t packed_cmult2(int16x8_t a,int16x8_t b, int16x8_t b2)
#endif
-static int16_t W0s[16]__attribute__((aligned(32))) = {32767,0,32767,0,32767,0,32767,0,32767,0,32767,0,32767,0,32767,0};
+const static int16_t W0s[16]__attribute__((aligned(32))) = {32767,0,32767,0,32767,0,32767,0,32767,0,32767,0,32767,0,32767,0};
-static int16_t W13s[16]__attribute__((aligned(32))) = {-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378};
-static int16_t W23s[16]__attribute__((aligned(32))) = {-16384,28378,-16384,28378,-16384,28378,-16384,28378,-16384,28378,-16384,28378,-16384,28378,-16384,28378};
+const static int16_t W13s[16]__attribute__((aligned(32))) = {-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378,-16384,-28378};
+const static int16_t W23s[16]__attribute__((aligned(32))) = {-16384,28378,-16384,28378,-16384,28378,-16384,28378,-16384,28378,-16384,28378,-16384,28378,-16384,28378};
-static int16_t W15s[16]__attribute__((aligned(32))) = {10126,-31163,10126,-31163,10126,-31163,10126,-31163,10126,-31163,10126,-31163,10126,-31163,10126,-31163};
-static int16_t W25s[16]__attribute__((aligned(32))) = {-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260};
-static int16_t W35s[16]__attribute__((aligned(32))) = {-26510,19260,-26510,19260,-26510,19260,-26510,19260,-26510,19260,-26510,19260,-26510,19260,-26510,19260};
-static int16_t W45s[16]__attribute__((aligned(32))) = {10126,31163,10126,31163,10126,31163,10126,31163,10126,31163,10126,31163,10126,31163,10126,31163};
+const static int16_t W15s[16]__attribute__((aligned(32))) = {10126,-31163,10126,-31163,10126,-31163,10126,-31163,10126,-31163,10126,-31163,10126,-31163,10126,-31163};
+const static int16_t W25s[16]__attribute__((aligned(32))) = {-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260,-26509,-19260};
+const static int16_t W35s[16]__attribute__((aligned(32))) = {-26510,19260,-26510,19260,-26510,19260,-26510,19260,-26510,19260,-26510,19260,-26510,19260,-26510,19260};
+const static int16_t W45s[16]__attribute__((aligned(32))) = {10126,31163,10126,31163,10126,31163,10126,31163,10126,31163,10126,31163,10126,31163,10126,31163};
#if defined(__x86_64__) || defined(__i386__)
-__m128i *W0 = (__m128i *)W0s;
-__m128i *W13 = (__m128i *)W13s;
-__m128i *W23 = (__m128i *)W23s;
-__m128i *W15 = (__m128i *)W15s;
-__m128i *W25 = (__m128i *)W25s;
-__m128i *W35 = (__m128i *)W35s;
-__m128i *W45 = (__m128i *)W45s;
+const __m128i *W0 = (__m128i *)W0s;
+const __m128i *W13 = (__m128i *)W13s;
+const __m128i *W23 = (__m128i *)W23s;
+const __m128i *W15 = (__m128i *)W15s;
+const __m128i *W25 = (__m128i *)W25s;
+const __m128i *W35 = (__m128i *)W35s;
+const __m128i *W45 = (__m128i *)W45s;
#ifdef __AVX2__
-__m256i *W0_256 = (__m256i *)W0s;
-__m256i *W13_256 = (__m256i *)W13s;
-__m256i *W23_256 = (__m256i *)W23s;
-__m256i *W15_256 = (__m256i *)W15s;
-__m256i *W25_256 = (__m256i *)W25s;
-__m256i *W35_256 = (__m256i *)W35s;
-__m256i *W45_256 = (__m256i *)W45s;
+const __m256i *W0_256 = (__m256i *)W0s;
+const __m256i *W13_256 = (__m256i *)W13s;
+const __m256i *W23_256 = (__m256i *)W23s;
+const __m256i *W15_256 = (__m256i *)W15s;
+const __m256i *W25_256 = (__m256i *)W25s;
+const __m256i *W35_256 = (__m256i *)W35s;
+const __m256i *W45_256 = (__m256i *)W45s;
#endif
#elif defined(__arm__)
@@ -512,23 +512,23 @@ int16x8_t *W25 = (int16x8_t *)W25s;
int16x8_t *W35 = (int16x8_t *)W35s;
int16x8_t *W45 = (int16x8_t *)W45s;
#endif
-static int16_t dft_norm_table[16] = {9459, //12
- 6689,//24
- 5461,//36
- 4729,//482
- 4230,//60
- 23170,//72
- 3344,//96
- 3153,//108
- 2991,//120
- 18918,//sqrt(3),//144
- 18918,//sqrt(3),//180
- 16384,//2, //192
- 18918,//sqrt(3), // 216
- 16384,//2, //240
- 18918,//sqrt(3), // 288
- 14654
- }; //sqrt(5) //300
+const static int16_t dft_norm_table[16] = {9459, //12
+ 6689,//24
+ 5461,//36
+ 4729,//482
+ 4230,//60
+ 23170,//72
+ 3344,//96
+ 3153,//108
+ 2991,//120
+ 18918,//sqrt(3),//144
+ 18918,//sqrt(3),//180
+ 16384,//2, //192
+ 18918,//sqrt(3), // 216
+ 16384,//2, //240
+ 18918,//sqrt(3), // 288
+ 14654
+}; //sqrt(5) //300
#if defined(__x86_64__) || defined(__i386__)
@@ -2036,42 +2036,42 @@ static inline void transpose4_ooff(int16x4_t *x,int16x4_t *y,int off)
// 16-point optimized DFT kernel
-int16_t tw16[24] __attribute__((aligned(32))) = { 32767,0,30272,-12540,23169 ,-23170,12539 ,-30273,
+const static int16_t tw16[24] __attribute__((aligned(32))) = { 32767,0,30272,-12540,23169 ,-23170,12539 ,-30273,
32767,0,23169,-23170,0 ,-32767,-23170,-23170,
32767,0,12539,-30273,-23170,-23170,-30273,12539
};
-int16_t tw16a[24] __attribute__((aligned(32))) = {32767,0,30272,12540,23169 ,23170,12539 ,30273,
+const static int16_t tw16a[24] __attribute__((aligned(32))) = {32767,0,30272,12540,23169 ,23170,12539 ,30273,
32767,0,23169,23170,0 ,32767,-23170,23170,
32767,0,12539,30273,-23170,23170,-30273,-12539
};
-int16_t tw16b[24] __attribute__((aligned(32))) = { 0,32767,-12540,30272,-23170,23169 ,-30273,12539,
+const static int16_t tw16b[24] __attribute__((aligned(32))) = { 0,32767,-12540,30272,-23170,23169 ,-30273,12539,
0,32767,-23170,23169,-32767,0 ,-23170,-23170,
0,32767,-30273,12539,-23170,-23170,12539 ,-30273
};
-int16_t tw16c[24] __attribute__((aligned(32))) = { 0,32767,12540,30272,23170,23169 ,30273 ,12539,
+const static int16_t tw16c[24] __attribute__((aligned(32))) = { 0,32767,12540,30272,23170,23169 ,30273 ,12539,
0,32767,23170,23169,32767,0 ,23170 ,-23170,
0,32767,30273,12539,23170,-23170,-12539,-30273
};
-int16_t tw16rep[48] __attribute__((aligned(32))) = { 32767,0,30272,-12540,23169 ,-23170,12539 ,-30273,32767,0,30272,-12540,23169 ,-23170,12539 ,-30273,
+const static int16_t tw16rep[48] __attribute__((aligned(32))) = { 32767,0,30272,-12540,23169 ,-23170,12539 ,-30273,32767,0,30272,-12540,23169 ,-23170,12539 ,-30273,
32767,0,23169,-23170,0 ,-32767,-23170,-23170,32767,0,23169,-23170,0 ,-32767,-23170,-23170,
32767,0,12539,-30273,-23170,-23170,-30273,12539,32767,0,12539,-30273,-23170,-23170,-30273,12539
};
-int16_t tw16arep[48] __attribute__((aligned(32))) = {32767,0,30272,12540,23169 ,23170,12539 ,30273,32767,0,30272,12540,23169 ,23170,12539 ,30273,
+const static int16_t tw16arep[48] __attribute__((aligned(32))) = {32767,0,30272,12540,23169 ,23170,12539 ,30273,32767,0,30272,12540,23169 ,23170,12539 ,30273,
32767,0,23169,23170,0 ,32767,-23170,23170,32767,0,23169,23170,0 ,32767,-23170,23170,
32767,0,12539,30273,-23170,23170,-30273,-12539,32767,0,12539,30273,-23170,23170,-30273,-12539
};
-int16_t tw16brep[48] __attribute__((aligned(32))) = { 0,32767,-12540,30272,-23170,23169 ,-30273,12539,0,32767,-12540,30272,-23170,23169 ,-30273,12539,
+const static int16_t tw16brep[48] __attribute__((aligned(32))) = { 0,32767,-12540,30272,-23170,23169 ,-30273,12539,0,32767,-12540,30272,-23170,23169 ,-30273,12539,
0,32767,-23170,23169,-32767,0 ,-23170,-23170,0,32767,-23170,23169,-32767,0 ,-23170,-23170,
0,32767,-30273,12539,-23170,-23170,12539 ,-30273,0,32767,-30273,12539,-23170,-23170,12539 ,-30273
};
-int16_t tw16crep[48] __attribute__((aligned(32))) = { 0,32767,12540,30272,23170,23169 ,30273 ,12539,0,32767,12540,30272,23170,23169 ,30273 ,12539,
+const static int16_t tw16crep[48] __attribute__((aligned(32))) = { 0,32767,12540,30272,23170,23169 ,30273 ,12539,0,32767,12540,30272,23170,23169 ,30273 ,12539,
0,32767,23170,23169,32767,0 ,23170 ,-23170,0,32767,23170,23169,32767,0 ,23170 ,-23170,
0,32767,30273,12539,23170,-23170,-12539,-30273,0,32767,30273,12539,23170,-23170,-12539,-30273
};
@@ -2502,7 +2502,7 @@ static inline void idft16_simd256(int16_t *x,int16_t *y)
// 64-point optimized DFT
-int16_t tw64[96] __attribute__((aligned(32))) = {
+const static int16_t tw64[96] __attribute__((aligned(32))) = {
32767,0,32609,-3212,32137,-6393,31356,-9512,
30272,-12540,28897,-15447,27244,-18205,25329,-20788,
23169,-23170,20787,-25330,18204,-27245,15446,-28898,
@@ -2517,7 +2517,7 @@ int16_t tw64[96] __attribute__((aligned(32))) = {
-30273,12539,-25330,20787,-18205,27244,-9512,31356
};
-int16_t tw64rep[192] __attribute__((aligned(32))) = {
+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,
23169,-23170,20787,-25330,18204,-27245,15446,-28898,23169,-23170,20787,-25330,18204,-27245,15446,-28898,
@@ -2532,7 +2532,7 @@ int16_t tw64rep[192] __attribute__((aligned(32))) = {
-30273,12539,-25330,20787,-18205,27244,-9512,31356,-30273,12539,-25330,20787,-18205,27244,-9512,31356
};
-int16_t tw64a[96] __attribute__((aligned(32))) = {
+const static int16_t tw64a[96] __attribute__((aligned(32))) = {
32767,0,32609,3212,32137,6393,31356,9512,
30272,12540,28897,15447,27244,18205,25329,20788,
23169,23170,20787,25330,18204,27245,15446,28898,
@@ -2546,7 +2546,7 @@ int16_t tw64a[96] __attribute__((aligned(32))) = {
-23170,23170,-28898,15447,-32138,6393,-32610,-3211,
-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356
};
-int16_t tw64arep[192] __attribute__((aligned(32))) = {
+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,
23169,23170,20787,25330,18204,27245,15446,28898,23169,23170,20787,25330,18204,27245,15446,28898,
@@ -2561,7 +2561,7 @@ int16_t tw64arep[192] __attribute__((aligned(32))) = {
-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356,-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356
};
-int16_t tw64b[96] __attribute__((aligned(32))) = {
+const static int16_t tw64b[96] __attribute__((aligned(32))) = {
0,32767,-3212,32609,-6393,32137,-9512,31356,
-12540,30272,-15447,28897,-18205,27244,-20788,25329,
-23170,23169,-25330,20787,-27245,18204,-28898,15446,
@@ -2576,7 +2576,7 @@ int16_t tw64b[96] __attribute__((aligned(32))) = {
12539,-30273,20787,-25330,27244,-18205,31356,-9512
};
-int16_t tw64brep[192] __attribute__((aligned(32))) = {
+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,
-23170,23169,-25330,20787,-27245,18204,-28898,15446,-23170,23169,-25330,20787,-27245,18204,-28898,15446,
@@ -2591,7 +2591,7 @@ int16_t tw64brep[192] __attribute__((aligned(32))) = {
12539,-30273,20787,-25330,27244,-18205,31356,-9512,12539,-30273,20787,-25330,27244,-18205,31356,-9512
};
-int16_t tw64c[96] __attribute__((aligned(32))) = {
+const static int16_t tw64c[96] __attribute__((aligned(32))) = {
0,32767,3212,32609,6393,32137,9512,31356,
12540,30272,15447,28897,18205,27244,20788,25329,
23170,23169,25330,20787,27245,18204,28898,15446,
@@ -2606,7 +2606,7 @@ int16_t tw64c[96] __attribute__((aligned(32))) = {
-12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512
};
-int16_t tw64crep[192] __attribute__((aligned(32))) = {
+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,
23170,23169,25330,20787,27245,18204,28898,15446,23170,23169,25330,20787,27245,18204,28898,15446,
diff --git a/openair1/PHY/TOOLS/signal_energy.c b/openair1/PHY/TOOLS/signal_energy.c
index 373fdc0d90..afd1c727f3 100755
--- a/openair1/PHY/TOOLS/signal_energy.c
+++ b/openair1/PHY/TOOLS/signal_energy.c
@@ -255,7 +255,7 @@ int32_t signal_energy_nodc(int32_t *input,uint32_t length)
}
#endif
-double signal_energy_fp(double **s_re,double **s_im,uint32_t nb_antennas,uint32_t length,uint32_t offset)
+double signal_energy_fp(double s_re[2][30720],double s_im[2][30720],uint32_t nb_antennas,uint32_t length,uint32_t offset)
{
int32_t aa,i;
diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h
index 5fdd88cd23..abf6038543 100755
--- a/openair1/PHY/defs.h
+++ b/openair1/PHY/defs.h
@@ -53,11 +53,6 @@
# define msg mexPrintf
#else
# ifdef OPENAIR2
-# if ENABLE_RAL
-# include "collection/hashtable/hashtable.h"
-# include "COMMON/ral_messages_types.h"
-# include "UTIL/queue.h"
-# endif
# include "log.h"
# define msg(aRGS...) LOG_D(PHY, ##aRGS)
# else
@@ -132,10 +127,6 @@ static inline void* malloc16_clear( size_t size )
#include "PHY/TOOLS/defs.h"
#include "platform_types.h"
-#ifdef OPENAIR_LTE
-
-//#include "PHY/LTE_ESTIMATION/defs.h"
-
#include "PHY/LTE_TRANSPORT/defs.h"
#include
@@ -178,16 +169,6 @@ typedef struct UE_SCAN_INFO_s {
int32_t freq_offset_Hz[3][10];
} UE_SCAN_INFO_t;
-#if ENABLE_RAL
-typedef struct ral_threshold_phy_s {
- SLIST_ENTRY(ral_threshold_phy_s) ral_thresholds;
- ral_threshold_t threshold;
- ral_th_action_t th_action;
- ral_link_param_t link_param;
- long timer_id;
-} ral_threshold_phy_t;
-#endif
-
/// Top-level PHY Data Structure for RN
typedef struct {
/// Module ID indicator for this instance
@@ -612,6 +593,8 @@ typedef struct {
int is_synchronized;
/// Data structure for UE process scheduling
UE_proc_t proc;
+ /// Flag to indicate the UE shouldn't do timing correction at all
+ int no_timing_correction;
/// \brief Total gain of the TX chain (16-bit baseband I/Q to antenna)
uint32_t tx_total_gain_dB;
/// \brief Total gain of the RX chain (antenna to baseband I/Q) This is a function of rx_gain_mode (and the corresponding gain) and the rx_gain of the card.
@@ -623,9 +606,9 @@ typedef struct {
/// \brief Total gains with bypassed RF gain stage (ExpressMIMO2/Lime)
uint32_t rx_gain_byp[4];
/// \brief Current transmit power
- int8_t tx_power_dBm;
+ int8_t tx_power_dBm[10];
/// \brief Total number of REs in current transmission
- int tx_total_RE;
+ int tx_total_RE[10];
/// \brief Maximum transmit power
int8_t tx_power_max_dBm;
/// \brief Number of eNB seen by UE
@@ -645,17 +628,25 @@ typedef struct {
LTE_UE_PDSCH_FLP *pdsch_vars_flp[NUMBER_OF_CONNECTED_eNB_MAX+1];
LTE_UE_PDSCH *pdsch_vars_SI[NUMBER_OF_CONNECTED_eNB_MAX+1];
LTE_UE_PDSCH *pdsch_vars_ra[NUMBER_OF_CONNECTED_eNB_MAX+1];
+ LTE_UE_PDSCH *pdsch_vars_p[NUMBER_OF_CONNECTED_eNB_MAX+1];
LTE_UE_PDSCH *pdsch_vars_MCH[NUMBER_OF_CONNECTED_eNB_MAX];
LTE_UE_PBCH *pbch_vars[NUMBER_OF_CONNECTED_eNB_MAX];
LTE_UE_PDCCH *pdcch_vars[NUMBER_OF_CONNECTED_eNB_MAX];
LTE_UE_PRACH *prach_vars[NUMBER_OF_CONNECTED_eNB_MAX];
LTE_UE_DLSCH_t *dlsch[NUMBER_OF_CONNECTED_eNB_MAX][2];
LTE_UE_ULSCH_t *ulsch[NUMBER_OF_CONNECTED_eNB_MAX];
- LTE_UE_DLSCH_t *dlsch_SI[NUMBER_OF_CONNECTED_eNB_MAX],*dlsch_ra[NUMBER_OF_CONNECTED_eNB_MAX];
+ LTE_UE_DLSCH_t *dlsch_SI[NUMBER_OF_CONNECTED_eNB_MAX];
+ LTE_UE_DLSCH_t *dlsch_ra[NUMBER_OF_CONNECTED_eNB_MAX];
+ LTE_UE_DLSCH_t *dlsch_p[NUMBER_OF_CONNECTED_eNB_MAX];
LTE_UE_DLSCH_t *dlsch_MCH[NUMBER_OF_CONNECTED_eNB_MAX];
// This is for SIC in the UE, to store the reencoded data
LTE_eNB_DLSCH_t *dlsch_eNB[NUMBER_OF_CONNECTED_eNB_MAX];
+ //Paging parameters
+ uint32_t IMSImod1024;
+ uint32_t PF;
+ uint32_t PO;
+
// For abstraction-purposes only
uint8_t sr[10];
uint8_t pucch_sel[10];
@@ -710,6 +701,8 @@ typedef struct {
int dlsch_SI_errors[NUMBER_OF_CONNECTED_eNB_MAX];
int dlsch_ra_received[NUMBER_OF_CONNECTED_eNB_MAX];
int dlsch_ra_errors[NUMBER_OF_CONNECTED_eNB_MAX];
+ int dlsch_p_received[NUMBER_OF_CONNECTED_eNB_MAX];
+ int dlsch_p_errors[NUMBER_OF_CONNECTED_eNB_MAX];
int dlsch_mch_received_sf[MAX_MBSFN_AREA][NUMBER_OF_CONNECTED_eNB_MAX];
int dlsch_mch_received[NUMBER_OF_CONNECTED_eNB_MAX];
int dlsch_mcch_received[MAX_MBSFN_AREA][NUMBER_OF_CONNECTED_eNB_MAX];
@@ -833,11 +826,6 @@ typedef struct {
/// RF and Interface devices per CC
openair0_device rfdevice;
-#if ENABLE_RAL
- hash_table_t *ral_thresholds_timed;
- SLIST_HEAD(ral_thresholds_gen_poll_s, ral_threshold_phy_t) ral_thresholds_gen_polled[RAL_LINK_PARAM_GEN_MAX];
- SLIST_HEAD(ral_thresholds_lte_poll_s, ral_threshold_phy_t) ral_thresholds_lte_polled[RAL_LINK_PARAM_LTE_MAX];
-#endif
} PHY_VARS_UE;
@@ -849,6 +837,5 @@ typedef struct {
#include "PHY/LTE_ESTIMATION/defs.h"
#include "SIMULATION/ETH_TRANSPORT/defs.h"
-#endif //OPENAIR_LTE
#endif // __PHY_DEFS__H__
diff --git a/openair1/PHY/extern.h b/openair1/PHY/extern.h
index 2144c4f01d..8a5bf5e8f5 100755
--- a/openair1/PHY/extern.h
+++ b/openair1/PHY/extern.h
@@ -111,7 +111,7 @@ extern double p_qam64[8];
extern double beta1_dlsch[6][MCS_COUNT];
extern double beta2_dlsch[6][MCS_COUNT];
-extern char eNB_functions[5][20];
+extern char eNB_functions[6][20];
extern char eNB_timing[2][20];
diff --git a/openair1/PHY/impl_defs_lte.h b/openair1/PHY/impl_defs_lte.h
index 7c38048a55..bed2057800 100644
--- a/openair1/PHY/impl_defs_lte.h
+++ b/openair1/PHY/impl_defs_lte.h
@@ -607,34 +607,34 @@ typedef struct {
int32_t **txdataF[3];
/// \brief Holds the received data in time domain.
/// Should point to the same memory as PHY_vars->rx_vars[a].RX_DMA_BUFFER.
- /// - first index: eNB id [0..2] (hard coded)
+ /// - first index: sector id [0..2] (hard coded)
/// - second index: rx antenna [0..nb_antennas_rx[
/// - third index: sample [0..]
int32_t **rxdata[3];
/// \brief Holds the last subframe of received data in time domain after removal of 7.5kHz frequency offset.
- /// - first index: eNB id [0..2] (hard coded)
+ /// - first index: secotr id [0..2] (hard coded)
/// - second index: rx antenna [0..nb_antennas_rx[
/// - third index: sample [0..samples_per_tti[
int32_t **rxdata_7_5kHz[3];
/// \brief Holds the received data in the frequency domain.
- /// - first index: eNB id [0..2] (hard coded)
+ /// - first index: sector id [0..2] (hard coded)
/// - second index: rx antenna [0..nb_antennas_rx[
/// - third index: ? [0..2*ofdm_symbol_size*frame_parms->symbols_per_tti[
int32_t **rxdataF[3];
/// \brief Holds output of the sync correlator.
- /// - first index: eNB id [0..2] (hard coded)
+ /// - first index: sector id [0..2] (hard coded)
/// - second index: sample [0..samples_per_tti*10[
uint32_t *sync_corr[3];
} LTE_eNB_COMMON;
typedef struct {
/// \brief Hold the channel estimates in frequency domain based on SRS.
- /// - first index: eNB id [0..2] (hard coded)
+ /// - first index: sector id [0..2] (hard coded)
/// - second index: rx antenna id [0..nb_antennas_rx[
/// - third index: ? [0..ofdm_symbol_size[
int32_t **srs_ch_estimates[3];
/// \brief Hold the channel estimates in time domain based on SRS.
- /// - first index: eNB id [0..2] (hard coded)
+ /// - first index: sector id [0..2] (hard coded)
/// - second index: rx antenna id [0..nb_antennas_rx[
/// - third index: ? [0..2*ofdm_symbol_size[
int32_t **srs_ch_estimates_time[3];
@@ -645,54 +645,54 @@ typedef struct {
typedef struct {
/// \brief Holds the received data in the frequency domain for the allocated RBs in repeated format.
- /// - first index: eNB id [0..2] (hard coded)
+ /// - first index: sector id [0..2] (hard coded)
/// - second index: rx antenna id [0..nb_antennas_rx[
/// - third index: ? [0..2*ofdm_symbol_size[
/// - third index (definition from phy_init_lte_eNB()): ? [0..24*N_RB_UL*frame_parms->symbols_per_tti[
/// \warning inconsistent third index definition
int32_t **rxdataF_ext[3];
/// \brief Holds the received data in the frequency domain for the allocated RBs in normal format.
- /// - first index: eNB id [0..2] (hard coded)
+ /// - first index: sector id [0..2] (hard coded)
/// - second index: rx antenna id [0..nb_antennas_rx[
/// - third index (definition from phy_init_lte_eNB()): ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
int32_t **rxdataF_ext2[3];
/// \brief Hold the channel estimates in time domain based on DRS.
- /// - first index: eNB id [0..2] (hard coded)
+ /// - first index: sector id [0..2] (hard coded)
/// - second index: rx antenna id [0..nb_antennas_rx[
/// - third index: ? [0..4*ofdm_symbol_size[
int32_t **drs_ch_estimates_time[3];
/// \brief Hold the channel estimates in frequency domain based on DRS.
- /// - first index: eNB id [0..2] (hard coded)
+ /// - first index: sector id [0..2] (hard coded)
/// - second index: rx antenna id [0..nb_antennas_rx[
/// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
int32_t **drs_ch_estimates[3];
/// \brief Hold the channel estimates for UE0 in case of Distributed Alamouti Scheme.
- /// - first index: eNB id [0..2] (hard coded)
+ /// - first index: sector id [0..2] (hard coded)
/// - second index: rx antenna id [0..nb_antennas_rx[
/// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
int32_t **drs_ch_estimates_0[3];
/// \brief Hold the channel estimates for UE1 in case of Distributed Almouti Scheme.
- /// - first index: eNB id [0..2] (hard coded)
+ /// - first index: sector id [0..2] (hard coded)
/// - second index: rx antenna id [0..nb_antennas_rx[
/// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
int32_t **drs_ch_estimates_1[3];
/// \brief Holds the compensated signal.
- /// - first index: eNB id [0..2] (hard coded)
+ /// - first index: sector id [0..2] (hard coded)
/// - second index: rx antenna id [0..nb_antennas_rx[
/// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
int32_t **rxdataF_comp[3];
/// \brief Hold the compensated data (y)*(h0*) in case of Distributed Alamouti Scheme.
- /// - first index: eNB id [0..2] (hard coded)
+ /// - first index: sector id [0..2] (hard coded)
/// - second index: rx antenna id [0..nb_antennas_rx[
/// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
int32_t **rxdataF_comp_0[3];
/// \brief Hold the compensated data (y*)*(h1) in case of Distributed Alamouti Scheme.
- /// - first index: eNB id [0..2] (hard coded)
+ /// - first index: sector id [0..2] (hard coded)
/// - second index: rx antenna id [0..nb_antennas_rx[
/// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
int32_t **rxdataF_comp_1[3];
/// \brief ?.
- /// - first index: eNB id [0..2] (hard coded)
+ /// - first index: sector id [0..2] (hard coded)
/// - second index: rx antenna id [0..nb_antennas_rx[
/// - third index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
int32_t **ul_ch_mag[3];
diff --git a/openair1/PHY/vars.h b/openair1/PHY/vars.h
index b8cb33239d..bc8b4deb1f 100755
--- a/openair1/PHY/vars.h
+++ b/openair1/PHY/vars.h
@@ -52,10 +52,15 @@ int16_t *primary_synch2_time;
#include "PHY/CODING/vars.h"
//PHY_VARS *PHY_vars;
+#ifndef OCP_FRAMEWORK
PHY_VARS_UE ***PHY_vars_UE_g;
PHY_VARS_eNB ***PHY_vars_eNB_g;
PHY_VARS_RN **PHY_vars_RN_g;
LTE_DL_FRAME_PARMS *lte_frame_parms_g;
+#else
+PHY_VARS_UE * PHY_vars_UE_g[MAX_UE][MAX_NUM_CCs]={NULL};
+PHY_VARS_eNB * PHY_vars_eNB_g[MAX_eNB][MAX_NUM_CCs]={NULL};
+#endif
unsigned short rev[2048],rev_times4[8192],rev_half[1024];
@@ -139,8 +144,12 @@ double beta2_dlsch[6][MCS_COUNT] = { {2.52163, 0.83231, 0.77472, 1.36536, 1.1682
*/
+#ifdef OCP_FRAMEWORK
+#include
+#else
char eNB_functions[6][20]={"eNodeB_3GPP","eNodeB_3GPP_BBU","NGFI_RCC_IF4p5","NGFI_RAI_IF4p5","NGFI_RRU_IF5","NGFI_RRU_IF4p5",};
char eNB_timing[2][20]={"synch_to_ext_device","synch_to_other"};
+#endif
diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c
index 2612302d54..8468d62cad 100755
--- a/openair1/SCHED/phy_procedures_lte_ue.c
+++ b/openair1/SCHED/phy_procedures_lte_ue.c
@@ -718,7 +718,7 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
frame_tx,
eNB_id,
subframe_tx);
- // LOG_I(PHY,"Got prach_resources for eNB %d address %d, RRCCommon %d\n",eNB_id,ue->prach_resources[eNB_id],UE_mac_inst[Mod_id].radioResourceConfigCommon);
+ LOG_D(PHY,"Got prach_resources for eNB %d address %d, RRCCommon %d\n",eNB_id,ue->prach_resources[eNB_id],UE_mac_inst[ue->Mod_id].radioResourceConfigCommon);
}
}
@@ -744,17 +744,17 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
ue->prach_resources[eNB_id]->ra_RNTI);
if ((ue->mac_enabled==1) && (mode != calib_prach_tx)) {
- ue->tx_power_dBm = ue->prach_resources[eNB_id]->ra_PREAMBLE_RECEIVED_TARGET_POWER+get_PL(ue->Mod_id,ue->CC_id,eNB_id);
+ ue->tx_power_dBm[subframe_tx] = ue->prach_resources[eNB_id]->ra_PREAMBLE_RECEIVED_TARGET_POWER+get_PL(ue->Mod_id,ue->CC_id,eNB_id);
}
else {
- ue->tx_power_dBm = ue->tx_power_max_dBm;
+ ue->tx_power_dBm[subframe_tx] = ue->tx_power_max_dBm;
ue->prach_resources[eNB_id]->ra_PreambleIndex = 19;
}
- ue->tx_total_RE = 96;
+ ue->tx_total_RE[subframe_tx] = 96;
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
- ue->prach_vars[eNB_id]->amp = get_tx_amp(ue->tx_power_dBm,
+ ue->prach_vars[eNB_id]->amp = get_tx_amp(ue->tx_power_dBm[subframe_tx],
ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL,
6);
@@ -766,7 +766,7 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
ue->Mod_id,
proc->frame_rx,
proc->subframe_tx,
- ue->tx_power_dBm,
+ ue->tx_power_dBm[subframe_tx],
ue->prach_vars[eNB_id]->amp);
@@ -778,7 +778,7 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
LOG_D(PHY,"[UE %d][RAPROC] PRACH PL %d dB, power %d dBm, digital power %d dB (amp %d)\n",
ue->Mod_id,
get_PL(ue->Mod_id,ue->CC_id,eNB_id),
- ue->tx_power_dBm,
+ ue->tx_power_dBm[subframe_tx],
dB_fixed(prach_power),
ue->prach_vars[eNB_id]->amp);
} else {
@@ -1036,12 +1036,12 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
if (abstraction_flag == 0) {
if (ue->mac_enabled==1) {
pusch_power_cntl(ue,proc,eNB_id,1, abstraction_flag);
- ue->tx_power_dBm = ue->ulsch[eNB_id]->Po_PUSCH;
+ ue->tx_power_dBm[subframe_tx] = ue->ulsch[eNB_id]->Po_PUSCH;
}
else {
- ue->tx_power_dBm = ue->tx_power_max_dBm;
+ ue->tx_power_dBm[subframe_tx] = ue->tx_power_max_dBm;
}
- ue->tx_total_RE = nb_rb*12;
+ ue->tx_total_RE[subframe_tx] = nb_rb*12;
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
tx_amp = get_tx_amp(ue->tx_power_dBm,
@@ -1052,7 +1052,7 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
tx_amp = AMP;
#endif
LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d, generating PUSCH, Po_PUSCH: %d dBm (max %d dBm), amp %d\n",
- Mod_id,harq_pid,frame_tx,subframe_tx,ue->tx_power_dBm,ue->tx_power_max_dBm, tx_amp);
+ Mod_id,harq_pid,frame_tx,subframe_tx,ue->tx_power_dBm[subframe_tx],ue->tx_power_max_dBm, tx_amp);
start_meas(&ue->ulsch_modulation_stats);
ulsch_modulation(ue->common_vars.txdataF,
tx_amp,
@@ -1156,8 +1156,8 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
else {
Po_PUCCH = ue->tx_power_max_dBm;
}
- ue->tx_power_dBm = Po_PUCCH;
- ue->tx_total_RE = 12;
+ ue->tx_power_dBm[subframe_tx] = Po_PUCCH;
+ ue->tx_total_RE[subframe_tx] = 12;
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
tx_amp = get_tx_amp(Po_PUCCH,
@@ -1220,8 +1220,8 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
else {
Po_PUCCH = ue->tx_power_max_dBm;
}
- ue->tx_power_dBm = Po_PUCCH;
- ue->tx_total_RE = 12;
+ ue->tx_power_dBm[subframe_tx] = Po_PUCCH;
+ ue->tx_total_RE[subframe_tx] = 12;
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
tx_amp = get_tx_amp(Po_PUCCH,
@@ -1286,7 +1286,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui
//phy_procedures_emos_UE_TX(next_slot);
#endif
- ue->tx_power_dBm=-127;
+ ue->tx_power_dBm[subframe_tx]=-127;
if (abstraction_flag==0) {
for (aa=0; aanb_antennas_tx; aa++) {
@@ -1391,6 +1391,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui
(ue->frame_parms.prach_config_common.prach_Config_enabled==1)) {
// check if we have PRACH opportunity
+
if (is_prach_subframe(&ue->frame_parms,frame_tx,subframe_tx)) {
ue_prach_procedures(ue,proc,eNB_id,abstraction_flag,mode);
@@ -1484,17 +1485,17 @@ void ue_measurement_procedures(uint16_t l, PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,
#endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL, VCD_FUNCTION_OUT);
- VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ADJUST_SYNCH, VCD_FUNCTION_IN);
+
eNB_id = 0;
- if (abstraction_flag == 0)
- lte_adjust_synch(&ue->frame_parms,
- ue,
- eNB_id,
- 0,
- 16384);
-
- VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ADJUST_SYNCH, VCD_FUNCTION_OUT);
+ if (abstraction_flag == 0) {
+ if (ue->no_timing_correction==0)
+ lte_adjust_synch(&ue->frame_parms,
+ ue,
+ eNB_id,
+ 0,
+ 16384);
+ }
}
@@ -1626,8 +1627,10 @@ void restart_phy(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uint8_t eNB_id,uint8_t ab
ue->dlsch_fer[eNB_id] = 0;
ue->dlsch_SI_received[eNB_id] = 0;
ue->dlsch_ra_received[eNB_id] = 0;
+ ue->dlsch_p_received[eNB_id] = 0;
ue->dlsch_SI_errors[eNB_id] = 0;
ue->dlsch_ra_errors[eNB_id] = 0;
+ ue->dlsch_p_errors[eNB_id] = 0;
ue->dlsch_mch_received[eNB_id] = 0;
@@ -2026,6 +2029,35 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
}
}
+ else if ((dci_alloc_rx[i].rnti == P_RNTI) &&
+ ((dci_alloc_rx[i].format == format1A) || (dci_alloc_rx[i].format == format1C))) {
+
+#ifdef DEBUG_PHY_PROC
+ LOG_D(PHY,"[UE %d] subframe %d: Found rnti %x, format 1%s, dci_cnt %d\n",ue->Mod_id,subframe_rx,dci_alloc_rx[i].rnti,dci_alloc_rx[i].format==format1A?"A":"C",i);
+#endif
+
+
+ if (generate_ue_dlsch_params_from_dci(frame_rx,
+ subframe_rx,
+ (void *)&dci_alloc_rx[i].dci_pdu,
+ SI_RNTI,
+ dci_alloc_rx[i].format,
+ &ue->dlsch_SI[eNB_id],
+ &ue->frame_parms,
+ ue->pdsch_config_dedicated,
+ SI_RNTI,
+ 0,
+ P_RNTI)==0) {
+
+ ue->dlsch_p_received[eNB_id]++;
+
+
+ LOG_D(PHY,"[UE %d] Frame %d, subframe %d : Generate UE DLSCH P_RNTI format 1%s\n",ue->Mod_id,frame_rx,subframe_rx,dci_alloc_rx[i].format==format1A?"A":"C");
+ //dump_dci(&ue->frame_parms, &dci_alloc_rx[i]);
+
+ }
+ }
+
else if ((ue->prach_resources[eNB_id]) &&
(dci_alloc_rx[i].rnti == ue->prach_resources[eNB_id]->ra_RNTI) &&
(dci_alloc_rx[i].format == format1A)) {
@@ -2439,6 +2471,9 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue,
case RA_PDSCH:
pdsch_vars = ue->pdsch_vars_ra[eNB_id];
break;
+ case P_PDSCH:
+ pdsch_vars = ue->pdsch_vars_p[eNB_id];
+ break;
case PDSCH:
pdsch_vars = ue->pdsch_vars[eNB_id];
break;
@@ -2556,6 +2591,14 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue,
ue->dlsch_SI[eNB_id]->harq_processes[0]->b,
ue->dlsch_SI[eNB_id]->harq_processes[0]->TBS>>3);
break;
+ case P_PDSCH:
+ mac_xface->ue_decode_p(ue->Mod_id,
+ CC_id,
+ frame_rx,
+ eNB_id,
+ ue->dlsch_SI[eNB_id]->harq_processes[0]->b,
+ ue->dlsch_SI[eNB_id]->harq_processes[0]->TBS>>3);
+ break;
case RA_PDSCH:
process_rar(ue,proc,eNB_id,mode,abstraction_flag);
break;
@@ -2629,6 +2672,8 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
if (ue->dlsch_SI[eNB_id])
ue->dlsch_SI[eNB_id]->active = 0;
+ if (ue->dlsch_p[eNB_id])
+ ue->dlsch_p[eNB_id]->active = 0;
if (ue->dlsch_ra[eNB_id])
ue->dlsch_ra[eNB_id]->active = 0;
@@ -2725,6 +2770,20 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
ue->frame_parms.symbols_per_tti>>1,
abstraction_flag);
}
+
+ // do procedures for SI-RNTI
+ if ((ue->dlsch_p[eNB_id]) && (ue->dlsch_p[eNB_id]->active == 1)) {
+ ue_pdsch_procedures(ue,
+ proc,
+ eNB_id,
+ P_PDSCH,
+ ue->dlsch_p[eNB_id],
+ NULL,
+ ue->pdcch_vars[eNB_id]->num_pdcch_symbols,
+ ue->frame_parms.symbols_per_tti>>1,
+ abstraction_flag);
+ }
+
// do procedures for RA-RNTI
if ((ue->dlsch_ra[eNB_id]) && (ue->dlsch_ra[eNB_id]->active == 1)) {
ue_pdsch_procedures(ue,
@@ -2820,6 +2879,30 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
abstraction_flag);
ue->dlsch_SI[eNB_id]->active = 0;
}
+
+ // do procedures for P-RNTI
+ if ((ue->dlsch_p[eNB_id]) && (ue->dlsch_p[eNB_id]->active == 1)) {
+ ue_pdsch_procedures(ue,
+ proc,
+ eNB_id,
+ P_PDSCH,
+ ue->dlsch_p[eNB_id],
+ NULL,
+ 1+(ue->frame_parms.symbols_per_tti>>1),
+ ue->frame_parms.symbols_per_tti-1,
+ abstraction_flag);
+
+ ue_dlsch_procedures(ue,
+ proc,
+ eNB_id,
+ P_PDSCH,
+ ue->dlsch_p[eNB_id],
+ NULL,
+ &ue->dlsch_p_errors[eNB_id],
+ mode,
+ abstraction_flag);
+ ue->dlsch_p[eNB_id]->active = 0;
+ }
// do procedures for RA-RNTI
if ((ue->dlsch_ra[eNB_id]) && (ue->dlsch_ra[eNB_id]->active == 1)) {
ue_pdsch_procedures(ue,
diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c
index fb6a9d0288..cfd3da43ca 100644
--- a/openair1/SIMULATION/LTE_PHY/dlsim.c
+++ b/openair1/SIMULATION/LTE_PHY/dlsim.c
@@ -129,7 +129,8 @@ void do_OFDM_mod_l(int32_t **txdataF, int32_t **txdata, uint16_t next_slot, LTE_
}
-void DL_channel(PHY_VARS_eNB *eNB,PHY_VARS_UE *UE,int subframe,int awgn_flag,double SNR, int tx_lev,int hold_channel,int abstx, int num_rounds, int trials, int round, channel_desc_t *eNB2UE[4], double **s_re,double **s_im,double **r_re,double **r_im,FILE *csv_fd) {
+void DL_channel(PHY_VARS_eNB *eNB,PHY_VARS_UE *UE,int subframe,int awgn_flag,double SNR, int tx_lev,int hold_channel,int abstx, int num_rounds, int trials, int round, channel_desc_t *eNB2UE[4],
+ double s_re[2][30720*2],double s_im[2][30720*2],double r_re[2][30720*2],double r_im[2][30720*2],FILE *csv_fd) {
int i,u;
int aa,aarx,aatx;
@@ -1266,7 +1267,7 @@ int main(int argc, char **argv)
double snr_step=1,input_snr_step=1, snr_int=30;
LTE_DL_FRAME_PARMS *frame_parms;
- double **s_re,**s_im,**r_re,**r_im;
+ double s_re[2][30720*2],s_im[2][30720*2],r_re[2][30720*2],r_im[2][30720*2];
double forgetting_factor=0.0; //in [0,1] 0 means a new channel every time, 1 means keep the same channel
@@ -1798,13 +1799,6 @@ int main(int argc, char **argv)
frame_parms = &eNB->frame_parms;
- s_re = malloc(2*sizeof(double*));
- s_im = malloc(2*sizeof(double*));
- r_re = malloc(2*sizeof(double*));
- r_im = malloc(2*sizeof(double*));
- // r_re0 = malloc(2*sizeof(double*));
- // r_im0 = malloc(2*sizeof(double*));
-
nsymb = (eNB->frame_parms.Ncp == 0) ? 14 : 12;
printf("Channel Model= (%s,%d)\n",channel_model_input, channel_model);
@@ -1948,14 +1942,6 @@ int main(int argc, char **argv)
}
*/
- for (i=0; i<2; i++) {
- s_re[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
- s_im[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
- r_re[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
- r_im[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
- }
-
-
UE->pdcch_vars[0]->crnti = n_rnti;
// Fill in UL_alloc
@@ -2329,165 +2315,7 @@ int main(int argc, char **argv)
} // common_flag == 0
- /*
- num_pdcch_symbols_2 = generate_dci_top(num_ue_spec_dci,
- num_common_dci,
- dci_alloc,
- 0,
- AMP,
- &eNB->frame_parms,
- eNB->common_vars.txdataF[eNB_id],
- subframe);
-
- if (n_frames==1) printf("Generated DCI, num_pdcch_symbols %d\n",num_pdcch_symbols_2);
- if (num_pdcch_symbols_2 > num_pdcch_symbols) {
- printf("Error: given num_pdcch_symbols not big enough (%d > %d)\n",num_pdcch_symbols_2,num_pdcch_symbols);
- exit(-1);
- }
-
- for (k=0; kframe_parms,
- eNB->dlsch[k][cw]->harq_processes[0]->nb_rb,
- eNB->dlsch[k][cw]->harq_processes[0]->rb_alloc,
- get_Qm(eNB->dlsch[k][cw]->harq_processes[0]->mcs),
- eNB->dlsch[k][cw]->harq_processes[0]->Nl,
- num_pdcch_symbols,
- 0,subframe);
-
- tbs = eNB->dlsch[k][cw]->harq_processes[0]->TBS;
- rate = (double)tbs/(double)coded_bits_per_codeword;
-
- if ((SNR==snr0) && (trials==0) && (round==0))
- printf("User %d, cw %d: Rate = %f (%f bits/dim) (G %d, TBS %d, mod %d, pdcch_sym %d, ndi %d)\n",
- k,cw,rate,rate*get_Qm(eNB->dlsch[k][0]->harq_processes[0]->mcs),
- coded_bits_per_codeword,
- tbs,
- get_Qm(eNB->dlsch[k][0]->harq_processes[0]->mcs),
- num_pdcch_symbols,
- eNB->dlsch[0][0]->harq_processes[0]->round);
-
- // use the PMI from previous trial
- if (DLSCH_alloc_pdu2_1E[0].tpmi == 5) {
- eNB->dlsch[0][0]->harq_processes[0]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,eNB->frame_parms.N_RB_DL);
- UE->dlsch[0][0]->harq_processes[0]->pmi_alloc = quantize_subband_pmi(&UE->measurements,0,UE->frame_parms.N_RB_DL);
-
- if (n_users>1)
- eNB->dlsch[1][0]->harq_processes[0]->pmi_alloc = (eNB->dlsch[0][0]->harq_processes[0]->pmi_alloc ^ 0x1555);
-
-
- }
-
-
- start_meas(&eNB->dlsch_encoding_stats);
-
- if (dlsch_encoding(((cw==0) ? input_buffer0[k] : input_buffer1[k]),
- &eNB->frame_parms,
- num_pdcch_symbols,
- eNB->dlsch[k][cw],
- 0,subframe,
- &eNB->dlsch_rate_matching_stats,
- &eNB->dlsch_turbo_encoding_stats,
- &eNB->dlsch_interleaving_stats
- )<0)
- exit(-1);
-
- stop_meas(&eNB->dlsch_encoding_stats);
-
- eNB->dlsch[k][cw]->rnti = (common_flag==0) ? n_rnti+k : SI_RNTI;
- start_meas(&eNB->dlsch_scrambling_stats);
- dlsch_scrambling(&eNB->frame_parms,
- 0,
- eNB->dlsch[k][cw],
- coded_bits_per_codeword,
- 0,
- subframe<<1);
- stop_meas(&eNB->dlsch_scrambling_stats);
-
- if (n_frames==1) {
- for (s=0; sdlsch[k][cw]->harq_processes[0]->C; s++) {
- if (sdlsch[k][cw]->harq_processes[0]->Cminus)
- Kr = eNB->dlsch[k][cw]->harq_processes[0]->Kminus;
- else
- Kr = eNB->dlsch[k][cw]->harq_processes[0]->Kplus;
-
- Kr_bytes = Kr>>3;
-
- for (i=0; idlsch[k][cw]->harq_processes[0]->c[s][i]);
- }
- }
- }
-
- start_meas(&eNB->dlsch_modulation_stats);
-
- re_allocated = dlsch_modulation(eNB->common_vars.txdataF[eNB_id],
- AMP,
- subframe,
- &eNB->frame_parms,
- num_pdcch_symbols,
- eNB->dlsch[k][0],
- (transmission_mode==3)||(transmission_mode==4) ? eNB->dlsch[k][1] : NULL);
-
- (void)re_allocated;
-
- stop_meas(&eNB->dlsch_modulation_stats);
-
- } //n_users
-
-
- generate_pilots(eNB,
- eNB->common_vars.txdataF[eNB_id],
- AMP,
- LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
-
- start_meas(&eNB->ofdm_mod_stats);
-
- do_OFDM_mod_l(eNB->common_vars.txdataF[eNB_id],
- eNB->common_vars.txdata[eNB_id],
- (subframe*2),
- &eNB->frame_parms);
-
- do_OFDM_mod_l(eNB->common_vars.txdataF[eNB_id],
- eNB->common_vars.txdata[eNB_id],
- (subframe*2)+1,
- &eNB->frame_parms);
-
- stop_meas(&eNB->ofdm_mod_stats);
- stop_meas(&eNB->phy_proc_tx);
-
- do_OFDM_mod_l(eNB->common_vars.txdataF[eNB_id],
- eNB->common_vars.txdata[eNB_id],
- (subframe*2)+2,
- &eNB->frame_parms);
-
- if (n_frames==1) {
- write_output("txsigF0.m","txsF0", &eNB->common_vars.txdataF[eNB_id][0][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],
- nsymb*eNB->frame_parms.ofdm_symbol_size,1,1);
-
- if (eNB->frame_parms.nb_antennas_tx>1)
- write_output("txsigF1.m","txsF1", &eNB->common_vars.txdataF[eNB_id][1][subframe*nsymb*eNB->frame_parms.ofdm_symbol_size],
- nsymb*eNB->frame_parms.ofdm_symbol_size,1,1);
- }
- tx_lev = 0;
-
- for (aa=0; aaframe_parms.nb_antennas_tx; aa++) {
- tx_lev += signal_energy(&eNB->common_vars.txdata[eNB_id][aa]
- [subframe*eNB->frame_parms.samples_per_tti],
- eNB->frame_parms.samples_per_tti);
- }
-
- tx_lev_dB = (unsigned int) dB_fixed(tx_lev);
-
- if (n_frames==1) {
- printf("tx_lev = %d (%d dB)\n",tx_lev,tx_lev_dB);
- write_output("txsig0.m","txs0", &eNB->common_vars.txdata[eNB_id][0][subframe* eNB->frame_parms.samples_per_tti],
-
- eNB->frame_parms.samples_per_tti,1,1);
- }
- }
- */
/*
else { // Read signal from file
i=0;
@@ -2533,7 +2361,6 @@ int main(int argc, char **argv)
&eNB->frame_parms);
stop_meas(&eNB->ofdm_mod_stats);
- stop_meas(&eNB->phy_proc_tx);
// generate next subframe for channel estimation
@@ -2653,461 +2480,7 @@ int main(int argc, char **argv)
}
- /*
- if (n_frames==1) {
- printf("RX level in null symbol %d\n",dB_fixed(signal_energy(&UE->common_vars.rxdata[0][160+OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES],OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES/2)));
- printf("RX level in data symbol %d\n",dB_fixed(signal_energy(&UE->common_vars.rxdata[0][160+(2*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES)],OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES/2)));
- printf("rx_level Null symbol %f\n",10*log10(signal_energy_fp(r_re,r_im,1,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES/2,256+(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES))));
- printf("rx_level data symbol %f\n",10*log10(signal_energy_fp(r_re,r_im,1,OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES/2,256+(2*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES))));
- }
-
- if (eNB->frame_parms.Ncp == 0) { // normal prefix
- pilot1 = 4;
- pilot2 = 7;
- pilot3 = 11;
- } else { // extended prefix
- pilot1 = 3;
- pilot2 = 6;
- pilot3 = 9;
- }
-
- start_meas(&UE->phy_proc_rx);
- // Inner receiver scheduling for 3 slots
- for (Ns=(2*subframe); Ns<((2*subframe)+3); Ns++) {
- for (l=0; lofdm_demod_stats);
- slot_fep(UE,
- l,
- Ns%20,
- 0,
- 0,
- 0);
- stop_meas(&UE->ofdm_demod_stats);
-
- if (UE->perfect_ce==1) {
- if (awgn_flag==0) {
- for(k=0; knb_antennas_tx; aa++) {
- for (aarx=0; aarxnb_antennas_rx; aarx++) {
- for (i=0; iN_RB_DL*12; i++) {
- ((int16_t *) UE->common_vars.dl_ch_estimates[k][(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(
- eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].x*AMP);
- ((int16_t *) UE->common_vars.dl_ch_estimates[k][(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(int16_t)(
- eNB2UE[round]->chF[aarx+(aa*frame_parms->nb_antennas_rx)][i].y*AMP);
- }
- }
- }
- }
- } else {
- for(aa=0; aanb_antennas_tx; aa++) {
- for (aarx=0; aarxnb_antennas_rx; aarx++) {
- for (i=0; iN_RB_DL*12; i++) {
- ((int16_t *) UE->common_vars.dl_ch_estimates[0][(aa<<1)+aarx])[2*i+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=(short)(AMP);
- ((int16_t *) UE->common_vars.dl_ch_estimates[0][(aa<<1)+aarx])[2*i+1+((l+(Ns%2)*pilot2)*frame_parms->ofdm_symbol_size+LTE_CE_FILTER_LENGTH)*2]=0/2;
- }
- }
- }
- }
- }
-
-
- if ((Ns==((2*subframe))) && (l==0)) {
- lte_ue_measurements(UE,
- subframe*UE->frame_parms.samples_per_tti,
- 1,
- 0);
-
- if (transmission_mode==5 || transmission_mode==6) {
- if (pmi_feedback == 1) {
- pmi_feedback = 0;
- hold_channel = 1;
- goto PMI_FEEDBACK;
- }
- }
-
- }
-
-
- if ((Ns==(2*subframe)) && (l==pilot1)) {// process symbols 0,1,2
-
- if (dci_flag == 1) {
- UE->UE_mode[0] = PUSCH;
- start_meas(&UE->dlsch_rx_pdcch_stats);
- rx_pdcch(&UE->common_vars,
- UE->pdcch_vars,
- &UE->frame_parms,
- subframe,
- 0,
- (UE->frame_parms.mode1_flag == 1) ? SISO : ALAMOUTI,
- UE->high_speed_flag,
- 0);
- stop_meas(&UE->dlsch_rx_pdcch_stats);
- // overwrite number of pdcch symbols
- UE->pdcch_vars[0]->num_pdcch_symbols = num_pdcch_symbols;
-
- dci_cnt = dci_decoding_procedure(UE,
- dci_alloc_rx,1,
- eNB_id,
- subframe);
- //printf("dci_cnt %d\n",dci_cnt);
-
- if (dci_cnt==0) {
- dlsch_active = 0;
-
- if (round==0) {
- dci_errors++;
- round=5;
- errs[0]++;
- //round_trials[0]++;
-
- if (n_frames==1)
- printf("DCI error trial %d errs[0] %d\n",trials,errs[0]);
- }
-
- // for (i=1;i<=round;i++)
- // round_trials[i]--;
- // round=5;
- }
-
- for (i=0; idlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->first_tx=1;
-
- if ((dci_alloc_rx[i].rnti == n_rnti) &&
- (generate_ue_dlsch_params_from_dci(0,
- subframe,
- dci_alloc_rx[i].dci_pdu,
- dci_alloc_rx[i].rnti,
- dci_alloc_rx[i].format,
- UE->dlsch[0],
- &UE->frame_parms,
- UE->pdsch_config_dedicated,
- SI_RNTI,
- 0,
- P_RNTI)==0)) {
- //dump_dci(&UE->frame_parms,&dci_alloc_rx[i]);
- coded_bits_per_codeword = get_G(&eNB->frame_parms,
- UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->nb_rb,
- UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->rb_alloc_even,
- get_Qm(UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->mcs),
- UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->Nl,
- UE->pdcch_vars[0]->num_pdcch_symbols,
- 0,subframe);
- printf("num_pdcch_symbols %d, G %d, TBS %d\n",UE->pdcch_vars[0]->num_pdcch_symbols,coded_bits_per_codeword,
- UE->dlsch[0][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->TBS);
-
- dlsch_active = 1;
- } else {
- dlsch_active = 0;
-
- if (round==0) {
- dci_errors++;
- errs[0]++;
- //round_trials[0]++;
- round=5;
-
- if (n_frames==1)
- printf("DCI misdetection trial %d\n",trials);
-
- }
-
- // for (i=1;i<=round;i++)
- // round_trials[i]--;
- // round=5;
- }
- }
- } // if dci_flag==1
- else { //dci_flag == 0
-
- UE->pdcch_vars[0]->crnti = n_rnti;
- UE->pdcch_vars[0]->num_pdcch_symbols = num_pdcch_symbols;
-
- if (round == 0) UE->dlsch[0][0]->harq_processes[0]->first_tx=1;
-
- switch (transmission_mode) {
- case 1:
- case 2:
- generate_ue_dlsch_params_from_dci(0,
- subframe,
- &DLSCH_alloc_pdu_1[0],
- (common_flag==0)? C_RNTI : SI_RNTI,
- (common_flag==0)? format1 : format1A,
- UE->dlsch[0],
- &UE->frame_parms,
- UE->pdsch_config_dedicated,
- SI_RNTI,
- 0,
- P_RNTI);
- break;
-
- case 3:
- // printf("Rate: TM3 (before) round %d (%d) first_tx %d\n",round,UE->dlsch[0][0]->harq_processes[0]->round,UE->dlsch[0][0]->harq_processes[0]->first_tx);
- generate_ue_dlsch_params_from_dci(0,
- subframe,
- &DLSCH_alloc_pdu_1[0],
- (common_flag==0)? C_RNTI : SI_RNTI,
- (common_flag==0)? format2A : format1A,
- UE->dlsch[0],
- &UE->frame_parms,
- UE->pdsch_config_dedicated,
- SI_RNTI,
- 0,
- P_RNTI);
- // printf("Rate: TM3 (after) round %d (%d) first_tx %d\n",round,UE->dlsch[0][0]->harq_processes[0]->round,UE->dlsch[0][0]->harq_processes[0]->first_tx);
- break;
-
- case 4:
- generate_ue_dlsch_params_from_dci(0,
- subframe,
- &DLSCH_alloc_pdu_1[0],
- (common_flag==0)? C_RNTI : SI_RNTI,
- (common_flag==0)? format2 : format1A,
- UE->dlsch[0],
- &UE->frame_parms,
- UE->pdsch_config_dedicated,
- SI_RNTI,
- 0,
- P_RNTI);
- break;
-
- case 5:
- case 6:
- generate_ue_dlsch_params_from_dci(0,
- subframe,
- &DLSCH_alloc_pdu2_1E[0],
- C_RNTI,
- format1E_2A_M10PRB,
- UE->dlsch[0],
- &UE->frame_parms,
- UE->pdsch_config_dedicated,
- SI_RNTI,
- 0,
- P_RNTI);
- break;
-
- }
-
- dlsch_active = 1;
- } // if dci_flag == 1
- }
-
- if (dlsch_active == 1) {
- if ((Ns==(1+(2*subframe))) && (l==0)) {// process PDSCH symbols 1,2,3,4,5,(6 Normal Prefix)
-
- if ((transmission_mode == 5) &&
- (UE->dlsch[eNB_id][0]->harq_processes[UE->dlsch[0][0]->current_harq_pid]->dl_power_off==0) &&
- (UE->use_ia_receiver ==1)) {
- dual_stream_UE = 1;
- } else {
- dual_stream_UE = 0;
- }
-
-
- start_meas(&UE->dlsch_llr_stats);
-
- for (m=UE->pdcch_vars[0]->num_pdcch_symbols;
- mpdcch_vars[0]->num_pdcch_symbols)?1:0,
- dual_stream_UE,
- i_mod,
- UE->dlsch[0][0]->current_harq_pid)==-1) {
- dlsch_active = 0;
- break;
- }
- }
-
- stop_meas(&UE->dlsch_llr_stats);
- }
-
- if ((Ns==(1+(2*subframe))) && (l==pilot1)) {
- // process symbols (6 Extended Prefix),7,8,9
- start_meas(&UE->dlsch_llr_stats);
-
- for (m=pilot2;
- mdlsch[0][0]->current_harq_pid)==-1) {
- dlsch_active=0;
- break;
- }
- }
-
- stop_meas(&UE->dlsch_llr_stats);
- }
-
- if ((Ns==(2+(2*subframe))) && (l==0)) { // process symbols 10,11,(12,13 Normal Prefix) do deinterleaving for TTI
- start_meas(&UE->dlsch_llr_stats);
-
- for (m=pilot3;
- mframe_parms.symbols_per_tti;
- m++) {
- if (rx_pdsch(UE,
- PDSCH,
- eNB_id,
- eNB_id_i,
- subframe,
- m,
- 0,
- dual_stream_UE,
- i_mod,
- UE->dlsch[0][0]->current_harq_pid)==-1) {
- dlsch_active=0;
- break;
- }
- }
-
- stop_meas(&UE->dlsch_llr_stats);
- }
-
- if (test_perf ==0 ) {
- if ((n_frames==1) && (Ns==(2+(2*subframe))) && (l==0)) {
- write_output("ch0.m","ch0",eNB2UE[0]->ch[0],eNB2UE[0]->channel_length,1,8);
-
- if (eNB->frame_parms.nb_antennas_tx>1)
- write_output("ch1.m","ch1",eNB2UE[0]->ch[eNB->frame_parms.nb_antennas_rx],eNB2UE[0]->channel_length,1,8);
-
- //common vars
- write_output("rxsig0.m","rxs0", &UE->common_vars.rxdata[0][0],10*UE->frame_parms.samples_per_tti,1,1);
- write_output("rxsigF0.m","rxsF0", &UE->common_vars.rxdataF[0][0],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
-
- if (UE->frame_parms.nb_antennas_rx>1) {
- write_output("rxsig1.m","rxs1", UE->common_vars.rxdata[1],UE->frame_parms.samples_per_tti,1,1);
- write_output("rxsigF1.m","rxsF1", UE->common_vars.rxdataF[1],UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
- }
-
- write_output("dlsch00_r0.m","dl00_r0",
- &(UE->common_vars.dl_ch_estimates[eNB_id][0][0]),
- UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
-
- if (UE->frame_parms.nb_antennas_rx>1)
- write_output("dlsch01_r0.m","dl01_r0",
- &(UE->common_vars.dl_ch_estimates[eNB_id][1][0]),
- UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
-
- if (eNB->frame_parms.nb_antennas_tx>1)
- write_output("dlsch10_r0.m","dl10_r0",
- &(UE->common_vars.dl_ch_estimates[eNB_id][2][0]),
- UE->frame_parms.ofdm_symbol_size*nsymb,1,1);
-
- if ((UE->frame_parms.nb_antennas_rx>1) && (eNB->frame_parms.nb_antennas_tx>1))
- write_output("dlsch11_r0.m","dl11_r0",
- &(UE->common_vars.dl_ch_estimates[eNB_id][3][0]),
- UE->frame_parms.ofdm_symbol_size*nsymb/2,1,1);
-
- //pdsch_vars
- dump_dlsch2(UE,eNB_id,coded_bits_per_codeword,round);
- //dump_dlsch2(UE,eNB_id_i,coded_bits_per_codeword);
- write_output("dlsch_e.m","e",eNB->dlsch[0][0]->harq_processes[0]->e,coded_bits_per_codeword,1,4);
-
- //pdcch_vars
- 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],300*3,1,1);
-
- write_output("pdcch_rxF_comp0.m","pdcch0_rxF_comp0",UE->pdcch_vars[eNB_id]->rxdataF_comp[0],4*300,1,1);
- write_output("pdcch_rxF_llr.m","pdcch_llr",UE->pdcch_vars[eNB_id]->llr,2400,1,4);
-
- }
- }
- }
- }
- }
-
- //saving PMI in case of Transmission Mode > 5
-
- if(abstx) {
- if (trials==0 && round==0 && transmission_mode>=5) {
- for (iii=0; iiilte_ue_pdsch_vars[eNB_id]->pmi_ext[iii]),(UE->lte_ue_pdsch_vars[eNB_id_i]->pmi_ext[iii]));
- fprintf(csv_fd,"%x,%x,",(UE->pdsch_vars[eNB_id]->pmi_ext[iii]),(UE->pdsch_vars[eNB_id]->pmi_ext[iii]));
- printf("%x ",(UE->pdsch_vars[eNB_id]->pmi_ext[iii]));
- }
- }
- }
-
- for (int cw=Kmimo-1; cw>=0; cw--) {
- UE->dlsch[0][cw]->rnti = (common_flag==0) ? n_rnti: SI_RNTI;
- coded_bits_per_codeword = get_G(&eNB->frame_parms,
- eNB->dlsch[0][cw]->harq_processes[0]->nb_rb,
- eNB->dlsch[0][cw]->harq_processes[0]->rb_alloc,
- get_Qm(eNB->dlsch[0][cw]->harq_processes[0]->mcs),
- eNB->dlsch[0][cw]->harq_processes[0]->Nl,
- num_pdcch_symbols,
- 0,subframe);
-
- UE->dlsch[0][cw]->harq_processes[UE->dlsch[0][cw]->current_harq_pid]->G = coded_bits_per_codeword;
-
-
- // calculate uncoded BLER
- uncoded_ber=0;
- for (i=0;idlsch[0][0]->harq_processes[0]->e[i] != (UE->pdsch_vars[0]->llr[0][i]<0)) {
- uncoded_ber_bit[i] = 1;
- uncoded_ber++;
- }
- else
- uncoded_ber_bit[i] = 0;
-
- uncoded_ber/=coded_bits_per_codeword;
- avg_ber += uncoded_ber;
-
- if (n_frames==1)
- write_output("uncoded_ber_bit.m","uncoded_ber_bit",uncoded_ber_bit,coded_bits_per_codeword,1,0);
-
-
- start_meas(&UE->dlsch_unscrambling_stats);
- dlsch_unscrambling(&UE->frame_parms,
- 0,
- UE->dlsch[0][cw],
- coded_bits_per_codeword,
- UE->pdsch_vars[eNB_id]->llr[cw],
- 0,
- subframe<<1);
- stop_meas(&UE->dlsch_unscrambling_stats);
-
- start_meas(&UE->dlsch_decoding_stats);
- ret = dlsch_decoding(UE,
- UE->pdsch_vars[eNB_id]->llr[cw],
- &UE->frame_parms,
- UE->dlsch[0][cw],
- UE->dlsch[0][cw]->harq_processes[UE->dlsch[0][cw]->current_harq_pid],
- subframe,
- UE->dlsch[0][cw]->current_harq_pid,
- 1,llr8_flag);
- stop_meas(&UE->dlsch_decoding_stats);
-
- if (cw==1) {
- if (ret <= UE->dlsch[0][cw]->max_turbo_iterations) {
- } else {
- errs2[round]++;
- }
- }
- }
-
-
- stop_meas(&UE->phy_proc_rx);
- */
if (UE->dlsch_errors[0] == 0) {
@@ -3120,45 +2493,7 @@ int main(int argc, char **argv)
UE->total_TBS[eNB_id] = UE->total_TBS[eNB_id] + UE->dlsch[eNB_id][0]->harq_processes[UE->dlsch[eNB_id][0]->current_harq_pid]->TBS;
TB0_active = 0;
- if (UE->dlsch[eNB_id][0]->harq_processes[UE->dlsch[eNB_id][0]->current_harq_pid]->mimo_mode == LARGE_CDD) { //try to decode second stream using SIC
-
- //for (round = 0 ; round < UE->dlsch[eNB_id][0]->harq_processes[UE->dlsch[eNB_id][0]->current_harq_pid]->round ; round++) {
- // re-encoding of first stream
- //dlsch0_ue_harq = UE->dlsch[eNB_id][0]->harq_processes[UE->dlsch[eNB_id][0]->current_harq_pid];
- //dlsch0_eNB_harq = UE->dlsch[eNB_id]->harq_processes[UE->dlsch[eNB_id][0]->current_harq_pid];
- //dlsch0_eNB_harq->mimo_mode = LARGE_CDD;
- //dlsch0_eNB_harq->rb_alloc[0] = dlsch0_ue_harq->rb_alloc_even[0];
- //dlsch0_eNB_harq->nb_rb = dlsch0_ue_harq->nb_rb;
- //dlsch0_eNB_harq->mcs = dlsch0_ue_harq->mcs;
- //dlsch0_eNB_harq->rvidx = dlsch0_ue_harq->rvidx;
- //dlsch0_eNB_harq->Nl = dlsch0_ue_harq->Nl;
-
- //dlsch0_eNB_harq->TBS = dlsch0_ue_harq->TBS;
- //dlsch0_eNB_harq->dl_power_off = dlsch0_ue_harq->dl_power_off;
- //dlsch0_eNB_harq->status = dlsch0_ue_harq->status;
-
- //UE->dlsch[eNB_id]->active = UE->dlsch[eNB_id][0]->active;
- //UE->dlsch[eNB_id]->rnti = UE->dlsch[eNB_id][0]->rnti;
-
- //dlsch_encoding(UE->dlsch[eNB_id][0]->harq_processes[UE->dlsch[eNB_id][0]->current_harq_pid]->b,
- // &UE->frame_parms,
- // num_pdcch_symbols,
- // UE->dlsch[0],
- // 0,subframe,
- // &UE->dlsch_rate_matching_stats,
- // &UE->dlsch_turbo_encoding_stats,
- // &UE->dlsch_interleaving_stats
- // );
-
- //scrambling
-
- //modulation
-
- //stripping (from matched filter output?)
-
- //detection of second stream
- }
-
+
} // DLSCH received ok
else {
errs[round]++;
@@ -3449,13 +2784,14 @@ int main(int argc, char **argv)
printf("eNB TX function statistics (per 1ms subframe)\n\n");
std_phy_proc_tx = sqrt((double)eNB->phy_proc_tx.diff_square/pow(cpu_freq_GHz,2)/pow(1000,
2)/eNB->phy_proc_tx.trials - pow((double)eNB->phy_proc_tx.diff/eNB->phy_proc_tx.trials/cpu_freq_GHz/1000,2));
- printf("Total PHY proc tx :%f us (%d trials)\n",(double)eNB->phy_proc_tx.diff/eNB->phy_proc_tx.trials/cpu_freq_GHz/1000.0,eNB->phy_proc_tx.trials);
- printf("|__ Statistcs std: %fus max: %fus min: %fus median %fus q1 %fus q3 %fus n_dropped: %d packet \n",std_phy_proc_tx, t_tx_max, t_tx_min, tx_median, tx_q1, tx_q3,
- n_tx_dropped);
std_phy_proc_tx_ifft = sqrt((double)eNB->ofdm_mod_stats.diff_square/pow(cpu_freq_GHz,2)/pow(1000,
2)/eNB->ofdm_mod_stats.trials - pow((double)eNB->ofdm_mod_stats.diff/eNB->ofdm_mod_stats.trials/cpu_freq_GHz/1000,2));
printf("OFDM_mod time :%f us (%d trials)\n",(double)eNB->ofdm_mod_stats.diff/eNB->ofdm_mod_stats.trials/cpu_freq_GHz/1000.0,eNB->ofdm_mod_stats.trials);
printf("|__ Statistcs std: %fus median %fus q1 %fus q3 %fus \n",std_phy_proc_tx_ifft, tx_ifft_median, tx_ifft_q1, tx_ifft_q3);
+ printf("Total PHY proc tx :%f us (%d trials)\n",(double)eNB->phy_proc_tx.diff/eNB->phy_proc_tx.trials/cpu_freq_GHz/1000.0,eNB->phy_proc_tx.trials);
+ printf("|__ Statistcs std: %fus max: %fus min: %fus median %fus q1 %fus q3 %fus n_dropped: %d packet \n",std_phy_proc_tx, t_tx_max, t_tx_min, tx_median, tx_q1, tx_q3,
+ n_tx_dropped);
+
std_phy_proc_tx_mod = sqrt((double)eNB->dlsch_modulation_stats.diff_square/pow(cpu_freq_GHz,2)/pow(1000,
2)/eNB->dlsch_modulation_stats.trials - pow((double)eNB->dlsch_modulation_stats.diff/eNB->dlsch_modulation_stats.trials/cpu_freq_GHz/1000,2));
printf("DLSCH modulation time :%f us (%d trials)\n",(double)eNB->dlsch_modulation_stats.diff/eNB->dlsch_modulation_stats.trials/cpu_freq_GHz/1000.0,
@@ -3809,24 +3145,6 @@ int main(int argc, char **argv)
}
- printf("Freeing channel I/O\n");
-
- for (i=0; i<2; i++) {
- free(s_re[i]);
- free(s_im[i]);
- free(r_re[i]);
- free(r_im[i]);
- }
-
- free(s_re);
- free(s_im);
- free(r_re);
- free(r_im);
-
- // lte_sync_time_free();
-
- // printf("[MUMIMO] mcs %d, mcsi %d, offset %d, bler %f\n",mcs,mcs_i,offset_mumimo_llr_drange_fix,((double)errs[0])/((double)round_trials[0]));
-
return(0);
}
diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c
index 48b3f8cec1..2c2b03ce78 100644
--- a/openair1/SIMULATION/LTE_PHY/ulsim.c
+++ b/openair1/SIMULATION/LTE_PHY/ulsim.c
@@ -188,7 +188,7 @@ int main(int argc, char **argv)
int **txdata;
LTE_DL_FRAME_PARMS *frame_parms;
- double **s_re,**s_im,**r_re,**r_im;
+ double s_re[2][30720],s_im[2][30720],r_re[2][30720],r_im[2][30720];
double forgetting_factor=0.0; //in [0,1] 0 means a new channel every time, 1 means keep the same channel
double iqim=0.0;
uint8_t extended_prefix_flag=0;
@@ -583,12 +583,6 @@ int main(int argc, char **argv)
txdata = UE->common_vars.txdata;
- s_re = malloc(2*sizeof(double*));
- s_im = malloc(2*sizeof(double*));
- r_re = malloc(2*sizeof(double*));
- r_im = malloc(2*sizeof(double*));
- // r_re0 = malloc(2*sizeof(double*));
- // r_im0 = malloc(2*sizeof(double*));
nsymb = (eNB->frame_parms.Ncp == NORMAL) ? 14 : 12;
@@ -630,13 +624,6 @@ int main(int argc, char **argv)
fprintf(csv_fdUL,"data_all%d=[",mcs);
}
- for (i=0; i<2; i++) {
- s_re[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
- s_im[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
- r_re[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
- r_im[i] = malloc(FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
- }
-
if (xforms==1) {
fl_initialize (&argc, argv, NULL, 0, 0);
@@ -1716,22 +1703,6 @@ int main(int argc, char **argv)
if (test_perf !=0)
fclose (time_meas_fd);
- printf("Freeing channel I/O\n");
-
- for (i=0; i<2; i++) {
- free(s_re[i]);
- free(s_im[i]);
- free(r_re[i]);
- free(r_im[i]);
- }
-
- free(s_re);
- free(s_im);
- free(r_re);
- free(r_im);
-
- // lte_sync_time_free();
-
return(0);
}
diff --git a/openair1/SIMULATION/RF/adc.c b/openair1/SIMULATION/RF/adc.c
index 6dc1c7f8e6..3f89a3cfe5 100755
--- a/openair1/SIMULATION/RF/adc.c
+++ b/openair1/SIMULATION/RF/adc.c
@@ -26,8 +26,8 @@
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
-void adc(double **r_re,
- double **r_im,
+void adc(double r_re[2][30720],
+ double r_im[2][30720],
unsigned int input_offset,
unsigned int output_offset,
unsigned int **output,
diff --git a/openair1/SIMULATION/RF/dac.c b/openair1/SIMULATION/RF/dac.c
index 22e286a496..ba67eb1f32 100755
--- a/openair1/SIMULATION/RF/dac.c
+++ b/openair1/SIMULATION/RF/dac.c
@@ -31,8 +31,8 @@
#include
#include "PHY/TOOLS/defs.h"
-void dac(double **s_re,
- double **s_im,
+void dac(double s_re[2][30720],
+ double s_im[2][30720],
uint32_t **input,
uint32_t input_offset,
uint32_t nb_tx_antennas,
@@ -81,8 +81,8 @@ void dac(double **s_re,
}
}
-double dac_fixed_gain(double **s_re,
- double **s_im,
+double dac_fixed_gain(double s_re[2][30720],
+ double s_im[2][30720],
uint32_t **input,
uint32_t input_offset,
uint32_t nb_tx_antennas,
diff --git a/openair1/SIMULATION/RF/defs.h b/openair1/SIMULATION/RF/defs.h
index 984dfa6ca8..4bd9528dae 100644
--- a/openair1/SIMULATION/RF/defs.h
+++ b/openair1/SIMULATION/RF/defs.h
@@ -64,16 +64,16 @@ void rf_rx(double **r_re,
double IQ_imb_dB,
double IQ_phase);
-void rf_rx_simple(double **r_re,
- double **r_im,
+void rf_rx_simple(double r_re[2][30720],
+ double r_im[2][30720],
unsigned int nb_rx_antennas,
unsigned int length,
double s_time,
double rx_gain_dB);
-void adc(double **r_re,
- double **r_im,
+void adc(double r_re[2][30720],
+ double r_im[2][30720],
unsigned int input_offset,
unsigned int output_offset,
int **output,
@@ -81,8 +81,8 @@ void adc(double **r_re,
unsigned int length,
unsigned char B);
-void dac(double **s_re,
- double **s_im,
+void dac(double s_re[2][30720],
+ double s_im[2][30720],
int **input,
unsigned int input_offset,
unsigned int nb_tx_antennas,
@@ -92,8 +92,8 @@ void dac(double **s_re,
unsigned int meas_length,
unsigned int meas_offset);
-double dac_fixed_gain(double **s_re,
- double **s_im,
+double dac_fixed_gain(double s_re[2][30720],
+ double s_im[2][30720],
int **input,
unsigned int input_offset,
unsigned int nb_tx_antennas,
diff --git a/openair1/SIMULATION/RF/rf.c b/openair1/SIMULATION/RF/rf.c
index 1f240595aa..2bcb64727d 100644
--- a/openair1/SIMULATION/RF/rf.c
+++ b/openair1/SIMULATION/RF/rf.c
@@ -206,8 +206,8 @@ void rf_rx(double **r_re,
}
}
-void rf_rx_simple(double **r_re,
- double **r_im,
+void rf_rx_simple(double r_re[2][30720],
+ double r_im[2][30720],
unsigned int nb_rx_antennas,
unsigned int length,
double s_time,
diff --git a/openair1/SIMULATION/TOOLS/defs.h b/openair1/SIMULATION/TOOLS/defs.h
index c72ea743b1..536655340b 100644
--- a/openair1/SIMULATION/TOOLS/defs.h
+++ b/openair1/SIMULATION/TOOLS/defs.h
@@ -219,10 +219,10 @@ channel_desc_t *new_channel_desc_scm(uint8_t nb_tx,
int random_channel(channel_desc_t *desc, uint8_t abstraction_flag);
/**\fn void multipath_channel(channel_desc_t *desc,
- double **tx_sig_re,
- double **tx_sig_im,
- double **rx_sig_re,
- double **rx_sig_im,
+ double tx_sig_re[2][30720],
+ double tx_sig_im[2][30720],
+ double rx_sig_re[2][30720],
+ double rx_sig_im[2][30720],
uint32_t length,
uint8_t keep_channel)
@@ -237,10 +237,10 @@ int random_channel(channel_desc_t *desc, uint8_t abstraction_flag);
*/
void multipath_channel(channel_desc_t *desc,
- double **tx_sig_re,
- double **tx_sig_im,
- double **rx_sig_re,
- double **rx_sig_im,
+ double tx_sig_re[2][30720],
+ double tx_sig_im[2][30720],
+ double rx_sig_re[2][30720],
+ double rx_sig_im[2][30720],
uint32_t length,
uint8_t keep_channel);
/*
diff --git a/openair1/SIMULATION/TOOLS/multipath_channel.c b/openair1/SIMULATION/TOOLS/multipath_channel.c
index 9a72ca6423..aae9e974a7 100644
--- a/openair1/SIMULATION/TOOLS/multipath_channel.c
+++ b/openair1/SIMULATION/TOOLS/multipath_channel.c
@@ -44,10 +44,10 @@ uint8_t multipath_channel_nosigconv(channel_desc_t *desc)
//#define CHANNEL_SSE
#ifdef CHANNEL_SSE
void multipath_channel(channel_desc_t *desc,
- double **tx_sig_re,
- double **tx_sig_im,
- double **rx_sig_re,
- double **rx_sig_im,
+ double tx_sig_re[2][30720],
+ double tx_sig_im[2][30720],
+ double rx_sig_re[2][30720],
+ double rx_sig_im[2][30720],
uint32_t length,
uint8_t keep_channel)
{
@@ -150,10 +150,10 @@ void multipath_channel(channel_desc_t *desc,
#else
void multipath_channel(channel_desc_t *desc,
- double **tx_sig_re,
- double **tx_sig_im,
- double **rx_sig_re,
- double **rx_sig_im,
+ double tx_sig_re[2][30720],
+ double tx_sig_im[2][30720],
+ double rx_sig_re[2][30720],
+ double rx_sig_im[2][30720],
uint32_t length,
uint8_t keep_channel)
{
diff --git a/openair2/COMMON/s1ap_messages_types.h b/openair2/COMMON/s1ap_messages_types.h
index f2c6a2a3a2..d664dd3bb4 100644
--- a/openair2/COMMON/s1ap_messages_types.h
+++ b/openair2/COMMON/s1ap_messages_types.h
@@ -76,7 +76,7 @@
* the key length is 32 bytes (256 bits)
*/
#define SECURITY_KEY_LENGTH 32
-
+#ifndef OCP_FRAMEWORK
typedef enum cell_type_e {
CELL_MACRO_ENB,
CELL_HOME_ENB
@@ -107,6 +107,7 @@ typedef enum cn_domain_s {
CN_DOMAIN_PS = 1,
CN_DOMAIN_CS = 2
} cn_domain_t;
+#endif
typedef struct net_ip_address_s {
unsigned ipv4:1;
@@ -122,6 +123,7 @@ typedef struct ambr_s {
bitrate_t br_dl;
} ambr_t;
+#ifndef OCP_FRAMEWORK
typedef enum priority_level_s {
PRIORITY_LEVEL_SPARE = 0,
PRIORITY_LEVEL_HIGHEST = 1,
@@ -140,6 +142,7 @@ typedef enum pre_emp_vulnerability_e {
PRE_EMPTION_VULNERABILITY_DISABLED = 1,
PRE_EMPTION_VULNERABILITY_MAX,
} pre_emp_vulnerability_t;
+#endif
typedef struct allocation_retention_priority_s {
priority_level_t priority_level;
diff --git a/openair2/ENB_APP/enb_config.h b/openair2/ENB_APP/enb_config.h
index 62418197f0..23a100cd22 100755
--- a/openair2/ENB_APP/enb_config.h
+++ b/openair2/ENB_APP/enb_config.h
@@ -40,6 +40,7 @@
#include
#include
#include
+#include
#include "commonDef.h"
#include "platform_types.h"
@@ -49,6 +50,7 @@
#include "s1ap_messages_types.h"
#ifdef CMAKER
#include "SystemInformationBlockType2.h"
+#include "rrc_messages_types.h"
#else
#include "RRC/LITE/MESSAGES/SystemInformationBlockType2.h"
#endif
@@ -116,6 +118,7 @@ typedef struct Enb_properties_s {
*/
char *eNB_name;
+
/* Tracking area code */
uint16_t tac;
@@ -130,6 +133,7 @@ typedef struct Enb_properties_s {
/* Physical parameters */
int16_t nb_cc;
+#ifndef OCP_FRAMEWORK
eNB_func_t cc_node_function[1+MAX_NUM_CCs];
eNB_timing_t cc_node_timing[1+MAX_NUM_CCs];
int16_t cc_node_synch_ref[1+MAX_NUM_CCs];
@@ -205,6 +209,9 @@ typedef struct Enb_properties_s {
long ue_TimersAndConstants_t311[1+MAX_NUM_CCs];
long ue_TimersAndConstants_n310[1+MAX_NUM_CCs];
long ue_TimersAndConstants_n311[1+MAX_NUM_CCs];
+#else
+ RrcConfigurationReq RrcReq;
+#endif
long srb1_timer_poll_retransmit;
long srb1_timer_reordering;
@@ -234,6 +241,7 @@ typedef struct Enb_properties_s {
/* List of MME to connect to */
rrh_gw_config_t rrh_gw_config[4];
+#ifndef OCP_FRAMEWORK
// otg config
/* Nb of OTG elements */
uint8_t num_otg_elements;
@@ -262,7 +270,7 @@ typedef struct Enb_properties_s {
int16_t udp_log_verbosity;
int16_t osa_log_level;
int16_t osa_log_verbosity;
-
+#endif
} Enb_properties_t;
typedef struct Enb_properties_array_s {
diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h
index bf166f6d64..5b558e2921 100644
--- a/openair2/LAYER2/MAC/defs.h
+++ b/openair2/LAYER2/MAC/defs.h
@@ -82,6 +82,7 @@
#define BCCH_PAYLOAD_SIZE_MAX 128
#define CCCH_PAYLOAD_SIZE_MAX 128
+#define PCCH_PAYLOAD_SIZE_MAX 128
#define SCH_PAYLOAD_SIZE_MAX 4096
/// Logical channel ids from 36-311 (Note BCCH is not specified in 36-311, uses the same as first DRB)
@@ -263,6 +264,10 @@ typedef struct {
typedef struct {
uint8_t payload[BCCH_PAYLOAD_SIZE_MAX] ;
} __attribute__((__packed__))BCCH_PDU;
+/*! \brief BCCH payload */
+typedef struct {
+ uint8_t payload[PCCH_PAYLOAD_SIZE_MAX] ;
+} __attribute__((__packed__))PCCH_PDU;
#ifdef Rel10
/*! \brief MCCH payload */
@@ -291,6 +296,8 @@ typedef struct {
#define CCCH_LCHANID 0
/*!\brief Values of BCCH logical channel */
#define BCCH 3 // SI
+/*!\brief Values of PCCH logical channel */
+#define PCCH 4 // Paging
/*!\brief Value of CCCH / SRB0 logical channel */
#define CCCH 0 // srb0
/*!\brief DCCH / SRB1 logical channel */
@@ -1104,6 +1111,8 @@ typedef struct {
time_stats_t rx_mch_sdu;
/// UE BCCH rx processing time including RLC interface (mac_rrc_data_ind)
time_stats_t rx_si;
+ /// UE PCCH rx processing time including RLC interface (mac_rrc_data_ind)
+ time_stats_t rx_p;
} UE_MAC_INST;
/*! \brief ID of the neighboring cells used for HO*/
typedef struct {
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c
index e673a33371..64c5bc12b5 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c
@@ -68,6 +68,7 @@
#include "SIMULATION/TOOLS/defs.h" // for taus
+#include "T.h"
void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,unsigned char Msg3_subframe)
{
@@ -644,6 +645,9 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,un
&eNB->common_channels[CC_id].CCCH_pdu.payload[0],
rrc_sdu_length);
+ T(T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT(module_idP), T_INT(CC_id), T_INT(RA_template->rnti), T_INT(frameP), T_INT(subframeP),
+ T_INT(0 /*harq_pid always 0?*/), T_BUFFER(&eNB->UE_list.DLSCH_pdu[CC_id][0][UE_id].payload[0], TBsize));
+
if (opt_enabled==1) {
trace_pdu(1, (uint8_t *)eNB->UE_list.DLSCH_pdu[CC_id][0][(unsigned char)UE_id].payload[0],
rrc_sdu_length, UE_id, 3, UE_RNTI(module_idP, UE_id),
diff --git a/openair2/LAYER2/MAC/main.c b/openair2/LAYER2/MAC/main.c
index 7480babd24..fd29513470 100644
--- a/openair2/LAYER2/MAC/main.c
+++ b/openair2/LAYER2/MAC/main.c
@@ -480,6 +480,7 @@ int l2_init(LTE_DL_FRAME_PARMS *frame_parms,int eMBMS_active, char *uecap_xer,ui
LOG_I(MAC,"[MAIN] init UE MAC functions \n");
mac_xface->ue_decode_si = ue_decode_si;
+ mac_xface->ue_decode_p = ue_decode_p;
mac_xface->ue_send_sdu = ue_send_sdu;
#ifdef Rel10
mac_xface->ue_send_mch_sdu = ue_send_mch_sdu;
diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h
index b6b223bd6a..10d5093dd4 100644
--- a/openair2/LAYER2/MAC/proto.h
+++ b/openair2/LAYER2/MAC/proto.h
@@ -385,6 +385,8 @@ void mac_out_of_sync_ind(module_id_t module_idP, frame_t frameP, uint16_t CH_ind
void ue_decode_si(module_id_t module_idP, int CC_id,frame_t frame, uint8_t CH_index, void *pdu, uint16_t len);
+void ue_decode_p(module_id_t module_idP, int CC_id,frame_t frame, uint8_t CH_index, void *pdu, uint16_t len);
+
void ue_send_sdu(module_id_t module_idP, uint8_t CC_id,frame_t frame, uint8_t *sdu,uint16_t sdu_len,uint8_t CH_index);
diff --git a/openair2/LAYER2/MAC/ue_procedures.c b/openair2/LAYER2/MAC/ue_procedures.c
index 1d7e49070b..a3c35d18b8 100644
--- a/openair2/LAYER2/MAC/ue_procedures.c
+++ b/openair2/LAYER2/MAC/ue_procedures.c
@@ -525,6 +525,41 @@ void ue_decode_si(module_id_t module_idP,int CC_id,frame_t frameP, uint8_t eNB_i
}
}
+void ue_decode_p(module_id_t module_idP,int CC_id,frame_t frameP, uint8_t eNB_index, void *pdu,uint16_t len)
+{
+
+ start_meas(&UE_mac_inst[module_idP].rx_p);
+ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_PCCH, VCD_FUNCTION_IN);
+
+ LOG_D(MAC,"[UE %d] Frame %d Sending Paging message to RRC (LCID Id %d,len %d)\n",module_idP,frameP,PCCH,len);
+
+ mac_rrc_data_ind(module_idP,
+ CC_id,
+ frameP,0, // unknown subframe
+ P_RNTI,
+ PCCH,
+ (uint8_t *)pdu,
+ len,
+ ENB_FLAG_NO,
+ eNB_index,
+ 0);
+ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_PCCH, VCD_FUNCTION_OUT);
+ stop_meas(&UE_mac_inst[module_idP].rx_p);
+ if (opt_enabled == 1) {
+ trace_pdu(0,
+ (uint8_t *)pdu,
+ len,
+ module_idP,
+ 4,
+ P_RNTI,
+ UE_mac_inst[module_idP].subframe,
+ 0,
+ 0);
+ LOG_D(OPT,"[UE %d][BCH] Frame %d trace pdu for CC_id %d rnti %x with size %d\n",
+ module_idP, frameP, CC_id, P_RNTI, len);
+ }
+}
+
#ifdef Rel10
unsigned char *parse_mch_header(unsigned char *mac_header,
unsigned char *num_sdu,
diff --git a/openair2/PHY_INTERFACE/defs.h b/openair2/PHY_INTERFACE/defs.h
index 5d933094f3..6b45bbdc7b 100755
--- a/openair2/PHY_INTERFACE/defs.h
+++ b/openair2/PHY_INTERFACE/defs.h
@@ -146,6 +146,9 @@ typedef struct {
/// Send a received SI sdu
void (*ue_decode_si)(module_id_t Mod_id,int CC_id,frame_t frameP, uint8_t CH_index, void *pdu, uint16_t len);
+ /// Send a received Paging sdu
+ void (*ue_decode_p)(module_id_t Mod_id,int CC_id,frame_t frameP, uint8_t CH_index, void *pdu, uint16_t len);
+
/// Send a received DLSCH sdu to MAC
void (*ue_send_sdu)(module_id_t Mod_id,uint8_t CC_id,frame_t frameP,uint8_t *sdu,uint16_t sdu_len,uint8_t CH_index);
diff --git a/openair2/RRC/LITE/L2_interface.c b/openair2/RRC/LITE/L2_interface.c
index 0558376b1d..3bdd88b821 100644
--- a/openair2/RRC/LITE/L2_interface.c
+++ b/openair2/RRC/LITE/L2_interface.c
@@ -397,6 +397,10 @@ mac_rrc_data_ind(
#endif
}
+ if(srb_idP == PCCH) {
+ LOG_D(RRC,"[UE %d] Received SDU for PCCH on SRB %d from eNB %d\n",module_idP,srb_idP,eNB_indexP);
+ decode_PCCH_DLSCH_Message(&ctxt,eNB_indexP,(uint8_t*)sduP,sdu_lenP);
+ }
if((srb_idP & RAB_OFFSET) == CCCH) {
if (sdu_lenP>0) {
LOG_T(RRC,"[UE %d] Received SDU for CCCH on SRB %d from eNB %d\n",module_idP,srb_idP & RAB_OFFSET,eNB_indexP);
diff --git a/openair2/RRC/LITE/MESSAGES/asn1c/asn1cpatch.p0 b/openair2/RRC/LITE/MESSAGES/asn1c/asn1cpatch.p0
deleted file mode 100644
index 18dc516285..0000000000
--- a/openair2/RRC/LITE/MESSAGES/asn1c/asn1cpatch.p0
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: skeletons/per_opentype.c
-===================================================================
---- skeletons/per_opentype.c (revision 1516)
-+++ skeletons/per_opentype.c (working copy)
-@@ -277,7 +306,7 @@
- (void)constraints;
- (void)sptr;
-
-- while(per_get_few_bits(pd, 24) >= 0);
-+ while(per_get_few_bits(pd, 1 /*24*/) >= 0);
-
- rv.code = RC_OK;
- rv.consumed = pd->moved;
diff --git a/openair2/RRC/LITE/proto.h b/openair2/RRC/LITE/proto.h
index 7b316ce953..f200b14d30 100644
--- a/openair2/RRC/LITE/proto.h
+++ b/openair2/RRC/LITE/proto.h
@@ -357,6 +357,12 @@ int decode_BCCH_DLSCH_Message(
const uint8_t rsrq,
const uint8_t rsrp );
+int decode_PCCH_DLSCH_Message(
+ const protocol_ctxt_t* const ctxt_pP,
+ const uint8_t eNB_index,
+ uint8_t* const Sdu,
+ const uint8_t Sdu_len);
+
void
ue_meas_filtering(
const protocol_ctxt_t* const ctxt_pP,
diff --git a/openair2/RRC/LITE/rrc_UE.c b/openair2/RRC/LITE/rrc_UE.c
index c72c106e0f..8ea604f932 100644
--- a/openair2/RRC/LITE/rrc_UE.c
+++ b/openair2/RRC/LITE/rrc_UE.c
@@ -58,6 +58,7 @@
#include "UL-DCCH-Message.h"
#include "DL-DCCH-Message.h"
#include "BCCH-DL-SCH-Message.h"
+#include "PCCH-Message.h"
#ifdef Rel10
#include "MCCH-Message.h"
#endif
@@ -2463,6 +2464,39 @@ int decode_BCCH_DLSCH_Message(
return 0;
}
+//-----------------------------------------------------------------------------
+int decode_PCCH_DLSCH_Message(
+ const protocol_ctxt_t* const ctxt_pP,
+ const uint8_t eNB_index,
+ uint8_t* const Sdu,
+ const uint8_t Sdu_len)
+{
+ PCCH_Message_t *pcch_message = NULL;
+ int i;
+
+ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_PCCH, VCD_FUNCTION_IN );
+
+ asn_dec_rval_t dec_rval = uper_decode_complete( NULL,
+ &asn_DEF_PCCH_Message,
+ (void **)&pcch_message,
+ (const void *)Sdu,
+ Sdu_len );
+
+ if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
+ LOG_E( RRC, "[UE %"PRIu8"] Failed to decode PCCH_MESSAGE (%zu bits)\n",
+ ctxt_pP->module_id,
+ dec_rval.consumed );
+ for (i=0;imessage.choice.c1.choice.ueCapabilityInformation;
+ /* 4096 is arbitrary, should be big enough */
+ unsigned char buf[4096];
+ unsigned char *buf2;
+ UERadioAccessCapabilityInformation_t rac;
- if ((ueCapabilityInformation->criticalExtensions.present == UECapabilityInformation__criticalExtensions_PR_c1)
- && (ueCapabilityInformation->criticalExtensions.choice.c1.present
- == UECapabilityInformation__criticalExtensions__c1_PR_ueCapabilityInformation_r8)
- && (ueCapabilityInformation->criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list.count > 0)) {
- UE_CapabilityRAT_ContainerList_t* ue_CapabilityRAT_ContainerList =
- &ueCapabilityInformation->criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList;
- MessageDef *msg_p;
-
- msg_p = itti_alloc_new_message (TASK_RRC_ENB, S1AP_UE_CAPABILITIES_IND);
- S1AP_UE_CAPABILITIES_IND (msg_p).eNB_ue_s1ap_id = ue_context_pP->ue_context.eNB_ue_s1ap_id;
- S1AP_UE_CAPABILITIES_IND (msg_p).ue_radio_cap.length = ue_CapabilityRAT_ContainerList->list.array[0]->ueCapabilityRAT_Container.size;
- S1AP_UE_CAPABILITIES_IND (msg_p).ue_radio_cap.buffer = ue_CapabilityRAT_ContainerList->list.array[0]->ueCapabilityRAT_Container.buf;
-
- itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p);
-
- if (ue_CapabilityRAT_ContainerList->list.count > 1) {
- LOG_W (RRC,"[eNB %d][UE %x] can only handle 1 UE capability RAT item for now (%d)\n",
- ctxt_pP->module_id,
- ue_context_pP->ue_context.rnti,
- ue_CapabilityRAT_ContainerList->list.count);
- }
+ if (ueCapabilityInformation->criticalExtensions.present != UECapabilityInformation__criticalExtensions_PR_c1
+ || ueCapabilityInformation->criticalExtensions.choice.c1.present != UECapabilityInformation__criticalExtensions__c1_PR_ueCapabilityInformation_r8) {
+ LOG_E(RRC, "[eNB %d][UE %x] bad UE capabilities\n", ctxt_pP->module_id, ue_context_pP->ue_context.rnti);
+ return;
}
+
+ asn_enc_rval_t ret = uper_encode_to_buffer(&asn_DEF_UECapabilityInformation, ueCapabilityInformation, buf, 4096);
+ if (ret.encoded == -1) abort();
+
+ memset(&rac, 0, sizeof(UERadioAccessCapabilityInformation_t));
+
+ rac.criticalExtensions.present = UERadioAccessCapabilityInformation__criticalExtensions_PR_c1;
+ rac.criticalExtensions.choice.c1.present = UERadioAccessCapabilityInformation__criticalExtensions__c1_PR_ueRadioAccessCapabilityInformation_r8;
+ rac.criticalExtensions.choice.c1.choice.ueRadioAccessCapabilityInformation_r8.ue_RadioAccessCapabilityInfo.buf = buf;
+ rac.criticalExtensions.choice.c1.choice.ueRadioAccessCapabilityInformation_r8.ue_RadioAccessCapabilityInfo.size = (ret.encoded+7)/8;
+ rac.criticalExtensions.choice.c1.choice.ueRadioAccessCapabilityInformation_r8.nonCriticalExtension = NULL;
+
+ /* 8192 is arbitrary, should be big enough */
+ buf2 = malloc16(8192);
+ if (buf2 == NULL) abort();
+ ret = uper_encode_to_buffer(&asn_DEF_UERadioAccessCapabilityInformation, &rac, buf2, 8192);
+ if (ret.encoded == -1) abort();
+
+ MessageDef *msg_p;
+
+ msg_p = itti_alloc_new_message (TASK_RRC_ENB, S1AP_UE_CAPABILITIES_IND);
+ S1AP_UE_CAPABILITIES_IND (msg_p).eNB_ue_s1ap_id = ue_context_pP->ue_context.eNB_ue_s1ap_id;
+ S1AP_UE_CAPABILITIES_IND (msg_p).ue_radio_cap.length = (ret.encoded+7)/8;
+ S1AP_UE_CAPABILITIES_IND (msg_p).ue_radio_cap.buffer = buf2;
+
+ itti_send_msg_to_task (TASK_S1AP, ctxt_pP->instance, msg_p);
}
//------------------------------------------------------------------------------
diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.c b/openair2/UTIL/LOG/vcd_signal_dumper.c
index 7779fe5290..94e180773d 100644
--- a/openair2/UTIL/LOG/vcd_signal_dumper.c
+++ b/openair2/UTIL/LOG/vcd_signal_dumper.c
@@ -293,6 +293,7 @@ const char* eurecomFunctionsNames[] = {
"macxface_out_of_sync_ind",
"macxface_ue_decode_si",
+ "macxface_ue_decode_pcch",
"macxface_ue_decode_ccch",
"macxface_ue_decode_bcch",
"macxface_ue_send_sdu",
diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.h b/openair2/UTIL/LOG/vcd_signal_dumper.h
index 4c5e5cc1b8..416ec6064e 100644
--- a/openair2/UTIL/LOG/vcd_signal_dumper.h
+++ b/openair2/UTIL/LOG/vcd_signal_dumper.h
@@ -267,6 +267,7 @@ typedef enum {
VCD_SIGNAL_DUMPER_FUNCTIONS_OUT_OF_SYNC_IND,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_SI,
+ VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_PCCH,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_CCCH,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_BCCH,
VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_SDU,
diff --git a/openair2/UTIL/OPT/opt.h b/openair2/UTIL/OPT/opt.h
index bb3a099e12..dfe2286ae1 100644
--- a/openair2/UTIL/OPT/opt.h
+++ b/openair2/UTIL/OPT/opt.h
@@ -63,12 +63,16 @@ This header file must be included */
#include "PHY/impl_defs_lte.h"
#endif
+#ifdef OCP_FRAMEWORK
+#include
+#else
typedef enum trace_mode_e {
OPT_WIRESHARK,
OPT_PCAP,
OPT_TSHARK,
OPT_NONE
} trace_mode_t;
+#endif
typedef enum radio_type_e {
RADIO_TYPE_FDD = 1,
diff --git a/openair3/NAS/UE/API/USIM/usim_api.c b/openair3/NAS/UE/API/USIM/usim_api.c
index fe8dc8b350..807ee46724 100644
--- a/openair3/NAS/UE/API/USIM/usim_api.c
+++ b/openair3/NAS/UE/API/USIM/usim_api.c
@@ -77,7 +77,8 @@ Description Implements the API used by the NAS layer to read/write
* Subscriber authentication security key
*/
#define USIM_API_K_SIZE 16
-#define USIM_API_K_VALUE "fec86ba6eb707ed08905757b1bb44b8f"
+//#define USIM_API_K_VALUE "fec86ba6eb707ed08905757b1bb44b8f"
+#define USIM_API_K_VALUE "8BAF473F2F8FD09487CCCBD7097C6862"
static uint8_t _usim_api_k[USIM_API_K_SIZE];
diff --git a/openair3/S1AP/MESSAGES/ASN1/asn1cpatch.p0 b/openair3/S1AP/MESSAGES/ASN1/asn1cpatch.p0
deleted file mode 100644
index b3a5b8d39f..0000000000
--- a/openair3/S1AP/MESSAGES/ASN1/asn1cpatch.p0
+++ /dev/null
@@ -1,5082 +0,0 @@
-Index: asn1c/unber.c
-===================================================================
---- asn1c/unber.c (revision 1516)
-+++ asn1c/unber.c (working copy)
-@@ -775,4 +775,8 @@
-
- asn_enc_rval_t OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *cts, void *sptr, asn_per_outp_t *po) { asn_enc_rval_t er = { 0, 0, 0 }; (void)td; (void)cts; (void)sptr; (void)po; return er; }
-
-+asn_dec_rval_t OCTET_STRING_decode_aper(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td, asn_per_constraints_t *cts, void **sptr, asn_per_data_t *pd) { asn_dec_rval_t rv = { 0, 0 }; (void)ctx; (void)td; (void)cts; (void)sptr; (void)pd; return rv; }
-+
-+asn_enc_rval_t OCTET_STRING_encode_aper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *cts, void *sptr, asn_per_outp_t *po) { asn_enc_rval_t er = { 0, 0, 0 }; (void)td; (void)cts; (void)sptr; (void)po; return er; }
-+
- size_t xer_whitespace_span(const void *chunk_buf, size_t chunk_size) { (void)chunk_buf; (void)chunk_size; return 0; }
-Index: asn1c/asn1c.c
-===================================================================
---- asn1c/asn1c.c (revision 1516)
-+++ asn1c/asn1c.c (working copy)
-@@ -111,6 +111,8 @@
- asn1_compiler_flags &= ~A1C_LINK_SKELETONS;
- } else if(strcmp(optarg, "link-skeletons") == 0) {
- asn1_compiler_flags |= A1C_LINK_SKELETONS;
-+ } else if(strcmp(optarg, "have_native64") == 0) {
-+ asn1_compiler_flags |= A1C_HAVE_NATIVE_64;
- } else {
- fprintf(stderr, "-f%s: Invalid argument\n", optarg);
- exit(EX_USAGE);
-@@ -471,6 +473,7 @@
- " -fno-include-deps Do not generate courtesy #includes for dependencies\n"
- " -funnamed-unions Enable unnamed unions in structures\n"
- " -fwide-types Use INTEGER_t instead of \"long\" by default, etc.\n"
-+" -fhave_native64 Use int64_t/uint64_t for target platform\n"
- "\n"
-
- " -gen-PER Generate PER support code\n"
-Index: examples/README
-===================================================================
---- examples/README (revision 1516)
-+++ examples/README (working copy)
-@@ -25,6 +25,8 @@
- UserPlane Location Protocol decoder. Before trying to compile, read the
- README file in that directory.
-
-+The clyx2asn1.pl script can be used to extract ASN.1 data from LyX editor files.
-+
- The crfc2asn1.pl script can be used to extract ASN.1 data from RFC texts.
- For instance, it is used to extract X.509, MEGACO, and LDAPv3 ASN.1 modules
- from the corresponding RFC texts (rfc3280.txt, rfc3525.txt, rfc4211.txt).
-Index: skeletons/UTF8String.c
-===================================================================
---- skeletons/UTF8String.c (revision 1516)
-+++ skeletons/UTF8String.c (working copy)
-@@ -25,6 +25,8 @@
- OCTET_STRING_encode_xer_utf8,
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
-+ OCTET_STRING_decode_aper,
-+ OCTET_STRING_encode_aper,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_UTF8String_tags,
- sizeof(asn_DEF_UTF8String_tags)
-Index: skeletons/constr_TYPE.h
-===================================================================
---- skeletons/constr_TYPE.h (revision 1516)
-+++ skeletons/constr_TYPE.h (working copy)
-@@ -99,6 +99,8 @@
- xer_type_encoder_f *xer_encoder; /* [Canonical] XER encoder */
- per_type_decoder_f *uper_decoder; /* Unaligned PER decoder */
- per_type_encoder_f *uper_encoder; /* Unaligned PER encoder */
-+ per_type_decoder_f *aper_decoder; /* Aligned PER decoder */
-+ per_type_encoder_f *aper_encoder; /* Aligned PER encoder */
-
- /***********************************************************************
- * Internally useful members. Not to be used by applications directly. *
-Index: skeletons/RELATIVE-OID.c
-===================================================================
---- skeletons/RELATIVE-OID.c (revision 1516)
-+++ skeletons/RELATIVE-OID.c (working copy)
-@@ -28,6 +28,8 @@
- RELATIVE_OID_encode_xer,
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
-+ OCTET_STRING_decode_aper,
-+ OCTET_STRING_encode_aper,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_RELATIVE_OID_tags,
- sizeof(asn_DEF_RELATIVE_OID_tags)
-Index: skeletons/per_encoder.c
-===================================================================
---- skeletons/per_encoder.c (revision 1516)
-+++ skeletons/per_encoder.c (working copy)
-@@ -4,6 +4,7 @@
-
- static asn_enc_rval_t uper_encode_internal(asn_TYPE_descriptor_t *td, asn_per_constraints_t *, void *sptr, asn_app_consume_bytes_f *cb, void *app_key);
-
-+static asn_enc_rval_t aper_encode_internal(asn_TYPE_descriptor_t *td, asn_per_constraints_t *, void *sptr, asn_app_consume_bytes_f *cb, void *app_key);
- asn_enc_rval_t
- uper_encode(asn_TYPE_descriptor_t *td, void *sptr, asn_app_consume_bytes_f *cb, void *app_key) {
- return uper_encode_internal(td, 0, sptr, cb, app_key);
-@@ -41,6 +42,18 @@
- return uper_encode_internal(td, 0, sptr, encode_to_buffer_cb, &key);
- }
-
-+asn_enc_rval_t
-+aper_encode_to_buffer(asn_TYPE_descriptor_t *td, void *sptr, void *buffer, size_t buffer_size) {
-+ enc_to_buf_arg key;
-+
-+ key.buffer = buffer;
-+ key.left = buffer_size;
-+
-+ if(td) ASN_DEBUG("Encoding \"%s\" using ALIGNED PER", td->name);
-+
-+ return aper_encode_internal(td, 0, sptr, encode_to_buffer_cb, &key);
-+}
-+
- typedef struct enc_dyn_arg {
- void *buffer;
- size_t length;
-@@ -93,6 +106,35 @@
- }
- }
-
-+ssize_t
-+aper_encode_to_new_buffer(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, void **buffer_r) {
-+ asn_enc_rval_t er;
-+ enc_dyn_arg key;
-+
-+ memset(&key, 0, sizeof(key));
-+
-+ er = aper_encode_internal(td, constraints, sptr, encode_dyn_cb, &key);
-+ switch(er.encoded) {
-+ case -1:
-+ FREEMEM(key.buffer);
-+ return -1;
-+ case 0:
-+ FREEMEM(key.buffer);
-+ key.buffer = MALLOC(1);
-+ if(key.buffer) {
-+ *(char *)key.buffer = '\0';
-+ *buffer_r = key.buffer;
-+ return 1;
-+ } else {
-+ return -1;
-+ }
-+ default:
-+ *buffer_r = key.buffer;
-+ ASN_DEBUG("Complete encoded in %ld bits", (long)er.encoded);
-+ return ((er.encoded + 7) >> 3);
-+ }
-+}
-+
- /*
- * Internally useful functions.
- */
-@@ -115,6 +157,23 @@
- return po->outper(po->tmpspace, buf - po->tmpspace, po->op_key);
- }
-
-+static int
-+_aper_encode_flush_outp(asn_per_outp_t *po) {
-+ uint8_t *buf;
-+
-+ if(po->nboff == 0 && po->buffer == po->tmpspace)
-+ return 0;
-+
-+ buf = po->buffer + (po->nboff >> 3);
-+ /* Make sure we account for the last, partially filled */
-+ if(po->nboff & 0x07) {
-+ buf[0] &= 0xff << (8 - (po->nboff & 0x07));
-+ buf++;
-+ }
-+
-+ return po->outper(po->tmpspace, buf - po->tmpspace, po->op_key);
-+}
-+
- static asn_enc_rval_t
- uper_encode_internal(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_app_consume_bytes_f *cb, void *app_key) {
- asn_per_outp_t po;
-@@ -149,3 +208,37 @@
- return er;
- }
-
-+static asn_enc_rval_t
-+aper_encode_internal(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_app_consume_bytes_f *cb, void *app_key) {
-+ asn_per_outp_t po;
-+ asn_enc_rval_t er;
-+
-+ /*
-+ * Invoke type-specific encoder.
-+ */
-+ if(!td || !td->aper_encoder)
-+ _ASN_ENCODE_FAILED; /* PER is not compiled in */
-+
-+ po.buffer = po.tmpspace;
-+ po.nboff = 0;
-+ po.nbits = 8 * sizeof(po.tmpspace);
-+ po.outper = cb;
-+ po.op_key = app_key;
-+ po.flushed_bytes = 0;
-+
-+ er = td->aper_encoder(td, constraints, sptr, &po);
-+ if(er.encoded != -1) {
-+ size_t bits_to_flush;
-+
-+ bits_to_flush = ((po.buffer - po.tmpspace) << 3) + po.nboff;
-+
-+ /* Set number of bits encoded to a firm value */
-+ er.encoded = (po.flushed_bytes << 3) + bits_to_flush;
-+
-+ if(_aper_encode_flush_outp(&po))
-+ _ASN_ENCODE_FAILED;
-+ }
-+
-+ return er;
-+}
-+
-Index: skeletons/NumericString.c
-===================================================================
---- skeletons/NumericString.c (revision 1516)
-+++ skeletons/NumericString.c (working copy)
-@@ -49,6 +49,8 @@
- OCTET_STRING_encode_xer_utf8,
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
-+ OCTET_STRING_decode_aper,
-+ OCTET_STRING_encode_aper,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_NumericString_tags,
- sizeof(asn_DEF_NumericString_tags)
-Index: skeletons/per_encoder.h
-===================================================================
---- skeletons/per_encoder.h (revision 1516)
-+++ skeletons/per_encoder.h (working copy)
-@@ -38,6 +38,12 @@
- size_t buffer_size /* Initial buffer size (max) */
- );
-
-+asn_enc_rval_t aper_encode_to_buffer(
-+ struct asn_TYPE_descriptor_s *type_descriptor,
-+ void *struct_ptr, /* Structure to be encoded */
-+ void *buffer, /* Pre-allocated buffer */
-+ size_t buffer_size /* Initial buffer size (max) */
-+);
- /*
- * A variant of uper_encode_to_buffer() which allocates buffer itself.
- * Returns the number of bytes in the buffer or -1 in case of failure.
-@@ -52,6 +58,11 @@
- void **buffer_r /* Buffer allocated and returned */
- );
-
-+ssize_t
-+aper_encode_to_new_buffer(struct asn_TYPE_descriptor_s *td,
-+ asn_per_constraints_t *constraints,
-+ void *sptr,
-+ void **buffer_r);
- /*
- * Type of the generic PER encoder function.
- */
-Index: skeletons/T61String.c
-===================================================================
---- skeletons/T61String.c (revision 1516)
-+++ skeletons/T61String.c (working copy)
-@@ -24,6 +24,8 @@
- OCTET_STRING_encode_xer,
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
-+ OCTET_STRING_decode_aper,
-+ OCTET_STRING_encode_aper,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_T61String_tags,
- sizeof(asn_DEF_T61String_tags)
-Index: skeletons/TeletexString.c
-===================================================================
---- skeletons/TeletexString.c (revision 1516)
-+++ skeletons/TeletexString.c (working copy)
-@@ -24,6 +24,8 @@
- OCTET_STRING_encode_xer,
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
-+ OCTET_STRING_decode_aper,
-+ OCTET_STRING_encode_aper,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_TeletexString_tags,
- sizeof(asn_DEF_TeletexString_tags)
-Index: skeletons/BMPString.c
-===================================================================
---- skeletons/BMPString.c (revision 1516)
-+++ skeletons/BMPString.c (working copy)
-@@ -35,6 +35,8 @@
- BMPString_encode_xer, /* Convert to UTF-8 */
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
-+ OCTET_STRING_decode_aper, /* Aligned PER decoder */
-+ OCTET_STRING_encode_aper, /* Aligned PER encoder */
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_BMPString_tags,
- sizeof(asn_DEF_BMPString_tags)
-Index: skeletons/ObjectDescriptor.c
-===================================================================
---- skeletons/ObjectDescriptor.c (revision 1516)
-+++ skeletons/ObjectDescriptor.c (working copy)
-@@ -24,6 +24,8 @@
- OCTET_STRING_encode_xer_utf8,
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
-+ OCTET_STRING_decode_aper,
-+ OCTET_STRING_encode_aper,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_ObjectDescriptor_tags,
- sizeof(asn_DEF_ObjectDescriptor_tags)
-Index: skeletons/PrintableString.c
-===================================================================
---- skeletons/PrintableString.c (revision 1516)
-+++ skeletons/PrintableString.c (working copy)
-@@ -59,6 +59,8 @@
- OCTET_STRING_encode_xer_utf8,
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
-+ OCTET_STRING_decode_aper,
-+ OCTET_STRING_encode_aper,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_PrintableString_tags,
- sizeof(asn_DEF_PrintableString_tags)
-Index: skeletons/constr_SET_OF.c
-===================================================================
---- skeletons/constr_SET_OF.c (revision 1516)
-+++ skeletons/constr_SET_OF.c (working copy)
-@@ -34,7 +34,7 @@
- #undef ADVANCE
- #define ADVANCE(num_bytes) do { \
- size_t num = num_bytes; \
-- ptr = ((const void *)ptr) + num;\
-+ ptr = ((const char *)ptr) + num;\
- size -= num; \
- if(ctx->left >= 0) \
- ctx->left -= num; \
-@@ -100,7 +100,7 @@
- /*
- * Restore parsing context.
- */
-- ctx = (asn_struct_ctx_t *)((void *)st + specs->ctx_offset);
-+ ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
-
- /*
- * Start to parse where left previously
-@@ -457,7 +457,7 @@
- #undef XER_ADVANCE
- #define XER_ADVANCE(num_bytes) do { \
- size_t num = num_bytes; \
-- buf_ptr = ((const void *)buf_ptr) + num;\
-+ buf_ptr = ((const char *)buf_ptr) + num;\
- size -= num; \
- consumed_myself += num; \
- } while(0)
-@@ -505,7 +505,7 @@
- /*
- * Restore parsing context.
- */
-- ctx = (asn_struct_ctx_t *)((void *)st + specs->ctx_offset);
-+ ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
-
- /*
- * Phases of XER/XML processing:
-@@ -627,7 +627,7 @@
- t->buffer = p;
- t->size = newsize;
- }
-- memcpy((void *)t->buffer + t->offset, buffer, size);
-+ memcpy((char *)t->buffer + t->offset, buffer, size);
- t->offset += size;
- return 0;
- }
-@@ -809,7 +809,7 @@
- asn_set_empty(list); /* Remove (list->array) */
-
- specs = (asn_SET_OF_specifics_t *)td->specifics;
-- ctx = (asn_struct_ctx_t *)((void *)ptr + specs->ctx_offset);
-+ ctx = (asn_struct_ctx_t *)((char *)ptr + specs->ctx_offset);
- if(ctx->ptr) {
- ASN_STRUCT_FREE(*elm->type, ctx->ptr);
- ctx->ptr = 0;
-@@ -884,7 +884,7 @@
- if(!st) {
- st = *sptr = CALLOC(1, specs->struct_size);
- if(!st) _ASN_DECODE_FAILED;
-- }
-+ }
- list = _A_SET_FROM_VOID(st);
-
- /* Figure out which constraints to use */
-@@ -901,7 +901,7 @@
- if(ct && ct->effective_bits >= 0) {
- /* X.691, #19.5: No length determinant */
- nelems = per_get_few_bits(pd, ct->effective_bits);
-- ASN_DEBUG("Preparing to fetch %ld+%ld elements from %s",
-+ ASN_DEBUG("Preparing to fetch %ld+%"PRIdMAX" elements from %s",
- (long)nelems, ct->lower_bound, td->name);
- if(nelems < 0) _ASN_DECODE_STARVED;
- nelems += ct->lower_bound;
-@@ -951,3 +951,91 @@
- return rv;
- }
-
-+asn_dec_rval_t
-+SET_OF_decode_aper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
-+ asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
-+ asn_dec_rval_t rv;
-+ asn_SET_OF_specifics_t *specs = (asn_SET_OF_specifics_t *)td->specifics;
-+ asn_TYPE_member_t *elm = td->elements; /* Single one */
-+ void *st = *sptr;
-+ asn_anonymous_set_ *list;
-+ asn_per_constraint_t *ct;
-+ int repeat = 0;
-+ ssize_t nelems;
-+
-+ if(_ASN_STACK_OVERFLOW_CHECK(opt_codec_ctx))
-+ _ASN_DECODE_FAILED;
-+
-+ /*
-+ * Create the target structure if it is not present already.
-+ */
-+ if(!st) {
-+ st = *sptr = CALLOC(1, specs->struct_size);
-+ if(!st) _ASN_DECODE_FAILED;
-+ }
-+ list = _A_SET_FROM_VOID(st);
-+
-+ /* Figure out which constraints to use */
-+ if(constraints) ct = &constraints->size;
-+ else if(td->per_constraints) ct = &td->per_constraints->size;
-+ else ct = 0;
-+
-+ if(ct && ct->flags & APC_EXTENSIBLE) {
-+ int value = per_get_few_bits(pd, 1);
-+ if(value < 0) _ASN_DECODE_STARVED;
-+ if(value) ct = 0; /* Not restricted! */
-+ }
-+
-+ if(ct && ct->effective_bits >= 0) {
-+ /* X.691, #19.5: No length determinant */
-+// nelems = per_get_few_bits(pd, ct->effective_bits);
-+ nelems = aper_get_nsnnwn(pd, ct->upper_bound - ct->lower_bound);
-+ ASN_DEBUG("Preparing to fetch %ld+%"PRIdMAX" elements from %s",
-+ (long)nelems, ct->lower_bound, td->name);
-+ if(nelems < 0) _ASN_DECODE_STARVED;
-+ nelems += ct->lower_bound;
-+ } else {
-+ nelems = -1;
-+ }
-+
-+ do {
-+ int i;
-+ if(nelems < 0) {
-+ nelems = aper_get_length(pd, ct ? ct->upper_bound - ct->lower_bound + 1 : -1,
-+ ct ? ct->effective_bits : -1, &repeat);
-+ ASN_DEBUG("Got to decode %d elements (eff %d)",
-+ (int)nelems, (int)ct ? ct->effective_bits : -1);
-+ if(nelems < 0) _ASN_DECODE_STARVED;
-+ }
-+
-+ for(i = 0; i < nelems; i++) {
-+ void *ptr = 0;
-+ ASN_DEBUG("SET OF %s decoding", elm->type->name);
-+ rv = elm->type->aper_decoder(opt_codec_ctx, elm->type,
-+ elm->per_constraints, &ptr, pd);
-+ ASN_DEBUG("%s SET OF %s decoded %d, %p",
-+ td->name, elm->type->name, rv.code, ptr);
-+ if(rv.code == RC_OK) {
-+ if(ASN_SET_ADD(list, ptr) == 0)
-+ continue;
-+ ASN_DEBUG("Failed to add element into %s",
-+ td->name);
-+ /* Fall through */
-+ rv.code = RC_FAIL;
-+ } else {
-+ ASN_DEBUG("Failed decoding %s of %s (SET OF)",
-+ elm->type->name, td->name);
-+ }
-+ if(ptr) ASN_STRUCT_FREE(*elm->type, ptr);
-+ return rv;
-+ }
-+
-+ nelems = -1; /* Allow uper_get_length() */
-+ } while(repeat);
-+
-+ ASN_DEBUG("Decoded %s as SET OF", td->name);
-+
-+ rv.code = RC_OK;
-+ rv.consumed = 0;
-+ return rv;
-+}
-Index: skeletons/NULL.c
-===================================================================
---- skeletons/NULL.c (revision 1516)
-+++ skeletons/NULL.c (working copy)
-@@ -25,6 +25,8 @@
- NULL_encode_xer,
- NULL_decode_uper, /* Unaligned PER decoder */
- NULL_encode_uper, /* Unaligned PER encoder */
-+ NULL_decode_aper, /* Aligned PER decoder */
-+ NULL_encode_aper, /* Aligned PER encoder */
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_NULL_tags,
- sizeof(asn_DEF_NULL_tags) / sizeof(asn_DEF_NULL_tags[0]),
-@@ -135,6 +137,34 @@
- return rv;
- }
-
-+asn_dec_rval_t
-+NULL_decode_aper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
-+ asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
-+ asn_dec_rval_t rv;
-+
-+ (void)opt_codec_ctx;
-+ (void)td;
-+ (void)constraints;
-+ (void)pd;
-+
-+ if(!*sptr) {
-+ *sptr = MALLOC(sizeof(NULL_t));
-+ if(*sptr) {
-+ *(NULL_t *)*sptr = 0;
-+ } else {
-+ _ASN_DECODE_FAILED;
-+ }
-+ }
-+
-+ /*
-+ * NULL type does not have content octets.
-+ */
-+
-+ rv.code = RC_OK;
-+ rv.consumed = 0;
-+ return rv;
-+}
-+
- asn_enc_rval_t
- NULL_encode_uper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints,
- void *sptr, asn_per_outp_t *po) {
-@@ -148,3 +178,17 @@
- er.encoded = 0;
- _ASN_ENCODED_OK(er);
- }
-+
-+asn_enc_rval_t
-+NULL_encode_aper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints,
-+ void *sptr, asn_per_outp_t *po) {
-+ asn_enc_rval_t er;
-+
-+ (void)td;
-+ (void)constraints;
-+ (void)sptr;
-+ (void)po;
-+
-+ er.encoded = 0;
-+ _ASN_ENCODED_OK(er);
-+}
-Index: skeletons/per_decoder.c
-===================================================================
---- skeletons/per_decoder.c (revision 1516)
-+++ skeletons/per_decoder.c (working copy)
-@@ -37,6 +37,35 @@
- }
-
- asn_dec_rval_t
-+aper_decode_complete(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const void *buffer, size_t size) {
-+ asn_dec_rval_t rval;
-+
-+ rval = aper_decode(opt_codec_ctx, td, sptr, buffer, size, 0, 0);
-+ if(rval.consumed) {
-+ /*
-+ * We've always given 8-aligned data,
-+ * so convert bits to integral bytes.
-+ */
-+ rval.consumed += 7;
-+ rval.consumed >>= 3;
-+ } else if(rval.code == RC_OK) {
-+ if(size) {
-+ if(((const uint8_t *)buffer)[0] == 0) {
-+ rval.consumed = 1; /* 1 byte */
-+ } else {
-+ ASN_DEBUG("Expecting single zeroed byte");
-+ rval.code = RC_FAIL;
-+ }
-+ } else {
-+ /* Must contain at least 8 bits. */
-+ rval.code = RC_WMORE;
-+ }
-+ }
-+
-+ return rval;
-+}
-+
-+asn_dec_rval_t
- uper_decode(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const void *buffer, size_t size, int skip_bits, int unused_bits) {
- asn_codec_ctx_t s_codec_ctx;
- asn_dec_rval_t rval;
-@@ -91,3 +120,57 @@
- return rval;
- }
-
-+asn_dec_rval_t
-+aper_decode(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, void **sptr, const void *buffer, size_t size, int skip_bits, int unused_bits) {
-+ asn_codec_ctx_t s_codec_ctx;
-+ asn_dec_rval_t rval;
-+ asn_per_data_t pd;
-+
-+ if(skip_bits < 0 || skip_bits > 7
-+ || unused_bits < 0 || unused_bits > 7
-+ || (unused_bits > 0 && !size))
-+ _ASN_DECODE_FAILED;
-+
-+ /*
-+ * Stack checker requires that the codec context
-+ * must be allocated on the stack.
-+ */
-+ if(opt_codec_ctx) {
-+ if(opt_codec_ctx->max_stack_size) {
-+ s_codec_ctx = *opt_codec_ctx;
-+ opt_codec_ctx = &s_codec_ctx;
-+ }
-+ } else {
-+ /* If context is not given, be security-conscious anyway */
-+ memset(&s_codec_ctx, 0, sizeof(s_codec_ctx));
-+ s_codec_ctx.max_stack_size = _ASN_DEFAULT_STACK_MAX;
-+ opt_codec_ctx = &s_codec_ctx;
-+ }
-+
-+ /* Fill in the position indicator */
-+ memset(&pd, 0, sizeof(pd));
-+ pd.buffer = (const uint8_t *)buffer;
-+ pd.nboff = skip_bits;
-+ pd.nbits = 8 * size - unused_bits; /* 8 is CHAR_BIT from */
-+ if(pd.nboff > pd.nbits)
-+ _ASN_DECODE_FAILED;
-+
-+ /*
-+ * Invoke type-specific decoder.
-+ */
-+ if(!td->aper_decoder)
-+ _ASN_DECODE_FAILED; /* PER is not compiled in */
-+ rval = td->aper_decoder(opt_codec_ctx, td, 0, sptr, &pd);
-+ if(rval.code == RC_OK) {
-+ /* Return the number of consumed bits */
-+ rval.consumed = ((pd.buffer - (const uint8_t *)buffer) << 3)
-+ + pd.nboff - skip_bits;
-+ ASN_DEBUG("PER decoding consumed %d, counted %d",
-+ rval.consumed, pd.moved);
-+ assert(rval.consumed == pd.moved);
-+ } else {
-+ /* PER codec is not a restartable */
-+ rval.consumed = 0;
-+ }
-+ return rval;
-+}
-Index: skeletons/constr_SET_OF.h
-===================================================================
---- skeletons/constr_SET_OF.h (revision 1516)
-+++ skeletons/constr_SET_OF.h (working copy)
-@@ -34,6 +34,8 @@
- xer_type_encoder_f SET_OF_encode_xer;
- per_type_decoder_f SET_OF_decode_uper;
- per_type_encoder_f SET_OF_encode_uper;
-+per_type_decoder_f SET_OF_decode_aper;
-+per_type_encoder_f SET_OF_encode_aper;
-
- #ifdef __cplusplus
- }
-Index: skeletons/NULL.h
-===================================================================
---- skeletons/NULL.h (revision 1516)
-+++ skeletons/NULL.h (working copy)
-@@ -25,6 +25,8 @@
- xer_type_encoder_f NULL_encode_xer;
- per_type_decoder_f NULL_decode_uper;
- per_type_encoder_f NULL_encode_uper;
-+per_type_decoder_f NULL_decode_aper;
-+per_type_encoder_f NULL_encode_aper;
-
- #ifdef __cplusplus
- }
-Index: skeletons/per_decoder.h
-===================================================================
---- skeletons/per_decoder.h (revision 1516)
-+++ skeletons/per_decoder.h (working copy)
-@@ -38,8 +38,30 @@
- int unused_bits /* Number of unused tailing bits, 0..7 */
- );
-
-+/*
-+ * Aligned PER decoder of a "complete encoding" as per X.691#10.1.
-+ * On success, this call always returns (.consumed >= 1), as per X.691#10.1.3.
-+ */
-+asn_dec_rval_t aper_decode_complete(struct asn_codec_ctx_s *opt_codec_ctx,
-+ struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */
-+ void **struct_ptr, /* Pointer to a target structure's pointer */
-+ const void *buffer, /* Data to be decoded */
-+ size_t size /* Size of data buffer */
-+ );
-
- /*
-+ * Aligned PER decoder of any ASN.1 type. May be invoked by the application.
-+ * WARNING: This call returns the number of BITS read from the stream. Beware.
-+ */
-+asn_dec_rval_t aper_decode(struct asn_codec_ctx_s *opt_codec_ctx,
-+ struct asn_TYPE_descriptor_s *type_descriptor, /* Type to decode */
-+ void **struct_ptr, /* Pointer to a target structure's pointer */
-+ const void *buffer, /* Data to be decoded */
-+ size_t size, /* Size of data buffer */
-+ int skip_bits, /* Number of unused leading bits, 0..7 */
-+ int unused_bits /* Number of unused tailing bits, 0..7 */
-+ );
-+/*
- * Type of the type-specific PER decoder function.
- */
- typedef asn_dec_rval_t (per_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx,
-Index: skeletons/per_support.c
-===================================================================
---- skeletons/per_support.c (revision 1516)
-+++ skeletons/per_support.c (working copy)
-@@ -31,6 +31,16 @@
- }
- }
-
-+int32_t
-+aper_get_align(asn_per_data_t *pd) {
-+
-+ if(pd->nboff & 0x7) {
-+ ASN_DEBUG("Aligning %d bits", 8 - (pd->nboff & 0x7));
-+ return per_get_few_bits(pd, 8 - (pd->nboff & 0x7));
-+ }
-+ return 0;
-+}
-+
- /*
- * Extract a small number of bits (<= 31) from the specified PER data pointer.
- */
-@@ -187,6 +197,36 @@
- return (16384 * value);
- }
-
-+ssize_t
-+aper_get_length(asn_per_data_t *pd, int range, int ebits, int *repeat) {
-+ ssize_t value;
-+
-+ *repeat = 0;
-+
-+ if (range <= 65536 && range >= 0)
-+ return aper_get_nsnnwn(pd, range);
-+
-+ if (aper_get_align(pd) < 0)
-+ return -1;
-+
-+ if(ebits >= 0) return per_get_few_bits(pd, ebits);
-+
-+ value = per_get_few_bits(pd, 8);
-+ if(value < 0) return -1;
-+ if((value & 128) == 0) /* #10.9.3.6 */
-+ return (value & 0x7F);
-+ if((value & 64) == 0) { /* #10.9.3.7 */
-+ value = ((value & 63) << 8) | per_get_few_bits(pd, 8);
-+ if(value < 0) return -1;
-+ return value;
-+ }
-+ value &= 63; /* this is "m" from X.691, #10.9.3.8 */
-+ if(value < 1 || value > 4)
-+ return -1;
-+ *repeat = 1;
-+ return (16384 * value);
-+}
-+
- /*
- * Get the normally small length "n".
- * This procedure used to decode length of extensions bit-maps
-@@ -211,6 +251,25 @@
- }
- }
-
-+ssize_t
-+aper_get_nslength(asn_per_data_t *pd) {
-+ ssize_t length;
-+
-+ ASN_DEBUG("Getting normally small length");
-+
-+ if(per_get_few_bits(pd, 1) == 0) {
-+ length = per_get_few_bits(pd, 6) + 1;
-+ if(length <= 0) return -1;
-+ ASN_DEBUG("l=%d", length);
-+ return length;
-+ } else {
-+ int repeat;
-+ length = aper_get_length(pd, -1, -1, &repeat);
-+ if(length >= 0 && !repeat) return length;
-+ return -1; /* Error, or do not support >16K extensions */
-+ }
-+}
-+
- /*
- * Get the normally small non-negative whole number.
- * X.691, #10.6
-@@ -237,6 +296,40 @@
- return value;
- }
-
-+ssize_t
-+aper_get_nsnnwn(asn_per_data_t *pd, int range) {
-+ ssize_t value;
-+ int bytes = 0;
-+
-+ ASN_DEBUG("getting nsnnwn with range %d", range);
-+
-+ if(range <= 255) {
-+ if (range < 0) return -1;
-+ /* 1 -> 8 bits */
-+ int i;
-+ for (i = 1; i <= 8; i++) {
-+ int upper = 1 << i;
-+ if (upper >= range)
-+ break;
-+ }
-+ value = per_get_few_bits(pd, i);
-+ return value;
-+ } else if (range == 256){
-+ /* 1 byte */
-+ bytes = 1;
-+ return -1;
-+ } else if (range <= 65536) {
-+ /* 2 bytes */
-+ bytes = 2;
-+ } else {
-+ return -1;
-+ }
-+ if (aper_get_align(pd) < 0)
-+ return -1;
-+ value = per_get_few_bits(pd, 8 * bytes);
-+ return value;
-+}
-+
- /*
- * Put the normally small non-negative whole number.
- * X.691, #10.6
-@@ -263,7 +356,59 @@
- return per_put_few_bits(po, n, 8 * bytes);
- }
-
-+int
-+aper_put_nsnnwn(asn_per_outp_t *po, int range, int number) {
-+ int bytes;
-
-+ /* 10.5.7.1 X.691 */
-+ if(range < 0) {
-+ int i;
-+ for (i = 1; ; i++) {
-+ int bits = 1 << (8 * i);
-+ if (number <= bits)
-+ break;
-+ }
-+ bytes = i;
-+ assert(i <= 4);
-+ }
-+ if(range <= 255) {
-+ int i;
-+ for (i = 1; i <= 8; i++) {
-+ int bits = 1 << i;
-+ if (range <= bits)
-+ break;
-+ }
-+ return per_put_few_bits(po, number, i);
-+ } else if(range == 256) {
-+ bytes = 1;
-+ } else if(range <= 65536) {
-+ bytes = 2;
-+ } else { /* Ranges > 64K */
-+ int i;
-+ for (i = 1; ; i++) {
-+ int bits = 1 << (8 * i);
-+ if (range <= bits)
-+ break;
-+ }
-+ assert(i <= 4);
-+ bytes = i;
-+ }
-+ if(aper_put_align(po) < 0) /* Aligning on octet */
-+ return -1;
-+
-+ return per_put_few_bits(po, number, 8 * bytes);
-+}
-+
-+int aper_put_align(asn_per_outp_t *po) {
-+
-+ if(po->nboff & 0x7) {
-+ ASN_DEBUG("Aligning %d bits", 8 - (po->nboff & 0x7));
-+ if(per_put_few_bits(po, 0x00, (8 - (po->nboff & 0x7))))
-+ return -1;
-+ }
-+ return 0;
-+}
-+
- /*
- * Put a small number of bits (<= 31).
- */
-@@ -392,6 +537,8 @@
- ssize_t
- uper_put_length(asn_per_outp_t *po, size_t length) {
-
-+ ASN_DEBUG("UPER put length %d", length);
-+
- if(length <= 127) /* #10.9.3.6 */
- return per_put_few_bits(po, length, 8)
- ? -1 : (ssize_t)length;
-@@ -406,7 +553,34 @@
- ? -1 : (ssize_t)(length << 14);
- }
-
-+ssize_t
-+aper_put_length(asn_per_outp_t *po, int range, size_t length) {
-
-+ ASN_DEBUG("APER put length %d with range %d", length, range);
-+
-+ /* 10.9 X.691 Note 2 */
-+ if (range <= 65536 && range >= 0)
-+ return aper_put_nsnnwn(po, range, length);
-+
-+ if (aper_put_align(po) < 0)
-+ return -1;
-+
-+ if(length <= 127) /* #10.9.3.6 */{
-+ return per_put_few_bits(po, length, 8)
-+ ? -1 : (ssize_t)length;
-+ }
-+ else if(length < 16384) /* #10.9.3.7 */
-+ return per_put_few_bits(po, length|0x8000, 16)
-+ ? -1 : (ssize_t)length;
-+
-+ length >>= 14;
-+ if(length > 4) length = 4;
-+
-+ return per_put_few_bits(po, 0xC0 | length, 8)
-+ ? -1 : (ssize_t)(length << 14);
-+}
-+
-+
- /*
- * Put the normally small length "n" into the stream.
- * This procedure used to encode length of extensions bit-maps
-@@ -429,3 +603,19 @@
- return 0;
- }
-
-+int
-+aper_put_nslength(asn_per_outp_t *po, size_t length) {
-+
-+ if(length <= 64) {
-+ /* #10.9.3.4 */
-+ if(length == 0) return -1;
-+ return per_put_few_bits(po, length-1, 7) ? -1 : 0;
-+ } else {
-+ if(aper_put_length(po, -1, length) != (ssize_t)length) {
-+ /* This might happen in case of >16K extensions */
-+ return -1;
-+ }
-+ }
-+
-+ return 0;
-+}
-Index: skeletons/constr_SET.c
-===================================================================
---- skeletons/constr_SET.c (revision 1516)
-+++ skeletons/constr_SET.c (working copy)
-@@ -36,7 +36,7 @@
- #undef ADVANCE
- #define ADVANCE(num_bytes) do { \
- size_t num = num_bytes; \
-- ptr = ((const void *)ptr) + num;\
-+ ptr = ((const char *)ptr) + num;\
- size -= num; \
- if(ctx->left >= 0) \
- ctx->left -= num; \
-@@ -132,7 +132,7 @@
- /*
- * Restore parsing context.
- */
-- ctx = (asn_struct_ctx_t *)((void *)st + specs->ctx_offset);
-+ ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
-
- /*
- * Start to parse where left previously
-@@ -250,7 +250,7 @@
-
- skip = ber_skip_length(opt_codec_ctx,
- BER_TLV_CONSTRUCTED(ptr),
-- (const void *)ptr + tag_len, LEFT - tag_len);
-+ (const char *)ptr + tag_len, LEFT - tag_len);
-
- switch(skip) {
- case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
-@@ -271,7 +271,7 @@
- * Check for duplications: must not overwrite
- * already decoded elements.
- */
-- if(ASN_SET_ISPRESENT2((void *)st + specs->pres_offset, edx)) {
-+ if(ASN_SET_ISPRESENT2((char *)st + specs->pres_offset, edx)) {
- ASN_DEBUG("SET %s: Duplicate element %s (%d)",
- td->name, elements[edx].name, edx);
- RETURN(RC_FAIL);
-@@ -284,13 +284,13 @@
- */
- if(elements[edx].flags & ATF_POINTER) {
- /* Member is a pointer to another structure */
-- memb_ptr2 = (void **)((void *)st + elements[edx].memb_offset);
-+ memb_ptr2 = (void **)((char *)st + elements[edx].memb_offset);
- } else {
- /*
- * A pointer to a pointer
- * holding the start of the structure
- */
-- memb_ptr = (void *)st + elements[edx].memb_offset;
-+ memb_ptr = (char *)st + elements[edx].memb_offset;
- memb_ptr2 = &memb_ptr;
- }
- /*
-@@ -302,7 +302,7 @@
- elements[edx].tag_mode);
- switch(rval.code) {
- case RC_OK:
-- ASN_SET_MKPRESENT((void *)st + specs->pres_offset, edx);
-+ ASN_SET_MKPRESENT((char *)st + specs->pres_offset, edx);
- break;
- case RC_WMORE: /* More data expected */
- if(!SIZE_VIOLATION) {
-@@ -369,7 +369,7 @@
-
- ll = ber_skip_length(opt_codec_ctx,
- BER_TLV_CONSTRUCTED(ptr),
-- (const void *)ptr + tl, LEFT - tl);
-+ (const char *)ptr + tl, LEFT - tl);
- switch(ll) {
- case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
- /* Fall through */
-@@ -404,7 +404,7 @@
- unsigned int midx, pres, must;
-
- midx = edx/(8 * sizeof(specs->_mandatory_elements[0]));
-- pres = ((unsigned int *)((void *)st+specs->pres_offset))[midx];
-+ pres = ((unsigned int *)((char *)st+specs->pres_offset))[midx];
- must = sys_ntohl(specs->_mandatory_elements[midx]);
-
- if((pres & must) == must) {
-@@ -473,7 +473,7 @@
- * Compute the length of the encoding of this member.
- */
- if(elm->flags & ATF_POINTER) {
-- memb_ptr = *(void **)((void *)sptr + elm->memb_offset);
-+ memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
- if(!memb_ptr) {
- if(!elm->optional)
- /* Mandatory elements missing */
-@@ -486,7 +486,7 @@
- continue;
- }
- } else {
-- memb_ptr = (void *)((void *)sptr + elm->memb_offset);
-+ memb_ptr = (void *)((char *)sptr + elm->memb_offset);
- }
- tmper = elm->type->der_encoder(elm->type, memb_ptr,
- elm->tag_mode, elm->tag,
-@@ -547,10 +547,10 @@
- elm = &td->elements[t2m[edx].el_no];
-
- if(elm->flags & ATF_POINTER) {
-- memb_ptr = *(void **)((void *)sptr + elm->memb_offset);
-+ memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
- if(!memb_ptr) continue;
- } else {
-- memb_ptr = (void *)((void *)sptr + elm->memb_offset);
-+ memb_ptr = (void *)((char *)sptr + elm->memb_offset);
- }
- tmper = elm->type->der_encoder(elm->type, memb_ptr,
- elm->tag_mode, elm->tag,
-@@ -570,10 +570,185 @@
- _ASN_ENCODED_OK(er);
- }
-
-+asn_enc_rval_t
-+SET_encode_uper(asn_TYPE_descriptor_t *td,
-+ asn_per_constraints_t *constraints,
-+ void *sptr,
-+ asn_per_outp_t *po) {
-+}
-+
-+asn_dec_rval_t
-+SET_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
-+ asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
-+}
-+
-+asn_enc_rval_t
-+SET_encode_aper(asn_TYPE_descriptor_t *td,
-+ asn_per_constraints_t *constraints,
-+ void *sptr,
-+ asn_per_outp_t *po) {
-+ asn_SET_specifics_t *specs = (asn_SET_specifics_t *)td->specifics;
-+ asn_enc_rval_t er;
-+ int edx, i;
-+ int t2m_build_own = (specs->tag2el_count != td->elements_count);
-+ asn_TYPE_tag2member_t *t2m;
-+ int t2m_count;
-+
-+ (void)constraints;
-+
-+ if(!sptr)
-+ _ASN_ENCODE_FAILED;
-+
-+ er.encoded = 0;
-+
-+ ASN_DEBUG("Encoding %s as SET (APER) map %d", td->name, specs->_mandatory_elements[0]);
-+
-+ /*
-+ * Use existing, or build our own tags map.
-+ */
-+ if(t2m_build_own) {
-+ t2m = (asn_TYPE_tag2member_t *)alloca(
-+ td->elements_count * sizeof(t2m[0]));
-+ if(!t2m) _ASN_ENCODE_FAILED; /* There are such platforms */
-+ t2m_count = 0;
-+ } else {
-+ /*
-+ * There is no untagged CHOICE in this SET.
-+ * Employ existing table.
-+ */
-+ t2m = specs->tag2el;
-+ t2m_count = specs->tag2el_count;
-+ }
-+
-+ /*
-+ * Gather the length of the underlying members sequence.
-+ */
-+ for(edx = 0; edx < td->elements_count; edx++) {
-+ asn_TYPE_member_t *elm = &td->elements[edx];
-+ asn_enc_rval_t tmper;
-+ void *memb_ptr;
-+
-+ /*
-+ * Compute the length of the encoding of this member.
-+ */
-+ if(elm->flags & ATF_POINTER) {
-+ memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
-+ if(!memb_ptr) {
-+ if(!elm->optional)
-+ /* Mandatory elements missing */
-+ _ASN_ENCODE_FAILED;
-+ if(t2m_build_own) {
-+ t2m[t2m_count].el_no = edx;
-+ t2m[t2m_count].el_tag = 0;
-+ t2m_count++;
-+ }
-+ continue;
-+ }
-+ } else {
-+ memb_ptr = (void *)((char *)sptr + elm->memb_offset);
-+ }
-+
-+ /*
-+ * Remember the outmost tag of this member.
-+ */
-+ if(t2m_build_own) {
-+ t2m[t2m_count].el_no = edx;
-+ t2m[t2m_count].el_tag = asn_TYPE_outmost_tag(
-+ elm->type, memb_ptr, elm->tag_mode, elm->tag);
-+ t2m_count++;
-+ } else {
-+ /*
-+ * No dynamic sorting is necessary.
-+ */
-+ }
-+ }
-+
-+ /*
-+ * Finalize order of the components.
-+ */
-+ assert(t2m_count == td->elements_count);
-+ if(t2m_build_own) {
-+ /*
-+ * Sort the underlying members according to their
-+ * canonical tags order. DER encoding mandates it.
-+ */
-+ qsort(t2m, t2m_count, sizeof(specs->tag2el[0]), _t2e_cmp);
-+ } else {
-+ /*
-+ * Tags are already sorted by the compiler.
-+ */
-+ }
-+
-+ for(edx = 0; edx < td->elements_count; edx++) {
-+ asn_TYPE_member_t *elm = &td->elements[t2m[edx].el_no];
-+ asn_enc_rval_t tmper;
-+ void *memb_ptr; /* Pointer to the member */
-+ void **memb_ptr2; /* Pointer to that pointer */
-+ int present;
-+
-+ /* Fetch the pointer to this member */
-+ if(elm->flags & ATF_POINTER) {
-+ memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
-+ present = (*memb_ptr2 != 0);
-+ } else {
-+// memb_ptr = (void *)((char *)sptr + elm->memb_offset);
-+// memb_ptr2 = &memb_ptr;
-+ present = 1;
-+ continue;
-+ }
-+
-+// /* Eliminate default values */
-+// if(present && elm->default_value
-+// && elm->default_value(0, memb_ptr2) == 1)
-+// present = 0;
-+
-+ ASN_DEBUG("Element %s %s %s->%s is %s",
-+ elm->flags & ATF_POINTER ? "ptr" : "inline",
-+ elm->default_value ? "def" : "wtv",
-+ td->name, elm->name, present ? "present" : "absent");
-+ if(per_put_few_bits(po, present << 7, 8))
-+ _ASN_ENCODE_FAILED;
-+ }
-+
-+ /*
-+ * Encode all members.
-+ */
-+ for(edx = 0; edx < td->elements_count; edx++) {
-+ asn_TYPE_member_t *elm = &td->elements[edx];
-+ asn_enc_rval_t tmper;
-+ void *memb_ptr; /* Pointer to the member */
-+ void **memb_ptr2; /* Pointer to that pointer */
-+
-+ /* Encode according to the tag order */
-+// elm = &td->elements[t2m[edx].el_no];
-+
-+ if(elm->flags & ATF_POINTER) {
-+ memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
-+ if(!*memb_ptr2) {
-+ ASN_DEBUG("Element %s %d not present",
-+ elm->name, edx);
-+ if(elm->optional)
-+ continue;
-+ /* Mandatory element is missing */
-+ _ASN_ENCODE_FAILED;
-+ }
-+ } else {
-+ memb_ptr = (void *)((char *)sptr + elm->memb_offset);
-+ memb_ptr2 = &memb_ptr;
-+ }
-+ tmper = elm->type->aper_encoder(elm->type, elm->per_constraints,
-+ *memb_ptr2, po);
-+ if(tmper.encoded == -1)
-+ return tmper;
-+ }
-+
-+ _ASN_ENCODED_OK(er);
-+}
-+
- #undef XER_ADVANCE
- #define XER_ADVANCE(num_bytes) do { \
- size_t num = num_bytes; \
-- buf_ptr = ((const void *)buf_ptr) + num;\
-+ buf_ptr = ((const char *)buf_ptr) + num;\
- size -= num; \
- consumed_myself += num; \
- } while(0)
-@@ -613,7 +788,7 @@
- /*
- * Restore parsing context.
- */
-- ctx = (asn_struct_ctx_t *)((void *)st + specs->ctx_offset);
-+ ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
-
- /*
- * Phases of XER/XML processing:
-@@ -637,7 +812,7 @@
- void *memb_ptr; /* Pointer to the member */
- void **memb_ptr2; /* Pointer to that pointer */
-
-- if(ASN_SET_ISPRESENT2((void *)st + specs->pres_offset,
-+ if(ASN_SET_ISPRESENT2((char *)st + specs->pres_offset,
- edx)) {
- ASN_DEBUG("SET %s: Duplicate element %s (%d)",
- td->name, elements[edx].name, edx);
-@@ -648,10 +823,10 @@
-
- if(elm->flags & ATF_POINTER) {
- /* Member is a pointer to another structure */
-- memb_ptr2 = (void **)((void *)st
-+ memb_ptr2 = (void **)((char *)st
- + elm->memb_offset);
- } else {
-- memb_ptr = (void *)st + elm->memb_offset;
-+ memb_ptr = (char *)st + elm->memb_offset;
- memb_ptr2 = &memb_ptr;
- }
-
-@@ -663,7 +838,7 @@
- if(tmprval.code != RC_OK)
- RETURN(tmprval.code);
- ctx->phase = 1; /* Back to body processing */
-- ASN_SET_MKPRESENT((void *)st + specs->pres_offset, edx);
-+ ASN_SET_MKPRESENT((char *)st + specs->pres_offset, edx);
- ASN_DEBUG("XER/SET phase => %d", ctx->phase);
- /* Fall through */
- }
-@@ -827,7 +1002,7 @@
- mlen = strlen(elm->name);
-
- if(elm->flags & ATF_POINTER) {
-- memb_ptr = *(void **)((void *)sptr + elm->memb_offset);
-+ memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
- if(!memb_ptr) {
- if(elm->optional)
- continue;
-@@ -835,7 +1010,7 @@
- _ASN_ENCODE_FAILED;
- }
- } else {
-- memb_ptr = (void *)((void *)sptr + elm->memb_offset);
-+ memb_ptr = (void *)((char *)sptr + elm->memb_offset);
- }
-
- if(!xcan)
-@@ -877,14 +1052,14 @@
- const void *memb_ptr;
-
- if(elm->flags & ATF_POINTER) {
-- memb_ptr = *(const void * const *)((const void *)sptr + elm->memb_offset);
-+ memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset);
- if(!memb_ptr) {
- if(elm->optional) continue;
- /* Print line */
- /* Fall through */
- }
- } else {
-- memb_ptr = (const void *)((const void *)sptr + elm->memb_offset);
-+ memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
- }
-
- _i_INDENT(1);
-@@ -919,11 +1094,11 @@
- asn_TYPE_member_t *elm = &td->elements[edx];
- void *memb_ptr;
- if(elm->flags & ATF_POINTER) {
-- memb_ptr = *(void **)((void *)ptr + elm->memb_offset);
-+ memb_ptr = *(void **)((char *)ptr + elm->memb_offset);
- if(memb_ptr)
- ASN_STRUCT_FREE(*elm->type, memb_ptr);
- } else {
-- memb_ptr = (void *)((void *)ptr + elm->memb_offset);
-+ memb_ptr = (void *)((char *)ptr + elm->memb_offset);
- ASN_STRUCT_FREE_CONTENTS_ONLY(*elm->type, memb_ptr);
- }
- }
-@@ -953,7 +1128,7 @@
- const void *memb_ptr;
-
- if(elm->flags & ATF_POINTER) {
-- memb_ptr = *(const void * const *)((const void *)sptr + elm->memb_offset);
-+ memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset);
- if(!memb_ptr) {
- if(elm->optional)
- continue;
-@@ -963,7 +1138,7 @@
- return -1;
- }
- } else {
-- memb_ptr = (const void *)((const void *)sptr + elm->memb_offset);
-+ memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
- }
-
- if(elm->memb_constraints) {
-Index: skeletons/constr_SEQUENCE_OF.c
-===================================================================
---- skeletons/constr_SEQUENCE_OF.c (revision 1516)
-+++ skeletons/constr_SEQUENCE_OF.c (working copy)
-@@ -164,7 +164,7 @@
- if(ct) {
- int not_in_root = (list->count < ct->lower_bound
- || list->count > ct->upper_bound);
-- ASN_DEBUG("lb %ld ub %ld %s",
-+ ASN_DEBUG("lb %"PRIdMAX" ub %"PRIdMAX" %s",
- ct->lower_bound, ct->upper_bound,
- ct->flags & APC_EXTENSIBLE ? "ext" : "fix");
- if(ct->flags & APC_EXTENSIBLE) {
-@@ -206,3 +206,70 @@
- _ASN_ENCODED_OK(er);
- }
-
-+asn_enc_rval_t
-+SEQUENCE_OF_encode_aper(asn_TYPE_descriptor_t *td,
-+ asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-+ asn_anonymous_sequence_ *list;
-+ asn_per_constraint_t *ct;
-+ asn_enc_rval_t er;
-+ asn_TYPE_member_t *elm = td->elements;
-+ int seq;
-+
-+ if(!sptr) _ASN_ENCODE_FAILED;
-+ list = _A_SEQUENCE_FROM_VOID(sptr);
-+
-+ er.encoded = 0;
-+
-+ ASN_DEBUG("Encoding %s as SEQUENCE OF size (%d) using ALIGNED PER", td->name, list->count);
-+
-+ if(constraints) ct = &constraints->size;
-+ else if(td->per_constraints) ct = &td->per_constraints->size;
-+ else ct = 0;
-+
-+ /* If extensible constraint, check if size is in root */
-+ if(ct) {
-+ int not_in_root = (list->count < ct->lower_bound
-+ || list->count > ct->upper_bound);
-+ ASN_DEBUG("lb %"PRIdMAX" ub %"PRIdMAX" %s",
-+ ct->lower_bound, ct->upper_bound,
-+ ct->flags & APC_EXTENSIBLE ? "ext" : "fix");
-+ if(ct->flags & APC_EXTENSIBLE) {
-+ /* Declare whether size is in extension root */
-+ if(per_put_few_bits(po, not_in_root, 1))
-+ _ASN_ENCODE_FAILED;
-+ if(not_in_root) ct = 0;
-+ } else if(not_in_root && ct->effective_bits >= 0)
-+ _ASN_ENCODE_FAILED;
-+ }
-+
-+ if(ct && ct->effective_bits >= 0) {
-+ /* X.691, #19.5: No length determinant */
-+// if(per_put_few_bits(po, list->count - ct->lower_bound,
-+// ct->effective_bits))
-+// _ASN_ENCODE_FAILED;
-+ if (aper_put_length(po, ct->upper_bound - ct->lower_bound + 1, list->count - ct->lower_bound) < 0)
-+ _ASN_ENCODE_FAILED;
-+ }
-+
-+ for(seq = -1; seq < list->count;) {
-+ ssize_t mayEncode;
-+ if(seq < 0) seq = 0;
-+ if(ct && ct->effective_bits >= 0) {
-+ mayEncode = list->count;
-+ } else {
-+ mayEncode = aper_put_length(po, -1, list->count - seq);
-+ if(mayEncode < 0) _ASN_ENCODE_FAILED;
-+ }
-+
-+ while(mayEncode--) {
-+ void *memb_ptr = list->array[seq++];
-+ if(!memb_ptr) _ASN_ENCODE_FAILED;
-+ er = elm->type->aper_encoder(elm->type,
-+ elm->per_constraints, memb_ptr, po);
-+ if(er.encoded == -1)
-+ _ASN_ENCODE_FAILED;
-+ }
-+ }
-+
-+ _ASN_ENCODED_OK(er);
-+}
-Index: skeletons/per_support.h
-===================================================================
---- skeletons/per_support.h (revision 1516)
-+++ skeletons/per_support.h (working copy)
-@@ -24,8 +24,8 @@
- } flags;
- int range_bits; /* Full number of bits in the range */
- int effective_bits; /* Effective bits */
-- long lower_bound; /* "lb" value */
-- long upper_bound; /* "ub" value */
-+ int64_t lower_bound; /* "lb" value */
-+ int64_t upper_bound; /* "ub" value */
- } asn_per_constraint_t;
- typedef struct asn_per_constraints_s {
- asn_per_constraint_t value;
-@@ -39,9 +39,9 @@
- */
- typedef struct asn_per_data_s {
- const uint8_t *buffer; /* Pointer to the octet stream */
-- size_t nboff; /* Bit offset to the meaningful bit */
-- size_t nbits; /* Number of bits in the stream */
-- size_t moved; /* Number of bits moved through this bit stream */
-+ size_t nboff; /* Bit offset to the meaningful bit */
-+ size_t nbits; /* Number of bits in the stream */
-+ size_t moved; /* Number of bits moved through this bit stream */
- int (*refill)(struct asn_per_data_s *);
- void *refill_key;
- } asn_per_data_t;
-@@ -71,15 +71,22 @@
- int effective_bound_bits,
- int *repeat);
-
-+ssize_t aper_get_length(asn_per_data_t *pd,
-+ int range,
-+ int effective_bound_bits,
-+ int *repeat);
-+
- /*
- * Get the normally small length "n".
- */
- ssize_t uper_get_nslength(asn_per_data_t *pd);
-+ssize_t aper_get_nslength(asn_per_data_t *pd);
-
- /*
- * Get the normally small non-negative whole number.
- */
- ssize_t uper_get_nsnnwn(asn_per_data_t *pd);
-+ssize_t aper_get_nsnnwn(asn_per_data_t *pd, int range);
-
- /* Non-thread-safe debugging function, don't use it */
- char *per_data_string(asn_per_data_t *pd);
-@@ -103,6 +110,10 @@
- /* Output a large number of bits */
- int per_put_many_bits(asn_per_outp_t *po, const uint8_t *src, int put_nbits);
-
-+/* Align the current bit position to octet bundary */
-+int aper_put_align(asn_per_outp_t *po);
-+int32_t aper_get_align(asn_per_data_t *pd);
-+
- /*
- * Put the length "n" to the Unaligned PER stream.
- * This function returns the number of units which may be flushed
-@@ -110,17 +121,23 @@
- */
- ssize_t uper_put_length(asn_per_outp_t *po, size_t whole_length);
-
-+ssize_t aper_put_length(asn_per_outp_t *po, int range, size_t length);
-+
- /*
- * Put the normally small length "n" to the Unaligned PER stream.
- * Returns 0 or -1.
- */
- int uper_put_nslength(asn_per_outp_t *po, size_t length);
-
-+int aper_put_nslength(asn_per_outp_t *po, size_t length);
-+
- /*
- * Put the normally small non-negative whole number.
- */
- int uper_put_nsnnwn(asn_per_outp_t *po, int n);
-
-+int aper_put_nsnnwn(asn_per_outp_t *po, int range, int number);
-+
- #ifdef __cplusplus
- }
- #endif
-Index: skeletons/constr_SET.h
-===================================================================
---- skeletons/constr_SET.h (revision 1516)
-+++ skeletons/constr_SET.h (working copy)
-@@ -53,7 +53,9 @@
- xer_type_decoder_f SET_decode_xer;
- xer_type_encoder_f SET_encode_xer;
- per_type_decoder_f SET_decode_uper;
-+per_type_decoder_f SET_decode_aper;
- per_type_encoder_f SET_encode_uper;
-+per_type_encoder_f SET_encode_aper;
-
- /***********************
- * Some handy helpers. *
-Index: skeletons/constr_SEQUENCE_OF.h
-===================================================================
---- skeletons/constr_SEQUENCE_OF.h (revision 1516)
-+++ skeletons/constr_SEQUENCE_OF.h (working copy)
-@@ -22,9 +22,11 @@
- #define SEQUENCE_OF_decode_ber SET_OF_decode_ber
- #define SEQUENCE_OF_decode_xer SET_OF_decode_xer
- #define SEQUENCE_OF_decode_uper SET_OF_decode_uper
-+#define SEQUENCE_OF_decode_aper SET_OF_decode_aper
- der_type_encoder_f SEQUENCE_OF_encode_der;
- xer_type_encoder_f SEQUENCE_OF_encode_xer;
- per_type_encoder_f SEQUENCE_OF_encode_uper;
-+per_type_encoder_f SEQUENCE_OF_encode_aper;
-
- #ifdef __cplusplus
- }
-Index: skeletons/ENUMERATED.c
-===================================================================
---- skeletons/ENUMERATED.c (revision 1516)
-+++ skeletons/ENUMERATED.c (working copy)
-@@ -26,6 +26,8 @@
- INTEGER_encode_xer,
- ENUMERATED_decode_uper, /* Unaligned PER decoder */
- ENUMERATED_encode_uper, /* Unaligned PER encoder */
-+ ENUMERATED_decode_aper, /* Aligned PER decoder */
-+ ENUMERATED_encode_aper, /* Aligned PER encoder */
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_ENUMERATED_tags,
- sizeof(asn_DEF_ENUMERATED_tags) / sizeof(asn_DEF_ENUMERATED_tags[0]),
-@@ -57,6 +59,27 @@
- return rval;
- }
-
-+asn_dec_rval_t
-+ENUMERATED_decode_aper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
-+ asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
-+ asn_dec_rval_t rval;
-+ ENUMERATED_t *st = (ENUMERATED_t *)*sptr;
-+ long value;
-+ void *vptr = &value;
-+
-+ if(!st) {
-+ st = (ENUMERATED_t *)(*sptr = CALLOC(1, sizeof(*st)));
-+ if(!st) _ASN_DECODE_FAILED;
-+ }
-+
-+ rval = NativeEnumerated_decode_aper(opt_codec_ctx, td, constraints,
-+ (void **)&vptr, pd);
-+ if(rval.code == RC_OK)
-+ if(asn_long2INTEGER(st, value))
-+ rval.code = RC_FAIL;
-+ return rval;
-+}
-+
- asn_enc_rval_t
- ENUMERATED_encode_uper(asn_TYPE_descriptor_t *td,
- asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-@@ -69,3 +92,14 @@
- return NativeEnumerated_encode_uper(td, constraints, &value, po);
- }
-
-+asn_enc_rval_t
-+ENUMERATED_encode_aper(asn_TYPE_descriptor_t *td,
-+ asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-+ ENUMERATED_t *st = (ENUMERATED_t *)sptr;
-+ long value;
-+
-+ if(asn_INTEGER2long(st, &value))
-+ _ASN_ENCODE_FAILED;
-+
-+ return NativeEnumerated_encode_aper(td, constraints, &value, po);
-+}
-Index: skeletons/ENUMERATED.h
-===================================================================
---- skeletons/ENUMERATED.h (revision 1516)
-+++ skeletons/ENUMERATED.h (working copy)
-@@ -17,6 +17,8 @@
-
- per_type_decoder_f ENUMERATED_decode_uper;
- per_type_encoder_f ENUMERATED_encode_uper;
-+per_type_decoder_f ENUMERATED_decode_aper;
-+per_type_encoder_f ENUMERATED_encode_aper;
-
- #ifdef __cplusplus
- }
-Index: skeletons/NativeEnumerated.c
-===================================================================
---- skeletons/NativeEnumerated.c (revision 1516)
-+++ skeletons/NativeEnumerated.c (working copy)
-@@ -30,6 +30,8 @@
- NativeEnumerated_encode_xer,
- NativeEnumerated_decode_uper,
- NativeEnumerated_encode_uper,
-+ NativeEnumerated_decode_aper,
-+ NativeEnumerated_encode_aper,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_NativeEnumerated_tags,
- sizeof(asn_DEF_NativeEnumerated_tags) / sizeof(asn_DEF_NativeEnumerated_tags[0]),
-@@ -42,17 +44,17 @@
-
- asn_enc_rval_t
- NativeEnumerated_encode_xer(asn_TYPE_descriptor_t *td, void *sptr,
-- int ilevel, enum xer_encoder_flags_e flags,
-- asn_app_consume_bytes_f *cb, void *app_key) {
-+ int ilevel, enum xer_encoder_flags_e flags,
-+ asn_app_consume_bytes_f *cb, void *app_key) {
- asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics;
-- asn_enc_rval_t er;
-- const long *native = (const long *)sptr;
-+ asn_enc_rval_t er;
-+ const long *native = (const long *)sptr;
- const asn_INTEGER_enum_map_t *el;
-
-- (void)ilevel;
-- (void)flags;
-+ (void)ilevel;
-+ (void)flags;
-
-- if(!native) _ASN_ENCODE_FAILED;
-+ if(!native) _ASN_ENCODE_FAILED;
-
- el = INTEGER_map_value2enum(specs, *native);
- if(el) {
-@@ -125,6 +127,66 @@
- return rval;
- }
-
-+asn_dec_rval_t
-+NativeEnumerated_decode_aper(asn_codec_ctx_t *opt_codec_ctx,
-+ asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints,
-+ void **sptr, asn_per_data_t *pd) {
-+ asn_INTEGER_specifics_t *specs = (asn_INTEGER_specifics_t *)td->specifics;
-+ asn_dec_rval_t rval = { RC_OK, 0 };
-+ long *native = (long *)*sptr;
-+ asn_per_constraint_t *ct;
-+ long value;
-+ int freeme = 0;
-+
-+ (void)opt_codec_ctx;
-+
-+ if(constraints) ct = &constraints->value;
-+ else if(td->per_constraints) ct = &td->per_constraints->value;
-+ else _ASN_DECODE_FAILED; /* Mandatory! */
-+ if(!specs) _ASN_DECODE_FAILED;
-+
-+ if(!native) {
-+ native = (long *)(*sptr = CALLOC(1, sizeof(*native)));
-+ freeme = 1;
-+ if(!native) _ASN_DECODE_FAILED;
-+ }
-+
-+ ASN_DEBUG("Decoding %s as NativeEnumerated", td->name);
-+
-+ if(ct->flags & APC_EXTENSIBLE) {
-+ int inext = per_get_few_bits(pd, 1);
-+ if(inext < 0) _ASN_DECODE_STARVED;
-+ if(inext) ct = 0;
-+ }
-+
-+ if(ct && ct->range_bits >= 0) {
-+ value = per_get_few_bits(pd, ct->range_bits);
-+ if(value < 0) _ASN_DECODE_STARVED;
-+ if(value >= (specs->extension
-+ ? specs->extension - 1 : specs->map_count))
-+ _ASN_DECODE_FAILED;
-+ } else {
-+ if(!specs->extension)
-+ _ASN_DECODE_FAILED;
-+ /*
-+ * X.691, #10.6: normally small non-negative whole number;
-+ */
-+ value = uper_get_nsnnwn(pd);
-+ if(value < 0) _ASN_DECODE_STARVED;
-+ value += specs->extension - 1;
-+ if(value >= specs->map_count)
-+ _ASN_DECODE_FAILED;
-+ }
-+
-+ *native = specs->value2enum[value].nat_value;
-+ ASN_DEBUG("Decoded %s = %ld", td->name, *native);
-+
-+ if (freeme)
-+ free(native);
-+
-+ return rval;
-+}
-+
- static int
- NativeEnumerated__compar_value2enum(const void *ap, const void *bp) {
- const asn_INTEGER_enum_map_t *a = ap;
-@@ -205,3 +267,71 @@
- _ASN_ENCODED_OK(er);
- }
-
-+asn_enc_rval_t
-+NativeEnumerated_encode_aper(asn_TYPE_descriptor_t *td,
-+ asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-+ asn_INTEGER_specifics_t *specs = (asn_INTEGER_specifics_t *)td->specifics;
-+ asn_enc_rval_t er;
-+ long native, value;
-+ asn_per_constraint_t *ct;
-+ int inext = 0;
-+ asn_INTEGER_enum_map_t key;
-+ asn_INTEGER_enum_map_t *kf;
-+
-+ if(!sptr) _ASN_ENCODE_FAILED;
-+ if(!specs) _ASN_ENCODE_FAILED;
-+
-+ if(constraints) ct = &constraints->value;
-+ else if(td->per_constraints) ct = &td->per_constraints->value;
-+ else _ASN_ENCODE_FAILED; /* Mandatory! */
-+
-+ ASN_DEBUG("Encoding %s as NativeEnumerated", td->name);
-+
-+ er.encoded = 0;
-+
-+ native = *(long *)sptr;
-+ if(native < 0) _ASN_ENCODE_FAILED;
-+
-+ key.nat_value = native;
-+ kf = bsearch(&key, specs->value2enum, specs->map_count,
-+ sizeof(key), NativeEnumerated__compar_value2enum);
-+ if(!kf) {
-+ ASN_DEBUG("No element corresponds to %ld", native);
-+ _ASN_ENCODE_FAILED;
-+ }
-+ value = kf - specs->value2enum;
-+
-+ if(ct->range_bits >= 0) {
-+ int cmpWith = specs->extension
-+ ? specs->extension - 1 : specs->map_count;
-+ if(value >= cmpWith)
-+ inext = 1;
-+ }
-+ if(ct->flags & APC_EXTENSIBLE) {
-+ if(per_put_few_bits(po, inext, 1))
-+ _ASN_ENCODE_FAILED;
-+ if(inext) ct = 0;
-+ } else if(inext) {
-+ _ASN_ENCODE_FAILED;
-+ }
-+
-+ if(ct && ct->range_bits >= 0) {
-+ if(per_put_few_bits(po, value, ct->range_bits))
-+ _ASN_ENCODE_FAILED;
-+ _ASN_ENCODED_OK(er);
-+ }
-+
-+ if(!specs->extension)
-+ _ASN_ENCODE_FAILED;
-+
-+ /*
-+ * X.691, #10.6: normally small non-negative whole number;
-+ */
-+ ASN_DEBUG("value = %ld, ext = %d, inext = %d, res = %ld",
-+ value, specs->extension, inext,
-+ value - (inext ? (specs->extension - 1) : 0));
-+ if(uper_put_nsnnwn(po, value - (inext ? (specs->extension - 1) : 0)))
-+ _ASN_ENCODE_FAILED;
-+
-+ _ASN_ENCODED_OK(er);
-+}
-Index: skeletons/GeneralString.c
-===================================================================
---- skeletons/GeneralString.c (revision 1516)
-+++ skeletons/GeneralString.c (working copy)
-@@ -24,6 +24,8 @@
- OCTET_STRING_encode_xer,
- OCTET_STRING_decode_uper, /* Implemented in terms of OCTET STRING */
- OCTET_STRING_encode_uper,
-+ OCTET_STRING_decode_aper,
-+ OCTET_STRING_encode_aper,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_GeneralString_tags,
- sizeof(asn_DEF_GeneralString_tags)
-Index: skeletons/IA5String.c
-===================================================================
---- skeletons/IA5String.c (revision 1516)
-+++ skeletons/IA5String.c (working copy)
-@@ -29,6 +29,8 @@
- OCTET_STRING_encode_xer_utf8,
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
-+ OCTET_STRING_decode_aper,
-+ OCTET_STRING_encode_aper,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_IA5String_tags,
- sizeof(asn_DEF_IA5String_tags)
-Index: skeletons/NativeEnumerated.h
-===================================================================
---- skeletons/NativeEnumerated.h (revision 1516)
-+++ skeletons/NativeEnumerated.h (working copy)
-@@ -24,6 +24,8 @@
- xer_type_encoder_f NativeEnumerated_encode_xer;
- per_type_decoder_f NativeEnumerated_decode_uper;
- per_type_encoder_f NativeEnumerated_encode_uper;
-+per_type_decoder_f NativeEnumerated_decode_aper;
-+per_type_encoder_f NativeEnumerated_encode_aper;
-
- #ifdef __cplusplus
- }
-Index: skeletons/OBJECT_IDENTIFIER.c
-===================================================================
---- skeletons/OBJECT_IDENTIFIER.c (revision 1516)
-+++ skeletons/OBJECT_IDENTIFIER.c (working copy)
-@@ -27,6 +27,8 @@
- OBJECT_IDENTIFIER_encode_xer,
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
-+ OCTET_STRING_decode_aper,
-+ OCTET_STRING_encode_aper,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_OBJECT_IDENTIFIER_tags,
- sizeof(asn_DEF_OBJECT_IDENTIFIER_tags)
-Index: skeletons/per_opentype.c
-===================================================================
---- skeletons/per_opentype.c (revision 1516)
-+++ skeletons/per_opentype.c (working copy)
-@@ -53,6 +53,35 @@
- return 0;
- }
-
-+int
-+aper_open_type_put(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-+ void *buf;
-+ void *bptr;
-+ ssize_t size;
-+ size_t toGo;
-+
-+ ASN_DEBUG("Open type put %s ...", td->name);
-+
-+ size = aper_encode_to_new_buffer(td, constraints, sptr, &buf);
-+ if(size <= 0) return -1;
-+
-+ for(bptr = buf, toGo = size; toGo;) {
-+ ssize_t maySave = aper_put_length(po, -1, toGo);
-+ if(maySave < 0) break;
-+ if(per_put_many_bits(po, bptr, maySave * 8)) break;
-+ bptr = (char *)bptr + maySave;
-+ toGo -= maySave;
-+ }
-+
-+ FREEMEM(buf);
-+ if(toGo) return -1;
-+
-+ ASN_DEBUG("Open type put %s of length %ld + overhead (1byte?)",
-+ td->name, (long)size);
-+
-+ return 0;
-+}
-+
- static asn_dec_rval_t
- uper_open_type_get_simple(asn_codec_ctx_t *ctx, asn_TYPE_descriptor_t *td,
- asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
-Index: skeletons/VideotexString.c
-===================================================================
---- skeletons/VideotexString.c (revision 1516)
-+++ skeletons/VideotexString.c (working copy)
-@@ -24,6 +24,8 @@
- OCTET_STRING_encode_xer,
- OCTET_STRING_decode_uper, /* Implemented in terms of OCTET STRING */
- OCTET_STRING_encode_uper,
-+ OCTET_STRING_decode_aper,
-+ OCTET_STRING_encode_aper,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_VideotexString_tags,
- sizeof(asn_DEF_VideotexString_tags)
-Index: skeletons/per_opentype.h
-===================================================================
---- skeletons/per_opentype.h (revision 1516)
-+++ skeletons/per_opentype.h (working copy)
-@@ -15,6 +15,8 @@
-
- int uper_open_type_put(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po);
-
-+int aper_open_type_put(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po);
-+
- #ifdef __cplusplus
- }
- #endif
-Index: skeletons/BOOLEAN.c
-===================================================================
---- skeletons/BOOLEAN.c (revision 1516)
-+++ skeletons/BOOLEAN.c (working copy)
-@@ -24,6 +24,8 @@
- BOOLEAN_encode_xer,
- BOOLEAN_decode_uper, /* Unaligned PER decoder */
- BOOLEAN_encode_uper, /* Unaligned PER encoder */
-+ BOOLEAN_decode_aper, /* Aligned PER decoder */
-+ BOOLEAN_encode_aper, /* Aligned PER encoder */
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_BOOLEAN_tags,
- sizeof(asn_DEF_BOOLEAN_tags) / sizeof(asn_DEF_BOOLEAN_tags[0]),
-@@ -264,7 +266,36 @@
- return rv;
- }
-
-+asn_dec_rval_t
-+BOOLEAN_decode_aper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
-+ asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
-+ asn_dec_rval_t rv;
-+ BOOLEAN_t *st = (BOOLEAN_t *)*sptr;
-
-+ (void)opt_codec_ctx;
-+ (void)constraints;
-+
-+ if(!st) {
-+ st = (BOOLEAN_t *)(*sptr = MALLOC(sizeof(*st)));
-+ if(!st) _ASN_DECODE_FAILED;
-+ }
-+
-+ /*
-+ * Extract a single bit
-+ */
-+ switch(per_get_few_bits(pd, 1)) {
-+ case 1: *st = 1; break;
-+ case 0: *st = 0; break;
-+ case -1: default: _ASN_DECODE_STARVED;
-+ }
-+
-+ ASN_DEBUG("%s decoded as %s", td->name, *st ? "TRUE" : "FALSE");
-+
-+ rv.code = RC_OK;
-+ rv.consumed = 1;
-+ return rv;
-+}
-+
- asn_enc_rval_t
- BOOLEAN_encode_uper(asn_TYPE_descriptor_t *td,
- asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-@@ -280,3 +311,18 @@
-
- _ASN_ENCODED_OK(er);
- }
-+
-+asn_enc_rval_t
-+BOOLEAN_encode_aper(asn_TYPE_descriptor_t *td,
-+ asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-+ const BOOLEAN_t *st = (const BOOLEAN_t *)sptr;
-+ asn_enc_rval_t er;
-+
-+ (void)constraints;
-+
-+ if(!st) _ASN_ENCODE_FAILED;
-+
-+ per_put_few_bits(po, *st ? 1 : 0, 1);
-+
-+ _ASN_ENCODED_OK(er);
-+}
-Index: skeletons/ISO646String.c
-===================================================================
---- skeletons/ISO646String.c (revision 1516)
-+++ skeletons/ISO646String.c (working copy)
-@@ -29,6 +29,8 @@
- OCTET_STRING_encode_xer_utf8,
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
-+ OCTET_STRING_decode_aper,
-+ OCTET_STRING_encode_aper,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_ISO646String_tags,
- sizeof(asn_DEF_ISO646String_tags)
-Index: skeletons/constr_CHOICE.c
-===================================================================
---- skeletons/constr_CHOICE.c (revision 1516)
-+++ skeletons/constr_CHOICE.c (working copy)
-@@ -34,7 +34,7 @@
- #undef ADVANCE
- #define ADVANCE(num_bytes) do { \
- size_t num = num_bytes; \
-- ptr = ((const void *)ptr) + num;\
-+ ptr = ((const char *)ptr) + num;\
- size -= num; \
- if(ctx->left >= 0) \
- ctx->left -= num; \
-@@ -133,7 +133,7 @@
- /*
- * Restore parsing context.
- */
-- ctx = (asn_struct_ctx_t *)((void *)st + specs->ctx_offset);
-+ ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
-
- /*
- * Start to parse where left previously
-@@ -211,7 +211,7 @@
-
- skip = ber_skip_length(opt_codec_ctx,
- BER_TLV_CONSTRUCTED(ptr),
-- (const void *)ptr + tag_len,
-+ (const char *)ptr + tag_len,
- LEFT - tag_len);
-
- switch(skip) {
-@@ -244,7 +244,7 @@
- */
- if(elm->flags & ATF_POINTER) {
- /* Member is a pointer to another structure */
-- memb_ptr2 = (void **)((void *)st + elm->memb_offset);
-+ memb_ptr2 = (void **)((char *)st + elm->memb_offset);
- } else {
- /*
- * A pointer to a pointer
-@@ -390,7 +390,7 @@
- */
- elm = &td->elements[present-1];
- if(elm->flags & ATF_POINTER) {
-- memb_ptr = *(void **)((void *)sptr + elm->memb_offset);
-+ memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
- if(memb_ptr == 0) {
- if(elm->optional) {
- erval.encoded = 0;
-@@ -400,7 +400,7 @@
- _ASN_ENCODE_FAILED;
- }
- } else {
-- memb_ptr = (void *)((void *)sptr + elm->memb_offset);
-+ memb_ptr = (void *)((char *)sptr + elm->memb_offset);
- }
-
- /*
-@@ -463,10 +463,10 @@
-
- if(elm->flags & ATF_POINTER) {
- memb_ptr = *(const void * const *)
-- ((const void *)ptr + elm->memb_offset);
-+ ((const char *)ptr + elm->memb_offset);
- } else {
- memb_ptr = (const void *)
-- ((const void *)ptr + elm->memb_offset);
-+ ((const char *)ptr + elm->memb_offset);
- }
-
- return asn_TYPE_outmost_tag(elm->type, memb_ptr,
-@@ -498,7 +498,7 @@
- const void *memb_ptr;
-
- if(elm->flags & ATF_POINTER) {
-- memb_ptr = *(const void * const *)((const void *)sptr + elm->memb_offset);
-+ memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset);
- if(!memb_ptr) {
- if(elm->optional)
- return 0;
-@@ -508,7 +508,7 @@
- return -1;
- }
- } else {
-- memb_ptr = (const void *)((const void *)sptr + elm->memb_offset);
-+ memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
- }
-
- if(elm->memb_constraints) {
-@@ -535,7 +535,7 @@
- #undef XER_ADVANCE
- #define XER_ADVANCE(num_bytes) do { \
- size_t num = num_bytes; \
-- buf_ptr = ((const void *)buf_ptr) + num;\
-+ buf_ptr = ((const char *)buf_ptr) + num;\
- size -= num; \
- consumed_myself += num; \
- } while(0)
-@@ -574,7 +574,7 @@
- /*
- * Restore parsing context.
- */
-- ctx = (asn_struct_ctx_t *)((void *)st + specs->ctx_offset);
-+ ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
- if(ctx->phase == 0 && !*xml_tag)
- ctx->phase = 1; /* Skip the outer tag checking phase */
-
-@@ -605,7 +605,7 @@
-
- if(elm->flags & ATF_POINTER) {
- /* Member is a pointer to another structure */
-- memb_ptr2 = (void **)((void *)st
-+ memb_ptr2 = (void **)((char *)st
- + elm->memb_offset);
- } else {
- memb_ptr = (char *)st + elm->memb_offset;
-@@ -797,10 +797,10 @@
- unsigned int mlen = strlen(mname);
-
- if(elm->flags & ATF_POINTER) {
-- memb_ptr = *(void **)((void *)sptr + elm->memb_offset);
-+ memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
- if(!memb_ptr) _ASN_ENCODE_FAILED;
- } else {
-- memb_ptr = (void *)((void *)sptr + elm->memb_offset);
-+ memb_ptr = (void *)((char *)sptr + elm->memb_offset);
- }
-
- er.encoded = 0;
-@@ -884,7 +884,7 @@
- elm = &td->elements[value];
- if(elm->flags & ATF_POINTER) {
- /* Member is a pointer to another structure */
-- memb_ptr2 = (void **)((void *)st + elm->memb_offset);
-+ memb_ptr2 = (void **)((char *)st + elm->memb_offset);
- } else {
- memb_ptr = (char *)st + elm->memb_offset;
- memb_ptr2 = &memb_ptr;
-@@ -904,7 +904,88 @@
- elm->name, td->name, rv.code);
- return rv;
- }
--
-+
-+asn_dec_rval_t
-+CHOICE_decode_aper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
-+ asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
-+ asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics;
-+ asn_dec_rval_t rv;
-+ asn_per_constraint_t *ct;
-+ asn_TYPE_member_t *elm; /* CHOICE's element */
-+ void *memb_ptr;
-+ void **memb_ptr2;
-+ void *st = *sptr;
-+ int value;
-+
-+ if(_ASN_STACK_OVERFLOW_CHECK(opt_codec_ctx))
-+ _ASN_DECODE_FAILED;
-+
-+ /*
-+ * Create the target structure if it is not present already.
-+ */
-+ if(!st) {
-+ st = *sptr = CALLOC(1, specs->struct_size);
-+ if(!st) _ASN_DECODE_FAILED;
-+ }
-+
-+ if(constraints) ct = &constraints->value;
-+ else if(td->per_constraints) ct = &td->per_constraints->value;
-+ else ct = 0;
-+
-+ if(ct && ct->flags & APC_EXTENSIBLE) {
-+ value = per_get_few_bits(pd, 1);
-+ if(value < 0) _ASN_DECODE_STARVED;
-+ if(value) ct = 0; /* Not restricted */
-+ }
-+
-+ if(ct && ct->range_bits >= 0) {
-+ value = per_get_few_bits(pd, ct->range_bits);
-+ if(value < 0) _ASN_DECODE_STARVED;
-+ ASN_DEBUG("CHOICE %s got index %d in range %d",
-+ td->name, value, ct->range_bits);
-+ if(value > ct->upper_bound)
-+ _ASN_DECODE_FAILED;
-+ } else {
-+ if(specs->ext_start == -1)
-+ _ASN_DECODE_FAILED;
-+ value = uper_get_nsnnwn(pd);
-+ if(value < 0) _ASN_DECODE_STARVED;
-+ value += specs->ext_start;
-+ if(value >= td->elements_count)
-+ _ASN_DECODE_FAILED;
-+ }
-+
-+ /* Adjust if canonical order is different from natural order */
-+ if(specs->canonical_order)
-+ value = specs->canonical_order[value];
-+
-+ /* Set presence to be able to free it later */
-+ _set_present_idx(st, specs->pres_offset, specs->pres_size, value + 1);
-+
-+ elm = &td->elements[value];
-+ if(elm->flags & ATF_POINTER) {
-+ /* Member is a pointer to another structure */
-+ memb_ptr2 = (void **)((char *)st + elm->memb_offset);
-+ } else {
-+ memb_ptr = (char *)st + elm->memb_offset;
-+ memb_ptr2 = &memb_ptr;
-+ }
-+ ASN_DEBUG("Discovered CHOICE %s encodes %s", td->name, elm->name);
-+
-+ if(ct && ct->range_bits >= 0) {
-+ rv = elm->type->aper_decoder(opt_codec_ctx, elm->type,
-+ elm->per_constraints, memb_ptr2, pd);
-+ } else {
-+ rv = uper_open_type_get(opt_codec_ctx, elm->type,
-+ elm->per_constraints, memb_ptr2, pd);
-+ }
-+
-+ if(rv.code != RC_OK)
-+ ASN_DEBUG("Failed to decode %s in %s (CHOICE) %d",
-+ elm->name, td->name, rv.code);
-+ return rv;
-+}
-+
- asn_enc_rval_t
- CHOICE_encode_uper(asn_TYPE_descriptor_t *td,
- asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-@@ -917,7 +998,7 @@
-
- if(!sptr) _ASN_ENCODE_FAILED;
-
-- ASN_DEBUG("Encoding %s as CHOICE", td->name);
-+ ASN_DEBUG("Encoding %s as CHOICE using UPER", td->name);
-
- if(constraints) ct = &constraints->value;
- else if(td->per_constraints) ct = &td->per_constraints->value;
-@@ -962,7 +1043,7 @@
- elm = &td->elements[present];
- if(elm->flags & ATF_POINTER) {
- /* Member is a pointer to another structure */
-- memb_ptr = *(void **)((void *)sptr + elm->memb_offset);
-+ memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
- if(!memb_ptr) _ASN_ENCODE_FAILED;
- } else {
- memb_ptr = (char *)sptr + elm->memb_offset;
-@@ -987,8 +1068,88 @@
- _ASN_ENCODED_OK(rval);
- }
- }
--
-
-+asn_enc_rval_t
-+CHOICE_encode_aper(asn_TYPE_descriptor_t *td,
-+ asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-+ asn_CHOICE_specifics_t *specs = (asn_CHOICE_specifics_t *)td->specifics;
-+ asn_TYPE_member_t *elm; /* CHOICE's element */
-+ asn_per_constraint_t *ct;
-+ void *memb_ptr;
-+ int present;
-+
-+ if(!sptr) _ASN_ENCODE_FAILED;
-+
-+ ASN_DEBUG("Encoding %s as CHOICE using ALIGNED PER", td->name);
-+
-+ if(constraints) ct = &constraints->value;
-+ else if(td->per_constraints) ct = &td->per_constraints->value;
-+ else ct = 0;
-+
-+ present = _fetch_present_idx(sptr,
-+ specs->pres_offset, specs->pres_size);
-+
-+ /*
-+ * If the structure was not initialized properly, it cannot be encoded:
-+ * can't deduce what to encode in the choice type.
-+ */
-+ if(present <= 0 || present > td->elements_count)
-+ _ASN_ENCODE_FAILED;
-+ else
-+ present--;
-+
-+ /* Adjust if canonical order is different from natural order */
-+ if(specs->canonical_order)
-+ present = specs->canonical_order[present];
-+
-+ ASN_DEBUG("Encoding %s CHOICE element %d", td->name, present);
-+
-+ if(ct && ct->range_bits >= 0) {
-+ if(present < ct->lower_bound
-+ || present > ct->upper_bound) {
-+ if(ct->flags & APC_EXTENSIBLE) {
-+ if(per_put_few_bits(po, 1, 1))
-+ _ASN_ENCODE_FAILED;
-+ } else {
-+ _ASN_ENCODE_FAILED;
-+ }
-+ ct = 0;
-+ }
-+ }
-+ if(ct && ct->flags & APC_EXTENSIBLE) {
-+ if(per_put_few_bits(po, 0, 1))
-+ _ASN_ENCODE_FAILED;
-+ }
-+
-+ elm = &td->elements[present];
-+ if(elm->flags & ATF_POINTER) {
-+ /* Member is a pointer to another structure */
-+ memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
-+ if(!memb_ptr) _ASN_ENCODE_FAILED;
-+ } else {
-+ memb_ptr = (char *)sptr + elm->memb_offset;
-+ }
-+
-+ if(ct && ct->range_bits >= 0) {
-+ if(per_put_few_bits(po, present, ct->range_bits))
-+ _ASN_ENCODE_FAILED;
-+
-+ return elm->type->aper_encoder(elm->type, elm->per_constraints,
-+ memb_ptr, po);
-+ } else {
-+ asn_enc_rval_t rval;
-+ if(specs->ext_start == -1)
-+ _ASN_ENCODE_FAILED;
-+ if(aper_put_nsnnwn(po, ct->range_bits, present - specs->ext_start))
-+ _ASN_ENCODE_FAILED;
-+ if(aper_open_type_put(elm->type, elm->per_constraints,
-+ memb_ptr, po))
-+ _ASN_ENCODE_FAILED;
-+ rval.encoded = 0;
-+ _ASN_ENCODED_OK(rval);
-+ }
-+}
-+
- int
- CHOICE_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
- asn_app_consume_bytes_f *cb, void *app_key) {
-@@ -1010,10 +1171,10 @@
- const void *memb_ptr;
-
- if(elm->flags & ATF_POINTER) {
-- memb_ptr = *(const void * const *)((const void *)sptr + elm->memb_offset);
-+ memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset);
- if(!memb_ptr) return (cb("", 8, app_key) < 0) ? -1 : 0;
- } else {
-- memb_ptr = (const void *)((const void *)sptr + elm->memb_offset);
-+ memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
- }
-
- /* Print member's name and stuff */
-@@ -1053,11 +1214,11 @@
- void *memb_ptr;
-
- if(elm->flags & ATF_POINTER) {
-- memb_ptr = *(void **)((void *)ptr + elm->memb_offset);
-+ memb_ptr = *(void **)((char *)ptr + elm->memb_offset);
- if(memb_ptr)
- ASN_STRUCT_FREE(*elm->type, memb_ptr);
- } else {
-- memb_ptr = (void *)((void *)ptr + elm->memb_offset);
-+ memb_ptr = (void *)((char *)ptr + elm->memb_offset);
- ASN_STRUCT_FREE_CONTENTS_ONLY(*elm->type, memb_ptr);
- }
- }
-@@ -1082,7 +1243,7 @@
- const void *present_ptr;
- int present;
-
-- present_ptr = ((const void *)struct_ptr) + pres_offset;
-+ present_ptr = ((const char *)struct_ptr) + pres_offset;
-
- switch(pres_size) {
- case sizeof(int): present = *(const int *)present_ptr; break;
-@@ -1100,7 +1261,7 @@
- static void
- _set_present_idx(void *struct_ptr, int pres_offset, int pres_size, int present) {
- void *present_ptr;
-- present_ptr = ((void *)struct_ptr) + pres_offset;
-+ present_ptr = ((char *)struct_ptr) + pres_offset;
-
- switch(pres_size) {
- case sizeof(int): *(int *)present_ptr = present; break;
-Index: skeletons/asn_internal.h
-===================================================================
---- skeletons/asn_internal.h (revision 1516)
-+++ skeletons/asn_internal.h (working copy)
-@@ -20,7 +20,7 @@
- #endif
-
- /* Environment version might be used to avoid running with the old library */
--#define ASN1C_ENVIRONMENT_VERSION 923 /* Compile-time version */
-+#define ASN1C_ENVIRONMENT_VERSION 924 /* Compile-time version */
- int get_asn1c_environment_version(void); /* Run-time version */
-
- #define CALLOC(nmemb, size) calloc(nmemb, size)
-@@ -48,18 +48,22 @@
- #define ASN_DEBUG_INDENT_ADD(i) do { asn_debug_indent += i; } while(0)
- #endif /* ASN_THREAD_SAFE */
- #define ASN_DEBUG(fmt, args...) do { \
-- int adi = asn_debug_indent; \
-- while(adi--) fprintf(stderr, " "); \
-- fprintf(stderr, fmt, ##args); \
-- fprintf(stderr, " (%s:%d)\n", \
-- __FILE__, __LINE__); \
-- } while(0)
-+ int adi = asn_debug_indent; \
-+ while(adi--) fprintf(stderr, " "); \
-+ fprintf(stderr, fmt, ##args); \
-+ fprintf(stderr, " (%s:%d)\n", \
-+ __FILE__, __LINE__); \
-+} while(0)
- #else /* !__GNUC__ */
- void ASN_DEBUG_f(const char *fmt, ...);
- #define ASN_DEBUG ASN_DEBUG_f
- #endif /* __GNUC__ */
- #else /* EMIT_ASN_DEBUG != 1 */
-+# ifdef EMIT_ASN_DEBUG_EXTERN
-+extern inline void ASN_DEBUG(const char *fmt, ...);
-+# else
- static inline void ASN_DEBUG(const char *fmt, ...) { (void)fmt; }
-+# endif
- #endif /* EMIT_ASN_DEBUG */
- #endif /* ASN_DEBUG */
-
-Index: skeletons/BOOLEAN.h
-===================================================================
---- skeletons/BOOLEAN.h (revision 1516)
-+++ skeletons/BOOLEAN.h (working copy)
-@@ -28,6 +28,8 @@
- xer_type_encoder_f BOOLEAN_encode_xer;
- per_type_decoder_f BOOLEAN_decode_uper;
- per_type_encoder_f BOOLEAN_encode_uper;
-+per_type_decoder_f BOOLEAN_decode_aper;
-+per_type_encoder_f BOOLEAN_encode_aper;
-
- #ifdef __cplusplus
- }
-Index: skeletons/constr_CHOICE.h
-===================================================================
---- skeletons/constr_CHOICE.h (revision 1516)
-+++ skeletons/constr_CHOICE.h (working copy)
-@@ -48,6 +48,8 @@
- xer_type_encoder_f CHOICE_encode_xer;
- per_type_decoder_f CHOICE_decode_uper;
- per_type_encoder_f CHOICE_encode_uper;
-+per_type_decoder_f CHOICE_decode_aper;
-+per_type_encoder_f CHOICE_encode_aper;
- asn_outmost_tag_f CHOICE_outmost_tag;
-
- #ifdef __cplusplus
-Index: skeletons/INTEGER.c
-===================================================================
---- skeletons/INTEGER.c (revision 1516)
-+++ skeletons/INTEGER.c (working copy)
-@@ -27,9 +27,13 @@
- #ifdef ASN_DISABLE_PER_SUPPORT
- 0,
- 0,
-+ 0,
-+ 0,
- #else
- INTEGER_decode_uper, /* Unaligned PER decoder */
- INTEGER_encode_uper, /* Unaligned PER encoder */
-+ INTEGER_decode_aper,
-+ INTEGER_encode_aper,
- #endif /* ASN_DISABLE_PER_SUPPORT */
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_INTEGER_tags,
-@@ -612,7 +616,7 @@
- value = per_get_few_bits(pd, ct->range_bits);
- if(value < 0) _ASN_DECODE_STARVED;
- }
-- ASN_DEBUG("Got value %ld + low %ld",
-+ ASN_DEBUG("Got value %ld + low %"PRIdMAX,
- value, ct->lower_bound);
- value += ct->lower_bound;
- if((specs && specs->field_unsigned)
-@@ -660,6 +664,158 @@
- return rval;
- }
-
-+asn_dec_rval_t
-+INTEGER_decode_aper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
-+ asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
-+ asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics;
-+ asn_dec_rval_t rval = { RC_OK, 0 };
-+ INTEGER_t *st = (INTEGER_t *)*sptr;
-+ asn_per_constraint_t *ct;
-+ int repeat;
-+
-+ (void)opt_codec_ctx;
-+
-+ if(!st) {
-+ st = (INTEGER_t *)(*sptr = CALLOC(1, sizeof(*st)));
-+ if(!st) _ASN_DECODE_FAILED;
-+ }
-+
-+ if(!constraints) constraints = td->per_constraints;
-+ ct = constraints ? &constraints->value : 0;
-+
-+ if(ct && ct->flags & APC_EXTENSIBLE) {
-+ int inext = per_get_few_bits(pd, 1);
-+ if(inext < 0) _ASN_DECODE_STARVED;
-+ if(inext) ct = 0;
-+ }
-+
-+ FREEMEM(st->buf);
-+ st->buf = 0;
-+ st->size = 0;
-+ if(ct) {
-+ if(ct->flags & APC_SEMI_CONSTRAINED) {
-+ st->buf = (uint8_t *)CALLOC(1, 2);
-+ if(!st->buf) _ASN_DECODE_FAILED;
-+ st->size = 1;
-+ } else if(ct->flags & APC_CONSTRAINED && ct->range_bits >= 0) {
-+ size_t size = (ct->range_bits + 7) >> 3;
-+ st->buf = (uint8_t *)MALLOC(1 + size + 1);
-+ if(!st->buf) _ASN_DECODE_FAILED;
-+ st->size = size;
-+ }
-+ }
-+
-+ /* X.691, #12.2.2 */
-+ if(ct && ct->flags != APC_UNCONSTRAINED) {
-+ /* #10.5.6 */
-+ ASN_DEBUG("Integer with range %d bits", ct->range_bits);
-+ if(ct->range_bits >= 0) {
-+ if (ct->range_bits > 16) {
-+ int max_range_bytes = (ct->range_bits >> 3) +
-+ (((ct->range_bits % 8) > 0) ? 1 : 0);
-+ int length = 0, i;
-+ int64_t value = 0;
-+
-+ for (i = 1; ; i++) {
-+ int upper = 1 << i;
-+ if (upper >= max_range_bytes)
-+ break;
-+ }
-+ ASN_DEBUG("Can encode %d (%d bytes) in %d bits", ct->range_bits,
-+ max_range_bytes, i);
-+
-+ if ((length = per_get_few_bits(pd, i)) < 0)
-+ _ASN_DECODE_FAILED;
-+
-+ /* X.691 #12.2.6 length determinant + lb (1) */
-+ length += 1;
-+ ASN_DEBUG("Got length %d", length);
-+
-+ if (aper_get_align(pd) != 0)
-+ _ASN_DECODE_STARVED;
-+
-+ while (length--) {
-+ int buf = per_get_few_bits(pd, 8);
-+ if (buf < 0)
-+ _ASN_DECODE_STARVED;
-+ value += (((int64_t)buf) << (8 * length));
-+ }
-+
-+ value += ct->lower_bound;
-+ if((specs && specs->field_unsigned)
-+ ? asn_uint642INTEGER(st, value)
-+ : asn_int642INTEGER(st, value))
-+ _ASN_DECODE_FAILED;
-+ ASN_DEBUG("Got value %lld + low %lld",
-+ value, ct->lower_bound);
-+ } else {
-+ long value = 0;
-+ if (ct->range_bits < 8) {
-+ value = per_get_few_bits(pd, ct->range_bits);
-+ if(value < 0) _ASN_DECODE_STARVED;
-+ } else if (ct->range_bits == 8) {
-+ if (aper_get_align(pd) < 0)
-+ _ASN_DECODE_FAILED;
-+ value = per_get_few_bits(pd, ct->range_bits);
-+ if(value < 0) _ASN_DECODE_STARVED;
-+ } else {
-+ /* Align */
-+ if (aper_get_align(pd) < 0)
-+ _ASN_DECODE_FAILED;
-+ value = per_get_few_bits(pd, 16);
-+ if(value < 0) _ASN_DECODE_STARVED;
-+ }
-+ value += ct->lower_bound;
-+ if((specs && specs->field_unsigned)
-+ ? asn_ulong2INTEGER(st, value)
-+ : asn_long2INTEGER(st, value))
-+ _ASN_DECODE_FAILED;
-+ ASN_DEBUG("Got value %ld + low %lld",
-+ value, ct->lower_bound);
-+ }
-+ return rval;
-+ } else {
-+ _ASN_DECODE_FAILED;
-+ }
-+ } else {
-+ ASN_DEBUG("Decoding unconstrained integer %s", td->name);
-+ }
-+
-+ /* X.691, #12.2.3, #12.2.4 */
-+ do {
-+ ssize_t len;
-+ void *p;
-+ int ret;
-+
-+ /* Get the PER length */
-+ len = aper_get_length(pd, -1, -1, &repeat);
-+ if(len < 0) _ASN_DECODE_STARVED;
-+
-+ p = REALLOC(st->buf, st->size + len + 1);
-+ if(!p) _ASN_DECODE_FAILED;
-+ st->buf = (uint8_t *)p;
-+
-+ ret = per_get_many_bits(pd, &st->buf[st->size], 0, 8 * len);
-+ if(ret < 0) _ASN_DECODE_STARVED;
-+ st->size += len;
-+ } while(repeat);
-+ st->buf[st->size] = 0; /* JIC */
-+
-+ /* #12.2.3 */
-+ if(ct && ct->lower_bound) {
-+ /*
-+ * TODO: replace by in-place arithmetics.
-+ */
-+ long value;
-+ if(asn_INTEGER2long(st, &value))
-+ _ASN_DECODE_FAILED;
-+ if(asn_long2INTEGER(st, value + ct->lower_bound))
-+ _ASN_DECODE_FAILED;
-+ }
-+
-+ return rval;
-+}
-+
- asn_enc_rval_t
- INTEGER_encode_uper(asn_TYPE_descriptor_t *td,
- asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-@@ -693,7 +849,7 @@
- || uval > (unsigned long)ct->upper_bound)
- inext = 1;
- }
-- ASN_DEBUG("Value %lu (%02x/%d) lb %lu ub %lu %s",
-+ ASN_DEBUG("Value %lu (%02x/%d) lb %"PRIuMAX" ub %"PRIuMAX" %s",
- uval, st->buf[0], st->size,
- ct->lower_bound, ct->upper_bound,
- inext ? "ext" : "fix");
-@@ -710,7 +866,7 @@
- || value > ct->upper_bound)
- inext = 1;
- }
-- ASN_DEBUG("Value %ld (%02x/%d) lb %ld ub %ld %s",
-+ ASN_DEBUG("Value %ld (%02x/%d) lb %"PRIdMAX" ub %"PRIdMAX" %s",
- value, st->buf[0], st->size,
- ct->lower_bound, ct->upper_bound,
- inext ? "ext" : "fix");
-@@ -745,7 +901,7 @@
- }
-
- if(ct && ct->lower_bound) {
-- ASN_DEBUG("Adjust lower bound to %ld", ct->lower_bound);
-+ ASN_DEBUG("Adjust lower bound to %"PRIdMAX"\n", ct->lower_bound);
- /* TODO: adjust lower bound */
- _ASN_ENCODE_FAILED;
- }
-@@ -762,6 +918,153 @@
- _ASN_ENCODED_OK(er);
- }
-
-+asn_enc_rval_t
-+INTEGER_encode_aper(asn_TYPE_descriptor_t *td,
-+ asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-+ asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics;
-+ asn_enc_rval_t er;
-+ INTEGER_t *st = (INTEGER_t *)sptr;
-+ const uint8_t *buf;
-+ const uint8_t *end;
-+ asn_per_constraint_t *ct;
-+ int64_t value = 0;
-+
-+ if(!st || st->size == 0) _ASN_ENCODE_FAILED;
-+
-+ if(!constraints) constraints = td->per_constraints;
-+ ct = constraints ? &constraints->value : 0;
-+
-+ er.encoded = 0;
-+
-+ if(ct) {
-+ int inext = 0;
-+ if(specs && specs->field_unsigned) {
-+ uint64_t uval;
-+ if(asn_INTEGER2uint64(st, &uval))
-+ _ASN_ENCODE_FAILED;
-+ /* Check proper range */
-+ if(ct->flags & APC_SEMI_CONSTRAINED) {
-+ if(uval < ct->lower_bound)
-+ inext = 1;
-+ } else if(ct->range_bits >= 0) {
-+ if(uval < ct->lower_bound
-+ || uval > ct->upper_bound)
-+ inext = 1;
-+ }
-+ ASN_DEBUG("Value %llu (%02x/%d) lb %llu ub %llu %s",
-+ uval, st->buf[0], st->size,
-+ ct->lower_bound, ct->upper_bound,
-+ inext ? "ext" : "fix");
-+ value = uval;
-+ } else {
-+ if(asn_INTEGER2int64(st, &value)) _ASN_ENCODE_FAILED;
-+ /* Check proper range */
-+ if(ct->flags & APC_SEMI_CONSTRAINED) {
-+ if(value < ct->lower_bound)
-+ inext = 1;
-+ } else if(ct->range_bits >= 0) {
-+ if(value < ct->lower_bound
-+ || value > ct->upper_bound)
-+ inext = 1;
-+ }
-+ ASN_DEBUG("Value %lld (%02x/%d) lb %lld ub %lld %s",
-+ value, st->buf[0], st->size,
-+ ct->lower_bound, ct->upper_bound,
-+ inext ? "ext" : "fix");
-+ }
-+ if(ct->flags & APC_EXTENSIBLE) {
-+ if(per_put_few_bits(po, inext, 1))
-+ _ASN_ENCODE_FAILED;
-+ if(inext) ct = 0;
-+ } else if(inext) {
-+ _ASN_ENCODE_FAILED;
-+ }
-+ }
-+
-+ /* X.691, #12.2.2 */
-+ if(ct && ct->range_bits >= 0) {
-+ /* #10.5.6 */
-+ ASN_DEBUG("Encoding integer with range %d bits",
-+ ct->range_bits);
-+
-+ value -= ct->lower_bound;
-+
-+ /* #12 <= 8 -> alignment ? */
-+ if (ct->range_bits < 8) {
-+ /* Bit field case -> no alignment*/
-+ if(per_put_few_bits(po, 0x00 | value, ct->range_bits))
-+ _ASN_ENCODE_FAILED;
-+ } else if (ct->range_bits == 8) {
-+ if(aper_put_align(po) < 0)
-+ _ASN_ENCODE_FAILED;
-+ if(per_put_few_bits(po, 0x00 | value, ct->range_bits))
-+ _ASN_ENCODE_FAILED;
-+ } else if (ct->range_bits <= 16) {
-+ // Consume the bytes to align on octet
-+ if(aper_put_align(po) < 0)
-+ _ASN_ENCODE_FAILED;
-+ if(per_put_few_bits(po, 0x0000 | value,
-+ 16))
-+ _ASN_ENCODE_FAILED;
-+ } else {
-+ /* TODO: extend to >64 bits */
-+ int64_t v = value;
-+ int i, j;
-+ int max_range_bytes = (ct->range_bits >> 3) +
-+ (((ct->range_bits % 8) > 0) ? 1 : 0);
-+
-+ for (i = 1; ; i++) {
-+ int upper = 1 << i;
-+ if (upper >= max_range_bytes)
-+ break;
-+ }
-+
-+ for(j = sizeof(int64_t) - 1; j != 0; j--) {
-+ uint8_t val;
-+ val = v >> (j * 8);
-+ if (val != 0) {
-+ break;
-+ }
-+ }
-+
-+ ASN_DEBUG("Putting n - lb (%"PRIdMAX") with range %d bytes (real size - lb (1)) %d in %d bits",
-+ v, max_range_bytes, j, i);
-+
-+ /* Putting length in the minimum number of bits ex: 5 = 3bits */
-+ if (per_put_few_bits(po, j, i))
-+ _ASN_ENCODE_FAILED;
-+
-+ // Consume the bits to align on octet
-+ if (aper_put_align(po) < 0)
-+ _ASN_ENCODE_FAILED;
-+
-+ /* Put the value */
-+ for (i = 0; i <= j; i++) {
-+ if(per_put_few_bits(po, (v >> (8 * (j - i))) & 0xff, 8))
-+ _ASN_ENCODE_FAILED;
-+ }
-+ }
-+ _ASN_ENCODED_OK(er);
-+ }
-+
-+ if(ct && ct->lower_bound) {
-+ ASN_DEBUG("Adjust lower bound to %"PRIdMAX, ct->lower_bound);
-+ /* TODO: adjust lower bound */
-+ _ASN_ENCODE_FAILED;
-+ }
-+
-+ for(buf = st->buf, end = st->buf + st->size; buf < end;) {
-+ ssize_t mayEncode = aper_put_length(po, -1, end - buf);
-+ if(mayEncode < 0)
-+ _ASN_ENCODE_FAILED;
-+ if(per_put_many_bits(po, buf, 8 * mayEncode))
-+ _ASN_ENCODE_FAILED;
-+ buf += mayEncode;
-+ }
-+
-+ _ASN_ENCODED_OK(er);
-+}
-+
- #endif /* ASN_DISABLE_PER_SUPPORT */
-
- int
-@@ -825,6 +1128,66 @@
- }
-
- int
-+asn_INTEGER2int64(const INTEGER_t *iptr, int64_t *lptr) {
-+ uint8_t *b, *end;
-+ size_t size;
-+ int64_t l;
-+
-+ /* Sanity checking */
-+ if(!iptr || !iptr->buf || !lptr) {
-+ errno = EINVAL;
-+ return -1;
-+ }
-+
-+ /* Cache the begin/end of the buffer */
-+ b = iptr->buf; /* Start of the INTEGER buffer */
-+ size = iptr->size;
-+ end = b + size; /* Where to stop */
-+
-+ if(size > sizeof(int64_t)) {
-+ uint8_t *end1 = end - 1;
-+ /*
-+ * Slightly more advanced processing,
-+ * able to >sizeof(int64_t) bytes,
-+ * when the actual value is small
-+ * (0x0000000000abcdef would yield a fine 0x00abcdef)
-+ */
-+ /* Skip out the insignificant leading bytes */
-+ for(; b < end1; b++) {
-+ switch(*b) {
-+ case 0x00: if((b[1] & 0x80) == 0) continue; break;
-+ case 0xff: if((b[1] & 0x80) != 0) continue; break;
-+ }
-+ break;
-+ }
-+
-+ size = end - b;
-+ if(size > sizeof(int64_t)) {
-+ /* Still cannot fit the int64_t */
-+ errno = ERANGE;
-+ return -1;
-+ }
-+ }
-+
-+ /* Shortcut processing of a corner case */
-+ if(end == b) {
-+ *lptr = 0;
-+ return 0;
-+ }
-+
-+ /* Perform the sign initialization */
-+ /* Actually l = -(*b >> 7); gains nothing, yet unreadable! */
-+ if((*b >> 7)) l = -1; else l = 0;
-+
-+ /* Conversion engine */
-+ for(; b < end; b++)
-+ l = (l << 8) | *b;
-+
-+ *lptr = l;
-+ return 0;
-+}
-+
-+int
- asn_INTEGER2ulong(const INTEGER_t *iptr, unsigned long *lptr) {
- uint8_t *b, *end;
- unsigned long l;
-@@ -857,6 +1220,38 @@
- }
-
- int
-+asn_INTEGER2uint64(const INTEGER_t *iptr, uint64_t *lptr) {
-+ uint8_t *b, *end;
-+ uint64_t l;
-+ size_t size;
-+
-+ if(!iptr || !iptr->buf || !lptr) {
-+ errno = EINVAL;
-+ return -1;
-+ }
-+
-+ b = iptr->buf;
-+ size = iptr->size;
-+ end = b + size;
-+
-+ /* If all extra leading bytes are zeroes, ignore them */
-+ for(; size > sizeof(uint64_t); b++, size--) {
-+ if(*b) {
-+ /* Value won't fit unsigned long */
-+ errno = ERANGE;
-+ return -1;
-+ }
-+ }
-+
-+ /* Conversion engine */
-+ for(l = 0; b < end; b++)
-+ l = (l << 8) | *b;
-+
-+ *lptr = l;
-+ return 0;
-+}
-+
-+int
- asn_ulong2INTEGER(INTEGER_t *st, unsigned long value) {
- uint8_t *buf;
- uint8_t *end;
-@@ -871,7 +1266,7 @@
-
- end = buf + (sizeof(value) + 1);
- buf[0] = 0;
-- for(b = buf + 1, shr = (sizeof(long)-1)*8; b < end; shr -= 8, b++)
-+ for(b = buf + 1, shr = (sizeof(unsigned long)-1)*8; b < end; shr -= 8, b++)
- *b = (uint8_t)(value >> shr);
-
- if(st->buf) FREEMEM(st->buf);
-@@ -882,6 +1277,31 @@
- }
-
- int
-+asn_uint642INTEGER(INTEGER_t *st, uint64_t value) {
-+ uint8_t *buf;
-+ uint8_t *end;
-+ uint8_t *b;
-+ int shr;
-+
-+ if(value <= INT64_MAX)
-+ return asn_int642INTEGER(st, value);
-+
-+ buf = (uint8_t *)MALLOC(1 + sizeof(value));
-+ if(!buf) return -1;
-+
-+ end = buf + (sizeof(value) + 1);
-+ buf[0] = 0;
-+ for(b = buf + 1, shr = (sizeof(value)-1)*8; b < end; shr -= 8, b++)
-+ *b = (uint8_t)(value >> shr);
-+
-+ if(st->buf) FREEMEM(st->buf);
-+ st->buf = buf;
-+ st->size = 1 + sizeof(value);
-+
-+ return 0;
-+}
-+
-+int
- asn_long2INTEGER(INTEGER_t *st, long value) {
- uint8_t *buf, *bp;
- uint8_t *p;
-@@ -1024,3 +1444,60 @@
- return ASN_STRTOL_OK;
- }
-
-+
-+int
-+asn_int642INTEGER(INTEGER_t *st, int64_t value) {
-+ uint8_t *buf, *bp;
-+ uint8_t *p;
-+ uint8_t *pstart;
-+ uint8_t *pend1;
-+ int littleEndian = 1; /* Run-time detection */
-+ int add;
-+
-+ if(!st) {
-+ errno = EINVAL;
-+ return -1;
-+ }
-+
-+ buf = (uint8_t *)MALLOC(sizeof(value));
-+ if(!buf) return -1;
-+
-+ if(*(char *)&littleEndian) {
-+ pstart = (uint8_t *)&value + sizeof(value) - 1;
-+ pend1 = (uint8_t *)&value;
-+ add = -1;
-+ } else {
-+ pstart = (uint8_t *)&value;
-+ pend1 = pstart + sizeof(value) - 1;
-+ add = 1;
-+ }
-+
-+ /*
-+ * If the contents octet consists of more than one octet,
-+ * then bits of the first octet and bit 8 of the second octet:
-+ * a) shall not all be ones; and
-+ * b) shall not all be zero.
-+ */
-+ for(p = pstart; p != pend1; p += add) {
-+ switch(*p) {
-+ case 0x00: if((*(p+add) & 0x80) == 0)
-+ continue;
-+ break;
-+ case 0xff: if((*(p+add) & 0x80))
-+ continue;
-+ break;
-+ }
-+ break;
-+ }
-+ /* Copy the integer body */
-+ for(pstart = p, bp = buf, pend1 += add; p != pend1; p += add)
-+ *bp++ = *p;
-+
-+ if(st->buf) FREEMEM(st->buf);
-+ st->buf = buf;
-+ st->size = bp - buf;
-+
-+ return 0;
-+}
-+
-+
-Index: skeletons/constr_SEQUENCE.c
-===================================================================
---- skeletons/constr_SEQUENCE.c (revision 1516)
-+++ skeletons/constr_SEQUENCE.c (working copy)
-@@ -34,7 +34,7 @@
- #undef ADVANCE
- #define ADVANCE(num_bytes) do { \
- size_t num = num_bytes; \
-- ptr = ((const void *)ptr) + num;\
-+ ptr = ((const char *)ptr) + num;\
- size -= num; \
- if(ctx->left >= 0) \
- ctx->left -= num; \
-@@ -144,7 +144,7 @@
- /*
- * Restore parsing context.
- */
-- ctx = (asn_struct_ctx_t *)((void *)st + specs->ctx_offset);
-+ ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
-
- /*
- * Start to parse where left previously
-@@ -366,7 +366,7 @@
- ber_tlv_tag_string(tlv_tag), edx);
- skip = ber_skip_length(opt_codec_ctx,
- BER_TLV_CONSTRUCTED(ptr),
-- (const void *)ptr + tag_len,
-+ (const char *)ptr + tag_len,
- LEFT - tag_len);
- ASN_DEBUG("Skip length %d in %s",
- (int)skip, td->name);
-@@ -397,13 +397,13 @@
- */
- if(elements[edx].flags & ATF_POINTER) {
- /* Member is a pointer to another structure */
-- memb_ptr2 = (void **)((void *)st + elements[edx].memb_offset);
-+ memb_ptr2 = (void **)((char *)st + elements[edx].memb_offset);
- } else {
- /*
- * A pointer to a pointer
- * holding the start of the structure
- */
-- memb_ptr = (void *)st + elements[edx].memb_offset;
-+ memb_ptr = (char *)st + elements[edx].memb_offset;
- memb_ptr2 = &memb_ptr;
- }
- /*
-@@ -489,7 +489,7 @@
-
- ll = ber_skip_length(opt_codec_ctx,
- BER_TLV_CONSTRUCTED(ptr),
-- (const void *)ptr + tl, LEFT - tl);
-+ (const char *)ptr + tl, LEFT - tl);
- switch(ll) {
- case 0: if(!SIZE_VIOLATION) RETURN(RC_WMORE);
- /* Fall through */
-@@ -528,14 +528,14 @@
- asn_TYPE_member_t *elm = &td->elements[edx];
- void *memb_ptr;
- if(elm->flags & ATF_POINTER) {
-- memb_ptr = *(void **)((void *)sptr + elm->memb_offset);
-+ memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
- if(!memb_ptr) {
- if(elm->optional) continue;
- /* Mandatory element is missing */
- _ASN_ENCODE_FAILED;
- }
- } else {
-- memb_ptr = (void *)((void *)sptr + elm->memb_offset);
-+ memb_ptr = (void *)((char *)sptr + elm->memb_offset);
- }
- erval = elm->type->der_encoder(elm->type, memb_ptr,
- elm->tag_mode, elm->tag,
-@@ -567,10 +567,10 @@
- void *memb_ptr;
-
- if(elm->flags & ATF_POINTER) {
-- memb_ptr = *(void **)((void *)sptr + elm->memb_offset);
-+ memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
- if(!memb_ptr) continue;
- } else {
-- memb_ptr = (void *)((void *)sptr + elm->memb_offset);
-+ memb_ptr = (void *)((char *)sptr + elm->memb_offset);
- }
- tmperval = elm->type->der_encoder(elm->type, memb_ptr,
- elm->tag_mode, elm->tag,
-@@ -595,7 +595,7 @@
- #undef XER_ADVANCE
- #define XER_ADVANCE(num_bytes) do { \
- size_t num = num_bytes; \
-- buf_ptr = ((const void *)buf_ptr) + num;\
-+ buf_ptr = ((const char *)buf_ptr) + num;\
- size -= num; \
- consumed_myself += num; \
- } while(0)
-@@ -637,7 +637,7 @@
- /*
- * Restore parsing context.
- */
-- ctx = (asn_struct_ctx_t *)((void *)st + specs->ctx_offset);
-+ ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
-
-
- /*
-@@ -667,9 +667,10 @@
-
- if(elm->flags & ATF_POINTER) {
- /* Member is a pointer to another structure */
-- memb_ptr2 = (void **)((void *)st + elm->memb_offset);
-+ memb_ptr2 = (void **)((char *)st
-+ + elm->memb_offset);
- } else {
-- memb_ptr = (void *)st + elm->memb_offset;
-+ memb_ptr = (char *)st + elm->memb_offset;
- memb_ptr2 = &memb_ptr;
- }
-
-@@ -739,7 +740,7 @@
- if(edx >= td->elements_count
- ||
- /* Explicit OPTIONAL specs reaches the end */
-- (edx + elements[edx].optional
-+ (edx + elements[edx].optional
- == td->elements_count)
- ||
- /* All extensions are optional */
-@@ -869,7 +870,7 @@
- unsigned int mlen = strlen(mname);
-
- if(elm->flags & ATF_POINTER) {
-- memb_ptr = *(void **)((void *)sptr + elm->memb_offset);
-+ memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
- if(!memb_ptr) {
- if(elm->optional)
- continue;
-@@ -877,7 +878,7 @@
- _ASN_ENCODE_FAILED;
- }
- } else {
-- memb_ptr = (void *)((void *)sptr + elm->memb_offset);
-+ memb_ptr = (void *)((char *)sptr + elm->memb_offset);
- }
-
- if(!xcan) _i_ASN_TEXT_INDENT(1, ilevel);
-@@ -917,14 +918,14 @@
- const void *memb_ptr;
-
- if(elm->flags & ATF_POINTER) {
-- memb_ptr = *(const void * const *)((const void *)sptr + elm->memb_offset);
-+ memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset);
- if(!memb_ptr) {
- if(elm->optional) continue;
- /* Print line */
- /* Fall through */
- }
- } else {
-- memb_ptr = (const void *)((const void *)sptr + elm->memb_offset);
-+ memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
- }
-
- /* Indentation */
-@@ -960,11 +961,11 @@
- asn_TYPE_member_t *elm = &td->elements[edx];
- void *memb_ptr;
- if(elm->flags & ATF_POINTER) {
-- memb_ptr = *(void **)((void *)sptr + elm->memb_offset);
-+ memb_ptr = *(void **)((char *)sptr + elm->memb_offset);
- if(memb_ptr)
- ASN_STRUCT_FREE(*elm->type, memb_ptr);
- } else {
-- memb_ptr = (void *)((void *)sptr + elm->memb_offset);
-+ memb_ptr = (void *)((char *)sptr + elm->memb_offset);
- ASN_STRUCT_FREE_CONTENTS_ONLY(*elm->type, memb_ptr);
- }
- }
-@@ -994,7 +995,7 @@
- const void *memb_ptr;
-
- if(elm->flags & ATF_POINTER) {
-- memb_ptr = *(const void * const *)((const void *)sptr + elm->memb_offset);
-+ memb_ptr = *(const void * const *)((const char *)sptr + elm->memb_offset);
- if(!memb_ptr) {
- if(elm->optional)
- continue;
-@@ -1004,7 +1005,7 @@
- return -1;
- }
- } else {
-- memb_ptr = (const void *)((const void *)sptr + elm->memb_offset);
-+ memb_ptr = (const void *)((const char *)sptr + elm->memb_offset);
- }
-
- if(elm->memb_constraints) {
-@@ -1088,9 +1089,9 @@
-
- /* Fetch the pointer to this member */
- if(elm->flags & ATF_POINTER) {
-- memb_ptr2 = (void **)((void *)st + elm->memb_offset);
-+ memb_ptr2 = (void **)((char *)st + elm->memb_offset);
- } else {
-- memb_ptr = (void *)st + elm->memb_offset;
-+ memb_ptr = (char *)st + elm->memb_offset;
- memb_ptr2 = &memb_ptr;
- }
-
-@@ -1154,11 +1155,224 @@
- memset(&epmd, 0, sizeof(epmd));
- epmd.buffer = epres;
- epmd.nbits = bmlength;
-+ ASN_DEBUG("Read in extensions bitmap for %s of %d bits (%x..)",
-+ td->name, bmlength, *epres);
-+
-+ /* Go over extensions and read them in */
-+ for(edx = specs->ext_after + 1; edx < td->elements_count; edx++) {
-+ asn_TYPE_member_t *elm = &td->elements[edx];
-+ void *memb_ptr; /* Pointer to the member */
-+ void **memb_ptr2; /* Pointer to that pointer */
-+ int present;
-+
-+ if(!IN_EXTENSION_GROUP(specs, edx)) {
-+ ASN_DEBUG("%d is not extension", edx);
-+ continue;
-+ }
-+
-+ /* Fetch the pointer to this member */
-+ if(elm->flags & ATF_POINTER) {
-+ memb_ptr2 = (void **)((char *)st + elm->memb_offset);
-+ } else {
-+ memb_ptr = (void *)((char *)st + elm->memb_offset);
-+ memb_ptr2 = &memb_ptr;
-+ }
-+
-+ present = per_get_few_bits(&epmd, 1);
-+ if(present <= 0) {
-+ if(present < 0) break; /* No more extensions */
-+ continue;
-+ }
-+
-+ ASN_DEBUG("Decoding member %s in %s %p", elm->name, td->name, *memb_ptr2);
-+ rv = uper_open_type_get(opt_codec_ctx, elm->type,
-+ elm->per_constraints, memb_ptr2, pd);
-+ if(rv.code != RC_OK) {
-+ FREEMEM(epres);
-+ return rv;
-+ }
-+ }
-+
-+ /* Skip over overflow extensions which aren't present
-+ * in this system's version of the protocol */
-+ for(;;) {
-+ ASN_DEBUG("Getting overflow extensions");
-+ switch(per_get_few_bits(&epmd, 1)) {
-+ case -1: break;
-+ case 0: continue;
-+ default:
-+ if(uper_open_type_skip(opt_codec_ctx, pd)) {
-+ FREEMEM(epres);
-+ _ASN_DECODE_STARVED;
-+ }
-+ }
-+ break;
-+ }
-+
-+ FREEMEM(epres);
-+ }
-+
-+ /* Fill DEFAULT members in extensions */
-+ for(edx = specs->roms_count; edx < specs->roms_count
-+ + specs->aoms_count; edx++) {
-+ asn_TYPE_member_t *elm = &td->elements[edx];
-+ void **memb_ptr2; /* Pointer to member pointer */
-+
-+ if(!elm->default_value) continue;
-+
-+ /* Fetch the pointer to this member */
-+ if(elm->flags & ATF_POINTER) {
-+ memb_ptr2 = (void **)((char *)st
-+ + elm->memb_offset);
-+ if(*memb_ptr2) continue;
-+ } else {
-+ continue; /* Extensions are all optionals */
-+ }
-+
-+ /* Set default value */
-+ if(elm->default_value(1, memb_ptr2)) {
-+ _ASN_DECODE_FAILED;
-+ }
-+ }
-+
-+ rv.consumed = 0;
-+ rv.code = RC_OK;
-+ return rv;
-+}
-+
-+asn_dec_rval_t
-+SEQUENCE_decode_aper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
-+ asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
-+ asn_SEQUENCE_specifics_t *specs = (asn_SEQUENCE_specifics_t *)td->specifics;
-+ void *st = *sptr; /* Target structure. */
-+ int extpresent; /* Extension additions are present */
-+ uint8_t *opres; /* Presence of optional root members */
-+ asn_per_data_t opmd;
-+ asn_dec_rval_t rv;
-+ int edx;
-+
-+ (void)constraints;
-+
-+ if(_ASN_STACK_OVERFLOW_CHECK(opt_codec_ctx))
-+ _ASN_DECODE_FAILED;
-+
-+ if(!st) {
-+ st = *sptr = CALLOC(1, specs->struct_size);
-+ if(!st) _ASN_DECODE_FAILED;
-+ }
-+
-+ ASN_DEBUG("Decoding %s as SEQUENCE (APER)", td->name);
-+
-+ /* Handle extensions */
-+ if(specs->ext_before >= 0) {
-+ extpresent = per_get_few_bits(pd, 1);
-+ if(extpresent < 0) _ASN_DECODE_STARVED;
-+ } else {
-+ extpresent = 0;
-+ }
-+
-+ /* Prepare a place and read-in the presence bitmap */
-+ memset(&opmd, 0, sizeof(opmd));
-+ if(specs->roms_count) {
-+ opres = (uint8_t *)MALLOC(((specs->roms_count + 7) >> 3) + 1);
-+ if(!opres) _ASN_DECODE_FAILED;
-+ /* Get the presence map */
-+ if(per_get_many_bits(pd, opres, 0, specs->roms_count)) {
-+ FREEMEM(opres);
-+ _ASN_DECODE_STARVED;
-+ }
-+ opmd.buffer = opres;
-+ opmd.nbits = specs->roms_count;
-+ ASN_DEBUG("Read in presence bitmap for %s of %d bits (%x..)",
-+ td->name, specs->roms_count, *opres);
-+ } else {
-+ opres = 0;
-+ }
-+
-+ /*
-+ * Get the sequence ROOT elements.
-+ */
-+ for(edx = 0; edx < td->elements_count; edx++) {
-+ asn_TYPE_member_t *elm = &td->elements[edx];
-+ void *memb_ptr; /* Pointer to the member */
-+ void **memb_ptr2; /* Pointer to that pointer */
-+
-+ if(IN_EXTENSION_GROUP(specs, edx))
-+ continue;
-+
-+ /* Fetch the pointer to this member */
-+ if(elm->flags & ATF_POINTER) {
-+ memb_ptr2 = (void **)((char *)st + elm->memb_offset);
-+ } else {
-+ memb_ptr = (char *)st + elm->memb_offset;
-+ memb_ptr2 = &memb_ptr;
-+ }
-+
-+ /* Deal with optionality */
-+ if(elm->optional) {
-+ int present = per_get_few_bits(&opmd, 1);
-+ ASN_DEBUG("Member %s->%s is optional, p=%d (%d->%d)",
-+ td->name, elm->name, present,
-+ (int)opmd.nboff, (int)opmd.nbits);
-+ if(present == 0) {
-+ /* This element is not present */
-+ if(elm->default_value) {
-+ /* Fill-in DEFAULT */
-+ if(elm->default_value(1, memb_ptr2)) {
-+ FREEMEM(opres);
-+ _ASN_DECODE_FAILED;
-+ }
-+ ASN_DEBUG("Filled-in default");
-+ }
-+ /* The member is just not present */
-+ continue;
-+ }
-+ /* Fall through */
-+ }
-+
-+ /* Fetch the member from the stream */
-+ ASN_DEBUG("Decoding member %s in %s", elm->name, td->name);
-+ rv = elm->type->aper_decoder(opt_codec_ctx, elm->type,
-+ elm->per_constraints, memb_ptr2, pd);
-+ if(rv.code != RC_OK) {
-+ ASN_DEBUG("Failed decode %s in %s",
-+ elm->name, td->name);
-+ FREEMEM(opres);
-+ return rv;
-+ }
-+ }
-+
-+ /* Optionality map is not needed anymore */
-+ FREEMEM(opres);
-+
-+ /*
-+ * Deal with extensions.
-+ */
-+ if(extpresent) {
-+ ssize_t bmlength;
-+ uint8_t *epres; /* Presence of extension members */
-+ asn_per_data_t epmd;
-+
-+ bmlength = uper_get_nslength(pd);
-+ if(bmlength < 0) _ASN_DECODE_STARVED;
-+
-+ ASN_DEBUG("Extensions %d present in %s", bmlength, td->name);
-+
-+ epres = (uint8_t *)MALLOC((bmlength + 15) >> 3);
-+ if(!epres) _ASN_DECODE_STARVED;
-+
-+ /* Get the extensions map */
-+ if(per_get_many_bits(pd, epres, 0, bmlength))
-+ _ASN_DECODE_STARVED;
-+
-+ memset(&epmd, 0, sizeof(epmd));
-+ epmd.buffer = epres;
-+ epmd.nbits = bmlength;
- ASN_DEBUG("Read in extensions bitmap for %s of %ld bits (%x..)",
- td->name, (long)bmlength, *epres);
-
-- /* Go over extensions and read them in */
-- for(edx = specs->ext_after + 1; edx < td->elements_count; edx++) {
-+ /* Go over extensions and read them in */
-+ for(edx = specs->ext_after + 1; edx < td->elements_count; edx++) {
- asn_TYPE_member_t *elm = &td->elements[edx];
- void *memb_ptr; /* Pointer to the member */
- void **memb_ptr2; /* Pointer to that pointer */
-@@ -1171,9 +1385,9 @@
-
- /* Fetch the pointer to this member */
- if(elm->flags & ATF_POINTER) {
-- memb_ptr2 = (void **)((void *)st + elm->memb_offset);
-+ memb_ptr2 = (void **)((char *)st + elm->memb_offset);
- } else {
-- memb_ptr = (void *)((void *)st + elm->memb_offset);
-+ memb_ptr = (void *)((char *)st + elm->memb_offset);
- memb_ptr2 = &memb_ptr;
- }
-
-@@ -1190,7 +1404,7 @@
- FREEMEM(epres);
- return rv;
- }
-- }
-+ }
-
- /* Skip over overflow extensions which aren't present
- * in this system's version of the protocol */
-@@ -1221,7 +1435,7 @@
-
- /* Fetch the pointer to this member */
- if(elm->flags & ATF_POINTER) {
-- memb_ptr2 = (void **)((void *)st
-+ memb_ptr2 = (void **)((char *)st
- + elm->memb_offset);
- if(*memb_ptr2) continue;
- } else {
-@@ -1265,10 +1479,10 @@
-
- /* Fetch the pointer to this member */
- if(elm->flags & ATF_POINTER) {
-- memb_ptr2 = (void **)((void *)sptr + elm->memb_offset);
-+ memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
- present = (*memb_ptr2 != 0);
- } else {
-- memb_ptr = (void *)((void *)sptr + elm->memb_offset);
-+ memb_ptr = (void *)((char *)sptr + elm->memb_offset);
- memb_ptr2 = &memb_ptr;
- present = 1;
- }
-@@ -1334,10 +1548,10 @@
-
- /* Fetch the pointer to this member */
- if(elm->flags & ATF_POINTER) {
-- memb_ptr2 = (void **)((void *)sptr + elm->memb_offset);
-+ memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
- present = (*memb_ptr2 != 0);
- } else {
-- memb_ptr = (void *)((void *)sptr + elm->memb_offset);
-+ memb_ptr = (void *)((char *)sptr + elm->memb_offset);
- memb_ptr2 = &memb_ptr;
- present = 1;
- }
-@@ -1373,7 +1587,7 @@
-
- /* Fetch the pointer to this member */
- if(elm->flags & ATF_POINTER) {
-- memb_ptr2 = (void **)((void *)sptr + elm->memb_offset);
-+ memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
- if(!*memb_ptr2) {
- ASN_DEBUG("Element %s %d not present",
- elm->name, edx);
-@@ -1383,7 +1597,7 @@
- _ASN_ENCODE_FAILED;
- }
- } else {
-- memb_ptr = (void *)((void *)sptr + elm->memb_offset);
-+ memb_ptr = (void *)((char *)sptr + elm->memb_offset);
- memb_ptr2 = &memb_ptr;
- }
-
-@@ -1420,3 +1634,130 @@
- _ASN_ENCODED_OK(er);
- }
-
-+asn_enc_rval_t
-+SEQUENCE_encode_aper(asn_TYPE_descriptor_t *td,
-+ asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-+ asn_SEQUENCE_specifics_t *specs
-+ = (asn_SEQUENCE_specifics_t *)td->specifics;
-+ asn_enc_rval_t er;
-+ int n_extensions;
-+ int edx;
-+ int i;
-+
-+ (void)constraints;
-+
-+ if(!sptr)
-+ _ASN_ENCODE_FAILED;
-+
-+ er.encoded = 0;
-+
-+ ASN_DEBUG("Encoding %s as SEQUENCE (APER)", td->name);
-+
-+ /*
-+ * X.691#18.1 Whether structure is extensible
-+ * and whether to encode extensions
-+ */
-+ if(specs->ext_before >= 0) {
-+ n_extensions = SEQUENCE_handle_extensions(td, sptr, 0, 0);
-+ per_put_few_bits(po, n_extensions ? 1 : 0, 1);
-+ } else {
-+ n_extensions = 0; /* There are no extensions to encode */
-+ }
-+
-+ /* Encode a presence bitmap */
-+ for(i = 0; i < specs->roms_count; i++) {
-+ asn_TYPE_member_t *elm;
-+ void *memb_ptr; /* Pointer to the member */
-+ void **memb_ptr2; /* Pointer to that pointer */
-+ int present;
-+
-+ edx = specs->oms[i];
-+ elm = &td->elements[edx];
-+
-+ /* Fetch the pointer to this member */
-+ if(elm->flags & ATF_POINTER) {
-+ memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
-+ present = (*memb_ptr2 != 0);
-+ } else {
-+ memb_ptr = (void *)((char *)sptr + elm->memb_offset);
-+ memb_ptr2 = &memb_ptr;
-+ present = 1;
-+ }
-+
-+ /* Eliminate default values */
-+ if(present && elm->default_value
-+ && elm->default_value(0, memb_ptr2) == 1)
-+ present = 0;
-+
-+ ASN_DEBUG("Element %s %s %s->%s is %s",
-+ elm->flags & ATF_POINTER ? "ptr" : "inline",
-+ elm->default_value ? "def" : "wtv",
-+ td->name, elm->name, present ? "present" : "absent");
-+ if(per_put_few_bits(po, present, 1))
-+ _ASN_ENCODE_FAILED;
-+ }
-+
-+ /*
-+ * Encode the sequence ROOT elements.
-+ */
-+ ASN_DEBUG("ext_after = %d, ec = %d, eb = %d", specs->ext_after, td->elements_count, specs->ext_before);
-+ for(edx = 0; edx < ((specs->ext_after < 0)
-+ ? td->elements_count : specs->ext_before - 1); edx++) {
-+
-+ asn_TYPE_member_t *elm = &td->elements[edx];
-+ void *memb_ptr; /* Pointer to the member */
-+ void **memb_ptr2; /* Pointer to that pointer */
-+
-+ if(IN_EXTENSION_GROUP(specs, edx))
-+ continue;
-+
-+ ASN_DEBUG("About to encode %s", elm->type->name);
-+
-+ /* Fetch the pointer to this member */
-+ if(elm->flags & ATF_POINTER) {
-+ memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
-+ if(!*memb_ptr2) {
-+ ASN_DEBUG("Element %s %d not present",
-+ elm->name, edx);
-+ if(elm->optional)
-+ continue;
-+ /* Mandatory element is missing */
-+ _ASN_ENCODE_FAILED;
-+ }
-+ } else {
-+ memb_ptr = (void *)((char *)sptr + elm->memb_offset);
-+ memb_ptr2 = &memb_ptr;
-+ }
-+
-+ /* Eliminate default values */
-+ if(elm->default_value && elm->default_value(0, memb_ptr2) == 1)
-+ continue;
-+
-+ ASN_DEBUG("Encoding %s->%s", td->name, elm->name);
-+ er = elm->type->aper_encoder(elm->type, elm->per_constraints,
-+ *memb_ptr2, po);
-+ if(er.encoded == -1)
-+ return er;
-+ }
-+
-+ /* No extensions to encode */
-+ if(!n_extensions) _ASN_ENCODED_OK(er);
-+
-+ ASN_DEBUG("Length of %d bit-map", n_extensions);
-+ /* #18.8. Write down the presence bit-map length. */
-+ if(aper_put_nslength(po, n_extensions))
-+ _ASN_ENCODE_FAILED;
-+
-+ ASN_DEBUG("Bit-map of %d elements", n_extensions);
-+ /* #18.7. Encoding the extensions presence bit-map. */
-+ /* TODO: act upon NOTE in #18.7 for canonical PER */
-+ if(SEQUENCE_handle_extensions(td, sptr, po, 0) != n_extensions)
-+ _ASN_ENCODE_FAILED;
-+
-+ ASN_DEBUG("Writing %d extensions", n_extensions);
-+ /* #18.9. Encode extensions as open type fields. */
-+ if(SEQUENCE_handle_extensions(td, sptr, 0, po) != n_extensions)
-+ _ASN_ENCODE_FAILED;
-+
-+ _ASN_ENCODED_OK(er);
-+}
-Index: skeletons/INTEGER.h
-===================================================================
---- skeletons/INTEGER.h (revision 1516)
-+++ skeletons/INTEGER.h (working copy)
-@@ -41,6 +41,8 @@
- xer_type_encoder_f INTEGER_encode_xer;
- per_type_decoder_f INTEGER_decode_uper;
- per_type_encoder_f INTEGER_encode_uper;
-+per_type_decoder_f INTEGER_decode_aper;
-+per_type_encoder_f INTEGER_encode_aper;
-
- /***********************************
- * Some handy conversion routines. *
-@@ -52,8 +54,12 @@
- * -1/ERANGE: Value encoded is out of range for long representation
- * -1/ENOMEM: Memory allocation failed (in asn_long2INTEGER()).
- */
-+int asn_INTEGER2int64(const INTEGER_t *i, int64_t *l);
-+int asn_INTEGER2uint64(const INTEGER_t *i, uint64_t *l);
- int asn_INTEGER2long(const INTEGER_t *i, long *l);
- int asn_INTEGER2ulong(const INTEGER_t *i, unsigned long *l);
-+int asn_int642INTEGER(INTEGER_t *i, int64_t l);
-+int asn_uint642INTEGER(INTEGER_t *i, uint64_t l);
- int asn_long2INTEGER(INTEGER_t *i, long l);
- int asn_ulong2INTEGER(INTEGER_t *i, unsigned long l);
-
-Index: skeletons/OCTET_STRING.c
-===================================================================
---- skeletons/OCTET_STRING.c (revision 1516)
-+++ skeletons/OCTET_STRING.c (working copy)
-@@ -36,6 +36,8 @@
- OCTET_STRING_encode_xer,
- OCTET_STRING_decode_uper, /* Unaligned PER decoder */
- OCTET_STRING_encode_uper, /* Unaligned PER encoder */
-+ OCTET_STRING_decode_aper, /* Aligned PER decoder */
-+ OCTET_STRING_encode_aper, /* Aligned PER encoder */
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_OCTET_STRING_tags,
- sizeof(asn_DEF_OCTET_STRING_tags)
-@@ -86,7 +88,7 @@
- void *ptr; \
- /* Be nice and round to the memory allocator */ \
- do { _ns = _ns ? _ns << 1 : 16; } \
-- while(_ns <= _es); \
-+ while(_ns <= _es); \
- /* int is really a typeof(st->size): */ \
- if((int)_ns < 0) RETURN(RC_FAIL); \
- ptr = REALLOC(st->buf, _ns); \
-@@ -195,7 +197,7 @@
- }
-
- /* Restore parsing context */
-- ctx = (asn_struct_ctx_t *)((void *)st + specs->ctx_offset);
-+ ctx = (asn_struct_ctx_t *)((char *)st + specs->ctx_offset);
-
- switch(ctx->phase) {
- case 0:
-@@ -416,7 +418,7 @@
- ASN_DEBUG("Phase 2: Need %ld bytes, size=%ld, alrg=%ld, wn=%d",
- (long)sel->left, (long)size, (long)sel->got,
- sel->want_nulls);
-- {
-+ {
- ber_tlv_len_t len;
-
- assert(sel->left >= 0);
-@@ -446,7 +448,7 @@
-
- PREV_PHASE(ctx);
- goto phase1;
-- }
-+ }
- break;
- case 3:
- phase3:
-@@ -1143,7 +1145,7 @@
- }
-
- /* Restore parsing context */
-- ctx = (asn_struct_ctx_t *)(((void *)*sptr) + specs->ctx_offset);
-+ ctx = (asn_struct_ctx_t *)(((char *)*sptr) + specs->ctx_offset);
-
- return xer_decode_general(opt_codec_ctx, ctx, *sptr, xml_tag,
- buf_ptr, size, opt_unexpected_tag_decoder, body_receiver);
-@@ -1392,7 +1394,7 @@
- if(!st) RETURN(RC_FAIL);
- }
-
-- ASN_DEBUG("PER Decoding %s size %ld .. %ld bits %d",
-+ ASN_DEBUG("PER Decoding %s size %"PRIdMAX" .. %"PRIdMAX" bits %d",
- csiz->flags & APC_EXTENSIBLE ? "extensible" : "non-extensible",
- csiz->lower_bound, csiz->upper_bound, csiz->effective_bits);
-
-@@ -1423,17 +1425,17 @@
- if(csiz->effective_bits == 0) {
- int ret;
- if(bpc) {
-- ASN_DEBUG("Encoding OCTET STRING size %ld",
-+ ASN_DEBUG("Encoding OCTET STRING size %"PRIdMAX,
- csiz->upper_bound);
- ret = OCTET_STRING_per_get_characters(pd, st->buf,
- csiz->upper_bound, bpc, unit_bits,
- cval->lower_bound, cval->upper_bound, pc);
- if(ret > 0) RETURN(RC_FAIL);
- } else {
-- ASN_DEBUG("Encoding BIT STRING size %ld",
-+ ASN_DEBUG("Encoding BIT STRING size %"PRIdMAX,
- csiz->upper_bound);
- ret = per_get_many_bits(pd, st->buf, 0,
-- unit_bits * csiz->upper_bound);
-+ unit_bits * csiz->upper_bound);
- }
- if(ret < 0) RETURN(RC_WMORE);
- consumed_myself += unit_bits * csiz->upper_bound;
-@@ -1492,9 +1494,197 @@
- return rval;
- }
-
-+asn_dec_rval_t
-+OCTET_STRING_decode_aper(asn_codec_ctx_t *opt_codec_ctx,
-+ asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints,
-+ void **sptr, asn_per_data_t *pd) {
-+
-+ asn_OCTET_STRING_specifics_t *specs = td->specifics
-+ ? (asn_OCTET_STRING_specifics_t *)td->specifics
-+ : &asn_DEF_OCTET_STRING_specs;
-+ asn_per_constraints_t *pc = constraints ? constraints
-+ : td->per_constraints;
-+ asn_per_constraint_t *cval;
-+ asn_per_constraint_t *csiz;
-+ asn_dec_rval_t rval = { RC_OK, 0 };
-+ BIT_STRING_t *st = (BIT_STRING_t *)*sptr;
-+ ssize_t consumed_myself = 0;
-+ int repeat;
-+ enum {
-+ OS__BPC_BIT = 0,
-+ OS__BPC_CHAR = 1,
-+ OS__BPC_U16 = 2,
-+ OS__BPC_U32 = 4
-+ } bpc; /* Bytes per character */
-+ unsigned int unit_bits;
-+ unsigned int canonical_unit_bits;
-+
-+ (void)opt_codec_ctx;
-+
-+ if(pc) {
-+ cval = &pc->value;
-+ csiz = &pc->size;
-+ } else {
-+ cval = &asn_DEF_OCTET_STRING_constraints.value;
-+ csiz = &asn_DEF_OCTET_STRING_constraints.size;
-+ }
-+
-+ switch(specs->subvariant) {
-+ default:
-+// case ASN_OSUBV_ANY:
-+// ASN_DEBUG("Unrecognized subvariant %d", specs->subvariant);
-+// RETURN(RC_FAIL);
-+ case ASN_OSUBV_BIT:
-+ canonical_unit_bits = unit_bits = 1;
-+ bpc = OS__BPC_BIT;
-+ break;
-+ case ASN_OSUBV_ANY:
-+ case ASN_OSUBV_STR:
-+ canonical_unit_bits = unit_bits = 8;
-+// if(cval->flags & APC_CONSTRAINED)
-+// unit_bits = cval->range_bits;
-+ bpc = OS__BPC_CHAR;
-+ break;
-+ case ASN_OSUBV_U16:
-+ canonical_unit_bits = unit_bits = 16;
-+ if(cval->flags & APC_CONSTRAINED)
-+ unit_bits = cval->range_bits;
-+ bpc = OS__BPC_U16;
-+ break;
-+ case ASN_OSUBV_U32:
-+ canonical_unit_bits = unit_bits = 32;
-+ if(cval->flags & APC_CONSTRAINED)
-+ unit_bits = cval->range_bits;
-+ bpc = OS__BPC_U32;
-+ break;
-+ }
-+
-+ /*
-+ * Allocate the string.
-+ */
-+ if(!st) {
-+ st = (BIT_STRING_t *)(*sptr = CALLOC(1, specs->struct_size));
-+ if(!st) RETURN(RC_FAIL);
-+ }
-+
-+ ASN_DEBUG("PER Decoding %s size %"PRIdMAX" .. %"PRIdMAX" bits %d",
-+ csiz->flags & APC_EXTENSIBLE ? "extensible" : "non-extensible",
-+ csiz->lower_bound, csiz->upper_bound, csiz->effective_bits);
-+
-+ if(csiz->flags & APC_EXTENSIBLE) {
-+ int inext = per_get_few_bits(pd, 1);
-+ if(inext < 0) RETURN(RC_WMORE);
-+ if(inext) {
-+ csiz = &asn_DEF_OCTET_STRING_constraints.size;
-+ cval = &asn_DEF_OCTET_STRING_constraints.value;
-+ unit_bits = canonical_unit_bits;
-+ }
-+ }
-+
-+ if(csiz->effective_bits >= 0) {
-+ FREEMEM(st->buf);
-+ if(bpc) {
-+ st->size = csiz->upper_bound * bpc;
-+ } else {
-+ st->size = (csiz->upper_bound + 7) >> 3;
-+ }
-+ st->buf = (uint8_t *)MALLOC(st->size + 1);
-+ if(!st->buf) { st->size = 0; RETURN(RC_FAIL); }
-+ }
-+
-+ /* X.691, #16.5: zero-length encoding */
-+ /* X.691, #16.6: short fixed length encoding (up to 2 octets) */
-+ /* X.691, #16.7: long fixed length encoding (up to 64K octets) */
-+ if(csiz->effective_bits == 0) {
-+ int ret;
-+ if (st->size > 2) { /* X.691 #16 NOTE 1 */
-+ if (aper_get_align(pd) < 0)
-+ RETURN(RC_FAIL);
-+ }
-+ if(bpc) {
-+ ASN_DEBUG("Decoding OCTET STRING size %"PRIdMAX,
-+ csiz->upper_bound);
-+ ret = OCTET_STRING_per_get_characters(pd, st->buf,
-+ csiz->upper_bound, bpc, unit_bits,
-+ cval->lower_bound, cval->upper_bound, pc);
-+ if(ret > 0) RETURN(RC_FAIL);
-+ } else {
-+ ASN_DEBUG("Decoding BIT STRING size %"PRIdMAX,
-+ csiz->upper_bound);
-+ ret = per_get_many_bits(pd, st->buf, 0,
-+ unit_bits * csiz->upper_bound);
-+ }
-+ if(ret < 0) RETURN(RC_WMORE);
-+ consumed_myself += unit_bits * csiz->upper_bound;
-+ st->buf[st->size] = 0;
-+ if(bpc == 0) {
-+ int ubs = (csiz->upper_bound & 0x7);
-+ st->bits_unused = ubs ? 8 - ubs : 0;
-+ }
-+ RETURN(RC_OK);
-+ }
-+
-+ st->size = 0;
-+ do {
-+ ssize_t raw_len;
-+ ssize_t len_bytes;
-+ ssize_t len_bits;
-+ void *p;
-+ int ret;
-+
-+ /* Get the PER length */
-+ if (csiz->upper_bound - csiz->lower_bound == 0)
-+ // Indefinite length case
-+ raw_len = aper_get_length(pd, -1, csiz->effective_bits, &repeat);
-+ else
-+ raw_len = aper_get_length(pd, csiz->upper_bound - csiz->lower_bound + 1, csiz->effective_bits, &repeat);
-+ repeat = 0;
-+ if(raw_len < 0) RETURN(RC_WMORE);
-+ raw_len += csiz->lower_bound;
-+
-+ ASN_DEBUG("Got PER length eb %ld, len %ld, %s (%s)",
-+ (long)csiz->effective_bits, (long)raw_len,
-+ repeat ? "repeat" : "once", td->name);
-+
-+ if (raw_len > 2) { /* X.691 #16 NOTE 1 */
-+ if (aper_get_align(pd) < 0)
-+ RETURN(RC_FAIL);
-+ }
-+
-+ if(bpc) {
-+ len_bytes = raw_len * bpc;
-+ len_bits = len_bytes * unit_bits;
-+ } else {
-+ len_bits = raw_len;
-+ len_bytes = (len_bits + 7) >> 3;
-+ if(len_bits & 0x7)
-+ st->bits_unused = 8 - (len_bits & 0x7);
-+ /* len_bits be multiple of 16K if repeat is set */
-+ }
-+ p = REALLOC(st->buf, st->size + len_bytes + 1);
-+ if(!p) RETURN(RC_FAIL);
-+ st->buf = (uint8_t *)p;
-+
-+ if(bpc) {
-+ ret = OCTET_STRING_per_get_characters(pd,
-+ &st->buf[st->size], raw_len, bpc, unit_bits,
-+ cval->lower_bound, cval->upper_bound, pc);
-+ if(ret > 0) RETURN(RC_FAIL);
-+ } else {
-+ ret = per_get_many_bits(pd, &st->buf[st->size],
-+ 0, len_bits);
-+ }
-+ if(ret < 0) RETURN(RC_WMORE);
-+ st->size += len_bytes;
-+ } while(repeat);
-+ st->buf[st->size] = 0; /* nul-terminate */
-+
-+ return rval;
-+}
-+
- asn_enc_rval_t
- OCTET_STRING_encode_uper(asn_TYPE_descriptor_t *td,
-- asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-+ asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-
- asn_OCTET_STRING_specifics_t *specs = td->specifics
- ? (asn_OCTET_STRING_specifics_t *)td->specifics
-@@ -1566,7 +1756,7 @@
- }
-
- ASN_DEBUG("Encoding %s into %d units of %d bits"
-- " (%ld..%ld, effective %d)%s",
-+ " (%"PRIdMAX"..%"PRIdMAX", effective %d)%s",
- td->name, sizeinunits, unit_bits,
- csiz->lower_bound, csiz->upper_bound,
- csiz->effective_bits, ct_extensible ? " EXT" : "");
-@@ -1598,7 +1788,7 @@
- /* X.691, #16.6: short fixed length encoding (up to 2 octets) */
- /* X.691, #16.7: long fixed length encoding (up to 64K octets) */
- if(csiz->effective_bits >= 0) {
-- ASN_DEBUG("Encoding %d bytes (%ld), length in %d bits",
-+ ASN_DEBUG("Encoding %d bytes (%"PRIdMAX"), length in %d bits",
- st->size, sizeinunits - csiz->lower_bound,
- csiz->effective_bits);
- ret = per_put_few_bits(po, sizeinunits - csiz->lower_bound,
-@@ -1652,6 +1842,173 @@
- _ASN_ENCODED_OK(er);
- }
-
-+asn_enc_rval_t
-+OCTET_STRING_encode_aper(asn_TYPE_descriptor_t *td,
-+ asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-+
-+ asn_OCTET_STRING_specifics_t *specs = td->specifics
-+ ? (asn_OCTET_STRING_specifics_t *)td->specifics
-+ : &asn_DEF_OCTET_STRING_specs;
-+ asn_per_constraints_t *pc = constraints ? constraints
-+ : td->per_constraints;
-+ asn_per_constraint_t *cval;
-+ asn_per_constraint_t *csiz;
-+ const BIT_STRING_t *st = (const BIT_STRING_t *)sptr;
-+ asn_enc_rval_t er = { 0, 0, 0 };
-+ int inext = 0; /* Lies not within extension root */
-+ unsigned int unit_bits;
-+ unsigned int canonical_unit_bits;
-+ unsigned int sizeinunits;
-+ const uint8_t *buf;
-+ int ret;
-+ enum {
-+ OS__BPC_BIT = 0,
-+ OS__BPC_CHAR = 1,
-+ OS__BPC_U16 = 2,
-+ OS__BPC_U32 = 4
-+ } bpc; /* Bytes per character */
-+ int ct_extensible;
-+
-+ if(!st || (!st->buf && st->size))
-+ _ASN_ENCODE_FAILED;
-+
-+ if(pc) {
-+ cval = &pc->value;
-+ csiz = &pc->size;
-+ } else {
-+ cval = &asn_DEF_OCTET_STRING_constraints.value;
-+ csiz = &asn_DEF_OCTET_STRING_constraints.size;
-+ }
-+ ct_extensible = csiz->flags & APC_EXTENSIBLE;
-+
-+ switch(specs->subvariant) {
-+ default:
-+// case ASN_OSUBV_ANY:
-+// _ASN_ENCODE_FAILED;
-+ case ASN_OSUBV_BIT:
-+ canonical_unit_bits = unit_bits = 1;
-+ bpc = OS__BPC_BIT;
-+ sizeinunits = st->size * 8 - (st->bits_unused & 0x07);
-+ ASN_DEBUG("BIT STRING of %d bits",
-+ sizeinunits);
-+ break;
-+ case ASN_OSUBV_ANY:
-+ case ASN_OSUBV_STR:
-+ canonical_unit_bits = unit_bits = 8;
-+// if(cval->flags & APC_CONSTRAINED)
-+// unit_bits = 8;
-+ bpc = OS__BPC_CHAR;
-+ sizeinunits = st->size;
-+ break;
-+ case ASN_OSUBV_U16:
-+ canonical_unit_bits = unit_bits = 16;
-+ if(cval->flags & APC_CONSTRAINED)
-+ unit_bits = cval->range_bits;
-+ bpc = OS__BPC_U16;
-+ sizeinunits = st->size / 2;
-+ break;
-+ case ASN_OSUBV_U32:
-+ canonical_unit_bits = unit_bits = 32;
-+ if(cval->flags & APC_CONSTRAINED)
-+ unit_bits = cval->range_bits;
-+ bpc = OS__BPC_U32;
-+ sizeinunits = st->size / 4;
-+ break;
-+ }
-+
-+ ASN_DEBUG("Encoding %s into %d units of %d bits"
-+ " (%"PRIdMAX"..%"PRIdMAX", effective %d)%s",
-+ td->name, sizeinunits, unit_bits,
-+ csiz->lower_bound, csiz->upper_bound,
-+ csiz->effective_bits, ct_extensible ? " EXT" : "");
-+
-+ /* Figure out wheter size lies within PER visible constraint */
-+
-+ if(csiz->effective_bits >= 0) {
-+ if((int)sizeinunits < csiz->lower_bound
-+ || (int)sizeinunits > csiz->upper_bound) {
-+ if(ct_extensible) {
-+ cval = &asn_DEF_OCTET_STRING_constraints.value;
-+ csiz = &asn_DEF_OCTET_STRING_constraints.size;
-+ unit_bits = canonical_unit_bits;
-+ inext = 1;
-+ } else
-+ _ASN_ENCODE_FAILED;
-+ }
-+ } else {
-+ inext = 0;
-+ }
-+
-+
-+ if(ct_extensible) {
-+ /* Declare whether length is [not] within extension root */
-+ if(per_put_few_bits(po, inext, 1))
-+ _ASN_ENCODE_FAILED;
-+ }
-+
-+ /* X.691, #16.5: zero-length encoding */
-+ /* X.691, #16.6: short fixed length encoding (up to 2 octets) */
-+ /* X.691, #16.7: long fixed length encoding (up to 64K octets) */
-+ if(csiz->effective_bits >= 0) {
-+ ASN_DEBUG("Encoding %d bytes (%"PRIdMAX"), length in %d bits",
-+ st->size, sizeinunits - csiz->lower_bound,
-+ csiz->effective_bits);
-+ ret = per_put_few_bits(po, sizeinunits - csiz->lower_bound,
-+ csiz->effective_bits);
-+ if(ret) _ASN_ENCODE_FAILED;
-+ if (st->size > 2) { /* X.691 #16 NOTE 1 */
-+ if (aper_put_align(po) < 0)
-+ _ASN_ENCODE_FAILED;
-+ }
-+ if(bpc) {
-+ ret = OCTET_STRING_per_put_characters(po, st->buf,
-+ sizeinunits, bpc, unit_bits,
-+ cval->lower_bound, cval->upper_bound, pc);
-+ } else {
-+ ret = per_put_many_bits(po, st->buf,
-+ sizeinunits * unit_bits);
-+ }
-+ if(ret) _ASN_ENCODE_FAILED;
-+ _ASN_ENCODED_OK(er);
-+ }
-+
-+ ASN_DEBUG("Encoding %d bytes", st->size);
-+
-+ if(sizeinunits == 0) {
-+ if(aper_put_length(po, -1, 0))
-+ _ASN_ENCODE_FAILED;
-+ _ASN_ENCODED_OK(er);
-+ }
-+
-+ buf = st->buf;
-+ while(sizeinunits) {
-+ ssize_t maySave = aper_put_length(po, -1, sizeinunits);
-+
-+ if(maySave < 0) _ASN_ENCODE_FAILED;
-+
-+ ASN_DEBUG("Encoding %ld of %ld",
-+ (long)maySave, (long)sizeinunits);
-+
-+ if(bpc) {
-+ ret = OCTET_STRING_per_put_characters(po, buf,
-+ maySave, bpc, unit_bits,
-+ cval->lower_bound, cval->upper_bound, pc);
-+ } else {
-+ ret = per_put_many_bits(po, buf, maySave * unit_bits);
-+ }
-+ if(ret) _ASN_ENCODE_FAILED;
-+
-+ if(bpc)
-+ buf += maySave * bpc;
-+ else
-+ buf += maySave >> 3;
-+ sizeinunits -= maySave;
-+ assert(!(maySave & 0x07) || !sizeinunits);
-+ }
-+
-+ _ASN_ENCODED_OK(er);
-+}
-+
- int
- OCTET_STRING_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel,
- asn_app_consume_bytes_f *cb, void *app_key) {
-@@ -1716,7 +2073,7 @@
- ? (asn_OCTET_STRING_specifics_t *)td->specifics
- : &asn_DEF_OCTET_STRING_specs;
- asn_struct_ctx_t *ctx = (asn_struct_ctx_t *)
-- ((void *)st + specs->ctx_offset);
-+ ((char *)st + specs->ctx_offset);
- struct _stack *stck;
-
- if(!td || !st)
-Index: skeletons/BIT_STRING.c
-===================================================================
---- skeletons/BIT_STRING.c (revision 1516)
-+++ skeletons/BIT_STRING.c (working copy)
-@@ -29,6 +29,8 @@
- BIT_STRING_encode_xer,
- OCTET_STRING_decode_uper, /* Unaligned PER decoder */
- OCTET_STRING_encode_uper, /* Unaligned PER encoder */
-+ OCTET_STRING_decode_aper, /* Aligned PER decoder */
-+ OCTET_STRING_encode_aper, /* Aligned PER encoder */
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_BIT_STRING_tags,
- sizeof(asn_DEF_BIT_STRING_tags)
-Index: skeletons/NativeInteger.c
-===================================================================
---- skeletons/NativeInteger.c (revision 1516)
-+++ skeletons/NativeInteger.c (working copy)
-@@ -31,6 +31,8 @@
- NativeInteger_encode_xer,
- NativeInteger_decode_uper, /* Unaligned PER decoder */
- NativeInteger_encode_uper, /* Unaligned PER encoder */
-+ NativeInteger_decode_aper, /* Aligned PER decoder */
-+ NativeInteger_encode_aper, /* Aligned PER encoder */
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_NativeInteger_tags,
- sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]),
-@@ -267,6 +269,46 @@
- return rval;
- }
-
-+asn_dec_rval_t
-+NativeInteger_decode_aper(asn_codec_ctx_t *opt_codec_ctx,
-+ asn_TYPE_descriptor_t *td,
-+ asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
-+
-+ asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics;
-+ asn_dec_rval_t rval;
-+ long *native = (long *)*sptr;
-+ INTEGER_t tmpint;
-+ void *tmpintptr = &tmpint;
-+ int dynamic = 0;
-+
-+ (void)opt_codec_ctx;
-+ ASN_DEBUG("Decoding NativeInteger %s (APER)", td->name);
-+
-+ if(!native) {
-+ native = (long *)(*sptr = CALLOC(1, sizeof(*native)));
-+ dynamic = 1;
-+ if(!native) _ASN_DECODE_FAILED;
-+ }
-+
-+ memset(&tmpint, 0, sizeof tmpint);
-+ rval = INTEGER_decode_aper(opt_codec_ctx, td, constraints,
-+ &tmpintptr, pd);
-+ if(rval.code == RC_OK) {
-+ if((specs&&specs->field_unsigned)
-+ ? asn_INTEGER2ulong(&tmpint, (unsigned long *)native)
-+ : asn_INTEGER2long(&tmpint, native))
-+ rval.code = RC_FAIL;
-+ else
-+ ASN_DEBUG("NativeInteger %s got value %ld",
-+ td->name, *native);
-+ }
-+ ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
-+ //if (dynamic)
-+ // free(native);
-+
-+ return rval;
-+}
-+
- asn_enc_rval_t
- NativeInteger_encode_uper(asn_TYPE_descriptor_t *td,
- asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-@@ -291,6 +333,44 @@
- return er;
- }
-
-+asn_enc_rval_t
-+NativeInteger_encode_aper(
-+ asn_TYPE_descriptor_t *td,
-+ asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-+
-+ asn_INTEGER_specifics_t *specs=(asn_INTEGER_specifics_t *)td->specifics;
-+ asn_enc_rval_t er;
-+ INTEGER_t tmpint;
-+
-+ if(!sptr) _ASN_ENCODE_FAILED;
-+ memset(&tmpint, 0, sizeof(tmpint));
-+
-+ if(specs&&specs->field_unsigned) {
-+ unsigned long native;
-+ native = *(unsigned long *)sptr;
-+
-+ ASN_DEBUG("Encoding NativeInteger %s %lu (APER) (unsigned)", td->name, native);
-+
-+ if(asn_ulong2INTEGER(&tmpint, native))
-+ _ASN_ENCODE_FAILED;
-+ } else {
-+ long native;
-+ native = *(long *)sptr;
-+
-+ ASN_DEBUG("Encoding NativeInteger %s %ld (APER) (unsigned)", td->name, native);
-+ if(asn_long2INTEGER(&tmpint, native))
-+ _ASN_ENCODE_FAILED;
-+ }
-+
-+// if((specs&&specs->field_unsigned)
-+// ? asn_ulong2INTEGER(&tmpint, native)
-+// : asn_long2INTEGER(&tmpint, native))
-+// _ASN_ENCODE_FAILED;
-+ er = INTEGER_encode_aper(td, constraints, &tmpint, po);
-+ ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_INTEGER, &tmpint);
-+ return er;
-+}
-+
- /*
- * INTEGER specific human-readable output.
- */
-Index: skeletons/constr_SEQUENCE.h
-===================================================================
---- skeletons/constr_SEQUENCE.h (revision 1516)
-+++ skeletons/constr_SEQUENCE.h (working copy)
-@@ -52,6 +52,8 @@
- xer_type_encoder_f SEQUENCE_encode_xer;
- per_type_decoder_f SEQUENCE_decode_uper;
- per_type_encoder_f SEQUENCE_encode_uper;
-+per_type_decoder_f SEQUENCE_decode_aper;
-+per_type_encoder_f SEQUENCE_encode_aper;
-
- #ifdef __cplusplus
- }
-Index: skeletons/NativeInteger.h
-===================================================================
---- skeletons/NativeInteger.h (revision 1516)
-+++ skeletons/NativeInteger.h (working copy)
-@@ -29,6 +29,8 @@
- xer_type_encoder_f NativeInteger_encode_xer;
- per_type_decoder_f NativeInteger_decode_uper;
- per_type_encoder_f NativeInteger_encode_uper;
-+per_type_decoder_f NativeInteger_decode_aper;
-+per_type_encoder_f NativeInteger_encode_aper;
-
- #ifdef __cplusplus
- }
-Index: skeletons/OCTET_STRING.h
-===================================================================
---- skeletons/OCTET_STRING.h (revision 1516)
-+++ skeletons/OCTET_STRING.h (working copy)
-@@ -32,6 +32,8 @@
- xer_type_encoder_f OCTET_STRING_encode_xer_utf8;
- per_type_decoder_f OCTET_STRING_decode_uper;
- per_type_encoder_f OCTET_STRING_encode_uper;
-+per_type_decoder_f OCTET_STRING_decode_aper;
-+per_type_encoder_f OCTET_STRING_encode_aper;
-
- /******************************
- * Handy conversion routines. *
-Index: skeletons/UTCTime.c
-===================================================================
---- skeletons/UTCTime.c (revision 1516)
-+++ skeletons/UTCTime.c (working copy)
-@@ -40,6 +40,8 @@
- UTCTime_encode_xer,
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
-+ OCTET_STRING_decode_aper,
-+ OCTET_STRING_encode_aper,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_UTCTime_tags,
- sizeof(asn_DEF_UTCTime_tags)
-Index: skeletons/REAL.c
-===================================================================
---- skeletons/REAL.c (revision 1516)
-+++ skeletons/REAL.c (working copy)
-@@ -45,6 +45,8 @@
- REAL_encode_xer,
- REAL_decode_uper,
- REAL_encode_uper,
-+ REAL_decode_aper,
-+ REAL_encode_aper,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_REAL_tags,
- sizeof(asn_DEF_REAL_tags) / sizeof(asn_DEF_REAL_tags[0]),
-@@ -361,6 +363,21 @@
- return OCTET_STRING_encode_uper(td, 0, sptr, po);
- }
-
-+asn_dec_rval_t
-+REAL_decode_aper(asn_codec_ctx_t *opt_codec_ctx,
-+ asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints,
-+ void **sptr, asn_per_data_t *pd) {
-+ (void)constraints; /* No PER visible constraints */
-+ return OCTET_STRING_decode_aper(opt_codec_ctx, td, 0, sptr, pd);
-+}
-+
-+asn_enc_rval_t
-+REAL_encode_aper(asn_TYPE_descriptor_t *td,
-+ asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-+ (void)constraints; /* No PER visible constraints */
-+ return OCTET_STRING_encode_aper(td, 0, sptr, po);
-+}
-+
- int
- asn_REAL2double(const REAL_t *st, double *dbl_value) {
- unsigned int octv;
-Index: skeletons/VisibleString.c
-===================================================================
---- skeletons/VisibleString.c (revision 1516)
-+++ skeletons/VisibleString.c (working copy)
-@@ -29,6 +29,8 @@
- OCTET_STRING_encode_xer_utf8,
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
-+ OCTET_STRING_decode_aper,
-+ OCTET_STRING_encode_aper,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_VisibleString_tags,
- sizeof(asn_DEF_VisibleString_tags)
-Index: skeletons/ANY.c
-===================================================================
---- skeletons/ANY.c (revision 1516)
-+++ skeletons/ANY.c (working copy)
-@@ -21,7 +21,10 @@
- OCTET_STRING_encode_der,
- OCTET_STRING_decode_xer_hex,
- ANY_encode_xer,
-- 0, 0,
-+ OCTET_STRING_decode_uper,
-+ OCTET_STRING_encode_uper,
-+ OCTET_STRING_decode_aper,
-+ OCTET_STRING_encode_aper,
- 0, /* Use generic outmost tag fetcher */
- 0, 0, 0, 0,
- 0, /* No PER visible constraints */
-@@ -87,6 +90,37 @@
- return 0;
- }
-
-+int
-+ANY_fromType_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr) {
-+ uint8_t *buffer = NULL;
-+ ssize_t erval;
-+
-+ if(!st || !td) {
-+ errno = EINVAL;
-+ return -1;
-+ }
-+
-+ if(!sptr) {
-+ if(st->buf) FREEMEM(st->buf);
-+ st->size = 0;
-+ return 0;
-+ }
-+
-+ erval = aper_encode_to_new_buffer(td, td->per_constraints, sptr, (void**)&buffer);
-+
-+ if(erval == -1) {
-+ if(buffer) FREEMEM(buffer);
-+ return -1;
-+ }
-+ assert((size_t)erval > 0);
-+
-+ if(st->buf) FREEMEM(st->buf);
-+ st->buf = buffer;
-+ st->size = erval;
-+
-+ return 0;
-+}
-+
- ANY_t *
- ANY_new_fromType(asn_TYPE_descriptor_t *td, void *sptr) {
- ANY_t tmp;
-@@ -111,6 +145,30 @@
- }
- }
-
-+ANY_t *
-+ANY_new_fromType_aper(asn_TYPE_descriptor_t *td, void *sptr) {
-+ ANY_t tmp;
-+ ANY_t *st;
-+
-+ if(!td || !sptr) {
-+ errno = EINVAL;
-+ return 0;
-+ }
-+
-+ memset(&tmp, 0, sizeof(tmp));
-+
-+ if(ANY_fromType_aper(&tmp, td, sptr)) return 0;
-+
-+ st = (ANY_t *)CALLOC(1, sizeof(ANY_t));
-+ if(st) {
-+ *st = tmp;
-+ return st;
-+ } else {
-+ FREEMEM(tmp.buf);
-+ return 0;
-+ }
-+}
-+
- int
- ANY_to_type(ANY_t *st, asn_TYPE_descriptor_t *td, void **struct_ptr) {
- asn_dec_rval_t rval;
-@@ -138,6 +196,33 @@
- }
- }
-
-+int
-+ANY_to_type_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void **struct_ptr) {
-+ asn_dec_rval_t rval;
-+ void *newst = 0;
-+
-+ if(!st || !td || !struct_ptr) {
-+ errno = EINVAL;
-+ return -1;
-+ }
-+
-+ if(st->buf == 0) {
-+ /* Nothing to convert, make it empty. */
-+ *struct_ptr = (void *)0;
-+ return 0;
-+ }
-+
-+ rval = aper_decode(0, td, (void **)&newst, st->buf, st->size, 0, 0);
-+ if(rval.code == RC_OK) {
-+ *struct_ptr = newst;
-+ return 0;
-+ } else {
-+ /* Remove possibly partially decoded data. */
-+ ASN_STRUCT_FREE(*td, newst);
-+ return -1;
-+ }
-+}
-+
- static int ANY__consume_bytes(const void *buffer, size_t size, void *key) {
- struct _callback_arg *arg = (struct _callback_arg *)key;
-
-Index: skeletons/REAL.h
-===================================================================
---- skeletons/REAL.h (revision 1516)
-+++ skeletons/REAL.h (working copy)
-@@ -21,6 +21,8 @@
- xer_type_encoder_f REAL_encode_xer;
- per_type_decoder_f REAL_decode_uper;
- per_type_encoder_f REAL_encode_uper;
-+per_type_decoder_f REAL_decode_aper;
-+per_type_encoder_f REAL_encode_aper;
-
- /***********************************
- * Some handy conversion routines. *
-Index: skeletons/NativeReal.c
-===================================================================
---- skeletons/NativeReal.c (revision 1516)
-+++ skeletons/NativeReal.c (working copy)
-@@ -32,6 +32,8 @@
- NativeReal_encode_xer,
- NativeReal_decode_uper,
- NativeReal_encode_uper,
-+ NativeReal_decode_aper,
-+ NativeReal_encode_aper,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_NativeReal_tags,
- sizeof(asn_DEF_NativeReal_tags) / sizeof(asn_DEF_NativeReal_tags[0]),
-@@ -123,11 +125,11 @@
- tmp.size = length;
- memcpy(tmp.buf, buf_ptr, length);
- tmp.buf[tmp.size] = '\0';
-- if(asn_REAL2double(&tmp, &d)) {
-- rval.code = RC_FAIL;
-- rval.consumed = 0;
-- return rval;
-- }
-+ if(asn_REAL2double(&tmp, &d)) {
-+ rval.code = RC_FAIL;
-+ rval.consumed = 0;
-+ return rval;
-+ }
- } else {
- /* This should probably never happen: impractically long value */
- tmp.buf = CALLOC(1, length + 1);
-@@ -228,6 +230,43 @@
- return rval;
- }
-
-+asn_dec_rval_t
-+NativeReal_decode_aper(asn_codec_ctx_t *opt_codec_ctx,
-+ asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints,
-+ void **dbl_ptr, asn_per_data_t *pd) {
-+ double *Dbl = (double *)*dbl_ptr;
-+ asn_dec_rval_t rval;
-+ REAL_t tmp;
-+ void *ptmp = &tmp;
-+ int ret;
-+
-+ (void)constraints;
-+
-+ /*
-+ * If the structure is not there, allocate it.
-+ */
-+ if(Dbl == NULL) {
-+ *dbl_ptr = CALLOC(1, sizeof(*Dbl));
-+ Dbl = (double *)*dbl_ptr;
-+ if(Dbl == NULL)
-+ _ASN_DECODE_FAILED;
-+ }
-+
-+ memset(&tmp, 0, sizeof(tmp));
-+ rval = OCTET_STRING_decode_aper(opt_codec_ctx, td, NULL,
-+ &ptmp, pd);
-+ if(rval.code != RC_OK) {
-+ ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_REAL, &tmp);
-+ return rval;
-+ }
-+
-+ ret = asn_REAL2double(&tmp, Dbl);
-+ ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_REAL, &tmp);
-+ if(ret) _ASN_DECODE_FAILED;
-+
-+ return rval;
-+}
-+
- /*
- * Encode the NativeReal using the OCTET STRING PER encoder.
- */
-@@ -257,6 +296,32 @@
- return erval;
- }
-
-+asn_enc_rval_t
-+NativeReal_encode_aper(asn_TYPE_descriptor_t *td,
-+ asn_per_constraints_t *constraints, void *sptr, asn_per_outp_t *po) {
-+ double Dbl = *(const double *)sptr;
-+ asn_enc_rval_t erval;
-+ REAL_t tmp;
-+
-+ (void)constraints;
-+
-+ /* Prepare a temporary clean structure */
-+ memset(&tmp, 0, sizeof(tmp));
-+
-+ if(asn_double2REAL(&tmp, Dbl))
-+ _ASN_ENCODE_FAILED;
-+
-+ /* Encode a DER REAL */
-+ erval = OCTET_STRING_encode_aper(td, NULL, &tmp, po);
-+ if(erval.encoded == -1)
-+ erval.structure_ptr = sptr;
-+
-+ /* Free possibly allocated members of the temporary structure */
-+ ASN_STRUCT_FREE_CONTENTS_ONLY(asn_DEF_REAL, &tmp);
-+
-+ return erval;
-+}
-+
- /*
- * Decode the chunk of XML text encoding REAL.
- */
-Index: skeletons/asn_system.h
-===================================================================
---- skeletons/asn_system.h (revision 1516)
-+++ skeletons/asn_system.h (working copy)
-@@ -21,6 +21,11 @@
- #include /* For va_start */
- #include /* for offsetof and ptrdiff_t */
-
-+#if HAVE_STDINT_H
-+# include
-+# include
-+#endif
-+
- #ifdef _WIN32
-
- #include
-Index: skeletons/ANY.h
-===================================================================
---- skeletons/ANY.h (revision 1516)
-+++ skeletons/ANY.h (working copy)
-@@ -32,10 +32,13 @@
-
- /* Convert another ASN.1 type into the ANY. This implies DER encoding. */
- int ANY_fromType(ANY_t *, asn_TYPE_descriptor_t *td, void *struct_ptr);
-+int ANY_fromType_aper(ANY_t *st, asn_TYPE_descriptor_t *td, void *sptr);
- ANY_t *ANY_new_fromType(asn_TYPE_descriptor_t *td, void *struct_ptr);
-+ANY_t *ANY_new_fromType_aper(asn_TYPE_descriptor_t *td, void *sptr);
-
- /* Convert the contents of the ANY type into the specified type. */
- int ANY_to_type(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr);
-+int ANY_to_type_aper(ANY_t *, asn_TYPE_descriptor_t *td, void **struct_ptr);
-
- #define ANY_fromBuf(s, buf, size) OCTET_STRING_fromBuf((s), (buf), (size))
- #define ANY_new_fromBuf(buf, size) OCTET_STRING_new_fromBuf( \
-Index: skeletons/NativeReal.h
-===================================================================
---- skeletons/NativeReal.h (revision 1516)
-+++ skeletons/NativeReal.h (working copy)
-@@ -27,6 +27,8 @@
- xer_type_encoder_f NativeReal_encode_xer;
- per_type_decoder_f NativeReal_decode_uper;
- per_type_encoder_f NativeReal_encode_uper;
-+per_type_decoder_f NativeReal_decode_aper;
-+per_type_encoder_f NativeReal_encode_aper;
-
- #ifdef __cplusplus
- }
-Index: skeletons/UniversalString.c
-===================================================================
---- skeletons/UniversalString.c (revision 1516)
-+++ skeletons/UniversalString.c (working copy)
-@@ -35,6 +35,8 @@
- UniversalString_encode_xer, /* Convert into UTF-8 */
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
-+ OCTET_STRING_decode_aper,
-+ OCTET_STRING_encode_aper,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_UniversalString_tags,
- sizeof(asn_DEF_UniversalString_tags)
-Index: skeletons/GraphicString.c
-===================================================================
---- skeletons/GraphicString.c (revision 1516)
-+++ skeletons/GraphicString.c (working copy)
-@@ -24,6 +24,8 @@
- OCTET_STRING_encode_xer, /* Can't expect it to be ASCII/UTF8 */
- OCTET_STRING_decode_uper, /* Implemented in terms of OCTET STRING */
- OCTET_STRING_encode_uper,
-+ OCTET_STRING_decode_aper,
-+ OCTET_STRING_encode_aper,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_GraphicString_tags,
- sizeof(asn_DEF_GraphicString_tags)
-Index: skeletons/GeneralizedTime.c
-===================================================================
---- skeletons/GeneralizedTime.c (revision 1516)
-+++ skeletons/GeneralizedTime.c (working copy)
-@@ -167,6 +167,8 @@
- GeneralizedTime_encode_xer,
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
-+ OCTET_STRING_decode_aper,
-+ OCTET_STRING_encode_aper,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_GeneralizedTime_tags,
- sizeof(asn_DEF_GeneralizedTime_tags)
-Index: libasn1compiler/asn1c_out.h
-===================================================================
---- libasn1compiler/asn1c_out.h (revision 1516)
-+++ libasn1compiler/asn1c_out.h (working copy)
-@@ -117,16 +117,24 @@
- * Format LONG_MIN according to C90 rules.
- */
- #define OINT(iv) do { \
-- if(iv == (-2147483647L - 1)) \
-+ if(iv > 4294967295U) \
-+ OUT("%" PRIdASN"ULL", iv); \
-+ else if(iv > 2147483647L) \
-+ OUT("%" PRIdASN"U", iv); \
-+ else if(iv == (-2147483647L - 1)) \
- OUT("(-2147483647L - 1)"); \
-- else \
-+ else \
- OUT("%" PRIdASN, iv); \
- } while(0)
-
- #define OINTS(iv) do { \
-- if(iv == (-2147483647L - 1)) \
-+ if(iv > 4294967295U) \
-+ OUT("%" PRIdASN"ULL", iv); \
-+ else if(iv > 2147483647L) \
-+ OUT("%" PRIdASN"U", iv); \
-+ else if(iv == (-2147483647L - 1)) \
- OUT("(-2147483647L - 1)"); \
-- else \
-+ else \
- OUT("% " PRIdASN, iv); \
- } while(0)
-
-Index: libasn1compiler/asn1compiler.h
-===================================================================
---- libasn1compiler/asn1compiler.h (revision 1516)
-+++ libasn1compiler/asn1compiler.h (working copy)
-@@ -77,7 +77,14 @@
- * -fline-refs
- * Include ASN.1 module's line numbers in comments.
- */
-- A1C_LINE_REFS = 0x20000
-+ A1C_LINE_REFS = 0x20000,
-+ /*
-+ * -fhave_native64
-+ * Assume target platform has native 64bits support and generate types using
-+ * int64_t or uint64_t whereas possible
-+ */
-+ A1C_HAVE_NATIVE_64 = 0x40000
-+
- };
-
- /*
-Index: libasn1compiler/asn1c_C.c
-===================================================================
---- libasn1compiler/asn1c_C.c (revision 1516)
-+++ libasn1compiler/asn1c_C.c (working copy)
-@@ -1242,6 +1242,8 @@
- OUT("td->xer_encoder = asn_DEF_%s.xer_encoder;\n", type_name);
- OUT("td->uper_decoder = asn_DEF_%s.uper_decoder;\n", type_name);
- OUT("td->uper_encoder = asn_DEF_%s.uper_encoder;\n", type_name);
-+ OUT("td->aper_decoder = asn_DEF_%s.aper_decoder;\n", type_name);
-+ OUT("td->aper_encoder = asn_DEF_%s.aper_encoder;\n", type_name);
- if(!terminal && !tags_count) {
- OUT("/* The next four lines are here because of -fknown-extern-type */\n");
- OUT("td->tags = asn_DEF_%s.tags;\n", type_name);
-@@ -1394,6 +1396,38 @@
- );
- OUT("}\n");
- OUT("\n");
-+
-+ p = MKID(expr);
-+ if(HIDE_INNER_DEFS) OUT("static ");
-+ OUT("asn_enc_rval_t\n");
-+ OUT("%s", p);
-+ if(HIDE_INNER_DEFS) OUT("_%d", expr->_type_unique_index);
-+ OUT("_encode_aper(asn_TYPE_descriptor_t *td,\n");
-+ INDENTED(
-+ OUT("\tasn_per_constraints_t *constraints,\n");
-+ OUT("\tvoid *structure, asn_per_outp_t *per_out) {\n");
-+ OUT("%s_%d_inherit_TYPE_descriptor(td);\n",
-+ p, expr->_type_unique_index);
-+ OUT("return td->aper_encoder(td, constraints, structure, per_out);\n");
-+ );
-+ OUT("}\n");
-+ OUT("\n");
-+
-+ p = MKID(expr);
-+
-+ if(HIDE_INNER_DEFS) OUT("static ");
-+ OUT("asn_dec_rval_t\n");
-+ OUT("%s", p);
-+ if(HIDE_INNER_DEFS) OUT("_%d", expr->_type_unique_index);
-+ OUT("_decode_aper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,\n");
-+ INDENTED(
-+ OUT("\tasn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {\n");
-+ OUT("%s_%d_inherit_TYPE_descriptor(td);\n",
-+ p, expr->_type_unique_index);
-+ OUT("return td->aper_decoder(opt_codec_ctx, td, constraints, structure, per_data);\n");
-+ );
-+ OUT("}\n");
-+ OUT("\n");
- }
-
- REDIR(OT_FUNC_DECLS);
-@@ -1415,6 +1449,8 @@
- if(arg->flags & A1C_GEN_PER) {
- OUT("per_type_decoder_f %s_decode_uper;\n", p);
- OUT("per_type_encoder_f %s_encode_uper;\n", p);
-+ OUT("per_type_decoder_f %s_decode_aper;\n", p);
-+ OUT("per_type_encoder_f %s_encode_aper;\n", p);
- }
- }
-
-@@ -1670,12 +1706,11 @@
- OUT("%d, ", tag2el[i].el_no);
- OUT("%d, ", tag2el[i].toff_first);
- OUT("%d ", tag2el[i].toff_last);
-- OUT("}%s /* %s",
-+ OUT("}%s /* %s at %d */\n",
- (i + 1 < tag2el_count) ? "," : "",
-- tag2el[i].from_expr->Identifier);
-- if(arg->flags & A1C_LINE_REFS)
-- OUT("at %d", tag2el[i].from_expr->_lineno);
-- OUT(" */\n");
-+ tag2el[i].from_expr->Identifier,
-+ tag2el[i].from_expr->_lineno
-+ );
- }
- OUT("};\n");
-
-@@ -2111,19 +2146,22 @@
- try_inline_default(arg_t *arg, asn1p_expr_t *expr, int out) {
- int save_target = arg->target->target;
- asn1p_expr_type_e etype = expr_get_type(arg, expr);
-- int fits_long = 0;
-+// int fits_long = 0;
-+ enum asn1c_fitslong_e fits = FL_NOTFIT;
-
- switch(etype) {
- case ASN_BASIC_BOOLEAN:
-- fits_long = 1;
-+// fits_long = 1;
-+ fits = FL_FITS_SIGNED;
- case ASN_BASIC_INTEGER:
- case ASN_BASIC_ENUMERATED:
- if(expr->marker.default_value == NULL
- || expr->marker.default_value->type != ATV_INTEGER)
- break;
-- if(!fits_long)
-- fits_long = asn1c_type_fits_long(arg, expr)!=FL_NOTFIT;
-- if(fits_long && !expr->marker.default_value->value.v_integer)
-+ if(fits == FL_NOTFIT)
-+// fits_long = asn1c_type_fits_long(arg, expr)!=FL_NOTFIT;
-+ fits = asn1c_type_fits_long(arg, expr);
-+ if(fits != FL_NOTFIT && !expr->marker.default_value->value.v_integer)
- expr->marker.flags &= ~EM_INDIRECT;
- if(!out) {
- OUT("asn_DFL_%d_set_%" PRIdASN
-@@ -2150,7 +2188,7 @@
- INDENT(+1);
- OUT("/* Install default value %" PRIdASN " */\n",
- expr->marker.default_value->value.v_integer);
-- if(fits_long) {
-+ if(fits != FL_NOTFIT) {
- OUT("*st = ");
- OINT(expr->marker.default_value->value.v_integer);
- OUT(";\n");
-@@ -2165,7 +2203,7 @@
- INDENT(+1);
- OUT("/* Test default value %" PRIdASN " */\n",
- expr->marker.default_value->value.v_integer);
-- if(fits_long) {
-+ if(fits != FL_NOTFIT) {
- OUT("return (*st == %" PRIdASN ");\n",
- expr->marker.default_value->value.v_integer);
- } else {
-@@ -2455,9 +2493,13 @@
- if(arg->flags & A1C_GEN_PER) {
- FUNCREF(decode_uper);
- FUNCREF(encode_uper);
-+ FUNCREF(decode_aper);
-+ FUNCREF(encode_aper);
- } else {
-- OUT("0, 0,\t/* No PER support, "
-+ OUT("0, 0,\t/* No UPER support, "
- "use \"-gen-PER\" to enable */\n");
-+ OUT("0, 0,\t/* No APER support, "
-+ "use \"-gen-PER\" to enable */\n");
- }
-
- if(!terminal || terminal->expr_type == ASN_CONSTR_CHOICE) {
-Index: libasn1compiler/asn1c_constraint.c
-===================================================================
---- libasn1compiler/asn1c_constraint.c (revision 1516)
-+++ libasn1compiler/asn1c_constraint.c (working copy)
-@@ -35,6 +35,7 @@
- int alphabet_table_compiled;
- int produce_st = 0;
- int ulong_optimize = 0;
-+ enum asn1c_fitslong_e fits = FL_NOTFIT;
-
- ct = expr->combined_constraints;
- if(ct == NULL)
-@@ -74,7 +75,8 @@
- switch(etype) {
- case ASN_BASIC_INTEGER:
- case ASN_BASIC_ENUMERATED:
-- if(asn1c_type_fits_long(arg, arg->expr) == FL_NOTFIT)
-+ fits = asn1c_type_fits_long(arg, arg->expr);
-+ if(fits == FL_NOTFIT)
- produce_st = 1;
- break;
- case ASN_BASIC_REAL:
-@@ -103,13 +105,19 @@
- switch(etype) {
- case ASN_BASIC_INTEGER:
- case ASN_BASIC_ENUMERATED:
-- if(native_long_sign(r_value) >= 0) {
-- ulong_optimize = ulong_optimization(etype, r_size, r_value);
-- if(!ulong_optimize) {
-- OUT("unsigned long value;\n");
-+ if(fits == FL_FITS_INT64) {
-+ OUT("int64_t value;\n");
-+ } else if(fits == FL_FITS_UINT64) {
-+ OUT("uint64_t value;\n");
-+ } else {
-+ if(native_long_sign(r_value) >= 0) {
-+ ulong_optimize = ulong_optimization(etype, r_size, r_value);
-+ if(!ulong_optimize) {
-+ OUT("unsigned long value;\n");
-+ }
-+ } else {
-+ OUT("long value;\n");
- }
-- } else {
-- OUT("long value;\n");
- }
- break;
- case ASN_BASIC_REAL:
-@@ -603,13 +611,19 @@
-
- static int
- emit_value_determination_code(arg_t *arg, asn1p_expr_type_e etype, asn1cnst_range_t *r_value) {
-+ enum asn1c_fitslong_e fits = FL_NOTFIT;
-
- switch(etype) {
- case ASN_BASIC_INTEGER:
- case ASN_BASIC_ENUMERATED:
-- if(asn1c_type_fits_long(arg, arg->expr) == FL_FITS_UNSIGN) {
-+ fits = asn1c_type_fits_long(arg, arg->expr);
-+ if(fits == FL_FITS_INT64) {
-+ OUT("value = *(const int64_t *)sptr;\n");
-+ } else if(fits == FL_FITS_UINT64) {
-+ OUT("value = *(const uint64_t *)sptr;\n");
-+ } else if(fits == FL_FITS_UNSIGN) {
- OUT("value = *(const unsigned long *)sptr;\n");
-- } else if(asn1c_type_fits_long(arg, arg->expr) != FL_NOTFIT) {
-+ } else if(fits != FL_NOTFIT) {
- OUT("value = *(const long *)sptr;\n");
- } else {
- /*
-Index: libasn1compiler/asn1c_misc.c
-===================================================================
---- libasn1compiler/asn1c_misc.c (revision 1516)
-+++ libasn1compiler/asn1c_misc.c (working copy)
-@@ -158,6 +158,7 @@
- asn1p_expr_t *terminal;
- int stdname = 0;
- char *typename;
-+ enum asn1c_fitslong_e fits;
-
- /* Rewind to the topmost parent expression */
- if((top_parent = expr->parent_expr))
-@@ -213,15 +214,20 @@
- case ASN_BASIC_INTEGER:
- case ASN_BASIC_ENUMERATED:
- case ASN_BASIC_REAL:
-+ fits = asn1c_type_fits_long(arg, expr);
- if((expr->expr_type == ASN_BASIC_REAL
- && !(arg->flags & A1C_USE_WIDE_TYPES))
-- || asn1c_type_fits_long(arg, expr)) {
-+ || (fits != FL_NOTFIT)) {
- switch(_format) {
- case TNF_CTYPE:
- case TNF_RSAFE:
- if(expr->expr_type == ASN_BASIC_REAL)
- return "double";
-- else if(asn1c_type_fits_long(arg, expr) == FL_FITS_UNSIGN)
-+ else if (fits == FL_FITS_INT64)
-+ return "int64_t";
-+ else if (fits == FL_FITS_UINT64)
-+ return "uint64_t";
-+ else if(fits == FL_FITS_UNSIGN)
- return "unsigned long";
- else
- return "long";
-@@ -377,11 +383,33 @@
- /* Special case for unsigned */
- if(left.type == ARE_VALUE
- && left.value >= 0
-- && right.type == ARE_VALUE
-+ && right.type == ARE_VALUE
- && right.value > 2147483647
- && right.value <= 4294967295UL)
- return FL_FITS_UNSIGN;
--
-+ /* Special for native 64 bits integer option */
-+ if (arg->flags & A1C_HAVE_NATIVE_64) {
-+// printf("left.value %lld right.value %lld\n", left.value, right.value);
-+ if(left.type == ARE_VALUE
-+ && left.value >= 0
-+ && right.type == ARE_VALUE
-+ && right.value > 9223372036854775807LL
-+ && right.value <= 18446744073709551615ULL)
-+ return FL_FITS_UINT64;
-+ if(left.type == ARE_VALUE
-+ && left.value < -2147483648
-+ && left.value >= -9223372036854775808LL
-+ && right.type == ARE_VALUE
-+ && right.value > 2147483647
-+ && right.value <= 9223372036854775807LL)
-+ return FL_FITS_INT64;
-+ if(left.type == ARE_VALUE
-+ && left.value >= 0
-+ && right.type == ARE_VALUE
-+ && right.value > 4294967295UL
-+ && right.value <= 9223372036854775807LL)
-+ return FL_FITS_INT64;
-+ }
-
- /* If some fixed value is outside of target range, not fit */
- if(left.type == ARE_VALUE
-Index: libasn1compiler/asn1c_misc.h
-===================================================================
---- libasn1compiler/asn1c_misc.h (revision 1516)
-+++ libasn1compiler/asn1c_misc.h (working copy)
-@@ -36,6 +36,8 @@
- */
- enum asn1c_fitslong_e {
- FL_NOTFIT,
-+ FL_FITS_INT64,
-+ FL_FITS_UINT64,
- FL_FITS_SIGNED,
- FL_FITS_UNSIGN,
- FL_PRESUMED,
diff --git a/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_2.p0 b/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_2.p0
deleted file mode 100644
index 80835b1b86..0000000000
--- a/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_2.p0
+++ /dev/null
@@ -1,22 +0,0 @@
---- skeletons/OCTET_STRING.c.orig 2015-04-28 10:40:04.036970492 +0200
-+++ skeletons/OCTET_STRING.c 2015-04-28 10:40:09.619970869 +0200
-@@ -159,7 +159,7 @@
- }
-
- static struct _stack *
--_new_stack() {
-+_new_stack(void) {
- return (struct _stack *)CALLOC(1, sizeof(struct _stack));
- }
-
---- skeletons/converter-sample.c.orig 2015-04-28 10:40:32.164972391 +0200
-+++ skeletons/converter-sample.c 2015-04-28 10:40:37.140972727 +0200
-@@ -353,7 +353,7 @@
- } DynamicBuffer;
-
- static void
--buffer_dump() {
-+buffer_dump(void) {
- uint8_t *p = DynamicBuffer.data + DynamicBuffer.offset;
- uint8_t *e = p + DynamicBuffer.length - (DynamicBuffer.unbits ? 1 : 0);
- if(!opt_debug) return;
diff --git a/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0 b/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0
deleted file mode 100644
index d5a936c101..0000000000
--- a/openair3/S1AP/MESSAGES/ASN1/asn1cpatch_3.p0
+++ /dev/null
@@ -1,1264 +0,0 @@
---- asn1c/unber.c 2015-12-08 14:39:33.282543533 +0100
-+++ asn1c/unber.c 2015-12-07 10:46:18.382647000 +0100
-@@ -779,4 +779,6 @@
-
- asn_enc_rval_t OCTET_STRING_encode_aper(asn_TYPE_descriptor_t *td, asn_per_constraints_t *cts, void *sptr, asn_per_outp_t *po) { asn_enc_rval_t er = { 0, 0, 0 }; (void)td; (void)cts; (void)sptr; (void)po; return er; }
-
-+asn_comp_rval_t * OCTET_STRING_compare(asn_TYPE_descriptor_t *td1, const void *sptr1, asn_TYPE_descriptor_t *td2, const void *sptr2) { (void)td1; (void)sptr1; (void)td2; (void)sptr2; return 0; }
-+
- size_t xer_whitespace_span(const void *chunk_buf, size_t chunk_size) { (void)chunk_buf; (void)chunk_size; return 0; }
---- libasn1compiler/asn1c_C.c 2015-12-08 14:39:33.366543533 +0100
-+++ libasn1compiler/asn1c_C.c 2015-12-08 08:38:29.002565000 +0100
-@@ -1082,6 +1082,8 @@
- enum tvm_compat tv_mode;
- enum etd_spec etd_spec;
- char *p;
-+ //char tmp_buf[512];
-+ //int i = 0;
-
- if(arg->embed) {
- enum tnfmt tnfmt = TNF_CTYPE;
-@@ -1243,7 +1245,8 @@
- OUT("td->uper_decoder = asn_DEF_%s.uper_decoder;\n", type_name);
- OUT("td->uper_encoder = asn_DEF_%s.uper_encoder;\n", type_name);
- OUT("td->aper_decoder = asn_DEF_%s.aper_decoder;\n", type_name);
-- OUT("td->aper_encoder = asn_DEF_%s.aper_encoder;\n", type_name);
-+ OUT("td->aper_encoder = asn_DEF_%s.aper_encoder;\n", type_name);
-+ OUT("td->compare = asn_DEF_%s.compare;\n", type_name);
- if(!terminal && !tags_count) {
- OUT("/* The next four lines are here because of -fknown-extern-type */\n");
- OUT("td->tags = asn_DEF_%s.tags;\n", type_name);
-@@ -1413,6 +1416,39 @@
- OUT("}\n");
- OUT("\n");
-
-+
-+ //i = 0;
-+ //while ((p[i] != '_') && (i < sizeof(tmp_buf))) {
-+ // tmp_buf[i] = p[i];
-+ // i++;
-+ //}
-+ //tmp_buf[i] = '\0';
-+ // hack, only for s1ap
-+ //if ((strcmp("S1ap", tmp_buf) == 0) || (strcmp("X2ap", tmp_buf) == 0))
-+ // OUT("#include \"%s-ProtocolIE-ID.h\"\n", tmp_buf);
-+
-+
-+ p = MKID(expr);
-+ if(HIDE_INNER_DEFS) OUT("static ");
-+ OUT("asn_comp_rval_t * \n");
-+ OUT("%s", p);
-+ if(HIDE_INNER_DEFS) OUT("_%d", expr->_type_unique_index);
-+ OUT("_compare(asn_TYPE_descriptor_t *td1,\n");
-+ INDENTED(
-+ OUT("\tconst void *structure1,\n");
-+ OUT("\tasn_TYPE_descriptor_t *td2,\n");
-+ OUT("\tconst void *structure2) {\n");
-+ OUT("asn_comp_rval_t * res = NULL;\n");
-+ OUT("%s_%d_inherit_TYPE_descriptor(td1);\n",
-+ p, expr->_type_unique_index);
-+ OUT("%s_%d_inherit_TYPE_descriptor(td2);\n",
-+ p, expr->_type_unique_index);
-+ OUT("res = td1->compare(td1, structure1, td2, structure2);\n");
-+ OUT("return res;\n");
-+ );
-+ OUT("}\n");
-+ OUT("\n");
-+
- p = MKID(expr);
-
- if(HIDE_INNER_DEFS) OUT("static ");
-@@ -1450,7 +1486,8 @@
- OUT("per_type_decoder_f %s_decode_uper;\n", p);
- OUT("per_type_encoder_f %s_encode_uper;\n", p);
- OUT("per_type_decoder_f %s_decode_aper;\n", p);
-- OUT("per_type_encoder_f %s_encode_aper;\n", p);
-+ OUT("per_type_encoder_f %s_encode_aper;\n", p);
-+ OUT("type_compare_f %s_compare;\n", p);
- }
- }
-
-@@ -2501,6 +2538,7 @@
- OUT("0, 0,\t/* No APER support, "
- "use \"-gen-PER\" to enable */\n");
- }
-+ FUNCREF(compare);
-
- if(!terminal || terminal->expr_type == ASN_CONSTR_CHOICE) {
- //if(expr->expr_type == ASN_CONSTR_CHOICE) {
---- skeletons/ANY.c 2015-12-08 14:39:33.350543533 +0100
-+++ skeletons/ANY.c 2015-11-26 14:40:56.547616000 +0100
-@@ -24,7 +24,8 @@
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
- OCTET_STRING_decode_aper,
-- OCTET_STRING_encode_aper,
-+ OCTET_STRING_encode_aper,
-+ OCTET_STRING_compare,
- 0, /* Use generic outmost tag fetcher */
- 0, 0, 0, 0,
- 0, /* No PER visible constraints */
---- skeletons/asn_application.h 2015-12-08 14:39:12.674543554 +0100
-+++ skeletons/asn_application.h 2015-12-07 14:36:32.950633000 +0100
-@@ -9,7 +9,8 @@
- #define _ASN_APPLICATION_H_
-
- #include "asn_system.h" /* for platform-dependent types */
--#include "asn_codecs.h" /* for ASN.1 codecs specifics */
-+#include "asn_codecs.h" /* for ASN.1 codecs specifics */
-+#include "asn_compare.h"
-
- #ifdef __cplusplus
- extern "C" {
---- skeletons/asn_compare.h 1970-01-01 01:00:00.000000000 +0100
-+++ skeletons/asn_compare.h 2015-12-08 10:34:58.090558000 +0100
-@@ -0,0 +1,78 @@
-+#ifndef _ASN_COMPARE_H_
-+#define _ASN_COMPARE_H_
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+struct asn_TYPE_descriptor_s; /* Forward declaration */
-+
-+
-+typedef enum COMPARE_ERR_CODE_e {
-+ COMPARE_ERR_CODE_START = 0,
-+ COMPARE_ERR_CODE_NONE = COMPARE_ERR_CODE_START,
-+ COMPARE_ERR_CODE_NO_MATCH,
-+ COMPARE_ERR_CODE_TYPE_MISMATCH,
-+ COMPARE_ERR_CODE_TYPE_ARG_NULL,
-+ COMPARE_ERR_CODE_VALUE_NULL,
-+ COMPARE_ERR_CODE_VALUE_ARG_NULL,
-+ COMPARE_ERR_CODE_CHOICE_NUM,
-+ COMPARE_ERR_CODE_CHOICE_PRESENT,
-+ COMPARE_ERR_CODE_CHOICE_MALFORMED,
-+ COMPARE_ERR_CODE_SET_MALFORMED,
-+ COMPARE_ERR_CODE_COLLECTION_NUM_ELEMENTS,
-+ COMPARE_ERR_CODE_END
-+} COMPARE_ERR_CODE_t;
-+
-+typedef struct asn_comp_rval_s {
-+ enum COMPARE_ERR_CODE_e err_code;
-+ char *name; // e_S1ap_ProtocolIE_ID not available for all ASN1 use (RRC vs S1AP, X2AP)
-+ const void *structure1;
-+ const void *structure2;
-+ struct asn_comp_rval_s *next;
-+} asn_comp_rval_t;
-+
-+#define COMPARE_CHECK_ARGS(aRg_tYpE_dEf1, aRg_tYpE_dEf2, aRg_vAl1, aRg_vAl2, rEsUlT) \
-+ do {\
-+ if ((aRg_tYpE_dEf1) && (aRg_tYpE_dEf2)) {\
-+ if ((aRg_tYpE_dEf1->name) && (aRg_tYpE_dEf2->name)) {\
-+ if (strcmp(aRg_tYpE_dEf1->name, aRg_tYpE_dEf2->name)) {\
-+ rEsUlT = (asn_comp_rval_t *)calloc(1, sizeof(asn_comp_rval_t));\
-+ rEsUlT->err_code = COMPARE_ERR_CODE_TYPE_MISMATCH;\
-+ rEsUlT->name = aRg_tYpE_dEf1->name;\
-+ return rEsUlT;\
-+ }\
-+ } else {\
-+ if ((aRg_tYpE_dEf1->xml_tag) && (aRg_tYpE_dEf2->xml_tag)) {\
-+ if (strcmp(aRg_tYpE_dEf1->xml_tag, aRg_tYpE_dEf2->xml_tag)) {\
-+ rEsUlT = (asn_comp_rval_t *)calloc(1, sizeof(asn_comp_rval_t));\
-+ rEsUlT->err_code = COMPARE_ERR_CODE_TYPE_MISMATCH;\
-+ rEsUlT->name = aRg_tYpE_dEf1->xml_tag;\
-+ return rEsUlT;\
-+ }\
-+ }\
-+ }\
-+ } else {\
-+ rEsUlT = (asn_comp_rval_t *)calloc(1, sizeof(asn_comp_rval_t));\
-+ rEsUlT->name = aRg_tYpE_dEf1->name;\
-+ rEsUlT->structure1 = aRg_vAl1;\
-+ rEsUlT->structure2 = aRg_vAl2;\
-+ rEsUlT->err_code = COMPARE_ERR_CODE_TYPE_ARG_NULL;\
-+ return rEsUlT;\
-+ }\
-+ if ((NULL == aRg_vAl1) || (NULL == aRg_vAl2)){\
-+ rEsUlT = (asn_comp_rval_t *)calloc(1, sizeof(asn_comp_rval_t));\
-+ rEsUlT->name = aRg_tYpE_dEf1->name;\
-+ rEsUlT->structure1 = aRg_vAl1;\
-+ rEsUlT->structure2 = aRg_vAl2;\
-+ rEsUlT->err_code = COMPARE_ERR_CODE_VALUE_ARG_NULL;\
-+ return rEsUlT;\
-+ }\
-+ } while (0);
-+
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif /* _ASN_COMPARE_H_ */
---- skeletons/BIT_STRING.c 2015-12-08 14:39:33.346543533 +0100
-+++ skeletons/BIT_STRING.c 2015-11-26 14:41:50.159616000 +0100
-@@ -30,7 +30,8 @@
- OCTET_STRING_decode_uper, /* Unaligned PER decoder */
- OCTET_STRING_encode_uper, /* Unaligned PER encoder */
- OCTET_STRING_decode_aper, /* Aligned PER decoder */
-- OCTET_STRING_encode_aper, /* Aligned PER encoder */
-+ OCTET_STRING_encode_aper, /* Aligned PER encoder */
-+ OCTET_STRING_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_BIT_STRING_tags,
- sizeof(asn_DEF_BIT_STRING_tags)
---- skeletons/BMPString.c 2015-12-08 14:39:33.338543533 +0100
-+++ skeletons/BMPString.c 2015-11-26 14:42:08.487616000 +0100
-@@ -36,7 +36,8 @@
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
- OCTET_STRING_decode_aper, /* Aligned PER decoder */
-- OCTET_STRING_encode_aper, /* Aligned PER encoder */
-+ OCTET_STRING_encode_aper, /* Aligned PER encoder */
-+ OCTET_STRING_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_BMPString_tags,
- sizeof(asn_DEF_BMPString_tags)
---- skeletons/BOOLEAN.c 2015-12-08 14:39:33.342543533 +0100
-+++ skeletons/BOOLEAN.c 2015-12-08 10:37:11.866558000 +0100
-@@ -25,7 +25,8 @@
- BOOLEAN_decode_uper, /* Unaligned PER decoder */
- BOOLEAN_encode_uper, /* Unaligned PER encoder */
- BOOLEAN_decode_aper, /* Aligned PER decoder */
-- BOOLEAN_encode_aper, /* Aligned PER encoder */
-+ BOOLEAN_encode_aper, /* Aligned PER encoder */
-+ BOOLEAN_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_BOOLEAN_tags,
- sizeof(asn_DEF_BOOLEAN_tags) / sizeof(asn_DEF_BOOLEAN_tags[0]),
-@@ -326,3 +327,22 @@
-
- _ASN_ENCODED_OK(er);
- }
-+
-+asn_comp_rval_t *
-+BOOLEAN_compare(asn_TYPE_descriptor_t *td1,
-+ const void *sptr1, asn_TYPE_descriptor_t *td2, const void *sptr2) {
-+ const BOOLEAN_t *st1 = (const BOOLEAN_t *)sptr1;
-+ const BOOLEAN_t *st2 = (const BOOLEAN_t *)sptr2;
-+ asn_comp_rval_t *res = NULL;
-+
-+ COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res)
-+
-+ if (*st1 == *st2) return NULL;
-+ res = calloc(1, sizeof(asn_comp_rval_t));
-+ res->name = td1->name;
-+ res->structure1 = sptr1;
-+ res->structure2 = sptr2;
-+ res->err_code = COMPARE_ERR_CODE_NO_MATCH;
-+ return res;
-+}
-+
---- skeletons/BOOLEAN.h 2015-12-08 14:39:33.342543533 +0100
-+++ skeletons/BOOLEAN.h 2015-11-26 12:46:58.491623000 +0100
-@@ -30,6 +30,7 @@
- per_type_encoder_f BOOLEAN_encode_uper;
- per_type_decoder_f BOOLEAN_decode_aper;
- per_type_encoder_f BOOLEAN_encode_aper;
-+type_compare_f BOOLEAN_compare;
-
- #ifdef __cplusplus
- }
---- skeletons/compare.h 1970-01-01 01:00:00.000000000 +0100
-+++ skeletons/compare.h 2015-12-08 08:23:03.694566000 +0100
-@@ -0,0 +1,28 @@
-+/*-
-+ * Eurecom 2015.
-+ */
-+#ifndef _COMPARE_H_
-+#define _COMPARE_H_
-+
-+#include
-+
-+#ifdef __cplusplus
-+extern "C" {
-+#endif
-+
-+struct asn_TYPE_descriptor_s; /* Forward declaration */
-+
-+typedef asn_comp_rval_t * (type_compare_f)(
-+ struct asn_TYPE_descriptor_s *type_descriptor1,
-+ const void *struct_ptr1,
-+ struct asn_TYPE_descriptor_s *type_descriptor2,
-+ const void *struct_ptr2
-+);
-+
-+
-+
-+#ifdef __cplusplus
-+}
-+#endif
-+
-+#endif /* _COMPARE_H_ */
---- skeletons/constr_CHOICE.c 2015-12-08 14:39:33.342543533 +0100
-+++ skeletons/constr_CHOICE.c 2015-12-08 10:39:16.670558000 +0100
-@@ -1272,3 +1272,75 @@
- assert(pres_size != sizeof(int));
- }
- }
-+
-+asn_comp_rval_t *
-+CHOICE_compare(asn_TYPE_descriptor_t *td1, const void *sptr1, asn_TYPE_descriptor_t *td2, const void *sptr2)
-+{
-+ asn_CHOICE_specifics_t *specs1 = (asn_CHOICE_specifics_t *)td1->specifics;
-+ asn_CHOICE_specifics_t *specs2 = (asn_CHOICE_specifics_t *)td2->specifics;
-+ int present1;
-+ int present2;
-+ asn_comp_rval_t *res = NULL;
-+
-+ COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res)
-+
-+ /*
-+ * Figure out which CHOICE element is encoded.
-+ */
-+ present1 = _fetch_present_idx(sptr1, specs1->pres_offset,specs1->pres_size);
-+ // same specs
-+ present2 = _fetch_present_idx(sptr2, specs2->pres_offset,specs2->pres_size);
-+
-+ if (td1->elements_count != td2->elements_count) {
-+ res = calloc(1, sizeof(asn_comp_rval_t));
-+ res->name = td1->name;
-+ res->structure1 = sptr1;
-+ res->structure2 = sptr2;
-+ res->err_code = COMPARE_ERR_CODE_CHOICE_NUM;
-+ return res;
-+ }
-+ if (present1 != present2) {
-+ res = calloc(1, sizeof(asn_comp_rval_t));
-+ res->name = td1->name;
-+ res->structure1 = sptr1;
-+ res->structure2 = sptr2;
-+ res->err_code = COMPARE_ERR_CODE_CHOICE_PRESENT;
-+ return res;
-+ }
-+ if(present1 > 0 && present1 <= td1->elements_count) {
-+ asn_TYPE_member_t *elm1 = &td1->elements[present1-1];
-+ asn_TYPE_member_t *elm2 = &td2->elements[present2-1];
-+ const void *memb_ptr1;
-+ const void *memb_ptr2;
-+
-+ if((elm1->flags & ATF_POINTER) && (elm1->flags & ATF_POINTER)){
-+ memb_ptr1 = *(const void * const *)((const char *)sptr1 + elm1->memb_offset);
-+ memb_ptr2 = *(const void * const *)((const char *)sptr2 + elm2->memb_offset);
-+ if((!memb_ptr1) || (!memb_ptr2)) {
-+ res = calloc(1, sizeof(asn_comp_rval_t));
-+ res->name = td1->name;
-+ res->structure1 = sptr1;
-+ res->structure2 = sptr2;
-+ res->err_code = COMPARE_ERR_CODE_VALUE_NULL;
-+ return res;
-+ }
-+ } else if (!(elm1->flags & ATF_POINTER) && !(elm1->flags & ATF_POINTER)){
-+ memb_ptr1 = (const void *)((const char *)sptr1 + elm1->memb_offset);
-+ memb_ptr2 = (const void *)((const char *)sptr2 + elm2->memb_offset);
-+ } else {
-+ res = calloc(1, sizeof(asn_comp_rval_t));
-+ res->name = td1->name;
-+ res->structure1 = sptr1;
-+ res->structure2 = sptr2;
-+ res->err_code = COMPARE_ERR_CODE_CHOICE_MALFORMED;
-+ return res;
-+ }
-+ return elm1->type->compare(elm1->type, memb_ptr1, elm2->type, memb_ptr2);
-+ }
-+ res = calloc(1, sizeof(asn_comp_rval_t));
-+ res->name = td1->name;
-+ res->structure1 = sptr1;
-+ res->structure2 = sptr2;
-+ res->err_code = COMPARE_ERR_CODE_CHOICE_MALFORMED;
-+ return res;
-+}
---- skeletons/constr_CHOICE.h 2015-12-08 14:39:33.342543533 +0100
-+++ skeletons/constr_CHOICE.h 2015-11-26 14:43:57.647616000 +0100
-@@ -39,7 +39,7 @@
- /*
- * A set specialized functions dealing with the CHOICE type.
- */
--asn_struct_free_f CHOICE_free;
-+asn_struct_free_f CHOICE_free;
- asn_struct_print_f CHOICE_print;
- asn_constr_check_f CHOICE_constraint;
- ber_type_decoder_f CHOICE_decode_ber;
-@@ -50,7 +50,8 @@
- per_type_encoder_f CHOICE_encode_uper;
- per_type_decoder_f CHOICE_decode_aper;
- per_type_encoder_f CHOICE_encode_aper;
--asn_outmost_tag_f CHOICE_outmost_tag;
-+type_compare_f CHOICE_compare;
-+asn_outmost_tag_f CHOICE_outmost_tag;
-
- #ifdef __cplusplus
- }
---- skeletons/constr_SEQUENCE.c 2015-12-08 14:39:33.346543533 +0100
-+++ skeletons/constr_SEQUENCE.c 2015-12-08 10:39:52.442558000 +0100
-@@ -1761,3 +1761,65 @@
-
- _ASN_ENCODED_OK(er);
- }
-+
-+asn_comp_rval_t * SEQUENCE_compare(asn_TYPE_descriptor_t *td1, const void *sptr1, asn_TYPE_descriptor_t *td2, const void *sptr2) {
-+ int edx;
-+ asn_comp_rval_t *res = NULL;
-+ asn_comp_rval_t *res2 = NULL;
-+
-+ COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res)
-+
-+ if (td1->elements_count != td2->elements_count) {
-+ res = calloc(1, sizeof(asn_comp_rval_t));
-+ res->name = td1->name;
-+ res->structure1 = sptr1;
-+ res->structure2 = sptr2;
-+ res->err_code = COMPARE_ERR_CODE_COLLECTION_NUM_ELEMENTS;
-+ return res;
-+ }
-+
-+ for(edx = 0; edx < td1->elements_count; edx++) {
-+ asn_TYPE_member_t *elm1 = &td1->elements[edx];
-+ asn_TYPE_member_t *elm2 = &td1->elements[edx];
-+ const void *memb_ptr1;
-+ const void *memb_ptr2;
-+
-+ if(elm1->flags & ATF_POINTER) {
-+ memb_ptr1 = *(const void * const *)((const char *)sptr1 + elm1->memb_offset);
-+ memb_ptr2 = *(const void * const *)((const char *)sptr2 + elm2->memb_offset);
-+ if((!memb_ptr1) && (!memb_ptr2)) {
-+ if(elm1->optional) continue;
-+ }
-+ if ((!memb_ptr1) || (!memb_ptr2)) {
-+ res2 = calloc(1, sizeof(asn_comp_rval_t));
-+ res2->name = elm1->name;
-+ res2->structure1 = memb_ptr1;
-+ res2->structure2 = memb_ptr2;
-+ res->err_code = COMPARE_ERR_CODE_VALUE_NULL;
-+ if (NULL == res) {
-+ res = res2;
-+ } else {
-+ res2->next = res;
-+ res = res2;
-+ }
-+ res2 = NULL;
-+ }
-+ } else {
-+ memb_ptr1 = (const void *)((const char *)sptr1 + elm1->memb_offset);
-+ memb_ptr2 = (const void *)((const char *)sptr2 + elm2->memb_offset);
-+ }
-+
-+ /* Compare the member itself */
-+ res2 = elm1->type->compare(elm1->type, memb_ptr1, elm2->type, memb_ptr2);
-+ if(res2) {
-+ if (NULL == res) {
-+ res = res2;
-+ } else {
-+ res2->next = res;
-+ res = res2;
-+ }
-+ res2 = NULL;
-+ }
-+ }
-+ return res;
-+}
---- skeletons/constr_SEQUENCE.h 2015-12-08 14:39:33.346543533 +0100
-+++ skeletons/constr_SEQUENCE.h 2015-11-26 14:48:14.123616000 +0100
-@@ -54,6 +54,7 @@
- per_type_encoder_f SEQUENCE_encode_uper;
- per_type_decoder_f SEQUENCE_decode_aper;
- per_type_encoder_f SEQUENCE_encode_aper;
-+type_compare_f SEQUENCE_compare;
-
- #ifdef __cplusplus
- }
---- skeletons/constr_SEQUENCE_OF.h 2015-12-08 14:39:33.342543533 +0100
-+++ skeletons/constr_SEQUENCE_OF.h 2015-11-26 15:05:25.399615000 +0100
-@@ -22,7 +22,8 @@
- #define SEQUENCE_OF_decode_ber SET_OF_decode_ber
- #define SEQUENCE_OF_decode_xer SET_OF_decode_xer
- #define SEQUENCE_OF_decode_uper SET_OF_decode_uper
--#define SEQUENCE_OF_decode_aper SET_OF_decode_aper
-+#define SEQUENCE_OF_decode_aper SET_OF_decode_aper
-+#define SEQUENCE_OF_compare SET_OF_compare
- der_type_encoder_f SEQUENCE_OF_encode_der;
- xer_type_encoder_f SEQUENCE_OF_encode_xer;
- per_type_encoder_f SEQUENCE_OF_encode_uper;
---- skeletons/constr_SET.c 2015-12-08 14:39:33.342543533 +0100
-+++ skeletons/constr_SET.c 2015-12-08 10:40:35.066558000 +0100
-@@ -1108,7 +1108,7 @@
- }
- }
-
--int
-+long
- SET_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
- asn_app_constraint_failed_f *ctfailcb, void *app_key) {
- int edx;
-@@ -1159,3 +1159,58 @@
-
- return 0;
- }
-+
-+asn_comp_rval_t *
-+SET_compare(asn_TYPE_descriptor_t *td1, const void *sptr1, asn_TYPE_descriptor_t *td2, const void *sptr2)
-+{
-+ int edx;
-+ asn_comp_rval_t *res = NULL;
-+ asn_comp_rval_t *res2 = NULL;
-+
-+ COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res)
-+
-+ if (td1->elements_count != td2->elements_count) {
-+ res = calloc(1, sizeof(asn_comp_rval_t));
-+ res->name = td1->name;
-+ res->structure1 = sptr1;
-+ res->structure2 = sptr2;
-+ res->err_code = COMPARE_ERR_CODE_COLLECTION_NUM_ELEMENTS;
-+ return res;
-+ }
-+
-+ for(edx = 0; edx < td1->elements_count; edx++) {
-+ asn_TYPE_member_t *elm1 = &td1->elements[edx];
-+ asn_TYPE_member_t *elm2 = &td2->elements[edx];
-+ const void *memb_ptr1;
-+ const void *memb_ptr2;
-+
-+ if(elm1->flags & ATF_POINTER) {
-+ memb_ptr1 = *(const void * const *)((const char *)sptr1 + elm1->memb_offset);
-+ memb_ptr2 = *(const void * const *)((const char *)sptr2 + elm2->memb_offset);
-+ if(!memb_ptr1) {
-+ if(elm1->optional)
-+ continue;
-+ res = calloc(1, sizeof(asn_comp_rval_t));
-+ res->name = td1->name;
-+ res->structure1 = sptr1;
-+ res->structure2 = sptr2;
-+ res->err_code = COMPARE_ERR_CODE_SET_MALFORMED;
-+ return res;
-+ }
-+ } else {
-+ memb_ptr1 = (const void *)((const char *)sptr1 + elm1->memb_offset);
-+ memb_ptr2 = (const void *)((const char *)sptr2 + elm2->memb_offset);
-+ }
-+ res2 = elm1->type->compare(elm1->type, memb_ptr1, elm2->type, memb_ptr2);
-+ if(res2) {
-+ if (NULL == res) {
-+ res = res2;
-+ } else {
-+ res2->next = res;
-+ res = res2;
-+ }
-+ res2 = NULL;
-+ }
-+ }
-+ return res;
-+}
---- skeletons/constr_SET.h 2015-12-08 14:39:33.342543533 +0100
-+++ skeletons/constr_SET.h 2015-11-26 14:49:09.243616000 +0100
-@@ -56,6 +56,7 @@
- per_type_decoder_f SET_decode_aper;
- per_type_encoder_f SET_encode_uper;
- per_type_encoder_f SET_encode_aper;
-+type_compare_f SET_compare;
-
- /***********************
- * Some handy helpers. *
---- skeletons/constr_SET_OF.c 2015-12-08 14:39:33.338543533 +0100
-+++ skeletons/constr_SET_OF.c 2015-12-08 10:45:54.466557000 +0100
-@@ -1039,3 +1039,54 @@
- rv.consumed = 0;
- return rv;
- }
-+
-+asn_comp_rval_t *
-+SET_OF_compare(asn_TYPE_descriptor_t *td1, const void *sptr1, asn_TYPE_descriptor_t *td2, const void *sptr2)
-+{
-+ asn_TYPE_member_t *elm1 = td1->elements;
-+ asn_TYPE_member_t *elm2 = td2->elements;
-+ const asn_anonymous_set_ *list1 = _A_CSET_FROM_VOID(sptr1);
-+ const asn_anonymous_set_ *list2 = _A_CSET_FROM_VOID(sptr2);
-+ int i;
-+ asn_comp_rval_t *res = NULL;
-+ asn_comp_rval_t *res2 = NULL;
-+
-+ COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res)
-+
-+ if (td1->elements_count != td2->elements_count) {
-+ res = calloc(1, sizeof(asn_comp_rval_t));
-+ res->name = td1->name;
-+ res->structure1 = sptr1;
-+ res->structure2 = sptr2;
-+ res->err_code = COMPARE_ERR_CODE_COLLECTION_NUM_ELEMENTS;
-+ return res;
-+ }
-+
-+
-+ if (list1->count != list2->count ) {
-+ res = calloc(1, sizeof(asn_comp_rval_t));
-+ res->name = td1->name;
-+ res->structure1 = sptr1;
-+ res->structure2 = sptr2;
-+ res->err_code = COMPARE_ERR_CODE_COLLECTION_NUM_ELEMENTS;
-+ return res;
-+ }
-+
-+ for(i = 0; i < list1->count; i++) {
-+ const void *memb_ptr1 = list1->array[i];
-+ const void *memb_ptr2 = list2->array[i];
-+ if ((!memb_ptr1) & (!memb_ptr2)) continue;
-+
-+ res2 = elm1->type->compare(elm1->type, memb_ptr1, elm2->type, memb_ptr2);
-+ if(res2) {
-+ if (NULL == res) {
-+ res = res2;
-+ } else {
-+ res2->next = res;
-+ res = res2;
-+ }
-+ res2 = NULL;
-+ }
-+ }
-+ return res;
-+}
---- skeletons/constr_SET_OF.h 2015-12-08 14:39:33.338543533 +0100
-+++ skeletons/constr_SET_OF.h 2015-11-26 14:48:45.067616000 +0100
-@@ -36,6 +36,7 @@
- per_type_encoder_f SET_OF_encode_uper;
- per_type_decoder_f SET_OF_decode_aper;
- per_type_encoder_f SET_OF_encode_aper;
-+type_compare_f SET_OF_compare;
-
- #ifdef __cplusplus
- }
---- skeletons/constr_TYPE.h 2015-12-08 14:39:33.338543533 +0100
-+++ skeletons/constr_TYPE.h 2015-11-26 15:28:05.495613000 +0100
-@@ -41,7 +41,8 @@
- #include /* Encoder into XER (XML, text) */
- #include /* Packet Encoding Rules decoder */
- #include /* Packet Encoding Rules encoder */
--#include /* Subtype constraints support */
-+#include /* Subtype constraints support */
-+#include /* Comparison */
-
- /*
- * Free the structure according to its specification.
-@@ -101,6 +102,7 @@
- per_type_encoder_f *uper_encoder; /* Unaligned PER encoder */
- per_type_decoder_f *aper_decoder; /* Aligned PER decoder */
- per_type_encoder_f *aper_encoder; /* Aligned PER encoder */
-+ type_compare_f *compare; /* Comparison between 2 instances */
-
- /***********************************************************************
- * Internally useful members. Not to be used by applications directly. *
---- skeletons/ENUMERATED.c 2015-12-08 14:39:33.342543533 +0100
-+++ skeletons/ENUMERATED.c 2015-12-08 10:40:55.986558000 +0100
-@@ -27,7 +27,8 @@
- ENUMERATED_decode_uper, /* Unaligned PER decoder */
- ENUMERATED_encode_uper, /* Unaligned PER encoder */
- ENUMERATED_decode_aper, /* Aligned PER decoder */
-- ENUMERATED_encode_aper, /* Aligned PER encoder */
-+ ENUMERATED_encode_aper, /* Aligned PER encoder */
-+ ENUMERATED_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_ENUMERATED_tags,
- sizeof(asn_DEF_ENUMERATED_tags) / sizeof(asn_DEF_ENUMERATED_tags[0]),
-@@ -103,3 +104,22 @@
-
- return NativeEnumerated_encode_aper(td, constraints, &value, po);
- }
-+
-+asn_comp_rval_t *
-+ENUMERATED_compare(asn_TYPE_descriptor_t *td1, const void *sptr1,
-+ asn_TYPE_descriptor_t *td2, const void *sptr2) {
-+ const ENUMERATED_t *st1 = (const ENUMERATED_t *)sptr1;
-+ const ENUMERATED_t *st2 = (const ENUMERATED_t *)sptr2;
-+ asn_comp_rval_t *res = NULL;
-+
-+ COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res)
-+
-+ if (*st1 == *st2) return NULL;
-+ res = calloc(1, sizeof(asn_comp_rval_t));
-+ res->name = td1->name;
-+ res->structure1 = sptr1;
-+ res->structure2 = sptr2;
-+ res->err_code = COMPARE_ERR_CODE_NO_MATCH;
-+ return res;
-+}
-+
---- skeletons/ENUMERATED.h 2015-12-08 14:39:33.342543533 +0100
-+++ skeletons/ENUMERATED.h 2015-11-26 12:46:35.523623000 +0100
-@@ -19,6 +19,7 @@
- per_type_encoder_f ENUMERATED_encode_uper;
- per_type_decoder_f ENUMERATED_decode_aper;
- per_type_encoder_f ENUMERATED_encode_aper;
-+type_compare_f ENUMERATED_compare;
-
- #ifdef __cplusplus
- }
---- skeletons/file-dependencies 2015-12-08 14:39:12.678543554 +0100
-+++ skeletons/file-dependencies 2015-12-07 15:34:40.454629000 +0100
-@@ -39,12 +39,13 @@
- constr_SEQUENCE.h constr_SEQUENCE.c
- constr_SEQUENCE_OF.h constr_SEQUENCE_OF.c asn_SEQUENCE_OF.h constr_SET_OF.h
- constr_SET.h constr_SET.c
--constr_SET_OF.h constr_SET_OF.c asn_SET_OF.h
-+constr_SET_OF.h constr_SET_OF.c asn_SET_OF.h compare.h
-
- COMMON-FILES: # THIS IS A SPECIAL SECTION
--asn_application.h # Applications should include this file
-+asn_application.h # Applications should include this file
- asn_system.h # Platform-dependent types
--asn_codecs.h # Return types of encoders and decoders
-+asn_codecs.h # Return types of encoders and decoders
-+asn_compare.h # Return type of compare
- asn_internal.h # Internal stuff
- OCTET_STRING.h OCTET_STRING.c # This one is used too widely
- BIT_STRING.h BIT_STRING.c # This one is necessary for the above one
---- skeletons/GeneralizedTime.c 2015-12-08 14:39:33.350543533 +0100
-+++ skeletons/GeneralizedTime.c 2015-11-26 15:09:03.899615000 +0100
-@@ -168,7 +168,8 @@
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
- OCTET_STRING_decode_aper,
-- OCTET_STRING_encode_aper,
-+ OCTET_STRING_encode_aper,
-+ OCTET_STRING_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_GeneralizedTime_tags,
- sizeof(asn_DEF_GeneralizedTime_tags)
---- skeletons/GeneralString.c 2015-12-08 14:39:33.342543533 +0100
-+++ skeletons/GeneralString.c 2015-11-26 14:50:11.843616000 +0100
-@@ -25,7 +25,8 @@
- OCTET_STRING_decode_uper, /* Implemented in terms of OCTET STRING */
- OCTET_STRING_encode_uper,
- OCTET_STRING_decode_aper,
-- OCTET_STRING_encode_aper,
-+ OCTET_STRING_encode_aper,
-+ OCTET_STRING_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_GeneralString_tags,
- sizeof(asn_DEF_GeneralString_tags)
---- skeletons/GraphicString.c 2015-12-08 14:39:33.350543533 +0100
-+++ skeletons/GraphicString.c 2015-11-26 15:33:33.255613000 +0100
-@@ -25,7 +25,8 @@
- OCTET_STRING_decode_uper, /* Implemented in terms of OCTET STRING */
- OCTET_STRING_encode_uper,
- OCTET_STRING_decode_aper,
-- OCTET_STRING_encode_aper,
-+ OCTET_STRING_encode_aper,
-+ OCTET_STRING_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_GraphicString_tags,
- sizeof(asn_DEF_GraphicString_tags)
---- skeletons/IA5String.c 2015-12-08 14:39:33.342543533 +0100
-+++ skeletons/IA5String.c 2015-11-26 14:50:44.219616000 +0100
-@@ -31,6 +31,7 @@
- OCTET_STRING_encode_uper,
- OCTET_STRING_decode_aper,
- OCTET_STRING_encode_aper,
-+ OCTET_STRING_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_IA5String_tags,
- sizeof(asn_DEF_IA5String_tags)
---- skeletons/INTEGER.c 2015-12-08 14:39:33.346543533 +0100
-+++ skeletons/INTEGER.c 2015-12-08 10:41:08.526558000 +0100
-@@ -35,6 +35,7 @@
- INTEGER_decode_aper,
- INTEGER_encode_aper,
- #endif /* ASN_DISABLE_PER_SUPPORT */
-+ INTEGER_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_INTEGER_tags,
- sizeof(asn_DEF_INTEGER_tags) / sizeof(asn_DEF_INTEGER_tags[0]),
-@@ -1501,3 +1502,30 @@
- }
-
-
-+asn_comp_rval_t *
-+INTEGER_compare(asn_TYPE_descriptor_t *td1, const void *sptr1,
-+ asn_TYPE_descriptor_t *td2, const void *sptr2) {
-+ const INTEGER_t *st1 = (const INTEGER_t *)sptr1;
-+ const INTEGER_t *st2 = (const INTEGER_t *)sptr2;
-+ asn_comp_rval_t *res = NULL;
-+
-+ COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res)
-+
-+ if (st1->size != st2->size) {
-+ res = calloc(1, sizeof(asn_comp_rval_t));
-+ res->name = td1->name;
-+ res->structure1 = sptr1;
-+ res->structure2 = sptr2;
-+ res->err_code = COMPARE_ERR_CODE_NO_MATCH;
-+ return res;
-+ }
-+ if (0 != memcmp(st1->buf, st2->buf, st1->size)) {
-+ res = calloc(1, sizeof(asn_comp_rval_t));
-+ res->name = td1->name;
-+ res->structure1 = sptr1;
-+ res->structure2 = sptr2;
-+ res->err_code = COMPARE_ERR_CODE_NO_MATCH;
-+ return res;
-+ }
-+ return NULL;
-+}
---- skeletons/INTEGER.h 2015-12-08 14:39:33.346543533 +0100
-+++ skeletons/INTEGER.h 2015-11-26 12:50:41.551623000 +0100
-@@ -43,6 +43,7 @@
- per_type_encoder_f INTEGER_encode_uper;
- per_type_decoder_f INTEGER_decode_aper;
- per_type_encoder_f INTEGER_encode_aper;
-+type_compare_f INTEGER_compare;
-
- /***********************************
- * Some handy conversion routines. *
---- skeletons/ISO646String.c 2015-12-08 14:39:33.342543533 +0100
-+++ skeletons/ISO646String.c 2015-11-26 12:55:48.327623000 +0100
-@@ -30,7 +30,8 @@
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
- OCTET_STRING_decode_aper,
-- OCTET_STRING_encode_aper,
-+ OCTET_STRING_encode_aper,
-+ OCTET_STRING_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_ISO646String_tags,
- sizeof(asn_DEF_ISO646String_tags)
---- skeletons/Makefile.am 2015-12-08 14:39:12.666543554 +0100
-+++ skeletons/Makefile.am 2015-12-07 15:54:00.150628000 +0100
-@@ -46,11 +46,11 @@
- asn_SET_OF.c asn_SET_OF.h \
- asn_application.h asn_codecs.h \
- asn_codecs_prim.c asn_codecs_prim.h \
-- asn_internal.h asn_system.h \
-+ asn_internal.h asn_system.h asn_compare.h \
- ber_decoder.c ber_decoder.h \
- ber_tlv_length.c ber_tlv_length.h \
-- ber_tlv_tag.c ber_tlv_tag.h \
-- constr_CHOICE.c constr_CHOICE.h \
-+ ber_tlv_tag.c ber_tlv_tag.h compare.h \
-+ comparison.h constr_CHOICE.c constr_CHOICE.h \
- constr_SEQUENCE.c constr_SEQUENCE.h \
- constr_SEQUENCE_OF.c constr_SEQUENCE_OF.h \
- constr_SET.c constr_SET.h \
---- skeletons/NativeEnumerated.c 2015-12-08 14:39:33.342543533 +0100
-+++ skeletons/NativeEnumerated.c 2015-12-08 10:41:17.662558000 +0100
-@@ -31,7 +31,8 @@
- NativeEnumerated_decode_uper,
- NativeEnumerated_encode_uper,
- NativeEnumerated_decode_aper,
-- NativeEnumerated_encode_aper,
-+ NativeEnumerated_encode_aper,
-+ NativeEnumerated_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_NativeEnumerated_tags,
- sizeof(asn_DEF_NativeEnumerated_tags) / sizeof(asn_DEF_NativeEnumerated_tags[0]),
-@@ -335,3 +336,22 @@
-
- _ASN_ENCODED_OK(er);
- }
-+
-+asn_comp_rval_t *
-+NativeEnumerated_compare(asn_TYPE_descriptor_t *td1, const void *sptr1,
-+ asn_TYPE_descriptor_t *td2, const void *sptr2) {
-+ const asn_INTEGER_enum_map_t *a = sptr1;
-+ const asn_INTEGER_enum_map_t *b = sptr2;
-+ asn_comp_rval_t *res = NULL;
-+
-+ COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res)
-+
-+ if(a->nat_value == b->nat_value)
-+ return NULL;
-+ res = calloc(1, sizeof(asn_comp_rval_t));
-+ res->name = td1->name;
-+ res->structure1 = sptr1;
-+ res->structure2 = sptr2;
-+ res->err_code = COMPARE_ERR_CODE_NO_MATCH;
-+ return res;
-+}
---- skeletons/NativeEnumerated.h 2015-12-08 14:39:33.342543533 +0100
-+++ skeletons/NativeEnumerated.h 2015-11-26 14:51:43.315616000 +0100
-@@ -26,6 +26,7 @@
- per_type_encoder_f NativeEnumerated_encode_uper;
- per_type_decoder_f NativeEnumerated_decode_aper;
- per_type_encoder_f NativeEnumerated_encode_aper;
-+type_compare_f NativeEnumerated_compare;
-
- #ifdef __cplusplus
- }
---- skeletons/NativeInteger.c 2015-12-08 14:39:33.346543533 +0100
-+++ skeletons/NativeInteger.c 2015-12-08 10:41:24.550558000 +0100
-@@ -32,7 +32,8 @@
- NativeInteger_decode_uper, /* Unaligned PER decoder */
- NativeInteger_encode_uper, /* Unaligned PER encoder */
- NativeInteger_decode_aper, /* Aligned PER decoder */
-- NativeInteger_encode_aper, /* Aligned PER encoder */
-+ NativeInteger_encode_aper, /* Aligned PER encoder */
-+ NativeInteger_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_NativeInteger_tags,
- sizeof(asn_DEF_NativeInteger_tags) / sizeof(asn_DEF_NativeInteger_tags[0]),
-@@ -410,3 +411,21 @@
- }
- }
-
-+
-+asn_comp_rval_t *
-+NativeInteger_compare(asn_TYPE_descriptor_t *td1, const void *sptr1,
-+ asn_TYPE_descriptor_t *td2, const void *sptr2) {
-+ const long *native1 = (const long *)sptr1;
-+ const long *native2 = (const long *)sptr2;
-+ asn_comp_rval_t *res = NULL;
-+
-+ COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res)
-+
-+ if (*native1 == *native2) return NULL;
-+ res = calloc(1, sizeof(asn_comp_rval_t));
-+ res->name = td1->name;
-+ res->structure1 = sptr1;
-+ res->structure2 = sptr2;
-+ res->err_code = COMPARE_ERR_CODE_NO_MATCH;
-+ return res;
-+}
---- skeletons/NativeInteger.h 2015-12-08 14:39:33.346543533 +0100
-+++ skeletons/NativeInteger.h 2015-11-26 14:52:13.931616000 +0100
-@@ -31,6 +31,7 @@
- per_type_encoder_f NativeInteger_encode_uper;
- per_type_decoder_f NativeInteger_decode_aper;
- per_type_encoder_f NativeInteger_encode_aper;
-+type_compare_f NativeInteger_compare;
-
- #ifdef __cplusplus
- }
---- skeletons/NativeReal.c 2015-12-08 14:39:33.350543533 +0100
-+++ skeletons/NativeReal.c 2015-12-08 10:41:32.666558000 +0100
-@@ -33,7 +33,8 @@
- NativeReal_decode_uper,
- NativeReal_encode_uper,
- NativeReal_decode_aper,
-- NativeReal_encode_aper,
-+ NativeReal_encode_aper,
-+ NativeReal_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_NativeReal_tags,
- sizeof(asn_DEF_NativeReal_tags) / sizeof(asn_DEF_NativeReal_tags[0]),
-@@ -405,3 +406,30 @@
- }
- }
-
-+asn_comp_rval_t *
-+NativeReal_compare(asn_TYPE_descriptor_t *td1, const void *sptr1,
-+ asn_TYPE_descriptor_t *td2, const void *sptr2) {
-+ const REAL_t *st1 = (const REAL_t *)sptr1;
-+ const REAL_t *st2 = (const REAL_t *)sptr2;
-+ asn_comp_rval_t *res = NULL;
-+
-+ COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res)
-+
-+ if (st1->size != st2->size) {
-+ res = calloc(1, sizeof(asn_comp_rval_t));
-+ res->name = td1->name;
-+ res->structure1 = sptr1;
-+ res->structure2 = sptr2;
-+ res->err_code = COMPARE_ERR_CODE_NO_MATCH;
-+ return res;
-+ }
-+ if (0 != memcmp(st1->buf, st2->buf, st1->size)) {
-+ res = calloc(1, sizeof(asn_comp_rval_t));
-+ res->name = td1->name;
-+ res->structure1 = sptr1;
-+ res->structure2 = sptr2;
-+ res->err_code = COMPARE_ERR_CODE_NO_MATCH;
-+ return res;
-+ }
-+ return NULL;
-+}
---- skeletons/NativeReal.h 2015-12-08 14:39:33.350543533 +0100
-+++ skeletons/NativeReal.h 2015-11-26 14:31:12.631617000 +0100
-@@ -29,6 +29,7 @@
- per_type_encoder_f NativeReal_encode_uper;
- per_type_decoder_f NativeReal_decode_aper;
- per_type_encoder_f NativeReal_encode_aper;
-+type_compare_f NativeReal_compare;
-
- #ifdef __cplusplus
- }
---- skeletons/NULL.c 2015-12-08 14:39:33.338543533 +0100
-+++ skeletons/NULL.c 2015-12-07 10:49:05.178647000 +0100
-@@ -26,7 +26,8 @@
- NULL_decode_uper, /* Unaligned PER decoder */
- NULL_encode_uper, /* Unaligned PER encoder */
- NULL_decode_aper, /* Aligned PER decoder */
-- NULL_encode_aper, /* Aligned PER encoder */
-+ NULL_encode_aper, /* Aligned PER encoder */
-+ NULL_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_NULL_tags,
- sizeof(asn_DEF_NULL_tags) / sizeof(asn_DEF_NULL_tags[0]),
-@@ -192,3 +193,10 @@
- er.encoded = 0;
- _ASN_ENCODED_OK(er);
- }
-+
-+asn_comp_rval_t *
-+NULL_compare(asn_TYPE_descriptor_t *td1, const void *sptr1,
-+ asn_TYPE_descriptor_t *td2, const void *sptr2) {
-+
-+ return NULL;
-+}
---- skeletons/NULL.h 2015-12-08 14:39:33.338543533 +0100
-+++ skeletons/NULL.h 2015-11-26 14:53:03.875616000 +0100
-@@ -27,6 +27,7 @@
- per_type_encoder_f NULL_encode_uper;
- per_type_decoder_f NULL_decode_aper;
- per_type_encoder_f NULL_encode_aper;
-+type_compare_f NULL_compare;
-
- #ifdef __cplusplus
- }
---- skeletons/NumericString.c 2015-12-08 14:39:33.338543533 +0100
-+++ skeletons/NumericString.c 2015-11-26 14:40:39.407616000 +0100
-@@ -50,7 +50,8 @@
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
- OCTET_STRING_decode_aper,
-- OCTET_STRING_encode_aper,
-+ OCTET_STRING_encode_aper,
-+ OCTET_STRING_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_NumericString_tags,
- sizeof(asn_DEF_NumericString_tags)
---- skeletons/ObjectDescriptor.c 2015-12-08 14:39:33.338543533 +0100
-+++ skeletons/ObjectDescriptor.c 2015-11-26 14:55:46.227615000 +0100
-@@ -25,7 +25,8 @@
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
- OCTET_STRING_decode_aper,
-- OCTET_STRING_encode_aper,
-+ OCTET_STRING_encode_aper,
-+ OCTET_STRING_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_ObjectDescriptor_tags,
- sizeof(asn_DEF_ObjectDescriptor_tags)
---- skeletons/OBJECT_IDENTIFIER.c 2015-12-08 14:39:33.342543533 +0100
-+++ skeletons/OBJECT_IDENTIFIER.c 2015-11-26 14:55:13.311615000 +0100
-@@ -28,7 +28,8 @@
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
- OCTET_STRING_decode_aper,
-- OCTET_STRING_encode_aper,
-+ OCTET_STRING_encode_aper,
-+ OCTET_STRING_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_OBJECT_IDENTIFIER_tags,
- sizeof(asn_DEF_OBJECT_IDENTIFIER_tags)
---- skeletons/OCTET_STRING.c 2015-12-08 14:39:44.554543521 +0100
-+++ skeletons/OCTET_STRING.c 2015-12-08 10:41:42.838558000 +0100
-@@ -37,7 +37,8 @@
- OCTET_STRING_decode_uper, /* Unaligned PER decoder */
- OCTET_STRING_encode_uper, /* Unaligned PER encoder */
- OCTET_STRING_decode_aper, /* Aligned PER decoder */
-- OCTET_STRING_encode_aper, /* Aligned PER encoder */
-+ OCTET_STRING_encode_aper, /* Aligned PER encoder */
-+ OCTET_STRING_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_OCTET_STRING_tags,
- sizeof(asn_DEF_OCTET_STRING_tags)
-@@ -2160,3 +2161,30 @@
- return st;
- }
-
-+asn_comp_rval_t *
-+OCTET_STRING_compare(asn_TYPE_descriptor_t *td1,
-+ const void *sptr1, asn_TYPE_descriptor_t *td2, const void *sptr2) {
-+ const OCTET_STRING_t *st1 = (const OCTET_STRING_t *)sptr1;
-+ const OCTET_STRING_t *st2 = (const OCTET_STRING_t *)sptr2;
-+ asn_comp_rval_t *res = NULL;
-+
-+ COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res)
-+
-+ if (st1->size != st2->size) {
-+ res = calloc(1, sizeof(asn_comp_rval_t));
-+ res->name = td1->name;
-+ res->structure1 = sptr1;
-+ res->structure2 = sptr2;
-+ res->err_code = COMPARE_ERR_CODE_NO_MATCH;
-+ return res;
-+ }
-+ if (0 != memcmp(st1->buf, st2->buf, st1->size)) {
-+ res = calloc(1, sizeof(asn_comp_rval_t));
-+ res->name = td1->name;
-+ res->structure1 = sptr1;
-+ res->structure2 = sptr2;
-+ res->err_code = COMPARE_ERR_CODE_NO_MATCH;
-+ return res;
-+ }
-+ return NULL;
-+}
---- skeletons/OCTET_STRING.h 2015-12-08 14:39:33.350543533 +0100
-+++ skeletons/OCTET_STRING.h 2015-11-26 12:56:15.259623000 +0100
-@@ -34,6 +34,7 @@
- per_type_encoder_f OCTET_STRING_encode_uper;
- per_type_decoder_f OCTET_STRING_decode_aper;
- per_type_encoder_f OCTET_STRING_encode_aper;
-+type_compare_f OCTET_STRING_compare;
-
- /******************************
- * Handy conversion routines. *
---- skeletons/PrintableString.c 2015-12-08 14:39:33.338543533 +0100
-+++ skeletons/PrintableString.c 2015-11-26 14:56:09.787615000 +0100
-@@ -60,7 +60,8 @@
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
- OCTET_STRING_decode_aper,
-- OCTET_STRING_encode_aper,
-+ OCTET_STRING_encode_aper,
-+ OCTET_STRING_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_PrintableString_tags,
- sizeof(asn_DEF_PrintableString_tags)
---- skeletons/REAL.c 2015-12-08 14:39:33.350543533 +0100
-+++ skeletons/REAL.c 2015-12-08 10:41:55.178558000 +0100
-@@ -46,7 +46,8 @@
- REAL_decode_uper,
- REAL_encode_uper,
- REAL_decode_aper,
-- REAL_encode_aper,
-+ REAL_encode_aper,
-+ REAL_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_REAL_tags,
- sizeof(asn_DEF_REAL_tags) / sizeof(asn_DEF_REAL_tags[0]),
-@@ -741,3 +742,32 @@
-
- return 0;
- }
-+
-+
-+asn_comp_rval_t *
-+REAL_compare(asn_TYPE_descriptor_t *td1, const void *sptr1,
-+ asn_TYPE_descriptor_t *td2, const void *sptr2) {
-+ const REAL_t *st1 = (const REAL_t *)sptr1;
-+ const REAL_t *st2 = (const REAL_t *)sptr2;
-+ asn_comp_rval_t *res = NULL;
-+
-+ COMPARE_CHECK_ARGS(td1, td2, sptr1, sptr2, res)
-+
-+ if (st1->size != st2->size) {
-+ res = calloc(1, sizeof(asn_comp_rval_t));
-+ res->name = td1->name;
-+ res->structure1 = sptr1;
-+ res->structure2 = sptr2;
-+ res->err_code = COMPARE_ERR_CODE_NO_MATCH;
-+ return res;
-+ }
-+ if (0 != memcmp(st1->buf, st2->buf, st1->size)) {
-+ res = calloc(1, sizeof(asn_comp_rval_t));
-+ res->name = td1->name;
-+ res->structure1 = sptr1;
-+ res->structure2 = sptr2;
-+ res->err_code = COMPARE_ERR_CODE_NO_MATCH;
-+ return res;
-+ }
-+ return NULL;
-+}
---- skeletons/REAL.h 2015-12-08 14:39:33.350543533 +0100
-+++ skeletons/REAL.h 2015-11-26 13:00:46.183623000 +0100
-@@ -23,6 +23,7 @@
- per_type_encoder_f REAL_encode_uper;
- per_type_decoder_f REAL_decode_aper;
- per_type_encoder_f REAL_encode_aper;
-+type_compare_f REAL_compare;
-
- /***********************************
- * Some handy conversion routines. *
---- skeletons/RELATIVE-OID.c 2015-12-08 14:39:33.338543533 +0100
-+++ skeletons/RELATIVE-OID.c 2015-11-26 14:56:31.703615000 +0100
-@@ -29,7 +29,8 @@
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
- OCTET_STRING_decode_aper,
-- OCTET_STRING_encode_aper,
-+ OCTET_STRING_encode_aper,
-+ OCTET_STRING_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_RELATIVE_OID_tags,
- sizeof(asn_DEF_RELATIVE_OID_tags)
---- skeletons/T61String.c 2015-12-08 14:39:33.338543533 +0100
-+++ skeletons/T61String.c 2015-11-26 14:57:07.235615000 +0100
-@@ -25,7 +25,8 @@
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
- OCTET_STRING_decode_aper,
-- OCTET_STRING_encode_aper,
-+ OCTET_STRING_encode_aper,
-+ OCTET_STRING_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_T61String_tags,
- sizeof(asn_DEF_T61String_tags)
---- skeletons/TeletexString.c 2015-12-08 14:39:33.338543533 +0100
-+++ skeletons/TeletexString.c 2015-11-26 14:57:17.643615000 +0100
-@@ -25,7 +25,8 @@
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
- OCTET_STRING_decode_aper,
-- OCTET_STRING_encode_aper,
-+ OCTET_STRING_encode_aper,
-+ OCTET_STRING_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_TeletexString_tags,
- sizeof(asn_DEF_TeletexString_tags)
---- skeletons/UniversalString.c 2015-12-08 14:39:33.350543533 +0100
-+++ skeletons/UniversalString.c 2015-11-26 14:57:29.015615000 +0100
-@@ -36,7 +36,8 @@
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
- OCTET_STRING_decode_aper,
-- OCTET_STRING_encode_aper,
-+ OCTET_STRING_encode_aper,
-+ OCTET_STRING_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_UniversalString_tags,
- sizeof(asn_DEF_UniversalString_tags)
---- skeletons/UTCTime.c 2015-12-08 14:39:33.350543533 +0100
-+++ skeletons/UTCTime.c 2015-11-26 14:57:44.127615000 +0100
-@@ -41,7 +41,8 @@
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
- OCTET_STRING_decode_aper,
-- OCTET_STRING_encode_aper,
-+ OCTET_STRING_encode_aper,
-+ OCTET_STRING_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_UTCTime_tags,
- sizeof(asn_DEF_UTCTime_tags)
---- skeletons/UTF8String.c 2015-12-08 14:39:33.314543533 +0100
-+++ skeletons/UTF8String.c 2015-11-26 14:06:54.563618000 +0100
-@@ -27,6 +27,7 @@
- OCTET_STRING_encode_uper,
- OCTET_STRING_decode_aper,
- OCTET_STRING_encode_aper,
-+ OCTET_STRING_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_UTF8String_tags,
- sizeof(asn_DEF_UTF8String_tags)
---- skeletons/VideotexString.c 2015-12-08 14:39:33.342543533 +0100
-+++ skeletons/VideotexString.c 2015-11-26 14:07:06.139618000 +0100
-@@ -25,7 +25,8 @@
- OCTET_STRING_decode_uper, /* Implemented in terms of OCTET STRING */
- OCTET_STRING_encode_uper,
- OCTET_STRING_decode_aper,
-- OCTET_STRING_encode_aper,
-+ OCTET_STRING_encode_aper,
-+ OCTET_STRING_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_VideotexString_tags,
- sizeof(asn_DEF_VideotexString_tags)
---- skeletons/VisibleString.c 2015-12-08 14:39:33.350543533 +0100
-+++ skeletons/VisibleString.c 2015-11-26 14:07:15.283618000 +0100
-@@ -30,7 +30,8 @@
- OCTET_STRING_decode_uper,
- OCTET_STRING_encode_uper,
- OCTET_STRING_decode_aper,
-- OCTET_STRING_encode_aper,
-+ OCTET_STRING_encode_aper,
-+ OCTET_STRING_compare,
- 0, /* Use generic outmost tag fetcher */
- asn_DEF_VisibleString_tags,
- sizeof(asn_DEF_VisibleString_tags)
diff --git a/openair3/S1AP/s1ap_eNB_nas_procedures.c b/openair3/S1AP/s1ap_eNB_nas_procedures.c
index dbe0fef091..43f5ad49e5 100644
--- a/openair3/S1AP/s1ap_eNB_nas_procedures.c
+++ b/openair3/S1AP/s1ap_eNB_nas_procedures.c
@@ -668,6 +668,8 @@ int s1ap_eNB_ue_capabilities(instance_t instance,
return -1;
}
+ free(ue_cap_info_ind_p->ue_radio_cap.buffer);
+
MSC_LOG_TX_MESSAGE(
MSC_S1AP_ENB,
MSC_S1AP_MME,
diff --git a/targets/ARCH/COMMON/common_lib.h b/targets/ARCH/COMMON/common_lib.h
index 99350a4c1e..dccc51753d 100644
--- a/targets/ARCH/COMMON/common_lib.h
+++ b/targets/ARCH/COMMON/common_lib.h
@@ -72,10 +72,13 @@ typedef enum {
max_gain=0,med_gain,byp_gain
} rx_gain_t;
+#if OCP_FRAMEWORK
+#include
+#else
typedef enum {
duplex_mode_TDD=1,duplex_mode_FDD=0
} duplex_mode_t;
-
+#endif
/** @addtogroup _GENERIC_PHY_RF_INTERFACE_
@@ -83,6 +86,9 @@ typedef enum {
*/
/*!\brief RF device types
*/
+#ifdef OCP_FRAMEWORK
+#include
+#else
typedef enum {
MIN_RF_DEV_TYPE = 0,
/*!\brief device is ExpressMIMO */
@@ -100,6 +106,7 @@ typedef enum {
MAX_RF_DEV_TYPE
} dev_type_t;
+#endif
/*!\brief transport protocol types
*/
diff --git a/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c b/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c
index 863b0d02d2..11aa8ed9ba 100644
--- a/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c
+++ b/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c
@@ -208,7 +208,9 @@ int trx_eth_write_udp_IF4p5(openair0_device *device, openair0_timestamp timestam
if (flags == IF4p5_PDLFFT) {
packet_size = UDP_IF4p5_PDLFFT_SIZE_BYTES(nblocks);
} else if (flags == IF4p5_PULFFT) {
- packet_size = UDP_IF4p5_PULFFT_SIZE_BYTES(nblocks);
+ packet_size = UDP_IF4p5_PULFFT_SIZE_BYTES(nblocks);
+ } else if (flags == IF4p5_PRACH) {
+ packet_size = UDP_IF4p5_PRACH_SIZE_BYTES;
} else {
printf("trx_eth_write_udp_IF4p5: unknown flags %d\n",flags);
return(-1);
diff --git a/targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h b/targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h
index 855ff49704..ce3024064a 100644
--- a/targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h
+++ b/targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h
@@ -45,11 +45,15 @@
#include "PHY/LTE_TRANSPORT/if5_tools.h"
// ETH transport preference modes
+#ifdef OCP_FRAMEWORK
+#include "enums.h"
+#else
#define ETH_UDP_MODE 0
#define ETH_RAW_MODE 1
#define ETH_UDP_IF4p5_MODE 2
#define ETH_RAW_IF4p5_MODE 3
#define ETH_RAW_IF5_MOBIPASS 4
+#endif
// Time domain RRH packet sizes
#define MAC_HEADER_SIZE_BYTES (sizeof(struct ether_header))
diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
index b8e9b21866..f9c2309ab8 100644
--- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
+++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
@@ -45,7 +45,8 @@
#include
#include
#include
-
+#include
+#include "UTIL/LOG/log_extern.h"
#include "common_lib.h"
#ifdef __SSE4_1__
# include
@@ -172,7 +173,13 @@ static void trx_usrp_end(openair0_device *device)
*/
static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags)
{
- int ret;
+ static long long int loop=0;
+ static long time_min=0, time_max=0, time_avg=0;
+ struct timespec tp_start, tp_end;
+ long time_diff;
+ clock_gettime(CLOCK_MONOTONIC_RAW, &tp_start);
+
+ int ret=0, ret_i=0;
usrp_state_t *s = (usrp_state_t*)device->priv;
s->tx_md.time_spec = uhd::time_spec_t::from_ticks(timestamp, s->sample_rate);
@@ -196,7 +203,23 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
if (ret != nsamps) {
printf("[xmit] tx samples %d != %d\n",ret,nsamps);
}
-
+
+ clock_gettime(CLOCK_MONOTONIC_RAW, &tp_end);
+ time_diff = (tp_end.tv_sec - tp_start.tv_sec) *1E09 + (tp_end.tv_nsec - tp_start.tv_nsec);
+ if (time_min==0 ||loop==1 || time_min > time_diff)
+ time_min=time_diff;
+ if (time_max==0 ||loop==1 || time_max < time_diff)
+ time_max=time_diff;
+ if (time_avg ==0 ||loop==1)
+ time_avg= time_diff;
+ else
+ time_avg=(time_diff+time_avg) /2.0;
+
+ //prints statics of uhd every 10 seconds
+ if ( loop % (10 * ((int)device->openair0_cfg[0].sample_rate /(int)nsamps )) ==0)
+ LOG_I(HW,"usrp_write: min(ns)=%d, max(ns)=%d, avg(ns)=%d\n", (int)time_min, (int)time_max,(int)time_avg);
+
+ loop++;
return ret;
}
@@ -213,6 +236,11 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
*/
static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc)
{
+ static long long int loop=0;
+ static long time_min=0, time_max=0, time_avg=0;
+ struct timespec tp_start, tp_end;
+ long time_diff;
+ clock_gettime(CLOCK_MONOTONIC_RAW, &tp_start);
usrp_state_t *s = (usrp_state_t*)device->priv;
int samples_received=0,i,j;
int nsamps2; // aligned to upper 32 or 16 byte boundary
@@ -293,6 +321,22 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
s->rx_timestamp = s->rx_md.time_spec.to_ticks(s->sample_rate);
*ptimestamp = s->rx_timestamp;
+ clock_gettime(CLOCK_MONOTONIC_RAW, &tp_end);
+ time_diff = (tp_end.tv_sec - tp_start.tv_sec) *1E09 + (tp_end.tv_nsec - tp_start.tv_nsec);
+ if (time_min==0 ||loop==1 || time_min > time_diff)
+ time_min=time_diff;
+ if (time_max==0 ||loop==1 || time_max < time_diff)
+ time_max=time_diff;
+ if (time_avg ==0 ||loop==1)
+ time_avg= time_diff;
+ else
+ time_avg=(time_diff+time_avg) /2.0;
+
+ //prints statics of uhd every 10 seconds
+ if ( loop % (10 * ((int)device->openair0_cfg[0].sample_rate /(int)nsamps )) ==0)
+ LOG_I(HW,"usrp_read: min(ns)=%d, max(ns)=%d, avg(ns)=%d\n", (int)time_min, (int)time_max,(int)time_avg);
+
+ loop++;
return samples_received;
}
@@ -500,6 +544,7 @@ extern "C" {
// Initialize USRP device
+ device->openair0_cfg = openair0_cfg;
std::string args = "type=b200";
@@ -523,6 +568,8 @@ extern "C" {
// workaround for an api problem, master clock has to be set with the constructor not via set_master_clock_rate
args += boost::str(boost::format(",master_clock_rate=%f") % usrp_master_clock);
+ args += ",num_send_frames=256,num_recv_frames=256, send_frame_size=4096, recv_frame_size=4096";
+
uhd::device_addrs_t device_adds = uhd::device::find(args);
if(device_adds.size() == 0)
@@ -554,25 +601,25 @@ extern "C" {
switch ((int)openair0_cfg[0].sample_rate) {
case 30720000:
// from usrp_time_offset
- openair0_cfg[0].samples_per_packet = 2048;
+ //openair0_cfg[0].samples_per_packet = 2048;
openair0_cfg[0].tx_sample_advance = 15;
openair0_cfg[0].tx_bw = 20e6;
openair0_cfg[0].rx_bw = 20e6;
break;
case 15360000:
- openair0_cfg[0].samples_per_packet = 2048;
+ //openair0_cfg[0].samples_per_packet = 2048;
openair0_cfg[0].tx_sample_advance = 45;
openair0_cfg[0].tx_bw = 10e6;
openair0_cfg[0].rx_bw = 10e6;
break;
case 7680000:
- openair0_cfg[0].samples_per_packet = 1024;
+ //openair0_cfg[0].samples_per_packet = 2048;
openair0_cfg[0].tx_sample_advance = 50;
openair0_cfg[0].tx_bw = 5e6;
openair0_cfg[0].rx_bw = 5e6;
break;
case 1920000:
- openair0_cfg[0].samples_per_packet = 256;
+ //openair0_cfg[0].samples_per_packet = 2048;
openair0_cfg[0].tx_sample_advance = 50;
openair0_cfg[0].tx_bw = 1.25e6;
openair0_cfg[0].rx_bw = 1.25e6;
@@ -585,7 +632,7 @@ extern "C" {
} else {
printf("Found USRP B200");
- args += ",num_recv_frames=256" ;
+ args += ",num_send_frames=256,num_recv_frames=256, send_frame_size=4096, recv_frame_size=4096" ;
s->usrp = uhd::usrp::multi_usrp::make(args);
// s->usrp->set_rx_subdev_spec(rx_subdev);
@@ -611,30 +658,35 @@ extern "C" {
switch ((int)openair0_cfg[0].sample_rate) {
case 30720000:
s->usrp->set_master_clock_rate(30.72e6);
+ //openair0_cfg[0].samples_per_packet = 1024;
openair0_cfg[0].tx_sample_advance = 115;
openair0_cfg[0].tx_bw = 20e6;
openair0_cfg[0].rx_bw = 20e6;
break;
case 23040000:
s->usrp->set_master_clock_rate(23.04e6); //to be checked
+ //openair0_cfg[0].samples_per_packet = 1024;
openair0_cfg[0].tx_sample_advance = 113;
openair0_cfg[0].tx_bw = 20e6;
openair0_cfg[0].rx_bw = 20e6;
break;
case 15360000:
s->usrp->set_master_clock_rate(30.72e06);
+ //openair0_cfg[0].samples_per_packet = 1024;
openair0_cfg[0].tx_sample_advance = 103;
openair0_cfg[0].tx_bw = 20e6;
openair0_cfg[0].rx_bw = 20e6;
break;
case 7680000:
s->usrp->set_master_clock_rate(30.72e6);
+ //openair0_cfg[0].samples_per_packet = 1024;
openair0_cfg[0].tx_sample_advance = 80;
openair0_cfg[0].tx_bw = 20e6;
openair0_cfg[0].rx_bw = 20e6;
break;
case 1920000:
s->usrp->set_master_clock_rate(30.72e6);
+ //openair0_cfg[0].samples_per_packet = 1024;
openair0_cfg[0].tx_sample_advance = 40;
openair0_cfg[0].tx_bw = 20e6;
openair0_cfg[0].rx_bw = 20e6;
@@ -758,7 +810,8 @@ extern "C" {
device->trx_stop_func = trx_usrp_stop;
device->trx_set_freq_func = trx_usrp_set_freq;
device->trx_set_gains_func = trx_usrp_set_gains;
-
+ device->openair0_cfg = openair0_cfg;
+
s->sample_rate = openair0_cfg[0].sample_rate;
// TODO:
// init tx_forward_nsamps based usrp_time_offset ex
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf
index ad3bcfcf92..3504adfff0 100644
--- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.oaisim.local_no_mme.conf
@@ -24,7 +24,7 @@ eNBs =
component_carriers = (
{
node_function = "eNodeB_3GPP";
- node_timing = "synch_to_other";
+ node_timing = "synch_to_ext_device";
node_synch_ref = 0;
frame_type = "FDD";
tdd_config = 3;
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.100PRB.if4p5.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.100PRB.if4p5.conf
new file mode 100644
index 0000000000..d97dc0c002
--- /dev/null
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.100PRB.if4p5.conf
@@ -0,0 +1,191 @@
+Active_eNBs = ( "eNB_Eurecom_LTEBox");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+
+eNBs =
+(
+ {
+ ////////// Identification parameters:
+ eNB_ID = 0xe00;
+
+ cell_type = "CELL_MACRO_ENB";
+
+ eNB_name = "eNB_Eurecom_LTEBox";
+
+ // Tracking area code, 0x0000 and 0xfffe are reserved values
+ tracking_area_code = "1";
+
+ mobile_country_code = "208";
+
+ mobile_network_code = "93";
+
+ ////////// Physical parameters:
+
+ component_carriers = (
+ {
+ node_function = "NGFI_RCC_IF4p5";
+ node_timing = "synch_to_ext_device";
+ node_synch_ref = 0;
+ frame_type = "FDD";
+ tdd_config = 3;
+ tdd_config_s = 0;
+ prefix_type = "NORMAL";
+ eutra_band = 7;
+ downlink_frequency = 2660000000L;
+ uplink_frequency_offset = -120000000;
+ Nid_cell = 0;
+ N_RB_DL = 100;
+ Nid_cell_mbsfn = 0;
+ nb_antennas_tx = 1;
+ nb_antennas_rx = 1;
+ tx_gain = 90;
+ rx_gain = 125;
+ prach_root = 0;
+ prach_config_index = 0;
+ prach_high_speed = "DISABLE";
+ prach_zero_correlation = 1;
+ prach_freq_offset = 2;
+ pucch_delta_shift = 1;
+ pucch_nRB_CQI = 1;
+ pucch_nCS_AN = 0;
+ pucch_n1_AN = 32;
+ pdsch_referenceSignalPower = -29;
+ pdsch_p_b = 0;
+ pusch_n_SB = 1;
+ pusch_enable64QAM = "DISABLE";
+ pusch_hoppingMode = "interSubFrame";
+ pusch_hoppingOffset = 0;
+ pusch_groupHoppingEnabled = "ENABLE";
+ pusch_groupAssignment = 0;
+ pusch_sequenceHoppingEnabled = "DISABLE";
+ pusch_nDMRS1 = 1;
+ phich_duration = "NORMAL";
+ phich_resource = "ONESIXTH";
+ srs_enable = "DISABLE";
+ /* srs_BandwidthConfig =;
+ srs_SubframeConfig =;
+ srs_ackNackST =;
+ srs_MaxUpPts =;*/
+
+ pusch_p0_Nominal = -90;
+ pusch_alpha = "AL1";
+ pucch_p0_Nominal = -96;
+ msg3_delta_Preamble = 6;
+ pucch_deltaF_Format1 = "deltaF2";
+ pucch_deltaF_Format1b = "deltaF3";
+ pucch_deltaF_Format2 = "deltaF0";
+ pucch_deltaF_Format2a = "deltaF0";
+ pucch_deltaF_Format2b = "deltaF0";
+
+ rach_numberOfRA_Preambles = 64;
+ rach_preamblesGroupAConfig = "DISABLE";
+ /*
+ rach_sizeOfRA_PreamblesGroupA = ;
+ rach_messageSizeGroupA = ;
+ rach_messagePowerOffsetGroupB = ;
+ */
+ rach_powerRampingStep = 4;
+ rach_preambleInitialReceivedTargetPower = -108;
+ rach_preambleTransMax = 10;
+ rach_raResponseWindowSize = 10;
+ rach_macContentionResolutionTimer = 48;
+ rach_maxHARQ_Msg3Tx = 4;
+
+ pcch_default_PagingCycle = 128;
+ pcch_nB = "oneT";
+ bcch_modificationPeriodCoeff = 2;
+ ue_TimersAndConstants_t300 = 1000;
+ ue_TimersAndConstants_t301 = 1000;
+ ue_TimersAndConstants_t310 = 1000;
+ ue_TimersAndConstants_t311 = 10000;
+ ue_TimersAndConstants_n310 = 20;
+ ue_TimersAndConstants_n311 = 1;
+
+ }
+ );
+
+
+ srb1_parameters :
+ {
+ # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
+ timer_poll_retransmit = 80;
+
+ # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
+ timer_reordering = 35;
+
+ # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
+ timer_status_prohibit = 0;
+
+ # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
+ poll_pdu = 4;
+
+ # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
+ poll_byte = 99999;
+
+ # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
+ max_retx_threshold = 4;
+ }
+
+ # ------- SCTP definitions
+ SCTP :
+ {
+ # Number of streams to use in input/output
+ SCTP_INSTREAMS = 2;
+ SCTP_OUTSTREAMS = 2;
+ };
+
+
+ ////////// MME parameters:
+ mme_ip_address = ( { ipv4 = "127.0.0.3";
+ ipv6 = "192:168:30::17";
+ active = "yes";
+ preference = "ipv4";
+ }
+ );
+
+ NETWORK_INTERFACES :
+ {
+
+ ENB_INTERFACE_NAME_FOR_S1_MME = "lo";
+ ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24";
+ ENB_INTERFACE_NAME_FOR_S1U = "lo";
+ ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24";
+ ENB_PORT_FOR_S1U = 2152; # Spec 2152
+ };
+
+ rrh_gw_config = (
+ {
+ local_if_name = "eth0";
+ remote_address = "74:d4:35:cc:8d:15";
+ local_address = "34:e6:d7:3c:ae:fc";
+ local_port = 50000; #for raw option local port must be the same to remote
+ remote_port = 50000;
+ rrh_gw_active = "yes";
+ tr_preference = "raw_if4p5";
+ rf_preference = "usrp_b200";
+ iq_txshift = 4;
+ tx_sample_advance = 80;
+ tx_scheduling_advance = 9;
+ }
+ );
+
+ log_config :
+ {
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="high";
+ rlc_log_level ="info";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="medium";
+ };
+ }
+);
+
diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.if4p5.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.if4p5.conf
new file mode 100644
index 0000000000..b264993dd4
--- /dev/null
+++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.50PRB.if4p5.conf
@@ -0,0 +1,191 @@
+Active_eNBs = ( "eNB_Eurecom_LTEBox");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+
+eNBs =
+(
+ {
+ ////////// Identification parameters:
+ eNB_ID = 0xe00;
+
+ cell_type = "CELL_MACRO_ENB";
+
+ eNB_name = "eNB_Eurecom_LTEBox";
+
+ // Tracking area code, 0x0000 and 0xfffe are reserved values
+ tracking_area_code = "1";
+
+ mobile_country_code = "208";
+
+ mobile_network_code = "93";
+
+ ////////// Physical parameters:
+
+ component_carriers = (
+ {
+ node_function = "NGFI_RCC_IF4p5";
+ node_timing = "synch_to_ext_device";
+ node_synch_ref = 0;
+ frame_type = "FDD";
+ tdd_config = 3;
+ tdd_config_s = 0;
+ prefix_type = "NORMAL";
+ eutra_band = 7;
+ downlink_frequency = 2660000000L;
+ uplink_frequency_offset = -120000000;
+ Nid_cell = 0;
+ N_RB_DL = 50;
+ Nid_cell_mbsfn = 0;
+ nb_antennas_tx = 1;
+ nb_antennas_rx = 1;
+ tx_gain = 90;
+ rx_gain = 125;
+ prach_root = 0;
+ prach_config_index = 0;
+ prach_high_speed = "DISABLE";
+ prach_zero_correlation = 1;
+ prach_freq_offset = 2;
+ pucch_delta_shift = 1;
+ pucch_nRB_CQI = 1;
+ pucch_nCS_AN = 0;
+ pucch_n1_AN = 32;
+ pdsch_referenceSignalPower = -29;
+ pdsch_p_b = 0;
+ pusch_n_SB = 1;
+ pusch_enable64QAM = "DISABLE";
+ pusch_hoppingMode = "interSubFrame";
+ pusch_hoppingOffset = 0;
+ pusch_groupHoppingEnabled = "ENABLE";
+ pusch_groupAssignment = 0;
+ pusch_sequenceHoppingEnabled = "DISABLE";
+ pusch_nDMRS1 = 1;
+ phich_duration = "NORMAL";
+ phich_resource = "ONESIXTH";
+ srs_enable = "DISABLE";
+ /* srs_BandwidthConfig =;
+ srs_SubframeConfig =;
+ srs_ackNackST =;
+ srs_MaxUpPts =;*/
+
+ pusch_p0_Nominal = -90;
+ pusch_alpha = "AL1";
+ pucch_p0_Nominal = -96;
+ msg3_delta_Preamble = 6;
+ pucch_deltaF_Format1 = "deltaF2";
+ pucch_deltaF_Format1b = "deltaF3";
+ pucch_deltaF_Format2 = "deltaF0";
+ pucch_deltaF_Format2a = "deltaF0";
+ pucch_deltaF_Format2b = "deltaF0";
+
+ rach_numberOfRA_Preambles = 64;
+ rach_preamblesGroupAConfig = "DISABLE";
+ /*
+ rach_sizeOfRA_PreamblesGroupA = ;
+ rach_messageSizeGroupA = ;
+ rach_messagePowerOffsetGroupB = ;
+ */
+ rach_powerRampingStep = 4;
+ rach_preambleInitialReceivedTargetPower = -108;
+ rach_preambleTransMax = 10;
+ rach_raResponseWindowSize = 10;
+ rach_macContentionResolutionTimer = 48;
+ rach_maxHARQ_Msg3Tx = 4;
+
+ pcch_default_PagingCycle = 128;
+ pcch_nB = "oneT";
+ bcch_modificationPeriodCoeff = 2;
+ ue_TimersAndConstants_t300 = 1000;
+ ue_TimersAndConstants_t301 = 1000;
+ ue_TimersAndConstants_t310 = 1000;
+ ue_TimersAndConstants_t311 = 10000;
+ ue_TimersAndConstants_n310 = 20;
+ ue_TimersAndConstants_n311 = 1;
+
+ }
+ );
+
+
+ srb1_parameters :
+ {
+ # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
+ timer_poll_retransmit = 80;
+
+ # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
+ timer_reordering = 35;
+
+ # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
+ timer_status_prohibit = 0;
+
+ # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
+ poll_pdu = 4;
+
+ # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
+ poll_byte = 99999;
+
+ # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
+ max_retx_threshold = 4;
+ }
+
+ # ------- SCTP definitions
+ SCTP :
+ {
+ # Number of streams to use in input/output
+ SCTP_INSTREAMS = 2;
+ SCTP_OUTSTREAMS = 2;
+ };
+
+
+ ////////// MME parameters:
+ mme_ip_address = ( { ipv4 = "127.0.0.3";
+ ipv6 = "192:168:30::17";
+ active = "yes";
+ preference = "ipv4";
+ }
+ );
+
+ NETWORK_INTERFACES :
+ {
+
+ ENB_INTERFACE_NAME_FOR_S1_MME = "lo";
+ ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24";
+ ENB_INTERFACE_NAME_FOR_S1U = "lo";
+ ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24";
+ ENB_PORT_FOR_S1U = 2152; # Spec 2152
+ };
+
+ rrh_gw_config = (
+ {
+ local_if_name = "eth0";
+ remote_address = "74:d4:35:cc:8d:15";
+ local_address = "34:e6:d7:3c:ae:fc";
+ local_port = 50000; #for raw option local port must be the same to remote
+ remote_port = 50000;
+ rrh_gw_active = "yes";
+ tr_preference = "raw_if4p5";
+ rf_preference = "usrp_b200";
+ iq_txshift = 4;
+ tx_sample_advance = 80;
+ tx_scheduling_advance = 9;
+ }
+ );
+
+ log_config :
+ {
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="high";
+ rlc_log_level ="info";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="medium";
+ };
+ }
+);
+
diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c
index 60a067b790..1023ccc04f 100644
--- a/targets/RT/USER/lte-enb.c
+++ b/targets/RT/USER/lte-enb.c
@@ -190,10 +190,10 @@ static inline void thread_top_init(char *thread_name,
if (sched_setattr(0, &attr, flags) < 0 ) {
perror("[SCHED] eNB tx thread: sched_setattr failed\n");
- exit(1);
+ exit_fun("Error setting deadline scheduler");
}
- LOG_I( HW, "[SCHED] eNB RXn-TXnp4 deadline thread (TID %ld) started on CPU %d\n", gettid(), sched_getcpu() );
+ LOG_I( HW, "[SCHED] eNB %s deadline thread (TID %ld) started on CPU %d\n", gettid(), thread_name,sched_getcpu() );
#else //LOW_LATENCY
int policy, s, j;
@@ -657,7 +657,7 @@ static void* eNB_thread_rxtx( void* param ) {
return &eNB_thread_rxtx_status;
}
-#if defined(ENABLE_ITTI)
+#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
/* Wait for eNB application initialization to be complete (eNB registration to MME) */
static void wait_system_ready (char *message, volatile int *start_flag) {
@@ -1036,7 +1036,7 @@ void rx_fh_if4p5(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
void rx_fh_slave(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
// This case is for synchronization to another thread
- // it just waits for an external event. The actual rx_rh is handle by the asynchronous RX thread
+ // it just waits for an external event. The actual rx_fh is handle by the asynchronous RX thread
eNB_proc_t *proc=&eNB->proc;
if (wait_on_condition(&proc->mutex_FH,&proc->cond_FH,&proc->instance_cnt_FH,"rx_fh_slave") < 0)
@@ -1080,8 +1080,8 @@ int wakeup_rxtx(eNB_proc_t *proc,eNB_rxtx_proc_t *proc_rxtx,LTE_DL_FRAME_PARMS *
// TS_rx is the last received timestamp (start of 1st slot), TS_tx is the desired
// transmitted timestamp of the next TX slot (first).
// The last (TS_rx mod samples_per_frame) was n*samples_per_tti,
- // we want to generate subframe (n+3), so TS_tx = TX_rx+3*samples_per_tti,
- // and proc->subframe_tx = proc->subframe_rx+3
+ // we want to generate subframe (n+4), so TS_tx = TX_rx+4*samples_per_tti,
+ // and proc->subframe_tx = proc->subframe_rx+4
proc_rxtx->timestamp_tx = proc->timestamp_rx + (4*fp->samples_per_tti);
proc_rxtx->frame_rx = proc->frame_rx;
proc_rxtx->subframe_rx = proc->subframe_rx;
@@ -1133,7 +1133,7 @@ void wakeup_slaves(eNB_proc_t *proc) {
break;
}
} else {
- LOG_W( PHY,"[eNB] Frame %d, FH CC_id %d thread busy!! (cnt_FH %i)\n",slave_proc->frame_rx,slave_proc->CC_id, cnt_slave);
+ LOG_W( PHY,"[eNB] Frame %d, slave CC_id %d thread busy!! (cnt_FH %i)\n",slave_proc->frame_rx,slave_proc->CC_id, cnt_slave);
exit_fun( "FH thread busy" );
break;
}
@@ -1165,7 +1165,7 @@ static void* eNB_thread_FH( void* param ) {
wait_sync("eNB_thread_FH");
-#if defined(ENABLE_ITTI)
+#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
if (eNB->node_function < NGFI_RRU_IF5)
wait_system_ready ("Waiting for eNB application to be ready %s\r", &start_eNB);
#endif
@@ -1277,7 +1277,7 @@ static void* eNB_thread_single( void* param ) {
wait_sync("eNB_thread_single");
-#if defined(ENABLE_ITTI)
+#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
if (eNB->node_function < NGFI_RRU_IF5)
wait_system_ready ("Waiting for eNB application to be ready %s\r", &start_eNB);
#endif
@@ -1311,6 +1311,7 @@ static void* eNB_thread_single( void* param ) {
subframe++;
}
+ LOG_D(PHY,"eNB Fronthaul thread, frame %d, subframe %d\n",frame,subframe);
// synchronization on FH interface, acquire signals/data and block
if (eNB->rx_fh) eNB->rx_fh(eNB,&frame,&subframe);
@@ -1318,6 +1319,7 @@ static void* eNB_thread_single( void* param ) {
T(T_ENB_MASTER_TICK, T_INT(0), T_INT(proc->frame_rx), T_INT(proc->subframe_rx));
+
// At this point, all information for subframe has been received on FH interface
// If this proc is to provide synchronization, do so
wakeup_slaves(proc);
@@ -1552,17 +1554,17 @@ int setup_eNB_buffers(PHY_VARS_eNB **phy_vars_eNB, openair0_config_t *openair0_c
for (i=0; inb_antennas_rx; i++) {
free(phy_vars_eNB[CC_id]->common_vars.rxdata[0][i]);
- rxdata[i] = (int32_t*)(32 + malloc16(32+openair0_cfg[phy_vars_eNB[CC_id]->rf_map.card].samples_per_frame*sizeof(int32_t))); // FIXME broken memory allocation
+ rxdata[i] = (int32_t*)(32 + malloc16(32+frame_parms->samples_per_tti*10*sizeof(int32_t))); // FIXME broken memory allocation
phy_vars_eNB[CC_id]->common_vars.rxdata[0][i] = rxdata[i]-N_TA_offset; // N_TA offset for TDD FIXME! N_TA_offset > 16 => access of unallocated memory
- memset(rxdata[i], 0, openair0_cfg[phy_vars_eNB[CC_id]->rf_map.card].samples_per_frame*sizeof(int32_t));
+ memset(rxdata[i], 0, frame_parms->samples_per_tti*10*sizeof(int32_t));
printf("rxdata[%d] @ %p (%p) (N_TA_OFFSET %d)\n", i, phy_vars_eNB[CC_id]->common_vars.rxdata[0][i],rxdata[i],N_TA_offset);
}
for (i=0; inb_antennas_tx; i++) {
free(phy_vars_eNB[CC_id]->common_vars.txdata[0][i]);
- txdata[i] = (int32_t*)(32 + malloc16(32 + openair0_cfg[phy_vars_eNB[CC_id]->rf_map.card].samples_per_frame*sizeof(int32_t))); // FIXME broken memory allocation
+ txdata[i] = (int32_t*)(32 + malloc16(32 + frame_parms->samples_per_tti*10*sizeof(int32_t))); // FIXME broken memory allocation
phy_vars_eNB[CC_id]->common_vars.txdata[0][i] = txdata[i];
- memset(txdata[i],0, openair0_cfg[phy_vars_eNB[CC_id]->rf_map.card].samples_per_frame*sizeof(int32_t));
+ memset(txdata[i],0, frame_parms->samples_per_tti*10*sizeof(int32_t));
printf("txdata[%d] @ %p\n", i, phy_vars_eNB[CC_id]->common_vars.txdata[0][i]);
}
}
diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c
index 852147f462..b9d6907c8e 100644
--- a/targets/RT/USER/lte-softmodem.c
+++ b/targets/RT/USER/lte-softmodem.c
@@ -382,7 +382,8 @@ void help (void) {
printf(" --ue-txgain set UE TX gain\n");
printf(" --ue-scan_carrier set UE to scan around carrier\n");
printf(" --loop-memory get softmodem (UE) to loop through memory instead of acquiring from HW\n");
- printf(" --mmapped-dma sets flag for improved EXMIMO UE performance\n");
+ printf(" --mmapped-dma sets flag for improved EXMIMO UE performance\n");
+ printf(" --single-thread runs lte-softmodem in only one thread\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");
@@ -401,6 +402,7 @@ void help (void) {
printf(" -W Enable L2 wireshark messages on localhost \n");
printf(" -V Enable VCD (generated file will be located atopenair_dump_eNB.vcd, read it with target/RT/USER/eNB.gtkw\n");
printf(" -x Set the transmission mode, valid options: 1 \n");
+ printf(" -E Apply three-quarter of sampling frequency, 23.04 Msps to reduce the data rate on USB/PCIe transfers (only valid for 20 MHz)\n");
#if T_TRACER
printf(" --T_port [port] use given port\n");
printf(" --T_nowait don't wait for tracer, start immediately\n");
diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c
index 88bce26d6c..c33005ebab 100644
--- a/targets/RT/USER/lte-ue.c
+++ b/targets/RT/USER/lte-ue.c
@@ -793,6 +793,16 @@ static void *UE_thread_rxn_txnp4(void *arg)
UE->UE_mode[0] = PRACH;
}
}
+
+ if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_UL) ||
+ (UE->frame_parms.frame_type == FDD) ||
+ (subframe_select( &UE->frame_parms, proc->subframe_tx ) == SF_S)) {
+
+ if (UE->mode != loop_through_memory) {
+ phy_procedures_UE_TX(UE,proc,0,0,normal_txrx,no_relay);
+ }
+ }
+
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_UE_THREAD_RXTX0+(proc->subframe_rx&1), 0 );
@@ -967,15 +977,18 @@ void *UE_thread(void *arg) {
if (start_rx_stream==0) {
start_rx_stream=1;
if (UE->mode != loop_through_memory) {
- LOG_I(PHY,"Resynchronizing RX by %d samples\n",UE->rx_offset);
- rxs = UE->rfdevice.trx_read_func(&UE->rfdevice,
- ×tamp,
- (void**)rxdata,
- UE->rx_offset,
- UE->frame_parms.nb_antennas_rx);
- if (rxs != UE->rx_offset) {
- exit_fun("problem in rx");
- return &UE_thread_retval;
+
+ if (UE->no_timing_correction==0) {
+ LOG_I(PHY,"Resynchronizing RX by %d samples\n",UE->rx_offset);
+ rxs = UE->rfdevice.trx_read_func(&UE->rfdevice,
+ ×tamp,
+ (void**)rxdata,
+ UE->rx_offset,
+ UE->frame_parms.nb_antennas_rx);
+ if (rxs != UE->rx_offset) {
+ exit_fun("problem in rx");
+ return &UE_thread_retval;
+ }
}
UE->rx_offset=0;
UE->proc.proc_rxtx[0].frame_rx++;
@@ -1049,10 +1062,15 @@ void *UE_thread(void *arg) {
int instance_cnt_rxtx = ++proc->instance_cnt_rxtx;
proc->subframe_rx=sf;
proc->subframe_tx=(sf+4)%10;
- proc->frame_tx = proc->frame_rx + (proc->subframe_rx>5)?1:0;
+ proc->frame_tx = proc->frame_rx + ((proc->subframe_rx>5)?1:0);
proc->timestamp_tx = timestamp+(4*UE->frame_parms.samples_per_tti)-UE->frame_parms.ofdm_symbol_size-UE->frame_parms.nb_prefix_samples0;
+ if (sf != (timestamp/UE->frame_parms.samples_per_tti)%10) {
+ LOG_E(PHY,"steady-state UE_thread error : frame_rx %d, subframe_rx %d, frame_tx %d, subframe_tx %d, rx subframe %d\n",proc->frame_rx,proc->subframe_rx,proc->frame_tx,proc->subframe_tx,(timestamp/UE->frame_parms.samples_per_tti)%10);
+ exit(-1);
+ }
+
if (pthread_mutex_unlock(&proc->mutex_rxtx) != 0) {
LOG_E( PHY, "[SCHED][UE] error unlocking mutex for UE RX\n" );
exit_fun("nothing to add");
diff --git a/targets/SIMU/USER/channel_sim.c b/targets/SIMU/USER/channel_sim.c
index 8ff6c88962..9034fc0574 100644
--- a/targets/SIMU/USER/channel_sim.c
+++ b/targets/SIMU/USER/channel_sim.c
@@ -437,9 +437,14 @@ void do_UL_sig(channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX][MAX_N
txdata = PHY_vars_UE_g[UE_id][CC_id]->common_vars.txdata;
sf_offset = subframe*frame_parms->samples_per_tti;
- if (((double)PHY_vars_UE_g[UE_id][CC_id]->tx_power_dBm +
+ if (((double)PHY_vars_UE_g[UE_id][CC_id]->tx_power_dBm[subframe] +
UE2eNB[UE_id][eNB_id][CC_id]->path_loss_dB) <= -125.0) {
// don't simulate a UE that is too weak
+ LOG_D(OCM,"[SIM][UL] UE %d tx_pwr %d dBm (num_RE %d) for subframe %d (sf_offset %d)\n",
+ UE_id,
+ PHY_vars_UE_g[UE_id][CC_id]->tx_power_dBm[subframe],
+ PHY_vars_UE_g[UE_id][CC_id]->tx_total_RE[subframe],
+ subframe,sf_offset);
} else {
tx_pwr = dac_fixed_gain((double**)s_re,
@@ -451,13 +456,13 @@ void do_UL_sig(channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX][MAX_N
sf_offset,
frame_parms->ofdm_symbol_size,
14,
- (double)PHY_vars_UE_g[UE_id][CC_id]->tx_power_dBm-10*log10((double)PHY_vars_UE_g[UE_id][CC_id]->tx_total_RE),
- PHY_vars_UE_g[UE_id][CC_id]->tx_total_RE); // This make the previous argument the total power
+ (double)PHY_vars_UE_g[UE_id][CC_id]->tx_power_dBm[subframe]-10*log10((double)PHY_vars_UE_g[UE_id][CC_id]->tx_total_RE[subframe]),
+ PHY_vars_UE_g[UE_id][CC_id]->tx_total_RE[subframe]); // This make the previous argument the total power
LOG_D(OCM,"[SIM][UL] UE %d tx_pwr %f dBm (target %d dBm, num_RE %d) for subframe %d (sf_offset %d)\n",
UE_id,
10*log10(tx_pwr),
- PHY_vars_UE_g[UE_id][CC_id]->tx_power_dBm,
- PHY_vars_UE_g[UE_id][CC_id]->tx_total_RE,
+ PHY_vars_UE_g[UE_id][CC_id]->tx_power_dBm[subframe],
+ PHY_vars_UE_g[UE_id][CC_id]->tx_total_RE[subframe],
subframe,sf_offset);
diff --git a/targets/SIMU/USER/oaisim.c b/targets/SIMU/USER/oaisim.c
index fddbf517fd..258096fe73 100644
--- a/targets/SIMU/USER/oaisim.c
+++ b/targets/SIMU/USER/oaisim.c
@@ -139,8 +139,10 @@ node_desc_t *ue_data[NUMBER_OF_UE_MAX];
pthread_cond_t sync_cond;
pthread_mutex_t sync_mutex;
-int sync_var;
+int sync_var=-1;
+pthread_mutex_t subframe_mutex;
+int subframe_eNB_mask=0,subframe_UE_mask=0;
openair0_config_t openair0_cfg[MAX_CARDS];
uint32_t downlink_frequency[MAX_NUM_CCs][4];
@@ -451,6 +453,10 @@ typedef enum l2l1_task_state_e {
l2l1_task_state_t l2l1_state = L2L1_WAITTING;
+extern openair0_timestamp current_eNB_rx_timestamp[NUMBER_OF_eNB_MAX][MAX_NUM_CCs];
+extern openair0_timestamp current_UE_rx_timestamp[NUMBER_OF_UE_MAX][MAX_NUM_CCs];
+
+
/*------------------------------------------------------------------------------*/
void *
l2l1_task (void *args_p)
@@ -719,6 +725,40 @@ l2l1_task (void *args_p)
clear_eNB_transport_info (oai_emulation.info.nb_enb_local);
+ CC_id=0;
+ int all_done=0;
+ while (all_done==0) {
+ pthread_mutex_lock(&subframe_mutex);
+ int subframe_eNB_mask_local = subframe_eNB_mask;
+ int subframe_UE_mask_local = subframe_UE_mask;
+ pthread_mutex_unlock(&subframe_mutex);
+ LOG_D(EMU,"Frame %d, Subframe %d: Checking masks %x,%x\n",frame,sf,subframe_eNB_mask,subframe_UE_mask);
+ if ((subframe_eNB_mask_local == ((1<frame_parms.samples_per_tti;
+ }
+ for (UE_inst = 0; UE_instframe_parms.samples_per_tti;
+ }
+
+
for (eNB_inst = oai_emulation.info.first_enb_local;
(eNB_inst
< (oai_emulation.info.first_enb_local
@@ -727,6 +767,7 @@ l2l1_task (void *args_p)
if (oai_emulation.info.cli_start_enb[eNB_inst] != 0) {
T(T_ENB_MASTER_TICK, T_INT(eNB_inst), T_INT(frame % 1024), T_INT(sf));
+ /*
LOG_D(EMU,
"PHY procedures eNB %d for frame %d, subframe %d TDD %d/%d Nid_cell %d\n",
eNB_inst,
@@ -736,7 +777,7 @@ l2l1_task (void *args_p)
PHY_vars_eNB_g[eNB_inst][0]->frame_parms.tdd_config,
PHY_vars_eNB_g[eNB_inst][0]->frame_parms.Nid_cell);
-
+ */
#ifdef OPENAIR2
//Application: traffic gen
update_otg_eNB (eNB_inst, oai_emulation.info.time_ms);
@@ -744,35 +785,8 @@ l2l1_task (void *args_p)
//IP/OTG to PDCP and PDCP to IP operation
// pdcp_run (frame, 1, 0, eNB_inst); //PHY_vars_eNB_g[eNB_id]->Mod_id
#endif
+
- CC_id=0;
- // trigger synch event to RAN FH thread for CC_id
- eNB_proc_t *proc = &PHY_vars_eNB_g[eNB_inst][CC_id]->proc;
-
-
- if (pthread_mutex_lock(&proc->mutex_FH) != 0) {
- LOG_E( PHY, "error locking mutex for FH\n");
- exit_fun( "error locking mutex" );
- break;
- }
- int cnt_FH = ++proc->instance_cnt_FH;
- proc->frame_rx = frame;
- proc->subframe_rx = sf;
- proc->timestamp_rx += PHY_vars_eNB_g[eNB_inst][CC_id]->frame_parms.samples_per_tti;
- pthread_mutex_unlock( &proc->mutex_FH );
-
- if (cnt_FH == 0) {
- if (pthread_cond_signal(&proc->cond_FH) != 0) {
- LOG_E(PHY,"ERROR pthread_cond_signal for eNB FH CCid %d\n",proc->CC_id);
- exit_fun("ERROR pthread_cond_signal");
- break;
- }
- }
- else {
- LOG_W(PHY,"[eNB] Frame %d, FH CC_id %d thread busy!! (cnt_FH %d)\n",proc->instance_cnt_FH);
- exit_fun("FH thread busy");
- break;
- }
#ifdef PRINT_STATS
if((sf==9) && frame%10==0)
@@ -1099,6 +1113,10 @@ main (int argc, char **argv)
sinr_dB = -20;
}
+ pthread_cond_init(&sync_cond,NULL);
+ pthread_mutex_init(&sync_mutex, NULL);
+ pthread_mutex_init(&subframe_mutex, NULL);
+
#ifdef OPENAIR2
init_omv ();
#endif
@@ -1116,6 +1134,15 @@ main (int argc, char **argv)
init_openair2 ();
init_ocm ();
+
+ // wait for all threads to startup
+ sleep(3);
+ printf("Sending sync to all threads\n");
+
+ pthread_mutex_lock(&sync_mutex);
+ sync_var=0;
+ pthread_cond_broadcast(&sync_cond);
+ pthread_mutex_unlock(&sync_mutex);
#ifdef SMBV
// Rohde&Schwarz SMBV100A vector signal generator
diff --git a/targets/SIMU/USER/oaisim_config.c b/targets/SIMU/USER/oaisim_config.c
index 51a5a03eac..a470558c27 100644
--- a/targets/SIMU/USER/oaisim_config.c
+++ b/targets/SIMU/USER/oaisim_config.c
@@ -456,7 +456,7 @@ int olg_config(void)
set_comp_log(PHY, LOG_TRACE, 0x15, 1);
set_comp_log(PDCP, LOG_DEBUG, 0x15,1);
set_comp_log(RRC, LOG_DEBUG, 0x15,1);
- set_comp_log(OCM, LOG_ERR, 0x15,20);
+ set_comp_log(OCM, LOG_DEBUG, 0x15,20);
set_comp_log(OTG, LOG_DEBUG, 0x15,1);
set_comp_log(OMG, LOG_NOTICE, 0x15,1);
set_comp_log(OPT, LOG_ERR, 0x15,1);
diff --git a/targets/SIMU/USER/oaisim_functions.c b/targets/SIMU/USER/oaisim_functions.c
index 7a5c36b45d..f6cb9fcb04 100644
--- a/targets/SIMU/USER/oaisim_functions.c
+++ b/targets/SIMU/USER/oaisim_functions.c
@@ -957,6 +957,11 @@ void init_seed(uint8_t set_seed)
}
}
+openair0_timestamp current_eNB_rx_timestamp[NUMBER_OF_eNB_MAX][MAX_NUM_CCs];
+openair0_timestamp current_UE_rx_timestamp[NUMBER_OF_UE_MAX][MAX_NUM_CCs];
+openair0_timestamp last_eNB_rx_timestamp[NUMBER_OF_eNB_MAX][MAX_NUM_CCs];
+openair0_timestamp last_UE_rx_timestamp[NUMBER_OF_UE_MAX][MAX_NUM_CCs];
+
int eNB_trx_start(openair0_device *device) {
return(0);
}
@@ -990,42 +995,44 @@ int UE_trx_set_gains(openair0_device *device, openair0_config_t *openair0_cfg) {
return(0);
}
+extern pthread_mutex_t subframe_mutex;
+extern int subframe_eNB_mask,subframe_UE_mask;
+
int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) {
- return(0);
-}
-
-int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) {
- return(0);
-}
-
-int eNB_trx_write(openair0_device *device,openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) {
int eNB_id = device->Mod_id;
int CC_id = device->CC_id;
- int UE_id;
- int subframe = (timestamp/PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.samples_per_tti)%10;
- for (UE_id=0;UE_id<=NB_UE_INST;UE_id++) {
- do_DL_sig(eNB2UE,
- enb_data,
- ue_data,
- subframe,
- 0, //abstraction_flag,
- &PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms,
- UE_id,
- CC_id);
- }
- return(0);
-}
+ int subframe;
+ int ready_for_new_subframe=0;
+ int subframe_eNB_mask_local;
+ int sample_count=0;
-int UE_trx_write(openair0_device *device,openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) {
+ *ptimestamp = last_eNB_rx_timestamp[eNB_id][CC_id];
- int UE_id = device->Mod_id;
- int CC_id = device->CC_id;
- int eNB_id;
- int subframe = (timestamp/PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti)%10;
+ LOG_D(PHY,"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);
+ // if we're at a subframe boundary generate UL signals for this eNB
- for (eNB_id=0;eNB_id<=NB_eNB_INST;eNB_id++) {
+ while (sample_countframe_parms.samples_per_tti)%10;
+ LOG_D(PHY,"eNB_trx_read generating UL subframe %d (Ts %llu, current TS %llu)\n",
+ subframe,(unsigned long long)*ptimestamp,
+ (unsigned long long)current_eNB_rx_timestamp[eNB_id][CC_id]);
+
do_UL_sig(UE2eNB,
enb_data,
ue_data,
@@ -1035,8 +1042,87 @@ int UE_trx_write(openair0_device *device,openair0_timestamp timestamp, void **bu
0, // frame is only used for abstraction
eNB_id,
CC_id);
+
+
+ last_eNB_rx_timestamp[eNB_id][CC_id] += PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.samples_per_tti;
+ sample_count += PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.samples_per_tti;
}
- return(0);
+
+ return(nsamps);
+}
+
+int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) {
+
+ int UE_id = device->Mod_id;
+ int CC_id = device->CC_id;
+ int subframe;
+ int ready_for_new_subframe=0;
+ int subframe_UE_mask_local;
+ int sample_count=0;
+ int read_size;
+
+ *ptimestamp = last_UE_rx_timestamp[UE_id][CC_id];
+
+ LOG_D(PHY,"UE_trx_read nsamps %d TS(%llu,%llu)\n",nsamps,
+ (unsigned long long)current_UE_rx_timestamp[UE_id][CC_id],
+ (unsigned long long)last_UE_rx_timestamp[UE_id][CC_id]);
+
+ if (nsamps < PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti)
+ read_size = nsamps;
+ else
+ read_size = PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti;
+
+ while (sample_countframe_parms.samples_per_tti)%10;
+ if ((last_UE_rx_timestamp[UE_id][CC_id]%PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti) > 0)
+ subframe++;
+
+ last_UE_rx_timestamp[UE_id][CC_id] += read_size;
+ sample_count += read_size;
+
+ if (subframe > 9)
+ return(nsamps);
+
+ LOG_D(PHY,"UE_trx_read generating DL subframe %d (Ts %llu, current TS %llu)\n",
+ subframe,(unsigned long long)*ptimestamp,
+ (unsigned long long)current_UE_rx_timestamp[UE_id][CC_id]);
+ do_DL_sig(eNB2UE,
+ enb_data,
+ ue_data,
+ subframe,
+ 0, //abstraction_flag,
+ &PHY_vars_UE_g[UE_id][CC_id]->frame_parms,
+ UE_id,
+ CC_id);
+ }
+
+ return(nsamps);
+}
+
+int eNB_trx_write(openair0_device *device,openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) {
+
+ return(nsamps);
+}
+
+int UE_trx_write(openair0_device *device,openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags) {
+
+ return(nsamps);
}
void init_devices(void){
@@ -1055,8 +1141,10 @@ void init_devices(void){
PHY_vars_eNB_g[eNB_id][CC_id]->rfdevice.trx_stop_func = eNB_trx_stop;
PHY_vars_eNB_g[eNB_id][CC_id]->rfdevice.trx_set_freq_func = eNB_trx_set_freq;
PHY_vars_eNB_g[eNB_id][CC_id]->rfdevice.trx_set_gains_func = eNB_trx_set_gains;
+ current_eNB_rx_timestamp[eNB_id][CC_id] = PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.samples_per_tti;
+ last_eNB_rx_timestamp[eNB_id][CC_id] = 0;
}
- for (UE_id=0;UE_idrfdevice.Mod_id = UE_id;
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.CC_id = CC_id;
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_start_func = UE_trx_start;
@@ -1066,6 +1154,9 @@ void init_devices(void){
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_stop_func = UE_trx_stop;
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_set_freq_func = UE_trx_set_freq;
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.trx_set_gains_func = UE_trx_set_gains;
+ current_UE_rx_timestamp[UE_id][CC_id] = PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti;
+ last_UE_rx_timestamp[UE_id][CC_id] = 0;
+
}
}
}
@@ -1123,7 +1214,11 @@ void init_openair1(void)
//N_TA_offset
for (CC_id=0; CC_iduse_ia_receiver = 0;
+
+ PHY_vars_UE_g[UE_id][CC_id]->use_ia_receiver = 0;
+ PHY_vars_UE_g[UE_id][CC_id]->mode = normal_txrx;
+ PHY_vars_UE_g[UE_id][CC_id]->mac_enabled = 1;
+ PHY_vars_UE_g[UE_id][CC_id]->no_timing_correction = 1;
if (PHY_vars_UE_g[UE_id][CC_id]->frame_parms.frame_type == TDD) {
if (PHY_vars_UE_g[UE_id][CC_id]->frame_parms.N_RB_DL == 100)
@@ -1396,7 +1491,7 @@ void update_ocm()
enb_data[eNB_id]->tx_power_dBm = PHY_vars_eNB_g[eNB_id][0]->frame_parms.pdsch_config_common.referenceSignalPower;
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++)
- ue_data[UE_id]->tx_power_dBm = PHY_vars_UE_g[UE_id][0]->tx_power_dBm;
+ ue_data[UE_id]->tx_power_dBm = PHY_vars_UE_g[UE_id][0]->tx_power_dBm[0];
/* check if the openair channel model is activated used for PHY abstraction : path loss*/
@@ -1450,10 +1545,10 @@ void update_ocm()
UE2eNB[UE_id][eNB_id][CC_id]->path_loss_dB = -132.24 + sinr_dB - PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.pdsch_config_common.referenceSignalPower;
}
- LOG_I(OCM,"Path loss from eNB %d to UE %d (CCid %d)=> %f dB (eNB TX %d, SNR %f)\n",eNB_id,UE_id,CC_id,
+ LOG_D(OCM,"Path loss from eNB %d to UE %d (CCid %d)=> %f dB (eNB TX %d, SNR %f)\n",eNB_id,UE_id,CC_id,
eNB2UE[eNB_id][UE_id][CC_id]->path_loss_dB,
PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.pdsch_config_common.referenceSignalPower,snr_dB);
- // printf("[SIM] Path loss from UE %d to eNB %d => %f dB\n",UE_id,eNB_id,UE2eNB[UE_id][eNB_id]->path_loss_dB);
+
}
}
}
@@ -1721,3 +1816,14 @@ void init_time()
td_avg = TARGET_SF_TIME_NS;
}
+int openair0_transport_load(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t * eth_params) {
+
+ return(0);
+
+
+}
+
+int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cfg) {
+
+ return(0);
+}