From aa82492ad6d6011b4e8026086cdc0fd837153808 Mon Sep 17 00:00:00 2001 From: Sylvain Munaut Date: Thu, 7 Mar 2019 16:32:02 +0100 Subject: 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 Change-Id: I7513d2cbe8b695ba6f031ad11560c63a6535cf2d --- include/osmocom/bsc/gsm_data.h | 17 ++++++++++------- include/osmocom/bsc/lchan_select.h | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'include/osmocom') diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index dacc63b15..dc686c366 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -98,9 +98,15 @@ enum subscr_sccp_state { SUBSCR_SCCP_ST_CONNECTED }; +enum channel_rate { + CH_RATE_SDCCH, + CH_RATE_HALF, + CH_RATE_FULL, +}; + struct channel_mode_and_rate { enum gsm48_chan_mode chan_mode; - bool full_rate; + enum channel_rate chan_rate; uint16_t s15_s0; }; @@ -115,12 +121,9 @@ struct assignment_request { char msc_rtp_addr[INET_ADDRSTRLEN]; uint16_t msc_rtp_port; - /* Prefered rate/codec setting (mandatory) */ - struct channel_mode_and_rate ch_mode_rate_pref; - - /* Alternate rate/codec setting (optional) */ - bool ch_mode_rate_alt_present; - struct channel_mode_and_rate ch_mode_rate_alt; + /* Rate/codec setting in preference order (need at least 1 !) */ + int n_ch_mode_rate; + struct channel_mode_and_rate ch_mode_rate[3]; }; /* State of an ongoing Assignment, while the assignment_fsm is still busy. This serves as state separation to keep the diff --git a/include/osmocom/bsc/lchan_select.h b/include/osmocom/bsc/lchan_select.h index 4aecdf676..865181bf5 100644 --- a/include/osmocom/bsc/lchan_select.h +++ b/include/osmocom/bsc/lchan_select.h @@ -3,4 +3,4 @@ struct gsm_lchan *lchan_select_by_type(struct gsm_bts *bts, enum gsm_chan_t type); 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); -- cgit v1.2.3