Review at  https://gerrit.osmocom.org/6737

host/trxcon/scheduler: confirm xCCH data sending

Change-Id: I40994e7046c25306a0a323910a65e195d2d8fbd0
---
M src/host/trxcon/l1ctl.c
M src/host/trxcon/l1ctl.h
M src/host/trxcon/sched_lchan_handlers.c
3 files changed, 37 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/37/6737/1

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 @@
        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_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 @@
        /* 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 @@
        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;
 }
 

-- 
To view, visit https://gerrit.osmocom.org/6737
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I40994e7046c25306a0a323910a65e195d2d8fbd0
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <lafo...@gnumonks.org>

Reply via email to