2008-12-23 20:25:15 +00:00
|
|
|
/* GSM Network Management messages on the A-bis interface
|
|
|
|
* 3GPP TS 12.21 version 8.0.0 Release 1999 / ETSI TS 100 623 V8.0.0 */
|
|
|
|
|
2009-01-18 18:01:49 +00:00
|
|
|
/* (C) 2008-2009 by Harald Welte <laforge@gnumonks.org>
|
2008-12-23 20:25:15 +00:00
|
|
|
* All Rights Reserved
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
2011-01-01 14:25:50 +00:00
|
|
|
* it under the terms of the GNU Affero General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2008-12-23 20:25:15 +00:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2011-01-01 14:25:50 +00:00
|
|
|
* GNU Affero General Public License for more details.
|
2008-12-23 20:25:15 +00:00
|
|
|
*
|
2011-01-01 14:25:50 +00:00
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2008-12-23 20:25:15 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _NM_H
|
|
|
|
#define _NM_H
|
|
|
|
|
2011-03-22 15:47:59 +00:00
|
|
|
#include <osmocom/gsm/tlv.h>
|
2011-06-05 09:24:08 +00:00
|
|
|
#include <osmocom/gsm/abis_nm.h>
|
2011-03-22 15:47:59 +00:00
|
|
|
#include <osmocom/gsm/protocol/gsm_12_21.h>
|
2009-11-12 13:48:42 +00:00
|
|
|
|
2009-11-13 10:56:05 +00:00
|
|
|
struct cell_global_id {
|
2011-04-18 15:04:00 +00:00
|
|
|
uint16_t mcc;
|
|
|
|
uint16_t mnc;
|
|
|
|
uint16_t lac;
|
|
|
|
uint16_t ci;
|
2009-11-13 10:56:05 +00:00
|
|
|
};
|
|
|
|
|
2009-11-12 13:48:42 +00:00
|
|
|
/* The BCCH info from an ip.access test, in host byte order
|
|
|
|
* and already parsed... */
|
|
|
|
struct ipac_bcch_info {
|
2009-11-13 10:56:05 +00:00
|
|
|
struct llist_head list;
|
|
|
|
|
2011-04-18 15:04:00 +00:00
|
|
|
uint16_t info_type;
|
|
|
|
uint8_t freq_qual;
|
|
|
|
uint16_t arfcn;
|
|
|
|
uint8_t rx_lev;
|
|
|
|
uint8_t rx_qual;
|
2009-11-13 13:41:52 +00:00
|
|
|
int16_t freq_err;
|
2011-04-18 15:04:00 +00:00
|
|
|
uint16_t frame_offset;
|
|
|
|
uint32_t frame_nr_offset;
|
|
|
|
uint8_t bsic;
|
2009-11-13 10:56:05 +00:00
|
|
|
struct cell_global_id cgi;
|
2011-04-18 15:04:00 +00:00
|
|
|
uint8_t ba_list_si2[16];
|
|
|
|
uint8_t ba_list_si2bis[16];
|
|
|
|
uint8_t ba_list_si2ter[16];
|
|
|
|
uint8_t ca_list_si1[16];
|
2009-11-12 13:48:42 +00:00
|
|
|
};
|
|
|
|
|
2008-12-23 20:25:15 +00:00
|
|
|
/* PUBLIC */
|
|
|
|
|
|
|
|
struct msgb;
|
|
|
|
|
|
|
|
struct abis_nm_cfg {
|
|
|
|
/* callback for unidirectional reports */
|
|
|
|
int (*report_cb)(struct msgb *,
|
|
|
|
struct abis_om_fom_hdr *);
|
|
|
|
/* callback for software activate requests from BTS */
|
|
|
|
int (*sw_act_req)(struct msgb *);
|
|
|
|
};
|
|
|
|
|
2012-11-22 13:59:46 +00:00
|
|
|
struct abis_nm_sw_descr {
|
|
|
|
/* where does it start? how long is it? */
|
|
|
|
const uint8_t *start;
|
|
|
|
size_t len;
|
|
|
|
|
|
|
|
/* the parsed data */
|
|
|
|
const uint8_t *file_id;
|
|
|
|
uint16_t file_id_len;
|
|
|
|
const uint8_t *file_ver;
|
|
|
|
uint16_t file_ver_len;
|
|
|
|
};
|
|
|
|
|
2008-12-25 23:28:35 +00:00
|
|
|
extern int abis_nm_rcvmsg(struct msgb *msg);
|
2008-12-23 20:25:15 +00:00
|
|
|
|
2011-04-18 15:04:00 +00:00
|
|
|
int abis_nm_tlv_parse(struct tlv_parsed *tp, struct gsm_bts *bts, const uint8_t *buf, int len);
|
2008-12-23 20:25:15 +00:00
|
|
|
int abis_nm_rx(struct msgb *msg);
|
2011-04-18 15:04:00 +00:00
|
|
|
int abis_nm_opstart(struct gsm_bts *bts, uint8_t obj_class, uint8_t i0, uint8_t i1, uint8_t i2);
|
|
|
|
int abis_nm_chg_adm_state(struct gsm_bts *bts, uint8_t obj_class, uint8_t i0,
|
|
|
|
uint8_t i1, uint8_t i2, enum abis_nm_adm_state adm_state);
|
|
|
|
int abis_nm_establish_tei(struct gsm_bts *bts, uint8_t trx_nr,
|
|
|
|
uint8_t e1_port, uint8_t e1_timeslot, uint8_t e1_subslot,
|
|
|
|
uint8_t tei);
|
2008-12-23 20:25:15 +00:00
|
|
|
int abis_nm_conn_terr_sign(struct gsm_bts_trx *trx,
|
2011-04-18 15:04:00 +00:00
|
|
|
uint8_t e1_port, uint8_t e1_timeslot, uint8_t e1_subslot);
|
2008-12-23 20:25:15 +00:00
|
|
|
int abis_nm_conn_terr_traf(struct gsm_bts_trx_ts *ts,
|
2011-04-18 15:04:00 +00:00
|
|
|
uint8_t e1_port, uint8_t e1_timeslot,
|
|
|
|
uint8_t e1_subslot);
|
2012-08-14 17:15:57 +00:00
|
|
|
int abis_nm_get_attr(struct gsm_bts *bts, uint8_t obj_class,
|
|
|
|
uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr,
|
|
|
|
uint8_t *attr, uint8_t attr_len);
|
2011-04-18 15:04:00 +00:00
|
|
|
int abis_nm_set_bts_attr(struct gsm_bts *bts, uint8_t *attr, int attr_len);
|
|
|
|
int abis_nm_set_radio_attr(struct gsm_bts_trx *trx, uint8_t *attr, int attr_len);
|
|
|
|
int abis_nm_set_channel_attr(struct gsm_bts_trx_ts *ts, uint8_t chan_comb);
|
|
|
|
int abis_nm_sw_act_req_ack(struct gsm_bts *bts, uint8_t obj_class, uint8_t i1,
|
|
|
|
uint8_t i2, uint8_t i3, int nack, uint8_t *attr, int att_len);
|
|
|
|
int abis_nm_raw_msg(struct gsm_bts *bts, int len, uint8_t *msg);
|
2008-12-23 20:25:15 +00:00
|
|
|
int abis_nm_event_reports(struct gsm_bts *bts, int on);
|
|
|
|
int abis_nm_reset_resource(struct gsm_bts *bts);
|
2010-05-12 15:51:46 +00:00
|
|
|
int abis_nm_software_load(struct gsm_bts *bts, int trx_nr, const char *fname,
|
2011-04-18 15:04:00 +00:00
|
|
|
uint8_t win_size, int forced,
|
2009-02-01 22:15:49 +00:00
|
|
|
gsm_cbfn *cbfn, void *cb_data);
|
|
|
|
int abis_nm_software_load_status(struct gsm_bts *bts);
|
2009-02-01 13:36:56 +00:00
|
|
|
int abis_nm_software_activate(struct gsm_bts *bts, const char *fname,
|
|
|
|
gsm_cbfn *cbfn, void *cb_data);
|
2009-01-04 12:02:08 +00:00
|
|
|
|
2011-04-18 15:04:00 +00:00
|
|
|
int abis_nm_conn_mdrop_link(struct gsm_bts *bts, uint8_t e1_port0, uint8_t ts0,
|
|
|
|
uint8_t e1_port1, uint8_t ts1);
|
2009-08-06 15:58:31 +00:00
|
|
|
|
2011-04-18 15:04:00 +00:00
|
|
|
int abis_nm_perform_test(struct gsm_bts *bts, uint8_t obj_class,
|
|
|
|
uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr,
|
|
|
|
uint8_t test_nr, uint8_t auton_report, struct msgb *msg);
|
implement nanoBTS frequency error test
This helps us to detect the frequency error of BS-11 if it is located
next to the nanoBTS 900.
If 'ipaccess-config -l' is called, it will produce a report like
<0020> ipaccess-config.c:85 TEST REPORT: test_no=0x42 test_res=0
<0020> ipaccess-config.c:108 ==> ARFCN 220, Frequency Error 22
<0020> ipaccess-config.c:108 ==> ARFCN 1, Frequency Error -37
<0020> ipaccess-config.c:108 ==> ARFCN 10, Frequency Error 0
<0020> ipaccess-config.c:108 ==> ARFCN 20, Frequency Error 11
<0020> ipaccess-config.c:108 ==> ARFCN 53, Frequency Error 5
<0020> ipaccess-config.c:108 ==> ARFCN 63, Frequency Error -4
<0020> ipaccess-config.c:108 ==> ARFCN 84, Frequency Error 11
<0020> ipaccess-config.c:108 ==> ARFCN 101, Frequency Error 0
<0020> ipaccess-config.c:108 ==> ARFCN 123, Frequency Error -52
where in this case the ARFCN 123 is the BS-11 with a frequency error
larger than all the other (regular) BTS in the vicinity.
2009-08-07 22:02:36 +00:00
|
|
|
|
2009-01-04 12:02:08 +00:00
|
|
|
/* Siemens / BS-11 specific */
|
2009-01-27 19:00:44 +00:00
|
|
|
int abis_nm_bs11_reset_resource(struct gsm_bts *bts);
|
2009-01-18 11:39:08 +00:00
|
|
|
int abis_nm_bs11_db_transmission(struct gsm_bts *bts, int begin);
|
|
|
|
int abis_nm_bs11_create_object(struct gsm_bts *bts, enum abis_bs11_objtype type,
|
2011-04-18 15:04:00 +00:00
|
|
|
uint8_t idx, uint8_t attr_len, const uint8_t *attr);
|
|
|
|
int abis_nm_bs11_create_envaBTSE(struct gsm_bts *bts, uint8_t idx);
|
|
|
|
int abis_nm_bs11_create_bport(struct gsm_bts *bts, uint8_t idx);
|
2009-02-19 02:50:57 +00:00
|
|
|
int abis_nm_bs11_delete_object(struct gsm_bts *bts,
|
2011-04-18 15:04:00 +00:00
|
|
|
enum abis_bs11_objtype type, uint8_t idx);
|
|
|
|
int abis_nm_bs11_delete_bport(struct gsm_bts *bts, uint8_t idx);
|
|
|
|
int abis_nm_bs11_conn_oml_tei(struct gsm_bts *bts, uint8_t e1_port,
|
|
|
|
uint8_t e1_timeslot, uint8_t e1_subslot, uint8_t tei);
|
2009-02-19 02:50:57 +00:00
|
|
|
int abis_nm_bs11_get_oml_tei_ts(struct gsm_bts *bts);
|
|
|
|
int abis_nm_bs11_get_serno(struct gsm_bts *bts);
|
2011-04-18 15:04:00 +00:00
|
|
|
int abis_nm_bs11_set_trx_power(struct gsm_bts_trx *trx, uint8_t level);
|
2009-02-19 02:50:57 +00:00
|
|
|
int abis_nm_bs11_get_trx_power(struct gsm_bts_trx *trx);
|
2011-04-18 15:04:00 +00:00
|
|
|
int abis_nm_bs11_logon(struct gsm_bts *bts, uint8_t level, const char *name, int on);
|
2009-01-18 14:17:52 +00:00
|
|
|
int abis_nm_bs11_factory_logon(struct gsm_bts *bts, int on);
|
2010-01-06 23:46:26 +00:00
|
|
|
int abis_nm_bs11_infield_logon(struct gsm_bts *bts, int on);
|
2009-01-18 14:17:52 +00:00
|
|
|
int abis_nm_bs11_set_trx1_pw(struct gsm_bts *bts, const char *password);
|
2009-04-28 16:31:38 +00:00
|
|
|
int abis_nm_bs11_set_pll_locked(struct gsm_bts *bts, int locked);
|
2009-05-17 12:43:42 +00:00
|
|
|
int abis_nm_bs11_get_pll_mode(struct gsm_bts *bts);
|
2010-01-06 23:54:01 +00:00
|
|
|
int abis_nm_bs11_set_pll(struct gsm_bts *bts, int value);
|
2009-05-17 12:43:42 +00:00
|
|
|
int abis_nm_bs11_get_cclk(struct gsm_bts *bts);
|
2009-01-18 14:17:52 +00:00
|
|
|
int abis_nm_bs11_get_state(struct gsm_bts *bts);
|
2009-02-01 13:36:56 +00:00
|
|
|
int abis_nm_bs11_load_swl(struct gsm_bts *bts, const char *fname,
|
2011-04-18 15:04:00 +00:00
|
|
|
uint8_t win_size, int forced, gsm_cbfn *cbfn);
|
2009-02-01 19:11:56 +00:00
|
|
|
int abis_nm_bs11_set_ext_time(struct gsm_bts *bts);
|
2011-04-18 15:04:00 +00:00
|
|
|
int abis_nm_bs11_get_bport_line_cfg(struct gsm_bts *bts, uint8_t bport);
|
|
|
|
int abis_nm_bs11_set_bport_line_cfg(struct gsm_bts *bts, uint8_t bport, enum abis_bs11_line_cfg line_cfg);
|
2009-02-01 22:15:49 +00:00
|
|
|
int abis_nm_bs11_bsc_disconnect(struct gsm_bts *bts, int reconnect);
|
2009-02-09 18:13:26 +00:00
|
|
|
int abis_nm_bs11_restart(struct gsm_bts *bts);
|
2008-12-23 20:25:15 +00:00
|
|
|
|
2009-02-15 11:57:29 +00:00
|
|
|
/* ip.access nanoBTS specific commands */
|
2011-04-18 15:04:00 +00:00
|
|
|
int abis_nm_ipaccess_msg(struct gsm_bts *bts, uint8_t msg_type,
|
|
|
|
uint8_t obj_class, uint8_t bts_nr,
|
|
|
|
uint8_t trx_nr, uint8_t ts_nr,
|
|
|
|
uint8_t *attr, int attr_len);
|
|
|
|
int abis_nm_ipaccess_set_nvattr(struct gsm_bts_trx *trx, uint8_t *attr,
|
2009-04-30 15:16:27 +00:00
|
|
|
int attr_len);
|
2010-05-12 15:34:51 +00:00
|
|
|
int abis_nm_ipaccess_restart(struct gsm_bts_trx *trx);
|
2011-04-18 15:04:00 +00:00
|
|
|
int abis_nm_ipaccess_set_attr(struct gsm_bts *bts, uint8_t obj_class,
|
|
|
|
uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr,
|
|
|
|
uint8_t *attr, uint8_t attr_len);
|
2009-10-19 20:11:11 +00:00
|
|
|
int abis_nm_ipaccess_rsl_connect(struct gsm_bts_trx *trx,
|
2011-04-18 15:04:00 +00:00
|
|
|
uint32_t ip, uint16_t port, uint8_t stream);
|
|
|
|
void abis_nm_ipaccess_cgi(uint8_t *buf, struct gsm_bts *bts);
|
|
|
|
int ipac_parse_bcch_info(struct ipac_bcch_info *binf, uint8_t *buf);
|
|
|
|
const char *ipacc_testres_name(uint8_t res);
|
2009-02-15 11:57:29 +00:00
|
|
|
|
2009-02-15 03:34:15 +00:00
|
|
|
/* Functions calling into other code parts */
|
2010-01-02 15:32:17 +00:00
|
|
|
int nm_is_running(struct gsm_nm_state *s);
|
2010-05-31 14:40:40 +00:00
|
|
|
|
|
|
|
int abis_nm_vty_init(void);
|
|
|
|
|
2010-11-15 19:50:42 +00:00
|
|
|
void abis_nm_clear_queue(struct gsm_bts *bts);
|
|
|
|
|
2011-09-26 21:43:23 +00:00
|
|
|
int _abis_nm_sendmsg(struct msgb *msg);
|
src: port openBSC over libosmo-abis
This is a big patch that ports openBSC over libosmo-abis.
Sorry, the changes that are included here are all dependent
of libosmo-abis, splitting them into smaller pieces would
leave the repository in some intermediate state, which is
not desired.
The main changes are:
- The directory libabis/ has been removed as it now lives in
libosmo-abis.
- new configuration file format for nanoBTS and HSL femto, we
need to define the virtual e1_line and attach it to the OML
link.
- all the existing BTS drivers (nanoBTS, hsl femto, Nokia site,
BS11 and rbs2000) now use the new libosmo-abis framework.
- use r232 input driver available in libosmo-abis for bs11_config.
- use ipa_msg_recv instead of old ipaccess_read_msg function.
- delete definition of gsm_e1_subslot and input_signal_data.
These structures now lives in libosmo-abis.
Most of this patch are deletions of libabis/ which has been
moved to libosmo-abis.
This patch also modifies openBSC to use all the new definitions
available in libosmocore and libosmo-abis. In order to do that,
we have replaced the following:
- DINP, DMI, DMIB and DMUX by their respective DL* correspondences.
- SS_GLOBAL by SS_L_GLOBAL
- SS_INPUT by SS_L_INPUT
- S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN
- SS_INPUT by SS_L_INPUT
- S_INP_* by S_L_INP_* sub-signals
- E1INP_NODE by L_E1INP_NODE vty node
This patch has been tested with:
- one nanoBTS
- the HSL femto with the examples available under libosmo-abis
- BS11 with both dahdi and misdn drivers.
2011-08-17 20:44:07 +00:00
|
|
|
|
|
|
|
void abis_nm_queue_send_next(struct gsm_bts *bts); /* for bs11_config. */
|
2010-11-15 19:50:42 +00:00
|
|
|
|
2012-11-22 13:59:46 +00:00
|
|
|
int abis_nm_parse_sw_config(const uint8_t *data, const size_t len,
|
|
|
|
struct abis_nm_sw_descr *res, const int res_len);
|
2012-11-22 18:04:10 +00:00
|
|
|
int abis_nm_select_newest_sw(const struct abis_nm_sw_descr *sw, const size_t len);
|
2012-11-22 13:59:46 +00:00
|
|
|
|
2014-03-26 13:24:42 +00:00
|
|
|
/* Helper functions for updating attributes */
|
|
|
|
int abis_nm_update_max_power_red(struct gsm_bts_trx *trx);
|
|
|
|
|
2008-12-23 20:25:15 +00:00
|
|
|
#endif /* _NM_H */
|