diff options
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2020-10-17 14:28:55 +0700 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2020-10-19 15:04:22 +0000 |
commit | 4cc38b8a72179a9ddbdbca79f17b9d1a011d2ba7 (patch) | |
tree | 030cb846d02cb2c0d82b0303748cd880f0453afe | |
parent | 2e28b3859d9606ac950b3680122dc10bd8582f2f (diff) |
scheduler: treat subsequent lchan (de)activation as error
Trying to (de)activate logical channels that are already (de)activated
is not something that we normally expect. Treat this as error.
Change-Id: I6256280cae35b2b4d7a8ba4b3913ca69cde22611
-rw-r--r-- | src/common/scheduler.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/scheduler.c b/src/common/scheduler.c index 3dc4db53..8cb9bd43 100644 --- a/src/common/scheduler.c +++ b/src/common/scheduler.c @@ -974,8 +974,8 @@ int trx_sched_set_lchan(struct l1sched_trx *l1t, uint8_t chan_nr, uint8_t link_i uint8_t tn = L1SAP_CHAN2TS(chan_nr); struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn); uint8_t ss = l1sap_chan2ss(chan_nr); + bool found = false; int i; - int rc = -EINVAL; /* look for all matching chan_nr/link_id */ for (i = 0; i < _TRX_CHAN_MAX; i++) { @@ -985,10 +985,10 @@ int trx_sched_set_lchan(struct l1sched_trx *l1t, uint8_t chan_nr, uint8_t link_i continue; if (trx_chan_desc[i].link_id != link_id) continue; - - rc = 0; if (chan_state->active == active) continue; + found = true; + LOGP(DL1C, LOGL_NOTICE, "%s %s on trx=%d ts=%d\n", (active) ? "Activating" : "Deactivating", trx_chan_desc[i].name, l1t->trx->nr, tn); @@ -1018,7 +1018,7 @@ int trx_sched_set_lchan(struct l1sched_trx *l1t, uint8_t chan_nr, uint8_t link_i if (!active) _sched_act_rach_det(l1t, tn, ss, 0); - return rc; + return found ? 0 : -EINVAL; } /* setting all logical channels given attributes to active/inactive */ |