Vadim Yanitskiy | 0df8c94 | 2020-05-02 16:23:35 +0700 | [diff] [blame] | 1 | /** |
| 2 | * GSM Rest Octets definitions as per 3GPP TS 44.018. |
| 3 | * |
Vadim Yanitskiy | d5f6bfe | 2020-07-01 03:13:13 +0700 | [diff] [blame] | 4 | * (C) 2020 by sysmocom s.f.m.c. GmbH <info@sysmocom.de> |
Vadim Yanitskiy | 0df8c94 | 2020-05-02 16:23:35 +0700 | [diff] [blame] | 5 | * (C) 2020 Vadim Yanitskiy <axilirator@gmail.com> |
| 6 | * All rights reserved. |
| 7 | * |
| 8 | * Released under the terms of GNU General Public License, Version 2 or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * SPDX-License-Identifier: GPL-2.0-or-later |
| 12 | */ |
| 13 | |
| 14 | module GSM_RestOctets { |
| 15 | |
| 16 | import from General_Types all; |
| 17 | import from Osmocom_Types all; |
Pau Espin Pedrol | 28652d8 | 2021-02-09 20:20:17 +0100 | [diff] [blame] | 18 | import from RLCMAC_CSN1_Types all; |
Vadim Yanitskiy | 150d6d1 | 2022-10-20 19:10:04 +0700 | [diff] [blame] | 19 | import from GSM_Types all; |
| 20 | |
| 21 | /* 10.5.2.16 IA (Immediate Assignment) Rest Octets */ |
| 22 | type record IaRestOctets { |
| 23 | BIT2 presence, |
| 24 | IaRestOctLL ll optional, |
| 25 | IaRestOctLH lh optional, |
| 26 | IaRestOctHL hl optional, |
| 27 | IaRestOctHH hh optional |
| 28 | } with { |
| 29 | variant (presence) "CSN.1 L/H" |
| 30 | variant (ll) "PRESENCE(presence = '00'B)" |
| 31 | variant (lh) "PRESENCE(presence = '01'B)" |
| 32 | variant (hl) "PRESENCE(presence = '10'B)" |
| 33 | variant (hh) "PRESENCE(presence = '11'B)" |
| 34 | |
| 35 | /* The TITAN's RAW encoder generates an octet-aligned octetstring, |
| 36 | * so we should make sure that unused bits contain proper padding. */ |
| 37 | variant "PADDING(yes), PADDING_PATTERN('00101011'B)" |
| 38 | }; |
| 39 | |
| 40 | type record IaRestOctLL { |
| 41 | BIT1 compressed_irat_ho_info_ind |
| 42 | } with { |
| 43 | variant (compressed_irat_ho_info_ind) "CSN.1 L/H" |
| 44 | }; |
| 45 | |
| 46 | type record IaRestOctLH { |
| 47 | BIT2 presence, |
| 48 | EgprsUlAss egprs_ul optional, |
| 49 | octetstring multiblock_dl_ass optional /* TODO */ |
| 50 | } with { |
| 51 | variant (egprs_ul) "PRESENCE(presence = '00'B)" |
| 52 | variant (multiblock_dl_ass) "PRESENCE(presence = '01'B)" |
| 53 | }; |
| 54 | |
| 55 | /* EGPRS Packet Uplink Assignment */ |
| 56 | type record EgprsUlAss { |
| 57 | BIT5 ext_ra, |
| 58 | BIT1 ats_present, |
| 59 | AccessTechnologiesRequestRepetition ats optional, |
| 60 | BIT1 presence, |
| 61 | EgprsUlAssignDyn dynamic optional, |
| 62 | EgprsUlAssignMultiblock multiblock optional |
| 63 | } with { |
| 64 | variant (ats) "PRESENCE(ats_present = '1'B)" |
| 65 | variant (dynamic) "PRESENCE(presence = '1'B)" |
| 66 | variant (multiblock) "PRESENCE(presence = '0'B)" |
| 67 | /* See https://bugs.eclipse.org/bugs/show_bug.cgi?id=562488 */ |
| 68 | variant (ext_ra) "BYTEORDER(last)" // FIXME: should be first |
| 69 | }; |
| 70 | |
| 71 | type record EgprsUlAssignDyn { |
| 72 | uint5_t tfi_assignment, |
| 73 | BIT1 polling, |
| 74 | BIT1 spare ('0'B), |
| 75 | uint3_t usf, |
| 76 | BIT1 usf_granularity, |
| 77 | BIT1 p0_present, |
| 78 | uint4_t p0 optional, |
| 79 | BIT1 pr_mode optional, |
| 80 | EgprsChCodingCommand egprs_ch_coding_cmd, |
| 81 | BIT1 tlli_block_chan_coding, |
| 82 | BIT1 bep_period2_present, |
| 83 | BIT4 bep_period2 optional, |
| 84 | BIT1 resegment, |
| 85 | EgprsWindowSize egprs_window_size, |
| 86 | BIT1 alpha_present, |
| 87 | uint4_t alpha optional, |
| 88 | uint5_t gamma, |
| 89 | BIT1 ta_index_present, |
| 90 | uint4_t ta_index optional, |
| 91 | BIT1 tbf_starting_time_present, |
| 92 | TbfStartingTime tbf_starting_time optional |
| 93 | /* TODO: Additions for Rel-7 */ |
| 94 | } with { |
| 95 | variant (p0) "PRESENCE(p0_present = '1'B)" |
| 96 | variant (pr_mode) "PRESENCE(p0_present = '1'B)" |
| 97 | variant (bep_period2) "PRESENCE(bep_period2_present = '1'B)" |
| 98 | variant (alpha) "PRESENCE(alpha_present = '1'B)" |
| 99 | variant (ta_index) "PRESENCE(ta_index_present = '1'B)" |
| 100 | variant (tbf_starting_time) "PRESENCE(tbf_starting_time_present = '1'B)" |
| 101 | }; |
| 102 | |
| 103 | type record EgprsUlAssignMultiblock { |
| 104 | BIT1 alpha_present, |
| 105 | uint4_t alpha optional, |
| 106 | uint5_t gamma, |
| 107 | TbfStartingTime tbf_starting_time, |
| 108 | BIT2 nr_radio_blocks_allocated, |
| 109 | BIT1 p0_present, |
| 110 | uint4_t p0 optional, |
| 111 | BIT1 spare ('0'B) optional, |
| 112 | BIT1 pr_mode optional |
| 113 | /* TDO: Additions for Rel-6 */ |
| 114 | } with { |
| 115 | variant (alpha) "PRESENCE(alpha_present = '1'B)" |
| 116 | variant (p0) "PRESENCE(p0_present = '1'B)" |
| 117 | variant (spare) "PRESENCE(p0_present = '1'B)" |
| 118 | variant (pr_mode) "PRESENCE(p0_present = '1'B)" |
| 119 | }; |
| 120 | |
| 121 | type record IaRestOctHL { |
| 122 | uint6_t freq_par_len, |
| 123 | BIT2 padding ('00'B) optional, |
| 124 | uint6_t maio optional, |
| 125 | octetstring mobile_allocation optional |
| 126 | } with { |
| 127 | variant (freq_par_len) "LENGTHTO(mobile_allocation,maio,padding)" |
| 128 | /* |
| 129 | variant (padding) "PRESENCE(freq_par_len != 0)" |
| 130 | variant (maio) "PRESENCE(freq_par_len != 0)" |
| 131 | variant (mobile_allocation) "PRESENCE(freq_par_len != 0)" |
| 132 | */ |
| 133 | }; |
| 134 | |
| 135 | type record IaRestOctHH { |
| 136 | /* Packet Assignment discriminator: |
| 137 | * Packet Uplink / Downlink Assignment (0) |
| 138 | * Second Part Packet Assignment (1) */ |
| 139 | BIT1 pa_disc, |
| 140 | PacketAssignUnion pa |
| 141 | } with { |
| 142 | variant (pa) "CROSSTAG(spa, pa_disc = '1'B; uldl, pa_disc = '0'B)" |
| 143 | }; |
| 144 | |
| 145 | type union PacketAssignUnion { |
| 146 | SecondPartAssign spa, |
| 147 | PacketUlDlAssign uldl |
| 148 | }; |
| 149 | |
| 150 | type record SecondPartAssign { |
| 151 | BIT1 r99, /* L / H */ |
| 152 | BIT1 presence optional, |
| 153 | BIT5 ext_ra optional |
| 154 | } with { |
| 155 | variant (r99) "CSN.1 L/H" |
| 156 | variant (presence) "PRESENCE(r99 = '1'B)" /* H */ |
| 157 | variant (ext_ra) "PRESENCE(presence = '1'B)" |
| 158 | /* See https://bugs.eclipse.org/bugs/show_bug.cgi?id=562488 */ |
| 159 | variant (ext_ra) "BYTEORDER(last)" // FIXME: should be first |
| 160 | }; |
| 161 | |
| 162 | type record PacketUlDlAssign { |
| 163 | BIT1 ass_disc, |
| 164 | PacketUlDlAssignUnion ass |
| 165 | } with { |
| 166 | variant (ass) "CROSSTAG(dl, ass_disc = '1'B; ul, ass_disc = '0'B)" |
| 167 | }; |
| 168 | |
| 169 | type union PacketUlDlAssignUnion { |
| 170 | PacketUlAssign ul, |
| 171 | PacketDlAssign dl |
| 172 | }; |
| 173 | |
| 174 | type record PacketUlAssign { |
| 175 | BIT1 presence, |
| 176 | PacketUlAssignDyn dynamic optional, |
| 177 | PacketUlAssignSgl single optional |
| 178 | /* TODO: Estended RA, PFI */ |
| 179 | } with { |
| 180 | variant (dynamic) "PRESENCE(presence = '1'B)" |
| 181 | variant (single) "PRESENCE(presence = '0'B)" |
| 182 | }; |
| 183 | |
| 184 | type record PacketUlAssignDyn { |
| 185 | uint5_t tfi_assignment, |
| 186 | BIT1 polling, |
| 187 | BIT1 spare ('0'B), |
| 188 | uint3_t usf, |
| 189 | BIT1 usf_granularity, |
| 190 | BIT1 p0_present, |
| 191 | uint4_t p0 optional, |
| 192 | BIT1 pr_mode optional, |
| 193 | ChCodingCommand ch_coding_cmd, |
| 194 | BIT1 tlli_block_chan_coding, |
| 195 | BIT1 alpha_present, |
| 196 | uint4_t alpha optional, |
| 197 | uint5_t gamma, |
| 198 | BIT1 ta_index_present, |
| 199 | uint4_t ta_index optional, |
| 200 | BIT1 tbf_starting_time_present, |
| 201 | TbfStartingTime tbf_starting_time optional |
| 202 | } with { |
| 203 | variant (p0) "PRESENCE(p0_present = '1'B)" |
| 204 | variant (pr_mode) "PRESENCE(p0_present = '1'B)" |
| 205 | variant (alpha) "PRESENCE(alpha_present = '1'B)" |
| 206 | variant (ta_index) "PRESENCE(ta_index_present = '1'B)" |
| 207 | variant (tbf_starting_time) "PRESENCE(tbf_starting_time_present = '1'B)" |
| 208 | }; |
| 209 | |
| 210 | type record PacketUlAssignSgl { |
| 211 | BIT1 alpha_present, |
| 212 | uint4_t alpha optional, |
| 213 | uint5_t gamma, |
| 214 | BIT2 padding ('01'B), |
| 215 | TbfStartingTime tbf_starting_time |
| 216 | /* TODO: P0 / PR_MODE */ |
| 217 | } with { |
| 218 | variant (alpha) "PRESENCE(alpha_present = '1'B)" |
| 219 | }; |
| 220 | |
| 221 | type record PacketDlAssign { |
| 222 | GprsTlli tlli, |
| 223 | BIT1 group1_present, |
| 224 | PacketDlAssG1 group1 optional, |
| 225 | BIT1 ta_index_present, |
| 226 | uint4_t ta_index optional, |
| 227 | BIT1 tbf_starting_time_present, |
| 228 | TbfStartingTime tbf_starting_time optional, |
| 229 | BIT1 p0_present, |
| 230 | uint4_t p0 optional, |
| 231 | BIT1 pr_mode optional |
| 232 | /* TODO: EGPRS window size, etc. */ |
| 233 | } with { |
| 234 | variant (group1) "PRESENCE(group1_present = '1'B)" |
| 235 | variant (ta_index) "PRESENCE(ta_index_present = '1'B)" |
| 236 | variant (tbf_starting_time) "PRESENCE(tbf_starting_time_present = '1'B)" |
| 237 | variant (p0) "PRESENCE(p0_present = '1'B)" |
| 238 | variant (pr_mode) "PRESENCE(p0_present = '1'B)" |
| 239 | }; |
| 240 | |
| 241 | type record PacketDlAssG1 { |
| 242 | uint5_t tfi_assignment, |
| 243 | BIT1 rlc_mode, |
| 244 | BIT1 alpha_present, |
| 245 | uint4_t alpha optional, |
| 246 | uint5_t gamma, |
| 247 | BIT1 polling, |
| 248 | BIT1 ta_valid |
| 249 | } with { variant "" }; |
| 250 | |
| 251 | type record TbfStartingTime { |
| 252 | uint5_t t1, |
| 253 | uint6_t t3, |
| 254 | uint5_t t2 |
| 255 | }; |
| 256 | |
| 257 | /* 10.5.2.17 IAR (Immediate Assignment Reject) Rest Octets */ |
| 258 | type record IARRestOctets { |
| 259 | ExtRAList ext_ra_list, |
| 260 | BIT1 rel13_ind, // L/H |
| 261 | uint3_t rcc optional |
| 262 | /* Addition in Rel-15: PEO IMM Cell Group Details struct */ |
| 263 | } with { |
| 264 | variant (rel13_ind) "CSN.1 L/H" |
| 265 | variant (rcc) "PRESENCE(rel13_ind = '1'B)" |
| 266 | |
| 267 | /* The TITAN's RAW encoder generates an octet-aligned octetstring, |
| 268 | * so we should make sure that unused bits contain proper padding. */ |
| 269 | variant "PADDING(yes), PADDING_PATTERN('00101011'B)" |
| 270 | }; |
| 271 | |
| 272 | /* Optional extended RA: 0 | 1 < Extended RA 1 : bit (5) > */ |
| 273 | type record length(4) of ExtRAOpt ExtRAList; |
| 274 | type record ExtRAOpt { |
| 275 | BIT1 presence, // L/H |
| 276 | BIT5 ext_ra optional |
| 277 | } with { |
| 278 | variant (presence) "CSN.1 L/H" |
| 279 | variant (ext_ra) "PRESENCE(presence = '1'B)" |
| 280 | /* See https://bugs.eclipse.org/bugs/show_bug.cgi?id=562488 */ |
| 281 | variant (ext_ra) "BYTEORDER(last)" |
| 282 | }; |
Vadim Yanitskiy | 0df8c94 | 2020-05-02 16:23:35 +0700 | [diff] [blame] | 283 | |
Vadim Yanitskiy | a193def | 2022-10-21 15:18:55 +0700 | [diff] [blame] | 284 | |
| 285 | external function enc_IaRestOctets(in IaRestOctets ro) return octetstring |
| 286 | with { extension "prototype(convert) encode(RAW)" }; |
| 287 | external function dec_IaRestOctets(in octetstring stream) return IaRestOctets |
| 288 | with { extension "prototype(convert) decode(RAW)" }; |
| 289 | |
| 290 | external function enc_IARRestOctets(in IARRestOctets ro) return octetstring |
| 291 | with { extension "prototype(convert) encode(RAW)" }; |
| 292 | external function dec_IARRestOctets(in octetstring stream) return IARRestOctets |
| 293 | with { extension "prototype(convert) decode(RAW)" }; |
| 294 | |
| 295 | |
Vadim Yanitskiy | d5f6bfe | 2020-07-01 03:13:13 +0700 | [diff] [blame] | 296 | /* 10.5.2.33b SI 2quater Rest Octets */ |
| 297 | type record SI2quaterRestOctets { |
| 298 | BIT1 ba_ind, |
| 299 | BIT1 ba_3g_ind, |
| 300 | BIT1 mp_change_mark, |
| 301 | uint4_t si2quater_index, |
| 302 | uint4_t si2quater_count, |
| 303 | |
| 304 | /* Measurement Parameters Description */ |
| 305 | MeasParamsDescOpt meas_params_desc, |
| 306 | /* GPRS specific parameters */ |
| 307 | record { |
| 308 | GPRS_RealTimeDiffDescOpt rt_diff_desc, |
| 309 | GPRS_BSICDescOpt bsic_desc, |
| 310 | GPRS_ReportPrioDescOpt rep_prio_desc, |
| 311 | MeasParamsDescOpt meas_params_desc |
| 312 | } gprs, |
| 313 | /* NC Measurement Parameters Description */ |
| 314 | NCMeasParamsOpt nc_meas_params, |
| 315 | /* SI2quater Extension Information */ |
| 316 | SI2quaterExtInfoOpt ext_info, |
| 317 | |
| 318 | /* 3G Neighbour Cell Description */ |
| 319 | UTRAN_NeighDescOpt utran_neigh_desc, |
| 320 | /* 3G Measurement Parameters Description */ |
| 321 | UTRAN_MeasParamsDescOpt utran_meas_params_desc, |
| 322 | /* GPRS 3G Measurement Parameters Description */ |
| 323 | UTRAN_GPRSMeasParamsDescOpt utran_gprs_meas_params_desc, |
| 324 | |
| 325 | /* SI2quater Rel-{5,6,7,8,9,10} Additions (Matrioshka!) */ |
| 326 | SI2quaterAdditions rel_additions |
| 327 | } with { |
| 328 | /* The TITAN's RAW encoder generates an octet-aligned octetstring, |
| 329 | * so we should make sure that unused bits contain proper padding. */ |
| 330 | variant "PADDING(yes), PADDING_PATTERN('00101011'B)" |
| 331 | }; |
Neels Hofmeyr | ad132f2 | 2020-07-08 02:20:16 +0200 | [diff] [blame] | 332 | type record of SI2quaterRestOctets SI2quaterRestOctetsList; |
Vadim Yanitskiy | d5f6bfe | 2020-07-01 03:13:13 +0700 | [diff] [blame] | 333 | |
| 334 | /* Measurement Parameters Description */ |
| 335 | private type record MeasParamsDescOpt { |
| 336 | BIT1 presence, // 0/1 |
| 337 | MeasParamsDesc desc optional |
| 338 | } with { |
| 339 | variant (desc) "PRESENCE(presence = '1'B)" |
| 340 | }; |
| 341 | |
| 342 | private type record MeasParamsDesc { |
| 343 | BIT1 report_type, |
| 344 | BIT2 serving_band_reporting |
| 345 | } with { variant "" }; |
| 346 | |
| 347 | /* GPRS Real Time Difference Description (not implemented) */ |
| 348 | private type record GPRS_RealTimeDiffDescOpt { |
| 349 | BIT1 presence ('0'B), // 0/1 |
| 350 | bitstring desc optional // TODO |
| 351 | } with { |
| 352 | variant (desc) "PRESENCE(presence = '1'B)" |
| 353 | }; |
| 354 | |
| 355 | /* GPRS BSIC Description (not implemented) */ |
| 356 | private type record GPRS_BSICDescOpt { |
| 357 | BIT1 presence ('0'B), // 0/1 |
| 358 | bitstring desc optional // TODO |
| 359 | } with { |
| 360 | variant (desc) "PRESENCE(presence = '1'B)" |
| 361 | }; |
| 362 | |
| 363 | /* GPRS Report Priority Description (not implemented) */ |
| 364 | private type record GPRS_ReportPrioDescOpt { |
| 365 | BIT1 presence ('0'B), // 0/1 |
| 366 | bitstring desc optional // TODO |
| 367 | } with { |
| 368 | variant (desc) "PRESENCE(presence = '1'B)" |
| 369 | }; |
| 370 | |
| 371 | /* NC (Network Controlled?) Measurement Parameters */ |
| 372 | private type record NCMeasParams { |
| 373 | /* Network Control Order */ |
| 374 | BIT2 nco, |
| 375 | BIT1 p_presence, |
| 376 | NCMeasPeriods p optional |
| 377 | } with { |
| 378 | variant (p) "PRESENCE(p_presence = '1'B)" |
| 379 | }; |
| 380 | |
| 381 | /* NC Measurement Periods */ |
| 382 | private type record NCMeasParamsOpt { |
| 383 | BIT1 presence, // 0/1 |
| 384 | NCMeasParams params optional |
| 385 | } with { |
| 386 | variant (params) "PRESENCE(presence = '1'B)" |
| 387 | }; |
| 388 | |
| 389 | private type record NCMeasPeriods { |
| 390 | BIT3 non_drx_period, |
| 391 | BIT3 rep_period_i, |
| 392 | BIT3 rep_period_t |
| 393 | } with { variant "" }; |
| 394 | |
| 395 | /* SI2quater Extersion Information */ |
| 396 | private type record SI2quaterExtInfoOpt { |
| 397 | BIT1 presence, // 0/1 |
| 398 | SI2quaterExtInfo info optional |
| 399 | } with { |
| 400 | variant (info) "PRESENCE(presence = '1'B)" |
| 401 | }; |
| 402 | |
| 403 | private type record SI2quaterExtInfo { |
| 404 | uint8_t len, |
| 405 | CCNSupportDescOpt ccn_supp_desc optional, |
| 406 | bitstring padding /* Octet alignment? */ |
| 407 | } with { |
| 408 | variant (len) "LENGTHTO(ccn_supp_desc,padding) + 1" |
| 409 | variant (len) "UNIT(bits)" |
| 410 | }; |
| 411 | |
| 412 | /* CCN Support Description */ |
| 413 | private type record CCNSupportDescOpt { |
| 414 | BIT1 presence, // 0/1 |
| 415 | CCNSupportDesc desc optional |
| 416 | } with { |
| 417 | variant (desc) "PRESENCE(presence = '1'B)" |
| 418 | }; |
| 419 | |
| 420 | private type record CCNSupportDesc { |
| 421 | uint7_t nr_of_cells, |
| 422 | bitstring ccn_supported |
| 423 | } with { |
| 424 | variant (nr_of_cells) "LENGTHTO(ccn_supported)" |
| 425 | variant (nr_of_cells) "UNIT(bits)" |
| 426 | }; |
| 427 | |
| 428 | /* 3G Neighbour Cell Description */ |
| 429 | private type record UTRAN_NeighDescOpt { |
| 430 | BIT1 presence, // 0/1 |
| 431 | UTRAN_NeighDesc desc optional |
| 432 | } with { |
| 433 | variant (desc) "PRESENCE(presence = '1'B)" |
| 434 | }; |
| 435 | |
| 436 | private type record UTRAN_NeighDesc { |
| 437 | BIT1 idx_start_3g_presence, |
| 438 | uint7_t idx_start_3g optional, |
| 439 | BIT1 abs_idx_start_emr_presence, |
| 440 | uint7_t abs_idx_start_emr optional, |
| 441 | UTRAN_FDDDescOpt fdd_desc, |
| 442 | UTRAN_TDDDescOpt tdd_desc |
| 443 | } with { |
| 444 | variant (idx_start_3g) "PRESENCE(idx_start_3g_presence = '1'B)" |
| 445 | variant (abs_idx_start_emr) "PRESENCE(abs_idx_start_emr_presence = '1'B)" |
| 446 | }; |
| 447 | |
| 448 | /* UTRAN (3G) FDD/TDD Description (not implementaed). |
| 449 | * |
| 450 | * TODO: Repeated UTRAN FDD/TDD Neighbour Cells structure contains a variable length |
| 451 | * field, that needs to be computed using tables (see 9.1.54.1a and 9.1.54.1b) with |
| 452 | * magic numbers. This cannot be described uing TITAN's RAW codec attributes. */ |
| 453 | private type record UTRAN_FDDDescOpt { |
| 454 | BIT1 presence ('0'B), // 0/1 |
| 455 | bitstring desc optional // TODO |
| 456 | } with { |
| 457 | variant (desc) "PRESENCE(presence = '1'B)" |
| 458 | }; |
| 459 | |
| 460 | private type record UTRAN_TDDDescOpt { |
| 461 | BIT1 presence ('0'B), // 0/1 |
| 462 | bitstring desc optional // TODO |
| 463 | } with { |
| 464 | variant (desc) "PRESENCE(presence = '1'B)" |
| 465 | }; |
| 466 | |
| 467 | /* 3G Measurement Parameters Description (not implemented) */ |
| 468 | private type record UTRAN_MeasParamsDescOpt { |
| 469 | BIT1 presence ('0'B), // 0/1 |
| 470 | bitstring desc optional // TODO |
| 471 | } with { |
| 472 | variant (desc) "PRESENCE(presence = '1'B)" |
| 473 | }; |
| 474 | |
| 475 | /* GPRS 3G Measurement Parameters Description (not implemented) */ |
| 476 | private type record UTRAN_GPRSMeasParamsDescOpt { |
| 477 | BIT1 presence ('0'B), // 0/1 |
| 478 | bitstring desc optional // TODO |
| 479 | } with { |
| 480 | variant (desc) "PRESENCE(presence = '1'B)" |
| 481 | }; |
| 482 | |
| 483 | /* SI2quater Rel-{5,6,7,8,9,10} Additions */ |
| 484 | private type record SI2quaterAdditions { |
| 485 | BIT1 rel5_presence, // L/H |
| 486 | SI2quaterR5Additions rel5 optional |
| 487 | } with { |
| 488 | variant (rel5_presence) "CSN.1 L/H" |
| 489 | variant (rel5) "PRESENCE(rel5_presence = '1'B)" |
| 490 | }; |
| 491 | |
| 492 | /* SI2quater Rel-5 and Rel-{6,7,8,9,10} Additions */ |
| 493 | private type record SI2quaterR5Additions { |
| 494 | UMTS_AddMeasParamsDescOpt umts_add_meas_params_desc, |
| 495 | UMTS_AddMeasParamsDesc2Opt umts_add_meas_params_desc2, |
| 496 | BIT1 rel6_presence, // L/H |
| 497 | SI2quaterR6Additions rel6 optional |
| 498 | } with { |
| 499 | variant (rel6_presence) "CSN.1 L/H" |
| 500 | variant (rel6) "PRESENCE(rel6_presence = '1'B)" |
| 501 | }; |
| 502 | |
| 503 | /* 3G Additional Measurement Parameters Description */ |
| 504 | private type record UMTS_AddMeasParamsDescOpt { |
| 505 | BIT1 presence, // 0/1 |
| 506 | UMTS_AddMeasParamsDesc desc optional |
| 507 | } with { |
| 508 | variant (desc) "PRESENCE(presence = '1'B)" |
| 509 | }; |
| 510 | |
| 511 | private type record UMTS_AddMeasParamsDesc { |
| 512 | BIT3 fdd_qmin_offset, |
| 513 | BIT4 fdd_rscpmin |
| 514 | } with { variant "" }; |
| 515 | |
| 516 | /* 3G Additional Measurement Parameters Description 2 */ |
| 517 | private type record UMTS_AddMeasParamsDesc2Opt { |
| 518 | BIT1 presence, // 0/1 |
| 519 | UMTS_AddMeasParamsDesc desc optional |
| 520 | } with { |
| 521 | variant (desc) "PRESENCE(presence = '1'B)" |
| 522 | }; |
| 523 | |
| 524 | private type record UMTS_AddMeasParamsDesc2 { |
| 525 | /* FDD Reporting Threshold 2 */ |
| 526 | BIT1 presence, // 0/1 |
| 527 | uint6_t threshold optional |
| 528 | } with { |
| 529 | variant (threshold) "PRESENCE(presence = '1'B)" |
| 530 | }; |
| 531 | |
| 532 | /* SI2quater Rel-6 and Rel-{7,8,9,10} Additions */ |
| 533 | private type record SI2quaterR6Additions { |
| 534 | BIT1 umts_ccn_active, |
| 535 | BIT1 rel7_presence, // L/H |
| 536 | SI2quaterR7Additions rel7 optional |
| 537 | } with { |
| 538 | variant (rel7_presence) "CSN.1 L/H" |
| 539 | variant (rel7) "PRESENCE(rel7_presence = '1'B)" |
| 540 | }; |
| 541 | |
| 542 | /* SI2quater Rel-7 and Rel-{8,9,10} Additions */ |
| 543 | private type record SI2quaterR7Additions { |
| 544 | Rel7RepOffseThresholdOpt rep700, |
| 545 | Rel7RepOffseThresholdOpt rep810, |
| 546 | BIT1 rel8_presence, // L/H |
| 547 | SI2quaterR8Additions rel8 optional |
| 548 | } with { |
| 549 | variant (rel8_presence) "CSN.1 L/H" |
| 550 | variant (rel8) "PRESENCE(rel8_presence = '1'B)" |
| 551 | }; |
| 552 | |
| 553 | /* Additions in Rel-7: Reporting Offset & Threshold */ |
| 554 | private type record Rel7RepOffseThresholdOpt { |
| 555 | BIT1 presence, // 0/1 |
| 556 | Rel7RepOffseThreshold val optional |
| 557 | } with { |
| 558 | variant (val) "PRESENCE(presence = '1'B)" |
| 559 | }; |
| 560 | |
| 561 | private type record Rel7RepOffseThreshold { |
| 562 | BIT3 offset, |
| 563 | BIT3 threshold |
| 564 | } with { variant "" }; |
| 565 | |
| 566 | /* SI2quater Rel-8 and Rel-{9,10} Additions */ |
| 567 | private type record SI2quaterR8Additions { |
| 568 | Rel8PrioEUTRANParamsDescOpt prio_eutran_params_desc, |
| 569 | Rel8UTRANCSGDescOpt utran_csg_desc, |
| 570 | Rel8EUTRANCSGDescOpt eutran_csg_desc |
| 571 | // TODO: Rel9 Additions (not implemented) |
| 572 | } with { variant "" }; |
| 573 | |
| 574 | /* Additions in Rel-8: Priority and E-UTRAN Parameters Description */ |
| 575 | private type record Rel8PrioEUTRANParamsDescOpt { |
| 576 | BIT1 presence, // 0/1 |
| 577 | Rel8PrioEUTRANParamsDesc desc optional |
| 578 | } with { |
| 579 | variant (desc) "PRESENCE(presence = '1'B)" |
| 580 | }; |
| 581 | |
| 582 | private type record Rel8PrioEUTRANParamsDesc { |
| 583 | ServingCellPrioParamsDescOpt sc_prio_params_desc, |
| 584 | UTRAN_PrioParamsDescOpt utran_prio_params_desc, |
| 585 | EUTRAN_ParamsDescOpt eutran_params_desc |
| 586 | } with { variant "" }; |
| 587 | |
| 588 | /* Serving Cell Priority Parameters Description */ |
| 589 | private type record ServingCellPrioParamsDescOpt { |
| 590 | BIT1 presence, // 0/1 |
| 591 | ServingCellPrioParamsDesc desc optional |
| 592 | } with { |
| 593 | variant (desc) "PRESENCE(presence = '1'B)" |
| 594 | }; |
| 595 | |
| 596 | private type record ServingCellPrioParamsDesc { |
| 597 | uint3_t geran_priority, |
| 598 | uint4_t thresh_priority_search, |
| 599 | uint4_t thresh_gsm_low, |
| 600 | uint2_t h_prio, |
| 601 | uint2_t t_reselection |
| 602 | } with { variant "" }; |
| 603 | |
| 604 | /* 3G Priority Parameters Description (not implemented) */ |
| 605 | private type record UTRAN_PrioParamsDescOpt { |
| 606 | BIT1 presence, // 0/1 |
| 607 | bitstring desc optional // TODO |
| 608 | } with { |
| 609 | variant (desc) "PRESENCE(presence = '1'B)" |
| 610 | }; |
| 611 | |
| 612 | /* E-UTRAN Parameters Description */ |
| 613 | private type record EUTRAN_ParamsDescOpt { |
| 614 | BIT1 presence, // 0/1 |
| 615 | EUTRAN_ParamsDesc desc optional |
| 616 | } with { |
| 617 | variant (desc) "PRESENCE(presence = '1'B)" |
| 618 | }; |
| 619 | |
| 620 | private type record EUTRAN_ParamsDesc { |
| 621 | BIT1 ccn_active, |
| 622 | BIT1 e_start, |
| 623 | BIT1 e_stop, |
| 624 | |
| 625 | /* E-UTRAN Measurement Parameters Description */ |
| 626 | EUTRAN_MeasParamsDescOpt meas_params_desc, |
| 627 | /* GPRS E-UTRAN Measurement Parameters Description */ |
| 628 | EUTRAN_GPRSMeasParamsDescOpt gprs_meas_params_desc, |
| 629 | |
| 630 | /* { 1 < Repeated E-UTRAN Neighbour Cells > } ** 0 */ |
Neels Hofmeyr | c865573 | 2020-07-08 00:55:18 +0200 | [diff] [blame] | 631 | EUTRAN_RepeatedNeighbourCells repeated_neigh_cells optional, |
| 632 | BIT1 repeated_neigh_cells_term ('0'B), |
Vadim Yanitskiy | d5f6bfe | 2020-07-01 03:13:13 +0700 | [diff] [blame] | 633 | /* { 1 < Repeated E-UTRAN Not Allowed Cells > } ** 0 */ |
Neels Hofmeyr | c865573 | 2020-07-08 00:55:18 +0200 | [diff] [blame] | 634 | EUTRAN_RepeatedNotAllowedCells repeated_not_allowed_cells optional, |
| 635 | BIT1 repeated_not_allowed_cells_term ('0'B), |
Vadim Yanitskiy | d5f6bfe | 2020-07-01 03:13:13 +0700 | [diff] [blame] | 636 | /* { 1 < Repeated E-UTRAN PCID to TA mapping > } ** 0 */ |
| 637 | EUTRAN_PCID2TAMaps pcid2ta_map_list optional, |
| 638 | BIT1 pcid2ta_map_list_term ('0'B) |
| 639 | } with { variant "" }; |
| 640 | |
| 641 | /* E-UTRAN Measurement Parameters Description (not implemented) */ |
| 642 | private type record EUTRAN_MeasParamsDescOpt { |
| 643 | BIT1 presence, // 0/1 |
| 644 | bitstring desc optional // TODO |
| 645 | } with { |
| 646 | variant (desc) "PRESENCE(presence = '1'B)" |
| 647 | }; |
| 648 | |
| 649 | /* GPRS E-UTRAN Measurement Parameters Description (not implemented) */ |
| 650 | private type record EUTRAN_GPRSMeasParamsDescOpt { |
| 651 | BIT1 presence, // 0/1 |
| 652 | bitstring desc optional // TODO |
| 653 | } with { |
| 654 | variant (desc) "PRESENCE(presence = '1'B)" |
| 655 | }; |
| 656 | |
Neels Hofmeyr | c865573 | 2020-07-08 00:55:18 +0200 | [diff] [blame] | 657 | /* Repeated E-UTRAN Neighbour Cells */ |
| 658 | private type record of EUTRAN_NeighbourCells EUTRAN_RepeatedNeighbourCells; |
Vadim Yanitskiy | eacec8a | 2020-07-03 06:44:40 +0700 | [diff] [blame] | 659 | type record EUTRAN_NeighbourCells { |
Vadim Yanitskiy | d5f6bfe | 2020-07-01 03:13:13 +0700 | [diff] [blame] | 660 | BIT1 item_ind ('1'B), |
| 661 | /* { 1 < Repeated E-UTRAN Neighbour Cells > } ** 0 */ |
| 662 | EUTRAN_CellDescs cell_desc_list optional, |
| 663 | BIT1 cell_desc_list_term ('0'B), |
| 664 | BIT1 prio_presence, // 0/1 |
| 665 | uint3_t prio optional, |
| 666 | uint5_t thresh_high, |
| 667 | BIT1 thresh_low_presence, // 0/1 |
| 668 | uint5_t thresh_low optional, |
| 669 | BIT1 qrxlevmin_presence, // 0/1 |
| 670 | uint5_t qrxlevmin optional |
| 671 | } with { |
| 672 | variant "PRESENCE(item_ind = '1'B)" |
| 673 | variant (prio) "PRESENCE(prio_presence = '1'B)" |
| 674 | variant (thresh_low) "PRESENCE(thresh_low_presence = '1'B)" |
| 675 | variant (qrxlevmin) "PRESENCE(qrxlevmin_presence = '1'B)" |
| 676 | }; |
| 677 | |
| 678 | /* Repeated E-UTRAN Cell Description (E-ARFCN & Measurement Bandwidth) List */ |
Vadim Yanitskiy | eacec8a | 2020-07-03 06:44:40 +0700 | [diff] [blame] | 679 | type record of EUTRAN_CellDesc EUTRAN_CellDescs; |
| 680 | type record EUTRAN_CellDesc { |
Vadim Yanitskiy | d5f6bfe | 2020-07-01 03:13:13 +0700 | [diff] [blame] | 681 | BIT1 item_ind ('1'B), |
| 682 | uint16_t e_arfcn, |
| 683 | BIT1 meas_bw_presence, // 0/1 |
| 684 | uint3_t meas_bw optional |
| 685 | } with { |
| 686 | variant "PRESENCE(item_ind = '1'B)" |
| 687 | variant (meas_bw) "PRESENCE(meas_bw_presence = '1'B)" |
| 688 | }; |
| 689 | |
Neels Hofmeyr | c865573 | 2020-07-08 00:55:18 +0200 | [diff] [blame] | 690 | /* Repeated E-UTRAN Not Allowed Cells */ |
| 691 | private type record of EUTRAN_NotAllowedCells EUTRAN_RepeatedNotAllowedCells; |
| 692 | private type record EUTRAN_NotAllowedCells { |
Vadim Yanitskiy | d5f6bfe | 2020-07-01 03:13:13 +0700 | [diff] [blame] | 693 | BIT1 item_ind ('1'B), |
| 694 | /* FIXME: Not Allowed Cells : < PCID Group IE > (not implemented) */ |
| 695 | BIT1 pcid_group_presence ('0'B), |
| 696 | /* { 1 < Repeated E-UTRAN_FREQUENCY_INDEX > } ** 0 */ |
| 697 | EUTRAN_FreqIndexes freq_idx_list optional, |
| 698 | BIT1 freq_idx_list_term ('0'B) |
| 699 | } with { |
| 700 | variant "PRESENCE(item_ind = '1'B)" |
| 701 | }; |
| 702 | |
| 703 | /* Repeated E-UTRAN PCID to TA mapping List */ |
| 704 | private type record of EUTRAN_PCID2TAMap EUTRAN_PCID2TAMaps; |
| 705 | private type record EUTRAN_PCID2TAMap { |
| 706 | BIT1 item_ind ('1'B), |
| 707 | /* FIXME: PCID to TA mapping : < PCID Group IE > (not implemented) */ |
| 708 | BIT1 pcid_group_presence ('0'B), |
| 709 | /* { 1 < Repeated E-UTRAN_FREQUENCY_INDEX > } ** 0 */ |
| 710 | EUTRAN_FreqIndexes freq_idx_list optional, |
| 711 | BIT1 freq_idx_list_term ('0'B) |
| 712 | } with { |
| 713 | variant "PRESENCE(item_ind = '1'B)" |
| 714 | }; |
| 715 | |
| 716 | /* Repeated E-UTRAN Frequency Index List */ |
| 717 | private type record of EUTRAN_FreqIndex EUTRAN_FreqIndexes; |
| 718 | private type record EUTRAN_FreqIndex { |
| 719 | BIT1 item_ind ('1'B), |
| 720 | uint3_t idx |
| 721 | } with { |
| 722 | variant "PRESENCE(item_ind = '1'B)" |
| 723 | }; |
| 724 | |
| 725 | /* Additions in Rel-8: 3G CSG Description (not implemented) */ |
| 726 | private type record Rel8UTRANCSGDescOpt { |
| 727 | BIT1 presence, // 0/1 |
| 728 | bitstring desc optional // TODO |
| 729 | } with { |
| 730 | variant (desc) "PRESENCE(presence = '1'B)" |
| 731 | }; |
| 732 | |
| 733 | /* Additions in Rel-8: E-UTRAN CSG Description (not implemented) */ |
| 734 | private type record Rel8EUTRANCSGDescOpt { |
| 735 | BIT1 presence, // 0/1 |
| 736 | bitstring desc optional // TODO |
| 737 | } with { |
| 738 | variant (desc) "PRESENCE(presence = '1'B)" |
| 739 | }; |
| 740 | |
| 741 | |
| 742 | /* Basic any-/omit-matching templates. To be inherited by other templates (see below). |
| 743 | * The point is that you cannot fit everything into 20 octets, so usually several kinds |
| 744 | * of SI2quater are being sub-multiplexed by the BTS. This is achieved using both |
| 745 | * 'si2quater_index' and 'si2quater_count' fields. */ |
| 746 | template SI2quaterRestOctets tra_SI2quaterRestOctets_base := { |
| 747 | ba_ind := ?, |
| 748 | ba_3g_ind := ?, |
| 749 | mp_change_mark := ?, |
| 750 | si2quater_index := ?, |
| 751 | si2quater_count := ?, |
| 752 | |
| 753 | meas_params_desc := { presence := ?, desc := * }, |
| 754 | gprs := { |
| 755 | rt_diff_desc := { presence := ?, desc := * }, |
| 756 | bsic_desc := { presence := ?, desc := * }, |
| 757 | rep_prio_desc := { presence := ?, desc := * }, |
| 758 | meas_params_desc := { presence := ?, desc := * } |
| 759 | }, |
| 760 | nc_meas_params := { presence := ?, params := * }, |
| 761 | ext_info := { presence := ?, info := * }, |
| 762 | |
| 763 | utran_neigh_desc := { presence := ?, desc := * }, |
| 764 | utran_meas_params_desc := { presence := ?, desc := * }, |
| 765 | utran_gprs_meas_params_desc := { presence := ?, desc := * }, |
| 766 | |
| 767 | rel_additions := ? |
| 768 | }; |
| 769 | |
| 770 | template SI2quaterRestOctets tro_SI2quaterRestOctets_base := { |
| 771 | ba_ind := ?, |
| 772 | ba_3g_ind := ?, |
| 773 | mp_change_mark := ?, |
| 774 | si2quater_index := ?, |
| 775 | si2quater_count := ?, |
| 776 | |
| 777 | meas_params_desc := { presence := '0'B, desc := omit }, |
| 778 | gprs := { |
| 779 | rt_diff_desc := { presence := '0'B, desc := omit }, |
| 780 | bsic_desc := { presence := '0'B, desc := omit }, |
| 781 | rep_prio_desc := { presence := '0'B, desc := omit }, |
| 782 | meas_params_desc := { presence := '0'B, desc := omit } |
| 783 | }, |
| 784 | nc_meas_params := { presence := '0'B, params := omit }, |
| 785 | ext_info := { presence := '0'B, info := omit }, |
| 786 | |
| 787 | utran_neigh_desc := { presence := '0'B, desc := omit }, |
| 788 | utran_meas_params_desc := { presence := '0'B, desc := omit }, |
| 789 | utran_gprs_meas_params_desc := { presence := '0'B, desc := omit }, |
| 790 | |
| 791 | rel_additions := { rel5_presence := CSN1_L, rel5 := omit } |
| 792 | }; |
| 793 | |
Vadim Yanitskiy | eacec8a | 2020-07-03 06:44:40 +0700 | [diff] [blame] | 794 | template SI2quaterRestOctets tro_SI2quaterRestOctets_rel8_EUTRAN |
| 795 | modifies tro_SI2quaterRestOctets_base |
| 796 | := { |
| 797 | ba_ind := ?, |
| 798 | ba_3g_ind := ?, |
| 799 | mp_change_mark := ?, |
| 800 | si2quater_index := ?, |
| 801 | si2quater_count := ?, |
| 802 | |
| 803 | rel_additions := { |
| 804 | rel5_presence := CSN1_H, |
| 805 | rel5 := { |
| 806 | umts_add_meas_params_desc := { presence := '0'B, desc := omit }, |
| 807 | umts_add_meas_params_desc2 := { presence := '0'B, desc := omit }, |
| 808 | rel6_presence := CSN1_H, |
| 809 | rel6 := { |
| 810 | umts_ccn_active := '0'B, |
| 811 | rel7_presence := CSN1_H, |
| 812 | rel7 := { |
| 813 | rep700 := { presence := '0'B, val := omit }, |
| 814 | rep810 := { presence := '0'B, val := omit }, |
| 815 | rel8_presence := CSN1_H, |
| 816 | rel8 := { |
| 817 | prio_eutran_params_desc := { |
| 818 | presence := '1'B, |
| 819 | desc := { |
| 820 | sc_prio_params_desc := { presence := '0'B, desc := omit }, |
| 821 | utran_prio_params_desc := { presence := '0'B, desc := omit }, |
| 822 | eutran_params_desc := { |
| 823 | presence := '1'B, |
| 824 | desc := { |
| 825 | ccn_active := ?, |
| 826 | e_start := ?, |
| 827 | e_stop := ?, |
| 828 | meas_params_desc := { presence := '0'B, desc := omit }, |
| 829 | gprs_meas_params_desc := { presence := '0'B, desc := omit }, |
| 830 | repeated_neigh_cells := *, |
| 831 | repeated_neigh_cells_term := '0'B, |
| 832 | repeated_not_allowed_cells := omit, |
| 833 | repeated_not_allowed_cells_term := '0'B, |
| 834 | pcid2ta_map_list := omit, |
| 835 | pcid2ta_map_list_term := '0'B |
| 836 | } |
| 837 | } |
| 838 | } |
| 839 | }, |
| 840 | utran_csg_desc := { presence := '0'B, desc := omit }, |
| 841 | eutran_csg_desc := { presence := '0'B, desc := omit } |
| 842 | } |
| 843 | } |
| 844 | } |
| 845 | } |
| 846 | } |
| 847 | }; |
| 848 | |
| 849 | template EUTRAN_CellDesc tr_EUTRAN_CellDesc(template (present) uint16_t e_arfcn := ?, |
| 850 | template (present) BIT1 meas_bw_presence := ?, |
| 851 | template uint3_t meas_bw := *) |
| 852 | := { |
| 853 | item_ind := '1'B, |
| 854 | e_arfcn := e_arfcn, |
| 855 | meas_bw_presence := meas_bw_presence, |
| 856 | meas_bw := meas_bw |
| 857 | } |
| 858 | |
| 859 | /* Defaults correspond to osmo-bsc cfg: |
| 860 | * si2quater neighbor-list add earfcn 111 thresh-hi 20 thresh-lo 10 prio 3 qrxlv 22 meas 3 |
| 861 | */ |
| 862 | template EUTRAN_NeighbourCells tr_EUTRAN_NeighbourCells(template (present) EUTRAN_CellDescs cell_desc_list := { tr_EUTRAN_CellDesc }, |
| 863 | template (present) BIT1 prio_presence := ?, |
| 864 | template uint3_t prio := *, |
| 865 | template (present) uint5_t thresh_high := ?, |
| 866 | template (present) BIT1 thresh_low_presence := ?, |
| 867 | template uint5_t thresh_low := *, |
| 868 | template (present) BIT1 qrxlevmin_presence := ?, |
| 869 | template uint5_t qrxlevmin := *) |
| 870 | := { |
| 871 | item_ind := '1'B, |
| 872 | cell_desc_list := cell_desc_list, |
| 873 | cell_desc_list_term := '0'B, |
| 874 | prio_presence := prio_presence, |
| 875 | prio := prio, |
| 876 | thresh_high := thresh_high, |
| 877 | thresh_low_presence := thresh_low_presence, |
| 878 | thresh_low := thresh_low, |
| 879 | qrxlevmin_presence := qrxlevmin_presence, |
| 880 | qrxlevmin := qrxlevmin |
| 881 | }; |
| 882 | |
| 883 | template SI2quaterRestOctets tr_SI2quaterRestOctets_EUTRAN( |
| 884 | template integer index := 0, |
| 885 | template integer count := 0, |
| 886 | template EUTRAN_RepeatedNeighbourCells repeated_neigh_cells := { tr_EUTRAN_NeighbourCells } |
| 887 | ) modifies tro_SI2quaterRestOctets_rel8_EUTRAN := { |
| 888 | si2quater_index := index, |
| 889 | si2quater_count := count, |
| 890 | rel_additions := { |
| 891 | rel5 := { |
| 892 | rel6 := { |
| 893 | rel7 := { |
| 894 | rel8 := { |
| 895 | prio_eutran_params_desc := { |
| 896 | desc := { |
| 897 | sc_prio_params_desc := { |
| 898 | presence := '1'B, |
| 899 | desc := { |
| 900 | geran_priority := 0, |
| 901 | thresh_priority_search := 0, |
| 902 | thresh_gsm_low := 0, |
| 903 | h_prio := 0, |
| 904 | t_reselection := 0 |
| 905 | } |
| 906 | }, |
| 907 | eutran_params_desc := { |
| 908 | desc := { |
| 909 | ccn_active := '0'B, |
| 910 | e_start := '1'B, |
| 911 | e_stop := '1'B, |
| 912 | repeated_neigh_cells := repeated_neigh_cells |
| 913 | } |
| 914 | } |
| 915 | } |
| 916 | } |
| 917 | } |
| 918 | } |
| 919 | } |
| 920 | } |
| 921 | } |
| 922 | }; |
| 923 | |
Vadim Yanitskiy | d5f6bfe | 2020-07-01 03:13:13 +0700 | [diff] [blame] | 924 | |
Vadim Yanitskiy | 0df8c94 | 2020-05-02 16:23:35 +0700 | [diff] [blame] | 925 | /* 10.5.2.34 SI 3 Rest Octets */ |
| 926 | type record SI3RestOctets { |
| 927 | SelectionParamsOpt sel_params, |
| 928 | PowerOffsetOpt pwr_offset, |
| 929 | BIT1 si_2ter_ind, |
| 930 | BIT1 early_cm_ind, |
| 931 | SchedIfAndWhere sched_where, |
| 932 | GPRSIndicatorOpt gprs_ind, |
| 933 | BIT1 umts_early_cm_ind, |
| 934 | SI2quaterIndicatorOpt si2_quater_ind, |
| 935 | BIT1 iu_mode_ind ('1'B) optional, |
| 936 | SI21IndicatorOpt si21_ind optional |
| 937 | /* ... spare padding ... */ |
| 938 | } with { |
| 939 | variant (si_2ter_ind) "CSN.1 L/H" |
| 940 | variant (early_cm_ind) "CSN.1 L/H" |
| 941 | variant (umts_early_cm_ind) "CSN.1 L/H" |
| 942 | |
| 943 | /* If Iu mode is not supported in the cell, the Iu Indicator is not sent |
| 944 | * within this cell. Iu Indicator is included if and only if GPRS is |
| 945 | * not supported, and Iu mode is supported in the cell. */ |
| 946 | variant (iu_mode_ind) "PRESENCE(gprs_ind.presence = '0'B)" |
| 947 | /* SI21 field is only present if 'WHERE' information is not present. */ |
| 948 | variant (si21_ind) "PRESENCE(sched_where.presence = '0'B)" |
Vadim Yanitskiy | 135b45e | 2020-05-04 19:54:02 +0700 | [diff] [blame] | 949 | |
| 950 | /* The TITAN's RAW encoder generates an octet-aligned octetstring, |
| 951 | * so we should make sure that unused bits contain proper padding. */ |
| 952 | variant "PADDING(yes), PADDING_PATTERN('00101011'B)" |
Vadim Yanitskiy | 0df8c94 | 2020-05-02 16:23:35 +0700 | [diff] [blame] | 953 | }; |
| 954 | |
Vadim Yanitskiy | 72add6d | 2020-05-03 21:46:42 +0700 | [diff] [blame] | 955 | /* 10.5.2.35 SI 4 Rest Octets (O & S) */ |
| 956 | type record SI4RestOctets { |
| 957 | SelectionParamsOpt sel_params, |
| 958 | PowerOffsetOpt pwr_offset, |
| 959 | GPRSIndicatorOpt gprs_ind, |
| 960 | BIT1 s_presence, // L/H |
| 961 | /* TODO: optional "Rest Octets S" part */ |
| 962 | bitstring s optional |
| 963 | } with { |
| 964 | variant (s_presence) "CSN.1 L/H" |
| 965 | variant (s) "PRESENCE(s_presence = '1'B)" |
Vadim Yanitskiy | 135b45e | 2020-05-04 19:54:02 +0700 | [diff] [blame] | 966 | |
| 967 | /* The TITAN's RAW encoder generates an octet-aligned octetstring, |
| 968 | * so we should make sure that unused bits contain proper padding. */ |
| 969 | variant "PADDING(yes), PADDING_PATTERN('00101011'B)" |
Vadim Yanitskiy | 72add6d | 2020-05-03 21:46:42 +0700 | [diff] [blame] | 970 | }; |
| 971 | |
Vadim Yanitskiy | dbd2f61 | 2022-03-10 17:03:26 +0300 | [diff] [blame] | 972 | /* 10.5.2.35a SI 6 Rest Octets */ |
| 973 | type record SI6RestOctets { |
| 974 | PchAndNchInfoOpt pch_nch_info, |
| 975 | VbsVgcsOptionsOpt vbs_vgcs_options, |
| 976 | BIT1 dtm_support, // L/H |
| 977 | uint8_t rac optional, |
| 978 | uint3_t max_lapdm optional, |
| 979 | BIT1 band_ind // L/H (DCS/PCS) |
| 980 | /* TODO: add more fields */ |
| 981 | } with { |
| 982 | variant (dtm_support) "CSN.1 L/H" |
| 983 | variant (rac) "PRESENCE(dtm_support = '1'B)" |
| 984 | variant (max_lapdm) "PRESENCE(dtm_support = '1'B)" |
| 985 | variant (band_ind) "CSN.1 L/H" |
| 986 | |
| 987 | /* The TITAN's RAW encoder generates an octet-aligned octetstring, |
| 988 | * so we should make sure that unused bits contain proper padding. */ |
| 989 | variant "PADDING(yes), PADDING_PATTERN('00101011'B)" |
| 990 | }; |
| 991 | |
| 992 | /* Optional PCH and NCH info: L | H < PCH and NCH info > */ |
| 993 | type record PchAndNchInfoOpt { |
| 994 | BIT1 presence, // L/H |
| 995 | PchAndNchInfo info optional |
| 996 | } with { |
| 997 | variant (presence) "CSN.1 L/H" |
| 998 | variant (info) "PRESENCE(presence = '1'B)" |
| 999 | }; |
| 1000 | |
| 1001 | /* PCH and NCH info */ |
| 1002 | type record PchAndNchInfo { |
| 1003 | BIT1 pag_chan_restruct, |
| 1004 | uint2_t nln_sacch, |
| 1005 | BIT1 call_prio_presence, |
| 1006 | uint3_t call_prio optional, |
| 1007 | BIT1 nln_status_sacch |
| 1008 | } with { |
| 1009 | variant (call_prio) "PRESENCE(call_prio_presence = '1'B)" |
| 1010 | }; |
| 1011 | |
| 1012 | /* Optional VBS/VGCS options: L | H < VBS/VGCS options > */ |
| 1013 | type record VbsVgcsOptionsOpt { |
| 1014 | BIT1 presence, // L/H |
| 1015 | BIT2 options optional |
| 1016 | } with { |
| 1017 | variant (presence) "CSN.1 L/H" |
| 1018 | variant (options) "PRESENCE(presence = '1'B)" |
| 1019 | }; |
| 1020 | |
Pau Espin Pedrol | 28652d8 | 2021-02-09 20:20:17 +0100 | [diff] [blame] | 1021 | /* 10.5.2.37b SI 13 Rest Octets (O & S) */ |
| 1022 | type record SI13RestOctets { |
| 1023 | BIT1 presence, // L/H |
| 1024 | uint3_t bcch_change_mark, |
| 1025 | BIT4 si_change_field, |
| 1026 | BIT1 presence2, |
| 1027 | BIT2 si13_change_mark optional, |
| 1028 | GprsMobileAllocation gprs_ma optional, |
| 1029 | BIT1 zero ('0'B), /* PBCCH not present in cell */ |
| 1030 | uint8_t rac, |
| 1031 | BIT1 spgc_ccch_sup, |
| 1032 | BIT3 priority_access_thr, |
| 1033 | BIT2 network_control_order, |
| 1034 | GprsCellOptions gprs_cell_opts, |
| 1035 | GprsPowerControlParameters gprs_pwr_ctrl_params |
| 1036 | /* TODO: Additions in release 99 */ |
| 1037 | } with { |
| 1038 | |
| 1039 | variant (presence) "CSN.1 L/H" |
| 1040 | /* TODO: for all fields after presencte: variant (<field>) "PRESENCE(presence = '1'B)" */ |
| 1041 | variant (si13_change_mark) "PRESENCE(presence2 = '1'B)" |
| 1042 | variant (gprs_ma) "PRESENCE(presence2 = '1'B)" |
| 1043 | |
| 1044 | /* The TITAN's RAW encoder generates an octet-aligned octetstring, |
| 1045 | * so we should make sure that unused bits contain proper padding. */ |
| 1046 | variant "PADDING(yes), PADDING_PATTERN('00101011'B)" |
| 1047 | }; |
| 1048 | |
Vadim Yanitskiy | 0df8c94 | 2020-05-02 16:23:35 +0700 | [diff] [blame] | 1049 | /* Selection Parameters */ |
| 1050 | type record SelectionParams { |
| 1051 | boolean cbq, |
| 1052 | uint6_t cr_offset, |
| 1053 | uint3_t temp_offset, |
| 1054 | uint5_t penalty_time |
| 1055 | } with { |
| 1056 | variant (cbq) "FIELDLENGTH(1)" |
| 1057 | }; |
| 1058 | |
| 1059 | /* Optional Selection Parameters: L | H < Selection Parameters > */ |
| 1060 | type record SelectionParamsOpt { |
| 1061 | BIT1 presence, // L/H |
| 1062 | SelectionParams params optional |
| 1063 | } with { |
| 1064 | variant (presence) "CSN.1 L/H" |
| 1065 | variant (params) "PRESENCE(presence = '1'B)" |
| 1066 | }; |
| 1067 | |
| 1068 | /* Optional Power Offset: L | H < Power Offset bit(2) > */ |
| 1069 | type record PowerOffsetOpt { |
| 1070 | BIT1 presence, // L/H |
| 1071 | uint2_t offset optional |
| 1072 | } with { |
| 1073 | variant (presence) "CSN.1 L/H" |
| 1074 | variant (offset) "PRESENCE(presence = '1'B)" |
| 1075 | }; |
| 1076 | |
| 1077 | /* Scheduling if and where: L | H < WHERE bit(3) > */ |
| 1078 | type record SchedIfAndWhere { |
| 1079 | BIT1 presence, // L/H |
| 1080 | uint3_t where optional |
| 1081 | } with { |
| 1082 | variant (presence) "CSN.1 L/H" |
| 1083 | variant (where) "PRESENCE(presence = '1'B)" |
| 1084 | }; |
| 1085 | |
| 1086 | type record GPRSIndicator { |
| 1087 | uint3_t ra_colour, |
| 1088 | BIT1 si13_pos |
| 1089 | } with { variant "" }; |
| 1090 | |
| 1091 | /* Optional GPRS Indicator: L | H < GPRS Indicator > */ |
| 1092 | type record GPRSIndicatorOpt { |
| 1093 | BIT1 presence, // L/H |
| 1094 | GPRSIndicator ind optional |
| 1095 | } with { |
| 1096 | variant (presence) "CSN.1 L/H" |
| 1097 | variant (ind) "PRESENCE(presence = '1'B)" |
| 1098 | }; |
| 1099 | |
| 1100 | /* Optional SI2quater Indicator: L | H < SI2quater Indicator > */ |
| 1101 | type record SI2quaterIndicatorOpt { |
| 1102 | BIT1 presence, // L/H |
| 1103 | BIT1 ind optional |
| 1104 | } with { |
| 1105 | variant (presence) "CSN.1 L/H" |
| 1106 | variant (ind) "PRESENCE(presence = '1'B)" |
| 1107 | }; |
| 1108 | |
| 1109 | /* Optional SI21 Indicator: L | H < SI21 Position > */ |
| 1110 | type record SI21IndicatorOpt { |
| 1111 | BIT1 presence, // L/H |
| 1112 | BIT1 pos optional |
| 1113 | } with { |
| 1114 | variant (presence) "CSN.1 L/H" |
| 1115 | variant (pos) "PRESENCE(presence = '1'B)" |
| 1116 | }; |
| 1117 | |
Vadim Yanitskiy | d5f6bfe | 2020-07-01 03:13:13 +0700 | [diff] [blame] | 1118 | |
| 1119 | external function enc_SI2quaterRestOctets(in SI2quaterRestOctets ro) return octetstring |
| 1120 | with { extension "prototype(convert) encode(RAW)" }; |
| 1121 | external function dec_SI2quaterRestOctets(in octetstring stream) return SI2quaterRestOctets |
| 1122 | with { extension "prototype(convert) decode(RAW)" }; |
| 1123 | |
Vadim Yanitskiy | 0df8c94 | 2020-05-02 16:23:35 +0700 | [diff] [blame] | 1124 | external function enc_SI3RestOctets(in SI3RestOctets ro) return octetstring |
| 1125 | with { extension "prototype(convert) encode(RAW)" }; |
| 1126 | external function dec_SI3RestOctets(in octetstring stream) return SI3RestOctets |
| 1127 | with { extension "prototype(convert) decode(RAW)" }; |
| 1128 | |
Vadim Yanitskiy | 72add6d | 2020-05-03 21:46:42 +0700 | [diff] [blame] | 1129 | external function enc_SI4RestOctets(in SI4RestOctets ro) return octetstring |
| 1130 | with { extension "prototype(convert) encode(RAW)" }; |
| 1131 | external function dec_SI4RestOctets(in octetstring stream) return SI4RestOctets |
| 1132 | with { extension "prototype(convert) decode(RAW)" }; |
| 1133 | |
Vadim Yanitskiy | dbd2f61 | 2022-03-10 17:03:26 +0300 | [diff] [blame] | 1134 | external function enc_SI6RestOctets(in SI4RestOctets ro) return octetstring |
| 1135 | with { extension "prototype(convert) encode(RAW)" }; |
| 1136 | external function dec_SI6RestOctets(in octetstring stream) return SI6RestOctets |
| 1137 | with { extension "prototype(convert) decode(RAW)" }; |
| 1138 | |
Pau Espin Pedrol | 28652d8 | 2021-02-09 20:20:17 +0100 | [diff] [blame] | 1139 | external function enc_SI13RestOctets(in SI13RestOctets ro) return octetstring |
| 1140 | with { extension "prototype(convert) encode(RAW)" }; |
| 1141 | external function dec_SI13RestOctets(in octetstring stream) return SI13RestOctets |
| 1142 | with { extension "prototype(convert) decode(RAW)" }; |
| 1143 | |
Vadim Yanitskiy | 0df8c94 | 2020-05-02 16:23:35 +0700 | [diff] [blame] | 1144 | |
Vadim Yanitskiy | 12cf3d9 | 2020-05-05 00:19:50 +0700 | [diff] [blame] | 1145 | /* Basic templates to be extended in place */ |
| 1146 | template (value) SI3RestOctets ts_SI3RestOctets := { |
| 1147 | sel_params := { |
| 1148 | presence := CSN1_L, |
| 1149 | params := omit |
| 1150 | }, |
| 1151 | pwr_offset := { |
| 1152 | presence := CSN1_L, |
| 1153 | offset := omit |
| 1154 | }, |
| 1155 | si_2ter_ind := CSN1_L, |
| 1156 | early_cm_ind := CSN1_L, |
| 1157 | sched_where := { |
| 1158 | presence := CSN1_L, |
| 1159 | where := omit |
| 1160 | }, |
| 1161 | gprs_ind := { |
| 1162 | presence := CSN1_L, |
| 1163 | ind := omit |
| 1164 | }, |
| 1165 | umts_early_cm_ind := CSN1_L, |
| 1166 | si2_quater_ind := { |
| 1167 | presence := CSN1_L, |
| 1168 | ind := omit |
| 1169 | }, |
| 1170 | iu_mode_ind := omit, |
| 1171 | si21_ind := { |
| 1172 | presence := CSN1_L, |
| 1173 | pos := omit |
| 1174 | } |
| 1175 | } |
| 1176 | |
| 1177 | template (value) SI4RestOctets ts_SI4RestOctets := { |
| 1178 | sel_params := { |
| 1179 | presence := CSN1_L, |
| 1180 | params := omit |
| 1181 | }, |
| 1182 | pwr_offset := { |
| 1183 | presence := CSN1_L, |
| 1184 | offset := omit |
| 1185 | }, |
| 1186 | gprs_ind := { |
| 1187 | presence := CSN1_L, |
| 1188 | ind := omit |
| 1189 | }, |
| 1190 | s_presence := CSN1_L, |
| 1191 | s := omit |
| 1192 | } |
| 1193 | |
| 1194 | |
Vadim Yanitskiy | 0df8c94 | 2020-05-02 16:23:35 +0700 | [diff] [blame] | 1195 | } with { encode "RAW"; variant "FIELDORDER(msb)" } |