gnb,rrc: make plmn and cell id configurable in SIB1

master
Francisco 3 years ago committed by Andre Puschmann
parent cfa614226e
commit d1ddd3da4d

@ -1541,6 +1541,9 @@ int set_derived_args_nr(all_args_t* args_, rrc_nr_cfg_t* rrc_nr_cfg_, phy_cfg_t*
cfg.phy_cell.pdsch.rs_power = phy_cfg_->pdsch_cnfg.ref_sig_pwr;
cfg.phy_cell.pdsch.p_b = phy_cfg_->pdsch_cnfg.p_b;
}
rrc_nr_cfg_->enb_id = args_->enb.enb_id;
rrc_nr_cfg_->mcc = args_->stack.s1ap.mcc;
rrc_nr_cfg_->mnc = args_->stack.s1ap.mnc;
// Derive cross-dependent cell params
if (set_derived_nr_rrc_params(*rrc_nr_cfg_) != SRSRAN_SUCCESS) {

@ -52,6 +52,9 @@ struct rrc_nr_cfg_t {
rrc_cfg_cqi_t cqi_cfg;
rrc_cell_list_nr_t cell_list;
uint32_t inactivity_timeout_ms = 100000;
uint32_t enb_id;
uint16_t mcc;
uint16_t mnc;
bool is_standalone;
std::array<srsran::CIPHERING_ALGORITHM_ID_NR_ENUM, srsran::CIPHERING_ALGORITHM_ID_NR_N_ITEMS> nea_preference_list;

@ -1060,8 +1060,6 @@ void fill_serv_cell_cfg_common_sib(const rrc_cell_cfg_nr_t& cell_cfg, serving_ce
int fill_sib1_from_enb_cfg(const rrc_nr_cfg_t& cfg, uint32_t cc, asn1::rrc_nr::sib1_s& sib1)
{
std::string plmn_str = "00101";
uint32_t cell_id = 0x19B01;
const rrc_cell_cfg_nr_t& cell_cfg = cfg.cell_list[cc];
sib1.cell_sel_info_present = true;
@ -1072,11 +1070,11 @@ int fill_sib1_from_enb_cfg(const rrc_nr_cfg_t& cfg, uint32_t cc, asn1::rrc_nr::s
sib1.cell_access_related_info.plmn_id_list.resize(1);
sib1.cell_access_related_info.plmn_id_list[0].plmn_id_list.resize(1);
srsran::plmn_id_t plmn;
plmn.from_string(plmn_str);
plmn.from_number(cfg.mcc, cfg.mnc);
srsran::to_asn1(&sib1.cell_access_related_info.plmn_id_list[0].plmn_id_list[0], plmn);
sib1.cell_access_related_info.plmn_id_list[0].tac_present = true;
sib1.cell_access_related_info.plmn_id_list[0].tac.from_number(cell_cfg.tac);
sib1.cell_access_related_info.plmn_id_list[0].cell_id.from_number(cell_id);
sib1.cell_access_related_info.plmn_id_list[0].cell_id.from_number((cfg.enb_id << 8U) + cell_cfg.phy_cell.cell_id);
sib1.cell_access_related_info.plmn_id_list[0].cell_reserved_for_oper.value =
plmn_id_info_s::cell_reserved_for_oper_opts::not_reserved;

@ -58,6 +58,9 @@ void test_sib_generation()
rrc_cfg_nr.cell_list[0].phy_cell.carrier.nof_prb = 52;
rrc_cfg_nr.cell_list[0].duplex_mode = SRSRAN_DUPLEX_MODE_FDD;
rrc_cfg_nr.is_standalone = true;
rrc_cfg_nr.enb_id = 0x19B;
srsran::string_to_mcc("001", &rrc_cfg_nr.mcc);
srsran::string_to_mnc("01", &rrc_cfg_nr.mnc);
set_derived_nr_cell_params(rrc_cfg_nr.is_standalone, rrc_cfg_nr.cell_list[0]);
srsran_assert(check_rrc_nr_cfg_valid(rrc_cfg_nr) == SRSRAN_SUCCESS, "Invalid RRC NR configuration");
@ -111,6 +114,9 @@ int test_rrc_setup()
rrc_cfg_nr.cell_list[0].band = 78;
rrc_cfg_nr.cell_list[0].phy_cell.carrier.nof_prb = 52;
rrc_cfg_nr.is_standalone = false;
rrc_cfg_nr.enb_id = 0x19B;
srsran::string_to_mcc("001", &rrc_cfg_nr.mcc);
srsran::string_to_mnc("01", &rrc_cfg_nr.mnc);
set_derived_nr_cell_params(rrc_cfg_nr.is_standalone, rrc_cfg_nr.cell_list[0]);
srsran_assert(check_rrc_nr_cfg_valid(rrc_cfg_nr) == SRSRAN_SUCCESS, "Invalid RRC NR configuration");
TESTASSERT(rrc_obj.init(rrc_cfg_nr, &phy_obj, &mac_obj, &rlc_obj, &pdcp_obj, nullptr, bearer_mapper, nullptr) ==
@ -151,6 +157,9 @@ void test_rrc_sa_connection()
rrc_cfg_nr.cell_list[0].phy_cell.carrier.nof_prb = 52;
rrc_cfg_nr.cell_list[0].duplex_mode = SRSRAN_DUPLEX_MODE_FDD;
rrc_cfg_nr.is_standalone = true;
rrc_cfg_nr.enb_id = 0x19B;
srsran::string_to_mcc("001", &rrc_cfg_nr.mcc);
srsran::string_to_mnc("01", &rrc_cfg_nr.mnc);
set_derived_nr_cell_params(rrc_cfg_nr.is_standalone, rrc_cfg_nr.cell_list[0]);
srsran_assert(check_rrc_nr_cfg_valid(rrc_cfg_nr) == SRSRAN_SUCCESS, "Invalid RRC NR configuration");

Loading…
Cancel
Save