Merge remote-tracking branch 'origin/develop' into develop-oriecpriupdates
Conflicts: openair1/PHY/LTE_TRANSPORT/if5_tools.c openair1/PHY/LTE_TRANSPORT/prach.c openair1/PHY/defs_eNB.h targets/ARCH/COMMON/common_lib.c targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c targets/RT/USER/lte-ru.c
This commit is contained in:
@@ -34,12 +34,15 @@
|
||||
#include <dlfcn.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "common_lib.h"
|
||||
#include "common/utils/load_module_shlib.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "targets/RT/USER/lte-softmodem.h"
|
||||
|
||||
int set_device(openair0_device *device) {
|
||||
int set_device(openair0_device *device)
|
||||
{
|
||||
switch (device->type) {
|
||||
case EXMIMO_DEV:
|
||||
LOG_I(HW,"[%s] has loaded EXPRESS MIMO device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
|
||||
@@ -62,7 +65,15 @@ int set_device(openair0_device *device) {
|
||||
break;
|
||||
|
||||
case IRIS_DEV:
|
||||
LOG_I(HW,"[%s] has loaded Iris device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
|
||||
LOG_I(HW,"[%s] has loaded Iris device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
|
||||
break;
|
||||
|
||||
case ADRV9371_ZC706_DEV:
|
||||
LOG_I(HW,"[%s] has loaded ADRV9371_ZC706 device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
|
||||
break;
|
||||
|
||||
case UEDv2_DEV:
|
||||
LOG_I(HW,"[%s] has loaded UEDv2 device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
|
||||
break;
|
||||
|
||||
case NONE_DEV:
|
||||
@@ -73,11 +84,11 @@ int set_device(openair0_device *device) {
|
||||
LOG_E(HW,"[%s] invalid HW device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int set_transport(openair0_device *device) {
|
||||
int set_transport(openair0_device *device)
|
||||
{
|
||||
switch (device->transp_type) {
|
||||
case ETHERNET_TP:
|
||||
LOG_I(HW,"[%s] has loaded ETHERNET trasport protocol.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
|
||||
@@ -95,30 +106,35 @@ int set_transport(openair0_device *device) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
typedef int(*devfunc_t)(openair0_device *, openair0_config_t *, eth_params_t *);
|
||||
//loader_shlibfunc_t shlib_fdesc[2];
|
||||
|
||||
/* look for the interface library and load it */
|
||||
int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t *cfg, uint8_t flag) {
|
||||
int load_lib(openair0_device *device,
|
||||
openair0_config_t *openair0_cfg,
|
||||
eth_params_t *cfg,
|
||||
uint8_t flag)
|
||||
{
|
||||
loader_shlibfunc_t shlib_fdesc[1];
|
||||
int ret=0;
|
||||
char *libname;
|
||||
|
||||
if ( IS_SOFTMODEM_BASICSIM ) {
|
||||
libname=OAI_BASICSIM_LIBNAME;
|
||||
shlib_fdesc[0].fname="device_init";
|
||||
} else if ( IS_SOFTMODEM_RFSIM && flag == RAU_LOCAL_RADIO_HEAD) {
|
||||
libname=OAI_RFSIM_LIBNAME;
|
||||
shlib_fdesc[0].fname="device_init";
|
||||
libname=OAI_BASICSIM_LIBNAME;
|
||||
shlib_fdesc[0].fname="device_init";
|
||||
} else if (flag == RAU_LOCAL_RADIO_HEAD) {
|
||||
libname=OAI_RF_LIBNAME;
|
||||
if (IS_SOFTMODEM_RFSIM)
|
||||
libname="rfsimulator";
|
||||
else
|
||||
libname=OAI_RF_LIBNAME;
|
||||
shlib_fdesc[0].fname="device_init";
|
||||
} else if (flag == RAU_REMOTE_RADIO_HEAD) {
|
||||
libname=OAI_TP_LIBNAME;
|
||||
shlib_fdesc[0].fname="transport_init";
|
||||
}else if (flag == RAU_REMOTE_THIRDPARTY_RADIO_HEAD) {
|
||||
} else if (flag == RAU_REMOTE_THIRDPARTY_RADIO_HEAD) {
|
||||
libname=OAI_THIRDPARTY_TP_LIBNAME;
|
||||
shlib_fdesc[0].fname="transport_init";
|
||||
}
|
||||
|
||||
ret=load_module_shlib(libname,shlib_fdesc,1,NULL);
|
||||
|
||||
if (ret < 0) {
|
||||
@@ -126,43 +142,40 @@ int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_param
|
||||
} else {
|
||||
ret=((devfunc_t)shlib_fdesc[0].fptr)(device,openair0_cfg,cfg);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cfg) {
|
||||
int openair0_device_load(openair0_device *device,
|
||||
openair0_config_t *openair0_cfg)
|
||||
{
|
||||
int rc=0;
|
||||
rc=load_lib(device, openair0_cfg, NULL,RAU_LOCAL_RADIO_HEAD );
|
||||
|
||||
if ( rc >= 0) {
|
||||
if ( set_device(device) < 0) {
|
||||
LOG_E(HW, "%s %d:Unsupported radio head\n",__FILE__, __LINE__);
|
||||
LOG_E(HW, "%s %d:Unsupported radio head\n", __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
int openair0_transport_load(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t *eth_params) {
|
||||
|
||||
int openair0_transport_load(openair0_device *device,
|
||||
openair0_config_t *openair0_cfg,
|
||||
eth_params_t *eth_params)
|
||||
{
|
||||
int rc;
|
||||
rc=load_lib(device, openair0_cfg, eth_params, RAU_REMOTE_RADIO_HEAD);
|
||||
|
||||
if ( rc >= 0) {
|
||||
if ( set_transport(device) < 0) {
|
||||
LOG_E(HW, "%s %d:Unsupported transport protocol\n",__FILE__, __LINE__);
|
||||
LOG_E(HW, "%s %d:Unsupported transport protocol\n", __FILE__, __LINE__);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -43,9 +43,9 @@
|
||||
/* name of shared library implementing a third-party transport */
|
||||
#define OAI_THIRDPARTY_TP_LIBNAME "thirdparty_transpro"
|
||||
/* name of shared library implementing the basic/rf simulator */
|
||||
#define OAI_RFSIM_LIBNAME "rfsimulator"
|
||||
#define OAI_RFSIM_LIBNAME "rfsimulator"
|
||||
/* name of shared library implementing the basic/rf simulator */
|
||||
#define OAI_BASICSIM_LIBNAME "tcp_bridge_oai"
|
||||
#define OAI_BASICSIM_LIBNAME "tcp_bridge_oai"
|
||||
/* flags for BBU to determine whether the attached radio head is local or remote */
|
||||
#define RAU_LOCAL_RADIO_HEAD 0
|
||||
#define RAU_REMOTE_RADIO_HEAD 1
|
||||
@@ -58,14 +58,9 @@ typedef int64_t openair0_timestamp;
|
||||
typedef volatile int64_t openair0_vtimestamp;
|
||||
|
||||
|
||||
/*!\brief structrue holds the parameters to configure USRP devices*/
|
||||
/*!\brief structure holds the parameters to configure USRP devices*/
|
||||
typedef struct openair0_device_t openair0_device;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//#define USRP_GAIN_OFFSET (56.0) // 86 calibrated for USRP B210 @ 2.6 GHz to get equivalent RS EPRE in OAI to SMBV100 output
|
||||
|
||||
typedef enum {
|
||||
@@ -107,7 +102,6 @@ typedef enum {
|
||||
/*!\brief device is UEDv2 */
|
||||
UEDv2_DEV,
|
||||
MAX_RF_DEV_TYPE
|
||||
|
||||
} dev_type_t;
|
||||
|
||||
/*!\brief transport protocol types
|
||||
@@ -119,7 +113,6 @@ typedef enum {
|
||||
/*!\brief no transport protocol*/
|
||||
NONE_TP,
|
||||
MAX_TRANSP_TYPE
|
||||
|
||||
} transport_type_t;
|
||||
|
||||
|
||||
@@ -131,7 +124,6 @@ typedef enum {
|
||||
/*!\brief device functions within a RRU */
|
||||
RRU_HOST,
|
||||
MAX_HOST_TYPE
|
||||
|
||||
} host_type_t;
|
||||
|
||||
|
||||
@@ -145,6 +137,8 @@ typedef struct {
|
||||
|
||||
/*! \brief Clock source types */
|
||||
typedef enum {
|
||||
//! this means the paramter has not been set
|
||||
unset=-1,
|
||||
//! This tells the underlying hardware to use the internal reference
|
||||
internal=0,
|
||||
//! This tells the underlying hardware to use the external reference
|
||||
@@ -190,7 +184,6 @@ typedef struct {
|
||||
//! \brief memory
|
||||
//! \brief Pointer to Calibration table for RX gains
|
||||
rx_gain_calib_table_t *rx_gain_calib_table;
|
||||
|
||||
//! mode for rxgain (ExpressMIMO2)
|
||||
rx_gain_t rxg_mode[4];
|
||||
//! \brief Gain for RX in dB.
|
||||
@@ -210,6 +203,7 @@ typedef struct {
|
||||
//! timing_source
|
||||
clock_source_t time_source;
|
||||
//! Manual SDR IP address
|
||||
//#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
|
||||
char *sdr_addrs;
|
||||
//! Auto calibration flag
|
||||
int autocal[4];
|
||||
@@ -219,6 +213,14 @@ typedef struct {
|
||||
int iq_rxrescale;
|
||||
//! Configuration file for LMS7002M
|
||||
char *configFilename;
|
||||
//! remote IP/MAC addr for Ethernet interface
|
||||
char *remote_addr;
|
||||
//! remote port number for Ethernet interface
|
||||
unsigned int remote_port;
|
||||
//! local IP/MAC addr for Ethernet interface (eNB/BBU, UE)
|
||||
char *my_addr;
|
||||
//! local port number for Ethernet interface (eNB/BBU, UE)
|
||||
unsigned int my_port;
|
||||
#if defined(USRP_REC_PLAY)
|
||||
unsigned short sf_mode; // 1=record, 2=replay
|
||||
char sf_filename[1024]; // subframes file path
|
||||
@@ -228,6 +230,14 @@ typedef struct {
|
||||
unsigned int sf_write_delay; // write delay in replay mode
|
||||
unsigned int eth_mtu; // ethernet MTU
|
||||
#endif
|
||||
//! number of samples per tti
|
||||
unsigned int samples_per_tti;
|
||||
//! the sample rate for receive.
|
||||
double rx_sample_rate;
|
||||
//! the sample rate for transmit.
|
||||
double tx_sample_rate;
|
||||
//! check for threequarter sampling rate
|
||||
int8_t threequarter_fs;
|
||||
} openair0_config_t;
|
||||
|
||||
/*! \brief RF mapping */
|
||||
@@ -259,7 +269,6 @@ typedef struct {
|
||||
uint8_t if_compress;
|
||||
} eth_params_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
//! Tx buffer for if device, keep one per subframe now to allow multithreading
|
||||
void *tx[10];
|
||||
@@ -269,7 +278,6 @@ typedef struct {
|
||||
void *rx;
|
||||
} if_buffer_t;
|
||||
|
||||
|
||||
/*!\brief structure holds the parameters to configure USRP devices */
|
||||
struct openair0_device_t {
|
||||
/*!brief Module ID of this device */
|
||||
@@ -281,7 +289,7 @@ struct openair0_device_t {
|
||||
/*!brief Type of this device */
|
||||
dev_type_t type;
|
||||
|
||||
/*!brief Transport protocol type that the device suppports (in case I/Q samples need to be transported) */
|
||||
/*!brief Transport protocol type that the device supports (in case I/Q samples need to be transported) */
|
||||
transport_type_t transp_type;
|
||||
|
||||
/*!brief Type of the device's host (RAU/RRU) */
|
||||
@@ -469,12 +477,23 @@ typedef struct {
|
||||
uint32_t option_flag; // Option flag
|
||||
} samplesBlockHeader_t;
|
||||
|
||||
#define UE_MAGICDL_FDD 0xA5A5A5A5A5A5A5A5 // UE DL FDD record
|
||||
#define UE_MAGICUL_FDD 0x5A5A5A5A5A5A5A5A // UE UL FDD record
|
||||
#define UE_MAGICDL_TDD 0xA6A6A6A6A6A6A6A6 // UE DL TDD record
|
||||
#define UE_MAGICUL_TDD 0x6A6A6A6A6A6A6A6A // UE UL TDD record
|
||||
|
||||
#define ENB_MAGICDL_FDD 0xB5B5B5B5B5B5B5B5 // eNB DL FDD record
|
||||
#define ENB_MAGICUL_FDD 0x5B5B5B5B5B5B5B5B // eNB UL FDD record
|
||||
#define ENB_MAGICDL_TDD 0xB6B6B6B6B6B6B6B6 // eNB DL TDD record
|
||||
#define ENB_MAGICUL_TDD 0x6B6B6B6B6B6B6B6B // eNB UL TDD record
|
||||
|
||||
#define OPTION_LZ4 0x00000001 // LZ4 compression (option_value is set to compressed size)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
|
||||
/*! \brief Initialize openair RF target. It returns 0 if OK */
|
||||
int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cfg);
|
||||
/*! \brief Initialize transport protocol . It returns 0 if OK */
|
||||
@@ -493,8 +512,11 @@ openair0_timestamp get_usrp_time(openair0_device *device);
|
||||
*/
|
||||
int openair0_set_rx_frequencies(openair0_device *device, openair0_config_t *openair0_cfg);
|
||||
|
||||
#define gettid() syscall(__NR_gettid)
|
||||
/*@}*/
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user