blob: 0b732e14d923b41bc9ffa9f5a7cfbad44aef551a [file] [log] [blame]
Harald Welte52b1f982008-12-23 20:25:15 +00001/* 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
4/* (C) 2008 by Harald Welte <laforge@gnumonks.org>
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 Welte47d88ae2009-01-04 12:02:08 +000030/* generic header in front of every OML message according to TS 08.59 */
Harald Welte52b1f982008-12-23 20:25:15 +000031struct 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
48struct 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
54struct abis_om_fom_hdr {
55 u_int8_t msg_type;
56 u_int8_t obj_class;
57 struct abis_om_obj_inst obj_inst;
58} __attribute__ ((packed));
59
60#define ABIS_OM_FOM_HDR_SIZE (sizeof(struct abis_om_hdr) + sizeof(struct abis_om_fom_hdr))
61
62/* Section 9.1: Message Types */
63enum abis_nm_msgtype {
64 /* SW Download Management Messages */
65 NM_MT_LOAD_INIT = 0x01,
66 NM_MT_LOAD_INIT_ACK,
67 NM_MT_LOAD_INIT_NACK,
68 NM_MT_LOAD_SEG,
69 NM_MT_LOAD_SEG_ACK,
70 NM_MT_LOAD_ABORT,
71 NM_MT_LOAD_END,
72 NM_MT_LOAD_END_ACK,
73 NM_MT_LOAD_END_NACK,
74 NM_MT_SW_ACT_REQ, /* BTS->BSC */
75 NM_MT_SW_ACT_REQ_ACK,
76 NM_MT_SW_ACT_REQ_NACK,
77 NM_MT_ACTIVATE_SW, /* BSC->BTS */
78 NM_MT_ACTIVATE_SW_ACK,
79 NM_MT_ACTIVATE_SW_NACK,
80 NM_MT_SW_ACTIVATED_REP, /* 0x10 */
81 /* A-bis Interface Management Messages */
82 NM_MT_ESTABLISH_TEI = 0x21,
83 NM_MT_ESTABLISH_TEI_ACK,
84 NM_MT_ESTABLISH_TEI_NACK,
85 NM_MT_CONN_TERR_SIGN,
86 NM_MT_CONN_TERR_SIGN_ACK,
87 NM_MT_CONN_TERR_SIGN_NACK,
88 NM_MT_DISC_TERR_SIGN,
89 NM_MT_DISC_TERR_SIGN_ACK,
90 NM_MT_DISC_TERR_SIGN_NACK,
91 NM_MT_CONN_TERR_TRAF,
92 NM_MT_CONN_TERR_TRAF_ACK,
93 NM_MT_CONN_TERR_TRAF_NACK,
94 NM_MT_DISC_TERR_TRAF,
95 NM_MT_DISC_TERR_TRAF_ACK,
96 NM_MT_DISC_TERR_TRAF_NACK,
97 /* Transmission Management Messages */
98 NM_MT_CONN_MDROP_LINK = 0x31,
99 NM_MT_CONN_MDROP_LINK_ACK,
100 NM_MT_CONN_MDROP_LINK_NACK,
101 NM_MT_DISC_MDROP_LINK,
102 NM_MT_DISC_MDROP_LINK_ACK,
103 NM_MT_DISC_MDROP_LINK_NACK,
104 /* Air Interface Management Messages */
105 NM_MT_SET_BTS_ATTR = 0x41,
106 NM_MT_SET_BTS_ATTR_ACK,
107 NM_MT_SET_BTS_ATTR_NACK,
108 NM_MT_SET_RADIO_ATTR,
109 NM_MT_SET_RADIO_ATTR_ACK,
110 NM_MT_SET_RADIO_ATTR_NACK,
111 NM_MT_SET_CHAN_ATTR,
112 NM_MT_SET_CHAN_ATTR_ACK,
113 NM_MT_SET_CHAN_ATTR_NACK,
114 /* Test Management Messages */
115 NM_MT_PERF_TEST = 0x51,
116 NM_MT_PERF_TESET_ACK,
117 NM_MT_PERF_TEST_NACK,
118 NM_MT_TEST_REP,
119 NM_MT_SEND_TEST_REP,
120 NM_MT_SEND_TEST_REP_ACK,
121 NM_MT_SEND_TEST_REP_NACK,
122 NM_MT_STOP_TEST,
123 NM_MT_STOP_TEST_ACK,
124 NM_MT_STOP_TEST_NACK,
125 /* State Management and Event Report Messages */
126 NM_MT_STATECHG_EVENT_REP = 0x61,
127 NM_MT_FAILURE_EVENT_REP,
128 NM_MT_STOP_EVENT_REP,
129 NM_MT_STOP_EVENT_REP_ACK,
130 NM_MT_STOP_EVENT_REP_NACK,
131 NM_MT_REST_EVENT_REP,
132 NM_MT_REST_EVENT_REP_ACK,
133 NM_MT_REST_EVENT_REP_NACK,
134 NM_MT_CHG_ADM_STATE,
135 NM_MT_CHG_ADM_STATE_ACK,
136 NM_MT_CHG_ADM_STATE_NACK,
137 NM_MT_CHG_ADM_STATE_REQ,
138 NM_MT_CHG_ADM_STATE_REQ_ACK,
139 NM_MT_CHG_ADM_STATE_REQ_NACK,
140 NM_MT_REP_OUTST_ALARMS = 0x93,
141 NM_MT_REP_OUTST_ALARMS_ACK,
142 NM_MT_REP_OUTST_ALARMS_NACK,
143 /* Equipment Management Messages */
144 NM_MT_CHANGEOVER = 0x71,
145 NM_MT_CHANGEOVER_ACK,
146 NM_MT_CHANGEOVER_NACK,
147 NM_MT_OPSTART,
148 NM_MT_OPSTART_ACK,
149 NM_MT_OPSTART_NACK,
150 NM_MT_REINIT,
151 NM_MT_REINIT_ACK,
152 NM_MT_REINIT_NACK,
Harald Welte47d88ae2009-01-04 12:02:08 +0000153 NM_MT_SET_SITE_OUT, /* BS11: get alarm ?!? */
Harald Welte52b1f982008-12-23 20:25:15 +0000154 NM_MT_SET_SITE_OUT_ACK,
155 NM_MT_SET_SITE_OUT_NACK,
156 NM_MT_CHG_HW_CONF = 0x90,
157 NM_MT_CHG_HW_CONF_ACK,
158 NM_MT_CHG_HW_CONF_NACK,
159 /* Measurement Management Messages */
160 NM_MT_MEAS_RES_REQ = 0x8a,
161 NM_MT_MEAS_RES_RESP,
162 NM_MT_STOP_MEAS,
163 NM_MT_START_MEAS,
164 /* Other Messages */
165 NM_MT_GET_ATTR = 0x81,
166 NM_MT_GET_ATTR_RESP,
167 NM_MT_GET_ATTR_NACK,
168 NM_MT_SET_ALARM_THRES,
169 NM_MT_SET_ALARM_THRES_ACK,
170 NM_MT_SET_ALARM_THRES_NACK,
Harald Welte4668fda2009-01-03 08:19:29 +0000171
172 NM_MT_BS11_RESET_RESOURCE = 0x74,
173
174 NM_MT_BS11_BEGIN_DB_TX = 0xa3,
175 NM_MT_BS11_BEGIN_DB_TX_ACK,
176 NM_MT_BS11_BEGIN_DB_TX_NACK,
177 NM_MT_BS11_END_DB_TX = 0xa6,
178 NM_MT_BS11_END_DB_TX_ACK,
179 NM_MT_BS11_END_DB_TX_NACK,
180 NM_MT_BS11_CREATE_OBJ = 0xa9,
181 NM_MT_BS11_CREATE_OBJ_ACK,
182 NM_MT_BS11_CREATE_OBJ_NACK,
183 NM_MT_BS11_DELETE_OBJ = 0xac,
184 NM_MT_BS11_DELETE_OBJ_ACK,
185 NM_MT_BS11_DELETE_OBJ_NACK,
186
Harald Welte47d88ae2009-01-04 12:02:08 +0000187 NM_MT_BS11_DEACT_TRX1 = 0xd0, /* BS11: Set attr */
Harald Welte4668fda2009-01-03 08:19:29 +0000188
189 NM_MT_BS11_RESTART = 0xe7,
190 NM_MT_BS11_DISCONNECT = 0xe9,
191 NM_MT_BS11_RECONNECT = 0xf1,
Harald Welte52b1f982008-12-23 20:25:15 +0000192};
193
194/* Section 9.2: Object Class */
195enum abis_nm_obj_class {
196 NM_OC_SITE_MANAGER = 0x00,
197 NM_OC_BTS,
198 NM_OC_RADIO_CARRIER,
199 NM_OC_BASEB_TRANSC,
200 NM_OC_CHANNEL,
201 /* RFU: 05-FE */
Harald Welte47d88ae2009-01-04 12:02:08 +0000202 NM_OC_BS11_unknown = 0xa3,
203 NM_OC_BS11 = 0xa5,
204 NM_OC_BS11_ENVABTSE = 0xa8,
205 NM_OC_BS11_BPORT = 0xa9,
Harald Welte4668fda2009-01-03 08:19:29 +0000206
Harald Welte52b1f982008-12-23 20:25:15 +0000207 NM_OC_NULL = 0xff,
208};
209
210/* Section 9.4: Attributes */
211enum abis_nm_attr {
212 NM_ATT_CHANNEL = 0x01,
213 NM_ATT_ADD_INFO,
214 NM_ATT_ADD_TEXT,
215 NM_ATT_ADM_STATE,
216 NM_ATT_ARFCN_LIST,
217 NM_ATT_AUTON_REPORT,
218 NM_ATT_AVAIL_STATUS,
219 NM_ATT_BCCH_ARFCN,
220 NM_ATT_BSIC,
221 NM_ATT_BTS_AIR_TIMER,
222 NM_ATT_CCCH_L_I_P,
223 NM_ATT_CCCH_L_T,
224 NM_ATT_CHAN_COMB,
225 NM_ATT_CONN_FAIL_CRIT,
226 NM_ATT_DEST,
227 /* res */
Harald Welte47d88ae2009-01-04 12:02:08 +0000228 NM_ATT_EVENT_TYPE = 0x11, /* BS11: file data ?!? */
Harald Welte52b1f982008-12-23 20:25:15 +0000229 NM_ATT_FILE_ID,
230 NM_ATT_FILE_VERSION,
231 NM_ATT_GSM_TIME,
232 NM_ATT_HSN,
233 NM_ATT_HW_CONFIG,
234 NM_ATT_HW_DESC,
235 NM_ATT_INTAVE_PARAM,
236 NM_ATT_INTERF_BOUND,
237 NM_ATT_LIST_REQ_ATTR,
238 NM_ATT_MAIO,
239 NM_ATT_MANUF_STATE,
240 NM_ATT_MANUF_THRESH,
241 NM_ATT_MANUF_ID,
242 NM_ATT_MAX_TA,
243 NM_ATT_MDROP_LINK, /* 0x20 */
244 NM_ATT_MDROP_NEXT,
245 NM_ATT_NACK_CAUSES,
246 NM_ATT_NY1,
247 NM_ATT_OPER_STATE,
248 NM_ATT_OVERL_PERIOD,
249 NM_ATT_PHYS_CONF,
250 NM_ATT_POWER_CLASS,
251 NM_ATT_POWER_THRESH,
252 NM_ATT_PROB_CAUSE,
253 NM_ATT_RACH_B_THRESH,
254 NM_ATT_LDAVG_SLOTS,
255 NM_ATT_RAD_SUBC,
256 NM_ATT_RF_MAXPOWR_R,
257 NM_ATT_SITE_INPUTS,
258 NM_ATT_SITE_OUTPUTS,
259 NM_ATT_SOURCE, /* 0x30 */
260 NM_ATT_SPEC_PROB,
261 NM_ATT_START_TIME,
262 NM_ATT_T200,
263 NM_ATT_TEI,
264 NM_ATT_TEST_DUR,
265 NM_ATT_TEST_NO,
266 NM_ATT_TEST_REPORT,
267 NM_ATT_VSWR_THRESH,
268 NM_ATT_WINDOW_SIZE,
269 /* Res */
270 NM_ATT_TSC = 0x40,
271 NM_ATT_SW_CONFIG,
272 NM_ATT_SW_DESCR,
273 NM_ATT_SEVERITY,
274 NM_ATT_GET_ARI,
275 NM_ATT_HW_CONF_CHG,
276 NM_ATT_OUTST_ALARM,
277 NM_ATT_FILE_DATA,
278 NM_ATT_MEAS_RES,
279 NM_ATT_MEAS_TYPE,
280};
281
282/* Section 9.4.4: Administrative State */
283enum abis_nm_adm_state {
284 NM_STATE_LOCKED = 0x01,
285 NM_STATE_UNLOCKED = 0x02,
286 NM_STATE_SHUTDOWN = 0x03,
287 NM_STATE_NULL = 0xff,
288};
289
290/* Section 9.4.13: Channel Combination */
291enum abis_nm_chan_comb {
292 NM_CHANC_TCHFull = 0x00,
293 NM_CHANC_TCHHalf = 0x01,
294 NM_CHANC_TCHHalf2 = 0x02,
295 NM_CHANC_SDCCH = 0x03,
296 NM_CHANC_mainBCCH = 0x04,
297 NM_CHANC_BCCCHComb = 0x05,
298 NM_CHANC_BCCH = 0x06,
299 NM_CHANC_BCCH_CBCH = 0x07,
300 NM_CHANC_SDCCH_CBCH = 0x08,
301};
302
303/* Section 9.4.1 */
Harald Welte8470bf22008-12-25 23:28:35 +0000304struct abis_nm_channel {
Harald Welte52b1f982008-12-23 20:25:15 +0000305 u_int8_t attrib;
306 u_int8_t bts_port;
307 u_int8_t timeslot;
308 u_int8_t subslot;
309} __attribute__ ((packed));
310
Harald Welte47d88ae2009-01-04 12:02:08 +0000311/* Siemens BS-11 specific */
312enum abis_bs11_objtype {
313 BS11_OBJ_ALCO = 0x01,
314 BS11_OBJ_BBSIG = 0x02, /* obj_class: 0,1 */
315 BS11_OBJ_TRX1 = 0x03, /* only DEACTIVATE TRX1 */
316 BS11_OBJ_CCLK = 0x04,
317 BS11_OBJ_GPSU = 0x06,
318 BS11_OBJ_LI = 0x07,
319 BS11_OBJ_PA = 0x09, /* obj_class: 0, 1*/
320};
321
Harald Welte52b1f982008-12-23 20:25:15 +0000322/* PUBLIC */
323
324struct msgb;
325
326struct abis_nm_cfg {
327 /* callback for unidirectional reports */
328 int (*report_cb)(struct msgb *,
329 struct abis_om_fom_hdr *);
330 /* callback for software activate requests from BTS */
331 int (*sw_act_req)(struct msgb *);
332};
333
Harald Welte8470bf22008-12-25 23:28:35 +0000334extern int abis_nm_rcvmsg(struct msgb *msg);
Harald Welte52b1f982008-12-23 20:25:15 +0000335//extern struct abis_nm_h *abis_nm_init(struct abis_nm_cfg *cfg);
336//extern void abis_nm_fini(struct abis_nm_h *nmh);
337
338int abis_nm_rx(struct msgb *msg);
339int abis_nm_establish_tei(struct gsm_bts *bts, u_int8_t trx_nr,
340 u_int8_t e1_port, u_int8_t e1_timeslot, u_int8_t e1_subslot,
341 u_int8_t tei);
342int abis_nm_conn_terr_sign(struct gsm_bts_trx *trx,
343 u_int8_t e1_port, u_int8_t e1_timeslot, u_int8_t e1_subslot);
344int abis_nm_conn_terr_traf(struct gsm_bts_trx_ts *ts,
345 u_int8_t e1_port, u_int8_t e1_timeslot,
346 u_int8_t e1_subslot);
347int abis_nm_set_channel_attr(struct gsm_bts_trx_ts *ts, u_int8_t chan_comb);
348int abis_nm_raw_msg(struct gsm_bts *bts, int len, u_int8_t *msg);
349int abis_nm_event_reports(struct gsm_bts *bts, int on);
350int abis_nm_reset_resource(struct gsm_bts *bts);
Harald Welte47d88ae2009-01-04 12:02:08 +0000351
352/* Siemens / BS-11 specific */
Harald Welte3633a6d2008-12-26 00:06:02 +0000353int abis_nm_db_transmission(struct gsm_bts *bts, int begin);
Harald Welte47d88ae2009-01-04 12:02:08 +0000354int abis_nm_create_object(struct gsm_bts *bts, enum abis_bs11_objtype type,
355 u_int8_t idx);
356int abis_nm_create_envaBTSE(struct gsm_bts *bts, u_int8_t idx);
357int abis_nm_create_bport(struct gsm_bts *bts, u_int8_t idx);
Harald Welte52b1f982008-12-23 20:25:15 +0000358
359#endif /* _NM_H */