Commit 1d6fb2ab authored by Rohit Gupta's avatar Rohit Gupta

Merge branch 'develop' into feature-44-dedicated-drb

parents eee16d48 f1c8c96c
...@@ -29,10 +29,7 @@ ...@@ -29,10 +29,7 @@
# *******************************************************************************/ # *******************************************************************************/
# \file test01.py # \author Rohit Gupta
# \brief test 01 for OAI
# \author Navid Nikaein
# \date 2013 - 2015
# \version 0.1 # \version 0.1
# @ingroup _test # @ingroup _test
...@@ -1529,9 +1526,8 @@ for testcase in testcaseList: ...@@ -1529,9 +1526,8 @@ for testcase in testcaseList:
print "Now copying files to NFS Share" print "Now copying files to NFS Share"
oai_localhost = openair('localdomain','localhost') oai_localhost = openair('localdomain','localhost')
oai_localhost.connect(user,pw) oai_localhost.connect(user,pw)
cmd = ' rm -fr ' + NFSTestsResultsDir + ' ; mkdir -p ' + NFSTestsResultsDir cmd = ' mkdir -p ' + NFSTestsResultsDir
res = oai_localhost.send_recv(cmd) res = oai_localhost.send_recv(cmd)
print "Deleting NFSTestResults Dir..." + res
print "Copying files from GilabCI Runner Machine : " + host + " .locallogdir = " + locallogdir + ", NFSTestsResultsDir = " + NFSTestsResultsDir print "Copying files from GilabCI Runner Machine : " + host + " .locallogdir = " + locallogdir + ", NFSTestsResultsDir = " + NFSTestsResultsDir
SSHSessionWrapper('localhost', user, None, pw , NFSTestsResultsDir , locallogdir, "put_all") SSHSessionWrapper('localhost', user, None, pw , NFSTestsResultsDir , locallogdir, "put_all")
...@@ -1568,12 +1564,15 @@ res=os.system(cmd) ...@@ -1568,12 +1564,15 @@ res=os.system(cmd)
print "Now copying files to NFS Share" print "Now copying files to NFS Share"
oai_localhost = openair('localdomain','localhost') oai_localhost = openair('localdomain','localhost')
oai_localhost.connect(user,pw) oai_localhost.connect(user,pw)
cmd = ' rm -fr ' + NFSTestsResultsDir + ' ; mkdir -p ' + NFSTestsResultsDir cmd = 'mkdir -p ' + NFSTestsResultsDir
res = oai_localhost.send_recv(cmd) res = oai_localhost.send_recv(cmd)
print "Deleting NFSTestResults Dir..." + res
print "Copying files from GilabCI Runner Machine : " + host + " .locallogdir = " + locallogdir + ", NFSTestsResultsDir = " + NFSTestsResultsDir print "Copying files from GilabCI Runner Machine : " + host + " .locallogdir = " + locallogdir + ", NFSTestsResultsDir = " + NFSTestsResultsDir
SSHSessionWrapper('localhost', user, None, pw , NFSTestsResultsDir , locallogdir, "put_all") SSHSessionWrapper('localhost', user, None, pw , NFSTestsResultsDir , locallogdir, "put_all")
cmd = "cat " + NFSTestsResultsDir + "/log/*/*.xml > " + NFSTestsResultsDir + "/log/results_autotests.xml"
res = oai_localhost.send_recv(cmd)
oai_localhost.disconnect() oai_localhost.disconnect()
sys.exit() sys.exit()
...@@ -6146,7 +6146,7 @@ c ...@@ -6146,7 +6146,7 @@ c
<HSS_main_exec_args></HSS_main_exec_args> <HSS_main_exec_args></HSS_main_exec_args>
<EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </EPC_traffic_exec> <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </EPC_traffic_exec>
<EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_traffic_exec_args></EPC_traffic_exec_args>
<EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> <EPC_search_expr_true>throughput_test min=5.0Mbits/sec max=5.0Mbits/sec average=5.0Mbits/sec </EPC_search_expr_true>
<EPC_search_expr_false></EPC_search_expr_false> <EPC_search_expr_false></EPC_search_expr_false>
<EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
<tags>USRPb210.ALU_EPC.SonyExperiaM4.5MHz.FDD.Band_7.UL.1TX.1RX</tags> <tags>USRPb210.ALU_EPC.SonyExperiaM4.5MHz.FDD.Band_7.UL.1TX.1RX</tags>
...@@ -6199,7 +6199,7 @@ c ...@@ -6199,7 +6199,7 @@ c
<UE_pre_exec_args></UE_pre_exec_args> <UE_pre_exec_args></UE_pre_exec_args>
<UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue </UE_main_exec> <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue </UE_main_exec>
<UE_main_exec_args></UE_main_exec_args> <UE_main_exec_args></UE_main_exec_args>
<UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 10Mbits/s -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -c 192.172.0.1 -b 20Mbits/s -B 192.172.0.2</UE_traffic_exec>
<UE_traffic_exec_args></UE_traffic_exec_args> <UE_traffic_exec_args></UE_traffic_exec_args>
<UE_search_expr_true></UE_search_expr_true> <UE_search_expr_true></UE_search_expr_true>
<UE_search_expr_false></UE_search_expr_false> <UE_search_expr_false></UE_search_expr_false>
...@@ -6221,7 +6221,7 @@ c ...@@ -6221,7 +6221,7 @@ c
<HSS_main_exec_args></HSS_main_exec_args> <HSS_main_exec_args></HSS_main_exec_args>
<EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </EPC_traffic_exec> <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 5 lo -s -i 1 -u -f m </EPC_traffic_exec>
<EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_traffic_exec_args></EPC_traffic_exec_args>
<EPC_search_expr_true>throughput_test min=1.0Mbits/sec max=1.0Mbits/sec average=1.0Mbits/sec </EPC_search_expr_true> <EPC_search_expr_true>throughput_test min=10.0Mbits/sec max=10.0Mbits/sec average=10.0Mbits/sec </EPC_search_expr_true>
<EPC_search_expr_false></EPC_search_expr_false> <EPC_search_expr_false></EPC_search_expr_false>
<EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
<tags>USRPb210.ALU_EPC.SonyExperiaM4.10MHz.FDD.Band_7.UL.1TX.1RX</tags> <tags>USRPb210.ALU_EPC.SonyExperiaM4.10MHz.FDD.Band_7.UL.1TX.1RX</tags>
...@@ -6347,7 +6347,7 @@ c ...@@ -6347,7 +6347,7 @@ c
<UE_pre_exec_args></UE_pre_exec_args> <UE_pre_exec_args></UE_pre_exec_args>
<UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue </UE_main_exec> <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue </UE_main_exec>
<UE_main_exec_args></UE_main_exec_args> <UE_main_exec_args></UE_main_exec_args>
<UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -u -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script_phone 1 YT9115PX1E -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 10M -R </UE_traffic_exec>
<UE_traffic_exec_args></UE_traffic_exec_args> <UE_traffic_exec_args></UE_traffic_exec_args>
<UE_search_expr_true>throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec </UE_search_expr_true> <UE_search_expr_true>throughput_test min=4.0Mbits/sec max=5.0Mbits/sec average=4.0Mbits/sec </UE_search_expr_true>
<UE_search_expr_false></UE_search_expr_false> <UE_search_expr_false></UE_search_expr_false>
...@@ -6368,7 +6368,7 @@ c ...@@ -6368,7 +6368,7 @@ c
<EPC_main_exec_args></EPC_main_exec_args> <EPC_main_exec_args></EPC_main_exec_args>
<HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
<HSS_main_exec_args></HSS_main_exec_args> <HSS_main_exec_args></HSS_main_exec_args>
<EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 10Mbits/s </EPC_traffic_exec> <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m</EPC_traffic_exec>
<EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_traffic_exec_args></EPC_traffic_exec_args>
<EPC_search_expr_false></EPC_search_expr_false> <EPC_search_expr_false></EPC_search_expr_false>
<EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
...@@ -6421,7 +6421,7 @@ c ...@@ -6421,7 +6421,7 @@ c
<UE_pre_exec_args></UE_pre_exec_args> <UE_pre_exec_args></UE_pre_exec_args>
<UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue </UE_main_exec> <UE_main_exec>sleep 50; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --stop-ue ; $OPENAIR_DIR/cmake_targets/autotests/tools/configure_cots_sony_experia_m4_ue.py --start-ue </UE_main_exec>
<UE_main_exec_args></UE_main_exec_args> <UE_main_exec_args></UE_main_exec_args>
<UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf_script_phone 1 YT9115PX1E -s -i 1 -u -f m -B 192.172.0.2</UE_traffic_exec> <UE_traffic_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/iperf3_script_phone 1 YT9115PX1E -c 192.172.0.1 -i 1 -u -f m -B 192.172.0.2 -b 20M -R </UE_traffic_exec>
<UE_traffic_exec_args></UE_traffic_exec_args> <UE_traffic_exec_args></UE_traffic_exec_args>
<UE_search_expr_true>throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec</UE_search_expr_true> <UE_search_expr_true>throughput_test min=8.0Mbits/sec max=9.0Mbits/sec average=8.5Mbits/sec</UE_search_expr_true>
<UE_search_expr_false></UE_search_expr_false> <UE_search_expr_false></UE_search_expr_false>
...@@ -6442,7 +6442,7 @@ c ...@@ -6442,7 +6442,7 @@ c
<EPC_main_exec_args></EPC_main_exec_args> <EPC_main_exec_args></EPC_main_exec_args>
<HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec> <HSS_main_exec>/opt/hss_sim0609/starthss >> /dev/null ; sleep 3000 </HSS_main_exec>
<HSS_main_exec_args></HSS_main_exec_args> <HSS_main_exec_args></HSS_main_exec_args>
<EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf_script 60 lo -u -c 192.172.0.2 -b 15Mbits/s </EPC_traffic_exec> <EPC_traffic_exec>$OPENAIRCN_DIR/TEST/autotests/tools/iperf3_script 5 lo -s -i 1 -f m </EPC_traffic_exec>
<EPC_traffic_exec_args></EPC_traffic_exec_args> <EPC_traffic_exec_args></EPC_traffic_exec_args>
<EPC_search_expr_false></EPC_search_expr_false> <EPC_search_expr_false></EPC_search_expr_false>
<EPC_terminate_missing_procs>False</EPC_terminate_missing_procs> <EPC_terminate_missing_procs>False</EPC_terminate_missing_procs>
......
...@@ -43,7 +43,8 @@ def kill_processes(name): ...@@ -43,7 +43,8 @@ def kill_processes(name):
cmd = 'sudo adb -s ' + device_id +' shell "ps |grep ' + name + '"' cmd = 'sudo adb -s ' + device_id +' shell "ps |grep ' + name + '"'
status, out = commands.getstatusoutput(cmd) status, out = commands.getstatusoutput(cmd)
if status != 0: if status != 0:
print "Error execting command to kill process " + name print "Error executing command to kill process " + name
print "Error =" + out
sys.exit(1) sys.exit(1)
print "Out = " + out print "Out = " + out
if out=='': if out=='':
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#arg1 timeout to wait before running the script #arg1 timeout to wait before running the script
#arg2 interface #arg2 interface
#arg3 iperf arguments #arg3 iperf3 arguments
args=($*) args=($*)
timeout=${args[0]} timeout=${args[0]}
...@@ -43,7 +43,7 @@ iperf3_args=(${args[@]:2}) ...@@ -43,7 +43,7 @@ iperf3_args=(${args[@]:2})
echo "args = ${args[@]}" echo "args = ${args[@]}"
echo "timeout = $timeout" echo "timeout = $timeout"
echo "device_id = $device_id" echo "device_id = $device_id"
echo "iperf_args = ${iperf_args[@]}" echo "iperf3_args = ${iperf3_args[@]}"
sleep $timeout sleep $timeout
...@@ -58,6 +58,6 @@ while true ; do ...@@ -58,6 +58,6 @@ while true ; do
fi fi
done done
echo "Starting iperf now..." echo "Starting iperf3 now..."
sudo adb -s $device_id shell /data/local/tmp/iperf3 ${iperf_args[@]} sudo adb -s $device_id shell /data/local/tmp/iperf3 ${iperf3_args[@]}
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
* @defgroup _GENERIC_PHY_RF_INTERFACE_ Generic PHY - RF Interface * @defgroup _GENERIC_PHY_RF_INTERFACE_ Generic PHY - RF Interface
* @defgroup _USRP_PHY_RF_INTERFACE_ PHY - USRP RF Interface * @defgroup _USRP_PHY_RF_INTERFACE_ PHY - USRP RF Interface
* @defgroup _BLADERF_PHY_RF_INTERFACE_ PHY - BLADERF RF Interface * @defgroup _BLADERF_PHY_RF_INTERFACE_ PHY - BLADERF RF Interface
* @defgroup _LMSSDR_PHY_RF_INTERFACE_ PHY - LMSSDR RF Interface
* @} * @}
* *
* @ingroup _ref_implementation_ * @ingroup _ref_implementation_
......
...@@ -51,7 +51,6 @@ ...@@ -51,7 +51,6 @@
void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_eNB) void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_eNB)
{ {
int i;
//uint8_t cooperation_flag = phy_vars_eNB->cooperation_flag; //uint8_t cooperation_flag = phy_vars_eNB->cooperation_flag;
uint8_t transmission_mode = phy_vars_eNB->transmission_mode[0]; uint8_t transmission_mode = phy_vars_eNB->transmission_mode[0];
...@@ -583,7 +582,6 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e ...@@ -583,7 +582,6 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e
void fill_dci_emos(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *phy_vars_eNB) void fill_dci_emos(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *phy_vars_eNB)
{ {
int i;
//uint8_t cooperation_flag = phy_vars_eNB->cooperation_flag; //uint8_t cooperation_flag = phy_vars_eNB->cooperation_flag;
uint8_t transmission_mode = phy_vars_eNB->transmission_mode[0]; uint8_t transmission_mode = phy_vars_eNB->transmission_mode[0];
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <inttypes.h> #include <inttypes.h>
#include "bladerf_lib.h" #include "bladerf_lib.h"
#include "math.h"
/** @addtogroup _BLADERF_PHY_RF_INTERFACE_ /** @addtogroup _BLADERF_PHY_RF_INTERFACE_
* @{ * @{
...@@ -58,14 +59,16 @@ int num_devices=0; ...@@ -58,14 +59,16 @@ int num_devices=0;
/*! \brief BladeRF Init function (not used at the moment) /*! \brief BladeRF Init function (not used at the moment)
* \param device RF frontend parameters set by application * \param device RF frontend parameters set by application
* \returns 0 on success
*/ */
int trx_brf_init(openair0_device *device) { int trx_brf_init(openair0_device *device) {
return 0;
} }
/*! \brief get current timestamp /*! \brief get current timestamp
*\param device the hardware to use *\param device the hardware to use
*\param module the bladeRf module *\param module the bladeRf module
*\returns timestamp of BladeRF
*/ */
openair0_timestamp trx_get_timestamp(openair0_device *device, bladerf_module module) { openair0_timestamp trx_get_timestamp(openair0_device *device, bladerf_module module) {
...@@ -83,28 +86,22 @@ openair0_timestamp trx_get_timestamp(openair0_device *device, bladerf_module mod ...@@ -83,28 +86,22 @@ openair0_timestamp trx_get_timestamp(openair0_device *device, bladerf_module mod
} }
/*! \brief Start BladeRF /*! \brief Start BladeRF
*\param device the hardware to use * \param device the hardware to use
* \returns 0 on success
*/ */
int trx_brf_start(openair0_device *device) { int trx_brf_start(openair0_device *device) {
return 0; return 0;
} }
/*! \brief Get BladeRF stats
*\param device the hardware to use
*/
static void trx_brf_stats(openair0_device *device){
}
/*! \brief Called to send samples to the BladeRF RF target /*! \brief Called to send samples to the BladeRF RF target
@param device pointer to the device structure specific to the RF hardware target \param device pointer to the device structure specific to the RF hardware target
@param timestamp The timestamp at whicch the first sample MUST be sent \param timestamp The timestamp at whicch the first sample MUST be sent
@param buff Buffer which holds the samples \param buff Buffer which holds the samples
@param nsamps number of samples to be sent \param nsamps number of samples to be sent
@param cc index of the component carrier \param cc index of the component carrier
@param flags Ignored for the moment \param flags Ignored for the moment
\returns 0 on success
*/ */
static int trx_brf_write(openair0_device *device,openair0_timestamp ptimestamp, void **buff, int nsamps, int cc, int flags) { static int trx_brf_write(openair0_device *device,openair0_timestamp ptimestamp, void **buff, int nsamps, int cc, int flags) {
...@@ -156,6 +153,7 @@ static int trx_brf_write(openair0_device *device,openair0_timestamp ptimestamp, ...@@ -156,6 +153,7 @@ static int trx_brf_write(openair0_device *device,openair0_timestamp ptimestamp,
* \param[out] buff An array of pointers to buffers for received samples. The buffers must be large enough to hold the number of samples \ref nsamps. * \param[out] buff An array of pointers to buffers for received samples. The buffers must be large enough to hold the number of samples \ref nsamps.
* \param nsamps Number of samples. One sample is 2 byte I + 2 byte Q => 4 byte. * \param nsamps Number of samples. One sample is 2 byte I + 2 byte Q => 4 byte.
* \param cc Index of component carrier * \param cc Index of component carrier
* \returns number of samples read
*/ */
static int trx_brf_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) { static int trx_brf_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) {
...@@ -176,9 +174,10 @@ static int trx_brf_read(openair0_device *device, openair0_timestamp *ptimestamp, ...@@ -176,9 +174,10 @@ static int trx_brf_read(openair0_device *device, openair0_timestamp *ptimestamp,
brf->num_rx_errors++; brf->num_rx_errors++;
} else if ( brf->meta_rx.status & BLADERF_META_STATUS_OVERRUN) { } else if ( brf->meta_rx.status & BLADERF_META_STATUS_OVERRUN) {
brf->num_overflows++; brf->num_overflows++;
printf("RX overrun (%d) is detected. t=%u. Got %u samples. nsymps %d\n", printf("RX overrun (%d) is detected. t=" "%" PRIu64 "Got %u samples. nsymps %d\n",
brf->num_overflows,brf->meta_rx.timestamp, brf->meta_rx.actual_count, nsamps); brf->num_overflows,brf->meta_rx.timestamp, brf->meta_rx.actual_count, nsamps);
} }
//printf("Current RX timestampe %u\n", brf->meta_rx.timestamp); //printf("Current RX timestampe %u\n", brf->meta_rx.timestamp);
//printf("[BRF] (buff %p) ts=0x%"PRIu64" %s\n",samples, brf->meta_rx.timestamp,bladerf_strerror(status)); //printf("[BRF] (buff %p) ts=0x%"PRIu64" %s\n",samples, brf->meta_rx.timestamp,bladerf_strerror(status));
brf->rx_current_ts=brf->meta_rx.timestamp; brf->rx_current_ts=brf->meta_rx.timestamp;
...@@ -196,7 +195,7 @@ static int trx_brf_read(openair0_device *device, openair0_timestamp *ptimestamp, ...@@ -196,7 +195,7 @@ static int trx_brf_read(openair0_device *device, openair0_timestamp *ptimestamp,
/*! \brief Terminate operation of the BladeRF transceiver -- free all associated resources /*! \brief Terminate operation of the BladeRF transceiver -- free all associated resources
* \param device the hardware to use * \param device the hardware to use
*/ */
int trx_brf_end(openair0_device *device) { void trx_brf_end(openair0_device *device) {
int status; int status;
brf_state_t *brf = (brf_state_t*)device->priv; brf_state_t *brf = (brf_state_t*)device->priv;
...@@ -208,7 +207,6 @@ int trx_brf_end(openair0_device *device) { ...@@ -208,7 +207,6 @@ int trx_brf_end(openair0_device *device) {
fprintf(stderr, "Failed to disable TX module: %s\n", bladerf_strerror(status)); fprintf(stderr, "Failed to disable TX module: %s\n", bladerf_strerror(status));
} }
bladerf_close(brf->dev); bladerf_close(brf->dev);
return 0;
} }
/*! \brief print the BladeRF statistics /*! \brief print the BladeRF statistics
...@@ -231,10 +229,11 @@ int trx_brf_reset_stats(openair0_device* device) { ...@@ -231,10 +229,11 @@ int trx_brf_reset_stats(openair0_device* device) {
} }
/*! \brief Stop USRP /*! \brief Stop BladeRF
* \param device the hardware to use * \param card the hardware to use
* \returns 0 in success
*/ */
int trx_brf_stop(openair0_device* device) { int trx_brf_stop(int card) {
return(0); return(0);
...@@ -242,9 +241,11 @@ int trx_brf_stop(openair0_device* device) { ...@@ -242,9 +241,11 @@ int trx_brf_stop(openair0_device* device) {
/*! \brief Set frequencies (TX/RX) /*! \brief Set frequencies (TX/RX)
* \param device the hardware to use * \param device the hardware to use
* \param openair0_cfg1 openair0 Config structure (ignored. It is there to comply with RF common API)
* \param exmimo_dump_config (ignored)
* \returns 0 in success * \returns 0 in success
*/ */
int trx_brf_set_freq(openair0_device* device) { int trx_brf_set_freq(openair0_device* device, openair0_config_t *openair0_cfg1,int exmimo_dump_config) {
int status; int status;
brf_state_t *brf = (brf_state_t *)device->priv; brf_state_t *brf = (brf_state_t *)device->priv;
...@@ -269,9 +270,10 @@ int trx_brf_set_freq(openair0_device* device) { ...@@ -269,9 +270,10 @@ int trx_brf_set_freq(openair0_device* device) {
/*! \brief Set Gains (TX/RX) /*! \brief Set Gains (TX/RX)
* \param device the hardware to use * \param device the hardware to use
* \param openair0_cfg openair0 Config structure
* \returns 0 in success * \returns 0 in success
*/ */
int trx_brf_set_gains(openair0_device* device) { int trx_brf_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) {
return(0); return(0);
...@@ -283,12 +285,17 @@ int trx_brf_set_gains(openair0_device* device) { ...@@ -283,12 +285,17 @@ int trx_brf_set_gains(openair0_device* device) {
int16_t cos_fsover8[8] = {2047, 1447, 0, -1448, -2047, -1448, 0, 1447}; int16_t cos_fsover8[8] = {2047, 1447, 0, -1448, -2047, -1448, 0, 1447};
int16_t cos_3fsover8[8] = {2047, -1448, 0, 1447, -2047, 1447, 0, -1448}; int16_t cos_3fsover8[8] = {2047, -1448, 0, 1447, -2047, 1447, 0, -1448};
/*! \brief calibration table for BladeRF */
rx_gain_calib_table_t calib_table_fx4[] = { rx_gain_calib_table_t calib_table_fx4[] = {
{2300000000.0,53.5}, {2300000000.0,53.5},
{1880000000.0,57.0}, {1880000000.0,57.0},
{816000000.0,73.0}, {816000000.0,73.0},
{-1,0}}; {-1,0}};
/*! \brief set RX gain offset from calibration table
* \param openair0_cfg RF frontend parameters set by application
* \param chain_index RF chain ID
*/
void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) { void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) {
int i=0; int i=0;
...@@ -310,6 +317,9 @@ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) { ...@@ -310,6 +317,9 @@ void set_rx_gain_offset(openair0_config_t *openair0_cfg, int chain_index) {
} }
/*! \brief Calibrate LMSSDR RF
* \param device the hardware to use
*/
void calibrate_rf(openair0_device *device) { void calibrate_rf(openair0_device *device) {
...@@ -885,11 +895,10 @@ void calibrate_rf(openair0_device *device) { ...@@ -885,11 +895,10 @@ void calibrate_rf(openair0_device *device) {
/*! \brief Initialize Openair BLADERF target. It returns 0 if OK /*! \brief Initialize Openair BLADERF target. It returns 0 if OK
* \param device the hardware to use * \param device the hardware to use
* \param openair0_cfg RF frontend parameters set by application * \param openair0_cfg RF frontend parameters set by application
* \returns 0 on success
*/ */
int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
int status; int status;
int card=0;
brf_state_t *brf = (brf_state_t*)malloc(sizeof(brf_state_t)); brf_state_t *brf = (brf_state_t*)malloc(sizeof(brf_state_t));
memset(brf, 0, sizeof(brf_state_t)); memset(brf, 0, sizeof(brf_state_t));
/* device specific */ /* device specific */
...@@ -1063,8 +1072,6 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { ...@@ -1063,8 +1072,6 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
}else }else
printf("[BRF] RX module calibrated DC \n"); printf("[BRF] RX module calibrated DC \n");
bladerf_log_set_verbosity(get_brf_log_level(openair0_cfg->log_level)); bladerf_log_set_verbosity(get_brf_log_level(openair0_cfg->log_level));
printf("BLADERF: Initializing openair0_device\n"); printf("BLADERF: Initializing openair0_device\n");
...@@ -1091,16 +1098,18 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { ...@@ -1091,16 +1098,18 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
/*! \brief bladeRF error report /*! \brief bladeRF error report
* \param status * \param status
* \returns 0 on success
*/ */
int brf_error(int status) { int brf_error(int status) {
//exit(-1); //exit(-1);
//return 1; // or status error code return status; // or status error code
} }
/*! \brief Open BladeRF from serial port /*! \brief Open BladeRF from serial port
* \param serial name of serial port on which to open BladeRF device * \param serial name of serial port on which to open BladeRF device
* \returns bladerf device structure
*/ */
struct bladerf * open_bladerf_from_serial(const char *serial) { struct bladerf * open_bladerf_from_serial(const char *serial) {
...@@ -1131,6 +1140,7 @@ struct bladerf * open_bladerf_from_serial(const char *serial) { ...@@ -1131,6 +1140,7 @@ struct bladerf * open_bladerf_from_serial(const char *serial) {
/*! \brief Get BladeRF log level /*! \brief Get BladeRF log level
* \param log_level log level * \param log_level log level
* \returns log level of BLADERF device
*/ */
int get_brf_log_level(int log_level){ int get_brf_log_level(int log_level){
......
...@@ -106,6 +106,27 @@ typedef struct { ...@@ -106,6 +106,27 @@ typedef struct {
/* /*
* func prototypes * func prototypes
*/ */
/*! \brief BladeRF Init function (not used at the moment)
* \param device RF frontend parameters set by application
*/
int trx_brf_init(openair0_device *device);
/*! \brief get current timestamp
*\param device the hardware to use
*\param module the bladeRf module
*/
openair0_timestamp trx_get_timestamp(openair0_device *device, bladerf_module module);
/*! \brief Get BladeRF log level
* \param log_level log level
* \returns log level of BLADERF device
*/
int get_brf_log_level(int log_level);
/*! \brief bladeRF error report
* \param status
* \returns 0 on success
*/
int brf_error(int status); int brf_error(int status);
/*@}*/ /*@}*/
...@@ -796,7 +796,8 @@ INPUT = $(OPENAIR1_DIR)/PHY/defs.h \ ...@@ -796,7 +796,8 @@ INPUT = $(OPENAIR1_DIR)/PHY/defs.h \
$(OPENAIR_TARGETS)/ARCH/COMMON/common_lib.h \ $(OPENAIR_TARGETS)/ARCH/COMMON/common_lib.h \
$(OPENAIR_TARGETS)/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp \ $(OPENAIR_TARGETS)/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp \
$(OPENAIR_TARGETS)/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c \ $(OPENAIR_TARGETS)/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c \
$(OPENAIR_TARGETS)/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h $(OPENAIR_TARGETS)/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.h \
$(OPENAIR_TARGETS)/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp
# This tag can be used to specify the character encoding of the source files # This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment