Commit 828077c2 authored by Raymond Knopp's avatar Raymond Knopp

bugfixes for eNB on usrp, some minor fixes for eMTC

parent faa111ec
...@@ -514,7 +514,8 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC, ...@@ -514,7 +514,8 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
if (Ncb>(3*(RTC<<5))) if (Ncb>(3*(RTC<<5)))
AssertFatal(1==0,"Exiting, RM condition (Ncb %d, RTC %d, Nir/C %d, Nsoft %d, Kw %d)\n",Ncb,RTC,Nir/C,Nsoft,3*(RTC<<5)); AssertFatal(1==0,"Exiting, RM condition (Ncb %d, RTC %d, Nir/C %d, Nsoft %d, Kw %d)\n",Ncb,RTC,Nir/C,Nsoft,3*(RTC<<5));
AssertFatal(Nl>0,"Nl is 0\n");
AssertFatal(Qm>0,"Qm is 0\n");
Gp = G/Nl/Qm; Gp = G/Nl/Qm;
GpmodC = Gp%C; GpmodC = Gp%C;
...@@ -720,6 +721,8 @@ int lte_rate_matching_turbo_rx(uint32_t RTC, ...@@ -720,6 +721,8 @@ int lte_rate_matching_turbo_rx(uint32_t RTC,
Ncb = 3*(RTC<<5); Ncb = 3*(RTC<<5);
} }
AssertFatal(Nl>0,"Nl is 0\n");
AssertFatal(Qm>0,"Qm is 0\n");
Gp = G/Nl/Qm; Gp = G/Nl/Qm;
GpmodC = Gp%C; GpmodC = Gp%C;
......
...@@ -123,6 +123,9 @@ int lte_segmentation(unsigned char *input_buffer, ...@@ -123,6 +123,9 @@ int lte_segmentation(unsigned char *input_buffer,
} }
AssertFatal(Bprime <= (*Cplus)*(*Kplus) + (*Cminus)*(*Kminus),
"Bprime %d < (*Cplus %d)*(*Kplus %d) + (*Cminus %d)*(*Kminus %d)\n",
Bprime,*Cplus,*Kplus,*Cminus,*Kminus);
*F = ((*Cplus)*(*Kplus) + (*Cminus)*(*Kminus) - (Bprime)); *F = ((*Cplus)*(*Kplus) + (*Cminus)*(*Kminus) - (Bprime));
#ifdef DEBUG_SEGMENTATION #ifdef DEBUG_SEGMENTATION
......
...@@ -1018,7 +1018,7 @@ handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, ...@@ -1018,7 +1018,7 @@ handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
else dlsch1_harq->pdu = sdu; else dlsch1_harq->pdu = sdu;
#ifdef Rel14 #ifdef Rel14
if ((rel13->pdsch_payload_type == 0) && (rel13->ue_type>0)) { // this is a BR/CE UE and SIB1-BR if ((rel13->pdsch_payload_type <2) && (rel13->ue_type>0)) { // this is a BR/CE UE and SIB1-BR/SI-BR
// configure PDSCH // configure PDSCH
switch (eNB->frame_parms.N_RB_DL) { switch (eNB->frame_parms.N_RB_DL) {
case 6: case 6:
...@@ -1048,13 +1048,13 @@ handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, ...@@ -1048,13 +1048,13 @@ handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
dlsch0_harq->nb_rb = 6; dlsch0_harq->nb_rb = 6;
dlsch0_harq->vrb_type = LOCALIZED; dlsch0_harq->vrb_type = LOCALIZED;
dlsch0_harq->rvidx = 0; dlsch0_harq->rvidx = rel8->redundancy_version;
dlsch0_harq->Nl = 0; dlsch0_harq->Nl = 1;
dlsch0_harq->mimo_mode = (eNB->frame_parms.nb_antenna_ports_eNB == 1) ? SISO : ALAMOUTI; dlsch0_harq->mimo_mode = (eNB->frame_parms.nb_antenna_ports_eNB == 1) ? SISO : ALAMOUTI;
dlsch0_harq->dl_power_off = 1; dlsch0_harq->dl_power_off = 1;
dlsch0_harq->round = 0; dlsch0_harq->round = 0;
dlsch0_harq->status = ACTIVE; dlsch0_harq->status = ACTIVE;
dlsch0_harq->TBS = rel8->length; dlsch0_harq->TBS = rel8->length<<3;
......
...@@ -503,7 +503,8 @@ void RCconfig_RU() { ...@@ -503,7 +503,8 @@ void RCconfig_RU() {
if ( !( if ( !(
config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_MAX_RS_EPRE, &max_pdschReferenceSignalPower) config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_MAX_RS_EPRE, &max_pdschReferenceSignalPower) &&
config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_MAX_RXGAIN, &max_rxgain)
) )
) { ) {
AssertFatal (0, AssertFatal (0,
......
...@@ -99,7 +99,7 @@ schedule_SIB1_BR( ...@@ -99,7 +99,7 @@ schedule_SIB1_BR(
int *Sj; int *Sj;
int n_NB = 0; int n_NB = 0;
int TBS; int TBS;
int k,rvidx; int k=0,rvidx;
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
...@@ -143,6 +143,7 @@ schedule_SIB1_BR( ...@@ -143,6 +143,7 @@ schedule_SIB1_BR(
switch (N_RB_DL) { switch (N_RB_DL) {
case 6: case 6:
case 15: case 15:
default:
m=1; m=1;
n_NB=0; n_NB=0;
N_S_NB=0; N_S_NB=0;
...@@ -189,11 +190,12 @@ schedule_SIB1_BR( ...@@ -189,11 +190,12 @@ schedule_SIB1_BR(
AssertFatal(cc->mib->message.schedulingInfoSIB1_BR_r13<19,"schedulingInfoSIB1_BR_r13 %d > 18\n", AssertFatal(cc->mib->message.schedulingInfoSIB1_BR_r13<19,"schedulingInfoSIB1_BR_r13 %d > 18\n",
(int)cc->mib->message.schedulingInfoSIB1_BR_r13); (int)cc->mib->message.schedulingInfoSIB1_BR_r13);
AssertFatal(bcch_sdu_length>0,"RRC returned 0 bytes for SIB1-BR\n");
TBS = SIB1_BR_TBS_table[(cc->mib->message.schedulingInfoSIB1_BR_r13-1)/3]>>3; TBS = SIB1_BR_TBS_table[(cc->mib->message.schedulingInfoSIB1_BR_r13-1)/3]>>3;
AssertFatal(bcch_sdu_length <= TBS, "length returned by RRC is not compatible with the TBS %d from MIB\n",TBS); AssertFatal(bcch_sdu_length <= TBS, "length returned by RRC %d is not compatible with the TBS %d from MIB\n",bcch_sdu_length,TBS);
if (bcch_sdu_length > 0) {
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); 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 // allocate all 6 PRBs in narrowband for SIB1_BR
...@@ -275,12 +277,10 @@ schedule_SIB1_BR( ...@@ -275,12 +277,10 @@ schedule_SIB1_BR(
CC_id, CC_id,
bcch_sdu_length); bcch_sdu_length);
} }
} else {
//LOG_D(MAC,"[eNB %d] Frame %d : BCCH not active \n",Mod_id,frame);
}
} }
return; return;
} }
...@@ -374,11 +374,12 @@ schedule_SI_BR( ...@@ -374,11 +374,12 @@ schedule_SI_BR(
module_idP, module_idP,
0); // not used in this case 0); // not used in this case
AssertFatal(bcch_sdu_length>0,"RRC returned 0 bytes for SI-BR %d\n",i);
if (bcch_sdu_length > 0) { if (bcch_sdu_length > 0) {
AssertFatal(bcch_sdu_length <= (si_TBS_r13>>3), AssertFatal(bcch_sdu_length <= (si_TBS_r13>>3),
"RRC provided bcch with length %d > %d\n", "RRC provided bcch with length %d > %d (si_TBS_r13 %d)\n",
bcch_sdu_length,(int)(si_TBS_r13>>3)); bcch_sdu_length,(int)(si_TBS_r13>>3),(int)schedulingInfoList_BR_r13->list.array[i]->si_TBS_r13);
LOG_D(MAC,"[eNB %d] Frame %d : BCCH_BR %d->DLSCH CC_id %d, Received %d bytes \n",module_idP,frameP,i,CC_id,bcch_sdu_length); LOG_D(MAC,"[eNB %d] Frame %d : BCCH_BR %d->DLSCH CC_id %d, Received %d bytes \n",module_idP,frameP,i,CC_id,bcch_sdu_length);
// allocate all 6 PRBs in narrowband for SIB1_BR // allocate all 6 PRBs in narrowband for SIB1_BR
...@@ -553,8 +554,8 @@ schedule_SI( ...@@ -553,8 +554,8 @@ schedule_SI(
start_meas(&eNB->schedule_si); start_meas(&eNB->schedule_si);
// Only schedule System Information in subframe 5 // Only schedule LTE System Information in subframe 5
if (subframeP != 5) return; if (subframeP == 5) {
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
...@@ -735,7 +736,12 @@ schedule_SI( ...@@ -735,7 +736,12 @@ schedule_SI(
//LOG_D(MAC,"[eNB %d] Frame %d : BCCH not active \n",Mod_id,frame); //LOG_D(MAC,"[eNB %d] Frame %d : BCCH not active \n",Mod_id,frame);
} }
} }
}
#ifdef Rel14
schedule_SIB1_BR(module_idP,frameP,subframeP);
schedule_SI_BR(module_idP,frameP,subframeP);
#endif
// this might be misleading when bcch is inactive // this might be misleading when bcch is inactive
stop_meas(&eNB->schedule_si); stop_meas(&eNB->schedule_si);
return; return;
......
...@@ -304,6 +304,24 @@ mac_rrc_data_req( ...@@ -304,6 +304,24 @@ mac_rrc_data_req(
} }
#endif //Rel10 || Rel14 #endif //Rel10 || Rel14
#ifdef Rel14
if ((Srb_id & RAB_OFFSET) == BCCH_SIB1_BR){
memcpy(&buffer_pP[0],
RC.rrc[Mod_idP]->carrier[CC_id].SIB1_BR,
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_BR);
return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB1_BR);
}
if ((Srb_id & RAB_OFFSET) == BCCH_SI_BR){ // First SI message with SIB2/3
memcpy(&buffer_pP[0],
RC.rrc[Mod_idP]->carrier[CC_id].SIB23_BR,
RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23_BR);
return (RC.rrc[Mod_idP]->carrier[CC_id].sizeof_SIB23_BR);
}
#endif
} else { //This is an UE } else { //This is an UE
......
...@@ -341,8 +341,8 @@ int trx_usrp_set_gains(openair0_device* device, ...@@ -341,8 +341,8 @@ int trx_usrp_set_gains(openair0_device* device,
openair0_config_t *openair0_cfg) { openair0_config_t *openair0_cfg) {
usrp_state_t *s = (usrp_state_t*)device->priv; 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(openair0_cfg[0].tx_gain[0]); s->usrp->set_tx_gain(gain_range_tx.stop()-openair0_cfg[0].tx_gain[0]);
::uhd::gain_range_t gain_range = s->usrp->get_rx_gain_range(0); ::uhd::gain_range_t gain_range = s->usrp->get_rx_gain_range(0);
// limit to maximum gain // limit to maximum gain
if (openair0_cfg[0].rx_gain[0]-openair0_cfg[0].rx_gain_offset[0] > gain_range.stop()) { if (openair0_cfg[0].rx_gain[0]-openair0_cfg[0].rx_gain_offset[0] > gain_range.stop()) {
...@@ -641,11 +641,13 @@ extern "C" { ...@@ -641,11 +641,13 @@ extern "C" {
openair0_cfg[0].rx_gain[i]-openair0_cfg[0].rx_gain_offset[i],gain_range.stop()); openair0_cfg[0].rx_gain[i]-openair0_cfg[0].rx_gain_offset[i],gain_range.stop());
} }
} }
for(int i=0; i<s->usrp->get_tx_num_channels(); i++) { for(int i=0; i<s->usrp->get_tx_num_channels(); i++) {
::uhd::gain_range_t gain_range_tx = s->usrp->get_tx_gain_range(i);
if (i<openair0_cfg[0].tx_num_channels) { if (i<openair0_cfg[0].tx_num_channels) {
s->usrp->set_tx_rate(openair0_cfg[0].sample_rate,i); s->usrp->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_freq(openair0_cfg[0].tx_freq[i],i);
s->usrp->set_tx_gain(openair0_cfg[0].tx_gain[i],i); s->usrp->set_tx_gain(gain_range_tx.stop()-openair0_cfg[0].tx_gain[i],i);
} }
} }
......
...@@ -1638,7 +1638,7 @@ void fill_rf_config(RU_t *ru,const char *rf_config_file) { ...@@ -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->rx_freq[i] = (double)fp->ul_CarrierFreq;
cfg->tx_gain[i] = (double)fp->att_tx; 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; cfg->configFilename = rf_config_file;
printf("channel %d, Setting tx_gain offset %f, rx_gain offset %f, tx_freq %f, rx_freq %f\n", printf("channel %d, Setting tx_gain offset %f, rx_gain offset %f, tx_freq %f, rx_freq %f\n",
......
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