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
This commit is contained in:
Harald Welte 2017-06-24 16:50:00 +02:00
parent a38d34112f
commit 9b97d0f683
1 changed files with 5 additions and 30 deletions

View File

@ -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 */