gnb,bearer_mapper: hack to keep 5QI information in bearer mapper

master
Pedro Alvarez 3 years ago
parent b8006534f0
commit 386b1640a9

@ -36,6 +36,7 @@ public:
srsran::srsran_rat_t rat;
uint32_t lcid;
uint32_t eps_bearer_id;
uint32_t five_qi = 0;
bool is_valid() const { return rat != srsran_rat_t::nulltype; }
};
static const radio_bearer_t invalid_rb;
@ -50,9 +51,11 @@ public:
bool has_active_radio_bearer(uint32_t eps_bearer_id);
radio_bearer_t get_radio_bearer(uint32_t eps_bearer_id);
radio_bearer_t get_radio_bearer(uint32_t eps_bearer_id) const;
radio_bearer_t get_eps_bearer_id_for_lcid(uint32_t lcid);
radio_bearer_t get_eps_bearer_id_for_lcid(uint32_t lcid) const;
bool set_five_qi(uint32_t eps_bearer_id, uint16_t five_qi);
private:
using eps_rb_map_t = std::map<uint32_t, radio_bearer_t>;
@ -147,7 +150,8 @@ public:
void rem_user(uint16_t rnti);
bool has_active_radio_bearer(uint16_t rnti, uint32_t eps_bearer_id);
radio_bearer_t get_radio_bearer(uint16_t rnti, uint32_t eps_bearer_id);
radio_bearer_t get_lcid_bearer(uint16_t rnti, uint32_t lcid);
radio_bearer_t get_lcid_bearer(uint16_t rnti, uint32_t lcid) const;
bool set_five_qi(uint16_t rnti, uint32_t eps_bearer_id, uint16_t five_qi);
private:
srslog::basic_logger& logger;
@ -157,4 +161,4 @@ private:
} // namespace srsenb
#endif // SRSRAN_BEARER_MANAGER_H
#endif // SRSRAN_BEARER_MANAGER_H

@ -52,18 +52,28 @@ bool ue_bearer_manager_impl::has_active_radio_bearer(uint32_t eps_bearer_id)
return bearers.count(eps_bearer_id) > 0;
}
ue_bearer_manager_impl::radio_bearer_t ue_bearer_manager_impl::get_radio_bearer(uint32_t eps_bearer_id)
ue_bearer_manager_impl::radio_bearer_t ue_bearer_manager_impl::get_radio_bearer(uint32_t eps_bearer_id) const
{
auto it = bearers.find(eps_bearer_id);
return it != bearers.end() ? it->second : invalid_rb;
}
ue_bearer_manager_impl::radio_bearer_t ue_bearer_manager_impl::get_eps_bearer_id_for_lcid(uint32_t lcid)
ue_bearer_manager_impl::radio_bearer_t ue_bearer_manager_impl::get_eps_bearer_id_for_lcid(uint32_t lcid) const
{
auto lcid_it = lcid_to_eps_bearer_id.find(lcid);
return lcid_it != lcid_to_eps_bearer_id.end() ? bearers.at(lcid_it->second) : invalid_rb;
}
bool ue_bearer_manager_impl::set_five_qi(uint32_t eps_bearer_id, uint16_t five_qi)
{
auto it = bearers.find(eps_bearer_id);
if (it == bearers.end()) {
return false;
}
it->second.five_qi = five_qi;
return true;
}
} // namespace detail
} // namespace srsran
@ -176,7 +186,7 @@ bool enb_bearer_manager::has_active_radio_bearer(uint16_t rnti, uint32_t eps_bea
return user_it->second.has_active_radio_bearer(eps_bearer_id);
}
enb_bearer_manager::radio_bearer_t enb_bearer_manager::get_lcid_bearer(uint16_t rnti, uint32_t lcid)
enb_bearer_manager::radio_bearer_t enb_bearer_manager::get_lcid_bearer(uint16_t rnti, uint32_t lcid) const
{
auto user_it = users_map.find(rnti);
if (user_it == users_map.end()) {
@ -194,4 +204,13 @@ enb_bearer_manager::radio_bearer_t enb_bearer_manager::get_radio_bearer(uint16_t
return user_it->second.get_radio_bearer(eps_bearer_id);
}
} // namespace srsenb
bool enb_bearer_manager::set_five_qi(uint16_t rnti, uint32_t eps_bearer_id, uint16_t five_qi)
{
auto user_it = users_map.find(rnti);
if (user_it == users_map.end()) {
return false;
}
return user_it->second.set_five_qi(eps_bearer_id, five_qi);
}
} // namespace srsenb

@ -1354,6 +1354,7 @@ void rrc_nr::ue::establish_eps_bearer(uint32_t pdu_session_id,
parent->bearer_mapper->add_eps_bearer(
rnti, lcid - 3, srsran::srsran_rat_t::nr, lcid); // TODO: configurable bearer id <-> lcid mapping
parent->bearer_mapper->set_five_qi(rnti, lcid - 3, five_qi);
logger.info("Established EPS bearer for LCID %u and RNTI 0x%x", lcid, rnti);
}

Loading…
Cancel
Save