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