summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2018-08-17 08:48:29 +0700
committerHarald Welte <laforge@gnumonks.org>2018-09-15 07:51:52 +0000
commit60da22a67b228b9f07a2765ae25acdc08d2d6747 (patch)
tree26249cafc849692c1676eda61a9b7aaa6b099e84 /src
parent909c86df29b2018fe602438f90e2d56e3bde48e1 (diff)
trxcon/scheduler: fix: don't send BFI in GSM48_CMODE_SIGN mode
GSM48_CMODE_SIGN means 'signaling only', so we shall not send bad frame indications in this state. Instead, it makes sense to send dummy L2 frames like we do for xCCH channels. Change-Id: Ie39d53522cafab265099076b3194fa96aff217ba
Diffstat (limited to 'src')
-rw-r--r--src/host/trxcon/sched_lchan_common.c4
-rw-r--r--src/host/trxcon/sched_lchan_tchf.c11
2 files changed, 11 insertions, 4 deletions
diff --git a/src/host/trxcon/sched_lchan_common.c b/src/host/trxcon/sched_lchan_common.c
index 2767b90d..95e496b2 100644
--- a/src/host/trxcon/sched_lchan_common.c
+++ b/src/host/trxcon/sched_lchan_common.c
@@ -145,7 +145,6 @@ int sched_send_dt_conf(struct trx_instance *trx, struct trx_ts *ts,
size_t sched_bad_frame_ind(uint8_t *l2, struct trx_lchan_state *lchan)
{
switch (lchan->tch_mode) {
- case GSM48_CMODE_SIGN:
case GSM48_CMODE_SPEECH_V1:
if (lchan->type == TRXC_TCHF) { /* Full Rate */
memset(l2, 0x00, GSM_FR_BYTES);
@@ -163,6 +162,9 @@ size_t sched_bad_frame_ind(uint8_t *l2, struct trx_lchan_state *lchan)
case GSM48_CMODE_SPEECH_AMR: /* Adaptive Multi Rate */
/* FIXME: AMR is not implemented yet */
return 0;
+ case GSM48_CMODE_SIGN:
+ LOGP(DSCH, LOGL_ERROR, "BFI is not allowed in signalling mode\n");
+ return 0;
default:
LOGP(DSCH, LOGL_ERROR, "Invalid TCH mode: %u\n", lchan->tch_mode);
return 0;
diff --git a/src/host/trxcon/sched_lchan_tchf.c b/src/host/trxcon/sched_lchan_tchf.c
index f6465f9b..09d504f8 100644
--- a/src/host/trxcon/sched_lchan_tchf.c
+++ b/src/host/trxcon/sched_lchan_tchf.c
@@ -151,13 +151,18 @@ int rx_tchf_fn(struct trx_instance *trx, struct trx_ts *ts,
n_errors, false, true);
bfi:
- /* Bad frame indication */
- l2_len = sched_bad_frame_ind(l2, lchan);
-
/* Didn't try to decode */
if (n_errors < 0)
n_errors = 116 * 4;
+ /* BFI is not applicable in signalling mode */
+ if (lchan->tch_mode == GSM48_CMODE_SIGN)
+ return sched_send_dt_ind(trx, ts, lchan, NULL, 0,
+ n_errors, true, false);
+
+ /* Bad frame indication */
+ l2_len = sched_bad_frame_ind(l2, lchan);
+
/* Send a BFI frame to the higher layers */
return sched_send_dt_ind(trx, ts, lchan, l2, l2_len,
n_errors, true, true);