Added functions for adding phr and tag config

master
David Rupprecht 4 years ago committed by Andre Puschmann
parent 48537f3fe7
commit 5a3a2a6d6f

@ -31,6 +31,7 @@ struct rlc_cfg_c;
struct pdcp_cfg_s;
struct lc_ch_cfg_s;
struct rach_cfg_common_s;
struct phr_cfg_s;
// Phy
struct tdd_ul_dl_cfg_common_s;
@ -92,6 +93,7 @@ bool make_phy_pusch_scaling(const asn1::rrc_nr::uci_on_pusch_s& uci_on_pusch, fl
**************************/
logical_channel_config_t make_mac_logical_channel_cfg_t(uint8_t lcid, const asn1::rrc_nr::lc_ch_cfg_s& asn1_type);
rach_nr_cfg_t make_mac_rach_cfg(const asn1::rrc_nr::rach_cfg_common_s& asn1_type);
bool make_mac_phr_cfg_t(const asn1::rrc_nr::phr_cfg_s& asn1_type, phr_cfg_nr_t* phr_cfg_nr);
/***************************
* RLC Config
**************************/

@ -150,6 +150,26 @@ struct sr_cfg_nr_t {
sr_cfg_item_nr_t item[SRSRAN_MAX_MAX_NR_OF_SR_CFG_PER_CELL_GROUP];
};
struct tag_cfg_nr_t {
uint8_t tag_id;
uint32_t time_align_timer;
};
struct phr_cfg_nr_t {
int periodic_timer;
int prohibit_timer;
int tx_pwr_factor_change;
bool extended;
phr_cfg_nr_t() { reset(); }
void reset()
{
periodic_timer = -1;
prohibit_timer = -1;
tx_pwr_factor_change = -1;
extended = false;
}
};
struct bsr_cfg_nr_t {
// mandatory BSR config
int periodic_timer;

@ -111,6 +111,9 @@ public:
virtual int set_config(const srsran::bsr_cfg_nr_t& bsr_cfg) = 0;
virtual int set_config(const srsran::sr_cfg_nr_t& sr_cfg) = 0;
virtual void set_config(const srsran::rach_nr_cfg_t& rach_cfg) = 0;
virtual int add_tag_config(const srsran::tag_cfg_nr_t& tag_cfg) = 0;
virtual int set_config(const srsran::phr_cfg_nr_t& phr_cfg) = 0;
virtual int remove_tag_config(const uint32_t tag_id) = 0;
// RRC triggers MAC ra procedure
virtual void start_ra_procedure() = 0;

@ -66,6 +66,15 @@ logical_channel_config_t make_mac_logical_channel_cfg_t(uint8_t lcid, const lc_c
return logical_channel_config;
}
bool make_mac_phr_cfg_t(const phr_cfg_s& asn1_type, phr_cfg_nr_t* phr_cfg_nr)
{
phr_cfg_nr->extended = asn1_type.ext;
phr_cfg_nr->periodic_timer = asn1_type.phr_periodic_timer.to_number();
phr_cfg_nr->prohibit_timer = asn1_type.phr_prohibit_timer.to_number();
phr_cfg_nr->tx_pwr_factor_change = asn1_type.phr_tx_pwr_factor_change.to_number();
return true;
}
rach_nr_cfg_t make_mac_rach_cfg(const rach_cfg_common_s& asn1_type)
{
rach_nr_cfg_t rach_nr_cfg = {};

@ -76,6 +76,9 @@ public:
void set_config(const srsran::rach_nr_cfg_t& rach_cfg);
void set_contention_id(const uint64_t ue_identity);
bool set_crnti(const uint16_t crnti);
int add_tag_config(const srsran::tag_cfg_nr_t& tag_cfg);
int set_config(const srsran::phr_cfg_nr_t& phr_cfg);
int remove_tag_config(const uint32_t tag_id);
void start_ra_procedure();
/// procedure ra nr interface + mux

@ -337,6 +337,24 @@ int mac_nr::setup_lcid(const srsran::logical_channel_config_t& config)
return SRSRAN_SUCCESS;
}
int mac_nr::add_tag_config(const srsran::tag_cfg_nr_t& tag_cfg)
{
logger.warning("Add tag config not supported yet");
return SRSRAN_SUCCESS;
}
int mac_nr::remove_tag_config(const uint32_t tag_id)
{
logger.warning("Remove tag config not supported yet");
return SRSRAN_SUCCESS;
}
int mac_nr::set_config(const srsran::phr_cfg_nr_t& phr_cfg)
{
logger.warning("Add phr config not supported yet");
return SRSRAN_SUCCESS;
}
int mac_nr::set_config(const srsran::bsr_cfg_nr_t& bsr_cfg)
{
return proc_bsr.set_config(bsr_cfg);

@ -518,11 +518,40 @@ bool rrc_nr::apply_mac_cell_group(const mac_cell_group_cfg_s& mac_cell_group_cfg
}
if (mac_cell_group_cfg.tag_cfg_present) {
logger.warning("Not handling tag cfg in MAC cell group config");
if (mac_cell_group_cfg.tag_cfg.tag_to_add_mod_list_present) {
for (uint32_t i = 0; i < mac_cell_group_cfg.tag_cfg.tag_to_add_mod_list.size(); i++) {
tag_cfg_nr_t tag_cfg_nr = {};
tag_cfg_nr.tag_id = mac_cell_group_cfg.tag_cfg.tag_to_add_mod_list[i].tag_id;
tag_cfg_nr.time_align_timer = mac_cell_group_cfg.tag_cfg.tag_to_add_mod_list[i].time_align_timer.to_number();
if (mac->add_tag_config(tag_cfg_nr) != SRSRAN_SUCCESS) {
logger.warning("Unable to add TAG config with tag_id %d", tag_cfg_nr.tag_id);
return false;
}
}
}
if (mac_cell_group_cfg.tag_cfg.tag_to_release_list_present) {
for (uint32_t i = 0; i < mac_cell_group_cfg.tag_cfg.tag_to_release_list.size(); i++) {
uint32_t tag_id = mac_cell_group_cfg.tag_cfg.tag_to_release_list[i];
if (mac->remove_tag_config(tag_id) != SRSRAN_SUCCESS) {
logger.warning("Unable to release TAG config with tag_id %d", tag_id);
return false;
}
}
}
}
if (mac_cell_group_cfg.phr_cfg_present) {
logger.warning("Not handling phr cfg in MAC cell group config");
if (mac_cell_group_cfg.phr_cfg.type() == setup_release_c<asn1::rrc_nr::phr_cfg_s>::types_opts::setup) {
phr_cfg_nr_t phr_cfg_nr;
if (make_mac_phr_cfg_t(mac_cell_group_cfg.phr_cfg.setup(), &phr_cfg_nr) != true) {
logger.warning("Unable to build PHR config");
return false;
}
if (mac->set_config(phr_cfg_nr) != SRSRAN_SUCCESS) {
logger.warning("Unable to set PHR config");
return false;
}
}
}
if (mac_cell_group_cfg.skip_ul_tx_dynamic) {

Loading…
Cancel
Save