This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
daniel gerrit-no-reply at lists.osmocom.orgdaniel has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/21240 ) Change subject: ns2: Split 'initiater' into initiate_{reset,block} ...................................................................... ns2: Split 'initiater' into initiate_{reset,block} Related: SYS#5002 Change-Id: Iff5aff0cf8d19d9c718dd11c4e731ced2aeb16ba --- M src/gb/gprs_ns2_vc_fsm.c 1 file changed, 28 insertions(+), 21 deletions(-) Approvals: Jenkins Builder: Verified daniel: Looks good to me, approved diff --git a/src/gb/gprs_ns2_vc_fsm.c b/src/gb/gprs_ns2_vc_fsm.c index 0d30f12..2761210 100644 --- a/src/gb/gprs_ns2_vc_fsm.c +++ b/src/gb/gprs_ns2_vc_fsm.c @@ -55,9 +55,10 @@ struct gprs_ns2_vc *nsvc; /* how often the timer was triggered */ int N; - /* The initiater is responsible to UNBLOCK the VC. The BSS is usually the initiater. - * It can change while runtime. The side which blocks an unblocked side.*/ - bool initiater; + /* The initiator is responsible to UNBLOCK the VC. The BSS is usually the initiator. + * It can change during runtime. The side which blocks an unblocked side.*/ + bool initiate_block; + bool initiate_reset; /* the alive counter is present in all states */ struct { @@ -241,7 +242,7 @@ if (old_state != GPRS_NS2_ST_RESET) priv->N = 0; - if (priv->initiater) + if (priv->initiate_reset) ns2_tx_reset(priv->nsvc, NS_CAUSE_OM_INTERVENTION); stop_test_procedure(priv); @@ -253,7 +254,7 @@ struct gprs_ns2_inst *nsi = ns_inst_from_fi(fi); struct gprs_ns2_vc_priv *priv = fi->priv; - if (priv->initiater) { + if (priv->initiate_reset) { switch (event) { case GPRS_NS2_EV_RESET_ACK: osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_BLOCKED, @@ -279,7 +280,7 @@ if (old_state != GPRS_NS2_ST_BLOCKED) priv->N = 0; - if (priv->initiater) + if (priv->initiate_block) ns2_tx_unblock(priv->nsvc); start_test_procedure(priv); @@ -289,7 +290,7 @@ { struct gprs_ns2_vc_priv *priv = fi->priv; - if (priv->initiater) { + if (priv->initiate_block) { switch (event) { case GPRS_NS2_EV_BLOCK: /* TODO: BLOCK is a UNBLOCK_NACK */ @@ -331,7 +332,7 @@ switch (event) { case GPRS_NS2_EV_BLOCK: - priv->initiater = false; + priv->initiate_block = false; ns2_tx_block_ack(priv->nsvc); osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_BLOCKED, 0, 2); @@ -419,10 +420,10 @@ struct gprs_ns2_inst *nsi = ns_inst_from_fi(fi); struct gprs_ns2_vc_priv *priv = fi->priv; - if (priv->initiater) { - /* PCU timeouts */ - switch (fi->state) { - case GPRS_NS2_ST_RESET: + /* PCU timeouts */ + switch (fi->state) { + case GPRS_NS2_ST_RESET: + if (priv->initiate_reset) { priv->N++; if (priv->N <= nsi->timeout[NS_TOUT_TNS_RESET_RETRIES]) { osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_RESET, nsi->timeout[NS_TOUT_TNS_RESET], 0); @@ -430,16 +431,20 @@ priv->N = 0; osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_RESET, nsi->timeout[NS_TOUT_TNS_RESET], 0); } - break; - case GPRS_NS2_ST_BLOCKED: + } + break; + case GPRS_NS2_ST_BLOCKED: + if (priv->initiate_block) { priv->N++; if (priv->N <= nsi->timeout[NS_TOUT_TNS_BLOCK_RETRIES]) { osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_BLOCKED, nsi->timeout[NS_TOUT_TNS_BLOCK], 0); } else { osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_RESET, nsi->timeout[NS_TOUT_TNS_RESET], 0); } - break; - case GPRS_NS2_ST_ALIVE: + } + break; + case GPRS_NS2_ST_ALIVE: + if (priv->initiate_reset) { priv->N++; if (priv->N <= nsi->timeout[NS_TOUT_TNS_ALIVE_RETRIES]) { osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_ALIVE, 0, 0); @@ -449,6 +454,7 @@ } break; } + break; } return 0; } @@ -502,7 +508,7 @@ /* move the FSM into reset */ if (fi->state != GPRS_NS2_ST_RESET) { - priv->initiater = false; + priv->initiate_reset = false; osmo_fsm_inst_state_chg(fi, GPRS_NS2_ST_RESET, nsi->timeout[NS_TOUT_TNS_RESET], NS_TOUT_TNS_RESET); } /* pass the event down into FSM action */ @@ -534,7 +540,7 @@ switch (fi->state) { case GPRS_NS2_ST_BLOCKED: /* 7.2.1: the BLOCKED_ACK might be lost */ - if (priv->initiater) { + if (priv->initiate_block) { gprs_ns2_recv_unitdata(fi, msg); return; } @@ -585,11 +591,11 @@ * \param ctx * \param vc * \param id a char representation of the virtual curcuit - * \param initiater initiater is the site which starts the connection. Usually the BSS. + * \param initiator initiator is the site which starts the connection. Usually the BSS. * \return NULL on error, otherwise the fsm */ struct osmo_fsm_inst *gprs_ns2_vc_fsm_alloc(struct gprs_ns2_vc *nsvc, - const char *id, bool initiater) + const char *id, bool initiator) { struct osmo_fsm_inst *fi; struct gprs_ns2_vc_priv *priv; @@ -601,7 +607,8 @@ nsvc->fi = fi; priv = fi->priv = talloc_zero(fi, struct gprs_ns2_vc_priv); priv->nsvc = nsvc; - priv->initiater = initiater; + priv->initiate_reset = initiator; + priv->initiate_block = initiator; osmo_timer_setup(&priv->alive.timer, alive_timeout_handler, fi); -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/21240 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: Iff5aff0cf8d19d9c718dd11c4e731ced2aeb16ba Gerrit-Change-Number: 21240 Gerrit-PatchSet: 2 Gerrit-Owner: daniel <dwillmann at sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann at sysmocom.de> Gerrit-Reviewer: laforge <laforge at osmocom.org> Gerrit-Reviewer: pespin <pespin at sysmocom.de> Gerrit-CC: lynxis lazus <lynxis at fe80.eu> Gerrit-MessageType: merged -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201120/926a9bbe/attachment.htm>