summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/host/trxcon/l1ctl.c13
-rw-r--r--src/host/trxcon/l1ctl.h1
-rw-r--r--src/host/trxcon/sched_lchan_handlers.c34
3 files changed, 37 insertions, 11 deletions
diff --git a/src/host/trxcon/l1ctl.c b/src/host/trxcon/l1ctl.c
index 12745e9..7d96396 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 596a5b0..6c61bfd 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 303ae81..1c7a313 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;
}