1 #ifndef PROTO_GSM_08_58_H
2 #define PROTO_GSM_08_58_H
4 /* GSM Radio Signalling Link messages on the A-bis interface
5 * 3GPP TS 08.58 version 8.6.0 Release 1999 / ETSI TS 100 596 V8.6.0 */
7 /* (C) 2008 by Harald Welte <laforge@gnumonks.org>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License along
21 * with this program; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 struct abis_rsl_common_hdr {
32 } __attribute__ ((packed));
35 struct abis_rsl_rll_hdr {
36 struct abis_rsl_common_hdr c;
42 } __attribute__ ((packed));
44 /* Chapter 8.3 and 8.4 */
45 struct abis_rsl_dchan_hdr {
46 struct abis_rsl_common_hdr c;
50 } __attribute__ ((packed));
54 #define ABIS_RSL_MDISC_RLL 0x02
55 #define ABIS_RSL_MDISC_DED_CHAN 0x08
56 #define ABIS_RSL_MDISC_COM_CHAN 0x0c
57 #define ABIS_RSL_MDISC_TRX 0x10
58 #define ABIS_RSL_MDISC_LOC 0x20
59 #define ABIS_RSL_MDISC_IPACCESS 0x7e
60 #define ABIS_RSL_MDISC_TRANSP 0x01
62 #define ABIS_RSL_MDISC_IS_TRANSP(x) (x & 0x01)
65 enum abis_rsl_msgtype {
66 /* Radio Link Layer Management */
67 RSL_MT_DATA_REQ = 0x01,
77 RSL_MT_UNIT_DATA_IND, /* 0x0b */
79 /* Common Channel Management / TRX Management */
80 RSL_MT_BCCH_INFO = 0x11,
85 RSL_MT_IMMEDIATE_ASSIGN_CMD,
88 RSL_MT_RF_RES_IND = 0x19,
94 RSL_MT_NOT_CMD, /* 0x1f */
96 /* Dedicate Channel Management */
97 RSL_MT_CHAN_ACTIV = 0x21,
98 RSL_MT_CHAN_ACTIV_ACK,
99 RSL_MT_CHAN_ACTIV_NACK,
101 RSL_MT_DEACTIVATE_SACCH,
105 RSL_MT_MODE_MODIFY_REQ,
106 RSL_MT_MODE_MODIFY_ACK,
107 RSL_MT_MODE_MODIFY_NACK,
108 RSL_MT_PHY_CONTEXT_REQ,
109 RSL_MT_PHY_CONTEXT_CONF,
111 RSL_MT_MS_POWER_CONTROL,
112 RSL_MT_BS_POWER_CONTROL, /* 0x30 */
113 RSL_MT_PREPROC_CONFIG,
114 RSL_MT_PREPROC_MEAS_RES,
115 RSL_MT_RF_CHAN_REL_ACK,
116 RSL_MT_SACCH_INFO_MODIFY,
119 RSL_MT_REMOTE_CODEC_CONF_REP,
121 RSL_MT_PRE_HANDO_NOTIF,
122 RSL_MT_MR_CODEC_MOD_REQ,
123 RSL_MT_MR_CODEC_MOD_ACK,
124 RSL_MT_MR_CODEC_MOD_NACK,
125 RSL_MT_MR_CODEC_MOD_PER,
127 RSL_MT_TFO_MOD_REQ, /* 0x3f */
128 RSL_MT_LOCATION_INFO = 0x41,
130 /* ip.access specific RSL message types */
131 RSL_MT_IPAC_DIR_RETR_ENQ = 0x40,
132 RSL_MT_IPAC_PDCH_ACT = 0x48,
133 RSL_MT_IPAC_PDCH_ACT_ACK,
134 RSL_MT_IPAC_PDCH_ACT_NACK,
135 RSL_MT_IPAC_PDCH_DEACT = 0x4b,
136 RSL_MT_IPAC_PDCH_DEACT_ACK,
137 RSL_MT_IPAC_PDCH_DEACT_NACK,
138 RSL_MT_IPAC_CONNECT_MUX = 0x50,
139 RSL_MT_IPAC_CONNECT_MUX_ACK,
140 RSL_MT_IPAC_CONNECT_MUX_NACK,
141 RSL_MT_IPAC_BIND_MUX = 0x53,
142 RSL_MT_IPAC_BIND_MUX_ACK,
143 RSL_MT_IPAC_BIND_MUX_NACK,
144 RSL_MT_IPAC_DISC_MUX = 0x56,
145 RSL_MT_IPAC_DISC_MUX_ACK,
146 RSL_MT_IPAC_DISC_MUX_NACK,
147 RSL_MT_IPAC_CRCX = 0x70, /* Bind to local BTS RTP port */
148 RSL_MT_IPAC_CRCX_ACK,
149 RSL_MT_IPAC_CRCX_NACK,
150 RSL_MT_IPAC_MDCX = 0x73,
151 RSL_MT_IPAC_MDCX_ACK,
152 RSL_MT_IPAC_MDCX_NACK,
153 RSL_MT_IPAC_DLCX_IND = 0x76,
154 RSL_MT_IPAC_DLCX = 0x77,
155 RSL_MT_IPAC_DLCX_ACK,
156 RSL_MT_IPAC_DLCX_NACK,
159 /* Siemens vendor-specific */
160 enum abis_rsl_msgtype_siemens {
161 RSL_MT_SIEMENS_MRPCI = 0x41,
162 RSL_MT_SIEMENS_INTRAC_HO_COND_IND = 0x42,
163 RSL_MT_SIEMENS_INTERC_HO_COND_IND = 0x43,
164 RSL_MT_SIEMENS_FORCED_HO_REQ = 0x44,
165 RSL_MT_SIEMENS_PREF_AREA_REQ = 0x45,
166 RSL_MT_SIEMENS_PREF_AREA = 0x46,
167 RSL_MT_SIEMENS_START_TRACE = 0x47,
168 RSL_MT_SIEMENS_START_TRACE_ACK = 0x48,
169 RSL_MT_SIEMENS_STOP_TRACE = 0x49,
170 RSL_MT_SIEMENS_TRMR = 0x4a,
171 RSL_MT_SIEMENS_HO_FAIL_IND = 0x4b,
172 RSL_MT_SIEMENS_STOP_TRACE_ACK = 0x4c,
173 RSL_MT_SIEMENS_UPLF = 0x4d,
174 RSL_MT_SIEMENS_UPLB = 0x4e,
175 RSL_MT_SIEMENS_SET_SYS_INFO_10 = 0x4f,
176 RSL_MT_SIEMENS_MODIF_COND_IND = 0x50,
181 RSL_IE_CHAN_NR = 0x01,
196 RSL_IE_PYHS_CONTEXT = 0x10,
199 RSL_IE_REQ_REFERENCE,
201 RSL_IE_RESOURCE_INFO,
204 RSL_IE_TIMING_ADVANCE,
210 RSL_IE_SYSINFO_TYPE = 0x1e,
211 RSL_IE_MS_POWER_PARAM,
212 RSL_IE_BS_POWER_PARAM,
213 RSL_IE_PREPROC_PARAM,
215 RSL_IE_IMM_ASS_INFO, /* Phase 1 (3.6.0), later Full below */
216 RSL_IE_SMSCB_INFO = 0x24,
217 RSL_IE_MS_TIMING_OFFSET,
219 RSL_IE_FULL_BCCH_INFO,
223 RSL_IE_FULL_IMM_ASS_INFO,
225 RSL_IE_CBCH_LOAD_INFO,
226 RSL_IE_SMSCB_CHAN_INDICATOR,
227 RSL_IE_GROUP_CALL_REF,
228 RSL_IE_CHAN_DESC = 0x30,
230 RSL_IE_CMD_INDICATOR,
233 RSL_IE_MAIN_CHAN_REF,
236 RSL_IE_SUP_CODEC_TYPES,
241 /* Siemens vendor-specific */
242 RSL_IE_SIEMENS_MRPCI = 0x40,
243 RSL_IE_SIEMENS_PREF_AREA_TYPE = 0x43,
244 RSL_IE_SIEMENS_ININ_CELL_HO_PAR = 0x45,
245 RSL_IE_SIEMENS_TRACE_REF_NR = 0x46,
246 RSL_IE_SIEMENS_INT_TRACE_IDX = 0x47,
247 RSL_IE_SIEMENS_L2_HDR_INFO = 0x48,
248 RSL_IE_SIEMENS_HIGHEST_RATE = 0x4e,
249 RSL_IE_SIEMENS_SUGGESTED_RATE = 0x4f,
252 RSL_IE_IPAC_SRTP_CONFIG = 0xe0,
253 RSL_IE_IPAC_PROXY_UDP = 0xe1,
254 RSL_IE_IPAC_BSCMPL_TOUT = 0xe2,
255 RSL_IE_IPAC_REMOTE_IP = 0xf0,
256 RSL_IE_IPAC_REMOTE_PORT = 0xf1,
257 RSL_IE_IPAC_RTP_PAYLOAD = 0xf2,
258 RSL_IE_IPAC_LOCAL_PORT = 0xf3,
259 RSL_IE_IPAC_SPEECH_MODE = 0xf4,
260 RSL_IE_IPAC_LOCAL_IP = 0xf5,
261 RSL_IE_IPAC_CONN_STAT = 0xf6,
262 RSL_IE_IPAC_HO_C_PARMS = 0xf7,
263 RSL_IE_IPAC_CONN_ID = 0xf8,
264 RSL_IE_IPAC_RTP_CSD_FMT = 0xf9,
265 RSL_IE_IPAC_RTP_JIT_BUF = 0xfa,
266 RSL_IE_IPAC_RTP_COMPR = 0xfb,
267 RSL_IE_IPAC_RTP_PAYLOAD2= 0xfc,
268 RSL_IE_IPAC_RTP_MPLEX = 0xfd,
269 RSL_IE_IPAC_RTP_MPLEX_ID= 0xfe,
273 #define RSL_CHAN_NR_MASK 0xf8
274 #define RSL_CHAN_Bm_ACCHs 0x08
275 #define RSL_CHAN_Lm_ACCHs 0x10 /* .. 0x18 */
276 #define RSL_CHAN_SDCCH4_ACCH 0x20 /* .. 0x38 */
277 #define RSL_CHAN_SDCCH8_ACCH 0x40 /* ...0x78 */
278 #define RSL_CHAN_BCCH 0x80
279 #define RSL_CHAN_RACH 0x88
280 #define RSL_CHAN_PCH_AGCH 0x90
283 #define RSL_ACT_TYPE_INITIAL 0x00
284 #define RSL_ACT_TYPE_REACT 0x80
285 #define RSL_ACT_INTRA_IMM_ASS 0x00
286 #define RSL_ACT_INTRA_NORM_ASS 0x01
287 #define RSL_ACT_INTER_ASYNC 0x02
288 #define RSL_ACT_INTER_SYNC 0x03
289 #define RSL_ACT_SECOND_ADD 0x04
290 #define RSL_ACT_SECOND_MULTI 0x05
293 struct rsl_ie_chan_mode {
298 } __attribute__ ((packed));
299 #define RSL_CMOD_DTXu 0x01 /* uplink */
300 #define RSL_CMOD_DTXd 0x02 /* downlink */
302 RSL_CMOD_SPD_SPEECH = 0x01,
303 RSL_CMOD_SPD_DATA = 0x02,
304 RSL_CMOD_SPD_SIGN = 0x03,
306 #define RSL_CMOD_CRT_SDCCH 0x01
307 #define RSL_CMOD_CRT_TCH_Bm 0x08 /* full-rate */
308 #define RSL_CMOD_CRT_TCH_Lm 0x09 /* half-rate */
309 /* FIXME: More CRT types */
311 #define RSL_CMOD_SP_GSM1 0x01
312 #define RSL_CMOD_SP_GSM2 0x11
313 #define RSL_CMOD_SP_GSM3 0x21
315 #define RSL_CMOD_SP_NT_14k5 0x58
316 #define RSL_CMOD_SP_NT_12k0 0x50
317 #define RSL_CMOD_SP_NT_6k0 0x51
320 struct rsl_ie_chan_ident {
321 /* GSM 04.08 10.5.2.5 */
324 uint8_t chan_nr; /* enc_chan_nr */
328 #if 0 /* spec says we need this but Abissim doesn't use it */
334 } __attribute__ ((packed));
337 #define RLL_CAUSE_T200_EXPIRED 0x01
338 #define RLL_CAUSE_REEST_REQ 0x02
339 #define RLL_CAUSE_UNSOL_UA_RESP 0x03
340 #define RLL_CAUSE_UNSOL_DM_RESP 0x04
341 #define RLL_CAUSE_UNSOL_DM_RESP_MF 0x05
342 #define RLL_CAUSE_UNSOL_SPRV_RESP 0x06
343 #define RLL_CAUSE_SEQ_ERR 0x07
344 #define RLL_CAUSE_UFRM_INC_PARAM 0x08
345 #define RLL_CAUSE_SFRM_INC_PARAM 0x09
346 #define RLL_CAUSE_IFRM_INC_MBITS 0x0a
347 #define RLL_CAUSE_IFRM_INC_LEN 0x0b
348 #define RLL_CAUSE_FRM_UNIMPL 0x0c
349 #define RLL_CAUSE_SABM_MF 0x0d
350 #define RLL_CAUSE_SABM_INFO_NOTALL 0x0e
353 #define RSL_ERRCLS_NORMAL 0x00
354 #define RSL_ERRCLS_RESOURCE_UNAVAIL 0x20
355 #define RSL_ERRCLS_SERVICE_UNAVAIL 0x30
356 #define RSL_ERRCLS_SERVICE_UNIMPL 0x40
357 #define RSL_ERRCLS_INVAL_MSG 0x50
358 #define RSL_ERRCLS_PROTO_ERROR 0x60
359 #define RSL_ERRCLS_INTERWORKING 0x70
362 #define RSL_ERR_RADIO_IF_FAIL 0x00
363 #define RSL_ERR_RADIO_LINK_FAIL 0x01
364 #define RSL_ERR_HANDOVER_ACC_FAIL 0x02
365 #define RSL_ERR_TALKER_ACC_FAIL 0x03
366 #define RSL_ERR_OM_INTERVENTION 0x07
367 #define RSL_ERR_NORMAL_UNSPEC 0x0f
368 #define RSL_ERR_T_MSRFPCI_EXP 0x18
369 /* resource unavailable */
370 #define RSL_ERR_EQUIPMENT_FAIL 0x20
371 #define RSL_ERR_RR_UNAVAIL 0x21
372 #define RSL_ERR_TERR_CH_FAIL 0x22
373 #define RSL_ERR_CCCH_OVERLOAD 0x23
374 #define RSL_ERR_ACCH_OVERLOAD 0x24
375 #define RSL_ERR_PROCESSOR_OVERLOAD 0x25
376 #define RSL_ERR_RES_UNAVAIL 0x2f
377 /* service or option not available */
378 #define RSL_ERR_TRANSC_UNAVAIL 0x30
379 #define RSL_ERR_SERV_OPT_UNAVAIL 0x3f
380 /* service or option not implemented */
381 #define RSL_ERR_ENCR_UNIMPL 0x40
382 #define RSL_ERR_SERV_OPT_UNIMPL 0x4f
383 /* invalid message */
384 #define RSL_ERR_RCH_ALR_ACTV_ALLOC 0x50
385 #define RSL_ERR_INVALID_MESSAGE 0x5f
387 #define RSL_ERR_MSG_DISCR 0x60
388 #define RSL_ERR_MSG_TYPE 0x61
389 #define RSL_ERR_MSG_SEQ 0x62
390 #define RSL_ERR_IE_ERROR 0x63
391 #define RSL_ERR_MAND_IE_ERROR 0x64
392 #define RSL_ERR_OPT_IE_ERROR 0x65
393 #define RSL_ERR_IE_NONEXIST 0x66
394 #define RSL_ERR_IE_LENGTH 0x67
395 #define RSL_ERR_IE_CONTENT 0x68
396 #define RSL_ERR_PROTO 0x6f
398 #define RSL_ERR_INTERWORKING 0x7f
401 #define RSL_SYSTEM_INFO_8 0x00
402 #define RSL_SYSTEM_INFO_1 0x01
403 #define RSL_SYSTEM_INFO_2 0x02
404 #define RSL_SYSTEM_INFO_3 0x03
405 #define RSL_SYSTEM_INFO_4 0x04
406 #define RSL_SYSTEM_INFO_5 0x05
407 #define RSL_SYSTEM_INFO_6 0x06
408 #define RSL_SYSTEM_INFO_7 0x07
409 #define RSL_SYSTEM_INFO_16 0x08
410 #define RSL_SYSTEM_INFO_17 0x09
411 #define RSL_SYSTEM_INFO_2bis 0x0a
412 #define RSL_SYSTEM_INFO_2ter 0x0b
413 #define RSL_SYSTEM_INFO_5bis 0x0d
414 #define RSL_SYSTEM_INFO_5ter 0x0e
415 #define RSL_SYSTEM_INFO_10 0x0f
416 #define REL_EXT_MEAS_ORDER 0x47
417 #define RSL_MEAS_INFO 0x48
418 #define RSL_SYSTEM_INFO_13 0x28
419 #define RSL_SYSTEM_INFO_2quater 0x29
420 #define RSL_SYSTEM_INFO_9 0x2a
421 #define RSL_SYSTEM_INFO_18 0x2b
422 #define RSL_SYSTEM_INFO_19 0x2c
423 #define RSL_SYSTEM_INFO_20 0x2d
426 #define RSL_CHANNEED_ANY 0x00
427 #define RSL_CHANNEED_SDCCH 0x01
428 #define RSL_CHANNEED_TCH_F 0x02
429 #define RSL_CHANNEED_TCH_ForH 0x03
431 /* Chapter 3.3.2.3 Brocast control channel */
432 /* CCCH-CONF, NC is not combined */
433 #define RSL_BCCH_CCCH_CONF_1_NC 0x00
434 #define RSL_BCCH_CCCH_CONF_1_C 0x01
435 #define RSL_BCCH_CCCH_CONF_2_NC 0x02
436 #define RSL_BCCH_CCCH_CONF_3_NC 0x04
437 #define RSL_BCCH_CCCH_CONF_4_NC 0x06
440 #define RSL_BS_PA_MFRMS_2 0x00
441 #define RSL_BS_PA_MFRMS_3 0x01
442 #define RSL_BS_PA_MFRMS_4 0x02
443 #define RSL_BS_PA_MFRMS_5 0x03
444 #define RSL_BS_PA_MFRMS_6 0x04
445 #define RSL_BS_PA_MFRMS_7 0x05
446 #define RSL_BS_PA_MFRMS_8 0x06
447 #define RSL_BS_PA_MFRMS_9 0x07
449 /* RSL_IE_IPAC_RTP_PAYLOAD[2] */
450 enum rsl_ipac_rtp_payload {
451 RSL_IPAC_RTP_GSM = 1,
458 /* RSL_IE_IPAC_SPEECH_MODE, lower four bits */
459 enum rsl_ipac_speech_mode_s {
460 RSL_IPAC_SPEECH_GSM_FR = 0, /* GSM FR (Type 1, FS) */
461 RSL_IPAC_SPEECH_GSM_EFR = 1, /* GSM EFR (Type 2, FS) */
462 RSL_IPAC_SPEECH_GSM_AMR_FR = 2, /* GSM AMR/FR (Type 3, FS) */
463 RSL_IPAC_SPEECH_GSM_HR = 3, /* GSM HR (Type 1, HS) */
464 RSL_IPAC_SPEECH_GSM_AMR_HR = 5, /* GSM AMR/hr (Type 3, HS) */
465 RSL_IPAC_SPEECH_AS_RTP = 0xf, /* As specified by RTP Payload IE */
467 /* RSL_IE_IPAC_SPEECH_MODE, upper four bits */
468 enum rsl_ipac_speech_mode_m {
469 RSL_IPAC_SPEECH_M_RXTX = 0, /* Send and Receive */
470 RSL_IPAC_SPEECH_M_RX = 1, /* Receive only */
471 RSL_IPAC_SPEECH_M_TX = 2, /* Send only */
474 /* RSL_IE_IPAC_RTP_CSD_FMT, lower four bits */
475 enum rsl_ipac_rtp_csd_format_d {
476 RSL_IPAC_RTP_CSD_EXT_TRAU = 0,
477 RSL_IPAC_RTP_CSD_NON_TRAU = 1,
478 RSL_IPAC_RTP_CSD_TRAU_BTS = 2,
479 RSL_IPAC_RTP_CSD_IWF_FREE = 3,
481 /* RSL_IE_IPAC_RTP_CSD_FMT, upper four bits */
482 enum rsl_ipac_rtp_csd_format_ir {
483 RSL_IPAC_RTP_CSD_IR_8k = 0,
484 RSL_IPAC_RTP_CSD_IR_16k = 1,
485 RSL_IPAC_RTP_CSD_IR_32k = 2,
486 RSL_IPAC_RTP_CSD_IR_64k = 3,
489 /* Siemens vendor-specific RSL extensions */
491 uint8_t power_class:3,
495 } __attribute__ ((packed));
497 enum rsl_mrpci_pwrclass {
498 RSL_MRPCI_PWRC_1 = 0,
499 RSL_MRPCI_PWRC_2 = 1,
500 RSL_MRPCI_PWRC_3 = 2,
501 RSL_MRPCI_PWRC_4 = 3,
502 RSL_MRPCI_PWRC_5 = 4,
504 enum rsl_mrpci_phase {
505 RSL_MRPCI_PHASE_1 = 0,
507 RSL_MRPCI_PHASE_2 = 2,
508 RSL_MRPCI_PHASE_2PLUS = 3,
512 #endif /* PROTO_GSM_08_58_H */