From f2af7d2953429a15cda5b52bedec226ea0b47aab Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Sun, 16 Jul 2017 17:13:34 +0700 Subject: host/trxcon/scheduler: confirm xCCH data sending Change-Id: I40994e7046c25306a0a323910a65e195d2d8fbd0 --- src/host/trxcon/l1ctl.c | 13 +++++++++++++ src/host/trxcon/l1ctl.h | 1 + src/host/trxcon/sched_lchan_handlers.c | 34 +++++++++++++++++++++++----------- 3 files changed, 37 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c index 12745e97..7d96396f 100644 --- a/src/host/trxcon/l1ctl.c +++ b/src/host/trxcon/l1ctl.c @@ -221,6 +221,19 @@ int l1ctl_tx_rach_conf(struct l1ctl_link *l1l, uint32_t fn) return l1ctl_link_send(l1l, msg); } +int l1ctl_tx_data_conf(struct l1ctl_link *l1l) +{ + struct msgb *msg; + + msg = l1ctl_alloc_msg(L1CTL_DATA_CONF); + if (msg == NULL) + return -ENOMEM; + + LOGP(DL1C, LOGL_DEBUG, "Send Data Conf\n"); + + return l1ctl_link_send(l1l, msg); +} + /* FBSB expire timer */ static void fbsb_timer_cb(void *data) { diff --git a/src/host/trxcon/l1ctl.h b/src/host/trxcon/l1ctl.h index 596a5b09..6c61bfd9 100644 --- a/src/host/trxcon/l1ctl.h +++ b/src/host/trxcon/l1ctl.h @@ -17,3 +17,4 @@ int l1ctl_rx_cb(struct l1ctl_link *l1l, struct msgb *msg); int l1ctl_tx_data_ind(struct l1ctl_link *l1l, struct l1ctl_info_dl *ind); int l1ctl_tx_rach_conf(struct l1ctl_link *l1l, uint32_t fn); +int l1ctl_tx_data_conf(struct l1ctl_link *l1l); diff --git a/src/host/trxcon/sched_lchan_handlers.c b/src/host/trxcon/sched_lchan_handlers.c index 303ae818..1c7a3136 100644 --- a/src/host/trxcon/sched_lchan_handlers.c +++ b/src/host/trxcon/sched_lchan_handlers.c @@ -259,17 +259,6 @@ send_burst: /* Choose proper TSC */ tsc = nb_training_bits[trx->tsc]; - /* If we are sending the last (4/4) burst */ - if ((*mask & 0x0f) == 0x0f) { - /* Remove primitive from queue and free memory */ - prim = llist_entry(ts->tx_prims.next, struct trx_ts_prim, list); - llist_del(&prim->list); - talloc_free(prim); - - /* Reset mask */ - *mask = 0x00; - } - /* Compose a new burst */ memset(burst, 0, 3); /* TB */ memcpy(burst + 3, offset, 58); /* Payload 1/2 */ @@ -287,9 +276,32 @@ send_burst: rc = trx_if_tx_burst(trx, ts->index, fn, 10, burst); if (rc) { LOGP(DSCH, LOGL_ERROR, "Could not send burst to transceiver\n"); + + /* Remove primitive from queue and free memory */ + prim = llist_entry(ts->tx_prims.next, struct trx_ts_prim, list); + llist_del(&prim->list); + talloc_free(prim); + + /* Reset mask */ + *mask = 0x00; + return rc; } + /* If we have sent the last (4/4) burst */ + if ((*mask & 0x0f) == 0x0f) { + /* Remove primitive from queue and free memory */ + prim = llist_entry(ts->tx_prims.next, struct trx_ts_prim, list); + llist_del(&prim->list); + talloc_free(prim); + + /* Reset mask */ + *mask = 0x00; + + /* Confirm data sending */ + l1ctl_tx_data_conf(trx->l1l); + } + return 0; } -- cgit v1.2.3