From 32201bf30b48587eb64b046f90c62c3bc63b25a3 Mon Sep 17 00:00:00 2001 From: "islam.galal" Date: Tue, 15 Aug 2017 13:34:09 +0200 Subject: [PATCH 01/14] commit before merge from repository --- openair1/PHY/LTE_TRANSPORT/defs.h | 19 ++++++-- openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c | 35 +++++++++++++-- openair1/PHY/LTE_TRANSPORT/pmch.c | 3 +- openair1/PHY/LTE_TRANSPORT/proto.h | 1 + openair1/SCHED/phy_procedures_lte_eNb.c | 45 ++++++++++--------- openair2/LAYER2/MAC/eNB_scheduler_RA.c | 7 ++- openair2/LAYER2/MAC/eNB_scheduler_bch.c | 16 ++++--- .../CONF/enb.band13.tm1.50PRB.emtc.conf | 2 +- 8 files changed, 92 insertions(+), 36 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/defs.h b/openair1/PHY/LTE_TRANSPORT/defs.h index e2be6810b2..e2105df344 100755 --- a/openair1/PHY/LTE_TRANSPORT/defs.h +++ b/openair1/PHY/LTE_TRANSPORT/defs.h @@ -148,6 +148,8 @@ typedef struct { uint16_t nb_rb; /// downlink power offset field uint8_t dl_power_off; + /// start symbold of pdsch + uint8_t pdsch_start; /// Concatenated "e"-sequences (for definition see 36-212 V8.6 2009-03, p.17-18) uint8_t e[MAX_NUM_CHANNEL_BITS] __attribute__((aligned(32))); /// Turbo-code outputs (36-212 V8.6 2009-03, p.12 @@ -172,8 +174,8 @@ typedef struct { uint8_t Nlayers; /// First layer for this PSCH transmission uint8_t first_layer; - /// codeword this transport block is mapped to - uint8_t codeword; + /// codeword this transport block is mapped to + uint8_t codeword; } LTE_DL_eNB_HARQ_t; typedef struct { @@ -250,11 +252,18 @@ typedef struct { uint8_t decode_phich; } LTE_UL_UE_HARQ_t; +#ifdef Rel14 +typedef enum { + CEmodeA = 0, + CEmodeB = 1 +} CEmode_t; +#endif + typedef struct { /// TX buffers for UE-spec transmission (antenna ports 5 or 7..14, prior to precoding) int32_t *txdataF[8]; /// beamforming weights for UE-spec transmission (antenna ports 5 or 7..14), for each codeword, maximum 4 layers? - int32_t **ue_spec_bf_weights[4]; + int32_t **ue_spec_bf_weights[4]; /// dl channel estimates (estimated from ul channel estimates) int32_t **calib_dl_ch_estimates; /// Allocated RNTI (0 means DLSCH_t is not currently used) @@ -292,7 +301,11 @@ typedef struct { /// amplitude of PDSCH (compared to RS) in symbols containing pilots int16_t sqrt_rho_b; #ifdef Rel14 + /// indicator that this DLSCH corresponds to SIB1-BR, needed for c_init for scrambling uint8_t sib1_br_flag; + /// initial absolute subframe (see 36.211 Section 6.3.1), needed for c_init for scrambling + uint16_t i0; + CEmode_t CEmode; #endif } LTE_eNB_DLSCH_t; diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c b/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c index eaaddb0c07..e11a637893 100755 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c @@ -74,23 +74,50 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms, int harq_pid, int G, uint8_t q, + uint16_t frame, uint8_t Ns) { - int i; + int n; // uint8_t reset; uint32_t x1, x2, s=0; uint8_t *dlsch_e=dlsch->harq_processes[harq_pid]->e; uint8_t *e=dlsch_e; +#ifdef Rel14 + // Rule for accumulation of subframes for BL/CE UEs + uint8_t Nacc=4; + uint16_t j0,j,idelta; + uint16_t i = (Ns>>1) + (10*frame); + uint16_t i0 = dlsch->i0; + if (dlsch->sib1_br_flag==1) Nacc=1; + else if (dlsch->rnti == 0xFFFF || dlsch->rnti == 0xFFFE) Nacc = (frame_parms->frame_type == TDD) ? 10 : 4; + // Note: above SC-RNTI will also have to be added when/if implemented + else if (dlsch->CEmode == CEmodeA) Nacc=1; + else if (dlsch->CEmode == CEmodeB) Nacc = (frame_parms->frame_type == TDD) ? 10 : 4; + + if (frame_parms->frame_type == FDD || Nacc == 1) idelta = 0; + else idelta = Nacc-2; + + j0 = (i0+idelta)/Nacc; + j = (i - i0)/Nacc; +#endif VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_SCRAMBLING, VCD_FUNCTION_IN); // reset = 1; // x1 is set in lte_gold_generic if (mbsfn_flag == 0) { - x2 = (dlsch->rnti<<14) + (q<<13) + ((Ns>>1)<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1 +#ifdef Rel14 + if (dlsch->i0 != 0xFFFF) { + // rule for BL/CE UEs from Section 6.3.1 in 36.211 + x2= (dlsch->rnti<<14) + (q<<13) + ((((j0+j)*Nacc)%10)<<9) + frame_parms->Nid_cell; + if ((frame&1023) < 200) LOG_D(PHY,"Scrambling init for (i0 %d, i %d, j0 %d, j %d, Nacc %d) => x2 %d\n",i0,i,j0,j,Nacc,x2); + } + else +#endif + x2 = (dlsch->rnti<<14) + (q<<13) + ((Ns>>1)<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1 for PDSCH } else { - x2 = ((Ns>>1)<<9) + frame_parms->Nid_cell_mbsfn; //this is c_init in 36.211 Sec 6.3.1 + x2 = ((Ns>>1)<<9) + frame_parms->Nid_cell_mbsfn; //this is c_init in 36.211 Sec 6.3.1 for PMCH } #ifdef DEBUG_SCRAMBLING @@ -98,7 +125,7 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms, #endif s = lte_gold_scram(&x1, &x2, 1); - for (i=0; i<(1+(G>>5)); i++) { + for (n=0; n<(1+(G>>5)); n++) { #ifdef DEBUG_SCRAMBLING printf("scrambling %d : %d => ",k,e[k]); diff --git a/openair1/PHY/LTE_TRANSPORT/pmch.c b/openair1/PHY/LTE_TRANSPORT/pmch.c index 3aa14d924c..40f157e56b 100755 --- a/openair1/PHY/LTE_TRANSPORT/pmch.c +++ b/openair1/PHY/LTE_TRANSPORT/pmch.c @@ -285,6 +285,7 @@ void generate_mch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t *a) int G; int subframe = proc->subframe_tx; + int frame = proc->frame_tx; if (eNB->abstraction_flag != 0) { if (eNB_transport_info_TB_index[eNB->Mod_id][eNB->CC_id]!=0) @@ -324,7 +325,7 @@ void generate_mch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t *a) &eNB->dlsch_interleaving_stats)==0, "problem in dlsch_encoding"); - dlsch_scrambling(&eNB->frame_parms,1,eNB->dlsch_MCH,0,G,0,subframe<<1); + dlsch_scrambling(&eNB->frame_parms,1,eNB->dlsch_MCH,0,G,0,frame,subframe<<1); mch_modulation(eNB->common_vars.txdataF, diff --git a/openair1/PHY/LTE_TRANSPORT/proto.h b/openair1/PHY/LTE_TRANSPORT/proto.h index 87b736e1b4..f3bc2c5db1 100755 --- a/openair1/PHY/LTE_TRANSPORT/proto.h +++ b/openair1/PHY/LTE_TRANSPORT/proto.h @@ -1973,6 +1973,7 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms, int hard_pid, int G, uint8_t q, + uint16_t frame, uint8_t Ns); void dlsch_unscrambling(LTE_DL_FRAME_PARMS *frame_parms, diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 80789c2e8d..e350cf14c3 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -705,8 +705,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t *dlsch1, LTE_eNB_UE_stats *ue_stats, - int ra_flag, - int num_pdcch_symbols) { + int ra_flag) { int frame=proc->frame_tx; int subframe=proc->subframe_tx; @@ -717,15 +716,15 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, if (frame < 20) { LOG_I(PHY, - "[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d, subframe %d: Generating PDSCH/DLSCH with input size = %"PRIu16", num_pdcch_symbols %d, G %d, nb_rb %"PRIu16", rb0 %x, rb1 %x, TBS %"PRIu16", pmi_alloc %"PRIx64", rv %"PRIu8" (round %"PRIu8")\n", + "[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d, subframe %d: Generating PDSCH/DLSCH with input size = %"PRIu16", pdsch_start %d, G %d, nb_rb %"PRIu16", rb0 %x, rb1 %x, TBS %"PRIu16", pmi_alloc %"PRIx64", rv %"PRIu8" (round %"PRIu8")\n", eNB->Mod_id, dlsch->rnti,harq_pid, - frame, subframe, input_buffer_length, num_pdcch_symbols, + frame, subframe, input_buffer_length, dlsch_harq->pdsch_start, get_G(fp, dlsch_harq->nb_rb, dlsch_harq->rb_alloc, dlsch_harq->Qm, dlsch_harq->Nl, - num_pdcch_symbols, + dlsch_harq->pdsch_start, frame, subframe, dlsch_harq->mimo_mode==TM7?7:0), @@ -751,7 +750,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, dlsch_harq->rb_alloc, dlsch_harq->Qm, dlsch_harq->Nl, - num_pdcch_symbols, + dlsch_harq->pdsch_start, frame, subframe, dlsch_harq->mimo_mode==TM7?7:0), @@ -857,7 +856,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, start_meas(&eNB->dlsch_encoding_stats); eNB->te(eNB, dlsch_harq->pdu, - num_pdcch_symbols, + dlsch_harq->pdsch_start, dlsch, frame,subframe, &eNB->dlsch_rate_matching_stats, @@ -875,10 +874,11 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, dlsch_harq->rb_alloc, dlsch_harq->Qm, dlsch_harq->Nl, - num_pdcch_symbols, + dlsch_harq->pdsch_start, frame,subframe, 0), 0, + frame, subframe<<1); stop_meas(&eNB->dlsch_scrambling_stats); @@ -889,7 +889,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, eNB->common_vars.txdataF, AMP, subframe, - num_pdcch_symbols, + dlsch_harq->pdsch_start, dlsch, dlsch1); @@ -991,6 +991,9 @@ handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, uint8_t *sdu) { nfapi_dl_config_dlsch_pdu_rel8_t *rel8 = &dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8; +#ifndef Rel8 + nfapi_dl_config_dlsch_pdu_rel10_t *rel10 = &dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10; +#endif #ifdef Rel14 nfapi_dl_config_dlsch_pdu_rel13_t *rel13 = &dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13; #endif @@ -1017,6 +1020,12 @@ handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, dlsch1_harq = dlsch1->harq_processes[harq_pid]; AssertFatal(dlsch0_harq!=NULL,"dlsch_harq is null\n"); + + dlsch0_harq->pdsch_start = eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols; + + + + LOG_D(PHY,"NFAPI: frame %d, subframe %d: programming dlsch, rnti %x, UE_id %d, harq_pid %d\n", proc->frame_tx,proc->subframe_tx,rel8->rnti,UE_id,harq_pid); if (codeword_index == 0) dlsch0_harq->pdu = sdu; @@ -1025,10 +1034,12 @@ handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, #ifdef Rel14 dlsch0->sib1_br_flag=0; if ((rel13->pdsch_payload_type <2) && (rel13->ue_type>0)) { // this is a BR/CE UE and SIB1-BR/SI-BR - dlsch0->rnti = 0xFFFF; - dlsch0->Kmimo = 1; - dlsch0->Mdlharq = 4; - dlsch0->Nsoft = 25344; + dlsch0->rnti = 0xFFFF; + dlsch0->Kmimo = 1; + dlsch0->Mdlharq = 4; + dlsch0->Nsoft = 25344; + dlsch0->i0 = rel13->initial_transmission_sf_io; + dlsch0_harq->pdsch_start = rel10->pdsch_start; if (rel13->pdsch_payload_type == 0) dlsch0->sib1_br_flag=1; @@ -1470,13 +1481,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, dlsch0, dlsch1, &eNB->UE_stats[(uint32_t)UE_id], - 0, -#ifdef Rel14 - dlsch0->sib1_br_flag==0 ? num_pdcch_symbols : 3 -#else - num_pdcch_symbols -#endif -); + 0); } diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index 88ee3d14ae..1a3ea1ca9e 100755 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -310,7 +310,10 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1; // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ; - + + // Rel10 fields + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13; + // Rel13 fields dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = (RA_template->rach_resource_type < 3) ? 1 : 2;; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2; // not SI message dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = (10*frameP)+subframeP; @@ -658,6 +661,8 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1; // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ; + + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = (RA_template->rach_resource_type < 3) ? 1 : 2; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 2; // not SI message diff --git a/openair2/LAYER2/MAC/eNB_scheduler_bch.c b/openair2/LAYER2/MAC/eNB_scheduler_bch.c index 4e4c8aca1f..f9b85ffdd8 100755 --- a/openair2/LAYER2/MAC/eNB_scheduler_bch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_bch.c @@ -196,7 +196,7 @@ schedule_SIB1_BR( 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 ((frameP&1023) < 200) LOG_I(MAC,"[eNB %d] Frame %d Subframe %d: SIB1_BR->DLSCH CC_id %d, Received %d bytes, scheduling on NB %d (i %d,m %d,N_S_NB %d) rvidx %d\n",module_idP,frameP,subframeP,CC_id,bcch_sdu_length,n_NB,i,m,N_S_NB,rvidx); + if ((frameP&1023) < 200) LOG_D(MAC,"[eNB %d] Frame %d Subframe %d: SIB1_BR->DLSCH CC_id %d, Received %d bytes, scheduling on NB %d (i %d,m %d,N_S_NB %d) rvidx %d\n",module_idP,frameP,subframeP,CC_id,bcch_sdu_length,n_NB,i,m,N_S_NB,rvidx); // allocate all 6 PRBs in narrowband for SIB1_BR @@ -235,6 +235,8 @@ schedule_SIB1_BR( dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = (cc->p_eNB==1 ) ? 1 : 2; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1; + // Rel10 fields + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = 3; // Rel13 fields dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = 1; // CEModeA UE dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 0; // SIB1-BR @@ -311,7 +313,7 @@ schedule_SI_BR( nfapi_dl_config_request_body_t *dl_req; int i; int rvidx; - + int absSF = (frameP*10)+subframeP; for (CC_id=0; CC_id>1) + (k&1))&3; @@ -398,7 +400,7 @@ schedule_SI_BR( vrb_map[first_rb+4] = 1; vrb_map[first_rb+5] = 1; - if ((frameP%1000) < 200) LOG_D(MAC,"[eNB %d] Frame %d Subframe %d: SI_BR->DLSCH CC_id %d, Narrowband %d rvidx %d (sf_mod_period %d : si_WindowLength_BR_r13 %d : si_RepetitionPattern_r13 %d) bcch_sdu_length %d\n", + if ((frameP&1023) < 200) LOG_D(MAC,"[eNB %d] Frame %d Subframe %d: SI_BR->DLSCH CC_id %d, Narrowband %d rvidx %d (sf_mod_period %d : si_WindowLength_BR_r13 %d : si_RepetitionPattern_r13 %d) bcch_sdu_length %d\n", module_idP,frameP,subframeP,CC_id,si_Narrowband_r13-1,rvidx, sf_mod_period,si_WindowLength_BR_r13,si_RepetitionPattern_r13, bcch_sdu_length); @@ -432,10 +434,12 @@ schedule_SI_BR( dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transmission_mode = (cc->p_eNB==1 ) ? 1 : 2; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_prb_per_subband = 1; dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.num_bf_vector = 1; + // Rel10 fields (for PDSCH starting symbol) + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel10.pdsch_start = cc[CC_id].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13; // Rel13 fields dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.ue_type = 1; // CEModeA UE dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.pdsch_payload_type = 1; // SI-BR - dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = 0xFFFF; // absolute SF + dl_config_pdu->dlsch_pdu.dlsch_pdu_rel13.initial_transmission_sf_io = absSF - sf_mod_period; // dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.bf_vector = ; dl_req->number_pdu++; @@ -757,7 +761,7 @@ schedule_SI( #ifdef Rel14 schedule_SIB1_BR(module_idP,frameP,subframeP); - // schedule_SI_BR(module_idP,frameP,subframeP); + schedule_SI_BR(module_idP,frameP,subframeP); #endif stop_meas(&eNB->schedule_si); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf index dbae933a5f..55548cead3 100755 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf @@ -129,7 +129,7 @@ eNBs = fdd_DownlinkOrTddSubframeBitmapBR_r13 = "subframePattern10-r13" fdd_DownlinkOrTddSubframeBitmapBR_val_r13 = 0; fdd_UplinkSubframeBitmapBR_r13 = 0; - startSymbolBR_r13 = 1; + startSymbolBR_r13 = 3; si_HoppingConfigCommon_r13 = 1; # Note: 1==OFF ! si_ValidityTime_r13 = 0; system_info_value_tag_SI = From 5d157436c2784756c88745b4cb22eaaecc6e6621 Mon Sep 17 00:00:00 2001 From: "mohamed.said" Date: Tue, 15 Aug 2017 14:53:45 +0200 Subject: [PATCH 02/14] SIB1 system info value tag made optional --- openair2/ENB_APP/enb_config.c | 29 ++++++++++++++++++--------- openair2/RRC/LITE/MESSAGES/asn1_msg.c | 28 +++++++++++++++++--------- 2 files changed, 37 insertions(+), 20 deletions(-) diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index fcf444a278..dc925da8eb 100755 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -2579,18 +2579,27 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { } system_info_value_tag_SI_list = config_setting_get_member(setting_br13, ENB_CONFIG_STRING_SYSTEM_INFO_VALUE_TAG_LIST); - int num_system_info = config_setting_length(system_info_value_tag_SI_list); + int num_system_info; + if (system_info_value_tag_SI_list != NULL) + { + num_system_info = config_setting_length(system_info_value_tag_SI_list); + for (sys_info_idx = 0; sys_info_idx < num_system_info; ++sys_info_idx) + { + system_info_value_tag_SI = config_setting_get_elem(system_info_value_tag_SI_list, sys_info_idx); + if ( !(config_setting_lookup_int(system_info_value_tag_SI, ENB_CONFIG_STRING_SYSTEM_INFO_VALUE_TAG_SI_R13, &systemInfoValueTagSi_r13)) ) + { + AssertFatal (0, "Failed to parse eNB configuration file %s, system info value tag %d!\n", RC.config_file_name, nb_cc++); + } + RRC_CONFIGURATION_REQ (msg_p).systemInfoValueTagSi_r13[j][sys_info_idx] = systemInfoValueTagSi_r13; + } + } + else + { + num_system_info = 0; + } RRC_CONFIGURATION_REQ (msg_p).system_info_value_tag_SI_size[j] = num_system_info; - for (sys_info_idx = 0; sys_info_idx < num_system_info; ++sys_info_idx) - { - system_info_value_tag_SI = config_setting_get_elem(system_info_value_tag_SI_list, sys_info_idx); - if ( !(config_setting_lookup_int(system_info_value_tag_SI, ENB_CONFIG_STRING_SYSTEM_INFO_VALUE_TAG_SI_R13, &systemInfoValueTagSi_r13)) ) - { - AssertFatal (0, "Failed to parse eNB configuration file %s, system info value tag %d!\n", RC.config_file_name, nb_cc++); - } - RRC_CONFIGURATION_REQ (msg_p).systemInfoValueTagSi_r13[j][sys_info_idx] = systemInfoValueTagSi_r13; - } + rach_ce_level_info_r13_list = config_setting_get_member(setting_br13, ENB_CONFIG_STRING_RACH_CE_LEVEL_INFO_LIST); diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index e7a7b2e88c..e34e6f7162 100755 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -653,21 +653,29 @@ uint8_t do_SIB1(rrc_eNB_carrier_data_t *carrier, sib1_1310->bandwidthReducedAccessRelatedInfo_r13->si_ValidityTime_r13 = NULL; } - sib1_1310->bandwidthReducedAccessRelatedInfo_r13->systemInfoValueTagList_r13 = calloc(1, sizeof(SystemInfoValueTagList_r13_t)); - SystemInfoValueTagSI_r13_t systemInfoValueTagSi_r13; int num_system_info_value_tag = configuration->system_info_value_tag_SI_size[CC_id]; - for (index = 0; index < num_system_info_value_tag; ++index) + if (num_system_info_value_tag > 0) { - if (configuration->systemInfoValueTagSi_r13[CC_id][index]) + sib1_1310->bandwidthReducedAccessRelatedInfo_r13->systemInfoValueTagList_r13 = calloc(1, sizeof(SystemInfoValueTagList_r13_t)); + SystemInfoValueTagSI_r13_t systemInfoValueTagSi_r13; + for (index = 0; index < num_system_info_value_tag; ++index) { - systemInfoValueTagSi_r13 = configuration->systemInfoValueTagSi_r13[CC_id][index]; + if (configuration->systemInfoValueTagSi_r13[CC_id][index]) + { + systemInfoValueTagSi_r13 = configuration->systemInfoValueTagSi_r13[CC_id][index]; + } + else + { + systemInfoValueTagSi_r13 = 0; + } + ASN_SEQUENCE_ADD(&sib1_1310->bandwidthReducedAccessRelatedInfo_r13->systemInfoValueTagList_r13->list, &systemInfoValueTagSi_r13); } - else - { - systemInfoValueTagSi_r13 = 0; - } - ASN_SEQUENCE_ADD(&sib1_1310->bandwidthReducedAccessRelatedInfo_r13->systemInfoValueTagList_r13->list, &systemInfoValueTagSi_r13); + + } + else + { + sib1_1310->bandwidthReducedAccessRelatedInfo_r13->systemInfoValueTagList_r13 = NULL; } } From aeda8e5cecb30c96ab15eacb84332b926bf65485 Mon Sep 17 00:00:00 2001 From: "mohamed.said" Date: Tue, 15 Aug 2017 15:49:11 +0200 Subject: [PATCH 03/14] added pcch_config_v1310 to config file and handled in enb_config.c , asn1_msg.c --- openair2/COMMON/rrc_messages_types.h | 8 ++- openair2/ENB_APP/enb_config.c | 57 +++++++++++++++++-- openair2/RRC/LITE/MESSAGES/asn1_msg.c | 33 ++++++++++- .../CONF/enb.band13.tm1.50PRB.emtc.conf | 17 +++--- 4 files changed, 99 insertions(+), 16 deletions(-) diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index 6492a0c4d2..9ef9414f91 100755 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -250,7 +250,7 @@ typedef struct RrcConfigurationReq_s { long prach_HoppingConfig_r13 [MAX_NUM_CCs][4]; int prach_parameters_list_size [MAX_NUM_CCs]; long max_available_narrow_band [MAX_NUM_CCs][4][2]; - int max_available_narrow_band_size [MAX_NUM_CCs]; + int max_available_narrow_band_size [MAX_NUM_CCs][4]; // end kogo @@ -259,6 +259,12 @@ typedef struct RrcConfigurationReq_s { int pucch_info_value_size [MAX_NUM_CCs]; // end kogo + // +kogo + bool pcch_config_v1310 [MAX_NUM_CCs]; + long paging_narrowbands_r13 [MAX_NUM_CCs]; + long mpdcch_numrepetition_paging_r13 [MAX_NUM_CCs]; + long *nb_v1310 [MAX_NUM_CCs]; + #endif } RrcConfigurationReq; diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index dc925da8eb..6532575527 100755 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -160,6 +160,12 @@ EMAIL : Lionel.Gauthier@eurecom.fr, navid.nikaein@eurecom.fr #define ENB_CONFIG_STRING_MAX_AVAILABLE_NARROWBAND "maxavailablenarrowband" #define ENB_CONFIG_STRING_PUCCH_INFO_VALUE "pucch_info_value" +#define ENB_CONFIG_STRING_PCCH_CONFIG_V1310 "pcch_config_v1310" +#define ENB_CONFIG_STRING_PAGING_NARROWBANDS_R13 "paging_narrowbands_r13" +#define ENB_CONFIG_STRING_MPDCCH_NUMREPETITION_PAGING_R13 "mpdcch_numrepetition_paging_r13" +#define ENB_CONFIG_STRING_NB_V1310 "nb_v1310" + + #define ENB_CONFIG_STRING_PDSCH_RS_EPRE "pdsch_referenceSignalPower" #define ENB_CONFIG_STRING_PDSCH_PB "pdsch_p_b" @@ -1007,6 +1013,8 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { config_setting_t *n1_pucch_AN_info_r13_list = NULL; config_setting_t *n1_pucch_AN_info_r13 = NULL; + config_setting_t *setting_pcch_config_v1310 = NULL; + #if defined(Rel14) config_setting_t *setting_br13 = NULL; #endif // REL14 @@ -1134,6 +1142,11 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { libconfig_int maxavailablenarrowband = 0; libconfig_int pucch_info_value = 0; + libconfig_int paging_narrowbands_r13 = 0; + libconfig_int mpdcch_numrepetition_paging_r13 = 0; + libconfig_int nb_v1310 = 0; + + libconfig_int srb1_timer_poll_retransmit = 0; libconfig_int srb1_timer_reordering = 0; libconfig_int srb1_timer_status_prohibit = 0; @@ -2692,13 +2705,20 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { RRC_CONFIGURATION_REQ (msg_p).maxNumPreambleAttemptCE_r13[j][prach_parameters_index] = NULL; } + + max_available_narrow_band_list = config_setting_get_member(prach_parameters_ce_r13_list, ENB_CONFIG_STRING_MAX_AVAILABLE_NARROW_BAND); + int num_available_narrow_bands = config_setting_length(max_available_narrow_band_list); + RRC_CONFIGURATION_REQ (msg_p).maxNumPreambleAttemptCE_r13[j][prach_parameters_index] = num_available_narrow_bands; + int narrow_band_index; + for (narrow_band_index = 0; narrow_band_index < num_available_narrow_bands; narrow_band_index++) + { + max_available_narrow_band = config_setting_get_elem(max_available_narrow_band_list, narrow_band_index); + RRC_CONFIGURATION_REQ (msg_p).max_available_narrow_band[j][prach_parameters_index][narrow_band_index] = config_setting_get_int(max_available_narrow_band); + } + } - // TODO - // max_available_narrow_band = config_setting_get_member(prach_parameters_ce_r13, ENB_CONFIG_STRING_MAX_AVAILABLE_NARROW_BAND); - - n1_pucch_AN_info_r13_list = config_setting_get_member(setting_br13, ENB_CONFIG_STRING_N1_PUCCH_AN_INFO_LIST); int num_pucch_an_info = config_setting_length(n1_pucch_AN_info_r13_list); @@ -3725,6 +3745,35 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { char* prach_ConfigCommon_v1310 = NULL; char* mpdcch_startSF_CSS_RA_r13; + setting_pcch_config_v1310 = config_setting_get_member(setting_br13, ENB_CONFIG_STRING_PCCH_CONFIG_V1310); + if (setting_pcch_config_v1310 != NULL) + { + RRC_CONFIGURATION_REQ(msg_p).pcch_config_v1310[j] = TRUE; + if (!config_setting_lookup_int(setting_pcch_config_v1310, ENB_CONFIG_STRING_PAGING_NARROWBANDS_R13, &paging_narrowbands_r13) + || !config_setting_lookup_int(setting_pcch_config_v1310, ENB_CONFIG_STRING_MPDCCH_NUMREPETITION_PAGING_R13, &mpdcch_numrepetition_paging_r13) + ) + AssertFatal(0, + "Failed to parse eNB configuration file %s, enb %d pcch_config_v1310!\n", + RC.config_file_name, i); + + RRC_CONFIGURATION_REQ(msg_p).paging_narrowbands_r13[j] = paging_narrowbands_r13; + RRC_CONFIGURATION_REQ(msg_p).mpdcch_numrepetition_paging_r13[j] = mpdcch_numrepetition_paging_r13; + + if (config_setting_lookup_int(setting_pcch_config_v1310, ENB_CONFIG_STRING_MPDCCH_NUMREPETITION_PAGING_R13, &nb_v1310)) + { + RRC_CONFIGURATION_REQ(msg_p).nb_v1310[j] = CALLOC(1, sizeof(long)); + *RRC_CONFIGURATION_REQ(msg_p).nb_v1310[j] = nb_v1310; + } + else + { + RRC_CONFIGURATION_REQ(msg_p).nb_v1310[j] = NULL; + } + + } + else + { + RRC_CONFIGURATION_REQ(msg_p).pcch_config_v1310[j] = FALSE; + } if (!config_setting_lookup_int(setting_br13, ENB_CONFIG_STRING_schedulingInfoSIB1, &schedulingInfoSIB1_BR_r13)) AssertFatal(0, diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index e34e6f7162..429fe863bd 100755 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -1178,7 +1178,28 @@ uint8_t do_SIB23(uint8_t Mod_id, (*sib2)->radioResourceConfigCommon.ext4->bcch_Config_v1310 = calloc(1, sizeof(BCCH_Config_v1310_t)); memset((*sib2)->radioResourceConfigCommon.ext4->bcch_Config_v1310, 0, sizeof(BCCH_Config_v1310_t)); (*sib2)->radioResourceConfigCommon.ext4->bcch_Config_v1310->modificationPeriodCoeff_v1310 = BCCH_Config_v1310__modificationPeriodCoeff_v1310_n64; - (*sib2)->radioResourceConfigCommon.ext4->pcch_Config_v1310 = NULL; + + if (configuration->pcch_config_v1310) + { + (*sib2)->radioResourceConfigCommon.ext4->pcch_Config_v1310 = CALLOC(1, sizeof(PCCH_Config_v1310_t)); + (*sib2)->radioResourceConfigCommon.ext4->pcch_Config_v1310->paging_narrowBands_r13 = configuration->paging_narrowbands_r13[CC_id]; + (*sib2)->radioResourceConfigCommon.ext4->pcch_Config_v1310->mpdcch_NumRepetition_Paging_r13 = configuration->mpdcch_numrepetition_paging_r13[CC_id]; + if (configuration->nb_v1310[CC_id]) + { + (*sib2)->radioResourceConfigCommon.ext4->pcch_Config_v1310->nB_v1310 = CALLOC(1, sizeof(long)); + *(*sib2)->radioResourceConfigCommon.ext4->pcch_Config_v1310->nB_v1310 = *configuration->nb_v1310[CC_id]; + } + else + { + (*sib2)->radioResourceConfigCommon.ext4->pcch_Config_v1310->nB_v1310 = NULL; + } + } + else + { + (*sib2)->radioResourceConfigCommon.ext4->pcch_Config_v1310 = NULL; + } + + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13 = NULL; (*sib2)->radioResourceConfigCommon.ext4->pdsch_ConfigCommon_v1310 = NULL; (*sib2)->radioResourceConfigCommon.ext4->pusch_ConfigCommon_v1310 = NULL; @@ -1281,8 +1302,14 @@ uint8_t do_SIB23(uint8_t Mod_id, prach_parametersce_r13->prach_HoppingConfig_r13 = PRACH_ParametersCE_r13__prach_HoppingConfig_r13_off; } - long maxavailablenarrowband = 2; - ASN_SEQUENCE_ADD(&prach_parametersce_r13->mpdcch_NarrowbandsToMonitor_r13.list, &maxavailablenarrowband); + long maxavailablenarrowband; + int num_narrow_bands = configuration->max_available_narrow_band_size[CC_id][prach_parameters_index]; + int narrow_band_index; + for (narrow_band_index = 0; narrow_band_index < num_narrow_bands; narrow_band_index++) + { + maxavailablenarrowband = configuration->max_available_narrow_band[CC_id][prach_parameters_index][narrow_band_index]; + ASN_SEQUENCE_ADD(&prach_parametersce_r13->mpdcch_NarrowbandsToMonitor_r13.list, &maxavailablenarrowband); + } prach_parametersce_r13->mpdcch_NumRepetition_RA_r13 = PRACH_ParametersCE_r13__mpdcch_NumRepetition_RA_r13_r1; prach_parametersce_r13->prach_HoppingConfig_r13 = PRACH_ParametersCE_r13__prach_HoppingConfig_r13_off; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf index dbae933a5f..6ad1f12c59 100755 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf @@ -184,14 +184,8 @@ eNBs = numRepetitionPerPreambleAttempt_r13 = 0; mpdcch_NumRepetition_RA_r13 = 0; prach_HoppingConfig_r13 = 0; - max_available_narrow_band = - ( - { - maxavailablenarrowband = 2; - - } - ); - } + max_available_narrow_band = [2]; + } ); n1PUCCH_AN_InfoList_r13 = @@ -203,6 +197,13 @@ eNBs = pucch_info_value = 13; } ); + + pcch_config_v1310 : + { + paging_narrowbands_r13 = 1; + mpdcch_numrepetition_paging_r13 = 2; + nb_v1310 = 3; + } mpdcch_startSF_CSS_RA_r13 = "fdd-r13" mpdcch_startSF_CSS_RA_r13_val = 5; From 44fc7753b6655c49b23fc4c92cfae2a850aa6d1c Mon Sep 17 00:00:00 2001 From: "islam.galal" Date: Tue, 15 Aug 2017 15:50:18 +0200 Subject: [PATCH 04/14] modifications in SI scheduler during interop testing with Sequans module. Some changes in eMTC config file. --- openair2/LAYER2/MAC/eNB_scheduler_bch.c | 2 +- .../GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_bch.c b/openair2/LAYER2/MAC/eNB_scheduler_bch.c index f9b85ffdd8..04485a9d3e 100755 --- a/openair2/LAYER2/MAC/eNB_scheduler_bch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_bch.c @@ -393,7 +393,7 @@ schedule_SI_BR( // check that SIB1 didn't take this narrowband if (vrb_map[first_rb] > 0) continue; - first_rb = narrowband_to_first_rb(cc,si_Narrowband_r13); + first_rb = narrowband_to_first_rb(cc,si_Narrowband_r13-1); vrb_map[first_rb] = 1; vrb_map[first_rb+1] = 1; vrb_map[first_rb+2] = 1; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf index 55548cead3..00158a2baf 100755 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf @@ -126,9 +126,6 @@ eNBs = ); si_WindowLength_BR_r13 = 0; si_RepetitionPattern_r13 = 0; - fdd_DownlinkOrTddSubframeBitmapBR_r13 = "subframePattern10-r13" - fdd_DownlinkOrTddSubframeBitmapBR_val_r13 = 0; - fdd_UplinkSubframeBitmapBR_r13 = 0; startSymbolBR_r13 = 3; si_HoppingConfigCommon_r13 = 1; # Note: 1==OFF ! si_ValidityTime_r13 = 0; @@ -138,7 +135,7 @@ eNBs = systemInfoValueTagSi_r13 = 0; } ); - freqHoppingParametersDL_r13 = "ENABLE" + freqHoppingParametersDL_r13 = "DISABLE" mpdcch_pdsch_HoppingNB_r13 = 0; interval_DLHoppingConfigCommonModeA_r13 = "interval-FDD-r13" interval_DLHoppingConfigCommonModeA_r13_val = 0; @@ -198,9 +195,6 @@ eNBs = ( { pucch_info_value = 12; - }, - { - pucch_info_value = 13; } ); From 291616328ecc6d429a9c82d2c3cb492df54ac521 Mon Sep 17 00:00:00 2001 From: "islam.galal" Date: Tue, 15 Aug 2017 19:01:47 +0200 Subject: [PATCH 05/14] integration and testing of SIB2 integrity --- openair2/COMMON/rrc_messages_types.h | 6 ++ openair2/ENB_APP/enb_config.c | 68 +++++++++++++++++-- openair2/RRC/LITE/MESSAGES/asn1_msg.c | 56 +++++++++++++-- .../CONF/enb.band13.tm1.50PRB.emtc.conf | 13 +++- 4 files changed, 132 insertions(+), 11 deletions(-) diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index 9ef9414f91..3193517225 100755 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -265,6 +265,12 @@ typedef struct RrcConfigurationReq_s { long mpdcch_numrepetition_paging_r13 [MAX_NUM_CCs]; long *nb_v1310 [MAX_NUM_CCs]; + long *pucch_NumRepetitionCE_Msg4_Level0_r13 [MAX_NUM_CCs]; + long *pucch_NumRepetitionCE_Msg4_Level1_r13 [MAX_NUM_CCs]; + long *pucch_NumRepetitionCE_Msg4_Level2_r13 [MAX_NUM_CCs]; + long *pucch_NumRepetitionCE_Msg4_Level3_r13 [MAX_NUM_CCs]; + + #endif } RrcConfigurationReq; diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 6532575527..8d5d16ead2 100755 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -166,6 +166,10 @@ EMAIL : Lionel.Gauthier@eurecom.fr, navid.nikaein@eurecom.fr #define ENB_CONFIG_STRING_NB_V1310 "nb_v1310" +#define ENB_CONFIG_STRING_PUCCH_NUM_REPETITION_CE_MSG4_LEVEL0 "pucch_NumRepetitionCE_Msg4_Level0_r13" +#define ENB_CONFIG_STRING_PUCCH_NUM_REPETITION_CE_MSG4_LEVEL1 "pucch_NumRepetitionCE_Msg4_Level1_r13" +#define ENB_CONFIG_STRING_PUCCH_NUM_REPETITION_CE_MSG4_LEVEL2 "pucch_NumRepetitionCE_Msg4_Level2_r13" +#define ENB_CONFIG_STRING_PUCCH_NUM_REPETITION_CE_MSG4_LEVEL3 "pucch_NumRepetitionCE_Msg4_Level3_r13" #define ENB_CONFIG_STRING_PDSCH_RS_EPRE "pdsch_referenceSignalPower" #define ENB_CONFIG_STRING_PDSCH_PB "pdsch_p_b" @@ -1142,10 +1146,15 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { libconfig_int maxavailablenarrowband = 0; libconfig_int pucch_info_value = 0; - libconfig_int paging_narrowbands_r13 = 0; + libconfig_int paging_narrowbands_r13 = 0; libconfig_int mpdcch_numrepetition_paging_r13 = 0; libconfig_int nb_v1310 = 0; + + libconfig_int pucch_NumRepetitionCE_Msg4_Level0_r13 = 0; + libconfig_int pucch_NumRepetitionCE_Msg4_Level1_r13 = 0; + libconfig_int pucch_NumRepetitionCE_Msg4_Level2_r13 = 0; + libconfig_int pucch_NumRepetitionCE_Msg4_Level3_r13 = 0; libconfig_int srb1_timer_poll_retransmit = 0; libconfig_int srb1_timer_reordering = 0; @@ -2572,7 +2581,51 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { } if (setting_br13 != NULL) { + int cnt = 0; + if (config_setting_lookup_int(setting_br13, ENB_CONFIG_STRING_PUCCH_NUM_REPETITION_CE_MSG4_LEVEL0, &pucch_NumRepetitionCE_Msg4_Level0_r13)) + { + RRC_CONFIGURATION_REQ (msg_p).pucch_NumRepetitionCE_Msg4_Level0_r13[j] = CALLOC(1, sizeof(long)); + *RRC_CONFIGURATION_REQ (msg_p).pucch_NumRepetitionCE_Msg4_Level0_r13[j] = pucch_NumRepetitionCE_Msg4_Level0_r13; + ++cnt; + } + else + { + RRC_CONFIGURATION_REQ (msg_p).pucch_NumRepetitionCE_Msg4_Level0_r13[j] = NULL;; + } + + if (config_setting_lookup_int(setting_br13, ENB_CONFIG_STRING_PUCCH_NUM_REPETITION_CE_MSG4_LEVEL1, &pucch_NumRepetitionCE_Msg4_Level1_r13)) + { + RRC_CONFIGURATION_REQ (msg_p).pucch_NumRepetitionCE_Msg4_Level1_r13[j] = CALLOC(1, sizeof(long)); + *RRC_CONFIGURATION_REQ (msg_p).pucch_NumRepetitionCE_Msg4_Level1_r13[j] = pucch_NumRepetitionCE_Msg4_Level1_r13; + ++cnt; + } + else + { + RRC_CONFIGURATION_REQ (msg_p).pucch_NumRepetitionCE_Msg4_Level1_r13[j] = NULL;; + } + if (config_setting_lookup_int(setting_br13, ENB_CONFIG_STRING_PUCCH_NUM_REPETITION_CE_MSG4_LEVEL2, &pucch_NumRepetitionCE_Msg4_Level2_r13)) + { + RRC_CONFIGURATION_REQ (msg_p).pucch_NumRepetitionCE_Msg4_Level2_r13[j] = CALLOC(1, sizeof(long)); + *RRC_CONFIGURATION_REQ (msg_p).pucch_NumRepetitionCE_Msg4_Level2_r13[j] = pucch_NumRepetitionCE_Msg4_Level2_r13; + ++cnt; + } + else + { + RRC_CONFIGURATION_REQ (msg_p).pucch_NumRepetitionCE_Msg4_Level2_r13[j] = NULL; + } + + if (config_setting_lookup_int(setting_br13, ENB_CONFIG_STRING_PUCCH_NUM_REPETITION_CE_MSG4_LEVEL3, &pucch_NumRepetitionCE_Msg4_Level3_r13)) + { + RRC_CONFIGURATION_REQ (msg_p).pucch_NumRepetitionCE_Msg4_Level3_r13[j] = CALLOC(1, sizeof(long)); + *RRC_CONFIGURATION_REQ (msg_p).pucch_NumRepetitionCE_Msg4_Level3_r13[j] = pucch_NumRepetitionCE_Msg4_Level3_r13; + ++cnt; + } + else + { + RRC_CONFIGURATION_REQ (msg_p).pucch_NumRepetitionCE_Msg4_Level3_r13[j] = NULL;; + } + scheduling_info_br_list = config_setting_get_member(setting_br13, ENB_CONFIG_STRING_SCHEDULING_INFO_LIST); int num_scheduling_info = config_setting_length(scheduling_info_br_list); RRC_CONFIGURATION_REQ (msg_p).scheduling_info_br_size[j] = num_scheduling_info; @@ -2656,6 +2709,7 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { RC.config_file_name, nb_cc++); } RRC_CONFIGURATION_REQ (msg_p).rsrp_range[j][rsrp_range_idx] = rsrp_range_br; + printf("[DEBUGGING][KOGO] : rsrp range br = %d\n", rsrp_range_br); } prach_parameters_ce_r13_list = config_setting_get_member(setting_br13, ENB_CONFIG_STRING_PRACH_PARAMETERS_CE_R13); @@ -2677,6 +2731,8 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { RC.config_file_name, nb_cc++); } + printf("[DEBUGGING][KOGO] : prach hopping config = %d\n", prach_HoppingConfig_r13); + RRC_CONFIGURATION_REQ (msg_p).prach_config_index[j][prach_parameters_index] = prach_config_index_br; RRC_CONFIGURATION_REQ (msg_p).prach_freq_offset[j][prach_parameters_index] = prach_freq_offset_br; RRC_CONFIGURATION_REQ (msg_p).prach_StartingSubframe_r13[j][prach_parameters_index] = prach_StartingSubframe_r13; @@ -2706,9 +2762,9 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { } - max_available_narrow_band_list = config_setting_get_member(prach_parameters_ce_r13_list, ENB_CONFIG_STRING_MAX_AVAILABLE_NARROW_BAND); + max_available_narrow_band_list = config_setting_get_member(prach_parameters_ce_r13, ENB_CONFIG_STRING_MAX_AVAILABLE_NARROW_BAND); int num_available_narrow_bands = config_setting_length(max_available_narrow_band_list); - RRC_CONFIGURATION_REQ (msg_p).maxNumPreambleAttemptCE_r13[j][prach_parameters_index] = num_available_narrow_bands; + RRC_CONFIGURATION_REQ (msg_p).max_available_narrow_band_size[j][prach_parameters_index] = num_available_narrow_bands; int narrow_band_index; for (narrow_band_index = 0; narrow_band_index < num_available_narrow_bands; narrow_band_index++) { @@ -2722,6 +2778,7 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { n1_pucch_AN_info_r13_list = config_setting_get_member(setting_br13, ENB_CONFIG_STRING_N1_PUCCH_AN_INFO_LIST); int num_pucch_an_info = config_setting_length(n1_pucch_AN_info_r13_list); + AssertFatal(cnt == num_pucch_an_info, "Num Repetition Count should be equal to pucch info count !!!"); RRC_CONFIGURATION_REQ (msg_p).pucch_info_value_size[j] = num_pucch_an_info; int pucch_info_idx; for (pucch_info_idx = 0; pucch_info_idx < num_pucch_an_info; ++pucch_info_idx) @@ -3759,15 +3816,18 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { RRC_CONFIGURATION_REQ(msg_p).paging_narrowbands_r13[j] = paging_narrowbands_r13; RRC_CONFIGURATION_REQ(msg_p).mpdcch_numrepetition_paging_r13[j] = mpdcch_numrepetition_paging_r13; - if (config_setting_lookup_int(setting_pcch_config_v1310, ENB_CONFIG_STRING_MPDCCH_NUMREPETITION_PAGING_R13, &nb_v1310)) + if (config_setting_lookup_int(setting_pcch_config_v1310, ENB_CONFIG_STRING_NB_V1310, &nb_v1310)) { RRC_CONFIGURATION_REQ(msg_p).nb_v1310[j] = CALLOC(1, sizeof(long)); *RRC_CONFIGURATION_REQ(msg_p).nb_v1310[j] = nb_v1310; + + printf("[DEBUGGING][KOGO] : nb_v1310 = %d\n", nb_v1310); } else { RRC_CONFIGURATION_REQ(msg_p).nb_v1310[j] = NULL; } + } else diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index 429fe863bd..89e74fe304 100755 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -1217,6 +1217,7 @@ uint8_t do_SIB23(uint8_t Mod_id, if (configuration->rsrp_range_list_size[CC_id]) { rsrp_range = configuration->rsrp_range[CC_id][rsrp_index]; + printf("[DEBUGGING][KOGO][SIB23] : rsrp range = %d\n", rsrp_range); } else { @@ -1289,6 +1290,7 @@ uint8_t do_SIB23(uint8_t Mod_id, prach_parametersce_r13->numRepetitionPerPreambleAttempt_r13 = configuration->numRepetitionPerPreambleAttempt_r13[CC_id][prach_parameters_index]; prach_parametersce_r13->mpdcch_NumRepetition_RA_r13 = configuration->mpdcch_NumRepetition_RA_r13[CC_id][prach_parameters_index]; prach_parametersce_r13->prach_HoppingConfig_r13 = configuration->prach_HoppingConfig_r13[CC_id][prach_parameters_index]; + printf("[DEBUGGING][KOGO][SIB23] : prach hopping config = %d\n", prach_parametersce_r13->prach_HoppingConfig_r13); } else { @@ -1344,10 +1346,56 @@ uint8_t do_SIB23(uint8_t Mod_id, // +kogo FIXME // ASN_SEQUENCE_ADD(&(*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->n1PUCCH_AN_InfoList_r13->list, &pucch_info_value2); - (*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->pucch_NumRepetitionCE_Msg4_Level0_r13 = NULL; - (*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->pucch_NumRepetitionCE_Msg4_Level1_r13 = NULL; - (*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->pucch_NumRepetitionCE_Msg4_Level2_r13 = NULL; - (*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->pucch_NumRepetitionCE_Msg4_Level3_r13 = NULL; + if (configuration->pucch_NumRepetitionCE_Msg4_Level0_r13[CC_id]) + { + puts("LEVEL 0"); + (*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->pucch_NumRepetitionCE_Msg4_Level0_r13 = CALLOC(1, sizeof(long)); + *(*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->pucch_NumRepetitionCE_Msg4_Level0_r13 = *configuration->pucch_NumRepetitionCE_Msg4_Level0_r13[CC_id]; + printf("[DEBUGGING][KOGO][SIB23]: pucch_NumRepetitionCE_Msg4_Level0_r13 = %d\n", *(*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->pucch_NumRepetitionCE_Msg4_Level0_r13); + } + else + { + (*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->pucch_NumRepetitionCE_Msg4_Level0_r13 = NULL; + } + + + if (configuration->pucch_NumRepetitionCE_Msg4_Level1_r13[CC_id]) + { + puts("LEVEL 1"); + (*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->pucch_NumRepetitionCE_Msg4_Level1_r13 = CALLOC(1, sizeof(long)); + *(*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->pucch_NumRepetitionCE_Msg4_Level1_r13 = *configuration->pucch_NumRepetitionCE_Msg4_Level1_r13[CC_id]; + printf("[DEBUGGING][KOGO][SIB23]: pucch_NumRepetitionCE_Msg4_Level1_r13 = %d\n", *(*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->pucch_NumRepetitionCE_Msg4_Level1_r13); + } + else + { + (*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->pucch_NumRepetitionCE_Msg4_Level1_r13 = NULL; + } + + if (configuration->pucch_NumRepetitionCE_Msg4_Level2_r13[CC_id]) + { + puts("LEVEL 2"); + (*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->pucch_NumRepetitionCE_Msg4_Level2_r13 = CALLOC(1, sizeof(long)); + *(*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->pucch_NumRepetitionCE_Msg4_Level2_r13 = *configuration->pucch_NumRepetitionCE_Msg4_Level2_r13[CC_id]; + printf("[DEBUGGING][KOGO][SIB23]: pucch_NumRepetitionCE_Msg4_Level2_r13 = %d\n", *(*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->pucch_NumRepetitionCE_Msg4_Level2_r13); + } + else + { + (*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->pucch_NumRepetitionCE_Msg4_Level2_r13 = NULL; + } + + if (configuration->pucch_NumRepetitionCE_Msg4_Level3_r13[CC_id]) + { + puts("LEVEL 3"); + (*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->pucch_NumRepetitionCE_Msg4_Level3_r13 = CALLOC(1, sizeof(long)); + *(*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->pucch_NumRepetitionCE_Msg4_Level3_r13 = *configuration->pucch_NumRepetitionCE_Msg4_Level3_r13[CC_id]; + printf("[DEBUGGING][KOGO][SIB23]: pucch_NumRepetitionCE_Msg4_Level3_r13 = %d\n", *(*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->pucch_NumRepetitionCE_Msg4_Level3_r13); + } + else + { + (*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->pucch_NumRepetitionCE_Msg4_Level3_r13 = NULL; + } + + //----------------------------------------------------------------------------------------------------------------------------------------- diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf index 625cbcf6f1..4b66149774 100755 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf @@ -181,7 +181,7 @@ eNBs = numRepetitionPerPreambleAttempt_r13 = 0; mpdcch_NumRepetition_RA_r13 = 0; prach_HoppingConfig_r13 = 0; - max_available_narrow_band = [2]; + max_available_narrow_band = [5]; } ); @@ -194,11 +194,18 @@ eNBs = pcch_config_v1310 : { - paging_narrowbands_r13 = 1; + paging_narrowbands_r13 = 5; mpdcch_numrepetition_paging_r13 = 2; - nb_v1310 = 3; + nb_v1310 = 2; } + + pucch_NumRepetitionCE_Msg4_Level0_r13 = 0; + #pucch_NumRepetitionCE_Msg4_Level1_r13 = 1; + #pucch_NumRepetitionCE_Msg4_Level2_r13 = 2; + #pucch_NumRepetitionCE_Msg4_Level3_r13 = 3; + + mpdcch_startSF_CSS_RA_r13 = "fdd-r13" mpdcch_startSF_CSS_RA_r13_val = 5; #prach_HoppingOffset_r13 = ; From c453bb9145e5227efe0881d2126aaceed4bf582d Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Wed, 16 Aug 2017 10:11:54 +0200 Subject: [PATCH 06/14] fix RSRP_Range allocation in prach_ConfigCommon_v1310 --- openair2/RRC/LITE/MESSAGES/asn1_msg.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index 89e74fe304..6ac41aa725 100755 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -1209,22 +1209,23 @@ uint8_t do_SIB23(uint8_t Mod_id, (*sib2)->radioResourceConfigCommon.ext4->prach_ConfigCommon_v1310 = calloc(1, sizeof(PRACH_ConfigSIB_v1310_t)); memset((*sib2)->radioResourceConfigCommon.ext4->prach_ConfigCommon_v1310, 0, sizeof(PRACH_ConfigSIB_v1310_t)); - RSRP_Range_t rsrp_range; + RSRP_Range_t *rsrp_range; int num_rsrp_range = configuration->rsrp_range_list_size[CC_id]; int rsrp_index; for (rsrp_index = 0; rsrp_index < num_rsrp_range; ++rsrp_index) { + rsrp_range = CALLOC(1, sizeof(RSRP_Range_t)); if (configuration->rsrp_range_list_size[CC_id]) { - rsrp_range = configuration->rsrp_range[CC_id][rsrp_index]; - printf("[DEBUGGING][KOGO][SIB23] : rsrp range = %d\n", rsrp_range); + *rsrp_range = configuration->rsrp_range[CC_id][rsrp_index]; + printf("[DEBUGGING][KOGO][SIB23] : rsrp range = %d\n", *rsrp_range); } else { - rsrp_range = 60; + *rsrp_range = 60; } - ASN_SEQUENCE_ADD(&(*sib2)->radioResourceConfigCommon.ext4->prach_ConfigCommon_v1310->rsrp_ThresholdsPrachInfoList_r13.list, &rsrp_range); + ASN_SEQUENCE_ADD(&(*sib2)->radioResourceConfigCommon.ext4->prach_ConfigCommon_v1310->rsrp_ThresholdsPrachInfoList_r13.list, rsrp_range); } From defe1ece09cf72289a23c9283d83f7d37a4c2248 Mon Sep 17 00:00:00 2001 From: "mohamed.said" Date: Wed, 16 Aug 2017 10:43:12 +0200 Subject: [PATCH 07/14] Fixed memory allocation bugs in asn1_msg.c (SIB1 & SIB23) ASN1C issue --- openair2/RRC/LITE/MESSAGES/asn1_msg.c | 47 ++++++++++++++------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index 6ac41aa725..996a7b6126 100755 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -654,22 +654,23 @@ uint8_t do_SIB1(rrc_eNB_carrier_data_t *carrier, } + SystemInfoValueTagSI_r13_t *systemInfoValueTagSi_r13; int num_system_info_value_tag = configuration->system_info_value_tag_SI_size[CC_id]; if (num_system_info_value_tag > 0) { sib1_1310->bandwidthReducedAccessRelatedInfo_r13->systemInfoValueTagList_r13 = calloc(1, sizeof(SystemInfoValueTagList_r13_t)); - SystemInfoValueTagSI_r13_t systemInfoValueTagSi_r13; for (index = 0; index < num_system_info_value_tag; ++index) { + systemInfoValueTagSi_r13 = CALLOC(1, sizeof(SystemInfoValueTagSI_r13_t)); if (configuration->systemInfoValueTagSi_r13[CC_id][index]) { - systemInfoValueTagSi_r13 = configuration->systemInfoValueTagSi_r13[CC_id][index]; + *systemInfoValueTagSi_r13 = configuration->systemInfoValueTagSi_r13[CC_id][index]; } else { - systemInfoValueTagSi_r13 = 0; + *systemInfoValueTagSi_r13 = 0; } - ASN_SEQUENCE_ADD(&sib1_1310->bandwidthReducedAccessRelatedInfo_r13->systemInfoValueTagList_r13->list, &systemInfoValueTagSi_r13); + ASN_SEQUENCE_ADD(&sib1_1310->bandwidthReducedAccessRelatedInfo_r13->systemInfoValueTagList_r13->list, systemInfoValueTagSi_r13); } } @@ -814,8 +815,9 @@ uint8_t do_SIB1(rrc_eNB_carrier_data_t *carrier, sib1_1310->bandwidthReducedAccessRelatedInfo_r13->systemInfoValueTagList_r13 = calloc(1, sizeof(SystemInfoValueTagList_r13_t)); - SystemInfoValueTagSI_r13_t systemInfoValueTagSi_r13 = 0; - ASN_SEQUENCE_ADD(&sib1_1310->bandwidthReducedAccessRelatedInfo_r13->systemInfoValueTagList_r13->list, &systemInfoValueTagSi_r13); + SystemInfoValueTagSI_r13_t *systemInfoValueTagSi_r13 = CALLOC(1, sizeof(SystemInfoValueTagSI_r13_t)); + *systemInfoValueTagSi_r13 = 0; + ASN_SEQUENCE_ADD(&sib1_1310->bandwidthReducedAccessRelatedInfo_r13->systemInfoValueTagList_r13->list, systemInfoValueTagSi_r13); sib1_1310->nonCriticalExtension = calloc(1, sizeof(SystemInformationBlockType1_v1320_IEs_t)); memset(sib1_1310->nonCriticalExtension, 0, sizeof(SystemInformationBlockType1_v1320_IEs_t)); @@ -1036,13 +1038,12 @@ uint8_t do_SIB23(uint8_t Mod_id, (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.ext1->rach_CE_LevelInfoList_r13 = calloc(1, sizeof(RACH_CE_LevelInfoList_r13_t)); memset((*sib2)->radioResourceConfigCommon.rach_ConfigCommon.ext1->rach_CE_LevelInfoList_r13, 0, sizeof(RACH_CE_LevelInfoList_r13_t)); - RACH_CE_LevelInfo_r13_t *rach_ce_levelinfo_r13 = calloc(1, sizeof(RACH_CE_LevelInfo_r13_t)); - memset(rach_ce_levelinfo_r13, 0, sizeof(RACH_CE_LevelInfo_r13_t)); - + RACH_CE_LevelInfo_r13_t *rach_ce_levelinfo_r13; int num_rach_ce_level_info = configuration->rach_CE_LevelInfoList_r13_size[CC_id]; int index; for (index = 0; index < num_rach_ce_level_info; ++index) { + rach_ce_levelinfo_r13 = calloc(1, sizeof(RACH_CE_LevelInfo_r13_t)); if (configuration->rach_CE_LevelInfoList_r13_size[CC_id]) { rach_ce_levelinfo_r13->preambleMappingInfo_r13.firstPreamble_r13 = configuration->firstPreamble_r13[CC_id][index]; @@ -1258,13 +1259,14 @@ uint8_t do_SIB23(uint8_t Mod_id, (*sib2)->radioResourceConfigCommon.ext4->prach_ConfigCommon_v1310->prach_HoppingOffset_r13 = NULL; } - PRACH_ParametersCE_r13_t *prach_parametersce_r13 = calloc(1, sizeof(PRACH_ParametersCE_r13_t)); + PRACH_ParametersCE_r13_t *prach_parametersce_r13; memset(prach_parametersce_r13, 0, sizeof(PRACH_ParametersCE_r13_t)); int num_prach_parameters_ce = configuration->prach_parameters_list_size[CC_id]; int prach_parameters_index; for (prach_parameters_index = 0; prach_parameters_index < num_prach_parameters_ce; ++prach_parameters_index) { + prach_parametersce_r13 = CALLOC(1, sizeof(PRACH_ParametersCE_r13_t)); if (configuration->prach_parameters_list_size[CC_id]) { prach_parametersce_r13->prach_ConfigIndex_r13 = configuration->prach_config_index[CC_id][prach_parameters_index]; @@ -1305,13 +1307,14 @@ uint8_t do_SIB23(uint8_t Mod_id, prach_parametersce_r13->prach_HoppingConfig_r13 = PRACH_ParametersCE_r13__prach_HoppingConfig_r13_off; } - long maxavailablenarrowband; + long *maxavailablenarrowband; int num_narrow_bands = configuration->max_available_narrow_band_size[CC_id][prach_parameters_index]; int narrow_band_index; for (narrow_band_index = 0; narrow_band_index < num_narrow_bands; narrow_band_index++) { - maxavailablenarrowband = configuration->max_available_narrow_band[CC_id][prach_parameters_index][narrow_band_index]; - ASN_SEQUENCE_ADD(&prach_parametersce_r13->mpdcch_NarrowbandsToMonitor_r13.list, &maxavailablenarrowband); + maxavailablenarrowband = CALLOC(1, sizeof(long)); + *maxavailablenarrowband = configuration->max_available_narrow_band[CC_id][prach_parameters_index][narrow_band_index]; + ASN_SEQUENCE_ADD(&prach_parametersce_r13->mpdcch_NarrowbandsToMonitor_r13.list, maxavailablenarrowband); } prach_parametersce_r13->mpdcch_NumRepetition_RA_r13 = PRACH_ParametersCE_r13__mpdcch_NumRepetition_RA_r13_r1; @@ -1330,23 +1333,21 @@ uint8_t do_SIB23(uint8_t Mod_id, int num_pucch_info_list = configuration->pucch_info_value_size[CC_id]; int pucch_index; - long pucch_info_value; + long *pucch_info_value; for (pucch_index = 0; pucch_index < num_pucch_info_list; ++pucch_index) { + pucch_info_value = CALLOC(1, sizeof(long)); if (configuration->pucch_info_value_size[CC_id]) { - pucch_info_value = configuration->pucch_info_value[CC_id][pucch_index]; + *pucch_info_value = configuration->pucch_info_value[CC_id][pucch_index]; } else { - pucch_info_value = 0; + *pucch_info_value = 0; } - ASN_SEQUENCE_ADD(&(*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->n1PUCCH_AN_InfoList_r13->list, &pucch_info_value); + ASN_SEQUENCE_ADD(&(*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->n1PUCCH_AN_InfoList_r13->list, pucch_info_value); } -// +kogo FIXME -// ASN_SEQUENCE_ADD(&(*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->n1PUCCH_AN_InfoList_r13->list, &pucch_info_value2); - if (configuration->pucch_NumRepetitionCE_Msg4_Level0_r13[CC_id]) { puts("LEVEL 0"); @@ -1598,7 +1599,7 @@ uint8_t do_SIB23(uint8_t Mod_id, sib2_mbsfn_SubframeConfig1->subframeAllocation.choice.oneFrame.buf[0]=0x38<<2; - ASN_SEQUENCE_ADD(&MBSFNSubframeConfigList->list,sib2_mbsfn_SubframeConfig1); + ASN_SEQUENCE_ADD(&MBSFNSubframeConfigList->list, sib2_mbsfn_SubframeConfig1); if (MBMS_flag == 4 ) { LOG_I(RRC,"Adding MBSFN subframe Configuration 2 to SIB2\n"); @@ -1616,7 +1617,7 @@ uint8_t do_SIB23(uint8_t Mod_id, sib2_mbsfn_SubframeConfig2->subframeAllocation.choice.oneFrame.buf[0]=0x07<<2; - ASN_SEQUENCE_ADD(&MBSFNSubframeConfigList->list,sib2_mbsfn_SubframeConfig2); + ASN_SEQUENCE_ADD(&MBSFNSubframeConfigList->list, sib2_mbsfn_SubframeConfig2); } } @@ -1741,7 +1742,7 @@ uint8_t do_SIB23(uint8_t Mod_id, #if defined(Rel10) || defined(Rel14) if (MBMS_flag > 0) { - ASN_SEQUENCE_ADD(&bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list,sib13_part); + ASN_SEQUENCE_ADD(&bcch_message->message.choice.c1.choice.systemInformation.criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list, sib13_part); } #endif From 8ec2f370b050b3029e1be8cfb04f84cef2d208a3 Mon Sep 17 00:00:00 2001 From: "mohamed.said" Date: Wed, 16 Aug 2017 12:39:16 +0200 Subject: [PATCH 08/14] added frequncy hopping config in do_SIB23 - ready to test --- openair2/COMMON/rrc_messages_types.h | 14 ++ openair2/ENB_APP/enb_config.c | 147 ++++++++++++++++++ openair2/RRC/LITE/MESSAGES/asn1_msg.c | 132 +++++++++++++++- .../CONF/enb.band13.tm1.50PRB.emtc.conf | 17 ++ 4 files changed, 309 insertions(+), 1 deletion(-) diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index 3193517225..501bf4b91c 100755 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -271,6 +271,20 @@ typedef struct RrcConfigurationReq_s { long *pucch_NumRepetitionCE_Msg4_Level3_r13 [MAX_NUM_CCs]; + bool sib2_freq_hoppingParameters_r13_exists [MAX_NUM_CCs]; + long *sib2_mpdcch_pdsch_hoppingNB_r13 [MAX_NUM_CCs]; + long *sib2_interval_DLHoppingConfigCommonModeA_r13 [MAX_NUM_CCs]; + long sib2_interval_DLHoppingConfigCommonModeA_r13_val [MAX_NUM_CCs]; + long *sib2_interval_DLHoppingConfigCommonModeB_r13 [MAX_NUM_CCs]; + long sib2_interval_DLHoppingConfigCommonModeB_r13_val [MAX_NUM_CCs]; + long *sib2_interval_ULHoppingConfigCommonModeA_r13 [MAX_NUM_CCs]; + long sib2_interval_ULHoppingConfigCommonModeA_r13_val [MAX_NUM_CCs]; + long *sib2_interval_ULHoppingConfigCommonModeB_r13 [MAX_NUM_CCs]; + long sib2_interval_ULHoppingConfigCommonModeB_r13_val [MAX_NUM_CCs]; + long *sib2_mpdcch_pdsch_hoppingOffset_r13 [MAX_NUM_CCs]; + + + #endif } RrcConfigurationReq; diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 8d5d16ead2..6ec38b3bb9 100755 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -171,6 +171,21 @@ EMAIL : Lionel.Gauthier@eurecom.fr, navid.nikaein@eurecom.fr #define ENB_CONFIG_STRING_PUCCH_NUM_REPETITION_CE_MSG4_LEVEL2 "pucch_NumRepetitionCE_Msg4_Level2_r13" #define ENB_CONFIG_STRING_PUCCH_NUM_REPETITION_CE_MSG4_LEVEL3 "pucch_NumRepetitionCE_Msg4_Level3_r13" +#define ENB_CONFIG_STRING_FREQ_HOPPING_PARAMETERS_R13 "sib2_freq_hoppingParameters_r13" +#define ENB_CONFIG_STRING_MPDCCH_PDSCH_HOPPING_NB_R13 "sib2_mpdcch_pdsch_hoppingNB_r13" +#define ENB_CONFIG_STRING_INTERVAL_DL_HOPPING_CONFIG_COMMON_MODE_A_R13 "sib2_interval_DLHoppingConfigCommonModeA_r13" +#define ENB_CONFIG_STRING_INTERVAL_DL_HOPPING_CONFIG_COMMON_MODE_A_R13_VAL "sib2_interval_DLHoppingConfigCommonModeA_r13_val" +#define ENB_CONFIG_STRING_INTERVAL_DL_HOPPING_CONFIG_COMMON_MODE_B_R13 "sib2_interval_DLHoppingConfigCommonModeB_r13" +#define ENB_CONFIG_STRING_INTERVAL_DL_HOPPING_CONFIG_COMMON_MODE_B_R13_VAL "sib2_interval_DLHoppingConfigCommonModeB_r13_val" +#define ENB_CONFIG_STRING_INTERVAL_UL_HOPPING_CONFIG_COMMON_MODE_A_R13 "sib2_interval_ULHoppingConfigCommonModeA_r13" +#define ENB_CONFIG_STRING_INTERVAL_UL_HOPPING_CONFIG_COMMON_MODE_A_R13_VAL "sib2_interval_ULHoppingConfigCommonModeA_r13_val" +#define ENB_CONFIG_STRING_INTERVAL_UL_HOPPING_CONFIG_COMMON_MODE_B_R13 "sib2_interval_ULHoppingConfigCommonModeB_r13" +#define ENB_CONFIG_STRING_INTERVAL_UL_HOPPING_CONFIG_COMMON_MODE_B_R13_VAL "sib2_interval_ULHoppingConfigCommonModeB_r13_val" +#define ENB_CONFIG_STRING_MPDCCH_PDSCH_HOPPING_OFFSET_R13 "sib2_mpdcch_pdsch_hoppingOffset_r13" + + + + #define ENB_CONFIG_STRING_PDSCH_RS_EPRE "pdsch_referenceSignalPower" #define ENB_CONFIG_STRING_PDSCH_PB "pdsch_p_b" #define ENB_CONFIG_STRING_PUSCH_N_SB "pusch_n_SB" @@ -1018,6 +1033,8 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { config_setting_t *n1_pucch_AN_info_r13 = NULL; config_setting_t *setting_pcch_config_v1310 = NULL; + config_setting_t *setting_freq_hoppingParameters_r13 = NULL; + #if defined(Rel14) config_setting_t *setting_br13 = NULL; @@ -1156,6 +1173,21 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { libconfig_int pucch_NumRepetitionCE_Msg4_Level2_r13 = 0; libconfig_int pucch_NumRepetitionCE_Msg4_Level3_r13 = 0; + libconfig_int sib2_mpdcch_pdsch_hoppingNB_r13 = 0; + libconfig_int sib2_interval_DLHoppingConfigCommonModeA_r13 = 0; + libconfig_int sib2_interval_DLHoppingConfigCommonModeA_r13_val = 0; + libconfig_int sib2_interval_DLHoppingConfigCommonModeB_r13 = 0; + libconfig_int sib2_interval_DLHoppingConfigCommonModeB_r13_val = 0; + libconfig_int sib2_interval_ULHoppingConfigCommonModeA_r13 = 0; + libconfig_int sib2_interval_ULHoppingConfigCommonModeA_r13_val = 0; + libconfig_int sib2_interval_ULHoppingConfigCommonModeB_r13 = 0; + libconfig_int sib2_interval_ULHoppingConfigCommonModeB_r13_val = 0; + libconfig_int sib2_mpdcch_pdsch_hoppingOffset_r13 = 0; + + + + + libconfig_int srb1_timer_poll_retransmit = 0; libconfig_int srb1_timer_reordering = 0; libconfig_int srb1_timer_status_prohibit = 0; @@ -2794,6 +2826,121 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { RRC_CONFIGURATION_REQ (msg_p).pucch_info_value[j][pucch_info_idx] = pucch_info_value; } + setting_freq_hoppingParameters_r13 = config_setting_get_member(setting_br13, ENB_CONFIG_STRING_FREQ_HOPPING_PARAMETERS_R13); + if (setting_freq_hoppingParameters_r13 != NULL) + { + RRC_CONFIGURATION_REQ(msg_p).sib2_freq_hoppingParameters_r13_exists[j] = TRUE; + if (config_setting_lookup_int(setting_freq_hoppingParameters_r13, ENB_CONFIG_STRING_MPDCCH_PDSCH_HOPPING_NB_R13, sib2_mpdcch_pdsch_hoppingNB_r13)) + { + + RRC_CONFIGURATION_REQ(msg_p).sib2_mpdcch_pdsch_hoppingNB_r13[j] = CALLOC(1, sizeof(long)); + *RRC_CONFIGURATION_REQ(msg_p).sib2_mpdcch_pdsch_hoppingNB_r13[j] = sib2_mpdcch_pdsch_hoppingNB_r13; + } + else + { + RRC_CONFIGURATION_REQ(msg_p).sib2_mpdcch_pdsch_hoppingNB_r13[j] = NULL; + } + + if (config_setting_lookup_int(setting_freq_hoppingParameters_r13, ENB_CONFIG_STRING_INTERVAL_DL_HOPPING_CONFIG_COMMON_MODE_A_R13, &sib2_interval_DLHoppingConfigCommonModeA_r13)) + { + + RRC_CONFIGURATION_REQ(msg_p).sib2_interval_DLHoppingConfigCommonModeA_r13[j] = CALLOC(1, sizeof(long)); + *RRC_CONFIGURATION_REQ(msg_p).sib2_interval_DLHoppingConfigCommonModeA_r13[j] = sib2_interval_DLHoppingConfigCommonModeA_r13; + config_setting_lookup_int(setting_freq_hoppingParameters_r13, ENB_CONFIG_STRING_INTERVAL_DL_HOPPING_CONFIG_COMMON_MODE_A_R13_VAL, &sib2_interval_DLHoppingConfigCommonModeA_r13_val); + RRC_CONFIGURATION_REQ(msg_p).sib2_interval_DLHoppingConfigCommonModeA_r13_val[j] = sib2_interval_DLHoppingConfigCommonModeA_r13_val; + + } + else + { + RRC_CONFIGURATION_REQ(msg_p).sib2_interval_DLHoppingConfigCommonModeA_r13[j] = NULL; + } + + + if (config_setting_lookup_int(setting_freq_hoppingParameters_r13, ENB_CONFIG_STRING_INTERVAL_DL_HOPPING_CONFIG_COMMON_MODE_B_R13, &sib2_interval_DLHoppingConfigCommonModeB_r13)) + { + + RRC_CONFIGURATION_REQ(msg_p).sib2_interval_DLHoppingConfigCommonModeB_r13[j] = CALLOC(1, sizeof(long)); + *RRC_CONFIGURATION_REQ(msg_p).sib2_interval_DLHoppingConfigCommonModeB_r13[j] = sib2_interval_DLHoppingConfigCommonModeB_r13; + config_setting_lookup_int(setting_freq_hoppingParameters_r13, ENB_CONFIG_STRING_INTERVAL_DL_HOPPING_CONFIG_COMMON_MODE_B_R13_VAL, &sib2_interval_DLHoppingConfigCommonModeB_r13_val); + RRC_CONFIGURATION_REQ(msg_p).sib2_interval_DLHoppingConfigCommonModeB_r13_val[j] = sib2_interval_DLHoppingConfigCommonModeB_r13_val; + + } + else + { + RRC_CONFIGURATION_REQ(msg_p).sib2_interval_DLHoppingConfigCommonModeB_r13[j] = NULL; + } + + + + if (config_setting_lookup_int(setting_freq_hoppingParameters_r13, ENB_CONFIG_STRING_INTERVAL_UL_HOPPING_CONFIG_COMMON_MODE_A_R13, &sib2_interval_ULHoppingConfigCommonModeA_r13)) + { + + RRC_CONFIGURATION_REQ(msg_p).sib2_interval_ULHoppingConfigCommonModeA_r13[j] = CALLOC(1, sizeof(long)); + *RRC_CONFIGURATION_REQ(msg_p).sib2_interval_ULHoppingConfigCommonModeA_r13[j] = sib2_interval_ULHoppingConfigCommonModeA_r13; + config_setting_lookup_int(setting_freq_hoppingParameters_r13, ENB_CONFIG_STRING_INTERVAL_UL_HOPPING_CONFIG_COMMON_MODE_A_R13_VAL, &sib2_interval_ULHoppingConfigCommonModeA_r13_val); + RRC_CONFIGURATION_REQ(msg_p).sib2_interval_ULHoppingConfigCommonModeA_r13_val[j] = sib2_interval_ULHoppingConfigCommonModeA_r13_val; + + } + else + { + RRC_CONFIGURATION_REQ(msg_p).sib2_interval_ULHoppingConfigCommonModeA_r13[j] = NULL; + } + + + + if (config_setting_lookup_int(setting_freq_hoppingParameters_r13, ENB_CONFIG_STRING_INTERVAL_UL_HOPPING_CONFIG_COMMON_MODE_B_R13, &sib2_interval_ULHoppingConfigCommonModeB_r13)) + { + + RRC_CONFIGURATION_REQ(msg_p).sib2_interval_ULHoppingConfigCommonModeB_r13[j] = CALLOC(1, sizeof(long)); + *RRC_CONFIGURATION_REQ(msg_p).sib2_interval_ULHoppingConfigCommonModeB_r13[j] = sib2_interval_ULHoppingConfigCommonModeB_r13; + config_setting_lookup_int(setting_freq_hoppingParameters_r13, ENB_CONFIG_STRING_INTERVAL_UL_HOPPING_CONFIG_COMMON_MODE_B_R13_VAL, &sib2_interval_ULHoppingConfigCommonModeB_r13_val); + RRC_CONFIGURATION_REQ(msg_p).sib2_interval_ULHoppingConfigCommonModeB_r13_val[j] = sib2_interval_ULHoppingConfigCommonModeB_r13_val; + + } + else + { + RRC_CONFIGURATION_REQ(msg_p).sib2_interval_ULHoppingConfigCommonModeB_r13[j] = NULL; + } + + + + + if (config_setting_lookup_int(setting_freq_hoppingParameters_r13, ENB_CONFIG_STRING_MPDCCH_PDSCH_HOPPING_OFFSET_R13, &sib2_mpdcch_pdsch_hoppingOffset_r13)) + { + + RRC_CONFIGURATION_REQ(msg_p).sib2_mpdcch_pdsch_hoppingOffset_r13[j] = CALLOC(1, sizeof(long)); + *RRC_CONFIGURATION_REQ(msg_p).sib2_mpdcch_pdsch_hoppingOffset_r13[j] = sib2_mpdcch_pdsch_hoppingOffset_r13; + } + else + { + RRC_CONFIGURATION_REQ(msg_p).sib2_mpdcch_pdsch_hoppingOffset_r13[j] = NULL; + } + + + } + else + { + RRC_CONFIGURATION_REQ(msg_p).sib2_freq_hoppingParameters_r13_exists[j] = FALSE; + } + + + + + printf("[DEBUGGING][KOGO][CONF]: 0 = %d\n", RRC_CONFIGURATION_REQ(msg_p).sib2_freq_hoppingParameters_r13_exists[j]); + printf("[DEBUGGING][KOGO][CONF]: 1 = %d\n", *RRC_CONFIGURATION_REQ(msg_p).sib2_mpdcch_pdsch_hoppingNB_r13[j]); + + printf("[DEBUGGING][KOGO][CONF]: 2 = %d\n", *RRC_CONFIGURATION_REQ(msg_p).sib2_interval_DLHoppingConfigCommonModeA_r13[j]); + printf("[DEBUGGING][KOGO][CONF]: 3 = %d\n", RRC_CONFIGURATION_REQ(msg_p).sib2_interval_DLHoppingConfigCommonModeA_r13_val[j]); + printf("[DEBUGGING][KOGO][CONF]: 4 = %d\n", *RRC_CONFIGURATION_REQ(msg_p).sib2_interval_DLHoppingConfigCommonModeB_r13[j]); + printf("[DEBUGGING][KOGO][CONF]: 5 = %d\n", RRC_CONFIGURATION_REQ(msg_p).sib2_interval_DLHoppingConfigCommonModeB_r13_val[j]); + + printf("[DEBUGGING][KOGO][CONF]: 6 = %d\n", *RRC_CONFIGURATION_REQ(msg_p).sib2_interval_ULHoppingConfigCommonModeA_r13[j]); + printf("[DEBUGGING][KOGO][CONF]: 7 = %d\n", RRC_CONFIGURATION_REQ(msg_p).sib2_interval_ULHoppingConfigCommonModeA_r13_val[j]); + printf("[DEBUGGING][KOGO][CONF]: 8 = %d\n", *RRC_CONFIGURATION_REQ(msg_p).sib2_interval_ULHoppingConfigCommonModeB_r13[j]); + printf("[DEBUGGING][KOGO][CONF]: 9 = %d\n", RRC_CONFIGURATION_REQ(msg_p).sib2_interval_ULHoppingConfigCommonModeB_r13_val[j]); + + printf("[DEBUGGING][KOGO][CONF]: 10 = %d\n", *RRC_CONFIGURATION_REQ(msg_p).sib2_mpdcch_pdsch_hoppingNB_r13[j]); + // Rel8 RadioResourceConfigCommon Parameters if (!(config_setting_lookup_string(setting_br13, ENB_CONFIG_STRING_FRAME_TYPE, &frame_type) diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index 996a7b6126..30b7ee8d79 100755 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -1201,7 +1201,137 @@ uint8_t do_SIB23(uint8_t Mod_id, } - (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13 = NULL; + if (configuration->sib2_freq_hoppingParameters_r13_exists[CC_id]) + { + puts("[DEBUGGING][KOGO][SIB23]: Structure exists"); + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13 = CALLOC(1, sizeof(FreqHoppingParameters_r13_t)); + if (configuration->sib2_mpdcch_pdsch_hoppingNB_r13[CC_id]) + { + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->mpdcch_pdsch_HoppingNB_r13 = CALLOC(1, sizeof(long)); + *(*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->mpdcch_pdsch_HoppingNB_r13 = *configuration->sib2_mpdcch_pdsch_hoppingNB_r13[CC_id]; + + } + else + { + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->mpdcch_pdsch_HoppingNB_r13 = NULL; + } + + if (configuration->sib2_interval_DLHoppingConfigCommonModeA_r13[CC_id]) + { + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_DLHoppingConfigCommonModeA_r13 + = CALLOC(1, sizeof(struct FreqHoppingParameters_r13__interval_DLHoppingConfigCommonModeA_r13)); + if (*configuration->sib2_interval_DLHoppingConfigCommonModeA_r13[CC_id] == 0) + { + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_DLHoppingConfigCommonModeA_r13->present + = FreqHoppingParameters_r13__interval_DLHoppingConfigCommonModeA_r13_PR_interval_FDD_r13; + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_DLHoppingConfigCommonModeA_r13->choice.interval_FDD_r13 + = configuration->sib2_interval_DLHoppingConfigCommonModeA_r13_val[CC_id]; + } + else + { + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_DLHoppingConfigCommonModeA_r13->present + = FreqHoppingParameters_r13__interval_DLHoppingConfigCommonModeA_r13_PR_interval_TDD_r13; + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_DLHoppingConfigCommonModeA_r13->choice.interval_TDD_r13 + = configuration->sib2_interval_DLHoppingConfigCommonModeA_r13_val[CC_id]; + + } + } + else + { + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_DLHoppingConfigCommonModeA_r13 = NULL; + } + + + if (configuration->sib2_interval_DLHoppingConfigCommonModeB_r13[CC_id]) + { + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_DLHoppingConfigCommonModeB_r13 + = CALLOC(1, sizeof(struct FreqHoppingParameters_r13__interval_DLHoppingConfigCommonModeB_r13)); + if (*configuration->sib2_interval_DLHoppingConfigCommonModeB_r13[CC_id] == 0) + { + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_DLHoppingConfigCommonModeB_r13->present + = FreqHoppingParameters_r13__interval_DLHoppingConfigCommonModeB_r13_PR_interval_FDD_r13; + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_DLHoppingConfigCommonModeB_r13->choice.interval_FDD_r13 + = configuration->sib2_interval_DLHoppingConfigCommonModeB_r13_val[CC_id]; + } + else + { + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_DLHoppingConfigCommonModeB_r13->present + = FreqHoppingParameters_r13__interval_DLHoppingConfigCommonModeB_r13_PR_interval_TDD_r13; + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_DLHoppingConfigCommonModeB_r13->choice.interval_TDD_r13 + = configuration->sib2_interval_DLHoppingConfigCommonModeB_r13_val[CC_id]; + + } + } + else + { + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_DLHoppingConfigCommonModeB_r13 = NULL; + } + + if (configuration->sib2_interval_ULHoppingConfigCommonModeA_r13[CC_id]) + { + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_ULHoppingConfigCommonModeA_r13 + = CALLOC(1, sizeof(struct FreqHoppingParameters_r13__interval_ULHoppingConfigCommonModeA_r13)); + if (*configuration->sib2_interval_ULHoppingConfigCommonModeA_r13[CC_id] == 0) + { + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_ULHoppingConfigCommonModeA_r13->present + = FreqHoppingParameters_r13__interval_ULHoppingConfigCommonModeA_r13_PR_interval_FDD_r13; + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_ULHoppingConfigCommonModeA_r13->choice.interval_FDD_r13 + = configuration->sib2_interval_ULHoppingConfigCommonModeA_r13_val[CC_id]; + } + else + { + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_ULHoppingConfigCommonModeA_r13->present + = FreqHoppingParameters_r13__interval_ULHoppingConfigCommonModeA_r13_PR_interval_TDD_r13; + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_ULHoppingConfigCommonModeA_r13->choice.interval_TDD_r13 + = configuration->sib2_interval_ULHoppingConfigCommonModeA_r13_val[CC_id]; + + } + } + else + { + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_ULHoppingConfigCommonModeA_r13 = NULL; + } + + if (configuration->sib2_interval_ULHoppingConfigCommonModeB_r13[CC_id]) + { + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_ULHoppingConfigCommonModeB_r13 + = CALLOC(1, sizeof(struct FreqHoppingParameters_r13__interval_ULHoppingConfigCommonModeB_r13)); + if (*configuration->sib2_interval_ULHoppingConfigCommonModeB_r13[CC_id] == 0) + { + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_ULHoppingConfigCommonModeB_r13->present + = FreqHoppingParameters_r13__interval_ULHoppingConfigCommonModeB_r13_PR_interval_FDD_r13; + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_ULHoppingConfigCommonModeB_r13->choice.interval_FDD_r13 + = configuration->sib2_interval_ULHoppingConfigCommonModeB_r13_val[CC_id]; + } + else + { + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_ULHoppingConfigCommonModeB_r13->present + = FreqHoppingParameters_r13__interval_ULHoppingConfigCommonModeB_r13_PR_interval_TDD_r13; + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_ULHoppingConfigCommonModeB_r13->choice.interval_TDD_r13 + = configuration->sib2_interval_ULHoppingConfigCommonModeB_r13_val[CC_id]; + + } + } + else + { + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->interval_ULHoppingConfigCommonModeB_r13 = NULL; + } + + if (configuration->sib2_mpdcch_pdsch_hoppingOffset_r13[CC_id]) + { + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->mpdcch_pdsch_HoppingOffset_r13 = CALLOC(1, sizeof(long)); + *(*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->mpdcch_pdsch_HoppingOffset_r13 = *configuration->sib2_mpdcch_pdsch_hoppingOffset_r13[CC_id]; + } + else + { + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13->mpdcch_pdsch_HoppingOffset_r13 = NULL; + } + } + else + { + (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13 = NULL; + } + (*sib2)->radioResourceConfigCommon.ext4->pdsch_ConfigCommon_v1310 = NULL; (*sib2)->radioResourceConfigCommon.ext4->pusch_ConfigCommon_v1310 = NULL; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf index 4b66149774..906c3cae30 100755 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf @@ -205,6 +205,23 @@ eNBs = #pucch_NumRepetitionCE_Msg4_Level2_r13 = 2; #pucch_NumRepetitionCE_Msg4_Level3_r13 = 3; + sib2_freq_hoppingParameters_r13 : + { + sib2_mpdcch_pdsch_hoppingNB_r13 = 1; + sib2_interval_DLHoppingConfigCommonModeA_r13 = 2; # choice -> (0, FDD) (1, TDD) + sib2_interval_DLHoppingConfigCommonModeA_r13_val = 3; + sib2_interval_DLHoppingConfigCommonModeB_r13 = 4; # choice -> (0, FDD) (1, TDD) + sib2_interval_DLHoppingConfigCommonModeB_r13_val = 5; + + sib2_interval_ULHoppingConfigCommonModeA_r13 = 6; # choice -> (0, FDD) (1, TDD) + sib2_interval_ULHoppingConfigCommonModeA_r13_val = 7; + sib2_interval_ULHoppingConfigCommonModeB_r13 = 8; # choice -> (0, FDD) (1, TDD) + sib2_interval_ULHoppingConfigCommonModeB_r13_val = 9; + + sib2_mpdcch_pdsch_hoppingOffset_r13 = 10; + } + + mpdcch_startSF_CSS_RA_r13 = "fdd-r13" mpdcch_startSF_CSS_RA_r13_val = 5; From c0b0ed5a5760c4d7bd93834926aa5e73e30f931d Mon Sep 17 00:00:00 2001 From: "islam.galal" Date: Wed, 16 Aug 2017 12:54:13 +0200 Subject: [PATCH 09/14] SIB2-BR configuration parameters --- openair1/PHY/impl_defs_lte.h | 6 +++-- openair2/ENB_APP/enb_config.c | 19 +--------------- openair2/RRC/LITE/MESSAGES/asn1_msg.c | 1 - .../CONF/enb.band13.tm1.50PRB.emtc.conf | 22 +++++++++---------- 4 files changed, 16 insertions(+), 32 deletions(-) diff --git a/openair1/PHY/impl_defs_lte.h b/openair1/PHY/impl_defs_lte.h index fea33a7707..e11f8edb89 100755 --- a/openair1/PHY/impl_defs_lte.h +++ b/openair1/PHY/impl_defs_lte.h @@ -802,11 +802,13 @@ typedef struct { uint8_t harq_pid; /// Narrowband index uint8_t narrowband; + /// number of repetitions + uint8_t reps; /// number of PRB pairs for MPDCCH uint8_t number_of_prb_pairs; - /// mpdcch resource assignement (0=localized,1=distributed) + /// mpdcch resource assignement (combinatorial index r) uint8_t resource_block_assignment; - /// transmission type + /// transmission type (0=localized,1=distributed) uint8_t transmission_type; /// mpdcch start symbol uint8_t start_symbol; diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 6ec38b3bb9..b99aacbf23 100755 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -2830,7 +2830,7 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { if (setting_freq_hoppingParameters_r13 != NULL) { RRC_CONFIGURATION_REQ(msg_p).sib2_freq_hoppingParameters_r13_exists[j] = TRUE; - if (config_setting_lookup_int(setting_freq_hoppingParameters_r13, ENB_CONFIG_STRING_MPDCCH_PDSCH_HOPPING_NB_R13, sib2_mpdcch_pdsch_hoppingNB_r13)) + if (config_setting_lookup_int(setting_freq_hoppingParameters_r13, ENB_CONFIG_STRING_MPDCCH_PDSCH_HOPPING_NB_R13, &sib2_mpdcch_pdsch_hoppingNB_r13)) { RRC_CONFIGURATION_REQ(msg_p).sib2_mpdcch_pdsch_hoppingNB_r13[j] = CALLOC(1, sizeof(long)); @@ -2924,23 +2924,6 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { } - - - printf("[DEBUGGING][KOGO][CONF]: 0 = %d\n", RRC_CONFIGURATION_REQ(msg_p).sib2_freq_hoppingParameters_r13_exists[j]); - printf("[DEBUGGING][KOGO][CONF]: 1 = %d\n", *RRC_CONFIGURATION_REQ(msg_p).sib2_mpdcch_pdsch_hoppingNB_r13[j]); - - printf("[DEBUGGING][KOGO][CONF]: 2 = %d\n", *RRC_CONFIGURATION_REQ(msg_p).sib2_interval_DLHoppingConfigCommonModeA_r13[j]); - printf("[DEBUGGING][KOGO][CONF]: 3 = %d\n", RRC_CONFIGURATION_REQ(msg_p).sib2_interval_DLHoppingConfigCommonModeA_r13_val[j]); - printf("[DEBUGGING][KOGO][CONF]: 4 = %d\n", *RRC_CONFIGURATION_REQ(msg_p).sib2_interval_DLHoppingConfigCommonModeB_r13[j]); - printf("[DEBUGGING][KOGO][CONF]: 5 = %d\n", RRC_CONFIGURATION_REQ(msg_p).sib2_interval_DLHoppingConfigCommonModeB_r13_val[j]); - - printf("[DEBUGGING][KOGO][CONF]: 6 = %d\n", *RRC_CONFIGURATION_REQ(msg_p).sib2_interval_ULHoppingConfigCommonModeA_r13[j]); - printf("[DEBUGGING][KOGO][CONF]: 7 = %d\n", RRC_CONFIGURATION_REQ(msg_p).sib2_interval_ULHoppingConfigCommonModeA_r13_val[j]); - printf("[DEBUGGING][KOGO][CONF]: 8 = %d\n", *RRC_CONFIGURATION_REQ(msg_p).sib2_interval_ULHoppingConfigCommonModeB_r13[j]); - printf("[DEBUGGING][KOGO][CONF]: 9 = %d\n", RRC_CONFIGURATION_REQ(msg_p).sib2_interval_ULHoppingConfigCommonModeB_r13_val[j]); - - printf("[DEBUGGING][KOGO][CONF]: 10 = %d\n", *RRC_CONFIGURATION_REQ(msg_p).sib2_mpdcch_pdsch_hoppingNB_r13[j]); - // Rel8 RadioResourceConfigCommon Parameters if (!(config_setting_lookup_string(setting_br13, ENB_CONFIG_STRING_FRAME_TYPE, &frame_type) diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index 30b7ee8d79..e683cf86de 100755 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -1390,7 +1390,6 @@ uint8_t do_SIB23(uint8_t Mod_id, } PRACH_ParametersCE_r13_t *prach_parametersce_r13; - memset(prach_parametersce_r13, 0, sizeof(PRACH_ParametersCE_r13_t)); int num_prach_parameters_ce = configuration->prach_parameters_list_size[CC_id]; int prach_parameters_index; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf index 906c3cae30..c345d71db6 100755 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf @@ -121,7 +121,7 @@ eNBs = ( { si_Narrowband_r13 = 5; - si_TBS_r13 = 4; + si_TBS_r13 = 5; } ); si_WindowLength_BR_r13 = 0; @@ -207,18 +207,18 @@ eNBs = sib2_freq_hoppingParameters_r13 : { - sib2_mpdcch_pdsch_hoppingNB_r13 = 1; - sib2_interval_DLHoppingConfigCommonModeA_r13 = 2; # choice -> (0, FDD) (1, TDD) - sib2_interval_DLHoppingConfigCommonModeA_r13_val = 3; - sib2_interval_DLHoppingConfigCommonModeB_r13 = 4; # choice -> (0, FDD) (1, TDD) - sib2_interval_DLHoppingConfigCommonModeB_r13_val = 5; + sib2_mpdcch_pdsch_hoppingNB_r13 = 0; + sib2_interval_DLHoppingConfigCommonModeA_r13 = 0; # choice -> (0, FDD) (1, TDD) + sib2_interval_DLHoppingConfigCommonModeA_r13_val = 0; + sib2_interval_DLHoppingConfigCommonModeB_r13 = 0; # choice -> (0, FDD) (1, TDD) + sib2_interval_DLHoppingConfigCommonModeB_r13_val = 0; - sib2_interval_ULHoppingConfigCommonModeA_r13 = 6; # choice -> (0, FDD) (1, TDD) - sib2_interval_ULHoppingConfigCommonModeA_r13_val = 7; - sib2_interval_ULHoppingConfigCommonModeB_r13 = 8; # choice -> (0, FDD) (1, TDD) - sib2_interval_ULHoppingConfigCommonModeB_r13_val = 9; + sib2_interval_ULHoppingConfigCommonModeA_r13 = 0; # choice -> (0, FDD) (1, TDD) + sib2_interval_ULHoppingConfigCommonModeA_r13_val = 0; + sib2_interval_ULHoppingConfigCommonModeB_r13 = 0; # choice -> (0, FDD) (1, TDD) + sib2_interval_ULHoppingConfigCommonModeB_r13_val = 0; - sib2_mpdcch_pdsch_hoppingOffset_r13 = 10; + sib2_mpdcch_pdsch_hoppingOffset_r13 = 1; } From 91beb110f09e50792034b856ad662b2f7f17cf3e Mon Sep 17 00:00:00 2001 From: "islam.galal" Date: Wed, 16 Aug 2017 13:18:51 +0200 Subject: [PATCH 10/14] hard-coded PUSCH/PDSCH-Config-Common-v1310, harmonization of configuration file with eMTC config from samples of Verizon network --- openair2/RRC/LITE/MESSAGES/asn1_msg.c | 15 +++++- .../CONF/enb.band13.tm1.50PRB.emtc.conf | 48 +++++++++---------- 2 files changed, 37 insertions(+), 26 deletions(-) diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index e683cf86de..4e15cae695 100755 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -1332,8 +1332,17 @@ uint8_t do_SIB23(uint8_t Mod_id, (*sib2)->radioResourceConfigCommon.ext4->freqHoppingParameters_r13 = NULL; } - (*sib2)->radioResourceConfigCommon.ext4->pdsch_ConfigCommon_v1310 = NULL; - (*sib2)->radioResourceConfigCommon.ext4->pusch_ConfigCommon_v1310 = NULL; + (*sib2)->radioResourceConfigCommon.ext4->pdsch_ConfigCommon_v1310 = calloc(1,sizeof(PDSCH_ConfigCommon_v1310_t)); + (*sib2)->radioResourceConfigCommon.ext4->pdsch_ConfigCommon_v1310->pdsch_maxNumRepetitionCEmodeA_r13 = calloc(1,sizeof(long)); + *(*sib2)->radioResourceConfigCommon.ext4->pdsch_ConfigCommon_v1310->pdsch_maxNumRepetitionCEmodeA_r13 = 0; + (*sib2)->radioResourceConfigCommon.ext4->pdsch_ConfigCommon_v1310->pdsch_maxNumRepetitionCEmodeB_r13 = NULL; + + + (*sib2)->radioResourceConfigCommon.ext4->pusch_ConfigCommon_v1310 = calloc(1,sizeof(PUSCH_ConfigCommon_v1310_t)); + (*sib2)->radioResourceConfigCommon.ext4->pusch_ConfigCommon_v1310->pusch_maxNumRepetitionCEmodeA_r13 = calloc(1,sizeof(long)); + *(*sib2)->radioResourceConfigCommon.ext4->pusch_ConfigCommon_v1310->pusch_maxNumRepetitionCEmodeA_r13 = 0; + (*sib2)->radioResourceConfigCommon.ext4->pusch_ConfigCommon_v1310->pusch_maxNumRepetitionCEmodeB_r13 = NULL; + (*sib2)->radioResourceConfigCommon.ext4->pusch_ConfigCommon_v1310->pusch_HoppingOffset_v1310 = NULL; if (rrconfig->prach_ConfigCommon_v1310) { @@ -1456,6 +1465,8 @@ uint8_t do_SIB23(uint8_t Mod_id, { (*sib2)->radioResourceConfigCommon.ext4->prach_ConfigCommon_v1310 = NULL; } + + (*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310 = calloc(1, sizeof(PUCCH_ConfigCommon_v1310_t)); memset((*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310, 0, sizeof(PUCCH_ConfigCommon_v1310_t)); (*sib2)->radioResourceConfigCommon.ext4->pucch_ConfigCommon_v1310->n1PUCCH_AN_InfoList_r13 = calloc(1, sizeof(N1PUCCH_AN_InfoList_r13_t)); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf index c345d71db6..c5dac15266 100755 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf @@ -152,11 +152,11 @@ eNBs = rach_CE_LevelInfoList_r13 = ( { - firstPreamble_r13 = 0; + firstPreamble_r13 = 60; lastPreamble_r13 = 63; ra_ResponseWindowSize_r13 = 0; mac_ContentionResolutionTimer_r13 = 0; - rar_HoppingConfig_r13 = 0; + rar_HoppingConfig_r13 = 1; } ); @@ -166,7 +166,7 @@ eNBs = rsrp_range_list = ( { - rsrp_range_br = 60; + rsrp_range_br = 0; } ); @@ -175,27 +175,27 @@ eNBs = ( { prach_config_index_br = 3; - prach_freq_offset_br = 1; + prach_freq_offset_br = 2; prach_StartingSubframe_r13 = 0; - maxNumPreambleAttemptCE_r13 = 0; + maxNumPreambleAttemptCE_r13 = 6; numRepetitionPerPreambleAttempt_r13 = 0; mpdcch_NumRepetition_RA_r13 = 0; - prach_HoppingConfig_r13 = 0; - max_available_narrow_band = [5]; + prach_HoppingConfig_r13 = 1; + max_available_narrow_band = [2]; } ); n1PUCCH_AN_InfoList_r13 = ( { - pucch_info_value = 12; + pucch_info_value = 0; } ); pcch_config_v1310 : { - paging_narrowbands_r13 = 5; - mpdcch_numrepetition_paging_r13 = 2; + paging_narrowbands_r13 = 1; + mpdcch_numrepetition_paging_r13 = 0; nb_v1310 = 2; } @@ -207,32 +207,32 @@ eNBs = sib2_freq_hoppingParameters_r13 : { - sib2_mpdcch_pdsch_hoppingNB_r13 = 0; - sib2_interval_DLHoppingConfigCommonModeA_r13 = 0; # choice -> (0, FDD) (1, TDD) - sib2_interval_DLHoppingConfigCommonModeA_r13_val = 0; - sib2_interval_DLHoppingConfigCommonModeB_r13 = 0; # choice -> (0, FDD) (1, TDD) - sib2_interval_DLHoppingConfigCommonModeB_r13_val = 0; +# sib2_mpdcch_pdsch_hoppingNB_r13 = 0; +# sib2_interval_DLHoppingConfigCommonModeA_r13 = 0; # choice -> (0, FDD) (1, TDD) +# sib2_interval_DLHoppingConfigCommonModeA_r13_val = 0; +# sib2_interval_DLHoppingConfigCommonModeB_r13 = 0; # choice -> (0, FDD) (1, TDD) +# sib2_interval_DLHoppingConfigCommonModeB_r13_val = 0; sib2_interval_ULHoppingConfigCommonModeA_r13 = 0; # choice -> (0, FDD) (1, TDD) - sib2_interval_ULHoppingConfigCommonModeA_r13_val = 0; - sib2_interval_ULHoppingConfigCommonModeB_r13 = 0; # choice -> (0, FDD) (1, TDD) - sib2_interval_ULHoppingConfigCommonModeB_r13_val = 0; + sib2_interval_ULHoppingConfigCommonModeA_r13_val = 2; +# sib2_interval_ULHoppingConfigCommonModeB_r13 = 0; # choice -> (0, FDD) (1, TDD) +# sib2_interval_ULHoppingConfigCommonModeB_r13_val = 0; - sib2_mpdcch_pdsch_hoppingOffset_r13 = 1; +# sib2_mpdcch_pdsch_hoppingOffset_r13 = 1; } mpdcch_startSF_CSS_RA_r13 = "fdd-r13" - mpdcch_startSF_CSS_RA_r13_val = 5; - #prach_HoppingOffset_r13 = ; + mpdcch_startSF_CSS_RA_r13_val = 0; + prach_HoppingOffset_r13 = 0; - prach_root = 1; - prach_config_index = 0; + prach_root = 89; + prach_config_index = 3; prach_high_speed = "DISABLE"; prach_zero_correlation = 1; prach_freq_offset = 3; - pucch_delta_shift = 1; + pucch_delta_shift = 2; pucch_nRB_CQI = 1; pucch_nCS_AN = 0; pucch_n1_AN = 32; From 82cd728edbcdd1d15a5bce431307ecc9eb52ff18 Mon Sep 17 00:00:00 2001 From: "islam.galal" Date: Wed, 16 Aug 2017 13:40:04 +0200 Subject: [PATCH 11/14] small changes --- openair2/ENB_APP/enb_config.c | 2 +- openair2/RRC/LITE/MESSAGES/asn1_msg.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index b99aacbf23..23693f0958 100755 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -2786,7 +2786,7 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { if (config_setting_lookup_int(prach_parameters_ce_r13, ENB_CONFIG_STRING_MAX_NUM_PREAMBLE_ATTEMPT_CE_R13, &maxNumPreambleAttemptCE_r13)) { RRC_CONFIGURATION_REQ (msg_p).maxNumPreambleAttemptCE_r13[j][prach_parameters_index] = calloc(1, sizeof(long)); - RRC_CONFIGURATION_REQ (msg_p).maxNumPreambleAttemptCE_r13[j][prach_parameters_index] = maxNumPreambleAttemptCE_r13; + *RRC_CONFIGURATION_REQ (msg_p).maxNumPreambleAttemptCE_r13[j][prach_parameters_index] = maxNumPreambleAttemptCE_r13; } else { diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index 4e15cae695..9a1e2dd600 100755 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -1412,6 +1412,7 @@ uint8_t do_SIB23(uint8_t Mod_id, if (configuration->prach_StartingSubframe_r13[CC_id][prach_parameters_index]) { + prach_parametersce_r13->prach_StartingSubframe_r13 = CALLOC(1, sizeof(long)); *prach_parametersce_r13->prach_StartingSubframe_r13 = *configuration->prach_StartingSubframe_r13[CC_id][prach_parameters_index]; } else @@ -1421,6 +1422,7 @@ uint8_t do_SIB23(uint8_t Mod_id, if (configuration->maxNumPreambleAttemptCE_r13[CC_id][prach_parameters_index]) { + prach_parametersce_r13->maxNumPreambleAttemptCE_r13 = CALLOC(1, sizeof(long)); *prach_parametersce_r13->maxNumPreambleAttemptCE_r13 = *configuration->maxNumPreambleAttemptCE_r13[CC_id][prach_parameters_index]; } else From 4d6af687149223076c4676ecf49790a7875332b8 Mon Sep 17 00:00:00 2001 From: "islam.galal" Date: Wed, 16 Aug 2017 15:00:01 +0200 Subject: [PATCH 12/14] added edci.c and minor configuration changes --- cmake_targets/CMakeLists.txt | 2 +- openair1/PHY/LTE_TRANSPORT/edci.c | 122 ++++++++++++++++++ openair2/ENB_APP/enb_config.c | 8 +- openair2/RRC/LITE/MESSAGES/asn1_msg.c | 10 +- .../CONF/enb.band13.tm1.50PRB.emtc.conf | 22 ++-- 5 files changed, 143 insertions(+), 21 deletions(-) create mode 100755 openair1/PHY/LTE_TRANSPORT/edci.c diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index a48590ad55..d25a9a08a6 100755 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -222,7 +222,7 @@ add_definitions("-DPACKAGE_BUGREPORT=\"openair4g-devel@lists.eurecom.fr\"") # Debug related options ######################################### add_boolean_option(ASN_DEBUG False "ASN1 coder/decoder Debug") -add_boolean_option(EMIT_ASN_DEBUG False "ASN1 coder/decoder Debug") +add_boolean_option(EMIT_ASN_DEBUG False "ASN1 coder/decoder Debug") add_boolean_option(MSG_PRINT False "print debug messages") add_boolean_option(DISABLE_XER_PRINT False "print XER Format") add_boolean_option(XER_PRINT False "print XER Format") diff --git a/openair1/PHY/LTE_TRANSPORT/edci.c b/openair1/PHY/LTE_TRANSPORT/edci.c new file mode 100755 index 0000000000..2487e8370c --- /dev/null +++ b/openair1/PHY/LTE_TRANSPORT/edci.c @@ -0,0 +1,122 @@ +/* + * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The OpenAirInterface Software Alliance licenses this file to You under + * the OAI Public License, Version 1.0 (the "License"); you may not use this file + * except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.openairinterface.org/?page_id=698 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + *------------------------------------------------------------------------------- + * For more information about the OpenAirInterface (OAI) Software Alliance: + * contact@openairinterface.org + */ + +/*! \file PHY/LTE_TRANSPORT/dci.c +* \brief Implements PDCCH physical channel TX/RX procedures (36.211) and DCI encoding/decoding (36.212/36.213). Current LTE compliance V8.6 2009-03. +* \author R. Knopp +* \date 2011 +* \version 0.1 +* \company Eurecom +* \email: knopp@eurecom.fr +* \note +* \warning +*/ +#ifdef USER_MODE +#include +#include +#include +#endif +#include "PHY/defs.h" +#include "PHY/extern.h" +#include "SCHED/defs.h" +#include "SIMULATION/TOOLS/defs.h" // for taus +#include "PHY/sse_intrin.h" + +#include "assertions.h" +#include "T.h" +#include "UTIL/LOG/log.h" + +//#define DEBUG_DCI_ENCODING 1 +//#define DEBUG_DCI_DECODING 1 +//#define DEBUG_PHY + +typedef struct { + uint8_t num_dci; + mDCI_ALLOC_t mdci_alloc[32]; +} LTE_eNB_MPDCCH; + +typedef struct { + /// Length of DCI in bits + uint8_t dci_length; + /// Aggregation level + uint8_t L; + /// Position of first CCE of the dci + int firstCCE; + /// flag to indicate that this is a RA response + boolean_t ra_flag; + /// rnti + rnti_t rnti; + /// Format + DCI_format_t format; + /// harq process index + uint8_t harq_pid; + /// Narrowband index + uint8_t narrowband; + /// number of PRB pairs for MPDCCH + uint8_t number_of_prb_pairs; + /// mpdcch resource assignement (0=localized,1=distributed) + uint8_t resource_block_assignment; + /// transmission type + uint8_t transmission_type; + /// mpdcch start symbol + uint8_t start_symbol; + /// CE mode (1=ModeA,2=ModeB) + uint8_t ce_mode; + /// 0-503 n_EPDCCHid_i + uint16_t dmrs_scrambling_init; + /// Absolute subframe of the initial transmission (0-10239) + uint16_t initial_transmission_sf_io; + /// DCI pdu + uint8_t dci_pdu[8]; +} mDCI_ALLOC_t; + +void generate_edci_top(PHY_VARS_eNB *eNB, int frame, int subframe) { + +} + +void generate_mdci_top(PHY_VARS_eNB *eNB, int frame, int subframe) { + + LTE_eNB_MPDCCH *mpdcch= &eNB->mpdcch_vars[subframe&2]; + mDCI_ALLOC_t *mdci; + uint8_t e[DCI_BITS_MAX]; + + for (i=0;inum_dci;i++) { + mdci = &mdpcch->mdci_alloc[i]; + + // Assume 4 EREG/ECCE case (normal prefix) + AssertFatal(eNB->frame_parms.frame_type==FDD,"TDD is not yet supported for MPDCCH\n"); + + // 9 REs/EREG => 36 REs/ECCE => 72 bits/ECCE + generate_dci0(mdci->dci_pdu, + e+(72*mdci->firstCCE), + mdci_length, + mdci->L, + mdci->rnti); + + // compute MPDCCH format based on parameters from NFAPI + AssertFatal(mdci->reps>0,"mdci->reps==0\n"); + if (reps==0) { // table 6.8A.1-1 + AssertFatal(eNB->frame_parms->Ncp == NORMAL,"Extended Prefix not yet supported for MPDCCH\n"); + N_ECCE_EREG = 4; + } + + } +} diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 23693f0958..325dfceda7 100755 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -2461,7 +2461,7 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].ue_TimersAndConstants_t311= UE_TimersAndConstants__t311_ms1000; break; - case 3110: + case 3000: RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].ue_TimersAndConstants_t311= UE_TimersAndConstants__t311_ms3000; break; @@ -2481,7 +2481,7 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].ue_TimersAndConstants_t311= UE_TimersAndConstants__t311_ms20000; break; - case 31100: + case 30000: RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig[j].ue_TimersAndConstants_t311= UE_TimersAndConstants__t311_ms30000; break; @@ -3761,7 +3761,7 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[j].ue_TimersAndConstants_t311= UE_TimersAndConstants__t311_ms1000; break; - case 3110: + case 3000: RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[j].ue_TimersAndConstants_t311= UE_TimersAndConstants__t311_ms3000; break; @@ -3781,7 +3781,7 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[j].ue_TimersAndConstants_t311= UE_TimersAndConstants__t311_ms20000; break; - case 31100: + case 30000: RRC_CONFIGURATION_REQ (msg_p).radioresourceconfig_BR[j].ue_TimersAndConstants_t311= UE_TimersAndConstants__t311_ms30000; break; diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index 9a1e2dd600..f339c4182d 100755 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -1025,10 +1025,10 @@ uint8_t do_SIB23(uint8_t Mod_id, (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.ext1 = calloc(1, sizeof(struct RACH_ConfigCommon__ext1)); memset((*sib2)->radioResourceConfigCommon.rach_ConfigCommon.ext1, 0, sizeof(struct RACH_ConfigCommon__ext1)); - if (rrconfig->rach_maxHARQ_Msg3Tx) + if (rrconfig->preambleTransMax_CE_r13) { (*sib2)->radioResourceConfigCommon.rach_ConfigCommon.ext1->preambleTransMax_CE_r13 = calloc(1, sizeof(PreambleTransMax_t)); - *(*sib2)->radioResourceConfigCommon.rach_ConfigCommon.ext1->preambleTransMax_CE_r13 = rrconfig->rach_maxHARQ_Msg3Tx; // to be re-initialized when we find the enum + *(*sib2)->radioResourceConfigCommon.rach_ConfigCommon.ext1->preambleTransMax_CE_r13 = *rrconfig->preambleTransMax_CE_r13; // to be re-initialized when we find the enum } else { @@ -1176,9 +1176,9 @@ uint8_t do_SIB23(uint8_t Mod_id, // LTE-M - +Kogo (*sib2)->radioResourceConfigCommon.ext4 = calloc(1, sizeof(struct RadioResourceConfigCommonSIB__ext4)); memset((*sib2)->radioResourceConfigCommon.ext4, 0, sizeof(struct RadioResourceConfigCommonSIB__ext4)); - (*sib2)->radioResourceConfigCommon.ext4->bcch_Config_v1310 = calloc(1, sizeof(BCCH_Config_v1310_t)); - memset((*sib2)->radioResourceConfigCommon.ext4->bcch_Config_v1310, 0, sizeof(BCCH_Config_v1310_t)); - (*sib2)->radioResourceConfigCommon.ext4->bcch_Config_v1310->modificationPeriodCoeff_v1310 = BCCH_Config_v1310__modificationPeriodCoeff_v1310_n64; + (*sib2)->radioResourceConfigCommon.ext4->bcch_Config_v1310 = NULL; //calloc(1, sizeof(BCCH_Config_v1310_t)); + //memset((*sib2)->radioResourceConfigCommon.ext4->bcch_Config_v1310, 0, sizeof(BCCH_Config_v1310_t)); + //(*sib2)->radioResourceConfigCommon.ext4->bcch_Config_v1310->modificationPeriodCoeff_v1310 = BCCH_Config_v1310__modificationPeriodCoeff_v1310_n64; if (configuration->pcch_config_v1310) { diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf index c5dac15266..6b5e62f2c7 100755 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf @@ -146,7 +146,7 @@ eNBs = # SIB23 frame_type = "FDD"; - preambleTransMax_CE_r13 = 10; + preambleTransMax_CE_r13 = 6; # max 4 rach_CE_LevelInfoList_r13 = @@ -231,9 +231,9 @@ eNBs = prach_config_index = 3; prach_high_speed = "DISABLE"; prach_zero_correlation = 1; - prach_freq_offset = 3; - pucch_delta_shift = 2; - pucch_nRB_CQI = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 0; pucch_nCS_AN = 0; pucch_n1_AN = 32; pdsch_referenceSignalPower = -27; @@ -245,7 +245,7 @@ eNBs = pusch_groupHoppingEnabled = "ENABLE"; pusch_groupAssignment = 0; pusch_sequenceHoppingEnabled = "DISABLE"; - pusch_nDMRS1 = 1; + pusch_nDMRS1 = 0; phich_duration = "NORMAL"; phich_resource = "ONESIXTH"; srs_enable = "DISABLE"; @@ -258,7 +258,7 @@ eNBs = pucch_deltaF_Format2 = "deltaF0"; pucch_deltaF_Format2a = "deltaF0"; pucch_deltaF_Format2b = "deltaF0"; - rach_numberOfRA_Preambles = 64; + rach_numberOfRA_Preambles = 60; rach_preamblesGroupAConfig = "DISABLE"; rach_powerRampingStep = 4; rach_preambleInitialReceivedTargetPower = -108; @@ -270,11 +270,11 @@ eNBs = pcch_nB = "oneT"; bcch_modificationPeriodCoeff = 2; ue_TimersAndConstants_t300 = 1000; - ue_TimersAndConstants_t301 = 1000; - ue_TimersAndConstants_t310 = 1000; - ue_TimersAndConstants_t311 = 10000; - ue_TimersAndConstants_n310 = 20; - ue_TimersAndConstants_n311 = 1; + ue_TimersAndConstants_t301 = 400; + ue_TimersAndConstants_t310 = 50; + ue_TimersAndConstants_t311 = 30000; + ue_TimersAndConstants_n310 = 1; + ue_TimersAndConstants_n311 = 10; ue_TransmissionMode = 1; } From a0f2d4815e013c70b428da5597b58fd18aa5b89d Mon Sep 17 00:00:00 2001 From: "islam.galal" Date: Wed, 16 Aug 2017 16:17:40 +0200 Subject: [PATCH 13/14] eMTC modem receives SIB1 & SIB23 successfully --- openair2/ENB_APP/enb_config.c | 2 +- openair2/RRC/LITE/MESSAGES/asn1_msg.c | 32 +++++++++++++++---- .../CONF/enb.band13.tm1.50PRB.emtc.conf | 22 +++++++------ 3 files changed, 39 insertions(+), 17 deletions(-) diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 325dfceda7..26c0f51214 100755 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -4063,7 +4063,7 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { RRC_CONFIGURATION_REQ(msg_p).si_HoppingConfigCommon_r13[j] = si_HoppingConfigCommon_r13; RRC_CONFIGURATION_REQ(msg_p).startSymbolBR_r13[j] = startSymbolBR_r13; - if (config_setting_lookup_int(setting_br13, ENB_CONFIG_STRING_Q_QUALMINRSRQ_CE, &si_ValidityTime_r13)) + if (config_setting_lookup_int(setting_br13, ENB_CONFIG_STRING_SI_VALIDITYTIME, &si_ValidityTime_r13)) { RRC_CONFIGURATION_REQ(msg_p).si_ValidityTime_r13[j] = calloc(1, sizeof(long)); *RRC_CONFIGURATION_REQ(msg_p).si_ValidityTime_r13[j] = si_ValidityTime_r13; diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index f339c4182d..af2292d132 100755 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -608,10 +608,15 @@ uint8_t do_SIB1(rrc_eNB_carrier_data_t *carrier, else { sib1_1310->bandwidthReducedAccessRelatedInfo_r13->fdd_DownlinkOrTddSubframeBitmapBR_r13->present - = SystemInformationBlockType1_v1310_IEs__bandwidthReducedAccessRelatedInfo_r13__fdd_DownlinkOrTddSubframeBitmapBR_r13_PR_subframePattern10_r13; + = SystemInformationBlockType1_v1310_IEs__bandwidthReducedAccessRelatedInfo_r13__fdd_DownlinkOrTddSubframeBitmapBR_r13_PR_subframePattern40_r13; sib1_1310->bandwidthReducedAccessRelatedInfo_r13->fdd_DownlinkOrTddSubframeBitmapBR_r13->choice.subframePattern40_r13.buf = calloc(5, sizeof(uint8_t)); - memmove(sib1_1310->bandwidthReducedAccessRelatedInfo_r13->fdd_DownlinkOrTddSubframeBitmapBR_r13->choice.subframePattern40_r13.buf, &configuration->fdd_DownlinkOrTddSubframeBitmapBR_val_r13[CC_id], 5 * sizeof(uint8_t)); +// memmove(sib1_1310->bandwidthReducedAccessRelatedInfo_r13->fdd_DownlinkOrTddSubframeBitmapBR_r13->choice.subframePattern40_r13.buf, &configuration->fdd_DownlinkOrTddSubframeBitmapBR_val_r13[CC_id], 5 * sizeof(uint8_t)); + int bm_index; + for (bm_index = 0; bm_index < 5; bm_index++) + { + sib1_1310->bandwidthReducedAccessRelatedInfo_r13->fdd_DownlinkOrTddSubframeBitmapBR_r13->choice.subframePattern40_r13.buf[bm_index] = 0xFF; + } sib1_1310->bandwidthReducedAccessRelatedInfo_r13->fdd_DownlinkOrTddSubframeBitmapBR_r13->choice.subframePattern40_r13.size = 5; sib1_1310->bandwidthReducedAccessRelatedInfo_r13->fdd_DownlinkOrTddSubframeBitmapBR_r13->choice.subframePattern40_r13.bits_unused = 0; } @@ -647,6 +652,7 @@ uint8_t do_SIB1(rrc_eNB_carrier_data_t *carrier, sib1_1310->bandwidthReducedAccessRelatedInfo_r13->si_ValidityTime_r13 = calloc(1, sizeof(long)); memset(sib1_1310->bandwidthReducedAccessRelatedInfo_r13->si_ValidityTime_r13, 0, sizeof(long)); *sib1_1310->bandwidthReducedAccessRelatedInfo_r13->si_ValidityTime_r13 = *configuration->si_ValidityTime_r13[CC_id]; + printf("[DEBUGGING][KOGO]: si_validity time = %d\n", *sib1_1310->bandwidthReducedAccessRelatedInfo_r13->si_ValidityTime_r13); } else { @@ -1783,16 +1789,16 @@ uint8_t do_SIB23(uint8_t Mod_id, (*sib3)->cellReselectionInfoCommon.speedStateReselectionPars=NULL; - (*sib3)->cellReselectionServingFreqInfo.s_NonIntraSearch=NULL; - (*sib3)->cellReselectionServingFreqInfo.threshServingLow=31; - (*sib3)->cellReselectionServingFreqInfo.cellReselectionPriority=7; + (*sib3)->cellReselectionServingFreqInfo.s_NonIntraSearch = NULL; + (*sib3)->cellReselectionServingFreqInfo.threshServingLow = 0; + (*sib3)->cellReselectionServingFreqInfo.s_NonIntraSearch = 0; + (*sib3)->cellReselectionServingFreqInfo.cellReselectionPriority = 7; (*sib3)->intraFreqCellReselectionInfo.q_RxLevMin = -70; (*sib3)->intraFreqCellReselectionInfo.p_Max = NULL; (*sib3)->intraFreqCellReselectionInfo.s_IntraSearch = CALLOC(1,sizeof(*(*sib3)->intraFreqCellReselectionInfo.s_IntraSearch)); *(*sib3)->intraFreqCellReselectionInfo.s_IntraSearch = 31; (*sib3)->intraFreqCellReselectionInfo.allowedMeasBandwidth=CALLOC(1,sizeof(*(*sib3)->intraFreqCellReselectionInfo.allowedMeasBandwidth)); - *(*sib3)->intraFreqCellReselectionInfo.allowedMeasBandwidth = AllowedMeasBandwidth_mbw6; (*sib3)->intraFreqCellReselectionInfo.presenceAntennaPort1 = 0; @@ -1800,9 +1806,21 @@ uint8_t do_SIB23(uint8_t Mod_id, (*sib3)->intraFreqCellReselectionInfo.neighCellConfig.size = 1; (*sib3)->intraFreqCellReselectionInfo.neighCellConfig.buf[0] = 1; (*sib3)->intraFreqCellReselectionInfo.neighCellConfig.bits_unused = 6; - (*sib3)->intraFreqCellReselectionInfo.t_ReselectionEUTRA = 1; + (*sib3)->intraFreqCellReselectionInfo.t_ReselectionEUTRA = 2; (*sib3)->intraFreqCellReselectionInfo.t_ReselectionEUTRA_SF = (struct SpeedStateScaleFactors *)NULL; + (*sib3)->ext1 = CALLOC(1, sizeof(struct SystemInformationBlockType3__ext1)); + (*sib3)->ext1->s_IntraSearch_v920 = CALLOC(1, sizeof(struct SystemInformationBlockType3__ext1__s_IntraSearch_v920)); + (*sib3)->ext1->s_IntraSearch_v920->s_IntraSearchP_r9 = 31; // FIXME + (*sib3)->ext1->s_IntraSearch_v920->s_IntraSearchQ_r9 = 4; + + (*sib3)->ext4 = CALLOC(1, sizeof(struct SystemInformationBlockType3__ext4)); + (*sib3)->ext4->cellSelectionInfoCE_r13 = CALLOC(1, sizeof(CellSelectionInfoCE_r13_t)); + (*sib3)->ext4->cellSelectionInfoCE_r13->q_RxLevMinCE_r13 = -70; + (*sib3)->ext4->cellSelectionInfoCE_r13->q_QualMinRSRQ_CE_r13 = NULL; + (*sib3)->ext4->t_ReselectionEUTRA_CE_r13 = CALLOC(1, sizeof(T_ReselectionEUTRA_CE_r13_t)); + *(*sib3)->ext4->t_ReselectionEUTRA_CE_r13 = 2; + // SIB13 // fill in all elements of SIB13 if present #if defined(Rel10) || defined(Rel14) diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf index 6b5e62f2c7..7baa08b3be 100755 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf @@ -109,12 +109,16 @@ eNBs = # BR Parameters br_parameters : { + + fdd_DownlinkOrTddSubframeBitmapBR_r13 = "subframePattern40-r13"; + fdd_DownlinkOrTddSubframeBitmapBR_val_r13 = 0xFFFFFFFFFF; + #SIB1 schedulingInfoSIB1_BR_r13 = 4; - hyperSFN_r13 = 0; + #hyperSFN_r13 = 0; #eDRX_Allowed_r13 = 0; cellSelectionInfoCE_r13 = "ENABLE"; - q_RxLevMinCE_r13 = -50; + q_RxLevMinCE_r13 = -70; #q_QualMinRSRQ_CE_r13 = ; bandwidthReducedAccessRelatedInfo_r13 = "ENABLE" scheduling_info_br = @@ -129,12 +133,12 @@ eNBs = startSymbolBR_r13 = 3; si_HoppingConfigCommon_r13 = 1; # Note: 1==OFF ! si_ValidityTime_r13 = 0; - system_info_value_tag_SI = - ( - { - systemInfoValueTagSi_r13 = 0; - } - ); + #system_info_value_tag_SI = + #( + # { + # systemInfoValueTagSi_r13 = 0; + # } + #); freqHoppingParametersDL_r13 = "DISABLE" mpdcch_pdsch_HoppingNB_r13 = 0; interval_DLHoppingConfigCommonModeA_r13 = "interval-FDD-r13" @@ -196,7 +200,7 @@ eNBs = { paging_narrowbands_r13 = 1; mpdcch_numrepetition_paging_r13 = 0; - nb_v1310 = 2; + #nb_v1310 = 2; } From 1ca5c8c40588c41cb5baa18701be07ae9130237f Mon Sep 17 00:00:00 2001 From: "islam.galal" Date: Wed, 16 Aug 2017 18:58:15 +0200 Subject: [PATCH 14/14] fixing prach configurations --- openair1/PHY/INIT/lte_init.c | 6 +- openair1/PHY/LTE_TRANSPORT/prach.c | 48 ++++++--- openair1/SCHED/phy_procedures_lte_eNb.c | 6 +- openair2/ENB_APP/enb_config.c | 2 +- openair2/LAYER2/MAC/config.c | 20 ++-- openair2/RRC/LITE/MESSAGES/asn1_msg.c | 102 ++++++++---------- openair2/RRC/LITE/rrc_eNB.c | 18 ++++ .../CONF/enb.band13.tm1.50PRB.emtc.conf | 6 +- 8 files changed, 123 insertions(+), 85 deletions(-) diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c index 4c68021325..914d5de51e 100755 --- a/openair1/PHY/INIT/lte_init.c +++ b/openair1/PHY/INIT/lte_init.c @@ -192,7 +192,11 @@ void phy_config_request(PHY_Config_t *phy_config) { fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0] = cfg->emtc_config.prach_ce_level_0_starting_subframe_periodicity.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0] = cfg->emtc_config.prach_ce_level_0_number_of_repetitions_per_attempt.value; AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0]>=fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0], - "prach_starting_subframe_periodicity[0] < prach_numPetitionPerPreambleAttempt[0]\n"); + "prach_starting_subframe_periodicity[0] %d < prach_numPetitionPerPreambleAttempt[0] %d\n", + fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0], + fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]); + AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0] > 0, + "prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]==0\n"); fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[0] = cfg->emtc_config.prach_ce_level_0_configuration_index.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[0] = cfg->emtc_config.prach_ce_level_0_frequency_offset.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[0] = cfg->emtc_config.prach_ce_level_0_hopping_enable.value; diff --git a/openair1/PHY/LTE_TRANSPORT/prach.c b/openair1/PHY/LTE_TRANSPORT/prach.c index e616741e13..19a8924863 100755 --- a/openair1/PHY/LTE_TRANSPORT/prach.c +++ b/openair1/PHY/LTE_TRANSPORT/prach.c @@ -1117,6 +1117,7 @@ void rx_prach0(PHY_VARS_eNB *eNB, uint8_t restricted_set; uint8_t n_ra_prb; + int frame; int subframe; int16_t *prachF=NULL; int16_t **rxsigF=NULL; @@ -1152,9 +1153,9 @@ void rx_prach0(PHY_VARS_eNB *eNB, #ifdef Rel14 int prach_ifft_cnt=0; #endif -#ifdef PRACH_DEBUG + //#ifdef PRACH_DEBUG int en,en0=0; -#endif + //#endif if (ru) { fp = &ru->frame_parms; @@ -1204,17 +1205,27 @@ void rx_prach0(PHY_VARS_eNB *eNB, #ifdef Rel14 if (br_flag == 1) { prach_ifftp = eNB->prach_vars_br.prach_ifft[ce_level]; + frame = eNB->proc.frame_prach_br; subframe = eNB->proc.subframe_prach_br; prachF = eNB->prach_vars_br.prachF; rxsigF = eNB->prach_vars_br.rxsigF; + if ((frame&1023) < 20) LOG_I(PHY,"PRACH (eNB) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d, rootSequenceIndex %d, repetition number %d,numRepetitionsPrePreambleAttempt %d\n", + br_flag,ce_level,frame,subframe, + fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level], + prach_ConfigIndex,rootSequenceIndex, + eNB->prach_vars_br.repetition_number[ce_level], + fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[ce_level]); } else #endif { prach_ifftp = eNB->prach_vars.prach_ifft[0]; + frame = eNB->proc.frame_prach; subframe = eNB->proc.subframe_prach; prachF = eNB->prach_vars.prachF; rxsigF = eNB->prach_vars.rxsigF; + if ((frame&1023) < 20) LOG_I(PHY,"PRACH (eNB) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d , rootSequenceIndex %d\n", + subframe,fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex,rootSequenceIndex); } } else { @@ -1222,16 +1233,17 @@ void rx_prach0(PHY_VARS_eNB *eNB, if (br_flag == 1) { subframe = ru->proc.subframe_prach_br; rxsigF = ru->prach_rxsigF_br[ce_level]; - LOG_D(PHY,"PRACH (RU) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n", - subframe,fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level],prach_ConfigIndex); + if ((frame&1023) < 20) LOG_I(PHY,"PRACH (RU) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n", + br_flag,ce_level,frame,subframe,fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level],prach_ConfigIndex); } else #endif { subframe = ru->proc.subframe_prach; rxsigF = ru->prach_rxsigF; - LOG_D(PHY,"PRACH (RU) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n", + if ((frame&1023) < 20) LOG_I(PHY,"PRACH (RU) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n", subframe,fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex); + } } @@ -1241,9 +1253,9 @@ void rx_prach0(PHY_VARS_eNB *eNB, for (aa=0; aaif_south == LOCAL_RF) { // set the time-domain signal if we have to use it in this node prach[aa] = (int16_t*)&ru->common.rxdata[aa][(subframe*fp->samples_per_tti)-ru->N_TA_offset]; -#ifdef PRACH_DEBUG - LOG_D(PHY,"RU %d, subframe %d, : prach %p (energy %d)\n",ru->idx,subframe,prach[aa],dB_fixed(en0=signal_energy(prach[aa],fp->samples_per_tti))); -#endif + //#ifdef PRACH_DEBUG + if ((frame&1023) < 20) LOG_I(PHY,"RU %d, br_flag %d ce_level %d frame %d subframe %d, : prach %p (energy %d)\n",ru->idx,br_flag,ce_level,frame,subframe,prach[aa],dB_fixed(en0=signal_energy(prach[aa],fp->samples_per_tti))); + //#endif } } @@ -1467,11 +1479,11 @@ void rx_prach0(PHY_VARS_eNB *eNB, } else if (eNB!=NULL) { -#if 0 + //#if 0 en = dB_fixed(signal_energy(&rxsigF[0][0],840)); /*if (en>60)*/ - printf("PRACH: Frame %d, Subframe %d => %d dB\n",eNB->proc.frame_rx,eNB->proc.subframe_rx,en); -#endif + if ((frame&1023) < 20) LOG_I(PHY,"PRACH (br_flag %d,ce_level %d): Frame %d, Subframe %d => %d dB\n",br_flag,ce_level,eNB->proc.frame_rx,eNB->proc.subframe_rx,en); + //#endif } @@ -1506,6 +1518,9 @@ void rx_prach0(PHY_VARS_eNB *eNB, *max_preamble_energy=0; for (preamble_index=0 ; preamble_index<64 ; preamble_index++) { + + if (en>60) LOG_I(PHY,"frame %d, subframe %d : Trying preamble %d (br_flag %d)\n",frame,subframe,preamble_index,br_flag); + if (restricted_set == 0) { // This is the relative offset in the root sequence table (5.7.2-4 from 36.211) for the given preamble index preamble_offset = ((NCS==0)? preamble_index : (preamble_index/(N_ZC/NCS))); @@ -1588,9 +1603,10 @@ void rx_prach0(PHY_VARS_eNB *eNB, } // Compute DFT of RX signal (conjugate input, results in conjugate output) for each new rootSequenceIndex -#ifdef PRACH_DEBUG - LOG_I(PHY,"preamble index %d: offset %d, preamble shift %d\n",preamble_index,preamble_offset,preamble_shift); -#endif + //#ifdef PRACH_DEBUG + if (en>60) LOG_I(PHY,"frame %d, subframe %d : preamble index %d: offset %d, preamble shift %d (br_flag %d, en %d)\n", + frame,subframe,preamble_index,preamble_offset,preamble_shift,br_flag,en); + //#endif log2_ifft_size = 10; fft_size = 6144; @@ -1678,6 +1694,8 @@ void rx_prach0(PHY_VARS_eNB *eNB, eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[ce_level])) #endif { + if (en>60) LOG_I(PHY,"frame %d, subframe %d: Checking for peak in time-domain (br_flag %d, en %d)\n",frame,subframe,br_flag,en); + preamble_shift2 = ((preamble_shift==0) ? 0 : ((preamble_shift<>log2_ifft_size)*update_TA/update_TA2; *max_preamble = preamble_index; + if (en>60) LOG_I(PHY,"frame %d, subframe %d : max_preamble_energy %d, max_preamble_delay %d, max_preamble %d (br_flag %d, en %d)\n",frame,subframe,*max_preamble_energy,*max_preamble_delay,*max_preamble,br_flag,en); } } + } }// preamble_index diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index e350cf14c3..201c534e34 100755 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -715,7 +715,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, int i; if (frame < 20) { - LOG_I(PHY, + LOG_D(PHY, "[eNB %"PRIu8"][PDSCH %"PRIx16"/%"PRIu8"] Frame %d, subframe %d: Generating PDSCH/DLSCH with input size = %"PRIu16", pdsch_start %d, G %d, nb_rb %"PRIu16", rb0 %x, rb1 %x, TBS %"PRIu16", pmi_alloc %"PRIx64", rv %"PRIu8" (round %"PRIu8")\n", eNB->Mod_id, dlsch->rnti,harq_pid, frame, subframe, input_buffer_length, dlsch_harq->pdsch_start, @@ -735,8 +735,6 @@ void pdsch_procedures(PHY_VARS_eNB *eNB, pmi2hex_2Ar1(dlsch_harq->pmi_alloc), dlsch_harq->rvidx, dlsch_harq->round); - for (i=0;iTBS>>3;i++) printf("%x.",dlsch_harq->pdu[i]); - printf("\n"); } #if defined(MESSAGE_CHART_GENERATOR_PHY) MSC_LOG_TX_MESSAGE( @@ -2018,6 +2016,8 @@ void prach_procedures(PHY_VARS_eNB *eNB, } } + if ((frame&1023) < 20) LOG_I(PHY,"Frame %d, subframe %d: Running rx_prach (br_flag %d)\n", + frame,subframe,br_flag); rx_prach(eNB, eNB->RU_list[0], &max_preamble[0], diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 26c0f51214..cd01541f6d 100755 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -2776,7 +2776,7 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { if (config_setting_lookup_int(prach_parameters_ce_r13, ENB_CONFIG_STRING_PRACH_STARTING_SUBFRAME_R13, &prach_StartingSubframe_r13)) { RRC_CONFIGURATION_REQ (msg_p).prach_StartingSubframe_r13[j][prach_parameters_index] = calloc(1, sizeof(long)); - RRC_CONFIGURATION_REQ (msg_p).prach_StartingSubframe_r13[j][prach_parameters_index] = prach_StartingSubframe_r13; + *RRC_CONFIGURATION_REQ (msg_p).prach_StartingSubframe_r13[j][prach_parameters_index] = prach_StartingSubframe_r13; } else { diff --git a/openair2/LAYER2/MAC/config.c b/openair2/LAYER2/MAC/config.c index 4646c12580..2084a6046b 100755 --- a/openair2/LAYER2/MAC/config.c +++ b/openair2/LAYER2/MAC/config.c @@ -339,15 +339,16 @@ void config_sib2(int Mod_idP, cfg->emtc_config.prach_ce_level_1_enable.value=0; cfg->emtc_config.prach_ce_level_2_enable.value=0; cfg->emtc_config.prach_ce_level_3_enable.value=0; + switch (prach_ParametersListCE_r13->list.count) { case 4: p=prach_ParametersListCE_r13->list.array[3]; cfg->emtc_config.prach_ce_level_3_enable.value = 1; cfg->emtc_config.prach_ce_level_3_configuration_index.value = p->prach_ConfigIndex_r13; cfg->emtc_config.prach_ce_level_3_frequency_offset.value = p->prach_FreqOffset_r13; - cfg->emtc_config.prach_ce_level_3_number_of_repetitions_per_attempt.value = p->numRepetitionPerPreambleAttempt_r13; + cfg->emtc_config.prach_ce_level_3_number_of_repetitions_per_attempt.value = 1<numRepetitionPerPreambleAttempt_r13; if (p->prach_StartingSubframe_r13) - cfg->emtc_config.prach_ce_level_3_starting_subframe_periodicity.value = *p->prach_StartingSubframe_r13; + cfg->emtc_config.prach_ce_level_3_starting_subframe_periodicity.value = 2<<*p->prach_StartingSubframe_r13; cfg->emtc_config.prach_ce_level_3_hopping_enable.value = p->prach_HoppingConfig_r13; cfg->emtc_config.prach_ce_level_3_hopping_offset.value = cfg->rf_config.ul_channel_bandwidth.value-6; case 3: @@ -355,9 +356,9 @@ void config_sib2(int Mod_idP, cfg->emtc_config.prach_ce_level_2_enable.value = 1; cfg->emtc_config.prach_ce_level_2_configuration_index.value = p->prach_ConfigIndex_r13; cfg->emtc_config.prach_ce_level_2_frequency_offset.value = p->prach_FreqOffset_r13; - cfg->emtc_config.prach_ce_level_2_number_of_repetitions_per_attempt.value = p->numRepetitionPerPreambleAttempt_r13; + cfg->emtc_config.prach_ce_level_2_number_of_repetitions_per_attempt.value = 1<numRepetitionPerPreambleAttempt_r13; if (p->prach_StartingSubframe_r13) - cfg->emtc_config.prach_ce_level_2_starting_subframe_periodicity.value = *p->prach_StartingSubframe_r13; + cfg->emtc_config.prach_ce_level_2_starting_subframe_periodicity.value = 2<<*p->prach_StartingSubframe_r13; cfg->emtc_config.prach_ce_level_2_hopping_enable.value = p->prach_HoppingConfig_r13; cfg->emtc_config.prach_ce_level_2_hopping_offset.value = cfg->rf_config.ul_channel_bandwidth.value-6; case 2: @@ -365,9 +366,9 @@ void config_sib2(int Mod_idP, cfg->emtc_config.prach_ce_level_1_enable.value = 1; cfg->emtc_config.prach_ce_level_1_configuration_index.value = p->prach_ConfigIndex_r13; cfg->emtc_config.prach_ce_level_1_frequency_offset.value = p->prach_FreqOffset_r13; - cfg->emtc_config.prach_ce_level_1_number_of_repetitions_per_attempt.value = p->numRepetitionPerPreambleAttempt_r13; + cfg->emtc_config.prach_ce_level_1_number_of_repetitions_per_attempt.value = 1<numRepetitionPerPreambleAttempt_r13; if (p->prach_StartingSubframe_r13) - cfg->emtc_config.prach_ce_level_1_starting_subframe_periodicity.value = *p->prach_StartingSubframe_r13; + cfg->emtc_config.prach_ce_level_1_starting_subframe_periodicity.value = 2<<*p->prach_StartingSubframe_r13; cfg->emtc_config.prach_ce_level_1_hopping_enable.value = p->prach_HoppingConfig_r13; cfg->emtc_config.prach_ce_level_1_hopping_offset.value = cfg->rf_config.ul_channel_bandwidth.value-6; case 1: @@ -375,13 +376,16 @@ void config_sib2(int Mod_idP, cfg->emtc_config.prach_ce_level_0_enable.value = 1; cfg->emtc_config.prach_ce_level_0_configuration_index.value = p->prach_ConfigIndex_r13; cfg->emtc_config.prach_ce_level_0_frequency_offset.value = p->prach_FreqOffset_r13; - cfg->emtc_config.prach_ce_level_0_number_of_repetitions_per_attempt.value = p->numRepetitionPerPreambleAttempt_r13; + cfg->emtc_config.prach_ce_level_0_number_of_repetitions_per_attempt.value = 1<numRepetitionPerPreambleAttempt_r13; + AssertFatal(p->prach_StartingSubframe_r13!=NULL,"prach_StartingSubframe_r13 is null\n"); if (p->prach_StartingSubframe_r13) - cfg->emtc_config.prach_ce_level_0_starting_subframe_periodicity.value = *p->prach_StartingSubframe_r13; + cfg->emtc_config.prach_ce_level_0_starting_subframe_periodicity.value = 2<<*p->prach_StartingSubframe_r13; cfg->emtc_config.prach_ce_level_0_hopping_enable.value = p->prach_HoppingConfig_r13; cfg->emtc_config.prach_ce_level_0_hopping_offset.value = cfg->rf_config.ul_channel_bandwidth.value-6; } + AssertFatal(cfg->emtc_config.prach_ce_level_0_enable.value>0,"CE_level0 is not enabled\n"); + struct FreqHoppingParameters_r13 *ext4_freqHoppingParameters = radioResourceConfigCommonP->ext4->freqHoppingParameters_r13; if ((ext4_freqHoppingParameters) && (ext4_freqHoppingParameters->interval_ULHoppingConfigCommonModeA_r13)){ diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index af2292d132..e48db1d483 100755 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -1408,66 +1408,58 @@ uint8_t do_SIB23(uint8_t Mod_id, int num_prach_parameters_ce = configuration->prach_parameters_list_size[CC_id]; int prach_parameters_index; + AssertFatal(num_prach_parameters_ce > 0, "PRACH CE parameter list is empty\n"); + for (prach_parameters_index = 0; prach_parameters_index < num_prach_parameters_ce; ++prach_parameters_index) { - prach_parametersce_r13 = CALLOC(1, sizeof(PRACH_ParametersCE_r13_t)); - if (configuration->prach_parameters_list_size[CC_id]) + prach_parametersce_r13 = CALLOC(1, sizeof(PRACH_ParametersCE_r13_t)); + + prach_parametersce_r13->prach_ConfigIndex_r13 = configuration->prach_config_index[CC_id][prach_parameters_index]; + prach_parametersce_r13->prach_FreqOffset_r13 = configuration->prach_freq_offset[CC_id][prach_parameters_index]; + + AssertFatal(configuration->prach_StartingSubframe_r13[CC_id][prach_parameters_index]!=NULL, + "configuration->prach_StartingSubframe_r13[%d][%d] is null", + (int)CC_id,(int)prach_parameters_index); + if (configuration->prach_StartingSubframe_r13[CC_id][prach_parameters_index]) + { + prach_parametersce_r13->prach_StartingSubframe_r13 = CALLOC(1, sizeof(long)); + *prach_parametersce_r13->prach_StartingSubframe_r13 = *configuration->prach_StartingSubframe_r13[CC_id][prach_parameters_index]; + } + else + { + prach_parametersce_r13->prach_StartingSubframe_r13 = NULL; + } + + if (configuration->maxNumPreambleAttemptCE_r13[CC_id][prach_parameters_index]) + { + prach_parametersce_r13->maxNumPreambleAttemptCE_r13 = CALLOC(1, sizeof(long)); + *prach_parametersce_r13->maxNumPreambleAttemptCE_r13 = *configuration->maxNumPreambleAttemptCE_r13[CC_id][prach_parameters_index]; + } + else + { + prach_parametersce_r13->maxNumPreambleAttemptCE_r13 = NULL; + } + + prach_parametersce_r13->numRepetitionPerPreambleAttempt_r13 = configuration->numRepetitionPerPreambleAttempt_r13[CC_id][prach_parameters_index]; + prach_parametersce_r13->mpdcch_NumRepetition_RA_r13 = configuration->mpdcch_NumRepetition_RA_r13[CC_id][prach_parameters_index]; + prach_parametersce_r13->prach_HoppingConfig_r13 = configuration->prach_HoppingConfig_r13[CC_id][prach_parameters_index]; + printf("[DEBUGGING][KOGO][SIB23] : prach hopping config = %d\n", prach_parametersce_r13->prach_HoppingConfig_r13); + + + long *maxavailablenarrowband; + int num_narrow_bands = configuration->max_available_narrow_band_size[CC_id][prach_parameters_index]; + int narrow_band_index; + for (narrow_band_index = 0; narrow_band_index < num_narrow_bands; narrow_band_index++) { - prach_parametersce_r13->prach_ConfigIndex_r13 = configuration->prach_config_index[CC_id][prach_parameters_index]; - prach_parametersce_r13->prach_FreqOffset_r13 = configuration->prach_freq_offset[CC_id][prach_parameters_index]; - - if (configuration->prach_StartingSubframe_r13[CC_id][prach_parameters_index]) - { - prach_parametersce_r13->prach_StartingSubframe_r13 = CALLOC(1, sizeof(long)); - *prach_parametersce_r13->prach_StartingSubframe_r13 = *configuration->prach_StartingSubframe_r13[CC_id][prach_parameters_index]; - } - else - { - prach_parametersce_r13->prach_StartingSubframe_r13 = NULL; - } - - if (configuration->maxNumPreambleAttemptCE_r13[CC_id][prach_parameters_index]) - { - prach_parametersce_r13->maxNumPreambleAttemptCE_r13 = CALLOC(1, sizeof(long)); - *prach_parametersce_r13->maxNumPreambleAttemptCE_r13 = *configuration->maxNumPreambleAttemptCE_r13[CC_id][prach_parameters_index]; - } - else - { - prach_parametersce_r13->maxNumPreambleAttemptCE_r13 = NULL; - } - - prach_parametersce_r13->numRepetitionPerPreambleAttempt_r13 = configuration->numRepetitionPerPreambleAttempt_r13[CC_id][prach_parameters_index]; - prach_parametersce_r13->mpdcch_NumRepetition_RA_r13 = configuration->mpdcch_NumRepetition_RA_r13[CC_id][prach_parameters_index]; - prach_parametersce_r13->prach_HoppingConfig_r13 = configuration->prach_HoppingConfig_r13[CC_id][prach_parameters_index]; - printf("[DEBUGGING][KOGO][SIB23] : prach hopping config = %d\n", prach_parametersce_r13->prach_HoppingConfig_r13); + maxavailablenarrowband = CALLOC(1, sizeof(long)); + *maxavailablenarrowband = configuration->max_available_narrow_band[CC_id][prach_parameters_index][narrow_band_index]; + ASN_SEQUENCE_ADD(&prach_parametersce_r13->mpdcch_NarrowbandsToMonitor_r13.list, maxavailablenarrowband); } - else - { - prach_parametersce_r13->prach_ConfigIndex_r13 = 3; - prach_parametersce_r13->prach_FreqOffset_r13 = 1; - prach_parametersce_r13->prach_StartingSubframe_r13 = NULL; - *prach_parametersce_r13->maxNumPreambleAttemptCE_r13 = calloc(1, sizeof(long)); - *prach_parametersce_r13->maxNumPreambleAttemptCE_r13 = PRACH_ParametersCE_r13__maxNumPreambleAttemptCE_r13_n3; - prach_parametersce_r13->numRepetitionPerPreambleAttempt_r13 = PRACH_ParametersCE_r13__numRepetitionPerPreambleAttempt_r13_n1; - prach_parametersce_r13->mpdcch_NumRepetition_RA_r13 = PRACH_ParametersCE_r13__mpdcch_NumRepetition_RA_r13_r1; - prach_parametersce_r13->prach_HoppingConfig_r13 = PRACH_ParametersCE_r13__prach_HoppingConfig_r13_off; - } - - long *maxavailablenarrowband; - int num_narrow_bands = configuration->max_available_narrow_band_size[CC_id][prach_parameters_index]; - int narrow_band_index; - for (narrow_band_index = 0; narrow_band_index < num_narrow_bands; narrow_band_index++) - { - maxavailablenarrowband = CALLOC(1, sizeof(long)); - *maxavailablenarrowband = configuration->max_available_narrow_band[CC_id][prach_parameters_index][narrow_band_index]; - ASN_SEQUENCE_ADD(&prach_parametersce_r13->mpdcch_NarrowbandsToMonitor_r13.list, maxavailablenarrowband); - } - - prach_parametersce_r13->mpdcch_NumRepetition_RA_r13 = PRACH_ParametersCE_r13__mpdcch_NumRepetition_RA_r13_r1; - prach_parametersce_r13->prach_HoppingConfig_r13 = PRACH_ParametersCE_r13__prach_HoppingConfig_r13_off; - ASN_SEQUENCE_ADD(&(*sib2)->radioResourceConfigCommon.ext4->prach_ConfigCommon_v1310->prach_ParametersListCE_r13.list, prach_parametersce_r13); + + prach_parametersce_r13->mpdcch_NumRepetition_RA_r13 = PRACH_ParametersCE_r13__mpdcch_NumRepetition_RA_r13_r1; + prach_parametersce_r13->prach_HoppingConfig_r13 = PRACH_ParametersCE_r13__prach_HoppingConfig_r13_off; + ASN_SEQUENCE_ADD(&(*sib2)->radioResourceConfigCommon.ext4->prach_ConfigCommon_v1310->prach_ParametersListCE_r13.list, prach_parametersce_r13); } - } else { diff --git a/openair2/RRC/LITE/rrc_eNB.c b/openair2/RRC/LITE/rrc_eNB.c index 29c2967004..56ce6ded6d 100755 --- a/openair2/RRC/LITE/rrc_eNB.c +++ b/openair2/RRC/LITE/rrc_eNB.c @@ -333,6 +333,24 @@ init_SI( sib1_v13ext = RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sib1_BR->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension; + // Basic Asserts for CE_level0 PRACH configuration + + RadioResourceConfigCommonSIB_t *radioResourceConfigCommon_BR = &RC.rrc[ctxt_pP->module_id]->carrier[CC_id].sib2_BR->radioResourceConfigCommon; + struct PRACH_ConfigSIB_v1310 *ext4_prach=radioResourceConfigCommon_BR->ext4->prach_ConfigCommon_v1310; + + PRACH_ParametersListCE_r13_t *prach_ParametersListCE_r13 = &ext4_prach->prach_ParametersListCE_r13; + AssertFatal(prach_ParametersListCE_r13->list.count>0,"prach_ParametersListCE_r13 is empty\n"); + PRACH_ParametersCE_r13_t *p = prach_ParametersListCE_r13->list.array[0]; + AssertFatal(p->prach_StartingSubframe_r13 != NULL, "prach_StartingSubframe_r13 celevel0 is null\n"); + AssertFatal((1<numRepetitionPerPreambleAttempt_r13)<=(2<<*p->prach_StartingSubframe_r13), + "prachce0->numReptitionPerPreambleAttempt_r13 %d > prach_StartingSubframe_r13 %d\n", + 1<numRepetitionPerPreambleAttempt_r13, + 2<<*p->prach_StartingSubframe_r13); + + + + + } #endif diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf index 7baa08b3be..6ba66784e4 100755 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band13.tm1.50PRB.emtc.conf @@ -48,7 +48,7 @@ eNBs = prach_config_index = 0; prach_high_speed = "DISABLE"; prach_zero_correlation = 1; - prach_freq_offset = 2; + prach_freq_offset = 1; pucch_delta_shift = 1; pucch_nRB_CQI = 1; pucch_nCS_AN = 0; @@ -179,7 +179,7 @@ eNBs = ( { prach_config_index_br = 3; - prach_freq_offset_br = 2; + prach_freq_offset_br = 1; prach_StartingSubframe_r13 = 0; maxNumPreambleAttemptCE_r13 = 6; numRepetitionPerPreambleAttempt_r13 = 0; @@ -235,7 +235,7 @@ eNBs = prach_config_index = 3; prach_high_speed = "DISABLE"; prach_zero_correlation = 1; - prach_freq_offset = 2; + prach_freq_offset = 1; pucch_delta_shift = 1; pucch_nRB_CQI = 0; pucch_nCS_AN = 0;