diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2013-02-05 16:53:04 +0100 |
---|---|---|
committer | Andreas Eversberg <jolly@eversberg.eu> | 2014-04-06 08:57:04 +0200 |
commit | 4dfcffab8c1d4d2cda0d4ed480cea13eaf539c0b (patch) | |
tree | d47d05c2995a6c99f8e1add6ce9e4d2dfa10f402 | |
parent | 98ae252ef94e8faf53fb63468c98fe089920caef (diff) |
TRX: Power down tranceiver and reset scheduler, if abis link is lost
If BTS is gone, TRX is powered down, due to loss of abis link. If link is
esablished again, tranceiver and scheduler are provisioned again by BTS.
-rw-r--r-- | src/osmo-bts-trx/l1_if.c | 7 | ||||
-rw-r--r-- | src/osmo-bts-trx/scheduler.c | 15 | ||||
-rw-r--r-- | src/osmo-bts-trx/scheduler.h | 3 |
3 files changed, 22 insertions, 3 deletions
diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index 66922b54..25aa0f98 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -239,12 +239,19 @@ static int trx_close(struct gsm_bts_trx *trx) { struct trx_l1h *l1h = trx_l1h_hdl(trx); + /* close all logical channels and reset timeslots */ + trx_sched_reset(l1h); + + /* power off tranceiver, if not already */ if (l1h->config.poweron) { l1h->config.poweron = 0; l1h->config.poweron_sent = 0; l1if_provision_tranceiver_trx(l1h); } + /* Set to Operational State: Disabled */ + oml_mo_state_chg(&trx->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OFF_LINE); + return 0; } diff --git a/src/osmo-bts-trx/scheduler.c b/src/osmo-bts-trx/scheduler.c index a0caeeca..d51c1eb4 100644 --- a/src/osmo-bts-trx/scheduler.c +++ b/src/osmo-bts-trx/scheduler.c @@ -201,10 +201,12 @@ int trx_sched_init(struct trx_l1h *l1h) for (tn = 0; tn < 8; tn++) { l1h->mf_index[tn] = 0; + INIT_LLIST_HEAD(&l1h->dl_prims[tn]); for (i = 0; i < _TRX_CHAN_MAX; i++) { - INIT_LLIST_HEAD(&l1h->dl_prims[tn]); chan_state = &l1h->chan_states[tn][i]; - chan_state->ul_mask = 0x0; + chan_state->dl_active = 0; + chan_state->ul_active = 0; + chan_state->ul_mask = 0x00; } } @@ -220,8 +222,8 @@ void trx_sched_exit(struct trx_l1h *l1h) LOGP(DL1C, LOGL_NOTICE, "Exit scheduler for trx=%u\n", l1h->trx->nr); for (tn = 0; tn < 8; tn++) { + msgb_queue_flush(&l1h->dl_prims[tn]); for (i = 0; i < _TRX_CHAN_MAX; i++) { - msgb_queue_flush(&l1h->dl_prims[tn]); chan_state = &l1h->chan_states[tn][i]; if (chan_state->dl_bursts) { talloc_free(chan_state->dl_bursts); @@ -235,6 +237,13 @@ void trx_sched_exit(struct trx_l1h *l1h) } } +/* close all logical channels and reset timeslots */ +void trx_sched_reset(struct trx_l1h *l1h) +{ + trx_sched_exit(l1h); + trx_sched_init(l1h); +} + /* * data request (from upper layer) diff --git a/src/osmo-bts-trx/scheduler.h b/src/osmo-bts-trx/scheduler.h index eb82327a..97803bd4 100644 --- a/src/osmo-bts-trx/scheduler.h +++ b/src/osmo-bts-trx/scheduler.h @@ -26,4 +26,7 @@ int trx_sched_set_pchan(struct trx_l1h *l1h, uint8_t tn, int trx_sched_set_lchan(struct trx_l1h *l1h, uint8_t chan_nr, uint8_t link_id, int downlink, int active); +/* close all logical channels and reset timeslots */ +void trx_sched_reset(struct trx_l1h *l1h); + #endif /* TRX_SCHEDULER_H */ |