aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/lchan_fsm.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-07-12 05:00:03 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2018-07-28 12:18:23 +0200
commit73ecfbb8228bcefad9cbc52d6fdf3da70a534c4f (patch)
tree2037a22288ac393eb57be9d65be75234fcd871b7 /src/osmo-bsc/lchan_fsm.c
parent18ce10b7b113480a43c0b11513aaf387a4a865a5 (diff)
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
Diffstat (limited to 'src/osmo-bsc/lchan_fsm.c')
-rw-r--r--src/osmo-bsc/lchan_fsm.c40
1 files changed, 38 insertions, 2 deletions
diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c
index 7a9f57fb2..9f053ac4a 100644
--- a/src/osmo-bsc/lchan_fsm.c
+++ b/src/osmo-bsc/lchan_fsm.c
@@ -755,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);
@@ -828,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);
}
@@ -879,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);
}
@@ -946,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);
}
@@ -1033,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)
@@ -1236,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)
@@ -1252,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)
@@ -1267,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)
@@ -1281,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)
@@ -1296,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)
@@ -1320,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)