blob: e8758df09299921251a4854223825309ef3947a2 [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 *
Harald Welteec8b4502010-02-20 20:34:29 +010018 */
19
Neels Hofmeyr17518fe2017-06-20 04:35:06 +020020#pragma once
21
Harald Welteec8b4502010-02-20 20:34:29 +010022#include <stdint.h>
23
Pau Espin Pedrol42908032018-10-10 17:04:28 +020024#include <osmocom/core/endian.h>
25
Harald Welte8f2c7e52011-08-17 18:52:03 +020026/*! \addtogroup rsl
27 * @{
Neels Hofmeyr17518fe2017-06-20 04:35:06 +020028 * \file gsm_08_58.h */
Harald Welte8f2c7e52011-08-17 18:52:03 +020029
Pau Espin Pedrolfb97e722018-10-10 20:41:40 +020030/* Channel Number 9.3.1 */
31union abis_rsl_chan_nr {
Andreas Eversberg5560c042023-11-29 08:32:46 +010032 struct {
Pau Espin Pedrolfb97e722018-10-10 20:41:40 +020033#if OSMO_IS_BIG_ENDIAN
34 uint8_t cbits:5,
35 tn:3;
36#elif OSMO_IS_LITTLE_ENDIAN
37 uint8_t tn:3,
38 cbits:5;
39#endif
Andreas Eversberg5560c042023-11-29 08:32:46 +010040 } __attribute__ ((packed));
41 uint8_t chan_nr;
Pau Espin Pedrolfb97e722018-10-10 20:41:40 +020042} __attribute__ ((packed));
43#define ABIS_RSL_CHAN_NR_CBITS_Bm_ACCHs 0x01
44#define ABIS_RSL_CHAN_NR_CBITS_Lm_ACCHs(ss) (0x02 + (ss))
45#define ABIS_RSL_CHAN_NR_CBITS_SDCCH4_ACCH(ss) (0x04 + (ss))
46#define ABIS_RSL_CHAN_NR_CBITS_SDCCH8_ACCH(ss) (0x08 + (ss))
47#define ABIS_RSL_CHAN_NR_CBITS_BCCH 0x10
48#define ABIS_RSL_CHAN_NR_CBITS_RACH 0x11
49#define ABIS_RSL_CHAN_NR_CBITS_PCH_AGCH 0x12
50#define ABIS_RSL_CHAN_NR_CBITS_OSMO_PDCH 0x18 /*< non-standard, for dyn TS */
Harald Weltea8d7ebb2019-05-27 16:51:23 +020051#define ABIS_RSL_CHAN_NR_CBITS_OSMO_CBCH4 0x19 /*< non-standard, for CBCH/SDCCH4 */
52#define ABIS_RSL_CHAN_NR_CBITS_OSMO_CBCH8 0x1a /*< non-standard, for CBCH/SDCCH8 */
Pau Espin Pedrolfb97e722018-10-10 20:41:40 +020053
Vadim Yanitskiyfc02ff42021-05-26 18:19:03 +020054/* non-standard, Osmocom specific Bm/Lm equivalents for VAMOS */
55#define ABIS_RSL_CHAN_NR_CBITS_OSMO_VAMOS_Bm_ACCHs 0x1d /*< VAMOS TCH/F */
56#define ABIS_RSL_CHAN_NR_CBITS_OSMO_VAMOS_Lm_ACCHs(ss) (0x1e + (ss)) /*< VAMOS TCH/H */
57
Pau Espin Pedrol42908032018-10-10 17:04:28 +020058/* Link Identifier 9.3.2 */
59union abis_rsl_link_id {
Andreas Eversberg5560c042023-11-29 08:32:46 +010060 struct {
Pau Espin Pedrol42908032018-10-10 17:04:28 +020061#if OSMO_IS_BIG_ENDIAN
62 uint8_t cbits:2,
63 na:1,
Martin Haukee63b8872018-11-15 14:53:13 +010064 reserved:2,
Pau Espin Pedrol42908032018-10-10 17:04:28 +020065 sapi:3;
66#elif OSMO_IS_LITTLE_ENDIAN
67 uint8_t sapi:3,
68 reserved:2,
69 na:1,
70 cbits:2;
71#endif
Andreas Eversberg5560c042023-11-29 08:32:46 +010072 } __attribute__ ((packed));
73 uint8_t link_id;
Pau Espin Pedrol42908032018-10-10 17:04:28 +020074} __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 {
Pau Espin Pedrol28c43882021-12-22 13:56:42 +0100125#if OSMO_IS_LITTLE_ENDIAN
Philipp Maier55ce87d2021-08-31 09:24:37 +0200126 uint8_t dl_facch_cmd:1,
127 dl_facch_all:1,
128 dl_sacch:1,
129 ul_sacch:1,
130 rxqual:3,
131 reserved:1;
Pau Espin Pedrol28c43882021-12-22 13:56:42 +0100132#elif OSMO_IS_BIG_ENDIAN
Oliver Smith0b5c09b2023-02-17 10:35:38 +0100133/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
Pau Espin Pedrol28c43882021-12-22 13:56:42 +0100134 uint8_t reserved:1, rxqual:3, ul_sacch:1, dl_sacch:1, dl_facch_all:1, dl_facch_cmd:1;
Philipp Maier439ddbe2020-11-16 17:49:34 +0100135#endif
136} __attribute__ ((packed));
Harald Welteec8b4502010-02-20 20:34:29 +0100137
Philipp Maier0e44a722021-08-30 10:51:52 +0200138/* Osmocom specific IE to negotiate temporary overpower of ACCH channels */
139struct abis_rsl_osmo_temp_ovp_acch_cap {
Pau Espin Pedrol28c43882021-12-22 13:56:42 +0100140#if OSMO_IS_LITTLE_ENDIAN
Vadim Yanitskiy8db64ee2021-10-20 14:36:18 +0300141 uint8_t overpower_db:3,
142 rxqual:3,
143 facch_enable:1,
144 sacch_enable:1;
Pau Espin Pedrol28c43882021-12-22 13:56:42 +0100145#elif OSMO_IS_BIG_ENDIAN
Oliver Smith0b5c09b2023-02-17 10:35:38 +0100146/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
Pau Espin Pedrol28c43882021-12-22 13:56:42 +0100147 uint8_t sacch_enable:1, facch_enable:1, rxqual:3, overpower_db:3;
Vadim Yanitskiy8db64ee2021-10-20 14:36:18 +0300148#endif
Philipp Maier0e44a722021-08-30 10:51:52 +0200149} __attribute__ ((packed));
150
Harald Welteec8b4502010-02-20 20:34:29 +0100151/* Chapter 9.1 */
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200152/* RSL Message Discriminator: RLL */
Harald Welteec8b4502010-02-20 20:34:29 +0100153#define ABIS_RSL_MDISC_RLL 0x02
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200154/* RSL Message Discriminator: Dedicated Channel */
Harald Welteec8b4502010-02-20 20:34:29 +0100155#define ABIS_RSL_MDISC_DED_CHAN 0x08
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200156/* RSL Message Discriminator: Common Channel */
Harald Welteec8b4502010-02-20 20:34:29 +0100157#define ABIS_RSL_MDISC_COM_CHAN 0x0c
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200158/* RSL Message Discriminator: TRX Management */
Harald Welteec8b4502010-02-20 20:34:29 +0100159#define ABIS_RSL_MDISC_TRX 0x10
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200160/* RSL Message Discriminator: Location Service */
Harald Welteec8b4502010-02-20 20:34:29 +0100161#define ABIS_RSL_MDISC_LOC 0x20
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200162/* RSL Message Discriminator: ip.access */
Harald Welteec8b4502010-02-20 20:34:29 +0100163#define ABIS_RSL_MDISC_IPACCESS 0x7e
164#define ABIS_RSL_MDISC_TRANSP 0x01
165
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200166/* Check if given RSL message discriminator is transparent */
Harald Welteec8b4502010-02-20 20:34:29 +0100167#define ABIS_RSL_MDISC_IS_TRANSP(x) (x & 0x01)
168
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200169/* RSL Message Type (Chapter 9.1) */
Harald Welteec8b4502010-02-20 20:34:29 +0100170enum abis_rsl_msgtype {
171 /* Radio Link Layer Management */
172 RSL_MT_DATA_REQ = 0x01,
173 RSL_MT_DATA_IND,
174 RSL_MT_ERROR_IND,
175 RSL_MT_EST_REQ,
176 RSL_MT_EST_CONF,
177 RSL_MT_EST_IND,
178 RSL_MT_REL_REQ,
179 RSL_MT_REL_CONF,
180 RSL_MT_REL_IND,
181 RSL_MT_UNIT_DATA_REQ,
182 RSL_MT_UNIT_DATA_IND, /* 0x0b */
Andreas Eversberg816e24c2010-06-25 02:50:56 +0200183 RSL_MT_SUSP_REQ, /* non-standard elements */
184 RSL_MT_SUSP_CONF,
185 RSL_MT_RES_REQ,
186 RSL_MT_RECON_REQ, /* 0x0f */
Harald Welteec8b4502010-02-20 20:34:29 +0100187
188 /* Common Channel Management / TRX Management */
189 RSL_MT_BCCH_INFO = 0x11,
190 RSL_MT_CCCH_LOAD_IND,
191 RSL_MT_CHAN_RQD,
192 RSL_MT_DELETE_IND,
193 RSL_MT_PAGING_CMD,
194 RSL_MT_IMMEDIATE_ASSIGN_CMD,
195 RSL_MT_SMS_BC_REQ,
Harald Welte6eb7d6c2010-07-13 13:48:13 +0200196 RSL_MT_CHAN_CONF, /* non-standard element */
Harald Welteec8b4502010-02-20 20:34:29 +0100197 /* empty */
198 RSL_MT_RF_RES_IND = 0x19,
199 RSL_MT_SACCH_FILL,
200 RSL_MT_OVERLOAD,
201 RSL_MT_ERROR_REPORT,
202 RSL_MT_SMS_BC_CMD,
203 RSL_MT_CBCH_LOAD_IND,
204 RSL_MT_NOT_CMD, /* 0x1f */
205
206 /* Dedicate Channel Management */
207 RSL_MT_CHAN_ACTIV = 0x21,
208 RSL_MT_CHAN_ACTIV_ACK,
209 RSL_MT_CHAN_ACTIV_NACK,
210 RSL_MT_CONN_FAIL,
211 RSL_MT_DEACTIVATE_SACCH,
212 RSL_MT_ENCR_CMD,
213 RSL_MT_HANDO_DET,
214 RSL_MT_MEAS_RES,
215 RSL_MT_MODE_MODIFY_REQ,
216 RSL_MT_MODE_MODIFY_ACK,
217 RSL_MT_MODE_MODIFY_NACK,
218 RSL_MT_PHY_CONTEXT_REQ,
219 RSL_MT_PHY_CONTEXT_CONF,
220 RSL_MT_RF_CHAN_REL,
221 RSL_MT_MS_POWER_CONTROL,
222 RSL_MT_BS_POWER_CONTROL, /* 0x30 */
223 RSL_MT_PREPROC_CONFIG,
224 RSL_MT_PREPROC_MEAS_RES,
225 RSL_MT_RF_CHAN_REL_ACK,
226 RSL_MT_SACCH_INFO_MODIFY,
227 RSL_MT_TALKER_DET,
228 RSL_MT_LISTENER_DET,
229 RSL_MT_REMOTE_CODEC_CONF_REP,
230 RSL_MT_RTD_REP,
231 RSL_MT_PRE_HANDO_NOTIF,
232 RSL_MT_MR_CODEC_MOD_REQ,
233 RSL_MT_MR_CODEC_MOD_ACK,
234 RSL_MT_MR_CODEC_MOD_NACK,
235 RSL_MT_MR_CODEC_MOD_PER,
236 RSL_MT_TFO_REP,
237 RSL_MT_TFO_MOD_REQ, /* 0x3f */
238 RSL_MT_LOCATION_INFO = 0x41,
239
240 /* ip.access specific RSL message types */
241 RSL_MT_IPAC_DIR_RETR_ENQ = 0x40,
242 RSL_MT_IPAC_PDCH_ACT = 0x48,
243 RSL_MT_IPAC_PDCH_ACT_ACK,
244 RSL_MT_IPAC_PDCH_ACT_NACK,
245 RSL_MT_IPAC_PDCH_DEACT = 0x4b,
246 RSL_MT_IPAC_PDCH_DEACT_ACK,
247 RSL_MT_IPAC_PDCH_DEACT_NACK,
248 RSL_MT_IPAC_CONNECT_MUX = 0x50,
249 RSL_MT_IPAC_CONNECT_MUX_ACK,
250 RSL_MT_IPAC_CONNECT_MUX_NACK,
251 RSL_MT_IPAC_BIND_MUX = 0x53,
252 RSL_MT_IPAC_BIND_MUX_ACK,
253 RSL_MT_IPAC_BIND_MUX_NACK,
254 RSL_MT_IPAC_DISC_MUX = 0x56,
255 RSL_MT_IPAC_DISC_MUX_ACK,
256 RSL_MT_IPAC_DISC_MUX_NACK,
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400257 RSL_MT_IPAC_MEAS_PREPROC_DFT = 0x60, /*Extented Common Channel Management */
258 RSL_MT_IPAC_HO_CAN_ENQ = 0x61,
259 RSL_MT_IPAC_HO_CAN_RES = 0x62,
Harald Welteec8b4502010-02-20 20:34:29 +0100260 RSL_MT_IPAC_CRCX = 0x70, /* Bind to local BTS RTP port */
261 RSL_MT_IPAC_CRCX_ACK,
262 RSL_MT_IPAC_CRCX_NACK,
263 RSL_MT_IPAC_MDCX = 0x73,
264 RSL_MT_IPAC_MDCX_ACK,
265 RSL_MT_IPAC_MDCX_NACK,
266 RSL_MT_IPAC_DLCX_IND = 0x76,
267 RSL_MT_IPAC_DLCX = 0x77,
268 RSL_MT_IPAC_DLCX_ACK,
269 RSL_MT_IPAC_DLCX_NACK,
Harald Weltef9456892019-09-03 13:56:00 +0200270
271 RSL_MT_OSMO_ETWS_CMD = 0x7f,
Harald Welteec8b4502010-02-20 20:34:29 +0100272};
273
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200274/*! Siemens vendor-specific RSL message types */
Harald Welteec8b4502010-02-20 20:34:29 +0100275enum abis_rsl_msgtype_siemens {
276 RSL_MT_SIEMENS_MRPCI = 0x41,
277 RSL_MT_SIEMENS_INTRAC_HO_COND_IND = 0x42,
278 RSL_MT_SIEMENS_INTERC_HO_COND_IND = 0x43,
279 RSL_MT_SIEMENS_FORCED_HO_REQ = 0x44,
280 RSL_MT_SIEMENS_PREF_AREA_REQ = 0x45,
281 RSL_MT_SIEMENS_PREF_AREA = 0x46,
282 RSL_MT_SIEMENS_START_TRACE = 0x47,
283 RSL_MT_SIEMENS_START_TRACE_ACK = 0x48,
284 RSL_MT_SIEMENS_STOP_TRACE = 0x49,
285 RSL_MT_SIEMENS_TRMR = 0x4a,
286 RSL_MT_SIEMENS_HO_FAIL_IND = 0x4b,
287 RSL_MT_SIEMENS_STOP_TRACE_ACK = 0x4c,
288 RSL_MT_SIEMENS_UPLF = 0x4d,
289 RSL_MT_SIEMENS_UPLB = 0x4e,
290 RSL_MT_SIEMENS_SET_SYS_INFO_10 = 0x4f,
291 RSL_MT_SIEMENS_MODIF_COND_IND = 0x50,
292};
293
Pau Espin Pedrol95959a82018-04-21 22:47:54 +0200294/*! Ericsson vendor-specific RSL message types */
295enum abis_rsl_msgtype_ericsson {
296 RSL_MT_ERICSSON_IMM_ASS_SENT = 0x10,
297};
298
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200299/*! RSL Information Element Identifiers (Chapter 9.3) */
Harald Welteec8b4502010-02-20 20:34:29 +0100300enum abis_rsl_ie {
301 RSL_IE_CHAN_NR = 0x01,
302 RSL_IE_LINK_IDENT,
303 RSL_IE_ACT_TYPE,
304 RSL_IE_BS_POWER,
305 RSL_IE_CHAN_IDENT,
306 RSL_IE_CHAN_MODE,
307 RSL_IE_ENCR_INFO,
308 RSL_IE_FRAME_NUMBER,
309 RSL_IE_HANDO_REF,
310 RSL_IE_L1_INFO,
311 RSL_IE_L3_INFO,
312 RSL_IE_MS_IDENTITY,
313 RSL_IE_MS_POWER,
314 RSL_IE_PAGING_GROUP,
315 RSL_IE_PAGING_LOAD,
316 RSL_IE_PYHS_CONTEXT = 0x10,
317 RSL_IE_ACCESS_DELAY,
318 RSL_IE_RACH_LOAD,
319 RSL_IE_REQ_REFERENCE,
320 RSL_IE_RELEASE_MODE,
321 RSL_IE_RESOURCE_INFO,
322 RSL_IE_RLM_CAUSE,
323 RSL_IE_STARTNG_TIME,
324 RSL_IE_TIMING_ADVANCE,
325 RSL_IE_UPLINK_MEAS,
326 RSL_IE_CAUSE,
327 RSL_IE_MEAS_RES_NR,
328 RSL_IE_MSG_ID,
329 /* reserved */
330 RSL_IE_SYSINFO_TYPE = 0x1e,
331 RSL_IE_MS_POWER_PARAM,
332 RSL_IE_BS_POWER_PARAM,
333 RSL_IE_PREPROC_PARAM,
334 RSL_IE_PREPROC_MEAS,
335 RSL_IE_IMM_ASS_INFO, /* Phase 1 (3.6.0), later Full below */
336 RSL_IE_SMSCB_INFO = 0x24,
337 RSL_IE_MS_TIMING_OFFSET,
338 RSL_IE_ERR_MSG,
339 RSL_IE_FULL_BCCH_INFO,
340 RSL_IE_CHAN_NEEDED,
341 RSL_IE_CB_CMD_TYPE,
342 RSL_IE_SMSCB_MSG,
343 RSL_IE_FULL_IMM_ASS_INFO,
344 RSL_IE_SACCH_INFO,
345 RSL_IE_CBCH_LOAD_INFO,
346 RSL_IE_SMSCB_CHAN_INDICATOR,
347 RSL_IE_GROUP_CALL_REF,
348 RSL_IE_CHAN_DESC = 0x30,
349 RSL_IE_NCH_DRX_INFO,
350 RSL_IE_CMD_INDICATOR,
351 RSL_IE_EMLPP_PRIO,
352 RSL_IE_UIC,
353 RSL_IE_MAIN_CHAN_REF,
354 RSL_IE_MR_CONFIG,
355 RSL_IE_MR_CONTROL,
356 RSL_IE_SUP_CODEC_TYPES,
357 RSL_IE_CODEC_CONFIG,
358 RSL_IE_RTD,
359 RSL_IE_TFO_STATUS,
360 RSL_IE_LLP_APDU,
361 /* Siemens vendor-specific */
362 RSL_IE_SIEMENS_MRPCI = 0x40,
363 RSL_IE_SIEMENS_PREF_AREA_TYPE = 0x43,
364 RSL_IE_SIEMENS_ININ_CELL_HO_PAR = 0x45,
365 RSL_IE_SIEMENS_TRACE_REF_NR = 0x46,
366 RSL_IE_SIEMENS_INT_TRACE_IDX = 0x47,
367 RSL_IE_SIEMENS_L2_HDR_INFO = 0x48,
368 RSL_IE_SIEMENS_HIGHEST_RATE = 0x4e,
369 RSL_IE_SIEMENS_SUGGESTED_RATE = 0x4f,
370
Philipp Maiera15967b2020-11-06 21:37:16 +0100371 /* Osmocom specific */
Philipp Maiere67edfd2021-08-31 09:46:35 +0200372 RSL_IE_OSMO_REP_ACCH_CAP = 0x60,
Neels Hofmeyrdd6f1362021-04-20 23:02:59 +0200373 RSL_IE_OSMO_TRAINING_SEQUENCE = 0x61,
Philipp Maier0e44a722021-08-30 10:51:52 +0200374 RSL_IE_OSMO_TEMP_OVP_ACCH_CAP = 0x62,
Pau Espin Pedrol83287ba2022-08-08 17:07:18 +0200375 RSL_IE_OSMO_OSMUX_CID = 0x63,
Philipp Maiera15967b2020-11-06 21:37:16 +0100376
Harald Welteec8b4502010-02-20 20:34:29 +0100377 /* ip.access */
378 RSL_IE_IPAC_SRTP_CONFIG = 0xe0,
379 RSL_IE_IPAC_PROXY_UDP = 0xe1,
380 RSL_IE_IPAC_BSCMPL_TOUT = 0xe2,
381 RSL_IE_IPAC_REMOTE_IP = 0xf0,
382 RSL_IE_IPAC_REMOTE_PORT = 0xf1,
383 RSL_IE_IPAC_RTP_PAYLOAD = 0xf2,
384 RSL_IE_IPAC_LOCAL_PORT = 0xf3,
385 RSL_IE_IPAC_SPEECH_MODE = 0xf4,
386 RSL_IE_IPAC_LOCAL_IP = 0xf5,
387 RSL_IE_IPAC_CONN_STAT = 0xf6,
388 RSL_IE_IPAC_HO_C_PARMS = 0xf7,
389 RSL_IE_IPAC_CONN_ID = 0xf8,
390 RSL_IE_IPAC_RTP_CSD_FMT = 0xf9,
391 RSL_IE_IPAC_RTP_JIT_BUF = 0xfa,
392 RSL_IE_IPAC_RTP_COMPR = 0xfb,
Pau Espin Pedrolb0c2f752022-04-04 19:37:19 +0200393 RSL_IE_IPAC_RTP_PAYLOAD2 = 0xfc,
Harald Welteec8b4502010-02-20 20:34:29 +0100394 RSL_IE_IPAC_RTP_MPLEX = 0xfd,
Pau Espin Pedrolb0c2f752022-04-04 19:37:19 +0200395 RSL_IE_IPAC_RTP_MPLEX_ID = 0xfe,
Harald Welteec8b4502010-02-20 20:34:29 +0100396};
397
Harald Welte6e363e72016-11-16 16:58:52 +0100398/* Ericsson specific IEs, clash with above partially, so they're not
399 * part of the enum */
Alexander Couzens9f39d892018-04-21 21:20:25 +0200400#define RSL_IE_ERIC_PAGING_GROUP 0x0e
Harald Welte6e363e72016-11-16 16:58:52 +0100401#define RSL_IE_ERIC_INST_NR 0x48
402#define RSL_IE_ERIC_PGSL_TIMERS 0x49
403#define RSL_IE_ERIC_REPEAT_DL_FACCH 0x4a
404#define RSL_IE_ERIC_POWER_INFO 0xf0
405#define RSL_IE_ERIC_MOBILE_ID 0xf1
406#define RSL_IE_ERIC_BCCH_MAPPING 0xf2
407#define RSL_IE_ERIC_PACKET_PAG_IND 0xf3
408#define RSL_IE_ERIC_CNTR_CTRL 0xf4
409#define RSL_IE_ERIC_CNTR_CTRL_ACK 0xf5
410#define RSL_IE_ERIC_CNTR_REPORT 0xf6
411#define RSL_IE_ERIC_ICP_CONN 0xf7
412#define RSL_IE_ERIC_EMR_SUPPORT 0xf8
413#define RSL_IE_ERIC_EGPRS_REQ_REF 0xf9
414#define RSL_IE_ERIC_VGCS_REL 0xfa
415#define RSL_IE_ERIC_REP_PER_NCH 0xfb
416#define RSL_IE_ERIC_NY2 0xfc
417#define RSL_IE_ERIC_T3115 0xfd
418#define RSL_IE_ERIC_ACTIVATE_FLAG 0xfe
419#define RSL_IE_ERIC_FULL_NCH_INFO 0xff
420
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400421/* IPAC MEAS_PREPROC AVERAGING METHOD */
422enum {
423 IPAC_UNWEIGHTED_AVE = 0,
424 IPAC_WEIGHTED_AVE,
Vadim Yanitskiyc8158ec2020-12-15 08:04:30 +0100425 IPAC_MEDIAN_AVE,
426 /* EWMA is an Osmocom specific extension */
427 IPAC_OSMO_EWMA_AVE,
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400428};
429
Pau Espin Pedrol9da16b52021-08-26 15:25:16 +0200430/* IPAC MEAS_PREPROC AVERAGING PARAM ID */
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400431enum {
432 IPAC_RXLEV_AVE = 0,
433 IPAC_RXQUAL_AVE,
434 IPAC_MS_BTS_DIS_AVE
435};
436
437/* IPAC MEAS_PREPROC HO CAUSES */
438enum {
439 IPAC_HO_RQD_CAUSE_L_RXLEV_UL_H = 0x01,
440 IPAC_HO_RQD_CAUSE_L_RXLEV_DL_H,
441 IPAC_HO_RQD_CAUSE_L_RXQUAL_UL_H,
442 IPAC_HO_RQD_CAUSE_L_RXQUAL_DL_H,
443 IPAC_HO_RQD_CAUSE_RXLEV_UL_IH,
444 IPAC_HO_RQD_CAUSE_RXLEV_DL_IH,
445 IPAC_HO_RQD_CAUSE_MAX_MS_RANGE,
446 IPAC_HO_RQD_CAUSE_POWER_BUDGET,
447 IPAC_HO_RQD_CAUSE_ENQUIRY,
448 IPAC_HO_RQD_CAUSE_ENQUIRY_FAILED,
449 IPAC_HO_RQD_CAUSE_NORMAL3G,
450 IPAC_HO_RQD_CAUSE_EMERGENCY3G,
451 IPAC_HO_RQD_CAUSE_SERVICE_PREFERRED3G,
452 IPAC_HO_RQD_CAUSE_O_M_SHUTDOWN,
453 IPAC_HO_RQD_CAUSE_QUALITY_PROMOTION,
454 IPAC_HO_RQD_CAUSE_LOAD_PROMOTION,
455 IPAC_HO_RQD_CAUSE_LOAD_DEMOTION,
456 IPAC_HO_RQD_CAUSE_MAX,
457};
458
Harald Welteec8b4502010-02-20 20:34:29 +0100459/* Chapter 9.3.1 */
460#define RSL_CHAN_NR_MASK 0xf8
Neels Hofmeyr15b96ff2016-07-18 23:33:48 +0200461#define RSL_CHAN_NR_1 0x08 /*< bit to add for 2nd,... lchan */
Harald Welteec8b4502010-02-20 20:34:29 +0100462#define RSL_CHAN_Bm_ACCHs 0x08
463#define RSL_CHAN_Lm_ACCHs 0x10 /* .. 0x18 */
464#define RSL_CHAN_SDCCH4_ACCH 0x20 /* .. 0x38 */
465#define RSL_CHAN_SDCCH8_ACCH 0x40 /* ...0x78 */
466#define RSL_CHAN_BCCH 0x80
467#define RSL_CHAN_RACH 0x88
468#define RSL_CHAN_PCH_AGCH 0x90
Neels Hofmeyrfd80f5a2016-07-14 03:21:05 +0200469#define RSL_CHAN_OSMO_PDCH 0xc0 /*< non-standard, for dyn TS */
Harald Weltea8d7ebb2019-05-27 16:51:23 +0200470#define RSL_CHAN_OSMO_CBCH4 0xc8 /*< non-standard, for CBCH/SDCCH4 */
471#define RSL_CHAN_OSMO_CBCH8 0xd0 /*< non-standard, for CBCH/SDCCH8 */
Harald Welteec8b4502010-02-20 20:34:29 +0100472
Vadim Yanitskiyfc02ff42021-05-26 18:19:03 +0200473/* non-standard, Osmocom specific Bm/Lm equivalents for VAMOS */
474#define RSL_CHAN_OSMO_VAMOS_Bm_ACCHs 0xe8 /* VAMOS TCH/F */
475#define RSL_CHAN_OSMO_VAMOS_Lm_ACCHs 0xf0 /* VAMOS TCH/H */
Vadim Yanitskiy442ff642021-06-01 19:55:43 +0200476#define RSL_CHAN_OSMO_VAMOS_MASK 0xe0 /* VAMOS TCH/{F,H} */
Vadim Yanitskiyfc02ff42021-05-26 18:19:03 +0200477
Harald Welteec8b4502010-02-20 20:34:29 +0100478/* Chapter 9.3.3 */
479#define RSL_ACT_TYPE_INITIAL 0x00
480#define RSL_ACT_TYPE_REACT 0x80
481#define RSL_ACT_INTRA_IMM_ASS 0x00
482#define RSL_ACT_INTRA_NORM_ASS 0x01
483#define RSL_ACT_INTER_ASYNC 0x02
484#define RSL_ACT_INTER_SYNC 0x03
485#define RSL_ACT_SECOND_ADD 0x04
486#define RSL_ACT_SECOND_MULTI 0x05
Neels Hofmeyrfd80f5a2016-07-14 03:21:05 +0200487#define RSL_ACT_OSMO_PDCH 0x0f /*< non-standard, for dyn TS */
Harald Welteec8b4502010-02-20 20:34:29 +0100488
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200489/*! RSL Channel Mode IF (Chapter 9.3.6) */
Harald Welteec8b4502010-02-20 20:34:29 +0100490struct rsl_ie_chan_mode {
491 uint8_t dtx_dtu;
492 uint8_t spd_ind;
493 uint8_t chan_rt;
494 uint8_t chan_rate;
495} __attribute__ ((packed));
496#define RSL_CMOD_DTXu 0x01 /* uplink */
497#define RSL_CMOD_DTXd 0x02 /* downlink */
498enum rsl_cmod_spd {
499 RSL_CMOD_SPD_SPEECH = 0x01,
500 RSL_CMOD_SPD_DATA = 0x02,
501 RSL_CMOD_SPD_SIGN = 0x03,
502};
Oliver Smith9d92c6e2023-03-01 09:53:16 +0100503/*! Channel rate and type */
504enum rsl_cmod_crt {
505 RSL_CMOD_CRT_SDCCH = 0x01,
506 RSL_CMOD_CRT_TCH_Bm = 0x08, /* full-rate */
507 RSL_CMOD_CRT_TCH_Lm = 0x09, /* half-rate */
508 RSL_CMOD_CRT_TCH_BI_Bm = 0x0a, /* full-rate: bi-directional (multislot) */
509 RSL_CMOD_CRT_TCH_UNI_Bm = 0x1a, /* full-rate: uni-directional (multislot) */
510 RSL_CMOD_CRT_TCH_GROUP_Bm = 0x18, /* full-rate: group call channel */
511 RSL_CMOD_CRT_TCH_GROUP_Lm = 0x19, /* half-rate: group call channel */
512 RSL_CMOD_CRT_TCH_BCAST_Bm = 0x28, /* full-rate: broadcast call channel */
513 RSL_CMOD_CRT_TCH_BCAST_Lm = 0x29, /* half-rate: broadcast call channel */
514 RSL_CMOD_CRT_OSMO_TCH_VAMOS_Bm = 0x88, /* full-rate in VAMOS mode */
515 RSL_CMOD_CRT_OSMO_TCH_VAMOS_Lm = 0x89, /* half-rate in VAMOS mode */
516};
517/*! Speech */
518enum rsl_cmod_sp {
519 RSL_CMOD_SP_GSM1 = 0x01,
520 RSL_CMOD_SP_GSM2 = 0x11,
521 RSL_CMOD_SP_GSM3 = 0x21,
522 RSL_CMOD_SP_GSM4 = 0x31,
523 RSL_CMOD_SP_GSM5 = 0x09,
524 RSL_CMOD_SP_GSM6 = 0x0d,
525};
526/*! Non-transparent data */
527enum rsl_cmod_csd_nt {
528 RSL_CMOD_CSD_NTA_43k5_14k5 = 0x61, /* asymmetric 43.5 kbit/s (DL) + 14.5 kbit/s (UL) */
529 RSL_CMOD_CSD_NTA_29k0_14k5 = 0x62, /* asymmetric 29.0 kbit/s (DL) + 14.5 kbit/s (UL) */
530 RSL_CMOD_CSD_NTA_43k5_29k0 = 0x63, /* asymmetric 43.5 kbit/s (DL) + 29.0 kbit/s (UL) */
531 RSL_CMOD_CSD_NTA_14k5_43k5 = 0x69, /* asymmetric 14.5 kbit/s (DL) + 43.5 kbit/s (UL) */
532 RSL_CMOD_CSD_NTA_14k5_29k0 = 0x6a, /* asymmetric 14.5 kbit/s (DL) + 29.0 kbit/s (UL) */
533 RSL_CMOD_CSD_NTA_29k0_43k5 = 0x6b, /* asymmetric 29.0 kbit/s (DL) + 43.5 kbit/s (UL) */
534 RSL_CMOD_CSD_NT_43k5 = 0x74,
535 RSL_CMOD_CSD_NT_28k8 = 0x71,
536 RSL_CMOD_CSD_NT_14k5 = 0x58,
537 RSL_CMOD_CSD_NT_12k0 = 0x50,
538 RSL_CMOD_CSD_NT_6k0 = 0x51,
539};
Harald Welteeed26112012-08-24 15:35:34 +0200540/* legacy #defines with wrong name */
541#define RSL_CMOD_SP_NT_14k5 RSL_CMOD_CSD_NT_14k5
542#define RSL_CMOD_SP_NT_12k0 RSL_CMOD_CSD_NT_12k0
543#define RSL_CMOD_SP_NT_6k0 RSL_CMOD_CSD_NT_6k0
Oliver Smith341d9e12023-03-03 09:50:09 +0100544#define RSL_CMOD_CSD_T_32000 RSL_CMOD_CSD_T_32k0
545#define RSL_CMOD_CSD_T_29000 RSL_CMOD_CSD_T_29k0
546#define RSL_CMOD_CSD_T_14400 RSL_CMOD_CSD_T_14k4
547#define RSL_CMOD_CSD_T_9600 RSL_CMOD_CSD_T_9k6
548#define RSL_CMOD_CSD_T_4800 RSL_CMOD_CSD_T_4k8
549#define RSL_CMOD_CSD_T_2400 RSL_CMOD_CSD_T_2k4
550#define RSL_CMOD_CSD_T_1200 RSL_CMOD_CSD_T_1k2
Oliver Smith9d92c6e2023-03-01 09:53:16 +0100551/*! Transparent data */
552enum rsl_cmod_csd_t {
Oliver Smith341d9e12023-03-03 09:50:09 +0100553 RSL_CMOD_CSD_T_32k0 = 0x38,
554 RSL_CMOD_CSD_T_29k0 = 0x39,
555 RSL_CMOD_CSD_T_14k4 = 0x18,
556 RSL_CMOD_CSD_T_9k6 = 0x10,
557 RSL_CMOD_CSD_T_4k8 = 0x11,
558 RSL_CMOD_CSD_T_2k4 = 0x12,
559 RSL_CMOD_CSD_T_1k2 = 0x13,
Oliver Smith9d92c6e2023-03-01 09:53:16 +0100560 RSL_CMOD_CSD_T_600 = 0x14,
561 RSL_CMOD_CSD_T_1200_75 = 0x15,
562};
Harald Welteec8b4502010-02-20 20:34:29 +0100563
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200564/*! RSL Channel Identification IE (Chapter 9.3.5) */
Harald Welteec8b4502010-02-20 20:34:29 +0100565struct rsl_ie_chan_ident {
566 /* GSM 04.08 10.5.2.5 */
567 struct {
568 uint8_t iei;
569 uint8_t chan_nr; /* enc_chan_nr */
570 uint8_t oct3;
571 uint8_t oct4;
572 } chan_desc;
573#if 0 /* spec says we need this but Abissim doesn't use it */
574 struct {
575 uint8_t tag;
576 uint8_t len;
577 } mobile_alloc;
578#endif
579} __attribute__ ((packed));
580
581/* Chapter 9.3.22 */
582#define RLL_CAUSE_T200_EXPIRED 0x01
583#define RLL_CAUSE_REEST_REQ 0x02
584#define RLL_CAUSE_UNSOL_UA_RESP 0x03
585#define RLL_CAUSE_UNSOL_DM_RESP 0x04
586#define RLL_CAUSE_UNSOL_DM_RESP_MF 0x05
587#define RLL_CAUSE_UNSOL_SPRV_RESP 0x06
588#define RLL_CAUSE_SEQ_ERR 0x07
589#define RLL_CAUSE_UFRM_INC_PARAM 0x08
590#define RLL_CAUSE_SFRM_INC_PARAM 0x09
591#define RLL_CAUSE_IFRM_INC_MBITS 0x0a
592#define RLL_CAUSE_IFRM_INC_LEN 0x0b
593#define RLL_CAUSE_FRM_UNIMPL 0x0c
594#define RLL_CAUSE_SABM_MF 0x0d
595#define RLL_CAUSE_SABM_INFO_NOTALL 0x0e
596
597/* Chapter 9.3.26 */
598#define RSL_ERRCLS_NORMAL 0x00
599#define RSL_ERRCLS_RESOURCE_UNAVAIL 0x20
600#define RSL_ERRCLS_SERVICE_UNAVAIL 0x30
601#define RSL_ERRCLS_SERVICE_UNIMPL 0x40
602#define RSL_ERRCLS_INVAL_MSG 0x50
603#define RSL_ERRCLS_PROTO_ERROR 0x60
604#define RSL_ERRCLS_INTERWORKING 0x70
605
606/* normal event */
607#define RSL_ERR_RADIO_IF_FAIL 0x00
608#define RSL_ERR_RADIO_LINK_FAIL 0x01
609#define RSL_ERR_HANDOVER_ACC_FAIL 0x02
610#define RSL_ERR_TALKER_ACC_FAIL 0x03
611#define RSL_ERR_OM_INTERVENTION 0x07
612#define RSL_ERR_NORMAL_UNSPEC 0x0f
613#define RSL_ERR_T_MSRFPCI_EXP 0x18
614/* resource unavailable */
615#define RSL_ERR_EQUIPMENT_FAIL 0x20
616#define RSL_ERR_RR_UNAVAIL 0x21
617#define RSL_ERR_TERR_CH_FAIL 0x22
618#define RSL_ERR_CCCH_OVERLOAD 0x23
619#define RSL_ERR_ACCH_OVERLOAD 0x24
620#define RSL_ERR_PROCESSOR_OVERLOAD 0x25
Philipp Maier6d214482020-07-28 16:53:27 +0200621#define RSL_ERR_BTS_NOT_EQUIPPED 0x27
622#define RSL_ERR_REMOTE_TRANSC_FAIL 0x28
623#define RSL_ERR_NOTIFICATION_OVERFL 0x29
Harald Welteec8b4502010-02-20 20:34:29 +0100624#define RSL_ERR_RES_UNAVAIL 0x2f
625/* service or option not available */
626#define RSL_ERR_TRANSC_UNAVAIL 0x30
627#define RSL_ERR_SERV_OPT_UNAVAIL 0x3f
628/* service or option not implemented */
629#define RSL_ERR_ENCR_UNIMPL 0x40
630#define RSL_ERR_SERV_OPT_UNIMPL 0x4f
631/* invalid message */
632#define RSL_ERR_RCH_ALR_ACTV_ALLOC 0x50
633#define RSL_ERR_INVALID_MESSAGE 0x5f
634/* protocol error */
635#define RSL_ERR_MSG_DISCR 0x60
636#define RSL_ERR_MSG_TYPE 0x61
637#define RSL_ERR_MSG_SEQ 0x62
638#define RSL_ERR_IE_ERROR 0x63
639#define RSL_ERR_MAND_IE_ERROR 0x64
640#define RSL_ERR_OPT_IE_ERROR 0x65
641#define RSL_ERR_IE_NONEXIST 0x66
642#define RSL_ERR_IE_LENGTH 0x67
643#define RSL_ERR_IE_CONTENT 0x68
644#define RSL_ERR_PROTO 0x6f
645/* interworking */
646#define RSL_ERR_INTERWORKING 0x7f
647
648/* Chapter 9.3.30 */
649#define RSL_SYSTEM_INFO_8 0x00
650#define RSL_SYSTEM_INFO_1 0x01
651#define RSL_SYSTEM_INFO_2 0x02
652#define RSL_SYSTEM_INFO_3 0x03
653#define RSL_SYSTEM_INFO_4 0x04
654#define RSL_SYSTEM_INFO_5 0x05
655#define RSL_SYSTEM_INFO_6 0x06
656#define RSL_SYSTEM_INFO_7 0x07
657#define RSL_SYSTEM_INFO_16 0x08
658#define RSL_SYSTEM_INFO_17 0x09
659#define RSL_SYSTEM_INFO_2bis 0x0a
660#define RSL_SYSTEM_INFO_2ter 0x0b
661#define RSL_SYSTEM_INFO_5bis 0x0d
662#define RSL_SYSTEM_INFO_5ter 0x0e
663#define RSL_SYSTEM_INFO_10 0x0f
Harald Welte3d732272011-06-25 21:39:01 +0200664#define RSL_EXT_MEAS_ORDER 0x47
Harald Welteec8b4502010-02-20 20:34:29 +0100665#define RSL_MEAS_INFO 0x48
666#define RSL_SYSTEM_INFO_13 0x28
Philipp00b15392016-11-14 12:34:15 +0100667#define RSL_ERIC_SYSTEM_INFO_13 0x0C
Harald Welteec8b4502010-02-20 20:34:29 +0100668#define RSL_SYSTEM_INFO_2quater 0x29
669#define RSL_SYSTEM_INFO_9 0x2a
670#define RSL_SYSTEM_INFO_18 0x2b
671#define RSL_SYSTEM_INFO_19 0x2c
672#define RSL_SYSTEM_INFO_20 0x2d
673
674/* Chapter 9.3.40 */
675#define RSL_CHANNEED_ANY 0x00
676#define RSL_CHANNEED_SDCCH 0x01
677#define RSL_CHANNEED_TCH_F 0x02
678#define RSL_CHANNEED_TCH_ForH 0x03
679
Harald Welte8079a062023-05-08 12:05:47 +0200680/*! RSL Cell Broadcast Command (Chapter 9.3.41) */
Alex Badea84930182010-11-27 23:34:46 +0200681struct rsl_ie_cb_cmd_type {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100682#if OSMO_IS_LITTLE_ENDIAN
Alex Badea84930182010-11-27 23:34:46 +0200683 uint8_t last_block:2;
684 uint8_t spare:1;
685 uint8_t def_bcast:1;
686 uint8_t command:4;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100687#elif OSMO_IS_BIG_ENDIAN
Oliver Smith0b5c09b2023-02-17 10:35:38 +0100688/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100689 uint8_t command:4, def_bcast:1, spare:1, last_block:2;
690#endif
Alex Badea84930182010-11-27 23:34:46 +0200691} __attribute__ ((packed));
692/* ->command */
693#define RSL_CB_CMD_TYPE_NORMAL 0x00
694#define RSL_CB_CMD_TYPE_SCHEDULE 0x08
695#define RSL_CB_CMD_TYPE_DEFAULT 0x0e
696#define RSL_CB_CMD_TYPE_NULL 0x0f
697/* ->def_bcast */
698#define RSL_CB_CMD_DEFBCAST_NORMAL 0
699#define RSL_CB_CMD_DEFBCAST_NULL 1
700/* ->last_block */
701#define RSL_CB_CMD_LASTBLOCK_4 0
702#define RSL_CB_CMD_LASTBLOCK_1 1
703#define RSL_CB_CMD_LASTBLOCK_2 2
704#define RSL_CB_CMD_LASTBLOCK_3 3
705
Harald Welte1dffb532023-05-08 12:06:27 +0200706/*! NCH DRX Information (Chapter 9.3.47) */
707struct rsl_ie_nch_drx_info {
708#if OSMO_IS_LITTLE_ENDIAN
709 uint8_t nln:2;
710 uint8_t emlpp_priority:3;
711 uint8_t nln_status:1;
712 uint8_t spare:2;
713#elif OSMO_IS_BIG_ENDIAN
714/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
715 uint8_t spare:2, nln_status:1, emlpp_priority:3, nln:2;
716#endif
717} __attribute__ ((packed));
718
719/*! Command Indicator (Chapter 9.3.48) */
720#define RSL_CMD_INDICATOR_START 0x00
721#define RSL_CMD_INDICATOR_STOP 0x01
722
Harald Welteec8b4502010-02-20 20:34:29 +0100723/* Chapter 3.3.2.3 Brocast control channel */
724/* CCCH-CONF, NC is not combined */
725#define RSL_BCCH_CCCH_CONF_1_NC 0x00
726#define RSL_BCCH_CCCH_CONF_1_C 0x01
727#define RSL_BCCH_CCCH_CONF_2_NC 0x02
728#define RSL_BCCH_CCCH_CONF_3_NC 0x04
729#define RSL_BCCH_CCCH_CONF_4_NC 0x06
730
731/* BS-PA-MFRMS */
732#define RSL_BS_PA_MFRMS_2 0x00
733#define RSL_BS_PA_MFRMS_3 0x01
734#define RSL_BS_PA_MFRMS_4 0x02
735#define RSL_BS_PA_MFRMS_5 0x03
736#define RSL_BS_PA_MFRMS_6 0x04
737#define RSL_BS_PA_MFRMS_7 0x05
738#define RSL_BS_PA_MFRMS_8 0x06
739#define RSL_BS_PA_MFRMS_9 0x07
740
741/* RSL_IE_IPAC_RTP_PAYLOAD[2] */
742enum rsl_ipac_rtp_payload {
743 RSL_IPAC_RTP_GSM = 1,
744 RSL_IPAC_RTP_EFR,
745 RSL_IPAC_RTP_AMR,
746 RSL_IPAC_RTP_CSD,
747 RSL_IPAC_RTP_MUX,
748};
749
750/* RSL_IE_IPAC_SPEECH_MODE, lower four bits */
751enum rsl_ipac_speech_mode_s {
752 RSL_IPAC_SPEECH_GSM_FR = 0, /* GSM FR (Type 1, FS) */
753 RSL_IPAC_SPEECH_GSM_EFR = 1, /* GSM EFR (Type 2, FS) */
754 RSL_IPAC_SPEECH_GSM_AMR_FR = 2, /* GSM AMR/FR (Type 3, FS) */
755 RSL_IPAC_SPEECH_GSM_HR = 3, /* GSM HR (Type 1, HS) */
756 RSL_IPAC_SPEECH_GSM_AMR_HR = 5, /* GSM AMR/hr (Type 3, HS) */
757 RSL_IPAC_SPEECH_AS_RTP = 0xf, /* As specified by RTP Payload IE */
758};
759/* RSL_IE_IPAC_SPEECH_MODE, upper four bits */
760enum rsl_ipac_speech_mode_m {
761 RSL_IPAC_SPEECH_M_RXTX = 0, /* Send and Receive */
762 RSL_IPAC_SPEECH_M_RX = 1, /* Receive only */
763 RSL_IPAC_SPEECH_M_TX = 2, /* Send only */
764};
765
766/* RSL_IE_IPAC_RTP_CSD_FMT, lower four bits */
767enum rsl_ipac_rtp_csd_format_d {
Harald Weltea41bd222023-03-06 18:06:18 +0100768 RSL_IPAC_RTP_CSD_EXT_TRAU = 0, /*!< TRAU-like RTP format, without leading zero-bits */
769 RSL_IPAC_RTP_CSD_NON_TRAU = 1, /*!< packed 16k (252/288 bit) / 8k (126 bit) in RTP */
770 RSL_IPAC_RTP_CSD_TRAU_BTS = 2, /*!< TRAU in BTS; V.110 in RTP/CLEARMODE */
771 RSL_IPAC_RTP_CSD_IWF_FREE = 3, /*!< unknown proprietary IWF-free BTS-BTS data */
Harald Welteec8b4502010-02-20 20:34:29 +0100772};
773/* RSL_IE_IPAC_RTP_CSD_FMT, upper four bits */
774enum rsl_ipac_rtp_csd_format_ir {
775 RSL_IPAC_RTP_CSD_IR_8k = 0,
776 RSL_IPAC_RTP_CSD_IR_16k = 1,
777 RSL_IPAC_RTP_CSD_IR_32k = 2,
778 RSL_IPAC_RTP_CSD_IR_64k = 3,
779};
780
781/* Siemens vendor-specific RSL extensions */
782struct rsl_mrpci {
783 uint8_t power_class:3,
784 vgcs_capable:1,
785 vbs_capable:1,
786 gsm_phase:2;
787} __attribute__ ((packed));
788
789enum rsl_mrpci_pwrclass {
790 RSL_MRPCI_PWRC_1 = 0,
791 RSL_MRPCI_PWRC_2 = 1,
792 RSL_MRPCI_PWRC_3 = 2,
793 RSL_MRPCI_PWRC_4 = 3,
794 RSL_MRPCI_PWRC_5 = 4,
795};
796enum rsl_mrpci_phase {
797 RSL_MRPCI_PHASE_1 = 0,
798 /* reserved */
799 RSL_MRPCI_PHASE_2 = 2,
800 RSL_MRPCI_PHASE_2PLUS = 3,
801};
802
Holger Hans Peter Freyther0357e9b2012-12-06 11:57:31 +0100803/* 9.3.20 Release Mode */
804enum rsl_rel_mode {
805 RSL_REL_NORMAL = 0,
806 RSL_REL_LOCAL_END = 1,
807};
808
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200809/*! ip.access specific embedded information elements */
Harald Weltefad57522015-12-13 11:56:36 +0100810enum rsl_ipac_embedded_ie {
811 RSL_IPAC_EIE_RXLEV = 0x00,
812 RSL_IPAC_EIE_RXQUAL = 0x01,
813 RSL_IPAC_EIE_FREQ_ERR = 0x02,
814 RSL_IPAC_EIE_TIMING_ERR = 0x03,
815 RSL_IPAC_EIE_MEAS_AVG_CFG = 0x04,
816 RSL_IPAC_EIE_BS_PWR_CTL = 0x05,
817 RSL_IPAC_EIE_MS_PWR_CTL = 0x06,
818 RSL_IPAC_EIE_HANDO_THRESH = 0x07,
819 RSL_IPAC_EIE_NCELL_DEFAULTS = 0x08,
820 RSL_IPAC_EIE_NCELL_LIST = 0x09,
821 RSL_IPAC_EIE_PC_THRESH_COMP = 0x0a,
822 RSL_IPAC_EIE_HO_THRESH_COMP = 0x0b,
823 RSL_IPAC_EIE_HO_CAUSE = 0x0c,
824 RSL_IPAC_EIE_HO_CANDIDATES = 0x0d,
825 RSL_IPAC_EIE_NCELL_BA_CHG_LIST = 0x0e,
826 RSL_IPAC_EIE_NUM_OF_MS = 0x10,
827 RSL_IPAC_EIE_HO_CAND_EXT = 0x11,
828 RSL_IPAC_EIE_NCELL_DEF_EXT = 0x12,
829 RSL_IPAC_EIE_NCELL_LIST_EXT = 0x13,
830 RSL_IPAC_EIE_MASTER_KEY = 0x14,
831 RSL_IPAC_EIE_MASTER_SALT = 0x15,
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400832 /* additional IPAC measurement pre-processing related IEI */
833 RSL_IPAC_EIE_MEAS_TRANS_RES = 0x16,
834 RSL_IPAC_EIE_3G_HO_PARAM = 0x17,
835 RSL_IPAC_EIE_3G_NCELL_LIST = 0x18,
836 RSL_IPAC_EIE_SDCCH_CTL_PARAM = 0x1a,
837 RSL_IPAC_EIE_AMR_CONV_THRESH = 0x1b,
838
Pau Espin Pedrol51933842021-08-30 13:50:56 +0200839 /* Osmocom specific extensions: */
840 RSL_IPAC_EIE_OSMO_MEAS_AVG_CFG = 0xf0,
841 RSL_IPAC_EIE_OSMO_MS_PWR_CTL = 0xf1,
842 RSL_IPAC_EIE_OSMO_PC_THRESH_COMP = 0xf2,
843
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400844};
845
Pau Espin Pedrol51933842021-08-30 13:50:56 +0200846/* Value of TLV IE RSL_IPAC_EIE_MEAS_AVG_CFG */
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400847struct ipac_preproc_ave_cfg {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100848#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400849 uint8_t h_reqave:5,
850 param_id:2,
851 reserved:1;
852 uint8_t h_reqt:5,
853 ave_method:3;
Vadim Yanitskiy8f5844e2020-12-25 00:19:45 +0100854 uint8_t params[0];
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100855#elif OSMO_IS_BIG_ENDIAN
Oliver Smith0b5c09b2023-02-17 10:35:38 +0100856/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100857 uint8_t reserved:1, param_id:2, h_reqave:5;
858 uint8_t ave_method:3, h_reqt:5;
Vadim Yanitskiy8f5844e2020-12-25 00:19:45 +0100859 uint8_t params[0];
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100860#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400861}__attribute__ ((packed));
862
Pau Espin Pedrol51933842021-08-30 13:50:56 +0200863
864struct osmo_preproc_ave_cfg_field {
865#if OSMO_IS_LITTLE_ENDIAN
866 uint8_t h_reqave:5,
867 ave_enabled:1,
868 reserved:2;
869 uint8_t h_reqt:5,
870 ave_method:3;
871#elif OSMO_IS_BIG_ENDIAN
Oliver Smith0b5c09b2023-02-17 10:35:38 +0100872/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
Pau Espin Pedrol51933842021-08-30 13:50:56 +0200873 uint8_t reserved:2, ave_enabled:1, h_reqave:5;
874 uint8_t ave_method:3, h_reqt:5;
875#endif
876}__attribute__ ((packed));
877/* Value of TLV IE RSL_IPAC_EIE_OSMO_MEAS_AVG_CFG: */
878struct osmo_preproc_ave_cfg {
879 struct osmo_preproc_ave_cfg_field ci_fr;
880 struct osmo_preproc_ave_cfg_field ci_hr;
881 struct osmo_preproc_ave_cfg_field ci_amr_fr;
882 struct osmo_preproc_ave_cfg_field ci_amr_hr;
883 struct osmo_preproc_ave_cfg_field ci_sdcch;
884 struct osmo_preproc_ave_cfg_field ci_gprs;
885 uint8_t params[0]; /* Contains params for each above, appended one after the other */
886}__attribute__ ((packed));
887
888/*! MS/BS Power Control Thresholds (RSL_IPAC_EIE_MS_PWR_CTL) */
Vadim Yanitskiya346c452020-12-15 07:48:58 +0100889struct ipac_preproc_pc_thresh {
890#if OSMO_IS_LITTLE_ENDIAN
891 uint8_t l_rxlev:6, reserved_l_rxlev:2;
892 uint8_t u_rxlev:6, reserved_u_rxlev:2;
Vadim Yanitskiy2060bbb2020-12-19 17:33:41 +0100893 uint8_t u_rxqual:3, reserved_u_rxqual:1,
894 l_rxqual:3, reserved_l_rxqual:1;
Vadim Yanitskiya346c452020-12-15 07:48:58 +0100895#elif OSMO_IS_BIG_ENDIAN
Oliver Smith0b5c09b2023-02-17 10:35:38 +0100896/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
Vadim Yanitskiya346c452020-12-15 07:48:58 +0100897 uint8_t reserved_l_rxlev:2, l_rxlev:6;
898 uint8_t reserved_u_rxlev:2, u_rxlev:6;
Pau Espin Pedrol28c43882021-12-22 13:56:42 +0100899 uint8_t reserved_l_rxqual:1, l_rxqual:3, reserved_u_rxqual:1, u_rxqual:3;
Vadim Yanitskiya346c452020-12-15 07:48:58 +0100900#endif
901}__attribute__ ((packed));
902
Pau Espin Pedrol51933842021-08-30 13:50:56 +0200903/*! Osmocom extension for: MS/BS Power Control Thresholds (RSL_IPAC_EIE_OSMO_MS_PWR_CTL) */
904struct osmo_preproc_pc_thresh {
905 /* Carrier-to-Interference (C/I), in dB: */
906 int8_t l_ci_fr; int8_t u_ci_fr; /* FR/EFR */
907 int8_t l_ci_hr; int8_t u_ci_hr; /* HR */
908 int8_t l_ci_amr_fr; int8_t u_ci_amr_fr; /* AMR FR */
909 int8_t l_ci_amr_hr; int8_t u_ci_amr_hr; /* AMR HR */
910 int8_t l_ci_sdcch; int8_t u_ci_sdcch; /* SDCCH */
911 int8_t l_ci_gprs; int8_t u_ci_gprs; /* GPRS */
912}__attribute__ ((packed));
913
Vadim Yanitskiya346c452020-12-15 07:48:58 +0100914/*! Handover Thresholds */
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400915struct ipac_preproc_ho_thresh {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100916#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400917 uint8_t l_rxlev_ul_h:6,
918 reserved_l_rxlev_ul:2;
919 uint8_t l_rxlev_dl_h:6,
920 reserved_l_rxlev_dl:2;
921 uint8_t rxlev_ul_ih:6,
922 reserved_rxlev_ul:2;
923 uint8_t rxlev_dl_ih:6,
924 reserved_rxlev_dl:2;
925 uint8_t l_rxqual_ul_h:3,
926 reserved_rxlqual_ul:1,
927 l_rxqual_dl_h:3,
928 reserved_rxqual_dl:1;
929 uint8_t ms_range_max:6,
930 reserved_ms_range:2;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100931#elif OSMO_IS_BIG_ENDIAN
Oliver Smith0b5c09b2023-02-17 10:35:38 +0100932/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100933 uint8_t reserved_l_rxlev_ul:2, l_rxlev_ul_h:6;
934 uint8_t reserved_l_rxlev_dl:2, l_rxlev_dl_h:6;
935 uint8_t reserved_rxlev_ul:2, rxlev_ul_ih:6;
936 uint8_t reserved_rxlev_dl:2, rxlev_dl_ih:6;
937 uint8_t reserved_rxqual_dl:1, l_rxqual_dl_h:3, reserved_rxlqual_ul:1, l_rxqual_ul_h:3;
938 uint8_t reserved_ms_range:2, ms_range_max:6;
939#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400940}__attribute__ ((packed));
941
Pau Espin Pedrol51933842021-08-30 13:50:56 +0200942/*! PC Threshold Comparators (RSL_IPAC_EIE_PC_THRESH_COMP) */
Vadim Yanitskiya346c452020-12-15 07:48:58 +0100943struct ipac_preproc_pc_comp {
944#if OSMO_IS_LITTLE_ENDIAN
945 uint8_t p1:5, reserved_p1:3;
946 uint8_t n1:5, reserved_n1:3;
947 uint8_t p2:5, reserved_p2:3;
948 uint8_t n2:5, reserved_n2:3;
949 uint8_t p3:5, reserved_p3:3;
950 uint8_t n3:5, reserved_n3:3;
951 uint8_t p4:5, reserved_p4:3;
952 uint8_t n4:5, reserved_n4:3;
953 uint8_t pc_interval:5, reserved_pc:3;
954 uint8_t red_step_size:4, inc_step_size:4;
955#elif OSMO_IS_BIG_ENDIAN
Oliver Smith0b5c09b2023-02-17 10:35:38 +0100956/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
Vadim Yanitskiya346c452020-12-15 07:48:58 +0100957 uint8_t reserved_p1:3, p1:5;
958 uint8_t reserved_n1:3, n1:5;
959 uint8_t reserved_p2:3, p2:5;
960 uint8_t reserved_n2:3, n2:5;
961 uint8_t reserved_p3:3, p3:5;
962 uint8_t reserved_n3:3, n3:5;
963 uint8_t reserved_p4:3, p4:5;
964 uint8_t reserved_n4:3, n4:5;
965 uint8_t reserved_pc:3, pc_interval:5;
966 uint8_t inc_step_size:4, red_step_size:4;
967#endif
968}__attribute__ ((packed));
969
Pau Espin Pedrol51933842021-08-30 13:50:56 +0200970/*! Osmocom extension for: PC Threshold Comparators (RSL_IPAC_EIE_OSMO_PC_THRESH_COMP) */
971struct ipac_preproc_pc_comp_field {
972#if OSMO_IS_LITTLE_ENDIAN
973 uint8_t lower_p:5, reserved_lower_p:3;
974 uint8_t lower_n:5, reserved_lower_n:3;
975 uint8_t upper_p:5, reserved_upper_p:3;
976 uint8_t upper_n:5, reserved_upper_n:3;
977#elif OSMO_IS_BIG_ENDIAN
Oliver Smith0b5c09b2023-02-17 10:35:38 +0100978/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
Pau Espin Pedrol51933842021-08-30 13:50:56 +0200979 uint8_t reserved_lower_p:3, lower_p:5;
980 uint8_t reserved_lower_n:3, lower_n:5;
981 uint8_t reserved_upper_p:3, upper_p:5;
982 uint8_t reserved_upper_n:3, upper_n:5;
Pau Espin Pedrol28c43882021-12-22 13:56:42 +0100983#endif
Pau Espin Pedrol51933842021-08-30 13:50:56 +0200984}__attribute__ ((packed));
985struct osmo_preproc_pc_comp {
986 /* Used for Carrier-to-Interference (C/I), in dB: */
987 struct ipac_preproc_pc_comp_field ci_fr;
988 struct ipac_preproc_pc_comp_field ci_hr;
989 struct ipac_preproc_pc_comp_field ci_amr_fr;
990 struct ipac_preproc_pc_comp_field ci_amr_hr;
991 struct ipac_preproc_pc_comp_field ci_sdcch;
992 struct ipac_preproc_pc_comp_field ci_gprs;
993}__attribute__ ((packed));
994
Vadim Yanitskiya346c452020-12-15 07:48:58 +0100995/*! HO Threshold Comparators */
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400996struct ipac_preproc_ho_comp {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100997#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400998 uint8_t p5:5,
999 reserved_p5:3;
1000 uint8_t n5:5,
1001 reserved_n5:3;
1002 uint8_t p6:5,
1003 reserved_p6:3;
1004 uint8_t n6:5,
1005 reserved_n6:3;
1006 uint8_t p7:5,
1007 reserved_p7:3;
1008 uint8_t n7:5,
1009 reserved_n7:3;
1010 uint8_t p8:5,
1011 reserved_p8:3;
1012 uint8_t n8:5,
1013 reserved_n8:3;
1014 uint8_t ho_interval:5,
1015 reserved_ho:3;
1016 uint8_t reserved;
1017
Neels Hofmeyrb2600392018-11-16 00:20:39 +01001018#elif OSMO_IS_BIG_ENDIAN
Oliver Smith0b5c09b2023-02-17 10:35:38 +01001019/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
Neels Hofmeyrb2600392018-11-16 00:20:39 +01001020 uint8_t reserved_p5:3, p5:5;
1021 uint8_t reserved_n5:3, n5:5;
1022 uint8_t reserved_p6:3, p6:5;
1023 uint8_t reserved_n6:3, n6:5;
1024 uint8_t reserved_p7:3, p7:5;
1025 uint8_t reserved_n7:3, n7:5;
1026 uint8_t reserved_p8:3, p8:5;
1027 uint8_t reserved_n8:3, n8:5;
1028 uint8_t reserved_ho:3, ho_interval:5;
1029 uint8_t reserved;
1030#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -04001031}__attribute__ ((packed));
1032
1033struct ipac_preproc_ho_candidates {
Neels Hofmeyrb2600392018-11-16 00:20:39 +01001034#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -04001035 uint8_t bsic:6,
1036 reserved0:2;
1037 uint8_t bcch_freq:5,
1038 ba_used:1,
1039 s:1,
1040 reserved1:1;
Neels Hofmeyrb2600392018-11-16 00:20:39 +01001041#elif OSMO_IS_BIG_ENDIAN
Oliver Smith0b5c09b2023-02-17 10:35:38 +01001042/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
Neels Hofmeyrb2600392018-11-16 00:20:39 +01001043 uint8_t reserved0:2, bsic:6;
1044 uint8_t reserved1:1, s:1, ba_used:1, bcch_freq:5;
1045#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -04001046}__attribute__ ((packed));
1047
1048struct ipac_preproc_ncell_dflts {
Neels Hofmeyrb2600392018-11-16 00:20:39 +01001049#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -04001050 uint8_t rxlev_min_def:6,
1051 reserved_rxlev_min_def:2;
1052 uint8_t ho_margin_def:5,
1053 reserved_ho_margin_def:3;
1054 uint8_t ms_txpwr_max_def:5,
1055 reserved_ms_txpwr_max_def:3;
Neels Hofmeyrb2600392018-11-16 00:20:39 +01001056#elif OSMO_IS_BIG_ENDIAN
Oliver Smith0b5c09b2023-02-17 10:35:38 +01001057/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
Neels Hofmeyrb2600392018-11-16 00:20:39 +01001058 uint8_t reserved_rxlev_min_def:2, rxlev_min_def:6;
1059 uint8_t reserved_ho_margin_def:3, ho_margin_def:5;
1060 uint8_t reserved_ms_txpwr_max_def:3, ms_txpwr_max_def:5;
1061#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -04001062}__attribute__ ((packed));
1063
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -05001064struct ipac_preproc_ho_ctl_param {
Neels Hofmeyrb2600392018-11-16 00:20:39 +01001065#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -05001066 uint8_t sdcch_ho_gsm:1,
1067 sdcch_ho_umts:1,
1068 reserved:6;
Neels Hofmeyrb2600392018-11-16 00:20:39 +01001069#elif OSMO_IS_BIG_ENDIAN
Oliver Smith0b5c09b2023-02-17 10:35:38 +01001070/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
Neels Hofmeyrb2600392018-11-16 00:20:39 +01001071 uint8_t reserved:6, sdcch_ho_umts:1, sdcch_ho_gsm:1;
1072#endif
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -05001073}__attribute__ ((packed));
1074
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -04001075struct ipac_preproc_cfg {
1076 uint8_t meas_rep_mode;
1077 uint32_t meas_mode_flags;
1078 struct ipac_preproc_ave_cfg ms_ave_cfg[3];
1079 struct ipac_preproc_ave_cfg ave_cfg;
1080 struct ipac_preproc_ho_thresh ho_thresh;
1081 struct ipac_preproc_ho_comp ho_comp;
1082 struct ipac_preproc_ncell_dflts ncell_dflts;
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -05001083 struct ipac_preproc_ho_ctl_param ho_ctl_param;
Harald Weltefad57522015-12-13 11:56:36 +01001084};
1085
Philipp Maierca770ae2021-02-16 17:31:22 +01001086struct rsl_l1_info {
Pau Espin Pedrol28c43882021-12-22 13:56:42 +01001087#if OSMO_IS_LITTLE_ENDIAN
Philipp Maierca770ae2021-02-16 17:31:22 +01001088 uint8_t reserved:1,
1089 srr_sro:1,
1090 fpc_epc:1,
1091 ms_pwr:5;
1092 uint8_t ta;
Pau Espin Pedrol28c43882021-12-22 13:56:42 +01001093#elif OSMO_IS_BIG_ENDIAN
Oliver Smith0b5c09b2023-02-17 10:35:38 +01001094/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */
Pau Espin Pedrol28c43882021-12-22 13:56:42 +01001095 uint8_t ms_pwr:5, fpc_epc:1, srr_sro:1, reserved:1;
1096 uint8_t ta;
Philipp Maierca770ae2021-02-16 17:31:22 +01001097#endif
1098} __attribute__ ((packed));
1099
Sylvain Munautdca7d2c2012-04-18 21:53:23 +02001100/*! @} */