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 | * |
| 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 Hofmeyr | 17518fe | 2017-06-20 04:35:06 +0200 | [diff] [blame] | 24 | #pragma once |
| 25 | |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 26 | #include <stdint.h> |
| 27 | |
Pau Espin Pedrol | 4290803 | 2018-10-10 17:04:28 +0200 | [diff] [blame] | 28 | #include <osmocom/core/endian.h> |
| 29 | |
Harald Welte | 8f2c7e5 | 2011-08-17 18:52:03 +0200 | [diff] [blame] | 30 | /*! \addtogroup rsl |
| 31 | * @{ |
Neels Hofmeyr | 17518fe | 2017-06-20 04:35:06 +0200 | [diff] [blame] | 32 | * \file gsm_08_58.h */ |
Harald Welte | 8f2c7e5 | 2011-08-17 18:52:03 +0200 | [diff] [blame] | 33 | |
Pau Espin Pedrol | fb97e72 | 2018-10-10 20:41:40 +0200 | [diff] [blame] | 34 | /* Channel Number 9.3.1 */ |
| 35 | union 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 Welte | a8d7ebb | 2019-05-27 16:51:23 +0200 | [diff] [blame] | 53 | #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 Pedrol | fb97e72 | 2018-10-10 20:41:40 +0200 | [diff] [blame] | 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 { |
| 121 | #if OSMO_IS_BIG_ENDIAN |
Philipp Maier | 595908a | 2020-11-20 16:13:07 +0100 | [diff] [blame] | 122 | uint8_t reserved:1, |
| 123 | rxqual:3, |
Philipp Maier | 439ddbe | 2020-11-16 17:49:34 +0100 | [diff] [blame] | 124 | 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 Maier | 595908a | 2020-11-20 16:13:07 +0100 | [diff] [blame] | 133 | rxqual:3, |
| 134 | reserved:1; |
Philipp Maier | 439ddbe | 2020-11-16 17:49:34 +0100 | [diff] [blame] | 135 | #endif |
| 136 | } __attribute__ ((packed)); |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 137 | |
| 138 | /* Chapter 9.1 */ |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 139 | /* RSL Message Discriminator: RLL */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 140 | #define ABIS_RSL_MDISC_RLL 0x02 |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 141 | /* RSL Message Discriminator: Dedicated Channel */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 142 | #define ABIS_RSL_MDISC_DED_CHAN 0x08 |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 143 | /* RSL Message Discriminator: Common Channel */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 144 | #define ABIS_RSL_MDISC_COM_CHAN 0x0c |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 145 | /* RSL Message Discriminator: TRX Management */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 146 | #define ABIS_RSL_MDISC_TRX 0x10 |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 147 | /* RSL Message Discriminator: Location Service */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 148 | #define ABIS_RSL_MDISC_LOC 0x20 |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 149 | /* RSL Message Discriminator: ip.access */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 150 | #define ABIS_RSL_MDISC_IPACCESS 0x7e |
| 151 | #define ABIS_RSL_MDISC_TRANSP 0x01 |
| 152 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 153 | /* Check if given RSL message discriminator is transparent */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 154 | #define ABIS_RSL_MDISC_IS_TRANSP(x) (x & 0x01) |
| 155 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 156 | /* RSL Message Type (Chapter 9.1) */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 157 | enum 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 Eversberg | 816e24c | 2010-06-25 02:50:56 +0200 | [diff] [blame] | 170 | RSL_MT_SUSP_REQ, /* non-standard elements */ |
| 171 | RSL_MT_SUSP_CONF, |
| 172 | RSL_MT_RES_REQ, |
| 173 | RSL_MT_RECON_REQ, /* 0x0f */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 174 | |
| 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 Welte | 6eb7d6c | 2010-07-13 13:48:13 +0200 | [diff] [blame] | 183 | RSL_MT_CHAN_CONF, /* non-standard element */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 184 | /* 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 Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 244 | 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 Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 247 | 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 Welte | f945689 | 2019-09-03 13:56:00 +0200 | [diff] [blame] | 257 | |
| 258 | RSL_MT_OSMO_ETWS_CMD = 0x7f, |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 259 | }; |
| 260 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 261 | /*! Siemens vendor-specific RSL message types */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 262 | enum 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 Pedrol | 95959a8 | 2018-04-21 22:47:54 +0200 | [diff] [blame] | 281 | /*! Ericsson vendor-specific RSL message types */ |
| 282 | enum abis_rsl_msgtype_ericsson { |
| 283 | RSL_MT_ERICSSON_IMM_ASS_SENT = 0x10, |
| 284 | }; |
| 285 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 286 | /*! RSL Information Element Identifiers (Chapter 9.3) */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 287 | enum 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 Maier | a15967b | 2020-11-06 21:37:16 +0100 | [diff] [blame] | 358 | /* Osmocom specific */ |
| 359 | RSL_IE_OSMO_REP_ACCH_CAP= 0x60, |
| 360 | |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 361 | /* 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 Welte | 6e363e7 | 2016-11-16 16:58:52 +0100 | [diff] [blame] | 382 | /* Ericsson specific IEs, clash with above partially, so they're not |
| 383 | * part of the enum */ |
Alexander Couzens | 9f39d89 | 2018-04-21 21:20:25 +0200 | [diff] [blame] | 384 | #define RSL_IE_ERIC_PAGING_GROUP 0x0e |
Harald Welte | 6e363e7 | 2016-11-16 16:58:52 +0100 | [diff] [blame] | 385 | #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 Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 405 | /* IPAC MEAS_PREPROC AVERAGING METHOD */ |
| 406 | enum { |
| 407 | IPAC_UNWEIGHTED_AVE = 0, |
| 408 | IPAC_WEIGHTED_AVE, |
| 409 | IPAC_MEDIAN_AVE |
| 410 | }; |
| 411 | |
| 412 | /* IPAC MEAS_PREPROC AVERAGING PARAMID */ |
| 413 | enum { |
| 414 | IPAC_RXLEV_AVE = 0, |
| 415 | IPAC_RXQUAL_AVE, |
| 416 | IPAC_MS_BTS_DIS_AVE |
| 417 | }; |
| 418 | |
| 419 | /* IPAC MEAS_PREPROC HO CAUSES */ |
| 420 | enum { |
| 421 | IPAC_HO_RQD_CAUSE_L_RXLEV_UL_H = 0x01, |
| 422 | IPAC_HO_RQD_CAUSE_L_RXLEV_DL_H, |
| 423 | IPAC_HO_RQD_CAUSE_L_RXQUAL_UL_H, |
| 424 | IPAC_HO_RQD_CAUSE_L_RXQUAL_DL_H, |
| 425 | IPAC_HO_RQD_CAUSE_RXLEV_UL_IH, |
| 426 | IPAC_HO_RQD_CAUSE_RXLEV_DL_IH, |
| 427 | IPAC_HO_RQD_CAUSE_MAX_MS_RANGE, |
| 428 | IPAC_HO_RQD_CAUSE_POWER_BUDGET, |
| 429 | IPAC_HO_RQD_CAUSE_ENQUIRY, |
| 430 | IPAC_HO_RQD_CAUSE_ENQUIRY_FAILED, |
| 431 | IPAC_HO_RQD_CAUSE_NORMAL3G, |
| 432 | IPAC_HO_RQD_CAUSE_EMERGENCY3G, |
| 433 | IPAC_HO_RQD_CAUSE_SERVICE_PREFERRED3G, |
| 434 | IPAC_HO_RQD_CAUSE_O_M_SHUTDOWN, |
| 435 | IPAC_HO_RQD_CAUSE_QUALITY_PROMOTION, |
| 436 | IPAC_HO_RQD_CAUSE_LOAD_PROMOTION, |
| 437 | IPAC_HO_RQD_CAUSE_LOAD_DEMOTION, |
| 438 | IPAC_HO_RQD_CAUSE_MAX, |
| 439 | }; |
| 440 | |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 441 | /* Chapter 9.3.1 */ |
| 442 | #define RSL_CHAN_NR_MASK 0xf8 |
Neels Hofmeyr | 15b96ff | 2016-07-18 23:33:48 +0200 | [diff] [blame] | 443 | #define RSL_CHAN_NR_1 0x08 /*< bit to add for 2nd,... lchan */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 444 | #define RSL_CHAN_Bm_ACCHs 0x08 |
| 445 | #define RSL_CHAN_Lm_ACCHs 0x10 /* .. 0x18 */ |
| 446 | #define RSL_CHAN_SDCCH4_ACCH 0x20 /* .. 0x38 */ |
| 447 | #define RSL_CHAN_SDCCH8_ACCH 0x40 /* ...0x78 */ |
| 448 | #define RSL_CHAN_BCCH 0x80 |
| 449 | #define RSL_CHAN_RACH 0x88 |
| 450 | #define RSL_CHAN_PCH_AGCH 0x90 |
Neels Hofmeyr | fd80f5a | 2016-07-14 03:21:05 +0200 | [diff] [blame] | 451 | #define RSL_CHAN_OSMO_PDCH 0xc0 /*< non-standard, for dyn TS */ |
Harald Welte | a8d7ebb | 2019-05-27 16:51:23 +0200 | [diff] [blame] | 452 | #define RSL_CHAN_OSMO_CBCH4 0xc8 /*< non-standard, for CBCH/SDCCH4 */ |
| 453 | #define RSL_CHAN_OSMO_CBCH8 0xd0 /*< non-standard, for CBCH/SDCCH8 */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 454 | |
| 455 | /* Chapter 9.3.3 */ |
| 456 | #define RSL_ACT_TYPE_INITIAL 0x00 |
| 457 | #define RSL_ACT_TYPE_REACT 0x80 |
| 458 | #define RSL_ACT_INTRA_IMM_ASS 0x00 |
| 459 | #define RSL_ACT_INTRA_NORM_ASS 0x01 |
| 460 | #define RSL_ACT_INTER_ASYNC 0x02 |
| 461 | #define RSL_ACT_INTER_SYNC 0x03 |
| 462 | #define RSL_ACT_SECOND_ADD 0x04 |
| 463 | #define RSL_ACT_SECOND_MULTI 0x05 |
Neels Hofmeyr | fd80f5a | 2016-07-14 03:21:05 +0200 | [diff] [blame] | 464 | #define RSL_ACT_OSMO_PDCH 0x0f /*< non-standard, for dyn TS */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 465 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 466 | /*! RSL Channel Mode IF (Chapter 9.3.6) */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 467 | struct rsl_ie_chan_mode { |
| 468 | uint8_t dtx_dtu; |
| 469 | uint8_t spd_ind; |
| 470 | uint8_t chan_rt; |
| 471 | uint8_t chan_rate; |
| 472 | } __attribute__ ((packed)); |
| 473 | #define RSL_CMOD_DTXu 0x01 /* uplink */ |
| 474 | #define RSL_CMOD_DTXd 0x02 /* downlink */ |
| 475 | enum rsl_cmod_spd { |
| 476 | RSL_CMOD_SPD_SPEECH = 0x01, |
| 477 | RSL_CMOD_SPD_DATA = 0x02, |
| 478 | RSL_CMOD_SPD_SIGN = 0x03, |
| 479 | }; |
| 480 | #define RSL_CMOD_CRT_SDCCH 0x01 |
| 481 | #define RSL_CMOD_CRT_TCH_Bm 0x08 /* full-rate */ |
| 482 | #define RSL_CMOD_CRT_TCH_Lm 0x09 /* half-rate */ |
| 483 | /* FIXME: More CRT types */ |
| 484 | /* Speech */ |
| 485 | #define RSL_CMOD_SP_GSM1 0x01 |
| 486 | #define RSL_CMOD_SP_GSM2 0x11 |
| 487 | #define RSL_CMOD_SP_GSM3 0x21 |
Harald Welte | eed2611 | 2012-08-24 15:35:34 +0200 | [diff] [blame] | 488 | /* non-transparent data */ |
| 489 | #define RSL_CMOD_CSD_NT_43k5 0x74 |
| 490 | #define RSL_CMOD_CSD_NT_28k8 0x71 |
| 491 | #define RSL_CMOD_CSD_NT_14k5 0x58 |
| 492 | #define RSL_CMOD_CSD_NT_12k0 0x50 |
| 493 | #define RSL_CMOD_CSD_NT_6k0 0x51 |
| 494 | /* legacy #defines with wrong name */ |
| 495 | #define RSL_CMOD_SP_NT_14k5 RSL_CMOD_CSD_NT_14k5 |
| 496 | #define RSL_CMOD_SP_NT_12k0 RSL_CMOD_CSD_NT_12k0 |
| 497 | #define RSL_CMOD_SP_NT_6k0 RSL_CMOD_CSD_NT_6k0 |
| 498 | /* transparent data */ |
| 499 | #define RSL_CMOD_CSD_T_32000 0x38 |
| 500 | #define RSL_CMOD_CSD_T_29000 0x39 |
| 501 | #define RSL_CMOD_CSD_T_14400 0x18 |
| 502 | #define RSL_CMOD_CSD_T_9600 0x10 |
| 503 | #define RSL_CMOD_CSD_T_4800 0x11 |
| 504 | #define RSL_CMOD_CSD_T_2400 0x12 |
| 505 | #define RSL_CMOD_CSD_T_1200 0x13 |
| 506 | #define RSL_CMOD_CSD_T_600 0x14 |
| 507 | #define RSL_CMOD_CSD_T_1200_75 0x15 |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 508 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 509 | /*! RSL Channel Identification IE (Chapter 9.3.5) */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 510 | struct rsl_ie_chan_ident { |
| 511 | /* GSM 04.08 10.5.2.5 */ |
| 512 | struct { |
| 513 | uint8_t iei; |
| 514 | uint8_t chan_nr; /* enc_chan_nr */ |
| 515 | uint8_t oct3; |
| 516 | uint8_t oct4; |
| 517 | } chan_desc; |
| 518 | #if 0 /* spec says we need this but Abissim doesn't use it */ |
| 519 | struct { |
| 520 | uint8_t tag; |
| 521 | uint8_t len; |
| 522 | } mobile_alloc; |
| 523 | #endif |
| 524 | } __attribute__ ((packed)); |
| 525 | |
| 526 | /* Chapter 9.3.22 */ |
| 527 | #define RLL_CAUSE_T200_EXPIRED 0x01 |
| 528 | #define RLL_CAUSE_REEST_REQ 0x02 |
| 529 | #define RLL_CAUSE_UNSOL_UA_RESP 0x03 |
| 530 | #define RLL_CAUSE_UNSOL_DM_RESP 0x04 |
| 531 | #define RLL_CAUSE_UNSOL_DM_RESP_MF 0x05 |
| 532 | #define RLL_CAUSE_UNSOL_SPRV_RESP 0x06 |
| 533 | #define RLL_CAUSE_SEQ_ERR 0x07 |
| 534 | #define RLL_CAUSE_UFRM_INC_PARAM 0x08 |
| 535 | #define RLL_CAUSE_SFRM_INC_PARAM 0x09 |
| 536 | #define RLL_CAUSE_IFRM_INC_MBITS 0x0a |
| 537 | #define RLL_CAUSE_IFRM_INC_LEN 0x0b |
| 538 | #define RLL_CAUSE_FRM_UNIMPL 0x0c |
| 539 | #define RLL_CAUSE_SABM_MF 0x0d |
| 540 | #define RLL_CAUSE_SABM_INFO_NOTALL 0x0e |
| 541 | |
| 542 | /* Chapter 9.3.26 */ |
| 543 | #define RSL_ERRCLS_NORMAL 0x00 |
| 544 | #define RSL_ERRCLS_RESOURCE_UNAVAIL 0x20 |
| 545 | #define RSL_ERRCLS_SERVICE_UNAVAIL 0x30 |
| 546 | #define RSL_ERRCLS_SERVICE_UNIMPL 0x40 |
| 547 | #define RSL_ERRCLS_INVAL_MSG 0x50 |
| 548 | #define RSL_ERRCLS_PROTO_ERROR 0x60 |
| 549 | #define RSL_ERRCLS_INTERWORKING 0x70 |
| 550 | |
| 551 | /* normal event */ |
| 552 | #define RSL_ERR_RADIO_IF_FAIL 0x00 |
| 553 | #define RSL_ERR_RADIO_LINK_FAIL 0x01 |
| 554 | #define RSL_ERR_HANDOVER_ACC_FAIL 0x02 |
| 555 | #define RSL_ERR_TALKER_ACC_FAIL 0x03 |
| 556 | #define RSL_ERR_OM_INTERVENTION 0x07 |
| 557 | #define RSL_ERR_NORMAL_UNSPEC 0x0f |
| 558 | #define RSL_ERR_T_MSRFPCI_EXP 0x18 |
| 559 | /* resource unavailable */ |
| 560 | #define RSL_ERR_EQUIPMENT_FAIL 0x20 |
| 561 | #define RSL_ERR_RR_UNAVAIL 0x21 |
| 562 | #define RSL_ERR_TERR_CH_FAIL 0x22 |
| 563 | #define RSL_ERR_CCCH_OVERLOAD 0x23 |
| 564 | #define RSL_ERR_ACCH_OVERLOAD 0x24 |
| 565 | #define RSL_ERR_PROCESSOR_OVERLOAD 0x25 |
Philipp Maier | 6d21448 | 2020-07-28 16:53:27 +0200 | [diff] [blame] | 566 | #define RSL_ERR_BTS_NOT_EQUIPPED 0x27 |
| 567 | #define RSL_ERR_REMOTE_TRANSC_FAIL 0x28 |
| 568 | #define RSL_ERR_NOTIFICATION_OVERFL 0x29 |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 569 | #define RSL_ERR_RES_UNAVAIL 0x2f |
| 570 | /* service or option not available */ |
| 571 | #define RSL_ERR_TRANSC_UNAVAIL 0x30 |
| 572 | #define RSL_ERR_SERV_OPT_UNAVAIL 0x3f |
| 573 | /* service or option not implemented */ |
| 574 | #define RSL_ERR_ENCR_UNIMPL 0x40 |
| 575 | #define RSL_ERR_SERV_OPT_UNIMPL 0x4f |
| 576 | /* invalid message */ |
| 577 | #define RSL_ERR_RCH_ALR_ACTV_ALLOC 0x50 |
| 578 | #define RSL_ERR_INVALID_MESSAGE 0x5f |
| 579 | /* protocol error */ |
| 580 | #define RSL_ERR_MSG_DISCR 0x60 |
| 581 | #define RSL_ERR_MSG_TYPE 0x61 |
| 582 | #define RSL_ERR_MSG_SEQ 0x62 |
| 583 | #define RSL_ERR_IE_ERROR 0x63 |
| 584 | #define RSL_ERR_MAND_IE_ERROR 0x64 |
| 585 | #define RSL_ERR_OPT_IE_ERROR 0x65 |
| 586 | #define RSL_ERR_IE_NONEXIST 0x66 |
| 587 | #define RSL_ERR_IE_LENGTH 0x67 |
| 588 | #define RSL_ERR_IE_CONTENT 0x68 |
| 589 | #define RSL_ERR_PROTO 0x6f |
| 590 | /* interworking */ |
| 591 | #define RSL_ERR_INTERWORKING 0x7f |
| 592 | |
| 593 | /* Chapter 9.3.30 */ |
| 594 | #define RSL_SYSTEM_INFO_8 0x00 |
| 595 | #define RSL_SYSTEM_INFO_1 0x01 |
| 596 | #define RSL_SYSTEM_INFO_2 0x02 |
| 597 | #define RSL_SYSTEM_INFO_3 0x03 |
| 598 | #define RSL_SYSTEM_INFO_4 0x04 |
| 599 | #define RSL_SYSTEM_INFO_5 0x05 |
| 600 | #define RSL_SYSTEM_INFO_6 0x06 |
| 601 | #define RSL_SYSTEM_INFO_7 0x07 |
| 602 | #define RSL_SYSTEM_INFO_16 0x08 |
| 603 | #define RSL_SYSTEM_INFO_17 0x09 |
| 604 | #define RSL_SYSTEM_INFO_2bis 0x0a |
| 605 | #define RSL_SYSTEM_INFO_2ter 0x0b |
| 606 | #define RSL_SYSTEM_INFO_5bis 0x0d |
| 607 | #define RSL_SYSTEM_INFO_5ter 0x0e |
| 608 | #define RSL_SYSTEM_INFO_10 0x0f |
Harald Welte | 3d73227 | 2011-06-25 21:39:01 +0200 | [diff] [blame] | 609 | #define RSL_EXT_MEAS_ORDER 0x47 |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 610 | #define RSL_MEAS_INFO 0x48 |
| 611 | #define RSL_SYSTEM_INFO_13 0x28 |
Philipp | 00b1539 | 2016-11-14 12:34:15 +0100 | [diff] [blame] | 612 | #define RSL_ERIC_SYSTEM_INFO_13 0x0C |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 613 | #define RSL_SYSTEM_INFO_2quater 0x29 |
| 614 | #define RSL_SYSTEM_INFO_9 0x2a |
| 615 | #define RSL_SYSTEM_INFO_18 0x2b |
| 616 | #define RSL_SYSTEM_INFO_19 0x2c |
| 617 | #define RSL_SYSTEM_INFO_20 0x2d |
| 618 | |
| 619 | /* Chapter 9.3.40 */ |
| 620 | #define RSL_CHANNEED_ANY 0x00 |
| 621 | #define RSL_CHANNEED_SDCCH 0x01 |
| 622 | #define RSL_CHANNEED_TCH_F 0x02 |
| 623 | #define RSL_CHANNEED_TCH_ForH 0x03 |
| 624 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 625 | /*! RSL Cell Broadcast Command (Chapter 9.3.45) */ |
Alex Badea | 8493018 | 2010-11-27 23:34:46 +0200 | [diff] [blame] | 626 | struct rsl_ie_cb_cmd_type { |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 627 | #if OSMO_IS_LITTLE_ENDIAN |
Alex Badea | 8493018 | 2010-11-27 23:34:46 +0200 | [diff] [blame] | 628 | uint8_t last_block:2; |
| 629 | uint8_t spare:1; |
| 630 | uint8_t def_bcast:1; |
| 631 | uint8_t command:4; |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 632 | #elif OSMO_IS_BIG_ENDIAN |
| 633 | /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */ |
| 634 | uint8_t command:4, def_bcast:1, spare:1, last_block:2; |
| 635 | #endif |
Alex Badea | 8493018 | 2010-11-27 23:34:46 +0200 | [diff] [blame] | 636 | } __attribute__ ((packed)); |
| 637 | /* ->command */ |
| 638 | #define RSL_CB_CMD_TYPE_NORMAL 0x00 |
| 639 | #define RSL_CB_CMD_TYPE_SCHEDULE 0x08 |
| 640 | #define RSL_CB_CMD_TYPE_DEFAULT 0x0e |
| 641 | #define RSL_CB_CMD_TYPE_NULL 0x0f |
| 642 | /* ->def_bcast */ |
| 643 | #define RSL_CB_CMD_DEFBCAST_NORMAL 0 |
| 644 | #define RSL_CB_CMD_DEFBCAST_NULL 1 |
| 645 | /* ->last_block */ |
| 646 | #define RSL_CB_CMD_LASTBLOCK_4 0 |
| 647 | #define RSL_CB_CMD_LASTBLOCK_1 1 |
| 648 | #define RSL_CB_CMD_LASTBLOCK_2 2 |
| 649 | #define RSL_CB_CMD_LASTBLOCK_3 3 |
| 650 | |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 651 | /* Chapter 3.3.2.3 Brocast control channel */ |
| 652 | /* CCCH-CONF, NC is not combined */ |
| 653 | #define RSL_BCCH_CCCH_CONF_1_NC 0x00 |
| 654 | #define RSL_BCCH_CCCH_CONF_1_C 0x01 |
| 655 | #define RSL_BCCH_CCCH_CONF_2_NC 0x02 |
| 656 | #define RSL_BCCH_CCCH_CONF_3_NC 0x04 |
| 657 | #define RSL_BCCH_CCCH_CONF_4_NC 0x06 |
| 658 | |
| 659 | /* BS-PA-MFRMS */ |
| 660 | #define RSL_BS_PA_MFRMS_2 0x00 |
| 661 | #define RSL_BS_PA_MFRMS_3 0x01 |
| 662 | #define RSL_BS_PA_MFRMS_4 0x02 |
| 663 | #define RSL_BS_PA_MFRMS_5 0x03 |
| 664 | #define RSL_BS_PA_MFRMS_6 0x04 |
| 665 | #define RSL_BS_PA_MFRMS_7 0x05 |
| 666 | #define RSL_BS_PA_MFRMS_8 0x06 |
| 667 | #define RSL_BS_PA_MFRMS_9 0x07 |
| 668 | |
| 669 | /* RSL_IE_IPAC_RTP_PAYLOAD[2] */ |
| 670 | enum rsl_ipac_rtp_payload { |
| 671 | RSL_IPAC_RTP_GSM = 1, |
| 672 | RSL_IPAC_RTP_EFR, |
| 673 | RSL_IPAC_RTP_AMR, |
| 674 | RSL_IPAC_RTP_CSD, |
| 675 | RSL_IPAC_RTP_MUX, |
| 676 | }; |
| 677 | |
| 678 | /* RSL_IE_IPAC_SPEECH_MODE, lower four bits */ |
| 679 | enum rsl_ipac_speech_mode_s { |
| 680 | RSL_IPAC_SPEECH_GSM_FR = 0, /* GSM FR (Type 1, FS) */ |
| 681 | RSL_IPAC_SPEECH_GSM_EFR = 1, /* GSM EFR (Type 2, FS) */ |
| 682 | RSL_IPAC_SPEECH_GSM_AMR_FR = 2, /* GSM AMR/FR (Type 3, FS) */ |
| 683 | RSL_IPAC_SPEECH_GSM_HR = 3, /* GSM HR (Type 1, HS) */ |
| 684 | RSL_IPAC_SPEECH_GSM_AMR_HR = 5, /* GSM AMR/hr (Type 3, HS) */ |
| 685 | RSL_IPAC_SPEECH_AS_RTP = 0xf, /* As specified by RTP Payload IE */ |
| 686 | }; |
| 687 | /* RSL_IE_IPAC_SPEECH_MODE, upper four bits */ |
| 688 | enum rsl_ipac_speech_mode_m { |
| 689 | RSL_IPAC_SPEECH_M_RXTX = 0, /* Send and Receive */ |
| 690 | RSL_IPAC_SPEECH_M_RX = 1, /* Receive only */ |
| 691 | RSL_IPAC_SPEECH_M_TX = 2, /* Send only */ |
| 692 | }; |
| 693 | |
| 694 | /* RSL_IE_IPAC_RTP_CSD_FMT, lower four bits */ |
| 695 | enum rsl_ipac_rtp_csd_format_d { |
| 696 | RSL_IPAC_RTP_CSD_EXT_TRAU = 0, |
| 697 | RSL_IPAC_RTP_CSD_NON_TRAU = 1, |
| 698 | RSL_IPAC_RTP_CSD_TRAU_BTS = 2, |
| 699 | RSL_IPAC_RTP_CSD_IWF_FREE = 3, |
| 700 | }; |
| 701 | /* RSL_IE_IPAC_RTP_CSD_FMT, upper four bits */ |
| 702 | enum rsl_ipac_rtp_csd_format_ir { |
| 703 | RSL_IPAC_RTP_CSD_IR_8k = 0, |
| 704 | RSL_IPAC_RTP_CSD_IR_16k = 1, |
| 705 | RSL_IPAC_RTP_CSD_IR_32k = 2, |
| 706 | RSL_IPAC_RTP_CSD_IR_64k = 3, |
| 707 | }; |
| 708 | |
| 709 | /* Siemens vendor-specific RSL extensions */ |
| 710 | struct rsl_mrpci { |
| 711 | uint8_t power_class:3, |
| 712 | vgcs_capable:1, |
| 713 | vbs_capable:1, |
| 714 | gsm_phase:2; |
| 715 | } __attribute__ ((packed)); |
| 716 | |
| 717 | enum rsl_mrpci_pwrclass { |
| 718 | RSL_MRPCI_PWRC_1 = 0, |
| 719 | RSL_MRPCI_PWRC_2 = 1, |
| 720 | RSL_MRPCI_PWRC_3 = 2, |
| 721 | RSL_MRPCI_PWRC_4 = 3, |
| 722 | RSL_MRPCI_PWRC_5 = 4, |
| 723 | }; |
| 724 | enum rsl_mrpci_phase { |
| 725 | RSL_MRPCI_PHASE_1 = 0, |
| 726 | /* reserved */ |
| 727 | RSL_MRPCI_PHASE_2 = 2, |
| 728 | RSL_MRPCI_PHASE_2PLUS = 3, |
| 729 | }; |
| 730 | |
Holger Hans Peter Freyther | 0357e9b | 2012-12-06 11:57:31 +0100 | [diff] [blame] | 731 | /* 9.3.20 Release Mode */ |
| 732 | enum rsl_rel_mode { |
| 733 | RSL_REL_NORMAL = 0, |
| 734 | RSL_REL_LOCAL_END = 1, |
| 735 | }; |
| 736 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 737 | /*! ip.access specific embedded information elements */ |
Harald Welte | fad5752 | 2015-12-13 11:56:36 +0100 | [diff] [blame] | 738 | enum rsl_ipac_embedded_ie { |
| 739 | RSL_IPAC_EIE_RXLEV = 0x00, |
| 740 | RSL_IPAC_EIE_RXQUAL = 0x01, |
| 741 | RSL_IPAC_EIE_FREQ_ERR = 0x02, |
| 742 | RSL_IPAC_EIE_TIMING_ERR = 0x03, |
| 743 | RSL_IPAC_EIE_MEAS_AVG_CFG = 0x04, |
| 744 | RSL_IPAC_EIE_BS_PWR_CTL = 0x05, |
| 745 | RSL_IPAC_EIE_MS_PWR_CTL = 0x06, |
| 746 | RSL_IPAC_EIE_HANDO_THRESH = 0x07, |
| 747 | RSL_IPAC_EIE_NCELL_DEFAULTS = 0x08, |
| 748 | RSL_IPAC_EIE_NCELL_LIST = 0x09, |
| 749 | RSL_IPAC_EIE_PC_THRESH_COMP = 0x0a, |
| 750 | RSL_IPAC_EIE_HO_THRESH_COMP = 0x0b, |
| 751 | RSL_IPAC_EIE_HO_CAUSE = 0x0c, |
| 752 | RSL_IPAC_EIE_HO_CANDIDATES = 0x0d, |
| 753 | RSL_IPAC_EIE_NCELL_BA_CHG_LIST = 0x0e, |
| 754 | RSL_IPAC_EIE_NUM_OF_MS = 0x10, |
| 755 | RSL_IPAC_EIE_HO_CAND_EXT = 0x11, |
| 756 | RSL_IPAC_EIE_NCELL_DEF_EXT = 0x12, |
| 757 | RSL_IPAC_EIE_NCELL_LIST_EXT = 0x13, |
| 758 | RSL_IPAC_EIE_MASTER_KEY = 0x14, |
| 759 | RSL_IPAC_EIE_MASTER_SALT = 0x15, |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 760 | /* additional IPAC measurement pre-processing related IEI */ |
| 761 | RSL_IPAC_EIE_MEAS_TRANS_RES = 0x16, |
| 762 | RSL_IPAC_EIE_3G_HO_PARAM = 0x17, |
| 763 | RSL_IPAC_EIE_3G_NCELL_LIST = 0x18, |
| 764 | RSL_IPAC_EIE_SDCCH_CTL_PARAM = 0x1a, |
| 765 | RSL_IPAC_EIE_AMR_CONV_THRESH = 0x1b, |
| 766 | |
| 767 | }; |
| 768 | |
| 769 | struct ipac_preproc_ave_cfg { |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 770 | #if OSMO_IS_LITTLE_ENDIAN |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 771 | uint8_t h_reqave:5, |
| 772 | param_id:2, |
| 773 | reserved:1; |
| 774 | uint8_t h_reqt:5, |
| 775 | ave_method:3; |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 776 | #elif OSMO_IS_BIG_ENDIAN |
| 777 | /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */ |
| 778 | uint8_t reserved:1, param_id:2, h_reqave:5; |
| 779 | uint8_t ave_method:3, h_reqt:5; |
| 780 | #endif |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 781 | }__attribute__ ((packed)); |
| 782 | |
| 783 | struct ipac_preproc_ho_thresh { |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 784 | #if OSMO_IS_LITTLE_ENDIAN |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 785 | uint8_t l_rxlev_ul_h:6, |
| 786 | reserved_l_rxlev_ul:2; |
| 787 | uint8_t l_rxlev_dl_h:6, |
| 788 | reserved_l_rxlev_dl:2; |
| 789 | uint8_t rxlev_ul_ih:6, |
| 790 | reserved_rxlev_ul:2; |
| 791 | uint8_t rxlev_dl_ih:6, |
| 792 | reserved_rxlev_dl:2; |
| 793 | uint8_t l_rxqual_ul_h:3, |
| 794 | reserved_rxlqual_ul:1, |
| 795 | l_rxqual_dl_h:3, |
| 796 | reserved_rxqual_dl:1; |
| 797 | uint8_t ms_range_max:6, |
| 798 | reserved_ms_range:2; |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 799 | #elif OSMO_IS_BIG_ENDIAN |
| 800 | /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */ |
| 801 | uint8_t reserved_l_rxlev_ul:2, l_rxlev_ul_h:6; |
| 802 | uint8_t reserved_l_rxlev_dl:2, l_rxlev_dl_h:6; |
| 803 | uint8_t reserved_rxlev_ul:2, rxlev_ul_ih:6; |
| 804 | uint8_t reserved_rxlev_dl:2, rxlev_dl_ih:6; |
| 805 | uint8_t reserved_rxqual_dl:1, l_rxqual_dl_h:3, reserved_rxlqual_ul:1, l_rxqual_ul_h:3; |
| 806 | uint8_t reserved_ms_range:2, ms_range_max:6; |
| 807 | #endif |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 808 | }__attribute__ ((packed)); |
| 809 | |
| 810 | struct ipac_preproc_ho_comp { |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 811 | #if OSMO_IS_LITTLE_ENDIAN |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 812 | uint8_t p5:5, |
| 813 | reserved_p5:3; |
| 814 | uint8_t n5:5, |
| 815 | reserved_n5:3; |
| 816 | uint8_t p6:5, |
| 817 | reserved_p6:3; |
| 818 | uint8_t n6:5, |
| 819 | reserved_n6:3; |
| 820 | uint8_t p7:5, |
| 821 | reserved_p7:3; |
| 822 | uint8_t n7:5, |
| 823 | reserved_n7:3; |
| 824 | uint8_t p8:5, |
| 825 | reserved_p8:3; |
| 826 | uint8_t n8:5, |
| 827 | reserved_n8:3; |
| 828 | uint8_t ho_interval:5, |
| 829 | reserved_ho:3; |
| 830 | uint8_t reserved; |
| 831 | |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 832 | #elif OSMO_IS_BIG_ENDIAN |
| 833 | /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */ |
| 834 | uint8_t reserved_p5:3, p5:5; |
| 835 | uint8_t reserved_n5:3, n5:5; |
| 836 | uint8_t reserved_p6:3, p6:5; |
| 837 | uint8_t reserved_n6:3, n6:5; |
| 838 | uint8_t reserved_p7:3, p7:5; |
| 839 | uint8_t reserved_n7:3, n7:5; |
| 840 | uint8_t reserved_p8:3, p8:5; |
| 841 | uint8_t reserved_n8:3, n8:5; |
| 842 | uint8_t reserved_ho:3, ho_interval:5; |
| 843 | uint8_t reserved; |
| 844 | #endif |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 845 | }__attribute__ ((packed)); |
| 846 | |
| 847 | struct ipac_preproc_ho_candidates { |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 848 | #if OSMO_IS_LITTLE_ENDIAN |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 849 | uint8_t bsic:6, |
| 850 | reserved0:2; |
| 851 | uint8_t bcch_freq:5, |
| 852 | ba_used:1, |
| 853 | s:1, |
| 854 | reserved1:1; |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 855 | #elif OSMO_IS_BIG_ENDIAN |
| 856 | /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */ |
| 857 | uint8_t reserved0:2, bsic:6; |
| 858 | uint8_t reserved1:1, s:1, ba_used:1, bcch_freq:5; |
| 859 | #endif |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 860 | }__attribute__ ((packed)); |
| 861 | |
| 862 | struct ipac_preproc_ncell_dflts { |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 863 | #if OSMO_IS_LITTLE_ENDIAN |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 864 | uint8_t rxlev_min_def:6, |
| 865 | reserved_rxlev_min_def:2; |
| 866 | uint8_t ho_margin_def:5, |
| 867 | reserved_ho_margin_def:3; |
| 868 | uint8_t ms_txpwr_max_def:5, |
| 869 | reserved_ms_txpwr_max_def:3; |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 870 | #elif OSMO_IS_BIG_ENDIAN |
| 871 | /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */ |
| 872 | uint8_t reserved_rxlev_min_def:2, rxlev_min_def:6; |
| 873 | uint8_t reserved_ho_margin_def:3, ho_margin_def:5; |
| 874 | uint8_t reserved_ms_txpwr_max_def:3, ms_txpwr_max_def:5; |
| 875 | #endif |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 876 | }__attribute__ ((packed)); |
| 877 | |
Minh-Quang Nguyen | adc28dc | 2017-02-06 11:13:31 -0500 | [diff] [blame] | 878 | struct ipac_preproc_ho_ctl_param { |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 879 | #if OSMO_IS_LITTLE_ENDIAN |
Minh-Quang Nguyen | adc28dc | 2017-02-06 11:13:31 -0500 | [diff] [blame] | 880 | uint8_t sdcch_ho_gsm:1, |
| 881 | sdcch_ho_umts:1, |
| 882 | reserved:6; |
Neels Hofmeyr | b260039 | 2018-11-16 00:20:39 +0100 | [diff] [blame] | 883 | #elif OSMO_IS_BIG_ENDIAN |
| 884 | /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */ |
| 885 | uint8_t reserved:6, sdcch_ho_umts:1, sdcch_ho_gsm:1; |
| 886 | #endif |
Minh-Quang Nguyen | adc28dc | 2017-02-06 11:13:31 -0500 | [diff] [blame] | 887 | }__attribute__ ((packed)); |
| 888 | |
Minh-Quang Nguyen | 17a8748 | 2016-09-02 11:28:31 -0400 | [diff] [blame] | 889 | struct ipac_preproc_cfg { |
| 890 | uint8_t meas_rep_mode; |
| 891 | uint32_t meas_mode_flags; |
| 892 | struct ipac_preproc_ave_cfg ms_ave_cfg[3]; |
| 893 | struct ipac_preproc_ave_cfg ave_cfg; |
| 894 | struct ipac_preproc_ho_thresh ho_thresh; |
| 895 | struct ipac_preproc_ho_comp ho_comp; |
| 896 | struct ipac_preproc_ncell_dflts ncell_dflts; |
Minh-Quang Nguyen | adc28dc | 2017-02-06 11:13:31 -0500 | [diff] [blame] | 897 | struct ipac_preproc_ho_ctl_param ho_ctl_param; |
Harald Welte | fad5752 | 2015-12-13 11:56:36 +0100 | [diff] [blame] | 898 | }; |
| 899 | |
Sylvain Munaut | dca7d2c | 2012-04-18 21:53:23 +0200 | [diff] [blame] | 900 | /*! @} */ |