aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/lchan_select.c
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2019-03-07 16:32:02 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2019-05-03 16:10:33 +0200
commitaa82492ad6d6011b4e8026086cdc0fd837153808 (patch)
tree12a2e0d7d6bbd561170f4954ce8f6fda5f2ec01c /src/osmo-bsc/lchan_select.c
parentf14aaa4ba1a744d74d431344e23932214bc42a08 (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/lchan_select.c')
-rw-r--r--src/osmo-bsc/lchan_select.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/osmo-bsc/lchan_select.c b/src/osmo-bsc/lchan_select.c
index 0f4dd6527..0a9752e44 100644
--- a/src/osmo-bsc/lchan_select.c
+++ b/src/osmo-bsc/lchan_select.c
@@ -128,22 +128,31 @@ _lc_find_bts(struct gsm_bts *bts, enum gsm_phys_chan_config pchan)
}
struct gsm_lchan *lchan_select_by_chan_mode(struct gsm_bts *bts,
- enum gsm48_chan_mode chan_mode, bool full_rate)
+ enum gsm48_chan_mode chan_mode, enum channel_rate chan_rate)
{
enum gsm_chan_t type;
switch (chan_mode) {
case GSM48_CMODE_SIGN:
- type = GSM_LCHAN_SDCCH;
+ switch (chan_rate) {
+ case CH_RATE_SDCCH: type = GSM_LCHAN_SDCCH; break;
+ case CH_RATE_HALF: type = GSM_LCHAN_TCH_H; break;
+ case CH_RATE_FULL: type = GSM_LCHAN_TCH_F; break;
+ default: return NULL;
+ }
break;
case GSM48_CMODE_SPEECH_EFR:
/* EFR works over FR channels only */
- if (!full_rate)
+ if (chan_rate != CH_RATE_FULL)
return NULL;
/* fall through */
case GSM48_CMODE_SPEECH_V1:
case GSM48_CMODE_SPEECH_AMR:
- type = full_rate ? GSM_LCHAN_TCH_F : GSM_LCHAN_TCH_H;
+ switch (chan_rate) {
+ case CH_RATE_HALF: type = GSM_LCHAN_TCH_H; break;
+ case CH_RATE_FULL: type = GSM_LCHAN_TCH_F; break;
+ default: return NULL;
+ }
break;
default:
return NULL;