From 83ad98c58b67c8eea12d7027fa403a08886cfbe9 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Thu, 3 Feb 2022 14:55:11 +0100 Subject: [PATCH] srsue,rrc_nr: add helper to configure default PHY layer parameters --- srsue/hdr/stack/rrc_nr/rrc_nr.h | 1 + srsue/src/stack/rrc_nr/rrc_nr.cc | 28 +++++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/srsue/hdr/stack/rrc_nr/rrc_nr.h b/srsue/hdr/stack/rrc_nr/rrc_nr.h index e71959a17..c9d8e9655 100644 --- a/srsue/hdr/stack/rrc_nr/rrc_nr.h +++ b/srsue/hdr/stack/rrc_nr/rrc_nr.h @@ -142,6 +142,7 @@ private: void send_security_mode_complete(); // helpers + void set_phy_default_config(); void handle_sib1(const asn1::rrc_nr::sib1_s& sib1); bool handle_rrc_setup(const asn1::rrc_nr::rrc_setup_s& setup); void handle_rrc_reconfig(const asn1::rrc_nr::rrc_recfg_s& reconfig); diff --git a/srsue/src/stack/rrc_nr/rrc_nr.cc b/srsue/src/stack/rrc_nr/rrc_nr.cc index 0da164daa..7593f6afd 100644 --- a/srsue/src/stack/rrc_nr/rrc_nr.cc +++ b/srsue/src/stack/rrc_nr/rrc_nr.cc @@ -35,7 +35,9 @@ rrc_nr::rrc_nr(srsran::task_sched_handle task_sched_) : setup_req_proc(*this), cell_selector(*this), meas_cells(task_sched_) -{} +{ + set_phy_default_config(); +} rrc_nr::~rrc_nr() = default; @@ -355,6 +357,30 @@ void rrc_nr::decode_pdu_bcch_dlsch(srsran::unique_byte_buffer_t pdu) } } +void rrc_nr::set_phy_default_config() +{ + phy_cfg = {}; + + // uses default values provided in 38.311 TS 138 331 V16.6 page 361 + if (make_phy_beta_offsets({}, &phy_cfg.pusch.beta_offsets) == false) { + logger.warning("Couldn't set default beta_offsets config"); + } + + // no default value provided, asume factor 1.0 + uci_on_pusch_s uci_on_pusch = {}; + uci_on_pusch.scaling = uci_on_pusch_s::scaling_opts::f1; + if (make_phy_pusch_scaling(uci_on_pusch, &phy_cfg.pusch.scaling) == false) { + logger.warning("Couldn't set default scaling config"); + } + + // no default value specified, use dynamic + phys_cell_group_cfg_s phys_cell_group_cfg = {}; + phys_cell_group_cfg.pdsch_harq_ack_codebook = phys_cell_group_cfg_s::pdsch_harq_ack_codebook_opts::dynamic_value; + if (make_phy_harq_ack_cfg(phys_cell_group_cfg, &phy_cfg.harq_ack) == false) { + logger.warning("Couldn't set default HARQ ack config"); + } +} + void rrc_nr::handle_sib1(const sib1_s& sib1) { meas_cells.serving_cell().set_sib1(sib1);