Commit 2e7d7b30 authored by Florian Kaltenberger's avatar Florian Kaltenberger

bugfixes in lte-softmodem re N_RB_DL parameter, added filter config to openair0_lib


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5723 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 6cd080cf
...@@ -248,7 +248,7 @@ int openair0_stop_without_reset(int card) ...@@ -248,7 +248,7 @@ int openair0_stop_without_reset(int card)
static exmimo_config_t *p_exmimo_config; static exmimo_config_t *p_exmimo_config;
static exmimo_id_t *p_exmimo_id; static exmimo_id_t *p_exmimo_id;
#define MY_RF_MODE (RXEN + TXEN + TXLPFNORM + TXLPFEN + TXLPF25 + RXLPFNORM + RXLPFEN + RXLPF25 + LNA1ON +LNAMax + RFBBNORM + DMAMODE_RX + DMAMODE_TX) #define MY_RF_MODE (RXEN + TXEN + TXLPFNORM + TXLPFEN + TXLPF25 + RXLPFNORM + RXLPFEN + RXLPF25 + LNA1ON +LNAMax + RFBBNORM + DMAMODE_RX + DMAMODE_TX)
#define RF_MODE_BASE (TXLPFNORM + TXLPFEN + TXLPF25 + RXLPFNORM + RXLPFEN + RXLPF25 + LNA1ON +LNAMax + RFBBNORM) #define RF_MODE_BASE (LNA1ON +LNAMax + RFBBNORM)
int openair0_device_init(openair0_device *device, openair0_config_t *openair0_cfg) { int openair0_device_init(openair0_device *device, openair0_config_t *openair0_cfg) {
...@@ -256,7 +256,7 @@ int openair0_device_init(openair0_device *device, openair0_config_t *openair0_cf ...@@ -256,7 +256,7 @@ int openair0_device_init(openair0_device *device, openair0_config_t *openair0_cf
int ret; int ret;
int ant; int ant;
int resampling_factor=2; int resampling_factor=2;
int rx_filter=RXLPF25, tx_filter=TXLPF25;
ret = openair0_open(); ret = openair0_open();
...@@ -284,7 +284,10 @@ int openair0_device_init(openair0_device *device, openair0_config_t *openair0_cf ...@@ -284,7 +284,10 @@ int openair0_device_init(openair0_device *device, openair0_config_t *openair0_cf
exit(-1); exit(-1);
} }
if (!openair0_cfg) {
printf("Error, openair0_cfg is null!!\n");
return(-1);
}
if (p_exmimo_id->board_swrev>=9) if (p_exmimo_id->board_swrev>=9)
p_exmimo_config->framing.eNB_flag = 0; p_exmimo_config->framing.eNB_flag = 0;
...@@ -293,15 +296,27 @@ int openair0_device_init(openair0_device *device, openair0_config_t *openair0_cf ...@@ -293,15 +296,27 @@ int openair0_device_init(openair0_device *device, openair0_config_t *openair0_cf
p_exmimo_config->framing.tdd_config = DUPLEXMODE_FDD + TXRXSWITCH_LSB; p_exmimo_config->framing.tdd_config = DUPLEXMODE_FDD + TXRXSWITCH_LSB;
if (openair0_cfg->sample_rate==30.72e6) if (openair0_cfg->sample_rate==30.72e6) {
resampling_factor = 0; resampling_factor = 0;
else if (openair0_cfg->sample_rate==15.36e6) rx_filter = RXLPF10;
tx_filter = TXLPF10;
}
else if (openair0_cfg->sample_rate==15.36e6) {
resampling_factor = 1; resampling_factor = 1;
else if (openair0_cfg->sample_rate==7.68e6) rx_filter = RXLPF5;
tx_filter = TXLPF5;
}
else if (openair0_cfg->sample_rate==7.68e6) {
resampling_factor = 2; resampling_factor = 2;
rx_filter = RXLPF25;
tx_filter = TXLPF25;
}
else { else {
printf("Sampling rate not supported, using default 7.68MHz"); printf("Sampling rate not supported, using default 7.68MHz");
resampling_factor = 2; resampling_factor = 2;
rx_filter = RXLPF25;
tx_filter = TXLPF25;
} }
#if (BOARD_SWREV_CNTL2>=0x0A) #if (BOARD_SWREV_CNTL2>=0x0A)
...@@ -311,16 +326,12 @@ int openair0_device_init(openair0_device *device, openair0_config_t *openair0_cf ...@@ -311,16 +326,12 @@ int openair0_device_init(openair0_device *device, openair0_config_t *openair0_cf
p_exmimo_config->framing.resampling_factor = resampling_factor; p_exmimo_config->framing.resampling_factor = resampling_factor;
#endif #endif
if (!openair0_cfg) {
printf("Error, openair0_cfg is null!!\n");
return(-1);
}
for (ant=0;ant<max(openair0_cfg->tx_num_channels,openair0_cfg->rx_num_channels);ant++) for (ant=0;ant<max(openair0_cfg->tx_num_channels,openair0_cfg->rx_num_channels);ant++)
p_exmimo_config->rf.rf_mode[ant] = RF_MODE_BASE; p_exmimo_config->rf.rf_mode[ant] = RF_MODE_BASE;
for (ant=0;ant<openair0_cfg->tx_num_channels;ant++) for (ant=0;ant<openair0_cfg->tx_num_channels;ant++)
p_exmimo_config->rf.rf_mode[ant] += (TXEN + DMAMODE_TX); p_exmimo_config->rf.rf_mode[ant] += (TXEN + DMAMODE_TX + TXLPFNORM + TXLPFEN + tx_filter);
for (ant=0;ant<openair0_cfg->rx_num_channels;ant++) { for (ant=0;ant<openair0_cfg->rx_num_channels;ant++) {
p_exmimo_config->rf.rf_mode[ant] += (RXEN + DMAMODE_RX); p_exmimo_config->rf.rf_mode[ant] += (RXEN + DMAMODE_RX + RXLPFNORM + RXLPFEN + rx_filter);
switch (openair0_cfg->rxg_mode[ant]) { switch (openair0_cfg->rxg_mode[ant]) {
default: default:
case max_gain: case max_gain:
......
...@@ -304,7 +304,6 @@ static int mbox_bounds[20] = {8,16,24,30,38,46,54,60,68,7 ...@@ -304,7 +304,6 @@ static int mbox_bounds[20] = {8,16,24,30,38,46,54,60,68,7
static LTE_DL_FRAME_PARMS *frame_parms; static LTE_DL_FRAME_PARMS *frame_parms;
int multi_thread=1; int multi_thread=1;
int N_RB_DL=25;
int16_t glog_level=LOG_DEBUG; int16_t glog_level=LOG_DEBUG;
int16_t glog_verbosity=LOG_MED; int16_t glog_verbosity=LOG_MED;
...@@ -1817,21 +1816,26 @@ static void get_options (int argc, char **argv) { ...@@ -1817,21 +1816,26 @@ static void get_options (int argc, char **argv) {
case 'r': case 'r':
switch(atoi(optarg)) { switch(atoi(optarg)) {
case 6: case 6:
N_RB_DL=6; frame_parms->N_RB_DL=6;
frame_parms->N_RB_UL=6;
break; break;
case 25: case 25:
N_RB_DL=25; frame_parms->N_RB_DL=25;
frame_parms->N_RB_UL=25;
break; break;
case 50: case 50:
N_RB_DL=50; frame_parms->N_RB_DL=50;
frame_parms->N_RB_UL=50;
break; break;
case 100: case 100:
N_RB_DL=100; frame_parms->N_RB_DL=100;
frame_parms->N_RB_UL=100;
break; break;
default: default:
printf("Unknown N_RB_DL %d, switching to 25\n",atoi(optarg)); printf("Unknown N_RB_DL %d, switching to 25\n",atoi(optarg));
break; break;
} }
break;
case 's': case 's':
#ifdef USRP #ifdef USRP
...@@ -1877,11 +1881,12 @@ static void get_options (int argc, char **argv) { ...@@ -1877,11 +1881,12 @@ static void get_options (int argc, char **argv) {
frame_parms->frame_type = enb_properties->properties[i]->frame_type; frame_parms->frame_type = enb_properties->properties[i]->frame_type;
frame_parms->tdd_config = enb_properties->properties[i]->tdd_config; frame_parms->tdd_config = enb_properties->properties[i]->tdd_config;
frame_parms->tdd_config_S = enb_properties->properties[i]->tdd_config_s; frame_parms->tdd_config_S = enb_properties->properties[i]->tdd_config_s;
frame_parms->Ncp = enb_properties->properties[i]->prefix_type;
for (j=0; j < enb_properties->properties[i]->nb_cc; j++ ){ //for (j=0; j < enb_properties->properties[i]->nb_cc; j++ ){
frame_parms->Nid_cell = enb_properties->properties[i]->cell_id[j]; frame_parms->Nid_cell = enb_properties->properties[i]->cell_id[0];
frame_parms->N_RB_DL = enb_properties->properties[i]->N_RB_DL[j]; frame_parms->N_RB_DL = enb_properties->properties[i]->N_RB_DL[0];
} // j //} // j
glog_level = enb_properties->properties[i]->glog_level; glog_level = enb_properties->properties[i]->glog_level;
glog_verbosity = enb_properties->properties[i]->glog_verbosity; glog_verbosity = enb_properties->properties[i]->glog_verbosity;
...@@ -1956,6 +1961,11 @@ int main(int argc, char **argv) { ...@@ -1956,6 +1961,11 @@ int main(int argc, char **argv) {
frame_parms->frame_type = TDD; /* TDD */ frame_parms->frame_type = TDD; /* TDD */
frame_parms->tdd_config = 3; frame_parms->tdd_config = 3;
frame_parms->tdd_config_S = 0; frame_parms->tdd_config_S = 0;
frame_parms->N_RB_DL = 25;
frame_parms->N_RB_UL = 25;
frame_parms->Ncp = NORMAL;
frame_parms->Ncp_UL = NORMAL;
frame_parms->Nid_cell = Nid_cell;
get_options (argc, argv); //Command-line options get_options (argc, argv); //Command-line options
...@@ -2055,11 +2065,6 @@ int main(int argc, char **argv) { ...@@ -2055,11 +2065,6 @@ int main(int argc, char **argv) {
#endif #endif
// init the parameters // init the parameters
frame_parms->N_RB_DL = N_RB_DL;
frame_parms->N_RB_UL = N_RB_DL;
frame_parms->Ncp = NORMAL;
frame_parms->Ncp_UL = NORMAL;
frame_parms->Nid_cell = Nid_cell;
frame_parms->nushift = 0; frame_parms->nushift = 0;
if (UE_flag==0) if (UE_flag==0)
{ {
......
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