summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2026-10-08 02:28:59 +0500
committerfixeria <vyanitskiy@sysmocom.de>2026-10-19 11:22:54 +0000
commit168b8c5fe49e84a8a8142e64519085b363b4982a (patch)
tree791b5568ac081b92dc03897cb1c5fd998af64ea1
parenta0a315e292575f6e7c9884d95154ddc674b536de (diff)
trxcon/trx_if: negotiate TRXD PDU version 1 (TRXDv1)HEADmaster
Now that trx_if.c is built against libosmo-trx, enable TRXDv1 by negotiating it (SETFORMAT) before every POWERON, since the transceiver may reset its active format back to legacy on the preceding POWEROFF. This significantly improves the ttcn3-bts-test pass/fail ratio in the frequency hopping configuration: TRXDv1 lets the transceiver (osmo-trx-proxy) send us NOPE.ind, which we rely on to keep driving uplink bursts even when no downlink burst was received. Change-Id: I08d588f74925bb7a85e131defc0fa82158d90680 Related: OS#6638
-rw-r--r--src/host/trxcon/src/trx_if.c30
-rw-r--r--src/host/trxcon/src/trxcon_shim.c12
2 files changed, 36 insertions, 6 deletions
diff --git a/src/host/trxcon/src/trx_if.c b/src/host/trxcon/src/trx_if.c
index a974b46c..bbbc93fe 100644
--- a/src/host/trxcon/src/trx_if.c
+++ b/src/host/trxcon/src/trx_if.c
@@ -45,6 +45,13 @@
#include <osmocom/bb/trxcon/trx_if.h>
#include <osmocom/bb/trxcon/logging.h>
+/* Highest TRXD PDU version supported by trxcon (TRXDv1).
+ *
+ * TRXDv2 requires Tx PDUs to contain modulation and training sequence info.
+ * struct trxcon_phyif_burst_req currently does not contain this information,
+ * so we cannot populate the necessary fields in trx_if_handle_phyif_burst_req(). */
+#define TRXD_PDU_VER_MAX 1
+
/* Give up after 3 retransmissions of a TRXC command */
#define TRX_MAX_RETRANS 3
@@ -148,6 +155,15 @@ static int trx_if_cmd_poweron(struct trx_instance *trx)
return osmo_trxc_client_poweron(trx->trxc_client, &trx_poweron_rsp_cb, trx);
}
+static void trx_setformat_cb(struct osmo_trxc_client *client,
+ uint8_t ver_use, void *cb_data)
+{
+ struct trx_instance *trx = cb_data;
+
+ LOGPFSML(trx->fi, LOGL_INFO, "Using TRXD PDU version %u\n", ver_use);
+ osmo_trx_ep_set_pdu_ver(trx->ep, 0, ver_use);
+}
+
static int trx_if_cmd_setslot(struct trx_instance *trx,
const struct trxcon_phyif_cmdp_setslot *cmdp)
{
@@ -400,8 +416,11 @@ static void trx_fsm_allstate_action(struct osmo_fsm_inst *fi, uint32_t event, vo
}
}
-/* No state change here: the POWERON response (see trx_poweron_rsp_cb())
- * is what moves us to TRX_ST_POWERON. */
+/* (Re-)negotiate the TRXD PDU format and send POWERON right behind it,
+ * since the transceiver may have reset its active format back to legacy
+ * on the preceding POWEROFF (or never negotiated it at all, if this is the
+ * very first POWERON). No state change here: the POWERON response (see
+ * trx_poweron_rsp_cb()) is what moves us to TRX_ST_POWERON. */
static void trx_fsm_handle_poweron_req(struct osmo_fsm_inst *fi)
{
struct trx_instance *trx = fi->priv;
@@ -411,6 +430,9 @@ static void trx_fsm_handle_poweron_req(struct osmo_fsm_inst *fi)
return;
}
+ osmo_trxc_client_negotiate_format(trx->trxc_client,
+ TRXD_PDU_VER_MAX,
+ &trx_setformat_cb, trx);
trx_if_cmd_poweron(trx);
}
@@ -488,8 +510,8 @@ void osmo_trx_ep_rx_burst_ind(struct osmo_trx_ep *ep, unsigned int chan,
.tn = bi->tn,
.toa256 = bi->toa256,
.rssi = bi->rssi,
- .burst = &bi->burst[0],
- .burst_len = bi->burst_len,
+ .burst = (bi->flags & OSMO_TRXD_F_NOPE_IND) ? NULL : &bi->burst[0],
+ .burst_len = (bi->flags & OSMO_TRXD_F_NOPE_IND) ? 0 : bi->burst_len,
};
trxcon_phyif_handle_burst_ind(trx->priv, &phybi);
diff --git a/src/host/trxcon/src/trxcon_shim.c b/src/host/trxcon/src/trxcon_shim.c
index ed2d402e..3446f13c 100644
--- a/src/host/trxcon/src/trxcon_shim.c
+++ b/src/host/trxcon/src/trxcon_shim.c
@@ -232,8 +232,16 @@ int trxcon_phyif_handle_burst_ind(void *priv, const struct trxcon_phyif_burst_in
.burst_len = phybi->burst_len,
};
- OSMO_ASSERT(phybi->burst_len <= sizeof(bi.burst));
- memcpy(&bi.burst[0], phybi->burst, phybi->burst_len);
+ if (phybi->burst_len > 0) {
+ OSMO_ASSERT(phybi->burst_len <= sizeof(bi.burst));
+ memcpy(bi.burst, phybi->burst, phybi->burst_len);
+ } else {
+ /* NOPE.ind: the transceiver did not detect a burst for this fn/tn,
+ * but still reports timing/level measurements. Feed the scheduler
+ * with a burst all soft-bits of which are uncertain (50% 0, 50% 1). */
+ bi.burst_len = GSM_NBITS_NB_GMSK_BURST;
+ memset(bi.burst, 0, bi.burst_len);
+ }
/* Poke scheduler */
return l1sched_handle_rx_burst(trxcon->sched, &bi);