From 6e33fcfe28eeed78dc8b97d009fc7f6ffb9b77d7 Mon Sep 17 00:00:00 2001 From: Francesco Mani Date: Mon, 11 Mar 2019 10:54:20 +0100 Subject: [PATCH] SSB periodicity at gNB from config file --- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 2 +- openair2/LAYER2/NR_MAC_gNB/config.c | 27 +++++++++++++++++++ openair2/LAYER2/NR_MAC_gNB/mac_proto.h | 3 ++- openair2/RRC/NR/rrc_gNB.c | 2 +- .../gnb.band22.tm1.106PRB.adrv9371zc706.conf | 2 +- .../CONF/gnb.band78.tm1.106PRB.usrpn300.conf | 2 +- .../CONF/gnb.band78.tm1.106PRB.usrpx300.conf | 2 +- .../CONF/gnb.band78.tm1.217PRB.usrpn300.conf | 2 +- 8 files changed, 35 insertions(+), 7 deletions(-) diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index c23af9c4ea..cd25ebc15a 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -91,7 +91,7 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot) { uint8_t *pbch_pdu=&gNB->pbch_pdu[0]; uint8_t ssb_index, n_hf; int ssb_start_symbol, rel_slot; - printf("Frame %d\n",frame); + n_hf = cfg->sch_config.half_frame_index.value; // if SSB periodicity is 5ms, they are transmitted in both half frames diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index d48e8f013e..a12981dafa 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -187,6 +187,7 @@ void config_common(int Mod_idP, int cellid, int nr_bandP, uint64_t ssb_pattern, + uint16_t ssb_periodicity, uint64_t dl_CarrierFreqP, uint32_t dl_BandwidthP ){ @@ -242,6 +243,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, int p_gNB, int nr_bandP, uint64_t ssb_pattern, + uint16_t ssb_enum_periodicity, uint64_t dl_CarrierFreqP, int dl_BandwidthP, NR_BCCH_BCH_Message_t *mib, @@ -249,6 +251,30 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, ){ + uint16_t ssb_periodicity; + + switch (ssb_enum_periodicity) { + case 0: + ssb_periodicity = 5; + break; + case 1: + ssb_periodicity = 10; + break; + case 2: + ssb_periodicity = 20; + break; + case 3: + ssb_periodicity = 40; + break; + case 4: + ssb_periodicity = 80; + break; + case 5: + ssb_periodicity = 160; + break; + + } + if( mib != NULL ){ config_nr_mib(Mod_idP, CC_idP, @@ -273,6 +299,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, cellid, nr_bandP, ssb_pattern, + ssb_periodicity, dl_CarrierFreqP, dl_BandwidthP ); diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index a214b160a2..36adc84d19 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -38,10 +38,11 @@ void mac_top_init_gNB(void); int rrc_mac_config_req_gNB(module_id_t Mod_idP, int CC_id, - int cellid, + int cellid, int p_gNB, int nr_bandP, uint64_t ssb_pattern, + uint16_t ssb_periodicity, uint64_t dl_CarrierFreqP, int dl_BandwidthP, NR_BCCH_BCH_Message_t *mib, diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 801673b2ef..5af4ad0f4e 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -260,13 +260,13 @@ static void init_NR_SI(const protocol_ctxt_t* const ctxt_pP, ); LOG_I(NR_RRC,"Done init_NR_SI\n"); - rrc_mac_config_req_gNB(ctxt_pP->module_id, CC_id, RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].physCellId, RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].p_gNB, configuration->nr_band[CC_id], + configuration->ServingCellConfigCommon_ssb_periodicityServingCell[CC_id], configuration->ServingCellConfigCommon_ssb_PositionsInBurst_PR[CC_id], RC.nrrrc[ctxt_pP->module_id]->carrier[CC_id].dl_CarrierFreq, configuration->N_RB_DL[CC_id], diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band22.tm1.106PRB.adrv9371zc706.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band22.tm1.106PRB.adrv9371zc706.conf index 5fd4b465b3..c121cce0aa 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band22.tm1.106PRB.adrv9371zc706.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band22.tm1.106PRB.adrv9371zc706.conf @@ -71,7 +71,7 @@ gNBs = UL_timeAlignmentTimerCommon = "infinity"; ServingCellConfigCommon_n_TimingAdvanceOffset = "n0" ServingCellConfigCommon_ssb_PositionsInBurst_PR = 0x01; - ServingCellConfigCommon_ssb_periodicityServingCell = 10; + ServingCellConfigCommon_ssb_periodicityServingCell = 20; ServingCellConfigCommon_dmrs_TypeA_Position = 2; NIA_SubcarrierSpacing = "kHz15"; ServingCellConfigCommon_ss_PBCH_BlockPower = -60; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf index 077d1e5bd3..774fabd60f 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf @@ -71,7 +71,7 @@ gNBs = UL_timeAlignmentTimerCommon = "infinity"; ServingCellConfigCommon_n_TimingAdvanceOffset = "n0" ServingCellConfigCommon_ssb_PositionsInBurst_PR = 0x01; - ServingCellConfigCommon_ssb_periodicityServingCell = 10; + ServingCellConfigCommon_ssb_periodicityServingCell = 20; ServingCellConfigCommon_dmrs_TypeA_Position = 2; NIA_SubcarrierSpacing = "kHz15"; ServingCellConfigCommon_ss_PBCH_BlockPower = -60; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf index be98106d1e..3593f2681a 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpx300.conf @@ -71,7 +71,7 @@ gNBs = UL_timeAlignmentTimerCommon = "infinity"; ServingCellConfigCommon_n_TimingAdvanceOffset = "n0" ServingCellConfigCommon_ssb_PositionsInBurst_PR = 0x01; - ServingCellConfigCommon_ssb_periodicityServingCell = 10; + ServingCellConfigCommon_ssb_periodicityServingCell = 20; ServingCellConfigCommon_dmrs_TypeA_Position = 2; NIA_SubcarrierSpacing = "kHz15"; ServingCellConfigCommon_ss_PBCH_BlockPower = -60; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf index dbd937d61a..36c0fb58ea 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.217PRB.usrpn300.conf @@ -71,7 +71,7 @@ gNBs = UL_timeAlignmentTimerCommon = "infinity"; ServingCellConfigCommon_n_TimingAdvanceOffset = "n0" ServingCellConfigCommon_ssb_PositionsInBurst_PR = 0x01; - ServingCellConfigCommon_ssb_periodicityServingCell = 10; + ServingCellConfigCommon_ssb_periodicityServingCell = 20; ServingCellConfigCommon_dmrs_TypeA_Position = 2; NIA_SubcarrierSpacing = "kHz15"; ServingCellConfigCommon_ss_PBCH_BlockPower = -60;