ngap,rrc: fix PDU session Id and DRB Id assigned

master
herlesupreeth 2 years ago committed by Justin Tallon
parent 0d8cae98fd
commit 8cac5e9919

@ -1348,7 +1348,7 @@ int fill_cellgroup_with_radio_bearer_cfg(const rrc_nr_cfg_t&
// Add DRBs // Add DRBs
for (const drb_to_add_mod_s& drb : bearers.drb_to_add_mod_list) { for (const drb_to_add_mod_s& drb : bearers.drb_to_add_mod_list) {
out.rlc_bearer_to_add_mod_list.push_back({}); out.rlc_bearer_to_add_mod_list.push_back({});
uint32_t lcid = drb.drb_id + (int)srsran::nr_srb::count - 1; uint32_t lcid = drb.drb_id + srsran::MAX_NR_SRB_ID;
enb_bearer_manager::radio_bearer_t rb = bearer_mapper.get_lcid_bearer(rnti, lcid); enb_bearer_manager::radio_bearer_t rb = bearer_mapper.get_lcid_bearer(rnti, lcid);
if (rb.is_valid() and cfg.five_qi_cfg.find(rb.five_qi) != cfg.five_qi_cfg.end()) { if (rb.is_valid() and cfg.five_qi_cfg.find(rb.five_qi) != cfg.five_qi_cfg.end()) {
fill_drb(cfg, rb, (srsran::nr_drb)drb.drb_id, out.rlc_bearer_to_add_mod_list.back()); fill_drb(cfg, rb, (srsran::nr_drb)drb.drb_id, out.rlc_bearer_to_add_mod_list.back());

@ -1340,29 +1340,36 @@ void rrc_nr::ue::establish_eps_bearer(uint32_t pdu_session_id,
nas_pdu_queue.push_back(std::move(pdu)); nas_pdu_queue.push_back(std::move(pdu));
// Add SRB2, if not yet added // Add SRB2, if not yet added
if (radio_bearer_cfg.srb_to_add_mod_list.size() <= 1) { asn1::rrc_nr::srb_to_add_mod_s* srb_it =
std::find_if(radio_bearer_cfg.srb_to_add_mod_list.begin(),
radio_bearer_cfg.srb_to_add_mod_list.end(),
[](const asn1::rrc_nr::srb_to_add_mod_s& srb) { return srb.srb_id == 2; });
if (srb_it == radio_bearer_cfg.srb_to_add_mod_list.end()) {
next_radio_bearer_cfg.srb_to_add_mod_list.push_back(srb_to_add_mod_s{}); next_radio_bearer_cfg.srb_to_add_mod_list.push_back(srb_to_add_mod_s{});
next_radio_bearer_cfg.srb_to_add_mod_list.back().srb_id = 2; next_radio_bearer_cfg.srb_to_add_mod_list.back().srb_id = 2;
} }
drb_to_add_mod_s drb; drb_to_add_mod_s drb;
drb.cn_assoc_present = true; drb.cn_assoc_present = true;
drb.cn_assoc.set_sdap_cfg().pdu_session = 1; drb.cn_assoc.set_sdap_cfg().pdu_session = pdu_session_id;
drb.cn_assoc.sdap_cfg().sdap_hdr_dl.value = asn1::rrc_nr::sdap_cfg_s::sdap_hdr_dl_opts::absent; drb.cn_assoc.sdap_cfg().sdap_hdr_dl.value = asn1::rrc_nr::sdap_cfg_s::sdap_hdr_dl_opts::absent;
drb.cn_assoc.sdap_cfg().sdap_hdr_ul.value = asn1::rrc_nr::sdap_cfg_s::sdap_hdr_ul_opts::absent; drb.cn_assoc.sdap_cfg().sdap_hdr_ul.value = asn1::rrc_nr::sdap_cfg_s::sdap_hdr_ul_opts::absent;
drb.cn_assoc.sdap_cfg().default_drb = true; drb.cn_assoc.sdap_cfg().default_drb = true;
drb.cn_assoc.sdap_cfg().mapped_qos_flows_to_add.resize(1); drb.cn_assoc.sdap_cfg().mapped_qos_flows_to_add.resize(1);
drb.cn_assoc.sdap_cfg().mapped_qos_flows_to_add[0] = 1; drb.cn_assoc.sdap_cfg().mapped_qos_flows_to_add[0] = 1;
drb.drb_id = 1; drb.drb_id = lcid - srsran::MAX_NR_SRB_ID;
drb.pdcp_cfg_present = true; drb.pdcp_cfg_present = true;
drb.pdcp_cfg = parent->cfg.five_qi_cfg[five_qi].pdcp_cfg; drb.pdcp_cfg = parent->cfg.five_qi_cfg[five_qi].pdcp_cfg;
next_radio_bearer_cfg.drb_to_add_mod_list.push_back(drb); next_radio_bearer_cfg.drb_to_add_mod_list.push_back(drb);
parent->bearer_mapper->add_eps_bearer( parent->bearer_mapper->add_eps_bearer(rnti,
rnti, lcid - 3, srsran::srsran_rat_t::nr, lcid); // TODO: configurable bearer id <-> lcid mapping pdu_session_id,
parent->bearer_mapper->set_five_qi(rnti, lcid - 3, five_qi); srsran::srsran_rat_t::nr,
lcid); // TODO: configurable bearer id <-> lcid mapping
parent->bearer_mapper->set_five_qi(rnti, pdu_session_id, five_qi);
// store 5QI for possible reestablishment of DRB // store 5QI for possible reestablishment of DRB
drb1_five_qi = five_qi; drb1_five_qi = five_qi;

Loading…
Cancel
Save