blob: f0bb33cdc801114ae0a1a8dca860da48663d005a [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
30/* generic header in front of every OML message */
31struct 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,
153 NM_MT_SET_SITE_OUT,
154 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,
171};
172
173/* Section 9.2: Object Class */
174enum abis_nm_obj_class {
175 NM_OC_SITE_MANAGER = 0x00,
176 NM_OC_BTS,
177 NM_OC_RADIO_CARRIER,
178 NM_OC_BASEB_TRANSC,
179 NM_OC_CHANNEL,
180 /* RFU: 05-FE */
181 NM_OC_NULL = 0xff,
182};
183
184/* Section 9.4: Attributes */
185enum abis_nm_attr {
186 NM_ATT_CHANNEL = 0x01,
187 NM_ATT_ADD_INFO,
188 NM_ATT_ADD_TEXT,
189 NM_ATT_ADM_STATE,
190 NM_ATT_ARFCN_LIST,
191 NM_ATT_AUTON_REPORT,
192 NM_ATT_AVAIL_STATUS,
193 NM_ATT_BCCH_ARFCN,
194 NM_ATT_BSIC,
195 NM_ATT_BTS_AIR_TIMER,
196 NM_ATT_CCCH_L_I_P,
197 NM_ATT_CCCH_L_T,
198 NM_ATT_CHAN_COMB,
199 NM_ATT_CONN_FAIL_CRIT,
200 NM_ATT_DEST,
201 /* res */
202 NM_ATT_EVENT_TYPE = 0x11,
203 NM_ATT_FILE_ID,
204 NM_ATT_FILE_VERSION,
205 NM_ATT_GSM_TIME,
206 NM_ATT_HSN,
207 NM_ATT_HW_CONFIG,
208 NM_ATT_HW_DESC,
209 NM_ATT_INTAVE_PARAM,
210 NM_ATT_INTERF_BOUND,
211 NM_ATT_LIST_REQ_ATTR,
212 NM_ATT_MAIO,
213 NM_ATT_MANUF_STATE,
214 NM_ATT_MANUF_THRESH,
215 NM_ATT_MANUF_ID,
216 NM_ATT_MAX_TA,
217 NM_ATT_MDROP_LINK, /* 0x20 */
218 NM_ATT_MDROP_NEXT,
219 NM_ATT_NACK_CAUSES,
220 NM_ATT_NY1,
221 NM_ATT_OPER_STATE,
222 NM_ATT_OVERL_PERIOD,
223 NM_ATT_PHYS_CONF,
224 NM_ATT_POWER_CLASS,
225 NM_ATT_POWER_THRESH,
226 NM_ATT_PROB_CAUSE,
227 NM_ATT_RACH_B_THRESH,
228 NM_ATT_LDAVG_SLOTS,
229 NM_ATT_RAD_SUBC,
230 NM_ATT_RF_MAXPOWR_R,
231 NM_ATT_SITE_INPUTS,
232 NM_ATT_SITE_OUTPUTS,
233 NM_ATT_SOURCE, /* 0x30 */
234 NM_ATT_SPEC_PROB,
235 NM_ATT_START_TIME,
236 NM_ATT_T200,
237 NM_ATT_TEI,
238 NM_ATT_TEST_DUR,
239 NM_ATT_TEST_NO,
240 NM_ATT_TEST_REPORT,
241 NM_ATT_VSWR_THRESH,
242 NM_ATT_WINDOW_SIZE,
243 /* Res */
244 NM_ATT_TSC = 0x40,
245 NM_ATT_SW_CONFIG,
246 NM_ATT_SW_DESCR,
247 NM_ATT_SEVERITY,
248 NM_ATT_GET_ARI,
249 NM_ATT_HW_CONF_CHG,
250 NM_ATT_OUTST_ALARM,
251 NM_ATT_FILE_DATA,
252 NM_ATT_MEAS_RES,
253 NM_ATT_MEAS_TYPE,
254};
255
256/* Section 9.4.4: Administrative State */
257enum abis_nm_adm_state {
258 NM_STATE_LOCKED = 0x01,
259 NM_STATE_UNLOCKED = 0x02,
260 NM_STATE_SHUTDOWN = 0x03,
261 NM_STATE_NULL = 0xff,
262};
263
264/* Section 9.4.13: Channel Combination */
265enum abis_nm_chan_comb {
266 NM_CHANC_TCHFull = 0x00,
267 NM_CHANC_TCHHalf = 0x01,
268 NM_CHANC_TCHHalf2 = 0x02,
269 NM_CHANC_SDCCH = 0x03,
270 NM_CHANC_mainBCCH = 0x04,
271 NM_CHANC_BCCCHComb = 0x05,
272 NM_CHANC_BCCH = 0x06,
273 NM_CHANC_BCCH_CBCH = 0x07,
274 NM_CHANC_SDCCH_CBCH = 0x08,
275};
276
277/* Section 9.4.1 */
Harald Welte8470bf22008-12-25 23:28:35 +0000278struct abis_nm_channel {
Harald Welte52b1f982008-12-23 20:25:15 +0000279 u_int8_t attrib;
280 u_int8_t bts_port;
281 u_int8_t timeslot;
282 u_int8_t subslot;
283} __attribute__ ((packed));
284
285/* PUBLIC */
286
287struct msgb;
288
289struct abis_nm_cfg {
290 /* callback for unidirectional reports */
291 int (*report_cb)(struct msgb *,
292 struct abis_om_fom_hdr *);
293 /* callback for software activate requests from BTS */
294 int (*sw_act_req)(struct msgb *);
295};
296
Harald Welte8470bf22008-12-25 23:28:35 +0000297extern int abis_nm_rcvmsg(struct msgb *msg);
Harald Welte52b1f982008-12-23 20:25:15 +0000298//extern struct abis_nm_h *abis_nm_init(struct abis_nm_cfg *cfg);
299//extern void abis_nm_fini(struct abis_nm_h *nmh);
300
301int abis_nm_rx(struct msgb *msg);
302int abis_nm_establish_tei(struct gsm_bts *bts, u_int8_t trx_nr,
303 u_int8_t e1_port, u_int8_t e1_timeslot, u_int8_t e1_subslot,
304 u_int8_t tei);
305int abis_nm_conn_terr_sign(struct gsm_bts_trx *trx,
306 u_int8_t e1_port, u_int8_t e1_timeslot, u_int8_t e1_subslot);
307int abis_nm_conn_terr_traf(struct gsm_bts_trx_ts *ts,
308 u_int8_t e1_port, u_int8_t e1_timeslot,
309 u_int8_t e1_subslot);
310int abis_nm_set_channel_attr(struct gsm_bts_trx_ts *ts, u_int8_t chan_comb);
311int abis_nm_raw_msg(struct gsm_bts *bts, int len, u_int8_t *msg);
312int abis_nm_event_reports(struct gsm_bts *bts, int on);
313int abis_nm_reset_resource(struct gsm_bts *bts);
Harald Welte3633a6d2008-12-26 00:06:02 +0000314int abis_nm_db_transmission(struct gsm_bts *bts, int begin);
Harald Welte52b1f982008-12-23 20:25:15 +0000315
316#endif /* _NM_H */