blob: 95da23a48400f17209174c63257d45091498a9ca [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
Pau Espin Pedrol42908032018-10-10 17:04:28 +020056/* Link Identifier 9.3.2 */
57union abis_rsl_link_id {
58#if OSMO_IS_BIG_ENDIAN
59 uint8_t cbits:2,
60 na:1,
Martin Haukee63b8872018-11-15 14:53:13 +010061 reserved:2,
Pau Espin Pedrol42908032018-10-10 17:04:28 +020062 sapi:3;
63#elif OSMO_IS_LITTLE_ENDIAN
64 uint8_t sapi:3,
65 reserved:2,
66 na:1,
67 cbits:2;
68#endif
69 uint8_t link_id;
70} __attribute__ ((packed));
71#define ABIS_RSL_LINK_ID_CBITS_FACCH_SDCCH 0x00
72#define ABIS_RSL_LINK_ID_CBITS_SACCH 0x01
73
Neels Hofmeyr87e45502017-06-20 00:17:59 +020074/*! RSL common header */
Harald Welteec8b4502010-02-20 20:34:29 +010075struct abis_rsl_common_hdr {
Neels Hofmeyr87e45502017-06-20 00:17:59 +020076 uint8_t msg_discr; /*!< message discriminator (ABIS_RSL_MDISC_*) */
77 uint8_t msg_type; /*!< message type (\ref abis_rsl_msgtype) */
78 uint8_t data[0]; /*!< actual payload data */
Harald Welteec8b4502010-02-20 20:34:29 +010079} __attribute__ ((packed));
80
Neels Hofmeyr87e45502017-06-20 00:17:59 +020081/* RSL RLL header (Chapter 8.3) */
Harald Welteec8b4502010-02-20 20:34:29 +010082struct abis_rsl_rll_hdr {
83 struct abis_rsl_common_hdr c;
Neels Hofmeyr87e45502017-06-20 00:17:59 +020084 uint8_t ie_chan; /*!< \ref RSL_IE_CHAN_NR (tag) */
Pau Espin Pedrolfb97e722018-10-10 20:41:40 +020085 union {
86 uint8_t chan_nr; /* API backward compat */
87 union abis_rsl_chan_nr chan_nr_fields; /*!< RSL channel number (value) */
88 };
Neels Hofmeyr87e45502017-06-20 00:17:59 +020089 uint8_t ie_link_id; /*!< \ref RSL_IE_LINK_IDENT (tag) */
Pau Espin Pedrol42908032018-10-10 17:04:28 +020090 union {
91 uint8_t link_id; /* API backward compat */
92 union abis_rsl_link_id link_id_fields; /*!< RSL link identifier (value) */
93 };
Neels Hofmeyr87e45502017-06-20 00:17:59 +020094 uint8_t data[0]; /*!< message payload data */
Harald Welteec8b4502010-02-20 20:34:29 +010095} __attribute__ ((packed));
96
Neels Hofmeyr87e45502017-06-20 00:17:59 +020097/* RSL Dedicated Channel header (Chapter 8.3 and 8.4) */
Harald Welteec8b4502010-02-20 20:34:29 +010098struct abis_rsl_dchan_hdr {
99 struct abis_rsl_common_hdr c;
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200100 uint8_t ie_chan; /*!< \ref RSL_IE_CHAN_NR (tag) */
Pau Espin Pedrolfb97e722018-10-10 20:41:40 +0200101 union {
102 uint8_t chan_nr; /* API backward compat */
103 union abis_rsl_chan_nr chan_nr_fields; /*!< RSL channel number (value) */
104 };
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200105 uint8_t data[0]; /*!< message payload data */
Harald Welteec8b4502010-02-20 20:34:29 +0100106} __attribute__ ((packed));
107
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200108/* RSL Common Channel header (Chapter 8.5) */
Harald Welte6eb7d6c2010-07-13 13:48:13 +0200109struct abis_rsl_cchan_hdr {
110 struct abis_rsl_common_hdr c;
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200111 uint8_t ie_chan; /*!< \ref RSL_IE_CHAN_NR (tag) */
Pau Espin Pedrolfb97e722018-10-10 20:41:40 +0200112 union {
113 uint8_t chan_nr; /* API backward compat */
114 union abis_rsl_chan_nr chan_nr_fields; /*!< RSL channel number (value) */
115 };
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200116 uint8_t data[0]; /*!< message payload data */
Harald Welte6eb7d6c2010-07-13 13:48:13 +0200117} __attribute__ ((packed));
118
Harald Welteec8b4502010-02-20 20:34:29 +0100119
120/* Chapter 9.1 */
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200121/* RSL Message Discriminator: RLL */
Harald Welteec8b4502010-02-20 20:34:29 +0100122#define ABIS_RSL_MDISC_RLL 0x02
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200123/* RSL Message Discriminator: Dedicated Channel */
Harald Welteec8b4502010-02-20 20:34:29 +0100124#define ABIS_RSL_MDISC_DED_CHAN 0x08
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200125/* RSL Message Discriminator: Common Channel */
Harald Welteec8b4502010-02-20 20:34:29 +0100126#define ABIS_RSL_MDISC_COM_CHAN 0x0c
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200127/* RSL Message Discriminator: TRX Management */
Harald Welteec8b4502010-02-20 20:34:29 +0100128#define ABIS_RSL_MDISC_TRX 0x10
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200129/* RSL Message Discriminator: Location Service */
Harald Welteec8b4502010-02-20 20:34:29 +0100130#define ABIS_RSL_MDISC_LOC 0x20
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200131/* RSL Message Discriminator: ip.access */
Harald Welteec8b4502010-02-20 20:34:29 +0100132#define ABIS_RSL_MDISC_IPACCESS 0x7e
133#define ABIS_RSL_MDISC_TRANSP 0x01
134
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200135/* Check if given RSL message discriminator is transparent */
Harald Welteec8b4502010-02-20 20:34:29 +0100136#define ABIS_RSL_MDISC_IS_TRANSP(x) (x & 0x01)
137
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200138/* RSL Message Type (Chapter 9.1) */
Harald Welteec8b4502010-02-20 20:34:29 +0100139enum abis_rsl_msgtype {
140 /* Radio Link Layer Management */
141 RSL_MT_DATA_REQ = 0x01,
142 RSL_MT_DATA_IND,
143 RSL_MT_ERROR_IND,
144 RSL_MT_EST_REQ,
145 RSL_MT_EST_CONF,
146 RSL_MT_EST_IND,
147 RSL_MT_REL_REQ,
148 RSL_MT_REL_CONF,
149 RSL_MT_REL_IND,
150 RSL_MT_UNIT_DATA_REQ,
151 RSL_MT_UNIT_DATA_IND, /* 0x0b */
Andreas Eversberg816e24c2010-06-25 02:50:56 +0200152 RSL_MT_SUSP_REQ, /* non-standard elements */
153 RSL_MT_SUSP_CONF,
154 RSL_MT_RES_REQ,
155 RSL_MT_RECON_REQ, /* 0x0f */
Harald Welteec8b4502010-02-20 20:34:29 +0100156
157 /* Common Channel Management / TRX Management */
158 RSL_MT_BCCH_INFO = 0x11,
159 RSL_MT_CCCH_LOAD_IND,
160 RSL_MT_CHAN_RQD,
161 RSL_MT_DELETE_IND,
162 RSL_MT_PAGING_CMD,
163 RSL_MT_IMMEDIATE_ASSIGN_CMD,
164 RSL_MT_SMS_BC_REQ,
Harald Welte6eb7d6c2010-07-13 13:48:13 +0200165 RSL_MT_CHAN_CONF, /* non-standard element */
Harald Welteec8b4502010-02-20 20:34:29 +0100166 /* empty */
167 RSL_MT_RF_RES_IND = 0x19,
168 RSL_MT_SACCH_FILL,
169 RSL_MT_OVERLOAD,
170 RSL_MT_ERROR_REPORT,
171 RSL_MT_SMS_BC_CMD,
172 RSL_MT_CBCH_LOAD_IND,
173 RSL_MT_NOT_CMD, /* 0x1f */
174
175 /* Dedicate Channel Management */
176 RSL_MT_CHAN_ACTIV = 0x21,
177 RSL_MT_CHAN_ACTIV_ACK,
178 RSL_MT_CHAN_ACTIV_NACK,
179 RSL_MT_CONN_FAIL,
180 RSL_MT_DEACTIVATE_SACCH,
181 RSL_MT_ENCR_CMD,
182 RSL_MT_HANDO_DET,
183 RSL_MT_MEAS_RES,
184 RSL_MT_MODE_MODIFY_REQ,
185 RSL_MT_MODE_MODIFY_ACK,
186 RSL_MT_MODE_MODIFY_NACK,
187 RSL_MT_PHY_CONTEXT_REQ,
188 RSL_MT_PHY_CONTEXT_CONF,
189 RSL_MT_RF_CHAN_REL,
190 RSL_MT_MS_POWER_CONTROL,
191 RSL_MT_BS_POWER_CONTROL, /* 0x30 */
192 RSL_MT_PREPROC_CONFIG,
193 RSL_MT_PREPROC_MEAS_RES,
194 RSL_MT_RF_CHAN_REL_ACK,
195 RSL_MT_SACCH_INFO_MODIFY,
196 RSL_MT_TALKER_DET,
197 RSL_MT_LISTENER_DET,
198 RSL_MT_REMOTE_CODEC_CONF_REP,
199 RSL_MT_RTD_REP,
200 RSL_MT_PRE_HANDO_NOTIF,
201 RSL_MT_MR_CODEC_MOD_REQ,
202 RSL_MT_MR_CODEC_MOD_ACK,
203 RSL_MT_MR_CODEC_MOD_NACK,
204 RSL_MT_MR_CODEC_MOD_PER,
205 RSL_MT_TFO_REP,
206 RSL_MT_TFO_MOD_REQ, /* 0x3f */
207 RSL_MT_LOCATION_INFO = 0x41,
208
209 /* ip.access specific RSL message types */
210 RSL_MT_IPAC_DIR_RETR_ENQ = 0x40,
211 RSL_MT_IPAC_PDCH_ACT = 0x48,
212 RSL_MT_IPAC_PDCH_ACT_ACK,
213 RSL_MT_IPAC_PDCH_ACT_NACK,
214 RSL_MT_IPAC_PDCH_DEACT = 0x4b,
215 RSL_MT_IPAC_PDCH_DEACT_ACK,
216 RSL_MT_IPAC_PDCH_DEACT_NACK,
217 RSL_MT_IPAC_CONNECT_MUX = 0x50,
218 RSL_MT_IPAC_CONNECT_MUX_ACK,
219 RSL_MT_IPAC_CONNECT_MUX_NACK,
220 RSL_MT_IPAC_BIND_MUX = 0x53,
221 RSL_MT_IPAC_BIND_MUX_ACK,
222 RSL_MT_IPAC_BIND_MUX_NACK,
223 RSL_MT_IPAC_DISC_MUX = 0x56,
224 RSL_MT_IPAC_DISC_MUX_ACK,
225 RSL_MT_IPAC_DISC_MUX_NACK,
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400226 RSL_MT_IPAC_MEAS_PREPROC_DFT = 0x60, /*Extented Common Channel Management */
227 RSL_MT_IPAC_HO_CAN_ENQ = 0x61,
228 RSL_MT_IPAC_HO_CAN_RES = 0x62,
Harald Welteec8b4502010-02-20 20:34:29 +0100229 RSL_MT_IPAC_CRCX = 0x70, /* Bind to local BTS RTP port */
230 RSL_MT_IPAC_CRCX_ACK,
231 RSL_MT_IPAC_CRCX_NACK,
232 RSL_MT_IPAC_MDCX = 0x73,
233 RSL_MT_IPAC_MDCX_ACK,
234 RSL_MT_IPAC_MDCX_NACK,
235 RSL_MT_IPAC_DLCX_IND = 0x76,
236 RSL_MT_IPAC_DLCX = 0x77,
237 RSL_MT_IPAC_DLCX_ACK,
238 RSL_MT_IPAC_DLCX_NACK,
Harald Weltef9456892019-09-03 13:56:00 +0200239
240 RSL_MT_OSMO_ETWS_CMD = 0x7f,
Harald Welteec8b4502010-02-20 20:34:29 +0100241};
242
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200243/*! Siemens vendor-specific RSL message types */
Harald Welteec8b4502010-02-20 20:34:29 +0100244enum abis_rsl_msgtype_siemens {
245 RSL_MT_SIEMENS_MRPCI = 0x41,
246 RSL_MT_SIEMENS_INTRAC_HO_COND_IND = 0x42,
247 RSL_MT_SIEMENS_INTERC_HO_COND_IND = 0x43,
248 RSL_MT_SIEMENS_FORCED_HO_REQ = 0x44,
249 RSL_MT_SIEMENS_PREF_AREA_REQ = 0x45,
250 RSL_MT_SIEMENS_PREF_AREA = 0x46,
251 RSL_MT_SIEMENS_START_TRACE = 0x47,
252 RSL_MT_SIEMENS_START_TRACE_ACK = 0x48,
253 RSL_MT_SIEMENS_STOP_TRACE = 0x49,
254 RSL_MT_SIEMENS_TRMR = 0x4a,
255 RSL_MT_SIEMENS_HO_FAIL_IND = 0x4b,
256 RSL_MT_SIEMENS_STOP_TRACE_ACK = 0x4c,
257 RSL_MT_SIEMENS_UPLF = 0x4d,
258 RSL_MT_SIEMENS_UPLB = 0x4e,
259 RSL_MT_SIEMENS_SET_SYS_INFO_10 = 0x4f,
260 RSL_MT_SIEMENS_MODIF_COND_IND = 0x50,
261};
262
Pau Espin Pedrol95959a82018-04-21 22:47:54 +0200263/*! Ericsson vendor-specific RSL message types */
264enum abis_rsl_msgtype_ericsson {
265 RSL_MT_ERICSSON_IMM_ASS_SENT = 0x10,
266};
267
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200268/*! RSL Information Element Identifiers (Chapter 9.3) */
Harald Welteec8b4502010-02-20 20:34:29 +0100269enum abis_rsl_ie {
270 RSL_IE_CHAN_NR = 0x01,
271 RSL_IE_LINK_IDENT,
272 RSL_IE_ACT_TYPE,
273 RSL_IE_BS_POWER,
274 RSL_IE_CHAN_IDENT,
275 RSL_IE_CHAN_MODE,
276 RSL_IE_ENCR_INFO,
277 RSL_IE_FRAME_NUMBER,
278 RSL_IE_HANDO_REF,
279 RSL_IE_L1_INFO,
280 RSL_IE_L3_INFO,
281 RSL_IE_MS_IDENTITY,
282 RSL_IE_MS_POWER,
283 RSL_IE_PAGING_GROUP,
284 RSL_IE_PAGING_LOAD,
285 RSL_IE_PYHS_CONTEXT = 0x10,
286 RSL_IE_ACCESS_DELAY,
287 RSL_IE_RACH_LOAD,
288 RSL_IE_REQ_REFERENCE,
289 RSL_IE_RELEASE_MODE,
290 RSL_IE_RESOURCE_INFO,
291 RSL_IE_RLM_CAUSE,
292 RSL_IE_STARTNG_TIME,
293 RSL_IE_TIMING_ADVANCE,
294 RSL_IE_UPLINK_MEAS,
295 RSL_IE_CAUSE,
296 RSL_IE_MEAS_RES_NR,
297 RSL_IE_MSG_ID,
298 /* reserved */
299 RSL_IE_SYSINFO_TYPE = 0x1e,
300 RSL_IE_MS_POWER_PARAM,
301 RSL_IE_BS_POWER_PARAM,
302 RSL_IE_PREPROC_PARAM,
303 RSL_IE_PREPROC_MEAS,
304 RSL_IE_IMM_ASS_INFO, /* Phase 1 (3.6.0), later Full below */
305 RSL_IE_SMSCB_INFO = 0x24,
306 RSL_IE_MS_TIMING_OFFSET,
307 RSL_IE_ERR_MSG,
308 RSL_IE_FULL_BCCH_INFO,
309 RSL_IE_CHAN_NEEDED,
310 RSL_IE_CB_CMD_TYPE,
311 RSL_IE_SMSCB_MSG,
312 RSL_IE_FULL_IMM_ASS_INFO,
313 RSL_IE_SACCH_INFO,
314 RSL_IE_CBCH_LOAD_INFO,
315 RSL_IE_SMSCB_CHAN_INDICATOR,
316 RSL_IE_GROUP_CALL_REF,
317 RSL_IE_CHAN_DESC = 0x30,
318 RSL_IE_NCH_DRX_INFO,
319 RSL_IE_CMD_INDICATOR,
320 RSL_IE_EMLPP_PRIO,
321 RSL_IE_UIC,
322 RSL_IE_MAIN_CHAN_REF,
323 RSL_IE_MR_CONFIG,
324 RSL_IE_MR_CONTROL,
325 RSL_IE_SUP_CODEC_TYPES,
326 RSL_IE_CODEC_CONFIG,
327 RSL_IE_RTD,
328 RSL_IE_TFO_STATUS,
329 RSL_IE_LLP_APDU,
330 /* Siemens vendor-specific */
331 RSL_IE_SIEMENS_MRPCI = 0x40,
332 RSL_IE_SIEMENS_PREF_AREA_TYPE = 0x43,
333 RSL_IE_SIEMENS_ININ_CELL_HO_PAR = 0x45,
334 RSL_IE_SIEMENS_TRACE_REF_NR = 0x46,
335 RSL_IE_SIEMENS_INT_TRACE_IDX = 0x47,
336 RSL_IE_SIEMENS_L2_HDR_INFO = 0x48,
337 RSL_IE_SIEMENS_HIGHEST_RATE = 0x4e,
338 RSL_IE_SIEMENS_SUGGESTED_RATE = 0x4f,
339
Philipp Maiera15967b2020-11-06 21:37:16 +0100340 /* Osmocom specific */
341 RSL_IE_OSMO_REP_ACCH_CAP= 0x60,
342
Harald Welteec8b4502010-02-20 20:34:29 +0100343 /* ip.access */
344 RSL_IE_IPAC_SRTP_CONFIG = 0xe0,
345 RSL_IE_IPAC_PROXY_UDP = 0xe1,
346 RSL_IE_IPAC_BSCMPL_TOUT = 0xe2,
347 RSL_IE_IPAC_REMOTE_IP = 0xf0,
348 RSL_IE_IPAC_REMOTE_PORT = 0xf1,
349 RSL_IE_IPAC_RTP_PAYLOAD = 0xf2,
350 RSL_IE_IPAC_LOCAL_PORT = 0xf3,
351 RSL_IE_IPAC_SPEECH_MODE = 0xf4,
352 RSL_IE_IPAC_LOCAL_IP = 0xf5,
353 RSL_IE_IPAC_CONN_STAT = 0xf6,
354 RSL_IE_IPAC_HO_C_PARMS = 0xf7,
355 RSL_IE_IPAC_CONN_ID = 0xf8,
356 RSL_IE_IPAC_RTP_CSD_FMT = 0xf9,
357 RSL_IE_IPAC_RTP_JIT_BUF = 0xfa,
358 RSL_IE_IPAC_RTP_COMPR = 0xfb,
359 RSL_IE_IPAC_RTP_PAYLOAD2= 0xfc,
360 RSL_IE_IPAC_RTP_MPLEX = 0xfd,
361 RSL_IE_IPAC_RTP_MPLEX_ID= 0xfe,
362};
363
Harald Welte6e363e72016-11-16 16:58:52 +0100364/* Ericsson specific IEs, clash with above partially, so they're not
365 * part of the enum */
Alexander Couzens9f39d892018-04-21 21:20:25 +0200366#define RSL_IE_ERIC_PAGING_GROUP 0x0e
Harald Welte6e363e72016-11-16 16:58:52 +0100367#define RSL_IE_ERIC_INST_NR 0x48
368#define RSL_IE_ERIC_PGSL_TIMERS 0x49
369#define RSL_IE_ERIC_REPEAT_DL_FACCH 0x4a
370#define RSL_IE_ERIC_POWER_INFO 0xf0
371#define RSL_IE_ERIC_MOBILE_ID 0xf1
372#define RSL_IE_ERIC_BCCH_MAPPING 0xf2
373#define RSL_IE_ERIC_PACKET_PAG_IND 0xf3
374#define RSL_IE_ERIC_CNTR_CTRL 0xf4
375#define RSL_IE_ERIC_CNTR_CTRL_ACK 0xf5
376#define RSL_IE_ERIC_CNTR_REPORT 0xf6
377#define RSL_IE_ERIC_ICP_CONN 0xf7
378#define RSL_IE_ERIC_EMR_SUPPORT 0xf8
379#define RSL_IE_ERIC_EGPRS_REQ_REF 0xf9
380#define RSL_IE_ERIC_VGCS_REL 0xfa
381#define RSL_IE_ERIC_REP_PER_NCH 0xfb
382#define RSL_IE_ERIC_NY2 0xfc
383#define RSL_IE_ERIC_T3115 0xfd
384#define RSL_IE_ERIC_ACTIVATE_FLAG 0xfe
385#define RSL_IE_ERIC_FULL_NCH_INFO 0xff
386
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400387/* IPAC MEAS_PREPROC AVERAGING METHOD */
388enum {
389 IPAC_UNWEIGHTED_AVE = 0,
390 IPAC_WEIGHTED_AVE,
391 IPAC_MEDIAN_AVE
392};
393
394/* IPAC MEAS_PREPROC AVERAGING PARAMID */
395enum {
396 IPAC_RXLEV_AVE = 0,
397 IPAC_RXQUAL_AVE,
398 IPAC_MS_BTS_DIS_AVE
399};
400
401/* IPAC MEAS_PREPROC HO CAUSES */
402enum {
403 IPAC_HO_RQD_CAUSE_L_RXLEV_UL_H = 0x01,
404 IPAC_HO_RQD_CAUSE_L_RXLEV_DL_H,
405 IPAC_HO_RQD_CAUSE_L_RXQUAL_UL_H,
406 IPAC_HO_RQD_CAUSE_L_RXQUAL_DL_H,
407 IPAC_HO_RQD_CAUSE_RXLEV_UL_IH,
408 IPAC_HO_RQD_CAUSE_RXLEV_DL_IH,
409 IPAC_HO_RQD_CAUSE_MAX_MS_RANGE,
410 IPAC_HO_RQD_CAUSE_POWER_BUDGET,
411 IPAC_HO_RQD_CAUSE_ENQUIRY,
412 IPAC_HO_RQD_CAUSE_ENQUIRY_FAILED,
413 IPAC_HO_RQD_CAUSE_NORMAL3G,
414 IPAC_HO_RQD_CAUSE_EMERGENCY3G,
415 IPAC_HO_RQD_CAUSE_SERVICE_PREFERRED3G,
416 IPAC_HO_RQD_CAUSE_O_M_SHUTDOWN,
417 IPAC_HO_RQD_CAUSE_QUALITY_PROMOTION,
418 IPAC_HO_RQD_CAUSE_LOAD_PROMOTION,
419 IPAC_HO_RQD_CAUSE_LOAD_DEMOTION,
420 IPAC_HO_RQD_CAUSE_MAX,
421};
422
Harald Welteec8b4502010-02-20 20:34:29 +0100423/* Chapter 9.3.1 */
424#define RSL_CHAN_NR_MASK 0xf8
Neels Hofmeyr15b96ff2016-07-18 23:33:48 +0200425#define RSL_CHAN_NR_1 0x08 /*< bit to add for 2nd,... lchan */
Harald Welteec8b4502010-02-20 20:34:29 +0100426#define RSL_CHAN_Bm_ACCHs 0x08
427#define RSL_CHAN_Lm_ACCHs 0x10 /* .. 0x18 */
428#define RSL_CHAN_SDCCH4_ACCH 0x20 /* .. 0x38 */
429#define RSL_CHAN_SDCCH8_ACCH 0x40 /* ...0x78 */
430#define RSL_CHAN_BCCH 0x80
431#define RSL_CHAN_RACH 0x88
432#define RSL_CHAN_PCH_AGCH 0x90
Neels Hofmeyrfd80f5a2016-07-14 03:21:05 +0200433#define RSL_CHAN_OSMO_PDCH 0xc0 /*< non-standard, for dyn TS */
Harald Weltea8d7ebb2019-05-27 16:51:23 +0200434#define RSL_CHAN_OSMO_CBCH4 0xc8 /*< non-standard, for CBCH/SDCCH4 */
435#define RSL_CHAN_OSMO_CBCH8 0xd0 /*< non-standard, for CBCH/SDCCH8 */
Harald Welteec8b4502010-02-20 20:34:29 +0100436
437/* Chapter 9.3.3 */
438#define RSL_ACT_TYPE_INITIAL 0x00
439#define RSL_ACT_TYPE_REACT 0x80
440#define RSL_ACT_INTRA_IMM_ASS 0x00
441#define RSL_ACT_INTRA_NORM_ASS 0x01
442#define RSL_ACT_INTER_ASYNC 0x02
443#define RSL_ACT_INTER_SYNC 0x03
444#define RSL_ACT_SECOND_ADD 0x04
445#define RSL_ACT_SECOND_MULTI 0x05
Neels Hofmeyrfd80f5a2016-07-14 03:21:05 +0200446#define RSL_ACT_OSMO_PDCH 0x0f /*< non-standard, for dyn TS */
Harald Welteec8b4502010-02-20 20:34:29 +0100447
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200448/*! RSL Channel Mode IF (Chapter 9.3.6) */
Harald Welteec8b4502010-02-20 20:34:29 +0100449struct rsl_ie_chan_mode {
450 uint8_t dtx_dtu;
451 uint8_t spd_ind;
452 uint8_t chan_rt;
453 uint8_t chan_rate;
454} __attribute__ ((packed));
455#define RSL_CMOD_DTXu 0x01 /* uplink */
456#define RSL_CMOD_DTXd 0x02 /* downlink */
457enum rsl_cmod_spd {
458 RSL_CMOD_SPD_SPEECH = 0x01,
459 RSL_CMOD_SPD_DATA = 0x02,
460 RSL_CMOD_SPD_SIGN = 0x03,
461};
462#define RSL_CMOD_CRT_SDCCH 0x01
463#define RSL_CMOD_CRT_TCH_Bm 0x08 /* full-rate */
464#define RSL_CMOD_CRT_TCH_Lm 0x09 /* half-rate */
465/* FIXME: More CRT types */
466/* Speech */
467#define RSL_CMOD_SP_GSM1 0x01
468#define RSL_CMOD_SP_GSM2 0x11
469#define RSL_CMOD_SP_GSM3 0x21
Harald Welteeed26112012-08-24 15:35:34 +0200470/* non-transparent data */
471#define RSL_CMOD_CSD_NT_43k5 0x74
472#define RSL_CMOD_CSD_NT_28k8 0x71
473#define RSL_CMOD_CSD_NT_14k5 0x58
474#define RSL_CMOD_CSD_NT_12k0 0x50
475#define RSL_CMOD_CSD_NT_6k0 0x51
476/* legacy #defines with wrong name */
477#define RSL_CMOD_SP_NT_14k5 RSL_CMOD_CSD_NT_14k5
478#define RSL_CMOD_SP_NT_12k0 RSL_CMOD_CSD_NT_12k0
479#define RSL_CMOD_SP_NT_6k0 RSL_CMOD_CSD_NT_6k0
480/* transparent data */
481#define RSL_CMOD_CSD_T_32000 0x38
482#define RSL_CMOD_CSD_T_29000 0x39
483#define RSL_CMOD_CSD_T_14400 0x18
484#define RSL_CMOD_CSD_T_9600 0x10
485#define RSL_CMOD_CSD_T_4800 0x11
486#define RSL_CMOD_CSD_T_2400 0x12
487#define RSL_CMOD_CSD_T_1200 0x13
488#define RSL_CMOD_CSD_T_600 0x14
489#define RSL_CMOD_CSD_T_1200_75 0x15
Harald Welteec8b4502010-02-20 20:34:29 +0100490
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200491/*! RSL Channel Identification IE (Chapter 9.3.5) */
Harald Welteec8b4502010-02-20 20:34:29 +0100492struct rsl_ie_chan_ident {
493 /* GSM 04.08 10.5.2.5 */
494 struct {
495 uint8_t iei;
496 uint8_t chan_nr; /* enc_chan_nr */
497 uint8_t oct3;
498 uint8_t oct4;
499 } chan_desc;
500#if 0 /* spec says we need this but Abissim doesn't use it */
501 struct {
502 uint8_t tag;
503 uint8_t len;
504 } mobile_alloc;
505#endif
506} __attribute__ ((packed));
507
508/* Chapter 9.3.22 */
509#define RLL_CAUSE_T200_EXPIRED 0x01
510#define RLL_CAUSE_REEST_REQ 0x02
511#define RLL_CAUSE_UNSOL_UA_RESP 0x03
512#define RLL_CAUSE_UNSOL_DM_RESP 0x04
513#define RLL_CAUSE_UNSOL_DM_RESP_MF 0x05
514#define RLL_CAUSE_UNSOL_SPRV_RESP 0x06
515#define RLL_CAUSE_SEQ_ERR 0x07
516#define RLL_CAUSE_UFRM_INC_PARAM 0x08
517#define RLL_CAUSE_SFRM_INC_PARAM 0x09
518#define RLL_CAUSE_IFRM_INC_MBITS 0x0a
519#define RLL_CAUSE_IFRM_INC_LEN 0x0b
520#define RLL_CAUSE_FRM_UNIMPL 0x0c
521#define RLL_CAUSE_SABM_MF 0x0d
522#define RLL_CAUSE_SABM_INFO_NOTALL 0x0e
523
524/* Chapter 9.3.26 */
525#define RSL_ERRCLS_NORMAL 0x00
526#define RSL_ERRCLS_RESOURCE_UNAVAIL 0x20
527#define RSL_ERRCLS_SERVICE_UNAVAIL 0x30
528#define RSL_ERRCLS_SERVICE_UNIMPL 0x40
529#define RSL_ERRCLS_INVAL_MSG 0x50
530#define RSL_ERRCLS_PROTO_ERROR 0x60
531#define RSL_ERRCLS_INTERWORKING 0x70
532
533/* normal event */
534#define RSL_ERR_RADIO_IF_FAIL 0x00
535#define RSL_ERR_RADIO_LINK_FAIL 0x01
536#define RSL_ERR_HANDOVER_ACC_FAIL 0x02
537#define RSL_ERR_TALKER_ACC_FAIL 0x03
538#define RSL_ERR_OM_INTERVENTION 0x07
539#define RSL_ERR_NORMAL_UNSPEC 0x0f
540#define RSL_ERR_T_MSRFPCI_EXP 0x18
541/* resource unavailable */
542#define RSL_ERR_EQUIPMENT_FAIL 0x20
543#define RSL_ERR_RR_UNAVAIL 0x21
544#define RSL_ERR_TERR_CH_FAIL 0x22
545#define RSL_ERR_CCCH_OVERLOAD 0x23
546#define RSL_ERR_ACCH_OVERLOAD 0x24
547#define RSL_ERR_PROCESSOR_OVERLOAD 0x25
Philipp Maier6d214482020-07-28 16:53:27 +0200548#define RSL_ERR_BTS_NOT_EQUIPPED 0x27
549#define RSL_ERR_REMOTE_TRANSC_FAIL 0x28
550#define RSL_ERR_NOTIFICATION_OVERFL 0x29
Harald Welteec8b4502010-02-20 20:34:29 +0100551#define RSL_ERR_RES_UNAVAIL 0x2f
552/* service or option not available */
553#define RSL_ERR_TRANSC_UNAVAIL 0x30
554#define RSL_ERR_SERV_OPT_UNAVAIL 0x3f
555/* service or option not implemented */
556#define RSL_ERR_ENCR_UNIMPL 0x40
557#define RSL_ERR_SERV_OPT_UNIMPL 0x4f
558/* invalid message */
559#define RSL_ERR_RCH_ALR_ACTV_ALLOC 0x50
560#define RSL_ERR_INVALID_MESSAGE 0x5f
561/* protocol error */
562#define RSL_ERR_MSG_DISCR 0x60
563#define RSL_ERR_MSG_TYPE 0x61
564#define RSL_ERR_MSG_SEQ 0x62
565#define RSL_ERR_IE_ERROR 0x63
566#define RSL_ERR_MAND_IE_ERROR 0x64
567#define RSL_ERR_OPT_IE_ERROR 0x65
568#define RSL_ERR_IE_NONEXIST 0x66
569#define RSL_ERR_IE_LENGTH 0x67
570#define RSL_ERR_IE_CONTENT 0x68
571#define RSL_ERR_PROTO 0x6f
572/* interworking */
573#define RSL_ERR_INTERWORKING 0x7f
574
575/* Chapter 9.3.30 */
576#define RSL_SYSTEM_INFO_8 0x00
577#define RSL_SYSTEM_INFO_1 0x01
578#define RSL_SYSTEM_INFO_2 0x02
579#define RSL_SYSTEM_INFO_3 0x03
580#define RSL_SYSTEM_INFO_4 0x04
581#define RSL_SYSTEM_INFO_5 0x05
582#define RSL_SYSTEM_INFO_6 0x06
583#define RSL_SYSTEM_INFO_7 0x07
584#define RSL_SYSTEM_INFO_16 0x08
585#define RSL_SYSTEM_INFO_17 0x09
586#define RSL_SYSTEM_INFO_2bis 0x0a
587#define RSL_SYSTEM_INFO_2ter 0x0b
588#define RSL_SYSTEM_INFO_5bis 0x0d
589#define RSL_SYSTEM_INFO_5ter 0x0e
590#define RSL_SYSTEM_INFO_10 0x0f
Harald Welte3d732272011-06-25 21:39:01 +0200591#define RSL_EXT_MEAS_ORDER 0x47
Harald Welteec8b4502010-02-20 20:34:29 +0100592#define RSL_MEAS_INFO 0x48
593#define RSL_SYSTEM_INFO_13 0x28
Philipp00b15392016-11-14 12:34:15 +0100594#define RSL_ERIC_SYSTEM_INFO_13 0x0C
Harald Welteec8b4502010-02-20 20:34:29 +0100595#define RSL_SYSTEM_INFO_2quater 0x29
596#define RSL_SYSTEM_INFO_9 0x2a
597#define RSL_SYSTEM_INFO_18 0x2b
598#define RSL_SYSTEM_INFO_19 0x2c
599#define RSL_SYSTEM_INFO_20 0x2d
600
601/* Chapter 9.3.40 */
602#define RSL_CHANNEED_ANY 0x00
603#define RSL_CHANNEED_SDCCH 0x01
604#define RSL_CHANNEED_TCH_F 0x02
605#define RSL_CHANNEED_TCH_ForH 0x03
606
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200607/*! RSL Cell Broadcast Command (Chapter 9.3.45) */
Alex Badea84930182010-11-27 23:34:46 +0200608struct rsl_ie_cb_cmd_type {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100609#if OSMO_IS_LITTLE_ENDIAN
Alex Badea84930182010-11-27 23:34:46 +0200610 uint8_t last_block:2;
611 uint8_t spare:1;
612 uint8_t def_bcast:1;
613 uint8_t command:4;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100614#elif OSMO_IS_BIG_ENDIAN
615/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
616 uint8_t command:4, def_bcast:1, spare:1, last_block:2;
617#endif
Alex Badea84930182010-11-27 23:34:46 +0200618} __attribute__ ((packed));
619/* ->command */
620#define RSL_CB_CMD_TYPE_NORMAL 0x00
621#define RSL_CB_CMD_TYPE_SCHEDULE 0x08
622#define RSL_CB_CMD_TYPE_DEFAULT 0x0e
623#define RSL_CB_CMD_TYPE_NULL 0x0f
624/* ->def_bcast */
625#define RSL_CB_CMD_DEFBCAST_NORMAL 0
626#define RSL_CB_CMD_DEFBCAST_NULL 1
627/* ->last_block */
628#define RSL_CB_CMD_LASTBLOCK_4 0
629#define RSL_CB_CMD_LASTBLOCK_1 1
630#define RSL_CB_CMD_LASTBLOCK_2 2
631#define RSL_CB_CMD_LASTBLOCK_3 3
632
Harald Welteec8b4502010-02-20 20:34:29 +0100633/* Chapter 3.3.2.3 Brocast control channel */
634/* CCCH-CONF, NC is not combined */
635#define RSL_BCCH_CCCH_CONF_1_NC 0x00
636#define RSL_BCCH_CCCH_CONF_1_C 0x01
637#define RSL_BCCH_CCCH_CONF_2_NC 0x02
638#define RSL_BCCH_CCCH_CONF_3_NC 0x04
639#define RSL_BCCH_CCCH_CONF_4_NC 0x06
640
641/* BS-PA-MFRMS */
642#define RSL_BS_PA_MFRMS_2 0x00
643#define RSL_BS_PA_MFRMS_3 0x01
644#define RSL_BS_PA_MFRMS_4 0x02
645#define RSL_BS_PA_MFRMS_5 0x03
646#define RSL_BS_PA_MFRMS_6 0x04
647#define RSL_BS_PA_MFRMS_7 0x05
648#define RSL_BS_PA_MFRMS_8 0x06
649#define RSL_BS_PA_MFRMS_9 0x07
650
651/* RSL_IE_IPAC_RTP_PAYLOAD[2] */
652enum rsl_ipac_rtp_payload {
653 RSL_IPAC_RTP_GSM = 1,
654 RSL_IPAC_RTP_EFR,
655 RSL_IPAC_RTP_AMR,
656 RSL_IPAC_RTP_CSD,
657 RSL_IPAC_RTP_MUX,
658};
659
660/* RSL_IE_IPAC_SPEECH_MODE, lower four bits */
661enum rsl_ipac_speech_mode_s {
662 RSL_IPAC_SPEECH_GSM_FR = 0, /* GSM FR (Type 1, FS) */
663 RSL_IPAC_SPEECH_GSM_EFR = 1, /* GSM EFR (Type 2, FS) */
664 RSL_IPAC_SPEECH_GSM_AMR_FR = 2, /* GSM AMR/FR (Type 3, FS) */
665 RSL_IPAC_SPEECH_GSM_HR = 3, /* GSM HR (Type 1, HS) */
666 RSL_IPAC_SPEECH_GSM_AMR_HR = 5, /* GSM AMR/hr (Type 3, HS) */
667 RSL_IPAC_SPEECH_AS_RTP = 0xf, /* As specified by RTP Payload IE */
668};
669/* RSL_IE_IPAC_SPEECH_MODE, upper four bits */
670enum rsl_ipac_speech_mode_m {
671 RSL_IPAC_SPEECH_M_RXTX = 0, /* Send and Receive */
672 RSL_IPAC_SPEECH_M_RX = 1, /* Receive only */
673 RSL_IPAC_SPEECH_M_TX = 2, /* Send only */
674};
675
676/* RSL_IE_IPAC_RTP_CSD_FMT, lower four bits */
677enum rsl_ipac_rtp_csd_format_d {
678 RSL_IPAC_RTP_CSD_EXT_TRAU = 0,
679 RSL_IPAC_RTP_CSD_NON_TRAU = 1,
680 RSL_IPAC_RTP_CSD_TRAU_BTS = 2,
681 RSL_IPAC_RTP_CSD_IWF_FREE = 3,
682};
683/* RSL_IE_IPAC_RTP_CSD_FMT, upper four bits */
684enum rsl_ipac_rtp_csd_format_ir {
685 RSL_IPAC_RTP_CSD_IR_8k = 0,
686 RSL_IPAC_RTP_CSD_IR_16k = 1,
687 RSL_IPAC_RTP_CSD_IR_32k = 2,
688 RSL_IPAC_RTP_CSD_IR_64k = 3,
689};
690
691/* Siemens vendor-specific RSL extensions */
692struct rsl_mrpci {
693 uint8_t power_class:3,
694 vgcs_capable:1,
695 vbs_capable:1,
696 gsm_phase:2;
697} __attribute__ ((packed));
698
699enum rsl_mrpci_pwrclass {
700 RSL_MRPCI_PWRC_1 = 0,
701 RSL_MRPCI_PWRC_2 = 1,
702 RSL_MRPCI_PWRC_3 = 2,
703 RSL_MRPCI_PWRC_4 = 3,
704 RSL_MRPCI_PWRC_5 = 4,
705};
706enum rsl_mrpci_phase {
707 RSL_MRPCI_PHASE_1 = 0,
708 /* reserved */
709 RSL_MRPCI_PHASE_2 = 2,
710 RSL_MRPCI_PHASE_2PLUS = 3,
711};
712
Holger Hans Peter Freyther0357e9b2012-12-06 11:57:31 +0100713/* 9.3.20 Release Mode */
714enum rsl_rel_mode {
715 RSL_REL_NORMAL = 0,
716 RSL_REL_LOCAL_END = 1,
717};
718
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200719/*! ip.access specific embedded information elements */
Harald Weltefad57522015-12-13 11:56:36 +0100720enum rsl_ipac_embedded_ie {
721 RSL_IPAC_EIE_RXLEV = 0x00,
722 RSL_IPAC_EIE_RXQUAL = 0x01,
723 RSL_IPAC_EIE_FREQ_ERR = 0x02,
724 RSL_IPAC_EIE_TIMING_ERR = 0x03,
725 RSL_IPAC_EIE_MEAS_AVG_CFG = 0x04,
726 RSL_IPAC_EIE_BS_PWR_CTL = 0x05,
727 RSL_IPAC_EIE_MS_PWR_CTL = 0x06,
728 RSL_IPAC_EIE_HANDO_THRESH = 0x07,
729 RSL_IPAC_EIE_NCELL_DEFAULTS = 0x08,
730 RSL_IPAC_EIE_NCELL_LIST = 0x09,
731 RSL_IPAC_EIE_PC_THRESH_COMP = 0x0a,
732 RSL_IPAC_EIE_HO_THRESH_COMP = 0x0b,
733 RSL_IPAC_EIE_HO_CAUSE = 0x0c,
734 RSL_IPAC_EIE_HO_CANDIDATES = 0x0d,
735 RSL_IPAC_EIE_NCELL_BA_CHG_LIST = 0x0e,
736 RSL_IPAC_EIE_NUM_OF_MS = 0x10,
737 RSL_IPAC_EIE_HO_CAND_EXT = 0x11,
738 RSL_IPAC_EIE_NCELL_DEF_EXT = 0x12,
739 RSL_IPAC_EIE_NCELL_LIST_EXT = 0x13,
740 RSL_IPAC_EIE_MASTER_KEY = 0x14,
741 RSL_IPAC_EIE_MASTER_SALT = 0x15,
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400742 /* additional IPAC measurement pre-processing related IEI */
743 RSL_IPAC_EIE_MEAS_TRANS_RES = 0x16,
744 RSL_IPAC_EIE_3G_HO_PARAM = 0x17,
745 RSL_IPAC_EIE_3G_NCELL_LIST = 0x18,
746 RSL_IPAC_EIE_SDCCH_CTL_PARAM = 0x1a,
747 RSL_IPAC_EIE_AMR_CONV_THRESH = 0x1b,
748
749};
750
751struct ipac_preproc_ave_cfg {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100752#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400753 uint8_t h_reqave:5,
754 param_id:2,
755 reserved:1;
756 uint8_t h_reqt:5,
757 ave_method:3;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100758#elif OSMO_IS_BIG_ENDIAN
759/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
760 uint8_t reserved:1, param_id:2, h_reqave:5;
761 uint8_t ave_method:3, h_reqt:5;
762#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400763}__attribute__ ((packed));
764
765struct ipac_preproc_ho_thresh {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100766#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400767 uint8_t l_rxlev_ul_h:6,
768 reserved_l_rxlev_ul:2;
769 uint8_t l_rxlev_dl_h:6,
770 reserved_l_rxlev_dl:2;
771 uint8_t rxlev_ul_ih:6,
772 reserved_rxlev_ul:2;
773 uint8_t rxlev_dl_ih:6,
774 reserved_rxlev_dl:2;
775 uint8_t l_rxqual_ul_h:3,
776 reserved_rxlqual_ul:1,
777 l_rxqual_dl_h:3,
778 reserved_rxqual_dl:1;
779 uint8_t ms_range_max:6,
780 reserved_ms_range:2;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100781#elif OSMO_IS_BIG_ENDIAN
782/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
783 uint8_t reserved_l_rxlev_ul:2, l_rxlev_ul_h:6;
784 uint8_t reserved_l_rxlev_dl:2, l_rxlev_dl_h:6;
785 uint8_t reserved_rxlev_ul:2, rxlev_ul_ih:6;
786 uint8_t reserved_rxlev_dl:2, rxlev_dl_ih:6;
787 uint8_t reserved_rxqual_dl:1, l_rxqual_dl_h:3, reserved_rxlqual_ul:1, l_rxqual_ul_h:3;
788 uint8_t reserved_ms_range:2, ms_range_max:6;
789#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400790}__attribute__ ((packed));
791
792struct ipac_preproc_ho_comp {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100793#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400794 uint8_t p5:5,
795 reserved_p5:3;
796 uint8_t n5:5,
797 reserved_n5:3;
798 uint8_t p6:5,
799 reserved_p6:3;
800 uint8_t n6:5,
801 reserved_n6:3;
802 uint8_t p7:5,
803 reserved_p7:3;
804 uint8_t n7:5,
805 reserved_n7:3;
806 uint8_t p8:5,
807 reserved_p8:3;
808 uint8_t n8:5,
809 reserved_n8:3;
810 uint8_t ho_interval:5,
811 reserved_ho:3;
812 uint8_t reserved;
813
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100814#elif OSMO_IS_BIG_ENDIAN
815/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
816 uint8_t reserved_p5:3, p5:5;
817 uint8_t reserved_n5:3, n5:5;
818 uint8_t reserved_p6:3, p6:5;
819 uint8_t reserved_n6:3, n6:5;
820 uint8_t reserved_p7:3, p7:5;
821 uint8_t reserved_n7:3, n7:5;
822 uint8_t reserved_p8:3, p8:5;
823 uint8_t reserved_n8:3, n8:5;
824 uint8_t reserved_ho:3, ho_interval:5;
825 uint8_t reserved;
826#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400827}__attribute__ ((packed));
828
829struct ipac_preproc_ho_candidates {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100830#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400831 uint8_t bsic:6,
832 reserved0:2;
833 uint8_t bcch_freq:5,
834 ba_used:1,
835 s:1,
836 reserved1:1;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100837#elif OSMO_IS_BIG_ENDIAN
838/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
839 uint8_t reserved0:2, bsic:6;
840 uint8_t reserved1:1, s:1, ba_used:1, bcch_freq:5;
841#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400842}__attribute__ ((packed));
843
844struct ipac_preproc_ncell_dflts {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100845#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400846 uint8_t rxlev_min_def:6,
847 reserved_rxlev_min_def:2;
848 uint8_t ho_margin_def:5,
849 reserved_ho_margin_def:3;
850 uint8_t ms_txpwr_max_def:5,
851 reserved_ms_txpwr_max_def:3;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100852#elif OSMO_IS_BIG_ENDIAN
853/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
854 uint8_t reserved_rxlev_min_def:2, rxlev_min_def:6;
855 uint8_t reserved_ho_margin_def:3, ho_margin_def:5;
856 uint8_t reserved_ms_txpwr_max_def:3, ms_txpwr_max_def:5;
857#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400858}__attribute__ ((packed));
859
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -0500860struct ipac_preproc_ho_ctl_param {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100861#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -0500862 uint8_t sdcch_ho_gsm:1,
863 sdcch_ho_umts:1,
864 reserved:6;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100865#elif OSMO_IS_BIG_ENDIAN
866/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
867 uint8_t reserved:6, sdcch_ho_umts:1, sdcch_ho_gsm:1;
868#endif
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -0500869}__attribute__ ((packed));
870
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400871struct ipac_preproc_cfg {
872 uint8_t meas_rep_mode;
873 uint32_t meas_mode_flags;
874 struct ipac_preproc_ave_cfg ms_ave_cfg[3];
875 struct ipac_preproc_ave_cfg ave_cfg;
876 struct ipac_preproc_ho_thresh ho_thresh;
877 struct ipac_preproc_ho_comp ho_comp;
878 struct ipac_preproc_ncell_dflts ncell_dflts;
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -0500879 struct ipac_preproc_ho_ctl_param ho_ctl_param;
Harald Weltefad57522015-12-13 11:56:36 +0100880};
881
Sylvain Munautdca7d2c2012-04-18 21:53:23 +0200882/*! @} */