scheduler: join conditions in trx_sched_set_lchan()

Change-Id: If2b68e3c7bf01badaaa4666198a4a4c5709f0040
This commit is contained in:
Vadim Yanitskiy 2020-10-17 15:13:54 +07:00 committed by laforge
parent 4cc38b8a72
commit debfbb6965
1 changed files with 8 additions and 6 deletions

View File

@ -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)
memset(chan_state, 0, sizeof(*chan_state));
else
chan_state->ho_rach_detect = 0;
chan_state->active = active;
if (active) {
/* Clean up everything */
memset(chan_state, 0, sizeof(*chan_state));
/* 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) */