Neels Hofmeyr | 17518fe | 2017-06-20 04:35:06 +0200 | [diff] [blame] | 1 | /*! \file gsm_08_58.h |
| 2 | * GSM Radio Signalling Link messages on the A-bis interface. |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 3 | * 3GPP TS 08.58 version 8.6.0 Release 1999 / ETSI TS 100 596 V8.6.0 */ |
Neels Hofmeyr | 17518fe | 2017-06-20 04:35:06 +0200 | [diff] [blame] | 4 | /* |
| 5 | * (C) 2008 by Harald Welte <laforge@gnumonks.org> |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 6 | * 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 | * |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 18 | */ |
| 19 | |
Neels Hofmeyr | 17518fe | 2017-06-20 04:35:06 +0200 | [diff] [blame] | 20 | #pragma once |
| 21 | |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 22 | #include <stdint.h> |
| 23 | |
Pau Espin Pedrol | 4290803 | 2018-10-10 17:04:28 +0200 | [diff] [blame] | 24 | #include <osmocom/core/endian.h> |
| 25 | |
Harald Welte | 8f2c7e5 | 2011-08-17 18:52:03 +0200 | [diff] [blame] | 26 | /*! \addtogroup rsl |
| 27 | * @{ |
Neels Hofmeyr | 17518fe | 2017-06-20 04:35:06 +0200 | [diff] [blame] | 28 | * \file gsm_08_58.h */ |
Harald Welte | 8f2c7e5 | 2011-08-17 18:52:03 +0200 | [diff] [blame] | 29 | |
Pau Espin Pedrol | fb97e72 | 2018-10-10 20:41:40 +0200 | [diff] [blame] | 30 | /* Channel Number 9.3.1 */ |
| 31 | union abis_rsl_chan_nr { |
| 32 | #if OSMO_IS_BIG_ENDIAN |
| 33 | uint8_t cbits:5, |
| 34 | tn:3; |
| 35 | #elif OSMO_IS_LITTLE_ENDIAN |
| 36 | uint8_t tn:3, |
| 37 | cbits:5; |
| 38 | #endif |
| 39 | uint8_t chan_nr; |
| 40 | } __attribute__ ((packed)); |
| 41 | #define ABIS_RSL_CHAN_NR_CBITS_Bm_ACCHs 0x01 |
| 42 | #define ABIS_RSL_CHAN_NR_CBITS_Lm_ACCHs(ss) (0x02 + (ss)) |
| 43 | #define ABIS_RSL_CHAN_NR_CBITS_SDCCH4_ACCH(ss) (0x04 + (ss)) |
| 44 | #define ABIS_RSL_CHAN_NR_CBITS_SDCCH8_ACCH(ss) (0x08 + (ss)) |
| 45 | #define ABIS_RSL_CHAN_NR_CBITS_BCCH 0x10 |
| 46 | #define ABIS_RSL_CHAN_NR_CBITS_RACH 0x11 |
| 47 | #define ABIS_RSL_CHAN_NR_CBITS_PCH_AGCH 0x12 |
| 48 | #define ABIS_RSL_CHAN_NR_CBITS_OSMO_PDCH 0x18 /*< non-standard, for dyn TS */ |
Harald Welte | a8d7ebb | 2019-05-27 16:51:23 +0200 | [diff] [blame] | 49 | #define ABIS_RSL_CHAN_NR_CBITS_OSMO_CBCH4 0x19 /*< non-standard, for CBCH/SDCCH4 */ |
| 50 | #define ABIS_RSL_CHAN_NR_CBITS_OSMO_CBCH8 0x1a /*< non-standard, for CBCH/SDCCH8 */ |
Pau Espin Pedrol | fb97e72 | 2018-10-10 20:41:40 +0200 | [diff] [blame] | 51 | |
Vadim Yanitskiy | fc02ff4 | 2021-05-26 18:19:03 +0200 | [diff] [blame] | 52 | /* non-standard, Osmocom specific Bm/Lm equivalents for VAMOS */ |
| 53 | #define ABIS_RSL_CHAN_NR_CBITS_OSMO_VAMOS_Bm_ACCHs 0x1d /*< VAMOS TCH/F */ |
| 54 | #define ABIS_RSL_CHAN_NR_CBITS_OSMO_VAMOS_Lm_ACCHs(ss) (0x1e + (ss)) /*< VAMOS TCH/H */ |
| 55 | |
Pau Espin Pedrol | 4290803 | 2018-10-10 17:04:28 +0200 | [diff] [blame] | 56 | /* Link Identifier 9.3.2 */ |
| 57 | union abis_rsl_link_id { |
| 58 | #if OSMO_IS_BIG_ENDIAN |
| 59 | uint8_t cbits:2, |
| 60 | na:1, |
Martin Hauke | e63b887 | 2018-11-15 14:53:13 +0100 | [diff] [blame] | 61 | reserved:2, |
Pau Espin Pedrol | 4290803 | 2018-10-10 17:04:28 +0200 | [diff] [blame] | 62 | 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 Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 74 | /*! RSL common header */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 75 | struct abis_rsl_common_hdr { |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 76 | 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 Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 79 | } __attribute__ ((packed)); |
| 80 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 81 | /* RSL RLL header (Chapter 8.3) */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 82 | struct abis_rsl_rll_hdr { |
| 83 | struct abis_rsl_common_hdr c; |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 84 | uint8_t ie_chan; /*!< \ref RSL_IE_CHAN_NR (tag) */ |
Pau Espin Pedrol | fb97e72 | 2018-10-10 20:41:40 +0200 | [diff] [blame] | 85 | union { |
| 86 | uint8_t chan_nr; /* API backward compat */ |
| 87 | union abis_rsl_chan_nr chan_nr_fields; /*!< RSL channel number (value) */ |
| 88 | }; |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 89 | uint8_t ie_link_id; /*!< \ref RSL_IE_LINK_IDENT (tag) */ |
Pau Espin Pedrol | 4290803 | 2018-10-10 17:04:28 +0200 | [diff] [blame] | 90 | union { |
| 91 | uint8_t link_id; /* API backward compat */ |
| 92 | union abis_rsl_link_id link_id_fields; /*!< RSL link identifier (value) */ |
| 93 | }; |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 94 | uint8_t data[0]; /*!< message payload data */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 95 | } __attribute__ ((packed)); |
| 96 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 97 | /* RSL Dedicated Channel header (Chapter 8.3 and 8.4) */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 98 | struct abis_rsl_dchan_hdr { |
| 99 | struct abis_rsl_common_hdr c; |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 100 | uint8_t ie_chan; /*!< \ref RSL_IE_CHAN_NR (tag) */ |
Pau Espin Pedrol | fb97e72 | 2018-10-10 20:41:40 +0200 | [diff] [blame] | 101 | union { |
| 102 | uint8_t chan_nr; /* API backward compat */ |
| 103 | union abis_rsl_chan_nr chan_nr_fields; /*!< RSL channel number (value) */ |
| 104 | }; |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 105 | uint8_t data[0]; /*!< message payload data */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 106 | } __attribute__ ((packed)); |
| 107 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 108 | /* RSL Common Channel header (Chapter 8.5) */ |
Harald Welte | 6eb7d6c | 2010-07-13 13:48:13 +0200 | [diff] [blame] | 109 | struct abis_rsl_cchan_hdr { |
| 110 | struct abis_rsl_common_hdr c; |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 111 | uint8_t ie_chan; /*!< \ref RSL_IE_CHAN_NR (tag) */ |
Pau Espin Pedrol | fb97e72 | 2018-10-10 20:41:40 +0200 | [diff] [blame] | 112 | union { |
| 113 | uint8_t chan_nr; /* API backward compat */ |
| 114 | union abis_rsl_chan_nr chan_nr_fields; /*!< RSL channel number (value) */ |
| 115 | }; |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 116 | uint8_t data[0]; /*!< message payload data */ |
Harald Welte | 6eb7d6c | 2010-07-13 13:48:13 +0200 | [diff] [blame] | 117 | } __attribute__ ((packed)); |
| 118 | |
Philipp Maier | 439ddbe | 2020-11-16 17:49:34 +0100 | [diff] [blame] | 119 | /* Osmocom specific IE to negotiate repeated ACCH capabilities */ |
| 120 | struct abis_rsl_osmo_rep_acch_cap { |
Pau Espin Pedrol | 28c4388 | 2021-12-22 13:56:42 +0100 | [diff] [blame] | 121 | #if OSMO_IS_LITTLE_ENDIAN |
Philipp Maier | 55ce87d | 2021-08-31 09:24:37 +0200 | [diff] [blame] | 122 | uint8_t dl_facch_cmd:1, |
| 123 | dl_facch_all:1, |
| 124 | dl_sacch:1, |
| 125 | ul_sacch:1, |
| 126 | rxqual:3, |
| 127 | reserved:1; |
Pau Espin Pedrol | 28c4388 | 2021-12-22 13:56:42 +0100 | [diff] [blame] | 128 | #elif OSMO_IS_BIG_ENDIAN |
Oliver Smith | 0b5c09b | 2023-02-17 10:35:38 +0100 | [diff] [blame] | 129 | /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */ |
Pau Espin Pedrol | 28c4388 | 2021-12-22 13:56:42 +0100 | [diff] [blame] | 130 | uint8_t reserved:1, rxqual:3, ul_sacch:1, dl_sacch:1, dl_facch_all:1, dl_facch_cmd:1; |
Philipp Maier | 439ddbe | 2020-11-16 17:49:34 +0100 | [diff] [blame] | 131 | #endif |
| 132 | } __attribute__ ((packed)); |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 133 | |
Philipp Maier | 0e44a72 | 2021-08-30 10:51:52 +0200 | [diff] [blame] | 134 | /* Osmocom specific IE to negotiate temporary overpower of ACCH channels */ |
| 135 | struct abis_rsl_osmo_temp_ovp_acch_cap { |
Pau Espin Pedrol | 28c4388 | 2021-12-22 13:56:42 +0100 | [diff] [blame] | 136 | #if OSMO_IS_LITTLE_ENDIAN |
Vadim Yanitskiy | 8db64ee | 2021-10-20 14:36:18 +0300 | [diff] [blame] | 137 | uint8_t overpower_db:3, |
| 138 | rxqual:3, |
| 139 | facch_enable:1, |
| 140 | sacch_enable:1; |
Pau Espin Pedrol | 28c4388 | 2021-12-22 13:56:42 +0100 | [diff] [blame] | 141 | #elif OSMO_IS_BIG_ENDIAN |
Oliver Smith | 0b5c09b | 2023-02-17 10:35:38 +0100 | [diff] [blame] | 142 | /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */ |
Pau Espin Pedrol | 28c4388 | 2021-12-22 13:56:42 +0100 | [diff] [blame] | 143 | uint8_t sacch_enable:1, facch_enable:1, rxqual:3, overpower_db:3; |
Vadim Yanitskiy | 8db64ee | 2021-10-20 14:36:18 +0300 | [diff] [blame] | 144 | #endif |
Philipp Maier | 0e44a72 | 2021-08-30 10:51:52 +0200 | [diff] [blame] | 145 | } __attribute__ ((packed)); |
| 146 | |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 147 | /* Chapter 9.1 */ |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 148 | /* RSL Message Discriminator: RLL */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 149 | #define ABIS_RSL_MDISC_RLL 0x02 |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 150 | /* RSL Message Discriminator: Dedicated Channel */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 151 | #define ABIS_RSL_MDISC_DED_CHAN 0x08 |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 152 | /* RSL Message Discriminator: Common Channel */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 153 | #define ABIS_RSL_MDISC_COM_CHAN 0x0c |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 154 | /* RSL Message Discriminator: TRX Management */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 155 | #define ABIS_RSL_MDISC_TRX 0x10 |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 156 | /* RSL Message Discriminator: Location Service */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 157 | #define ABIS_RSL_MDISC_LOC 0x20 |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 158 | /* RSL Message Discriminator: ip.access */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 159 | #define ABIS_RSL_MDISC_IPACCESS 0x7e |
| 160 | #define ABIS_RSL_MDISC_TRANSP 0x01 |
| 161 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 162 | /* Check if given RSL message discriminator is transparent */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 163 | #define ABIS_RSL_MDISC_IS_TRANSP(x) (x & 0x01) |
| 164 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 165 | /* RSL Message Type (Chapter 9.1) */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 166 | enum abis_rsl_msgtype { |
| 167 | /* Radio Link Layer Management */ |
| 168 | RSL_MT_DATA_REQ = 0x01, |
| 169 | RSL_MT_DATA_IND, |
| 170 | RSL_MT_ERROR_IND, |
| 171 | RSL_MT_EST_REQ, |
| 172 | RSL_MT_EST_CONF, |
| 173 | RSL_MT_EST_IND, |
| 174 | RSL_MT_REL_REQ, |
| 175 | RSL_MT_REL_CONF, |
| 176 | RSL_MT_REL_IND, |
| 177 | RSL_MT_UNIT_DATA_REQ, |
| 178 | RSL_MT_UNIT_DATA_IND, /* 0x0b */ |
Andreas Eversberg | 816e24c | 2010-06-25 02:50:56 +0200 | [diff] [blame] | 179 | RSL_MT_SUSP_REQ, /* non-standard elements */ |
| 180 | RSL_MT_SUSP_CONF, |
| 181 | RSL_MT_RES_REQ, |
| 182 | RSL_MT_RECON_REQ, /* 0x0f */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 183 | |
| 184 | /* Common Channel Management / TRX Management */ |
| 185 | RSL_MT_BCCH_INFO = 0x11, |
| 186 | RSL_MT_CCCH_LOAD_IND, |
| 187 | RSL_MT_CHAN_RQD, |
| 188 | RSL_MT_DELETE_IND, |
| 189 | RSL_MT_PAGING_CMD, |
| 190 | RSL_MT_IMMEDIATE_ASSIGN_CMD, |
| 191 | RSL_MT_SMS_BC_REQ, |
Harald Welte | 6eb7d6c | 2010-07-13 13:48:13 +0200 | [diff] [blame] | 192 | RSL_MT_CHAN_CONF, /* non-standard element */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 193 | /* empty */ |
| 194 | RSL_MT_RF_RES_IND = 0x19, |
| 195 | RSL_MT_SACCH_FILL, |
| 196 | RSL_MT_OVERLOAD, |
| 197 | RSL_MT_ERROR_REPORT, |
| 198 | RSL_MT_SMS_BC_CMD, |
| 199 | RSL_MT_CBCH_LOAD_IND, |
| 200 | RSL_MT_NOT_CMD, /* 0x1f */ |
| 201 | |
| 202 | /* Dedicate Channel Management */ |
| 203 | RSL_MT_CHAN_ACTIV = 0x21, |
| 204 | RSL_MT_CHAN_ACTIV_ACK, |
| 205 | RSL_MT_CHAN_ACTIV_NACK, |
| 206 | RSL_MT_CONN_FAIL, |
| 207 | RSL_MT_DEACTIVATE_SACCH, |
| 208 | RSL_MT_ENCR_CMD, |
| 209 | RSL_MT_HANDO_DET, |
| 210 | RSL_MT_MEAS_RES, |
| 211 | RSL_MT_MODE_MODIFY_REQ, |
| 212 | RSL_MT_MODE_MODIFY_ACK, |
| 213 | RSL_MT_MODE_MODIFY_NACK, |
| 214 | RSL_MT_PHY_CONTEXT_REQ, |
| 215 | RSL_MT_PHY_CONTEXT_CONF, |
| 216 | RSL_MT_RF_CHAN_REL, |
| 217 | RSL_MT_MS_POWER_CONTROL, |
| 218 | RSL_MT_BS_POWER_CONTROL, /* 0x30 */ |
| 219 | RSL_MT_PREPROC_CONFIG, |
| 220 | RSL_MT_PREPROC_MEAS_RES, |
| 221 | RSL_MT_RF_CHAN_REL_ACK, |
| 222 | RSL_MT_SACCH_INFO_MODIFY, |
| 223 | RSL_MT_TALKER_DET, |
| 224 | RSL_MT_LISTENER_DET, |
| 225 | RSL_MT_REMOTE_CODEC_CONF_REP, |
| 226 | RSL_MT_RTD_REP, |
| 227 | RSL_MT_PRE_HANDO_NOTIF, |
| 228 | RSL_MT_MR_CODEC_MOD_REQ, |
| 229 | RSL_MT_MR_CODEC_MOD_ACK, |
| 230 | RSL_MT_MR_CODEC_MOD_NACK, |
| 231 | RSL_MT_MR_CODEC_MOD_PER, |
| 232 | RSL_MT_TFO_REP, |
| 233 | RSL_MT_TFO_MOD_REQ, /* 0x3f */ |
| 234 | RSL_MT_LOCATION_INFO = 0x41, |
| 235 | |
| 236 | /* ip.access specific RSL message types */ |
| 237 | RSL_MT_IPAC_DIR_RETR_ENQ = 0x40, |
| 238 | RSL_MT_IPAC_PDCH_ACT = 0x48, |
| 239 | RSL_MT_IPAC_PDCH_ACT_ACK, |
| 240 | RSL_MT_IPAC_PDCH_ACT_NACK, |
| 241 | RSL_MT_IPAC_PDCH_DEACT = 0x4b, |
| 242 | RSL_MT_IPAC_PDCH_DEACT_ACK, |
| 243 | RSL_MT_IPAC_PDCH_DEACT_NACK, |
| 244 | RSL_MT_IPAC_CONNECT_MUX = 0x50, |
| 245 | RSL_MT_IPAC_CONNECT_MUX_ACK, |
| 246 | RSL_MT_IPAC_CONNECT_MUX_NACK, |
| 247 | RSL_MT_IPAC_BIND_MUX = 0x53, |
| 248 | RSL_MT_IPAC_BIND_MUX_ACK, |
| 249 | RSL_MT_IPAC_BIND_MUX_NACK, |
| 250 | RSL_MT_IPAC_DISC_MUX = 0x56, |
| 251 | RSL_MT_IPAC_DISC_MUX_ACK, |
| 252 | RSL_MT_IPAC_DISC_MUX_NACK, |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 253 | RSL_MT_IPAC_MEAS_PREPROC_DFT = 0x60, /*Extented Common Channel Management */ |
| 254 | RSL_MT_IPAC_HO_CAN_ENQ = 0x61, |
| 255 | RSL_MT_IPAC_HO_CAN_RES = 0x62, |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 256 | RSL_MT_IPAC_CRCX = 0x70, /* Bind to local BTS RTP port */ |
| 257 | RSL_MT_IPAC_CRCX_ACK, |
| 258 | RSL_MT_IPAC_CRCX_NACK, |
| 259 | RSL_MT_IPAC_MDCX = 0x73, |
| 260 | RSL_MT_IPAC_MDCX_ACK, |
| 261 | RSL_MT_IPAC_MDCX_NACK, |
| 262 | RSL_MT_IPAC_DLCX_IND = 0x76, |
| 263 | RSL_MT_IPAC_DLCX = 0x77, |
| 264 | RSL_MT_IPAC_DLCX_ACK, |
| 265 | RSL_MT_IPAC_DLCX_NACK, |
Harald Welte | f945689 | 2019-09-03 13:56:00 +0200 | [diff] [blame] | 266 | |
| 267 | RSL_MT_OSMO_ETWS_CMD = 0x7f, |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 268 | }; |
| 269 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 270 | /*! Siemens vendor-specific RSL message types */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 271 | enum abis_rsl_msgtype_siemens { |
| 272 | RSL_MT_SIEMENS_MRPCI = 0x41, |
| 273 | RSL_MT_SIEMENS_INTRAC_HO_COND_IND = 0x42, |
| 274 | RSL_MT_SIEMENS_INTERC_HO_COND_IND = 0x43, |
| 275 | RSL_MT_SIEMENS_FORCED_HO_REQ = 0x44, |
| 276 | RSL_MT_SIEMENS_PREF_AREA_REQ = 0x45, |
| 277 | RSL_MT_SIEMENS_PREF_AREA = 0x46, |
| 278 | RSL_MT_SIEMENS_START_TRACE = 0x47, |
| 279 | RSL_MT_SIEMENS_START_TRACE_ACK = 0x48, |
| 280 | RSL_MT_SIEMENS_STOP_TRACE = 0x49, |
| 281 | RSL_MT_SIEMENS_TRMR = 0x4a, |
| 282 | RSL_MT_SIEMENS_HO_FAIL_IND = 0x4b, |
| 283 | RSL_MT_SIEMENS_STOP_TRACE_ACK = 0x4c, |
| 284 | RSL_MT_SIEMENS_UPLF = 0x4d, |
| 285 | RSL_MT_SIEMENS_UPLB = 0x4e, |
| 286 | RSL_MT_SIEMENS_SET_SYS_INFO_10 = 0x4f, |
| 287 | RSL_MT_SIEMENS_MODIF_COND_IND = 0x50, |
| 288 | }; |
| 289 | |
Pau Espin Pedrol | 95959a8 | 2018-04-21 22:47:54 +0200 | [diff] [blame] | 290 | /*! Ericsson vendor-specific RSL message types */ |
| 291 | enum abis_rsl_msgtype_ericsson { |
| 292 | RSL_MT_ERICSSON_IMM_ASS_SENT = 0x10, |
| 293 | }; |
| 294 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 295 | /*! RSL Information Element Identifiers (Chapter 9.3) */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 296 | enum abis_rsl_ie { |
| 297 | RSL_IE_CHAN_NR = 0x01, |
| 298 | RSL_IE_LINK_IDENT, |
| 299 | RSL_IE_ACT_TYPE, |
| 300 | RSL_IE_BS_POWER, |
| 301 | RSL_IE_CHAN_IDENT, |
| 302 | RSL_IE_CHAN_MODE, |
| 303 | RSL_IE_ENCR_INFO, |
| 304 | RSL_IE_FRAME_NUMBER, |
| 305 | RSL_IE_HANDO_REF, |
| 306 | RSL_IE_L1_INFO, |
| 307 | RSL_IE_L3_INFO, |
| 308 | RSL_IE_MS_IDENTITY, |
| 309 | RSL_IE_MS_POWER, |
| 310 | RSL_IE_PAGING_GROUP, |
| 311 | RSL_IE_PAGING_LOAD, |
| 312 | RSL_IE_PYHS_CONTEXT = 0x10, |
| 313 | RSL_IE_ACCESS_DELAY, |
| 314 | RSL_IE_RACH_LOAD, |
| 315 | RSL_IE_REQ_REFERENCE, |
| 316 | RSL_IE_RELEASE_MODE, |
| 317 | RSL_IE_RESOURCE_INFO, |
| 318 | RSL_IE_RLM_CAUSE, |
| 319 | RSL_IE_STARTNG_TIME, |
| 320 | RSL_IE_TIMING_ADVANCE, |
| 321 | RSL_IE_UPLINK_MEAS, |
| 322 | RSL_IE_CAUSE, |
| 323 | RSL_IE_MEAS_RES_NR, |
| 324 | RSL_IE_MSG_ID, |
| 325 | /* reserved */ |
| 326 | RSL_IE_SYSINFO_TYPE = 0x1e, |
| 327 | RSL_IE_MS_POWER_PARAM, |
| 328 | RSL_IE_BS_POWER_PARAM, |
| 329 | RSL_IE_PREPROC_PARAM, |
| 330 | RSL_IE_PREPROC_MEAS, |
| 331 | RSL_IE_IMM_ASS_INFO, /* Phase 1 (3.6.0), later Full below */ |
| 332 | RSL_IE_SMSCB_INFO = 0x24, |
| 333 | RSL_IE_MS_TIMING_OFFSET, |
| 334 | RSL_IE_ERR_MSG, |
| 335 | RSL_IE_FULL_BCCH_INFO, |
| 336 | RSL_IE_CHAN_NEEDED, |
| 337 | RSL_IE_CB_CMD_TYPE, |
| 338 | RSL_IE_SMSCB_MSG, |
| 339 | RSL_IE_FULL_IMM_ASS_INFO, |
| 340 | RSL_IE_SACCH_INFO, |
| 341 | RSL_IE_CBCH_LOAD_INFO, |
| 342 | RSL_IE_SMSCB_CHAN_INDICATOR, |
| 343 | RSL_IE_GROUP_CALL_REF, |
| 344 | RSL_IE_CHAN_DESC = 0x30, |
| 345 | RSL_IE_NCH_DRX_INFO, |
| 346 | RSL_IE_CMD_INDICATOR, |
| 347 | RSL_IE_EMLPP_PRIO, |
| 348 | RSL_IE_UIC, |
| 349 | RSL_IE_MAIN_CHAN_REF, |
| 350 | RSL_IE_MR_CONFIG, |
| 351 | RSL_IE_MR_CONTROL, |
| 352 | RSL_IE_SUP_CODEC_TYPES, |
| 353 | RSL_IE_CODEC_CONFIG, |
| 354 | RSL_IE_RTD, |
| 355 | RSL_IE_TFO_STATUS, |
| 356 | RSL_IE_LLP_APDU, |
| 357 | /* Siemens vendor-specific */ |
| 358 | RSL_IE_SIEMENS_MRPCI = 0x40, |
| 359 | RSL_IE_SIEMENS_PREF_AREA_TYPE = 0x43, |
| 360 | RSL_IE_SIEMENS_ININ_CELL_HO_PAR = 0x45, |
| 361 | RSL_IE_SIEMENS_TRACE_REF_NR = 0x46, |
| 362 | RSL_IE_SIEMENS_INT_TRACE_IDX = 0x47, |
| 363 | RSL_IE_SIEMENS_L2_HDR_INFO = 0x48, |
| 364 | RSL_IE_SIEMENS_HIGHEST_RATE = 0x4e, |
| 365 | RSL_IE_SIEMENS_SUGGESTED_RATE = 0x4f, |
| 366 | |
Philipp Maier | a15967b | 2020-11-06 21:37:16 +0100 | [diff] [blame] | 367 | /* Osmocom specific */ |
Philipp Maier | e67edfd | 2021-08-31 09:46:35 +0200 | [diff] [blame] | 368 | RSL_IE_OSMO_REP_ACCH_CAP = 0x60, |
Neels Hofmeyr | dd6f136 | 2021-04-20 23:02:59 +0200 | [diff] [blame] | 369 | RSL_IE_OSMO_TRAINING_SEQUENCE = 0x61, |
Philipp Maier | 0e44a72 | 2021-08-30 10:51:52 +0200 | [diff] [blame] | 370 | RSL_IE_OSMO_TEMP_OVP_ACCH_CAP = 0x62, |
Pau Espin Pedrol | 83287ba | 2022-08-08 17:07:18 +0200 | [diff] [blame] | 371 | RSL_IE_OSMO_OSMUX_CID = 0x63, |
Philipp Maier | a15967b | 2020-11-06 21:37:16 +0100 | [diff] [blame] | 372 | |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 373 | /* ip.access */ |
| 374 | RSL_IE_IPAC_SRTP_CONFIG = 0xe0, |
| 375 | RSL_IE_IPAC_PROXY_UDP = 0xe1, |
| 376 | RSL_IE_IPAC_BSCMPL_TOUT = 0xe2, |
| 377 | RSL_IE_IPAC_REMOTE_IP = 0xf0, |
| 378 | RSL_IE_IPAC_REMOTE_PORT = 0xf1, |
| 379 | RSL_IE_IPAC_RTP_PAYLOAD = 0xf2, |
| 380 | RSL_IE_IPAC_LOCAL_PORT = 0xf3, |
| 381 | RSL_IE_IPAC_SPEECH_MODE = 0xf4, |
| 382 | RSL_IE_IPAC_LOCAL_IP = 0xf5, |
| 383 | RSL_IE_IPAC_CONN_STAT = 0xf6, |
| 384 | RSL_IE_IPAC_HO_C_PARMS = 0xf7, |
| 385 | RSL_IE_IPAC_CONN_ID = 0xf8, |
| 386 | RSL_IE_IPAC_RTP_CSD_FMT = 0xf9, |
| 387 | RSL_IE_IPAC_RTP_JIT_BUF = 0xfa, |
| 388 | RSL_IE_IPAC_RTP_COMPR = 0xfb, |
Pau Espin Pedrol | b0c2f75 | 2022-04-04 19:37:19 +0200 | [diff] [blame] | 389 | RSL_IE_IPAC_RTP_PAYLOAD2 = 0xfc, |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 390 | RSL_IE_IPAC_RTP_MPLEX = 0xfd, |
Pau Espin Pedrol | b0c2f75 | 2022-04-04 19:37:19 +0200 | [diff] [blame] | 391 | RSL_IE_IPAC_RTP_MPLEX_ID = 0xfe, |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 392 | }; |
| 393 | |
Harald Welte | 6e363e7 | 2016-11-16 16:58:52 +0100 | [diff] [blame] | 394 | /* Ericsson specific IEs, clash with above partially, so they're not |
| 395 | * part of the enum */ |
Alexander Couzens | 9f39d89 | 2018-04-21 21:20:25 +0200 | [diff] [blame] | 396 | #define RSL_IE_ERIC_PAGING_GROUP 0x0e |
Harald Welte | 6e363e7 | 2016-11-16 16:58:52 +0100 | [diff] [blame] | 397 | #define RSL_IE_ERIC_INST_NR 0x48 |
| 398 | #define RSL_IE_ERIC_PGSL_TIMERS 0x49 |
| 399 | #define RSL_IE_ERIC_REPEAT_DL_FACCH 0x4a |
| 400 | #define RSL_IE_ERIC_POWER_INFO 0xf0 |
| 401 | #define RSL_IE_ERIC_MOBILE_ID 0xf1 |
| 402 | #define RSL_IE_ERIC_BCCH_MAPPING 0xf2 |
| 403 | #define RSL_IE_ERIC_PACKET_PAG_IND 0xf3 |
| 404 | #define RSL_IE_ERIC_CNTR_CTRL 0xf4 |
| 405 | #define RSL_IE_ERIC_CNTR_CTRL_ACK 0xf5 |
| 406 | #define RSL_IE_ERIC_CNTR_REPORT 0xf6 |
| 407 | #define RSL_IE_ERIC_ICP_CONN 0xf7 |
| 408 | #define RSL_IE_ERIC_EMR_SUPPORT 0xf8 |
| 409 | #define RSL_IE_ERIC_EGPRS_REQ_REF 0xf9 |
| 410 | #define RSL_IE_ERIC_VGCS_REL 0xfa |
| 411 | #define RSL_IE_ERIC_REP_PER_NCH 0xfb |
| 412 | #define RSL_IE_ERIC_NY2 0xfc |
| 413 | #define RSL_IE_ERIC_T3115 0xfd |
| 414 | #define RSL_IE_ERIC_ACTIVATE_FLAG 0xfe |
| 415 | #define RSL_IE_ERIC_FULL_NCH_INFO 0xff |
| 416 | |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 417 | /* IPAC MEAS_PREPROC AVERAGING METHOD */ |
| 418 | enum { |
| 419 | IPAC_UNWEIGHTED_AVE = 0, |
| 420 | IPAC_WEIGHTED_AVE, |
Vadim Yanitskiy | c8158ec | 2020-12-15 08:04:30 +0100 | [diff] [blame] | 421 | IPAC_MEDIAN_AVE, |
| 422 | /* EWMA is an Osmocom specific extension */ |
| 423 | IPAC_OSMO_EWMA_AVE, |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 424 | }; |
| 425 | |
Pau Espin Pedrol | 9da16b5 | 2021-08-26 15:25:16 +0200 | [diff] [blame] | 426 | /* IPAC MEAS_PREPROC AVERAGING PARAM ID */ |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 427 | enum { |
| 428 | IPAC_RXLEV_AVE = 0, |
| 429 | IPAC_RXQUAL_AVE, |
| 430 | IPAC_MS_BTS_DIS_AVE |
| 431 | }; |
| 432 | |
| 433 | /* IPAC MEAS_PREPROC HO CAUSES */ |
| 434 | enum { |
| 435 | IPAC_HO_RQD_CAUSE_L_RXLEV_UL_H = 0x01, |
| 436 | IPAC_HO_RQD_CAUSE_L_RXLEV_DL_H, |
| 437 | IPAC_HO_RQD_CAUSE_L_RXQUAL_UL_H, |
| 438 | IPAC_HO_RQD_CAUSE_L_RXQUAL_DL_H, |
| 439 | IPAC_HO_RQD_CAUSE_RXLEV_UL_IH, |
| 440 | IPAC_HO_RQD_CAUSE_RXLEV_DL_IH, |
| 441 | IPAC_HO_RQD_CAUSE_MAX_MS_RANGE, |
| 442 | IPAC_HO_RQD_CAUSE_POWER_BUDGET, |
| 443 | IPAC_HO_RQD_CAUSE_ENQUIRY, |
| 444 | IPAC_HO_RQD_CAUSE_ENQUIRY_FAILED, |
| 445 | IPAC_HO_RQD_CAUSE_NORMAL3G, |
| 446 | IPAC_HO_RQD_CAUSE_EMERGENCY3G, |
| 447 | IPAC_HO_RQD_CAUSE_SERVICE_PREFERRED3G, |
| 448 | IPAC_HO_RQD_CAUSE_O_M_SHUTDOWN, |
| 449 | IPAC_HO_RQD_CAUSE_QUALITY_PROMOTION, |
| 450 | IPAC_HO_RQD_CAUSE_LOAD_PROMOTION, |
| 451 | IPAC_HO_RQD_CAUSE_LOAD_DEMOTION, |
| 452 | IPAC_HO_RQD_CAUSE_MAX, |
| 453 | }; |
| 454 | |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 455 | /* Chapter 9.3.1 */ |
| 456 | #define RSL_CHAN_NR_MASK 0xf8 |
Neels Hofmeyr | 15b96ff | 2016-07-18 23:33:48 +0200 | [diff] [blame] | 457 | #define RSL_CHAN_NR_1 0x08 /*< bit to add for 2nd,... lchan */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 458 | #define RSL_CHAN_Bm_ACCHs 0x08 |
| 459 | #define RSL_CHAN_Lm_ACCHs 0x10 /* .. 0x18 */ |
| 460 | #define RSL_CHAN_SDCCH4_ACCH 0x20 /* .. 0x38 */ |
| 461 | #define RSL_CHAN_SDCCH8_ACCH 0x40 /* ...0x78 */ |
| 462 | #define RSL_CHAN_BCCH 0x80 |
| 463 | #define RSL_CHAN_RACH 0x88 |
| 464 | #define RSL_CHAN_PCH_AGCH 0x90 |
Neels Hofmeyr | fd80f5a | 2016-07-14 03:21:05 +0200 | [diff] [blame] | 465 | #define RSL_CHAN_OSMO_PDCH 0xc0 /*< non-standard, for dyn TS */ |
Harald Welte | a8d7ebb | 2019-05-27 16:51:23 +0200 | [diff] [blame] | 466 | #define RSL_CHAN_OSMO_CBCH4 0xc8 /*< non-standard, for CBCH/SDCCH4 */ |
| 467 | #define RSL_CHAN_OSMO_CBCH8 0xd0 /*< non-standard, for CBCH/SDCCH8 */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 468 | |
Vadim Yanitskiy | fc02ff4 | 2021-05-26 18:19:03 +0200 | [diff] [blame] | 469 | /* non-standard, Osmocom specific Bm/Lm equivalents for VAMOS */ |
| 470 | #define RSL_CHAN_OSMO_VAMOS_Bm_ACCHs 0xe8 /* VAMOS TCH/F */ |
| 471 | #define RSL_CHAN_OSMO_VAMOS_Lm_ACCHs 0xf0 /* VAMOS TCH/H */ |
Vadim Yanitskiy | 442ff64 | 2021-06-01 19:55:43 +0200 | [diff] [blame] | 472 | #define RSL_CHAN_OSMO_VAMOS_MASK 0xe0 /* VAMOS TCH/{F,H} */ |
Vadim Yanitskiy | fc02ff4 | 2021-05-26 18:19:03 +0200 | [diff] [blame] | 473 | |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 474 | /* Chapter 9.3.3 */ |
| 475 | #define RSL_ACT_TYPE_INITIAL 0x00 |
| 476 | #define RSL_ACT_TYPE_REACT 0x80 |
| 477 | #define RSL_ACT_INTRA_IMM_ASS 0x00 |
| 478 | #define RSL_ACT_INTRA_NORM_ASS 0x01 |
| 479 | #define RSL_ACT_INTER_ASYNC 0x02 |
| 480 | #define RSL_ACT_INTER_SYNC 0x03 |
| 481 | #define RSL_ACT_SECOND_ADD 0x04 |
| 482 | #define RSL_ACT_SECOND_MULTI 0x05 |
Neels Hofmeyr | fd80f5a | 2016-07-14 03:21:05 +0200 | [diff] [blame] | 483 | #define RSL_ACT_OSMO_PDCH 0x0f /*< non-standard, for dyn TS */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 484 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 485 | /*! RSL Channel Mode IF (Chapter 9.3.6) */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 486 | struct rsl_ie_chan_mode { |
| 487 | uint8_t dtx_dtu; |
| 488 | uint8_t spd_ind; |
| 489 | uint8_t chan_rt; |
| 490 | uint8_t chan_rate; |
| 491 | } __attribute__ ((packed)); |
| 492 | #define RSL_CMOD_DTXu 0x01 /* uplink */ |
| 493 | #define RSL_CMOD_DTXd 0x02 /* downlink */ |
| 494 | enum rsl_cmod_spd { |
| 495 | RSL_CMOD_SPD_SPEECH = 0x01, |
| 496 | RSL_CMOD_SPD_DATA = 0x02, |
| 497 | RSL_CMOD_SPD_SIGN = 0x03, |
| 498 | }; |
Oliver Smith | 9d92c6e | 2023-03-01 09:53:16 +0100 | [diff] [blame] | 499 | /*! Channel rate and type */ |
| 500 | enum rsl_cmod_crt { |
| 501 | RSL_CMOD_CRT_SDCCH = 0x01, |
| 502 | RSL_CMOD_CRT_TCH_Bm = 0x08, /* full-rate */ |
| 503 | RSL_CMOD_CRT_TCH_Lm = 0x09, /* half-rate */ |
| 504 | RSL_CMOD_CRT_TCH_BI_Bm = 0x0a, /* full-rate: bi-directional (multislot) */ |
| 505 | RSL_CMOD_CRT_TCH_UNI_Bm = 0x1a, /* full-rate: uni-directional (multislot) */ |
| 506 | RSL_CMOD_CRT_TCH_GROUP_Bm = 0x18, /* full-rate: group call channel */ |
| 507 | RSL_CMOD_CRT_TCH_GROUP_Lm = 0x19, /* half-rate: group call channel */ |
| 508 | RSL_CMOD_CRT_TCH_BCAST_Bm = 0x28, /* full-rate: broadcast call channel */ |
| 509 | RSL_CMOD_CRT_TCH_BCAST_Lm = 0x29, /* half-rate: broadcast call channel */ |
| 510 | RSL_CMOD_CRT_OSMO_TCH_VAMOS_Bm = 0x88, /* full-rate in VAMOS mode */ |
| 511 | RSL_CMOD_CRT_OSMO_TCH_VAMOS_Lm = 0x89, /* half-rate in VAMOS mode */ |
| 512 | }; |
| 513 | /*! Speech */ |
| 514 | enum rsl_cmod_sp { |
| 515 | RSL_CMOD_SP_GSM1 = 0x01, |
| 516 | RSL_CMOD_SP_GSM2 = 0x11, |
| 517 | RSL_CMOD_SP_GSM3 = 0x21, |
| 518 | RSL_CMOD_SP_GSM4 = 0x31, |
| 519 | RSL_CMOD_SP_GSM5 = 0x09, |
| 520 | RSL_CMOD_SP_GSM6 = 0x0d, |
| 521 | }; |
| 522 | /*! Non-transparent data */ |
| 523 | enum rsl_cmod_csd_nt { |
| 524 | RSL_CMOD_CSD_NTA_43k5_14k5 = 0x61, /* asymmetric 43.5 kbit/s (DL) + 14.5 kbit/s (UL) */ |
| 525 | RSL_CMOD_CSD_NTA_29k0_14k5 = 0x62, /* asymmetric 29.0 kbit/s (DL) + 14.5 kbit/s (UL) */ |
| 526 | RSL_CMOD_CSD_NTA_43k5_29k0 = 0x63, /* asymmetric 43.5 kbit/s (DL) + 29.0 kbit/s (UL) */ |
| 527 | RSL_CMOD_CSD_NTA_14k5_43k5 = 0x69, /* asymmetric 14.5 kbit/s (DL) + 43.5 kbit/s (UL) */ |
| 528 | RSL_CMOD_CSD_NTA_14k5_29k0 = 0x6a, /* asymmetric 14.5 kbit/s (DL) + 29.0 kbit/s (UL) */ |
| 529 | RSL_CMOD_CSD_NTA_29k0_43k5 = 0x6b, /* asymmetric 29.0 kbit/s (DL) + 43.5 kbit/s (UL) */ |
| 530 | RSL_CMOD_CSD_NT_43k5 = 0x74, |
| 531 | RSL_CMOD_CSD_NT_28k8 = 0x71, |
| 532 | RSL_CMOD_CSD_NT_14k5 = 0x58, |
| 533 | RSL_CMOD_CSD_NT_12k0 = 0x50, |
| 534 | RSL_CMOD_CSD_NT_6k0 = 0x51, |
| 535 | }; |
Harald Welte | eed2611 | 2012-08-24 15:35:34 +0200 | [diff] [blame] | 536 | /* legacy #defines with wrong name */ |
| 537 | #define RSL_CMOD_SP_NT_14k5 RSL_CMOD_CSD_NT_14k5 |
| 538 | #define RSL_CMOD_SP_NT_12k0 RSL_CMOD_CSD_NT_12k0 |
| 539 | #define RSL_CMOD_SP_NT_6k0 RSL_CMOD_CSD_NT_6k0 |
Oliver Smith | 341d9e1 | 2023-03-03 09:50:09 +0100 | [diff] [blame] | 540 | #define RSL_CMOD_CSD_T_32000 RSL_CMOD_CSD_T_32k0 |
| 541 | #define RSL_CMOD_CSD_T_29000 RSL_CMOD_CSD_T_29k0 |
| 542 | #define RSL_CMOD_CSD_T_14400 RSL_CMOD_CSD_T_14k4 |
| 543 | #define RSL_CMOD_CSD_T_9600 RSL_CMOD_CSD_T_9k6 |
| 544 | #define RSL_CMOD_CSD_T_4800 RSL_CMOD_CSD_T_4k8 |
| 545 | #define RSL_CMOD_CSD_T_2400 RSL_CMOD_CSD_T_2k4 |
| 546 | #define RSL_CMOD_CSD_T_1200 RSL_CMOD_CSD_T_1k2 |
Oliver Smith | 9d92c6e | 2023-03-01 09:53:16 +0100 | [diff] [blame] | 547 | /*! Transparent data */ |
| 548 | enum rsl_cmod_csd_t { |
Oliver Smith | 341d9e1 | 2023-03-03 09:50:09 +0100 | [diff] [blame] | 549 | RSL_CMOD_CSD_T_32k0 = 0x38, |
| 550 | RSL_CMOD_CSD_T_29k0 = 0x39, |
| 551 | RSL_CMOD_CSD_T_14k4 = 0x18, |
| 552 | RSL_CMOD_CSD_T_9k6 = 0x10, |
| 553 | RSL_CMOD_CSD_T_4k8 = 0x11, |
| 554 | RSL_CMOD_CSD_T_2k4 = 0x12, |
| 555 | RSL_CMOD_CSD_T_1k2 = 0x13, |
Oliver Smith | 9d92c6e | 2023-03-01 09:53:16 +0100 | [diff] [blame] | 556 | RSL_CMOD_CSD_T_600 = 0x14, |
| 557 | RSL_CMOD_CSD_T_1200_75 = 0x15, |
| 558 | }; |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 559 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 560 | /*! RSL Channel Identification IE (Chapter 9.3.5) */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 561 | struct rsl_ie_chan_ident { |
| 562 | /* GSM 04.08 10.5.2.5 */ |
| 563 | struct { |
| 564 | uint8_t iei; |
| 565 | uint8_t chan_nr; /* enc_chan_nr */ |
| 566 | uint8_t oct3; |
| 567 | uint8_t oct4; |
| 568 | } chan_desc; |
| 569 | #if 0 /* spec says we need this but Abissim doesn't use it */ |
| 570 | struct { |
| 571 | uint8_t tag; |
| 572 | uint8_t len; |
| 573 | } mobile_alloc; |
| 574 | #endif |
| 575 | } __attribute__ ((packed)); |
| 576 | |
| 577 | /* Chapter 9.3.22 */ |
| 578 | #define RLL_CAUSE_T200_EXPIRED 0x01 |
| 579 | #define RLL_CAUSE_REEST_REQ 0x02 |
| 580 | #define RLL_CAUSE_UNSOL_UA_RESP 0x03 |
| 581 | #define RLL_CAUSE_UNSOL_DM_RESP 0x04 |
| 582 | #define RLL_CAUSE_UNSOL_DM_RESP_MF 0x05 |
| 583 | #define RLL_CAUSE_UNSOL_SPRV_RESP 0x06 |
| 584 | #define RLL_CAUSE_SEQ_ERR 0x07 |
| 585 | #define RLL_CAUSE_UFRM_INC_PARAM 0x08 |
| 586 | #define RLL_CAUSE_SFRM_INC_PARAM 0x09 |
| 587 | #define RLL_CAUSE_IFRM_INC_MBITS 0x0a |
| 588 | #define RLL_CAUSE_IFRM_INC_LEN 0x0b |
| 589 | #define RLL_CAUSE_FRM_UNIMPL 0x0c |
| 590 | #define RLL_CAUSE_SABM_MF 0x0d |
| 591 | #define RLL_CAUSE_SABM_INFO_NOTALL 0x0e |
| 592 | |
| 593 | /* Chapter 9.3.26 */ |
| 594 | #define RSL_ERRCLS_NORMAL 0x00 |
| 595 | #define RSL_ERRCLS_RESOURCE_UNAVAIL 0x20 |
| 596 | #define RSL_ERRCLS_SERVICE_UNAVAIL 0x30 |
| 597 | #define RSL_ERRCLS_SERVICE_UNIMPL 0x40 |
| 598 | #define RSL_ERRCLS_INVAL_MSG 0x50 |
| 599 | #define RSL_ERRCLS_PROTO_ERROR 0x60 |
| 600 | #define RSL_ERRCLS_INTERWORKING 0x70 |
| 601 | |
| 602 | /* normal event */ |
| 603 | #define RSL_ERR_RADIO_IF_FAIL 0x00 |
| 604 | #define RSL_ERR_RADIO_LINK_FAIL 0x01 |
| 605 | #define RSL_ERR_HANDOVER_ACC_FAIL 0x02 |
| 606 | #define RSL_ERR_TALKER_ACC_FAIL 0x03 |
| 607 | #define RSL_ERR_OM_INTERVENTION 0x07 |
| 608 | #define RSL_ERR_NORMAL_UNSPEC 0x0f |
| 609 | #define RSL_ERR_T_MSRFPCI_EXP 0x18 |
| 610 | /* resource unavailable */ |
| 611 | #define RSL_ERR_EQUIPMENT_FAIL 0x20 |
| 612 | #define RSL_ERR_RR_UNAVAIL 0x21 |
| 613 | #define RSL_ERR_TERR_CH_FAIL 0x22 |
| 614 | #define RSL_ERR_CCCH_OVERLOAD 0x23 |
| 615 | #define RSL_ERR_ACCH_OVERLOAD 0x24 |
| 616 | #define RSL_ERR_PROCESSOR_OVERLOAD 0x25 |
Philipp Maier | 6d21448 | 2020-07-28 16:53:27 +0200 | [diff] [blame] | 617 | #define RSL_ERR_BTS_NOT_EQUIPPED 0x27 |
| 618 | #define RSL_ERR_REMOTE_TRANSC_FAIL 0x28 |
| 619 | #define RSL_ERR_NOTIFICATION_OVERFL 0x29 |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 620 | #define RSL_ERR_RES_UNAVAIL 0x2f |
| 621 | /* service or option not available */ |
| 622 | #define RSL_ERR_TRANSC_UNAVAIL 0x30 |
| 623 | #define RSL_ERR_SERV_OPT_UNAVAIL 0x3f |
| 624 | /* service or option not implemented */ |
| 625 | #define RSL_ERR_ENCR_UNIMPL 0x40 |
| 626 | #define RSL_ERR_SERV_OPT_UNIMPL 0x4f |
| 627 | /* invalid message */ |
| 628 | #define RSL_ERR_RCH_ALR_ACTV_ALLOC 0x50 |
| 629 | #define RSL_ERR_INVALID_MESSAGE 0x5f |
| 630 | /* protocol error */ |
| 631 | #define RSL_ERR_MSG_DISCR 0x60 |
| 632 | #define RSL_ERR_MSG_TYPE 0x61 |
| 633 | #define RSL_ERR_MSG_SEQ 0x62 |
| 634 | #define RSL_ERR_IE_ERROR 0x63 |
| 635 | #define RSL_ERR_MAND_IE_ERROR 0x64 |
| 636 | #define RSL_ERR_OPT_IE_ERROR 0x65 |
| 637 | #define RSL_ERR_IE_NONEXIST 0x66 |
| 638 | #define RSL_ERR_IE_LENGTH 0x67 |
| 639 | #define RSL_ERR_IE_CONTENT 0x68 |
| 640 | #define RSL_ERR_PROTO 0x6f |
| 641 | /* interworking */ |
| 642 | #define RSL_ERR_INTERWORKING 0x7f |
| 643 | |
| 644 | /* Chapter 9.3.30 */ |
| 645 | #define RSL_SYSTEM_INFO_8 0x00 |
| 646 | #define RSL_SYSTEM_INFO_1 0x01 |
| 647 | #define RSL_SYSTEM_INFO_2 0x02 |
| 648 | #define RSL_SYSTEM_INFO_3 0x03 |
| 649 | #define RSL_SYSTEM_INFO_4 0x04 |
| 650 | #define RSL_SYSTEM_INFO_5 0x05 |
| 651 | #define RSL_SYSTEM_INFO_6 0x06 |
| 652 | #define RSL_SYSTEM_INFO_7 0x07 |
| 653 | #define RSL_SYSTEM_INFO_16 0x08 |
| 654 | #define RSL_SYSTEM_INFO_17 0x09 |
| 655 | #define RSL_SYSTEM_INFO_2bis 0x0a |
| 656 | #define RSL_SYSTEM_INFO_2ter 0x0b |
| 657 | #define RSL_SYSTEM_INFO_5bis 0x0d |
| 658 | #define RSL_SYSTEM_INFO_5ter 0x0e |
| 659 | #define RSL_SYSTEM_INFO_10 0x0f |
Harald Welte | 3d73227 | 2011-06-25 21:39:01 +0200 | [diff] [blame] | 660 | #define RSL_EXT_MEAS_ORDER 0x47 |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 661 | #define RSL_MEAS_INFO 0x48 |
| 662 | #define RSL_SYSTEM_INFO_13 0x28 |
Philipp | 00b1539 | 2016-11-14 12:34:15 +0100 | [diff] [blame] | 663 | #define RSL_ERIC_SYSTEM_INFO_13 0x0C |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 664 | #define RSL_SYSTEM_INFO_2quater 0x29 |
| 665 | #define RSL_SYSTEM_INFO_9 0x2a |
| 666 | #define RSL_SYSTEM_INFO_18 0x2b |
| 667 | #define RSL_SYSTEM_INFO_19 0x2c |
| 668 | #define RSL_SYSTEM_INFO_20 0x2d |
| 669 | |
| 670 | /* Chapter 9.3.40 */ |
| 671 | #define RSL_CHANNEED_ANY 0x00 |
| 672 | #define RSL_CHANNEED_SDCCH 0x01 |
| 673 | #define RSL_CHANNEED_TCH_F 0x02 |
| 674 | #define RSL_CHANNEED_TCH_ForH 0x03 |
| 675 | |
Harald Welte | 8079a06 | 2023-05-08 12:05:47 +0200 | [diff] [blame] | 676 | /*! RSL Cell Broadcast Command (Chapter 9.3.41) */ |
Alex Badea | 8493018 | 2010-11-27 23:34:46 +0200 | [diff] [blame] | 677 | struct rsl_ie_cb_cmd_type { |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 678 | #if OSMO_IS_LITTLE_ENDIAN |
Alex Badea | 8493018 | 2010-11-27 23:34:46 +0200 | [diff] [blame] | 679 | uint8_t last_block:2; |
| 680 | uint8_t spare:1; |
| 681 | uint8_t def_bcast:1; |
| 682 | uint8_t command:4; |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 683 | #elif OSMO_IS_BIG_ENDIAN |
Oliver Smith | 0b5c09b | 2023-02-17 10:35:38 +0100 | [diff] [blame] | 684 | /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */ |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 685 | uint8_t command:4, def_bcast:1, spare:1, last_block:2; |
| 686 | #endif |
Alex Badea | 8493018 | 2010-11-27 23:34:46 +0200 | [diff] [blame] | 687 | } __attribute__ ((packed)); |
| 688 | /* ->command */ |
| 689 | #define RSL_CB_CMD_TYPE_NORMAL 0x00 |
| 690 | #define RSL_CB_CMD_TYPE_SCHEDULE 0x08 |
| 691 | #define RSL_CB_CMD_TYPE_DEFAULT 0x0e |
| 692 | #define RSL_CB_CMD_TYPE_NULL 0x0f |
| 693 | /* ->def_bcast */ |
| 694 | #define RSL_CB_CMD_DEFBCAST_NORMAL 0 |
| 695 | #define RSL_CB_CMD_DEFBCAST_NULL 1 |
| 696 | /* ->last_block */ |
| 697 | #define RSL_CB_CMD_LASTBLOCK_4 0 |
| 698 | #define RSL_CB_CMD_LASTBLOCK_1 1 |
| 699 | #define RSL_CB_CMD_LASTBLOCK_2 2 |
| 700 | #define RSL_CB_CMD_LASTBLOCK_3 3 |
| 701 | |
Harald Welte | 1dffb53 | 2023-05-08 12:06:27 +0200 | [diff] [blame] | 702 | /*! NCH DRX Information (Chapter 9.3.47) */ |
| 703 | struct rsl_ie_nch_drx_info { |
| 704 | #if OSMO_IS_LITTLE_ENDIAN |
| 705 | uint8_t nln:2; |
| 706 | uint8_t emlpp_priority:3; |
| 707 | uint8_t nln_status:1; |
| 708 | uint8_t spare:2; |
| 709 | #elif OSMO_IS_BIG_ENDIAN |
| 710 | /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */ |
| 711 | uint8_t spare:2, nln_status:1, emlpp_priority:3, nln:2; |
| 712 | #endif |
| 713 | } __attribute__ ((packed)); |
| 714 | |
| 715 | /*! Command Indicator (Chapter 9.3.48) */ |
| 716 | #define RSL_CMD_INDICATOR_START 0x00 |
| 717 | #define RSL_CMD_INDICATOR_STOP 0x01 |
| 718 | |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 719 | /* Chapter 3.3.2.3 Brocast control channel */ |
| 720 | /* CCCH-CONF, NC is not combined */ |
| 721 | #define RSL_BCCH_CCCH_CONF_1_NC 0x00 |
| 722 | #define RSL_BCCH_CCCH_CONF_1_C 0x01 |
| 723 | #define RSL_BCCH_CCCH_CONF_2_NC 0x02 |
| 724 | #define RSL_BCCH_CCCH_CONF_3_NC 0x04 |
| 725 | #define RSL_BCCH_CCCH_CONF_4_NC 0x06 |
| 726 | |
| 727 | /* BS-PA-MFRMS */ |
| 728 | #define RSL_BS_PA_MFRMS_2 0x00 |
| 729 | #define RSL_BS_PA_MFRMS_3 0x01 |
| 730 | #define RSL_BS_PA_MFRMS_4 0x02 |
| 731 | #define RSL_BS_PA_MFRMS_5 0x03 |
| 732 | #define RSL_BS_PA_MFRMS_6 0x04 |
| 733 | #define RSL_BS_PA_MFRMS_7 0x05 |
| 734 | #define RSL_BS_PA_MFRMS_8 0x06 |
| 735 | #define RSL_BS_PA_MFRMS_9 0x07 |
| 736 | |
| 737 | /* RSL_IE_IPAC_RTP_PAYLOAD[2] */ |
| 738 | enum rsl_ipac_rtp_payload { |
| 739 | RSL_IPAC_RTP_GSM = 1, |
| 740 | RSL_IPAC_RTP_EFR, |
| 741 | RSL_IPAC_RTP_AMR, |
| 742 | RSL_IPAC_RTP_CSD, |
| 743 | RSL_IPAC_RTP_MUX, |
| 744 | }; |
| 745 | |
| 746 | /* RSL_IE_IPAC_SPEECH_MODE, lower four bits */ |
| 747 | enum rsl_ipac_speech_mode_s { |
| 748 | RSL_IPAC_SPEECH_GSM_FR = 0, /* GSM FR (Type 1, FS) */ |
| 749 | RSL_IPAC_SPEECH_GSM_EFR = 1, /* GSM EFR (Type 2, FS) */ |
| 750 | RSL_IPAC_SPEECH_GSM_AMR_FR = 2, /* GSM AMR/FR (Type 3, FS) */ |
| 751 | RSL_IPAC_SPEECH_GSM_HR = 3, /* GSM HR (Type 1, HS) */ |
| 752 | RSL_IPAC_SPEECH_GSM_AMR_HR = 5, /* GSM AMR/hr (Type 3, HS) */ |
| 753 | RSL_IPAC_SPEECH_AS_RTP = 0xf, /* As specified by RTP Payload IE */ |
| 754 | }; |
| 755 | /* RSL_IE_IPAC_SPEECH_MODE, upper four bits */ |
| 756 | enum rsl_ipac_speech_mode_m { |
| 757 | RSL_IPAC_SPEECH_M_RXTX = 0, /* Send and Receive */ |
| 758 | RSL_IPAC_SPEECH_M_RX = 1, /* Receive only */ |
| 759 | RSL_IPAC_SPEECH_M_TX = 2, /* Send only */ |
| 760 | }; |
| 761 | |
| 762 | /* RSL_IE_IPAC_RTP_CSD_FMT, lower four bits */ |
| 763 | enum rsl_ipac_rtp_csd_format_d { |
Harald Welte | a41bd22 | 2023-03-06 18:06:18 +0100 | [diff] [blame] | 764 | RSL_IPAC_RTP_CSD_EXT_TRAU = 0, /*!< TRAU-like RTP format, without leading zero-bits */ |
| 765 | RSL_IPAC_RTP_CSD_NON_TRAU = 1, /*!< packed 16k (252/288 bit) / 8k (126 bit) in RTP */ |
| 766 | RSL_IPAC_RTP_CSD_TRAU_BTS = 2, /*!< TRAU in BTS; V.110 in RTP/CLEARMODE */ |
| 767 | RSL_IPAC_RTP_CSD_IWF_FREE = 3, /*!< unknown proprietary IWF-free BTS-BTS data */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 768 | }; |
| 769 | /* RSL_IE_IPAC_RTP_CSD_FMT, upper four bits */ |
| 770 | enum rsl_ipac_rtp_csd_format_ir { |
| 771 | RSL_IPAC_RTP_CSD_IR_8k = 0, |
| 772 | RSL_IPAC_RTP_CSD_IR_16k = 1, |
| 773 | RSL_IPAC_RTP_CSD_IR_32k = 2, |
| 774 | RSL_IPAC_RTP_CSD_IR_64k = 3, |
| 775 | }; |
| 776 | |
| 777 | /* Siemens vendor-specific RSL extensions */ |
| 778 | struct rsl_mrpci { |
| 779 | uint8_t power_class:3, |
| 780 | vgcs_capable:1, |
| 781 | vbs_capable:1, |
| 782 | gsm_phase:2; |
| 783 | } __attribute__ ((packed)); |
| 784 | |
| 785 | enum rsl_mrpci_pwrclass { |
| 786 | RSL_MRPCI_PWRC_1 = 0, |
| 787 | RSL_MRPCI_PWRC_2 = 1, |
| 788 | RSL_MRPCI_PWRC_3 = 2, |
| 789 | RSL_MRPCI_PWRC_4 = 3, |
| 790 | RSL_MRPCI_PWRC_5 = 4, |
| 791 | }; |
| 792 | enum rsl_mrpci_phase { |
| 793 | RSL_MRPCI_PHASE_1 = 0, |
| 794 | /* reserved */ |
| 795 | RSL_MRPCI_PHASE_2 = 2, |
| 796 | RSL_MRPCI_PHASE_2PLUS = 3, |
| 797 | }; |
| 798 | |
Holger Hans Peter Freyther | 0357e9b | 2012-12-06 11:57:31 +0100 | [diff] [blame] | 799 | /* 9.3.20 Release Mode */ |
| 800 | enum rsl_rel_mode { |
| 801 | RSL_REL_NORMAL = 0, |
| 802 | RSL_REL_LOCAL_END = 1, |
| 803 | }; |
| 804 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 805 | /*! ip.access specific embedded information elements */ |
Harald Welte | fad5752 | 2015-12-13 11:56:36 +0100 | [diff] [blame] | 806 | enum rsl_ipac_embedded_ie { |
| 807 | RSL_IPAC_EIE_RXLEV = 0x00, |
| 808 | RSL_IPAC_EIE_RXQUAL = 0x01, |
| 809 | RSL_IPAC_EIE_FREQ_ERR = 0x02, |
| 810 | RSL_IPAC_EIE_TIMING_ERR = 0x03, |
| 811 | RSL_IPAC_EIE_MEAS_AVG_CFG = 0x04, |
| 812 | RSL_IPAC_EIE_BS_PWR_CTL = 0x05, |
| 813 | RSL_IPAC_EIE_MS_PWR_CTL = 0x06, |
| 814 | RSL_IPAC_EIE_HANDO_THRESH = 0x07, |
| 815 | RSL_IPAC_EIE_NCELL_DEFAULTS = 0x08, |
| 816 | RSL_IPAC_EIE_NCELL_LIST = 0x09, |
| 817 | RSL_IPAC_EIE_PC_THRESH_COMP = 0x0a, |
| 818 | RSL_IPAC_EIE_HO_THRESH_COMP = 0x0b, |
| 819 | RSL_IPAC_EIE_HO_CAUSE = 0x0c, |
| 820 | RSL_IPAC_EIE_HO_CANDIDATES = 0x0d, |
| 821 | RSL_IPAC_EIE_NCELL_BA_CHG_LIST = 0x0e, |
| 822 | RSL_IPAC_EIE_NUM_OF_MS = 0x10, |
| 823 | RSL_IPAC_EIE_HO_CAND_EXT = 0x11, |
| 824 | RSL_IPAC_EIE_NCELL_DEF_EXT = 0x12, |
| 825 | RSL_IPAC_EIE_NCELL_LIST_EXT = 0x13, |
| 826 | RSL_IPAC_EIE_MASTER_KEY = 0x14, |
| 827 | RSL_IPAC_EIE_MASTER_SALT = 0x15, |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 828 | /* additional IPAC measurement pre-processing related IEI */ |
| 829 | RSL_IPAC_EIE_MEAS_TRANS_RES = 0x16, |
| 830 | RSL_IPAC_EIE_3G_HO_PARAM = 0x17, |
| 831 | RSL_IPAC_EIE_3G_NCELL_LIST = 0x18, |
| 832 | RSL_IPAC_EIE_SDCCH_CTL_PARAM = 0x1a, |
| 833 | RSL_IPAC_EIE_AMR_CONV_THRESH = 0x1b, |
| 834 | |
Pau Espin Pedrol | 5193384 | 2021-08-30 13:50:56 +0200 | [diff] [blame] | 835 | /* Osmocom specific extensions: */ |
| 836 | RSL_IPAC_EIE_OSMO_MEAS_AVG_CFG = 0xf0, |
| 837 | RSL_IPAC_EIE_OSMO_MS_PWR_CTL = 0xf1, |
| 838 | RSL_IPAC_EIE_OSMO_PC_THRESH_COMP = 0xf2, |
| 839 | |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 840 | }; |
| 841 | |
Pau Espin Pedrol | 5193384 | 2021-08-30 13:50:56 +0200 | [diff] [blame] | 842 | /* Value of TLV IE RSL_IPAC_EIE_MEAS_AVG_CFG */ |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 843 | struct ipac_preproc_ave_cfg { |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 844 | #if OSMO_IS_LITTLE_ENDIAN |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 845 | uint8_t h_reqave:5, |
| 846 | param_id:2, |
| 847 | reserved:1; |
| 848 | uint8_t h_reqt:5, |
| 849 | ave_method:3; |
Vadim Yanitskiy | 8f5844e | 2020-12-25 00:19:45 +0100 | [diff] [blame] | 850 | uint8_t params[0]; |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 851 | #elif OSMO_IS_BIG_ENDIAN |
Oliver Smith | 0b5c09b | 2023-02-17 10:35:38 +0100 | [diff] [blame] | 852 | /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */ |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 853 | uint8_t reserved:1, param_id:2, h_reqave:5; |
| 854 | uint8_t ave_method:3, h_reqt:5; |
Vadim Yanitskiy | 8f5844e | 2020-12-25 00:19:45 +0100 | [diff] [blame] | 855 | uint8_t params[0]; |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 856 | #endif |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 857 | }__attribute__ ((packed)); |
| 858 | |
Pau Espin Pedrol | 5193384 | 2021-08-30 13:50:56 +0200 | [diff] [blame] | 859 | |
| 860 | struct osmo_preproc_ave_cfg_field { |
| 861 | #if OSMO_IS_LITTLE_ENDIAN |
| 862 | uint8_t h_reqave:5, |
| 863 | ave_enabled:1, |
| 864 | reserved:2; |
| 865 | uint8_t h_reqt:5, |
| 866 | ave_method:3; |
| 867 | #elif OSMO_IS_BIG_ENDIAN |
Oliver Smith | 0b5c09b | 2023-02-17 10:35:38 +0100 | [diff] [blame] | 868 | /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */ |
Pau Espin Pedrol | 5193384 | 2021-08-30 13:50:56 +0200 | [diff] [blame] | 869 | uint8_t reserved:2, ave_enabled:1, h_reqave:5; |
| 870 | uint8_t ave_method:3, h_reqt:5; |
| 871 | #endif |
| 872 | }__attribute__ ((packed)); |
| 873 | /* Value of TLV IE RSL_IPAC_EIE_OSMO_MEAS_AVG_CFG: */ |
| 874 | struct osmo_preproc_ave_cfg { |
| 875 | struct osmo_preproc_ave_cfg_field ci_fr; |
| 876 | struct osmo_preproc_ave_cfg_field ci_hr; |
| 877 | struct osmo_preproc_ave_cfg_field ci_amr_fr; |
| 878 | struct osmo_preproc_ave_cfg_field ci_amr_hr; |
| 879 | struct osmo_preproc_ave_cfg_field ci_sdcch; |
| 880 | struct osmo_preproc_ave_cfg_field ci_gprs; |
| 881 | uint8_t params[0]; /* Contains params for each above, appended one after the other */ |
| 882 | }__attribute__ ((packed)); |
| 883 | |
| 884 | /*! MS/BS Power Control Thresholds (RSL_IPAC_EIE_MS_PWR_CTL) */ |
Vadim Yanitskiy | a346c45 | 2020-12-15 07:48:58 +0100 | [diff] [blame] | 885 | struct ipac_preproc_pc_thresh { |
| 886 | #if OSMO_IS_LITTLE_ENDIAN |
| 887 | uint8_t l_rxlev:6, reserved_l_rxlev:2; |
| 888 | uint8_t u_rxlev:6, reserved_u_rxlev:2; |
Vadim Yanitskiy | 2060bbb | 2020-12-19 17:33:41 +0100 | [diff] [blame] | 889 | uint8_t u_rxqual:3, reserved_u_rxqual:1, |
| 890 | l_rxqual:3, reserved_l_rxqual:1; |
Vadim Yanitskiy | a346c45 | 2020-12-15 07:48:58 +0100 | [diff] [blame] | 891 | #elif OSMO_IS_BIG_ENDIAN |
Oliver Smith | 0b5c09b | 2023-02-17 10:35:38 +0100 | [diff] [blame] | 892 | /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */ |
Vadim Yanitskiy | a346c45 | 2020-12-15 07:48:58 +0100 | [diff] [blame] | 893 | uint8_t reserved_l_rxlev:2, l_rxlev:6; |
| 894 | uint8_t reserved_u_rxlev:2, u_rxlev:6; |
Pau Espin Pedrol | 28c4388 | 2021-12-22 13:56:42 +0100 | [diff] [blame] | 895 | uint8_t reserved_l_rxqual:1, l_rxqual:3, reserved_u_rxqual:1, u_rxqual:3; |
Vadim Yanitskiy | a346c45 | 2020-12-15 07:48:58 +0100 | [diff] [blame] | 896 | #endif |
| 897 | }__attribute__ ((packed)); |
| 898 | |
Pau Espin Pedrol | 5193384 | 2021-08-30 13:50:56 +0200 | [diff] [blame] | 899 | /*! Osmocom extension for: MS/BS Power Control Thresholds (RSL_IPAC_EIE_OSMO_MS_PWR_CTL) */ |
| 900 | struct osmo_preproc_pc_thresh { |
| 901 | /* Carrier-to-Interference (C/I), in dB: */ |
| 902 | int8_t l_ci_fr; int8_t u_ci_fr; /* FR/EFR */ |
| 903 | int8_t l_ci_hr; int8_t u_ci_hr; /* HR */ |
| 904 | int8_t l_ci_amr_fr; int8_t u_ci_amr_fr; /* AMR FR */ |
| 905 | int8_t l_ci_amr_hr; int8_t u_ci_amr_hr; /* AMR HR */ |
| 906 | int8_t l_ci_sdcch; int8_t u_ci_sdcch; /* SDCCH */ |
| 907 | int8_t l_ci_gprs; int8_t u_ci_gprs; /* GPRS */ |
| 908 | }__attribute__ ((packed)); |
| 909 | |
Vadim Yanitskiy | a346c45 | 2020-12-15 07:48:58 +0100 | [diff] [blame] | 910 | /*! Handover Thresholds */ |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 911 | struct ipac_preproc_ho_thresh { |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 912 | #if OSMO_IS_LITTLE_ENDIAN |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 913 | uint8_t l_rxlev_ul_h:6, |
| 914 | reserved_l_rxlev_ul:2; |
| 915 | uint8_t l_rxlev_dl_h:6, |
| 916 | reserved_l_rxlev_dl:2; |
| 917 | uint8_t rxlev_ul_ih:6, |
| 918 | reserved_rxlev_ul:2; |
| 919 | uint8_t rxlev_dl_ih:6, |
| 920 | reserved_rxlev_dl:2; |
| 921 | uint8_t l_rxqual_ul_h:3, |
| 922 | reserved_rxlqual_ul:1, |
| 923 | l_rxqual_dl_h:3, |
| 924 | reserved_rxqual_dl:1; |
| 925 | uint8_t ms_range_max:6, |
| 926 | reserved_ms_range:2; |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 927 | #elif OSMO_IS_BIG_ENDIAN |
Oliver Smith | 0b5c09b | 2023-02-17 10:35:38 +0100 | [diff] [blame] | 928 | /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */ |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 929 | uint8_t reserved_l_rxlev_ul:2, l_rxlev_ul_h:6; |
| 930 | uint8_t reserved_l_rxlev_dl:2, l_rxlev_dl_h:6; |
| 931 | uint8_t reserved_rxlev_ul:2, rxlev_ul_ih:6; |
| 932 | uint8_t reserved_rxlev_dl:2, rxlev_dl_ih:6; |
| 933 | uint8_t reserved_rxqual_dl:1, l_rxqual_dl_h:3, reserved_rxlqual_ul:1, l_rxqual_ul_h:3; |
| 934 | uint8_t reserved_ms_range:2, ms_range_max:6; |
| 935 | #endif |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 936 | }__attribute__ ((packed)); |
| 937 | |
Pau Espin Pedrol | 5193384 | 2021-08-30 13:50:56 +0200 | [diff] [blame] | 938 | /*! PC Threshold Comparators (RSL_IPAC_EIE_PC_THRESH_COMP) */ |
Vadim Yanitskiy | a346c45 | 2020-12-15 07:48:58 +0100 | [diff] [blame] | 939 | struct ipac_preproc_pc_comp { |
| 940 | #if OSMO_IS_LITTLE_ENDIAN |
| 941 | uint8_t p1:5, reserved_p1:3; |
| 942 | uint8_t n1:5, reserved_n1:3; |
| 943 | uint8_t p2:5, reserved_p2:3; |
| 944 | uint8_t n2:5, reserved_n2:3; |
| 945 | uint8_t p3:5, reserved_p3:3; |
| 946 | uint8_t n3:5, reserved_n3:3; |
| 947 | uint8_t p4:5, reserved_p4:3; |
| 948 | uint8_t n4:5, reserved_n4:3; |
| 949 | uint8_t pc_interval:5, reserved_pc:3; |
| 950 | uint8_t red_step_size:4, inc_step_size:4; |
| 951 | #elif OSMO_IS_BIG_ENDIAN |
Oliver Smith | 0b5c09b | 2023-02-17 10:35:38 +0100 | [diff] [blame] | 952 | /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */ |
Vadim Yanitskiy | a346c45 | 2020-12-15 07:48:58 +0100 | [diff] [blame] | 953 | uint8_t reserved_p1:3, p1:5; |
| 954 | uint8_t reserved_n1:3, n1:5; |
| 955 | uint8_t reserved_p2:3, p2:5; |
| 956 | uint8_t reserved_n2:3, n2:5; |
| 957 | uint8_t reserved_p3:3, p3:5; |
| 958 | uint8_t reserved_n3:3, n3:5; |
| 959 | uint8_t reserved_p4:3, p4:5; |
| 960 | uint8_t reserved_n4:3, n4:5; |
| 961 | uint8_t reserved_pc:3, pc_interval:5; |
| 962 | uint8_t inc_step_size:4, red_step_size:4; |
| 963 | #endif |
| 964 | }__attribute__ ((packed)); |
| 965 | |
Pau Espin Pedrol | 5193384 | 2021-08-30 13:50:56 +0200 | [diff] [blame] | 966 | /*! Osmocom extension for: PC Threshold Comparators (RSL_IPAC_EIE_OSMO_PC_THRESH_COMP) */ |
| 967 | struct ipac_preproc_pc_comp_field { |
| 968 | #if OSMO_IS_LITTLE_ENDIAN |
| 969 | uint8_t lower_p:5, reserved_lower_p:3; |
| 970 | uint8_t lower_n:5, reserved_lower_n:3; |
| 971 | uint8_t upper_p:5, reserved_upper_p:3; |
| 972 | uint8_t upper_n:5, reserved_upper_n:3; |
| 973 | #elif OSMO_IS_BIG_ENDIAN |
Oliver Smith | 0b5c09b | 2023-02-17 10:35:38 +0100 | [diff] [blame] | 974 | /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */ |
Pau Espin Pedrol | 5193384 | 2021-08-30 13:50:56 +0200 | [diff] [blame] | 975 | uint8_t reserved_lower_p:3, lower_p:5; |
| 976 | uint8_t reserved_lower_n:3, lower_n:5; |
| 977 | uint8_t reserved_upper_p:3, upper_p:5; |
| 978 | uint8_t reserved_upper_n:3, upper_n:5; |
Pau Espin Pedrol | 28c4388 | 2021-12-22 13:56:42 +0100 | [diff] [blame] | 979 | #endif |
Pau Espin Pedrol | 5193384 | 2021-08-30 13:50:56 +0200 | [diff] [blame] | 980 | }__attribute__ ((packed)); |
| 981 | struct osmo_preproc_pc_comp { |
| 982 | /* Used for Carrier-to-Interference (C/I), in dB: */ |
| 983 | struct ipac_preproc_pc_comp_field ci_fr; |
| 984 | struct ipac_preproc_pc_comp_field ci_hr; |
| 985 | struct ipac_preproc_pc_comp_field ci_amr_fr; |
| 986 | struct ipac_preproc_pc_comp_field ci_amr_hr; |
| 987 | struct ipac_preproc_pc_comp_field ci_sdcch; |
| 988 | struct ipac_preproc_pc_comp_field ci_gprs; |
| 989 | }__attribute__ ((packed)); |
| 990 | |
Vadim Yanitskiy | a346c45 | 2020-12-15 07:48:58 +0100 | [diff] [blame] | 991 | /*! HO Threshold Comparators */ |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 992 | struct ipac_preproc_ho_comp { |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 993 | #if OSMO_IS_LITTLE_ENDIAN |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 994 | uint8_t p5:5, |
| 995 | reserved_p5:3; |
| 996 | uint8_t n5:5, |
| 997 | reserved_n5:3; |
| 998 | uint8_t p6:5, |
| 999 | reserved_p6:3; |
| 1000 | uint8_t n6:5, |
| 1001 | reserved_n6:3; |
| 1002 | uint8_t p7:5, |
| 1003 | reserved_p7:3; |
| 1004 | uint8_t n7:5, |
| 1005 | reserved_n7:3; |
| 1006 | uint8_t p8:5, |
| 1007 | reserved_p8:3; |
| 1008 | uint8_t n8:5, |
| 1009 | reserved_n8:3; |
| 1010 | uint8_t ho_interval:5, |
| 1011 | reserved_ho:3; |
| 1012 | uint8_t reserved; |
| 1013 | |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 1014 | #elif OSMO_IS_BIG_ENDIAN |
Oliver Smith | 0b5c09b | 2023-02-17 10:35:38 +0100 | [diff] [blame] | 1015 | /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */ |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 1016 | uint8_t reserved_p5:3, p5:5; |
| 1017 | uint8_t reserved_n5:3, n5:5; |
| 1018 | uint8_t reserved_p6:3, p6:5; |
| 1019 | uint8_t reserved_n6:3, n6:5; |
| 1020 | uint8_t reserved_p7:3, p7:5; |
| 1021 | uint8_t reserved_n7:3, n7:5; |
| 1022 | uint8_t reserved_p8:3, p8:5; |
| 1023 | uint8_t reserved_n8:3, n8:5; |
| 1024 | uint8_t reserved_ho:3, ho_interval:5; |
| 1025 | uint8_t reserved; |
| 1026 | #endif |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 1027 | }__attribute__ ((packed)); |
| 1028 | |
| 1029 | struct ipac_preproc_ho_candidates { |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 1030 | #if OSMO_IS_LITTLE_ENDIAN |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 1031 | uint8_t bsic:6, |
| 1032 | reserved0:2; |
| 1033 | uint8_t bcch_freq:5, |
| 1034 | ba_used:1, |
| 1035 | s:1, |
| 1036 | reserved1:1; |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 1037 | #elif OSMO_IS_BIG_ENDIAN |
Oliver Smith | 0b5c09b | 2023-02-17 10:35:38 +0100 | [diff] [blame] | 1038 | /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */ |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 1039 | uint8_t reserved0:2, bsic:6; |
| 1040 | uint8_t reserved1:1, s:1, ba_used:1, bcch_freq:5; |
| 1041 | #endif |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 1042 | }__attribute__ ((packed)); |
| 1043 | |
| 1044 | struct ipac_preproc_ncell_dflts { |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 1045 | #if OSMO_IS_LITTLE_ENDIAN |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 1046 | uint8_t rxlev_min_def:6, |
| 1047 | reserved_rxlev_min_def:2; |
| 1048 | uint8_t ho_margin_def:5, |
| 1049 | reserved_ho_margin_def:3; |
| 1050 | uint8_t ms_txpwr_max_def:5, |
| 1051 | reserved_ms_txpwr_max_def:3; |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 1052 | #elif OSMO_IS_BIG_ENDIAN |
Oliver Smith | 0b5c09b | 2023-02-17 10:35:38 +0100 | [diff] [blame] | 1053 | /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */ |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 1054 | uint8_t reserved_rxlev_min_def:2, rxlev_min_def:6; |
| 1055 | uint8_t reserved_ho_margin_def:3, ho_margin_def:5; |
| 1056 | uint8_t reserved_ms_txpwr_max_def:3, ms_txpwr_max_def:5; |
| 1057 | #endif |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 1058 | }__attribute__ ((packed)); |
| 1059 | |
Minh-Quang Nguyen | adc28dc | 2017-02-06 11:13:31 -0500 | [diff] [blame] | 1060 | struct ipac_preproc_ho_ctl_param { |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 1061 | #if OSMO_IS_LITTLE_ENDIAN |
Minh-Quang Nguyen | adc28dc | 2017-02-06 11:13:31 -0500 | [diff] [blame] | 1062 | uint8_t sdcch_ho_gsm:1, |
| 1063 | sdcch_ho_umts:1, |
| 1064 | reserved:6; |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 1065 | #elif OSMO_IS_BIG_ENDIAN |
Oliver Smith | 0b5c09b | 2023-02-17 10:35:38 +0100 | [diff] [blame] | 1066 | /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */ |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 1067 | uint8_t reserved:6, sdcch_ho_umts:1, sdcch_ho_gsm:1; |
| 1068 | #endif |
Minh-Quang Nguyen | adc28dc | 2017-02-06 11:13:31 -0500 | [diff] [blame] | 1069 | }__attribute__ ((packed)); |
| 1070 | |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 1071 | struct ipac_preproc_cfg { |
| 1072 | uint8_t meas_rep_mode; |
| 1073 | uint32_t meas_mode_flags; |
| 1074 | struct ipac_preproc_ave_cfg ms_ave_cfg[3]; |
| 1075 | struct ipac_preproc_ave_cfg ave_cfg; |
| 1076 | struct ipac_preproc_ho_thresh ho_thresh; |
| 1077 | struct ipac_preproc_ho_comp ho_comp; |
| 1078 | struct ipac_preproc_ncell_dflts ncell_dflts; |
Minh-Quang Nguyen | adc28dc | 2017-02-06 11:13:31 -0500 | [diff] [blame] | 1079 | struct ipac_preproc_ho_ctl_param ho_ctl_param; |
Harald Welte | fad5752 | 2015-12-13 11:56:36 +0100 | [diff] [blame] | 1080 | }; |
| 1081 | |
Philipp Maier | ca770ae | 2021-02-16 17:31:22 +0100 | [diff] [blame] | 1082 | struct rsl_l1_info { |
Pau Espin Pedrol | 28c4388 | 2021-12-22 13:56:42 +0100 | [diff] [blame] | 1083 | #if OSMO_IS_LITTLE_ENDIAN |
Philipp Maier | ca770ae | 2021-02-16 17:31:22 +0100 | [diff] [blame] | 1084 | uint8_t reserved:1, |
| 1085 | srr_sro:1, |
| 1086 | fpc_epc:1, |
| 1087 | ms_pwr:5; |
| 1088 | uint8_t ta; |
Pau Espin Pedrol | 28c4388 | 2021-12-22 13:56:42 +0100 | [diff] [blame] | 1089 | #elif OSMO_IS_BIG_ENDIAN |
Oliver Smith | 0b5c09b | 2023-02-17 10:35:38 +0100 | [diff] [blame] | 1090 | /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianness.py) */ |
Pau Espin Pedrol | 28c4388 | 2021-12-22 13:56:42 +0100 | [diff] [blame] | 1091 | uint8_t ms_pwr:5, fpc_epc:1, srr_sro:1, reserved:1; |
| 1092 | uint8_t ta; |
Philipp Maier | ca770ae | 2021-02-16 17:31:22 +0100 | [diff] [blame] | 1093 | #endif |
| 1094 | } __attribute__ ((packed)); |
| 1095 | |
Sylvain Munaut | dca7d2c | 2012-04-18 21:53:23 +0200 | [diff] [blame] | 1096 | /*! @} */ |