aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-07-08 10:34:33 +0700
committerlaforge <laforge@gnumonks.org>2019-07-16 04:16:13 +0000
commit55dbafc497a1406a3bfa9c87c5e7337d6e127249 (patch)
treebf88069f6f81e8495ab7451c6c5577fd57abc819
parent139b8caa79499ec170b10b035409649b02750af3 (diff)
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
-rw-r--r--src/osmo-bts-trx/trx_if.c19
1 files changed, 17 insertions, 2 deletions
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 @@ static int trx_data_read_cb(struct osmo_fd *ofd, unsigned int what)
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 @@ int trx_if_send_burst(struct trx_l1h *l1h, uint8_t tn, uint32_t fn, uint8_t pwr,
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;