From e91a7ea5136c2706b1f15f1b31c249ce317e6847 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Fri, 20 Mar 2020 21:15:19 +0000 Subject: [PATCH] removed stack-mac interface dedicated methods. We use now the task dispatch methods instead --- lib/include/srslte/interfaces/ue_interfaces.h | 3 -- srsue/hdr/stack/mac/mac.h | 4 --- srsue/hdr/stack/ue_stack_lte.h | 4 --- srsue/src/stack/mac/mac.cc | 10 ------- srsue/src/stack/mac/proc_ra.cc | 15 ++++++++-- srsue/src/stack/ue_stack_lte.cc | 22 -------------- srsue/test/common/dummy_classes.h | 2 -- srsue/test/mac_test.cc | 30 ------------------- 8 files changed, 12 insertions(+), 78 deletions(-) diff --git a/lib/include/srslte/interfaces/ue_interfaces.h b/lib/include/srslte/interfaces/ue_interfaces.h index 91fc6aca3..ee36b835a 100644 --- a/lib/include/srslte/interfaces/ue_interfaces.h +++ b/lib/include/srslte/interfaces/ue_interfaces.h @@ -612,9 +612,6 @@ public: // STACK interface for MAC class stack_interface_mac : public task_handler_interface_lte { -public: - virtual void wait_ra_completion(uint16_t rnti) = 0; - virtual void start_prach_configuration() = 0; }; // STACK interface for MAC diff --git a/srsue/hdr/stack/mac/mac.h b/srsue/hdr/stack/mac/mac.h index 94209e611..71376bc12 100644 --- a/srsue/hdr/stack/mac/mac.h +++ b/srsue/hdr/stack/mac/mac.h @@ -72,9 +72,6 @@ public: void run_tti(const uint32_t tti); - /** Stack interface */ - void notify_phy_config_completed(); - /******** Interface from RRC (RRC -> MAC) ****************/ void bcch_start_rx(int si_window_start, int si_window_length); void bcch_stop_rx(); @@ -102,7 +99,6 @@ public: /*********** interface for stack ******************/ void process_pdus(); - void notify_ra_completed(); void start_pcap(srslte::mac_pcap* pcap); diff --git a/srsue/hdr/stack/ue_stack_lte.h b/srsue/hdr/stack/ue_stack_lte.h index ee580e67f..0c6694e8b 100644 --- a/srsue/hdr/stack/ue_stack_lte.h +++ b/srsue/hdr/stack/ue_stack_lte.h @@ -118,10 +118,6 @@ public: bool is_lcid_enabled(uint32_t lcid) final { return pdcp.is_lcid_enabled(lcid); } - // Interface to upper MAC - void wait_ra_completion(uint16_t rnti) final; - void start_prach_configuration() final; - // Interface for RRC void start_cell_search() final; void start_cell_select(const phy_interface_rrc_lte::phy_cell_t* cell) final; diff --git a/srsue/src/stack/mac/mac.cc b/srsue/src/stack/mac/mac.cc index 80d50a3d6..a5716fc4f 100644 --- a/srsue/src/stack/mac/mac.cc +++ b/srsue/src/stack/mac/mac.cc @@ -509,11 +509,6 @@ void mac::process_pdus() } } -void mac::notify_ra_completed() -{ - ra_procedure.notify_ra_completed(); -} - uint32_t mac::get_current_tti() { return phy_h->get_current_tti(); @@ -606,11 +601,6 @@ void mac::start_noncont_ho(uint32_t preamble_index, uint32_t prach_mask) ra_procedure.start_noncont(preamble_index, prach_mask); } -void mac::notify_phy_config_completed() -{ - ra_procedure.notify_phy_config_completed(); -} - void mac::start_cont_ho() { ra_procedure.start_mac_order(56, true); diff --git a/srsue/src/stack/mac/proc_ra.cc b/srsue/src/stack/mac/proc_ra.cc index 4dd26932e..df09679f3 100644 --- a/srsue/src/stack/mac/proc_ra.cc +++ b/srsue/src/stack/mac/proc_ra.cc @@ -236,8 +236,13 @@ void ra_proc::state_contention_resolution() */ void ra_proc::state_completition() { - state = WAITING_COMPLETION; - stack->wait_ra_completion(rntis->crnti); + state = WAITING_COMPLETION; + uint16_t rnti = rntis->crnti; + stack->enqueue_background_task([this, rnti](uint32_t worker_id) { + phy_h->set_crnti(rnti); + // signal MAC RA proc to go back to idle + notify_ra_completed(); + }); } void ra_proc::notify_phy_config_completed() @@ -272,7 +277,11 @@ void ra_proc::initialization() // Instruct phy to configure PRACH state = WAITING_PHY_CONFIG; - stack->start_prach_configuration(); + stack->enqueue_background_task([this](uint32_t worker_id) { + phy_h->configure_prach_params(); + // notify back MAC + stack->notify_background_task_result([this]() { notify_phy_config_completed(); }); + }); } /* Resource selection as defined in 5.1.2 */ diff --git a/srsue/src/stack/ue_stack_lte.cc b/srsue/src/stack/ue_stack_lte.cc index 5e19aa596..1dec0b855 100644 --- a/srsue/src/stack/ue_stack_lte.cc +++ b/srsue/src/stack/ue_stack_lte.cc @@ -330,28 +330,6 @@ void ue_stack_lte::run_tti_impl(uint32_t tti, uint32_t tti_jump) } } -/******************** - * low MAC Interface - *******************/ - -void ue_stack_lte::wait_ra_completion(uint16_t rnti) -{ - background_tasks.push_task([this, rnti](uint32_t worker_id) { - phy->set_crnti(rnti); - // signal MAC RA proc to go back to idle - mac.notify_ra_completed(); - }); -} - -void ue_stack_lte::start_prach_configuration() -{ - background_tasks.push_task([this](uint32_t worker_id) { - phy->configure_prach_params(); - // notify back RRC - pending_tasks.push(background_queue_id, [this]() { mac.notify_phy_config_completed(); }); - }); -} - /*************************** * Task Handling Interface **************************/ diff --git a/srsue/test/common/dummy_classes.h b/srsue/test/common/dummy_classes.h index 1660c9b37..8bd1d3ed0 100644 --- a/srsue/test/common/dummy_classes.h +++ b/srsue/test/common/dummy_classes.h @@ -40,8 +40,6 @@ public: { timers.defer_callback(duration_ms, func); } - void wait_ra_completion(uint16_t rnti) override {} - void start_prach_configuration() override {} srslte::timer_handler timers{100}; srslte::task_multiqueue pending_tasks; diff --git a/srsue/test/mac_test.cc b/srsue/test/mac_test.cc index 2024ebb67..c930017ea 100644 --- a/srsue/test/mac_test.cc +++ b/srsue/test/mac_test.cc @@ -343,16 +343,6 @@ public: mac_h = mac_; phy_h = phy_; } - void wait_ra_completion(uint16_t rnti) final - { - phy_h->set_crnti(rnti); - mac_h->notify_ra_completed(); - } - void start_prach_configuration() final - { - phy_h->configure_prach_params(); - mac_h->notify_phy_config_completed(); - } bool events_exist() { for (int i = 0; i < pending_tasks.nof_queues(); ++i) { @@ -460,8 +450,6 @@ int mac_ul_sch_pdu_test1() rlc_log.set_level(srslte::LOG_LEVEL_DEBUG); rlc_log.set_hex_limit(100000); - srslte::timer_handler timers(64); - // dummy layers phy_dummy phy; rlc_dummy rlc(&rlc_log); @@ -527,8 +515,6 @@ int mac_ul_logical_channel_prioritization_test1() rlc_log.set_level(srslte::LOG_LEVEL_DEBUG); rlc_log.set_hex_limit(100000); - srslte::timer_handler timers(64); - // dummy layers phy_dummy phy; rlc_dummy rlc(&rlc_log); @@ -640,8 +626,6 @@ int mac_ul_logical_channel_prioritization_test2() rlc_log.set_level(srslte::LOG_LEVEL_DEBUG); rlc_log.set_hex_limit(100000); - srslte::timer_handler timers(64); - // dummy layers phy_dummy phy; rlc_dummy rlc(&rlc_log); @@ -740,8 +724,6 @@ int mac_ul_logical_channel_prioritization_test3() rlc_log.set_level(srslte::LOG_LEVEL_DEBUG); rlc_log.set_hex_limit(100000); - srslte::timer_handler timers(64); - // dummy layers phy_dummy phy; rlc_dummy rlc(&rlc_log); @@ -828,8 +810,6 @@ int mac_ul_sch_pdu_with_short_bsr_test() rlc_log.set_level(srslte::LOG_LEVEL_DEBUG); rlc_log.set_hex_limit(100000); - srslte::timer_handler timers(64); - // dummy layers phy_dummy phy; rlc_dummy rlc(&rlc_log); @@ -914,8 +894,6 @@ int mac_ul_sch_pdu_with_padding_bsr_test() rlc_log.set_level(srslte::LOG_LEVEL_DEBUG); rlc_log.set_hex_limit(100000); - srslte::timer_handler timers(64); - // dummy layers phy_dummy phy; rlc_dummy rlc(&rlc_log); @@ -1009,8 +987,6 @@ int mac_ul_sch_pdu_one_byte_test() rlc_log.set_level(srslte::LOG_LEVEL_DEBUG); rlc_log.set_hex_limit(100000); - srslte::timer_handler timers(64); - // dummy layers phy_dummy phy; rlc_dummy rlc(&rlc_log); @@ -1068,8 +1044,6 @@ int mac_ul_sch_pdu_two_byte_test() rlc_log.set_level(srslte::LOG_LEVEL_DEBUG); rlc_log.set_hex_limit(100000); - srslte::timer_handler timers(64); - // dummy layers phy_dummy phy; rlc_dummy rlc(&rlc_log); @@ -1127,8 +1101,6 @@ int mac_ul_sch_pdu_three_byte_test() rlc_log.set_level(srslte::LOG_LEVEL_DEBUG); rlc_log.set_hex_limit(100000); - srslte::timer_handler timers(64); - // dummy layers phy_dummy phy; rlc_dummy rlc(&rlc_log); @@ -1368,8 +1340,6 @@ int mac_random_access_test() rlc_log.set_level(srslte::LOG_LEVEL_DEBUG); rlc_log.set_hex_limit(100000); - srslte::timer_handler timers(64); - // dummy layers phy_dummy phy; phy.set_log(&phy_log);