Change in ...osmo-bts[master]: osmo-bts-trx/trx_if.c: encode actual TRXD header version

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Tue Jul 16 04:16:14 UTC 2019


laforge has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-bts/+/14745 )

Change subject: osmo-bts-trx/trx_if.c: encode actual TRXD header version
......................................................................

osmo-bts-trx/trx_if.c: encode actual TRXD header version

Both TRX2L1 (Uplink) and L12TRX (Downlink) messages should use
the same TRXD header format (and version) as was negotiated.

Change-Id: Idbc598ef7c1871ee8da830f3fbe0a5cc386f873d
Related: OS#4006
---
M src/osmo-bts-trx/trx_if.c
1 file changed, 17 insertions(+), 2 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c
index 3e53fdb..b966bbe 100644
--- a/src/osmo-bts-trx/trx_if.c
+++ b/src/osmo-bts-trx/trx_if.c
@@ -1054,6 +1054,7 @@
 int trx_if_send_burst(struct trx_l1h *l1h, uint8_t tn, uint32_t fn, uint8_t pwr,
 	const ubit_t *bits, uint16_t nbits)
 {
+	uint8_t hdr_ver = l1h->config.trxd_hdr_ver_use;
 	uint8_t buf[TRX_DATA_MSG_MAX_LEN];
 
 	if ((nbits != GSM_BURST_LEN) && (nbits != EGPRS_BURST_LEN)) {
@@ -1061,9 +1062,23 @@
 		return -1;
 	}
 
-	LOGPPHI(l1h->phy_inst, DTRX, LOGL_DEBUG, "TX burst tn=%u fn=%u pwr=%u\n", tn, fn, pwr);
+	LOGPPHI(l1h->phy_inst, DTRX, LOGL_DEBUG,
+		"Tx burst (hdr_ver=%u): tn=%u fn=%u pwr=%u\n",
+		hdr_ver, tn, fn, pwr);
 
-	buf[0] = tn;
+	switch (hdr_ver) {
+	case 0:
+	case 1:
+		/* Both versions have the same header format */
+		break;
+
+	default:
+		LOGPPHI(l1h->phy_inst, DTRX, LOGL_ERROR,
+			"Requested TRXD header version %u is not supported\n", hdr_ver);
+		return -ENOTSUP;
+	}
+
+	buf[0] = ((hdr_ver & 0x0f) << 4) | tn;
 	buf[1] = (fn >> 24) & 0xff;
 	buf[2] = (fn >> 16) & 0xff;
 	buf[3] = (fn >>  8) & 0xff;

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/14745
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Idbc598ef7c1871ee8da830f3fbe0a5cc386f873d
Gerrit-Change-Number: 14745
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at gnumonks.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190716/ad5144fd/attachment.htm>


More information about the gerrit-log mailing list