Commit e5938ed5 authored by Fang-WANG's avatar Fang-WANG

modify for yunsdr

parent 96a8c90e
...@@ -836,7 +836,7 @@ add_library(F1AP ...@@ -836,7 +836,7 @@ add_library(F1AP
add_list1_option(NB_ANTENNAS_RX "2" "Number of antennas in reception" "1" "2" "4") add_list1_option(NB_ANTENNAS_RX "2" "Number of antennas in reception" "1" "2" "4")
add_list1_option(NB_ANTENNAS_TX "4" "Number of antennas in transmission" "1" "2" "4") add_list1_option(NB_ANTENNAS_TX "4" "Number of antennas in transmission" "1" "2" "4")
add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "OAI_USRP" "OAI_BLADERF" "OAI_LMSSDR" "OAI_SIMU") add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "OAI_USRP" "OAI_BLADERF" "OAI_LMSSDR" "OAI_SIMU" "OAI_YUNSDR")
...@@ -877,6 +877,13 @@ set(HWLIB_BLADERF_SOURCE ...@@ -877,6 +877,13 @@ set(HWLIB_BLADERF_SOURCE
add_library(oai_bladerfdevif MODULE ${HWLIB_BLADERF_SOURCE} ) add_library(oai_bladerfdevif MODULE ${HWLIB_BLADERF_SOURCE} )
target_link_libraries(oai_bladerfdevif bladeRF) target_link_libraries(oai_bladerfdevif bladeRF)
include_directories("${OPENAIR_TARGETS}/ARCH/YUNSDR/USERSPACE/LIB/")
set(HWLIB_YUNSDR_SOURCE
${OPENAIR_TARGETS}/ARCH/YUNSDR/USERSPACE/LIB/yunsdr_lib.c
)
add_library(oai_yunsdrdevif MODULE ${HWLIB_YUNSDR_SOURCE} )
target_link_libraries(oai_yunsdrdevif yunsdr_ss)
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/") include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/")
set(HWLIB_LMSSDR_SOURCE set(HWLIB_LMSSDR_SOURCE
...@@ -3086,7 +3093,7 @@ target_link_libraries (ocp-gnb ${LIBXML2_LIBRARIES} ) ...@@ -3086,7 +3093,7 @@ target_link_libraries (ocp-gnb ${LIBXML2_LIBRARIES} )
target_link_libraries (ocp-gnb pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES}) target_link_libraries (ocp-gnb pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
target_link_libraries (ocp-gnb ${LIB_LMS_LIBRARIES}) target_link_libraries (ocp-gnb ${LIB_LMS_LIBRARIES})
target_link_libraries (ocp-gnb ${T_LIB}) target_link_libraries (ocp-gnb ${T_LIB})
add_dependencies(ocp-gnb ldpc_orig ldpc_optim ldpc_optim8seg ldpc params_libconfig rfsimulator oai_usrpdevif rfsimulator nrscope) add_dependencies(ocp-gnb ldpc_orig ldpc_optim ldpc_optim8seg ldpc params_libconfig rfsimulator oai_usrpdevif oai_yunsdrdevif rfsimulator nrscope)
# nr-uesoftmodem is UE implementation # nr-uesoftmodem is UE implementation
...@@ -3438,7 +3445,7 @@ if (${T_TRACER}) ...@@ -3438,7 +3445,7 @@ if (${T_TRACER})
nr_ulschsim ldpctest polartest smallblocktest cu_test du_test nr_ulschsim ldpctest polartest smallblocktest cu_test du_test
#all "add_library" definitions #all "add_library" definitions
ITTI RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP ITTI RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP
params_libconfig oai_exmimodevif oai_usrpdevif oai_bladerfdevif oai_lmssdrdevif oai_iqplayer params_libconfig oai_exmimodevif oai_usrpdevif oai_yunsdrdevif oai_bladerfdevif oai_lmssdrdevif oai_iqplayer
oai_eth_transpro oai_mobipass tcp_bridge tcp_bridge_oai oai_eth_transpro oai_mobipass tcp_bridge tcp_bridge_oai
coding FLPT_MSG ASYNC_IF FLEXRAN_AGENT HASHTABLE MSC UTIL OMG_SUMO coding FLPT_MSG ASYNC_IF FLEXRAN_AGENT HASHTABLE MSC UTIL OMG_SUMO
SECU_OSA SECU_CN SCHED_LIB SCHED_NR_LIB SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB default_sched remote_sched RAL SECU_OSA SECU_CN SCHED_LIB SCHED_NR_LIB SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB default_sched remote_sched RAL
......
...@@ -113,7 +113,7 @@ Options ...@@ -113,7 +113,7 @@ Options
-a | --agent -a | --agent
Enables agent for software-defined control of the eNB Enables agent for software-defined control of the eNB
-w | --hardware -w | --hardware
EXMIMO, USRP, BLADERF, LMSSDR, IRIS, ADRV9371_ZC706, SIMU, None (Default) EXMIMO, USRP, BLADERF, LMSSDR, IRIS, YUNSDR, ADRV9371_ZC706, SIMU, None (Default)
Adds this RF board support (in external packages installation and in compilation) Adds this RF board support (in external packages installation and in compilation)
-P | --phy_simulators -P | --phy_simulators
Makes the unitary tests Layer 1 simulators Makes the unitary tests Layer 1 simulators
...@@ -278,7 +278,7 @@ function main() { ...@@ -278,7 +278,7 @@ function main() {
"EXMIMO") "EXMIMO")
HW="EXMIMO" HW="EXMIMO"
;; ;;
"USRP" | "BLADERF" | "LMSSDR" | "IRIS" | "ADRV9371_ZC706" | "SIMU") "USRP" | "BLADERF" | "LMSSDR" | "IRIS" | "ADRV9371_ZC706" | "SIMU" | "YUNSDR")
HW="OAI_"$2 HW="OAI_"$2
;; ;;
"None") "None")
...@@ -540,6 +540,10 @@ function main() { ...@@ -540,6 +540,10 @@ function main() {
flash_firmware_bladerf flash_firmware_bladerf
fi fi
fi fi
if [ "$HW" == "OAI_YUNSDR" ] ; then
echo_info "installing packages for YUNSDR support"
#check_install_yunsdr_driver
fi
if [ "$HW" == "OAI_IRIS" ] ; then if [ "$HW" == "OAI_IRIS" ] ; then
echo_info "installing packages for IRIS support" echo_info "installing packages for IRIS support"
check_install_soapy check_install_soapy
...@@ -883,6 +887,16 @@ function main() { ...@@ -883,6 +887,16 @@ function main() {
ln -sf liboai_bladerfdevif.so liboai_device.so ln -sf liboai_bladerfdevif.so liboai_device.so
ln -sf $dbin/liboai_bladerfdevif.so.$REL $dbin/liboai_device.so ln -sf $dbin/liboai_bladerfdevif.so.$REL $dbin/liboai_device.so
echo_info "liboai_device.so is linked to BLADERF device library" echo_info "liboai_device.so is linked to BLADERF device library"
elif [ "$HW" == "OAI_YUNSDR" ] ; then
if [ -f "/usr/local/include/yunsdr_api_ss.h" ] ; then
compilations \
$build_dir oai_yunsdrdevif \
liboai_yunsdrdevif.so $dbin/liboai_yunsdrdevif.so.$REL
fi
ln -sf liboai_yunsdrdevif.so liboai_device.so
ln -sf $dbin/liboai_yunsdrdevif.so.$REL $dbin/liboai_device.so
echo_info "liboai_device.so is linked to YUNSDR device library"
elif [ "$HW" == "OAI_LMSSDR" ] ; then elif [ "$HW" == "OAI_LMSSDR" ] ; then
# if [ -f "/usr/include/libbladeRF.h" ] ; then # if [ -f "/usr/include/libbladeRF.h" ] ; then
compilations \ compilations \
......
...@@ -395,6 +395,34 @@ install_usrp_uhd_driver() { ...@@ -395,6 +395,34 @@ install_usrp_uhd_driver() {
fi fi
} }
check_install_yunsdr_driver() {
#if modinfo riffa > /dev/null 2>&1
if modinfo xdma > /dev/null 2>&1
then
echo_success "YunSDR driver has loaded."
else
git clone https://github.com/v3best/riffa /tmp/riffa
if [ $? -ne 0 ]; then
echo_fatal "YunSDR driver download failed, please check your net connection."
else
cd /tmp/riffa/driver/linux
make && $SUDO make install
echo_success "YunSDR driver install success, please restart your PC later."
fi
git clone https://github.com/v3best/libyunsdr /tmp/libyunsdr
if [ $? -ne 0 ]; then
echo_fatal "YunSDR API download failed, please check your net connection."
else
cd /tmp/libyunsdr
mkdir build
cd build
cmake ../
make && $SUDO make install && $SUDO ldconfig
echo_success "YunSDR API install success, please restart your PC later."
fi
fi
}
install_bladerf_driver_from_source(){ install_bladerf_driver_from_source(){
bladerf_install_log=$OPENAIR_DIR/cmake_targets/log/bladerf_install_log.txt bladerf_install_log=$OPENAIR_DIR/cmake_targets/log/bladerf_install_log.txt
echo_info "\nInstalling BladeRF driver from sources. The log file for BladeRF driver installation is here: $bladerf_install_log " echo_info "\nInstalling BladeRF driver from sources. The log file for BladeRF driver installation is here: $bladerf_install_log "
...@@ -812,7 +840,8 @@ check_install_oai_software() { ...@@ -812,7 +840,8 @@ check_install_oai_software() {
install_asn1c_from_source $1 install_asn1c_from_source $1
$SUDO rm -fr /opt/ssh $SUDO rm -fr /opt/ssh
$SUDO git clone https://gist.github.com/2190472.git /opt/ssh #$SUDO git clone https://gist.github.com/2190472.git /opt/ssh
$SUDO git clone https://gitlab.eurecom.fr/oai/ssh.git /opt/ssh
} }
install_asn1c_from_source(){ install_asn1c_from_source(){
......
...@@ -409,7 +409,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, runmode_t mode, ...@@ -409,7 +409,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, runmode_t mode,
phich_string[fp->phich_config_common.phich_resource], phich_string[fp->phich_config_common.phich_resource],
fp->nb_antenna_ports_gNB);*/ fp->nb_antenna_ports_gNB);*/
#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) #if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) || defined(OAI_YUNSDR)
LOG_I(PHY, "[UE %d] Measured Carrier Frequency %.0f Hz (offset %d Hz)\n", LOG_I(PHY, "[UE %d] Measured Carrier Frequency %.0f Hz (offset %d Hz)\n",
ue->Mod_id, ue->Mod_id,
openair0_cfg[0].rx_freq[0]+ue->common_vars.freq_offset, openair0_cfg[0].rx_freq[0]+ue->common_vars.freq_offset,
...@@ -459,10 +459,12 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, runmode_t mode, ...@@ -459,10 +459,12 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, runmode_t mode,
#ifndef OAI_BLADERF #ifndef OAI_BLADERF
#ifndef OAI_LMSSDR #ifndef OAI_LMSSDR
#ifndef OAI_ADRV9371_ZC706 #ifndef OAI_ADRV9371_ZC706
#ifndef OAI_YUNSDR
//phy_adjust_gain(ue,ue->measurements.rx_power_avg_dB[0],0); //phy_adjust_gain(ue,ue->measurements.rx_power_avg_dB[0],0);
#endif #endif
#endif #endif
#endif #endif
#endif
#endif #endif
} }
...@@ -472,10 +474,12 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, runmode_t mode, ...@@ -472,10 +474,12 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, runmode_t mode,
#ifndef OAI_BLADERF #ifndef OAI_BLADERF
#ifndef OAI_LMSSDR #ifndef OAI_LMSSDR
#ifndef OAI_ADRV9371_ZC706 #ifndef OAI_ADRV9371_ZC706
#ifndef OAI_YUNSDR
//phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0); //phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0);
#endif #endif
#endif #endif
#endif #endif
#endif
#endif #endif
} }
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,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 _YUNSDR_PHY_RF_INTERFACE_ PHY - YUNSDR RF Interface
* @defgroup _LMSSDR_PHY_RF_INTERFACE_ PHY - LMSSDR RF Interface * @defgroup _LMSSDR_PHY_RF_INTERFACE_ PHY - LMSSDR RF Interface
* @} * @}
* *
......
...@@ -86,7 +86,7 @@ const uint8_t nr_rv_round_map_ue[4] = {0, 2, 1, 3}; ...@@ -86,7 +86,7 @@ const uint8_t nr_rv_round_map_ue[4] = {0, 2, 1, 3};
extern double cpuf; extern double cpuf;
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) #if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) || defined(OAI_YUNSDR)
extern uint64_t downlink_frequency[MAX_NUM_CCs][4]; extern uint64_t downlink_frequency[MAX_NUM_CCs][4];
#endif #endif
......
...@@ -617,7 +617,7 @@ bool pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_ ...@@ -617,7 +617,7 @@ bool pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_
int tx_amp; int tx_amp;
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) #if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) || defined(OAI_YUNSDR)
tx_amp = nr_get_tx_amp(pucch_tx_power, tx_amp = nr_get_tx_amp(pucch_tx_power,
ue->tx_power_max_dBm, ue->tx_power_max_dBm,
......
...@@ -94,6 +94,8 @@ typedef enum { ...@@ -94,6 +94,8 @@ typedef enum {
USRP_N300_DEV, USRP_N300_DEV,
/*!\brief device is BLADE RF*/ /*!\brief device is BLADE RF*/
BLADERF_DEV, BLADERF_DEV,
/*!\brief device is YUNSDR pcie*/
YUNSDR_DEV,
/*!\brief device is LMSSDR (SoDeRa)*/ /*!\brief device is LMSSDR (SoDeRa)*/
LMSSDR_DEV, LMSSDR_DEV,
/*!\brief device is Iris */ /*!\brief device is Iris */
...@@ -106,7 +108,7 @@ typedef enum { ...@@ -106,7 +108,7 @@ typedef enum {
UEDv2_DEV, UEDv2_DEV,
MAX_RF_DEV_TYPE MAX_RF_DEV_TYPE
} dev_type_t; } dev_type_t;
#define DEVTYPE_NAMES {"","EXMIMO","USRP B200","USRP X300","USRP N300","BLADERF","LMSSDR","IRIS","No HW","ADRV9371_ZC706","UEDv2"} #define DEVTYPE_NAMES {"","EXMIMO","USRP B200","USRP X300","USRP N300","BLADERF","YUNSDR","LMSSDR","IRIS","No HW","ADRV9371_ZC706","UEDv2"}
/*!\brief transport protocol types /*!\brief transport protocol types
*/ */
typedef enum { typedef enum {
...@@ -207,7 +209,7 @@ typedef struct { ...@@ -207,7 +209,7 @@ typedef struct {
//! timing_source //! timing_source
clock_source_t time_source; clock_source_t time_source;
//! Manual SDR IP address //! Manual SDR IP address
//#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) //#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_YUNSDR)
char *sdr_addrs; char *sdr_addrs;
//! Auto calibration flag //! Auto calibration flag
int autocal[4]; int autocal[4];
......
This diff is collapsed.
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.0 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/** yunsdr_lib.h
*
* Author: eric
* base on bladerf_lib.h
*/
#include "yunsdr_api_ss.h"
#include "common_lib.h"
/** @addtogroup _YUNSDR_PHY_RF_INTERFACE_
* @{
*/
/*! \brief YunSDR specific data structure */
typedef struct {
//! opaque YunSDR device struct. An empty ("") or NULL device identifier will result in the first encountered device being opened (using the first discovered backend)
YUNSDR_DESCRIPTOR *dev;
int16_t *rx_buffer;
int16_t *tx_buffer;
//! Sample rate
unsigned int sample_rate;
int rx_num_channels;
int tx_num_channels;
// --------------------------------
// Debug and output control
// --------------------------------
//! Number of underflows
int num_underflows;
//! Number of overflows
int num_overflows;
//! number of RX errors
int num_rx_errors;
//! Number of TX errors
int num_tx_errors;
//! timestamp of current TX
uint64_t tx_current_ts;
//! timestamp of current RX
uint64_t rx_current_ts;
//! number of TX samples
uint64_t tx_nsamps;
//! number of RX samples
uint64_t rx_nsamps;
//! number of TX count
uint64_t tx_count;
//! number of RX count
uint64_t rx_count;
//! timestamp of RX packet
openair0_timestamp rx_timestamp;
} yunsdr_state_t;
/*! \brief get current timestamp
*\param device the hardware to use
*/
openair0_timestamp trx_get_timestamp(openair0_device *device);
/*@}*/
#ifndef OPENAIRINTERFACE5G_LIMITS_H_ #ifndef OPENAIRINTERFACE5G_LIMITS_H_
#define OPENAIRINTERFACE5G_LIMITS_H_ #define OPENAIRINTERFACE5G_LIMITS_H_
#if 1 /*defined(CBMIMO1) || defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706)*/ #if 1 /*defined(CBMIMO1) || defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706) || defined(OAI_YUNSDR)*/
# define NUMBER_OF_eNB_MAX 1 # define NUMBER_OF_eNB_MAX 1
# define NUMBER_OF_gNB_MAX 1 # define NUMBER_OF_gNB_MAX 1
# define NUMBER_OF_RU_MAX 2 # define NUMBER_OF_RU_MAX 2
......
...@@ -217,8 +217,8 @@ gNBs = ...@@ -217,8 +217,8 @@ gNBs =
////////// AMF parameters: ////////// AMF parameters:
amf_ip_address = ( { ipv4 = "192.168.199.223"; amf_ip_address = ( { ipv4 = "192.168.199.205";
ipv6 = "192:168:199::223"; ipv6 = "192:168:199::205";
active = "yes"; active = "yes";
preference = "ipv4"; preference = "ipv4";
} }
...@@ -230,7 +230,7 @@ gNBs = ...@@ -230,7 +230,7 @@ gNBs =
{ {
GNB_INTERFACE_NAME_FOR_NG_AMF = "eno1"; GNB_INTERFACE_NAME_FOR_NG_AMF = "eno1";
GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.199.222/24"; GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.199.224/24";
GNB_INTERFACE_NAME_FOR_NGU = "enx000ec6c0a3ac"; GNB_INTERFACE_NAME_FOR_NGU = "enx000ec6c0a3ac";
GNB_IPV4_ADDRESS_FOR_NGU = "192.168.10.100/24"; GNB_IPV4_ADDRESS_FOR_NGU = "192.168.10.100/24";
GNB_PORT_FOR_NGU = 2152; # Spec 2152 GNB_PORT_FOR_NGU = 2152; # Spec 2152
......
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