aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-07-12 05:00:03 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2018-07-16 16:24:26 +0200
commitdee4b236469dc6ff9f1ca680a71f2b79f8adf388 (patch)
tree31d7028cd521f74f45bd07b76c48325e3aaa0201 /src
parent645bdf0b1a3a8e155c0e54d4f4502fc41539e1f7 (diff)
cosmetics: 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
Diffstat (limited to 'src')
-rw-r--r--src/osmo-bsc/assignment_fsm.c10
-rw-r--r--src/osmo-bsc/handover_fsm.c17
-rw-r--r--src/osmo-bsc/lchan_fsm.c42
3 files changed, 62 insertions, 7 deletions
diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c
index aa35b9550..c7d55d815 100644
--- a/src/osmo-bsc/assignment_fsm.c
+++ b/src/osmo-bsc/assignment_fsm.c
@@ -434,8 +434,9 @@ static void assignment_fsm_wait_rr_ass_complete(struct osmo_fsm_inst *fi, uint32
return;
case ASSIGNMENT_EV_LCHAN_ESTABLISHED:
- /* The lchan is already done with all of its RTP setup. We will notice the lchan state to
- * be established in assignment_fsm_wait_lchan_established_onenter(). */
+ LOG_ASSIGNMENT(conn, LOGL_DEBUG, "lchan established, still waiting for RR Assignment Complete\n");
+ /* The lchan is already done with all of its RTP setup. We will notice the lchan state
+ * being LCHAN_ST_ESTABLISHED in assignment_fsm_wait_lchan_established_onenter(). */
return;
case ASSIGNMENT_EV_RR_ASSIGNMENT_FAIL:
@@ -454,8 +455,10 @@ static void assignment_fsm_wait_lchan_established_onenter(struct osmo_fsm_inst *
{
struct gsm_subscriber_connection *conn = assignment_fi_conn(fi);
/* Do we still need to wait for the RTP stream at all? */
- if (lchan_state_is(conn->assignment.new_lchan, LCHAN_ST_ESTABLISHED))
+ if (lchan_state_is(conn->assignment.new_lchan, LCHAN_ST_ESTABLISHED)) {
+ LOG_ASSIGNMENT(conn, LOGL_DEBUG, "lchan fully established, no need to wait");
assignment_fsm_post_lchan_established(fi);
+ }
}
static void assignment_fsm_wait_lchan_established(struct osmo_fsm_inst *fi, uint32_t event, void *data)
@@ -559,6 +562,7 @@ static const struct osmo_fsm_state assignment_fsm_states[] = {
.in_event_mask = 0
| S(ASSIGNMENT_EV_RR_ASSIGNMENT_COMPLETE)
| S(ASSIGNMENT_EV_RR_ASSIGNMENT_FAIL)
+ | S(ASSIGNMENT_EV_LCHAN_ESTABLISHED)
,
.out_state_mask = 0
| S(ASSIGNMENT_ST_WAIT_LCHAN_ESTABLISHED)
diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c
index 9d9c29b68..88b5118f4 100644
--- a/src/osmo-bsc/handover_fsm.c
+++ b/src/osmo-bsc/handover_fsm.c
@@ -862,6 +862,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;
@@ -881,9 +891,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(ho->mt.new_lchan, LCHAN_ST_ESTABLISHED))
+ if (conn->ho.fi && lchan_state_is(conn->ho.mt.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)
@@ -1059,6 +1070,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)
,
diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c
index 8653fdfc1..d9eae9c99 100644
--- a/src/osmo-bsc/lchan_fsm.c
+++ b/src/osmo-bsc/lchan_fsm.c
@@ -351,6 +351,8 @@ void lchan_fsm_alloc(struct gsm_lchan *lchan)
*/
static void lchan_reset(struct gsm_lchan *lchan)
{
+ LOG_LCHAN(lchan, LOGL_DEBUG, "Clearing lchan state");
+
if (lchan->rqd_ref) {
talloc_free(lchan->rqd_ref);
lchan->rqd_ref = NULL;
@@ -753,7 +755,11 @@ static void lchan_fsm_wait_mgw_endpoint_available(struct osmo_fsm_inst *fi, uint
case LCHAN_EV_MGW_ENDPOINT_AVAILABLE:
lchan->activate.mgw_endpoint_available = true;
lchan_fsm_tch_post_endpoint_available(fi);
- break;
+ return;
+
+ case LCHAN_EV_RLL_ESTABLISH_IND:
+ /* abis_rsl.c has noticed that a SAPI was established, no need to take action here. */
+ return;
default:
OSMO_ASSERT(false);
@@ -826,6 +832,10 @@ static void lchan_fsm_wait_ipacc_crcx_ack(struct osmo_fsm_inst *fi, uint32_t eve
lchan_fail("Received NACK on IPACC CRCX");
return;
+ case LCHAN_EV_RLL_ESTABLISH_IND:
+ /* abis_rsl.c has noticed that a SAPI was established, no need to take action here. */
+ return;
+
default:
OSMO_ASSERT(false);
}
@@ -877,6 +887,10 @@ static void lchan_fsm_wait_ipacc_mdcx_ack(struct osmo_fsm_inst *fi, uint32_t eve
lchan_fail("Received NACK on IPACC MDCX");
return;
+ case LCHAN_EV_RLL_ESTABLISH_IND:
+ /* abis_rsl.c has noticed that a SAPI was established, no need to take action here. */
+ return;
+
default:
OSMO_ASSERT(false);
}
@@ -944,6 +958,10 @@ static void lchan_fsm_wait_mgw_endpoint_configured(struct osmo_fsm_inst *fi, uin
lchan_fail("Error while redirecting the MGW to the BTS' RTP port");
return;
+ case LCHAN_EV_RLL_ESTABLISH_IND:
+ /* abis_rsl.c has noticed that a SAPI was established, no need to take action here. */
+ return;
+
default:
OSMO_ASSERT(false);
}
@@ -1031,7 +1049,19 @@ static void handle_rll_rel_ind_or_conf(struct osmo_fsm_inst *fi, uint32_t event,
static void lchan_fsm_established(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
- handle_rll_rel_ind_or_conf(fi, event, data, true);
+ switch (event) {
+ case LCHAN_EV_RLL_ESTABLISH_IND:
+ /* abis_rsl.c has noticed that a SAPI was established, no need to take action here. */
+ return;
+
+ case LCHAN_EV_RLL_REL_IND:
+ case LCHAN_EV_RLL_REL_CONF:
+ handle_rll_rel_ind_or_conf(fi, event, data, true);
+ return;
+
+ default:
+ OSMO_ASSERT(false);
+ }
}
static bool should_sacch_deact(struct gsm_lchan *lchan)
@@ -1234,6 +1264,7 @@ static const struct osmo_fsm_state lchan_fsm_states[] = {
.action = lchan_fsm_wait_mgw_endpoint_available,
.in_event_mask = 0
| S(LCHAN_EV_MGW_ENDPOINT_AVAILABLE)
+ | S(LCHAN_EV_RLL_ESTABLISH_IND) /* ignored */
,
.out_state_mask = 0
| S(LCHAN_ST_UNUSED)
@@ -1250,6 +1281,7 @@ static const struct osmo_fsm_state lchan_fsm_states[] = {
.in_event_mask = 0
| S(LCHAN_EV_IPACC_CRCX_ACK)
| S(LCHAN_EV_IPACC_CRCX_NACK)
+ | S(LCHAN_EV_RLL_ESTABLISH_IND) /* ignored */
,
.out_state_mask = 0
| S(LCHAN_ST_UNUSED)
@@ -1265,6 +1297,7 @@ static const struct osmo_fsm_state lchan_fsm_states[] = {
.in_event_mask = 0
| S(LCHAN_EV_IPACC_MDCX_ACK)
| S(LCHAN_EV_IPACC_MDCX_NACK)
+ | S(LCHAN_EV_RLL_ESTABLISH_IND) /* ignored */
,
.out_state_mask = 0
| S(LCHAN_ST_UNUSED)
@@ -1279,6 +1312,7 @@ static const struct osmo_fsm_state lchan_fsm_states[] = {
.action = lchan_fsm_wait_mgw_endpoint_configured,
.in_event_mask = 0
| S(LCHAN_EV_MGW_ENDPOINT_CONFIGURED)
+ | S(LCHAN_EV_RLL_ESTABLISH_IND) /* ignored */
,
.out_state_mask = 0
| S(LCHAN_ST_UNUSED)
@@ -1294,6 +1328,7 @@ static const struct osmo_fsm_state lchan_fsm_states[] = {
.in_event_mask = 0
| S(LCHAN_EV_RLL_REL_IND)
| S(LCHAN_EV_RLL_REL_CONF)
+ | S(LCHAN_EV_RLL_ESTABLISH_IND) /* ignored */
,
.out_state_mask = 0
| S(LCHAN_ST_UNUSED)
@@ -1318,6 +1353,9 @@ static const struct osmo_fsm_state lchan_fsm_states[] = {
},
[LCHAN_ST_WAIT_BEFORE_RF_RELEASE] = {
.name = "WAIT_BEFORE_RF_RELEASE",
+ .in_event_mask = 0
+ | S(LCHAN_EV_RLL_REL_IND) /* allow late REL_IND of SAPI[0] */
+ ,
.out_state_mask = 0
| S(LCHAN_ST_UNUSED)
| S(LCHAN_ST_WAIT_RF_RELEASE_ACK)