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