aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/bts.c
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-06-17 17:23:57 +0200
committerpespin <pespin@sysmocom.de>2020-06-23 12:49:11 +0000
commitfee04adc751747a476ce832be26a488df01f852e (patch)
treeef09fb652ae54806a468bba53a07f247e35b394c /src/common/bts.c
parent580a27e97c3f0e139dfd7b0c10de24463d4b5294 (diff)
Introduce bts_shutdown FSM
Using an FSM here will allow for more complex ordered shutdown procedures, like power ramp down, waiting for TRX deact asyncrhonously, etc. Current commit leaves everything in place already prepared to implement ramp down, which will be implemented in next commit in the series. Related: SYS#4920 Change-Id: I8f48f17e61c3b9b86342eaf5b8a2b1ac9758bde5
Diffstat (limited to 'src/common/bts.c')
-rw-r--r--src/common/bts.c33
1 files changed, 0 insertions, 33 deletions
diff --git a/src/common/bts.c b/src/common/bts.c
index d2bca2f7..dccb0986 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -269,39 +269,6 @@ int bts_trx_init(struct gsm_bts_trx *trx)
return 0;
}
-static void shutdown_timer_cb(void *data)
-{
- fprintf(stderr, "Shutdown timer expired\n");
- exit(42);
-}
-
-static struct osmo_timer_list shutdown_timer = {
- .cb = &shutdown_timer_cb,
-};
-
-void bts_shutdown(struct gsm_bts *bts, const char *reason)
-{
- struct gsm_bts_trx *trx;
-
- if (osmo_timer_pending(&shutdown_timer)) {
- LOGP(DOML, LOGL_NOTICE,
- "BTS is already being shutdown.\n");
- return;
- }
-
- LOGP(DOML, LOGL_NOTICE, "Shutting down BTS %u, Reason %s\n",
- bts->nr, reason);
-
- llist_for_each_entry_reverse(trx, &bts->trx_list, list) {
- bts_model_trx_deact_rf(trx);
- bts_model_trx_close(trx);
- }
-
- /* schedule a timer to make sure select loop logic can run again
- * to dispatch any pending primitives */
- osmo_timer_schedule(&shutdown_timer, 3, 0);
-}
-
/* main link is established, send status report */
int bts_link_estab(struct gsm_bts *bts)
{