blob: a7a2ccfda4c1faf188a63f197c51afe2ac10e8df [file] [log] [blame]
Sylvain Munaut12ba7782014-06-16 10:13:40 +02001#pragma once
Harald Welteec8b4502010-02-20 20:34:29 +01002
3/* GSM Radio Signalling Link messages on the A-bis interface
4 * 3GPP TS 08.58 version 8.6.0 Release 1999 / ETSI TS 100 596 V8.6.0 */
5
6/* (C) 2008 by Harald Welte <laforge@gnumonks.org>
7 * All Rights Reserved
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 *
23 */
24
25#include <stdint.h>
26
Harald Welte8f2c7e52011-08-17 18:52:03 +020027/*! \addtogroup rsl
28 * @{
29 */
30
31/*! \file gsm_08_58.h */
32
33/*! \brief RSL common header */
Harald Welteec8b4502010-02-20 20:34:29 +010034struct abis_rsl_common_hdr {
Harald Weltebe145192011-08-18 11:45:18 +020035 uint8_t msg_discr; /*!< \brief message discriminator (ABIS_RSL_MDISC_*) */
36 uint8_t msg_type; /*!< \brief message type (\ref abis_rsl_msgtype) */
37 uint8_t data[0]; /*!< \brief actual payload data */
Harald Welteec8b4502010-02-20 20:34:29 +010038} __attribute__ ((packed));
39
Harald Welte8f2c7e52011-08-17 18:52:03 +020040/* \brief RSL RLL header (Chapter 8.3) */
Harald Welteec8b4502010-02-20 20:34:29 +010041struct abis_rsl_rll_hdr {
42 struct abis_rsl_common_hdr c;
Harald Weltebe145192011-08-18 11:45:18 +020043 uint8_t ie_chan; /*!< \brief \ref RSL_IE_CHAN_NR (tag) */
44 uint8_t chan_nr; /*!< \brief RSL channel number (value) */
45 uint8_t ie_link_id; /*!< \brief \ref RSL_IE_LINK_IDENT (tag) */
46 uint8_t link_id; /*!< \brief RSL link identifier (value) */
47 uint8_t data[0]; /*!< \brief message payload data */
Harald Welteec8b4502010-02-20 20:34:29 +010048} __attribute__ ((packed));
49
Harald Welte8f2c7e52011-08-17 18:52:03 +020050/* \brief RSL Dedicated Channel header (Chapter 8.3 and 8.4) */
Harald Welteec8b4502010-02-20 20:34:29 +010051struct abis_rsl_dchan_hdr {
52 struct abis_rsl_common_hdr c;
Harald Weltebe145192011-08-18 11:45:18 +020053 uint8_t ie_chan; /*!< \brief \ref RSL_IE_CHAN_NR (tag) */
54 uint8_t chan_nr; /*!< \brief RSL channel number (value) */
55 uint8_t data[0]; /*!< \brief message payload data */
Harald Welteec8b4502010-02-20 20:34:29 +010056} __attribute__ ((packed));
57
Harald Welte8f2c7e52011-08-17 18:52:03 +020058/* \brief RSL Common Channel header (Chapter 8.5) */
Harald Welte6eb7d6c2010-07-13 13:48:13 +020059struct abis_rsl_cchan_hdr {
60 struct abis_rsl_common_hdr c;
Harald Weltebe145192011-08-18 11:45:18 +020061 uint8_t ie_chan; /*!< \brief \ref RSL_IE_CHAN_NR (tag) */
62 uint8_t chan_nr; /*!< \brief RSL channel number (value) */
63 uint8_t data[0]; /*!< \brief message payload data */
Harald Welte6eb7d6c2010-07-13 13:48:13 +020064} __attribute__ ((packed));
65
Harald Welteec8b4502010-02-20 20:34:29 +010066
67/* Chapter 9.1 */
Harald Weltebe145192011-08-18 11:45:18 +020068/* \brief RSL Message Discriminator: RLL */
Harald Welteec8b4502010-02-20 20:34:29 +010069#define ABIS_RSL_MDISC_RLL 0x02
Harald Weltebe145192011-08-18 11:45:18 +020070/* \brief RSL Message Discriminator: Dedicated Channel */
Harald Welteec8b4502010-02-20 20:34:29 +010071#define ABIS_RSL_MDISC_DED_CHAN 0x08
Harald Weltebe145192011-08-18 11:45:18 +020072/* \brief RSL Message Discriminator: Common Channel */
Harald Welteec8b4502010-02-20 20:34:29 +010073#define ABIS_RSL_MDISC_COM_CHAN 0x0c
Harald Weltebe145192011-08-18 11:45:18 +020074/* \brief RSL Message Discriminator: TRX Management */
Harald Welteec8b4502010-02-20 20:34:29 +010075#define ABIS_RSL_MDISC_TRX 0x10
Harald Weltebe145192011-08-18 11:45:18 +020076/* \brief RSL Message Discriminator: Location Service */
Harald Welteec8b4502010-02-20 20:34:29 +010077#define ABIS_RSL_MDISC_LOC 0x20
Harald Weltebe145192011-08-18 11:45:18 +020078/* \brief RSL Message Discriminator: ip.access */
Harald Welteec8b4502010-02-20 20:34:29 +010079#define ABIS_RSL_MDISC_IPACCESS 0x7e
80#define ABIS_RSL_MDISC_TRANSP 0x01
81
Harald Weltebe145192011-08-18 11:45:18 +020082/* \brief Check if given RSL message discriminator is transparent */
Harald Welteec8b4502010-02-20 20:34:29 +010083#define ABIS_RSL_MDISC_IS_TRANSP(x) (x & 0x01)
84
Neels Hofmeyr9e57a5a2015-12-21 11:20:14 +010085/* \brief RSL Message Type (Chapter 9.1) */
Harald Welteec8b4502010-02-20 20:34:29 +010086enum abis_rsl_msgtype {
87 /* Radio Link Layer Management */
88 RSL_MT_DATA_REQ = 0x01,
89 RSL_MT_DATA_IND,
90 RSL_MT_ERROR_IND,
91 RSL_MT_EST_REQ,
92 RSL_MT_EST_CONF,
93 RSL_MT_EST_IND,
94 RSL_MT_REL_REQ,
95 RSL_MT_REL_CONF,
96 RSL_MT_REL_IND,
97 RSL_MT_UNIT_DATA_REQ,
98 RSL_MT_UNIT_DATA_IND, /* 0x0b */
Andreas Eversberg816e24c2010-06-25 02:50:56 +020099 RSL_MT_SUSP_REQ, /* non-standard elements */
100 RSL_MT_SUSP_CONF,
101 RSL_MT_RES_REQ,
102 RSL_MT_RECON_REQ, /* 0x0f */
Harald Welteec8b4502010-02-20 20:34:29 +0100103
104 /* Common Channel Management / TRX Management */
105 RSL_MT_BCCH_INFO = 0x11,
106 RSL_MT_CCCH_LOAD_IND,
107 RSL_MT_CHAN_RQD,
108 RSL_MT_DELETE_IND,
109 RSL_MT_PAGING_CMD,
110 RSL_MT_IMMEDIATE_ASSIGN_CMD,
111 RSL_MT_SMS_BC_REQ,
Harald Welte6eb7d6c2010-07-13 13:48:13 +0200112 RSL_MT_CHAN_CONF, /* non-standard element */
Harald Welteec8b4502010-02-20 20:34:29 +0100113 /* empty */
114 RSL_MT_RF_RES_IND = 0x19,
115 RSL_MT_SACCH_FILL,
116 RSL_MT_OVERLOAD,
117 RSL_MT_ERROR_REPORT,
118 RSL_MT_SMS_BC_CMD,
119 RSL_MT_CBCH_LOAD_IND,
120 RSL_MT_NOT_CMD, /* 0x1f */
121
122 /* Dedicate Channel Management */
123 RSL_MT_CHAN_ACTIV = 0x21,
124 RSL_MT_CHAN_ACTIV_ACK,
125 RSL_MT_CHAN_ACTIV_NACK,
126 RSL_MT_CONN_FAIL,
127 RSL_MT_DEACTIVATE_SACCH,
128 RSL_MT_ENCR_CMD,
129 RSL_MT_HANDO_DET,
130 RSL_MT_MEAS_RES,
131 RSL_MT_MODE_MODIFY_REQ,
132 RSL_MT_MODE_MODIFY_ACK,
133 RSL_MT_MODE_MODIFY_NACK,
134 RSL_MT_PHY_CONTEXT_REQ,
135 RSL_MT_PHY_CONTEXT_CONF,
136 RSL_MT_RF_CHAN_REL,
137 RSL_MT_MS_POWER_CONTROL,
138 RSL_MT_BS_POWER_CONTROL, /* 0x30 */
139 RSL_MT_PREPROC_CONFIG,
140 RSL_MT_PREPROC_MEAS_RES,
141 RSL_MT_RF_CHAN_REL_ACK,
142 RSL_MT_SACCH_INFO_MODIFY,
143 RSL_MT_TALKER_DET,
144 RSL_MT_LISTENER_DET,
145 RSL_MT_REMOTE_CODEC_CONF_REP,
146 RSL_MT_RTD_REP,
147 RSL_MT_PRE_HANDO_NOTIF,
148 RSL_MT_MR_CODEC_MOD_REQ,
149 RSL_MT_MR_CODEC_MOD_ACK,
150 RSL_MT_MR_CODEC_MOD_NACK,
151 RSL_MT_MR_CODEC_MOD_PER,
152 RSL_MT_TFO_REP,
153 RSL_MT_TFO_MOD_REQ, /* 0x3f */
154 RSL_MT_LOCATION_INFO = 0x41,
155
156 /* ip.access specific RSL message types */
157 RSL_MT_IPAC_DIR_RETR_ENQ = 0x40,
158 RSL_MT_IPAC_PDCH_ACT = 0x48,
159 RSL_MT_IPAC_PDCH_ACT_ACK,
160 RSL_MT_IPAC_PDCH_ACT_NACK,
161 RSL_MT_IPAC_PDCH_DEACT = 0x4b,
162 RSL_MT_IPAC_PDCH_DEACT_ACK,
163 RSL_MT_IPAC_PDCH_DEACT_NACK,
164 RSL_MT_IPAC_CONNECT_MUX = 0x50,
165 RSL_MT_IPAC_CONNECT_MUX_ACK,
166 RSL_MT_IPAC_CONNECT_MUX_NACK,
167 RSL_MT_IPAC_BIND_MUX = 0x53,
168 RSL_MT_IPAC_BIND_MUX_ACK,
169 RSL_MT_IPAC_BIND_MUX_NACK,
170 RSL_MT_IPAC_DISC_MUX = 0x56,
171 RSL_MT_IPAC_DISC_MUX_ACK,
172 RSL_MT_IPAC_DISC_MUX_NACK,
173 RSL_MT_IPAC_CRCX = 0x70, /* Bind to local BTS RTP port */
174 RSL_MT_IPAC_CRCX_ACK,
175 RSL_MT_IPAC_CRCX_NACK,
176 RSL_MT_IPAC_MDCX = 0x73,
177 RSL_MT_IPAC_MDCX_ACK,
178 RSL_MT_IPAC_MDCX_NACK,
179 RSL_MT_IPAC_DLCX_IND = 0x76,
180 RSL_MT_IPAC_DLCX = 0x77,
181 RSL_MT_IPAC_DLCX_ACK,
182 RSL_MT_IPAC_DLCX_NACK,
183};
184
Harald Welte8f2c7e52011-08-17 18:52:03 +0200185/*! \brief Siemens vendor-specific RSL message types */
Harald Welteec8b4502010-02-20 20:34:29 +0100186enum abis_rsl_msgtype_siemens {
187 RSL_MT_SIEMENS_MRPCI = 0x41,
188 RSL_MT_SIEMENS_INTRAC_HO_COND_IND = 0x42,
189 RSL_MT_SIEMENS_INTERC_HO_COND_IND = 0x43,
190 RSL_MT_SIEMENS_FORCED_HO_REQ = 0x44,
191 RSL_MT_SIEMENS_PREF_AREA_REQ = 0x45,
192 RSL_MT_SIEMENS_PREF_AREA = 0x46,
193 RSL_MT_SIEMENS_START_TRACE = 0x47,
194 RSL_MT_SIEMENS_START_TRACE_ACK = 0x48,
195 RSL_MT_SIEMENS_STOP_TRACE = 0x49,
196 RSL_MT_SIEMENS_TRMR = 0x4a,
197 RSL_MT_SIEMENS_HO_FAIL_IND = 0x4b,
198 RSL_MT_SIEMENS_STOP_TRACE_ACK = 0x4c,
199 RSL_MT_SIEMENS_UPLF = 0x4d,
200 RSL_MT_SIEMENS_UPLB = 0x4e,
201 RSL_MT_SIEMENS_SET_SYS_INFO_10 = 0x4f,
202 RSL_MT_SIEMENS_MODIF_COND_IND = 0x50,
203};
204
Harald Welte8f2c7e52011-08-17 18:52:03 +0200205/*! \brief RSL Information Element Identifiers (Chapter 9.3) */
Harald Welteec8b4502010-02-20 20:34:29 +0100206enum abis_rsl_ie {
207 RSL_IE_CHAN_NR = 0x01,
208 RSL_IE_LINK_IDENT,
209 RSL_IE_ACT_TYPE,
210 RSL_IE_BS_POWER,
211 RSL_IE_CHAN_IDENT,
212 RSL_IE_CHAN_MODE,
213 RSL_IE_ENCR_INFO,
214 RSL_IE_FRAME_NUMBER,
215 RSL_IE_HANDO_REF,
216 RSL_IE_L1_INFO,
217 RSL_IE_L3_INFO,
218 RSL_IE_MS_IDENTITY,
219 RSL_IE_MS_POWER,
220 RSL_IE_PAGING_GROUP,
221 RSL_IE_PAGING_LOAD,
222 RSL_IE_PYHS_CONTEXT = 0x10,
223 RSL_IE_ACCESS_DELAY,
224 RSL_IE_RACH_LOAD,
225 RSL_IE_REQ_REFERENCE,
226 RSL_IE_RELEASE_MODE,
227 RSL_IE_RESOURCE_INFO,
228 RSL_IE_RLM_CAUSE,
229 RSL_IE_STARTNG_TIME,
230 RSL_IE_TIMING_ADVANCE,
231 RSL_IE_UPLINK_MEAS,
232 RSL_IE_CAUSE,
233 RSL_IE_MEAS_RES_NR,
234 RSL_IE_MSG_ID,
235 /* reserved */
236 RSL_IE_SYSINFO_TYPE = 0x1e,
237 RSL_IE_MS_POWER_PARAM,
238 RSL_IE_BS_POWER_PARAM,
239 RSL_IE_PREPROC_PARAM,
240 RSL_IE_PREPROC_MEAS,
241 RSL_IE_IMM_ASS_INFO, /* Phase 1 (3.6.0), later Full below */
242 RSL_IE_SMSCB_INFO = 0x24,
243 RSL_IE_MS_TIMING_OFFSET,
244 RSL_IE_ERR_MSG,
245 RSL_IE_FULL_BCCH_INFO,
246 RSL_IE_CHAN_NEEDED,
247 RSL_IE_CB_CMD_TYPE,
248 RSL_IE_SMSCB_MSG,
249 RSL_IE_FULL_IMM_ASS_INFO,
250 RSL_IE_SACCH_INFO,
251 RSL_IE_CBCH_LOAD_INFO,
252 RSL_IE_SMSCB_CHAN_INDICATOR,
253 RSL_IE_GROUP_CALL_REF,
254 RSL_IE_CHAN_DESC = 0x30,
255 RSL_IE_NCH_DRX_INFO,
256 RSL_IE_CMD_INDICATOR,
257 RSL_IE_EMLPP_PRIO,
258 RSL_IE_UIC,
259 RSL_IE_MAIN_CHAN_REF,
260 RSL_IE_MR_CONFIG,
261 RSL_IE_MR_CONTROL,
262 RSL_IE_SUP_CODEC_TYPES,
263 RSL_IE_CODEC_CONFIG,
264 RSL_IE_RTD,
265 RSL_IE_TFO_STATUS,
266 RSL_IE_LLP_APDU,
267 /* Siemens vendor-specific */
268 RSL_IE_SIEMENS_MRPCI = 0x40,
269 RSL_IE_SIEMENS_PREF_AREA_TYPE = 0x43,
270 RSL_IE_SIEMENS_ININ_CELL_HO_PAR = 0x45,
271 RSL_IE_SIEMENS_TRACE_REF_NR = 0x46,
272 RSL_IE_SIEMENS_INT_TRACE_IDX = 0x47,
273 RSL_IE_SIEMENS_L2_HDR_INFO = 0x48,
274 RSL_IE_SIEMENS_HIGHEST_RATE = 0x4e,
275 RSL_IE_SIEMENS_SUGGESTED_RATE = 0x4f,
276
277 /* ip.access */
278 RSL_IE_IPAC_SRTP_CONFIG = 0xe0,
279 RSL_IE_IPAC_PROXY_UDP = 0xe1,
280 RSL_IE_IPAC_BSCMPL_TOUT = 0xe2,
281 RSL_IE_IPAC_REMOTE_IP = 0xf0,
282 RSL_IE_IPAC_REMOTE_PORT = 0xf1,
283 RSL_IE_IPAC_RTP_PAYLOAD = 0xf2,
284 RSL_IE_IPAC_LOCAL_PORT = 0xf3,
285 RSL_IE_IPAC_SPEECH_MODE = 0xf4,
286 RSL_IE_IPAC_LOCAL_IP = 0xf5,
287 RSL_IE_IPAC_CONN_STAT = 0xf6,
288 RSL_IE_IPAC_HO_C_PARMS = 0xf7,
289 RSL_IE_IPAC_CONN_ID = 0xf8,
290 RSL_IE_IPAC_RTP_CSD_FMT = 0xf9,
291 RSL_IE_IPAC_RTP_JIT_BUF = 0xfa,
292 RSL_IE_IPAC_RTP_COMPR = 0xfb,
293 RSL_IE_IPAC_RTP_PAYLOAD2= 0xfc,
294 RSL_IE_IPAC_RTP_MPLEX = 0xfd,
295 RSL_IE_IPAC_RTP_MPLEX_ID= 0xfe,
296};
297
Harald Welte6e363e72016-11-16 16:58:52 +0100298/* Ericsson specific IEs, clash with above partially, so they're not
299 * part of the enum */
300#define RSL_IE_ERIC_INST_NR 0x48
301#define RSL_IE_ERIC_PGSL_TIMERS 0x49
302#define RSL_IE_ERIC_REPEAT_DL_FACCH 0x4a
303#define RSL_IE_ERIC_POWER_INFO 0xf0
304#define RSL_IE_ERIC_MOBILE_ID 0xf1
305#define RSL_IE_ERIC_BCCH_MAPPING 0xf2
306#define RSL_IE_ERIC_PACKET_PAG_IND 0xf3
307#define RSL_IE_ERIC_CNTR_CTRL 0xf4
308#define RSL_IE_ERIC_CNTR_CTRL_ACK 0xf5
309#define RSL_IE_ERIC_CNTR_REPORT 0xf6
310#define RSL_IE_ERIC_ICP_CONN 0xf7
311#define RSL_IE_ERIC_EMR_SUPPORT 0xf8
312#define RSL_IE_ERIC_EGPRS_REQ_REF 0xf9
313#define RSL_IE_ERIC_VGCS_REL 0xfa
314#define RSL_IE_ERIC_REP_PER_NCH 0xfb
315#define RSL_IE_ERIC_NY2 0xfc
316#define RSL_IE_ERIC_T3115 0xfd
317#define RSL_IE_ERIC_ACTIVATE_FLAG 0xfe
318#define RSL_IE_ERIC_FULL_NCH_INFO 0xff
319
Harald Welteec8b4502010-02-20 20:34:29 +0100320/* Chapter 9.3.1 */
321#define RSL_CHAN_NR_MASK 0xf8
Neels Hofmeyr15b96ff2016-07-18 23:33:48 +0200322#define RSL_CHAN_NR_1 0x08 /*< bit to add for 2nd,... lchan */
Harald Welteec8b4502010-02-20 20:34:29 +0100323#define RSL_CHAN_Bm_ACCHs 0x08
324#define RSL_CHAN_Lm_ACCHs 0x10 /* .. 0x18 */
325#define RSL_CHAN_SDCCH4_ACCH 0x20 /* .. 0x38 */
326#define RSL_CHAN_SDCCH8_ACCH 0x40 /* ...0x78 */
327#define RSL_CHAN_BCCH 0x80
328#define RSL_CHAN_RACH 0x88
329#define RSL_CHAN_PCH_AGCH 0x90
Neels Hofmeyrfd80f5a2016-07-14 03:21:05 +0200330#define RSL_CHAN_OSMO_PDCH 0xc0 /*< non-standard, for dyn TS */
Harald Welteec8b4502010-02-20 20:34:29 +0100331
332/* Chapter 9.3.3 */
333#define RSL_ACT_TYPE_INITIAL 0x00
334#define RSL_ACT_TYPE_REACT 0x80
335#define RSL_ACT_INTRA_IMM_ASS 0x00
336#define RSL_ACT_INTRA_NORM_ASS 0x01
337#define RSL_ACT_INTER_ASYNC 0x02
338#define RSL_ACT_INTER_SYNC 0x03
339#define RSL_ACT_SECOND_ADD 0x04
340#define RSL_ACT_SECOND_MULTI 0x05
Neels Hofmeyrfd80f5a2016-07-14 03:21:05 +0200341#define RSL_ACT_OSMO_PDCH 0x0f /*< non-standard, for dyn TS */
Harald Welteec8b4502010-02-20 20:34:29 +0100342
Harald Welte8f2c7e52011-08-17 18:52:03 +0200343/*! \brief RSL Channel Mode IF (Chapter 9.3.6) */
Harald Welteec8b4502010-02-20 20:34:29 +0100344struct rsl_ie_chan_mode {
345 uint8_t dtx_dtu;
346 uint8_t spd_ind;
347 uint8_t chan_rt;
348 uint8_t chan_rate;
349} __attribute__ ((packed));
350#define RSL_CMOD_DTXu 0x01 /* uplink */
351#define RSL_CMOD_DTXd 0x02 /* downlink */
352enum rsl_cmod_spd {
353 RSL_CMOD_SPD_SPEECH = 0x01,
354 RSL_CMOD_SPD_DATA = 0x02,
355 RSL_CMOD_SPD_SIGN = 0x03,
356};
357#define RSL_CMOD_CRT_SDCCH 0x01
358#define RSL_CMOD_CRT_TCH_Bm 0x08 /* full-rate */
359#define RSL_CMOD_CRT_TCH_Lm 0x09 /* half-rate */
360/* FIXME: More CRT types */
361/* Speech */
362#define RSL_CMOD_SP_GSM1 0x01
363#define RSL_CMOD_SP_GSM2 0x11
364#define RSL_CMOD_SP_GSM3 0x21
Harald Welteeed26112012-08-24 15:35:34 +0200365/* non-transparent data */
366#define RSL_CMOD_CSD_NT_43k5 0x74
367#define RSL_CMOD_CSD_NT_28k8 0x71
368#define RSL_CMOD_CSD_NT_14k5 0x58
369#define RSL_CMOD_CSD_NT_12k0 0x50
370#define RSL_CMOD_CSD_NT_6k0 0x51
371/* legacy #defines with wrong name */
372#define RSL_CMOD_SP_NT_14k5 RSL_CMOD_CSD_NT_14k5
373#define RSL_CMOD_SP_NT_12k0 RSL_CMOD_CSD_NT_12k0
374#define RSL_CMOD_SP_NT_6k0 RSL_CMOD_CSD_NT_6k0
375/* transparent data */
376#define RSL_CMOD_CSD_T_32000 0x38
377#define RSL_CMOD_CSD_T_29000 0x39
378#define RSL_CMOD_CSD_T_14400 0x18
379#define RSL_CMOD_CSD_T_9600 0x10
380#define RSL_CMOD_CSD_T_4800 0x11
381#define RSL_CMOD_CSD_T_2400 0x12
382#define RSL_CMOD_CSD_T_1200 0x13
383#define RSL_CMOD_CSD_T_600 0x14
384#define RSL_CMOD_CSD_T_1200_75 0x15
Harald Welteec8b4502010-02-20 20:34:29 +0100385
Harald Welte8f2c7e52011-08-17 18:52:03 +0200386/*! \brief RSL Channel Identification IE (Chapter 9.3.5) */
Harald Welteec8b4502010-02-20 20:34:29 +0100387struct rsl_ie_chan_ident {
388 /* GSM 04.08 10.5.2.5 */
389 struct {
390 uint8_t iei;
391 uint8_t chan_nr; /* enc_chan_nr */
392 uint8_t oct3;
393 uint8_t oct4;
394 } chan_desc;
395#if 0 /* spec says we need this but Abissim doesn't use it */
396 struct {
397 uint8_t tag;
398 uint8_t len;
399 } mobile_alloc;
400#endif
401} __attribute__ ((packed));
402
403/* Chapter 9.3.22 */
404#define RLL_CAUSE_T200_EXPIRED 0x01
405#define RLL_CAUSE_REEST_REQ 0x02
406#define RLL_CAUSE_UNSOL_UA_RESP 0x03
407#define RLL_CAUSE_UNSOL_DM_RESP 0x04
408#define RLL_CAUSE_UNSOL_DM_RESP_MF 0x05
409#define RLL_CAUSE_UNSOL_SPRV_RESP 0x06
410#define RLL_CAUSE_SEQ_ERR 0x07
411#define RLL_CAUSE_UFRM_INC_PARAM 0x08
412#define RLL_CAUSE_SFRM_INC_PARAM 0x09
413#define RLL_CAUSE_IFRM_INC_MBITS 0x0a
414#define RLL_CAUSE_IFRM_INC_LEN 0x0b
415#define RLL_CAUSE_FRM_UNIMPL 0x0c
416#define RLL_CAUSE_SABM_MF 0x0d
417#define RLL_CAUSE_SABM_INFO_NOTALL 0x0e
418
419/* Chapter 9.3.26 */
420#define RSL_ERRCLS_NORMAL 0x00
421#define RSL_ERRCLS_RESOURCE_UNAVAIL 0x20
422#define RSL_ERRCLS_SERVICE_UNAVAIL 0x30
423#define RSL_ERRCLS_SERVICE_UNIMPL 0x40
424#define RSL_ERRCLS_INVAL_MSG 0x50
425#define RSL_ERRCLS_PROTO_ERROR 0x60
426#define RSL_ERRCLS_INTERWORKING 0x70
427
428/* normal event */
429#define RSL_ERR_RADIO_IF_FAIL 0x00
430#define RSL_ERR_RADIO_LINK_FAIL 0x01
431#define RSL_ERR_HANDOVER_ACC_FAIL 0x02
432#define RSL_ERR_TALKER_ACC_FAIL 0x03
433#define RSL_ERR_OM_INTERVENTION 0x07
434#define RSL_ERR_NORMAL_UNSPEC 0x0f
435#define RSL_ERR_T_MSRFPCI_EXP 0x18
436/* resource unavailable */
437#define RSL_ERR_EQUIPMENT_FAIL 0x20
438#define RSL_ERR_RR_UNAVAIL 0x21
439#define RSL_ERR_TERR_CH_FAIL 0x22
440#define RSL_ERR_CCCH_OVERLOAD 0x23
441#define RSL_ERR_ACCH_OVERLOAD 0x24
442#define RSL_ERR_PROCESSOR_OVERLOAD 0x25
443#define RSL_ERR_RES_UNAVAIL 0x2f
444/* service or option not available */
445#define RSL_ERR_TRANSC_UNAVAIL 0x30
446#define RSL_ERR_SERV_OPT_UNAVAIL 0x3f
447/* service or option not implemented */
448#define RSL_ERR_ENCR_UNIMPL 0x40
449#define RSL_ERR_SERV_OPT_UNIMPL 0x4f
450/* invalid message */
451#define RSL_ERR_RCH_ALR_ACTV_ALLOC 0x50
452#define RSL_ERR_INVALID_MESSAGE 0x5f
453/* protocol error */
454#define RSL_ERR_MSG_DISCR 0x60
455#define RSL_ERR_MSG_TYPE 0x61
456#define RSL_ERR_MSG_SEQ 0x62
457#define RSL_ERR_IE_ERROR 0x63
458#define RSL_ERR_MAND_IE_ERROR 0x64
459#define RSL_ERR_OPT_IE_ERROR 0x65
460#define RSL_ERR_IE_NONEXIST 0x66
461#define RSL_ERR_IE_LENGTH 0x67
462#define RSL_ERR_IE_CONTENT 0x68
463#define RSL_ERR_PROTO 0x6f
464/* interworking */
465#define RSL_ERR_INTERWORKING 0x7f
466
467/* Chapter 9.3.30 */
468#define RSL_SYSTEM_INFO_8 0x00
469#define RSL_SYSTEM_INFO_1 0x01
470#define RSL_SYSTEM_INFO_2 0x02
471#define RSL_SYSTEM_INFO_3 0x03
472#define RSL_SYSTEM_INFO_4 0x04
473#define RSL_SYSTEM_INFO_5 0x05
474#define RSL_SYSTEM_INFO_6 0x06
475#define RSL_SYSTEM_INFO_7 0x07
476#define RSL_SYSTEM_INFO_16 0x08
477#define RSL_SYSTEM_INFO_17 0x09
478#define RSL_SYSTEM_INFO_2bis 0x0a
479#define RSL_SYSTEM_INFO_2ter 0x0b
480#define RSL_SYSTEM_INFO_5bis 0x0d
481#define RSL_SYSTEM_INFO_5ter 0x0e
482#define RSL_SYSTEM_INFO_10 0x0f
Harald Welte3d732272011-06-25 21:39:01 +0200483#define RSL_EXT_MEAS_ORDER 0x47
Harald Welteec8b4502010-02-20 20:34:29 +0100484#define RSL_MEAS_INFO 0x48
485#define RSL_SYSTEM_INFO_13 0x28
Philipp00b15392016-11-14 12:34:15 +0100486#define RSL_ERIC_SYSTEM_INFO_13 0x0C
Harald Welteec8b4502010-02-20 20:34:29 +0100487#define RSL_SYSTEM_INFO_2quater 0x29
488#define RSL_SYSTEM_INFO_9 0x2a
489#define RSL_SYSTEM_INFO_18 0x2b
490#define RSL_SYSTEM_INFO_19 0x2c
491#define RSL_SYSTEM_INFO_20 0x2d
492
493/* Chapter 9.3.40 */
494#define RSL_CHANNEED_ANY 0x00
495#define RSL_CHANNEED_SDCCH 0x01
496#define RSL_CHANNEED_TCH_F 0x02
497#define RSL_CHANNEED_TCH_ForH 0x03
498
Harald Welte8f2c7e52011-08-17 18:52:03 +0200499/*! \brief RSL Cell Broadcast Command (Chapter 9.3.45) */
Alex Badea84930182010-11-27 23:34:46 +0200500struct rsl_ie_cb_cmd_type {
501 uint8_t last_block:2;
502 uint8_t spare:1;
503 uint8_t def_bcast:1;
504 uint8_t command:4;
505} __attribute__ ((packed));
506/* ->command */
507#define RSL_CB_CMD_TYPE_NORMAL 0x00
508#define RSL_CB_CMD_TYPE_SCHEDULE 0x08
509#define RSL_CB_CMD_TYPE_DEFAULT 0x0e
510#define RSL_CB_CMD_TYPE_NULL 0x0f
511/* ->def_bcast */
512#define RSL_CB_CMD_DEFBCAST_NORMAL 0
513#define RSL_CB_CMD_DEFBCAST_NULL 1
514/* ->last_block */
515#define RSL_CB_CMD_LASTBLOCK_4 0
516#define RSL_CB_CMD_LASTBLOCK_1 1
517#define RSL_CB_CMD_LASTBLOCK_2 2
518#define RSL_CB_CMD_LASTBLOCK_3 3
519
Harald Welteec8b4502010-02-20 20:34:29 +0100520/* Chapter 3.3.2.3 Brocast control channel */
521/* CCCH-CONF, NC is not combined */
522#define RSL_BCCH_CCCH_CONF_1_NC 0x00
523#define RSL_BCCH_CCCH_CONF_1_C 0x01
524#define RSL_BCCH_CCCH_CONF_2_NC 0x02
525#define RSL_BCCH_CCCH_CONF_3_NC 0x04
526#define RSL_BCCH_CCCH_CONF_4_NC 0x06
527
528/* BS-PA-MFRMS */
529#define RSL_BS_PA_MFRMS_2 0x00
530#define RSL_BS_PA_MFRMS_3 0x01
531#define RSL_BS_PA_MFRMS_4 0x02
532#define RSL_BS_PA_MFRMS_5 0x03
533#define RSL_BS_PA_MFRMS_6 0x04
534#define RSL_BS_PA_MFRMS_7 0x05
535#define RSL_BS_PA_MFRMS_8 0x06
536#define RSL_BS_PA_MFRMS_9 0x07
537
538/* RSL_IE_IPAC_RTP_PAYLOAD[2] */
539enum rsl_ipac_rtp_payload {
540 RSL_IPAC_RTP_GSM = 1,
541 RSL_IPAC_RTP_EFR,
542 RSL_IPAC_RTP_AMR,
543 RSL_IPAC_RTP_CSD,
544 RSL_IPAC_RTP_MUX,
545};
546
547/* RSL_IE_IPAC_SPEECH_MODE, lower four bits */
548enum rsl_ipac_speech_mode_s {
549 RSL_IPAC_SPEECH_GSM_FR = 0, /* GSM FR (Type 1, FS) */
550 RSL_IPAC_SPEECH_GSM_EFR = 1, /* GSM EFR (Type 2, FS) */
551 RSL_IPAC_SPEECH_GSM_AMR_FR = 2, /* GSM AMR/FR (Type 3, FS) */
552 RSL_IPAC_SPEECH_GSM_HR = 3, /* GSM HR (Type 1, HS) */
553 RSL_IPAC_SPEECH_GSM_AMR_HR = 5, /* GSM AMR/hr (Type 3, HS) */
554 RSL_IPAC_SPEECH_AS_RTP = 0xf, /* As specified by RTP Payload IE */
555};
556/* RSL_IE_IPAC_SPEECH_MODE, upper four bits */
557enum rsl_ipac_speech_mode_m {
558 RSL_IPAC_SPEECH_M_RXTX = 0, /* Send and Receive */
559 RSL_IPAC_SPEECH_M_RX = 1, /* Receive only */
560 RSL_IPAC_SPEECH_M_TX = 2, /* Send only */
561};
562
563/* RSL_IE_IPAC_RTP_CSD_FMT, lower four bits */
564enum rsl_ipac_rtp_csd_format_d {
565 RSL_IPAC_RTP_CSD_EXT_TRAU = 0,
566 RSL_IPAC_RTP_CSD_NON_TRAU = 1,
567 RSL_IPAC_RTP_CSD_TRAU_BTS = 2,
568 RSL_IPAC_RTP_CSD_IWF_FREE = 3,
569};
570/* RSL_IE_IPAC_RTP_CSD_FMT, upper four bits */
571enum rsl_ipac_rtp_csd_format_ir {
572 RSL_IPAC_RTP_CSD_IR_8k = 0,
573 RSL_IPAC_RTP_CSD_IR_16k = 1,
574 RSL_IPAC_RTP_CSD_IR_32k = 2,
575 RSL_IPAC_RTP_CSD_IR_64k = 3,
576};
577
578/* Siemens vendor-specific RSL extensions */
579struct rsl_mrpci {
580 uint8_t power_class:3,
581 vgcs_capable:1,
582 vbs_capable:1,
583 gsm_phase:2;
584} __attribute__ ((packed));
585
586enum rsl_mrpci_pwrclass {
587 RSL_MRPCI_PWRC_1 = 0,
588 RSL_MRPCI_PWRC_2 = 1,
589 RSL_MRPCI_PWRC_3 = 2,
590 RSL_MRPCI_PWRC_4 = 3,
591 RSL_MRPCI_PWRC_5 = 4,
592};
593enum rsl_mrpci_phase {
594 RSL_MRPCI_PHASE_1 = 0,
595 /* reserved */
596 RSL_MRPCI_PHASE_2 = 2,
597 RSL_MRPCI_PHASE_2PLUS = 3,
598};
599
Holger Hans Peter Freyther0357e9b2012-12-06 11:57:31 +0100600/* 9.3.20 Release Mode */
601enum rsl_rel_mode {
602 RSL_REL_NORMAL = 0,
603 RSL_REL_LOCAL_END = 1,
604};
605
Harald Weltefad57522015-12-13 11:56:36 +0100606/*! \brief ip.access specific embedded information elements */
607enum rsl_ipac_embedded_ie {
608 RSL_IPAC_EIE_RXLEV = 0x00,
609 RSL_IPAC_EIE_RXQUAL = 0x01,
610 RSL_IPAC_EIE_FREQ_ERR = 0x02,
611 RSL_IPAC_EIE_TIMING_ERR = 0x03,
612 RSL_IPAC_EIE_MEAS_AVG_CFG = 0x04,
613 RSL_IPAC_EIE_BS_PWR_CTL = 0x05,
614 RSL_IPAC_EIE_MS_PWR_CTL = 0x06,
615 RSL_IPAC_EIE_HANDO_THRESH = 0x07,
616 RSL_IPAC_EIE_NCELL_DEFAULTS = 0x08,
617 RSL_IPAC_EIE_NCELL_LIST = 0x09,
618 RSL_IPAC_EIE_PC_THRESH_COMP = 0x0a,
619 RSL_IPAC_EIE_HO_THRESH_COMP = 0x0b,
620 RSL_IPAC_EIE_HO_CAUSE = 0x0c,
621 RSL_IPAC_EIE_HO_CANDIDATES = 0x0d,
622 RSL_IPAC_EIE_NCELL_BA_CHG_LIST = 0x0e,
623 RSL_IPAC_EIE_NUM_OF_MS = 0x10,
624 RSL_IPAC_EIE_HO_CAND_EXT = 0x11,
625 RSL_IPAC_EIE_NCELL_DEF_EXT = 0x12,
626 RSL_IPAC_EIE_NCELL_LIST_EXT = 0x13,
627 RSL_IPAC_EIE_MASTER_KEY = 0x14,
628 RSL_IPAC_EIE_MASTER_SALT = 0x15,
629};
630
Sylvain Munautdca7d2c2012-04-18 21:53:23 +0200631/*! @} */