fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/43829?usp=email )
(
3 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: trxcon/trx_if: negotiate TRXD PDU version 1 (TRXDv1) ......................................................................
trxcon/trx_if: negotiate TRXD PDU version 1 (TRXDv1)
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 --- M src/host/trxcon/src/trx_if.c M src/host/trxcon/src/trxcon_shim.c 2 files changed, 36 insertions(+), 6 deletions(-)
Approvals: Jenkins Builder: Verified osmith: Looks good to me, approved pespin: Looks good to me, but someone else must approve
diff --git a/src/host/trxcon/src/trx_if.c b/src/host/trxcon/src/trx_if.c index a974b46..bbbc93f 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 @@ 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 @@ } }
-/* 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 @@ 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 @@ .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 ed2d402..3446f13 100644 --- a/src/host/trxcon/src/trxcon_shim.c +++ b/src/host/trxcon/src/trxcon_shim.c @@ -232,8 +232,16 @@ .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);