blob: e9c14e6c368e27bce0a3b0d8cb88791d116ef224 [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
Philipp Maier439ddbe2020-11-16 17:49:34 +0100119/* Osmocom specific IE to negotiate repeated ACCH capabilities */
120struct abis_rsl_osmo_rep_acch_cap {
121#if OSMO_IS_BIG_ENDIAN
Philipp Maier595908a2020-11-20 16:13:07 +0100122 uint8_t reserved:1,
123 rxqual:3,
Philipp Maier439ddbe2020-11-16 17:49:34 +0100124 ul_sacch:1,
125 dl_sacch:1,
126 dl_facch_all:1,
127 dl_facch_cmd:1;
128#elif OSMO_IS_LITTLE_ENDIAN
129 uint8_t dl_facch_cmd:1,
130 dl_facch_all:1,
131 dl_sacch:1,
132 ul_sacch:1,
Philipp Maier595908a2020-11-20 16:13:07 +0100133 rxqual:3,
134 reserved:1;
Philipp Maier439ddbe2020-11-16 17:49:34 +0100135#endif
136} __attribute__ ((packed));
Harald Welteec8b4502010-02-20 20:34:29 +0100137
138/* Chapter 9.1 */
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200139/* RSL Message Discriminator: RLL */
Harald Welteec8b4502010-02-20 20:34:29 +0100140#define ABIS_RSL_MDISC_RLL 0x02
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200141/* RSL Message Discriminator: Dedicated Channel */
Harald Welteec8b4502010-02-20 20:34:29 +0100142#define ABIS_RSL_MDISC_DED_CHAN 0x08
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200143/* RSL Message Discriminator: Common Channel */
Harald Welteec8b4502010-02-20 20:34:29 +0100144#define ABIS_RSL_MDISC_COM_CHAN 0x0c
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200145/* RSL Message Discriminator: TRX Management */
Harald Welteec8b4502010-02-20 20:34:29 +0100146#define ABIS_RSL_MDISC_TRX 0x10
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200147/* RSL Message Discriminator: Location Service */
Harald Welteec8b4502010-02-20 20:34:29 +0100148#define ABIS_RSL_MDISC_LOC 0x20
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200149/* RSL Message Discriminator: ip.access */
Harald Welteec8b4502010-02-20 20:34:29 +0100150#define ABIS_RSL_MDISC_IPACCESS 0x7e
151#define ABIS_RSL_MDISC_TRANSP 0x01
152
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200153/* Check if given RSL message discriminator is transparent */
Harald Welteec8b4502010-02-20 20:34:29 +0100154#define ABIS_RSL_MDISC_IS_TRANSP(x) (x & 0x01)
155
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200156/* RSL Message Type (Chapter 9.1) */
Harald Welteec8b4502010-02-20 20:34:29 +0100157enum abis_rsl_msgtype {
158 /* Radio Link Layer Management */
159 RSL_MT_DATA_REQ = 0x01,
160 RSL_MT_DATA_IND,
161 RSL_MT_ERROR_IND,
162 RSL_MT_EST_REQ,
163 RSL_MT_EST_CONF,
164 RSL_MT_EST_IND,
165 RSL_MT_REL_REQ,
166 RSL_MT_REL_CONF,
167 RSL_MT_REL_IND,
168 RSL_MT_UNIT_DATA_REQ,
169 RSL_MT_UNIT_DATA_IND, /* 0x0b */
Andreas Eversberg816e24c2010-06-25 02:50:56 +0200170 RSL_MT_SUSP_REQ, /* non-standard elements */
171 RSL_MT_SUSP_CONF,
172 RSL_MT_RES_REQ,
173 RSL_MT_RECON_REQ, /* 0x0f */
Harald Welteec8b4502010-02-20 20:34:29 +0100174
175 /* Common Channel Management / TRX Management */
176 RSL_MT_BCCH_INFO = 0x11,
177 RSL_MT_CCCH_LOAD_IND,
178 RSL_MT_CHAN_RQD,
179 RSL_MT_DELETE_IND,
180 RSL_MT_PAGING_CMD,
181 RSL_MT_IMMEDIATE_ASSIGN_CMD,
182 RSL_MT_SMS_BC_REQ,
Harald Welte6eb7d6c2010-07-13 13:48:13 +0200183 RSL_MT_CHAN_CONF, /* non-standard element */
Harald Welteec8b4502010-02-20 20:34:29 +0100184 /* empty */
185 RSL_MT_RF_RES_IND = 0x19,
186 RSL_MT_SACCH_FILL,
187 RSL_MT_OVERLOAD,
188 RSL_MT_ERROR_REPORT,
189 RSL_MT_SMS_BC_CMD,
190 RSL_MT_CBCH_LOAD_IND,
191 RSL_MT_NOT_CMD, /* 0x1f */
192
193 /* Dedicate Channel Management */
194 RSL_MT_CHAN_ACTIV = 0x21,
195 RSL_MT_CHAN_ACTIV_ACK,
196 RSL_MT_CHAN_ACTIV_NACK,
197 RSL_MT_CONN_FAIL,
198 RSL_MT_DEACTIVATE_SACCH,
199 RSL_MT_ENCR_CMD,
200 RSL_MT_HANDO_DET,
201 RSL_MT_MEAS_RES,
202 RSL_MT_MODE_MODIFY_REQ,
203 RSL_MT_MODE_MODIFY_ACK,
204 RSL_MT_MODE_MODIFY_NACK,
205 RSL_MT_PHY_CONTEXT_REQ,
206 RSL_MT_PHY_CONTEXT_CONF,
207 RSL_MT_RF_CHAN_REL,
208 RSL_MT_MS_POWER_CONTROL,
209 RSL_MT_BS_POWER_CONTROL, /* 0x30 */
210 RSL_MT_PREPROC_CONFIG,
211 RSL_MT_PREPROC_MEAS_RES,
212 RSL_MT_RF_CHAN_REL_ACK,
213 RSL_MT_SACCH_INFO_MODIFY,
214 RSL_MT_TALKER_DET,
215 RSL_MT_LISTENER_DET,
216 RSL_MT_REMOTE_CODEC_CONF_REP,
217 RSL_MT_RTD_REP,
218 RSL_MT_PRE_HANDO_NOTIF,
219 RSL_MT_MR_CODEC_MOD_REQ,
220 RSL_MT_MR_CODEC_MOD_ACK,
221 RSL_MT_MR_CODEC_MOD_NACK,
222 RSL_MT_MR_CODEC_MOD_PER,
223 RSL_MT_TFO_REP,
224 RSL_MT_TFO_MOD_REQ, /* 0x3f */
225 RSL_MT_LOCATION_INFO = 0x41,
226
227 /* ip.access specific RSL message types */
228 RSL_MT_IPAC_DIR_RETR_ENQ = 0x40,
229 RSL_MT_IPAC_PDCH_ACT = 0x48,
230 RSL_MT_IPAC_PDCH_ACT_ACK,
231 RSL_MT_IPAC_PDCH_ACT_NACK,
232 RSL_MT_IPAC_PDCH_DEACT = 0x4b,
233 RSL_MT_IPAC_PDCH_DEACT_ACK,
234 RSL_MT_IPAC_PDCH_DEACT_NACK,
235 RSL_MT_IPAC_CONNECT_MUX = 0x50,
236 RSL_MT_IPAC_CONNECT_MUX_ACK,
237 RSL_MT_IPAC_CONNECT_MUX_NACK,
238 RSL_MT_IPAC_BIND_MUX = 0x53,
239 RSL_MT_IPAC_BIND_MUX_ACK,
240 RSL_MT_IPAC_BIND_MUX_NACK,
241 RSL_MT_IPAC_DISC_MUX = 0x56,
242 RSL_MT_IPAC_DISC_MUX_ACK,
243 RSL_MT_IPAC_DISC_MUX_NACK,
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400244 RSL_MT_IPAC_MEAS_PREPROC_DFT = 0x60, /*Extented Common Channel Management */
245 RSL_MT_IPAC_HO_CAN_ENQ = 0x61,
246 RSL_MT_IPAC_HO_CAN_RES = 0x62,
Harald Welteec8b4502010-02-20 20:34:29 +0100247 RSL_MT_IPAC_CRCX = 0x70, /* Bind to local BTS RTP port */
248 RSL_MT_IPAC_CRCX_ACK,
249 RSL_MT_IPAC_CRCX_NACK,
250 RSL_MT_IPAC_MDCX = 0x73,
251 RSL_MT_IPAC_MDCX_ACK,
252 RSL_MT_IPAC_MDCX_NACK,
253 RSL_MT_IPAC_DLCX_IND = 0x76,
254 RSL_MT_IPAC_DLCX = 0x77,
255 RSL_MT_IPAC_DLCX_ACK,
256 RSL_MT_IPAC_DLCX_NACK,
Harald Weltef9456892019-09-03 13:56:00 +0200257
258 RSL_MT_OSMO_ETWS_CMD = 0x7f,
Harald Welteec8b4502010-02-20 20:34:29 +0100259};
260
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200261/*! Siemens vendor-specific RSL message types */
Harald Welteec8b4502010-02-20 20:34:29 +0100262enum abis_rsl_msgtype_siemens {
263 RSL_MT_SIEMENS_MRPCI = 0x41,
264 RSL_MT_SIEMENS_INTRAC_HO_COND_IND = 0x42,
265 RSL_MT_SIEMENS_INTERC_HO_COND_IND = 0x43,
266 RSL_MT_SIEMENS_FORCED_HO_REQ = 0x44,
267 RSL_MT_SIEMENS_PREF_AREA_REQ = 0x45,
268 RSL_MT_SIEMENS_PREF_AREA = 0x46,
269 RSL_MT_SIEMENS_START_TRACE = 0x47,
270 RSL_MT_SIEMENS_START_TRACE_ACK = 0x48,
271 RSL_MT_SIEMENS_STOP_TRACE = 0x49,
272 RSL_MT_SIEMENS_TRMR = 0x4a,
273 RSL_MT_SIEMENS_HO_FAIL_IND = 0x4b,
274 RSL_MT_SIEMENS_STOP_TRACE_ACK = 0x4c,
275 RSL_MT_SIEMENS_UPLF = 0x4d,
276 RSL_MT_SIEMENS_UPLB = 0x4e,
277 RSL_MT_SIEMENS_SET_SYS_INFO_10 = 0x4f,
278 RSL_MT_SIEMENS_MODIF_COND_IND = 0x50,
279};
280
Pau Espin Pedrol95959a82018-04-21 22:47:54 +0200281/*! Ericsson vendor-specific RSL message types */
282enum abis_rsl_msgtype_ericsson {
283 RSL_MT_ERICSSON_IMM_ASS_SENT = 0x10,
284};
285
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200286/*! RSL Information Element Identifiers (Chapter 9.3) */
Harald Welteec8b4502010-02-20 20:34:29 +0100287enum abis_rsl_ie {
288 RSL_IE_CHAN_NR = 0x01,
289 RSL_IE_LINK_IDENT,
290 RSL_IE_ACT_TYPE,
291 RSL_IE_BS_POWER,
292 RSL_IE_CHAN_IDENT,
293 RSL_IE_CHAN_MODE,
294 RSL_IE_ENCR_INFO,
295 RSL_IE_FRAME_NUMBER,
296 RSL_IE_HANDO_REF,
297 RSL_IE_L1_INFO,
298 RSL_IE_L3_INFO,
299 RSL_IE_MS_IDENTITY,
300 RSL_IE_MS_POWER,
301 RSL_IE_PAGING_GROUP,
302 RSL_IE_PAGING_LOAD,
303 RSL_IE_PYHS_CONTEXT = 0x10,
304 RSL_IE_ACCESS_DELAY,
305 RSL_IE_RACH_LOAD,
306 RSL_IE_REQ_REFERENCE,
307 RSL_IE_RELEASE_MODE,
308 RSL_IE_RESOURCE_INFO,
309 RSL_IE_RLM_CAUSE,
310 RSL_IE_STARTNG_TIME,
311 RSL_IE_TIMING_ADVANCE,
312 RSL_IE_UPLINK_MEAS,
313 RSL_IE_CAUSE,
314 RSL_IE_MEAS_RES_NR,
315 RSL_IE_MSG_ID,
316 /* reserved */
317 RSL_IE_SYSINFO_TYPE = 0x1e,
318 RSL_IE_MS_POWER_PARAM,
319 RSL_IE_BS_POWER_PARAM,
320 RSL_IE_PREPROC_PARAM,
321 RSL_IE_PREPROC_MEAS,
322 RSL_IE_IMM_ASS_INFO, /* Phase 1 (3.6.0), later Full below */
323 RSL_IE_SMSCB_INFO = 0x24,
324 RSL_IE_MS_TIMING_OFFSET,
325 RSL_IE_ERR_MSG,
326 RSL_IE_FULL_BCCH_INFO,
327 RSL_IE_CHAN_NEEDED,
328 RSL_IE_CB_CMD_TYPE,
329 RSL_IE_SMSCB_MSG,
330 RSL_IE_FULL_IMM_ASS_INFO,
331 RSL_IE_SACCH_INFO,
332 RSL_IE_CBCH_LOAD_INFO,
333 RSL_IE_SMSCB_CHAN_INDICATOR,
334 RSL_IE_GROUP_CALL_REF,
335 RSL_IE_CHAN_DESC = 0x30,
336 RSL_IE_NCH_DRX_INFO,
337 RSL_IE_CMD_INDICATOR,
338 RSL_IE_EMLPP_PRIO,
339 RSL_IE_UIC,
340 RSL_IE_MAIN_CHAN_REF,
341 RSL_IE_MR_CONFIG,
342 RSL_IE_MR_CONTROL,
343 RSL_IE_SUP_CODEC_TYPES,
344 RSL_IE_CODEC_CONFIG,
345 RSL_IE_RTD,
346 RSL_IE_TFO_STATUS,
347 RSL_IE_LLP_APDU,
348 /* Siemens vendor-specific */
349 RSL_IE_SIEMENS_MRPCI = 0x40,
350 RSL_IE_SIEMENS_PREF_AREA_TYPE = 0x43,
351 RSL_IE_SIEMENS_ININ_CELL_HO_PAR = 0x45,
352 RSL_IE_SIEMENS_TRACE_REF_NR = 0x46,
353 RSL_IE_SIEMENS_INT_TRACE_IDX = 0x47,
354 RSL_IE_SIEMENS_L2_HDR_INFO = 0x48,
355 RSL_IE_SIEMENS_HIGHEST_RATE = 0x4e,
356 RSL_IE_SIEMENS_SUGGESTED_RATE = 0x4f,
357
Philipp Maiera15967b2020-11-06 21:37:16 +0100358 /* Osmocom specific */
359 RSL_IE_OSMO_REP_ACCH_CAP= 0x60,
360
Harald Welteec8b4502010-02-20 20:34:29 +0100361 /* ip.access */
362 RSL_IE_IPAC_SRTP_CONFIG = 0xe0,
363 RSL_IE_IPAC_PROXY_UDP = 0xe1,
364 RSL_IE_IPAC_BSCMPL_TOUT = 0xe2,
365 RSL_IE_IPAC_REMOTE_IP = 0xf0,
366 RSL_IE_IPAC_REMOTE_PORT = 0xf1,
367 RSL_IE_IPAC_RTP_PAYLOAD = 0xf2,
368 RSL_IE_IPAC_LOCAL_PORT = 0xf3,
369 RSL_IE_IPAC_SPEECH_MODE = 0xf4,
370 RSL_IE_IPAC_LOCAL_IP = 0xf5,
371 RSL_IE_IPAC_CONN_STAT = 0xf6,
372 RSL_IE_IPAC_HO_C_PARMS = 0xf7,
373 RSL_IE_IPAC_CONN_ID = 0xf8,
374 RSL_IE_IPAC_RTP_CSD_FMT = 0xf9,
375 RSL_IE_IPAC_RTP_JIT_BUF = 0xfa,
376 RSL_IE_IPAC_RTP_COMPR = 0xfb,
377 RSL_IE_IPAC_RTP_PAYLOAD2= 0xfc,
378 RSL_IE_IPAC_RTP_MPLEX = 0xfd,
379 RSL_IE_IPAC_RTP_MPLEX_ID= 0xfe,
380};
381
Harald Welte6e363e72016-11-16 16:58:52 +0100382/* Ericsson specific IEs, clash with above partially, so they're not
383 * part of the enum */
Alexander Couzens9f39d892018-04-21 21:20:25 +0200384#define RSL_IE_ERIC_PAGING_GROUP 0x0e
Harald Welte6e363e72016-11-16 16:58:52 +0100385#define RSL_IE_ERIC_INST_NR 0x48
386#define RSL_IE_ERIC_PGSL_TIMERS 0x49
387#define RSL_IE_ERIC_REPEAT_DL_FACCH 0x4a
388#define RSL_IE_ERIC_POWER_INFO 0xf0
389#define RSL_IE_ERIC_MOBILE_ID 0xf1
390#define RSL_IE_ERIC_BCCH_MAPPING 0xf2
391#define RSL_IE_ERIC_PACKET_PAG_IND 0xf3
392#define RSL_IE_ERIC_CNTR_CTRL 0xf4
393#define RSL_IE_ERIC_CNTR_CTRL_ACK 0xf5
394#define RSL_IE_ERIC_CNTR_REPORT 0xf6
395#define RSL_IE_ERIC_ICP_CONN 0xf7
396#define RSL_IE_ERIC_EMR_SUPPORT 0xf8
397#define RSL_IE_ERIC_EGPRS_REQ_REF 0xf9
398#define RSL_IE_ERIC_VGCS_REL 0xfa
399#define RSL_IE_ERIC_REP_PER_NCH 0xfb
400#define RSL_IE_ERIC_NY2 0xfc
401#define RSL_IE_ERIC_T3115 0xfd
402#define RSL_IE_ERIC_ACTIVATE_FLAG 0xfe
403#define RSL_IE_ERIC_FULL_NCH_INFO 0xff
404
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400405/* IPAC MEAS_PREPROC AVERAGING METHOD */
406enum {
407 IPAC_UNWEIGHTED_AVE = 0,
408 IPAC_WEIGHTED_AVE,
Vadim Yanitskiyc8158ec2020-12-15 08:04:30 +0100409 IPAC_MEDIAN_AVE,
410 /* EWMA is an Osmocom specific extension */
411 IPAC_OSMO_EWMA_AVE,
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400412};
413
414/* IPAC MEAS_PREPROC AVERAGING PARAMID */
415enum {
416 IPAC_RXLEV_AVE = 0,
417 IPAC_RXQUAL_AVE,
418 IPAC_MS_BTS_DIS_AVE
419};
420
421/* IPAC MEAS_PREPROC HO CAUSES */
422enum {
423 IPAC_HO_RQD_CAUSE_L_RXLEV_UL_H = 0x01,
424 IPAC_HO_RQD_CAUSE_L_RXLEV_DL_H,
425 IPAC_HO_RQD_CAUSE_L_RXQUAL_UL_H,
426 IPAC_HO_RQD_CAUSE_L_RXQUAL_DL_H,
427 IPAC_HO_RQD_CAUSE_RXLEV_UL_IH,
428 IPAC_HO_RQD_CAUSE_RXLEV_DL_IH,
429 IPAC_HO_RQD_CAUSE_MAX_MS_RANGE,
430 IPAC_HO_RQD_CAUSE_POWER_BUDGET,
431 IPAC_HO_RQD_CAUSE_ENQUIRY,
432 IPAC_HO_RQD_CAUSE_ENQUIRY_FAILED,
433 IPAC_HO_RQD_CAUSE_NORMAL3G,
434 IPAC_HO_RQD_CAUSE_EMERGENCY3G,
435 IPAC_HO_RQD_CAUSE_SERVICE_PREFERRED3G,
436 IPAC_HO_RQD_CAUSE_O_M_SHUTDOWN,
437 IPAC_HO_RQD_CAUSE_QUALITY_PROMOTION,
438 IPAC_HO_RQD_CAUSE_LOAD_PROMOTION,
439 IPAC_HO_RQD_CAUSE_LOAD_DEMOTION,
440 IPAC_HO_RQD_CAUSE_MAX,
441};
442
Harald Welteec8b4502010-02-20 20:34:29 +0100443/* Chapter 9.3.1 */
444#define RSL_CHAN_NR_MASK 0xf8
Neels Hofmeyr15b96ff2016-07-18 23:33:48 +0200445#define RSL_CHAN_NR_1 0x08 /*< bit to add for 2nd,... lchan */
Harald Welteec8b4502010-02-20 20:34:29 +0100446#define RSL_CHAN_Bm_ACCHs 0x08
447#define RSL_CHAN_Lm_ACCHs 0x10 /* .. 0x18 */
448#define RSL_CHAN_SDCCH4_ACCH 0x20 /* .. 0x38 */
449#define RSL_CHAN_SDCCH8_ACCH 0x40 /* ...0x78 */
450#define RSL_CHAN_BCCH 0x80
451#define RSL_CHAN_RACH 0x88
452#define RSL_CHAN_PCH_AGCH 0x90
Neels Hofmeyrfd80f5a2016-07-14 03:21:05 +0200453#define RSL_CHAN_OSMO_PDCH 0xc0 /*< non-standard, for dyn TS */
Harald Weltea8d7ebb2019-05-27 16:51:23 +0200454#define RSL_CHAN_OSMO_CBCH4 0xc8 /*< non-standard, for CBCH/SDCCH4 */
455#define RSL_CHAN_OSMO_CBCH8 0xd0 /*< non-standard, for CBCH/SDCCH8 */
Harald Welteec8b4502010-02-20 20:34:29 +0100456
457/* Chapter 9.3.3 */
458#define RSL_ACT_TYPE_INITIAL 0x00
459#define RSL_ACT_TYPE_REACT 0x80
460#define RSL_ACT_INTRA_IMM_ASS 0x00
461#define RSL_ACT_INTRA_NORM_ASS 0x01
462#define RSL_ACT_INTER_ASYNC 0x02
463#define RSL_ACT_INTER_SYNC 0x03
464#define RSL_ACT_SECOND_ADD 0x04
465#define RSL_ACT_SECOND_MULTI 0x05
Neels Hofmeyrfd80f5a2016-07-14 03:21:05 +0200466#define RSL_ACT_OSMO_PDCH 0x0f /*< non-standard, for dyn TS */
Harald Welteec8b4502010-02-20 20:34:29 +0100467
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200468/*! RSL Channel Mode IF (Chapter 9.3.6) */
Harald Welteec8b4502010-02-20 20:34:29 +0100469struct rsl_ie_chan_mode {
470 uint8_t dtx_dtu;
471 uint8_t spd_ind;
472 uint8_t chan_rt;
473 uint8_t chan_rate;
474} __attribute__ ((packed));
475#define RSL_CMOD_DTXu 0x01 /* uplink */
476#define RSL_CMOD_DTXd 0x02 /* downlink */
477enum rsl_cmod_spd {
478 RSL_CMOD_SPD_SPEECH = 0x01,
479 RSL_CMOD_SPD_DATA = 0x02,
480 RSL_CMOD_SPD_SIGN = 0x03,
481};
482#define RSL_CMOD_CRT_SDCCH 0x01
483#define RSL_CMOD_CRT_TCH_Bm 0x08 /* full-rate */
484#define RSL_CMOD_CRT_TCH_Lm 0x09 /* half-rate */
485/* FIXME: More CRT types */
486/* Speech */
487#define RSL_CMOD_SP_GSM1 0x01
488#define RSL_CMOD_SP_GSM2 0x11
489#define RSL_CMOD_SP_GSM3 0x21
Harald Welteeed26112012-08-24 15:35:34 +0200490/* non-transparent data */
491#define RSL_CMOD_CSD_NT_43k5 0x74
492#define RSL_CMOD_CSD_NT_28k8 0x71
493#define RSL_CMOD_CSD_NT_14k5 0x58
494#define RSL_CMOD_CSD_NT_12k0 0x50
495#define RSL_CMOD_CSD_NT_6k0 0x51
496/* legacy #defines with wrong name */
497#define RSL_CMOD_SP_NT_14k5 RSL_CMOD_CSD_NT_14k5
498#define RSL_CMOD_SP_NT_12k0 RSL_CMOD_CSD_NT_12k0
499#define RSL_CMOD_SP_NT_6k0 RSL_CMOD_CSD_NT_6k0
500/* transparent data */
501#define RSL_CMOD_CSD_T_32000 0x38
502#define RSL_CMOD_CSD_T_29000 0x39
503#define RSL_CMOD_CSD_T_14400 0x18
504#define RSL_CMOD_CSD_T_9600 0x10
505#define RSL_CMOD_CSD_T_4800 0x11
506#define RSL_CMOD_CSD_T_2400 0x12
507#define RSL_CMOD_CSD_T_1200 0x13
508#define RSL_CMOD_CSD_T_600 0x14
509#define RSL_CMOD_CSD_T_1200_75 0x15
Harald Welteec8b4502010-02-20 20:34:29 +0100510
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200511/*! RSL Channel Identification IE (Chapter 9.3.5) */
Harald Welteec8b4502010-02-20 20:34:29 +0100512struct rsl_ie_chan_ident {
513 /* GSM 04.08 10.5.2.5 */
514 struct {
515 uint8_t iei;
516 uint8_t chan_nr; /* enc_chan_nr */
517 uint8_t oct3;
518 uint8_t oct4;
519 } chan_desc;
520#if 0 /* spec says we need this but Abissim doesn't use it */
521 struct {
522 uint8_t tag;
523 uint8_t len;
524 } mobile_alloc;
525#endif
526} __attribute__ ((packed));
527
528/* Chapter 9.3.22 */
529#define RLL_CAUSE_T200_EXPIRED 0x01
530#define RLL_CAUSE_REEST_REQ 0x02
531#define RLL_CAUSE_UNSOL_UA_RESP 0x03
532#define RLL_CAUSE_UNSOL_DM_RESP 0x04
533#define RLL_CAUSE_UNSOL_DM_RESP_MF 0x05
534#define RLL_CAUSE_UNSOL_SPRV_RESP 0x06
535#define RLL_CAUSE_SEQ_ERR 0x07
536#define RLL_CAUSE_UFRM_INC_PARAM 0x08
537#define RLL_CAUSE_SFRM_INC_PARAM 0x09
538#define RLL_CAUSE_IFRM_INC_MBITS 0x0a
539#define RLL_CAUSE_IFRM_INC_LEN 0x0b
540#define RLL_CAUSE_FRM_UNIMPL 0x0c
541#define RLL_CAUSE_SABM_MF 0x0d
542#define RLL_CAUSE_SABM_INFO_NOTALL 0x0e
543
544/* Chapter 9.3.26 */
545#define RSL_ERRCLS_NORMAL 0x00
546#define RSL_ERRCLS_RESOURCE_UNAVAIL 0x20
547#define RSL_ERRCLS_SERVICE_UNAVAIL 0x30
548#define RSL_ERRCLS_SERVICE_UNIMPL 0x40
549#define RSL_ERRCLS_INVAL_MSG 0x50
550#define RSL_ERRCLS_PROTO_ERROR 0x60
551#define RSL_ERRCLS_INTERWORKING 0x70
552
553/* normal event */
554#define RSL_ERR_RADIO_IF_FAIL 0x00
555#define RSL_ERR_RADIO_LINK_FAIL 0x01
556#define RSL_ERR_HANDOVER_ACC_FAIL 0x02
557#define RSL_ERR_TALKER_ACC_FAIL 0x03
558#define RSL_ERR_OM_INTERVENTION 0x07
559#define RSL_ERR_NORMAL_UNSPEC 0x0f
560#define RSL_ERR_T_MSRFPCI_EXP 0x18
561/* resource unavailable */
562#define RSL_ERR_EQUIPMENT_FAIL 0x20
563#define RSL_ERR_RR_UNAVAIL 0x21
564#define RSL_ERR_TERR_CH_FAIL 0x22
565#define RSL_ERR_CCCH_OVERLOAD 0x23
566#define RSL_ERR_ACCH_OVERLOAD 0x24
567#define RSL_ERR_PROCESSOR_OVERLOAD 0x25
Philipp Maier6d214482020-07-28 16:53:27 +0200568#define RSL_ERR_BTS_NOT_EQUIPPED 0x27
569#define RSL_ERR_REMOTE_TRANSC_FAIL 0x28
570#define RSL_ERR_NOTIFICATION_OVERFL 0x29
Harald Welteec8b4502010-02-20 20:34:29 +0100571#define RSL_ERR_RES_UNAVAIL 0x2f
572/* service or option not available */
573#define RSL_ERR_TRANSC_UNAVAIL 0x30
574#define RSL_ERR_SERV_OPT_UNAVAIL 0x3f
575/* service or option not implemented */
576#define RSL_ERR_ENCR_UNIMPL 0x40
577#define RSL_ERR_SERV_OPT_UNIMPL 0x4f
578/* invalid message */
579#define RSL_ERR_RCH_ALR_ACTV_ALLOC 0x50
580#define RSL_ERR_INVALID_MESSAGE 0x5f
581/* protocol error */
582#define RSL_ERR_MSG_DISCR 0x60
583#define RSL_ERR_MSG_TYPE 0x61
584#define RSL_ERR_MSG_SEQ 0x62
585#define RSL_ERR_IE_ERROR 0x63
586#define RSL_ERR_MAND_IE_ERROR 0x64
587#define RSL_ERR_OPT_IE_ERROR 0x65
588#define RSL_ERR_IE_NONEXIST 0x66
589#define RSL_ERR_IE_LENGTH 0x67
590#define RSL_ERR_IE_CONTENT 0x68
591#define RSL_ERR_PROTO 0x6f
592/* interworking */
593#define RSL_ERR_INTERWORKING 0x7f
594
595/* Chapter 9.3.30 */
596#define RSL_SYSTEM_INFO_8 0x00
597#define RSL_SYSTEM_INFO_1 0x01
598#define RSL_SYSTEM_INFO_2 0x02
599#define RSL_SYSTEM_INFO_3 0x03
600#define RSL_SYSTEM_INFO_4 0x04
601#define RSL_SYSTEM_INFO_5 0x05
602#define RSL_SYSTEM_INFO_6 0x06
603#define RSL_SYSTEM_INFO_7 0x07
604#define RSL_SYSTEM_INFO_16 0x08
605#define RSL_SYSTEM_INFO_17 0x09
606#define RSL_SYSTEM_INFO_2bis 0x0a
607#define RSL_SYSTEM_INFO_2ter 0x0b
608#define RSL_SYSTEM_INFO_5bis 0x0d
609#define RSL_SYSTEM_INFO_5ter 0x0e
610#define RSL_SYSTEM_INFO_10 0x0f
Harald Welte3d732272011-06-25 21:39:01 +0200611#define RSL_EXT_MEAS_ORDER 0x47
Harald Welteec8b4502010-02-20 20:34:29 +0100612#define RSL_MEAS_INFO 0x48
613#define RSL_SYSTEM_INFO_13 0x28
Philipp00b15392016-11-14 12:34:15 +0100614#define RSL_ERIC_SYSTEM_INFO_13 0x0C
Harald Welteec8b4502010-02-20 20:34:29 +0100615#define RSL_SYSTEM_INFO_2quater 0x29
616#define RSL_SYSTEM_INFO_9 0x2a
617#define RSL_SYSTEM_INFO_18 0x2b
618#define RSL_SYSTEM_INFO_19 0x2c
619#define RSL_SYSTEM_INFO_20 0x2d
620
621/* Chapter 9.3.40 */
622#define RSL_CHANNEED_ANY 0x00
623#define RSL_CHANNEED_SDCCH 0x01
624#define RSL_CHANNEED_TCH_F 0x02
625#define RSL_CHANNEED_TCH_ForH 0x03
626
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200627/*! RSL Cell Broadcast Command (Chapter 9.3.45) */
Alex Badea84930182010-11-27 23:34:46 +0200628struct rsl_ie_cb_cmd_type {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100629#if OSMO_IS_LITTLE_ENDIAN
Alex Badea84930182010-11-27 23:34:46 +0200630 uint8_t last_block:2;
631 uint8_t spare:1;
632 uint8_t def_bcast:1;
633 uint8_t command:4;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100634#elif OSMO_IS_BIG_ENDIAN
635/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
636 uint8_t command:4, def_bcast:1, spare:1, last_block:2;
637#endif
Alex Badea84930182010-11-27 23:34:46 +0200638} __attribute__ ((packed));
639/* ->command */
640#define RSL_CB_CMD_TYPE_NORMAL 0x00
641#define RSL_CB_CMD_TYPE_SCHEDULE 0x08
642#define RSL_CB_CMD_TYPE_DEFAULT 0x0e
643#define RSL_CB_CMD_TYPE_NULL 0x0f
644/* ->def_bcast */
645#define RSL_CB_CMD_DEFBCAST_NORMAL 0
646#define RSL_CB_CMD_DEFBCAST_NULL 1
647/* ->last_block */
648#define RSL_CB_CMD_LASTBLOCK_4 0
649#define RSL_CB_CMD_LASTBLOCK_1 1
650#define RSL_CB_CMD_LASTBLOCK_2 2
651#define RSL_CB_CMD_LASTBLOCK_3 3
652
Harald Welteec8b4502010-02-20 20:34:29 +0100653/* Chapter 3.3.2.3 Brocast control channel */
654/* CCCH-CONF, NC is not combined */
655#define RSL_BCCH_CCCH_CONF_1_NC 0x00
656#define RSL_BCCH_CCCH_CONF_1_C 0x01
657#define RSL_BCCH_CCCH_CONF_2_NC 0x02
658#define RSL_BCCH_CCCH_CONF_3_NC 0x04
659#define RSL_BCCH_CCCH_CONF_4_NC 0x06
660
661/* BS-PA-MFRMS */
662#define RSL_BS_PA_MFRMS_2 0x00
663#define RSL_BS_PA_MFRMS_3 0x01
664#define RSL_BS_PA_MFRMS_4 0x02
665#define RSL_BS_PA_MFRMS_5 0x03
666#define RSL_BS_PA_MFRMS_6 0x04
667#define RSL_BS_PA_MFRMS_7 0x05
668#define RSL_BS_PA_MFRMS_8 0x06
669#define RSL_BS_PA_MFRMS_9 0x07
670
671/* RSL_IE_IPAC_RTP_PAYLOAD[2] */
672enum rsl_ipac_rtp_payload {
673 RSL_IPAC_RTP_GSM = 1,
674 RSL_IPAC_RTP_EFR,
675 RSL_IPAC_RTP_AMR,
676 RSL_IPAC_RTP_CSD,
677 RSL_IPAC_RTP_MUX,
678};
679
680/* RSL_IE_IPAC_SPEECH_MODE, lower four bits */
681enum rsl_ipac_speech_mode_s {
682 RSL_IPAC_SPEECH_GSM_FR = 0, /* GSM FR (Type 1, FS) */
683 RSL_IPAC_SPEECH_GSM_EFR = 1, /* GSM EFR (Type 2, FS) */
684 RSL_IPAC_SPEECH_GSM_AMR_FR = 2, /* GSM AMR/FR (Type 3, FS) */
685 RSL_IPAC_SPEECH_GSM_HR = 3, /* GSM HR (Type 1, HS) */
686 RSL_IPAC_SPEECH_GSM_AMR_HR = 5, /* GSM AMR/hr (Type 3, HS) */
687 RSL_IPAC_SPEECH_AS_RTP = 0xf, /* As specified by RTP Payload IE */
688};
689/* RSL_IE_IPAC_SPEECH_MODE, upper four bits */
690enum rsl_ipac_speech_mode_m {
691 RSL_IPAC_SPEECH_M_RXTX = 0, /* Send and Receive */
692 RSL_IPAC_SPEECH_M_RX = 1, /* Receive only */
693 RSL_IPAC_SPEECH_M_TX = 2, /* Send only */
694};
695
696/* RSL_IE_IPAC_RTP_CSD_FMT, lower four bits */
697enum rsl_ipac_rtp_csd_format_d {
698 RSL_IPAC_RTP_CSD_EXT_TRAU = 0,
699 RSL_IPAC_RTP_CSD_NON_TRAU = 1,
700 RSL_IPAC_RTP_CSD_TRAU_BTS = 2,
701 RSL_IPAC_RTP_CSD_IWF_FREE = 3,
702};
703/* RSL_IE_IPAC_RTP_CSD_FMT, upper four bits */
704enum rsl_ipac_rtp_csd_format_ir {
705 RSL_IPAC_RTP_CSD_IR_8k = 0,
706 RSL_IPAC_RTP_CSD_IR_16k = 1,
707 RSL_IPAC_RTP_CSD_IR_32k = 2,
708 RSL_IPAC_RTP_CSD_IR_64k = 3,
709};
710
711/* Siemens vendor-specific RSL extensions */
712struct rsl_mrpci {
713 uint8_t power_class:3,
714 vgcs_capable:1,
715 vbs_capable:1,
716 gsm_phase:2;
717} __attribute__ ((packed));
718
719enum rsl_mrpci_pwrclass {
720 RSL_MRPCI_PWRC_1 = 0,
721 RSL_MRPCI_PWRC_2 = 1,
722 RSL_MRPCI_PWRC_3 = 2,
723 RSL_MRPCI_PWRC_4 = 3,
724 RSL_MRPCI_PWRC_5 = 4,
725};
726enum rsl_mrpci_phase {
727 RSL_MRPCI_PHASE_1 = 0,
728 /* reserved */
729 RSL_MRPCI_PHASE_2 = 2,
730 RSL_MRPCI_PHASE_2PLUS = 3,
731};
732
Holger Hans Peter Freyther0357e9b2012-12-06 11:57:31 +0100733/* 9.3.20 Release Mode */
734enum rsl_rel_mode {
735 RSL_REL_NORMAL = 0,
736 RSL_REL_LOCAL_END = 1,
737};
738
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200739/*! ip.access specific embedded information elements */
Harald Weltefad57522015-12-13 11:56:36 +0100740enum rsl_ipac_embedded_ie {
741 RSL_IPAC_EIE_RXLEV = 0x00,
742 RSL_IPAC_EIE_RXQUAL = 0x01,
743 RSL_IPAC_EIE_FREQ_ERR = 0x02,
744 RSL_IPAC_EIE_TIMING_ERR = 0x03,
745 RSL_IPAC_EIE_MEAS_AVG_CFG = 0x04,
746 RSL_IPAC_EIE_BS_PWR_CTL = 0x05,
747 RSL_IPAC_EIE_MS_PWR_CTL = 0x06,
748 RSL_IPAC_EIE_HANDO_THRESH = 0x07,
749 RSL_IPAC_EIE_NCELL_DEFAULTS = 0x08,
750 RSL_IPAC_EIE_NCELL_LIST = 0x09,
751 RSL_IPAC_EIE_PC_THRESH_COMP = 0x0a,
752 RSL_IPAC_EIE_HO_THRESH_COMP = 0x0b,
753 RSL_IPAC_EIE_HO_CAUSE = 0x0c,
754 RSL_IPAC_EIE_HO_CANDIDATES = 0x0d,
755 RSL_IPAC_EIE_NCELL_BA_CHG_LIST = 0x0e,
756 RSL_IPAC_EIE_NUM_OF_MS = 0x10,
757 RSL_IPAC_EIE_HO_CAND_EXT = 0x11,
758 RSL_IPAC_EIE_NCELL_DEF_EXT = 0x12,
759 RSL_IPAC_EIE_NCELL_LIST_EXT = 0x13,
760 RSL_IPAC_EIE_MASTER_KEY = 0x14,
761 RSL_IPAC_EIE_MASTER_SALT = 0x15,
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400762 /* additional IPAC measurement pre-processing related IEI */
763 RSL_IPAC_EIE_MEAS_TRANS_RES = 0x16,
764 RSL_IPAC_EIE_3G_HO_PARAM = 0x17,
765 RSL_IPAC_EIE_3G_NCELL_LIST = 0x18,
766 RSL_IPAC_EIE_SDCCH_CTL_PARAM = 0x1a,
767 RSL_IPAC_EIE_AMR_CONV_THRESH = 0x1b,
768
769};
770
771struct ipac_preproc_ave_cfg {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100772#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400773 uint8_t h_reqave:5,
774 param_id:2,
775 reserved:1;
776 uint8_t h_reqt:5,
777 ave_method:3;
Vadim Yanitskiy8f5844e2020-12-25 00:19:45 +0100778 uint8_t params[0];
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100779#elif OSMO_IS_BIG_ENDIAN
780/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
781 uint8_t reserved:1, param_id:2, h_reqave:5;
782 uint8_t ave_method:3, h_reqt:5;
Vadim Yanitskiy8f5844e2020-12-25 00:19:45 +0100783 uint8_t params[0];
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100784#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400785}__attribute__ ((packed));
786
Vadim Yanitskiya346c452020-12-15 07:48:58 +0100787/*! MS/BS Power Control Thresholds */
788struct ipac_preproc_pc_thresh {
789#if OSMO_IS_LITTLE_ENDIAN
790 uint8_t l_rxlev:6, reserved_l_rxlev:2;
791 uint8_t u_rxlev:6, reserved_u_rxlev:2;
Vadim Yanitskiy2060bbb2020-12-19 17:33:41 +0100792 uint8_t u_rxqual:3, reserved_u_rxqual:1,
793 l_rxqual:3, reserved_l_rxqual:1;
Vadim Yanitskiya346c452020-12-15 07:48:58 +0100794#elif OSMO_IS_BIG_ENDIAN
795 uint8_t reserved_l_rxlev:2, l_rxlev:6;
796 uint8_t reserved_u_rxlev:2, u_rxlev:6;
797 uint8_t reserved_l_rxqual:1, l_rxqual:3,
798 reserved_u_rxqual:1, u_rxqual:3;
799#endif
800}__attribute__ ((packed));
801
802/*! Handover Thresholds */
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400803struct ipac_preproc_ho_thresh {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100804#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400805 uint8_t l_rxlev_ul_h:6,
806 reserved_l_rxlev_ul:2;
807 uint8_t l_rxlev_dl_h:6,
808 reserved_l_rxlev_dl:2;
809 uint8_t rxlev_ul_ih:6,
810 reserved_rxlev_ul:2;
811 uint8_t rxlev_dl_ih:6,
812 reserved_rxlev_dl:2;
813 uint8_t l_rxqual_ul_h:3,
814 reserved_rxlqual_ul:1,
815 l_rxqual_dl_h:3,
816 reserved_rxqual_dl:1;
817 uint8_t ms_range_max:6,
818 reserved_ms_range:2;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100819#elif OSMO_IS_BIG_ENDIAN
820/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
821 uint8_t reserved_l_rxlev_ul:2, l_rxlev_ul_h:6;
822 uint8_t reserved_l_rxlev_dl:2, l_rxlev_dl_h:6;
823 uint8_t reserved_rxlev_ul:2, rxlev_ul_ih:6;
824 uint8_t reserved_rxlev_dl:2, rxlev_dl_ih:6;
825 uint8_t reserved_rxqual_dl:1, l_rxqual_dl_h:3, reserved_rxlqual_ul:1, l_rxqual_ul_h:3;
826 uint8_t reserved_ms_range:2, ms_range_max:6;
827#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400828}__attribute__ ((packed));
829
Vadim Yanitskiya346c452020-12-15 07:48:58 +0100830/*! PC Threshold Comparators */
831struct ipac_preproc_pc_comp {
832#if OSMO_IS_LITTLE_ENDIAN
833 uint8_t p1:5, reserved_p1:3;
834 uint8_t n1:5, reserved_n1:3;
835 uint8_t p2:5, reserved_p2:3;
836 uint8_t n2:5, reserved_n2:3;
837 uint8_t p3:5, reserved_p3:3;
838 uint8_t n3:5, reserved_n3:3;
839 uint8_t p4:5, reserved_p4:3;
840 uint8_t n4:5, reserved_n4:3;
841 uint8_t pc_interval:5, reserved_pc:3;
842 uint8_t red_step_size:4, inc_step_size:4;
843#elif OSMO_IS_BIG_ENDIAN
844 uint8_t reserved_p1:3, p1:5;
845 uint8_t reserved_n1:3, n1:5;
846 uint8_t reserved_p2:3, p2:5;
847 uint8_t reserved_n2:3, n2:5;
848 uint8_t reserved_p3:3, p3:5;
849 uint8_t reserved_n3:3, n3:5;
850 uint8_t reserved_p4:3, p4:5;
851 uint8_t reserved_n4:3, n4:5;
852 uint8_t reserved_pc:3, pc_interval:5;
853 uint8_t inc_step_size:4, red_step_size:4;
854#endif
855}__attribute__ ((packed));
856
857/*! HO Threshold Comparators */
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400858struct ipac_preproc_ho_comp {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100859#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400860 uint8_t p5:5,
861 reserved_p5:3;
862 uint8_t n5:5,
863 reserved_n5:3;
864 uint8_t p6:5,
865 reserved_p6:3;
866 uint8_t n6:5,
867 reserved_n6:3;
868 uint8_t p7:5,
869 reserved_p7:3;
870 uint8_t n7:5,
871 reserved_n7:3;
872 uint8_t p8:5,
873 reserved_p8:3;
874 uint8_t n8:5,
875 reserved_n8:3;
876 uint8_t ho_interval:5,
877 reserved_ho:3;
878 uint8_t reserved;
879
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100880#elif OSMO_IS_BIG_ENDIAN
881/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
882 uint8_t reserved_p5:3, p5:5;
883 uint8_t reserved_n5:3, n5:5;
884 uint8_t reserved_p6:3, p6:5;
885 uint8_t reserved_n6:3, n6:5;
886 uint8_t reserved_p7:3, p7:5;
887 uint8_t reserved_n7:3, n7:5;
888 uint8_t reserved_p8:3, p8:5;
889 uint8_t reserved_n8:3, n8:5;
890 uint8_t reserved_ho:3, ho_interval:5;
891 uint8_t reserved;
892#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400893}__attribute__ ((packed));
894
895struct ipac_preproc_ho_candidates {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100896#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400897 uint8_t bsic:6,
898 reserved0:2;
899 uint8_t bcch_freq:5,
900 ba_used:1,
901 s:1,
902 reserved1:1;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100903#elif OSMO_IS_BIG_ENDIAN
904/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
905 uint8_t reserved0:2, bsic:6;
906 uint8_t reserved1:1, s:1, ba_used:1, bcch_freq:5;
907#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400908}__attribute__ ((packed));
909
910struct ipac_preproc_ncell_dflts {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100911#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400912 uint8_t rxlev_min_def:6,
913 reserved_rxlev_min_def:2;
914 uint8_t ho_margin_def:5,
915 reserved_ho_margin_def:3;
916 uint8_t ms_txpwr_max_def:5,
917 reserved_ms_txpwr_max_def:3;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100918#elif OSMO_IS_BIG_ENDIAN
919/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
920 uint8_t reserved_rxlev_min_def:2, rxlev_min_def:6;
921 uint8_t reserved_ho_margin_def:3, ho_margin_def:5;
922 uint8_t reserved_ms_txpwr_max_def:3, ms_txpwr_max_def:5;
923#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400924}__attribute__ ((packed));
925
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -0500926struct ipac_preproc_ho_ctl_param {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100927#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -0500928 uint8_t sdcch_ho_gsm:1,
929 sdcch_ho_umts:1,
930 reserved:6;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100931#elif OSMO_IS_BIG_ENDIAN
932/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
933 uint8_t reserved:6, sdcch_ho_umts:1, sdcch_ho_gsm:1;
934#endif
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -0500935}__attribute__ ((packed));
936
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400937struct ipac_preproc_cfg {
938 uint8_t meas_rep_mode;
939 uint32_t meas_mode_flags;
940 struct ipac_preproc_ave_cfg ms_ave_cfg[3];
941 struct ipac_preproc_ave_cfg ave_cfg;
942 struct ipac_preproc_ho_thresh ho_thresh;
943 struct ipac_preproc_ho_comp ho_comp;
944 struct ipac_preproc_ncell_dflts ncell_dflts;
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -0500945 struct ipac_preproc_ho_ctl_param ho_ctl_param;
Harald Weltefad57522015-12-13 11:56:36 +0100946};
947
Sylvain Munautdca7d2c2012-04-18 21:53:23 +0200948/*! @} */