Philipp Maier | 844876f | 2018-07-13 09:17:07 +0200 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Neels Hofmeyr | 31f525e | 2018-05-14 18:14:15 +0200 | [diff] [blame] | 3 | #include <stdbool.h> |
| 4 | #include <osmocom/gsm/protocol/gsm_04_08.h> |
Philipp Maier | 5bc43cd | 2018-07-13 16:14:18 +0200 | [diff] [blame] | 5 | |
Neels Hofmeyr | 31f525e | 2018-05-14 18:14:15 +0200 | [diff] [blame] | 6 | struct gsm0808_channel_type; |
| 7 | struct gsm0808_speech_codec_list; |
| 8 | struct gsm_audio_support; |
| 9 | struct bts_codec_conf; |
Philipp Maier | 67e47c6 | 2018-09-13 12:05:51 +0200 | [diff] [blame] | 10 | struct bsc_msc_data; |
| 11 | struct gsm_bts; |
Philipp Maier | bb66d10 | 2019-01-22 11:29:06 +0100 | [diff] [blame] | 12 | struct channel_mode_and_rate; |
Neels Hofmeyr | 31f525e | 2018-05-14 18:14:15 +0200 | [diff] [blame] | 13 | |
Philipp Maier | bb66d10 | 2019-01-22 11:29:06 +0100 | [diff] [blame] | 14 | enum rate_pref { |
| 15 | RATE_PREF_NONE, |
| 16 | RATE_PREF_HR, |
| 17 | RATE_PREF_FR, |
| 18 | }; |
| 19 | |
| 20 | int match_codec_pref(struct channel_mode_and_rate *ch_mode_rate, |
Neels Hofmeyr | 31f525e | 2018-05-14 18:14:15 +0200 | [diff] [blame] | 21 | const struct gsm0808_channel_type *ct, |
| 22 | const struct gsm0808_speech_codec_list *scl, |
Philipp Maier | c9a4f69 | 2018-09-21 14:21:50 +0200 | [diff] [blame] | 23 | const struct bsc_msc_data *msc, |
Philipp Maier | bb66d10 | 2019-01-22 11:29:06 +0100 | [diff] [blame] | 24 | const struct gsm_bts *bts, enum rate_pref rate_pref); |
Philipp Maier | 67e47c6 | 2018-09-13 12:05:51 +0200 | [diff] [blame] | 25 | |
| 26 | void 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 Maier | b5208d4 | 2018-10-05 14:59:37 +0200 | [diff] [blame] | 29 | |
Philipp Maier | bca82ed | 2018-10-23 16:05:13 +0200 | [diff] [blame] | 30 | int 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 Maier | b5208d4 | 2018-10-05 14:59:37 +0200 | [diff] [blame] | 34 | int check_codec_pref(struct llist_head *mscs); |