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.
This commit is contained in:
Andreas Eversberg 2013-02-05 16:53:04 +01:00 committed by Harald Welte
parent 7a0d11dd68
commit 414faaca19
3 changed files with 22 additions and 3 deletions

View File

@ -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;
}

View File

@ -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)

View File

@ -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 */