Sylvain Munaut | 12ba778 | 2014-06-16 10:13:40 +0200 | [diff] [blame] | 1 | #pragma once |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 2 | |
| 3 | /* GSM Radio Signalling Link messages on the A-bis interface |
| 4 | * 3GPP TS 08.58 version 8.6.0 Release 1999 / ETSI TS 100 596 V8.6.0 */ |
| 5 | |
| 6 | /* (C) 2008 by Harald Welte <laforge@gnumonks.org> |
| 7 | * All Rights Reserved |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License as published by |
| 11 | * the Free Software Foundation; either version 2 of the License, or |
| 12 | * (at your option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License along |
| 20 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 21 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 22 | * |
| 23 | */ |
| 24 | |
| 25 | #include <stdint.h> |
| 26 | |
Harald Welte | 8f2c7e5 | 2011-08-17 18:52:03 +0200 | [diff] [blame] | 27 | /*! \addtogroup rsl |
| 28 | * @{ |
| 29 | */ |
| 30 | |
| 31 | /*! \file gsm_08_58.h */ |
| 32 | |
| 33 | /*! \brief RSL common header */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 34 | struct abis_rsl_common_hdr { |
Harald Welte | be14519 | 2011-08-18 11:45:18 +0200 | [diff] [blame] | 35 | uint8_t msg_discr; /*!< \brief message discriminator (ABIS_RSL_MDISC_*) */ |
| 36 | uint8_t msg_type; /*!< \brief message type (\ref abis_rsl_msgtype) */ |
| 37 | uint8_t data[0]; /*!< \brief actual payload data */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 38 | } __attribute__ ((packed)); |
| 39 | |
Harald Welte | 8f2c7e5 | 2011-08-17 18:52:03 +0200 | [diff] [blame] | 40 | /* \brief RSL RLL header (Chapter 8.3) */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 41 | struct abis_rsl_rll_hdr { |
| 42 | struct abis_rsl_common_hdr c; |
Harald Welte | be14519 | 2011-08-18 11:45:18 +0200 | [diff] [blame] | 43 | uint8_t ie_chan; /*!< \brief \ref RSL_IE_CHAN_NR (tag) */ |
| 44 | uint8_t chan_nr; /*!< \brief RSL channel number (value) */ |
| 45 | uint8_t ie_link_id; /*!< \brief \ref RSL_IE_LINK_IDENT (tag) */ |
| 46 | uint8_t link_id; /*!< \brief RSL link identifier (value) */ |
| 47 | uint8_t data[0]; /*!< \brief message payload data */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 48 | } __attribute__ ((packed)); |
| 49 | |
Harald Welte | 8f2c7e5 | 2011-08-17 18:52:03 +0200 | [diff] [blame] | 50 | /* \brief RSL Dedicated Channel header (Chapter 8.3 and 8.4) */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 51 | struct abis_rsl_dchan_hdr { |
| 52 | struct abis_rsl_common_hdr c; |
Harald Welte | be14519 | 2011-08-18 11:45:18 +0200 | [diff] [blame] | 53 | uint8_t ie_chan; /*!< \brief \ref RSL_IE_CHAN_NR (tag) */ |
| 54 | uint8_t chan_nr; /*!< \brief RSL channel number (value) */ |
| 55 | uint8_t data[0]; /*!< \brief message payload data */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 56 | } __attribute__ ((packed)); |
| 57 | |
Harald Welte | 8f2c7e5 | 2011-08-17 18:52:03 +0200 | [diff] [blame] | 58 | /* \brief RSL Common Channel header (Chapter 8.5) */ |
Harald Welte | 6eb7d6c | 2010-07-13 13:48:13 +0200 | [diff] [blame] | 59 | struct abis_rsl_cchan_hdr { |
| 60 | struct abis_rsl_common_hdr c; |
Harald Welte | be14519 | 2011-08-18 11:45:18 +0200 | [diff] [blame] | 61 | uint8_t ie_chan; /*!< \brief \ref RSL_IE_CHAN_NR (tag) */ |
| 62 | uint8_t chan_nr; /*!< \brief RSL channel number (value) */ |
| 63 | uint8_t data[0]; /*!< \brief message payload data */ |
Harald Welte | 6eb7d6c | 2010-07-13 13:48:13 +0200 | [diff] [blame] | 64 | } __attribute__ ((packed)); |
| 65 | |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 66 | |
| 67 | /* Chapter 9.1 */ |
Harald Welte | be14519 | 2011-08-18 11:45:18 +0200 | [diff] [blame] | 68 | /* \brief RSL Message Discriminator: RLL */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 69 | #define ABIS_RSL_MDISC_RLL 0x02 |
Harald Welte | be14519 | 2011-08-18 11:45:18 +0200 | [diff] [blame] | 70 | /* \brief RSL Message Discriminator: Dedicated Channel */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 71 | #define ABIS_RSL_MDISC_DED_CHAN 0x08 |
Harald Welte | be14519 | 2011-08-18 11:45:18 +0200 | [diff] [blame] | 72 | /* \brief RSL Message Discriminator: Common Channel */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 73 | #define ABIS_RSL_MDISC_COM_CHAN 0x0c |
Harald Welte | be14519 | 2011-08-18 11:45:18 +0200 | [diff] [blame] | 74 | /* \brief RSL Message Discriminator: TRX Management */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 75 | #define ABIS_RSL_MDISC_TRX 0x10 |
Harald Welte | be14519 | 2011-08-18 11:45:18 +0200 | [diff] [blame] | 76 | /* \brief RSL Message Discriminator: Location Service */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 77 | #define ABIS_RSL_MDISC_LOC 0x20 |
Harald Welte | be14519 | 2011-08-18 11:45:18 +0200 | [diff] [blame] | 78 | /* \brief RSL Message Discriminator: ip.access */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 79 | #define ABIS_RSL_MDISC_IPACCESS 0x7e |
| 80 | #define ABIS_RSL_MDISC_TRANSP 0x01 |
| 81 | |
Harald Welte | be14519 | 2011-08-18 11:45:18 +0200 | [diff] [blame] | 82 | /* \brief Check if given RSL message discriminator is transparent */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 83 | #define ABIS_RSL_MDISC_IS_TRANSP(x) (x & 0x01) |
| 84 | |
Neels Hofmeyr | 9e57a5a | 2015-12-21 11:20:14 +0100 | [diff] [blame] | 85 | /* \brief RSL Message Type (Chapter 9.1) */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 86 | enum abis_rsl_msgtype { |
| 87 | /* Radio Link Layer Management */ |
| 88 | RSL_MT_DATA_REQ = 0x01, |
| 89 | RSL_MT_DATA_IND, |
| 90 | RSL_MT_ERROR_IND, |
| 91 | RSL_MT_EST_REQ, |
| 92 | RSL_MT_EST_CONF, |
| 93 | RSL_MT_EST_IND, |
| 94 | RSL_MT_REL_REQ, |
| 95 | RSL_MT_REL_CONF, |
| 96 | RSL_MT_REL_IND, |
| 97 | RSL_MT_UNIT_DATA_REQ, |
| 98 | RSL_MT_UNIT_DATA_IND, /* 0x0b */ |
Andreas Eversberg | 816e24c | 2010-06-25 02:50:56 +0200 | [diff] [blame] | 99 | RSL_MT_SUSP_REQ, /* non-standard elements */ |
| 100 | RSL_MT_SUSP_CONF, |
| 101 | RSL_MT_RES_REQ, |
| 102 | RSL_MT_RECON_REQ, /* 0x0f */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 103 | |
| 104 | /* Common Channel Management / TRX Management */ |
| 105 | RSL_MT_BCCH_INFO = 0x11, |
| 106 | RSL_MT_CCCH_LOAD_IND, |
| 107 | RSL_MT_CHAN_RQD, |
| 108 | RSL_MT_DELETE_IND, |
| 109 | RSL_MT_PAGING_CMD, |
| 110 | RSL_MT_IMMEDIATE_ASSIGN_CMD, |
| 111 | RSL_MT_SMS_BC_REQ, |
Harald Welte | 6eb7d6c | 2010-07-13 13:48:13 +0200 | [diff] [blame] | 112 | RSL_MT_CHAN_CONF, /* non-standard element */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 113 | /* empty */ |
| 114 | RSL_MT_RF_RES_IND = 0x19, |
| 115 | RSL_MT_SACCH_FILL, |
| 116 | RSL_MT_OVERLOAD, |
| 117 | RSL_MT_ERROR_REPORT, |
| 118 | RSL_MT_SMS_BC_CMD, |
| 119 | RSL_MT_CBCH_LOAD_IND, |
| 120 | RSL_MT_NOT_CMD, /* 0x1f */ |
| 121 | |
| 122 | /* Dedicate Channel Management */ |
| 123 | RSL_MT_CHAN_ACTIV = 0x21, |
| 124 | RSL_MT_CHAN_ACTIV_ACK, |
| 125 | RSL_MT_CHAN_ACTIV_NACK, |
| 126 | RSL_MT_CONN_FAIL, |
| 127 | RSL_MT_DEACTIVATE_SACCH, |
| 128 | RSL_MT_ENCR_CMD, |
| 129 | RSL_MT_HANDO_DET, |
| 130 | RSL_MT_MEAS_RES, |
| 131 | RSL_MT_MODE_MODIFY_REQ, |
| 132 | RSL_MT_MODE_MODIFY_ACK, |
| 133 | RSL_MT_MODE_MODIFY_NACK, |
| 134 | RSL_MT_PHY_CONTEXT_REQ, |
| 135 | RSL_MT_PHY_CONTEXT_CONF, |
| 136 | RSL_MT_RF_CHAN_REL, |
| 137 | RSL_MT_MS_POWER_CONTROL, |
| 138 | RSL_MT_BS_POWER_CONTROL, /* 0x30 */ |
| 139 | RSL_MT_PREPROC_CONFIG, |
| 140 | RSL_MT_PREPROC_MEAS_RES, |
| 141 | RSL_MT_RF_CHAN_REL_ACK, |
| 142 | RSL_MT_SACCH_INFO_MODIFY, |
| 143 | RSL_MT_TALKER_DET, |
| 144 | RSL_MT_LISTENER_DET, |
| 145 | RSL_MT_REMOTE_CODEC_CONF_REP, |
| 146 | RSL_MT_RTD_REP, |
| 147 | RSL_MT_PRE_HANDO_NOTIF, |
| 148 | RSL_MT_MR_CODEC_MOD_REQ, |
| 149 | RSL_MT_MR_CODEC_MOD_ACK, |
| 150 | RSL_MT_MR_CODEC_MOD_NACK, |
| 151 | RSL_MT_MR_CODEC_MOD_PER, |
| 152 | RSL_MT_TFO_REP, |
| 153 | RSL_MT_TFO_MOD_REQ, /* 0x3f */ |
| 154 | RSL_MT_LOCATION_INFO = 0x41, |
| 155 | |
| 156 | /* ip.access specific RSL message types */ |
| 157 | RSL_MT_IPAC_DIR_RETR_ENQ = 0x40, |
| 158 | RSL_MT_IPAC_PDCH_ACT = 0x48, |
| 159 | RSL_MT_IPAC_PDCH_ACT_ACK, |
| 160 | RSL_MT_IPAC_PDCH_ACT_NACK, |
| 161 | RSL_MT_IPAC_PDCH_DEACT = 0x4b, |
| 162 | RSL_MT_IPAC_PDCH_DEACT_ACK, |
| 163 | RSL_MT_IPAC_PDCH_DEACT_NACK, |
| 164 | RSL_MT_IPAC_CONNECT_MUX = 0x50, |
| 165 | RSL_MT_IPAC_CONNECT_MUX_ACK, |
| 166 | RSL_MT_IPAC_CONNECT_MUX_NACK, |
| 167 | RSL_MT_IPAC_BIND_MUX = 0x53, |
| 168 | RSL_MT_IPAC_BIND_MUX_ACK, |
| 169 | RSL_MT_IPAC_BIND_MUX_NACK, |
| 170 | RSL_MT_IPAC_DISC_MUX = 0x56, |
| 171 | RSL_MT_IPAC_DISC_MUX_ACK, |
| 172 | RSL_MT_IPAC_DISC_MUX_NACK, |
| 173 | RSL_MT_IPAC_CRCX = 0x70, /* Bind to local BTS RTP port */ |
| 174 | RSL_MT_IPAC_CRCX_ACK, |
| 175 | RSL_MT_IPAC_CRCX_NACK, |
| 176 | RSL_MT_IPAC_MDCX = 0x73, |
| 177 | RSL_MT_IPAC_MDCX_ACK, |
| 178 | RSL_MT_IPAC_MDCX_NACK, |
| 179 | RSL_MT_IPAC_DLCX_IND = 0x76, |
| 180 | RSL_MT_IPAC_DLCX = 0x77, |
| 181 | RSL_MT_IPAC_DLCX_ACK, |
| 182 | RSL_MT_IPAC_DLCX_NACK, |
| 183 | }; |
| 184 | |
Harald Welte | 8f2c7e5 | 2011-08-17 18:52:03 +0200 | [diff] [blame] | 185 | /*! \brief Siemens vendor-specific RSL message types */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 186 | enum abis_rsl_msgtype_siemens { |
| 187 | RSL_MT_SIEMENS_MRPCI = 0x41, |
| 188 | RSL_MT_SIEMENS_INTRAC_HO_COND_IND = 0x42, |
| 189 | RSL_MT_SIEMENS_INTERC_HO_COND_IND = 0x43, |
| 190 | RSL_MT_SIEMENS_FORCED_HO_REQ = 0x44, |
| 191 | RSL_MT_SIEMENS_PREF_AREA_REQ = 0x45, |
| 192 | RSL_MT_SIEMENS_PREF_AREA = 0x46, |
| 193 | RSL_MT_SIEMENS_START_TRACE = 0x47, |
| 194 | RSL_MT_SIEMENS_START_TRACE_ACK = 0x48, |
| 195 | RSL_MT_SIEMENS_STOP_TRACE = 0x49, |
| 196 | RSL_MT_SIEMENS_TRMR = 0x4a, |
| 197 | RSL_MT_SIEMENS_HO_FAIL_IND = 0x4b, |
| 198 | RSL_MT_SIEMENS_STOP_TRACE_ACK = 0x4c, |
| 199 | RSL_MT_SIEMENS_UPLF = 0x4d, |
| 200 | RSL_MT_SIEMENS_UPLB = 0x4e, |
| 201 | RSL_MT_SIEMENS_SET_SYS_INFO_10 = 0x4f, |
| 202 | RSL_MT_SIEMENS_MODIF_COND_IND = 0x50, |
| 203 | }; |
| 204 | |
Harald Welte | 8f2c7e5 | 2011-08-17 18:52:03 +0200 | [diff] [blame] | 205 | /*! \brief RSL Information Element Identifiers (Chapter 9.3) */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 206 | enum abis_rsl_ie { |
| 207 | RSL_IE_CHAN_NR = 0x01, |
| 208 | RSL_IE_LINK_IDENT, |
| 209 | RSL_IE_ACT_TYPE, |
| 210 | RSL_IE_BS_POWER, |
| 211 | RSL_IE_CHAN_IDENT, |
| 212 | RSL_IE_CHAN_MODE, |
| 213 | RSL_IE_ENCR_INFO, |
| 214 | RSL_IE_FRAME_NUMBER, |
| 215 | RSL_IE_HANDO_REF, |
| 216 | RSL_IE_L1_INFO, |
| 217 | RSL_IE_L3_INFO, |
| 218 | RSL_IE_MS_IDENTITY, |
| 219 | RSL_IE_MS_POWER, |
| 220 | RSL_IE_PAGING_GROUP, |
| 221 | RSL_IE_PAGING_LOAD, |
| 222 | RSL_IE_PYHS_CONTEXT = 0x10, |
| 223 | RSL_IE_ACCESS_DELAY, |
| 224 | RSL_IE_RACH_LOAD, |
| 225 | RSL_IE_REQ_REFERENCE, |
| 226 | RSL_IE_RELEASE_MODE, |
| 227 | RSL_IE_RESOURCE_INFO, |
| 228 | RSL_IE_RLM_CAUSE, |
| 229 | RSL_IE_STARTNG_TIME, |
| 230 | RSL_IE_TIMING_ADVANCE, |
| 231 | RSL_IE_UPLINK_MEAS, |
| 232 | RSL_IE_CAUSE, |
| 233 | RSL_IE_MEAS_RES_NR, |
| 234 | RSL_IE_MSG_ID, |
| 235 | /* reserved */ |
| 236 | RSL_IE_SYSINFO_TYPE = 0x1e, |
| 237 | RSL_IE_MS_POWER_PARAM, |
| 238 | RSL_IE_BS_POWER_PARAM, |
| 239 | RSL_IE_PREPROC_PARAM, |
| 240 | RSL_IE_PREPROC_MEAS, |
| 241 | RSL_IE_IMM_ASS_INFO, /* Phase 1 (3.6.0), later Full below */ |
| 242 | RSL_IE_SMSCB_INFO = 0x24, |
| 243 | RSL_IE_MS_TIMING_OFFSET, |
| 244 | RSL_IE_ERR_MSG, |
| 245 | RSL_IE_FULL_BCCH_INFO, |
| 246 | RSL_IE_CHAN_NEEDED, |
| 247 | RSL_IE_CB_CMD_TYPE, |
| 248 | RSL_IE_SMSCB_MSG, |
| 249 | RSL_IE_FULL_IMM_ASS_INFO, |
| 250 | RSL_IE_SACCH_INFO, |
| 251 | RSL_IE_CBCH_LOAD_INFO, |
| 252 | RSL_IE_SMSCB_CHAN_INDICATOR, |
| 253 | RSL_IE_GROUP_CALL_REF, |
| 254 | RSL_IE_CHAN_DESC = 0x30, |
| 255 | RSL_IE_NCH_DRX_INFO, |
| 256 | RSL_IE_CMD_INDICATOR, |
| 257 | RSL_IE_EMLPP_PRIO, |
| 258 | RSL_IE_UIC, |
| 259 | RSL_IE_MAIN_CHAN_REF, |
| 260 | RSL_IE_MR_CONFIG, |
| 261 | RSL_IE_MR_CONTROL, |
| 262 | RSL_IE_SUP_CODEC_TYPES, |
| 263 | RSL_IE_CODEC_CONFIG, |
| 264 | RSL_IE_RTD, |
| 265 | RSL_IE_TFO_STATUS, |
| 266 | RSL_IE_LLP_APDU, |
| 267 | /* Siemens vendor-specific */ |
| 268 | RSL_IE_SIEMENS_MRPCI = 0x40, |
| 269 | RSL_IE_SIEMENS_PREF_AREA_TYPE = 0x43, |
| 270 | RSL_IE_SIEMENS_ININ_CELL_HO_PAR = 0x45, |
| 271 | RSL_IE_SIEMENS_TRACE_REF_NR = 0x46, |
| 272 | RSL_IE_SIEMENS_INT_TRACE_IDX = 0x47, |
| 273 | RSL_IE_SIEMENS_L2_HDR_INFO = 0x48, |
| 274 | RSL_IE_SIEMENS_HIGHEST_RATE = 0x4e, |
| 275 | RSL_IE_SIEMENS_SUGGESTED_RATE = 0x4f, |
| 276 | |
| 277 | /* ip.access */ |
| 278 | RSL_IE_IPAC_SRTP_CONFIG = 0xe0, |
| 279 | RSL_IE_IPAC_PROXY_UDP = 0xe1, |
| 280 | RSL_IE_IPAC_BSCMPL_TOUT = 0xe2, |
| 281 | RSL_IE_IPAC_REMOTE_IP = 0xf0, |
| 282 | RSL_IE_IPAC_REMOTE_PORT = 0xf1, |
| 283 | RSL_IE_IPAC_RTP_PAYLOAD = 0xf2, |
| 284 | RSL_IE_IPAC_LOCAL_PORT = 0xf3, |
| 285 | RSL_IE_IPAC_SPEECH_MODE = 0xf4, |
| 286 | RSL_IE_IPAC_LOCAL_IP = 0xf5, |
| 287 | RSL_IE_IPAC_CONN_STAT = 0xf6, |
| 288 | RSL_IE_IPAC_HO_C_PARMS = 0xf7, |
| 289 | RSL_IE_IPAC_CONN_ID = 0xf8, |
| 290 | RSL_IE_IPAC_RTP_CSD_FMT = 0xf9, |
| 291 | RSL_IE_IPAC_RTP_JIT_BUF = 0xfa, |
| 292 | RSL_IE_IPAC_RTP_COMPR = 0xfb, |
| 293 | RSL_IE_IPAC_RTP_PAYLOAD2= 0xfc, |
| 294 | RSL_IE_IPAC_RTP_MPLEX = 0xfd, |
| 295 | RSL_IE_IPAC_RTP_MPLEX_ID= 0xfe, |
| 296 | }; |
| 297 | |
| 298 | /* Chapter 9.3.1 */ |
| 299 | #define RSL_CHAN_NR_MASK 0xf8 |
Neels Hofmeyr | 15b96ff | 2016-07-18 23:33:48 +0200 | [diff] [blame] | 300 | #define RSL_CHAN_NR_1 0x08 /*< bit to add for 2nd,... lchan */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 301 | #define RSL_CHAN_Bm_ACCHs 0x08 |
| 302 | #define RSL_CHAN_Lm_ACCHs 0x10 /* .. 0x18 */ |
| 303 | #define RSL_CHAN_SDCCH4_ACCH 0x20 /* .. 0x38 */ |
| 304 | #define RSL_CHAN_SDCCH8_ACCH 0x40 /* ...0x78 */ |
| 305 | #define RSL_CHAN_BCCH 0x80 |
| 306 | #define RSL_CHAN_RACH 0x88 |
| 307 | #define RSL_CHAN_PCH_AGCH 0x90 |
Neels Hofmeyr | fd80f5a | 2016-07-14 03:21:05 +0200 | [diff] [blame] | 308 | #define RSL_CHAN_OSMO_PDCH 0xc0 /*< non-standard, for dyn TS */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 309 | |
| 310 | /* Chapter 9.3.3 */ |
| 311 | #define RSL_ACT_TYPE_INITIAL 0x00 |
| 312 | #define RSL_ACT_TYPE_REACT 0x80 |
| 313 | #define RSL_ACT_INTRA_IMM_ASS 0x00 |
| 314 | #define RSL_ACT_INTRA_NORM_ASS 0x01 |
| 315 | #define RSL_ACT_INTER_ASYNC 0x02 |
| 316 | #define RSL_ACT_INTER_SYNC 0x03 |
| 317 | #define RSL_ACT_SECOND_ADD 0x04 |
| 318 | #define RSL_ACT_SECOND_MULTI 0x05 |
Neels Hofmeyr | fd80f5a | 2016-07-14 03:21:05 +0200 | [diff] [blame] | 319 | #define RSL_ACT_OSMO_PDCH 0x0f /*< non-standard, for dyn TS */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 320 | |
Harald Welte | 8f2c7e5 | 2011-08-17 18:52:03 +0200 | [diff] [blame] | 321 | /*! \brief RSL Channel Mode IF (Chapter 9.3.6) */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 322 | struct rsl_ie_chan_mode { |
| 323 | uint8_t dtx_dtu; |
| 324 | uint8_t spd_ind; |
| 325 | uint8_t chan_rt; |
| 326 | uint8_t chan_rate; |
| 327 | } __attribute__ ((packed)); |
| 328 | #define RSL_CMOD_DTXu 0x01 /* uplink */ |
| 329 | #define RSL_CMOD_DTXd 0x02 /* downlink */ |
| 330 | enum rsl_cmod_spd { |
| 331 | RSL_CMOD_SPD_SPEECH = 0x01, |
| 332 | RSL_CMOD_SPD_DATA = 0x02, |
| 333 | RSL_CMOD_SPD_SIGN = 0x03, |
| 334 | }; |
| 335 | #define RSL_CMOD_CRT_SDCCH 0x01 |
| 336 | #define RSL_CMOD_CRT_TCH_Bm 0x08 /* full-rate */ |
| 337 | #define RSL_CMOD_CRT_TCH_Lm 0x09 /* half-rate */ |
| 338 | /* FIXME: More CRT types */ |
| 339 | /* Speech */ |
| 340 | #define RSL_CMOD_SP_GSM1 0x01 |
| 341 | #define RSL_CMOD_SP_GSM2 0x11 |
| 342 | #define RSL_CMOD_SP_GSM3 0x21 |
Harald Welte | eed2611 | 2012-08-24 15:35:34 +0200 | [diff] [blame] | 343 | /* non-transparent data */ |
| 344 | #define RSL_CMOD_CSD_NT_43k5 0x74 |
| 345 | #define RSL_CMOD_CSD_NT_28k8 0x71 |
| 346 | #define RSL_CMOD_CSD_NT_14k5 0x58 |
| 347 | #define RSL_CMOD_CSD_NT_12k0 0x50 |
| 348 | #define RSL_CMOD_CSD_NT_6k0 0x51 |
| 349 | /* legacy #defines with wrong name */ |
| 350 | #define RSL_CMOD_SP_NT_14k5 RSL_CMOD_CSD_NT_14k5 |
| 351 | #define RSL_CMOD_SP_NT_12k0 RSL_CMOD_CSD_NT_12k0 |
| 352 | #define RSL_CMOD_SP_NT_6k0 RSL_CMOD_CSD_NT_6k0 |
| 353 | /* transparent data */ |
| 354 | #define RSL_CMOD_CSD_T_32000 0x38 |
| 355 | #define RSL_CMOD_CSD_T_29000 0x39 |
| 356 | #define RSL_CMOD_CSD_T_14400 0x18 |
| 357 | #define RSL_CMOD_CSD_T_9600 0x10 |
| 358 | #define RSL_CMOD_CSD_T_4800 0x11 |
| 359 | #define RSL_CMOD_CSD_T_2400 0x12 |
| 360 | #define RSL_CMOD_CSD_T_1200 0x13 |
| 361 | #define RSL_CMOD_CSD_T_600 0x14 |
| 362 | #define RSL_CMOD_CSD_T_1200_75 0x15 |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 363 | |
Harald Welte | 8f2c7e5 | 2011-08-17 18:52:03 +0200 | [diff] [blame] | 364 | /*! \brief RSL Channel Identification IE (Chapter 9.3.5) */ |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 365 | struct rsl_ie_chan_ident { |
| 366 | /* GSM 04.08 10.5.2.5 */ |
| 367 | struct { |
| 368 | uint8_t iei; |
| 369 | uint8_t chan_nr; /* enc_chan_nr */ |
| 370 | uint8_t oct3; |
| 371 | uint8_t oct4; |
| 372 | } chan_desc; |
| 373 | #if 0 /* spec says we need this but Abissim doesn't use it */ |
| 374 | struct { |
| 375 | uint8_t tag; |
| 376 | uint8_t len; |
| 377 | } mobile_alloc; |
| 378 | #endif |
| 379 | } __attribute__ ((packed)); |
| 380 | |
| 381 | /* Chapter 9.3.22 */ |
| 382 | #define RLL_CAUSE_T200_EXPIRED 0x01 |
| 383 | #define RLL_CAUSE_REEST_REQ 0x02 |
| 384 | #define RLL_CAUSE_UNSOL_UA_RESP 0x03 |
| 385 | #define RLL_CAUSE_UNSOL_DM_RESP 0x04 |
| 386 | #define RLL_CAUSE_UNSOL_DM_RESP_MF 0x05 |
| 387 | #define RLL_CAUSE_UNSOL_SPRV_RESP 0x06 |
| 388 | #define RLL_CAUSE_SEQ_ERR 0x07 |
| 389 | #define RLL_CAUSE_UFRM_INC_PARAM 0x08 |
| 390 | #define RLL_CAUSE_SFRM_INC_PARAM 0x09 |
| 391 | #define RLL_CAUSE_IFRM_INC_MBITS 0x0a |
| 392 | #define RLL_CAUSE_IFRM_INC_LEN 0x0b |
| 393 | #define RLL_CAUSE_FRM_UNIMPL 0x0c |
| 394 | #define RLL_CAUSE_SABM_MF 0x0d |
| 395 | #define RLL_CAUSE_SABM_INFO_NOTALL 0x0e |
| 396 | |
| 397 | /* Chapter 9.3.26 */ |
| 398 | #define RSL_ERRCLS_NORMAL 0x00 |
| 399 | #define RSL_ERRCLS_RESOURCE_UNAVAIL 0x20 |
| 400 | #define RSL_ERRCLS_SERVICE_UNAVAIL 0x30 |
| 401 | #define RSL_ERRCLS_SERVICE_UNIMPL 0x40 |
| 402 | #define RSL_ERRCLS_INVAL_MSG 0x50 |
| 403 | #define RSL_ERRCLS_PROTO_ERROR 0x60 |
| 404 | #define RSL_ERRCLS_INTERWORKING 0x70 |
| 405 | |
| 406 | /* normal event */ |
| 407 | #define RSL_ERR_RADIO_IF_FAIL 0x00 |
| 408 | #define RSL_ERR_RADIO_LINK_FAIL 0x01 |
| 409 | #define RSL_ERR_HANDOVER_ACC_FAIL 0x02 |
| 410 | #define RSL_ERR_TALKER_ACC_FAIL 0x03 |
| 411 | #define RSL_ERR_OM_INTERVENTION 0x07 |
| 412 | #define RSL_ERR_NORMAL_UNSPEC 0x0f |
| 413 | #define RSL_ERR_T_MSRFPCI_EXP 0x18 |
| 414 | /* resource unavailable */ |
| 415 | #define RSL_ERR_EQUIPMENT_FAIL 0x20 |
| 416 | #define RSL_ERR_RR_UNAVAIL 0x21 |
| 417 | #define RSL_ERR_TERR_CH_FAIL 0x22 |
| 418 | #define RSL_ERR_CCCH_OVERLOAD 0x23 |
| 419 | #define RSL_ERR_ACCH_OVERLOAD 0x24 |
| 420 | #define RSL_ERR_PROCESSOR_OVERLOAD 0x25 |
| 421 | #define RSL_ERR_RES_UNAVAIL 0x2f |
| 422 | /* service or option not available */ |
| 423 | #define RSL_ERR_TRANSC_UNAVAIL 0x30 |
| 424 | #define RSL_ERR_SERV_OPT_UNAVAIL 0x3f |
| 425 | /* service or option not implemented */ |
| 426 | #define RSL_ERR_ENCR_UNIMPL 0x40 |
| 427 | #define RSL_ERR_SERV_OPT_UNIMPL 0x4f |
| 428 | /* invalid message */ |
| 429 | #define RSL_ERR_RCH_ALR_ACTV_ALLOC 0x50 |
| 430 | #define RSL_ERR_INVALID_MESSAGE 0x5f |
| 431 | /* protocol error */ |
| 432 | #define RSL_ERR_MSG_DISCR 0x60 |
| 433 | #define RSL_ERR_MSG_TYPE 0x61 |
| 434 | #define RSL_ERR_MSG_SEQ 0x62 |
| 435 | #define RSL_ERR_IE_ERROR 0x63 |
| 436 | #define RSL_ERR_MAND_IE_ERROR 0x64 |
| 437 | #define RSL_ERR_OPT_IE_ERROR 0x65 |
| 438 | #define RSL_ERR_IE_NONEXIST 0x66 |
| 439 | #define RSL_ERR_IE_LENGTH 0x67 |
| 440 | #define RSL_ERR_IE_CONTENT 0x68 |
| 441 | #define RSL_ERR_PROTO 0x6f |
| 442 | /* interworking */ |
| 443 | #define RSL_ERR_INTERWORKING 0x7f |
| 444 | |
| 445 | /* Chapter 9.3.30 */ |
| 446 | #define RSL_SYSTEM_INFO_8 0x00 |
| 447 | #define RSL_SYSTEM_INFO_1 0x01 |
| 448 | #define RSL_SYSTEM_INFO_2 0x02 |
| 449 | #define RSL_SYSTEM_INFO_3 0x03 |
| 450 | #define RSL_SYSTEM_INFO_4 0x04 |
| 451 | #define RSL_SYSTEM_INFO_5 0x05 |
| 452 | #define RSL_SYSTEM_INFO_6 0x06 |
| 453 | #define RSL_SYSTEM_INFO_7 0x07 |
| 454 | #define RSL_SYSTEM_INFO_16 0x08 |
| 455 | #define RSL_SYSTEM_INFO_17 0x09 |
| 456 | #define RSL_SYSTEM_INFO_2bis 0x0a |
| 457 | #define RSL_SYSTEM_INFO_2ter 0x0b |
| 458 | #define RSL_SYSTEM_INFO_5bis 0x0d |
| 459 | #define RSL_SYSTEM_INFO_5ter 0x0e |
| 460 | #define RSL_SYSTEM_INFO_10 0x0f |
Harald Welte | 3d73227 | 2011-06-25 21:39:01 +0200 | [diff] [blame] | 461 | #define RSL_EXT_MEAS_ORDER 0x47 |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 462 | #define RSL_MEAS_INFO 0x48 |
| 463 | #define RSL_SYSTEM_INFO_13 0x28 |
| 464 | #define RSL_SYSTEM_INFO_2quater 0x29 |
| 465 | #define RSL_SYSTEM_INFO_9 0x2a |
| 466 | #define RSL_SYSTEM_INFO_18 0x2b |
| 467 | #define RSL_SYSTEM_INFO_19 0x2c |
| 468 | #define RSL_SYSTEM_INFO_20 0x2d |
| 469 | |
| 470 | /* Chapter 9.3.40 */ |
| 471 | #define RSL_CHANNEED_ANY 0x00 |
| 472 | #define RSL_CHANNEED_SDCCH 0x01 |
| 473 | #define RSL_CHANNEED_TCH_F 0x02 |
| 474 | #define RSL_CHANNEED_TCH_ForH 0x03 |
| 475 | |
Harald Welte | 8f2c7e5 | 2011-08-17 18:52:03 +0200 | [diff] [blame] | 476 | /*! \brief RSL Cell Broadcast Command (Chapter 9.3.45) */ |
Alex Badea | 8493018 | 2010-11-27 23:34:46 +0200 | [diff] [blame] | 477 | struct rsl_ie_cb_cmd_type { |
| 478 | uint8_t last_block:2; |
| 479 | uint8_t spare:1; |
| 480 | uint8_t def_bcast:1; |
| 481 | uint8_t command:4; |
| 482 | } __attribute__ ((packed)); |
| 483 | /* ->command */ |
| 484 | #define RSL_CB_CMD_TYPE_NORMAL 0x00 |
| 485 | #define RSL_CB_CMD_TYPE_SCHEDULE 0x08 |
| 486 | #define RSL_CB_CMD_TYPE_DEFAULT 0x0e |
| 487 | #define RSL_CB_CMD_TYPE_NULL 0x0f |
| 488 | /* ->def_bcast */ |
| 489 | #define RSL_CB_CMD_DEFBCAST_NORMAL 0 |
| 490 | #define RSL_CB_CMD_DEFBCAST_NULL 1 |
| 491 | /* ->last_block */ |
| 492 | #define RSL_CB_CMD_LASTBLOCK_4 0 |
| 493 | #define RSL_CB_CMD_LASTBLOCK_1 1 |
| 494 | #define RSL_CB_CMD_LASTBLOCK_2 2 |
| 495 | #define RSL_CB_CMD_LASTBLOCK_3 3 |
| 496 | |
Harald Welte | ec8b450 | 2010-02-20 20:34:29 +0100 | [diff] [blame] | 497 | /* Chapter 3.3.2.3 Brocast control channel */ |
| 498 | /* CCCH-CONF, NC is not combined */ |
| 499 | #define RSL_BCCH_CCCH_CONF_1_NC 0x00 |
| 500 | #define RSL_BCCH_CCCH_CONF_1_C 0x01 |
| 501 | #define RSL_BCCH_CCCH_CONF_2_NC 0x02 |
| 502 | #define RSL_BCCH_CCCH_CONF_3_NC 0x04 |
| 503 | #define RSL_BCCH_CCCH_CONF_4_NC 0x06 |
| 504 | |
| 505 | /* BS-PA-MFRMS */ |
| 506 | #define RSL_BS_PA_MFRMS_2 0x00 |
| 507 | #define RSL_BS_PA_MFRMS_3 0x01 |
| 508 | #define RSL_BS_PA_MFRMS_4 0x02 |
| 509 | #define RSL_BS_PA_MFRMS_5 0x03 |
| 510 | #define RSL_BS_PA_MFRMS_6 0x04 |
| 511 | #define RSL_BS_PA_MFRMS_7 0x05 |
| 512 | #define RSL_BS_PA_MFRMS_8 0x06 |
| 513 | #define RSL_BS_PA_MFRMS_9 0x07 |
| 514 | |
| 515 | /* RSL_IE_IPAC_RTP_PAYLOAD[2] */ |
| 516 | enum rsl_ipac_rtp_payload { |
| 517 | RSL_IPAC_RTP_GSM = 1, |
| 518 | RSL_IPAC_RTP_EFR, |
| 519 | RSL_IPAC_RTP_AMR, |
| 520 | RSL_IPAC_RTP_CSD, |
| 521 | RSL_IPAC_RTP_MUX, |
| 522 | }; |
| 523 | |
| 524 | /* RSL_IE_IPAC_SPEECH_MODE, lower four bits */ |
| 525 | enum rsl_ipac_speech_mode_s { |
| 526 | RSL_IPAC_SPEECH_GSM_FR = 0, /* GSM FR (Type 1, FS) */ |
| 527 | RSL_IPAC_SPEECH_GSM_EFR = 1, /* GSM EFR (Type 2, FS) */ |
| 528 | RSL_IPAC_SPEECH_GSM_AMR_FR = 2, /* GSM AMR/FR (Type 3, FS) */ |
| 529 | RSL_IPAC_SPEECH_GSM_HR = 3, /* GSM HR (Type 1, HS) */ |
| 530 | RSL_IPAC_SPEECH_GSM_AMR_HR = 5, /* GSM AMR/hr (Type 3, HS) */ |
| 531 | RSL_IPAC_SPEECH_AS_RTP = 0xf, /* As specified by RTP Payload IE */ |
| 532 | }; |
| 533 | /* RSL_IE_IPAC_SPEECH_MODE, upper four bits */ |
| 534 | enum rsl_ipac_speech_mode_m { |
| 535 | RSL_IPAC_SPEECH_M_RXTX = 0, /* Send and Receive */ |
| 536 | RSL_IPAC_SPEECH_M_RX = 1, /* Receive only */ |
| 537 | RSL_IPAC_SPEECH_M_TX = 2, /* Send only */ |
| 538 | }; |
| 539 | |
| 540 | /* RSL_IE_IPAC_RTP_CSD_FMT, lower four bits */ |
| 541 | enum rsl_ipac_rtp_csd_format_d { |
| 542 | RSL_IPAC_RTP_CSD_EXT_TRAU = 0, |
| 543 | RSL_IPAC_RTP_CSD_NON_TRAU = 1, |
| 544 | RSL_IPAC_RTP_CSD_TRAU_BTS = 2, |
| 545 | RSL_IPAC_RTP_CSD_IWF_FREE = 3, |
| 546 | }; |
| 547 | /* RSL_IE_IPAC_RTP_CSD_FMT, upper four bits */ |
| 548 | enum rsl_ipac_rtp_csd_format_ir { |
| 549 | RSL_IPAC_RTP_CSD_IR_8k = 0, |
| 550 | RSL_IPAC_RTP_CSD_IR_16k = 1, |
| 551 | RSL_IPAC_RTP_CSD_IR_32k = 2, |
| 552 | RSL_IPAC_RTP_CSD_IR_64k = 3, |
| 553 | }; |
| 554 | |
| 555 | /* Siemens vendor-specific RSL extensions */ |
| 556 | struct rsl_mrpci { |
| 557 | uint8_t power_class:3, |
| 558 | vgcs_capable:1, |
| 559 | vbs_capable:1, |
| 560 | gsm_phase:2; |
| 561 | } __attribute__ ((packed)); |
| 562 | |
| 563 | enum rsl_mrpci_pwrclass { |
| 564 | RSL_MRPCI_PWRC_1 = 0, |
| 565 | RSL_MRPCI_PWRC_2 = 1, |
| 566 | RSL_MRPCI_PWRC_3 = 2, |
| 567 | RSL_MRPCI_PWRC_4 = 3, |
| 568 | RSL_MRPCI_PWRC_5 = 4, |
| 569 | }; |
| 570 | enum rsl_mrpci_phase { |
| 571 | RSL_MRPCI_PHASE_1 = 0, |
| 572 | /* reserved */ |
| 573 | RSL_MRPCI_PHASE_2 = 2, |
| 574 | RSL_MRPCI_PHASE_2PLUS = 3, |
| 575 | }; |
| 576 | |
Holger Hans Peter Freyther | 0357e9b | 2012-12-06 11:57:31 +0100 | [diff] [blame] | 577 | /* 9.3.20 Release Mode */ |
| 578 | enum rsl_rel_mode { |
| 579 | RSL_REL_NORMAL = 0, |
| 580 | RSL_REL_LOCAL_END = 1, |
| 581 | }; |
| 582 | |
Harald Welte | fad5752 | 2015-12-13 11:56:36 +0100 | [diff] [blame] | 583 | /*! \brief ip.access specific embedded information elements */ |
| 584 | enum rsl_ipac_embedded_ie { |
| 585 | RSL_IPAC_EIE_RXLEV = 0x00, |
| 586 | RSL_IPAC_EIE_RXQUAL = 0x01, |
| 587 | RSL_IPAC_EIE_FREQ_ERR = 0x02, |
| 588 | RSL_IPAC_EIE_TIMING_ERR = 0x03, |
| 589 | RSL_IPAC_EIE_MEAS_AVG_CFG = 0x04, |
| 590 | RSL_IPAC_EIE_BS_PWR_CTL = 0x05, |
| 591 | RSL_IPAC_EIE_MS_PWR_CTL = 0x06, |
| 592 | RSL_IPAC_EIE_HANDO_THRESH = 0x07, |
| 593 | RSL_IPAC_EIE_NCELL_DEFAULTS = 0x08, |
| 594 | RSL_IPAC_EIE_NCELL_LIST = 0x09, |
| 595 | RSL_IPAC_EIE_PC_THRESH_COMP = 0x0a, |
| 596 | RSL_IPAC_EIE_HO_THRESH_COMP = 0x0b, |
| 597 | RSL_IPAC_EIE_HO_CAUSE = 0x0c, |
| 598 | RSL_IPAC_EIE_HO_CANDIDATES = 0x0d, |
| 599 | RSL_IPAC_EIE_NCELL_BA_CHG_LIST = 0x0e, |
| 600 | RSL_IPAC_EIE_NUM_OF_MS = 0x10, |
| 601 | RSL_IPAC_EIE_HO_CAND_EXT = 0x11, |
| 602 | RSL_IPAC_EIE_NCELL_DEF_EXT = 0x12, |
| 603 | RSL_IPAC_EIE_NCELL_LIST_EXT = 0x13, |
| 604 | RSL_IPAC_EIE_MASTER_KEY = 0x14, |
| 605 | RSL_IPAC_EIE_MASTER_SALT = 0x15, |
| 606 | }; |
| 607 | |
Sylvain Munaut | dca7d2c | 2012-04-18 21:53:23 +0200 | [diff] [blame] | 608 | /*! @} */ |