blob: adefe0473d7f08df6846b367b7820de1cf7e5dfc [file] [log] [blame]
Philipp Maier844876f2018-07-13 09:17:07 +02001#pragma once
2
Neels Hofmeyr31f525e2018-05-14 18:14:15 +02003#include <stdbool.h>
4#include <osmocom/gsm/protocol/gsm_04_08.h>
Philipp Maier5bc43cd2018-07-13 16:14:18 +02005
Neels Hofmeyr31f525e2018-05-14 18:14:15 +02006struct gsm0808_channel_type;
7struct gsm0808_speech_codec_list;
8struct gsm_audio_support;
9struct bts_codec_conf;
Philipp Maier67e47c62018-09-13 12:05:51 +020010struct bsc_msc_data;
11struct gsm_bts;
Philipp Maierbb66d102019-01-22 11:29:06 +010012struct channel_mode_and_rate;
Neels Hofmeyr31f525e2018-05-14 18:14:15 +020013
Philipp Maierbb66d102019-01-22 11:29:06 +010014enum rate_pref {
15 RATE_PREF_NONE,
16 RATE_PREF_HR,
17 RATE_PREF_FR,
18};
19
20int match_codec_pref(struct channel_mode_and_rate *ch_mode_rate,
Neels Hofmeyr31f525e2018-05-14 18:14:15 +020021 const struct gsm0808_channel_type *ct,
22 const struct gsm0808_speech_codec_list *scl,
Philipp Maierc9a4f692018-09-21 14:21:50 +020023 const struct bsc_msc_data *msc,
Philipp Maierbb66d102019-01-22 11:29:06 +010024 const struct gsm_bts *bts, enum rate_pref rate_pref);
Philipp Maier67e47c62018-09-13 12:05:51 +020025
26void gen_bss_supported_codec_list(struct gsm0808_speech_codec_list *scl,
27 const struct bsc_msc_data *msc,
28 const struct gsm_bts *bts);
Philipp Maierb5208d42018-10-05 14:59:37 +020029
Philipp Maierbca82ed2018-10-23 16:05:13 +020030int calc_amr_rate_intersection(struct gsm48_multi_rate_conf *c,
31 const struct gsm48_multi_rate_conf *b,
32 const struct gsm48_multi_rate_conf *a);
33
Philipp Maierb5208d42018-10-05 14:59:37 +020034int check_codec_pref(struct llist_head *mscs);