From bde71c180a3af5b61d7ea59cf494e385c864a2f1 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Fri, 28 Sep 2018 02:47:54 +0700 Subject: trxcon/scheduler: pass lchan state to sched_prim_dequeue() Having access to a logical channel state is required by the follow-up change, which will introduce a separate function for dequeuing SACCH primitives. Change-Id: Ibde0acf8e6be224b1007be707a636eaad68c8d36 --- src/host/trxcon/sched_prim.c | 10 +++++----- src/host/trxcon/sched_trx.c | 2 +- src/host/trxcon/sched_trx.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/host/trxcon/sched_prim.c b/src/host/trxcon/sched_prim.c index 6b160d1c..e71109b1 100644 --- a/src/host/trxcon/sched_prim.c +++ b/src/host/trxcon/sched_prim.c @@ -284,17 +284,17 @@ no_facch: * * @param queue a transmit queue to take a prim from * @param fn the current frame number (used for FACCH/H) - * @param lchan_type required primitive type + * @param lchan logical channel state * @return a primitive or NULL if not found */ struct trx_ts_prim *sched_prim_dequeue(struct llist_head *queue, - uint32_t fn, enum trx_lchan_type lchan_type) + uint32_t fn, struct trx_lchan_state *lchan) { /* There is nothing to dequeue */ if (llist_empty(queue)) return NULL; - switch (lchan_type) { + switch (lchan->type) { /* TCH/F requires FACCH/F prioritization */ case TRXC_TCHF: return prim_dequeue_tch_f(queue); @@ -302,11 +302,11 @@ struct trx_ts_prim *sched_prim_dequeue(struct llist_head *queue, /* FACCH/H prioritization is a bit more complex */ case TRXC_TCHH_0: case TRXC_TCHH_1: - return prim_dequeue_tch_h(queue, fn, lchan_type); + return prim_dequeue_tch_h(queue, fn, lchan->type); /* Other kinds of logical channels */ default: - return prim_dequeue_one(queue, lchan_type); + return prim_dequeue_one(queue, lchan->type); } } diff --git a/src/host/trxcon/sched_trx.c b/src/host/trxcon/sched_trx.c index 023764dc..fc29998d 100644 --- a/src/host/trxcon/sched_trx.c +++ b/src/host/trxcon/sched_trx.c @@ -95,7 +95,7 @@ static void sched_frame_clck_cb(struct trx_sched *sched) * attempt to obtain a new one from queue */ if (lchan->prim == NULL) - lchan->prim = sched_prim_dequeue(&ts->tx_prims, fn, chan); + lchan->prim = sched_prim_dequeue(&ts->tx_prims, fn, lchan); /* TODO: report TX buffers health to the higher layers */ diff --git a/src/host/trxcon/sched_trx.h b/src/host/trxcon/sched_trx.h index 08e24894..ff288f20 100644 --- a/src/host/trxcon/sched_trx.h +++ b/src/host/trxcon/sched_trx.h @@ -302,7 +302,7 @@ int sched_prim_push(struct trx_instance *trx, (CHAN_IS_TCH(prim->chan) && prim->payload_len == GSM_MACBLOCK_LEN) struct trx_ts_prim *sched_prim_dequeue(struct llist_head *queue, - uint32_t fn, enum trx_lchan_type lchan_type); + uint32_t fn, struct trx_lchan_state *lchan); int sched_prim_dummy(struct trx_lchan_state *lchan); void sched_prim_drop(struct trx_lchan_state *lchan); void sched_prim_flush_queue(struct llist_head *list); -- cgit v1.2.3