blob: 79d32c5302c24ac69e6a6395495d1e1798beccfc [file] [log] [blame]
Neels Hofmeyr44fcc9f2018-05-28 14:29:49 +02001msc {
2 hscale=2;
3 bts [label="MS/BTS"], bsc[label="BSC"], bsc_ts[label="BSC timeslot FSM"], bsc_lchan[label="BSC lchan FSM"];
4
5 bsc box bsc [label="gsm_bts_alloc()"];
6 bsc box bsc [label="bts->c0 = gsm_bts_trx_alloc()"];
7 bsc -> bsc_ts;
8 bsc_ts box bsc_ts [label="trx->ts[*].fi = osmo_fsm_inst_alloc(timeslot_fsm)"];
9 bsc_ts abox bsc_ts [label="TS_ST_NOT_INITIALIZED"];
10 bsc -> bsc_lchan;
11 bsc_lchan box bsc_lchan [label="ts->lchan[*].ts = ts;\nts->lchan[*].nr = i;"];
12 bsc_lchan box bsc_lchan [label="ts->lchan[*].fi = NULL"];
13 bsc_ts note bsc_lchan [label="lchan_select() will only pick lchans from initialized timeslots of
14 the right pchan kind. lchan_select() shall OSMO_ASSERT(lchan->fi)."];
15 ...;
16 ...;
17
18 bts rbox bsc_lchan [label="reading config file"];
19 ...;
20 bsc box bsc [label="timeslot N"];
21 bsc box bsc [label="phys_chan_config X"];
22 bsc_ts box bsc_ts [label="ts->pchan_from_config = X"];
23 bsc_ts note bsc_ts [label="still TS_ST_NOT_INITIALIZED"];
24 ...;
25 bsc box bsc [label="trx 1..*"];
26 bsc box bsc [label="bts->trx_list add gsm_bts_trx_alloc()"];
27 bsc_ts rbox bsc_lchan [label="same as for c0 above"];
28 ...;
29 ...;
30 bts rbox bsc_lchan [label="Starting Operation"];
31 bts => bsc_ts [label="OML Channel OPSTART ACK"];
32 bsc_ts box bsc_ts [label="ts_on_oml_opstart()"];
33 bsc_ts box bsc_ts [label="ts->pchan_on_init = pchan_from_config"];
34 --- [label="IF dedicated TS"];
35 bsc_ts box bsc_ts [label="ts->pchan = ts->pchan_on_init"];
36 --- [label="ELSE: dyn TS"];
37 bsc_ts box bsc_ts [label="ts->pchan = NONE"];
38 --- [label="END: dyn TS"];
39 bsc_ts note bsc_lchan [label="Normally, the lchan FSM never terminates. Logic dictates that
40 the lchan is a child of the timeslot FSM, but it's not actually of functional importance
41 beyond basic sanity. Parent term event: TS_EV_LCHAN_UNUSED"];
42 bsc_ts box bsc_ts [label="Determine N = maximum number of lchans applicable to pchan_on_init"];
43 bsc_ts -> bsc_lchan;
44 bsc_lchan box bsc_lchan [label="ts->lchan[all N].type = osmo_fsm_inst_alloc(lchan_fsm)"];
45 bsc_lchan abox bsc_lchan [label="LCHAN_ST_UNUSED\n(initial state)"];
46 bsc_ts -> bsc_ts [label="ts_check_init()"];
47 ...;
48 bsc -> bsc_ts [label="RSL bootstrapped"];
49 bsc_ts -> bsc_ts [label="ts_check_init()"];
50 ...;
51 bsc_ts box bsc_ts [label="ts_check_init()"];
52 --- [label="as soon as both OML and RSL are ready:"];
53 bsc_ts box bsc_ts [label="ts_on_init()"];
54 bsc_ts abox bsc_ts [label="TS_ST_UNUSED"];
55 --- [label="dyn TS"];
56 bsc_ts box bsc_ts [label="onenter of TS_ST_UNUSED:"];
57 bsc_ts abox bsc_ts [label="TS_ST_WAIT_PDCH_ACT"];
58 ...;
59 bsc_ts abox bsc_ts [label="PDCH"];
60 --- [label="END: dyn TS"];
61 --- [label="END: OML and RSL ready"];
62 ...;
63 bsc box bsc [label="lchan_select() picks an unused lchan"];
64 bsc -> bsc_lchan [label="lchan_allocate()"];
65 bsc_lchan -> bsc_ts [label="TS_EV_LCHAN_REQUESTED"];
66
67 --- [label="dyn TS"];
68 bsc_ts note bsc_ts [label="possibly switch from PDCH...\n(see timeslot FSM)"];
69 bsc_ts box bsc_ts [label="ts->pchan =\n requested GSM_PCHAN_XXX type"];
70 ---;
71
72 bsc_ts -> bsc_lchan [label="LCHAN_EV_TS_READY"];
73 bsc_lchan note bsc_lchan [label="RSL Chan Alloc and so fort..."];
74 bsc_lchan abox bsc_lchan [label="LCHAN_ST_ACTIVE"];
75 ...;
76 bsc -> bsc_lchan [label="LCHAN_EV_RELEASE"];
77 bsc_lchan note bsc_lchan [label="...RSL RF Chan Release..."];
78 bsc_lchan abox bsc_lchan [label="LCHAN_ST_UNUSED"];
79 bsc_ts <- bsc_lchan [label="TS_EV_LCHAN_UNUSED"];
80 bsc_ts abox bsc_ts [label="TS_ST_UNUSED"];
81 --- [label="dyn TS"];
82 bsc_ts note bsc_ts [label="possibly switch to PDCH"];
83 ---;
84 ...;
85 ...;
86 bts rbox bsc_lchan [label="BTS RSL is dropped"];
87 bsc box bsc [label="ipaccess_drop_rsl()"];
88 bsc -> bsc_ts [label="ts[*]:"];
89 bsc_ts abox bsc_ts [label="TS_ST_NOT_INITIALIZED"];
90 bsc_ts note bsc_lchan [label="If it's just the RSL being dropped, transition lchan FSMs to
91 LCHAN_ST_UNUSED, but keep them allocated. Unless OML is re-established, any vty pchan
92 modifications must not take effect."];
93 bsc_ts -> bsc_lchan [label="lchan[*]:"];
94 bsc_lchan abox bsc_lchan [label="LCHAN_ST_UNUSED"];
95 bsc_ts <- bsc_lchan [label="TS_EV_LCHAN_UNUSED (ignored)"];
96 ...;
97 --- [label="when RSL comes back later:"];
98 bsc -> bsc_ts [label="RSL bootstrapped"];
99 bsc_ts box bsc_ts [label="ts_check_init()"];
100 bsc_ts rbox bsc_ts [label="see ts_check_init() above"];
101 ...;
102 ...;
103 bts rbox bsc_lchan [label="BTS OML is dropped"];
104 bsc note bsc [label="As part of OML drop, RSL is also dropped:"];
105 bsc box bsc [label="ipaccess_drop_rsl()"];
106 bsc -> bsc_ts [label="ts[*]:"];
107 bsc_ts abox bsc_ts [label="TS_ST_NOT_INITIALIZED"];
108 bsc rbox bsc [label="see 'BTS RSL is dropped' above"];
109 bsc -> bsc_ts [label="ts[*]:"];
110 bsc_ts -> bsc_lchan [label="lchan[*]:"];
111 bsc_lchan box bsc_lchan [label="osmo_fsm_inst_term()"];
112 bsc_ts <- bsc_lchan [label="TS_EV_LCHAN_UNUSED (ignored)"];
113 bsc_lchan box bsc_lchan [label="lchan->fi = NULL"];
114 bsc rbox bsc [label="Continue at 'Starting Operation'"];
115
116}