Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 1 | module PCUIF_Types { |
| 2 | |
| 3 | import from General_Types all; |
| 4 | import from Osmocom_Types all; |
| 5 | |
| 6 | /* Osmocom PCU Interface Types, as per osmo-pcu/include/osmocom/pcu/pcuif_proto.h */ |
| 7 | |
| 8 | const charstring PCU_SOCK_DEFAULT := "/tmp/pcu_bts"; |
Harald Welte | 3568dc7 | 2018-03-13 17:06:51 +0100 | [diff] [blame] | 9 | const uint32_t PCU_IF_VERSION := 9; |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 10 | |
| 11 | type enumerated PCUIF_MsgType { |
| 12 | PCU_IF_MSG_DATA_REQ ('00'O), |
| 13 | PCU_IF_MSG_DATA_CNF ('01'O), |
| 14 | PCU_IF_MSG_DATA_IND ('02'O), |
| 15 | PCU_IF_MSG_SUSP_REQ ('03'O), |
| 16 | PCU_IF_MSG_RTS_REQ ('10'O), |
| 17 | PCU_IF_MSG_DATA_CNF_DT ('11'O), |
| 18 | PCU_IF_MSG_RACH_IND ('22'O), |
| 19 | PCU_IF_MSG_INFO_IND ('32'O), |
| 20 | PCU_IF_MSG_ACT_REQ ('40'O), |
| 21 | PCU_IF_MSG_TIME_IND ('52'O), |
| 22 | PCU_IF_MSG_PAG_REQ ('60'O), |
| 23 | PCU_IF_MSG_TXT_IND ('70'O) |
| 24 | } with { variant "FIELDLENGTH(8)" }; |
| 25 | |
| 26 | type enumerated PCUIF_Sapi { |
| 27 | PCU_IF_SAPI_UNKNOWN ('00'O), |
| 28 | PCU_IF_SAPI_RACH ('01'O), |
| 29 | PCU_IF_SAPI_AGCH ('02'O), |
| 30 | PCU_IF_SAPI_PCH ('03'O), |
| 31 | PCU_IF_SAPI_BCCH ('04'O), |
| 32 | PCU_IF_SAPI_PDTCH ('05'O), |
| 33 | PCU_IF_SAPI_PRACH ('06'O), |
| 34 | PCU_IF_SAPI_PTCCH ('07'O), |
| 35 | PCU_IF_SAPI_AGCH_DT ('08'O) |
| 36 | } with { variant "FIELDLENGTH(8)" }; |
| 37 | |
| 38 | type record PCUIF_Flags { |
| 39 | boolean bts_active, |
| 40 | boolean sysmo_direct_dsp, |
| 41 | BIT14 spare, |
| 42 | boolean cs1, |
| 43 | boolean cs2, |
| 44 | boolean cs3, |
| 45 | boolean cs4, |
| 46 | boolean mcs1, |
| 47 | boolean mcs2, |
| 48 | boolean mcs3, |
| 49 | boolean mcs4, |
| 50 | boolean mcs5, |
| 51 | boolean mcs6, |
| 52 | boolean mcs7, |
| 53 | boolean mcs8, |
| 54 | boolean mcs9, |
| 55 | BIT3 spare2 |
| 56 | } with { variant "" }; |
| 57 | |
| 58 | type enumerated PCUIF_TextType { |
| 59 | PCU_VERSION (0), |
| 60 | PCU_OML_ALERT (1) |
| 61 | } with { variant "FIELDLENGTH(8)" }; |
| 62 | |
| 63 | type charstring PCUIF_Text length(128) with { variant "FIELDLENGTH(128)" }; |
| 64 | |
| 65 | type record PCUIF_txt_ind { |
| 66 | PCUIF_TextType txt_type, |
| 67 | PCUIF_Text text |
| 68 | } with { variant "" }; |
| 69 | |
| 70 | type octetstring OCT162 length(162) with { variant "FIELDLENGTH(162)" }; |
| 71 | |
| 72 | type record PCUIF_data { |
| 73 | PCUIF_Sapi sapi, |
| 74 | uint8_t len, |
| 75 | OCT162 data, |
| 76 | uint32_t fn, |
| 77 | uint16_t arfcn, |
| 78 | uint8_t trx_nr, |
| 79 | uint8_t ts_nr, |
| 80 | uint8_t block_nr, |
| 81 | int8_t rssi, |
| 82 | uint16_t ber10k, |
| 83 | int16_t ta_offs_qbits, |
| 84 | int16_t lqual_cb |
| 85 | } with { variant "" }; |
| 86 | |
| 87 | type record PCUIF_data_cnf_dt { |
| 88 | PCUIF_Sapi sapi, |
| 89 | OCT4 tlli, |
| 90 | uint32_t fn, |
| 91 | uint16_t arfcn, |
| 92 | uint8_t trx_nr, |
| 93 | uint8_t ts_nr, |
| 94 | uint8_t block_nr, |
| 95 | int8_t rssi, |
| 96 | uint16_t ber10k, |
| 97 | int16_t ta_offs_qbits, |
| 98 | int16_t lqual_cb |
| 99 | } with { variant "" }; |
| 100 | |
| 101 | type record PCUIF_rts_req { |
| 102 | PCUIF_Sapi sapi, |
| 103 | OCT3 spare, |
| 104 | uint32_t fn, |
| 105 | uint16_t arfcn, |
| 106 | uint8_t trx_nr, |
| 107 | uint8_t ts_nr, |
| 108 | uint8_t block_nr |
| 109 | } with { variant "" }; |
| 110 | |
Harald Welte | 913bbf6 | 2019-03-01 00:39:19 +0100 | [diff] [blame] | 111 | type enumerated PCUIF_BurstType { |
| 112 | BURST_TYPE_NONE (0), |
| 113 | BURST_TYPE_0 (1), |
| 114 | BURST_TYPE_1 (2), |
| 115 | BURST_TYPE_2 (3) |
| 116 | } with { variant "FIELDLENGTH(8)" }; |
| 117 | |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 118 | type record PCUIF_rach_ind { |
| 119 | PCUIF_Sapi sapi, |
| 120 | uint16_t ra, |
| 121 | int16_t qta, |
| 122 | uint32_t fn, |
| 123 | uint16_t arfcn, |
| 124 | uint8_t is_11bit, |
Harald Welte | 913bbf6 | 2019-03-01 00:39:19 +0100 | [diff] [blame] | 125 | PCUIF_BurstType burst_type |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 126 | } with { variant "" }; |
| 127 | |
| 128 | type record PCUIF_InfoTrx { |
| 129 | uint16_t arfcn, |
| 130 | BIT8 pdch_mask, |
| 131 | OCT1 spare, |
| 132 | OCT8 tsc, |
| 133 | uint32_t hLayer1 |
Harald Welte | f148659 | 2018-04-04 19:26:41 +0200 | [diff] [blame] | 134 | } with { variant (pdch_mask) "BITORDER(msb)" }; |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 135 | type record length(8) of PCUIF_InfoTrx PCUIF_InfoTrxs; |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 136 | |
| 137 | type record PCUIF_info_ind { |
| 138 | uint32_t version, |
| 139 | PCUIF_Flags flags, |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 140 | PCUIF_InfoTrxs trx, |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 141 | uint8_t bsic, |
| 142 | |
| 143 | uint16_t mcc, |
| 144 | uint16_t mnc, |
Harald Welte | 3568dc7 | 2018-03-13 17:06:51 +0100 | [diff] [blame] | 145 | uint8_t mnc_3_digits, |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 146 | uint16_t lac, |
| 147 | uint16_t rac, |
| 148 | |
| 149 | uint16_t nsei, |
| 150 | record length(7) of uint8_t nse_timer, |
| 151 | record length(11) of uint8_t cell_timer, |
| 152 | |
| 153 | uint16_t cell_id, |
| 154 | uint16_t repeat_time, |
| 155 | uint8_t repeat_count, |
| 156 | uint16_t bvci, |
| 157 | uint8_t t3142, |
| 158 | uint8_t t3169, |
| 159 | uint8_t t3191, |
| 160 | uint8_t t3193_10ms, |
| 161 | uint8_t t3195, |
| 162 | uint8_t t3101, |
| 163 | uint8_t t3103, |
| 164 | uint8_t t3105, |
| 165 | uint8_t cv_countdown, |
| 166 | uint16_t dl_tbf_ext, |
| 167 | uint16_t ul_tbf_ext, |
| 168 | uint8_t initial_cs, |
| 169 | uint8_t initial_mcs, |
| 170 | |
| 171 | record length(2) of uint16_t nsvci, |
| 172 | record length(2) of uint16_t local_pprt, |
| 173 | record length(2) of uint16_t remote_port, |
Harald Welte | 07e8dde | 2019-02-18 20:38:45 +0100 | [diff] [blame] | 174 | record length(2) of OCT4 remote_ip |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 175 | } with { variant "" } |
| 176 | |
| 177 | type record PCUIF_act_req { |
| 178 | uint8_t is_activate, |
| 179 | uint8_t trx_nr, |
| 180 | uint8_t ts_nr, |
| 181 | OCT1 spare |
| 182 | } with { variant "" }; |
| 183 | |
| 184 | type record PCUIF_time_ind { |
| 185 | uint32_t fn |
| 186 | } with { variant "" }; |
| 187 | |
| 188 | type record PCUIF_pag_req { |
| 189 | PCUIF_Sapi sapi, |
| 190 | uint8_t chan_needed, |
| 191 | OCT9 identity_lv |
| 192 | } with { variant "" }; |
| 193 | |
| 194 | type record PCUIF_susp_req { |
| 195 | OCT4 tlli, |
| 196 | OCT6 ra_id, |
| 197 | uint8_t cause |
| 198 | } with { variant "" }; |
| 199 | |
| 200 | |
| 201 | type union PCUIF_MsgUnion { |
| 202 | PCUIF_data data_req, |
| 203 | PCUIF_data data_cnf, |
| 204 | PCUIF_data_cnf_dt data_cnf_dt, |
| 205 | PCUIF_data data_ind, |
| 206 | PCUIF_susp_req susp_req, |
| 207 | PCUIF_rts_req rts_req, |
| 208 | PCUIF_rach_ind rach_ind, |
| 209 | PCUIF_txt_ind txt_ind, |
| 210 | PCUIF_info_ind info_ind, |
| 211 | PCUIF_act_req act_req, |
| 212 | PCUIF_time_ind time_ind, |
| 213 | PCUIF_pag_req pag_req |
| 214 | } with { variant "" }; |
| 215 | |
| 216 | type record PCUIF_Message { |
| 217 | PCUIF_MsgType msg_type, |
| 218 | uint8_t bts_nr, |
| 219 | OCT2 spare, |
| 220 | PCUIF_MsgUnion u |
| 221 | } with { variant (u) "CROSSTAG( |
| 222 | data_req, msg_type = PCU_IF_MSG_DATA_REQ; |
| 223 | data_cnf, msg_type = PCU_IF_MSG_DATA_CNF; |
| 224 | data_cnf_dt, msg_type = PCU_IF_MSG_DATA_CNF_DT; |
| 225 | data_ind, msg_type = PCU_IF_MSG_DATA_IND; |
| 226 | susp_req, msg_type = PCU_IF_MSG_SUSP_REQ; |
| 227 | rts_req, msg_type = PCU_IF_MSG_RTS_REQ; |
| 228 | rach_ind, msg_type = PCU_IF_MSG_RACH_IND; |
| 229 | txt_ind, msg_type = PCU_IF_MSG_TXT_IND; |
| 230 | info_ind, msg_type = PCU_IF_MSG_INFO_IND; |
| 231 | act_req, msg_type = PCU_IF_MSG_ACT_REQ; |
| 232 | time_ind, msg_type = PCU_IF_MSG_TIME_IND; |
| 233 | pag_req, msg_type = PCU_IF_MSG_PAG_REQ)" |
Harald Welte | 3568dc7 | 2018-03-13 17:06:51 +0100 | [diff] [blame] | 234 | variant "PADDING(1696)" /* 212 * 8 */ |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 235 | }; |
| 236 | |
| 237 | external function enc_PCUIF_Message(in PCUIF_Message pdu) return octetstring |
| 238 | with { extension "prototype(convert) encode(RAW)" }; |
| 239 | external function dec_PCUIF_Message(in octetstring stream) return PCUIF_Message |
| 240 | with { extension "prototype(convert) decode(RAW)" }; |
| 241 | |
| 242 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 243 | template (value) PCUIF_Message ts_PCUIF_RTS_REQ(template (value) uint8_t bts_nr, |
| 244 | template (value) uint8_t trx_nr, |
| 245 | template (value) uint8_t ts_nr, |
| 246 | template (value) PCUIF_Sapi sapi, |
| 247 | template (value) uint32_t fn, |
| 248 | template (value) uint16_t arfcn, |
| 249 | template (value) uint8_t block_nr |
| 250 | ) := { |
| 251 | msg_type := PCU_IF_MSG_RTS_REQ, |
| 252 | bts_nr := bts_nr, |
| 253 | spare := '0000'O, |
| 254 | u := { |
| 255 | rts_req := { |
| 256 | sapi := sapi, |
| 257 | spare := '000000'O, |
| 258 | fn := fn, |
| 259 | arfcn := arfcn, |
| 260 | trx_nr := trx_nr, |
| 261 | ts_nr := ts_nr, |
| 262 | block_nr := block_nr |
| 263 | } |
| 264 | } |
| 265 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 266 | template PCUIF_Message tr_PCUIF_RTS_REQ(template uint8_t bts_nr := ?, |
| 267 | template uint8_t trx_nr := ?, |
| 268 | template uint8_t ts_nr := ?, |
| 269 | template PCUIF_Sapi sapi := ?, |
| 270 | template uint32_t fn := ?, |
| 271 | template uint8_t block_nr := ? |
| 272 | ) := { |
| 273 | msg_type := PCU_IF_MSG_RTS_REQ, |
| 274 | bts_nr := bts_nr, |
| 275 | spare := ?, |
| 276 | u := { |
| 277 | rts_req := { |
| 278 | sapi := sapi, |
| 279 | spare := ?, |
| 280 | fn := fn, |
| 281 | arfcn := ?, |
| 282 | trx_nr := trx_nr, |
| 283 | ts_nr := ts_nr, |
| 284 | block_nr := block_nr |
| 285 | } |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | template (value) PCUIF_Message ts_PCUIF_TXT_IND(uint8_t bts_nr, PCUIF_TextType tt, charstring text) := { |
| 290 | msg_type := PCU_IF_MSG_TXT_IND, |
| 291 | bts_nr := bts_nr, |
| 292 | spare := '0000'O, |
| 293 | u := { |
| 294 | txt_ind := { |
| 295 | txt_type := tt, |
| 296 | text := text |
| 297 | } |
| 298 | } |
| 299 | } |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 300 | template PCUIF_Message tr_PCUIF_TXT_IND(template uint8_t bts_nr, template PCUIF_TextType tt, |
| 301 | template charstring text := ?) := { |
| 302 | msg_type := PCU_IF_MSG_TXT_IND, |
| 303 | bts_nr := bts_nr, |
| 304 | spare := '0000'O, |
| 305 | u := { |
| 306 | txt_ind := { |
| 307 | txt_type := tt, |
| 308 | text := text |
| 309 | } |
| 310 | } |
| 311 | } |
| 312 | |
| 313 | |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 314 | |
| 315 | template (value) PCUIF_Message ts_PCUIF_ACT_REQ(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr) := { |
| 316 | msg_type := PCU_IF_MSG_ACT_REQ, |
| 317 | bts_nr := bts_nr, |
| 318 | spare := '0000'O, |
| 319 | u := { |
| 320 | act_req := { |
| 321 | is_activate := 1, |
| 322 | trx_nr := trx_nr, |
| 323 | ts_nr := ts_nr, |
| 324 | spare := '00'O |
| 325 | } |
| 326 | } |
| 327 | } |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 328 | template PCUIF_Message tr_PCUIF_ACT_REQ(template uint8_t bts_nr, template uint8_t trx_nr, |
| 329 | template uint8_t ts_nr) := { |
| 330 | msg_type := PCU_IF_MSG_ACT_REQ, |
| 331 | bts_nr := bts_nr, |
| 332 | spare := '0000'O, |
| 333 | u := { |
| 334 | act_req := { |
| 335 | is_activate := 1, |
| 336 | trx_nr := trx_nr, |
| 337 | ts_nr := ts_nr, |
| 338 | spare := '00'O |
| 339 | } |
| 340 | } |
| 341 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 342 | |
| 343 | template (value) PCUIF_Message ts_PCUIF_DEACT_REQ(uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr) := { |
| 344 | msg_type := PCU_IF_MSG_ACT_REQ, |
| 345 | bts_nr := bts_nr, |
| 346 | spare := '0000'O, |
| 347 | u := { |
| 348 | act_req := { |
| 349 | is_activate := 0, |
| 350 | trx_nr := trx_nr, |
| 351 | ts_nr := ts_nr, |
| 352 | spare := '00'O |
| 353 | } |
| 354 | } |
| 355 | } |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 356 | template PCUIF_Message tr_PCUIF_DEACT_REQ(template uint8_t bts_nr, template uint8_t trx_nr, |
| 357 | template uint8_t ts_nr) := { |
| 358 | msg_type := PCU_IF_MSG_ACT_REQ, |
| 359 | bts_nr := bts_nr, |
| 360 | spare := '0000'O, |
| 361 | u := { |
| 362 | act_req := { |
| 363 | is_activate := 0, |
| 364 | trx_nr := trx_nr, |
| 365 | ts_nr := ts_nr, |
| 366 | spare := '00'O |
| 367 | } |
| 368 | } |
| 369 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 370 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 371 | template (value) PCUIF_Message ts_PCUIF_DATA_IND(template (value) uint8_t bts_nr, |
| 372 | template (value) uint8_t trx_nr, |
| 373 | template (value) uint8_t ts_nr, |
| 374 | template (value) uint8_t block_nr, |
| 375 | template (value) PCUIF_Sapi sapi, |
| 376 | template (value) OCT162 data, |
| 377 | template (value) uint32_t fn, |
| 378 | template (value) uint16_t arfcn, |
| 379 | template (value) int8_t rssi := -80, |
| 380 | template (value) uint16_t ber10k := 0, |
| 381 | template (value) int16_t ta_offs_qbits := 0, |
| 382 | template (value) uint16_t lqual_cb := 10) := { |
| 383 | msg_type := PCU_IF_MSG_DATA_IND, |
| 384 | bts_nr := bts_nr, |
| 385 | spare := '0000'O, |
| 386 | u := { |
| 387 | data_ind := { |
| 388 | sapi := sapi, |
| 389 | len := lengthof(valueof(data)), |
| 390 | data := data, |
| 391 | fn := fn, |
| 392 | arfcn := arfcn, |
| 393 | trx_nr := trx_nr, |
| 394 | ts_nr := ts_nr, |
| 395 | block_nr := block_nr, |
| 396 | rssi := rssi, |
| 397 | ber10k := ber10k, |
| 398 | ta_offs_qbits := ta_offs_qbits, |
| 399 | lqual_cb := lqual_cb |
| 400 | } |
| 401 | } |
| 402 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 403 | template PCUIF_Message tr_PCUIF_DATA_IND(template uint8_t bts_nr := ?, |
| 404 | template uint8_t trx_nr := ?, |
| 405 | template uint8_t ts_nr := ?, |
| 406 | template uint8_t block_nr := ?, |
| 407 | template PCUIF_Sapi sapi := ?, |
| 408 | template OCT162 data := ?) := { |
| 409 | msg_type := PCU_IF_MSG_DATA_IND, |
| 410 | bts_nr := bts_nr, |
| 411 | spare := ?, |
| 412 | u := { |
| 413 | data_ind := { |
| 414 | sapi := sapi, |
| 415 | len := ?, |
| 416 | data := data, |
| 417 | fn := ?, |
| 418 | arfcn := ?, |
| 419 | trx_nr := trx_nr, |
| 420 | ts_nr := ts_nr, |
| 421 | block_nr := block_nr, |
| 422 | rssi := ?, |
| 423 | ber10k := ?, |
| 424 | ta_offs_qbits := ?, |
| 425 | lqual_cb := ? |
| 426 | } |
| 427 | } |
| 428 | } |
| 429 | |
| 430 | template (value) PCUIF_Message ts_PCUIF_DATA_REQ(uint8_t bts_nr, uint8_t trx_nr, |
| 431 | uint8_t ts_nr, uint8_t block_nr, |
| 432 | uint32_t fn, PCUIF_Sapi sapi, |
| 433 | octetstring data) := { |
| 434 | msg_type := PCU_IF_MSG_DATA_REQ, |
| 435 | bts_nr := bts_nr, |
| 436 | spare := '0000'O, |
| 437 | u := { |
| 438 | data_req := { |
| 439 | sapi := sapi, |
| 440 | len := lengthof(data), |
| 441 | data := data, |
| 442 | fn := fn, |
| 443 | arfcn := 0, /* unused in BTS */ |
| 444 | trx_nr := trx_nr, |
| 445 | ts_nr := ts_nr, |
| 446 | block_nr := block_nr, |
| 447 | /* measurement parameters below unused on Tx */ |
| 448 | rssi := 0, |
| 449 | ber10k := 0, |
| 450 | ta_offs_qbits := 0, |
| 451 | lqual_cb := 0 |
| 452 | } |
| 453 | } |
| 454 | } |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 455 | template PCUIF_Message tr_PCUIF_DATA_REQ(template uint8_t bts_nr, |
| 456 | template uint8_t trx_nr, |
| 457 | template uint8_t ts_nr, |
| 458 | template uint8_t block_nr := ?, |
| 459 | template uint32_t fn := ?, |
| 460 | template PCUIF_Sapi sapi := ?, |
| 461 | template octetstring data := ?) := { |
| 462 | msg_type := PCU_IF_MSG_DATA_REQ, |
| 463 | bts_nr := bts_nr, |
| 464 | spare := '0000'O, |
| 465 | u := { |
| 466 | data_req := { |
| 467 | sapi := sapi, |
| 468 | len := ?, |
| 469 | data := data, |
| 470 | fn := fn, |
Harald Welte | 0a3d63f | 2019-03-02 00:02:07 +0100 | [diff] [blame] | 471 | arfcn := ?, /* unused in BTS */ |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 472 | trx_nr := trx_nr, |
| 473 | ts_nr := ts_nr, |
| 474 | block_nr := block_nr, |
| 475 | /* measurement parameters below unused on Tx */ |
| 476 | rssi := 0, |
| 477 | ber10k := 0, |
| 478 | ta_offs_qbits := 0, |
| 479 | lqual_cb := 0 |
| 480 | } |
| 481 | } |
| 482 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 483 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 484 | template (value) PCUIF_Message ts_PCUIF_DATA_CNF(template (value) uint8_t bts_nr, |
| 485 | template (value) uint8_t trx_nr, |
| 486 | template (value) uint8_t ts_nr, |
| 487 | template (value) uint8_t block_nr, |
| 488 | template (value) uint32_t fn, |
| 489 | template (value) uint16_t arfcn, |
| 490 | template (value) PCUIF_Sapi sapi, |
| 491 | template (value) octetstring data) := { |
| 492 | msg_type := PCU_IF_MSG_DATA_CNF, |
| 493 | bts_nr := bts_nr, |
| 494 | spare := '0000'O, |
| 495 | u := { |
| 496 | data_cnf := { |
| 497 | sapi := sapi, |
| 498 | len := 0, /* overwritten */ |
| 499 | data := data, |
| 500 | fn := fn, |
| 501 | arfcn := arfcn, |
| 502 | trx_nr := trx_nr, |
| 503 | ts_nr := ts_nr, |
| 504 | block_nr := block_nr, |
| 505 | rssi := 0, |
| 506 | ber10k := 0, |
| 507 | ta_offs_qbits := 0, |
| 508 | lqual_cb := 0 |
| 509 | } |
| 510 | } |
| 511 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 512 | template PCUIF_Message tr_PCUIF_DATA_CNF(template uint8_t bts_nr := ?, |
| 513 | template uint8_t trx_nr := ?, |
| 514 | template uint8_t ts_nr := ?, |
| 515 | template PCUIF_Sapi sapi := ?, |
| 516 | template octetstring data := ?) := { |
| 517 | msg_type := PCU_IF_MSG_DATA_CNF, |
| 518 | bts_nr := bts_nr, |
| 519 | spare := ?, |
| 520 | u := { |
| 521 | data_cnf := { |
| 522 | sapi := sapi, |
| 523 | len := ?, |
| 524 | data := data, |
| 525 | fn := ?, |
| 526 | arfcn := ?, |
| 527 | trx_nr := trx_nr, |
| 528 | ts_nr := ts_nr, |
| 529 | block_nr := ?, |
| 530 | rssi := ?, |
| 531 | ber10k := ?, |
| 532 | ta_offs_qbits := ?, |
| 533 | lqual_cb := ? |
| 534 | } |
| 535 | } |
| 536 | } |
| 537 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 538 | template (value) PCUIF_Message ts_PCUIF_RACH_IND(template (value) uint8_t bts_nr, |
| 539 | template (value) uint16_t ra, |
| 540 | template (value) uint8_t is_11bit, |
Harald Welte | 913bbf6 | 2019-03-01 00:39:19 +0100 | [diff] [blame] | 541 | template (value) PCUIF_BurstType burst_type, |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 542 | template (value) uint32_t fn, |
| 543 | template (value) uint16_t arfcn, |
| 544 | template (value) int16_t qta := 0 |
| 545 | ) := { |
| 546 | msg_type := PCU_IF_MSG_RACH_IND, |
| 547 | bts_nr := bts_nr, |
| 548 | spare := '0000'O, |
| 549 | u := { |
| 550 | rach_ind := { |
| 551 | sapi := PCU_IF_SAPI_RACH, |
| 552 | ra := ra, |
| 553 | qta := qta, |
| 554 | fn := fn, |
| 555 | arfcn := arfcn, |
| 556 | is_11bit := is_11bit, |
| 557 | burst_type := burst_type |
| 558 | } |
| 559 | } |
| 560 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 561 | template PCUIF_Message tr_PCUIF_RACH_IND(template uint8_t bts_nr := ?, |
| 562 | template uint16_t ra := ?, |
| 563 | template uint8_t is_11bit := ?, |
Harald Welte | 913bbf6 | 2019-03-01 00:39:19 +0100 | [diff] [blame] | 564 | template PCUIF_BurstType burst_type := ?, |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 565 | template uint32_t fn := ?) := { |
| 566 | msg_type := PCU_IF_MSG_RACH_IND, |
| 567 | bts_nr := bts_nr, |
| 568 | spare := ?, |
| 569 | u := { |
| 570 | rach_ind := { |
| 571 | sapi := PCU_IF_SAPI_RACH, |
| 572 | ra := ra, |
| 573 | qta := ?, |
| 574 | fn := fn, |
| 575 | arfcn := ?, |
| 576 | is_11bit := is_11bit, |
| 577 | burst_type := burst_type |
| 578 | } |
| 579 | } |
| 580 | } |
| 581 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 582 | template (value) PCUIF_Message ts_PCUIF_PAG_REQ(template (value) uint8_t bts_nr, |
| 583 | template (value) OCT9 id_lv, |
| 584 | template (value) uint8_t chan_needed, |
| 585 | template (value) PCUIF_Sapi sapi) := { |
| 586 | msg_type := PCU_IF_MSG_PAG_REQ, |
| 587 | bts_nr := bts_nr, |
| 588 | spare := '0000'O, |
| 589 | u := { |
| 590 | pag_req := { |
| 591 | sapi := sapi, |
| 592 | chan_needed := chan_needed, |
| 593 | identity_lv := id_lv |
| 594 | } |
| 595 | } |
| 596 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 597 | template PCUIF_Message tr_PCUIF_PAG_REQ(template uint8_t bts_nr := ?, |
| 598 | template OCT9 id_lv := ?, |
| 599 | template uint8_t chan_needed := ?, |
| 600 | template PCUIF_Sapi sapi := ?) := { |
| 601 | msg_type := PCU_IF_MSG_PAG_REQ, |
| 602 | bts_nr := bts_nr, |
| 603 | spare := ?, |
| 604 | u := { |
| 605 | pag_req := { |
| 606 | sapi := ?, |
| 607 | chan_needed := chan_needed, |
| 608 | identity_lv := id_lv |
| 609 | } |
| 610 | } |
| 611 | } |
| 612 | |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 613 | const PCUIF_Flags c_PCUIF_Flags_default := { |
| 614 | bts_active := true, |
| 615 | sysmo_direct_dsp := false, |
| 616 | spare := '00000000000000'B, |
| 617 | cs1 := true, |
| 618 | cs2 := true, |
| 619 | cs3 := true, |
| 620 | cs4 := true, |
| 621 | mcs1 := true, |
| 622 | mcs2 := true, |
| 623 | mcs3 := true, |
| 624 | mcs4 := true, |
| 625 | mcs5 := true, |
| 626 | mcs6 := true, |
| 627 | mcs7 := true, |
| 628 | mcs8 := true, |
| 629 | mcs9 := true, |
| 630 | spare2 := '000'B |
| 631 | }; |
| 632 | |
| 633 | template (value) PCUIF_InfoTrx ts_PCUIF_InfoTrx(template (value) uint16_t arfcn := 871, |
| 634 | template (value) BIT8 pdch_mask := '00000001'B, |
| 635 | OCT1 tsc := '07'O) := { |
| 636 | arfcn := arfcn, |
| 637 | pdch_mask := pdch_mask, |
| 638 | spare := '00'O, |
| 639 | tsc := tsc & tsc & tsc & tsc & tsc & tsc & tsc & tsc, |
| 640 | hLayer1 := 0 |
| 641 | } |
| 642 | |
| 643 | template (value) PCUIF_InfoTrx ts_PCUIF_InfoTrxNULL := ts_PCUIF_InfoTrx(0, '00000000'B, '00'O); |
| 644 | |
| 645 | template (value) PCUIF_InfoTrxs ts_PCUIF_InfoTrxs_def := { |
| 646 | ts_PCUIF_InfoTrx, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, |
| 647 | ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL, ts_PCUIF_InfoTrxNULL }; |
| 648 | |
| 649 | |
| 650 | template (value) PCUIF_Message ts_PCUIF_INFO_IND(template (value) uint8_t bts_nr, |
| 651 | template (value) uint16_t nsei, |
| 652 | template (value) uint16_t nsvci, |
| 653 | template (value) uint16_t bvci, |
| 654 | template (value) uint16_t local_port, |
| 655 | template (value) uint16_t remote_port, |
Harald Welte | 07e8dde | 2019-02-18 20:38:45 +0100 | [diff] [blame] | 656 | template (value) OCT4 remote_ip, |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 657 | template (value) PCUIF_Flags flags := c_PCUIF_Flags_default, |
| 658 | template (value) uint16_t mcc := 262, |
| 659 | template (value) uint16_t mnc := 42, |
Harald Welte | f12b5a4 | 2019-03-21 19:50:21 +0100 | [diff] [blame] | 660 | template (value) uint16_t lac := 13135, |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 661 | template (value) uint8_t rac := 0, |
Harald Welte | f12b5a4 | 2019-03-21 19:50:21 +0100 | [diff] [blame] | 662 | template (value) uint16_t cell_id := 20960, |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 663 | template (value) uint8_t bsic := 7, |
| 664 | template (value) PCUIF_InfoTrxs trx := ts_PCUIF_InfoTrxs_def, |
| 665 | template (value) uint32_t version := PCU_IF_VERSION) := { |
| 666 | msg_type := PCU_IF_MSG_INFO_IND, |
| 667 | bts_nr := bts_nr, |
| 668 | spare := '0000'O, |
| 669 | u := { |
| 670 | info_ind := { |
| 671 | version := version, |
| 672 | flags := flags, |
| 673 | trx := trx, |
| 674 | bsic := bsic, |
| 675 | mcc := mcc, |
| 676 | mnc := mnc, |
| 677 | mnc_3_digits := 0, |
| 678 | lac := lac, |
| 679 | rac := rac, |
| 680 | nsei := nsei, |
| 681 | nse_timer := { 3, 3, 3, 3, 30, 3, 10 }, |
| 682 | cell_timer := { 3, 3, 3, 3, 3, 10, 3, 10, 3, 10, 3 }, |
| 683 | cell_id := cell_id, |
| 684 | repeat_time := 5 * 50, |
| 685 | repeat_count := 3, |
| 686 | bvci := bvci, |
| 687 | t3142 := 20, |
| 688 | t3169 := 5, |
| 689 | t3191 := 5, |
| 690 | t3193_10ms := 160, |
| 691 | t3195 := 5, |
| 692 | t3101 := 10, |
| 693 | t3103 := 4, |
| 694 | t3105 := 8, |
| 695 | cv_countdown := 15, |
| 696 | dl_tbf_ext := 250 * 10, /* ms */ |
| 697 | ul_tbf_ext := 250 * 10, /* ms */ |
| 698 | initial_cs := 2, |
| 699 | initial_mcs := 6, |
| 700 | nsvci := { nsvci, 0 }, |
| 701 | local_pprt := { local_port, 0 }, |
| 702 | remote_port := { remote_port, 0 }, |
Harald Welte | 07e8dde | 2019-02-18 20:38:45 +0100 | [diff] [blame] | 703 | remote_ip := { remote_ip , '00000000'O } |
Harald Welte | e1fd916 | 2019-02-18 19:47:53 +0100 | [diff] [blame] | 704 | } |
| 705 | } |
| 706 | } |
Harald Welte | d378a25 | 2018-03-13 17:02:14 +0100 | [diff] [blame] | 707 | template PCUIF_Message tr_PCUIF_INFO_IND(template uint8_t bts_nr := ?, |
| 708 | template PCUIF_Flags flags := ?, |
| 709 | template uint32_t version := PCU_IF_VERSION) := { |
| 710 | msg_type := PCU_IF_MSG_INFO_IND, |
| 711 | bts_nr := bts_nr, |
| 712 | spare := ?, |
| 713 | u := { |
| 714 | info_ind := { |
| 715 | version := version, |
| 716 | flags := flags, |
| 717 | trx := ?, |
| 718 | bsic := ?, |
| 719 | mcc := ?, |
| 720 | mnc :=?, |
Harald Welte | 3568dc7 | 2018-03-13 17:06:51 +0100 | [diff] [blame] | 721 | mnc_3_digits := ?, |
Harald Welte | d378a25 | 2018-03-13 17:02:14 +0100 | [diff] [blame] | 722 | lac := ?, |
| 723 | rac := ?, |
| 724 | nsei := ?, |
| 725 | nse_timer := ?, |
| 726 | cell_timer := ?, |
| 727 | cell_id := ?, |
| 728 | repeat_time := ?, |
| 729 | repeat_count := ?, |
| 730 | bvci := ?, |
| 731 | t3142 := ?, |
| 732 | t3169 := ?, |
| 733 | t3191 := ?, |
| 734 | t3193_10ms := ?, |
| 735 | t3195 := ?, |
| 736 | t3101 := ?, |
| 737 | t3103 := ?, |
| 738 | t3105 := ?, |
| 739 | cv_countdown := ?, |
| 740 | dl_tbf_ext := ?, |
| 741 | ul_tbf_ext := ?, |
| 742 | initial_cs := ?, |
| 743 | initial_mcs := ?, |
| 744 | nsvci := ?, |
| 745 | local_pprt := ?, |
| 746 | remote_port := ?, |
| 747 | remote_ip := ? |
| 748 | } |
| 749 | } |
| 750 | } |
| 751 | |
Harald Welte | a321981 | 2019-03-02 00:02:28 +0100 | [diff] [blame] | 752 | template (value) PCUIF_Message ts_PCUIF_TIME_IND(template (value) uint8_t bts_nr, |
| 753 | template (value) uint32_t fn) := { |
| 754 | msg_type := PCU_IF_MSG_TIME_IND, |
| 755 | bts_nr := bts_nr, |
| 756 | spare := '0000'O, |
| 757 | u := { |
| 758 | time_ind := { |
| 759 | fn := fn |
| 760 | } |
| 761 | } |
| 762 | } |
| 763 | template PCUIF_Message tr_PCUIF_TIME_IND(template uint8_t bts_nr, |
| 764 | template uint32_t fn) := { |
| 765 | msg_type := PCU_IF_MSG_TIME_IND, |
| 766 | bts_nr := bts_nr, |
| 767 | spare := ?, |
| 768 | u := { |
| 769 | time_ind := { |
| 770 | fn := fn |
| 771 | } |
| 772 | } |
| 773 | } |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 774 | |
Harald Welte | 4bff40a | 2019-03-21 21:34:10 +0100 | [diff] [blame] | 775 | template (value) PCUIF_Message ts_PCUIF_SUSP_REQ(template (value) uint8_t bts_nr, |
| 776 | template (value) OCT4 tlli, |
| 777 | template (value) OCT6 ra_id, |
| 778 | template (value) uint8_t cause) := { |
| 779 | msg_type := PCU_IF_MSG_SUSP_REQ, |
| 780 | bts_nr := bts_nr, |
| 781 | spare := '0000'O, |
| 782 | u := { |
| 783 | susp_req := { |
| 784 | tlli := tlli, |
| 785 | ra_id := ra_id, |
| 786 | cause := cause |
| 787 | } |
| 788 | } |
| 789 | } |
| 790 | template PCUIF_Message tr_PCUIF_SUSP_REQ(template uint8_t bts_nr, |
| 791 | template OCT4 tlli, |
| 792 | template OCT6 ra_id, |
| 793 | template uint8_t cause) := { |
| 794 | msg_type := PCU_IF_MSG_SUSP_REQ, |
| 795 | bts_nr := bts_nr, |
| 796 | spare := '0000'O, |
| 797 | u := { |
| 798 | susp_req := { |
| 799 | tlli := tlli, |
| 800 | ra_id := ra_id, |
| 801 | cause := cause |
| 802 | } |
| 803 | } |
| 804 | } |
| 805 | |
| 806 | |
Harald Welte | 883340c | 2018-02-28 18:59:29 +0100 | [diff] [blame] | 807 | } with { encode "RAW" variant "BYTEORDER(first)" }; |