more warning removal
This commit is contained in:
@@ -359,7 +359,7 @@ struct openair0_device_t {
|
||||
* \param idx RU index
|
||||
* \param arg pointer to capabilities or configuration
|
||||
*/
|
||||
int (*configure_rru)(int idx, void* arg);
|
||||
void (*configure_rru)(int idx, void* arg);
|
||||
};
|
||||
|
||||
/* type of device init function, implemented in shared lib */
|
||||
|
||||
+26
-21
@@ -30,6 +30,8 @@
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include <pthread.h>
|
||||
|
||||
#include "time_utils.h"
|
||||
|
||||
@@ -241,8 +243,8 @@ static void* eNB_thread_rxtx( void* param ) {
|
||||
}
|
||||
|
||||
|
||||
#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
|
||||
/* Wait for eNB application initialization to be complete (eNB registration to MME) */
|
||||
#if 0 //defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
|
||||
// Wait for eNB application initialization to be complete (eNB registration to MME)
|
||||
static void wait_system_ready (char *message, volatile int *start_flag) {
|
||||
|
||||
static char *indicator[] = {". ", ".. ", "... ", ".... ", ".....",
|
||||
@@ -280,7 +282,7 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string) {
|
||||
|
||||
|
||||
LOG_D(PHY,"eNB_top in %p (proc %p, CC_id %d), frame %d, subframe %d, instance_cnt_prach %d\n",
|
||||
pthread_self(), proc, eNB->CC_id, proc->frame_rx,proc->subframe_rx,proc->instance_cnt_prach);
|
||||
(void*)pthread_self(), proc, eNB->CC_id, proc->frame_rx,proc->subframe_rx,proc->instance_cnt_prach);
|
||||
|
||||
|
||||
|
||||
@@ -295,7 +297,7 @@ void eNB_top(PHY_VARS_eNB *eNB, int frame_rx, int subframe_rx, char *string) {
|
||||
|
||||
if (rxtx(eNB,proc_rxtx,string) < 0) LOG_E(PHY,"eNB %d CC_id %d failed during execution\n",eNB->Mod_id,eNB->CC_id);
|
||||
LOG_D(PHY,"eNB_top out %p (proc %p, CC_id %d), frame %d, subframe %d, instance_cnt_prach %d\n",
|
||||
pthread_self(), proc, eNB->CC_id, proc->frame_rx,proc->subframe_rx,proc->instance_cnt_prach);
|
||||
(void*)pthread_self(), proc, eNB->CC_id, proc->frame_rx,proc->subframe_rx,proc->instance_cnt_prach);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -399,7 +401,7 @@ void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) {
|
||||
}
|
||||
if (proc->RU_mask_prach != (1<<eNB->num_RU)-1) { // not all RUs have provided their information so return
|
||||
pthread_mutex_unlock(&proc->mutex_RU_PRACH);
|
||||
return(0);
|
||||
return;
|
||||
}
|
||||
else { // all RUs have provided their information so continue on and wakeup eNB processing
|
||||
proc->RU_mask_prach = 0;
|
||||
@@ -459,7 +461,7 @@ void wakeup_prach_eNB_br(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe) {
|
||||
}
|
||||
if (proc->RU_mask_prach_br != (1<<eNB->num_RU)-1) { // not all RUs have provided their information so return
|
||||
pthread_mutex_unlock(&proc->mutex_RU_PRACH_br);
|
||||
return(0);
|
||||
return;
|
||||
}
|
||||
else { // all RUs have provided their information so continue on and wakeup eNB processing
|
||||
proc->RU_mask_prach_br = 0;
|
||||
@@ -591,7 +593,8 @@ void init_eNB_proc(int inst) {
|
||||
PHY_VARS_eNB *eNB;
|
||||
eNB_proc_t *proc;
|
||||
eNB_rxtx_proc_t *proc_rxtx;
|
||||
pthread_attr_t *attr0=NULL,*attr1=NULL,*attr_FH=NULL,*attr_prach=NULL,*attr_asynch=NULL,*attr_single=NULL,*attr_fep=NULL,*attr_td=NULL,*attr_te=NULL,*attr_synch=NULL;
|
||||
pthread_attr_t *attr0=NULL,*attr1=NULL,*attr_prach=NULL;
|
||||
//*attr_td=NULL,*attr_te=NULL;
|
||||
#ifdef Rel14
|
||||
pthread_attr_t *attr_prach_br=NULL;
|
||||
#endif
|
||||
@@ -631,9 +634,8 @@ void init_eNB_proc(int inst) {
|
||||
|
||||
pthread_attr_init( &proc->attr_prach);
|
||||
pthread_attr_init( &proc->attr_asynch_rxtx);
|
||||
pthread_attr_init( &proc->attr_single);
|
||||
pthread_attr_init( &proc->attr_td);
|
||||
pthread_attr_init( &proc->attr_te);
|
||||
// pthread_attr_init( &proc->attr_td);
|
||||
// pthread_attr_init( &proc->attr_te);
|
||||
pthread_attr_init( &proc_rxtx[0].attr_rxtx);
|
||||
pthread_attr_init( &proc_rxtx[1].attr_rxtx);
|
||||
#ifdef Rel14
|
||||
@@ -652,10 +654,8 @@ void init_eNB_proc(int inst) {
|
||||
attr_prach_br = &proc->attr_prach_br;
|
||||
#endif
|
||||
|
||||
attr_asynch = &proc->attr_asynch_rxtx;
|
||||
attr_single = &proc->attr_single;
|
||||
attr_td = &proc->attr_td;
|
||||
attr_te = &proc->attr_te;
|
||||
// attr_td = &proc->attr_td;
|
||||
// attr_te = &proc->attr_te;
|
||||
#endif
|
||||
|
||||
if (eNB->single_thread_flag==0) {
|
||||
@@ -749,9 +749,9 @@ void kill_eNB_proc(int inst) {
|
||||
int i;
|
||||
if (eNB->single_thread_flag==0) {
|
||||
for (i=0;i<2;i++) {
|
||||
LOG_I(PHY, "Joining rxtx[%d] mutex/cond\n");
|
||||
LOG_I(PHY, "Joining rxtx[%d] mutex/cond\n",i);
|
||||
pthread_join( proc_rxtx[i].pthread_rxtx, (void**)&status );
|
||||
LOG_I(PHY, "Destroying rxtx[%d] mutex/cond\n");
|
||||
LOG_I(PHY, "Destroying rxtx[%d] mutex/cond\n",i);
|
||||
pthread_mutex_destroy( &proc_rxtx[i].mutex_rxtx );
|
||||
pthread_cond_destroy( &proc_rxtx[i].cond_rxtx );
|
||||
}
|
||||
@@ -849,7 +849,8 @@ void init_transport(PHY_VARS_eNB *eNB) {
|
||||
fp->pucch_config_common.deltaPUCCH_Shift = 1;
|
||||
|
||||
}
|
||||
void init_eNB_afterRU() {
|
||||
|
||||
void init_eNB_afterRU(void) {
|
||||
|
||||
int inst,CC_id,ru_id,i,aa;
|
||||
PHY_VARS_eNB *eNB;
|
||||
@@ -863,10 +864,10 @@ void init_eNB_afterRU() {
|
||||
AssertFatal(eNB->num_RU>0,"Number of RU attached to eNB %d is zero\n",eNB->Mod_id);
|
||||
LOG_I(PHY,"Mapping RX ports from %d RUs to eNB %d\n",eNB->num_RU,eNB->Mod_id);
|
||||
eNB->frame_parms.nb_antennas_rx = 0;
|
||||
eNB->prach_vars.rxsigF[0] = (int16_t*)malloc16(64*sizeof(int16_t*));
|
||||
eNB->prach_vars.rxsigF[0] = (int16_t**)malloc16(64*sizeof(int16_t*));
|
||||
#ifdef Rel14
|
||||
for (int ce_level=0;ce_level<4;ce_level++)
|
||||
eNB->prach_vars_br.rxsigF[ce_level] = (int16_t*)malloc16(64*sizeof(int16_t*));
|
||||
eNB->prach_vars_br.rxsigF[ce_level] = (int16_t**)malloc16(64*sizeof(int16_t*));
|
||||
#endif
|
||||
for (ru_id=0,aa=0;ru_id<eNB->num_RU;ru_id++) {
|
||||
eNB->frame_parms.nb_antennas_rx += eNB->RU_list[ru_id]->nb_rx;
|
||||
@@ -881,7 +882,11 @@ void init_eNB_afterRU() {
|
||||
|
||||
for (i=0;i<eNB->RU_list[ru_id]->nb_rx;aa++,i++) {
|
||||
LOG_I(PHY,"Attaching RU %d antenna %d to eNB antenna %d\n",eNB->RU_list[ru_id]->idx,i,aa);
|
||||
eNB->prach_vars.rxsigF[aa] = eNB->RU_list[ru_id]->prach_rxsigF[i];
|
||||
eNB->prach_vars.rxsigF[0][aa] = eNB->RU_list[ru_id]->prach_rxsigF[i];
|
||||
#ifdef Rel14
|
||||
for (int ce_level=0;ce_level<4;ce_level++)
|
||||
eNB->prach_vars_br.rxsigF[ce_level][aa] = eNB->RU_list[ru_id]->prach_rxsigF_br[ce_level][i];
|
||||
#endif
|
||||
eNB->common_vars.rxdataF[aa] = eNB->RU_list[ru_id]->common.rxdataF[i];
|
||||
}
|
||||
}
|
||||
@@ -890,7 +895,7 @@ void init_eNB_afterRU() {
|
||||
LOG_I(PHY,"inst %d, CC_id %d : nb_antennas_rx %d\n",inst,CC_id,eNB->frame_parms.nb_antennas_rx);
|
||||
|
||||
init_transport(eNB);
|
||||
init_precoding_weights(RC.eNB[inst][CC_id]);
|
||||
//init_precoding_weights(RC.eNB[inst][CC_id]);
|
||||
}
|
||||
init_eNB_proc(inst);
|
||||
}
|
||||
|
||||
+177
-172
@@ -115,7 +115,7 @@ extern volatile int oai_exit;
|
||||
|
||||
extern void phy_init_RU(RU_t*);
|
||||
|
||||
void init_RU(const char*);
|
||||
void init_RU(char*);
|
||||
void stop_RU(RU_t *ru);
|
||||
void do_ru_sync(RU_t *ru);
|
||||
|
||||
@@ -133,7 +133,7 @@ int connect_rau(RU_t *ru);
|
||||
/*************************************************************/
|
||||
/* Functions to attach and configure RRU */
|
||||
|
||||
extern void wait_eNBs();
|
||||
extern void wait_eNBs(void);
|
||||
|
||||
int attach_rru(RU_t *ru) {
|
||||
|
||||
@@ -141,7 +141,7 @@ int attach_rru(RU_t *ru) {
|
||||
RRU_CONFIG_msg_t rru_config_msg;
|
||||
int received_capabilities=0;
|
||||
|
||||
wait_eNBs(ru);
|
||||
wait_eNBs();
|
||||
// Wait for capabilities
|
||||
while (received_capabilities==0) {
|
||||
|
||||
@@ -480,7 +480,7 @@ void fh_if4p5_south_asynch_in(RU_t *ru,int *frame,int *subframe) {
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
|
||||
uint16_t packet_type;
|
||||
uint32_t symbol_number,symbol_mask,symbol_mask_full,prach_rx;
|
||||
uint32_t symbol_number,symbol_mask,prach_rx;
|
||||
uint32_t got_prach_info=0;
|
||||
|
||||
symbol_number = 0;
|
||||
@@ -814,7 +814,7 @@ void tx_rf(RU_t *ru) {
|
||||
flags);
|
||||
|
||||
LOG_D(PHY,"[TXPATH] RU %d tx_rf, writing to TS %llu, frame %d, unwrapped_frame %d, subframe %d\n",ru->idx,
|
||||
proc->timestamp_tx,proc->frame_tx,proc->frame_tx_unwrap,proc->subframe_tx,proc);
|
||||
(long long unsigned int)proc->timestamp_tx,proc->frame_tx,proc->frame_tx_unwrap,proc->subframe_tx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 );
|
||||
|
||||
|
||||
@@ -1120,7 +1120,7 @@ void wakeup_eNBs(RU_t *ru) {
|
||||
else {
|
||||
|
||||
for (i=0;i<ru->num_eNB;i++)
|
||||
if (ru->wakeup_rxtx(eNB_list[i],ru->proc.frame_rx,ru->proc.subframe_rx) < 0)
|
||||
if (ru->wakeup_rxtx(eNB_list[i],ru) < 0)
|
||||
LOG_E(PHY,"could not wakeup eNB rxtx process for subframe %d\n", ru->proc.subframe_rx);
|
||||
}
|
||||
}
|
||||
@@ -1181,6 +1181,143 @@ static inline int wakeup_prach_ru_br(RU_t *ru) {
|
||||
}
|
||||
#endif
|
||||
|
||||
// this is for RU with local RF unit
|
||||
void fill_rf_config(RU_t *ru, char *rf_config_file) {
|
||||
|
||||
int i;
|
||||
|
||||
LTE_DL_FRAME_PARMS *fp = &ru->frame_parms;
|
||||
openair0_config_t *cfg = &ru->openair0_cfg;
|
||||
|
||||
if(fp->N_RB_DL == 100) {
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=23.04e6;
|
||||
cfg->samples_per_frame = 230400;
|
||||
cfg->tx_bw = 10e6;
|
||||
cfg->rx_bw = 10e6;
|
||||
}
|
||||
else {
|
||||
cfg->sample_rate=30.72e6;
|
||||
cfg->samples_per_frame = 307200;
|
||||
cfg->tx_bw = 10e6;
|
||||
cfg->rx_bw = 10e6;
|
||||
}
|
||||
} else if(fp->N_RB_DL == 50) {
|
||||
cfg->sample_rate=15.36e6;
|
||||
cfg->samples_per_frame = 153600;
|
||||
cfg->tx_bw = 5e6;
|
||||
cfg->rx_bw = 5e6;
|
||||
} else if (fp->N_RB_DL == 25) {
|
||||
cfg->sample_rate=7.68e6;
|
||||
cfg->samples_per_frame = 76800;
|
||||
cfg->tx_bw = 2.5e6;
|
||||
cfg->rx_bw = 2.5e6;
|
||||
} else if (fp->N_RB_DL == 6) {
|
||||
cfg->sample_rate=1.92e6;
|
||||
cfg->samples_per_frame = 19200;
|
||||
cfg->tx_bw = 1.5e6;
|
||||
cfg->rx_bw = 1.5e6;
|
||||
}
|
||||
else AssertFatal(1==0,"Unknown N_RB_DL %d\n",fp->N_RB_DL);
|
||||
|
||||
if (fp->frame_type==TDD)
|
||||
cfg->duplex_mode = duplex_mode_TDD;
|
||||
else //FDD
|
||||
cfg->duplex_mode = duplex_mode_FDD;
|
||||
|
||||
cfg->Mod_id = 0;
|
||||
cfg->num_rb_dl=fp->N_RB_DL;
|
||||
cfg->tx_num_channels=ru->nb_tx;
|
||||
cfg->rx_num_channels=ru->nb_rx;
|
||||
|
||||
for (i=0; i<ru->nb_tx; i++) {
|
||||
|
||||
cfg->tx_freq[i] = (double)fp->dl_CarrierFreq;
|
||||
cfg->rx_freq[i] = (double)fp->ul_CarrierFreq;
|
||||
|
||||
cfg->tx_gain[i] = (double)fp->att_tx;
|
||||
cfg->rx_gain[i] = ru->max_rxgain-(double)fp->att_rx;
|
||||
|
||||
cfg->configFilename = rf_config_file;
|
||||
printf("channel %d, Setting tx_gain offset %f, rx_gain offset %f, tx_freq %f, rx_freq %f\n",
|
||||
i, cfg->tx_gain[i],
|
||||
cfg->rx_gain[i],
|
||||
cfg->tx_freq[i],
|
||||
cfg->rx_freq[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/* this function maps the RU tx and rx buffers to the available rf chains.
|
||||
Each rf chain is is addressed by the card number and the chain on the card. The
|
||||
rf_map specifies for each antenna port, on which rf chain the mapping should start. Multiple
|
||||
antennas are mapped to successive RF chains on the same card. */
|
||||
int setup_RU_buffers(RU_t *ru) {
|
||||
|
||||
int i,j;
|
||||
int card,ant;
|
||||
|
||||
//uint16_t N_TA_offset = 0;
|
||||
|
||||
LTE_DL_FRAME_PARMS *frame_parms;
|
||||
|
||||
if (ru) {
|
||||
frame_parms = &ru->frame_parms;
|
||||
printf("setup_RU_buffers: frame_parms = %p\n",frame_parms);
|
||||
} else {
|
||||
printf("RU[%d] not initialized\n", ru->idx);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
if (frame_parms->frame_type == TDD) {
|
||||
if (frame_parms->N_RB_DL == 100)
|
||||
N_TA_offset = 624;
|
||||
else if (frame_parms->N_RB_DL == 50)
|
||||
N_TA_offset = 624/2;
|
||||
else if (frame_parms->N_RB_DL == 25)
|
||||
N_TA_offset = 624/4;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
if (ru->openair0_cfg.mmapped_dma == 1) {
|
||||
// replace RX signal buffers with mmaped HW versions
|
||||
|
||||
for (i=0; i<ru->nb_rx; i++) {
|
||||
card = i/4;
|
||||
ant = i%4;
|
||||
printf("Mapping RU id %d, rx_ant %d, on card %d, chain %d\n",ru->idx,i,ru->rf_map.card+card, ru->rf_map.chain+ant);
|
||||
free(ru->common.rxdata[i]);
|
||||
ru->common.rxdata[i] = ru->openair0_cfg.rxbase[ru->rf_map.chain+ant];
|
||||
|
||||
printf("rxdata[%d] @ %p\n",i,ru->common.rxdata[i]);
|
||||
for (j=0; j<16; j++) {
|
||||
printf("rxbuffer %d: %x\n",j,ru->common.rxdata[i][j]);
|
||||
ru->common.rxdata[i][j] = 16-j;
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0; i<ru->nb_tx; i++) {
|
||||
card = i/4;
|
||||
ant = i%4;
|
||||
printf("Mapping RU id %d, tx_ant %d, on card %d, chain %d\n",ru->idx,i,ru->rf_map.card+card, ru->rf_map.chain+ant);
|
||||
free(ru->common.txdata[i]);
|
||||
ru->common.txdata[i] = ru->openair0_cfg.txbase[ru->rf_map.chain+ant];
|
||||
|
||||
printf("txdata[%d] @ %p\n",i,ru->common.txdata[i]);
|
||||
|
||||
for (j=0; j<16; j++) {
|
||||
printf("txbuffer %d: %x\n",j,ru->common.txdata[i][j]);
|
||||
ru->common.txdata[i][j] = 16-j;
|
||||
}
|
||||
}
|
||||
}
|
||||
else { // not memory-mapped DMA
|
||||
//nothing to do, everything already allocated in lte_init
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
static void* ru_thread( void* param ) {
|
||||
|
||||
static int ru_thread_status;
|
||||
@@ -1511,143 +1648,9 @@ void init_RU_proc(RU_t *ru) {
|
||||
|
||||
}
|
||||
|
||||
/* this function maps the RU tx and rx buffers to the available rf chains.
|
||||
Each rf chain is is addressed by the card number and the chain on the card. The
|
||||
rf_map specifies for each antenna port, on which rf chain the mapping should start. Multiple
|
||||
antennas are mapped to successive RF chains on the same card. */
|
||||
int setup_RU_buffers(RU_t *ru) {
|
||||
|
||||
int i,j;
|
||||
int card,ant;
|
||||
|
||||
//uint16_t N_TA_offset = 0;
|
||||
|
||||
LTE_DL_FRAME_PARMS *frame_parms;
|
||||
|
||||
if (ru) {
|
||||
frame_parms = &ru->frame_parms;
|
||||
printf("setup_RU_buffers: frame_parms = %p\n",frame_parms);
|
||||
} else {
|
||||
printf("RU[%d] not initialized\n", ru->idx);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/*
|
||||
if (frame_parms->frame_type == TDD) {
|
||||
if (frame_parms->N_RB_DL == 100)
|
||||
N_TA_offset = 624;
|
||||
else if (frame_parms->N_RB_DL == 50)
|
||||
N_TA_offset = 624/2;
|
||||
else if (frame_parms->N_RB_DL == 25)
|
||||
N_TA_offset = 624/4;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
if (ru->openair0_cfg.mmapped_dma == 1) {
|
||||
// replace RX signal buffers with mmaped HW versions
|
||||
|
||||
for (i=0; i<ru->nb_rx; i++) {
|
||||
card = i/4;
|
||||
ant = i%4;
|
||||
printf("Mapping RU id %d, rx_ant %d, on card %d, chain %d\n",ru->idx,i,ru->rf_map.card+card, ru->rf_map.chain+ant);
|
||||
free(ru->common.rxdata[i]);
|
||||
ru->common.rxdata[i] = ru->openair0_cfg.rxbase[ru->rf_map.chain+ant];
|
||||
|
||||
printf("rxdata[%d] @ %p\n",i,ru->common.rxdata[i]);
|
||||
for (j=0; j<16; j++) {
|
||||
printf("rxbuffer %d: %x\n",j,ru->common.rxdata[i][j]);
|
||||
ru->common.rxdata[i][j] = 16-j;
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0; i<ru->nb_tx; i++) {
|
||||
card = i/4;
|
||||
ant = i%4;
|
||||
printf("Mapping RU id %d, tx_ant %d, on card %d, chain %d\n",ru->idx,i,ru->rf_map.card+card, ru->rf_map.chain+ant);
|
||||
free(ru->common.txdata[i]);
|
||||
ru->common.txdata[i] = ru->openair0_cfg.txbase[ru->rf_map.chain+ant];
|
||||
|
||||
printf("txdata[%d] @ %p\n",i,ru->common.txdata[i]);
|
||||
|
||||
for (j=0; j<16; j++) {
|
||||
printf("txbuffer %d: %x\n",j,ru->common.txdata[i][j]);
|
||||
ru->common.txdata[i][j] = 16-j;
|
||||
}
|
||||
}
|
||||
}
|
||||
else { // not memory-mapped DMA
|
||||
//nothing to do, everything already allocated in lte_init
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
// this is for RU with local RF unit
|
||||
void fill_rf_config(RU_t *ru,const char *rf_config_file) {
|
||||
|
||||
int i;
|
||||
|
||||
LTE_DL_FRAME_PARMS *fp = &ru->frame_parms;
|
||||
openair0_config_t *cfg = &ru->openair0_cfg;
|
||||
|
||||
if(fp->N_RB_DL == 100) {
|
||||
if (fp->threequarter_fs) {
|
||||
cfg->sample_rate=23.04e6;
|
||||
cfg->samples_per_frame = 230400;
|
||||
cfg->tx_bw = 10e6;
|
||||
cfg->rx_bw = 10e6;
|
||||
}
|
||||
else {
|
||||
cfg->sample_rate=30.72e6;
|
||||
cfg->samples_per_frame = 307200;
|
||||
cfg->tx_bw = 10e6;
|
||||
cfg->rx_bw = 10e6;
|
||||
}
|
||||
} else if(fp->N_RB_DL == 50) {
|
||||
cfg->sample_rate=15.36e6;
|
||||
cfg->samples_per_frame = 153600;
|
||||
cfg->tx_bw = 5e6;
|
||||
cfg->rx_bw = 5e6;
|
||||
} else if (fp->N_RB_DL == 25) {
|
||||
cfg->sample_rate=7.68e6;
|
||||
cfg->samples_per_frame = 76800;
|
||||
cfg->tx_bw = 2.5e6;
|
||||
cfg->rx_bw = 2.5e6;
|
||||
} else if (fp->N_RB_DL == 6) {
|
||||
cfg->sample_rate=1.92e6;
|
||||
cfg->samples_per_frame = 19200;
|
||||
cfg->tx_bw = 1.5e6;
|
||||
cfg->rx_bw = 1.5e6;
|
||||
}
|
||||
else AssertFatal(1==0,"Unknown N_RB_DL %d\n",fp->N_RB_DL);
|
||||
|
||||
if (fp->frame_type==TDD)
|
||||
cfg->duplex_mode = duplex_mode_TDD;
|
||||
else //FDD
|
||||
cfg->duplex_mode = duplex_mode_FDD;
|
||||
|
||||
cfg->Mod_id = 0;
|
||||
cfg->num_rb_dl=fp->N_RB_DL;
|
||||
cfg->tx_num_channels=ru->nb_tx;
|
||||
cfg->rx_num_channels=ru->nb_rx;
|
||||
|
||||
for (i=0; i<ru->nb_tx; i++) {
|
||||
|
||||
cfg->tx_freq[i] = (double)fp->dl_CarrierFreq;
|
||||
cfg->rx_freq[i] = (double)fp->ul_CarrierFreq;
|
||||
|
||||
cfg->tx_gain[i] = (double)fp->att_tx;
|
||||
cfg->rx_gain[i] = ru->max_rxgain-(double)fp->att_rx;
|
||||
|
||||
cfg->configFilename = rf_config_file;
|
||||
printf("channel %d, Setting tx_gain offset %f, rx_gain offset %f, tx_freq %f, rx_freq %f\n",
|
||||
i, cfg->tx_gain[i],
|
||||
cfg->rx_gain[i],
|
||||
cfg->tx_freq[i],
|
||||
cfg->rx_freq[i]);
|
||||
}
|
||||
}
|
||||
|
||||
int check_capabilities(RU_t *ru,RRU_capabilities_t *cap) {
|
||||
|
||||
@@ -1689,6 +1692,7 @@ int check_capabilities(RU_t *ru,RRU_capabilities_t *cap) {
|
||||
return(-1);
|
||||
}
|
||||
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
@@ -1710,41 +1714,40 @@ void configure_ru(int idx,
|
||||
|
||||
|
||||
if (capabilities->FH_fmt < MAX_FH_FMTs) LOG_I(PHY, "RU FH options %s\n",rru_format_options[capabilities->FH_fmt]);
|
||||
if ((ret=check_capabilities(ru,capabilities)) == 0) {
|
||||
// Pass configuration to RRU
|
||||
LOG_I(PHY, "Using %s fronthaul (%d), band %d \n",ru_if_formats[ru->if_south],ru->if_south,ru->frame_parms.eutra_band);
|
||||
// wait for configuration
|
||||
config->FH_fmt = ru->if_south;
|
||||
config->num_bands = 1;
|
||||
config->band_list[0] = ru->frame_parms.eutra_band;
|
||||
config->tx_freq[0] = ru->frame_parms.dl_CarrierFreq;
|
||||
config->rx_freq[0] = ru->frame_parms.ul_CarrierFreq;
|
||||
config->att_tx[0] = ru->att_tx;
|
||||
config->att_rx[0] = ru->att_rx;
|
||||
config->N_RB_DL[0] = ru->frame_parms.N_RB_DL;
|
||||
config->N_RB_UL[0] = ru->frame_parms.N_RB_UL;
|
||||
config->threequarter_fs[0] = ru->frame_parms.threequarter_fs;
|
||||
if (ru->if_south==REMOTE_IF4p5) {
|
||||
config->prach_FreqOffset[0] = ru->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset;
|
||||
config->prach_ConfigIndex[0] = ru->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
|
||||
LOG_I(PHY,"REMOTE_IF4p5: prach_FrequOffset %d, prach_ConfigIndex %d\n",
|
||||
config->prach_FreqOffset[0],config->prach_ConfigIndex[0]);
|
||||
|
||||
AssertFatal((ret=check_capabilities(ru,capabilities)) == 0,
|
||||
"Cannot configure RRU %d, check_capabilities returned %d\n", idx,ret);
|
||||
// Pass configuration to RRU
|
||||
LOG_I(PHY, "Using %s fronthaul (%d), band %d \n",ru_if_formats[ru->if_south],ru->if_south,ru->frame_parms.eutra_band);
|
||||
// wait for configuration
|
||||
config->FH_fmt = ru->if_south;
|
||||
config->num_bands = 1;
|
||||
config->band_list[0] = ru->frame_parms.eutra_band;
|
||||
config->tx_freq[0] = ru->frame_parms.dl_CarrierFreq;
|
||||
config->rx_freq[0] = ru->frame_parms.ul_CarrierFreq;
|
||||
config->att_tx[0] = ru->att_tx;
|
||||
config->att_rx[0] = ru->att_rx;
|
||||
config->N_RB_DL[0] = ru->frame_parms.N_RB_DL;
|
||||
config->N_RB_UL[0] = ru->frame_parms.N_RB_UL;
|
||||
config->threequarter_fs[0] = ru->frame_parms.threequarter_fs;
|
||||
if (ru->if_south==REMOTE_IF4p5) {
|
||||
config->prach_FreqOffset[0] = ru->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset;
|
||||
config->prach_ConfigIndex[0] = ru->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
|
||||
LOG_I(PHY,"REMOTE_IF4p5: prach_FrequOffset %d, prach_ConfigIndex %d\n",
|
||||
config->prach_FreqOffset[0],config->prach_ConfigIndex[0]);
|
||||
|
||||
#ifdef Rel14
|
||||
for (i=0;i<4;i++) {
|
||||
config->emtc_prach_CElevel_enable[0][i] = ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[i];
|
||||
config->emtc_prach_FreqOffset[0][i] = ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[i];
|
||||
config->emtc_prach_ConfigIndex[0][i] = ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[i];
|
||||
}
|
||||
#endif
|
||||
for (i=0;i<4;i++) {
|
||||
config->emtc_prach_CElevel_enable[0][i] = ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[i];
|
||||
config->emtc_prach_FreqOffset[0][i] = ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[i];
|
||||
config->emtc_prach_ConfigIndex[0][i] = ru->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[i];
|
||||
}
|
||||
// take antenna capabilities of RRU
|
||||
ru->nb_tx = capabilities->nb_tx[0];
|
||||
ru->nb_rx = capabilities->nb_rx[0];
|
||||
}
|
||||
else {
|
||||
LOG_I(PHY,"Cannot configure RRU %d, check_capabilities returned %d\n", idx,ret);
|
||||
#endif
|
||||
}
|
||||
// take antenna capabilities of RRU
|
||||
ru->nb_tx = capabilities->nb_tx[0];
|
||||
ru->nb_rx = capabilities->nb_rx[0];
|
||||
|
||||
|
||||
init_frame_parms(&ru->frame_parms,1);
|
||||
phy_init_RU(ru);
|
||||
@@ -1816,7 +1819,9 @@ void init_precoding_weights(PHY_VARS_eNB *eNB) {
|
||||
}
|
||||
}
|
||||
|
||||
void init_RU(const char *rf_config_file) {
|
||||
extern void RCconfig_RU(void);
|
||||
|
||||
void init_RU(char *rf_config_file) {
|
||||
|
||||
int ru_id;
|
||||
RU_t *ru;
|
||||
|
||||
@@ -713,7 +713,6 @@ void *UE_thread(void *arg) {
|
||||
void* rxp[NB_ANTENNAS_RX], *txp[NB_ANTENNAS_TX];
|
||||
int start_rx_stream = 0;
|
||||
int i;
|
||||
char threadname[128];
|
||||
|
||||
cpu_set_t cpuset;
|
||||
CPU_ZERO(&cpuset);
|
||||
|
||||
Reference in New Issue
Block a user