aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/amr.c
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2016-06-17 13:10:38 +0200
committerHarald Welte <laforge@gnumonks.org>2016-06-18 11:35:12 +0000
commit61372a20de695a151611753689ee9a3018b101f6 (patch)
tree7b1b1e69c4c79262eb03806da79457d59cf98020 /src/common/amr.c
parentc3fb0dcc8cd01a84942d06267003478b972feadb (diff)
Move copy-pasted code into common part
Diffstat (limited to 'src/common/amr.c')
-rw-r--r--src/common/amr.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/common/amr.c b/src/common/amr.c
index 80c5fb62..56ed4302 100644
--- a/src/common/amr.c
+++ b/src/common/amr.c
@@ -22,6 +22,15 @@ void amr_log_mr_conf(int ss, int logl, const char *pfx,
LOGPC(ss, logl, "\n");
}
+int get_amr_mode_idx(const struct amr_multirate_conf *amr_mrc, uint8_t cmi)
+{
+ unsigned int i;
+ for (i = 0; i < amr_mrc->num_modes; i++) {
+ if (amr_mrc->bts_mode[i].mode == cmi)
+ return i;
+ }
+ return -EINVAL;
+}
/* parse a GSM 04.08 MultiRate Config IE (10.5.2.21aa) in a more
* comfortable internal data structure */