diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-05-15 13:00:30 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-05-15 14:18:26 +0200 |
commit | d75c648871d1cae1d2cf4f74f60eaf07fb97ba73 (patch) | |
tree | 50b849d910083c824db4f6d18c7e98dcc00682d3 | |
parent | 8b5b993d29f751bf66fa9deabbe900fd9e193637 (diff) |
abis: Separate initialization from connect for Abis
Initialize the libosmo-abis VTY nodes more early so we can parse
the config file that was created by "write". Introduce abis_init
to initialize the libosmo-abis and modify abis_open to re-use an
existing line. Update the comments. This has only been tried with
the sysmobts-remote on x86. A TCP connection is opened toward the
configured BSC.
Fixes: SYS#285
-rw-r--r-- | include/osmo-bts/abis.h | 1 | ||||
-rw-r--r-- | src/common/abis.c | 23 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/main.c | 2 |
3 files changed, 14 insertions, 12 deletions
diff --git a/include/osmo-bts/abis.h b/include/osmo-bts/abis.h index fb0fbd76..8c055d71 100644 --- a/include/osmo-bts/abis.h +++ b/include/osmo-bts/abis.h @@ -16,6 +16,7 @@ enum { LINK_STATE_CONNECT, }; +void abis_init(struct gsm_bts *bts); struct e1inp_line *abis_open(struct gsm_bts *bts, const char *dst_host, const char *model_name); diff --git a/src/common/abis.c b/src/common/abis.c index fa1a565f..da03402b 100644 --- a/src/common/abis.c +++ b/src/common/abis.c @@ -222,14 +222,8 @@ static struct e1inp_line_ops line_ops = { .sign_link = sign_link_cb, }; -/* UGLY: we assume this function is only called once as it does some - * global initialization as well as the actual opening of the A-bis link - * */ -struct e1inp_line *abis_open(struct gsm_bts *bts, const char *dst_host, - const char *model_name) +void abis_init(struct gsm_bts *bts) { - struct e1inp_line *line; - g_bts = bts; oml_init(); @@ -237,6 +231,12 @@ struct e1inp_line *abis_open(struct gsm_bts *bts, const char *dst_host, libosmo_abis_init(NULL); osmo_signal_register_handler(SS_L_INPUT, &inp_s_cbfn, bts); +} + +struct e1inp_line *abis_open(struct gsm_bts *bts, const char *dst_host, + const char *model_name) +{ + struct e1inp_line *line; /* patch in various data from VTY and othe sources */ line_ops.cfg.ipa.addr = dst_host; @@ -248,15 +248,14 @@ struct e1inp_line *abis_open(struct gsm_bts *bts, const char *dst_host, bts_dev_info.unit_name = bts->description; bts_dev_info.location2 = model_name; - line = e1inp_line_create(0, "ipa"); + line = e1inp_line_find(0); + if (!line) + line = e1inp_line_create(0, "ipa"); if (!line) return NULL; e1inp_line_bind_ops(line, &line_ops); - /* This is what currently starts both the outbound OML and RSL - * connections, which is wrong. - * FIXME: It should only start OML and wait for the RLS IP - * address to be set as part of the TRX attributes */ + /* This will open the OML connection now */ if (e1inp_line_update(line) < 0) return NULL; diff --git a/src/osmo-bts-sysmo/main.c b/src/osmo-bts-sysmo/main.c index 921103e6..20cfe9c6 100644 --- a/src/osmo-bts-sysmo/main.c +++ b/src/osmo-bts-sysmo/main.c @@ -328,6 +328,8 @@ int main(int argc, char **argv) btsb = bts_role_bts(bts); btsb->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3); + abis_init(bts); + rc = vty_read_config_file(config_file, NULL); if (rc < 0) { fprintf(stderr, "Failed to parse the config file: '%s'\n", |