diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/mac.h b/srsapps/ue/mac/include/srsapps/ue/mac/mac.h index 739374c81..17828b1e9 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/mac.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/mac.h @@ -79,6 +79,7 @@ public: void setup_lcid(uint32_t lcid, uint32_t lcg, uint32_t priority, int PBR_x_tti, uint32_t BSD); void set_param(mac_params::mac_param_t param, int64_t value); + int64_t get_param(mac_params::mac_param_t param); void reconfiguration(); void reset(); @@ -148,4 +149,4 @@ private: } } -#endif \ No newline at end of file +#endif diff --git a/srsapps/ue/mac/include/srsapps/ue/mac/mac_params.h b/srsapps/ue/mac/include/srsapps/ue/mac/mac_params.h index 4c9c55e6c..6525eec95 100644 --- a/srsapps/ue/mac/include/srsapps/ue/mac/mac_params.h +++ b/srsapps/ue/mac/include/srsapps/ue/mac/mac_params.h @@ -80,9 +80,6 @@ namespace ue { RA_INITRECEIVEDPOWER, RA_CONTENTIONTIMER, - SR_PUCCH_CONFIGURED, - SR_TRANS_MAX, - BSR_TIMER_PERIODIC, BSR_TIMER_RETX, diff --git a/srsapps/ue/mac/src/mac.cc b/srsapps/ue/mac/src/mac.cc index 33908642d..950086247 100644 --- a/srsapps/ue/mac/src/mac.cc +++ b/srsapps/ue/mac/src/mac.cc @@ -516,6 +516,11 @@ void mac::set_param(mac_params::mac_param_t param, int64_t value) params_db.set_param((uint32_t) param, value); } +int64_t mac::get_param(mac_params::mac_param_t param) +{ + return params_db.get_param((uint32_t) param); +} + void mac::setup_lcid(uint32_t lcid, uint32_t lcg, uint32_t priority, int PBR_x_tti, uint32_t BSD) { mux_unit.set_priority(mac_io::MAC_LCH_CCCH_UL+lcid, priority, PBR_x_tti, BSD); diff --git a/srsapps/ue/mac/src/proc_sr.cc b/srsapps/ue/mac/src/proc_sr.cc index a2c9193c7..74c6aef1d 100644 --- a/srsapps/ue/mac/src/proc_sr.cc +++ b/srsapps/ue/mac/src/proc_sr.cc @@ -54,8 +54,8 @@ void sr_proc::reset() void sr_proc::step(uint32_t tti) { if (initiated) { - if (is_pending_sr) { - if (params_db->get_param(mac_params::SR_PUCCH_CONFIGURED)) { + if (is_pending_sr) { + if (phy_h->get_param(phy_params::SR_PUCCH_CONFIGURED)) { if (sr_counter < dsr_transmax) { int last_tx_tti = phy_h->sr_last_tx_tti(); if (last_tx_tti >= 0 && last_tx_tti + 4 < tti) { @@ -93,7 +93,7 @@ void sr_proc::start() sr_counter = 0; is_pending_sr = true; } - dsr_transmax = params_db->get_param(mac_params::SR_TRANS_MAX); + dsr_transmax = phy_h->get_param(phy_params::SR_TRANS_MAX); Info("SR starting dsrTransMax=%d. sr_counter=%d, PHY TTI=%d\n", dsr_transmax, sr_counter, phy_h->get_current_tti()); } } diff --git a/srsapps/ue/mac/test/mac_test.cc b/srsapps/ue/mac/test/mac_test.cc index b2d207612..eaf6b3443 100644 --- a/srsapps/ue/mac/test/mac_test.cc +++ b/srsapps/ue/mac/test/mac_test.cc @@ -206,6 +206,9 @@ void process_connsetup(LIBLTE_RRC_CONNECTION_SETUP_STRUCT *msg, srslte::ue::mac msg->rr_cnfg.phy_cnfg_ded.sched_request_cnfg.sr_pucch_resource_idx); phy->set_param(srslte::ue::phy_params::SR_CONFIG_INDEX, msg->rr_cnfg.phy_cnfg_ded.sched_request_cnfg.sr_cnfg_idx); + phy->set_param(srslte::ue::phy_params::SR_TRANS_MAX, msg->rr_cnfg.phy_cnfg_ded.sched_request_cnfg.dsr_trans_max); + phy->set_param(srslte::ue::phy_params::SR_PUCCH_CONFIGURED, 1); + phy->set_param(srslte::ue::phy_params::UCI_I_OFFSET_ACK, msg->rr_cnfg.phy_cnfg_ded.pusch_cnfg_ded.beta_offset_ack_idx); phy->set_param(srslte::ue::phy_params::UCI_I_OFFSET_CQI, msg->rr_cnfg.phy_cnfg_ded.pusch_cnfg_ded.beta_offset_cqi_idx); phy->set_param(srslte::ue::phy_params::UCI_I_OFFSET_RI, msg->rr_cnfg.phy_cnfg_ded.pusch_cnfg_ded.beta_offset_ri_idx); @@ -216,9 +219,7 @@ void process_connsetup(LIBLTE_RRC_CONNECTION_SETUP_STRUCT *msg, srslte::ue::mac mac->set_param(srslte::ue::mac_params::HARQ_MAXTX, liblte_rrc_max_harq_tx_num[msg->rr_cnfg.mac_main_cnfg.explicit_value.ulsch_cnfg.max_harq_tx]); - mac->set_param(srslte::ue::mac_params::SR_TRANS_MAX, - liblte_rrc_dsr_trans_max_num[msg->rr_cnfg.phy_cnfg_ded.sched_request_cnfg.dsr_trans_max]); - mac->set_param(srslte::ue::mac_params::SR_PUCCH_CONFIGURED, 1); + mac->set_param(srslte::ue::mac_params::BSR_TIMER_RETX, liblte_rrc_retransmission_bsr_timer_num[msg->rr_cnfg.mac_main_cnfg.explicit_value.ulsch_cnfg.retx_bsr_timer]); diff --git a/srsapps/ue/phy/include/srsapps/ue/phy/phy.h b/srsapps/ue/phy/include/srsapps/ue/phy/phy.h index f93e65f64..b2bfc3220 100644 --- a/srsapps/ue/phy/include/srsapps/ue/phy/phy.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/phy.h @@ -111,6 +111,7 @@ public: bool status_is_rxtx(); void set_param(phy_params::phy_param_t param, int64_t value); + int64_t get_param(phy_params::phy_param_t param); uint32_t get_current_tti(); static uint32_t tti_to_SFN(uint32_t tti); @@ -170,4 +171,4 @@ private: } } -#endif \ No newline at end of file +#endif diff --git a/srsapps/ue/phy/include/srsapps/ue/phy/phy_params.h b/srsapps/ue/phy/include/srsapps/ue/phy/phy_params.h index 02aed5a4f..5d327b286 100644 --- a/srsapps/ue/phy/include/srsapps/ue/phy/phy_params.h +++ b/srsapps/ue/phy/include/srsapps/ue/phy/phy_params.h @@ -78,6 +78,8 @@ namespace ue { PUCCH_N_PUCCH_SR, SR_CONFIG_INDEX, + SR_TRANS_MAX, + SR_PUCCH_CONFIGURED, UCI_I_OFFSET_ACK, UCI_I_OFFSET_RI, diff --git a/srsapps/ue/phy/src/phy.cc b/srsapps/ue/phy/src/phy.cc index fd6449311..ee7e82baf 100644 --- a/srsapps/ue/phy/src/phy.cc +++ b/srsapps/ue/phy/src/phy.cc @@ -131,6 +131,10 @@ void phy::set_param(phy_params::phy_param_t param, int64_t value) { params_db.set_param((uint32_t) param, value); } +int64_t phy::get_param(phy_params::phy_param_t param) { + return params_db.get_param((uint32_t) param); +} + // FIXME: Add PRACH power control bool phy::send_prach(uint32_t preamble_idx) { return send_prach(preamble_idx, -1, 0); @@ -546,4 +550,4 @@ void phy::main_radio_loop() { } -} \ No newline at end of file +}