diff options
author | Vadim Yanitskiy <axilirator@gmail.com> | 2017-12-18 02:13:41 +0700 |
---|---|---|
committer | Vadim Yanitskiy <axilirator@gmail.com> | 2017-12-18 05:20:25 +0700 |
commit | 15d512d301545e10f69ade0562d5ea86832066b4 (patch) | |
tree | 98a0c277737359a2cad47b31da8fc65155f8a4cd /src/host/trxcon/sched_lchan_common.c | |
parent | e17bb11c3b29919799b3637dece1c7c0273af304 (diff) |
trxcon/scheduler: separate primitive management code
It's good to write, keep and make the source code as much modular
as possible. So, Tte primitive management code was separated to
the 'sched_prim.c' and going to be extended in the near future.
Change-Id: Ifec8c9e4f2c95c72b00772688bcb5dc9c11d6de7
Diffstat (limited to 'src/host/trxcon/sched_lchan_common.c')
-rw-r--r-- | src/host/trxcon/sched_lchan_common.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/src/host/trxcon/sched_lchan_common.c b/src/host/trxcon/sched_lchan_common.c index bf475414..9eccc3e7 100644 --- a/src/host/trxcon/sched_lchan_common.c +++ b/src/host/trxcon/sched_lchan_common.c @@ -185,52 +185,3 @@ size_t sched_bad_frame_ind(uint8_t *l2, uint8_t rsl_cmode, uint8_t tch_mode) return 0; } } - -#define CHAN_IS_TCH(chan) \ - (chan == TRXC_TCHF || chan == TRXC_TCHH_0 || chan == TRXC_TCHH_1) - -#define PRIM_IS_TCH(prim) \ - CHAN_IS_TCH(prim->chan) && prim->payload_len != GSM_MACBLOCK_LEN - -#define PRIM_IS_FACCH(prim) \ - CHAN_IS_TCH(prim->chan) && prim->payload_len == GSM_MACBLOCK_LEN - -struct trx_ts_prim *sched_dequeue_tch_prim(struct llist_head *queue) -{ - struct trx_ts_prim *a, *b; - - /* Obtain the first prim from TX queue */ - a = llist_entry(queue->next, struct trx_ts_prim, list); - - /* If this is the only one => do nothing... */ - if (queue->next->next == queue) - return a; - - /* Obtain the second prim from TX queue */ - b = llist_entry(queue->next->next, struct trx_ts_prim, list); - - /* Find and prioritize FACCH */ - if (PRIM_IS_FACCH(a) && PRIM_IS_TCH(b)) { - /** - * Case 1: first is FACCH, second is TCH: - * Prioritize FACCH, dropping TCH - */ - llist_del(&b->list); - talloc_free(b); - return a; - } else if (PRIM_IS_TCH(a) && PRIM_IS_FACCH(b)) { - /** - * Case 2: first is TCH, second is FACCH: - * Prioritize FACCH, dropping TCH - */ - llist_del(&a->list); - talloc_free(a); - return b; - } else { - /** - * Otherwise: both are TCH or FACCH frames: - * Nothing to prioritize, return the first one - */ - return a; - } -} |