aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/osmo-bts/abis.h1
-rw-r--r--src/common/abis.c23
-rw-r--r--src/osmo-bts-sysmo/main.c2
3 files changed, 14 insertions, 12 deletions
diff --git a/include/osmo-bts/abis.h b/include/osmo-bts/abis.h
index fb0fbd7..8c055d7 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 fa1a565..da03402 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 921103e..20cfe9c 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",