blob: 0d48c0c2fc29fd072d53a706be17d31d1c0ddf3d [file] [log] [blame]
Harald Welte9a311ec2011-02-12 12:33:06 +01001#ifndef OPENBSC_ABIS_OM2K_H
2#define OPENBSC_ABIS_OM2K_H
3/* Ericsson RBS 2xxx GSM O&M (OM2000) messages on the A-bis interface
4 * implemented based on protocol trace analysis, no formal documentation */
5
6/* (C) 2010-2011 by Harald Welte <laforge@gnumonks.org>
7 *
8 * All Rights Reserved
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Affero General Public License as published by
12 * the Free Software Foundation; either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Affero General Public License for more details.
19 *
20 * You should have received a copy of the GNU Affero General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 *
23 */
24
Harald Weltea0ce3492011-03-05 14:13:14 +010025enum abis_om2k_mo_cls {
26 OM2K_MO_CLS_TRXC = 0x01,
Sylvain Munaut63d76612020-04-28 09:29:14 +020027 OM2K_MO_CLS_TG = 0x02,
Harald Weltea0ce3492011-03-05 14:13:14 +010028 OM2K_MO_CLS_TS = 0x03,
29 OM2K_MO_CLS_TF = 0x04,
30 OM2K_MO_CLS_IS = 0x05,
31 OM2K_MO_CLS_CON = 0x06,
32 OM2K_MO_CLS_DP = 0x07,
Harald Welte2fa97632020-01-29 09:19:45 +010033 OM2K_MO_CLS_MCTR = 0x08,
Harald Weltea0ce3492011-03-05 14:13:14 +010034 OM2K_MO_CLS_CF = 0x0a,
35 OM2K_MO_CLS_TX = 0x0b,
36 OM2K_MO_CLS_RX = 0x0c,
37};
38
Harald Welte1484d882011-03-06 22:12:24 +010039enum om2k_mo_state {
40 OM2K_MO_S_RESET = 0,
41 OM2K_MO_S_STARTED,
42 OM2K_MO_S_ENABLED,
43 OM2K_MO_S_DISABLED,
44};
45
Harald Welted529db62011-03-06 21:49:21 +010046/* on-wire format for IS conn group */
Harald Welte8bcb1a02011-02-12 20:23:40 +010047struct om2k_is_conn_grp {
48 uint16_t icp1;
49 uint16_t icp2;
50 uint8_t cont_idx;
51} __attribute__ ((packed));
52
Harald Welted529db62011-03-06 21:49:21 +010053/* internal data formant for IS conn group */
54struct is_conn_group {
55 struct llist_head list;
56 uint16_t icp1;
57 uint16_t icp2;
58 uint8_t ci;
59};
60
Harald Welteeae68292016-11-11 19:41:59 +010061/* on-wire format for CON Path */
62struct om2k_con_path {
63 uint16_t ccp;
64 uint8_t ci;
65 uint8_t tag;
66 uint8_t tei;
67} __attribute__ ((packed));
68
69/* internal data format for CON group */
70struct con_group {
71 /* links list of CON groups in BTS */
72 struct llist_head list;
73 struct gsm_bts *bts;
74 /* CON Group ID */
75 uint8_t cg;
76 /* list of CON paths in this group */
77 struct llist_head paths;
78};
79
80/* internal data format for CON path */
81struct con_path {
82 /* links with con_group.paths */
83 struct llist_head list;
84 /* CON Connection Point */
85 uint16_t ccp;
86 /* Contiguity Index */
87 uint8_t ci;
88 /* Tag */
89 uint8_t tag;
90 /* TEI */
91 uint8_t tei;
92};
93
Harald Welte1484d882011-03-06 22:12:24 +010094extern const struct abis_om2k_mo om2k_mo_cf;
95extern const struct abis_om2k_mo om2k_mo_is;
96extern const struct abis_om2k_mo om2k_mo_con;
97extern const struct abis_om2k_mo om2k_mo_tf;
98
Harald Weltee1d5eca2011-02-12 14:42:59 +010099extern const struct value_string om2k_mo_class_short_vals[];
100
Harald Welte9a311ec2011-02-12 12:33:06 +0100101int abis_om2k_rcvmsg(struct msgb *msg);
102
Harald Welte73541072011-02-12 13:44:14 +0100103extern const struct abis_om2k_mo om2k_mo_cf;
104
Harald Welte6fec79d2011-02-12 14:57:17 +0100105int abis_om2k_tx_reset_cmd(struct gsm_bts *bts, const struct abis_om2k_mo *mo);
106int abis_om2k_tx_start_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo);
107int abis_om2k_tx_status_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo);
108int abis_om2k_tx_connect_cmd(struct gsm_bts *bts, const struct abis_om2k_mo *mo);
109int abis_om2k_tx_disconnect_cmd(struct gsm_bts *bts, const struct abis_om2k_mo *mo);
Harald Welte0741ffe2011-02-12 18:48:53 +0100110int abis_om2k_tx_enable_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo);
111int abis_om2k_tx_disable_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo);
Harald Welte8024d8f2011-02-12 15:07:30 +0100112int abis_om2k_tx_test_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo);
Harald Welte6fec79d2011-02-12 14:57:17 +0100113int abis_om2k_tx_op_info(struct gsm_bts *bts, const struct abis_om2k_mo *mo,
114 uint8_t operational);
root45799782016-10-15 21:24:57 +0200115int abis_om2k_tx_cap_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo);
Sylvain Munaute55e76f2020-04-28 09:30:52 +0200116int abis_om2k_tx_arb(struct gsm_bts *bts, struct abis_om2k_mo *mo, uint16_t req, uint8_t *buf, int buf_len);
Harald Welted529db62011-03-06 21:49:21 +0100117int abis_om2k_tx_is_conf_req(struct gsm_bts *bts);
Sylvain Munautd9fe61c2020-04-28 09:30:28 +0200118int abis_om2k_tx_con_conf_req(struct gsm_bts *bts);
Harald Weltef9cf9612011-03-05 14:36:47 +0100119int abis_om2k_tx_tf_conf_req(struct gsm_bts *bts);
Harald Weltea0ce3492011-03-05 14:13:14 +0100120int abis_om2k_tx_rx_conf_req(struct gsm_bts_trx *trx);
121int abis_om2k_tx_tx_conf_req(struct gsm_bts_trx *trx);
122int abis_om2k_tx_ts_conf_req(struct gsm_bts_trx_ts *ts);
Harald Weltee1d5eca2011-02-12 14:42:59 +0100123
Harald Welte591e1d72016-07-09 22:20:57 +0200124struct osmo_fsm_inst *om2k_bts_fsm_start(struct gsm_bts *bts);
125void abis_om2k_bts_init(struct gsm_bts *bts);
126void abis_om2k_trx_init(struct gsm_bts_trx *trx);
127
Harald Weltee1d5eca2011-02-12 14:42:59 +0100128int abis_om2k_vty_init(void);
Harald Welte73541072011-02-12 13:44:14 +0100129
Harald Welte59eee422011-02-14 16:17:49 +0100130struct vty;
131void abis_om2k_config_write_bts(struct vty *vty, struct gsm_bts *bts);
132
Harald Welte9a311ec2011-02-12 12:33:06 +0100133#endif /* OPENBCS_ABIS_OM2K_H */