blob: cd13a7dc713aab6f3ce1589941c4caf519d730b5 [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
340 /* ip.access */
341 RSL_IE_IPAC_SRTP_CONFIG = 0xe0,
342 RSL_IE_IPAC_PROXY_UDP = 0xe1,
343 RSL_IE_IPAC_BSCMPL_TOUT = 0xe2,
344 RSL_IE_IPAC_REMOTE_IP = 0xf0,
345 RSL_IE_IPAC_REMOTE_PORT = 0xf1,
346 RSL_IE_IPAC_RTP_PAYLOAD = 0xf2,
347 RSL_IE_IPAC_LOCAL_PORT = 0xf3,
348 RSL_IE_IPAC_SPEECH_MODE = 0xf4,
349 RSL_IE_IPAC_LOCAL_IP = 0xf5,
350 RSL_IE_IPAC_CONN_STAT = 0xf6,
351 RSL_IE_IPAC_HO_C_PARMS = 0xf7,
352 RSL_IE_IPAC_CONN_ID = 0xf8,
353 RSL_IE_IPAC_RTP_CSD_FMT = 0xf9,
354 RSL_IE_IPAC_RTP_JIT_BUF = 0xfa,
355 RSL_IE_IPAC_RTP_COMPR = 0xfb,
356 RSL_IE_IPAC_RTP_PAYLOAD2= 0xfc,
357 RSL_IE_IPAC_RTP_MPLEX = 0xfd,
358 RSL_IE_IPAC_RTP_MPLEX_ID= 0xfe,
359};
360
Harald Welte6e363e72016-11-16 16:58:52 +0100361/* Ericsson specific IEs, clash with above partially, so they're not
362 * part of the enum */
Alexander Couzens9f39d892018-04-21 21:20:25 +0200363#define RSL_IE_ERIC_PAGING_GROUP 0x0e
Harald Welte6e363e72016-11-16 16:58:52 +0100364#define RSL_IE_ERIC_INST_NR 0x48
365#define RSL_IE_ERIC_PGSL_TIMERS 0x49
366#define RSL_IE_ERIC_REPEAT_DL_FACCH 0x4a
367#define RSL_IE_ERIC_POWER_INFO 0xf0
368#define RSL_IE_ERIC_MOBILE_ID 0xf1
369#define RSL_IE_ERIC_BCCH_MAPPING 0xf2
370#define RSL_IE_ERIC_PACKET_PAG_IND 0xf3
371#define RSL_IE_ERIC_CNTR_CTRL 0xf4
372#define RSL_IE_ERIC_CNTR_CTRL_ACK 0xf5
373#define RSL_IE_ERIC_CNTR_REPORT 0xf6
374#define RSL_IE_ERIC_ICP_CONN 0xf7
375#define RSL_IE_ERIC_EMR_SUPPORT 0xf8
376#define RSL_IE_ERIC_EGPRS_REQ_REF 0xf9
377#define RSL_IE_ERIC_VGCS_REL 0xfa
378#define RSL_IE_ERIC_REP_PER_NCH 0xfb
379#define RSL_IE_ERIC_NY2 0xfc
380#define RSL_IE_ERIC_T3115 0xfd
381#define RSL_IE_ERIC_ACTIVATE_FLAG 0xfe
382#define RSL_IE_ERIC_FULL_NCH_INFO 0xff
383
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400384/* IPAC MEAS_PREPROC AVERAGING METHOD */
385enum {
386 IPAC_UNWEIGHTED_AVE = 0,
387 IPAC_WEIGHTED_AVE,
388 IPAC_MEDIAN_AVE
389};
390
391/* IPAC MEAS_PREPROC AVERAGING PARAMID */
392enum {
393 IPAC_RXLEV_AVE = 0,
394 IPAC_RXQUAL_AVE,
395 IPAC_MS_BTS_DIS_AVE
396};
397
398/* IPAC MEAS_PREPROC HO CAUSES */
399enum {
400 IPAC_HO_RQD_CAUSE_L_RXLEV_UL_H = 0x01,
401 IPAC_HO_RQD_CAUSE_L_RXLEV_DL_H,
402 IPAC_HO_RQD_CAUSE_L_RXQUAL_UL_H,
403 IPAC_HO_RQD_CAUSE_L_RXQUAL_DL_H,
404 IPAC_HO_RQD_CAUSE_RXLEV_UL_IH,
405 IPAC_HO_RQD_CAUSE_RXLEV_DL_IH,
406 IPAC_HO_RQD_CAUSE_MAX_MS_RANGE,
407 IPAC_HO_RQD_CAUSE_POWER_BUDGET,
408 IPAC_HO_RQD_CAUSE_ENQUIRY,
409 IPAC_HO_RQD_CAUSE_ENQUIRY_FAILED,
410 IPAC_HO_RQD_CAUSE_NORMAL3G,
411 IPAC_HO_RQD_CAUSE_EMERGENCY3G,
412 IPAC_HO_RQD_CAUSE_SERVICE_PREFERRED3G,
413 IPAC_HO_RQD_CAUSE_O_M_SHUTDOWN,
414 IPAC_HO_RQD_CAUSE_QUALITY_PROMOTION,
415 IPAC_HO_RQD_CAUSE_LOAD_PROMOTION,
416 IPAC_HO_RQD_CAUSE_LOAD_DEMOTION,
417 IPAC_HO_RQD_CAUSE_MAX,
418};
419
Harald Welteec8b4502010-02-20 20:34:29 +0100420/* Chapter 9.3.1 */
421#define RSL_CHAN_NR_MASK 0xf8
Neels Hofmeyr15b96ff2016-07-18 23:33:48 +0200422#define RSL_CHAN_NR_1 0x08 /*< bit to add for 2nd,... lchan */
Harald Welteec8b4502010-02-20 20:34:29 +0100423#define RSL_CHAN_Bm_ACCHs 0x08
424#define RSL_CHAN_Lm_ACCHs 0x10 /* .. 0x18 */
425#define RSL_CHAN_SDCCH4_ACCH 0x20 /* .. 0x38 */
426#define RSL_CHAN_SDCCH8_ACCH 0x40 /* ...0x78 */
427#define RSL_CHAN_BCCH 0x80
428#define RSL_CHAN_RACH 0x88
429#define RSL_CHAN_PCH_AGCH 0x90
Neels Hofmeyrfd80f5a2016-07-14 03:21:05 +0200430#define RSL_CHAN_OSMO_PDCH 0xc0 /*< non-standard, for dyn TS */
Harald Weltea8d7ebb2019-05-27 16:51:23 +0200431#define RSL_CHAN_OSMO_CBCH4 0xc8 /*< non-standard, for CBCH/SDCCH4 */
432#define RSL_CHAN_OSMO_CBCH8 0xd0 /*< non-standard, for CBCH/SDCCH8 */
Harald Welteec8b4502010-02-20 20:34:29 +0100433
434/* Chapter 9.3.3 */
435#define RSL_ACT_TYPE_INITIAL 0x00
436#define RSL_ACT_TYPE_REACT 0x80
437#define RSL_ACT_INTRA_IMM_ASS 0x00
438#define RSL_ACT_INTRA_NORM_ASS 0x01
439#define RSL_ACT_INTER_ASYNC 0x02
440#define RSL_ACT_INTER_SYNC 0x03
441#define RSL_ACT_SECOND_ADD 0x04
442#define RSL_ACT_SECOND_MULTI 0x05
Neels Hofmeyrfd80f5a2016-07-14 03:21:05 +0200443#define RSL_ACT_OSMO_PDCH 0x0f /*< non-standard, for dyn TS */
Harald Welteec8b4502010-02-20 20:34:29 +0100444
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200445/*! RSL Channel Mode IF (Chapter 9.3.6) */
Harald Welteec8b4502010-02-20 20:34:29 +0100446struct rsl_ie_chan_mode {
447 uint8_t dtx_dtu;
448 uint8_t spd_ind;
449 uint8_t chan_rt;
450 uint8_t chan_rate;
451} __attribute__ ((packed));
452#define RSL_CMOD_DTXu 0x01 /* uplink */
453#define RSL_CMOD_DTXd 0x02 /* downlink */
454enum rsl_cmod_spd {
455 RSL_CMOD_SPD_SPEECH = 0x01,
456 RSL_CMOD_SPD_DATA = 0x02,
457 RSL_CMOD_SPD_SIGN = 0x03,
458};
459#define RSL_CMOD_CRT_SDCCH 0x01
460#define RSL_CMOD_CRT_TCH_Bm 0x08 /* full-rate */
461#define RSL_CMOD_CRT_TCH_Lm 0x09 /* half-rate */
462/* FIXME: More CRT types */
463/* Speech */
464#define RSL_CMOD_SP_GSM1 0x01
465#define RSL_CMOD_SP_GSM2 0x11
466#define RSL_CMOD_SP_GSM3 0x21
Harald Welteeed26112012-08-24 15:35:34 +0200467/* non-transparent data */
468#define RSL_CMOD_CSD_NT_43k5 0x74
469#define RSL_CMOD_CSD_NT_28k8 0x71
470#define RSL_CMOD_CSD_NT_14k5 0x58
471#define RSL_CMOD_CSD_NT_12k0 0x50
472#define RSL_CMOD_CSD_NT_6k0 0x51
473/* legacy #defines with wrong name */
474#define RSL_CMOD_SP_NT_14k5 RSL_CMOD_CSD_NT_14k5
475#define RSL_CMOD_SP_NT_12k0 RSL_CMOD_CSD_NT_12k0
476#define RSL_CMOD_SP_NT_6k0 RSL_CMOD_CSD_NT_6k0
477/* transparent data */
478#define RSL_CMOD_CSD_T_32000 0x38
479#define RSL_CMOD_CSD_T_29000 0x39
480#define RSL_CMOD_CSD_T_14400 0x18
481#define RSL_CMOD_CSD_T_9600 0x10
482#define RSL_CMOD_CSD_T_4800 0x11
483#define RSL_CMOD_CSD_T_2400 0x12
484#define RSL_CMOD_CSD_T_1200 0x13
485#define RSL_CMOD_CSD_T_600 0x14
486#define RSL_CMOD_CSD_T_1200_75 0x15
Harald Welteec8b4502010-02-20 20:34:29 +0100487
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200488/*! RSL Channel Identification IE (Chapter 9.3.5) */
Harald Welteec8b4502010-02-20 20:34:29 +0100489struct rsl_ie_chan_ident {
490 /* GSM 04.08 10.5.2.5 */
491 struct {
492 uint8_t iei;
493 uint8_t chan_nr; /* enc_chan_nr */
494 uint8_t oct3;
495 uint8_t oct4;
496 } chan_desc;
497#if 0 /* spec says we need this but Abissim doesn't use it */
498 struct {
499 uint8_t tag;
500 uint8_t len;
501 } mobile_alloc;
502#endif
503} __attribute__ ((packed));
504
505/* Chapter 9.3.22 */
506#define RLL_CAUSE_T200_EXPIRED 0x01
507#define RLL_CAUSE_REEST_REQ 0x02
508#define RLL_CAUSE_UNSOL_UA_RESP 0x03
509#define RLL_CAUSE_UNSOL_DM_RESP 0x04
510#define RLL_CAUSE_UNSOL_DM_RESP_MF 0x05
511#define RLL_CAUSE_UNSOL_SPRV_RESP 0x06
512#define RLL_CAUSE_SEQ_ERR 0x07
513#define RLL_CAUSE_UFRM_INC_PARAM 0x08
514#define RLL_CAUSE_SFRM_INC_PARAM 0x09
515#define RLL_CAUSE_IFRM_INC_MBITS 0x0a
516#define RLL_CAUSE_IFRM_INC_LEN 0x0b
517#define RLL_CAUSE_FRM_UNIMPL 0x0c
518#define RLL_CAUSE_SABM_MF 0x0d
519#define RLL_CAUSE_SABM_INFO_NOTALL 0x0e
520
521/* Chapter 9.3.26 */
522#define RSL_ERRCLS_NORMAL 0x00
523#define RSL_ERRCLS_RESOURCE_UNAVAIL 0x20
524#define RSL_ERRCLS_SERVICE_UNAVAIL 0x30
525#define RSL_ERRCLS_SERVICE_UNIMPL 0x40
526#define RSL_ERRCLS_INVAL_MSG 0x50
527#define RSL_ERRCLS_PROTO_ERROR 0x60
528#define RSL_ERRCLS_INTERWORKING 0x70
529
530/* normal event */
531#define RSL_ERR_RADIO_IF_FAIL 0x00
532#define RSL_ERR_RADIO_LINK_FAIL 0x01
533#define RSL_ERR_HANDOVER_ACC_FAIL 0x02
534#define RSL_ERR_TALKER_ACC_FAIL 0x03
535#define RSL_ERR_OM_INTERVENTION 0x07
536#define RSL_ERR_NORMAL_UNSPEC 0x0f
537#define RSL_ERR_T_MSRFPCI_EXP 0x18
538/* resource unavailable */
539#define RSL_ERR_EQUIPMENT_FAIL 0x20
540#define RSL_ERR_RR_UNAVAIL 0x21
541#define RSL_ERR_TERR_CH_FAIL 0x22
542#define RSL_ERR_CCCH_OVERLOAD 0x23
543#define RSL_ERR_ACCH_OVERLOAD 0x24
544#define RSL_ERR_PROCESSOR_OVERLOAD 0x25
Philipp Maier6d214482020-07-28 16:53:27 +0200545#define RSL_ERR_BTS_NOT_EQUIPPED 0x27
546#define RSL_ERR_REMOTE_TRANSC_FAIL 0x28
547#define RSL_ERR_NOTIFICATION_OVERFL 0x29
Harald Welteec8b4502010-02-20 20:34:29 +0100548#define RSL_ERR_RES_UNAVAIL 0x2f
549/* service or option not available */
550#define RSL_ERR_TRANSC_UNAVAIL 0x30
551#define RSL_ERR_SERV_OPT_UNAVAIL 0x3f
552/* service or option not implemented */
553#define RSL_ERR_ENCR_UNIMPL 0x40
554#define RSL_ERR_SERV_OPT_UNIMPL 0x4f
555/* invalid message */
556#define RSL_ERR_RCH_ALR_ACTV_ALLOC 0x50
557#define RSL_ERR_INVALID_MESSAGE 0x5f
558/* protocol error */
559#define RSL_ERR_MSG_DISCR 0x60
560#define RSL_ERR_MSG_TYPE 0x61
561#define RSL_ERR_MSG_SEQ 0x62
562#define RSL_ERR_IE_ERROR 0x63
563#define RSL_ERR_MAND_IE_ERROR 0x64
564#define RSL_ERR_OPT_IE_ERROR 0x65
565#define RSL_ERR_IE_NONEXIST 0x66
566#define RSL_ERR_IE_LENGTH 0x67
567#define RSL_ERR_IE_CONTENT 0x68
568#define RSL_ERR_PROTO 0x6f
569/* interworking */
570#define RSL_ERR_INTERWORKING 0x7f
571
572/* Chapter 9.3.30 */
573#define RSL_SYSTEM_INFO_8 0x00
574#define RSL_SYSTEM_INFO_1 0x01
575#define RSL_SYSTEM_INFO_2 0x02
576#define RSL_SYSTEM_INFO_3 0x03
577#define RSL_SYSTEM_INFO_4 0x04
578#define RSL_SYSTEM_INFO_5 0x05
579#define RSL_SYSTEM_INFO_6 0x06
580#define RSL_SYSTEM_INFO_7 0x07
581#define RSL_SYSTEM_INFO_16 0x08
582#define RSL_SYSTEM_INFO_17 0x09
583#define RSL_SYSTEM_INFO_2bis 0x0a
584#define RSL_SYSTEM_INFO_2ter 0x0b
585#define RSL_SYSTEM_INFO_5bis 0x0d
586#define RSL_SYSTEM_INFO_5ter 0x0e
587#define RSL_SYSTEM_INFO_10 0x0f
Harald Welte3d732272011-06-25 21:39:01 +0200588#define RSL_EXT_MEAS_ORDER 0x47
Harald Welteec8b4502010-02-20 20:34:29 +0100589#define RSL_MEAS_INFO 0x48
590#define RSL_SYSTEM_INFO_13 0x28
Philipp00b15392016-11-14 12:34:15 +0100591#define RSL_ERIC_SYSTEM_INFO_13 0x0C
Harald Welteec8b4502010-02-20 20:34:29 +0100592#define RSL_SYSTEM_INFO_2quater 0x29
593#define RSL_SYSTEM_INFO_9 0x2a
594#define RSL_SYSTEM_INFO_18 0x2b
595#define RSL_SYSTEM_INFO_19 0x2c
596#define RSL_SYSTEM_INFO_20 0x2d
597
598/* Chapter 9.3.40 */
599#define RSL_CHANNEED_ANY 0x00
600#define RSL_CHANNEED_SDCCH 0x01
601#define RSL_CHANNEED_TCH_F 0x02
602#define RSL_CHANNEED_TCH_ForH 0x03
603
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200604/*! RSL Cell Broadcast Command (Chapter 9.3.45) */
Alex Badea84930182010-11-27 23:34:46 +0200605struct rsl_ie_cb_cmd_type {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100606#if OSMO_IS_LITTLE_ENDIAN
Alex Badea84930182010-11-27 23:34:46 +0200607 uint8_t last_block:2;
608 uint8_t spare:1;
609 uint8_t def_bcast:1;
610 uint8_t command:4;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100611#elif OSMO_IS_BIG_ENDIAN
612/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
613 uint8_t command:4, def_bcast:1, spare:1, last_block:2;
614#endif
Alex Badea84930182010-11-27 23:34:46 +0200615} __attribute__ ((packed));
616/* ->command */
617#define RSL_CB_CMD_TYPE_NORMAL 0x00
618#define RSL_CB_CMD_TYPE_SCHEDULE 0x08
619#define RSL_CB_CMD_TYPE_DEFAULT 0x0e
620#define RSL_CB_CMD_TYPE_NULL 0x0f
621/* ->def_bcast */
622#define RSL_CB_CMD_DEFBCAST_NORMAL 0
623#define RSL_CB_CMD_DEFBCAST_NULL 1
624/* ->last_block */
625#define RSL_CB_CMD_LASTBLOCK_4 0
626#define RSL_CB_CMD_LASTBLOCK_1 1
627#define RSL_CB_CMD_LASTBLOCK_2 2
628#define RSL_CB_CMD_LASTBLOCK_3 3
629
Harald Welteec8b4502010-02-20 20:34:29 +0100630/* Chapter 3.3.2.3 Brocast control channel */
631/* CCCH-CONF, NC is not combined */
632#define RSL_BCCH_CCCH_CONF_1_NC 0x00
633#define RSL_BCCH_CCCH_CONF_1_C 0x01
634#define RSL_BCCH_CCCH_CONF_2_NC 0x02
635#define RSL_BCCH_CCCH_CONF_3_NC 0x04
636#define RSL_BCCH_CCCH_CONF_4_NC 0x06
637
638/* BS-PA-MFRMS */
639#define RSL_BS_PA_MFRMS_2 0x00
640#define RSL_BS_PA_MFRMS_3 0x01
641#define RSL_BS_PA_MFRMS_4 0x02
642#define RSL_BS_PA_MFRMS_5 0x03
643#define RSL_BS_PA_MFRMS_6 0x04
644#define RSL_BS_PA_MFRMS_7 0x05
645#define RSL_BS_PA_MFRMS_8 0x06
646#define RSL_BS_PA_MFRMS_9 0x07
647
648/* RSL_IE_IPAC_RTP_PAYLOAD[2] */
649enum rsl_ipac_rtp_payload {
650 RSL_IPAC_RTP_GSM = 1,
651 RSL_IPAC_RTP_EFR,
652 RSL_IPAC_RTP_AMR,
653 RSL_IPAC_RTP_CSD,
654 RSL_IPAC_RTP_MUX,
655};
656
657/* RSL_IE_IPAC_SPEECH_MODE, lower four bits */
658enum rsl_ipac_speech_mode_s {
659 RSL_IPAC_SPEECH_GSM_FR = 0, /* GSM FR (Type 1, FS) */
660 RSL_IPAC_SPEECH_GSM_EFR = 1, /* GSM EFR (Type 2, FS) */
661 RSL_IPAC_SPEECH_GSM_AMR_FR = 2, /* GSM AMR/FR (Type 3, FS) */
662 RSL_IPAC_SPEECH_GSM_HR = 3, /* GSM HR (Type 1, HS) */
663 RSL_IPAC_SPEECH_GSM_AMR_HR = 5, /* GSM AMR/hr (Type 3, HS) */
664 RSL_IPAC_SPEECH_AS_RTP = 0xf, /* As specified by RTP Payload IE */
665};
666/* RSL_IE_IPAC_SPEECH_MODE, upper four bits */
667enum rsl_ipac_speech_mode_m {
668 RSL_IPAC_SPEECH_M_RXTX = 0, /* Send and Receive */
669 RSL_IPAC_SPEECH_M_RX = 1, /* Receive only */
670 RSL_IPAC_SPEECH_M_TX = 2, /* Send only */
671};
672
673/* RSL_IE_IPAC_RTP_CSD_FMT, lower four bits */
674enum rsl_ipac_rtp_csd_format_d {
675 RSL_IPAC_RTP_CSD_EXT_TRAU = 0,
676 RSL_IPAC_RTP_CSD_NON_TRAU = 1,
677 RSL_IPAC_RTP_CSD_TRAU_BTS = 2,
678 RSL_IPAC_RTP_CSD_IWF_FREE = 3,
679};
680/* RSL_IE_IPAC_RTP_CSD_FMT, upper four bits */
681enum rsl_ipac_rtp_csd_format_ir {
682 RSL_IPAC_RTP_CSD_IR_8k = 0,
683 RSL_IPAC_RTP_CSD_IR_16k = 1,
684 RSL_IPAC_RTP_CSD_IR_32k = 2,
685 RSL_IPAC_RTP_CSD_IR_64k = 3,
686};
687
688/* Siemens vendor-specific RSL extensions */
689struct rsl_mrpci {
690 uint8_t power_class:3,
691 vgcs_capable:1,
692 vbs_capable:1,
693 gsm_phase:2;
694} __attribute__ ((packed));
695
696enum rsl_mrpci_pwrclass {
697 RSL_MRPCI_PWRC_1 = 0,
698 RSL_MRPCI_PWRC_2 = 1,
699 RSL_MRPCI_PWRC_3 = 2,
700 RSL_MRPCI_PWRC_4 = 3,
701 RSL_MRPCI_PWRC_5 = 4,
702};
703enum rsl_mrpci_phase {
704 RSL_MRPCI_PHASE_1 = 0,
705 /* reserved */
706 RSL_MRPCI_PHASE_2 = 2,
707 RSL_MRPCI_PHASE_2PLUS = 3,
708};
709
Holger Hans Peter Freyther0357e9b2012-12-06 11:57:31 +0100710/* 9.3.20 Release Mode */
711enum rsl_rel_mode {
712 RSL_REL_NORMAL = 0,
713 RSL_REL_LOCAL_END = 1,
714};
715
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200716/*! ip.access specific embedded information elements */
Harald Weltefad57522015-12-13 11:56:36 +0100717enum rsl_ipac_embedded_ie {
718 RSL_IPAC_EIE_RXLEV = 0x00,
719 RSL_IPAC_EIE_RXQUAL = 0x01,
720 RSL_IPAC_EIE_FREQ_ERR = 0x02,
721 RSL_IPAC_EIE_TIMING_ERR = 0x03,
722 RSL_IPAC_EIE_MEAS_AVG_CFG = 0x04,
723 RSL_IPAC_EIE_BS_PWR_CTL = 0x05,
724 RSL_IPAC_EIE_MS_PWR_CTL = 0x06,
725 RSL_IPAC_EIE_HANDO_THRESH = 0x07,
726 RSL_IPAC_EIE_NCELL_DEFAULTS = 0x08,
727 RSL_IPAC_EIE_NCELL_LIST = 0x09,
728 RSL_IPAC_EIE_PC_THRESH_COMP = 0x0a,
729 RSL_IPAC_EIE_HO_THRESH_COMP = 0x0b,
730 RSL_IPAC_EIE_HO_CAUSE = 0x0c,
731 RSL_IPAC_EIE_HO_CANDIDATES = 0x0d,
732 RSL_IPAC_EIE_NCELL_BA_CHG_LIST = 0x0e,
733 RSL_IPAC_EIE_NUM_OF_MS = 0x10,
734 RSL_IPAC_EIE_HO_CAND_EXT = 0x11,
735 RSL_IPAC_EIE_NCELL_DEF_EXT = 0x12,
736 RSL_IPAC_EIE_NCELL_LIST_EXT = 0x13,
737 RSL_IPAC_EIE_MASTER_KEY = 0x14,
738 RSL_IPAC_EIE_MASTER_SALT = 0x15,
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400739 /* additional IPAC measurement pre-processing related IEI */
740 RSL_IPAC_EIE_MEAS_TRANS_RES = 0x16,
741 RSL_IPAC_EIE_3G_HO_PARAM = 0x17,
742 RSL_IPAC_EIE_3G_NCELL_LIST = 0x18,
743 RSL_IPAC_EIE_SDCCH_CTL_PARAM = 0x1a,
744 RSL_IPAC_EIE_AMR_CONV_THRESH = 0x1b,
745
746};
747
748struct ipac_preproc_ave_cfg {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100749#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400750 uint8_t h_reqave:5,
751 param_id:2,
752 reserved:1;
753 uint8_t h_reqt:5,
754 ave_method:3;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100755#elif OSMO_IS_BIG_ENDIAN
756/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
757 uint8_t reserved:1, param_id:2, h_reqave:5;
758 uint8_t ave_method:3, h_reqt:5;
759#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400760}__attribute__ ((packed));
761
762struct ipac_preproc_ho_thresh {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100763#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400764 uint8_t l_rxlev_ul_h:6,
765 reserved_l_rxlev_ul:2;
766 uint8_t l_rxlev_dl_h:6,
767 reserved_l_rxlev_dl:2;
768 uint8_t rxlev_ul_ih:6,
769 reserved_rxlev_ul:2;
770 uint8_t rxlev_dl_ih:6,
771 reserved_rxlev_dl:2;
772 uint8_t l_rxqual_ul_h:3,
773 reserved_rxlqual_ul:1,
774 l_rxqual_dl_h:3,
775 reserved_rxqual_dl:1;
776 uint8_t ms_range_max:6,
777 reserved_ms_range:2;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100778#elif OSMO_IS_BIG_ENDIAN
779/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
780 uint8_t reserved_l_rxlev_ul:2, l_rxlev_ul_h:6;
781 uint8_t reserved_l_rxlev_dl:2, l_rxlev_dl_h:6;
782 uint8_t reserved_rxlev_ul:2, rxlev_ul_ih:6;
783 uint8_t reserved_rxlev_dl:2, rxlev_dl_ih:6;
784 uint8_t reserved_rxqual_dl:1, l_rxqual_dl_h:3, reserved_rxlqual_ul:1, l_rxqual_ul_h:3;
785 uint8_t reserved_ms_range:2, ms_range_max:6;
786#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400787}__attribute__ ((packed));
788
789struct ipac_preproc_ho_comp {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100790#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400791 uint8_t p5:5,
792 reserved_p5:3;
793 uint8_t n5:5,
794 reserved_n5:3;
795 uint8_t p6:5,
796 reserved_p6:3;
797 uint8_t n6:5,
798 reserved_n6:3;
799 uint8_t p7:5,
800 reserved_p7:3;
801 uint8_t n7:5,
802 reserved_n7:3;
803 uint8_t p8:5,
804 reserved_p8:3;
805 uint8_t n8:5,
806 reserved_n8:3;
807 uint8_t ho_interval:5,
808 reserved_ho:3;
809 uint8_t reserved;
810
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100811#elif OSMO_IS_BIG_ENDIAN
812/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
813 uint8_t reserved_p5:3, p5:5;
814 uint8_t reserved_n5:3, n5:5;
815 uint8_t reserved_p6:3, p6:5;
816 uint8_t reserved_n6:3, n6:5;
817 uint8_t reserved_p7:3, p7:5;
818 uint8_t reserved_n7:3, n7:5;
819 uint8_t reserved_p8:3, p8:5;
820 uint8_t reserved_n8:3, n8:5;
821 uint8_t reserved_ho:3, ho_interval:5;
822 uint8_t reserved;
823#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400824}__attribute__ ((packed));
825
826struct ipac_preproc_ho_candidates {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100827#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400828 uint8_t bsic:6,
829 reserved0:2;
830 uint8_t bcch_freq:5,
831 ba_used:1,
832 s:1,
833 reserved1:1;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100834#elif OSMO_IS_BIG_ENDIAN
835/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
836 uint8_t reserved0:2, bsic:6;
837 uint8_t reserved1:1, s:1, ba_used:1, bcch_freq:5;
838#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400839}__attribute__ ((packed));
840
841struct ipac_preproc_ncell_dflts {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100842#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400843 uint8_t rxlev_min_def:6,
844 reserved_rxlev_min_def:2;
845 uint8_t ho_margin_def:5,
846 reserved_ho_margin_def:3;
847 uint8_t ms_txpwr_max_def:5,
848 reserved_ms_txpwr_max_def:3;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100849#elif OSMO_IS_BIG_ENDIAN
850/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
851 uint8_t reserved_rxlev_min_def:2, rxlev_min_def:6;
852 uint8_t reserved_ho_margin_def:3, ho_margin_def:5;
853 uint8_t reserved_ms_txpwr_max_def:3, ms_txpwr_max_def:5;
854#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400855}__attribute__ ((packed));
856
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -0500857struct ipac_preproc_ho_ctl_param {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100858#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -0500859 uint8_t sdcch_ho_gsm:1,
860 sdcch_ho_umts:1,
861 reserved:6;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100862#elif OSMO_IS_BIG_ENDIAN
863/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
864 uint8_t reserved:6, sdcch_ho_umts:1, sdcch_ho_gsm:1;
865#endif
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -0500866}__attribute__ ((packed));
867
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400868struct ipac_preproc_cfg {
869 uint8_t meas_rep_mode;
870 uint32_t meas_mode_flags;
871 struct ipac_preproc_ave_cfg ms_ave_cfg[3];
872 struct ipac_preproc_ave_cfg ave_cfg;
873 struct ipac_preproc_ho_thresh ho_thresh;
874 struct ipac_preproc_ho_comp ho_comp;
875 struct ipac_preproc_ncell_dflts ncell_dflts;
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -0500876 struct ipac_preproc_ho_ctl_param ho_ctl_param;
Harald Weltefad57522015-12-13 11:56:36 +0100877};
878
Sylvain Munautdca7d2c2012-04-18 21:53:23 +0200879/*! @} */