aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2023-07-06 10:59:57 +0200
committerOliver Smith <osmith@sysmocom.de>2023-07-18 09:45:46 +0200
commit18bc06eeb62a60f7fc9723a8b5d8bf4d6d006cac (patch)
treeaca53f76a1251698cecc0052d77cf9d6f860a92b
parentf7c6f1424fc907096bb99a25f99564f663b112e0 (diff)
csd_bs_list_to_gsm0808_channel_type: add T 300osmith/wip-csd
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
-rw-r--r--src/libmsc/csd_bs.c14
1 files 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;
}