Commit e16241fa authored by WANG Tsu-Han's avatar WANG Tsu-Han

adding executional option for usrp trx thread and adding null device function...

adding executional option for usrp trx thread and adding null device function for device other than usrp
parent d098d93d
...@@ -117,6 +117,7 @@ uint16_t sl_ahead; ...@@ -117,6 +117,7 @@ uint16_t sl_ahead;
extern int emulate_rf; extern int emulate_rf;
extern int numerology; extern int numerology;
extern int usrp_tx_thread;
/*************************************************************/ /*************************************************************/
/* Functions to attach and configure RRU */ /* Functions to attach and configure RRU */
...@@ -1465,12 +1466,15 @@ void *ru_thread( void *param ) { ...@@ -1465,12 +1466,15 @@ void *ru_thread( void *param ) {
if ((ru->is_slave) && (ru->if_south == LOCAL_RF)) do_ru_synch(ru); if ((ru->is_slave) && (ru->if_south == LOCAL_RF)) do_ru_synch(ru);
// start trx write thread // start trx write thread
if (ru->start_write_thread){ if(usrp_tx_thread == 1){
if(ru->start_write_thread(ru) != 0){ printf("~~~~~~~~~~~testing if the command is get\n");
LOG_E(HW,"Could not start tx write thread\n"); if (ru->start_write_thread){
} if(ru->start_write_thread(ru) != 0){
else{ LOG_E(HW,"Could not start tx write thread\n");
LOG_I(PHY,"tx write thread ready\n"); }
else{
LOG_I(PHY,"tx write thread ready\n");
}
} }
} }
} }
......
...@@ -89,6 +89,7 @@ ...@@ -89,6 +89,7 @@
#define CONFIG_HLP_EMULATE_RF "Emulated RF enabled(disable by defult)\n" #define CONFIG_HLP_EMULATE_RF "Emulated RF enabled(disable by defult)\n"
#define CONFIG_HLP_PARALLEL_CMD "three config for level of parallelism 'PARALLEL_SINGLE_THREAD', 'PARALLEL_RU_L1_SPLIT', or 'PARALLEL_RU_L1_TRX_SPLIT'\n" #define CONFIG_HLP_PARALLEL_CMD "three config for level of parallelism 'PARALLEL_SINGLE_THREAD', 'PARALLEL_RU_L1_SPLIT', or 'PARALLEL_RU_L1_TRX_SPLIT'\n"
#define CONFIG_HLP_WORKER_CMD "two option for worker 'WORKER_DISABLE' or 'WORKER_ENABLE'\n" #define CONFIG_HLP_WORKER_CMD "two option for worker 'WORKER_DISABLE' or 'WORKER_ENABLE'\n"
#define CONFIG_HLP_USRP_THREAD "having extra thead for usrp tx\n"
#define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n" #define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n"
#define CONFIG_HLP_USRP_ARGS "set the arguments to identify USRP (same syntax as in UHD)\n" #define CONFIG_HLP_USRP_ARGS "set the arguments to identify USRP (same syntax as in UHD)\n"
...@@ -143,6 +144,10 @@ extern int sync_var; ...@@ -143,6 +144,10 @@ extern int sync_var;
extern int transmission_mode; extern int transmission_mode;
extern double cpuf; extern double cpuf;
extern int emulate_rf;
extern int numerology;
extern int usrp_tx_thread;
extern volatile int start_eNB; extern volatile int start_eNB;
extern volatile int start_UE; extern volatile int start_UE;
......
...@@ -182,6 +182,7 @@ extern void init_eNB_afterRU(void); ...@@ -182,6 +182,7 @@ extern void init_eNB_afterRU(void);
int transmission_mode=1; int transmission_mode=1;
int emulate_rf = 0; int emulate_rf = 0;
int numerology = 0; int numerology = 0;
int usrp_tx_thread = 0;
static char *parallel_config = NULL; static char *parallel_config = NULL;
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
{"emulate-rf" , CONFIG_HLP_EMULATE_RF, PARAMFLAG_BOOL, iptr:&emulate_rf, defintval:0, TYPE_INT, 0}, \ {"emulate-rf" , CONFIG_HLP_EMULATE_RF, PARAMFLAG_BOOL, iptr:&emulate_rf, defintval:0, TYPE_INT, 0}, \
{"parallel-config", CONFIG_HLP_PARALLEL_CMD,0, strptr:(char **)&parallel_config, defstrval:NULL, TYPE_STRING, 0}, \ {"parallel-config", CONFIG_HLP_PARALLEL_CMD,0, strptr:(char **)&parallel_config, defstrval:NULL, TYPE_STRING, 0}, \
{"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:(char **)&worker_config, defstrval:NULL, TYPE_STRING, 0}, \ {"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:(char **)&worker_config, defstrval:NULL, TYPE_STRING, 0}, \
{"usrp-tx-thread-config", CONFIG_HLP_USRP_THREAD, 0, iptr:&usrp_tx_thread, defstrval:0, TYPE_INT, 0}, \
{"s" , CONFIG_HLP_SNR, 0, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0}, \ {"s" , CONFIG_HLP_SNR, 0, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0}, \
} }
......
...@@ -330,7 +330,10 @@ int trx_brf_set_gains(openair0_device* device, ...@@ -330,7 +330,10 @@ int trx_brf_set_gains(openair0_device* device,
{ {
return(0); return(0);
} }
int trx_brf_write_init(openair0_device *device)
{
return 0;
}
#define RXDCLENGTH 16384 #define RXDCLENGTH 16384
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};
...@@ -1145,6 +1148,7 @@ int device_init(openair0_device *device, ...@@ -1145,6 +1148,7 @@ int device_init(openair0_device *device,
device->trx_stop_func = trx_brf_stop; device->trx_stop_func = trx_brf_stop;
device->trx_set_freq_func = trx_brf_set_freq; device->trx_set_freq_func = trx_brf_set_freq;
device->trx_set_gains_func = trx_brf_set_gains; device->trx_set_gains_func = trx_brf_set_gains;
device->trx_write_init = trx_brf_write_init;
device->openair0_cfg = openair0_cfg; device->openair0_cfg = openair0_cfg;
device->priv = (void *)brf; device->priv = (void *)brf;
......
...@@ -197,6 +197,10 @@ int trx_eth_reset_stats(openair0_device* device) ...@@ -197,6 +197,10 @@ int trx_eth_reset_stats(openair0_device* device)
return(0); return(0);
} }
int trx_eth_write_init(openair0_device *device)
{
return 0;
}
int ethernet_tune(openair0_device *device, int ethernet_tune(openair0_device *device,
unsigned int option, unsigned int option,
...@@ -415,8 +419,9 @@ int transport_init(openair0_device *device, ...@@ -415,8 +419,9 @@ int transport_init(openair0_device *device,
device->trx_reset_stats_func = trx_eth_reset_stats; device->trx_reset_stats_func = trx_eth_reset_stats;
device->trx_end_func = trx_eth_end; device->trx_end_func = trx_eth_end;
device->trx_stop_func = trx_eth_stop; device->trx_stop_func = trx_eth_stop;
device->trx_set_freq_func = trx_eth_set_freq; device->trx_set_freq_func = trx_eth_set_freq;
device->trx_set_gains_func = trx_eth_set_gains; device->trx_set_gains_func = trx_eth_set_gains;
device->trx_write_init = trx_eth_write_init;
if (eth->flags == ETH_RAW_MODE) { if (eth->flags == ETH_RAW_MODE) {
device->trx_write_func = trx_eth_write_raw; device->trx_write_func = trx_eth_write_raw;
......
...@@ -510,6 +510,11 @@ int trx_iris_reset_stats(openair0_device *device) { ...@@ -510,6 +510,11 @@ int trx_iris_reset_stats(openair0_device *device) {
} }
int trx_iris_write_init(openair0_device *device)
{
return 0;
}
extern "C" { extern "C" {
/*! \brief Initialize Openair Iris target. It returns 0 if OK /*! \brief Initialize Openair Iris target. It returns 0 if OK
...@@ -831,6 +836,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) { ...@@ -831,6 +836,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
device->trx_set_freq_func = trx_iris_set_freq; device->trx_set_freq_func = trx_iris_set_freq;
device->trx_set_gains_func = trx_iris_set_gains; device->trx_set_gains_func = trx_iris_set_gains;
device->openair0_cfg = openair0_cfg; device->openair0_cfg = openair0_cfg;
device->trx_write_init = trx_iris_write_init;
s->sample_rate = openair0_cfg[0].sample_rate; s->sample_rate = openair0_cfg[0].sample_rate;
// TODO: // TODO:
......
...@@ -350,6 +350,10 @@ void trx_lms_end(openair0_device *device) { ...@@ -350,6 +350,10 @@ void trx_lms_end(openair0_device *device) {
} }
int trx_lms_write_init(openair0_device *device)
{
return 0;
}
extern "C" { extern "C" {
/*! \brief Initialize Openair LMSSDR target. It returns 0 if OK /*! \brief Initialize Openair LMSSDR target. It returns 0 if OK
* \param device the hardware to use * \param device the hardware to use
...@@ -406,6 +410,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg){ ...@@ -406,6 +410,7 @@ int device_init(openair0_device *device, openair0_config_t *openair0_cfg){
device->trx_stop_func = trx_lms_stop; device->trx_stop_func = trx_lms_stop;
device->trx_set_freq_func = trx_lms_set_freq; device->trx_set_freq_func = trx_lms_set_freq;
device->trx_set_gains_func = trx_lms_set_gains; device->trx_set_gains_func = trx_lms_set_gains;
device->trx_write_init = trx_lms_write_init;
device->openair0_cfg = openair0_cfg; device->openair0_cfg = openair0_cfg;
......
...@@ -70,6 +70,8 @@ ...@@ -70,6 +70,8 @@
* @{ * @{
*/ */
extern int usrp_tx_thread;
typedef struct { typedef struct {
...@@ -345,7 +347,6 @@ static int trx_usrp_write(openair0_device *device, ...@@ -345,7 +347,6 @@ static int trx_usrp_write(openair0_device *device,
int flags_msb = (flags>>8)&0xff; int flags_msb = (flags>>8)&0xff;
int end; int end;
int write_tread = 0;
openair0_thread_t *write_thread = &device->write_thread; openair0_thread_t *write_thread = &device->write_thread;
openair0_write_package_t *write_package = write_thread->write_package; openair0_write_package_t *write_package = write_thread->write_package;
...@@ -382,7 +383,7 @@ static int trx_usrp_write(openair0_device *device, ...@@ -382,7 +383,7 @@ static int trx_usrp_write(openair0_device *device,
last_packet_state = true; last_packet_state = true;
} }
if(write_tread == 0){ if(usrp_tx_thread == 0){
#if defined(__x86_64) || defined(__i386__) #if defined(__x86_64) || defined(__i386__)
#ifdef __AVX2__ #ifdef __AVX2__
nsamps2 = (nsamps+7)>>3; nsamps2 = (nsamps+7)>>3;
...@@ -586,7 +587,7 @@ void *trx_usrp_write_thread(void * arg){ ...@@ -586,7 +587,7 @@ void *trx_usrp_write_thread(void * arg){
return NULL; return NULL;
} }
int trx_write_init(openair0_device *device){ int trx_usrp_write_init(openair0_device *device){
uhd::set_thread_priority_safe(1.0); uhd::set_thread_priority_safe(1.0);
openair0_thread_t *write_thread = &device->write_thread; openair0_thread_t *write_thread = &device->write_thread;
...@@ -932,7 +933,7 @@ extern "C" { ...@@ -932,7 +933,7 @@ extern "C" {
device->trx_stop_func = trx_usrp_stop; device->trx_stop_func = trx_usrp_stop;
device->trx_set_freq_func = trx_usrp_set_freq; device->trx_set_freq_func = trx_usrp_set_freq;
device->trx_set_gains_func = trx_usrp_set_gains; device->trx_set_gains_func = trx_usrp_set_gains;
device->trx_write_init = trx_write_init; device->trx_write_init = trx_usrp_write_init;
// hotfix! to be checked later // hotfix! to be checked later
......
...@@ -243,6 +243,11 @@ ts += nsamps; ...@@ -243,6 +243,11 @@ ts += nsamps;
return nsamps; return nsamps;
} }
int tcp_bridge_write_init(openair0_device *device)
{
return 0;
}
__attribute__((__visibility__("default"))) __attribute__((__visibility__("default")))
int device_init(openair0_device* device, openair0_config_t *openair0_cfg) int device_init(openair0_device* device, openair0_config_t *openair0_cfg)
{ {
...@@ -267,6 +272,7 @@ int device_init(openair0_device* device, openair0_config_t *openair0_cfg) ...@@ -267,6 +272,7 @@ int device_init(openair0_device* device, openair0_config_t *openair0_cfg)
device->trx_set_gains_func = tcp_bridge_set_gains; device->trx_set_gains_func = tcp_bridge_set_gains;
device->trx_write_func = tcp_bridge_write; device->trx_write_func = tcp_bridge_write;
device->trx_read_func = tcp_bridge_read; device->trx_read_func = tcp_bridge_read;
device->trx_write_init = tcp_bridge_write_init;
device->priv = tcp_bridge; device->priv = tcp_bridge;
......
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