From 0ca70e6ad73e88ee7e352d921e923b77058cade2 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Mon, 2 Aug 2021 17:49:35 +0200 Subject: [PATCH] Implement enb to gnb number of PRB conversion --- srsenb/src/enb_cfg_parser.cc | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/srsenb/src/enb_cfg_parser.cc b/srsenb/src/enb_cfg_parser.cc index 4b9afea23..3b9cf7e5a 100644 --- a/srsenb/src/enb_cfg_parser.cc +++ b/srsenb/src/enb_cfg_parser.cc @@ -1102,11 +1102,24 @@ int set_derived_args(all_args_t* args_, rrc_cfg_t* rrc_cfg_, phy_cfg_t* phy_cfg_ auto& cfg = *it; phy_cell_cfg_nr_t phy_cell_cfg = {}; phy_cell_cfg.carrier.max_mimo_layers = cell_cfg_.nof_ports; - phy_cell_cfg.carrier.nof_prb = cell_cfg_.nof_prb; // TODO: convert NR PRBs - phy_cell_cfg.carrier.pci = cfg.pci; - phy_cell_cfg.cell_id = cfg.cell_id; - phy_cell_cfg.root_seq_idx = cfg.root_seq_idx; - phy_cell_cfg.rf_port = cfg.rf_port; + switch (cell_cfg_.nof_prb) { + case 25: + phy_cell_cfg.carrier.nof_prb = 25; + break; + case 50: + phy_cell_cfg.carrier.nof_prb = 52; + break; + case 100: + phy_cell_cfg.carrier.nof_prb = 106; + break; + default: + ERROR("The only accepted number of PRB is: 25, 50, 100"); + return SRSRAN_ERROR; + } + phy_cell_cfg.carrier.pci = cfg.pci; + phy_cell_cfg.cell_id = cfg.cell_id; + phy_cell_cfg.root_seq_idx = cfg.root_seq_idx; + phy_cell_cfg.rf_port = cfg.rf_port; phy_cell_cfg.num_ra_preambles = rrc_cfg_->sibs[1].sib2().rr_cfg_common.rach_cfg_common.preamb_info.nof_ra_preambs.to_number();