Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 1 | /* GSM Network Management messages on the A-bis interface |
| 2 | * 3GPP TS 12.21 version 8.0.0 Release 1999 / ETSI TS 100 623 V8.0.0 */ |
| 3 | |
Harald Welte | 4724f99 | 2009-01-18 18:01:49 +0000 | [diff] [blame] | 4 | /* (C) 2008-2009 by Harald Welte <laforge@gnumonks.org> |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 5 | * All Rights Reserved |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 2 of the License, or |
| 10 | * (at your option) any later version. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License along |
| 18 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 19 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 20 | * |
| 21 | */ |
| 22 | |
| 23 | #ifndef _NM_H |
| 24 | #define _NM_H |
| 25 | |
| 26 | #include <sys/types.h> |
| 27 | |
| 28 | /* PRIVATE */ |
| 29 | |
Harald Welte | 47d88ae | 2009-01-04 12:02:08 +0000 | [diff] [blame] | 30 | /* generic header in front of every OML message according to TS 08.59 */ |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 31 | struct abis_om_hdr { |
| 32 | u_int8_t mdisc; |
| 33 | u_int8_t placement; |
| 34 | u_int8_t sequence; |
| 35 | u_int8_t length; |
| 36 | u_int8_t data[0]; |
| 37 | } __attribute__ ((packed)); |
| 38 | |
| 39 | #define ABIS_OM_MDISC_FOM 0x80 |
| 40 | #define ABIS_OM_MDISC_MMI 0x40 |
| 41 | #define ABIS_OM_MDISC_TRAU 0x20 |
| 42 | #define ABIS_OM_MDISC_MANUF 0x10 |
| 43 | #define ABIS_OM_PLACEMENT_ONLY 0x80 |
| 44 | #define ABIS_OM_PLACEMENT_FIRST 0x40 |
| 45 | #define ABIS_OM_PLACEMENT_MIDDLE 0x20 |
| 46 | #define ABIS_OM_PLACEMENT_LAST 0x10 |
| 47 | |
| 48 | struct abis_om_obj_inst { |
| 49 | u_int8_t bts_nr; |
| 50 | u_int8_t trx_nr; |
| 51 | u_int8_t ts_nr; |
| 52 | } __attribute__ ((packed)); |
| 53 | |
| 54 | struct abis_om_fom_hdr { |
| 55 | u_int8_t msg_type; |
| 56 | u_int8_t obj_class; |
| 57 | struct abis_om_obj_inst obj_inst; |
Harald Welte | f3066bb | 2009-01-18 19:02:46 +0000 | [diff] [blame] | 58 | u_int8_t data[0]; |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 59 | } __attribute__ ((packed)); |
| 60 | |
| 61 | #define ABIS_OM_FOM_HDR_SIZE (sizeof(struct abis_om_hdr) + sizeof(struct abis_om_fom_hdr)) |
| 62 | |
| 63 | /* Section 9.1: Message Types */ |
| 64 | enum abis_nm_msgtype { |
| 65 | /* SW Download Management Messages */ |
| 66 | NM_MT_LOAD_INIT = 0x01, |
| 67 | NM_MT_LOAD_INIT_ACK, |
| 68 | NM_MT_LOAD_INIT_NACK, |
| 69 | NM_MT_LOAD_SEG, |
| 70 | NM_MT_LOAD_SEG_ACK, |
| 71 | NM_MT_LOAD_ABORT, |
| 72 | NM_MT_LOAD_END, |
| 73 | NM_MT_LOAD_END_ACK, |
| 74 | NM_MT_LOAD_END_NACK, |
| 75 | NM_MT_SW_ACT_REQ, /* BTS->BSC */ |
| 76 | NM_MT_SW_ACT_REQ_ACK, |
| 77 | NM_MT_SW_ACT_REQ_NACK, |
| 78 | NM_MT_ACTIVATE_SW, /* BSC->BTS */ |
| 79 | NM_MT_ACTIVATE_SW_ACK, |
| 80 | NM_MT_ACTIVATE_SW_NACK, |
| 81 | NM_MT_SW_ACTIVATED_REP, /* 0x10 */ |
| 82 | /* A-bis Interface Management Messages */ |
| 83 | NM_MT_ESTABLISH_TEI = 0x21, |
| 84 | NM_MT_ESTABLISH_TEI_ACK, |
| 85 | NM_MT_ESTABLISH_TEI_NACK, |
| 86 | NM_MT_CONN_TERR_SIGN, |
| 87 | NM_MT_CONN_TERR_SIGN_ACK, |
| 88 | NM_MT_CONN_TERR_SIGN_NACK, |
| 89 | NM_MT_DISC_TERR_SIGN, |
| 90 | NM_MT_DISC_TERR_SIGN_ACK, |
| 91 | NM_MT_DISC_TERR_SIGN_NACK, |
| 92 | NM_MT_CONN_TERR_TRAF, |
| 93 | NM_MT_CONN_TERR_TRAF_ACK, |
| 94 | NM_MT_CONN_TERR_TRAF_NACK, |
| 95 | NM_MT_DISC_TERR_TRAF, |
| 96 | NM_MT_DISC_TERR_TRAF_ACK, |
| 97 | NM_MT_DISC_TERR_TRAF_NACK, |
| 98 | /* Transmission Management Messages */ |
| 99 | NM_MT_CONN_MDROP_LINK = 0x31, |
| 100 | NM_MT_CONN_MDROP_LINK_ACK, |
| 101 | NM_MT_CONN_MDROP_LINK_NACK, |
| 102 | NM_MT_DISC_MDROP_LINK, |
| 103 | NM_MT_DISC_MDROP_LINK_ACK, |
| 104 | NM_MT_DISC_MDROP_LINK_NACK, |
| 105 | /* Air Interface Management Messages */ |
| 106 | NM_MT_SET_BTS_ATTR = 0x41, |
| 107 | NM_MT_SET_BTS_ATTR_ACK, |
| 108 | NM_MT_SET_BTS_ATTR_NACK, |
| 109 | NM_MT_SET_RADIO_ATTR, |
| 110 | NM_MT_SET_RADIO_ATTR_ACK, |
| 111 | NM_MT_SET_RADIO_ATTR_NACK, |
| 112 | NM_MT_SET_CHAN_ATTR, |
| 113 | NM_MT_SET_CHAN_ATTR_ACK, |
| 114 | NM_MT_SET_CHAN_ATTR_NACK, |
| 115 | /* Test Management Messages */ |
| 116 | NM_MT_PERF_TEST = 0x51, |
| 117 | NM_MT_PERF_TESET_ACK, |
| 118 | NM_MT_PERF_TEST_NACK, |
| 119 | NM_MT_TEST_REP, |
| 120 | NM_MT_SEND_TEST_REP, |
| 121 | NM_MT_SEND_TEST_REP_ACK, |
| 122 | NM_MT_SEND_TEST_REP_NACK, |
| 123 | NM_MT_STOP_TEST, |
| 124 | NM_MT_STOP_TEST_ACK, |
| 125 | NM_MT_STOP_TEST_NACK, |
| 126 | /* State Management and Event Report Messages */ |
| 127 | NM_MT_STATECHG_EVENT_REP = 0x61, |
| 128 | NM_MT_FAILURE_EVENT_REP, |
| 129 | NM_MT_STOP_EVENT_REP, |
| 130 | NM_MT_STOP_EVENT_REP_ACK, |
| 131 | NM_MT_STOP_EVENT_REP_NACK, |
| 132 | NM_MT_REST_EVENT_REP, |
| 133 | NM_MT_REST_EVENT_REP_ACK, |
| 134 | NM_MT_REST_EVENT_REP_NACK, |
| 135 | NM_MT_CHG_ADM_STATE, |
| 136 | NM_MT_CHG_ADM_STATE_ACK, |
| 137 | NM_MT_CHG_ADM_STATE_NACK, |
| 138 | NM_MT_CHG_ADM_STATE_REQ, |
| 139 | NM_MT_CHG_ADM_STATE_REQ_ACK, |
| 140 | NM_MT_CHG_ADM_STATE_REQ_NACK, |
| 141 | NM_MT_REP_OUTST_ALARMS = 0x93, |
| 142 | NM_MT_REP_OUTST_ALARMS_ACK, |
| 143 | NM_MT_REP_OUTST_ALARMS_NACK, |
| 144 | /* Equipment Management Messages */ |
| 145 | NM_MT_CHANGEOVER = 0x71, |
| 146 | NM_MT_CHANGEOVER_ACK, |
| 147 | NM_MT_CHANGEOVER_NACK, |
| 148 | NM_MT_OPSTART, |
| 149 | NM_MT_OPSTART_ACK, |
| 150 | NM_MT_OPSTART_NACK, |
| 151 | NM_MT_REINIT, |
| 152 | NM_MT_REINIT_ACK, |
| 153 | NM_MT_REINIT_NACK, |
Harald Welte | 47d88ae | 2009-01-04 12:02:08 +0000 | [diff] [blame] | 154 | NM_MT_SET_SITE_OUT, /* BS11: get alarm ?!? */ |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 155 | NM_MT_SET_SITE_OUT_ACK, |
| 156 | NM_MT_SET_SITE_OUT_NACK, |
| 157 | NM_MT_CHG_HW_CONF = 0x90, |
| 158 | NM_MT_CHG_HW_CONF_ACK, |
| 159 | NM_MT_CHG_HW_CONF_NACK, |
| 160 | /* Measurement Management Messages */ |
| 161 | NM_MT_MEAS_RES_REQ = 0x8a, |
| 162 | NM_MT_MEAS_RES_RESP, |
| 163 | NM_MT_STOP_MEAS, |
| 164 | NM_MT_START_MEAS, |
| 165 | /* Other Messages */ |
| 166 | NM_MT_GET_ATTR = 0x81, |
| 167 | NM_MT_GET_ATTR_RESP, |
| 168 | NM_MT_GET_ATTR_NACK, |
| 169 | NM_MT_SET_ALARM_THRES, |
| 170 | NM_MT_SET_ALARM_THRES_ACK, |
| 171 | NM_MT_SET_ALARM_THRES_NACK, |
Harald Welte | 4668fda | 2009-01-03 08:19:29 +0000 | [diff] [blame] | 172 | |
| 173 | NM_MT_BS11_RESET_RESOURCE = 0x74, |
| 174 | |
| 175 | NM_MT_BS11_BEGIN_DB_TX = 0xa3, |
| 176 | NM_MT_BS11_BEGIN_DB_TX_ACK, |
| 177 | NM_MT_BS11_BEGIN_DB_TX_NACK, |
| 178 | NM_MT_BS11_END_DB_TX = 0xa6, |
| 179 | NM_MT_BS11_END_DB_TX_ACK, |
| 180 | NM_MT_BS11_END_DB_TX_NACK, |
| 181 | NM_MT_BS11_CREATE_OBJ = 0xa9, |
| 182 | NM_MT_BS11_CREATE_OBJ_ACK, |
| 183 | NM_MT_BS11_CREATE_OBJ_NACK, |
| 184 | NM_MT_BS11_DELETE_OBJ = 0xac, |
| 185 | NM_MT_BS11_DELETE_OBJ_ACK, |
| 186 | NM_MT_BS11_DELETE_OBJ_NACK, |
| 187 | |
Harald Welte | adaf08b | 2009-01-18 11:08:10 +0000 | [diff] [blame] | 188 | NM_MT_BS11_SET_ATTR = 0xd0, |
| 189 | NM_MT_BS11_SET_ATTR_ACK, |
Harald Welte | 4668fda | 2009-01-03 08:19:29 +0000 | [diff] [blame] | 190 | |
Harald Welte | 1bc0906 | 2009-01-18 14:17:52 +0000 | [diff] [blame] | 191 | NM_MT_BS11_GET_STATE = 0xe3, |
| 192 | NM_MT_BS11_GET_STATE_ACK, |
Harald Welte | 043d04a | 2009-01-29 23:15:30 +0000 | [diff] [blame] | 193 | NM_MT_BS11_LMT_LOGON = 0xe5, |
| 194 | NM_MT_BS11_LMT_LOGON_ACK, |
Harald Welte | 4668fda | 2009-01-03 08:19:29 +0000 | [diff] [blame] | 195 | NM_MT_BS11_RESTART = 0xe7, |
Harald Welte | adaf08b | 2009-01-18 11:08:10 +0000 | [diff] [blame] | 196 | NM_MT_BS11_RESTART_ACK, |
Harald Welte | 4668fda | 2009-01-03 08:19:29 +0000 | [diff] [blame] | 197 | NM_MT_BS11_DISCONNECT = 0xe9, |
Harald Welte | adaf08b | 2009-01-18 11:08:10 +0000 | [diff] [blame] | 198 | NM_MT_BS11_DISCONNECT_ACK, |
| 199 | NM_MT_BS11_LOGOFF = 0xec, |
| 200 | NM_MT_BS11_LOGOFF_ACK, |
Harald Welte | 4668fda | 2009-01-03 08:19:29 +0000 | [diff] [blame] | 201 | NM_MT_BS11_RECONNECT = 0xf1, |
Harald Welte | adaf08b | 2009-01-18 11:08:10 +0000 | [diff] [blame] | 202 | NM_MT_BS11_RECONNECT_ACK, |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 203 | }; |
| 204 | |
| 205 | /* Section 9.2: Object Class */ |
| 206 | enum abis_nm_obj_class { |
| 207 | NM_OC_SITE_MANAGER = 0x00, |
| 208 | NM_OC_BTS, |
| 209 | NM_OC_RADIO_CARRIER, |
| 210 | NM_OC_BASEB_TRANSC, |
| 211 | NM_OC_CHANNEL, |
| 212 | /* RFU: 05-FE */ |
Harald Welte | adaf08b | 2009-01-18 11:08:10 +0000 | [diff] [blame] | 213 | NM_OC_BS11_A0 = 0xa0, |
| 214 | NM_OC_BS11_A3 = 0xa3, |
| 215 | NM_OC_BS11_A4 = 0xa4, |
Harald Welte | 47d88ae | 2009-01-04 12:02:08 +0000 | [diff] [blame] | 216 | NM_OC_BS11 = 0xa5, |
Harald Welte | adaf08b | 2009-01-18 11:08:10 +0000 | [diff] [blame] | 217 | NM_OC_BS11_A6 = 0xa6, |
Harald Welte | 47d88ae | 2009-01-04 12:02:08 +0000 | [diff] [blame] | 218 | NM_OC_BS11_ENVABTSE = 0xa8, |
| 219 | NM_OC_BS11_BPORT = 0xa9, |
Harald Welte | 4668fda | 2009-01-03 08:19:29 +0000 | [diff] [blame] | 220 | |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 221 | NM_OC_NULL = 0xff, |
| 222 | }; |
| 223 | |
| 224 | /* Section 9.4: Attributes */ |
| 225 | enum abis_nm_attr { |
Harald Welte | adaf08b | 2009-01-18 11:08:10 +0000 | [diff] [blame] | 226 | NM_ATT_ABIS_CHANNEL = 0x01, |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 227 | NM_ATT_ADD_INFO, |
| 228 | NM_ATT_ADD_TEXT, |
| 229 | NM_ATT_ADM_STATE, |
| 230 | NM_ATT_ARFCN_LIST, |
| 231 | NM_ATT_AUTON_REPORT, |
| 232 | NM_ATT_AVAIL_STATUS, |
| 233 | NM_ATT_BCCH_ARFCN, |
| 234 | NM_ATT_BSIC, |
| 235 | NM_ATT_BTS_AIR_TIMER, |
| 236 | NM_ATT_CCCH_L_I_P, |
| 237 | NM_ATT_CCCH_L_T, |
| 238 | NM_ATT_CHAN_COMB, |
| 239 | NM_ATT_CONN_FAIL_CRIT, |
| 240 | NM_ATT_DEST, |
| 241 | /* res */ |
Harald Welte | 47d88ae | 2009-01-04 12:02:08 +0000 | [diff] [blame] | 242 | NM_ATT_EVENT_TYPE = 0x11, /* BS11: file data ?!? */ |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 243 | NM_ATT_FILE_ID, |
| 244 | NM_ATT_FILE_VERSION, |
| 245 | NM_ATT_GSM_TIME, |
| 246 | NM_ATT_HSN, |
| 247 | NM_ATT_HW_CONFIG, |
| 248 | NM_ATT_HW_DESC, |
| 249 | NM_ATT_INTAVE_PARAM, |
| 250 | NM_ATT_INTERF_BOUND, |
| 251 | NM_ATT_LIST_REQ_ATTR, |
| 252 | NM_ATT_MAIO, |
| 253 | NM_ATT_MANUF_STATE, |
| 254 | NM_ATT_MANUF_THRESH, |
| 255 | NM_ATT_MANUF_ID, |
| 256 | NM_ATT_MAX_TA, |
| 257 | NM_ATT_MDROP_LINK, /* 0x20 */ |
| 258 | NM_ATT_MDROP_NEXT, |
| 259 | NM_ATT_NACK_CAUSES, |
| 260 | NM_ATT_NY1, |
| 261 | NM_ATT_OPER_STATE, |
| 262 | NM_ATT_OVERL_PERIOD, |
| 263 | NM_ATT_PHYS_CONF, |
| 264 | NM_ATT_POWER_CLASS, |
| 265 | NM_ATT_POWER_THRESH, |
| 266 | NM_ATT_PROB_CAUSE, |
| 267 | NM_ATT_RACH_B_THRESH, |
| 268 | NM_ATT_LDAVG_SLOTS, |
| 269 | NM_ATT_RAD_SUBC, |
| 270 | NM_ATT_RF_MAXPOWR_R, |
| 271 | NM_ATT_SITE_INPUTS, |
| 272 | NM_ATT_SITE_OUTPUTS, |
| 273 | NM_ATT_SOURCE, /* 0x30 */ |
| 274 | NM_ATT_SPEC_PROB, |
| 275 | NM_ATT_START_TIME, |
| 276 | NM_ATT_T200, |
| 277 | NM_ATT_TEI, |
| 278 | NM_ATT_TEST_DUR, |
| 279 | NM_ATT_TEST_NO, |
| 280 | NM_ATT_TEST_REPORT, |
| 281 | NM_ATT_VSWR_THRESH, |
| 282 | NM_ATT_WINDOW_SIZE, |
| 283 | /* Res */ |
Harald Welte | 934e68b | 2009-01-29 23:08:12 +0000 | [diff] [blame] | 284 | NM_ATT_BS11_RSSI_OFFS = 0x3d, |
Harald Welte | adaf08b | 2009-01-18 11:08:10 +0000 | [diff] [blame] | 285 | NM_ATT_BS11_TXPWR = 0x3e, |
Harald Welte | 934e68b | 2009-01-29 23:08:12 +0000 | [diff] [blame] | 286 | NM_ATT_BS11_DIVERSITY = 0x3f, |
Harald Welte | adaf08b | 2009-01-18 11:08:10 +0000 | [diff] [blame] | 287 | /* Res */ |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 288 | NM_ATT_TSC = 0x40, |
| 289 | NM_ATT_SW_CONFIG, |
| 290 | NM_ATT_SW_DESCR, |
| 291 | NM_ATT_SEVERITY, |
| 292 | NM_ATT_GET_ARI, |
| 293 | NM_ATT_HW_CONF_CHG, |
| 294 | NM_ATT_OUTST_ALARM, |
| 295 | NM_ATT_FILE_DATA, |
| 296 | NM_ATT_MEAS_RES, |
| 297 | NM_ATT_MEAS_TYPE, |
Harald Welte | 1bc0906 | 2009-01-18 14:17:52 +0000 | [diff] [blame] | 298 | |
Harald Welte | 934e68b | 2009-01-29 23:08:12 +0000 | [diff] [blame] | 299 | NM_ATT_BS11_ALL_TEST_CATG = 0x60, |
| 300 | NM_ATT_BS11_BTSLS_HOPPING, |
| 301 | NM_ATT_BS11_CELL_ALLOC_NR, |
| 302 | NM_ATT_BS11_CALL_GLOBAL_ID, |
| 303 | NM_ATT_BS11_ENA_INTERF_CLASS = 0x66, |
| 304 | NM_ATT_BS11_ENA_INT_INTEC_HANDO = 0x67, |
| 305 | NM_ATT_BS11_ENA_INT_INTRC_HANDO = 0x68, |
| 306 | NM_ATT_BS11_ENA_MS_PWR_CTRL = 0x69, |
| 307 | NM_ATT_BS11_ENA_PWR_BDGT_HO = 0x6a, |
| 308 | NM_ATT_BS11_ENA_PWR_CTRL_RLFW = 0x6b, |
| 309 | NM_ATT_BS11_ENA_RXLEV_HO = 0x6c, |
| 310 | NM_ATT_BS11_ENA_RXQUAL_HO = 0x6d, |
| 311 | |
| 312 | NM_ATT_BS11_RX_LEV_MIN_CELL = 0x90, |
| 313 | NM_ATT_BS11_ABIS_EXT_TIME = 0x91, |
| 314 | NM_ATT_BS11_TIMER_HO_REQUEST = 0x92, |
| 315 | NM_ATT_BS11_TIMER_NCELL = 0x93, |
| 316 | NM_ATT_BS11_TSYNC = 0x94, |
| 317 | NM_ATT_BS11_TTRAU = 0x95, |
| 318 | |
| 319 | NM_ATT_BS11_BCCH_RECONF = 0xd7, |
| 320 | NM_ATT_BS11_BIT_ERR_THESH = 0xa0, |
| 321 | NM_ATT_BS11_BOOT_SW_VERS = 0xa1, |
| 322 | NM_ATT_BS11_CCLK_ACCURACY = 0xa3, |
| 323 | NM_ATT_BS11_CCLK_TYPE = 0xa4, |
| 324 | NM_ATT_BS11_INP_IMPEDANCE = 0xaa, |
| 325 | NM_ATT_BS11_L1_PROT_TYPE = 0xab, |
| 326 | NM_ATT_BS11_LINE_CFG = 0xac, |
| 327 | NM_ATT_BS11_LI_PORT_1 = 0xad, |
| 328 | NM_ATT_BS11_LI_PORT_2 = 0xae, |
| 329 | |
| 330 | NM_ATT_BS11_L1_REM_ALM_TYPE = 0xb0, |
| 331 | NM_ATT_BS11_SW_LOAD_INTENDED = 0xbb, |
| 332 | NM_ATT_BS11_SW_LOAD_SAFETY = 0xbc, |
| 333 | NM_ATT_BS11_SW_LOAD_SSTORED = 0xbd, |
| 334 | |
| 335 | NM_ATT_BS11_VENDOR_NAME = 0xc1, |
| 336 | NM_ATT_BS11_LMT_LOGON_SESSION = 0xc6, |
| 337 | NM_ATT_BS11_LMT_LOGIN_TIME = 0xc7, |
| 338 | NM_ATT_BS11_LMT_USER_ACC_LEV = 0xc8, |
| 339 | NM_ATT_BS11_LMT_USER_NAME = 0xc9, |
| 340 | |
| 341 | NM_ATT_BS11_L1_CONTROL_TS = 0xd8, |
| 342 | |
| 343 | NM_ATT_BS11_PLL = 0xf2, |
| 344 | NM_ATT_BS11_RX_OFFSET = 0xf3, |
| 345 | NM_ATT_BS11_ANT_TYPE = 0xf4, |
| 346 | NM_ATT_BS11_PASSWORD = 0xfd, |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 347 | }; |
Harald Welte | 3b8ba21 | 2009-01-29 12:27:58 +0000 | [diff] [blame] | 348 | #define NM_ATT_BS11_FILE_DATA NM_ATT_EVENT_TYPE |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 349 | |
| 350 | /* Section 9.4.4: Administrative State */ |
| 351 | enum abis_nm_adm_state { |
| 352 | NM_STATE_LOCKED = 0x01, |
| 353 | NM_STATE_UNLOCKED = 0x02, |
| 354 | NM_STATE_SHUTDOWN = 0x03, |
| 355 | NM_STATE_NULL = 0xff, |
| 356 | }; |
| 357 | |
| 358 | /* Section 9.4.13: Channel Combination */ |
| 359 | enum abis_nm_chan_comb { |
| 360 | NM_CHANC_TCHFull = 0x00, |
| 361 | NM_CHANC_TCHHalf = 0x01, |
| 362 | NM_CHANC_TCHHalf2 = 0x02, |
| 363 | NM_CHANC_SDCCH = 0x03, |
| 364 | NM_CHANC_mainBCCH = 0x04, |
| 365 | NM_CHANC_BCCCHComb = 0x05, |
| 366 | NM_CHANC_BCCH = 0x06, |
| 367 | NM_CHANC_BCCH_CBCH = 0x07, |
| 368 | NM_CHANC_SDCCH_CBCH = 0x08, |
| 369 | }; |
| 370 | |
| 371 | /* Section 9.4.1 */ |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 372 | struct abis_nm_channel { |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 373 | u_int8_t attrib; |
| 374 | u_int8_t bts_port; |
| 375 | u_int8_t timeslot; |
| 376 | u_int8_t subslot; |
| 377 | } __attribute__ ((packed)); |
| 378 | |
Harald Welte | 47d88ae | 2009-01-04 12:02:08 +0000 | [diff] [blame] | 379 | /* Siemens BS-11 specific */ |
| 380 | enum abis_bs11_objtype { |
| 381 | BS11_OBJ_ALCO = 0x01, |
| 382 | BS11_OBJ_BBSIG = 0x02, /* obj_class: 0,1 */ |
| 383 | BS11_OBJ_TRX1 = 0x03, /* only DEACTIVATE TRX1 */ |
| 384 | BS11_OBJ_CCLK = 0x04, |
| 385 | BS11_OBJ_GPSU = 0x06, |
| 386 | BS11_OBJ_LI = 0x07, |
| 387 | BS11_OBJ_PA = 0x09, /* obj_class: 0, 1*/ |
| 388 | }; |
| 389 | |
Harald Welte | 1bc0906 | 2009-01-18 14:17:52 +0000 | [diff] [blame] | 390 | enum abis_bs11_trx_power { |
| 391 | BS11_TRX_POWER_30mW = 0x09, |
| 392 | }; |
| 393 | |
| 394 | enum abis_bs11_state { |
| 395 | BS11_STATE_SOFTWARE_RQD = 0x01, |
| 396 | BS11_STATE_NORMAL = 0x03, |
| 397 | BS11_STATE_LOAD_SMU_SAFETY = 0x21, |
| 398 | BS11_STATE_WARM_UP = 0x51, |
| 399 | BS11_STATE_WAIT_MIN_CFG = 0x62, |
| 400 | BS11_STATE_MAINTENANCE = 0x72, |
| 401 | BS11_STATE_WAIT_MIN_CFG_2 = 0xA2, |
| 402 | }; |
| 403 | |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 404 | /* PUBLIC */ |
| 405 | |
| 406 | struct msgb; |
| 407 | |
| 408 | struct abis_nm_cfg { |
| 409 | /* callback for unidirectional reports */ |
| 410 | int (*report_cb)(struct msgb *, |
| 411 | struct abis_om_fom_hdr *); |
| 412 | /* callback for software activate requests from BTS */ |
| 413 | int (*sw_act_req)(struct msgb *); |
| 414 | }; |
| 415 | |
Harald Welte | 8470bf2 | 2008-12-25 23:28:35 +0000 | [diff] [blame] | 416 | extern int abis_nm_rcvmsg(struct msgb *msg); |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 417 | //extern struct abis_nm_h *abis_nm_init(struct abis_nm_cfg *cfg); |
| 418 | //extern void abis_nm_fini(struct abis_nm_h *nmh); |
| 419 | |
| 420 | int abis_nm_rx(struct msgb *msg); |
| 421 | int abis_nm_establish_tei(struct gsm_bts *bts, u_int8_t trx_nr, |
| 422 | u_int8_t e1_port, u_int8_t e1_timeslot, u_int8_t e1_subslot, |
| 423 | u_int8_t tei); |
| 424 | int abis_nm_conn_terr_sign(struct gsm_bts_trx *trx, |
| 425 | u_int8_t e1_port, u_int8_t e1_timeslot, u_int8_t e1_subslot); |
| 426 | int abis_nm_conn_terr_traf(struct gsm_bts_trx_ts *ts, |
| 427 | u_int8_t e1_port, u_int8_t e1_timeslot, |
| 428 | u_int8_t e1_subslot); |
| 429 | int abis_nm_set_channel_attr(struct gsm_bts_trx_ts *ts, u_int8_t chan_comb); |
| 430 | int abis_nm_raw_msg(struct gsm_bts *bts, int len, u_int8_t *msg); |
| 431 | int abis_nm_event_reports(struct gsm_bts *bts, int on); |
| 432 | int abis_nm_reset_resource(struct gsm_bts *bts); |
Harald Welte | 4724f99 | 2009-01-18 18:01:49 +0000 | [diff] [blame] | 433 | int abis_nm_software_load(struct gsm_bts *bts, const char *fname, u_int8_t win); |
Harald Welte | 47d88ae | 2009-01-04 12:02:08 +0000 | [diff] [blame] | 434 | |
| 435 | /* Siemens / BS-11 specific */ |
Holger Freyther | 245c534 | 2009-01-27 19:00:44 +0000 | [diff] [blame] | 436 | int abis_nm_bs11_reset_resource(struct gsm_bts *bts); |
Harald Welte | 05188ee | 2009-01-18 11:39:08 +0000 | [diff] [blame] | 437 | int abis_nm_bs11_db_transmission(struct gsm_bts *bts, int begin); |
| 438 | int abis_nm_bs11_create_object(struct gsm_bts *bts, enum abis_bs11_objtype type, |
Harald Welte | 1bc0906 | 2009-01-18 14:17:52 +0000 | [diff] [blame] | 439 | u_int8_t idx, u_int8_t attr_len, const u_int8_t *attr); |
Harald Welte | 05188ee | 2009-01-18 11:39:08 +0000 | [diff] [blame] | 440 | int abis_nm_bs11_create_envaBTSE(struct gsm_bts *bts, u_int8_t idx); |
| 441 | int abis_nm_bs11_create_bport(struct gsm_bts *bts, u_int8_t idx); |
| 442 | int abis_nm_bs11_set_oml_tei(struct gsm_bts *bts, u_int8_t tei); |
| 443 | int abis_nm_bs11_conn_oml(struct gsm_bts *bts, u_int8_t e1_port, |
| 444 | u_int8_t e1_timeslot, u_int8_t e1_subslot); |
| 445 | int abis_nm_bs11_set_trx_power(struct gsm_bts_trx *trx, u_int8_t level); |
Harald Welte | 1bc0906 | 2009-01-18 14:17:52 +0000 | [diff] [blame] | 446 | int abis_nm_bs11_factory_logon(struct gsm_bts *bts, int on); |
| 447 | int abis_nm_bs11_set_trx1_pw(struct gsm_bts *bts, const char *password); |
| 448 | int abis_nm_bs11_get_state(struct gsm_bts *bts); |
Harald Welte | 52b1f98 | 2008-12-23 20:25:15 +0000 | [diff] [blame] | 449 | |
| 450 | #endif /* _NM_H */ |