diff options
author | Sylvain Munaut <tnt@246tNt.com> | 2019-03-07 16:32:02 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2019-05-03 16:10:33 +0200 |
commit | aa82492ad6d6011b4e8026086cdc0fd837153808 (patch) | |
tree | 12a2e0d7d6bbd561170f4954ce8f6fda5f2ec01c /src/osmo-bsc/codec_pref.c | |
parent | f14aaa4ba1a744d74d431344e23932214bc42a08 (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
Originally merged as Change-Id I4c7499c8c866ea3ff7b1327edb3615d003d927d3,
reverted because the change broke voice calls. Re-submitting with the fix:
don't forget to set conn->assignment.requires_voice_stream.
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Change-Id: I7513d2cbe8b695ba6f031ad11560c63a6535cf2d
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 3e06114dd..b27defcde 100644 --- a/src/osmo-bsc/codec_pref.c +++ b/src/osmo-bsc/codec_pref.c @@ -324,6 +324,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; int rc; @@ -337,15 +338,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. @@ -375,8 +377,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; } |