From 12357a7d37ccfbf9fddb1a5833826ac7460b1f94 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Mon, 2 Mar 2020 03:29:47 +0700 Subject: [PATCH] trxcon/scheduler: FACCH: ensure fake measurements for BFI According to 3GPP TS 45.003, clauses 4.2.5 and 4.3.5: - one FACCH/F frame steals a single speech frame, - one FACCH/H frame steals two speech frames. A BFI (Bad Frame Indication) needs to be sent for each stolen speech frame. This does not apply to CSD (data) channels though. The BFI frames must have measurement data attached to them, and due to their virtual nature (they do not actually come from the air interface), the measurements must be crafted by trxcon. Assigning a negative value to n_errors makes the code below the 'bfi' label craft fake measurement data. Otherwise, the actual measurements belonging to the FACCH frame will be used. Change-Id: Ia2f7c3cf7b1ef3737da6b1818cae2f001ee8768f --- src/host/trxcon/sched_lchan_tchf.c | 3 ++- src/host/trxcon/sched_lchan_tchh.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/host/trxcon/sched_lchan_tchf.c b/src/host/trxcon/sched_lchan_tchf.c index d2cf030ec..788d1532b 100644 --- a/src/host/trxcon/sched_lchan_tchf.c +++ b/src/host/trxcon/sched_lchan_tchf.c @@ -136,7 +136,8 @@ int rx_tchf_fn(struct trx_instance *trx, struct trx_ts *ts, sched_send_dt_ind(trx, ts, lchan, l2, GSM_MACBLOCK_LEN, n_errors, false, false); - /* Send BFI instead of stolen TCH frame */ + /* Send BFI substituting a stolen TCH frame */ + n_errors = -1; /* ensure fake measurements */ goto bfi; } else { /* A good TCH frame received */ diff --git a/src/host/trxcon/sched_lchan_tchh.c b/src/host/trxcon/sched_lchan_tchh.c index 599dd2046..013dba94d 100644 --- a/src/host/trxcon/sched_lchan_tchh.c +++ b/src/host/trxcon/sched_lchan_tchh.c @@ -315,7 +315,8 @@ int rx_tchh_fn(struct trx_instance *trx, struct trx_ts *ts, sched_send_dt_ind(trx, ts, lchan, l2, GSM_MACBLOCK_LEN, n_errors, false, false); - /* 1/2 BFI */ + /* Send BFI substituting 1/2 stolen TCH frames */ + n_errors = -1; /* ensure fake measurements */ goto bfi; } else { /* A good TCH frame received */