<p>Neels Hofmeyr has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/9502">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">doc: copy current charts to doc/old/ for later reference<br><br>Change-Id: Iac18f12529d5961a66e4853dc3a93636eb499127<br>---<br>M configure.ac<br>M doc/Makefile.am<br>A doc/old/Makefile.am<br>A doc/old/assignment.msc<br>A doc/old/handover.msc<br>A doc/old/lchan-release.msc<br>A doc/old/ms-channel-request.msc<br>7 files changed, 587 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/02/9502/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/configure.ac b/configure.ac</span><br><span>index 25bcad7..96d4c5a 100644</span><br><span>--- a/configure.ac</span><br><span>+++ b/configure.ac</span><br><span>@@ -182,4 +182,5 @@</span><br><span>     tests/handover/Makefile</span><br><span>     doc/Makefile</span><br><span>     doc/examples/Makefile</span><br><span style="color: hsl(120, 100%, 40%);">+    doc/old/Makefile</span><br><span>     Makefile)</span><br><span>diff --git a/doc/Makefile.am b/doc/Makefile.am</span><br><span>index ca0470d..c11cb08 100644</span><br><span>--- a/doc/Makefile.am</span><br><span>+++ b/doc/Makefile.am</span><br><span>@@ -1,5 +1,6 @@</span><br><span> SUBDIRS = \</span><br><span>   examples \</span><br><span style="color: hsl(120, 100%, 40%);">+    old \</span><br><span>        $(NULL)</span><br><span> </span><br><span> msc: \</span><br><span>diff --git a/doc/old/Makefile.am b/doc/old/Makefile.am</span><br><span>new file mode 100644</span><br><span>index 0000000..52680ec</span><br><span>--- /dev/null</span><br><span>+++ b/doc/old/Makefile.am</span><br><span>@@ -0,0 +1,13 @@</span><br><span style="color: hsl(120, 100%, 40%);">+msc: \</span><br><span style="color: hsl(120, 100%, 40%);">+ $(builddir)/handover.png \</span><br><span style="color: hsl(120, 100%, 40%);">+    $(builddir)/assignment.png \</span><br><span style="color: hsl(120, 100%, 40%);">+  $(builddir)/lchan-release.png \</span><br><span style="color: hsl(120, 100%, 40%);">+       $(builddir)/ms-channel-request.png \</span><br><span style="color: hsl(120, 100%, 40%);">+  $(NULL)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+$(builddir)/%.png: $(srcdir)/%.msc</span><br><span style="color: hsl(120, 100%, 40%);">+ mscgen -T png -o $@ $<</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+.PHONY: poll</span><br><span style="color: hsl(120, 100%, 40%);">+poll:</span><br><span style="color: hsl(120, 100%, 40%);">+      while true; do $(MAKE) msc; sleep 1; done</span><br><span>diff --git a/doc/old/assignment.msc b/doc/old/assignment.msc</span><br><span>new file mode 100644</span><br><span>index 0000000..d470d01</span><br><span>--- /dev/null</span><br><span>+++ b/doc/old/assignment.msc</span><br><span>@@ -0,0 +1,190 @@</span><br><span style="color: hsl(120, 100%, 40%);">+msc {</span><br><span style="color: hsl(120, 100%, 40%);">+    hscale=3;</span><br><span style="color: hsl(120, 100%, 40%);">+     ms [label="MS"], bts [label="BTS"], bsc[label="BSC"], bsc_gscon[label="BSC conn FSM"], bsc_mgcp[label="BSC mgcp FSM"], mgw[label="MGW"], msc_[label="MSC"];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   ms note msc_ [label="lchan allocation sequence for BSSMAP Assignment Request"];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc <= msc_ [label="BSSMAP Assignment Request"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc box bsc [label="bssmap_handle_assignm_req()"];</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc -> bsc_gscon [label="GSCON_EV_A_ASSIGNMENT_CMD"];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  --- [label="is the chan_mode a speech mode?"];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    bsc_gscon abox bsc_gscon [label="ST_WAIT_CRCX_BTS (MGCP_MGW_TIMEOUT = 4s)"];</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc_gscon -> bsc_mgcp [label="mgcp_conn_create()"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bsc_mgcp => mgw [label="CRCX (for BTS)"];</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc_mgcp abox bsc_mgcp [label="ST_CRCX (MGCP_MGW_TIMEOUT = 4s)"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc_gscon note bsc_mgcp [label="two timeouts running in parallel"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc_gscon note bsc_mgcp [label="note: #define MGCP_MGW_TIMEOUT exists twice,</span><br><span style="color: hsl(120, 100%, 40%);">+                                    once in libosmo-mgcp-client,</span><br><span style="color: hsl(120, 100%, 40%);">+                                  once in bsc_subscr_conn_fsm.c"];</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc_mgcp -> bsc_gscon [label="mgcp_conn_create() exits"];</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc_gscon -> bsc [label="bssmap_handle_assignm_req() exits"];</span><br><span style="color: hsl(120, 100%, 40%);">+    ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  --- [label="On Timeout"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc_gscon note bsc_gscon [label="The conn FSM likely timeouts first"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bsc_gscon => msc_ [label="BSSMAP Assignment Failure"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc_gscon abox bsc_gscon [label="ST_ACTIVE"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc_mgcp note bsc_mgcp [label="The MGCP FSM will timeout right after that, and terminate itself,</span><br><span style="color: hsl(120, 100%, 40%);">+                               emitting the parent_term event set upon mgcp_conn_create():"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc_mgcp -> bsc_gscon [label="GSCON_EV_MGW_FAIL_BTS"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc_gscon note bsc_gscon [label="GSCON_EV_MGW_FAIL_BTS is handled by the conn FSM allstate</span><br><span style="color: hsl(120, 100%, 40%);">+                                       handler. It sets conn->user_plane.fi_bts = NULL. There is code</span><br><span style="color: hsl(120, 100%, 40%);">+                                     that would emit a BSSMAP Assignment Failure, but not in</span><br><span style="color: hsl(120, 100%, 40%);">+                                       ST_ACTIVE"];</span><br><span style="color: hsl(120, 100%, 40%);">+     --- [label="end: 'On Timeout'"];</span><br><span style="color: hsl(120, 100%, 40%);">+    ...;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc_mgcp <= mgw [label="CRCX OK (for BTS)"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc_mgcp box bsc_mgcp [label="libosmo-mgcp-client fsm_crcx_resp_cb()"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc_mgcp -> bsc_gscon [label="GSCON_EV_MGW_CRCX_RESP_BTS"];</span><br><span style="color: hsl(120, 100%, 40%);">+      --- [label="end: 'is the chan_mode a speech mode?'"];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc_gscon note bsc_gscon [label="for mode=sign, we're still handling GSCON_EV_A_ASSIGNMENT_CMD;</span><br><span style="color: hsl(120, 100%, 40%);">+                                       for speech mode, we're handling GSCON_EV_MGW_CRCX_RESP_BTS"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc <- bsc_gscon [label="gsm0808_assign_req()"];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc box bsc [label="lchan_alloc(): pick available lchan"];</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc box bsc [label="rsl_chan_activate_lchan()"];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  --- [label="is the chosen lchan on dynamic timeslot that is currently used as PDCH?"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bts <= bsc [label="i) RSL RF Chan Release of PDCH (Osmocom dyn TS)"];</span><br><span style="color: hsl(120, 100%, 40%);">+    bts <= bsc [label="OR ii) RSL PDCH Deact (ip.access dyn TS)"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc -> bsc_gscon [label="gsm0808_assign_req() returns early"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc_gscon abox bsc_gscon [label="ST_WAIT_ASS_COMPL (GSM0808_T10_VALUE=6s)"];</span><br><span style="color: hsl(120, 100%, 40%);">+        ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bts note bsc_gscon [linecolor="red",</span><br><span style="color: hsl(120, 100%, 40%);">+                label="Osmocom style dyn TS use lchan->act_timer to watch over RF Chan Release, but there</span><br><span style="color: hsl(120, 100%, 40%);">+             seems to be no timer watching over PDCH Deact!"];</span><br><span style="color: hsl(120, 100%, 40%);">+        ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bts => bsc [label="i) RSL RF Chan Release ACK (Osmocom dyn TS)"];</span><br><span style="color: hsl(120, 100%, 40%);">+        bts => bsc [label="OR ii) RSL PDCH Deact ACK (ip.access dyn TS)"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc box bsc [label="rsl_chan_activate_lchan() re-invoked"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc box bsc [label="lchan->state = LCHAN_S_ACT_REQ"];</span><br><span style="color: hsl(120, 100%, 40%);">+    bts <= bsc [label="RSL Chan Activ"];</span><br><span style="color: hsl(120, 100%, 40%);">+     --- [label="else (no dyn TS switchover)"];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc box bsc [label="lchan->state = LCHAN_S_ACT_REQ"];</span><br><span style="color: hsl(120, 100%, 40%);">+    bts <= bsc [label="RSL Chan Activ"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc -> bsc_gscon [label="gsm0808_assign_req() returns"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc_gscon abox bsc_gscon [label="ST_WAIT_ASS_COMPL (GSM0808_T10_VALUE=6s)"];</span><br><span style="color: hsl(120, 100%, 40%);">+        ---;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  --- [label="On Timeout"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc_gscon => msc_ [label="BSSMAP Assignment Failure"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc_gscon abox bsc_gscon [label="ST_ACTIVE"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc_gscon note bsc_mgcp [linecolor="red",</span><br><span style="color: hsl(120, 100%, 40%);">+     label="The mgcp FSM from CRCX above apparently lacks a cleanup action for this case.</span><br><span style="color: hsl(120, 100%, 40%);">+            It should be cleaned up eventually when the conn is torn down, but we should</span><br><span style="color: hsl(120, 100%, 40%);">+          release RTP endpoints as soon as possible."];</span><br><span style="color: hsl(120, 100%, 40%);">+   --- [label="end: 'On Timeout'"];</span><br><span style="color: hsl(120, 100%, 40%);">+    ...;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        bts => bsc [label="RSL Chan Activ ACK"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc box bsc [label="rsl_rx_chan_act_ack()"];</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc box bsc [label="Stop lchan->act_timer"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc box bsc [label="lchan->state = LCHAN_S_ACTIVE"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc -> bsc [label="S_LCHAN_ACTIVATE_ACK"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc box bsc [label="bsc_api.c handle_chan_ack()"];</span><br><span style="color: hsl(120, 100%, 40%);">+  ms <= bsc [label="RR Assignment Command"];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  ms note bsc_gscon [label="We rely on the overall conn FSM ST_WAIT_ASS_COMPL timeout."];</span><br><span style="color: hsl(120, 100%, 40%);">+     ...;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        ms => bsc [label="RR Assignment Complete"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bsc box bsc [label="handle_ass_compl()"];</span><br><span style="color: hsl(120, 100%, 40%);">+   --- [label="Release old lchan"];</span><br><span style="color: hsl(120, 100%, 40%);">+    bsc box bsc [label="_lchan_handle_release(sacch_deact=0)"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc box bsc [label="rsl_release_sapis_from(start=1)"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bts <= bsc [label="RSL Release Request (Local End)..."];</span><br><span style="color: hsl(120, 100%, 40%);">+ bts <= bsc [label="...for each SAPI except link_id=0"];</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc box bsc [label="rsl_release_request(link_id=0)"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bts <= bsc [label="RSL Release Request (Local End) for link_id=0"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bsc box bsc [label="_lchan_handle_release() returns here, the remaining release is asynchronous;</span><br><span style="color: hsl(120, 100%, 40%);">+                     see `End: 'Release old lchan'` below."];</span><br><span style="color: hsl(120, 100%, 40%);">+     ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bts note bsc_gscon [linecolor="red",</span><br><span style="color: hsl(120, 100%, 40%);">+          label="There seems to be no timer watching over RSL Release Request!"];</span><br><span style="color: hsl(120, 100%, 40%);">+   ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bts => bsc [label="RSL Release Confirm..."];</span><br><span style="color: hsl(120, 100%, 40%);">+     bts => bsc [label="...for each SAPI and link_id=0"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc abox bsc [label="start T3111"];</span><br><span style="color: hsl(120, 100%, 40%);">+ ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc box bsc [label="T3111 expires"];</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc abox bsc [label="Start lchan->act_timer with lchan_deact_tmr_cb"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bts <= bsc [label="RSL RF Channel Release"];</span><br><span style="color: hsl(120, 100%, 40%);">+     ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  --- [label="On timeout"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc box bsc [label="lchan_deact_tmr_cb()"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc box bsc [label="rsl_lchan_mark_broken(): state=LCHAN_S_BROKEN"];</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc box bsc [label="lchan_free()"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc -> bsc [label="S_LCHAN_UNEXPECTED_RELEASE"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc box bsc [label="bsc_api.c handle_release()"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc box bsc [label="bsc->assign_fail()"];</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc -> bsc_gscon [label="GSCON_EV_RR_ASS_FAIL"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc note bsc_gscon [linecolor="orange",</span><br><span style="color: hsl(120, 100%, 40%);">+       label="The name 'RR_ASS_FAIL' might suggest the event means an actual RR Assignment</span><br><span style="color: hsl(120, 100%, 40%);">+             Failure message being received. Maybe this should be called GSCON_EV_ASSIGNMENT_ERROR."];</span><br><span style="color: hsl(120, 100%, 40%);">+       ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc box bsc [label="bsc->clear_request()"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bsc box bsc [label="bsc_clear_request encodes a BSSMAP Clear Request message and passes it on</span><br><span style="color: hsl(120, 100%, 40%);">+                        to the conn FSM as data argument via:"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc -> bsc_gscon [label="GSCON_EV_TX_SCCP"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc_gscon => msc_ [label="BSSMAP Clear Request"];</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc note bsc_gscon [linecolor="red",</span><br><span style="color: hsl(120, 100%, 40%);">+          label="Instead of sending an arbitrary message, the conn FSM should</span><br><span style="color: hsl(120, 100%, 40%);">+             be explicitly instructed to clear the connection, to be able</span><br><span style="color: hsl(120, 100%, 40%);">+          to notice if the MSC failed to respond to the Clear Request.</span><br><span style="color: hsl(120, 100%, 40%);">+          Currently, this relies on the MSC responding with a Clear</span><br><span style="color: hsl(120, 100%, 40%);">+             Command, hopefully, some time later."];</span><br><span style="color: hsl(120, 100%, 40%);">+ --- [label="End: 'On timeout'"];</span><br><span style="color: hsl(120, 100%, 40%);">+    ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bts => bsc [label="RSL RF Channel Release Ack"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc box bsc [label="Stop lchan->act_timer"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc box bsc [label="Stop lchan->T3111"];</span><br><span style="color: hsl(120, 100%, 40%);">+ --- [label="End: 'Release old lchan'"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc box bsc [label="still in handle_ass_compl()"];</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc note bsc [label="officially take over new lchan: conn->lchan = conn->secondary_lchan"];</span><br><span style="color: hsl(120, 100%, 40%);">+   --- [label="is BTS using IPA Abis? (osmo-bts, ip.access)"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bts <= bsc [label="IPACC CRCX"];</span><br><span style="color: hsl(120, 100%, 40%);">+ ---;</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc -> bsc [label="handle_ass_compl() calls bsc_api->assign_compl()"];</span><br><span style="color: hsl(120, 100%, 40%);">+        --- [label="is BTS using IPA Abis? (osmo-bts, ip.access) && conn->user_plane.rtp_ip"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc box bsc [label="bsc_assign_compl()"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc note bsc [label="set ass_compl.valid = true,</span><br><span style="color: hsl(120, 100%, 40%);">+                     postponing GSCON_EV_RR_ASS_COMPL until after the</span><br><span style="color: hsl(120, 100%, 40%);">+                      IPACC MDCX ACK received in osmo_bsc_audio.c"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc box bsc [label="exit early: bsc_assign_compl()"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc box bsc [label="exit early: handle_ass_compl()"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc box bsc [label="osmo_bsc_audio.c"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bts => bsc [label="IPACC CRCX ACK"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bts <= bsc [label="IPACC MDCX"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bts => bsc [label="IPACC MDCX ACK"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc box bsc [label="handle_abisip_signal()"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc -> bsc_gscon [label="GSCON_EV_RR_ASS_COMPL"];</span><br><span style="color: hsl(120, 100%, 40%);">+        --- [label="else"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc box bsc [label="bsc_assign_compl()"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc -> bsc_gscon [label="GSCON_EV_RR_ASS_COMPL"];</span><br><span style="color: hsl(120, 100%, 40%);">+        --- ;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+       --- [label="is chan_mode a speech mode?"];</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc_gscon abox bsc_gscon [label="ST_WAIT_MDCX_BTS"];</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc_gscon -> bsc_mgcp [label="mgcp_conn_modify()"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bsc_mgcp note bsc_mgcp [label="same mgcp FSM as above, for BTS side"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bsc_mgcp => mgw [label="MDCX (for BTS)"];</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc_mgcp <= mgw [label="MDCX OK"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc_mgcp -> bsc_gscon [label="GSCON_EV_MGW_MDCX_RESP_BTS"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bsc_gscon abox bsc_gscon [label="ST_WAIT_CRCX_MSC"];</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc_gscon -> bsc_mgcp [label="mgcp_conn_create()"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bsc_mgcp note bsc_mgcp [label="second mgcp FSM for MSC side"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bsc_mgcp => mgw [label="CRCX (for MSC)"];</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc_mgcp <= mgw [label="CRCX OK (for MSC)"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc_gscon <- bsc_mgcp [label="GSCON_EV_MGW_CRCX_RESP_MSC"];</span><br><span style="color: hsl(120, 100%, 40%);">+      ---;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc_gscon => msc_ [label="BSSMAP Assignment Complete"];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc_gscon abox bsc_gscon [label="ST_ACTIVE"];</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span>diff --git a/doc/old/handover.msc b/doc/old/handover.msc</span><br><span>new file mode 100644</span><br><span>index 0000000..8862dd9</span><br><span>--- /dev/null</span><br><span>+++ b/doc/old/handover.msc</span><br><span>@@ -0,0 +1,170 @@</span><br><span style="color: hsl(120, 100%, 40%);">+# Handover between cells, intra-BSC</span><br><span style="color: hsl(120, 100%, 40%);">+msc {</span><br><span style="color: hsl(120, 100%, 40%);">+    hscale=3;</span><br><span style="color: hsl(120, 100%, 40%);">+     ms [label="MS"], bts [label="BTS"], bsc[label="BSC"], bsc_gscon[label="BSC conn FSM"], bsc_mgcp[label="BSC mgcp FSM"], mgw[label="MGW"];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        ms note mgw [label="intra-BSC Handover sequence"];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc_gscon abox bsc_gscon [label="ST_ACTIVE"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc box bsc [label="bsc_handover_start(): init conn->ho"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc -> bsc_gscon [label="GSCON_EV_HO_START"];</span><br><span style="color: hsl(120, 100%, 40%);">+    bsc <- bsc_gscon [label="bsc_handover_start_gscon()"];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc box bsc [label="lchan_alloc(): pick available lchan"];</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc box bsc [label="rsl_chan_activate_lchan()"];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  --- [label="is the chosen lchan on dynamic timeslot that is currently used as PDCH?"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bts <= bsc [label="i) RSL RF Chan Release of PDCH (Osmocom dyn TS)"];</span><br><span style="color: hsl(120, 100%, 40%);">+    bts <= bsc [label="OR ii) RSL PDCH Deact (ip.access dyn TS)"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc -> bsc_gscon [label="bsc_handover_start_gscon() returns early"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc_gscon abox bsc_gscon [label="ST_WAIT_HO_COMPL (no timeout, relies on T3103 below)"];</span><br><span style="color: hsl(120, 100%, 40%);">+    ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bts note bsc_gscon [linecolor="red",</span><br><span style="color: hsl(120, 100%, 40%);">+                label="Osmocom style dyn TS use lchan->act_timer to watch over RF Chan Release, but there</span><br><span style="color: hsl(120, 100%, 40%);">+             seems to be no timer watching over PDCH Deact!"];</span><br><span style="color: hsl(120, 100%, 40%);">+        ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bts => bsc [label="i) RSL RF Chan Release ACK (Osmocom dyn TS)"];</span><br><span style="color: hsl(120, 100%, 40%);">+        bts => bsc [label="OR ii) RSL PDCH Deact ACK (ip.access dyn TS)"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc box bsc [label="rsl_chan_activate_lchan() re-invoked"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bts <= bsc [label="RSL Chan Activ"];</span><br><span style="color: hsl(120, 100%, 40%);">+     --- [label="else (no dyn TS switchover)"];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        bts <= bsc [label="RSL Chan Activ"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc -> bsc_gscon [label="bsc_handover_start_gscon() returns"];</span><br><span style="color: hsl(120, 100%, 40%);">+   ---;</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc_gscon abox bsc_gscon [label="ST_WAIT_HO_COMPL (no timeout, relies on T3103 below)"];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+  ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bts note bsc_gscon [linecolor="red",</span><br><span style="color: hsl(120, 100%, 40%);">+          label="There seems to be no timer watching out for RSL Chan Activ ACK/NACK!"];</span><br><span style="color: hsl(120, 100%, 40%);">+    ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bts => bsc [label="RSL Chan Activ ACK"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc box bsc [label="rsl_rx_chan_act_ack()"];</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc box bsc [label="Stop lchan->act_timer"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc box bsc [label="lchan->state = LCHAN_S_ACTIVE"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc -> bsc [label="S_LCHAN_ACTIVATE_ACK"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc box bsc [label="handover_logic.c ho_logic_sig_cb()"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc box bsc [label="ho_chan_activ_ack()"];</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc note bsc [label="gsm48_send_ho_cmd()"];</span><br><span style="color: hsl(120, 100%, 40%);">+ ms <= bsc [label="RR Handover Command"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc abox bsc [label="start T3103"];</span><br><span style="color: hsl(120, 100%, 40%);">+ --- [label="is BTS using IPA Abis? (osmo-bts, ip.access)"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bts <= bsc [label="IPACC CRCX"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc -> bsc [label="ho_chan_activ_ack() returns"];</span><br><span style="color: hsl(120, 100%, 40%);">+        bts note bsc [linecolor="red",</span><br><span style="color: hsl(120, 100%, 40%);">+        label="There seems to be no timer watching over IPACC CRCX ACK/NACK!</span><br><span style="color: hsl(120, 100%, 40%);">+            If no response is received, we simply ignore that fact and carry on as if</span><br><span style="color: hsl(120, 100%, 40%);">+             everything was fine."];</span><br><span style="color: hsl(120, 100%, 40%);">+ ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bts note bsc [label="The IPACC CRCX and MDCX ACKs may come back at any time:</span><br><span style="color: hsl(120, 100%, 40%);">+                          before or after the Handover Detect, before or after Handover Complete."];</span><br><span style="color: hsl(120, 100%, 40%);">+  bts note bsc_mgcp [linecolor="red",</span><br><span style="color: hsl(120, 100%, 40%);">+   label="The CRCX ACK contains vital information for routing the RTP stream.</span><br><span style="color: hsl(120, 100%, 40%);">+              If the CRCX ACK were very slow, we would not know which RTP/RTPC ports</span><br><span style="color: hsl(120, 100%, 40%);">+                to point the MGW at, below at mgcp_conn_modify()!</span><br><span style="color: hsl(120, 100%, 40%);">+             Even though this being unrealistic, we must make sure to receive a CRCX ACK."];</span><br><span style="color: hsl(120, 100%, 40%);">+ ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc box bsc [label="osmo_bsc_audio.c"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bts => bsc [label="IPACC CRCX ACK"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bts <= bsc [label="IPACC MDCX"];</span><br><span style="color: hsl(120, 100%, 40%);">+ ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bts note bsc [linecolor="red",</span><br><span style="color: hsl(120, 100%, 40%);">+        label="There seems to be no timer watching over IPACC MDCX ACK/NACK!</span><br><span style="color: hsl(120, 100%, 40%);">+            If no response is received, we simply ignore that fact and carry on as if</span><br><span style="color: hsl(120, 100%, 40%);">+             everything was fine."];</span><br><span style="color: hsl(120, 100%, 40%);">+ ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bts => bsc [label="IPACC MDCX ACK"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bts note bsc [label="IPACC MDCX ACK triggers no events or actions"];</span><br><span style="color: hsl(120, 100%, 40%);">+        ---;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  ms => bsc [label="RR Handover Detect"];</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc -> bsc [label="S_LCHAN_HANDOVER_DETECT"];</span><br><span style="color: hsl(120, 100%, 40%);">+    bsc box bsc [label="ho_rsl_detect(): no action, only logging"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc note bsc_gscon [label="Handover Detect triggers no events or actions"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc note bsc_gscon [linecolor="red",</span><br><span style="color: hsl(120, 100%, 40%);">+          label="upon Handover Detect, we should already start re-routing the RTP!</span><br><span style="color: hsl(120, 100%, 40%);">+                Instead we wait for Handover Complete."];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  ms => bsc [label="RR Handover Complete"];</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc -> bsc [label="S_LCHAN_HANDOVER_COMPL"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc box bsc [label="handover_logic.c ho_logic_sig_cb()"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc box bsc [label="ho_gsm48_ho_compl()"];</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc box bsc [label="stop T3103"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bts note bsc_gscon [label="If anything goes wrong from this point on, we will not move back</span><br><span style="color: hsl(120, 100%, 40%);">+                                 to the old lchan: would be pointless after Handover Complete."];</span><br><span style="color: hsl(120, 100%, 40%);">+      bsc note bsc [label="officially take over new lchan: conn->lchan = ho->new_lchan"];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ --- [label="Release old lchan"];</span><br><span style="color: hsl(120, 100%, 40%);">+    bsc box bsc [label="_lchan_handle_release(sacch_deact=0)"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc box bsc [label="rsl_release_sapis_from(start=1)"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bts <= bsc [label="RSL Release Request (Local End)..."];</span><br><span style="color: hsl(120, 100%, 40%);">+ bts <= bsc [label="...for each SAPI except link_id=0"];</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc box bsc [label="rsl_release_request(link_id=0)"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bts <= bsc [label="RSL Release Request (Local End) for link_id=0"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bsc box bsc [label="_lchan_handle_release() returns here, the remaining release is asynchronous;</span><br><span style="color: hsl(120, 100%, 40%);">+                     see `End: 'Release old lchan'` below."];</span><br><span style="color: hsl(120, 100%, 40%);">+     ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bts note bsc_gscon [linecolor="red",</span><br><span style="color: hsl(120, 100%, 40%);">+          label="There seems to be no timer watching over RSL Release Request!"];</span><br><span style="color: hsl(120, 100%, 40%);">+   ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bts => bsc [label="RSL Release Confirm..."];</span><br><span style="color: hsl(120, 100%, 40%);">+     bts => bsc [label="...for each SAPI and link_id=0"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc abox bsc [label="start T3111"];</span><br><span style="color: hsl(120, 100%, 40%);">+ ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc box bsc [label="T3111 expires"];</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc abox bsc [label="Start lchan->act_timer with lchan_deact_tmr_cb"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bts <= bsc [label="RSL RF Channel Release"];</span><br><span style="color: hsl(120, 100%, 40%);">+     ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  --- [label="On timeout"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc box bsc [label="lchan_deact_tmr_cb()"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc box bsc [label="rsl_lchan_mark_broken(): state=LCHAN_S_BROKEN"];</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc box bsc [label="lchan_free()"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc -> bsc [label="S_LCHAN_UNEXPECTED_RELEASE"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc box bsc [label="bsc_api.c handle_release()"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc box bsc [label="bsc->clear_request()"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bsc box bsc [label="bsc_clear_request encodes a BSSMAP Clear Request message and passes it on</span><br><span style="color: hsl(120, 100%, 40%);">+                        to the conn FSM as data argument via:"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc -> bsc_gscon [label="GSCON_EV_TX_SCCP"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc_gscon rbox bsc_gscon [label="BSSMAP Clear Request to MSC"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc note bsc_gscon [linecolor="red",</span><br><span style="color: hsl(120, 100%, 40%);">+          label="During Handover, we actually release the entire conn just because we failed to</span><br><span style="color: hsl(120, 100%, 40%);">+           gracefully release the old lchan. That is obviously nonsense."];</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc note bsc [label="Stop T3101 (but was not active in this code path)"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc -> bsc [label="S_CHALLOC_FREED"];</span><br><span style="color: hsl(120, 100%, 40%);">+    --- [label="End: 'On timeout'"];</span><br><span style="color: hsl(120, 100%, 40%);">+    ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bts => bsc [label="RSL RF Channel Release Ack"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc box bsc [label="Stop lchan->act_timer"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc box bsc [label="Stop lchan->T3111"];</span><br><span style="color: hsl(120, 100%, 40%);">+ ---;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc box bsc [label="still in ho_gsm48_ho_compl()"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc note bsc [label="handover_free(), conn->ho = NULL"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc -> bsc_gscon [label="GSCON_EV_HO_COMPL"];</span><br><span style="color: hsl(120, 100%, 40%);">+    bsc note bsc_gscon [linecolor="orange",</span><br><span style="color: hsl(120, 100%, 40%);">+       label="Handover information is cleared before signalling the conn FSM.</span><br><span style="color: hsl(120, 100%, 40%);">+          That means the conn FSM cannot possibly log sensible information about exactly</span><br><span style="color: hsl(120, 100%, 40%);">+                which Handover has just completed."];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc_gscon abox bsc_gscon [label="ST_WAIT_MDCX_BTS_HO</span><br><span style="color: hsl(120, 100%, 40%);">+                                      (MGCP_MGW_TIMEOUT=4s with MGCP_MGW_HO_TIMEOUT_TIMER_NR)"];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    bsc_gscon -> bsc_mgcp [label="mgcp_conn_modify()"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bsc_mgcp note bsc_mgcp [label="mgcp FSM that was established for old lchan, for BTS side"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc_mgcp => mgw [label="MDCX (for BTS)"];</span><br><span style="color: hsl(120, 100%, 40%);">+        ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc_gscon note mgw [</span><br><span style="color: hsl(120, 100%, 40%);">+    label="If we get no MDCX ACK, the MGCP FSM terminates, and emits GSCON_EV_MGW_FAIL_BTS.</span><br><span style="color: hsl(120, 100%, 40%);">+                 Besides invalidating the MGCP FSM pointer, this event has no</span><br><span style="color: hsl(120, 100%, 40%);">+          effect in ST_WAIT_MDCX_BTS_HO, and we rely on above conn FSM</span><br><span style="color: hsl(120, 100%, 40%);">+          timeout instead."];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc_gscon note bsc_gscon [linecolor="red",</span><br><span style="color: hsl(120, 100%, 40%);">+    label="A timeout of ST_WAIT_MDCX_BTS_HO simply transitions back to ST_ACTIVE!</span><br><span style="color: hsl(120, 100%, 40%);">+           Even though the MGW failed, we carry on as if everything were fine."];</span><br><span style="color: hsl(120, 100%, 40%);">+  ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc_mgcp <= mgw [label="MDCX OK"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc_mgcp -> bsc_gscon [label="GSCON_EV_MGW_MDCX_RESP_BTS"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bsc_gscon abox bsc_gscon [label="ST_ACTIVE"];</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span>diff --git a/doc/old/lchan-release.msc b/doc/old/lchan-release.msc</span><br><span>new file mode 100644</span><br><span>index 0000000..f75b559</span><br><span>--- /dev/null</span><br><span>+++ b/doc/old/lchan-release.msc</span><br><span>@@ -0,0 +1,149 @@</span><br><span style="color: hsl(120, 100%, 40%);">+msc {</span><br><span style="color: hsl(120, 100%, 40%);">+  hscale=2;</span><br><span style="color: hsl(120, 100%, 40%);">+     ms [label="MS"], bts [label="BTS"], bsc[label="BSC"], bsc_gscon[label="BSC conn FSM"];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      ms note bsc_gscon [label="various lchan release scenarios"];</span><br><span style="color: hsl(120, 100%, 40%);">+        </span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    ms rbox bsc_gscon [label="IF BSC releases, from BSSMAP Clear Request"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc note bsc [label="lchan_release() may be called with sacch_deact=true or false.</span><br><span style="color: hsl(120, 100%, 40%);">+               Currently, the only time lchan_release(sacch_deact=true) is invoked is upon BSSMAP Clear</span><br><span style="color: hsl(120, 100%, 40%);">+              Command, i.e. when the MSC instructs to stop using an active lchan.</span><br><span style="color: hsl(120, 100%, 40%);">+           Some error handling code paths however directly invoke</span><br><span style="color: hsl(120, 100%, 40%);">+                rsl_rf_chan_release(error=1, SACCH_DEACTIVATE)."];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+     ---;</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc_gscon note bsc_gscon [label="Rx: BSSMAP Clear Request from MSC"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc <- bsc_gscon [label="gsm0808_clear()"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bsc box bsc [label="lchan_release(sacch_deact=1)"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc box bsc [label="lchan->state = LCHAN_S_REL_REQ"];</span><br><span style="color: hsl(120, 100%, 40%);">+    bsc box bsc [label="_lchan_handle_release(sacch_deact=1)"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc box bsc [label="rsl_release_sapis_from(start=1)"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bts <= bsc [label="RSL Release Request (Local End)..."];</span><br><span style="color: hsl(120, 100%, 40%);">+ bts <= bsc [label="...for each SAPI, except link_id=0"];</span><br><span style="color: hsl(120, 100%, 40%);">+ ms <= bsc [label="RR Channel Release"];</span><br><span style="color: hsl(120, 100%, 40%);">+  ms note bsc [label="There is no ACK for RR Channel Release"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc box bsc [label="rsl_deact_sacch()"];</span><br><span style="color: hsl(120, 100%, 40%);">+    bts <= bsc [label="RSL Deactivate SACCH"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc abox bsc [label="Start T3109 (net->T3109, t3109_expired())"];</span><br><span style="color: hsl(120, 100%, 40%);">+        ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  --- [label="If T3109 expires"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc box bsc [label="t3109_expired()"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bsc box bsc [label="rsl_rf_chan_release(error=1)"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bts <= bsc [label="RSL Release Request (Local End)..."];</span><br><span style="color: hsl(120, 100%, 40%);">+ bts <= bsc [label="...for each SAPI, except link_id=0"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc box bsc [label="lchan->state = LCHAN_S_REL_REQ"];</span><br><span style="color: hsl(120, 100%, 40%);">+    bts <= bsc [label="RSL RF Channel Release"];</span><br><span style="color: hsl(120, 100%, 40%);">+     ---;</span><br><span style="color: hsl(120, 100%, 40%);">+  ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc rbox bsc [label="continue in the 'Common' part"];</span><br><span style="color: hsl(120, 100%, 40%);">+       --- [label="END: 'BSSMAP Clear Request'"];</span><br><span style="color: hsl(120, 100%, 40%);">+  ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  ...;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        ms rbox bsc_gscon [label="IF BSC releases, from implicitly unused lchan"];</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc note bsc [label="The BSC may release old unused lchans after Handover, or release lchans</span><br><span style="color: hsl(120, 100%, 40%);">+             after some error condition."];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc note bsc [label="BSC decides to release an unused lchan"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bsc box bsc [label="lchan_release(sacch_deact=0)"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc box bsc [label="lchan->state = LCHAN_S_REL_REQ"];</span><br><span style="color: hsl(120, 100%, 40%);">+    bsc box bsc [label="_lchan_handle_release(sacch_deact=0)"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bts <= bsc [label="RSL Release Request (Local End)..."];</span><br><span style="color: hsl(120, 100%, 40%);">+ bts <= bsc [label="...for all SAPIs"];</span><br><span style="color: hsl(120, 100%, 40%);">+   ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bts note bsc_gscon [linecolor="red",</span><br><span style="color: hsl(120, 100%, 40%);">+          label="There seems to be no timer watching over RSL Release Request!"];</span><br><span style="color: hsl(120, 100%, 40%);">+   ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bts => bsc [label="RSL Release Confirm..."];</span><br><span style="color: hsl(120, 100%, 40%);">+     bts => bsc [label="...for all SAPIs"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc rbox bsc [label="continue in the 'Common' part"];</span><br><span style="color: hsl(120, 100%, 40%);">+       ---;</span><br><span style="color: hsl(120, 100%, 40%);">+  ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  ...;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        ms rbox bsc_gscon [label="IF MS releases"];</span><br><span style="color: hsl(120, 100%, 40%);">+ ms => bts [label="DISC"];</span><br><span style="color: hsl(120, 100%, 40%);">+        bts => bsc [label="RLL Release Ind..."];</span><br><span style="color: hsl(120, 100%, 40%);">+ bts => bsc [label="...for each SAPI"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc rbox bsc [label="continue in the 'Common' part"];</span><br><span style="color: hsl(120, 100%, 40%);">+       ---;</span><br><span style="color: hsl(120, 100%, 40%);">+  ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  ms rbox bsc_gscon [label="Common"];</span><br><span style="color: hsl(120, 100%, 40%);">+ --- [label="for each SAPI (?)"];</span><br><span style="color: hsl(120, 100%, 40%);">+    bts => bsc [label="RLL Release Confirm / RLL Release Ind"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bsc box bsc [label="abis_rsl_rx_rll()"];</span><br><span style="color: hsl(120, 100%, 40%);">+    bsc box bsc [label="mark lchan->sapis[link_id] = LCHAN_SAPI_UNUSED"];</span><br><span style="color: hsl(120, 100%, 40%);">+    bsc box bsc [label="rll_indication()"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc box bsc [label="for each bsc_rll_req matching this link_id:</span><br><span style="color: hsl(120, 100%, 40%);">+          disable timer, call cb(BSC_RLLR_IND_REL_IND)"];</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc box bsc [label="rsl_handle_release()"];</span><br><span style="color: hsl(120, 100%, 40%);">+ --- [label="IF all SAPIs are unused"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bsc box bsc [label="Stop T3109"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc note bsc [label="T3109 was started if the MSC requested the release"];</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc abox bsc [label="Start T3111 (net->T3111 value, t3111_expired())"];</span><br><span style="color: hsl(120, 100%, 40%);">+  --- [label="END: all SAPIs are unused"];</span><br><span style="color: hsl(120, 100%, 40%);">+    bsc -> bsc_gscon [label="GSCON_EV_RLL_REL_IND (only if RLL Release Ind)"];</span><br><span style="color: hsl(120, 100%, 40%);">+       --- [label="END: for each SAPI"];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc box bsc [label="T3111 expires"];</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc box bsc [label="rsl_rf_chan_release()"];</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc box bsc [label="Stop T3109"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc note bsc [label="[If lchan->state is LCHAN_S_REL_ERR, don't do anything]"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bsc abox bsc [label="Start lchan->act_timer (4s, lchan_deact_tmr_cb())"];</span><br><span style="color: hsl(120, 100%, 40%);">+        bts <= bsc [label="RSL RF Channel Release"];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+   ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  --- [label="IF lchan->act_timer expires"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc box bsc [label="lchan_deact_tmr_cb()"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc box bsc [label="rsl_lchan_mark_broken(): lchan->state = LCHAN_S_BROKEN"];</span><br><span style="color: hsl(120, 100%, 40%);">+    bsc box bsc [label="lchan_free() (see below)"];</span><br><span style="color: hsl(120, 100%, 40%);">+     --- [label="END: 'lchan->act_timer expires'"];</span><br><span style="color: hsl(120, 100%, 40%);">+   ...;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        bts => bsc [label="RSL RF Channel Release ACK"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc box bsc [label="rsl_rx_rf_chan_rel_ack()"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc box bsc [label="Stop lchan->act_timer"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc box bsc [label="Stop T3111"];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ --- [label="IF lchan->state == LCHAN_S_BROKEN"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc note bsc [label="If an ACK comes in late, for specific BTS models, we may choose to 'repair'</span><br><span style="color: hsl(120, 100%, 40%);">+         the lchan so that it is usable again, by calling do_lchan_free() directly (see below)."];</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc box bsc [label="rsl_rx_rf_chan_rel_ack() exits here and none of below actions happen.</span><br><span style="color: hsl(120, 100%, 40%);">+                The lchan remains LCHAN_S_BROKEN indefinitely."];</span><br><span style="color: hsl(120, 100%, 40%);">+        --- [label="END: lchan->state == LCHAN_S_BROKEN"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc box bsc [label="do_lchan_free()"];</span><br><span style="color: hsl(120, 100%, 40%);">+      --- [label="IF lchan->state == LCHAN_S_REL_ERR"];</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc note bsc [label="If release failed, we take the lchan back into operation after due</span><br><span style="color: hsl(120, 100%, 40%);">+          timeout"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc abox bsc [label="Start lchan->error_timer (T3111+2, error_timeout_cb())"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc note bsc [label="do_lchan_free() continues, async:"];</span><br><span style="color: hsl(120, 100%, 40%);">+   ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc box bsc [label="error_timeout_cb()"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc box bsc [label="lchan->state = LCHAN_S_NONE"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc box bsc [label="dyn TS: activate PDCH..."];</span><br><span style="color: hsl(120, 100%, 40%);">+     --- [label="ELSE"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc box bsc [label="lchan->state = LCHAN_S_NONE"];</span><br><span style="color: hsl(120, 100%, 40%);">+       --- [label="END: lchan->state == LCHAN_S_REL_ERR"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bsc box bsc [label="lchan_free()"];</span><br><span style="color: hsl(120, 100%, 40%);">+ --- [label="IF conn is still associated (and not dyn TS in switchover)"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc -> bsc [label="S_LCHAN_UNEXPECTED_RELEASE"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc box bsc [label="handle_release()"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc box bsc [label="Stop T10"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc note bsc [linecolor=orange,label="conn->T10 is actually dead code, it is never started.</span><br><span style="color: hsl(120, 100%, 40%);">+           Instead, the conn FSM starts ST_WAIT_ASS_COMPL with a T10 value."];</span><br><span style="color: hsl(120, 100%, 40%);">+      bsc -> bsc_gscon [label="GSCON_EV_RR_ASS_FAIL"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc -> bsc_gscon [label="GSCON_EV_TX_SCCP: BSSMAP Clear Request"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc box bsc [label="bsc_clear_handover()"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc box bsc [label="Stop T3103"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc box bsc [label="free handover struct"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc box bsc [label="lchan->conn = NULL"];</span><br><span style="color: hsl(120, 100%, 40%);">+        --- [label="END: 'conn is still associated'"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bsc box bsc [label="Stop T3101"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc note bsc [label="T3101 is started when sending an RR Immediate Assignment"];</span><br><span style="color: hsl(120, 100%, 40%);">+    bsc -> bsc [label="S_CHALLOC_FREED"];</span><br><span style="color: hsl(120, 100%, 40%);">+    bsc -> bsc [label="rll_lchan_signal()"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc box bsc [label="for each bsc_rll_req matching this lchan:</span><br><span style="color: hsl(120, 100%, 40%);">+            disable timer, call cb(BSC_RLLR_IND_REL_IND)"];</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span>diff --git a/doc/old/ms-channel-request.msc b/doc/old/ms-channel-request.msc</span><br><span>new file mode 100644</span><br><span>index 0000000..c0ef60f</span><br><span>--- /dev/null</span><br><span>+++ b/doc/old/ms-channel-request.msc</span><br><span>@@ -0,0 +1,63 @@</span><br><span style="color: hsl(120, 100%, 40%);">+msc {</span><br><span style="color: hsl(120, 100%, 40%);">+       hscale=3;</span><br><span style="color: hsl(120, 100%, 40%);">+     ms [label="MS"], bts [label="BTS"], bsc[label="BSC"], bsc_gscon[label="BSC conn FSM"];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      ms note bsc_gscon [label="lchan allocation sequence for RSL Channel Request"];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+    ms => bts [label="RR Channel Request"];</span><br><span style="color: hsl(120, 100%, 40%);">+  bts => bsc [label="RSL Channel Request"];</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc box bsc [label="rsl_rx_chan_rqd()"];</span><br><span style="color: hsl(120, 100%, 40%);">+    bsc note bsc [label="Obtain RACH data from Request: - Reference - Access Delay (TA)</span><br><span style="color: hsl(120, 100%, 40%);">+              - Request Reason - Channel Type"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc note bsc [label="If the reason is PDCH, the RACH Request is forwarded to PCU and BSC is no</span><br><span style="color: hsl(120, 100%, 40%);">+           longer concerned (rsl_rx_pchan_rqd())."];</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc note bsc [label="Always try to allocate an SDCCH regardless of the requested type, only if no</span><br><span style="color: hsl(120, 100%, 40%);">+                SDCCH is available, look for the actually requested channel type."];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc box bsc [label="lchan_alloc(SDCCH, allow_bigger=0)"];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ --- [label="IF no lchan is available (neither SDCCH nor requested type)"];</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc note bsc [label="Figure out T3122 value from bts->T3122, network->T3122 or</span><br><span style="color: hsl(120, 100%, 40%);">+             GSM_T3122_DEFAULT"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc box bsc [label="rsl_send_imm_ass_rej()"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc note bsc [label="..."];</span><br><span style="color: hsl(120, 100%, 40%);">+ bts <= bsc [label="RR Immediate Assign Reject"];</span><br><span style="color: hsl(120, 100%, 40%);">+ ms <= bts [label="RR Immediate Assign Reject (possibly grouped with up to 4 others)"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc note bsc [label="rsl_rx_pchan_rqd() exits, no channel is allocated."];</span><br><span style="color: hsl(120, 100%, 40%);">+  ---;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc box bsc [label="Store RACH data in lchan->rqd_ref, rqd_ta"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc abox bsc [label="Start lchan->act_timer (4s, lchan_act_tmr_cb())"];</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc box bsc [label="rsl_chan_activate_lchan(RSL_ACT_INTRA_IMM_ASS)"];</span><br><span style="color: hsl(120, 100%, 40%);">+       --- [label="is the chosen lchan on dynamic timeslot that is currently used as PDCH?"];</span><br><span style="color: hsl(120, 100%, 40%);">+      bsc box bsc [linecolor=red,label="Osmocom style dyn TS use the lchan->act_timer for an RSL RF</span><br><span style="color: hsl(120, 100%, 40%);">+         Channel Release, to release PDCH mode. This will actually overwrite above act_timer!"];</span><br><span style="color: hsl(120, 100%, 40%);">+  bts <= bsc [label="i) RSL RF Chan Release of PDCH (Osmocom dyn TS)"];</span><br><span style="color: hsl(120, 100%, 40%);">+    bts <= bsc [label="OR ii) RSL PDCH Deact (ip.access dyn TS)"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc -> bsc_gscon [label="gsm0808_assign_req() returns early"];</span><br><span style="color: hsl(120, 100%, 40%);">+   bsc_gscon abox bsc_gscon [label="ST_WAIT_ASS_COMPL (GSM0808_T10_VALUE=6s)"];</span><br><span style="color: hsl(120, 100%, 40%);">+        ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bts note bsc_gscon [linecolor="red",</span><br><span style="color: hsl(120, 100%, 40%);">+                label="Osmocom style dyn TS use lchan->act_timer to watch over RF Chan Release, but there</span><br><span style="color: hsl(120, 100%, 40%);">+             seems to be no timer watching over PDCH Deact!"];</span><br><span style="color: hsl(120, 100%, 40%);">+        ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bts => bsc [label="i) RSL RF Chan Release ACK (Osmocom dyn TS)"];</span><br><span style="color: hsl(120, 100%, 40%);">+        bts => bsc [label="OR ii) RSL PDCH Deact ACK (ip.access dyn TS)"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc box bsc [label="rsl_chan_activate_lchan() re-invoked"];</span><br><span style="color: hsl(120, 100%, 40%);">+ ---;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc box bsc [label="lchan->state = LCHAN_S_ACT_REQ"];</span><br><span style="color: hsl(120, 100%, 40%);">+    bts <= bsc [label="RSL Chan Activ: Immediate Assignment"];</span><br><span style="color: hsl(120, 100%, 40%);">+       ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bsc note bsc [label="Timeout of lchan->act_timer causes the</span><br><span style="color: hsl(120, 100%, 40%);">+           lchan->state to go to LCHAN_S_BROKEN, but no events or actions</span><br><span style="color: hsl(120, 100%, 40%);">+             are triggered."];</span><br><span style="color: hsl(120, 100%, 40%);">+        ...;</span><br><span style="color: hsl(120, 100%, 40%);">+  bts => bsc [label="RSL Chan Activ ACK"];</span><br><span style="color: hsl(120, 100%, 40%);">+ bsc box bsc [label="rsl_rx_chan_act_ack()"];</span><br><span style="color: hsl(120, 100%, 40%);">+        bsc box bsc [label="Stop lchan->act_timer"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc box bsc [label="lchan->state = LCHAN_S_ACTIVE"];</span><br><span style="color: hsl(120, 100%, 40%);">+     bsc -> bsc [label="S_LCHAN_ACTIVATE_ACK (has no effect)"];</span><br><span style="color: hsl(120, 100%, 40%);">+       bsc note bsc [label="Since this was an Immediate Assignment, no further action is required on</span><br><span style="color: hsl(120, 100%, 40%);">+            behalf of the BSC. The MS is now free to use the lchan."];</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/9502">change 9502</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/9502"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bsc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Iac18f12529d5961a66e4853dc3a93636eb499127 </div>
<div style="display:none"> Gerrit-Change-Number: 9502 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: Jenkins Builder </div>