aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-trx/trx_if.c
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-05-18 23:53:18 +0200
committerfixeria <vyanitskiy@sysmocom.de>2021-06-01 02:46:43 +0000
commitec1045a01bc037686a023917db2659e4cebcbbe2 (patch)
tree4a057217670e401fcc44fe6ffb4f1176101bf983 /src/osmo-bts-trx/trx_if.c
parent272d474ccb4d1e70ef28c7c984dee8b74e54f4b9 (diff)
[VAMOS] osmo-bts-trx: implement and enable PDU batching for TRXDv2
This change implements TRXD PDU batching approach b), which is described in section 25.3.4 of the user manual [1]. This approach is quite easy to implement on the transceiver side, so we can enable it by default. .Example: datagram structure for combination b) ---- +--------+----------------+---------+------------------------+ | TRXN=N | TDMA FN=F TN=0 | BATCH=1 | Hard-/Soft-bits | +--------+----------------+---------+------------------------+ | TRXN=N | TDMA FN=F TN=1 | BATCH=1 | Hard-/Soft-bits | +--------+----------------+---------+------------------------+ | TRXN=N | TDMA FN=F TN=2 | BATCH=1 | Hard-/Soft-bits | +--------+----------------+---------+------------------------+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +--------+----------------+---------+------------------------+ | TRXN=N | TDMA FN=F TN=7 | BATCH=0 | Hard-/Soft-bits | +--------+----------------+---------+------------------------+ ---- Other PDU batching approaches can be introduced later. [1] https://downloads.osmocom.org/docs/latest/osmobts-usermanual.pdf Change-Id: I9b4cc8e10cd683b28d22e32890569484cd20372d Related: SYS#4895, OS#4941
Diffstat (limited to 'src/osmo-bts-trx/trx_if.c')
-rw-r--r--src/osmo-bts-trx/trx_if.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c
index fcad75c9..eae11ee4 100644
--- a/src/osmo-bts-trx/trx_if.c
+++ b/src/osmo-bts-trx/trx_if.c
@@ -1071,6 +1071,7 @@ int trx_if_send_burst(struct trx_l1h *l1h, const struct trx_dl_burst_req *br)
{
uint8_t pdu_ver = l1h->config.trxd_pdu_ver_use;
static uint8_t *buf = &trx_data_buf[0];
+ static uint8_t *last_pdu = NULL;
static unsigned int pdu_num = 0;
ssize_t snd_len, buf_len;
@@ -1081,6 +1082,16 @@ int trx_if_send_burst(struct trx_l1h *l1h, const struct trx_dl_burst_req *br)
return -ENODEV;
}
+ /* Burst batching breaker */
+ if (br == NULL) {
+ if (pdu_num > 0)
+ goto sendall;
+ return -ENOMSG;
+ }
+
+ /* Pointer to the last encoded PDU */
+ last_pdu = &buf[0];
+
switch (pdu_ver) {
/* Both versions have the same PDU format */
case 0: /* TRXDv0 */
@@ -1092,7 +1103,8 @@ int trx_if_send_burst(struct trx_l1h *l1h, const struct trx_dl_burst_req *br)
break;
case 2: /* TRXDv2 */
buf[0] = br->tn;
- buf[1] = (br->trx_num & 0x3f) | (br->flags << 7);
+ /* BATCH.ind will be unset in the last PDU */
+ buf[1] = (br->trx_num & 0x3f) | (1 << 7);
buf[2] = br->mts;
buf[3] = br->att;
buf[4] = (uint8_t) br->scpir;
@@ -1117,14 +1129,19 @@ int trx_if_send_burst(struct trx_l1h *l1h, const struct trx_dl_burst_req *br)
/* One more PDU in the buffer */
pdu_num++;
- /* More PDUs to send? Batch them! */
- if (pdu_ver >= 2 && br->flags & TRX_BR_F_MORE_PDUS)
+ /* TRXDv2: wait for the batching breaker */
+ if (pdu_ver >= 2)
return 0;
+sendall:
LOGPPHI(l1h->phy_inst, DTRX, LOGL_DEBUG,
"Tx TRXDv%u datagram with %u PDU(s): fn=%u\n",
pdu_ver, pdu_num, br->fn);
+ /* TRXDv2: unset BATCH.ind in the last PDU */
+ if (pdu_ver >= 2)
+ last_pdu[1] &= ~(1 << 7);
+
buf_len = buf - &trx_data_buf[0];
buf = &trx_data_buf[0];
pdu_num = 0;