diff options
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2020-10-17 15:13:54 +0700 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2020-10-19 15:04:22 +0000 |
commit | debfbb69653421b523f50ef4625a4f7ee4741d5a (patch) | |
tree | 80846512b743f3d7dab564ccda9e6be0202adf43 /src/common | |
parent | 4cc38b8a72179a9ddbdbca79f17b9d1a011d2ba7 (diff) |
scheduler: join conditions in trx_sched_set_lchan()
Change-Id: If2b68e3c7bf01badaaa4666198a4a4c5709f0040
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/scheduler.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/common/scheduler.c b/src/common/scheduler.c index 8cb9bd43..5bf1c5bc 100644 --- a/src/common/scheduler.c +++ b/src/common/scheduler.c @@ -1002,16 +1002,18 @@ int trx_sched_set_lchan(struct l1sched_trx *l1t, uint8_t chan_nr, uint8_t link_i chan_state->ul_bursts = NULL; } - if (active) + if (active) { + /* Clean up everything */ memset(chan_state, 0, sizeof(*chan_state)); - else - chan_state->ho_rach_detect = 0; - chan_state->active = active; - if (active) { + /* Bind to generic 'struct gsm_lchan' */ chan_state->lchan = get_lchan_by_chan_nr(l1t->trx, chan_nr); OSMO_ASSERT(chan_state->lchan != NULL); + } else { + chan_state->ho_rach_detect = 0; } + + chan_state->active = active; } /* disable handover detection (on deactivation) */ |