aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2021-03-05 09:48:18 +0100
committerHarald Welte <laforge@osmocom.org>2021-03-24 01:04:21 +0100
commitc51ddf27b49215a2eab385939f86a9e8bf523cd2 (patch)
tree24fdab3892095b059636faf9c1926ea99bc6ea9b /src
parentc962a2efc3ab30f9efc4219bebbae4a662ed0ec4 (diff)
gprs_ns2_vc_fsm: In IP-SNS/ALIVE mode, initial state is ALIVE/UNBLOCKED
Only when the ALIVE procedure fails, we mark a NS-VC as RECOVERING. Change-Id: Ieb860827c2149306b135c0e6c8b3cd3bbb78851e
Diffstat (limited to 'src')
-rw-r--r--src/gb/gprs_ns2_vc_fsm.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/gb/gprs_ns2_vc_fsm.c b/src/gb/gprs_ns2_vc_fsm.c
index cca724f3..65248eaf 100644
--- a/src/gb/gprs_ns2_vc_fsm.c
+++ b/src/gb/gprs_ns2_vc_fsm.c
@@ -245,13 +245,18 @@ static void ns2_st_unconfigured(struct osmo_fsm_inst *fi, uint32_t event, void *
case GPRS_NS2_EV_REQ_START:
switch (priv->nsvc->mode) {
case GPRS_NS2_VC_MODE_ALIVE:
- osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_RECOVERING, nsi->timeout[NS_TOUT_TNS_ALIVE], NS_TOUT_TNS_ALIVE);
+ if (priv->nsvc->nse->dialect == GPRS_NS2_DIALECT_SNS) {
+ /* In IP-SNS, the NS-VC are assumed initially alive, until the alive
+ * procedure should fail at some future point */
+ osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_UNBLOCKED, 0, 0);
+ } else {
+ osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_RECOVERING, nsi->timeout[NS_TOUT_TNS_ALIVE], NS_TOUT_TNS_ALIVE);
+ }
break;
case GPRS_NS2_VC_MODE_BLOCKRESET:
osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_RESET, nsi->timeout[NS_TOUT_TNS_RESET], NS_TOUT_TNS_RESET);
break;
}
-
break;
default:
OSMO_ASSERT(0);
@@ -428,17 +433,15 @@ static void ns2_st_alive_onenter(struct osmo_fsm_inst *fi, uint32_t old_state)
ns2_tx_alive(priv->nsvc);
ns2_nse_notify_unblocked(priv->nsvc, false);
-}
-
-static void ns2_st_alive_onleave(struct osmo_fsm_inst *fi, uint32_t next_state)
-{
- start_test_procedure(fi->priv);
+ start_test_procedure(priv);
}
static const struct osmo_fsm_state ns2_vc_states[] = {
[GPRS_NS2_ST_UNCONFIGURED] = {
.in_event_mask = S(GPRS_NS2_EV_REQ_START),
- .out_state_mask = S(GPRS_NS2_ST_RESET) | S(GPRS_NS2_ST_RECOVERING),
+ .out_state_mask = S(GPRS_NS2_ST_RESET) |
+ S(GPRS_NS2_ST_RECOVERING) |
+ S(GPRS_NS2_ST_UNBLOCKED),
.name = "UNCONFIGURED",
.action = ns2_st_unconfigured,
.onenter = ns2_st_unconfigured_onenter,
@@ -483,7 +486,6 @@ static const struct osmo_fsm_state ns2_vc_states[] = {
.name = "RECOVERING",
.action = ns2_st_alive,
.onenter = ns2_st_alive_onenter,
- .onleave = ns2_st_alive_onleave,
},
};