Harald Welte | 484160b | 2017-07-28 13:30:24 +0200 | [diff] [blame] | 1 | /* 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 Welte | 34b5a95 | 2019-05-27 11:54:11 +0200 | [diff] [blame] | 3 | * 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 Welte | 484160b | 2017-07-28 13:30:24 +0200 | [diff] [blame] | 15 | module RLCMAC_CSN1_Types { |
| 16 | import from General_Types all; |
| 17 | import from Osmocom_Types all; |
| 18 | import from GSM_Types all; |
Pau Espin Pedrol | 8690408 | 2019-12-30 20:21:00 +0100 | [diff] [blame] | 19 | import from MobileL3_GMM_SM_Types all; |
Harald Welte | 484160b | 2017-07-28 13:30:24 +0200 | [diff] [blame] | 20 | |
| 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 Yanitskiy | 759cb29 | 2019-09-30 20:08:11 +0700 | [diff] [blame] | 30 | PACKET_PWR_CONTROL_TA ('000101'B), |
Harald Welte | 484160b | 2017-07-28 13:30:24 +0200 | [diff] [blame] | 31 | /* 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 Pedrol | 2ec84fd | 2020-05-14 13:28:21 +0200 | [diff] [blame] | 59 | 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 Welte | 484160b | 2017-07-28 13:30:24 +0200 | [diff] [blame] | 108 | 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 Welte | acc93ab | 2018-03-02 21:39:09 +0100 | [diff] [blame] | 116 | } with { variant "" |
| 117 | variant (tlli) "BYTEORDER(first)" |
| 118 | }; |
Harald Welte | 484160b | 2017-07-28 13:30:24 +0200 | [diff] [blame] | 119 | |
| 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 Welte | acc93ab | 2018-03-02 21:39:09 +0100 | [diff] [blame] | 144 | } with { variant "" |
| 145 | variant (tlli) "BYTEORDER(first)" |
| 146 | }; |
Harald Welte | 484160b | 2017-07-28 13:30:24 +0200 | [diff] [blame] | 147 | 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 Pedrol | 45b664b | 2020-05-14 15:16:40 +0200 | [diff] [blame] | 236 | type record COMPACTreducedMA { |
| 237 | uint7_t ma_bitmap_length, |
| 238 | bitstring ma_bitmap, |
| 239 | BIT1 maio_2_present, |
| 240 | BIT6 maio_2 |
| 241 | } with { |
| 242 | variant (ma_bitmap_length) "LENGTHTO (ma_bitmap)" |
| 243 | variant (ma_bitmap_length) "UNIT(bits)" |
| 244 | variant (maio_2) "PRESENCE(maio_2_present = '1'B)" |
| 245 | }; |
Pau Espin Pedrol | 2ec84fd | 2020-05-14 13:28:21 +0200 | [diff] [blame] | 246 | type record of AccessTechnologiesRequest AccessTechnologiesRequestRepetition |
| 247 | with { variant "EXTENSION_BIT(reverse)" }; |
| 248 | type record AccessTechnologiesRequest |
| 249 | { |
| 250 | BIT4 accessTechnType, |
| 251 | BIT1 extensionBit |
| 252 | } with { variant "FIELDORDER(msb)" }; |
Pau Espin Pedrol | 45b664b | 2020-05-14 15:16:40 +0200 | [diff] [blame] | 253 | type record MultiBlockAllocation { |
| 254 | uint3_t timeslot_nr, |
| 255 | BIT1 alpha_gamma_present, |
| 256 | uint4_t alpha optional, |
| 257 | uint5_t gamma_tn optional, |
| 258 | BIT1 p0_present, |
| 259 | uint4_t p0 optional, |
| 260 | BIT1 reserved ('0'B) optional, |
| 261 | BIT1 pr_mode optional, |
| 262 | StartingFnDesc tbf_starting_time, |
| 263 | uint2_t num_radio_blocks_alloc |
| 264 | } with { |
| 265 | variant (alpha) "PRESENCE(alpha_gamma_present = '1'B)" |
| 266 | variant (gamma_tn) "PRESENCE(alpha_gamma_present = '1'B)" |
| 267 | variant (p0) "PRESENCE(p0_present = '1'B)" |
| 268 | variant (reserved) "PRESENCE(p0_present = '1'B)" |
| 269 | variant (pr_mode) "PRESENCE(p0_present = '1'B)" |
| 270 | }; |
| 271 | type record PktUlAssEgprs { |
| 272 | BIT2 dual_carrier('00'B), /*TODO 01 -- Message escape for dual carrier, RTTI, BTTI with FANR activated, EGPRS2 */ |
| 273 | BIT1 tlli_present, |
| 274 | GprsTlli tlli optional, |
| 275 | BIT1 compact_reduced_ma_present, |
| 276 | COMPACTreducedMA compact_reduced_ma optional, |
| 277 | EgprsChCodingCommand chan_coding_cmd, |
| 278 | BIT1 resegment, |
| 279 | EgprsWindowSize window_size, |
| 280 | BIT1 ats_present, |
| 281 | AccessTechnologiesRequestRepetition ats optional, /* ? */ |
| 282 | BIT1 arac_retrans_req, |
| 283 | BIT1 tlli_block_chan_coding, |
| 284 | BIT1 bep_period2_present, |
| 285 | BIT4 bep_period2 optional, |
| 286 | PacketTimingAdvance pkt_ta, |
| 287 | BIT1 pkt_ext_ta_present, |
| 288 | BIT2 pkt_ext_ta optional, |
| 289 | BIT1 freq_par_present, |
| 290 | FrequencyParameters freq_par optional, |
| 291 | BIT2 alloc_present, |
| 292 | DynamicAllocation dyn_block_alloc optional, |
| 293 | MultiBlockAllocation multi_block_alloc optional |
| 294 | /* TODO: Additions for Rel-5 and more */ |
| 295 | } with { |
| 296 | variant (tlli) "PRESENCE(tlli_present = '1'B)" |
| 297 | variant (compact_reduced_ma) "PRESENCE(compact_reduced_ma_present = '1'B)" |
| 298 | variant (ats) "PRESENCE(ats_present = '1'B)" |
| 299 | variant (bep_period2) "PRESENCE(bep_period2_present = '1'B)" |
| 300 | variant (pkt_ext_ta) "PRESENCE(pkt_ext_ta_present = '1'B)" |
| 301 | variant (freq_par) "PRESENCE(freq_par_present = '1'B)" |
| 302 | variant (dyn_block_alloc) "PRESENCE(alloc_present = '01'B)" |
| 303 | variant (multi_block_alloc) "PRESENCE(alloc_present = '10'B)" |
| 304 | }; |
Harald Welte | 484160b | 2017-07-28 13:30:24 +0200 | [diff] [blame] | 305 | type record PacketUlAssignment { |
| 306 | PageMode page_mode, |
| 307 | BIT1 persistence_levels_present, |
| 308 | PersistenceLevels persistence_levels optional, |
| 309 | PktUlAssUnion identity, |
| 310 | BIT1 is_egprs, /* msg escape */ |
Pau Espin Pedrol | 45b664b | 2020-05-14 15:16:40 +0200 | [diff] [blame] | 311 | PktUlAssGprs gprs optional, |
| 312 | PktUlAssEgprs egprs optional |
| 313 | /* TODO: Table 11.2.29.1: PACKET UPLINK ASSIGNMENT information elements |
| 314 | https://www.etsi.org/deliver/etsi_ts/144000_144099/144060/09.03.00_60/ts_144060v090300p.pdf */ |
Harald Welte | 484160b | 2017-07-28 13:30:24 +0200 | [diff] [blame] | 315 | } with { |
| 316 | variant (persistence_levels) "PRESENCE(persistence_levels_present = '1'B)" |
| 317 | variant (gprs) "PRESENCE(is_egprs = '0'B)" |
Pau Espin Pedrol | 45b664b | 2020-05-14 15:16:40 +0200 | [diff] [blame] | 318 | variant (egprs) "PRESENCE(is_egprs = '1'B)" |
Harald Welte | 484160b | 2017-07-28 13:30:24 +0200 | [diff] [blame] | 319 | }; |
| 320 | |
| 321 | /* 11.2.10 Packet Paging Request */ |
Stefan Sperling | 59c15d6 | 2018-10-10 11:09:25 +0200 | [diff] [blame] | 322 | type record MobileIdentityLV_Paging { |
| 323 | /* Note that the size of 'len' differs from that of the Mobile Identify IE |
| 324 | * as defined in 3GPP TS 24.008 10.5.1.4 "Mobile Identity"; Paging Requests |
| 325 | * use only 4 bit to encode the length of a mobile identity, whereas the IE |
| 326 | * uses a byte. */ |
Harald Welte | 484160b | 2017-07-28 13:30:24 +0200 | [diff] [blame] | 327 | uint4_t len, |
| 328 | octetstring mobile_id |
Vadim Yanitskiy | 322c793 | 2020-01-01 23:03:47 +0100 | [diff] [blame] | 329 | } with { |
| 330 | variant (len) "LENGTHTO(mobile_id)" |
| 331 | variant (mobile_id) "BYTEORDER(first)" |
| 332 | }; |
Harald Welte | 484160b | 2017-07-28 13:30:24 +0200 | [diff] [blame] | 333 | type record PageInfoPs { |
| 334 | BIT1 presence ('0'B), |
| 335 | BIT1 ptmsi_or_mobile_id, |
| 336 | GsmTmsi ptmsi optional, |
Stefan Sperling | 59c15d6 | 2018-10-10 11:09:25 +0200 | [diff] [blame] | 337 | MobileIdentityLV_Paging mobile_identity optional |
Harald Welte | 484160b | 2017-07-28 13:30:24 +0200 | [diff] [blame] | 338 | } with { |
| 339 | variant (ptmsi) "PRESENCE(ptmsi_or_mobile_id = '0'B)" |
| 340 | variant (mobile_identity) "PRESENCE(ptmsi_or_mobile_id = '1'B)" |
| 341 | }; |
| 342 | type record PageInfoCs { |
| 343 | BIT1 presence ('1'B), |
| 344 | BIT1 tmsi_or_mobile_id, |
| 345 | GsmTmsi tmsi optional, |
Stefan Sperling | 59c15d6 | 2018-10-10 11:09:25 +0200 | [diff] [blame] | 346 | MobileIdentityLV_Paging mobile_identity optional, |
Harald Welte | 484160b | 2017-07-28 13:30:24 +0200 | [diff] [blame] | 347 | ChannelNeeded chan_needed, |
| 348 | BIT1 emlpp_prio_present, |
| 349 | uint3_t emlpp_prio optional |
| 350 | } with { |
| 351 | variant (tmsi) "PRESENCE(tmsi_or_mobile_id = '0'B)" |
| 352 | variant (mobile_identity) "PRESENCE(tmsi_or_mobile_id = '1'B)" |
| 353 | variant (emlpp_prio) "PRESENCE(emlpp_prio_present = '1'B)" |
| 354 | }; |
| 355 | type union PageInfo { |
| 356 | PageInfoPs ps, |
| 357 | PageInfoCs cs |
Vadim Yanitskiy | 5e51873 | 2020-01-01 21:27:18 +0100 | [diff] [blame] | 358 | } with { |
| 359 | variant "TAG(ps, presence = '0'B; cs, presence = '1'B)" |
Harald Welte | 484160b | 2017-07-28 13:30:24 +0200 | [diff] [blame] | 360 | }; |
| 361 | type record PacketPagingReq { |
| 362 | PageMode page_mode, |
| 363 | BIT1 persistence_levels_present, |
| 364 | PersistenceLevels persistence_levels optional, |
| 365 | BIT1 nln_present, |
Oliver Smith | 8f9daab | 2019-10-09 09:27:19 +0200 | [diff] [blame] | 366 | uint2_t nln optional, |
| 367 | BIT1 repeated_pageinfo_present, |
| 368 | PageInfo repeated_pageinfo optional |
Harald Welte | 484160b | 2017-07-28 13:30:24 +0200 | [diff] [blame] | 369 | } with { |
| 370 | variant (persistence_levels) "PRESENCE(persistence_levels_present = '1'B)" |
| 371 | variant (nln) "PRESENCE(nln_present = '1'B)" |
Oliver Smith | 8f9daab | 2019-10-09 09:27:19 +0200 | [diff] [blame] | 372 | variant (repeated_pageinfo) "PRESENCE(repeated_pageinfo_present = '1'B)" |
Harald Welte | 484160b | 2017-07-28 13:30:24 +0200 | [diff] [blame] | 373 | }; |
| 374 | |
| 375 | /* 11.2.28 Uplink Ack/Nack */ |
| 376 | type enumerated ChCodingCommand { |
| 377 | CH_CODING_CS1 ('00'B), |
| 378 | CH_CODING_CS2 ('01'B), |
| 379 | CH_CODING_CS3 ('10'B), |
| 380 | CH_CODING_CS4 ('11'B) |
| 381 | } with { variant "FIELDLENGTH(2)" }; |
| 382 | type record UlAckNackGprs { |
| 383 | ChCodingCommand ch_coding_cmd, |
| 384 | AckNackDescription ack_nack_desc, |
| 385 | BIT1 cont_res_tlli_present, |
| 386 | GprsTlli cont_res_tlli optional, |
| 387 | BIT1 pkt_ta_present, |
| 388 | PacketTimingAdvance pkt_ta optional, |
| 389 | BIT1 pwr_ctrl_present, |
| 390 | PowerControlParameters pwr_ctrl optional |
| 391 | /* TODO: Extension Bits, Rel5 ,... */ |
| 392 | } with { |
| 393 | variant (cont_res_tlli) "PRESENCE(cont_res_tlli_present = '1'B)" |
| 394 | variant (pkt_ta) "PRESENCE(pkt_ta_present = '1'B)" |
| 395 | variant (pwr_ctrl) "PRESENCE(pwr_ctrl_present = '1'B)" |
Harald Welte | acc93ab | 2018-03-02 21:39:09 +0100 | [diff] [blame] | 396 | variant (cont_res_tlli) "BYTEORDER(first)" |
Harald Welte | 484160b | 2017-07-28 13:30:24 +0200 | [diff] [blame] | 397 | }; |
| 398 | type record PacketUlAckNack { |
| 399 | PageMode page_mode, |
| 400 | BIT2 msg_excape ('00'B), |
| 401 | uint5_t uplink_tfi, |
| 402 | BIT1 is_egprs ('0'B), /* msg escape */ |
| 403 | UlAckNackGprs gprs optional |
| 404 | /* TODO: EGPRS */ |
| 405 | } with { variant (gprs) "PRESENCE(is_egprs = '0'B)" }; |
| 406 | |
| 407 | /* 11.2.8 Packet Downlink Dummy Control Block */ |
| 408 | type record PacketDlDummy { |
| 409 | PageMode page_mode, |
| 410 | BIT1 persistence_levels_present, |
| 411 | PersistenceLevels persistence_levels optional |
| 412 | } with { |
| 413 | variant (persistence_levels) "PRESENCE(persistence_levels_present = '1'B)" |
| 414 | }; |
| 415 | |
Vadim Yanitskiy | 759cb29 | 2019-09-30 20:08:11 +0700 | [diff] [blame] | 416 | /* 11.9 Global Power Control Parameters */ |
| 417 | type record GlobalPwrCtrlParams { |
| 418 | uint4_t alpha, |
| 419 | uint5_t t_avg_v, |
| 420 | uint5_t t_avg_t, |
| 421 | uint4_t pb, |
| 422 | BIT1 pc_meas_chan, |
| 423 | BIT1 spare ('0'B), |
| 424 | uint4_t n_avg_i |
| 425 | }; |
| 426 | |
| 427 | /* 12.12a Global Packet Timing Advance */ |
| 428 | type record TimingAdvanceIdxTN { |
| 429 | uint4_t ta_idx, |
| 430 | uint3_t ts_num |
| 431 | }; |
| 432 | type record GlobalPacketTA { |
| 433 | BIT1 ta_val_presence, |
| 434 | uint4_t ta_val optional, |
| 435 | BIT1 ul_presence, |
| 436 | TimingAdvanceIdxTN ul optional, |
| 437 | BIT1 dl_presence, |
| 438 | TimingAdvanceIdxTN dl optional |
| 439 | } with { |
| 440 | variant (ta_val) "PRESENCE(ta_val_presence = '1'B)" |
| 441 | variant (ul) "PRESENCE(ul_presence = '1'B)" |
| 442 | variant (dl) "PRESENCE(dl_presence = '1'B)" |
| 443 | }; |
| 444 | |
| 445 | /* 11.2.13 Packet Power Control/Timing Advance */ |
| 446 | type record PacketPwrControlTAMsg { |
| 447 | BIT1 g_pwr_ctrl_presence, |
| 448 | GlobalPwrCtrlParams g_pwr_ctrl optional, |
| 449 | BIT1 split, |
| 450 | BIT1 split_desc optional, |
| 451 | GlobalPacketTA g_pkt_ta optional, |
| 452 | PowerControlParameters pwr_ctrl optional |
| 453 | /* TODO: additions for R99, REL-7, REL-12 */ |
| 454 | } with { |
| 455 | variant (g_pwr_ctrl) "PRESENCE(g_pwr_ctrl_presence = '1'B)" |
| 456 | variant (split_desc) "PRESENCE(split = '1'B)" |
| 457 | /* FIXME: Fancy coding: either both IEs together, or one of them */ |
| 458 | variant (g_pkt_ta) "PRESENCE(split = '0'B, split_desc = '0'B)" |
| 459 | variant (pwr_ctrl) "PRESENCE(split = '0'B, split_desc = '1'B)" |
| 460 | }; |
| 461 | type record PacketPwrControlTA { |
| 462 | PageMode page_mode, |
| 463 | NullGlobalTfi global_tfi, |
| 464 | /* See 11.1.3.3 'Message escape' error label |
| 465 | * 0 < Message body > ! < Message escape : 1 bit (*) = <no string> > */ |
| 466 | BIT1 msg_escape, |
| 467 | PacketPwrControlTAMsg msg optional |
| 468 | } with { |
| 469 | variant (msg) "PRESENCE(msg_escape = '0'B)" |
| 470 | }; |
| 471 | |
Harald Welte | 484160b | 2017-07-28 13:30:24 +0200 | [diff] [blame] | 472 | /* 11.2.0.1 */ |
| 473 | type union RlcmacDlCtrlUnion { |
| 474 | PacketDlAssignment dl_assignment, |
| 475 | PacketUlAssignment ul_assignment, |
| 476 | PacketPagingReq paging, |
| 477 | PacketUlAckNack ul_ack_nack, |
Harald Welte | 422f072 | 2017-08-01 00:27:06 +0200 | [diff] [blame] | 478 | PacketDlDummy dl_dummy, |
Vadim Yanitskiy | 759cb29 | 2019-09-30 20:08:11 +0700 | [diff] [blame] | 479 | PacketPwrControlTA pwr_ta, |
Harald Welte | 422f072 | 2017-08-01 00:27:06 +0200 | [diff] [blame] | 480 | octetstring other |
Harald Welte | 484160b | 2017-07-28 13:30:24 +0200 | [diff] [blame] | 481 | } with { variant "" }; |
| 482 | |
| 483 | type record RlcmacDlCtrlMsg { |
| 484 | RlcmacDlCtrlMsgType msg_type, |
| 485 | RlcmacDlCtrlUnion u |
| 486 | } with { |
| 487 | variant (u) "CROSSTAG(dl_assignment, msg_type = PACKET_DL_ASSIGNMENT; |
| 488 | ul_assignment, msg_type = PACKET_UL_ASSIGNMENT; |
| 489 | paging, msg_type = PACKET_PAGING_REQUEST; |
| 490 | ul_ack_nack, msg_type = PACKET_UL_ACK_NACK; |
Harald Welte | 422f072 | 2017-08-01 00:27:06 +0200 | [diff] [blame] | 491 | dl_dummy, msg_type = PACKET_DL_DUMMY_CTRL; |
Vadim Yanitskiy | 759cb29 | 2019-09-30 20:08:11 +0700 | [diff] [blame] | 492 | pwr_ta, msg_type = PACKET_PWR_CONTROL_TA; |
Harald Welte | 422f072 | 2017-08-01 00:27:06 +0200 | [diff] [blame] | 493 | other, OTHERWISE |
Harald Welte | 484160b | 2017-07-28 13:30:24 +0200 | [diff] [blame] | 494 | )" |
| 495 | }; |
| 496 | |
| 497 | external function enc_RlcmacDlCtrlMsg(in RlcmacDlCtrlMsg si) return octetstring |
| 498 | with { extension "prototype(convert) encode(RAW)" }; |
| 499 | external function dec_RlcmacDlCtrlMsg(in octetstring stream) return RlcmacDlCtrlMsg |
| 500 | with { extension "prototype(convert) decode(RAW)" }; |
| 501 | |
| 502 | |
| 503 | /* 11.2.6 Packet Downlikn Ack/Nack */ |
| 504 | type record ILevel { |
| 505 | BIT1 presence, |
| 506 | uint4_t i_level optional |
| 507 | } with { variant (i_level) "PRESENCE(presence = '1'B)" }; |
| 508 | type record length(8) of ILevel ILevels; |
| 509 | type record ChannelQualityReport { |
| 510 | uint6_t c_value, |
| 511 | uint3_t rxqual, |
| 512 | uint6_t sign_var, |
| 513 | ILevels i_levels |
| 514 | } with { variant "" }; |
| 515 | type record PacketDlAckNack { |
| 516 | uint5_t dl_tfi, |
| 517 | AckNackDescription ack_nack_desc, |
| 518 | BIT1 chreq_desc_presence, |
| 519 | ChannelReqDescription chreq_desc optional, |
| 520 | ChannelQualityReport ch_qual_rep |
| 521 | } with { variant "" }; |
| 522 | |
| 523 | /* 11.2.2 Packet Control Acknowledgement */ |
| 524 | type enumerated CtrlAck { |
| 525 | MS_RCVD_TWO_RLC_SAME_RTI_DIFF_RBSN_NEW_TFI ('00'B), |
| 526 | MS_RCVD_RBSN1_NO_RBSN0 ('01'B), |
| 527 | MS_RCVD_RBSN0_NO_RBSN1 ('10'B), |
| 528 | MS_RCVD_TWO_RLC_SAME_RTI_DIFF_RBSN ('11'B) |
| 529 | } with { variant "FIELDLENGTH(2)" }; |
| 530 | type record PacketCtrlAck { |
| 531 | GprsTlli tlli, |
| 532 | CtrlAck ctrl_ack |
| 533 | /* TODO: Rel5 additions */ |
Harald Welte | acc93ab | 2018-03-02 21:39:09 +0100 | [diff] [blame] | 534 | } with { variant "" |
| 535 | variant (tlli) "BYTEORDER(first)" |
| 536 | }; |
Harald Welte | 484160b | 2017-07-28 13:30:24 +0200 | [diff] [blame] | 537 | |
| 538 | /* 1.2.8b Packet Uplink Dummy Control Block */ |
| 539 | type record PacketUlDummy { |
| 540 | GprsTlli tlli |
Harald Welte | acc93ab | 2018-03-02 21:39:09 +0100 | [diff] [blame] | 541 | } with { variant "" |
| 542 | variant (tlli) "BYTEORDER(first)" |
| 543 | }; |
Harald Welte | 484160b | 2017-07-28 13:30:24 +0200 | [diff] [blame] | 544 | |
Pau Espin Pedrol | 8f24571 | 2020-04-24 18:47:30 +0200 | [diff] [blame] | 545 | /* TS 44.060 sec 12.30 MS Radio Access Capability 2 |
| 546 | * (for value part, see 3GPP TS 24.008 sec 10.5.5.12a and table 10.5.146) */ |
Vadim Yanitskiy | c524849 | 2019-09-14 16:11:33 +0200 | [diff] [blame] | 547 | type union MSRadioAccCap2 { |
Pau Espin Pedrol | 8690408 | 2019-12-30 20:21:00 +0100 | [diff] [blame] | 548 | MSRadioAccessCapabilityV msRadioAccessCapabilityV |
Vadim Yanitskiy | c524849 | 2019-09-14 16:11:33 +0200 | [diff] [blame] | 549 | }; |
| 550 | |
| 551 | /* Table 11.2.16.2 Access Type */ |
| 552 | type enumerated RlcAccessType { |
| 553 | RLC_ACC_TYPE_TWO_PHASE ('00'B), |
| 554 | RLC_ACC_TYPE_PAG_RESPONSE ('01'B), |
| 555 | RLC_ACC_TYPE_CELL_UPDATE ('10'B), |
| 556 | RLC_ACC_TYPE_MM ('11'B) |
| 557 | } with { variant "FIELDLENGTH(2)" }; |
| 558 | |
| 559 | type union PacketResourceReqID { |
| 560 | GlobalTfi gtfi, |
| 561 | GprsTlli tlli |
| 562 | } with { variant (tlli) "BYTEORDER(first)" }; |
| 563 | |
| 564 | /* 11.2.16 Packet Resource Request */ |
| 565 | type record PacketResourceReq { |
| 566 | BIT1 acc_type_presence, |
| 567 | RlcAccessType acc_type optional, |
| 568 | BIT1 id_type, |
| 569 | PacketResourceReqID id, |
| 570 | BIT1 ms_rac2_presence, |
| 571 | MSRadioAccCap2 ms_rac2 optional, |
| 572 | ChannelReqDescription ch_req_desc, |
| 573 | BIT1 change_mark_presence, |
| 574 | BIT2 change_mark optional, |
| 575 | BIT6 C_val, |
| 576 | BIT1 sign_var_presence, |
| 577 | BIT6 sign_var optional, |
| 578 | ILevels I_levels |
| 579 | /* TODO: additional contents for further Releases (starting from 1999) */ |
| 580 | } with { |
| 581 | variant (acc_type) "PRESENCE(acc_type_presence = '1'B)" |
| 582 | variant (id) "CROSSTAG(gtfi, id_type = '0'B; tlli, id_type = '1'B)" |
| 583 | variant (ms_rac2) "PRESENCE(ms_rac2_presence = '1'B)" |
| 584 | variant (change_mark) "PRESENCE(change_mark_presence = '1'B)" |
| 585 | variant (sign_var) "PRESENCE(sign_var_presence = '1'B)" |
| 586 | }; |
| 587 | |
Harald Welte | 484160b | 2017-07-28 13:30:24 +0200 | [diff] [blame] | 588 | /* 11.2.0.2 */ |
| 589 | type union RlcmacUlCtrlUnion { |
| 590 | PacketCtrlAck ctrl_ack, |
| 591 | PacketDlAckNack dl_ack_nack, |
Harald Welte | 422f072 | 2017-08-01 00:27:06 +0200 | [diff] [blame] | 592 | PacketUlDummy ul_dummy, |
Vadim Yanitskiy | c524849 | 2019-09-14 16:11:33 +0200 | [diff] [blame] | 593 | PacketResourceReq resource_req, |
Harald Welte | 422f072 | 2017-08-01 00:27:06 +0200 | [diff] [blame] | 594 | octetstring other |
Harald Welte | 484160b | 2017-07-28 13:30:24 +0200 | [diff] [blame] | 595 | } with { variant "" }; |
| 596 | |
| 597 | type record RlcmacUlCtrlMsg { |
| 598 | RlcmacUlCtrlMsgType msg_type, |
| 599 | RlcmacUlCtrlUnion u |
| 600 | } with { |
| 601 | variant (u) "CROSSTAG(ctrl_ack, msg_type = PACKET_CONTROL_ACK; |
| 602 | dl_ack_nack, msg_type = PACKET_DL_ACK_NACK; |
Harald Welte | 422f072 | 2017-08-01 00:27:06 +0200 | [diff] [blame] | 603 | ul_dummy, msg_type = PACKET_UL_DUMMY_CTRL; |
Vadim Yanitskiy | c524849 | 2019-09-14 16:11:33 +0200 | [diff] [blame] | 604 | resource_req, msg_type = PACKET_RESOURCE_REQUEST; |
Harald Welte | 422f072 | 2017-08-01 00:27:06 +0200 | [diff] [blame] | 605 | other, OTHERWISE |
Harald Welte | 484160b | 2017-07-28 13:30:24 +0200 | [diff] [blame] | 606 | )" |
| 607 | }; |
| 608 | |
| 609 | external function enc_RlcmacUlCtrlMsg(in RlcmacUlCtrlMsg si) return octetstring |
| 610 | with { extension "prototype(convert) encode(RAW)" }; |
| 611 | external function dec_RlcmacUlCtrlMsg(in octetstring stream) return RlcmacUlCtrlMsg |
| 612 | with { extension "prototype(convert) decode(RAW)" }; |
| 613 | |
| 614 | type bitstring ReceivedBlockBitmap length(64) with { variant "BYTEORDER(last)" }; |
| 615 | |
| 616 | /* 12.3 Ack/Nack Description */ |
| 617 | type record AckNackDescription { |
| 618 | BIT1 final_ack, |
| 619 | uint7_t starting_seq_nr, |
| 620 | ReceivedBlockBitmap receive_block_bitmap |
| 621 | } with { variant "" }; |
| 622 | |
| 623 | /* 12.7 Channel Request Description */ |
| 624 | type enumerated RlcMode { |
| 625 | RLC_MODE_ACKNOWLEDGED (0), |
| 626 | RLC_MODE_UNACKNOWLEDGED (1) |
| 627 | } with { variant "FIELDLENGTH(1)" }; |
| 628 | type enumerated LlcPduType { |
| 629 | LLC_PDU_IS_SACK_OR_ACK (0), |
| 630 | LLC_PDU_IS_NOT_SACK_OR_ACK (1) |
| 631 | } with { variant "FIELDLENGTH(1)" }; |
| 632 | type record ChannelReqDescription { |
| 633 | uint4_t peak_tput_class, |
| 634 | uint2_t priority, |
| 635 | RlcMode rlc_mode, |
| 636 | LlcPduType llc_pdu_type, |
| 637 | uint16_t RlcOctetCount |
| 638 | } with { variant "" }; |
| 639 | |
| 640 | /* 12.8 Frequency Parameters */ |
| 641 | type record FreqIndirect { |
| 642 | uint6_t maio, |
| 643 | uint4_t ma_number, |
| 644 | BIT1 change_mark1_present, |
| 645 | uint2_t change_mark1 optional, |
| 646 | BIT1 change_mark2_present, |
| 647 | uint2_t change_mark2 optional |
| 648 | } with { |
| 649 | variant (change_mark1) "PRESENCE(change_mark1_present = '1'B)" |
| 650 | variant (change_mark2) "PRESENCE(change_mark2_present = '1'B)" |
| 651 | }; |
| 652 | type record FreqDirect1 { |
| 653 | uint6_t maio, |
| 654 | GprsMobileAllication mobile_allocation |
| 655 | } |
| 656 | type record FreqDirect2 { |
| 657 | uint6_t maio, |
| 658 | uint6_t hsn, |
| 659 | uint4_t ma_freq_len, |
| 660 | octetstring m1_freq_list |
| 661 | } with { |
| 662 | /* FIXME: this can not be expressed in TTCN-3 ?!? */ |
| 663 | //variant (ma_freq_len) "LENGTHTO(m1_freq_list)+3" |
| 664 | variant (ma_freq_len) "LENGTHTO(m1_freq_list)" |
| 665 | }; |
| 666 | type record FrequencyParameters { |
| 667 | uint3_t tsc, |
| 668 | BIT2 presence, |
| 669 | uint10_t arfcn optional, |
| 670 | FreqIndirect indirect optional, |
| 671 | FreqDirect1 direct1 optional, |
| 672 | FreqDirect2 direct2 optional |
| 673 | } with { |
| 674 | variant (arfcn) "PRESENCE(presence = '00'B)" |
| 675 | variant (indirect) "PRESENCE(presence = '01'B)" |
| 676 | variant (direct1) "PRESENCE(presence = '10'B)" |
| 677 | variant (direct2) "PRESENCE(presence = '11'B)" |
| 678 | }; |
| 679 | |
| 680 | /* 12.10 Global TFI */ |
| 681 | type record GlobalTfi { |
| 682 | boolean is_dl_tfi, |
| 683 | uint5_t tfi |
| 684 | } with { variant (is_dl_tfi) "FIELDLENGTH(1)" }; |
| 685 | |
| 686 | /* 12.10a GPRS Mobile Allocation */ |
| 687 | type record RflNumberList { |
| 688 | uint4_t rfl_number, |
| 689 | BIT1 presence, |
| 690 | RflNumberList rfl_number_list optional |
| 691 | } with { |
| 692 | variant (rfl_number_list) "PRESENCE(presence = '1'B)" |
| 693 | }; |
| 694 | type record GprsMobileAllication { |
| 695 | uint6_t hsn, |
| 696 | BIT1 rfl_number_list_present, |
| 697 | RflNumberList rfl_number_list optional, |
| 698 | BIT1 ma_present, |
| 699 | uint6_t ma_length optional, |
| 700 | bitstring ma_bitmap optional |
| 701 | /* TODO: ARFCN index list */ |
| 702 | } with { |
| 703 | variant (rfl_number_list) "PRESENCE(rfl_number_list_present = '1'B)" |
| 704 | variant (ma_length) "PRESENCE(ma_present = '0'B)" |
| 705 | variant (ma_bitmap) "PRESENCE(ma_present = '0'B)" |
| 706 | /* FIXME: this can not be expressed in TTCN-3 ?!? */ |
| 707 | //variant (ma_length) "LENGTHTO(ma_bitmap)+1" |
| 708 | variant (ma_length) "LENGTHTO(ma_bitmap)" |
| 709 | } |
| 710 | |
| 711 | /* 12.11 Packet Request Reference */ |
| 712 | type record PacketRequestReference { |
| 713 | uint11_t ra_info, |
| 714 | uint16_t frame_nr |
| 715 | } with { variant "" }; |
| 716 | |
| 717 | /* 12.12 Packet Timing Advance */ |
| 718 | type record PacketTimingAdvance { |
| 719 | BIT1 val_present, |
| 720 | uint6_t val optional, |
| 721 | BIT1 idx_present, |
| 722 | uint4_t idx optional, |
| 723 | uint3_t timeslot_nr optional |
| 724 | } with { |
| 725 | variant (val) "PRESENCE(val_present = '1'B)" |
| 726 | variant (idx) "PRESENCE(idx_present = '1'B)" |
| 727 | variant (timeslot_nr) "PRESENCE(idx_present = '1'B)" |
| 728 | }; |
| 729 | |
| 730 | /* 12.13 Power Control Parameters */ |
| 731 | type record ZeroOneGamma { |
| 732 | BIT1 gamma_present, |
| 733 | uint5_t gamma |
| 734 | } with { |
| 735 | variant (gamma) "PRESENCE (gamma_present = '1'B)" |
| 736 | }; |
| 737 | type record length(8) of ZeroOneGamma ZeroOneGammas; |
| 738 | type record PowerControlParameters { |
| 739 | uint4_t alpha, |
| 740 | ZeroOneGammas gamma |
| 741 | } with { variant "" }; |
| 742 | |
| 743 | /* 12.14 Persistence Level */ |
| 744 | type record length(4) of uint4_t PersistenceLevels; |
| 745 | |
| 746 | /* 12.20 Page Mode */ |
| 747 | type enumerated PageMode { |
| 748 | PAGE_MODE_NORMAL ('00'B), |
| 749 | PAGE_MODE_EXTENDED ('01'B), |
| 750 | PAGE_MODE_REORG ('10'B), |
| 751 | PAGE_MODE_SAME ('11'B) |
| 752 | } with { variant "FIELDLENGTH(2)" }; |
| 753 | |
| 754 | /* 12.21 Starting Frame Number */ |
| 755 | type record StartingFnDesc { |
| 756 | BIT1 presence, |
| 757 | uint16_t absolute_starting_time optional, |
| 758 | uint13_t relative_k optional |
| 759 | } with { |
| 760 | variant (absolute_starting_time) "PRESENCE(presence = '0'B)" |
| 761 | variant (relative_k) "PRESENCE(presence = '1'B)" |
| 762 | }; |
| 763 | |
Vadim Yanitskiy | 3911d11 | 2020-04-01 22:31:30 +0700 | [diff] [blame] | 764 | /* 3GPP TS 44.060, table 11.2.5a.2 "EGPRS PACKET CHANNEL REQUEST" */ |
| 765 | type union EGPRSPktChRequest { |
| 766 | EGPRSPktChRequest_MC5P2RB3 one_phase, |
| 767 | EGPRSPktChRequest_NOB3P2RB3 short, // deprecated |
| 768 | EGPRSPktChRequest_MCG3P2RB3 one_phase_red, |
| 769 | EGPRSPktChRequest_P2RB3 two_phase, |
| 770 | EGPRSPktChRequest_RB5 signalling, |
| 771 | EGPRSPktChRequest_RB5 one_phase_unack, |
| 772 | EGPRSPktChRequest_RB5 dedicated, |
| 773 | EGPRSPktChRequest_RB5 emergency, |
| 774 | EGPRSPktChRequest_P2RB3 two_phase_ipa, |
| 775 | EGPRSPktChRequest_RB5 signalling_ipa |
| 776 | } with { |
| 777 | variant "TAG ( |
| 778 | one_phase, tag = '0'B; |
| 779 | short, tag = '100'B; |
| 780 | one_phase_red, tag = '101'B; |
| 781 | two_phase, tag = '110000'B; |
| 782 | signalling, tag = '110011'B; |
| 783 | one_phase_unack, tag = '110101'B; |
| 784 | dedicated, tag = '110110'B; |
| 785 | emergency, tag = '110111'B; |
| 786 | two_phase_ipa, tag = '111000'B; |
| 787 | signalling_ipa, tag = '111001'B; |
| 788 | )" |
| 789 | }; |
| 790 | |
| 791 | private type record EGPRSPktChRequest_MC5P2RB3 { |
| 792 | BIT1 tag, |
| 793 | BIT5 multislot_class, |
| 794 | BIT2 priority, |
| 795 | BIT3 random_bits |
| 796 | }; |
| 797 | |
| 798 | private type record EGPRSPktChRequest_NOB3P2RB3 { |
| 799 | BIT3 tag, |
| 800 | BIT3 nr_of_blocks, |
| 801 | BIT2 priority, |
| 802 | BIT3 random_bits |
| 803 | }; |
| 804 | |
| 805 | private type record EGPRSPktChRequest_MCG3P2RB3 { |
| 806 | BIT3 tag, |
| 807 | BIT3 multislot_class_group, |
| 808 | BIT2 priority, |
| 809 | BIT3 random_bits |
| 810 | }; |
| 811 | |
| 812 | private type record EGPRSPktChRequest_P2RB3 { |
| 813 | BIT6 tag, |
| 814 | BIT2 priority, |
| 815 | BIT3 random_bits |
| 816 | }; |
| 817 | |
| 818 | private type record EGPRSPktChRequest_RB5 { |
| 819 | BIT6 tag, |
| 820 | BIT5 random_bits |
| 821 | }; |
| 822 | |
| 823 | /* TITAN violates length restrictions on returned type, so we cannot do '... return BIT11'. |
| 824 | * Keep this function private as it returns octet-aligned bitstring (+5 padding bits). */ |
| 825 | private external function enc_EGPRSPktChRequestInternal(in EGPRSPktChRequest req) return bitstring |
| 826 | with { extension "prototype(convert) encode(RAW)" }; |
| 827 | |
| 828 | function enc_EGPRSPktChRequest2bits(in EGPRSPktChRequest req) return BIT11 |
| 829 | { |
| 830 | var bitstring ra11_pad := enc_EGPRSPktChRequestInternal(req); |
| 831 | return substr(ra11_pad, 0, 11); /* TITAN adds 5 padding bits */ |
| 832 | } |
| 833 | |
| 834 | function enc_EGPRSPktChRequest2uint(in EGPRSPktChRequest req) return uint16_t |
| 835 | { |
| 836 | var BIT11 ra11 := enc_EGPRSPktChRequest2bits(req); |
| 837 | return bit2int(ra11); |
| 838 | } |
| 839 | |
Harald Welte | 7024baa | 2018-03-02 23:37:51 +0100 | [diff] [blame] | 840 | |
Harald Welte | 484160b | 2017-07-28 13:30:24 +0200 | [diff] [blame] | 841 | } with { encode "RAW"; variant "FIELDORDER(msb)" variant "BYTEORDER(last)" }; |