aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-02-05 16:47:57 +0100
committerHarald Welte <laforge@gnumonks.org>2015-09-22 16:41:25 +0200
commit7a0d11dd68528d96afff61083c3cf90a50af11bb (patch)
treef026dcdae8b564b6e0d197e7822b5a11a99dcc9a
parentcd0581d815f76dd159406a2e797ad554df82c761 (diff)
ABIS: Introduce bts_model_abis_close to indicate ABIS link failure.
sysmocom-bts model shuts down on link loss, but other models may not want this, so shutdown is moved tor bts_model_abis_close of osmo-bts-sysmo.
-rw-r--r--include/osmo-bts/bts_model.h2
-rw-r--r--src/common/abis.c3
-rw-r--r--src/common/bts.c2
-rw-r--r--src/osmo-bts-sysmo/main.c6
-rw-r--r--src/osmo-bts-trx/main.c3
-rw-r--r--tests/stubs.c3
-rw-r--r--tests/sysmobts/sysmobts_test.c2
7 files changed, 20 insertions, 1 deletions
diff --git a/include/osmo-bts/bts_model.h b/include/osmo-bts/bts_model.h
index de846365..ecbfc3d3 100644
--- a/include/osmo-bts/bts_model.h
+++ b/include/osmo-bts/bts_model.h
@@ -40,4 +40,6 @@ int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan);
int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap);
+void bts_model_abis_close(struct gsm_bts *bts);
+
#endif
diff --git a/src/common/abis.c b/src/common/abis.c
index 3b9bcdd2..3b8a7af1 100644
--- a/src/common/abis.c
+++ b/src/common/abis.c
@@ -47,6 +47,7 @@
#include <osmo-bts/bts.h>
#include <osmo-bts/rsl.h>
#include <osmo-bts/oml.h>
+#include <osmo-bts/bts_model.h>
static struct gsm_bts *g_bts;
@@ -114,7 +115,7 @@ static void sign_link_down(struct e1inp_line *line)
e1inp_sign_link_destroy(g_bts->oml_link);
g_bts->oml_link = NULL;
- bts_shutdown(g_bts, "Abis close");
+ bts_model_abis_close(g_bts);
}
diff --git a/src/common/bts.c b/src/common/bts.c
index 77302e2f..3fa2bddc 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -242,6 +242,8 @@ int trx_link_estab(struct gsm_bts_trx *trx)
if (link)
rsl_tx_rf_res(trx);
+ else
+ bts_model_trx_deact_rf(trx);
return 0;
}
diff --git a/src/osmo-bts-sysmo/main.c b/src/osmo-bts-sysmo/main.c
index 72c8cfd7..bee5bda2 100644
--- a/src/osmo-bts-sysmo/main.c
+++ b/src/osmo-bts-sysmo/main.c
@@ -420,3 +420,9 @@ int main(int argc, char **argv)
osmo_select_main(0);
}
}
+
+void bts_model_abis_close(struct gsm_bts *bts)
+{
+ /* for now, we simply terminate the program and re-spawn */
+ bts_shutdown(bts, "Abis close");
+}
diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c
index 1b3359aa..4e942499 100644
--- a/src/osmo-bts-trx/main.c
+++ b/src/osmo-bts-trx/main.c
@@ -400,3 +400,6 @@ int main(int argc, char **argv)
return 0;
}
+void bts_model_abis_close(struct gsm_bts *bts)
+{
+}
diff --git a/tests/stubs.c b/tests/stubs.c
index 89ab8027..f1ba5cc7 100644
--- a/tests/stubs.c
+++ b/tests/stubs.c
@@ -59,3 +59,6 @@ int l1if_set_txpower(struct femtol1_hdl *fl1h, float tx_power)
int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan)
{ return 0; }
+
+void bts_model_abis_close(struct gsm_bts *bts)
+{ }
diff --git a/tests/sysmobts/sysmobts_test.c b/tests/sysmobts/sysmobts_test.c
index 99fd4c7d..def7a819 100644
--- a/tests/sysmobts/sysmobts_test.c
+++ b/tests/sysmobts/sysmobts_test.c
@@ -265,3 +265,5 @@ int bts_model_init(struct gsm_bts *bts)
{ return 0; }
int bts_model_oml_estab(struct gsm_bts *bts)
{ return 0; }
+void bts_model_abis_close(struct gsm_bts *bts)
+{ }