blob: 918cbff5370851646197f69210d4b1ef10da0e87 [file] [log] [blame]
Harald Welte484160b2017-07-28 13:30:24 +02001/* GPRS RLC/MAC Control Messages as per 3GPP TS 44.060 manually transcribed from the CSN.1 syntax, as no CSN.1
2 * tool for Eclipse TITAN could be found. Implements only the minimum necessary messages for Osmocom teseting
Harald Welte34b5a952019-05-27 11:54:11 +02003 * purposes. */
4
5/* (C) 2017-2018 Harald Welte <laforge@gnumonks.org>
6 * contributions by sysmocom - s.f.m.c. GmbH
7 * All rights reserved.
8 *
9 * Released under the terms of GNU General Public License, Version 2 or
10 * (at your option) any later version.
11 *
12 * SPDX-License-Identifier: GPL-2.0-or-later
13 */
14
Harald Welte484160b2017-07-28 13:30:24 +020015module RLCMAC_CSN1_Types {
16 import from General_Types all;
17 import from Osmocom_Types all;
18 import from GSM_Types all;
19
20 /* TS 44.060 11.2.0.1 */
21 type enumerated RlcmacDlCtrlMsgType {
22 PACKET_ACCESS_REJECT ('100001'B),
23 PACKET_CELL_CHANGE_ORDER ('000001'B),
24 PACKET_DL_ASSIGNMENT ('000010'B),
25 PACKET_MEASUREMENT_ORDER ('000011'B),
26 PACKET_PAGING_REQUEST ('100010'B),
27 PACKET_PDCH_RELEASE ('100011'B),
28 PACKET_POLLING_REQUEST ('000100'B),
29 /* TODO */
30 PACKET_TBF_RELEASE ('001000'B),
31 PACKET_UL_ACK_NACK ('001001'B),
32 PACKET_UL_ASSIGNMENT ('001010'B),
33 PACKET_DL_DUMMY_CTRL ('100101'B)
34 } with { variant "FIELDLENGTH(6)" };
35
36 /* TS 44.060 11.2.0.2 */
37 type enumerated RlcmacUlCtrlMsgType {
38 PACKET_CELL_CHANGE_FEATURE ('000000'B),
39 PACKET_CONTROL_ACK ('000001'B),
40 PACKET_DL_ACK_NACK ('000010'B),
41 PACKET_UL_DUMMY_CTRL ('000011'B),
42 PACKET_MEASUREMENT_REPORT ('000100'B),
43 PACKET_ENH_MEASUREMENT_REPORT ('001010'B),
44 PACKET_RESOURCE_REQUEST ('000101'B),
45 PACKET_MOBILE_TBF_STATUS ('000110'B),
46 PACKET_PSI_STATUS ('000111'B),
47 PACKET_EGPRS_DL_ACK_NACK ('001000'B),
48 PACKET_PAUSE ('001001'B),
49 ADDITIONAL_MS_RA_CAPABILITIES ('001011'B),
50 PACKET_CELL_CANGE_NOTIFICATION ('001100'B),
51 PACKET_SI_STATUS ('001101'B),
52 PACKET_CS_REQUEST ('001110'B),
53 MBMS_SERVICE_REQUEST ('001111'B),
54 MBMS_DL_ACK_NACK ('010000'B)
55 } with { variant "FIELDLENGTH(6)" };
56
57 type record NullGlobalTfi {
58 BIT1 presence ('0'B),
59 GlobalTfi global_tfi
60 } with { variant "" };
61
62 type record TenTlli {
63 BIT2 presence ('10'B),
64 GprsTlli tlli
Harald Welteacc93ab2018-03-02 21:39:09 +010065 } with { variant ""
66 variant (tlli) "BYTEORDER(first)"
67 };
Harald Welte484160b2017-07-28 13:30:24 +020068
69 type union GlobalTfiOrTlli {
70 NullGlobalTfi global_tfi,
71 TenTlli tlli
72 };
73
74 /* 11.2.7 Packet Downlink Assignment */
75 type record PacketDlAssignment {
76 PageMode page_mode,
77 BIT1 pres1,
78 PersistenceLevels persistence_levels optional,
79 GlobalTfiOrTlli tfi_or_tlli
80 /* TODO */
81 } with {
82 variant (persistence_levels) "PRESENCE(pres1 = '1'B)"
83 };
84
85 /* 11.2.29 Packet Uplink Assignment */
86 type record O_Gtfi {
87 BIT1 presence ('0'B),
88 GlobalTfi global_tfi
89 } with { variant "" };
90 type record IO_Tlli {
91 BIT2 presence ('10'B),
92 GprsTlli tlli
Harald Welteacc93ab2018-03-02 21:39:09 +010093 } with { variant ""
94 variant (tlli) "BYTEORDER(first)"
95 };
Harald Welte484160b2017-07-28 13:30:24 +020096 type record IIO_Tqi {
97 BIT3 presence ('110'B),
98 PacketRequestReference pkt_req_ref
99 } with { variant "" };
100 type union PktUlAssUnion {
101 O_Gtfi global_tfi,
102 IO_Tlli tlli,
103 IIO_Tqi tqi
104 } with {
105 variant "TAG(global_tfi, presence = '0'B;
106 tlli, presence = '10'B;
107 tqi, presence = '110'B)"
108 };
109 type record DynamicAllocation {
110 BIT1 extd_dyn_alloc,
111 BIT1 p0_present,
112 uint4_t p0 optional,
113 BIT1 pr_mode optional,
114 BIT1 usf_granularity,
115 BIT1 ul_tfi_ass_present,
116 uint5_t ul_tfi_assignment optional,
117 BIT1 reserved ('0'B),
118 BIT1 tbf_starting_time_present,
119 StartingFnDesc tbf_starting_time optional,
120 TsAllocationUnion ts_allocation
121 } with {
122 variant (p0) "PRESENCE(p0_present = '1'B)"
123 variant (pr_mode) "PRESENCE(p0_present = '1'B)"
124 variant (ul_tfi_assignment) "PRESENCE(ul_tfi_ass_present = '1'B)"
125 variant (tbf_starting_time) "PRESENCE(tbf_starting_time_present = '1'B)"
126 };
127 type record TsAllocationTs {
128 BIT1 presence,
129 uint3_t usf_tn optional
130 } with {
131 variant (usf_tn) "PRESENCE(presence = '1'B)"
132 };
133 type record length(8) of TsAllocationTs TsAllocationTsArr;
134 type record TnGamma {
135 BIT1 presence,
136 uint3_t usf_tn optional,
137 uint5_t gamma_tn optional
138 } with {
139 variant (usf_tn) "PRESENCE(presence = '1'B)"
140 variant (gamma_tn) "PRESENCE(presence = '1'B)"
141 };
142 type record length(8) of TnGamma TnGamma8;
143 type record TsAllocationPwr {
144 uint4_t alpha,
145 TnGamma tn_gamma
146 } with { variant "" };
147 type record TsAllocationUnion {
148 BIT1 presence,
149 TsAllocationTsArr ts optional,
150 TsAllocationPwr ts_with_pwr optional
151 } with {
152 variant (ts) "PRESENCE(presence = '0'B)"
153 variant (ts_with_pwr) "PRESENCE(presence = '1'B)"
154 };
155 type record SingleBlockAllocation {
156 uint3_t timeslot_nr,
157 BIT1 alpha_present,
158 uint4_t alpha optional,
159 uint5_t gamma_tn,
160 BIT1 p0_present,
161 uint4_t p0 optional,
162 BIT1 reserved ('0'B) optional,
163 BIT1 pr_mode optional,
164 StartingFnDesc tbf_starting_time
165 } with {
166 variant (alpha) "PRESENCE(alpha_present = '1'B)"
167 variant (p0) "PRESENCE(p0_present = '1'B)"
168 variant (reserved) "PRESENCE(p0_present = '1'B)"
169 variant (pr_mode) "PRESENCE(p0_present = '1'B)"
170 };
171 type record PktUlAssGprs {
172 ChCodingCommand ch_coding_cmd,
173 BIT1 tlli_block_chan_coding,
174 PacketTimingAdvance pkt_ta,
175 BIT1 freq_par_present,
176 FrequencyParameters freq_par optional,
177 BIT2 alloc_present,
178 DynamicAllocation dyn_block_alloc optional,
179 SingleBlockAllocation sgl_block_alloc optional
180 } with {
181 variant (freq_par) "PRESENCE(freq_par_present = '1'B)"
182 variant (dyn_block_alloc) "PRESENCE(alloc_present = '01'B)"
183 variant (sgl_block_alloc) "PRESENCE(alloc_present = '10'B)"
184 };
185 type record PacketUlAssignment {
186 PageMode page_mode,
187 BIT1 persistence_levels_present,
188 PersistenceLevels persistence_levels optional,
189 PktUlAssUnion identity,
190 BIT1 is_egprs, /* msg escape */
191 PktUlAssGprs gprs optional
192 } with {
193 variant (persistence_levels) "PRESENCE(persistence_levels_present = '1'B)"
194 variant (gprs) "PRESENCE(is_egprs = '0'B)"
195 };
196
197 /* 11.2.10 Packet Paging Request */
Stefan Sperling59c15d62018-10-10 11:09:25 +0200198 type record MobileIdentityLV_Paging {
199 /* Note that the size of 'len' differs from that of the Mobile Identify IE
200 * as defined in 3GPP TS 24.008 10.5.1.4 "Mobile Identity"; Paging Requests
201 * use only 4 bit to encode the length of a mobile identity, whereas the IE
202 * uses a byte. */
Harald Welte484160b2017-07-28 13:30:24 +0200203 uint4_t len,
204 octetstring mobile_id
205 } with { variant (len) "LENGTHTO(mobile_id)" };
206 type record PageInfoPs {
207 BIT1 presence ('0'B),
208 BIT1 ptmsi_or_mobile_id,
209 GsmTmsi ptmsi optional,
Stefan Sperling59c15d62018-10-10 11:09:25 +0200210 MobileIdentityLV_Paging mobile_identity optional
Harald Welte484160b2017-07-28 13:30:24 +0200211 } with {
212 variant (ptmsi) "PRESENCE(ptmsi_or_mobile_id = '0'B)"
213 variant (mobile_identity) "PRESENCE(ptmsi_or_mobile_id = '1'B)"
214 };
215 type record PageInfoCs {
216 BIT1 presence ('1'B),
217 BIT1 tmsi_or_mobile_id,
218 GsmTmsi tmsi optional,
Stefan Sperling59c15d62018-10-10 11:09:25 +0200219 MobileIdentityLV_Paging mobile_identity optional,
Harald Welte484160b2017-07-28 13:30:24 +0200220 ChannelNeeded chan_needed,
221 BIT1 emlpp_prio_present,
222 uint3_t emlpp_prio optional
223 } with {
224 variant (tmsi) "PRESENCE(tmsi_or_mobile_id = '0'B)"
225 variant (mobile_identity) "PRESENCE(tmsi_or_mobile_id = '1'B)"
226 variant (emlpp_prio) "PRESENCE(emlpp_prio_present = '1'B)"
227 };
228 type union PageInfo {
229 PageInfoPs ps,
230 PageInfoCs cs
231 };
232 type record PacketPagingReq {
233 PageMode page_mode,
234 BIT1 persistence_levels_present,
235 PersistenceLevels persistence_levels optional,
236 BIT1 nln_present,
237 uint2_t nln optional
238 /* TODO: Repeated PageInfo */
239 } with {
240 variant (persistence_levels) "PRESENCE(persistence_levels_present = '1'B)"
241 variant (nln) "PRESENCE(nln_present = '1'B)"
242 };
243
244 /* 11.2.28 Uplink Ack/Nack */
245 type enumerated ChCodingCommand {
246 CH_CODING_CS1 ('00'B),
247 CH_CODING_CS2 ('01'B),
248 CH_CODING_CS3 ('10'B),
249 CH_CODING_CS4 ('11'B)
250 } with { variant "FIELDLENGTH(2)" };
251 type record UlAckNackGprs {
252 ChCodingCommand ch_coding_cmd,
253 AckNackDescription ack_nack_desc,
254 BIT1 cont_res_tlli_present,
255 GprsTlli cont_res_tlli optional,
256 BIT1 pkt_ta_present,
257 PacketTimingAdvance pkt_ta optional,
258 BIT1 pwr_ctrl_present,
259 PowerControlParameters pwr_ctrl optional
260 /* TODO: Extension Bits, Rel5 ,... */
261 } with {
262 variant (cont_res_tlli) "PRESENCE(cont_res_tlli_present = '1'B)"
263 variant (pkt_ta) "PRESENCE(pkt_ta_present = '1'B)"
264 variant (pwr_ctrl) "PRESENCE(pwr_ctrl_present = '1'B)"
Harald Welteacc93ab2018-03-02 21:39:09 +0100265 variant (cont_res_tlli) "BYTEORDER(first)"
Harald Welte484160b2017-07-28 13:30:24 +0200266 };
267 type record PacketUlAckNack {
268 PageMode page_mode,
269 BIT2 msg_excape ('00'B),
270 uint5_t uplink_tfi,
271 BIT1 is_egprs ('0'B), /* msg escape */
272 UlAckNackGprs gprs optional
273 /* TODO: EGPRS */
274 } with { variant (gprs) "PRESENCE(is_egprs = '0'B)" };
275
276 /* 11.2.8 Packet Downlink Dummy Control Block */
277 type record PacketDlDummy {
278 PageMode page_mode,
279 BIT1 persistence_levels_present,
280 PersistenceLevels persistence_levels optional
281 } with {
282 variant (persistence_levels) "PRESENCE(persistence_levels_present = '1'B)"
283 };
284
285 /* 11.2.0.1 */
286 type union RlcmacDlCtrlUnion {
287 PacketDlAssignment dl_assignment,
288 PacketUlAssignment ul_assignment,
289 PacketPagingReq paging,
290 PacketUlAckNack ul_ack_nack,
Harald Welte422f0722017-08-01 00:27:06 +0200291 PacketDlDummy dl_dummy,
292 octetstring other
Harald Welte484160b2017-07-28 13:30:24 +0200293 } with { variant "" };
294
295 type record RlcmacDlCtrlMsg {
296 RlcmacDlCtrlMsgType msg_type,
297 RlcmacDlCtrlUnion u
298 } with {
299 variant (u) "CROSSTAG(dl_assignment, msg_type = PACKET_DL_ASSIGNMENT;
300 ul_assignment, msg_type = PACKET_UL_ASSIGNMENT;
301 paging, msg_type = PACKET_PAGING_REQUEST;
302 ul_ack_nack, msg_type = PACKET_UL_ACK_NACK;
Harald Welte422f0722017-08-01 00:27:06 +0200303 dl_dummy, msg_type = PACKET_DL_DUMMY_CTRL;
304 other, OTHERWISE
Harald Welte484160b2017-07-28 13:30:24 +0200305 )"
306 };
307
308 external function enc_RlcmacDlCtrlMsg(in RlcmacDlCtrlMsg si) return octetstring
309 with { extension "prototype(convert) encode(RAW)" };
310 external function dec_RlcmacDlCtrlMsg(in octetstring stream) return RlcmacDlCtrlMsg
311 with { extension "prototype(convert) decode(RAW)" };
312
313
314 /* 11.2.6 Packet Downlikn Ack/Nack */
315 type record ILevel {
316 BIT1 presence,
317 uint4_t i_level optional
318 } with { variant (i_level) "PRESENCE(presence = '1'B)" };
319 type record length(8) of ILevel ILevels;
320 type record ChannelQualityReport {
321 uint6_t c_value,
322 uint3_t rxqual,
323 uint6_t sign_var,
324 ILevels i_levels
325 } with { variant "" };
326 type record PacketDlAckNack {
327 uint5_t dl_tfi,
328 AckNackDescription ack_nack_desc,
329 BIT1 chreq_desc_presence,
330 ChannelReqDescription chreq_desc optional,
331 ChannelQualityReport ch_qual_rep
332 } with { variant "" };
333
334 /* 11.2.2 Packet Control Acknowledgement */
335 type enumerated CtrlAck {
336 MS_RCVD_TWO_RLC_SAME_RTI_DIFF_RBSN_NEW_TFI ('00'B),
337 MS_RCVD_RBSN1_NO_RBSN0 ('01'B),
338 MS_RCVD_RBSN0_NO_RBSN1 ('10'B),
339 MS_RCVD_TWO_RLC_SAME_RTI_DIFF_RBSN ('11'B)
340 } with { variant "FIELDLENGTH(2)" };
341 type record PacketCtrlAck {
342 GprsTlli tlli,
343 CtrlAck ctrl_ack
344 /* TODO: Rel5 additions */
Harald Welteacc93ab2018-03-02 21:39:09 +0100345 } with { variant ""
346 variant (tlli) "BYTEORDER(first)"
347 };
Harald Welte484160b2017-07-28 13:30:24 +0200348
349 /* 1.2.8b Packet Uplink Dummy Control Block */
350 type record PacketUlDummy {
351 GprsTlli tlli
Harald Welteacc93ab2018-03-02 21:39:09 +0100352 } with { variant ""
353 variant (tlli) "BYTEORDER(first)"
354 };
Harald Welte484160b2017-07-28 13:30:24 +0200355
Vadim Yanitskiyc5248492019-09-14 16:11:33 +0200356 /* 12.30 MS Radio Access Capability 2 (feature bitmask)
357 * (value part, see 3GPP TS 24.008, 10.5.5.12a) */
358 type union MSRadioAccCap2 {
359 /* TODO: see table 10.5.146/3GPP TS 24.008 */
360 bitstring other
361 };
362
363 /* Table 11.2.16.2 Access Type */
364 type enumerated RlcAccessType {
365 RLC_ACC_TYPE_TWO_PHASE ('00'B),
366 RLC_ACC_TYPE_PAG_RESPONSE ('01'B),
367 RLC_ACC_TYPE_CELL_UPDATE ('10'B),
368 RLC_ACC_TYPE_MM ('11'B)
369 } with { variant "FIELDLENGTH(2)" };
370
371 type union PacketResourceReqID {
372 GlobalTfi gtfi,
373 GprsTlli tlli
374 } with { variant (tlli) "BYTEORDER(first)" };
375
376 /* 11.2.16 Packet Resource Request */
377 type record PacketResourceReq {
378 BIT1 acc_type_presence,
379 RlcAccessType acc_type optional,
380 BIT1 id_type,
381 PacketResourceReqID id,
382 BIT1 ms_rac2_presence,
383 MSRadioAccCap2 ms_rac2 optional,
384 ChannelReqDescription ch_req_desc,
385 BIT1 change_mark_presence,
386 BIT2 change_mark optional,
387 BIT6 C_val,
388 BIT1 sign_var_presence,
389 BIT6 sign_var optional,
390 ILevels I_levels
391 /* TODO: additional contents for further Releases (starting from 1999) */
392 } with {
393 variant (acc_type) "PRESENCE(acc_type_presence = '1'B)"
394 variant (id) "CROSSTAG(gtfi, id_type = '0'B; tlli, id_type = '1'B)"
395 variant (ms_rac2) "PRESENCE(ms_rac2_presence = '1'B)"
396 variant (change_mark) "PRESENCE(change_mark_presence = '1'B)"
397 variant (sign_var) "PRESENCE(sign_var_presence = '1'B)"
398 };
399
Harald Welte484160b2017-07-28 13:30:24 +0200400 /* 11.2.0.2 */
401 type union RlcmacUlCtrlUnion {
402 PacketCtrlAck ctrl_ack,
403 PacketDlAckNack dl_ack_nack,
Harald Welte422f0722017-08-01 00:27:06 +0200404 PacketUlDummy ul_dummy,
Vadim Yanitskiyc5248492019-09-14 16:11:33 +0200405 PacketResourceReq resource_req,
Harald Welte422f0722017-08-01 00:27:06 +0200406 octetstring other
Harald Welte484160b2017-07-28 13:30:24 +0200407 } with { variant "" };
408
409 type record RlcmacUlCtrlMsg {
410 RlcmacUlCtrlMsgType msg_type,
411 RlcmacUlCtrlUnion u
412 } with {
413 variant (u) "CROSSTAG(ctrl_ack, msg_type = PACKET_CONTROL_ACK;
414 dl_ack_nack, msg_type = PACKET_DL_ACK_NACK;
Harald Welte422f0722017-08-01 00:27:06 +0200415 ul_dummy, msg_type = PACKET_UL_DUMMY_CTRL;
Vadim Yanitskiyc5248492019-09-14 16:11:33 +0200416 resource_req, msg_type = PACKET_RESOURCE_REQUEST;
Harald Welte422f0722017-08-01 00:27:06 +0200417 other, OTHERWISE
Harald Welte484160b2017-07-28 13:30:24 +0200418 )"
419 };
420
421 external function enc_RlcmacUlCtrlMsg(in RlcmacUlCtrlMsg si) return octetstring
422 with { extension "prototype(convert) encode(RAW)" };
423 external function dec_RlcmacUlCtrlMsg(in octetstring stream) return RlcmacUlCtrlMsg
424 with { extension "prototype(convert) decode(RAW)" };
425
426 type bitstring ReceivedBlockBitmap length(64) with { variant "BYTEORDER(last)" };
427
428 /* 12.3 Ack/Nack Description */
429 type record AckNackDescription {
430 BIT1 final_ack,
431 uint7_t starting_seq_nr,
432 ReceivedBlockBitmap receive_block_bitmap
433 } with { variant "" };
434
435 /* 12.7 Channel Request Description */
436 type enumerated RlcMode {
437 RLC_MODE_ACKNOWLEDGED (0),
438 RLC_MODE_UNACKNOWLEDGED (1)
439 } with { variant "FIELDLENGTH(1)" };
440 type enumerated LlcPduType {
441 LLC_PDU_IS_SACK_OR_ACK (0),
442 LLC_PDU_IS_NOT_SACK_OR_ACK (1)
443 } with { variant "FIELDLENGTH(1)" };
444 type record ChannelReqDescription {
445 uint4_t peak_tput_class,
446 uint2_t priority,
447 RlcMode rlc_mode,
448 LlcPduType llc_pdu_type,
449 uint16_t RlcOctetCount
450 } with { variant "" };
451
452 /* 12.8 Frequency Parameters */
453 type record FreqIndirect {
454 uint6_t maio,
455 uint4_t ma_number,
456 BIT1 change_mark1_present,
457 uint2_t change_mark1 optional,
458 BIT1 change_mark2_present,
459 uint2_t change_mark2 optional
460 } with {
461 variant (change_mark1) "PRESENCE(change_mark1_present = '1'B)"
462 variant (change_mark2) "PRESENCE(change_mark2_present = '1'B)"
463 };
464 type record FreqDirect1 {
465 uint6_t maio,
466 GprsMobileAllication mobile_allocation
467 }
468 type record FreqDirect2 {
469 uint6_t maio,
470 uint6_t hsn,
471 uint4_t ma_freq_len,
472 octetstring m1_freq_list
473 } with {
474 /* FIXME: this can not be expressed in TTCN-3 ?!? */
475 //variant (ma_freq_len) "LENGTHTO(m1_freq_list)+3"
476 variant (ma_freq_len) "LENGTHTO(m1_freq_list)"
477 };
478 type record FrequencyParameters {
479 uint3_t tsc,
480 BIT2 presence,
481 uint10_t arfcn optional,
482 FreqIndirect indirect optional,
483 FreqDirect1 direct1 optional,
484 FreqDirect2 direct2 optional
485 } with {
486 variant (arfcn) "PRESENCE(presence = '00'B)"
487 variant (indirect) "PRESENCE(presence = '01'B)"
488 variant (direct1) "PRESENCE(presence = '10'B)"
489 variant (direct2) "PRESENCE(presence = '11'B)"
490 };
491
492 /* 12.10 Global TFI */
493 type record GlobalTfi {
494 boolean is_dl_tfi,
495 uint5_t tfi
496 } with { variant (is_dl_tfi) "FIELDLENGTH(1)" };
497
498 /* 12.10a GPRS Mobile Allocation */
499 type record RflNumberList {
500 uint4_t rfl_number,
501 BIT1 presence,
502 RflNumberList rfl_number_list optional
503 } with {
504 variant (rfl_number_list) "PRESENCE(presence = '1'B)"
505 };
506 type record GprsMobileAllication {
507 uint6_t hsn,
508 BIT1 rfl_number_list_present,
509 RflNumberList rfl_number_list optional,
510 BIT1 ma_present,
511 uint6_t ma_length optional,
512 bitstring ma_bitmap optional
513 /* TODO: ARFCN index list */
514 } with {
515 variant (rfl_number_list) "PRESENCE(rfl_number_list_present = '1'B)"
516 variant (ma_length) "PRESENCE(ma_present = '0'B)"
517 variant (ma_bitmap) "PRESENCE(ma_present = '0'B)"
518 /* FIXME: this can not be expressed in TTCN-3 ?!? */
519 //variant (ma_length) "LENGTHTO(ma_bitmap)+1"
520 variant (ma_length) "LENGTHTO(ma_bitmap)"
521 }
522
523 /* 12.11 Packet Request Reference */
524 type record PacketRequestReference {
525 uint11_t ra_info,
526 uint16_t frame_nr
527 } with { variant "" };
528
529 /* 12.12 Packet Timing Advance */
530 type record PacketTimingAdvance {
531 BIT1 val_present,
532 uint6_t val optional,
533 BIT1 idx_present,
534 uint4_t idx optional,
535 uint3_t timeslot_nr optional
536 } with {
537 variant (val) "PRESENCE(val_present = '1'B)"
538 variant (idx) "PRESENCE(idx_present = '1'B)"
539 variant (timeslot_nr) "PRESENCE(idx_present = '1'B)"
540 };
541
542 /* 12.13 Power Control Parameters */
543 type record ZeroOneGamma {
544 BIT1 gamma_present,
545 uint5_t gamma
546 } with {
547 variant (gamma) "PRESENCE (gamma_present = '1'B)"
548 };
549 type record length(8) of ZeroOneGamma ZeroOneGammas;
550 type record PowerControlParameters {
551 uint4_t alpha,
552 ZeroOneGammas gamma
553 } with { variant "" };
554
555 /* 12.14 Persistence Level */
556 type record length(4) of uint4_t PersistenceLevels;
557
558 /* 12.20 Page Mode */
559 type enumerated PageMode {
560 PAGE_MODE_NORMAL ('00'B),
561 PAGE_MODE_EXTENDED ('01'B),
562 PAGE_MODE_REORG ('10'B),
563 PAGE_MODE_SAME ('11'B)
564 } with { variant "FIELDLENGTH(2)" };
565
566 /* 12.21 Starting Frame Number */
567 type record StartingFnDesc {
568 BIT1 presence,
569 uint16_t absolute_starting_time optional,
570 uint13_t relative_k optional
571 } with {
572 variant (absolute_starting_time) "PRESENCE(presence = '0'B)"
573 variant (relative_k) "PRESENCE(presence = '1'B)"
574 };
575
Harald Welte7024baa2018-03-02 23:37:51 +0100576 template (value) RlcmacUlCtrlMsg ts_RlcMacUlCtrl_PKT_CTRL_ACK(GprsTlli tlli,
577 CtrlAck ack := MS_RCVD_TWO_RLC_SAME_RTI_DIFF_RBSN) := {
578 msg_type := PACKET_CONTROL_ACK,
579 u := {
580 ctrl_ack := {
581 tlli := tlli,
582 ctrl_ack := ack
583 }
584 }
585 }
586
Harald Welteb669ee02018-03-09 12:50:02 +0100587 private const ILevel iNone := {
588 presence := '0'B,
589 i_level := omit
590 }
591 private const ChannelQualityReport c_ChQualRep_default := {
592 c_value := 0,
593 rxqual := 0,
594 sign_var := 0,
595 i_levels := { iNone, iNone, iNone, iNone, iNone, iNone, iNone, iNone }
596 }
597 template (value) RlcmacUlCtrlMsg ts_RlcMacUlCtrl_PKT_DL_ACK(uint5_t dl_tfi,
598 AckNackDescription andesc,
599 ChannelQualityReport qual_rep := c_ChQualRep_default) := {
600 msg_type := PACKET_DL_ACK_NACK,
601 u := {
602 dl_ack_nack := {
603 dl_tfi := dl_tfi,
604 ack_nack_desc := andesc,
605 chreq_desc_presence := '0'B,
606 chreq_desc := omit,
607 ch_qual_rep := qual_rep
608 }
609 }
610 }
611
Vadim Yanitskiyc5248492019-09-14 16:11:33 +0200612 template (value) RlcmacUlCtrlMsg ts_RlcMacUlCtrl_PKT_RES_REQ(
613 GprsTlli tlli, ChannelReqDescription ch_req_desc,
614 RlcAccessType acc_type := RLC_ACC_TYPE_TWO_PHASE
615 ) := {
616 msg_type := PACKET_RESOURCE_REQUEST,
617 u := {
618 resource_req := {
619 acc_type_presence := '1'B,
620 acc_type := acc_type,
621 id_type := '1'B,
622 id := { tlli := tlli },
623 ms_rac2_presence := '0'B,
624 ms_rac2 := omit,
625 ch_req_desc := ch_req_desc,
626 change_mark_presence := '0'B,
627 change_mark := omit,
628 C_val := '000000'B,
629 sign_var_presence := '0'B,
630 sign_var := omit,
631 I_levels := {
632 iNone, iNone, iNone, iNone,
633 iNone, iNone, iNone, iNone
634 }
635 }
636 }
637 }
Harald Welteb669ee02018-03-09 12:50:02 +0100638
Harald Welte7024baa2018-03-02 23:37:51 +0100639
Harald Welte484160b2017-07-28 13:30:24 +0200640} with { encode "RAW"; variant "FIELDORDER(msb)" variant "BYTEORDER(last)" };