fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/15441


Change subject: osmo-bts-trx/scheduler: fix: do not reset ECU with BFI frame
......................................................................

osmo-bts-trx/scheduler: fix: do not reset ECU with BFI frame

BFI (Bad Frame Indication) needs to be sent:

  - when failed to decode a speech (or FACCH) frame, or
  - when decoded frame is FACCH frame (23 octets long),

if the current channel mode is RSL_CMOD_SPD_SPEECH.

Since we (re)use the same buffer as used for non-BFI frames,
we need to avoid resetting the ECU (Error Cancellation Unit)
with a bad frame indication.

We used a boolean flag for that, but it was not set in the
second case - when a FACCH frame is decoded. Let's get rid
of that flag and use 'goto' operator to step over the ECU
resetting code.

Let's also modify rx_tchh_fn(), which does not (yet) deal
with ECU, but most likely will in the future.

Change-Id: I8bdc7483f524006a86ff1fee7cdefafe3db899d8
---
M src/osmo-bts-trx/scheduler_trx.c
1 file changed, 7 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/41/15441/1

diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 57eb138..5b31387 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -1138,7 +1138,6 @@
        uint8_t tch_data[128]; /* just to be safe */
        int rc, amr = 0;
        int n_errors, n_bits_total;
-       bool bfi_flag = false;
        struct gsm_lchan *lchan =
                get_lchan_by_chan_nr(l1t->trx, trx_chan_desc[chan].chan_nr | 
bi->tn);

@@ -1235,14 +1234,12 @@
                LOGL1S(DL1P, LOGL_NOTICE, l1t, bi->tn, chan, bi->fn,
                        "Received bad data (%u/%u)\n",
                        bi->fn % l1ts->mf_period, l1ts->mf_period);
-               bfi_flag = true;
                goto bfi;
        }
        if (rc < 4) {
                LOGL1S(DL1P, LOGL_NOTICE, l1t, bi->tn, chan, bi->fn,
                        "Received bad data (%u/%u) with invalid codec mode 
%d\n",
                        bi->fn % l1ts->mf_period, l1ts->mf_period, rc);
-               bfi_flag = true;
                goto bfi;
        }

@@ -1300,6 +1297,9 @@
                                        "TCH mode %u invalid, please fix!\n", 
tch_mode);
                                return -EINVAL;
                        }
+
+                       /* Step over resetting ECU */
+                       goto compose_l1sap;
                }
        }

@@ -1307,7 +1307,7 @@
                return 0;

        /* Reset ECU with a good frame */
-       if (!bfi_flag && tch_mode == GSM48_CMODE_SPEECH_V1)
+       if (tch_mode == GSM48_CMODE_SPEECH_V1)
                osmo_ecu_fr_reset(&lchan->ecu_state.fr, tch_data);

        /* TCH or BFI */
@@ -1497,6 +1497,9 @@
                                        "TCH mode %u invalid, please fix!\n", 
tch_mode);
                                return -EINVAL;
                        }
+
+                       /* Step over resetting ECU */
+                       goto compose_l1sap;
                }
        }


--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/15441
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I8bdc7483f524006a86ff1fee7cdefafe3db899d8
Gerrit-Change-Number: 15441
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <[email protected]>
Gerrit-MessageType: newchange

Reply via email to