diff --git a/srsenb/hdr/phy/phy_common.h b/srsenb/hdr/phy/phy_common.h index d5dbd0c48..d7fe99636 100644 --- a/srsenb/hdr/phy/phy_common.h +++ b/srsenb/hdr/phy/phy_common.h @@ -84,14 +84,7 @@ public: float ret = 0.0f; if (cc_idx < cell_list.size()) { - uint32_t earfcn = cell_list[cc_idx].ul_earfcn; - - // If there is no UL-EARFCN, deduce it from DL-EARFCN - if (earfcn == 0) { - earfcn = srslte_band_ul_earfcn(cell_list[cc_idx].dl_earfcn); - } - - ret = 1e6f * srslte_band_fd(earfcn); + ret = cell_list[cc_idx].ul_freq_hz; } return ret; @@ -101,7 +94,7 @@ public: float ret = 0.0f; if (cc_idx < cell_list.size()) { - ret = 1e6f * srslte_band_fd(cell_list[cc_idx].dl_earfcn); + ret = cell_list[cc_idx].dl_freq_hz; } return ret; diff --git a/srsenb/hdr/phy/phy_interfaces.h b/srsenb/hdr/phy/phy_interfaces.h index ffc1f6464..054ac007c 100644 --- a/srsenb/hdr/phy/phy_interfaces.h +++ b/srsenb/hdr/phy/phy_interfaces.h @@ -34,8 +34,8 @@ struct phy_cell_cfg_t { srslte_cell_t cell; uint32_t rf_port; uint32_t cell_id; - uint32_t dl_earfcn; - uint32_t ul_earfcn; + float dl_freq_hz; + float ul_freq_hz; uint32_t root_seq_idx; }; diff --git a/srsenb/hdr/stack/rrc/rrc.h b/srsenb/hdr/stack/rrc/rrc.h index 2db96139d..737457435 100644 --- a/srsenb/hdr/stack/rrc/rrc.h +++ b/srsenb/hdr/stack/rrc/rrc.h @@ -100,7 +100,9 @@ struct cell_cfg_t { uint32_t pci; uint16_t root_seq_idx; uint32_t dl_earfcn; + float dl_freq_hz; uint32_t ul_earfcn; + float ul_freq_hz; std::vector scell_list; }; diff --git a/srsenb/src/enb_cfg_parser.cc b/srsenb/src/enb_cfg_parser.cc index 5b7a7747e..ceafe5dc2 100644 --- a/srsenb/src/enb_cfg_parser.cc +++ b/srsenb/src/enb_cfg_parser.cc @@ -661,7 +661,9 @@ int parse_rr(all_args_t* args_, rrc_cfg_t* rrc_cfg_) cell_cfg.pci = args_->enb.pci; cell_cfg.root_seq_idx = rrc_cfg_->sibs[1].sib2().rr_cfg_common.prach_cfg.root_seq_idx; cell_cfg.dl_earfcn = args_->enb.dl_earfcn; + cell_cfg.dl_freq_hz = args_->rf.dl_freq; cell_cfg.ul_earfcn = args_->enb.ul_earfcn; + cell_cfg.ul_freq_hz = args_->rf.ul_freq; } return p.parse(); @@ -730,6 +732,8 @@ static int parse_cell_list(all_args_t* args, rrc_cfg_t* rrc_cfg, Setting& root) cell_cfg.root_seq_idx, cellroot, "root_seq_idx", rrc_cfg->sibs[1].sib2().rr_cfg_common.prach_cfg.root_seq_idx); parse_default_field(cell_cfg.dl_earfcn, cellroot, "dl_earfcn", args->enb.dl_earfcn); parse_default_field(cell_cfg.ul_earfcn, cellroot, "ul_earfcn", args->enb.ul_earfcn); + parse_default_field(cell_cfg.dl_freq_hz, cellroot, "dl_freq", args->rf.dl_freq); + parse_default_field(cell_cfg.ul_freq_hz, cellroot, "ul_freq", args->rf.ul_freq); if (cellroot["ho_active"]) { HANDLEPARSERCODE(parse_meas_cell_list(&rrc_cfg->meas_cfg, cellroot["meas_cell_list"])); @@ -842,9 +846,22 @@ int set_derived_args(all_args_t* args_, rrc_cfg_t* rrc_cfg_, phy_cfg_t* phy_cfg_ phy_cell_cfg.cell.id = cfg.pci; phy_cell_cfg.cell_id = cfg.cell_id; phy_cell_cfg.root_seq_idx = cfg.root_seq_idx; - phy_cell_cfg.dl_earfcn = cfg.dl_earfcn; - phy_cell_cfg.ul_earfcn = cfg.ul_earfcn; phy_cell_cfg.rf_port = cfg.rf_port; + + if (cfg.dl_freq_hz > 0) { + phy_cell_cfg.dl_freq_hz = cfg.dl_freq_hz; + } else { + cfg.dl_freq_hz = 1e6f * srslte_band_fd(cfg.dl_earfcn); + } + + if (cfg.ul_freq_hz > 0) { + phy_cell_cfg.ul_freq_hz = cfg.ul_freq_hz; + } else { + if (cfg.ul_earfcn == 0) { + cfg.ul_earfcn = srslte_band_ul_earfcn(cfg.dl_earfcn); + } + cfg.ul_freq_hz = 1e6f * srslte_band_fd(cfg.ul_earfcn); + } phy_cfg_->phy_cell_cfg.push_back(phy_cell_cfg); }