diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index 2fa9c36d6903919cb7755437804262377ced9aa6..4386ca5d47d7e4f05aaf155b37ecf6e13f1a7a7f 100644 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -965,7 +965,7 @@ int phy_init_lte_ue(PHY_VARS_UE *ue, int i,j,k; int eNB_id; - msg("Initializing UE vars (abstraction %"PRIu8") for eNB TXant %"PRIu8", UE RXant %"PRIu8"\n",abstraction_flag,frame_parms->nb_antennas_tx,frame_parms->nb_antennas_rx); + printf("Initializing UE vars (abstraction %"PRIu8") for eNB TXant %"PRIu8", UE RXant %"PRIu8"\n",abstraction_flag,frame_parms->nb_antennas_tx,frame_parms->nb_antennas_rx); LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_UE][MOD %02u][]\n", ue->Mod_id+NB_eNB_INST); // many memory allocation sizes are hard coded @@ -1199,8 +1199,8 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB, common_vars->txdata[eNB_id][i] = (int32_t*)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(int32_t) ); common_vars->txdataF[eNB_id][i] = (int32_t*)malloc16_clear( FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t) ); #ifdef DEBUG_PHY - msg("[openair][LTE_PHY][INIT] common_vars->txdata[%d][%d] = %p\n",eNB_id,i,common_vars->txdata[eNB_id][i]); - msg("[openair][LTE_PHY][INIT] common_vars->txdataF[%d][%d] = %p (%d bytes)\n", + printf("[openair][LTE_PHY][INIT] common_vars->txdata[%d][%d] = %p\n",eNB_id,i,common_vars->txdata[eNB_id][i]); + printf("[openair][LTE_PHY][INIT] common_vars->txdataF[%d][%d] = %p (%d bytes)\n", eNB_id,i,common_vars->txdataF[eNB_id][i], FRAME_LENGTH_COMPLEX_SAMPLES_NO_PREFIX*sizeof(int32_t)); #endif @@ -1221,8 +1221,8 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB, common_vars->rxdataF[eNB_id][i] = (int32_t*)malloc16_clear(sizeof(int32_t)*(frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti) ); #ifdef DEBUG_PHY - msg("[openair][LTE_PHY][INIT] common_vars->rxdata[%d][%d] = %p\n",eNB_id,i,common_vars->rxdata[eNB_id][i]); - msg("[openair][LTE_PHY][INIT] common_vars->rxdata_7_5kHz[%d][%d] = %p\n",eNB_id,i,common_vars->rxdata_7_5kHz[eNB_id][i]); + printf("[openair][LTE_PHY][INIT] common_vars->rxdata[%d][%d] = %p\n",eNB_id,i,common_vars->rxdata[eNB_id][i]); + printf("[openair][LTE_PHY][INIT] common_vars->rxdata_7_5kHz[%d][%d] = %p\n",eNB_id,i,common_vars->rxdata_7_5kHz[eNB_id][i]); #endif } @@ -1272,7 +1272,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB, for (i=0; i<frame_parms->nb_antennas_rx; i++) { prach_vars->rxsigF[i] = (int16_t*)malloc16_clear( frame_parms->ofdm_symbol_size*12*2*sizeof(int16_t) ); #ifdef DEBUG_PHY - msg("[openair][LTE_PHY][INIT] prach_vars->rxsigF[%d] = %p\n",i,prach_vars->rxsigF[i]); + printf("[openair][LTE_PHY][INIT] prach_vars->rxsigF[%d] = %p\n",i,prach_vars->rxsigF[i]); #endif } @@ -1282,7 +1282,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB, for (i=0; i<frame_parms->nb_antennas_rx; i++) { prach_vars->prach_ifft[i] = (int16_t*)malloc16_clear(1024*2*sizeof(int16_t)); #ifdef DEBUG_PHY - msg("[openair][LTE_PHY][INIT] prach_vars->prach_ifft[%d] = %p\n",i,prach_vars->prach_ifft[i]); + printf("[openair][LTE_PHY][INIT] prach_vars->prach_ifft[%d] = %p\n",i,prach_vars->prach_ifft[i]); #endif } @@ -1365,11 +1365,11 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB, if (eNB->dl_precoder_SeNB[eNB_id]) { #ifdef DEBUG_PHY - msg("[openair][SECSYS_PHY][INIT] eNB->dl_precoder_SeNB[%d] allocated at %p\n",eNB_id, + printf("[openair][SECSYS_PHY][INIT] eNB->dl_precoder_SeNB[%d] allocated at %p\n",eNB_id, eNB->dl_precoder_SeNB[eNB_id]); #endif } else { - msg("[openair][SECSYS_PHY][INIT] eNB->dl_precoder_SeNB[%d] not allocated\n",eNB_id); + printf("[openair][SECSYS_PHY][INIT] eNB->dl_precoder_SeNB[%d] not allocated\n",eNB_id); return(-1); } @@ -1378,12 +1378,12 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB, if (eNB->dl_precoder_SeNB[eNB_id][j]) { #ifdef DEBUG_PHY - msg("[openair][LTE_PHY][INIT] eNB->dl_precoder_SeNB[%d][%d] allocated at %p\n",eNB_id,j, + printf("[openair][LTE_PHY][INIT] eNB->dl_precoder_SeNB[%d][%d] allocated at %p\n",eNB_id,j, eNB->dl_precoder_SeNB[eNB_id][j]); #endif memset(eNB->dl_precoder_SeNB[eNB_id][j],0,2*sizeof(int)*(eNB->frame_parms.ofdm_symbol_size)); } else { - msg("[openair][LTE_PHY][INIT] eNB->dl_precoder_SeNB[%d][%d] not allocated\n",eNB_id,j); + printf("[openair][LTE_PHY][INIT] eNB->dl_precoder_SeNB[%d][%d] not allocated\n",eNB_id,j); return(-1); } } //for(j=...nb_antennas_tx diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index b78856b15c5e8244284d896ff7f67977e3ab36ab..41f8d3532787ef70b23e1d9eec1ab6ef8cf0d149 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -367,6 +367,22 @@ int rrc_mac_remove_ue(module_id_t mod_idP,rnti_t rntiP) mac_phy_remove_ue(mod_idP,rntiP); + // check if this has an RA process active + RA_TEMPLATE *RA_template; + for (i=0;i<NB_RA_PROC_MAX;i++) { + RA_template = (RA_TEMPLATE *)&eNB_mac_inst[mod_idP].common_channels[pCC_id].RA_template[i]; + if ((RA_template->RA_active == TRUE) && + (RA_template->rnti == rntiP)){ + RA_template->RA_active=FALSE; + RA_template->generate_rar=0; + RA_template->generate_Msg4=0; + RA_template->wait_ack_Msg4=0; + RA_template->timing_offset=0; + RA_template->RRC_timer=20; + RA_template->rnti = 0; + break; + } + } if (ret == 0) { return (0); } diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index 59ee560b8a52e3897294b946d4121b8c10a8bbf0..ed1f18db278a31053cd893f13c93a927fa58a761 100644 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -3880,6 +3880,7 @@ rrc_eNB_decode_ccch( LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" Can't create new context for UE random UE identity (0x%" PRIx64 ")\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), random_value); + rrc_mac_remove_ue(ctxt_pP->module_id,ctxt_pP->rnti); return -1; } } @@ -4220,7 +4221,7 @@ rrc_eNB_decode_dcch( #ifdef RRC_MSG_PRINT LOG_F(RRC,"[MSG] RRC Security Mode Complete\n"); - for (i = 0; i < sdu_sizeP; i++) { + for (i = 0; i < sdu_sizeP; i++) eNB->pusch_vars[UE_id]{ LOG_F(RRC,"%02x ", ((uint8_t*)Rx_sdu)[i]); } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf index a2187d402fb545d73553ac51ad49767a974a640e..8144147ea587693e9314e22a299447b6ec351553 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf @@ -31,7 +31,7 @@ eNBs = tdd_config_s = 0; prefix_type = "NORMAL"; eutra_band = 7; - downlink_frequency = 2660000000L; + downlink_frequency = 2645000000L; uplink_frequency_offset = -120000000; Nid_cell = 0; N_RB_DL = 100; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf index 0a9b61546bf4063e327abb91a22d628e945fe26a..d2e99a3481c222ca6f6a36819a7d3ec8e3ac9855 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf @@ -31,7 +31,7 @@ eNBs = tdd_config_s = 0; prefix_type = "NORMAL"; eutra_band = 7; - downlink_frequency = 2680000000L; + downlink_frequency = 2660000000L; uplink_frequency_offset = -120000000; Nid_cell = 0; N_RB_DL = 50; diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index 832e35465e9f2c3880fb216b8ed547ff77d9ad6d..a3dc3179d37414e602bc7c8586aa50b3f12b8916 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -876,20 +876,20 @@ void rx_rf(PHY_VARS_eNB *eNB,int *frame,int *subframe) { void *rxp[fp->nb_antennas_rx],*txp[fp->nb_antennas_tx]; unsigned int rxs,txs; int i; - + int tx_sfoffset = (eNB->single_thread_flag == 1) ? 3 : 3; if (proc->first_rx==0) { // Transmit TX buffer based on timestamp from RX // printf("trx_write -> USRP TS %llu (sf %d)\n", (proc->timestamp_rx+(3*fp->samples_per_tti)),(proc->subframe_rx+2)%10); - VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (proc->timestamp_rx+(2*fp->samples_per_tti)-openair0_cfg[0].tx_sample_advance)&0xffffffff ); + VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (proc->timestamp_rx+(tx_sfoffset*fp->samples_per_tti)-openair0_cfg[0].tx_sample_advance)&0xffffffff ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 ); // prepare tx buffer pointers for (i=0; i<fp->nb_antennas_tx; i++) - txp[i] = (void*)&eNB->common_vars.txdata[0][i][((proc->subframe_rx+3)%10)*fp->samples_per_tti]; + txp[i] = (void*)&eNB->common_vars.txdata[0][i][((proc->subframe_rx+tx_sfoffset)%10)*fp->samples_per_tti]; txs = eNB->rfdevice.trx_write_func(&eNB->rfdevice, - proc->timestamp_rx+(3*fp->samples_per_tti)-openair0_cfg[0].tx_sample_advance, + proc->timestamp_rx+(tx_sfoffset*fp->samples_per_tti)-openair0_cfg[0].tx_sample_advance, txp, fp->samples_per_tti, fp->nb_antennas_tx, @@ -1317,7 +1317,7 @@ static void* eNB_thread_single( void* param ) { proc_rxtx->subframe_rx = proc->subframe_rx; proc_rxtx->frame_rx = proc->frame_rx; proc_rxtx->subframe_tx = (proc->subframe_rx+4)%10; - proc_rxtx->frame_tx = (proc->subframe_rx < 6) ? proc->frame_rx : (proc->frame_rx+1); + proc_rxtx->frame_tx = (proc->subframe_rx < 6) ? proc->frame_rx : (proc->frame_rx+1)&1023; if (rxtx(eNB,proc_rxtx,"eNB_thread_single") < 0) break; }