blob: 1d4530d1b5a01fc717122001ba8264fc5c907597 [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,
239};
240
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200241/*! Siemens vendor-specific RSL message types */
Harald Welteec8b4502010-02-20 20:34:29 +0100242enum abis_rsl_msgtype_siemens {
243 RSL_MT_SIEMENS_MRPCI = 0x41,
244 RSL_MT_SIEMENS_INTRAC_HO_COND_IND = 0x42,
245 RSL_MT_SIEMENS_INTERC_HO_COND_IND = 0x43,
246 RSL_MT_SIEMENS_FORCED_HO_REQ = 0x44,
247 RSL_MT_SIEMENS_PREF_AREA_REQ = 0x45,
248 RSL_MT_SIEMENS_PREF_AREA = 0x46,
249 RSL_MT_SIEMENS_START_TRACE = 0x47,
250 RSL_MT_SIEMENS_START_TRACE_ACK = 0x48,
251 RSL_MT_SIEMENS_STOP_TRACE = 0x49,
252 RSL_MT_SIEMENS_TRMR = 0x4a,
253 RSL_MT_SIEMENS_HO_FAIL_IND = 0x4b,
254 RSL_MT_SIEMENS_STOP_TRACE_ACK = 0x4c,
255 RSL_MT_SIEMENS_UPLF = 0x4d,
256 RSL_MT_SIEMENS_UPLB = 0x4e,
257 RSL_MT_SIEMENS_SET_SYS_INFO_10 = 0x4f,
258 RSL_MT_SIEMENS_MODIF_COND_IND = 0x50,
259};
260
Pau Espin Pedrol95959a82018-04-21 22:47:54 +0200261/*! Ericsson vendor-specific RSL message types */
262enum abis_rsl_msgtype_ericsson {
263 RSL_MT_ERICSSON_IMM_ASS_SENT = 0x10,
264};
265
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200266/*! RSL Information Element Identifiers (Chapter 9.3) */
Harald Welteec8b4502010-02-20 20:34:29 +0100267enum abis_rsl_ie {
268 RSL_IE_CHAN_NR = 0x01,
269 RSL_IE_LINK_IDENT,
270 RSL_IE_ACT_TYPE,
271 RSL_IE_BS_POWER,
272 RSL_IE_CHAN_IDENT,
273 RSL_IE_CHAN_MODE,
274 RSL_IE_ENCR_INFO,
275 RSL_IE_FRAME_NUMBER,
276 RSL_IE_HANDO_REF,
277 RSL_IE_L1_INFO,
278 RSL_IE_L3_INFO,
279 RSL_IE_MS_IDENTITY,
280 RSL_IE_MS_POWER,
281 RSL_IE_PAGING_GROUP,
282 RSL_IE_PAGING_LOAD,
283 RSL_IE_PYHS_CONTEXT = 0x10,
284 RSL_IE_ACCESS_DELAY,
285 RSL_IE_RACH_LOAD,
286 RSL_IE_REQ_REFERENCE,
287 RSL_IE_RELEASE_MODE,
288 RSL_IE_RESOURCE_INFO,
289 RSL_IE_RLM_CAUSE,
290 RSL_IE_STARTNG_TIME,
291 RSL_IE_TIMING_ADVANCE,
292 RSL_IE_UPLINK_MEAS,
293 RSL_IE_CAUSE,
294 RSL_IE_MEAS_RES_NR,
295 RSL_IE_MSG_ID,
296 /* reserved */
297 RSL_IE_SYSINFO_TYPE = 0x1e,
298 RSL_IE_MS_POWER_PARAM,
299 RSL_IE_BS_POWER_PARAM,
300 RSL_IE_PREPROC_PARAM,
301 RSL_IE_PREPROC_MEAS,
302 RSL_IE_IMM_ASS_INFO, /* Phase 1 (3.6.0), later Full below */
303 RSL_IE_SMSCB_INFO = 0x24,
304 RSL_IE_MS_TIMING_OFFSET,
305 RSL_IE_ERR_MSG,
306 RSL_IE_FULL_BCCH_INFO,
307 RSL_IE_CHAN_NEEDED,
308 RSL_IE_CB_CMD_TYPE,
309 RSL_IE_SMSCB_MSG,
310 RSL_IE_FULL_IMM_ASS_INFO,
311 RSL_IE_SACCH_INFO,
312 RSL_IE_CBCH_LOAD_INFO,
313 RSL_IE_SMSCB_CHAN_INDICATOR,
314 RSL_IE_GROUP_CALL_REF,
315 RSL_IE_CHAN_DESC = 0x30,
316 RSL_IE_NCH_DRX_INFO,
317 RSL_IE_CMD_INDICATOR,
318 RSL_IE_EMLPP_PRIO,
319 RSL_IE_UIC,
320 RSL_IE_MAIN_CHAN_REF,
321 RSL_IE_MR_CONFIG,
322 RSL_IE_MR_CONTROL,
323 RSL_IE_SUP_CODEC_TYPES,
324 RSL_IE_CODEC_CONFIG,
325 RSL_IE_RTD,
326 RSL_IE_TFO_STATUS,
327 RSL_IE_LLP_APDU,
328 /* Siemens vendor-specific */
329 RSL_IE_SIEMENS_MRPCI = 0x40,
330 RSL_IE_SIEMENS_PREF_AREA_TYPE = 0x43,
331 RSL_IE_SIEMENS_ININ_CELL_HO_PAR = 0x45,
332 RSL_IE_SIEMENS_TRACE_REF_NR = 0x46,
333 RSL_IE_SIEMENS_INT_TRACE_IDX = 0x47,
334 RSL_IE_SIEMENS_L2_HDR_INFO = 0x48,
335 RSL_IE_SIEMENS_HIGHEST_RATE = 0x4e,
336 RSL_IE_SIEMENS_SUGGESTED_RATE = 0x4f,
337
338 /* ip.access */
339 RSL_IE_IPAC_SRTP_CONFIG = 0xe0,
340 RSL_IE_IPAC_PROXY_UDP = 0xe1,
341 RSL_IE_IPAC_BSCMPL_TOUT = 0xe2,
342 RSL_IE_IPAC_REMOTE_IP = 0xf0,
343 RSL_IE_IPAC_REMOTE_PORT = 0xf1,
344 RSL_IE_IPAC_RTP_PAYLOAD = 0xf2,
345 RSL_IE_IPAC_LOCAL_PORT = 0xf3,
346 RSL_IE_IPAC_SPEECH_MODE = 0xf4,
347 RSL_IE_IPAC_LOCAL_IP = 0xf5,
348 RSL_IE_IPAC_CONN_STAT = 0xf6,
349 RSL_IE_IPAC_HO_C_PARMS = 0xf7,
350 RSL_IE_IPAC_CONN_ID = 0xf8,
351 RSL_IE_IPAC_RTP_CSD_FMT = 0xf9,
352 RSL_IE_IPAC_RTP_JIT_BUF = 0xfa,
353 RSL_IE_IPAC_RTP_COMPR = 0xfb,
354 RSL_IE_IPAC_RTP_PAYLOAD2= 0xfc,
355 RSL_IE_IPAC_RTP_MPLEX = 0xfd,
356 RSL_IE_IPAC_RTP_MPLEX_ID= 0xfe,
357};
358
Harald Welte6e363e72016-11-16 16:58:52 +0100359/* Ericsson specific IEs, clash with above partially, so they're not
360 * part of the enum */
Alexander Couzens9f39d892018-04-21 21:20:25 +0200361#define RSL_IE_ERIC_PAGING_GROUP 0x0e
Harald Welte6e363e72016-11-16 16:58:52 +0100362#define RSL_IE_ERIC_INST_NR 0x48
363#define RSL_IE_ERIC_PGSL_TIMERS 0x49
364#define RSL_IE_ERIC_REPEAT_DL_FACCH 0x4a
365#define RSL_IE_ERIC_POWER_INFO 0xf0
366#define RSL_IE_ERIC_MOBILE_ID 0xf1
367#define RSL_IE_ERIC_BCCH_MAPPING 0xf2
368#define RSL_IE_ERIC_PACKET_PAG_IND 0xf3
369#define RSL_IE_ERIC_CNTR_CTRL 0xf4
370#define RSL_IE_ERIC_CNTR_CTRL_ACK 0xf5
371#define RSL_IE_ERIC_CNTR_REPORT 0xf6
372#define RSL_IE_ERIC_ICP_CONN 0xf7
373#define RSL_IE_ERIC_EMR_SUPPORT 0xf8
374#define RSL_IE_ERIC_EGPRS_REQ_REF 0xf9
375#define RSL_IE_ERIC_VGCS_REL 0xfa
376#define RSL_IE_ERIC_REP_PER_NCH 0xfb
377#define RSL_IE_ERIC_NY2 0xfc
378#define RSL_IE_ERIC_T3115 0xfd
379#define RSL_IE_ERIC_ACTIVATE_FLAG 0xfe
380#define RSL_IE_ERIC_FULL_NCH_INFO 0xff
381
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400382/* IPAC MEAS_PREPROC AVERAGING METHOD */
383enum {
384 IPAC_UNWEIGHTED_AVE = 0,
385 IPAC_WEIGHTED_AVE,
386 IPAC_MEDIAN_AVE
387};
388
389/* IPAC MEAS_PREPROC AVERAGING PARAMID */
390enum {
391 IPAC_RXLEV_AVE = 0,
392 IPAC_RXQUAL_AVE,
393 IPAC_MS_BTS_DIS_AVE
394};
395
396/* IPAC MEAS_PREPROC HO CAUSES */
397enum {
398 IPAC_HO_RQD_CAUSE_L_RXLEV_UL_H = 0x01,
399 IPAC_HO_RQD_CAUSE_L_RXLEV_DL_H,
400 IPAC_HO_RQD_CAUSE_L_RXQUAL_UL_H,
401 IPAC_HO_RQD_CAUSE_L_RXQUAL_DL_H,
402 IPAC_HO_RQD_CAUSE_RXLEV_UL_IH,
403 IPAC_HO_RQD_CAUSE_RXLEV_DL_IH,
404 IPAC_HO_RQD_CAUSE_MAX_MS_RANGE,
405 IPAC_HO_RQD_CAUSE_POWER_BUDGET,
406 IPAC_HO_RQD_CAUSE_ENQUIRY,
407 IPAC_HO_RQD_CAUSE_ENQUIRY_FAILED,
408 IPAC_HO_RQD_CAUSE_NORMAL3G,
409 IPAC_HO_RQD_CAUSE_EMERGENCY3G,
410 IPAC_HO_RQD_CAUSE_SERVICE_PREFERRED3G,
411 IPAC_HO_RQD_CAUSE_O_M_SHUTDOWN,
412 IPAC_HO_RQD_CAUSE_QUALITY_PROMOTION,
413 IPAC_HO_RQD_CAUSE_LOAD_PROMOTION,
414 IPAC_HO_RQD_CAUSE_LOAD_DEMOTION,
415 IPAC_HO_RQD_CAUSE_MAX,
416};
417
Harald Welteec8b4502010-02-20 20:34:29 +0100418/* Chapter 9.3.1 */
419#define RSL_CHAN_NR_MASK 0xf8
Neels Hofmeyr15b96ff2016-07-18 23:33:48 +0200420#define RSL_CHAN_NR_1 0x08 /*< bit to add for 2nd,... lchan */
Harald Welteec8b4502010-02-20 20:34:29 +0100421#define RSL_CHAN_Bm_ACCHs 0x08
422#define RSL_CHAN_Lm_ACCHs 0x10 /* .. 0x18 */
423#define RSL_CHAN_SDCCH4_ACCH 0x20 /* .. 0x38 */
424#define RSL_CHAN_SDCCH8_ACCH 0x40 /* ...0x78 */
425#define RSL_CHAN_BCCH 0x80
426#define RSL_CHAN_RACH 0x88
427#define RSL_CHAN_PCH_AGCH 0x90
Neels Hofmeyrfd80f5a2016-07-14 03:21:05 +0200428#define RSL_CHAN_OSMO_PDCH 0xc0 /*< non-standard, for dyn TS */
Harald Weltea8d7ebb2019-05-27 16:51:23 +0200429#define RSL_CHAN_OSMO_CBCH4 0xc8 /*< non-standard, for CBCH/SDCCH4 */
430#define RSL_CHAN_OSMO_CBCH8 0xd0 /*< non-standard, for CBCH/SDCCH8 */
Harald Welteec8b4502010-02-20 20:34:29 +0100431
432/* Chapter 9.3.3 */
433#define RSL_ACT_TYPE_INITIAL 0x00
434#define RSL_ACT_TYPE_REACT 0x80
435#define RSL_ACT_INTRA_IMM_ASS 0x00
436#define RSL_ACT_INTRA_NORM_ASS 0x01
437#define RSL_ACT_INTER_ASYNC 0x02
438#define RSL_ACT_INTER_SYNC 0x03
439#define RSL_ACT_SECOND_ADD 0x04
440#define RSL_ACT_SECOND_MULTI 0x05
Neels Hofmeyrfd80f5a2016-07-14 03:21:05 +0200441#define RSL_ACT_OSMO_PDCH 0x0f /*< non-standard, for dyn TS */
Harald Welteec8b4502010-02-20 20:34:29 +0100442
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200443/*! RSL Channel Mode IF (Chapter 9.3.6) */
Harald Welteec8b4502010-02-20 20:34:29 +0100444struct rsl_ie_chan_mode {
445 uint8_t dtx_dtu;
446 uint8_t spd_ind;
447 uint8_t chan_rt;
448 uint8_t chan_rate;
449} __attribute__ ((packed));
450#define RSL_CMOD_DTXu 0x01 /* uplink */
451#define RSL_CMOD_DTXd 0x02 /* downlink */
452enum rsl_cmod_spd {
453 RSL_CMOD_SPD_SPEECH = 0x01,
454 RSL_CMOD_SPD_DATA = 0x02,
455 RSL_CMOD_SPD_SIGN = 0x03,
456};
457#define RSL_CMOD_CRT_SDCCH 0x01
458#define RSL_CMOD_CRT_TCH_Bm 0x08 /* full-rate */
459#define RSL_CMOD_CRT_TCH_Lm 0x09 /* half-rate */
460/* FIXME: More CRT types */
461/* Speech */
462#define RSL_CMOD_SP_GSM1 0x01
463#define RSL_CMOD_SP_GSM2 0x11
464#define RSL_CMOD_SP_GSM3 0x21
Harald Welteeed26112012-08-24 15:35:34 +0200465/* non-transparent data */
466#define RSL_CMOD_CSD_NT_43k5 0x74
467#define RSL_CMOD_CSD_NT_28k8 0x71
468#define RSL_CMOD_CSD_NT_14k5 0x58
469#define RSL_CMOD_CSD_NT_12k0 0x50
470#define RSL_CMOD_CSD_NT_6k0 0x51
471/* legacy #defines with wrong name */
472#define RSL_CMOD_SP_NT_14k5 RSL_CMOD_CSD_NT_14k5
473#define RSL_CMOD_SP_NT_12k0 RSL_CMOD_CSD_NT_12k0
474#define RSL_CMOD_SP_NT_6k0 RSL_CMOD_CSD_NT_6k0
475/* transparent data */
476#define RSL_CMOD_CSD_T_32000 0x38
477#define RSL_CMOD_CSD_T_29000 0x39
478#define RSL_CMOD_CSD_T_14400 0x18
479#define RSL_CMOD_CSD_T_9600 0x10
480#define RSL_CMOD_CSD_T_4800 0x11
481#define RSL_CMOD_CSD_T_2400 0x12
482#define RSL_CMOD_CSD_T_1200 0x13
483#define RSL_CMOD_CSD_T_600 0x14
484#define RSL_CMOD_CSD_T_1200_75 0x15
Harald Welteec8b4502010-02-20 20:34:29 +0100485
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200486/*! RSL Channel Identification IE (Chapter 9.3.5) */
Harald Welteec8b4502010-02-20 20:34:29 +0100487struct rsl_ie_chan_ident {
488 /* GSM 04.08 10.5.2.5 */
489 struct {
490 uint8_t iei;
491 uint8_t chan_nr; /* enc_chan_nr */
492 uint8_t oct3;
493 uint8_t oct4;
494 } chan_desc;
495#if 0 /* spec says we need this but Abissim doesn't use it */
496 struct {
497 uint8_t tag;
498 uint8_t len;
499 } mobile_alloc;
500#endif
501} __attribute__ ((packed));
502
503/* Chapter 9.3.22 */
504#define RLL_CAUSE_T200_EXPIRED 0x01
505#define RLL_CAUSE_REEST_REQ 0x02
506#define RLL_CAUSE_UNSOL_UA_RESP 0x03
507#define RLL_CAUSE_UNSOL_DM_RESP 0x04
508#define RLL_CAUSE_UNSOL_DM_RESP_MF 0x05
509#define RLL_CAUSE_UNSOL_SPRV_RESP 0x06
510#define RLL_CAUSE_SEQ_ERR 0x07
511#define RLL_CAUSE_UFRM_INC_PARAM 0x08
512#define RLL_CAUSE_SFRM_INC_PARAM 0x09
513#define RLL_CAUSE_IFRM_INC_MBITS 0x0a
514#define RLL_CAUSE_IFRM_INC_LEN 0x0b
515#define RLL_CAUSE_FRM_UNIMPL 0x0c
516#define RLL_CAUSE_SABM_MF 0x0d
517#define RLL_CAUSE_SABM_INFO_NOTALL 0x0e
518
519/* Chapter 9.3.26 */
520#define RSL_ERRCLS_NORMAL 0x00
521#define RSL_ERRCLS_RESOURCE_UNAVAIL 0x20
522#define RSL_ERRCLS_SERVICE_UNAVAIL 0x30
523#define RSL_ERRCLS_SERVICE_UNIMPL 0x40
524#define RSL_ERRCLS_INVAL_MSG 0x50
525#define RSL_ERRCLS_PROTO_ERROR 0x60
526#define RSL_ERRCLS_INTERWORKING 0x70
527
528/* normal event */
529#define RSL_ERR_RADIO_IF_FAIL 0x00
530#define RSL_ERR_RADIO_LINK_FAIL 0x01
531#define RSL_ERR_HANDOVER_ACC_FAIL 0x02
532#define RSL_ERR_TALKER_ACC_FAIL 0x03
533#define RSL_ERR_OM_INTERVENTION 0x07
534#define RSL_ERR_NORMAL_UNSPEC 0x0f
535#define RSL_ERR_T_MSRFPCI_EXP 0x18
536/* resource unavailable */
537#define RSL_ERR_EQUIPMENT_FAIL 0x20
538#define RSL_ERR_RR_UNAVAIL 0x21
539#define RSL_ERR_TERR_CH_FAIL 0x22
540#define RSL_ERR_CCCH_OVERLOAD 0x23
541#define RSL_ERR_ACCH_OVERLOAD 0x24
542#define RSL_ERR_PROCESSOR_OVERLOAD 0x25
543#define RSL_ERR_RES_UNAVAIL 0x2f
544/* service or option not available */
545#define RSL_ERR_TRANSC_UNAVAIL 0x30
546#define RSL_ERR_SERV_OPT_UNAVAIL 0x3f
547/* service or option not implemented */
548#define RSL_ERR_ENCR_UNIMPL 0x40
549#define RSL_ERR_SERV_OPT_UNIMPL 0x4f
550/* invalid message */
551#define RSL_ERR_RCH_ALR_ACTV_ALLOC 0x50
552#define RSL_ERR_INVALID_MESSAGE 0x5f
553/* protocol error */
554#define RSL_ERR_MSG_DISCR 0x60
555#define RSL_ERR_MSG_TYPE 0x61
556#define RSL_ERR_MSG_SEQ 0x62
557#define RSL_ERR_IE_ERROR 0x63
558#define RSL_ERR_MAND_IE_ERROR 0x64
559#define RSL_ERR_OPT_IE_ERROR 0x65
560#define RSL_ERR_IE_NONEXIST 0x66
561#define RSL_ERR_IE_LENGTH 0x67
562#define RSL_ERR_IE_CONTENT 0x68
563#define RSL_ERR_PROTO 0x6f
564/* interworking */
565#define RSL_ERR_INTERWORKING 0x7f
566
567/* Chapter 9.3.30 */
568#define RSL_SYSTEM_INFO_8 0x00
569#define RSL_SYSTEM_INFO_1 0x01
570#define RSL_SYSTEM_INFO_2 0x02
571#define RSL_SYSTEM_INFO_3 0x03
572#define RSL_SYSTEM_INFO_4 0x04
573#define RSL_SYSTEM_INFO_5 0x05
574#define RSL_SYSTEM_INFO_6 0x06
575#define RSL_SYSTEM_INFO_7 0x07
576#define RSL_SYSTEM_INFO_16 0x08
577#define RSL_SYSTEM_INFO_17 0x09
578#define RSL_SYSTEM_INFO_2bis 0x0a
579#define RSL_SYSTEM_INFO_2ter 0x0b
580#define RSL_SYSTEM_INFO_5bis 0x0d
581#define RSL_SYSTEM_INFO_5ter 0x0e
582#define RSL_SYSTEM_INFO_10 0x0f
Harald Welte3d732272011-06-25 21:39:01 +0200583#define RSL_EXT_MEAS_ORDER 0x47
Harald Welteec8b4502010-02-20 20:34:29 +0100584#define RSL_MEAS_INFO 0x48
585#define RSL_SYSTEM_INFO_13 0x28
Philipp00b15392016-11-14 12:34:15 +0100586#define RSL_ERIC_SYSTEM_INFO_13 0x0C
Harald Welteec8b4502010-02-20 20:34:29 +0100587#define RSL_SYSTEM_INFO_2quater 0x29
588#define RSL_SYSTEM_INFO_9 0x2a
589#define RSL_SYSTEM_INFO_18 0x2b
590#define RSL_SYSTEM_INFO_19 0x2c
591#define RSL_SYSTEM_INFO_20 0x2d
592
593/* Chapter 9.3.40 */
594#define RSL_CHANNEED_ANY 0x00
595#define RSL_CHANNEED_SDCCH 0x01
596#define RSL_CHANNEED_TCH_F 0x02
597#define RSL_CHANNEED_TCH_ForH 0x03
598
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200599/*! RSL Cell Broadcast Command (Chapter 9.3.45) */
Alex Badea84930182010-11-27 23:34:46 +0200600struct rsl_ie_cb_cmd_type {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100601#if OSMO_IS_LITTLE_ENDIAN
Alex Badea84930182010-11-27 23:34:46 +0200602 uint8_t last_block:2;
603 uint8_t spare:1;
604 uint8_t def_bcast:1;
605 uint8_t command:4;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100606#elif OSMO_IS_BIG_ENDIAN
607/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
608 uint8_t command:4, def_bcast:1, spare:1, last_block:2;
609#endif
Alex Badea84930182010-11-27 23:34:46 +0200610} __attribute__ ((packed));
611/* ->command */
612#define RSL_CB_CMD_TYPE_NORMAL 0x00
613#define RSL_CB_CMD_TYPE_SCHEDULE 0x08
614#define RSL_CB_CMD_TYPE_DEFAULT 0x0e
615#define RSL_CB_CMD_TYPE_NULL 0x0f
616/* ->def_bcast */
617#define RSL_CB_CMD_DEFBCAST_NORMAL 0
618#define RSL_CB_CMD_DEFBCAST_NULL 1
619/* ->last_block */
620#define RSL_CB_CMD_LASTBLOCK_4 0
621#define RSL_CB_CMD_LASTBLOCK_1 1
622#define RSL_CB_CMD_LASTBLOCK_2 2
623#define RSL_CB_CMD_LASTBLOCK_3 3
624
Harald Welteec8b4502010-02-20 20:34:29 +0100625/* Chapter 3.3.2.3 Brocast control channel */
626/* CCCH-CONF, NC is not combined */
627#define RSL_BCCH_CCCH_CONF_1_NC 0x00
628#define RSL_BCCH_CCCH_CONF_1_C 0x01
629#define RSL_BCCH_CCCH_CONF_2_NC 0x02
630#define RSL_BCCH_CCCH_CONF_3_NC 0x04
631#define RSL_BCCH_CCCH_CONF_4_NC 0x06
632
633/* BS-PA-MFRMS */
634#define RSL_BS_PA_MFRMS_2 0x00
635#define RSL_BS_PA_MFRMS_3 0x01
636#define RSL_BS_PA_MFRMS_4 0x02
637#define RSL_BS_PA_MFRMS_5 0x03
638#define RSL_BS_PA_MFRMS_6 0x04
639#define RSL_BS_PA_MFRMS_7 0x05
640#define RSL_BS_PA_MFRMS_8 0x06
641#define RSL_BS_PA_MFRMS_9 0x07
642
643/* RSL_IE_IPAC_RTP_PAYLOAD[2] */
644enum rsl_ipac_rtp_payload {
645 RSL_IPAC_RTP_GSM = 1,
646 RSL_IPAC_RTP_EFR,
647 RSL_IPAC_RTP_AMR,
648 RSL_IPAC_RTP_CSD,
649 RSL_IPAC_RTP_MUX,
650};
651
652/* RSL_IE_IPAC_SPEECH_MODE, lower four bits */
653enum rsl_ipac_speech_mode_s {
654 RSL_IPAC_SPEECH_GSM_FR = 0, /* GSM FR (Type 1, FS) */
655 RSL_IPAC_SPEECH_GSM_EFR = 1, /* GSM EFR (Type 2, FS) */
656 RSL_IPAC_SPEECH_GSM_AMR_FR = 2, /* GSM AMR/FR (Type 3, FS) */
657 RSL_IPAC_SPEECH_GSM_HR = 3, /* GSM HR (Type 1, HS) */
658 RSL_IPAC_SPEECH_GSM_AMR_HR = 5, /* GSM AMR/hr (Type 3, HS) */
659 RSL_IPAC_SPEECH_AS_RTP = 0xf, /* As specified by RTP Payload IE */
660};
661/* RSL_IE_IPAC_SPEECH_MODE, upper four bits */
662enum rsl_ipac_speech_mode_m {
663 RSL_IPAC_SPEECH_M_RXTX = 0, /* Send and Receive */
664 RSL_IPAC_SPEECH_M_RX = 1, /* Receive only */
665 RSL_IPAC_SPEECH_M_TX = 2, /* Send only */
666};
667
668/* RSL_IE_IPAC_RTP_CSD_FMT, lower four bits */
669enum rsl_ipac_rtp_csd_format_d {
670 RSL_IPAC_RTP_CSD_EXT_TRAU = 0,
671 RSL_IPAC_RTP_CSD_NON_TRAU = 1,
672 RSL_IPAC_RTP_CSD_TRAU_BTS = 2,
673 RSL_IPAC_RTP_CSD_IWF_FREE = 3,
674};
675/* RSL_IE_IPAC_RTP_CSD_FMT, upper four bits */
676enum rsl_ipac_rtp_csd_format_ir {
677 RSL_IPAC_RTP_CSD_IR_8k = 0,
678 RSL_IPAC_RTP_CSD_IR_16k = 1,
679 RSL_IPAC_RTP_CSD_IR_32k = 2,
680 RSL_IPAC_RTP_CSD_IR_64k = 3,
681};
682
683/* Siemens vendor-specific RSL extensions */
684struct rsl_mrpci {
685 uint8_t power_class:3,
686 vgcs_capable:1,
687 vbs_capable:1,
688 gsm_phase:2;
689} __attribute__ ((packed));
690
691enum rsl_mrpci_pwrclass {
692 RSL_MRPCI_PWRC_1 = 0,
693 RSL_MRPCI_PWRC_2 = 1,
694 RSL_MRPCI_PWRC_3 = 2,
695 RSL_MRPCI_PWRC_4 = 3,
696 RSL_MRPCI_PWRC_5 = 4,
697};
698enum rsl_mrpci_phase {
699 RSL_MRPCI_PHASE_1 = 0,
700 /* reserved */
701 RSL_MRPCI_PHASE_2 = 2,
702 RSL_MRPCI_PHASE_2PLUS = 3,
703};
704
Holger Hans Peter Freyther0357e9b2012-12-06 11:57:31 +0100705/* 9.3.20 Release Mode */
706enum rsl_rel_mode {
707 RSL_REL_NORMAL = 0,
708 RSL_REL_LOCAL_END = 1,
709};
710
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200711/*! ip.access specific embedded information elements */
Harald Weltefad57522015-12-13 11:56:36 +0100712enum rsl_ipac_embedded_ie {
713 RSL_IPAC_EIE_RXLEV = 0x00,
714 RSL_IPAC_EIE_RXQUAL = 0x01,
715 RSL_IPAC_EIE_FREQ_ERR = 0x02,
716 RSL_IPAC_EIE_TIMING_ERR = 0x03,
717 RSL_IPAC_EIE_MEAS_AVG_CFG = 0x04,
718 RSL_IPAC_EIE_BS_PWR_CTL = 0x05,
719 RSL_IPAC_EIE_MS_PWR_CTL = 0x06,
720 RSL_IPAC_EIE_HANDO_THRESH = 0x07,
721 RSL_IPAC_EIE_NCELL_DEFAULTS = 0x08,
722 RSL_IPAC_EIE_NCELL_LIST = 0x09,
723 RSL_IPAC_EIE_PC_THRESH_COMP = 0x0a,
724 RSL_IPAC_EIE_HO_THRESH_COMP = 0x0b,
725 RSL_IPAC_EIE_HO_CAUSE = 0x0c,
726 RSL_IPAC_EIE_HO_CANDIDATES = 0x0d,
727 RSL_IPAC_EIE_NCELL_BA_CHG_LIST = 0x0e,
728 RSL_IPAC_EIE_NUM_OF_MS = 0x10,
729 RSL_IPAC_EIE_HO_CAND_EXT = 0x11,
730 RSL_IPAC_EIE_NCELL_DEF_EXT = 0x12,
731 RSL_IPAC_EIE_NCELL_LIST_EXT = 0x13,
732 RSL_IPAC_EIE_MASTER_KEY = 0x14,
733 RSL_IPAC_EIE_MASTER_SALT = 0x15,
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400734 /* additional IPAC measurement pre-processing related IEI */
735 RSL_IPAC_EIE_MEAS_TRANS_RES = 0x16,
736 RSL_IPAC_EIE_3G_HO_PARAM = 0x17,
737 RSL_IPAC_EIE_3G_NCELL_LIST = 0x18,
738 RSL_IPAC_EIE_SDCCH_CTL_PARAM = 0x1a,
739 RSL_IPAC_EIE_AMR_CONV_THRESH = 0x1b,
740
741};
742
743struct ipac_preproc_ave_cfg {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100744#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400745 uint8_t h_reqave:5,
746 param_id:2,
747 reserved:1;
748 uint8_t h_reqt:5,
749 ave_method:3;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100750#elif OSMO_IS_BIG_ENDIAN
751/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
752 uint8_t reserved:1, param_id:2, h_reqave:5;
753 uint8_t ave_method:3, h_reqt:5;
754#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400755}__attribute__ ((packed));
756
757struct ipac_preproc_ho_thresh {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100758#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400759 uint8_t l_rxlev_ul_h:6,
760 reserved_l_rxlev_ul:2;
761 uint8_t l_rxlev_dl_h:6,
762 reserved_l_rxlev_dl:2;
763 uint8_t rxlev_ul_ih:6,
764 reserved_rxlev_ul:2;
765 uint8_t rxlev_dl_ih:6,
766 reserved_rxlev_dl:2;
767 uint8_t l_rxqual_ul_h:3,
768 reserved_rxlqual_ul:1,
769 l_rxqual_dl_h:3,
770 reserved_rxqual_dl:1;
771 uint8_t ms_range_max:6,
772 reserved_ms_range:2;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100773#elif OSMO_IS_BIG_ENDIAN
774/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
775 uint8_t reserved_l_rxlev_ul:2, l_rxlev_ul_h:6;
776 uint8_t reserved_l_rxlev_dl:2, l_rxlev_dl_h:6;
777 uint8_t reserved_rxlev_ul:2, rxlev_ul_ih:6;
778 uint8_t reserved_rxlev_dl:2, rxlev_dl_ih:6;
779 uint8_t reserved_rxqual_dl:1, l_rxqual_dl_h:3, reserved_rxlqual_ul:1, l_rxqual_ul_h:3;
780 uint8_t reserved_ms_range:2, ms_range_max:6;
781#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400782}__attribute__ ((packed));
783
784struct ipac_preproc_ho_comp {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100785#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400786 uint8_t p5:5,
787 reserved_p5:3;
788 uint8_t n5:5,
789 reserved_n5:3;
790 uint8_t p6:5,
791 reserved_p6:3;
792 uint8_t n6:5,
793 reserved_n6:3;
794 uint8_t p7:5,
795 reserved_p7:3;
796 uint8_t n7:5,
797 reserved_n7:3;
798 uint8_t p8:5,
799 reserved_p8:3;
800 uint8_t n8:5,
801 reserved_n8:3;
802 uint8_t ho_interval:5,
803 reserved_ho:3;
804 uint8_t reserved;
805
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100806#elif OSMO_IS_BIG_ENDIAN
807/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
808 uint8_t reserved_p5:3, p5:5;
809 uint8_t reserved_n5:3, n5:5;
810 uint8_t reserved_p6:3, p6:5;
811 uint8_t reserved_n6:3, n6:5;
812 uint8_t reserved_p7:3, p7:5;
813 uint8_t reserved_n7:3, n7:5;
814 uint8_t reserved_p8:3, p8:5;
815 uint8_t reserved_n8:3, n8:5;
816 uint8_t reserved_ho:3, ho_interval:5;
817 uint8_t reserved;
818#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400819}__attribute__ ((packed));
820
821struct ipac_preproc_ho_candidates {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100822#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400823 uint8_t bsic:6,
824 reserved0:2;
825 uint8_t bcch_freq:5,
826 ba_used:1,
827 s:1,
828 reserved1:1;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100829#elif OSMO_IS_BIG_ENDIAN
830/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
831 uint8_t reserved0:2, bsic:6;
832 uint8_t reserved1:1, s:1, ba_used:1, bcch_freq:5;
833#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400834}__attribute__ ((packed));
835
836struct ipac_preproc_ncell_dflts {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100837#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400838 uint8_t rxlev_min_def:6,
839 reserved_rxlev_min_def:2;
840 uint8_t ho_margin_def:5,
841 reserved_ho_margin_def:3;
842 uint8_t ms_txpwr_max_def:5,
843 reserved_ms_txpwr_max_def:3;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100844#elif OSMO_IS_BIG_ENDIAN
845/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
846 uint8_t reserved_rxlev_min_def:2, rxlev_min_def:6;
847 uint8_t reserved_ho_margin_def:3, ho_margin_def:5;
848 uint8_t reserved_ms_txpwr_max_def:3, ms_txpwr_max_def:5;
849#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400850}__attribute__ ((packed));
851
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -0500852struct ipac_preproc_ho_ctl_param {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100853#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -0500854 uint8_t sdcch_ho_gsm:1,
855 sdcch_ho_umts:1,
856 reserved:6;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100857#elif OSMO_IS_BIG_ENDIAN
858/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
859 uint8_t reserved:6, sdcch_ho_umts:1, sdcch_ho_gsm:1;
860#endif
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -0500861}__attribute__ ((packed));
862
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400863struct ipac_preproc_cfg {
864 uint8_t meas_rep_mode;
865 uint32_t meas_mode_flags;
866 struct ipac_preproc_ave_cfg ms_ave_cfg[3];
867 struct ipac_preproc_ave_cfg ave_cfg;
868 struct ipac_preproc_ho_thresh ho_thresh;
869 struct ipac_preproc_ho_comp ho_comp;
870 struct ipac_preproc_ncell_dflts ncell_dflts;
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -0500871 struct ipac_preproc_ho_ctl_param ho_ctl_param;
Harald Weltefad57522015-12-13 11:56:36 +0100872};
873
Sylvain Munautdca7d2c2012-04-18 21:53:23 +0200874/*! @} */