aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/bts.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-06-29 20:42:14 +0200
committerHarald Welte <laforge@gnumonks.org>2011-06-29 20:42:14 +0200
commitb84968418172040f12dc150d770f9b06d6df335d (patch)
treed7cd7017d9ee345aa7d5660dcf82d0c451dd0c7d /src/common/bts.c
parent1eb4d4893c3de16692ae3e9c3b4c8a09da490ad8 (diff)
deactivate RF + exit when the Abis link is gone
The idea is that the BTS process is re-spawned from init/upstart/systemd
Diffstat (limited to 'src/common/bts.c')
-rw-r--r--src/common/bts.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/common/bts.c b/src/common/bts.c
index 02cb0fe1..19a3e430 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -56,6 +56,27 @@ int bts_init(struct gsm_bts *bts)
return bts_model_init(bts);
}
+static void shutdown_timer_cb(void *data)
+{
+ exit(42);
+}
+
+static struct osmo_timer_list shutdown_timer = {
+ .cb = &shutdown_timer_cb,
+};
+
+void bts_shutdown(struct gsm_bts *bts)
+{
+ struct gsm_bts_trx *trx;
+
+ llist_for_each_entry(trx, &bts->trx_list, list)
+ bts_model_trx_deact_rf(trx);
+
+ /* shedule a timer to make sure select loop logic can run again
+ * to dispatch any pending primitives */
+ osmo_timer_schedule(&shutdown_timer, 3, 0);
+}
+
#if 0
struct osmobts_lchan *lchan_by_channelnr(struct osmobts_trx *trx,
uint8_t channelnr)