libosmogsm  0.6.3
Osmocom GSM library
gsm_08_58.h
Go to the documentation of this file.
1 #ifndef PROTO_GSM_08_58_H
2 #define PROTO_GSM_08_58_H
3 
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 */
6 
7 /* (C) 2008 by Harald Welte <laforge@gnumonks.org>
8  * All Rights Reserved
9  *
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.
14  *
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.
19  *
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.
23  *
24  */
25 
26 #include <stdint.h>
27 
36  uint8_t msg_discr;
37  uint8_t msg_type;
38  uint8_t data[0];
39 } __attribute__ ((packed));
40 
41 /* \brief RSL RLL header (Chapter 8.3) */
43  struct abis_rsl_common_hdr c;
44  uint8_t ie_chan;
45  uint8_t chan_nr;
46  uint8_t ie_link_id;
47  uint8_t link_id;
48  uint8_t data[0];
49 } __attribute__ ((packed));
50 
51 /* \brief RSL Dedicated Channel header (Chapter 8.3 and 8.4) */
54  uint8_t ie_chan;
55  uint8_t chan_nr;
56  uint8_t data[0];
57 } __attribute__ ((packed));
58 
59 /* \brief RSL Common Channel header (Chapter 8.5) */
61  struct abis_rsl_common_hdr c;
62  uint8_t ie_chan;
63  uint8_t chan_nr;
64  uint8_t data[0];
65 } __attribute__ ((packed));
66 
67 
68 /* Chapter 9.1 */
69 /* \brief RSL Message Discriminator: RLL */
70 #define ABIS_RSL_MDISC_RLL 0x02
71 /* \brief RSL Message Discriminator: Dedicated Channel */
72 #define ABIS_RSL_MDISC_DED_CHAN 0x08
73 /* \brief RSL Message Discriminator: Common Channel */
74 #define ABIS_RSL_MDISC_COM_CHAN 0x0c
75 /* \brief RSL Message Discriminator: TRX Management */
76 #define ABIS_RSL_MDISC_TRX 0x10
77 /* \brief RSL Message Discriminator: Location Service */
78 #define ABIS_RSL_MDISC_LOC 0x20
79 /* \brief RSL Message Discriminator: ip.access */
80 #define ABIS_RSL_MDISC_IPACCESS 0x7e
81 #define ABIS_RSL_MDISC_TRANSP 0x01
82 
83 /* \brief Check if given RSL message discriminator is transparent */
84 #define ABIS_RSL_MDISC_IS_TRANSP(x) (x & 0x01)
85 
86 /* \brief RSL Message Tyoe (Chapter 9.1) */
87 enum abis_rsl_msgtype {
88  /* Radio Link Layer Management */
89  RSL_MT_DATA_REQ = 0x01,
90  RSL_MT_DATA_IND,
91  RSL_MT_ERROR_IND,
92  RSL_MT_EST_REQ,
93  RSL_MT_EST_CONF,
94  RSL_MT_EST_IND,
95  RSL_MT_REL_REQ,
96  RSL_MT_REL_CONF,
97  RSL_MT_REL_IND,
98  RSL_MT_UNIT_DATA_REQ,
99  RSL_MT_UNIT_DATA_IND, /* 0x0b */
100  RSL_MT_SUSP_REQ, /* non-standard elements */
101  RSL_MT_SUSP_CONF,
102  RSL_MT_RES_REQ,
103  RSL_MT_RECON_REQ, /* 0x0f */
104 
105  /* Common Channel Management / TRX Management */
106  RSL_MT_BCCH_INFO = 0x11,
107  RSL_MT_CCCH_LOAD_IND,
108  RSL_MT_CHAN_RQD,
109  RSL_MT_DELETE_IND,
110  RSL_MT_PAGING_CMD,
111  RSL_MT_IMMEDIATE_ASSIGN_CMD,
112  RSL_MT_SMS_BC_REQ,
113  RSL_MT_CHAN_CONF, /* non-standard element */
114  /* empty */
115  RSL_MT_RF_RES_IND = 0x19,
116  RSL_MT_SACCH_FILL,
117  RSL_MT_OVERLOAD,
118  RSL_MT_ERROR_REPORT,
119  RSL_MT_SMS_BC_CMD,
120  RSL_MT_CBCH_LOAD_IND,
121  RSL_MT_NOT_CMD, /* 0x1f */
122 
123  /* Dedicate Channel Management */
124  RSL_MT_CHAN_ACTIV = 0x21,
125  RSL_MT_CHAN_ACTIV_ACK,
126  RSL_MT_CHAN_ACTIV_NACK,
127  RSL_MT_CONN_FAIL,
128  RSL_MT_DEACTIVATE_SACCH,
129  RSL_MT_ENCR_CMD,
130  RSL_MT_HANDO_DET,
131  RSL_MT_MEAS_RES,
132  RSL_MT_MODE_MODIFY_REQ,
133  RSL_MT_MODE_MODIFY_ACK,
134  RSL_MT_MODE_MODIFY_NACK,
135  RSL_MT_PHY_CONTEXT_REQ,
136  RSL_MT_PHY_CONTEXT_CONF,
137  RSL_MT_RF_CHAN_REL,
138  RSL_MT_MS_POWER_CONTROL,
139  RSL_MT_BS_POWER_CONTROL, /* 0x30 */
140  RSL_MT_PREPROC_CONFIG,
141  RSL_MT_PREPROC_MEAS_RES,
142  RSL_MT_RF_CHAN_REL_ACK,
143  RSL_MT_SACCH_INFO_MODIFY,
144  RSL_MT_TALKER_DET,
145  RSL_MT_LISTENER_DET,
146  RSL_MT_REMOTE_CODEC_CONF_REP,
147  RSL_MT_RTD_REP,
148  RSL_MT_PRE_HANDO_NOTIF,
149  RSL_MT_MR_CODEC_MOD_REQ,
150  RSL_MT_MR_CODEC_MOD_ACK,
151  RSL_MT_MR_CODEC_MOD_NACK,
152  RSL_MT_MR_CODEC_MOD_PER,
153  RSL_MT_TFO_REP,
154  RSL_MT_TFO_MOD_REQ, /* 0x3f */
155  RSL_MT_LOCATION_INFO = 0x41,
156 
157  /* ip.access specific RSL message types */
158  RSL_MT_IPAC_DIR_RETR_ENQ = 0x40,
159  RSL_MT_IPAC_PDCH_ACT = 0x48,
160  RSL_MT_IPAC_PDCH_ACT_ACK,
161  RSL_MT_IPAC_PDCH_ACT_NACK,
162  RSL_MT_IPAC_PDCH_DEACT = 0x4b,
163  RSL_MT_IPAC_PDCH_DEACT_ACK,
164  RSL_MT_IPAC_PDCH_DEACT_NACK,
165  RSL_MT_IPAC_CONNECT_MUX = 0x50,
166  RSL_MT_IPAC_CONNECT_MUX_ACK,
167  RSL_MT_IPAC_CONNECT_MUX_NACK,
168  RSL_MT_IPAC_BIND_MUX = 0x53,
169  RSL_MT_IPAC_BIND_MUX_ACK,
170  RSL_MT_IPAC_BIND_MUX_NACK,
171  RSL_MT_IPAC_DISC_MUX = 0x56,
172  RSL_MT_IPAC_DISC_MUX_ACK,
173  RSL_MT_IPAC_DISC_MUX_NACK,
174  RSL_MT_IPAC_CRCX = 0x70, /* Bind to local BTS RTP port */
175  RSL_MT_IPAC_CRCX_ACK,
176  RSL_MT_IPAC_CRCX_NACK,
177  RSL_MT_IPAC_MDCX = 0x73,
178  RSL_MT_IPAC_MDCX_ACK,
179  RSL_MT_IPAC_MDCX_NACK,
180  RSL_MT_IPAC_DLCX_IND = 0x76,
181  RSL_MT_IPAC_DLCX = 0x77,
182  RSL_MT_IPAC_DLCX_ACK,
183  RSL_MT_IPAC_DLCX_NACK,
184 };
185 
188  RSL_MT_SIEMENS_MRPCI = 0x41,
189  RSL_MT_SIEMENS_INTRAC_HO_COND_IND = 0x42,
190  RSL_MT_SIEMENS_INTERC_HO_COND_IND = 0x43,
191  RSL_MT_SIEMENS_FORCED_HO_REQ = 0x44,
192  RSL_MT_SIEMENS_PREF_AREA_REQ = 0x45,
193  RSL_MT_SIEMENS_PREF_AREA = 0x46,
194  RSL_MT_SIEMENS_START_TRACE = 0x47,
195  RSL_MT_SIEMENS_START_TRACE_ACK = 0x48,
196  RSL_MT_SIEMENS_STOP_TRACE = 0x49,
197  RSL_MT_SIEMENS_TRMR = 0x4a,
198  RSL_MT_SIEMENS_HO_FAIL_IND = 0x4b,
199  RSL_MT_SIEMENS_STOP_TRACE_ACK = 0x4c,
200  RSL_MT_SIEMENS_UPLF = 0x4d,
201  RSL_MT_SIEMENS_UPLB = 0x4e,
202  RSL_MT_SIEMENS_SET_SYS_INFO_10 = 0x4f,
203  RSL_MT_SIEMENS_MODIF_COND_IND = 0x50,
204 };
205 
208  RSL_IE_CHAN_NR = 0x01,
209  RSL_IE_LINK_IDENT,
210  RSL_IE_ACT_TYPE,
211  RSL_IE_BS_POWER,
212  RSL_IE_CHAN_IDENT,
213  RSL_IE_CHAN_MODE,
214  RSL_IE_ENCR_INFO,
215  RSL_IE_FRAME_NUMBER,
216  RSL_IE_HANDO_REF,
217  RSL_IE_L1_INFO,
218  RSL_IE_L3_INFO,
219  RSL_IE_MS_IDENTITY,
220  RSL_IE_MS_POWER,
221  RSL_IE_PAGING_GROUP,
222  RSL_IE_PAGING_LOAD,
223  RSL_IE_PYHS_CONTEXT = 0x10,
224  RSL_IE_ACCESS_DELAY,
225  RSL_IE_RACH_LOAD,
226  RSL_IE_REQ_REFERENCE,
227  RSL_IE_RELEASE_MODE,
228  RSL_IE_RESOURCE_INFO,
229  RSL_IE_RLM_CAUSE,
230  RSL_IE_STARTNG_TIME,
231  RSL_IE_TIMING_ADVANCE,
232  RSL_IE_UPLINK_MEAS,
233  RSL_IE_CAUSE,
234  RSL_IE_MEAS_RES_NR,
235  RSL_IE_MSG_ID,
236  /* reserved */
237  RSL_IE_SYSINFO_TYPE = 0x1e,
238  RSL_IE_MS_POWER_PARAM,
239  RSL_IE_BS_POWER_PARAM,
240  RSL_IE_PREPROC_PARAM,
241  RSL_IE_PREPROC_MEAS,
242  RSL_IE_IMM_ASS_INFO, /* Phase 1 (3.6.0), later Full below */
243  RSL_IE_SMSCB_INFO = 0x24,
244  RSL_IE_MS_TIMING_OFFSET,
245  RSL_IE_ERR_MSG,
246  RSL_IE_FULL_BCCH_INFO,
247  RSL_IE_CHAN_NEEDED,
248  RSL_IE_CB_CMD_TYPE,
249  RSL_IE_SMSCB_MSG,
250  RSL_IE_FULL_IMM_ASS_INFO,
251  RSL_IE_SACCH_INFO,
252  RSL_IE_CBCH_LOAD_INFO,
253  RSL_IE_SMSCB_CHAN_INDICATOR,
254  RSL_IE_GROUP_CALL_REF,
255  RSL_IE_CHAN_DESC = 0x30,
256  RSL_IE_NCH_DRX_INFO,
257  RSL_IE_CMD_INDICATOR,
258  RSL_IE_EMLPP_PRIO,
259  RSL_IE_UIC,
260  RSL_IE_MAIN_CHAN_REF,
261  RSL_IE_MR_CONFIG,
262  RSL_IE_MR_CONTROL,
263  RSL_IE_SUP_CODEC_TYPES,
264  RSL_IE_CODEC_CONFIG,
265  RSL_IE_RTD,
266  RSL_IE_TFO_STATUS,
267  RSL_IE_LLP_APDU,
268  /* Siemens vendor-specific */
269  RSL_IE_SIEMENS_MRPCI = 0x40,
270  RSL_IE_SIEMENS_PREF_AREA_TYPE = 0x43,
271  RSL_IE_SIEMENS_ININ_CELL_HO_PAR = 0x45,
272  RSL_IE_SIEMENS_TRACE_REF_NR = 0x46,
273  RSL_IE_SIEMENS_INT_TRACE_IDX = 0x47,
274  RSL_IE_SIEMENS_L2_HDR_INFO = 0x48,
275  RSL_IE_SIEMENS_HIGHEST_RATE = 0x4e,
276  RSL_IE_SIEMENS_SUGGESTED_RATE = 0x4f,
277 
278  /* ip.access */
279  RSL_IE_IPAC_SRTP_CONFIG = 0xe0,
280  RSL_IE_IPAC_PROXY_UDP = 0xe1,
281  RSL_IE_IPAC_BSCMPL_TOUT = 0xe2,
282  RSL_IE_IPAC_REMOTE_IP = 0xf0,
283  RSL_IE_IPAC_REMOTE_PORT = 0xf1,
284  RSL_IE_IPAC_RTP_PAYLOAD = 0xf2,
285  RSL_IE_IPAC_LOCAL_PORT = 0xf3,
286  RSL_IE_IPAC_SPEECH_MODE = 0xf4,
287  RSL_IE_IPAC_LOCAL_IP = 0xf5,
288  RSL_IE_IPAC_CONN_STAT = 0xf6,
289  RSL_IE_IPAC_HO_C_PARMS = 0xf7,
290  RSL_IE_IPAC_CONN_ID = 0xf8,
291  RSL_IE_IPAC_RTP_CSD_FMT = 0xf9,
292  RSL_IE_IPAC_RTP_JIT_BUF = 0xfa,
293  RSL_IE_IPAC_RTP_COMPR = 0xfb,
294  RSL_IE_IPAC_RTP_PAYLOAD2= 0xfc,
295  RSL_IE_IPAC_RTP_MPLEX = 0xfd,
296  RSL_IE_IPAC_RTP_MPLEX_ID= 0xfe,
297 };
298 
299 /* Chapter 9.3.1 */
300 #define RSL_CHAN_NR_MASK 0xf8
301 #define RSL_CHAN_Bm_ACCHs 0x08
302 #define RSL_CHAN_Lm_ACCHs 0x10 /* .. 0x18 */
303 #define RSL_CHAN_SDCCH4_ACCH 0x20 /* .. 0x38 */
304 #define RSL_CHAN_SDCCH8_ACCH 0x40 /* ...0x78 */
305 #define RSL_CHAN_BCCH 0x80
306 #define RSL_CHAN_RACH 0x88
307 #define RSL_CHAN_PCH_AGCH 0x90
308 
309 /* Chapter 9.3.3 */
310 #define RSL_ACT_TYPE_INITIAL 0x00
311 #define RSL_ACT_TYPE_REACT 0x80
312 #define RSL_ACT_INTRA_IMM_ASS 0x00
313 #define RSL_ACT_INTRA_NORM_ASS 0x01
314 #define RSL_ACT_INTER_ASYNC 0x02
315 #define RSL_ACT_INTER_SYNC 0x03
316 #define RSL_ACT_SECOND_ADD 0x04
317 #define RSL_ACT_SECOND_MULTI 0x05
318 
321  uint8_t dtx_dtu;
322  uint8_t spd_ind;
323  uint8_t chan_rt;
324  uint8_t chan_rate;
325 } __attribute__ ((packed));
326 #define RSL_CMOD_DTXu 0x01 /* uplink */
327 #define RSL_CMOD_DTXd 0x02 /* downlink */
328 enum rsl_cmod_spd {
329  RSL_CMOD_SPD_SPEECH = 0x01,
330  RSL_CMOD_SPD_DATA = 0x02,
331  RSL_CMOD_SPD_SIGN = 0x03,
332 };
333 #define RSL_CMOD_CRT_SDCCH 0x01
334 #define RSL_CMOD_CRT_TCH_Bm 0x08 /* full-rate */
335 #define RSL_CMOD_CRT_TCH_Lm 0x09 /* half-rate */
336 /* FIXME: More CRT types */
337 /* Speech */
338 #define RSL_CMOD_SP_GSM1 0x01
339 #define RSL_CMOD_SP_GSM2 0x11
340 #define RSL_CMOD_SP_GSM3 0x21
341 /* non-transparent data */
342 #define RSL_CMOD_CSD_NT_43k5 0x74
343 #define RSL_CMOD_CSD_NT_28k8 0x71
344 #define RSL_CMOD_CSD_NT_14k5 0x58
345 #define RSL_CMOD_CSD_NT_12k0 0x50
346 #define RSL_CMOD_CSD_NT_6k0 0x51
347 /* legacy #defines with wrong name */
348 #define RSL_CMOD_SP_NT_14k5 RSL_CMOD_CSD_NT_14k5
349 #define RSL_CMOD_SP_NT_12k0 RSL_CMOD_CSD_NT_12k0
350 #define RSL_CMOD_SP_NT_6k0 RSL_CMOD_CSD_NT_6k0
351 /* transparent data */
352 #define RSL_CMOD_CSD_T_32000 0x38
353 #define RSL_CMOD_CSD_T_29000 0x39
354 #define RSL_CMOD_CSD_T_14400 0x18
355 #define RSL_CMOD_CSD_T_9600 0x10
356 #define RSL_CMOD_CSD_T_4800 0x11
357 #define RSL_CMOD_CSD_T_2400 0x12
358 #define RSL_CMOD_CSD_T_1200 0x13
359 #define RSL_CMOD_CSD_T_600 0x14
360 #define RSL_CMOD_CSD_T_1200_75 0x15
361 
364  /* GSM 04.08 10.5.2.5 */
365  struct {
366  uint8_t iei;
367  uint8_t chan_nr; /* enc_chan_nr */
368  uint8_t oct3;
369  uint8_t oct4;
370  } chan_desc;
371 #if 0 /* spec says we need this but Abissim doesn't use it */
372  struct {
373  uint8_t tag;
374  uint8_t len;
375  } mobile_alloc;
376 #endif
377 } __attribute__ ((packed));
378 
379 /* Chapter 9.3.22 */
380 #define RLL_CAUSE_T200_EXPIRED 0x01
381 #define RLL_CAUSE_REEST_REQ 0x02
382 #define RLL_CAUSE_UNSOL_UA_RESP 0x03
383 #define RLL_CAUSE_UNSOL_DM_RESP 0x04
384 #define RLL_CAUSE_UNSOL_DM_RESP_MF 0x05
385 #define RLL_CAUSE_UNSOL_SPRV_RESP 0x06
386 #define RLL_CAUSE_SEQ_ERR 0x07
387 #define RLL_CAUSE_UFRM_INC_PARAM 0x08
388 #define RLL_CAUSE_SFRM_INC_PARAM 0x09
389 #define RLL_CAUSE_IFRM_INC_MBITS 0x0a
390 #define RLL_CAUSE_IFRM_INC_LEN 0x0b
391 #define RLL_CAUSE_FRM_UNIMPL 0x0c
392 #define RLL_CAUSE_SABM_MF 0x0d
393 #define RLL_CAUSE_SABM_INFO_NOTALL 0x0e
394 
395 /* Chapter 9.3.26 */
396 #define RSL_ERRCLS_NORMAL 0x00
397 #define RSL_ERRCLS_RESOURCE_UNAVAIL 0x20
398 #define RSL_ERRCLS_SERVICE_UNAVAIL 0x30
399 #define RSL_ERRCLS_SERVICE_UNIMPL 0x40
400 #define RSL_ERRCLS_INVAL_MSG 0x50
401 #define RSL_ERRCLS_PROTO_ERROR 0x60
402 #define RSL_ERRCLS_INTERWORKING 0x70
403 
404 /* normal event */
405 #define RSL_ERR_RADIO_IF_FAIL 0x00
406 #define RSL_ERR_RADIO_LINK_FAIL 0x01
407 #define RSL_ERR_HANDOVER_ACC_FAIL 0x02
408 #define RSL_ERR_TALKER_ACC_FAIL 0x03
409 #define RSL_ERR_OM_INTERVENTION 0x07
410 #define RSL_ERR_NORMAL_UNSPEC 0x0f
411 #define RSL_ERR_T_MSRFPCI_EXP 0x18
412 /* resource unavailable */
413 #define RSL_ERR_EQUIPMENT_FAIL 0x20
414 #define RSL_ERR_RR_UNAVAIL 0x21
415 #define RSL_ERR_TERR_CH_FAIL 0x22
416 #define RSL_ERR_CCCH_OVERLOAD 0x23
417 #define RSL_ERR_ACCH_OVERLOAD 0x24
418 #define RSL_ERR_PROCESSOR_OVERLOAD 0x25
419 #define RSL_ERR_RES_UNAVAIL 0x2f
420 /* service or option not available */
421 #define RSL_ERR_TRANSC_UNAVAIL 0x30
422 #define RSL_ERR_SERV_OPT_UNAVAIL 0x3f
423 /* service or option not implemented */
424 #define RSL_ERR_ENCR_UNIMPL 0x40
425 #define RSL_ERR_SERV_OPT_UNIMPL 0x4f
426 /* invalid message */
427 #define RSL_ERR_RCH_ALR_ACTV_ALLOC 0x50
428 #define RSL_ERR_INVALID_MESSAGE 0x5f
429 /* protocol error */
430 #define RSL_ERR_MSG_DISCR 0x60
431 #define RSL_ERR_MSG_TYPE 0x61
432 #define RSL_ERR_MSG_SEQ 0x62
433 #define RSL_ERR_IE_ERROR 0x63
434 #define RSL_ERR_MAND_IE_ERROR 0x64
435 #define RSL_ERR_OPT_IE_ERROR 0x65
436 #define RSL_ERR_IE_NONEXIST 0x66
437 #define RSL_ERR_IE_LENGTH 0x67
438 #define RSL_ERR_IE_CONTENT 0x68
439 #define RSL_ERR_PROTO 0x6f
440 /* interworking */
441 #define RSL_ERR_INTERWORKING 0x7f
442 
443 /* Chapter 9.3.30 */
444 #define RSL_SYSTEM_INFO_8 0x00
445 #define RSL_SYSTEM_INFO_1 0x01
446 #define RSL_SYSTEM_INFO_2 0x02
447 #define RSL_SYSTEM_INFO_3 0x03
448 #define RSL_SYSTEM_INFO_4 0x04
449 #define RSL_SYSTEM_INFO_5 0x05
450 #define RSL_SYSTEM_INFO_6 0x06
451 #define RSL_SYSTEM_INFO_7 0x07
452 #define RSL_SYSTEM_INFO_16 0x08
453 #define RSL_SYSTEM_INFO_17 0x09
454 #define RSL_SYSTEM_INFO_2bis 0x0a
455 #define RSL_SYSTEM_INFO_2ter 0x0b
456 #define RSL_SYSTEM_INFO_5bis 0x0d
457 #define RSL_SYSTEM_INFO_5ter 0x0e
458 #define RSL_SYSTEM_INFO_10 0x0f
459 #define RSL_EXT_MEAS_ORDER 0x47
460 #define RSL_MEAS_INFO 0x48
461 #define RSL_SYSTEM_INFO_13 0x28
462 #define RSL_SYSTEM_INFO_2quater 0x29
463 #define RSL_SYSTEM_INFO_9 0x2a
464 #define RSL_SYSTEM_INFO_18 0x2b
465 #define RSL_SYSTEM_INFO_19 0x2c
466 #define RSL_SYSTEM_INFO_20 0x2d
467 
468 /* Chapter 9.3.40 */
469 #define RSL_CHANNEED_ANY 0x00
470 #define RSL_CHANNEED_SDCCH 0x01
471 #define RSL_CHANNEED_TCH_F 0x02
472 #define RSL_CHANNEED_TCH_ForH 0x03
473 
476  uint8_t last_block:2;
477  uint8_t spare:1;
478  uint8_t def_bcast:1;
479  uint8_t command:4;
480 } __attribute__ ((packed));
481 /* ->command */
482 #define RSL_CB_CMD_TYPE_NORMAL 0x00
483 #define RSL_CB_CMD_TYPE_SCHEDULE 0x08
484 #define RSL_CB_CMD_TYPE_DEFAULT 0x0e
485 #define RSL_CB_CMD_TYPE_NULL 0x0f
486 /* ->def_bcast */
487 #define RSL_CB_CMD_DEFBCAST_NORMAL 0
488 #define RSL_CB_CMD_DEFBCAST_NULL 1
489 /* ->last_block */
490 #define RSL_CB_CMD_LASTBLOCK_4 0
491 #define RSL_CB_CMD_LASTBLOCK_1 1
492 #define RSL_CB_CMD_LASTBLOCK_2 2
493 #define RSL_CB_CMD_LASTBLOCK_3 3
494 
495 /* Chapter 3.3.2.3 Brocast control channel */
496 /* CCCH-CONF, NC is not combined */
497 #define RSL_BCCH_CCCH_CONF_1_NC 0x00
498 #define RSL_BCCH_CCCH_CONF_1_C 0x01
499 #define RSL_BCCH_CCCH_CONF_2_NC 0x02
500 #define RSL_BCCH_CCCH_CONF_3_NC 0x04
501 #define RSL_BCCH_CCCH_CONF_4_NC 0x06
502 
503 /* BS-PA-MFRMS */
504 #define RSL_BS_PA_MFRMS_2 0x00
505 #define RSL_BS_PA_MFRMS_3 0x01
506 #define RSL_BS_PA_MFRMS_4 0x02
507 #define RSL_BS_PA_MFRMS_5 0x03
508 #define RSL_BS_PA_MFRMS_6 0x04
509 #define RSL_BS_PA_MFRMS_7 0x05
510 #define RSL_BS_PA_MFRMS_8 0x06
511 #define RSL_BS_PA_MFRMS_9 0x07
512 
513 /* RSL_IE_IPAC_RTP_PAYLOAD[2] */
514 enum rsl_ipac_rtp_payload {
515  RSL_IPAC_RTP_GSM = 1,
516  RSL_IPAC_RTP_EFR,
517  RSL_IPAC_RTP_AMR,
518  RSL_IPAC_RTP_CSD,
519  RSL_IPAC_RTP_MUX,
520 };
521 
522 /* RSL_IE_IPAC_SPEECH_MODE, lower four bits */
523 enum rsl_ipac_speech_mode_s {
524  RSL_IPAC_SPEECH_GSM_FR = 0, /* GSM FR (Type 1, FS) */
525  RSL_IPAC_SPEECH_GSM_EFR = 1, /* GSM EFR (Type 2, FS) */
526  RSL_IPAC_SPEECH_GSM_AMR_FR = 2, /* GSM AMR/FR (Type 3, FS) */
527  RSL_IPAC_SPEECH_GSM_HR = 3, /* GSM HR (Type 1, HS) */
528  RSL_IPAC_SPEECH_GSM_AMR_HR = 5, /* GSM AMR/hr (Type 3, HS) */
529  RSL_IPAC_SPEECH_AS_RTP = 0xf, /* As specified by RTP Payload IE */
530 };
531 /* RSL_IE_IPAC_SPEECH_MODE, upper four bits */
532 enum rsl_ipac_speech_mode_m {
533  RSL_IPAC_SPEECH_M_RXTX = 0, /* Send and Receive */
534  RSL_IPAC_SPEECH_M_RX = 1, /* Receive only */
535  RSL_IPAC_SPEECH_M_TX = 2, /* Send only */
536 };
537 
538 /* RSL_IE_IPAC_RTP_CSD_FMT, lower four bits */
539 enum rsl_ipac_rtp_csd_format_d {
540  RSL_IPAC_RTP_CSD_EXT_TRAU = 0,
541  RSL_IPAC_RTP_CSD_NON_TRAU = 1,
542  RSL_IPAC_RTP_CSD_TRAU_BTS = 2,
543  RSL_IPAC_RTP_CSD_IWF_FREE = 3,
544 };
545 /* RSL_IE_IPAC_RTP_CSD_FMT, upper four bits */
546 enum rsl_ipac_rtp_csd_format_ir {
547  RSL_IPAC_RTP_CSD_IR_8k = 0,
548  RSL_IPAC_RTP_CSD_IR_16k = 1,
549  RSL_IPAC_RTP_CSD_IR_32k = 2,
550  RSL_IPAC_RTP_CSD_IR_64k = 3,
551 };
552 
553 /* Siemens vendor-specific RSL extensions */
554 struct rsl_mrpci {
555  uint8_t power_class:3,
556  vgcs_capable:1,
557  vbs_capable:1,
558  gsm_phase:2;
559 } __attribute__ ((packed));
560 
561 enum rsl_mrpci_pwrclass {
562  RSL_MRPCI_PWRC_1 = 0,
563  RSL_MRPCI_PWRC_2 = 1,
564  RSL_MRPCI_PWRC_3 = 2,
565  RSL_MRPCI_PWRC_4 = 3,
566  RSL_MRPCI_PWRC_5 = 4,
567 };
568 enum rsl_mrpci_phase {
569  RSL_MRPCI_PHASE_1 = 0,
570  /* reserved */
571  RSL_MRPCI_PHASE_2 = 2,
572  RSL_MRPCI_PHASE_2PLUS = 3,
573 };
574 
575 /* 9.3.20 Release Mode */
576 enum rsl_rel_mode {
577  RSL_REL_NORMAL = 0,
578  RSL_REL_LOCAL_END = 1,
579 };
580 
583 #endif /* PROTO_GSM_08_58_H */