blob: 9aa1217f051a88a3b0a8a39d06e3c9cd11ed3d05 [file] [log] [blame]
Vadim Yanitskiy0df8c942020-05-02 16:23:35 +07001/**
2 * GSM Rest Octets definitions as per 3GPP TS 44.018.
3 *
Vadim Yanitskiyd5f6bfe2020-07-01 03:13:13 +07004 * (C) 2020 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
Vadim Yanitskiy0df8c942020-05-02 16:23:35 +07005 * (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
14module GSM_RestOctets {
15
16import from General_Types all;
17import from Osmocom_Types all;
Pau Espin Pedrol28652d82021-02-09 20:20:17 +010018import from RLCMAC_CSN1_Types all;
Vadim Yanitskiy0df8c942020-05-02 16:23:35 +070019
Vadim Yanitskiyd5f6bfe2020-07-01 03:13:13 +070020/* 10.5.2.33b SI 2quater Rest Octets */
21type record SI2quaterRestOctets {
22 BIT1 ba_ind,
23 BIT1 ba_3g_ind,
24 BIT1 mp_change_mark,
25 uint4_t si2quater_index,
26 uint4_t si2quater_count,
27
28 /* Measurement Parameters Description */
29 MeasParamsDescOpt meas_params_desc,
30 /* GPRS specific parameters */
31 record {
32 GPRS_RealTimeDiffDescOpt rt_diff_desc,
33 GPRS_BSICDescOpt bsic_desc,
34 GPRS_ReportPrioDescOpt rep_prio_desc,
35 MeasParamsDescOpt meas_params_desc
36 } gprs,
37 /* NC Measurement Parameters Description */
38 NCMeasParamsOpt nc_meas_params,
39 /* SI2quater Extension Information */
40 SI2quaterExtInfoOpt ext_info,
41
42 /* 3G Neighbour Cell Description */
43 UTRAN_NeighDescOpt utran_neigh_desc,
44 /* 3G Measurement Parameters Description */
45 UTRAN_MeasParamsDescOpt utran_meas_params_desc,
46 /* GPRS 3G Measurement Parameters Description */
47 UTRAN_GPRSMeasParamsDescOpt utran_gprs_meas_params_desc,
48
49 /* SI2quater Rel-{5,6,7,8,9,10} Additions (Matrioshka!) */
50 SI2quaterAdditions rel_additions
51} with {
52 /* The TITAN's RAW encoder generates an octet-aligned octetstring,
53 * so we should make sure that unused bits contain proper padding. */
54 variant "PADDING(yes), PADDING_PATTERN('00101011'B)"
55};
Neels Hofmeyrad132f22020-07-08 02:20:16 +020056type record of SI2quaterRestOctets SI2quaterRestOctetsList;
Vadim Yanitskiyd5f6bfe2020-07-01 03:13:13 +070057
58/* Measurement Parameters Description */
59private type record MeasParamsDescOpt {
60 BIT1 presence, // 0/1
61 MeasParamsDesc desc optional
62} with {
63 variant (desc) "PRESENCE(presence = '1'B)"
64};
65
66private type record MeasParamsDesc {
67 BIT1 report_type,
68 BIT2 serving_band_reporting
69} with { variant "" };
70
71/* GPRS Real Time Difference Description (not implemented) */
72private type record GPRS_RealTimeDiffDescOpt {
73 BIT1 presence ('0'B), // 0/1
74 bitstring desc optional // TODO
75} with {
76 variant (desc) "PRESENCE(presence = '1'B)"
77};
78
79/* GPRS BSIC Description (not implemented) */
80private type record GPRS_BSICDescOpt {
81 BIT1 presence ('0'B), // 0/1
82 bitstring desc optional // TODO
83} with {
84 variant (desc) "PRESENCE(presence = '1'B)"
85};
86
87/* GPRS Report Priority Description (not implemented) */
88private type record GPRS_ReportPrioDescOpt {
89 BIT1 presence ('0'B), // 0/1
90 bitstring desc optional // TODO
91} with {
92 variant (desc) "PRESENCE(presence = '1'B)"
93};
94
95/* NC (Network Controlled?) Measurement Parameters */
96private type record NCMeasParams {
97 /* Network Control Order */
98 BIT2 nco,
99 BIT1 p_presence,
100 NCMeasPeriods p optional
101} with {
102 variant (p) "PRESENCE(p_presence = '1'B)"
103};
104
105/* NC Measurement Periods */
106private type record NCMeasParamsOpt {
107 BIT1 presence, // 0/1
108 NCMeasParams params optional
109} with {
110 variant (params) "PRESENCE(presence = '1'B)"
111};
112
113private type record NCMeasPeriods {
114 BIT3 non_drx_period,
115 BIT3 rep_period_i,
116 BIT3 rep_period_t
117} with { variant "" };
118
119/* SI2quater Extersion Information */
120private type record SI2quaterExtInfoOpt {
121 BIT1 presence, // 0/1
122 SI2quaterExtInfo info optional
123} with {
124 variant (info) "PRESENCE(presence = '1'B)"
125};
126
127private type record SI2quaterExtInfo {
128 uint8_t len,
129 CCNSupportDescOpt ccn_supp_desc optional,
130 bitstring padding /* Octet alignment? */
131} with {
132 variant (len) "LENGTHTO(ccn_supp_desc,padding) + 1"
133 variant (len) "UNIT(bits)"
134};
135
136/* CCN Support Description */
137private type record CCNSupportDescOpt {
138 BIT1 presence, // 0/1
139 CCNSupportDesc desc optional
140} with {
141 variant (desc) "PRESENCE(presence = '1'B)"
142};
143
144private type record CCNSupportDesc {
145 uint7_t nr_of_cells,
146 bitstring ccn_supported
147} with {
148 variant (nr_of_cells) "LENGTHTO(ccn_supported)"
149 variant (nr_of_cells) "UNIT(bits)"
150};
151
152/* 3G Neighbour Cell Description */
153private type record UTRAN_NeighDescOpt {
154 BIT1 presence, // 0/1
155 UTRAN_NeighDesc desc optional
156} with {
157 variant (desc) "PRESENCE(presence = '1'B)"
158};
159
160private type record UTRAN_NeighDesc {
161 BIT1 idx_start_3g_presence,
162 uint7_t idx_start_3g optional,
163 BIT1 abs_idx_start_emr_presence,
164 uint7_t abs_idx_start_emr optional,
165 UTRAN_FDDDescOpt fdd_desc,
166 UTRAN_TDDDescOpt tdd_desc
167} with {
168 variant (idx_start_3g) "PRESENCE(idx_start_3g_presence = '1'B)"
169 variant (abs_idx_start_emr) "PRESENCE(abs_idx_start_emr_presence = '1'B)"
170};
171
172/* UTRAN (3G) FDD/TDD Description (not implementaed).
173 *
174 * TODO: Repeated UTRAN FDD/TDD Neighbour Cells structure contains a variable length
175 * field, that needs to be computed using tables (see 9.1.54.1a and 9.1.54.1b) with
176 * magic numbers. This cannot be described uing TITAN's RAW codec attributes. */
177private type record UTRAN_FDDDescOpt {
178 BIT1 presence ('0'B), // 0/1
179 bitstring desc optional // TODO
180} with {
181 variant (desc) "PRESENCE(presence = '1'B)"
182};
183
184private type record UTRAN_TDDDescOpt {
185 BIT1 presence ('0'B), // 0/1
186 bitstring desc optional // TODO
187} with {
188 variant (desc) "PRESENCE(presence = '1'B)"
189};
190
191/* 3G Measurement Parameters Description (not implemented) */
192private type record UTRAN_MeasParamsDescOpt {
193 BIT1 presence ('0'B), // 0/1
194 bitstring desc optional // TODO
195} with {
196 variant (desc) "PRESENCE(presence = '1'B)"
197};
198
199/* GPRS 3G Measurement Parameters Description (not implemented) */
200private type record UTRAN_GPRSMeasParamsDescOpt {
201 BIT1 presence ('0'B), // 0/1
202 bitstring desc optional // TODO
203} with {
204 variant (desc) "PRESENCE(presence = '1'B)"
205};
206
207/* SI2quater Rel-{5,6,7,8,9,10} Additions */
208private type record SI2quaterAdditions {
209 BIT1 rel5_presence, // L/H
210 SI2quaterR5Additions rel5 optional
211} with {
212 variant (rel5_presence) "CSN.1 L/H"
213 variant (rel5) "PRESENCE(rel5_presence = '1'B)"
214};
215
216/* SI2quater Rel-5 and Rel-{6,7,8,9,10} Additions */
217private type record SI2quaterR5Additions {
218 UMTS_AddMeasParamsDescOpt umts_add_meas_params_desc,
219 UMTS_AddMeasParamsDesc2Opt umts_add_meas_params_desc2,
220 BIT1 rel6_presence, // L/H
221 SI2quaterR6Additions rel6 optional
222} with {
223 variant (rel6_presence) "CSN.1 L/H"
224 variant (rel6) "PRESENCE(rel6_presence = '1'B)"
225};
226
227/* 3G Additional Measurement Parameters Description */
228private type record UMTS_AddMeasParamsDescOpt {
229 BIT1 presence, // 0/1
230 UMTS_AddMeasParamsDesc desc optional
231} with {
232 variant (desc) "PRESENCE(presence = '1'B)"
233};
234
235private type record UMTS_AddMeasParamsDesc {
236 BIT3 fdd_qmin_offset,
237 BIT4 fdd_rscpmin
238} with { variant "" };
239
240/* 3G Additional Measurement Parameters Description 2 */
241private type record UMTS_AddMeasParamsDesc2Opt {
242 BIT1 presence, // 0/1
243 UMTS_AddMeasParamsDesc desc optional
244} with {
245 variant (desc) "PRESENCE(presence = '1'B)"
246};
247
248private type record UMTS_AddMeasParamsDesc2 {
249 /* FDD Reporting Threshold 2 */
250 BIT1 presence, // 0/1
251 uint6_t threshold optional
252} with {
253 variant (threshold) "PRESENCE(presence = '1'B)"
254};
255
256/* SI2quater Rel-6 and Rel-{7,8,9,10} Additions */
257private type record SI2quaterR6Additions {
258 BIT1 umts_ccn_active,
259 BIT1 rel7_presence, // L/H
260 SI2quaterR7Additions rel7 optional
261} with {
262 variant (rel7_presence) "CSN.1 L/H"
263 variant (rel7) "PRESENCE(rel7_presence = '1'B)"
264};
265
266/* SI2quater Rel-7 and Rel-{8,9,10} Additions */
267private type record SI2quaterR7Additions {
268 Rel7RepOffseThresholdOpt rep700,
269 Rel7RepOffseThresholdOpt rep810,
270 BIT1 rel8_presence, // L/H
271 SI2quaterR8Additions rel8 optional
272} with {
273 variant (rel8_presence) "CSN.1 L/H"
274 variant (rel8) "PRESENCE(rel8_presence = '1'B)"
275};
276
277/* Additions in Rel-7: Reporting Offset & Threshold */
278private type record Rel7RepOffseThresholdOpt {
279 BIT1 presence, // 0/1
280 Rel7RepOffseThreshold val optional
281} with {
282 variant (val) "PRESENCE(presence = '1'B)"
283};
284
285private type record Rel7RepOffseThreshold {
286 BIT3 offset,
287 BIT3 threshold
288} with { variant "" };
289
290/* SI2quater Rel-8 and Rel-{9,10} Additions */
291private type record SI2quaterR8Additions {
292 Rel8PrioEUTRANParamsDescOpt prio_eutran_params_desc,
293 Rel8UTRANCSGDescOpt utran_csg_desc,
294 Rel8EUTRANCSGDescOpt eutran_csg_desc
295 // TODO: Rel9 Additions (not implemented)
296} with { variant "" };
297
298/* Additions in Rel-8: Priority and E-UTRAN Parameters Description */
299private type record Rel8PrioEUTRANParamsDescOpt {
300 BIT1 presence, // 0/1
301 Rel8PrioEUTRANParamsDesc desc optional
302} with {
303 variant (desc) "PRESENCE(presence = '1'B)"
304};
305
306private type record Rel8PrioEUTRANParamsDesc {
307 ServingCellPrioParamsDescOpt sc_prio_params_desc,
308 UTRAN_PrioParamsDescOpt utran_prio_params_desc,
309 EUTRAN_ParamsDescOpt eutran_params_desc
310} with { variant "" };
311
312/* Serving Cell Priority Parameters Description */
313private type record ServingCellPrioParamsDescOpt {
314 BIT1 presence, // 0/1
315 ServingCellPrioParamsDesc desc optional
316} with {
317 variant (desc) "PRESENCE(presence = '1'B)"
318};
319
320private type record ServingCellPrioParamsDesc {
321 uint3_t geran_priority,
322 uint4_t thresh_priority_search,
323 uint4_t thresh_gsm_low,
324 uint2_t h_prio,
325 uint2_t t_reselection
326} with { variant "" };
327
328/* 3G Priority Parameters Description (not implemented) */
329private type record UTRAN_PrioParamsDescOpt {
330 BIT1 presence, // 0/1
331 bitstring desc optional // TODO
332} with {
333 variant (desc) "PRESENCE(presence = '1'B)"
334};
335
336/* E-UTRAN Parameters Description */
337private type record EUTRAN_ParamsDescOpt {
338 BIT1 presence, // 0/1
339 EUTRAN_ParamsDesc desc optional
340} with {
341 variant (desc) "PRESENCE(presence = '1'B)"
342};
343
344private type record EUTRAN_ParamsDesc {
345 BIT1 ccn_active,
346 BIT1 e_start,
347 BIT1 e_stop,
348
349 /* E-UTRAN Measurement Parameters Description */
350 EUTRAN_MeasParamsDescOpt meas_params_desc,
351 /* GPRS E-UTRAN Measurement Parameters Description */
352 EUTRAN_GPRSMeasParamsDescOpt gprs_meas_params_desc,
353
354 /* { 1 < Repeated E-UTRAN Neighbour Cells > } ** 0 */
Neels Hofmeyrc8655732020-07-08 00:55:18 +0200355 EUTRAN_RepeatedNeighbourCells repeated_neigh_cells optional,
356 BIT1 repeated_neigh_cells_term ('0'B),
Vadim Yanitskiyd5f6bfe2020-07-01 03:13:13 +0700357 /* { 1 < Repeated E-UTRAN Not Allowed Cells > } ** 0 */
Neels Hofmeyrc8655732020-07-08 00:55:18 +0200358 EUTRAN_RepeatedNotAllowedCells repeated_not_allowed_cells optional,
359 BIT1 repeated_not_allowed_cells_term ('0'B),
Vadim Yanitskiyd5f6bfe2020-07-01 03:13:13 +0700360 /* { 1 < Repeated E-UTRAN PCID to TA mapping > } ** 0 */
361 EUTRAN_PCID2TAMaps pcid2ta_map_list optional,
362 BIT1 pcid2ta_map_list_term ('0'B)
363} with { variant "" };
364
365/* E-UTRAN Measurement Parameters Description (not implemented) */
366private type record EUTRAN_MeasParamsDescOpt {
367 BIT1 presence, // 0/1
368 bitstring desc optional // TODO
369} with {
370 variant (desc) "PRESENCE(presence = '1'B)"
371};
372
373/* GPRS E-UTRAN Measurement Parameters Description (not implemented) */
374private type record EUTRAN_GPRSMeasParamsDescOpt {
375 BIT1 presence, // 0/1
376 bitstring desc optional // TODO
377} with {
378 variant (desc) "PRESENCE(presence = '1'B)"
379};
380
Neels Hofmeyrc8655732020-07-08 00:55:18 +0200381/* Repeated E-UTRAN Neighbour Cells */
382private type record of EUTRAN_NeighbourCells EUTRAN_RepeatedNeighbourCells;
Vadim Yanitskiyeacec8a2020-07-03 06:44:40 +0700383type record EUTRAN_NeighbourCells {
Vadim Yanitskiyd5f6bfe2020-07-01 03:13:13 +0700384 BIT1 item_ind ('1'B),
385 /* { 1 < Repeated E-UTRAN Neighbour Cells > } ** 0 */
386 EUTRAN_CellDescs cell_desc_list optional,
387 BIT1 cell_desc_list_term ('0'B),
388 BIT1 prio_presence, // 0/1
389 uint3_t prio optional,
390 uint5_t thresh_high,
391 BIT1 thresh_low_presence, // 0/1
392 uint5_t thresh_low optional,
393 BIT1 qrxlevmin_presence, // 0/1
394 uint5_t qrxlevmin optional
395} with {
396 variant "PRESENCE(item_ind = '1'B)"
397 variant (prio) "PRESENCE(prio_presence = '1'B)"
398 variant (thresh_low) "PRESENCE(thresh_low_presence = '1'B)"
399 variant (qrxlevmin) "PRESENCE(qrxlevmin_presence = '1'B)"
400};
401
402/* Repeated E-UTRAN Cell Description (E-ARFCN & Measurement Bandwidth) List */
Vadim Yanitskiyeacec8a2020-07-03 06:44:40 +0700403type record of EUTRAN_CellDesc EUTRAN_CellDescs;
404type record EUTRAN_CellDesc {
Vadim Yanitskiyd5f6bfe2020-07-01 03:13:13 +0700405 BIT1 item_ind ('1'B),
406 uint16_t e_arfcn,
407 BIT1 meas_bw_presence, // 0/1
408 uint3_t meas_bw optional
409} with {
410 variant "PRESENCE(item_ind = '1'B)"
411 variant (meas_bw) "PRESENCE(meas_bw_presence = '1'B)"
412};
413
Neels Hofmeyrc8655732020-07-08 00:55:18 +0200414/* Repeated E-UTRAN Not Allowed Cells */
415private type record of EUTRAN_NotAllowedCells EUTRAN_RepeatedNotAllowedCells;
416private type record EUTRAN_NotAllowedCells {
Vadim Yanitskiyd5f6bfe2020-07-01 03:13:13 +0700417 BIT1 item_ind ('1'B),
418 /* FIXME: Not Allowed Cells : < PCID Group IE > (not implemented) */
419 BIT1 pcid_group_presence ('0'B),
420 /* { 1 < Repeated E-UTRAN_FREQUENCY_INDEX > } ** 0 */
421 EUTRAN_FreqIndexes freq_idx_list optional,
422 BIT1 freq_idx_list_term ('0'B)
423} with {
424 variant "PRESENCE(item_ind = '1'B)"
425};
426
427/* Repeated E-UTRAN PCID to TA mapping List */
428private type record of EUTRAN_PCID2TAMap EUTRAN_PCID2TAMaps;
429private type record EUTRAN_PCID2TAMap {
430 BIT1 item_ind ('1'B),
431 /* FIXME: PCID to TA mapping : < PCID Group IE > (not implemented) */
432 BIT1 pcid_group_presence ('0'B),
433 /* { 1 < Repeated E-UTRAN_FREQUENCY_INDEX > } ** 0 */
434 EUTRAN_FreqIndexes freq_idx_list optional,
435 BIT1 freq_idx_list_term ('0'B)
436} with {
437 variant "PRESENCE(item_ind = '1'B)"
438};
439
440/* Repeated E-UTRAN Frequency Index List */
441private type record of EUTRAN_FreqIndex EUTRAN_FreqIndexes;
442private type record EUTRAN_FreqIndex {
443 BIT1 item_ind ('1'B),
444 uint3_t idx
445} with {
446 variant "PRESENCE(item_ind = '1'B)"
447};
448
449/* Additions in Rel-8: 3G CSG Description (not implemented) */
450private type record Rel8UTRANCSGDescOpt {
451 BIT1 presence, // 0/1
452 bitstring desc optional // TODO
453} with {
454 variant (desc) "PRESENCE(presence = '1'B)"
455};
456
457/* Additions in Rel-8: E-UTRAN CSG Description (not implemented) */
458private type record Rel8EUTRANCSGDescOpt {
459 BIT1 presence, // 0/1
460 bitstring desc optional // TODO
461} with {
462 variant (desc) "PRESENCE(presence = '1'B)"
463};
464
465
466/* Basic any-/omit-matching templates. To be inherited by other templates (see below).
467 * The point is that you cannot fit everything into 20 octets, so usually several kinds
468 * of SI2quater are being sub-multiplexed by the BTS. This is achieved using both
469 * 'si2quater_index' and 'si2quater_count' fields. */
470template SI2quaterRestOctets tra_SI2quaterRestOctets_base := {
471 ba_ind := ?,
472 ba_3g_ind := ?,
473 mp_change_mark := ?,
474 si2quater_index := ?,
475 si2quater_count := ?,
476
477 meas_params_desc := { presence := ?, desc := * },
478 gprs := {
479 rt_diff_desc := { presence := ?, desc := * },
480 bsic_desc := { presence := ?, desc := * },
481 rep_prio_desc := { presence := ?, desc := * },
482 meas_params_desc := { presence := ?, desc := * }
483 },
484 nc_meas_params := { presence := ?, params := * },
485 ext_info := { presence := ?, info := * },
486
487 utran_neigh_desc := { presence := ?, desc := * },
488 utran_meas_params_desc := { presence := ?, desc := * },
489 utran_gprs_meas_params_desc := { presence := ?, desc := * },
490
491 rel_additions := ?
492};
493
494template SI2quaterRestOctets tro_SI2quaterRestOctets_base := {
495 ba_ind := ?,
496 ba_3g_ind := ?,
497 mp_change_mark := ?,
498 si2quater_index := ?,
499 si2quater_count := ?,
500
501 meas_params_desc := { presence := '0'B, desc := omit },
502 gprs := {
503 rt_diff_desc := { presence := '0'B, desc := omit },
504 bsic_desc := { presence := '0'B, desc := omit },
505 rep_prio_desc := { presence := '0'B, desc := omit },
506 meas_params_desc := { presence := '0'B, desc := omit }
507 },
508 nc_meas_params := { presence := '0'B, params := omit },
509 ext_info := { presence := '0'B, info := omit },
510
511 utran_neigh_desc := { presence := '0'B, desc := omit },
512 utran_meas_params_desc := { presence := '0'B, desc := omit },
513 utran_gprs_meas_params_desc := { presence := '0'B, desc := omit },
514
515 rel_additions := { rel5_presence := CSN1_L, rel5 := omit }
516};
517
Vadim Yanitskiyeacec8a2020-07-03 06:44:40 +0700518template SI2quaterRestOctets tro_SI2quaterRestOctets_rel8_EUTRAN
519modifies tro_SI2quaterRestOctets_base
520:= {
521 ba_ind := ?,
522 ba_3g_ind := ?,
523 mp_change_mark := ?,
524 si2quater_index := ?,
525 si2quater_count := ?,
526
527 rel_additions := {
528 rel5_presence := CSN1_H,
529 rel5 := {
530 umts_add_meas_params_desc := { presence := '0'B, desc := omit },
531 umts_add_meas_params_desc2 := { presence := '0'B, desc := omit },
532 rel6_presence := CSN1_H,
533 rel6 := {
534 umts_ccn_active := '0'B,
535 rel7_presence := CSN1_H,
536 rel7 := {
537 rep700 := { presence := '0'B, val := omit },
538 rep810 := { presence := '0'B, val := omit },
539 rel8_presence := CSN1_H,
540 rel8 := {
541 prio_eutran_params_desc := {
542 presence := '1'B,
543 desc := {
544 sc_prio_params_desc := { presence := '0'B, desc := omit },
545 utran_prio_params_desc := { presence := '0'B, desc := omit },
546 eutran_params_desc := {
547 presence := '1'B,
548 desc := {
549 ccn_active := ?,
550 e_start := ?,
551 e_stop := ?,
552 meas_params_desc := { presence := '0'B, desc := omit },
553 gprs_meas_params_desc := { presence := '0'B, desc := omit },
554 repeated_neigh_cells := *,
555 repeated_neigh_cells_term := '0'B,
556 repeated_not_allowed_cells := omit,
557 repeated_not_allowed_cells_term := '0'B,
558 pcid2ta_map_list := omit,
559 pcid2ta_map_list_term := '0'B
560 }
561 }
562 }
563 },
564 utran_csg_desc := { presence := '0'B, desc := omit },
565 eutran_csg_desc := { presence := '0'B, desc := omit }
566 }
567 }
568 }
569 }
570 }
571};
572
573template EUTRAN_CellDesc tr_EUTRAN_CellDesc(template (present) uint16_t e_arfcn := ?,
574 template (present) BIT1 meas_bw_presence := ?,
575 template uint3_t meas_bw := *)
576:= {
577 item_ind := '1'B,
578 e_arfcn := e_arfcn,
579 meas_bw_presence := meas_bw_presence,
580 meas_bw := meas_bw
581}
582
583/* Defaults correspond to osmo-bsc cfg:
584 * si2quater neighbor-list add earfcn 111 thresh-hi 20 thresh-lo 10 prio 3 qrxlv 22 meas 3
585 */
586template EUTRAN_NeighbourCells tr_EUTRAN_NeighbourCells(template (present) EUTRAN_CellDescs cell_desc_list := { tr_EUTRAN_CellDesc },
587 template (present) BIT1 prio_presence := ?,
588 template uint3_t prio := *,
589 template (present) uint5_t thresh_high := ?,
590 template (present) BIT1 thresh_low_presence := ?,
591 template uint5_t thresh_low := *,
592 template (present) BIT1 qrxlevmin_presence := ?,
593 template uint5_t qrxlevmin := *)
594:= {
595 item_ind := '1'B,
596 cell_desc_list := cell_desc_list,
597 cell_desc_list_term := '0'B,
598 prio_presence := prio_presence,
599 prio := prio,
600 thresh_high := thresh_high,
601 thresh_low_presence := thresh_low_presence,
602 thresh_low := thresh_low,
603 qrxlevmin_presence := qrxlevmin_presence,
604 qrxlevmin := qrxlevmin
605};
606
607template SI2quaterRestOctets tr_SI2quaterRestOctets_EUTRAN(
608 template integer index := 0,
609 template integer count := 0,
610 template EUTRAN_RepeatedNeighbourCells repeated_neigh_cells := { tr_EUTRAN_NeighbourCells }
611) modifies tro_SI2quaterRestOctets_rel8_EUTRAN := {
612 si2quater_index := index,
613 si2quater_count := count,
614 rel_additions := {
615 rel5 := {
616 rel6 := {
617 rel7 := {
618 rel8 := {
619 prio_eutran_params_desc := {
620 desc := {
621 sc_prio_params_desc := {
622 presence := '1'B,
623 desc := {
624 geran_priority := 0,
625 thresh_priority_search := 0,
626 thresh_gsm_low := 0,
627 h_prio := 0,
628 t_reselection := 0
629 }
630 },
631 eutran_params_desc := {
632 desc := {
633 ccn_active := '0'B,
634 e_start := '1'B,
635 e_stop := '1'B,
636 repeated_neigh_cells := repeated_neigh_cells
637 }
638 }
639 }
640 }
641 }
642 }
643 }
644 }
645 }
646};
647
Vadim Yanitskiyd5f6bfe2020-07-01 03:13:13 +0700648
Vadim Yanitskiy0df8c942020-05-02 16:23:35 +0700649/* 10.5.2.34 SI 3 Rest Octets */
650type record SI3RestOctets {
651 SelectionParamsOpt sel_params,
652 PowerOffsetOpt pwr_offset,
653 BIT1 si_2ter_ind,
654 BIT1 early_cm_ind,
655 SchedIfAndWhere sched_where,
656 GPRSIndicatorOpt gprs_ind,
657 BIT1 umts_early_cm_ind,
658 SI2quaterIndicatorOpt si2_quater_ind,
659 BIT1 iu_mode_ind ('1'B) optional,
660 SI21IndicatorOpt si21_ind optional
661 /* ... spare padding ... */
662} with {
663 variant (si_2ter_ind) "CSN.1 L/H"
664 variant (early_cm_ind) "CSN.1 L/H"
665 variant (umts_early_cm_ind) "CSN.1 L/H"
666
667 /* If Iu mode is not supported in the cell, the Iu Indicator is not sent
668 * within this cell. Iu Indicator is included if and only if GPRS is
669 * not supported, and Iu mode is supported in the cell. */
670 variant (iu_mode_ind) "PRESENCE(gprs_ind.presence = '0'B)"
671 /* SI21 field is only present if 'WHERE' information is not present. */
672 variant (si21_ind) "PRESENCE(sched_where.presence = '0'B)"
Vadim Yanitskiy135b45e2020-05-04 19:54:02 +0700673
674 /* The TITAN's RAW encoder generates an octet-aligned octetstring,
675 * so we should make sure that unused bits contain proper padding. */
676 variant "PADDING(yes), PADDING_PATTERN('00101011'B)"
Vadim Yanitskiy0df8c942020-05-02 16:23:35 +0700677};
678
Vadim Yanitskiy72add6d2020-05-03 21:46:42 +0700679/* 10.5.2.35 SI 4 Rest Octets (O & S) */
680type record SI4RestOctets {
681 SelectionParamsOpt sel_params,
682 PowerOffsetOpt pwr_offset,
683 GPRSIndicatorOpt gprs_ind,
684 BIT1 s_presence, // L/H
685 /* TODO: optional "Rest Octets S" part */
686 bitstring s optional
687} with {
688 variant (s_presence) "CSN.1 L/H"
689 variant (s) "PRESENCE(s_presence = '1'B)"
Vadim Yanitskiy135b45e2020-05-04 19:54:02 +0700690
691 /* The TITAN's RAW encoder generates an octet-aligned octetstring,
692 * so we should make sure that unused bits contain proper padding. */
693 variant "PADDING(yes), PADDING_PATTERN('00101011'B)"
Vadim Yanitskiy72add6d2020-05-03 21:46:42 +0700694};
695
Pau Espin Pedrol28652d82021-02-09 20:20:17 +0100696/* 10.5.2.37b SI 13 Rest Octets (O & S) */
697type record SI13RestOctets {
698 BIT1 presence, // L/H
699 uint3_t bcch_change_mark,
700 BIT4 si_change_field,
701 BIT1 presence2,
702 BIT2 si13_change_mark optional,
703 GprsMobileAllocation gprs_ma optional,
704 BIT1 zero ('0'B), /* PBCCH not present in cell */
705 uint8_t rac,
706 BIT1 spgc_ccch_sup,
707 BIT3 priority_access_thr,
708 BIT2 network_control_order,
709 GprsCellOptions gprs_cell_opts,
710 GprsPowerControlParameters gprs_pwr_ctrl_params
711 /* TODO: Additions in release 99 */
712} with {
713
714 variant (presence) "CSN.1 L/H"
715 /* TODO: for all fields after presencte: variant (<field>) "PRESENCE(presence = '1'B)" */
716 variant (si13_change_mark) "PRESENCE(presence2 = '1'B)"
717 variant (gprs_ma) "PRESENCE(presence2 = '1'B)"
718
719 /* The TITAN's RAW encoder generates an octet-aligned octetstring,
720 * so we should make sure that unused bits contain proper padding. */
721 variant "PADDING(yes), PADDING_PATTERN('00101011'B)"
722};
723
Vadim Yanitskiy0df8c942020-05-02 16:23:35 +0700724/* Selection Parameters */
725type record SelectionParams {
726 boolean cbq,
727 uint6_t cr_offset,
728 uint3_t temp_offset,
729 uint5_t penalty_time
730} with {
731 variant (cbq) "FIELDLENGTH(1)"
732};
733
734/* Optional Selection Parameters: L | H < Selection Parameters > */
735type record SelectionParamsOpt {
736 BIT1 presence, // L/H
737 SelectionParams params optional
738} with {
739 variant (presence) "CSN.1 L/H"
740 variant (params) "PRESENCE(presence = '1'B)"
741};
742
743/* Optional Power Offset: L | H < Power Offset bit(2) > */
744type record PowerOffsetOpt {
745 BIT1 presence, // L/H
746 uint2_t offset optional
747} with {
748 variant (presence) "CSN.1 L/H"
749 variant (offset) "PRESENCE(presence = '1'B)"
750};
751
752/* Scheduling if and where: L | H < WHERE bit(3) > */
753type record SchedIfAndWhere {
754 BIT1 presence, // L/H
755 uint3_t where optional
756} with {
757 variant (presence) "CSN.1 L/H"
758 variant (where) "PRESENCE(presence = '1'B)"
759};
760
761type record GPRSIndicator {
762 uint3_t ra_colour,
763 BIT1 si13_pos
764} with { variant "" };
765
766/* Optional GPRS Indicator: L | H < GPRS Indicator > */
767type record GPRSIndicatorOpt {
768 BIT1 presence, // L/H
769 GPRSIndicator ind optional
770} with {
771 variant (presence) "CSN.1 L/H"
772 variant (ind) "PRESENCE(presence = '1'B)"
773};
774
775/* Optional SI2quater Indicator: L | H < SI2quater Indicator > */
776type record SI2quaterIndicatorOpt {
777 BIT1 presence, // L/H
778 BIT1 ind optional
779} with {
780 variant (presence) "CSN.1 L/H"
781 variant (ind) "PRESENCE(presence = '1'B)"
782};
783
784/* Optional SI21 Indicator: L | H < SI21 Position > */
785type record SI21IndicatorOpt {
786 BIT1 presence, // L/H
787 BIT1 pos optional
788} with {
789 variant (presence) "CSN.1 L/H"
790 variant (pos) "PRESENCE(presence = '1'B)"
791};
792
Vadim Yanitskiyd5f6bfe2020-07-01 03:13:13 +0700793
794external function enc_SI2quaterRestOctets(in SI2quaterRestOctets ro) return octetstring
795 with { extension "prototype(convert) encode(RAW)" };
796external function dec_SI2quaterRestOctets(in octetstring stream) return SI2quaterRestOctets
797 with { extension "prototype(convert) decode(RAW)" };
798
Vadim Yanitskiy0df8c942020-05-02 16:23:35 +0700799external function enc_SI3RestOctets(in SI3RestOctets ro) return octetstring
800 with { extension "prototype(convert) encode(RAW)" };
801external function dec_SI3RestOctets(in octetstring stream) return SI3RestOctets
802 with { extension "prototype(convert) decode(RAW)" };
803
Vadim Yanitskiy72add6d2020-05-03 21:46:42 +0700804external function enc_SI4RestOctets(in SI4RestOctets ro) return octetstring
805 with { extension "prototype(convert) encode(RAW)" };
806external function dec_SI4RestOctets(in octetstring stream) return SI4RestOctets
807 with { extension "prototype(convert) decode(RAW)" };
808
Pau Espin Pedrol28652d82021-02-09 20:20:17 +0100809external function enc_SI13RestOctets(in SI13RestOctets ro) return octetstring
810 with { extension "prototype(convert) encode(RAW)" };
811external function dec_SI13RestOctets(in octetstring stream) return SI13RestOctets
812 with { extension "prototype(convert) decode(RAW)" };
813
Vadim Yanitskiy0df8c942020-05-02 16:23:35 +0700814
Vadim Yanitskiy12cf3d92020-05-05 00:19:50 +0700815/* Basic templates to be extended in place */
816template (value) SI3RestOctets ts_SI3RestOctets := {
817 sel_params := {
818 presence := CSN1_L,
819 params := omit
820 },
821 pwr_offset := {
822 presence := CSN1_L,
823 offset := omit
824 },
825 si_2ter_ind := CSN1_L,
826 early_cm_ind := CSN1_L,
827 sched_where := {
828 presence := CSN1_L,
829 where := omit
830 },
831 gprs_ind := {
832 presence := CSN1_L,
833 ind := omit
834 },
835 umts_early_cm_ind := CSN1_L,
836 si2_quater_ind := {
837 presence := CSN1_L,
838 ind := omit
839 },
840 iu_mode_ind := omit,
841 si21_ind := {
842 presence := CSN1_L,
843 pos := omit
844 }
845}
846
847template (value) SI4RestOctets ts_SI4RestOctets := {
848 sel_params := {
849 presence := CSN1_L,
850 params := omit
851 },
852 pwr_offset := {
853 presence := CSN1_L,
854 offset := omit
855 },
856 gprs_ind := {
857 presence := CSN1_L,
858 ind := omit
859 },
860 s_presence := CSN1_L,
861 s := omit
862}
863
864
Vadim Yanitskiy0df8c942020-05-02 16:23:35 +0700865} with { encode "RAW"; variant "FIELDORDER(msb)" }