blob: c7a7d8aafb7c32e1448d525c89946e63d6e663f5 [file] [log] [blame]
Neels Hofmeyr17518fe2017-06-20 04:35:06 +02001/*! \file gsm_08_58.h
2 * GSM Radio Signalling Link messages on the A-bis interface.
Harald Welteec8b4502010-02-20 20:34:29 +01003 * 3GPP TS 08.58 version 8.6.0 Release 1999 / ETSI TS 100 596 V8.6.0 */
Neels Hofmeyr17518fe2017-06-20 04:35:06 +02004/*
5 * (C) 2008 by Harald Welte <laforge@gnumonks.org>
Harald Welteec8b4502010-02-20 20:34:29 +01006 * All Rights Reserved
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 *
22 */
23
Neels Hofmeyr17518fe2017-06-20 04:35:06 +020024#pragma once
25
Harald Welteec8b4502010-02-20 20:34:29 +010026#include <stdint.h>
27
Pau Espin Pedrol42908032018-10-10 17:04:28 +020028#include <osmocom/core/endian.h>
29
Harald Welte8f2c7e52011-08-17 18:52:03 +020030/*! \addtogroup rsl
31 * @{
Neels Hofmeyr17518fe2017-06-20 04:35:06 +020032 * \file gsm_08_58.h */
Harald Welte8f2c7e52011-08-17 18:52:03 +020033
Pau Espin Pedrol42908032018-10-10 17:04:28 +020034/* Link Identifier 9.3.2 */
35union abis_rsl_link_id {
36#if OSMO_IS_BIG_ENDIAN
37 uint8_t cbits:2,
38 na:1,
39 reserved:2;
40 sapi:3;
41#elif OSMO_IS_LITTLE_ENDIAN
42 uint8_t sapi:3,
43 reserved:2,
44 na:1,
45 cbits:2;
46#endif
47 uint8_t link_id;
48} __attribute__ ((packed));
49#define ABIS_RSL_LINK_ID_CBITS_FACCH_SDCCH 0x00
50#define ABIS_RSL_LINK_ID_CBITS_SACCH 0x01
51
Neels Hofmeyr87e45502017-06-20 00:17:59 +020052/*! RSL common header */
Harald Welteec8b4502010-02-20 20:34:29 +010053struct abis_rsl_common_hdr {
Neels Hofmeyr87e45502017-06-20 00:17:59 +020054 uint8_t msg_discr; /*!< message discriminator (ABIS_RSL_MDISC_*) */
55 uint8_t msg_type; /*!< message type (\ref abis_rsl_msgtype) */
56 uint8_t data[0]; /*!< actual payload data */
Harald Welteec8b4502010-02-20 20:34:29 +010057} __attribute__ ((packed));
58
Neels Hofmeyr87e45502017-06-20 00:17:59 +020059/* RSL RLL header (Chapter 8.3) */
Harald Welteec8b4502010-02-20 20:34:29 +010060struct abis_rsl_rll_hdr {
61 struct abis_rsl_common_hdr c;
Neels Hofmeyr87e45502017-06-20 00:17:59 +020062 uint8_t ie_chan; /*!< \ref RSL_IE_CHAN_NR (tag) */
63 uint8_t chan_nr; /*!< RSL channel number (value) */
64 uint8_t ie_link_id; /*!< \ref RSL_IE_LINK_IDENT (tag) */
Pau Espin Pedrol42908032018-10-10 17:04:28 +020065 union {
66 uint8_t link_id; /* API backward compat */
67 union abis_rsl_link_id link_id_fields; /*!< RSL link identifier (value) */
68 };
Neels Hofmeyr87e45502017-06-20 00:17:59 +020069 uint8_t data[0]; /*!< message payload data */
Harald Welteec8b4502010-02-20 20:34:29 +010070} __attribute__ ((packed));
71
Neels Hofmeyr87e45502017-06-20 00:17:59 +020072/* RSL Dedicated Channel header (Chapter 8.3 and 8.4) */
Harald Welteec8b4502010-02-20 20:34:29 +010073struct abis_rsl_dchan_hdr {
74 struct abis_rsl_common_hdr c;
Neels Hofmeyr87e45502017-06-20 00:17:59 +020075 uint8_t ie_chan; /*!< \ref RSL_IE_CHAN_NR (tag) */
76 uint8_t chan_nr; /*!< RSL channel number (value) */
77 uint8_t data[0]; /*!< message payload data */
Harald Welteec8b4502010-02-20 20:34:29 +010078} __attribute__ ((packed));
79
Neels Hofmeyr87e45502017-06-20 00:17:59 +020080/* RSL Common Channel header (Chapter 8.5) */
Harald Welte6eb7d6c2010-07-13 13:48:13 +020081struct abis_rsl_cchan_hdr {
82 struct abis_rsl_common_hdr c;
Neels Hofmeyr87e45502017-06-20 00:17:59 +020083 uint8_t ie_chan; /*!< \ref RSL_IE_CHAN_NR (tag) */
84 uint8_t chan_nr; /*!< RSL channel number (value) */
85 uint8_t data[0]; /*!< message payload data */
Harald Welte6eb7d6c2010-07-13 13:48:13 +020086} __attribute__ ((packed));
87
Harald Welteec8b4502010-02-20 20:34:29 +010088
89/* Chapter 9.1 */
Neels Hofmeyr87e45502017-06-20 00:17:59 +020090/* RSL Message Discriminator: RLL */
Harald Welteec8b4502010-02-20 20:34:29 +010091#define ABIS_RSL_MDISC_RLL 0x02
Neels Hofmeyr87e45502017-06-20 00:17:59 +020092/* RSL Message Discriminator: Dedicated Channel */
Harald Welteec8b4502010-02-20 20:34:29 +010093#define ABIS_RSL_MDISC_DED_CHAN 0x08
Neels Hofmeyr87e45502017-06-20 00:17:59 +020094/* RSL Message Discriminator: Common Channel */
Harald Welteec8b4502010-02-20 20:34:29 +010095#define ABIS_RSL_MDISC_COM_CHAN 0x0c
Neels Hofmeyr87e45502017-06-20 00:17:59 +020096/* RSL Message Discriminator: TRX Management */
Harald Welteec8b4502010-02-20 20:34:29 +010097#define ABIS_RSL_MDISC_TRX 0x10
Neels Hofmeyr87e45502017-06-20 00:17:59 +020098/* RSL Message Discriminator: Location Service */
Harald Welteec8b4502010-02-20 20:34:29 +010099#define ABIS_RSL_MDISC_LOC 0x20
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200100/* RSL Message Discriminator: ip.access */
Harald Welteec8b4502010-02-20 20:34:29 +0100101#define ABIS_RSL_MDISC_IPACCESS 0x7e
102#define ABIS_RSL_MDISC_TRANSP 0x01
103
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200104/* Check if given RSL message discriminator is transparent */
Harald Welteec8b4502010-02-20 20:34:29 +0100105#define ABIS_RSL_MDISC_IS_TRANSP(x) (x & 0x01)
106
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200107/* RSL Message Type (Chapter 9.1) */
Harald Welteec8b4502010-02-20 20:34:29 +0100108enum abis_rsl_msgtype {
109 /* Radio Link Layer Management */
110 RSL_MT_DATA_REQ = 0x01,
111 RSL_MT_DATA_IND,
112 RSL_MT_ERROR_IND,
113 RSL_MT_EST_REQ,
114 RSL_MT_EST_CONF,
115 RSL_MT_EST_IND,
116 RSL_MT_REL_REQ,
117 RSL_MT_REL_CONF,
118 RSL_MT_REL_IND,
119 RSL_MT_UNIT_DATA_REQ,
120 RSL_MT_UNIT_DATA_IND, /* 0x0b */
Andreas Eversberg816e24c2010-06-25 02:50:56 +0200121 RSL_MT_SUSP_REQ, /* non-standard elements */
122 RSL_MT_SUSP_CONF,
123 RSL_MT_RES_REQ,
124 RSL_MT_RECON_REQ, /* 0x0f */
Harald Welteec8b4502010-02-20 20:34:29 +0100125
126 /* Common Channel Management / TRX Management */
127 RSL_MT_BCCH_INFO = 0x11,
128 RSL_MT_CCCH_LOAD_IND,
129 RSL_MT_CHAN_RQD,
130 RSL_MT_DELETE_IND,
131 RSL_MT_PAGING_CMD,
132 RSL_MT_IMMEDIATE_ASSIGN_CMD,
133 RSL_MT_SMS_BC_REQ,
Harald Welte6eb7d6c2010-07-13 13:48:13 +0200134 RSL_MT_CHAN_CONF, /* non-standard element */
Harald Welteec8b4502010-02-20 20:34:29 +0100135 /* empty */
136 RSL_MT_RF_RES_IND = 0x19,
137 RSL_MT_SACCH_FILL,
138 RSL_MT_OVERLOAD,
139 RSL_MT_ERROR_REPORT,
140 RSL_MT_SMS_BC_CMD,
141 RSL_MT_CBCH_LOAD_IND,
142 RSL_MT_NOT_CMD, /* 0x1f */
143
144 /* Dedicate Channel Management */
145 RSL_MT_CHAN_ACTIV = 0x21,
146 RSL_MT_CHAN_ACTIV_ACK,
147 RSL_MT_CHAN_ACTIV_NACK,
148 RSL_MT_CONN_FAIL,
149 RSL_MT_DEACTIVATE_SACCH,
150 RSL_MT_ENCR_CMD,
151 RSL_MT_HANDO_DET,
152 RSL_MT_MEAS_RES,
153 RSL_MT_MODE_MODIFY_REQ,
154 RSL_MT_MODE_MODIFY_ACK,
155 RSL_MT_MODE_MODIFY_NACK,
156 RSL_MT_PHY_CONTEXT_REQ,
157 RSL_MT_PHY_CONTEXT_CONF,
158 RSL_MT_RF_CHAN_REL,
159 RSL_MT_MS_POWER_CONTROL,
160 RSL_MT_BS_POWER_CONTROL, /* 0x30 */
161 RSL_MT_PREPROC_CONFIG,
162 RSL_MT_PREPROC_MEAS_RES,
163 RSL_MT_RF_CHAN_REL_ACK,
164 RSL_MT_SACCH_INFO_MODIFY,
165 RSL_MT_TALKER_DET,
166 RSL_MT_LISTENER_DET,
167 RSL_MT_REMOTE_CODEC_CONF_REP,
168 RSL_MT_RTD_REP,
169 RSL_MT_PRE_HANDO_NOTIF,
170 RSL_MT_MR_CODEC_MOD_REQ,
171 RSL_MT_MR_CODEC_MOD_ACK,
172 RSL_MT_MR_CODEC_MOD_NACK,
173 RSL_MT_MR_CODEC_MOD_PER,
174 RSL_MT_TFO_REP,
175 RSL_MT_TFO_MOD_REQ, /* 0x3f */
176 RSL_MT_LOCATION_INFO = 0x41,
177
178 /* ip.access specific RSL message types */
179 RSL_MT_IPAC_DIR_RETR_ENQ = 0x40,
180 RSL_MT_IPAC_PDCH_ACT = 0x48,
181 RSL_MT_IPAC_PDCH_ACT_ACK,
182 RSL_MT_IPAC_PDCH_ACT_NACK,
183 RSL_MT_IPAC_PDCH_DEACT = 0x4b,
184 RSL_MT_IPAC_PDCH_DEACT_ACK,
185 RSL_MT_IPAC_PDCH_DEACT_NACK,
186 RSL_MT_IPAC_CONNECT_MUX = 0x50,
187 RSL_MT_IPAC_CONNECT_MUX_ACK,
188 RSL_MT_IPAC_CONNECT_MUX_NACK,
189 RSL_MT_IPAC_BIND_MUX = 0x53,
190 RSL_MT_IPAC_BIND_MUX_ACK,
191 RSL_MT_IPAC_BIND_MUX_NACK,
192 RSL_MT_IPAC_DISC_MUX = 0x56,
193 RSL_MT_IPAC_DISC_MUX_ACK,
194 RSL_MT_IPAC_DISC_MUX_NACK,
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400195 RSL_MT_IPAC_MEAS_PREPROC_DFT = 0x60, /*Extented Common Channel Management */
196 RSL_MT_IPAC_HO_CAN_ENQ = 0x61,
197 RSL_MT_IPAC_HO_CAN_RES = 0x62,
Harald Welteec8b4502010-02-20 20:34:29 +0100198 RSL_MT_IPAC_CRCX = 0x70, /* Bind to local BTS RTP port */
199 RSL_MT_IPAC_CRCX_ACK,
200 RSL_MT_IPAC_CRCX_NACK,
201 RSL_MT_IPAC_MDCX = 0x73,
202 RSL_MT_IPAC_MDCX_ACK,
203 RSL_MT_IPAC_MDCX_NACK,
204 RSL_MT_IPAC_DLCX_IND = 0x76,
205 RSL_MT_IPAC_DLCX = 0x77,
206 RSL_MT_IPAC_DLCX_ACK,
207 RSL_MT_IPAC_DLCX_NACK,
208};
209
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200210/*! Siemens vendor-specific RSL message types */
Harald Welteec8b4502010-02-20 20:34:29 +0100211enum abis_rsl_msgtype_siemens {
212 RSL_MT_SIEMENS_MRPCI = 0x41,
213 RSL_MT_SIEMENS_INTRAC_HO_COND_IND = 0x42,
214 RSL_MT_SIEMENS_INTERC_HO_COND_IND = 0x43,
215 RSL_MT_SIEMENS_FORCED_HO_REQ = 0x44,
216 RSL_MT_SIEMENS_PREF_AREA_REQ = 0x45,
217 RSL_MT_SIEMENS_PREF_AREA = 0x46,
218 RSL_MT_SIEMENS_START_TRACE = 0x47,
219 RSL_MT_SIEMENS_START_TRACE_ACK = 0x48,
220 RSL_MT_SIEMENS_STOP_TRACE = 0x49,
221 RSL_MT_SIEMENS_TRMR = 0x4a,
222 RSL_MT_SIEMENS_HO_FAIL_IND = 0x4b,
223 RSL_MT_SIEMENS_STOP_TRACE_ACK = 0x4c,
224 RSL_MT_SIEMENS_UPLF = 0x4d,
225 RSL_MT_SIEMENS_UPLB = 0x4e,
226 RSL_MT_SIEMENS_SET_SYS_INFO_10 = 0x4f,
227 RSL_MT_SIEMENS_MODIF_COND_IND = 0x50,
228};
229
Pau Espin Pedrol95959a82018-04-21 22:47:54 +0200230/*! Ericsson vendor-specific RSL message types */
231enum abis_rsl_msgtype_ericsson {
232 RSL_MT_ERICSSON_IMM_ASS_SENT = 0x10,
233};
234
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200235/*! RSL Information Element Identifiers (Chapter 9.3) */
Harald Welteec8b4502010-02-20 20:34:29 +0100236enum abis_rsl_ie {
237 RSL_IE_CHAN_NR = 0x01,
238 RSL_IE_LINK_IDENT,
239 RSL_IE_ACT_TYPE,
240 RSL_IE_BS_POWER,
241 RSL_IE_CHAN_IDENT,
242 RSL_IE_CHAN_MODE,
243 RSL_IE_ENCR_INFO,
244 RSL_IE_FRAME_NUMBER,
245 RSL_IE_HANDO_REF,
246 RSL_IE_L1_INFO,
247 RSL_IE_L3_INFO,
248 RSL_IE_MS_IDENTITY,
249 RSL_IE_MS_POWER,
250 RSL_IE_PAGING_GROUP,
251 RSL_IE_PAGING_LOAD,
252 RSL_IE_PYHS_CONTEXT = 0x10,
253 RSL_IE_ACCESS_DELAY,
254 RSL_IE_RACH_LOAD,
255 RSL_IE_REQ_REFERENCE,
256 RSL_IE_RELEASE_MODE,
257 RSL_IE_RESOURCE_INFO,
258 RSL_IE_RLM_CAUSE,
259 RSL_IE_STARTNG_TIME,
260 RSL_IE_TIMING_ADVANCE,
261 RSL_IE_UPLINK_MEAS,
262 RSL_IE_CAUSE,
263 RSL_IE_MEAS_RES_NR,
264 RSL_IE_MSG_ID,
265 /* reserved */
266 RSL_IE_SYSINFO_TYPE = 0x1e,
267 RSL_IE_MS_POWER_PARAM,
268 RSL_IE_BS_POWER_PARAM,
269 RSL_IE_PREPROC_PARAM,
270 RSL_IE_PREPROC_MEAS,
271 RSL_IE_IMM_ASS_INFO, /* Phase 1 (3.6.0), later Full below */
272 RSL_IE_SMSCB_INFO = 0x24,
273 RSL_IE_MS_TIMING_OFFSET,
274 RSL_IE_ERR_MSG,
275 RSL_IE_FULL_BCCH_INFO,
276 RSL_IE_CHAN_NEEDED,
277 RSL_IE_CB_CMD_TYPE,
278 RSL_IE_SMSCB_MSG,
279 RSL_IE_FULL_IMM_ASS_INFO,
280 RSL_IE_SACCH_INFO,
281 RSL_IE_CBCH_LOAD_INFO,
282 RSL_IE_SMSCB_CHAN_INDICATOR,
283 RSL_IE_GROUP_CALL_REF,
284 RSL_IE_CHAN_DESC = 0x30,
285 RSL_IE_NCH_DRX_INFO,
286 RSL_IE_CMD_INDICATOR,
287 RSL_IE_EMLPP_PRIO,
288 RSL_IE_UIC,
289 RSL_IE_MAIN_CHAN_REF,
290 RSL_IE_MR_CONFIG,
291 RSL_IE_MR_CONTROL,
292 RSL_IE_SUP_CODEC_TYPES,
293 RSL_IE_CODEC_CONFIG,
294 RSL_IE_RTD,
295 RSL_IE_TFO_STATUS,
296 RSL_IE_LLP_APDU,
297 /* Siemens vendor-specific */
298 RSL_IE_SIEMENS_MRPCI = 0x40,
299 RSL_IE_SIEMENS_PREF_AREA_TYPE = 0x43,
300 RSL_IE_SIEMENS_ININ_CELL_HO_PAR = 0x45,
301 RSL_IE_SIEMENS_TRACE_REF_NR = 0x46,
302 RSL_IE_SIEMENS_INT_TRACE_IDX = 0x47,
303 RSL_IE_SIEMENS_L2_HDR_INFO = 0x48,
304 RSL_IE_SIEMENS_HIGHEST_RATE = 0x4e,
305 RSL_IE_SIEMENS_SUGGESTED_RATE = 0x4f,
306
307 /* ip.access */
308 RSL_IE_IPAC_SRTP_CONFIG = 0xe0,
309 RSL_IE_IPAC_PROXY_UDP = 0xe1,
310 RSL_IE_IPAC_BSCMPL_TOUT = 0xe2,
311 RSL_IE_IPAC_REMOTE_IP = 0xf0,
312 RSL_IE_IPAC_REMOTE_PORT = 0xf1,
313 RSL_IE_IPAC_RTP_PAYLOAD = 0xf2,
314 RSL_IE_IPAC_LOCAL_PORT = 0xf3,
315 RSL_IE_IPAC_SPEECH_MODE = 0xf4,
316 RSL_IE_IPAC_LOCAL_IP = 0xf5,
317 RSL_IE_IPAC_CONN_STAT = 0xf6,
318 RSL_IE_IPAC_HO_C_PARMS = 0xf7,
319 RSL_IE_IPAC_CONN_ID = 0xf8,
320 RSL_IE_IPAC_RTP_CSD_FMT = 0xf9,
321 RSL_IE_IPAC_RTP_JIT_BUF = 0xfa,
322 RSL_IE_IPAC_RTP_COMPR = 0xfb,
323 RSL_IE_IPAC_RTP_PAYLOAD2= 0xfc,
324 RSL_IE_IPAC_RTP_MPLEX = 0xfd,
325 RSL_IE_IPAC_RTP_MPLEX_ID= 0xfe,
326};
327
Harald Welte6e363e72016-11-16 16:58:52 +0100328/* Ericsson specific IEs, clash with above partially, so they're not
329 * part of the enum */
Alexander Couzens9f39d892018-04-21 21:20:25 +0200330#define RSL_IE_ERIC_PAGING_GROUP 0x0e
Harald Welte6e363e72016-11-16 16:58:52 +0100331#define RSL_IE_ERIC_INST_NR 0x48
332#define RSL_IE_ERIC_PGSL_TIMERS 0x49
333#define RSL_IE_ERIC_REPEAT_DL_FACCH 0x4a
334#define RSL_IE_ERIC_POWER_INFO 0xf0
335#define RSL_IE_ERIC_MOBILE_ID 0xf1
336#define RSL_IE_ERIC_BCCH_MAPPING 0xf2
337#define RSL_IE_ERIC_PACKET_PAG_IND 0xf3
338#define RSL_IE_ERIC_CNTR_CTRL 0xf4
339#define RSL_IE_ERIC_CNTR_CTRL_ACK 0xf5
340#define RSL_IE_ERIC_CNTR_REPORT 0xf6
341#define RSL_IE_ERIC_ICP_CONN 0xf7
342#define RSL_IE_ERIC_EMR_SUPPORT 0xf8
343#define RSL_IE_ERIC_EGPRS_REQ_REF 0xf9
344#define RSL_IE_ERIC_VGCS_REL 0xfa
345#define RSL_IE_ERIC_REP_PER_NCH 0xfb
346#define RSL_IE_ERIC_NY2 0xfc
347#define RSL_IE_ERIC_T3115 0xfd
348#define RSL_IE_ERIC_ACTIVATE_FLAG 0xfe
349#define RSL_IE_ERIC_FULL_NCH_INFO 0xff
350
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400351/* IPAC MEAS_PREPROC AVERAGING METHOD */
352enum {
353 IPAC_UNWEIGHTED_AVE = 0,
354 IPAC_WEIGHTED_AVE,
355 IPAC_MEDIAN_AVE
356};
357
358/* IPAC MEAS_PREPROC AVERAGING PARAMID */
359enum {
360 IPAC_RXLEV_AVE = 0,
361 IPAC_RXQUAL_AVE,
362 IPAC_MS_BTS_DIS_AVE
363};
364
365/* IPAC MEAS_PREPROC HO CAUSES */
366enum {
367 IPAC_HO_RQD_CAUSE_L_RXLEV_UL_H = 0x01,
368 IPAC_HO_RQD_CAUSE_L_RXLEV_DL_H,
369 IPAC_HO_RQD_CAUSE_L_RXQUAL_UL_H,
370 IPAC_HO_RQD_CAUSE_L_RXQUAL_DL_H,
371 IPAC_HO_RQD_CAUSE_RXLEV_UL_IH,
372 IPAC_HO_RQD_CAUSE_RXLEV_DL_IH,
373 IPAC_HO_RQD_CAUSE_MAX_MS_RANGE,
374 IPAC_HO_RQD_CAUSE_POWER_BUDGET,
375 IPAC_HO_RQD_CAUSE_ENQUIRY,
376 IPAC_HO_RQD_CAUSE_ENQUIRY_FAILED,
377 IPAC_HO_RQD_CAUSE_NORMAL3G,
378 IPAC_HO_RQD_CAUSE_EMERGENCY3G,
379 IPAC_HO_RQD_CAUSE_SERVICE_PREFERRED3G,
380 IPAC_HO_RQD_CAUSE_O_M_SHUTDOWN,
381 IPAC_HO_RQD_CAUSE_QUALITY_PROMOTION,
382 IPAC_HO_RQD_CAUSE_LOAD_PROMOTION,
383 IPAC_HO_RQD_CAUSE_LOAD_DEMOTION,
384 IPAC_HO_RQD_CAUSE_MAX,
385};
386
Harald Welteec8b4502010-02-20 20:34:29 +0100387/* Chapter 9.3.1 */
388#define RSL_CHAN_NR_MASK 0xf8
Neels Hofmeyr15b96ff2016-07-18 23:33:48 +0200389#define RSL_CHAN_NR_1 0x08 /*< bit to add for 2nd,... lchan */
Harald Welteec8b4502010-02-20 20:34:29 +0100390#define RSL_CHAN_Bm_ACCHs 0x08
391#define RSL_CHAN_Lm_ACCHs 0x10 /* .. 0x18 */
392#define RSL_CHAN_SDCCH4_ACCH 0x20 /* .. 0x38 */
393#define RSL_CHAN_SDCCH8_ACCH 0x40 /* ...0x78 */
394#define RSL_CHAN_BCCH 0x80
395#define RSL_CHAN_RACH 0x88
396#define RSL_CHAN_PCH_AGCH 0x90
Neels Hofmeyrfd80f5a2016-07-14 03:21:05 +0200397#define RSL_CHAN_OSMO_PDCH 0xc0 /*< non-standard, for dyn TS */
Harald Welteec8b4502010-02-20 20:34:29 +0100398
399/* Chapter 9.3.3 */
400#define RSL_ACT_TYPE_INITIAL 0x00
401#define RSL_ACT_TYPE_REACT 0x80
402#define RSL_ACT_INTRA_IMM_ASS 0x00
403#define RSL_ACT_INTRA_NORM_ASS 0x01
404#define RSL_ACT_INTER_ASYNC 0x02
405#define RSL_ACT_INTER_SYNC 0x03
406#define RSL_ACT_SECOND_ADD 0x04
407#define RSL_ACT_SECOND_MULTI 0x05
Neels Hofmeyrfd80f5a2016-07-14 03:21:05 +0200408#define RSL_ACT_OSMO_PDCH 0x0f /*< non-standard, for dyn TS */
Harald Welteec8b4502010-02-20 20:34:29 +0100409
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200410/*! RSL Channel Mode IF (Chapter 9.3.6) */
Harald Welteec8b4502010-02-20 20:34:29 +0100411struct rsl_ie_chan_mode {
412 uint8_t dtx_dtu;
413 uint8_t spd_ind;
414 uint8_t chan_rt;
415 uint8_t chan_rate;
416} __attribute__ ((packed));
417#define RSL_CMOD_DTXu 0x01 /* uplink */
418#define RSL_CMOD_DTXd 0x02 /* downlink */
419enum rsl_cmod_spd {
420 RSL_CMOD_SPD_SPEECH = 0x01,
421 RSL_CMOD_SPD_DATA = 0x02,
422 RSL_CMOD_SPD_SIGN = 0x03,
423};
424#define RSL_CMOD_CRT_SDCCH 0x01
425#define RSL_CMOD_CRT_TCH_Bm 0x08 /* full-rate */
426#define RSL_CMOD_CRT_TCH_Lm 0x09 /* half-rate */
427/* FIXME: More CRT types */
428/* Speech */
429#define RSL_CMOD_SP_GSM1 0x01
430#define RSL_CMOD_SP_GSM2 0x11
431#define RSL_CMOD_SP_GSM3 0x21
Harald Welteeed26112012-08-24 15:35:34 +0200432/* non-transparent data */
433#define RSL_CMOD_CSD_NT_43k5 0x74
434#define RSL_CMOD_CSD_NT_28k8 0x71
435#define RSL_CMOD_CSD_NT_14k5 0x58
436#define RSL_CMOD_CSD_NT_12k0 0x50
437#define RSL_CMOD_CSD_NT_6k0 0x51
438/* legacy #defines with wrong name */
439#define RSL_CMOD_SP_NT_14k5 RSL_CMOD_CSD_NT_14k5
440#define RSL_CMOD_SP_NT_12k0 RSL_CMOD_CSD_NT_12k0
441#define RSL_CMOD_SP_NT_6k0 RSL_CMOD_CSD_NT_6k0
442/* transparent data */
443#define RSL_CMOD_CSD_T_32000 0x38
444#define RSL_CMOD_CSD_T_29000 0x39
445#define RSL_CMOD_CSD_T_14400 0x18
446#define RSL_CMOD_CSD_T_9600 0x10
447#define RSL_CMOD_CSD_T_4800 0x11
448#define RSL_CMOD_CSD_T_2400 0x12
449#define RSL_CMOD_CSD_T_1200 0x13
450#define RSL_CMOD_CSD_T_600 0x14
451#define RSL_CMOD_CSD_T_1200_75 0x15
Harald Welteec8b4502010-02-20 20:34:29 +0100452
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200453/*! RSL Channel Identification IE (Chapter 9.3.5) */
Harald Welteec8b4502010-02-20 20:34:29 +0100454struct rsl_ie_chan_ident {
455 /* GSM 04.08 10.5.2.5 */
456 struct {
457 uint8_t iei;
458 uint8_t chan_nr; /* enc_chan_nr */
459 uint8_t oct3;
460 uint8_t oct4;
461 } chan_desc;
462#if 0 /* spec says we need this but Abissim doesn't use it */
463 struct {
464 uint8_t tag;
465 uint8_t len;
466 } mobile_alloc;
467#endif
468} __attribute__ ((packed));
469
470/* Chapter 9.3.22 */
471#define RLL_CAUSE_T200_EXPIRED 0x01
472#define RLL_CAUSE_REEST_REQ 0x02
473#define RLL_CAUSE_UNSOL_UA_RESP 0x03
474#define RLL_CAUSE_UNSOL_DM_RESP 0x04
475#define RLL_CAUSE_UNSOL_DM_RESP_MF 0x05
476#define RLL_CAUSE_UNSOL_SPRV_RESP 0x06
477#define RLL_CAUSE_SEQ_ERR 0x07
478#define RLL_CAUSE_UFRM_INC_PARAM 0x08
479#define RLL_CAUSE_SFRM_INC_PARAM 0x09
480#define RLL_CAUSE_IFRM_INC_MBITS 0x0a
481#define RLL_CAUSE_IFRM_INC_LEN 0x0b
482#define RLL_CAUSE_FRM_UNIMPL 0x0c
483#define RLL_CAUSE_SABM_MF 0x0d
484#define RLL_CAUSE_SABM_INFO_NOTALL 0x0e
485
486/* Chapter 9.3.26 */
487#define RSL_ERRCLS_NORMAL 0x00
488#define RSL_ERRCLS_RESOURCE_UNAVAIL 0x20
489#define RSL_ERRCLS_SERVICE_UNAVAIL 0x30
490#define RSL_ERRCLS_SERVICE_UNIMPL 0x40
491#define RSL_ERRCLS_INVAL_MSG 0x50
492#define RSL_ERRCLS_PROTO_ERROR 0x60
493#define RSL_ERRCLS_INTERWORKING 0x70
494
495/* normal event */
496#define RSL_ERR_RADIO_IF_FAIL 0x00
497#define RSL_ERR_RADIO_LINK_FAIL 0x01
498#define RSL_ERR_HANDOVER_ACC_FAIL 0x02
499#define RSL_ERR_TALKER_ACC_FAIL 0x03
500#define RSL_ERR_OM_INTERVENTION 0x07
501#define RSL_ERR_NORMAL_UNSPEC 0x0f
502#define RSL_ERR_T_MSRFPCI_EXP 0x18
503/* resource unavailable */
504#define RSL_ERR_EQUIPMENT_FAIL 0x20
505#define RSL_ERR_RR_UNAVAIL 0x21
506#define RSL_ERR_TERR_CH_FAIL 0x22
507#define RSL_ERR_CCCH_OVERLOAD 0x23
508#define RSL_ERR_ACCH_OVERLOAD 0x24
509#define RSL_ERR_PROCESSOR_OVERLOAD 0x25
510#define RSL_ERR_RES_UNAVAIL 0x2f
511/* service or option not available */
512#define RSL_ERR_TRANSC_UNAVAIL 0x30
513#define RSL_ERR_SERV_OPT_UNAVAIL 0x3f
514/* service or option not implemented */
515#define RSL_ERR_ENCR_UNIMPL 0x40
516#define RSL_ERR_SERV_OPT_UNIMPL 0x4f
517/* invalid message */
518#define RSL_ERR_RCH_ALR_ACTV_ALLOC 0x50
519#define RSL_ERR_INVALID_MESSAGE 0x5f
520/* protocol error */
521#define RSL_ERR_MSG_DISCR 0x60
522#define RSL_ERR_MSG_TYPE 0x61
523#define RSL_ERR_MSG_SEQ 0x62
524#define RSL_ERR_IE_ERROR 0x63
525#define RSL_ERR_MAND_IE_ERROR 0x64
526#define RSL_ERR_OPT_IE_ERROR 0x65
527#define RSL_ERR_IE_NONEXIST 0x66
528#define RSL_ERR_IE_LENGTH 0x67
529#define RSL_ERR_IE_CONTENT 0x68
530#define RSL_ERR_PROTO 0x6f
531/* interworking */
532#define RSL_ERR_INTERWORKING 0x7f
533
534/* Chapter 9.3.30 */
535#define RSL_SYSTEM_INFO_8 0x00
536#define RSL_SYSTEM_INFO_1 0x01
537#define RSL_SYSTEM_INFO_2 0x02
538#define RSL_SYSTEM_INFO_3 0x03
539#define RSL_SYSTEM_INFO_4 0x04
540#define RSL_SYSTEM_INFO_5 0x05
541#define RSL_SYSTEM_INFO_6 0x06
542#define RSL_SYSTEM_INFO_7 0x07
543#define RSL_SYSTEM_INFO_16 0x08
544#define RSL_SYSTEM_INFO_17 0x09
545#define RSL_SYSTEM_INFO_2bis 0x0a
546#define RSL_SYSTEM_INFO_2ter 0x0b
547#define RSL_SYSTEM_INFO_5bis 0x0d
548#define RSL_SYSTEM_INFO_5ter 0x0e
549#define RSL_SYSTEM_INFO_10 0x0f
Harald Welte3d732272011-06-25 21:39:01 +0200550#define RSL_EXT_MEAS_ORDER 0x47
Harald Welteec8b4502010-02-20 20:34:29 +0100551#define RSL_MEAS_INFO 0x48
552#define RSL_SYSTEM_INFO_13 0x28
Philipp00b15392016-11-14 12:34:15 +0100553#define RSL_ERIC_SYSTEM_INFO_13 0x0C
Harald Welteec8b4502010-02-20 20:34:29 +0100554#define RSL_SYSTEM_INFO_2quater 0x29
555#define RSL_SYSTEM_INFO_9 0x2a
556#define RSL_SYSTEM_INFO_18 0x2b
557#define RSL_SYSTEM_INFO_19 0x2c
558#define RSL_SYSTEM_INFO_20 0x2d
559
560/* Chapter 9.3.40 */
561#define RSL_CHANNEED_ANY 0x00
562#define RSL_CHANNEED_SDCCH 0x01
563#define RSL_CHANNEED_TCH_F 0x02
564#define RSL_CHANNEED_TCH_ForH 0x03
565
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200566/*! RSL Cell Broadcast Command (Chapter 9.3.45) */
Alex Badea84930182010-11-27 23:34:46 +0200567struct rsl_ie_cb_cmd_type {
568 uint8_t last_block:2;
569 uint8_t spare:1;
570 uint8_t def_bcast:1;
571 uint8_t command:4;
572} __attribute__ ((packed));
573/* ->command */
574#define RSL_CB_CMD_TYPE_NORMAL 0x00
575#define RSL_CB_CMD_TYPE_SCHEDULE 0x08
576#define RSL_CB_CMD_TYPE_DEFAULT 0x0e
577#define RSL_CB_CMD_TYPE_NULL 0x0f
578/* ->def_bcast */
579#define RSL_CB_CMD_DEFBCAST_NORMAL 0
580#define RSL_CB_CMD_DEFBCAST_NULL 1
581/* ->last_block */
582#define RSL_CB_CMD_LASTBLOCK_4 0
583#define RSL_CB_CMD_LASTBLOCK_1 1
584#define RSL_CB_CMD_LASTBLOCK_2 2
585#define RSL_CB_CMD_LASTBLOCK_3 3
586
Harald Welteec8b4502010-02-20 20:34:29 +0100587/* Chapter 3.3.2.3 Brocast control channel */
588/* CCCH-CONF, NC is not combined */
589#define RSL_BCCH_CCCH_CONF_1_NC 0x00
590#define RSL_BCCH_CCCH_CONF_1_C 0x01
591#define RSL_BCCH_CCCH_CONF_2_NC 0x02
592#define RSL_BCCH_CCCH_CONF_3_NC 0x04
593#define RSL_BCCH_CCCH_CONF_4_NC 0x06
594
595/* BS-PA-MFRMS */
596#define RSL_BS_PA_MFRMS_2 0x00
597#define RSL_BS_PA_MFRMS_3 0x01
598#define RSL_BS_PA_MFRMS_4 0x02
599#define RSL_BS_PA_MFRMS_5 0x03
600#define RSL_BS_PA_MFRMS_6 0x04
601#define RSL_BS_PA_MFRMS_7 0x05
602#define RSL_BS_PA_MFRMS_8 0x06
603#define RSL_BS_PA_MFRMS_9 0x07
604
605/* RSL_IE_IPAC_RTP_PAYLOAD[2] */
606enum rsl_ipac_rtp_payload {
607 RSL_IPAC_RTP_GSM = 1,
608 RSL_IPAC_RTP_EFR,
609 RSL_IPAC_RTP_AMR,
610 RSL_IPAC_RTP_CSD,
611 RSL_IPAC_RTP_MUX,
612};
613
614/* RSL_IE_IPAC_SPEECH_MODE, lower four bits */
615enum rsl_ipac_speech_mode_s {
616 RSL_IPAC_SPEECH_GSM_FR = 0, /* GSM FR (Type 1, FS) */
617 RSL_IPAC_SPEECH_GSM_EFR = 1, /* GSM EFR (Type 2, FS) */
618 RSL_IPAC_SPEECH_GSM_AMR_FR = 2, /* GSM AMR/FR (Type 3, FS) */
619 RSL_IPAC_SPEECH_GSM_HR = 3, /* GSM HR (Type 1, HS) */
620 RSL_IPAC_SPEECH_GSM_AMR_HR = 5, /* GSM AMR/hr (Type 3, HS) */
621 RSL_IPAC_SPEECH_AS_RTP = 0xf, /* As specified by RTP Payload IE */
622};
623/* RSL_IE_IPAC_SPEECH_MODE, upper four bits */
624enum rsl_ipac_speech_mode_m {
625 RSL_IPAC_SPEECH_M_RXTX = 0, /* Send and Receive */
626 RSL_IPAC_SPEECH_M_RX = 1, /* Receive only */
627 RSL_IPAC_SPEECH_M_TX = 2, /* Send only */
628};
629
630/* RSL_IE_IPAC_RTP_CSD_FMT, lower four bits */
631enum rsl_ipac_rtp_csd_format_d {
632 RSL_IPAC_RTP_CSD_EXT_TRAU = 0,
633 RSL_IPAC_RTP_CSD_NON_TRAU = 1,
634 RSL_IPAC_RTP_CSD_TRAU_BTS = 2,
635 RSL_IPAC_RTP_CSD_IWF_FREE = 3,
636};
637/* RSL_IE_IPAC_RTP_CSD_FMT, upper four bits */
638enum rsl_ipac_rtp_csd_format_ir {
639 RSL_IPAC_RTP_CSD_IR_8k = 0,
640 RSL_IPAC_RTP_CSD_IR_16k = 1,
641 RSL_IPAC_RTP_CSD_IR_32k = 2,
642 RSL_IPAC_RTP_CSD_IR_64k = 3,
643};
644
645/* Siemens vendor-specific RSL extensions */
646struct rsl_mrpci {
647 uint8_t power_class:3,
648 vgcs_capable:1,
649 vbs_capable:1,
650 gsm_phase:2;
651} __attribute__ ((packed));
652
653enum rsl_mrpci_pwrclass {
654 RSL_MRPCI_PWRC_1 = 0,
655 RSL_MRPCI_PWRC_2 = 1,
656 RSL_MRPCI_PWRC_3 = 2,
657 RSL_MRPCI_PWRC_4 = 3,
658 RSL_MRPCI_PWRC_5 = 4,
659};
660enum rsl_mrpci_phase {
661 RSL_MRPCI_PHASE_1 = 0,
662 /* reserved */
663 RSL_MRPCI_PHASE_2 = 2,
664 RSL_MRPCI_PHASE_2PLUS = 3,
665};
666
Holger Hans Peter Freyther0357e9b2012-12-06 11:57:31 +0100667/* 9.3.20 Release Mode */
668enum rsl_rel_mode {
669 RSL_REL_NORMAL = 0,
670 RSL_REL_LOCAL_END = 1,
671};
672
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200673/*! ip.access specific embedded information elements */
Harald Weltefad57522015-12-13 11:56:36 +0100674enum rsl_ipac_embedded_ie {
675 RSL_IPAC_EIE_RXLEV = 0x00,
676 RSL_IPAC_EIE_RXQUAL = 0x01,
677 RSL_IPAC_EIE_FREQ_ERR = 0x02,
678 RSL_IPAC_EIE_TIMING_ERR = 0x03,
679 RSL_IPAC_EIE_MEAS_AVG_CFG = 0x04,
680 RSL_IPAC_EIE_BS_PWR_CTL = 0x05,
681 RSL_IPAC_EIE_MS_PWR_CTL = 0x06,
682 RSL_IPAC_EIE_HANDO_THRESH = 0x07,
683 RSL_IPAC_EIE_NCELL_DEFAULTS = 0x08,
684 RSL_IPAC_EIE_NCELL_LIST = 0x09,
685 RSL_IPAC_EIE_PC_THRESH_COMP = 0x0a,
686 RSL_IPAC_EIE_HO_THRESH_COMP = 0x0b,
687 RSL_IPAC_EIE_HO_CAUSE = 0x0c,
688 RSL_IPAC_EIE_HO_CANDIDATES = 0x0d,
689 RSL_IPAC_EIE_NCELL_BA_CHG_LIST = 0x0e,
690 RSL_IPAC_EIE_NUM_OF_MS = 0x10,
691 RSL_IPAC_EIE_HO_CAND_EXT = 0x11,
692 RSL_IPAC_EIE_NCELL_DEF_EXT = 0x12,
693 RSL_IPAC_EIE_NCELL_LIST_EXT = 0x13,
694 RSL_IPAC_EIE_MASTER_KEY = 0x14,
695 RSL_IPAC_EIE_MASTER_SALT = 0x15,
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400696 /* additional IPAC measurement pre-processing related IEI */
697 RSL_IPAC_EIE_MEAS_TRANS_RES = 0x16,
698 RSL_IPAC_EIE_3G_HO_PARAM = 0x17,
699 RSL_IPAC_EIE_3G_NCELL_LIST = 0x18,
700 RSL_IPAC_EIE_SDCCH_CTL_PARAM = 0x1a,
701 RSL_IPAC_EIE_AMR_CONV_THRESH = 0x1b,
702
703};
704
705struct ipac_preproc_ave_cfg {
706 uint8_t h_reqave:5,
707 param_id:2,
708 reserved:1;
709 uint8_t h_reqt:5,
710 ave_method:3;
711}__attribute__ ((packed));
712
713struct ipac_preproc_ho_thresh {
714 uint8_t l_rxlev_ul_h:6,
715 reserved_l_rxlev_ul:2;
716 uint8_t l_rxlev_dl_h:6,
717 reserved_l_rxlev_dl:2;
718 uint8_t rxlev_ul_ih:6,
719 reserved_rxlev_ul:2;
720 uint8_t rxlev_dl_ih:6,
721 reserved_rxlev_dl:2;
722 uint8_t l_rxqual_ul_h:3,
723 reserved_rxlqual_ul:1,
724 l_rxqual_dl_h:3,
725 reserved_rxqual_dl:1;
726 uint8_t ms_range_max:6,
727 reserved_ms_range:2;
728}__attribute__ ((packed));
729
730struct ipac_preproc_ho_comp {
731 uint8_t p5:5,
732 reserved_p5:3;
733 uint8_t n5:5,
734 reserved_n5:3;
735 uint8_t p6:5,
736 reserved_p6:3;
737 uint8_t n6:5,
738 reserved_n6:3;
739 uint8_t p7:5,
740 reserved_p7:3;
741 uint8_t n7:5,
742 reserved_n7:3;
743 uint8_t p8:5,
744 reserved_p8:3;
745 uint8_t n8:5,
746 reserved_n8:3;
747 uint8_t ho_interval:5,
748 reserved_ho:3;
749 uint8_t reserved;
750
751}__attribute__ ((packed));
752
753struct ipac_preproc_ho_candidates {
754 uint8_t bsic:6,
755 reserved0:2;
756 uint8_t bcch_freq:5,
757 ba_used:1,
758 s:1,
759 reserved1:1;
760}__attribute__ ((packed));
761
762struct ipac_preproc_ncell_dflts {
763 uint8_t rxlev_min_def:6,
764 reserved_rxlev_min_def:2;
765 uint8_t ho_margin_def:5,
766 reserved_ho_margin_def:3;
767 uint8_t ms_txpwr_max_def:5,
768 reserved_ms_txpwr_max_def:3;
769}__attribute__ ((packed));
770
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -0500771struct ipac_preproc_ho_ctl_param {
772 uint8_t sdcch_ho_gsm:1,
773 sdcch_ho_umts:1,
774 reserved:6;
775}__attribute__ ((packed));
776
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400777struct ipac_preproc_cfg {
778 uint8_t meas_rep_mode;
779 uint32_t meas_mode_flags;
780 struct ipac_preproc_ave_cfg ms_ave_cfg[3];
781 struct ipac_preproc_ave_cfg ave_cfg;
782 struct ipac_preproc_ho_thresh ho_thresh;
783 struct ipac_preproc_ho_comp ho_comp;
784 struct ipac_preproc_ncell_dflts ncell_dflts;
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -0500785 struct ipac_preproc_ho_ctl_param ho_ctl_param;
Harald Weltefad57522015-12-13 11:56:36 +0100786};
787
Sylvain Munautdca7d2c2012-04-18 21:53:23 +0200788/*! @} */