summaryrefslogtreecommitdiffstats
path: root/src/host/trxcon/sched_trx.h
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-08-13 00:16:24 +0600
committerVadim Yanitskiy <axilirator@gmail.com>2017-11-19 17:35:07 +0700
commit7d95f8821e82895f7952860923a7624287f9c42c (patch)
tree49ec058fd61bda0ddf4c0529e9071dd80e2d8515 /src/host/trxcon/sched_trx.h
parent82b8c21b210535feaed98487f0df12f3acc2e46c (diff)
host/trxcon/l1ctl.c: share primitive management code
This change introduces shared primitive management functions, exposed from the l1ctl_rx_data_req() implementation: - sched_trx_init_prim() - allocates memory for a new primitive and its payload. Initializes primitive's header, setting the logical channel type and the payload length. After initialization, the talloc context of a primitive is a trx instance, which passed as the first argument. - sched_trx_push_prim() - decodes the timeslot index from chan_nr and pushes a primitive to its transimt queue. The talloc context of primitive is changed to the parent trx_ts instance after queuing. Both functions will be used for handling both L1CTL_TRAFFIC_REQ and L1CTL_RACH_REQ. Change-Id: I8169a1ef4ef54d91b50f3e213e4842f54af8b499
Diffstat (limited to 'src/host/trxcon/sched_trx.h')
-rw-r--r--src/host/trxcon/sched_trx.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/host/trxcon/sched_trx.h b/src/host/trxcon/sched_trx.h
index 1b74041c..4209f533 100644
--- a/src/host/trxcon/sched_trx.h
+++ b/src/host/trxcon/sched_trx.h
@@ -235,6 +235,8 @@ struct trx_ts_prim {
struct llist_head list;
/*! \brief Logical channel type */
enum trx_lchan_type chan;
+ /*! \brief Payload length */
+ size_t payload_len;
/*! \brief Payload */
uint8_t payload[0];
};
@@ -267,5 +269,11 @@ int sched_trx_deactivate_lchan(struct trx_ts *ts, enum trx_lchan_type chan);
struct trx_lchan_state *sched_trx_find_lchan(struct trx_ts *ts,
enum trx_lchan_type chan);
+/* Primitive management functions */
+int sched_trx_init_prim(struct trx_instance *trx, struct trx_ts_prim **prim,
+ size_t pl_len, uint8_t chan_nr, uint8_t link_id);
+int sched_trx_push_prim(struct trx_instance *trx,
+ struct trx_ts_prim *prim, uint8_t chan_nr);
+
int sched_trx_handle_rx_burst(struct trx_instance *trx, uint8_t tn,
uint32_t burst_fn, sbit_t *bits, uint16_t nbits, int8_t rssi, float toa);