From b84968418172040f12dc150d770f9b06d6df335d Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 29 Jun 2011 20:42:14 +0200 Subject: deactivate RF + exit when the Abis link is gone The idea is that the BTS process is re-spawned from init/upstart/systemd --- src/common/bts.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/common/bts.c') 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) -- cgit v1.2.3