From 9f3b4bf9a516f43bfdd65d2caeec6dd8adf98810 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 23 Jun 2017 14:30:51 +0200 Subject: [PATCH] use dedicated UL harq config - this patch changes the UL harq config to a dedicated one instead of passing the whole MAC config which may be specific to a specific RAT - it also extends the RRC to fill the harq specific config field in the MAC config - clean up dl_harq and remove unused mac config --- srsue/hdr/mac/dl_harq.h | 4 +--- srsue/hdr/mac/ul_harq.h | 16 ++++++++-------- srsue/src/mac/mac.cc | 12 ++++++------ srsue/src/upper/rrc.cc | 11 +++++++++-- 4 files changed, 24 insertions(+), 19 deletions(-) diff --git a/srsue/hdr/mac/dl_harq.h b/srsue/hdr/mac/dl_harq.h index 25677dd84..809ecd151 100644 --- a/srsue/hdr/mac/dl_harq.h +++ b/srsue/hdr/mac/dl_harq.h @@ -58,11 +58,10 @@ public: pcap = NULL; } - bool init(srslte::log *log_h_, mac_interface_rrc::mac_cfg_t *mac_cfg_, srslte::timers *timers_, demux *demux_unit_) + bool init(srslte::log *log_h_, srslte::timers *timers_, demux *demux_unit_) { timers_db = timers_; demux_unit = demux_unit_; - mac_cfg = mac_cfg_; si_window_start = 0; log_h = log_h_; for (uint32_t i=0;i proc; srslte::timers *timers_db; - mac_interface_rrc::mac_cfg_t *mac_cfg; demux *demux_unit; srslte::log *log_h; srslte::mac_pcap *pcap; diff --git a/srsue/hdr/mac/ul_harq.h b/srsue/hdr/mac/ul_harq.h index 21c4a9602..107683ebb 100644 --- a/srsue/hdr/mac/ul_harq.h +++ b/srsue/hdr/mac/ul_harq.h @@ -59,21 +59,21 @@ public: timers_db = NULL; mux_unit = NULL; log_h = NULL; - mac_cfg = NULL; + params = NULL; rntis = NULL; average_retx = 0; nof_pkts = 0; } bool init(srslte::log *log_h_, - mac_interface_rrc::ue_rnti_t *rntis_, - mac_interface_rrc::mac_cfg_t *mac_cfg_, + mac_interface_rrc_common::ue_rnti_t *rntis_, + mac_interface_rrc_common::ul_harq_params_t *params_, srslte::timers* timers_db_, mux *mux_unit_) { log_h = log_h_; mux_unit = mux_unit_; - mac_cfg = mac_cfg_; + params = params_; rntis = rntis_; timers_db = timers_db_; for (uint32_t i=0;imac_cfg->rach.max_harq_msg3_tx; + max_retx = harq_entity->params->max_harq_msg3_tx; } else { - max_retx = liblte_rrc_max_harq_tx_num[harq_entity->mac_cfg->main.ulsch_cnfg.max_harq_tx]; + max_retx = harq_entity->params->max_harq_tx; } // Receive and route HARQ feedbacks @@ -409,8 +409,8 @@ private: srslte::log *log_h; srslte::mac_pcap *pcap; - mac_interface_rrc::ue_rnti_t *rntis; - mac_interface_rrc::mac_cfg_t *mac_cfg; + mac_interface_rrc_common::ue_rnti_t *rntis; + mac_interface_rrc_common::ul_harq_params_t *params; float average_retx; uint64_t nof_pkts; diff --git a/srsue/src/mac/mac.cc b/srsue/src/mac/mac.cc index 9a461ca05..9fe08166f 100644 --- a/srsue/src/mac/mac.cc +++ b/srsue/src/mac/mac.cc @@ -66,13 +66,13 @@ bool mac::init(phy_interface_mac *phy, rlc_interface_mac *rlc, rrc_interface_mac srslte_softbuffer_rx_init(&pch_softbuffer, 100); bsr_procedure.init( rlc_h, log_h, &config, &timers_db); - phr_procedure.init(phy_h, log_h, &config, &timers_db); - mux_unit.init ( rlc_h, log_h, &bsr_procedure, &phr_procedure); - demux_unit.init (phy_h, rlc_h, log_h, &timers_db); - ra_procedure.init (phy_h, rrc, log_h, &uernti, &config, &timers_db, &mux_unit, &demux_unit); + phr_procedure.init(phy_h, log_h, &config, &timers_db); + mux_unit.init ( rlc_h, log_h, &bsr_procedure, &phr_procedure); + demux_unit.init (phy_h, rlc_h, log_h, &timers_db); + ra_procedure.init (phy_h, rrc, log_h, &uernti, &config, &timers_db, &mux_unit, &demux_unit); sr_procedure.init (phy_h, rrc, log_h, &config); - ul_harq.init ( log_h, &uernti, &config, &timers_db, &mux_unit); - dl_harq.init ( log_h, &config, &timers_db, &demux_unit); + ul_harq.init ( log_h, &uernti, &config.ul_harq_params, &timers_db, &mux_unit); + dl_harq.init ( log_h, &timers_db, &demux_unit); reset(); diff --git a/srsue/src/upper/rrc.cc b/srsue/src/upper/rrc.cc index a1805a1e9..144d98711 100644 --- a/srsue/src/upper/rrc.cc +++ b/srsue/src/upper/rrc.cc @@ -989,7 +989,8 @@ void rrc::apply_sib2_configs() mac->get_config(&cfg); cfg.main.time_alignment_timer = sib2.time_alignment_timer; memcpy(&cfg.rach, &sib2.rr_config_common_sib.rach_cnfg, sizeof(LIBLTE_RRC_RACH_CONFIG_COMMON_STRUCT)); - cfg.prach_config_index = sib2.rr_config_common_sib.prach_cnfg.root_sequence_index; + cfg.prach_config_index = sib2.rr_config_common_sib.prach_cnfg.root_sequence_index; + cfg.ul_harq_params.max_harq_msg3_tx = cfg.rach.max_harq_msg3_tx; mac->set_config(&cfg); rrc_log->info("Set RACH ConfigCommon: NofPreambles=%d, ResponseWindow=%d, ContentionResolutionTimer=%d ms\n", @@ -1218,7 +1219,13 @@ void rrc::apply_mac_config_dedicated(LIBLTE_RRC_MAC_MAIN_CONFIG_STRUCT *mac_cnfg } // Setup MAC configuration - mac->set_config_main(&default_cfg); + mac->set_config_main(&default_cfg); + + // Update UL HARQ config + mac_interface_rrc::mac_cfg_t cfg; + mac->get_config(&cfg); + cfg.ul_harq_params.max_harq_tx = liblte_rrc_max_harq_tx_num[default_cfg.ulsch_cnfg.max_harq_tx]; + mac->set_config(&cfg); rrc_log->info("Set MAC main config: harq-MaxReTX=%d, bsr-TimerReTX=%d, bsr-TimerPeriodic=%d\n", liblte_rrc_max_harq_tx_num[default_cfg.ulsch_cnfg.max_harq_tx],