blob: b86e0221a62b3f8099236173876c117693ef3556 [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 Welteadaf08b2009-01-18 11:08:10 +0000187 NM_MT_BS11_SET_ATTR = 0xd0,
188 NM_MT_BS11_SET_ATTR_ACK,
Harald Welte4668fda2009-01-03 08:19:29 +0000189
Harald Welteadaf08b2009-01-18 11:08:10 +0000190 NM_MT_BS11_FACTORY_LOGON = 0xe5,
191 NM_MT_BS11_FACTORY_LOGON_ACK,
Harald Welte4668fda2009-01-03 08:19:29 +0000192 NM_MT_BS11_RESTART = 0xe7,
Harald Welteadaf08b2009-01-18 11:08:10 +0000193 NM_MT_BS11_RESTART_ACK,
Harald Welte4668fda2009-01-03 08:19:29 +0000194 NM_MT_BS11_DISCONNECT = 0xe9,
Harald Welteadaf08b2009-01-18 11:08:10 +0000195 NM_MT_BS11_DISCONNECT_ACK,
196 NM_MT_BS11_LOGOFF = 0xec,
197 NM_MT_BS11_LOGOFF_ACK,
Harald Welte4668fda2009-01-03 08:19:29 +0000198 NM_MT_BS11_RECONNECT = 0xf1,
Harald Welteadaf08b2009-01-18 11:08:10 +0000199 NM_MT_BS11_RECONNECT_ACK,
Harald Welte52b1f982008-12-23 20:25:15 +0000200};
201
202/* Section 9.2: Object Class */
203enum abis_nm_obj_class {
204 NM_OC_SITE_MANAGER = 0x00,
205 NM_OC_BTS,
206 NM_OC_RADIO_CARRIER,
207 NM_OC_BASEB_TRANSC,
208 NM_OC_CHANNEL,
209 /* RFU: 05-FE */
Harald Welteadaf08b2009-01-18 11:08:10 +0000210 NM_OC_BS11_A0 = 0xa0,
211 NM_OC_BS11_A3 = 0xa3,
212 NM_OC_BS11_A4 = 0xa4,
Harald Welte47d88ae2009-01-04 12:02:08 +0000213 NM_OC_BS11 = 0xa5,
Harald Welteadaf08b2009-01-18 11:08:10 +0000214 NM_OC_BS11_A6 = 0xa6,
Harald Welte47d88ae2009-01-04 12:02:08 +0000215 NM_OC_BS11_ENVABTSE = 0xa8,
216 NM_OC_BS11_BPORT = 0xa9,
Harald Welte4668fda2009-01-03 08:19:29 +0000217
Harald Welte52b1f982008-12-23 20:25:15 +0000218 NM_OC_NULL = 0xff,
219};
220
221/* Section 9.4: Attributes */
222enum abis_nm_attr {
Harald Welteadaf08b2009-01-18 11:08:10 +0000223 NM_ATT_ABIS_CHANNEL = 0x01,
Harald Welte52b1f982008-12-23 20:25:15 +0000224 NM_ATT_ADD_INFO,
225 NM_ATT_ADD_TEXT,
226 NM_ATT_ADM_STATE,
227 NM_ATT_ARFCN_LIST,
228 NM_ATT_AUTON_REPORT,
229 NM_ATT_AVAIL_STATUS,
230 NM_ATT_BCCH_ARFCN,
231 NM_ATT_BSIC,
232 NM_ATT_BTS_AIR_TIMER,
233 NM_ATT_CCCH_L_I_P,
234 NM_ATT_CCCH_L_T,
235 NM_ATT_CHAN_COMB,
236 NM_ATT_CONN_FAIL_CRIT,
237 NM_ATT_DEST,
238 /* res */
Harald Welte47d88ae2009-01-04 12:02:08 +0000239 NM_ATT_EVENT_TYPE = 0x11, /* BS11: file data ?!? */
Harald Welte52b1f982008-12-23 20:25:15 +0000240 NM_ATT_FILE_ID,
241 NM_ATT_FILE_VERSION,
242 NM_ATT_GSM_TIME,
243 NM_ATT_HSN,
244 NM_ATT_HW_CONFIG,
245 NM_ATT_HW_DESC,
246 NM_ATT_INTAVE_PARAM,
247 NM_ATT_INTERF_BOUND,
248 NM_ATT_LIST_REQ_ATTR,
249 NM_ATT_MAIO,
250 NM_ATT_MANUF_STATE,
251 NM_ATT_MANUF_THRESH,
252 NM_ATT_MANUF_ID,
253 NM_ATT_MAX_TA,
254 NM_ATT_MDROP_LINK, /* 0x20 */
255 NM_ATT_MDROP_NEXT,
256 NM_ATT_NACK_CAUSES,
257 NM_ATT_NY1,
258 NM_ATT_OPER_STATE,
259 NM_ATT_OVERL_PERIOD,
260 NM_ATT_PHYS_CONF,
261 NM_ATT_POWER_CLASS,
262 NM_ATT_POWER_THRESH,
263 NM_ATT_PROB_CAUSE,
264 NM_ATT_RACH_B_THRESH,
265 NM_ATT_LDAVG_SLOTS,
266 NM_ATT_RAD_SUBC,
267 NM_ATT_RF_MAXPOWR_R,
268 NM_ATT_SITE_INPUTS,
269 NM_ATT_SITE_OUTPUTS,
270 NM_ATT_SOURCE, /* 0x30 */
271 NM_ATT_SPEC_PROB,
272 NM_ATT_START_TIME,
273 NM_ATT_T200,
274 NM_ATT_TEI,
275 NM_ATT_TEST_DUR,
276 NM_ATT_TEST_NO,
277 NM_ATT_TEST_REPORT,
278 NM_ATT_VSWR_THRESH,
279 NM_ATT_WINDOW_SIZE,
280 /* Res */
Harald Welteadaf08b2009-01-18 11:08:10 +0000281 NM_ATT_BS11_TXPWR = 0x3e,
282 /* Res */
Harald Welte52b1f982008-12-23 20:25:15 +0000283 NM_ATT_TSC = 0x40,
284 NM_ATT_SW_CONFIG,
285 NM_ATT_SW_DESCR,
286 NM_ATT_SEVERITY,
287 NM_ATT_GET_ARI,
288 NM_ATT_HW_CONF_CHG,
289 NM_ATT_OUTST_ALARM,
290 NM_ATT_FILE_DATA,
291 NM_ATT_MEAS_RES,
292 NM_ATT_MEAS_TYPE,
293};
294
295/* Section 9.4.4: Administrative State */
296enum abis_nm_adm_state {
297 NM_STATE_LOCKED = 0x01,
298 NM_STATE_UNLOCKED = 0x02,
299 NM_STATE_SHUTDOWN = 0x03,
300 NM_STATE_NULL = 0xff,
301};
302
303/* Section 9.4.13: Channel Combination */
304enum abis_nm_chan_comb {
305 NM_CHANC_TCHFull = 0x00,
306 NM_CHANC_TCHHalf = 0x01,
307 NM_CHANC_TCHHalf2 = 0x02,
308 NM_CHANC_SDCCH = 0x03,
309 NM_CHANC_mainBCCH = 0x04,
310 NM_CHANC_BCCCHComb = 0x05,
311 NM_CHANC_BCCH = 0x06,
312 NM_CHANC_BCCH_CBCH = 0x07,
313 NM_CHANC_SDCCH_CBCH = 0x08,
314};
315
316/* Section 9.4.1 */
Harald Welte8470bf22008-12-25 23:28:35 +0000317struct abis_nm_channel {
Harald Welte52b1f982008-12-23 20:25:15 +0000318 u_int8_t attrib;
319 u_int8_t bts_port;
320 u_int8_t timeslot;
321 u_int8_t subslot;
322} __attribute__ ((packed));
323
Harald Welte47d88ae2009-01-04 12:02:08 +0000324/* Siemens BS-11 specific */
325enum abis_bs11_objtype {
326 BS11_OBJ_ALCO = 0x01,
327 BS11_OBJ_BBSIG = 0x02, /* obj_class: 0,1 */
328 BS11_OBJ_TRX1 = 0x03, /* only DEACTIVATE TRX1 */
329 BS11_OBJ_CCLK = 0x04,
330 BS11_OBJ_GPSU = 0x06,
331 BS11_OBJ_LI = 0x07,
332 BS11_OBJ_PA = 0x09, /* obj_class: 0, 1*/
333};
334
Harald Welte52b1f982008-12-23 20:25:15 +0000335/* PUBLIC */
336
337struct msgb;
338
339struct abis_nm_cfg {
340 /* callback for unidirectional reports */
341 int (*report_cb)(struct msgb *,
342 struct abis_om_fom_hdr *);
343 /* callback for software activate requests from BTS */
344 int (*sw_act_req)(struct msgb *);
345};
346
Harald Welte8470bf22008-12-25 23:28:35 +0000347extern int abis_nm_rcvmsg(struct msgb *msg);
Harald Welte52b1f982008-12-23 20:25:15 +0000348//extern struct abis_nm_h *abis_nm_init(struct abis_nm_cfg *cfg);
349//extern void abis_nm_fini(struct abis_nm_h *nmh);
350
351int abis_nm_rx(struct msgb *msg);
352int abis_nm_establish_tei(struct gsm_bts *bts, u_int8_t trx_nr,
353 u_int8_t e1_port, u_int8_t e1_timeslot, u_int8_t e1_subslot,
354 u_int8_t tei);
355int abis_nm_conn_terr_sign(struct gsm_bts_trx *trx,
356 u_int8_t e1_port, u_int8_t e1_timeslot, u_int8_t e1_subslot);
357int abis_nm_conn_terr_traf(struct gsm_bts_trx_ts *ts,
358 u_int8_t e1_port, u_int8_t e1_timeslot,
359 u_int8_t e1_subslot);
360int abis_nm_set_channel_attr(struct gsm_bts_trx_ts *ts, u_int8_t chan_comb);
361int abis_nm_raw_msg(struct gsm_bts *bts, int len, u_int8_t *msg);
362int abis_nm_event_reports(struct gsm_bts *bts, int on);
363int abis_nm_reset_resource(struct gsm_bts *bts);
Harald Welte47d88ae2009-01-04 12:02:08 +0000364
365/* Siemens / BS-11 specific */
Harald Welte05188ee2009-01-18 11:39:08 +0000366int abis_nm_bs11_db_transmission(struct gsm_bts *bts, int begin);
367int abis_nm_bs11_create_object(struct gsm_bts *bts, enum abis_bs11_objtype type,
Harald Welte47d88ae2009-01-04 12:02:08 +0000368 u_int8_t idx);
Harald Welte05188ee2009-01-18 11:39:08 +0000369int abis_nm_bs11_create_envaBTSE(struct gsm_bts *bts, u_int8_t idx);
370int abis_nm_bs11_create_bport(struct gsm_bts *bts, u_int8_t idx);
371int abis_nm_bs11_set_oml_tei(struct gsm_bts *bts, u_int8_t tei);
372int abis_nm_bs11_conn_oml(struct gsm_bts *bts, u_int8_t e1_port,
373 u_int8_t e1_timeslot, u_int8_t e1_subslot);
374int abis_nm_bs11_set_trx_power(struct gsm_bts_trx *trx, u_int8_t level);
375int abis_nm_bs11_factory_logon(struct gsm_bts *bts);
Harald Welte52b1f982008-12-23 20:25:15 +0000376
377#endif /* _NM_H */