diff --git a/openair2/LAYER2/MAC/eNB_scheduler_bch.c b/openair2/LAYER2/MAC/eNB_scheduler_bch.c index 08cb63c3c6..2a7023e3ab 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_bch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_bch.c @@ -99,7 +99,7 @@ schedule_SIB1_BR( int *Sj; int n_NB = 0; int TBS; - int k,rvidx; + int k=0,rvidx; for (CC_id=0; CC_idDLSCH (SIB1) CC_id %d, Received %d bytes for NB %d\n",module_idP,frameP,CC_id,bcch_sdu_length,n_NB); - + LOG_D(MAC,"[eNB %d] Frame %d : BCCH_BR->DLSCH CC_id %d, Received %d bytes \n",module_idP,frameP,CC_id,bcch_sdu_length); + // allocate all 6 PRBs in narrowband for SIB1_BR first_rb = n_NB*6; vrb_map[first_rb] = 1; @@ -281,7 +281,6 @@ schedule_SIB1_BR( } - return; } @@ -563,10 +562,10 @@ schedule_SI( nfapi_dl_config_request_body_t *dl_req; start_meas(&eNB->schedule_si); - + // Only schedule LTE System Information in subframe 5 if (subframeP == 5) { - + for (CC_id=0; CC_idcommon_channels[CC_id]; @@ -753,7 +752,6 @@ schedule_SI( schedule_SI_BR(module_idP,frameP,subframeP); #endif - // this might be misleading when bcch is inactive stop_meas(&eNB->schedule_si); return; } diff --git a/openair2/RRC/LITE/L2_interface.c b/openair2/RRC/LITE/L2_interface.c index 2f67b9b03d..a67e86f808 100644 --- a/openair2/RRC/LITE/L2_interface.c +++ b/openair2/RRC/LITE/L2_interface.c @@ -302,7 +302,8 @@ mac_rrc_data_req( //else //return(0); } -#endif + +#endif //Rel10 || Rel14 #ifdef Rel14 if ((Srb_id & RAB_OFFSET) == BCCH_SIB1_BR){ @@ -320,6 +321,7 @@ mac_rrc_data_req( } #endif + } else { //This is an UE diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index b658c1cd86..ee5568c66e 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -341,8 +341,9 @@ int trx_usrp_set_gains(openair0_device* device, openair0_config_t *openair0_cfg) { usrp_state_t *s = (usrp_state_t*)device->priv; + ::uhd::gain_range_t gain_range_tx = s->usrp->get_tx_gain_range(0); + s->usrp->set_tx_gain(gain_range_tx.stop()-openair0_cfg[0].tx_gain[0]); - s->usrp->set_tx_gain(89.0-openair0_cfg[0].tx_gain[0]); ::uhd::gain_range_t gain_range = s->usrp->get_rx_gain_range(0); // limit to maximum gain if (openair0_cfg[0].rx_gain[0]-openair0_cfg[0].rx_gain_offset[0] > gain_range.stop()) { @@ -641,11 +642,13 @@ extern "C" { openair0_cfg[0].rx_gain[i]-openair0_cfg[0].rx_gain_offset[i],gain_range.stop()); } } + for(int i=0; iusrp->get_tx_num_channels(); i++) { + ::uhd::gain_range_t gain_range_tx = s->usrp->get_tx_gain_range(i); if (iusrp->set_tx_rate(openair0_cfg[0].sample_rate,i); s->usrp->set_tx_freq(openair0_cfg[0].tx_freq[i],i); - s->usrp->set_tx_gain(89.0-openair0_cfg[0].tx_gain[i],i); + s->usrp->set_tx_gain(gain_range_tx.stop()-openair0_cfg[0].tx_gain[i],i); } } diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 7519b34e86..ee7d73263a 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -1638,7 +1638,7 @@ void fill_rf_config(RU_t *ru,const char *rf_config_file) { cfg->rx_freq[i] = (double)fp->ul_CarrierFreq; cfg->tx_gain[i] = (double)fp->att_tx; - cfg->rx_gain[i] = (double)fp->att_rx; + 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",