From 73ecfbb8228bcefad9cbc52d6fdf3da70a534c4f Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Thu, 12 Jul 2018 05:00:03 +0200 Subject: cosmetic: FSMs: allow ignorable events In various FSMs, some events may appear later or earlier without need of action. Do not indicate these as 'ERROR' (event not permitted), but allow and ignore them. Debug-log about some of those. From the old code, we've taken over the habit to change into WAIT_BEFORE_RF_RELEASE even before SAPI[0] is released. Hence we may still receive a SAPI[0] REL_IND in WAIT_BEFORE_RF_RELEASE. Don't show this as error message, just silently accept it. Change-Id: Ie320c7c6a1436184aaf2ec5a1843e04f4b3414ab --- src/osmo-bsc/handover_fsm.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/osmo-bsc/handover_fsm.c') diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c index 0430a7f6d..0a6ee2471 100644 --- a/src/osmo-bsc/handover_fsm.c +++ b/src/osmo-bsc/handover_fsm.c @@ -870,6 +870,16 @@ static void ho_fsm_wait_rr_ho_complete(struct osmo_fsm_inst *fi, uint32_t event, switch (event) { + case HO_EV_RR_HO_DETECT: + /* Numerous HO Detect RACH bursts may follow after the initial one, ignore. */ + return; + + case HO_EV_LCHAN_ESTABLISHED: + LOG_HO(conn, LOGL_DEBUG, "lchan established, still waiting for RR Handover Complete\n"); + /* The lchan is already done with all of its RTP setup. We will notice the lchan state + * being LCHAN_ST_ESTABLISHED in ho_fsm_wait_lchan_established_onenter(). */ + return; + case HO_EV_RR_HO_COMPLETE: ho_fsm_state_chg(HO_ST_WAIT_LCHAN_ESTABLISHED); return; @@ -889,8 +899,10 @@ static void ho_fsm_wait_lchan_established_onenter(struct osmo_fsm_inst *fi, uint { struct gsm_subscriber_connection *conn = ho_fi_conn(fi); - if (conn->ho.fi && lchan_state_is(conn->ho.new_lchan, LCHAN_ST_ESTABLISHED)) + if (conn->ho.fi && lchan_state_is(conn->ho.new_lchan, LCHAN_ST_ESTABLISHED)) { + LOG_HO(conn, LOGL_DEBUG, "lchan already established earlier\n"); ho_fsm_post_lchan_established(fi); + } } static void ho_fsm_wait_lchan_established(struct osmo_fsm_inst *fi, uint32_t event, void *data) @@ -1066,6 +1078,8 @@ static const struct osmo_fsm_state ho_fsm_states[] = { .name = "WAIT_RR_HO_COMPLETE", .action = ho_fsm_wait_rr_ho_complete, .in_event_mask = 0 + | S(HO_EV_RR_HO_DETECT) /* ignore extra HO RACH */ + | S(HO_EV_LCHAN_ESTABLISHED) | S(HO_EV_RR_HO_COMPLETE) | S(HO_EV_RR_HO_FAIL) , -- cgit v1.2.3