Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Michael Black
OpenXG UE
Commits
6a98e5d5
Commit
6a98e5d5
authored
Oct 12, 2016
by
Rohit Gupta
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'enhancement-10-harmony-lts' into develop
parents
a0ed8f20
c62b9f46
Changes
27
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
574 additions
and
458 deletions
+574
-458
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+16
-3
cmake_targets/at_commands/CMakeLists.txt
cmake_targets/at_commands/CMakeLists.txt
+18
-0
cmake_targets/autotests/README.txt
cmake_targets/autotests/README.txt
+0
-1
cmake_targets/autotests/test_case_list.xml
cmake_targets/autotests/test_case_list.xml
+1
-1
cmake_targets/build_oai
cmake_targets/build_oai
+1
-0
cmake_targets/tools/build_helper
cmake_targets/tools/build_helper
+56
-58
cmake_targets/tools/init_exmimo2
cmake_targets/tools/init_exmimo2
+0
-8
common/utils/itti/assertions.h
common/utils/itti/assertions.h
+1
-1
common/utils/itti/backtrace.c
common/utils/itti/backtrace.c
+2
-1
openair1/PHY/defs.h
openair1/PHY/defs.h
+12
-1
openair1/PHY/extern.h
openair1/PHY/extern.h
+7
-1
openair1/PHY/impl_defs_lte.h
openair1/PHY/impl_defs_lte.h
+8
-2
openair1/PHY/vars.h
openair1/PHY/vars.h
+9
-0
openair2/COMMON/s1ap_messages_types.h
openair2/COMMON/s1ap_messages_types.h
+4
-1
openair2/ENB_APP/enb_config.h
openair2/ENB_APP/enb_config.h
+9
-2
openair2/RRC/LITE/rrc_eNB.c
openair2/RRC/LITE/rrc_eNB.c
+6
-0
openair2/UTIL/OPT/opt.h
openair2/UTIL/OPT/opt.h
+4
-0
openair2/UTIL/OSA/osa_stream_eea.c
openair2/UTIL/OSA/osa_stream_eea.c
+5
-0
openair2/X2AP/x2ap_common.h
openair2/X2AP/x2ap_common.h
+2
-0
openair3/SECU/nas_stream_eea2.c
openair3/SECU/nas_stream_eea2.c
+5
-0
openair3/TEST/test_aes128_ctr_decrypt.c
openair3/TEST/test_aes128_ctr_decrypt.c
+6
-1
openair3/TEST/test_aes128_ctr_encrypt.c
openair3/TEST/test_aes128_ctr_encrypt.c
+5
-0
targets/ARCH/COMMON/common_lib.h
targets/ARCH/COMMON/common_lib.h
+8
-1
targets/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c
targets/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c
+1
-0
targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
+373
-373
targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h
targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h
+4
-0
targets/RT/USER/lte-enb.c
targets/RT/USER/lte-enb.c
+11
-3
No files found.
cmake_targets/CMakeLists.txt
View file @
6a98e5d5
...
@@ -181,7 +181,6 @@ set(GIT_BRANCH "UNKNOWN")
...
@@ -181,7 +181,6 @@ set(GIT_BRANCH "UNKNOWN")
set
(
GIT_COMMIT_HASH
"UNKNOWN"
)
set
(
GIT_COMMIT_HASH
"UNKNOWN"
)
set
(
GIT_COMMIT_DATE
"UNKNOWN"
)
set
(
GIT_COMMIT_DATE
"UNKNOWN"
)
find_package
(
Git
)
find_package
(
Git
)
if
(
GIT_FOUND
)
if
(
GIT_FOUND
)
message
(
"git found:
${
GIT_EXECUTABLE
}
"
)
message
(
"git found:
${
GIT_EXECUTABLE
}
"
)
...
@@ -875,7 +874,7 @@ set(UTIL_SRC
...
@@ -875,7 +874,7 @@ set(UTIL_SRC
${
OPENAIR2_DIR
}
/UTIL/OMG/job.c
${
OPENAIR2_DIR
}
/UTIL/OMG/job.c
${
OPENAIR2_DIR
}
/UTIL/OMG/mobility_parser.c
${
OPENAIR2_DIR
}
/UTIL/OMG/mobility_parser.c
${
OPENAIR2_DIR
}
/UTIL/OMG/omg.c
${
OPENAIR2_DIR
}
/UTIL/OMG/omg.c
${
OPENAIR2_DIR
}
/UTIL/OMG/omg_hashtable.c
#
${OPENAIR2_DIR}/UTIL/OMG/omg_hashtable.c
${
OPENAIR2_DIR
}
/UTIL/OMG/rwalk.c
${
OPENAIR2_DIR
}
/UTIL/OMG/rwalk.c
${
OPENAIR2_DIR
}
/UTIL/OMG/rwp.c
${
OPENAIR2_DIR
}
/UTIL/OMG/rwp.c
${
OPENAIR2_DIR
}
/UTIL/OMG/static.c
${
OPENAIR2_DIR
}
/UTIL/OMG/static.c
...
@@ -1532,11 +1531,25 @@ endif()
...
@@ -1532,11 +1531,25 @@ endif()
pkg_search_module
(
NETTLE nettle
)
pkg_search_module
(
NETTLE nettle
)
if
(
NOT
${
NETTLE_FOUND
}
)
if
(
NOT
${
NETTLE_FOUND
}
)
message
(
"PACKAGE nettle not found: some targets will fail
"
)
message
(
FATAL_ERROR
"PACKAGE nettle not found: some targets will fail. Run build_oai -I again!
"
)
else
()
else
()
include_directories
(
${
NETTLE_INCLUDE_DIRS
}
)
include_directories
(
${
NETTLE_INCLUDE_DIRS
}
)
endif
()
endif
()
message
(
"NETTLE VERSION_INSTALLED =
${
NETTLE_VERSION
}
"
)
string
(
REGEX REPLACE
"([0-9]+).*"
"
\\
1"
NETTLE_VERSION_MAJOR
${
NETTLE_VERSION
}
)
string
(
REGEX REPLACE
"[0-9]+
\\
.([0-9]+).*"
"
\\
1"
NETTLE_VERSION_MINOR
${
NETTLE_VERSION
}
)
message
(
"NETTLE_VERSION_MAJOR =
${
NETTLE_VERSION_MAJOR
}
"
)
message
(
"NETTLE_VERSION_MINOR =
${
NETTLE_VERSION_MINOR
}
"
)
if
(
"
${
NETTLE_VERSION_MAJOR
}
"
STREQUAL
""
OR
"
${
NETTLE_VERSION_MINOR
}
"
STREQUAL
""
)
message
(
FATAL_ERROR
"The nettle version not detected properly. Try to run build_oai -I again"
)
endif
()
add_definitions
(
"-DNETTLE_VERSION_MAJOR=
${
NETTLE_VERSION_MAJOR
}
"
)
add_definitions
(
"-DNETTLE_VERSION_MINOR=
${
NETTLE_VERSION_MINOR
}
"
)
pkg_search_module
(
XPM xpm
)
pkg_search_module
(
XPM xpm
)
if
(
NOT
${
XPM_FOUND
}
)
if
(
NOT
${
XPM_FOUND
}
)
message
(
"PACKAGE xpm not found: some targets will fail"
)
message
(
"PACKAGE xpm not found: some targets will fail"
)
...
...
cmake_targets/at_commands/CMakeLists.txt
View file @
6a98e5d5
...
@@ -88,6 +88,24 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.2 -std=gnu99 -Wall -Wstrict-prototype
...
@@ -88,6 +88,24 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.2 -std=gnu99 -Wall -Wstrict-prototype
set
(
CMAKE_C_FLAGS_DEBUG
"
${
CMAKE_C_FLAGS_DEBUG
}
-ggdb -DMALLOC_CHECK_=3"
)
set
(
CMAKE_C_FLAGS_DEBUG
"
${
CMAKE_C_FLAGS_DEBUG
}
-ggdb -DMALLOC_CHECK_=3"
)
set
(
CMAKE_C_FLAGS_RELWITHDEBINFO
"
${
CMAKE_C_FLAGS_RELWITHDEBINFO
}
-ggdb -DMALLOC_CHECK_=3 -O2"
)
set
(
CMAKE_C_FLAGS_RELWITHDEBINFO
"
${
CMAKE_C_FLAGS_RELWITHDEBINFO
}
-ggdb -DMALLOC_CHECK_=3 -O2"
)
#This is to detect nettle version changes between Ubuntu 14.04/16.04
set
(
nettle_cmd
"nettle-hash"
)
set
(
nettle_arg
"-V"
)
execute_process
(
COMMAND
${
nettle_cmd
}
${
nettle_arg
}
RESULT_VARIABLE rv OUTPUT_VARIABLE ov ERROR_VARIABLE ev
)
string
(
REGEX MATCH
"[+-]?[0-9]+([.][0-9]+)?"
nv
${
ov
}
)
message
(
"NETTLE_VERSION =
${
nv
}
"
)
# we need to remove decimal as floating point arithematic does not work properly with C preprocessor
STRING
(
REGEX REPLACE
"[.]"
""
nv
${
nv
}
)
if
(
"
${
nv
}
"
STREQUAL
""
)
message
(
FATAL_ERROR
"The nettle version not detected properly. Try to run build_oai -I again"
)
endif
()
set
(
NETTLE_VERSION
"
${
nv
}
"
)
add_definitions
(
"-DNETTLE_VERSION=
${
NETTLE_VERSION
}
"
)
include
(
FindPkgConfig
)
include
(
FindPkgConfig
)
...
...
cmake_targets/autotests/README.txt
View file @
6a98e5d5
OAI Test PLAN
OAI Test PLAN
#UNDER CONSTRUCTION. Not correct at the moment
Obj.# Case# Test# Description
Obj.# Case# Test# Description
...
...
cmake_targets/autotests/test_case_list.xml
View file @
6a98e5d5
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<GitOpenair-cnRepo>
https://gitlab.eurecom.fr/oai/openair-cn.git
</GitOpenair-cnRepo>
<GitOpenair-cnRepo>
https://gitlab.eurecom.fr/oai/openair-cn.git
</GitOpenair-cnRepo>
<GitOAI5GRepoBranch>
develop
</GitOAI5GRepoBranch>
<GitOAI5GRepoBranch>
develop
</GitOAI5GRepoBranch>
<GitOpenair-cnRepoBranch>
develop
</GitOpenair-cnRepoBranch>
<GitOpenair-cnRepoBranch>
develop
</GitOpenair-cnRepoBranch>
<CleanUpOldProgs>
oaisim oaisim_nos1 lte-softmodem lte-softmodem-nos1 mme_gw run_epc auth_request run_hss oai_hss mme spgw hss hss_sim
configure_cots*
wvdial iperf iperf_script iperf_script_phone ping tshark rrh_gw iperf3 iperf3_script iperf3_script_phone pppd starthss start_ltebox stop_ltebox configure_cots_sony_experia_m4_ue configure_cots_huaweiE398_ue configure_cots_bandrich_ue
</CleanUpOldProgs>
<CleanUpOldProgs>
oaisim oaisim_nos1 lte-softmodem lte-softmodem-nos1 mme_gw run_epc auth_request run_hss oai_hss mme spgw hss hss_sim wvdial iperf iperf_script iperf_script_phone ping tshark rrh_gw iperf3 iperf3_script iperf3_script_phone pppd starthss start_ltebox stop_ltebox configure_cots_sony_experia_m4_ue configure_cots_huaweiE398_ue configure_cots_bandrich_ue
</CleanUpOldProgs>
<CleanUpAluLteBox>
sudo -S -E /opt/ltebox/tools/stop_ltebox
</CleanUpAluLteBox>
<CleanUpAluLteBox>
sudo -S -E /opt/ltebox/tools/stop_ltebox
</CleanUpAluLteBox>
<ExmimoRfStop>
exmimo_pci=`lspci -m | grep Xilinx`; if [ -n "$exmimo_pci" ] ; then $OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; fi; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py --reset-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue; uname -a; sudo -E dmesg
</ExmimoRfStop>
<ExmimoRfStop>
exmimo_pci=`lspci -m | grep Xilinx`; if [ -n "$exmimo_pci" ] ; then $OPENAIR_DIR/cmake_targets/build_oai -w EXMIMO -c; sudo -S -E $OPENAIR_DIR/cmake_targets/tools/stop_exmimo2; fi; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_bandrich_ue.py --reset-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_huaweiE398_ue.py --reset-ue; sudo -E $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue; uname -a; sudo -E dmesg
</ExmimoRfStop>
<Timeout_execution>
36000
</Timeout_execution>
<Timeout_execution>
36000
</Timeout_execution>
...
...
cmake_targets/build_oai
View file @
6a98e5d5
...
@@ -552,6 +552,7 @@ function main() {
...
@@ -552,6 +552,7 @@ function main() {
compilations
\
compilations
\
$lte_build_dir
updatefw
\
$lte_build_dir
updatefw
\
updatefw
$dbin
/updatefw
updatefw
$dbin
/updatefw
echo_info
"Compiling oarf tools. The logfile for compilation is here:
$dlog
/oarf.txt"
make
-C
$OPENAIR_DIR
/cmake_targets/
$lte_build_dir
/build oarf
>
$dlog
/oarf.txt 2>&1
make
-C
$OPENAIR_DIR
/cmake_targets/
$lte_build_dir
/build oarf
>
$dlog
/oarf.txt 2>&1
cp
$OPENAIR_DIR
/cmake_targets/
$lte_build_dir
/build/
*
.oct
$dbin
cp
$OPENAIR_DIR
/cmake_targets/
$lte_build_dir
/build/
*
.oct
$dbin
if
[
-s
$dbin
/oarf_config_exmimo.oct
]
;
then
if
[
-s
$dbin
/oarf_config_exmimo.oct
]
;
then
...
...
cmake_targets/tools/build_helper
View file @
6a98e5d5
...
@@ -163,57 +163,6 @@ compilations() {
...
@@ -163,57 +163,6 @@ compilations() {
# External packages installers
# External packages installers
############################################
############################################
install_nettle_from_source() {
nettle_install_log=$OPENAIR_DIR/cmake_targets/log/nettle_install_log.txt
echo_info "\nInstalling Nettle. The log file for nettle installation is here: $nettle_install_log "
(
cd /tmp
echo "Downloading nettle archive"
$SUDO rm -rf /tmp/nettle-2.5.tar.gz* /tmp/nettle-2.5
wget http://ftp.nluug.nl/gnu/nettle/nettle-2.5.tar.gz
if [ $? -ne 0 ]; then
wget ftp://ftp.lysator.liu.se/pub/security/lsh/nettle-2.5.tar.gz
fi
if [ ! -f nettle-2.5.tar.gz ]; then
echo_error "Could not download nettle source files"
cd -
return
fi
tar -xzf nettle-2.5.tar.gz
cd nettle-2.5/
./configure --disable-openssl --enable-shared --prefix=/usr
echo "Compiling nettle"
make -j`nproc`
make check
$SUDO make install
) >& $nettle_install_log
}
install_gnutls_from_source(){
gnutls_install_log=$OPENAIR_DIR/cmake_targets/log/gnutls_install_log.txt
echo_info "\nInstalling Gnutls. The log file for Gnutls installation is here: $gnutls_install_log "
(
cd /tmp
echo "Downloading gnutls archive"
$SUDO rm -rf /tmp/gnutls-3.1.23.tar.xz* /tmp/gnutls-3.1.23
wget http://mirrors.dotsrc.org/gcrypt/gnutls/v3.1/gnutls-3.1.23.tar.xz || \
wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.1/gnutls-3.1.23.tar.xz
if [ ! -f gnutls-3.1.23.tar.xz ]; then
echo_error "Could not download gnutls source files"
cd -
return
fi
tar -xJf gnutls-3.1.23.tar.xz
cd gnutls-3.1.23/
./configure --prefix=/usr
echo "Compiling gnutls"
make -j`nproc`
$SUDO make install
)>& $gnutls_install_log
}
check_install_usrp_uhd_driver(){
check_install_usrp_uhd_driver(){
#first we remove old installation
#first we remove old installation
$SUDO apt-get remove -y uhd || true
$SUDO apt-get remove -y uhd || true
...
@@ -377,22 +326,71 @@ check_install_oai_software() {
...
@@ -377,22 +326,71 @@ check_install_oai_software() {
$SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so
$SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so
#Sometimes linux headers are not available in apt-get if kernel is custom or new
#Remove old gnutls/nettle installation that was done from sources
$SUDO apt-get install linux-headers-`uname -r` || true
remove_nettle_from_source
# First we remove gnutls/nettle installation and then install from sources
$SUDO apt-get remove -y libgnutls-dev nettle-dev nettle-bin
$SUDO apt-get install -y nettle-dev nettle-bin
install_nettle_from_source
remove_gnutls_from_source
install_gnutls_from_source
$SUDO apt-get install -y libgnutls-dev
install_asn1c_from_source
install_asn1c_from_source
}
}
### Remove Nettle installation which was done from sources
remove_nettle_from_source() {
nettle_uninstall_log=$OPENAIR_DIR/cmake_targets/log/nettle_uninstall_log.txt
echo_info "\nUn-Installing Nettle from sources. The log file for nettle un-installation is here: $nettle_uninstall_log "
(
$SUDO apt-get remove -y nettle-dev nettle-bin
cd /tmp
echo "Downloading nettle archive"
$SUDO rm -rf /tmp/nettle-2.5.tar.gz* /tmp/nettle-2.5
wget https://ftp.gnu.org/gnu/nettle/nettle-2.5.tar.gz
if [ $? -ne 0 ]; then
wget ftp://ftp.lysator.liu.se/pub/security/lsh/nettle-2.5.tar.gz
fi
if [ ! -f nettle-2.5.tar.gz ]; then
echo_error "Could not download nettle source files"
cd -
return
fi
tar -xzf nettle-2.5.tar.gz
cd nettle-2.5/
./configure --disable-openssl --enable-shared --prefix=/usr
$SUDO make uninstall || true
) >& $nettle_uninstall_log
}
### Remove Gnutls from source
remove_gnutls_from_source(){
gnutls_uninstall_log=$OPENAIR_DIR/cmake_targets/log/gnutls_uninstall_log.txt
echo_info "\nUn-Installing Gnutls. The log file for Gnutls un-installation is here: $gnutls_uninstall_log "
(
$SUDO apt-get remove -y libgnutls-dev
cd /tmp
echo "Downloading gnutls archive"
$SUDO rm -rf /tmp/gnutls-3.1.23.tar.xz* /tmp/gnutls-3.1.23
wget http://mirrors.dotsrc.org/gcrypt/gnutls/v3.1/gnutls-3.1.23.tar.xz || \
wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.1/gnutls-3.1.23.tar.xz
if [ ! -f gnutls-3.1.23.tar.xz ]; then
echo_error "Could not download gnutls source files"
cd -
return
fi
tar -xJf gnutls-3.1.23.tar.xz
cd gnutls-3.1.23/
./configure --prefix=/usr
$SUDO make uninstall || true
)>& $gnutls_uninstall_log
}
install_asn1c_from_source(){
install_asn1c_from_source(){
asn1_install_log=$OPENAIR_DIR/cmake_targets/log/asn1c_install_log.txt
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 "
echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_log "
(
(
$SUDO rm -rf /tmp/asn1c
$SUDO rm -rf /tmp/asn1c
git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c
GIT_SSL_NO_VERIFY=true
git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c
cd /tmp/asn1c
cd /tmp/asn1c
./configure
./configure
make -j`nproc`
make -j`nproc`
...
...
cmake_targets/tools/init_exmimo2
View file @
6a98e5d5
...
@@ -64,15 +64,7 @@ if [ ! -e /dev/openair0 ]; then
...
@@ -64,15 +64,7 @@ if [ ! -e /dev/openair0 ]; then
sudo chmod
a+rw /dev/openair0
sudo chmod
a+rw /dev/openair0
fi
fi
DEVICE
=
`
echo
$PCI
|
awk
-F
\"
'{print $(NF-1)}'
|
awk
'{print $2}'
`
DEVICE_SWID
=
${
DEVICE
:2:2
}
if
[
$DEVICE_SWID
==
'0a'
]
;
then
echo
"Using firware version 10"
$OPENAIR_DIR
/targets/bin/updatefw
-s
0x43fffff0
-b
-f
$OPENAIR_TARGETS
/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT/sdr_expressmimo2_v10
$OPENAIR_DIR
/targets/bin/updatefw
-s
0x43fffff0
-b
-f
$OPENAIR_TARGETS
/ARCH/EXMIMO/USERSPACE/OAI_FW_INIT/sdr_expressmimo2_v10
else
echo
'No corresponding firmware found'
return
fi
}
}
main
"
$@
"
main
"
$@
"
common/utils/itti/assertions.h
View file @
6a98e5d5
common/utils/itti/backtrace.c
View file @
6a98e5d5
...
@@ -37,7 +37,8 @@ void display_backtrace(void)
...
@@ -37,7 +37,8 @@ void display_backtrace(void)
size_t
size
;
size_t
size
;
char
**
strings
;
char
**
strings
;
size_t
i
;
size_t
i
;
char
*
test
=
getenv
(
"NO_BACKTRACE"
);
if
(
test
!=
0
)
*
((
int
*
)
0
)
=
0
;
size
=
backtrace
(
array
,
10
);
size
=
backtrace
(
array
,
10
);
strings
=
backtrace_symbols
(
array
,
size
);
strings
=
backtrace_symbols
(
array
,
size
);
...
...
openair1/PHY/defs.h
View file @
6a98e5d5
...
@@ -45,6 +45,11 @@
...
@@ -45,6 +45,11 @@
# define msg mexPrintf
# define msg mexPrintf
#else
#else
# ifdef OPENAIR2
# ifdef OPENAIR2
# if ENABLE_RAL
# include "collection/hashtable/hashtable.h"
# include "COMMON/ral_messages_types.h"
# include "UTIL/queue.h"
# endif
# include "log.h"
# include "log.h"
# define msg(aRGS...) LOG_D(PHY, ##aRGS)
# define msg(aRGS...) LOG_D(PHY, ##aRGS)
# else
# else
...
@@ -119,6 +124,8 @@ static inline void* malloc16_clear( size_t size )
...
@@ -119,6 +124,8 @@ static inline void* malloc16_clear( size_t size )
#include "PHY/TOOLS/defs.h"
#include "PHY/TOOLS/defs.h"
#include "platform_types.h"
#include "platform_types.h"
#ifdef OPENAIR_LTE
#include "PHY/LTE_TRANSPORT/defs.h"
#include "PHY/LTE_TRANSPORT/defs.h"
#include <pthread.h>
#include <pthread.h>
...
@@ -130,6 +137,9 @@ static inline void* malloc16_clear( size_t size )
...
@@ -130,6 +137,9 @@ static inline void* malloc16_clear( size_t size )
#define NB_BANDS_MAX 8
#define NB_BANDS_MAX 8
#ifdef OCP_FRAMEWORK
#include <enums.h>
#else
typedef
enum
{
normal_txrx
=
0
,
rx_calib_ue
=
1
,
rx_calib_ue_med
=
2
,
rx_calib_ue_byp
=
3
,
debug_prach
=
4
,
no_L2_connect
=
5
,
calib_prach_tx
=
6
,
rx_dump_frame
=
7
,
loop_through_memory
=
8
}
runmode_t
;
typedef
enum
{
normal_txrx
=
0
,
rx_calib_ue
=
1
,
rx_calib_ue_med
=
2
,
rx_calib_ue_byp
=
3
,
debug_prach
=
4
,
no_L2_connect
=
5
,
calib_prach_tx
=
6
,
rx_dump_frame
=
7
,
loop_through_memory
=
8
}
runmode_t
;
enum
transmission_access_mode
{
enum
transmission_access_mode
{
...
@@ -153,6 +163,7 @@ typedef enum {
...
@@ -153,6 +163,7 @@ typedef enum {
synch_to_ext_device
=
0
,
// synch to RF or Ethernet device
synch_to_ext_device
=
0
,
// synch to RF or Ethernet device
synch_to_other
// synch to another source (timer, other CC_id)
synch_to_other
// synch to another source (timer, other CC_id)
}
eNB_timing_t
;
}
eNB_timing_t
;
#endif
typedef
struct
UE_SCAN_INFO_s
{
typedef
struct
UE_SCAN_INFO_s
{
/// 10 best amplitudes (linear) for each pss signals
/// 10 best amplitudes (linear) for each pss signals
...
@@ -939,5 +950,5 @@ static inline int release_thread(pthread_mutex_t *mutex,int *instance_cnt,char *
...
@@ -939,5 +950,5 @@ static inline int release_thread(pthread_mutex_t *mutex,int *instance_cnt,char *
#include "PHY/LTE_ESTIMATION/defs.h"
#include "PHY/LTE_ESTIMATION/defs.h"
#include "SIMULATION/ETH_TRANSPORT/defs.h"
#include "SIMULATION/ETH_TRANSPORT/defs.h"
#endif
#endif // __PHY_DEFS__H__
#endif // __PHY_DEFS__H__
openair1/PHY/extern.h
View file @
6a98e5d5
...
@@ -40,11 +40,17 @@ extern int number_of_cards;
...
@@ -40,11 +40,17 @@ extern int number_of_cards;
//extern PHY_CONFIG *PHY_config;
//extern PHY_CONFIG *PHY_config;
//extern PHY_VARS *PHY_vars;
//extern PHY_VARS *PHY_vars;
#ifndef OCP_FRAMEWORK
extern
PHY_VARS_UE
***
PHY_vars_UE_g
;
extern
PHY_VARS_UE
***
PHY_vars_UE_g
;
extern
PHY_VARS_eNB
***
PHY_vars_eNB_g
;
extern
PHY_VARS_eNB
***
PHY_vars_eNB_g
;
extern
PHY_VARS_RN
**
PHY_vars_RN_g
;
extern
PHY_VARS_RN
**
PHY_vars_RN_g
;
extern
LTE_DL_FRAME_PARMS
*
lte_frame_parms_g
;
extern
LTE_DL_FRAME_PARMS
*
lte_frame_parms_g
;
#else
#define MAX_UE 10
#define MAX_eNB 20
extern
PHY_VARS_UE
*
PHY_vars_UE_g
[
MAX_UE
][
MAX_NUM_CCs
];
extern
PHY_VARS_eNB
*
PHY_vars_eNB_g
[
MAX_eNB
][
MAX_NUM_CCs
];
#endif
extern
MAC_xface
*
mac_xface
;
extern
MAC_xface
*
mac_xface
;
...
...
openair1/PHY/impl_defs_lte.h
View file @
6a98e5d5
...
@@ -54,7 +54,9 @@
...
@@ -54,7 +54,9 @@
#define MAX_MBSFN_AREA 8
#define MAX_MBSFN_AREA 8
#ifdef OCP_FRAMEWORK
#include "enums.h"
#else
typedef
enum
{
TDD
=
1
,
FDD
=
0
}
lte_frame_type_t
;
typedef
enum
{
TDD
=
1
,
FDD
=
0
}
lte_frame_type_t
;
typedef
enum
{
EXTENDED
=
1
,
NORMAL
=
0
}
lte_prefix_type_t
;
typedef
enum
{
EXTENDED
=
1
,
NORMAL
=
0
}
lte_prefix_type_t
;
...
@@ -74,7 +76,7 @@ typedef enum {
...
@@ -74,7 +76,7 @@ typedef enum {
one
=
6
,
one
=
6
,
two
=
12
two
=
12
}
PHICH_RESOURCE_t
;
}
PHICH_RESOURCE_t
;
#endif
/// PHICH-Config from 36.331 RRC spec
/// PHICH-Config from 36.331 RRC spec
typedef
struct
{
typedef
struct
{
/// Parameter: PHICH-Duration, see TS 36.211 (Table 6.9.3-1).
/// Parameter: PHICH-Duration, see TS 36.211 (Table 6.9.3-1).
...
@@ -161,10 +163,12 @@ typedef struct {
...
@@ -161,10 +163,12 @@ typedef struct {
}
UL_REFERENCE_SIGNALS_PUSCH_t
;
}
UL_REFERENCE_SIGNALS_PUSCH_t
;
/// Enumeration for parameter Hopping-mode \ref PUSCH_CONFIG_COMMON::hoppingMode.
/// Enumeration for parameter Hopping-mode \ref PUSCH_CONFIG_COMMON::hoppingMode.
#ifndef OCP_FRAMEWORK
typedef
enum
{
typedef
enum
{
interSubFrame
=
0
,
interSubFrame
=
0
,
intraAndInterSubFrame
=
1
intraAndInterSubFrame
=
1
}
PUSCH_HOPPING_t
;
}
PUSCH_HOPPING_t
;
#endif
/// PUSCH-ConfigCommon from 36.331 RRC spec.
/// PUSCH-ConfigCommon from 36.331 RRC spec.
typedef
struct
{
typedef
struct
{
...
@@ -329,6 +333,7 @@ typedef struct {
...
@@ -329,6 +333,7 @@ typedef struct {
uint8_t
filterCoefficient
;
uint8_t
filterCoefficient
;
}
UL_POWER_CONTROL_DEDICATED
;
}
UL_POWER_CONTROL_DEDICATED
;
#ifndef OCP_FRAMEWORK
/// Enumeration for parameter \f$\alpha\f$ \ref UL_POWER_CONTROL_CONFIG_COMMON::alpha.
/// Enumeration for parameter \f$\alpha\f$ \ref UL_POWER_CONTROL_CONFIG_COMMON::alpha.
typedef
enum
{
typedef
enum
{
al0
=
0
,
al0
=
0
,
...
@@ -340,6 +345,7 @@ typedef enum {
...
@@ -340,6 +345,7 @@ typedef enum {
al09
=
6
,
al09
=
6
,
al1
=
7
al1
=
7
}
PUSCH_alpha_t
;
}
PUSCH_alpha_t
;
#endif
/// \note UNUSED
/// \note UNUSED
typedef
enum
{
typedef
enum
{
...
...
openair1/PHY/vars.h
View file @
6a98e5d5
...
@@ -45,10 +45,15 @@ int16_t *primary_synch2_time;
...
@@ -45,10 +45,15 @@ int16_t *primary_synch2_time;
#include "PHY/CODING/vars.h"
#include "PHY/CODING/vars.h"
//PHY_VARS *PHY_vars;
//PHY_VARS *PHY_vars;
#ifndef OCP_FRAMEWORK
PHY_VARS_UE
***
PHY_vars_UE_g
;
PHY_VARS_UE
***
PHY_vars_UE_g
;
PHY_VARS_eNB
***
PHY_vars_eNB_g
;
PHY_VARS_eNB
***
PHY_vars_eNB_g
;
PHY_VARS_RN
**
PHY_vars_RN_g
;
PHY_VARS_RN
**
PHY_vars_RN_g
;
LTE_DL_FRAME_PARMS
*
lte_frame_parms_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
];
unsigned
short
rev
[
2048
],
rev_times4
[
8192
],
rev_half
[
1024
];
...
@@ -132,8 +137,12 @@ double beta2_dlsch[6][MCS_COUNT] = { {2.52163, 0.83231, 0.77472, 1.36536, 1.1682
...
@@ -132,8 +137,12 @@ double beta2_dlsch[6][MCS_COUNT] = { {2.52163, 0.83231, 0.77472, 1.36536, 1.1682
*/
*/
#ifdef OCP_FRAMEWORK
#include <enums.h>
#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_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"
};
char
eNB_timing
[
2
][
20
]
=
{
"synch_to_ext_device"
,
"synch_to_other"
};
#endif
/// lookup table for unscrambling in RX
/// lookup table for unscrambling in RX
int16_t
unscrambling_lut
[
65536
*
16
]
__attribute__
((
aligned
(
32
)));
int16_t
unscrambling_lut
[
65536
*
16
]
__attribute__
((
aligned
(
32
)));
...
...
openair2/COMMON/s1ap_messages_types.h
View file @
6a98e5d5
...
@@ -71,7 +71,7 @@
...
@@ -71,7 +71,7 @@
* the key length is 32 bytes (256 bits)
* the key length is 32 bytes (256 bits)
*/
*/
#define SECURITY_KEY_LENGTH 32
#define SECURITY_KEY_LENGTH 32
#ifndef OCP_FRAMEWORK
typedef
enum
cell_type_e
{
typedef
enum
cell_type_e
{
CELL_MACRO_ENB
,
CELL_MACRO_ENB
,
CELL_HOME_ENB
CELL_HOME_ENB
...
@@ -102,6 +102,7 @@ typedef enum cn_domain_s {
...
@@ -102,6 +102,7 @@ typedef enum cn_domain_s {
CN_DOMAIN_PS
=
1
,
CN_DOMAIN_PS
=
1
,
CN_DOMAIN_CS
=
2
CN_DOMAIN_CS
=
2
}
cn_domain_t
;
}
cn_domain_t
;
#endif
typedef
struct
net_ip_address_s
{
typedef
struct
net_ip_address_s
{
unsigned
ipv4
:
1
;
unsigned
ipv4
:
1
;
...
@@ -117,6 +118,7 @@ typedef struct ambr_s {
...
@@ -117,6 +118,7 @@ typedef struct ambr_s {
bitrate_t
br_dl
;
bitrate_t
br_dl
;
}
ambr_t
;
}
ambr_t
;
#ifndef OCP_FRAMEWORK
typedef
enum
priority_level_s
{
typedef
enum
priority_level_s
{
PRIORITY_LEVEL_SPARE
=
0
,
PRIORITY_LEVEL_SPARE
=
0
,
PRIORITY_LEVEL_HIGHEST
=
1
,
PRIORITY_LEVEL_HIGHEST
=
1
,
...
@@ -135,6 +137,7 @@ typedef enum pre_emp_vulnerability_e {
...
@@ -135,6 +137,7 @@ typedef enum pre_emp_vulnerability_e {
PRE_EMPTION_VULNERABILITY_DISABLED
=
1
,
PRE_EMPTION_VULNERABILITY_DISABLED
=
1
,
PRE_EMPTION_VULNERABILITY_MAX
,
PRE_EMPTION_VULNERABILITY_MAX
,
}
pre_emp_vulnerability_t
;
}
pre_emp_vulnerability_t
;
#endif
typedef
struct
allocation_retention_priority_s
{
typedef
struct
allocation_retention_priority_s
{
priority_level_t
priority_level
;
priority_level_t
priority_level
;
...
...
openair2/ENB_APP/enb_config.h
View file @
6a98e5d5
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
#include <sys/socket.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <arpa/inet.h>
#include <libconfig.h>
#include "commonDef.h"
#include "commonDef.h"
#include "platform_types.h"
#include "platform_types.h"
...
@@ -41,6 +42,7 @@
...
@@ -41,6 +42,7 @@
#include "s1ap_messages_types.h"
#include "s1ap_messages_types.h"
#ifdef CMAKER
#ifdef CMAKER
#include "SystemInformationBlockType2.h"
#include "SystemInformationBlockType2.h"
#include "rrc_messages_types.h"
#else
#else
#include "RRC/LITE/MESSAGES/SystemInformationBlockType2.h"
#include "RRC/LITE/MESSAGES/SystemInformationBlockType2.h"
#endif
#endif
...
@@ -109,6 +111,7 @@ typedef struct Enb_properties_s {
...
@@ -109,6 +111,7 @@ typedef struct Enb_properties_s {
*/
*/
char
*
eNB_name
;
char
*
eNB_name
;
/* Tracking area code */
/* Tracking area code */
uint16_t
tac
;
uint16_t
tac
;
...
@@ -123,6 +126,7 @@ typedef struct Enb_properties_s {
...
@@ -123,6 +126,7 @@ typedef struct Enb_properties_s {
/* Physical parameters */
/* Physical parameters */
int16_t
nb_cc
;
int16_t
nb_cc
;
#ifndef OCP_FRAMEWORK
eNB_func_t
cc_node_function
[
1
+
MAX_NUM_CCs
];
eNB_func_t
cc_node_function
[
1
+
MAX_NUM_CCs
];
eNB_timing_t
cc_node_timing
[
1
+
MAX_NUM_CCs
];
eNB_timing_t
cc_node_timing
[
1
+
MAX_NUM_CCs
];
int16_t
cc_node_synch_ref
[
1
+
MAX_NUM_CCs
];
int16_t
cc_node_synch_ref
[
1
+
MAX_NUM_CCs
];
...
@@ -199,8 +203,10 @@ typedef struct Enb_properties_s {
...
@@ -199,8 +203,10 @@ typedef struct Enb_properties_s {
long
ue_TimersAndConstants_t311
[
1
+
MAX_NUM_CCs
];
long
ue_TimersAndConstants_t311
[
1
+
MAX_NUM_CCs
];
long
ue_TimersAndConstants_n310
[
1
+
MAX_NUM_CCs
];
long
ue_TimersAndConstants_n310
[
1
+
MAX_NUM_CCs
];
long
ue_TimersAndConstants_n311
[
1
+
MAX_NUM_CCs
];
long
ue_TimersAndConstants_n311
[
1
+
MAX_NUM_CCs
];
#else
RrcConfigurationReq
RrcReq
;
#endif
long
ue_TransmissionMode
[
1
+
MAX_NUM_CCs
];
long
ue_TransmissionMode
[
1
+
MAX_NUM_CCs
];
long
srb1_timer_poll_retransmit
;
long
srb1_timer_poll_retransmit
;
long
srb1_timer_reordering
;
long
srb1_timer_reordering
;
long
srb1_timer_status_prohibit
;
long
srb1_timer_status_prohibit
;
...
@@ -229,6 +235,7 @@ typedef struct Enb_properties_s {
...
@@ -229,6 +235,7 @@ typedef struct Enb_properties_s {
/* List of MME to connect to */
/* List of MME to connect to */
rrh_gw_config_t
rrh_gw_config
[
4
];
rrh_gw_config_t
rrh_gw_config
[
4
];
#ifndef OCP_FRAMEWORK
// otg config
// otg config
/* Nb of OTG elements */
/* Nb of OTG elements */
uint8_t
num_otg_elements
;
uint8_t
num_otg_elements
;
...
@@ -257,7 +264,7 @@ typedef struct Enb_properties_s {
...
@@ -257,7 +264,7 @@ typedef struct Enb_properties_s {
int16_t
udp_log_verbosity
;
int16_t
udp_log_verbosity
;
int16_t
osa_log_level
;
int16_t
osa_log_level
;
int16_t
osa_log_verbosity
;
int16_t
osa_log_verbosity
;
#endif
}
Enb_properties_t
;
}
Enb_properties_t
;
typedef
struct
Enb_properties_array_s
{
typedef
struct
Enb_properties_array_s
{
...
...
openair2/RRC/LITE/rrc_eNB.c
View file @
6a98e5d5
...
@@ -3867,6 +3867,12 @@ openair_rrc_eNB_init(
...
@@ -3867,6 +3867,12 @@ openair_rrc_eNB_init(
PROTOCOL_RRC_CTXT_FMT
" Init...
\n
"
,
PROTOCOL_RRC_CTXT_FMT
" Init...
\n
"
,
PROTOCOL_RRC_CTXT_ARGS
(
&
ctxt
));
PROTOCOL_RRC_CTXT_ARGS
(
&
ctxt
));
#if OCP_FRAMEWORK
while
(
eNB_rrc_inst
==
NULL
)
{
LOG_E
(
RRC
,
"eNB_rrc_inst not yet initialized, waiting 1 second
\n
"
);
sleep
(
1
);
}
#endif
AssertFatal
(
eNB_rrc_inst
!=
NULL
,
"eNB_rrc_inst not initialized!"
);
AssertFatal
(
eNB_rrc_inst
!=
NULL
,
"eNB_rrc_inst not initialized!"
);
AssertFatal
(
NUMBER_OF_UE_MAX
<
(
module_id_t
)
0xFFFFFFFFFFFFFFFF
,
" variable overflow"
);
AssertFatal
(
NUMBER_OF_UE_MAX
<
(
module_id_t
)
0xFFFFFFFFFFFFFFFF
,
" variable overflow"
);
...
...
openair2/UTIL/OPT/opt.h
View file @
6a98e5d5
...
@@ -55,12 +55,16 @@ This header file must be included */
...
@@ -55,12 +55,16 @@ This header file must be included */
#include "PHY/impl_defs_lte.h"
#include "PHY/impl_defs_lte.h"
#endif
#endif
#ifdef OCP_FRAMEWORK
#include <enums.h>
#else
typedef
enum
trace_mode_e
{
typedef
enum
trace_mode_e
{
OPT_WIRESHARK
,
OPT_WIRESHARK
,
OPT_PCAP
,
OPT_PCAP
,
OPT_TSHARK
,
OPT_TSHARK
,
OPT_NONE
OPT_NONE
}
trace_mode_t
;
}
trace_mode_t
;
#endif
typedef
enum
radio_type_e
{
typedef
enum
radio_type_e
{
RADIO_TYPE_FDD
=
1
,
RADIO_TYPE_FDD
=
1
,
...
...
openair2/UTIL/OSA/osa_stream_eea.c
View file @
6a98e5d5
...
@@ -191,8 +191,13 @@ int stream_encrypt_eea2(stream_cipher_t *stream_cipher, uint8_t **out)
...
@@ -191,8 +191,13 @@ int stream_encrypt_eea2(stream_cipher_t *stream_cipher, uint8_t **out)
}
}
#endif
#endif
#if NETTLE_VERSION_MAJOR < 3
nettle_aes128
.
set_encrypt_key
(
ctx
,
stream_cipher
->
key_length
,
nettle_aes128
.
set_encrypt_key
(
ctx
,
stream_cipher
->
key_length
,
stream_cipher
->
key
);
stream_cipher
->
key
);
#else
nettle_aes128
.
set_encrypt_key
(
ctx
,
stream_cipher
->
key
);
#endif
nettle_ctr_crypt
(
ctx
,
nettle_aes128
.
encrypt
,
nettle_ctr_crypt
(
ctx
,
nettle_aes128
.
encrypt
,
nettle_aes128
.
block_size
,
m
,
nettle_aes128
.
block_size
,
m
,
...
...
openair2/X2AP/x2ap_common.h
View file @
6a98e5d5
...
@@ -282,8 +282,10 @@
...
@@ -282,8 +282,10 @@
# define X2AP_PORT 36422
# define X2AP_PORT 36422
#endif
#endif
#ifndef TRUE
#define TRUE 1
#define TRUE 1
#define FALSE 0
#define FALSE 0
#endif
extern
int
asn_debug
;
extern
int
asn_debug
;
extern
int
asn1_xer_print
;
extern
int
asn1_xer_print
;
...
...
openair3/SECU/nas_stream_eea2.c
View file @
6a98e5d5
...
@@ -78,8 +78,13 @@ int nas_stream_encrypt_eea2(nas_stream_cipher_t *stream_cipher, uint8_t *out)
...
@@ -78,8 +78,13 @@ int nas_stream_encrypt_eea2(nas_stream_cipher_t *stream_cipher, uint8_t *out)
}
}
#endif
#endif
#if NETTLE_VERSION_MAJOR < 3
nettle_aes128
.
set_encrypt_key
(
ctx
,
stream_cipher
->
key_length
,
nettle_aes128
.
set_encrypt_key
(
ctx
,
stream_cipher
->
key_length
,
stream_cipher
->
key
);
stream_cipher
->
key
);
#else
nettle_aes128
.
set_encrypt_key
(
ctx
,
stream_cipher
->
key
);
#endif
nettle_ctr_crypt
(
ctx
,
nettle_aes128
.
encrypt
,
nettle_ctr_crypt
(
ctx
,
nettle_aes128
.
encrypt
,
nettle_aes128
.
block_size
,
m
,
nettle_aes128
.
block_size
,
m
,
...
...
openair3/TEST/test_aes128_ctr_decrypt.c
View file @
6a98e5d5
...
@@ -41,7 +41,12 @@ void test_uncipher_ctr(const struct nettle_cipher *cipher, const uint8_t *key,
...
@@ -41,7 +41,12 @@ void test_uncipher_ctr(const struct nettle_cipher *cipher, const uint8_t *key,
uint8_t
*
data
=
malloc
(
length
);
uint8_t
*
data
=
malloc
(
length
);
uint8_t
*
ctr
=
malloc
(
cipher
->
block_size
);
uint8_t
*
ctr
=
malloc
(
cipher
->
block_size
);
#if NETTLE_VERSION_MAJOR < 3
cipher
->
set_encrypt_key
(
ctx
,
key_length
,
key
);
cipher
->
set_encrypt_key
(
ctx
,
key_length
,
key
);
#else
cipher
->
set_encrypt_key
(
ctx
,
key
);
#endif
memcpy
(
ctr
,
ictr
,
cipher
->
block_size
);
memcpy
(
ctr
,
ictr
,
cipher
->
block_size
);
ctr_crypt
(
ctx
,
cipher
->
encrypt
,
ctr_crypt
(
ctx
,
cipher
->
encrypt
,
...
...
openair3/TEST/test_aes128_ctr_encrypt.c
View file @
6a98e5d5
...
@@ -40,7 +40,12 @@ static void test_cipher_ctr(const struct nettle_cipher *cipher, const uint8_t *k
...
@@ -40,7 +40,12 @@ static void test_cipher_ctr(const struct nettle_cipher *cipher, const uint8_t *k
uint8_t
*
data
=
malloc
(
length
);
uint8_t
*
data
=
malloc
(
length
);
uint8_t
*
ctr
=
malloc
(
cipher
->
block_size
);
uint8_t
*
ctr
=
malloc
(
cipher
->
block_size
);
#if NETTLE_VERSION_MAJOR < 3
cipher
->
set_encrypt_key
(
ctx
,
key_length
,
key
);
cipher
->
set_encrypt_key
(
ctx
,
key_length
,
key
);
#else
cipher
->
set_encrypt_key
(
ctx
,
key
);
#endif
memcpy
(
ctr
,
ictr
,
cipher
->
block_size
);
memcpy
(
ctr
,
ictr
,
cipher
->
block_size
);
ctr_crypt
(
ctx
,
cipher
->
encrypt
,
ctr_crypt
(
ctx
,
cipher
->
encrypt
,
...
...
targets/ARCH/COMMON/common_lib.h
View file @
6a98e5d5
...
@@ -65,10 +65,13 @@ typedef enum {
...
@@ -65,10 +65,13 @@ typedef enum {
max_gain
=
0
,
med_gain
,
byp_gain
max_gain
=
0
,
med_gain
,
byp_gain
}
rx_gain_t
;
}
rx_gain_t
;
#if OCP_FRAMEWORK
#include <enums.h>
#else
typedef
enum
{
typedef
enum
{
duplex_mode_TDD
=
1
,
duplex_mode_FDD
=
0
duplex_mode_TDD
=
1
,
duplex_mode_FDD
=
0
}
duplex_mode_t
;
}
duplex_mode_t
;
#endif
/** @addtogroup _GENERIC_PHY_RF_INTERFACE_
/** @addtogroup _GENERIC_PHY_RF_INTERFACE_
...
@@ -76,6 +79,9 @@ typedef enum {
...
@@ -76,6 +79,9 @@ typedef enum {
*/
*/
/*!\brief RF device types
/*!\brief RF device types
*/
*/
#ifdef OCP_FRAMEWORK
#include <enums.h>
#else
typedef
enum
{
typedef
enum
{
MIN_RF_DEV_TYPE
=
0
,
MIN_RF_DEV_TYPE
=
0
,
/*!\brief device is ExpressMIMO */
/*!\brief device is ExpressMIMO */
...
@@ -93,6 +99,7 @@ typedef enum {
...
@@ -93,6 +99,7 @@ typedef enum {
MAX_RF_DEV_TYPE
MAX_RF_DEV_TYPE
}
dev_type_t
;
}
dev_type_t
;
#endif
/*!\brief transport protocol types
/*!\brief transport protocol types
*/
*/
...
...
targets/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c
View file @
6a98e5d5
...
@@ -264,6 +264,7 @@ int trx_eth_read_raw(openair0_device *device, openair0_timestamp *timestamp, voi
...
@@ -264,6 +264,7 @@ int trx_eth_read_raw(openair0_device *device, openair0_timestamp *timestamp, voi
if
(
bytes_received
==-
1
)
{
if
(
bytes_received
==-
1
)
{
eth
->
num_rx_errors
++
;
eth
->
num_rx_errors
++
;
perror
(
"ETHERNET IF5 READ: "
);
perror
(
"ETHERNET IF5 READ: "
);
if
(
errno
==
EAGAIN
)
continue
;
exit
(
-
1
);
exit
(
-
1
);
}
else
{
}
else
{
/* store the timestamp value from packet's header */
/* store the timestamp value from packet's header */
...
...
targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
View file @
6a98e5d5
...
@@ -494,7 +494,7 @@ void inline dump_buff(openair0_device *device, char *buff,unsigned int tx_rx_fla
...
@@ -494,7 +494,7 @@ void inline dump_buff(openair0_device *device, char *buff,unsigned int tx_rx_fla
void
dump_iqs
(
char
*
buff
,
int
iq_cnt
)
{
void
dump_iqs
(
char
*
buff
,
int
iq_cnt
)
{
int
i
;
int
i
;
for
(
i
=
0
;
i
<
iq_cnt
;
i
++
)
{
for
(
i
=
0
;
i
<
iq_cnt
;
i
++
)
{
printf
(
"s%02i: Q=%+ij I=%+i%s"
,
i
,
printf
(
"s%02i: Q=%+ij I=%+i%s"
,
i
,
((
iqoai_t
*
)(
buff
))[
i
].
q
,
((
iqoai_t
*
)(
buff
))[
i
].
q
,
((
iqoai_t
*
)(
buff
))[
i
].
i
,
((
iqoai_t
*
)(
buff
))[
i
].
i
,
...
...
targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h
View file @
6a98e5d5
...
@@ -37,11 +37,15 @@
...
@@ -37,11 +37,15 @@
#include "PHY/LTE_TRANSPORT/if5_tools.h"
#include "PHY/LTE_TRANSPORT/if5_tools.h"
// ETH transport preference modes
// ETH transport preference modes
#ifdef OCP_FRAMEWORK
#include "enums.h"
#else
#define ETH_UDP_MODE 0
#define ETH_UDP_MODE 0
#define ETH_RAW_MODE 1
#define ETH_RAW_MODE 1
#define ETH_UDP_IF4p5_MODE 2
#define ETH_UDP_IF4p5_MODE 2
#define ETH_RAW_IF4p5_MODE 3
#define ETH_RAW_IF4p5_MODE 3
#define ETH_RAW_IF5_MOBIPASS 4
#define ETH_RAW_IF5_MOBIPASS 4
#endif
// Time domain RRH packet sizes
// Time domain RRH packet sizes
#define MAC_HEADER_SIZE_BYTES (sizeof(struct ether_header))
#define MAC_HEADER_SIZE_BYTES (sizeof(struct ether_header))
...
...
targets/RT/USER/lte-enb.c
View file @
6a98e5d5
...
@@ -151,6 +151,8 @@ static struct {
...
@@ -151,6 +151,8 @@ static struct {
volatile
uint8_t
phy_proc_CC_id
;
volatile
uint8_t
phy_proc_CC_id
;
}
sync_phy_proc
;
}
sync_phy_proc
;
extern
double
cpuf
;
void
exit_fun
(
const
char
*
s
);
void
exit_fun
(
const
char
*
s
);
void
init_eNB
(
eNB_func_t
node_function
[],
eNB_timing_t
node_timing
[],
int
nb_inst
,
eth_params_t
*
,
int
);
void
init_eNB
(
eNB_func_t
node_function
[],
eNB_timing_t
node_timing
[],
int
nb_inst
,
eth_params_t
*
,
int
);
...
@@ -182,11 +184,9 @@ static inline void thread_top_init(char *thread_name,
...
@@ -182,11 +184,9 @@ static inline void thread_top_init(char *thread_name,
if
(
sched_setattr
(
0
,
&
attr
,
flags
)
<
0
)
{
if
(
sched_setattr
(
0
,
&
attr
,
flags
)
<
0
)
{
perror
(
"[SCHED] eNB tx thread: sched_setattr failed
\n
"
);
perror
(
"[SCHED] eNB tx thread: sched_setattr failed
\n
"
);
exit
_fun
(
"Error setting deadline scheduler"
);
exit
(
1
);
}
}
LOG_I
(
HW
,
"[SCHED] eNB %s deadline thread started on CPU %d
\n
"
,
thread_name
,
sched_getcpu
()
);
#else //LOW_LATENCY
#else //LOW_LATENCY
int
policy
,
s
,
j
;
int
policy
,
s
,
j
;
struct
sched_param
sparam
;
struct
sched_param
sparam
;
...
@@ -582,6 +582,7 @@ static void* eNB_thread_rxtx( void* param ) {
...
@@ -582,6 +582,7 @@ static void* eNB_thread_rxtx( void* param ) {
// set default return value
// set default return value
eNB_thread_rxtx_status
=
0
;
eNB_thread_rxtx_status
=
0
;
sprintf
(
thread_name
,
"RXn_TXnp4_%d
\n
"
,
&
eNB
->
proc
.
proc_rxtx
[
0
]
==
proc
?
0
:
1
);
sprintf
(
thread_name
,
"RXn_TXnp4_%d
\n
"
,
&
eNB
->
proc
.
proc_rxtx
[
0
]
==
proc
?
0
:
1
);
thread_top_init
(
thread_name
,
1
,
850000L
,
1000000L
,
2000000L
);
thread_top_init
(
thread_name
,
1
,
850000L
,
1000000L
,
2000000L
);
...
@@ -786,6 +787,7 @@ static void* eNB_thread_asynch_rxtx( void* param ) {
...
@@ -786,6 +787,7 @@ static void* eNB_thread_asynch_rxtx( void* param ) {
PHY_VARS_eNB
*
eNB
=
PHY_vars_eNB_g
[
0
][
proc
->
CC_id
];
PHY_VARS_eNB
*
eNB
=
PHY_vars_eNB_g
[
0
][
proc
->
CC_id
];
int
subframe
=
0
,
frame
=
0
;
int
subframe
=
0
,
frame
=
0
;
thread_top_init
(
"thread_asynch"
,
1
,
870000L
,
1000000L
,
1000000L
);
thread_top_init
(
"thread_asynch"
,
1
,
870000L
,
1000000L
,
1000000L
);
...
@@ -1312,7 +1314,9 @@ void init_eNB_proc(int inst) {
...
@@ -1312,7 +1314,9 @@ void init_eNB_proc(int inst) {
for
(
CC_id
=
0
;
CC_id
<
MAX_NUM_CCs
;
CC_id
++
)
{
for
(
CC_id
=
0
;
CC_id
<
MAX_NUM_CCs
;
CC_id
++
)
{
eNB
=
PHY_vars_eNB_g
[
inst
][
CC_id
];
eNB
=
PHY_vars_eNB_g
[
inst
][
CC_id
];
#ifndef OCP_FRAMEWORK
LOG_I
(
PHY
,
"Initializing eNB %d CC_id %d (%s,%s),
\n
"
,
inst
,
CC_id
,
eNB_functions
[
eNB
->
node_function
],
eNB_timing
[
eNB
->
node_timing
]);
LOG_I
(
PHY
,
"Initializing eNB %d CC_id %d (%s,%s),
\n
"
,
inst
,
CC_id
,
eNB_functions
[
eNB
->
node_function
],
eNB_timing
[
eNB
->
node_timing
]);
#endif
proc
=
&
eNB
->
proc
;
proc
=
&
eNB
->
proc
;
proc_rxtx
=
proc
->
proc_rxtx
;
proc_rxtx
=
proc
->
proc_rxtx
;
...
@@ -1374,6 +1378,8 @@ void init_eNB_proc(int inst) {
...
@@ -1374,6 +1378,8 @@ void init_eNB_proc(int inst) {
if
((
eNB
->
node_timing
==
synch_to_other
)
||
if
((
eNB
->
node_timing
==
synch_to_other
)
||
(
eNB
->
node_function
==
NGFI_RRU_IF5
)
||
(
eNB
->
node_function
==
NGFI_RRU_IF5
)
||
(
eNB
->
node_function
==
NGFI_RRU_IF4p5
))
(
eNB
->
node_function
==
NGFI_RRU_IF4p5
))
pthread_create
(
&
proc
->
pthread_asynch_rxtx
,
attr_asynch
,
eNB_thread_asynch_rxtx
,
&
eNB
->
proc
);
pthread_create
(
&
proc
->
pthread_asynch_rxtx
,
attr_asynch
,
eNB_thread_asynch_rxtx
,
&
eNB
->
proc
);
char
name
[
16
];
char
name
[
16
];
...
@@ -1606,7 +1612,9 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst
...
@@ -1606,7 +1612,9 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst
eNB
->
node_timing
=
node_timing
[
CC_id
];
eNB
->
node_timing
=
node_timing
[
CC_id
];
eNB
->
abstraction_flag
=
0
;
eNB
->
abstraction_flag
=
0
;
eNB
->
single_thread_flag
=
single_thread_flag
;
eNB
->
single_thread_flag
=
single_thread_flag
;
#ifndef OCP_FRAMEWORK
LOG_I
(
PHY
,
"Initializing eNB %d CC_id %d : (%s,%s)
\n
"
,
inst
,
CC_id
,
eNB_functions
[
node_function
[
CC_id
]],
eNB_timing
[
node_timing
[
CC_id
]]);
LOG_I
(
PHY
,
"Initializing eNB %d CC_id %d : (%s,%s)
\n
"
,
inst
,
CC_id
,
eNB_functions
[
node_function
[
CC_id
]],
eNB_timing
[
node_timing
[
CC_id
]]);
#endif
switch
(
node_function
[
CC_id
])
{
switch
(
node_function
[
CC_id
])
{
case
NGFI_RRU_IF5
:
case
NGFI_RRU_IF5
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment