added usrp-tx-thread to lte modem
This commit is contained in:
@@ -86,6 +86,8 @@ extern "C"
|
||||
#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_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_NOS1 "Disable s1 interface\n"
|
||||
#define CONFIG_HLP_RFSIM "Run in rf simulator mode (also known as basic simulator)\n"
|
||||
#define CONFIG_HLP_NOKRNMOD "(noS1 only): Use tun instead of namesh module \n"
|
||||
@@ -139,6 +141,7 @@ extern "C"
|
||||
{"nokrnmod", CONFIG_HLP_NOKRNMOD, PARAMFLAG_BOOL, uptr:&nokrnmod, defintval:0, TYPE_INT, 0}, \
|
||||
{"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, uptr:&nonbiot, defuintval:0, TYPE_INT, 0}, \
|
||||
{"use-256qam-table", CONFIG_HLP_256QAM, PARAMFLAG_BOOL, iptr:&USE_256QAM_TABLE, defintval:0, TYPE_INT, 0}, \
|
||||
{"usrp-tx-thread-config", CONFIG_HLP_USRP_THREAD, 0, iptr:&usrp_tx_thread, defstrval:0, TYPE_INT, 0}, \
|
||||
}
|
||||
|
||||
|
||||
@@ -236,6 +239,7 @@ extern char *get_softmodem_function(uint64_t *sofmodemfunc_mask_ptr);
|
||||
extern void set_softmodem_sighandler(void);
|
||||
extern uint64_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
extern int usrp_tx_thread;
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -464,6 +464,7 @@ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_BEAM_SWITCHI
|
||||
write_package[end].buff[i] = buff[i];
|
||||
write_thread->count_write++;
|
||||
write_thread->end = (write_thread->end + 1)% MAX_WRITE_THREAD_PACKAGE;
|
||||
LOG_I(HW,"Signaling TX TS %llu\n",(unsigned long long)timestamp);
|
||||
pthread_cond_signal(&write_thread->cond_write);
|
||||
pthread_mutex_unlock(&write_thread->mutex_write);
|
||||
return 0;
|
||||
@@ -1263,7 +1264,7 @@ extern "C" {
|
||||
LOG_I(HW,"Actual time source %s...\n",s->usrp->get_time_source(0).c_str());
|
||||
sleep(1);
|
||||
// create tx & rx streamer
|
||||
uhd::stream_args_t stream_args_rx("sc16", "sc12");
|
||||
uhd::stream_args_t stream_args_rx("sc16", "sc16");
|
||||
int samples=openair0_cfg[0].sample_rate;
|
||||
int max=s->usrp->get_rx_stream(stream_args_rx)->get_max_num_samps();
|
||||
samples/=10000;
|
||||
@@ -1280,7 +1281,7 @@ extern "C" {
|
||||
stream_args_rx.channels.push_back(i);
|
||||
|
||||
s->rx_stream = s->usrp->get_rx_stream(stream_args_rx);
|
||||
uhd::stream_args_t stream_args_tx("sc16", "sc12");
|
||||
uhd::stream_args_t stream_args_tx("sc16", "sc16");
|
||||
|
||||
for (int i = 0; i<openair0_cfg[0].tx_num_channels; i++)
|
||||
stream_args_tx.channels.push_back(i);
|
||||
|
||||
@@ -1659,6 +1659,17 @@ static void *ru_thread( void *param ) {
|
||||
pthread_cond_signal(&proc->cond_FH1);
|
||||
AssertFatal((ret=pthread_mutex_unlock(&proc->mutex_FH1))==0,"mutex_unlock returns %d\n",ret);
|
||||
|
||||
if(usrp_tx_thread == 1){
|
||||
if (ru->start_write_thread){
|
||||
if(ru->start_write_thread(ru) != 0){
|
||||
LOG_E(HW,"Could not start tx write thread\n");
|
||||
}
|
||||
else{
|
||||
LOG_I(PHY,"tx write thread ready\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
while (!oai_exit) {
|
||||
if (ru->if_south != LOCAL_RF && ru->is_slave==1) {
|
||||
ru->wait_cnt = 100;
|
||||
@@ -2174,6 +2185,9 @@ void reset_proc(RU_t *ru) {
|
||||
for (i=0; i<10; i++) proc->symbol_mask[i]=0;
|
||||
}
|
||||
|
||||
int start_write_thread(RU_t *ru) {
|
||||
return(ru->rfdevice.trx_write_init(&ru->rfdevice));
|
||||
}
|
||||
|
||||
void init_RU_proc(RU_t *ru) {
|
||||
int i=0;
|
||||
@@ -2536,6 +2550,7 @@ void set_function_spec_param(RU_t *ru) {
|
||||
ru->fh_north_out = NULL; // no outgoing fronthaul to north
|
||||
ru->start_if = NULL; // no if interface
|
||||
ru->rfdevice.host_type = RAU_HOST;
|
||||
ru->start_write_thread = start_write_thread;
|
||||
}
|
||||
|
||||
ru->fh_south_in = rx_rf; // local synchronous RF RX
|
||||
|
||||
Reference in New Issue
Block a user