Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 1 | #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 Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 25 | enum abis_om2k_mo_cls { |
| 26 | OM2K_MO_CLS_TRXC = 0x01, |
| 27 | OM2K_MO_CLS_TS = 0x03, |
| 28 | OM2K_MO_CLS_TF = 0x04, |
| 29 | OM2K_MO_CLS_IS = 0x05, |
| 30 | OM2K_MO_CLS_CON = 0x06, |
| 31 | OM2K_MO_CLS_DP = 0x07, |
| 32 | OM2K_MO_CLS_CF = 0x0a, |
| 33 | OM2K_MO_CLS_TX = 0x0b, |
| 34 | OM2K_MO_CLS_RX = 0x0c, |
| 35 | }; |
| 36 | |
Harald Welte | 1484d88 | 2011-03-06 22:12:24 +0100 | [diff] [blame] | 37 | enum om2k_mo_state { |
| 38 | OM2K_MO_S_RESET = 0, |
| 39 | OM2K_MO_S_STARTED, |
| 40 | OM2K_MO_S_ENABLED, |
| 41 | OM2K_MO_S_DISABLED, |
| 42 | }; |
| 43 | |
Harald Welte | d529db6 | 2011-03-06 21:49:21 +0100 | [diff] [blame] | 44 | /* on-wire format for IS conn group */ |
Harald Welte | 8bcb1a0 | 2011-02-12 20:23:40 +0100 | [diff] [blame] | 45 | struct om2k_is_conn_grp { |
| 46 | uint16_t icp1; |
| 47 | uint16_t icp2; |
| 48 | uint8_t cont_idx; |
| 49 | } __attribute__ ((packed)); |
| 50 | |
Harald Welte | d529db6 | 2011-03-06 21:49:21 +0100 | [diff] [blame] | 51 | /* internal data formant for IS conn group */ |
| 52 | struct is_conn_group { |
| 53 | struct llist_head list; |
| 54 | uint16_t icp1; |
| 55 | uint16_t icp2; |
| 56 | uint8_t ci; |
| 57 | }; |
| 58 | |
Harald Welte | eae6829 | 2016-11-11 19:41:59 +0100 | [diff] [blame] | 59 | /* on-wire format for CON Path */ |
| 60 | struct om2k_con_path { |
| 61 | uint16_t ccp; |
| 62 | uint8_t ci; |
| 63 | uint8_t tag; |
| 64 | uint8_t tei; |
| 65 | } __attribute__ ((packed)); |
| 66 | |
| 67 | /* internal data format for CON group */ |
| 68 | struct con_group { |
| 69 | /* links list of CON groups in BTS */ |
| 70 | struct llist_head list; |
| 71 | struct gsm_bts *bts; |
| 72 | /* CON Group ID */ |
| 73 | uint8_t cg; |
| 74 | /* list of CON paths in this group */ |
| 75 | struct llist_head paths; |
| 76 | }; |
| 77 | |
| 78 | /* internal data format for CON path */ |
| 79 | struct con_path { |
| 80 | /* links with con_group.paths */ |
| 81 | struct llist_head list; |
| 82 | /* CON Connection Point */ |
| 83 | uint16_t ccp; |
| 84 | /* Contiguity Index */ |
| 85 | uint8_t ci; |
| 86 | /* Tag */ |
| 87 | uint8_t tag; |
| 88 | /* TEI */ |
| 89 | uint8_t tei; |
| 90 | }; |
| 91 | |
Harald Welte | 1484d88 | 2011-03-06 22:12:24 +0100 | [diff] [blame] | 92 | extern const struct abis_om2k_mo om2k_mo_cf; |
| 93 | extern const struct abis_om2k_mo om2k_mo_is; |
| 94 | extern const struct abis_om2k_mo om2k_mo_con; |
| 95 | extern const struct abis_om2k_mo om2k_mo_tf; |
| 96 | |
Harald Welte | e1d5eca | 2011-02-12 14:42:59 +0100 | [diff] [blame] | 97 | extern const struct value_string om2k_mo_class_short_vals[]; |
| 98 | |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 99 | int abis_om2k_rcvmsg(struct msgb *msg); |
| 100 | |
Harald Welte | 7354107 | 2011-02-12 13:44:14 +0100 | [diff] [blame] | 101 | extern const struct abis_om2k_mo om2k_mo_cf; |
| 102 | |
Harald Welte | 6fec79d | 2011-02-12 14:57:17 +0100 | [diff] [blame] | 103 | int abis_om2k_tx_reset_cmd(struct gsm_bts *bts, const struct abis_om2k_mo *mo); |
| 104 | int abis_om2k_tx_start_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo); |
| 105 | int abis_om2k_tx_status_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo); |
| 106 | int abis_om2k_tx_connect_cmd(struct gsm_bts *bts, const struct abis_om2k_mo *mo); |
| 107 | int abis_om2k_tx_disconnect_cmd(struct gsm_bts *bts, const struct abis_om2k_mo *mo); |
Harald Welte | 0741ffe | 2011-02-12 18:48:53 +0100 | [diff] [blame] | 108 | int abis_om2k_tx_enable_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo); |
| 109 | int abis_om2k_tx_disable_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo); |
Harald Welte | 8024d8f | 2011-02-12 15:07:30 +0100 | [diff] [blame] | 110 | int abis_om2k_tx_test_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo); |
Harald Welte | 6fec79d | 2011-02-12 14:57:17 +0100 | [diff] [blame] | 111 | int abis_om2k_tx_op_info(struct gsm_bts *bts, const struct abis_om2k_mo *mo, |
| 112 | uint8_t operational); |
root | 4579978 | 2016-10-15 21:24:57 +0200 | [diff] [blame] | 113 | int abis_om2k_tx_cap_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo); |
Harald Welte | d529db6 | 2011-03-06 21:49:21 +0100 | [diff] [blame] | 114 | int abis_om2k_tx_is_conf_req(struct gsm_bts *bts); |
Harald Welte | f9cf961 | 2011-03-05 14:36:47 +0100 | [diff] [blame] | 115 | int abis_om2k_tx_tf_conf_req(struct gsm_bts *bts); |
Harald Welte | a0ce349 | 2011-03-05 14:13:14 +0100 | [diff] [blame] | 116 | int abis_om2k_tx_rx_conf_req(struct gsm_bts_trx *trx); |
| 117 | int abis_om2k_tx_tx_conf_req(struct gsm_bts_trx *trx); |
| 118 | int abis_om2k_tx_ts_conf_req(struct gsm_bts_trx_ts *ts); |
Harald Welte | e1d5eca | 2011-02-12 14:42:59 +0100 | [diff] [blame] | 119 | |
Harald Welte | 591e1d7 | 2016-07-09 22:20:57 +0200 | [diff] [blame] | 120 | struct osmo_fsm_inst *om2k_bts_fsm_start(struct gsm_bts *bts); |
| 121 | void abis_om2k_bts_init(struct gsm_bts *bts); |
| 122 | void abis_om2k_trx_init(struct gsm_bts_trx *trx); |
| 123 | |
Harald Welte | e1d5eca | 2011-02-12 14:42:59 +0100 | [diff] [blame] | 124 | int abis_om2k_vty_init(void); |
Harald Welte | 7354107 | 2011-02-12 13:44:14 +0100 | [diff] [blame] | 125 | |
Harald Welte | 59eee42 | 2011-02-14 16:17:49 +0100 | [diff] [blame] | 126 | struct vty; |
| 127 | void abis_om2k_config_write_bts(struct vty *vty, struct gsm_bts *bts); |
| 128 | |
Harald Welte | 9a311ec | 2011-02-12 12:33:06 +0100 | [diff] [blame] | 129 | #endif /* OPENBCS_ABIS_OM2K_H */ |