blob: ea2edf6d8152000ea936a19ec5f68145a385192c [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),
Vadim Yanitskiy759cb292019-09-30 20:08:11 +070029 PACKET_PWR_CONTROL_TA ('000101'B),
Harald Welte484160b2017-07-28 13:30:24 +020030 /* TODO */
31 PACKET_TBF_RELEASE ('001000'B),
32 PACKET_UL_ACK_NACK ('001001'B),
33 PACKET_UL_ASSIGNMENT ('001010'B),
34 PACKET_DL_DUMMY_CTRL ('100101'B)
35 } with { variant "FIELDLENGTH(6)" };
36
37 /* TS 44.060 11.2.0.2 */
38 type enumerated RlcmacUlCtrlMsgType {
39 PACKET_CELL_CHANGE_FEATURE ('000000'B),
40 PACKET_CONTROL_ACK ('000001'B),
41 PACKET_DL_ACK_NACK ('000010'B),
42 PACKET_UL_DUMMY_CTRL ('000011'B),
43 PACKET_MEASUREMENT_REPORT ('000100'B),
44 PACKET_ENH_MEASUREMENT_REPORT ('001010'B),
45 PACKET_RESOURCE_REQUEST ('000101'B),
46 PACKET_MOBILE_TBF_STATUS ('000110'B),
47 PACKET_PSI_STATUS ('000111'B),
48 PACKET_EGPRS_DL_ACK_NACK ('001000'B),
49 PACKET_PAUSE ('001001'B),
50 ADDITIONAL_MS_RA_CAPABILITIES ('001011'B),
51 PACKET_CELL_CANGE_NOTIFICATION ('001100'B),
52 PACKET_SI_STATUS ('001101'B),
53 PACKET_CS_REQUEST ('001110'B),
54 MBMS_SERVICE_REQUEST ('001111'B),
55 MBMS_DL_ACK_NACK ('010000'B)
56 } with { variant "FIELDLENGTH(6)" };
57
58 type record NullGlobalTfi {
59 BIT1 presence ('0'B),
60 GlobalTfi global_tfi
61 } with { variant "" };
62
63 type record TenTlli {
64 BIT2 presence ('10'B),
65 GprsTlli tlli
Harald Welteacc93ab2018-03-02 21:39:09 +010066 } with { variant ""
67 variant (tlli) "BYTEORDER(first)"
68 };
Harald Welte484160b2017-07-28 13:30:24 +020069
70 type union GlobalTfiOrTlli {
71 NullGlobalTfi global_tfi,
72 TenTlli tlli
73 };
74
75 /* 11.2.7 Packet Downlink Assignment */
76 type record PacketDlAssignment {
77 PageMode page_mode,
78 BIT1 pres1,
79 PersistenceLevels persistence_levels optional,
80 GlobalTfiOrTlli tfi_or_tlli
81 /* TODO */
82 } with {
83 variant (persistence_levels) "PRESENCE(pres1 = '1'B)"
84 };
85
86 /* 11.2.29 Packet Uplink Assignment */
87 type record O_Gtfi {
88 BIT1 presence ('0'B),
89 GlobalTfi global_tfi
90 } with { variant "" };
91 type record IO_Tlli {
92 BIT2 presence ('10'B),
93 GprsTlli tlli
Harald Welteacc93ab2018-03-02 21:39:09 +010094 } with { variant ""
95 variant (tlli) "BYTEORDER(first)"
96 };
Harald Welte484160b2017-07-28 13:30:24 +020097 type record IIO_Tqi {
98 BIT3 presence ('110'B),
99 PacketRequestReference pkt_req_ref
100 } with { variant "" };
101 type union PktUlAssUnion {
102 O_Gtfi global_tfi,
103 IO_Tlli tlli,
104 IIO_Tqi tqi
105 } with {
106 variant "TAG(global_tfi, presence = '0'B;
107 tlli, presence = '10'B;
108 tqi, presence = '110'B)"
109 };
110 type record DynamicAllocation {
111 BIT1 extd_dyn_alloc,
112 BIT1 p0_present,
113 uint4_t p0 optional,
114 BIT1 pr_mode optional,
115 BIT1 usf_granularity,
116 BIT1 ul_tfi_ass_present,
117 uint5_t ul_tfi_assignment optional,
118 BIT1 reserved ('0'B),
119 BIT1 tbf_starting_time_present,
120 StartingFnDesc tbf_starting_time optional,
121 TsAllocationUnion ts_allocation
122 } with {
123 variant (p0) "PRESENCE(p0_present = '1'B)"
124 variant (pr_mode) "PRESENCE(p0_present = '1'B)"
125 variant (ul_tfi_assignment) "PRESENCE(ul_tfi_ass_present = '1'B)"
126 variant (tbf_starting_time) "PRESENCE(tbf_starting_time_present = '1'B)"
127 };
128 type record TsAllocationTs {
129 BIT1 presence,
130 uint3_t usf_tn optional
131 } with {
132 variant (usf_tn) "PRESENCE(presence = '1'B)"
133 };
134 type record length(8) of TsAllocationTs TsAllocationTsArr;
135 type record TnGamma {
136 BIT1 presence,
137 uint3_t usf_tn optional,
138 uint5_t gamma_tn optional
139 } with {
140 variant (usf_tn) "PRESENCE(presence = '1'B)"
141 variant (gamma_tn) "PRESENCE(presence = '1'B)"
142 };
143 type record length(8) of TnGamma TnGamma8;
144 type record TsAllocationPwr {
145 uint4_t alpha,
146 TnGamma tn_gamma
147 } with { variant "" };
148 type record TsAllocationUnion {
149 BIT1 presence,
150 TsAllocationTsArr ts optional,
151 TsAllocationPwr ts_with_pwr optional
152 } with {
153 variant (ts) "PRESENCE(presence = '0'B)"
154 variant (ts_with_pwr) "PRESENCE(presence = '1'B)"
155 };
156 type record SingleBlockAllocation {
157 uint3_t timeslot_nr,
158 BIT1 alpha_present,
159 uint4_t alpha optional,
160 uint5_t gamma_tn,
161 BIT1 p0_present,
162 uint4_t p0 optional,
163 BIT1 reserved ('0'B) optional,
164 BIT1 pr_mode optional,
165 StartingFnDesc tbf_starting_time
166 } with {
167 variant (alpha) "PRESENCE(alpha_present = '1'B)"
168 variant (p0) "PRESENCE(p0_present = '1'B)"
169 variant (reserved) "PRESENCE(p0_present = '1'B)"
170 variant (pr_mode) "PRESENCE(p0_present = '1'B)"
171 };
172 type record PktUlAssGprs {
173 ChCodingCommand ch_coding_cmd,
174 BIT1 tlli_block_chan_coding,
175 PacketTimingAdvance pkt_ta,
176 BIT1 freq_par_present,
177 FrequencyParameters freq_par optional,
178 BIT2 alloc_present,
179 DynamicAllocation dyn_block_alloc optional,
180 SingleBlockAllocation sgl_block_alloc optional
181 } with {
182 variant (freq_par) "PRESENCE(freq_par_present = '1'B)"
183 variant (dyn_block_alloc) "PRESENCE(alloc_present = '01'B)"
184 variant (sgl_block_alloc) "PRESENCE(alloc_present = '10'B)"
185 };
186 type record PacketUlAssignment {
187 PageMode page_mode,
188 BIT1 persistence_levels_present,
189 PersistenceLevels persistence_levels optional,
190 PktUlAssUnion identity,
191 BIT1 is_egprs, /* msg escape */
192 PktUlAssGprs gprs optional
193 } with {
194 variant (persistence_levels) "PRESENCE(persistence_levels_present = '1'B)"
195 variant (gprs) "PRESENCE(is_egprs = '0'B)"
196 };
197
198 /* 11.2.10 Packet Paging Request */
Stefan Sperling59c15d62018-10-10 11:09:25 +0200199 type record MobileIdentityLV_Paging {
200 /* Note that the size of 'len' differs from that of the Mobile Identify IE
201 * as defined in 3GPP TS 24.008 10.5.1.4 "Mobile Identity"; Paging Requests
202 * use only 4 bit to encode the length of a mobile identity, whereas the IE
203 * uses a byte. */
Harald Welte484160b2017-07-28 13:30:24 +0200204 uint4_t len,
205 octetstring mobile_id
206 } with { variant (len) "LENGTHTO(mobile_id)" };
207 type record PageInfoPs {
208 BIT1 presence ('0'B),
209 BIT1 ptmsi_or_mobile_id,
210 GsmTmsi ptmsi optional,
Stefan Sperling59c15d62018-10-10 11:09:25 +0200211 MobileIdentityLV_Paging mobile_identity optional
Harald Welte484160b2017-07-28 13:30:24 +0200212 } with {
213 variant (ptmsi) "PRESENCE(ptmsi_or_mobile_id = '0'B)"
214 variant (mobile_identity) "PRESENCE(ptmsi_or_mobile_id = '1'B)"
215 };
216 type record PageInfoCs {
217 BIT1 presence ('1'B),
218 BIT1 tmsi_or_mobile_id,
219 GsmTmsi tmsi optional,
Stefan Sperling59c15d62018-10-10 11:09:25 +0200220 MobileIdentityLV_Paging mobile_identity optional,
Harald Welte484160b2017-07-28 13:30:24 +0200221 ChannelNeeded chan_needed,
222 BIT1 emlpp_prio_present,
223 uint3_t emlpp_prio optional
224 } with {
225 variant (tmsi) "PRESENCE(tmsi_or_mobile_id = '0'B)"
226 variant (mobile_identity) "PRESENCE(tmsi_or_mobile_id = '1'B)"
227 variant (emlpp_prio) "PRESENCE(emlpp_prio_present = '1'B)"
228 };
229 type union PageInfo {
230 PageInfoPs ps,
231 PageInfoCs cs
232 };
233 type record PacketPagingReq {
234 PageMode page_mode,
235 BIT1 persistence_levels_present,
236 PersistenceLevels persistence_levels optional,
237 BIT1 nln_present,
Oliver Smith8f9daab2019-10-09 09:27:19 +0200238 uint2_t nln optional,
239 BIT1 repeated_pageinfo_present,
240 PageInfo repeated_pageinfo optional
Harald Welte484160b2017-07-28 13:30:24 +0200241 } with {
242 variant (persistence_levels) "PRESENCE(persistence_levels_present = '1'B)"
243 variant (nln) "PRESENCE(nln_present = '1'B)"
Oliver Smith8f9daab2019-10-09 09:27:19 +0200244 variant (repeated_pageinfo) "PRESENCE(repeated_pageinfo_present = '1'B)"
Harald Welte484160b2017-07-28 13:30:24 +0200245 };
246
247 /* 11.2.28 Uplink Ack/Nack */
248 type enumerated ChCodingCommand {
249 CH_CODING_CS1 ('00'B),
250 CH_CODING_CS2 ('01'B),
251 CH_CODING_CS3 ('10'B),
252 CH_CODING_CS4 ('11'B)
253 } with { variant "FIELDLENGTH(2)" };
254 type record UlAckNackGprs {
255 ChCodingCommand ch_coding_cmd,
256 AckNackDescription ack_nack_desc,
257 BIT1 cont_res_tlli_present,
258 GprsTlli cont_res_tlli optional,
259 BIT1 pkt_ta_present,
260 PacketTimingAdvance pkt_ta optional,
261 BIT1 pwr_ctrl_present,
262 PowerControlParameters pwr_ctrl optional
263 /* TODO: Extension Bits, Rel5 ,... */
264 } with {
265 variant (cont_res_tlli) "PRESENCE(cont_res_tlli_present = '1'B)"
266 variant (pkt_ta) "PRESENCE(pkt_ta_present = '1'B)"
267 variant (pwr_ctrl) "PRESENCE(pwr_ctrl_present = '1'B)"
Harald Welteacc93ab2018-03-02 21:39:09 +0100268 variant (cont_res_tlli) "BYTEORDER(first)"
Harald Welte484160b2017-07-28 13:30:24 +0200269 };
270 type record PacketUlAckNack {
271 PageMode page_mode,
272 BIT2 msg_excape ('00'B),
273 uint5_t uplink_tfi,
274 BIT1 is_egprs ('0'B), /* msg escape */
275 UlAckNackGprs gprs optional
276 /* TODO: EGPRS */
277 } with { variant (gprs) "PRESENCE(is_egprs = '0'B)" };
278
279 /* 11.2.8 Packet Downlink Dummy Control Block */
280 type record PacketDlDummy {
281 PageMode page_mode,
282 BIT1 persistence_levels_present,
283 PersistenceLevels persistence_levels optional
284 } with {
285 variant (persistence_levels) "PRESENCE(persistence_levels_present = '1'B)"
286 };
287
Vadim Yanitskiy759cb292019-09-30 20:08:11 +0700288 /* 11.9 Global Power Control Parameters */
289 type record GlobalPwrCtrlParams {
290 uint4_t alpha,
291 uint5_t t_avg_v,
292 uint5_t t_avg_t,
293 uint4_t pb,
294 BIT1 pc_meas_chan,
295 BIT1 spare ('0'B),
296 uint4_t n_avg_i
297 };
298
299 /* 12.12a Global Packet Timing Advance */
300 type record TimingAdvanceIdxTN {
301 uint4_t ta_idx,
302 uint3_t ts_num
303 };
304 type record GlobalPacketTA {
305 BIT1 ta_val_presence,
306 uint4_t ta_val optional,
307 BIT1 ul_presence,
308 TimingAdvanceIdxTN ul optional,
309 BIT1 dl_presence,
310 TimingAdvanceIdxTN dl optional
311 } with {
312 variant (ta_val) "PRESENCE(ta_val_presence = '1'B)"
313 variant (ul) "PRESENCE(ul_presence = '1'B)"
314 variant (dl) "PRESENCE(dl_presence = '1'B)"
315 };
316
317 /* 11.2.13 Packet Power Control/Timing Advance */
318 type record PacketPwrControlTAMsg {
319 BIT1 g_pwr_ctrl_presence,
320 GlobalPwrCtrlParams g_pwr_ctrl optional,
321 BIT1 split,
322 BIT1 split_desc optional,
323 GlobalPacketTA g_pkt_ta optional,
324 PowerControlParameters pwr_ctrl optional
325 /* TODO: additions for R99, REL-7, REL-12 */
326 } with {
327 variant (g_pwr_ctrl) "PRESENCE(g_pwr_ctrl_presence = '1'B)"
328 variant (split_desc) "PRESENCE(split = '1'B)"
329 /* FIXME: Fancy coding: either both IEs together, or one of them */
330 variant (g_pkt_ta) "PRESENCE(split = '0'B, split_desc = '0'B)"
331 variant (pwr_ctrl) "PRESENCE(split = '0'B, split_desc = '1'B)"
332 };
333 type record PacketPwrControlTA {
334 PageMode page_mode,
335 NullGlobalTfi global_tfi,
336 /* See 11.1.3.3 'Message escape' error label
337 * 0 < Message body > ! < Message escape : 1 bit (*) = <no string> > */
338 BIT1 msg_escape,
339 PacketPwrControlTAMsg msg optional
340 } with {
341 variant (msg) "PRESENCE(msg_escape = '0'B)"
342 };
343
Harald Welte484160b2017-07-28 13:30:24 +0200344 /* 11.2.0.1 */
345 type union RlcmacDlCtrlUnion {
346 PacketDlAssignment dl_assignment,
347 PacketUlAssignment ul_assignment,
348 PacketPagingReq paging,
349 PacketUlAckNack ul_ack_nack,
Harald Welte422f0722017-08-01 00:27:06 +0200350 PacketDlDummy dl_dummy,
Vadim Yanitskiy759cb292019-09-30 20:08:11 +0700351 PacketPwrControlTA pwr_ta,
Harald Welte422f0722017-08-01 00:27:06 +0200352 octetstring other
Harald Welte484160b2017-07-28 13:30:24 +0200353 } with { variant "" };
354
355 type record RlcmacDlCtrlMsg {
356 RlcmacDlCtrlMsgType msg_type,
357 RlcmacDlCtrlUnion u
358 } with {
359 variant (u) "CROSSTAG(dl_assignment, msg_type = PACKET_DL_ASSIGNMENT;
360 ul_assignment, msg_type = PACKET_UL_ASSIGNMENT;
361 paging, msg_type = PACKET_PAGING_REQUEST;
362 ul_ack_nack, msg_type = PACKET_UL_ACK_NACK;
Harald Welte422f0722017-08-01 00:27:06 +0200363 dl_dummy, msg_type = PACKET_DL_DUMMY_CTRL;
Vadim Yanitskiy759cb292019-09-30 20:08:11 +0700364 pwr_ta, msg_type = PACKET_PWR_CONTROL_TA;
Harald Welte422f0722017-08-01 00:27:06 +0200365 other, OTHERWISE
Harald Welte484160b2017-07-28 13:30:24 +0200366 )"
367 };
368
369 external function enc_RlcmacDlCtrlMsg(in RlcmacDlCtrlMsg si) return octetstring
370 with { extension "prototype(convert) encode(RAW)" };
371 external function dec_RlcmacDlCtrlMsg(in octetstring stream) return RlcmacDlCtrlMsg
372 with { extension "prototype(convert) decode(RAW)" };
373
374
375 /* 11.2.6 Packet Downlikn Ack/Nack */
376 type record ILevel {
377 BIT1 presence,
378 uint4_t i_level optional
379 } with { variant (i_level) "PRESENCE(presence = '1'B)" };
380 type record length(8) of ILevel ILevels;
381 type record ChannelQualityReport {
382 uint6_t c_value,
383 uint3_t rxqual,
384 uint6_t sign_var,
385 ILevels i_levels
386 } with { variant "" };
387 type record PacketDlAckNack {
388 uint5_t dl_tfi,
389 AckNackDescription ack_nack_desc,
390 BIT1 chreq_desc_presence,
391 ChannelReqDescription chreq_desc optional,
392 ChannelQualityReport ch_qual_rep
393 } with { variant "" };
394
395 /* 11.2.2 Packet Control Acknowledgement */
396 type enumerated CtrlAck {
397 MS_RCVD_TWO_RLC_SAME_RTI_DIFF_RBSN_NEW_TFI ('00'B),
398 MS_RCVD_RBSN1_NO_RBSN0 ('01'B),
399 MS_RCVD_RBSN0_NO_RBSN1 ('10'B),
400 MS_RCVD_TWO_RLC_SAME_RTI_DIFF_RBSN ('11'B)
401 } with { variant "FIELDLENGTH(2)" };
402 type record PacketCtrlAck {
403 GprsTlli tlli,
404 CtrlAck ctrl_ack
405 /* TODO: Rel5 additions */
Harald Welteacc93ab2018-03-02 21:39:09 +0100406 } with { variant ""
407 variant (tlli) "BYTEORDER(first)"
408 };
Harald Welte484160b2017-07-28 13:30:24 +0200409
410 /* 1.2.8b Packet Uplink Dummy Control Block */
411 type record PacketUlDummy {
412 GprsTlli tlli
Harald Welteacc93ab2018-03-02 21:39:09 +0100413 } with { variant ""
414 variant (tlli) "BYTEORDER(first)"
415 };
Harald Welte484160b2017-07-28 13:30:24 +0200416
Vadim Yanitskiyc5248492019-09-14 16:11:33 +0200417 /* 12.30 MS Radio Access Capability 2 (feature bitmask)
418 * (value part, see 3GPP TS 24.008, 10.5.5.12a) */
419 type union MSRadioAccCap2 {
420 /* TODO: see table 10.5.146/3GPP TS 24.008 */
421 bitstring other
422 };
423
424 /* Table 11.2.16.2 Access Type */
425 type enumerated RlcAccessType {
426 RLC_ACC_TYPE_TWO_PHASE ('00'B),
427 RLC_ACC_TYPE_PAG_RESPONSE ('01'B),
428 RLC_ACC_TYPE_CELL_UPDATE ('10'B),
429 RLC_ACC_TYPE_MM ('11'B)
430 } with { variant "FIELDLENGTH(2)" };
431
432 type union PacketResourceReqID {
433 GlobalTfi gtfi,
434 GprsTlli tlli
435 } with { variant (tlli) "BYTEORDER(first)" };
436
437 /* 11.2.16 Packet Resource Request */
438 type record PacketResourceReq {
439 BIT1 acc_type_presence,
440 RlcAccessType acc_type optional,
441 BIT1 id_type,
442 PacketResourceReqID id,
443 BIT1 ms_rac2_presence,
444 MSRadioAccCap2 ms_rac2 optional,
445 ChannelReqDescription ch_req_desc,
446 BIT1 change_mark_presence,
447 BIT2 change_mark optional,
448 BIT6 C_val,
449 BIT1 sign_var_presence,
450 BIT6 sign_var optional,
451 ILevels I_levels
452 /* TODO: additional contents for further Releases (starting from 1999) */
453 } with {
454 variant (acc_type) "PRESENCE(acc_type_presence = '1'B)"
455 variant (id) "CROSSTAG(gtfi, id_type = '0'B; tlli, id_type = '1'B)"
456 variant (ms_rac2) "PRESENCE(ms_rac2_presence = '1'B)"
457 variant (change_mark) "PRESENCE(change_mark_presence = '1'B)"
458 variant (sign_var) "PRESENCE(sign_var_presence = '1'B)"
459 };
460
Harald Welte484160b2017-07-28 13:30:24 +0200461 /* 11.2.0.2 */
462 type union RlcmacUlCtrlUnion {
463 PacketCtrlAck ctrl_ack,
464 PacketDlAckNack dl_ack_nack,
Harald Welte422f0722017-08-01 00:27:06 +0200465 PacketUlDummy ul_dummy,
Vadim Yanitskiyc5248492019-09-14 16:11:33 +0200466 PacketResourceReq resource_req,
Harald Welte422f0722017-08-01 00:27:06 +0200467 octetstring other
Harald Welte484160b2017-07-28 13:30:24 +0200468 } with { variant "" };
469
470 type record RlcmacUlCtrlMsg {
471 RlcmacUlCtrlMsgType msg_type,
472 RlcmacUlCtrlUnion u
473 } with {
474 variant (u) "CROSSTAG(ctrl_ack, msg_type = PACKET_CONTROL_ACK;
475 dl_ack_nack, msg_type = PACKET_DL_ACK_NACK;
Harald Welte422f0722017-08-01 00:27:06 +0200476 ul_dummy, msg_type = PACKET_UL_DUMMY_CTRL;
Vadim Yanitskiyc5248492019-09-14 16:11:33 +0200477 resource_req, msg_type = PACKET_RESOURCE_REQUEST;
Harald Welte422f0722017-08-01 00:27:06 +0200478 other, OTHERWISE
Harald Welte484160b2017-07-28 13:30:24 +0200479 )"
480 };
481
482 external function enc_RlcmacUlCtrlMsg(in RlcmacUlCtrlMsg si) return octetstring
483 with { extension "prototype(convert) encode(RAW)" };
484 external function dec_RlcmacUlCtrlMsg(in octetstring stream) return RlcmacUlCtrlMsg
485 with { extension "prototype(convert) decode(RAW)" };
486
487 type bitstring ReceivedBlockBitmap length(64) with { variant "BYTEORDER(last)" };
488
489 /* 12.3 Ack/Nack Description */
490 type record AckNackDescription {
491 BIT1 final_ack,
492 uint7_t starting_seq_nr,
493 ReceivedBlockBitmap receive_block_bitmap
494 } with { variant "" };
495
496 /* 12.7 Channel Request Description */
497 type enumerated RlcMode {
498 RLC_MODE_ACKNOWLEDGED (0),
499 RLC_MODE_UNACKNOWLEDGED (1)
500 } with { variant "FIELDLENGTH(1)" };
501 type enumerated LlcPduType {
502 LLC_PDU_IS_SACK_OR_ACK (0),
503 LLC_PDU_IS_NOT_SACK_OR_ACK (1)
504 } with { variant "FIELDLENGTH(1)" };
505 type record ChannelReqDescription {
506 uint4_t peak_tput_class,
507 uint2_t priority,
508 RlcMode rlc_mode,
509 LlcPduType llc_pdu_type,
510 uint16_t RlcOctetCount
511 } with { variant "" };
512
513 /* 12.8 Frequency Parameters */
514 type record FreqIndirect {
515 uint6_t maio,
516 uint4_t ma_number,
517 BIT1 change_mark1_present,
518 uint2_t change_mark1 optional,
519 BIT1 change_mark2_present,
520 uint2_t change_mark2 optional
521 } with {
522 variant (change_mark1) "PRESENCE(change_mark1_present = '1'B)"
523 variant (change_mark2) "PRESENCE(change_mark2_present = '1'B)"
524 };
525 type record FreqDirect1 {
526 uint6_t maio,
527 GprsMobileAllication mobile_allocation
528 }
529 type record FreqDirect2 {
530 uint6_t maio,
531 uint6_t hsn,
532 uint4_t ma_freq_len,
533 octetstring m1_freq_list
534 } with {
535 /* FIXME: this can not be expressed in TTCN-3 ?!? */
536 //variant (ma_freq_len) "LENGTHTO(m1_freq_list)+3"
537 variant (ma_freq_len) "LENGTHTO(m1_freq_list)"
538 };
539 type record FrequencyParameters {
540 uint3_t tsc,
541 BIT2 presence,
542 uint10_t arfcn optional,
543 FreqIndirect indirect optional,
544 FreqDirect1 direct1 optional,
545 FreqDirect2 direct2 optional
546 } with {
547 variant (arfcn) "PRESENCE(presence = '00'B)"
548 variant (indirect) "PRESENCE(presence = '01'B)"
549 variant (direct1) "PRESENCE(presence = '10'B)"
550 variant (direct2) "PRESENCE(presence = '11'B)"
551 };
552
553 /* 12.10 Global TFI */
554 type record GlobalTfi {
555 boolean is_dl_tfi,
556 uint5_t tfi
557 } with { variant (is_dl_tfi) "FIELDLENGTH(1)" };
558
559 /* 12.10a GPRS Mobile Allocation */
560 type record RflNumberList {
561 uint4_t rfl_number,
562 BIT1 presence,
563 RflNumberList rfl_number_list optional
564 } with {
565 variant (rfl_number_list) "PRESENCE(presence = '1'B)"
566 };
567 type record GprsMobileAllication {
568 uint6_t hsn,
569 BIT1 rfl_number_list_present,
570 RflNumberList rfl_number_list optional,
571 BIT1 ma_present,
572 uint6_t ma_length optional,
573 bitstring ma_bitmap optional
574 /* TODO: ARFCN index list */
575 } with {
576 variant (rfl_number_list) "PRESENCE(rfl_number_list_present = '1'B)"
577 variant (ma_length) "PRESENCE(ma_present = '0'B)"
578 variant (ma_bitmap) "PRESENCE(ma_present = '0'B)"
579 /* FIXME: this can not be expressed in TTCN-3 ?!? */
580 //variant (ma_length) "LENGTHTO(ma_bitmap)+1"
581 variant (ma_length) "LENGTHTO(ma_bitmap)"
582 }
583
584 /* 12.11 Packet Request Reference */
585 type record PacketRequestReference {
586 uint11_t ra_info,
587 uint16_t frame_nr
588 } with { variant "" };
589
590 /* 12.12 Packet Timing Advance */
591 type record PacketTimingAdvance {
592 BIT1 val_present,
593 uint6_t val optional,
594 BIT1 idx_present,
595 uint4_t idx optional,
596 uint3_t timeslot_nr optional
597 } with {
598 variant (val) "PRESENCE(val_present = '1'B)"
599 variant (idx) "PRESENCE(idx_present = '1'B)"
600 variant (timeslot_nr) "PRESENCE(idx_present = '1'B)"
601 };
602
603 /* 12.13 Power Control Parameters */
604 type record ZeroOneGamma {
605 BIT1 gamma_present,
606 uint5_t gamma
607 } with {
608 variant (gamma) "PRESENCE (gamma_present = '1'B)"
609 };
610 type record length(8) of ZeroOneGamma ZeroOneGammas;
611 type record PowerControlParameters {
612 uint4_t alpha,
613 ZeroOneGammas gamma
614 } with { variant "" };
615
616 /* 12.14 Persistence Level */
617 type record length(4) of uint4_t PersistenceLevels;
618
619 /* 12.20 Page Mode */
620 type enumerated PageMode {
621 PAGE_MODE_NORMAL ('00'B),
622 PAGE_MODE_EXTENDED ('01'B),
623 PAGE_MODE_REORG ('10'B),
624 PAGE_MODE_SAME ('11'B)
625 } with { variant "FIELDLENGTH(2)" };
626
627 /* 12.21 Starting Frame Number */
628 type record StartingFnDesc {
629 BIT1 presence,
630 uint16_t absolute_starting_time optional,
631 uint13_t relative_k optional
632 } with {
633 variant (absolute_starting_time) "PRESENCE(presence = '0'B)"
634 variant (relative_k) "PRESENCE(presence = '1'B)"
635 };
636
Harald Welte7024baa2018-03-02 23:37:51 +0100637 template (value) RlcmacUlCtrlMsg ts_RlcMacUlCtrl_PKT_CTRL_ACK(GprsTlli tlli,
638 CtrlAck ack := MS_RCVD_TWO_RLC_SAME_RTI_DIFF_RBSN) := {
639 msg_type := PACKET_CONTROL_ACK,
640 u := {
641 ctrl_ack := {
642 tlli := tlli,
643 ctrl_ack := ack
644 }
645 }
646 }
647
Pau Espin Pedrola3f0a852019-12-02 19:16:26 +0100648 const ILevel iNone := {
Harald Welteb669ee02018-03-09 12:50:02 +0100649 presence := '0'B,
650 i_level := omit
651 }
Pau Espin Pedrola3f0a852019-12-02 19:16:26 +0100652 const ChannelQualityReport c_ChQualRep_default := {
Harald Welteb669ee02018-03-09 12:50:02 +0100653 c_value := 0,
654 rxqual := 0,
655 sign_var := 0,
656 i_levels := { iNone, iNone, iNone, iNone, iNone, iNone, iNone, iNone }
657 }
658 template (value) RlcmacUlCtrlMsg ts_RlcMacUlCtrl_PKT_DL_ACK(uint5_t dl_tfi,
659 AckNackDescription andesc,
660 ChannelQualityReport qual_rep := c_ChQualRep_default) := {
661 msg_type := PACKET_DL_ACK_NACK,
662 u := {
663 dl_ack_nack := {
664 dl_tfi := dl_tfi,
665 ack_nack_desc := andesc,
666 chreq_desc_presence := '0'B,
667 chreq_desc := omit,
668 ch_qual_rep := qual_rep
669 }
670 }
671 }
672
Vadim Yanitskiyc5248492019-09-14 16:11:33 +0200673 template (value) RlcmacUlCtrlMsg ts_RlcMacUlCtrl_PKT_RES_REQ(
674 GprsTlli tlli, ChannelReqDescription ch_req_desc,
675 RlcAccessType acc_type := RLC_ACC_TYPE_TWO_PHASE
676 ) := {
677 msg_type := PACKET_RESOURCE_REQUEST,
678 u := {
679 resource_req := {
680 acc_type_presence := '1'B,
681 acc_type := acc_type,
682 id_type := '1'B,
683 id := { tlli := tlli },
684 ms_rac2_presence := '0'B,
685 ms_rac2 := omit,
686 ch_req_desc := ch_req_desc,
687 change_mark_presence := '0'B,
688 change_mark := omit,
689 C_val := '000000'B,
690 sign_var_presence := '0'B,
691 sign_var := omit,
692 I_levels := {
693 iNone, iNone, iNone, iNone,
694 iNone, iNone, iNone, iNone
695 }
696 }
697 }
698 }
Harald Welteb669ee02018-03-09 12:50:02 +0100699
Harald Welte7024baa2018-03-02 23:37:51 +0100700
Harald Welte484160b2017-07-28 13:30:24 +0200701} with { encode "RAW"; variant "FIELDORDER(msb)" variant "BYTEORDER(last)" };