Review at https://gerrit.osmocom.org/7216
trxcon/sched_lchan_tchf.c: always send traffic indications We shall always send traffic frame indications, even if received frame is incomplete or decoding was failed. This is required for proper Measurement Reporting. Change-Id: I99e134699796c7075299459e96b2f2d462636619 --- M src/host/trxcon/sched_lchan_tchf.c 1 file changed, 29 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/16/7216/1 diff --git a/src/host/trxcon/sched_lchan_tchf.c b/src/host/trxcon/sched_lchan_tchf.c index 25c9b10..80e4d52 100644 --- a/src/host/trxcon/sched_lchan_tchf.c +++ b/src/host/trxcon/sched_lchan_tchf.c @@ -49,8 +49,8 @@ sbit_t *bits, int8_t rssi, int16_t toa256) { const struct trx_lchan_desc *lchan_desc; + int n_errors = -1, n_bits_total, rc; uint8_t rsl_cmode, tch_mode, mode; - int n_errors, n_bits_total, rc; sbit_t *buffer, *offset; uint8_t l2[128], *mask; uint32_t *first_fn; @@ -92,16 +92,6 @@ if (bid != 3) return 0; - /* Check for complete set of bursts */ - if ((*mask & 0xf) != 0xf) { - LOGP(DSCHD, LOGL_ERROR, "Received incomplete traffic frame at " - "fn=%u (%u/%u) for %s\n", *first_fn, - (*first_fn) % ts->mf_layout->period, - ts->mf_layout->period, - lchan_desc->name); - return -EINVAL; - } - /** * Get current RSL / TCH modes * @@ -110,6 +100,18 @@ */ rsl_cmode = RSL_CMOD_SPD_SPEECH; tch_mode = lchan->tch_mode; + + /* Check for complete set of bursts */ + if ((*mask & 0xf) != 0xf) { + LOGP(DSCHD, LOGL_ERROR, "Received incomplete traffic frame at " + "fn=%u (%u/%u) for %s\n", *first_fn, + (*first_fn) % ts->mf_layout->period, + ts->mf_layout->period, + lchan_desc->name); + + /* Send BFI */ + goto bfi; + } mode = rsl_cmode != RSL_CMOD_SPD_SPEECH ? GSM48_CMODE_SPEECH_V1 : tch_mode; @@ -144,25 +146,35 @@ LOGP(DSCHD, LOGL_ERROR, "Received bad TCH frame ending at " "fn=%u for %s\n", fn, lchan_desc->name); - l2_len = sched_bad_frame_ind(l2, rsl_cmode, tch_mode); + /* Send BFI */ + goto bfi; } else if (rc == GSM_MACBLOCK_LEN) { /* FACCH received, forward it to the higher layers */ sched_send_dt_ind(trx, ts, lchan, l2, GSM_MACBLOCK_LEN, n_errors, false, false); /* Send BFI instead of stolen TCH frame */ - l2_len = sched_bad_frame_ind(l2, rsl_cmode, tch_mode); + goto bfi; } else { /* A good TCH frame received */ l2_len = rc; } /* Send a traffic frame to the higher layers */ - if (l2_len > 0) - sched_send_dt_ind(trx, ts, lchan, l2, l2_len, - n_errors, rc < 4, true); + return sched_send_dt_ind(trx, ts, lchan, l2, l2_len, + n_errors, false, true); - return 0; +bfi: + /* Bad frame indication */ + l2_len = sched_bad_frame_ind(l2, rsl_cmode, tch_mode); + + /* Didn't try to decode */ + if (n_errors < 0) + n_errors = 116 * 4; + + /* Send a BFI frame to the higher layers */ + return sched_send_dt_ind(trx, ts, lchan, l2, l2_len, + n_errors, true, true); } int tx_tchf_fn(struct trx_instance *trx, struct trx_ts *ts, -- To view, visit https://gerrit.osmocom.org/7216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I99e134699796c7075299459e96b2f2d462636619 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: fixeria/trx Gerrit-Owner: Vadim Yanitskiy <axilira...@gmail.com>