aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-trx/scheduler.c
diff options
context:
space:
mode:
authorAndreas Eversberg <jolly@eversberg.eu>2013-02-05 16:53:04 +0100
committerHarald Welte <laforge@gnumonks.org>2015-09-22 16:41:25 +0200
commit414faaca19812016d5fb756838988f341c23ba51 (patch)
tree898f36f0469be0e55eb3fc50996b557f10513fbd /src/osmo-bts-trx/scheduler.c
parent7a0d11dd68528d96afff61083c3cf90a50af11bb (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.
Diffstat (limited to 'src/osmo-bts-trx/scheduler.c')
-rw-r--r--src/osmo-bts-trx/scheduler.c15
1 files changed, 12 insertions, 3 deletions
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)