* add RRH gateway module, IQ transports, and its gtkwave template (experimental)
* update ethernet library and common lib * update runtime values of the lte-softmodem tx and rx threads based on an empirical model git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7709 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
@@ -26,16 +26,23 @@
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
/*! \file common_lib.h
|
||||
* \brief common APIs for different RF frontend device
|
||||
* \author HongliangXU, Navid Nikaein
|
||||
* \date 2015
|
||||
* \version 0.2
|
||||
* \company Eurecom
|
||||
* \maintainer: navid.nikaein@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
/** common_lib.h
|
||||
*
|
||||
* Author: HongliangXU : hong-liang-xu@agilent.com
|
||||
*/
|
||||
#ifndef COMMON_LIB_H
|
||||
#define COMMON_LIB_H
|
||||
#include <stdint.h>
|
||||
|
||||
typedef int64_t openair0_timestamp;
|
||||
typedef volatile int64_t openair0_vtimestamp;
|
||||
typedef struct openair0_device_t openair0_device;
|
||||
/* structrue holds the parameters to configure USRP devices
|
||||
*/
|
||||
@@ -56,10 +63,18 @@ typedef struct {
|
||||
int Mod_id;
|
||||
// device log level
|
||||
int log_level;
|
||||
//! number of downlink resource blocks
|
||||
int num_rb_dl;
|
||||
//! number of samples per frame
|
||||
unsigned int samples_per_frame;
|
||||
//! the sample rate for both transmit and receive.
|
||||
double sample_rate;
|
||||
//! number of samples per RX/TX packet (USRP + Ethernet)
|
||||
int samples_per_packet;
|
||||
// delay in sending samples (write) due to hardware access, softmodem processing and fronthaul delay if exist
|
||||
int tx_delay;
|
||||
//! adjust the position of the samples after delay when sending
|
||||
unsigned int tx_forward_nsamps;
|
||||
//! number of RX channels (=RX antennas)
|
||||
int rx_num_channels;
|
||||
//! number of TX channels (=TX antennas)
|
||||
@@ -84,9 +99,14 @@ typedef struct {
|
||||
//! Auto calibration flag
|
||||
int autocal[4];
|
||||
//! RRH IP addr for Ethernet interface
|
||||
char *rrh_ip;
|
||||
char *remote_ip;
|
||||
//! RRH port number for Ethernet interface
|
||||
int rrh_port;
|
||||
int remote_port;
|
||||
//! my IP addr for Ethernet interface (eNB/BBU, UE)
|
||||
char *my_ip;
|
||||
//! my port number for Ethernet interface (eNB/BBU, UE)
|
||||
int my_port;
|
||||
|
||||
} openair0_config_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -98,10 +118,42 @@ typedef struct {
|
||||
|
||||
|
||||
|
||||
/*!\brief device type */
|
||||
typedef enum {
|
||||
MIN_DEV_TYPE = 0,
|
||||
/*!\brief device is ETH */
|
||||
ETH_IF,
|
||||
/*!\brief device is ExpressMIMO */
|
||||
EXMIMO_IF,
|
||||
/*!\brief device is USRP*/
|
||||
USRP_IF,
|
||||
/*!\brief device is BLADE RF*/
|
||||
BLADERF_IF,
|
||||
/*!\brief device is NONE*/
|
||||
NONE_IF,
|
||||
MAX_DEV_TYPE
|
||||
|
||||
} dev_type_t;
|
||||
|
||||
/*!\brief type */
|
||||
typedef enum {
|
||||
MIN_FUNC_TYPE = 0,
|
||||
BBU_FUNC,
|
||||
RRH_FUNC,
|
||||
MAX_FUNC_TYPE
|
||||
|
||||
}func_type_t;
|
||||
|
||||
struct openair0_device_t {
|
||||
/* Module ID of this device */
|
||||
int Mod_id;
|
||||
|
||||
/* Type of this device */
|
||||
func_type_t func_type;
|
||||
|
||||
/* Type of this device */
|
||||
dev_type_t type;
|
||||
|
||||
/* RF frontend parameters set by application */
|
||||
openair0_config_t openair0_cfg;
|
||||
|
||||
@@ -113,11 +165,20 @@ struct openair0_device_t {
|
||||
/* Called to start the transceiver. Return 0 if OK, < 0 if error */
|
||||
int (*trx_start_func)(openair0_device *device);
|
||||
|
||||
/* Called to initiate transceiver threads */
|
||||
void (*trx_thread_func)(openair0_device *device, unsigned int rt_period, uint8_t RT_flag,uint8_t NRT_flag);
|
||||
|
||||
/* Called to request connection from the transceiver/RRH. Return 0 if OK, < 0 if error */
|
||||
int (*trx_request_func)(openair0_device *device);
|
||||
|
||||
/* Called to reply back to connection state to eNB/BBU. Return 0 if OK, < 0 if error */
|
||||
int (*trx_reply_func)(openair0_device *openair0);
|
||||
|
||||
/* Write 'nsamps' samples on each channel from buffers. buff[0] is the array for
|
||||
* the first channel. timestamp if the time (in samples) at which the first sample
|
||||
* MUST be sent
|
||||
* use flags = 1 to send as timestamp specfied*/
|
||||
void (*trx_write_func)(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags);
|
||||
int (*trx_write_func)(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps,int antenna_id, int flags);
|
||||
|
||||
/*! \brief Receive samples from hardware.
|
||||
* Read \ref nsamps samples from each channel to buffers. buff[0] is the array for
|
||||
@@ -130,7 +191,19 @@ struct openair0_device_t {
|
||||
* \param cc Number of channels. If cc == 1, only buff[0] is filled with samples.
|
||||
* \returns the number of sample read
|
||||
*/
|
||||
int (*trx_read_func)(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps,int cc);
|
||||
int (*trx_read_func)(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps,int antenna_id);
|
||||
|
||||
/*! \brief print the device statistics
|
||||
* \param device the hardware to use
|
||||
* \returns 0 on success
|
||||
*/
|
||||
int (*trx_get_stats_func)(openair0_device *device);
|
||||
|
||||
/*! \brief Reset device statistics
|
||||
* \param device the hardware to use
|
||||
* \returns 0 in success
|
||||
*/
|
||||
int (*trx_reset_stats_func)(openair0_device *device);
|
||||
|
||||
/* Terminate operation of the transceiver -- free all associated resources */
|
||||
void (*trx_end_func)(openair0_device *device);
|
||||
@@ -142,15 +215,33 @@ extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/* return 0 if OK, < 0 if error */
|
||||
int openair0_device_init(openair0_device* device, openair0_config_t *openair0_cfg);
|
||||
openair0_timestamp get_usrp_time(openair0_device *device);
|
||||
int openair0_set_frequencies(openair0_device* device, openair0_config_t *openair0_cfg,int exmimo_dump_config);
|
||||
int openair0_set_rx_frequencies(openair0_device* device, openair0_config_t *openair0_cfg);
|
||||
|
||||
int openair0_set_gains(openair0_device* device, openair0_config_t *openair0_cfg);
|
||||
|
||||
int openair0_stop(int card);
|
||||
/* return 0 if OK */
|
||||
|
||||
int openair0_device_init(openair0_device* device, openair0_config_t *openair0_cfg);
|
||||
openair0_timestamp get_usrp_time(openair0_device *device);
|
||||
|
||||
//EXMIMO
|
||||
//int openair0_dev_init_exmimo(openair0_device *device, openair0_config_t *openair0_cfg);
|
||||
//USPRP
|
||||
//int openair0_dev_init_usrp(openair0_device* device, openair0_config_t *openair0_cfg);
|
||||
//BLADERF
|
||||
//int openair0_dev_init_bladerf(openair0_device* device, openair0_config_t *openair0_cfg);
|
||||
|
||||
//ETHERNET
|
||||
int openair0_dev_init_eth(openair0_device *device, openair0_config_t *openair0_cfg);
|
||||
|
||||
int openair0_set_frequencies(openair0_device* device, openair0_config_t *openair0_cfg,int exmimo_dump_config);
|
||||
|
||||
int openair0_set_rx_frequencies(openair0_device* device, openair0_config_t *openair0_cfg);
|
||||
|
||||
int openair0_set_gains(openair0_device* device, openair0_config_t *openair0_cfg);
|
||||
|
||||
int openair0_print_stats(openair0_device* device);
|
||||
|
||||
int openair0_reset_stats(openair0_device* device);
|
||||
|
||||
int openair0_stop(int card);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user