From bb66d1095bdbe2c8eceaa9ea32d3c64cdfc835a9 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Tue, 22 Jan 2019 11:29:06 +0100 Subject: assignment_fsm: fix channel allocator preferences When the MSC allocates a channel through the ASSIGNMENT REQUEST, it may ask for a TCH/H and a TCH/F at the same time and tell which of the two types it prefers. The process of channel allocation currently selects, based on the BTS, MSC and MS capabilites exactly one apropriate codec/rate (e.g. TCH/H) and then tries to allocate it. If that allocation fails, there is no way to try the second choice and the assignment fails. For example: The MSC asks for TCH/F and TCH/H, prefering TCH/F, then the channel allocator will try TCH/F and if it fails (all TCH/F are currently in use), then TCH/H is never tried. Since the BSC currently only trys the first best codec/rate that is supported it also ignores the preference. Lets fix those problems by including the preference information and both possible codec/rate settings into the channel allocation decision. Change-Id: I5239e05c1cfbcb8af28f43373a58fa6c2d216c51 Related: OS#3503 --- include/osmocom/bsc/gsm_data.h | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'include/osmocom/bsc/gsm_data.h') diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index f6c5129c9..4d27a2ec2 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -99,6 +99,12 @@ enum subscr_sccp_state { SUBSCR_SCCP_ST_CONNECTED }; +struct channel_mode_and_rate { + enum gsm48_chan_mode chan_mode; + bool full_rate; + uint16_t s15_s0; +}; + /* Information retrieved during an Assignment Request from the MSC. This is storage of the Assignment instructions * parsed from the Assignment Request message, to pass on until the gscon and assignment FSMs have decided whether an * Assignment is actually going to be carried out. Should remain unchanged after initial decoding. */ @@ -110,9 +116,12 @@ struct assignment_request { char msc_rtp_addr[INET_ADDRSTRLEN]; uint16_t msc_rtp_port; - enum gsm48_chan_mode chan_mode; - bool full_rate; - uint16_t s15_s0; + /* 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; }; /* State of an ongoing Assignment, while the assignment_fsm is still busy. This serves as state separation to keep the @@ -629,6 +638,13 @@ struct gsm_lchan { struct gsm48_req_ref *rqd_ref; struct gsm_subscriber_connection *conn; + + /* Depending on the preferences that where submitted together with + * the assignment and the current channel load, the BSC has to select + * one of the offered codec/rates. The final selection by the BSC is + * stored here and is used when sending the assignment complete or + * when performing a handover procedure. */ + struct channel_mode_and_rate ch_mode_rate; }; /* One Timeslot in a TRX */ -- cgit v1.2.3