From 18bc06eeb62a60f7fc9723a8b5d8bf4d6d006cac Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Thu, 6 Jul 2023 10:59:57 +0200 Subject: csd_bs_list_to_gsm0808_channel_type: add T 300 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is no GSM0808_DATA_RATE_TRANSP_300 (not in libosmocore and not in 3GPP TS 48.008 ยง 3.2.11 on which the enum is based). As I understand it, we need to use GSM0808_DATA_RATE_TRANSP_600 and half rate TCH. As pointed out in review, either TCH/H2.4 or TCH/F2.4 would work, so use GSM0808_DATA_FULL_PREF. It was also considered using FULL_PREF for other rates below 9600, but while it is technically possible we are not setting it here as TCH/F provides so much more redundancy and hence robustness. Use GSM0808_DATA_FULL_BM instead of GSM0808_SPEECH_FULL_BM. The value is 0x8 for both, but this is the correct name. Related: OS#4394 Change-Id: I7297cc481fbe36355b5231ca800cf566a1ee93c0 --- src/libmsc/csd_bs.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/libmsc/csd_bs.c b/src/libmsc/csd_bs.c index 967bd6dce..4f67f513d 100644 --- a/src/libmsc/csd_bs.c +++ b/src/libmsc/csd_bs.c @@ -180,16 +180,23 @@ const char *csd_bs_to_str(enum csd_bs bs) return csd_bs_to_str_c(OTC_SELECT, bs); } -static int csd_bs_to_gsm0808_data_rate_transp(enum csd_bs bs) +static int csd_bs_to_gsm0808_data_rate_transp(enum csd_bs bs, uint8_t *ch_rate_type) { switch (bs_map[bs].rate) { + case 300: + *ch_rate_type = GSM0808_DATA_FULL_PREF; + return GSM0808_DATA_RATE_TRANSP_600; case 1200: + *ch_rate_type = GSM0808_DATA_FULL_BM; return GSM0808_DATA_RATE_TRANSP_1k2; case 2400: + *ch_rate_type = GSM0808_DATA_FULL_BM; return GSM0808_DATA_RATE_TRANSP_2k4; case 4800: + *ch_rate_type = GSM0808_DATA_FULL_BM; return GSM0808_DATA_RATE_TRANSP_4k8; case 9600: + *ch_rate_type = GSM0808_DATA_FULL_BM; return GSM0808_DATA_RATE_TRANSP_9k6; } return -EINVAL; @@ -375,9 +382,10 @@ int csd_bs_list_to_gsm0808_channel_type(struct gsm0808_channel_type *ct, const s if (csd_bs_is_transp(list->bs[0])) { ct->data_transparent = true; - rc = csd_bs_to_gsm0808_data_rate_transp(list->bs[0]); + rc = csd_bs_to_gsm0808_data_rate_transp(list->bs[0], &ct->ch_rate_type); } else { rc = csd_bs_to_gsm0808_data_rate_non_transp(list->bs[0]); + ct->ch_rate_type = GSM0808_DATA_FULL_BM; } if (rc < 0) @@ -404,8 +412,6 @@ int csd_bs_list_to_gsm0808_channel_type(struct gsm0808_channel_type *ct, const s ct->data_rate_allowed_is_set = true; } - ct->ch_rate_type = GSM0808_SPEECH_FULL_BM; - return 0; } -- cgit v1.2.3