trxcon/scheduler: share chan / prim identification helpers

Because they would be also used outside.

Change-Id: Ic8af9d7c72fdb124caef82e35170f92b84e16eb9
This commit is contained in:
Vadim Yanitskiy 2018-01-04 01:20:39 +01:00
parent 6c0b1261a3
commit 96da00d457
2 changed files with 9 additions and 9 deletions

View File

@ -126,15 +126,6 @@ int sched_prim_push(struct trx_instance *trx,
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
/**
* Dequeues a TCH or FACCH frame, prioritizing the second.
* In case if a FACCH frame is found, a TCH frame is being

View File

@ -274,6 +274,15 @@ int sched_prim_init(struct trx_instance *trx, struct trx_ts_prim **prim,
int sched_prim_push(struct trx_instance *trx,
struct trx_ts_prim *prim, uint8_t chan_nr);
#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_prim_dequeue(struct llist_head *queue,
enum trx_lchan_type lchan_type);
void sched_prim_drop(struct trx_lchan_state *lchan);