blob: 79ddb68561fafa7f586e7e761b0d4630e86e4996 [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};
Vadim Yanitskiy307b2012021-04-19 04:42:34 +0200482#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#define RSL_CMOD_CRT_TCH_BI_Bm 0x0a /* full-rate: bi-directional (multislot) */
486#define RSL_CMOD_CRT_TCH_UNI_Bm 0x1a /* full-rate: uni-directional (multislot) */
487#define RSL_CMOD_CRT_TCH_GROUP_Bm 0x18 /* full-rate: group call channel */
488#define RSL_CMOD_CRT_TCH_GROUP_Lm 0x19 /* half-rate: group call channel */
489#define RSL_CMOD_CRT_TCH_BCAST_Bm 0x28 /* full-rate: broadcast call channel */
490#define RSL_CMOD_CRT_TCH_BCAST_Lm 0x29 /* half-rate: broadcast call channel */
Harald Welteec8b4502010-02-20 20:34:29 +0100491/* Speech */
492#define RSL_CMOD_SP_GSM1 0x01
493#define RSL_CMOD_SP_GSM2 0x11
494#define RSL_CMOD_SP_GSM3 0x21
Vadim Yanitskiy99f6cd52021-04-19 04:26:10 +0200495#define RSL_CMOD_SP_GSM4 0x31
496#define RSL_CMOD_SP_GSM5 0x09
497#define RSL_CMOD_SP_GSM6 0x0d
Vadim Yanitskiye731a7d2021-04-19 04:59:51 +0200498/* non-transparent data (asymmetric) */
499#define RSL_CMOD_CSD_NTA_43k5_14k5 0x61 /* asymmetric 43.5 kbit/s (DL) + 14.5 kbit/s (UL) */
500#define RSL_CMOD_CSD_NTA_29k0_14k5 0x62 /* asymmetric 29.0 kbit/s (DL) + 14.5 kbit/s (UL) */
501#define RSL_CMOD_CSD_NTA_43k5_29k0 0x63 /* asymmetric 43.5 kbit/s (DL) + 29.0 kbit/s (UL) */
502#define RSL_CMOD_CSD_NTA_14k5_43k5 0x69 /* asymmetric 14.5 kbit/s (DL) + 43.5 kbit/s (UL) */
503#define RSL_CMOD_CSD_NTA_14k5_29k0 0x6a /* asymmetric 14.5 kbit/s (DL) + 29.0 kbit/s (UL) */
504#define RSL_CMOD_CSD_NTA_29k0_43k5 0x6b /* asymmetric 29.0 kbit/s (DL) + 43.5 kbit/s (UL) */
Harald Welteeed26112012-08-24 15:35:34 +0200505/* non-transparent data */
506#define RSL_CMOD_CSD_NT_43k5 0x74
507#define RSL_CMOD_CSD_NT_28k8 0x71
508#define RSL_CMOD_CSD_NT_14k5 0x58
509#define RSL_CMOD_CSD_NT_12k0 0x50
510#define RSL_CMOD_CSD_NT_6k0 0x51
511/* legacy #defines with wrong name */
512#define RSL_CMOD_SP_NT_14k5 RSL_CMOD_CSD_NT_14k5
513#define RSL_CMOD_SP_NT_12k0 RSL_CMOD_CSD_NT_12k0
514#define RSL_CMOD_SP_NT_6k0 RSL_CMOD_CSD_NT_6k0
515/* transparent data */
516#define RSL_CMOD_CSD_T_32000 0x38
517#define RSL_CMOD_CSD_T_29000 0x39
518#define RSL_CMOD_CSD_T_14400 0x18
519#define RSL_CMOD_CSD_T_9600 0x10
520#define RSL_CMOD_CSD_T_4800 0x11
521#define RSL_CMOD_CSD_T_2400 0x12
522#define RSL_CMOD_CSD_T_1200 0x13
523#define RSL_CMOD_CSD_T_600 0x14
524#define RSL_CMOD_CSD_T_1200_75 0x15
Harald Welteec8b4502010-02-20 20:34:29 +0100525
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200526/*! RSL Channel Identification IE (Chapter 9.3.5) */
Harald Welteec8b4502010-02-20 20:34:29 +0100527struct rsl_ie_chan_ident {
528 /* GSM 04.08 10.5.2.5 */
529 struct {
530 uint8_t iei;
531 uint8_t chan_nr; /* enc_chan_nr */
532 uint8_t oct3;
533 uint8_t oct4;
534 } chan_desc;
535#if 0 /* spec says we need this but Abissim doesn't use it */
536 struct {
537 uint8_t tag;
538 uint8_t len;
539 } mobile_alloc;
540#endif
541} __attribute__ ((packed));
542
543/* Chapter 9.3.22 */
544#define RLL_CAUSE_T200_EXPIRED 0x01
545#define RLL_CAUSE_REEST_REQ 0x02
546#define RLL_CAUSE_UNSOL_UA_RESP 0x03
547#define RLL_CAUSE_UNSOL_DM_RESP 0x04
548#define RLL_CAUSE_UNSOL_DM_RESP_MF 0x05
549#define RLL_CAUSE_UNSOL_SPRV_RESP 0x06
550#define RLL_CAUSE_SEQ_ERR 0x07
551#define RLL_CAUSE_UFRM_INC_PARAM 0x08
552#define RLL_CAUSE_SFRM_INC_PARAM 0x09
553#define RLL_CAUSE_IFRM_INC_MBITS 0x0a
554#define RLL_CAUSE_IFRM_INC_LEN 0x0b
555#define RLL_CAUSE_FRM_UNIMPL 0x0c
556#define RLL_CAUSE_SABM_MF 0x0d
557#define RLL_CAUSE_SABM_INFO_NOTALL 0x0e
558
559/* Chapter 9.3.26 */
560#define RSL_ERRCLS_NORMAL 0x00
561#define RSL_ERRCLS_RESOURCE_UNAVAIL 0x20
562#define RSL_ERRCLS_SERVICE_UNAVAIL 0x30
563#define RSL_ERRCLS_SERVICE_UNIMPL 0x40
564#define RSL_ERRCLS_INVAL_MSG 0x50
565#define RSL_ERRCLS_PROTO_ERROR 0x60
566#define RSL_ERRCLS_INTERWORKING 0x70
567
568/* normal event */
569#define RSL_ERR_RADIO_IF_FAIL 0x00
570#define RSL_ERR_RADIO_LINK_FAIL 0x01
571#define RSL_ERR_HANDOVER_ACC_FAIL 0x02
572#define RSL_ERR_TALKER_ACC_FAIL 0x03
573#define RSL_ERR_OM_INTERVENTION 0x07
574#define RSL_ERR_NORMAL_UNSPEC 0x0f
575#define RSL_ERR_T_MSRFPCI_EXP 0x18
576/* resource unavailable */
577#define RSL_ERR_EQUIPMENT_FAIL 0x20
578#define RSL_ERR_RR_UNAVAIL 0x21
579#define RSL_ERR_TERR_CH_FAIL 0x22
580#define RSL_ERR_CCCH_OVERLOAD 0x23
581#define RSL_ERR_ACCH_OVERLOAD 0x24
582#define RSL_ERR_PROCESSOR_OVERLOAD 0x25
Philipp Maier6d214482020-07-28 16:53:27 +0200583#define RSL_ERR_BTS_NOT_EQUIPPED 0x27
584#define RSL_ERR_REMOTE_TRANSC_FAIL 0x28
585#define RSL_ERR_NOTIFICATION_OVERFL 0x29
Harald Welteec8b4502010-02-20 20:34:29 +0100586#define RSL_ERR_RES_UNAVAIL 0x2f
587/* service or option not available */
588#define RSL_ERR_TRANSC_UNAVAIL 0x30
589#define RSL_ERR_SERV_OPT_UNAVAIL 0x3f
590/* service or option not implemented */
591#define RSL_ERR_ENCR_UNIMPL 0x40
592#define RSL_ERR_SERV_OPT_UNIMPL 0x4f
593/* invalid message */
594#define RSL_ERR_RCH_ALR_ACTV_ALLOC 0x50
595#define RSL_ERR_INVALID_MESSAGE 0x5f
596/* protocol error */
597#define RSL_ERR_MSG_DISCR 0x60
598#define RSL_ERR_MSG_TYPE 0x61
599#define RSL_ERR_MSG_SEQ 0x62
600#define RSL_ERR_IE_ERROR 0x63
601#define RSL_ERR_MAND_IE_ERROR 0x64
602#define RSL_ERR_OPT_IE_ERROR 0x65
603#define RSL_ERR_IE_NONEXIST 0x66
604#define RSL_ERR_IE_LENGTH 0x67
605#define RSL_ERR_IE_CONTENT 0x68
606#define RSL_ERR_PROTO 0x6f
607/* interworking */
608#define RSL_ERR_INTERWORKING 0x7f
609
610/* Chapter 9.3.30 */
611#define RSL_SYSTEM_INFO_8 0x00
612#define RSL_SYSTEM_INFO_1 0x01
613#define RSL_SYSTEM_INFO_2 0x02
614#define RSL_SYSTEM_INFO_3 0x03
615#define RSL_SYSTEM_INFO_4 0x04
616#define RSL_SYSTEM_INFO_5 0x05
617#define RSL_SYSTEM_INFO_6 0x06
618#define RSL_SYSTEM_INFO_7 0x07
619#define RSL_SYSTEM_INFO_16 0x08
620#define RSL_SYSTEM_INFO_17 0x09
621#define RSL_SYSTEM_INFO_2bis 0x0a
622#define RSL_SYSTEM_INFO_2ter 0x0b
623#define RSL_SYSTEM_INFO_5bis 0x0d
624#define RSL_SYSTEM_INFO_5ter 0x0e
625#define RSL_SYSTEM_INFO_10 0x0f
Harald Welte3d732272011-06-25 21:39:01 +0200626#define RSL_EXT_MEAS_ORDER 0x47
Harald Welteec8b4502010-02-20 20:34:29 +0100627#define RSL_MEAS_INFO 0x48
628#define RSL_SYSTEM_INFO_13 0x28
Philipp00b15392016-11-14 12:34:15 +0100629#define RSL_ERIC_SYSTEM_INFO_13 0x0C
Harald Welteec8b4502010-02-20 20:34:29 +0100630#define RSL_SYSTEM_INFO_2quater 0x29
631#define RSL_SYSTEM_INFO_9 0x2a
632#define RSL_SYSTEM_INFO_18 0x2b
633#define RSL_SYSTEM_INFO_19 0x2c
634#define RSL_SYSTEM_INFO_20 0x2d
635
636/* Chapter 9.3.40 */
637#define RSL_CHANNEED_ANY 0x00
638#define RSL_CHANNEED_SDCCH 0x01
639#define RSL_CHANNEED_TCH_F 0x02
640#define RSL_CHANNEED_TCH_ForH 0x03
641
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200642/*! RSL Cell Broadcast Command (Chapter 9.3.45) */
Alex Badea84930182010-11-27 23:34:46 +0200643struct rsl_ie_cb_cmd_type {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100644#if OSMO_IS_LITTLE_ENDIAN
Alex Badea84930182010-11-27 23:34:46 +0200645 uint8_t last_block:2;
646 uint8_t spare:1;
647 uint8_t def_bcast:1;
648 uint8_t command:4;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100649#elif OSMO_IS_BIG_ENDIAN
650/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
651 uint8_t command:4, def_bcast:1, spare:1, last_block:2;
652#endif
Alex Badea84930182010-11-27 23:34:46 +0200653} __attribute__ ((packed));
654/* ->command */
655#define RSL_CB_CMD_TYPE_NORMAL 0x00
656#define RSL_CB_CMD_TYPE_SCHEDULE 0x08
657#define RSL_CB_CMD_TYPE_DEFAULT 0x0e
658#define RSL_CB_CMD_TYPE_NULL 0x0f
659/* ->def_bcast */
660#define RSL_CB_CMD_DEFBCAST_NORMAL 0
661#define RSL_CB_CMD_DEFBCAST_NULL 1
662/* ->last_block */
663#define RSL_CB_CMD_LASTBLOCK_4 0
664#define RSL_CB_CMD_LASTBLOCK_1 1
665#define RSL_CB_CMD_LASTBLOCK_2 2
666#define RSL_CB_CMD_LASTBLOCK_3 3
667
Harald Welteec8b4502010-02-20 20:34:29 +0100668/* Chapter 3.3.2.3 Brocast control channel */
669/* CCCH-CONF, NC is not combined */
670#define RSL_BCCH_CCCH_CONF_1_NC 0x00
671#define RSL_BCCH_CCCH_CONF_1_C 0x01
672#define RSL_BCCH_CCCH_CONF_2_NC 0x02
673#define RSL_BCCH_CCCH_CONF_3_NC 0x04
674#define RSL_BCCH_CCCH_CONF_4_NC 0x06
675
676/* BS-PA-MFRMS */
677#define RSL_BS_PA_MFRMS_2 0x00
678#define RSL_BS_PA_MFRMS_3 0x01
679#define RSL_BS_PA_MFRMS_4 0x02
680#define RSL_BS_PA_MFRMS_5 0x03
681#define RSL_BS_PA_MFRMS_6 0x04
682#define RSL_BS_PA_MFRMS_7 0x05
683#define RSL_BS_PA_MFRMS_8 0x06
684#define RSL_BS_PA_MFRMS_9 0x07
685
686/* RSL_IE_IPAC_RTP_PAYLOAD[2] */
687enum rsl_ipac_rtp_payload {
688 RSL_IPAC_RTP_GSM = 1,
689 RSL_IPAC_RTP_EFR,
690 RSL_IPAC_RTP_AMR,
691 RSL_IPAC_RTP_CSD,
692 RSL_IPAC_RTP_MUX,
693};
694
695/* RSL_IE_IPAC_SPEECH_MODE, lower four bits */
696enum rsl_ipac_speech_mode_s {
697 RSL_IPAC_SPEECH_GSM_FR = 0, /* GSM FR (Type 1, FS) */
698 RSL_IPAC_SPEECH_GSM_EFR = 1, /* GSM EFR (Type 2, FS) */
699 RSL_IPAC_SPEECH_GSM_AMR_FR = 2, /* GSM AMR/FR (Type 3, FS) */
700 RSL_IPAC_SPEECH_GSM_HR = 3, /* GSM HR (Type 1, HS) */
701 RSL_IPAC_SPEECH_GSM_AMR_HR = 5, /* GSM AMR/hr (Type 3, HS) */
702 RSL_IPAC_SPEECH_AS_RTP = 0xf, /* As specified by RTP Payload IE */
703};
704/* RSL_IE_IPAC_SPEECH_MODE, upper four bits */
705enum rsl_ipac_speech_mode_m {
706 RSL_IPAC_SPEECH_M_RXTX = 0, /* Send and Receive */
707 RSL_IPAC_SPEECH_M_RX = 1, /* Receive only */
708 RSL_IPAC_SPEECH_M_TX = 2, /* Send only */
709};
710
711/* RSL_IE_IPAC_RTP_CSD_FMT, lower four bits */
712enum rsl_ipac_rtp_csd_format_d {
713 RSL_IPAC_RTP_CSD_EXT_TRAU = 0,
714 RSL_IPAC_RTP_CSD_NON_TRAU = 1,
715 RSL_IPAC_RTP_CSD_TRAU_BTS = 2,
716 RSL_IPAC_RTP_CSD_IWF_FREE = 3,
717};
718/* RSL_IE_IPAC_RTP_CSD_FMT, upper four bits */
719enum rsl_ipac_rtp_csd_format_ir {
720 RSL_IPAC_RTP_CSD_IR_8k = 0,
721 RSL_IPAC_RTP_CSD_IR_16k = 1,
722 RSL_IPAC_RTP_CSD_IR_32k = 2,
723 RSL_IPAC_RTP_CSD_IR_64k = 3,
724};
725
726/* Siemens vendor-specific RSL extensions */
727struct rsl_mrpci {
728 uint8_t power_class:3,
729 vgcs_capable:1,
730 vbs_capable:1,
731 gsm_phase:2;
732} __attribute__ ((packed));
733
734enum rsl_mrpci_pwrclass {
735 RSL_MRPCI_PWRC_1 = 0,
736 RSL_MRPCI_PWRC_2 = 1,
737 RSL_MRPCI_PWRC_3 = 2,
738 RSL_MRPCI_PWRC_4 = 3,
739 RSL_MRPCI_PWRC_5 = 4,
740};
741enum rsl_mrpci_phase {
742 RSL_MRPCI_PHASE_1 = 0,
743 /* reserved */
744 RSL_MRPCI_PHASE_2 = 2,
745 RSL_MRPCI_PHASE_2PLUS = 3,
746};
747
Holger Hans Peter Freyther0357e9b2012-12-06 11:57:31 +0100748/* 9.3.20 Release Mode */
749enum rsl_rel_mode {
750 RSL_REL_NORMAL = 0,
751 RSL_REL_LOCAL_END = 1,
752};
753
Neels Hofmeyr87e45502017-06-20 00:17:59 +0200754/*! ip.access specific embedded information elements */
Harald Weltefad57522015-12-13 11:56:36 +0100755enum rsl_ipac_embedded_ie {
756 RSL_IPAC_EIE_RXLEV = 0x00,
757 RSL_IPAC_EIE_RXQUAL = 0x01,
758 RSL_IPAC_EIE_FREQ_ERR = 0x02,
759 RSL_IPAC_EIE_TIMING_ERR = 0x03,
760 RSL_IPAC_EIE_MEAS_AVG_CFG = 0x04,
761 RSL_IPAC_EIE_BS_PWR_CTL = 0x05,
762 RSL_IPAC_EIE_MS_PWR_CTL = 0x06,
763 RSL_IPAC_EIE_HANDO_THRESH = 0x07,
764 RSL_IPAC_EIE_NCELL_DEFAULTS = 0x08,
765 RSL_IPAC_EIE_NCELL_LIST = 0x09,
766 RSL_IPAC_EIE_PC_THRESH_COMP = 0x0a,
767 RSL_IPAC_EIE_HO_THRESH_COMP = 0x0b,
768 RSL_IPAC_EIE_HO_CAUSE = 0x0c,
769 RSL_IPAC_EIE_HO_CANDIDATES = 0x0d,
770 RSL_IPAC_EIE_NCELL_BA_CHG_LIST = 0x0e,
771 RSL_IPAC_EIE_NUM_OF_MS = 0x10,
772 RSL_IPAC_EIE_HO_CAND_EXT = 0x11,
773 RSL_IPAC_EIE_NCELL_DEF_EXT = 0x12,
774 RSL_IPAC_EIE_NCELL_LIST_EXT = 0x13,
775 RSL_IPAC_EIE_MASTER_KEY = 0x14,
776 RSL_IPAC_EIE_MASTER_SALT = 0x15,
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400777 /* additional IPAC measurement pre-processing related IEI */
778 RSL_IPAC_EIE_MEAS_TRANS_RES = 0x16,
779 RSL_IPAC_EIE_3G_HO_PARAM = 0x17,
780 RSL_IPAC_EIE_3G_NCELL_LIST = 0x18,
781 RSL_IPAC_EIE_SDCCH_CTL_PARAM = 0x1a,
782 RSL_IPAC_EIE_AMR_CONV_THRESH = 0x1b,
783
784};
785
786struct ipac_preproc_ave_cfg {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100787#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400788 uint8_t h_reqave:5,
789 param_id:2,
790 reserved:1;
791 uint8_t h_reqt:5,
792 ave_method:3;
Vadim Yanitskiy8f5844e2020-12-25 00:19:45 +0100793 uint8_t params[0];
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100794#elif OSMO_IS_BIG_ENDIAN
795/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
796 uint8_t reserved:1, param_id:2, h_reqave:5;
797 uint8_t ave_method:3, h_reqt:5;
Vadim Yanitskiy8f5844e2020-12-25 00:19:45 +0100798 uint8_t params[0];
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100799#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400800}__attribute__ ((packed));
801
Vadim Yanitskiya346c452020-12-15 07:48:58 +0100802/*! MS/BS Power Control Thresholds */
803struct ipac_preproc_pc_thresh {
804#if OSMO_IS_LITTLE_ENDIAN
805 uint8_t l_rxlev:6, reserved_l_rxlev:2;
806 uint8_t u_rxlev:6, reserved_u_rxlev:2;
Vadim Yanitskiy2060bbb2020-12-19 17:33:41 +0100807 uint8_t u_rxqual:3, reserved_u_rxqual:1,
808 l_rxqual:3, reserved_l_rxqual:1;
Vadim Yanitskiya346c452020-12-15 07:48:58 +0100809#elif OSMO_IS_BIG_ENDIAN
810 uint8_t reserved_l_rxlev:2, l_rxlev:6;
811 uint8_t reserved_u_rxlev:2, u_rxlev:6;
812 uint8_t reserved_l_rxqual:1, l_rxqual:3,
813 reserved_u_rxqual:1, u_rxqual:3;
814#endif
815}__attribute__ ((packed));
816
817/*! Handover Thresholds */
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400818struct ipac_preproc_ho_thresh {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100819#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400820 uint8_t l_rxlev_ul_h:6,
821 reserved_l_rxlev_ul:2;
822 uint8_t l_rxlev_dl_h:6,
823 reserved_l_rxlev_dl:2;
824 uint8_t rxlev_ul_ih:6,
825 reserved_rxlev_ul:2;
826 uint8_t rxlev_dl_ih:6,
827 reserved_rxlev_dl:2;
828 uint8_t l_rxqual_ul_h:3,
829 reserved_rxlqual_ul:1,
830 l_rxqual_dl_h:3,
831 reserved_rxqual_dl:1;
832 uint8_t ms_range_max:6,
833 reserved_ms_range:2;
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 reserved_l_rxlev_ul:2, l_rxlev_ul_h:6;
837 uint8_t reserved_l_rxlev_dl:2, l_rxlev_dl_h:6;
838 uint8_t reserved_rxlev_ul:2, rxlev_ul_ih:6;
839 uint8_t reserved_rxlev_dl:2, rxlev_dl_ih:6;
840 uint8_t reserved_rxqual_dl:1, l_rxqual_dl_h:3, reserved_rxlqual_ul:1, l_rxqual_ul_h:3;
841 uint8_t reserved_ms_range:2, ms_range_max:6;
842#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400843}__attribute__ ((packed));
844
Vadim Yanitskiya346c452020-12-15 07:48:58 +0100845/*! PC Threshold Comparators */
846struct ipac_preproc_pc_comp {
847#if OSMO_IS_LITTLE_ENDIAN
848 uint8_t p1:5, reserved_p1:3;
849 uint8_t n1:5, reserved_n1:3;
850 uint8_t p2:5, reserved_p2:3;
851 uint8_t n2:5, reserved_n2:3;
852 uint8_t p3:5, reserved_p3:3;
853 uint8_t n3:5, reserved_n3:3;
854 uint8_t p4:5, reserved_p4:3;
855 uint8_t n4:5, reserved_n4:3;
856 uint8_t pc_interval:5, reserved_pc:3;
857 uint8_t red_step_size:4, inc_step_size:4;
858#elif OSMO_IS_BIG_ENDIAN
859 uint8_t reserved_p1:3, p1:5;
860 uint8_t reserved_n1:3, n1:5;
861 uint8_t reserved_p2:3, p2:5;
862 uint8_t reserved_n2:3, n2:5;
863 uint8_t reserved_p3:3, p3:5;
864 uint8_t reserved_n3:3, n3:5;
865 uint8_t reserved_p4:3, p4:5;
866 uint8_t reserved_n4:3, n4:5;
867 uint8_t reserved_pc:3, pc_interval:5;
868 uint8_t inc_step_size:4, red_step_size:4;
869#endif
870}__attribute__ ((packed));
871
872/*! HO Threshold Comparators */
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400873struct ipac_preproc_ho_comp {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100874#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400875 uint8_t p5:5,
876 reserved_p5:3;
877 uint8_t n5:5,
878 reserved_n5:3;
879 uint8_t p6:5,
880 reserved_p6:3;
881 uint8_t n6:5,
882 reserved_n6:3;
883 uint8_t p7:5,
884 reserved_p7:3;
885 uint8_t n7:5,
886 reserved_n7:3;
887 uint8_t p8:5,
888 reserved_p8:3;
889 uint8_t n8:5,
890 reserved_n8:3;
891 uint8_t ho_interval:5,
892 reserved_ho:3;
893 uint8_t reserved;
894
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100895#elif OSMO_IS_BIG_ENDIAN
896/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
897 uint8_t reserved_p5:3, p5:5;
898 uint8_t reserved_n5:3, n5:5;
899 uint8_t reserved_p6:3, p6:5;
900 uint8_t reserved_n6:3, n6:5;
901 uint8_t reserved_p7:3, p7:5;
902 uint8_t reserved_n7:3, n7:5;
903 uint8_t reserved_p8:3, p8:5;
904 uint8_t reserved_n8:3, n8:5;
905 uint8_t reserved_ho:3, ho_interval:5;
906 uint8_t reserved;
907#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400908}__attribute__ ((packed));
909
910struct ipac_preproc_ho_candidates {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100911#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400912 uint8_t bsic:6,
913 reserved0:2;
914 uint8_t bcch_freq:5,
915 ba_used:1,
916 s:1,
917 reserved1:1;
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 reserved0:2, bsic:6;
921 uint8_t reserved1:1, s:1, ba_used:1, bcch_freq:5;
922#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400923}__attribute__ ((packed));
924
925struct ipac_preproc_ncell_dflts {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100926#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400927 uint8_t rxlev_min_def:6,
928 reserved_rxlev_min_def:2;
929 uint8_t ho_margin_def:5,
930 reserved_ho_margin_def:3;
931 uint8_t ms_txpwr_max_def:5,
932 reserved_ms_txpwr_max_def:3;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100933#elif OSMO_IS_BIG_ENDIAN
934/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
935 uint8_t reserved_rxlev_min_def:2, rxlev_min_def:6;
936 uint8_t reserved_ho_margin_def:3, ho_margin_def:5;
937 uint8_t reserved_ms_txpwr_max_def:3, ms_txpwr_max_def:5;
938#endif
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400939}__attribute__ ((packed));
940
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -0500941struct ipac_preproc_ho_ctl_param {
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100942#if OSMO_IS_LITTLE_ENDIAN
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -0500943 uint8_t sdcch_ho_gsm:1,
944 sdcch_ho_umts:1,
945 reserved:6;
Neels Hofmeyrb2600392018-11-16 00:20:39 +0100946#elif OSMO_IS_BIG_ENDIAN
947/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
948 uint8_t reserved:6, sdcch_ho_umts:1, sdcch_ho_gsm:1;
949#endif
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -0500950}__attribute__ ((packed));
951
Minh-Quang Nguyen17a87482016-09-02 11:28:31 -0400952struct ipac_preproc_cfg {
953 uint8_t meas_rep_mode;
954 uint32_t meas_mode_flags;
955 struct ipac_preproc_ave_cfg ms_ave_cfg[3];
956 struct ipac_preproc_ave_cfg ave_cfg;
957 struct ipac_preproc_ho_thresh ho_thresh;
958 struct ipac_preproc_ho_comp ho_comp;
959 struct ipac_preproc_ncell_dflts ncell_dflts;
Minh-Quang Nguyenadc28dc2017-02-06 11:13:31 -0500960 struct ipac_preproc_ho_ctl_param ho_ctl_param;
Harald Weltefad57522015-12-13 11:56:36 +0100961};
962
Philipp Maierca770ae2021-02-16 17:31:22 +0100963struct rsl_l1_info {
964#if OSMO_IS_BIG_ENDIAN
965 uint8_t ms_pwr:5,
966 fpc_epc:1,
967 srr_sro:1,
968 reserved:1;
969 uint8_t ta;
970#elif OSMO_IS_LITTLE_ENDIAN
971 uint8_t reserved:1,
972 srr_sro:1,
973 fpc_epc:1,
974 ms_pwr:5;
975 uint8_t ta;
976#endif
977} __attribute__ ((packed));
978
Sylvain Munautdca7d2c2012-04-18 21:53:23 +0200979/*! @} */