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