Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 1 | module RSL_Emulation { |
| 2 | |
Harald Welte | 35bb716 | 2018-01-03 21:07:52 +0100 | [diff] [blame] | 3 | /* RSL Emulation, runs on top of IPA_Emulation. It multiplexes/demultiplexes |
| 4 | * the individual connections (logical channels), so there can be separate TTCN-3 components |
| 5 | * handling each of the connections. |
| 6 | * |
| 7 | * The RSL_Emulation.main() function processes RSL messages from the IPA demultiplex |
| 8 | * stack via the IPA_RSL_PT, and dispatches them to the per-connection components. |
| 9 | * |
| 10 | * Outbound RSL connections are initiated by sending a RSLDC_ChanRqd primitive |
| 11 | * to the component running the RSL_Emulation.main() function. |
| 12 | * |
Harald Welte | ad2647b | 2018-03-22 19:53:55 +0100 | [diff] [blame] | 13 | * in case we're emulating the BTS-side of RSL: We have no clue as to which particular logical |
| 14 | * channel the BSC may decide to activate at which point, so we have to blindly acknowledge all |
| 15 | * channel activations. Still, a test case might be interested in the exact assignment message to |
| 16 | * determine the type of activation, encryption, codec flags etc. at some later point, when it's |
| 17 | * clear for which transaction this activation happened. We keep this in the LastChanAct table. |
| 18 | * |
| 19 | * (C) 2017-2018 by Harald Welte <laforge@gnumonks.org> |
Harald Welte | 35bb716 | 2018-01-03 21:07:52 +0100 | [diff] [blame] | 20 | * All rights reserved. |
| 21 | * |
| 22 | * Released under the terms of GNU General Public License, Version 2 or |
| 23 | * (at your option) any later version. |
Harald Welte | 34b5a95 | 2019-05-27 11:54:11 +0200 | [diff] [blame] | 24 | * |
| 25 | * SPDX-License-Identifier: GPL-2.0-or-later |
Harald Welte | 35bb716 | 2018-01-03 21:07:52 +0100 | [diff] [blame] | 26 | */ |
| 27 | |
Pau Espin Pedrol | a07cfd9 | 2018-10-22 15:54:41 +0200 | [diff] [blame] | 28 | import from Misc_Helpers all; |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 29 | import from General_Types all; |
| 30 | import from Osmocom_Types all; |
| 31 | import from GSM_Types all; |
| 32 | import from GSM_RR_Types all; |
| 33 | import from RSL_Types all; |
| 34 | import from IPA_Types all; |
| 35 | import from IPA_Emulation all; |
| 36 | |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 37 | /* General "base class" component definition, of which specific implementations |
| 38 | * derive themselves by means of the "extends" feature */ |
| 39 | type component RSL_DchanHdlr { |
| 40 | /* port facing up towards dedicated channel handler */ |
| 41 | port RSL_DCHAN_PT RSL; |
Harald Welte | f70df65 | 2018-01-29 22:00:23 +0100 | [diff] [blame] | 42 | port RSLEM_PROC_PT RSL_PROC; |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 43 | var RslChannelNr g_chan_nr; |
Harald Welte | 421e4d4 | 2018-02-12 20:04:50 +0100 | [diff] [blame] | 44 | /* second BTS / DChan during hand-over */ |
| 45 | port RSL_DCHAN_PT RSL1; |
| 46 | port RSLEM_PROC_PT RSL1_PROC; |
Neels Hofmeyr | 9140101 | 2019-07-11 00:42:35 +0200 | [diff] [blame] | 47 | port RSL_DCHAN_PT RSL2; |
| 48 | port RSLEM_PROC_PT RSL2_PROC; |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 49 | }; |
| 50 | |
| 51 | type record RSLDC_ChanRqd { |
| 52 | OCT1 ra, |
Pau Espin Pedrol | 6451b04 | 2018-10-24 20:36:16 +0200 | [diff] [blame] | 53 | GsmFrameNumber fn optional |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 54 | }; |
| 55 | |
Pau Espin Pedrol | 6451b04 | 2018-10-24 20:36:16 +0200 | [diff] [blame] | 56 | template (value) RSLDC_ChanRqd ts_RSLDC_ChanRqd(OCT1 ra, GsmFrameNumber fn) := { |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 57 | ra := ra, |
| 58 | fn := fn |
| 59 | } |
| 60 | |
Pau Espin Pedrol | 6451b04 | 2018-10-24 20:36:16 +0200 | [diff] [blame] | 61 | template (value) RSLDC_ChanRqd ts_RSLDC_ChanRqd_anyFN(OCT1 ra) := { |
| 62 | ra := ra, |
| 63 | fn := omit |
| 64 | } |
| 65 | |
Vadim Yanitskiy | 6de2fcb | 2020-05-25 19:40:45 +0700 | [diff] [blame] | 66 | type enumerated RSLEm_EventType { |
| 67 | RSLEM_EV_TRX_UP, |
| 68 | RSLEM_EV_TRX_DOWN |
| 69 | }; |
| 70 | |
| 71 | type record RSLEm_Event { |
| 72 | RSLEm_EventType ev_type, |
| 73 | IpaStreamId sid |
| 74 | }; |
| 75 | |
| 76 | template (value) RSLEm_Event ts_RSLEm_EV(RSLEm_EventType ev_type, |
| 77 | IpaStreamId sid) := { |
| 78 | ev_type := ev_type, |
| 79 | sid := sid |
| 80 | }; |
| 81 | template RSLEm_Event tr_RSLEm_EV(template RSLEm_EventType ev_type, |
| 82 | template IpaStreamId sid := ?) := { |
| 83 | ev_type := ev_type, |
| 84 | sid := sid |
| 85 | }; |
| 86 | |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 87 | type port RSL_DCHAN_PT message { |
Neels Hofmeyr | 1470fc6 | 2021-05-25 21:35:46 +0000 | [diff] [blame] | 88 | inout RSLDC_ChanRqd, RSL_Message, ASP_RSL_Unitdata; |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 89 | } with { extension "internal" }; |
| 90 | |
Harald Welte | 1c02fd1 | 2018-02-19 19:20:47 +0100 | [diff] [blame] | 91 | type port RSL_CCHAN_PT message { |
Vadim Yanitskiy | 6de2fcb | 2020-05-25 19:40:45 +0700 | [diff] [blame] | 92 | inout ASP_RSL_Unitdata, RSLEm_Event; |
Harald Welte | 1c02fd1 | 2018-02-19 19:20:47 +0100 | [diff] [blame] | 93 | } with { extension "internal" }; |
| 94 | |
| 95 | |
Harald Welte | f70df65 | 2018-01-29 22:00:23 +0100 | [diff] [blame] | 96 | signature RSLEM_register(uint8_t trx_nr, RslChannelNr chan_nr, RSL_DchanHdlr hdlr); |
Harald Welte | 1909f46 | 2018-01-29 22:29:29 +0100 | [diff] [blame] | 97 | signature RSLEM_unregister(uint8_t trx_nr, RslChannelNr chan_nr, RSL_DchanHdlr hdlr); |
Harald Welte | 70b52c9 | 2018-02-12 20:47:31 +0100 | [diff] [blame] | 98 | signature RSLEM_suspend(boolean suspend); |
Vadim Yanitskiy | e9c0635 | 2020-06-20 01:30:58 +0700 | [diff] [blame] | 99 | signature RSLEM_wait_queue(boolean enable); |
Harald Welte | ad2647b | 2018-03-22 19:53:55 +0100 | [diff] [blame] | 100 | signature RSLEM_get_last_act(in uint8_t trx_nr, in RslChannelNr chan_nr, out RSL_Message chan_act); |
Neels Hofmeyr | ad26fc0 | 2021-09-28 18:30:17 +0200 | [diff] [blame] | 101 | signature RSLEM_set_auto_chan_act_ack(boolean enable); |
Harald Welte | f70df65 | 2018-01-29 22:00:23 +0100 | [diff] [blame] | 102 | |
| 103 | type port RSLEM_PROC_PT procedure { |
Vadim Yanitskiy | e9c0635 | 2020-06-20 01:30:58 +0700 | [diff] [blame] | 104 | inout RSLEM_register, RSLEM_unregister, |
| 105 | RSLEM_suspend, RSLEM_wait_queue, |
Neels Hofmeyr | ad26fc0 | 2021-09-28 18:30:17 +0200 | [diff] [blame] | 106 | RSLEM_get_last_act, |
| 107 | RSLEM_set_auto_chan_act_ack; |
Harald Welte | f70df65 | 2018-01-29 22:00:23 +0100 | [diff] [blame] | 108 | } with { extension "internal" }; |
| 109 | |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 110 | /*********************************************************************** |
| 111 | * Client Component for a single dedicated channel |
| 112 | ***********************************************************************/ |
| 113 | |
Neels Hofmeyr | 3222e0e | 2021-07-20 22:25:38 +0200 | [diff] [blame] | 114 | private function f_rx_or_fail(template RSL_Message exp_rx, RSL_DCHAN_PT rsl_pt := RSL) runs on RSL_DchanHdlr return RSL_Message |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 115 | { |
| 116 | var RSL_Message rx_rsl; |
| 117 | timer T := 10.0; |
| 118 | |
| 119 | /* request a channel to be established */ |
| 120 | T.start; |
| 121 | alt { |
Neels Hofmeyr | 3222e0e | 2021-07-20 22:25:38 +0200 | [diff] [blame] | 122 | [] rsl_pt.receive(exp_rx) -> value rx_rsl { |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 123 | T.stop; |
| 124 | return rx_rsl; |
| 125 | } |
Neels Hofmeyr | 3222e0e | 2021-07-20 22:25:38 +0200 | [diff] [blame] | 126 | [] rsl_pt.receive { |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 127 | setverdict(fail, "Unexpected RSL message on DCHAN"); |
Daniel Willmann | e4ff537 | 2018-07-05 17:35:03 +0200 | [diff] [blame] | 128 | mtc.stop; |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 129 | } |
| 130 | [] T.timeout { |
| 131 | setverdict(fail, "Timeout waiting for RSL on DCHAN"); |
Daniel Willmann | e4ff537 | 2018-07-05 17:35:03 +0200 | [diff] [blame] | 132 | mtc.stop; |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 133 | } |
| 134 | } |
| 135 | /* never reached */ |
| 136 | return rx_rsl; |
| 137 | } |
| 138 | |
Neels Hofmeyr | 596393a | 2021-10-02 13:01:04 +0200 | [diff] [blame] | 139 | function f_chan_act_verify_tsc(RSL_Message chan_act, template uint3_t tsc) { |
| 140 | var RSL_IE_Body ie; |
| 141 | if (f_rsl_find_ie(chan_act, RSL_IE_CHAN_IDENT, ie)) { |
| 142 | var uint3_t got_tsc := ie.chan_ident.ch_desc.v.tsc; |
| 143 | if (not match(got_tsc, tsc)) { |
| 144 | setverdict(fail, "RSL CHANnel ACTIVation: unexpected TSC in Channel Description: expected ", |
| 145 | tsc, " got ", got_tsc); |
| 146 | mtc.stop; |
| 147 | } |
| 148 | } |
| 149 | } |
| 150 | |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 151 | /* establish a dedicated channel using 'ra' */ |
Neels Hofmeyr | b5b7a6e | 2021-06-04 19:03:45 +0200 | [diff] [blame] | 152 | function f_chan_est(OCT1 ra, octetstring est_l3, template RslLinkId link_id, GsmFrameNumber fn := 23, |
Neels Hofmeyr | 3222e0e | 2021-07-20 22:25:38 +0200 | [diff] [blame] | 153 | template uint3_t tsc := ?, RSL_DCHAN_PT rsl_pt := RSL, RSLEM_PROC_PT rsl_proc_pt := RSL_PROC) |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 154 | runs on RSL_DchanHdlr { |
| 155 | var RSL_Message rx_rsl; |
| 156 | var GsmRrMessage rr; |
| 157 | |
| 158 | /* request a channel to be established */ |
Neels Hofmeyr | 3222e0e | 2021-07-20 22:25:38 +0200 | [diff] [blame] | 159 | rsl_pt.send(ts_RSLDC_ChanRqd(ra, fn)); |
Neels Hofmeyr | b5b7a6e | 2021-06-04 19:03:45 +0200 | [diff] [blame] | 160 | /* At this point the BSC sends a CHAN ACTIV which we always ACK. Checking it below. */ |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 161 | /* expect immediate assignment */ |
Neels Hofmeyr | 3222e0e | 2021-07-20 22:25:38 +0200 | [diff] [blame] | 162 | rx_rsl := f_rx_or_fail(tr_RSL_IMM_ASSIGN, rsl_pt := rsl_pt); |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 163 | rr := dec_GsmRrMessage(rx_rsl.ies[1].body.full_imm_ass_info.payload); |
Neels Hofmeyr | b5b7a6e | 2021-06-04 19:03:45 +0200 | [diff] [blame] | 164 | if (not match(rr.payload.imm_ass.chan_desc.tsc, tsc)) { |
| 165 | setverdict(fail, "Immediate Assignment: unexpected TSC in Channel Description: expected ", tsc, " got ", |
| 166 | rr.payload.imm_ass.chan_desc.tsc); |
| 167 | mtc.stop; |
| 168 | } |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 169 | g_chan_nr := rr.payload.imm_ass.chan_desc.chan_nr; |
Neels Hofmeyr | 3222e0e | 2021-07-20 22:25:38 +0200 | [diff] [blame] | 170 | rsl_pt.send(ts_RSL_EST_IND(g_chan_nr, valueof(link_id), est_l3)); |
Neels Hofmeyr | b5b7a6e | 2021-06-04 19:03:45 +0200 | [diff] [blame] | 171 | |
| 172 | /* Check above CHAN ACTIV */ |
Neels Hofmeyr | 596393a | 2021-10-02 13:01:04 +0200 | [diff] [blame] | 173 | f_chan_act_verify_tsc(f_rslem_get_last_act(rsl_proc_pt, 0, g_chan_nr), tsc); |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 174 | } |
| 175 | |
| 176 | function f_deact_chan(RSL_Cause cause) runs on RSL_DchanHdlr |
| 177 | { |
| 178 | var RSL_Message rx_rsl; |
| 179 | |
| 180 | RSL.send(ts_RSL_CONN_FAIL_IND(g_chan_nr, cause)); |
| 181 | rx_rsl := f_rx_or_fail(tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL)); |
| 182 | /* FIXME RSL.send(ts_RSL_RF_CHAN_REL_ACK()) */ |
| 183 | } |
| 184 | |
| 185 | |
| 186 | |
| 187 | /*********************************************************************** |
| 188 | * Main Component |
| 189 | ***********************************************************************/ |
| 190 | |
| 191 | private type record ConnectionData { |
| 192 | /* component reference to the client component */ |
| 193 | RSL_DchanHdlr comp_ref, |
| 194 | /* RSL (dedicated) Channel number we're handling */ |
| 195 | uint8_t trx_nr optional, |
| 196 | IpaStreamId stream_id optional, |
| 197 | RslChannelNr chan_nr optional, |
| 198 | /* Random Reference */ |
| 199 | OCT1 ra optional, |
| 200 | GsmFrameNumber ra_fn optional |
| 201 | }; |
| 202 | |
| 203 | private function f_cid_by_comp_ref(RSL_DchanHdlr comp_ref) |
| 204 | runs on RSL_Emulation_CT return integer { |
| 205 | var integer i; |
| 206 | for (i := 0; i < sizeof(ConnectionTable); i := i+1) { |
Pau Espin Pedrol | 7096509 | 2020-06-23 14:29:56 +0200 | [diff] [blame] | 207 | if (ispresent(ConnectionTable[i].comp_ref) and |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 208 | ConnectionTable[i].comp_ref == comp_ref) { |
| 209 | return i; |
| 210 | } |
| 211 | } |
Vadim Yanitskiy | f79d936 | 2020-06-03 04:06:18 +0700 | [diff] [blame] | 212 | log("No Dchan handler for comp_ref=", comp_ref); |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 213 | return -1; |
| 214 | } |
| 215 | |
| 216 | private function f_cid_by_chan_nr(uint8_t trx_nr, RslChannelNr chan_nr) |
| 217 | runs on RSL_Emulation_CT return integer { |
| 218 | var integer i; |
| 219 | for (i := 0; i < sizeof(ConnectionTable); i := i+1) { |
Pau Espin Pedrol | 7096509 | 2020-06-23 14:29:56 +0200 | [diff] [blame] | 220 | if (ispresent(ConnectionTable[i].chan_nr) and |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 221 | ConnectionTable[i].chan_nr == chan_nr and ConnectionTable[i].trx_nr == trx_nr) { |
| 222 | return i; |
| 223 | } |
| 224 | } |
Vadim Yanitskiy | f79d936 | 2020-06-03 04:06:18 +0700 | [diff] [blame] | 225 | log("No Dchan handler for trx_nr=", trx_nr, " and chan_nr=", chan_nr); |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 226 | return -1; |
| 227 | } |
| 228 | |
| 229 | private function f_cid_by_ra_fn(OCT1 ra, GsmFrameNumber fn) |
| 230 | runs on RSL_Emulation_CT return integer { |
| 231 | var integer i; |
| 232 | for (i := 0; i < sizeof(ConnectionTable); i := i+1) { |
| 233 | if (ispresent(ConnectionTable[i].ra) and |
| 234 | ConnectionTable[i].ra == ra and ConnectionTable[i].ra_fn == fn) { |
| 235 | return i; |
| 236 | } |
| 237 | } |
Vadim Yanitskiy | f79d936 | 2020-06-03 04:06:18 +0700 | [diff] [blame] | 238 | log("No Dchan handler for ra=", ra, " and fn=", fn); |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 239 | return -1; |
| 240 | } |
| 241 | |
Pau Espin Pedrol | 6451b04 | 2018-10-24 20:36:16 +0200 | [diff] [blame] | 242 | /* Matches by only RA if FN is ommited in one of the connections allocated */ |
| 243 | private function f_cid_by_ra_fn2(OCT1 ra, RSL_IE_FrameNumber fn) |
| 244 | runs on RSL_Emulation_CT return integer { |
| 245 | var integer i; |
| 246 | for (i := 0; i < sizeof(ConnectionTable); i := i+1) { |
| 247 | if (ispresent(ConnectionTable[i].ra) and |
| 248 | ConnectionTable[i].ra == ra) { |
| 249 | if (not ispresent(ConnectionTable[i].ra_fn) or |
| 250 | fn == valueof(ts_RSL_IE_FrameNumber(ConnectionTable[i].ra_fn))) { |
| 251 | return i; |
| 252 | } |
| 253 | } |
| 254 | } |
Vadim Yanitskiy | f79d936 | 2020-06-03 04:06:18 +0700 | [diff] [blame] | 255 | log("No Dchan handler for ra=", ra, " and fn=", fn); |
Pau Espin Pedrol | 6451b04 | 2018-10-24 20:36:16 +0200 | [diff] [blame] | 256 | return -1; |
| 257 | } |
| 258 | |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 259 | /* create an ew client with given RA and FN */ |
Pau Espin Pedrol | 6451b04 | 2018-10-24 20:36:16 +0200 | [diff] [blame] | 260 | private function f_cid_create(OCT1 ra, template (omit) GsmFrameNumber fn, RSL_DchanHdlr comp_ref) |
Harald Welte | 930d0a7 | 2018-03-22 22:08:40 +0100 | [diff] [blame] | 261 | runs on RSL_Emulation_CT { |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 262 | var integer i; |
| 263 | for (i := 0; i < sizeof(ConnectionTable); i := i+1) { |
Harald Welte | f70df65 | 2018-01-29 22:00:23 +0100 | [diff] [blame] | 264 | if (not ispresent(ConnectionTable[i].ra) and |
| 265 | not ispresent(ConnectionTable[i].trx_nr)) { |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 266 | ConnectionTable[i].ra := ra; |
Pau Espin Pedrol | 6451b04 | 2018-10-24 20:36:16 +0200 | [diff] [blame] | 267 | if (ispresent(fn)) { |
| 268 | ConnectionTable[i].ra_fn := valueof(fn); |
| 269 | } else { |
| 270 | ConnectionTable[i].ra_fn := omit; |
| 271 | } |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 272 | ConnectionTable[i].comp_ref := comp_ref; |
Harald Welte | 930d0a7 | 2018-03-22 22:08:40 +0100 | [diff] [blame] | 273 | return; |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 274 | } |
| 275 | } |
Daniel Willmann | 8273fb9 | 2018-07-05 17:31:20 +0200 | [diff] [blame] | 276 | testcase.stop("No free entry in conn table for ", ra, fn); |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 277 | } |
| 278 | |
Vadim Yanitskiy | efc9413 | 2020-05-24 04:26:45 +0700 | [diff] [blame] | 279 | /* create a new client with given RA and FN */ |
Harald Welte | f70df65 | 2018-01-29 22:00:23 +0100 | [diff] [blame] | 280 | private function f_cid_create_cnr(uint8_t trx_nr, RslChannelNr chan_nr, RSL_DchanHdlr comp_ref) |
Harald Welte | 930d0a7 | 2018-03-22 22:08:40 +0100 | [diff] [blame] | 281 | runs on RSL_Emulation_CT { |
Harald Welte | f70df65 | 2018-01-29 22:00:23 +0100 | [diff] [blame] | 282 | var integer i; |
| 283 | for (i := 0; i < sizeof(ConnectionTable); i := i+1) { |
| 284 | if (not ispresent(ConnectionTable[i].ra) and |
| 285 | not ispresent(ConnectionTable[i].trx_nr)) { |
| 286 | ConnectionTable[i].stream_id := f_streamId_by_trx(trx_nr); |
| 287 | ConnectionTable[i].trx_nr := trx_nr; |
| 288 | ConnectionTable[i].chan_nr := chan_nr; |
| 289 | ConnectionTable[i].comp_ref := comp_ref; |
Harald Welte | 930d0a7 | 2018-03-22 22:08:40 +0100 | [diff] [blame] | 290 | return; |
Harald Welte | f70df65 | 2018-01-29 22:00:23 +0100 | [diff] [blame] | 291 | } |
| 292 | } |
Daniel Willmann | 8273fb9 | 2018-07-05 17:31:20 +0200 | [diff] [blame] | 293 | testcase.stop("No free entry in conn table for ", trx_nr, chan_nr, comp_ref); |
Harald Welte | f70df65 | 2018-01-29 22:00:23 +0100 | [diff] [blame] | 294 | } |
| 295 | |
| 296 | |
Vadim Yanitskiy | efc9413 | 2020-05-24 04:26:45 +0700 | [diff] [blame] | 297 | /* delete client with given RA and FN */ |
Harald Welte | f70df65 | 2018-01-29 22:00:23 +0100 | [diff] [blame] | 298 | private function f_cid_delete_cnr(IpaStreamId stream_id, RslChannelNr chan_nr, RSL_DchanHdlr comp_ref) |
| 299 | runs on RSL_Emulation_CT return integer { |
| 300 | var integer i; |
| 301 | for (i := 0; i < sizeof(ConnectionTable); i := i+1) { |
| 302 | if (ConnectionTable[i].comp_ref == null) { |
| 303 | continue; |
| 304 | } |
| 305 | if (ConnectionTable[i].stream_id == stream_id and |
| 306 | ConnectionTable[i].chan_nr == chan_nr and |
| 307 | ConnectionTable[i].comp_ref == comp_ref) { |
| 308 | f_cid_clear(i); |
| 309 | } |
| 310 | } |
| 311 | log("Unable to find entry to delete for ", stream_id, chan_nr, comp_ref); |
| 312 | return -1; |
| 313 | } |
| 314 | |
| 315 | |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 316 | private function f_cid_clear(integer cid) |
| 317 | runs on RSL_Emulation_CT { |
| 318 | ConnectionTable[cid].ra := omit; |
| 319 | ConnectionTable[cid].ra_fn := omit; |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 320 | ConnectionTable[cid].trx_nr := omit; |
| 321 | ConnectionTable[cid].stream_id := omit; |
| 322 | ConnectionTable[cid].chan_nr := omit; |
Harald Welte | f70df65 | 2018-01-29 22:00:23 +0100 | [diff] [blame] | 323 | ConnectionTable[cid].comp_ref := null; |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 324 | } |
| 325 | |
Harald Welte | ad2647b | 2018-03-22 19:53:55 +0100 | [diff] [blame] | 326 | /* last activation for a given channel number */ |
| 327 | type record LastActData { |
| 328 | uint8_t trx_nr optional, |
| 329 | RslChannelNr chan_nr optional, |
| 330 | RSL_Message chan_act optional |
| 331 | } |
| 332 | |
| 333 | private function f_store_last_act_data(uint8_t trx_nr, RslChannelNr chan_nr, RSL_Message chan_act) |
| 334 | runs on RSL_Emulation_CT { |
| 335 | for (var integer i := 0; i < sizeof(LastActTable); i := i+1) { |
| 336 | if (not ispresent(LastActTable[i].chan_nr) or |
| 337 | (LastActTable[i].chan_nr == chan_nr and LastActTable[i].trx_nr == trx_nr)) { |
| 338 | LastActTable[i].trx_nr := trx_nr; |
| 339 | LastActTable[i].chan_nr := chan_nr; |
| 340 | LastActTable[i].chan_act := chan_act; |
| 341 | return; |
| 342 | } |
| 343 | } |
Daniel Willmann | 8273fb9 | 2018-07-05 17:31:20 +0200 | [diff] [blame] | 344 | testcase.stop("No space left in LastActTable to store chan_act for ", chan_nr); |
Harald Welte | ad2647b | 2018-03-22 19:53:55 +0100 | [diff] [blame] | 345 | } |
| 346 | |
| 347 | private function f_lookup_last_act(uint8_t trx_nr, RslChannelNr chan_nr) |
| 348 | runs on RSL_Emulation_CT return RSL_Message { |
| 349 | for (var integer i := 0; i < sizeof(LastActTable); i := i+1) { |
| 350 | if (ispresent(LastActTable[i].chan_nr) and LastActTable[i].chan_nr == chan_nr |
| 351 | and LastActTable[i].trx_nr == trx_nr) { |
| 352 | return LastActTable[i].chan_act; |
| 353 | } |
| 354 | } |
Daniel Willmann | 8273fb9 | 2018-07-05 17:31:20 +0200 | [diff] [blame] | 355 | testcase.stop("No LastActTable entry found for TRX ", trx_nr, " ", chan_nr); |
Harald Welte | ad2647b | 2018-03-22 19:53:55 +0100 | [diff] [blame] | 356 | } |
| 357 | |
| 358 | private function f_last_act_table_init() runs on RSL_Emulation_CT { |
| 359 | for (var integer i := 0; i < sizeof(LastActTable); i := i+1) { |
| 360 | LastActTable[i] := { omit, omit, omit }; |
| 361 | } |
| 362 | } |
| 363 | |
Vadim Yanitskiy | 6de2fcb | 2020-05-25 19:40:45 +0700 | [diff] [blame] | 364 | private function f_trx_conn_map_init() |
| 365 | runs on RSL_Emulation_CT { |
| 366 | for (var integer i := 0; i < sizeof(TrxConnMap); i := i + 1) { |
| 367 | TrxConnMap[i] := -1; |
| 368 | } |
| 369 | } |
| 370 | |
| 371 | private function f_trx_conn_map_register(integer conn_id, in IpaCcmIdResp id_resp) |
| 372 | runs on RSL_Emulation_CT return IpaStreamId { |
Vadim Yanitskiy | 73468c8 | 2024-04-20 03:20:17 +0700 | [diff] [blame] | 373 | var IpaUnitId unit_id; |
Vadim Yanitskiy | 6de2fcb | 2020-05-25 19:40:45 +0700 | [diff] [blame] | 374 | var integer idx; |
| 375 | |
| 376 | /* Check if we have room for a new connection */ |
| 377 | if (TrxConnNum >= sizeof(TrxConnMap)) { |
| 378 | testcase.stop("We cannot handle more than ", sizeof(TrxConnMap), " transceivers"); |
| 379 | } |
| 380 | |
| 381 | /* Find IPAC_IDTAG_UNITID in the IPA IDENTITY RESPONSE */ |
| 382 | idx := f_ipa_id_resp_find_ie(id_resp, IPAC_IDTAG_UNITID); |
| 383 | if (idx < 0) { |
| 384 | testcase.stop("IPA IDENTITY RESPONSE contains no unit-id"); |
| 385 | } |
| 386 | |
Vadim Yanitskiy | 73468c8 | 2024-04-20 03:20:17 +0700 | [diff] [blame] | 387 | /* Parse IPA unit-id */ |
| 388 | unit_id := dec_IpaUnitId(oct2char(id_resp[idx].data)); |
Vadim Yanitskiy | 6de2fcb | 2020-05-25 19:40:45 +0700 | [diff] [blame] | 389 | |
Vadim Yanitskiy | 73468c8 | 2024-04-20 03:20:17 +0700 | [diff] [blame] | 390 | if (unit_id.trx_id >= sizeof(TrxConnMap)) { |
| 391 | testcase.stop("Transceiver #", unit_id.trx_id, " does not fit"); |
| 392 | } else if (TrxConnMap[unit_id.trx_id] != -1) { |
| 393 | testcase.stop("Transceiver #", unit_id.trx_id, " is already connected?!?"); |
Vadim Yanitskiy | 6de2fcb | 2020-05-25 19:40:45 +0700 | [diff] [blame] | 394 | } |
| 395 | |
| 396 | /* Finally, store the connection ID */ |
Vadim Yanitskiy | 73468c8 | 2024-04-20 03:20:17 +0700 | [diff] [blame] | 397 | log("Mapped TRX#", unit_id.trx_id, " to TCP/IP conn_id=", conn_id); |
| 398 | TrxConnMap[unit_id.trx_id] := conn_id; |
Vadim Yanitskiy | 6de2fcb | 2020-05-25 19:40:45 +0700 | [diff] [blame] | 399 | TrxConnNum := TrxConnNum + 1; |
| 400 | |
Vadim Yanitskiy | 73468c8 | 2024-04-20 03:20:17 +0700 | [diff] [blame] | 401 | return f_streamId_by_trx(unit_id.trx_id); |
Vadim Yanitskiy | 6de2fcb | 2020-05-25 19:40:45 +0700 | [diff] [blame] | 402 | } |
| 403 | |
Pau Espin Pedrol | abcdf78 | 2020-06-23 14:29:24 +0200 | [diff] [blame] | 404 | private function f_trx_conn_map_unregister(integer conn_id) |
| 405 | runs on RSL_Emulation_CT return IpaStreamId { |
| 406 | |
| 407 | for (var integer i := 0; i < sizeof(TrxConnMap); i := i + 1) { |
| 408 | if (conn_id == TrxConnMap[i]) { |
| 409 | TrxConnMap[i] := -1; |
| 410 | TrxConnNum := TrxConnNum - 1; |
| 411 | return f_streamId_by_trx(i); |
| 412 | } |
| 413 | } |
| 414 | |
| 415 | testcase.stop("Trying to unregister an unknown conn_id=", conn_id); |
| 416 | } |
| 417 | |
Vadim Yanitskiy | 6de2fcb | 2020-05-25 19:40:45 +0700 | [diff] [blame] | 418 | private function f_trx_conn_map_resolve(IpaStreamId id) |
| 419 | runs on RSL_Emulation_CT return integer { |
| 420 | var integer trx_nr := f_trx_by_streamId(id); |
| 421 | |
| 422 | if (TrxConnMap[trx_nr] == -1) { |
| 423 | testcase.stop("Transceiver #", trx_nr, " is not connected"); |
| 424 | } |
| 425 | |
| 426 | return TrxConnMap[trx_nr]; |
| 427 | } |
| 428 | |
Vadim Yanitskiy | e9c0635 | 2020-06-20 01:30:58 +0700 | [diff] [blame] | 429 | private type record of ASP_RSL_Unitdata ASP_RSL_UDList; |
| 430 | |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 431 | type component RSL_Emulation_CT { |
| 432 | /* port facing down towards IPA emulation */ |
| 433 | port IPA_RSL_PT IPA_PT; |
| 434 | /* port facing up towards dedicated channel handler */ |
| 435 | port RSL_DCHAN_PT CLIENT_PT; |
Harald Welte | f70df65 | 2018-01-29 22:00:23 +0100 | [diff] [blame] | 436 | port RSLEM_PROC_PT RSL_PROC; |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 437 | |
Harald Welte | 1c02fd1 | 2018-02-19 19:20:47 +0100 | [diff] [blame] | 438 | /* port for Common Channel / TRX Management */ |
| 439 | port RSL_CCHAN_PT CCHAN_PT; |
| 440 | |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 441 | /* state of all concurrent connections / dedicated channels */ |
| 442 | var ConnectionData ConnectionTable[64]; |
Harald Welte | ad2647b | 2018-03-22 19:53:55 +0100 | [diff] [blame] | 443 | |
Vadim Yanitskiy | e9c0635 | 2020-06-20 01:30:58 +0700 | [diff] [blame] | 444 | /* RSL messages for which no handler is currently registered */ |
| 445 | var ASP_RSL_UDList WaitingQueue := { }; |
| 446 | |
Harald Welte | ad2647b | 2018-03-22 19:53:55 +0100 | [diff] [blame] | 447 | /* last RSL CHAN ACT for each chan_nr */ |
| 448 | var LastActData LastActTable[64]; |
Vadim Yanitskiy | 6de2fcb | 2020-05-25 19:40:45 +0700 | [diff] [blame] | 449 | |
| 450 | /* IPA stream ID -> TCP/IP connection ID mapping for transceivers */ |
| 451 | var integer TrxConnNum := 0; /* number of connected transceivers */ |
| 452 | var integer TrxConnMap[4]; /* up to 4 transceivers for now */ |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 453 | } |
| 454 | |
| 455 | |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 456 | private function f_trx_by_streamId(IpaStreamId id) return integer { |
| 457 | return enum2int(id); |
| 458 | } |
| 459 | |
Harald Welte | f70df65 | 2018-01-29 22:00:23 +0100 | [diff] [blame] | 460 | private function f_streamId_by_trx(uint8_t trx_nr) return IpaStreamId { |
| 461 | select (trx_nr) { |
| 462 | case (0) { return IPAC_PROTO_RSL_TRX0; } |
| 463 | case (1) { return IPAC_PROTO_RSL_TRX1; } |
| 464 | case (2) { return IPAC_PROTO_RSL_TRX2; } |
| 465 | case (3) { return IPAC_PROTO_RSL_TRX3; } |
| 466 | } |
Daniel Willmann | a6ea2ef | 2018-07-24 09:55:52 +0200 | [diff] [blame] | 467 | setverdict(fail, "Unknown stream ID ", trx_nr); |
| 468 | mtc.stop; |
Harald Welte | f70df65 | 2018-01-29 22:00:23 +0100 | [diff] [blame] | 469 | } |
| 470 | |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 471 | |
Harald Welte | 1c02fd1 | 2018-02-19 19:20:47 +0100 | [diff] [blame] | 472 | function main(boolean bts_role := true) runs on RSL_Emulation_CT { |
Harald Welte | bb6aed3 | 2018-02-21 12:19:18 +0100 | [diff] [blame] | 473 | var ASP_IPA_Event evt; |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 474 | var ASP_RSL_Unitdata rx_rsl; |
| 475 | var RSL_Message rx_rsl_msg; |
| 476 | var RSLDC_ChanRqd chan_rqd; |
| 477 | var RSL_DchanHdlr vc_conn; |
Harald Welte | f70df65 | 2018-01-29 22:00:23 +0100 | [diff] [blame] | 478 | var RslChannelNr chan_nr; |
| 479 | var uint8_t trx_nr; |
Vadim Yanitskiy | 6de2fcb | 2020-05-25 19:40:45 +0700 | [diff] [blame] | 480 | var integer conn_id; |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 481 | var integer cid; |
| 482 | var integer i; |
Harald Welte | 70b52c9 | 2018-02-12 20:47:31 +0100 | [diff] [blame] | 483 | /* special synchronization handling during hand-over */ |
| 484 | var boolean dchan_suspended := false; |
Vadim Yanitskiy | e9c0635 | 2020-06-20 01:30:58 +0700 | [diff] [blame] | 485 | /* Whether to keep RSL messages, for which no handler is found in ConnectionTable, |
| 486 | * in a queue. These messages will remain in the queue until the appropriate |
| 487 | * connection handler is registered. */ |
| 488 | var boolean wait_queue_enabled := false; |
Neels Hofmeyr | ad26fc0 | 2021-09-28 18:30:17 +0200 | [diff] [blame] | 489 | var boolean auto_chan_act_ack := true; |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 490 | |
Daniel Willmann | 17f970f | 2018-01-17 12:03:19 +0100 | [diff] [blame] | 491 | f_conn_table_init(); |
Vadim Yanitskiy | 6de2fcb | 2020-05-25 19:40:45 +0700 | [diff] [blame] | 492 | f_trx_conn_map_init(); |
Harald Welte | ad2647b | 2018-03-22 19:53:55 +0100 | [diff] [blame] | 493 | f_last_act_table_init(); |
Daniel Willmann | 17f970f | 2018-01-17 12:03:19 +0100 | [diff] [blame] | 494 | |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 495 | while (true) { |
| 496 | alt { |
Vadim Yanitskiy | a2afacc | 2020-05-18 21:16:19 +0700 | [diff] [blame] | 497 | [bts_role] IPA_PT.receive(tr_ASP_IPA_EV(ASP_IPA_EVENT_UP)) { |
Harald Welte | bb6aed3 | 2018-02-21 12:19:18 +0100 | [diff] [blame] | 498 | } |
Vadim Yanitskiy | a2afacc | 2020-05-18 21:16:19 +0700 | [diff] [blame] | 499 | [not bts_role] IPA_PT.receive(tr_ASP_IPA_EV(ASP_IPA_EVENT_UP)) -> value evt { |
Vadim Yanitskiy | 6de2fcb | 2020-05-25 19:40:45 +0700 | [diff] [blame] | 500 | log("A new IPA/RSL connection has been established (conn_id=", |
| 501 | evt.conn_id, "), waiting for IDENTITY RESPONSE..."); |
| 502 | } |
| 503 | [not bts_role] IPA_PT.receive(tr_ASP_IPA_EV(ASP_IPA_EVENT_ID_RESP)) -> value evt { |
| 504 | log("Got IDENTITY RESPONSE (conn_id=", evt.conn_id, "): ", evt.id_resp); |
| 505 | /* Update [ IPA stream ID -> TCP/IP connection ID ] mapping */ |
| 506 | var IpaStreamId sid := f_trx_conn_map_register(evt.conn_id, evt.id_resp); |
| 507 | /* Notify the upper layers about a new connection */ |
| 508 | CCHAN_PT.send(ts_RSLEm_EV(RSLEM_EV_TRX_UP, sid)); |
Harald Welte | 624f963 | 2017-12-16 19:26:04 +0100 | [diff] [blame] | 509 | } |
Pau Espin Pedrol | abcdf78 | 2020-06-23 14:29:24 +0200 | [diff] [blame] | 510 | [bts_role] IPA_PT.receive(tr_ASP_IPA_EV(ASP_IPA_EVENT_DOWN)) -> value evt { |
| 511 | log("Lost IPA connection! (conn_id=", evt.conn_id, "): ", evt.id_resp); |
| 512 | /* Notify the upper layers about lost connection */ |
| 513 | var IpaStreamId sid := f_trx_conn_map_unregister(evt.conn_id); |
| 514 | CCHAN_PT.send(ts_RSLEm_EV(RSLEM_EV_TRX_DOWN, sid)); |
Pau Espin Pedrol | a07cfd9 | 2018-10-22 15:54:41 +0200 | [diff] [blame] | 515 | } |
Pau Espin Pedrol | abcdf78 | 2020-06-23 14:29:24 +0200 | [diff] [blame] | 516 | [not bts_role] IPA_PT.receive(tr_ASP_IPA_EV(ASP_IPA_EVENT_DOWN)) -> value evt { |
| 517 | log("Lost IPA connection! (conn_id=", evt.conn_id, ")"); |
| 518 | /* Notify the upper layers about lost connection */ |
| 519 | var IpaStreamId sid := f_trx_conn_map_unregister(evt.conn_id); |
| 520 | CCHAN_PT.send(ts_RSLEm_EV(RSLEM_EV_TRX_DOWN, sid)); |
Pau Espin Pedrol | a07cfd9 | 2018-10-22 15:54:41 +0200 | [diff] [blame] | 521 | } |
Vadim Yanitskiy | a2afacc | 2020-05-18 21:16:19 +0700 | [diff] [blame] | 522 | [bts_role] IPA_PT.receive(tr_ASP_IPA_EV(ASP_IPA_EVENT_ID_ACK)) { |
Vadim Yanitskiy | 9b4e356 | 2020-05-25 21:40:52 +0700 | [diff] [blame] | 523 | IPA_PT.send(ts_ASP_RSL_UD(ts_RSL_PAGING_LOAD_IND(23))); |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 524 | } |
Vadim Yanitskiy | a2afacc | 2020-05-18 21:16:19 +0700 | [diff] [blame] | 525 | [not bts_role] IPA_PT.receive(tr_ASP_IPA_EV(ASP_IPA_EVENT_ID_ACK)) { } |
Vadim Yanitskiy | a60e5cf | 2020-05-26 01:46:31 +0700 | [diff] [blame] | 526 | [bts_role] IPA_PT.receive(tr_ASP_RSL_UD(tr_RSL_IMM_ASSIGN, sid := ?)) -> value rx_rsl { |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 527 | var GsmRrMessage rr; |
| 528 | var OCT1 ra; |
| 529 | var GsmFrameNumber fn; |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 530 | rr := dec_GsmRrMessage(rx_rsl.rsl.ies[1].body.full_imm_ass_info.payload); |
| 531 | if (ischosen(rr.payload.imm_ass)) { |
| 532 | ra := bit2oct(rr.payload.imm_ass.req_ref.ra); |
| 533 | fn := 23; //FIXME(rr.payload.imm_ass); |
| 534 | /* lookup client based on RA+time, deliver to client */ |
| 535 | cid := f_cid_by_ra_fn(ra, fn); |
| 536 | if (cid == -1) { |
| 537 | setverdict(fail, "IMM ASS for unknown DChan"); |
Daniel Willmann | e4ff537 | 2018-07-05 17:35:03 +0200 | [diff] [blame] | 538 | mtc.stop; |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 539 | } |
| 540 | /* update client with trx_nr */ |
| 541 | ConnectionTable[cid].trx_nr := f_trx_by_streamId(rx_rsl.streamId); |
| 542 | ConnectionTable[cid].stream_id := rx_rsl.streamId; |
| 543 | /* update client with chan_nr */ |
| 544 | ConnectionTable[cid].chan_nr := rr.payload.imm_ass.chan_desc.chan_nr; |
| 545 | /* TODO: add timer to time-out ConnectionTable entries which |
| 546 | * never get followed-up to */ |
| 547 | CLIENT_PT.send(rx_rsl.rsl) to ConnectionTable[cid].comp_ref; |
| 548 | } else if (ischosen(rr.payload.imm_ass_rej)) { |
| 549 | for (i := 0; i < sizeof(rr.payload.imm_ass_rej.payload); i := i + 1) { |
| 550 | ra := bit2oct(rr.payload.imm_ass_rej.payload[i].req_ref.ra); |
| 551 | fn := 23; //FIXME(); |
| 552 | /* lookup client based on RA+time, deliver to client */ |
| 553 | cid := f_cid_by_ra_fn(ra, fn); |
| 554 | if (cid != -1) { |
| 555 | CLIENT_PT.send(rx_rsl.rsl) to ConnectionTable[cid].comp_ref; |
| 556 | /* delete ClientTable entry, as it failed */ |
| 557 | f_cid_clear(cid); |
| 558 | } |
| 559 | } |
| 560 | } |
| 561 | } |
Vadim Yanitskiy | a60e5cf | 2020-05-26 01:46:31 +0700 | [diff] [blame] | 562 | [not bts_role] IPA_PT.receive(tr_ASP_RSL_UD(tr_RSL_CHAN_RQD(?), sid := ?)) -> value rx_rsl { |
Pau Espin Pedrol | 6451b04 | 2018-10-24 20:36:16 +0200 | [diff] [blame] | 563 | var RSL_IE_RequestRef req_ref; |
| 564 | req_ref := rx_rsl.rsl.ies[1].body.req_ref; |
| 565 | cid := f_cid_by_ra_fn2(req_ref.ra, req_ref.frame_nr); |
| 566 | if (cid != -1) { |
| 567 | CLIENT_PT.send(rx_rsl.rsl) to ConnectionTable[cid].comp_ref; |
| 568 | f_cid_clear(cid); |
| 569 | } else { |
| 570 | CCHAN_PT.send(rx_rsl); |
| 571 | } |
| 572 | } |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 573 | |
Vadim Yanitskiy | a60e5cf | 2020-05-26 01:46:31 +0700 | [diff] [blame] | 574 | [bts_role] IPA_PT.receive(tr_ASP_RSL_UD(tr_RSL_PAGING_CMD(?, ?), sid := ?)) -> value rx_rsl { |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 575 | /* broadcast to all clients? */ |
| 576 | for (i := 0; i < sizeof(ConnectionTable); i := i + 1) { |
Neels Hofmeyr | d7eabd6 | 2020-06-08 22:30:54 +0200 | [diff] [blame] | 577 | if (ispresent(ConnectionTable[i].comp_ref) and ConnectionTable[i].comp_ref != null) { |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 578 | CLIENT_PT.send(rx_rsl.rsl) to ConnectionTable[i].comp_ref; |
| 579 | } |
| 580 | } |
| 581 | } |
| 582 | |
Harald Welte | 1c02fd1 | 2018-02-19 19:20:47 +0100 | [diff] [blame] | 583 | /* Forward common channel management to the special port for it */ |
Vadim Yanitskiy | a60e5cf | 2020-05-26 01:46:31 +0700 | [diff] [blame] | 584 | [] IPA_PT.receive(tr_ASP_RSL_UD(tr_RSL_MsgTypeT(?), sid := ?)) -> value rx_rsl { |
Harald Welte | 1c02fd1 | 2018-02-19 19:20:47 +0100 | [diff] [blame] | 585 | CCHAN_PT.send(rx_rsl); |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 586 | } |
| 587 | |
Harald Welte | 1c02fd1 | 2018-02-19 19:20:47 +0100 | [diff] [blame] | 588 | /* Forward common channel management to the special port for it */ |
Vadim Yanitskiy | a60e5cf | 2020-05-26 01:46:31 +0700 | [diff] [blame] | 589 | [] IPA_PT.receive(tr_ASP_RSL_UD(tr_RSL_MsgTypeC(?), sid := ?)) -> value rx_rsl { |
Harald Welte | 1c02fd1 | 2018-02-19 19:20:47 +0100 | [diff] [blame] | 590 | CCHAN_PT.send(rx_rsl); |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 591 | } |
| 592 | |
Neels Hofmeyr | ad26fc0 | 2021-09-28 18:30:17 +0200 | [diff] [blame] | 593 | /* Channel Activation: store in LastActTable, possibly ACK. */ |
Vadim Yanitskiy | a60e5cf | 2020-05-26 01:46:31 +0700 | [diff] [blame] | 594 | [bts_role] IPA_PT.receive(tr_ASP_RSL_UD(tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV), sid := ?)) -> value rx_rsl { |
Harald Welte | f70df65 | 2018-01-29 22:00:23 +0100 | [diff] [blame] | 595 | chan_nr := rx_rsl.rsl.ies[0].body.chan_nr; |
Harald Welte | ad2647b | 2018-03-22 19:53:55 +0100 | [diff] [blame] | 596 | trx_nr := f_trx_by_streamId(rx_rsl.streamId); |
| 597 | f_store_last_act_data(trx_nr, chan_nr, rx_rsl.rsl); |
Neels Hofmeyr | ad26fc0 | 2021-09-28 18:30:17 +0200 | [diff] [blame] | 598 | if (auto_chan_act_ack) { |
| 599 | /* blindly acknowledge all channel activations */ |
| 600 | IPA_PT.send(ts_ASP_RSL_UD(ts_RSL_CHAN_ACT_ACK(chan_nr, 23), rx_rsl.streamId)); |
| 601 | } else { |
| 602 | CLIENT_PT.send(rx_rsl); |
| 603 | } |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 604 | } |
| 605 | |
Vadim Yanitskiy | a60e5cf | 2020-05-26 01:46:31 +0700 | [diff] [blame] | 606 | [not dchan_suspended] IPA_PT.receive(tr_ASP_RSL_UD(tr_RSL_MsgTypeDR(?), sid := ?)) -> value rx_rsl { |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 607 | /* dispatch to channel based on ChanId */ |
| 608 | cid := f_cid_by_chan_nr(f_trx_by_streamId(rx_rsl.streamId), |
| 609 | rx_rsl.rsl.ies[0].body.chan_nr); |
| 610 | if (cid != -1) { |
| 611 | CLIENT_PT.send(rx_rsl.rsl) to ConnectionTable[cid].comp_ref; |
Vadim Yanitskiy | e9c0635 | 2020-06-20 01:30:58 +0700 | [diff] [blame] | 612 | } else if (wait_queue_enabled) { |
| 613 | log("Storing an RSL message in the waiting queue"); |
| 614 | WaitingQueue := WaitingQueue & { rx_rsl }; |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 615 | } else { |
Neels Hofmeyr | c0ef35c | 2021-07-22 16:22:25 +0200 | [diff] [blame] | 616 | log("Error: RSL for unknown Dchan (streamId ", rx_rsl.streamId, ", chan_nr ", |
| 617 | rx_rsl.rsl.ies[0].body.chan_nr, "): ", rx_rsl); |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 618 | setverdict(fail, "RSL for unknown Dchan"); |
Daniel Willmann | e4ff537 | 2018-07-05 17:35:03 +0200 | [diff] [blame] | 619 | mtc.stop; |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 620 | } |
| 621 | } |
| 622 | |
Harald Welte | 70b52c9 | 2018-02-12 20:47:31 +0100 | [diff] [blame] | 623 | [not dchan_suspended] IPA_PT.receive { |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 624 | setverdict(fail, "Received unknown primitive from IPA"); |
Daniel Willmann | e4ff537 | 2018-07-05 17:35:03 +0200 | [diff] [blame] | 625 | mtc.stop; |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 626 | } |
| 627 | |
Harald Welte | 1c02fd1 | 2018-02-19 19:20:47 +0100 | [diff] [blame] | 628 | [bts_role] CLIENT_PT.receive(RSLDC_ChanRqd:?) -> value chan_rqd sender vc_conn { |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 629 | /* Store the knowledge that this sender has requested a certain RQ+time */ |
| 630 | f_cid_create(chan_rqd.ra, chan_rqd.fn, vc_conn); |
Vadim Yanitskiy | 9b4e356 | 2020-05-25 21:40:52 +0700 | [diff] [blame] | 631 | IPA_PT.send(ts_ASP_RSL_UD(ts_RSL_CHAN_RQD(chan_rqd.ra, chan_rqd.fn))); |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 632 | } |
| 633 | |
Pau Espin Pedrol | 6451b04 | 2018-10-24 20:36:16 +0200 | [diff] [blame] | 634 | [not bts_role] CLIENT_PT.receive(RSLDC_ChanRqd:?) -> value chan_rqd sender vc_conn { |
| 635 | /* Store the knowledge that this sender has requested a certain RQ+time */ |
| 636 | f_cid_create(chan_rqd.ra, chan_rqd.fn, vc_conn); |
| 637 | } |
| 638 | |
Vadim Yanitskiy | 6de2fcb | 2020-05-25 19:40:45 +0700 | [diff] [blame] | 639 | /* RSL message from a component that runs on RSL_DchanHdlr */ |
| 640 | [bts_role] CLIENT_PT.receive(tr_RSL_MsgType(?)) -> value rx_rsl_msg sender vc_conn { |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 641 | cid := f_cid_by_comp_ref(vc_conn); |
Vadim Yanitskiy | 9b4e356 | 2020-05-25 21:40:52 +0700 | [diff] [blame] | 642 | IPA_PT.send(ts_ASP_RSL_UD(rx_rsl_msg, ConnectionTable[cid].stream_id)); |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 643 | } |
Vadim Yanitskiy | 6de2fcb | 2020-05-25 19:40:45 +0700 | [diff] [blame] | 644 | [not bts_role] CLIENT_PT.receive(tr_RSL_MsgType(?)) -> value rx_rsl_msg sender vc_conn { |
| 645 | cid := f_cid_by_comp_ref(vc_conn); |
| 646 | conn_id := f_trx_conn_map_resolve(ConnectionTable[cid].stream_id); |
| 647 | IPA_PT.send(ts_ASP_RSL_UD(rx_rsl_msg, ConnectionTable[cid].stream_id, conn_id)); |
| 648 | } |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 649 | |
Vadim Yanitskiy | a120d03 | 2023-11-22 02:37:39 +0700 | [diff] [blame] | 650 | /* allow the RSL_DchanHdlr components to "escape the sandbox" by sending RSL messages |
| 651 | * to other transceivers than they're bound to (determined by rx_rsl.streamId) */ |
| 652 | [bts_role] CLIENT_PT.receive(tr_ASP_RSL_UD(?, sid := ?)) -> value rx_rsl { |
| 653 | IPA_PT.send(ts_ASP_RSL_UD(rx_rsl.rsl, rx_rsl.streamId)); |
| 654 | } |
| 655 | [not bts_role] CLIENT_PT.receive(tr_ASP_RSL_UD(?, sid := ?)) -> value rx_rsl { |
| 656 | conn_id := f_trx_conn_map_resolve(rx_rsl.streamId); |
| 657 | IPA_PT.send(ts_ASP_RSL_UD(rx_rsl.rsl, rx_rsl.streamId, conn_id)); |
| 658 | } |
| 659 | |
Vadim Yanitskiy | 6de2fcb | 2020-05-25 19:40:45 +0700 | [diff] [blame] | 660 | /* RSL message from MTC */ |
| 661 | [bts_role] CCHAN_PT.receive(tr_ASP_RSL_UD(?, sid := ?)) -> value rx_rsl { |
Vadim Yanitskiy | 9b4e356 | 2020-05-25 21:40:52 +0700 | [diff] [blame] | 662 | IPA_PT.send(ts_ASP_RSL_UD(rx_rsl.rsl, rx_rsl.streamId)); |
Harald Welte | 34252c5 | 2018-02-24 04:51:50 +0100 | [diff] [blame] | 663 | } |
Vadim Yanitskiy | 6de2fcb | 2020-05-25 19:40:45 +0700 | [diff] [blame] | 664 | [not bts_role] CCHAN_PT.receive(tr_ASP_RSL_UD(?, sid := ?)) -> value rx_rsl { |
| 665 | conn_id := f_trx_conn_map_resolve(rx_rsl.streamId); |
| 666 | IPA_PT.send(ts_ASP_RSL_UD(rx_rsl.rsl, rx_rsl.streamId, conn_id)); |
| 667 | } |
Harald Welte | 34252c5 | 2018-02-24 04:51:50 +0100 | [diff] [blame] | 668 | |
Harald Welte | f70df65 | 2018-01-29 22:00:23 +0100 | [diff] [blame] | 669 | /* explicit registration, e.g. in (non-immediate) assignment case */ |
| 670 | [] RSL_PROC.getcall(RSLEM_register:{?,?,?}) -> param(trx_nr, chan_nr, vc_conn) { |
| 671 | f_cid_create_cnr(trx_nr, chan_nr, vc_conn); |
Harald Welte | e32ad99 | 2018-05-31 22:17:46 +0200 | [diff] [blame] | 672 | RSL_PROC.reply(RSLEM_register:{trx_nr, chan_nr, vc_conn}) to vc_conn; |
Harald Welte | f70df65 | 2018-01-29 22:00:23 +0100 | [diff] [blame] | 673 | } |
| 674 | |
Harald Welte | 1909f46 | 2018-01-29 22:29:29 +0100 | [diff] [blame] | 675 | [] RSL_PROC.getcall(RSLEM_unregister:{?,?,?}) -> param(trx_nr, chan_nr, vc_conn) { |
| 676 | cid := f_cid_by_chan_nr(trx_nr, chan_nr); |
| 677 | f_cid_clear(cid); |
Harald Welte | e32ad99 | 2018-05-31 22:17:46 +0200 | [diff] [blame] | 678 | RSL_PROC.reply(RSLEM_unregister:{trx_nr, chan_nr, vc_conn}) to vc_conn; |
Harald Welte | 1909f46 | 2018-01-29 22:29:29 +0100 | [diff] [blame] | 679 | } |
| 680 | |
Harald Welte | e32ad99 | 2018-05-31 22:17:46 +0200 | [diff] [blame] | 681 | [] RSL_PROC.getcall(RSLEM_suspend:{true}) -> sender vc_conn { |
Harald Welte | 70b52c9 | 2018-02-12 20:47:31 +0100 | [diff] [blame] | 682 | log("Suspending DChan"); |
| 683 | dchan_suspended := true; |
Harald Welte | e32ad99 | 2018-05-31 22:17:46 +0200 | [diff] [blame] | 684 | RSL_PROC.reply(RSLEM_suspend:{true}) to vc_conn; |
Harald Welte | 70b52c9 | 2018-02-12 20:47:31 +0100 | [diff] [blame] | 685 | } |
| 686 | |
Harald Welte | e32ad99 | 2018-05-31 22:17:46 +0200 | [diff] [blame] | 687 | [] RSL_PROC.getcall(RSLEM_suspend:{false}) -> sender vc_conn { |
Harald Welte | 70b52c9 | 2018-02-12 20:47:31 +0100 | [diff] [blame] | 688 | log("Resuming DChan"); |
| 689 | dchan_suspended := false; |
Harald Welte | e32ad99 | 2018-05-31 22:17:46 +0200 | [diff] [blame] | 690 | RSL_PROC.reply(RSLEM_suspend:{false}) to vc_conn; |
Harald Welte | 70b52c9 | 2018-02-12 20:47:31 +0100 | [diff] [blame] | 691 | } |
Harald Welte | 1909f46 | 2018-01-29 22:29:29 +0100 | [diff] [blame] | 692 | |
Vadim Yanitskiy | e9c0635 | 2020-06-20 01:30:58 +0700 | [diff] [blame] | 693 | [not wait_queue_enabled] RSL_PROC.getcall(RSLEM_wait_queue:{true}) -> sender vc_conn { |
| 694 | wait_queue_enabled := true; |
| 695 | log("Enabled queueing of DChan messages"); |
| 696 | RSL_PROC.reply(RSLEM_wait_queue:{wait_queue_enabled}) to vc_conn; |
| 697 | } |
| 698 | |
| 699 | [wait_queue_enabled] RSL_PROC.getcall(RSLEM_wait_queue:{false}) -> sender vc_conn { |
| 700 | /* Dispatch stalled messages (if any) */ |
| 701 | f_WaitingQueue_dispatch(); |
| 702 | |
| 703 | wait_queue_enabled := false; |
| 704 | log("Disabled queueing of DChan messages"); |
| 705 | RSL_PROC.reply(RSLEM_wait_queue:{wait_queue_enabled}) to vc_conn; |
| 706 | } |
| 707 | |
| 708 | [] RSL_PROC.getcall(RSLEM_wait_queue:{?}) -> sender vc_conn { |
| 709 | log("Queueing of DChan messages is already enabled/disabled"); |
| 710 | RSL_PROC.reply(RSLEM_wait_queue:{wait_queue_enabled}) to vc_conn; |
| 711 | } |
| 712 | |
Harald Welte | e32ad99 | 2018-05-31 22:17:46 +0200 | [diff] [blame] | 713 | [] RSL_PROC.getcall(RSLEM_get_last_act:{?,?,?}) -> param(trx_nr, chan_nr) sender vc_conn { |
Harald Welte | ad2647b | 2018-03-22 19:53:55 +0100 | [diff] [blame] | 714 | var RSL_Message last_chan_act := f_lookup_last_act(trx_nr, chan_nr); |
Harald Welte | e32ad99 | 2018-05-31 22:17:46 +0200 | [diff] [blame] | 715 | RSL_PROC.reply(RSLEM_get_last_act:{trx_nr, chan_nr, last_chan_act}) to vc_conn; |
Harald Welte | ad2647b | 2018-03-22 19:53:55 +0100 | [diff] [blame] | 716 | } |
Neels Hofmeyr | ad26fc0 | 2021-09-28 18:30:17 +0200 | [diff] [blame] | 717 | |
| 718 | [] RSL_PROC.getcall(RSLEM_set_auto_chan_act_ack:{?}) -> param(auto_chan_act_ack) sender vc_conn { |
| 719 | RSL_PROC.reply(RSLEM_set_auto_chan_act_ack:{auto_chan_act_ack}) to vc_conn; |
| 720 | } |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 721 | } |
| 722 | } |
| 723 | } |
| 724 | |
Daniel Willmann | 17f970f | 2018-01-17 12:03:19 +0100 | [diff] [blame] | 725 | private function f_conn_table_init() |
| 726 | runs on RSL_Emulation_CT { |
| 727 | var integer i; |
| 728 | |
| 729 | /* Initialize the ConnectionTable */ |
| 730 | for (i := 0; i < sizeof(ConnectionTable); i := i+1) { |
| 731 | f_cid_clear(i); |
| 732 | } |
| 733 | } |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 734 | |
Vadim Yanitskiy | e9c0635 | 2020-06-20 01:30:58 +0700 | [diff] [blame] | 735 | private function f_WaitingQueue_dispatch() |
| 736 | runs on RSL_Emulation_CT { |
| 737 | var integer cid; |
| 738 | |
| 739 | for (var integer i := 0; i < lengthof(WaitingQueue); i := i + 1) { |
| 740 | cid := f_cid_by_chan_nr(f_trx_by_streamId(WaitingQueue[i].streamId), |
| 741 | WaitingQueue[i].rsl.ies[0].body.chan_nr); |
| 742 | if (cid == -1) { |
| 743 | setverdict(fail, "No Dchan handler found for: ", WaitingQueue[i]); |
| 744 | mtc.stop; |
Vadim Yanitskiy | e9c0635 | 2020-06-20 01:30:58 +0700 | [diff] [blame] | 745 | } |
| 746 | |
| 747 | /* Dispatch a stalled message to the appropriate handler */ |
| 748 | CLIENT_PT.send(WaitingQueue[i].rsl) to ConnectionTable[cid].comp_ref; |
| 749 | } |
| 750 | |
| 751 | /* All messages dispatched, clear the queue */ |
| 752 | WaitingQueue := { }; |
| 753 | } |
| 754 | |
Harald Welte | f70df65 | 2018-01-29 22:00:23 +0100 | [diff] [blame] | 755 | /* client/conn_hdlr side function to use procedure port to register stream_id/chan_nr */ |
Harald Welte | 421e4d4 | 2018-02-12 20:04:50 +0100 | [diff] [blame] | 756 | function f_rslem_register(uint8_t trx_nr, RslChannelNr chan_nr, RSLEM_PROC_PT PT := RSL_PROC) |
| 757 | runs on RSL_DchanHdlr { |
| 758 | PT.call(RSLEM_register:{trx_nr, chan_nr, self}) { |
| 759 | [] PT.getreply(RSLEM_register:{?,?,?}) {}; |
Harald Welte | f70df65 | 2018-01-29 22:00:23 +0100 | [diff] [blame] | 760 | } |
| 761 | } |
| 762 | |
Harald Welte | 1909f46 | 2018-01-29 22:29:29 +0100 | [diff] [blame] | 763 | /* client/conn_hdlr side function to use procedure port to unregister stream_id/chan_nr */ |
Harald Welte | 421e4d4 | 2018-02-12 20:04:50 +0100 | [diff] [blame] | 764 | function f_rslem_unregister(uint8_t trx_nr, RslChannelNr chan_nr, RSLEM_PROC_PT PT := RSL_PROC) |
| 765 | runs on RSL_DchanHdlr { |
| 766 | PT.call(RSLEM_unregister:{trx_nr, chan_nr, self}) { |
| 767 | [] PT.getreply(RSLEM_unregister:{?,?,?}) {}; |
Harald Welte | 1909f46 | 2018-01-29 22:29:29 +0100 | [diff] [blame] | 768 | } |
| 769 | } |
| 770 | |
Vadim Yanitskiy | a38c265 | 2020-06-21 19:47:00 +0700 | [diff] [blame] | 771 | /* suspend handling of RSL DChan messages from IPA until f_rslem_resume() is called */ |
Harald Welte | 70b52c9 | 2018-02-12 20:47:31 +0100 | [diff] [blame] | 772 | function f_rslem_suspend(RSLEM_PROC_PT PT) |
| 773 | runs on RSL_DchanHdlr { |
| 774 | PT.call(RSLEM_suspend:{true}) { |
| 775 | [] PT.getreply(RSLEM_suspend:{true}) {}; |
| 776 | } |
| 777 | } |
| 778 | |
| 779 | /* resume handling of RSL DChan messages after f_rslem_suspend() is called */ |
| 780 | function f_rslem_resume(RSLEM_PROC_PT PT) |
| 781 | runs on RSL_DchanHdlr { |
| 782 | PT.call(RSLEM_suspend:{false}) { |
| 783 | [] PT.getreply(RSLEM_suspend:{false}) {}; |
| 784 | } |
| 785 | } |
| 786 | |
Vadim Yanitskiy | e9c0635 | 2020-06-20 01:30:58 +0700 | [diff] [blame] | 787 | /* Enable queueing of RSL DChan messages from IPA until f_rslem_dchan_queue_disable() is called. */ |
| 788 | function f_rslem_dchan_queue_enable(RSLEM_PROC_PT PT := RSL_PROC) |
| 789 | runs on RSL_DchanHdlr { |
| 790 | PT.call(RSLEM_wait_queue:{true}) { |
| 791 | [] PT.getreply(RSLEM_wait_queue:{true}) {}; |
| 792 | } |
| 793 | } |
| 794 | |
| 795 | /* Disable queueing of RSL DChan messages after f_rslem_dchan_queue_enable() is called. |
| 796 | * Dispatch all stalled messages to the registered handlers. Make sure that no |
| 797 | * messages for which there is no handler are left in the queue (mtc.stop if so). */ |
| 798 | function f_rslem_dchan_queue_dispatch(RSLEM_PROC_PT PT := RSL_PROC) |
| 799 | runs on RSL_DchanHdlr { |
| 800 | PT.call(RSLEM_wait_queue:{false}) { |
| 801 | [] PT.getreply(RSLEM_wait_queue:{false}) {}; |
| 802 | } |
| 803 | } |
| 804 | |
Harald Welte | ad2647b | 2018-03-22 19:53:55 +0100 | [diff] [blame] | 805 | /* obtain the last RSL_CHAN_ACT message for the given chan_nr */ |
| 806 | function f_rslem_get_last_act(RSLEM_PROC_PT PT, uint8_t trx_nr, RslChannelNr chan_nr) |
| 807 | runs on RSL_DchanHdlr return RSL_Message { |
| 808 | var RSL_Message chan_act; |
| 809 | PT.call(RSLEM_get_last_act:{trx_nr, chan_nr, -}) { |
| 810 | [] PT.getreply(RSLEM_get_last_act:{trx_nr, chan_nr, ?}) -> param(chan_act) {}; |
| 811 | } |
| 812 | return chan_act; |
| 813 | } |
| 814 | |
Neels Hofmeyr | ad26fc0 | 2021-09-28 18:30:17 +0200 | [diff] [blame] | 815 | function f_rslem_set_auto_chan_act_ack(RSLEM_PROC_PT PT, boolean enable) |
| 816 | runs on RSL_DchanHdlr { |
| 817 | PT.call(RSLEM_set_auto_chan_act_ack:{enable}) { |
| 818 | [] PT.getreply(RSLEM_set_auto_chan_act_ack:{enable}) {}; |
| 819 | } |
| 820 | } |
Harald Welte | 1909f46 | 2018-01-29 22:29:29 +0100 | [diff] [blame] | 821 | |
Harald Welte | 714ded9 | 2017-12-08 14:00:22 +0100 | [diff] [blame] | 822 | } |