From 92221eb780841cdde07061824d939948d3eac168 Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Fri, 28 Aug 2020 16:09:27 +0100 Subject: [PATCH] update of rrc_interface_mac to remove signal from mac to rrc that RA failed in case of handover failure --- lib/include/srslte/interfaces/ue_interfaces.h | 4 ++-- srsue/hdr/stack/rrc/rrc.h | 2 +- srsue/src/stack/mac/proc_ra.cc | 2 +- srsue/src/stack/rrc/rrc.cc | 4 ++-- srsue/test/mac_test.cc | 20 ++++++------------- 5 files changed, 12 insertions(+), 20 deletions(-) diff --git a/lib/include/srslte/interfaces/ue_interfaces.h b/lib/include/srslte/interfaces/ue_interfaces.h index d33ff2065..294961ac0 100644 --- a/lib/include/srslte/interfaces/ue_interfaces.h +++ b/lib/include/srslte/interfaces/ue_interfaces.h @@ -129,8 +129,8 @@ public: class rrc_interface_mac : public rrc_interface_mac_common { public: - virtual void ho_ra_completed(bool ra_successful) = 0; - virtual void release_pucch_srs() = 0; + virtual void ho_ra_completed() = 0; + virtual void release_pucch_srs() = 0; }; // RRC interface for PHY diff --git a/srsue/hdr/stack/rrc/rrc.h b/srsue/hdr/stack/rrc/rrc.h index 01be3b211..21bae2a6f 100644 --- a/srsue/hdr/stack/rrc/rrc.h +++ b/srsue/hdr/stack/rrc/rrc.h @@ -125,7 +125,7 @@ public: void new_cell_meas(const std::vector& meas); // MAC interface - void ho_ra_completed(bool ra_successful) final; + void ho_ra_completed() final; void release_pucch_srs(); void run_tti(); void ra_problem(); diff --git a/srsue/src/stack/mac/proc_ra.cc b/srsue/src/stack/mac/proc_ra.cc index dc028944c..f51eb17a5 100644 --- a/srsue/src/stack/mac/proc_ra.cc +++ b/srsue/src/stack/mac/proc_ra.cc @@ -539,7 +539,7 @@ void ra_proc::complete() mux_unit->msg3_flush(); if (ra_is_ho) { - rrc->ho_ra_completed(true); + rrc->ho_ra_completed(); } log_h->console("Random Access Complete. c-rnti=0x%x, ta=%d\n", rntis->crnti, current_ta); rInfo("Random Access Complete. c-rnti=0x%x, ta=%d\n", rntis->crnti, current_ta); diff --git a/srsue/src/stack/rrc/rrc.cc b/srsue/src/stack/rrc/rrc.cc index 6a6c5636e..c407fc2b1 100644 --- a/srsue/src/stack/rrc/rrc.cc +++ b/srsue/src/stack/rrc/rrc.cc @@ -821,11 +821,11 @@ void rrc::send_rrc_con_reconfig_complete() send_ul_dcch_msg(RB_ID_SRB1, ul_dcch_msg); } -void rrc::ho_ra_completed(bool ra_successful) +void rrc::ho_ra_completed() { cmd_msg_t msg; msg.command = cmd_msg_t::HO_COMPLETE; - msg.lcid = ra_successful ? 1 : 0; + msg.lcid = 1; cmd_q.push(std::move(msg)); } diff --git a/srsue/test/mac_test.cc b/srsue/test/mac_test.cc index 4d2ae8ef7..bc9792447 100644 --- a/srsue/test/mac_test.cc +++ b/srsue/test/mac_test.cc @@ -321,15 +321,10 @@ private: class rrc_dummy : public rrc_interface_mac { public: - void ho_ra_completed(bool ra_successful) - { - ho_finish = true; - ho_finish_successful = ra_successful; - } + void ho_ra_completed() { ho_finish_successful = true; } void release_pucch_srs() { printf("%s\n", __FUNCTION__); } void run_tti(uint32_t tti) { printf("%s\n", __FUNCTION__); } void ra_problem() { rach_problem++; } - bool ho_finish = false; bool ho_finish_successful = false; uint32_t rach_problem = 0; }; @@ -1430,7 +1425,6 @@ int mac_random_access_test() phy.set_crnti(0); mac.start_cont_ho(); stack.run_tti(tti++); - rrc.ho_finish = false; my_test.nof_prachs = rach_cfg.ra_supervision_info.preamb_trans_max.to_number(); my_test.temp_rnti++; // Temporal C-RNTI has to change to avoid duplicate my_test.msg4_valid_conres = false; @@ -1438,7 +1432,7 @@ int mac_random_access_test() my_test.check_ra_successful = false; my_test.send_valid_ul_grant = false; TESTASSERT(!run_mac_ra_test(my_test, &mac, &phy, &tti, &stack)); - TESTASSERT(!rrc.ho_finish_successful && rrc.ho_finish); + TESTASSERT(!rrc.ho_finish_successful); // Test 8: Test Contention based Random Access. Same as above but we let the procedure finish successfully. mac_log->info("\n=========== Test %d =============\n", test_id++); @@ -1446,21 +1440,20 @@ int mac_random_access_test() phy.set_crnti(0); mac.start_cont_ho(); stack.run_tti(tti++); - rrc.ho_finish = false; my_test.nof_prachs = 1; my_test.temp_rnti++; // Temporal C-RNTI has to change to avoid duplicate my_test.send_valid_ul_grant = true; TESTASSERT(!run_mac_ra_test(my_test, &mac, &phy, &tti, &stack)); - TESTASSERT(rrc.ho_finish_successful && rrc.ho_finish); + TESTASSERT(rrc.ho_finish_successful); // Test 9: Test non-Contention based HO. Used in HO but preamble is given by the network. In addition to checking // that the given preamble is correctly passed to the PHY, in this case there is no contention. // In this first test, no RAR is received and RA procedure fails mac_log->info("\n=========== Test %d =============\n", test_id++); + rrc.ho_finish_successful = false; phy.set_prach_tti(tti + phy.prach_delay); stack.run_tti(tti++); phy.set_crnti(0); - rrc.ho_finish = false; my_test.preamble_idx = 3; mac.start_noncont_ho(my_test.preamble_idx, 0); stack.run_pending_tasks(); @@ -1469,7 +1462,7 @@ int mac_random_access_test() my_test.temp_rnti++; // Temporal C-RNTI has to change to avoid duplicate TESTASSERT(!run_mac_ra_test(my_test, &mac, &phy, &tti, &stack)); stack.run_tti(tti++); - TESTASSERT(!rrc.ho_finish_successful && rrc.ho_finish); + TESTASSERT(!rrc.ho_finish_successful); // Test 10: Test non-Contention based HO. Used in HO but preamble is given by the network. We check that // the procedure is considered successful without waiting for contention @@ -1477,7 +1470,6 @@ int mac_random_access_test() phy.set_prach_tti(tti + phy.prach_delay); stack.run_tti(tti++); phy.set_crnti(0); - rrc.ho_finish = false; my_test.preamble_idx = 3; mac.start_noncont_ho(my_test.preamble_idx, 0); stack.run_pending_tasks(); @@ -1487,7 +1479,7 @@ int mac_random_access_test() my_test.temp_rnti++; // Temporal C-RNTI has to change to avoid duplicate TESTASSERT(!run_mac_ra_test(my_test, &mac, &phy, &tti, &stack)); stack.run_tti(tti++); - TESTASSERT(rrc.ho_finish_successful && rrc.ho_finish); + TESTASSERT(rrc.ho_finish_successful); mac.stop();