diff options
author | Sylvain Munaut <tnt@246tNt.com> | 2019-03-07 16:32:02 +0100 |
---|---|---|
committer | tnt <tnt@246tNt.com> | 2019-03-14 08:31:58 +0000 |
commit | 4d3a21269b25e7164a94fa8ce3ad67ff80904aee (patch) | |
tree | 3542ca15253e0519e6801474ca224640566f7392 /src/osmo-bsc/codec_pref.c | |
parent | a58e10c1b62c9b757a37697da3d986e3e0d0e9de (diff) |
assignment_fsm: Properly support assigning signalling mode TCH/x
To support the 3 possible preferences, the changes needed were:
- Replace 'full_rate' bool with a 3 option enum to represent
the channels types for signalling
- Switch from _pref/_alt to using an array sorted in preference
order
Change-Id: I4c7499c8c866ea3ff7b1327edb3615d003d927d3
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Diffstat (limited to 'src/osmo-bsc/codec_pref.c')
-rw-r--r-- | src/osmo-bsc/codec_pref.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/osmo-bsc/codec_pref.c b/src/osmo-bsc/codec_pref.c index a94d6a834..659853ce8 100644 --- a/src/osmo-bsc/codec_pref.c +++ b/src/osmo-bsc/codec_pref.c @@ -281,6 +281,7 @@ int match_codec_pref(struct channel_mode_and_rate *ch_mode_rate, { unsigned int i; uint8_t perm_spch; + bool full_rate; bool match = false; const struct gsm0808_speech_codec *sc_match = NULL; uint16_t amr_s15_s0_supported; @@ -295,15 +296,16 @@ int match_codec_pref(struct channel_mode_and_rate *ch_mode_rate, perm_spch = audio_support_to_gsm88(msc->audio_support[i]); /* Determine if the result is a half or full rate codec */ - rc = full_rate_from_perm_spch(&ch_mode_rate->full_rate, perm_spch); + rc = full_rate_from_perm_spch(&full_rate, perm_spch); if (rc < 0) return -EINVAL; + ch_mode_rate->chan_rate = full_rate ? CH_RATE_FULL : CH_RATE_HALF; /* If we have a preference for FR or HR in our request, we * discard the potential match */ - if (rate_pref == RATE_PREF_HR && ch_mode_rate->full_rate) + if (rate_pref == RATE_PREF_HR && ch_mode_rate->chan_rate == CH_RATE_FULL) continue; - if (rate_pref == RATE_PREF_FR && !ch_mode_rate->full_rate) + if (rate_pref == RATE_PREF_FR && ch_mode_rate->chan_rate == CH_RATE_HALF) continue; /* Check this permitted speech value against the BTS specific parameters. @@ -321,8 +323,8 @@ int match_codec_pref(struct channel_mode_and_rate *ch_mode_rate, /* Exit without result, in case no match can be deteched */ if (!match) { - ch_mode_rate->full_rate = false; ch_mode_rate->chan_mode = GSM48_CMODE_SIGN; + ch_mode_rate->chan_rate = CH_RATE_SDCCH; ch_mode_rate->s15_s0 = 0; return -1; } |