From 9b97d0f683bccd71b035ece1a6caebfc0f26d1b1 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 24 Jun 2017 16:50:00 +0200 Subject: TRX: permit transmission of all-zero loopback frames For some reason, osmo-bts-trx attempted to interpret/validate the contents of the downlink TCH block that it was about to transmit. If such checks are made, they should clearly be in the common part above L1SAP, and not in the bts-model specific part. Also, having the checks in place didn't allow us to send an all-zero downlink block, as is required for detection of uplink FER in a loopback testing setup, e.g. with CMU-300. Change-Id: I6388de98e4a7e20843a1be88a58bba8d2c9aa0d5 --- src/osmo-bts-trx/scheduler_trx.c | 35 +++++------------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) (limited to 'src') diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index a9bcbda3..4c3330fa 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -471,42 +471,15 @@ inval_mode1: switch (tch_mode) { case GSM48_CMODE_SPEECH_V1: /* FR / HR */ - if (chan != TRXC_TCHF) { /* HR */ + if (chan != TRXC_TCHF) /* HR */ len = 15; - if (msgb_l2len(msg_tch) >= 1 - && (msg_tch->l2h[0] & 0xf0) != 0x00) { - LOGP(DL1C, LOGL_NOTICE, "%s " - "Transmitting 'bad " - "HR frame' trx=%u ts=%u at " - "fn=%u.\n", - trx_chan_desc[chan].name, - l1t->trx->nr, tn, fn); - goto free_bad_msg; - } - break; - } - len = GSM_FR_BYTES; - if (msgb_l2len(msg_tch) >= 1 - && (msg_tch->l2h[0] >> 4) != 0xd) { - LOGP(DL1C, LOGL_NOTICE, "%s Transmitting 'bad " - "FR frame' trx=%u ts=%u at fn=%u.\n", - trx_chan_desc[chan].name, - l1t->trx->nr, tn, fn); - goto free_bad_msg; - } + else + len = GSM_FR_BYTES; break; case GSM48_CMODE_SPEECH_EFR: /* EFR */ if (chan != TRXC_TCHF) goto inval_mode2; len = GSM_EFR_BYTES; - if (msgb_l2len(msg_tch) >= 1 - && (msg_tch->l2h[0] >> 4) != 0xc) { - LOGP(DL1C, LOGL_NOTICE, "%s Transmitting 'bad " - "EFR frame' trx=%u ts=%u at fn=%u.\n", - trx_chan_desc[chan].name, - l1t->trx->nr, tn, fn); - goto free_bad_msg; - } break; case GSM48_CMODE_SPEECH_AMR: /* AMR */ len = osmo_amr_rtp_dec(msg_tch->l2h, msgb_l2len(msg_tch), @@ -1146,10 +1119,12 @@ bfi: if (lchan->tch.dtx.ul_sid) return 0; /* DTXu: pause in progress */ memset(tch_data, 0, GSM_FR_BYTES); + tch_data[0] = 0xd0; rc = GSM_FR_BYTES; break; case GSM48_CMODE_SPEECH_EFR: /* EFR */ memset(tch_data, 0, GSM_EFR_BYTES); + tch_data[0] = 0xc0; rc = GSM_EFR_BYTES; break; case GSM48_CMODE_SPEECH_AMR: /* AMR */ -- cgit v1.2.3