Commit 31cf3ac0 authored by Raymond Knopp's avatar Raymond Knopp

removal of warnings

parent c245e426
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "LAYER2/MAC/mac.h" #include "LAYER2/MAC/mac.h"
#include "RRC/LTE/rrc_extern.h" #include "RRC/LTE/rrc_extern.h"
#include "PHY_INTERFACE/phy_interface.h" #include "PHY_INTERFACE/phy_interface.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
// Note: this is for prototype of generate_drs_pusch (OTA synchronization of RRUs) // Note: this is for prototype of generate_drs_pusch (OTA synchronization of RRUs)
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h" #include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
...@@ -659,8 +660,7 @@ int ru_sync_time(RU_t *ru, ...@@ -659,8 +660,7 @@ int ru_sync_time(RU_t *ru,
(void*)&ru->common.rxdata[ar][0], (void*)&ru->common.rxdata[ar][0],
frame_parms->ofdm_symbol_size); frame_parms->ofdm_symbol_size);
int32_t tmp0; int32_t maxlev0=0;
int32_t magtmp0,maxlev0=0;
int maxpos0=0; int maxpos0=0;
int64_t avg0=0; int64_t avg0=0;
int64_t result; int64_t result;
......
...@@ -247,7 +247,7 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) { ...@@ -247,7 +247,7 @@ void send_IF4p5(RU_t *ru, int frame, int subframe, uint16_t packet_type) {
(void *)rxF, (void *)rxF,
PRACH_BLOCK_SIZE_BYTES); PRACH_BLOCK_SIZE_BYTES);
} }
if (frame == 0) LOG_D(PHY,"signal energy prach %d\n",dB_fixed(signal_energy(rxF,839))); if (frame == 0) LOG_D(PHY,"signal energy prach %d\n",dB_fixed(signal_energy((int*)rxF,839)));
} }
if (ru->idx<=1) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0+ru->idx, 1 ); if (ru->idx<=1) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0+ru->idx, 1 );
if ((ru->ifdevice.trx_write_func(&ru->ifdevice, if ((ru->ifdevice.trx_write_func(&ru->ifdevice,
...@@ -385,7 +385,7 @@ void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint ...@@ -385,7 +385,7 @@ void recv_IF4p5(RU_t *ru, int *frame, int *subframe, uint16_t *packet_type, uint
int16_t *rxF; int16_t *rxF;
for (int antenna_id=0;antenna_id<ru->nb_rx;antenna_id++) { for (int antenna_id=0;antenna_id<ru->nb_rx;antenna_id++) {
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
if (*packet_type > IF4p5_PRACH) if (*packet_type > IF4p5_PRACH)
rxF = &prach_rxsigF_br[*packet_type - IF4p5_PRACH - 1][antenna_id][0]; rxF = &prach_rxsigF_br[*packet_type - IF4p5_PRACH - 1][antenna_id][0];
else else
......
...@@ -93,7 +93,7 @@ int beam_precoding_one_eNB(int32_t **txdataF, ...@@ -93,7 +93,7 @@ int beam_precoding_one_eNB(int32_t **txdataF,
LTE_DL_FRAME_PARMS *frame_parms LTE_DL_FRAME_PARMS *frame_parms
) )
{ {
int p, re, symbol, aa; // loop index int p, symbol, aa; // loop index
int re_offset; int re_offset;
int ofdm_symbol_size = frame_parms->ofdm_symbol_size; int ofdm_symbol_size = frame_parms->ofdm_symbol_size;
int symbols_per_tti = frame_parms->symbols_per_tti; int symbols_per_tti = frame_parms->symbols_per_tti;
...@@ -101,44 +101,37 @@ int beam_precoding_one_eNB(int32_t **txdataF, ...@@ -101,44 +101,37 @@ int beam_precoding_one_eNB(int32_t **txdataF,
re_offset = ofdm_symbol_size*symbols_per_tti*subframe; re_offset = ofdm_symbol_size*symbols_per_tti*subframe;
// txdataF_BF[aa][re] = sum(beam_weghts[p][aa][re]*txdataF[p][re]), p=0~nb_antenna_ports-1 // txdataF_BF[aa][re] = sum(beam_weghts[p][aa][re]*txdataF[p][re]), p=0~nb_antenna_ports-1
// real part and image part need to compute separately // real part and image part need to compute separately
for (aa=0; aa<nb_tx; aa++) { for (aa=0; aa<nb_tx; aa++) {
memset(txdataF_BF[aa],0,sizeof(int32_t)*(ofdm_symbol_size*symbols_per_tti)); memset(txdataF_BF[aa],0,sizeof(int32_t)*(ofdm_symbol_size*symbols_per_tti));
for(p=0;p<nb_antenna_ports;p++){ for(p=0;p<nb_antenna_ports;p++){
if (p<nb_antenna_ports_eNB || p==5){ if (p<nb_antenna_ports_eNB || p==5){
for (symbol=0; symbol<symbols_per_tti; symbol++){ for (symbol=0; symbol<symbols_per_tti; symbol++){
multadd_cpx_vector((int16_t*)&txdataF[p][symbol*ofdm_symbol_size+re_offset],
(int16_t*)beam_weights[0][p][aa],
(int16_t*)&txdataF_BF[aa][symbol*ofdm_symbol_size],
0,
ofdm_symbol_size,
15);
/*
for (re=0; re<ofdm_symbol_size; re++){
// direct
((int16_t*)&txdataF_BF[aa][re])[0] += (int16_t)((((int16_t*)&txdataF[p][re+symbol*ofdm_symbol_size+re_offset])[0]*((int16_t*)&beam_weights[p][aa][re])[0])>>15);
((int16_t*)&txdataF_BF[aa][re])[0] -= (int16_t)((((int16_t*)&txdataF[p][re+symbol*ofdm_symbol_size+re_offset])[1]*((int16_t*)&beam_weights[p][aa][re])[1])>>15);
((int16_t*)&txdataF_BF[aa][re])[1] += (int16_t)((((int16_t*)&txdataF[p][re+symbol*ofdm_symbol_size+re_offset])[0]*((int16_t*)&beam_weights[p][aa][re])[1])>>15);
((int16_t*)&txdataF_BF[aa][re])[1] += (int16_t)((((int16_t*)&txdataF[p][re+symbol*ofdm_symbol_size+re_offset])[1]*((int16_t*)&beam_weights[p][aa][re])[0])>>15);
}
*/
}
}
}
}
multadd_cpx_vector((int16_t*)&txdataF[p][symbol*ofdm_symbol_size+re_offset],
(int16_t*)beam_weights[0][p][aa],
(int16_t*)&txdataF_BF[aa][symbol*ofdm_symbol_size],
0,
ofdm_symbol_size,
15);
/*
for (re=0; re<ofdm_symbol_size; re++){
// direct
((int16_t*)&txdataF_BF[aa][re])[0] += (int16_t)((((int16_t*)&txdataF[p][re+symbol*ofdm_symbol_size+re_offset])[0]*((int16_t*)&beam_weights[p][aa][re])[0])>>15);
((int16_t*)&txdataF_BF[aa][re])[0] -= (int16_t)((((int16_t*)&txdataF[p][re+symbol*ofdm_symbol_size+re_offset])[1]*((int16_t*)&beam_weights[p][aa][re])[1])>>15);
((int16_t*)&txdataF_BF[aa][re])[1] += (int16_t)((((int16_t*)&txdataF[p][re+symbol*ofdm_symbol_size+re_offset])[0]*((int16_t*)&beam_weights[p][aa][re])[1])>>15);
((int16_t*)&txdataF_BF[aa][re])[1] += (int16_t)((((int16_t*)&txdataF[p][re+symbol*ofdm_symbol_size+re_offset])[1]*((int16_t*)&beam_weights[p][aa][re])[0])>>15);
}
*/
}
}
}
}
return 0; return 0;
} }
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#include "PHY/LTE_TRANSPORT/if5_tools.h" #include "PHY/LTE_TRANSPORT/if5_tools.h"
#include "PHY/LTE_TRANSPORT/transport_common_proto.h" #include "PHY/LTE_TRANSPORT/transport_common_proto.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h" #include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
#include "PHY/LTE_ESTIMATION/lte_estimation.h" #include "PHY/LTE_ESTIMATION/lte_estimation.h"
#include "LAYER2/MAC/mac.h" #include "LAYER2/MAC/mac.h"
......
...@@ -476,7 +476,6 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t ...@@ -476,7 +476,6 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string,RU_t
} }
int wakeup_txfh(L1_rxtx_proc_t *proc,int frame_tx,int subframe_tx,uint64_t timestamp_tx,PHY_VARS_eNB *eNB) { int wakeup_txfh(L1_rxtx_proc_t *proc,int frame_tx,int subframe_tx,uint64_t timestamp_tx,PHY_VARS_eNB *eNB) {
RU_t *ru;
RU_proc_t *ru_proc; RU_proc_t *ru_proc;
LTE_DL_FRAME_PARMS *fp; LTE_DL_FRAME_PARMS *fp;
...@@ -587,7 +586,6 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) { ...@@ -587,7 +586,6 @@ int wakeup_rxtx(PHY_VARS_eNB *eNB,RU_t *ru) {
LOG_D(PHY,"ENTERED wakeup_rxtx, %d.%d\n",ru_proc->frame_rx,ru_proc->subframe_rx); LOG_D(PHY,"ENTERED wakeup_rxtx, %d.%d\n",ru_proc->frame_rx,ru_proc->subframe_rx);
int i;
struct timespec wait; struct timespec wait;
int sleep_cnt=0; int sleep_cnt=0;
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
* For more information about the OpenAirInterface (OAI) Software Alliance: * For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org * contact@openairinterface.org
*/ */
/*! \file lte-enb.c /*! \file lte-ru.c
* \brief Top-level threads for eNodeB * \brief Top-level threads for RU entity
* \author R. Knopp, F. Kaltenberger, Navid Nikaein * \author R. Knopp, F. Kaltenberger, Navid Nikaein
* \date 2018 * \date 2019
* \version 0.1 * \version 0.1
* \company Eurecom * \company Eurecom
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr, navid.nikaein@eurecom.fr * \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr, navid.nikaein@eurecom.fr
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
#include "PHY/LTE_TRANSPORT/transport_proto.h" #include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "SCHED/sched_eNB.h" #include "SCHED/sched_eNB.h"
#include "PHY/LTE_ESTIMATION/lte_estimation.h" #include "PHY/LTE_ESTIMATION/lte_estimation.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
#include "PHY/INIT/phy_init.h" #include "PHY/INIT/phy_init.h"
#include "LAYER2/MAC/mac.h" #include "LAYER2/MAC/mac.h"
...@@ -1011,14 +1012,12 @@ void do_ru_synch(RU_t *ru) { ...@@ -1011,14 +1012,12 @@ void do_ru_synch(RU_t *ru) {
int32_t dummy_rx[ru->nb_rx][fp->samples_per_tti] __attribute__((aligned(32))); int32_t dummy_rx[ru->nb_rx][fp->samples_per_tti] __attribute__((aligned(32)));
int rxs; int rxs;
int ic; int ic;
RRU_CONFIG_msg_t rru_config_msg;
// initialize the synchronization buffer to the common_vars.rxdata // initialize the synchronization buffer to the common_vars.rxdata
for (int i=0; i<ru->nb_rx; i++) for (int i=0; i<ru->nb_rx; i++)
rxp[i] = &ru->common.rxdata[i][0]; rxp[i] = &ru->common.rxdata[i][0];
double temp_freq1 = ru->rfdevice.openair0_cfg->rx_freq[0]; double temp_freq1 = ru->rfdevice.openair0_cfg->rx_freq[0];
double temp_freq2 = ru->rfdevice.openair0_cfg->tx_freq[0];
for (i=0; i<4; i++) { for (i=0; i<4; i++) {
ru->rfdevice.openair0_cfg->rx_freq[i] = ru->rfdevice.openair0_cfg->tx_freq[i]; ru->rfdevice.openair0_cfg->rx_freq[i] = ru->rfdevice.openair0_cfg->tx_freq[i];
...@@ -1086,7 +1085,6 @@ void wakeup_L1s(RU_t *ru) { ...@@ -1086,7 +1085,6 @@ void wakeup_L1s(RU_t *ru) {
PHY_VARS_eNB *eNB=eNB_list[0]; PHY_VARS_eNB *eNB=eNB_list[0];
L1_proc_t *proc = &eNB->proc; L1_proc_t *proc = &eNB->proc;
RU_proc_t *ruproc = &ru->proc;
struct timespec t; struct timespec t;
LOG_D(PHY,"wakeup_L1s (num %d) for RU %d ru->eNB_top:%p\n",ru->num_eNB,ru->idx, ru->eNB_top); LOG_D(PHY,"wakeup_L1s (num %d) for RU %d ru->eNB_top:%p\n",ru->num_eNB,ru->idx, ru->eNB_top);
...@@ -1530,7 +1528,6 @@ void *ru_thread_tx( void *param ) { ...@@ -1530,7 +1528,6 @@ void *ru_thread_tx( void *param ) {
} }
void *ru_thread( void *param ) { void *ru_thread( void *param ) {
static int ru_thread_status;
RU_t *ru = (RU_t *)param; RU_t *ru = (RU_t *)param;
RU_proc_t *proc = &ru->proc; RU_proc_t *proc = &ru->proc;
LTE_DL_FRAME_PARMS *fp = &ru->frame_parms; LTE_DL_FRAME_PARMS *fp = &ru->frame_parms;
...@@ -1551,17 +1548,17 @@ void *ru_thread( void *param ) { ...@@ -1551,17 +1548,17 @@ void *ru_thread( void *param ) {
pthread_setname_np( pthread_self(),"ru thread"); pthread_setname_np( pthread_self(),"ru thread");
LOG_I(PHY,"thread ru created id=%ld\n", syscall(__NR_gettid)); LOG_I(PHY,"thread ru created id=%ld\n", syscall(__NR_gettid));
LOG_I(PHY,"Starting RU %d (%s,%s),\n",ru->idx,eNB_functions[ru->function],eNB_timing[ru->if_timing]); LOG_I(PHY,"Starting RU %d (%s,%s),\n",ru->idx,eNB_functions[ru->function],eNB_timing[ru->if_timing]);
if(get_softmodem_params()->emulate_rf) { if(get_softmodem_params()->emulate_rf) {
fill_rf_config(ru,ru->rf_config_file); fill_rf_config(ru,ru->rf_config_file);
init_frame_parms(&ru->frame_parms,1); init_frame_parms(&ru->frame_parms,1);
phy_init_RU(ru); phy_init_RU(ru);
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");
exit(-1); exit(-1);
} }
LOG_I(PHY, "Signaling main thread that RU %d is ready\n",ru->idx); LOG_I(PHY, "Signaling main thread that RU %d is ready\n",ru->idx);
pthread_mutex_lock(&RC.ru_mutex); pthread_mutex_lock(&RC.ru_mutex);
RC.ru_mask &= ~(1<<ru->idx); RC.ru_mask &= ~(1<<ru->idx);
...@@ -1599,29 +1596,29 @@ void *ru_thread( void *param ) { ...@@ -1599,29 +1596,29 @@ void *ru_thread( void *param ) {
} }
pthread_mutex_lock(&proc->mutex_FH1); pthread_mutex_lock(&proc->mutex_FH1);
proc->instance_cnt_FH1 = 0; proc->instance_cnt_FH1 = 0;
pthread_mutex_unlock(&proc->mutex_FH1); pthread_mutex_unlock(&proc->mutex_FH1);
pthread_cond_signal(&proc->cond_FH1); pthread_cond_signal(&proc->cond_FH1);
while (!oai_exit) { while (!oai_exit) {
if (ru->if_south != LOCAL_RF && ru->is_slave==1) { if (ru->if_south != LOCAL_RF && ru->is_slave==1) {
ru->wait_cnt = 100; ru->wait_cnt = 100;
} }
else { else {
ru->wait_cnt = 0; ru->wait_cnt = 0;
ru->wait_check = 0; ru->wait_check = 0;
} }
// wait to be woken up // wait to be woken up
if (ru->function!=eNodeB_3GPP && ru->has_ctrl_prt == 1) { if (ru->function!=eNodeB_3GPP && ru->has_ctrl_prt == 1) {
if (wait_on_condition(&ru->proc.mutex_ru,&ru->proc.cond_ru_thread,&ru->proc.instance_cnt_ru,"ru_thread")<0) break; if (wait_on_condition(&ru->proc.mutex_ru,&ru->proc.cond_ru_thread,&ru->proc.instance_cnt_ru,"ru_thread")<0) break;
} }
else wait_sync("ru_thread"); else wait_sync("ru_thread");
if(!(get_softmodem_params()->emulate_rf)) { if(!(get_softmodem_params()->emulate_rf)) {
if (ru->is_slave == 0) AssertFatal(ru->state == RU_RUN,"ru-%d state = %s != RU_RUN\n",ru->idx,ru_states[ru->state]); if (ru->is_slave == 0) AssertFatal(ru->state == RU_RUN,"ru-%d state = %s != RU_RUN\n",ru->idx,ru_states[ru->state]);
else if (ru->is_slave == 1) AssertFatal(ru->state == RU_SYNC || ru->state == RU_RUN || ru->state == RU_CHECK_SYNC,"ru %d state = %s != RU_SYNC or RU_RUN or RU_CHECK_SYNC\n",ru->idx,ru_states[ru->state]); else if (ru->is_slave == 1) AssertFatal(ru->state == RU_SYNC || ru->state == RU_RUN || ru->state == RU_CHECK_SYNC,"ru %d state = %s != RU_SYNC or RU_RUN or RU_CHECK_SYNC\n",ru->idx,ru_states[ru->state]);
...@@ -1635,21 +1632,21 @@ void *ru_thread( void *param ) { ...@@ -1635,21 +1632,21 @@ void *ru_thread( void *param ) {
} }
// if an asnych_rxtx thread exists // if an asnych_rxtx thread exists
// wakeup the thread because the devices are ready at this point // wakeup the thread because the devices are ready at this point
if ((ru->fh_south_asynch_in)||(ru->fh_north_asynch_in)) { if ((ru->fh_south_asynch_in)||(ru->fh_north_asynch_in)) {
pthread_mutex_lock(&proc->mutex_asynch_rxtx); pthread_mutex_lock(&proc->mutex_asynch_rxtx);
proc->instance_cnt_asynch_rxtx=0; proc->instance_cnt_asynch_rxtx=0;
pthread_mutex_unlock(&proc->mutex_asynch_rxtx); pthread_mutex_unlock(&proc->mutex_asynch_rxtx);
pthread_cond_signal(&proc->cond_asynch_rxtx); pthread_cond_signal(&proc->cond_asynch_rxtx);
} else LOG_I(PHY,"RU %d no asynch_south interface\n",ru->idx); } else LOG_I(PHY,"RU %d no asynch_south interface\n",ru->idx);
// if this is a slave RRU, try to synchronize on the DL frequency // if this is a slave RRU, try to synchronize on the DL frequency
if ((ru->is_slave == 1) && (ru->if_south == LOCAL_RF)) do_ru_synch(ru); if ((ru->is_slave == 1) && (ru->if_south == LOCAL_RF)) do_ru_synch(ru);
LOG_D(PHY,"Starting steady-state operation\n"); LOG_D(PHY,"Starting steady-state operation\n");
// This is a forever while loop, it loops over subframes which are scheduled by incoming samples from HW devices // This is a forever while loop, it loops over subframes which are scheduled by incoming samples from HW devices
while (ru->state == RU_RUN || ru->state == RU_CHECK_SYNC) { while (ru->state == RU_RUN || ru->state == RU_CHECK_SYNC) {
// these are local subframe/frame counters to check that we are in synch with the fronthaul timing. // these are local subframe/frame counters to check that we are in synch with the fronthaul timing.
// They are set on the first rx/tx in the underly FH routines. // They are set on the first rx/tx in the underly FH routines.
if (subframe==9) { if (subframe==9) {
...@@ -1659,11 +1656,11 @@ void *ru_thread( void *param ) { ...@@ -1659,11 +1656,11 @@ void *ru_thread( void *param ) {
} else { } else {
subframe++; subframe++;
} }
// synchronization on input FH interface, acquire signals/data and block // synchronization on input FH interface, acquire signals/data and block
if (ru->fh_south_in) ru->fh_south_in(ru,&frame,&subframe); if (ru->fh_south_in) ru->fh_south_in(ru,&frame,&subframe);
else AssertFatal(1==0, "No fronthaul interface at south port"); else AssertFatal(1==0, "No fronthaul interface at south port");
#ifdef PHY_TX_THREAD #ifdef PHY_TX_THREAD
if(first_phy_tx == 0) if(first_phy_tx == 0)
{ {
...@@ -1704,14 +1701,14 @@ void *ru_thread( void *param ) { ...@@ -1704,14 +1701,14 @@ void *ru_thread( void *param ) {
break; break;
} }
if (oai_exit == 1) break; if (oai_exit == 1) break;
if (ru->wait_cnt > 0) { if (ru->wait_cnt > 0) {
ru->wait_cnt--; ru->wait_cnt--;
LOG_D(PHY,"RU thread %d, frame %d, subframe %d, wait_cnt %d \n",ru->idx, frame, subframe, ru->wait_cnt); LOG_D(PHY,"RU thread %d, frame %d, subframe %d, wait_cnt %d \n",ru->idx, frame, subframe, ru->wait_cnt);
if (ru->if_south!=LOCAL_RF && ru->wait_cnt <=20 && subframe == 5 && frame != RC.ru[0]->proc.frame_rx && resynch_done == 0) { if (ru->if_south!=LOCAL_RF && ru->wait_cnt <=20 && subframe == 5 && frame != RC.ru[0]->proc.frame_rx && resynch_done == 0) {
// Send RRU_frame adjust // Send RRU_frame adjust
RRU_CONFIG_msg_t rru_config_msg; RRU_CONFIG_msg_t rru_config_msg;
rru_config_msg.type = RRU_frame_resynch; rru_config_msg.type = RRU_frame_resynch;
rru_config_msg.len = sizeof(RRU_CONFIG_msg_t); // TODO: set to correct msg len rru_config_msg.len = sizeof(RRU_CONFIG_msg_t); // TODO: set to correct msg len
...@@ -1724,37 +1721,36 @@ void *ru_thread( void *param ) { ...@@ -1724,37 +1721,36 @@ void *ru_thread( void *param ) {
wakeup_L1s(ru); wakeup_L1s(ru);
} }
else { else {
LOG_D(PHY,"RU thread %d, frame %d, subframe %d \n", LOG_D(PHY,"RU thread %d, frame %d, subframe %d \n",
ru->idx,frame,subframe); ru->idx,frame,subframe);
if ((ru->do_prach>0) && (is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx)==1)) { if ((ru->do_prach>0) && (is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx)==1)) {
LOG_D(PHY,"Waking up prach for %d.%d\n",proc->frame_rx,proc->subframe_rx); LOG_D(PHY,"Waking up prach for %d.%d\n",proc->frame_rx,proc->subframe_rx);
wakeup_prach_ru(ru); wakeup_prach_ru(ru);
} }
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0)) #if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
else if ((ru->do_prach>0) && (is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx)>1)) { else if ((ru->do_prach>0) && (is_prach_subframe(fp, proc->frame_rx, proc->subframe_rx)>1))
wakeup_prach_ru_br(ru); wakeup_prach_ru_br(ru);
#endif #endif
// adjust for timing offset between RU // adjust for timing offset between RU
if (ru->idx!=0) proc->frame_tx = (proc->frame_tx+proc->frame_offset)&1023; if (ru->idx!=0) proc->frame_tx = (proc->frame_tx+proc->frame_offset)&1023;
// At this point, all information for subframe has been received on FH interface // At this point, all information for subframe has been received on FH interface
// If this proc is to provide synchronization, do so // If this proc is to provide synchronization, do so
wakeup_slaves(proc); wakeup_slaves(proc);
// do RX front-end processing (frequency-shift, dft) if needed // do RX front-end processing (frequency-shift, dft) if needed
if (ru->feprx) ru->feprx(ru); if (ru->feprx) ru->feprx(ru);
// wakeup all eNB processes waiting for this RU // wakeup all eNB processes waiting for this RU
pthread_mutex_lock(&proc->mutex_eNBs); pthread_mutex_lock(&proc->mutex_eNBs);
if (proc->instance_cnt_eNBs==0) proc->instance_cnt_eNBs--; if (proc->instance_cnt_eNBs==0) proc->instance_cnt_eNBs--;
pthread_mutex_unlock(&proc->mutex_eNBs); pthread_mutex_unlock(&proc->mutex_eNBs);
#if defined(PRE_SCD_THREAD) #if defined(PRE_SCD_THREAD)
new_dlsch_ue_select_tbl_in_use = dlsch_ue_select_tbl_in_use; new_dlsch_ue_select_tbl_in_use = dlsch_ue_select_tbl_in_use;
dlsch_ue_select_tbl_in_use = !dlsch_ue_select_tbl_in_use; dlsch_ue_select_tbl_in_use = !dlsch_ue_select_tbl_in_use;
...@@ -1782,28 +1778,28 @@ void *ru_thread( void *param ) { ...@@ -1782,28 +1778,28 @@ void *ru_thread( void *param ) {
exit_fun("error unlocking mutex_pre_scd"); exit_fun("error unlocking mutex_pre_scd");
} }
#endif #endif
// wakeup all eNB processes waiting for this RU // wakeup all eNB processes waiting for this RU
if (ru->num_eNB>0) wakeup_L1s(ru); if (ru->num_eNB>0) wakeup_L1s(ru);
#ifndef PHY_TX_THREAD #ifndef PHY_TX_THREAD
if(get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD || ru->num_eNB==0) { if(get_thread_parallel_conf() == PARALLEL_SINGLE_THREAD || ru->num_eNB==0) {
// do TX front-end processing if needed (precoding and/or IDFTs) // do TX front-end processing if needed (precoding and/or IDFTs)
if (ru->feptx_prec) ru->feptx_prec(ru); if (ru->feptx_prec) ru->feptx_prec(ru);
// do OFDM if needed // do OFDM if needed
if ((ru->fh_north_asynch_in == NULL) && (ru->feptx_ofdm)) ru->feptx_ofdm(ru); if ((ru->fh_north_asynch_in == NULL) && (ru->feptx_ofdm)) ru->feptx_ofdm(ru);
if(!(get_softmodem_params()->emulate_rf)) { if(!(get_softmodem_params()->emulate_rf)) {
// do outgoing fronthaul (south) if needed // do outgoing fronthaul (south) if needed
if ((ru->fh_north_asynch_in == NULL) && (ru->fh_south_out)) ru->fh_south_out(ru); if ((ru->fh_north_asynch_in == NULL) && (ru->fh_south_out)) ru->fh_south_out(ru);
if ((ru->fh_north_out) && (ru->state!=RU_CHECK_SYNC)) ru->fh_north_out(ru); if ((ru->fh_north_out) && (ru->state!=RU_CHECK_SYNC)) ru->fh_north_out(ru);
} }
proc->emulate_rf_busy = 0; proc->emulate_rf_busy = 0;
} }
#else #else
struct timespec time_req, time_rem; struct timespec time_req, time_rem;
time_req.tv_sec = 0; time_req.tv_sec = 0;
...@@ -1817,9 +1813,9 @@ void *ru_thread( void *param ) { ...@@ -1817,9 +1813,9 @@ void *ru_thread( void *param ) {
} // else wait_cnt == 0 } // else wait_cnt == 0
} // ru->state = RU_RUN } // ru->state = RU_RUN
} // while !oai_exit } // while !oai_exit
printf( "Exiting ru_thread \n"); printf( "Exiting ru_thread \n");
if (!(get_softmodem_params()->emulate_rf)) { if (!(get_softmodem_params()->emulate_rf)) {
if (ru->stop_rf != NULL) { if (ru->stop_rf != NULL) {
if (ru->stop_rf(ru) != 0) if (ru->stop_rf(ru) != 0)
...@@ -1827,7 +1823,7 @@ void *ru_thread( void *param ) { ...@@ -1827,7 +1823,7 @@ void *ru_thread( void *param ) {
else LOG_I(PHY,"RU %d rf device stopped\n",ru->idx); else LOG_I(PHY,"RU %d rf device stopped\n",ru->idx);
} }
} }
return NULL; return NULL;
} }
...@@ -2618,8 +2614,8 @@ void init_RU(char *rf_config_file, clock_source_t clock_source,clock_source_t ti ...@@ -2618,8 +2614,8 @@ void init_RU(char *rf_config_file, clock_source_t clock_source,clock_source_t ti
ru->openair0_cfg.time_source = time_source; ru->openair0_cfg.time_source = time_source;
// ru->generate_dmrs_sync = (ru->is_slave == 0) ? 1 : 0; // ru->generate_dmrs_sync = (ru->is_slave == 0) ? 1 : 0;
if (ru->generate_dmrs_sync == 1) { if (ru->generate_dmrs_sync == 1) {
generate_ul_ref_sigs(); generate_ul_ref_sigs();
ru->dmrssync = (int16_t*)malloc16_clear(ru->frame_parms.ofdm_symbol_size*2*sizeof(int16_t)); ru->dmrssync = (int16_t*)malloc16_clear(ru->frame_parms.ofdm_symbol_size*2*sizeof(int16_t));
} }
ru->wakeup_L1_sleeptime = 2000; ru->wakeup_L1_sleeptime = 2000;
ru->wakeup_L1_sleep_cnt_max = 3; ru->wakeup_L1_sleep_cnt_max = 3;
......
/******************************************************************************* /*
OpenAirInterface * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
Copyright(c) 1999 - 2014 Eurecom * contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
OpenAirInterface is free software: you can redistribute it and/or modify * The OpenAirInterface Software Alliance licenses this file to You under
it under the terms of the GNU General Public License as published by * the OAI Public License, Version 1.1 (the "License"); you may not use this file
the Free Software Foundation, either version 3 of the License, or * except in compliance with the License.
(at your option) any later version. * You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
OpenAirInterface is distributed in the hope that it will be useful, *
but WITHOUT ANY WARRANTY; without even the implied warranty of * Unless required by applicable law or agreed to in writing, software
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * distributed under the License is distributed on an "AS IS" BASIS,
GNU General Public License for more details. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
You should have received a copy of the GNU General Public License * limitations under the License.
along with OpenAirInterface.The full GNU General Public License is *-------------------------------------------------------------------------------
included in this distribution in the file called "COPYING". If not, * For more information about the OpenAirInterface (OAI) Software Alliance:
see <http://www.gnu.org/licenses/>. * contact@openairinterface.org
*/
Contact Information /*! \file ru_control.c
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
/*! \file lte-ru.c
* \brief Top-level threads for RU entity * \brief Top-level threads for RU entity
* \author R. Knopp, F. Kaltenberger, Navid Nikaein * \author R. Knopp, F. Kaltenberger, Navid Nikaein
* \date 2012 * \date 2018
* \version 0.1 * \version 0.1
* \company Eurecom * \company Eurecom
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr, navid.nikaein@eurecom.fr * \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr, navid.nikaein@eurecom.fr
...@@ -101,6 +92,10 @@ void fill_rf_config(RU_t *ru, char *rf_config_file); ...@@ -101,6 +92,10 @@ void fill_rf_config(RU_t *ru, char *rf_config_file);
void* ru_thread_control( void* param ); void* ru_thread_control( void* param );
extern void reset_proc(RU_t *ru);
extern int setup_RU_buffers(RU_t *ru);
extern void phy_init_RU(RU_t*); extern void phy_init_RU(RU_t*);
extern const char ru_states[6][9]; extern const char ru_states[6][9];
...@@ -494,7 +489,7 @@ void configure_rru(int idx, ...@@ -494,7 +489,7 @@ void configure_rru(int idx,
fill_rf_config(ru,ru->rf_config_file); fill_rf_config(ru,ru->rf_config_file);
// phy_init_RU(ru); // phy_init_RU(ru);
} }
...@@ -506,14 +501,13 @@ void* ru_thread_control( void* param ) { ...@@ -506,14 +501,13 @@ void* ru_thread_control( void* param ) {
RU_proc_t *proc = &ru->proc; RU_proc_t *proc = &ru->proc;
RRU_CONFIG_msg_t rru_config_msg; RRU_CONFIG_msg_t rru_config_msg;
ssize_t msg_len; ssize_t msg_len;
int len, ret; int len;
// 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( AssertFatal(
ru->start_if(ru,NULL) == 0, "Could not start the IF device\n"); 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();
} }
...@@ -597,17 +591,11 @@ void* ru_thread_control( void* param ) { ...@@ -597,17 +591,11 @@ 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);
if (ru->rfdevice.is_init != 1){ if (ru->rfdevice.is_init != 1) openair0_device_load(&ru->rfdevice,&ru->openair0_cfg);
ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg);
}
if (ru->rfdevice.trx_config_func) AssertFatal((ru->rfdevice.trx_config_func(&ru->rfdevice,&ru->openair0_cfg)==0), if (ru->rfdevice.trx_config_func) AssertFatal((ru->rfdevice.trx_config_func(&ru->rfdevice,&ru->openair0_cfg)==0),
"Failed to configure RF device for RU %d\n",ru->idx); "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");
exit(-1); exit(-1);
...@@ -714,10 +702,10 @@ void* ru_thread_control( void* param ) { ...@@ -714,10 +702,10 @@ void* ru_thread_control( void* param ) {
case RRU_frame_resynch: //RRU case RRU_frame_resynch: //RRU
if (ru->if_south != LOCAL_RF) LOG_E(PHY,"Received RRU frame resynch message, should not happen in RAU\n"); if (ru->if_south != LOCAL_RF) LOG_E(PHY,"Received RRU frame resynch message, should not happen in RAU\n");
else { else {
LOG_I(PHY,"Received RRU_frame_resynch command\n"); LOG_I(PHY,"Received RRU_frame_resynch command\n");
ru->cmd = RU_FRAME_RESYNCH; ru->cmd = RU_FRAME_RESYNCH;
ru->cmdval = ((uint16_t*)&rru_config_msg.msg[0])[0]; ru->cmdval = ((uint16_t*)&rru_config_msg.msg[0])[0];
LOG_I(PHY,"Received Frame Resynch message with value %d\n",ru->cmdval); LOG_I(PHY,"Received Frame Resynch message with value %d\n",ru->cmdval);
} }
break; break;
......
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