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