blob: a03b199c9a0f5c829f34c929968e57a0160e85d8 [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 Pedrolfb97e722018-10-10 20:41:40 +020034/* Channel Number 9.3.1 */
35union abis_rsl_chan_nr {
36#if OSMO_IS_BIG_ENDIAN
37 uint8_t cbits:5,
38 tn:3;
39#elif OSMO_IS_LITTLE_ENDIAN
40 uint8_t tn:3,
41 cbits:5;
42#endif
43 uint8_t chan_nr;
44} __attribute__ ((packed));
45#define ABIS_RSL_CHAN_NR_CBITS_Bm_ACCHs 0x01
46#define ABIS_RSL_CHAN_NR_CBITS_Lm_ACCHs(ss) (0x02 + (ss))
47#define ABIS_RSL_CHAN_NR_CBITS_SDCCH4_ACCH(ss) (0x04 + (ss))
48#define ABIS_RSL_CHAN_NR_CBITS_SDCCH8_ACCH(ss) (0x08 + (ss))
49#define ABIS_RSL_CHAN_NR_CBITS_BCCH 0x10
50#define ABIS_RSL_CHAN_NR_CBITS_RACH 0x11
51#define ABIS_RSL_CHAN_NR_CBITS_PCH_AGCH 0x12
52#define ABIS_RSL_CHAN_NR_CBITS_OSMO_PDCH 0x18 /*< non-standard, for dyn TS */
Harald Weltea8d7ebb2019-05-27 16:51:23 +020053#define ABIS_RSL_CHAN_NR_CBITS_OSMO_CBCH4 0x19 /*< non-standard, for CBCH/SDCCH4 */
54#define ABIS_RSL_CHAN_NR_CBITS_OSMO_CBCH8 0x1a /*< non-standard, for CBCH/SDCCH8 */
Pau Espin Pedrolfb97e722018-10-10 20:41:40 +020055
Vadim Yanitskiyfc02ff42021-05-26 18:19:03 +020056/* non-standard, Osmocom specific Bm/Lm equivalents for VAMOS */
57#define ABIS_RSL_CHAN_NR_CBITS_OSMO_VAMOS_Bm_ACCHs 0x1d /*< VAMOS TCH/F */
58#define ABIS_RSL_CHAN_NR_CBITS_OSMO_VAMOS_Lm_ACCHs(ss) (0x1e + (ss)) /*< VAMOS TCH/H */
59
Pau Espin Pedrol42908032018-10-10 17:04:28 +020060/* Link Identifier 9.3.2 */
61union abis_rsl_link_id {
62#if OSMO_IS_BIG_ENDIAN
63 uint8_t cbits:2,
64 na:1,
Martin Haukee63b8872018-11-15 14:53:13 +010065 reserved:2,
Pau Espin Pedrol42908032018-10-10 17:04:28 +020066 sapi:3;
67#elif OSMO_IS_LITTLE_ENDIAN
68 uint8_t sapi:3,
69 reserved:2,
70 na:1,
71 cbits:2;
72#endif
73 uint8_t link_id;
74} __attribute__ ((packed));
75#define ABIS_RSL_LINK_ID_CBITS_FACCH_SDCCH 0x00
76#define ABIS_RSL_LINK_ID_CBITS_SACCH 0x01
77
Neels Hofmeyr87e45502017-06-20 00:17:59 +020078/*! RSL common header */
Harald Welteec8b4502010-02-20 20:34:29 +010079struct abis_rsl_common_hdr {
Neels Hofmeyr87e45502017-06-20 00:17:59 +020080 uint8_t msg_discr; /*!< message discriminator (ABIS_RSL_MDISC_*) */
81 uint8_t msg_type; /*!< message type (\ref abis_rsl_msgtype) */
82 uint8_t data[0]; /*!< actual payload data */
Harald Welteec8b4502010-02-20 20:34:29 +010083} __attribute__ ((packed));
84
Neels Hofmeyr87e45502017-06-20 00:17:59 +020085/* RSL RLL header (Chapter 8.3) */
Harald Welteec8b4502010-02-20 20:34:29 +010086struct abis_rsl_rll_hdr {
87 struct abis_rsl_common_hdr c;
Neels Hofmeyr87e45502017-06-20 00:17:59 +020088 uint8_t ie_chan; /*!< \ref RSL_IE_CHAN_NR (tag) */
Pau Espin Pedrolfb97e722018-10-10 20:41:40 +020089 union {
90 uint8_t chan_nr; /* API backward compat */
91 union abis_rsl_chan_nr chan_nr_fields; /*!< RSL channel number (value) */
92 };
Neels Hofmeyr87e45502017-06-20 00:17:59 +020093 uint8_t ie_link_id; /*!< \ref RSL_IE_LINK_IDENT (tag) */
Pau Espin Pedrol42908032018-10-10 17:04:28 +020094 union {
95 uint8_t link_id; /* API backward compat */
96 union abis_rsl_link_id link_id_fields; /*!< RSL link identifier (value) */
97 };
Neels Hofmeyr87e45502017-06-20 00:17:59 +020098 uint8_t data[0]; /*!< message payload data */
Harald Welteec8b4502010-02-20 20:34:29 +010099} __attribute__ ((packed));
100
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200101/* RSL Dedicated Channel header (Chapter 8.3 and 8.4) */
Harald Welteec8b4502010-02-20 20:34:29 +0100102struct abis_rsl_dchan_hdr {
103 struct abis_rsl_common_hdr c;
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200104 uint8_t ie_chan; /*!< \ref RSL_IE_CHAN_NR (tag) */
Pau Espin Pedrolfb97e722018-10-10 20:41:40 +0200105 union {
106 uint8_t chan_nr; /* API backward compat */
107 union abis_rsl_chan_nr chan_nr_fields; /*!< RSL channel number (value) */
108 };
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200109 uint8_t data[0]; /*!< message payload data */
Harald Welteec8b4502010-02-20 20:34:29 +0100110} __attribute__ ((packed));
111
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200112/* RSL Common Channel header (Chapter 8.5) */
Harald Welte6eb7d6c2010-07-13 13:48:13 +0200113struct abis_rsl_cchan_hdr {
114 struct abis_rsl_common_hdr c;
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200115 uint8_t ie_chan; /*!< \ref RSL_IE_CHAN_NR (tag) */
Pau Espin Pedrolfb97e722018-10-10 20:41:40 +0200116 union {
117 uint8_t chan_nr; /* API backward compat */
118 union abis_rsl_chan_nr chan_nr_fields; /*!< RSL channel number (value) */
119 };
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200120 uint8_t data[0]; /*!< message payload data */
Harald Welte6eb7d6c2010-07-13 13:48:13 +0200121} __attribute__ ((packed));
122
Philipp Maier439ddbe2020-11-16 17:49:34 +0100123/* Osmocom specific IE to negotiate repeated ACCH capabilities */
124struct abis_rsl_osmo_rep_acch_cap {
125#if OSMO_IS_BIG_ENDIAN
Philipp Maier595908a2020-11-20 16:13:07 +0100126 uint8_t reserved:1,
127 rxqual:3,
Philipp Maier439ddbe2020-11-16 17:49:34 +0100128 ul_sacch:1,
129 dl_sacch:1,
130 dl_facch_all:1,
131 dl_facch_cmd:1;
132#elif OSMO_IS_LITTLE_ENDIAN
133 uint8_t dl_facch_cmd:1,
134 dl_facch_all:1,
135 dl_sacch:1,
136 ul_sacch:1,
Philipp Maier595908a2020-11-20 16:13:07 +0100137 rxqual:3,
138 reserved:1;
Philipp Maier439ddbe2020-11-16 17:49:34 +0100139#endif
140} __attribute__ ((packed));
Harald Welteec8b4502010-02-20 20:34:29 +0100141
142/* Chapter 9.1 */
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200143/* RSL Message Discriminator: RLL */
Harald Welteec8b4502010-02-20 20:34:29 +0100144#define ABIS_RSL_MDISC_RLL 0x02
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200145/* RSL Message Discriminator: Dedicated Channel */
Harald Welteec8b4502010-02-20 20:34:29 +0100146#define ABIS_RSL_MDISC_DED_CHAN 0x08
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200147/* RSL Message Discriminator: Common Channel */
Harald Welteec8b4502010-02-20 20:34:29 +0100148#define ABIS_RSL_MDISC_COM_CHAN 0x0c
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200149/* RSL Message Discriminator: TRX Management */
Harald Welteec8b4502010-02-20 20:34:29 +0100150#define ABIS_RSL_MDISC_TRX 0x10
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200151/* RSL Message Discriminator: Location Service */
Harald Welteec8b4502010-02-20 20:34:29 +0100152#define ABIS_RSL_MDISC_LOC 0x20
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200153/* RSL Message Discriminator: ip.access */
Harald Welteec8b4502010-02-20 20:34:29 +0100154#define ABIS_RSL_MDISC_IPACCESS 0x7e
155#define ABIS_RSL_MDISC_TRANSP 0x01
156
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200157/* Check if given RSL message discriminator is transparent */
Harald Welteec8b4502010-02-20 20:34:29 +0100158#define ABIS_RSL_MDISC_IS_TRANSP(x) (x & 0x01)
159
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200160/* RSL Message Type (Chapter 9.1) */
Harald Welteec8b4502010-02-20 20:34:29 +0100161enum abis_rsl_msgtype {
162 /* Radio Link Layer Management */
163 RSL_MT_DATA_REQ = 0x01,
164 RSL_MT_DATA_IND,
165 RSL_MT_ERROR_IND,
166 RSL_MT_EST_REQ,
167 RSL_MT_EST_CONF,
168 RSL_MT_EST_IND,
169 RSL_MT_REL_REQ,
170 RSL_MT_REL_CONF,
171 RSL_MT_REL_IND,
172 RSL_MT_UNIT_DATA_REQ,
173 RSL_MT_UNIT_DATA_IND, /* 0x0b */
Andreas Eversberg816e24c2010-06-25 02:50:56 +0200174 RSL_MT_SUSP_REQ, /* non-standard elements */
175 RSL_MT_SUSP_CONF,
176 RSL_MT_RES_REQ,
177 RSL_MT_RECON_REQ, /* 0x0f */
Harald Welteec8b4502010-02-20 20:34:29 +0100178
179 /* Common Channel Management / TRX Management */
180 RSL_MT_BCCH_INFO = 0x11,
181 RSL_MT_CCCH_LOAD_IND,
182 RSL_MT_CHAN_RQD,
183 RSL_MT_DELETE_IND,
184 RSL_MT_PAGING_CMD,
185 RSL_MT_IMMEDIATE_ASSIGN_CMD,
186 RSL_MT_SMS_BC_REQ,
Harald Welte6eb7d6c2010-07-13 13:48:13 +0200187 RSL_MT_CHAN_CONF, /* non-standard element */
Harald Welteec8b4502010-02-20 20:34:29 +0100188 /* empty */
189 RSL_MT_RF_RES_IND = 0x19,
190 RSL_MT_SACCH_FILL,
191 RSL_MT_OVERLOAD,
192 RSL_MT_ERROR_REPORT,
193 RSL_MT_SMS_BC_CMD,
194 RSL_MT_CBCH_LOAD_IND,
195 RSL_MT_NOT_CMD, /* 0x1f */
196
197 /* Dedicate Channel Management */
198 RSL_MT_CHAN_ACTIV = 0x21,
199 RSL_MT_CHAN_ACTIV_ACK,
200 RSL_MT_CHAN_ACTIV_NACK,
201 RSL_MT_CONN_FAIL,
202 RSL_MT_DEACTIVATE_SACCH,
203 RSL_MT_ENCR_CMD,
204 RSL_MT_HANDO_DET,
205 RSL_MT_MEAS_RES,
206 RSL_MT_MODE_MODIFY_REQ,
207 RSL_MT_MODE_MODIFY_ACK,
208 RSL_MT_MODE_MODIFY_NACK,
209 RSL_MT_PHY_CONTEXT_REQ,
210 RSL_MT_PHY_CONTEXT_CONF,
211 RSL_MT_RF_CHAN_REL,
212 RSL_MT_MS_POWER_CONTROL,
213 RSL_MT_BS_POWER_CONTROL, /* 0x30 */
214 RSL_MT_PREPROC_CONFIG,
215 RSL_MT_PREPROC_MEAS_RES,
216 RSL_MT_RF_CHAN_REL_ACK,
217 RSL_MT_SACCH_INFO_MODIFY,
218 RSL_MT_TALKER_DET,
219 RSL_MT_LISTENER_DET,
220 RSL_MT_REMOTE_CODEC_CONF_REP,
221 RSL_MT_RTD_REP,
222 RSL_MT_PRE_HANDO_NOTIF,
223 RSL_MT_MR_CODEC_MOD_REQ,
224 RSL_MT_MR_CODEC_MOD_ACK,
225 RSL_MT_MR_CODEC_MOD_NACK,
226 RSL_MT_MR_CODEC_MOD_PER,
227 RSL_MT_TFO_REP,
228 RSL_MT_TFO_MOD_REQ, /* 0x3f */
229 RSL_MT_LOCATION_INFO = 0x41,
230
231 /* ip.access specific RSL message types */
232 RSL_MT_IPAC_DIR_RETR_ENQ = 0x40,
233 RSL_MT_IPAC_PDCH_ACT = 0x48,
234 RSL_MT_IPAC_PDCH_ACT_ACK,
235 RSL_MT_IPAC_PDCH_ACT_NACK,
236 RSL_MT_IPAC_PDCH_DEACT = 0x4b,
237 RSL_MT_IPAC_PDCH_DEACT_ACK,
238 RSL_MT_IPAC_PDCH_DEACT_NACK,
239 RSL_MT_IPAC_CONNECT_MUX = 0x50,
240 RSL_MT_IPAC_CONNECT_MUX_ACK,
241 RSL_MT_IPAC_CONNECT_MUX_NACK,
242 RSL_MT_IPAC_BIND_MUX = 0x53,
243 RSL_MT_IPAC_BIND_MUX_ACK,
244 RSL_MT_IPAC_BIND_MUX_NACK,
245 RSL_MT_IPAC_DISC_MUX = 0x56,
246 RSL_MT_IPAC_DISC_MUX_ACK,
247 RSL_MT_IPAC_DISC_MUX_NACK,
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400248 RSL_MT_IPAC_MEAS_PREPROC_DFT = 0x60, /*Extented Common Channel Management */
249 RSL_MT_IPAC_HO_CAN_ENQ = 0x61,
250 RSL_MT_IPAC_HO_CAN_RES = 0x62,
Harald Welteec8b4502010-02-20 20:34:29 +0100251 RSL_MT_IPAC_CRCX = 0x70, /* Bind to local BTS RTP port */
252 RSL_MT_IPAC_CRCX_ACK,
253 RSL_MT_IPAC_CRCX_NACK,
254 RSL_MT_IPAC_MDCX = 0x73,
255 RSL_MT_IPAC_MDCX_ACK,
256 RSL_MT_IPAC_MDCX_NACK,
257 RSL_MT_IPAC_DLCX_IND = 0x76,
258 RSL_MT_IPAC_DLCX = 0x77,
259 RSL_MT_IPAC_DLCX_ACK,
260 RSL_MT_IPAC_DLCX_NACK,
Harald Weltef9456892019-09-03 13:56:00 +0200261
262 RSL_MT_OSMO_ETWS_CMD = 0x7f,
Harald Welteec8b4502010-02-20 20:34:29 +0100263};
264
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200265/*! Siemens vendor-specific RSL message types */
Harald Welteec8b4502010-02-20 20:34:29 +0100266enum abis_rsl_msgtype_siemens {
267 RSL_MT_SIEMENS_MRPCI = 0x41,
268 RSL_MT_SIEMENS_INTRAC_HO_COND_IND = 0x42,
269 RSL_MT_SIEMENS_INTERC_HO_COND_IND = 0x43,
270 RSL_MT_SIEMENS_FORCED_HO_REQ = 0x44,
271 RSL_MT_SIEMENS_PREF_AREA_REQ = 0x45,
272 RSL_MT_SIEMENS_PREF_AREA = 0x46,
273 RSL_MT_SIEMENS_START_TRACE = 0x47,
274 RSL_MT_SIEMENS_START_TRACE_ACK = 0x48,
275 RSL_MT_SIEMENS_STOP_TRACE = 0x49,
276 RSL_MT_SIEMENS_TRMR = 0x4a,
277 RSL_MT_SIEMENS_HO_FAIL_IND = 0x4b,
278 RSL_MT_SIEMENS_STOP_TRACE_ACK = 0x4c,
279 RSL_MT_SIEMENS_UPLF = 0x4d,
280 RSL_MT_SIEMENS_UPLB = 0x4e,
281 RSL_MT_SIEMENS_SET_SYS_INFO_10 = 0x4f,
282 RSL_MT_SIEMENS_MODIF_COND_IND = 0x50,
283};
284
Pau Espin Pedrol95959a82018-04-21 22:47:54 +0200285/*! Ericsson vendor-specific RSL message types */
286enum abis_rsl_msgtype_ericsson {
287 RSL_MT_ERICSSON_IMM_ASS_SENT = 0x10,
288};
289
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200290/*! RSL Information Element Identifiers (Chapter 9.3) */
Harald Welteec8b4502010-02-20 20:34:29 +0100291enum abis_rsl_ie {
292 RSL_IE_CHAN_NR = 0x01,
293 RSL_IE_LINK_IDENT,
294 RSL_IE_ACT_TYPE,
295 RSL_IE_BS_POWER,
296 RSL_IE_CHAN_IDENT,
297 RSL_IE_CHAN_MODE,
298 RSL_IE_ENCR_INFO,
299 RSL_IE_FRAME_NUMBER,
300 RSL_IE_HANDO_REF,
301 RSL_IE_L1_INFO,
302 RSL_IE_L3_INFO,
303 RSL_IE_MS_IDENTITY,
304 RSL_IE_MS_POWER,
305 RSL_IE_PAGING_GROUP,
306 RSL_IE_PAGING_LOAD,
307 RSL_IE_PYHS_CONTEXT = 0x10,
308 RSL_IE_ACCESS_DELAY,
309 RSL_IE_RACH_LOAD,
310 RSL_IE_REQ_REFERENCE,
311 RSL_IE_RELEASE_MODE,
312 RSL_IE_RESOURCE_INFO,
313 RSL_IE_RLM_CAUSE,
314 RSL_IE_STARTNG_TIME,
315 RSL_IE_TIMING_ADVANCE,
316 RSL_IE_UPLINK_MEAS,
317 RSL_IE_CAUSE,
318 RSL_IE_MEAS_RES_NR,
319 RSL_IE_MSG_ID,
320 /* reserved */
321 RSL_IE_SYSINFO_TYPE = 0x1e,
322 RSL_IE_MS_POWER_PARAM,
323 RSL_IE_BS_POWER_PARAM,
324 RSL_IE_PREPROC_PARAM,
325 RSL_IE_PREPROC_MEAS,
326 RSL_IE_IMM_ASS_INFO, /* Phase 1 (3.6.0), later Full below */
327 RSL_IE_SMSCB_INFO = 0x24,
328 RSL_IE_MS_TIMING_OFFSET,
329 RSL_IE_ERR_MSG,
330 RSL_IE_FULL_BCCH_INFO,
331 RSL_IE_CHAN_NEEDED,
332 RSL_IE_CB_CMD_TYPE,
333 RSL_IE_SMSCB_MSG,
334 RSL_IE_FULL_IMM_ASS_INFO,
335 RSL_IE_SACCH_INFO,
336 RSL_IE_CBCH_LOAD_INFO,
337 RSL_IE_SMSCB_CHAN_INDICATOR,
338 RSL_IE_GROUP_CALL_REF,
339 RSL_IE_CHAN_DESC = 0x30,
340 RSL_IE_NCH_DRX_INFO,
341 RSL_IE_CMD_INDICATOR,
342 RSL_IE_EMLPP_PRIO,
343 RSL_IE_UIC,
344 RSL_IE_MAIN_CHAN_REF,
345 RSL_IE_MR_CONFIG,
346 RSL_IE_MR_CONTROL,
347 RSL_IE_SUP_CODEC_TYPES,
348 RSL_IE_CODEC_CONFIG,
349 RSL_IE_RTD,
350 RSL_IE_TFO_STATUS,
351 RSL_IE_LLP_APDU,
352 /* Siemens vendor-specific */
353 RSL_IE_SIEMENS_MRPCI = 0x40,
354 RSL_IE_SIEMENS_PREF_AREA_TYPE = 0x43,
355 RSL_IE_SIEMENS_ININ_CELL_HO_PAR = 0x45,
356 RSL_IE_SIEMENS_TRACE_REF_NR = 0x46,
357 RSL_IE_SIEMENS_INT_TRACE_IDX = 0x47,
358 RSL_IE_SIEMENS_L2_HDR_INFO = 0x48,
359 RSL_IE_SIEMENS_HIGHEST_RATE = 0x4e,
360 RSL_IE_SIEMENS_SUGGESTED_RATE = 0x4f,
361
Philipp Maiera15967b2020-11-06 21:37:16 +0100362 /* Osmocom specific */
363 RSL_IE_OSMO_REP_ACCH_CAP= 0x60,
Neels Hofmeyrdd6f1362021-04-20 23:02:59 +0200364 RSL_IE_OSMO_TRAINING_SEQUENCE = 0x61,
Philipp Maiera15967b2020-11-06 21:37:16 +0100365
Harald Welteec8b4502010-02-20 20:34:29 +0100366 /* ip.access */
367 RSL_IE_IPAC_SRTP_CONFIG = 0xe0,
368 RSL_IE_IPAC_PROXY_UDP = 0xe1,
369 RSL_IE_IPAC_BSCMPL_TOUT = 0xe2,
370 RSL_IE_IPAC_REMOTE_IP = 0xf0,
371 RSL_IE_IPAC_REMOTE_PORT = 0xf1,
372 RSL_IE_IPAC_RTP_PAYLOAD = 0xf2,
373 RSL_IE_IPAC_LOCAL_PORT = 0xf3,
374 RSL_IE_IPAC_SPEECH_MODE = 0xf4,
375 RSL_IE_IPAC_LOCAL_IP = 0xf5,
376 RSL_IE_IPAC_CONN_STAT = 0xf6,
377 RSL_IE_IPAC_HO_C_PARMS = 0xf7,
378 RSL_IE_IPAC_CONN_ID = 0xf8,
379 RSL_IE_IPAC_RTP_CSD_FMT = 0xf9,
380 RSL_IE_IPAC_RTP_JIT_BUF = 0xfa,
381 RSL_IE_IPAC_RTP_COMPR = 0xfb,
382 RSL_IE_IPAC_RTP_PAYLOAD2= 0xfc,
383 RSL_IE_IPAC_RTP_MPLEX = 0xfd,
384 RSL_IE_IPAC_RTP_MPLEX_ID= 0xfe,
385};
386
Harald Welte6e363e72016-11-16 16:58:52 +0100387/* Ericsson specific IEs, clash with above partially, so they're not
388 * part of the enum */
Alexander Couzens9f39d892018-04-21 21:20:25 +0200389#define RSL_IE_ERIC_PAGING_GROUP 0x0e
Harald Welte6e363e72016-11-16 16:58:52 +0100390#define RSL_IE_ERIC_INST_NR 0x48
391#define RSL_IE_ERIC_PGSL_TIMERS 0x49
392#define RSL_IE_ERIC_REPEAT_DL_FACCH 0x4a
393#define RSL_IE_ERIC_POWER_INFO 0xf0
394#define RSL_IE_ERIC_MOBILE_ID 0xf1
395#define RSL_IE_ERIC_BCCH_MAPPING 0xf2
396#define RSL_IE_ERIC_PACKET_PAG_IND 0xf3
397#define RSL_IE_ERIC_CNTR_CTRL 0xf4
398#define RSL_IE_ERIC_CNTR_CTRL_ACK 0xf5
399#define RSL_IE_ERIC_CNTR_REPORT 0xf6
400#define RSL_IE_ERIC_ICP_CONN 0xf7
401#define RSL_IE_ERIC_EMR_SUPPORT 0xf8
402#define RSL_IE_ERIC_EGPRS_REQ_REF 0xf9
403#define RSL_IE_ERIC_VGCS_REL 0xfa
404#define RSL_IE_ERIC_REP_PER_NCH 0xfb
405#define RSL_IE_ERIC_NY2 0xfc
406#define RSL_IE_ERIC_T3115 0xfd
407#define RSL_IE_ERIC_ACTIVATE_FLAG 0xfe
408#define RSL_IE_ERIC_FULL_NCH_INFO 0xff
409
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400410/* IPAC MEAS_PREPROC AVERAGING METHOD */
411enum {
412 IPAC_UNWEIGHTED_AVE = 0,
413 IPAC_WEIGHTED_AVE,
Vadim Yanitskiyc8158ec2020-12-15 08:04:30 +0100414 IPAC_MEDIAN_AVE,
415 /* EWMA is an Osmocom specific extension */
416 IPAC_OSMO_EWMA_AVE,
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400417};
418
419/* IPAC MEAS_PREPROC AVERAGING PARAMID */
420enum {
421 IPAC_RXLEV_AVE = 0,
422 IPAC_RXQUAL_AVE,
423 IPAC_MS_BTS_DIS_AVE
424};
425
426/* IPAC MEAS_PREPROC HO CAUSES */
427enum {
428 IPAC_HO_RQD_CAUSE_L_RXLEV_UL_H = 0x01,
429 IPAC_HO_RQD_CAUSE_L_RXLEV_DL_H,
430 IPAC_HO_RQD_CAUSE_L_RXQUAL_UL_H,
431 IPAC_HO_RQD_CAUSE_L_RXQUAL_DL_H,
432 IPAC_HO_RQD_CAUSE_RXLEV_UL_IH,
433 IPAC_HO_RQD_CAUSE_RXLEV_DL_IH,
434 IPAC_HO_RQD_CAUSE_MAX_MS_RANGE,
435 IPAC_HO_RQD_CAUSE_POWER_BUDGET,
436 IPAC_HO_RQD_CAUSE_ENQUIRY,
437 IPAC_HO_RQD_CAUSE_ENQUIRY_FAILED,
438 IPAC_HO_RQD_CAUSE_NORMAL3G,
439 IPAC_HO_RQD_CAUSE_EMERGENCY3G,
440 IPAC_HO_RQD_CAUSE_SERVICE_PREFERRED3G,
441 IPAC_HO_RQD_CAUSE_O_M_SHUTDOWN,
442 IPAC_HO_RQD_CAUSE_QUALITY_PROMOTION,
443 IPAC_HO_RQD_CAUSE_LOAD_PROMOTION,
444 IPAC_HO_RQD_CAUSE_LOAD_DEMOTION,
445 IPAC_HO_RQD_CAUSE_MAX,
446};
447
Harald Welteec8b4502010-02-20 20:34:29 +0100448/* Chapter 9.3.1 */
449#define RSL_CHAN_NR_MASK 0xf8
Neels Hofmeyr15b96ff2016-07-18 23:33:48 +0200450#define RSL_CHAN_NR_1 0x08 /*< bit to add for 2nd,... lchan */
Harald Welteec8b4502010-02-20 20:34:29 +0100451#define RSL_CHAN_Bm_ACCHs 0x08
452#define RSL_CHAN_Lm_ACCHs 0x10 /* .. 0x18 */
453#define RSL_CHAN_SDCCH4_ACCH 0x20 /* .. 0x38 */
454#define RSL_CHAN_SDCCH8_ACCH 0x40 /* ...0x78 */
455#define RSL_CHAN_BCCH 0x80
456#define RSL_CHAN_RACH 0x88
457#define RSL_CHAN_PCH_AGCH 0x90
Neels Hofmeyrfd80f5a2016-07-14 03:21:05 +0200458#define RSL_CHAN_OSMO_PDCH 0xc0 /*< non-standard, for dyn TS */
Harald Weltea8d7ebb2019-05-27 16:51:23 +0200459#define RSL_CHAN_OSMO_CBCH4 0xc8 /*< non-standard, for CBCH/SDCCH4 */
460#define RSL_CHAN_OSMO_CBCH8 0xd0 /*< non-standard, for CBCH/SDCCH8 */
Harald Welteec8b4502010-02-20 20:34:29 +0100461
Vadim Yanitskiyfc02ff42021-05-26 18:19:03 +0200462/* non-standard, Osmocom specific Bm/Lm equivalents for VAMOS */
463#define RSL_CHAN_OSMO_VAMOS_Bm_ACCHs 0xe8 /* VAMOS TCH/F */
464#define RSL_CHAN_OSMO_VAMOS_Lm_ACCHs 0xf0 /* VAMOS TCH/H */
Vadim Yanitskiy442ff642021-06-01 19:55:43 +0200465#define RSL_CHAN_OSMO_VAMOS_MASK 0xe0 /* VAMOS TCH/{F,H} */
Vadim Yanitskiyfc02ff42021-05-26 18:19:03 +0200466
Harald Welteec8b4502010-02-20 20:34:29 +0100467/* Chapter 9.3.3 */
468#define RSL_ACT_TYPE_INITIAL 0x00
469#define RSL_ACT_TYPE_REACT 0x80
470#define RSL_ACT_INTRA_IMM_ASS 0x00
471#define RSL_ACT_INTRA_NORM_ASS 0x01
472#define RSL_ACT_INTER_ASYNC 0x02
473#define RSL_ACT_INTER_SYNC 0x03
474#define RSL_ACT_SECOND_ADD 0x04
475#define RSL_ACT_SECOND_MULTI 0x05
Neels Hofmeyrfd80f5a2016-07-14 03:21:05 +0200476#define RSL_ACT_OSMO_PDCH 0x0f /*< non-standard, for dyn TS */
Harald Welteec8b4502010-02-20 20:34:29 +0100477
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200478/*! RSL Channel Mode IF (Chapter 9.3.6) */
Harald Welteec8b4502010-02-20 20:34:29 +0100479struct rsl_ie_chan_mode {
480 uint8_t dtx_dtu;
481 uint8_t spd_ind;
482 uint8_t chan_rt;
483 uint8_t chan_rate;
484} __attribute__ ((packed));
485#define RSL_CMOD_DTXu 0x01 /* uplink */
486#define RSL_CMOD_DTXd 0x02 /* downlink */
487enum rsl_cmod_spd {
488 RSL_CMOD_SPD_SPEECH = 0x01,
489 RSL_CMOD_SPD_DATA = 0x02,
490 RSL_CMOD_SPD_SIGN = 0x03,
491};
Vadim Yanitskiy307b2012021-04-19 04:42:34 +0200492#define RSL_CMOD_CRT_SDCCH 0x01
493#define RSL_CMOD_CRT_TCH_Bm 0x08 /* full-rate */
494#define RSL_CMOD_CRT_TCH_Lm 0x09 /* half-rate */
495#define RSL_CMOD_CRT_TCH_BI_Bm 0x0a /* full-rate: bi-directional (multislot) */
496#define RSL_CMOD_CRT_TCH_UNI_Bm 0x1a /* full-rate: uni-directional (multislot) */
497#define RSL_CMOD_CRT_TCH_GROUP_Bm 0x18 /* full-rate: group call channel */
498#define RSL_CMOD_CRT_TCH_GROUP_Lm 0x19 /* half-rate: group call channel */
499#define RSL_CMOD_CRT_TCH_BCAST_Bm 0x28 /* full-rate: broadcast call channel */
500#define RSL_CMOD_CRT_TCH_BCAST_Lm 0x29 /* half-rate: broadcast call channel */
Neels Hofmeyrfef61cd2021-04-22 21:54:31 +0200501#define RSL_CMOD_CRT_OSMO_TCH_VAMOS_Bm 0x88 /* full-rate in VAMOS mode */
502#define RSL_CMOD_CRT_OSMO_TCH_VAMOS_Lm 0x89 /* half-rate in VAMOS mode */
Harald Welteec8b4502010-02-20 20:34:29 +0100503/* Speech */
504#define RSL_CMOD_SP_GSM1 0x01
505#define RSL_CMOD_SP_GSM2 0x11
506#define RSL_CMOD_SP_GSM3 0x21
Vadim Yanitskiy99f6cd52021-04-19 04:26:10 +0200507#define RSL_CMOD_SP_GSM4 0x31
508#define RSL_CMOD_SP_GSM5 0x09
509#define RSL_CMOD_SP_GSM6 0x0d
Vadim Yanitskiye731a7d2021-04-19 04:59:51 +0200510/* non-transparent data (asymmetric) */
511#define RSL_CMOD_CSD_NTA_43k5_14k5 0x61 /* asymmetric 43.5 kbit/s (DL) + 14.5 kbit/s (UL) */
512#define RSL_CMOD_CSD_NTA_29k0_14k5 0x62 /* asymmetric 29.0 kbit/s (DL) + 14.5 kbit/s (UL) */
513#define RSL_CMOD_CSD_NTA_43k5_29k0 0x63 /* asymmetric 43.5 kbit/s (DL) + 29.0 kbit/s (UL) */
514#define RSL_CMOD_CSD_NTA_14k5_43k5 0x69 /* asymmetric 14.5 kbit/s (DL) + 43.5 kbit/s (UL) */
515#define RSL_CMOD_CSD_NTA_14k5_29k0 0x6a /* asymmetric 14.5 kbit/s (DL) + 29.0 kbit/s (UL) */
516#define RSL_CMOD_CSD_NTA_29k0_43k5 0x6b /* asymmetric 29.0 kbit/s (DL) + 43.5 kbit/s (UL) */
Harald Welteeed26112012-08-24 15:35:34 +0200517/* non-transparent data */
518#define RSL_CMOD_CSD_NT_43k5 0x74
519#define RSL_CMOD_CSD_NT_28k8 0x71
520#define RSL_CMOD_CSD_NT_14k5 0x58
521#define RSL_CMOD_CSD_NT_12k0 0x50
522#define RSL_CMOD_CSD_NT_6k0 0x51
523/* legacy #defines with wrong name */
524#define RSL_CMOD_SP_NT_14k5 RSL_CMOD_CSD_NT_14k5
525#define RSL_CMOD_SP_NT_12k0 RSL_CMOD_CSD_NT_12k0
526#define RSL_CMOD_SP_NT_6k0 RSL_CMOD_CSD_NT_6k0
527/* transparent data */
528#define RSL_CMOD_CSD_T_32000 0x38
529#define RSL_CMOD_CSD_T_29000 0x39
530#define RSL_CMOD_CSD_T_14400 0x18
531#define RSL_CMOD_CSD_T_9600 0x10
532#define RSL_CMOD_CSD_T_4800 0x11
533#define RSL_CMOD_CSD_T_2400 0x12
534#define RSL_CMOD_CSD_T_1200 0x13
535#define RSL_CMOD_CSD_T_600 0x14
536#define RSL_CMOD_CSD_T_1200_75 0x15
Harald Welteec8b4502010-02-20 20:34:29 +0100537
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200538/*! RSL Channel Identification IE (Chapter 9.3.5) */
Harald Welteec8b4502010-02-20 20:34:29 +0100539struct rsl_ie_chan_ident {
540 /* GSM 04.08 10.5.2.5 */
541 struct {
542 uint8_t iei;
543 uint8_t chan_nr; /* enc_chan_nr */
544 uint8_t oct3;
545 uint8_t oct4;
546 } chan_desc;
547#if 0 /* spec says we need this but Abissim doesn't use it */
548 struct {
549 uint8_t tag;
550 uint8_t len;
551 } mobile_alloc;
552#endif
553} __attribute__ ((packed));
554
555/* Chapter 9.3.22 */
556#define RLL_CAUSE_T200_EXPIRED 0x01
557#define RLL_CAUSE_REEST_REQ 0x02
558#define RLL_CAUSE_UNSOL_UA_RESP 0x03
559#define RLL_CAUSE_UNSOL_DM_RESP 0x04
560#define RLL_CAUSE_UNSOL_DM_RESP_MF 0x05
561#define RLL_CAUSE_UNSOL_SPRV_RESP 0x06
562#define RLL_CAUSE_SEQ_ERR 0x07
563#define RLL_CAUSE_UFRM_INC_PARAM 0x08
564#define RLL_CAUSE_SFRM_INC_PARAM 0x09
565#define RLL_CAUSE_IFRM_INC_MBITS 0x0a
566#define RLL_CAUSE_IFRM_INC_LEN 0x0b
567#define RLL_CAUSE_FRM_UNIMPL 0x0c
568#define RLL_CAUSE_SABM_MF 0x0d
569#define RLL_CAUSE_SABM_INFO_NOTALL 0x0e
570
571/* Chapter 9.3.26 */
572#define RSL_ERRCLS_NORMAL 0x00
573#define RSL_ERRCLS_RESOURCE_UNAVAIL 0x20
574#define RSL_ERRCLS_SERVICE_UNAVAIL 0x30
575#define RSL_ERRCLS_SERVICE_UNIMPL 0x40
576#define RSL_ERRCLS_INVAL_MSG 0x50
577#define RSL_ERRCLS_PROTO_ERROR 0x60
578#define RSL_ERRCLS_INTERWORKING 0x70
579
580/* normal event */
581#define RSL_ERR_RADIO_IF_FAIL 0x00
582#define RSL_ERR_RADIO_LINK_FAIL 0x01
583#define RSL_ERR_HANDOVER_ACC_FAIL 0x02
584#define RSL_ERR_TALKER_ACC_FAIL 0x03
585#define RSL_ERR_OM_INTERVENTION 0x07
586#define RSL_ERR_NORMAL_UNSPEC 0x0f
587#define RSL_ERR_T_MSRFPCI_EXP 0x18
588/* resource unavailable */
589#define RSL_ERR_EQUIPMENT_FAIL 0x20
590#define RSL_ERR_RR_UNAVAIL 0x21
591#define RSL_ERR_TERR_CH_FAIL 0x22
592#define RSL_ERR_CCCH_OVERLOAD 0x23
593#define RSL_ERR_ACCH_OVERLOAD 0x24
594#define RSL_ERR_PROCESSOR_OVERLOAD 0x25
Philipp Maier6d214482020-07-28 16:53:27 +0200595#define RSL_ERR_BTS_NOT_EQUIPPED 0x27
596#define RSL_ERR_REMOTE_TRANSC_FAIL 0x28
597#define RSL_ERR_NOTIFICATION_OVERFL 0x29
Harald Welteec8b4502010-02-20 20:34:29 +0100598#define RSL_ERR_RES_UNAVAIL 0x2f
599/* service or option not available */
600#define RSL_ERR_TRANSC_UNAVAIL 0x30
601#define RSL_ERR_SERV_OPT_UNAVAIL 0x3f
602/* service or option not implemented */
603#define RSL_ERR_ENCR_UNIMPL 0x40
604#define RSL_ERR_SERV_OPT_UNIMPL 0x4f
605/* invalid message */
606#define RSL_ERR_RCH_ALR_ACTV_ALLOC 0x50
607#define RSL_ERR_INVALID_MESSAGE 0x5f
608/* protocol error */
609#define RSL_ERR_MSG_DISCR 0x60
610#define RSL_ERR_MSG_TYPE 0x61
611#define RSL_ERR_MSG_SEQ 0x62
612#define RSL_ERR_IE_ERROR 0x63
613#define RSL_ERR_MAND_IE_ERROR 0x64
614#define RSL_ERR_OPT_IE_ERROR 0x65
615#define RSL_ERR_IE_NONEXIST 0x66
616#define RSL_ERR_IE_LENGTH 0x67
617#define RSL_ERR_IE_CONTENT 0x68
618#define RSL_ERR_PROTO 0x6f
619/* interworking */
620#define RSL_ERR_INTERWORKING 0x7f
621
622/* Chapter 9.3.30 */
623#define RSL_SYSTEM_INFO_8 0x00
624#define RSL_SYSTEM_INFO_1 0x01
625#define RSL_SYSTEM_INFO_2 0x02
626#define RSL_SYSTEM_INFO_3 0x03
627#define RSL_SYSTEM_INFO_4 0x04
628#define RSL_SYSTEM_INFO_5 0x05
629#define RSL_SYSTEM_INFO_6 0x06
630#define RSL_SYSTEM_INFO_7 0x07
631#define RSL_SYSTEM_INFO_16 0x08
632#define RSL_SYSTEM_INFO_17 0x09
633#define RSL_SYSTEM_INFO_2bis 0x0a
634#define RSL_SYSTEM_INFO_2ter 0x0b
635#define RSL_SYSTEM_INFO_5bis 0x0d
636#define RSL_SYSTEM_INFO_5ter 0x0e
637#define RSL_SYSTEM_INFO_10 0x0f
Harald Welte3d732272011-06-25 21:39:01 +0200638#define RSL_EXT_MEAS_ORDER 0x47
Harald Welteec8b4502010-02-20 20:34:29 +0100639#define RSL_MEAS_INFO 0x48
640#define RSL_SYSTEM_INFO_13 0x28
Philipp00b15392016-11-14 12:34:15 +0100641#define RSL_ERIC_SYSTEM_INFO_13 0x0C
Harald Welteec8b4502010-02-20 20:34:29 +0100642#define RSL_SYSTEM_INFO_2quater 0x29
643#define RSL_SYSTEM_INFO_9 0x2a
644#define RSL_SYSTEM_INFO_18 0x2b
645#define RSL_SYSTEM_INFO_19 0x2c
646#define RSL_SYSTEM_INFO_20 0x2d
647
648/* Chapter 9.3.40 */
649#define RSL_CHANNEED_ANY 0x00
650#define RSL_CHANNEED_SDCCH 0x01
651#define RSL_CHANNEED_TCH_F 0x02
652#define RSL_CHANNEED_TCH_ForH 0x03
653
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200654/*! RSL Cell Broadcast Command (Chapter 9.3.45) */
Alex Badea84930182010-11-27 23:34:46 +0200655struct rsl_ie_cb_cmd_type {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100656#if OSMO_IS_LITTLE_ENDIAN
Alex Badea84930182010-11-27 23:34:46 +0200657 uint8_t last_block:2;
658 uint8_t spare:1;
659 uint8_t def_bcast:1;
660 uint8_t command:4;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100661#elif OSMO_IS_BIG_ENDIAN
662/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
663 uint8_t command:4, def_bcast:1, spare:1, last_block:2;
664#endif
Alex Badea84930182010-11-27 23:34:46 +0200665} __attribute__ ((packed));
666/* ->command */
667#define RSL_CB_CMD_TYPE_NORMAL 0x00
668#define RSL_CB_CMD_TYPE_SCHEDULE 0x08
669#define RSL_CB_CMD_TYPE_DEFAULT 0x0e
670#define RSL_CB_CMD_TYPE_NULL 0x0f
671/* ->def_bcast */
672#define RSL_CB_CMD_DEFBCAST_NORMAL 0
673#define RSL_CB_CMD_DEFBCAST_NULL 1
674/* ->last_block */
675#define RSL_CB_CMD_LASTBLOCK_4 0
676#define RSL_CB_CMD_LASTBLOCK_1 1
677#define RSL_CB_CMD_LASTBLOCK_2 2
678#define RSL_CB_CMD_LASTBLOCK_3 3
679
Harald Welteec8b4502010-02-20 20:34:29 +0100680/* Chapter 3.3.2.3 Brocast control channel */
681/* CCCH-CONF, NC is not combined */
682#define RSL_BCCH_CCCH_CONF_1_NC 0x00
683#define RSL_BCCH_CCCH_CONF_1_C 0x01
684#define RSL_BCCH_CCCH_CONF_2_NC 0x02
685#define RSL_BCCH_CCCH_CONF_3_NC 0x04
686#define RSL_BCCH_CCCH_CONF_4_NC 0x06
687
688/* BS-PA-MFRMS */
689#define RSL_BS_PA_MFRMS_2 0x00
690#define RSL_BS_PA_MFRMS_3 0x01
691#define RSL_BS_PA_MFRMS_4 0x02
692#define RSL_BS_PA_MFRMS_5 0x03
693#define RSL_BS_PA_MFRMS_6 0x04
694#define RSL_BS_PA_MFRMS_7 0x05
695#define RSL_BS_PA_MFRMS_8 0x06
696#define RSL_BS_PA_MFRMS_9 0x07
697
698/* RSL_IE_IPAC_RTP_PAYLOAD[2] */
699enum rsl_ipac_rtp_payload {
700 RSL_IPAC_RTP_GSM = 1,
701 RSL_IPAC_RTP_EFR,
702 RSL_IPAC_RTP_AMR,
703 RSL_IPAC_RTP_CSD,
704 RSL_IPAC_RTP_MUX,
705};
706
707/* RSL_IE_IPAC_SPEECH_MODE, lower four bits */
708enum rsl_ipac_speech_mode_s {
709 RSL_IPAC_SPEECH_GSM_FR = 0, /* GSM FR (Type 1, FS) */
710 RSL_IPAC_SPEECH_GSM_EFR = 1, /* GSM EFR (Type 2, FS) */
711 RSL_IPAC_SPEECH_GSM_AMR_FR = 2, /* GSM AMR/FR (Type 3, FS) */
712 RSL_IPAC_SPEECH_GSM_HR = 3, /* GSM HR (Type 1, HS) */
713 RSL_IPAC_SPEECH_GSM_AMR_HR = 5, /* GSM AMR/hr (Type 3, HS) */
714 RSL_IPAC_SPEECH_AS_RTP = 0xf, /* As specified by RTP Payload IE */
715};
716/* RSL_IE_IPAC_SPEECH_MODE, upper four bits */
717enum rsl_ipac_speech_mode_m {
718 RSL_IPAC_SPEECH_M_RXTX = 0, /* Send and Receive */
719 RSL_IPAC_SPEECH_M_RX = 1, /* Receive only */
720 RSL_IPAC_SPEECH_M_TX = 2, /* Send only */
721};
722
723/* RSL_IE_IPAC_RTP_CSD_FMT, lower four bits */
724enum rsl_ipac_rtp_csd_format_d {
725 RSL_IPAC_RTP_CSD_EXT_TRAU = 0,
726 RSL_IPAC_RTP_CSD_NON_TRAU = 1,
727 RSL_IPAC_RTP_CSD_TRAU_BTS = 2,
728 RSL_IPAC_RTP_CSD_IWF_FREE = 3,
729};
730/* RSL_IE_IPAC_RTP_CSD_FMT, upper four bits */
731enum rsl_ipac_rtp_csd_format_ir {
732 RSL_IPAC_RTP_CSD_IR_8k = 0,
733 RSL_IPAC_RTP_CSD_IR_16k = 1,
734 RSL_IPAC_RTP_CSD_IR_32k = 2,
735 RSL_IPAC_RTP_CSD_IR_64k = 3,
736};
737
738/* Siemens vendor-specific RSL extensions */
739struct rsl_mrpci {
740 uint8_t power_class:3,
741 vgcs_capable:1,
742 vbs_capable:1,
743 gsm_phase:2;
744} __attribute__ ((packed));
745
746enum rsl_mrpci_pwrclass {
747 RSL_MRPCI_PWRC_1 = 0,
748 RSL_MRPCI_PWRC_2 = 1,
749 RSL_MRPCI_PWRC_3 = 2,
750 RSL_MRPCI_PWRC_4 = 3,
751 RSL_MRPCI_PWRC_5 = 4,
752};
753enum rsl_mrpci_phase {
754 RSL_MRPCI_PHASE_1 = 0,
755 /* reserved */
756 RSL_MRPCI_PHASE_2 = 2,
757 RSL_MRPCI_PHASE_2PLUS = 3,
758};
759
Holger Hans Peter Freyther0357e9b2012-12-06 11:57:31 +0100760/* 9.3.20 Release Mode */
761enum rsl_rel_mode {
762 RSL_REL_NORMAL = 0,
763 RSL_REL_LOCAL_END = 1,
764};
765
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200766/*! ip.access specific embedded information elements */
Harald Weltefad57522015-12-13 11:56:36 +0100767enum rsl_ipac_embedded_ie {
768 RSL_IPAC_EIE_RXLEV = 0x00,
769 RSL_IPAC_EIE_RXQUAL = 0x01,
770 RSL_IPAC_EIE_FREQ_ERR = 0x02,
771 RSL_IPAC_EIE_TIMING_ERR = 0x03,
772 RSL_IPAC_EIE_MEAS_AVG_CFG = 0x04,
773 RSL_IPAC_EIE_BS_PWR_CTL = 0x05,
774 RSL_IPAC_EIE_MS_PWR_CTL = 0x06,
775 RSL_IPAC_EIE_HANDO_THRESH = 0x07,
776 RSL_IPAC_EIE_NCELL_DEFAULTS = 0x08,
777 RSL_IPAC_EIE_NCELL_LIST = 0x09,
778 RSL_IPAC_EIE_PC_THRESH_COMP = 0x0a,
779 RSL_IPAC_EIE_HO_THRESH_COMP = 0x0b,
780 RSL_IPAC_EIE_HO_CAUSE = 0x0c,
781 RSL_IPAC_EIE_HO_CANDIDATES = 0x0d,
782 RSL_IPAC_EIE_NCELL_BA_CHG_LIST = 0x0e,
783 RSL_IPAC_EIE_NUM_OF_MS = 0x10,
784 RSL_IPAC_EIE_HO_CAND_EXT = 0x11,
785 RSL_IPAC_EIE_NCELL_DEF_EXT = 0x12,
786 RSL_IPAC_EIE_NCELL_LIST_EXT = 0x13,
787 RSL_IPAC_EIE_MASTER_KEY = 0x14,
788 RSL_IPAC_EIE_MASTER_SALT = 0x15,
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400789 /* additional IPAC measurement pre-processing related IEI */
790 RSL_IPAC_EIE_MEAS_TRANS_RES = 0x16,
791 RSL_IPAC_EIE_3G_HO_PARAM = 0x17,
792 RSL_IPAC_EIE_3G_NCELL_LIST = 0x18,
793 RSL_IPAC_EIE_SDCCH_CTL_PARAM = 0x1a,
794 RSL_IPAC_EIE_AMR_CONV_THRESH = 0x1b,
795
796};
797
798struct ipac_preproc_ave_cfg {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100799#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400800 uint8_t h_reqave:5,
801 param_id:2,
802 reserved:1;
803 uint8_t h_reqt:5,
804 ave_method:3;
Vadim Yanitskiy8f5844e2020-12-25 00:19:45 +0100805 uint8_t params[0];
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100806#elif OSMO_IS_BIG_ENDIAN
807/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
808 uint8_t reserved:1, param_id:2, h_reqave:5;
809 uint8_t ave_method:3, h_reqt:5;
Vadim Yanitskiy8f5844e2020-12-25 00:19:45 +0100810 uint8_t params[0];
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100811#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400812}__attribute__ ((packed));
813
Vadim Yanitskiya346c452020-12-15 07:48:58 +0100814/*! MS/BS Power Control Thresholds */
815struct ipac_preproc_pc_thresh {
816#if OSMO_IS_LITTLE_ENDIAN
817 uint8_t l_rxlev:6, reserved_l_rxlev:2;
818 uint8_t u_rxlev:6, reserved_u_rxlev:2;
Vadim Yanitskiy2060bbb2020-12-19 17:33:41 +0100819 uint8_t u_rxqual:3, reserved_u_rxqual:1,
820 l_rxqual:3, reserved_l_rxqual:1;
Vadim Yanitskiya346c452020-12-15 07:48:58 +0100821#elif OSMO_IS_BIG_ENDIAN
822 uint8_t reserved_l_rxlev:2, l_rxlev:6;
823 uint8_t reserved_u_rxlev:2, u_rxlev:6;
824 uint8_t reserved_l_rxqual:1, l_rxqual:3,
825 reserved_u_rxqual:1, u_rxqual:3;
826#endif
827}__attribute__ ((packed));
828
829/*! Handover Thresholds */
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400830struct ipac_preproc_ho_thresh {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100831#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400832 uint8_t l_rxlev_ul_h:6,
833 reserved_l_rxlev_ul:2;
834 uint8_t l_rxlev_dl_h:6,
835 reserved_l_rxlev_dl:2;
836 uint8_t rxlev_ul_ih:6,
837 reserved_rxlev_ul:2;
838 uint8_t rxlev_dl_ih:6,
839 reserved_rxlev_dl:2;
840 uint8_t l_rxqual_ul_h:3,
841 reserved_rxlqual_ul:1,
842 l_rxqual_dl_h:3,
843 reserved_rxqual_dl:1;
844 uint8_t ms_range_max:6,
845 reserved_ms_range:2;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100846#elif OSMO_IS_BIG_ENDIAN
847/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
848 uint8_t reserved_l_rxlev_ul:2, l_rxlev_ul_h:6;
849 uint8_t reserved_l_rxlev_dl:2, l_rxlev_dl_h:6;
850 uint8_t reserved_rxlev_ul:2, rxlev_ul_ih:6;
851 uint8_t reserved_rxlev_dl:2, rxlev_dl_ih:6;
852 uint8_t reserved_rxqual_dl:1, l_rxqual_dl_h:3, reserved_rxlqual_ul:1, l_rxqual_ul_h:3;
853 uint8_t reserved_ms_range:2, ms_range_max:6;
854#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400855}__attribute__ ((packed));
856
Vadim Yanitskiya346c452020-12-15 07:48:58 +0100857/*! PC Threshold Comparators */
858struct ipac_preproc_pc_comp {
859#if OSMO_IS_LITTLE_ENDIAN
860 uint8_t p1:5, reserved_p1:3;
861 uint8_t n1:5, reserved_n1:3;
862 uint8_t p2:5, reserved_p2:3;
863 uint8_t n2:5, reserved_n2:3;
864 uint8_t p3:5, reserved_p3:3;
865 uint8_t n3:5, reserved_n3:3;
866 uint8_t p4:5, reserved_p4:3;
867 uint8_t n4:5, reserved_n4:3;
868 uint8_t pc_interval:5, reserved_pc:3;
869 uint8_t red_step_size:4, inc_step_size:4;
870#elif OSMO_IS_BIG_ENDIAN
871 uint8_t reserved_p1:3, p1:5;
872 uint8_t reserved_n1:3, n1:5;
873 uint8_t reserved_p2:3, p2:5;
874 uint8_t reserved_n2:3, n2:5;
875 uint8_t reserved_p3:3, p3:5;
876 uint8_t reserved_n3:3, n3:5;
877 uint8_t reserved_p4:3, p4:5;
878 uint8_t reserved_n4:3, n4:5;
879 uint8_t reserved_pc:3, pc_interval:5;
880 uint8_t inc_step_size:4, red_step_size:4;
881#endif
882}__attribute__ ((packed));
883
884/*! HO Threshold Comparators */
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400885struct ipac_preproc_ho_comp {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100886#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400887 uint8_t p5:5,
888 reserved_p5:3;
889 uint8_t n5:5,
890 reserved_n5:3;
891 uint8_t p6:5,
892 reserved_p6:3;
893 uint8_t n6:5,
894 reserved_n6:3;
895 uint8_t p7:5,
896 reserved_p7:3;
897 uint8_t n7:5,
898 reserved_n7:3;
899 uint8_t p8:5,
900 reserved_p8:3;
901 uint8_t n8:5,
902 reserved_n8:3;
903 uint8_t ho_interval:5,
904 reserved_ho:3;
905 uint8_t reserved;
906
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100907#elif OSMO_IS_BIG_ENDIAN
908/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
909 uint8_t reserved_p5:3, p5:5;
910 uint8_t reserved_n5:3, n5:5;
911 uint8_t reserved_p6:3, p6:5;
912 uint8_t reserved_n6:3, n6:5;
913 uint8_t reserved_p7:3, p7:5;
914 uint8_t reserved_n7:3, n7:5;
915 uint8_t reserved_p8:3, p8:5;
916 uint8_t reserved_n8:3, n8:5;
917 uint8_t reserved_ho:3, ho_interval:5;
918 uint8_t reserved;
919#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400920}__attribute__ ((packed));
921
922struct ipac_preproc_ho_candidates {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100923#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400924 uint8_t bsic:6,
925 reserved0:2;
926 uint8_t bcch_freq:5,
927 ba_used:1,
928 s:1,
929 reserved1:1;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100930#elif OSMO_IS_BIG_ENDIAN
931/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
932 uint8_t reserved0:2, bsic:6;
933 uint8_t reserved1:1, s:1, ba_used:1, bcch_freq:5;
934#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400935}__attribute__ ((packed));
936
937struct ipac_preproc_ncell_dflts {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100938#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400939 uint8_t rxlev_min_def:6,
940 reserved_rxlev_min_def:2;
941 uint8_t ho_margin_def:5,
942 reserved_ho_margin_def:3;
943 uint8_t ms_txpwr_max_def:5,
944 reserved_ms_txpwr_max_def:3;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100945#elif OSMO_IS_BIG_ENDIAN
946/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
947 uint8_t reserved_rxlev_min_def:2, rxlev_min_def:6;
948 uint8_t reserved_ho_margin_def:3, ho_margin_def:5;
949 uint8_t reserved_ms_txpwr_max_def:3, ms_txpwr_max_def:5;
950#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400951}__attribute__ ((packed));
952
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -0500953struct ipac_preproc_ho_ctl_param {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100954#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -0500955 uint8_t sdcch_ho_gsm:1,
956 sdcch_ho_umts:1,
957 reserved:6;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100958#elif OSMO_IS_BIG_ENDIAN
959/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
960 uint8_t reserved:6, sdcch_ho_umts:1, sdcch_ho_gsm:1;
961#endif
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -0500962}__attribute__ ((packed));
963
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400964struct ipac_preproc_cfg {
965 uint8_t meas_rep_mode;
966 uint32_t meas_mode_flags;
967 struct ipac_preproc_ave_cfg ms_ave_cfg[3];
968 struct ipac_preproc_ave_cfg ave_cfg;
969 struct ipac_preproc_ho_thresh ho_thresh;
970 struct ipac_preproc_ho_comp ho_comp;
971 struct ipac_preproc_ncell_dflts ncell_dflts;
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -0500972 struct ipac_preproc_ho_ctl_param ho_ctl_param;
Harald Weltefad57522015-12-13 11:56:36 +0100973};
974
Philipp Maierca770ae2021-02-16 17:31:22 +0100975struct rsl_l1_info {
976#if OSMO_IS_BIG_ENDIAN
977 uint8_t ms_pwr:5,
978 fpc_epc:1,
979 srr_sro:1,
980 reserved:1;
981 uint8_t ta;
982#elif OSMO_IS_LITTLE_ENDIAN
983 uint8_t reserved:1,
984 srr_sro:1,
985 fpc_epc:1,
986 ms_pwr:5;
987 uint8_t ta;
988#endif
989} __attribute__ ((packed));
990
Sylvain Munautdca7d2c2012-04-18 21:53:23 +0200991/*! @} */