blob: 447e52b3aa459ea248a2908435ad5a4e47bbb32e [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
Pau Espin Pedrol2ec84fd2020-05-14 13:28:21 +020059 type enumerated EgprsChCodingCommand {
60 CH_CODING_MCS1 ('0000'B),
61 CH_CODING_MCS2 ('0001'B),
62 CH_CODING_MCS3 ('0010'B),
63 CH_CODING_MCS4 ('0011'B),
64 CH_CODING_MCS5 ('0100'B),
65 CH_CODING_MCS6 ('0101'B),
66 CH_CODING_MCS7 ('0110'B),
67 CH_CODING_MCS8 ('0111'B),
68 CH_CODING_MCS9 ('1000'B),
69 CH_CODING_MCS5_7 ('1001'B),
70 CH_CODING_MCS6_9 ('1010'B)
71 } with { variant "FIELDLENGTH(4)" };
72
73 /* TS 44.060 Table 12.5.2.1 */
74 type enumerated EgprsWindowSize { /* This probably needs to be moved to RLCMAC_CSN1_Types.ttcn */
75 EGPRS_WS_64 ('00000'B),
76 EGPRS_WS_96 ('00001'B),
77 EGPRS_WS_128 ('00010'B),
78 EGPRS_WS_160 ('00011'B),
79 EGPRS_WS_192 ('00100'B),
80 EGPRS_WS_224 ('00101'B),
81 EGPRS_WS_256 ('00110'B),
82 EGPRS_WS_288 ('00111'B),
83 EGPRS_WS_320 ('01000'B),
84 EGPRS_WS_352 ('01001'B),
85 EGPRS_WS_384 ('01010'B),
86 EGPRS_WS_416 ('01011'B),
87 EGPRS_WS_448 ('01100'B),
88 EGPRS_WS_480 ('01101'B),
89 EGPRS_WS_512 ('01110'B),
90 EGPRS_WS_544 ('01111'B),
91 EGPRS_WS_576 ('10000'B),
92 EGPRS_WS_608 ('10001'B),
93 EGPRS_WS_640 ('10010'B),
94 EGPRS_WS_672 ('10011'B),
95 EGPRS_WS_704 ('10100'B),
96 EGPRS_WS_736 ('10101'B),
97 EGPRS_WS_768 ('10110'B),
98 EGPRS_WS_800 ('10111'B),
99 EGPRS_WS_832 ('11000'B),
100 EGPRS_WS_864 ('11001'B),
101 EGPRS_WS_896 ('11010'B),
102 EGPRS_WS_928 ('11011'B),
103 EGPRS_WS_960 ('11100'B),
104 EGPRS_WS_992 ('11101'B),
105 EGPRS_WS_1024 ('11110'B)
106 } with { variant "FIELDLENGTH(5)" };
107
Harald Welte484160b2017-07-28 13:30:24 +0200108 type record NullGlobalTfi {
109 BIT1 presence ('0'B),
110 GlobalTfi global_tfi
111 } with { variant "" };
112
113 type record TenTlli {
114 BIT2 presence ('10'B),
115 GprsTlli tlli
Harald Welteacc93ab2018-03-02 21:39:09 +0100116 } with { variant ""
117 variant (tlli) "BYTEORDER(first)"
118 };
Harald Welte484160b2017-07-28 13:30:24 +0200119
120 type union GlobalTfiOrTlli {
121 NullGlobalTfi global_tfi,
122 TenTlli tlli
123 };
124
125 /* 11.2.7 Packet Downlink Assignment */
126 type record PacketDlAssignment {
127 PageMode page_mode,
128 BIT1 pres1,
129 PersistenceLevels persistence_levels optional,
130 GlobalTfiOrTlli tfi_or_tlli
131 /* TODO */
132 } with {
133 variant (persistence_levels) "PRESENCE(pres1 = '1'B)"
134 };
135
136 /* 11.2.29 Packet Uplink Assignment */
137 type record O_Gtfi {
138 BIT1 presence ('0'B),
139 GlobalTfi global_tfi
140 } with { variant "" };
141 type record IO_Tlli {
142 BIT2 presence ('10'B),
143 GprsTlli tlli
Harald Welteacc93ab2018-03-02 21:39:09 +0100144 } with { variant ""
145 variant (tlli) "BYTEORDER(first)"
146 };
Harald Welte484160b2017-07-28 13:30:24 +0200147 type record IIO_Tqi {
148 BIT3 presence ('110'B),
149 PacketRequestReference pkt_req_ref
150 } with { variant "" };
151 type union PktUlAssUnion {
152 O_Gtfi global_tfi,
153 IO_Tlli tlli,
154 IIO_Tqi tqi
155 } with {
156 variant "TAG(global_tfi, presence = '0'B;
157 tlli, presence = '10'B;
158 tqi, presence = '110'B)"
159 };
160 type record DynamicAllocation {
161 BIT1 extd_dyn_alloc,
162 BIT1 p0_present,
163 uint4_t p0 optional,
164 BIT1 pr_mode optional,
165 BIT1 usf_granularity,
166 BIT1 ul_tfi_ass_present,
167 uint5_t ul_tfi_assignment optional,
168 BIT1 reserved ('0'B),
169 BIT1 tbf_starting_time_present,
170 StartingFnDesc tbf_starting_time optional,
171 TsAllocationUnion ts_allocation
172 } with {
173 variant (p0) "PRESENCE(p0_present = '1'B)"
174 variant (pr_mode) "PRESENCE(p0_present = '1'B)"
175 variant (ul_tfi_assignment) "PRESENCE(ul_tfi_ass_present = '1'B)"
176 variant (tbf_starting_time) "PRESENCE(tbf_starting_time_present = '1'B)"
177 };
178 type record TsAllocationTs {
179 BIT1 presence,
180 uint3_t usf_tn optional
181 } with {
182 variant (usf_tn) "PRESENCE(presence = '1'B)"
183 };
184 type record length(8) of TsAllocationTs TsAllocationTsArr;
185 type record TnGamma {
186 BIT1 presence,
187 uint3_t usf_tn optional,
188 uint5_t gamma_tn optional
189 } with {
190 variant (usf_tn) "PRESENCE(presence = '1'B)"
191 variant (gamma_tn) "PRESENCE(presence = '1'B)"
192 };
193 type record length(8) of TnGamma TnGamma8;
194 type record TsAllocationPwr {
195 uint4_t alpha,
196 TnGamma tn_gamma
197 } with { variant "" };
198 type record TsAllocationUnion {
199 BIT1 presence,
200 TsAllocationTsArr ts optional,
201 TsAllocationPwr ts_with_pwr optional
202 } with {
203 variant (ts) "PRESENCE(presence = '0'B)"
204 variant (ts_with_pwr) "PRESENCE(presence = '1'B)"
205 };
206 type record SingleBlockAllocation {
207 uint3_t timeslot_nr,
208 BIT1 alpha_present,
209 uint4_t alpha optional,
210 uint5_t gamma_tn,
211 BIT1 p0_present,
212 uint4_t p0 optional,
213 BIT1 reserved ('0'B) optional,
214 BIT1 pr_mode optional,
215 StartingFnDesc tbf_starting_time
216 } with {
217 variant (alpha) "PRESENCE(alpha_present = '1'B)"
218 variant (p0) "PRESENCE(p0_present = '1'B)"
219 variant (reserved) "PRESENCE(p0_present = '1'B)"
220 variant (pr_mode) "PRESENCE(p0_present = '1'B)"
221 };
222 type record PktUlAssGprs {
223 ChCodingCommand ch_coding_cmd,
224 BIT1 tlli_block_chan_coding,
225 PacketTimingAdvance pkt_ta,
226 BIT1 freq_par_present,
227 FrequencyParameters freq_par optional,
228 BIT2 alloc_present,
229 DynamicAllocation dyn_block_alloc optional,
230 SingleBlockAllocation sgl_block_alloc optional
231 } with {
232 variant (freq_par) "PRESENCE(freq_par_present = '1'B)"
233 variant (dyn_block_alloc) "PRESENCE(alloc_present = '01'B)"
234 variant (sgl_block_alloc) "PRESENCE(alloc_present = '10'B)"
235 };
Pau Espin Pedrol2ec84fd2020-05-14 13:28:21 +0200236 type record of AccessTechnologiesRequest AccessTechnologiesRequestRepetition
237 with { variant "EXTENSION_BIT(reverse)" };
238 type record AccessTechnologiesRequest
239 {
240 BIT4 accessTechnType,
241 BIT1 extensionBit
242 } with { variant "FIELDORDER(msb)" };
Harald Welte484160b2017-07-28 13:30:24 +0200243 type record PacketUlAssignment {
244 PageMode page_mode,
245 BIT1 persistence_levels_present,
246 PersistenceLevels persistence_levels optional,
247 PktUlAssUnion identity,
248 BIT1 is_egprs, /* msg escape */
249 PktUlAssGprs gprs optional
250 } with {
251 variant (persistence_levels) "PRESENCE(persistence_levels_present = '1'B)"
252 variant (gprs) "PRESENCE(is_egprs = '0'B)"
253 };
254
255 /* 11.2.10 Packet Paging Request */
Stefan Sperling59c15d62018-10-10 11:09:25 +0200256 type record MobileIdentityLV_Paging {
257 /* Note that the size of 'len' differs from that of the Mobile Identify IE
258 * as defined in 3GPP TS 24.008 10.5.1.4 "Mobile Identity"; Paging Requests
259 * use only 4 bit to encode the length of a mobile identity, whereas the IE
260 * uses a byte. */
Harald Welte484160b2017-07-28 13:30:24 +0200261 uint4_t len,
262 octetstring mobile_id
Vadim Yanitskiy322c7932020-01-01 23:03:47 +0100263 } with {
264 variant (len) "LENGTHTO(mobile_id)"
265 variant (mobile_id) "BYTEORDER(first)"
266 };
Harald Welte484160b2017-07-28 13:30:24 +0200267 type record PageInfoPs {
268 BIT1 presence ('0'B),
269 BIT1 ptmsi_or_mobile_id,
270 GsmTmsi ptmsi optional,
Stefan Sperling59c15d62018-10-10 11:09:25 +0200271 MobileIdentityLV_Paging mobile_identity optional
Harald Welte484160b2017-07-28 13:30:24 +0200272 } with {
273 variant (ptmsi) "PRESENCE(ptmsi_or_mobile_id = '0'B)"
274 variant (mobile_identity) "PRESENCE(ptmsi_or_mobile_id = '1'B)"
275 };
276 type record PageInfoCs {
277 BIT1 presence ('1'B),
278 BIT1 tmsi_or_mobile_id,
279 GsmTmsi tmsi optional,
Stefan Sperling59c15d62018-10-10 11:09:25 +0200280 MobileIdentityLV_Paging mobile_identity optional,
Harald Welte484160b2017-07-28 13:30:24 +0200281 ChannelNeeded chan_needed,
282 BIT1 emlpp_prio_present,
283 uint3_t emlpp_prio optional
284 } with {
285 variant (tmsi) "PRESENCE(tmsi_or_mobile_id = '0'B)"
286 variant (mobile_identity) "PRESENCE(tmsi_or_mobile_id = '1'B)"
287 variant (emlpp_prio) "PRESENCE(emlpp_prio_present = '1'B)"
288 };
289 type union PageInfo {
290 PageInfoPs ps,
291 PageInfoCs cs
Vadim Yanitskiy5e518732020-01-01 21:27:18 +0100292 } with {
293 variant "TAG(ps, presence = '0'B; cs, presence = '1'B)"
Harald Welte484160b2017-07-28 13:30:24 +0200294 };
295 type record PacketPagingReq {
296 PageMode page_mode,
297 BIT1 persistence_levels_present,
298 PersistenceLevels persistence_levels optional,
299 BIT1 nln_present,
Oliver Smith8f9daab2019-10-09 09:27:19 +0200300 uint2_t nln optional,
301 BIT1 repeated_pageinfo_present,
302 PageInfo repeated_pageinfo optional
Harald Welte484160b2017-07-28 13:30:24 +0200303 } with {
304 variant (persistence_levels) "PRESENCE(persistence_levels_present = '1'B)"
305 variant (nln) "PRESENCE(nln_present = '1'B)"
Oliver Smith8f9daab2019-10-09 09:27:19 +0200306 variant (repeated_pageinfo) "PRESENCE(repeated_pageinfo_present = '1'B)"
Harald Welte484160b2017-07-28 13:30:24 +0200307 };
308
309 /* 11.2.28 Uplink Ack/Nack */
310 type enumerated ChCodingCommand {
311 CH_CODING_CS1 ('00'B),
312 CH_CODING_CS2 ('01'B),
313 CH_CODING_CS3 ('10'B),
314 CH_CODING_CS4 ('11'B)
315 } with { variant "FIELDLENGTH(2)" };
316 type record UlAckNackGprs {
317 ChCodingCommand ch_coding_cmd,
318 AckNackDescription ack_nack_desc,
319 BIT1 cont_res_tlli_present,
320 GprsTlli cont_res_tlli optional,
321 BIT1 pkt_ta_present,
322 PacketTimingAdvance pkt_ta optional,
323 BIT1 pwr_ctrl_present,
324 PowerControlParameters pwr_ctrl optional
325 /* TODO: Extension Bits, Rel5 ,... */
326 } with {
327 variant (cont_res_tlli) "PRESENCE(cont_res_tlli_present = '1'B)"
328 variant (pkt_ta) "PRESENCE(pkt_ta_present = '1'B)"
329 variant (pwr_ctrl) "PRESENCE(pwr_ctrl_present = '1'B)"
Harald Welteacc93ab2018-03-02 21:39:09 +0100330 variant (cont_res_tlli) "BYTEORDER(first)"
Harald Welte484160b2017-07-28 13:30:24 +0200331 };
332 type record PacketUlAckNack {
333 PageMode page_mode,
334 BIT2 msg_excape ('00'B),
335 uint5_t uplink_tfi,
336 BIT1 is_egprs ('0'B), /* msg escape */
337 UlAckNackGprs gprs optional
338 /* TODO: EGPRS */
339 } with { variant (gprs) "PRESENCE(is_egprs = '0'B)" };
340
341 /* 11.2.8 Packet Downlink Dummy Control Block */
342 type record PacketDlDummy {
343 PageMode page_mode,
344 BIT1 persistence_levels_present,
345 PersistenceLevels persistence_levels optional
346 } with {
347 variant (persistence_levels) "PRESENCE(persistence_levels_present = '1'B)"
348 };
349
Vadim Yanitskiy759cb292019-09-30 20:08:11 +0700350 /* 11.9 Global Power Control Parameters */
351 type record GlobalPwrCtrlParams {
352 uint4_t alpha,
353 uint5_t t_avg_v,
354 uint5_t t_avg_t,
355 uint4_t pb,
356 BIT1 pc_meas_chan,
357 BIT1 spare ('0'B),
358 uint4_t n_avg_i
359 };
360
361 /* 12.12a Global Packet Timing Advance */
362 type record TimingAdvanceIdxTN {
363 uint4_t ta_idx,
364 uint3_t ts_num
365 };
366 type record GlobalPacketTA {
367 BIT1 ta_val_presence,
368 uint4_t ta_val optional,
369 BIT1 ul_presence,
370 TimingAdvanceIdxTN ul optional,
371 BIT1 dl_presence,
372 TimingAdvanceIdxTN dl optional
373 } with {
374 variant (ta_val) "PRESENCE(ta_val_presence = '1'B)"
375 variant (ul) "PRESENCE(ul_presence = '1'B)"
376 variant (dl) "PRESENCE(dl_presence = '1'B)"
377 };
378
379 /* 11.2.13 Packet Power Control/Timing Advance */
380 type record PacketPwrControlTAMsg {
381 BIT1 g_pwr_ctrl_presence,
382 GlobalPwrCtrlParams g_pwr_ctrl optional,
383 BIT1 split,
384 BIT1 split_desc optional,
385 GlobalPacketTA g_pkt_ta optional,
386 PowerControlParameters pwr_ctrl optional
387 /* TODO: additions for R99, REL-7, REL-12 */
388 } with {
389 variant (g_pwr_ctrl) "PRESENCE(g_pwr_ctrl_presence = '1'B)"
390 variant (split_desc) "PRESENCE(split = '1'B)"
391 /* FIXME: Fancy coding: either both IEs together, or one of them */
392 variant (g_pkt_ta) "PRESENCE(split = '0'B, split_desc = '0'B)"
393 variant (pwr_ctrl) "PRESENCE(split = '0'B, split_desc = '1'B)"
394 };
395 type record PacketPwrControlTA {
396 PageMode page_mode,
397 NullGlobalTfi global_tfi,
398 /* See 11.1.3.3 'Message escape' error label
399 * 0 < Message body > ! < Message escape : 1 bit (*) = <no string> > */
400 BIT1 msg_escape,
401 PacketPwrControlTAMsg msg optional
402 } with {
403 variant (msg) "PRESENCE(msg_escape = '0'B)"
404 };
405
Harald Welte484160b2017-07-28 13:30:24 +0200406 /* 11.2.0.1 */
407 type union RlcmacDlCtrlUnion {
408 PacketDlAssignment dl_assignment,
409 PacketUlAssignment ul_assignment,
410 PacketPagingReq paging,
411 PacketUlAckNack ul_ack_nack,
Harald Welte422f0722017-08-01 00:27:06 +0200412 PacketDlDummy dl_dummy,
Vadim Yanitskiy759cb292019-09-30 20:08:11 +0700413 PacketPwrControlTA pwr_ta,
Harald Welte422f0722017-08-01 00:27:06 +0200414 octetstring other
Harald Welte484160b2017-07-28 13:30:24 +0200415 } with { variant "" };
416
417 type record RlcmacDlCtrlMsg {
418 RlcmacDlCtrlMsgType msg_type,
419 RlcmacDlCtrlUnion u
420 } with {
421 variant (u) "CROSSTAG(dl_assignment, msg_type = PACKET_DL_ASSIGNMENT;
422 ul_assignment, msg_type = PACKET_UL_ASSIGNMENT;
423 paging, msg_type = PACKET_PAGING_REQUEST;
424 ul_ack_nack, msg_type = PACKET_UL_ACK_NACK;
Harald Welte422f0722017-08-01 00:27:06 +0200425 dl_dummy, msg_type = PACKET_DL_DUMMY_CTRL;
Vadim Yanitskiy759cb292019-09-30 20:08:11 +0700426 pwr_ta, msg_type = PACKET_PWR_CONTROL_TA;
Harald Welte422f0722017-08-01 00:27:06 +0200427 other, OTHERWISE
Harald Welte484160b2017-07-28 13:30:24 +0200428 )"
429 };
430
431 external function enc_RlcmacDlCtrlMsg(in RlcmacDlCtrlMsg si) return octetstring
432 with { extension "prototype(convert) encode(RAW)" };
433 external function dec_RlcmacDlCtrlMsg(in octetstring stream) return RlcmacDlCtrlMsg
434 with { extension "prototype(convert) decode(RAW)" };
435
436
437 /* 11.2.6 Packet Downlikn Ack/Nack */
438 type record ILevel {
439 BIT1 presence,
440 uint4_t i_level optional
441 } with { variant (i_level) "PRESENCE(presence = '1'B)" };
442 type record length(8) of ILevel ILevels;
443 type record ChannelQualityReport {
444 uint6_t c_value,
445 uint3_t rxqual,
446 uint6_t sign_var,
447 ILevels i_levels
448 } with { variant "" };
449 type record PacketDlAckNack {
450 uint5_t dl_tfi,
451 AckNackDescription ack_nack_desc,
452 BIT1 chreq_desc_presence,
453 ChannelReqDescription chreq_desc optional,
454 ChannelQualityReport ch_qual_rep
455 } with { variant "" };
456
457 /* 11.2.2 Packet Control Acknowledgement */
458 type enumerated CtrlAck {
459 MS_RCVD_TWO_RLC_SAME_RTI_DIFF_RBSN_NEW_TFI ('00'B),
460 MS_RCVD_RBSN1_NO_RBSN0 ('01'B),
461 MS_RCVD_RBSN0_NO_RBSN1 ('10'B),
462 MS_RCVD_TWO_RLC_SAME_RTI_DIFF_RBSN ('11'B)
463 } with { variant "FIELDLENGTH(2)" };
464 type record PacketCtrlAck {
465 GprsTlli tlli,
466 CtrlAck ctrl_ack
467 /* TODO: Rel5 additions */
Harald Welteacc93ab2018-03-02 21:39:09 +0100468 } with { variant ""
469 variant (tlli) "BYTEORDER(first)"
470 };
Harald Welte484160b2017-07-28 13:30:24 +0200471
472 /* 1.2.8b Packet Uplink Dummy Control Block */
473 type record PacketUlDummy {
474 GprsTlli tlli
Harald Welteacc93ab2018-03-02 21:39:09 +0100475 } with { variant ""
476 variant (tlli) "BYTEORDER(first)"
477 };
Harald Welte484160b2017-07-28 13:30:24 +0200478
Pau Espin Pedrol8f245712020-04-24 18:47:30 +0200479 /* TS 44.060 sec 12.30 MS Radio Access Capability 2
480 * (for value part, see 3GPP TS 24.008 sec 10.5.5.12a and table 10.5.146) */
Vadim Yanitskiyc5248492019-09-14 16:11:33 +0200481 type union MSRadioAccCap2 {
Pau Espin Pedrol86904082019-12-30 20:21:00 +0100482 MSRadioAccessCapabilityV msRadioAccessCapabilityV
Vadim Yanitskiyc5248492019-09-14 16:11:33 +0200483 };
484
485 /* Table 11.2.16.2 Access Type */
486 type enumerated RlcAccessType {
487 RLC_ACC_TYPE_TWO_PHASE ('00'B),
488 RLC_ACC_TYPE_PAG_RESPONSE ('01'B),
489 RLC_ACC_TYPE_CELL_UPDATE ('10'B),
490 RLC_ACC_TYPE_MM ('11'B)
491 } with { variant "FIELDLENGTH(2)" };
492
493 type union PacketResourceReqID {
494 GlobalTfi gtfi,
495 GprsTlli tlli
496 } with { variant (tlli) "BYTEORDER(first)" };
497
498 /* 11.2.16 Packet Resource Request */
499 type record PacketResourceReq {
500 BIT1 acc_type_presence,
501 RlcAccessType acc_type optional,
502 BIT1 id_type,
503 PacketResourceReqID id,
504 BIT1 ms_rac2_presence,
505 MSRadioAccCap2 ms_rac2 optional,
506 ChannelReqDescription ch_req_desc,
507 BIT1 change_mark_presence,
508 BIT2 change_mark optional,
509 BIT6 C_val,
510 BIT1 sign_var_presence,
511 BIT6 sign_var optional,
512 ILevels I_levels
513 /* TODO: additional contents for further Releases (starting from 1999) */
514 } with {
515 variant (acc_type) "PRESENCE(acc_type_presence = '1'B)"
516 variant (id) "CROSSTAG(gtfi, id_type = '0'B; tlli, id_type = '1'B)"
517 variant (ms_rac2) "PRESENCE(ms_rac2_presence = '1'B)"
518 variant (change_mark) "PRESENCE(change_mark_presence = '1'B)"
519 variant (sign_var) "PRESENCE(sign_var_presence = '1'B)"
520 };
521
Harald Welte484160b2017-07-28 13:30:24 +0200522 /* 11.2.0.2 */
523 type union RlcmacUlCtrlUnion {
524 PacketCtrlAck ctrl_ack,
525 PacketDlAckNack dl_ack_nack,
Harald Welte422f0722017-08-01 00:27:06 +0200526 PacketUlDummy ul_dummy,
Vadim Yanitskiyc5248492019-09-14 16:11:33 +0200527 PacketResourceReq resource_req,
Harald Welte422f0722017-08-01 00:27:06 +0200528 octetstring other
Harald Welte484160b2017-07-28 13:30:24 +0200529 } with { variant "" };
530
531 type record RlcmacUlCtrlMsg {
532 RlcmacUlCtrlMsgType msg_type,
533 RlcmacUlCtrlUnion u
534 } with {
535 variant (u) "CROSSTAG(ctrl_ack, msg_type = PACKET_CONTROL_ACK;
536 dl_ack_nack, msg_type = PACKET_DL_ACK_NACK;
Harald Welte422f0722017-08-01 00:27:06 +0200537 ul_dummy, msg_type = PACKET_UL_DUMMY_CTRL;
Vadim Yanitskiyc5248492019-09-14 16:11:33 +0200538 resource_req, msg_type = PACKET_RESOURCE_REQUEST;
Harald Welte422f0722017-08-01 00:27:06 +0200539 other, OTHERWISE
Harald Welte484160b2017-07-28 13:30:24 +0200540 )"
541 };
542
543 external function enc_RlcmacUlCtrlMsg(in RlcmacUlCtrlMsg si) return octetstring
544 with { extension "prototype(convert) encode(RAW)" };
545 external function dec_RlcmacUlCtrlMsg(in octetstring stream) return RlcmacUlCtrlMsg
546 with { extension "prototype(convert) decode(RAW)" };
547
548 type bitstring ReceivedBlockBitmap length(64) with { variant "BYTEORDER(last)" };
549
550 /* 12.3 Ack/Nack Description */
551 type record AckNackDescription {
552 BIT1 final_ack,
553 uint7_t starting_seq_nr,
554 ReceivedBlockBitmap receive_block_bitmap
555 } with { variant "" };
556
557 /* 12.7 Channel Request Description */
558 type enumerated RlcMode {
559 RLC_MODE_ACKNOWLEDGED (0),
560 RLC_MODE_UNACKNOWLEDGED (1)
561 } with { variant "FIELDLENGTH(1)" };
562 type enumerated LlcPduType {
563 LLC_PDU_IS_SACK_OR_ACK (0),
564 LLC_PDU_IS_NOT_SACK_OR_ACK (1)
565 } with { variant "FIELDLENGTH(1)" };
566 type record ChannelReqDescription {
567 uint4_t peak_tput_class,
568 uint2_t priority,
569 RlcMode rlc_mode,
570 LlcPduType llc_pdu_type,
571 uint16_t RlcOctetCount
572 } with { variant "" };
573
574 /* 12.8 Frequency Parameters */
575 type record FreqIndirect {
576 uint6_t maio,
577 uint4_t ma_number,
578 BIT1 change_mark1_present,
579 uint2_t change_mark1 optional,
580 BIT1 change_mark2_present,
581 uint2_t change_mark2 optional
582 } with {
583 variant (change_mark1) "PRESENCE(change_mark1_present = '1'B)"
584 variant (change_mark2) "PRESENCE(change_mark2_present = '1'B)"
585 };
586 type record FreqDirect1 {
587 uint6_t maio,
588 GprsMobileAllication mobile_allocation
589 }
590 type record FreqDirect2 {
591 uint6_t maio,
592 uint6_t hsn,
593 uint4_t ma_freq_len,
594 octetstring m1_freq_list
595 } with {
596 /* FIXME: this can not be expressed in TTCN-3 ?!? */
597 //variant (ma_freq_len) "LENGTHTO(m1_freq_list)+3"
598 variant (ma_freq_len) "LENGTHTO(m1_freq_list)"
599 };
600 type record FrequencyParameters {
601 uint3_t tsc,
602 BIT2 presence,
603 uint10_t arfcn optional,
604 FreqIndirect indirect optional,
605 FreqDirect1 direct1 optional,
606 FreqDirect2 direct2 optional
607 } with {
608 variant (arfcn) "PRESENCE(presence = '00'B)"
609 variant (indirect) "PRESENCE(presence = '01'B)"
610 variant (direct1) "PRESENCE(presence = '10'B)"
611 variant (direct2) "PRESENCE(presence = '11'B)"
612 };
613
614 /* 12.10 Global TFI */
615 type record GlobalTfi {
616 boolean is_dl_tfi,
617 uint5_t tfi
618 } with { variant (is_dl_tfi) "FIELDLENGTH(1)" };
619
620 /* 12.10a GPRS Mobile Allocation */
621 type record RflNumberList {
622 uint4_t rfl_number,
623 BIT1 presence,
624 RflNumberList rfl_number_list optional
625 } with {
626 variant (rfl_number_list) "PRESENCE(presence = '1'B)"
627 };
628 type record GprsMobileAllication {
629 uint6_t hsn,
630 BIT1 rfl_number_list_present,
631 RflNumberList rfl_number_list optional,
632 BIT1 ma_present,
633 uint6_t ma_length optional,
634 bitstring ma_bitmap optional
635 /* TODO: ARFCN index list */
636 } with {
637 variant (rfl_number_list) "PRESENCE(rfl_number_list_present = '1'B)"
638 variant (ma_length) "PRESENCE(ma_present = '0'B)"
639 variant (ma_bitmap) "PRESENCE(ma_present = '0'B)"
640 /* FIXME: this can not be expressed in TTCN-3 ?!? */
641 //variant (ma_length) "LENGTHTO(ma_bitmap)+1"
642 variant (ma_length) "LENGTHTO(ma_bitmap)"
643 }
644
645 /* 12.11 Packet Request Reference */
646 type record PacketRequestReference {
647 uint11_t ra_info,
648 uint16_t frame_nr
649 } with { variant "" };
650
651 /* 12.12 Packet Timing Advance */
652 type record PacketTimingAdvance {
653 BIT1 val_present,
654 uint6_t val optional,
655 BIT1 idx_present,
656 uint4_t idx optional,
657 uint3_t timeslot_nr optional
658 } with {
659 variant (val) "PRESENCE(val_present = '1'B)"
660 variant (idx) "PRESENCE(idx_present = '1'B)"
661 variant (timeslot_nr) "PRESENCE(idx_present = '1'B)"
662 };
663
664 /* 12.13 Power Control Parameters */
665 type record ZeroOneGamma {
666 BIT1 gamma_present,
667 uint5_t gamma
668 } with {
669 variant (gamma) "PRESENCE (gamma_present = '1'B)"
670 };
671 type record length(8) of ZeroOneGamma ZeroOneGammas;
672 type record PowerControlParameters {
673 uint4_t alpha,
674 ZeroOneGammas gamma
675 } with { variant "" };
676
677 /* 12.14 Persistence Level */
678 type record length(4) of uint4_t PersistenceLevels;
679
680 /* 12.20 Page Mode */
681 type enumerated PageMode {
682 PAGE_MODE_NORMAL ('00'B),
683 PAGE_MODE_EXTENDED ('01'B),
684 PAGE_MODE_REORG ('10'B),
685 PAGE_MODE_SAME ('11'B)
686 } with { variant "FIELDLENGTH(2)" };
687
688 /* 12.21 Starting Frame Number */
689 type record StartingFnDesc {
690 BIT1 presence,
691 uint16_t absolute_starting_time optional,
692 uint13_t relative_k optional
693 } with {
694 variant (absolute_starting_time) "PRESENCE(presence = '0'B)"
695 variant (relative_k) "PRESENCE(presence = '1'B)"
696 };
697
Vadim Yanitskiy3911d112020-04-01 22:31:30 +0700698 /* 3GPP TS 44.060, table 11.2.5a.2 "EGPRS PACKET CHANNEL REQUEST" */
699 type union EGPRSPktChRequest {
700 EGPRSPktChRequest_MC5P2RB3 one_phase,
701 EGPRSPktChRequest_NOB3P2RB3 short, // deprecated
702 EGPRSPktChRequest_MCG3P2RB3 one_phase_red,
703 EGPRSPktChRequest_P2RB3 two_phase,
704 EGPRSPktChRequest_RB5 signalling,
705 EGPRSPktChRequest_RB5 one_phase_unack,
706 EGPRSPktChRequest_RB5 dedicated,
707 EGPRSPktChRequest_RB5 emergency,
708 EGPRSPktChRequest_P2RB3 two_phase_ipa,
709 EGPRSPktChRequest_RB5 signalling_ipa
710 } with {
711 variant "TAG (
712 one_phase, tag = '0'B;
713 short, tag = '100'B;
714 one_phase_red, tag = '101'B;
715 two_phase, tag = '110000'B;
716 signalling, tag = '110011'B;
717 one_phase_unack, tag = '110101'B;
718 dedicated, tag = '110110'B;
719 emergency, tag = '110111'B;
720 two_phase_ipa, tag = '111000'B;
721 signalling_ipa, tag = '111001'B;
722 )"
723 };
724
725 private type record EGPRSPktChRequest_MC5P2RB3 {
726 BIT1 tag,
727 BIT5 multislot_class,
728 BIT2 priority,
729 BIT3 random_bits
730 };
731
732 private type record EGPRSPktChRequest_NOB3P2RB3 {
733 BIT3 tag,
734 BIT3 nr_of_blocks,
735 BIT2 priority,
736 BIT3 random_bits
737 };
738
739 private type record EGPRSPktChRequest_MCG3P2RB3 {
740 BIT3 tag,
741 BIT3 multislot_class_group,
742 BIT2 priority,
743 BIT3 random_bits
744 };
745
746 private type record EGPRSPktChRequest_P2RB3 {
747 BIT6 tag,
748 BIT2 priority,
749 BIT3 random_bits
750 };
751
752 private type record EGPRSPktChRequest_RB5 {
753 BIT6 tag,
754 BIT5 random_bits
755 };
756
757 /* TITAN violates length restrictions on returned type, so we cannot do '... return BIT11'.
758 * Keep this function private as it returns octet-aligned bitstring (+5 padding bits). */
759 private external function enc_EGPRSPktChRequestInternal(in EGPRSPktChRequest req) return bitstring
760 with { extension "prototype(convert) encode(RAW)" };
761
762 function enc_EGPRSPktChRequest2bits(in EGPRSPktChRequest req) return BIT11
763 {
764 var bitstring ra11_pad := enc_EGPRSPktChRequestInternal(req);
765 return substr(ra11_pad, 0, 11); /* TITAN adds 5 padding bits */
766 }
767
768 function enc_EGPRSPktChRequest2uint(in EGPRSPktChRequest req) return uint16_t
769 {
770 var BIT11 ra11 := enc_EGPRSPktChRequest2bits(req);
771 return bit2int(ra11);
772 }
773
Harald Welte7024baa2018-03-02 23:37:51 +0100774
Harald Welte484160b2017-07-28 13:30:24 +0200775} with { encode "RAW"; variant "FIELDORDER(msb)" variant "BYTEORDER(last)" };