diff --git a/srsue/hdr/stack/rrc_nr/rrc_nr_config.h b/srsue/hdr/stack/rrc_nr/rrc_nr_config.h index fc3e4a25a..cdc87b9d0 100644 --- a/srsue/hdr/stack/rrc_nr/rrc_nr_config.h +++ b/srsue/hdr/stack/rrc_nr/rrc_nr_config.h @@ -27,7 +27,6 @@ struct rrc_nr_args_t { uint32_t dl_nr_arfcn; uint32_t ssb_nr_arfcn; uint32_t nof_prb; - uint32_t pci; srsran_subcarrier_spacing_t scs; srsran_subcarrier_spacing_t ssb_scs; std::string log_level; diff --git a/srsue/src/main.cc b/srsue/src/main.cc index 495d49777..8d89be9b4 100644 --- a/srsue/src/main.cc +++ b/srsue/src/main.cc @@ -60,6 +60,7 @@ string config_file; static int parse_args(all_args_t* args, int argc, char* argv[]) { bool use_standard_lte_rates = false; + std::string scs_khz, ssb_scs_khz; // temporary value to store integer // Command line only options bpo::options_description general("General options"); @@ -122,9 +123,14 @@ static int parse_args(all_args_t* args, int argc, char* argv[]) ("rat.eutra.ul_freq", bpo::value(&args->phy.ul_freq)->default_value(-1), "Uplink Frequency (if positive overrides EARFCN)") ("rat.eutra.nof_carriers", bpo::value(&args->phy.nof_lte_carriers)->default_value(1), "Number of carriers") - ("rat.nr.bands", bpo::value(&args->stack.rrc_nr.supported_bands_nr_str)->default_value("78"), "Supported NR bands") + ("rat.nr.bands", bpo::value(&args->stack.rrc_nr.supported_bands_nr_str)->default_value("3"), "Supported NR bands") ("rat.nr.nof_carriers", bpo::value(&args->phy.nof_nr_carriers)->default_value(0), "Number of NR carriers") - ("rat.nr.max_nof_prb", bpo::value(&args->phy.nr_max_nof_prb)->default_value(52), "Maximum NR carrier bandwidth in PRB") + ("rat.nr.max_nof_prb", bpo::value(&args->phy.nr_max_nof_prb)->default_value(52), "Maximum NR carrier bandwidth in PRB") + ("rat.nr.dl_nr_arfcn", bpo::value(&args->stack.rrc_nr.dl_nr_arfcn)->default_value(368500), "DL ARFCN of NR cell") + ("rat.nr.ssb_nr_arfcn", bpo::value(&args->stack.rrc_nr.ssb_nr_arfcn)->default_value(368410), "SSB ARFCN of NR cell") + ("rat.nr.nof_prb", bpo::value(&args->stack.rrc_nr.nof_prb)->default_value(52), "Actual NR carrier bandwidth in PRB") + ("rat.nr.scs", bpo::value(&scs_khz)->default_value("15"), "PDSCH subcarrier spacing in kHz") + ("rat.nr.ssb_scs", bpo::value(&ssb_scs_khz)->default_value("15"), "SSB subcarrier spacing in kHz") ("rrc.feature_group", bpo::value(&args->stack.rrc.feature_group)->default_value(0xe6041000), "Hex value of the featureGroupIndicators field in the" "UECapabilityInformation message. Default 0xe6041000") @@ -620,6 +626,14 @@ static int parse_args(all_args_t* args, int argc, char* argv[]) srsran_use_standard_symbol_size(use_standard_lte_rates); + args->stack.rrc_nr.scs = srsran_subcarrier_spacing_from_str(scs_khz.c_str()); + args->stack.rrc_nr.ssb_scs = srsran_subcarrier_spacing_from_str(ssb_scs_khz.c_str()); + if (args->stack.rrc_nr.scs == srsran_subcarrier_spacing_invalid || + args->stack.rrc_nr.ssb_scs == srsran_subcarrier_spacing_invalid) { + cout << "Invalid subcarrier spacing config" << endl; + return SRSRAN_ERROR; + } + return SRSRAN_SUCCESS; } diff --git a/srsue/src/stack/rrc_nr/rrc_nr.cc b/srsue/src/stack/rrc_nr/rrc_nr.cc index 7fa2f4266..16b198756 100644 --- a/srsue/src/stack/rrc_nr/rrc_nr.cc +++ b/srsue/src/stack/rrc_nr/rrc_nr.cc @@ -89,7 +89,6 @@ int rrc_nr::init(phy_interface_rrc_nr* phy_, phy_cfg.carrier.ssb_center_freq_hz = bands.nr_arfcn_to_freq(args.ssb_nr_arfcn); phy_cfg.carrier.nof_prb = args.nof_prb; phy_cfg.carrier.max_mimo_layers = 1; - phy_cfg.carrier.pci = args.pci; phy_cfg.carrier.scs = args.scs; phy_cfg.duplex.mode = bands.get_duplex_mode(bands.get_band_from_dl_arfcn(args.dl_nr_arfcn)); diff --git a/srsue/src/stack/rrc_nr/rrc_nr_procedures.cc b/srsue/src/stack/rrc_nr/rrc_nr_procedures.cc index fe307a0bb..c699e0e65 100644 --- a/srsue/src/stack/rrc_nr/rrc_nr_procedures.cc +++ b/srsue/src/stack/rrc_nr/rrc_nr_procedures.cc @@ -426,13 +426,13 @@ rrc_nr::cell_selection_proc::handle_cell_search_result(const rrc_interface_phy_n // Transition to cell selection ignoring the cell search result state = state_t::phy_cell_select; + // until cell selection is done, update PHY config to take the last found PCI + rrc_handle.phy_cfg.carrier.pci = result.pci; + phy_interface_rrc_nr::cell_select_args_t cs_args = {}; cs_args.carrier = rrc_handle.phy_cfg.carrier; cs_args.ssb_cfg = rrc_handle.phy_cfg.get_ssb_cfg(); - // until cell selection is done, update PHY config to take the last found PCI - rrc_handle.phy_cfg.carrier.pci = result.pci; - { // Coreset0 configuration srsran::phy_cfg_nr_t& phy_cfg = rrc_handle.phy_cfg; diff --git a/srsue/src/ue.cc b/srsue/src/ue.cc index 27994309c..ef91501ce 100644 --- a/srsue/src/ue.cc +++ b/srsue/src/ue.cc @@ -278,14 +278,6 @@ int ue::parse_args(const all_args_t& args_) // SA params if (args.phy.nof_lte_carriers == 0 && args.phy.nof_nr_carriers == 1) { - // TODO: expose to UE config - args.stack.rrc_nr.dl_nr_arfcn = 368500; - args.stack.rrc_nr.ssb_nr_arfcn = 368410; - args.stack.rrc_nr.nof_prb = 52; - args.stack.rrc_nr.pci = 500; - args.stack.rrc_nr.scs = srsran_subcarrier_spacing_15kHz; - args.stack.rrc_nr.ssb_scs = srsran_subcarrier_spacing_15kHz; - // Update NAS-5G args args.stack.nas_5g.ia5g = args.stack.nas.eia; args.stack.nas_5g.ea5g = args.stack.nas.eea;