aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-trx/loops.h
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2019-11-14 15:37:16 +0100
committerfixeria <axilirator@gmail.com>2019-11-20 13:35:02 +0000
commit5c5ad3cb4afb131ce32cdc857899540c51aab604 (patch)
treef541e63f67984dc5d2fc1c04408e8fc6bcb7dea9 /src/osmo-bts-trx/loops.h
parentae5e1d7110f1c87a0c4458cba47149b18f4ed2b6 (diff)
scheduler_trx.c: avoid division by zero when calculating BER
There is theoretical risk that when calculating the BER that a division by zero occurrs. Lets add a check to avoid n_errors / n_bits_total when n_bits_total is zero. Change-Id: I1c0731b9a60be4b8c0c84b85b4403168120ceacd Fixes: CID#205696
Diffstat (limited to 'src/osmo-bts-trx/loops.h')
-rw-r--r--src/osmo-bts-trx/loops.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/osmo-bts-trx/loops.h b/src/osmo-bts-trx/loops.h
index 78699031..978cb7ec 100644
--- a/src/osmo-bts-trx/loops.h
+++ b/src/osmo-bts-trx/loops.h
@@ -22,7 +22,8 @@ void trx_loop_sacch_clock(struct l1sched_trx *l1t, uint8_t chan_nr,
struct l1sched_chan_state *chan_state);
void trx_loop_amr_input(struct l1sched_trx *l1t, uint8_t chan_nr,
- struct l1sched_chan_state *chan_state, float ber);
+ struct l1sched_chan_state *chan_state,
+ int n_errors, int n_bits_total);
void trx_loop_amr_set(struct l1sched_chan_state *chan_state, int loop);