Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 1 | /* Data Types / Encoding / Decoding for OsmocomBB L1CTL interface */ |
| 2 | /* (C) 2017 by Harald Welte <laforge@gnumonks.org>, derived from l1ctl_proto.h |
Harald Welte | 34b5a95 | 2019-05-27 11:54:11 +0200 | [diff] [blame] | 3 | * which is (C) 2010 by Harald Welte + Holger Hans Peter Freyther |
| 4 | * All rights reserved. |
| 5 | * |
| 6 | * Released under the terms of GNU General Public License, Version 2 or |
| 7 | * (at your option) any later version. |
| 8 | * |
| 9 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 10 | */ |
| 11 | |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 12 | module L1CTL_Types { |
| 13 | |
| 14 | import from General_Types all; |
| 15 | import from GSM_Types all; |
Harald Welte | 9419c8a | 2017-07-30 04:07:05 +0200 | [diff] [blame] | 16 | import from GSM_RR_Types all; |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 17 | import from Osmocom_Types all; |
| 18 | |
| 19 | type enumerated L1ctlMsgType { |
| 20 | L1CTL_NONE, |
| 21 | L1CTL_FBSB_REQ, |
| 22 | L1CTL_FBSB_CONF, |
| 23 | L1CTL_DATA_IND, |
| 24 | L1CTL_RACH_REQ, |
| 25 | L1CTL_DM_EST_REQ, |
| 26 | L1CTL_DATA_REQ, |
| 27 | L1CTL_RESET_IND, |
| 28 | L1CTL_PM_REQ, /* power measurement */ |
| 29 | L1CTL_PM_CONF, /* power measurement */ |
| 30 | L1CTL_ECHO_REQ, |
| 31 | L1CTL_ECHO_CONF, |
| 32 | L1CTL_RACH_CONF, |
| 33 | L1CTL_RESET_REQ, |
| 34 | L1CTL_RESET_CONF, |
| 35 | L1CTL_DATA_CONF, |
| 36 | L1CTL_CCCH_MODE_REQ, |
| 37 | L1CTL_CCCH_MODE_CONF, |
| 38 | L1CTL_DM_REL_REQ, |
| 39 | L1CTL_PARAM_REQ, |
| 40 | L1CTL_DM_FREQ_REQ, |
| 41 | L1CTL_CRYPTO_REQ, |
| 42 | L1CTL_SIM_REQ, |
| 43 | L1CTL_SIM_CONF, |
| 44 | L1CTL_TCH_MODE_REQ, |
| 45 | L1CTL_TCH_MODE_CONF, |
| 46 | L1CTL_NEIGH_PM_REQ, |
| 47 | L1CTL_NEIGH_PM_IND, |
| 48 | L1CTL_TRAFFIC_REQ, |
| 49 | L1CTL_TRAFFIC_CONF, |
Harald Welte | 00d4dac | 2017-07-30 00:50:32 +0200 | [diff] [blame] | 50 | L1CTL_TRAFFIC_IND, |
Vadim Yanitskiy | 4e79ff5 | 2019-04-22 06:38:21 +0700 | [diff] [blame] | 51 | L1CTL_BURST_IND, |
Vadim Yanitskiy | 72a76b5 | 2023-03-18 00:12:09 +0700 | [diff] [blame] | 52 | L1CTL_GPRS_UL_TBF_CFG_REQ, |
| 53 | L1CTL_GPRS_DL_TBF_CFG_REQ, |
| 54 | L1CTL_GPRS_UL_BLOCK_REQ, |
| 55 | L1CTL_GPRS_DL_BLOCK_IND, |
Vadim Yanitskiy | 9f40dc5 | 2023-12-15 13:55:59 +0700 | [diff] [blame] | 56 | L1CTL_EXT_RACH_REQ, |
Vadim Yanitskiy | 090759a | 2024-02-05 21:42:29 +0700 | [diff] [blame] | 57 | L1CTL_GPRS_RTS_IND, |
| 58 | L1CTL_GPRS_UL_BLOCK_CNF |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 59 | } with { variant "FIELDLENGTH(8)" }; |
| 60 | |
| 61 | type enumerated L1ctlCcchMode { |
| 62 | CCCH_MODE_NONE (0), |
| 63 | CCCH_MODE_NON_COMBINED, |
Harald Welte | 990a361 | 2019-05-27 14:02:13 +0200 | [diff] [blame] | 64 | CCCH_MODE_COMBINED, |
| 65 | CCCH_MODE_COMBINED_CBCH |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 66 | } with { variant "FIELDLENGTH(8)" }; |
| 67 | |
| 68 | type enumerated L1ctlNeighMode { |
| 69 | NEIGH_MODE_NONE (0), |
| 70 | NEIGH_MODE_PM, |
| 71 | NEIGH_MODE_SB |
| 72 | } with { variant "FIELDLENGTH(8)" }; |
| 73 | |
| 74 | type enumerated L1ctlResetType { |
| 75 | L1CTL_RES_T_BOOT (0), |
| 76 | L1CTL_RES_T_FULL, |
| 77 | L1CTL_RES_T_SCHED |
| 78 | } with { variant "FIELDLENGTH(8)" }; |
| 79 | |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 80 | type record L1ctlHdrFlags { |
| 81 | BIT7 padding, |
| 82 | boolean f_done |
| 83 | } with { variant "" }; |
| 84 | |
| 85 | type record L1ctlHeader { |
| 86 | L1ctlMsgType msg_type, |
| 87 | L1ctlHdrFlags flags, |
| 88 | OCT2 padding |
| 89 | } with { variant "" }; |
| 90 | |
Vadim Yanitskiy | be33f6b | 2020-11-14 04:05:34 +0700 | [diff] [blame] | 91 | template L1ctlHeader |
| 92 | tr_L1ctlHeader(template (present) L1ctlMsgType msg_type) := { |
Harald Welte | f8df4cb | 2018-03-10 15:15:08 +0100 | [diff] [blame] | 93 | msg_type := msg_type, |
| 94 | flags := ?, |
| 95 | padding := ? |
| 96 | }; |
| 97 | |
Vadim Yanitskiy | be33f6b | 2020-11-14 04:05:34 +0700 | [diff] [blame] | 98 | template (value) L1ctlHeader |
| 99 | ts_L1ctlHeader(template (value) L1ctlMsgType msg_type) := { |
Harald Welte | 52c713c | 2017-07-16 15:44:44 +0200 | [diff] [blame] | 100 | msg_type := msg_type, |
| 101 | flags := { padding := '0000000'B, f_done := false }, |
| 102 | padding := '0000'O |
| 103 | }; |
| 104 | |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 105 | type record L1ctlDlInfo { |
Harald Welte | 8e4db2c | 2017-07-16 18:54:55 +0200 | [diff] [blame] | 106 | RslChannelNr chan_nr, |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 107 | RslLinkId link_id, |
Vadim Yanitskiy | 1acc7bb | 2020-11-14 04:24:57 +0700 | [diff] [blame] | 108 | GsmBandArfcn arfcn, |
Harald Welte | 5f0d5c8 | 2017-07-16 18:56:01 +0200 | [diff] [blame] | 109 | uint32_t frame_nr, |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 110 | GsmRxLev rx_level, |
| 111 | uint8_t snr, |
| 112 | uint8_t num_biterr, |
| 113 | uint8_t fire_crc |
| 114 | } with { variant "" }; |
| 115 | |
| 116 | type record L1ctlFbsbConf { |
| 117 | int16_t initial_freq_err, |
| 118 | uint8_t result, |
| 119 | uint8_t bsic |
| 120 | } with { variant "" }; |
| 121 | |
| 122 | type record L1ctlCcchModeConf { |
| 123 | L1ctlCcchMode ccch_mode, |
| 124 | OCT3 padding |
| 125 | } with { variant "" }; |
| 126 | |
| 127 | /* gsm48_chan_mode */ |
Vadim Yanitskiy | fe05296 | 2020-10-19 13:27:09 +0700 | [diff] [blame] | 128 | type enumerated L1ctlTchMode { |
| 129 | L1CTL_CHAN_MODE_SIGN ('00000000'B), /* Signalling */ |
| 130 | L1CTL_CHAN_MODE_SPEECH_V1 ('00000001'B), /* FR or HR codec */ |
| 131 | L1CTL_CHAN_MODE_SPEECH_V2 ('00100001'B), /* EFR codec */ |
Vadim Yanitskiy | 8fd78f7 | 2023-05-26 19:21:55 +0700 | [diff] [blame] | 132 | L1CTL_CHAN_MODE_SPEECH_V3 ('01000001'B), /* AMR codec */ |
| 133 | L1CTL_CHAN_MODE_DATA_14k5 ('00001111'B), /* CSD: TCH/F14.4 */ |
| 134 | L1CTL_CHAN_MODE_DATA_12k0 ('00000011'B), /* CSD: TCH/F9.6 */ |
| 135 | L1CTL_CHAN_MODE_DATA_6k0 ('00001011'B), /* CSD: TCH/{FH}4.8 */ |
| 136 | L1CTL_CHAN_MODE_DATA_3k6 ('00010011'B) /* CSD: TCH/{FH}2.4 */ |
Vadim Yanitskiy | fe05296 | 2020-10-19 13:27:09 +0700 | [diff] [blame] | 137 | } with { variant "FIELDLENGTH(8)" }; |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 138 | |
Vadim Yanitskiy | 7ce605f | 2020-10-19 16:04:38 +0700 | [diff] [blame] | 139 | type enumerated L1ctlLoopMode { |
| 140 | L1CTL_LOOP_MODE_OPEN ('00000000'B), |
| 141 | L1CTL_LOOP_MODE_A ('00000001'B), |
| 142 | L1CTL_LOOP_MODE_B ('00000010'B), |
| 143 | L1CTL_LOOP_MODE_C ('00000011'B), |
| 144 | L1CTL_LOOP_MODE_D ('00000100'B), |
| 145 | L1CTL_LOOP_MODE_E ('00000101'B), |
| 146 | L1CTL_LOOP_MODE_F ('00000110'B), |
| 147 | L1CTL_LOOP_MODE_I ('00000111'B) |
| 148 | } with { variant "FIELDLENGTH(8)" }; |
| 149 | |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 150 | type record L1ctlAudioMode { |
| 151 | BIT4 padding, |
| 152 | boolean tx_microphone, |
| 153 | boolean tx_traffic_req, |
| 154 | boolean rx_speaker, |
| 155 | boolean rx_traffic_ind |
| 156 | } with { variant "" }; |
| 157 | |
Harald Welte | f8df4cb | 2018-03-10 15:15:08 +0100 | [diff] [blame] | 158 | template (value) L1ctlAudioMode t_L1CTL_AudioModeNone := { '0000'B, false, false, false, false }; |
Harald Welte | 66110f0 | 2017-07-16 21:05:18 +0200 | [diff] [blame] | 159 | |
Vadim Yanitskiy | 1618583 | 2020-10-19 21:20:43 +0700 | [diff] [blame] | 160 | /* Traffic forwarding mode (see TRAFFIC.{req,cnf,ind} messages) */ |
| 161 | template (value) L1ctlAudioMode t_L1CTL_AudioModeFwd |
| 162 | modifies t_L1CTL_AudioModeNone := { |
| 163 | tx_traffic_req := true, |
| 164 | rx_traffic_ind := true |
| 165 | }; |
| 166 | |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 167 | type record L1ctlTchModeConf { |
| 168 | L1ctlTchMode tch_mode, |
| 169 | L1ctlAudioMode audio_mode, |
Pau Espin Pedrol | 440e1dc | 2022-09-02 16:35:49 +0200 | [diff] [blame] | 170 | record { |
| 171 | uint8_t start_codec, |
| 172 | BIT8 codecs_bitmask |
| 173 | } amr |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 174 | } with { variant "" }; |
| 175 | |
| 176 | type record L1ctlDataInd { |
Vadim Yanitskiy | 2a92e2a | 2019-05-28 21:13:35 +0700 | [diff] [blame] | 177 | octetstring payload |
Harald Welte | 7024baa | 2018-03-02 23:37:51 +0100 | [diff] [blame] | 178 | } with { |
| 179 | variant (payload) "BYTEORDER(first)" |
| 180 | }; |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 181 | |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 182 | |
| 183 | type record L1ctlUlInfo { |
Harald Welte | 8e4db2c | 2017-07-16 18:54:55 +0200 | [diff] [blame] | 184 | RslChannelNr chan_nr, |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 185 | RslLinkId link_id, |
| 186 | OCT2 padding |
| 187 | } with { variant "" }; |
| 188 | |
| 189 | type record L1ctlFbsbFlags { |
| 190 | BIT5 padding, |
| 191 | boolean sb, |
| 192 | boolean fb1, |
| 193 | boolean fb0 |
Harald Welte | 344c0cf | 2018-03-09 16:17:45 +0100 | [diff] [blame] | 194 | } with { variant "FIELDORDER(msb)" }; |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 195 | |
Harald Welte | f8df4cb | 2018-03-10 15:15:08 +0100 | [diff] [blame] | 196 | template (value) L1ctlFbsbFlags t_L1CTL_FBSB_F_ALL := { |
Harald Welte | 66110f0 | 2017-07-16 21:05:18 +0200 | [diff] [blame] | 197 | padding := '00000'B, |
| 198 | sb := true, |
| 199 | fb1 := true, |
| 200 | fb0 := true |
| 201 | }; |
| 202 | |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 203 | type record L1ctlFbsbReq { |
Vadim Yanitskiy | 1acc7bb | 2020-11-14 04:24:57 +0700 | [diff] [blame] | 204 | GsmBandArfcn arfcn, |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 205 | uint16_t timeout_tdma_frames, |
| 206 | uint16_t freq_err_thresh1, |
| 207 | uint16_t freq_err_thresh2, |
| 208 | uint8_t num_freqerr_avg, |
| 209 | L1ctlFbsbFlags flags, |
| 210 | uint8_t sync_info_idx, |
| 211 | L1ctlCcchMode ccch_mode, |
| 212 | GsmRxLev rxlev_exp |
| 213 | } with { variant "" }; |
| 214 | |
| 215 | type record L1ctlCcchModeReq { |
Harald Welte | f8df4cb | 2018-03-10 15:15:08 +0100 | [diff] [blame] | 216 | L1ctlCcchMode ccch_mode, |
| 217 | OCT3 padding |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 218 | } with { variant "" }; |
| 219 | |
| 220 | type record L1ctlTchModeReq { |
| 221 | L1ctlTchMode tch_mode, |
| 222 | L1ctlAudioMode audio_mode, |
Vadim Yanitskiy | 7ce605f | 2020-10-19 16:04:38 +0700 | [diff] [blame] | 223 | L1ctlLoopMode loop_mode, |
Pau Espin Pedrol | 440e1dc | 2022-09-02 16:35:49 +0200 | [diff] [blame] | 224 | record { |
| 225 | uint8_t start_codec, |
| 226 | BIT8 codecs_bitmask |
| 227 | } amr |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 228 | } with { variant "" }; |
| 229 | |
| 230 | type record L1ctlRachReq { |
| 231 | uint8_t ra, |
| 232 | uint8_t combined, |
| 233 | uint16_t offset |
| 234 | } with { variant "" }; |
| 235 | |
Vadim Yanitskiy | 5c83679 | 2019-04-22 05:45:03 +0700 | [diff] [blame] | 236 | type enumerated L1ctlRachSynchSeq { |
| 237 | RACH_SYNCH_SEQ_TS0 (0), |
| 238 | RACH_SYNCH_SEQ_TS1, |
| 239 | RACH_SYNCH_SEQ_TS2 |
| 240 | } with { variant "FIELDLENGTH(8)" }; |
| 241 | |
| 242 | type record L1ctlExtRachReq { |
| 243 | uint16_t ra11, |
| 244 | L1ctlRachSynchSeq synch_seq, |
| 245 | uint8_t combined, |
| 246 | uint16_t offset |
| 247 | } with { variant "" }; |
| 248 | |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 249 | type record L1ctlParReq { |
| 250 | int8_t ta, |
| 251 | uint8_t tx_power, |
| 252 | OCT2 padding |
| 253 | } with { variant "" }; |
| 254 | |
Pau Espin Pedrol | 0aad596 | 2018-09-28 16:03:55 +0200 | [diff] [blame] | 255 | type record L1ctlDataReq { |
| 256 | SacchL1Header l1header optional, |
| 257 | octetstring l2_payload |
| 258 | } with { variant "" }; |
| 259 | |
Vadim Yanitskiy | 2cdb97f | 2020-10-19 14:17:38 +0700 | [diff] [blame] | 260 | type record L1ctlH0 { |
| 261 | uint8_t h, |
Vadim Yanitskiy | 1acc7bb | 2020-11-14 04:24:57 +0700 | [diff] [blame] | 262 | GsmBandArfcn arfcn, |
Vadim Yanitskiy | 2cdb97f | 2020-10-19 14:17:38 +0700 | [diff] [blame] | 263 | octetstring padding length(130) |
| 264 | } with { variant "" }; |
| 265 | |
Vadim Yanitskiy | 1acc7bb | 2020-11-14 04:24:57 +0700 | [diff] [blame] | 266 | type record length(0..64) of GsmBandArfcn L1ctlMA; |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 267 | type record L1ctlH1 { |
Vadim Yanitskiy | 2cdb97f | 2020-10-19 14:17:38 +0700 | [diff] [blame] | 268 | uint8_t h, |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 269 | uint8_t hsn, |
| 270 | uint8_t maio, |
| 271 | uint8_t n, |
Vadim Yanitskiy | e8ea3ee | 2020-05-27 13:29:48 +0700 | [diff] [blame] | 272 | OCT1 spare, |
| 273 | L1ctlMA ma, |
| 274 | octetstring padding |
| 275 | } with { |
| 276 | variant (n) "LENGTHTO(ma)" |
| 277 | variant (n) "UNIT(elements)" |
| 278 | /* See https://bugs.eclipse.org/bugs/show_bug.cgi?id=562849. |
| 279 | * TL;DR The reference point of the PADDING attribute is the beginning |
| 280 | * of the message, not the beginning of the type/field it's applied on. |
| 281 | * Therefore we cannot use it here, and have to add padding manually. |
| 282 | * variant (ma) "PADDING(128)" */ |
| 283 | }; |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 284 | |
Vadim Yanitskiy | 2cdb97f | 2020-10-19 14:17:38 +0700 | [diff] [blame] | 285 | type union L1ctlH0H1 { |
| 286 | L1ctlH0 h0, |
| 287 | L1ctlH1 h1 |
| 288 | } with { variant "TAG(h0, h = 0; h1, h = 1)" }; |
| 289 | |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 290 | type record L1ctlDmEstReq { |
| 291 | GsmTsc tsc, |
Vadim Yanitskiy | 2cdb97f | 2020-10-19 14:17:38 +0700 | [diff] [blame] | 292 | L1ctlH0H1 h0h1, |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 293 | L1ctlTchMode tch_mode, |
| 294 | L1ctlAudioMode audio_mode |
Vadim Yanitskiy | 2cdb97f | 2020-10-19 14:17:38 +0700 | [diff] [blame] | 295 | } with { variant "" }; |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 296 | |
| 297 | type record L1ctlReset { |
| 298 | L1ctlResetType reset_type, |
| 299 | OCT3 padding |
| 300 | } with { variant "" }; |
| 301 | |
Harald Welte | e613f96 | 2018-04-18 22:38:16 +0200 | [diff] [blame] | 302 | type record L1CtlCryptoReq { |
| 303 | uint8_t algo, |
| 304 | uint8_t key_len, |
| 305 | octetstring key |
| 306 | } with { variant (key_len) "LENGTHTO(key)" }; |
| 307 | |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 308 | |
| 309 | type record L1ctlTrafficReq { |
Vadim Yanitskiy | e01691d | 2018-10-29 00:18:04 +0700 | [diff] [blame] | 310 | octetstring data |
Harald Welte | 7024baa | 2018-03-02 23:37:51 +0100 | [diff] [blame] | 311 | } with { |
| 312 | variant (data) "BYTEORDER(first)" |
| 313 | } |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 314 | |
Harald Welte | 00d4dac | 2017-07-30 00:50:32 +0200 | [diff] [blame] | 315 | |
Vadim Yanitskiy | 72a76b5 | 2023-03-18 00:12:09 +0700 | [diff] [blame] | 316 | /* payload of L1CTL_GPRS_UL_TBF_CFG_REQ */ |
| 317 | type record L1ctlGprsUlTbfCfgReq { |
| 318 | uint8_t tbf_ref, |
| 319 | BIT8 slotmask, |
Vadim Yanitskiy | 0e5693f | 2023-08-27 14:09:32 +0700 | [diff] [blame] | 320 | OCT2 pad ('0000'O), |
| 321 | uint32_t start_fn /* TBF Starting Time (absolute Fn) */ |
Vadim Yanitskiy | 72a76b5 | 2023-03-18 00:12:09 +0700 | [diff] [blame] | 322 | } with { variant (slotmask) "BITORDER(msb)" }; |
| 323 | |
| 324 | /* payload of L1CTL_GPRS_DL_TBF_CFG_REQ */ |
| 325 | type record L1ctlGprsDlTbfCfgReq { |
| 326 | uint8_t tbf_ref, |
| 327 | BIT8 slotmask, |
| 328 | uint8_t dl_tfi, |
Vadim Yanitskiy | 0e5693f | 2023-08-27 14:09:32 +0700 | [diff] [blame] | 329 | OCT1 pad ('00'O), |
| 330 | uint32_t start_fn /* TBF Starting Time (absolute Fn) */ |
Vadim Yanitskiy | 72a76b5 | 2023-03-18 00:12:09 +0700 | [diff] [blame] | 331 | } with { variant (slotmask) "BITORDER(msb)" }; |
| 332 | |
| 333 | /* part of L1CTL_GPRS_{UL,DL}_BLOCK_{REQ,IND} */ |
| 334 | type record L1ctlGprsBlockHdr { |
| 335 | uint32_t fn, |
| 336 | uint8_t tn, |
| 337 | OCT3 pad ('000000'O) |
| 338 | } with { variant "" }; |
| 339 | |
| 340 | /* payload of L1CTL_GPRS_UL_BLOCK_REQ */ |
| 341 | type record L1ctlGprsUlBlockReq { |
| 342 | L1ctlGprsBlockHdr hdr, |
| 343 | octetstring data |
| 344 | } with { variant (data) "BYTEORDER(first)" }; |
| 345 | |
Vadim Yanitskiy | 090759a | 2024-02-05 21:42:29 +0700 | [diff] [blame] | 346 | /* payload of L1CTL_GPRS_UL_BLOCK_CNF */ |
| 347 | type record L1ctlGprsUlBlockCnf { |
| 348 | uint32_t fn, |
| 349 | uint8_t tn, |
| 350 | octetstring data |
| 351 | } with { variant "" }; |
| 352 | |
Vadim Yanitskiy | 72a76b5 | 2023-03-18 00:12:09 +0700 | [diff] [blame] | 353 | /* payload of L1CTL_GPRS_DL_BLOCK_IND */ |
| 354 | type record L1ctlGprsDlBlockInd { |
| 355 | L1ctlGprsBlockHdr hdr, |
| 356 | record { |
| 357 | uint16_t ber10k, /* Bit Error Rate */ |
| 358 | int16_t ci_cb, /* C/I in centiBels */ |
| 359 | uint8_t rx_level /* RxLev 0..63 */ |
| 360 | } meas, |
| 361 | uint8_t usf, |
| 362 | octetstring data |
| 363 | } with { variant (data) "BYTEORDER(first)" }; |
| 364 | |
Vadim Yanitskiy | 9f40dc5 | 2023-12-15 13:55:59 +0700 | [diff] [blame] | 365 | /* payload of L1CTL_GPRS_RTS_IND */ |
| 366 | type record L1ctlGprsRtsInd { |
| 367 | uint32_t fn, |
| 368 | uint8_t tn, |
| 369 | uint8_t usf |
| 370 | } with { variant "" }; |
| 371 | |
Harald Welte | 00d4dac | 2017-07-30 00:50:32 +0200 | [diff] [blame] | 372 | |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 373 | type union L1ctlMsgPayload { |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 374 | L1ctlFbsbReq fbsb_req, |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 375 | L1ctlFbsbConf fbsb_conf, |
| 376 | L1ctlDataInd data_ind, |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 377 | L1ctlRachReq rach_req, |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 378 | L1ctlDmEstReq dm_est_req, |
Pau Espin Pedrol | 0aad596 | 2018-09-28 16:03:55 +0200 | [diff] [blame] | 379 | L1ctlDataReq data_req, |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 380 | /* TODO: L1CTL_RESET_IND */ |
| 381 | /* TODO: L1CTL_PM_REQ */ |
| 382 | /* TODO: L1CTL_PM_CONF */ |
| 383 | L1ctlReset reset_req, |
| 384 | L1ctlCcchModeReq ccch_mode_req, |
| 385 | L1ctlCcchModeConf ccch_mode_conf, |
| 386 | L1ctlParReq par_req, |
| 387 | /* TODO: L1CTL_DM_FREQ_REQ */ |
| 388 | L1CtlCryptoReq crypto_req, |
| 389 | /* TODO: L1CTL_SIM_REQ */ |
| 390 | /* TODO: L1CTL_SIM_CONF */ |
| 391 | L1ctlTchModeReq tch_mode_req, |
| 392 | L1ctlTchModeConf tch_mode_conf, |
| 393 | /* TODO: L1CTL_NEIGH_PM_REQ */ |
| 394 | /* TODO: L1CTL_NEIGH_PM_IND */ |
| 395 | L1ctlTrafficReq traffic_req, |
| 396 | L1ctlTrafficReq traffic_ind, |
| 397 | /* TODO: L1CTL_BURST_IND */ |
Vadim Yanitskiy | 72a76b5 | 2023-03-18 00:12:09 +0700 | [diff] [blame] | 398 | L1ctlGprsUlTbfCfgReq ul_tbf_cfg_req, |
| 399 | L1ctlGprsDlTbfCfgReq dl_tbf_cfg_req, |
| 400 | L1ctlGprsUlBlockReq ul_block_req, |
Vadim Yanitskiy | 090759a | 2024-02-05 21:42:29 +0700 | [diff] [blame] | 401 | L1ctlGprsUlBlockCnf ul_block_cnf, |
Vadim Yanitskiy | 72a76b5 | 2023-03-18 00:12:09 +0700 | [diff] [blame] | 402 | L1ctlGprsDlBlockInd dl_block_ind, |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 403 | L1ctlExtRachReq ext_rach_req, |
Vadim Yanitskiy | 9f40dc5 | 2023-12-15 13:55:59 +0700 | [diff] [blame] | 404 | L1ctlGprsRtsInd rts_ind, |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 405 | octetstring other |
Harald Welte | 7024baa | 2018-03-02 23:37:51 +0100 | [diff] [blame] | 406 | } with { |
| 407 | variant (other) "BYTEORDER(first)" |
| 408 | }; |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 409 | |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 410 | type record L1ctlMessage { |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 411 | L1ctlHeader header, |
| 412 | L1ctlUlInfo ul_info optional, |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 413 | L1ctlDlInfo dl_info optional, |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 414 | L1ctlMsgPayload payload optional |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 415 | } with { variant (ul_info) "PRESENCE(header.msg_type = L1CTL_RACH_REQ, |
Vadim Yanitskiy | 5c83679 | 2019-04-22 05:45:03 +0700 | [diff] [blame] | 416 | header.msg_type = L1CTL_EXT_RACH_REQ, |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 417 | header.msg_type = L1CTL_PARAM_REQ, |
| 418 | header.msg_type = L1CTL_CRYPTO_REQ, |
| 419 | header.msg_type = L1CTL_DATA_REQ, |
| 420 | header.msg_type = L1CTL_DM_EST_REQ, |
| 421 | header.msg_type = L1CTL_DM_FREQ_REQ, |
| 422 | header.msg_type = L1CTL_DM_REL_REQ, |
| 423 | header.msg_type = L1CTL_TRAFFIC_REQ)" |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 424 | variant (dl_info) "PRESENCE(header.msg_type = L1CTL_FBSB_CONF, |
| 425 | header.msg_type = L1CTL_RACH_CONF, |
| 426 | header.msg_type = L1CTL_DATA_IND, |
| 427 | header.msg_type = L1CTL_DATA_CONF, |
| 428 | header.msg_type = L1CTL_TRAFFIC_IND, |
| 429 | header.msg_type = L1CTL_TRAFFIC_CONF)" |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 430 | variant (payload) "CROSSTAG(fbsb_req, header.msg_type = L1CTL_FBSB_REQ; |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 431 | fbsb_conf, header.msg_type = L1CTL_FBSB_CONF; |
| 432 | data_ind, header.msg_type = L1CTL_DATA_IND; |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 433 | rach_req, header.msg_type = L1CTL_RACH_REQ; |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 434 | dm_est_req, header.msg_type = L1CTL_DM_EST_REQ; |
Pau Espin Pedrol | 0aad596 | 2018-09-28 16:03:55 +0200 | [diff] [blame] | 435 | data_req, header.msg_type = L1CTL_DATA_REQ; |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 436 | /* TODO: reset_ind, header.msg_type = L1CTL_RESET_IND */ |
| 437 | /* TODO: pm_req, header.msg_type = L1CTL_PM_REQ */ |
| 438 | /* TODO: pm_conf, header.msg_type = L1CTL_PM_CONF */ |
| 439 | reset_req, header.msg_type = L1CTL_RESET_REQ; |
| 440 | ccch_mode_req, header.msg_type = L1CTL_CCCH_MODE_REQ; |
| 441 | ccch_mode_conf, header.msg_type = L1CTL_CCCH_MODE_CONF; |
| 442 | par_req, header.msg_type = L1CTL_PARAM_REQ; |
| 443 | /* TODO: freq_req, header.msg_type = L1CTL_DM_FREQ_REQ */ |
| 444 | crypto_req, header.msg_type = L1CTL_CRYPTO_REQ; |
| 445 | /* TODO: sim_req, header.msg_type = L1CTL_SIM_REQ */ |
| 446 | /* TODO: sim_conf, header.msg_type = L1CTL_SIM_CONF */ |
| 447 | tch_mode_req, header.msg_type = L1CTL_TCH_MODE_REQ; |
| 448 | tch_mode_conf, header.msg_type = L1CTL_TCH_MODE_CONF; |
| 449 | /* TODO: neigh_pm_req, header.msg_type = L1CTL_NEIGH_PM_REQ */ |
| 450 | /* TODO: neigh_pm_ind, header.msg_type = L1CTL_NEIGH_PM_IND */ |
| 451 | traffic_req, header.msg_type = L1CTL_TRAFFIC_REQ; |
| 452 | traffic_ind, header.msg_type = L1CTL_TRAFFIC_IND; |
| 453 | /* TODO: burst_ind, header.msg_type = L1CTL_BURST_IND */ |
Vadim Yanitskiy | 72a76b5 | 2023-03-18 00:12:09 +0700 | [diff] [blame] | 454 | ul_tbf_cfg_req, header.msg_type = L1CTL_GPRS_UL_TBF_CFG_REQ; |
| 455 | dl_tbf_cfg_req, header.msg_type = L1CTL_GPRS_DL_TBF_CFG_REQ; |
| 456 | ul_block_req, header.msg_type = L1CTL_GPRS_UL_BLOCK_REQ; |
Vadim Yanitskiy | 090759a | 2024-02-05 21:42:29 +0700 | [diff] [blame] | 457 | ul_block_cnf, header.msg_type = L1CTL_GPRS_UL_BLOCK_CNF; |
Vadim Yanitskiy | 72a76b5 | 2023-03-18 00:12:09 +0700 | [diff] [blame] | 458 | dl_block_ind, header.msg_type = L1CTL_GPRS_DL_BLOCK_IND; |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 459 | ext_rach_req, header.msg_type = L1CTL_EXT_RACH_REQ; |
Vadim Yanitskiy | 9f40dc5 | 2023-12-15 13:55:59 +0700 | [diff] [blame] | 460 | rts_ind, header.msg_type = L1CTL_GPRS_RTS_IND; |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 461 | other, OTHERWISE; |
| 462 | )" }; |
| 463 | |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 464 | external function enc_L1ctlMessage(in L1ctlMessage msg) return octetstring |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 465 | with { extension "prototype(convert) encode(RAW)" }; |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 466 | external function dec_L1ctlMessage(in octetstring stream) return L1ctlMessage |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 467 | with { extension "prototype(convert) decode(RAW)" }; |
| 468 | |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 469 | type record L1ctlMessageLV { |
Harald Welte | 52c713c | 2017-07-16 15:44:44 +0200 | [diff] [blame] | 470 | uint16_t len, |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 471 | L1ctlMessage msg |
Harald Welte | 52c713c | 2017-07-16 15:44:44 +0200 | [diff] [blame] | 472 | } with { variant (len) "LENGTHTO(msg)" }; |
| 473 | |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 474 | external function enc_L1ctlMessageLV(in L1ctlMessageLV msg) return octetstring |
Harald Welte | 52c713c | 2017-07-16 15:44:44 +0200 | [diff] [blame] | 475 | with { extension "prototype(convert) encode(RAW)" }; |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 476 | external function dec_L1ctlMessageLV(in octetstring stream) return L1ctlMessageLV |
Harald Welte | 52c713c | 2017-07-16 15:44:44 +0200 | [diff] [blame] | 477 | with { extension "prototype(convert) decode(RAW)" }; |
| 478 | |
| 479 | |
Harald Welte | 9e4725d | 2017-07-16 23:18:09 +0200 | [diff] [blame] | 480 | |
Harald Welte | 9e4725d | 2017-07-16 23:18:09 +0200 | [diff] [blame] | 481 | /* for generating RESET_REQ */ |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 482 | template (value) L1ctlMessage |
Vadim Yanitskiy | be33f6b | 2020-11-14 04:05:34 +0700 | [diff] [blame] | 483 | t_L1ctlResetReq(template (value) L1ctlResetType rst_type) := { |
Harald Welte | f8df4cb | 2018-03-10 15:15:08 +0100 | [diff] [blame] | 484 | header := ts_L1ctlHeader(L1CTL_RESET_REQ), |
Harald Welte | 9e4725d | 2017-07-16 23:18:09 +0200 | [diff] [blame] | 485 | ul_info := omit, |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 486 | dl_info := omit, |
Harald Welte | 9e4725d | 2017-07-16 23:18:09 +0200 | [diff] [blame] | 487 | payload := { |
| 488 | reset_req := { |
| 489 | reset_type := rst_type, |
| 490 | padding := '000000'O |
| 491 | } |
| 492 | } |
| 493 | }; |
| 494 | |
| 495 | /* for generating FBSB_REQ */ |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 496 | template (value) L1ctlMessage |
Vadim Yanitskiy | 1acc7bb | 2020-11-14 04:24:57 +0700 | [diff] [blame] | 497 | ts_L1CTL_FBSB_REQ(template (value) GsmBandArfcn arfcn, |
Vadim Yanitskiy | be33f6b | 2020-11-14 04:05:34 +0700 | [diff] [blame] | 498 | template (value) L1ctlFbsbFlags flags, |
| 499 | template (value) uint8_t sync_info_idx, |
| 500 | template (value) L1ctlCcchMode ccch_mode, |
| 501 | template (value) GsmRxLev rxlev_exp) := { |
Harald Welte | f8df4cb | 2018-03-10 15:15:08 +0100 | [diff] [blame] | 502 | header := ts_L1ctlHeader(L1CTL_FBSB_REQ), |
Harald Welte | 9e4725d | 2017-07-16 23:18:09 +0200 | [diff] [blame] | 503 | ul_info := omit, |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 504 | dl_info := omit, |
Harald Welte | 9e4725d | 2017-07-16 23:18:09 +0200 | [diff] [blame] | 505 | payload := { |
| 506 | fbsb_req := { |
| 507 | arfcn := arfcn, |
Harald Welte | a82f7e6 | 2018-02-22 18:51:33 +0100 | [diff] [blame] | 508 | timeout_tdma_frames := 250, /* about 1s */ |
Harald Welte | 9e4725d | 2017-07-16 23:18:09 +0200 | [diff] [blame] | 509 | freq_err_thresh1 := 10000, |
| 510 | freq_err_thresh2 := 800, |
| 511 | num_freqerr_avg := 3, |
| 512 | flags := flags, |
| 513 | sync_info_idx := sync_info_idx, |
| 514 | ccch_mode := ccch_mode, |
| 515 | rxlev_exp := rxlev_exp |
| 516 | } |
| 517 | } |
| 518 | }; |
| 519 | |
| 520 | /* for matching against incoming FBSB_CONF */ |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 521 | template L1ctlMessage |
Vadim Yanitskiy | be33f6b | 2020-11-14 04:05:34 +0700 | [diff] [blame] | 522 | tr_L1CTL_FBSB_CONF(template (present) uint8_t result) := { |
Harald Welte | f8df4cb | 2018-03-10 15:15:08 +0100 | [diff] [blame] | 523 | header := tr_L1ctlHeader(L1CTL_FBSB_CONF), |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 524 | ul_info := omit, |
Harald Welte | 9e4725d | 2017-07-16 23:18:09 +0200 | [diff] [blame] | 525 | dl_info := ?, |
| 526 | payload := { |
| 527 | fbsb_conf := { |
| 528 | initial_freq_err := ?, |
| 529 | result := result, |
| 530 | bsic := ? |
| 531 | } |
| 532 | } |
| 533 | }; |
| 534 | |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 535 | template (value) L1ctlMessage |
Vadim Yanitskiy | be33f6b | 2020-11-14 04:05:34 +0700 | [diff] [blame] | 536 | ts_L1CTL_CCCH_MODE_REQ(template (value) L1ctlCcchMode ccch_mode) := { |
Harald Welte | f8df4cb | 2018-03-10 15:15:08 +0100 | [diff] [blame] | 537 | header := ts_L1ctlHeader(L1CTL_CCCH_MODE_REQ), |
| 538 | ul_info := omit, |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 539 | dl_info := omit, |
Harald Welte | f8df4cb | 2018-03-10 15:15:08 +0100 | [diff] [blame] | 540 | payload := { |
| 541 | ccch_mode_req := { |
| 542 | ccch_mode := ccch_mode, |
| 543 | padding := '000000'O |
| 544 | } |
| 545 | } |
| 546 | }; |
| 547 | |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 548 | template (value) L1ctlMessage |
Vadim Yanitskiy | 3b1fae4 | 2020-10-19 16:16:41 +0700 | [diff] [blame] | 549 | ts_L1CTL_TCH_MODE_REQ(template (value) L1ctlTchMode tch_mode := L1CTL_CHAN_MODE_SIGN, |
Vadim Yanitskiy | 1618583 | 2020-10-19 21:20:43 +0700 | [diff] [blame] | 550 | template (value) L1ctlAudioMode audio_mode := t_L1CTL_AudioModeFwd, |
Pau Espin Pedrol | 440e1dc | 2022-09-02 16:35:49 +0200 | [diff] [blame] | 551 | template (value) L1ctlLoopMode loop_mode := L1CTL_LOOP_MODE_OPEN, |
| 552 | template (value) uint8_t amr_start_codec := 0, |
| 553 | template (value) BIT8 amr_codecs_bitmask := '00000000'B) := { |
Vadim Yanitskiy | 3b1fae4 | 2020-10-19 16:16:41 +0700 | [diff] [blame] | 554 | header := ts_L1ctlHeader(L1CTL_TCH_MODE_REQ), |
| 555 | ul_info := omit, |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 556 | dl_info := omit, |
Vadim Yanitskiy | 3b1fae4 | 2020-10-19 16:16:41 +0700 | [diff] [blame] | 557 | payload := { |
| 558 | tch_mode_req := { |
| 559 | tch_mode := tch_mode, |
| 560 | audio_mode := audio_mode, |
| 561 | loop_mode := loop_mode, |
Pau Espin Pedrol | 440e1dc | 2022-09-02 16:35:49 +0200 | [diff] [blame] | 562 | amr := { |
| 563 | start_codec := amr_start_codec, |
| 564 | codecs_bitmask := amr_codecs_bitmask |
| 565 | } |
Vadim Yanitskiy | 3b1fae4 | 2020-10-19 16:16:41 +0700 | [diff] [blame] | 566 | } |
| 567 | } |
| 568 | }; |
| 569 | |
Harald Welte | 3757e60 | 2018-03-10 17:12:02 +0100 | [diff] [blame] | 570 | |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 571 | template L1ctlMessage |
Vadim Yanitskiy | be33f6b | 2020-11-14 04:05:34 +0700 | [diff] [blame] | 572 | tr_L1CTL_MsgType(template (present) L1ctlMsgType msg_type) := { |
Harald Welte | 3757e60 | 2018-03-10 17:12:02 +0100 | [diff] [blame] | 573 | header := tr_L1ctlHeader(msg_type), |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 574 | ul_info := *, |
Harald Welte | 3757e60 | 2018-03-10 17:12:02 +0100 | [diff] [blame] | 575 | dl_info := *, |
Harald Welte | f56cc49 | 2018-04-15 10:58:43 +0200 | [diff] [blame] | 576 | payload := * |
Harald Welte | 3757e60 | 2018-03-10 17:12:02 +0100 | [diff] [blame] | 577 | } |
| 578 | |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 579 | template L1ctlMessage tr_L1CTL_CCCH_MODE_CONF := tr_L1CTL_MsgType(L1CTL_CCCH_MODE_CONF); |
Harald Welte | f8df4cb | 2018-03-10 15:15:08 +0100 | [diff] [blame] | 580 | |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 581 | template (value) L1ctlMessage |
Vadim Yanitskiy | be33f6b | 2020-11-14 04:05:34 +0700 | [diff] [blame] | 582 | ts_L1CTL_RACH_REQ(template (value) uint8_t ra, |
| 583 | template (value) uint8_t combined, |
| 584 | template (value) uint16_t offset, |
| 585 | template (value) RslChannelNr chan_nr := ts_RslChanNr_RACH(0), |
| 586 | template (value) RslLinkId link_id := ts_RslLinkID_DCCH(0)) := { |
Harald Welte | f8df4cb | 2018-03-10 15:15:08 +0100 | [diff] [blame] | 587 | header := ts_L1ctlHeader(L1CTL_RACH_REQ), |
Harald Welte | 9e4725d | 2017-07-16 23:18:09 +0200 | [diff] [blame] | 588 | ul_info := { |
Vadim Yanitskiy | e432ba9 | 2019-05-31 18:44:13 +0700 | [diff] [blame] | 589 | chan_nr := chan_nr, |
| 590 | link_id := link_id, |
Harald Welte | 9e4725d | 2017-07-16 23:18:09 +0200 | [diff] [blame] | 591 | padding := '0000'O |
| 592 | }, |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 593 | dl_info := omit, |
Harald Welte | 9e4725d | 2017-07-16 23:18:09 +0200 | [diff] [blame] | 594 | payload := { |
| 595 | rach_req := { |
| 596 | ra := ra, |
| 597 | combined := combined, |
| 598 | offset := offset |
| 599 | } |
| 600 | } |
| 601 | } |
| 602 | |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 603 | template (value) L1ctlMessage |
Vadim Yanitskiy | be33f6b | 2020-11-14 04:05:34 +0700 | [diff] [blame] | 604 | ts_L1CTL_EXT_RACH_REQ(template (value) uint16_t ra11, |
| 605 | template (value) L1ctlRachSynchSeq seq, |
| 606 | template (value) uint8_t combined, |
| 607 | template (value) uint16_t offset) := { |
Vadim Yanitskiy | 5c83679 | 2019-04-22 05:45:03 +0700 | [diff] [blame] | 608 | header := ts_L1ctlHeader(L1CTL_EXT_RACH_REQ), |
| 609 | ul_info := { |
| 610 | /* FIXME: both RSL chan_nr and link_id should be configurable */ |
Vadim Yanitskiy | 443891b | 2022-03-12 17:46:57 +0300 | [diff] [blame] | 611 | chan_nr := ts_RslChanNr_RACH(0), |
Vadim Yanitskiy | 5c83679 | 2019-04-22 05:45:03 +0700 | [diff] [blame] | 612 | link_id := ts_RslLinkID_DCCH(0), |
| 613 | padding := '0000'O |
| 614 | }, |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 615 | dl_info := omit, |
Vadim Yanitskiy | 5c83679 | 2019-04-22 05:45:03 +0700 | [diff] [blame] | 616 | payload := { |
| 617 | ext_rach_req := { |
| 618 | ra11 := ra11, |
| 619 | synch_seq := seq, |
| 620 | combined := combined, |
| 621 | offset := offset |
| 622 | } |
| 623 | } |
| 624 | } |
| 625 | |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 626 | template (value) L1ctlMessage |
Vadim Yanitskiy | be33f6b | 2020-11-14 04:05:34 +0700 | [diff] [blame] | 627 | ts_L1CTL_PAR_REQ(template (value) uint8_t ta, |
| 628 | template (value) uint8_t tx_power) := { |
Harald Welte | f8df4cb | 2018-03-10 15:15:08 +0100 | [diff] [blame] | 629 | header := ts_L1ctlHeader(L1CTL_PARAM_REQ), |
Harald Welte | 3705273 | 2018-03-09 19:38:46 +0100 | [diff] [blame] | 630 | ul_info := { |
Vadim Yanitskiy | 443891b | 2022-03-12 17:46:57 +0300 | [diff] [blame] | 631 | chan_nr := ts_RslChanNr_RACH(0), |
Harald Welte | 3705273 | 2018-03-09 19:38:46 +0100 | [diff] [blame] | 632 | link_id := ts_RslLinkID_DCCH(0), |
| 633 | padding := '0000'O |
| 634 | }, |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 635 | dl_info := omit, |
Harald Welte | 3705273 | 2018-03-09 19:38:46 +0100 | [diff] [blame] | 636 | payload := { |
| 637 | par_req := { |
| 638 | ta := ta, |
| 639 | tx_power := tx_power, |
| 640 | padding := '0000'O |
| 641 | } |
| 642 | } |
| 643 | } |
| 644 | |
Vadim Yanitskiy | 5afe885 | 2020-05-27 14:40:51 +0700 | [diff] [blame] | 645 | /* Base template to be inherited by ts_L1CTL_DM_EST_REQ_H0 and ts_L1CTL_DM_EST_REQ_H1 */ |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 646 | private template (value) L1ctlMessage |
Vadim Yanitskiy | be33f6b | 2020-11-14 04:05:34 +0700 | [diff] [blame] | 647 | ts_L1CTL_DM_EST_REQ(template (value) RslChannelNr chan_nr, |
| 648 | template (value) GsmTsc tsc) := { |
Harald Welte | f8df4cb | 2018-03-10 15:15:08 +0100 | [diff] [blame] | 649 | header := ts_L1ctlHeader(L1CTL_DM_EST_REQ), |
Harald Welte | 9e4725d | 2017-07-16 23:18:09 +0200 | [diff] [blame] | 650 | ul_info := { |
| 651 | chan_nr := chan_nr, |
| 652 | link_id := ts_RslLinkID_DCCH(0), |
| 653 | padding := '0000'O |
| 654 | }, |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 655 | dl_info := omit, |
Harald Welte | 9e4725d | 2017-07-16 23:18:09 +0200 | [diff] [blame] | 656 | payload := { |
| 657 | dm_est_req := { |
| 658 | tsc := tsc, |
Vadim Yanitskiy | 0a3e31c | 2022-12-18 08:09:38 +0700 | [diff] [blame] | 659 | h0h1 := -, |
Vadim Yanitskiy | fe05296 | 2020-10-19 13:27:09 +0700 | [diff] [blame] | 660 | tch_mode := L1CTL_CHAN_MODE_SIGN, |
Vadim Yanitskiy | 1618583 | 2020-10-19 21:20:43 +0700 | [diff] [blame] | 661 | audio_mode := t_L1CTL_AudioModeFwd |
Harald Welte | 9e4725d | 2017-07-16 23:18:09 +0200 | [diff] [blame] | 662 | } |
| 663 | } |
| 664 | } |
| 665 | |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 666 | template (value) L1ctlMessage |
Vadim Yanitskiy | be33f6b | 2020-11-14 04:05:34 +0700 | [diff] [blame] | 667 | ts_L1CTL_DM_EST_REQ_H0(template (value) RslChannelNr chan_nr, |
| 668 | template (value) GsmTsc tsc, |
| 669 | template (value) GsmArfcn arfcn) |
Vadim Yanitskiy | 5afe885 | 2020-05-27 14:40:51 +0700 | [diff] [blame] | 670 | modifies ts_L1CTL_DM_EST_REQ := { |
| 671 | payload := { |
| 672 | dm_est_req := { |
Vadim Yanitskiy | 2cdb97f | 2020-10-19 14:17:38 +0700 | [diff] [blame] | 673 | h0h1 := { |
| 674 | h0 := { |
| 675 | h := 0, |
Vadim Yanitskiy | 1acc7bb | 2020-11-14 04:24:57 +0700 | [diff] [blame] | 676 | arfcn := ts_GsmBandArfcn(arfcn), |
Vadim Yanitskiy | 2cdb97f | 2020-10-19 14:17:38 +0700 | [diff] [blame] | 677 | padding := f_pad_oct(''O, 130, '00'O) |
| 678 | } |
| 679 | } |
Vadim Yanitskiy | 5afe885 | 2020-05-27 14:40:51 +0700 | [diff] [blame] | 680 | } |
| 681 | } |
| 682 | } |
| 683 | |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 684 | template (value) L1ctlMessage |
Vadim Yanitskiy | be33f6b | 2020-11-14 04:05:34 +0700 | [diff] [blame] | 685 | ts_L1CTL_DM_EST_REQ_H1(template (value) RslChannelNr chan_nr, |
| 686 | template (value) GsmTsc tsc, |
| 687 | template (value) uint6_t hsn, |
| 688 | template (value) uint6_t maio, |
| 689 | template (value) L1ctlMA ma) |
Vadim Yanitskiy | eda9081 | 2020-05-27 14:51:18 +0700 | [diff] [blame] | 690 | modifies ts_L1CTL_DM_EST_REQ := { |
| 691 | payload := { |
| 692 | dm_est_req := { |
Vadim Yanitskiy | 2cdb97f | 2020-10-19 14:17:38 +0700 | [diff] [blame] | 693 | h0h1 := { |
| 694 | h1 := { |
| 695 | h := 1, |
| 696 | hsn := hsn, |
| 697 | maio := maio, |
| 698 | n := sizeof(ma), |
| 699 | spare := '00'O, |
| 700 | ma := ma, |
| 701 | /* See https://bugs.eclipse.org/bugs/show_bug.cgi?id=562849 */ |
| 702 | padding := f_pad_oct(''O, (64 - sizeof(ma)) * 2, '00'O) |
| 703 | } |
Vadim Yanitskiy | eda9081 | 2020-05-27 14:51:18 +0700 | [diff] [blame] | 704 | } |
| 705 | } |
| 706 | } |
| 707 | } |
| 708 | |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 709 | template (value) L1ctlMessage |
Vadim Yanitskiy | be33f6b | 2020-11-14 04:05:34 +0700 | [diff] [blame] | 710 | ts_L1CTL_DM_REL_REQ(template (value) RslChannelNr chan_nr) := { |
Harald Welte | f8df4cb | 2018-03-10 15:15:08 +0100 | [diff] [blame] | 711 | header := ts_L1ctlHeader(L1CTL_DM_REL_REQ), |
Harald Welte | 9e4725d | 2017-07-16 23:18:09 +0200 | [diff] [blame] | 712 | ul_info := { |
| 713 | chan_nr := chan_nr, |
| 714 | link_id := ts_RslLinkID_DCCH(0), |
| 715 | padding := '0000'O |
| 716 | }, |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 717 | dl_info := omit, |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 718 | payload := omit |
Harald Welte | 9e4725d | 2017-07-16 23:18:09 +0200 | [diff] [blame] | 719 | } |
| 720 | |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 721 | template (value) L1ctlMessage |
Vadim Yanitskiy | be33f6b | 2020-11-14 04:05:34 +0700 | [diff] [blame] | 722 | ts_L1CTL_DATA_REQ(template (value) RslChannelNr chan_nr, |
| 723 | template (value) RslLinkId link_id, |
| 724 | octetstring l2_data) := { |
Harald Welte | f8df4cb | 2018-03-10 15:15:08 +0100 | [diff] [blame] | 725 | header := ts_L1ctlHeader(L1CTL_DATA_REQ), |
Harald Welte | 9e4725d | 2017-07-16 23:18:09 +0200 | [diff] [blame] | 726 | ul_info := { |
| 727 | chan_nr := chan_nr, |
| 728 | link_id := link_id, |
| 729 | padding := '0000'O |
| 730 | }, |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 731 | dl_info := omit, |
Harald Welte | 9e4725d | 2017-07-16 23:18:09 +0200 | [diff] [blame] | 732 | payload := { |
Vadim Yanitskiy | 0a8d6da | 2019-05-28 22:18:28 +0700 | [diff] [blame] | 733 | data_req := { |
| 734 | l1header := omit, |
| 735 | l2_payload := l2_data |
| 736 | } |
Harald Welte | 9e4725d | 2017-07-16 23:18:09 +0200 | [diff] [blame] | 737 | } |
| 738 | } |
| 739 | |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 740 | template (value) L1ctlMessage |
Vadim Yanitskiy | be33f6b | 2020-11-14 04:05:34 +0700 | [diff] [blame] | 741 | ts_L1CTL_DATA_REQ_SACCH(template (value) RslChannelNr chan_nr, |
| 742 | template (value) RslLinkId link_id, |
| 743 | template (value) SacchL1Header l1h, |
| 744 | octetstring l2_data) := { |
Pau Espin Pedrol | 0aad596 | 2018-09-28 16:03:55 +0200 | [diff] [blame] | 745 | header := ts_L1ctlHeader(L1CTL_DATA_REQ), |
| 746 | ul_info := { |
| 747 | chan_nr := chan_nr, |
| 748 | link_id := link_id, |
| 749 | padding := '0000'O |
| 750 | }, |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 751 | dl_info := omit, |
Pau Espin Pedrol | 0aad596 | 2018-09-28 16:03:55 +0200 | [diff] [blame] | 752 | payload := { |
Vadim Yanitskiy | 0a8d6da | 2019-05-28 22:18:28 +0700 | [diff] [blame] | 753 | data_req := { |
| 754 | l1header := l1h, |
| 755 | l2_payload := l2_data |
| 756 | } |
Pau Espin Pedrol | 0aad596 | 2018-09-28 16:03:55 +0200 | [diff] [blame] | 757 | } |
| 758 | } |
| 759 | |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 760 | template (value) L1ctlMessage |
Vadim Yanitskiy | be33f6b | 2020-11-14 04:05:34 +0700 | [diff] [blame] | 761 | ts_L1CTL_TRAFFIC_REQ(template (value) RslChannelNr chan_nr, |
| 762 | template (value) RslLinkId link_id, |
| 763 | octetstring frame) := { |
Vadim Yanitskiy | f3cc649 | 2019-06-30 16:34:30 +0700 | [diff] [blame] | 764 | header := ts_L1ctlHeader(L1CTL_TRAFFIC_REQ), |
| 765 | ul_info := { |
| 766 | chan_nr := chan_nr, |
| 767 | link_id := link_id, |
| 768 | padding := '0000'O |
| 769 | }, |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 770 | dl_info := omit, |
Vadim Yanitskiy | f3cc649 | 2019-06-30 16:34:30 +0700 | [diff] [blame] | 771 | payload := { |
| 772 | traffic_req := { |
| 773 | data := frame |
| 774 | } |
| 775 | } |
| 776 | }; |
| 777 | |
Harald Welte | 9e4725d | 2017-07-16 23:18:09 +0200 | [diff] [blame] | 778 | /* for matching against incoming RACH_CONF */ |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 779 | template L1ctlMessage tr_L1CTL_RACH_CONF := { |
Harald Welte | f8df4cb | 2018-03-10 15:15:08 +0100 | [diff] [blame] | 780 | header := tr_L1ctlHeader(L1CTL_RACH_CONF), |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 781 | ul_info := omit, |
Harald Welte | 9e4725d | 2017-07-16 23:18:09 +0200 | [diff] [blame] | 782 | dl_info := ?, |
Harald Welte | f56cc49 | 2018-04-15 10:58:43 +0200 | [diff] [blame] | 783 | payload := * |
Harald Welte | 9e4725d | 2017-07-16 23:18:09 +0200 | [diff] [blame] | 784 | }; |
| 785 | |
Vadim Yanitskiy | 60b6188 | 2022-12-18 06:02:22 +0700 | [diff] [blame] | 786 | /* for sending and matching L1CTL_DATA_IND */ |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 787 | template (value) L1ctlMessage |
Vadim Yanitskiy | 60b6188 | 2022-12-18 06:02:22 +0700 | [diff] [blame] | 788 | ts_L1CTL_DATA_IND(template (value) RslChannelNr chan_nr, |
| 789 | template (value) RslLinkId link_id, |
| 790 | template (value) octetstring l2_data, |
| 791 | template (value) GsmBandArfcn arfcn, |
| 792 | template (value) uint32_t fn := 1337, |
| 793 | template (value) GsmRxLev rx_level := 63, |
| 794 | template (value) uint8_t num_biterr := 0, |
| 795 | template (value) uint8_t fire_crc := 0) := { |
| 796 | header := ts_L1ctlHeader(L1CTL_DATA_IND), |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 797 | ul_info := omit, |
Vadim Yanitskiy | 60b6188 | 2022-12-18 06:02:22 +0700 | [diff] [blame] | 798 | dl_info := { |
| 799 | chan_nr := chan_nr, |
| 800 | link_id := link_id, |
| 801 | arfcn := arfcn, |
| 802 | frame_nr := fn, |
| 803 | rx_level := rx_level, |
| 804 | snr := 0, |
| 805 | num_biterr := num_biterr, |
| 806 | fire_crc := fire_crc |
| 807 | }, |
| 808 | payload := { |
| 809 | data_ind := { |
| 810 | payload := l2_data |
| 811 | } |
| 812 | } |
| 813 | }; |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 814 | template L1ctlMessage |
Vadim Yanitskiy | be33f6b | 2020-11-14 04:05:34 +0700 | [diff] [blame] | 815 | tr_L1CTL_DATA_IND(template (present) RslChannelNr chan_nr, |
| 816 | template (present) RslLinkId link_id := ?, |
| 817 | template (present) octetstring l2_data := ?, |
| 818 | template (present) uint8_t num_biterr := 0, |
| 819 | template (present) uint8_t fire_crc := 0) := { |
Harald Welte | f8df4cb | 2018-03-10 15:15:08 +0100 | [diff] [blame] | 820 | header := tr_L1ctlHeader(L1CTL_DATA_IND), |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 821 | ul_info := omit, |
Harald Welte | 9e4725d | 2017-07-16 23:18:09 +0200 | [diff] [blame] | 822 | dl_info := { |
| 823 | chan_nr := chan_nr, |
Harald Welte | ce6dc44 | 2018-02-21 22:00:21 +0100 | [diff] [blame] | 824 | link_id := link_id, |
Harald Welte | 9e4725d | 2017-07-16 23:18:09 +0200 | [diff] [blame] | 825 | arfcn := ?, |
| 826 | frame_nr := ?, |
| 827 | rx_level := ?, |
| 828 | snr := ?, |
Harald Welte | 629cc6b | 2018-03-11 17:19:05 +0100 | [diff] [blame] | 829 | num_biterr := num_biterr, |
Pau Espin Pedrol | 17da323 | 2022-09-02 16:35:32 +0200 | [diff] [blame] | 830 | fire_crc := fire_crc |
Harald Welte | 9e4725d | 2017-07-16 23:18:09 +0200 | [diff] [blame] | 831 | }, |
| 832 | payload := { |
Harald Welte | 68e495b | 2018-02-25 00:05:57 +0100 | [diff] [blame] | 833 | data_ind := { |
| 834 | payload := l2_data |
| 835 | } |
Harald Welte | 9e4725d | 2017-07-16 23:18:09 +0200 | [diff] [blame] | 836 | } |
| 837 | }; |
| 838 | |
Vadim Yanitskiy | f3cc649 | 2019-06-30 16:34:30 +0700 | [diff] [blame] | 839 | /* for matching against incoming TRAFFIC_IND */ |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 840 | template L1ctlMessage |
Vadim Yanitskiy | be33f6b | 2020-11-14 04:05:34 +0700 | [diff] [blame] | 841 | tr_L1CTL_TRAFFIC_IND(template (present) RslChannelNr chan_nr, |
| 842 | template (present) RslLinkId link_id := ?, |
| 843 | template (present) octetstring frame := ?, |
| 844 | template (present) uint8_t num_biterr := ?, |
| 845 | template (present) uint8_t fire_crc := ?) := { |
Vadim Yanitskiy | f3cc649 | 2019-06-30 16:34:30 +0700 | [diff] [blame] | 846 | header := tr_L1ctlHeader(L1CTL_TRAFFIC_IND), |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 847 | ul_info := omit, |
Vadim Yanitskiy | f3cc649 | 2019-06-30 16:34:30 +0700 | [diff] [blame] | 848 | dl_info := { |
| 849 | chan_nr := chan_nr, |
| 850 | link_id := link_id, |
| 851 | arfcn := ?, |
| 852 | frame_nr := ?, |
| 853 | rx_level := ?, |
| 854 | snr := ?, |
| 855 | num_biterr := num_biterr, |
| 856 | fire_crc := fire_crc |
| 857 | }, |
| 858 | payload := { |
| 859 | traffic_ind := { |
| 860 | data := frame |
| 861 | } |
| 862 | } |
| 863 | }; |
| 864 | |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 865 | template (value) L1ctlMessage |
Vadim Yanitskiy | be33f6b | 2020-11-14 04:05:34 +0700 | [diff] [blame] | 866 | ts_L1CTL_CRYPTO_REQ(template (value) RslChannelNr chan_nr, |
| 867 | template (value) uint8_t algo, |
| 868 | template (value) octetstring key) := { |
Harald Welte | e613f96 | 2018-04-18 22:38:16 +0200 | [diff] [blame] | 869 | header := ts_L1ctlHeader(L1CTL_CRYPTO_REQ), |
| 870 | ul_info := { |
| 871 | chan_nr := chan_nr, |
| 872 | link_id := ts_RslLinkID_DCCH(0), |
| 873 | padding := '0000'O |
| 874 | }, |
Vadim Yanitskiy | af0aae6 | 2023-03-18 06:49:18 +0700 | [diff] [blame] | 875 | dl_info := omit, |
Harald Welte | e613f96 | 2018-04-18 22:38:16 +0200 | [diff] [blame] | 876 | payload := { |
| 877 | crypto_req := { |
| 878 | algo := algo, |
| 879 | key_len := 0, /* overwritten */ |
| 880 | key := key |
| 881 | } |
| 882 | } |
| 883 | }; |
| 884 | |
Vadim Yanitskiy | 72a76b5 | 2023-03-18 00:12:09 +0700 | [diff] [blame] | 885 | |
| 886 | template (value) L1ctlMessage |
| 887 | ts_L1CTL_GPRS_UL_TBF_CFG_REQ(template (value) uint8_t tbf_ref, |
Vadim Yanitskiy | 0e5693f | 2023-08-27 14:09:32 +0700 | [diff] [blame] | 888 | template (value) BIT8 slotmask := '00000000'B, |
| 889 | template (value) uint32_t start_fn := c_UINT32_MAX) := { |
Vadim Yanitskiy | 72a76b5 | 2023-03-18 00:12:09 +0700 | [diff] [blame] | 890 | header := ts_L1ctlHeader(L1CTL_GPRS_UL_TBF_CFG_REQ), |
| 891 | ul_info := omit, |
| 892 | dl_info := omit, |
| 893 | payload := { |
| 894 | ul_tbf_cfg_req := { |
| 895 | tbf_ref := tbf_ref, |
| 896 | slotmask := slotmask, |
Vadim Yanitskiy | 0e5693f | 2023-08-27 14:09:32 +0700 | [diff] [blame] | 897 | pad := '0000'O, |
| 898 | start_fn := start_fn |
Vadim Yanitskiy | 72a76b5 | 2023-03-18 00:12:09 +0700 | [diff] [blame] | 899 | } |
| 900 | } |
| 901 | }; |
| 902 | template L1ctlMessage |
| 903 | tr_L1CTL_GPRS_UL_TBF_CFG_REQ(template (present) uint8_t tbf_ref := ?, |
Vadim Yanitskiy | 0e5693f | 2023-08-27 14:09:32 +0700 | [diff] [blame] | 904 | template (present) BIT8 slotmask := ?, |
| 905 | template (present) uint32_t start_fn := ?) := { |
Vadim Yanitskiy | 72a76b5 | 2023-03-18 00:12:09 +0700 | [diff] [blame] | 906 | header := tr_L1ctlHeader(L1CTL_GPRS_UL_TBF_CFG_REQ), |
| 907 | ul_info := omit, |
| 908 | dl_info := omit, |
| 909 | payload := { |
| 910 | ul_tbf_cfg_req := { |
| 911 | tbf_ref := tbf_ref, |
| 912 | slotmask := slotmask, |
Vadim Yanitskiy | 0e5693f | 2023-08-27 14:09:32 +0700 | [diff] [blame] | 913 | pad := ?, |
| 914 | start_fn := start_fn |
Vadim Yanitskiy | 72a76b5 | 2023-03-18 00:12:09 +0700 | [diff] [blame] | 915 | } |
| 916 | } |
| 917 | }; |
| 918 | |
| 919 | template (value) L1ctlMessage |
| 920 | ts_L1CTL_GPRS_DL_TBF_CFG_REQ(template (value) uint8_t tbf_ref, |
| 921 | template (value) BIT8 slotmask := '00000000'B, |
Vadim Yanitskiy | 0e5693f | 2023-08-27 14:09:32 +0700 | [diff] [blame] | 922 | template (value) uint32_t start_fn := c_UINT32_MAX, |
Vadim Yanitskiy | 72a76b5 | 2023-03-18 00:12:09 +0700 | [diff] [blame] | 923 | template (value) uint5_t dl_tfi := 0) := { |
| 924 | header := ts_L1ctlHeader(L1CTL_GPRS_DL_TBF_CFG_REQ), |
| 925 | ul_info := omit, |
| 926 | dl_info := omit, |
| 927 | payload := { |
| 928 | dl_tbf_cfg_req := { |
| 929 | tbf_ref := tbf_ref, |
| 930 | slotmask := slotmask, |
| 931 | dl_tfi := dl_tfi, |
Vadim Yanitskiy | 0e5693f | 2023-08-27 14:09:32 +0700 | [diff] [blame] | 932 | pad := '00'O, |
| 933 | start_fn := start_fn |
Vadim Yanitskiy | 72a76b5 | 2023-03-18 00:12:09 +0700 | [diff] [blame] | 934 | } |
| 935 | } |
| 936 | }; |
| 937 | template L1ctlMessage |
| 938 | tr_L1CTL_GPRS_DL_TBF_CFG_REQ(template (present) uint8_t tbf_ref := ?, |
| 939 | template (present) BIT8 slotmask := ?, |
Vadim Yanitskiy | 0e5693f | 2023-08-27 14:09:32 +0700 | [diff] [blame] | 940 | template (present) uint32_t start_fn := ?, |
Vadim Yanitskiy | 72a76b5 | 2023-03-18 00:12:09 +0700 | [diff] [blame] | 941 | template (present) uint5_t dl_tfi := ?) := { |
| 942 | header := tr_L1ctlHeader(L1CTL_GPRS_DL_TBF_CFG_REQ), |
| 943 | ul_info := omit, |
| 944 | dl_info := omit, |
| 945 | payload := { |
| 946 | dl_tbf_cfg_req := { |
| 947 | tbf_ref := tbf_ref, |
| 948 | slotmask := slotmask, |
| 949 | dl_tfi := dl_tfi, |
Vadim Yanitskiy | 0e5693f | 2023-08-27 14:09:32 +0700 | [diff] [blame] | 950 | pad := ?, |
| 951 | start_fn := start_fn |
Vadim Yanitskiy | 72a76b5 | 2023-03-18 00:12:09 +0700 | [diff] [blame] | 952 | } |
| 953 | } |
| 954 | }; |
| 955 | |
| 956 | template (value) L1ctlMessage |
| 957 | ts_L1CTL_GPRS_UL_BLOCK_REQ(template (value) GsmFrameNumber fn, |
| 958 | template (value) uint3_t tn, |
| 959 | template (value) octetstring data) := { |
| 960 | header := ts_L1ctlHeader(L1CTL_GPRS_UL_BLOCK_REQ), |
| 961 | ul_info := omit, |
| 962 | dl_info := omit, |
| 963 | payload := { |
| 964 | ul_block_req := { |
| 965 | hdr := { |
| 966 | fn := fn, |
| 967 | tn := tn, |
| 968 | pad := '000000'O |
| 969 | }, |
| 970 | data := data |
| 971 | } |
| 972 | } |
| 973 | }; |
| 974 | template L1ctlMessage |
| 975 | tr_L1CTL_GPRS_UL_BLOCK_REQ(template (present) GsmFrameNumber fn := ?, |
| 976 | template (present) uint3_t tn := ?, |
| 977 | template (present) octetstring data := ?) := { |
| 978 | header := tr_L1ctlHeader(L1CTL_GPRS_UL_BLOCK_REQ), |
| 979 | ul_info := omit, |
| 980 | dl_info := omit, |
| 981 | payload := { |
| 982 | ul_block_req := { |
| 983 | hdr := { |
| 984 | fn := fn, |
| 985 | tn := tn, |
| 986 | pad := ? |
| 987 | }, |
| 988 | data := data |
| 989 | } |
| 990 | } |
| 991 | }; |
| 992 | |
| 993 | template (value) L1ctlMessage |
| 994 | ts_L1CTL_GPRS_DL_BLOCK_IND(template (value) GsmFrameNumber fn, |
| 995 | template (value) uint3_t tn, |
| 996 | template (value) uint3_t usf, |
| 997 | template (value) octetstring data, |
| 998 | template (value) uint16_t ber10k := 0, |
| 999 | template (value) int16_t ci_cb := 180 /* 18 dB */, |
| 1000 | template (value) GsmRxLev rx_level := 63) := { |
| 1001 | header := ts_L1ctlHeader(L1CTL_GPRS_DL_BLOCK_IND), |
| 1002 | ul_info := omit, |
| 1003 | dl_info := omit, |
| 1004 | payload := { |
| 1005 | dl_block_ind := { |
| 1006 | hdr := { |
| 1007 | fn := fn, |
| 1008 | tn := tn, |
| 1009 | pad := '000000'O |
| 1010 | }, |
| 1011 | meas := { |
| 1012 | ber10k := ber10k, |
| 1013 | ci_cb := ci_cb, |
| 1014 | rx_level := rx_level |
| 1015 | }, |
| 1016 | usf := usf, |
| 1017 | data := data |
| 1018 | } |
| 1019 | } |
| 1020 | }; |
| 1021 | template L1ctlMessage |
| 1022 | tr_L1CTL_GPRS_DL_BLOCK_IND(template (present) GsmFrameNumber fn := ?, |
| 1023 | template (present) uint3_t tn := ?, |
| 1024 | template (present) uint3_t usf := ?, |
| 1025 | template (present) octetstring data := ?, |
| 1026 | template (present) uint16_t ber10k := ?, |
| 1027 | template (present) int16_t ci_cb := ?, |
| 1028 | template (present) GsmRxLev rx_level := ?) := { |
| 1029 | header := tr_L1ctlHeader(L1CTL_GPRS_DL_BLOCK_IND), |
| 1030 | ul_info := omit, |
| 1031 | dl_info := omit, |
| 1032 | payload := { |
| 1033 | dl_block_ind := { |
| 1034 | hdr := { |
| 1035 | fn := fn, |
| 1036 | tn := tn, |
| 1037 | pad := ? |
| 1038 | }, |
| 1039 | meas := { |
| 1040 | ber10k := ber10k, |
| 1041 | ci_cb := ci_cb, |
| 1042 | rx_level := rx_level |
| 1043 | }, |
| 1044 | usf := usf, |
| 1045 | data := data |
| 1046 | } |
| 1047 | } |
| 1048 | }; |
| 1049 | |
Harald Welte | 68e495b | 2018-02-25 00:05:57 +0100 | [diff] [blame] | 1050 | const octetstring c_DummyUI := '0303012B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B'O; |
| 1051 | |
Harald Welte | 7024baa | 2018-03-02 23:37:51 +0100 | [diff] [blame] | 1052 | /* We use "BYTEORDER(last)" so we get little-endian integers. Unfortuantely, this also |
| 1053 | switches the byte ordering in octet strings, so we need to explicitly annotate them :/ */ |
Harald Welte | f654332 | 2017-07-16 07:35:10 +0200 | [diff] [blame] | 1054 | } with { encode "RAW" }; |