Commit ffe2967d authored by Raymond Knopp's avatar Raymond Knopp

Split init and config USRP device. It seems to have solved the stop/restart...

Split init and config USRP device. It seems to have solved the stop/restart RAU without stopping the RRU
parent bc0ae0fc
...@@ -134,6 +134,9 @@ int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_param ...@@ -134,6 +134,9 @@ int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_param
return ret; return ret;
} }
int openair0_check_device_loaded(){
return dlopen(OAI_RF_LIBNAME, RTLD_NOLOAD);
}
int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cfg) { int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cfg) {
......
...@@ -283,6 +283,10 @@ struct openair0_device_t { ...@@ -283,6 +283,10 @@ struct openair0_device_t {
/* !brief ETH params set by application */ /* !brief ETH params set by application */
eth_params_t *eth_params; eth_params_t *eth_params;
/* !brief Indicates if device already initialized */
int is_init;
/*!brief Can be used by driver to hold internal structure*/ /*!brief Can be used by driver to hold internal structure*/
void *priv; void *priv;
...@@ -293,6 +297,13 @@ struct openair0_device_t { ...@@ -293,6 +297,13 @@ struct openair0_device_t {
*/ */
int (*trx_start_func)(openair0_device *device); int (*trx_start_func)(openair0_device *device);
/*! \brief Called to configure the device
@param device pointer to the device structure specific to the RF hardware target
*/
int (*trx_config_func)(openair0_device* device, openair0_config_t *openair0_cfg);
/*! \brief Called to send a request message between RAU-RRU on control port /*! \brief Called to send a request message between RAU-RRU on control port
@param device pointer to the device structure specific to the RF hardware target @param device pointer to the device structure specific to the RF hardware target
@param msg pointer to the message structure passed between RAU-RRU @param msg pointer to the message structure passed between RAU-RRU
......
...@@ -1563,7 +1563,8 @@ static void* ru_thread_control( void* param ) { ...@@ -1563,7 +1563,8 @@ static void* ru_thread_control( void* param ) {
// Start IF device if any // Start IF device if any
if (ru->start_if) { if (ru->start_if) {
LOG_I(PHY,"Starting IF interface for RU %d\n",ru->idx); LOG_I(PHY,"Starting IF interface for RU %d\n",ru->idx);
AssertFatal(ru->start_if(ru,NULL) == 0, "Could not start the IF device\n"); AssertFatal(
ru->start_if(ru,NULL) == 0, "Could not start the IF device\n");
if (ru->if_south != LOCAL_RF) wait_eNBs(); if (ru->if_south != LOCAL_RF) wait_eNBs();
} }
...@@ -1647,7 +1648,16 @@ static void* ru_thread_control( void* param ) { ...@@ -1647,7 +1648,16 @@ static void* ru_thread_control( void* param ) {
//if (ru->is_slave == 1) lte_sync_time_init(&ru->frame_parms); //if (ru->is_slave == 1) lte_sync_time_init(&ru->frame_parms);
ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg); if (ru->rfdevice.is_init != 1){
ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg);
}
AssertFatal((ru->rfdevice.trx_config_func(&ru->rfdevice,&ru->openair0_cfg)==0),
"Failed to configure RF device for RU %d\n",ru->idx);
if (setup_RU_buffers(ru)!=0) { if (setup_RU_buffers(ru)!=0) {
printf("Exiting, cannot initialize RU Buffers\n"); printf("Exiting, cannot initialize RU Buffers\n");
...@@ -1879,7 +1889,7 @@ static void* ru_thread( void* param ) { ...@@ -1879,7 +1889,7 @@ static void* ru_thread( void* param ) {
else if (ru->cmd == STOP_RU) { else if (ru->cmd == STOP_RU) {
ru->state = RU_IDLE; ru->state = RU_IDLE;
ru->cmd = EMPTY; ru->cmd = EMPTY;
LOG_I(PHY,"RU %d rf device stopped\n",ru->idx); LOG_I(PHY,"RU %d stopped\n",ru->idx);
break; break;
} }
old_time = time_rf.tv_nsec; old_time = time_rf.tv_nsec;
......
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