Commit 173f10e5 authored by Wang Tsu-Han's avatar Wang Tsu-Han

adding uhd priority setting in ru_thread_tx

parent eaa83242
......@@ -415,9 +415,6 @@ int wakeup_txfh(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc,int frame_tx,int slot
RU_proc_t *ru_proc;
int waitret,ret;
struct timespec wait;
wait.tv_sec=0;
wait.tv_nsec=10000000L;
......@@ -484,10 +481,6 @@ int wakeup_tx(PHY_VARS_gNB *gNB,int frame_rx,int slot_rx,int frame_tx,int slot_t
int ret;
struct timespec wait;
wait.tv_sec=0;
wait.tv_nsec=5000000L;
AssertFatal((ret = pthread_mutex_lock(&L1_proc_tx->mutex))==0,"mutex_lock returns %d\n",ret);
......@@ -524,7 +517,6 @@ int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) {
RU_proc_t *ru_proc=&ru->proc;
int ret;
int i;
struct timespec wait;
AssertFatal((ret=pthread_mutex_lock(&proc->mutex_RU))==0,"mutex_lock returns %d\n",ret);
for (i=0;i<gNB->num_RU;i++) {
......@@ -546,9 +538,6 @@ int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) {
}
wait.tv_sec=0;
wait.tv_nsec=5000000L;
// wake up TX for subframe n+sl_ahead
// lock the TX mutex and make sure the thread is ready
AssertFatal((ret=pthread_mutex_lock(&L1_proc->mutex)) == 0,"mutex_lock returns %d\n", ret);
......
......@@ -1208,6 +1208,12 @@ static void *ru_thread_tx( void *param ) {
int i = 0;
int ret;
if(ru->if_south == LOCAL_RF)
{
uhd_set_thread_prio();
LOG_I(PHY,"set ru_thread_tx uhd priority");
}
wait_on_condition(&proc->mutex_FH1,&proc->cond_FH1,&proc->instance_cnt_FH1,"ru_thread_tx");
printf( "ru_thread_tx ready\n");
......
......@@ -43,6 +43,8 @@
int set_device(openair0_device *device) {
switch (device->type) {
printf("/////////////HW device type %s\n",device->type);
case EXMIMO_DEV:
LOG_I(HW,"[%s] has loaded EXPRESS MIMO device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
......@@ -95,34 +97,56 @@ int set_transport(openair0_device *device) {
}
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) {
loader_shlibfunc_t shlib_fdesc[2];
loader_shlibfunc_t shlib_fdesc[1];
int ret=0;
char *libname;
if (flag == RAU_LOCAL_RADIO_HEAD) {
if (getenv("RFSIMULATOR") != NULL)
libname="rfsimulator";
else
if (getenv("RFSIMULATOR") != NULL)
libname="rfsimulator";
else
libname=OAI_RF_LIBNAME;
shlib_fdesc[0].fname="device_init";
shlib_fdesc[1].fname="uhd_set_thread_priority";
//shlib_fdesc[1].fname="uhd_set_thread_priority";
} else {
libname=OAI_TP_LIBNAME;
shlib_fdesc[0].fname="transport_init";
}
ret=load_module_shlib(libname,shlib_fdesc,2,NULL);
ret=load_module_shlib(libname,shlib_fdesc,1,NULL);
if (ret < 0) {
LOG_E(HW,"Library %s couldn't be loaded\n",libname);
} else {
ret=((devfunc_t)shlib_fdesc[0].fptr)(device,openair0_cfg,cfg);
uhd_set_thread_priority_fun = (set_prio_func_t)shlib_fdesc[1].fptr;
//uhd_set_thread_priority_fun = (set_prio_func_t)shlib_fdesc[1].fptr;
}
return ret;
}
void uhd_set_thread_prio(void) {
loader_shlibfunc_t shlib_fdesc[1];
int ret = 0;
char *libname;
if (getenv("RFSIMULATOR") != NULL)
libname="rfsimulator";
else
libname=OAI_RF_LIBNAME;
shlib_fdesc[0].fname="uhd_set_thread_priority";
ret=load_module_shlib(libname,shlib_fdesc,1,NULL);
if (ret < 0) {
LOG_E(HW,"Library %s couldn't be loaded\n",libname);
} else {
(set_prio_func_t)shlib_fdesc[0].fptr();
}
return ret;
}
int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cfg) {
......
......@@ -445,7 +445,7 @@ int openair0_set_rx_frequencies(openair0_device *device, openair0_config_t *open
#define gettid() syscall(__NR_gettid)
/*@}*/
void uhd_set_thread_priority(void);
void uhd_set_thread_prio(void);
typedef void(*set_prio_func_t)(void);
set_prio_func_t uhd_set_thread_priority_fun;
......
......@@ -254,7 +254,7 @@ RUs = (
max_pdschReferenceSignalPower = -27;
max_rxgain = 114;
eNB_instances = [0];
sdr_addrs = "addr=192.168.30.2";
sdr_addrs = "type=x300";
}
);
......
......@@ -254,7 +254,7 @@ RUs = (
max_pdschReferenceSignalPower = -27;
max_rxgain = 114;
eNB_instances = [0];
sdr_addrs = "addr=192.168.30.2";
sdr_addrs = "type=x300";
}
);
......
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