mirror of https://github.com/pvnis/srsRAN_4G.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
178 lines
6.4 KiB
C
178 lines
6.4 KiB
C
4 years ago
|
/**
|
||
5 years ago
|
*
|
||
4 years ago
|
* \section COPYRIGHT
|
||
5 years ago
|
*
|
||
4 years ago
|
* Copyright 2013-2021 Software Radio Systems Limited
|
||
5 years ago
|
*
|
||
4 years ago
|
* By using this file, you agree to the terms and conditions set
|
||
|
* forth in the LICENSE file which can be found at the top level of
|
||
|
* the distribution.
|
||
5 years ago
|
*
|
||
|
*/
|
||
|
|
||
4 years ago
|
#ifndef SRSRAN_RRC_UTILS_H
|
||
|
#define SRSRAN_RRC_UTILS_H
|
||
5 years ago
|
|
||
4 years ago
|
#include "srsran/interfaces/mac_interface_types.h"
|
||
|
#include "srsran/interfaces/pdcp_interface_types.h"
|
||
|
#include "srsran/interfaces/rlc_interface_types.h"
|
||
|
#include "srsran/interfaces/rrc_interface_types.h"
|
||
|
#include "srsran/interfaces/sched_interface.h"
|
||
5 years ago
|
|
||
5 years ago
|
/************************
|
||
|
* Forward declarations
|
||
|
***********************/
|
||
5 years ago
|
namespace asn1 {
|
||
5 years ago
|
|
||
|
template <uint32_t N, bool aligned>
|
||
|
class fixed_octstring;
|
||
|
|
||
5 years ago
|
namespace rrc {
|
||
|
|
||
|
struct plmn_id_s;
|
||
|
struct s_tmsi_s;
|
||
5 years ago
|
struct rlc_cfg_c;
|
||
5 years ago
|
struct pdcp_cfg_s;
|
||
5 years ago
|
struct srb_to_add_mod_s;
|
||
5 years ago
|
struct drb_to_add_mod_s;
|
||
5 years ago
|
// mac
|
||
5 years ago
|
struct sched_request_cfg_c;
|
||
|
struct mac_main_cfg_s;
|
||
|
struct rach_cfg_common_s;
|
||
|
struct time_align_timer_opts;
|
||
5 years ago
|
struct ant_info_ded_s;
|
||
|
|
||
5 years ago
|
struct phys_cfg_ded_s;
|
||
|
struct prach_cfg_info_s;
|
||
|
struct pdsch_cfg_common_s;
|
||
|
struct pusch_cfg_common_s;
|
||
|
struct pucch_cfg_common_s;
|
||
|
struct srs_ul_cfg_common_c;
|
||
|
struct ul_pwr_ctrl_common_s;
|
||
|
struct scell_to_add_mod_r10_s;
|
||
5 years ago
|
struct mbms_notif_cfg_r9_s;
|
||
|
struct mbsfn_area_info_r9_s;
|
||
|
struct mbsfn_sf_cfg_s;
|
||
|
struct mcch_msg_s;
|
||
|
struct sib_type13_r9_s;
|
||
5 years ago
|
// MeasConfig
|
||
|
struct cells_to_add_mod_s;
|
||
4 years ago
|
struct cells_to_add_mod_nr_r15_s;
|
||
|
struct black_cells_to_add_mod_s;
|
||
5 years ago
|
struct report_cfg_eutra_s;
|
||
|
struct meas_obj_to_add_mod_s;
|
||
|
struct report_cfg_to_add_mod_s;
|
||
|
struct meas_id_to_add_mod_s;
|
||
5 years ago
|
struct quant_cfg_s;
|
||
5 years ago
|
|
||
5 years ago
|
// UE Capabilities
|
||
|
struct ue_eutra_cap_s;
|
||
|
|
||
5 years ago
|
} // namespace rrc
|
||
|
} // namespace asn1
|
||
|
|
||
5 years ago
|
/************************
|
||
|
* Conversion Helpers
|
||
|
***********************/
|
||
4 years ago
|
namespace srsran {
|
||
5 years ago
|
plmn_id_t make_plmn_id_t(const asn1::rrc::plmn_id_s& asn1_type);
|
||
|
void to_asn1(asn1::rrc::plmn_id_s* asn1_type, const plmn_id_t& cfg);
|
||
5 years ago
|
plmn_id_t make_plmn_id_t(const asn1::fixed_octstring<3, true>& asn1_type);
|
||
|
void to_asn1(asn1::fixed_octstring<3, true>* asn1_type, const plmn_id_t& cfg);
|
||
5 years ago
|
|
||
5 years ago
|
s_tmsi_t make_s_tmsi_t(const asn1::rrc::s_tmsi_s& asn1_type);
|
||
|
void to_asn1(asn1::rrc::s_tmsi_s* asn1_type, const s_tmsi_t& cfg);
|
||
5 years ago
|
|
||
5 years ago
|
/***************************
|
||
|
* RLC Config
|
||
|
**************************/
|
||
5 years ago
|
rlc_config_t make_rlc_config_t(const asn1::rrc::rlc_cfg_c& asn1_type);
|
||
|
rlc_config_t make_rlc_config_t(const asn1::rrc::srb_to_add_mod_s& asn1_type);
|
||
|
void to_asn1(asn1::rrc::rlc_cfg_c* asn1_type, const rlc_config_t& cfg);
|
||
5 years ago
|
|
||
5 years ago
|
/***************************
|
||
|
* PDCP Config
|
||
|
**************************/
|
||
4 years ago
|
srsran::pdcp_config_t make_srb_pdcp_config_t(const uint8_t bearer_id, bool is_ue);
|
||
|
srsran::pdcp_config_t make_drb_pdcp_config_t(const uint8_t bearer_id, bool is_ue);
|
||
4 years ago
|
uint8_t get_pdcp_drb_sn_len(const asn1::rrc::pdcp_cfg_s& pdcp_cfg);
|
||
4 years ago
|
srsran::pdcp_config_t
|
||
5 years ago
|
make_drb_pdcp_config_t(const uint8_t bearer_id, bool is_ue, const asn1::rrc::pdcp_cfg_s& pdcp_cfg);
|
||
5 years ago
|
|
||
5 years ago
|
/***************************
|
||
|
* MAC Config
|
||
|
**************************/
|
||
|
void set_mac_cfg_t_sched_request_cfg(mac_cfg_t* cfg, const asn1::rrc::sched_request_cfg_c& asn1_type);
|
||
|
void set_mac_cfg_t_main_cfg(mac_cfg_t* cfg, const asn1::rrc::mac_main_cfg_s& asn1_type);
|
||
|
void set_mac_cfg_t_rach_cfg_common(mac_cfg_t* cfg, const asn1::rrc::rach_cfg_common_s& asn1_type);
|
||
|
void set_mac_cfg_t_time_alignment(mac_cfg_t* cfg, const asn1::rrc::time_align_timer_opts asn1_type);
|
||
|
|
||
5 years ago
|
srsenb::sched_interface::ant_info_ded_t make_ant_info_ded(const asn1::rrc::ant_info_ded_s& asn1_type);
|
||
|
|
||
5 years ago
|
/***************************
|
||
|
* PHY Config
|
||
|
**************************/
|
||
|
void set_phy_cfg_t_dedicated_cfg(phy_cfg_t* cfg, const asn1::rrc::phys_cfg_ded_s& asn1_type);
|
||
|
void set_phy_cfg_t_common_prach(phy_cfg_t* cfg, const asn1::rrc::prach_cfg_info_s* asn1_type, uint32_t root_seq_idx);
|
||
|
void set_phy_cfg_t_common_pdsch(phy_cfg_t* cfg, const asn1::rrc::pdsch_cfg_common_s& asn1_type);
|
||
|
void set_phy_cfg_t_common_pusch(phy_cfg_t* cfg, const asn1::rrc::pusch_cfg_common_s& asn1_type);
|
||
|
void set_phy_cfg_t_common_pucch(phy_cfg_t* cfg, const asn1::rrc::pucch_cfg_common_s& asn1_type);
|
||
|
void set_phy_cfg_t_common_srs(phy_cfg_t* cfg, const asn1::rrc::srs_ul_cfg_common_c& asn1_type);
|
||
|
void set_phy_cfg_t_common_pwr_ctrl(phy_cfg_t* cfg, const asn1::rrc::ul_pwr_ctrl_common_s& asn1_type);
|
||
5 years ago
|
void set_phy_cfg_t_scell_config(phy_cfg_t* cfg, const asn1::rrc::scell_to_add_mod_r10_s& asn1_type);
|
||
5 years ago
|
void set_phy_cfg_t_enable_64qam(phy_cfg_t* cfg, const bool enabled);
|
||
5 years ago
|
|
||
4 years ago
|
/***************************
|
||
|
* Measurements
|
||
|
**************************/
|
||
|
int get_carrier_freq(const asn1::rrc::meas_obj_to_add_mod_s& obj);
|
||
|
|
||
5 years ago
|
/***************************
|
||
|
* EUTRA UE Capabilities
|
||
|
**************************/
|
||
4 years ago
|
rrc_ue_capabilities_t make_rrc_ue_capabilities(const asn1::rrc::ue_eutra_cap_s& eutra_cap_s);
|
||
5 years ago
|
|
||
5 years ago
|
// mbms
|
||
|
mbms_notif_cfg_t make_mbms_notif_cfg(const asn1::rrc::mbms_notif_cfg_r9_s& asn1_type);
|
||
|
mbsfn_area_info_t make_mbsfn_area_info(const asn1::rrc::mbsfn_area_info_r9_s& asn1_type);
|
||
|
mbsfn_sf_cfg_t make_mbsfn_sf_cfg(const asn1::rrc::mbsfn_sf_cfg_s& sf_cfg);
|
||
|
mcch_msg_t make_mcch_msg(const asn1::rrc::mcch_msg_s& asn1_type);
|
||
|
sib13_t make_sib13(const asn1::rrc::sib_type13_r9_s& asn1_type);
|
||
|
|
||
4 years ago
|
} // namespace srsran
|
||
5 years ago
|
|
||
5 years ago
|
/************************
|
||
|
* ASN1 RRC extensions
|
||
|
***********************/
|
||
|
namespace asn1 {
|
||
|
namespace rrc {
|
||
|
|
||
5 years ago
|
/**************************
|
||
|
* RRC Obj Id
|
||
|
*************************/
|
||
|
|
||
|
uint8_t get_rrc_obj_id(const srb_to_add_mod_s& srb);
|
||
5 years ago
|
uint8_t get_rrc_obj_id(const drb_to_add_mod_s& drb);
|
||
|
uint8_t get_rrc_obj_id(const cells_to_add_mod_s& obj);
|
||
4 years ago
|
uint8_t get_rrc_obj_id(const cells_to_add_mod_nr_r15_s& obj);
|
||
|
uint8_t get_rrc_obj_id(const black_cells_to_add_mod_s& obj);
|
||
5 years ago
|
uint8_t get_rrc_obj_id(const meas_obj_to_add_mod_s& obj);
|
||
|
uint8_t get_rrc_obj_id(const report_cfg_to_add_mod_s& obj);
|
||
|
uint8_t get_rrc_obj_id(const meas_id_to_add_mod_s& obj);
|
||
4 years ago
|
uint8_t get_rrc_obj_id(const scell_to_add_mod_r10_s& obj);
|
||
5 years ago
|
|
||
|
void set_rrc_obj_id(srb_to_add_mod_s& srb, uint8_t id);
|
||
5 years ago
|
void set_rrc_obj_id(drb_to_add_mod_s& drb, uint8_t id);
|
||
|
void set_rrc_obj_id(cells_to_add_mod_s& obj, uint8_t id);
|
||
4 years ago
|
void set_rrc_obj_id(cells_to_add_mod_nr_r15_s& obj, uint8_t id);
|
||
|
void set_rrc_obj_id(black_cells_to_add_mod_s& obj, uint8_t id);
|
||
5 years ago
|
void set_rrc_obj_id(meas_obj_to_add_mod_s& obj, uint8_t id);
|
||
|
void set_rrc_obj_id(report_cfg_to_add_mod_s& obj, uint8_t id);
|
||
|
void set_rrc_obj_id(meas_id_to_add_mod_s& obj, uint8_t id);
|
||
4 years ago
|
void set_rrc_obj_id(scell_to_add_mod_r10_s& obj, uint8_t id);
|
||
5 years ago
|
|
||
|
} // namespace rrc
|
||
|
} // namespace asn1
|
||
|
|
||
4 years ago
|
#endif // SRSRAN_RRC_UTILS_H
|