summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-08-13 01:35:22 +0600
committerVadim Yanitskiy <axilirator@gmail.com>2017-11-19 15:55:35 +0700
commit097d19a062ffffebed98430d9170e4087efde84b (patch)
treeaf6888f3bd404f99058d818c5f9e58eaf0d49a08
parent64e08c45abae6e07c765fbc39a424b1a863c1d35 (diff)
host/trxcon/l1ctl.c: handle L1CTL_TRAFFIC_REQ
-rw-r--r--src/host/trxcon/l1ctl.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c
index 6a9cdb3..4898d2b 100644
--- a/src/host/trxcon/l1ctl.c
+++ b/src/host/trxcon/l1ctl.c
@@ -639,6 +639,44 @@ exit:
return rc;
}
+static int l1ctl_rx_traffic_req(struct l1ctl_link *l1l, struct msgb *msg)
+{
+ struct l1ctl_info_ul *ul;
+ struct trx_ts_prim *prim;
+ uint8_t chan_nr, link_id;
+ int rc;
+
+ /* Extract UL frame header */
+ ul = (struct l1ctl_info_ul *) msg->l1h;
+
+ /* Obtain channel description */
+ chan_nr = ul->chan_nr;
+ link_id = ul->link_id & 0x40;
+
+ LOGP(DL1D, LOGL_DEBUG, "Recv Traffic Req (chan_nr=0x%02x, "
+ "link_id=0x%02x)\n", chan_nr, link_id);
+
+ /* Init a new primitive */
+ rc = sched_trx_init_prim(l1l->trx, &prim, TRAFFIC_DATA_LEN,
+ chan_nr, link_id);
+ if (rc)
+ goto exit;
+
+ /* Push this primitive to transmit queue */
+ rc = sched_trx_push_prim(l1l->trx, prim, chan_nr);
+ if (rc) {
+ talloc_free(prim);
+ goto exit;
+ }
+
+ /* Fill in the payload */
+ memcpy(prim->payload, ul->payload, TRAFFIC_DATA_LEN);
+
+exit:
+ msgb_free(msg);
+ return rc;
+}
+
static int l1ctl_rx_param_req(struct l1ctl_link *l1l, struct msgb *msg)
{
struct l1ctl_par_req *par_req;
@@ -717,6 +755,8 @@ int l1ctl_rx_cb(struct l1ctl_link *l1l, struct msgb *msg)
return l1ctl_rx_dm_rel_req(l1l, msg);
case L1CTL_DATA_REQ:
return l1ctl_rx_data_req(l1l, msg);
+ case L1CTL_TRAFFIC_REQ:
+ return l1ctl_rx_traffic_req(l1l, msg);
case L1CTL_PARAM_REQ:
return l1ctl_rx_param_req(l1l, msg);
case L1CTL_TCH_MODE_REQ: